|
9 | 9 |
|
10 | 10 | #include "os/os.h"
|
11 | 11 | #include "infra/log.h"
|
| 12 | +#include "dccm_alloc.h" |
12 | 13 |
|
13 | 14 | #ifdef CONFIG_MEMORY_POOLS_BALLOC_TRACK_OWNER
|
14 | 15 | #include "misc/printk.h"
|
@@ -59,7 +60,6 @@ typedef struct {
|
59 | 60 |
|
60 | 61 | #include "memory_pool_list.def"
|
61 | 62 |
|
62 |
| - |
63 | 63 | /** Pool descriptor definition */
|
64 | 64 | T_POOL_DESC mpool[] =
|
65 | 65 | {
|
@@ -100,21 +100,19 @@ T_POOL_DESC mpool[] =
|
100 | 100 |
|
101 | 101 | /** Allocate the memory blocks and tracking variables for each pool */
|
102 | 102 | #define DECLARE_MEMORY_POOL(index, size, count) \
|
103 |
| - uint8_t mblock_ ## index[count][size]; \ |
104 | 103 | uint32_t mblock_alloc_track_ ## index[count / BITS_PER_U32 + 1] = { 0 };
|
105 | 104 |
|
106 | 105 | #include "memory_pool_list.def"
|
107 | 106 |
|
108 | 107 |
|
109 |
| - |
110 | 108 | /** Pool descriptor definition */
|
111 | 109 | T_POOL_DESC mpool [] =
|
112 | 110 | {
|
113 | 111 | #define DECLARE_MEMORY_POOL(index, size, count) \
|
114 | 112 | { \
|
115 | 113 | /* T_POOL_DESC.track */ mblock_alloc_track_ ## index, \
|
116 |
| -/* T_POOL_DESC.start */ (uint32_t)mblock_ ## index, \ |
117 |
| -/* T_POOL_DESC.end */ (uint32_t)mblock_ ## index + count * size, \ |
| 114 | +/* T_POOL_DESC.start */ 0, \ |
| 115 | +/* T_POOL_DESC.end */ 0, \ |
118 | 116 | /* T_POOL_DESC.count */ count, \
|
119 | 117 | /* T_POOL_DESC.size */ size \
|
120 | 118 | },
|
@@ -333,6 +331,14 @@ static void print_pool(int method, void *ctx)
|
333 | 331 | */
|
334 | 332 | void os_abstraction_init_malloc(void)
|
335 | 333 | {
|
| 334 | + int indx; |
| 335 | + uint32_t bufSize; |
| 336 | + |
| 337 | + for (indx=0; indx < NB_MEMORY_POOLS; indx++) { |
| 338 | + bufSize = mpool[indx].count * mpool[indx].size; |
| 339 | + mpool[indx].start = (uint32_t)dccm_memalign((uint16_t)bufSize); |
| 340 | + mpool[indx].end = mpool[indx].start + bufSize; |
| 341 | + } |
336 | 342 | }
|
337 | 343 |
|
338 | 344 | /**
|
|
0 commit comments