map_mem(): Fixed handling of physical address parameter.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37216 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-06-21 22:30:47 +00:00
parent 34a662eda7
commit 2c9f2dcb89
1 changed files with 4 additions and 4 deletions

View File

@ -61,11 +61,11 @@ static int32 intr_wrapper(void *data);
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 @@ bus_alloc_mem_resource(device_t dev, struct resource *res, int regid)
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;