Author: bonefish Date: 2010-06-22 00:30:47 +0200 (Tue, 22 Jun 2010) New Revision: 37216 Changeset: http://dev.haiku-os.org/changeset/37216/haiku Modified: haiku/trunk/src/libs/compat/freebsd_network/bus.c Log: map_mem(): Fixed handling of physical address parameter. Modified: haiku/trunk/src/libs/compat/freebsd_network/bus.c =================================================================== --- haiku/trunk/src/libs/compat/freebsd_network/bus.c 2010-06-21 22:02:31 UTC (rev 37215) +++ haiku/trunk/src/libs/compat/freebsd_network/bus.c 2010-06-21 22:30:47 UTC (rev 37216) @@ -61,11 +61,11 @@ static area_id -map_mem(void **virtualAddr, void *_phy, size_t size, uint32 protection, +map_mem(void **virtualAddr, phys_addr_t _phy, size_t size, uint32 protection, const char *name) { - uint32 offset = (uint32)_phy & (B_PAGE_SIZE - 1); - void *physicalAddr = (uint8 *)_phy - offset; + uint32 offset = _phy & (B_PAGE_SIZE - 1); + phys_addr_t physicalAddr = _phy - offset; area_id area; size = ROUNDUP(size + offset, B_PAGE_SIZE); @@ -102,7 +102,7 @@ uint32 size = 128 * 1024; /* XXX */ void *virtualAddr; - res->r_mapped_area = map_mem(&virtualAddr, (void *)addr, size, 0, + res->r_mapped_area = map_mem(&virtualAddr, addr, size, 0, "bus_alloc_resource(MEMORY)"); if (res->r_mapped_area < B_OK) return -1;