summaryrefslogtreecommitdiff
path: root/hw/xfree86/x86emu
AgeCommit message (Collapse)AuthorFilesLines
2013-11-12Avoid conflicts with Solaris <sys/regset.h> defines that clash with our namesAlan Coopersmith3-1/+30
When building on Solaris with _XOPEN_SOURCE set to a recent XPG release, <stdlib.h> and other core headers start including <sys/regset.h>, which has a bunch of unfortunately named macros such as "CS", "ES", etc. for x86 & x64 registers which clash with existing variable & struct member names in Xorg - so #undef these so they don't interfere with our use. (Yes, have filed a bug against the system headers for exposing these, but this solves the problem for building on existing releases.) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-08-06Replace INCLUDES with AM_CPPFLAGSPeter Hutterer1-1/+1
newer automake gets quite noisy about this. hw/xfree86/ddc/Makefile.am:7: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') and many more of these. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21Introduce a consistent coding styleKeith Packard20-5207/+6193
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-12x86emu: constify debug stringsAlan Coopersmith4-14/+14
Strings are all pointers to literal constants, just used as input to printf calls when debugging is enabled. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-11-23Convert a bunch of sprintf to snprintf callsAlan Coopersmith1-1/+1
This batch is the straightforward set - others are more complex and need more analysis to determine right size to pass. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-15x86emu: There is no NO_INLINE implementation of unaligned access here.Jamey Sharp1-2/+0
Patch produced with: unifdef -UNO_INLINE -B This change isn't relevant to the similar code in hw/xfree86/common/compiler.h, because x86emu is expected to someday move out of xserver entirely and so should not depend on any xserver headers. Also, some platforms apparently do have NO_INLINE versions of compiler.h. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2011-01-04x86emu: Fix more mis-decoding of the data prefixAdam Jackson1-18/+45
cc2c73ddcb4370a7c3ad439cda4da825156c26c9's three-cent titanium tax doesn't go too far enough. Fix the rest of the call and jmp instructions to handle the data prefix correctly. Reference: Intel 64 and IA-32 Architectures Software Developer's Manual Volume 2A: Instruction Set Reference, A-M http://www.intel.com/Assets/PDF/manual/253666.pdf Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-10x86emu: fix jump_near_IMM to handle DATA: flag correctly.Luc Verhaegen1-6/+14
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24348 Before (data flag ignored -> broken): 66 DATA: e944f1 JMP 1ff6 After (fixed): 66 DATA: e944f1ffff JMP 00001ff8 This subtle difference in the length of decoded instruction meant that the VBE call jumped to the routine setting AX=0x14F (VBE Failed) instead of the routine that set AX=0x4F (VBE success). The ability to run the same code in vm86 significantly aided the debugging of this issue. Those X.org developers who would like to drop vm86 better take special care towards _all_ vesa bugs, as those will expose further issues. Patch applies easily to even xserver 1.4.2. Signed-off-by: Luc Verhaegen <libv@skynet.be> Tested-by: Luc Verhaegen <libv@skynet.be> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-07Convert x86emu fixed size int typedefs to use stdint typesAlan Coopersmith1-33/+9
Fixes x86emu builds when using non-gnu compilers now that u64 is required Before this fix, the u64 type would not be defined, causing x86emu/sys.c to fail to build: "sys.c", line 102: syntax error before or at: ldq_u "sys.c", line 102: syntax error before or at: * Since Keith requested using <stdint.h>, converted all the x86emu typedefs to use the stdint types. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Matt Turner <mattst88@gmail.com> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-03Replace assembly with generic unaligned access codeMatt Turner1-162/+74
Removes Alpha assembly, and probably works around unaligned accesses on other sensitive platforms. Signed-off-by: Matt Turner <mattst88@gmail.com> Acked-by: Adam Jackson <ajax@redhat.com> Compiled-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-17Use C-style comments in x86emuMatt Turner2-4/+4
Signed-off-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27x86emu: Respect the LEA 67h address size prefix.Christian Zander1-25/+45
Signed-off-by: Christian Zander <chzander@nvidia.com> Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-08Revert "Make sys.c use unaligned access functions provided in compiler."Tiago Vignatti2-2/+181
This reverts commit da923d0bc15e99a8ed1986bd6f5df37f7af7284b. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-15Fix builds with --with-int10=stubAlan Coopersmith1-0/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Adam Jackson <ajax@redhat.com>
2009-11-01Make sys.c use unaligned access functions provided in compiler.Matt Turner2-181/+2
Favorite deleted line was definitely /* to cope with broken egcs-1.1.2 :-(((( */ Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-11Revert "Make sys.c use compiler.h unaligned access functions"Tiago Vignatti1-1/+182
This reverts commit 1b30545c04a51bfa3ff95a26d64962907a62ff15. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-31Make sys.c use compiler.h unaligned access functionsMatt Turner1-182/+1
Signed-off-by: Matt Turner <mattst88@gmail.com>
2008-12-07Convert libx86emu.a to a "libtool convenience library".Paulo Cesar Pereira de Andrade1-2/+2
2008-10-26x86emu: fix sparse warningsJulien Cristau1-2/+2
ops2.c:113:18: warning: Using plain integer as NULL pointer ops2.c:207:18: warning: Using plain integer as NULL pointer
2008-07-23Unifdef sgi.Adam Jackson1-3/+2
2008-07-23Assume __GNUC__ >= 3.Adam Jackson1-61/+7
gcc 3.0 was seven years ago. Get with the times.
2008-06-24x86emu: fix build, fallout from 9719354Julien Cristau1-1/+1
2008-06-24Check for __amd64__, not __x86_64__.Adam Jackson3-3/+3
Spiritual revert of 1fa4de80fcfc697b5e5879cc351fb3e9dbf6acbe. Intel's C compiler claims to be gcc-compatible; if they're not defining the same macros as gcc then that's their bug, not ours. Even if we were to do this aliasing we should do it once and for all in servermd.h.
2008-06-23Implement bswap in x86emu.Adam Jackson1-8/+55
Yes, this is a 486+ instruction and thus not strictly legal in vm86 mode, but enough BIOSes use it (looking at you VIA) that we might as well implement it.
2008-04-12Check for __x86_64__ when we check for __amd64__Matt Turner3-3/+3
It seems Intel C Compiler neglects to define __amd64__, __amd64, or amd64, but *does* define __x86_64__.
2008-03-05Fix distcheck.Adam Jackson1-0/+1
(cherry picked from commit 2a47accff8dccded4dfe031f9366c028ba927824)
2008-02-08X86EMU: handle CPUID instructionBart Trojanowski4-1/+161
After trying to switch from X to VT (or just quit) the video-amd driver attempts to issue INT 10/0 to go to mode 3 (VGA). The emulator, running the BIOS code, would then spit out: c000:0282: A2 ILLEGAL EXTENDED X86 OPCODE! The opcode was 0F A2, or CPUID; it was not implemented in the emulator. This simple patch, against 1.3.0.0, handles the CPUID instruction in one of two ways: 1) if ran on __i386__ or __x86_64__ then it calls the CPUID instruction directly. 2) if ran elsewhere it returns a canned 486dx4 set of values for function 1. This fix allows the video-amd driver to switch back to console mode, with the GSW BIOS. Thanks to Symbio Technologies for funding my work, and ThinCan for providing hardware :) Signed-off-by: Bart Trojanowski <bart@jukie.net> Acked-by: Eric Anholt <eric@anholt.net>
2007-07-02Make x86emu's I/O cycle tracing more useful.Adam Jackson1-0/+2
Print debug messages only when the appropriate debug bit is set in the 8086 state vector, so you can focus in on the call you're actually interested in.
2007-03-15Fix calculations in x86 emulator for the long long case (Andreas Schwab).Matthias Hopf1-2/+2
2007-02-06Add an RDTSC implementation to the x86 emulator.Aaron Plattner1-1/+35
This instruction is being used in some debug VBIOSes. This implementation doesn't even try to be accurate. Instead, it just increments the counter by a fixed amount every time an rdtsc instruction in encountered, to avoid divides by zero.
2007-01-03Fix BSF and BSR instructions in the x86 emulator.Aaron Plattner1-18/+18
Patch courtesy of Michael Yaroslavtsev.
2006-09-18Remove smashing of CFLAGS from server build.Keith Packard1-1/+1
CFLAGS is a user variable, extracted from the environment at configure time and settable by the user at build time. We must not override this variable.
2006-03-15Enable correct handling of the BTS instruction (opcode 0f ab) The code wasFelix Kuehling1-4/+2
there but #ifdefed out. Insead of BTS, BT was executed. This patch enables the BTS function and hooks it up the the correct opcode. (ATI Technologies Inc.)
2006-02-10Remove libcwrapper usage from xorg server modules. The libcwrapper is onlyEric Anholt2-1/+3
of (marginal) use in the drivers, and that usage remains.
2005-12-02Define XFree86Server only where it is required.Kevin E Martin1-1/+1
2005-11-29Fix usage of XFree86LOADER/XFree86Module/IN_MODULE and update loadableKevin E Martin1-1/+1
module builds to reflect this change.
2005-10-17include/dix-config.h.in Add support for more extensionsKevin E Martin1-1/+2
Add missing files to EXTRA_DIST
2005-09-13Don't define POSIX_SOURCE on any BSDs, since it breaks things.Eric Anholt1-1/+0
Define NO_SYS_HEADERS, as the monolithic build does. Helps FreeBSD. Don't include validate.c in the library, since it seems to be a userland test program.
2005-07-28Fix distcheck for serverKevin E Martin1-1/+19
2005-07-12add x86emu.Lars Knoll1-0/+8
2005-02-18Bug #2455: Make x86emu handle JNL correctly. (David Wong)Adam Jackson1-1/+1
2004-05-26Updated x86emu and resynced with upsteam at Scitech.Egbert Eich16-415/+166
2004-04-23Merging XORG-CURRENT into trunkEgbert Eich14-15/+16
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich14-14/+14
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0Egbert Eich14-14/+14
2004-02-26readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich14-14/+14
2004-02-26Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich14-14/+14
2004-02-23Import most of XFree86 4.4RC3. This import excludes files which have thexf86-4_3_99_903_specialKaleb Keithley1-29/+29
new license. If we want to, later we can import 4.4RC3 again and pick up the files that have the new license, but for now the vendor branch is "pure."
2003-12-19XFree86 4.3.99.902 (RC 2)xf86-4_3_99_902Kaleb Keithley1-1/+5
2003-11-25XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16Kaleb Keithley6-31/+50