13,18 → 13,7 |
|
zone_t z_core; |
|
static inline u32_t save_edx(void) |
{ |
u32_t val; |
asm volatile ("movl %%edx, %0":"=r"(val)); |
return val; |
}; |
|
static inline void restore_edx(u32_t val) |
{ |
asm volatile (""::"d" (val) ); |
}; |
|
static void buddy_system_create(zone_t *z); |
static void __fastcall buddy_system_free(zone_t *z, link_t *block); |
static void zone_mark_unavailable(zone_t *zone, index_t frame_idx); |
36,9 → 25,7 |
|
static inline void frame_initialize(frame_t *frame); |
|
void init_mm(); |
|
|
static void zone_create(zone_t *z, pfn_t start, count_t count); |
static void zone_reserve(zone_t *z, pfn_t base, count_t count); |
static void zone_release(zone_t *z, pfn_t base, count_t count); |
558,8 → 545,8 |
spinlock_unlock(&z_core.lock); |
safe_sti(efl); |
|
DBG("core alloc: %x, size %x remain %d\n", v << FRAME_WIDTH, |
((1<<order)<<12), z_core.free_count); |
DBG("core alloc at: 0x%x, size 0x%x remain %d\n", v << FRAME_WIDTH, |
((1<<order)<<FRAME_WIDTH), z_core.free_count); |
|
return (v << FRAME_WIDTH); |
}; |
568,11 → 555,11 |
{ |
eflags_t efl; |
|
DBG("core free %x", frame); |
DBG("core free 0x%x", frame); |
|
efl = safe_cli(); |
spinlock_lock(&z_core.lock); |
zone_free(&z_core, frame>>12); |
// zone_free(&z_core, frame>>12); |
spinlock_unlock(&z_core.lock); |
safe_sti(efl); |
|