lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #6966] Moving the heap into a user defined section


From: Iordan Neshev
Subject: [lwip-devel] [patch #6966] Moving the heap into a user defined section
Date: Fri, 30 Oct 2009 16:20:14 +0000
User-agent: Opera/9.80 (Windows NT 5.1; U; en) Presto/2.2.15 Version/10.00

URL:
  <http://savannah.nongnu.org/patch/?6966>

                 Summary: Moving the heap into a user defined section
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: iordan_neshev
            Submitted on: Fri 30 Oct 2009 04:20:05 PM GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

This is my suggestion how to move the heap with GCC. 
It does not affect the current code if a section is not defined. 


This should go in mem.c (above the heap declaration) 

/** Defining this allows the heap to be placed in a user-defined 
linker section (e.g. EXTERNAL RAM) */ 

#ifndef HEAP_SECT_PRE 
#define HEAP_SECT_PRE 
#endif /* HEAP_SECT_PRE */ 

/** Defining this allows the heap to be placed in a user-defined 
linker section (e.g. EXTERNAL RAM) */ 

#ifndef HEAP_SECT_POST 
#define HEAP_SECT_POST 
#endif /* HEAP_SECT_POST */ 

mem.c, line 175: change 
static u8_t ram_heap[MEM_SIZE_ALIGNED + (2*SIZEOF_STRUCT_MEM) +
MEM_ALIGNMENT]; 
to 
static HEAP_SECT_PRE u8_t ram_heap[MEM_SIZE_ALIGNED + (2*SIZEOF_STRUCT_MEM) +
MEM_ALIGNMENT] HEAP_SECT_POST; 

We may add a note how to define the section 
/** Place this in cc.h to tell GCC to place the heap in section .externalram:

#define HEAP_SECT_PRE(/POST) _attribute_ ((section (".externalram"))) 
*/ 

Alternatively, the two #ifndef-#define-#endifs can be placed in opt.h. Then
the _atribute_ would go to lwipopts.h

Unfortunately, this is not easily compatible with #pragma-s





    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?6966>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]