aux/vga: use 64-bit physical addresses for pci membar

This commit is contained in:
cinap_lenrek 2020-06-06 16:44:14 +02:00
parent 4c8d2b0ebf
commit 301148756e
8 changed files with 13 additions and 11 deletions

View file

@ -81,7 +81,8 @@ snarf(Vga* vga, Ctlr* ctlr)
vga->n[1] = 256;
vga->p[1] = 4;
if((v = (tdfx->pci->mem[2].bar & ~0x3)) == 0)
v = tdfx->pci->mem[2].bar & ~0x3;
if(v == 0)
error("%s: I/O not mapped\n", ctlr->name);
tdfx->io = v;

View file

@ -403,10 +403,10 @@ dump(Vga* vga, Ctlr* ctlr)
p = i81x->pci;
printitem(name, "mem[0]");
Bprint(&stdout, "base %lux size %d\n", p->mem[0].bar & ~0x0F, p->mem[0].size);
Bprint(&stdout, "base %llux size %d\n", p->mem[0].bar & ~0x0F, p->mem[0].size);
printitem(name, "mem[1]");
Bprint(&stdout, "base %lux size %d\n", p->mem[1].bar & ~0x0F, p->mem[1].size);
Bprint(&stdout, "base %llux size %d\n", p->mem[1].bar & ~0x0F, p->mem[1].size);
}

View file

@ -379,7 +379,8 @@ snarf(Vga* vga, Ctlr* ctlr)
mp->iow32 = portiow32;
mp->pci = pcimatch(0, 0x1002, 0);
if (mp->pci) {
if(v = mp->pci->mem[1].bar & ~0x3) {
v = mp->pci->mem[1].bar & ~0x3;
if(v != 0) {
mp->io = v;
mp->ior32 = pciior32;
mp->iow32 = pciiow32;

View file

@ -131,12 +131,12 @@ linear(Vga* vga)
* new: addr p 0x12345678 v 0x82345678 size 0x123
*/
if(buf[0]=='p' && buf[1]==' '){
vga->vmb = strtoul(buf+2, 0, 0);
vga->vmb = strtoull(buf+2, 0, 0);
p = strstr(buf, "size");
if(p)
vga->apz = strtoul(p+4, 0, 0);
}else
vga->vmb = strtoul(buf, 0, 0);
vga->vmb = strtoull(buf, 0, 0);
}
else
vgactlw("linear", "0");

View file

@ -70,9 +70,9 @@ pcicfginit(void)
j = strtol(s+1, &s, 10);
if(j < 0 || j >= nelem(p->mem))
break;
p->mem[j].bar = strtoul(s+1, &s, 16);
p->mem[j].bar = strtoull(s+1, &s, 16);
p->mem[j].size = strtoul(s+1, &s, 10);
trace("\tmem[%d] = %lux %d\n", j, p->mem[j].bar, p->mem[j].size);
trace("\tmem[%d] = %llux %d\n", j, p->mem[j].bar, p->mem[j].size);
}
if(pcilist != nil)

View file

@ -92,7 +92,7 @@ typedef struct Pcidev {
uchar rid; /* revision ID */
struct {
ulong bar; /* base address */
uvlong bar; /* base address */
int size;
} mem[6];

View file

@ -459,7 +459,7 @@ dump(Vga* vga, Ctlr* ctlr)
if(vga->vma || vga->vmb){
printitem(ctlr->name, "vm a b");
Bprint(&stdout, "%9lud %8lud\n", vga->vma, vga->vmb);
Bprint(&stdout, "%9lud %8llud\n", vga->vma, vga->vmb);
}
if(vga->vmz){
printitem(ctlr->name, "vmz");

View file

@ -197,7 +197,7 @@ typedef struct Vga {
ulong r[2];
ulong vma; /* video memory linear-address alignment */
ulong vmb; /* video memory linear-address base */
uvlong vmb; /* video memory linear-address base */
ulong apz; /* aperture size */
ulong vmz; /* video memory size */