Changeset 180
- Timestamp:
- Jul 11, 2017, 1:09:51 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/kmem.c
r159 r180 154 154 cluster_t * cluster = LOCAL_CLUSTER; 155 155 156 // allocate smemory for the requested KCM allocator156 // allocate memory for the requested KCM allocator 157 157 // from the KCM allocator embedded in cluster descriptor 158 158 kcm = kcm_alloc( &cluster->kcm ); … … 165 165 } 166 166 167 // initialize sthe new KCM allocator167 // initialize the new KCM allocator 168 168 kcm_init( kcm , type ); 169 169 … … 200 200 201 201 // analyse request type 202 if( type == KMEM_PAGE )// PPM allocator202 if( type == KMEM_PAGE ) // PPM allocator 203 203 { 204 204 // allocate the number of requested pages 205 205 ptr = (void *)ppm_alloc_pages( size ); 206 if( ptr == NULL ) 207 { 208 printk("\n[ERROR] in %s : failed for type %d / size %d in cluster %x\n", 209 __FUNCTION__ , type , size , local_cxy ); 210 return NULL; 211 } 206 212 207 213 // reset page if requested … … 216 222 // allocate memory from KHM 217 223 ptr = khm_alloc( &cluster->khm , size ); 224 if( ptr == NULL ) 225 { 226 printk("\n[ERROR] in %s : failed for type %d / size %d in cluster %x\n", 227 __FUNCTION__ , type , size , local_cxy ); 228 return NULL; 229 } 218 230 219 231 // reset memory if requested … … 237 249 // allocate memory from KCM 238 250 ptr = kcm_alloc( cluster->kcm_tbl[type] ); 251 if( ptr == NULL ) 252 { 253 printk("\n[ERROR] in %s : failed for type %d / size %d in cluster %x\n", 254 __FUNCTION__ , type , size , local_cxy ); 255 return NULL; 256 } 239 257 240 258 // reset memory if requested … … 246 264 } 247 265 248 if( ptr == NULL )249 {250 printk("\n[ERROR] in %s : failed for type %d / size %d in cluster %x\n",251 __FUNCTION__ , type , size , local_cxy );252 253 return NULL;254 }255 256 266 return ptr; 257 267 }
Note: See TracChangeset
for help on using the changeset viewer.