Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 377 → Rev 378

/SPARTAN/trunk/include/mm/heap.h
45,7 → 45,7
 
extern void early_heap_init(__address heap, size_t size);
 
extern void *early_malloc(size_t size);
extern void *early_malloc(size_t size) __attribute__ ((malloc));
extern void early_free(void *ptr);
 
#endif
/SPARTAN/trunk/include/mm/buddy.h
32,6 → 32,8
#include <arch/types.h>
#include <typedefs.h>
 
#define BUDDY_SYSTEM_INNER_BLOCK 0xff
 
struct buddy_operations {
link_t *(* find_buddy)(link_t *);
link_t *(* bisect)(link_t *);
/SPARTAN/trunk/src/proc/scheduler.c
29,23 → 29,23
#include <proc/scheduler.h>
#include <proc/thread.h>
#include <proc/task.h>
#include <cpu.h>
#include <mm/heap.h>
#include <mm/frame.h>
#include <mm/page.h>
#include <mm/vm.h>
#include <arch/asm.h>
#include <arch/faddr.h>
#include <arch/atomic.h>
#include <synch/spinlock.h>
#include <config.h>
#include <context.h>
#include <func.h>
#include <arch.h>
#include <arch/asm.h>
#include <list.h>
#include <panic.h>
#include <typedefs.h>
#include <mm/page.h>
#include <synch/spinlock.h>
#include <arch/faddr.h>
#include <arch/atomic.h>
#include <cpu.h>
#include <print.h>
#include <mm/frame.h>
#include <mm/heap.h>
#include <debug.h>
 
volatile count_t nrdy;
/SPARTAN/trunk/src/mm/buddy.c
48,6 → 48,8
buddy_system_t *b;
int i;
 
ASSERT(max_order < BUDDY_SYSTEM_INNER_BLOCK);
 
ASSERT(op->find_buddy);
ASSERT(op->set_order);
ASSERT(op->get_order);
166,6 → 168,9
buddy = b->op->find_buddy(block);
if (buddy && i != b->max_order - 1) {
 
ASSERT(b->op->get_order(buddy) == i);
/*
* Remove buddy from the list of order i.
*/
172,6 → 177,12
list_remove(buddy);
/*
* Invalidate order of both block and buddy.
*/
b->op->set_order(block, BUDDY_SYSTEM_INNER_BLOCK);
b->op->set_order(buddy, BUDDY_SYSTEM_INNER_BLOCK);
/*
* Coalesce block and buddy into one block.
*/
hlp = b->op->coalesce(block, buddy);