lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #6822] Patch places memory pools in separate arrays


From: Iordan Neshev
Subject: [lwip-devel] [patch #6822] Patch places memory pools in separate arrays
Date: Fri, 30 Oct 2009 11:19:15 +0000
User-agent: Opera/9.80 (Windows NT 5.1; U; en) Presto/2.2.15 Version/10.00

Follow-up Comment #7, patch #6822 (project lwip):

This post would go to bug #26133, but Bill decided to
move the discussion here (if I understood it right).
(feel free to move the post back in bug #26133, if its
place is not here).

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


    _______________________________________________________

Reply to this item at:

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

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





reply via email to

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