summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-03-03 21:28:41 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-03-03 21:28:41 +0000
commitcd2031e81266c04e915c77b101cf3caaa4b1cc71 (patch)
tree53af80d0f251c9af2e03000bd291263665429d1e /sys/arch/loongson
parentf853daad836874d041eb3aac1138d37f24c1c8c3 (diff)
Fix the logic deciding whether to return PCI_COMMAND_MASTER_ENABLE in the
emulated pci functions #2 and #3; from NetBSD
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r--sys/arch/loongson/dev/glx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/loongson/dev/glx.c b/sys/arch/loongson/dev/glx.c
index a93a653c748..e5ee0573f56 100644
--- a/sys/arch/loongson/dev/glx.c
+++ b/sys/arch/loongson/dev/glx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: glx.c,v 1.6 2010/10/14 21:23:04 pirofti Exp $ */
+/* $OpenBSD: glx.c,v 1.7 2012/03/03 21:28:40 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -436,7 +436,7 @@ glx_fn2_read(int reg)
data = glx_get_status();
data |= PCI_COMMAND_IO_ENABLE;
msr = rdmsr(GLIU_PAE);
- if ((msr & (0x3 << 4)) == 0x03)
+ if ((msr & (0x3 << 4)) == (0x03 << 4))
data |= PCI_COMMAND_MASTER_ENABLE;
break;
case PCI_CLASS_REG:
@@ -560,7 +560,7 @@ glx_fn3_read(int reg)
data = glx_get_status();
data |= PCI_COMMAND_IO_ENABLE;
msr = rdmsr(GLIU_PAE);
- if ((msr & (0x3 << 8)) == 0x03)
+ if ((msr & (0x3 << 8)) == (0x03 << 8))
data |= PCI_COMMAND_MASTER_ENABLE;
break;
case PCI_CLASS_REG: