summaryrefslogtreecommitdiff
path: root/hw/xfree86/int10
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/int10
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/int10')
-rw-r--r--hw/xfree86/int10/generic.c12
-rw-r--r--hw/xfree86/int10/helper_exec.c62
-rw-r--r--hw/xfree86/int10/helper_mem.c22
-rw-r--r--hw/xfree86/int10/stub.c18
-rw-r--r--hw/xfree86/int10/xf86int10.c4
-rw-r--r--hw/xfree86/int10/xf86int10.h31
-rw-r--r--hw/xfree86/int10/xf86x86emu.c4
7 files changed, 78 insertions, 75 deletions
diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index 2cda75394..0af7c1baa 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -116,7 +116,7 @@ read_legacy_video_BIOS(struct pci_device *dev, unsigned char *Buf)
}
-_X_EXPORT xf86Int10InfoPtr
+xf86Int10InfoPtr
xf86ExtendedInitInt10(int entityIndex, int Flags)
{
xf86Int10InfoPtr pInt;
@@ -321,14 +321,14 @@ UnmapVRam(xf86Int10InfoPtr pInt)
xf86UnMapVidMem(screen, INTPriv(pInt)->vRam, size);
}
-_X_EXPORT Bool
+Bool
MapCurrentInt10(xf86Int10InfoPtr pInt)
{
/* nothing to do here */
return TRUE;
}
-_X_EXPORT void
+void
xf86FreeInt10(xf86Int10InfoPtr pInt)
{
if (!pInt)
@@ -345,7 +345,7 @@ xf86FreeInt10(xf86Int10InfoPtr pInt)
xfree(pInt);
}
-_X_EXPORT void *
+void *
xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off)
{
int pagesize = getpagesize();
@@ -373,7 +373,7 @@ xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off)
return (char *)INTPriv(pInt)->base + *off;
}
-_X_EXPORT void
+void
xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
{
int pagesize = getpagesize();
@@ -486,7 +486,7 @@ write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
V_ADDR_WB(addr + 3, val >> 24);
}
-_X_EXPORT pointer
+pointer
xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
{
return V_ADDR(addr);
diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index ab559eda9..1c89ce508 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -49,7 +49,7 @@ static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set);
#define REG pInt
-_X_EXPORT int
+int
setup_int(xf86Int10InfoPtr pInt)
{
if (pInt != Int10Current) {
@@ -78,7 +78,7 @@ setup_int(xf86Int10InfoPtr pInt)
return xf86BlockSIGIO();
}
-_X_EXPORT void
+void
finish_int(xf86Int10InfoPtr pInt, int sig)
{
xf86UnblockSIGIO(sig);
@@ -98,20 +98,20 @@ finish_int(xf86Int10InfoPtr pInt, int sig)
}
/* general software interrupt handler */
-_X_EXPORT CARD32
+CARD32
getIntVect(xf86Int10InfoPtr pInt,int num)
{
return MEM_RW(pInt, num << 2) + (MEM_RW(pInt, (num << 2) + 2) << 4);
}
-_X_EXPORT void
+void
pushw(xf86Int10InfoPtr pInt, CARD16 val)
{
X86_ESP -= 2;
MEM_WW(pInt, ((CARD32) X86_SS << 4) + X86_SP, val);
}
-_X_EXPORT int
+int
run_bios_int(int num, xf86Int10InfoPtr pInt)
{
CARD32 eflags;
@@ -157,7 +157,7 @@ run_bios_int(int num, xf86Int10InfoPtr pInt)
}
/* Debugging stuff */
-_X_EXPORT void
+void
dump_code(xf86Int10InfoPtr pInt)
{
int i;
@@ -172,7 +172,7 @@ dump_code(xf86Int10InfoPtr pInt)
xf86ErrorFVerb(3, "\n");
}
-_X_EXPORT void
+void
dump_registers(xf86Int10InfoPtr pInt)
{
xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
@@ -192,7 +192,7 @@ dump_registers(xf86Int10InfoPtr pInt)
(unsigned long)X86_EIP, (unsigned long)X86_EFLAGS);
}
-_X_EXPORT void
+void
stack_trace(xf86Int10InfoPtr pInt)
{
int i = 0;
@@ -212,7 +212,7 @@ stack_trace(xf86Int10InfoPtr pInt)
xf86ErrorFVerb(3, "\n");
}
-_X_EXPORT int
+int
port_rep_inb(xf86Int10InfoPtr pInt,
CARD16 port, CARD32 base, int d_f, CARD32 count)
{
@@ -228,7 +228,7 @@ port_rep_inb(xf86Int10InfoPtr pInt,
return dst - base;
}
-_X_EXPORT int
+int
port_rep_inw(xf86Int10InfoPtr pInt,
CARD16 port, CARD32 base, int d_f, CARD32 count)
{
@@ -244,7 +244,7 @@ port_rep_inw(xf86Int10InfoPtr pInt,
return dst - base;
}
-_X_EXPORT int
+int
port_rep_inl(xf86Int10InfoPtr pInt,
CARD16 port, CARD32 base, int d_f, CARD32 count)
{
@@ -260,7 +260,7 @@ port_rep_inl(xf86Int10InfoPtr pInt,
return dst - base;
}
-_X_EXPORT int
+int
port_rep_outb(xf86Int10InfoPtr pInt,
CARD16 port, CARD32 base, int d_f, CARD32 count)
{
@@ -276,7 +276,7 @@ port_rep_outb(xf86Int10InfoPtr pInt,
return dst - base;
}
-_X_EXPORT int
+int
port_rep_outw(xf86Int10InfoPtr pInt,
CARD16 port, CARD32 base, int d_f, CARD32 count)
{
@@ -292,7 +292,7 @@ port_rep_outw(xf86Int10InfoPtr pInt,
return dst - base;
}
-_X_EXPORT int
+int
port_rep_outl(xf86Int10InfoPtr pInt,
CARD16 port, CARD32 base, int d_f, CARD32 count)
{
@@ -308,7 +308,7 @@ port_rep_outl(xf86Int10InfoPtr pInt,
return dst - base;
}
-_X_EXPORT CARD8
+CARD8
x_inb(CARD16 port)
{
CARD8 val;
@@ -337,7 +337,7 @@ x_inb(CARD16 port)
return val;
}
-_X_EXPORT CARD16
+CARD16
x_inw(CARD16 port)
{
CARD16 val;
@@ -359,7 +359,7 @@ x_inw(CARD16 port)
return val;
}
-_X_EXPORT void
+void
x_outb(CARD16 port, CARD8 val)
{
if ((port == 0x43) && (val == 0)) {
@@ -390,7 +390,7 @@ x_outb(CARD16 port, CARD8 val)
}
}
-_X_EXPORT void
+void
x_outw(CARD16 port, CARD16 val)
{
@@ -401,7 +401,7 @@ x_outw(CARD16 port, CARD16 val)
}
}
-_X_EXPORT CARD32
+CARD32
x_inl(CARD16 port)
{
CARD32 val;
@@ -414,7 +414,7 @@ x_inl(CARD16 port)
return val;
}
-_X_EXPORT void
+void
x_outl(CARD16 port, CARD32 val)
{
if (!pciCfg1out(port, val)) {
@@ -424,37 +424,37 @@ x_outl(CARD16 port, CARD32 val)
}
}
-_X_EXPORT CARD8
+CARD8
Mem_rb(CARD32 addr)
{
return (*Int10Current->mem->rb)(Int10Current, addr);
}
-_X_EXPORT CARD16
+CARD16
Mem_rw(CARD32 addr)
{
return (*Int10Current->mem->rw)(Int10Current, addr);
}
-_X_EXPORT CARD32
+CARD32
Mem_rl(CARD32 addr)
{
return (*Int10Current->mem->rl)(Int10Current, addr);
}
-_X_EXPORT void
+void
Mem_wb(CARD32 addr, CARD8 val)
{
(*Int10Current->mem->wb)(Int10Current, addr, val);
}
-_X_EXPORT void
+void
Mem_ww(CARD32 addr, CARD16 val)
{
(*Int10Current->mem->ww)(Int10Current, addr, val);
}
-_X_EXPORT void
+void
Mem_wl(CARD32 addr, CARD32 val)
{
(*Int10Current->mem->wl)(Int10Current, addr, val);
@@ -613,7 +613,7 @@ pciCfg1outb(CARD16 addr, CARD8 val)
return 0;
}
-_X_EXPORT CARD8
+CARD8
bios_checksum(const CARD8 *start, int size)
{
CARD8 sum = 0;
@@ -641,7 +641,7 @@ bios_checksum(const CARD8 *start, int size)
* the driver would have to load the vga-module prior to
* doing int10.
*/
-_X_EXPORT void
+void
LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
{
xf86SetCurrentAccess(FALSE, xf86Screens[pInt->scrnIndex]);
@@ -660,7 +660,7 @@ LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
xf86SetCurrentAccess(TRUE, xf86Screens[pInt->scrnIndex]);
}
-_X_EXPORT void
+void
UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
{
xf86SetCurrentAccess(FALSE, xf86Screens[pInt->scrnIndex]);
@@ -693,7 +693,7 @@ SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set)
xf86UnMapVidMem(pInt->scrnIndex,base,pagesize);
}
-_X_EXPORT void
+void
xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save)
{
int pagesize = getpagesize();
@@ -724,7 +724,7 @@ xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save)
}
#endif
-_X_EXPORT xf86Int10InfoPtr
+xf86Int10InfoPtr
xf86InitInt10(int entityIndex)
{
return xf86ExtendedInitInt10(entityIndex, 0);
diff --git a/hw/xfree86/int10/helper_mem.c b/hw/xfree86/int10/helper_mem.c
index 16d7c175c..6f6ecc2b3 100644
--- a/hw/xfree86/int10/helper_mem.c
+++ b/hw/xfree86/int10/helper_mem.c
@@ -34,7 +34,7 @@ static const OptionInfoRec INT10Options[] = {
};
#ifdef DEBUG
-_X_EXPORT void
+void
dprint(unsigned long start, unsigned long size)
{
int i,j;
@@ -62,7 +62,7 @@ dprint(unsigned long start, unsigned long size)
* BIOS. Most of this information was pulled from
* dosemu.
*/
-_X_EXPORT void
+void
setup_int_vect(xf86Int10InfoPtr pInt)
{
int i;
@@ -105,7 +105,7 @@ setup_int_vect(xf86Int10InfoPtr pInt)
}
#endif
-_X_EXPORT int
+int
setup_system_bios(void *base_addr)
{
char *base = (char *) base_addr;
@@ -127,7 +127,7 @@ setup_system_bios(void *base_addr)
return 1;
}
-_X_EXPORT void
+void
reset_int_vect(xf86Int10InfoPtr pInt)
{
/*
@@ -176,7 +176,7 @@ reset_int_vect(xf86Int10InfoPtr pInt)
MEM_WW(pInt, (0x6D << 2) + 2, SYS_BIOS >> 4);
}
-_X_EXPORT void
+void
set_return_trap(xf86Int10InfoPtr pInt)
{
/*
@@ -191,7 +191,7 @@ set_return_trap(xf86Int10InfoPtr pInt)
xf86Int10AllocPages(pInt, 1, &pInt->stackseg);
}
-_X_EXPORT void *
+void *
xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex)
{
EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
@@ -220,7 +220,7 @@ xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex)
return options;
}
-_X_EXPORT Bool
+Bool
int10skip(const void* options)
{
Bool noint10 = FALSE;
@@ -231,7 +231,7 @@ int10skip(const void* options)
return noint10;
}
-_X_EXPORT Bool
+Bool
int10_check_bios(int scrnIndex, int codeSeg, const unsigned char* vbiosMem)
{
int size;
@@ -258,7 +258,7 @@ int10_check_bios(int scrnIndex, int codeSeg, const unsigned char* vbiosMem)
return TRUE;
}
-_X_EXPORT Bool
+Bool
initPrimary(const void* options)
{
Bool initPrimary = FALSE;
@@ -269,7 +269,7 @@ initPrimary(const void* options)
return initPrimary;
}
-_X_EXPORT BusType
+BusType
xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt)
{
BusType location_type;
@@ -290,7 +290,7 @@ xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt)
return FALSE; \
}
-_X_EXPORT Bool
+Bool
xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base)
{
unsigned i;
diff --git a/hw/xfree86/int10/stub.c b/hw/xfree86/int10/stub.c
index 4d9fe520a..58b65782c 100644
--- a/hw/xfree86/int10/stub.c
+++ b/hw/xfree86/int10/stub.c
@@ -13,56 +13,56 @@
#define _INT10_PRIVATE
#include "xf86int10.h"
-_X_EXPORT xf86Int10InfoPtr
+xf86Int10InfoPtr
xf86InitInt10(int entityIndex)
{
return xf86ExtendedInitInt10(entityIndex, 0);
}
-_X_EXPORT xf86Int10InfoPtr
+xf86Int10InfoPtr
xf86ExtendedInitInt10(int entityIndex, int Flags)
{
return NULL;
}
-_X_EXPORT Bool
+Bool
MapCurrentInt10(xf86Int10InfoPtr pInt)
{
return FALSE;
}
-_X_EXPORT void
+void
xf86FreeInt10(xf86Int10InfoPtr pInt)
{
return;
}
-_X_EXPORT void *
+void *
xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off)
{
*off = 0;
return NULL;
}
-_X_EXPORT void
+void
xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
{
return;
}
-_X_EXPORT Bool
+Bool
xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
{
return FALSE;
}
-_X_EXPORT void
+void
xf86ExecX86int10(xf86Int10InfoPtr pInt)
{
return;
}
-_X_EXPORT pointer
+pointer
xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
{
return 0;
diff --git a/hw/xfree86/int10/xf86int10.c b/hw/xfree86/int10/xf86int10.c
index a7904dc6a..51eb91fbb 100644
--- a/hw/xfree86/int10/xf86int10.c
+++ b/hw/xfree86/int10/xf86int10.c
@@ -17,7 +17,7 @@
#define REG pInt
-_X_EXPORT xf86Int10InfoPtr Int10Current = NULL;
+xf86Int10InfoPtr Int10Current = NULL;
static int int1A_handler(xf86Int10InfoPtr pInt);
#ifndef _PC
@@ -27,7 +27,7 @@ static int intE6_handler(xf86Int10InfoPtr pInt);
static struct pci_device *findPci(xf86Int10InfoPtr pInt, unsigned short bx);
static CARD32 pciSlotBX( const struct pci_device * pvp );
-_X_EXPORT int
+int
int_handler(xf86Int10InfoPtr pInt)
{
int num = pInt->num;
diff --git a/hw/xfree86/int10/xf86int10.h b/hw/xfree86/int10/xf86int10.h
index 2af709b9a..ba9ee5276 100644
--- a/hw/xfree86/int10/xf86int10.h
+++ b/hw/xfree86/int10/xf86int10.h
@@ -61,15 +61,18 @@ typedef struct {
} legacyVGARec, *legacyVGAPtr;
/* OS dependent functions */
-xf86Int10InfoPtr xf86InitInt10(int entityIndex);
-xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags);
-void xf86FreeInt10(xf86Int10InfoPtr pInt);
-void *xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off);
-void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num);
-pointer xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr);
+extern _X_EXPORT xf86Int10InfoPtr xf86InitInt10(int entityIndex);
+extern _X_EXPORT xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex,
+ int Flags);
+extern _X_EXPORT void xf86FreeInt10(xf86Int10InfoPtr pInt);
+extern _X_EXPORT void *xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num,
+ int *off);
+extern _X_EXPORT void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase,
+ int num);
+extern _X_EXPORT pointer xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr);
/* x86 executor related functions */
-void xf86ExecX86int10(xf86Int10InfoPtr pInt);
+extern _X_EXPORT void xf86ExecX86int10(xf86Int10InfoPtr pInt);
#ifdef _INT10_PRIVATE
@@ -112,12 +115,12 @@ void xf86ExecX86int10(xf86Int10InfoPtr pInt);
#define MEM_WL(name, addr, val) (*name->mem->wl)(name, addr, val)
/* OS dependent functions */
-Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
+extern _X_EXPORT Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
/* x86 executor related functions */
-Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
+extern _X_EXPORT Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
/* int.c */
-extern xf86Int10InfoPtr Int10Current;
+extern _X_EXPORT xf86Int10InfoPtr Int10Current;
int int_handler(xf86Int10InfoPtr pInt);
/* helper_exec.c */
@@ -133,7 +136,7 @@ CARD8 bios_checksum(const CARD8 *start, int size);
void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
#if defined (_PC)
-void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save);
+extern _X_EXPORT void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save);
#endif
int port_rep_inb(xf86Int10InfoPtr pInt,
CARD16 port, CARD32 base, int d_f, CARD32 count);
@@ -167,13 +170,13 @@ void setup_int_vect(xf86Int10InfoPtr pInt);
int setup_system_bios(void *base_addr);
void reset_int_vect(xf86Int10InfoPtr pInt);
void set_return_trap(xf86Int10InfoPtr pInt);
-void * xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex);
+extern _X_EXPORT void * xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex);
Bool int10skip(const void* options);
Bool int10_check_bios(int scrnIndex, int codeSeg,
const unsigned char* vbiosMem);
Bool initPrimary(const void* options);
-BusType xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt);
-Bool xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base);
+extern _X_EXPORT BusType xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt);
+extern _X_EXPORT Bool xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base);
#ifdef DEBUG
void dprint(unsigned long start, unsigned long size);
#endif
diff --git a/hw/xfree86/int10/xf86x86emu.c b/hw/xfree86/int10/xf86x86emu.c
index a884bf971..83663b0e6 100644
--- a/hw/xfree86/int10/xf86x86emu.c
+++ b/hw/xfree86/int10/xf86x86emu.c
@@ -28,7 +28,7 @@ x86emu_do_int(int num)
}
}
-_X_EXPORT void
+void
xf86ExecX86int10(xf86Int10InfoPtr pInt)
{
int sig = setup_int(pInt);
@@ -43,7 +43,7 @@ xf86ExecX86int10(xf86Int10InfoPtr pInt)
finish_int(pInt, sig);
}
-_X_EXPORT Bool
+Bool
xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
{
int i;