/kernel/trunk/test/mm/falloc1/test.c |
---|
45,7 → 45,6 |
int i, order, run; |
int allocated; |
int status; |
ASSERT(TEST_RUNS > 1); |
ASSERT(frames != NULL) |
55,7 → 54,7 |
printf("Allocating %d frames blocks ... ", 1 << order); |
allocated = 0; |
for (i = 0; i < MAX_FRAMES >> order; i++) { |
frames[allocated] = frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status); |
frames[allocated] = frame_alloc(order, FRAME_ATOMIC | FRAME_KA); |
if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) { |
panic("Test failed. Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10); |
/kernel/trunk/genarch/src/fb/fb.c |
---|
388,13 → 388,12 |
int totsize = scanline * yres; |
int pages = SIZE2FRAMES(totsize); |
int order; |
int rc; |
if (pages == 1) |
order = 0; |
else |
order = fnzb(pages-1)+1; |
dbbuffer = frame_alloc_rc(order,FRAME_ATOMIC | FRAME_KA, &rc); |
dbbuffer = frame_alloc(order,FRAME_ATOMIC | FRAME_KA); |
if (!dbbuffer) |
printf("Failed to allocate scroll buffer.\n"); |
dboffset = 0; |
401,7 → 400,8 |
/* Initialized blank line */ |
blankline = (__u8 *) malloc(ROW_BYTES, FRAME_ATOMIC); |
ASSERT(blankline); |
if (!blankline) |
panic("Failed to allocate blank line for framebuffer."); |
for (y=0; y < FONT_SCANLINES; y++) |
for (x=0; x < xres; x++) |
(*rgb2scr)(&blankline[POINTPOS(x,y)],BGCOLOR); |
/kernel/trunk/generic/include/mm/frame.h |
---|
89,12 → 89,10 |
#define IS_BUDDY_LEFT_BLOCK_ABS(zone, frame) (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0) |
#define IS_BUDDY_RIGHT_BLOCK_ABS(zone, frame) (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 1) |
#define frame_alloc(order, flags) frame_alloc_generic(order, flags, NULL, NULL) |
#define frame_alloc_rc(order, flags, status) frame_alloc_generic(order, flags, status, NULL) |
#define frame_alloc_rc_zone(order, flags, status, zone) frame_alloc_generic(order, flags, status, zone) |
#define frame_alloc(order, flags) frame_alloc_generic(order, flags, NULL) |
extern void frame_init(void); |
extern void * frame_alloc_generic(__u8 order, int flags, int * status, int *pzone); |
extern void * frame_alloc_generic(__u8 order, int flags, int *pzone); |
extern void frame_free(__address frame); |
extern void frame_reference_add(pfn_t pfn); |
/kernel/trunk/generic/src/proc/thread.c |
---|
124,7 → 124,6 |
static int thr_constructor(void *obj, int kmflags) |
{ |
thread_t *t = (thread_t *)obj; |
int status; |
spinlock_initialize(&t->lock, "thread_t_lock"); |
link_initialize(&t->rq_link); |
141,8 → 140,8 |
# endif |
#endif |
t->kstack = frame_alloc_rc(STACK_FRAMES, FRAME_KA | kmflags,&status); |
if (status) { |
t->kstack = frame_alloc(STACK_FRAMES, FRAME_KA | kmflags); |
if (! t->kstack) { |
#ifdef ARCH_HAS_FPU |
if (t->saved_fpu_context) |
slab_free(fpu_context_slab,t->saved_fpu_context); |
/kernel/trunk/generic/src/mm/slab.c |
---|
161,11 → 161,10 |
slab_t *slab; |
size_t fsize; |
int i; |
int status; |
int zone=0; |
data = frame_alloc_rc_zone(cache->order, FRAME_KA | flags, &status, &zone); |
if (status != FRAME_OK) { |
data = frame_alloc_generic(cache->order, FRAME_KA | flags, &zone); |
if (!data) { |
return NULL; |
} |
if (! (cache->flags & SLAB_CACHE_SLINSIDE)) { |
/kernel/trunk/generic/src/mm/frame.c |
---|
931,7 → 931,7 |
* @return Physical address of the allocated frame. |
* |
*/ |
void * frame_alloc_generic(__u8 order, int flags, int *status, int *pzone) |
void * frame_alloc_generic(__u8 order, int flags, int *pzone) |
{ |
ipl_t ipl; |
int freed; |
967,12 → 967,8 |
*/ |
interrupts_restore(ipl); |
if (flags & FRAME_ATOMIC) { |
ASSERT(status != NULL); |
if (status) |
*status = FRAME_NO_MEMORY; |
if (flags & FRAME_ATOMIC) |
return 0; |
} |
panic("Sleep not implemented.\n"); |
goto loop; |
984,9 → 980,6 |
spinlock_unlock(&zone->lock); |
interrupts_restore(ipl); |
if (status) |
*status = FRAME_OK; |
if (flags & FRAME_KA) |
return (void *)PA2KA(PFN2ADDR(v)); |
return (void *)PFN2ADDR(v); |
/kernel/trunk/arch/ia32/src/smp/smp.c |
---|
61,7 → 61,6 |
void smp_init(void) |
{ |
int status; |
__address l_apic_address, io_apic_address; |
if (acpi_madt) { |
73,12 → 72,12 |
ops = &mps_config_operations; |
} |
l_apic_address = (__address) frame_alloc_rc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA, &status); |
if (status != FRAME_OK) |
l_apic_address = (__address) frame_alloc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA); |
if (!l_apic_address) |
panic("cannot allocate address for l_apic\n"); |
io_apic_address = (__address) frame_alloc_rc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA, &status); |
if (status != FRAME_OK) |
io_apic_address = (__address) frame_alloc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA); |
if (!io_apic_address) |
panic("cannot allocate address for io_apic\n"); |
if (config.cpu_count > 1) { |