99
1010#include "os/os.h"
1111#include "infra/log.h"
12- #include "dccm_alloc.h"
1312
1413#ifdef CONFIG_MEMORY_POOLS_BALLOC_TRACK_OWNER
1514#include "misc/printk.h"
@@ -48,18 +47,19 @@ typedef struct {
4847/** Allocate the memory blocks and tracking variables for each pool */
4948#ifdef CONFIG_MEMORY_POOLS_BALLOC_TRACK_OWNER
5049#define DECLARE_MEMORY_POOL (index , size , count ) \
51- uint8_t mblock_ ## index[count][size] __aligned(4); \
50+ uint8_t mblock_ ## index[count][size] __aligned(4) __attribute__ ((section(".kernelmempool"))) ; \
5251 uint32_t mblock_alloc_track_ ## index[count / BITS_PER_U32 + 1] = { 0 }; \
5352 uint32_t *mblock_owners_ ## index[count] = { 0 };
5453#else
5554#define DECLARE_MEMORY_POOL (index , size , count ) \
56- uint8_t mblock_ ## index[count][size] __aligned(4); \
55+ uint8_t mblock_ ## index[count][size] __aligned(4) __attribute__ ((section(".kernelmempool"))) ; \
5756 uint32_t mblock_alloc_track_ ## index[count / BITS_PER_U32 + \
5857 1] = { 0 };
5958#endif
6059
6160#include "memory_pool_list.def"
6261
62+
6363/** Pool descriptor definition */
6464T_POOL_DESC mpool [] =
6565{
@@ -100,19 +100,21 @@ T_POOL_DESC mpool[] =
100100
101101/** Allocate the memory blocks and tracking variables for each pool */
102102#define DECLARE_MEMORY_POOL (index , size , count ) \
103+ uint8_t mblock_ ## index[count][size] __attribute__ ((section(".kernelmempool"))); \
103104 uint32_t mblock_alloc_track_ ## index[count / BITS_PER_U32 + 1] = { 0 };
104105
105106#include "memory_pool_list.def"
106107
107108
109+
108110/** Pool descriptor definition */
109111T_POOL_DESC mpool [] =
110112{
111113#define DECLARE_MEMORY_POOL (index , size , count ) \
112114 { \
113115/* T_POOL_DESC.track */ mblock_alloc_track_ ## index , \
114- /* T_POOL_DESC.start */ 0 , \
115- /* T_POOL_DESC.end */ 0 , \
116+ /* T_POOL_DESC.start */ ( uint32_t ) mblock_ # # index , \
117+ /* T_POOL_DESC.end */ ( uint32_t ) mblock_ # # index + count * size , \
116118/* T_POOL_DESC.count */ count , \
117119/* T_POOL_DESC.size */ size \
118120 },
@@ -331,6 +333,7 @@ static void print_pool(int method, void *ctx)
331333 */
332334void os_abstraction_init_malloc (void )
333335{
336+ /*
334337 int indx;
335338 uint32_t bufSize;
336339
@@ -339,6 +342,7 @@ void os_abstraction_init_malloc(void)
339342 mpool[indx].start = (uint32_t)dccm_memalign((uint16_t)bufSize);
340343 mpool[indx].end = mpool[indx].start + bufSize;
341344 }
345+ */
342346}
343347
344348/**
0 commit comments