shithub: riscv

Download patch

ref: 2a531d444cf53419e8d4af716b9937d14ca5b08c
parent: 20ea113790c22e5fc8dd0051baa359e4fa083425
author: cinap_lenrek <[email protected]>
date: Fri Nov 26 15:55:58 EST 2021

aux/vga: use vlong for pci bar size

--- a/sys/src/cmd/aux/vga/i81x.c
+++ b/sys/src/cmd/aux/vga/i81x.c
@@ -403,10 +403,10 @@
 
 	p = i81x->pci;
 	printitem(name, "mem[0]");
-	Bprint(&stdout, "base %llux size %d\n", p->mem[0].bar & ~0x0F, p->mem[0].size);
+	Bprint(&stdout, "base %llux size %lld\n", p->mem[0].bar & ~0x0F, p->mem[0].size);
 
 	printitem(name, "mem[1]");
-	Bprint(&stdout, "base %llux size %d\n", p->mem[1].bar & ~0x0F, p->mem[1].size);
+	Bprint(&stdout, "base %llux size %lld\n", p->mem[1].bar & ~0x0F, p->mem[1].size);
 
 }
 
--- a/sys/src/cmd/aux/vga/nvidia.c
+++ b/sys/src/cmd/aux/vga/nvidia.c
@@ -151,7 +151,7 @@
 
 		mmio = segattach(0, "nvidiammio", 0, p->mem[0].size);
 		if(mmio == (void*)-1)
-			error("%s: segattach nvidiammio, size %d: %r\n",
+			error("%s: segattach nvidiammio, size %lld: %r\n",
 				ctlr->name, p->mem[0].size);
 
 		nv->pci = p;
--- a/sys/src/cmd/aux/vga/pci.c
+++ b/sys/src/cmd/aux/vga/pci.c
@@ -71,8 +71,8 @@
 			if(j < 0 || j >= nelem(p->mem))
 				break;
 			p->mem[j].bar = strtoull(s+1, &s, 16);
-			p->mem[j].size = strtoul(s+1, &s, 10);
-			trace("\tmem[%d] = %llux %d\n", j, p->mem[j].bar, p->mem[j].size);
+			p->mem[j].size = strtoll(s+1, &s, 10);
+			trace("\tmem[%d] = %llux %lld\n", j, p->mem[j].bar, p->mem[j].size);
 		}
 
 		if(pcilist != nil)
--- a/sys/src/cmd/aux/vga/pci.h
+++ b/sys/src/cmd/aux/vga/pci.h
@@ -93,7 +93,7 @@
 
 	struct {
 		uvlong	bar;		/* base address */
-		int	size;
+		vlong	size;
 	} mem[6];
 
 	uchar	intl;			/* interrupt line */
--- a/sys/src/cmd/aux/vga/radeon.c
+++ b/sys/src/cmd/aux/vga/radeon.c
@@ -247,7 +247,7 @@
 		if (mmio == ~0)
 			error("%s: can't attach mmio segment\n", ctlr->name);
 
-		DBGPRINT("radeon: mmio address: %08#p [size=%#x]\n",
+		DBGPRINT("radeon: mmio address: %08#p [size=%lld]\n",
 			(void *)mmio, p->mem[2].size);
 
 		radeon->pci = p;