# HG changeset patch # User Michael Spacefalcon # Date 1402284680 0 # Node ID 3efb28578dadd136f9dc1f838b268576f3ab2c53 # Parent 5f7d723b934363e2283326c100a86dee16d4f1e6 os_mem_fl.c: os_InitPartitionCheck() done diff -r 5f7d723b9343 -r 3efb28578dad gsm-fw/gpf/osl/os_mem_fl.c --- a/gsm-fw/gpf/osl/os_mem_fl.c Sun Jun 01 00:46:47 2014 +0000 +++ b/gsm-fw/gpf/osl/os_mem_fl.c Mon Jun 09 03:31:20 2014 +0000 @@ -152,3 +152,26 @@ MemPoolTable[0].pcb = &mem_pool_head; return(OS_OK); } + +void +os_InitPartitionCheck(T_OS_PART_POOL *pool) +{ + unsigned **Buffer, offset; + USHORT i, k; + + NU_Allocate_Memory(MemPoolTable[0].pcb, (VOID **) &Buffer, + pool->pcb.pm_available * sizeof(unsigned *), + NU_NO_SUSPEND); + offset = pool->pcb.pm_partition_size / sizeof(unsigned) - 1; + for (i = 0; ; i++) { + if (NU_Allocate_Partition(&pool->pcb, (VOID **)(Buffer + i), + NU_NO_SUSPEND) + != NU_SUCCESS) + break; + Buffer[i][offset] = GUARD_PATTERN; + } + for (k = 0; k < i; k++) + if (NU_Deallocate_Partition(Buffer[k]) != NU_SUCCESS) + break; + NU_Deallocate_Memory(Buffer); +}