[PATCH 09/14] xfree86: remove IOADDRESS definition from common header file
Mark Kettenis
mark.kettenis at xs4all.nl
Thu Jun 3 06:01:23 PDT 2010
> From: Tiago Vignatti <tiago.vignatti at nokia.com>
> Date: Thu, 3 Jun 2010 14:48:16 +0300
>
> IOADDRESS currently is used to store I/O addresses - actually the virtual
> address of I/O ports. In theory it should be used for any kind of bus that
> would access devices through this method. However, in practice we're abusing
> such definition in the implementation:
>
> 1. we're narrowing it because it's defined inside os-support/bus/xf86Pci.h,
> i.e., for PCI buses only, and;
>
> 2. we're extending its usage to common/ files, which conceptually shouldn't
> be aware of any hardware details.
>
> This patch try to contour 2., substituting all references of
> IOADDRESS inside common/ by unsigned long. Therefore IOADDRESS
> should be used only for PCI from now.
>
> One may want to improve this patch creating a similar type inside DDX common
> directory (common/) to deal with buses in general.
This doesn't do a thing to address the issues I raised. At the very
least you should rename the vertsyncreg variable to something that
indicates it's an address and not the value of the register. Same
thing for the domainIO variable (to domainIOBase?). Otherwise this
code becomes much harder to understand.
> hw/xfree86/common/xf86.h | 2 +-
> hw/xfree86/common/xf86Bus.h | 2 +-
> hw/xfree86/common/xf86Helper.c | 2 +-
> hw/xfree86/common/xf86str.h | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
> index d8629a8..755d171 100644
> --- a/hw/xfree86/common/xf86.h
> +++ b/hw/xfree86/common/xf86.h
> @@ -240,7 +240,7 @@ extern _X_EXPORT void xf86GetClocks(ScrnInfoPtr pScrn, int num,
> Bool (*ClockFunc)(ScrnInfoPtr, int),
> void (*ProtectRegs)(ScrnInfoPtr, Bool),
> void (*BlankScreen)(ScrnInfoPtr, Bool),
> - IOADDRESS vertsyncreg, int maskval,
> + unsigned long vertsyncreg, int maskval,
> int knownclkindex, int knownclkvalue);
> extern _X_EXPORT const char *xf86GetVisualName(int visual);
> extern _X_EXPORT int xf86GetVerbosity(void);
> diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
> index e161c7f..2f46ef4 100644
> --- a/hw/xfree86/common/xf86Bus.h
> +++ b/hw/xfree86/common/xf86Bus.h
> @@ -58,7 +58,7 @@ typedef struct {
> DevUnion * entityPrivates;
> int numInstances;
> GDevPtr * devices;
> - IOADDRESS domainIO;
> + unsigned long domainIO;
> } EntityRec, *EntityPtr;
>
> #define ACCEL_IS_SHARABLE 0x100
> diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
> index d4b9351..31d661e 100644
> --- a/hw/xfree86/common/xf86Helper.c
> +++ b/hw/xfree86/common/xf86Helper.c
> @@ -1508,7 +1508,7 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
> void
> xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
> void (*ProtectRegs)(ScrnInfoPtr, Bool),
> - void (*BlankScreen)(ScrnInfoPtr, Bool), IOADDRESS vertsyncreg,
> + void (*BlankScreen)(ScrnInfoPtr, Bool), unsigned long vertsyncreg,
> int maskval, int knownclkindex, int knownclkvalue)
> {
> register int status = vertsyncreg;
> diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
> index 078e459..95b43e5 100644
> --- a/hw/xfree86/common/xf86str.h
> +++ b/hw/xfree86/common/xf86str.h
> @@ -754,7 +754,7 @@ typedef struct _ScrnInfoRec {
> unsigned long biosBase; /* Base address of video BIOS */
> unsigned long memPhysBase; /* Physical address of FB */
> unsigned long fbOffset; /* Offset of FB in the above */
> - IOADDRESS domainIOBase; /* Domain I/O base address */
> + unsigned long domainIOBase; /* Domain I/O base address */
> int memClk; /* memory clock */
> int textClockFreq; /* clock of text mode */
> Bool flipPixels; /* swap default black/white */
> --
> 1.7.1.226.g770c5
More information about the xorg-devel
mailing list