freebsd-dev/sys/conf
Bill Paul d8f2dda739 Add support for Windows/x86-64 binaries to Project Evil.
Ville-Pertti Keinonen (will at exomi dot comohmygodnospampleasekthx)
deserves a big thanks for submitting initial patches to make it
work. I have mangled his contributions appropriately.

The main gotcha with Windows/x86-64 is that Microsoft uses a different
calling convention than everyone else. The standard ABI requires using
6 registers for argument passing, with other arguments on the stack.
Microsoft uses only 4 registers, and requires the caller to leave room
on the stack for the register arguments incase the callee needs to
spill them. Unlike x86, where Microsoft uses a mix of _cdecl, _stdcall
and _fastcall, all routines on Windows/x86-64 uses the same convention.
This unfortunately means that all the functions we export to the
driver require an intermediate translation wrapper. Similarly, we have
to wrap all calls back into the driver binary itself.

The original patches provided macros to wrap every single routine at
compile time, providing a secondary jump table with a customized
wrapper for each exported routine. I decided to use a different approach:
the call wrapper for each function is created from a template at
runtime, and the routine to jump to is patched into the wrapper as
it is created. The subr_pe module has been modified to patch in the
wrapped function instead of the original. (On x86, the wrapping
routine is a no-op.)

There are some minor API differences that had to be accounted for:

- KeAcquireSpinLock() is a real function on amd64, not a macro wrapper
  around KfAcquireSpinLock()
- NdisFreeBuffer() is actually IoFreeMdl(). I had to change the whole
  NDIS_BUFFER API a bit to accomodate this.

Bugs fixed along the way:
- IoAllocateMdl() always returned NULL
- kern_windrv.c:windrv_unload() wasn't releasing private driver object
  extensions correctly (found thanks to memguard)

This has only been tested with the driver for the Broadcom 802.11g
chipset, which was the only Windows/x86-64 driver I could find.
2005-02-16 05:41:18 +00:00
..
defines
files Add sys/dev/ieee488/ibfoo.c for hte pcii driver. Fixes the broken tinderbox 2005-02-14 06:00:34 +00:00
files.alpha Break out obscure ISA cards into their own files, as well as ne2000 2005-02-09 20:03:40 +00:00
files.amd64 Add support for Windows/x86-64 binaries to Project Evil. 2005-02-16 05:41:18 +00:00
files.arm Add arm/mem.c. 2004-11-22 22:20:50 +00:00
files.i386 Break out obscure ISA cards into their own files, as well as ne2000 2005-02-09 20:03:40 +00:00
files.ia64 It appears that 'kbd' device has never been used and isn't needed. 2004-11-23 00:00:43 +00:00
files.pc98 Fix build error (s/wd80x3.c/if_ed_wd80x3.c/). 2005-02-11 03:44:03 +00:00
files.powerpc Add /dev/mem and /dev/kmem to powerpc. 2004-08-16 13:07:40 +00:00
files.sparc64 Back out no longer necessary work-arounds added in rev. 1.59 for building 2005-02-12 19:19:20 +00:00
kern.mk Define INLINE_LIMIT for arm. 2004-05-14 13:35:46 +00:00
kern.post.mk Back when VOP_* was introduced, we did not have new-style struct 2004-12-01 23:16:38 +00:00
kern.pre.mk Barrow from kmod.mk and protect against adding -fno-strict-aliasing 2005-02-13 05:58:40 +00:00
kmod_syms.awk Our awk does not implement the ARGIND variable, so we were attempting 2002-08-06 19:31:04 +00:00
kmod.mk Further embellish rev. 1.180: protect against -fno-strict-aliasing 2005-02-11 21:04:20 +00:00
ldscript.alpha Have the linker provide the btext symbol when referenced. This is needed 2004-08-27 19:13:35 +00:00
ldscript.amd64 Provide the _start_ctors and _stop_ctors symbols. As on i386, the addresses 2004-05-29 01:09:00 +00:00
ldscript.arm Use the address provided in the conf file, instead of hardcode 0xc0000000. 2004-09-23 22:52:55 +00:00
ldscript.i386 Align the .ctors section correctly. 2003-12-03 07:40:03 +00:00
ldscript.ia64 Have the linker provide btext. It's used for profiling. 2004-08-25 07:43:28 +00:00
ldscript.powerpc
ldscript.sparc64 Use the same SEARCH_DIR as other platforms. 2003-06-07 18:23:50 +00:00
majors nos->now typo reported by njl 2004-12-27 18:58:57 +00:00
majors.awk Add necessary awk magic to create a table of major numbers allocated 2003-02-27 08:52:11 +00:00
Makefile.alpha bump the Makefile config versions now that config is 600001... 2005-02-10 21:15:31 +00:00
Makefile.amd64 bump the Makefile config versions now that config is 600001... 2005-02-10 21:15:31 +00:00
Makefile.arm bump the Makefile config versions now that config is 600001... 2005-02-10 21:15:31 +00:00
Makefile.i386 bump the Makefile config versions now that config is 600001... 2005-02-10 21:15:31 +00:00
Makefile.ia64 bump the Makefile config versions now that config is 600001... 2005-02-10 21:15:31 +00:00
Makefile.pc98 bump the Makefile config versions now that config is 600001... 2005-02-10 21:15:31 +00:00
Makefile.powerpc bump the Makefile config versions now that config is 600001... 2005-02-10 21:15:31 +00:00
Makefile.sparc64 bump the Makefile config versions now that config is 600001... 2005-02-10 21:15:31 +00:00
makeLINT.mk Implemented "nooption" and "nomakeoption" config(8) tokens. 2003-02-26 23:36:59 +00:00
makeLINT.sed Implemented "nooption" and "nomakeoption" config(8) tokens. 2003-02-26 23:36:59 +00:00
newvers.sh If USER of HOSTNAME is set to an empty value, use the fallback value. 2005-01-15 13:25:41 +00:00
NOTES Fix sloppy use of "manpage", bump .Dd where applicable and rename RED to 2005-02-07 23:20:12 +00:00
options Break out obscure ISA cards into their own files, as well as ne2000 2005-02-09 20:03:40 +00:00
options.alpha Update for the KDB framework. Sanitize the alpha console code now that 2004-07-10 22:29:41 +00:00
options.amd64 Add support for Windows/x86-64 binaries to Project Evil. 2005-02-16 05:41:18 +00:00
options.arm Add a new option, ARM32_NEW_VM_LAYOUT. When set, we try to put up to 4 2004-11-10 22:08:27 +00:00
options.i386 Initiate deorbit burn sequence for 80386 support in FreeBSD: Remove 2004-11-16 20:42:32 +00:00
options.ia64 Catch up with the drive-by renaming of IA32 to COMPAT_IA32. It must 2004-08-16 18:54:23 +00:00
options.pc98 The bs and wdc drivers are gone. 2005-02-04 15:29:54 +00:00
options.powerpc Catch up with sparc64 OFWCONS_POLL_HZ change 2004-06-25 13:44:34 +00:00
options.sparc64 Better OFW console support on Sun Ultra2 machines. 2004-06-24 02:57:11 +00:00
systags.sh Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00