ia64/xen-unstable

changeset 5733:ece694762d7a

Remove old linux sparse trees.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Jul 11 15:12:37 2005 +0000 (2005-07-11)
parents b3cfebba3b30
children 60fc40a82fa9
files
line diff
     1.1 --- a/linux-2.4.30-xen-sparse/Makefile	Mon Jul 11 14:48:47 2005 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,592 +0,0 @@
     1.4 -VERSION = 2
     1.5 -PATCHLEVEL = 4
     1.6 -SUBLEVEL = 30
     1.7 -EXTRAVERSION =
     1.8 -
     1.9 -KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
    1.10 -
    1.11 -# SUBARCH always tells us the underlying machine architecture.
    1.12 -# Unless overridden, by default ARCH is equivalent to SUBARCH.
    1.13 -# This will be overriden for Xen and UML builds.
    1.14 -SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
    1.15 -ARCH ?= $(SUBARCH)
    1.16 -
    1.17 -## XXX The following hack can be discarded after users have adjusted to the
    1.18 -## architectural name change 'xeno' -> 'xen'.
    1.19 -ifeq ($(ARCH),xeno)
    1.20 -  ARCH := xen
    1.21 -endif
    1.22 -
    1.23 -KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
    1.24 -
    1.25 -CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
    1.26 -	  else if [ -x /bin/bash ]; then echo /bin/bash; \
    1.27 -	  else echo sh; fi ; fi)
    1.28 -TOPDIR	:= $(shell /bin/pwd)
    1.29 -
    1.30 -HPATH   	= $(TOPDIR)/include
    1.31 -FINDHPATH	= $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
    1.32 -
    1.33 -HOSTCC  	= gcc
    1.34 -HOSTCFLAGS	= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
    1.35 -
    1.36 -CROSS_COMPILE 	=
    1.37 -
    1.38 -#
    1.39 -# Include the make variables (CC, etc...)
    1.40 -#
    1.41 -
    1.42 -AS		= $(CROSS_COMPILE)as
    1.43 -LD		= $(CROSS_COMPILE)ld
    1.44 -CC		= $(CROSS_COMPILE)gcc
    1.45 -CPP		= $(CC) -E
    1.46 -AR		= $(CROSS_COMPILE)ar
    1.47 -NM		= $(CROSS_COMPILE)nm
    1.48 -STRIP		= $(CROSS_COMPILE)strip
    1.49 -OBJCOPY		= $(CROSS_COMPILE)objcopy
    1.50 -OBJDUMP		= $(CROSS_COMPILE)objdump
    1.51 -MAKEFILES	= $(TOPDIR)/.config
    1.52 -GENKSYMS	= /sbin/genksyms
    1.53 -DEPMOD		= /sbin/depmod
    1.54 -MODFLAGS	= -DMODULE
    1.55 -CFLAGS_KERNEL	=
    1.56 -PERL		= perl
    1.57 -AWK		= awk
    1.58 -RPM 		:= $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
    1.59 -		    	else echo rpm; fi)
    1.60 -
    1.61 -export	VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
    1.62 -	CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
    1.63 -	CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS MODFLAGS PERL AWK
    1.64 -
    1.65 -all:	do-it-all
    1.66 -
    1.67 -#
    1.68 -# Make "config" the default target if there is no configuration file or
    1.69 -# "depend" the target if there is no top-level dependency information.
    1.70 -#
    1.71 -
    1.72 -ifeq (.config,$(wildcard .config))
    1.73 -include .config
    1.74 -ifeq (.depend,$(wildcard .depend))
    1.75 -include .depend
    1.76 -do-it-all:	Version vmlinux
    1.77 -else
    1.78 -CONFIGURATION = depend
    1.79 -do-it-all:	depend
    1.80 -endif
    1.81 -else
    1.82 -CONFIGURATION = config
    1.83 -do-it-all:	config
    1.84 -endif
    1.85 -
    1.86 -#
    1.87 -# INSTALL_PATH specifies where to place the updated kernel and system map
    1.88 -# images.  Uncomment if you want to place them anywhere other than root.
    1.89 -#
    1.90 -
    1.91 -#export	INSTALL_PATH=/boot
    1.92 -
    1.93 -#
    1.94 -# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
    1.95 -# relocations required by build roots.  This is not defined in the
    1.96 -# makefile but the arguement can be passed to make if needed.
    1.97 -#
    1.98 -
    1.99 -MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
   1.100 -export MODLIB
   1.101 -
   1.102 -#
   1.103 -# standard CFLAGS
   1.104 -#
   1.105 -
   1.106 -CPPFLAGS := -D__KERNEL__ -I$(HPATH)
   1.107 -
   1.108 -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
   1.109 -	  -fno-strict-aliasing -fno-common
   1.110 -ifndef CONFIG_FRAME_POINTER
   1.111 -CFLAGS += -fomit-frame-pointer
   1.112 -endif
   1.113 -AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
   1.114 -
   1.115 -#
   1.116 -# ROOT_DEV specifies the default root-device when making the image.
   1.117 -# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
   1.118 -# the default of FLOPPY is used by 'build'.
   1.119 -# This is i386 specific.
   1.120 -#
   1.121 -
   1.122 -export ROOT_DEV = CURRENT
   1.123 -
   1.124 -#
   1.125 -# If you want to preset the SVGA mode, uncomment the next line and
   1.126 -# set SVGA_MODE to whatever number you want.
   1.127 -# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
   1.128 -# The number is the same as you would ordinarily press at bootup.
   1.129 -# This is i386 specific.
   1.130 -#
   1.131 -
   1.132 -export SVGA_MODE = -DSVGA_MODE=NORMAL_VGA
   1.133 -
   1.134 -#
   1.135 -# If you want the RAM disk device, define this to be the size in blocks.
   1.136 -# This is i386 specific.
   1.137 -#
   1.138 -
   1.139 -#export RAMDISK = -DRAMDISK=512
   1.140 -
   1.141 -CORE_FILES	=kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
   1.142 -NETWORKS	=net/network.o
   1.143 -
   1.144 -LIBS		=$(TOPDIR)/lib/lib.a
   1.145 -SUBDIRS		=kernel drivers mm fs net ipc lib crypto
   1.146 -
   1.147 -DRIVERS-n :=
   1.148 -DRIVERS-y :=
   1.149 -DRIVERS-m :=
   1.150 -DRIVERS-  :=
   1.151 -
   1.152 -DRIVERS-$(CONFIG_ACPI_BOOT) += drivers/acpi/acpi.o
   1.153 -DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o
   1.154 -DRIVERS-y += drivers/char/char.o \
   1.155 -	drivers/block/block.o \
   1.156 -	drivers/misc/misc.o \
   1.157 -	drivers/net/net.o
   1.158 -DRIVERS-$(CONFIG_AGP) += drivers/char/agp/agp.o
   1.159 -DRIVERS-$(CONFIG_DRM_NEW) += drivers/char/drm/drm.o
   1.160 -DRIVERS-$(CONFIG_DRM_OLD) += drivers/char/drm-4.0/drm.o
   1.161 -DRIVERS-$(CONFIG_NUBUS) += drivers/nubus/nubus.a
   1.162 -DRIVERS-$(CONFIG_NET_FC) += drivers/net/fc/fc.o
   1.163 -DRIVERS-$(CONFIG_DEV_APPLETALK) += drivers/net/appletalk/appletalk.o
   1.164 -DRIVERS-$(CONFIG_TR) += drivers/net/tokenring/tr.o
   1.165 -DRIVERS-$(CONFIG_WAN) += drivers/net/wan/wan.o
   1.166 -DRIVERS-$(CONFIG_ARCNET) += drivers/net/arcnet/arcnetdrv.o
   1.167 -DRIVERS-$(CONFIG_ATM) += drivers/atm/atm.o
   1.168 -DRIVERS-$(CONFIG_IDE) += drivers/ide/idedriver.o
   1.169 -DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
   1.170 -DRIVERS-$(CONFIG_SCSI) += drivers/scsi/scsidrv.o
   1.171 -DRIVERS-$(CONFIG_FUSION_BOOT) += drivers/message/fusion/fusion.o
   1.172 -DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394drv.o
   1.173 -
   1.174 -ifneq ($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR)$(CONFIG_PARIDE_PCD),)
   1.175 -DRIVERS-y += drivers/cdrom/driver.o
   1.176 -endif
   1.177 -
   1.178 -DRIVERS-$(CONFIG_SOUND) += drivers/sound/sounddrivers.o
   1.179 -DRIVERS-$(CONFIG_PCI) += drivers/pci/driver.o
   1.180 -DRIVERS-$(CONFIG_MTD) += drivers/mtd/mtdlink.o
   1.181 -DRIVERS-$(CONFIG_PCMCIA) += drivers/pcmcia/pcmcia.o
   1.182 -DRIVERS-$(CONFIG_NET_PCMCIA) += drivers/net/pcmcia/pcmcia_net.o
   1.183 -DRIVERS-$(CONFIG_NET_WIRELESS) += drivers/net/wireless/wireless_net.o
   1.184 -DRIVERS-$(CONFIG_PCMCIA_CHRDEV) += drivers/char/pcmcia/pcmcia_char.o
   1.185 -DRIVERS-$(CONFIG_DIO) += drivers/dio/dio.a
   1.186 -DRIVERS-$(CONFIG_SBUS) += drivers/sbus/sbus_all.o
   1.187 -DRIVERS-$(CONFIG_ZORRO) += drivers/zorro/driver.o
   1.188 -DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
   1.189 -DRIVERS-$(CONFIG_PPC32) += drivers/macintosh/macintosh.o
   1.190 -DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o
   1.191 -DRIVERS-$(CONFIG_ISAPNP) += drivers/pnp/pnp.o
   1.192 -DRIVERS-$(CONFIG_I2C) += drivers/i2c/i2c.o
   1.193 -DRIVERS-$(CONFIG_VT) += drivers/video/video.o
   1.194 -DRIVERS-$(CONFIG_PARIDE) += drivers/block/paride/paride.a
   1.195 -DRIVERS-$(CONFIG_HAMRADIO) += drivers/net/hamradio/hamradio.o
   1.196 -DRIVERS-$(CONFIG_TC) += drivers/tc/tc.a
   1.197 -DRIVERS-$(CONFIG_USB) += drivers/usb/usbdrv.o
   1.198 -DRIVERS-$(CONFIG_USB_GADGET) += drivers/usb/gadget/built-in.o
   1.199 -DRIVERS-y +=drivers/media/media.o
   1.200 -DRIVERS-$(CONFIG_INPUT) += drivers/input/inputdrv.o
   1.201 -DRIVERS-$(CONFIG_HIL) += drivers/hil/hil.o
   1.202 -DRIVERS-$(CONFIG_I2O) += drivers/message/i2o/i2o.o
   1.203 -DRIVERS-$(CONFIG_IRDA) += drivers/net/irda/irda.o
   1.204 -DRIVERS-$(CONFIG_PHONE) += drivers/telephony/telephony.o
   1.205 -DRIVERS-$(CONFIG_MD) += drivers/md/mddev.o
   1.206 -DRIVERS-$(CONFIG_GSC) += drivers/gsc/gscbus.o
   1.207 -DRIVERS-$(CONFIG_BLUEZ) += drivers/bluetooth/bluetooth.o
   1.208 -DRIVERS-$(CONFIG_HOTPLUG_PCI) += drivers/hotplug/vmlinux-obj.o
   1.209 -DRIVERS-$(CONFIG_ISDN_BOOL) += drivers/isdn/vmlinux-obj.o
   1.210 -DRIVERS-$(CONFIG_CRYPTO) += crypto/crypto.o
   1.211 -
   1.212 -DRIVERS := $(DRIVERS-y)
   1.213 -
   1.214 -
   1.215 -# files removed with 'make clean'
   1.216 -CLEAN_FILES = \
   1.217 -	kernel/ksyms.lst include/linux/compile.h \
   1.218 -	vmlinux System.map \
   1.219 -	.tmp* \
   1.220 -	drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \
   1.221 -	drivers/char/conmakehash \
   1.222 -	drivers/char/drm/*-mod.c \
   1.223 -	drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist \
   1.224 -	drivers/zorro/devlist.h drivers/zorro/gen-devlist \
   1.225 -	drivers/sound/bin2hex drivers/sound/hex2hex \
   1.226 -	drivers/atm/fore200e_mkfirm drivers/atm/{pca,sba}*{.bin,.bin1,.bin2} \
   1.227 -	drivers/scsi/aic7xxx/aicasm/aicasm \
   1.228 -	drivers/scsi/aic7xxx/aicasm/aicasm_gram.c \
   1.229 -	drivers/scsi/aic7xxx/aicasm/aicasm_gram.h \
   1.230 -	drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.c \
   1.231 -	drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.h \
   1.232 -	drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.c \
   1.233 -	drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \
   1.234 -	drivers/scsi/aic7xxx/aicasm/aicdb.h \
   1.235 -	drivers/scsi/aic7xxx/aicasm/y.tab.h \
   1.236 -	drivers/scsi/53c700_d.h \
   1.237 -	drivers/tc/lk201-map.c \
   1.238 -	net/khttpd/make_times_h \
   1.239 -	net/khttpd/times.h \
   1.240 -	submenu* \
   1.241 -	drivers/ieee1394/oui.c
   1.242 -# directories removed with 'make clean'
   1.243 -CLEAN_DIRS = \
   1.244 -	modules
   1.245 -
   1.246 -# files removed with 'make mrproper'
   1.247 -MRPROPER_FILES = \
   1.248 -	include/linux/autoconf.h include/linux/version.h \
   1.249 -	lib/crc32table.h lib/gen_crc32table \
   1.250 -	drivers/net/hamradio/soundmodem/sm_tbl_{afsk1200,afsk2666,fsk9600}.h \
   1.251 -	drivers/net/hamradio/soundmodem/sm_tbl_{hapn4800,psk4800}.h \
   1.252 -	drivers/net/hamradio/soundmodem/sm_tbl_{afsk2400_7,afsk2400_8}.h \
   1.253 -	drivers/net/hamradio/soundmodem/gentbl \
   1.254 -	drivers/sound/*_boot.h drivers/sound/.*.boot \
   1.255 -	drivers/sound/msndinit.c \
   1.256 -	drivers/sound/msndperm.c \
   1.257 -	drivers/sound/pndsperm.c \
   1.258 -	drivers/sound/pndspini.c \
   1.259 -	drivers/atm/fore200e_*_fw.c drivers/atm/.fore200e_*.fw \
   1.260 -	.version .config* config.in config.old \
   1.261 -	scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp \
   1.262 -	scripts/lxdialog/*.o scripts/lxdialog/lxdialog \
   1.263 -	.menuconfig.log \
   1.264 -	include/asm \
   1.265 -	.hdepend scripts/mkdep scripts/split-include scripts/docproc \
   1.266 -	$(TOPDIR)/include/linux/modversions.h \
   1.267 -	kernel.spec
   1.268 -
   1.269 -# directories removed with 'make mrproper'
   1.270 -MRPROPER_DIRS = \
   1.271 -	include/config \
   1.272 -	$(TOPDIR)/include/linux/modules
   1.273 -
   1.274 -
   1.275 -include arch/$(ARCH)/Makefile
   1.276 -
   1.277 -# Extra cflags for kbuild 2.4.  The default is to forbid includes by kernel code
   1.278 -# from user space headers.  Some UML code requires user space headers, in the
   1.279 -# UML Makefiles add 'kbuild_2_4_nostdinc :=' before include Rules.make.  No
   1.280 -# other kernel code should include user space headers, if you need
   1.281 -# 'kbuild_2_4_nostdinc :=' or -I/usr/include for kernel code and you are not UML
   1.282 -# then your code is broken!  KAO.
   1.283 -
   1.284 -kbuild_2_4_nostdinc	:= -nostdinc -iwithprefix include
   1.285 -export kbuild_2_4_nostdinc
   1.286 -
   1.287 -export	CPPFLAGS CFLAGS CFLAGS_KERNEL AFLAGS AFLAGS_KERNEL
   1.288 -
   1.289 -export	NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS
   1.290 -
   1.291 -.S.s:
   1.292 -	$(CPP) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -o $*.s $<
   1.293 -.S.o:
   1.294 -	$(CC) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -c -o $*.o $<
   1.295 -
   1.296 -Version: dummy
   1.297 -	@rm -f include/linux/compile.h
   1.298 -
   1.299 -boot: vmlinux
   1.300 -	@$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C arch/$(ARCH)/boot
   1.301 -
   1.302 -vmlinux: include/linux/version.h $(CONFIGURATION) init/main.o init/version.o init/do_mounts.o linuxsubdirs
   1.303 -	$(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o init/do_mounts.o \
   1.304 -		--start-group \
   1.305 -		$(CORE_FILES) \
   1.306 -		$(DRIVERS) \
   1.307 -		$(NETWORKS) \
   1.308 -		$(LIBS) \
   1.309 -		--end-group \
   1.310 -		-o vmlinux
   1.311 -	$(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
   1.312 -
   1.313 -symlinks:
   1.314 -	rm -f include/asm
   1.315 -	( cd include ; ln -sf asm-$(ARCH) asm)
   1.316 -	@if [ ! -d include/linux/modules ]; then \
   1.317 -		mkdir include/linux/modules; \
   1.318 -	fi
   1.319 -
   1.320 -oldconfig: symlinks
   1.321 -	$(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
   1.322 -
   1.323 -xconfig: symlinks
   1.324 -	$(MAKE) -C scripts kconfig.tk
   1.325 -	wish -f scripts/kconfig.tk
   1.326 -
   1.327 -menuconfig: include/linux/version.h symlinks
   1.328 -	$(MAKE) -C scripts/lxdialog all
   1.329 -	$(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in
   1.330 -
   1.331 -config: symlinks
   1.332 -	$(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in
   1.333 -
   1.334 -include/config/MARKER: scripts/split-include include/linux/autoconf.h
   1.335 -	scripts/split-include include/linux/autoconf.h include/config
   1.336 -	@ touch include/config/MARKER
   1.337 -
   1.338 -linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
   1.339 -
   1.340 -$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/linux/version.h include/config/MARKER
   1.341 -	$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C $(patsubst _dir_%, %, $@)
   1.342 -
   1.343 -$(TOPDIR)/include/linux/version.h: include/linux/version.h
   1.344 -$(TOPDIR)/include/linux/compile.h: include/linux/compile.h
   1.345 -
   1.346 -newversion:
   1.347 -	. scripts/mkversion > .tmpversion
   1.348 -	@mv -f .tmpversion .version
   1.349 -
   1.350 -uts_len		:= 64
   1.351 -uts_truncate	:= sed -e 's/\(.\{1,$(uts_len)\}\).*/\1/'
   1.352 -
   1.353 -include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion
   1.354 -	@echo -n \#`cat .version` > .ver1
   1.355 -	@if [ -n "$(CONFIG_SMP)" ] ; then echo -n " SMP" >> .ver1; fi
   1.356 -	@if [ -f .name ]; then  echo -n \-`cat .name` >> .ver1; fi
   1.357 -	@LANG=C echo ' '`date` >> .ver1
   1.358 -	@echo \#define UTS_VERSION \"`cat .ver1 | $(uts_truncate)`\" > .ver
   1.359 -	@LANG=C echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> .ver
   1.360 -	@echo \#define LINUX_COMPILE_BY \"`whoami`\" >> .ver
   1.361 -	@echo \#define LINUX_COMPILE_HOST \"`hostname | $(uts_truncate)`\" >> .ver
   1.362 -	@([ -x /bin/dnsdomainname ] && /bin/dnsdomainname > .ver1) || \
   1.363 -	 ([ -x /bin/domainname ] && /bin/domainname > .ver1) || \
   1.364 -	 echo > .ver1
   1.365 -	@echo \#define LINUX_COMPILE_DOMAIN \"`cat .ver1 | $(uts_truncate)`\" >> .ver
   1.366 -	@echo \#define LINUX_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -n 1`\" >> .ver
   1.367 -	@mv -f .ver $@
   1.368 -	@rm -f .ver1
   1.369 -
   1.370 -include/linux/version.h: ./Makefile
   1.371 -	@expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
   1.372 -	  (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
   1.373 -	@echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
   1.374 -	@echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
   1.375 -	@echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver
   1.376 -	@mv -f .ver $@
   1.377 -
   1.378 -comma	:= ,
   1.379 -
   1.380 -init/version.o: init/version.c include/linux/compile.h include/config/MARKER
   1.381 -	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) -DUTS_MACHINE='"$(SUBARCH)"' -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o init/version.o init/version.c
   1.382 -
   1.383 -init/main.o: init/main.c include/config/MARKER
   1.384 -	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $<
   1.385 -
   1.386 -init/do_mounts.o: init/do_mounts.c include/config/MARKER
   1.387 -	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $<
   1.388 -
   1.389 -fs lib mm ipc kernel drivers net: dummy
   1.390 -	$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
   1.391 -
   1.392 -TAGS: dummy
   1.393 -	{ find include/asm-${ARCH} -name '*.h' -print ; \
   1.394 -	find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print ; \
   1.395 -	find $(SUBDIRS) init arch/${ARCH} -name '*.[chS]' ; } | grep -v SCCS | grep -v '\.svn' | etags -
   1.396 -
   1.397 -# Exuberant ctags works better with -I
   1.398 -tags: dummy
   1.399 -	CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
   1.400 -	ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
   1.401 -	find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
   1.402 -	find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a
   1.403 -
   1.404 -ifdef CONFIG_MODULES
   1.405 -ifdef CONFIG_MODVERSIONS
   1.406 -MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h
   1.407 -endif
   1.408 -
   1.409 -.PHONY: modules
   1.410 -modules: $(patsubst %, _mod_%, $(SUBDIRS))
   1.411 -
   1.412 -.PHONY: $(patsubst %, _mod_%, $(SUBDIRS))
   1.413 -$(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER
   1.414 -	$(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules
   1.415 -
   1.416 -.PHONY: modules_install
   1.417 -modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS)) _modinst_post
   1.418 -
   1.419 -.PHONY: _modinst_
   1.420 -_modinst_:
   1.421 -	@rm -rf $(MODLIB)/kernel
   1.422 -	@rm -f $(MODLIB)/build
   1.423 -	@mkdir -p $(MODLIB)/kernel
   1.424 -	@ln -s $(TOPDIR) $(MODLIB)/build
   1.425 -
   1.426 -# If System.map exists, run depmod.  This deliberately does not have a
   1.427 -# dependency on System.map since that would run the dependency tree on
   1.428 -# vmlinux.  This depmod is only for convenience to give the initial
   1.429 -# boot a modules.dep even before / is mounted read-write.  However the
   1.430 -# boot script depmod is the master version.
   1.431 -ifeq "$(strip $(INSTALL_MOD_PATH))" ""
   1.432 -depmod_opts	:=
   1.433 -else
   1.434 -depmod_opts	:= -b $(INSTALL_MOD_PATH) -r
   1.435 -endif
   1.436 -.PHONY: _modinst_post
   1.437 -_modinst_post: _modinst_post_pcmcia
   1.438 -	if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
   1.439 -
   1.440 -# Backwards compatibilty symlinks for people still using old versions
   1.441 -# of pcmcia-cs with hard coded pathnames on insmod.  Remove
   1.442 -# _modinst_post_pcmcia for kernel 2.4.1.
   1.443 -.PHONY: _modinst_post_pcmcia
   1.444 -_modinst_post_pcmcia:
   1.445 -	cd $(MODLIB); \
   1.446 -	mkdir -p pcmcia; \
   1.447 -	find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
   1.448 -
   1.449 -.PHONY: $(patsubst %, _modinst_%, $(SUBDIRS))
   1.450 -$(patsubst %, _modinst_%, $(SUBDIRS)) :
   1.451 -	$(MAKE) -C $(patsubst _modinst_%, %, $@) modules_install
   1.452 -
   1.453 -# modules disabled....
   1.454 -
   1.455 -else
   1.456 -modules modules_install: dummy
   1.457 -	@echo
   1.458 -	@echo "The present kernel configuration has modules disabled."
   1.459 -	@echo "Type 'make config' and enable loadable module support."
   1.460 -	@echo "Then build a kernel with module support enabled."
   1.461 -	@echo
   1.462 -	@exit 1
   1.463 -endif
   1.464 -
   1.465 -clean:	archclean
   1.466 -	find . \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f -print \
   1.467 -		| grep -v lxdialog/ | xargs rm -f
   1.468 -	rm -f $(CLEAN_FILES)
   1.469 -	rm -rf $(CLEAN_DIRS)
   1.470 -	$(MAKE) -C Documentation/DocBook clean
   1.471 -
   1.472 -mrproper: clean archmrproper
   1.473 -	find . \( -size 0 -o -name .depend \) -type f -print | xargs rm -f
   1.474 -	rm -f $(MRPROPER_FILES)
   1.475 -	rm -rf $(MRPROPER_DIRS)
   1.476 -	$(MAKE) -C Documentation/DocBook mrproper
   1.477 -
   1.478 -distclean: mrproper
   1.479 -	rm -f core `find . \( -not -type d \) -and \
   1.480 -		\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
   1.481 -		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
   1.482 -		-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
   1.483 -
   1.484 -backup: mrproper
   1.485 -	cd .. && tar cf - linux/ | gzip -9 > backup.gz
   1.486 -	sync
   1.487 -
   1.488 -sgmldocs: 
   1.489 -	chmod 755 $(TOPDIR)/scripts/docgen
   1.490 -	chmod 755 $(TOPDIR)/scripts/gen-all-syms
   1.491 -	chmod 755 $(TOPDIR)/scripts/kernel-doc
   1.492 -	$(MAKE) -C $(TOPDIR)/Documentation/DocBook books
   1.493 -
   1.494 -psdocs: sgmldocs
   1.495 -	$(MAKE) -C Documentation/DocBook ps
   1.496 -
   1.497 -pdfdocs: sgmldocs
   1.498 -	$(MAKE) -C Documentation/DocBook pdf
   1.499 -
   1.500 -htmldocs: sgmldocs
   1.501 -	$(MAKE) -C Documentation/DocBook html
   1.502 -
   1.503 -mandocs:
   1.504 -	chmod 755 $(TOPDIR)/scripts/kernel-doc
   1.505 -	chmod 755 $(TOPDIR)/scripts/split-man
   1.506 -	$(MAKE) -C Documentation/DocBook man
   1.507 -
   1.508 -sums:
   1.509 -	find . -type f -print | sort | xargs sum > .SUMS
   1.510 -
   1.511 -dep-files: scripts/mkdep archdep include/linux/version.h
   1.512 -	rm -f .depend .hdepend
   1.513 -	$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
   1.514 -ifdef CONFIG_MODVERSIONS
   1.515 -	$(MAKE) update-modverfile
   1.516 -endif
   1.517 -	scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
   1.518 -	scripts/mkdep -- init/*.c > .depend
   1.519 -
   1.520 -ifdef CONFIG_MODVERSIONS
   1.521 -MODVERFILE := $(TOPDIR)/include/linux/modversions.h
   1.522 -else
   1.523 -MODVERFILE :=
   1.524 -endif
   1.525 -export	MODVERFILE
   1.526 -
   1.527 -depend dep: dep-files
   1.528 -
   1.529 -checkconfig:
   1.530 -	find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkconfig.pl
   1.531 -
   1.532 -checkhelp:
   1.533 -	find * -name [cC]onfig.in -print | sort | xargs $(PERL) -w scripts/checkhelp.pl
   1.534 -
   1.535 -checkincludes:
   1.536 -	find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl
   1.537 -
   1.538 -ifdef CONFIGURATION
   1.539 -..$(CONFIGURATION):
   1.540 -	@echo
   1.541 -	@echo "You have a bad or nonexistent" .$(CONFIGURATION) ": running 'make" $(CONFIGURATION)"'"
   1.542 -	@echo
   1.543 -	$(MAKE) $(CONFIGURATION)
   1.544 -	@echo
   1.545 -	@echo "Successful. Try re-making (ignore the error that follows)"
   1.546 -	@echo
   1.547 -	exit 1
   1.548 -
   1.549 -#dummy: ..$(CONFIGURATION)
   1.550 -dummy:
   1.551 -
   1.552 -else
   1.553 -
   1.554 -dummy:
   1.555 -
   1.556 -endif
   1.557 -
   1.558 -include Rules.make
   1.559 -
   1.560 -#
   1.561 -# This generates dependencies for the .h files.
   1.562 -#
   1.563 -
   1.564 -scripts/mkdep: scripts/mkdep.c
   1.565 -	$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
   1.566 -
   1.567 -scripts/split-include: scripts/split-include.c
   1.568 -	$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
   1.569 -
   1.570 -#
   1.571 -# RPM target
   1.572 -#
   1.573 -#	If you do a make spec before packing the tarball you can rpm -ta it
   1.574 -#
   1.575 -spec:
   1.576 -	. scripts/mkspec >kernel.spec
   1.577 -
   1.578 -#
   1.579 -#	Build a tar ball, generate an rpm from it and pack the result
   1.580 -#	There arw two bits of magic here
   1.581 -#	1) The use of /. to avoid tar packing just the symlink
   1.582 -#	2) Removing the .dep files as they have source paths in them that
   1.583 -#	   will become invalid
   1.584 -#
   1.585 -rpm:	clean spec
   1.586 -	find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f
   1.587 -	set -e; \
   1.588 -	cd $(TOPDIR)/.. ; \
   1.589 -	ln -sf $(TOPDIR) $(KERNELPATH) ; \
   1.590 -	tar -cvz --exclude CVS -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
   1.591 -	rm $(KERNELPATH) ; \
   1.592 -	cd $(TOPDIR) ; \
   1.593 -	. scripts/mkversion > .version ; \
   1.594 -	$(RPM) -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
   1.595 -	rm $(TOPDIR)/../$(KERNELPATH).tar.gz
     2.1 --- a/linux-2.4.30-xen-sparse/arch/xen/Makefile	Mon Jul 11 14:48:47 2005 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,139 +0,0 @@
     2.4 -#
     2.5 -# xen/Makefile
     2.6 -#
     2.7 -# This file is included by the global makefile so that you can add your own
     2.8 -# architecture-specific flags and dependencies. Remember to do have actions
     2.9 -# for "archclean" and "archdep" for cleaning up and making dependencies for
    2.10 -# this architecture
    2.11 -#
    2.12 -# This file is subject to the terms and conditions of the GNU General Public
    2.13 -# License.  See the file "COPYING" in the main directory of this archive
    2.14 -# for more details.
    2.15 -#
    2.16 -# Copyright (C) 1994 by Linus Torvalds
    2.17 -#
    2.18 -# 19990713  Artur Skawina <skawina@geocities.com>
    2.19 -#           Added '-march' and '-mpreferred-stack-boundary' support
    2.20 -#
    2.21 -
    2.22 -# If no .config file exists then use the appropriate defconfig-* file
    2.23 -ifneq (.config,$(wildcard .config))
    2.24 -DUMMYX:=$(shell cp $(TOPDIR)/arch/xen/defconfig$(EXTRAVERSION) $(TOPDIR)/.config)
    2.25 --include $(TOPDIR)/.config
    2.26 -endif
    2.27 -
    2.28 -LD=$(CROSS_COMPILE)ld -m elf_i386
    2.29 -OBJCOPY=$(CROSS_COMPILE)objcopy -R .note -R .comment -S
    2.30 -LDFLAGS=-e stext
    2.31 -LINKFLAGS =-T $(TOPDIR)/arch/xen/vmlinux.lds $(LDFLAGS)
    2.32 -
    2.33 -CFLAGS += -pipe
    2.34 -
    2.35 -check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
    2.36 -
    2.37 -# prevent gcc from keeping the stack 16 byte aligned
    2.38 -CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,)
    2.39 -
    2.40 -ifdef CONFIG_M686
    2.41 -CFLAGS += -march=i686
    2.42 -endif
    2.43 -
    2.44 -ifdef CONFIG_MPENTIUMIII
    2.45 -CFLAGS += -march=i686
    2.46 -endif
    2.47 -
    2.48 -ifdef CONFIG_MPENTIUM4
    2.49 -CFLAGS += -march=i686
    2.50 -endif
    2.51 -
    2.52 -ifdef CONFIG_MK7
    2.53 -CFLAGS += $(call check_gcc,-march=athlon,-march=i686 -malign-functions=4)
    2.54 -endif
    2.55 -
    2.56 -# Disable unit-at-a-time mode, it makes gcc use a lot more stack
    2.57 -# due to the lack of sharing of stacklots.
    2.58 -CFLAGS += $(call check_gcc,-fno-unit-at-a-time,)
    2.59 -
    2.60 -HEAD := arch/xen/kernel/head.o arch/xen/kernel/init_task.o
    2.61 -
    2.62 -SUBDIRS += arch/xen/kernel arch/xen/mm arch/xen/lib
    2.63 -SUBDIRS += arch/xen/drivers/console 
    2.64 -SUBDIRS += arch/xen/drivers/evtchn
    2.65 -SUBDIRS += arch/xen/drivers/blkif
    2.66 -SUBDIRS += arch/xen/drivers/netif
    2.67 -SUBDIRS += arch/xen/drivers/usbif
    2.68 -SUBDIRS += arch/xen/drivers/balloon
    2.69 -ifdef CONFIG_XEN_PRIVILEGED_GUEST
    2.70 -SUBDIRS += arch/xen/drivers/dom0 
    2.71 -endif
    2.72 -
    2.73 -CORE_FILES += arch/xen/kernel/kernel.o arch/xen/mm/mm.o
    2.74 -CORE_FILES += arch/xen/drivers/evtchn/drv.o
    2.75 -CORE_FILES += arch/xen/drivers/console/drv.o
    2.76 -DRIVERS += arch/xen/drivers/blkif/drv.o
    2.77 -DRIVERS += arch/xen/drivers/netif/drv.o
    2.78 -DRIVERS += arch/xen/drivers/usbif/drv.o
    2.79 -ifdef CONFIG_XEN_PRIVILEGED_GUEST
    2.80 -CORE_FILES += arch/xen/drivers/dom0/drv.o
    2.81 -endif
    2.82 -CORE_FILES += arch/xen/drivers/balloon/drv.o
    2.83 -LIBS := $(TOPDIR)/arch/xen/lib/lib.a $(LIBS) $(TOPDIR)/arch/xen/lib/lib.a
    2.84 -
    2.85 -arch/xen/kernel: dummy
    2.86 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xen/kernel
    2.87 -
    2.88 -arch/xen/mm: dummy
    2.89 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xen/mm
    2.90 -
    2.91 -arch/xen/drivers/console: dummy
    2.92 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xen/drivers/console
    2.93 -
    2.94 -arch/xen/drivers/network: dummy
    2.95 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xen/drivers/network
    2.96 -
    2.97 -arch/xen/drivers/block: dummy
    2.98 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xen/drivers/block
    2.99 -
   2.100 -arch/xen/drivers/dom0: dummy
   2.101 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xen/drivers/dom0
   2.102 -
   2.103 -arch/xen/drivers/balloon: dummy
   2.104 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xen/drivers/balloon
   2.105 -
   2.106 -MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
   2.107 -
   2.108 -vmlinux: arch/xen/vmlinux.lds
   2.109 -
   2.110 -FORCE: ;
   2.111 -
   2.112 -.PHONY: bzImage compressed clean archclean archmrproper archdep
   2.113 -
   2.114 -
   2.115 -bzImage: vmlinux
   2.116 -	@$(MAKEBOOT) bzImage
   2.117 -
   2.118 -INSTALL_NAME ?= $(KERNELRELEASE)
   2.119 -install: bzImage
   2.120 -	mkdir -p $(INSTALL_PATH)/boot
   2.121 -	ln -f -s vmlinuz-$(INSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_PATH)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
   2.122 -	rm -f $(INSTALL_PATH)/boot/vmlinuz-$(INSTALL_NAME)$(INSTALL_SUFFIX)
   2.123 -	install -m0644 arch/$(ARCH)/boot/bzImage $(INSTALL_PATH)/boot/vmlinuz-$(INSTALL_NAME)$(INSTALL_SUFFIX)
   2.124 -	install -m0644 vmlinux $(INSTALL_PATH)/boot/vmlinux-syms-$(INSTALL_NAME)$(INSTALL_SUFFIX)
   2.125 -	install -m0664 .config $(INSTALL_PATH)/boot/config-$(INSTALL_NAME)$(INSTALL_SUFFIX)
   2.126 -	install -m0664 System.map $(INSTALL_PATH)/boot/System.map-$(INSTALL_NAME)$(INSTALL_SUFFIX)
   2.127 -	ln -f -s vmlinuz-$(INSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_PATH)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
   2.128 -
   2.129 -%_config: arch/xen/defconfig-%
   2.130 -	rm -f .config arch/xen/defconfig
   2.131 -	cp -f arch/xen/defconfig-$(@:_config=) arch/xen/defconfig
   2.132 -	cp -f arch/xen/defconfig-$(@:_config=) .config
   2.133 -
   2.134 -
   2.135 -archclean:
   2.136 -	@$(MAKEBOOT) clean
   2.137 -
   2.138 -archmrproper:
   2.139 -	rm -f include/asm-xen/xen-public/arch
   2.140 -
   2.141 -archdep:
   2.142 -	@$(MAKEBOOT) dep
     3.1 --- a/linux-2.4.30-xen-sparse/arch/xen/boot/Makefile	Mon Jul 11 14:48:47 2005 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,13 +0,0 @@
     3.4 -#
     3.5 -# arch/xen/boot/Makefile
     3.6 -#
     3.7 -
     3.8 -bzImage: $(TOPDIR)/vmlinux
     3.9 -	$(OBJCOPY) $< Image
    3.10 -	gzip -f -9 < Image > $@
    3.11 -	rm -f Image
    3.12 -
    3.13 -dep:
    3.14 -
    3.15 -clean:
    3.16 -	rm -f bzImage Image
     4.1 --- a/linux-2.4.30-xen-sparse/arch/xen/config.in	Mon Jul 11 14:48:47 2005 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,337 +0,0 @@
     4.4 -#
     4.5 -# For a description of the syntax of this configuration file,
     4.6 -# see Documentation/kbuild/config-language.txt.
     4.7 -#
     4.8 -mainmenu_name "Linux Kernel Configuration"
     4.9 -
    4.10 -define_bool CONFIG_XEN y
    4.11 -
    4.12 -define_bool CONFIG_X86 y
    4.13 -define_bool CONFIG_ISA y
    4.14 -define_bool CONFIG_SBUS n
    4.15 -
    4.16 -define_bool CONFIG_UID16 y
    4.17 -
    4.18 -mainmenu_option next_comment
    4.19 -comment 'Xen'
    4.20 -bool 'Support for privileged operations (domain 0)' CONFIG_XEN_PRIVILEGED_GUEST
    4.21 -bool 'Device-driver domain (physical device access)' CONFIG_XEN_PHYSDEV_ACCESS
    4.22 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
    4.23 -    bool 'USB-device backend driver' CONFIG_XEN_USB_BACKEND
    4.24 -fi
    4.25 -bool 'Scrub memory before freeing it to Xen' CONFIG_XEN_SCRUB_PAGES
    4.26 -bool 'Network-device frontend driver' CONFIG_XEN_NETDEV_FRONTEND
    4.27 -bool 'Block-device frontend driver' CONFIG_XEN_BLKDEV_FRONTEND
    4.28 -bool 'Block-device uses grant tables' CONFIG_XEN_BLKDEV_GRANT
    4.29 -bool 'USB-device frontend driver' CONFIG_XEN_USB_FRONTEND
    4.30 -endmenu
    4.31 -# The IBM S/390 patch needs this.
    4.32 -define_bool CONFIG_NO_IDLE_HZ y
    4.33 -
    4.34 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
    4.35 -   define_bool CONFIG_FOREIGN_PAGES y
    4.36 -else
    4.37 -   define_bool CONFIG_FOREIGN_PAGES n
    4.38 -   define_bool CONFIG_NETDEVICES y
    4.39 -   define_bool CONFIG_VT n
    4.40 -fi
    4.41 -
    4.42 -mainmenu_option next_comment
    4.43 -comment 'Code maturity level options'
    4.44 -bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL
    4.45 -endmenu
    4.46 -
    4.47 -mainmenu_option next_comment
    4.48 -comment 'Loadable module support'
    4.49 -bool 'Enable loadable module support' CONFIG_MODULES
    4.50 -if [ "$CONFIG_MODULES" = "y" ]; then
    4.51 -   bool '  Set version information on all module symbols' CONFIG_MODVERSIONS
    4.52 -   bool '  Kernel module loader' CONFIG_KMOD
    4.53 -fi
    4.54 -endmenu
    4.55 -
    4.56 -mainmenu_option next_comment
    4.57 -comment 'Processor type and features'
    4.58 -choice 'Processor family' \
    4.59 -	"Pentium-Pro/Celeron/Pentium-II		CONFIG_M686 \
    4.60 -	 Pentium-III/Celeron(Coppermine)	CONFIG_MPENTIUMIII \
    4.61 -	 Pentium-4				CONFIG_MPENTIUM4 \
    4.62 -	 Athlon/Duron/K7			CONFIG_MK7 \
    4.63 -	 Opteron/Athlon64/Hammer/K8             CONFIG_MK8 \
    4.64 -	 VIA-C3-2                               CONFIG_MVIAC3_2" Pentium-Pro
    4.65 -
    4.66 -   define_bool CONFIG_X86_WP_WORKS_OK y
    4.67 -   define_bool CONFIG_X86_INVLPG y
    4.68 -   define_bool CONFIG_X86_CMPXCHG y
    4.69 -   define_bool CONFIG_X86_XADD y
    4.70 -   define_bool CONFIG_X86_BSWAP y
    4.71 -   define_bool CONFIG_X86_POPAD_OK y
    4.72 -   define_bool CONFIG_RWSEM_GENERIC_SPINLOCK n
    4.73 -   define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM y
    4.74 -
    4.75 -   define_bool CONFIG_X86_GOOD_APIC y
    4.76 -   define_bool CONFIG_X86_PGE y
    4.77 -   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
    4.78 -   define_bool CONFIG_X86_TSC y
    4.79 -
    4.80 -if [ "$CONFIG_M686" = "y" ]; then
    4.81 -   define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    4.82 -fi
    4.83 -if [ "$CONFIG_MPENTIUMIII" = "y" ]; then
    4.84 -   define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    4.85 -fi
    4.86 -if [ "$CONFIG_MPENTIUM4" = "y" ]; then
    4.87 -   define_int  CONFIG_X86_L1_CACHE_SHIFT 7
    4.88 -fi
    4.89 -if [ "$CONFIG_MK8" = "y" ]; then
    4.90 -   define_bool CONFIG_MK7 y
    4.91 -fi
    4.92 -if [ "$CONFIG_MK7" = "y" ]; then
    4.93 -   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
    4.94 -   define_bool CONFIG_X86_USE_3DNOW y
    4.95 -fi
    4.96 -if [ "$CONFIG_MVIAC3_2" = "y" ]; then
    4.97 -   define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    4.98 -fi
    4.99 -
   4.100 -#if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
   4.101 -#   tristate 'BIOS Enhanced Disk Drive calls determine boot disk (EXPERIMENTAL)' CONFIG_EDD
   4.102 -#fi
   4.103 -
   4.104 -choice 'High Memory Support' \
   4.105 -	"off    CONFIG_NOHIGHMEM \
   4.106 -	 4GB    CONFIG_HIGHMEM4G" off
   4.107 -#	 64GB   CONFIG_HIGHMEM64G" off
   4.108 -if [ "$CONFIG_HIGHMEM4G" = "y" ]; then
   4.109 -   define_bool CONFIG_HIGHMEM y
   4.110 -fi
   4.111 -if [ "$CONFIG_HIGHMEM64G" = "y" ]; then
   4.112 -   define_bool CONFIG_HIGHMEM y
   4.113 -   define_bool CONFIG_X86_PAE y
   4.114 -fi
   4.115 -
   4.116 -if [ "$CONFIG_HIGHMEM" = "y" ]; then
   4.117 -   bool 'HIGHMEM I/O support' CONFIG_HIGHIO
   4.118 -fi
   4.119 -
   4.120 -define_int CONFIG_FORCE_MAX_ZONEORDER 11
   4.121 -
   4.122 -#bool 'Symmetric multi-processing support' CONFIG_SMP
   4.123 -#if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then
   4.124 -#   define_bool CONFIG_HAVE_DEC_LOCK y
   4.125 -#fi
   4.126 -endmenu
   4.127 -
   4.128 -mainmenu_option next_comment
   4.129 -comment 'General setup'
   4.130 -
   4.131 -bool 'Networking support' CONFIG_NET
   4.132 -
   4.133 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   4.134 -   bool 'PCI support' CONFIG_PCI
   4.135 -   source drivers/pci/Config.in
   4.136 -
   4.137 -   bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG
   4.138 -
   4.139 -   if [ "$CONFIG_HOTPLUG" = "y" ] ; then
   4.140 -      source drivers/pcmcia/Config.in
   4.141 -      source drivers/hotplug/Config.in
   4.142 -   else
   4.143 -      define_bool CONFIG_PCMCIA n
   4.144 -      define_bool CONFIG_HOTPLUG_PCI n
   4.145 -   fi
   4.146 -fi
   4.147 -
   4.148 -bool 'System V IPC' CONFIG_SYSVIPC
   4.149 -bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
   4.150 -bool 'Sysctl support' CONFIG_SYSCTL
   4.151 -if [ "$CONFIG_PROC_FS" = "y" ]; then
   4.152 -   choice 'Kernel core (/proc/kcore) format' \
   4.153 -	"ELF		CONFIG_KCORE_ELF	\
   4.154 -	 A.OUT		CONFIG_KCORE_AOUT" ELF
   4.155 -fi
   4.156 -tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
   4.157 -bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
   4.158 -tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
   4.159 -bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER
   4.160 -
   4.161 -endmenu
   4.162 -
   4.163 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   4.164 -   source drivers/mtd/Config.in
   4.165 -
   4.166 -   source drivers/parport/Config.in
   4.167 -
   4.168 -   source drivers/pnp/Config.in
   4.169 -
   4.170 -   source drivers/block/Config.in
   4.171 -
   4.172 -   source drivers/md/Config.in
   4.173 -fi
   4.174 -
   4.175 -if [ "$CONFIG_NET" = "y" ]; then
   4.176 -   source net/Config.in
   4.177 -fi
   4.178 -
   4.179 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   4.180 -   mainmenu_option next_comment
   4.181 -   comment 'ATA/IDE/MFM/RLL support'
   4.182 -
   4.183 -   tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE
   4.184 -
   4.185 -   if [ "$CONFIG_IDE" != "n" ]; then
   4.186 -      source drivers/ide/Config.in
   4.187 -   else
   4.188 -      define_bool CONFIG_BLK_DEV_HD n
   4.189 -   fi
   4.190 -   endmenu
   4.191 -fi
   4.192 -
   4.193 -mainmenu_option next_comment
   4.194 -comment 'SCSI support'
   4.195 -
   4.196 -tristate 'SCSI support' CONFIG_SCSI
   4.197 -
   4.198 -if [ "$CONFIG_SCSI" != "n" ]; then
   4.199 -   source drivers/scsi/Config.in
   4.200 -fi
   4.201 -endmenu
   4.202 -
   4.203 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   4.204 -   source drivers/message/fusion/Config.in
   4.205 -
   4.206 -   source drivers/ieee1394/Config.in
   4.207 -
   4.208 -   source drivers/message/i2o/Config.in
   4.209 -
   4.210 -   if [ "$CONFIG_NET" = "y" ]; then
   4.211 -      mainmenu_option next_comment
   4.212 -      comment 'Network device support'
   4.213 -
   4.214 -      bool 'Network device support' CONFIG_NETDEVICES
   4.215 -      if [ "$CONFIG_NETDEVICES" = "y" ]; then
   4.216 -         source drivers/net/Config.in
   4.217 -         if [ "$CONFIG_ATM" = "y" -o "$CONFIG_ATM" = "m" ]; then
   4.218 -            source drivers/atm/Config.in
   4.219 -         fi
   4.220 -      fi
   4.221 -      endmenu
   4.222 -   fi
   4.223 -
   4.224 -   source net/ax25/Config.in
   4.225 -
   4.226 -   source net/irda/Config.in
   4.227 -
   4.228 -   mainmenu_option next_comment
   4.229 -   comment 'ISDN subsystem'
   4.230 -   if [ "$CONFIG_NET" != "n" ]; then
   4.231 -      tristate 'ISDN support' CONFIG_ISDN
   4.232 -      if [ "$CONFIG_ISDN" != "n" ]; then
   4.233 -         source drivers/isdn/Config.in
   4.234 -      fi
   4.235 -   fi
   4.236 -   endmenu
   4.237 -
   4.238 -   if [ "$CONFIG_ISA" = "y" ]; then
   4.239 -       mainmenu_option next_comment
   4.240 -       comment 'Old CD-ROM drivers (not SCSI, not IDE)'
   4.241 -   
   4.242 -       bool 'Support non-SCSI/IDE/ATAPI CDROM drives' CONFIG_CD_NO_IDESCSI
   4.243 -       if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
   4.244 -          source drivers/cdrom/Config.in
   4.245 -       fi
   4.246 -       endmenu
   4.247 -   fi
   4.248 -
   4.249 -   #
   4.250 -   # input before char - char/joystick depends on it. As does USB.
   4.251 -   #
   4.252 -   source drivers/input/Config.in
   4.253 -else
   4.254 -   #
   4.255 -   # Block device driver configuration
   4.256 -   #
   4.257 -   mainmenu_option next_comment
   4.258 -   comment 'Block devices'
   4.259 -   tristate 'Loopback device support' CONFIG_BLK_DEV_LOOP
   4.260 -   dep_tristate 'Network block device support' CONFIG_BLK_DEV_NBD $CONFIG_NET
   4.261 -   tristate 'RAM disk support' CONFIG_BLK_DEV_RAM
   4.262 -   if [ "$CONFIG_BLK_DEV_RAM" = "y" -o "$CONFIG_BLK_DEV_RAM" = "m" ]; then
   4.263 -      int '  Default RAM disk size' CONFIG_BLK_DEV_RAM_SIZE 4096
   4.264 -   fi
   4.265 -   dep_bool '  Initial RAM disk (initrd) support' CONFIG_BLK_DEV_INITRD $CONFIG_BLK_DEV_RAM
   4.266 -   bool 'Per partition statistics in /proc/partitions' CONFIG_BLK_STATS
   4.267 -   define_bool CONFIG_BLK_DEV_HD n
   4.268 -   endmenu
   4.269 -fi
   4.270 -
   4.271 -source drivers/char/Config.in
   4.272 -
   4.273 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" -o "$CONFIG_XEN_USB_FRONTEND" = "y" ]; then
   4.274 -   source drivers/media/Config.in
   4.275 -fi
   4.276 -
   4.277 -source fs/Config.in
   4.278 -
   4.279 -mainmenu_option next_comment
   4.280 -comment 'Console drivers'
   4.281 -
   4.282 -define_bool CONFIG_XEN_CONSOLE y
   4.283 -
   4.284 -if [ "$CONFIG_VT" = "y" ]; then
   4.285 -   bool 'VGA text console' CONFIG_VGA_CONSOLE
   4.286 -   bool 'Dummy console' CONFIG_DUMMY_CONSOLE 
   4.287 -   if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   4.288 -      bool 'Video mode selection support' CONFIG_VIDEO_SELECT
   4.289 -      if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
   4.290 -         tristate 'MDA text console (dual-headed) (EXPERIMENTAL)' CONFIG_MDA_CONSOLE
   4.291 -         source drivers/video/Config.in
   4.292 -      fi
   4.293 -   fi
   4.294 -fi
   4.295 -endmenu
   4.296 -
   4.297 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   4.298 -   mainmenu_option next_comment
   4.299 -   comment 'Sound'
   4.300 -
   4.301 -   tristate 'Sound card support' CONFIG_SOUND
   4.302 -   if [ "$CONFIG_SOUND" != "n" ]; then
   4.303 -      source drivers/sound/Config.in
   4.304 -   fi
   4.305 -   endmenu
   4.306 -fi
   4.307 -
   4.308 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" -o "$CONFIG_XEN_USB_FRONTEND" = "y" ]; then
   4.309 -   if [ "$CONFIG_XEN_USB_FRONTEND" = "y" -o "$CONFIG_XEN_USB_BACKEND" = "y" ]; then
   4.310 -       define_bool CONFIG_USB y
   4.311 -   fi
   4.312 -   source drivers/usb/Config.in
   4.313 -fi
   4.314 -
   4.315 -if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then
   4.316 -   source net/bluetooth/Config.in
   4.317 -fi
   4.318 -
   4.319 -mainmenu_option next_comment
   4.320 -comment 'Kernel hacking'
   4.321 -
   4.322 -bool 'Kernel debugging' CONFIG_DEBUG_KERNEL
   4.323 -if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then
   4.324 -   bool '  Check for stack overflows' CONFIG_DEBUG_STACKOVERFLOW
   4.325 -   bool '  Debug high memory support' CONFIG_DEBUG_HIGHMEM
   4.326 -   bool '  Debug memory allocations' CONFIG_DEBUG_SLAB
   4.327 -   bool '  Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT
   4.328 -   bool '  Magic SysRq key' CONFIG_MAGIC_SYSRQ
   4.329 -   bool '  Spinlock debugging' CONFIG_DEBUG_SPINLOCK
   4.330 -   bool '  Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE
   4.331 -   bool '  Load all symbols for debugging' CONFIG_KALLSYMS
   4.332 -   bool '  Compile the kernel with frame pointers' CONFIG_FRAME_POINTER
   4.333 -fi
   4.334 -
   4.335 -int 'Kernel messages buffer length shift (0 = default)' CONFIG_LOG_BUF_SHIFT 0
   4.336 -
   4.337 -endmenu
   4.338 -
   4.339 -source crypto/Config.in
   4.340 -source lib/Config.in
     5.1 --- a/linux-2.4.30-xen-sparse/arch/xen/defconfig-xen0	Mon Jul 11 14:48:47 2005 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,927 +0,0 @@
     5.4 -#
     5.5 -# Automatically generated by make menuconfig: don't edit
     5.6 -#
     5.7 -CONFIG_XEN=y
     5.8 -CONFIG_X86=y
     5.9 -CONFIG_ISA=y
    5.10 -# CONFIG_SBUS is not set
    5.11 -CONFIG_UID16=y
    5.12 -
    5.13 -#
    5.14 -# Xen
    5.15 -#
    5.16 -CONFIG_XEN_PRIVILEGED_GUEST=y
    5.17 -CONFIG_XEN_PHYSDEV_ACCESS=y
    5.18 -# CONFIG_XEN_USB_BACKEND is not set
    5.19 -CONFIG_XEN_SCRUB_PAGES=y
    5.20 -CONFIG_XEN_NETDEV_FRONTEND=y
    5.21 -CONFIG_XEN_BLKDEV_FRONTEND=y
    5.22 -CONFIG_XEN_BLKDEV_GRANT=y
    5.23 -# CONFIG_XEN_USB_FRONTEND is not set
    5.24 -CONFIG_NO_IDLE_HZ=y
    5.25 -CONFIG_FOREIGN_PAGES=y
    5.26 -
    5.27 -#
    5.28 -# Code maturity level options
    5.29 -#
    5.30 -CONFIG_EXPERIMENTAL=y
    5.31 -
    5.32 -#
    5.33 -# Loadable module support
    5.34 -#
    5.35 -CONFIG_MODULES=y
    5.36 -CONFIG_MODVERSIONS=y
    5.37 -CONFIG_KMOD=y
    5.38 -
    5.39 -#
    5.40 -# Processor type and features
    5.41 -#
    5.42 -CONFIG_M686=y
    5.43 -# CONFIG_MPENTIUMIII is not set
    5.44 -# CONFIG_MPENTIUM4 is not set
    5.45 -# CONFIG_MK7 is not set
    5.46 -# CONFIG_MK8 is not set
    5.47 -# CONFIG_MVIAC3_2 is not set
    5.48 -CONFIG_X86_WP_WORKS_OK=y
    5.49 -CONFIG_X86_INVLPG=y
    5.50 -CONFIG_X86_CMPXCHG=y
    5.51 -CONFIG_X86_XADD=y
    5.52 -CONFIG_X86_BSWAP=y
    5.53 -CONFIG_X86_POPAD_OK=y
    5.54 -# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
    5.55 -CONFIG_RWSEM_XCHGADD_ALGORITHM=y
    5.56 -CONFIG_X86_GOOD_APIC=y
    5.57 -CONFIG_X86_PGE=y
    5.58 -CONFIG_X86_USE_PPRO_CHECKSUM=y
    5.59 -CONFIG_X86_TSC=y
    5.60 -CONFIG_X86_L1_CACHE_SHIFT=5
    5.61 -CONFIG_NOHIGHMEM=y
    5.62 -# CONFIG_HIGHMEM4G is not set
    5.63 -CONFIG_FORCE_MAX_ZONEORDER=11
    5.64 -
    5.65 -#
    5.66 -# General setup
    5.67 -#
    5.68 -CONFIG_NET=y
    5.69 -CONFIG_PCI=y
    5.70 -CONFIG_PCI_NAMES=y
    5.71 -CONFIG_HOTPLUG=y
    5.72 -
    5.73 -#
    5.74 -# PCMCIA/CardBus support
    5.75 -#
    5.76 -# CONFIG_PCMCIA is not set
    5.77 -
    5.78 -#
    5.79 -# PCI Hotplug Support
    5.80 -#
    5.81 -# CONFIG_HOTPLUG_PCI is not set
    5.82 -# CONFIG_HOTPLUG_PCI_COMPAQ is not set
    5.83 -# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
    5.84 -# CONFIG_HOTPLUG_PCI_SHPC is not set
    5.85 -# CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE is not set
    5.86 -# CONFIG_HOTPLUG_PCI_PCIE is not set
    5.87 -# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
    5.88 -CONFIG_SYSVIPC=y
    5.89 -# CONFIG_BSD_PROCESS_ACCT is not set
    5.90 -CONFIG_SYSCTL=y
    5.91 -CONFIG_KCORE_ELF=y
    5.92 -# CONFIG_KCORE_AOUT is not set
    5.93 -CONFIG_BINFMT_AOUT=y
    5.94 -CONFIG_BINFMT_ELF=y
    5.95 -# CONFIG_BINFMT_MISC is not set
    5.96 -# CONFIG_OOM_KILLER is not set
    5.97 -
    5.98 -#
    5.99 -# Memory Technology Devices (MTD)
   5.100 -#
   5.101 -# CONFIG_MTD is not set
   5.102 -
   5.103 -#
   5.104 -# Parallel port support
   5.105 -#
   5.106 -# CONFIG_PARPORT is not set
   5.107 -
   5.108 -#
   5.109 -# Plug and Play configuration
   5.110 -#
   5.111 -CONFIG_PNP=y
   5.112 -# CONFIG_ISAPNP is not set
   5.113 -
   5.114 -#
   5.115 -# Block devices
   5.116 -#
   5.117 -# CONFIG_BLK_DEV_FD is not set
   5.118 -# CONFIG_BLK_DEV_XD is not set
   5.119 -# CONFIG_PARIDE is not set
   5.120 -# CONFIG_BLK_CPQ_DA is not set
   5.121 -# CONFIG_BLK_CPQ_CISS_DA is not set
   5.122 -# CONFIG_CISS_SCSI_TAPE is not set
   5.123 -# CONFIG_CISS_MONITOR_THREAD is not set
   5.124 -# CONFIG_BLK_DEV_DAC960 is not set
   5.125 -# CONFIG_BLK_DEV_UMEM is not set
   5.126 -# CONFIG_BLK_DEV_SX8 is not set
   5.127 -CONFIG_BLK_DEV_LOOP=y
   5.128 -CONFIG_BLK_DEV_NBD=y
   5.129 -CONFIG_BLK_DEV_RAM=y
   5.130 -CONFIG_BLK_DEV_RAM_SIZE=4096
   5.131 -CONFIG_BLK_DEV_INITRD=y
   5.132 -# CONFIG_BLK_STATS is not set
   5.133 -
   5.134 -#
   5.135 -# Multi-device support (RAID and LVM)
   5.136 -#
   5.137 -CONFIG_MD=y
   5.138 -CONFIG_BLK_DEV_MD=y
   5.139 -CONFIG_MD_LINEAR=y
   5.140 -# CONFIG_MD_RAID0 is not set
   5.141 -CONFIG_MD_RAID1=y
   5.142 -# CONFIG_MD_RAID5 is not set
   5.143 -# CONFIG_MD_MULTIPATH is not set
   5.144 -CONFIG_BLK_DEV_LVM=y
   5.145 -
   5.146 -#
   5.147 -# Networking options
   5.148 -#
   5.149 -CONFIG_PACKET=y
   5.150 -CONFIG_PACKET_MMAP=y
   5.151 -# CONFIG_NETLINK_DEV is not set
   5.152 -CONFIG_NETFILTER=y
   5.153 -# CONFIG_NETFILTER_DEBUG is not set
   5.154 -CONFIG_FILTER=y
   5.155 -CONFIG_UNIX=y
   5.156 -CONFIG_INET=y
   5.157 -# CONFIG_IP_MULTICAST is not set
   5.158 -# CONFIG_IP_ADVANCED_ROUTER is not set
   5.159 -CONFIG_IP_PNP=y
   5.160 -CONFIG_IP_PNP_DHCP=y
   5.161 -# CONFIG_IP_PNP_BOOTP is not set
   5.162 -# CONFIG_IP_PNP_RARP is not set
   5.163 -# CONFIG_NET_IPIP is not set
   5.164 -# CONFIG_NET_IPGRE is not set
   5.165 -# CONFIG_ARPD is not set
   5.166 -# CONFIG_INET_ECN is not set
   5.167 -# CONFIG_SYN_COOKIES is not set
   5.168 -
   5.169 -#
   5.170 -#   IP: Netfilter Configuration
   5.171 -#
   5.172 -CONFIG_IP_NF_CONNTRACK=m
   5.173 -CONFIG_IP_NF_FTP=m
   5.174 -# CONFIG_IP_NF_AMANDA is not set
   5.175 -CONFIG_IP_NF_TFTP=m
   5.176 -CONFIG_IP_NF_IRC=m
   5.177 -# CONFIG_IP_NF_QUEUE is not set
   5.178 -CONFIG_IP_NF_IPTABLES=y
   5.179 -# CONFIG_IP_NF_MATCH_LIMIT is not set
   5.180 -# CONFIG_IP_NF_MATCH_MAC is not set
   5.181 -# CONFIG_IP_NF_MATCH_PKTTYPE is not set
   5.182 -# CONFIG_IP_NF_MATCH_MARK is not set
   5.183 -# CONFIG_IP_NF_MATCH_MULTIPORT is not set
   5.184 -# CONFIG_IP_NF_MATCH_TOS is not set
   5.185 -# CONFIG_IP_NF_MATCH_RECENT is not set
   5.186 -# CONFIG_IP_NF_MATCH_ECN is not set
   5.187 -# CONFIG_IP_NF_MATCH_DSCP is not set
   5.188 -# CONFIG_IP_NF_MATCH_AH_ESP is not set
   5.189 -# CONFIG_IP_NF_MATCH_LENGTH is not set
   5.190 -# CONFIG_IP_NF_MATCH_TTL is not set
   5.191 -# CONFIG_IP_NF_MATCH_TCPMSS is not set
   5.192 -# CONFIG_IP_NF_MATCH_HELPER is not set
   5.193 -CONFIG_IP_NF_MATCH_STATE=m
   5.194 -CONFIG_IP_NF_MATCH_CONNTRACK=m
   5.195 -# CONFIG_IP_NF_MATCH_UNCLEAN is not set
   5.196 -# CONFIG_IP_NF_MATCH_OWNER is not set
   5.197 -CONFIG_IP_NF_MATCH_PHYSDEV=y
   5.198 -CONFIG_IP_NF_FILTER=y
   5.199 -CONFIG_IP_NF_TARGET_REJECT=y
   5.200 -# CONFIG_IP_NF_TARGET_MIRROR is not set
   5.201 -CONFIG_IP_NF_NAT=m
   5.202 -CONFIG_IP_NF_NAT_NEEDED=y
   5.203 -CONFIG_IP_NF_TARGET_MASQUERADE=m
   5.204 -CONFIG_IP_NF_TARGET_REDIRECT=m
   5.205 -# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
   5.206 -CONFIG_IP_NF_NAT_IRC=m
   5.207 -CONFIG_IP_NF_NAT_FTP=m
   5.208 -CONFIG_IP_NF_NAT_TFTP=m
   5.209 -# CONFIG_IP_NF_MANGLE is not set
   5.210 -CONFIG_IP_NF_TARGET_LOG=y
   5.211 -CONFIG_IP_NF_TARGET_ULOG=y
   5.212 -# CONFIG_IP_NF_TARGET_TCPMSS is not set
   5.213 -# CONFIG_IP_NF_ARPTABLES is not set
   5.214 -
   5.215 -#
   5.216 -#   IP: Virtual Server Configuration
   5.217 -#
   5.218 -# CONFIG_IP_VS is not set
   5.219 -# CONFIG_IPV6 is not set
   5.220 -# CONFIG_KHTTPD is not set
   5.221 -
   5.222 -#
   5.223 -#    SCTP Configuration (EXPERIMENTAL)
   5.224 -#
   5.225 -# CONFIG_IP_SCTP is not set
   5.226 -# CONFIG_ATM is not set
   5.227 -CONFIG_VLAN_8021Q=y
   5.228 -# CONFIG_IPX is not set
   5.229 -# CONFIG_ATALK is not set
   5.230 -# CONFIG_DECNET is not set
   5.231 -CONFIG_BRIDGE=y
   5.232 -CONFIG_BRIDGE_NF_EBTABLES=m
   5.233 -CONFIG_BRIDGE_EBT_T_FILTER=m
   5.234 -CONFIG_BRIDGE_EBT_T_NAT=m
   5.235 -CONFIG_BRIDGE_EBT_BROUTE=m
   5.236 -CONFIG_BRIDGE_EBT_LOG=m
   5.237 -CONFIG_BRIDGE_EBT_IPF=m
   5.238 -CONFIG_BRIDGE_EBT_ARPF=m
   5.239 -CONFIG_BRIDGE_EBT_AMONG=m
   5.240 -CONFIG_BRIDGE_EBT_LIMIT=m
   5.241 -CONFIG_BRIDGE_EBT_VLANF=m
   5.242 -CONFIG_BRIDGE_EBT_802_3=m
   5.243 -CONFIG_BRIDGE_EBT_PKTTYPE=m
   5.244 -CONFIG_BRIDGE_EBT_STP=m
   5.245 -CONFIG_BRIDGE_EBT_MARKF=m
   5.246 -CONFIG_BRIDGE_EBT_ARPREPLY=m
   5.247 -CONFIG_BRIDGE_EBT_SNAT=m
   5.248 -CONFIG_BRIDGE_EBT_DNAT=m
   5.249 -CONFIG_BRIDGE_EBT_REDIRECT=m
   5.250 -CONFIG_BRIDGE_EBT_MARK_T=m
   5.251 -# CONFIG_X25 is not set
   5.252 -# CONFIG_LAPB is not set
   5.253 -# CONFIG_LLC is not set
   5.254 -# CONFIG_NET_DIVERT is not set
   5.255 -# CONFIG_ECONET is not set
   5.256 -# CONFIG_WAN_ROUTER is not set
   5.257 -# CONFIG_NET_FASTROUTE is not set
   5.258 -# CONFIG_NET_HW_FLOWCONTROL is not set
   5.259 -
   5.260 -#
   5.261 -# QoS and/or fair queueing
   5.262 -#
   5.263 -# CONFIG_NET_SCHED is not set
   5.264 -
   5.265 -#
   5.266 -# Network testing
   5.267 -#
   5.268 -# CONFIG_NET_PKTGEN is not set
   5.269 -
   5.270 -#
   5.271 -# ATA/IDE/MFM/RLL support
   5.272 -#
   5.273 -CONFIG_IDE=y
   5.274 -
   5.275 -#
   5.276 -# IDE, ATA and ATAPI Block devices
   5.277 -#
   5.278 -CONFIG_BLK_DEV_IDE=y
   5.279 -# CONFIG_BLK_DEV_HD_IDE is not set
   5.280 -# CONFIG_BLK_DEV_HD is not set
   5.281 -# CONFIG_BLK_DEV_IDE_SATA is not set
   5.282 -CONFIG_BLK_DEV_IDEDISK=y
   5.283 -CONFIG_IDEDISK_MULTI_MODE=y
   5.284 -CONFIG_IDEDISK_STROKE=y
   5.285 -# CONFIG_BLK_DEV_IDECS is not set
   5.286 -# CONFIG_BLK_DEV_DELKIN is not set
   5.287 -CONFIG_BLK_DEV_IDECD=y
   5.288 -CONFIG_BLK_DEV_IDETAPE=y
   5.289 -CONFIG_BLK_DEV_IDEFLOPPY=y
   5.290 -CONFIG_BLK_DEV_IDESCSI=y
   5.291 -CONFIG_IDE_TASK_IOCTL=y
   5.292 -CONFIG_BLK_DEV_CMD640=y
   5.293 -CONFIG_BLK_DEV_CMD640_ENHANCED=y
   5.294 -# CONFIG_BLK_DEV_ISAPNP is not set
   5.295 -CONFIG_BLK_DEV_IDEPCI=y
   5.296 -CONFIG_BLK_DEV_GENERIC=y
   5.297 -CONFIG_IDEPCI_SHARE_IRQ=y
   5.298 -CONFIG_BLK_DEV_IDEDMA_PCI=y
   5.299 -CONFIG_BLK_DEV_OFFBOARD=y
   5.300 -# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
   5.301 -CONFIG_IDEDMA_PCI_AUTO=y
   5.302 -# CONFIG_IDEDMA_ONLYDISK is not set
   5.303 -CONFIG_BLK_DEV_IDEDMA=y
   5.304 -# CONFIG_IDEDMA_PCI_WIP is not set
   5.305 -CONFIG_BLK_DEV_ADMA100=y
   5.306 -CONFIG_BLK_DEV_AEC62XX=y
   5.307 -CONFIG_BLK_DEV_ALI15X3=y
   5.308 -CONFIG_WDC_ALI15X3=y
   5.309 -CONFIG_BLK_DEV_AMD74XX=y
   5.310 -CONFIG_AMD74XX_OVERRIDE=y
   5.311 -# CONFIG_BLK_DEV_ATIIXP is not set
   5.312 -CONFIG_BLK_DEV_CMD64X=y
   5.313 -CONFIG_BLK_DEV_TRIFLEX=y
   5.314 -CONFIG_BLK_DEV_CY82C693=y
   5.315 -CONFIG_BLK_DEV_CS5530=y
   5.316 -CONFIG_BLK_DEV_HPT34X=y
   5.317 -# CONFIG_HPT34X_AUTODMA is not set
   5.318 -CONFIG_BLK_DEV_HPT366=y
   5.319 -CONFIG_BLK_DEV_PIIX=y
   5.320 -CONFIG_BLK_DEV_NS87415=y
   5.321 -# CONFIG_BLK_DEV_OPTI621 is not set
   5.322 -CONFIG_BLK_DEV_PDC202XX_OLD=y
   5.323 -CONFIG_PDC202XX_BURST=y
   5.324 -CONFIG_BLK_DEV_PDC202XX_NEW=y
   5.325 -CONFIG_PDC202XX_FORCE=y
   5.326 -CONFIG_BLK_DEV_RZ1000=y
   5.327 -CONFIG_BLK_DEV_SC1200=y
   5.328 -CONFIG_BLK_DEV_SVWKS=y
   5.329 -CONFIG_BLK_DEV_SIIMAGE=y
   5.330 -CONFIG_BLK_DEV_SIS5513=y
   5.331 -CONFIG_BLK_DEV_SLC90E66=y
   5.332 -CONFIG_BLK_DEV_TRM290=y
   5.333 -CONFIG_BLK_DEV_VIA82CXXX=y
   5.334 -CONFIG_IDE_CHIPSETS=y
   5.335 -# CONFIG_BLK_DEV_4DRIVES is not set
   5.336 -# CONFIG_BLK_DEV_ALI14XX is not set
   5.337 -# CONFIG_BLK_DEV_DTC2278 is not set
   5.338 -# CONFIG_BLK_DEV_HT6560B is not set
   5.339 -# CONFIG_BLK_DEV_PDC4030 is not set
   5.340 -# CONFIG_BLK_DEV_QD65XX is not set
   5.341 -# CONFIG_BLK_DEV_UMC8672 is not set
   5.342 -CONFIG_IDEDMA_AUTO=y
   5.343 -# CONFIG_IDEDMA_IVB is not set
   5.344 -# CONFIG_DMA_NONPCI is not set
   5.345 -CONFIG_BLK_DEV_PDC202XX=y
   5.346 -# CONFIG_BLK_DEV_ATARAID is not set
   5.347 -# CONFIG_BLK_DEV_ATARAID_PDC is not set
   5.348 -# CONFIG_BLK_DEV_ATARAID_HPT is not set
   5.349 -# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
   5.350 -# CONFIG_BLK_DEV_ATARAID_SII is not set
   5.351 -
   5.352 -#
   5.353 -# SCSI support
   5.354 -#
   5.355 -CONFIG_SCSI=y
   5.356 -CONFIG_BLK_DEV_SD=y
   5.357 -CONFIG_SD_EXTRA_DEVS=40
   5.358 -# CONFIG_CHR_DEV_ST is not set
   5.359 -# CONFIG_CHR_DEV_OSST is not set
   5.360 -# CONFIG_BLK_DEV_SR is not set
   5.361 -CONFIG_CHR_DEV_SG=y
   5.362 -# CONFIG_SCSI_DEBUG_QUEUES is not set
   5.363 -# CONFIG_SCSI_MULTI_LUN is not set
   5.364 -# CONFIG_SCSI_CONSTANTS is not set
   5.365 -# CONFIG_SCSI_LOGGING is not set
   5.366 -
   5.367 -#
   5.368 -# SCSI low-level drivers
   5.369 -#
   5.370 -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
   5.371 -# CONFIG_SCSI_7000FASST is not set
   5.372 -# CONFIG_SCSI_ACARD is not set
   5.373 -# CONFIG_SCSI_AHA152X is not set
   5.374 -# CONFIG_SCSI_AHA1542 is not set
   5.375 -# CONFIG_SCSI_AHA1740 is not set
   5.376 -CONFIG_SCSI_AACRAID=y
   5.377 -CONFIG_SCSI_AIC7XXX=y
   5.378 -CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
   5.379 -CONFIG_AIC7XXX_RESET_DELAY_MS=15000
   5.380 -# CONFIG_AIC7XXX_PROBE_EISA_VL is not set
   5.381 -# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
   5.382 -# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
   5.383 -CONFIG_AIC7XXX_DEBUG_MASK=0
   5.384 -# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
   5.385 -CONFIG_SCSI_AIC79XX=y
   5.386 -CONFIG_AIC79XX_CMDS_PER_DEVICE=32
   5.387 -CONFIG_AIC79XX_RESET_DELAY_MS=15000
   5.388 -# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
   5.389 -# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
   5.390 -# CONFIG_AIC79XX_DEBUG_ENABLE is not set
   5.391 -CONFIG_AIC79XX_DEBUG_MASK=0
   5.392 -# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
   5.393 -# CONFIG_SCSI_DPT_I2O is not set
   5.394 -# CONFIG_SCSI_ADVANSYS is not set
   5.395 -# CONFIG_SCSI_IN2000 is not set
   5.396 -# CONFIG_SCSI_AM53C974 is not set
   5.397 -CONFIG_SCSI_MEGARAID=y
   5.398 -# CONFIG_SCSI_MEGARAID2 is not set
   5.399 -CONFIG_SCSI_SATA=y
   5.400 -# CONFIG_SCSI_SATA_AHCI is not set
   5.401 -# CONFIG_SCSI_SATA_SVW is not set
   5.402 -CONFIG_SCSI_ATA_PIIX=y
   5.403 -# CONFIG_SCSI_SATA_NV is not set
   5.404 -# CONFIG_SCSI_SATA_QSTOR is not set
   5.405 -CONFIG_SCSI_SATA_PROMISE=y
   5.406 -CONFIG_SCSI_SATA_SX4=y
   5.407 -CONFIG_SCSI_SATA_SIL=y
   5.408 -CONFIG_SCSI_SATA_SIS=y
   5.409 -# CONFIG_SCSI_SATA_ULI is not set
   5.410 -CONFIG_SCSI_SATA_VIA=y
   5.411 -CONFIG_SCSI_SATA_VITESSE=y
   5.412 -CONFIG_SCSI_BUSLOGIC=y
   5.413 -# CONFIG_SCSI_OMIT_FLASHPOINT is not set
   5.414 -# CONFIG_SCSI_CPQFCTS is not set
   5.415 -# CONFIG_SCSI_DMX3191D is not set
   5.416 -# CONFIG_SCSI_DTC3280 is not set
   5.417 -# CONFIG_SCSI_EATA is not set
   5.418 -# CONFIG_SCSI_EATA_DMA is not set
   5.419 -# CONFIG_SCSI_EATA_PIO is not set
   5.420 -# CONFIG_SCSI_FUTURE_DOMAIN is not set
   5.421 -# CONFIG_SCSI_GDTH is not set
   5.422 -# CONFIG_SCSI_GENERIC_NCR5380 is not set
   5.423 -# CONFIG_SCSI_IPS is not set
   5.424 -# CONFIG_SCSI_INITIO is not set
   5.425 -# CONFIG_SCSI_INIA100 is not set
   5.426 -# CONFIG_SCSI_NCR53C406A is not set
   5.427 -# CONFIG_SCSI_NCR53C7xx is not set
   5.428 -CONFIG_SCSI_SYM53C8XX_2=y
   5.429 -CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
   5.430 -CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
   5.431 -CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
   5.432 -# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
   5.433 -# CONFIG_SCSI_PAS16 is not set
   5.434 -# CONFIG_SCSI_PCI2000 is not set
   5.435 -# CONFIG_SCSI_PCI2220I is not set
   5.436 -# CONFIG_SCSI_PSI240I is not set
   5.437 -# CONFIG_SCSI_QLOGIC_FAS is not set
   5.438 -# CONFIG_SCSI_QLOGIC_ISP is not set
   5.439 -# CONFIG_SCSI_QLOGIC_FC is not set
   5.440 -# CONFIG_SCSI_QLOGIC_1280 is not set
   5.441 -# CONFIG_SCSI_SEAGATE is not set
   5.442 -# CONFIG_SCSI_SIM710 is not set
   5.443 -# CONFIG_SCSI_SYM53C416 is not set
   5.444 -# CONFIG_SCSI_DC390T is not set
   5.445 -# CONFIG_SCSI_T128 is not set
   5.446 -# CONFIG_SCSI_U14_34F is not set
   5.447 -# CONFIG_SCSI_ULTRASTOR is not set
   5.448 -# CONFIG_SCSI_NSP32 is not set
   5.449 -# CONFIG_SCSI_DEBUG is not set
   5.450 -
   5.451 -#
   5.452 -# Fusion MPT device support
   5.453 -#
   5.454 -# CONFIG_FUSION is not set
   5.455 -# CONFIG_FUSION_BOOT is not set
   5.456 -# CONFIG_FUSION_ISENSE is not set
   5.457 -# CONFIG_FUSION_CTL is not set
   5.458 -# CONFIG_FUSION_LAN is not set
   5.459 -
   5.460 -#
   5.461 -# IEEE 1394 (FireWire) support (EXPERIMENTAL)
   5.462 -#
   5.463 -# CONFIG_IEEE1394 is not set
   5.464 -
   5.465 -#
   5.466 -# I2O device support
   5.467 -#
   5.468 -# CONFIG_I2O is not set
   5.469 -# CONFIG_I2O_PCI is not set
   5.470 -# CONFIG_I2O_BLOCK is not set
   5.471 -# CONFIG_I2O_LAN is not set
   5.472 -# CONFIG_I2O_SCSI is not set
   5.473 -# CONFIG_I2O_PROC is not set
   5.474 -
   5.475 -#
   5.476 -# Network device support
   5.477 -#
   5.478 -CONFIG_NETDEVICES=y
   5.479 -
   5.480 -#
   5.481 -# ARCnet devices
   5.482 -#
   5.483 -# CONFIG_ARCNET is not set
   5.484 -# CONFIG_DUMMY is not set
   5.485 -# CONFIG_BONDING is not set
   5.486 -# CONFIG_EQUALIZER is not set
   5.487 -# CONFIG_TUN is not set
   5.488 -# CONFIG_ETHERTAP is not set
   5.489 -
   5.490 -#
   5.491 -# Ethernet (10 or 100Mbit)
   5.492 -#
   5.493 -CONFIG_NET_ETHERNET=y
   5.494 -# CONFIG_SUNLANCE is not set
   5.495 -# CONFIG_HAPPYMEAL is not set
   5.496 -# CONFIG_SUNBMAC is not set
   5.497 -# CONFIG_SUNQE is not set
   5.498 -# CONFIG_SUNGEM is not set
   5.499 -CONFIG_NET_VENDOR_3COM=y
   5.500 -# CONFIG_EL1 is not set
   5.501 -# CONFIG_EL2 is not set
   5.502 -# CONFIG_ELPLUS is not set
   5.503 -# CONFIG_EL16 is not set
   5.504 -# CONFIG_EL3 is not set
   5.505 -# CONFIG_3C515 is not set
   5.506 -# CONFIG_ELMC is not set
   5.507 -# CONFIG_ELMC_II is not set
   5.508 -CONFIG_VORTEX=y
   5.509 -# CONFIG_TYPHOON is not set
   5.510 -# CONFIG_LANCE is not set
   5.511 -# CONFIG_NET_VENDOR_SMC is not set
   5.512 -# CONFIG_NET_VENDOR_RACAL is not set
   5.513 -# CONFIG_AT1700 is not set
   5.514 -# CONFIG_DEPCA is not set
   5.515 -# CONFIG_HP100 is not set
   5.516 -# CONFIG_NET_ISA is not set
   5.517 -CONFIG_NET_PCI=y
   5.518 -CONFIG_PCNET32=y
   5.519 -# CONFIG_AMD8111_ETH is not set
   5.520 -# CONFIG_ADAPTEC_STARFIRE is not set
   5.521 -# CONFIG_AC3200 is not set
   5.522 -# CONFIG_APRICOT is not set
   5.523 -# CONFIG_B44 is not set
   5.524 -# CONFIG_CS89x0 is not set
   5.525 -# CONFIG_TULIP is not set
   5.526 -# CONFIG_DE4X5 is not set
   5.527 -# CONFIG_DGRS is not set
   5.528 -# CONFIG_DM9102 is not set
   5.529 -# CONFIG_EEPRO100 is not set
   5.530 -# CONFIG_EEPRO100_PIO is not set
   5.531 -CONFIG_E100=y
   5.532 -# CONFIG_LNE390 is not set
   5.533 -# CONFIG_FEALNX is not set
   5.534 -# CONFIG_NATSEMI is not set
   5.535 -CONFIG_NE2K_PCI=y
   5.536 -# CONFIG_FORCEDETH is not set
   5.537 -# CONFIG_NE3210 is not set
   5.538 -# CONFIG_ES3210 is not set
   5.539 -# CONFIG_8139CP is not set
   5.540 -# CONFIG_8139TOO is not set
   5.541 -# CONFIG_8139TOO_PIO is not set
   5.542 -# CONFIG_8139TOO_TUNE_TWISTER is not set
   5.543 -# CONFIG_8139TOO_8129 is not set
   5.544 -# CONFIG_8139_OLD_RX_RESET is not set
   5.545 -# CONFIG_SIS900 is not set
   5.546 -# CONFIG_EPIC100 is not set
   5.547 -# CONFIG_SUNDANCE is not set
   5.548 -# CONFIG_SUNDANCE_MMIO is not set
   5.549 -# CONFIG_TLAN is not set
   5.550 -# CONFIG_VIA_RHINE is not set
   5.551 -# CONFIG_VIA_RHINE_MMIO is not set
   5.552 -# CONFIG_WINBOND_840 is not set
   5.553 -# CONFIG_NET_POCKET is not set
   5.554 -
   5.555 -#
   5.556 -# Ethernet (1000 Mbit)
   5.557 -#
   5.558 -# CONFIG_ACENIC is not set
   5.559 -# CONFIG_DL2K is not set
   5.560 -CONFIG_E1000=y
   5.561 -# CONFIG_E1000_NAPI is not set
   5.562 -# CONFIG_MYRI_SBUS is not set
   5.563 -# CONFIG_NS83820 is not set
   5.564 -# CONFIG_HAMACHI is not set
   5.565 -# CONFIG_YELLOWFIN is not set
   5.566 -# CONFIG_R8169 is not set
   5.567 -# CONFIG_SK98LIN is not set
   5.568 -CONFIG_TIGON3=y
   5.569 -# CONFIG_FDDI is not set
   5.570 -# CONFIG_HIPPI is not set
   5.571 -# CONFIG_PLIP is not set
   5.572 -# CONFIG_PPP is not set
   5.573 -# CONFIG_SLIP is not set
   5.574 -
   5.575 -#
   5.576 -# Wireless LAN (non-hamradio)
   5.577 -#
   5.578 -# CONFIG_NET_RADIO is not set
   5.579 -
   5.580 -#
   5.581 -# Token Ring devices
   5.582 -#
   5.583 -# CONFIG_TR is not set
   5.584 -# CONFIG_NET_FC is not set
   5.585 -# CONFIG_RCPCI is not set
   5.586 -# CONFIG_SHAPER is not set
   5.587 -
   5.588 -#
   5.589 -# Wan interfaces
   5.590 -#
   5.591 -# CONFIG_WAN is not set
   5.592 -
   5.593 -#
   5.594 -# Amateur Radio support
   5.595 -#
   5.596 -# CONFIG_HAMRADIO is not set
   5.597 -
   5.598 -#
   5.599 -# IrDA (infrared) support
   5.600 -#
   5.601 -# CONFIG_IRDA is not set
   5.602 -
   5.603 -#
   5.604 -# ISDN subsystem
   5.605 -#
   5.606 -# CONFIG_ISDN is not set
   5.607 -
   5.608 -#
   5.609 -# Old CD-ROM drivers (not SCSI, not IDE)
   5.610 -#
   5.611 -# CONFIG_CD_NO_IDESCSI is not set
   5.612 -
   5.613 -#
   5.614 -# Input core support
   5.615 -#
   5.616 -# CONFIG_INPUT is not set
   5.617 -# CONFIG_INPUT_KEYBDEV is not set
   5.618 -# CONFIG_INPUT_MOUSEDEV is not set
   5.619 -# CONFIG_INPUT_JOYDEV is not set
   5.620 -# CONFIG_INPUT_EVDEV is not set
   5.621 -# CONFIG_INPUT_UINPUT is not set
   5.622 -
   5.623 -#
   5.624 -# Character devices
   5.625 -#
   5.626 -CONFIG_VT=y
   5.627 -CONFIG_VT_CONSOLE=y
   5.628 -# CONFIG_SERIAL is not set
   5.629 -# CONFIG_SERIAL_EXTENDED is not set
   5.630 -# CONFIG_SERIAL_NONSTANDARD is not set
   5.631 -CONFIG_UNIX98_PTYS=y
   5.632 -CONFIG_UNIX98_PTY_COUNT=256
   5.633 -
   5.634 -#
   5.635 -# I2C support
   5.636 -#
   5.637 -# CONFIG_I2C is not set
   5.638 -
   5.639 -#
   5.640 -# Mice
   5.641 -#
   5.642 -# CONFIG_BUSMOUSE is not set
   5.643 -CONFIG_MOUSE=y
   5.644 -CONFIG_PSMOUSE=y
   5.645 -# CONFIG_82C710_MOUSE is not set
   5.646 -# CONFIG_PC110_PAD is not set
   5.647 -# CONFIG_MK712_MOUSE is not set
   5.648 -
   5.649 -#
   5.650 -# Joysticks
   5.651 -#
   5.652 -# CONFIG_INPUT_GAMEPORT is not set
   5.653 -# CONFIG_QIC02_TAPE is not set
   5.654 -# CONFIG_IPMI_HANDLER is not set
   5.655 -# CONFIG_IPMI_PANIC_EVENT is not set
   5.656 -# CONFIG_IPMI_DEVICE_INTERFACE is not set
   5.657 -# CONFIG_IPMI_KCS is not set
   5.658 -# CONFIG_IPMI_WATCHDOG is not set
   5.659 -
   5.660 -#
   5.661 -# Watchdog Cards
   5.662 -#
   5.663 -# CONFIG_WATCHDOG is not set
   5.664 -# CONFIG_SCx200 is not set
   5.665 -# CONFIG_SCx200_GPIO is not set
   5.666 -# CONFIG_AMD_RNG is not set
   5.667 -# CONFIG_INTEL_RNG is not set
   5.668 -# CONFIG_HW_RANDOM is not set
   5.669 -# CONFIG_AMD_PM768 is not set
   5.670 -# CONFIG_NVRAM is not set
   5.671 -# CONFIG_RTC is not set
   5.672 -# CONFIG_DTLK is not set
   5.673 -# CONFIG_R3964 is not set
   5.674 -# CONFIG_APPLICOM is not set
   5.675 -# CONFIG_SONYPI is not set
   5.676 -
   5.677 -#
   5.678 -# Ftape, the floppy tape device driver
   5.679 -#
   5.680 -# CONFIG_FTAPE is not set
   5.681 -# CONFIG_AGP is not set
   5.682 -
   5.683 -#
   5.684 -# Direct Rendering Manager (XFree86 DRI support)
   5.685 -#
   5.686 -# CONFIG_DRM is not set
   5.687 -# CONFIG_MWAVE is not set
   5.688 -# CONFIG_OBMOUSE is not set
   5.689 -
   5.690 -#
   5.691 -# Multimedia devices
   5.692 -#
   5.693 -# CONFIG_VIDEO_DEV is not set
   5.694 -
   5.695 -#
   5.696 -# File systems
   5.697 -#
   5.698 -# CONFIG_QUOTA is not set
   5.699 -# CONFIG_QFMT_V2 is not set
   5.700 -CONFIG_AUTOFS_FS=y
   5.701 -CONFIG_AUTOFS4_FS=y
   5.702 -# CONFIG_REISERFS_FS is not set
   5.703 -# CONFIG_REISERFS_CHECK is not set
   5.704 -# CONFIG_REISERFS_PROC_INFO is not set
   5.705 -# CONFIG_ADFS_FS is not set
   5.706 -# CONFIG_ADFS_FS_RW is not set
   5.707 -# CONFIG_AFFS_FS is not set
   5.708 -# CONFIG_HFS_FS is not set
   5.709 -# CONFIG_HFSPLUS_FS is not set
   5.710 -# CONFIG_BEFS_FS is not set
   5.711 -# CONFIG_BEFS_DEBUG is not set
   5.712 -# CONFIG_BFS_FS is not set
   5.713 -CONFIG_EXT3_FS=y
   5.714 -CONFIG_JBD=y
   5.715 -# CONFIG_JBD_DEBUG is not set
   5.716 -CONFIG_FAT_FS=y
   5.717 -CONFIG_MSDOS_FS=y
   5.718 -CONFIG_UMSDOS_FS=y
   5.719 -CONFIG_VFAT_FS=y
   5.720 -# CONFIG_EFS_FS is not set
   5.721 -# CONFIG_JFFS_FS is not set
   5.722 -# CONFIG_JFFS2_FS is not set
   5.723 -# CONFIG_CRAMFS is not set
   5.724 -CONFIG_TMPFS=y
   5.725 -CONFIG_RAMFS=y
   5.726 -CONFIG_ISO9660_FS=y
   5.727 -CONFIG_JOLIET=y
   5.728 -CONFIG_ZISOFS=y
   5.729 -# CONFIG_JFS_FS is not set
   5.730 -# CONFIG_JFS_DEBUG is not set
   5.731 -# CONFIG_JFS_STATISTICS is not set
   5.732 -# CONFIG_MINIX_FS is not set
   5.733 -# CONFIG_VXFS_FS is not set
   5.734 -# CONFIG_NTFS_FS is not set
   5.735 -# CONFIG_NTFS_RW is not set
   5.736 -# CONFIG_HPFS_FS is not set
   5.737 -CONFIG_PROC_FS=y
   5.738 -# CONFIG_DEVFS_FS is not set
   5.739 -# CONFIG_DEVFS_MOUNT is not set
   5.740 -# CONFIG_DEVFS_DEBUG is not set
   5.741 -CONFIG_DEVPTS_FS=y
   5.742 -# CONFIG_QNX4FS_FS is not set
   5.743 -# CONFIG_QNX4FS_RW is not set
   5.744 -# CONFIG_ROMFS_FS is not set
   5.745 -CONFIG_EXT2_FS=y
   5.746 -# CONFIG_SYSV_FS is not set
   5.747 -# CONFIG_UDF_FS is not set
   5.748 -# CONFIG_UDF_RW is not set
   5.749 -# CONFIG_UFS_FS is not set
   5.750 -# CONFIG_UFS_FS_WRITE is not set
   5.751 -# CONFIG_XFS_FS is not set
   5.752 -# CONFIG_XFS_QUOTA is not set
   5.753 -# CONFIG_XFS_RT is not set
   5.754 -# CONFIG_XFS_TRACE is not set
   5.755 -# CONFIG_XFS_DEBUG is not set
   5.756 -
   5.757 -#
   5.758 -# Network File Systems
   5.759 -#
   5.760 -# CONFIG_CODA_FS is not set
   5.761 -# CONFIG_INTERMEZZO_FS is not set
   5.762 -CONFIG_NFS_FS=y
   5.763 -CONFIG_NFS_V3=y
   5.764 -# CONFIG_NFS_DIRECTIO is not set
   5.765 -CONFIG_ROOT_NFS=y
   5.766 -CONFIG_NFSD=y
   5.767 -CONFIG_NFSD_V3=y
   5.768 -# CONFIG_NFSD_TCP is not set
   5.769 -CONFIG_SUNRPC=y
   5.770 -CONFIG_LOCKD=y
   5.771 -CONFIG_LOCKD_V4=y
   5.772 -# CONFIG_SMB_FS is not set
   5.773 -# CONFIG_NCP_FS is not set
   5.774 -# CONFIG_NCPFS_PACKET_SIGNING is not set
   5.775 -# CONFIG_NCPFS_IOCTL_LOCKING is not set
   5.776 -# CONFIG_NCPFS_STRONG is not set
   5.777 -# CONFIG_NCPFS_NFS_NS is not set
   5.778 -# CONFIG_NCPFS_OS2_NS is not set
   5.779 -# CONFIG_NCPFS_SMALLDOS is not set
   5.780 -# CONFIG_NCPFS_NLS is not set
   5.781 -# CONFIG_NCPFS_EXTRAS is not set
   5.782 -CONFIG_ZISOFS_FS=y
   5.783 -
   5.784 -#
   5.785 -# Partition Types
   5.786 -#
   5.787 -CONFIG_PARTITION_ADVANCED=y
   5.788 -# CONFIG_ACORN_PARTITION is not set
   5.789 -# CONFIG_OSF_PARTITION is not set
   5.790 -# CONFIG_AMIGA_PARTITION is not set
   5.791 -# CONFIG_ATARI_PARTITION is not set
   5.792 -# CONFIG_MAC_PARTITION is not set
   5.793 -CONFIG_MSDOS_PARTITION=y
   5.794 -# CONFIG_BSD_DISKLABEL is not set
   5.795 -# CONFIG_MINIX_SUBPARTITION is not set
   5.796 -# CONFIG_SOLARIS_X86_PARTITION is not set
   5.797 -# CONFIG_UNIXWARE_DISKLABEL is not set
   5.798 -# CONFIG_LDM_PARTITION is not set
   5.799 -# CONFIG_SGI_PARTITION is not set
   5.800 -# CONFIG_ULTRIX_PARTITION is not set
   5.801 -# CONFIG_SUN_PARTITION is not set
   5.802 -# CONFIG_EFI_PARTITION is not set
   5.803 -# CONFIG_SMB_NLS is not set
   5.804 -CONFIG_NLS=y
   5.805 -
   5.806 -#
   5.807 -# Native Language Support
   5.808 -#
   5.809 -CONFIG_NLS_DEFAULT="iso8559-1"
   5.810 -# CONFIG_NLS_CODEPAGE_437 is not set
   5.811 -# CONFIG_NLS_CODEPAGE_737 is not set
   5.812 -# CONFIG_NLS_CODEPAGE_775 is not set
   5.813 -# CONFIG_NLS_CODEPAGE_850 is not set
   5.814 -# CONFIG_NLS_CODEPAGE_852 is not set
   5.815 -# CONFIG_NLS_CODEPAGE_855 is not set
   5.816 -# CONFIG_NLS_CODEPAGE_857 is not set
   5.817 -# CONFIG_NLS_CODEPAGE_860 is not set
   5.818 -# CONFIG_NLS_CODEPAGE_861 is not set
   5.819 -# CONFIG_NLS_CODEPAGE_862 is not set
   5.820 -# CONFIG_NLS_CODEPAGE_863 is not set
   5.821 -# CONFIG_NLS_CODEPAGE_864 is not set
   5.822 -# CONFIG_NLS_CODEPAGE_865 is not set
   5.823 -# CONFIG_NLS_CODEPAGE_866 is not set
   5.824 -# CONFIG_NLS_CODEPAGE_869 is not set
   5.825 -# CONFIG_NLS_CODEPAGE_936 is not set
   5.826 -# CONFIG_NLS_CODEPAGE_950 is not set
   5.827 -# CONFIG_NLS_CODEPAGE_932 is not set
   5.828 -# CONFIG_NLS_CODEPAGE_949 is not set
   5.829 -# CONFIG_NLS_CODEPAGE_874 is not set
   5.830 -# CONFIG_NLS_ISO8859_8 is not set
   5.831 -# CONFIG_NLS_CODEPAGE_1250 is not set
   5.832 -# CONFIG_NLS_CODEPAGE_1251 is not set
   5.833 -CONFIG_NLS_ISO8859_1=y
   5.834 -# CONFIG_NLS_ISO8859_2 is not set
   5.835 -# CONFIG_NLS_ISO8859_3 is not set
   5.836 -# CONFIG_NLS_ISO8859_4 is not set
   5.837 -# CONFIG_NLS_ISO8859_5 is not set
   5.838 -# CONFIG_NLS_ISO8859_6 is not set
   5.839 -# CONFIG_NLS_ISO8859_7 is not set
   5.840 -# CONFIG_NLS_ISO8859_9 is not set
   5.841 -# CONFIG_NLS_ISO8859_13 is not set
   5.842 -# CONFIG_NLS_ISO8859_14 is not set
   5.843 -# CONFIG_NLS_ISO8859_15 is not set
   5.844 -# CONFIG_NLS_KOI8_R is not set
   5.845 -# CONFIG_NLS_KOI8_U is not set
   5.846 -# CONFIG_NLS_UTF8 is not set
   5.847 -
   5.848 -#
   5.849 -# Console drivers
   5.850 -#
   5.851 -CONFIG_XEN_CONSOLE=y
   5.852 -CONFIG_VGA_CONSOLE=y
   5.853 -CONFIG_DUMMY_CONSOLE=y
   5.854 -# CONFIG_VIDEO_SELECT is not set
   5.855 -# CONFIG_MDA_CONSOLE is not set
   5.856 -
   5.857 -#
   5.858 -# Frame-buffer support
   5.859 -#
   5.860 -# CONFIG_FB is not set
   5.861 -
   5.862 -#
   5.863 -# Sound
   5.864 -#
   5.865 -# CONFIG_SOUND is not set
   5.866 -
   5.867 -#
   5.868 -# USB support
   5.869 -#
   5.870 -# CONFIG_USB is not set
   5.871 -
   5.872 -#
   5.873 -# Support for USB gadgets
   5.874 -#
   5.875 -# CONFIG_USB_GADGET is not set
   5.876 -
   5.877 -#
   5.878 -# Bluetooth support
   5.879 -#
   5.880 -# CONFIG_BLUEZ is not set
   5.881 -
   5.882 -#
   5.883 -# Kernel hacking
   5.884 -#
   5.885 -CONFIG_DEBUG_KERNEL=y
   5.886 -# CONFIG_DEBUG_STACKOVERFLOW is not set
   5.887 -# CONFIG_DEBUG_HIGHMEM is not set
   5.888 -# CONFIG_DEBUG_SLAB is not set
   5.889 -# CONFIG_DEBUG_IOVIRT is not set
   5.890 -# CONFIG_MAGIC_SYSRQ is not set
   5.891 -# CONFIG_DEBUG_SPINLOCK is not set
   5.892 -# CONFIG_DEBUG_BUGVERBOSE is not set
   5.893 -CONFIG_KALLSYMS=y
   5.894 -# CONFIG_FRAME_POINTER is not set
   5.895 -CONFIG_LOG_BUF_SHIFT=0
   5.896 -
   5.897 -#
   5.898 -# Cryptographic options
   5.899 -#
   5.900 -CONFIG_CRYPTO=y
   5.901 -CONFIG_CRYPTO_HMAC=y
   5.902 -CONFIG_CRYPTO_NULL=m
   5.903 -CONFIG_CRYPTO_MD4=m
   5.904 -CONFIG_CRYPTO_MD5=m
   5.905 -CONFIG_CRYPTO_SHA1=m
   5.906 -CONFIG_CRYPTO_SHA256=m
   5.907 -CONFIG_CRYPTO_SHA512=m
   5.908 -# CONFIG_CRYPTO_WP512 is not set
   5.909 -CONFIG_CRYPTO_DES=m
   5.910 -CONFIG_CRYPTO_BLOWFISH=m
   5.911 -CONFIG_CRYPTO_TWOFISH=m
   5.912 -CONFIG_CRYPTO_SERPENT=m
   5.913 -CONFIG_CRYPTO_AES=m
   5.914 -CONFIG_CRYPTO_CAST5=m
   5.915 -CONFIG_CRYPTO_CAST6=m
   5.916 -# CONFIG_CRYPTO_TEA is not set
   5.917 -# CONFIG_CRYPTO_KHAZAD is not set
   5.918 -# CONFIG_CRYPTO_ANUBIS is not set
   5.919 -CONFIG_CRYPTO_ARC4=m
   5.920 -CONFIG_CRYPTO_DEFLATE=m
   5.921 -# CONFIG_CRYPTO_MICHAEL_MIC is not set
   5.922 -# CONFIG_CRYPTO_TEST is not set
   5.923 -
   5.924 -#
   5.925 -# Library routines
   5.926 -#
   5.927 -# CONFIG_CRC32 is not set
   5.928 -CONFIG_ZLIB_INFLATE=y
   5.929 -CONFIG_ZLIB_DEFLATE=m
   5.930 -# CONFIG_FW_LOADER is not set
     6.1 --- a/linux-2.4.30-xen-sparse/arch/xen/defconfig-xenU	Mon Jul 11 14:48:47 2005 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,562 +0,0 @@
     6.4 -#
     6.5 -# Automatically generated make config: don't edit
     6.6 -#
     6.7 -CONFIG_XEN=y
     6.8 -CONFIG_X86=y
     6.9 -CONFIG_ISA=y
    6.10 -# CONFIG_SBUS is not set
    6.11 -CONFIG_UID16=y
    6.12 -
    6.13 -#
    6.14 -# Xen
    6.15 -#
    6.16 -# CONFIG_XEN_PRIVILEGED_GUEST is not set
    6.17 -# CONFIG_XEN_PHYSDEV_ACCESS is not set
    6.18 -CONFIG_XEN_SCRUB_PAGES=y
    6.19 -CONFIG_XEN_NETDEV_FRONTEND=y
    6.20 -CONFIG_XEN_BLKDEV_FRONTEND=y
    6.21 -CONFIG_XEN_BLKDEV_GRANT=y
    6.22 -# CONFIG_XEN_USB_FRONTEND is not set
    6.23 -CONFIG_NO_IDLE_HZ=y
    6.24 -# CONFIG_FOREIGN_PAGES is not set
    6.25 -CONFIG_NETDEVICES=y
    6.26 -# CONFIG_VT is not set
    6.27 -
    6.28 -#
    6.29 -# Code maturity level options
    6.30 -#
    6.31 -CONFIG_EXPERIMENTAL=y
    6.32 -
    6.33 -#
    6.34 -# Loadable module support
    6.35 -#
    6.36 -CONFIG_MODULES=y
    6.37 -CONFIG_MODVERSIONS=y
    6.38 -CONFIG_KMOD=y
    6.39 -
    6.40 -#
    6.41 -# Processor type and features
    6.42 -#
    6.43 -CONFIG_M686=y
    6.44 -# CONFIG_MPENTIUMIII is not set
    6.45 -# CONFIG_MPENTIUM4 is not set
    6.46 -# CONFIG_MK7 is not set
    6.47 -# CONFIG_MK8 is not set
    6.48 -# CONFIG_MVIAC3_2 is not set
    6.49 -CONFIG_X86_WP_WORKS_OK=y
    6.50 -CONFIG_X86_INVLPG=y
    6.51 -CONFIG_X86_CMPXCHG=y
    6.52 -CONFIG_X86_XADD=y
    6.53 -CONFIG_X86_BSWAP=y
    6.54 -CONFIG_X86_POPAD_OK=y
    6.55 -# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
    6.56 -CONFIG_RWSEM_XCHGADD_ALGORITHM=y
    6.57 -CONFIG_X86_GOOD_APIC=y
    6.58 -CONFIG_X86_PGE=y
    6.59 -CONFIG_X86_USE_PPRO_CHECKSUM=y
    6.60 -CONFIG_X86_TSC=y
    6.61 -CONFIG_X86_L1_CACHE_SHIFT=5
    6.62 -CONFIG_NOHIGHMEM=y
    6.63 -# CONFIG_HIGHMEM4G is not set
    6.64 -CONFIG_FORCE_MAX_ZONEORDER=11
    6.65 -
    6.66 -#
    6.67 -# General setup
    6.68 -#
    6.69 -CONFIG_NET=y
    6.70 -CONFIG_SYSVIPC=y
    6.71 -# CONFIG_BSD_PROCESS_ACCT is not set
    6.72 -CONFIG_SYSCTL=y
    6.73 -CONFIG_KCORE_ELF=y
    6.74 -# CONFIG_KCORE_AOUT is not set
    6.75 -CONFIG_BINFMT_AOUT=y
    6.76 -CONFIG_BINFMT_ELF=y
    6.77 -# CONFIG_BINFMT_MISC is not set
    6.78 -# CONFIG_OOM_KILLER is not set
    6.79 -
    6.80 -#
    6.81 -# Networking options
    6.82 -#
    6.83 -CONFIG_PACKET=y
    6.84 -CONFIG_PACKET_MMAP=y
    6.85 -# CONFIG_NETLINK_DEV is not set
    6.86 -CONFIG_NETFILTER=y
    6.87 -# CONFIG_NETFILTER_DEBUG is not set
    6.88 -CONFIG_FILTER=y
    6.89 -CONFIG_UNIX=y
    6.90 -CONFIG_INET=y
    6.91 -# CONFIG_IP_MULTICAST is not set
    6.92 -# CONFIG_IP_ADVANCED_ROUTER is not set
    6.93 -CONFIG_IP_PNP=y
    6.94 -CONFIG_IP_PNP_DHCP=y
    6.95 -# CONFIG_IP_PNP_BOOTP is not set
    6.96 -# CONFIG_IP_PNP_RARP is not set
    6.97 -# CONFIG_NET_IPIP is not set
    6.98 -# CONFIG_NET_IPGRE is not set
    6.99 -# CONFIG_ARPD is not set
   6.100 -# CONFIG_INET_ECN is not set
   6.101 -# CONFIG_SYN_COOKIES is not set
   6.102 -
   6.103 -#
   6.104 -#   IP: Netfilter Configuration
   6.105 -#
   6.106 -CONFIG_IP_NF_CONNTRACK=y
   6.107 -CONFIG_IP_NF_FTP=y
   6.108 -# CONFIG_IP_NF_AMANDA is not set
   6.109 -CONFIG_IP_NF_TFTP=y
   6.110 -CONFIG_IP_NF_IRC=y
   6.111 -# CONFIG_IP_NF_QUEUE is not set
   6.112 -CONFIG_IP_NF_IPTABLES=y
   6.113 -# CONFIG_IP_NF_MATCH_LIMIT is not set
   6.114 -# CONFIG_IP_NF_MATCH_MAC is not set
   6.115 -# CONFIG_IP_NF_MATCH_PKTTYPE is not set
   6.116 -# CONFIG_IP_NF_MATCH_MARK is not set
   6.117 -# CONFIG_IP_NF_MATCH_MULTIPORT is not set
   6.118 -# CONFIG_IP_NF_MATCH_TOS is not set
   6.119 -# CONFIG_IP_NF_MATCH_RECENT is not set
   6.120 -# CONFIG_IP_NF_MATCH_ECN is not set
   6.121 -# CONFIG_IP_NF_MATCH_DSCP is not set
   6.122 -# CONFIG_IP_NF_MATCH_AH_ESP is not set
   6.123 -# CONFIG_IP_NF_MATCH_LENGTH is not set
   6.124 -# CONFIG_IP_NF_MATCH_TTL is not set
   6.125 -# CONFIG_IP_NF_MATCH_TCPMSS is not set
   6.126 -# CONFIG_IP_NF_MATCH_HELPER is not set
   6.127 -CONFIG_IP_NF_MATCH_STATE=y
   6.128 -CONFIG_IP_NF_MATCH_CONNTRACK=y
   6.129 -# CONFIG_IP_NF_MATCH_UNCLEAN is not set
   6.130 -# CONFIG_IP_NF_MATCH_OWNER is not set
   6.131 -CONFIG_IP_NF_FILTER=y
   6.132 -CONFIG_IP_NF_TARGET_REJECT=y
   6.133 -# CONFIG_IP_NF_TARGET_MIRROR is not set
   6.134 -CONFIG_IP_NF_NAT=y
   6.135 -CONFIG_IP_NF_NAT_NEEDED=y
   6.136 -CONFIG_IP_NF_TARGET_MASQUERADE=y
   6.137 -CONFIG_IP_NF_TARGET_REDIRECT=y
   6.138 -# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
   6.139 -CONFIG_IP_NF_NAT_IRC=y
   6.140 -CONFIG_IP_NF_NAT_FTP=y
   6.141 -CONFIG_IP_NF_NAT_TFTP=y
   6.142 -# CONFIG_IP_NF_MANGLE is not set
   6.143 -CONFIG_IP_NF_TARGET_LOG=y
   6.144 -CONFIG_IP_NF_TARGET_ULOG=y
   6.145 -# CONFIG_IP_NF_TARGET_TCPMSS is not set
   6.146 -# CONFIG_IP_NF_ARPTABLES is not set
   6.147 -
   6.148 -#
   6.149 -#   IP: Virtual Server Configuration
   6.150 -#
   6.151 -# CONFIG_IP_VS is not set
   6.152 -# CONFIG_IPV6 is not set
   6.153 -# CONFIG_KHTTPD is not set
   6.154 -
   6.155 -#
   6.156 -#    SCTP Configuration (EXPERIMENTAL)
   6.157 -#
   6.158 -# CONFIG_IP_SCTP is not set
   6.159 -# CONFIG_ATM is not set
   6.160 -CONFIG_VLAN_8021Q=y
   6.161 -
   6.162 -#
   6.163 -#  
   6.164 -#
   6.165 -# CONFIG_IPX is not set
   6.166 -# CONFIG_ATALK is not set
   6.167 -# CONFIG_DECNET is not set
   6.168 -# CONFIG_BRIDGE is not set
   6.169 -# CONFIG_X25 is not set
   6.170 -# CONFIG_LAPB is not set
   6.171 -# CONFIG_LLC is not set
   6.172 -# CONFIG_NET_DIVERT is not set
   6.173 -# CONFIG_ECONET is not set
   6.174 -# CONFIG_WAN_ROUTER is not set
   6.175 -# CONFIG_NET_FASTROUTE is not set
   6.176 -# CONFIG_NET_HW_FLOWCONTROL is not set
   6.177 -
   6.178 -#
   6.179 -# QoS and/or fair queueing
   6.180 -#
   6.181 -# CONFIG_NET_SCHED is not set
   6.182 -
   6.183 -#
   6.184 -# Network testing
   6.185 -#
   6.186 -# CONFIG_NET_PKTGEN is not set
   6.187 -
   6.188 -#
   6.189 -# SCSI support
   6.190 -#
   6.191 -CONFIG_SCSI=y
   6.192 -
   6.193 -#
   6.194 -# SCSI support type (disk, tape, CD-ROM)
   6.195 -#
   6.196 -CONFIG_BLK_DEV_SD=y
   6.197 -CONFIG_SD_EXTRA_DEVS=40
   6.198 -# CONFIG_CHR_DEV_ST is not set
   6.199 -# CONFIG_CHR_DEV_OSST is not set
   6.200 -# CONFIG_BLK_DEV_SR is not set
   6.201 -CONFIG_CHR_DEV_SG=y
   6.202 -
   6.203 -#
   6.204 -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
   6.205 -#
   6.206 -# CONFIG_SCSI_DEBUG_QUEUES is not set
   6.207 -# CONFIG_SCSI_MULTI_LUN is not set
   6.208 -# CONFIG_SCSI_CONSTANTS is not set
   6.209 -# CONFIG_SCSI_LOGGING is not set
   6.210 -
   6.211 -#
   6.212 -# SCSI low-level drivers
   6.213 -#
   6.214 -# CONFIG_SCSI_7000FASST is not set
   6.215 -# CONFIG_SCSI_ACARD is not set
   6.216 -# CONFIG_SCSI_AHA152X is not set
   6.217 -# CONFIG_SCSI_AHA1542 is not set
   6.218 -# CONFIG_SCSI_AHA1740 is not set
   6.219 -# CONFIG_SCSI_AACRAID is not set
   6.220 -# CONFIG_SCSI_AIC7XXX is not set
   6.221 -# CONFIG_SCSI_AIC79XX is not set
   6.222 -# CONFIG_SCSI_AIC7XXX_OLD is not set
   6.223 -# CONFIG_SCSI_DPT_I2O is not set
   6.224 -# CONFIG_SCSI_ADVANSYS is not set
   6.225 -# CONFIG_SCSI_IN2000 is not set
   6.226 -# CONFIG_SCSI_AM53C974 is not set
   6.227 -# CONFIG_SCSI_MEGARAID is not set
   6.228 -# CONFIG_SCSI_MEGARAID2 is not set
   6.229 -# CONFIG_SCSI_SATA is not set
   6.230 -# CONFIG_SCSI_SATA_AHCI is not set
   6.231 -# CONFIG_SCSI_SATA_SVW is not set
   6.232 -# CONFIG_SCSI_ATA_PIIX is not set
   6.233 -# CONFIG_SCSI_SATA_NV is not set
   6.234 -# CONFIG_SCSI_SATA_QSTOR is not set
   6.235 -# CONFIG_SCSI_SATA_PROMISE is not set
   6.236 -# CONFIG_SCSI_SATA_SX4 is not set
   6.237 -# CONFIG_SCSI_SATA_SIL is not set
   6.238 -# CONFIG_SCSI_SATA_SIS is not set
   6.239 -# CONFIG_SCSI_SATA_ULI is not set
   6.240 -# CONFIG_SCSI_SATA_VIA is not set
   6.241 -# CONFIG_SCSI_SATA_VITESSE is not set
   6.242 -# CONFIG_SCSI_BUSLOGIC is not set
   6.243 -# CONFIG_SCSI_DMX3191D is not set
   6.244 -# CONFIG_SCSI_DTC3280 is not set
   6.245 -# CONFIG_SCSI_EATA is not set
   6.246 -# CONFIG_SCSI_EATA_DMA is not set
   6.247 -# CONFIG_SCSI_EATA_PIO is not set
   6.248 -# CONFIG_SCSI_FUTURE_DOMAIN is not set
   6.249 -# CONFIG_SCSI_GDTH is not set
   6.250 -# CONFIG_SCSI_GENERIC_NCR5380 is not set
   6.251 -# CONFIG_SCSI_IPS is not set
   6.252 -# CONFIG_SCSI_INITIO is not set
   6.253 -# CONFIG_SCSI_INIA100 is not set
   6.254 -# CONFIG_SCSI_PPA is not set
   6.255 -# CONFIG_SCSI_IMM is not set
   6.256 -# CONFIG_SCSI_NCR53C406A is not set
   6.257 -# CONFIG_SCSI_NCR53C7xx is not set
   6.258 -# CONFIG_SCSI_PAS16 is not set
   6.259 -# CONFIG_SCSI_PCI2000 is not set
   6.260 -# CONFIG_SCSI_PCI2220I is not set
   6.261 -# CONFIG_SCSI_PSI240I is not set
   6.262 -# CONFIG_SCSI_QLOGIC_FAS is not set
   6.263 -# CONFIG_SCSI_SEAGATE is not set
   6.264 -# CONFIG_SCSI_SIM710 is not set
   6.265 -# CONFIG_SCSI_SYM53C416 is not set
   6.266 -# CONFIG_SCSI_T128 is not set
   6.267 -# CONFIG_SCSI_U14_34F is not set
   6.268 -# CONFIG_SCSI_ULTRASTOR is not set
   6.269 -# CONFIG_SCSI_NSP32 is not set
   6.270 -# CONFIG_SCSI_DEBUG is not set
   6.271 -
   6.272 -#
   6.273 -# Block devices
   6.274 -#
   6.275 -CONFIG_BLK_DEV_LOOP=y
   6.276 -CONFIG_BLK_DEV_NBD=y
   6.277 -CONFIG_BLK_DEV_RAM=y
   6.278 -CONFIG_BLK_DEV_RAM_SIZE=4096
   6.279 -CONFIG_BLK_DEV_INITRD=y
   6.280 -# CONFIG_BLK_STATS is not set
   6.281 -# CONFIG_BLK_DEV_HD is not set
   6.282 -
   6.283 -#
   6.284 -# Character devices
   6.285 -#
   6.286 -# CONFIG_VT is not set
   6.287 -# CONFIG_SERIAL is not set
   6.288 -# CONFIG_SERIAL_EXTENDED is not set
   6.289 -# CONFIG_SERIAL_NONSTANDARD is not set
   6.290 -CONFIG_UNIX98_PTYS=y
   6.291 -CONFIG_UNIX98_PTY_COUNT=256
   6.292 -# CONFIG_PRINTER is not set
   6.293 -# CONFIG_PPDEV is not set
   6.294 -# CONFIG_TIPAR is not set
   6.295 -
   6.296 -#
   6.297 -# I2C support
   6.298 -#
   6.299 -# CONFIG_I2C is not set
   6.300 -
   6.301 -#
   6.302 -# Mice
   6.303 -#
   6.304 -# CONFIG_BUSMOUSE is not set
   6.305 -CONFIG_MOUSE=y
   6.306 -CONFIG_PSMOUSE=y
   6.307 -# CONFIG_82C710_MOUSE is not set
   6.308 -# CONFIG_PC110_PAD is not set
   6.309 -# CONFIG_MK712_MOUSE is not set
   6.310 -
   6.311 -#
   6.312 -# Joysticks
   6.313 -#
   6.314 -# CONFIG_INPUT_GAMEPORT is not set
   6.315 -# CONFIG_INPUT_NS558 is not set
   6.316 -# CONFIG_INPUT_LIGHTNING is not set
   6.317 -# CONFIG_INPUT_PCIGAME is not set
   6.318 -# CONFIG_INPUT_CS461X is not set
   6.319 -# CONFIG_INPUT_EMU10K1 is not set
   6.320 -# CONFIG_INPUT_SERIO is not set
   6.321 -# CONFIG_INPUT_SERPORT is not set
   6.322 -
   6.323 -#
   6.324 -# Joysticks
   6.325 -#
   6.326 -# CONFIG_INPUT_ANALOG is not set
   6.327 -# CONFIG_INPUT_A3D is not set
   6.328 -# CONFIG_INPUT_ADI is not set
   6.329 -# CONFIG_INPUT_COBRA is not set
   6.330 -# CONFIG_INPUT_GF2K is not set
   6.331 -# CONFIG_INPUT_GRIP is not set
   6.332 -# CONFIG_INPUT_INTERACT is not set
   6.333 -# CONFIG_INPUT_TMDC is not set
   6.334 -# CONFIG_INPUT_SIDEWINDER is not set
   6.335 -# CONFIG_INPUT_IFORCE_USB is not set
   6.336 -# CONFIG_INPUT_IFORCE_232 is not set
   6.337 -# CONFIG_INPUT_WARRIOR is not set
   6.338 -# CONFIG_INPUT_MAGELLAN is not set
   6.339 -# CONFIG_INPUT_SPACEORB is not set
   6.340 -# CONFIG_INPUT_SPACEBALL is not set
   6.341 -# CONFIG_INPUT_STINGER is not set
   6.342 -# CONFIG_INPUT_DB9 is not set
   6.343 -# CONFIG_INPUT_GAMECON is not set
   6.344 -# CONFIG_INPUT_TURBOGRAFX is not set
   6.345 -# CONFIG_QIC02_TAPE is not set
   6.346 -# CONFIG_IPMI_HANDLER is not set
   6.347 -# CONFIG_IPMI_PANIC_EVENT is not set
   6.348 -# CONFIG_IPMI_DEVICE_INTERFACE is not set
   6.349 -# CONFIG_IPMI_KCS is not set
   6.350 -# CONFIG_IPMI_WATCHDOG is not set
   6.351 -
   6.352 -#
   6.353 -# Watchdog Cards
   6.354 -#
   6.355 -# CONFIG_WATCHDOG is not set
   6.356 -# CONFIG_SCx200 is not set
   6.357 -# CONFIG_SCx200_GPIO is not set
   6.358 -# CONFIG_AMD_RNG is not set
   6.359 -# CONFIG_INTEL_RNG is not set
   6.360 -# CONFIG_HW_RANDOM is not set
   6.361 -# CONFIG_AMD_PM768 is not set
   6.362 -# CONFIG_NVRAM is not set
   6.363 -# CONFIG_RTC is not set
   6.364 -# CONFIG_DTLK is not set
   6.365 -# CONFIG_R3964 is not set
   6.366 -# CONFIG_APPLICOM is not set
   6.367 -# CONFIG_SONYPI is not set
   6.368 -
   6.369 -#
   6.370 -# Ftape, the floppy tape device driver
   6.371 -#
   6.372 -# CONFIG_FTAPE is not set
   6.373 -# CONFIG_AGP is not set
   6.374 -
   6.375 -#
   6.376 -# Direct Rendering Manager (XFree86 DRI support)
   6.377 -#
   6.378 -# CONFIG_DRM is not set
   6.379 -# CONFIG_MWAVE is not set
   6.380 -# CONFIG_OBMOUSE is not set
   6.381 -
   6.382 -#
   6.383 -# File systems
   6.384 -#
   6.385 -# CONFIG_QUOTA is not set
   6.386 -# CONFIG_QFMT_V2 is not set
   6.387 -CONFIG_AUTOFS_FS=y
   6.388 -CONFIG_AUTOFS4_FS=y
   6.389 -# CONFIG_REISERFS_FS is not set
   6.390 -# CONFIG_REISERFS_CHECK is not set
   6.391 -# CONFIG_REISERFS_PROC_INFO is not set
   6.392 -# CONFIG_ADFS_FS is not set
   6.393 -# CONFIG_ADFS_FS_RW is not set
   6.394 -# CONFIG_AFFS_FS is not set
   6.395 -# CONFIG_HFS_FS is not set
   6.396 -# CONFIG_HFSPLUS_FS is not set
   6.397 -# CONFIG_BEFS_FS is not set
   6.398 -# CONFIG_BEFS_DEBUG is not set
   6.399 -# CONFIG_BFS_FS is not set
   6.400 -CONFIG_EXT3_FS=y
   6.401 -CONFIG_JBD=y
   6.402 -# CONFIG_JBD_DEBUG is not set
   6.403 -CONFIG_FAT_FS=y
   6.404 -CONFIG_MSDOS_FS=y
   6.405 -CONFIG_UMSDOS_FS=y
   6.406 -CONFIG_VFAT_FS=y
   6.407 -# CONFIG_EFS_FS is not set
   6.408 -# CONFIG_JFFS_FS is not set
   6.409 -# CONFIG_JFFS2_FS is not set
   6.410 -# CONFIG_CRAMFS is not set
   6.411 -CONFIG_TMPFS=y
   6.412 -CONFIG_RAMFS=y
   6.413 -CONFIG_ISO9660_FS=y
   6.414 -CONFIG_JOLIET=y
   6.415 -CONFIG_ZISOFS=y
   6.416 -# CONFIG_JFS_FS is not set
   6.417 -# CONFIG_JFS_DEBUG is not set
   6.418 -# CONFIG_JFS_STATISTICS is not set
   6.419 -# CONFIG_MINIX_FS is not set
   6.420 -# CONFIG_VXFS_FS is not set
   6.421 -# CONFIG_NTFS_FS is not set
   6.422 -# CONFIG_NTFS_RW is not set
   6.423 -# CONFIG_HPFS_FS is not set
   6.424 -CONFIG_PROC_FS=y
   6.425 -# CONFIG_DEVFS_FS is not set
   6.426 -# CONFIG_DEVFS_MOUNT is not set
   6.427 -# CONFIG_DEVFS_DEBUG is not set
   6.428 -CONFIG_DEVPTS_FS=y
   6.429 -# CONFIG_QNX4FS_FS is not set
   6.430 -# CONFIG_QNX4FS_RW is not set
   6.431 -# CONFIG_ROMFS_FS is not set
   6.432 -CONFIG_EXT2_FS=y
   6.433 -# CONFIG_SYSV_FS is not set
   6.434 -# CONFIG_UDF_FS is not set
   6.435 -# CONFIG_UDF_RW is not set
   6.436 -# CONFIG_UFS_FS is not set
   6.437 -# CONFIG_UFS_FS_WRITE is not set
   6.438 -# CONFIG_XFS_FS is not set
   6.439 -# CONFIG_XFS_QUOTA is not set
   6.440 -# CONFIG_XFS_RT is not set
   6.441 -# CONFIG_XFS_TRACE is not set
   6.442 -# CONFIG_XFS_DEBUG is not set
   6.443 -
   6.444 -#
   6.445 -# Network File Systems
   6.446 -#
   6.447 -# CONFIG_CODA_FS is not set
   6.448 -# CONFIG_INTERMEZZO_FS is not set
   6.449 -CONFIG_NFS_FS=y
   6.450 -CONFIG_NFS_V3=y
   6.451 -# CONFIG_NFS_DIRECTIO is not set
   6.452 -CONFIG_ROOT_NFS=y
   6.453 -CONFIG_NFSD=y
   6.454 -CONFIG_NFSD_V3=y
   6.455 -# CONFIG_NFSD_TCP is not set
   6.456 -CONFIG_SUNRPC=y
   6.457 -CONFIG_LOCKD=y
   6.458 -CONFIG_LOCKD_V4=y
   6.459 -# CONFIG_SMB_FS is not set
   6.460 -# CONFIG_NCP_FS is not set
   6.461 -# CONFIG_NCPFS_PACKET_SIGNING is not set
   6.462 -# CONFIG_NCPFS_IOCTL_LOCKING is not set
   6.463 -# CONFIG_NCPFS_STRONG is not set
   6.464 -# CONFIG_NCPFS_NFS_NS is not set
   6.465 -# CONFIG_NCPFS_OS2_NS is not set
   6.466 -# CONFIG_NCPFS_SMALLDOS is not set
   6.467 -# CONFIG_NCPFS_NLS is not set
   6.468 -# CONFIG_NCPFS_EXTRAS is not set
   6.469 -CONFIG_ZISOFS_FS=y
   6.470 -
   6.471 -#
   6.472 -# Partition Types
   6.473 -#
   6.474 -CONFIG_PARTITION_ADVANCED=y
   6.475 -# CONFIG_ACORN_PARTITION is not set
   6.476 -# CONFIG_OSF_PARTITION is not set
   6.477 -# CONFIG_AMIGA_PARTITION is not set
   6.478 -# CONFIG_ATARI_PARTITION is not set
   6.479 -# CONFIG_MAC_PARTITION is not set
   6.480 -CONFIG_MSDOS_PARTITION=y
   6.481 -# CONFIG_BSD_DISKLABEL is not set
   6.482 -# CONFIG_MINIX_SUBPARTITION is not set
   6.483 -# CONFIG_SOLARIS_X86_PARTITION is not set
   6.484 -# CONFIG_UNIXWARE_DISKLABEL is not set
   6.485 -# CONFIG_LDM_PARTITION is not set
   6.486 -# CONFIG_SGI_PARTITION is not set
   6.487 -# CONFIG_ULTRIX_PARTITION is not set
   6.488 -# CONFIG_SUN_PARTITION is not set
   6.489 -# CONFIG_EFI_PARTITION is not set
   6.490 -# CONFIG_SMB_NLS is not set
   6.491 -CONFIG_NLS=y
   6.492 -
   6.493 -#
   6.494 -# Native Language Support
   6.495 -#
   6.496 -CONFIG_NLS_DEFAULT="iso8559-1"
   6.497 -# CONFIG_NLS_CODEPAGE_437 is not set
   6.498 -# CONFIG_NLS_CODEPAGE_737 is not set
   6.499 -# CONFIG_NLS_CODEPAGE_775 is not set
   6.500 -# CONFIG_NLS_CODEPAGE_850 is not set
   6.501 -# CONFIG_NLS_CODEPAGE_852 is not set
   6.502 -# CONFIG_NLS_CODEPAGE_855 is not set
   6.503 -# CONFIG_NLS_CODEPAGE_857 is not set
   6.504 -# CONFIG_NLS_CODEPAGE_860 is not set
   6.505 -# CONFIG_NLS_CODEPAGE_861 is not set
   6.506 -# CONFIG_NLS_CODEPAGE_862 is not set
   6.507 -# CONFIG_NLS_CODEPAGE_863 is not set
   6.508 -# CONFIG_NLS_CODEPAGE_864 is not set
   6.509 -# CONFIG_NLS_CODEPAGE_865 is not set
   6.510 -# CONFIG_NLS_CODEPAGE_866 is not set
   6.511 -# CONFIG_NLS_CODEPAGE_869 is not set
   6.512 -# CONFIG_NLS_CODEPAGE_936 is not set
   6.513 -# CONFIG_NLS_CODEPAGE_950 is not set
   6.514 -# CONFIG_NLS_CODEPAGE_932 is not set
   6.515 -# CONFIG_NLS_CODEPAGE_949 is not set
   6.516 -# CONFIG_NLS_CODEPAGE_874 is not set
   6.517 -# CONFIG_NLS_ISO8859_8 is not set
   6.518 -# CONFIG_NLS_CODEPAGE_1250 is not set
   6.519 -# CONFIG_NLS_CODEPAGE_1251 is not set
   6.520 -CONFIG_NLS_ISO8859_1=y
   6.521 -# CONFIG_NLS_ISO8859_2 is not set
   6.522 -# CONFIG_NLS_ISO8859_3 is not set
   6.523 -# CONFIG_NLS_ISO8859_4 is not set
   6.524 -# CONFIG_NLS_ISO8859_5 is not set
   6.525 -# CONFIG_NLS_ISO8859_6 is not set
   6.526 -# CONFIG_NLS_ISO8859_7 is not set
   6.527 -# CONFIG_NLS_ISO8859_9 is not set
   6.528 -# CONFIG_NLS_ISO8859_13 is not set
   6.529 -# CONFIG_NLS_ISO8859_14 is not set
   6.530 -# CONFIG_NLS_ISO8859_15 is not set
   6.531 -# CONFIG_NLS_KOI8_R is not set
   6.532 -# CONFIG_NLS_KOI8_U is not set
   6.533 -# CONFIG_NLS_UTF8 is not set
   6.534 -
   6.535 -#
   6.536 -# Console drivers
   6.537 -#
   6.538 -CONFIG_XEN_CONSOLE=y
   6.539 -
   6.540 -#
   6.541 -# Kernel hacking
   6.542 -#
   6.543 -CONFIG_DEBUG_KERNEL=y
   6.544 -# CONFIG_DEBUG_STACKOVERFLOW is not set
   6.545 -# CONFIG_DEBUG_HIGHMEM is not set
   6.546 -# CONFIG_DEBUG_SLAB is not set
   6.547 -# CONFIG_DEBUG_IOVIRT is not set
   6.548 -# CONFIG_MAGIC_SYSRQ is not set
   6.549 -# CONFIG_DEBUG_SPINLOCK is not set
   6.550 -# CONFIG_DEBUG_BUGVERBOSE is not set
   6.551 -CONFIG_KALLSYMS=y
   6.552 -# CONFIG_FRAME_POINTER is not set
   6.553 -CONFIG_LOG_BUF_SHIFT=0
   6.554 -
   6.555 -#
   6.556 -# Cryptographic options
   6.557 -#
   6.558 -# CONFIG_CRYPTO is not set
   6.559 -
   6.560 -#
   6.561 -# Library routines
   6.562 -#
   6.563 -# CONFIG_CRC32 is not set
   6.564 -CONFIG_ZLIB_INFLATE=y
   6.565 -# CONFIG_ZLIB_DEFLATE is not set
     7.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/balloon/Makefile	Mon Jul 11 14:48:47 2005 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,4 +0,0 @@
     7.4 -O_TARGET := drv.o
     7.5 -export-objs := balloon.o
     7.6 -obj-y := balloon.o
     7.7 -include $(TOPDIR)/Rules.make
     8.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/blkif/Makefile	Mon Jul 11 14:48:47 2005 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,10 +0,0 @@
     8.4 -
     8.5 -O_TARGET := drv.o
     8.6 -
     8.7 -subdir-$(CONFIG_XEN_BLKDEV_FRONTEND) += frontend
     8.8 -obj-$(CONFIG_XEN_BLKDEV_FRONTEND)    += frontend/drv.o
     8.9 -
    8.10 -subdir-$(CONFIG_XEN_PHYSDEV_ACCESS) += backend
    8.11 -obj-$(CONFIG_XEN_PHYSDEV_ACCESS)    += backend/drv.o
    8.12 -
    8.13 -include $(TOPDIR)/Rules.make
     9.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/blkif/backend/Makefile	Mon Jul 11 14:48:47 2005 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,3 +0,0 @@
     9.4 -O_TARGET := drv.o
     9.5 -obj-y := main.o control.o interface.o vbd.o
     9.6 -include $(TOPDIR)/Rules.make
    10.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/blkif/frontend/Makefile	Mon Jul 11 14:48:47 2005 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,3 +0,0 @@
    10.4 -O_TARGET := drv.o
    10.5 -obj-y := blkfront.o vbd.o
    10.6 -include $(TOPDIR)/Rules.make
    11.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/blkif/frontend/common.h	Mon Jul 11 14:48:47 2005 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,93 +0,0 @@
    11.4 -/******************************************************************************
    11.5 - * arch/xen/drivers/blkif/frontend/common.h
    11.6 - * 
    11.7 - * Shared definitions between all levels of XenoLinux Virtual block devices.
    11.8 - */
    11.9 -
   11.10 -#ifndef __XEN_DRIVERS_COMMON_H__
   11.11 -#define __XEN_DRIVERS_COMMON_H__
   11.12 -
   11.13 -#include <linux/config.h>
   11.14 -#include <linux/module.h>
   11.15 -#include <linux/kernel.h>
   11.16 -#include <linux/sched.h>
   11.17 -#include <linux/slab.h>
   11.18 -#include <linux/string.h>
   11.19 -#include <linux/errno.h>
   11.20 -#include <linux/fs.h>
   11.21 -#include <linux/hdreg.h>
   11.22 -#include <linux/blkdev.h>
   11.23 -#include <linux/major.h>
   11.24 -#include <asm-xen/xen-public/xen.h>
   11.25 -#include <asm/io.h>
   11.26 -#include <asm/atomic.h>
   11.27 -#include <asm/uaccess.h>
   11.28 -#include <asm-xen/xen-public/io/blkif.h>
   11.29 -
   11.30 -#if 1
   11.31 -#define IPRINTK(fmt, args...) \
   11.32 -    printk(KERN_INFO "xen_blk: " fmt, ##args)
   11.33 -#else
   11.34 -#define IPRINTK(fmt, args...) ((void)0)
   11.35 -#endif
   11.36 -
   11.37 -#if 1
   11.38 -#define WPRINTK(fmt, args...) \
   11.39 -    printk(KERN_WARNING "xen_blk: " fmt, ##args)
   11.40 -#else
   11.41 -#define WPRINTK(fmt, args...) ((void)0)
   11.42 -#endif
   11.43 -
   11.44 -#if 0
   11.45 -#define DPRINTK(_f, _a...) printk ( KERN_ALERT _f , ## _a )
   11.46 -#else
   11.47 -#define DPRINTK(_f, _a...) ((void)0)
   11.48 -#endif
   11.49 -
   11.50 -#if 0
   11.51 -#define DPRINTK_IOCTL(_f, _a...) printk ( KERN_ALERT _f , ## _a )
   11.52 -#else
   11.53 -#define DPRINTK_IOCTL(_f, _a...) ((void)0)
   11.54 -#endif
   11.55 -
   11.56 -/* Private gendisk->flags[] values. */
   11.57 -#define GENHD_FL_XEN        2 /* Is unit a Xen block device?  */
   11.58 -#define GENHD_FL_VIRT_PARTNS 4 /* Are unit partitions virtual? */
   11.59 -
   11.60 -/*
   11.61 - * We have one of these per vbd, whether ide, scsi or 'other'.
   11.62 - * They hang in an array off the gendisk structure. We may end up putting
   11.63 - * all kinds of interesting stuff here :-)
   11.64 - */
   11.65 -typedef struct xl_disk {
   11.66 -    int usage;
   11.67 -} xl_disk_t;
   11.68 -
   11.69 -extern int blkif_open(struct inode *inode, struct file *filep);
   11.70 -extern int blkif_release(struct inode *inode, struct file *filep);
   11.71 -extern int blkif_ioctl(struct inode *inode, struct file *filep,
   11.72 -                                 unsigned command, unsigned long argument);
   11.73 -extern int blkif_check(kdev_t dev);
   11.74 -extern int blkif_revalidate(kdev_t dev);
   11.75 -extern void blkif_control_send(blkif_request_t *req, blkif_response_t *rsp);
   11.76 -extern void do_blkif_request (request_queue_t *rq); 
   11.77 -
   11.78 -extern void xlvbd_update_vbds(void);
   11.79 -
   11.80 -static inline xl_disk_t *xldev_to_xldisk(kdev_t xldev)
   11.81 -{
   11.82 -    struct gendisk *gd = get_gendisk(xldev);
   11.83 -    
   11.84 -    if ( gd == NULL ) 
   11.85 -        return NULL;
   11.86 -    
   11.87 -    return (xl_disk_t *)gd->real_devices + 
   11.88 -        (MINOR(xldev) >> gd->minor_shift);
   11.89 -}
   11.90 -
   11.91 -
   11.92 -/* Virtual block-device subsystem. */
   11.93 -extern int  xlvbd_init(void);
   11.94 -extern void xlvbd_cleanup(void); 
   11.95 -
   11.96 -#endif /* __XEN_DRIVERS_COMMON_H__ */
    12.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c	Mon Jul 11 14:48:47 2005 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,540 +0,0 @@
    12.4 -/******************************************************************************
    12.5 - * arch/xen/drivers/blkif/frontend/vbd.c
    12.6 - * 
    12.7 - * Xenolinux virtual block-device driver.
    12.8 - * 
    12.9 - * Copyright (c) 2003-2004, Keir Fraser & Steve Hand
   12.10 - * Modifications by Mark A. Williamson are (c) Intel Research Cambridge
   12.11 - */
   12.12 -
   12.13 -#include "common.h"
   12.14 -#include <linux/blk.h>
   12.15 -
   12.16 -/*
   12.17 - * For convenience we distinguish between ide, scsi and 'other' (i.e.
   12.18 - * potentially combinations of the two) in the naming scheme and in a few 
   12.19 - * other places (like default readahead, etc).
   12.20 - */
   12.21 -#define XLIDE_MAJOR_NAME  "hd"
   12.22 -#define XLSCSI_MAJOR_NAME "sd"
   12.23 -#define XLVBD_MAJOR_NAME "xvd"
   12.24 -
   12.25 -#define XLIDE_DEVS_PER_MAJOR   2
   12.26 -#define XLSCSI_DEVS_PER_MAJOR 16
   12.27 -#define XLVBD_DEVS_PER_MAJOR  16
   12.28 -
   12.29 -#define XLIDE_PARTN_SHIFT  6    /* amount to shift minor to get 'real' minor */
   12.30 -#define XLIDE_MAX_PART    (1 << XLIDE_PARTN_SHIFT)     /* minors per ide vbd */
   12.31 -
   12.32 -#define XLSCSI_PARTN_SHIFT 4    /* amount to shift minor to get 'real' minor */
   12.33 -#define XLSCSI_MAX_PART   (1 << XLSCSI_PARTN_SHIFT)   /* minors per scsi vbd */
   12.34 -
   12.35 -#define XLVBD_PARTN_SHIFT  4    /* amount to shift minor to get 'real' minor */
   12.36 -#define XLVBD_MAX_PART    (1 << XLVBD_PARTN_SHIFT) /* minors per 'other' vbd */
   12.37 -
   12.38 -/* The below are for the generic drivers/block/ll_rw_block.c code. */
   12.39 -static int xlide_blksize_size[256];
   12.40 -static int xlide_hardsect_size[256];
   12.41 -static int xlide_max_sectors[256];
   12.42 -static int xlscsi_blksize_size[256];
   12.43 -static int xlscsi_hardsect_size[256];
   12.44 -static int xlscsi_max_sectors[256];
   12.45 -static int xlvbd_blksize_size[256];
   12.46 -static int xlvbd_hardsect_size[256];
   12.47 -static int xlvbd_max_sectors[256];
   12.48 -
   12.49 -/* Information about our VBDs. */
   12.50 -#define MAX_VBDS 64
   12.51 -static int nr_vbds;
   12.52 -static vdisk_t *vbd_info;
   12.53 -
   12.54 -static struct block_device_operations xlvbd_block_fops = 
   12.55 -{
   12.56 -    open:               blkif_open,
   12.57 -    release:            blkif_release,
   12.58 -    ioctl:              blkif_ioctl,
   12.59 -    check_media_change: blkif_check,
   12.60 -    revalidate:         blkif_revalidate,
   12.61 -};
   12.62 -
   12.63 -static int xlvbd_get_vbd_info(vdisk_t *disk_info)
   12.64 -{
   12.65 -    vdisk_t         *buf = (vdisk_t *)__get_free_page(GFP_KERNEL);
   12.66 -    blkif_request_t  req;
   12.67 -    blkif_response_t rsp;
   12.68 -    int              nr;
   12.69 -
   12.70 -    memset(&req, 0, sizeof(req));
   12.71 -    req.operation   = BLKIF_OP_PROBE;
   12.72 -    req.nr_segments = 1;
   12.73 -#ifdef CONFIG_XEN_BLKDEV_GRANT
   12.74 -    blkif_control_probe_send(&req, &rsp,
   12.75 -                             (unsigned long)(virt_to_machine(buf)));
   12.76 -#else
   12.77 -    req.frame_and_sects[0] = virt_to_machine(buf) | 7;
   12.78 -
   12.79 -    blkif_control_send(&req, &rsp);
   12.80 -#endif
   12.81 -
   12.82 -    if ( rsp.status <= 0 )
   12.83 -    {
   12.84 -        printk(KERN_ALERT "Could not probe disks (%d)\n", rsp.status);
   12.85 -        return -1;
   12.86 -    }
   12.87 -
   12.88 -    if ( (nr = rsp.status) > MAX_VBDS )
   12.89 -         nr = MAX_VBDS;
   12.90 -    memcpy(disk_info, buf, nr * sizeof(vdisk_t));
   12.91 -
   12.92 -    return nr;
   12.93 -}
   12.94 -
   12.95 -/*
   12.96 - * xlvbd_init_device - initialise a VBD device
   12.97 - * @disk:              a vdisk_t describing the VBD
   12.98 - *
   12.99 - * Takes a vdisk_t * that describes a VBD the domain has access to.
  12.100 - * Performs appropriate initialisation and registration of the device.
  12.101 - *
  12.102 - * Care needs to be taken when making re-entrant calls to ensure that
  12.103 - * corruption does not occur.  Also, devices that are in use should not have
  12.104 - * their details updated.  This is the caller's responsibility.
  12.105 - */
  12.106 -static int xlvbd_init_device(vdisk_t *xd)
  12.107 -{
  12.108 -    int device = xd->device;
  12.109 -    int major  = MAJOR(device); 
  12.110 -    int minor  = MINOR(device);
  12.111 -    int is_ide = IDE_DISK_MAJOR(major);  /* is this an ide device? */
  12.112 -    int is_scsi= SCSI_BLK_MAJOR(major);  /* is this a scsi device? */
  12.113 -    char *major_name;
  12.114 -    struct gendisk *gd;
  12.115 -    struct block_device *bd;
  12.116 -    xl_disk_t *disk;
  12.117 -    int i, rc = 0, max_part, partno;
  12.118 -    unsigned long capacity;
  12.119 -
  12.120 -    unsigned char buf[64];
  12.121 -
  12.122 -    if ( (bd = bdget(device)) == NULL )
  12.123 -        return -1;
  12.124 -
  12.125 -    if ( ((disk = xldev_to_xldisk(device)) != NULL) && (disk->usage != 0) )
  12.126 -    {
  12.127 -        printk(KERN_ALERT "VBD update failed - in use [dev=%x]\n", device);
  12.128 -        rc = -1;
  12.129 -        goto out;
  12.130 -    }
  12.131 -
  12.132 -    if ( is_ide ) {
  12.133 -
  12.134 -	major_name = XLIDE_MAJOR_NAME; 
  12.135 -	max_part   = XLIDE_MAX_PART;
  12.136 -
  12.137 -    } else if ( is_scsi ) {
  12.138 -
  12.139 -	major_name = XLSCSI_MAJOR_NAME;
  12.140 -	max_part   = XLSCSI_MAX_PART;
  12.141 -
  12.142 -    } else { 
  12.143 -
  12.144 -        /* SMH: hmm - probably a CCISS driver or sim; assume CCISS for now */
  12.145 -	printk(KERN_ALERT "Assuming device %02x:%02x is CCISS/SCSI\n", 
  12.146 -	       major, minor);
  12.147 -	is_scsi    = 1; 
  12.148 -	major_name = "cciss"; 
  12.149 -	max_part   = XLSCSI_MAX_PART;
  12.150 -
  12.151 -    }
  12.152 -    
  12.153 -    partno = minor & (max_part - 1); 
  12.154 -    
  12.155 -    if ( (gd = get_gendisk(device)) == NULL )
  12.156 -    {
  12.157 -        rc = register_blkdev(major, major_name, &xlvbd_block_fops);
  12.158 -        if ( rc < 0 )
  12.159 -        {
  12.160 -            printk(KERN_ALERT "XL VBD: can't get major %d\n", major);
  12.161 -            goto out;
  12.162 -        }
  12.163 -
  12.164 -        if ( is_ide )
  12.165 -        { 
  12.166 -            blksize_size[major]  = xlide_blksize_size;
  12.167 -            hardsect_size[major] = xlide_hardsect_size;
  12.168 -            max_sectors[major]   = xlide_max_sectors;
  12.169 -            read_ahead[major]    = 8;
  12.170 -        } 
  12.171 -        else if ( is_scsi )
  12.172 -        { 
  12.173 -            blksize_size[major]  = xlscsi_blksize_size;
  12.174 -            hardsect_size[major] = xlscsi_hardsect_size;
  12.175 -            max_sectors[major]   = xlscsi_max_sectors;
  12.176 -            read_ahead[major]    = 8;
  12.177 -        }
  12.178 -        else
  12.179 -        { 
  12.180 -            blksize_size[major]  = xlvbd_blksize_size;
  12.181 -            hardsect_size[major] = xlvbd_hardsect_size;
  12.182 -            max_sectors[major]   = xlvbd_max_sectors;
  12.183 -            read_ahead[major]    = 8;
  12.184 -        }
  12.185 -
  12.186 -        blk_init_queue(BLK_DEFAULT_QUEUE(major), do_blkif_request);
  12.187 -
  12.188 -        /*
  12.189 -         * Turn off barking 'headactive' mode. We dequeue buffer heads as
  12.190 -         * soon as we pass them to the back-end driver.
  12.191 -         */
  12.192 -        blk_queue_headactive(BLK_DEFAULT_QUEUE(major), 0);
  12.193 -
  12.194 -        /* Construct an appropriate gendisk structure. */
  12.195 -        gd             = kmalloc(sizeof(struct gendisk), GFP_KERNEL);
  12.196 -        gd->major      = major;
  12.197 -        gd->major_name = major_name; 
  12.198 -    
  12.199 -        gd->max_p      = max_part; 
  12.200 -        if ( is_ide )
  12.201 -        { 
  12.202 -            gd->minor_shift  = XLIDE_PARTN_SHIFT; 
  12.203 -            gd->nr_real      = XLIDE_DEVS_PER_MAJOR; 
  12.204 -        } 
  12.205 -        else if ( is_scsi )
  12.206 -        { 
  12.207 -            gd->minor_shift  = XLSCSI_PARTN_SHIFT; 
  12.208 -            gd->nr_real      = XLSCSI_DEVS_PER_MAJOR; 
  12.209 -        }
  12.210 -        else
  12.211 -        { 
  12.212 -            gd->minor_shift  = XLVBD_PARTN_SHIFT; 
  12.213 -            gd->nr_real      = XLVBD_DEVS_PER_MAJOR; 
  12.214 -        }
  12.215 -
  12.216 -        /* 
  12.217 -        ** The sizes[] and part[] arrays hold the sizes and other 
  12.218 -        ** information about every partition with this 'major' (i.e. 
  12.219 -        ** every disk sharing the 8 bit prefix * max partns per disk) 
  12.220 -        */
  12.221 -        gd->sizes = kmalloc(max_part*gd->nr_real*sizeof(int), GFP_KERNEL);
  12.222 -        gd->part  = kmalloc(max_part*gd->nr_real*sizeof(struct hd_struct), 
  12.223 -                            GFP_KERNEL);
  12.224 -        memset(gd->sizes, 0, max_part * gd->nr_real * sizeof(int));
  12.225 -        memset(gd->part,  0, max_part * gd->nr_real 
  12.226 -               * sizeof(struct hd_struct));
  12.227 -
  12.228 -
  12.229 -        gd->real_devices = kmalloc(gd->nr_real * sizeof(xl_disk_t), 
  12.230 -                                   GFP_KERNEL);
  12.231 -        memset(gd->real_devices, 0, gd->nr_real * sizeof(xl_disk_t));
  12.232 -
  12.233 -        gd->next   = NULL;            
  12.234 -        gd->fops   = &xlvbd_block_fops;
  12.235 -
  12.236 -        gd->de_arr = kmalloc(gd->nr_real * sizeof(*gd->de_arr), 
  12.237 -                             GFP_KERNEL);
  12.238 -        gd->flags  = kmalloc(gd->nr_real * sizeof(*gd->flags), GFP_KERNEL);
  12.239 -    
  12.240 -        memset(gd->de_arr, 0, gd->nr_real * sizeof(*gd->de_arr));
  12.241 -        memset(gd->flags, 0, gd->nr_real *  sizeof(*gd->flags));
  12.242 -
  12.243 -        add_gendisk(gd);
  12.244 -
  12.245 -        blk_size[major] = gd->sizes;
  12.246 -    }
  12.247 -
  12.248 -    if ( xd->info & VDISK_READONLY )
  12.249 -        set_device_ro(device, 1);
  12.250 -
  12.251 -    gd->flags[minor >> gd->minor_shift] |= GENHD_FL_XEN;
  12.252 -
  12.253 -    /* NB. Linux 2.4 only handles 32-bit sector offsets and capacities. */
  12.254 -    capacity = (unsigned long)xd->capacity;
  12.255 -
  12.256 -    if ( partno != 0 )
  12.257 -    {
  12.258 -        /*
  12.259 -         * If this was previously set up as a real disc we will have set 
  12.260 -         * up partition-table information. Virtual partitions override 
  12.261 -         * 'real' partitions, and the two cannot coexist on a device.
  12.262 -         */
  12.263 -        if ( !(gd->flags[minor >> gd->minor_shift] & GENHD_FL_VIRT_PARTNS) &&
  12.264 -             (gd->sizes[minor & ~(max_part-1)] != 0) )
  12.265 -        {
  12.266 -            /*
  12.267 -             * Any non-zero sub-partition entries must be cleaned out before
  12.268 -             * installing 'virtual' partition entries. The two types cannot
  12.269 -             * coexist, and virtual partitions are favoured.
  12.270 -             */
  12.271 -            kdev_t dev = device & ~(max_part-1);
  12.272 -            for ( i = max_part - 1; i > 0; i-- )
  12.273 -            {
  12.274 -                invalidate_device(dev+i, 1);
  12.275 -                gd->part[MINOR(dev+i)].start_sect = 0;
  12.276 -                gd->part[MINOR(dev+i)].nr_sects   = 0;
  12.277 -                gd->sizes[MINOR(dev+i)]           = 0;
  12.278 -            }
  12.279 -            printk(KERN_ALERT
  12.280 -                   "Virtual partitions found for /dev/%s - ignoring any "
  12.281 -                   "real partition information we may have found.\n",
  12.282 -                   disk_name(gd, MINOR(device), buf));
  12.283 -        }
  12.284 -
  12.285 -        /* Need to skankily setup 'partition' information */
  12.286 -        gd->part[minor].start_sect = 0; 
  12.287 -        gd->part[minor].nr_sects   = capacity; 
  12.288 -        gd->sizes[minor]           = capacity >>(BLOCK_SIZE_BITS-9); 
  12.289 -
  12.290 -        gd->flags[minor >> gd->minor_shift] |= GENHD_FL_VIRT_PARTNS;
  12.291 -    }
  12.292 -    else
  12.293 -    {
  12.294 -        gd->part[minor].nr_sects = capacity;
  12.295 -        gd->sizes[minor] = capacity>>(BLOCK_SIZE_BITS-9);
  12.296 -        
  12.297 -        /* Some final fix-ups depending on the device type */
  12.298 -        if ( xd->info & VDISK_REMOVABLE )
  12.299 -        { 
  12.300 -            gd->flags[minor >> gd->minor_shift] |= GENHD_FL_REMOVABLE; 
  12.301 -            printk(KERN_ALERT 
  12.302 -                   "Skipping partition check on %s /dev/%s\n", 
  12.303 -                   (xd->info & VDISK_CDROM) ? "cdrom" : "removable",
  12.304 -                   disk_name(gd, MINOR(device), buf)); 
  12.305 -        }
  12.306 -        else
  12.307 -        {
  12.308 -            /* Only check partitions on real discs (not virtual!). */
  12.309 -            if ( gd->flags[minor>>gd->minor_shift] & GENHD_FL_VIRT_PARTNS )
  12.310 -            {
  12.311 -                printk(KERN_ALERT
  12.312 -                       "Skipping partition check on virtual /dev/%s\n",
  12.313 -                       disk_name(gd, MINOR(device), buf));
  12.314 -                break;
  12.315 -            }
  12.316 -            register_disk(gd, device, gd->max_p, &xlvbd_block_fops, capacity);
  12.317 -        }
  12.318 -    }
  12.319 -
  12.320 - out:
  12.321 -    bdput(bd);    
  12.322 -    return rc;
  12.323 -}
  12.324 -
  12.325 -
  12.326 -/*
  12.327 - * xlvbd_remove_device - remove a device node if possible
  12.328 - * @device:       numeric device ID
  12.329 - *
  12.330 - * Updates the gendisk structure and invalidates devices.
  12.331 - *
  12.332 - * This is OK for now but in future, should perhaps consider where this should
  12.333 - * deallocate gendisks / unregister devices.
  12.334 - */
  12.335 -static int xlvbd_remove_device(int device)
  12.336 -{
  12.337 -    int i, rc = 0, minor = MINOR(device);
  12.338 -    struct gendisk *gd;
  12.339 -    struct block_device *bd;
  12.340 -    xl_disk_t *disk = NULL;
  12.341 -
  12.342 -    if ( (bd = bdget(device)) == NULL )
  12.343 -        return -1;
  12.344 -
  12.345 -    if ( ((gd = get_gendisk(device)) == NULL) ||
  12.346 -         ((disk = xldev_to_xldisk(device)) == NULL) )
  12.347 -        BUG();
  12.348 -
  12.349 -    if ( disk->usage != 0 )
  12.350 -    {
  12.351 -        printk(KERN_ALERT "VBD removal failed - in use [dev=%x]\n", device);
  12.352 -        rc = -1;
  12.353 -        goto out;
  12.354 -    }
  12.355 - 
  12.356 -    if ( (minor & (gd->max_p-1)) != 0 )
  12.357 -    {
  12.358 -        /* 1: The VBD is mapped to a partition rather than a whole unit. */
  12.359 -        invalidate_device(device, 1);
  12.360 -	gd->part[minor].start_sect = 0;
  12.361 -        gd->part[minor].nr_sects   = 0;
  12.362 -        gd->sizes[minor]           = 0;
  12.363 -
  12.364 -        /* Clear the consists-of-virtual-partitions flag if possible. */
  12.365 -        gd->flags[minor >> gd->minor_shift] &= ~GENHD_FL_VIRT_PARTNS;
  12.366 -        for ( i = 1; i < gd->max_p; i++ )
  12.367 -            if ( gd->sizes[(minor & ~(gd->max_p-1)) + i] != 0 )
  12.368 -                gd->flags[minor >> gd->minor_shift] |= GENHD_FL_VIRT_PARTNS;
  12.369 -
  12.370 -        /*
  12.371 -         * If all virtual partitions are now gone, and a 'whole unit' VBD is
  12.372 -         * present, then we can try to grok the unit's real partition table.
  12.373 -         */
  12.374 -        if ( !(gd->flags[minor >> gd->minor_shift] & GENHD_FL_VIRT_PARTNS) &&
  12.375 -             (gd->sizes[minor & ~(gd->max_p-1)] != 0) &&
  12.376 -             !(gd->flags[minor >> gd->minor_shift] & GENHD_FL_REMOVABLE) )
  12.377 -        {
  12.378 -            register_disk(gd,
  12.379 -                          device&~(gd->max_p-1), 
  12.380 -                          gd->max_p, 
  12.381 -                          &xlvbd_block_fops,
  12.382 -                          gd->part[minor&~(gd->max_p-1)].nr_sects);
  12.383 -        }
  12.384 -    }
  12.385 -    else
  12.386 -    {
  12.387 -        /*
  12.388 -         * 2: The VBD is mapped to an entire 'unit'. Clear all partitions.
  12.389 -         * NB. The partition entries are only cleared if there are no VBDs
  12.390 -         * mapped to individual partitions on this unit.
  12.391 -         */
  12.392 -        i = gd->max_p - 1; /* Default: clear subpartitions as well. */
  12.393 -        if ( gd->flags[minor >> gd->minor_shift] & GENHD_FL_VIRT_PARTNS )
  12.394 -            i = 0; /* 'Virtual' mode: only clear the 'whole unit' entry. */
  12.395 -        while ( i >= 0 )
  12.396 -        {
  12.397 -            invalidate_device(device+i, 1);
  12.398 -            gd->part[minor+i].start_sect = 0;
  12.399 -            gd->part[minor+i].nr_sects   = 0;
  12.400 -            gd->sizes[minor+i]           = 0;
  12.401 -            i--;
  12.402 -        }
  12.403 -    }
  12.404 -
  12.405 - out:
  12.406 -    bdput(bd);
  12.407 -    return rc;
  12.408 -}
  12.409 -
  12.410 -/*
  12.411 - * xlvbd_update_vbds - reprobes the VBD status and performs updates driver
  12.412 - * state. The VBDs need to be updated in this way when the domain is
  12.413 - * initialised and also each time we receive an XLBLK_UPDATE event.
  12.414 - */
  12.415 -void xlvbd_update_vbds(void)
  12.416 -{
  12.417 -    int i, j, k, old_nr, new_nr;
  12.418 -    vdisk_t *old_info, *new_info, *merged_info;
  12.419 -
  12.420 -    old_info = vbd_info;
  12.421 -    old_nr   = nr_vbds;
  12.422 -
  12.423 -    new_info = kmalloc(MAX_VBDS * sizeof(vdisk_t), GFP_KERNEL);
  12.424 -    if (!new_info)
  12.425 -        return;
  12.426 -
  12.427 -    if ( unlikely(new_nr = xlvbd_get_vbd_info(new_info)) < 0 )
  12.428 -        goto out;
  12.429 -
  12.430 -    /*
  12.431 -     * Final list maximum size is old list + new list. This occurs only when
  12.432 -     * old list and new list do not overlap at all, and we cannot yet destroy
  12.433 -     * VBDs in the old list because the usage counts are busy.
  12.434 -     */
  12.435 -    merged_info = kmalloc((old_nr + new_nr) * sizeof(vdisk_t), GFP_KERNEL);
  12.436 -    if (!merged_info)
  12.437 -        goto out;
  12.438 -
  12.439 -    /* @i tracks old list; @j tracks new list; @k tracks merged list. */
  12.440 -    i = j = k = 0;
  12.441 -
  12.442 -    while ( (i < old_nr) && (j < new_nr) )
  12.443 -    {
  12.444 -        if ( old_info[i].device < new_info[j].device )
  12.445 -        {
  12.446 -            if ( xlvbd_remove_device(old_info[i].device) != 0 )
  12.447 -                memcpy(&merged_info[k++], &old_info[i], sizeof(vdisk_t));
  12.448 -            i++;
  12.449 -        }
  12.450 -        else if ( old_info[i].device > new_info[j].device )
  12.451 -        {
  12.452 -            if ( xlvbd_init_device(&new_info[j]) == 0 )
  12.453 -                memcpy(&merged_info[k++], &new_info[j], sizeof(vdisk_t));
  12.454 -            j++;
  12.455 -        }
  12.456 -        else
  12.457 -        {
  12.458 -            if ( ((old_info[i].capacity == new_info[j].capacity) &&
  12.459 -                  (old_info[i].info == new_info[j].info)) ||
  12.460 -                 (xlvbd_remove_device(old_info[i].device) != 0) )
  12.461 -                memcpy(&merged_info[k++], &old_info[i], sizeof(vdisk_t));
  12.462 -            else if ( xlvbd_init_device(&new_info[j]) == 0 )
  12.463 -                memcpy(&merged_info[k++], &new_info[j], sizeof(vdisk_t));
  12.464 -            i++; j++;
  12.465 -        }
  12.466 -    }
  12.467 -
  12.468 -    for ( ; i < old_nr; i++ )
  12.469 -    {
  12.470 -        if ( xlvbd_remove_device(old_info[i].device) != 0 )
  12.471 -            memcpy(&merged_info[k++], &old_info[i], sizeof(vdisk_t));
  12.472 -    }
  12.473 -
  12.474 -    for ( ; j < new_nr; j++ )
  12.475 -    {
  12.476 -        if ( xlvbd_init_device(&new_info[j]) == 0 )
  12.477 -            memcpy(&merged_info[k++], &new_info[j], sizeof(vdisk_t));
  12.478 -    }
  12.479 -
  12.480 -    vbd_info = merged_info;
  12.481 -    nr_vbds  = k;
  12.482 -
  12.483 -    kfree(old_info);
  12.484 -out:
  12.485 -    kfree(new_info);
  12.486 -}
  12.487 -
  12.488 -
  12.489 -/*
  12.490 - * Set up all the linux device goop for the virtual block devices (vbd's) that
  12.491 - * we know about. Note that although from the backend driver's p.o.v. VBDs are
  12.492 - * addressed simply an opaque 16-bit device number, the domain creation tools 
  12.493 - * conventionally allocate these numbers to correspond to those used by 'real' 
  12.494 - * linux -- this is just for convenience as it means e.g. that the same 
  12.495 - * /etc/fstab can be used when booting with or without Xen.
  12.496 - */
  12.497 -int xlvbd_init(void)
  12.498 -{
  12.499 -    int i;
  12.500 -    
  12.501 -    /*
  12.502 -     * If compiled as a module, we don't support unloading yet. We therefore 
  12.503 -     * permanently increment the reference count to disallow it.
  12.504 -     */
  12.505 -    SET_MODULE_OWNER(&xlvbd_block_fops);
  12.506 -    MOD_INC_USE_COUNT;
  12.507 -
  12.508 -    /* Initialize the global arrays. */
  12.509 -    for ( i = 0; i < 256; i++ ) 
  12.510 -    {
  12.511 -        xlide_blksize_size[i]  = 1024;
  12.512 -        xlide_hardsect_size[i] = 512;
  12.513 -        xlide_max_sectors[i]   = 512;
  12.514 -
  12.515 -        xlscsi_blksize_size[i]  = 1024;
  12.516 -        xlscsi_hardsect_size[i] = 512;
  12.517 -        xlscsi_max_sectors[i]   = 512;
  12.518 -
  12.519 -        xlvbd_blksize_size[i]  = 512;
  12.520 -        xlvbd_hardsect_size[i] = 512;
  12.521 -        xlvbd_max_sectors[i]   = 512;
  12.522 -    }
  12.523 -
  12.524 -    vbd_info = kmalloc(MAX_VBDS * sizeof(vdisk_t), GFP_KERNEL);
  12.525 -    if (!vbd_info)
  12.526 -        return -ENOMEM;
  12.527 -
  12.528 -    nr_vbds  = xlvbd_get_vbd_info(vbd_info);
  12.529 -
  12.530 -    if ( nr_vbds < 0 )
  12.531 -    {
  12.532 -        kfree(vbd_info);
  12.533 -        vbd_info = NULL;
  12.534 -        nr_vbds  = 0;
  12.535 -    }
  12.536 -    else
  12.537 -    {
  12.538 -        for ( i = 0; i < nr_vbds; i++ )
  12.539 -            xlvbd_init_device(&vbd_info[i]);
  12.540 -    }
  12.541 -
  12.542 -    return 0;
  12.543 -}
    13.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/console/Makefile	Mon Jul 11 14:48:47 2005 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,3 +0,0 @@
    13.4 -O_TARGET := drv.o
    13.5 -obj-$(CONFIG_XEN_CONSOLE) := console.o
    13.6 -include $(TOPDIR)/Rules.make
    14.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/dom0/Makefile	Mon Jul 11 14:48:47 2005 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,3 +0,0 @@
    14.4 -O_TARGET := drv.o
    14.5 -obj-y := core.o
    14.6 -include $(TOPDIR)/Rules.make
    15.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/evtchn/Makefile	Mon Jul 11 14:48:47 2005 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,3 +0,0 @@
    15.4 -O_TARGET := drv.o
    15.5 -obj-y := evtchn.o
    15.6 -include $(TOPDIR)/Rules.make
    16.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/netif/Makefile	Mon Jul 11 14:48:47 2005 +0000
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,10 +0,0 @@
    16.4 -
    16.5 -O_TARGET := drv.o
    16.6 -
    16.7 -subdir-$(CONFIG_XEN_NETDEV_FRONTEND) += frontend
    16.8 -obj-$(CONFIG_XEN_NETDEV_FRONTEND)    += frontend/drv.o
    16.9 -
   16.10 -subdir-$(CONFIG_XEN_PHYSDEV_ACCESS) += backend
   16.11 -obj-$(CONFIG_XEN_PHYSDEV_ACCESS)    += backend/drv.o
   16.12 -
   16.13 -include $(TOPDIR)/Rules.make
    17.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/netif/backend/Makefile	Mon Jul 11 14:48:47 2005 +0000
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,4 +0,0 @@
    17.4 -O_TARGET := drv.o
    17.5 -export-objs := interface.o
    17.6 -obj-y := main.o control.o interface.o
    17.7 -include $(TOPDIR)/Rules.make
    18.1 --- a/linux-2.4.30-xen-sparse/arch/xen/drivers/netif/frontend/Makefile	Mon Jul 11 14:48:47 2005 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,3 +0,0 @@
    18.4 -O_TARGET := drv.o
    18.5 -obj-y := main.o
    18.6 -include $(TOPDIR)/Rules.make
    19.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/Makefile	Mon Jul 11 14:48:47 2005 +0000
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,20 +0,0 @@
    19.4 -
    19.5 -.S.o:
    19.6 -	$(CC) $(AFLAGS) -traditional -c $< -o $*.o
    19.7 -
    19.8 -all: kernel.o head.o init_task.o
    19.9 -
   19.10 -O_TARGET := kernel.o
   19.11 -
   19.12 -export-objs     := i386_ksyms.o gnttab.o skbuff.o ctrl_if.o
   19.13 -
   19.14 -obj-y	:= process.o semaphore.o signal.o entry.o traps.o irq.o  \
   19.15 -		ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o \
   19.16 -		i386_ksyms.o i387.o evtchn.o ctrl_if.o pci-dma.o \
   19.17 -		reboot.o fixup.o gnttab.o skbuff.o
   19.18 -
   19.19 -ifdef CONFIG_PCI
   19.20 -obj-y	+= pci-i386.o pci-pc.o
   19.21 -endif
   19.22 -
   19.23 -include $(TOPDIR)/Rules.make
    20.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/entry.S	Mon Jul 11 14:48:47 2005 +0000
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,779 +0,0 @@
    20.4 -/*
    20.5 - *  linux/arch/i386/entry.S
    20.6 - *
    20.7 - *  Copyright (C) 1991, 1992  Linus Torvalds
    20.8 - */
    20.9 -
   20.10 -/*
   20.11 - * entry.S contains the system-call and fault low-level handling routines.
   20.12 - * This also contains the timer-interrupt handler, as well as all interrupts
   20.13 - * and faults that can result in a task-switch.
   20.14 - *
   20.15 - * NOTE: This code handles signal-recognition, which happens every time
   20.16 - * after a timer-interrupt and after each system call.
   20.17 - *
   20.18 - * I changed all the .align's to 4 (16 byte alignment), as that's faster
   20.19 - * on a 486.
   20.20 - *
   20.21 - * Stack layout in 'ret_to_user':
   20.22 - * 	ptrace needs to have all regs on the stack.
   20.23 - *	if the order here is changed, it needs to be
   20.24 - *	updated in fork.c:copy_process, signal.c:do_signal,
   20.25 - *	ptrace.c and ptrace.h
   20.26 - *
   20.27 - *	 0(%esp) - %ebx
   20.28 - *	 4(%esp) - %ecx
   20.29 - *	 8(%esp) - %edx
   20.30 - *       C(%esp) - %esi
   20.31 - *	10(%esp) - %edi
   20.32 - *	14(%esp) - %ebp
   20.33 - *	18(%esp) - %eax
   20.34 - *	1C(%esp) - %ds
   20.35 - *	20(%esp) - %es
   20.36 - *	24(%esp) - orig_eax
   20.37 - *	28(%esp) - %eip
   20.38 - *	2C(%esp) - %cs
   20.39 - *	30(%esp) - %eflags
   20.40 - *	34(%esp) - %oldesp
   20.41 - *	38(%esp) - %oldss
   20.42 - *
   20.43 - * "current" is in register %ebx during any slow entries.
   20.44 - */
   20.45 -
   20.46 -#include <linux/config.h>
   20.47 -#include <linux/sys.h>
   20.48 -#include <linux/linkage.h>
   20.49 -#include <asm/segment.h>
   20.50 -#include <asm/smp.h>
   20.51 -
   20.52 -EBX		= 0x00
   20.53 -ECX		= 0x04
   20.54 -EDX		= 0x08
   20.55 -ESI		= 0x0C
   20.56 -EDI		= 0x10
   20.57 -EBP		= 0x14
   20.58 -EAX		= 0x18
   20.59 -DS		= 0x1C
   20.60 -ES		= 0x20
   20.61 -ORIG_EAX	= 0x24
   20.62 -EIP		= 0x28
   20.63 -CS		= 0x2C
   20.64 -EFLAGS		= 0x30
   20.65 -OLDESP		= 0x34
   20.66 -OLDSS		= 0x38
   20.67 -
   20.68 -CF_MASK		= 0x00000001
   20.69 -TF_MASK		= 0x00000100
   20.70 -IF_MASK		= 0x00000200
   20.71 -DF_MASK		= 0x00000400
   20.72 -NT_MASK		= 0x00004000
   20.73 -
   20.74 -/* Offsets into task_struct. */
   20.75 -state		=  0
   20.76 -flags		=  4
   20.77 -sigpending	=  8
   20.78 -addr_limit	= 12
   20.79 -exec_domain	= 16
   20.80 -need_resched	= 20
   20.81 -tsk_ptrace	= 24
   20.82 -processor	= 52
   20.83 -
   20.84 -/* Offsets into shared_info_t. */
   20.85 -#define evtchn_upcall_pending /* 0 */
   20.86 -#define evtchn_upcall_mask       1
   20.87 -
   20.88 -ENOSYS = 38
   20.89 -
   20.90 -
   20.91 -#define SAVE_ALL \
   20.92 -	cld; \
   20.93 -	pushl %es; \
   20.94 -	pushl %ds; \
   20.95 -	pushl %eax; \
   20.96 -	pushl %ebp; \
   20.97 -	pushl %edi; \
   20.98 -	pushl %esi; \
   20.99 -	pushl %edx; \
  20.100 -	pushl %ecx; \
  20.101 -	pushl %ebx; \
  20.102 -	movl $(__KERNEL_DS),%edx; \
  20.103 -	movl %edx,%ds; \
  20.104 -	movl %edx,%es;
  20.105 -
  20.106 -#define RESTORE_ALL	\
  20.107 -	popl %ebx;	\
  20.108 -	popl %ecx;	\
  20.109 -	popl %edx;	\
  20.110 -	popl %esi;	\
  20.111 -	popl %edi;	\
  20.112 -	popl %ebp;	\
  20.113 -	popl %eax;	\
  20.114 -1:	popl %ds;	\
  20.115 -2:	popl %es;	\
  20.116 -	addl $4,%esp;	\
  20.117 -3:	iret;		\
  20.118 -.section .fixup,"ax";	\
  20.119 -4:	movl $0,(%esp);	\
  20.120 -	jmp 1b;		\
  20.121 -5:	movl $0,(%esp);	\
  20.122 -	jmp 2b;		\
  20.123 -6:	pushl %ss;	\
  20.124 -	popl %ds;	\
  20.125 -	pushl %ss;	\
  20.126 -	popl %es;	\
  20.127 -	pushl $11;	\
  20.128 -	call do_exit;	\
  20.129 -.previous;		\
  20.130 -.section __ex_table,"a";\
  20.131 -	.align 4;	\
  20.132 -	.long 1b,4b;	\
  20.133 -	.long 2b,5b;	\
  20.134 -	.long 3b,6b;	\
  20.135 -.previous
  20.136 -
  20.137 -#define GET_CURRENT(reg) \
  20.138 -	movl $-8192, reg; \
  20.139 -	andl %esp, reg
  20.140 -
  20.141 -ENTRY(lcall7)
  20.142 -	pushfl			# We get a different stack layout with call
  20.143 -	pushl %eax		# gates, which has to be cleaned up later..
  20.144 -	SAVE_ALL
  20.145 -	movl EIP(%esp),%eax	# due to call gates, this is eflags, not eip..
  20.146 -	movl CS(%esp),%edx	# this is eip..
  20.147 -	movl EFLAGS(%esp),%ecx	# and this is cs..
  20.148 -	movl %eax,EFLAGS(%esp)	#
  20.149 -	andl $~(NT_MASK|TF_MASK|DF_MASK), %eax
  20.150 -	pushl %eax
  20.151 -	popfl
  20.152 -	movl %edx,EIP(%esp)	# Now we move them to their "normal" places
  20.153 -	movl %ecx,CS(%esp)	#
  20.154 -	movl %esp,%ebx
  20.155 -	pushl %ebx
  20.156 -	andl $-8192,%ebx	# GET_CURRENT
  20.157 -	movl exec_domain(%ebx),%edx	# Get the execution domain
  20.158 -	movl 4(%edx),%edx	# Get the lcall7 handler for the domain
  20.159 -	pushl $0x7
  20.160 -	call *%edx
  20.161 -	addl $4, %esp
  20.162 -	popl %eax
  20.163 -	jmp ret_to_user
  20.164 -
  20.165 -ENTRY(lcall27)
  20.166 -	pushfl			# We get a different stack layout with call
  20.167 -	pushl %eax		# gates, which has to be cleaned up later..
  20.168 -	SAVE_ALL
  20.169 -	movl EIP(%esp),%eax	# due to call gates, this is eflags, not eip..
  20.170 -	movl CS(%esp),%edx	# this is eip..
  20.171 -	movl EFLAGS(%esp),%ecx	# and this is cs..
  20.172 -	movl %eax,EFLAGS(%esp)	#
  20.173 -	andl $~(NT_MASK|TF_MASK|DF_MASK), %eax
  20.174 -	pushl %eax
  20.175 -	popfl
  20.176 -	movl %edx,EIP(%esp)	# Now we move them to their "normal" places
  20.177 -	movl %ecx,CS(%esp)	#
  20.178 -	movl %esp,%ebx
  20.179 -	pushl %ebx
  20.180 -	andl $-8192,%ebx	# GET_CURRENT
  20.181 -	movl exec_domain(%ebx),%edx	# Get the execution domain
  20.182 -	movl 4(%edx),%edx	# Get the lcall7 handler for the domain
  20.183 -	pushl $0x27
  20.184 -	call *%edx
  20.185 -	addl $4, %esp
  20.186 -	popl %eax
  20.187 -	jmp ret_to_user
  20.188 -
  20.189 -ENTRY(ret_from_fork)
  20.190 -	pushl %ebx
  20.191 -	call SYMBOL_NAME(schedule_tail)
  20.192 -	addl $4, %esp
  20.193 -	GET_CURRENT(%ebx)
  20.194 -	testb $0x02,tsk_ptrace(%ebx)	# PT_TRACESYS
  20.195 -	jne tracesys_exit
  20.196 -	jmp ret_to_user
  20.197 -
  20.198 -/*
  20.199 - * Return to user mode is not as complex as all this looks,
  20.200 - * but we want the default path for a system call return to
  20.201 - * go as quickly as possible which is why some of this is
  20.202 - * less clear than it otherwise should be.
  20.203 - */
  20.204 -ENTRY(system_call)
  20.205 -	pushl %eax			# save orig_eax
  20.206 -	SAVE_ALL
  20.207 -	GET_CURRENT(%ebx)
  20.208 -	testb $0x02,tsk_ptrace(%ebx)	# PT_TRACESYS
  20.209 -	jne tracesys
  20.210 -	cmpl $(NR_syscalls),%eax
  20.211 -	jae badsys
  20.212 -	call *SYMBOL_NAME(sys_call_table)(,%eax,4)
  20.213 -	movl %eax,EAX(%esp)		# save the return value
  20.214 -ret_to_user:
  20.215 -        movl SYMBOL_NAME(HYPERVISOR_shared_info),%esi
  20.216 -        movb $1,evtchn_upcall_mask(%esi) # make tests atomic
  20.217 -ret_to_user_nocli:
  20.218 -	cmpl $0,need_resched(%ebx)
  20.219 -	jne  reschedule
  20.220 -	cmpl $0,sigpending(%ebx)
  20.221 -	je   safesti                    # ensure need_resched updates are seen
  20.222 -/*signal_return:*/
  20.223 -	movb $0,evtchn_upcall_mask(%esi) # reenable event callbacks
  20.224 -	movl %esp,%eax
  20.225 -	xorl %edx,%edx
  20.226 -	call SYMBOL_NAME(do_signal)
  20.227 -	jmp  safesti
  20.228 -
  20.229 -	ALIGN
  20.230 -restore_all:
  20.231 -	RESTORE_ALL
  20.232 -
  20.233 -	ALIGN
  20.234 -tracesys:
  20.235 -	movl $-ENOSYS,EAX(%esp)
  20.236 -	call SYMBOL_NAME(syscall_trace)
  20.237 -	movl ORIG_EAX(%esp),%eax
  20.238 -	cmpl $(NR_syscalls),%eax
  20.239 -	jae tracesys_exit
  20.240 -	call *SYMBOL_NAME(sys_call_table)(,%eax,4)
  20.241 -	movl %eax,EAX(%esp)		# save the return value
  20.242 -tracesys_exit:
  20.243 -	call SYMBOL_NAME(syscall_trace)
  20.244 -	jmp ret_to_user
  20.245 -badsys:
  20.246 -	movl $-ENOSYS,EAX(%esp)
  20.247 -	jmp ret_to_user
  20.248 -
  20.249 -	ALIGN
  20.250 -ENTRY(ret_from_intr)
  20.251 -	GET_CURRENT(%ebx)
  20.252 -ret_from_exception:
  20.253 -	movb CS(%esp),%al
  20.254 -	testl $2,%eax
  20.255 -	jne ret_to_user
  20.256 -	jmp restore_all
  20.257 -
  20.258 -	ALIGN
  20.259 -reschedule:
  20.260 -        movb $0,evtchn_upcall_mask(%esi)  # reenable event callbacks
  20.261 -	call SYMBOL_NAME(schedule)        # test
  20.262 -	jmp  ret_to_user
  20.263 -
  20.264 -ENTRY(divide_error)
  20.265 -	pushl $0		# no error code
  20.266 -	pushl $ SYMBOL_NAME(do_divide_error)
  20.267 -	ALIGN
  20.268 -error_code:
  20.269 -	pushl %ds
  20.270 -	pushl %eax
  20.271 -	xorl %eax,%eax
  20.272 -	pushl %ebp
  20.273 -	pushl %edi
  20.274 -	pushl %esi
  20.275 -	pushl %edx
  20.276 -	decl %eax			# eax = -1
  20.277 -	pushl %ecx
  20.278 -	pushl %ebx
  20.279 -	GET_CURRENT(%ebx)
  20.280 -	cld
  20.281 -	movl %es,%ecx
  20.282 -	movl ORIG_EAX(%esp), %esi	# get the error code
  20.283 -	movl ES(%esp), %edi		# get the function address
  20.284 -	movl %eax, ORIG_EAX(%esp)
  20.285 -	movl %ecx, ES(%esp)
  20.286 -	movl %esp,%edx
  20.287 -	pushl %esi			# push the error code
  20.288 -	pushl %edx			# push the pt_regs pointer
  20.289 -	movl $(__KERNEL_DS),%edx
  20.290 -	movl %edx,%ds
  20.291 -	movl %edx,%es
  20.292 -	call *%edi
  20.293 -	addl $8,%esp
  20.294 -	jmp ret_from_exception
  20.295 -
  20.296 -# A note on the "critical region" in our callback handler.
  20.297 -# We want to avoid stacking callback handlers due to events occurring
  20.298 -# during handling of the last event. To do this, we keep events disabled
  20.299 -# until we've done all processing. HOWEVER, we must enable events before
  20.300 -# popping the stack frame (can't be done atomically) and so it would still
  20.301 -# be possible to get enough handler activations to overflow the stack.
  20.302 -# Although unlikely, bugs of that kind are hard to track down, so we'd
  20.303 -# like to avoid the possibility.
  20.304 -# So, on entry to the handler we detect whether we interrupted an
  20.305 -# existing activation in its critical region -- if so, we pop the current
  20.306 -# activation and restart the handler using the previous one.
  20.307 -ENTRY(hypervisor_callback)
  20.308 -        pushl %eax
  20.309 -        SAVE_ALL
  20.310 -        GET_CURRENT(%ebx)
  20.311 -        movl EIP(%esp),%eax
  20.312 -        cmpl $scrit,%eax
  20.313 -        jb   11f
  20.314 -        cmpl $ecrit,%eax
  20.315 -        jb   critical_region_fixup
  20.316 -11:     push %esp
  20.317 -        call evtchn_do_upcall
  20.318 -        add  $4,%esp
  20.319 -        movl SYMBOL_NAME(HYPERVISOR_shared_info),%esi
  20.320 -        movb CS(%esp),%cl
  20.321 -	test $2,%cl          # slow return to ring 2 or 3
  20.322 -	jne  ret_to_user_nocli
  20.323 -safesti:movb $0,evtchn_upcall_mask(%esi) # reenable event callbacks
  20.324 -scrit:  /**** START OF CRITICAL REGION ****/
  20.325 -        testb $0xFF,evtchn_upcall_pending(%esi)
  20.326 -        jnz  14f              # process more events if necessary...
  20.327 -        RESTORE_ALL
  20.328 -14:     movb $1,evtchn_upcall_mask(%esi)
  20.329 -        jmp  11b
  20.330 -ecrit:  /**** END OF CRITICAL REGION ****/
  20.331 -# [How we do the fixup]. We want to merge the current stack frame with the
  20.332 -# just-interrupted frame. How we do this depends on where in the critical
  20.333 -# region the interrupted handler was executing, and so how many saved
  20.334 -# registers are in each frame. We do this quickly using the lookup table
  20.335 -# 'critical_fixup_table'. For each byte offset in the critical region, it
  20.336 -# provides the number of bytes which have already been popped from the
  20.337 -# interrupted stack frame. 
  20.338 -critical_region_fixup:
  20.339 -        addl $critical_fixup_table-scrit,%eax
  20.340 -        movzbl (%eax),%eax    # %eax contains num bytes popped
  20.341 -        mov  %esp,%esi
  20.342 -        add  %eax,%esi        # %esi points at end of src region
  20.343 -        mov  %esp,%edi
  20.344 -        add  $0x34,%edi       # %edi points at end of dst region
  20.345 -        mov  %eax,%ecx
  20.346 -        shr  $2,%ecx          # convert words to bytes
  20.347 -        je   16f              # skip loop if nothing to copy
  20.348 -15:     subl $4,%esi          # pre-decrementing copy loop
  20.349 -        subl $4,%edi
  20.350 -        movl (%esi),%eax
  20.351 -        movl %eax,(%edi)
  20.352 -        loop 15b
  20.353 -16:     movl %edi,%esp        # final %edi is top of merged stack
  20.354 -        jmp  11b
  20.355 -        
  20.356 -critical_fixup_table:        
  20.357 -        .byte 0x00,0x00,0x00                  # testb $0xFF,(%esi)
  20.358 -        .byte 0x00,0x00                       # jnz  14f
  20.359 -        .byte 0x00                            # pop  %ebx
  20.360 -        .byte 0x04                            # pop  %ecx
  20.361 -        .byte 0x08                            # pop  %edx
  20.362 -        .byte 0x0c                            # pop  %esi
  20.363 -        .byte 0x10                            # pop  %edi
  20.364 -        .byte 0x14                            # pop  %ebp
  20.365 -        .byte 0x18                            # pop  %eax
  20.366 -        .byte 0x1c                            # pop  %ds
  20.367 -        .byte 0x20                            # pop  %es
  20.368 -        .byte 0x24,0x24,0x24                  # add  $4,%esp
  20.369 -        .byte 0x28                            # iret
  20.370 -        .byte 0x00,0x00,0x00,0x00             # movb $1,4(%esi)
  20.371 -        .byte 0x00,0x00                       # jmp  11b
  20.372 -
  20.373 -# Hypervisor uses this for application faults while it executes.
  20.374 -ENTRY(failsafe_callback)
  20.375 -1:      popl %ds
  20.376 -2:      popl %es
  20.377 -3:      popl %fs
  20.378 -4:      popl %gs
  20.379 -5:      iret
  20.380 -.section .fixup,"ax";	\
  20.381 -6:	movl $0,(%esp);	\
  20.382 -	jmp 1b;		\
  20.383 -7:	movl $0,(%esp);	\
  20.384 -	jmp 2b;		\
  20.385 -8:	movl $0,(%esp);	\
  20.386 -	jmp 3b;		\
  20.387 -9:	movl $0,(%esp);	\
  20.388 -	jmp 4b;		\
  20.389 -10:	pushl %ss;	\
  20.390 -	popl %ds;	\
  20.391 -	pushl %ss;	\
  20.392 -	popl %es;	\
  20.393 -	pushl $11;	\
  20.394 -	call do_exit;	\
  20.395 -.previous;		\
  20.396 -.section __ex_table,"a";\
  20.397 -	.align 4;	\
  20.398 -	.long 1b,6b;	\
  20.399 -	.long 2b,7b;	\
  20.400 -	.long 3b,8b;	\
  20.401 -	.long 4b,9b;	\
  20.402 -	.long 5b,10b;	\
  20.403 -.previous
  20.404 -        
  20.405 -ENTRY(coprocessor_error)
  20.406 -	pushl $0
  20.407 -	pushl $ SYMBOL_NAME(do_coprocessor_error)
  20.408 -	jmp error_code
  20.409 -
  20.410 -ENTRY(simd_coprocessor_error)
  20.411 -	pushl $0
  20.412 -	pushl $ SYMBOL_NAME(do_simd_coprocessor_error)
  20.413 -	jmp error_code
  20.414 -
  20.415 -ENTRY(device_not_available)
  20.416 -	pushl $-1		# mark this as an int
  20.417 -	SAVE_ALL
  20.418 -	GET_CURRENT(%ebx)
  20.419 -	call SYMBOL_NAME(math_state_restore)
  20.420 -	jmp ret_from_exception
  20.421 -
  20.422 -ENTRY(debug)
  20.423 -	pushl $0
  20.424 -	pushl $ SYMBOL_NAME(do_debug)
  20.425 -	jmp error_code
  20.426 -
  20.427 -ENTRY(int3)
  20.428 -	pushl $0
  20.429 -	pushl $ SYMBOL_NAME(do_int3)
  20.430 -	jmp error_code
  20.431 -
  20.432 -ENTRY(overflow)
  20.433 -	pushl $0
  20.434 -	pushl $ SYMBOL_NAME(do_overflow)
  20.435 -	jmp error_code
  20.436 -
  20.437 -ENTRY(bounds)
  20.438 -	pushl $0
  20.439 -	pushl $ SYMBOL_NAME(do_bounds)
  20.440 -	jmp error_code
  20.441 -
  20.442 -ENTRY(invalid_op)
  20.443 -	pushl $0
  20.444 -	pushl $ SYMBOL_NAME(do_invalid_op)
  20.445 -	jmp error_code
  20.446 -
  20.447 -ENTRY(coprocessor_segment_overrun)
  20.448 -	pushl $0
  20.449 -	pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun)
  20.450 -	jmp error_code
  20.451 -
  20.452 -ENTRY(double_fault)
  20.453 -	pushl $ SYMBOL_NAME(do_double_fault)
  20.454 -	jmp error_code
  20.455 -
  20.456 -ENTRY(invalid_TSS)
  20.457 -	pushl $ SYMBOL_NAME(do_invalid_TSS)
  20.458 -	jmp error_code
  20.459 -
  20.460 -ENTRY(segment_not_present)
  20.461 -	pushl $ SYMBOL_NAME(do_segment_not_present)
  20.462 -	jmp error_code
  20.463 -
  20.464 -ENTRY(stack_segment)
  20.465 -	pushl $ SYMBOL_NAME(do_stack_segment)
  20.466 -	jmp error_code
  20.467 -
  20.468 -ENTRY(general_protection)
  20.469 -	pushl $ SYMBOL_NAME(do_general_protection)
  20.470 -	jmp error_code
  20.471 -
  20.472 -ENTRY(alignment_check)
  20.473 -	pushl $ SYMBOL_NAME(do_alignment_check)
  20.474 -	jmp error_code
  20.475 -
  20.476 -# This handler is special, because it gets an extra value on its stack,
  20.477 -# which is the linear faulting address.
  20.478 -#define PAGE_FAULT_STUB(_name1, _name2)                                  \
  20.479 -ENTRY(_name1)                                                            \
  20.480 -	pushl %ds                                                      ; \
  20.481 -	pushl %eax                                                     ; \
  20.482 -	xorl %eax,%eax                                                 ; \
  20.483 -	pushl %ebp                                                     ; \
  20.484 -	pushl %edi                                                     ; \
  20.485 -	pushl %esi                                                     ; \
  20.486 -	pushl %edx                                                     ; \
  20.487 -	decl %eax                      /* eax = -1 */                  ; \
  20.488 -	pushl %ecx                                                     ; \
  20.489 -	pushl %ebx                                                     ; \
  20.490 -	GET_CURRENT(%ebx)                                              ; \
  20.491 -	cld                                                            ; \
  20.492 -	movl %es,%ecx                                                  ; \
  20.493 -	movl ORIG_EAX(%esp), %esi      /* get the error code */        ; \
  20.494 -	movl ES(%esp), %edi            /* get the faulting address */  ; \
  20.495 -	movl %eax, ORIG_EAX(%esp)                                      ; \
  20.496 -	movl %ecx, ES(%esp)                                            ; \
  20.497 -	movl %esp,%edx                                                 ; \
  20.498 -        pushl %edi                     /* push the faulting address */ ; \
  20.499 -	pushl %esi                     /* push the error code */       ; \
  20.500 -	pushl %edx                     /* push the pt_regs pointer */  ; \
  20.501 -	movl $(__KERNEL_DS),%edx                                       ; \
  20.502 -	movl %edx,%ds                                                  ; \
  20.503 -	movl %edx,%es                                                  ; \
  20.504 -	call SYMBOL_NAME(_name2)                                       ; \
  20.505 -	addl $12,%esp                                                  ; \
  20.506 -	jmp ret_from_exception                                         ;
  20.507 -PAGE_FAULT_STUB(page_fault, do_page_fault)
  20.508 -
  20.509 -ENTRY(machine_check)
  20.510 -	pushl $0
  20.511 -	pushl $ SYMBOL_NAME(do_machine_check)
  20.512 -	jmp error_code
  20.513 -
  20.514 -ENTRY(fixup_4gb_segment)
  20.515 -	pushl $ SYMBOL_NAME(do_fixup_4gb_segment)
  20.516 -	jmp error_code
  20.517 -
  20.518 -.data
  20.519 -ENTRY(sys_call_table)
  20.520 -	.long SYMBOL_NAME(sys_ni_syscall)	/* 0  -  old "setup()" system call*/
  20.521 -	.long SYMBOL_NAME(sys_exit)
  20.522 -	.long SYMBOL_NAME(sys_fork)
  20.523 -	.long SYMBOL_NAME(sys_read)
  20.524 -	.long SYMBOL_NAME(sys_write)
  20.525 -	.long SYMBOL_NAME(sys_open)		/* 5 */
  20.526 -	.long SYMBOL_NAME(sys_close)
  20.527 -	.long SYMBOL_NAME(sys_waitpid)
  20.528 -	.long SYMBOL_NAME(sys_creat)
  20.529 -	.long SYMBOL_NAME(sys_link)
  20.530 -	.long SYMBOL_NAME(sys_unlink)		/* 10 */
  20.531 -	.long SYMBOL_NAME(sys_execve)
  20.532 -	.long SYMBOL_NAME(sys_chdir)
  20.533 -	.long SYMBOL_NAME(sys_time)
  20.534 -	.long SYMBOL_NAME(sys_mknod)
  20.535 -	.long SYMBOL_NAME(sys_chmod)		/* 15 */
  20.536 -	.long SYMBOL_NAME(sys_lchown16)
  20.537 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old break syscall holder */
  20.538 -	.long SYMBOL_NAME(sys_stat)
  20.539 -	.long SYMBOL_NAME(sys_lseek)
  20.540 -	.long SYMBOL_NAME(sys_getpid)		/* 20 */
  20.541 -	.long SYMBOL_NAME(sys_mount)
  20.542 -	.long SYMBOL_NAME(sys_oldumount)
  20.543 -	.long SYMBOL_NAME(sys_setuid16)
  20.544 -	.long SYMBOL_NAME(sys_getuid16)
  20.545 -	.long SYMBOL_NAME(sys_stime)		/* 25 */
  20.546 -	.long SYMBOL_NAME(sys_ptrace)
  20.547 -	.long SYMBOL_NAME(sys_alarm)
  20.548 -	.long SYMBOL_NAME(sys_fstat)
  20.549 -	.long SYMBOL_NAME(sys_pause)
  20.550 -	.long SYMBOL_NAME(sys_utime)		/* 30 */
  20.551 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old stty syscall holder */
  20.552 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old gtty syscall holder */
  20.553 -	.long SYMBOL_NAME(sys_access)
  20.554 -	.long SYMBOL_NAME(sys_nice)
  20.555 -	.long SYMBOL_NAME(sys_ni_syscall)	/* 35 */		/* old ftime syscall holder */
  20.556 -	.long SYMBOL_NAME(sys_sync)
  20.557 -	.long SYMBOL_NAME(sys_kill)
  20.558 -	.long SYMBOL_NAME(sys_rename)
  20.559 -	.long SYMBOL_NAME(sys_mkdir)
  20.560 -	.long SYMBOL_NAME(sys_rmdir)		/* 40 */
  20.561 -	.long SYMBOL_NAME(sys_dup)
  20.562 -	.long SYMBOL_NAME(sys_pipe)
  20.563 -	.long SYMBOL_NAME(sys_times)
  20.564 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old prof syscall holder */
  20.565 -	.long SYMBOL_NAME(sys_brk)		/* 45 */
  20.566 -	.long SYMBOL_NAME(sys_setgid16)
  20.567 -	.long SYMBOL_NAME(sys_getgid16)
  20.568 -	.long SYMBOL_NAME(sys_signal)
  20.569 -	.long SYMBOL_NAME(sys_geteuid16)
  20.570 -	.long SYMBOL_NAME(sys_getegid16)	/* 50 */
  20.571 -	.long SYMBOL_NAME(sys_acct)
  20.572 -	.long SYMBOL_NAME(sys_umount)					/* recycled never used phys() */
  20.573 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old lock syscall holder */
  20.574 -	.long SYMBOL_NAME(sys_ioctl)
  20.575 -	.long SYMBOL_NAME(sys_fcntl)		/* 55 */
  20.576 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old mpx syscall holder */
  20.577 -	.long SYMBOL_NAME(sys_setpgid)
  20.578 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old ulimit syscall holder */
  20.579 -	.long SYMBOL_NAME(sys_olduname)
  20.580 -	.long SYMBOL_NAME(sys_umask)		/* 60 */
  20.581 -	.long SYMBOL_NAME(sys_chroot)
  20.582 -	.long SYMBOL_NAME(sys_ustat)
  20.583 -	.long SYMBOL_NAME(sys_dup2)
  20.584 -	.long SYMBOL_NAME(sys_getppid)
  20.585 -	.long SYMBOL_NAME(sys_getpgrp)		/* 65 */
  20.586 -	.long SYMBOL_NAME(sys_setsid)
  20.587 -	.long SYMBOL_NAME(sys_sigaction)
  20.588 -	.long SYMBOL_NAME(sys_sgetmask)
  20.589 -	.long SYMBOL_NAME(sys_ssetmask)
  20.590 -	.long SYMBOL_NAME(sys_setreuid16)	/* 70 */
  20.591 -	.long SYMBOL_NAME(sys_setregid16)
  20.592 -	.long SYMBOL_NAME(sys_sigsuspend)
  20.593 -	.long SYMBOL_NAME(sys_sigpending)
  20.594 -	.long SYMBOL_NAME(sys_sethostname)
  20.595 -	.long SYMBOL_NAME(sys_setrlimit)	/* 75 */
  20.596 -	.long SYMBOL_NAME(sys_old_getrlimit)
  20.597 -	.long SYMBOL_NAME(sys_getrusage)
  20.598 -	.long SYMBOL_NAME(sys_gettimeofday)
  20.599 -	.long SYMBOL_NAME(sys_settimeofday)
  20.600 -	.long SYMBOL_NAME(sys_getgroups16)	/* 80 */
  20.601 -	.long SYMBOL_NAME(sys_setgroups16)
  20.602 -	.long SYMBOL_NAME(old_select)
  20.603 -	.long SYMBOL_NAME(sys_symlink)
  20.604 -	.long SYMBOL_NAME(sys_lstat)
  20.605 -	.long SYMBOL_NAME(sys_readlink)		/* 85 */
  20.606 -	.long SYMBOL_NAME(sys_uselib)
  20.607 -	.long SYMBOL_NAME(sys_swapon)
  20.608 -	.long SYMBOL_NAME(sys_reboot)
  20.609 -	.long SYMBOL_NAME(old_readdir)
  20.610 -	.long SYMBOL_NAME(old_mmap)		/* 90 */
  20.611 -	.long SYMBOL_NAME(sys_munmap)
  20.612 -	.long SYMBOL_NAME(sys_truncate)
  20.613 -	.long SYMBOL_NAME(sys_ftruncate)
  20.614 -	.long SYMBOL_NAME(sys_fchmod)
  20.615 -	.long SYMBOL_NAME(sys_fchown16)		/* 95 */
  20.616 -	.long SYMBOL_NAME(sys_getpriority)
  20.617 -	.long SYMBOL_NAME(sys_setpriority)
  20.618 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old profil syscall holder */
  20.619 -	.long SYMBOL_NAME(sys_statfs)
  20.620 -	.long SYMBOL_NAME(sys_fstatfs)		/* 100 */
  20.621 -	.long SYMBOL_NAME(sys_ioperm)
  20.622 -	.long SYMBOL_NAME(sys_socketcall)
  20.623 -	.long SYMBOL_NAME(sys_syslog)
  20.624 -	.long SYMBOL_NAME(sys_setitimer)
  20.625 -	.long SYMBOL_NAME(sys_getitimer)	/* 105 */
  20.626 -	.long SYMBOL_NAME(sys_newstat)
  20.627 -	.long SYMBOL_NAME(sys_newlstat)
  20.628 -	.long SYMBOL_NAME(sys_newfstat)
  20.629 -	.long SYMBOL_NAME(sys_uname)
  20.630 -	.long SYMBOL_NAME(sys_iopl)		/* 110 */
  20.631 -	.long SYMBOL_NAME(sys_vhangup)
  20.632 -	.long SYMBOL_NAME(sys_ni_syscall)	/* old "idle" system call */
  20.633 -	.long SYMBOL_NAME(sys_ni_syscall) /* was VM86 */
  20.634 -	.long SYMBOL_NAME(sys_wait4)
  20.635 -	.long SYMBOL_NAME(sys_swapoff)		/* 115 */
  20.636 -	.long SYMBOL_NAME(sys_sysinfo)
  20.637 -	.long SYMBOL_NAME(sys_ipc)
  20.638 -	.long SYMBOL_NAME(sys_fsync)
  20.639 -	.long SYMBOL_NAME(sys_sigreturn)
  20.640 -	.long SYMBOL_NAME(sys_clone)		/* 120 */
  20.641 -	.long SYMBOL_NAME(sys_setdomainname)
  20.642 -	.long SYMBOL_NAME(sys_newuname)
  20.643 -	.long SYMBOL_NAME(sys_modify_ldt)
  20.644 -	.long SYMBOL_NAME(sys_adjtimex)
  20.645 -	.long SYMBOL_NAME(sys_mprotect)		/* 125 */
  20.646 -	.long SYMBOL_NAME(sys_sigprocmask)
  20.647 -	.long SYMBOL_NAME(sys_create_module)
  20.648 -	.long SYMBOL_NAME(sys_init_module)
  20.649 -	.long SYMBOL_NAME(sys_delete_module)
  20.650 -	.long SYMBOL_NAME(sys_get_kernel_syms)	/* 130 */
  20.651 -	.long SYMBOL_NAME(sys_quotactl)
  20.652 -	.long SYMBOL_NAME(sys_getpgid)
  20.653 -	.long SYMBOL_NAME(sys_fchdir)
  20.654 -	.long SYMBOL_NAME(sys_bdflush)
  20.655 -	.long SYMBOL_NAME(sys_sysfs)		/* 135 */
  20.656 -	.long SYMBOL_NAME(sys_personality)
  20.657 -	.long SYMBOL_NAME(sys_ni_syscall)	/* for afs_syscall */
  20.658 -	.long SYMBOL_NAME(sys_setfsuid16)
  20.659 -	.long SYMBOL_NAME(sys_setfsgid16)
  20.660 -	.long SYMBOL_NAME(sys_llseek)		/* 140 */
  20.661 -	.long SYMBOL_NAME(sys_getdents)
  20.662 -	.long SYMBOL_NAME(sys_select)
  20.663 -	.long SYMBOL_NAME(sys_flock)
  20.664 -	.long SYMBOL_NAME(sys_msync)
  20.665 -	.long SYMBOL_NAME(sys_readv)		/* 145 */
  20.666 -	.long SYMBOL_NAME(sys_writev)
  20.667 -	.long SYMBOL_NAME(sys_getsid)
  20.668 -	.long SYMBOL_NAME(sys_fdatasync)
  20.669 -	.long SYMBOL_NAME(sys_sysctl)
  20.670 -	.long SYMBOL_NAME(sys_mlock)		/* 150 */
  20.671 -	.long SYMBOL_NAME(sys_munlock)
  20.672 -	.long SYMBOL_NAME(sys_mlockall)
  20.673 -	.long SYMBOL_NAME(sys_munlockall)
  20.674 -	.long SYMBOL_NAME(sys_sched_setparam)
  20.675 -	.long SYMBOL_NAME(sys_sched_getparam)   /* 155 */
  20.676 -	.long SYMBOL_NAME(sys_sched_setscheduler)
  20.677 -	.long SYMBOL_NAME(sys_sched_getscheduler)
  20.678 -	.long SYMBOL_NAME(sys_sched_yield)
  20.679 -	.long SYMBOL_NAME(sys_sched_get_priority_max)
  20.680 -	.long SYMBOL_NAME(sys_sched_get_priority_min)  /* 160 */
  20.681 -	.long SYMBOL_NAME(sys_sched_rr_get_interval)
  20.682 -	.long SYMBOL_NAME(sys_nanosleep)
  20.683 -	.long SYMBOL_NAME(sys_mremap)
  20.684 -	.long SYMBOL_NAME(sys_setresuid16)
  20.685 -	.long SYMBOL_NAME(sys_getresuid16)	/* 165 */
  20.686 -	.long SYMBOL_NAME(sys_ni_syscall) /* was VM86 */
  20.687 -	.long SYMBOL_NAME(sys_query_module)
  20.688 -	.long SYMBOL_NAME(sys_poll)
  20.689 -	.long SYMBOL_NAME(sys_nfsservctl)
  20.690 -	.long SYMBOL_NAME(sys_setresgid16)	/* 170 */
  20.691 -	.long SYMBOL_NAME(sys_getresgid16)
  20.692 -	.long SYMBOL_NAME(sys_prctl)
  20.693 -	.long SYMBOL_NAME(sys_rt_sigreturn)
  20.694 -	.long SYMBOL_NAME(sys_rt_sigaction)
  20.695 -	.long SYMBOL_NAME(sys_rt_sigprocmask)	/* 175 */
  20.696 -	.long SYMBOL_NAME(sys_rt_sigpending)
  20.697 -	.long SYMBOL_NAME(sys_rt_sigtimedwait)
  20.698 -	.long SYMBOL_NAME(sys_rt_sigqueueinfo)
  20.699 -	.long SYMBOL_NAME(sys_rt_sigsuspend)
  20.700 -	.long SYMBOL_NAME(sys_pread)		/* 180 */
  20.701 -	.long SYMBOL_NAME(sys_pwrite)
  20.702 -	.long SYMBOL_NAME(sys_chown16)
  20.703 -	.long SYMBOL_NAME(sys_getcwd)
  20.704 -	.long SYMBOL_NAME(sys_capget)
  20.705 -	.long SYMBOL_NAME(sys_capset)           /* 185 */
  20.706 -	.long SYMBOL_NAME(sys_sigaltstack)
  20.707 -	.long SYMBOL_NAME(sys_sendfile)
  20.708 -	.long SYMBOL_NAME(sys_ni_syscall)		/* streams1 */
  20.709 -	.long SYMBOL_NAME(sys_ni_syscall)		/* streams2 */
  20.710 -	.long SYMBOL_NAME(sys_vfork)            /* 190 */
  20.711 -	.long SYMBOL_NAME(sys_getrlimit)
  20.712 -	.long SYMBOL_NAME(sys_mmap2)
  20.713 -	.long SYMBOL_NAME(sys_truncate64)
  20.714 -	.long SYMBOL_NAME(sys_ftruncate64)
  20.715 -	.long SYMBOL_NAME(sys_stat64)		/* 195 */
  20.716 -	.long SYMBOL_NAME(sys_lstat64)
  20.717 -	.long SYMBOL_NAME(sys_fstat64)
  20.718 -	.long SYMBOL_NAME(sys_lchown)
  20.719 -	.long SYMBOL_NAME(sys_getuid)
  20.720 -	.long SYMBOL_NAME(sys_getgid)		/* 200 */
  20.721 -	.long SYMBOL_NAME(sys_geteuid)
  20.722 -	.long SYMBOL_NAME(sys_getegid)
  20.723 -	.long SYMBOL_NAME(sys_setreuid)
  20.724 -	.long SYMBOL_NAME(sys_setregid)
  20.725 -	.long SYMBOL_NAME(sys_getgroups)	/* 205 */
  20.726 -	.long SYMBOL_NAME(sys_setgroups)
  20.727 -	.long SYMBOL_NAME(sys_fchown)
  20.728 -	.long SYMBOL_NAME(sys_setresuid)
  20.729 -	.long SYMBOL_NAME(sys_getresuid)
  20.730 -	.long SYMBOL_NAME(sys_setresgid)	/* 210 */
  20.731 -	.long SYMBOL_NAME(sys_getresgid)
  20.732 -	.long SYMBOL_NAME(sys_chown)
  20.733 -	.long SYMBOL_NAME(sys_setuid)
  20.734 -	.long SYMBOL_NAME(sys_setgid)
  20.735 -	.long SYMBOL_NAME(sys_setfsuid)		/* 215 */
  20.736 -	.long SYMBOL_NAME(sys_setfsgid)
  20.737 -	.long SYMBOL_NAME(sys_pivot_root)
  20.738 -	.long SYMBOL_NAME(sys_mincore)
  20.739 -	.long SYMBOL_NAME(sys_madvise)
  20.740 -	.long SYMBOL_NAME(sys_getdents64)	/* 220 */
  20.741 -	.long SYMBOL_NAME(sys_fcntl64)
  20.742 -	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for TUX */
  20.743 -	.long SYMBOL_NAME(sys_ni_syscall)	/* Reserved for Security */
  20.744 -	.long SYMBOL_NAME(sys_gettid)
  20.745 -	.long SYMBOL_NAME(sys_readahead)	/* 225 */
  20.746 -	.long SYMBOL_NAME(sys_setxattr)
  20.747 -	.long SYMBOL_NAME(sys_lsetxattr)
  20.748 -	.long SYMBOL_NAME(sys_fsetxattr)
  20.749 -	.long SYMBOL_NAME(sys_getxattr)
  20.750 -	.long SYMBOL_NAME(sys_lgetxattr)	/* 230 */
  20.751 -	.long SYMBOL_NAME(sys_fgetxattr)
  20.752 -	.long SYMBOL_NAME(sys_listxattr)
  20.753 -	.long SYMBOL_NAME(sys_llistxattr)
  20.754 -	.long SYMBOL_NAME(sys_flistxattr)
  20.755 -	.long SYMBOL_NAME(sys_removexattr)	/* 235 */
  20.756 -	.long SYMBOL_NAME(sys_lremovexattr)
  20.757 -	.long SYMBOL_NAME(sys_fremovexattr)
  20.758 - 	.long SYMBOL_NAME(sys_tkill)
  20.759 -	.long SYMBOL_NAME(sys_sendfile64)
  20.760 -	.long SYMBOL_NAME(sys_ni_syscall)	/* 240 reserved for futex */
  20.761 -	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for sched_setaffinity */
  20.762 -	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for sched_getaffinity */
  20.763 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_set_thread_area */
  20.764 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_get_thread_area */
  20.765 -	.long SYMBOL_NAME(sys_ni_syscall)	/* 245 sys_io_setup */
  20.766 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_io_destroy */
  20.767 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_io_getevents */
  20.768 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_io_submit */
  20.769 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_io_cancel */
  20.770 -	.long SYMBOL_NAME(sys_ni_syscall)	/* 250 sys_alloc_hugepages */
  20.771 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_free_hugepages */
  20.772 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_exit_group */
  20.773 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_lookup_dcookie */
  20.774 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_epoll_create */
  20.775 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_epoll_ctl 255 */
  20.776 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_epoll_wait */
  20.777 - 	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_remap_file_pages */
  20.778 - 	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_set_tid_address */
  20.779 -
  20.780 -	.rept NR_syscalls-(.-sys_call_table)/4
  20.781 -		.long SYMBOL_NAME(sys_ni_syscall)
  20.782 -	.endr
    21.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/head.S	Mon Jul 11 14:48:47 2005 +0000
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,41 +0,0 @@
    21.4 -
    21.5 -.section __xen_guest
    21.6 -    .ascii "GUEST_OS=linux,GUEST_VER=2.4,XEN_VER=3.0,VIRT_BASE=0xC0000000"
    21.7 -    .ascii ",LOADER=generic"
    21.8 -    .byte  0
    21.9 -
   21.10 -.text
   21.11 -#include <linux/config.h>
   21.12 -#include <linux/threads.h>
   21.13 -#include <linux/linkage.h>
   21.14 -#include <asm/segment.h>
   21.15 -#include <asm/page.h>
   21.16 -#include <asm/pgtable.h>
   21.17 -#include <asm/desc.h>
   21.18 -
   21.19 -ENTRY(stext)
   21.20 -ENTRY(_stext)
   21.21 -        cld
   21.22 -        lss stack_start,%esp
   21.23 -        /* Copy the necessary stuff from xen_start_info structure. */
   21.24 -        mov $SYMBOL_NAME(xen_start_info_union),%edi
   21.25 -        mov $128,%ecx
   21.26 -        rep movsl
   21.27 -        jmp SYMBOL_NAME(start_kernel)
   21.28 -
   21.29 -ENTRY(stack_start)
   21.30 -	.long SYMBOL_NAME(init_task_union)+8192, __KERNEL_DS
   21.31 -
   21.32 -.org 0x1000
   21.33 -ENTRY(empty_zero_page)
   21.34 -
   21.35 -.org 0x2000
   21.36 -ENTRY(default_ldt)
   21.37 -
   21.38 -.org 0x3000
   21.39 -ENTRY(cpu0_pte_quicklist)
   21.40 -
   21.41 -.org 0x3400
   21.42 -ENTRY(cpu0_pgd_quicklist)
   21.43 -        
   21.44 -.org 0x3800
    22.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/i386_ksyms.c	Mon Jul 11 14:48:47 2005 +0000
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,180 +0,0 @@
    22.4 -#include <linux/config.h>
    22.5 -#include <linux/module.h>
    22.6 -#include <linux/smp.h>
    22.7 -#include <linux/user.h>
    22.8 -#include <linux/elfcore.h>
    22.9 -#include <linux/mca.h>
   22.10 -#include <linux/sched.h>
   22.11 -#include <linux/in6.h>
   22.12 -#include <linux/interrupt.h>
   22.13 -#include <linux/smp_lock.h>
   22.14 -#include <linux/pm.h>
   22.15 -#include <linux/pci.h>
   22.16 -#include <linux/apm_bios.h>
   22.17 -#include <linux/kernel.h>
   22.18 -#include <linux/string.h>
   22.19 -#include <linux/tty.h>
   22.20 -
   22.21 -#include <asm/semaphore.h>
   22.22 -#include <asm/processor.h>
   22.23 -#include <asm/i387.h>
   22.24 -#include <asm/uaccess.h>
   22.25 -#include <asm/checksum.h>
   22.26 -#include <asm/io.h>
   22.27 -#include <asm/hardirq.h>
   22.28 -#include <asm/delay.h>
   22.29 -#include <asm/irq.h>
   22.30 -#include <asm/mmx.h>
   22.31 -#include <asm/desc.h>
   22.32 -#include <asm/pgtable.h>
   22.33 -#include <asm/pgalloc.h>
   22.34 -
   22.35 -extern void dump_thread(struct pt_regs *, struct user *);
   22.36 -extern spinlock_t rtc_lock;
   22.37 -
   22.38 -#if defined(CONFIG_APMXXX) || defined(CONFIG_APM_MODULEXXX)
   22.39 -extern void machine_real_restart(unsigned char *, int);
   22.40 -EXPORT_SYMBOL(machine_real_restart);
   22.41 -extern void default_idle(void);
   22.42 -EXPORT_SYMBOL(default_idle);
   22.43 -#endif
   22.44 -
   22.45 -#ifdef CONFIG_SMP
   22.46 -extern void FASTCALL( __write_lock_failed(rwlock_t *rw));
   22.47 -extern void FASTCALL( __read_lock_failed(rwlock_t *rw));
   22.48 -#endif
   22.49 -
   22.50 -#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
   22.51 -extern struct drive_info_struct drive_info;
   22.52 -EXPORT_SYMBOL(drive_info);
   22.53 -#endif
   22.54 -
   22.55 -// XXX extern unsigned long get_cmos_time(void);
   22.56 -
   22.57 -/* platform dependent support */
   22.58 -EXPORT_SYMBOL(boot_cpu_data);
   22.59 -EXPORT_SYMBOL(dump_thread);
   22.60 -EXPORT_SYMBOL(dump_fpu);
   22.61 -EXPORT_SYMBOL(dump_extended_fpu);
   22.62 -EXPORT_SYMBOL(__ioremap);
   22.63 -EXPORT_SYMBOL(iounmap);
   22.64 -EXPORT_SYMBOL(enable_irq);
   22.65 -EXPORT_SYMBOL(disable_irq);
   22.66 -EXPORT_SYMBOL(disable_irq_nosync);
   22.67 -EXPORT_SYMBOL(probe_irq_mask);
   22.68 -EXPORT_SYMBOL(kernel_thread);
   22.69 -EXPORT_SYMBOL(pm_idle);
   22.70 -EXPORT_SYMBOL(pm_power_off);
   22.71 -EXPORT_SYMBOL(apm_info);
   22.72 -//EXPORT_SYMBOL(gdt);
   22.73 -EXPORT_SYMBOL(empty_zero_page);
   22.74 -EXPORT_SYMBOL(phys_to_machine_mapping);
   22.75 -
   22.76 -
   22.77 -#ifdef CONFIG_DEBUG_IOVIRT
   22.78 -EXPORT_SYMBOL(__io_virt_debug);
   22.79 -#endif
   22.80 -
   22.81 -EXPORT_SYMBOL_NOVERS(__down_failed);
   22.82 -EXPORT_SYMBOL_NOVERS(__down_failed_interruptible);
   22.83 -EXPORT_SYMBOL_NOVERS(__down_failed_trylock);
   22.84 -EXPORT_SYMBOL_NOVERS(__up_wakeup);
   22.85 -/* Networking helper routines. */
   22.86 -EXPORT_SYMBOL(csum_partial_copy_generic);
   22.87 -/* Delay loops */
   22.88 -EXPORT_SYMBOL(__ndelay);
   22.89 -EXPORT_SYMBOL(__udelay);
   22.90 -EXPORT_SYMBOL(__delay);
   22.91 -EXPORT_SYMBOL(__const_udelay);
   22.92 -
   22.93 -EXPORT_SYMBOL_NOVERS(__get_user_1);
   22.94 -EXPORT_SYMBOL_NOVERS(__get_user_2);
   22.95 -EXPORT_SYMBOL_NOVERS(__get_user_4);
   22.96 -
   22.97 -EXPORT_SYMBOL(strtok);
   22.98 -EXPORT_SYMBOL(strpbrk);
   22.99 -EXPORT_SYMBOL(strstr);
  22.100 -
  22.101 -EXPORT_SYMBOL(strncpy_from_user);
  22.102 -EXPORT_SYMBOL(__strncpy_from_user);
  22.103 -EXPORT_SYMBOL(clear_user);
  22.104 -EXPORT_SYMBOL(__clear_user);
  22.105 -EXPORT_SYMBOL(__generic_copy_from_user);
  22.106 -EXPORT_SYMBOL(__generic_copy_to_user);
  22.107 -EXPORT_SYMBOL(strnlen_user);
  22.108 -
  22.109 -
  22.110 -EXPORT_SYMBOL(pci_alloc_consistent);
  22.111 -EXPORT_SYMBOL(pci_free_consistent);
  22.112 -
  22.113 -#ifdef CONFIG_PCI
  22.114 -EXPORT_SYMBOL(pcibios_penalize_isa_irq);
  22.115 -EXPORT_SYMBOL(pci_mem_start);
  22.116 -#endif
  22.117 -
  22.118 -
  22.119 -#ifdef CONFIG_X86_USE_3DNOW
  22.120 -EXPORT_SYMBOL(_mmx_memcpy);
  22.121 -EXPORT_SYMBOL(mmx_clear_page);
  22.122 -EXPORT_SYMBOL(mmx_copy_page);
  22.123 -#endif
  22.124 -
  22.125 -#ifdef CONFIG_SMP
  22.126 -EXPORT_SYMBOL(cpu_data);
  22.127 -EXPORT_SYMBOL(kernel_flag_cacheline);
  22.128 -EXPORT_SYMBOL(smp_num_cpus);
  22.129 -EXPORT_SYMBOL(cpu_online_map);
  22.130 -EXPORT_SYMBOL_NOVERS(__write_lock_failed);
  22.131 -EXPORT_SYMBOL_NOVERS(__read_lock_failed);
  22.132 -
  22.133 -/* Global SMP irq stuff */
  22.134 -EXPORT_SYMBOL(synchronize_irq);
  22.135 -EXPORT_SYMBOL(global_irq_holder);
  22.136 -EXPORT_SYMBOL(__global_cli);
  22.137 -EXPORT_SYMBOL(__global_sti);
  22.138 -EXPORT_SYMBOL(__global_save_flags);
  22.139 -EXPORT_SYMBOL(__global_restore_flags);
  22.140 -EXPORT_SYMBOL(smp_call_function);
  22.141 -
  22.142 -/* TLB flushing */
  22.143 -EXPORT_SYMBOL(flush_tlb_page);
  22.144 -
  22.145 -/* HT support */
  22.146 -EXPORT_SYMBOL(smp_num_siblings);
  22.147 -EXPORT_SYMBOL(cpu_sibling_map);
  22.148 -#endif
  22.149 -
  22.150 -#ifdef CONFIG_X86_IO_APIC
  22.151 -EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector);
  22.152 -#endif
  22.153 -
  22.154 -#ifdef CONFIG_VT
  22.155 -EXPORT_SYMBOL(screen_info);
  22.156 -#endif
  22.157 -
  22.158 -EXPORT_SYMBOL(get_wchan);
  22.159 -
  22.160 -EXPORT_SYMBOL(rtc_lock);
  22.161 -
  22.162 -#undef memcpy
  22.163 -#undef memset
  22.164 -extern void * memset(void *,int,__kernel_size_t);
  22.165 -extern void * memcpy(void *,const void *,__kernel_size_t);
  22.166 -EXPORT_SYMBOL_NOVERS(memcpy);
  22.167 -EXPORT_SYMBOL_NOVERS(memset);
  22.168 -
  22.169 -#ifdef CONFIG_HAVE_DEC_LOCK
  22.170 -EXPORT_SYMBOL(atomic_dec_and_lock);
  22.171 -#endif
  22.172 -
  22.173 -#ifdef CONFIG_MULTIQUAD
  22.174 -EXPORT_SYMBOL(xquad_portio);
  22.175 -#endif
  22.176 -
  22.177 -#include <asm/xen_proc.h>
  22.178 -EXPORT_SYMBOL(create_xen_proc_entry);
  22.179 -EXPORT_SYMBOL(remove_xen_proc_entry);
  22.180 -
  22.181 -EXPORT_SYMBOL(evtchn_do_upcall);
  22.182 -EXPORT_SYMBOL(force_evtchn_callback);
  22.183 -EXPORT_SYMBOL(HYPERVISOR_shared_info);
    23.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/irq.c	Mon Jul 11 14:48:47 2005 +0000
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,1242 +0,0 @@
    23.4 -/*
    23.5 - *	linux/arch/i386/kernel/irq.c
    23.6 - *
    23.7 - *	Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
    23.8 - *
    23.9 - * This file contains the code used by various IRQ handling routines:
   23.10 - * asking for different IRQ's should be done through these routines
   23.11 - * instead of just grabbing them. Thus setups with different IRQ numbers
   23.12 - * shouldn't result in any weird surprises, and installing new handlers
   23.13 - * should be easier.
   23.14 - */
   23.15 -
   23.16 -/*
   23.17 - * (mostly architecture independent, will move to kernel/irq.c in 2.5.)
   23.18 - *
   23.19 - * IRQs are in fact implemented a bit like signal handlers for the kernel.
   23.20 - * Naturally it's not a 1:1 relation, but there are similarities.
   23.21 - */
   23.22 -
   23.23 -#include <linux/config.h>
   23.24 -#include <linux/ptrace.h>
   23.25 -#include <linux/errno.h>
   23.26 -#include <linux/signal.h>
   23.27 -#include <linux/sched.h>
   23.28 -#include <linux/ioport.h>
   23.29 -#include <linux/interrupt.h>
   23.30 -#include <linux/timex.h>
   23.31 -#include <linux/slab.h>
   23.32 -#include <linux/random.h>
   23.33 -#include <linux/smp_lock.h>
   23.34 -#include <linux/init.h>
   23.35 -#include <linux/kernel_stat.h>
   23.36 -#include <linux/irq.h>
   23.37 -#include <linux/proc_fs.h>
   23.38 -#include <linux/seq_file.h>
   23.39 -
   23.40 -#include <asm/atomic.h>
   23.41 -#include <asm/io.h>
   23.42 -#include <asm/smp.h>
   23.43 -#include <asm/system.h>
   23.44 -#include <asm/bitops.h>
   23.45 -#include <asm/uaccess.h>
   23.46 -#include <asm/pgalloc.h>
   23.47 -#include <asm/delay.h>
   23.48 -#include <asm/desc.h>
   23.49 -#include <asm/irq.h>
   23.50 -
   23.51 -
   23.52 -
   23.53 -/*
   23.54 - * Linux has a controller-independent x86 interrupt architecture.
   23.55 - * every controller has a 'controller-template', that is used
   23.56 - * by the main code to do the right thing. Each driver-visible
   23.57 - * interrupt source is transparently wired to the apropriate
   23.58 - * controller. Thus drivers need not be aware of the
   23.59 - * interrupt-controller.
   23.60 - *
   23.61 - * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
   23.62 - * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
   23.63 - * (IO-APICs assumed to be messaging to Pentium local-APICs)
   23.64 - *
   23.65 - * the code is designed to be easily extended with new/different
   23.66 - * interrupt controllers, without having to do assembly magic.
   23.67 - */
   23.68 -
   23.69 -/*
   23.70 - * Controller mappings for all interrupt sources:
   23.71 - */
   23.72 -irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned =
   23.73 -	{ [0 ... NR_IRQS-1] = { 0, &no_irq_type, NULL, 0, SPIN_LOCK_UNLOCKED}};
   23.74 -
   23.75 -static void register_irq_proc (unsigned int irq);
   23.76 -
   23.77 -/*
   23.78 - * Special irq handlers.
   23.79 - */
   23.80 -
   23.81 -void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
   23.82 -
   23.83 -/*
   23.84 - * Generic no controller code
   23.85 - */
   23.86 -
   23.87 -static void enable_none(unsigned int irq) { }
   23.88 -static unsigned int startup_none(unsigned int irq) { return 0; }
   23.89 -static void disable_none(unsigned int irq) { }
   23.90 -static void ack_none(unsigned int irq)
   23.91 -{
   23.92 -/*
   23.93 - * 'what should we do if we get a hw irq event on an illegal vector'.
   23.94 - * each architecture has to answer this themselves, it doesnt deserve
   23.95 - * a generic callback i think.
   23.96 - */
   23.97 -#if CONFIG_X86
   23.98 -	printk("unexpected IRQ trap at vector %02x\n", irq);
   23.99 -#ifdef CONFIG_X86_LOCAL_APIC
  23.100 -	/*
  23.101 -	 * Currently unexpected vectors happen only on SMP and APIC.
  23.102 -	 * We _must_ ack these because every local APIC has only N
  23.103 -	 * irq slots per priority level, and a 'hanging, unacked' IRQ
  23.104 -	 * holds up an irq slot - in excessive cases (when multiple
  23.105 -	 * unexpected vectors occur) that might lock up the APIC
  23.106 -	 * completely.
  23.107 -	 */
  23.108 -	ack_APIC_irq();
  23.109 -#endif
  23.110 -#endif
  23.111 -}
  23.112 -
  23.113 -/* startup is the same as "enable", shutdown is same as "disable" */
  23.114 -#define shutdown_none	disable_none
  23.115 -#define end_none	enable_none
  23.116 -
  23.117 -struct hw_interrupt_type no_irq_type = {
  23.118 -	"none",
  23.119 -	startup_none,
  23.120 -	shutdown_none,
  23.121 -	enable_none,
  23.122 -	disable_none,
  23.123 -	ack_none,
  23.124 -	end_none
  23.125 -};
  23.126 -
  23.127 -atomic_t irq_err_count;
  23.128 -#ifdef CONFIG_X86_IO_APIC
  23.129 -#ifdef APIC_MISMATCH_DEBUG
  23.130 -atomic_t irq_mis_count;
  23.131 -#endif
  23.132 -#endif
  23.133 -
  23.134 -/*
  23.135 - * Generic, controller-independent functions:
  23.136 - */
  23.137 -
  23.138 -int show_interrupts(struct seq_file *p, void *v)
  23.139 -{
  23.140 -	int i, j;
  23.141 -	struct irqaction * action;
  23.142 -
  23.143 -	seq_printf(p, "           ");
  23.144 -	for (j=0; j<smp_num_cpus; j++)
  23.145 -		seq_printf(p, "CPU%d       ",j);
  23.146 -	seq_putc(p,'\n');
  23.147 -
  23.148 -	for (i = 0 ; i < NR_IRQS ; i++) {
  23.149 -		action = irq_desc[i].action;
  23.150 -		if (!action) 
  23.151 -			continue;
  23.152 -		seq_printf(p, "%3d: ",i);
  23.153 -#ifndef CONFIG_SMP
  23.154 -		seq_printf(p, "%10u ", kstat_irqs(i));
  23.155 -#else
  23.156 -		for (j = 0; j < smp_num_cpus; j++)
  23.157 -			seq_printf(p, "%10u ",
  23.158 -				kstat.irqs[cpu_logical_map(j)][i]);
  23.159 -#endif
  23.160 -		seq_printf(p, " %14s", irq_desc[i].handler->typename);
  23.161 -		seq_printf(p, "  %s", action->name);
  23.162 -
  23.163 -		for (action=action->next; action; action = action->next)
  23.164 -			seq_printf(p, ", %s", action->name);
  23.165 -		seq_putc(p,'\n');
  23.166 -	}
  23.167 -	seq_printf(p, "NMI: ");
  23.168 -	for (j = 0; j < smp_num_cpus; j++)
  23.169 -		seq_printf(p, "%10u ",
  23.170 -			nmi_count(cpu_logical_map(j)));
  23.171 -	seq_printf(p, "\n");
  23.172 -#if CONFIG_X86_LOCAL_APIC
  23.173 -	seq_printf(p, "LOC: ");
  23.174 -	for (j = 0; j < smp_num_cpus; j++)
  23.175 -		seq_printf(p, "%10u ",
  23.176 -			apic_timer_irqs[cpu_logical_map(j)]);
  23.177 -	seq_printf(p, "\n");
  23.178 -#endif
  23.179 -	seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
  23.180 -#ifdef CONFIG_X86_IO_APIC
  23.181 -#ifdef APIC_MISMATCH_DEBUG
  23.182 -	seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));
  23.183 -#endif
  23.184 -#endif
  23.185 -
  23.186 -	return 0;
  23.187 -}
  23.188 -
  23.189 -
  23.190 -/*
  23.191 - * Global interrupt locks for SMP. Allow interrupts to come in on any
  23.192 - * CPU, yet make cli/sti act globally to protect critical regions..
  23.193 - */
  23.194 -
  23.195 -#ifdef CONFIG_SMP
  23.196 -unsigned char global_irq_holder = NO_PROC_ID;
  23.197 -unsigned volatile long global_irq_lock; /* pendantic: long for set_bit --RR */
  23.198 -
  23.199 -extern void show_stack(unsigned long* esp);
  23.200 -
  23.201 -static void show(char * str)
  23.202 -{
  23.203 -	int i;
  23.204 -	int cpu = smp_processor_id();
  23.205 -
  23.206 -	printk("\n%s, CPU %d:\n", str, cpu);
  23.207 -	printk("irq:  %d [",irqs_running());
  23.208 -	for(i=0;i < smp_num_cpus;i++)
  23.209 -		printk(" %d",local_irq_count(i));
  23.210 -	printk(" ]\nbh:   %d [",spin_is_locked(&global_bh_lock) ? 1 : 0);
  23.211 -	for(i=0;i < smp_num_cpus;i++)
  23.212 -		printk(" %d",local_bh_count(i));
  23.213 -
  23.214 -	printk(" ]\nStack dumps:");
  23.215 -	for(i = 0; i < smp_num_cpus; i++) {
  23.216 -		unsigned long esp;
  23.217 -		if (i == cpu)
  23.218 -			continue;
  23.219 -		printk("\nCPU %d:",i);
  23.220 -		esp = init_tss[i].esp0;
  23.221 -		if (!esp) {
  23.222 -			/* tss->esp0 is set to NULL in cpu_init(),
  23.223 -			 * it's initialized when the cpu returns to user
  23.224 -			 * space. -- manfreds
  23.225 -			 */
  23.226 -			printk(" <unknown> ");
  23.227 -			continue;
  23.228 -		}
  23.229 -		esp &= ~(THREAD_SIZE-1);
  23.230 -		esp += sizeof(struct task_struct);
  23.231 -		show_stack((void*)esp);
  23.232 - 	}
  23.233 -	printk("\nCPU %d:",cpu);
  23.234 -	show_stack(NULL);
  23.235 -	printk("\n");
  23.236 -}
  23.237 -	
  23.238 -#define MAXCOUNT 100000000
  23.239 -
  23.240 -/*
  23.241 - * I had a lockup scenario where a tight loop doing
  23.242 - * spin_unlock()/spin_lock() on CPU#1 was racing with
  23.243 - * spin_lock() on CPU#0. CPU#0 should have noticed spin_unlock(), but
  23.244 - * apparently the spin_unlock() information did not make it
  23.245 - * through to CPU#0 ... nasty, is this by design, do we have to limit
  23.246 - * 'memory update oscillation frequency' artificially like here?
  23.247 - *
  23.248 - * Such 'high frequency update' races can be avoided by careful design, but
  23.249 - * some of our major constructs like spinlocks use similar techniques,
  23.250 - * it would be nice to clarify this issue. Set this define to 0 if you
  23.251 - * want to check whether your system freezes.  I suspect the delay done
  23.252 - * by SYNC_OTHER_CORES() is in correlation with 'snooping latency', but
  23.253 - * i thought that such things are guaranteed by design, since we use
  23.254 - * the 'LOCK' prefix.
  23.255 - */
  23.256 -#define SUSPECTED_CPU_OR_CHIPSET_BUG_WORKAROUND 0
  23.257 -
  23.258 -#if SUSPECTED_CPU_OR_CHIPSET_BUG_WORKAROUND
  23.259 -# define SYNC_OTHER_CORES(x) udelay(x+1)
  23.260 -#else
  23.261 -/*
  23.262 - * We have to allow irqs to arrive between __sti and __cli
  23.263 - */
  23.264 -# define SYNC_OTHER_CORES(x) __asm__ __volatile__ ("nop")
  23.265 -#endif
  23.266 -
  23.267 -static inline void wait_on_irq(int cpu)
  23.268 -{
  23.269 -	int count = MAXCOUNT;
  23.270 -
  23.271 -	for (;;) {
  23.272 -
  23.273 -		/*
  23.274 -		 * Wait until all interrupts are gone. Wait
  23.275 -		 * for bottom half handlers unless we're
  23.276 -		 * already executing in one..
  23.277 -		 */
  23.278 -		if (!irqs_running())
  23.279 -			if (local_bh_count(cpu) || !spin_is_locked(&global_bh_lock))
  23.280 -				break;
  23.281 -
  23.282 -		/* Duh, we have to loop. Release the lock to avoid deadlocks */
  23.283 -		clear_bit(0,&global_irq_lock);
  23.284 -
  23.285 -		for (;;) {
  23.286 -			if (!--count) {
  23.287 -				show("wait_on_irq");
  23.288 -				count = ~0;
  23.289 -			}
  23.290 -			__sti();
  23.291 -			SYNC_OTHER_CORES(cpu);
  23.292 -			__cli();
  23.293 -			if (irqs_running())
  23.294 -				continue;
  23.295 -			if (global_irq_lock)
  23.296 -				continue;
  23.297 -			if (!local_bh_count(cpu) && spin_is_locked(&global_bh_lock))
  23.298 -				continue;
  23.299 -			if (!test_and_set_bit(0,&global_irq_lock))
  23.300 -				break;
  23.301 -		}
  23.302 -	}
  23.303 -}
  23.304 -
  23.305 -/*
  23.306 - * This is called when we want to synchronize with
  23.307 - * interrupts. We may for example tell a device to
  23.308 - * stop sending interrupts: but to make sure there
  23.309 - * are no interrupts that are executing on another
  23.310 - * CPU we need to call this function.
  23.311 - */
  23.312 -void synchronize_irq(void)
  23.313 -{
  23.314 -	if (irqs_running()) {
  23.315 -		/* Stupid approach */
  23.316 -		cli();
  23.317 -		sti();
  23.318 -	}
  23.319 -}
  23.320 -
  23.321 -static inline void get_irqlock(int cpu)
  23.322 -{
  23.323 -	if (test_and_set_bit(0,&global_irq_lock)) {
  23.324 -		/* do we already hold the lock? */
  23.325 -		if ((unsigned char) cpu == global_irq_holder)
  23.326 -			return;
  23.327 -		/* Uhhuh.. Somebody else got it. Wait.. */
  23.328 -		do {
  23.329 -			do {
  23.330 -				rep_nop();
  23.331 -			} while (test_bit(0,&global_irq_lock));
  23.332 -		} while (test_and_set_bit(0,&global_irq_lock));		
  23.333 -	}
  23.334 -	/* 
  23.335 -	 * We also to make sure that nobody else is running
  23.336 -	 * in an interrupt context. 
  23.337 -	 */
  23.338 -	wait_on_irq(cpu);
  23.339 -
  23.340 -	/*
  23.341 -	 * Ok, finally..
  23.342 -	 */
  23.343 -	global_irq_holder = cpu;
  23.344 -}
  23.345 -
  23.346 -/*
  23.347 - * A global "cli()" while in an interrupt context
  23.348 - * turns into just a local cli(). Interrupts
  23.349 - * should use spinlocks for the (very unlikely)
  23.350 - * case that they ever want to protect against
  23.351 - * each other.
  23.352 - *
  23.353 - * If we already have local interrupts disabled,
  23.354 - * this will not turn a local disable into a
  23.355 - * global one (problems with spinlocks: this makes
  23.356 - * save_flags+cli+sti usable inside a spinlock).
  23.357 - */
  23.358 -void __global_cli(void)
  23.359 -{
  23.360 -	unsigned int flags;
  23.361 -
  23.362 -	__save_flags(flags);
  23.363 -	if (!flags) {
  23.364 -		int cpu = smp_processor_id();
  23.365 -		__cli();
  23.366 -		if (!local_irq_count(cpu))
  23.367 -			get_irqlock(cpu);
  23.368 -	}
  23.369 -}
  23.370 -
  23.371 -void __global_sti(void)
  23.372 -{
  23.373 -	int cpu = smp_processor_id();
  23.374 -
  23.375 -	if (!local_irq_count(cpu))
  23.376 -		release_irqlock(cpu);
  23.377 -	__sti();
  23.378 -}
  23.379 -
  23.380 -/*
  23.381 - * SMP flags value to restore to:
  23.382 - * 0 - global cli
  23.383 - * 1 - global sti
  23.384 - * 2 - local cli
  23.385 - * 3 - local sti
  23.386 - */
  23.387 -unsigned long __global_save_flags(void)
  23.388 -{
  23.389 -	int retval;
  23.390 -	int local_enabled;
  23.391 -	unsigned long flags;
  23.392 -	int cpu = smp_processor_id();
  23.393 -
  23.394 -	__save_flags(flags);
  23.395 -	local_enabled = !flags;
  23.396 -	/* default to local */
  23.397 -	retval = 2 + local_enabled;
  23.398 -
  23.399 -	/* check for global flags if we're not in an interrupt */
  23.400 -	if (!local_irq_count(cpu)) {
  23.401 -		if (local_enabled)
  23.402 -			retval = 1;
  23.403 -		if (global_irq_holder == cpu)
  23.404 -			retval = 0;
  23.405 -	}
  23.406 -	return retval;
  23.407 -}
  23.408 -
  23.409 -void __global_restore_flags(unsigned long flags)
  23.410 -{
  23.411 -	switch (flags) {
  23.412 -	case 0:
  23.413 -		__global_cli();
  23.414 -		break;
  23.415 -	case 1:
  23.416 -		__global_sti();
  23.417 -		break;
  23.418 -	case 2:
  23.419 -		__cli();
  23.420 -		break;
  23.421 -	case 3:
  23.422 -		__sti();
  23.423 -		break;
  23.424 -	default:
  23.425 -		printk("global_restore_flags: %08lx (%08lx)\n",
  23.426 -			flags, (&flags)[-1]);
  23.427 -	}
  23.428 -}
  23.429 -
  23.430 -#endif
  23.431 -
  23.432 -/*
  23.433 - * This should really return information about whether
  23.434 - * we should do bottom half handling etc. Right now we
  23.435 - * end up _always_ checking the bottom half, which is a
  23.436 - * waste of time and is not what some drivers would
  23.437 - * prefer.
  23.438 - */
  23.439 -int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, struct irqaction * action)
  23.440 -{
  23.441 -	int status;
  23.442 -	int cpu = smp_processor_id();
  23.443 -
  23.444 -	irq_enter(cpu, irq);
  23.445 -
  23.446 -	status = 1;	/* Force the "do bottom halves" bit */
  23.447 -
  23.448 -	if (!(action->flags & SA_INTERRUPT))
  23.449 -		__sti();
  23.450 -
  23.451 -	do {
  23.452 -		status |= action->flags;
  23.453 -		action->handler(irq, action->dev_id, regs);
  23.454 -		action = action->next;
  23.455 -	} while (action);
  23.456 -	if (status & SA_SAMPLE_RANDOM)
  23.457 -		add_interrupt_randomness(irq);
  23.458 -	__cli();
  23.459 -
  23.460 -	irq_exit(cpu, irq);
  23.461 -
  23.462 -	return status;
  23.463 -}
  23.464 -
  23.465 -/*
  23.466 - * Generic enable/disable code: this just calls
  23.467 - * down into the PIC-specific version for the actual
  23.468 - * hardware disable after having gotten the irq
  23.469 - * controller lock. 
  23.470 - */
  23.471 - 
  23.472 -/**
  23.473 - *	disable_irq_nosync - disable an irq without waiting
  23.474 - *	@irq: Interrupt to disable
  23.475 - *
  23.476 - *	Disable the selected interrupt line.  Disables and Enables are
  23.477 - *	nested.
  23.478 - *	Unlike disable_irq(), this function does not ensure existing
  23.479 - *	instances of the IRQ handler have completed before returning.
  23.480 - *
  23.481 - *	This function may be called from IRQ context.
  23.482 - */
  23.483 - 
  23.484 -inline void disable_irq_nosync(unsigned int irq)
  23.485 -{
  23.486 -	irq_desc_t *desc = irq_desc + irq;
  23.487 -	unsigned long flags;
  23.488 -
  23.489 -	spin_lock_irqsave(&desc->lock, flags);
  23.490 -	if (!desc->depth++) {
  23.491 -		desc->status |= IRQ_DISABLED;
  23.492 -		desc->handler->disable(irq);
  23.493 -	}
  23.494 -	spin_unlock_irqrestore(&desc->lock, flags);
  23.495 -}
  23.496 -
  23.497 -/**
  23.498 - *	disable_irq - disable an irq and wait for completion
  23.499 - *	@irq: Interrupt to disable
  23.500 - *
  23.501 - *	Disable the selected interrupt line.  Enables and Disables are
  23.502 - *	nested.
  23.503 - *	This function waits for any pending IRQ handlers for this interrupt
  23.504 - *	to complete before returning. If you use this function while
  23.505 - *	holding a resource the IRQ handler may need you will deadlock.
  23.506 - *
  23.507 - *	This function may be called - with care - from IRQ context.
  23.508 - */
  23.509 - 
  23.510 -void disable_irq(unsigned int irq)
  23.511 -{
  23.512 -	disable_irq_nosync(irq);
  23.513 -
  23.514 -	if (!local_irq_count(smp_processor_id())) {
  23.515 -		do {
  23.516 -			barrier();
  23.517 -			cpu_relax();
  23.518 -		} while (irq_desc[irq].status & IRQ_INPROGRESS);
  23.519 -	}
  23.520 -}
  23.521 -
  23.522 -/**
  23.523 - *	enable_irq - enable handling of an irq
  23.524 - *	@irq: Interrupt to enable
  23.525 - *
  23.526 - *	Undoes the effect of one call to disable_irq().  If this
  23.527 - *	matches the last disable, processing of interrupts on this
  23.528 - *	IRQ line is re-enabled.
  23.529 - *
  23.530 - *	This function may be called from IRQ context.
  23.531 - */
  23.532 - 
  23.533 -void enable_irq(unsigned int irq)
  23.534 -{
  23.535 -	irq_desc_t *desc = irq_desc + irq;
  23.536 -	unsigned long flags;
  23.537 -
  23.538 -	spin_lock_irqsave(&desc->lock, flags);
  23.539 -	switch (desc->depth) {
  23.540 -	case 1: {
  23.541 -		unsigned int status = desc->status & ~IRQ_DISABLED;
  23.542 -		desc->status = status;
  23.543 -		if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
  23.544 -			desc->status = status | IRQ_REPLAY;
  23.545 -			hw_resend_irq(desc->handler,irq);
  23.546 -		}
  23.547 -		desc->handler->enable(irq);
  23.548 -		/* fall-through */
  23.549 -	}
  23.550 -	default:
  23.551 -		desc->depth--;
  23.552 -		break;
  23.553 -	case 0:
  23.554 -		printk("enable_irq(%u) unbalanced from %p\n", irq,
  23.555 -		       __builtin_return_address(0));
  23.556 -	}
  23.557 -	spin_unlock_irqrestore(&desc->lock, flags);
  23.558 -}
  23.559 -
  23.560 -/*
  23.561 - * do_IRQ handles all normal device IRQ's (the special
  23.562 - * SMP cross-CPU interrupts have their own specific
  23.563 - * handlers).
  23.564 - */
  23.565 -asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
  23.566 -{	
  23.567 -	/* 
  23.568 -	 * We ack quickly, we don't want the irq controller
  23.569 -	 * thinking we're snobs just because some other CPU has
  23.570 -	 * disabled global interrupts (we have already done the
  23.571 -	 * INT_ACK cycles, it's too late to try to pretend to the
  23.572 -	 * controller that we aren't taking the interrupt).
  23.573 -	 *
  23.574 -	 * 0 return value means that this irq is already being
  23.575 -	 * handled by some other CPU. (or is disabled)
  23.576 -	 */
  23.577 -	int irq = regs->orig_eax & 0xff; /* high bits used in ret_from_ code */
  23.578 -	int cpu = smp_processor_id();
  23.579 -	irq_desc_t *desc = irq_desc + irq;
  23.580 -	struct irqaction * action;
  23.581 -	unsigned int status;
  23.582 -#ifdef CONFIG_DEBUG_STACKOVERFLOW
  23.583 -	long esp;
  23.584 -
  23.585 -	/* Debugging check for stack overflow: is there less than 1KB free? */
  23.586 -	__asm__ __volatile__("andl %%esp,%0" : "=r" (esp) : "0" (8191));
  23.587 -	if (unlikely(esp < (sizeof(struct task_struct) + 1024))) {
  23.588 -		extern void show_stack(unsigned long *);
  23.589 -
  23.590 -		printk("do_IRQ: stack overflow: %ld\n",
  23.591 -			esp - sizeof(struct task_struct));
  23.592 -		__asm__ __volatile__("movl %%esp,%0" : "=r" (esp));
  23.593 -		show_stack((void *)esp);
  23.594 -	}
  23.595 -#endif
  23.596 -
  23.597 -	kstat.irqs[cpu][irq]++;
  23.598 -	spin_lock(&desc->lock);
  23.599 -	desc->handler->ack(irq);
  23.600 -	/*
  23.601 -	   REPLAY is when Linux resends an IRQ that was dropped earlier
  23.602 -	   WAITING is used by probe to mark irqs that are being tested
  23.603 -	   */
  23.604 -	status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING);
  23.605 -	status |= IRQ_PENDING; /* we _want_ to handle it */
  23.606 -
  23.607 -	/*
  23.608 -	 * If the IRQ is disabled for whatever reason, we cannot
  23.609 -	 * use the action we have.
  23.610 -	 */
  23.611 -	action = NULL;
  23.612 -	if (!(status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
  23.613 -		action = desc->action;
  23.614 -		status &= ~IRQ_PENDING; /* we commit to handling */
  23.615 -		status |= IRQ_INPROGRESS; /* we are handling it */
  23.616 -	}
  23.617 -	desc->status = status;
  23.618 -
  23.619 -	/*
  23.620 -	 * If there is no IRQ handler or it was disabled, exit early.
  23.621 -	   Since we set PENDING, if another processor is handling
  23.622 -	   a different instance of this same irq, the other processor
  23.623 -	   will take care of it.
  23.624 -	 */
  23.625 -	if (!action)
  23.626 -		goto out;
  23.627 -
  23.628 -	/*
  23.629 -	 * Edge triggered interrupts need to remember
  23.630 -	 * pending events.
  23.631 -	 * This applies to any hw interrupts that allow a second
  23.632 -	 * instance of the same irq to arrive while we are in do_IRQ
  23.633 -	 * or in the handler. But the code here only handles the _second_
  23.634 -	 * instance of the irq, not the third or fourth. So it is mostly
  23.635 -	 * useful for irq hardware that does not mask cleanly in an
  23.636 -	 * SMP environment.
  23.637 -	 */
  23.638 -	for (;;) {
  23.639 -		spin_unlock(&desc->lock);
  23.640 -		handle_IRQ_event(irq, regs, action);
  23.641 -		spin_lock(&desc->lock);
  23.642 -		
  23.643 -		if (!(desc->status & IRQ_PENDING))
  23.644 -			break;
  23.645 -		desc->status &= ~IRQ_PENDING;
  23.646 -	}
  23.647 -	desc->status &= ~IRQ_INPROGRESS;
  23.648 -out:
  23.649 -	/*
  23.650 -	 * The ->end() handler has to deal with interrupts which got
  23.651 -	 * disabled while the handler was running.
  23.652 -	 */
  23.653 -	desc->handler->end(irq);
  23.654 -	spin_unlock(&desc->lock);
  23.655 -
  23.656 -	if (softirq_pending(cpu))
  23.657 -		do_softirq();
  23.658 -	return 1;
  23.659 -}
  23.660 -
  23.661 -/**
  23.662 - *	request_irq - allocate an interrupt line
  23.663 - *	@irq: Interrupt line to allocate
  23.664 - *	@handler: Function to be called when the IRQ occurs
  23.665 - *	@irqflags: Interrupt type flags
  23.666 - *	@devname: An ascii name for the claiming device
  23.667 - *	@dev_id: A cookie passed back to the handler function
  23.668 - *
  23.669 - *	This call allocates interrupt resources and enables the
  23.670 - *	interrupt line and IRQ handling. From the point this
  23.671 - *	call is made your handler function may be invoked. Since
  23.672 - *	your handler function must clear any interrupt the board 
  23.673 - *	raises, you must take care both to initialise your hardware
  23.674 - *	and to set up the interrupt handler in the right order.
  23.675 - *
  23.676 - *	Dev_id must be globally unique. Normally the address of the
  23.677 - *	device data structure is used as the cookie. Since the handler
  23.678 - *	receives this value it makes sense to use it.
  23.679 - *
  23.680 - *	If your interrupt is shared you must pass a non NULL dev_id
  23.681 - *	as this is required when freeing the interrupt.
  23.682 - *
  23.683 - *	Flags:
  23.684 - *
  23.685 - *	SA_SHIRQ		Interrupt is shared
  23.686 - *
  23.687 - *	SA_INTERRUPT		Disable local interrupts while processing
  23.688 - *
  23.689 - *	SA_SAMPLE_RANDOM	The interrupt can be used for entropy
  23.690 - *
  23.691 - */
  23.692 - 
  23.693 -int request_irq(unsigned int irq, 
  23.694 -		void (*handler)(int, void *, struct pt_regs *),
  23.695 -		unsigned long irqflags, 
  23.696 -		const char * devname,
  23.697 -		void *dev_id)
  23.698 -{
  23.699 -	int retval;
  23.700 -	struct irqaction * action;
  23.701 -
  23.702 -#if 1
  23.703 -	/*
  23.704 -	 * Sanity-check: shared interrupts should REALLY pass in
  23.705 -	 * a real dev-ID, otherwise we'll have trouble later trying
  23.706 -	 * to figure out which interrupt is which (messes up the
  23.707 -	 * interrupt freeing logic etc).
  23.708 -	 */
  23.709 -	if (irqflags & SA_SHIRQ) {
  23.710 -		if (!dev_id)
  23.711 -			printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]);
  23.712 -	}
  23.713 -#endif
  23.714 -
  23.715 -	if (irq >= NR_IRQS)
  23.716 -		return -EINVAL;
  23.717 -	if (!handler)
  23.718 -		return -EINVAL;
  23.719 -
  23.720 -	action = (struct irqaction *)
  23.721 -			kmalloc(sizeof(struct irqaction), GFP_KERNEL);
  23.722 -	if (!action)
  23.723 -		return -ENOMEM;
  23.724 -
  23.725 -	action->handler = handler;
  23.726 -	action->flags = irqflags;
  23.727 -	action->mask = 0;
  23.728 -	action->name = devname;
  23.729 -	action->next = NULL;
  23.730 -	action->dev_id = dev_id;
  23.731 -
  23.732 -	retval = setup_irq(irq, action);
  23.733 -	if (retval)
  23.734 -		kfree(action);
  23.735 -	return retval;
  23.736 -}
  23.737 -
  23.738 -/*
  23.739 - * Internal function to unregister an irqaction - typically used to
  23.740 - * deallocate special interrupts that are part of the architecture.
  23.741 - */
  23.742 -int teardown_irq(unsigned int irq, struct irqaction * old)
  23.743 -{
  23.744 -	irq_desc_t *desc;
  23.745 -	struct irqaction **p;
  23.746 -	unsigned long flags;
  23.747 -
  23.748 -	if (irq >= NR_IRQS)
  23.749 -		return -ENOENT;
  23.750 -
  23.751 -	desc = irq_desc + irq;
  23.752 -	spin_lock_irqsave(&desc->lock,flags);
  23.753 -	p = &desc->action;
  23.754 -	for (;;) {
  23.755 -		struct irqaction * action = *p;
  23.756 -		if (action) {
  23.757 -			struct irqaction **pp = p;
  23.758 -			p = &action->next;
  23.759 -			if (action != old)
  23.760 -				continue;
  23.761 -
  23.762 -			/* Found it - now remove it from the list of entries */
  23.763 -			*pp = action->next;
  23.764 -			if (!desc->action) {
  23.765 -				desc->status |= IRQ_DISABLED;
  23.766 -				desc->handler->shutdown(irq);
  23.767 -			}
  23.768 -			spin_unlock_irqrestore(&desc->lock,flags);
  23.769 -
  23.770 -#ifdef CONFIG_SMP
  23.771 -			/* Wait to make sure it's not being used on another CPU */
  23.772 -			while (desc->status & IRQ_INPROGRESS) {
  23.773 -				barrier();
  23.774 -				cpu_relax();
  23.775 -			}
  23.776 -#endif
  23.777 -			return 0;
  23.778 -		}
  23.779 -		printk("Trying to free free IRQ%d\n",irq);
  23.780 -		spin_unlock_irqrestore(&desc->lock,flags);
  23.781 -		return -ENOENT;
  23.782 -	}
  23.783 -}
  23.784 -
  23.785 -/**
  23.786 - *	free_irq - free an interrupt
  23.787 - *	@irq: Interrupt line to free
  23.788 - *	@dev_id: Device identity to free
  23.789 - *
  23.790 - *	Remove an interrupt handler. The handler is removed and if the
  23.791 - *	interrupt line is no longer in use by any driver it is disabled.
  23.792 - *	On a shared IRQ the caller must ensure the interrupt is disabled
  23.793 - *	on the card it drives before calling this function. The function
  23.794 - *	does not return until any executing interrupts for this IRQ
  23.795 - *	have completed.
  23.796 - *
  23.797 - *	This function may be called from interrupt context. 
  23.798 - *
  23.799 - *	Bugs: Attempting to free an irq in a handler for the same irq hangs
  23.800 - *	      the machine.
  23.801 - */
  23.802 - 
  23.803 -void free_irq(unsigned int irq, void *dev_id)
  23.804 -{
  23.805 -	irq_desc_t *desc;
  23.806 -	struct irqaction *action;
  23.807 -	unsigned long flags;
  23.808 -
  23.809 -	if (irq >= NR_IRQS)
  23.810 -		return;
  23.811 -
  23.812 -	desc = irq_desc + irq;
  23.813 -	spin_lock_irqsave(&desc->lock,flags);
  23.814 -	for (action = desc->action; action != NULL; action = action->next) {
  23.815 -		if (action->dev_id != dev_id)
  23.816 -			continue;
  23.817 -
  23.818 -		spin_unlock_irqrestore(&desc->lock,flags);
  23.819 -
  23.820 -		if (teardown_irq(irq, action) == 0)
  23.821 -			kfree(action);
  23.822 -		return;
  23.823 -	}
  23.824 -	printk("Trying to free free IRQ%d\n",irq);
  23.825 -	spin_unlock_irqrestore(&desc->lock,flags);
  23.826 -	return;
  23.827 -}
  23.828 -
  23.829 -/*
  23.830 - * IRQ autodetection code..
  23.831 - *
  23.832 - * This depends on the fact that any interrupt that
  23.833 - * comes in on to an unassigned handler will get stuck
  23.834 - * with "IRQ_WAITING" cleared and the interrupt
  23.835 - * disabled.
  23.836 - */
  23.837 -
  23.838 -static DECLARE_MUTEX(probe_sem);
  23.839 -
  23.840 -/**
  23.841 - *	probe_irq_on	- begin an interrupt autodetect
  23.842 - *
  23.843 - *	Commence probing for an interrupt. The interrupts are scanned
  23.844 - *	and a mask of potential interrupt lines is returned.
  23.845 - *
  23.846 - */
  23.847 - 
  23.848 -unsigned long probe_irq_on(void)
  23.849 -{
  23.850 -	unsigned int i;
  23.851 -	irq_desc_t *desc;
  23.852 -	unsigned long val;
  23.853 -	unsigned long delay;
  23.854 -
  23.855 -	down(&probe_sem);
  23.856 -	/* 
  23.857 -	 * something may have generated an irq long ago and we want to
  23.858 -	 * flush such a longstanding irq before considering it as spurious. 
  23.859 -	 */
  23.860 -	for (i = NR_PIRQS-1; i > 0; i--)  {
  23.861 -		desc = irq_desc + i;
  23.862 -
  23.863 -		spin_lock_irq(&desc->lock);
  23.864 -		if (!irq_desc[i].action) 
  23.865 -			irq_desc[i].handler->startup(i);
  23.866 -		spin_unlock_irq(&desc->lock);
  23.867 -	}
  23.868 -
  23.869 -	/* Wait for longstanding interrupts to trigger. */
  23.870 -	for (delay = jiffies + HZ/50; time_after(delay, jiffies); )
  23.871 -		/* about 20ms delay */ synchronize_irq();
  23.872 -
  23.873 -	/*
  23.874 -	 * enable any unassigned irqs
  23.875 -	 * (we must startup again here because if a longstanding irq
  23.876 -	 * happened in the previous stage, it may have masked itself)
  23.877 -	 */
  23.878 -	for (i = NR_PIRQS-1; i > 0; i--) {
  23.879 -		desc = irq_desc + i;
  23.880 -
  23.881 -		spin_lock_irq(&desc->lock);
  23.882 -		if (!desc->action) {
  23.883 -			desc->status |= IRQ_AUTODETECT | IRQ_WAITING;
  23.884 -			if (desc->handler->startup(i))
  23.885 -				desc->status |= IRQ_PENDING;
  23.886 -		}
  23.887 -		spin_unlock_irq(&desc->lock);
  23.888 -	}
  23.889 -
  23.890 -	/*
  23.891 -	 * Wait for spurious interrupts to trigger
  23.892 -	 */
  23.893 -	for (delay = jiffies + HZ/10; time_after(delay, jiffies); )
  23.894 -		/* about 100ms delay */ synchronize_irq();
  23.895 -
  23.896 -	/*
  23.897 -	 * Now filter out any obviously spurious interrupts
  23.898 -	 */
  23.899 -	val = 0;
  23.900 -	for (i = 0; i < NR_PIRQS; i++) {
  23.901 -		irq_desc_t *desc = irq_desc + i;
  23.902 -		unsigned int status;
  23.903 -
  23.904 -		spin_lock_irq(&desc->lock);
  23.905 -		status = desc->status;
  23.906 -
  23.907 -		if (status & IRQ_AUTODETECT) {
  23.908 -			/* It triggered already - consider it spurious. */
  23.909 -			if (!(status & IRQ_WAITING)) {
  23.910 -				desc->status = status & ~IRQ_AUTODETECT;
  23.911 -				desc->handler->shutdown(i);
  23.912 -			} else
  23.913 -				if (i < 32)
  23.914 -					val |= 1 << i;
  23.915 -		}
  23.916 -		spin_unlock_irq(&desc->lock);
  23.917 -	}
  23.918 -
  23.919 -	return val;
  23.920 -}
  23.921 -
  23.922 -/*
  23.923 - * Return a mask of triggered interrupts (this
  23.924 - * can handle only legacy ISA interrupts).
  23.925 - */
  23.926 - 
  23.927 -/**
  23.928 - *	probe_irq_mask - scan a bitmap of interrupt lines
  23.929 - *	@val:	mask of interrupts to consider
  23.930 - *
  23.931 - *	Scan the ISA bus interrupt lines and return a bitmap of
  23.932 - *	active interrupts. The interrupt probe logic state is then
  23.933 - *	returned to its previous value.
  23.934 - *
  23.935 - *	Note: we need to scan all the irq's even though we will
  23.936 - *	only return ISA irq numbers - just so that we reset them
  23.937 - *	all to a known state.
  23.938 - */
  23.939 -unsigned int probe_irq_mask(unsigned long val)
  23.940 -{
  23.941 -	int i;
  23.942 -	unsigned int mask;
  23.943 -
  23.944 -	mask = 0;
  23.945 -	for (i = 0; i < NR_PIRQS; i++) {
  23.946 -		irq_desc_t *desc = irq_desc + i;
  23.947 -		unsigned int status;
  23.948 -
  23.949 -		spin_lock_irq(&desc->lock);
  23.950 -		status = desc->status;
  23.951 -
  23.952 -		if (status & IRQ_AUTODETECT) {
  23.953 -			if (i < 16 && !(status & IRQ_WAITING))
  23.954 -				mask |= 1 << i;
  23.955 -
  23.956 -			desc->status = status & ~IRQ_AUTODETECT;
  23.957 -			desc->handler->shutdown(i);
  23.958 -		}
  23.959 -		spin_unlock_irq(&desc->lock);
  23.960 -	}
  23.961 -	up(&probe_sem);
  23.962 -
  23.963 -	return mask & val;
  23.964 -}
  23.965 -
  23.966 -/*
  23.967 - * Return the one interrupt that triggered (this can
  23.968 - * handle any interrupt source).
  23.969 - */
  23.970 -
  23.971 -/**
  23.972 - *	probe_irq_off	- end an interrupt autodetect
  23.973 - *	@val: mask of potential interrupts (unused)
  23.974 - *
  23.975 - *	Scans the unused interrupt lines and returns the line which
  23.976 - *	appears to have triggered the interrupt. If no interrupt was
  23.977 - *	found then zero is returned. If more than one interrupt is
  23.978 - *	found then minus the first candidate is returned to indicate
  23.979 - *	their is doubt.
  23.980 - *
  23.981 - *	The interrupt probe logic state is returned to its previous
  23.982 - *	value.
  23.983 - *
  23.984 - *	BUGS: When used in a module (which arguably shouldnt happen)
  23.985 - *	nothing prevents two IRQ probe callers from overlapping. The
  23.986 - *	results of this are non-optimal.
  23.987 - */
  23.988 - 
  23.989 -int probe_irq_off(unsigned long val)
  23.990 -{
  23.991 -	int i, irq_found, nr_irqs;
  23.992 -
  23.993 -	nr_irqs = 0;
  23.994 -	irq_found = 0;
  23.995 -	for (i = 0; i < NR_PIRQS; i++) {
  23.996 -		irq_desc_t *desc = irq_desc + i;
  23.997 -		unsigned int status;
  23.998 -
  23.999 -		spin_lock_irq(&desc->lock);
 23.1000 -		status = desc->status;
 23.1001 -
 23.1002 -		if (status & IRQ_AUTODETECT) {
 23.1003 -			if (!(status & IRQ_WAITING)) {
 23.1004 -				if (!nr_irqs)
 23.1005 -					irq_found = i;
 23.1006 -				nr_irqs++;
 23.1007 -			}
 23.1008 -			desc->status = status & ~IRQ_AUTODETECT;
 23.1009 -			desc->handler->shutdown(i);
 23.1010 -		}
 23.1011 -		spin_unlock_irq(&desc->lock);
 23.1012 -	}
 23.1013 -	up(&probe_sem);
 23.1014 -
 23.1015 -	if (nr_irqs > 1)
 23.1016 -		irq_found = -irq_found;
 23.1017 -	return irq_found;
 23.1018 -}
 23.1019 -
 23.1020 -/* this was setup_x86_irq but it seems pretty generic */
 23.1021 -int setup_irq(unsigned int irq, struct irqaction * new)
 23.1022 -{
 23.1023 -	int shared = 0;
 23.1024 -	unsigned long flags;
 23.1025 -	struct irqaction *old, **p;
 23.1026 -	irq_desc_t *desc = irq_desc + irq;
 23.1027 -
 23.1028 -	/*
 23.1029 -	 * Some drivers like serial.c use request_irq() heavily,
 23.1030 -	 * so we have to be careful not to interfere with a
 23.1031 -	 * running system.
 23.1032 -	 */
 23.1033 -	if (new->flags & SA_SAMPLE_RANDOM) {
 23.1034 -		/*
 23.1035 -		 * This function might sleep, we want to call it first,
 23.1036 -		 * outside of the atomic block.
 23.1037 -		 * Yes, this might clear the entropy pool if the wrong
 23.1038 -		 * driver is attempted to be loaded, without actually
 23.1039 -		 * installing a new handler, but is this really a problem,
 23.1040 -		 * only the sysadmin is able to do this.
 23.1041 -		 */
 23.1042 -		rand_initialize_irq(irq);
 23.1043 -	}
 23.1044 -
 23.1045 -	/*
 23.1046 -	 * The following block of code has to be executed atomically
 23.1047 -	 */
 23.1048 -	spin_lock_irqsave(&desc->lock,flags);
 23.1049 -	p = &desc->action;
 23.1050 -	if ((old = *p) != NULL) {
 23.1051 -		/* Can't share interrupts unless both agree to */
 23.1052 -		if (!(old->flags & new->flags & SA_SHIRQ)) {
 23.1053 -			spin_unlock_irqrestore(&desc->lock,flags);
 23.1054 -			return -EBUSY;
 23.1055 -		}
 23.1056 -
 23.1057 -		/* add new interrupt at end of irq queue */
 23.1058 -		do {
 23.1059 -			p = &old->next;
 23.1060 -			old = *p;
 23.1061 -		} while (old);
 23.1062 -		shared = 1;
 23.1063 -	}
 23.1064 -
 23.1065 -	*p = new;
 23.1066 -
 23.1067 -	if (!shared) {
 23.1068 -		desc->depth = 0;
 23.1069 -		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
 23.1070 -		desc->handler->startup(irq);
 23.1071 -	}
 23.1072 -	spin_unlock_irqrestore(&desc->lock,flags);
 23.1073 -
 23.1074 -	register_irq_proc(irq);
 23.1075 -	return 0;
 23.1076 -}
 23.1077 -
 23.1078 -static struct proc_dir_entry * root_irq_dir;
 23.1079 -static struct proc_dir_entry * irq_dir [NR_IRQS];
 23.1080 -
 23.1081 -#define HEX_DIGITS 8
 23.1082 -
 23.1083 -static unsigned int parse_hex_value (const char *buffer,
 23.1084 -		unsigned long count, unsigned long *ret)
 23.1085 -{
 23.1086 -	unsigned char hexnum [HEX_DIGITS];
 23.1087 -	unsigned long value;
 23.1088 -	int i;
 23.1089 -
 23.1090 -	if (!count)
 23.1091 -		return -EINVAL;
 23.1092 -	if (count > HEX_DIGITS)
 23.1093 -		count = HEX_DIGITS;
 23.1094 -	if (copy_from_user(hexnum, buffer, count))
 23.1095 -		return -EFAULT;
 23.1096 -
 23.1097 -	/*
 23.1098 -	 * Parse the first 8 characters as a hex string, any non-hex char
 23.1099 -	 * is end-of-string. '00e1', 'e1', '00E1', 'E1' are all the same.
 23.1100 -	 */
 23.1101 -	value = 0;
 23.1102 -
 23.1103 -	for (i = 0; i < count; i++) {
 23.1104 -		unsigned int c = hexnum[i];
 23.1105 -
 23.1106 -		switch (c) {
 23.1107 -			case '0' ... '9': c -= '0'; break;
 23.1108 -			case 'a' ... 'f': c -= 'a'-10; break;
 23.1109 -			case 'A' ... 'F': c -= 'A'-10; break;
 23.1110 -		default:
 23.1111 -			goto out;
 23.1112 -		}
 23.1113 -		value = (value << 4) | c;
 23.1114 -	}
 23.1115 -out:
 23.1116 -	*ret = value;
 23.1117 -	return 0;
 23.1118 -}
 23.1119 -
 23.1120 -#if CONFIG_SMP
 23.1121 -
 23.1122 -static struct proc_dir_entry * smp_affinity_entry [NR_IRQS];
 23.1123 -
 23.1124 -static unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL };
 23.1125 -static int irq_affinity_read_proc (char *page, char **start, off_t off,
 23.1126 -			int count, int *eof, void *data)
 23.1127 -{
 23.1128 -	if (count < HEX_DIGITS+1)
 23.1129 -		return -EINVAL;
 23.1130 -	return sprintf (page, "%08lx\n", irq_affinity[(long)data]);
 23.1131 -}
 23.1132 -
 23.1133 -static int irq_affinity_write_proc (struct file *file, const char *buffer,
 23.1134 -					unsigned long count, void *data)
 23.1135 -{
 23.1136 -	int irq = (long) data, full_count = count, err;
 23.1137 -	unsigned long new_value;
 23.1138 -
 23.1139 -	if (!irq_desc[irq].handler->set_affinity)
 23.1140 -		return -EIO;
 23.1141 -
 23.1142 -	err = parse_hex_value(buffer, count, &new_value);
 23.1143 -
 23.1144 -	/*
 23.1145 -	 * Do not allow disabling IRQs completely - it's a too easy
 23.1146 -	 * way to make the system unusable accidentally :-) At least
 23.1147 -	 * one online CPU still has to be targeted.
 23.1148 -	 */
 23.1149 -	if (!(new_value & cpu_online_map))
 23.1150 -		return -EINVAL;
 23.1151 -
 23.1152 -	irq_affinity[irq] = new_value;
 23.1153 -	irq_desc[irq].handler->set_affinity(irq, new_value);
 23.1154 -
 23.1155 -	return full_count;
 23.1156 -}
 23.1157 -
 23.1158 -#endif
 23.1159 -
 23.1160 -static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
 23.1161 -			int count, int *eof, void *data)
 23.1162 -{
 23.1163 -	unsigned long *mask = (unsigned long *) data;
 23.1164 -	if (count < HEX_DIGITS+1)
 23.1165 -		return -EINVAL;
 23.1166 -	return sprintf (page, "%08lx\n", *mask);
 23.1167 -}
 23.1168 -
 23.1169 -static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
 23.1170 -					unsigned long count, void *data)
 23.1171 -{
 23.1172 -	unsigned long *mask = (unsigned long *) data, full_count = count, err;
 23.1173 -	unsigned long new_value;
 23.1174 -
 23.1175 -	err = parse_hex_value(buffer, count, &new_value);
 23.1176 -	if (err)
 23.1177 -		return err;
 23.1178 -
 23.1179 -	*mask = new_value;
 23.1180 -	return full_count;
 23.1181 -}
 23.1182 -
 23.1183 -#define MAX_NAMELEN 10
 23.1184 -
 23.1185 -static void register_irq_proc (unsigned int irq)
 23.1186 -{
 23.1187 -	char name [MAX_NAMELEN];
 23.1188 -
 23.1189 -	if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
 23.1190 -			irq_dir[irq])
 23.1191 -		return;
 23.1192 -
 23.1193 -	memset(name, 0, MAX_NAMELEN);
 23.1194 -	sprintf(name, "%d", irq);
 23.1195 -
 23.1196 -	/* create /proc/irq/1234 */
 23.1197 -	irq_dir[irq] = proc_mkdir(name, root_irq_dir);
 23.1198 -
 23.1199 -#if CONFIG_SMP
 23.1200 -	{
 23.1201 -		struct proc_dir_entry *entry;
 23.1202 -
 23.1203 -		/* create /proc/irq/1234/smp_affinity */
 23.1204 -		entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
 23.1205 -
 23.1206 -		if (entry) {
 23.1207 -			entry->nlink = 1;
 23.1208 -			entry->data = (void *)(long)irq;
 23.1209 -			entry->read_proc = irq_affinity_read_proc;
 23.1210 -			entry->write_proc = irq_affinity_write_proc;
 23.1211 -		}
 23.1212 -
 23.1213 -		smp_affinity_entry[irq] = entry;
 23.1214 -	}
 23.1215 -#endif
 23.1216 -}
 23.1217 -
 23.1218 -unsigned long prof_cpu_mask = -1;
 23.1219 -
 23.1220 -void init_irq_proc (void)
 23.1221 -{
 23.1222 -	struct proc_dir_entry *entry;
 23.1223 -	int i;
 23.1224 -
 23.1225 -	/* create /proc/irq */
 23.1226 -	root_irq_dir = proc_mkdir("irq", 0);
 23.1227 -
 23.1228 -	/* create /proc/irq/prof_cpu_mask */
 23.1229 -	entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
 23.1230 -
 23.1231 -	if (!entry)
 23.1232 -	    return;
 23.1233 -
 23.1234 -	entry->nlink = 1;
 23.1235 -	entry->data = (void *)&prof_cpu_mask;
 23.1236 -	entry->read_proc = prof_cpu_mask_read_proc;
 23.1237 -	entry->write_proc = prof_cpu_mask_write_proc;
 23.1238 -
 23.1239 -	/*
 23.1240 -	 * Create entries for all existing IRQs.
 23.1241 -	 */
 23.1242 -	for (i = 0; i < NR_IRQS; i++)
 23.1243 -		register_irq_proc(i);
 23.1244 -}
 23.1245 -
    24.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/ldt.c	Mon Jul 11 14:48:47 2005 +0000
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,272 +0,0 @@
    24.4 -/*
    24.5 - * linux/kernel/ldt.c
    24.6 - *
    24.7 - * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds
    24.8 - * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
    24.9 - */
   24.10 -
   24.11 -#include <linux/errno.h>
   24.12 -#include <linux/sched.h>
   24.13 -#include <linux/string.h>
   24.14 -#include <linux/mm.h>
   24.15 -#include <linux/smp.h>
   24.16 -#include <linux/smp_lock.h>
   24.17 -#include <linux/vmalloc.h>
   24.18 -#include <linux/slab.h>
   24.19 -
   24.20 -#include <asm/mmu_context.h>
   24.21 -#include <asm/uaccess.h>
   24.22 -#include <asm/system.h>
   24.23 -#include <asm/ldt.h>
   24.24 -#include <asm/desc.h>
   24.25 -
   24.26 -#ifdef CONFIG_SMP /* avoids "defined but not used" warnig */
   24.27 -static void flush_ldt(void *mm)
   24.28 -{
   24.29 -	if (current->active_mm)
   24.30 -		load_LDT(&current->active_mm->context);
   24.31 -}
   24.32 -#endif
   24.33 -
   24.34 -static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
   24.35 -{
   24.36 -	void *oldldt;
   24.37 -	void *newldt;
   24.38 -	int oldsize;
   24.39 -
   24.40 -	if (mincount <= pc->size)
   24.41 -		return 0;
   24.42 -	oldsize = pc->size;
   24.43 -	mincount = (mincount+511)&(~511);
   24.44 -	if (mincount*LDT_ENTRY_SIZE > PAGE_SIZE)
   24.45 -		newldt = vmalloc(mincount*LDT_ENTRY_SIZE);
   24.46 -	else
   24.47 -		newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL);
   24.48 -
   24.49 -	if (!newldt)
   24.50 -		return -ENOMEM;
   24.51 -
   24.52 -	if (oldsize)
   24.53 -		memcpy(newldt, pc->ldt, oldsize*LDT_ENTRY_SIZE);
   24.54 -
   24.55 -	oldldt = pc->ldt;
   24.56 -	memset(newldt+oldsize*LDT_ENTRY_SIZE, 0, (mincount-oldsize)*LDT_ENTRY_SIZE);
   24.57 -	wmb();
   24.58 -	pc->ldt = newldt;
   24.59 -	pc->size = mincount;
   24.60 -	if (reload) {
   24.61 -		make_pages_readonly(
   24.62 -			pc->ldt,
   24.63 -			(pc->size*LDT_ENTRY_SIZE)/PAGE_SIZE);
   24.64 -		load_LDT(pc);
   24.65 -#ifdef CONFIG_SMP
   24.66 -		if (current->mm->cpu_vm_mask != (1<<smp_processor_id()))
   24.67 -			smp_call_function(flush_ldt, 0, 1, 1);
   24.68 -#endif
   24.69 -	}
   24.70 -	wmb();
   24.71 -	if (oldsize) {
   24.72 -		make_pages_writable(
   24.73 -			oldldt, (oldsize*LDT_ENTRY_SIZE)/PAGE_SIZE);
   24.74 -		if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
   24.75 -			vfree(oldldt);
   24.76 -		else
   24.77 -			kfree(oldldt);
   24.78 -	}
   24.79 -	return 0;
   24.80 -}
   24.81 -
   24.82 -static inline int copy_ldt(mm_context_t *new, mm_context_t *old)
   24.83 -{
   24.84 -	int err = alloc_ldt(new, old->size, 0);
   24.85 -	if (err < 0) {
   24.86 -		printk(KERN_WARNING "ldt allocation failed\n");
   24.87 -		new->size = 0;
   24.88 -		return err;
   24.89 -	}
   24.90 -	memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
   24.91 -	make_pages_readonly(new->ldt, (new->size*LDT_ENTRY_SIZE)/PAGE_SIZE);
   24.92 -	return 0;
   24.93 -}
   24.94 -
   24.95 -/*
   24.96 - * we do not have to muck with descriptors here, that is
   24.97 - * done in switch_mm() as needed.
   24.98 - */
   24.99 -int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
  24.100 -{
  24.101 -	struct mm_struct * old_mm;
  24.102 -	int retval = 0;
  24.103 -
  24.104 -	init_MUTEX(&mm->context.sem);
  24.105 -	mm->context.size = 0;
  24.106 -	old_mm = current->mm;
  24.107 -	if (old_mm && old_mm->context.size > 0) {
  24.108 -		down(&old_mm->context.sem);
  24.109 -		retval = copy_ldt(&mm->context, &old_mm->context);
  24.110 -		up(&old_mm->context.sem);
  24.111 -	}
  24.112 -	return retval;
  24.113 -}
  24.114 -
  24.115 -/*
  24.116 - * No need to lock the MM as we are the last user
  24.117 - * Do not touch the ldt register, we are already
  24.118 - * in the next thread.
  24.119 - */
  24.120 -void destroy_context(struct mm_struct *mm)
  24.121 -{
  24.122 -	if (mm->context.size) {
  24.123 -		make_pages_writable(
  24.124 -			mm->context.ldt, 
  24.125 -			(mm->context.size*LDT_ENTRY_SIZE)/PAGE_SIZE);
  24.126 -		if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
  24.127 -			vfree(mm->context.ldt);
  24.128 -		else
  24.129 -			kfree(mm->context.ldt);
  24.130 -		mm->context.size = 0;
  24.131 -	}
  24.132 -}
  24.133 -
  24.134 -static int read_ldt(void * ptr, unsigned long bytecount)
  24.135 -{
  24.136 -	int err;
  24.137 -	unsigned long size;
  24.138 -	struct mm_struct * mm = current->mm;
  24.139 -
  24.140 -	if (!mm->context.size)
  24.141 -		return 0;
  24.142 -	if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES)
  24.143 -		bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES;
  24.144 -
  24.145 -	down(&mm->context.sem);
  24.146 -	size = mm->context.size*LDT_ENTRY_SIZE;
  24.147 -	if (size > bytecount)
  24.148 -		size = bytecount;
  24.149 -
  24.150 -	err = 0;
  24.151 -	if (copy_to_user(ptr, mm->context.ldt, size))
  24.152 -		err = -EFAULT;
  24.153 -	up(&mm->context.sem);
  24.154 -	if (err < 0)
  24.155 -		return err;
  24.156 -	if (size != bytecount) {
  24.157 -		/* zero-fill the rest */
  24.158 -		clear_user(ptr+size, bytecount-size);
  24.159 -	}
  24.160 -	return bytecount;
  24.161 -}
  24.162 -
  24.163 -static int read_default_ldt(void * ptr, unsigned long bytecount)
  24.164 -{
  24.165 -	int err;
  24.166 -	unsigned long size;
  24.167 -	void *address;
  24.168 -
  24.169 -	err = 0;
  24.170 -	address = &default_ldt[0];
  24.171 -	size = 5*sizeof(struct desc_struct);
  24.172 -	if (size > bytecount)
  24.173 -		size = bytecount;
  24.174 -
  24.175 -	err = size;
  24.176 -	if (copy_to_user(ptr, address, size))
  24.177 -		err = -EFAULT;
  24.178 -
  24.179 -	return err;
  24.180 -}
  24.181 -
  24.182 -static int write_ldt(void * ptr, unsigned long bytecount, int oldmode)
  24.183 -{
  24.184 -	struct mm_struct * mm = current->mm;
  24.185 -	__u32 entry_1, entry_2, *lp;
  24.186 -	unsigned long mach_lp;
  24.187 -	int error;
  24.188 -	struct modify_ldt_ldt_s ldt_info;
  24.189 -
  24.190 -	error = -EINVAL;
  24.191 -	if (bytecount != sizeof(ldt_info))
  24.192 -		goto out;
  24.193 -	error = -EFAULT; 	
  24.194 -	if (copy_from_user(&ldt_info, ptr, sizeof(ldt_info)))
  24.195 -		goto out;
  24.196 -
  24.197 -	error = -EINVAL;
  24.198 -	if (ldt_info.entry_number >= LDT_ENTRIES)
  24.199 -		goto out;
  24.200 -	if (ldt_info.contents == 3) {
  24.201 -		if (oldmode)
  24.202 -			goto out;
  24.203 -		if (ldt_info.seg_not_present == 0)
  24.204 -			goto out;
  24.205 -	}
  24.206 -
  24.207 -	down(&mm->context.sem);
  24.208 -	if (ldt_info.entry_number >= mm->context.size) {
  24.209 -		error = alloc_ldt(&current->mm->context, ldt_info.entry_number+1, 1);
  24.210 -		if (error < 0)
  24.211 -			goto out_unlock;
  24.212 -	}
  24.213 -
  24.214 -	lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->context.ldt);
  24.215 -	mach_lp = arbitrary_virt_to_machine(lp);
  24.216 -
  24.217 -   	/* Allow LDTs to be cleared by the user. */
  24.218 -   	if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
  24.219 -		if (oldmode ||
  24.220 -		    (ldt_info.contents == 0		&&
  24.221 -		     ldt_info.read_exec_only == 1	&&
  24.222 -		     ldt_info.seg_32bit == 0		&&
  24.223 -		     ldt_info.limit_in_pages == 0	&&
  24.224 -		     ldt_info.seg_not_present == 1	&&
  24.225 -		     ldt_info.useable == 0 )) {
  24.226 -			entry_1 = 0;
  24.227 -			entry_2 = 0;
  24.228 -			goto install;
  24.229 -		}
  24.230 -	}
  24.231 -
  24.232 -	entry_1 = ((ldt_info.base_addr & 0x0000ffff) << 16) |
  24.233 -		  (ldt_info.limit & 0x0ffff);
  24.234 -	entry_2 = (ldt_info.base_addr & 0xff000000) |
  24.235 -		  ((ldt_info.base_addr & 0x00ff0000) >> 16) |
  24.236 -		  (ldt_info.limit & 0xf0000) |
  24.237 -		  ((ldt_info.read_exec_only ^ 1) << 9) |
  24.238 -		  (ldt_info.contents << 10) |
  24.239 -		  ((ldt_info.seg_not_present ^ 1) << 15) |
  24.240 -		  (ldt_info.seg_32bit << 22) |
  24.241 -		  (ldt_info.limit_in_pages << 23) |
  24.242 -		  0x7000;
  24.243 -	if (!oldmode)
  24.244 -		entry_2 |= (ldt_info.useable << 20);
  24.245 -
  24.246 -	/* Install the new entry ...  */
  24.247 -install:
  24.248 -	error = HYPERVISOR_update_descriptor(mach_lp, entry_1, entry_2);
  24.249 -
  24.250 -out_unlock:
  24.251 -	up(&mm->context.sem);
  24.252 -out:
  24.253 -	return error;
  24.254 -}
  24.255 -
  24.256 -asmlinkage int sys_modify_ldt(int func, void *ptr, unsigned long bytecount)
  24.257 -{
  24.258 -	int ret = -ENOSYS;
  24.259 -
  24.260 -	switch (func) {
  24.261 -	case 0:
  24.262 -		ret = read_ldt(ptr, bytecount);
  24.263 -		break;
  24.264 -	case 1:
  24.265 -		ret = write_ldt(ptr, bytecount, 1);
  24.266 -		break;
  24.267 -	case 2:
  24.268 -		ret = read_default_ldt(ptr, bytecount);
  24.269 -		break;
  24.270 -	case 0x11:
  24.271 -		ret = write_ldt(ptr, bytecount, 0);
  24.272 -		break;
  24.273 -	}
  24.274 -	return ret;
  24.275 -}
    25.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/pci-pc.c	Mon Jul 11 14:48:47 2005 +0000
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,260 +0,0 @@
    25.4 -/*
    25.5 - *	Low-Level PCI Support for PC
    25.6 - *
    25.7 - *	(c) 1999--2000 Martin Mares <mj@ucw.cz>
    25.8 - *
    25.9 - * Adjusted to use Xen's interface by Rolf Neugebauer, Intel Research Cambridge
   25.10 - * Further modifications by Keir Fraser, University of Cambridge
   25.11 - */
   25.12 -
   25.13 -#include <linux/config.h>
   25.14 -#include <linux/types.h>
   25.15 -#include <linux/kernel.h>
   25.16 -#include <linux/sched.h>
   25.17 -#include <linux/pci.h>
   25.18 -#include <linux/init.h>
   25.19 -#include <linux/ioport.h>
   25.20 -
   25.21 -#include <asm/segment.h>
   25.22 -#include <asm/io.h>
   25.23 -
   25.24 -#include <asm-xen/xen-public/xen.h>
   25.25 -#include <asm-xen/xen-public/physdev.h>
   25.26 -
   25.27 -#include "pci-i386.h"
   25.28 -
   25.29 -/*
   25.30 - * NB. The following interface functions are not included here:
   25.31 - *  1. void eisa_set_level_irq(unsigned int irq)
   25.32 - *  2. irq_routing_table * __devinit pcibios_get_irq_routing_table(void)
   25.33 - *  3. int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
   25.34 - * All are used by the ACPI driver. This should be ported to Xen if it is
   25.35 - * ever required -- Xen is the ultimate source for IRQ-routing knowledge.
   25.36 - */
   25.37 -
   25.38 -struct pci_ops *pci_root_ops = NULL;
   25.39 -
   25.40 -int (*pci_config_read)(int seg, int bus, int dev, int fn, 
   25.41 -                       int reg, int len, u32 *value) = NULL;
   25.42 -int (*pci_config_write)(int seg, int bus, int dev, int fn,
   25.43 -                        int reg, int len, u32 value) = NULL;
   25.44 -
   25.45 -unsigned int pci_probe = PCI_PROBE_BIOS;
   25.46 -
   25.47 -struct pci_fixup pcibios_fixups[] = { { 0 } };
   25.48 -
   25.49 -static int pci_confx_read(int seg, int bus, int dev, int fn, int reg, 
   25.50 -                          int len, u32 *value)
   25.51 -{
   25.52 -    int ret;
   25.53 -    physdev_op_t op;
   25.54 -
   25.55 -    if (bus > 255 || dev > 31 || fn > 7 || reg > 255)
   25.56 -        return -EINVAL;
   25.57 -
   25.58 -    op.cmd = PHYSDEVOP_PCI_CFGREG_READ;
   25.59 -    op.u.pci_cfgreg_read.bus  = bus;
   25.60 -    op.u.pci_cfgreg_read.dev  = dev;
   25.61 -    op.u.pci_cfgreg_read.func = fn;
   25.62 -    op.u.pci_cfgreg_read.reg  = reg;
   25.63 -    op.u.pci_cfgreg_read.len  = len;
   25.64 -
   25.65 -    if ( (ret = HYPERVISOR_physdev_op(&op)) != 0 )
   25.66 -        return ret;
   25.67 -
   25.68 -    *value = op.u.pci_cfgreg_read.value;
   25.69 -
   25.70 -    return 0;
   25.71 -}
   25.72 -
   25.73 -static int pci_confx_write(int seg, int bus, int dev, int fn, int reg, 
   25.74 -                           int len, u32 value)
   25.75 -{
   25.76 -    int ret;
   25.77 -    physdev_op_t op;
   25.78 -
   25.79 -    if ((bus > 255 || dev > 31 || fn > 7 || reg > 255)) 
   25.80 -        return -EINVAL;
   25.81 -
   25.82 -    op.cmd = PHYSDEVOP_PCI_CFGREG_WRITE;
   25.83 -    op.u.pci_cfgreg_write.bus   = bus;
   25.84 -    op.u.pci_cfgreg_write.dev   = dev;
   25.85 -    op.u.pci_cfgreg_write.func  = fn;
   25.86 -    op.u.pci_cfgreg_write.reg   = reg;
   25.87 -    op.u.pci_cfgreg_write.len   = len;
   25.88 -    op.u.pci_cfgreg_write.value = value;
   25.89 -
   25.90 -    if ( (ret = HYPERVISOR_physdev_op(&op)) != 0 )
   25.91 -        return ret;
   25.92 -    return 0;
   25.93 -}
   25.94 -
   25.95 -
   25.96 -static int pci_confx_read_config_byte(struct pci_dev *dev, 
   25.97 -                                      int where, u8 *value)
   25.98 -{
   25.99 -    int result; 
  25.100 -    u32 data;
  25.101 -
  25.102 -    result = pci_confx_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
  25.103 -                            PCI_FUNC(dev->devfn), where, 1, &data);
  25.104 -
  25.105 -    *value = (u8)data;
  25.106 -
  25.107 -    return result;
  25.108 -}
  25.109 -
  25.110 -static int pci_confx_read_config_word(struct pci_dev *dev, 
  25.111 -                                      int where, u16 *value)
  25.112 -{
  25.113 -    int result; 
  25.114 -    u32 data;
  25.115 -
  25.116 -    result = pci_confx_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
  25.117 -                            PCI_FUNC(dev->devfn), where, 2, &data);
  25.118 -
  25.119 -    *value = (u16)data;
  25.120 -
  25.121 -    return result;
  25.122 -}
  25.123 -
  25.124 -static int pci_confx_read_config_dword(struct pci_dev *dev, 
  25.125 -                                       int where, u32 *value)
  25.126 -{
  25.127 -    return pci_confx_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
  25.128 -                          PCI_FUNC(dev->devfn), where, 4, value);
  25.129 -}
  25.130 -
  25.131 -static int pci_confx_write_config_byte(struct pci_dev *dev, 
  25.132 -                                       int where, u8 value)
  25.133 -{
  25.134 -    return pci_confx_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
  25.135 -                           PCI_FUNC(dev->devfn), where, 1, value);
  25.136 -}
  25.137 -
  25.138 -static int pci_confx_write_config_word(struct pci_dev *dev, 
  25.139 -                                       int where, u16 value)
  25.140 -{
  25.141 -    return pci_confx_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
  25.142 -                           PCI_FUNC(dev->devfn), where, 2, value);
  25.143 -}
  25.144 -
  25.145 -static int pci_confx_write_config_dword(struct pci_dev *dev, 
  25.146 -                                        int where, u32 value)
  25.147 -{
  25.148 -    return pci_confx_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
  25.149 -                           PCI_FUNC(dev->devfn), where, 4, value);
  25.150 -}
  25.151 -
  25.152 -static struct pci_ops pci_conf_xen = {
  25.153 -    pci_confx_read_config_byte,
  25.154 -    pci_confx_read_config_word,
  25.155 -    pci_confx_read_config_dword,
  25.156 -    pci_confx_write_config_byte,
  25.157 -    pci_confx_write_config_word,
  25.158 -    pci_confx_write_config_dword
  25.159 -};
  25.160 -
  25.161 -void pcibios_penalize_isa_irq(int irq)
  25.162 -{ 
  25.163 -    /* nothing */
  25.164 -}
  25.165 -
  25.166 -void __devinit pcibios_fixup_bus(struct pci_bus *b)
  25.167 -{
  25.168 -    pci_read_bridge_bases(b);
  25.169 -}
  25.170 -
  25.171 -struct pci_bus * __devinit pcibios_scan_root(int busnum)
  25.172 -{
  25.173 -    struct list_head *list;
  25.174 -    struct pci_bus *bus;
  25.175 -
  25.176 -    list_for_each ( list, &pci_root_buses )
  25.177 -    {
  25.178 -        bus = pci_bus_b(list);
  25.179 -        if ( bus->number == busnum )
  25.180 -            return bus;
  25.181 -    }
  25.182 -
  25.183 -    printk("PCI: Probing PCI hardware (bus %02x)\n", busnum);
  25.184 -    return pci_scan_bus(busnum, pci_root_ops, NULL);
  25.185 -}
  25.186 -
  25.187 -void __init pcibios_init(void)
  25.188 -{
  25.189 -    int bus;
  25.190 -    physdev_op_t op;
  25.191 -
  25.192 -    if ( !pci_probe )
  25.193 -        return;
  25.194 -
  25.195 -    pci_root_ops     = &pci_conf_xen;
  25.196 -    pci_config_read  = pci_confx_read;
  25.197 -    pci_config_write = pci_confx_write;
  25.198 -
  25.199 -    pcibios_set_cacheline_size();
  25.200 -
  25.201 -    op.cmd = PHYSDEVOP_PCI_PROBE_ROOT_BUSES;
  25.202 -    if ( HYPERVISOR_physdev_op(&op) != 0 )
  25.203 -    {
  25.204 -        printk(KERN_WARNING "PCI: System does not support PCI\n");
  25.205 -        return;
  25.206 -    }
  25.207 -
  25.208 -    printk(KERN_INFO "PCI: Probing PCI hardware\n");
  25.209 -    for ( bus = 0; bus < 256; bus++ )
  25.210 -        if ( test_bit(bus, &op.u.pci_probe_root_buses.busmask[0]) )
  25.211 -            (void)pcibios_scan_root(bus);
  25.212 -
  25.213 -    pcibios_resource_survey();
  25.214 -}
  25.215 -
  25.216 -char * __devinit pcibios_setup(char *str)
  25.217 -{
  25.218 -    if ( !strcmp(str, "off") )
  25.219 -        pci_probe = 0;
  25.220 -    return NULL;
  25.221 -}
  25.222 -
  25.223 -unsigned int pcibios_assign_all_busses(void)
  25.224 -{
  25.225 -    return 0;
  25.226 -}
  25.227 -
  25.228 -int pcibios_enable_device(struct pci_dev *dev, int mask)
  25.229 -{
  25.230 -    int err;
  25.231 -    u8  pin;
  25.232 -    physdev_op_t op;
  25.233 -
  25.234 -    /* Inform Xen that we are going to use this device. */
  25.235 -    op.cmd = PHYSDEVOP_PCI_INITIALISE_DEVICE;
  25.236 -    op.u.pci_initialise_device.bus  = dev->bus->number;
  25.237 -    op.u.pci_initialise_device.dev  = PCI_SLOT(dev->devfn);
  25.238 -    op.u.pci_initialise_device.func = PCI_FUNC(dev->devfn);
  25.239 -    if ( (err = HYPERVISOR_physdev_op(&op)) != 0 )
  25.240 -        return err;
  25.241 -
  25.242 -    /* Now we can bind to the very final IRQ line. */
  25.243 -    pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &pin);
  25.244 -    dev->irq = pin;
  25.245 -
  25.246 -    /* Turn on device I/O and memory access as necessary. */
  25.247 -    if ( (err = pcibios_enable_resources(dev, mask)) < 0 )
  25.248 -        return err;
  25.249 -
  25.250 -    /* Sanity-check that an interrupt-producing device is routed to an IRQ. */
  25.251 -    pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
  25.252 -    if ( pin != 0 )
  25.253 -    {
  25.254 -        if ( dev->irq != 0 )
  25.255 -            printk(KERN_INFO "PCI: Obtained IRQ %d for device %s\n",
  25.256 -                   dev->irq, dev->slot_name);
  25.257 -        else
  25.258 -            printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of "
  25.259 -                   "device %s.\n", 'A' + pin - 1, dev->slot_name);
  25.260 -    }
  25.261 -
  25.262 -    return 0;
  25.263 -}
    26.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/process.c	Mon Jul 11 14:48:47 2005 +0000
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,448 +0,0 @@
    26.4 -/*
    26.5 - *  linux/arch/i386/kernel/process.c
    26.6 - *
    26.7 - *  Copyright (C) 1995  Linus Torvalds
    26.8 - *
    26.9 - *  Pentium III FXSR, SSE support
   26.10 - *	Gareth Hughes <gareth@valinux.com>, May 2000
   26.11 - */
   26.12 -
   26.13 -/*
   26.14 - * This file handles the architecture-dependent parts of process handling..
   26.15 - */
   26.16 -
   26.17 -#define __KERNEL_SYSCALLS__
   26.18 -#include <stdarg.h>
   26.19 -
   26.20 -#include <linux/errno.h>
   26.21 -#include <linux/sched.h>
   26.22 -#include <linux/kernel.h>
   26.23 -#include <linux/mm.h>
   26.24 -#include <linux/smp.h>
   26.25 -#include <linux/smp_lock.h>
   26.26 -#include <linux/stddef.h>
   26.27 -#include <linux/unistd.h>
   26.28 -#include <linux/ptrace.h>
   26.29 -#include <linux/slab.h>
   26.30 -#include <linux/vmalloc.h>
   26.31 -#include <linux/user.h>
   26.32 -#include <linux/a.out.h>
   26.33 -#include <linux/interrupt.h>
   26.34 -#include <linux/config.h>
   26.35 -#include <linux/delay.h>
   26.36 -#include <linux/reboot.h>
   26.37 -#include <linux/init.h>
   26.38 -#include <linux/mc146818rtc.h>
   26.39 -
   26.40 -#include <asm/uaccess.h>
   26.41 -#include <asm/pgtable.h>
   26.42 -#include <asm/system.h>
   26.43 -#include <asm/io.h>
   26.44 -#include <asm/ldt.h>
   26.45 -#include <asm/processor.h>
   26.46 -#include <asm/i387.h>
   26.47 -#include <asm/desc.h>
   26.48 -#include <asm/mmu_context.h>
   26.49 -#include <asm-xen/xen-public/physdev.h>
   26.50 -
   26.51 -#include <linux/irq.h>
   26.52 -
   26.53 -asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
   26.54 -
   26.55 -int hlt_counter;
   26.56 -
   26.57 -/*
   26.58 - * Powermanagement idle function, if any..
   26.59 - */
   26.60 -void (*pm_idle)(void);
   26.61 -
   26.62 -/*
   26.63 - * Power off function, if any
   26.64 - */
   26.65 -void (*pm_power_off)(void);
   26.66 -
   26.67 -void disable_hlt(void)
   26.68 -{
   26.69 -    hlt_counter++;
   26.70 -}
   26.71 -
   26.72 -void enable_hlt(void)
   26.73 -{
   26.74 -    hlt_counter--;
   26.75 -}
   26.76 -
   26.77 -/*
   26.78 - * The idle thread. There's no useful work to be
   26.79 - * done, so just try to conserve power and have a
   26.80 - * low exit latency (ie sit in a loop waiting for
   26.81 - * somebody to say that they'd like to reschedule)
   26.82 - */
   26.83 -void cpu_idle (void)
   26.84 -{
   26.85 -    extern int set_timeout_timer(void);
   26.86 -
   26.87 -    /* Endless idle loop with no priority at all. */
   26.88 -    init_idle();
   26.89 -    current->nice = 20;
   26.90 -    current->counter = -100;
   26.91 -
   26.92 -    for ( ; ; )
   26.93 -    {
   26.94 -        while ( !current->need_resched )
   26.95 -        {
   26.96 -            __cli();
   26.97 -            if ( current->need_resched )
   26.98 -            {
   26.99 -                /* The race-free check for events failed. */
  26.100 -                __sti();
  26.101 -                break;
  26.102 -            }
  26.103 -            else if ( set_timeout_timer() == 0 )
  26.104 -            {
  26.105 -                /* NB. Blocking reenable events in a race-free manner. */
  26.106 -                HYPERVISOR_block();
  26.107 -            }
  26.108 -            else
  26.109 -            {
  26.110 -                /* No race here: yielding will get us the CPU again anyway. */
  26.111 -                __sti();
  26.112 -                HYPERVISOR_yield();
  26.113 -            }
  26.114 -        }
  26.115 -        schedule();
  26.116 -        check_pgt_cache();
  26.117 -    }
  26.118 -}
  26.119 -
  26.120 -extern void show_trace(unsigned long* esp);
  26.121 -
  26.122 -void show_regs(struct pt_regs * regs)
  26.123 -{
  26.124 -    printk("\n");
  26.125 -    printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
  26.126 -    printk("EIP: %04x:[<%08lx>] CPU: %d",0xffff & regs->xcs,regs->eip, smp_processor_id());
  26.127 -    if (regs->xcs & 2)
  26.128 -        printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
  26.129 -    printk(" EFLAGS: %08lx    %s\n",regs->eflags, print_tainted());
  26.130 -    printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
  26.131 -           regs->eax,regs->ebx,regs->ecx,regs->edx);
  26.132 -    printk("ESI: %08lx EDI: %08lx EBP: %08lx",
  26.133 -           regs->esi, regs->edi, regs->ebp);
  26.134 -    printk(" DS: %04x ES: %04x\n",
  26.135 -           0xffff & regs->xds,0xffff & regs->xes);
  26.136 -
  26.137 -    show_trace(&regs->esp);
  26.138 -}
  26.139 -
  26.140 -
  26.141 -/*
  26.142 - * Create a kernel thread
  26.143 - */
  26.144 -int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
  26.145 -{
  26.146 -    long retval, d0;
  26.147 -
  26.148 -    __asm__ __volatile__(
  26.149 -        "movl %%esp,%%esi\n\t"
  26.150 -        "int $0x80\n\t"		/* Linux/i386 system call */
  26.151 -        "cmpl %%esp,%%esi\n\t"	/* child or parent? */
  26.152 -        "je 1f\n\t"		/* parent - jump */
  26.153 -        /* Load the argument into eax, and push it.  That way, it does
  26.154 -         * not matter whether the called function is compiled with
  26.155 -         * -mregparm or not.  */
  26.156 -        "movl %4,%%eax\n\t"
  26.157 -        "pushl %%eax\n\t"		
  26.158 -        "call *%5\n\t"		/* call fn */
  26.159 -        "movl %3,%0\n\t"	/* exit */
  26.160 -        "int $0x80\n"
  26.161 -        "1:\t"
  26.162 -        :"=&a" (retval), "=&S" (d0)
  26.163 -        :"0" (__NR_clone), "i" (__NR_exit),
  26.164 -        "r" (arg), "r" (fn),
  26.165 -        "b" (flags | CLONE_VM)
  26.166 -        : "memory");
  26.167 -
  26.168 -    return retval;
  26.169 -}
  26.170 -
  26.171 -/*
  26.172 - * Free current thread data structures etc..
  26.173 - */
  26.174 -void exit_thread(void)
  26.175 -{
  26.176 -    /* nothing to do ... */
  26.177 -}
  26.178 -
  26.179 -void flush_thread(void)
  26.180 -{
  26.181 -    struct task_struct *tsk = current;
  26.182 -
  26.183 -    memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8);
  26.184 -
  26.185 -    /*
  26.186 -     * Forget coprocessor state..
  26.187 -     */
  26.188 -    clear_fpu(tsk);
  26.189 -    tsk->used_math = 0;
  26.190 -}
  26.191 -
  26.192 -void release_thread(struct task_struct *dead_task)
  26.193 -{
  26.194 -    if (dead_task->mm) {
  26.195 -        // temporary debugging check
  26.196 -        if (dead_task->mm->context.size) {
  26.197 -            printk("WARNING: dead process %8s still has LDT? <%p/%08x>\n",
  26.198 -                   dead_task->comm, 
  26.199 -		   dead_task->mm->context.ldt,
  26.200 -		   dead_task->mm->context.size);
  26.201 -            BUG();
  26.202 -        }
  26.203 -    }
  26.204 -    //release_x86_irqs(dead_task);
  26.205 -}
  26.206 -
  26.207 -
  26.208 -/*
  26.209 - * Save a segment.
  26.210 - */
  26.211 -#define savesegment(seg,value) \
  26.212 -	asm volatile("movl %%" #seg ",%0":"=m" (*(int *)&(value)))
  26.213 -
  26.214 -int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
  26.215 -                unsigned long unused,
  26.216 -                struct task_struct * p, struct pt_regs * regs)
  26.217 -{
  26.218 -    struct pt_regs * childregs;
  26.219 -
  26.220 -    childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p)) - 1;
  26.221 -    struct_cpy(childregs, regs);
  26.222 -    childregs->eax = 0;
  26.223 -    childregs->esp = esp;
  26.224 -
  26.225 -    p->thread.esp = (unsigned long) childregs;
  26.226 -    p->thread.esp0 = (unsigned long) (childregs+1);
  26.227 -
  26.228 -    p->thread.eip = (unsigned long) ret_from_fork;
  26.229 -
  26.230 -    savesegment(fs,p->thread.fs);
  26.231 -    savesegment(gs,p->thread.gs);
  26.232 -
  26.233 -    unlazy_fpu(current);
  26.234 -    struct_cpy(&p->thread.i387, &current->thread.i387);
  26.235 -
  26.236 -    p->thread.io_pl = current->thread.io_pl;
  26.237 -
  26.238 -    return 0;
  26.239 -}
  26.240 -
  26.241 -/*
  26.242 - * fill in the user structure for a core dump..
  26.243 - */
  26.244 -void dump_thread(struct pt_regs * regs, struct user * dump)
  26.245 -{
  26.246 -    int i;
  26.247 -
  26.248 -/* changed the size calculations - should hopefully work better. lbt */
  26.249 -    dump->magic = CMAGIC;
  26.250 -    dump->start_code = 0;
  26.251 -    dump->start_stack = regs->esp & ~(PAGE_SIZE - 1);
  26.252 -    dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
  26.253 -    dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT;
  26.254 -    dump->u_dsize -= dump->u_tsize;
  26.255 -    dump->u_ssize = 0;
  26.256 -    for (i = 0; i < 8; i++)
  26.257 -        dump->u_debugreg[i] = current->thread.debugreg[i];  
  26.258 -
  26.259 -    if (dump->start_stack < TASK_SIZE)
  26.260 -        dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;
  26.261 -
  26.262 -    dump->regs.ebx = regs->ebx;
  26.263 -    dump->regs.ecx = regs->ecx;
  26.264 -    dump->regs.edx = regs->edx;
  26.265 -    dump->regs.esi = regs->esi;
  26.266 -    dump->regs.edi = regs->edi;
  26.267 -    dump->regs.ebp = regs->ebp;
  26.268 -    dump->regs.eax = regs->eax;
  26.269 -    dump->regs.ds = regs->xds;
  26.270 -    dump->regs.es = regs->xes;
  26.271 -    savesegment(fs,dump->regs.fs);
  26.272 -    savesegment(gs,dump->regs.gs);
  26.273 -    dump->regs.orig_eax = regs->orig_eax;
  26.274 -    dump->regs.eip = regs->eip;
  26.275 -    dump->regs.cs = regs->xcs;
  26.276 -    dump->regs.eflags = regs->eflags;
  26.277 -    dump->regs.esp = regs->esp;
  26.278 -    dump->regs.ss = regs->xss;
  26.279 -
  26.280 -    dump->u_fpvalid = dump_fpu (regs, &dump->i387);
  26.281 -}
  26.282 -
  26.283 -/*
  26.284 - *	switch_to(x,yn) should switch tasks from x to y.
  26.285 - *
  26.286 - * We fsave/fwait so that an exception goes off at the right time
  26.287 - * (as a call from the fsave or fwait in effect) rather than to
  26.288 - * the wrong process. Lazy FP saving no longer makes any sense
  26.289 - * with modern CPU's, and this simplifies a lot of things (SMP
  26.290 - * and UP become the same).
  26.291 - *
  26.292 - * NOTE! We used to use the x86 hardware context switching. The
  26.293 - * reason for not using it any more becomes apparent when you
  26.294 - * try to recover gracefully from saved state that is no longer
  26.295 - * valid (stale segment register values in particular). With the
  26.296 - * hardware task-switch, there is no way to fix up bad state in
  26.297 - * a reasonable manner.
  26.298 - *
  26.299 - * The fact that Intel documents the hardware task-switching to
  26.300 - * be slow is a fairly red herring - this code is not noticeably
  26.301 - * faster. However, there _is_ some room for improvement here,
  26.302 - * so the performance issues may eventually be a valid point.
  26.303 - * More important, however, is the fact that this allows us much
  26.304 - * more flexibility.
  26.305 - */
  26.306 -void fastcall __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
  26.307 -{
  26.308 -    struct thread_struct *next = &next_p->thread;
  26.309 -    physdev_op_t op;
  26.310 -    multicall_entry_t _mcl[8], *mcl = _mcl;
  26.311 -
  26.312 -    /*
  26.313 -     * This is basically 'unlazy_fpu', except that we queue a multicall to 
  26.314 -     * indicate FPU task switch, rather than synchronously trapping to Xen.
  26.315 -     */
  26.316 -    if ( prev_p->flags & PF_USEDFPU )
  26.317 -    {
  26.318 -	if ( cpu_has_fxsr )
  26.319 -            asm volatile( "fxsave %0 ; fnclex"
  26.320 -                          : "=m" (prev_p->thread.i387.fxsave) );
  26.321 -	else
  26.322 -            asm volatile( "fnsave %0 ; fwait"
  26.323 -                          : "=m" (prev_p->thread.i387.fsave) );
  26.324 -	prev_p->flags &= ~PF_USEDFPU;
  26.325 -        mcl->op      = __HYPERVISOR_fpu_taskswitch;
  26.326 -        mcl->args[0] = 1;
  26.327 -        mcl++;
  26.328 -    }
  26.329 -
  26.330 -    mcl->op      = __HYPERVISOR_stack_switch;
  26.331 -    mcl->args[0] = __KERNEL_DS;
  26.332 -    mcl->args[1] = next->esp0;
  26.333 -    mcl++;
  26.334 -
  26.335 -    if ( prev_p->thread.io_pl != next->io_pl ) 
  26.336 -    {
  26.337 -        op.cmd             = PHYSDEVOP_SET_IOPL;
  26.338 -	op.u.set_iopl.iopl = next->io_pl;
  26.339 -        mcl->op      = __HYPERVISOR_physdev_op;
  26.340 -        mcl->args[0] = (unsigned long)&op;
  26.341 -        mcl++;
  26.342 -    }
  26.343 -
  26.344 -    (void)HYPERVISOR_multicall(_mcl, mcl - _mcl);
  26.345 -
  26.346 -    /*
  26.347 -     * Restore %fs and %gs.
  26.348 -     */
  26.349 -    loadsegment(fs, next->fs);
  26.350 -    loadsegment(gs, next->gs);
  26.351 -
  26.352 -    /*
  26.353 -     * Now maybe reload the debug registers
  26.354 -     */
  26.355 -    if ( next->debugreg[7] != 0 )
  26.356 -    {
  26.357 -        HYPERVISOR_set_debugreg(0, next->debugreg[0]);
  26.358 -        HYPERVISOR_set_debugreg(1, next->debugreg[1]);
  26.359 -        HYPERVISOR_set_debugreg(2, next->debugreg[2]);
  26.360 -        HYPERVISOR_set_debugreg(3, next->debugreg[3]);
  26.361 -        /* no 4 and 5 */
  26.362 -        HYPERVISOR_set_debugreg(6, next->debugreg[6]);
  26.363 -        HYPERVISOR_set_debugreg(7, next->debugreg[7]);
  26.364 -    }
  26.365 -}
  26.366 -
  26.367 -asmlinkage int sys_fork(struct pt_regs regs)
  26.368 -{
  26.369 -    return do_fork(SIGCHLD, regs.esp, &regs, 0);
  26.370 -}
  26.371 -
  26.372 -asmlinkage int sys_clone(struct pt_regs regs)
  26.373 -{
  26.374 -    unsigned long clone_flags;
  26.375 -    unsigned long newsp;
  26.376 -
  26.377 -    clone_flags = regs.ebx;
  26.378 -    newsp = regs.ecx;
  26.379 -    if (!newsp)
  26.380 -        newsp = regs.esp;
  26.381 -    return do_fork(clone_flags, newsp, &regs, 0);
  26.382 -}
  26.383 -
  26.384 -/*
  26.385 - * This is trivial, and on the face of it looks like it
  26.386 - * could equally well be done in user mode.
  26.387 - *
  26.388 - * Not so, for quite unobvious reasons - register pressure.
  26.389 - * In user mode vfork() cannot have a stack frame, and if
  26.390 - * done by calling the "clone()" system call directly, you
  26.391 - * do not have enough call-clobbered registers to hold all
  26.392 - * the information you need.
  26.393 - */
  26.394 -asmlinkage int sys_vfork(struct pt_regs regs)
  26.395 -{
  26.396 -    return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.esp, &regs, 0);
  26.397 -}
  26.398 -
  26.399 -/*
  26.400 - * sys_execve() executes a new program.
  26.401 - */
  26.402 -asmlinkage int sys_execve(struct pt_regs regs)
  26.403 -{
  26.404 -    int error;
  26.405 -    char * filename;
  26.406 -
  26.407 -    filename = getname((char *) regs.ebx);
  26.408 -    error = PTR_ERR(filename);
  26.409 -    if (IS_ERR(filename))
  26.410 -        goto out;
  26.411 -    error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, &regs);
  26.412 -    if (error == 0)
  26.413 -        current->ptrace &= ~PT_DTRACE;
  26.414 -    putname(filename);
  26.415 - out:
  26.416 -    return error;
  26.417 -}
  26.418 -
  26.419 -/*
  26.420 - * These bracket the sleeping functions..
  26.421 - */
  26.422 -extern void scheduling_functions_start_here(void);
  26.423 -extern void scheduling_functions_end_here(void);
  26.424 -#define first_sched	((unsigned long) scheduling_functions_start_here)
  26.425 -#define last_sched	((unsigned long) scheduling_functions_end_here)
  26.426 -
  26.427 -unsigned long get_wchan(struct task_struct *p)
  26.428 -{
  26.429 -    unsigned long ebp, esp, eip;
  26.430 -    unsigned long stack_page;
  26.431 -    int count = 0;
  26.432 -    if (!p || p == current || p->state == TASK_RUNNING)
  26.433 -        return 0;
  26.434 -    stack_page = (unsigned long)p;
  26.435 -    esp = p->thread.esp;
  26.436 -    if (!stack_page || esp < stack_page || esp > 8188+stack_page)
  26.437 -        return 0;
  26.438 -    /* include/asm-i386/system.h:switch_to() pushes ebp last. */
  26.439 -    ebp = *(unsigned long *) esp;
  26.440 -    do {
  26.441 -        if (ebp < stack_page || ebp > 8184+stack_page)
  26.442 -            return 0;
  26.443 -        eip = *(unsigned long *) (ebp+4);
  26.444 -        if (eip < first_sched || eip >= last_sched)
  26.445 -            return eip;
  26.446 -        ebp = *(unsigned long *) ebp;
  26.447 -    } while (count++ < 16);
  26.448 -    return 0;
  26.449 -}
  26.450 -#undef last_sched
  26.451 -#undef first_sched
    27.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/setup.c	Mon Jul 11 14:48:47 2005 +0000
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,1213 +0,0 @@
    27.4 -/*
    27.5 - *  linux/arch/i386/kernel/setup.c
    27.6 - *
    27.7 - *  Copyright (C) 1995  Linus Torvalds
    27.8 - */
    27.9 -
   27.10 -/*
   27.11 - * This file handles the architecture-dependent parts of initialization
   27.12 - */
   27.13 -
   27.14 -#define __KERNEL_SYSCALLS__
   27.15 -static int errno;
   27.16 -#include <linux/errno.h>
   27.17 -#include <linux/sched.h>
   27.18 -#include <linux/kernel.h>
   27.19 -#include <linux/mm.h>
   27.20 -#include <linux/stddef.h>
   27.21 -#include <linux/unistd.h>
   27.22 -#include <linux/ptrace.h>
   27.23 -#include <linux/slab.h>
   27.24 -#include <linux/user.h>
   27.25 -#include <linux/a.out.h>
   27.26 -#include <linux/tty.h>
   27.27 -#include <linux/ioport.h>
   27.28 -#include <linux/delay.h>
   27.29 -#include <linux/config.h>
   27.30 -#include <linux/init.h>
   27.31 -#include <linux/apm_bios.h>
   27.32 -#ifdef CONFIG_BLK_DEV_RAM
   27.33 -#include <linux/blk.h>
   27.34 -#endif
   27.35 -#include <linux/highmem.h>
   27.36 -#include <linux/bootmem.h>
   27.37 -#include <linux/seq_file.h>
   27.38 -#include <linux/reboot.h>
   27.39 -#include <asm/processor.h>
   27.40 -#include <linux/console.h>
   27.41 -#include <linux/module.h>
   27.42 -#include <asm/mtrr.h>
   27.43 -#include <asm/uaccess.h>
   27.44 -#include <asm/system.h>
   27.45 -#include <asm/io.h>
   27.46 -#include <asm/smp.h>
   27.47 -#include <asm/msr.h>
   27.48 -#include <asm/desc.h>
   27.49 -#include <asm/dma.h>
   27.50 -#include <asm/mpspec.h>
   27.51 -#include <asm/mmu_context.h>
   27.52 -#include <asm/ctrl_if.h>
   27.53 -#include <asm/hypervisor.h>
   27.54 -#include <asm-xen/xen-public/physdev.h>
   27.55 -#include <linux/netdevice.h>
   27.56 -#include <linux/rtnetlink.h>
   27.57 -#include <linux/tqueue.h>
   27.58 -#include <net/pkt_sched.h> /* dev_(de)activate */
   27.59 -
   27.60 -/*
   27.61 - * Point at the empty zero page to start with. We map the real shared_info
   27.62 - * page as soon as fixmap is up and running.
   27.63 - */
   27.64 -shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
   27.65 -
   27.66 -unsigned int *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
   27.67 -
   27.68 -/*
   27.69 - * Machine setup..
   27.70 - */
   27.71 -
   27.72 -char ignore_irq13;		/* set if exception 16 works */
   27.73 -struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
   27.74 -
   27.75 -unsigned long mmu_cr4_features;
   27.76 -
   27.77 -unsigned char * vgacon_mmap;
   27.78 -
   27.79 -/*
   27.80 - * Bus types ..
   27.81 - */
   27.82 -#ifdef CONFIG_EISA
   27.83 -int EISA_bus;
   27.84 -#endif
   27.85 -int MCA_bus;
   27.86 -
   27.87 -/* for MCA, but anyone else can use it if they want */
   27.88 -unsigned int machine_id;
   27.89 -unsigned int machine_submodel_id;
   27.90 -unsigned int BIOS_revision;
   27.91 -unsigned int mca_pentium_flag;
   27.92 -
   27.93 -/* For PCI or other memory-mapped resources */
   27.94 -unsigned long pci_mem_start = 0x10000000;
   27.95 -
   27.96 -/*
   27.97 - * Setup options
   27.98 - */
   27.99 -struct drive_info_struct { char dummy[32]; } drive_info;
  27.100 -struct screen_info screen_info;
  27.101 -struct apm_info apm_info;
  27.102 -struct sys_desc_table_struct {
  27.103 -    unsigned short length;
  27.104 -    unsigned char table[0];
  27.105 -};
  27.106 -
  27.107 -unsigned char aux_device_present;
  27.108 -
  27.109 -extern int root_mountflags;
  27.110 -extern char _text, _etext, _edata, _end;
  27.111 -
  27.112 -extern int blk_nohighio;
  27.113 -
  27.114 -int enable_acpi_smp_table;
  27.115 -
  27.116 -/* Raw start-of-day parameters from the hypervisor. */
  27.117 -union xen_start_info_union xen_start_info_union;
  27.118 -
  27.119 -#define COMMAND_LINE_SIZE MAX_GUEST_CMDLINE
  27.120 -static char command_line[COMMAND_LINE_SIZE];
  27.121 -char saved_command_line[COMMAND_LINE_SIZE];
  27.122 -
  27.123 -/* parse_mem_cmdline()
  27.124 - * returns the value of the mem= boot param converted to pages or 0
  27.125 - */ 
  27.126 -static int __init parse_mem_cmdline (char ** cmdline_p)
  27.127 -{
  27.128 -    char c = ' ', *to = command_line, *from = saved_command_line;
  27.129 -    int len = 0;
  27.130 -    unsigned long long bytes;
  27.131 -    int mem_param = 0;
  27.132 -
  27.133 -    /* Save unparsed command line copy for /proc/cmdline */
  27.134 -    memcpy(saved_command_line, xen_start_info.cmd_line, COMMAND_LINE_SIZE);
  27.135 -    saved_command_line[COMMAND_LINE_SIZE-1] = '\0';
  27.136 -
  27.137 -    for (;;) {
  27.138 -        /*
  27.139 -         * "mem=nopentium" disables the 4MB page tables.
  27.140 -         * "mem=XXX[kKmM]" defines a memory region from HIGH_MEM
  27.141 -         * to <mem>, overriding the bios size.
  27.142 -         * "mem=XXX[KkmM]@XXX[KkmM]" defines a memory region from
  27.143 -         * <start> to <start>+<mem>, overriding the bios size.
  27.144 -         */
  27.145 -        if (c == ' ' && !memcmp(from, "mem=", 4)) {
  27.146 -            if (to != command_line)
  27.147 -                to--;
  27.148 -            if (!memcmp(from+4, "nopentium", 9)) {
  27.149 -                from += 9+4;
  27.150 -            } else if (!memcmp(from+4, "exactmap", 8)) {
  27.151 -                from += 8+4;
  27.152 -            } else {
  27.153 -                bytes = memparse(from+4, &from);
  27.154 -                mem_param = bytes>>PAGE_SHIFT;
  27.155 -		if (*from == '@')
  27.156 -                    (void)memparse(from+1, &from);
  27.157 -            }
  27.158 -        }
  27.159 -
  27.160 -        c = *(from++);
  27.161 -        if (!c)
  27.162 -            break;
  27.163 -        if (COMMAND_LINE_SIZE <= ++len)
  27.164 -            break;
  27.165 -        *(to++) = c;
  27.166 -    }
  27.167 -    *to = '\0';
  27.168 -    *cmdline_p = command_line;
  27.169 -
  27.170 -    return mem_param;
  27.171 -}
  27.172 -
  27.173 -/*
  27.174 - * Every exception-fixup table is sorted (i.e., kernel main table, and every
  27.175 - * module table. Some elements may be out of order if they reference text.init,
  27.176 - * for example. 
  27.177 - */
  27.178 -static void sort_exception_table(struct exception_table_entry *start,
  27.179 -                                 struct exception_table_entry *end)
  27.180 -{
  27.181 -    struct exception_table_entry *p, *q, tmp;
  27.182 -
  27.183 -    for ( p = start; p < end; p++ )
  27.184 -    {
  27.185 -        for ( q = p-1; q > start; q-- )
  27.186 -            if ( p->insn > q->insn )
  27.187 -                break;
  27.188 -        if ( ++q != p )
  27.189 -        {
  27.190 -            tmp = *p;
  27.191 -            memmove(q+1, q, (p-q)*sizeof(*p));
  27.192 -            *q = tmp;
  27.193 -        }
  27.194 -    }
  27.195 -}
  27.196 -
  27.197 -int xen_module_init(struct module *mod)
  27.198 -{
  27.199 -    sort_exception_table(mod->ex_table_start, mod->ex_table_end);
  27.200 -    return 0;
  27.201 -}
  27.202 -
  27.203 -void __init setup_arch(char **cmdline_p)
  27.204 -{
  27.205 -    int i,j;
  27.206 -    unsigned long bootmap_size, start_pfn, lmax_low_pfn;
  27.207 -    int mem_param;  /* user specified memory size in pages */
  27.208 -    int boot_pfn;   /* low pages available for bootmem */
  27.209 -    physdev_op_t op;
  27.210 -
  27.211 -    extern void hypervisor_callback(void);
  27.212 -    extern void failsafe_callback(void);
  27.213 -
  27.214 -    extern unsigned long cpu0_pte_quicklist[];
  27.215 -    extern unsigned long cpu0_pgd_quicklist[];
  27.216 -
  27.217 -    extern const struct exception_table_entry __start___ex_table[];
  27.218 -    extern const struct exception_table_entry __stop___ex_table[];
  27.219 -
  27.220 -    extern char _stext;
  27.221 -
  27.222 -    /* Force a quick death if the kernel panics. */
  27.223 -    extern int panic_timeout;
  27.224 -    if ( panic_timeout == 0 )
  27.225 -        panic_timeout = 1;
  27.226 -
  27.227 -    /* Ensure that the kernel exception-fixup table is sorted. */
  27.228 -    sort_exception_table(__start___ex_table, __stop___ex_table);
  27.229 -
  27.230 -#ifndef CONFIG_HIGHIO
  27.231 -    blk_nohighio = 1;
  27.232 -#endif
  27.233 -
  27.234 -    HYPERVISOR_vm_assist(
  27.235 -        VMASST_CMD_enable, VMASST_TYPE_4gb_segments);
  27.236 -    HYPERVISOR_vm_assist(
  27.237 -        VMASST_CMD_enable, VMASST_TYPE_writable_pagetables);
  27.238 -        
  27.239 -    HYPERVISOR_set_callbacks(
  27.240 -        __KERNEL_CS, (unsigned long)hypervisor_callback,
  27.241 -        __KERNEL_CS, (unsigned long)failsafe_callback);
  27.242 -
  27.243 -    boot_cpu_data.pgd_quick = cpu0_pgd_quicklist;
  27.244 -    boot_cpu_data.pte_quick = cpu0_pte_quicklist;
  27.245 -
  27.246 -    /* This must be initialized to UNNAMED_MAJOR for ipconfig to work
  27.247 -       properly.  Setting ROOT_DEV to default to /dev/ram0 breaks initrd. */
  27.248 -    ROOT_DEV = MKDEV(UNNAMED_MAJOR,0);
  27.249 -    memset(&drive_info, 0, sizeof(drive_info));
  27.250 -    memset(&screen_info, 0, sizeof(screen_info));
  27.251 -    
  27.252 -    /* This is drawn from a dump from vgacon:startup in standard Linux. */
  27.253 -    screen_info.orig_video_mode = 3; 
  27.254 -    screen_info.orig_video_isVGA = 1;
  27.255 -    screen_info.orig_video_lines = 25;
  27.256 -    screen_info.orig_video_cols = 80;
  27.257 -    screen_info.orig_video_ega_bx = 3;
  27.258 -    screen_info.orig_video_points = 16;
  27.259 -
  27.260 -    memset(&apm_info.bios, 0, sizeof(apm_info.bios));
  27.261 -    aux_device_present = 0; 
  27.262 -#ifdef CONFIG_BLK_DEV_RAM
  27.263 -    rd_image_start = 0;
  27.264 -    rd_prompt = 0;
  27.265 -    rd_doload = 0;
  27.266 -#endif
  27.267 -
  27.268 -    root_mountflags &= ~MS_RDONLY;
  27.269 -    init_mm.start_code = (unsigned long) &_text;
  27.270 -    init_mm.end_code = (unsigned long) &_etext;
  27.271 -    init_mm.end_data = (unsigned long) &_edata;
  27.272 -    init_mm.brk = (unsigned long) &_end;
  27.273 -
  27.274 -    /* The mem= kernel command line param overrides the detected amount
  27.275 -     * of memory.   For xenolinux, if this override is larger than detected
  27.276 -     * memory, then boot using only detected memory and make provisions to
  27.277 -     * use all of the override value.   The hypervisor can give this
  27.278 -     * domain more memory later on and it will be added to the free
  27.279 -     * lists at that time.   See claim_new_pages() in
  27.280 -     * arch/xen/drivers/balloon/balloon.c
  27.281 -     */
  27.282 -    mem_param = parse_mem_cmdline(cmdline_p);
  27.283 -    if (mem_param < xen_start_info.nr_pages)
  27.284 -        mem_param = xen_start_info.nr_pages;
  27.285 -
  27.286 -#define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
  27.287 -#define PFN_DOWN(x)	((x) >> PAGE_SHIFT)
  27.288 -#define PFN_PHYS(x)	((x) << PAGE_SHIFT)
  27.289 -
  27.290 -/*
  27.291 - * 128MB for vmalloc(), iomap(), kmap(), and fixaddr mappings.
  27.292 - */
  27.293 -#define VMALLOC_RESERVE	(unsigned long)(128 << 20)
  27.294 -#define MAXMEM		(unsigned long)(HYPERVISOR_VIRT_START-PAGE_OFFSET-VMALLOC_RESERVE)
  27.295 -#define MAXMEM_PFN	PFN_DOWN(MAXMEM)
  27.296 -#define MAX_NONPAE_PFN	(1 << 20)
  27.297 -
  27.298 -    /*
  27.299 -     * Determine low and high memory ranges:
  27.300 -     */
  27.301 -    lmax_low_pfn = max_pfn = mem_param;
  27.302 -    if (lmax_low_pfn > MAXMEM_PFN) {
  27.303 -        lmax_low_pfn = MAXMEM_PFN;
  27.304 -#ifndef CONFIG_HIGHMEM
  27.305 -        /* Maximum memory usable is what is directly addressable */
  27.306 -        printk(KERN_WARNING "Warning only %ldMB will be used.\n",
  27.307 -               MAXMEM>>20);
  27.308 -        if (max_pfn > MAX_NONPAE_PFN)
  27.309 -            printk(KERN_WARNING "Use a PAE enabled kernel.\n");
  27.310 -        else
  27.311 -            printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
  27.312 -        max_pfn = lmax_low_pfn;
  27.313 -#else /* !CONFIG_HIGHMEM */
  27.314 -#ifndef CONFIG_X86_PAE
  27.315 -        if (max_pfn > MAX_NONPAE_PFN) {
  27.316 -            max_pfn = MAX_NONPAE_PFN;
  27.317 -            printk(KERN_WARNING "Warning only 4GB will be used.\n");
  27.318 -            printk(KERN_WARNING "Use a PAE enabled kernel.\n");
  27.319 -        }
  27.320 -#endif /* !CONFIG_X86_PAE */
  27.321 -#endif /* !CONFIG_HIGHMEM */
  27.322 -    }
  27.323 -
  27.324 -#ifdef CONFIG_HIGHMEM
  27.325 -    highstart_pfn = highend_pfn = max_pfn;
  27.326 -    if (max_pfn > MAXMEM_PFN) {
  27.327 -        highstart_pfn = MAXMEM_PFN;
  27.328 -        printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
  27.329 -               pages_to_mb(highend_pfn - highstart_pfn));
  27.330 -    }
  27.331 -#endif
  27.332 -
  27.333 -    phys_to_machine_mapping = (unsigned int *)xen_start_info.mfn_list;
  27.334 -    cur_pgd = init_mm.pgd = (pgd_t *)xen_start_info.pt_base;
  27.335 -
  27.336 -    start_pfn = (__pa(xen_start_info.pt_base) >> PAGE_SHIFT) + 
  27.337 -        xen_start_info.nr_pt_frames;
  27.338 -
  27.339 -    /*
  27.340 -     * Initialize the boot-time allocator, and free up all RAM. Then reserve 
  27.341 -     * space for OS image, initrd, phys->machine table, bootstrap page table,
  27.342 -     * and the bootmem bitmap. 
  27.343 -     * NB. There is definitely enough room for the bootmem bitmap in the
  27.344 -     * bootstrap page table. We are guaranteed to get >=512kB unused 'padding'
  27.345 -     * for our own use after all bootstrap elements 
  27.346 -     * (see asm-xen/xen-public/xen.h).
  27.347 -     */
  27.348 -    boot_pfn = min((int)xen_start_info.nr_pages,lmax_low_pfn);
  27.349 -    bootmap_size = init_bootmem(start_pfn,boot_pfn);
  27.350 -    free_bootmem(0, PFN_PHYS(boot_pfn));
  27.351 -    reserve_bootmem(__pa(&_stext), 
  27.352 -                    PFN_PHYS(start_pfn) + bootmap_size + PAGE_SIZE-1 - 
  27.353 -                    __pa(&_stext));
  27.354 -
  27.355 -    /* init_bootmem() set the global max_low_pfn to boot_pfn.  Now max_low_pfn 
  27.356 -     * can be set to the override value.
  27.357 -     */
  27.358 -    max_low_pfn = lmax_low_pfn;
  27.359 -
  27.360 -#ifdef CONFIG_BLK_DEV_INITRD
  27.361 -    if ( xen_start_info.mod_start != 0 )
  27.362 -    {
  27.363 -        if ( (__pa(xen_start_info.mod_start) + xen_start_info.mod_len) <= 
  27.364 -             (max_low_pfn << PAGE_SHIFT) )
  27.365 -        {
  27.366 -            initrd_start = xen_start_info.mod_start;
  27.367 -            initrd_end   = initrd_start + xen_start_info.mod_len;
  27.368 -            initrd_below_start_ok = 1;
  27.369 -        }
  27.370 -        else
  27.371 -        {
  27.372 -            printk(KERN_ERR "initrd extends beyond end of memory "
  27.373 -                   "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
  27.374 -                   __pa(xen_start_info.mod_start) + xen_start_info.mod_len,
  27.375 -                   max_low_pfn << PAGE_SHIFT);
  27.376 -            initrd_start = 0;
  27.377 -        }
  27.378 -    }
  27.379 -#endif
  27.380 -
  27.381 -    paging_init();
  27.382 -
  27.383 -    /* Make sure we have a correctly sized P->M table. */
  27.384 -    if ( max_pfn != xen_start_info.nr_pages )
  27.385 -    {
  27.386 -        phys_to_machine_mapping = alloc_bootmem_low_pages(
  27.387 -            max_pfn * sizeof(unsigned long));
  27.388 -        if ( max_pfn > xen_start_info.nr_pages )
  27.389 -        {
  27.390 -            memset(phys_to_machine_mapping, ~0,
  27.391 -                   max_pfn * sizeof(unsigned long));
  27.392 -            memcpy(phys_to_machine_mapping,
  27.393 -                   (unsigned long *)xen_start_info.mfn_list,
  27.394 -                   xen_start_info.nr_pages * sizeof(unsigned long));
  27.395 -        }
  27.396 -        else
  27.397 -        {
  27.398 -            memcpy(phys_to_machine_mapping,
  27.399 -                   (unsigned long *)xen_start_info.mfn_list,
  27.400 -                   max_pfn * sizeof(unsigned long));
  27.401 -            if (HYPERVISOR_dom_mem_op(
  27.402 -                MEMOP_decrease_reservation,
  27.403 -                (unsigned long *)xen_start_info.mfn_list + max_pfn,
  27.404 -                xen_start_info.nr_pages - max_pfn, 0) !=
  27.405 -                (xen_start_info.nr_pages - max_pfn))
  27.406 -                BUG();
  27.407 -        }
  27.408 -        free_bootmem(__pa(xen_start_info.mfn_list), 
  27.409 -                     PFN_PHYS(PFN_UP(xen_start_info.nr_pages *
  27.410 -                                     sizeof(unsigned long))));
  27.411 -    }
  27.412 -
  27.413 -    pfn_to_mfn_frame_list = alloc_bootmem_low_pages(PAGE_SIZE);
  27.414 -    for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
  27.415 -    {	
  27.416 -        pfn_to_mfn_frame_list[j] = 
  27.417 -            virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT;
  27.418 -    }
  27.419 -    HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list =
  27.420 -	virt_to_machine(pfn_to_mfn_frame_list) >> PAGE_SHIFT;
  27.421 -
  27.422 -    op.cmd             = PHYSDEVOP_SET_IOPL;
  27.423 -    op.u.set_iopl.iopl = current->thread.io_pl = 1;
  27.424 -    HYPERVISOR_physdev_op(&op);
  27.425 -
  27.426 -    if (xen_start_info.flags & SIF_INITDOMAIN )
  27.427 -    {
  27.428 -        if( !(xen_start_info.flags & SIF_PRIVILEGED) )
  27.429 -            panic("Xen granted us console access but not privileged status");
  27.430 -
  27.431 -#if defined(CONFIG_VT)
  27.432 -#if defined(CONFIG_VGA_CONSOLE)
  27.433 -        conswitchp = &vga_con;
  27.434 -#elif defined(CONFIG_DUMMY_CONSOLE)
  27.435 -        conswitchp = &dummy_con;
  27.436 -#endif
  27.437 -#endif
  27.438 -    }
  27.439 -}
  27.440 -
  27.441 -static int cachesize_override __initdata = -1;
  27.442 -static int __init cachesize_setup(char *str)
  27.443 -{
  27.444 -    get_option (&str, &cachesize_override);
  27.445 -    return 1;
  27.446 -}
  27.447 -__setup("cachesize=", cachesize_setup);
  27.448 -
  27.449 -static int __init highio_setup(char *str)
  27.450 -{
  27.451 -    printk("i386: disabling HIGHMEM block I/O\n");
  27.452 -    blk_nohighio = 1;
  27.453 -    return 1;
  27.454 -}
  27.455 -__setup("nohighio", highio_setup);
  27.456 -
  27.457 -static int __init get_model_name(struct cpuinfo_x86 *c)
  27.458 -{
  27.459 -    unsigned int *v;
  27.460 -    char *p, *q;
  27.461 -
  27.462 -    if (cpuid_eax(0x80000000) < 0x80000004)
  27.463 -        return 0;
  27.464 -
  27.465 -    v = (unsigned int *) c->x86_model_id;
  27.466 -    cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]);
  27.467 -    cpuid(0x80000003, &v[4], &v[5], &v[6], &v[7]);
  27.468 -    cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]);
  27.469 -    c->x86_model_id[48] = 0;
  27.470 -
  27.471 -    /* Intel chips right-justify this string for some dumb reason;
  27.472 -       undo that brain damage */
  27.473 -    p = q = &c->x86_model_id[0];
  27.474 -    while ( *p == ' ' )
  27.475 -        p++;
  27.476 -    if ( p != q ) {
  27.477 -        while ( *p )
  27.478 -            *q++ = *p++;
  27.479 -        while ( q <= &c->x86_model_id[48] )
  27.480 -            *q++ = '\0';	/* Zero-pad the rest */
  27.481 -    }
  27.482 -
  27.483 -    return 1;
  27.484 -}
  27.485 -
  27.486 -
  27.487 -static void __init display_cacheinfo(struct cpuinfo_x86 *c)
  27.488 -{
  27.489 -    unsigned int n, dummy, ecx, edx, l2size;
  27.490 -
  27.491 -    n = cpuid_eax(0x80000000);
  27.492 -
  27.493 -    if (n >= 0x80000005) {
  27.494 -        cpuid(0x80000005, &dummy, &dummy, &ecx, &edx);
  27.495 -        printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n",
  27.496 -               edx>>24, edx&0xFF, ecx>>24, ecx&0xFF);
  27.497 -        c->x86_cache_size=(ecx>>24)+(edx>>24);	
  27.498 -    }
  27.499 -
  27.500 -    if (n < 0x80000006)	/* Some chips just has a large L1. */
  27.501 -        return;
  27.502 -
  27.503 -    ecx = cpuid_ecx(0x80000006);
  27.504 -    l2size = ecx >> 16;
  27.505 -
  27.506 -    /* AMD errata T13 (order #21922) */
  27.507 -    if ((c->x86_vendor == X86_VENDOR_AMD) && (c->x86 == 6)) {
  27.508 -        if (c->x86_model == 3 && c->x86_mask == 0)	/* Duron Rev A0 */
  27.509 -            l2size = 64;
  27.510 -        if (c->x86_model == 4 &&
  27.511 -            (c->x86_mask==0 || c->x86_mask==1))	/* Tbird rev A1/A2 */
  27.512 -            l2size = 256;
  27.513 -    }
  27.514 -
  27.515 -    /* Intel PIII Tualatin. This comes in two flavours.
  27.516 -     * One has 256kb of cache, the other 512. We have no way
  27.517 -     * to determine which, so we use a boottime override
  27.518 -     * for the 512kb model, and assume 256 otherwise.
  27.519 -     */
  27.520 -    if ((c->x86_vendor == X86_VENDOR_INTEL) && (c->x86 == 6) &&
  27.521 -        (c->x86_model == 11) && (l2size == 0))
  27.522 -        l2size = 256;
  27.523 -
  27.524 -    if (c->x86_vendor == X86_VENDOR_CENTAUR) {
  27.525 -	/* VIA C3 CPUs (670-68F) need further shifting. */
  27.526 -	if ((c->x86 == 6) &&
  27.527 -	    ((c->x86_model == 7) || (c->x86_model == 8))) {
  27.528 -		l2size >>= 8;
  27.529 -	}
  27.530 -
  27.531 -	/* VIA also screwed up Nehemiah stepping 1, and made
  27.532 -	   it return '65KB' instead of '64KB'
  27.533 -	   - Note, it seems this may only be in engineering samples. */
  27.534 -	if ((c->x86==6) && (c->x86_model==9) &&
  27.535 -	    (c->x86_mask==1) && (l2size==65))
  27.536 -		l2size -= 1;
  27.537 -    }
  27.538 -
  27.539 -    /* Allow user to override all this if necessary. */
  27.540 -    if (cachesize_override != -1)
  27.541 -        l2size = cachesize_override;
  27.542 -
  27.543 -    if ( l2size == 0 )
  27.544 -        return;		/* Again, no L2 cache is possible */
  27.545 -
  27.546 -    c->x86_cache_size = l2size;
  27.547 -
  27.548 -    printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n",
  27.549 -           l2size, ecx & 0xFF);
  27.550 -}
  27.551 -
  27.552 -static void __init init_c3(struct cpuinfo_x86 *c)
  27.553 -{
  27.554 -    /* Test for Centaur Extended Feature Flags presence */
  27.555 -    if (cpuid_eax(0xC0000000) >= 0xC0000001) {
  27.556 -        /* store Centaur Extended Feature Flags as
  27.557 -         * word 5 of the CPU capability bit array
  27.558 -         */
  27.559 -        c->x86_capability[5] = cpuid_edx(0xC0000001);
  27.560 -    }
  27.561 -   
  27.562 -    switch (c->x86_model) {
  27.563 -    case 9:	/* Nehemiah */
  27.564 -    default:
  27.565 -        get_model_name(c);
  27.566 -        display_cacheinfo(c);
  27.567 -        break;
  27.568 -    }
  27.569 -}
  27.570 -
  27.571 -static void __init init_centaur(struct cpuinfo_x86 *c)
  27.572 -{
  27.573 -    /* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
  27.574 -       3DNow is IDd by bit 31 in extended CPUID (1*3231) anyway */
  27.575 -    clear_bit(0*32+31, &c->x86_capability);
  27.576 -  
  27.577 -    switch (c->x86) {
  27.578 -    case 6:
  27.579 -        init_c3(c);
  27.580 -        break;
  27.581 -    default:
  27.582 -        panic("Unsupported Centaur CPU (%i)\n", c->x86);
  27.583 -    }
  27.584 -}
  27.585 -
  27.586 -static int __init init_amd(struct cpuinfo_x86 *c)
  27.587 -{
  27.588 -    int r;
  27.589 -
  27.590 -    /* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
  27.591 -       3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
  27.592 -    clear_bit(0*32+31, &c->x86_capability);
  27.593 -	
  27.594 -    r = get_model_name(c);
  27.595 -
  27.596 -    switch(c->x86)
  27.597 -    {
  27.598 -    case 5: /* We don't like AMD K6 */
  27.599 -        panic("Unsupported AMD processor\n");
  27.600 -    case 6:	/* An Athlon/Duron. We can trust the BIOS probably */
  27.601 -        break;
  27.602 -    }
  27.603 -
  27.604 -    display_cacheinfo(c);
  27.605 -    return r;
  27.606 -}
  27.607 -
  27.608 -
  27.609 -static void __init init_intel(struct cpuinfo_x86 *c)
  27.610 -{
  27.611 -    char *p = NULL;
  27.612 -    unsigned int l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
  27.613 -
  27.614 -    if (c->cpuid_level > 1) {
  27.615 -        /* supports eax=2  call */
  27.616 -        int i, j, n;
  27.617 -        int regs[4];
  27.618 -        unsigned char *dp = (unsigned char *)regs;
  27.619 -
  27.620 -        /* Number of times to iterate */
  27.621 -        n = cpuid_eax(2) & 0xFF;
  27.622 -
  27.623 -        for ( i = 0 ; i < n ; i++ ) {
  27.624 -            cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
  27.625 -			
  27.626 -            /* If bit 31 is set, this is an unknown format */
  27.627 -            for ( j = 0 ; j < 3 ; j++ ) {
  27.628 -                if ( regs[j] < 0 ) regs[j] = 0;
  27.629 -            }
  27.630 -
  27.631 -            /* Byte 0 is level count, not a descriptor */
  27.632 -            for ( j = 1 ; j < 16 ; j++ ) {
  27.633 -                unsigned char des = dp[j];
  27.634 -                unsigned char dl, dh;
  27.635 -                unsigned int cs;
  27.636 -
  27.637 -                dh = des >> 4;
  27.638 -                dl = des & 0x0F;
  27.639 -
  27.640 -				/* Black magic... */
  27.641 -
  27.642 -                switch ( dh )
  27.643 -                {
  27.644 -                case 0:
  27.645 -                    switch ( dl ) {
  27.646 -                    case 6:
  27.647 -                        /* L1 I cache */
  27.648 -                        l1i += 8;
  27.649 -                        break;
  27.650 -                    case 8:
  27.651 -                        /* L1 I cache */
  27.652 -                        l1i += 16;
  27.653 -                        break;
  27.654 -                    case 10:
  27.655 -                        /* L1 D cache */
  27.656 -                        l1d += 8;
  27.657 -                        break;
  27.658 -                    case 12:
  27.659 -                        /* L1 D cache */
  27.660 -                        l1d += 16;
  27.661 -                        break;
  27.662 -                    default:;
  27.663 -                        /* TLB, or unknown */
  27.664 -                    }
  27.665 -                    break;
  27.666 -                case 2:
  27.667 -                    if ( dl ) {
  27.668 -                        /* L3 cache */
  27.669 -                        cs = (dl-1) << 9;
  27.670 -                        l3 += cs;
  27.671 -                    }
  27.672 -                    break;
  27.673 -                case 4:
  27.674 -                    if ( c->x86 > 6 && dl ) {
  27.675 -                        /* P4 family */
  27.676 -                        /* L3 cache */
  27.677 -                        cs = 128 << (dl-1);
  27.678 -                        l3 += cs;
  27.679 -                        break;
  27.680 -                    }
  27.681 -                    /* else same as 8 - fall through */
  27.682 -                case 8:
  27.683 -                    if ( dl ) {
  27.684 -                        /* L2 cache */
  27.685 -                        cs = 128 << (dl-1);
  27.686 -                        l2 += cs;
  27.687 -                    }
  27.688 -                    break;
  27.689 -                case 6:
  27.690 -                    if (dl > 5) {
  27.691 -                        /* L1 D cache */
  27.692 -                        cs = 8<<(dl-6);
  27.693 -                        l1d += cs;
  27.694 -                    }
  27.695 -                    break;
  27.696 -                case 7:
  27.697 -                    if ( dl >= 8 ) 
  27.698 -                    {
  27.699 -                        /* L2 cache */
  27.700 -                        cs = 64<<(dl-8);
  27.701 -                        l2 += cs;
  27.702 -                    } else {
  27.703 -                        /* L0 I cache, count as L1 */
  27.704 -                        cs = dl ? (16 << (dl-1)) : 12;
  27.705 -                        l1i += cs;
  27.706 -                    }
  27.707 -                    break;
  27.708 -                default:
  27.709 -                    /* TLB, or something else we don't know about */
  27.710 -                    break;
  27.711 -                }
  27.712 -            }
  27.713 -        }
  27.714 -        if ( l1i || l1d )
  27.715 -            printk(KERN_INFO "CPU: L1 I cache: %dK, L1 D cache: %dK\n",
  27.716 -                   l1i, l1d);
  27.717 -        if ( l2 )
  27.718 -            printk(KERN_INFO "CPU: L2 cache: %dK\n", l2);
  27.719 -        if ( l3 )
  27.720 -            printk(KERN_INFO "CPU: L3 cache: %dK\n", l3);
  27.721 -
  27.722 -        /*
  27.723 -         * This assumes the L3 cache is shared; it typically lives in
  27.724 -         * the northbridge.  The L1 caches are included by the L2
  27.725 -         * cache, and so should not be included for the purpose of
  27.726 -         * SMP switching weights.
  27.727 -         */
  27.728 -        c->x86_cache_size = l2 ? l2 : (l1i+l1d);
  27.729 -    }
  27.730 -
  27.731 -    /* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it */
  27.732 -    if ( c->x86 == 6 && c->x86_model < 3 && c->x86_mask < 3 )
  27.733 -        clear_bit(X86_FEATURE_SEP, &c->x86_capability);
  27.734 -	
  27.735 -    /* Names for the Pentium II/Celeron processors 
  27.736 -       detectable only by also checking the cache size.
  27.737 -       Dixon is NOT a Celeron. */
  27.738 -    if (c->x86 == 6) {
  27.739 -        switch (c->x86_model) {
  27.740 -        case 5:
  27.741 -            if (l2 == 0)
  27.742 -                p = "Celeron (Covington)";
  27.743 -            if (l2 == 256)
  27.744 -                p = "Mobile Pentium II (Dixon)";
  27.745 -            break;
  27.746 -			
  27.747 -        case 6:
  27.748 -            if (l2 == 128)
  27.749 -                p = "Celeron (Mendocino)";
  27.750 -            break;
  27.751 -			
  27.752 -        case 8:
  27.753 -            if (l2 == 128)
  27.754 -                p = "Celeron (Coppermine)";
  27.755 -            break;
  27.756 -        }
  27.757 -    }
  27.758 -
  27.759 -    if ( p )
  27.760 -        strcpy(c->x86_model_id, p);
  27.761 -}
  27.762 -
  27.763 -void __init get_cpu_vendor(struct cpuinfo_x86 *c)
  27.764 -{
  27.765 -    char *v = c->x86_vendor_id;
  27.766 -
  27.767 -    if (!strcmp(v, "GenuineIntel"))
  27.768 -        c->x86_vendor = X86_VENDOR_INTEL;
  27.769 -    else if (!strcmp(v, "AuthenticAMD"))
  27.770 -        c->x86_vendor = X86_VENDOR_AMD;
  27.771 -    else if (!strcmp(v, "CentaurHauls"))
  27.772 -        c->x86_vendor = X86_VENDOR_CENTAUR;
  27.773 -    else
  27.774 -        c->x86_vendor = X86_VENDOR_UNKNOWN;
  27.775 -}
  27.776 -
  27.777 -struct cpu_model_info {
  27.778 -    int vendor;
  27.779 -    int family;
  27.780 -    char *model_names[16];
  27.781 -};
  27.782 -
  27.783 -/* Naming convention should be: <Name> [(<Codename>)] */
  27.784 -/* This table only is used unless init_<vendor>() below doesn't set it; */
  27.785 -/* in particular, if CPUID levels 0x80000002..4 are supported, this isn't used */
  27.786 -static struct cpu_model_info cpu_models[] __initdata = {
  27.787 -    { X86_VENDOR_INTEL,	6,
  27.788 -      { "Pentium Pro A-step", "Pentium Pro", NULL, "Pentium II (Klamath)", 
  27.789 -        NULL, "Pentium II (Deschutes)", "Mobile Pentium II",
  27.790 -        "Pentium III (Katmai)", "Pentium III (Coppermine)", NULL,
  27.791 -        "Pentium III (Cascades)", NULL, NULL, NULL, NULL }},
  27.792 -    { X86_VENDOR_AMD,	6, /* Is this this really necessary?? */
  27.793 -      { "Athlon", "Athlon",
  27.794 -        "Athlon", NULL, "Athlon", NULL,
  27.795 -        NULL, NULL, NULL,
  27.796 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL }}
  27.797 -};
  27.798 -
  27.799 -/* Look up CPU names by table lookup. */
  27.800 -static char __init *table_lookup_model(struct cpuinfo_x86 *c)
  27.801 -{
  27.802 -    struct cpu_model_info *info = cpu_models;
  27.803 -    int i;
  27.804 -
  27.805 -    if ( c->x86_model >= 16 )
  27.806 -        return NULL;	/* Range check */
  27.807 -
  27.808 -    for ( i = 0 ; i < sizeof(cpu_models)/sizeof(struct cpu_model_info) ; i++ ) {
  27.809 -        if ( info->vendor == c->x86_vendor &&
  27.810 -             info->family == c->x86 ) {
  27.811 -            return info->model_names[c->x86_model];
  27.812 -        }
  27.813 -        info++;
  27.814 -    }
  27.815 -    return NULL;		/* Not found */
  27.816 -}
  27.817 -
  27.818 -
  27.819 -
  27.820 -/* Standard macro to see if a specific flag is changeable */
  27.821 -static inline int flag_is_changeable_p(u32 flag)
  27.822 -{
  27.823 -    u32 f1, f2;
  27.824 -
  27.825 -    asm("pushfl\n\t"
  27.826 -        "pushfl\n\t"
  27.827 -        "popl %0\n\t"
  27.828 -        "movl %0,%1\n\t"
  27.829 -        "xorl %2,%0\n\t"
  27.830 -        "pushl %0\n\t"
  27.831 -        "popfl\n\t"
  27.832 -        "pushfl\n\t"
  27.833 -        "popl %0\n\t"
  27.834 -        "popfl\n\t"
  27.835 -        : "=&r" (f1), "=&r" (f2)
  27.836 -        : "ir" (flag));
  27.837 -
  27.838 -    return ((f1^f2) & flag) != 0;
  27.839 -}
  27.840 -
  27.841 -
  27.842 -/* Probe for the CPUID instruction */
  27.843 -static int __init have_cpuid_p(void)
  27.844 -{
  27.845 -    return flag_is_changeable_p(X86_EFLAGS_ID);
  27.846 -}
  27.847 -
  27.848 -
  27.849 -
  27.850 -#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
  27.851 -unsigned char eddnr;
  27.852 -struct edd_info edd[EDDMAXNR];
  27.853 -unsigned int edd_disk80_sig;
  27.854 -/**
  27.855 - * copy_edd() - Copy the BIOS EDD information
  27.856 - *              from empty_zero_page into a safe place.
  27.857 - *
  27.858 - */
  27.859 -static inline void copy_edd(void)
  27.860 -{
  27.861 -     eddnr = EDD_NR;
  27.862 -     memcpy(edd, EDD_BUF, sizeof(edd));
  27.863 -     edd_disk80_sig = DISK80_SIGNATURE_BUFFER;
  27.864 -}
  27.865 -#else
  27.866 -static inline void copy_edd(void) {}
  27.867 -#endif
  27.868 -
  27.869 -/*
  27.870 - * This does the hard work of actually picking apart the CPU stuff...
  27.871 - */
  27.872 -void __init identify_cpu(struct cpuinfo_x86 *c)
  27.873 -{
  27.874 -    int junk, i;
  27.875 -    u32 xlvl, tfms;
  27.876 -
  27.877 -    c->loops_per_jiffy = loops_per_jiffy;
  27.878 -    c->x86_cache_size = -1;
  27.879 -    c->x86_vendor = X86_VENDOR_UNKNOWN;
  27.880 -    c->cpuid_level = -1;	/* CPUID not detected */
  27.881 -    c->x86_model = c->x86_mask = 0;	/* So far unknown... */
  27.882 -    c->x86_vendor_id[0] = '\0'; /* Unset */
  27.883 -    c->x86_model_id[0] = '\0';  /* Unset */
  27.884 -    memset(&c->x86_capability, 0, sizeof c->x86_capability);
  27.885 -    c->hard_math = 1;
  27.886 -
  27.887 -    if ( !have_cpuid_p() ) {
  27.888 -        panic("Processor must support CPUID\n");
  27.889 -    } else {
  27.890 -        /* CPU does have CPUID */
  27.891 -
  27.892 -        /* Get vendor name */
  27.893 -        cpuid(0x00000000, &c->cpuid_level,
  27.894 -              (int *)&c->x86_vendor_id[0],
  27.895 -              (int *)&c->x86_vendor_id[8],
  27.896 -              (int *)&c->x86_vendor_id[4]);
  27.897 -		
  27.898 -        get_cpu_vendor(c);
  27.899 -        /* Initialize the standard set of capabilities */
  27.900 -        /* Note that the vendor-specific code below might override */
  27.901 -
  27.902 -        /* Intel-defined flags: level 0x00000001 */
  27.903 -        if ( c->cpuid_level >= 0x00000001 ) {
  27.904 -                        u32 capability, excap;
  27.905 -                        cpuid(0x00000001, &tfms, &junk, &excap, &capability);
  27.906 -                        c->x86_capability[0] = capability;
  27.907 -                        c->x86_capability[4] = excap;
  27.908 -                        c->x86 = (tfms >> 8) & 15;
  27.909 -                        c->x86_model = (tfms >> 4) & 15;
  27.910 -                        if (c->x86 == 0xf) {
  27.911 -                                c->x86 += (tfms >> 20) & 0xff;
  27.912 -                                c->x86_model += ((tfms >> 16) & 0xF) << 4;
  27.913 -                        }
  27.914 -                        c->x86_mask = tfms & 15;
  27.915 -        } else {
  27.916 -            /* Have CPUID level 0 only - unheard of */
  27.917 -            c->x86 = 4;
  27.918 -        }
  27.919 -
  27.920 -        /* AMD-defined flags: level 0x80000001 */
  27.921 -        xlvl = cpuid_eax(0x80000000);
  27.922 -        if ( (xlvl & 0xffff0000) == 0x80000000 ) {
  27.923 -            if ( xlvl >= 0x80000001 )
  27.924 -                c->x86_capability[1] = cpuid_edx(0x80000001);
  27.925 -            if ( xlvl >= 0x80000004 )
  27.926 -                get_model_name(c); /* Default name */
  27.927 -        }
  27.928 -
  27.929 -        /* Transmeta-defined flags: level 0x80860001 */
  27.930 -        xlvl = cpuid_eax(0x80860000);
  27.931 -        if ( (xlvl & 0xffff0000) == 0x80860000 ) {
  27.932 -            if (  xlvl >= 0x80860001 )
  27.933 -                c->x86_capability[2] = cpuid_edx(0x80860001);
  27.934 -        }
  27.935 -    }
  27.936 -
  27.937 -    printk(KERN_DEBUG "CPU: Before vendor init, caps: %08x %08x %08x, vendor = %d\n",
  27.938 -           c->x86_capability[0],
  27.939 -           c->x86_capability[1],
  27.940 -           c->x86_capability[2],
  27.941 -           c->x86_vendor);
  27.942 -
  27.943 -    /*
  27.944 -     * Vendor-specific initialization.  In this section we
  27.945 -     * canonicalize the feature flags, meaning if there are
  27.946 -     * features a certain CPU supports which CPUID doesn't
  27.947 -     * tell us, CPUID claiming incorrect flags, or other bugs,
  27.948 -     * we handle them here.
  27.949 -     *
  27.950 -     * At the end of this section, c->x86_capability better
  27.951 -     * indicate the features this CPU genuinely supports!
  27.952 -     */
  27.953 -    switch ( c->x86_vendor ) {
  27.954 -    case X86_VENDOR_AMD:
  27.955 -        init_amd(c);
  27.956 -        break;
  27.957 -
  27.958 -    case X86_VENDOR_INTEL:
  27.959 -        init_intel(c);
  27.960 -        break;
  27.961 -
  27.962 -    case X86_VENDOR_CENTAUR:
  27.963 -        init_centaur(c);
  27.964 -        break;
  27.965 -        
  27.966 -    default:
  27.967 -        printk("Unsupported CPU vendor (%d) -- please report!\n",
  27.968 -               c->x86_vendor);
  27.969 -    }
  27.970 -	
  27.971 -    printk(KERN_DEBUG "CPU: After vendor init, caps: %08x %08x %08x %08x\n",
  27.972 -           c->x86_capability[0],
  27.973 -           c->x86_capability[1],
  27.974 -           c->x86_capability[2],
  27.975 -           c->x86_capability[3]);
  27.976 -
  27.977 -
  27.978 -    /* If the model name is still unset, do table lookup. */
  27.979 -    if ( !c->x86_model_id[0] ) {
  27.980 -        char *p;
  27.981 -        p = table_lookup_model(c);
  27.982 -        if ( p )
  27.983 -            strcpy(c->x86_model_id, p);
  27.984 -        else
  27.985 -            /* Last resort... */
  27.986 -            sprintf(c->x86_model_id, "%02x/%02x",
  27.987 -                    c->x86_vendor, c->x86_model);
  27.988 -    }
  27.989 -
  27.990 -    /* Now the feature flags better reflect actual CPU features! */
  27.991 -
  27.992 -    printk(KERN_DEBUG "CPU:     After generic, caps: %08x %08x %08x %08x\n",
  27.993 -           c->x86_capability[0],
  27.994 -           c->x86_capability[1],
  27.995 -           c->x86_capability[2],
  27.996 -           c->x86_capability[3]);
  27.997 -
  27.998 -    /*
  27.999 -     * On SMP, boot_cpu_data holds the common feature set between
 27.1000 -     * all CPUs; so make sure that we indicate which features are
 27.1001 -     * common between the CPUs.  The first time this routine gets
 27.1002 -     * executed, c == &boot_cpu_data.
 27.1003 -     */
 27.1004 -    if ( c != &boot_cpu_data ) {
 27.1005 -        /* AND the already accumulated flags with these */
 27.1006 -        for ( i = 0 ; i < NCAPINTS ; i++ )
 27.1007 -            boot_cpu_data.x86_capability[i] &= c->x86_capability[i];
 27.1008 -    }
 27.1009 -
 27.1010 -    printk(KERN_DEBUG "CPU:             Common caps: %08x %08x %08x %08x\n",
 27.1011 -           boot_cpu_data.x86_capability[0],
 27.1012 -           boot_cpu_data.x86_capability[1],
 27.1013 -           boot_cpu_data.x86_capability[2],
 27.1014 -           boot_cpu_data.x86_capability[3]);
 27.1015 -}
 27.1016 -
 27.1017 -
 27.1018 -/* These need to match <asm/processor.h> */
 27.1019 -static char *cpu_vendor_names[] __initdata = {
 27.1020 -    "Intel", "Cyrix", "AMD", "UMC", "NexGen", "Centaur", "Rise", "Transmeta" };
 27.1021 -
 27.1022 -
 27.1023 -void __init print_cpu_info(struct cpuinfo_x86 *c)
 27.1024 -{
 27.1025 -    char *vendor = NULL;
 27.1026 -
 27.1027 -    if (c->x86_vendor < sizeof(cpu_vendor_names)/sizeof(char *))
 27.1028 -        vendor = cpu_vendor_names[c->x86_vendor];
 27.1029 -    else if (c->cpuid_level >= 0)
 27.1030 -        vendor = c->x86_vendor_id;
 27.1031 -
 27.1032 -    if (vendor && strncmp(c->x86_model_id, vendor, strlen(vendor)))
 27.1033 -        printk("%s ", vendor);
 27.1034 -
 27.1035 -    if (!c->x86_model_id[0])
 27.1036 -        printk("%d86", c->x86);
 27.1037 -    else
 27.1038 -        printk("%s", c->x86_model_id);
 27.1039 -
 27.1040 -    if (c->x86_mask || c->cpuid_level >= 0) 
 27.1041 -        printk(" stepping %02x\n", c->x86_mask);
 27.1042 -    else
 27.1043 -        printk("\n");
 27.1044 -}
 27.1045 -
 27.1046 -/*
 27.1047 - *	Get CPU information for use by the procfs.
 27.1048 - */
 27.1049 -static int show_cpuinfo(struct seq_file *m, void *v)
 27.1050 -{
 27.1051 -    /* 
 27.1052 -     * These flag bits must match the definitions in <asm/cpufeature.h>.
 27.1053 -     * NULL means this bit is undefined or reserved; either way it doesn't
 27.1054 -     * have meaning as far as Linux is concerned.  Note that it's important
 27.1055 -     * to realize there is a difference between this table and CPUID -- if
 27.1056 -     * applications want to get the raw CPUID data, they should access
 27.1057 -     * /dev/cpu/<cpu_nr>/cpuid instead.
 27.1058 -	 */
 27.1059 -    static char *x86_cap_flags[] = {
 27.1060 -        /* Intel-defined */
 27.1061 -        "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
 27.1062 -        "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
 27.1063 -        "pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
 27.1064 -        "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe",
 27.1065 -
 27.1066 -        /* AMD-defined */
 27.1067 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1068 -        NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
 27.1069 -        NULL, NULL, NULL, "mp", NULL, NULL, "mmxext", NULL,
 27.1070 -        NULL, NULL, NULL, NULL, NULL, "lm", "3dnowext", "3dnow",
 27.1071 -
 27.1072 -        /* Transmeta-defined */
 27.1073 -        "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
 27.1074 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1075 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1076 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1077 -
 27.1078 -        /* Other (Linux-defined) */
 27.1079 -        "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", 
 27.1080 -	NULL, NULL, NULL, NULL,
 27.1081 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1082 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1083 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1084 -
 27.1085 -        /* Intel-defined (#2) */
 27.1086 -        "pni", NULL, NULL, "monitor", "ds_cpl", NULL, NULL, "tm2",
 27.1087 -        "est", NULL, "cid", NULL, NULL, NULL, NULL, NULL,
 27.1088 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1089 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1090 -
 27.1091 -        /* VIA/Cyrix/Centaur-defined */
 27.1092 -        NULL, NULL, "xstore", NULL, NULL, NULL, NULL, NULL,
 27.1093 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1094 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1095 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 27.1096 -
 27.1097 -    };
 27.1098 -    struct cpuinfo_x86 *c = v;
 27.1099 -    int i, n = c - cpu_data;
 27.1100 -    int fpu_exception;
 27.1101 -
 27.1102 -#ifdef CONFIG_SMP
 27.1103 -    if (!(cpu_online_map & (1<<n)))
 27.1104 -        return 0;
 27.1105 -#endif
 27.1106 -    seq_printf(m, "processor\t: %d\n"
 27.1107 -               "vendor_id\t: %s\n"
 27.1108 -               "cpu family\t: %d\n"
 27.1109 -               "model\t\t: %d\n"
 27.1110 -               "model name\t: %s\n",
 27.1111 -               n,
 27.1112 -               c->x86_vendor_id[0] ? c->x86_vendor_id : "unknown",
 27.1113 -               c->x86,
 27.1114 -               c->x86_model,
 27.1115 -               c->x86_model_id[0] ? c->x86_model_id : "unknown");
 27.1116 -
 27.1117 -    if (c->x86_mask || c->cpuid_level >= 0)
 27.1118 -        seq_printf(m, "stepping\t: %d\n", c->x86_mask);
 27.1119 -    else
 27.1120 -        seq_printf(m, "stepping\t: unknown\n");
 27.1121 -
 27.1122 -    if ( test_bit(X86_FEATURE_TSC, &c->x86_capability) ) {
 27.1123 -        seq_printf(m, "cpu MHz\t\t: %lu.%03lu\n",
 27.1124 -                   cpu_khz / 1000, (cpu_khz % 1000));
 27.1125 -    }
 27.1126 -
 27.1127 -    /* Cache size */
 27.1128 -    if (c->x86_cache_size >= 0)
 27.1129 -        seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
 27.1130 -	
 27.1131 -	/* We use exception 16 if we have hardware math and we've either seen it or the CPU claims it is internal */
 27.1132 -    fpu_exception = c->hard_math && (ignore_irq13 || cpu_has_fpu);
 27.1133 -    seq_printf(m, "fdiv_bug\t: %s\n"
 27.1134 -               "hlt_bug\t\t: %s\n"
 27.1135 -               "f00f_bug\t: %s\n"
 27.1136 -               "coma_bug\t: %s\n"
 27.1137 -               "fpu\t\t: %s\n"
 27.1138 -               "fpu_exception\t: %s\n"
 27.1139 -               "cpuid level\t: %d\n"
 27.1140 -               "wp\t\t: %s\n"
 27.1141 -               "flags\t\t:",
 27.1142 -               c->fdiv_bug ? "yes" : "no",
 27.1143 -               c->hlt_works_ok ? "no" : "yes",
 27.1144 -               c->f00f_bug ? "yes" : "no",
 27.1145 -               c->coma_bug ? "yes" : "no",
 27.1146 -               c->hard_math ? "yes" : "no",
 27.1147 -               fpu_exception ? "yes" : "no",
 27.1148 -               c->cpuid_level,
 27.1149 -               c->wp_works_ok ? "yes" : "no");
 27.1150 -
 27.1151 -    for ( i = 0 ; i < 32*NCAPINTS ; i++ )
 27.1152 -        if ( test_bit(i, &c->x86_capability) &&
 27.1153 -             x86_cap_flags[i] != NULL )
 27.1154 -            seq_printf(m, " %s", x86_cap_flags[i]);
 27.1155 -
 27.1156 -    seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n",
 27.1157 -               c->loops_per_jiffy/(500000/HZ),
 27.1158 -               (c->loops_per_jiffy/(5000/HZ)) % 100);
 27.1159 -    return 0;
 27.1160 -}
 27.1161 -
 27.1162 -static void *c_start(struct seq_file *m, loff_t *pos)
 27.1163 -{
 27.1164 -    return *pos < NR_CPUS ? cpu_data + *pos : NULL;
 27.1165 -}
 27.1166 -static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 27.1167 -{
 27.1168 -    ++*pos;
 27.1169 -    return c_start(m, pos);
 27.1170 -}
 27.1171 -static void c_stop(struct seq_file *m, void *v)
 27.1172 -{
 27.1173 -}
 27.1174 -struct seq_operations cpuinfo_op = {
 27.1175 -    start:	c_start,
 27.1176 -    next:	c_next,
 27.1177 -    stop:	c_stop,
 27.1178 -    show:	show_cpuinfo,
 27.1179 -};
 27.1180 -
 27.1181 -unsigned long cpu_initialized __initdata = 0;
 27.1182 -
 27.1183 -/*
 27.1184 - * cpu_init() initializes state that is per-CPU. Some data is already
 27.1185 - * initialized (naturally) in the bootstrap process, such as the GDT
 27.1186 - * and IDT. We reload them nevertheless, this function acts as a
 27.1187 - * 'CPU state barrier', nothing should get across.
 27.1188 - */
 27.1189 -void __init cpu_init (void)
 27.1190 -{
 27.1191 -    int nr = smp_processor_id();
 27.1192 -
 27.1193 -    if (test_and_set_bit(nr, &cpu_initialized)) {
 27.1194 -        printk(KERN_WARNING "CPU#%d already initialized!\n", nr);
 27.1195 -        for (;;) __sti();
 27.1196 -    }
 27.1197 -    printk(KERN_INFO "Initializing CPU#%d\n", nr);
 27.1198 -
 27.1199 -    /*
 27.1200 -     * set up and load the per-CPU TSS and LDT
 27.1201 -     */
 27.1202 -    atomic_inc(&init_mm.mm_count);
 27.1203 -    current->active_mm = &init_mm;
 27.1204 -    if(current->mm)
 27.1205 -        BUG();
 27.1206 -    enter_lazy_tlb(&init_mm, current, nr);
 27.1207 -
 27.1208 -    HYPERVISOR_stack_switch(__KERNEL_DS, current->thread.esp0);
 27.1209 -
 27.1210 -    load_LDT(&init_mm.context);
 27.1211 -
 27.1212 -    /* Force FPU initialization. */
 27.1213 -    current->flags &= ~PF_USEDFPU;
 27.1214 -    current->used_math = 0;
 27.1215 -    stts();
 27.1216 -}
    28.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/signal.c	Mon Jul 11 14:48:47 2005 +0000
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,717 +0,0 @@
    28.4 -/*
    28.5 - *  linux/arch/i386/kernel/signal.c
    28.6 - *
    28.7 - *  Copyright (C) 1991, 1992  Linus Torvalds
    28.8 - *
    28.9 - *  1997-11-28  Modified for POSIX.1b signals by Richard Henderson
   28.10 - *  2000-06-20  Pentium III FXSR, SSE support by Gareth Hughes
   28.11 - */
   28.12 -
   28.13 -#include <linux/sched.h>
   28.14 -#include <linux/mm.h>
   28.15 -#include <linux/smp.h>
   28.16 -#include <linux/smp_lock.h>
   28.17 -#include <linux/kernel.h>
   28.18 -#include <linux/signal.h>
   28.19 -#include <linux/errno.h>
   28.20 -#include <linux/wait.h>
   28.21 -#include <linux/ptrace.h>
   28.22 -#include <linux/unistd.h>
   28.23 -#include <linux/stddef.h>
   28.24 -#include <linux/tty.h>
   28.25 -#include <linux/personality.h>
   28.26 -#include <asm/ucontext.h>
   28.27 -#include <asm/uaccess.h>
   28.28 -#include <asm/i387.h>
   28.29 -
   28.30 -#define DEBUG_SIG 0
   28.31 -
   28.32 -#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
   28.33 -
   28.34 -int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
   28.35 -
   28.36 -int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from)
   28.37 -{
   28.38 -	if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t)))
   28.39 -		return -EFAULT;
   28.40 -	if (from->si_code < 0)
   28.41 -		return __copy_to_user(to, from, sizeof(siginfo_t));
   28.42 -	else {
   28.43 -		int err;
   28.44 -
   28.45 -		/* If you change siginfo_t structure, please be sure
   28.46 -		   this code is fixed accordingly.
   28.47 -		   It should never copy any pad contained in the structure
   28.48 -		   to avoid security leaks, but must copy the generic
   28.49 -		   3 ints plus the relevant union member.  */
   28.50 -		err = __put_user(from->si_signo, &to->si_signo);
   28.51 -		err |= __put_user(from->si_errno, &to->si_errno);
   28.52 -		err |= __put_user((short)from->si_code, &to->si_code);
   28.53 -		/* First 32bits of unions are always present.  */
   28.54 -		err |= __put_user(from->si_pid, &to->si_pid);
   28.55 -		switch (from->si_code >> 16) {
   28.56 -		case __SI_FAULT >> 16:
   28.57 -			break;
   28.58 -		case __SI_CHLD >> 16:
   28.59 -			err |= __put_user(from->si_utime, &to->si_utime);
   28.60 -			err |= __put_user(from->si_stime, &to->si_stime);
   28.61 -			err |= __put_user(from->si_status, &to->si_status);
   28.62 -		default:
   28.63 -			err |= __put_user(from->si_uid, &to->si_uid);
   28.64 -			break;
   28.65 -		/* case __SI_RT: This is not generated by the kernel as of now.  */
   28.66 -		}
   28.67 -		return err;
   28.68 -	}
   28.69 -}
   28.70 -
   28.71 -/*
   28.72 - * Atomically swap in the new signal mask, and wait for a signal.
   28.73 - */
   28.74 -asmlinkage int
   28.75 -sys_sigsuspend(int history0, int history1, old_sigset_t mask)
   28.76 -{
   28.77 -	struct pt_regs * regs = (struct pt_regs *) &history0;
   28.78 -	sigset_t saveset;
   28.79 -
   28.80 -	mask &= _BLOCKABLE;
   28.81 -	spin_lock_irq(&current->sigmask_lock);
   28.82 -	saveset = current->blocked;
   28.83 -	siginitset(&current->blocked, mask);
   28.84 -	recalc_sigpending(current);
   28.85 -	spin_unlock_irq(&current->sigmask_lock);
   28.86 -
   28.87 -	regs->eax = -EINTR;
   28.88 -	while (1) {
   28.89 -		current->state = TASK_INTERRUPTIBLE;
   28.90 -		schedule();
   28.91 -		if (do_signal(regs, &saveset))
   28.92 -			return -EINTR;
   28.93 -	}
   28.94 -}
   28.95 -
   28.96 -asmlinkage int
   28.97 -sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize)
   28.98 -{
   28.99 -	struct pt_regs * regs = (struct pt_regs *) &unewset;
  28.100 -	sigset_t saveset, newset;
  28.101 -
  28.102 -	/* XXX: Don't preclude handling different sized sigset_t's.  */
  28.103 -	if (sigsetsize != sizeof(sigset_t))
  28.104 -		return -EINVAL;
  28.105 -
  28.106 -	if (copy_from_user(&newset, unewset, sizeof(newset)))
  28.107 -		return -EFAULT;
  28.108 -	sigdelsetmask(&newset, ~_BLOCKABLE);
  28.109 -
  28.110 -	spin_lock_irq(&current->sigmask_lock);
  28.111 -	saveset = current->blocked;
  28.112 -	current->blocked = newset;
  28.113 -	recalc_sigpending(current);
  28.114 -	spin_unlock_irq(&current->sigmask_lock);
  28.115 -
  28.116 -	regs->eax = -EINTR;
  28.117 -	while (1) {
  28.118 -		current->state = TASK_INTERRUPTIBLE;
  28.119 -		schedule();
  28.120 -		if (do_signal(regs, &saveset))
  28.121 -			return -EINTR;
  28.122 -	}
  28.123 -}
  28.124 -
  28.125 -asmlinkage int 
  28.126 -sys_sigaction(int sig, const struct old_sigaction *act,
  28.127 -	      struct old_sigaction *oact)
  28.128 -{
  28.129 -	struct k_sigaction new_ka, old_ka;
  28.130 -	int ret;
  28.131 -
  28.132 -	if (act) {
  28.133 -		old_sigset_t mask;
  28.134 -		if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
  28.135 -		    __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
  28.136 -		    __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
  28.137 -			return -EFAULT;
  28.138 -		__get_user(new_ka.sa.sa_flags, &act->sa_flags);
  28.139 -		__get_user(mask, &act->sa_mask);
  28.140 -		siginitset(&new_ka.sa.sa_mask, mask);
  28.141 -	}
  28.142 -
  28.143 -	ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
  28.144 -
  28.145 -	if (!ret && oact) {
  28.146 -		if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
  28.147 -		    __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
  28.148 -		    __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
  28.149 -			return -EFAULT;
  28.150 -		__put_user(old_ka.sa.sa_flags, &oact->sa_flags);
  28.151 -		__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
  28.152 -	}
  28.153 -
  28.154 -	return ret;
  28.155 -}
  28.156 -
  28.157 -asmlinkage int
  28.158 -sys_sigaltstack(const stack_t *uss, stack_t *uoss)
  28.159 -{
  28.160 -	struct pt_regs *regs = (struct pt_regs *) &uss;
  28.161 -	return do_sigaltstack(uss, uoss, regs->esp);
  28.162 -}
  28.163 -
  28.164 -
  28.165 -/*
  28.166 - * Do a signal return; undo the signal stack.
  28.167 - */
  28.168 -
  28.169 -struct sigframe
  28.170 -{
  28.171 -	char *pretcode;
  28.172 -	int sig;
  28.173 -	struct sigcontext sc;
  28.174 -	struct _fpstate fpstate;
  28.175 -	unsigned long extramask[_NSIG_WORDS-1];
  28.176 -	char retcode[8];
  28.177 -};
  28.178 -
  28.179 -struct rt_sigframe
  28.180 -{
  28.181 -	char *pretcode;
  28.182 -	int sig;
  28.183 -	struct siginfo *pinfo;
  28.184 -	void *puc;
  28.185 -	struct siginfo info;
  28.186 -	struct ucontext uc;
  28.187 -	struct _fpstate fpstate;
  28.188 -	char retcode[8];
  28.189 -};
  28.190 -
  28.191 -static int
  28.192 -restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *peax)
  28.193 -{
  28.194 -	unsigned int err = 0;
  28.195 -
  28.196 -#define COPY(x)		err |= __get_user(regs->x, &sc->x)
  28.197 -
  28.198 -#define COPY_SEG(seg)							\
  28.199 -	{ unsigned short tmp;						\
  28.200 -	  err |= __get_user(tmp, &sc->seg);				\
  28.201 -	  regs->x##seg = tmp; }
  28.202 -
  28.203 -#define COPY_SEG_STRICT(seg)						\
  28.204 -	{ unsigned short tmp;						\
  28.205 -	  err |= __get_user(tmp, &sc->seg);				\
  28.206 -	  regs->x##seg = tmp|3; }
  28.207 -
  28.208 -#define GET_SEG(seg)							\
  28.209 -	{ unsigned short tmp;						\
  28.210 -	  err |= __get_user(tmp, &sc->seg);				\
  28.211 -	  loadsegment(seg,tmp); }
  28.212 -
  28.213 -	GET_SEG(gs);
  28.214 -	GET_SEG(fs);
  28.215 -	COPY_SEG(es);
  28.216 -	COPY_SEG(ds);
  28.217 -	COPY(edi);
  28.218 -	COPY(esi);
  28.219 -	COPY(ebp);
  28.220 -	COPY(esp);
  28.221 -	COPY(ebx);
  28.222 -	COPY(edx);
  28.223 -	COPY(ecx);
  28.224 -	COPY(eip);
  28.225 -	COPY_SEG_STRICT(cs);
  28.226 -	COPY_SEG_STRICT(ss);
  28.227 -	
  28.228 -	{
  28.229 -		unsigned int tmpflags;
  28.230 -		err |= __get_user(tmpflags, &sc->eflags);
  28.231 -		regs->eflags = (regs->eflags & ~0x40DD5) | (tmpflags & 0x40DD5);
  28.232 -		regs->orig_eax = -1;		/* disable syscall checks */
  28.233 -	}
  28.234 -
  28.235 -	{
  28.236 -		struct _fpstate * buf;
  28.237 -		err |= __get_user(buf, &sc->fpstate);
  28.238 -		if (buf) {
  28.239 -			if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
  28.240 -				goto badframe;
  28.241 -			err |= restore_i387(buf);
  28.242 -		}
  28.243 -	}
  28.244 -
  28.245 -	err |= __get_user(*peax, &sc->eax);
  28.246 -	return err;
  28.247 -
  28.248 -badframe:
  28.249 -	return 1;
  28.250 -}
  28.251 -
  28.252 -asmlinkage int sys_sigreturn(unsigned long __unused)
  28.253 -{
  28.254 -	struct pt_regs *regs = (struct pt_regs *) &__unused;
  28.255 -	struct sigframe *frame = (struct sigframe *)(regs->esp - 8);
  28.256 -	sigset_t set;
  28.257 -	int eax;
  28.258 -
  28.259 -	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
  28.260 -		goto badframe;
  28.261 -	if (__get_user(set.sig[0], &frame->sc.oldmask)
  28.262 -	    || (_NSIG_WORDS > 1
  28.263 -		&& __copy_from_user(&set.sig[1], &frame->extramask,
  28.264 -				    sizeof(frame->extramask))))
  28.265 -		goto badframe;
  28.266 -
  28.267 -	sigdelsetmask(&set, ~_BLOCKABLE);
  28.268 -	spin_lock_irq(&current->sigmask_lock);
  28.269 -	current->blocked = set;
  28.270 -	recalc_sigpending(current);
  28.271 -	spin_unlock_irq(&current->sigmask_lock);
  28.272 -	
  28.273 -	if (restore_sigcontext(regs, &frame->sc, &eax))
  28.274 -		goto badframe;
  28.275 -	return eax;
  28.276 -
  28.277 -badframe:
  28.278 -	force_sig(SIGSEGV, current);
  28.279 -	return 0;
  28.280 -}	
  28.281 -
  28.282 -asmlinkage int sys_rt_sigreturn(unsigned long __unused)
  28.283 -{
  28.284 -	struct pt_regs *regs = (struct pt_regs *) &__unused;
  28.285 -	struct rt_sigframe *frame = (struct rt_sigframe *)(regs->esp - 4);
  28.286 -	sigset_t set;
  28.287 -	stack_t st;
  28.288 -	int eax;
  28.289 -
  28.290 -	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
  28.291 -		goto badframe;
  28.292 -	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
  28.293 -		goto badframe;
  28.294 -
  28.295 -	sigdelsetmask(&set, ~_BLOCKABLE);
  28.296 -	spin_lock_irq(&current->sigmask_lock);
  28.297 -	current->blocked = set;
  28.298 -	recalc_sigpending(current);
  28.299 -	spin_unlock_irq(&current->sigmask_lock);
  28.300 -	
  28.301 -	if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax))
  28.302 -		goto badframe;
  28.303 -
  28.304 -	if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
  28.305 -		goto badframe;
  28.306 -	/* It is more difficult to avoid calling this function than to
  28.307 -	   call it and ignore errors.  */
  28.308 -	do_sigaltstack(&st, NULL, regs->esp);
  28.309 -
  28.310 -	return eax;
  28.311 -
  28.312 -badframe:
  28.313 -	force_sig(SIGSEGV, current);
  28.314 -	return 0;
  28.315 -}	
  28.316 -
  28.317 -/*
  28.318 - * Set up a signal frame.
  28.319 - */
  28.320 -
  28.321 -static int
  28.322 -setup_sigcontext(struct sigcontext *sc, struct _fpstate *fpstate,
  28.323 -		 struct pt_regs *regs, unsigned long mask)
  28.324 -{
  28.325 -	int tmp, err = 0;
  28.326 -
  28.327 -	tmp = 0;
  28.328 -	__asm__("movl %%gs,%0" : "=r"(tmp): "0"(tmp));
  28.329 -	err |= __put_user(tmp, (unsigned int *)&sc->gs);
  28.330 -	__asm__("movl %%fs,%0" : "=r"(tmp): "0"(tmp));
  28.331 -	err |= __put_user(tmp, (unsigned int *)&sc->fs);
  28.332 -
  28.333 -	err |= __put_user(regs->xes, (unsigned int *)&sc->es);
  28.334 -	err |= __put_user(regs->xds, (unsigned int *)&sc->ds);
  28.335 -	err |= __put_user(regs->edi, &sc->edi);
  28.336 -	err |= __put_user(regs->esi, &sc->esi);
  28.337 -	err |= __put_user(regs->ebp, &sc->ebp);
  28.338 -	err |= __put_user(regs->esp, &sc->esp);
  28.339 -	err |= __put_user(regs->ebx, &sc->ebx);
  28.340 -	err |= __put_user(regs->edx, &sc->edx);
  28.341 -	err |= __put_user(regs->ecx, &sc->ecx);
  28.342 -	err |= __put_user(regs->eax, &sc->eax);
  28.343 -	err |= __put_user(current->thread.trap_no, &sc->trapno);
  28.344 -	err |= __put_user(current->thread.error_code, &sc->err);
  28.345 -	err |= __put_user(regs->eip, &sc->eip);
  28.346 -	err |= __put_user(regs->xcs, (unsigned int *)&sc->cs);
  28.347 -	err |= __put_user(regs->eflags, &sc->eflags);
  28.348 -	err |= __put_user(regs->esp, &sc->esp_at_signal);
  28.349 -	err |= __put_user(regs->xss, (unsigned int *)&sc->ss);
  28.350 -
  28.351 -	tmp = save_i387(fpstate);
  28.352 -	if (tmp < 0)
  28.353 -	  err = 1;
  28.354 -	else
  28.355 -	  err |= __put_user(tmp ? fpstate : NULL, &sc->fpstate);
  28.356 -
  28.357 -	/* non-iBCS2 extensions.. */
  28.358 -	err |= __put_user(mask, &sc->oldmask);
  28.359 -	err |= __put_user(current->thread.cr2, &sc->cr2);
  28.360 -
  28.361 -	return err;
  28.362 -}
  28.363 -
  28.364 -/*
  28.365 - * Determine which stack to use..
  28.366 - */
  28.367 -static inline void *
  28.368 -get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
  28.369 -{
  28.370 -	unsigned long esp;
  28.371 -
  28.372 -	/* Default to using normal stack */
  28.373 -	esp = regs->esp;
  28.374 -
  28.375 -	/* This is the X/Open sanctioned signal stack switching.  */
  28.376 -	if (ka->sa.sa_flags & SA_ONSTACK) {
  28.377 -		if (sas_ss_flags(esp) == 0)
  28.378 -			esp = current->sas_ss_sp + current->sas_ss_size;
  28.379 -	}
  28.380 -
  28.381 -	/* This is the legacy signal stack switching. */
  28.382 -	else if ((regs->xss & 0xffff) != __USER_DS &&
  28.383 -		 !(ka->sa.sa_flags & SA_RESTORER) &&
  28.384 -		 ka->sa.sa_restorer) {
  28.385 -		esp = (unsigned long) ka->sa.sa_restorer;
  28.386 -	}
  28.387 -
  28.388 -	return (void *)((esp - frame_size) & -8ul);
  28.389 -}
  28.390 -
  28.391 -static void setup_frame(int sig, struct k_sigaction *ka,
  28.392 -			sigset_t *set, struct pt_regs * regs)
  28.393 -{
  28.394 -	struct sigframe *frame;
  28.395 -	int err = 0;
  28.396 -
  28.397 -	frame = get_sigframe(ka, regs, sizeof(*frame));
  28.398 -
  28.399 -	if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
  28.400 -		goto give_sigsegv;
  28.401 -
  28.402 -	err |= __put_user((current->exec_domain
  28.403 -		           && current->exec_domain->signal_invmap
  28.404 -		           && sig < 32
  28.405 -		           ? current->exec_domain->signal_invmap[sig]
  28.406 -		           : sig),
  28.407 -		          &frame->sig);
  28.408 -	if (err)
  28.409 -		goto give_sigsegv;
  28.410 -
  28.411 -	err |= setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]);
  28.412 -	if (err)
  28.413 -		goto give_sigsegv;
  28.414 -
  28.415 -	if (_NSIG_WORDS > 1) {
  28.416 -		err |= __copy_to_user(frame->extramask, &set->sig[1],
  28.417 -				      sizeof(frame->extramask));
  28.418 -	}
  28.419 -	if (err)
  28.420 -		goto give_sigsegv;
  28.421 -
  28.422 -	/* Set up to return from userspace.  If provided, use a stub
  28.423 -	   already in userspace.  */
  28.424 -	if (ka->sa.sa_flags & SA_RESTORER) {
  28.425 -		err |= __put_user(ka->sa.sa_restorer, &frame->pretcode);
  28.426 -	} else {
  28.427 -		err |= __put_user(frame->retcode, &frame->pretcode);
  28.428 -		/* This is popl %eax ; movl $,%eax ; int $0x80 */
  28.429 -		err |= __put_user(0xb858, (short *)(frame->retcode+0));
  28.430 -		err |= __put_user(__NR_sigreturn, (int *)(frame->retcode+2));
  28.431 -		err |= __put_user(0x80cd, (short *)(frame->retcode+6));
  28.432 -	}
  28.433 -
  28.434 -	if (err)
  28.435 -		goto give_sigsegv;
  28.436 -
  28.437 -	/* Set up registers for signal handler */
  28.438 -	regs->esp = (unsigned long) frame;
  28.439 -	regs->eip = (unsigned long) ka->sa.sa_handler;
  28.440 -
  28.441 -	set_fs(USER_DS);
  28.442 -	regs->xds = __USER_DS;
  28.443 -	regs->xes = __USER_DS;
  28.444 -	regs->xss = __USER_DS;
  28.445 -	regs->xcs = __USER_CS;
  28.446 -	regs->eflags &= ~TF_MASK;
  28.447 -
  28.448 -#if DEBUG_SIG
  28.449 -	printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
  28.450 -		current->comm, current->pid, frame, regs->eip, frame->pretcode);
  28.451 -#endif
  28.452 -
  28.453 -	return;
  28.454 -
  28.455 -give_sigsegv:
  28.456 -	if (sig == SIGSEGV)
  28.457 -		ka->sa.sa_handler = SIG_DFL;
  28.458 -	force_sig(SIGSEGV, current);
  28.459 -}
  28.460 -
  28.461 -static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
  28.462 -			   sigset_t *set, struct pt_regs * regs)
  28.463 -{
  28.464 -	struct rt_sigframe *frame;
  28.465 -	int err = 0;
  28.466 -
  28.467 -	frame = get_sigframe(ka, regs, sizeof(*frame));
  28.468 -
  28.469 -	if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
  28.470 -		goto give_sigsegv;
  28.471 -
  28.472 -	err |= __put_user((current->exec_domain
  28.473 -		    	   && current->exec_domain->signal_invmap
  28.474 -		    	   && sig < 32
  28.475 -		    	   ? current->exec_domain->signal_invmap[sig]
  28.476 -			   : sig),
  28.477 -			  &frame->sig);
  28.478 -	err |= __put_user(&frame->info, &frame->pinfo);
  28.479 -	err |= __put_user(&frame->uc, &frame->puc);
  28.480 -	err |= copy_siginfo_to_user(&frame->info, info);
  28.481 -	if (err)
  28.482 -		goto give_sigsegv;
  28.483 -
  28.484 -	/* Create the ucontext.  */
  28.485 -	err |= __put_user(0, &frame->uc.uc_flags);
  28.486 -	err |= __put_user(0, &frame->uc.uc_link);
  28.487 -	err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
  28.488 -	err |= __put_user(sas_ss_flags(regs->esp),
  28.489 -			  &frame->uc.uc_stack.ss_flags);
  28.490 -	err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
  28.491 -	err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate,
  28.492 -			        regs, set->sig[0]);
  28.493 -	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
  28.494 -	if (err)
  28.495 -		goto give_sigsegv;
  28.496 -
  28.497 -	/* Set up to return from userspace.  If provided, use a stub
  28.498 -	   already in userspace.  */
  28.499 -	if (ka->sa.sa_flags & SA_RESTORER) {
  28.500 -		err |= __put_user(ka->sa.sa_restorer, &frame->pretcode);
  28.501 -	} else {
  28.502 -		err |= __put_user(frame->retcode, &frame->pretcode);
  28.503 -		/* This is movl $,%eax ; int $0x80 */
  28.504 -		err |= __put_user(0xb8, (char *)(frame->retcode+0));
  28.505 -		err |= __put_user(__NR_rt_sigreturn, (int *)(frame->retcode+1));
  28.506 -		err |= __put_user(0x80cd, (short *)(frame->retcode+5));
  28.507 -	}
  28.508 -
  28.509 -	if (err)
  28.510 -		goto give_sigsegv;
  28.511 -
  28.512 -	/* Set up registers for signal handler */
  28.513 -	regs->esp = (unsigned long) frame;
  28.514 -	regs->eip = (unsigned long) ka->sa.sa_handler;
  28.515 -
  28.516 -	set_fs(USER_DS);
  28.517 -	regs->xds = __USER_DS;
  28.518 -	regs->xes = __USER_DS;
  28.519 -	regs->xss = __USER_DS;
  28.520 -	regs->xcs = __USER_CS;
  28.521 -	regs->eflags &= ~TF_MASK;
  28.522 -
  28.523 -#if DEBUG_SIG
  28.524 -	printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
  28.525 -		current->comm, current->pid, frame, regs->eip, frame->pretcode);
  28.526 -#endif
  28.527 -
  28.528 -	return;
  28.529 -
  28.530 -give_sigsegv:
  28.531 -	if (sig == SIGSEGV)
  28.532 -		ka->sa.sa_handler = SIG_DFL;
  28.533 -	force_sig(SIGSEGV, current);
  28.534 -}
  28.535 -
  28.536 -/*
  28.537 - * OK, we're invoking a handler
  28.538 - */	
  28.539 -
  28.540 -static void
  28.541 -handle_signal(unsigned long sig, struct k_sigaction *ka,
  28.542 -	      siginfo_t *info, sigset_t *oldset, struct pt_regs * regs)
  28.543 -{
  28.544 -	/* Are we from a system call? */
  28.545 -	if (regs->orig_eax >= 0) {
  28.546 -		/* If so, check system call restarting.. */
  28.547 -		switch (regs->eax) {
  28.548 -			case -ERESTARTNOHAND:
  28.549 -				regs->eax = -EINTR;
  28.550 -				break;
  28.551 -
  28.552 -			case -ERESTARTSYS:
  28.553 -				if (!(ka->sa.sa_flags & SA_RESTART)) {
  28.554 -					regs->eax = -EINTR;
  28.555 -					break;
  28.556 -				}
  28.557 -			/* fallthrough */
  28.558 -			case -ERESTARTNOINTR:
  28.559 -				regs->eax = regs->orig_eax;
  28.560 -				regs->eip -= 2;
  28.561 -		}
  28.562 -	}
  28.563 -
  28.564 -	/* Set up the stack frame */
  28.565 -	if (ka->sa.sa_flags & SA_SIGINFO)
  28.566 -		setup_rt_frame(sig, ka, info, oldset, regs);
  28.567 -	else
  28.568 -		setup_frame(sig, ka, oldset, regs);
  28.569 -
  28.570 -	if (ka->sa.sa_flags & SA_ONESHOT)
  28.571 -		ka->sa.sa_handler = SIG_DFL;
  28.572 -
  28.573 -	if (!(ka->sa.sa_flags & SA_NODEFER)) {
  28.574 -		spin_lock_irq(&current->sigmask_lock);
  28.575 -		sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
  28.576 -		sigaddset(&current->blocked,sig);
  28.577 -		recalc_sigpending(current);
  28.578 -		spin_unlock_irq(&current->sigmask_lock);
  28.579 -	}
  28.580 -}
  28.581 -
  28.582 -/*
  28.583 - * Note that 'init' is a special process: it doesn't get signals it doesn't
  28.584 - * want to handle. Thus you cannot kill init even with a SIGKILL even by
  28.585 - * mistake.
  28.586 - */
  28.587 -int fastcall do_signal(struct pt_regs *regs, sigset_t *oldset)
  28.588 -{
  28.589 -	siginfo_t info;
  28.590 -	struct k_sigaction *ka;
  28.591 -
  28.592 -	/*
  28.593 -	 * We want the common case to go fast, which
  28.594 -	 * is why we may in certain cases get here from
  28.595 -	 * kernel mode. Just return without doing anything
  28.596 -	 * if so.
  28.597 -	 */
  28.598 -	if ((regs->xcs & 2) != 2)
  28.599 -		return 1;
  28.600 -
  28.601 -	if (!oldset)
  28.602 -		oldset = &current->blocked;
  28.603 -
  28.604 -	for (;;) {
  28.605 -		unsigned long signr;
  28.606 -
  28.607 -		spin_lock_irq(&current->sigmask_lock);
  28.608 -		signr = dequeue_signal(&current->blocked, &info);
  28.609 -		spin_unlock_irq(&current->sigmask_lock);
  28.610 -
  28.611 -		if (!signr)
  28.612 -			break;
  28.613 -
  28.614 -		if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
  28.615 -			/* Let the debugger run.  */
  28.616 -			current->exit_code = signr;
  28.617 -			current->state = TASK_STOPPED;
  28.618 -			notify_parent(current, SIGCHLD);
  28.619 -			schedule();
  28.620 -
  28.621 -			/* We're back.  Did the debugger cancel the sig?  */
  28.622 -			if (!(signr = current->exit_code))
  28.623 -				continue;
  28.624 -			current->exit_code = 0;
  28.625 -
  28.626 -			/* The debugger continued.  Ignore SIGSTOP.  */
  28.627 -			if (signr == SIGSTOP)
  28.628 -				continue;
  28.629 -
  28.630 -			/* Update the siginfo structure.  Is this good?  */
  28.631 -			if (signr != info.si_signo) {
  28.632 -				info.si_signo = signr;
  28.633 -				info.si_errno = 0;
  28.634 -				info.si_code = SI_USER;
  28.635 -				info.si_pid = current->p_pptr->pid;
  28.636 -				info.si_uid = current->p_pptr->uid;
  28.637 -			}
  28.638 -
  28.639 -			/* If the (new) signal is now blocked, requeue it.  */
  28.640 -			if (sigismember(&current->blocked, signr)) {
  28.641 -				send_sig_info(signr, &info, current);
  28.642 -				continue;
  28.643 -			}
  28.644 -		}
  28.645 -
  28.646 -		ka = &current->sig->action[signr-1];
  28.647 -		if (ka->sa.sa_handler == SIG_IGN) {
  28.648 -			if (signr != SIGCHLD)
  28.649 -				continue;
  28.650 -			/* Check for SIGCHLD: it's special.  */
  28.651 -			while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0)
  28.652 -				/* nothing */;
  28.653 -			continue;
  28.654 -		}
  28.655 -
  28.656 -		if (ka->sa.sa_handler == SIG_DFL) {
  28.657 -			int exit_code = signr;
  28.658 -
  28.659 -			/* Init gets no signals it doesn't want.  */
  28.660 -			if (current->pid == 1)
  28.661 -				continue;
  28.662 -
  28.663 -			switch (signr) {
  28.664 -			case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG:
  28.665 -				continue;
  28.666 -
  28.667 -			case SIGTSTP: case SIGTTIN: case SIGTTOU:
  28.668 -				if (is_orphaned_pgrp(current->pgrp))
  28.669 -					continue;
  28.670 -				/* FALLTHRU */
  28.671 -
  28.672 -			case SIGSTOP: {
  28.673 -				struct signal_struct *sig;
  28.674 -				current->state = TASK_STOPPED;
  28.675 -				current->exit_code = signr;
  28.676 -				sig = current->p_pptr->sig;
  28.677 -				if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
  28.678 -					notify_parent(current, SIGCHLD);
  28.679 -				schedule();
  28.680 -				continue;
  28.681 -			}
  28.682 -
  28.683 -			case SIGQUIT: case SIGILL: case SIGTRAP:
  28.684 -			case SIGABRT: case SIGFPE: case SIGSEGV:
  28.685 -			case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ:
  28.686 -				if (do_coredump(signr, regs))
  28.687 -					exit_code |= 0x80;
  28.688 -				/* FALLTHRU */
  28.689 -
  28.690 -			default:
  28.691 -				sig_exit(signr, exit_code, &info);
  28.692 -				/* NOTREACHED */
  28.693 -			}
  28.694 -		}
  28.695 -
  28.696 -		/* Reenable any watchpoints before delivering the
  28.697 -		 * signal to user space. The processor register will
  28.698 -		 * have been cleared if the watchpoint triggered
  28.699 -		 * inside the kernel.
  28.700 -		 */
  28.701 -                if ( current->thread.debugreg[7] != 0 )
  28.702 -                    HYPERVISOR_set_debugreg(7, current->thread.debugreg[7]);
  28.703 -
  28.704 -		/* Whee!  Actually deliver the signal.  */
  28.705 -		handle_signal(signr, ka, &info, oldset, regs);
  28.706 -		return 1;
  28.707 -	}
  28.708 -
  28.709 -	/* Did we come from a system call? */
  28.710 -	if (regs->orig_eax >= 0) {
  28.711 -		/* Restart the system call - no handlers present */
  28.712 -		if (regs->eax == -ERESTARTNOHAND ||
  28.713 -		    regs->eax == -ERESTARTSYS ||
  28.714 -		    regs->eax == -ERESTARTNOINTR) {
  28.715 -			regs->eax = regs->orig_eax;
  28.716 -			regs->eip -= 2;
  28.717 -		}
  28.718 -	}
  28.719 -	return 0;
  28.720 -}
    29.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/time.c	Mon Jul 11 14:48:47 2005 +0000
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,721 +0,0 @@
    29.4 -/* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
    29.5 - ****************************************************************************
    29.6 - * (C) 2002-2003 - Rolf Neugebauer - Intel Research Cambridge
    29.7 - * (C) 2002-2003 - Keir Fraser - University of Cambridge
    29.8 - ****************************************************************************
    29.9 - *
   29.10 - *        File: arch/xen/kernel/time.c
   29.11 - *      Author: Rolf Neugebauer and Keir Fraser
   29.12 - * 
   29.13 - * Description: Interface with Xen to get correct notion of time
   29.14 - */
   29.15 -
   29.16 -/*
   29.17 - *  linux/arch/i386/kernel/time.c
   29.18 - *
   29.19 - *  Copyright (C) 1991, 1992, 1995  Linus Torvalds
   29.20 - *
   29.21 - * This file contains the PC-specific time handling details:
   29.22 - * reading the RTC at bootup, etc..
   29.23 - * 1994-07-02    Alan Modra
   29.24 - * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
   29.25 - * 1995-03-26    Markus Kuhn
   29.26 - *      fixed 500 ms bug at call to set_rtc_mmss, fixed DS12887
   29.27 - *      precision CMOS clock update
   29.28 - * 1996-05-03    Ingo Molnar
   29.29 - *      fixed time warps in do_[slow|fast]_gettimeoffset()
   29.30 - * 1997-09-10 Updated NTP code according to technical memorandum Jan '96
   29.31 - *  "A Kernel Model for Precision Timekeeping" by Dave Mills
   29.32 - * 1998-09-05    (Various)
   29.33 - * More robust do_fast_gettimeoffset() algorithm implemented
   29.34 - * (works with APM, Cyrix 6x86MX and Centaur C6),
   29.35 - * monotonic gettimeofday() with fast_get_timeoffset(),
   29.36 - * drift-proof precision TSC calibration on boot
   29.37 - * (C. Scott Ananian <cananian@alumni.princeton.edu>, Andrew D.
   29.38 - * Balsa <andrebalsa@altern.org>, Philip Gladstone <philip@raptor.com>;
   29.39 - * ported from 2.0.35 Jumbo-9 by Michael Krause <m.krause@tu-harburg.de>).
   29.40 - * 1998-12-16    Andrea Arcangeli
   29.41 - * Fixed Jumbo-9 code in 2.1.131: do_gettimeofday was missing 1 jiffy
   29.42 - * because was not accounting lost_ticks.
   29.43 - * 1998-12-24 Copyright (C) 1998  Andrea Arcangeli
   29.44 - * Fixed a xtime SMP race (we need the xtime_lock rw spinlock to
   29.45 - * serialize accesses to xtime/lost_ticks).
   29.46 - */
   29.47 -
   29.48 -#include <asm/smp.h>
   29.49 -#include <asm/irq.h>
   29.50 -#include <asm/msr.h>
   29.51 -#include <asm/delay.h>
   29.52 -#include <asm/mpspec.h>
   29.53 -#include <asm/uaccess.h>
   29.54 -#include <asm/processor.h>
   29.55 -
   29.56 -#include <asm/div64.h>
   29.57 -#include <asm/hypervisor.h>
   29.58 -#include <asm-xen/xen-public/dom0_ops.h>
   29.59 -
   29.60 -#include <linux/mc146818rtc.h>
   29.61 -#include <linux/kernel.h>
   29.62 -#include <linux/interrupt.h>
   29.63 -#include <linux/time.h>
   29.64 -#include <linux/init.h>
   29.65 -#include <linux/smp.h>
   29.66 -#include <linux/irq.h>
   29.67 -#include <linux/sysctl.h>
   29.68 -#include <linux/sysrq.h>
   29.69 -
   29.70 -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
   29.71 -extern rwlock_t xtime_lock;
   29.72 -extern unsigned long wall_jiffies;
   29.73 -
   29.74 -unsigned long cpu_khz; /* get this from Xen, used elsewhere */
   29.75 -
   29.76 -static unsigned int rdtsc_bitshift;
   29.77 -static u32 st_scale_f; /* convert ticks -> usecs */
   29.78 -static u32 st_scale_i; /* convert ticks -> usecs */
   29.79 -
   29.80 -/* These are peridically updated in shared_info, and then copied here. */
   29.81 -static u32 shadow_tsc_stamp;
   29.82 -static u64 shadow_system_time;
   29.83 -static u32 shadow_time_version;
   29.84 -static struct timeval shadow_tv;
   29.85 -
   29.86 -/*
   29.87 - * We use this to ensure that gettimeofday() is monotonically increasing. We
   29.88 - * only break this guarantee if the wall clock jumps backwards "a long way".
   29.89 - */
   29.90 -static struct timeval last_seen_tv = {0,0};
   29.91 -
   29.92 -#ifdef CONFIG_XEN_PRIVILEGED_GUEST
   29.93 -/* Periodically propagate synchronised time base to the RTC and to Xen. */
   29.94 -static long last_update_to_rtc, last_update_to_xen;
   29.95 -#endif
   29.96 -
   29.97 -/* Periodically take synchronised time base from Xen, if we need it. */
   29.98 -static long last_update_from_xen;   /* UTC seconds when last read Xen clock. */
   29.99 -
  29.100 -/* Keep track of last time we did processing/updating of jiffies and xtime. */
  29.101 -static u64 processed_system_time;   /* System time (ns) at last processing. */
  29.102 -
  29.103 -#define NS_PER_TICK (1000000000ULL/HZ)
  29.104 -
  29.105 -#ifndef NSEC_PER_SEC
  29.106 -#define NSEC_PER_SEC (1000000000L)
  29.107 -#endif
  29.108 -
  29.109 -#define HANDLE_USEC_UNDERFLOW(_tv)         \
  29.110 -    do {                                   \
  29.111 -        while ( (_tv).tv_usec < 0 )        \
  29.112 -        {                                  \
  29.113 -            (_tv).tv_usec += 1000000;      \
  29.114 -            (_tv).tv_sec--;                \
  29.115 -        }                                  \
  29.116 -    } while ( 0 )
  29.117 -#define HANDLE_USEC_OVERFLOW(_tv)          \
  29.118 -    do {                                   \
  29.119 -        while ( (_tv).tv_usec >= 1000000 ) \
  29.120 -        {                                  \
  29.121 -            (_tv).tv_usec -= 1000000;      \
  29.122 -            (_tv).tv_sec++;                \
  29.123 -        }                                  \
  29.124 -    } while ( 0 )
  29.125 -static inline void __normalize_time(time_t *sec, s64 *nsec)
  29.126 -{
  29.127 -	while (*nsec >= NSEC_PER_SEC) {
  29.128 -		(*nsec) -= NSEC_PER_SEC;
  29.129 -		(*sec)++;
  29.130 -	}
  29.131 -	while (*nsec < 0) {
  29.132 -		(*nsec) += NSEC_PER_SEC;
  29.133 -		(*sec)--;
  29.134 -	}
  29.135 -}
  29.136 -
  29.137 -/* Dynamically-mapped IRQs. */
  29.138 -static int time_irq, debug_irq;
  29.139 -
  29.140 -/* Does this guest OS track Xen time, or set its wall clock independently? */
  29.141 -static int independent_wallclock = 0;
  29.142 -static int __init __independent_wallclock(char *str)
  29.143 -{
  29.144 -    independent_wallclock = 1;
  29.145 -    return 1;
  29.146 -}
  29.147 -__setup("independent_wallclock", __independent_wallclock);
  29.148 -#define INDEPENDENT_WALLCLOCK() \
  29.149 -    (independent_wallclock || (xen_start_info.flags & SIF_INITDOMAIN))
  29.150 -
  29.151 -#ifdef CONFIG_XEN_PRIVILEGED_GUEST
  29.152 -/*
  29.153 - * In order to set the CMOS clock precisely, set_rtc_mmss has to be
  29.154 - * called 500 ms after the second nowtime has started, because when
  29.155 - * nowtime is written into the registers of the CMOS clock, it will
  29.156 - * jump to the next second precisely 500 ms later. Check the Motorola
  29.157 - * MC146818A or Dallas DS12887 data sheet for details.
  29.158 - *
  29.159 - * BUG: This routine does not handle hour overflow properly; it just
  29.160 - *      sets the minutes. Usually you'll only notice that after reboot!
  29.161 - */
  29.162 -static int set_rtc_mmss(unsigned long nowtime)
  29.163 -{
  29.164 -    int retval = 0;
  29.165 -    int real_seconds, real_minutes, cmos_minutes;
  29.166 -    unsigned char save_control, save_freq_select;
  29.167 -
  29.168 -    /* gets recalled with irq locally disabled */
  29.169 -    spin_lock(&rtc_lock);
  29.170 -    save_control = CMOS_READ(RTC_CONTROL);
  29.171 -    CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
  29.172 -
  29.173 -    save_freq_select = CMOS_READ(RTC_FREQ_SELECT);
  29.174 -    CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
  29.175 -
  29.176 -    cmos_minutes = CMOS_READ(RTC_MINUTES);
  29.177 -    if ( !(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD )
  29.178 -        BCD_TO_BIN(cmos_minutes);
  29.179 -
  29.180 -    /*
  29.181 -     * since we're only adjusting minutes and seconds, don't interfere with
  29.182 -     * hour overflow. This avoids messing with unknown time zones but requires
  29.183 -     * your RTC not to be off by more than 15 minutes
  29.184 -     */
  29.185 -    real_seconds = nowtime % 60;
  29.186 -    real_minutes = nowtime / 60;
  29.187 -    if ( ((abs(real_minutes - cmos_minutes) + 15)/30) & 1 )
  29.188 -        real_minutes += 30;  /* correct for half hour time zone */
  29.189 -    real_minutes %= 60;
  29.190 -
  29.191 -    if ( abs(real_minutes - cmos_minutes) < 30 )
  29.192 -    {
  29.193 -        if ( !(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD )
  29.194 -        {
  29.195 -            BIN_TO_BCD(real_seconds);
  29.196 -            BIN_TO_BCD(real_minutes);
  29.197 -        }
  29.198 -        CMOS_WRITE(real_seconds,RTC_SECONDS);
  29.199 -        CMOS_WRITE(real_minutes,RTC_MINUTES);
  29.200 -    }
  29.201 -    else 
  29.202 -    {
  29.203 -        printk(KERN_WARNING
  29.204 -               "set_rtc_mmss: can't update from %d to %d\n",
  29.205 -               cmos_minutes, real_minutes);
  29.206 -        retval = -1;
  29.207 -    }
  29.208 -
  29.209 -    /* The following flags have to be released exactly in this order,
  29.210 -     * otherwise the DS12887 (popular MC146818A clone with integrated
  29.211 -     * battery and quartz) will not reset the oscillator and will not
  29.212 -     * update precisely 500 ms later. You won't find this mentioned in
  29.213 -     * the Dallas Semiconductor data sheets, but who believes data
  29.214 -     * sheets anyway ...                           -- Markus Kuhn
  29.215 -     */
  29.216 -    CMOS_WRITE(save_control, RTC_CONTROL);
  29.217 -    CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
  29.218 -    spin_unlock(&rtc_lock);
  29.219 -
  29.220 -    return retval;
  29.221 -}
  29.222 -#endif
  29.223 -
  29.224 -
  29.225 -/*
  29.226 - * Reads a consistent set of time-base values from Xen, into a shadow data
  29.227 - * area. Must be called with the xtime_lock held for writing.
  29.228 - */
  29.229 -static void __get_time_values_from_xen(void)
  29.230 -{
  29.231 -    do {
  29.232 -        shadow_time_version = HYPERVISOR_shared_info->time_version2;
  29.233 -        rmb();
  29.234 -        shadow_tv.tv_sec    = HYPERVISOR_shared_info->wc_sec;
  29.235 -        shadow_tv.tv_usec   = HYPERVISOR_shared_info->wc_usec;
  29.236 -        shadow_tsc_stamp    = 
  29.237 -            (u32)(HYPERVISOR_shared_info->tsc_timestamp >> rdtsc_bitshift);
  29.238 -        shadow_system_time  = HYPERVISOR_shared_info->system_time;
  29.239 -        rmb();
  29.240 -    }
  29.241 -    while ( shadow_time_version != HYPERVISOR_shared_info->time_version1 );
  29.242 -}
  29.243 -
  29.244 -#define TIME_VALUES_UP_TO_DATE \
  29.245 - ({ rmb(); (shadow_time_version == HYPERVISOR_shared_info->time_version2); })
  29.246 -
  29.247 -
  29.248 -/*
  29.249 - * Returns the system time elapsed, in ns, since the current shadow_timestamp
  29.250 - * was calculated. Must be called with the xtime_lock held for reading.
  29.251 - */
  29.252 -static inline unsigned long __get_time_delta_usecs(void)
  29.253 -{
  29.254 -    s32      delta_tsc;
  29.255 -    u32      low;
  29.256 -    u64      delta, tsc;
  29.257 -
  29.258 -    rdtscll(tsc);
  29.259 -    low = (u32)(tsc >> rdtsc_bitshift);
  29.260 -    delta_tsc = (s32)(low - shadow_tsc_stamp);
  29.261 -    if ( unlikely(delta_tsc < 0) ) delta_tsc = 0;
  29.262 -    delta = ((u64)delta_tsc * st_scale_f);
  29.263 -    delta >>= 32;
  29.264 -    delta += ((u64)delta_tsc * st_scale_i);
  29.265 -
  29.266 -    return (unsigned long)delta;
  29.267 -}
  29.268 -
  29.269 -
  29.270 -/*
  29.271 - * Returns the current time-of-day in UTC timeval format.
  29.272 - */
  29.273 -void do_gettimeofday(struct timeval *tv)
  29.274 -{
  29.275 -    unsigned long flags, lost;
  29.276 -    struct timeval _tv;
  29.277 -    s64 nsec;
  29.278 -
  29.279 - again:
  29.280 -    read_lock_irqsave(&xtime_lock, flags);
  29.281 -
  29.282 -    _tv.tv_usec = __get_time_delta_usecs();
  29.283 -    if ( (lost = (jiffies - wall_jiffies)) != 0 )
  29.284 -        _tv.tv_usec += lost * (1000000 / HZ);
  29.285 -    _tv.tv_sec   = xtime.tv_sec;
  29.286 -    _tv.tv_usec += xtime.tv_usec;
  29.287 -
  29.288 -    nsec = shadow_system_time - processed_system_time;
  29.289 -    __normalize_time(&_tv.tv_sec, &nsec);
  29.290 -    _tv.tv_usec += (long)nsec / 1000L;
  29.291 -
  29.292 -    if ( unlikely(!TIME_VALUES_UP_TO_DATE) )
  29.293 -    {
  29.294 -        /*
  29.295 -         * We may have blocked for a long time, rendering our calculations
  29.296 -         * invalid (e.g. the time delta may have overflowed). Detect that
  29.297 -         * and recalculate with fresh values.
  29.298 -         */
  29.299 -        read_unlock_irqrestore(&xtime_lock, flags);
  29.300 -        write_lock_irqsave(&xtime_lock, flags);
  29.301 -        __get_time_values_from_xen();
  29.302 -        write_unlock_irqrestore(&xtime_lock, flags);
  29.303 -        goto again;
  29.304 -    }
  29.305 -
  29.306 -    HANDLE_USEC_OVERFLOW(_tv);
  29.307 -
  29.308 -    /* Ensure that time-of-day is monotonically increasing. */
  29.309 -    if ( (_tv.tv_sec < last_seen_tv.tv_sec) ||
  29.310 -         ((_tv.tv_sec == last_seen_tv.tv_sec) &&
  29.311 -          (_tv.tv_usec < last_seen_tv.tv_usec)) )
  29.312 -        _tv = last_seen_tv;
  29.313 -    last_seen_tv = _tv;
  29.314 -
  29.315 -    read_unlock_irqrestore(&xtime_lock, flags);
  29.316 -
  29.317 -    *tv = _tv;
  29.318 -}
  29.319 -
  29.320 -
  29.321 -/*
  29.322 - * Sets the current time-of-day based on passed-in UTC timeval parameter.
  29.323 - */
  29.324 -void do_settimeofday(struct timeval *tv)
  29.325 -{
  29.326 -    struct timeval newtv;
  29.327 -    s64            nsec;
  29.328 -    suseconds_t    usec;
  29.329 -    
  29.330 -    if ( !INDEPENDENT_WALLCLOCK() )
  29.331 -        return;
  29.332 -    
  29.333 -    write_lock_irq(&xtime_lock);
  29.334 -    
  29.335 -    /*
  29.336 -     * Ensure we don't get blocked for a long time so that our time delta
  29.337 -     * overflows. If that were to happen then our shadow time values would
  29.338 -     * be stale, so we can retry with fresh ones.
  29.339 -     */
  29.340 - again:
  29.341 -    usec = tv->tv_usec - __get_time_delta_usecs();
  29.342 -
  29.343 -    nsec = shadow_system_time - processed_system_time;
  29.344 -    __normalize_time(&tv->tv_sec, &nsec);
  29.345 -    usec -= (long)nsec / 1000L;
  29.346 -
  29.347 -    if ( unlikely(!TIME_VALUES_UP_TO_DATE) )
  29.348 -    {
  29.349 -        __get_time_values_from_xen();
  29.350 -        goto again;
  29.351 -    }
  29.352 -    tv->tv_usec = usec;
  29.353 -    
  29.354 -    HANDLE_USEC_UNDERFLOW(*tv);
  29.355 -    
  29.356 -    newtv = *tv;
  29.357 -    
  29.358 -    tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ);
  29.359 -    HANDLE_USEC_UNDERFLOW(*tv);
  29.360 -
  29.361 -    xtime = *tv;
  29.362 -    time_adjust = 0;  /* stop active adjtime() */
  29.363 -    time_status |= STA_UNSYNC;
  29.364 -    time_maxerror = NTP_PHASE_LIMIT;
  29.365 -    time_esterror = NTP_PHASE_LIMIT;
  29.366 -
  29.367 -    /* Reset all our running time counts. They make no sense now. */
  29.368 -    last_seen_tv.tv_sec = 0;
  29.369 -    last_update_from_xen = 0;
  29.370 -
  29.371 -#ifdef CONFIG_XEN_PRIVILEGED_GUEST
  29.372 -    if ( xen_start_info.flags & SIF_INITDOMAIN )
  29.373 -    {
  29.374 -        dom0_op_t op;
  29.375 -        last_update_to_rtc = last_update_to_xen = 0;
  29.376 -        op.cmd = DOM0_SETTIME;
  29.377 -        op.u.settime.secs        = newtv.tv_sec;
  29.378 -        op.u.settime.usecs       = newtv.tv_usec;
  29.379 -        op.u.settime.system_time = shadow_system_time;
  29.380 -        write_unlock_irq(&xtime_lock);
  29.381 -        HYPERVISOR_dom0_op(&op);
  29.382 -    }
  29.383 -    else
  29.384 -#endif
  29.385 -    {
  29.386 -        write_unlock_irq(&xtime_lock);
  29.387 -    }
  29.388 -}
  29.389 -
  29.390 -
  29.391 -asmlinkage long sys_stime(int *tptr)
  29.392 -{
  29.393 -    int value;
  29.394 -    struct timeval tv;
  29.395 -
  29.396 -    if ( !capable(CAP_SYS_TIME) )
  29.397 -        return -EPERM;
  29.398 -
  29.399 -    if ( get_user(value, tptr) )
  29.400 -        return -EFAULT;
  29.401 -
  29.402 -    tv.tv_sec  = value;
  29.403 -    tv.tv_usec = 0;
  29.404 -
  29.405 -    do_settimeofday(&tv);
  29.406 -
  29.407 -    return 0;
  29.408 -}
  29.409 -
  29.410 -
  29.411 -/* Convert jiffies to system time. Call with xtime_lock held for reading. */
  29.412 -static inline u64 __jiffies_to_st(unsigned long j) 
  29.413 -{
  29.414 -    return processed_system_time + ((j - jiffies) * NS_PER_TICK);
  29.415 -}
  29.416 -
  29.417 -
  29.418 -static inline void do_timer_interrupt(int irq, void *dev_id,
  29.419 -                                      struct pt_regs *regs)
  29.420 -{
  29.421 -    s64 delta;
  29.422 -    unsigned long ticks = 0;
  29.423 -    long sec_diff;
  29.424 -
  29.425 -    do {
  29.426 -        __get_time_values_from_xen();
  29.427 -        
  29.428 -        delta = (s64)(shadow_system_time + 
  29.429 -                      ((s64)__get_time_delta_usecs() * 1000LL) -
  29.430 -                      processed_system_time);
  29.431 -    }
  29.432 -    while ( !TIME_VALUES_UP_TO_DATE );
  29.433 -
  29.434 -    if ( unlikely(delta < 0) )
  29.435 -    {
  29.436 -        printk("Timer ISR: Time went backwards: %lld\n", delta);
  29.437 -        return;
  29.438 -    }
  29.439 -
  29.440 -    /* Process elapsed jiffies since last call. */
  29.441 -    while ( delta >= NS_PER_TICK )
  29.442 -    {
  29.443 -        ticks++;
  29.444 -        delta -= NS_PER_TICK;
  29.445 -        processed_system_time += NS_PER_TICK;
  29.446 -    }
  29.447 -
  29.448 -    if ( ticks != 0 )
  29.449 -    {
  29.450 -        do_timer_ticks(ticks);
  29.451 -
  29.452 -        if ( user_mode(regs) )
  29.453 -            update_process_times_us(ticks, 0);
  29.454 -        else
  29.455 -            update_process_times_us(0, ticks);
  29.456 -    }
  29.457 -
  29.458 -    /*
  29.459 -     * Take synchronised time from Xen once a minute if we're not
  29.460 -     * synchronised ourselves, and we haven't chosen to keep an independent
  29.461 -     * time base.
  29.462 -     */
  29.463 -    if ( !INDEPENDENT_WALLCLOCK() &&
  29.464 -         ((time_status & STA_UNSYNC) != 0) &&
  29.465 -         (xtime.tv_sec > (last_update_from_xen + 60)) )
  29.466 -    {
  29.467 -        /* Adjust shadow timeval for jiffies that haven't updated xtime yet. */
  29.468 -        shadow_tv.tv_usec -= (jiffies - wall_jiffies) * (1000000/HZ);
  29.469 -        HANDLE_USEC_UNDERFLOW(shadow_tv);
  29.470 -
  29.471 -        /*
  29.472 -         * Reset our running time counts if they are invalidated by a warp
  29.473 -         * backwards of more than 500ms.
  29.474 -         */
  29.475 -        sec_diff = xtime.tv_sec - shadow_tv.tv_sec;
  29.476 -        if ( unlikely(abs(sec_diff) > 1) ||
  29.477 -             unlikely(((sec_diff * 1000000) + 
  29.478 -                       xtime.tv_usec - shadow_tv.tv_usec) > 500000) )
  29.479 -        {
  29.480 -#ifdef CONFIG_XEN_PRIVILEGED_GUEST
  29.481 -            last_update_to_rtc = last_update_to_xen = 0;
  29.482 -#endif
  29.483 -            last_seen_tv.tv_sec = 0;
  29.484 -        }
  29.485 -
  29.486 -        /* Update our unsynchronised xtime appropriately. */
  29.487 -        xtime = shadow_tv;
  29.488 -
  29.489 -        last_update_from_xen = xtime.tv_sec;
  29.490 -    }
  29.491 -
  29.492 -#ifdef CONFIG_XEN_PRIVILEGED_GUEST
  29.493 -    if ( (xen_start_info.flags & SIF_INITDOMAIN) &&
  29.494 -         ((time_status & STA_UNSYNC) == 0) )
  29.495 -    {
  29.496 -        /* Send synchronised time to Xen approximately every minute. */
  29.497 -        if ( xtime.tv_sec > (last_update_to_xen + 60) )
  29.498 -        {
  29.499 -            dom0_op_t op;
  29.500 -            struct timeval tv = xtime;
  29.501 -
  29.502 -            tv.tv_usec += (jiffies - wall_jiffies) * (1000000/HZ);
  29.503 -            HANDLE_USEC_OVERFLOW(tv);
  29.504 -
  29.505 -            op.cmd = DOM0_SETTIME;
  29.506 -            op.u.settime.secs        = tv.tv_sec;
  29.507 -            op.u.settime.usecs       = tv.tv_usec;
  29.508 -            op.u.settime.system_time = shadow_system_time;
  29.509 -            HYPERVISOR_dom0_op(&op);
  29.510 -
  29.511 -            last_update_to_xen = xtime.tv_sec;
  29.512 -        }
  29.513 -
  29.514 -        /*
  29.515 -         * If we have an externally synchronized Linux clock, then update CMOS
  29.516 -         * clock accordingly every ~11 minutes. Set_rtc_mmss() has to be called
  29.517 -         * as close as possible to 500 ms before the new second starts.
  29.518 -         */
  29.519 -        if ( (xtime.tv_sec > (last_update_to_rtc + 660)) &&
  29.520 -             (xtime.tv_usec >= (500000 - ((unsigned) tick) / 2)) &&
  29.521 -             (xtime.tv_usec <= (500000 + ((unsigned) tick) / 2)) )
  29.522 -        {
  29.523 -            if ( set_rtc_mmss(xtime.tv_sec) == 0 )
  29.524 -                last_update_to_rtc = xtime.tv_sec;
  29.525 -            else
  29.526 -                last_update_to_rtc = xtime.tv_sec - 600;
  29.527 -        }
  29.528 -    }
  29.529 -#endif
  29.530 -}
  29.531 -
  29.532 -
  29.533 -static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  29.534 -{
  29.535 -    write_lock(&xtime_lock);
  29.536 -    do_timer_interrupt(irq, NULL, regs);
  29.537 -    write_unlock(&xtime_lock);
  29.538 -}
  29.539 -
  29.540 -static struct irqaction irq_timer = {
  29.541 -    timer_interrupt, 
  29.542 -    SA_INTERRUPT, 
  29.543 -    0, 
  29.544 -    "timer", 
  29.545 -    NULL, 
  29.546 -    NULL
  29.547 -};
  29.548 -
  29.549 -
  29.550 -/*
  29.551 - * This function works out when the the next timer function has to be
  29.552 - * executed (by looking at the timer list) and sets the Xen one-shot
  29.553 - * domain timer to the appropriate value. This is typically called in
  29.554 - * cpu_idle() before the domain blocks.
  29.555 - * 
  29.556 - * The function returns a non-0 value on error conditions.
  29.557 - * 
  29.558 - * It must be called with interrupts disabled.
  29.559 - */
  29.560 -extern spinlock_t timerlist_lock;
  29.561 -int set_timeout_timer(void)
  29.562 -{
  29.563 -    struct timer_list *timer;
  29.564 -    u64 alarm = 0;
  29.565 -    int ret = 0;
  29.566 -
  29.567 -    spin_lock(&timerlist_lock);
  29.568 -
  29.569 -    /*
  29.570 -     * This is safe against long blocking (since calculations are not based on 
  29.571 -     * TSC deltas). It is also safe against warped system time since
  29.572 -     * suspend-resume is cooperative and we would first get locked out. It is 
  29.573 -     * safe against normal updates of jiffies since interrupts are off.
  29.574 -     */
  29.575 -    if ( (timer = next_timer_event()) != NULL )
  29.576 -        alarm = __jiffies_to_st(timer->expires);
  29.577 -
  29.578 -    /* Tasks on the timer task queue expect to be executed on the next tick. */
  29.579 -    if ( TQ_ACTIVE(tq_timer) )
  29.580 -        alarm = __jiffies_to_st(jiffies + 1);
  29.581 -
  29.582 -    /* Failure is pretty bad, but we'd best soldier on. */
  29.583 -    if ( HYPERVISOR_set_timer_op(alarm) != 0 )
  29.584 -        ret = -1;
  29.585 -    
  29.586 -    spin_unlock(&timerlist_lock);
  29.587 -
  29.588 -    return ret;
  29.589 -}
  29.590 -
  29.591 -
  29.592 -/* Time debugging. */
  29.593 -static void dbg_time_int(int irq, void *dev_id, struct pt_regs *ptregs)
  29.594 -{
  29.595 -    unsigned long flags, j;
  29.596 -    u64 s_now, j_st;
  29.597 -    struct timeval s_tv, tv;
  29.598 -
  29.599 -    struct timer_list *timer;
  29.600 -    u64 t_st;
  29.601 -
  29.602 -    read_lock_irqsave(&xtime_lock, flags);
  29.603 -    s_tv.tv_sec  = shadow_tv.tv_sec;
  29.604 -    s_tv.tv_usec = shadow_tv.tv_usec;
  29.605 -    s_now        = shadow_system_time;
  29.606 -    read_unlock_irqrestore(&xtime_lock, flags);
  29.607 -
  29.608 -    do_gettimeofday(&tv);
  29.609 -
  29.610 -    j = jiffies;
  29.611 -    j_st = __jiffies_to_st(j);
  29.612 -
  29.613 -    timer = next_timer_event();
  29.614 -    t_st = __jiffies_to_st(timer->expires);
  29.615 -
  29.616 -    printk(KERN_ALERT "time: shadow_st=0x%X:%08X\n",
  29.617 -           (u32)(s_now>>32), (u32)s_now);
  29.618 -    printk(KERN_ALERT "time: wct=%lds %ldus shadow_wct=%lds %ldus\n",
  29.619 -           tv.tv_sec, tv.tv_usec, s_tv.tv_sec, s_tv.tv_usec);
  29.620 -    printk(KERN_ALERT "time: jiffies=%lu(0x%X:%08X) timeout=%lu(0x%X:%08X)\n",
  29.621 -           jiffies,(u32)(j_st>>32), (u32)j_st,
  29.622 -           timer->expires,(u32)(t_st>>32), (u32)t_st);
  29.623 -    printk(KERN_ALERT "time: processed_system_time=0x%X:%08X\n",
  29.624 -           (u32)(processed_system_time>>32), (u32)processed_system_time);
  29.625 -
  29.626 -#ifdef CONFIG_MAGIC_SYSRQ
  29.627 -    handle_sysrq('t',NULL,NULL,NULL);
  29.628 -#endif
  29.629 -}
  29.630 -
  29.631 -static struct irqaction dbg_time = {
  29.632 -    dbg_time_int, 
  29.633 -    SA_SHIRQ, 
  29.634 -    0, 
  29.635 -    "timer_dbg", 
  29.636 -    &dbg_time_int,
  29.637 -    NULL
  29.638 -};
  29.639 -
  29.640 -void __init time_init(void)
  29.641 -{
  29.642 -    unsigned long long alarm;
  29.643 -    u64 __cpu_khz, __cpu_ghz, cpu_freq, scale, scale2;
  29.644 -    unsigned int cpu_ghz;
  29.645 -
  29.646 -    __cpu_khz = __cpu_ghz = cpu_freq = HYPERVISOR_shared_info->cpu_freq;
  29.647 -    do_div(__cpu_khz, 1000UL);
  29.648 -    cpu_khz = (u32)__cpu_khz;
  29.649 -    do_div(__cpu_ghz, 1000000000UL);
  29.650 -    cpu_ghz = (unsigned int)__cpu_ghz;
  29.651 -
  29.652 -    printk("Xen reported: %lu.%03lu MHz processor.\n", 
  29.653 -           cpu_khz / 1000, cpu_khz % 1000);
  29.654 -
  29.655 -    xtime.tv_sec = HYPERVISOR_shared_info->wc_sec;
  29.656 -    xtime.tv_usec = HYPERVISOR_shared_info->wc_usec;
  29.657 -    processed_system_time = shadow_system_time;
  29.658 -
  29.659 -    for ( rdtsc_bitshift = 0; cpu_ghz != 0; rdtsc_bitshift++, cpu_ghz >>= 1 )
  29.660 -        continue;
  29.661 -
  29.662 -    scale = 1000000LL << (32 + rdtsc_bitshift);
  29.663 -    do_div(scale, (u32)cpu_freq);
  29.664 -
  29.665 -    if ( (cpu_freq >> 32) != 0 )
  29.666 -    {
  29.667 -        scale2 = 1000000LL << rdtsc_bitshift;
  29.668 -        do_div(scale2, (u32)(cpu_freq>>32));
  29.669 -        scale += scale2;
  29.670 -    }
  29.671 -
  29.672 -    st_scale_f = scale & 0xffffffff;
  29.673 -    st_scale_i = scale >> 32;
  29.674 -
  29.675 -    __get_time_values_from_xen();
  29.676 -    processed_system_time = shadow_system_time;
  29.677 -
  29.678 -    time_irq  = bind_virq_to_irq(VIRQ_TIMER);
  29.679 -    debug_irq = bind_virq_to_irq(VIRQ_DEBUG);
  29.680 -
  29.681 -    (void)setup_irq(time_irq, &irq_timer);
  29.682 -    (void)setup_irq(debug_irq, &dbg_time);
  29.683 -
  29.684 -    rdtscll(alarm);
  29.685 -}
  29.686 -
  29.687 -void time_suspend(void)
  29.688 -{
  29.689 -}
  29.690 -
  29.691 -void time_resume(void)
  29.692 -{
  29.693 -    unsigned long flags;
  29.694 -    write_lock_irqsave(&xtime_lock, flags);
  29.695 -    /* Get timebases for new environment. */ 
  29.696 -    __get_time_values_from_xen();
  29.697 -    /* Reset our own concept of passage of system time. */
  29.698 -    processed_system_time = shadow_system_time;
  29.699 -    /* Accept a warp in UTC (wall-clock) time. */
  29.700 -    last_seen_tv.tv_sec = 0;
  29.701 -    /* Make sure we resync UTC time with Xen on next timer interrupt. */
  29.702 -    last_update_from_xen = 0;
  29.703 -    write_unlock_irqrestore(&xtime_lock, flags);
  29.704 -}
  29.705 -
  29.706 -/*
  29.707 - * /proc/sys/xen: This really belongs in another file. It can stay here for
  29.708 - * now however.
  29.709 - */
  29.710 -static ctl_table xen_subtable[] = {
  29.711 -    {1, "independent_wallclock", &independent_wallclock,
  29.712 -     sizeof(independent_wallclock), 0644, NULL, proc_dointvec},
  29.713 -    {0}
  29.714 -};
  29.715 -static ctl_table xen_table[] = {
  29.716 -    {123, "xen", NULL, 0, 0555, xen_subtable},
  29.717 -    {0}
  29.718 -};
  29.719 -static int __init xen_sysctl_init(void)
  29.720 -{
  29.721 -    (void)register_sysctl_table(xen_table, 0);
  29.722 -    return 0;
  29.723 -}
  29.724 -__initcall(xen_sysctl_init);
    30.1 --- a/linux-2.4.30-xen-sparse/arch/xen/kernel/traps.c	Mon Jul 11 14:48:47 2005 +0000
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,619 +0,0 @@
    30.4 -/*
    30.5 - *  linux/arch/i386/traps.c
    30.6 - *
    30.7 - *  Copyright (C) 1991, 1992  Linus Torvalds
    30.8 - *
    30.9 - *  Pentium III FXSR, SSE support
   30.10 - *	Gareth Hughes <gareth@valinux.com>, May 2000
   30.11 - */
   30.12 -
   30.13 -/*
   30.14 - * 'Traps.c' handles hardware traps and faults after we have saved some
   30.15 - * state in 'asm.s'.
   30.16 - */
   30.17 -#include <linux/config.h>
   30.18 -#include <linux/sched.h>
   30.19 -#include <linux/kernel.h>
   30.20 -#include <linux/string.h>
   30.21 -#include <linux/errno.h>
   30.22 -#include <linux/ptrace.h>
   30.23 -#include <linux/timer.h>
   30.24 -#include <linux/mm.h>
   30.25 -#include <linux/init.h>
   30.26 -#include <linux/delay.h>
   30.27 -#include <linux/spinlock.h>
   30.28 -#include <linux/interrupt.h>
   30.29 -#include <linux/highmem.h>
   30.30 -
   30.31 -#include <asm/system.h>
   30.32 -#include <asm/uaccess.h>
   30.33 -#include <asm/io.h>
   30.34 -#include <asm/atomic.h>
   30.35 -#include <asm/debugreg.h>
   30.36 -#include <asm/desc.h>
   30.37 -#include <asm/i387.h>
   30.38 -
   30.39 -#include <asm/smp.h>
   30.40 -#include <asm/pgalloc.h>
   30.41 -
   30.42 -#include <asm/hypervisor.h>
   30.43 -
   30.44 -#include <linux/irq.h>
   30.45 -#include <linux/module.h>
   30.46 -
   30.47 -asmlinkage int system_call(void);
   30.48 -asmlinkage void lcall7(void);
   30.49 -asmlinkage void lcall27(void);
   30.50 -
   30.51 -asmlinkage void divide_error(void);
   30.52 -asmlinkage void debug(void);
   30.53 -asmlinkage void int3(void);
   30.54 -asmlinkage void overflow(void);
   30.55 -asmlinkage void bounds(void);
   30.56 -asmlinkage void invalid_op(void);
   30.57 -asmlinkage void device_not_available(void);
   30.58 -asmlinkage void double_fault(void);
   30.59 -asmlinkage void coprocessor_segment_overrun(void);
   30.60 -asmlinkage void invalid_TSS(void);
   30.61 -asmlinkage void segment_not_present(void);
   30.62 -asmlinkage void stack_segment(void);
   30.63 -asmlinkage void general_protection(void);
   30.64 -asmlinkage void page_fault(void);
   30.65 -asmlinkage void coprocessor_error(void);
   30.66 -asmlinkage void simd_coprocessor_error(void);
   30.67 -asmlinkage void alignment_check(void);
   30.68 -asmlinkage void fixup_4gb_segment(void);
   30.69 -asmlinkage void machine_check(void);
   30.70 -
   30.71 -int kstack_depth_to_print = 24;
   30.72 -
   30.73 -
   30.74 -/*
   30.75 - * If the address is either in the .text section of the
   30.76 - * kernel, or in the vmalloc'ed module regions, it *may* 
   30.77 - * be the address of a calling routine
   30.78 - */
   30.79 -
   30.80 -#ifdef CONFIG_MODULES
   30.81 -
   30.82 -extern struct module *module_list;
   30.83 -extern struct module kernel_module;
   30.84 -
   30.85 -static inline int kernel_text_address(unsigned long addr)
   30.86 -{
   30.87 -	int retval = 0;
   30.88 -	struct module *mod;
   30.89 -
   30.90 -	if (addr >= (unsigned long) &_stext &&
   30.91 -	    addr <= (unsigned long) &_etext)
   30.92 -		return 1;
   30.93 -
   30.94 -	for (mod = module_list; mod != &kernel_module; mod = mod->next) {
   30.95 -		/* mod_bound tests for addr being inside the vmalloc'ed
   30.96 -		 * module area. Of course it'd be better to test only
   30.97 -		 * for the .text subset... */
   30.98 -		if (mod_bound(addr, 0, mod)) {
   30.99 -			retval = 1;
  30.100 -			break;
  30.101 -		}
  30.102 -	}
  30.103 -
  30.104 -	return retval;
  30.105 -}
  30.106 -
  30.107 -#else
  30.108 -
  30.109 -static inline int kernel_text_address(unsigned long addr)
  30.110 -{
  30.111 -	return (addr >= (unsigned long) &_stext &&
  30.112 -		addr <= (unsigned long) &_etext);
  30.113 -}
  30.114 -
  30.115 -#endif
  30.116 -
  30.117 -void show_trace(unsigned long * stack)
  30.118 -{
  30.119 -	int i;
  30.120 -	unsigned long addr;
  30.121 -
  30.122 -	if (!stack)
  30.123 -		stack = (unsigned long*)&stack;
  30.124 -
  30.125 -	printk("Call Trace: ");
  30.126 -	i = 1;
  30.127 -	while (((long) stack & (THREAD_SIZE-1)) != 0) {
  30.128 -		addr = *stack++;
  30.129 -		if (kernel_text_address(addr)) {
  30.130 -			if (i && ((i % 6) == 0))
  30.131 -				printk("\n   ");
  30.132 -			printk("[<%08lx>] ", addr);
  30.133 -			i++;
  30.134 -		}
  30.135 -	}
  30.136 -	printk("\n");
  30.137 -}
  30.138 -
  30.139 -void show_trace_task(struct task_struct *tsk)
  30.140 -{
  30.141 -	unsigned long esp = tsk->thread.esp;
  30.142 -
  30.143 -	/* User space on another CPU? */
  30.144 -	if ((esp ^ (unsigned long)tsk) & (PAGE_MASK<<1))
  30.145 -		return;
  30.146 -	show_trace((unsigned long *)esp);
  30.147 -}
  30.148 -
  30.149 -void show_stack(unsigned long * esp)
  30.150 -{
  30.151 -	unsigned long *stack;
  30.152 -	int i;
  30.153 -
  30.154 -	// debugging aid: "show_stack(NULL);" prints the
  30.155 -	// back trace for this cpu.
  30.156 -
  30.157 -	if(esp==NULL)
  30.158 -		esp=(unsigned long*)&esp;
  30.159 -
  30.160 -	stack = esp;
  30.161 -	for(i=0; i < kstack_depth_to_print; i++) {
  30.162 -		if (((long) stack & (THREAD_SIZE-1)) == 0)
  30.163 -			break;
  30.164 -		if (i && ((i % 8) == 0))
  30.165 -			printk("\n       ");
  30.166 -		printk("%08lx ", *stack++);
  30.167 -	}
  30.168 -	printk("\n");
  30.169 -	show_trace(esp);
  30.170 -}
  30.171 -
  30.172 -void show_registers(struct pt_regs *regs)
  30.173 -{
  30.174 -	int in_kernel = 1;
  30.175 -	unsigned long esp;
  30.176 -	unsigned short ss;
  30.177 -
  30.178 -	esp = (unsigned long) (&regs->esp);
  30.179 -	ss = __KERNEL_DS;
  30.180 -	if (regs->xcs & 2) {
  30.181 -		in_kernel = 0;
  30.182 -		esp = regs->esp;
  30.183 -		ss = regs->xss & 0xffff;
  30.184 -	}
  30.185 -	printk(KERN_ALERT "CPU:    %d\n", smp_processor_id() );
  30.186 -	printk(KERN_ALERT "EIP:    %04x:[<%08lx>]    %s\n",
  30.187 -	       0xffff & regs->xcs, regs->eip, print_tainted());
  30.188 -	printk(KERN_ALERT "EFLAGS: %08lx\n",regs->eflags);
  30.189 -	printk(KERN_ALERT "eax: %08lx   ebx: %08lx   ecx: %08lx   edx: %08lx\n",
  30.190 -		regs->eax, regs->ebx, regs->ecx, regs->edx);
  30.191 -	printk(KERN_ALERT "esi: %08lx   edi: %08lx   ebp: %08lx   esp: %08lx\n",
  30.192 -		regs->esi, regs->edi, regs->ebp, esp);
  30.193 -	printk(KERN_ALERT "ds: %04x   es: %04x   ss: %04x\n",
  30.194 -		regs->xds & 0xffff, regs->xes & 0xffff, ss);
  30.195 -	printk(KERN_ALERT "Process %s (pid: %d, stackpage=%08lx)",
  30.196 -		current->comm, current->pid, 4096+(unsigned long)current);
  30.197 -	/*
  30.198 -	 * When in-kernel, we also print out the stack and code at the
  30.199 -	 * time of the fault..
  30.200 -	 */
  30.201 -	if (in_kernel) {
  30.202 -
  30.203 -		printk(KERN_ALERT "\nStack: ");
  30.204 -		show_stack((unsigned long*)esp);
  30.205 -
  30.206 -#if 0
  30.207 -                {
  30.208 -                        int i;
  30.209 -			printk(KERN_ALERT "\nCode: ");
  30.210 -			if(regs->eip < PAGE_OFFSET)
  30.211 -			        goto bad;
  30.212 -
  30.213 -			for(i=0;i<20;i++)
  30.214 -			{
  30.215 -			        unsigned char c;
  30.216 -			        if(__get_user(c, &((unsigned char*)regs->eip)[i])) {
  30.217 -bad:
  30.218 -				        printk(KERN_ALERT " Bad EIP value.");
  30.219 -					break;
  30.220 -				}
  30.221 -				printk("%02x ", c);
  30.222 -			}
  30.223 -		}
  30.224 -#endif
  30.225 -	}
  30.226 -	printk(KERN_ALERT "\n");
  30.227 -}	
  30.228 -
  30.229 -spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
  30.230 -
  30.231 -void die(const char * str, struct pt_regs * regs, long err)
  30.232 -{
  30.233 -	console_verbose();
  30.234 -	spin_lock_irq(&die_lock);
  30.235 -	bust_spinlocks(1);
  30.236 -	printk("%s: %04lx\n", str, err & 0xffff);
  30.237 -	show_registers(regs);
  30.238 -	bust_spinlocks(0);
  30.239 -	spin_unlock_irq(&die_lock);
  30.240 -	do_exit(SIGSEGV);
  30.241 -}
  30.242 -
  30.243 -static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err)
  30.244 -{
  30.245 -	if (!(2 & regs->xcs))
  30.246 -		die(str, regs, err);
  30.247 -}
  30.248 -
  30.249 -
  30.250 -static void inline do_trap(int trapnr, int signr, char *str,
  30.251 -			   struct pt_regs * regs, long error_code,
  30.252 -                           siginfo_t *info)
  30.253 -{
  30.254 -	if (!(regs->xcs & 2))
  30.255 -		goto kernel_trap;
  30.256 -
  30.257 -	/*trap_signal:*/ {
  30.258 -		struct task_struct *tsk = current;
  30.259 -		tsk->thread.error_code = error_code;
  30.260 -		tsk->thread.trap_no = trapnr;
  30.261 -		if (info)
  30.262 -			force_sig_info(signr, info, tsk);
  30.263 -		else
  30.264 -			force_sig(signr, tsk);
  30.265 -		return;
  30.266 -	}
  30.267 -
  30.268 -	kernel_trap: {
  30.269 -		unsigned long fixup = search_exception_table(regs->eip);
  30.270 -		if (fixup)
  30.271 -			regs->eip = fixup;
  30.272 -		else	
  30.273 -			die(str, regs, error_code);
  30.274 -		return;
  30.275 -	}
  30.276 -}
  30.277 -
  30.278 -#define DO_ERROR(trapnr, signr, str, name) \
  30.279 -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
  30.280 -{ \
  30.281 -	do_trap(trapnr, signr, str, regs, error_code, NULL); \
  30.282 -}
  30.283 -
  30.284 -#define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \
  30.285 -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
  30.286 -{ \
  30.287 -	siginfo_t info; \
  30.288 -	info.si_signo = signr; \
  30.289 -	info.si_errno = 0; \
  30.290 -	info.si_code = sicode; \
  30.291 -	info.si_addr = (void *)siaddr; \
  30.292 -	do_trap(trapnr, signr, str, regs, error_code, &info); \
  30.293 -}
  30.294 -
  30.295 -DO_ERROR_INFO( 0, SIGFPE,  "divide error", divide_error, FPE_INTDIV, regs->eip)
  30.296 -DO_ERROR( 3, SIGTRAP, "int3", int3)
  30.297 -DO_ERROR( 4, SIGSEGV, "overflow", overflow)
  30.298 -DO_ERROR( 5, SIGSEGV, "bounds", bounds)
  30.299 -DO_ERROR_INFO( 6, SIGILL,  "invalid operand", invalid_op, ILL_ILLOPN, regs->eip)
  30.300 -DO_ERROR( 7, SIGSEGV, "device not available", device_not_available)
  30.301 -DO_ERROR( 8, SIGSEGV, "double fault", double_fault)
  30.302 -DO_ERROR( 9, SIGFPE,  "coprocessor segment overrun", coprocessor_segment_overrun)
  30.303 -DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS)
  30.304 -DO_ERROR(11, SIGBUS,  "segment not present", segment_not_present)
  30.305 -DO_ERROR(12, SIGBUS,  "stack segment", stack_segment)
  30.306 -DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
  30.307 -DO_ERROR(18, SIGBUS, "machine check", machine_check)
  30.308 -
  30.309 -asmlinkage void do_general_protection(struct pt_regs * regs, long error_code)
  30.310 -{
  30.311 -	/*
  30.312 -	 * If we trapped on an LDT access then ensure that the default_ldt is
  30.313 -	 * loaded, if nothing else. We load default_ldt lazily because LDT
  30.314 -	 * switching costs time and many applications don't need it.
  30.315 -	 */
  30.316 -	if ( unlikely((error_code & 6) == 4) )
  30.317 -	{
  30.318 -		unsigned long ldt;
  30.319 -		__asm__ __volatile__ ( "sldt %0" : "=r" (ldt) );
  30.320 -		if ( ldt == 0 )
  30.321 -		{
  30.322 -                    xen_set_ldt((unsigned long)&default_ldt[0], 5);
  30.323 -		    return;
  30.324 -		}
  30.325 -	}
  30.326 -
  30.327 -	if (!(regs->xcs & 2))
  30.328 -		goto gp_in_kernel;
  30.329 -
  30.330 -	current->thread.error_code = error_code;
  30.331 -	current->thread.trap_no = 13;
  30.332 -	force_sig(SIGSEGV, current);
  30.333 -	return;
  30.334 -
  30.335 -gp_in_kernel:
  30.336 -	{
  30.337 -		unsigned long fixup;
  30.338 -		fixup = search_exception_table(regs->eip);
  30.339 -		if (fixup) {
  30.340 -			regs->eip = fixup;
  30.341 -			return;
  30.342 -		}
  30.343 -		die("general protection fault", regs, error_code);
  30.344 -	}
  30.345 -}
  30.346 -
  30.347 -
  30.348 -asmlinkage void do_debug(struct pt_regs * regs, long error_code)
  30.349 -{
  30.350 -    unsigned int condition;
  30.351 -    struct task_struct *tsk = current;
  30.352 -    siginfo_t info;
  30.353 -
  30.354 -    condition = HYPERVISOR_get_debugreg(6);
  30.355 -
  30.356 -    /* Mask out spurious debug traps due to lazy DR7 setting */
  30.357 -    if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) {
  30.358 -        if (!tsk->thread.debugreg[7])
  30.359 -            goto clear_dr7;
  30.360 -    }
  30.361 -
  30.362 -    /* Save debug status register where ptrace can see it */
  30.363 -    tsk->thread.debugreg[6] = condition;
  30.364 -
  30.365 -    /* Mask out spurious TF errors due to lazy TF clearing */
  30.366 -    if (condition & DR_STEP) {
  30.367 -        /*
  30.368 -         * The TF error should be masked out only if the current
  30.369 -         * process is not traced and if the TRAP flag has been set
  30.370 -         * previously by a tracing process (condition detected by
  30.371 -         * the PT_DTRACE flag); remember that the i386 TRAP flag
  30.372 -         * can be modified by the process itself in user mode,
  30.373 -         * allowing programs to debug themselves without the ptrace()
  30.374 -         * interface.
  30.375 -         */
  30.376 -        if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE)
  30.377 -            goto clear_TF;
  30.378 -    }
  30.379 -
  30.380 -    /* Ok, finally something we can handle */
  30.381 -    tsk->thread.trap_no = 1;
  30.382 -    tsk->thread.error_code = error_code;
  30.383 -    info.si_signo = SIGTRAP;
  30.384 -    info.si_errno = 0;
  30.385 -    info.si_code = TRAP_BRKPT;
  30.386 -        
  30.387 -    /* If this is a kernel mode trap, save the user PC on entry to 
  30.388 -     * the kernel, that's what the debugger can make sense of.
  30.389 -     */
  30.390 -    info.si_addr = ((regs->xcs & 2) == 0) ? (void *)tsk->thread.eip : 
  30.391 -                                            (void *)regs->eip;
  30.392 -    force_sig_info(SIGTRAP, &info, tsk);
  30.393 -
  30.394 -    /* Disable additional traps. They'll be re-enabled when
  30.395 -     * the signal is delivered.
  30.396 -     */
  30.397 - clear_dr7:
  30.398 -    HYPERVISOR_set_debugreg(7, 0);
  30.399 -    return;
  30.400 -
  30.401 - clear_TF:
  30.402 -    regs->eflags &= ~TF_MASK;
  30.403 -    return;
  30.404 -}
  30.405 -
  30.406 -
  30.407 -/*
  30.408 - * Note that we play around with the 'TS' bit in an attempt to get
  30.409 - * the correct behaviour even in the presence of the asynchronous
  30.410 - * IRQ13 behaviour
  30.411 - */
  30.412 -void math_error(void *eip)
  30.413 -{
  30.414 -	struct task_struct * task;
  30.415 -	siginfo_t info;
  30.416 -	unsigned short cwd, swd;
  30.417 -
  30.418 -	/*
  30.419 -	 * Save the info for the exception handler and clear the error.
  30.420 -	 */
  30.421 -	task = current;
  30.422 -	save_init_fpu(task);
  30.423 -	task->thread.trap_no = 16;
  30.424 -	task->thread.error_code = 0;
  30.425 -	info.si_signo = SIGFPE;
  30.426 -	info.si_errno = 0;
  30.427 -	info.si_code = __SI_FAULT;
  30.428 -	info.si_addr = eip;
  30.429 -	/*
  30.430 -	 * (~cwd & swd) will mask out exceptions that are not set to unmasked
  30.431 -	 * status.  0x3f is the exception bits in these regs, 0x200 is the
  30.432 -	 * C1 reg you need in case of a stack fault, 0x040 is the stack
  30.433 -	 * fault bit.  We should only be taking one exception at a time,
  30.434 -	 * so if this combination doesn't produce any single exception,
  30.435 -	 * then we have a bad program that isn't syncronizing its FPU usage
  30.436 -	 * and it will suffer the consequences since we won't be able to
  30.437 -	 * fully reproduce the context of the exception
  30.438 -	 */
  30.439 -	cwd = get_fpu_cwd(task);
  30.440 -	swd = get_fpu_swd(task);
  30.441 -	switch (((~cwd) & swd & 0x3f) | (swd & 0x240)) {
  30.442 -		case 0x000:
  30.443 -		default:
  30.444 -			break;
  30.445 -		case 0x001: /* Invalid Op */
  30.446 -		case 0x041: /* Stack Fault */
  30.447 -		case 0x241: /* Stack Fault | Direction */
  30.448 -			info.si_code = FPE_FLTINV;
  30.449 -			break;
  30.450 -		case 0x002: /* Denormalize */
  30.451 -		case 0x010: /* Underflow */
  30.452 -			info.si_code = FPE_FLTUND;
  30.453 -			break;
  30.454 -		case 0x004: /* Zero Divide */
  30.455 -			info.si_code = FPE_FLTDIV;
  30.456 -			break;
  30.457 -		case 0x008: /* Overflow */
  30.458 -			info.si_code = FPE_FLTOVF;
  30.459 -			break;
  30.460 -		case 0x020: /* Precision */
  30.461 -			info.si_code = FPE_FLTRES;
  30.462 -			break;
  30.463 -	}
  30.464 -	force_sig_info(SIGFPE, &info, task);
  30.465 -}
  30.466 -
  30.467 -asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code)
  30.468 -{
  30.469 -	ignore_irq13 = 1;
  30.470 -	math_error((void *)regs->eip);
  30.471 -}
  30.472 -
  30.473 -void simd_math_error(void *eip)
  30.474 -{
  30.475 -	struct task_struct * task;
  30.476 -	siginfo_t info;
  30.477 -	unsigned short mxcsr;
  30.478 -
  30.479 -	/*
  30.480 -	 * Save the info for the exception handler and clear the error.
  30.481 -	 */
  30.482 -	task = current;
  30.483 -	save_init_fpu(task);
  30.484 -	task->thread.trap_no = 19;
  30.485 -	task->thread.error_code = 0;
  30.486 -	info.si_signo = SIGFPE;
  30.487 -	info.si_errno = 0;
  30.488 -	info.si_code = __SI_FAULT;
  30.489 -	info.si_addr = eip;
  30.490 -	/*
  30.491 -	 * The SIMD FPU exceptions are handled a little differently, as there
  30.492 -	 * is only a single status/control register.  Thus, to determine which
  30.493 -	 * unmasked exception was caught we must mask the exception mask bits
  30.494 -	 * at 0x1f80, and then use these to mask the exception bits at 0x3f.
  30.495 -	 */
  30.496 -	mxcsr = get_fpu_mxcsr(task);
  30.497 -	switch (~((mxcsr & 0x1f80) >> 7) & (mxcsr & 0x3f)) {
  30.498 -		case 0x000:
  30.499 -		default:
  30.500 -			break;
  30.501 -		case 0x001: /* Invalid Op */
  30.502 -			info.si_code = FPE_FLTINV;
  30.503 -			break;
  30.504 -		case 0x002: /* Denormalize */
  30.505 -		case 0x010: /* Underflow */
  30.506 -			info.si_code = FPE_FLTUND;
  30.507 -			break;
  30.508 -		case 0x004: /* Zero Divide */
  30.509 -			info.si_code = FPE_FLTDIV;
  30.510 -			break;
  30.511 -		case 0x008: /* Overflow */
  30.512 -			info.si_code = FPE_FLTOVF;
  30.513 -			break;
  30.514 -		case 0x020: /* Precision */
  30.515 -			info.si_code = FPE_FLTRES;
  30.516 -			break;
  30.517 -	}
  30.518 -	force_sig_info(SIGFPE, &info, task);
  30.519 -}
  30.520 -
  30.521 -asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs,
  30.522 -					  long error_code)
  30.523 -{
  30.524 -	if (cpu_has_xmm) {
  30.525 -		/* Handle SIMD FPU exceptions on PIII+ processors. */
  30.526 -		ignore_irq13 = 1;
  30.527 -		simd_math_error((void *)regs->eip);
  30.528 -	} else {
  30.529 -		die_if_kernel("cache flush denied", regs, error_code);
  30.530 -		current->thread.trap_no = 19;
  30.531 -		current->thread.error_code = error_code;
  30.532 -		force_sig(SIGSEGV, current);
  30.533 -	}
  30.534 -}
  30.535 -
  30.536 -/*
  30.537 - *  'math_state_restore()' saves the current math information in the
  30.538 - * old math state array, and gets the new ones from the current task
  30.539 - *
  30.540 - * Careful.. There are problems with IBM-designed IRQ13 behaviour.
  30.541 - * Don't touch unless you *really* know how it works.
  30.542 - */
  30.543 -asmlinkage void math_state_restore(struct pt_regs regs)
  30.544 -{
  30.545 -	/*
  30.546 -	 * A trap in kernel mode can be ignored. It'll be the fast XOR or
  30.547 -	 * copying libraries, which will correctly save/restore state and
  30.548 -	 * reset the TS bit in CR0.
  30.549 -	 */
  30.550 -	if ( (regs.xcs & 2) == 0 )
  30.551 -		return;
  30.552 -
  30.553 -	if (current->used_math) {
  30.554 -		restore_fpu(current);
  30.555 -	} else {
  30.556 -		init_fpu();
  30.557 -	}
  30.558 -	current->flags |= PF_USEDFPU;	/* So we fnsave on switch_to() */
  30.559 -}
  30.560 -
  30.561 -
  30.562 -#define _set_gate(gate_addr,type,dpl,addr) \
  30.563 -do { \
  30.564 -  int __d0, __d1; \
  30.565 -  __asm__ __volatile__ ("movw %%dx,%%ax\n\t" \
  30.566 -	"movw %4,%%dx\n\t" \
  30.567 -	"movl %%eax,%0\n\t" \
  30.568 -	"movl %%edx,%1" \
  30.569 -	:"=m" (*((long *) (gate_addr))), \
  30.570 -	 "=m" (*(1+(long *) (gate_addr))), "=&a" (__d0), "=&d" (__d1) \
  30.571 -	:"i" ((short) (0x8000+(dpl<<13)+(type<<8))), \
  30.572 -	 "3" ((char *) (addr)),"2" (__KERNEL_CS << 16)); \
  30.573 -} while (0)
  30.574 -
  30.575 -static void __init set_call_gate(void *a, void *addr)
  30.576 -{
  30.577 -	_set_gate(a,12,3,addr);
  30.578 -}
  30.579 -
  30.580 -
  30.581 -/* NB. All these are "trap gates" (i.e. events_mask isn't cleared). */
  30.582 -static trap_info_t trap_table[] = {
  30.583 -    {  0, 0, __KERNEL_CS, (unsigned long)divide_error                },
  30.584 -    {  1, 0, __KERNEL_CS, (unsigned long)debug                       },
  30.585 -    {  3, 3, __KERNEL_CS, (unsigned long)int3                        },
  30.586 -    {  4, 3, __KERNEL_CS, (unsigned long)overflow                    },
  30.587 -    {  5, 3, __KERNEL_CS, (unsigned long)bounds                      },
  30.588 -    {  6, 0, __KERNEL_CS, (unsigned long)invalid_op                  },
  30.589 -    {  7, 0, __KERNEL_CS, (unsigned long)device_not_available        },
  30.590 -    {  8, 0, __KERNEL_CS, (unsigned long)double_fault                },
  30.591 -    {  9, 0, __KERNEL_CS, (unsigned long)coprocessor_segment_overrun },
  30.592 -    { 10, 0, __KERNEL_CS, (unsigned long)invalid_TSS                 },
  30.593 -    { 11, 0, __KERNEL_CS, (unsigned long)segment_not_present         },
  30.594 -    { 12, 0, __KERNEL_CS, (unsigned long)stack_segment               },
  30.595 -    { 13, 0, __KERNEL_CS, (unsigned long)general_protection          },
  30.596 -    { 14, 0, __KERNEL_CS, (unsigned long)page_fault                  },
  30.597 -    { 15, 0, __KERNEL_CS, (unsigned long)fixup_4gb_segment           },
  30.598 -    { 16, 0, __KERNEL_CS, (unsigned long)coprocessor_error           },
  30.599 -    { 17, 0, __KERNEL_CS, (unsigned long)alignment_check             },
  30.600 -    { 18, 0, __KERNEL_CS, (unsigned long)machine_check               },
  30.601 -    { 19, 0, __KERNEL_CS, (unsigned long)simd_coprocessor_error      },
  30.602 -    { SYSCALL_VECTOR, 
  30.603 -          3, __KERNEL_CS, (unsigned long)system_call                 },
  30.604 -    {  0, 0,           0, 0                           }
  30.605 -};
  30.606 -
  30.607 -
  30.608 -void __init trap_init(void)
  30.609 -{
  30.610 -    HYPERVISOR_set_trap_table(trap_table);    
  30.611 -
  30.612 -    /*
  30.613 -     * The default LDT is a single-entry callgate to lcall7 for iBCS and a
  30.614 -     * callgate to lcall27 for Solaris/x86 binaries.
  30.615 -     */
  30.616 -    clear_page(&default_ldt[0]);
  30.617 -    set_call_gate(&default_ldt[0],lcall7);
  30.618 -    set_call_gate(&default_ldt[4],lcall27);
  30.619 -    __make_page_readonly(&default_ldt[0]);
  30.620 -
  30.621 -    cpu_init();
  30.622 -}
    31.1 --- a/linux-2.4.30-xen-sparse/arch/xen/lib/Makefile	Mon Jul 11 14:48:47 2005 +0000
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,15 +0,0 @@
    31.4 -
    31.5 -.S.o:
    31.6 -	$(CC) $(AFLAGS) -c $< -o $*.o
    31.7 -
    31.8 -L_TARGET = lib.a
    31.9 -
   31.10 -obj-y = checksum.o old-checksum.o delay.o \
   31.11 -	usercopy.o getuser.o \
   31.12 -	memcpy.o strstr.o xen_proc.o
   31.13 -
   31.14 -obj-$(CONFIG_X86_USE_3DNOW) += mmx.o
   31.15 -obj-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
   31.16 -obj-$(CONFIG_DEBUG_IOVIRT)  += iodebug.o
   31.17 -
   31.18 -include $(TOPDIR)/Rules.make
    32.1 --- a/linux-2.4.30-xen-sparse/arch/xen/lib/delay.c	Mon Jul 11 14:48:47 2005 +0000
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,52 +0,0 @@
    32.4 -/*
    32.5 - *	Precise Delay Loops for i386
    32.6 - *
    32.7 - *	Copyright (C) 1993 Linus Torvalds
    32.8 - *	Copyright (C) 1997 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
    32.9 - *
   32.10 - *	The __delay function must _NOT_ be inlined as its execution time
   32.11 - *	depends wildly on alignment on many x86 processors. The additional
   32.12 - *	jump magic is needed to get the timing stable on all the CPU's
   32.13 - *	we have to worry about.
   32.14 - */
   32.15 -
   32.16 -#include <linux/config.h>
   32.17 -#include <linux/sched.h>
   32.18 -#include <linux/delay.h>
   32.19 -#include <asm/processor.h>
   32.20 -#include <asm/delay.h>
   32.21 -
   32.22 -#ifdef CONFIG_SMP
   32.23 -#include <asm/smp.h>
   32.24 -#endif
   32.25 -
   32.26 -void __delay(unsigned long loops)
   32.27 -{
   32.28 -	unsigned long bclock, now;
   32.29 -	
   32.30 -	rdtscl(bclock);
   32.31 -	do
   32.32 -	{
   32.33 -		rep_nop();
   32.34 -		rdtscl(now);
   32.35 -	} while ((now-bclock) < loops);
   32.36 -}
   32.37 -
   32.38 -inline void __const_udelay(unsigned long xloops)
   32.39 -{
   32.40 -	int d0;
   32.41 -	__asm__("mull %0"
   32.42 -		:"=d" (xloops), "=&a" (d0)
   32.43 -		:"1" (xloops),"0" (current_cpu_data.loops_per_jiffy));
   32.44 -        __delay(xloops * HZ);
   32.45 -}
   32.46 -
   32.47 -void __udelay(unsigned long usecs)
   32.48 -{
   32.49 -	__const_udelay(usecs * 0x000010c6);  /* 2**32 / 1000000 */
   32.50 -}
   32.51 -
   32.52 -void __ndelay(unsigned long nsecs)
   32.53 -{
   32.54 -	__const_udelay(nsecs * 0x00005);  /* 2**32 / 1000000000 (rounded up) */
   32.55 -}
    33.1 --- a/linux-2.4.30-xen-sparse/arch/xen/mm/Makefile	Mon Jul 11 14:48:47 2005 +0000
    33.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.3 @@ -1,16 +0,0 @@
    33.4