freebsd-dev/sys/modules
Bill Paul d02239a3af Create new i386 windows/bsd thunking layer, similar to the amd64 thunking
layer, but with a twist.

The twist has to do with the fact that Microsoft supports structured
exception handling in kernel mode. On the i386 arch, exception handling
is implemented by hanging an exception registration list off the
Thread Environment Block (TEB), and the TEB is accessed via the %fs
register. The problem is, we use %fs as a pointer to the pcpu stucture,
which means any driver that tries to write through %fs:0 will overwrite
the curthread pointer and make a serious mess of things.

To get around this, Project Evil now creates a special entry in
the GDT on each processor. When we call into Windows code, a context
switch routine will fix up %fs so it points to our new descriptor,
which in turn points to a fake TEB. When the Windows code returns,
or calls out to an external routine, we swap %fs back again. Currently,
Project Evil makes use of GDT slot 7, which is all 0s by default.
I fully expect someone to jump up and say I can't do that, but I
couldn't find any code that makes use of this entry anywhere. Sadly,
this was the only method I could come up with that worked on both
UP and SMP. (Modifying the LDT works on UP, but becomes incredibly
complicated on SMP.) If necessary, the context switching stuff can
be yanked out while preserving the convention calling wrappers.

(Fortunately, it looks like Microsoft uses some special epilog/prolog
code on amd64 to implement exception handling, so the same nastiness
won't be necessary on that arch.)

The advantages are:

- Any driver that uses %fs as though it were a TEB pointer won't
  clobber pcpu.
- All the __stdcall/__fastcall/__regparm stuff that's specific to
  gcc goes away.

Also, while I'm here, switch NdisGetSystemUpTime() back to using
nanouptime() again. It turns out nanouptime() is way more accurate
than just using ticks(). On slower machines, the Atheros drivers
I tested seem to take a long time to associate due to the loss
in accuracy.
2005-04-11 02:02:35 +00:00
..
3dfx
aac
accf_data
accf_http
acpi Add acpi_fujitsu for handling acpi-controlled buttons on Fujitsu laptops. 2005-03-18 08:48:10 +00:00
agp
aha
ahb
aic
aic7xxx
aio
amd
amr
an
aout
apm
ar
arcmsr Add the Areca SATA RAID driver (arcmsr). This supports the ARC-11xx and 12xx 2005-03-31 18:19:55 +00:00
arcnet
arl Use CFLAGS+=. 2005-02-09 11:50:43 +00:00
asr Unbreak buildworld on i386 when MODULES_WITH_WORLD is defined. 2005-03-23 17:13:08 +00:00
ata Connect the atapicam module to the build. 2005-04-05 02:05:01 +00:00
ath
ath_hal
ath_rate_amrr
ath_rate_onoe
ath_rate_sample SampleRate rate control algorithm for the ath driver 2005-03-11 01:39:57 +00:00
aue
auxio Add missing ofw_bus_if.h to SRCS. 2005-02-25 06:59:56 +00:00
awi
axe
bfe
bge
bios
bktr
bridge
cam
canbepm
canbus
cardbus
cbb
cd9660
cd9660_iconv
cdce Add USB Communication Device Class Ethernet driver. Originally written for 2005-03-22 14:52:40 +00:00
ciss
cm
coda
coda5
coff
cp
cpufreq Add support for _PDC/_OSC by advertising that we support direct access to 2005-04-04 15:51:13 +00:00
crypto just use crypto/rijndael, and nuke opencrypto/rindael.[ch]. 2005-03-11 17:24:46 +00:00
cryptodev
cs
ctau
cue
cx
dc
dcons
dcons_crom
de
digi
dpt
drm
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
em
en
ep eisa attachment is safe to be in this module, both on eisa and 2005-03-17 18:40:37 +00:00
esp
ex
exca
ext2fs Use vfs_hash() instead of home-rolled 2005-03-14 13:30:06 +00:00
fatm
fdc
fdescfs
fe
firewire
fxp
gem
geom
harp
hatm
hfa
hifn
hme
hpfs - Fix the hpfs build, hpfs_hash.c was removed from the repository. 2005-03-28 09:41:25 +00:00
hptmv Move all of the hptmv files to /sys/dev/hptmv so that they won't be mistaken 2005-03-02 05:14:28 +00:00
i2c
ibcs2
ichwd
ida
idt
ie
if_disc
if_ef
if_faith
if_gif
if_gre
if_ndis
if_ppp
if_sl
if_stf
if_tap
if_tun
if_vlan
iir
io
ip6fw
ip_mroute_mod
ipdivert
ipfilter
ipfw
ips
isp
ispfw
ixgb
joy
kue
lge
libiconv
libmbpool
libmchain
linprocfs
linux
lnc
lpt
mac_biba
mac_bsdextended
mac_ifoff
mac_lomac
mac_mls
mac_none
mac_partition
mac_portacl
mac_seeotheruids
mac_stub
mac_test
mcd
md
mem
mii
mlx
mly
mpt
msdosfs
msdosfs_iconv
mse
my
ncp
ncv
ndis Create new i386 windows/bsd thunking layer, similar to the amd64 thunking 2005-04-11 02:02:35 +00:00
netgraph Connect ng_source(4) to the build. 2005-02-12 17:04:21 +00:00
nfs4client
nfsclient
nfsserver
nge
nmdm
nsp
ntfs
ntfs_iconv
nullfs
nve Due to a CVS misfire, I ended up committing the wrong version of this. 2005-03-12 08:02:06 +00:00
nwfs
oldcard
oltr
osf1
owi
patm
pccard
pcfclock
pcn
pecoff
pf
plip
pmc
portalfs
ppbus
ppi
pps
procfs
pseudofs Add PSEUDOFS_TRACE option. 2005-03-14 16:04:27 +00:00
pst
random
ray
rc
rc4
re
rl
rndtest
rp
rue
s3
safe
sbni
sbsh
scd
scsi_low
sem
sf
sio
sis
sk
smbfs
sn
snc
snp
sound
speaker
splash
sppp
sr
ste
stg
streams
svr4
sym
syscons
sysvipc Fix the standalone module build. 2005-02-09 08:35:24 +00:00
ti
tl
trm
twa
twe
tx
txp
uart
ubsa
ubsec
ubser
ucom
ucycom
udav
udbp
udf
udf_iconv
ufm
ufs Remove ufs_ihash.c here as well. 2005-03-14 10:23:34 +00:00
uftdi
ugen
uhid
ukbd
ulpt
umapfs
umass
umct
umodem
ums
unionfs
uplcom
urio
usb
uscanner
utopia The chip specific functions have been split out in their own 2005-02-25 09:49:29 +00:00
uvisor
uvscom
vesa
vge
vkbd
vpo
vr
vx
wb
wi
wlan
wlan_acl
wlan_ccmp
wlan_tkip
wlan_wep
wlan_xauth
xe
xl
zlib
Makefile Don't build arcmsr on pc98. The card either won't fit/work in the 2005-04-01 17:40:39 +00:00
Makefile.inc