comparison gsm-fw/gpf/osl/os_mem_fl.c @ 374:3efb28578dad

os_mem_fl.c: os_InitPartitionCheck() done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 09 Jun 2014 03:31:20 +0000
parents 5f7d723b9343
children 1319bd1d5ac3
comparison
equal deleted inserted replaced
373:5f7d723b9343 374:3efb28578dad
150 PartGrpTable[i].name[0] = 0; 150 PartGrpTable[i].name[0] = 0;
151 } 151 }
152 MemPoolTable[0].pcb = &mem_pool_head; 152 MemPoolTable[0].pcb = &mem_pool_head;
153 return(OS_OK); 153 return(OS_OK);
154 } 154 }
155
156 void
157 os_InitPartitionCheck(T_OS_PART_POOL *pool)
158 {
159 unsigned **Buffer, offset;
160 USHORT i, k;
161
162 NU_Allocate_Memory(MemPoolTable[0].pcb, (VOID **) &Buffer,
163 pool->pcb.pm_available * sizeof(unsigned *),
164 NU_NO_SUSPEND);
165 offset = pool->pcb.pm_partition_size / sizeof(unsigned) - 1;
166 for (i = 0; ; i++) {
167 if (NU_Allocate_Partition(&pool->pcb, (VOID **)(Buffer + i),
168 NU_NO_SUSPEND)
169 != NU_SUCCESS)
170 break;
171 Buffer[i][offset] = GUARD_PATTERN;
172 }
173 for (k = 0; k < i; k++)
174 if (NU_Deallocate_Partition(Buffer[k]) != NU_SUCCESS)
175 break;
176 NU_Deallocate_Memory(Buffer);
177 }