diff options
Diffstat (limited to 'linux/dev')
-rw-r--r-- | linux/dev/glue/block.c | 8 | ||||
-rw-r--r-- | linux/dev/glue/net.c | 7 | ||||
-rw-r--r-- | linux/dev/include/asm-i386/page.h | 7 | ||||
-rw-r--r-- | linux/dev/init/main.c | 4 |
4 files changed, 11 insertions, 15 deletions
diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c index c7b3873..63bc766 100644 --- a/linux/dev/glue/block.c +++ b/linux/dev/glue/block.c @@ -307,7 +307,7 @@ alloc_buffer (int size) d = current_thread ()->pcb->data; assert (d); queue_enter (&d->pages, m, vm_page_t, pageq); - return (void *) m->phys_addr; + return (void *) phystokv(m->phys_addr); } return (void *) __get_free_pages (GFP_KERNEL, 0, ~0UL); } @@ -327,7 +327,7 @@ free_buffer (void *p, int size) assert (d); queue_iterate (&d->pages, m, vm_page_t, pageq) { - if (m->phys_addr == (vm_offset_t) p) + if (phystokv(m->phys_addr) == (vm_offset_t) p) { queue_remove (&d->pages, m, vm_page_t, pageq); VM_PAGE_FREE (m); @@ -600,9 +600,9 @@ rdwr_full (int rw, kdev_t dev, loff_t *off, char **buf, int *resid, int bshift) if (cc > ((nbuf - nb) << bshift)) cc = (nbuf - nb) << bshift; if (! test_bit (BH_Bounce, &bh->b_state)) - bh->b_data = (char *) pmap_extract (vm_map_pmap (device_io_map), + bh->b_data = (char *) phystokv(pmap_extract (vm_map_pmap (device_io_map), (((vm_offset_t) *buf) - + (nb << bshift))); + + (nb << bshift)))); else { bh->b_data = alloc_buffer (cc); diff --git a/linux/dev/glue/net.c b/linux/dev/glue/net.c index a60275f..1573273 100644 --- a/linux/dev/glue/net.c +++ b/linux/dev/glue/net.c @@ -61,6 +61,7 @@ #include <sys/types.h> #include <machine/spl.h> +#include <machine/vm_param.h> #include <mach/mach_types.h> #include <mach/kern_return.h> @@ -449,7 +450,7 @@ device_write (void *d, ipc_port_t reply_port, assert (copy->cpy_npages == 1); skb->copy = copy; - skb->data = ((void *) copy->cpy_page_list[0]->phys_addr + skb->data = ((void *) phystokv(copy->cpy_page_list[0]->phys_addr) + (copy->offset & PAGE_MASK)); skb->len = count; skb->head = skb->data; @@ -463,7 +464,7 @@ device_write (void *d, ipc_port_t reply_port, skb->end = skb->tail; memcpy (skb->data, - ((void *) copy->cpy_page_list[0]->phys_addr + ((void *) phystokv(copy->cpy_page_list[0]->phys_addr) + (copy->offset & PAGE_MASK)), amt); count -= amt; @@ -473,7 +474,7 @@ device_write (void *d, ipc_port_t reply_port, amt = PAGE_SIZE; if (amt > count) amt = count; - memcpy (p, (void *) copy->cpy_page_list[i]->phys_addr, amt); + memcpy (p, (void *) phystokv(copy->cpy_page_list[i]->phys_addr), amt); count -= amt; p += amt; } diff --git a/linux/dev/include/asm-i386/page.h b/linux/dev/include/asm-i386/page.h index 2bb6837..be81848 100644 --- a/linux/dev/include/asm-i386/page.h +++ b/linux/dev/include/asm-i386/page.h @@ -1,12 +1,7 @@ #ifndef _I386_PAGE_H #define _I386_PAGE_H -#ifndef MACH_INCLUDE -/* PAGE_SHIFT determines the page size */ -#define PAGE_SHIFT 12 -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#define PAGE_MASK (~(PAGE_SIZE-1)) -#endif +#include <mach/vm_param.h> #ifdef __KERNEL__ diff --git a/linux/dev/init/main.c b/linux/dev/init/main.c index f5c4832..ecbd0b6 100644 --- a/linux/dev/init/main.c +++ b/linux/dev/init/main.c @@ -149,7 +149,7 @@ linux_init (void) /* * Free unused memory. */ - while (pages && pages->phys_addr < round_page (memory_start)) + while (pages && phystokv(pages->phys_addr) < round_page (memory_start)) pages = (vm_page_t) pages->pageq.next; if (pages) free_contig_mem (pages); @@ -296,7 +296,7 @@ alloc_contig_mem (unsigned size, unsigned limit, kfree ((vm_offset_t) bits, bits_len); if (pages) *pages = page_list; - return (m); + return phystokv(m); } /* |