summaryrefslogtreecommitdiff
path: root/hw/xfree86/os-support/bus
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-03 05:43:34 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-03 05:43:34 -0200
commit49f77fff1495c0a2050fb18f9b1fc627839bbfc2 (patch)
treeeebaec908150abfc0159d9ee941404918f553113 /hw/xfree86/os-support/bus
parent0b8f8b24f718820a72ebdc52423c2e6a44e848c5 (diff)
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source files. Instead, it should be used in headers, and the proper C source include that header. Some special cases are symbols that need to be shared between modules, but not expected to be used by external drivers, and symbols that are accessible via LoaderSymbol/dlopen. This patch also adds conditionally some new sdk header files, depending on extensions enabled. These files were added to match pattern for other extensions/modules, that is, have the headers "deciding" symbol visibility in the sdk. These headers are: o Xext/panoramiXsrv.h, Xext/panoramiX.h o fbpict.h (unconditionally) o vidmodeproc.h o mioverlay.h (unconditionally, used only by xaa) o xfixes.h (unconditionally, symbols required by dri2) LoaderSymbol and similar functions now don't have different prototypes, in loaderProcs.h and xf86Module.h, so that both headers can be included, without the need of defining IN_LOADER. xf86NewInputDevice() device prototype readded to xf86Xinput.h, but not exported (and with a comment about it).
Diffstat (limited to 'hw/xfree86/os-support/bus')
-rw-r--r--hw/xfree86/os-support/bus/Pci.c6
-rw-r--r--hw/xfree86/os-support/bus/Sbus.c36
-rw-r--r--hw/xfree86/os-support/bus/bsd_pci.c2
-rw-r--r--hw/xfree86/os-support/bus/linuxPci.c4
-rw-r--r--hw/xfree86/os-support/bus/xf86Pci.h10
5 files changed, 29 insertions, 29 deletions
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 888a9e36d..8c1aa6e2e 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -140,7 +140,7 @@
pciBusFuncs_t *pciBusFuncs = NULL;
-_X_EXPORT ADDRESS
+ADDRESS
pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
{
if (pciBusFuncs && pciBusFuncs->pciAddrBusToHost)
@@ -149,7 +149,7 @@ pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
return addr;
}
-_X_EXPORT PCITAG
+PCITAG
pciTag(int busnum, int devnum, int funcnum)
{
return(PCI_MAKE_TAG(busnum,devnum,funcnum));
@@ -161,7 +161,7 @@ pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS addr)
return(addr);
}
-_X_EXPORT Bool
+Bool
xf86scanpci(void)
{
Bool success = FALSE;
diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c
index 2fe34bcaa..0b6205f0b 100644
--- a/hw/xfree86/os-support/bus/Sbus.c
+++ b/hw/xfree86/os-support/bus/Sbus.c
@@ -41,7 +41,7 @@
#include "xf86sbusBus.h"
#include "xf86Sbus.h"
-_X_EXPORT int promRootNode;
+int promRootNode;
static int promFd = -1;
static int promCurrentNode;
@@ -51,7 +51,7 @@ static int promP1275 = -1;
#define MAX_VAL (4096-128-4)
static struct openpromio *promOpio;
-_X_EXPORT sbusDevicePtr *xf86SbusInfo = NULL;
+sbusDevicePtr *xf86SbusInfo = NULL;
struct sbus_devtable sbusDeviceTable[] = {
{ SBUS_DEVICE_BW2, FBTYPE_SUN2BW, "bwtwo", "sunbw2", "Sun Monochrome (bwtwo)" },
@@ -71,7 +71,7 @@ struct sbus_devtable sbusDeviceTable[] = {
{ 0, 0, NULL }
};
-_X_EXPORT int
+int
promGetSibling(int node)
{
promOpio->oprom_size = sizeof(int);
@@ -84,7 +84,7 @@ promGetSibling(int node)
return *(int *)promOpio->oprom_array;
}
-_X_EXPORT int
+int
promGetChild(int node)
{
promOpio->oprom_size = sizeof(int);
@@ -97,7 +97,7 @@ promGetChild(int node)
return *(int *)promOpio->oprom_array;
}
-_X_EXPORT char *
+char *
promGetProperty(const char *prop, int *lenp)
{
promOpio->oprom_size = MAX_VAL;
@@ -109,7 +109,7 @@ promGetProperty(const char *prop, int *lenp)
return promOpio->oprom_array;
}
-_X_EXPORT int
+int
promGetBool(const char *prop)
{
promOpio->oprom_size = 0;
@@ -180,7 +180,7 @@ promIsP1275(void)
#endif
}
-_X_EXPORT void
+void
sparcPromClose(void)
{
if (promOpenCount > 1) {
@@ -198,7 +198,7 @@ sparcPromClose(void)
promOpenCount = 0;
}
-_X_EXPORT int
+int
sparcPromInit(void)
{
if (promOpenCount) {
@@ -224,7 +224,7 @@ sparcPromInit(void)
return 0;
}
-_X_EXPORT char *
+char *
sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp)
{
if (promSetNode(pnode))
@@ -232,7 +232,7 @@ sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp)
return promGetProperty(prop, lenp);
}
-_X_EXPORT int
+int
sparcPromGetBool(sbusPromNodePtr pnode, const char *prop)
{
if (promSetNode(pnode))
@@ -281,7 +281,7 @@ promWalkGetDriverName(int node, int oldnode)
return NULL;
}
-_X_EXPORT char *
+char *
sparcDriverName(void)
{
char *name;
@@ -367,7 +367,7 @@ promWalkAssignNodes(int node, int oldnode, int flags, sbusDevicePtr *devicePtrs)
promWalkAssignNodes(nextnode, node, PROM_NODE_SIBLING | sbus, devicePtrs);
}
-_X_EXPORT void
+void
sparcPromAssignNodes(void)
{
sbusDevicePtr psdp, *psdpp;
@@ -509,7 +509,7 @@ promWalkNode2Pathname(char *path, int parent, int node, int searchNode, int type
return 0;
}
-_X_EXPORT char *
+char *
sparcPromNode2Pathname(sbusPromNodePtr pnode)
{
char *ret;
@@ -578,7 +578,7 @@ promWalkPathname2Node(char *name, char *regstr, int parent, int type)
}
}
-_X_EXPORT int
+int
sparcPromPathname2Node(const char *pathName)
{
int i;
@@ -609,7 +609,7 @@ sparcPromPathname2Node(const char *pathName)
return i;
}
-_X_EXPORT pointer
+pointer
xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size)
{
pointer ret;
@@ -636,7 +636,7 @@ xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size)
return (char *)ret + (offset - off);
}
-_X_EXPORT void
+void
xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size)
{
unsigned long mask = getpagesize() - 1;
@@ -647,7 +647,7 @@ xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size)
}
/* Tell OS that we are driving the HW cursor ourselves. */
-_X_EXPORT void
+void
xf86SbusHideOsHwCursor(sbusDevicePtr psdp)
{
struct fbcursor fbcursor;
@@ -668,7 +668,7 @@ xf86SbusHideOsHwCursor(sbusDevicePtr psdp)
}
/* Set HW cursor colormap. */
-_X_EXPORT void
+void
xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg)
{
struct fbcursor fbcursor;
diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c
index 9b55d3a44..17b52db49 100644
--- a/hw/xfree86/os-support/bus/bsd_pci.c
+++ b/hw/xfree86/os-support/bus/bsd_pci.c
@@ -48,7 +48,7 @@
#include "pciaccess.h"
-_X_EXPORT pointer
+pointer
xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
ADDRESS Base, unsigned long Size)
{
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index fdd10d1d5..5cb328d43 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -464,7 +464,7 @@ linuxOpenLegacy(struct pci_device *dev, char *name)
* returns a pointer to it. The pointer is saved for future use if it's in
* the legacy ISA memory space (memory in a domain between 0 and 1MB).
*/
-_X_EXPORT pointer
+pointer
xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
ADDRESS Base, unsigned long Size)
{
@@ -531,7 +531,7 @@ xf86MapLegacyIO(struct pci_device *dev)
return (IOADDRESS)DomainMmappedIO[domain];
}
-_X_EXPORT resPtr
+resPtr
xf86AccResFromOS(resPtr pRes)
{
struct pci_device *dev;
diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
index 3a73678b3..415f0710b 100644
--- a/hw/xfree86/os-support/bus/xf86Pci.h
+++ b/hw/xfree86/os-support/bus/xf86Pci.h
@@ -251,13 +251,13 @@ typedef enum {
/* Public PCI access functions */
-ADDRESS pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
-PCITAG pciTag(int busnum, int devnum, int funcnum);
-Bool xf86scanpci(void);
+extern _X_EXPORT ADDRESS pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
+extern _X_EXPORT PCITAG pciTag(int busnum, int devnum, int funcnum);
+extern _X_EXPORT Bool xf86scanpci(void);
/* Domain access functions. Some of these probably shouldn't be public */
-pointer xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
+extern _X_EXPORT pointer xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
ADDRESS Base, unsigned long Size);
-IOADDRESS xf86MapLegacyIO(struct pci_device *dev);
+extern _X_EXPORT IOADDRESS xf86MapLegacyIO(struct pci_device *dev);
#endif /* _XF86PCI_H */