comparison gsm-fw/gpf/osl/os_mem_fl.c @ 376:754e72d134a0

os_mem_fl.c: os_GetPartitionPoolStatus() done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 09 Jun 2014 04:53:32 +0000
parents 1319bd1d5ac3
children d148403013c0
comparison
equal deleted inserted replaced
375:1319bd1d5ac3 376:754e72d134a0
192 if (!pool) 192 if (!pool)
193 return(0); 193 return(0);
194 } 194 }
195 return (const ULONG *) &pool->pcb; 195 return (const ULONG *) &pool->pcb;
196 } 196 }
197
198 GLOBAL LONG
199 os_GetPartitionPoolStatus(ULONG size, OS_HANDLE gr_hndl,
200 USHORT *m_free, USHORT *m_alloc)
201 {
202 T_OS_PART_POOL *pool;
203 UNSIGNED dummy, allocated, available;
204 CHAR Name[8];
205
206 for (pool = PartGrpTable[gr_hndl].grp_head; pool; pool = pool->next) {
207 if (!size)
208 break;
209 if (size > pool->size)
210 continue;
211 if (NU_Partition_Pool_Information(&pool->pcb, Name,
212 (VOID **)&dummy, &dummy,
213 &dummy, &available,
214 &allocated, (OPTION *)&dummy,
215 &dummy, (NU_TASK **)&dummy)
216 != NU_SUCCESS)
217 break;
218 *m_alloc = allocated;
219 *m_free = available;
220 return(OS_OK);
221 }
222 *m_alloc = 0;
223 *m_free = 0;
224 return(OS_ERROR);
225 }