summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Deucher <agd5f@yahoo.com>2004-09-30 05:31:13 +0000
committerAlex Deucher <agd5f@yahoo.com>2004-09-30 05:31:13 +0000
commitd88b1abf40905ff9b343b047c34460162017ddfc (patch)
tree9a68096b8548d01b6d8e2f8f6acdd33ecf70feb8 /src
parenta1ef17bb2cc069511baaefcbe04298c087533d35 (diff)
Portability fixes from Matthieu Herrb (bug 1409)
Diffstat (limited to 'src')
-rw-r--r--src/savage_accel.c30
-rw-r--r--src/savage_driver.c11
-rw-r--r--src/savage_driver.h25
-rw-r--r--src/savage_regs.h2
4 files changed, 28 insertions, 40 deletions
diff --git a/src/savage_accel.c b/src/savage_accel.c
index 104fca3..e1eb741 100644
--- a/src/savage_accel.c
+++ b/src/savage_accel.c
@@ -217,7 +217,7 @@ unsigned long readfb( unsigned long addr );
unsigned long writefb( unsigned long addr, unsigned long value );
void writescan( unsigned long scan, unsigned long color );
-static int GetTileAperturePitch(ulong dwWidth, ulong dwBpp);
+static int GetTileAperturePitch(unsigned long dwWidth, unsigned long dwBpp);
void SavageSetGBD_M7(ScrnInfoPtr pScrn);
void SavageSetGBD_Twister(ScrnInfoPtr pScrn);
void SavageSetGBD_PM(ScrnInfoPtr pScrn);
@@ -235,7 +235,7 @@ ScrnInfoPtr gpScrn = 0;
* if MM850C_15 = 1 (use MS-1 128bit non-linear tile mode),we should do it as follows
* we now only support the later, and don't use Y range flag,see tile surface register
*/
-static int GetTileAperturePitch(ulong dwWidth, ulong dwBpp)
+static int GetTileAperturePitch(unsigned long dwWidth, unsigned long dwBpp)
{
switch (dwBpp) {
case 4:
@@ -474,8 +474,8 @@ SavageSetGBD(ScrnInfoPtr pScrn)
void SavageSetGBD_Twister(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);
- ulong ulTmp;
- uchar byte;
+ unsigned long ulTmp;
+ unsigned char byte;
int bci_enable, tile16, tile32;
if (psav->Chipset == S3_SAVAGE4) {
@@ -600,8 +600,8 @@ void SavageSetGBD_Twister(ScrnInfoPtr pScrn)
psav->GlobalBD.bd1.HighPart.ResBWTile |= 0x10;/* disable block write - was 0 */
/* HW uses width */
- psav->GlobalBD.bd1.HighPart.Stride = (ushort) psav->lDelta / (pScrn->bitsPerPixel >> 3);
- psav->GlobalBD.bd1.HighPart.Bpp = (uchar) (pScrn->bitsPerPixel);
+ psav->GlobalBD.bd1.HighPart.Stride = (unsigned short) psav->lDelta / (pScrn->bitsPerPixel >> 3);
+ psav->GlobalBD.bd1.HighPart.Bpp = (unsigned char) (pScrn->bitsPerPixel);
psav->GlobalBD.bd1.Offset = 0;
@@ -642,8 +642,8 @@ void SavageSetGBD_Twister(ScrnInfoPtr pScrn)
void SavageSetGBD_M7(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);
- ulong ulTmp;
- uchar byte;
+ unsigned long ulTmp;
+ unsigned char byte;
int bci_enable, tile16, tile32;
bci_enable = BCI_ENABLE;
@@ -859,8 +859,8 @@ void SavageSetGBD_M7(ScrnInfoPtr pScrn)
psav->GlobalBD.bd1.HighPart.ResBWTile |= 0x10;/* disable block write */
/* HW uses width */
- psav->GlobalBD.bd1.HighPart.Stride = (ushort)(psav->lDelta / (pScrn->bitsPerPixel >> 3));
- psav->GlobalBD.bd1.HighPart.Bpp = (uchar) (pScrn->bitsPerPixel);
+ psav->GlobalBD.bd1.HighPart.Stride = (unsigned short)(psav->lDelta / (pScrn->bitsPerPixel >> 3));
+ psav->GlobalBD.bd1.HighPart.Bpp = (unsigned char) (pScrn->bitsPerPixel);
psav->GlobalBD.bd1.Offset = pScrn->fbOffset;
@@ -897,8 +897,8 @@ void SavageSetGBD_M7(ScrnInfoPtr pScrn)
void SavageSetGBD_PM(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);
- ulong ulTmp;
- uchar byte;
+ unsigned long ulTmp;
+ unsigned char byte;
int bci_enable, tile16, tile32;
/* Is supersavage like savage4 or twister?
@@ -1078,8 +1078,8 @@ void SavageSetGBD_PM(ScrnInfoPtr pScrn)
psav->GlobalBD.bd1.HighPart.ResBWTile |= 0x10;/* disable block write */
/* HW uses width */
- psav->GlobalBD.bd1.HighPart.Stride = (ushort)(psav->lDelta / (pScrn->bitsPerPixel >> 3));
- psav->GlobalBD.bd1.HighPart.Bpp = (uchar) (pScrn->bitsPerPixel);
+ psav->GlobalBD.bd1.HighPart.Stride = (unsigned short)(psav->lDelta / (pScrn->bitsPerPixel >> 3));
+ psav->GlobalBD.bd1.HighPart.Bpp = (unsigned char) (pScrn->bitsPerPixel);
psav->GlobalBD.bd1.Offset = pScrn->fbOffset;
/*
@@ -1111,7 +1111,7 @@ void SavageRestoreAccelState(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);
int bci_enable;
- ulong cmd;
+ unsigned long cmd;
BCI_GET_PTR;
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 6049d81..c7ff0a2 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -1335,12 +1335,13 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
}
psav->EntityIndex = pEnt->index;
-
+
+#ifdef XFree86LOADER
if (xf86LoadSubModule(pScrn, "vbe")) {
xf86LoaderReqSymLists(vbeSymbols, NULL);
psav->pVbe = VBEInit(NULL, pEnt->index);
}
-
+#endif
psav->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
xf86RegisterResources(pEnt->index, NULL, ResNone);
@@ -4074,7 +4075,7 @@ SavageDDC1(int scrnIndex)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
SavagePtr psav = SAVPTR(pScrn);
- uchar byte;
+ unsigned char byte;
xf86MonPtr pMon;
UnLockExtRegs();
@@ -4136,8 +4137,8 @@ static void
SavageResetStreams(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);
- uchar cr67;
- uchar cr69;
+ unsigned char cr67;
+ unsigned char cr69;
/* disable streams */
switch (psav->Chipset) {
diff --git a/src/savage_driver.h b/src/savage_driver.h
index 1b1cda4..867bcdb 100644
--- a/src/savage_driver.h
+++ b/src/savage_driver.h
@@ -52,19 +52,6 @@ typedef struct
} SavageEntRec, *SavageEntPtr;
-#ifndef uint
-typedef unsigned int uint;
-#endif
-#ifndef ulong
-typedef unsigned long ulong;
-#endif
-#ifndef ushort
-typedef unsigned short ushort;
-#endif
-#ifndef uchar
-typedef unsigned char uchar;
-#endif
-
#define VGAIN8(addr) MMIO_IN8(psav->MapBase+0x8000, addr)
#define VGAIN16(addr) MMIO_IN16(psav->MapBase+0x8000, addr)
#define VGAIN(addr) MMIO_IN32(psav->MapBase+0x8000, addr)
@@ -148,19 +135,19 @@ typedef struct {
/* Bitmap descriptor structures for BCI */
typedef struct _HIGH {
- ushort Stride;
- uchar Bpp;
- uchar ResBWTile;
+ unsigned short Stride;
+ unsigned char Bpp;
+ unsigned char ResBWTile;
} HIGH;
typedef struct _BMPDESC1 {
- ulong Offset;
+ unsigned long Offset;
HIGH HighPart;
} BMPDESC1;
typedef struct _BMPDESC2 {
- ulong LoPart;
- ulong HiPart;
+ unsigned long LoPart;
+ unsigned long HiPart;
} BMPDESC2;
typedef union _BMPDESC {
diff --git a/src/savage_regs.h b/src/savage_regs.h
index 4a6cb99..ab2ec27 100644
--- a/src/savage_regs.h
+++ b/src/savage_regs.h
@@ -241,7 +241,7 @@ do { \
*/
#define UnProtectCRTC() \
do { \
- uchar byte; \
+ unsigned char byte; \
OUTREG8(CRT_ADDRESS_REG,0x11); \
byte = INREG8(CRT_DATA_REG) & 0X7F; \
OUTREG16(CRT_ADDRESS_REG,byte << 8 | 0x11); \