9
9
10
10
#include "os/os.h"
11
11
#include "infra/log.h"
12
- #include "dccm_alloc.h"
13
12
14
13
#ifdef CONFIG_MEMORY_POOLS_BALLOC_TRACK_OWNER
15
14
#include "misc/printk.h"
@@ -48,18 +47,19 @@ typedef struct {
48
47
/** Allocate the memory blocks and tracking variables for each pool */
49
48
#ifdef CONFIG_MEMORY_POOLS_BALLOC_TRACK_OWNER
50
49
#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"))) ; \
52
51
uint32_t mblock_alloc_track_ ## index[count / BITS_PER_U32 + 1] = { 0 }; \
53
52
uint32_t *mblock_owners_ ## index[count] = { 0 };
54
53
#else
55
54
#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"))) ; \
57
56
uint32_t mblock_alloc_track_ ## index[count / BITS_PER_U32 + \
58
57
1] = { 0 };
59
58
#endif
60
59
61
60
#include "memory_pool_list.def"
62
61
62
+
63
63
/** Pool descriptor definition */
64
64
T_POOL_DESC mpool [] =
65
65
{
@@ -100,19 +100,21 @@ 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] __attribute__ ((section(".kernelmempool"))); \
103
104
uint32_t mblock_alloc_track_ ## index[count / BITS_PER_U32 + 1] = { 0 };
104
105
105
106
#include "memory_pool_list.def"
106
107
107
108
109
+
108
110
/** Pool descriptor definition */
109
111
T_POOL_DESC mpool [] =
110
112
{
111
113
#define DECLARE_MEMORY_POOL (index , size , count ) \
112
114
{ \
113
115
/* 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 , \
116
118
/* T_POOL_DESC.count */ count , \
117
119
/* T_POOL_DESC.size */ size \
118
120
},
@@ -331,6 +333,7 @@ static void print_pool(int method, void *ctx)
331
333
*/
332
334
void os_abstraction_init_malloc (void )
333
335
{
336
+ /*
334
337
int indx;
335
338
uint32_t bufSize;
336
339
@@ -339,6 +342,7 @@ void os_abstraction_init_malloc(void)
339
342
mpool[indx].start = (uint32_t)dccm_memalign((uint16_t)bufSize);
340
343
mpool[indx].end = mpool[indx].start + bufSize;
341
344
}
345
+ */
342
346
}
343
347
344
348
/**
0 commit comments