aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Smith <msmith@FreeBSD.org>2000-05-04 17:44:55 +0000
committerMike Smith <msmith@FreeBSD.org>2000-05-04 17:44:55 +0000
commitac9b3dacb2809c2ee23c8ea45dee49c815ebf9c9 (patch)
tree7eb92af0c85d03c0ec374aed2fe611de0ed6ee49
parentec6fc617fa68544d0f6e2d4876ea908a4c1b5de1 (diff)
Notes
-rw-r--r--sys/amd64/pci/pci_bus.c6
-rw-r--r--sys/amd64/pci/pci_cfgreg.c6
-rw-r--r--sys/i386/isa/pcibus.c6
-rw-r--r--sys/i386/pci/pci_bus.c6
-rw-r--r--sys/i386/pci/pci_cfgreg.c6
-rw-r--r--sys/i386/pci/pci_pir.c6
6 files changed, 30 insertions, 6 deletions
diff --git a/sys/amd64/pci/pci_bus.c b/sys/amd64/pci/pci_bus.c
index a1b399b6a41d..0f49b633c51a 100644
--- a/sys/amd64/pci/pci_bus.c
+++ b/sys/amd64/pci/pci_bus.c
@@ -90,16 +90,20 @@ static int
pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
{
struct bios_regs args;
+ u_int mask;
switch(bytes) {
case 1:
args.eax = PCIBIOS_READ_CONFIG_BYTE;
+ mask = 0xff;
break;
case 2:
args.eax = PCIBIOS_READ_CONFIG_WORD;
+ mask = 0xffff;
break;
case 4:
args.eax = PCIBIOS_READ_CONFIG_DWORD;
+ mask = 0xffffffff;
break;
default:
return(-1);
@@ -108,7 +112,7 @@ pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
args.edi = reg;
bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL));
/* check call results? */
- return(args.ecx);
+ return(args.ecx & mask);
}
static void
diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c
index a1b399b6a41d..0f49b633c51a 100644
--- a/sys/amd64/pci/pci_cfgreg.c
+++ b/sys/amd64/pci/pci_cfgreg.c
@@ -90,16 +90,20 @@ static int
pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
{
struct bios_regs args;
+ u_int mask;
switch(bytes) {
case 1:
args.eax = PCIBIOS_READ_CONFIG_BYTE;
+ mask = 0xff;
break;
case 2:
args.eax = PCIBIOS_READ_CONFIG_WORD;
+ mask = 0xffff;
break;
case 4:
args.eax = PCIBIOS_READ_CONFIG_DWORD;
+ mask = 0xffffffff;
break;
default:
return(-1);
@@ -108,7 +112,7 @@ pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
args.edi = reg;
bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL));
/* check call results? */
- return(args.ecx);
+ return(args.ecx & mask);
}
static void
diff --git a/sys/i386/isa/pcibus.c b/sys/i386/isa/pcibus.c
index a1b399b6a41d..0f49b633c51a 100644
--- a/sys/i386/isa/pcibus.c
+++ b/sys/i386/isa/pcibus.c
@@ -90,16 +90,20 @@ static int
pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
{
struct bios_regs args;
+ u_int mask;
switch(bytes) {
case 1:
args.eax = PCIBIOS_READ_CONFIG_BYTE;
+ mask = 0xff;
break;
case 2:
args.eax = PCIBIOS_READ_CONFIG_WORD;
+ mask = 0xffff;
break;
case 4:
args.eax = PCIBIOS_READ_CONFIG_DWORD;
+ mask = 0xffffffff;
break;
default:
return(-1);
@@ -108,7 +112,7 @@ pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
args.edi = reg;
bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL));
/* check call results? */
- return(args.ecx);
+ return(args.ecx & mask);
}
static void
diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c
index a1b399b6a41d..0f49b633c51a 100644
--- a/sys/i386/pci/pci_bus.c
+++ b/sys/i386/pci/pci_bus.c
@@ -90,16 +90,20 @@ static int
pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
{
struct bios_regs args;
+ u_int mask;
switch(bytes) {
case 1:
args.eax = PCIBIOS_READ_CONFIG_BYTE;
+ mask = 0xff;
break;
case 2:
args.eax = PCIBIOS_READ_CONFIG_WORD;
+ mask = 0xffff;
break;
case 4:
args.eax = PCIBIOS_READ_CONFIG_DWORD;
+ mask = 0xffffffff;
break;
default:
return(-1);
@@ -108,7 +112,7 @@ pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
args.edi = reg;
bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL));
/* check call results? */
- return(args.ecx);
+ return(args.ecx & mask);
}
static void
diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c
index a1b399b6a41d..0f49b633c51a 100644
--- a/sys/i386/pci/pci_cfgreg.c
+++ b/sys/i386/pci/pci_cfgreg.c
@@ -90,16 +90,20 @@ static int
pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
{
struct bios_regs args;
+ u_int mask;
switch(bytes) {
case 1:
args.eax = PCIBIOS_READ_CONFIG_BYTE;
+ mask = 0xff;
break;
case 2:
args.eax = PCIBIOS_READ_CONFIG_WORD;
+ mask = 0xffff;
break;
case 4:
args.eax = PCIBIOS_READ_CONFIG_DWORD;
+ mask = 0xffffffff;
break;
default:
return(-1);
@@ -108,7 +112,7 @@ pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
args.edi = reg;
bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL));
/* check call results? */
- return(args.ecx);
+ return(args.ecx & mask);
}
static void
diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c
index a1b399b6a41d..0f49b633c51a 100644
--- a/sys/i386/pci/pci_pir.c
+++ b/sys/i386/pci/pci_pir.c
@@ -90,16 +90,20 @@ static int
pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
{
struct bios_regs args;
+ u_int mask;
switch(bytes) {
case 1:
args.eax = PCIBIOS_READ_CONFIG_BYTE;
+ mask = 0xff;
break;
case 2:
args.eax = PCIBIOS_READ_CONFIG_WORD;
+ mask = 0xffff;
break;
case 4:
args.eax = PCIBIOS_READ_CONFIG_DWORD;
+ mask = 0xffffffff;
break;
default:
return(-1);
@@ -108,7 +112,7 @@ pcibios_cfgread(pcicfgregs *cfg, int reg, int bytes)
args.edi = reg;
bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL));
/* check call results? */
- return(args.ecx);
+ return(args.ecx & mask);
}
static void