FreeCalypso > hg > fc-magnetite
comparison src/gpf2/osl/os_mem_fl.c @ 493:2e73bbc0648e
OSL: os_mem_fl.c compiles
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 24 Jun 2018 18:59:22 +0000 |
parents | 91e8dac34ada |
children |
comparison
equal
deleted
inserted
replaced
492:10c059efb3d1 | 493:2e73bbc0648e |
---|---|
4 */ | 4 */ |
5 | 5 |
6 /* set of included headers from COFF symtab: */ | 6 /* set of included headers from COFF symtab: */ |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include "gpfconf.h" /* FreeCalypso addition */ | 9 #include "nucleus.h" |
10 #include "../../nucleus/nucleus.h" | |
11 #include "typedefs.h" | 10 #include "typedefs.h" |
12 #include "os.h" | 11 #include "os.h" |
13 #include "gdi.h" | 12 #include "gdi.h" |
14 #include "os_types.h" | 13 #include "os_types.h" |
15 #include "os_glob.h" | 14 #include "os_glob.h" |
257 | 256 |
258 if (Suspend == 0xFFFFFFFF) | 257 if (Suspend == 0xFFFFFFFF) |
259 Suspend = 1; | 258 Suspend = 1; |
260 ret = OS_OK; | 259 ret = OS_OK; |
261 for (;;) { | 260 for (;;) { |
262 sts = NU_Allocate_Memory(MemPoolTable[PoolHandle].pcb, Buffer, | 261 sts = NU_Allocate_Memory(MemPoolTable[PoolHandle].pcb, |
263 Size, Suspend); | 262 (VOID **) Buffer, Size, Suspend); |
264 switch (sts) { | 263 switch (sts) { |
265 case NU_SUCCESS: | 264 case NU_SUCCESS: |
266 return(ret); | 265 return(ret); |
267 case NU_INVALID_SUSPEND: | 266 case NU_INVALID_SUSPEND: |
268 Suspend = 0; | 267 Suspend = 0; |
346 os_ext_pool_handle) != OS_OK) | 345 os_ext_pool_handle) != OS_OK) |
347 goto release_sem_return_err; | 346 goto release_sem_return_err; |
348 sprintf(PoolName, "POOL%1d%1d", part_group + 1, j); | 347 sprintf(PoolName, "POOL%1d%1d", part_group + 1, j); |
349 Size &= ~3; | 348 Size &= ~3; |
350 npool->pool_mem = Addr; | 349 npool->pool_mem = Addr; |
350 #if 0 | |
351 /* | 351 /* |
352 * FreeCalypso: we need to bzero the PM_PCB before calling | 352 * FreeCalypso: in our first-attempt gcc-built firmwares we needed to |
353 * NU_Create_Partition_Pool() to prevent the possibility of | 353 * bzero the PM_PCB before calling NU_Create_Partition_Pool() to |
354 * Nucleus error checker failing the call because the | 354 * prevent the possibility of Nucleus error checker failing the call |
355 * signature word happens to be there already. | 355 * because the signature word happens to be there already. The issue |
356 * arose because we were using "raw" memory sections that weren't | |
357 * zeroed out on boot like standard .bss, but in TI's original | |
358 * architecture everything is zeroed out on boot, so we don't need | |
359 * this additional zeroing here. | |
356 */ | 360 */ |
357 bzero(&npool->pcb, sizeof(NU_PARTITION_POOL)); | 361 bzero(&npool->pcb, sizeof(NU_PARTITION_POOL)); |
362 #endif | |
358 if (NU_Create_Partition_Pool(&npool->pcb, PoolName, npool->pool_mem, | 363 if (NU_Create_Partition_Pool(&npool->pcb, PoolName, npool->pool_mem, |
359 POOL_SIZE(Num, Size), Size + 4, NU_FIFO) | 364 POOL_SIZE(Num, Size), Size + 4, NU_FIFO) |
360 != NU_SUCCESS) | 365 != NU_SUCCESS) |
361 goto release_sem_return_err; | 366 goto release_sem_return_err; |
362 if (!part_group_head) | 367 if (!part_group_head) |
417 if (os_AllocateMemory(OS_NOTASK, | 422 if (os_AllocateMemory(OS_NOTASK, |
418 (T_VOID_STRUCT **) &MemPoolTable[i].pcb, | 423 (T_VOID_STRUCT **) &MemPoolTable[i].pcb, |
419 sizeof(NU_MEMORY_POOL), OS_NO_SUSPEND, | 424 sizeof(NU_MEMORY_POOL), OS_NO_SUSPEND, |
420 os_ext_pool_handle) != OS_OK) | 425 os_ext_pool_handle) != OS_OK) |
421 goto release_sem_return_err; | 426 goto release_sem_return_err; |
427 #if 0 | |
422 /* | 428 /* |
423 * FreeCalypso: we need to bzero the DM_PCB before calling | 429 * FreeCalypso: in our first-attempt gcc-built firmwares we |
430 * needed to bzero the DM_PCB before calling | |
424 * NU_Create_Memory_Pool() to prevent the possibility of | 431 * NU_Create_Memory_Pool() to prevent the possibility of |
425 * Nucleus error checker failing the call because the | 432 * Nucleus error checker failing the call because the signature |
426 * signature word happens to be there already. | 433 * word happens to be there already. The issue arose because |
434 * we were using "raw" memory sections that weren't zeroed out | |
435 * on boot like standard .bss, but in TI's original architecture | |
436 * everything is zeroed out on boot, so we don't need this | |
437 * additional zeroing here. | |
427 */ | 438 */ |
428 bzero(MemPoolTable[i].pcb, sizeof(NU_MEMORY_POOL)); | 439 bzero(MemPoolTable[i].pcb, sizeof(NU_MEMORY_POOL)); |
440 #endif | |
429 } | 441 } |
430 if (NU_Create_Memory_Pool(MemPoolTable[i].pcb, Name, Addr, PoolSize, | 442 if (NU_Create_Memory_Pool(MemPoolTable[i].pcb, Name, Addr, PoolSize, |
431 4, NU_FIFO) != NU_SUCCESS) | 443 4, NU_FIFO) != NU_SUCCESS) |
432 goto release_sem_return_err; | 444 goto release_sem_return_err; |
433 strncpy(MemPoolTable[i].name, Name, RESOURCE_NAMELEN); | 445 strncpy(MemPoolTable[i].name, Name, RESOURCE_NAMELEN); |