freebsd-skq/sys/modules
wpaul 07b632956a 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
..
3dfx
aac Only compile aac_linux.ko for i386 2004-08-30 03:35:17 +00:00
accf_data
accf_http
acpi Hook acpi_throttle(4) up to the build. It's currently part of acpi_perf.ko 2005-02-06 21:13:41 +00:00
agp The tinderbox seems to have a different set of compiler options 2005-01-26 21:18:58 +00:00
aha
ahb Add the ahb module for old Adaptec 1742 drivers now that eisa bus 2004-06-29 20:50:24 +00:00
aic Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
aic7xxx Add WERRROR= to work around the warnings 2005-01-26 16:29:07 +00:00
aio
amd Move the amd(4) driver to it's own directory in preparation for it growing 2002-12-13 22:59:18 +00:00
amr (1) added LSI Logic copyright, and legal line 3 in license, and string 2002-10-18 21:29:14 +00:00
an Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
aout
apm Merge PC98 support. 2003-03-25 05:19:18 +00:00
ar Convert Netgraph to use mbuf tags to pass its meta information around. 2004-06-25 19:22:05 +00:00
arcnet - add support for IPX (tested with mount -t nwfs and mars_nwe), 2003-01-24 01:32:20 +00:00
arl Use CFLAGS+=. 2005-02-09 11:50:43 +00:00
asr Fix the build. opt_asr.h is gone. 2004-04-22 02:22:18 +00:00
ath module for Atheros 802.11 driver 2003-06-23 17:02:43 +00:00
ath_hal Fix building for non-i386 platforms. 2005-01-18 03:28:08 +00:00
ath_rate_amrr Update/new modules for net80211 and ath changes. 2004-12-08 17:38:38 +00:00
ath_rate_onoe Update/new modules for net80211 and ath changes. 2004-12-08 17:38:38 +00:00
aue Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
auxio Port NetBSD auxio driver. The driver was modified to use led(4) and can 2004-10-09 07:31:03 +00:00
awi Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
axe Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
bfe Add a device driver for the Broadcom BCM4401 ethernet controller, 2003-09-09 18:17:23 +00:00
bge Remove miidevs.h and generate it from miidevs at compile time. 2003-01-19 02:59:34 +00:00
bios Add WERRROR= to work around the warnings 2005-01-26 16:29:07 +00:00
bktr We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
bridge opt_pfil_hooks.h is no longer required. 2004-08-27 19:57:33 +00:00
cam Remove the HW_WDOG option; it serves no purpose. 2004-08-29 11:10:09 +00:00
canbepm Add CanBe power management controller support. 2003-02-03 14:46:26 +00:00
canbus Add CanBe power management controller support. 2003-02-03 14:46:26 +00:00
cardbus
cbb And isa_if.h 2004-08-16 15:24:03 +00:00
cd9660 - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
cd9660_iconv - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
ciss - Comment a line which sets CISS_DEBUG by default. 2002-10-27 12:09:51 +00:00
cm
coda bsd.kmod.mk knows how to clean up opt_*.h files automatically, 2004-09-01 06:51:43 +00:00
coda5 bsd.kmod.mk knows how to clean up opt_*.h files automatically, 2004-09-01 06:51:43 +00:00
coff
cp Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
cpufreq Hook up the cpufreq framework, acpi_perf(4), and cpufreq(4) drivers. 2005-02-04 05:49:36 +00:00
crypto Push m_apply() and m_getptr() up into the colleciton of standard mbuf 2003-12-15 21:49:41 +00:00
cryptodev
cs Sort files alphabetically 2004-09-04 03:32:15 +00:00
ctau Mechanically tidy up the contents of CLEANFILES:M*.h: kmod.mk 2004-09-01 07:12:24 +00:00
cue Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
cx Mechanically tidy up the contents of CLEANFILES:M*.h: kmod.mk 2004-09-01 07:12:24 +00:00
dc
dcons Add dcons_os.{c,h}. 2004-10-13 05:41:09 +00:00
dcons_crom Add dcons_os.{c,h}. 2004-10-13 05:41:09 +00:00
de Document compile-time switches here as I'm going to yank them from 2004-07-09 02:38:25 +00:00
digi
dpt Add module infrastructure for 'dpt' driver. 2003-03-29 15:47:13 +00:00
drm bsd.kmod.mk does not deal with manpages anymore. 2004-01-13 11:28:51 +00:00
dummynet
ed Break out obscure ISA cards into their own files, as well as ne2000 2005-02-09 20:03:40 +00:00
el
elink Add module infrastructure for elink. 2003-03-29 13:42:20 +00:00
em style.Makefile(5) 2004-06-09 08:27:05 +00:00
en When compiling the module with INVARIANTS we also need INVARIANT_SUPPORT. 2003-08-06 16:01:32 +00:00
ep Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
esp Fix paths after repocopies done by scottl 2004-11-10 14:09:52 +00:00
ex Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
exca Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
ext2fs
fatm Removed -g from CFLAGS. There is a better way to build debugging 2004-02-13 10:11:01 +00:00
fdc Let kmod.mk touch opt_*.h files as needed. 2004-09-04 06:37:58 +00:00
fdescfs
fe Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
firewire Add fwip module. 2004-07-12 13:13:17 +00:00
fxp
gem Build a gem module, for sparc64 only for now. 2003-01-08 20:40:29 +00:00
geom Connect SHSEC GEOM class to the build. 2005-01-11 18:18:40 +00:00
harp Removed -g from CFLAGS. There is a better way to build debugging 2004-02-13 10:11:01 +00:00
hatm Removed -g from CFLAGS. There is a better way to build debugging 2004-02-13 10:11:01 +00:00
hfa Include "../Makefile.inc". 2002-11-06 13:41:40 +00:00
hifn fix module building; drivers now require opt_{ubsec,hifn}.h 2003-03-11 23:20:43 +00:00
hme Now that hme(4) is MI build its module on all platforms. 2004-08-14 22:40:16 +00:00
hpfs
hptmv Clean up some messy Makefile stuff so that this can be built into the 2004-10-24 08:38:29 +00:00
i2c Kill bogus isa compat opt file. 2004-03-15 11:27:39 +00:00
ibcs2
ichwd Add a driver for the watchdog timer function present on the LPC interface 2004-05-11 18:21:38 +00:00
ida ida(4) module. PCI only for now. 2004-01-11 07:01:30 +00:00
idt
ie Add WERRROR= to work around the warnings 2005-01-26 16:29:07 +00:00
if_disc
if_ef Removed custom "load" and "unload" targets. 2004-01-19 14:00:26 +00:00
if_faith
if_gif NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
if_gre Fix a bug whereby the physical endpoints of a gre(4) tunnel would not 2003-11-14 20:58:00 +00:00
if_ndis Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
if_ppp We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
if_sl
if_stf Add opt_mac.h to dependencies for if_stf.c module. 2002-10-20 22:57:22 +00:00
if_tap Mechanically tidy up the contents of CLEANFILES:M*.h: kmod.mk 2004-09-01 07:12:24 +00:00
if_tun We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
if_vlan
iir
io No need to generate vnode_if.h anymore 2004-12-29 08:44:30 +00:00
ip6fw
ip_mroute_mod Get rid of the RANDOM_IP_ID option and make it a sysctl. NetBSD 2004-08-14 15:32:40 +00:00
ipdivert Convert IPDIVERT into a loadable module. This makes use of the dynamic loadability 2004-10-19 21:14:57 +00:00
ipfilter Don't define PFIL_HOOKS. It's no longer required in RELENG_5 or HEAD. 2004-12-25 00:23:36 +00:00
ipfw IPDIVERT is a module now and tell the other parts of the kernel about it. 2004-10-25 20:02:34 +00:00
ips Add the 'ips' driver for the IBM (now Adaptec) ServeRAID controller 2003-05-11 06:36:49 +00:00
isp - Introduce an ofw_bus kobj-interface for retrieving the OFW node and a 2004-08-12 17:41:33 +00:00
ispfw
ixgb style.Makefile(5) 2004-06-09 08:27:05 +00:00
joy Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
kue Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
lge
libiconv - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
libmbpool Add a facility for devices, specifically network interfaces, that require 2003-07-15 08:59:38 +00:00
libmchain libmchain no longer exports m_fixhdr(); remove it from EXPORT_SYMS. 2002-12-14 00:01:51 +00:00
linprocfs Let kmod.mk touch opt_*.h files as needed. 2004-09-04 06:37:58 +00:00
linux o Remove @- from the ln and change it to a -sf. This was bogus, and 2003-11-19 05:08:27 +00:00
lnc Removed -g from CFLAGS. There is a better way to build debugging 2004-02-13 10:11:01 +00:00
lpt
mac_biba opt_mac.h is no longer required for any of these modules, remove from 2002-10-22 17:10:15 +00:00
mac_bsdextended
mac_ifoff opt_mac.h is no longer required for any of these modules, remove from 2002-10-22 17:10:15 +00:00
mac_lomac Hook up the mac_lomac module build. 2002-11-26 17:35:44 +00:00
mac_mls opt_mac.h is no longer required for any of these modules, remove from 2002-10-22 17:10:15 +00:00
mac_none opt_mac.h is no longer required for any of these modules, remove from 2002-10-22 17:10:15 +00:00
mac_partition Commit of Makefile missed in earlier pass. 2002-10-24 02:04:03 +00:00
mac_portacl mac_portacl.c no longer references vnode_if.h. 2004-12-30 13:49:01 +00:00
mac_seeotheruids
mac_stub Following the repo-copy from src/sys/modules/mac_none/Makefile, 2003-11-11 21:23:54 +00:00
mac_test opt_mac.h is no longer required for any of these modules, remove from 2002-10-22 17:10:15 +00:00
mcd opt_geom.h is no longer required for this module. 2003-03-29 16:13:11 +00:00
md change the name of the md module, to g_md, introduce a define with the 2004-08-09 06:45:20 +00:00
mem No need to generate vnode_if.h anymore 2004-12-29 08:44:30 +00:00
mii Add a PHY driver to support the built-in gigE PHY in the 8169S/8110S 2003-09-11 03:53:46 +00:00
mlx
mly
mpt Add a module for mpt(4). 2002-10-31 19:39:23 +00:00
msdosfs Let kmod.mk touch opt_*.h files as needed. 2004-09-04 06:37:58 +00:00
msdosfs_iconv - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
mse Separate mse driver into a core driver and a bus attachments. Separate out 2004-12-12 20:05:50 +00:00
my
ncp Removed custom "load" and "unload" targets. 2004-01-19 14:00:26 +00:00
ncv Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
ndis Add support for Windows/x86-64 binaries to Project Evil. 2005-02-16 05:41:18 +00:00
netgraph Connect ng_source(4) to the build. 2005-02-12 17:04:21 +00:00
nfs4client Let kmod.mk touch opt_*.h files as needed. 2004-09-04 06:37:58 +00:00
nfsclient Let kmod.mk touch opt_*.h files as needed. 2004-09-04 06:37:58 +00:00
nfsserver Permit MAC policies to instrument the access control decisions for 2002-11-04 15:13:36 +00:00
nge
nmdm Make TTYHOG tunable. 2003-03-05 08:16:29 +00:00
nsp Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
ntfs - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
ntfs_iconv - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
nullfs
nwfs Removed custom "load" and "unload" targets. 2004-01-19 14:00:26 +00:00
oldcard Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
oltr - Split out PCI support. 2005-02-03 23:01:01 +00:00
osf1 Removed -g from CFLAGS. There is a better way to build debugging 2004-02-13 10:11:01 +00:00
owi Let kmod.mk touch opt_*.h files as needed. 2004-09-04 06:37:58 +00:00
patm Removed -g from CFLAGS. There is a better way to build debugging 2004-02-13 10:11:01 +00:00
pccard Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
pcfclock
pcn
pecoff Removed -g from CFLAGS. There is a better way to build debugging 2004-02-13 10:11:01 +00:00
pf NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
plip
pmc Move adding -DPC98 to CFLAGS from each modules to sys/modules/Makefile.inc. 2002-11-06 13:47:00 +00:00
portalfs
ppbus o Remove @- from the ln and change it to a -sf. This was bogus, and 2003-11-19 05:08:27 +00:00
ppi o Remove @- from the ln and change it to a -sf. This was bogus, and 2003-11-19 05:08:27 +00:00
pps o Remove @- from the ln and change it to a -sf. This was bogus, and 2003-11-19 05:08:27 +00:00
procfs Slightly change the semantics of vnode labels for MAC: rather than 2002-10-26 14:38:24 +00:00
pseudofs
pst Add pst as a module 2003-08-30 08:01:05 +00:00
random Include nehemiah.c only on i386, as is done for the non-modules 2004-04-11 15:40:18 +00:00
ray Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
rc Make TTYHOG tunable. 2003-03-05 08:16:29 +00:00
rc4 make rc4 crypto support a module so other modules can depend on it 2003-01-15 19:55:17 +00:00
re Fix PATH: directive in sys/modules/re/Makefile, and add the re(4) driver to 2003-09-08 03:24:29 +00:00
rl
rndtest FIPS 140-2 rng data tester for h/w crypto devices. This driver periodically 2003-03-11 19:26:16 +00:00
rp
rue Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
s3
safe SafeNet crypto driver 2003-07-21 21:47:47 +00:00
sbni
sbsh Driver for Granch SBNI16 SHDSL modem 2003-04-13 06:27:13 +00:00
scd - Convert to newbus, bus_space etc. 2002-11-05 09:37:32 +00:00
scsi_low
sem
sf
sio o Remove opt_ddb.h from SRCS. 2004-11-20 23:04:32 +00:00
sis
sk
smbfs For variables that are only checked with defined(), don't provide 2004-10-24 15:33:08 +00:00
sn Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
snc
snp We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
sound Add WERRROR= to work around the warnings 2005-01-26 16:29:07 +00:00
speaker 'speaker' not 'atspeaker' 2003-03-29 10:01:03 +00:00
splash Move the source code for these two modules out of src/sys/modules. 2004-08-06 20:37:08 +00:00
sppp Add FR support to sppp (MFCronyx). 2004-12-28 00:07:57 +00:00
sr Convert Netgraph to use mbuf tags to pass its meta information around. 2004-06-25 19:22:05 +00:00
ste
stg Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
streams o Remove @- from the ln and change it to a -sf. This was bogus, and 2003-11-19 05:08:27 +00:00
svr4
sym
syscons Normalize SUBDIR. 2004-01-19 12:36:08 +00:00
sysvipc Fix the standalone module build. 2005-02-09 08:35:24 +00:00
ti Remove vnode_if.h for rev 1.14. 2004-12-29 21:50:44 +00:00
tl
trm Connect trm(4) to the build. 2002-10-13 18:44:26 +00:00
twa Changed comments following changes to not bundle firmware by default. 2004-04-10 02:41:22 +00:00
twe
tx Remove miidevs.h and generate it from miidevs at compile time. 2003-01-19 02:59:34 +00:00
txp
uart Stop building uart_dev_i8251.c. It was copied from uart_dev_ns8250.c 2004-11-20 23:38:48 +00:00
ubsa We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
ubsec fix module building; drivers now require opt_{ubsec,hifn}.h 2003-03-11 23:20:43 +00:00
ubser We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
ucom We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
ucycom We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
udav Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
udbp Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
udf bsd.kmod.mk does not deal with manpages anymore. 2004-01-13 11:28:51 +00:00
udf_iconv Add the Makefile glue for the udf_iconv module. 2003-11-07 09:38:05 +00:00
ufm Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
ufs Add a few missing opt_ files to make this module compile again. 2003-06-23 19:41:00 +00:00
uftdi We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
ugen We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
uhid We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
ukbd We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
ulpt We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
umapfs
umass Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
umct We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
umodem We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
ums We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
unionfs
uplcom We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
urio We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
usb Add usbdevs_data.h to the SRCS list since usb_subr.c needs it. This forces 2004-12-31 16:05:07 +00:00
uscanner We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
utopia This is a driver for the physical layer chips used in ATM interfaces. 2003-06-12 14:28:32 +00:00
uvisor We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
uvscom We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
vesa
vge Add device driver support for the VIA Networking Technologies 2004-09-10 20:57:46 +00:00
vkbd No need to generate vnode_if.h anymore 2004-12-29 08:44:30 +00:00
vpo
vr
vx Add eisa_if.h 2004-06-09 21:52:12 +00:00
wb
wi Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
wlan Update/new modules for net80211 and ath changes. 2004-12-08 17:38:38 +00:00
wlan_acl Update/new modules for net80211 and ath changes. 2004-12-08 17:38:38 +00:00
wlan_ccmp fix typo to resolve undefined symbol 2004-12-16 01:10:48 +00:00
wlan_tkip Update/new modules for net80211 and ath changes. 2004-12-08 17:38:38 +00:00
wlan_wep Update/new modules for net80211 and ath changes. 2004-12-08 17:38:38 +00:00
wlan_xauth Update/new modules for net80211 and ath changes. 2004-12-08 17:38:38 +00:00
xe Move to generating pccarddevs.h on the fly, both for the kernel and 2004-05-26 00:53:10 +00:00
xl
zlib Give zlib the ability to be a module that can be depended on, 2004-06-20 17:42:35 +00:00
Makefile Add support for Windows/x86-64 binaries to Project Evil. 2005-02-16 05:41:18 +00:00
Makefile.inc Move adding -DPC98 to CFLAGS from each modules to sys/modules/Makefile.inc. 2002-11-06 13:47:00 +00:00