Changeset e45f81a in mainline
- Timestamp:
- 2006-06-26T10:07:05Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7ee0e2f
- Parents:
- 430f12c
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/smp/smp.c
r430f12c re45f81a 62 62 void smp_init(void) 63 63 { 64 int status;65 64 __address l_apic_address, io_apic_address; 66 65 … … 74 73 } 75 74 76 l_apic_address = (__address) frame_alloc _rc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA, &status);77 if ( status != FRAME_OK)75 l_apic_address = (__address) frame_alloc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA); 76 if (!l_apic_address) 78 77 panic("cannot allocate address for l_apic\n"); 79 78 80 io_apic_address = (__address) frame_alloc _rc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA, &status);81 if ( status != FRAME_OK)79 io_apic_address = (__address) frame_alloc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA); 80 if (!io_apic_address) 82 81 panic("cannot allocate address for io_apic\n"); 83 82 -
genarch/src/fb/fb.c
r430f12c re45f81a 389 389 int pages = SIZE2FRAMES(totsize); 390 390 int order; 391 int rc;392 391 if (pages == 1) 393 392 order = 0; … … 395 394 order = fnzb(pages-1)+1; 396 395 397 dbbuffer = frame_alloc _rc(order,FRAME_ATOMIC | FRAME_KA, &rc);396 dbbuffer = frame_alloc(order,FRAME_ATOMIC | FRAME_KA); 398 397 if (!dbbuffer) 399 398 printf("Failed to allocate scroll buffer.\n"); … … 402 401 /* Initialized blank line */ 403 402 blankline = (__u8 *) malloc(ROW_BYTES, FRAME_ATOMIC); 404 ASSERT(blankline); 403 if (!blankline) 404 panic("Failed to allocate blank line for framebuffer."); 405 405 for (y=0; y < FONT_SCANLINES; y++) 406 406 for (x=0; x < xres; x++) -
generic/include/mm/frame.h
r430f12c re45f81a 90 90 #define IS_BUDDY_RIGHT_BLOCK_ABS(zone, frame) (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 1) 91 91 92 #define frame_alloc(order, flags) frame_alloc_generic(order, flags, NULL, NULL) 93 #define frame_alloc_rc(order, flags, status) frame_alloc_generic(order, flags, status, NULL) 94 #define frame_alloc_rc_zone(order, flags, status, zone) frame_alloc_generic(order, flags, status, zone) 92 #define frame_alloc(order, flags) frame_alloc_generic(order, flags, NULL) 95 93 96 94 extern void frame_init(void); 97 extern void * frame_alloc_generic(__u8 order, int flags, int * status, int *pzone);95 extern void * frame_alloc_generic(__u8 order, int flags, int *pzone); 98 96 extern void frame_free(__address frame); 99 97 extern void frame_reference_add(pfn_t pfn); -
generic/src/mm/frame.c
r430f12c re45f81a 932 932 * 933 933 */ 934 void * frame_alloc_generic(__u8 order, int flags, int * status, int *pzone)934 void * frame_alloc_generic(__u8 order, int flags, int *pzone) 935 935 { 936 936 ipl_t ipl; … … 968 968 interrupts_restore(ipl); 969 969 970 if (flags & FRAME_ATOMIC) { 971 ASSERT(status != NULL); 972 if (status) 973 *status = FRAME_NO_MEMORY; 970 if (flags & FRAME_ATOMIC) 974 971 return 0; 975 }976 972 977 973 panic("Sleep not implemented.\n"); … … 984 980 spinlock_unlock(&zone->lock); 985 981 interrupts_restore(ipl); 986 987 if (status)988 *status = FRAME_OK;989 982 990 983 if (flags & FRAME_KA) -
generic/src/mm/slab.c
r430f12c re45f81a 162 162 size_t fsize; 163 163 int i; 164 int status;165 164 int zone=0; 166 165 167 data = frame_alloc_ rc_zone(cache->order, FRAME_KA | flags, &status, &zone);168 if ( status != FRAME_OK) {166 data = frame_alloc_generic(cache->order, FRAME_KA | flags, &zone); 167 if (!data) { 169 168 return NULL; 170 169 } -
generic/src/proc/thread.c
r430f12c re45f81a 125 125 { 126 126 thread_t *t = (thread_t *)obj; 127 int status;128 127 129 128 spinlock_initialize(&t->lock, "thread_t_lock"); … … 142 141 #endif 143 142 144 t->kstack = frame_alloc _rc(STACK_FRAMES, FRAME_KA | kmflags,&status);145 if ( status) {143 t->kstack = frame_alloc(STACK_FRAMES, FRAME_KA | kmflags); 144 if (! t->kstack) { 146 145 #ifdef ARCH_HAS_FPU 147 146 if (t->saved_fpu_context) -
test/mm/falloc1/test.c
r430f12c re45f81a 46 46 int i, order, run; 47 47 int allocated; 48 int status;49 48 50 49 ASSERT(TEST_RUNS > 1); … … 56 55 allocated = 0; 57 56 for (i = 0; i < MAX_FRAMES >> order; i++) { 58 frames[allocated] = frame_alloc _rc(order, FRAME_ATOMIC | FRAME_KA, &status);57 frames[allocated] = frame_alloc(order, FRAME_ATOMIC | FRAME_KA); 59 58 60 59 if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
Note:
See TracChangeset
for help on using the changeset viewer.