sdodin: use 64-bit physical addresses and check pci membar type
This commit is contained in:
parent
2907f7ffc4
commit
caf8df6478
1 changed files with 5 additions and 6 deletions
|
@ -2542,10 +2542,9 @@ msverify(SDunit *u)
|
||||||
static uint*
|
static uint*
|
||||||
map(Pcidev *p, int bar)
|
map(Pcidev *p, int bar)
|
||||||
{
|
{
|
||||||
uintptr io;
|
if(p->mem[bar].size == 0 || (p->mem[bar].bar & 1) != 0)
|
||||||
|
return nil;
|
||||||
io = p->mem[bar].bar & ~0xf;
|
return (uint*)vmap(p->mem[bar].bar & ~0xf, p->mem[bar].size);
|
||||||
return (uint*)vmap(io, p->mem[bar].size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* §5.1.3 */
|
/* §5.1.3 */
|
||||||
|
@ -2655,8 +2654,8 @@ mspnp(void)
|
||||||
s = sdevs + nmsctlr;
|
s = sdevs + nmsctlr;
|
||||||
memset(c, 0, sizeof *c);
|
memset(c, 0, sizeof *c);
|
||||||
memset(s, 0, sizeof *s);
|
memset(s, 0, sizeof *s);
|
||||||
if((c->reg = map(p, Mebar)) == 0){
|
if((c->reg = map(p, Mebar)) == nil){
|
||||||
print("sdodin: bar %#p in use\n", c->reg);
|
print("sdodin: can't map registers\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
pcienable(p);
|
pcienable(p);
|
||||||
|
|
Loading…
Reference in a new issue