comparison gsm-fw/gpf/osl/os_mem_fl.c @ 377:d148403013c0

os_mem_fl.c: os_GetPartitionGroupHandle() done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 09 Jun 2014 05:08:11 +0000
parents 754e72d134a0
children c82d093a2b89
comparison
equal deleted inserted replaced
376:754e72d134a0 377:d148403013c0
70 UNSIGNED Available; 70 UNSIGNED Available;
71 UNSIGNED Waiting; 71 UNSIGNED Waiting;
72 UNSIGNED Allocated; 72 UNSIGNED Allocated;
73 VOID *pStartAddress; 73 VOID *pStartAddress;
74 NU_TASK *First; 74 NU_TASK *First;
75 CHAR Name[8]; 75 CHAR Name[NU_MAX_NAME];
76 76
77 if (os_GetPartitionPoolEntry(Handle, &pool) == OS_ERROR) 77 if (os_GetPartitionPoolEntry(Handle, &pool) == OS_ERROR)
78 return(OS_ERROR); 78 return(OS_ERROR);
79 if (NU_Partition_Pool_Information(&pool->pcb, Name, &pStartAddress, 79 if (NU_Partition_Pool_Information(&pool->pcb, Name, &pStartAddress,
80 &PoolSize, &PartitionSize, &Available, 80 &PoolSize, &PartitionSize, &Available,
116 OS_HANDLE Handle; 116 OS_HANDLE Handle;
117 OPTION SuspendType; 117 OPTION SuspendType;
118 UNSIGNED Size, Min, Available, Waiting; 118 UNSIGNED Size, Min, Available, Waiting;
119 VOID *pStartAddress; 119 VOID *pStartAddress;
120 NU_TASK *First; 120 NU_TASK *First;
121 CHAR Name[8]; 121 CHAR Name[NU_MAX_NAME];
122 122
123 if (os_GetMemoryPoolEntry(Index, &Handle) == OS_ERROR) 123 if (os_GetMemoryPoolEntry(Index, &Handle) == OS_ERROR)
124 return(OS_ERROR); 124 return(OS_ERROR);
125 if (NU_Memory_Pool_Information(MemPoolTable[Handle].pcb, Name, 125 if (NU_Memory_Pool_Information(MemPoolTable[Handle].pcb, Name,
126 &pStartAddress, &Size, &Min, 126 &pStartAddress, &Size, &Min,
199 os_GetPartitionPoolStatus(ULONG size, OS_HANDLE gr_hndl, 199 os_GetPartitionPoolStatus(ULONG size, OS_HANDLE gr_hndl,
200 USHORT *m_free, USHORT *m_alloc) 200 USHORT *m_free, USHORT *m_alloc)
201 { 201 {
202 T_OS_PART_POOL *pool; 202 T_OS_PART_POOL *pool;
203 UNSIGNED dummy, allocated, available; 203 UNSIGNED dummy, allocated, available;
204 CHAR Name[8]; 204 CHAR Name[NU_MAX_NAME];
205 205
206 for (pool = PartGrpTable[gr_hndl].grp_head; pool; pool = pool->next) { 206 for (pool = PartGrpTable[gr_hndl].grp_head; pool; pool = pool->next) {
207 if (!size) 207 if (!size)
208 break; 208 break;
209 if (size > pool->size) 209 if (size > pool->size)
221 } 221 }
222 *m_alloc = 0; 222 *m_alloc = 0;
223 *m_free = 0; 223 *m_free = 0;
224 return(OS_ERROR); 224 return(OS_ERROR);
225 } 225 }
226
227 GLOBAL LONG
228 os_GetPartitionGroupHandle(OS_HANDLE Caller, char *Name, OS_HANDLE *GroupHandle)
229 {
230 int i;
231
232 for (i = 0; i <= MaxPoolGroups; i++) {
233 if (!PartGrpTable[i].grp_head)
234 continue;
235 if (strncmp(Name, PartGrpTable[i].name, RESOURCE_NAMELEN-1))
236 continue;
237 *GroupHandle = i;
238 return(OS_OK);
239 }
240 return(OS_ERROR);
241 }