[PATCH xf86-video-sis 1/6] Use unsigned long when performing PCI read / write

Kevin Brace kevinbrace at gmx.com
Tue Dec 17 03:12:26 UTC 2019


From: Kevin Brace <kevinbrace at bracecomputerlab.com>

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 at bracecomputerlab.com>
---
 src/sis.h       |  8 ++++----
 src/sis_setup.c | 10 +++++-----
 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);
--
2.7.4



More information about the xorg-devel mailing list