summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Brace <kevinbrace@bracecomputerlab.com>2019-12-16 20:37:54 -0600
committerKevin Brace <kevinbrace@bracecomputerlab.com>2019-12-16 20:37:54 -0600
commit1ac40451b8c07b8c028782321b26ebbd5bc4559c (patch)
tree7751a4a8a4e4751f7c3e9548664e028325b7e92a
parent866e109fc12752b1679e0b59baf40326d421a03f (diff)
Use unsigned long when performing PCI read / write
When thinking about 64-bit ISA environment, 32-bit PCI read / write should be performed as a unsigned long type. Signed-off-by: Kevin Brace <kevinbrace@bracecomputerlab.com>
-rw-r--r--src/sis.h8
-rw-r--r--src/sis_setup.c10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/sis.h b/src/sis.h
index 789b1d6..6861e8e 100644
--- a/src/sis.h
+++ b/src/sis.h
@@ -807,7 +807,7 @@ typedef struct {
UShort ch70xx[64];
unsigned int sisMMIO85C0;
UChar sis6326tv[0x46];
- unsigned int sisRegsPCI50, sisRegsPCIA0;
+ unsigned long sisRegsPCI50, sisRegsPCIA0;
UChar BIOSModeSave;
} SISRegRec, *SISRegPtr;
@@ -1621,12 +1621,12 @@ extern int SiS_GetTVyscale(ScrnInfoPtr pScrn);
extern int SiS_GetSISCRT1SaturationGain(ScrnInfoPtr pScrn);
extern void SiS_SetSISCRT1SaturationGain(ScrnInfoPtr pScrn, int val);
-extern unsigned int sis_pci_read_device_u32(int device, int offset);
+extern unsigned long sis_pci_read_device_u32(int device, int offset);
extern unsigned char sis_pci_read_device_u8(int device, int offset);
-extern unsigned int sis_pci_read_host_bridge_u32(int offset);
+extern unsigned long sis_pci_read_host_bridge_u32(int offset);
extern unsigned char sis_pci_read_host_bridge_u8(int offset);
extern void sis_pci_write_host_bridge_u8(int offset, unsigned char value);
-extern void sis_pci_write_host_bridge_u32(int offset, unsigned int value);
+extern void sis_pci_write_host_bridge_u32(int offset, unsigned long value);
#endif /* _SIS_H_ */
diff --git a/src/sis_setup.c b/src/sis_setup.c
index 355c5ac..562f28d 100644
--- a/src/sis_setup.c
+++ b/src/sis_setup.c
@@ -113,7 +113,7 @@ sis_get_device (int device)
return bridge;
}
-unsigned int
+unsigned long
sis_pci_read_device_u32(int device, int offset)
{
struct pci_device *host_bridge = sis_get_device(device);
@@ -134,7 +134,7 @@ sis_pci_read_device_u8(int device, int offset)
}
void
-sis_pci_write_host_bridge_u32(int offset, unsigned int value)
+sis_pci_write_host_bridge_u32(int offset, unsigned long value)
{
struct pci_device *host_bridge = sis_get_device(0);
pci_device_cfg_write_u32(host_bridge, value, offset);
@@ -148,7 +148,7 @@ sis_pci_write_host_bridge_u8(int offset, unsigned char value)
}
#else
-unsigned int
+unsigned long
sis_pci_read_device_u32(int device, int offset)
{
PCITAG tag = pciTag(0, device, 0);
@@ -163,7 +163,7 @@ sis_pci_read_device_u8(int device, int offset)
}
void
-sis_pci_write_host_bridge_u32(int offset, unsigned int value)
+sis_pci_write_host_bridge_u32(int offset, unsigned long value)
{
pciWriteLong(0x00000000, offset, value);
}
@@ -177,7 +177,7 @@ sis_pci_write_host_bridge_u8(int offset, unsigned char value)
#endif
-unsigned int
+unsigned long
sis_pci_read_host_bridge_u32(int offset)
{
return sis_pci_read_device_u32(0, offset);