lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #47092] Tag memory buffers like memp_memory_xxx and ra


From: David Fernandez
Subject: [lwip-devel] [bug #47092] Tag memory buffers like memp_memory_xxx and ram_heap with a macro so that attributes can be attached to teir definitions
Date: Mon, 08 Feb 2016 16:23:26 +0000
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0

URL:
  <http://savannah.nongnu.org/bugs/?47092>

                 Summary: Tag memory buffers like memp_memory_xxx and ram_heap
with a macro so that attributes can be attached to teir definitions
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: david0fc
            Submitted on: Mon 08 Feb 2016 16:23:25 GMT
                Category: Platform ports
                Severity: 3 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: git head

    _______________________________________________________

Details:

In a similar way as it is done for alignment, sometimes, build systems and
platforms have to, or would benefit from, putting memory pools and heaps in a
special section.

So what is requested here is to have a configuration option to specify
attributes for those definitions and/or declarations, or specific
configuration options to specify a section, and also an oveeride of a weak
symbol e.g. __asm__("<symbol-to-override>").

Despit this might seem not that necessary for ram_heap, it is when you
consider than LWIP_RAW_HEAP_POINTER won't have easy access to MEM_SIZE
definition if you don't want to modify the lwIP codebase.

Currently I do this in cc.h:

+/* Rather than using LWIP_RAW_HEAP_POINTER, force the default lwIP heap to
go
+ * into our .extra section and override our default __heap_start.
+ * That will provide the configured heap size to be taken into account for
the
+ * sizewatch.pl script in our build system. */
+#include <mc/mem_layout.h>
+extern u8_t ram_heap[] __asm__("__heap_start")
__attribute__((section(".heap")));
+

so that I could still use MEM_SIZE and the alignment options and macros as
they are in mem.c

For the memory pools I have to resort to -include<special-hdr.h> for lwIP,
with:

#ifndef MEMP_EXTRA_H
#define MEMP_EXTRA_H

/* Non orthodox way to put all pools in .extra section... as there is no
 * abstraction defined to tag them seamlessly. */

#include <mc/mem_layout.h>

#include "lwip/opt.h"
#include "lwip/memp.h"
#define LWIP_MEMPOOL_TOSECTION(name,num,size,desc) 
extern u8_t memp_memory_ ## name ## _base[] EXTRA_DATA_SECTION("");
#define LWIP_MEMPOOL(name,num,size,desc) 
LWIP_MEMPOOL_TOSECTION(name,num,size,desc)
#include "lwip/priv/memp_std.h"

#endif/*MEMP_EXTRA_H*/

which is not that good either.

As an example, ecOS has a tagging macro to define attributes for stack
definitions... something similar could be done here.




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?47092>

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




reply via email to

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