#include <mach/boolean.h>
#include <kern/misc_protos.h>
#include <i386/AT386/misc_protos.h>
+#include <i386/pmap.h>
hil_t hil_head;
decl_simple_lock_data(,hil_lock)
himem_init(
void)
{
- simple_lock_init(&hil_lock, ETAP_VM_HIMEM);
+ simple_lock_init(&hil_lock, 0);
}
/*
vm_page_t low;
hil_t hil;
spl_t ipl;
- extern vm_offset_t avail_end;
+ extern pmap_paddr_t_t avail_end;
if (avail_end <= HIGH_MEM)
return;
+ kprintf("looking for low mem pages\n");
hil = (hil_t)kalloc(npages*sizeof(struct himem_link));
if (hil == (hil_t)0)
panic("himem_reserve: kalloc failed\n");
i++;
}
}
-
+ kprintf("freeing high pages back\n");
for (low = free_head; low; low = free_head) {
free_head = (vm_page_t) low->pageq.next;
VM_PAGE_FREE(low);
h->high_addr = phys_addr;
if (io_op == D_WRITE) {
- bcopy((char *)phystokv(phys_addr), (char *)phystokv(h->low_page + offset),
+ bcopy_phys((addr64_t)phys_addr, (addr64_t)(h->low_page + offset),
length);
h->length = 0;
} else {
while(hil) {
if (hil->length) {
- bcopy((char *)phystokv(hil->low_page + hil->offset),
- (char *)phystokv(hil->high_addr),
+ bcopy_phys((addr64_t)hil->low_page + hil->offset),
+ (addr64_t)(hil->high_addr),
hil->length);
}
hil->high_addr = 0;