diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-11-27 00:12:59 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-11-27 00:12:59 -0200 |
commit | 87a7fb7438b70d07ebf240c530b8548a01021d48 (patch) | |
tree | e38a9c8dc0986cae89230e08acc1d5f15de6e530 /hw/xfree86/i2c/xf86i2c.h | |
parent | fc708394318ed92c612e2938b335c08c1ffebb28 (diff) |
Rework code using return value of LoaderSymbol as a function pointer.
The patch removes all macros in the format
define xf86_sym ((type (*)(argument-list))LoaderSymbol("sym"))
creates a new macro in the format
define xf86_sym sym
and ensures "sym" is a "visible" symbol.
The patch doesn't add or remove features, and is source and binary
compatible with previous shared objects (with the difference that it
requires the dlloader).
These symbols are a special case, as, due to the fact that LoaderSymbol
was being used to reference them, they are not easily found by "automated"
tools that check for missing symbols. And now it also have the benefit
that the compiler/loader "knows what is going on".
Diffstat (limited to 'hw/xfree86/i2c/xf86i2c.h')
-rw-r--r-- | hw/xfree86/i2c/xf86i2c.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/hw/xfree86/i2c/xf86i2c.h b/hw/xfree86/i2c/xf86i2c.h index 76d2ebf92..a3413c9c4 100644 --- a/hw/xfree86/i2c/xf86i2c.h +++ b/hw/xfree86/i2c/xf86i2c.h @@ -49,9 +49,13 @@ typedef struct _I2CBusRec { I2CByte *ReadBuffer, int nRead); } I2CBusRec; -I2CBusPtr xf86CreateI2CBusRec(void); -void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc, Bool devs_too); -Bool xf86I2CBusInit(I2CBusPtr pI2CBus); +#define CreateI2CBusRec xf86CreateI2CBusRec +extern I2CBusPtr xf86CreateI2CBusRec(void); +#define DestroyI2CBusRec xf86DestroyI2CBusRec +extern void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc, Bool devs_too); +#define I2CBusInit xf86I2CBusInit +extern Bool xf86I2CBusInit(I2CBusPtr pI2CBus); + I2CBusPtr xf86I2CFindBus(int scrnIndex, char *name); int xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus); @@ -72,17 +76,23 @@ typedef struct _I2CDevRec { DevUnion DriverPrivate; } I2CDevRec; -I2CDevPtr xf86CreateI2CDevRec(void); +#define CreateI2CDevRec xf86CreateI2CDevRec +extern I2CDevPtr xf86CreateI2CDevRec(void); void xf86DestroyI2CDevRec(I2CDevPtr pI2CDev, Bool unalloc); -Bool xf86I2CDevInit(I2CDevPtr pI2CDev); +#define I2CDevInit xf86I2CDevInit +extern Bool xf86I2CDevInit(I2CDevPtr pI2CDev); I2CDevPtr xf86I2CFindDev(I2CBusPtr, I2CSlaveAddr); /* See descriptions of these functions in xf86i2c.c */ -Bool xf86I2CProbeAddress(I2CBusPtr pI2CBus, I2CSlaveAddr); -Bool xf86I2CWriteRead(I2CDevPtr d, I2CByte *WriteBuffer, int nWrite, +#define I2CProbeAddress xf86I2CProbeAddress +extern Bool xf86I2CProbeAddress(I2CBusPtr pI2CBus, I2CSlaveAddr); + +#define I2C_WriteRead xf86I2CWriteRead +extern Bool xf86I2CWriteRead(I2CDevPtr d, I2CByte *WriteBuffer, int nWrite, I2CByte *ReadBuffer, int nRead); #define xf86I2CRead(d, rb, nr) xf86I2CWriteRead(d, NULL, 0, rb, nr) + Bool xf86I2CReadStatus(I2CDevPtr d, I2CByte *pbyte); Bool xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte); Bool xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte, int n); |