echo: fixed driver init on x86_64.
* tested with echo3g without external box connected.
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
|
||||
spinlock slock = 0;
|
||||
spinlock slock = B_SPINLOCK_INITIALIZER;
|
||||
|
||||
uint32 round_to_pagesize(uint32 size);
|
||||
|
||||
@@ -109,16 +109,15 @@ map_mem(void **log, phys_addr_t phy, size_t size, const char *name)
|
||||
|
||||
LOG(("mapping physical address %p with %#x bytes for %s\n",phy,size,name));
|
||||
|
||||
offset = phy & (B_PAGE_SIZE - 1);
|
||||
offset = (uint32)phy & (B_PAGE_SIZE - 1);
|
||||
phyadr = phy - offset;
|
||||
size = round_to_pagesize(size + offset);
|
||||
area = map_physical_memory(name, phyadr, size, B_ANY_KERNEL_ADDRESS,
|
||||
0, &mapadr);
|
||||
*log = (void*) ((uint32)mapadr + offset);
|
||||
*log = mapadr + offset;
|
||||
|
||||
LOG(("physical = %p, logical = %p, offset = %#x, phyadr = %p, mapadr = %p, size = %#x, area = %#x\n",
|
||||
phy, *log, offset, phyadr, mapadr, size, area));
|
||||
|
||||
return area;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user