From e37bcac1dc7ae8058fca0b5087bbfe89624d596e Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 13 Mar 2024 13:27:44 +0100 Subject: [PATCH] xfree86: linux: int10: drop dead code The code pieces inside `ifdef DoSubModule` aren't used anymore since very long time. There's no evidence of this symbol ever been set in the whole git history, so it must be an really ancient relic, that nobody used for decades. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- hw/xfree86/os-support/linux/int10/linux.c | 64 ----------------------- 1 file changed, 64 deletions(-) diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c index 6ca118f25..42f872dd2 100644 --- a/hw/xfree86/os-support/linux/int10/linux.c +++ b/hw/xfree86/os-support/linux/int10/linux.c @@ -55,21 +55,6 @@ typedef struct { char *alloc; } linuxInt10Priv; -#if defined DoSubModules - -typedef enum { - INT10_NOT_LOADED, - INT10_LOADED_VM86, - INT10_LOADED_X86EMU, - INT10_LOAD_FAILED -} Int10LinuxSubModuleState; - -static Int10LinuxSubModuleState loadedSubModule = INT10_NOT_LOADED; - -static Int10LinuxSubModuleState int10LinuxLoadSubModule(ScrnInfoPtr pScrn); - -#endif /* DoSubModules */ - static Bool readLegacy(struct pci_device *dev, unsigned char *buf, int base, int len) { @@ -118,14 +103,6 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) return NULL; } -#if defined DoSubModules - if (loadedSubModule == INT10_NOT_LOADED) - loadedSubModule = int10LinuxLoadSubModule(pScrn); - - if (loadedSubModule == INT10_LOAD_FAILED) - return NULL; -#endif - if ((!vidMem) || (!sysMem)) { if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) { if (!sysMem) { @@ -518,44 +495,3 @@ xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr) else return (void *) (memType) addr; } - -#if defined DoSubModules - -static Bool -vm86_tst(void) -{ - int __res; - -#ifdef __PIC__ - /* When compiling with -fPIC, we can't use asm constraint "b" because - %ebx is already taken by gcc. */ - __asm__ __volatile__("pushl %%ebx\n\t" - "movl %2,%%ebx\n\t" - "movl %1,%%eax\n\t" - "int $0x80\n\t" "popl %%ebx":"=a"(__res) - :"n"((int) 113), "r"(NULL)); -#else - __asm__ __volatile__("int $0x80\n\t":"=a"(__res):"a"((int) 113), - "b"((struct vm86_struct *) NULL)); -#endif - - if (__res < 0 && __res == -ENOSYS) - return FALSE; - - return TRUE; -} - -static Int10LinuxSubModuleState -int10LinuxLoadSubModule(ScrnInfoPtr pScrn) -{ - if (vm86_tst()) { - if (xf86LoadSubModule(pScrn, "vm86")) - return INT10_LOADED_VM86; - } - if (xf86LoadSubModule(pScrn, "x86emu")) - return INT10_LOADED_X86EMU; - - return INT10_LOAD_FAILED; -} - -#endif /* DoSubModules */