ia64/xen-unstable
changeset 5805:a83ac0806d6b
Merge with ia64-unstable.hg
line diff
27.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 27.2 +++ b/linux-2.4.30-xen-sparse/Makefile Fri Jul 15 06:39:50 2005 -0700 27.3 @@ -0,0 +1,592 @@ 27.4 +VERSION = 2 27.5 +PATCHLEVEL = 4 27.6 +SUBLEVEL = 30 27.7 +EXTRAVERSION = 27.8 + 27.9 +KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) 27.10 + 27.11 +# SUBARCH always tells us the underlying machine architecture. 27.12 +# Unless overridden, by default ARCH is equivalent to SUBARCH. 27.13 +# This will be overriden for Xen and UML builds. 27.14 +SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) 27.15 +ARCH ?= $(SUBARCH) 27.16 + 27.17 +## XXX The following hack can be discarded after users have adjusted to the 27.18 +## architectural name change 'xeno' -> 'xen'. 27.19 +ifeq ($(ARCH),xeno) 27.20 + ARCH := xen 27.21 +endif 27.22 + 27.23 +KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g") 27.24 + 27.25 +CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ 27.26 + else if [ -x /bin/bash ]; then echo /bin/bash; \ 27.27 + else echo sh; fi ; fi) 27.28 +TOPDIR := $(shell /bin/pwd) 27.29 + 27.30 +HPATH = $(TOPDIR)/include 27.31 +FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu 27.32 + 27.33 +HOSTCC = gcc 27.34 +HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 27.35 + 27.36 +CROSS_COMPILE = 27.37 + 27.38 +# 27.39 +# Include the make variables (CC, etc...) 27.40 +# 27.41 + 27.42 +AS = $(CROSS_COMPILE)as 27.43 +LD = $(CROSS_COMPILE)ld 27.44 +CC = $(CROSS_COMPILE)gcc 27.45 +CPP = $(CC) -E 27.46 +AR = $(CROSS_COMPILE)ar 27.47 +NM = $(CROSS_COMPILE)nm 27.48 +STRIP = $(CROSS_COMPILE)strip 27.49 +OBJCOPY = $(CROSS_COMPILE)objcopy 27.50 +OBJDUMP = $(CROSS_COMPILE)objdump 27.51 +MAKEFILES = $(TOPDIR)/.config 27.52 +GENKSYMS = /sbin/genksyms 27.53 +DEPMOD = /sbin/depmod 27.54 +MODFLAGS = -DMODULE 27.55 +CFLAGS_KERNEL = 27.56 +PERL = perl 27.57 +AWK = awk 27.58 +RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ 27.59 + else echo rpm; fi) 27.60 + 27.61 +export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ 27.62 + CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ 27.63 + CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS MODFLAGS PERL AWK 27.64 + 27.65 +all: do-it-all 27.66 + 27.67 +# 27.68 +# Make "config" the default target if there is no configuration file or 27.69 +# "depend" the target if there is no top-level dependency information. 27.70 +# 27.71 + 27.72 +ifeq (.config,$(wildcard .config)) 27.73 +include .config 27.74 +ifeq (.depend,$(wildcard .depend)) 27.75 +include .depend 27.76 +do-it-all: Version vmlinux 27.77 +else 27.78 +CONFIGURATION = depend 27.79 +do-it-all: depend 27.80 +endif 27.81 +else 27.82 +CONFIGURATION = config 27.83 +do-it-all: config 27.84 +endif 27.85 + 27.86 +# 27.87 +# INSTALL_PATH specifies where to place the updated kernel and system map 27.88 +# images. Uncomment if you want to place them anywhere other than root. 27.89 +# 27.90 + 27.91 +#export INSTALL_PATH=/boot 27.92 + 27.93 +# 27.94 +# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory 27.95 +# relocations required by build roots. This is not defined in the 27.96 +# makefile but the arguement can be passed to make if needed. 27.97 +# 27.98 + 27.99 +MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) 27.100 +export MODLIB 27.101 + 27.102 +# 27.103 +# standard CFLAGS 27.104 +# 27.105 + 27.106 +CPPFLAGS := -D__KERNEL__ -I$(HPATH) 27.107 + 27.108 +CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ 27.109 + -fno-strict-aliasing -fno-common 27.110 +ifndef CONFIG_FRAME_POINTER 27.111 +CFLAGS += -fomit-frame-pointer 27.112 +endif 27.113 +AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS) 27.114 + 27.115 +# 27.116 +# ROOT_DEV specifies the default root-device when making the image. 27.117 +# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case 27.118 +# the default of FLOPPY is used by 'build'. 27.119 +# This is i386 specific. 27.120 +# 27.121 + 27.122 +export ROOT_DEV = CURRENT 27.123 + 27.124 +# 27.125 +# If you want to preset the SVGA mode, uncomment the next line and 27.126 +# set SVGA_MODE to whatever number you want. 27.127 +# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode. 27.128 +# The number is the same as you would ordinarily press at bootup. 27.129 +# This is i386 specific. 27.130 +# 27.131 + 27.132 +export SVGA_MODE = -DSVGA_MODE=NORMAL_VGA 27.133 + 27.134 +# 27.135 +# If you want the RAM disk device, define this to be the size in blocks. 27.136 +# This is i386 specific. 27.137 +# 27.138 + 27.139 +#export RAMDISK = -DRAMDISK=512 27.140 + 27.141 +CORE_FILES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o 27.142 +NETWORKS =net/network.o 27.143 + 27.144 +LIBS =$(TOPDIR)/lib/lib.a 27.145 +SUBDIRS =kernel drivers mm fs net ipc lib crypto 27.146 + 27.147 +DRIVERS-n := 27.148 +DRIVERS-y := 27.149 +DRIVERS-m := 27.150 +DRIVERS- := 27.151 + 27.152 +DRIVERS-$(CONFIG_ACPI_BOOT) += drivers/acpi/acpi.o 27.153 +DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o 27.154 +DRIVERS-y += drivers/char/char.o \ 27.155 + drivers/block/block.o \ 27.156 + drivers/misc/misc.o \ 27.157 + drivers/net/net.o 27.158 +DRIVERS-$(CONFIG_AGP) += drivers/char/agp/agp.o 27.159 +DRIVERS-$(CONFIG_DRM_NEW) += drivers/char/drm/drm.o 27.160 +DRIVERS-$(CONFIG_DRM_OLD) += drivers/char/drm-4.0/drm.o 27.161 +DRIVERS-$(CONFIG_NUBUS) += drivers/nubus/nubus.a 27.162 +DRIVERS-$(CONFIG_NET_FC) += drivers/net/fc/fc.o 27.163 +DRIVERS-$(CONFIG_DEV_APPLETALK) += drivers/net/appletalk/appletalk.o 27.164 +DRIVERS-$(CONFIG_TR) += drivers/net/tokenring/tr.o 27.165 +DRIVERS-$(CONFIG_WAN) += drivers/net/wan/wan.o 27.166 +DRIVERS-$(CONFIG_ARCNET) += drivers/net/arcnet/arcnetdrv.o 27.167 +DRIVERS-$(CONFIG_ATM) += drivers/atm/atm.o 27.168 +DRIVERS-$(CONFIG_IDE) += drivers/ide/idedriver.o 27.169 +DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a 27.170 +DRIVERS-$(CONFIG_SCSI) += drivers/scsi/scsidrv.o 27.171 +DRIVERS-$(CONFIG_FUSION_BOOT) += drivers/message/fusion/fusion.o 27.172 +DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394drv.o 27.173 + 27.174 +ifneq ($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR)$(CONFIG_PARIDE_PCD),) 27.175 +DRIVERS-y += drivers/cdrom/driver.o 27.176 +endif 27.177 + 27.178 +DRIVERS-$(CONFIG_SOUND) += drivers/sound/sounddrivers.o 27.179 +DRIVERS-$(CONFIG_PCI) += drivers/pci/driver.o 27.180 +DRIVERS-$(CONFIG_MTD) += drivers/mtd/mtdlink.o 27.181 +DRIVERS-$(CONFIG_PCMCIA) += drivers/pcmcia/pcmcia.o 27.182 +DRIVERS-$(CONFIG_NET_PCMCIA) += drivers/net/pcmcia/pcmcia_net.o 27.183 +DRIVERS-$(CONFIG_NET_WIRELESS) += drivers/net/wireless/wireless_net.o 27.184 +DRIVERS-$(CONFIG_PCMCIA_CHRDEV) += drivers/char/pcmcia/pcmcia_char.o 27.185 +DRIVERS-$(CONFIG_DIO) += drivers/dio/dio.a 27.186 +DRIVERS-$(CONFIG_SBUS) += drivers/sbus/sbus_all.o 27.187 +DRIVERS-$(CONFIG_ZORRO) += drivers/zorro/driver.o 27.188 +DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a 27.189 +DRIVERS-$(CONFIG_PPC32) += drivers/macintosh/macintosh.o 27.190 +DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o 27.191 +DRIVERS-$(CONFIG_ISAPNP) += drivers/pnp/pnp.o 27.192 +DRIVERS-$(CONFIG_I2C) += drivers/i2c/i2c.o 27.193 +DRIVERS-$(CONFIG_VT) += drivers/video/video.o 27.194 +DRIVERS-$(CONFIG_PARIDE) += drivers/block/paride/paride.a 27.195 +DRIVERS-$(CONFIG_HAMRADIO) += drivers/net/hamradio/hamradio.o 27.196 +DRIVERS-$(CONFIG_TC) += drivers/tc/tc.a 27.197 +DRIVERS-$(CONFIG_USB) += drivers/usb/usbdrv.o 27.198 +DRIVERS-$(CONFIG_USB_GADGET) += drivers/usb/gadget/built-in.o 27.199 +DRIVERS-y +=drivers/media/media.o 27.200 +DRIVERS-$(CONFIG_INPUT) += drivers/input/inputdrv.o 27.201 +DRIVERS-$(CONFIG_HIL) += drivers/hil/hil.o 27.202 +DRIVERS-$(CONFIG_I2O) += drivers/message/i2o/i2o.o 27.203 +DRIVERS-$(CONFIG_IRDA) += drivers/net/irda/irda.o 27.204 +DRIVERS-$(CONFIG_PHONE) += drivers/telephony/telephony.o 27.205 +DRIVERS-$(CONFIG_MD) += drivers/md/mddev.o 27.206 +DRIVERS-$(CONFIG_GSC) += drivers/gsc/gscbus.o 27.207 +DRIVERS-$(CONFIG_BLUEZ) += drivers/bluetooth/bluetooth.o 27.208 +DRIVERS-$(CONFIG_HOTPLUG_PCI) += drivers/hotplug/vmlinux-obj.o 27.209 +DRIVERS-$(CONFIG_ISDN_BOOL) += drivers/isdn/vmlinux-obj.o 27.210 +DRIVERS-$(CONFIG_CRYPTO) += crypto/crypto.o 27.211 + 27.212 +DRIVERS := $(DRIVERS-y) 27.213 + 27.214 + 27.215 +# files removed with 'make clean' 27.216 +CLEAN_FILES = \ 27.217 + kernel/ksyms.lst include/linux/compile.h \ 27.218 + vmlinux System.map \ 27.219 + .tmp* \ 27.220 + drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \ 27.221 + drivers/char/conmakehash \ 27.222 + drivers/char/drm/*-mod.c \ 27.223 + drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist \ 27.224 + drivers/zorro/devlist.h drivers/zorro/gen-devlist \ 27.225 + drivers/sound/bin2hex drivers/sound/hex2hex \ 27.226 + drivers/atm/fore200e_mkfirm drivers/atm/{pca,sba}*{.bin,.bin1,.bin2} \ 27.227 + drivers/scsi/aic7xxx/aicasm/aicasm \ 27.228 + drivers/scsi/aic7xxx/aicasm/aicasm_gram.c \ 27.229 + drivers/scsi/aic7xxx/aicasm/aicasm_gram.h \ 27.230 + drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.c \ 27.231 + drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.h \ 27.232 + drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.c \ 27.233 + drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \ 27.234 + drivers/scsi/aic7xxx/aicasm/aicdb.h \ 27.235 + drivers/scsi/aic7xxx/aicasm/y.tab.h \ 27.236 + drivers/scsi/53c700_d.h \ 27.237 + drivers/tc/lk201-map.c \ 27.238 + net/khttpd/make_times_h \ 27.239 + net/khttpd/times.h \ 27.240 + submenu* \ 27.241 + drivers/ieee1394/oui.c 27.242 +# directories removed with 'make clean' 27.243 +CLEAN_DIRS = \ 27.244 + modules 27.245 + 27.246 +# files removed with 'make mrproper' 27.247 +MRPROPER_FILES = \ 27.248 + include/linux/autoconf.h include/linux/version.h \ 27.249 + lib/crc32table.h lib/gen_crc32table \ 27.250 + drivers/net/hamradio/soundmodem/sm_tbl_{afsk1200,afsk2666,fsk9600}.h \ 27.251 + drivers/net/hamradio/soundmodem/sm_tbl_{hapn4800,psk4800}.h \ 27.252 + drivers/net/hamradio/soundmodem/sm_tbl_{afsk2400_7,afsk2400_8}.h \ 27.253 + drivers/net/hamradio/soundmodem/gentbl \ 27.254 + drivers/sound/*_boot.h drivers/sound/.*.boot \ 27.255 + drivers/sound/msndinit.c \ 27.256 + drivers/sound/msndperm.c \ 27.257 + drivers/sound/pndsperm.c \ 27.258 + drivers/sound/pndspini.c \ 27.259 + drivers/atm/fore200e_*_fw.c drivers/atm/.fore200e_*.fw \ 27.260 + .version .config* config.in config.old \ 27.261 + scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp \ 27.262 + scripts/lxdialog/*.o scripts/lxdialog/lxdialog \ 27.263 + .menuconfig.log \ 27.264 + include/asm \ 27.265 + .hdepend scripts/mkdep scripts/split-include scripts/docproc \ 27.266 + $(TOPDIR)/include/linux/modversions.h \ 27.267 + kernel.spec 27.268 + 27.269 +# directories removed with 'make mrproper' 27.270 +MRPROPER_DIRS = \ 27.271 + include/config \ 27.272 + $(TOPDIR)/include/linux/modules 27.273 + 27.274 + 27.275 +include arch/$(ARCH)/Makefile 27.276 + 27.277 +# Extra cflags for kbuild 2.4. The default is to forbid includes by kernel code 27.278 +# from user space headers. Some UML code requires user space headers, in the 27.279 +# UML Makefiles add 'kbuild_2_4_nostdinc :=' before include Rules.make. No 27.280 +# other kernel code should include user space headers, if you need 27.281 +# 'kbuild_2_4_nostdinc :=' or -I/usr/include for kernel code and you are not UML 27.282 +# then your code is broken! KAO. 27.283 + 27.284 +kbuild_2_4_nostdinc := -nostdinc -iwithprefix include 27.285 +export kbuild_2_4_nostdinc 27.286 + 27.287 +export CPPFLAGS CFLAGS CFLAGS_KERNEL AFLAGS AFLAGS_KERNEL 27.288 + 27.289 +export NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS 27.290 + 27.291 +.S.s: 27.292 + $(CPP) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -o $*.s $< 27.293 +.S.o: 27.294 + $(CC) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -c -o $*.o $< 27.295 + 27.296 +Version: dummy 27.297 + @rm -f include/linux/compile.h 27.298 + 27.299 +boot: vmlinux 27.300 + @$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C arch/$(ARCH)/boot 27.301 + 27.302 +vmlinux: include/linux/version.h $(CONFIGURATION) init/main.o init/version.o init/do_mounts.o linuxsubdirs 27.303 + $(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o init/do_mounts.o \ 27.304 + --start-group \ 27.305 + $(CORE_FILES) \ 27.306 + $(DRIVERS) \ 27.307 + $(NETWORKS) \ 27.308 + $(LIBS) \ 27.309 + --end-group \ 27.310 + -o vmlinux 27.311 + $(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map 27.312 + 27.313 +symlinks: 27.314 + rm -f include/asm 27.315 + ( cd include ; ln -sf asm-$(ARCH) asm) 27.316 + @if [ ! -d include/linux/modules ]; then \ 27.317 + mkdir include/linux/modules; \ 27.318 + fi 27.319 + 27.320 +oldconfig: symlinks 27.321 + $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in 27.322 + 27.323 +xconfig: symlinks 27.324 + $(MAKE) -C scripts kconfig.tk 27.325 + wish -f scripts/kconfig.tk 27.326 + 27.327 +menuconfig: include/linux/version.h symlinks 27.328 + $(MAKE) -C scripts/lxdialog all 27.329 + $(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in 27.330 + 27.331 +config: symlinks 27.332 + $(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in 27.333 + 27.334 +include/config/MARKER: scripts/split-include include/linux/autoconf.h 27.335 + scripts/split-include include/linux/autoconf.h include/config 27.336 + @ touch include/config/MARKER 27.337 + 27.338 +linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS)) 27.339 + 27.340 +$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/linux/version.h include/config/MARKER 27.341 + $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C $(patsubst _dir_%, %, $@) 27.342 + 27.343 +$(TOPDIR)/include/linux/version.h: include/linux/version.h 27.344 +$(TOPDIR)/include/linux/compile.h: include/linux/compile.h 27.345 + 27.346 +newversion: 27.347 + . scripts/mkversion > .tmpversion 27.348 + @mv -f .tmpversion .version 27.349 + 27.350 +uts_len := 64 27.351 +uts_truncate := sed -e 's/\(.\{1,$(uts_len)\}\).*/\1/' 27.352 + 27.353 +include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion 27.354 + @echo -n \#`cat .version` > .ver1 27.355 + @if [ -n "$(CONFIG_SMP)" ] ; then echo -n " SMP" >> .ver1; fi 27.356 + @if [ -f .name ]; then echo -n \-`cat .name` >> .ver1; fi 27.357 + @LANG=C echo ' '`date` >> .ver1 27.358 + @echo \#define UTS_VERSION \"`cat .ver1 | $(uts_truncate)`\" > .ver 27.359 + @LANG=C echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> .ver 27.360 + @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> .ver 27.361 + @echo \#define LINUX_COMPILE_HOST \"`hostname | $(uts_truncate)`\" >> .ver 27.362 + @([ -x /bin/dnsdomainname ] && /bin/dnsdomainname > .ver1) || \ 27.363 + ([ -x /bin/domainname ] && /bin/domainname > .ver1) || \ 27.364 + echo > .ver1 27.365 + @echo \#define LINUX_COMPILE_DOMAIN \"`cat .ver1 | $(uts_truncate)`\" >> .ver 27.366 + @echo \#define LINUX_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -n 1`\" >> .ver 27.367 + @mv -f .ver $@ 27.368 + @rm -f .ver1 27.369 + 27.370 +include/linux/version.h: ./Makefile 27.371 + @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \ 27.372 + (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false) 27.373 + @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver 27.374 + @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver 27.375 + @echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver 27.376 + @mv -f .ver $@ 27.377 + 27.378 +comma := , 27.379 + 27.380 +init/version.o: init/version.c include/linux/compile.h include/config/MARKER 27.381 + $(CC) $(CFLAGS) $(CFLAGS_KERNEL) -DUTS_MACHINE='"$(SUBARCH)"' -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o init/version.o init/version.c 27.382 + 27.383 +init/main.o: init/main.c include/config/MARKER 27.384 + $(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $< 27.385 + 27.386 +init/do_mounts.o: init/do_mounts.c include/config/MARKER 27.387 + $(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $< 27.388 + 27.389 +fs lib mm ipc kernel drivers net: dummy 27.390 + $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@) 27.391 + 27.392 +TAGS: dummy 27.393 + { find include/asm-${ARCH} -name '*.h' -print ; \ 27.394 + find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print ; \ 27.395 + find $(SUBDIRS) init arch/${ARCH} -name '*.[chS]' ; } | grep -v SCCS | grep -v '\.svn' | etags - 27.396 + 27.397 +# Exuberant ctags works better with -I 27.398 +tags: dummy 27.399 + CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \ 27.400 + ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \ 27.401 + find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \ 27.402 + find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a 27.403 + 27.404 +ifdef CONFIG_MODULES 27.405 +ifdef CONFIG_MODVERSIONS 27.406 +MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h 27.407 +endif 27.408 + 27.409 +.PHONY: modules 27.410 +modules: $(patsubst %, _mod_%, $(SUBDIRS)) 27.411 + 27.412 +.PHONY: $(patsubst %, _mod_%, $(SUBDIRS)) 27.413 +$(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER 27.414 + $(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules 27.415 + 27.416 +.PHONY: modules_install 27.417 +modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS)) _modinst_post 27.418 + 27.419 +.PHONY: _modinst_ 27.420 +_modinst_: 27.421 + @rm -rf $(MODLIB)/kernel 27.422 + @rm -f $(MODLIB)/build 27.423 + @mkdir -p $(MODLIB)/kernel 27.424 + @ln -s $(TOPDIR) $(MODLIB)/build 27.425 + 27.426 +# If System.map exists, run depmod. This deliberately does not have a 27.427 +# dependency on System.map since that would run the dependency tree on 27.428 +# vmlinux. This depmod is only for convenience to give the initial 27.429 +# boot a modules.dep even before / is mounted read-write. However the 27.430 +# boot script depmod is the master version. 27.431 +ifeq "$(strip $(INSTALL_MOD_PATH))" "" 27.432 +depmod_opts := 27.433 +else 27.434 +depmod_opts := -b $(INSTALL_MOD_PATH) -r 27.435 +endif 27.436 +.PHONY: _modinst_post 27.437 +_modinst_post: _modinst_post_pcmcia 27.438 + if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi 27.439 + 27.440 +# Backwards compatibilty symlinks for people still using old versions 27.441 +# of pcmcia-cs with hard coded pathnames on insmod. Remove 27.442 +# _modinst_post_pcmcia for kernel 2.4.1. 27.443 +.PHONY: _modinst_post_pcmcia 27.444 +_modinst_post_pcmcia: 27.445 + cd $(MODLIB); \ 27.446 + mkdir -p pcmcia; \ 27.447 + find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia 27.448 + 27.449 +.PHONY: $(patsubst %, _modinst_%, $(SUBDIRS)) 27.450 +$(patsubst %, _modinst_%, $(SUBDIRS)) : 27.451 + $(MAKE) -C $(patsubst _modinst_%, %, $@) modules_install 27.452 + 27.453 +# modules disabled.... 27.454 + 27.455 +else 27.456 +modules modules_install: dummy 27.457 + @echo 27.458 + @echo "The present kernel configuration has modules disabled." 27.459 + @echo "Type 'make config' and enable loadable module support." 27.460 + @echo "Then build a kernel with module support enabled." 27.461 + @echo 27.462 + @exit 1 27.463 +endif 27.464 + 27.465 +clean: archclean 27.466 + find . \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f -print \ 27.467 + | grep -v lxdialog/ | xargs rm -f 27.468 + rm -f $(CLEAN_FILES) 27.469 + rm -rf $(CLEAN_DIRS) 27.470 + $(MAKE) -C Documentation/DocBook clean 27.471 + 27.472 +mrproper: clean archmrproper 27.473 + find . \( -size 0 -o -name .depend \) -type f -print | xargs rm -f 27.474 + rm -f $(MRPROPER_FILES) 27.475 + rm -rf $(MRPROPER_DIRS) 27.476 + $(MAKE) -C Documentation/DocBook mrproper 27.477 + 27.478 +distclean: mrproper 27.479 + rm -f core `find . \( -not -type d \) -and \ 27.480 + \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ 27.481 + -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ 27.482 + -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags 27.483 + 27.484 +backup: mrproper 27.485 + cd .. && tar cf - linux/ | gzip -9 > backup.gz 27.486 + sync 27.487 + 27.488 +sgmldocs: 27.489 + chmod 755 $(TOPDIR)/scripts/docgen 27.490 + chmod 755 $(TOPDIR)/scripts/gen-all-syms 27.491 + chmod 755 $(TOPDIR)/scripts/kernel-doc 27.492 + $(MAKE) -C $(TOPDIR)/Documentation/DocBook books 27.493 + 27.494 +psdocs: sgmldocs 27.495 + $(MAKE) -C Documentation/DocBook ps 27.496 + 27.497 +pdfdocs: sgmldocs 27.498 + $(MAKE) -C Documentation/DocBook pdf 27.499 + 27.500 +htmldocs: sgmldocs 27.501 + $(MAKE) -C Documentation/DocBook html 27.502 + 27.503 +mandocs: 27.504 + chmod 755 $(TOPDIR)/scripts/kernel-doc 27.505 + chmod 755 $(TOPDIR)/scripts/split-man 27.506 + $(MAKE) -C Documentation/DocBook man 27.507 + 27.508 +sums: 27.509 + find . -type f -print | sort | xargs sum > .SUMS 27.510 + 27.511 +dep-files: scripts/mkdep archdep include/linux/version.h 27.512 + rm -f .depend .hdepend 27.513 + $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" 27.514 +ifdef CONFIG_MODVERSIONS 27.515 + $(MAKE) update-modverfile 27.516 +endif 27.517 + scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend 27.518 + scripts/mkdep -- init/*.c > .depend 27.519 + 27.520 +ifdef CONFIG_MODVERSIONS 27.521 +MODVERFILE := $(TOPDIR)/include/linux/modversions.h 27.522 +else 27.523 +MODVERFILE := 27.524 +endif 27.525 +export MODVERFILE 27.526 + 27.527 +depend dep: dep-files 27.528 + 27.529 +checkconfig: 27.530 + find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkconfig.pl 27.531 + 27.532 +checkhelp: 27.533 + find * -name [cC]onfig.in -print | sort | xargs $(PERL) -w scripts/checkhelp.pl 27.534 + 27.535 +checkincludes: 27.536 + find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl 27.537 + 27.538 +ifdef CONFIGURATION 27.539 +..$(CONFIGURATION): 27.540 + @echo 27.541 + @echo "You have a bad or nonexistent" .$(CONFIGURATION) ": running 'make" $(CONFIGURATION)"'" 27.542 + @echo 27.543 + $(MAKE) $(CONFIGURATION) 27.544 + @echo 27.545 + @echo "Successful. Try re-making (ignore the error that follows)" 27.546 + @echo 27.547 + exit 1 27.548 + 27.549 +#dummy: ..$(CONFIGURATION) 27.550 +dummy: 27.551 + 27.552 +else 27.553 + 27.554 +dummy: 27.555 + 27.556 +endif 27.557 + 27.558 +include Rules.make 27.559 + 27.560 +# 27.561 +# This generates dependencies for the .h files. 27.562 +# 27.563 + 27.564 +scripts/mkdep: scripts/mkdep.c 27.565 + $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c 27.566 + 27.567 +scripts/split-include: scripts/split-include.c 27.568 + $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c 27.569 + 27.570 +# 27.571 +# RPM target 27.572 +# 27.573 +# If you do a make spec before packing the tarball you can rpm -ta it 27.574 +# 27.575 +spec: 27.576 + . scripts/mkspec >kernel.spec 27.577 + 27.578 +# 27.579 +# Build a tar ball, generate an rpm from it and pack the result 27.580 +# There arw two bits of magic here 27.581 +# 1) The use of /. to avoid tar packing just the symlink 27.582 +# 2) Removing the .dep files as they have source paths in them that 27.583 +# will become invalid 27.584 +# 27.585 +rpm: clean spec 27.586 + find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f 27.587 + set -e; \ 27.588 + cd $(TOPDIR)/.. ; \ 27.589 + ln -sf $(TOPDIR) $(KERNELPATH) ; \ 27.590 + tar -cvz --exclude CVS -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \ 27.591 + rm $(KERNELPATH) ; \ 27.592 + cd $(TOPDIR) ; \ 27.593 + . scripts/mkversion > .version ; \ 27.594 + $(RPM) -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \ 27.595 + rm $(TOPDIR)/../$(KERNELPATH).tar.gz
28.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 28.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/Makefile Fri Jul 15 06:39:50 2005 -0700 28.3 @@ -0,0 +1,139 @@ 28.4 +# 28.5 +# xen/Makefile 28.6 +# 28.7 +# This file is included by the global makefile so that you can add your own 28.8 +# architecture-specific flags and dependencies. Remember to do have actions 28.9 +# for "archclean" and "archdep" for cleaning up and making dependencies for 28.10 +# this architecture 28.11 +# 28.12 +# This file is subject to the terms and conditions of the GNU General Public 28.13 +# License. See the file "COPYING" in the main directory of this archive 28.14 +# for more details. 28.15 +# 28.16 +# Copyright (C) 1994 by Linus Torvalds 28.17 +# 28.18 +# 19990713 Artur Skawina <skawina@geocities.com> 28.19 +# Added '-march' and '-mpreferred-stack-boundary' support 28.20 +# 28.21 + 28.22 +# If no .config file exists then use the appropriate defconfig-* file 28.23 +ifneq (.config,$(wildcard .config)) 28.24 +DUMMYX:=$(shell cp $(TOPDIR)/arch/xen/defconfig$(EXTRAVERSION) $(TOPDIR)/.config) 28.25 +-include $(TOPDIR)/.config 28.26 +endif 28.27 + 28.28 +LD=$(CROSS_COMPILE)ld -m elf_i386 28.29 +OBJCOPY=$(CROSS_COMPILE)objcopy -R .note -R .comment -S 28.30 +LDFLAGS=-e stext 28.31 +LINKFLAGS =-T $(TOPDIR)/arch/xen/vmlinux.lds $(LDFLAGS) 28.32 + 28.33 +CFLAGS += -pipe 28.34 + 28.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) 28.36 + 28.37 +# prevent gcc from keeping the stack 16 byte aligned 28.38 +CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,) 28.39 + 28.40 +ifdef CONFIG_M686 28.41 +CFLAGS += -march=i686 28.42 +endif 28.43 + 28.44 +ifdef CONFIG_MPENTIUMIII 28.45 +CFLAGS += -march=i686 28.46 +endif 28.47 + 28.48 +ifdef CONFIG_MPENTIUM4 28.49 +CFLAGS += -march=i686 28.50 +endif 28.51 + 28.52 +ifdef CONFIG_MK7 28.53 +CFLAGS += $(call check_gcc,-march=athlon,-march=i686 -malign-functions=4) 28.54 +endif 28.55 + 28.56 +# Disable unit-at-a-time mode, it makes gcc use a lot more stack 28.57 +# due to the lack of sharing of stacklots. 28.58 +CFLAGS += $(call check_gcc,-fno-unit-at-a-time,) 28.59 + 28.60 +HEAD := arch/xen/kernel/head.o arch/xen/kernel/init_task.o 28.61 + 28.62 +SUBDIRS += arch/xen/kernel arch/xen/mm arch/xen/lib 28.63 +SUBDIRS += arch/xen/drivers/console 28.64 +SUBDIRS += arch/xen/drivers/evtchn 28.65 +SUBDIRS += arch/xen/drivers/blkif 28.66 +SUBDIRS += arch/xen/drivers/netif 28.67 +SUBDIRS += arch/xen/drivers/usbif 28.68 +SUBDIRS += arch/xen/drivers/balloon 28.69 +ifdef CONFIG_XEN_PRIVILEGED_GUEST 28.70 +SUBDIRS += arch/xen/drivers/dom0 28.71 +endif 28.72 + 28.73 +CORE_FILES += arch/xen/kernel/kernel.o arch/xen/mm/mm.o 28.74 +CORE_FILES += arch/xen/drivers/evtchn/drv.o 28.75 +CORE_FILES += arch/xen/drivers/console/drv.o 28.76 +DRIVERS += arch/xen/drivers/blkif/drv.o 28.77 +DRIVERS += arch/xen/drivers/netif/drv.o 28.78 +DRIVERS += arch/xen/drivers/usbif/drv.o 28.79 +ifdef CONFIG_XEN_PRIVILEGED_GUEST 28.80 +CORE_FILES += arch/xen/drivers/dom0/drv.o 28.81 +endif 28.82 +CORE_FILES += arch/xen/drivers/balloon/drv.o 28.83 +LIBS := $(TOPDIR)/arch/xen/lib/lib.a $(LIBS) $(TOPDIR)/arch/xen/lib/lib.a 28.84 + 28.85 +arch/xen/kernel: dummy 28.86 + $(MAKE) linuxsubdirs SUBDIRS=arch/xen/kernel 28.87 + 28.88 +arch/xen/mm: dummy 28.89 + $(MAKE) linuxsubdirs SUBDIRS=arch/xen/mm 28.90 + 28.91 +arch/xen/drivers/console: dummy 28.92 + $(MAKE) linuxsubdirs SUBDIRS=arch/xen/drivers/console 28.93 + 28.94 +arch/xen/drivers/network: dummy 28.95 + $(MAKE) linuxsubdirs SUBDIRS=arch/xen/drivers/network 28.96 + 28.97 +arch/xen/drivers/block: dummy 28.98 + $(MAKE) linuxsubdirs SUBDIRS=arch/xen/drivers/block 28.99 + 28.100 +arch/xen/drivers/dom0: dummy 28.101 + $(MAKE) linuxsubdirs SUBDIRS=arch/xen/drivers/dom0 28.102 + 28.103 +arch/xen/drivers/balloon: dummy 28.104 + $(MAKE) linuxsubdirs SUBDIRS=arch/xen/drivers/balloon 28.105 + 28.106 +MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot 28.107 + 28.108 +vmlinux: arch/xen/vmlinux.lds 28.109 + 28.110 +FORCE: ; 28.111 + 28.112 +.PHONY: bzImage compressed clean archclean archmrproper archdep 28.113 + 28.114 + 28.115 +bzImage: vmlinux 28.116 + @$(MAKEBOOT) bzImage 28.117 + 28.118 +INSTALL_NAME ?= $(KERNELRELEASE) 28.119 +install: bzImage 28.120 + mkdir -p $(INSTALL_PATH)/boot 28.121 + ln -f -s vmlinuz-$(INSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_PATH)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(XENGUEST)$(INSTALL_SUFFIX) 28.122 + rm -f $(INSTALL_PATH)/boot/vmlinuz-$(INSTALL_NAME)$(INSTALL_SUFFIX) 28.123 + install -m0644 arch/$(ARCH)/boot/bzImage $(INSTALL_PATH)/boot/vmlinuz-$(INSTALL_NAME)$(INSTALL_SUFFIX) 28.124 + install -m0644 vmlinux $(INSTALL_PATH)/boot/vmlinux-syms-$(INSTALL_NAME)$(INSTALL_SUFFIX) 28.125 + install -m0664 .config $(INSTALL_PATH)/boot/config-$(INSTALL_NAME)$(INSTALL_SUFFIX) 28.126 + install -m0664 System.map $(INSTALL_PATH)/boot/System.map-$(INSTALL_NAME)$(INSTALL_SUFFIX) 28.127 + ln -f -s vmlinuz-$(INSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_PATH)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(XENGUEST)$(INSTALL_SUFFIX) 28.128 + 28.129 +%_config: arch/xen/defconfig-% 28.130 + rm -f .config arch/xen/defconfig 28.131 + cp -f arch/xen/defconfig-$(@:_config=) arch/xen/defconfig 28.132 + cp -f arch/xen/defconfig-$(@:_config=) .config 28.133 + 28.134 + 28.135 +archclean: 28.136 + @$(MAKEBOOT) clean 28.137 + 28.138 +archmrproper: 28.139 + rm -f include/asm-xen/xen-public/arch 28.140 + 28.141 +archdep: 28.142 + @$(MAKEBOOT) dep
29.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 29.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/boot/Makefile Fri Jul 15 06:39:50 2005 -0700 29.3 @@ -0,0 +1,13 @@ 29.4 +# 29.5 +# arch/xen/boot/Makefile 29.6 +# 29.7 + 29.8 +bzImage: $(TOPDIR)/vmlinux 29.9 + $(OBJCOPY) $< Image 29.10 + gzip -f -9 < Image > $@ 29.11 + rm -f Image 29.12 + 29.13 +dep: 29.14 + 29.15 +clean: 29.16 + rm -f bzImage Image
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 30.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/config.in Fri Jul 15 06:39:50 2005 -0700 30.3 @@ -0,0 +1,337 @@ 30.4 +# 30.5 +# For a description of the syntax of this configuration file, 30.6 +# see Documentation/kbuild/config-language.txt. 30.7 +# 30.8 +mainmenu_name "Linux Kernel Configuration" 30.9 + 30.10 +define_bool CONFIG_XEN y 30.11 + 30.12 +define_bool CONFIG_X86 y 30.13 +define_bool CONFIG_ISA y 30.14 +define_bool CONFIG_SBUS n 30.15 + 30.16 +define_bool CONFIG_UID16 y 30.17 + 30.18 +mainmenu_option next_comment 30.19 +comment 'Xen' 30.20 +bool 'Support for privileged operations (domain 0)' CONFIG_XEN_PRIVILEGED_GUEST 30.21 +bool 'Device-driver domain (physical device access)' CONFIG_XEN_PHYSDEV_ACCESS 30.22 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then 30.23 + bool 'USB-device backend driver' CONFIG_XEN_USB_BACKEND 30.24 +fi 30.25 +bool 'Scrub memory before freeing it to Xen' CONFIG_XEN_SCRUB_PAGES 30.26 +bool 'Network-device frontend driver' CONFIG_XEN_NETDEV_FRONTEND 30.27 +bool 'Block-device frontend driver' CONFIG_XEN_BLKDEV_FRONTEND 30.28 +bool 'Block-device uses grant tables' CONFIG_XEN_BLKDEV_GRANT 30.29 +bool 'USB-device frontend driver' CONFIG_XEN_USB_FRONTEND 30.30 +endmenu 30.31 +# The IBM S/390 patch needs this. 30.32 +define_bool CONFIG_NO_IDLE_HZ y 30.33 + 30.34 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then 30.35 + define_bool CONFIG_FOREIGN_PAGES y 30.36 +else 30.37 + define_bool CONFIG_FOREIGN_PAGES n 30.38 + define_bool CONFIG_NETDEVICES y 30.39 + define_bool CONFIG_VT n 30.40 +fi 30.41 + 30.42 +mainmenu_option next_comment 30.43 +comment 'Code maturity level options' 30.44 +bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL 30.45 +endmenu 30.46 + 30.47 +mainmenu_option next_comment 30.48 +comment 'Loadable module support' 30.49 +bool 'Enable loadable module support' CONFIG_MODULES 30.50 +if [ "$CONFIG_MODULES" = "y" ]; then 30.51 + bool ' Set version information on all module symbols' CONFIG_MODVERSIONS 30.52 + bool ' Kernel module loader' CONFIG_KMOD 30.53 +fi 30.54 +endmenu 30.55 + 30.56 +mainmenu_option next_comment 30.57 +comment 'Processor type and features' 30.58 +choice 'Processor family' \ 30.59 + "Pentium-Pro/Celeron/Pentium-II CONFIG_M686 \ 30.60 + Pentium-III/Celeron(Coppermine) CONFIG_MPENTIUMIII \ 30.61 + Pentium-4 CONFIG_MPENTIUM4 \ 30.62 + Athlon/Duron/K7 CONFIG_MK7 \ 30.63 + Opteron/Athlon64/Hammer/K8 CONFIG_MK8 \ 30.64 + VIA-C3-2 CONFIG_MVIAC3_2" Pentium-Pro 30.65 + 30.66 + define_bool CONFIG_X86_WP_WORKS_OK y 30.67 + define_bool CONFIG_X86_INVLPG y 30.68 + define_bool CONFIG_X86_CMPXCHG y 30.69 + define_bool CONFIG_X86_XADD y 30.70 + define_bool CONFIG_X86_BSWAP y 30.71 + define_bool CONFIG_X86_POPAD_OK y 30.72 + define_bool CONFIG_RWSEM_GENERIC_SPINLOCK n 30.73 + define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM y 30.74 + 30.75 + define_bool CONFIG_X86_GOOD_APIC y 30.76 + define_bool CONFIG_X86_PGE y 30.77 + define_bool CONFIG_X86_USE_PPRO_CHECKSUM y 30.78 + define_bool CONFIG_X86_TSC y 30.79 + 30.80 +if [ "$CONFIG_M686" = "y" ]; then 30.81 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 30.82 +fi 30.83 +if [ "$CONFIG_MPENTIUMIII" = "y" ]; then 30.84 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 30.85 +fi 30.86 +if [ "$CONFIG_MPENTIUM4" = "y" ]; then 30.87 + define_int CONFIG_X86_L1_CACHE_SHIFT 7 30.88 +fi 30.89 +if [ "$CONFIG_MK8" = "y" ]; then 30.90 + define_bool CONFIG_MK7 y 30.91 +fi 30.92 +if [ "$CONFIG_MK7" = "y" ]; then 30.93 + define_int CONFIG_X86_L1_CACHE_SHIFT 6 30.94 + define_bool CONFIG_X86_USE_3DNOW y 30.95 +fi 30.96 +if [ "$CONFIG_MVIAC3_2" = "y" ]; then 30.97 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 30.98 +fi 30.99 + 30.100 +#if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then 30.101 +# tristate 'BIOS Enhanced Disk Drive calls determine boot disk (EXPERIMENTAL)' CONFIG_EDD 30.102 +#fi 30.103 + 30.104 +choice 'High Memory Support' \ 30.105 + "off CONFIG_NOHIGHMEM \ 30.106 + 4GB CONFIG_HIGHMEM4G" off 30.107 +# 64GB CONFIG_HIGHMEM64G" off 30.108 +if [ "$CONFIG_HIGHMEM4G" = "y" ]; then 30.109 + define_bool CONFIG_HIGHMEM y 30.110 +fi 30.111 +if [ "$CONFIG_HIGHMEM64G" = "y" ]; then 30.112 + define_bool CONFIG_HIGHMEM y 30.113 + define_bool CONFIG_X86_PAE y 30.114 +fi 30.115 + 30.116 +if [ "$CONFIG_HIGHMEM" = "y" ]; then 30.117 + bool 'HIGHMEM I/O support' CONFIG_HIGHIO 30.118 +fi 30.119 + 30.120 +define_int CONFIG_FORCE_MAX_ZONEORDER 11 30.121 + 30.122 +#bool 'Symmetric multi-processing support' CONFIG_SMP 30.123 +#if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then 30.124 +# define_bool CONFIG_HAVE_DEC_LOCK y 30.125 +#fi 30.126 +endmenu 30.127 + 30.128 +mainmenu_option next_comment 30.129 +comment 'General setup' 30.130 + 30.131 +bool 'Networking support' CONFIG_NET 30.132 + 30.133 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then 30.134 + bool 'PCI support' CONFIG_PCI 30.135 + source drivers/pci/Config.in 30.136 + 30.137 + bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG 30.138 + 30.139 + if [ "$CONFIG_HOTPLUG" = "y" ] ; then 30.140 + source drivers/pcmcia/Config.in 30.141 + source drivers/hotplug/Config.in 30.142 + else 30.143 + define_bool CONFIG_PCMCIA n 30.144 + define_bool CONFIG_HOTPLUG_PCI n 30.145 + fi 30.146 +fi 30.147 + 30.148 +bool 'System V IPC' CONFIG_SYSVIPC 30.149 +bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT 30.150 +bool 'Sysctl support' CONFIG_SYSCTL 30.151 +if [ "$CONFIG_PROC_FS" = "y" ]; then 30.152 + choice 'Kernel core (/proc/kcore) format' \ 30.153 + "ELF CONFIG_KCORE_ELF \ 30.154 + A.OUT CONFIG_KCORE_AOUT" ELF 30.155 +fi 30.156 +tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT 30.157 +bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF 30.158 +tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC 30.159 +bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER 30.160 + 30.161 +endmenu 30.162 + 30.163 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then 30.164 + source drivers/mtd/Config.in 30.165 + 30.166 + source drivers/parport/Config.in 30.167 + 30.168 + source drivers/pnp/Config.in 30.169 + 30.170 + source drivers/block/Config.in 30.171 + 30.172 + source drivers/md/Config.in 30.173 +fi 30.174 + 30.175 +if [ "$CONFIG_NET" = "y" ]; then 30.176 + source net/Config.in 30.177 +fi 30.178 + 30.179 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then 30.180 + mainmenu_option next_comment 30.181 + comment 'ATA/IDE/MFM/RLL support' 30.182 + 30.183 + tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE 30.184 + 30.185 + if [ "$CONFIG_IDE" != "n" ]; then 30.186 + source drivers/ide/Config.in 30.187 + else 30.188 + define_bool CONFIG_BLK_DEV_HD n 30.189 + fi 30.190 + endmenu 30.191 +fi 30.192 + 30.193 +mainmenu_option next_comment 30.194 +comment 'SCSI support' 30.195 + 30.196 +tristate 'SCSI support' CONFIG_SCSI 30.197 + 30.198 +if [ "$CONFIG_SCSI" != "n" ]; then 30.199 + source drivers/scsi/Config.in 30.200 +fi 30.201 +endmenu 30.202 + 30.203 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then 30.204 + source drivers/message/fusion/Config.in 30.205 + 30.206 + source drivers/ieee1394/Config.in 30.207 + 30.208 + source drivers/message/i2o/Config.in 30.209 + 30.210 + if [ "$CONFIG_NET" = "y" ]; then 30.211 + mainmenu_option next_comment 30.212 + comment 'Network device support' 30.213 + 30.214 + bool 'Network device support' CONFIG_NETDEVICES 30.215 + if [ "$CONFIG_NETDEVICES" = "y" ]; then 30.216 + source drivers/net/Config.in 30.217 + if [ "$CONFIG_ATM" = "y" -o "$CONFIG_ATM" = "m" ]; then 30.218 + source drivers/atm/Config.in 30.219 + fi 30.220 + fi 30.221 + endmenu 30.222 + fi 30.223 + 30.224 + source net/ax25/Config.in 30.225 + 30.226 + source net/irda/Config.in 30.227 + 30.228 + mainmenu_option next_comment 30.229 + comment 'ISDN subsystem' 30.230 + if [ "$CONFIG_NET" != "n" ]; then 30.231 + tristate 'ISDN support' CONFIG_ISDN 30.232 + if [ "$CONFIG_ISDN" != "n" ]; then 30.233 + source drivers/isdn/Config.in 30.234 + fi 30.235 + fi 30.236 + endmenu 30.237 + 30.238 + if [ "$CONFIG_ISA" = "y" ]; then 30.239 + mainmenu_option next_comment 30.240 + comment 'Old CD-ROM drivers (not SCSI, not IDE)' 30.241 + 30.242 + bool 'Support non-SCSI/IDE/ATAPI CDROM drives' CONFIG_CD_NO_IDESCSI 30.243 + if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then 30.244 + source drivers/cdrom/Config.in 30.245 + fi 30.246 + endmenu 30.247 + fi 30.248 + 30.249 + # 30.250 + # input before char - char/joystick depends on it. As does USB. 30.251 + # 30.252 + source drivers/input/Config.in 30.253 +else 30.254 + # 30.255 + # Block device driver configuration 30.256 + # 30.257 + mainmenu_option next_comment 30.258 + comment 'Block devices' 30.259 + tristate 'Loopback device support' CONFIG_BLK_DEV_LOOP 30.260 + dep_tristate 'Network block device support' CONFIG_BLK_DEV_NBD $CONFIG_NET 30.261 + tristate 'RAM disk support' CONFIG_BLK_DEV_RAM 30.262 + if [ "$CONFIG_BLK_DEV_RAM" = "y" -o "$CONFIG_BLK_DEV_RAM" = "m" ]; then 30.263 + int ' Default RAM disk size' CONFIG_BLK_DEV_RAM_SIZE 4096 30.264 + fi 30.265 + dep_bool ' Initial RAM disk (initrd) support' CONFIG_BLK_DEV_INITRD $CONFIG_BLK_DEV_RAM 30.266 + bool 'Per partition statistics in /proc/partitions' CONFIG_BLK_STATS 30.267 + define_bool CONFIG_BLK_DEV_HD n 30.268 + endmenu 30.269 +fi 30.270 + 30.271 +source drivers/char/Config.in 30.272 + 30.273 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" -o "$CONFIG_XEN_USB_FRONTEND" = "y" ]; then 30.274 + source drivers/media/Config.in 30.275 +fi 30.276 + 30.277 +source fs/Config.in 30.278 + 30.279 +mainmenu_option next_comment 30.280 +comment 'Console drivers' 30.281 + 30.282 +define_bool CONFIG_XEN_CONSOLE y 30.283 + 30.284 +if [ "$CONFIG_VT" = "y" ]; then 30.285 + bool 'VGA text console' CONFIG_VGA_CONSOLE 30.286 + bool 'Dummy console' CONFIG_DUMMY_CONSOLE 30.287 + if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then 30.288 + bool 'Video mode selection support' CONFIG_VIDEO_SELECT 30.289 + if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then 30.290 + tristate 'MDA text console (dual-headed) (EXPERIMENTAL)' CONFIG_MDA_CONSOLE 30.291 + source drivers/video/Config.in 30.292 + fi 30.293 + fi 30.294 +fi 30.295 +endmenu 30.296 + 30.297 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then 30.298 + mainmenu_option next_comment 30.299 + comment 'Sound' 30.300 + 30.301 + tristate 'Sound card support' CONFIG_SOUND 30.302 + if [ "$CONFIG_SOUND" != "n" ]; then 30.303 + source drivers/sound/Config.in 30.304 + fi 30.305 + endmenu 30.306 +fi 30.307 + 30.308 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" -o "$CONFIG_XEN_USB_FRONTEND" = "y" ]; then 30.309 + if [ "$CONFIG_XEN_USB_FRONTEND" = "y" -o "$CONFIG_XEN_USB_BACKEND" = "y" ]; then 30.310 + define_bool CONFIG_USB y 30.311 + fi 30.312 + source drivers/usb/Config.in 30.313 +fi 30.314 + 30.315 +if [ "$CONFIG_XEN_PHYSDEV_ACCESS" = "y" ]; then 30.316 + source net/bluetooth/Config.in 30.317 +fi 30.318 + 30.319 +mainmenu_option next_comment 30.320 +comment 'Kernel hacking' 30.321 + 30.322 +bool 'Kernel debugging' CONFIG_DEBUG_KERNEL 30.323 +if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then 30.324 + bool ' Check for stack overflows' CONFIG_DEBUG_STACKOVERFLOW 30.325 + bool ' Debug high memory support' CONFIG_DEBUG_HIGHMEM 30.326 + bool ' Debug memory allocations' CONFIG_DEBUG_SLAB 30.327 + bool ' Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT 30.328 + bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ 30.329 + bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK 30.330 + bool ' Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE 30.331 + bool ' Load all symbols for debugging' CONFIG_KALLSYMS 30.332 + bool ' Compile the kernel with frame pointers' CONFIG_FRAME_POINTER 30.333 +fi 30.334 + 30.335 +int 'Kernel messages buffer length shift (0 = default)' CONFIG_LOG_BUF_SHIFT 0 30.336 + 30.337 +endmenu 30.338 + 30.339 +source crypto/Config.in 30.340 +source lib/Config.in
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 31.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/defconfig-xen0 Fri Jul 15 06:39:50 2005 -0700 31.3 @@ -0,0 +1,927 @@ 31.4 +# 31.5 +# Automatically generated by make menuconfig: don't edit 31.6 +# 31.7 +CONFIG_XEN=y 31.8 +CONFIG_X86=y 31.9 +CONFIG_ISA=y 31.10 +# CONFIG_SBUS is not set 31.11 +CONFIG_UID16=y 31.12 + 31.13 +# 31.14 +# Xen 31.15 +# 31.16 +CONFIG_XEN_PRIVILEGED_GUEST=y 31.17 +CONFIG_XEN_PHYSDEV_ACCESS=y 31.18 +# CONFIG_XEN_USB_BACKEND is not set 31.19 +CONFIG_XEN_SCRUB_PAGES=y 31.20 +CONFIG_XEN_NETDEV_FRONTEND=y 31.21 +CONFIG_XEN_BLKDEV_FRONTEND=y 31.22 +CONFIG_XEN_BLKDEV_GRANT=y 31.23 +# CONFIG_XEN_USB_FRONTEND is not set 31.24 +CONFIG_NO_IDLE_HZ=y 31.25 +CONFIG_FOREIGN_PAGES=y 31.26 + 31.27 +# 31.28 +# Code maturity level options 31.29 +# 31.30 +CONFIG_EXPERIMENTAL=y 31.31 + 31.32 +# 31.33 +# Loadable module support 31.34 +# 31.35 +CONFIG_MODULES=y 31.36 +CONFIG_MODVERSIONS=y 31.37 +CONFIG_KMOD=y 31.38 + 31.39 +# 31.40 +# Processor type and features 31.41 +# 31.42 +CONFIG_M686=y 31.43 +# CONFIG_MPENTIUMIII is not set 31.44 +# CONFIG_MPENTIUM4 is not set 31.45 +# CONFIG_MK7 is not set 31.46 +# CONFIG_MK8 is not set 31.47 +# CONFIG_MVIAC3_2 is not set 31.48 +CONFIG_X86_WP_WORKS_OK=y 31.49 +CONFIG_X86_INVLPG=y 31.50 +CONFIG_X86_CMPXCHG=y 31.51 +CONFIG_X86_XADD=y 31.52 +CONFIG_X86_BSWAP=y 31.53 +CONFIG_X86_POPAD_OK=y 31.54 +# CONFIG_RWSEM_GENERIC_SPINLOCK is not set 31.55 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y 31.56 +CONFIG_X86_GOOD_APIC=y 31.57 +CONFIG_X86_PGE=y 31.58 +CONFIG_X86_USE_PPRO_CHECKSUM=y 31.59 +CONFIG_X86_TSC=y 31.60 +CONFIG_X86_L1_CACHE_SHIFT=5 31.61 +CONFIG_NOHIGHMEM=y 31.62 +# CONFIG_HIGHMEM4G is not set 31.63 +CONFIG_FORCE_MAX_ZONEORDER=11 31.64 + 31.65 +# 31.66 +# General setup 31.67 +# 31.68 +CONFIG_NET=y 31.69 +CONFIG_PCI=y 31.70 +CONFIG_PCI_NAMES=y 31.71 +CONFIG_HOTPLUG=y 31.72 + 31.73 +# 31.74 +# PCMCIA/CardBus support 31.75 +# 31.76 +# CONFIG_PCMCIA is not set 31.77 + 31.78 +# 31.79 +# PCI Hotplug Support 31.80 +# 31.81 +# CONFIG_HOTPLUG_PCI is not set 31.82 +# CONFIG_HOTPLUG_PCI_COMPAQ is not set 31.83 +# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set 31.84 +# CONFIG_HOTPLUG_PCI_SHPC is not set 31.85 +# CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE is not set 31.86 +# CONFIG_HOTPLUG_PCI_PCIE is not set 31.87 +# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set 31.88 +CONFIG_SYSVIPC=y 31.89 +# CONFIG_BSD_PROCESS_ACCT is not set 31.90 +CONFIG_SYSCTL=y 31.91 +CONFIG_KCORE_ELF=y 31.92 +# CONFIG_KCORE_AOUT is not set 31.93 +CONFIG_BINFMT_AOUT=y 31.94 +CONFIG_BINFMT_ELF=y 31.95 +# CONFIG_BINFMT_MISC is not set 31.96 +# CONFIG_OOM_KILLER is not set 31.97 + 31.98 +# 31.99 +# Memory Technology Devices (MTD) 31.100 +# 31.101 +# CONFIG_MTD is not set 31.102 + 31.103 +# 31.104 +# Parallel port support 31.105 +# 31.106 +# CONFIG_PARPORT is not set 31.107 + 31.108 +# 31.109 +# Plug and Play configuration 31.110 +# 31.111 +CONFIG_PNP=y 31.112 +# CONFIG_ISAPNP is not set 31.113 + 31.114 +# 31.115 +# Block devices 31.116 +# 31.117 +# CONFIG_BLK_DEV_FD is not set 31.118 +# CONFIG_BLK_DEV_XD is not set 31.119 +# CONFIG_PARIDE is not set 31.120 +# CONFIG_BLK_CPQ_DA is not set 31.121 +# CONFIG_BLK_CPQ_CISS_DA is not set 31.122 +# CONFIG_CISS_SCSI_TAPE is not set 31.123 +# CONFIG_CISS_MONITOR_THREAD is not set 31.124 +# CONFIG_BLK_DEV_DAC960 is not set 31.125 +# CONFIG_BLK_DEV_UMEM is not set 31.126 +# CONFIG_BLK_DEV_SX8 is not set 31.127 +CONFIG_BLK_DEV_LOOP=y 31.128 +CONFIG_BLK_DEV_NBD=y 31.129 +CONFIG_BLK_DEV_RAM=y 31.130 +CONFIG_BLK_DEV_RAM_SIZE=4096 31.131 +CONFIG_BLK_DEV_INITRD=y 31.132 +# CONFIG_BLK_STATS is not set 31.133 + 31.134 +# 31.135 +# Multi-device support (RAID and LVM) 31.136 +# 31.137 +CONFIG_MD=y 31.138 +CONFIG_BLK_DEV_MD=y 31.139 +CONFIG_MD_LINEAR=y 31.140 +# CONFIG_MD_RAID0 is not set 31.141 +CONFIG_MD_RAID1=y 31.142 +# CONFIG_MD_RAID5 is not set 31.143 +# CONFIG_MD_MULTIPATH is not set 31.144 +CONFIG_BLK_DEV_LVM=y 31.145 + 31.146 +# 31.147 +# Networking options 31.148 +# 31.149 +CONFIG_PACKET=y 31.150 +CONFIG_PACKET_MMAP=y 31.151 +# CONFIG_NETLINK_DEV is not set 31.152 +CONFIG_NETFILTER=y 31.153 +# CONFIG_NETFILTER_DEBUG is not set 31.154 +CONFIG_FILTER=y 31.155 +CONFIG_UNIX=y 31.156 +CONFIG_INET=y 31.157 +# CONFIG_IP_MULTICAST is not set 31.158 +# CONFIG_IP_ADVANCED_ROUTER is not set 31.159 +CONFIG_IP_PNP=y 31.160 +CONFIG_IP_PNP_DHCP=y 31.161 +# CONFIG_IP_PNP_BOOTP is not set 31.162 +# CONFIG_IP_PNP_RARP is not set 31.163 +# CONFIG_NET_IPIP is not set 31.164 +# CONFIG_NET_IPGRE is not set 31.165 +# CONFIG_ARPD is not set 31.166 +# CONFIG_INET_ECN is not set 31.167 +# CONFIG_SYN_COOKIES is not set 31.168 + 31.169 +# 31.170 +# IP: Netfilter Configuration 31.171 +# 31.172 +CONFIG_IP_NF_CONNTRACK=m 31.173 +CONFIG_IP_NF_FTP=m 31.174 +# CONFIG_IP_NF_AMANDA is not set 31.175 +CONFIG_IP_NF_TFTP=m 31.176 +CONFIG_IP_NF_IRC=m 31.177 +# CONFIG_IP_NF_QUEUE is not set 31.178 +CONFIG_IP_NF_IPTABLES=y 31.179 +# CONFIG_IP_NF_MATCH_LIMIT is not set 31.180 +# CONFIG_IP_NF_MATCH_MAC is not set 31.181 +# CONFIG_IP_NF_MATCH_PKTTYPE is not set 31.182 +# CONFIG_IP_NF_MATCH_MARK is not set 31.183 +# CONFIG_IP_NF_MATCH_MULTIPORT is not set 31.184 +# CONFIG_IP_NF_MATCH_TOS is not set 31.185 +# CONFIG_IP_NF_MATCH_RECENT is not set 31.186 +# CONFIG_IP_NF_MATCH_ECN is not set 31.187 +# CONFIG_IP_NF_MATCH_DSCP is not set 31.188 +# CONFIG_IP_NF_MATCH_AH_ESP is not set 31.189 +# CONFIG_IP_NF_MATCH_LENGTH is not set 31.190 +# CONFIG_IP_NF_MATCH_TTL is not set 31.191 +# CONFIG_IP_NF_MATCH_TCPMSS is not set 31.192 +# CONFIG_IP_NF_MATCH_HELPER is not set 31.193 +CONFIG_IP_NF_MATCH_STATE=m 31.194 +CONFIG_IP_NF_MATCH_CONNTRACK=m 31.195 +# CONFIG_IP_NF_MATCH_UNCLEAN is not set 31.196 +# CONFIG_IP_NF_MATCH_OWNER is not set 31.197 +CONFIG_IP_NF_MATCH_PHYSDEV=y 31.198 +CONFIG_IP_NF_FILTER=y 31.199 +CONFIG_IP_NF_TARGET_REJECT=y 31.200 +# CONFIG_IP_NF_TARGET_MIRROR is not set 31.201 +CONFIG_IP_NF_NAT=m 31.202 +CONFIG_IP_NF_NAT_NEEDED=y 31.203 +CONFIG_IP_NF_TARGET_MASQUERADE=m 31.204 +CONFIG_IP_NF_TARGET_REDIRECT=m 31.205 +# CONFIG_IP_NF_NAT_SNMP_BASIC is not set 31.206 +CONFIG_IP_NF_NAT_IRC=m 31.207 +CONFIG_IP_NF_NAT_FTP=m 31.208 +CONFIG_IP_NF_NAT_TFTP=m 31.209 +# CONFIG_IP_NF_MANGLE is not set 31.210 +CONFIG_IP_NF_TARGET_LOG=y 31.211 +CONFIG_IP_NF_TARGET_ULOG=y 31.212 +# CONFIG_IP_NF_TARGET_TCPMSS is not set 31.213 +# CONFIG_IP_NF_ARPTABLES is not set 31.214 + 31.215 +# 31.216 +# IP: Virtual Server Configuration 31.217 +# 31.218 +# CONFIG_IP_VS is not set 31.219 +# CONFIG_IPV6 is not set 31.220 +# CONFIG_KHTTPD is not set 31.221 + 31.222 +# 31.223 +# SCTP Configuration (EXPERIMENTAL) 31.224 +# 31.225 +# CONFIG_IP_SCTP is not set 31.226 +# CONFIG_ATM is not set 31.227 +CONFIG_VLAN_8021Q=y 31.228 +# CONFIG_IPX is not set 31.229 +# CONFIG_ATALK is not set 31.230 +# CONFIG_DECNET is not set 31.231 +CONFIG_BRIDGE=y 31.232 +CONFIG_BRIDGE_NF_EBTABLES=m 31.233 +CONFIG_BRIDGE_EBT_T_FILTER=m 31.234 +CONFIG_BRIDGE_EBT_T_NAT=m 31.235 +CONFIG_BRIDGE_EBT_BROUTE=m 31.236 +CONFIG_BRIDGE_EBT_LOG=m 31.237 +CONFIG_BRIDGE_EBT_IPF=m 31.238 +CONFIG_BRIDGE_EBT_ARPF=m 31.239 +CONFIG_BRIDGE_EBT_AMONG=m 31.240 +CONFIG_BRIDGE_EBT_LIMIT=m 31.241 +CONFIG_BRIDGE_EBT_VLANF=m 31.242 +CONFIG_BRIDGE_EBT_802_3=m 31.243 +CONFIG_BRIDGE_EBT_PKTTYPE=m 31.244 +CONFIG_BRIDGE_EBT_STP=m 31.245 +CONFIG_BRIDGE_EBT_MARKF=m 31.246 +CONFIG_BRIDGE_EBT_ARPREPLY=m 31.247 +CONFIG_BRIDGE_EBT_SNAT=m 31.248 +CONFIG_BRIDGE_EBT_DNAT=m 31.249 +CONFIG_BRIDGE_EBT_REDIRECT=m 31.250 +CONFIG_BRIDGE_EBT_MARK_T=m 31.251 +# CONFIG_X25 is not set 31.252 +# CONFIG_LAPB is not set 31.253 +# CONFIG_LLC is not set 31.254 +# CONFIG_NET_DIVERT is not set 31.255 +# CONFIG_ECONET is not set 31.256 +# CONFIG_WAN_ROUTER is not set 31.257 +# CONFIG_NET_FASTROUTE is not set 31.258 +# CONFIG_NET_HW_FLOWCONTROL is not set 31.259 + 31.260 +# 31.261 +# QoS and/or fair queueing 31.262 +# 31.263 +# CONFIG_NET_SCHED is not set 31.264 + 31.265 +# 31.266 +# Network testing 31.267 +# 31.268 +# CONFIG_NET_PKTGEN is not set 31.269 + 31.270 +# 31.271 +# ATA/IDE/MFM/RLL support 31.272 +# 31.273 +CONFIG_IDE=y 31.274 + 31.275 +# 31.276 +# IDE, ATA and ATAPI Block devices 31.277 +# 31.278 +CONFIG_BLK_DEV_IDE=y 31.279 +# CONFIG_BLK_DEV_HD_IDE is not set 31.280 +# CONFIG_BLK_DEV_HD is not set 31.281 +# CONFIG_BLK_DEV_IDE_SATA is not set 31.282 +CONFIG_BLK_DEV_IDEDISK=y 31.283 +CONFIG_IDEDISK_MULTI_MODE=y 31.284 +CONFIG_IDEDISK_STROKE=y 31.285 +# CONFIG_BLK_DEV_IDECS is not set 31.286 +# CONFIG_BLK_DEV_DELKIN is not set 31.287 +CONFIG_BLK_DEV_IDECD=y 31.288 +CONFIG_BLK_DEV_IDETAPE=y 31.289 +CONFIG_BLK_DEV_IDEFLOPPY=y 31.290 +CONFIG_BLK_DEV_IDESCSI=y 31.291 +CONFIG_IDE_TASK_IOCTL=y 31.292 +CONFIG_BLK_DEV_CMD640=y 31.293 +CONFIG_BLK_DEV_CMD640_ENHANCED=y 31.294 +# CONFIG_BLK_DEV_ISAPNP is not set 31.295 +CONFIG_BLK_DEV_IDEPCI=y 31.296 +CONFIG_BLK_DEV_GENERIC=y 31.297 +CONFIG_IDEPCI_SHARE_IRQ=y 31.298 +CONFIG_BLK_DEV_IDEDMA_PCI=y 31.299 +CONFIG_BLK_DEV_OFFBOARD=y 31.300 +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set 31.301 +CONFIG_IDEDMA_PCI_AUTO=y 31.302 +# CONFIG_IDEDMA_ONLYDISK is not set 31.303 +CONFIG_BLK_DEV_IDEDMA=y 31.304 +# CONFIG_IDEDMA_PCI_WIP is not set 31.305 +CONFIG_BLK_DEV_ADMA100=y 31.306 +CONFIG_BLK_DEV_AEC62XX=y 31.307 +CONFIG_BLK_DEV_ALI15X3=y 31.308 +CONFIG_WDC_ALI15X3=y 31.309 +CONFIG_BLK_DEV_AMD74XX=y 31.310 +CONFIG_AMD74XX_OVERRIDE=y 31.311 +# CONFIG_BLK_DEV_ATIIXP is not set 31.312 +CONFIG_BLK_DEV_CMD64X=y 31.313 +CONFIG_BLK_DEV_TRIFLEX=y 31.314 +CONFIG_BLK_DEV_CY82C693=y 31.315 +CONFIG_BLK_DEV_CS5530=y 31.316 +CONFIG_BLK_DEV_HPT34X=y 31.317 +# CONFIG_HPT34X_AUTODMA is not set 31.318 +CONFIG_BLK_DEV_HPT366=y 31.319 +CONFIG_BLK_DEV_PIIX=y 31.320 +CONFIG_BLK_DEV_NS87415=y 31.321 +# CONFIG_BLK_DEV_OPTI621 is not set 31.322 +CONFIG_BLK_DEV_PDC202XX_OLD=y 31.323 +CONFIG_PDC202XX_BURST=y 31.324 +CONFIG_BLK_DEV_PDC202XX_NEW=y 31.325 +CONFIG_PDC202XX_FORCE=y 31.326 +CONFIG_BLK_DEV_RZ1000=y 31.327 +CONFIG_BLK_DEV_SC1200=y 31.328 +CONFIG_BLK_DEV_SVWKS=y 31.329 +CONFIG_BLK_DEV_SIIMAGE=y 31.330 +CONFIG_BLK_DEV_SIS5513=y 31.331 +CONFIG_BLK_DEV_SLC90E66=y 31.332 +CONFIG_BLK_DEV_TRM290=y 31.333 +CONFIG_BLK_DEV_VIA82CXXX=y 31.334 +CONFIG_IDE_CHIPSETS=y 31.335 +# CONFIG_BLK_DEV_4DRIVES is not set 31.336 +# CONFIG_BLK_DEV_ALI14XX is not set 31.337 +# CONFIG_BLK_DEV_DTC2278 is not set 31.338 +# CONFIG_BLK_DEV_HT6560B is not set 31.339 +# CONFIG_BLK_DEV_PDC4030 is not set 31.340 +# CONFIG_BLK_DEV_QD65XX is not set 31.341 +# CONFIG_BLK_DEV_UMC8672 is not set 31.342 +CONFIG_IDEDMA_AUTO=y 31.343 +# CONFIG_IDEDMA_IVB is not set 31.344 +# CONFIG_DMA_NONPCI is not set 31.345 +CONFIG_BLK_DEV_PDC202XX=y 31.346 +# CONFIG_BLK_DEV_ATARAID is not set 31.347 +# CONFIG_BLK_DEV_ATARAID_PDC is not set 31.348 +# CONFIG_BLK_DEV_ATARAID_HPT is not set 31.349 +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set 31.350 +# CONFIG_BLK_DEV_ATARAID_SII is not set 31.351 + 31.352 +# 31.353 +# SCSI support 31.354 +# 31.355 +CONFIG_SCSI=y 31.356 +CONFIG_BLK_DEV_SD=y 31.357 +CONFIG_SD_EXTRA_DEVS=40 31.358 +# CONFIG_CHR_DEV_ST is not set 31.359 +# CONFIG_CHR_DEV_OSST is not set 31.360 +# CONFIG_BLK_DEV_SR is not set 31.361 +CONFIG_CHR_DEV_SG=y 31.362 +# CONFIG_SCSI_DEBUG_QUEUES is not set 31.363 +# CONFIG_SCSI_MULTI_LUN is not set 31.364 +# CONFIG_SCSI_CONSTANTS is not set 31.365 +# CONFIG_SCSI_LOGGING is not set 31.366 + 31.367 +# 31.368 +# SCSI low-level drivers 31.369 +# 31.370 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 31.371 +# CONFIG_SCSI_7000FASST is not set 31.372 +# CONFIG_SCSI_ACARD is not set 31.373 +# CONFIG_SCSI_AHA152X is not set 31.374 +# CONFIG_SCSI_AHA1542 is not set 31.375 +# CONFIG_SCSI_AHA1740 is not set 31.376 +CONFIG_SCSI_AACRAID=y 31.377 +CONFIG_SCSI_AIC7XXX=y 31.378 +CONFIG_AIC7XXX_CMDS_PER_DEVICE=32 31.379 +CONFIG_AIC7XXX_RESET_DELAY_MS=15000 31.380 +# CONFIG_AIC7XXX_PROBE_EISA_VL is not set 31.381 +# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set 31.382 +# CONFIG_AIC7XXX_DEBUG_ENABLE is not set 31.383 +CONFIG_AIC7XXX_DEBUG_MASK=0 31.384 +# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set 31.385 +CONFIG_SCSI_AIC79XX=y 31.386 +CONFIG_AIC79XX_CMDS_PER_DEVICE=32 31.387 +CONFIG_AIC79XX_RESET_DELAY_MS=15000 31.388 +# CONFIG_AIC79XX_BUILD_FIRMWARE is not set 31.389 +# CONFIG_AIC79XX_ENABLE_RD_STRM is not set 31.390 +# CONFIG_AIC79XX_DEBUG_ENABLE is not set 31.391 +CONFIG_AIC79XX_DEBUG_MASK=0 31.392 +# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set 31.393 +# CONFIG_SCSI_DPT_I2O is not set 31.394 +# CONFIG_SCSI_ADVANSYS is not set 31.395 +# CONFIG_SCSI_IN2000 is not set 31.396 +# CONFIG_SCSI_AM53C974 is not set 31.397 +CONFIG_SCSI_MEGARAID=y 31.398 +# CONFIG_SCSI_MEGARAID2 is not set 31.399 +CONFIG_SCSI_SATA=y 31.400 +# CONFIG_SCSI_SATA_AHCI is not set 31.401 +# CONFIG_SCSI_SATA_SVW is not set 31.402 +CONFIG_SCSI_ATA_PIIX=y 31.403 +# CONFIG_SCSI_SATA_NV is not set 31.404 +# CONFIG_SCSI_SATA_QSTOR is not set 31.405 +CONFIG_SCSI_SATA_PROMISE=y 31.406 +CONFIG_SCSI_SATA_SX4=y 31.407 +CONFIG_SCSI_SATA_SIL=y 31.408 +CONFIG_SCSI_SATA_SIS=y 31.409 +# CONFIG_SCSI_SATA_ULI is not set 31.410 +CONFIG_SCSI_SATA_VIA=y 31.411 +CONFIG_SCSI_SATA_VITESSE=y 31.412 +CONFIG_SCSI_BUSLOGIC=y 31.413 +# CONFIG_SCSI_OMIT_FLASHPOINT is not set 31.414 +# CONFIG_SCSI_CPQFCTS is not set 31.415 +# CONFIG_SCSI_DMX3191D is not set 31.416 +# CONFIG_SCSI_DTC3280 is not set 31.417 +# CONFIG_SCSI_EATA is not set 31.418 +# CONFIG_SCSI_EATA_DMA is not set 31.419 +# CONFIG_SCSI_EATA_PIO is not set 31.420 +# CONFIG_SCSI_FUTURE_DOMAIN is not set 31.421 +# CONFIG_SCSI_GDTH is not set 31.422 +# CONFIG_SCSI_GENERIC_NCR5380 is not set 31.423 +# CONFIG_SCSI_IPS is not set 31.424 +# CONFIG_SCSI_INITIO is not set 31.425 +# CONFIG_SCSI_INIA100 is not set 31.426 +# CONFIG_SCSI_NCR53C406A is not set 31.427 +# CONFIG_SCSI_NCR53C7xx is not set 31.428 +CONFIG_SCSI_SYM53C8XX_2=y 31.429 +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 31.430 +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 31.431 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 31.432 +# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 31.433 +# CONFIG_SCSI_PAS16 is not set 31.434 +# CONFIG_SCSI_PCI2000 is not set 31.435 +# CONFIG_SCSI_PCI2220I is not set 31.436 +# CONFIG_SCSI_PSI240I is not set 31.437 +# CONFIG_SCSI_QLOGIC_FAS is not set 31.438 +# CONFIG_SCSI_QLOGIC_ISP is not set 31.439 +# CONFIG_SCSI_QLOGIC_FC is not set 31.440 +# CONFIG_SCSI_QLOGIC_1280 is not set 31.441 +# CONFIG_SCSI_SEAGATE is not set 31.442 +# CONFIG_SCSI_SIM710 is not set 31.443 +# CONFIG_SCSI_SYM53C416 is not set 31.444 +# CONFIG_SCSI_DC390T is not set 31.445 +# CONFIG_SCSI_T128 is not set 31.446 +# CONFIG_SCSI_U14_34F is not set 31.447 +# CONFIG_SCSI_ULTRASTOR is not set 31.448 +# CONFIG_SCSI_NSP32 is not set 31.449 +# CONFIG_SCSI_DEBUG is not set 31.450 + 31.451 +# 31.452 +# Fusion MPT device support 31.453 +# 31.454 +# CONFIG_FUSION is not set 31.455 +# CONFIG_FUSION_BOOT is not set 31.456 +# CONFIG_FUSION_ISENSE is not set 31.457 +# CONFIG_FUSION_CTL is not set 31.458 +# CONFIG_FUSION_LAN is not set 31.459 + 31.460 +# 31.461 +# IEEE 1394 (FireWire) support (EXPERIMENTAL) 31.462 +# 31.463 +# CONFIG_IEEE1394 is not set 31.464 + 31.465 +# 31.466 +# I2O device support 31.467 +# 31.468 +# CONFIG_I2O is not set 31.469 +# CONFIG_I2O_PCI is not set 31.470 +# CONFIG_I2O_BLOCK is not set 31.471 +# CONFIG_I2O_LAN is not set 31.472 +# CONFIG_I2O_SCSI is not set 31.473 +# CONFIG_I2O_PROC is not set 31.474 + 31.475 +# 31.476 +# Network device support 31.477 +# 31.478 +CONFIG_NETDEVICES=y 31.479 + 31.480 +# 31.481 +# ARCnet devices 31.482 +# 31.483 +# CONFIG_ARCNET is not set 31.484 +# CONFIG_DUMMY is not set 31.485 +# CONFIG_BONDING is not set 31.486 +# CONFIG_EQUALIZER is not set 31.487 +# CONFIG_TUN is not set 31.488 +# CONFIG_ETHERTAP is not set 31.489 + 31.490 +# 31.491 +# Ethernet (10 or 100Mbit) 31.492 +# 31.493 +CONFIG_NET_ETHERNET=y 31.494 +# CONFIG_SUNLANCE is not set 31.495 +# CONFIG_HAPPYMEAL is not set 31.496 +# CONFIG_SUNBMAC is not set 31.497 +# CONFIG_SUNQE is not set 31.498 +# CONFIG_SUNGEM is not set 31.499 +CONFIG_NET_VENDOR_3COM=y 31.500 +# CONFIG_EL1 is not set 31.501 +# CONFIG_EL2 is not set 31.502 +# CONFIG_ELPLUS is not set 31.503 +# CONFIG_EL16 is not set 31.504 +# CONFIG_EL3 is not set 31.505 +# CONFIG_3C515 is not set 31.506 +# CONFIG_ELMC is not set 31.507 +# CONFIG_ELMC_II is not set 31.508 +CONFIG_VORTEX=y 31.509 +# CONFIG_TYPHOON is not set 31.510 +# CONFIG_LANCE is not set 31.511 +# CONFIG_NET_VENDOR_SMC is not set 31.512 +# CONFIG_NET_VENDOR_RACAL is not set 31.513 +# CONFIG_AT1700 is not set 31.514 +# CONFIG_DEPCA is not set 31.515 +# CONFIG_HP100 is not set 31.516 +# CONFIG_NET_ISA is not set 31.517 +CONFIG_NET_PCI=y 31.518 +CONFIG_PCNET32=y 31.519 +# CONFIG_AMD8111_ETH is not set 31.520 +# CONFIG_ADAPTEC_STARFIRE is not set 31.521 +# CONFIG_AC3200 is not set 31.522 +# CONFIG_APRICOT is not set 31.523 +# CONFIG_B44 is not set 31.524 +# CONFIG_CS89x0 is not set 31.525 +# CONFIG_TULIP is not set 31.526 +# CONFIG_DE4X5 is not set 31.527 +# CONFIG_DGRS is not set 31.528 +# CONFIG_DM9102 is not set 31.529 +# CONFIG_EEPRO100 is not set 31.530 +# CONFIG_EEPRO100_PIO is not set 31.531 +CONFIG_E100=y 31.532 +# CONFIG_LNE390 is not set 31.533 +# CONFIG_FEALNX is not set 31.534 +# CONFIG_NATSEMI is not set 31.535 +CONFIG_NE2K_PCI=y 31.536 +# CONFIG_FORCEDETH is not set 31.537 +# CONFIG_NE3210 is not set 31.538 +# CONFIG_ES3210 is not set 31.539 +# CONFIG_8139CP is not set 31.540 +# CONFIG_8139TOO is not set 31.541 +# CONFIG_8139TOO_PIO is not set 31.542 +# CONFIG_8139TOO_TUNE_TWISTER is not set 31.543 +# CONFIG_8139TOO_8129 is not set 31.544 +# CONFIG_8139_OLD_RX_RESET is not set 31.545 +# CONFIG_SIS900 is not set 31.546 +# CONFIG_EPIC100 is not set 31.547 +# CONFIG_SUNDANCE is not set 31.548 +# CONFIG_SUNDANCE_MMIO is not set 31.549 +# CONFIG_TLAN is not set 31.550 +# CONFIG_VIA_RHINE is not set 31.551 +# CONFIG_VIA_RHINE_MMIO is not set 31.552 +# CONFIG_WINBOND_840 is not set 31.553 +# CONFIG_NET_POCKET is not set 31.554 + 31.555 +# 31.556 +# Ethernet (1000 Mbit) 31.557 +# 31.558 +# CONFIG_ACENIC is not set 31.559 +# CONFIG_DL2K is not set 31.560 +CONFIG_E1000=y 31.561 +# CONFIG_E1000_NAPI is not set 31.562 +# CONFIG_MYRI_SBUS is not set 31.563 +# CONFIG_NS83820 is not set 31.564 +# CONFIG_HAMACHI is not set 31.565 +# CONFIG_YELLOWFIN is not set 31.566 +# CONFIG_R8169 is not set 31.567 +# CONFIG_SK98LIN is not set 31.568 +CONFIG_TIGON3=y 31.569 +# CONFIG_FDDI is not set 31.570 +# CONFIG_HIPPI is not set 31.571 +# CONFIG_PLIP is not set 31.572 +# CONFIG_PPP is not set 31.573 +# CONFIG_SLIP is not set 31.574 + 31.575 +# 31.576 +# Wireless LAN (non-hamradio) 31.577 +# 31.578 +# CONFIG_NET_RADIO is not set 31.579 + 31.580 +# 31.581 +# Token Ring devices 31.582 +# 31.583 +# CONFIG_TR is not set 31.584 +# CONFIG_NET_FC is not set 31.585 +# CONFIG_RCPCI is not set 31.586 +# CONFIG_SHAPER is not set 31.587 + 31.588 +# 31.589 +# Wan interfaces 31.590 +# 31.591 +# CONFIG_WAN is not set 31.592 + 31.593 +# 31.594 +# Amateur Radio support 31.595 +# 31.596 +# CONFIG_HAMRADIO is not set 31.597 + 31.598 +# 31.599 +# IrDA (infrared) support 31.600 +# 31.601 +# CONFIG_IRDA is not set 31.602 + 31.603 +# 31.604 +# ISDN subsystem 31.605 +# 31.606 +# CONFIG_ISDN is not set 31.607 + 31.608 +# 31.609 +# Old CD-ROM drivers (not SCSI, not IDE) 31.610 +# 31.611 +# CONFIG_CD_NO_IDESCSI is not set 31.612 + 31.613 +# 31.614 +# Input core support 31.615 +# 31.616 +# CONFIG_INPUT is not set 31.617 +# CONFIG_INPUT_KEYBDEV is not set 31.618 +# CONFIG_INPUT_MOUSEDEV is not set 31.619 +# CONFIG_INPUT_JOYDEV is not set 31.620 +# CONFIG_INPUT_EVDEV is not set 31.621 +# CONFIG_INPUT_UINPUT is not set 31.622 + 31.623 +# 31.624 +# Character devices 31.625 +# 31.626 +CONFIG_VT=y 31.627 +CONFIG_VT_CONSOLE=y 31.628 +# CONFIG_SERIAL is not set 31.629 +# CONFIG_SERIAL_EXTENDED is not set 31.630 +# CONFIG_SERIAL_NONSTANDARD is not set 31.631 +CONFIG_UNIX98_PTYS=y 31.632 +CONFIG_UNIX98_PTY_COUNT=256 31.633 + 31.634 +# 31.635 +# I2C support 31.636 +# 31.637 +# CONFIG_I2C is not set 31.638 + 31.639 +# 31.640 +# Mice 31.641 +# 31.642 +# CONFIG_BUSMOUSE is not set 31.643 +CONFIG_MOUSE=y 31.644 +CONFIG_PSMOUSE=y 31.645 +# CONFIG_82C710_MOUSE is not set 31.646 +# CONFIG_PC110_PAD is not set 31.647 +# CONFIG_MK712_MOUSE is not set 31.648 + 31.649 +# 31.650 +# Joysticks 31.651 +# 31.652 +# CONFIG_INPUT_GAMEPORT is not set 31.653 +# CONFIG_QIC02_TAPE is not set 31.654 +# CONFIG_IPMI_HANDLER is not set 31.655 +# CONFIG_IPMI_PANIC_EVENT is not set 31.656 +# CONFIG_IPMI_DEVICE_INTERFACE is not set 31.657 +# CONFIG_IPMI_KCS is not set 31.658 +# CONFIG_IPMI_WATCHDOG is not set 31.659 + 31.660 +# 31.661 +# Watchdog Cards 31.662 +# 31.663 +# CONFIG_WATCHDOG is not set 31.664 +# CONFIG_SCx200 is not set 31.665 +# CONFIG_SCx200_GPIO is not set 31.666 +# CONFIG_AMD_RNG is not set 31.667 +# CONFIG_INTEL_RNG is not set 31.668 +# CONFIG_HW_RANDOM is not set 31.669 +# CONFIG_AMD_PM768 is not set 31.670 +# CONFIG_NVRAM is not set 31.671 +# CONFIG_RTC is not set 31.672 +# CONFIG_DTLK is not set 31.673 +# CONFIG_R3964 is not set 31.674 +# CONFIG_APPLICOM is not set 31.675 +# CONFIG_SONYPI is not set 31.676 + 31.677 +# 31.678 +# Ftape, the floppy tape device driver 31.679 +# 31.680 +# CONFIG_FTAPE is not set 31.681 +# CONFIG_AGP is not set 31.682 + 31.683 +# 31.684 +# Direct Rendering Manager (XFree86 DRI support) 31.685 +# 31.686 +# CONFIG_DRM is not set 31.687 +# CONFIG_MWAVE is not set 31.688 +# CONFIG_OBMOUSE is not set 31.689 + 31.690 +# 31.691 +# Multimedia devices 31.692 +# 31.693 +# CONFIG_VIDEO_DEV is not set 31.694 + 31.695 +# 31.696 +# File systems 31.697 +# 31.698 +# CONFIG_QUOTA is not set 31.699 +# CONFIG_QFMT_V2 is not set 31.700 +CONFIG_AUTOFS_FS=y 31.701 +CONFIG_AUTOFS4_FS=y 31.702 +# CONFIG_REISERFS_FS is not set 31.703 +# CONFIG_REISERFS_CHECK is not set 31.704 +# CONFIG_REISERFS_PROC_INFO is not set 31.705 +# CONFIG_ADFS_FS is not set 31.706 +# CONFIG_ADFS_FS_RW is not set 31.707 +# CONFIG_AFFS_FS is not set 31.708 +# CONFIG_HFS_FS is not set 31.709 +# CONFIG_HFSPLUS_FS is not set 31.710 +# CONFIG_BEFS_FS is not set 31.711 +# CONFIG_BEFS_DEBUG is not set 31.712 +# CONFIG_BFS_FS is not set 31.713 +CONFIG_EXT3_FS=y 31.714 +CONFIG_JBD=y 31.715 +# CONFIG_JBD_DEBUG is not set 31.716 +CONFIG_FAT_FS=y 31.717 +CONFIG_MSDOS_FS=y 31.718 +CONFIG_UMSDOS_FS=y 31.719 +CONFIG_VFAT_FS=y 31.720 +# CONFIG_EFS_FS is not set 31.721 +# CONFIG_JFFS_FS is not set 31.722 +# CONFIG_JFFS2_FS is not set 31.723 +# CONFIG_CRAMFS is not set 31.724 +CONFIG_TMPFS=y 31.725 +CONFIG_RAMFS=y 31.726 +CONFIG_ISO9660_FS=y 31.727 +CONFIG_JOLIET=y 31.728 +CONFIG_ZISOFS=y 31.729 +# CONFIG_JFS_FS is not set 31.730 +# CONFIG_JFS_DEBUG is not set 31.731 +# CONFIG_JFS_STATISTICS is not set 31.732 +# CONFIG_MINIX_FS is not set 31.733 +# CONFIG_VXFS_FS is not set 31.734 +# CONFIG_NTFS_FS is not set 31.735 +# CONFIG_NTFS_RW is not set 31.736 +# CONFIG_HPFS_FS is not set 31.737 +CONFIG_PROC_FS=y 31.738 +# CONFIG_DEVFS_FS is not set 31.739 +# CONFIG_DEVFS_MOUNT is not set 31.740 +# CONFIG_DEVFS_DEBUG is not set 31.741 +CONFIG_DEVPTS_FS=y 31.742 +# CONFIG_QNX4FS_FS is not set 31.743 +# CONFIG_QNX4FS_RW is not set 31.744 +# CONFIG_ROMFS_FS is not set 31.745 +CONFIG_EXT2_FS=y 31.746 +# CONFIG_SYSV_FS is not set 31.747 +# CONFIG_UDF_FS is not set 31.748 +# CONFIG_UDF_RW is not set 31.749 +# CONFIG_UFS_FS is not set 31.750 +# CONFIG_UFS_FS_WRITE is not set 31.751 +# CONFIG_XFS_FS is not set 31.752 +# CONFIG_XFS_QUOTA is not set 31.753 +# CONFIG_XFS_RT is not set 31.754 +# CONFIG_XFS_TRACE is not set 31.755 +# CONFIG_XFS_DEBUG is not set 31.756 + 31.757 +# 31.758 +# Network File Systems 31.759 +# 31.760 +# CONFIG_CODA_FS is not set 31.761 +# CONFIG_INTERMEZZO_FS is not set 31.762 +CONFIG_NFS_FS=y 31.763 +CONFIG_NFS_V3=y 31.764 +# CONFIG_NFS_DIRECTIO is not set 31.765 +CONFIG_ROOT_NFS=y 31.766 +CONFIG_NFSD=y 31.767 +CONFIG_NFSD_V3=y 31.768 +# CONFIG_NFSD_TCP is not set 31.769 +CONFIG_SUNRPC=y 31.770 +CONFIG_LOCKD=y 31.771 +CONFIG_LOCKD_V4=y 31.772 +# CONFIG_SMB_FS is not set 31.773 +# CONFIG_NCP_FS is not set 31.774 +# CONFIG_NCPFS_PACKET_SIGNING is not set 31.775 +# CONFIG_NCPFS_IOCTL_LOCKING is not set 31.776 +# CONFIG_NCPFS_STRONG is not set 31.777 +# CONFIG_NCPFS_NFS_NS is not set 31.778 +# CONFIG_NCPFS_OS2_NS is not set 31.779 +# CONFIG_NCPFS_SMALLDOS is not set 31.780 +# CONFIG_NCPFS_NLS is not set 31.781 +# CONFIG_NCPFS_EXTRAS is not set 31.782 +CONFIG_ZISOFS_FS=y 31.783 + 31.784 +# 31.785 +# Partition Types 31.786 +# 31.787 +CONFIG_PARTITION_ADVANCED=y 31.788 +# CONFIG_ACORN_PARTITION is not set 31.789 +# CONFIG_OSF_PARTITION is not set 31.790 +# CONFIG_AMIGA_PARTITION is not set 31.791 +# CONFIG_ATARI_PARTITION is not set 31.792 +# CONFIG_MAC_PARTITION is not set 31.793 +CONFIG_MSDOS_PARTITION=y 31.794 +# CONFIG_BSD_DISKLABEL is not set 31.795 +# CONFIG_MINIX_SUBPARTITION is not set 31.796 +# CONFIG_SOLARIS_X86_PARTITION is not set 31.797 +# CONFIG_UNIXWARE_DISKLABEL is not set 31.798 +# CONFIG_LDM_PARTITION is not set 31.799 +# CONFIG_SGI_PARTITION is not set 31.800 +# CONFIG_ULTRIX_PARTITION is not set 31.801 +# CONFIG_SUN_PARTITION is not set 31.802 +# CONFIG_EFI_PARTITION is not set 31.803 +# CONFIG_SMB_NLS is not set 31.804 +CONFIG_NLS=y 31.805 + 31.806 +# 31.807 +# Native Language Support 31.808 +# 31.809 +CONFIG_NLS_DEFAULT="iso8559-1" 31.810 +# CONFIG_NLS_CODEPAGE_437 is not set 31.811 +# CONFIG_NLS_CODEPAGE_737 is not set 31.812 +# CONFIG_NLS_CODEPAGE_775 is not set 31.813 +# CONFIG_NLS_CODEPAGE_850 is not set 31.814 +# CONFIG_NLS_CODEPAGE_852 is not set 31.815 +# CONFIG_NLS_CODEPAGE_855 is not set 31.816 +# CONFIG_NLS_CODEPAGE_857 is not set 31.817 +# CONFIG_NLS_CODEPAGE_860 is not set 31.818 +# CONFIG_NLS_CODEPAGE_861 is not set 31.819 +# CONFIG_NLS_CODEPAGE_862 is not set 31.820 +# CONFIG_NLS_CODEPAGE_863 is not set 31.821 +# CONFIG_NLS_CODEPAGE_864 is not set 31.822 +# CONFIG_NLS_CODEPAGE_865 is not set 31.823 +# CONFIG_NLS_CODEPAGE_866 is not set 31.824 +# CONFIG_NLS_CODEPAGE_869 is not set 31.825 +# CONFIG_NLS_CODEPAGE_936 is not set 31.826 +# CONFIG_NLS_CODEPAGE_950 is not set 31.827 +# CONFIG_NLS_CODEPAGE_932 is not set 31.828 +# CONFIG_NLS_CODEPAGE_949 is not set 31.829 +# CONFIG_NLS_CODEPAGE_874 is not set 31.830 +# CONFIG_NLS_ISO8859_8 is not set 31.831 +# CONFIG_NLS_CODEPAGE_1250 is not set 31.832 +# CONFIG_NLS_CODEPAGE_1251 is not set 31.833 +CONFIG_NLS_ISO8859_1=y 31.834 +# CONFIG_NLS_ISO8859_2 is not set 31.835 +# CONFIG_NLS_ISO8859_3 is not set 31.836 +# CONFIG_NLS_ISO8859_4 is not set 31.837 +# CONFIG_NLS_ISO8859_5 is not set 31.838 +# CONFIG_NLS_ISO8859_6 is not set 31.839 +# CONFIG_NLS_ISO8859_7 is not set 31.840 +# CONFIG_NLS_ISO8859_9 is not set 31.841 +# CONFIG_NLS_ISO8859_13 is not set 31.842 +# CONFIG_NLS_ISO8859_14 is not set 31.843 +# CONFIG_NLS_ISO8859_15 is not set 31.844 +# CONFIG_NLS_KOI8_R is not set 31.845 +# CONFIG_NLS_KOI8_U is not set 31.846 +# CONFIG_NLS_UTF8 is not set 31.847 + 31.848 +# 31.849 +# Console drivers 31.850 +# 31.851 +CONFIG_XEN_CONSOLE=y 31.852 +CONFIG_VGA_CONSOLE=y 31.853 +CONFIG_DUMMY_CONSOLE=y 31.854 +# CONFIG_VIDEO_SELECT is not set 31.855 +# CONFIG_MDA_CONSOLE is not set 31.856 + 31.857 +# 31.858 +# Frame-buffer support 31.859 +# 31.860 +# CONFIG_FB is not set 31.861 + 31.862 +# 31.863 +# Sound 31.864 +# 31.865 +# CONFIG_SOUND is not set 31.866 + 31.867 +# 31.868 +# USB support 31.869 +# 31.870 +# CONFIG_USB is not set 31.871 + 31.872 +# 31.873 +# Support for USB gadgets 31.874 +# 31.875 +# CONFIG_USB_GADGET is not set 31.876 + 31.877 +# 31.878 +# Bluetooth support 31.879 +# 31.880 +# CONFIG_BLUEZ is not set 31.881 + 31.882 +# 31.883 +# Kernel hacking 31.884 +# 31.885 +CONFIG_DEBUG_KERNEL=y 31.886 +# CONFIG_DEBUG_STACKOVERFLOW is not set 31.887 +# CONFIG_DEBUG_HIGHMEM is not set 31.888 +# CONFIG_DEBUG_SLAB is not set 31.889 +# CONFIG_DEBUG_IOVIRT is not set 31.890 +# CONFIG_MAGIC_SYSRQ is not set 31.891 +# CONFIG_DEBUG_SPINLOCK is not set 31.892 +# CONFIG_DEBUG_BUGVERBOSE is not set 31.893 +CONFIG_KALLSYMS=y 31.894 +# CONFIG_FRAME_POINTER is not set 31.895 +CONFIG_LOG_BUF_SHIFT=0 31.896 + 31.897 +# 31.898 +# Cryptographic options 31.899 +# 31.900 +CONFIG_CRYPTO=y 31.901 +CONFIG_CRYPTO_HMAC=y 31.902 +CONFIG_CRYPTO_NULL=m 31.903 +CONFIG_CRYPTO_MD4=m 31.904 +CONFIG_CRYPTO_MD5=m 31.905 +CONFIG_CRYPTO_SHA1=m 31.906 +CONFIG_CRYPTO_SHA256=m 31.907 +CONFIG_CRYPTO_SHA512=m 31.908 +# CONFIG_CRYPTO_WP512 is not set 31.909 +CONFIG_CRYPTO_DES=m 31.910 +CONFIG_CRYPTO_BLOWFISH=m 31.911 +CONFIG_CRYPTO_TWOFISH=m 31.912 +CONFIG_CRYPTO_SERPENT=m 31.913 +CONFIG_CRYPTO_AES=m 31.914 +CONFIG_CRYPTO_CAST5=m 31.915 +CONFIG_CRYPTO_CAST6=m 31.916 +# CONFIG_CRYPTO_TEA is not set 31.917 +# CONFIG_CRYPTO_KHAZAD is not set 31.918 +# CONFIG_CRYPTO_ANUBIS is not set 31.919 +CONFIG_CRYPTO_ARC4=m 31.920 +CONFIG_CRYPTO_DEFLATE=m 31.921 +# CONFIG_CRYPTO_MICHAEL_MIC is not set 31.922 +# CONFIG_CRYPTO_TEST is not set 31.923 + 31.924 +# 31.925 +# Library routines 31.926 +# 31.927 +# CONFIG_CRC32 is not set 31.928 +CONFIG_ZLIB_INFLATE=y 31.929 +CONFIG_ZLIB_DEFLATE=m 31.930 +# CONFIG_FW_LOADER is not set
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 32.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/defconfig-xenU Fri Jul 15 06:39:50 2005 -0700 32.3 @@ -0,0 +1,562 @@ 32.4 +# 32.5 +# Automatically generated make config: don't edit 32.6 +# 32.7 +CONFIG_XEN=y 32.8 +CONFIG_X86=y 32.9 +CONFIG_ISA=y 32.10 +# CONFIG_SBUS is not set 32.11 +CONFIG_UID16=y 32.12 + 32.13 +# 32.14 +# Xen 32.15 +# 32.16 +# CONFIG_XEN_PRIVILEGED_GUEST is not set 32.17 +# CONFIG_XEN_PHYSDEV_ACCESS is not set 32.18 +CONFIG_XEN_SCRUB_PAGES=y 32.19 +CONFIG_XEN_NETDEV_FRONTEND=y 32.20 +CONFIG_XEN_BLKDEV_FRONTEND=y 32.21 +CONFIG_XEN_BLKDEV_GRANT=y 32.22 +# CONFIG_XEN_USB_FRONTEND is not set 32.23 +CONFIG_NO_IDLE_HZ=y 32.24 +# CONFIG_FOREIGN_PAGES is not set 32.25 +CONFIG_NETDEVICES=y 32.26 +# CONFIG_VT is not set 32.27 + 32.28 +# 32.29 +# Code maturity level options 32.30 +# 32.31 +CONFIG_EXPERIMENTAL=y 32.32 + 32.33 +# 32.34 +# Loadable module support 32.35 +# 32.36 +CONFIG_MODULES=y 32.37 +CONFIG_MODVERSIONS=y 32.38 +CONFIG_KMOD=y 32.39 + 32.40 +# 32.41 +# Processor type and features 32.42 +# 32.43 +CONFIG_M686=y 32.44 +# CONFIG_MPENTIUMIII is not set 32.45 +# CONFIG_MPENTIUM4 is not set 32.46 +# CONFIG_MK7 is not set 32.47 +# CONFIG_MK8 is not set 32.48 +# CONFIG_MVIAC3_2 is not set 32.49 +CONFIG_X86_WP_WORKS_OK=y 32.50 +CONFIG_X86_INVLPG=y 32.51 +CONFIG_X86_CMPXCHG=y 32.52 +CONFIG_X86_XADD=y 32.53 +CONFIG_X86_BSWAP=y 32.54 +CONFIG_X86_POPAD_OK=y 32.55 +# CONFIG_RWSEM_GENERIC_SPINLOCK is not set 32.56 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y 32.57 +CONFIG_X86_GOOD_APIC=y 32.58 +CONFIG_X86_PGE=y 32.59 +CONFIG_X86_USE_PPRO_CHECKSUM=y 32.60 +CONFIG_X86_TSC=y 32.61 +CONFIG_X86_L1_CACHE_SHIFT=5 32.62 +CONFIG_NOHIGHMEM=y 32.63 +# CONFIG_HIGHMEM4G is not set 32.64 +CONFIG_FORCE_MAX_ZONEORDER=11 32.65 + 32.66 +# 32.67 +# General setup 32.68 +# 32.69 +CONFIG_NET=y 32.70 +CONFIG_SYSVIPC=y 32.71 +# CONFIG_BSD_PROCESS_ACCT is not set 32.72 +CONFIG_SYSCTL=y 32.73 +CONFIG_KCORE_ELF=y 32.74 +# CONFIG_KCORE_AOUT is not set 32.75 +CONFIG_BINFMT_AOUT=y 32.76 +CONFIG_BINFMT_ELF=y 32.77 +# CONFIG_BINFMT_MISC is not set 32.78 +# CONFIG_OOM_KILLER is not set 32.79 + 32.80 +# 32.81 +# Networking options 32.82 +# 32.83 +CONFIG_PACKET=y 32.84 +CONFIG_PACKET_MMAP=y 32.85 +# CONFIG_NETLINK_DEV is not set 32.86 +CONFIG_NETFILTER=y 32.87 +# CONFIG_NETFILTER_DEBUG is not set 32.88 +CONFIG_FILTER=y 32.89 +CONFIG_UNIX=y 32.90 +CONFIG_INET=y 32.91 +# CONFIG_IP_MULTICAST is not set 32.92 +# CONFIG_IP_ADVANCED_ROUTER is not set 32.93 +CONFIG_IP_PNP=y 32.94 +CONFIG_IP_PNP_DHCP=y 32.95 +# CONFIG_IP_PNP_BOOTP is not set 32.96 +# CONFIG_IP_PNP_RARP is not set 32.97 +# CONFIG_NET_IPIP is not set 32.98 +# CONFIG_NET_IPGRE is not set 32.99 +# CONFIG_ARPD is not set 32.100 +# CONFIG_INET_ECN is not set 32.101 +# CONFIG_SYN_COOKIES is not set 32.102 + 32.103 +# 32.104 +# IP: Netfilter Configuration 32.105 +# 32.106 +CONFIG_IP_NF_CONNTRACK=y 32.107 +CONFIG_IP_NF_FTP=y 32.108 +# CONFIG_IP_NF_AMANDA is not set 32.109 +CONFIG_IP_NF_TFTP=y 32.110 +CONFIG_IP_NF_IRC=y 32.111 +# CONFIG_IP_NF_QUEUE is not set 32.112 +CONFIG_IP_NF_IPTABLES=y 32.113 +# CONFIG_IP_NF_MATCH_LIMIT is not set 32.114 +# CONFIG_IP_NF_MATCH_MAC is not set 32.115 +# CONFIG_IP_NF_MATCH_PKTTYPE is not set 32.116 +# CONFIG_IP_NF_MATCH_MARK is not set 32.117 +# CONFIG_IP_NF_MATCH_MULTIPORT is not set 32.118 +# CONFIG_IP_NF_MATCH_TOS is not set 32.119 +# CONFIG_IP_NF_MATCH_RECENT is not set 32.120 +# CONFIG_IP_NF_MATCH_ECN is not set 32.121 +# CONFIG_IP_NF_MATCH_DSCP is not set 32.122 +# CONFIG_IP_NF_MATCH_AH_ESP is not set 32.123 +# CONFIG_IP_NF_MATCH_LENGTH is not set 32.124 +# CONFIG_IP_NF_MATCH_TTL is not set 32.125 +# CONFIG_IP_NF_MATCH_TCPMSS is not set 32.126 +# CONFIG_IP_NF_MATCH_HELPER is not set 32.127 +CONFIG_IP_NF_MATCH_STATE=y 32.128 +CONFIG_IP_NF_MATCH_CONNTRACK=y 32.129 +# CONFIG_IP_NF_MATCH_UNCLEAN is not set 32.130 +# CONFIG_IP_NF_MATCH_OWNER is not set 32.131 +CONFIG_IP_NF_FILTER=y 32.132 +CONFIG_IP_NF_TARGET_REJECT=y 32.133 +# CONFIG_IP_NF_TARGET_MIRROR is not set 32.134 +CONFIG_IP_NF_NAT=y 32.135 +CONFIG_IP_NF_NAT_NEEDED=y 32.136 +CONFIG_IP_NF_TARGET_MASQUERADE=y 32.137 +CONFIG_IP_NF_TARGET_REDIRECT=y 32.138 +# CONFIG_IP_NF_NAT_SNMP_BASIC is not set 32.139 +CONFIG_IP_NF_NAT_IRC=y 32.140 +CONFIG_IP_NF_NAT_FTP=y 32.141 +CONFIG_IP_NF_NAT_TFTP=y 32.142 +# CONFIG_IP_NF_MANGLE is not set 32.143 +CONFIG_IP_NF_TARGET_LOG=y 32.144 +CONFIG_IP_NF_TARGET_ULOG=y 32.145 +# CONFIG_IP_NF_TARGET_TCPMSS is not set 32.146 +# CONFIG_IP_NF_ARPTABLES is not set 32.147 + 32.148 +# 32.149 +# IP: Virtual Server Configuration 32.150 +# 32.151 +# CONFIG_IP_VS is not set 32.152 +# CONFIG_IPV6 is not set 32.153 +# CONFIG_KHTTPD is not set 32.154 + 32.155 +# 32.156 +# SCTP Configuration (EXPERIMENTAL) 32.157 +# 32.158 +# CONFIG_IP_SCTP is not set 32.159 +# CONFIG_ATM is not set 32.160 +CONFIG_VLAN_8021Q=y 32.161 + 32.162 +# 32.163 +# 32.164 +# 32.165 +# CONFIG_IPX is not set 32.166 +# CONFIG_ATALK is not set 32.167 +# CONFIG_DECNET is not set 32.168 +# CONFIG_BRIDGE is not set 32.169 +# CONFIG_X25 is not set 32.170 +# CONFIG_LAPB is not set 32.171 +# CONFIG_LLC is not set 32.172 +# CONFIG_NET_DIVERT is not set 32.173 +# CONFIG_ECONET is not set 32.174 +# CONFIG_WAN_ROUTER is not set 32.175 +# CONFIG_NET_FASTROUTE is not set 32.176 +# CONFIG_NET_HW_FLOWCONTROL is not set 32.177 + 32.178 +# 32.179 +# QoS and/or fair queueing 32.180 +# 32.181 +# CONFIG_NET_SCHED is not set 32.182 + 32.183 +# 32.184 +# Network testing 32.185 +# 32.186 +# CONFIG_NET_PKTGEN is not set 32.187 + 32.188 +# 32.189 +# SCSI support 32.190 +# 32.191 +CONFIG_SCSI=y 32.192 + 32.193 +# 32.194 +# SCSI support type (disk, tape, CD-ROM) 32.195 +# 32.196 +CONFIG_BLK_DEV_SD=y 32.197 +CONFIG_SD_EXTRA_DEVS=40 32.198 +# CONFIG_CHR_DEV_ST is not set 32.199 +# CONFIG_CHR_DEV_OSST is not set 32.200 +# CONFIG_BLK_DEV_SR is not set 32.201 +CONFIG_CHR_DEV_SG=y 32.202 + 32.203 +# 32.204 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 32.205 +# 32.206 +# CONFIG_SCSI_DEBUG_QUEUES is not set 32.207 +# CONFIG_SCSI_MULTI_LUN is not set 32.208 +# CONFIG_SCSI_CONSTANTS is not set 32.209 +# CONFIG_SCSI_LOGGING is not set 32.210 + 32.211 +# 32.212 +# SCSI low-level drivers 32.213 +# 32.214 +# CONFIG_SCSI_7000FASST is not set 32.215 +# CONFIG_SCSI_ACARD is not set 32.216 +# CONFIG_SCSI_AHA152X is not set 32.217 +# CONFIG_SCSI_AHA1542 is not set 32.218 +# CONFIG_SCSI_AHA1740 is not set 32.219 +# CONFIG_SCSI_AACRAID is not set 32.220 +# CONFIG_SCSI_AIC7XXX is not set 32.221 +# CONFIG_SCSI_AIC79XX is not set 32.222 +# CONFIG_SCSI_AIC7XXX_OLD is not set 32.223 +# CONFIG_SCSI_DPT_I2O is not set 32.224 +# CONFIG_SCSI_ADVANSYS is not set 32.225 +# CONFIG_SCSI_IN2000 is not set 32.226 +# CONFIG_SCSI_AM53C974 is not set 32.227 +# CONFIG_SCSI_MEGARAID is not set 32.228 +# CONFIG_SCSI_MEGARAID2 is not set 32.229 +# CONFIG_SCSI_SATA is not set 32.230 +# CONFIG_SCSI_SATA_AHCI is not set 32.231 +# CONFIG_SCSI_SATA_SVW is not set 32.232 +# CONFIG_SCSI_ATA_PIIX is not set 32.233 +# CONFIG_SCSI_SATA_NV is not set 32.234 +# CONFIG_SCSI_SATA_QSTOR is not set 32.235 +# CONFIG_SCSI_SATA_PROMISE is not set 32.236 +# CONFIG_SCSI_SATA_SX4 is not set 32.237 +# CONFIG_SCSI_SATA_SIL is not set 32.238 +# CONFIG_SCSI_SATA_SIS is not set 32.239 +# CONFIG_SCSI_SATA_ULI is not set 32.240 +# CONFIG_SCSI_SATA_VIA is not set 32.241 +# CONFIG_SCSI_SATA_VITESSE is not set 32.242 +# CONFIG_SCSI_BUSLOGIC is not set 32.243 +# CONFIG_SCSI_DMX3191D is not set 32.244 +# CONFIG_SCSI_DTC3280 is not set 32.245 +# CONFIG_SCSI_EATA is not set 32.246 +# CONFIG_SCSI_EATA_DMA is not set 32.247 +# CONFIG_SCSI_EATA_PIO is not set 32.248 +# CONFIG_SCSI_FUTURE_DOMAIN is not set 32.249 +# CONFIG_SCSI_GDTH is not set 32.250 +# CONFIG_SCSI_GENERIC_NCR5380 is not set 32.251 +# CONFIG_SCSI_IPS is not set 32.252 +# CONFIG_SCSI_INITIO is not set 32.253 +# CONFIG_SCSI_INIA100 is not set 32.254 +# CONFIG_SCSI_PPA is not set 32.255 +# CONFIG_SCSI_IMM is not set 32.256 +# CONFIG_SCSI_NCR53C406A is not set 32.257 +# CONFIG_SCSI_NCR53C7xx is not set 32.258 +# CONFIG_SCSI_PAS16 is not set 32.259 +# CONFIG_SCSI_PCI2000 is not set 32.260 +# CONFIG_SCSI_PCI2220I is not set 32.261 +# CONFIG_SCSI_PSI240I is not set 32.262 +# CONFIG_SCSI_QLOGIC_FAS is not set 32.263 +# CONFIG_SCSI_SEAGATE is not set 32.264 +# CONFIG_SCSI_SIM710 is not set 32.265 +# CONFIG_SCSI_SYM53C416 is not set 32.266 +# CONFIG_SCSI_T128 is not set 32.267 +# CONFIG_SCSI_U14_34F is not set 32.268 +# CONFIG_SCSI_ULTRASTOR is not set 32.269 +# CONFIG_SCSI_NSP32 is not set 32.270 +# CONFIG_SCSI_DEBUG is not set 32.271 + 32.272 +# 32.273 +# Block devices 32.274 +# 32.275 +CONFIG_BLK_DEV_LOOP=y 32.276 +CONFIG_BLK_DEV_NBD=y 32.277 +CONFIG_BLK_DEV_RAM=y 32.278 +CONFIG_BLK_DEV_RAM_SIZE=4096 32.279 +CONFIG_BLK_DEV_INITRD=y 32.280 +# CONFIG_BLK_STATS is not set 32.281 +# CONFIG_BLK_DEV_HD is not set 32.282 + 32.283 +# 32.284 +# Character devices 32.285 +# 32.286 +# CONFIG_VT is not set 32.287 +# CONFIG_SERIAL is not set 32.288 +# CONFIG_SERIAL_EXTENDED is not set 32.289 +# CONFIG_SERIAL_NONSTANDARD is not set 32.290 +CONFIG_UNIX98_PTYS=y 32.291 +CONFIG_UNIX98_PTY_COUNT=256 32.292 +# CONFIG_PRINTER is not set 32.293 +# CONFIG_PPDEV is not set 32.294 +# CONFIG_TIPAR is not set 32.295 + 32.296 +# 32.297 +# I2C support 32.298 +# 32.299 +# CONFIG_I2C is not set 32.300 + 32.301 +# 32.302 +# Mice 32.303 +# 32.304 +# CONFIG_BUSMOUSE is not set 32.305 +CONFIG_MOUSE=y 32.306 +CONFIG_PSMOUSE=y 32.307 +# CONFIG_82C710_MOUSE is not set 32.308 +# CONFIG_PC110_PAD is not set 32.309 +# CONFIG_MK712_MOUSE is not set 32.310 + 32.311 +# 32.312 +# Joysticks 32.313 +# 32.314 +# CONFIG_INPUT_GAMEPORT is not set 32.315 +# CONFIG_INPUT_NS558 is not set 32.316 +# CONFIG_INPUT_LIGHTNING is not set 32.317 +# CONFIG_INPUT_PCIGAME is not set 32.318 +# CONFIG_INPUT_CS461X is not set 32.319 +# CONFIG_INPUT_EMU10K1 is not set 32.320 +# CONFIG_INPUT_SERIO is not set 32.321 +# CONFIG_INPUT_SERPORT is not set 32.322 + 32.323 +# 32.324 +# Joysticks 32.325 +# 32.326 +# CONFIG_INPUT_ANALOG is not set 32.327 +# CONFIG_INPUT_A3D is not set 32.328 +# CONFIG_INPUT_ADI is not set 32.329 +# CONFIG_INPUT_COBRA is not set 32.330 +# CONFIG_INPUT_GF2K is not set 32.331 +# CONFIG_INPUT_GRIP is not set 32.332 +# CONFIG_INPUT_INTERACT is not set 32.333 +# CONFIG_INPUT_TMDC is not set 32.334 +# CONFIG_INPUT_SIDEWINDER is not set 32.335 +# CONFIG_INPUT_IFORCE_USB is not set 32.336 +# CONFIG_INPUT_IFORCE_232 is not set 32.337 +# CONFIG_INPUT_WARRIOR is not set 32.338 +# CONFIG_INPUT_MAGELLAN is not set 32.339 +# CONFIG_INPUT_SPACEORB is not set 32.340 +# CONFIG_INPUT_SPACEBALL is not set 32.341 +# CONFIG_INPUT_STINGER is not set 32.342 +# CONFIG_INPUT_DB9 is not set 32.343 +# CONFIG_INPUT_GAMECON is not set 32.344 +# CONFIG_INPUT_TURBOGRAFX is not set 32.345 +# CONFIG_QIC02_TAPE is not set 32.346 +# CONFIG_IPMI_HANDLER is not set 32.347 +# CONFIG_IPMI_PANIC_EVENT is not set 32.348 +# CONFIG_IPMI_DEVICE_INTERFACE is not set 32.349 +# CONFIG_IPMI_KCS is not set 32.350 +# CONFIG_IPMI_WATCHDOG is not set 32.351 + 32.352 +# 32.353 +# Watchdog Cards 32.354 +# 32.355 +# CONFIG_WATCHDOG is not set 32.356 +# CONFIG_SCx200 is not set 32.357 +# CONFIG_SCx200_GPIO is not set 32.358 +# CONFIG_AMD_RNG is not set 32.359 +# CONFIG_INTEL_RNG is not set 32.360 +# CONFIG_HW_RANDOM is not set 32.361 +# CONFIG_AMD_PM768 is not set 32.362 +# CONFIG_NVRAM is not set 32.363 +# CONFIG_RTC is not set 32.364 +# CONFIG_DTLK is not set 32.365 +# CONFIG_R3964 is not set 32.366 +# CONFIG_APPLICOM is not set 32.367 +# CONFIG_SONYPI is not set 32.368 + 32.369 +# 32.370 +# Ftape, the floppy tape device driver 32.371 +# 32.372 +# CONFIG_FTAPE is not set 32.373 +# CONFIG_AGP is not set 32.374 + 32.375 +# 32.376 +# Direct Rendering Manager (XFree86 DRI support) 32.377 +# 32.378 +# CONFIG_DRM is not set 32.379 +# CONFIG_MWAVE is not set 32.380 +# CONFIG_OBMOUSE is not set 32.381 + 32.382 +# 32.383 +# File systems 32.384 +# 32.385 +# CONFIG_QUOTA is not set 32.386 +# CONFIG_QFMT_V2 is not set 32.387 +CONFIG_AUTOFS_FS=y 32.388 +CONFIG_AUTOFS4_FS=y 32.389 +# CONFIG_REISERFS_FS is not set 32.390 +# CONFIG_REISERFS_CHECK is not set 32.391 +# CONFIG_REISERFS_PROC_INFO is not set 32.392 +# CONFIG_ADFS_FS is not set 32.393 +# CONFIG_ADFS_FS_RW is not set 32.394 +# CONFIG_AFFS_FS is not set 32.395 +# CONFIG_HFS_FS is not set 32.396 +# CONFIG_HFSPLUS_FS is not set 32.397 +# CONFIG_BEFS_FS is not set 32.398 +# CONFIG_BEFS_DEBUG is not set 32.399 +# CONFIG_BFS_FS is not set 32.400 +CONFIG_EXT3_FS=y 32.401 +CONFIG_JBD=y 32.402 +# CONFIG_JBD_DEBUG is not set 32.403 +CONFIG_FAT_FS=y 32.404 +CONFIG_MSDOS_FS=y 32.405 +CONFIG_UMSDOS_FS=y 32.406 +CONFIG_VFAT_FS=y 32.407 +# CONFIG_EFS_FS is not set 32.408 +# CONFIG_JFFS_FS is not set 32.409 +# CONFIG_JFFS2_FS is not set 32.410 +# CONFIG_CRAMFS is not set 32.411 +CONFIG_TMPFS=y 32.412 +CONFIG_RAMFS=y 32.413 +CONFIG_ISO9660_FS=y 32.414 +CONFIG_JOLIET=y 32.415 +CONFIG_ZISOFS=y 32.416 +# CONFIG_JFS_FS is not set 32.417 +# CONFIG_JFS_DEBUG is not set 32.418 +# CONFIG_JFS_STATISTICS is not set 32.419 +# CONFIG_MINIX_FS is not set 32.420 +# CONFIG_VXFS_FS is not set 32.421 +# CONFIG_NTFS_FS is not set 32.422 +# CONFIG_NTFS_RW is not set 32.423 +# CONFIG_HPFS_FS is not set 32.424 +CONFIG_PROC_FS=y 32.425 +# CONFIG_DEVFS_FS is not set 32.426 +# CONFIG_DEVFS_MOUNT is not set 32.427 +# CONFIG_DEVFS_DEBUG is not set 32.428 +CONFIG_DEVPTS_FS=y 32.429 +# CONFIG_QNX4FS_FS is not set 32.430 +# CONFIG_QNX4FS_RW is not set 32.431 +# CONFIG_ROMFS_FS is not set 32.432 +CONFIG_EXT2_FS=y 32.433 +# CONFIG_SYSV_FS is not set 32.434 +# CONFIG_UDF_FS is not set 32.435 +# CONFIG_UDF_RW is not set 32.436 +# CONFIG_UFS_FS is not set 32.437 +# CONFIG_UFS_FS_WRITE is not set 32.438 +# CONFIG_XFS_FS is not set 32.439 +# CONFIG_XFS_QUOTA is not set 32.440 +# CONFIG_XFS_RT is not set 32.441 +# CONFIG_XFS_TRACE is not set 32.442 +# CONFIG_XFS_DEBUG is not set 32.443 + 32.444 +# 32.445 +# Network File Systems 32.446 +# 32.447 +# CONFIG_CODA_FS is not set 32.448 +# CONFIG_INTERMEZZO_FS is not set 32.449 +CONFIG_NFS_FS=y 32.450 +CONFIG_NFS_V3=y 32.451 +# CONFIG_NFS_DIRECTIO is not set 32.452 +CONFIG_ROOT_NFS=y 32.453 +CONFIG_NFSD=y 32.454 +CONFIG_NFSD_V3=y 32.455 +# CONFIG_NFSD_TCP is not set 32.456 +CONFIG_SUNRPC=y 32.457 +CONFIG_LOCKD=y 32.458 +CONFIG_LOCKD_V4=y 32.459 +# CONFIG_SMB_FS is not set 32.460 +# CONFIG_NCP_FS is not set 32.461 +# CONFIG_NCPFS_PACKET_SIGNING is not set 32.462 +# CONFIG_NCPFS_IOCTL_LOCKING is not set 32.463 +# CONFIG_NCPFS_STRONG is not set 32.464 +# CONFIG_NCPFS_NFS_NS is not set 32.465 +# CONFIG_NCPFS_OS2_NS is not set 32.466 +# CONFIG_NCPFS_SMALLDOS is not set 32.467 +# CONFIG_NCPFS_NLS is not set 32.468 +# CONFIG_NCPFS_EXTRAS is not set 32.469 +CONFIG_ZISOFS_FS=y 32.470 + 32.471 +# 32.472 +# Partition Types 32.473 +# 32.474 +CONFIG_PARTITION_ADVANCED=y 32.475 +# CONFIG_ACORN_PARTITION is not set 32.476 +# CONFIG_OSF_PARTITION is not set 32.477 +# CONFIG_AMIGA_PARTITION is not set 32.478 +# CONFIG_ATARI_PARTITION is not set 32.479 +# CONFIG_MAC_PARTITION is not set 32.480 +CONFIG_MSDOS_PARTITION=y 32.481 +# CONFIG_BSD_DISKLABEL is not set 32.482 +# CONFIG_MINIX_SUBPARTITION is not set 32.483 +# CONFIG_SOLARIS_X86_PARTITION is not set 32.484 +# CONFIG_UNIXWARE_DISKLABEL is not set 32.485 +# CONFIG_LDM_PARTITION is not set 32.486 +# CONFIG_SGI_PARTITION is not set 32.487 +# CONFIG_ULTRIX_PARTITION is not set 32.488 +# CONFIG_SUN_PARTITION is not set 32.489 +# CONFIG_EFI_PARTITION is not set 32.490 +# CONFIG_SMB_NLS is not set 32.491 +CONFIG_NLS=y 32.492 + 32.493 +# 32.494 +# Native Language Support 32.495 +# 32.496 +CONFIG_NLS_DEFAULT="iso8559-1" 32.497 +# CONFIG_NLS_CODEPAGE_437 is not set 32.498 +# CONFIG_NLS_CODEPAGE_737 is not set 32.499 +# CONFIG_NLS_CODEPAGE_775 is not set 32.500 +# CONFIG_NLS_CODEPAGE_850 is not set 32.501 +# CONFIG_NLS_CODEPAGE_852 is not set 32.502 +# CONFIG_NLS_CODEPAGE_855 is not set 32.503 +# CONFIG_NLS_CODEPAGE_857 is not set 32.504 +# CONFIG_NLS_CODEPAGE_860 is not set 32.505 +# CONFIG_NLS_CODEPAGE_861 is not set 32.506 +# CONFIG_NLS_CODEPAGE_862 is not set 32.507 +# CONFIG_NLS_CODEPAGE_863 is not set 32.508 +# CONFIG_NLS_CODEPAGE_864 is not set 32.509 +# CONFIG_NLS_CODEPAGE_865 is not set 32.510 +# CONFIG_NLS_CODEPAGE_866 is not set 32.511 +# CONFIG_NLS_CODEPAGE_869 is not set 32.512 +# CONFIG_NLS_CODEPAGE_936 is not set 32.513 +# CONFIG_NLS_CODEPAGE_950 is not set 32.514 +# CONFIG_NLS_CODEPAGE_932 is not set 32.515 +# CONFIG_NLS_CODEPAGE_949 is not set 32.516 +# CONFIG_NLS_CODEPAGE_874 is not set 32.517 +# CONFIG_NLS_ISO8859_8 is not set 32.518 +# CONFIG_NLS_CODEPAGE_1250 is not set 32.519 +# CONFIG_NLS_CODEPAGE_1251 is not set 32.520 +CONFIG_NLS_ISO8859_1=y 32.521 +# CONFIG_NLS_ISO8859_2 is not set 32.522 +# CONFIG_NLS_ISO8859_3 is not set 32.523 +# CONFIG_NLS_ISO8859_4 is not set 32.524 +# CONFIG_NLS_ISO8859_5 is not set 32.525 +# CONFIG_NLS_ISO8859_6 is not set 32.526 +# CONFIG_NLS_ISO8859_7 is not set 32.527 +# CONFIG_NLS_ISO8859_9 is not set 32.528 +# CONFIG_NLS_ISO8859_13 is not set 32.529 +# CONFIG_NLS_ISO8859_14 is not set 32.530 +# CONFIG_NLS_ISO8859_15 is not set 32.531 +# CONFIG_NLS_KOI8_R is not set 32.532 +# CONFIG_NLS_KOI8_U is not set 32.533 +# CONFIG_NLS_UTF8 is not set 32.534 + 32.535 +# 32.536 +# Console drivers 32.537 +# 32.538 +CONFIG_XEN_CONSOLE=y 32.539 + 32.540 +# 32.541 +# Kernel hacking 32.542 +# 32.543 +CONFIG_DEBUG_KERNEL=y 32.544 +# CONFIG_DEBUG_STACKOVERFLOW is not set 32.545 +# CONFIG_DEBUG_HIGHMEM is not set 32.546 +# CONFIG_DEBUG_SLAB is not set 32.547 +# CONFIG_DEBUG_IOVIRT is not set 32.548 +# CONFIG_MAGIC_SYSRQ is not set 32.549 +# CONFIG_DEBUG_SPINLOCK is not set 32.550 +# CONFIG_DEBUG_BUGVERBOSE is not set 32.551 +CONFIG_KALLSYMS=y 32.552 +# CONFIG_FRAME_POINTER is not set 32.553 +CONFIG_LOG_BUF_SHIFT=0 32.554 + 32.555 +# 32.556 +# Cryptographic options 32.557 +# 32.558 +# CONFIG_CRYPTO is not set 32.559 + 32.560 +# 32.561 +# Library routines 32.562 +# 32.563 +# CONFIG_CRC32 is not set 32.564 +CONFIG_ZLIB_INFLATE=y 32.565 +# CONFIG_ZLIB_DEFLATE is not set
33.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 33.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/balloon/Makefile Fri Jul 15 06:39:50 2005 -0700 33.3 @@ -0,0 +1,4 @@ 33.4 +O_TARGET := drv.o 33.5 +export-objs := balloon.o 33.6 +obj-y := balloon.o 33.7 +include $(TOPDIR)/Rules.make
34.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 34.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/blkif/Makefile Fri Jul 15 06:39:50 2005 -0700 34.3 @@ -0,0 +1,10 @@ 34.4 + 34.5 +O_TARGET := drv.o 34.6 + 34.7 +subdir-$(CONFIG_XEN_BLKDEV_FRONTEND) += frontend 34.8 +obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += frontend/drv.o 34.9 + 34.10 +subdir-$(CONFIG_XEN_PHYSDEV_ACCESS) += backend 34.11 +obj-$(CONFIG_XEN_PHYSDEV_ACCESS) += backend/drv.o 34.12 + 34.13 +include $(TOPDIR)/Rules.make
35.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 35.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/blkif/backend/Makefile Fri Jul 15 06:39:50 2005 -0700 35.3 @@ -0,0 +1,3 @@ 35.4 +O_TARGET := drv.o 35.5 +obj-y := main.o control.o interface.o vbd.o 35.6 +include $(TOPDIR)/Rules.make
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 36.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/blkif/frontend/Makefile Fri Jul 15 06:39:50 2005 -0700 36.3 @@ -0,0 +1,3 @@ 36.4 +O_TARGET := drv.o 36.5 +obj-y := blkfront.o vbd.o 36.6 +include $(TOPDIR)/Rules.make
37.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 37.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/blkif/frontend/common.h Fri Jul 15 06:39:50 2005 -0700 37.3 @@ -0,0 +1,93 @@ 37.4 +/****************************************************************************** 37.5 + * arch/xen/drivers/blkif/frontend/common.h 37.6 + * 37.7 + * Shared definitions between all levels of XenoLinux Virtual block devices. 37.8 + */ 37.9 + 37.10 +#ifndef __XEN_DRIVERS_COMMON_H__ 37.11 +#define __XEN_DRIVERS_COMMON_H__ 37.12 + 37.13 +#include <linux/config.h> 37.14 +#include <linux/module.h> 37.15 +#include <linux/kernel.h> 37.16 +#include <linux/sched.h> 37.17 +#include <linux/slab.h> 37.18 +#include <linux/string.h> 37.19 +#include <linux/errno.h> 37.20 +#include <linux/fs.h> 37.21 +#include <linux/hdreg.h> 37.22 +#include <linux/blkdev.h> 37.23 +#include <linux/major.h> 37.24 +#include <asm-xen/xen-public/xen.h> 37.25 +#include <asm/io.h> 37.26 +#include <asm/atomic.h> 37.27 +#include <asm/uaccess.h> 37.28 +#include <asm-xen/xen-public/io/blkif.h> 37.29 + 37.30 +#if 1 37.31 +#define IPRINTK(fmt, args...) \ 37.32 + printk(KERN_INFO "xen_blk: " fmt, ##args) 37.33 +#else 37.34 +#define IPRINTK(fmt, args...) ((void)0) 37.35 +#endif 37.36 + 37.37 +#if 1 37.38 +#define WPRINTK(fmt, args...) \ 37.39 + printk(KERN_WARNING "xen_blk: " fmt, ##args) 37.40 +#else 37.41 +#define WPRINTK(fmt, args...) ((void)0) 37.42 +#endif 37.43 + 37.44 +#if 0 37.45 +#define DPRINTK(_f, _a...) printk ( KERN_ALERT _f , ## _a ) 37.46 +#else 37.47 +#define DPRINTK(_f, _a...) ((void)0) 37.48 +#endif 37.49 + 37.50 +#if 0 37.51 +#define DPRINTK_IOCTL(_f, _a...) printk ( KERN_ALERT _f , ## _a ) 37.52 +#else 37.53 +#define DPRINTK_IOCTL(_f, _a...) ((void)0) 37.54 +#endif 37.55 + 37.56 +/* Private gendisk->flags[] values. */ 37.57 +#define GENHD_FL_XEN 2 /* Is unit a Xen block device? */ 37.58 +#define GENHD_FL_VIRT_PARTNS 4 /* Are unit partitions virtual? */ 37.59 + 37.60 +/* 37.61 + * We have one of these per vbd, whether ide, scsi or 'other'. 37.62 + * They hang in an array off the gendisk structure. We may end up putting 37.63 + * all kinds of interesting stuff here :-) 37.64 + */ 37.65 +typedef struct xl_disk { 37.66 + int usage; 37.67 +} xl_disk_t; 37.68 + 37.69 +extern int blkif_open(struct inode *inode, struct file *filep); 37.70 +extern int blkif_release(struct inode *inode, struct file *filep); 37.71 +extern int blkif_ioctl(struct inode *inode, struct file *filep, 37.72 + unsigned command, unsigned long argument); 37.73 +extern int blkif_check(kdev_t dev); 37.74 +extern int blkif_revalidate(kdev_t dev); 37.75 +extern void blkif_control_send(blkif_request_t *req, blkif_response_t *rsp); 37.76 +extern void do_blkif_request (request_queue_t *rq); 37.77 + 37.78 +extern void xlvbd_update_vbds(void); 37.79 + 37.80 +static inline xl_disk_t *xldev_to_xldisk(kdev_t xldev) 37.81 +{ 37.82 + struct gendisk *gd = get_gendisk(xldev); 37.83 + 37.84 + if ( gd == NULL ) 37.85 + return NULL; 37.86 + 37.87 + return (xl_disk_t *)gd->real_devices + 37.88 + (MINOR(xldev) >> gd->minor_shift); 37.89 +} 37.90 + 37.91 + 37.92 +/* Virtual block-device subsystem. */ 37.93 +extern int xlvbd_init(void); 37.94 +extern void xlvbd_cleanup(void); 37.95 + 37.96 +#endif /* __XEN_DRIVERS_COMMON_H__ */
38.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 38.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c Fri Jul 15 06:39:50 2005 -0700 38.3 @@ -0,0 +1,540 @@ 38.4 +/****************************************************************************** 38.5 + * arch/xen/drivers/blkif/frontend/vbd.c 38.6 + * 38.7 + * Xenolinux virtual block-device driver. 38.8 + * 38.9 + * Copyright (c) 2003-2004, Keir Fraser & Steve Hand 38.10 + * Modifications by Mark A. Williamson are (c) Intel Research Cambridge 38.11 + */ 38.12 + 38.13 +#include "common.h" 38.14 +#include <linux/blk.h> 38.15 + 38.16 +/* 38.17 + * For convenience we distinguish between ide, scsi and 'other' (i.e. 38.18 + * potentially combinations of the two) in the naming scheme and in a few 38.19 + * other places (like default readahead, etc). 38.20 + */ 38.21 +#define XLIDE_MAJOR_NAME "hd" 38.22 +#define XLSCSI_MAJOR_NAME "sd" 38.23 +#define XLVBD_MAJOR_NAME "xvd" 38.24 + 38.25 +#define XLIDE_DEVS_PER_MAJOR 2 38.26 +#define XLSCSI_DEVS_PER_MAJOR 16 38.27 +#define XLVBD_DEVS_PER_MAJOR 16 38.28 + 38.29 +#define XLIDE_PARTN_SHIFT 6 /* amount to shift minor to get 'real' minor */ 38.30 +#define XLIDE_MAX_PART (1 << XLIDE_PARTN_SHIFT) /* minors per ide vbd */ 38.31 + 38.32 +#define XLSCSI_PARTN_SHIFT 4 /* amount to shift minor to get 'real' minor */ 38.33 +#define XLSCSI_MAX_PART (1 << XLSCSI_PARTN_SHIFT) /* minors per scsi vbd */ 38.34 + 38.35 +#define XLVBD_PARTN_SHIFT 4 /* amount to shift minor to get 'real' minor */ 38.36 +#define XLVBD_MAX_PART (1 << XLVBD_PARTN_SHIFT) /* minors per 'other' vbd */ 38.37 + 38.38 +/* The below are for the generic drivers/block/ll_rw_block.c code. */ 38.39 +static int xlide_blksize_size[256]; 38.40 +static int xlide_hardsect_size[256]; 38.41 +static int xlide_max_sectors[256]; 38.42 +static int xlscsi_blksize_size[256]; 38.43 +static int xlscsi_hardsect_size[256]; 38.44 +static int xlscsi_max_sectors[256]; 38.45 +static int xlvbd_blksize_size[256]; 38.46 +static int xlvbd_hardsect_size[256]; 38.47 +static int xlvbd_max_sectors[256]; 38.48 + 38.49 +/* Information about our VBDs. */ 38.50 +#define MAX_VBDS 64 38.51 +static int nr_vbds; 38.52 +static vdisk_t *vbd_info; 38.53 + 38.54 +static struct block_device_operations xlvbd_block_fops = 38.55 +{ 38.56 + open: blkif_open, 38.57 + release: blkif_release, 38.58 + ioctl: blkif_ioctl, 38.59 + check_media_change: blkif_check, 38.60 + revalidate: blkif_revalidate, 38.61 +}; 38.62 + 38.63 +static int xlvbd_get_vbd_info(vdisk_t *disk_info) 38.64 +{ 38.65 + vdisk_t *buf = (vdisk_t *)__get_free_page(GFP_KERNEL); 38.66 + blkif_request_t req; 38.67 + blkif_response_t rsp; 38.68 + int nr; 38.69 + 38.70 + memset(&req, 0, sizeof(req)); 38.71 + req.operation = BLKIF_OP_PROBE; 38.72 + req.nr_segments = 1; 38.73 +#ifdef CONFIG_XEN_BLKDEV_GRANT 38.74 + blkif_control_probe_send(&req, &rsp, 38.75 + (unsigned long)(virt_to_machine(buf))); 38.76 +#else 38.77 + req.frame_and_sects[0] = virt_to_machine(buf) | 7; 38.78 + 38.79 + blkif_control_send(&req, &rsp); 38.80 +#endif 38.81 + 38.82 + if ( rsp.status <= 0 ) 38.83 + { 38.84 + printk(KERN_ALERT "Could not probe disks (%d)\n", rsp.status); 38.85 + return -1; 38.86 + } 38.87 + 38.88 + if ( (nr = rsp.status) > MAX_VBDS ) 38.89 + nr = MAX_VBDS; 38.90 + memcpy(disk_info, buf, nr * sizeof(vdisk_t)); 38.91 + 38.92 + return nr; 38.93 +} 38.94 + 38.95 +/* 38.96 + * xlvbd_init_device - initialise a VBD device 38.97 + * @disk: a vdisk_t describing the VBD 38.98 + * 38.99 + * Takes a vdisk_t * that describes a VBD the domain has access to. 38.100 + * Performs appropriate initialisation and registration of the device. 38.101 + * 38.102 + * Care needs to be taken when making re-entrant calls to ensure that 38.103 + * corruption does not occur. Also, devices that are in use should not have 38.104 + * their details updated. This is the caller's responsibility. 38.105 + */ 38.106 +static int xlvbd_init_device(vdisk_t *xd) 38.107 +{ 38.108 + int device = xd->device; 38.109 + int major = MAJOR(device); 38.110 + int minor = MINOR(device); 38.111 + int is_ide = IDE_DISK_MAJOR(major); /* is this an ide device? */ 38.112 + int is_scsi= SCSI_BLK_MAJOR(major); /* is this a scsi device? */ 38.113 + char *major_name; 38.114 + struct gendisk *gd; 38.115 + struct block_device *bd; 38.116 + xl_disk_t *disk; 38.117 + int i, rc = 0, max_part, partno; 38.118 + unsigned long capacity; 38.119 + 38.120 + unsigned char buf[64]; 38.121 + 38.122 + if ( (bd = bdget(device)) == NULL ) 38.123 + return -1; 38.124 + 38.125 + if ( ((disk = xldev_to_xldisk(device)) != NULL) && (disk->usage != 0) ) 38.126 + { 38.127 + printk(KERN_ALERT "VBD update failed - in use [dev=%x]\n", device); 38.128 + rc = -1; 38.129 + goto out; 38.130 + } 38.131 + 38.132 + if ( is_ide ) { 38.133 + 38.134 + major_name = XLIDE_MAJOR_NAME; 38.135 + max_part = XLIDE_MAX_PART; 38.136 + 38.137 + } else if ( is_scsi ) { 38.138 + 38.139 + major_name = XLSCSI_MAJOR_NAME; 38.140 + max_part = XLSCSI_MAX_PART; 38.141 + 38.142 + } else { 38.143 + 38.144 + /* SMH: hmm - probably a CCISS driver or sim; assume CCISS for now */ 38.145 + printk(KERN_ALERT "Assuming device %02x:%02x is CCISS/SCSI\n", 38.146 + major, minor); 38.147 + is_scsi = 1; 38.148 + major_name = "cciss"; 38.149 + max_part = XLSCSI_MAX_PART; 38.150 + 38.151 + } 38.152 + 38.153 + partno = minor & (max_part - 1); 38.154 + 38.155 + if ( (gd = get_gendisk(device)) == NULL ) 38.156 + { 38.157 + rc = register_blkdev(major, major_name, &xlvbd_block_fops); 38.158 + if ( rc < 0 ) 38.159 + { 38.160 + printk(KERN_ALERT "XL VBD: can't get major %d\n", major); 38.161 + goto out; 38.162 + } 38.163 + 38.164 + if ( is_ide ) 38.165 + { 38.166 + blksize_size[major] = xlide_blksize_size; 38.167 + hardsect_size[major] = xlide_hardsect_size; 38.168 + max_sectors[major] = xlide_max_sectors; 38.169 + read_ahead[major] = 8; 38.170 + } 38.171 + else if ( is_scsi ) 38.172 + { 38.173 + blksize_size[major] = xlscsi_blksize_size; 38.174 + hardsect_size[major] = xlscsi_hardsect_size; 38.175 + max_sectors[major] = xlscsi_max_sectors; 38.176 + read_ahead[major] = 8; 38.177 + } 38.178 + else 38.179 + { 38.180 + blksize_size[major] = xlvbd_blksize_size; 38.181 + hardsect_size[major] = xlvbd_hardsect_size; 38.182 + max_sectors[major] = xlvbd_max_sectors; 38.183 + read_ahead[major] = 8; 38.184 + } 38.185 + 38.186 + blk_init_queue(BLK_DEFAULT_QUEUE(major), do_blkif_request); 38.187 + 38.188 + /* 38.189 + * Turn off barking 'headactive' mode. We dequeue buffer heads as 38.190 + * soon as we pass them to the back-end driver. 38.191 + */ 38.192 + blk_queue_headactive(BLK_DEFAULT_QUEUE(major), 0); 38.193 + 38.194 + /* Construct an appropriate gendisk structure. */ 38.195 + gd = kmalloc(sizeof(struct gendisk), GFP_KERNEL); 38.196 + gd->major = major; 38.197 + gd->major_name = major_name; 38.198 + 38.199 + gd->max_p = max_part; 38.200 + if ( is_ide ) 38.201 + { 38.202 + gd->minor_shift = XLIDE_PARTN_SHIFT; 38.203 + gd->nr_real = XLIDE_DEVS_PER_MAJOR; 38.204 + } 38.205 + else if ( is_scsi ) 38.206 + { 38.207 + gd->minor_shift = XLSCSI_PARTN_SHIFT; 38.208 + gd->nr_real = XLSCSI_DEVS_PER_MAJOR; 38.209 + } 38.210 + else 38.211 + { 38.212 + gd->minor_shift = XLVBD_PARTN_SHIFT; 38.213 + gd->nr_real = XLVBD_DEVS_PER_MAJOR; 38.214 + } 38.215 + 38.216 + /* 38.217 + ** The sizes[] and part[] arrays hold the sizes and other 38.218 + ** information about every partition with this 'major' (i.e. 38.219 + ** every disk sharing the 8 bit prefix * max partns per disk) 38.220 + */ 38.221 + gd->sizes = kmalloc(max_part*gd->nr_real*sizeof(int), GFP_KERNEL); 38.222 + gd->part = kmalloc(max_part*gd->nr_real*sizeof(struct hd_struct), 38.223 + GFP_KERNEL); 38.224 + memset(gd->sizes, 0, max_part * gd->nr_real * sizeof(int)); 38.225 + memset(gd->part, 0, max_part * gd->nr_real 38.226 + * sizeof(struct hd_struct)); 38.227 + 38.228 + 38.229 + gd->real_devices = kmalloc(gd->nr_real * sizeof(xl_disk_t), 38.230 + GFP_KERNEL); 38.231 + memset(gd->real_devices, 0, gd->nr_real * sizeof(xl_disk_t)); 38.232 + 38.233 + gd->next = NULL; 38.234 + gd->fops = &xlvbd_block_fops; 38.235 + 38.236 + gd->de_arr = kmalloc(gd->nr_real * sizeof(*gd->de_arr), 38.237 + GFP_KERNEL); 38.238 + gd->flags = kmalloc(gd->nr_real * sizeof(*gd->flags), GFP_KERNEL); 38.239 + 38.240 + memset(gd->de_arr, 0, gd->nr_real * sizeof(*gd->de_arr)); 38.241 + memset(gd->flags, 0, gd->nr_real * sizeof(*gd->flags)); 38.242 + 38.243 + add_gendisk(gd); 38.244 + 38.245 + blk_size[major] = gd->sizes; 38.246 + } 38.247 + 38.248 + if ( xd->info & VDISK_READONLY ) 38.249 + set_device_ro(device, 1); 38.250 + 38.251 + gd->flags[minor >> gd->minor_shift] |= GENHD_FL_XEN; 38.252 + 38.253 + /* NB. Linux 2.4 only handles 32-bit sector offsets and capacities. */ 38.254 + capacity = (unsigned long)xd->capacity; 38.255 + 38.256 + if ( partno != 0 ) 38.257 + { 38.258 + /* 38.259 + * If this was previously set up as a real disc we will have set 38.260 + * up partition-table information. Virtual partitions override 38.261 + * 'real' partitions, and the two cannot coexist on a device. 38.262 + */ 38.263 + if ( !(gd->flags[minor >> gd->minor_shift] & GENHD_FL_VIRT_PARTNS) && 38.264 + (gd->sizes[minor & ~(max_part-1)] != 0) ) 38.265 + { 38.266 + /* 38.267 + * Any non-zero sub-partition entries must be cleaned out before 38.268 + * installing 'virtual' partition entries. The two types cannot 38.269 + * coexist, and virtual partitions are favoured. 38.270 + */ 38.271 + kdev_t dev = device & ~(max_part-1); 38.272 + for ( i = max_part - 1; i > 0; i-- ) 38.273 + { 38.274 + invalidate_device(dev+i, 1); 38.275 + gd->part[MINOR(dev+i)].start_sect = 0; 38.276 + gd->part[MINOR(dev+i)].nr_sects = 0; 38.277 + gd->sizes[MINOR(dev+i)] = 0; 38.278 + } 38.279 + printk(KERN_ALERT 38.280 + "Virtual partitions found for /dev/%s - ignoring any " 38.281 + "real partition information we may have found.\n", 38.282 + disk_name(gd, MINOR(device), buf)); 38.283 + } 38.284 + 38.285 + /* Need to skankily setup 'partition' information */ 38.286 + gd->part[minor].start_sect = 0; 38.287 + gd->part[minor].nr_sects = capacity; 38.288 + gd->sizes[minor] = capacity >>(BLOCK_SIZE_BITS-9); 38.289 + 38.290 + gd->flags[minor >> gd->minor_shift] |= GENHD_FL_VIRT_PARTNS; 38.291 + } 38.292 + else 38.293 + { 38.294 + gd->part[minor].nr_sects = capacity; 38.295 + gd->sizes[minor] = capacity>>(BLOCK_SIZE_BITS-9); 38.296 + 38.297 + /* Some final fix-ups depending on the device type */ 38.298 + if ( xd->info & VDISK_REMOVABLE ) 38.299 + { 38.300 + gd->flags[minor >> gd->minor_shift] |= GENHD_FL_REMOVABLE; 38.301 + printk(KERN_ALERT 38.302 + "Skipping partition check on %s /dev/%s\n", 38.303 + (xd->info & VDISK_CDROM) ? "cdrom" : "removable", 38.304 + disk_name(gd, MINOR(device), buf)); 38.305 + } 38.306 + else 38.307 + { 38.308 + /* Only check partitions on real discs (not virtual!). */ 38.309 + if ( gd->flags[minor>>gd->minor_shift] & GENHD_FL_VIRT_PARTNS ) 38.310 + { 38.311 + printk(KERN_ALERT 38.312 + "Skipping partition check on virtual /dev/%s\n", 38.313 + disk_name(gd, MINOR(device), buf)); 38.314 + break; 38.315 + } 38.316 + register_disk(gd, device, gd->max_p, &xlvbd_block_fops, capacity); 38.317 + } 38.318 + } 38.319 + 38.320 + out: 38.321 + bdput(bd); 38.322 + return rc; 38.323 +} 38.324 + 38.325 + 38.326 +/* 38.327 + * xlvbd_remove_device - remove a device node if possible 38.328 + * @device: numeric device ID 38.329 + * 38.330 + * Updates the gendisk structure and invalidates devices. 38.331 + * 38.332 + * This is OK for now but in future, should perhaps consider where this should 38.333 + * deallocate gendisks / unregister devices. 38.334 + */ 38.335 +static int xlvbd_remove_device(int device) 38.336 +{ 38.337 + int i, rc = 0, minor = MINOR(device); 38.338 + struct gendisk *gd; 38.339 + struct block_device *bd; 38.340 + xl_disk_t *disk = NULL; 38.341 + 38.342 + if ( (bd = bdget(device)) == NULL ) 38.343 + return -1; 38.344 + 38.345 + if ( ((gd = get_gendisk(device)) == NULL) || 38.346 + ((disk = xldev_to_xldisk(device)) == NULL) ) 38.347 + BUG(); 38.348 + 38.349 + if ( disk->usage != 0 ) 38.350 + { 38.351 + printk(KERN_ALERT "VBD removal failed - in use [dev=%x]\n", device); 38.352 + rc = -1; 38.353 + goto out; 38.354 + } 38.355 + 38.356 + if ( (minor & (gd->max_p-1)) != 0 ) 38.357 + { 38.358 + /* 1: The VBD is mapped to a partition rather than a whole unit. */ 38.359 + invalidate_device(device, 1); 38.360 + gd->part[minor].start_sect = 0; 38.361 + gd->part[minor].nr_sects = 0; 38.362 + gd->sizes[minor] = 0; 38.363 + 38.364 + /* Clear the consists-of-virtual-partitions flag if possible. */ 38.365 + gd->flags[minor >> gd->minor_shift] &= ~GENHD_FL_VIRT_PARTNS; 38.366 + for ( i = 1; i < gd->max_p; i++ ) 38.367 + if ( gd->sizes[(minor & ~(gd->max_p-1)) + i] != 0 ) 38.368 + gd->flags[minor >> gd->minor_shift] |= GENHD_FL_VIRT_PARTNS; 38.369 + 38.370 + /* 38.371 + * If all virtual partitions are now gone, and a 'whole unit' VBD is 38.372 + * present, then we can try to grok the unit's real partition table. 38.373 + */ 38.374 + if ( !(gd->flags[minor >> gd->minor_shift] & GENHD_FL_VIRT_PARTNS) && 38.375 + (gd->sizes[minor & ~(gd->max_p-1)] != 0) && 38.376 + !(gd->flags[minor >> gd->minor_shift] & GENHD_FL_REMOVABLE) ) 38.377 + { 38.378 + register_disk(gd, 38.379 + device&~(gd->max_p-1), 38.380 + gd->max_p, 38.381 + &xlvbd_block_fops, 38.382 + gd->part[minor&~(gd->max_p-1)].nr_sects); 38.383 + } 38.384 + } 38.385 + else 38.386 + { 38.387 + /* 38.388 + * 2: The VBD is mapped to an entire 'unit'. Clear all partitions. 38.389 + * NB. The partition entries are only cleared if there are no VBDs 38.390 + * mapped to individual partitions on this unit. 38.391 + */ 38.392 + i = gd->max_p - 1; /* Default: clear subpartitions as well. */ 38.393 + if ( gd->flags[minor >> gd->minor_shift] & GENHD_FL_VIRT_PARTNS ) 38.394 + i = 0; /* 'Virtual' mode: only clear the 'whole unit' entry. */ 38.395 + while ( i >= 0 ) 38.396 + { 38.397 + invalidate_device(device+i, 1); 38.398 + gd->part[minor+i].start_sect = 0; 38.399 + gd->part[minor+i].nr_sects = 0; 38.400 + gd->sizes[minor+i] = 0; 38.401 + i--; 38.402 + } 38.403 + } 38.404 + 38.405 + out: 38.406 + bdput(bd); 38.407 + return rc; 38.408 +} 38.409 + 38.410 +/* 38.411 + * xlvbd_update_vbds - reprobes the VBD status and performs updates driver 38.412 + * state. The VBDs need to be updated in this way when the domain is 38.413 + * initialised and also each time we receive an XLBLK_UPDATE event. 38.414 + */ 38.415 +void xlvbd_update_vbds(void) 38.416 +{ 38.417 + int i, j, k, old_nr, new_nr; 38.418 + vdisk_t *old_info, *new_info, *merged_info; 38.419 + 38.420 + old_info = vbd_info; 38.421 + old_nr = nr_vbds; 38.422 + 38.423 + new_info = kmalloc(MAX_VBDS * sizeof(vdisk_t), GFP_KERNEL); 38.424 + if (!new_info) 38.425 + return; 38.426 + 38.427 + if ( unlikely(new_nr = xlvbd_get_vbd_info(new_info)) < 0 ) 38.428 + goto out; 38.429 + 38.430 + /* 38.431 + * Final list maximum size is old list + new list. This occurs only when 38.432 + * old list and new list do not overlap at all, and we cannot yet destroy 38.433 + * VBDs in the old list because the usage counts are busy. 38.434 + */ 38.435 + merged_info = kmalloc((old_nr + new_nr) * sizeof(vdisk_t), GFP_KERNEL); 38.436 + if (!merged_info) 38.437 + goto out; 38.438 + 38.439 + /* @i tracks old list; @j tracks new list; @k tracks merged list. */ 38.440 + i = j = k = 0; 38.441 + 38.442 + while ( (i < old_nr) && (j < new_nr) ) 38.443 + { 38.444 + if ( old_info[i].device < new_info[j].device ) 38.445 + { 38.446 + if ( xlvbd_remove_device(old_info[i].device) != 0 ) 38.447 + memcpy(&merged_info[k++], &old_info[i], sizeof(vdisk_t)); 38.448 + i++; 38.449 + } 38.450 + else if ( old_info[i].device > new_info[j].device ) 38.451 + { 38.452 + if ( xlvbd_init_device(&new_info[j]) == 0 ) 38.453 + memcpy(&merged_info[k++], &new_info[j], sizeof(vdisk_t)); 38.454 + j++; 38.455 + } 38.456 + else 38.457 + { 38.458 + if ( ((old_info[i].capacity == new_info[j].capacity) && 38.459 + (old_info[i].info == new_info[j].info)) || 38.460 + (xlvbd_remove_device(old_info[i].device) != 0) ) 38.461 + memcpy(&merged_info[k++], &old_info[i], sizeof(vdisk_t)); 38.462 + else if ( xlvbd_init_device(&new_info[j]) == 0 ) 38.463 + memcpy(&merged_info[k++], &new_info[j], sizeof(vdisk_t)); 38.464 + i++; j++; 38.465 + } 38.466 + } 38.467 + 38.468 + for ( ; i < old_nr; i++ ) 38.469 + { 38.470 + if ( xlvbd_remove_device(old_info[i].device) != 0 ) 38.471 + memcpy(&merged_info[k++], &old_info[i], sizeof(vdisk_t)); 38.472 + } 38.473 + 38.474 + for ( ; j < new_nr; j++ ) 38.475 + { 38.476 + if ( xlvbd_init_device(&new_info[j]) == 0 ) 38.477 + memcpy(&merged_info[k++], &new_info[j], sizeof(vdisk_t)); 38.478 + } 38.479 + 38.480 + vbd_info = merged_info; 38.481 + nr_vbds = k; 38.482 + 38.483 + kfree(old_info); 38.484 +out: 38.485 + kfree(new_info); 38.486 +} 38.487 + 38.488 + 38.489 +/* 38.490 + * Set up all the linux device goop for the virtual block devices (vbd's) that 38.491 + * we know about. Note that although from the backend driver's p.o.v. VBDs are 38.492 + * addressed simply an opaque 16-bit device number, the domain creation tools 38.493 + * conventionally allocate these numbers to correspond to those used by 'real' 38.494 + * linux -- this is just for convenience as it means e.g. that the same 38.495 + * /etc/fstab can be used when booting with or without Xen. 38.496 + */ 38.497 +int xlvbd_init(void) 38.498 +{ 38.499 + int i; 38.500 + 38.501 + /* 38.502 + * If compiled as a module, we don't support unloading yet. We therefore 38.503 + * permanently increment the reference count to disallow it. 38.504 + */ 38.505 + SET_MODULE_OWNER(&xlvbd_block_fops); 38.506 + MOD_INC_USE_COUNT; 38.507 + 38.508 + /* Initialize the global arrays. */ 38.509 + for ( i = 0; i < 256; i++ ) 38.510 + { 38.511 + xlide_blksize_size[i] = 1024; 38.512 + xlide_hardsect_size[i] = 512; 38.513 + xlide_max_sectors[i] = 512; 38.514 + 38.515 + xlscsi_blksize_size[i] = 1024; 38.516 + xlscsi_hardsect_size[i] = 512; 38.517 + xlscsi_max_sectors[i] = 512; 38.518 + 38.519 + xlvbd_blksize_size[i] = 512; 38.520 + xlvbd_hardsect_size[i] = 512; 38.521 + xlvbd_max_sectors[i] = 512; 38.522 + } 38.523 + 38.524 + vbd_info = kmalloc(MAX_VBDS * sizeof(vdisk_t), GFP_KERNEL); 38.525 + if (!vbd_info) 38.526 + return -ENOMEM; 38.527 + 38.528 + nr_vbds = xlvbd_get_vbd_info(vbd_info); 38.529 + 38.530 + if ( nr_vbds < 0 ) 38.531 + { 38.532 + kfree(vbd_info); 38.533 + vbd_info = NULL; 38.534 + nr_vbds = 0; 38.535 + } 38.536 + else 38.537 + { 38.538 + for ( i = 0; i < nr_vbds; i++ ) 38.539 + xlvbd_init_device(&vbd_info[i]); 38.540 + } 38.541 + 38.542 + return 0; 38.543 +}
39.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 39.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/console/Makefile Fri Jul 15 06:39:50 2005 -0700 39.3 @@ -0,0 +1,3 @@ 39.4 +O_TARGET := drv.o 39.5 +obj-$(CONFIG_XEN_CONSOLE) := console.o 39.6 +include $(TOPDIR)/Rules.make
40.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 40.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/dom0/Makefile Fri Jul 15 06:39:50 2005 -0700 40.3 @@ -0,0 +1,3 @@ 40.4 +O_TARGET := drv.o 40.5 +obj-y := core.o 40.6 +include $(TOPDIR)/Rules.make
41.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 41.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/evtchn/Makefile Fri Jul 15 06:39:50 2005 -0700 41.3 @@ -0,0 +1,3 @@ 41.4 +O_TARGET := drv.o 41.5 +obj-y := evtchn.o 41.6 +include $(TOPDIR)/Rules.make
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 42.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/netif/Makefile Fri Jul 15 06:39:50 2005 -0700 42.3 @@ -0,0 +1,10 @@ 42.4 + 42.5 +O_TARGET := drv.o 42.6 + 42.7 +subdir-$(CONFIG_XEN_NETDEV_FRONTEND) += frontend 42.8 +obj-$(CONFIG_XEN_NETDEV_FRONTEND) += frontend/drv.o 42.9 + 42.10 +subdir-$(CONFIG_XEN_PHYSDEV_ACCESS) += backend 42.11 +obj-$(CONFIG_XEN_PHYSDEV_ACCESS) += backend/drv.o 42.12 + 42.13 +include $(TOPDIR)/Rules.make
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 43.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/netif/backend/Makefile Fri Jul 15 06:39:50 2005 -0700 43.3 @@ -0,0 +1,4 @@ 43.4 +O_TARGET := drv.o 43.5 +export-objs := interface.o 43.6 +obj-y := main.o control.o interface.o 43.7 +include $(TOPDIR)/Rules.make
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 44.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/drivers/netif/frontend/Makefile Fri Jul 15 06:39:50 2005 -0700 44.3 @@ -0,0 +1,3 @@ 44.4 +O_TARGET := drv.o 44.5 +obj-y := main.o 44.6 +include $(TOPDIR)/Rules.make
45.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 45.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/Makefile Fri Jul 15 06:39:50 2005 -0700 45.3 @@ -0,0 +1,20 @@ 45.4 + 45.5 +.S.o: 45.6 + $(CC) $(AFLAGS) -traditional -c $< -o $*.o 45.7 + 45.8 +all: kernel.o head.o init_task.o 45.9 + 45.10 +O_TARGET := kernel.o 45.11 + 45.12 +export-objs := i386_ksyms.o gnttab.o skbuff.o ctrl_if.o 45.13 + 45.14 +obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ 45.15 + ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o \ 45.16 + i386_ksyms.o i387.o evtchn.o ctrl_if.o pci-dma.o \ 45.17 + reboot.o fixup.o gnttab.o skbuff.o 45.18 + 45.19 +ifdef CONFIG_PCI 45.20 +obj-y += pci-i386.o pci-pc.o 45.21 +endif 45.22 + 45.23 +include $(TOPDIR)/Rules.make
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 46.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/entry.S Fri Jul 15 06:39:50 2005 -0700 46.3 @@ -0,0 +1,779 @@ 46.4 +/* 46.5 + * linux/arch/i386/entry.S 46.6 + * 46.7 + * Copyright (C) 1991, 1992 Linus Torvalds 46.8 + */ 46.9 + 46.10 +/* 46.11 + * entry.S contains the system-call and fault low-level handling routines. 46.12 + * This also contains the timer-interrupt handler, as well as all interrupts 46.13 + * and faults that can result in a task-switch. 46.14 + * 46.15 + * NOTE: This code handles signal-recognition, which happens every time 46.16 + * after a timer-interrupt and after each system call. 46.17 + * 46.18 + * I changed all the .align's to 4 (16 byte alignment), as that's faster 46.19 + * on a 486. 46.20 + * 46.21 + * Stack layout in 'ret_to_user': 46.22 + * ptrace needs to have all regs on the stack. 46.23 + * if the order here is changed, it needs to be 46.24 + * updated in fork.c:copy_process, signal.c:do_signal, 46.25 + * ptrace.c and ptrace.h 46.26 + * 46.27 + * 0(%esp) - %ebx 46.28 + * 4(%esp) - %ecx 46.29 + * 8(%esp) - %edx 46.30 + * C(%esp) - %esi 46.31 + * 10(%esp) - %edi 46.32 + * 14(%esp) - %ebp 46.33 + * 18(%esp) - %eax 46.34 + * 1C(%esp) - %ds 46.35 + * 20(%esp) - %es 46.36 + * 24(%esp) - orig_eax 46.37 + * 28(%esp) - %eip 46.38 + * 2C(%esp) - %cs 46.39 + * 30(%esp) - %eflags 46.40 + * 34(%esp) - %oldesp 46.41 + * 38(%esp) - %oldss 46.42 + * 46.43 + * "current" is in register %ebx during any slow entries. 46.44 + */ 46.45 + 46.46 +#include <linux/config.h> 46.47 +#include <linux/sys.h> 46.48 +#include <linux/linkage.h> 46.49 +#include <asm/segment.h> 46.50 +#include <asm/smp.h> 46.51 + 46.52 +EBX = 0x00 46.53 +ECX = 0x04 46.54 +EDX = 0x08 46.55 +ESI = 0x0C 46.56 +EDI = 0x10 46.57 +EBP = 0x14 46.58 +EAX = 0x18 46.59 +DS = 0x1C 46.60 +ES = 0x20 46.61 +ORIG_EAX = 0x24 46.62 +EIP = 0x28 46.63 +CS = 0x2C 46.64 +EFLAGS = 0x30 46.65 +OLDESP = 0x34 46.66 +OLDSS = 0x38 46.67 + 46.68 +CF_MASK = 0x00000001 46.69 +TF_MASK = 0x00000100 46.70 +IF_MASK = 0x00000200 46.71 +DF_MASK = 0x00000400 46.72 +NT_MASK = 0x00004000 46.73 + 46.74 +/* Offsets into task_struct. */ 46.75 +state = 0 46.76 +flags = 4 46.77 +sigpending = 8 46.78 +addr_limit = 12 46.79 +exec_domain = 16 46.80 +need_resched = 20 46.81 +tsk_ptrace = 24 46.82 +processor = 52 46.83 + 46.84 +/* Offsets into shared_info_t. */ 46.85 +#define evtchn_upcall_pending /* 0 */ 46.86 +#define evtchn_upcall_mask 1 46.87 + 46.88 +ENOSYS = 38 46.89 + 46.90 + 46.91 +#define SAVE_ALL \ 46.92 + cld; \ 46.93 + pushl %es; \ 46.94 + pushl %ds; \ 46.95 + pushl %eax; \ 46.96 + pushl %ebp; \ 46.97 + pushl %edi; \ 46.98 + pushl %esi; \ 46.99 + pushl %edx; \ 46.100 + pushl %ecx; \ 46.101 + pushl %ebx; \ 46.102 + movl $(__KERNEL_DS),%edx; \ 46.103 + movl %edx,%ds; \ 46.104 + movl %edx,%es; 46.105 + 46.106 +#define RESTORE_ALL \ 46.107 + popl %ebx; \ 46.108 + popl %ecx; \ 46.109 + popl %edx; \ 46.110 + popl %esi; \ 46.111 + popl %edi; \ 46.112 + popl %ebp; \ 46.113 + popl %eax; \ 46.114 +1: popl %ds; \ 46.115 +2: popl %es; \ 46.116 + addl $4,%esp; \ 46.117 +3: iret; \ 46.118 +.section .fixup,"ax"; \ 46.119 +4: movl $0,(%esp); \ 46.120 + jmp 1b; \ 46.121 +5: movl $0,(%esp); \ 46.122 + jmp 2b; \ 46.123 +6: pushl %ss; \ 46.124 + popl %ds; \ 46.125 + pushl %ss; \ 46.126 + popl %es; \ 46.127 + pushl $11; \ 46.128 + call do_exit; \ 46.129 +.previous; \ 46.130 +.section __ex_table,"a";\ 46.131 + .align 4; \ 46.132 + .long 1b,4b; \ 46.133 + .long 2b,5b; \ 46.134 + .long 3b,6b; \ 46.135 +.previous 46.136 + 46.137 +#define GET_CURRENT(reg) \ 46.138 + movl $-8192, reg; \ 46.139 + andl %esp, reg 46.140 + 46.141 +ENTRY(lcall7) 46.142 + pushfl # We get a different stack layout with call 46.143 + pushl %eax # gates, which has to be cleaned up later.. 46.144 + SAVE_ALL 46.145 + movl EIP(%esp),%eax # due to call gates, this is eflags, not eip.. 46.146 + movl CS(%esp),%edx # this is eip.. 46.147 + movl EFLAGS(%esp),%ecx # and this is cs.. 46.148 + movl %eax,EFLAGS(%esp) # 46.149 + andl $~(NT_MASK|TF_MASK|DF_MASK), %eax 46.150 + pushl %eax 46.151 + popfl 46.152 + movl %edx,EIP(%esp) # Now we move them to their "normal" places 46.153 + movl %ecx,CS(%esp) # 46.154 + movl %esp,%ebx 46.155 + pushl %ebx 46.156 + andl $-8192,%ebx # GET_CURRENT 46.157 + movl exec_domain(%ebx),%edx # Get the execution domain 46.158 + movl 4(%edx),%edx # Get the lcall7 handler for the domain 46.159 + pushl $0x7 46.160 + call *%edx 46.161 + addl $4, %esp 46.162 + popl %eax 46.163 + jmp ret_to_user 46.164 + 46.165 +ENTRY(lcall27) 46.166 + pushfl # We get a different stack layout with call 46.167 + pushl %eax # gates, which has to be cleaned up later.. 46.168 + SAVE_ALL 46.169 + movl EIP(%esp),%eax # due to call gates, this is eflags, not eip.. 46.170 + movl CS(%esp),%edx # this is eip.. 46.171 + movl EFLAGS(%esp),%ecx # and this is cs.. 46.172 + movl %eax,EFLAGS(%esp) # 46.173 + andl $~(NT_MASK|TF_MASK|DF_MASK), %eax 46.174 + pushl %eax 46.175 + popfl 46.176 + movl %edx,EIP(%esp) # Now we move them to their "normal" places 46.177 + movl %ecx,CS(%esp) # 46.178 + movl %esp,%ebx 46.179 + pushl %ebx 46.180 + andl $-8192,%ebx # GET_CURRENT 46.181 + movl exec_domain(%ebx),%edx # Get the execution domain 46.182 + movl 4(%edx),%edx # Get the lcall7 handler for the domain 46.183 + pushl $0x27 46.184 + call *%edx 46.185 + addl $4, %esp 46.186 + popl %eax 46.187 + jmp ret_to_user 46.188 + 46.189 +ENTRY(ret_from_fork) 46.190 + pushl %ebx 46.191 + call SYMBOL_NAME(schedule_tail) 46.192 + addl $4, %esp 46.193 + GET_CURRENT(%ebx) 46.194 + testb $0x02,tsk_ptrace(%ebx) # PT_TRACESYS 46.195 + jne tracesys_exit 46.196 + jmp ret_to_user 46.197 + 46.198 +/* 46.199 + * Return to user mode is not as complex as all this looks, 46.200 + * but we want the default path for a system call return to 46.201 + * go as quickly as possible which is why some of this is 46.202 + * less clear than it otherwise should be. 46.203 + */ 46.204 +ENTRY(system_call) 46.205 + pushl %eax # save orig_eax 46.206 + SAVE_ALL 46.207 + GET_CURRENT(%ebx) 46.208 + testb $0x02,tsk_ptrace(%ebx) # PT_TRACESYS 46.209 + jne tracesys 46.210 + cmpl $(NR_syscalls),%eax 46.211 + jae badsys 46.212 + call *SYMBOL_NAME(sys_call_table)(,%eax,4) 46.213 + movl %eax,EAX(%esp) # save the return value 46.214 +ret_to_user: 46.215 + movl SYMBOL_NAME(HYPERVISOR_shared_info),%esi 46.216 + movb $1,evtchn_upcall_mask(%esi) # make tests atomic 46.217 +ret_to_user_nocli: 46.218 + cmpl $0,need_resched(%ebx) 46.219 + jne reschedule 46.220 + cmpl $0,sigpending(%ebx) 46.221 + je safesti # ensure need_resched updates are seen 46.222 +/*signal_return:*/ 46.223 + movb $0,evtchn_upcall_mask(%esi) # reenable event callbacks 46.224 + movl %esp,%eax 46.225 + xorl %edx,%edx 46.226 + call SYMBOL_NAME(do_signal) 46.227 + jmp safesti 46.228 + 46.229 + ALIGN 46.230 +restore_all: 46.231 + RESTORE_ALL 46.232 + 46.233 + ALIGN 46.234 +tracesys: 46.235 + movl $-ENOSYS,EAX(%esp) 46.236 + call SYMBOL_NAME(syscall_trace) 46.237 + movl ORIG_EAX(%esp),%eax 46.238 + cmpl $(NR_syscalls),%eax 46.239 + jae tracesys_exit 46.240 + call *SYMBOL_NAME(sys_call_table)(,%eax,4) 46.241 + movl %eax,EAX(%esp) # save the return value 46.242 +tracesys_exit: 46.243 + call SYMBOL_NAME(syscall_trace) 46.244 + jmp ret_to_user 46.245 +badsys: 46.246 + movl $-ENOSYS,EAX(%esp) 46.247 + jmp ret_to_user 46.248 + 46.249 + ALIGN 46.250 +ENTRY(ret_from_intr) 46.251 + GET_CURRENT(%ebx) 46.252 +ret_from_exception: 46.253 + movb CS(%esp),%al 46.254 + testl $2,%eax 46.255 + jne ret_to_user 46.256 + jmp restore_all 46.257 + 46.258 + ALIGN 46.259 +reschedule: 46.260 + movb $0,evtchn_upcall_mask(%esi) # reenable event callbacks 46.261 + call SYMBOL_NAME(schedule) # test 46.262 + jmp ret_to_user 46.263 + 46.264 +ENTRY(divide_error) 46.265 + pushl $0 # no error code 46.266 + pushl $ SYMBOL_NAME(do_divide_error) 46.267 + ALIGN 46.268 +error_code: 46.269 + pushl %ds 46.270 + pushl %eax 46.271 + xorl %eax,%eax 46.272 + pushl %ebp 46.273 + pushl %edi 46.274 + pushl %esi 46.275 + pushl %edx 46.276 + decl %eax # eax = -1 46.277 + pushl %ecx 46.278 + pushl %ebx 46.279 + GET_CURRENT(%ebx) 46.280 + cld 46.281 + movl %es,%ecx 46.282 + movl ORIG_EAX(%esp), %esi # get the error code 46.283 + movl ES(%esp), %edi # get the function address 46.284 + movl %eax, ORIG_EAX(%esp) 46.285 + movl %ecx, ES(%esp) 46.286 + movl %esp,%edx 46.287 + pushl %esi # push the error code 46.288 + pushl %edx # push the pt_regs pointer 46.289 + movl $(__KERNEL_DS),%edx 46.290 + movl %edx,%ds 46.291 + movl %edx,%es 46.292 + call *%edi 46.293 + addl $8,%esp 46.294 + jmp ret_from_exception 46.295 + 46.296 +# A note on the "critical region" in our callback handler. 46.297 +# We want to avoid stacking callback handlers due to events occurring 46.298 +# during handling of the last event. To do this, we keep events disabled 46.299 +# until we've done all processing. HOWEVER, we must enable events before 46.300 +# popping the stack frame (can't be done atomically) and so it would still 46.301 +# be possible to get enough handler activations to overflow the stack. 46.302 +# Although unlikely, bugs of that kind are hard to track down, so we'd 46.303 +# like to avoid the possibility. 46.304 +# So, on entry to the handler we detect whether we interrupted an 46.305 +# existing activation in its critical region -- if so, we pop the current 46.306 +# activation and restart the handler using the previous one. 46.307 +ENTRY(hypervisor_callback) 46.308 + pushl %eax 46.309 + SAVE_ALL 46.310 + GET_CURRENT(%ebx) 46.311 + movl EIP(%esp),%eax 46.312 + cmpl $scrit,%eax 46.313 + jb 11f 46.314 + cmpl $ecrit,%eax 46.315 + jb critical_region_fixup 46.316 +11: push %esp 46.317 + call evtchn_do_upcall 46.318 + add $4,%esp 46.319 + movl SYMBOL_NAME(HYPERVISOR_shared_info),%esi 46.320 + movb CS(%esp),%cl 46.321 + test $2,%cl # slow return to ring 2 or 3 46.322 + jne ret_to_user_nocli 46.323 +safesti:movb $0,evtchn_upcall_mask(%esi) # reenable event callbacks 46.324 +scrit: /**** START OF CRITICAL REGION ****/ 46.325 + testb $0xFF,evtchn_upcall_pending(%esi) 46.326 + jnz 14f # process more events if necessary... 46.327 + RESTORE_ALL 46.328 +14: movb $1,evtchn_upcall_mask(%esi) 46.329 + jmp 11b 46.330 +ecrit: /**** END OF CRITICAL REGION ****/ 46.331 +# [How we do the fixup]. We want to merge the current stack frame with the 46.332 +# just-interrupted frame. How we do this depends on where in the critical 46.333 +# region the interrupted handler was executing, and so how many saved 46.334 +# registers are in each frame. We do this quickly using the lookup table 46.335 +# 'critical_fixup_table'. For each byte offset in the critical region, it 46.336 +# provides the number of bytes which have already been popped from the 46.337 +# interrupted stack frame. 46.338 +critical_region_fixup: 46.339 + addl $critical_fixup_table-scrit,%eax 46.340 + movzbl (%eax),%eax # %eax contains num bytes popped 46.341 + mov %esp,%esi 46.342 + add %eax,%esi # %esi points at end of src region 46.343 + mov %esp,%edi 46.344 + add $0x34,%edi # %edi points at end of dst region 46.345 + mov %eax,%ecx 46.346 + shr $2,%ecx # convert words to bytes 46.347 + je 16f # skip loop if nothing to copy 46.348 +15: subl $4,%esi # pre-decrementing copy loop 46.349 + subl $4,%edi 46.350 + movl (%esi),%eax 46.351 + movl %eax,(%edi) 46.352 + loop 15b 46.353 +16: movl %edi,%esp # final %edi is top of merged stack 46.354 + jmp 11b 46.355 + 46.356 +critical_fixup_table: 46.357 + .byte 0x00,0x00,0x00 # testb $0xFF,(%esi) 46.358 + .byte 0x00,0x00 # jnz 14f 46.359 + .byte 0x00 # pop %ebx 46.360 + .byte 0x04 # pop %ecx 46.361 + .byte 0x08 # pop %edx 46.362 + .byte 0x0c # pop %esi 46.363 + .byte 0x10 # pop %edi 46.364 + .byte 0x14 # pop %ebp 46.365 + .byte 0x18 # pop %eax 46.366 + .byte 0x1c # pop %ds 46.367 + .byte 0x20 # pop %es 46.368 + .byte 0x24,0x24,0x24 # add $4,%esp 46.369 + .byte 0x28 # iret 46.370 + .byte 0x00,0x00,0x00,0x00 # movb $1,4(%esi) 46.371 + .byte 0x00,0x00 # jmp 11b 46.372 + 46.373 +# Hypervisor uses this for application faults while it executes. 46.374 +ENTRY(failsafe_callback) 46.375 +1: popl %ds 46.376 +2: popl %es 46.377 +3: popl %fs 46.378 +4: popl %gs 46.379 +5: iret 46.380 +.section .fixup,"ax"; \ 46.381 +6: movl $0,(%esp); \ 46.382 + jmp 1b; \ 46.383 +7: movl $0,(%esp); \ 46.384 + jmp 2b; \ 46.385 +8: movl $0,(%esp); \ 46.386 + jmp 3b; \ 46.387 +9: movl $0,(%esp); \ 46.388 + jmp 4b; \ 46.389 +10: pushl %ss; \ 46.390 + popl %ds; \ 46.391 + pushl %ss; \ 46.392 + popl %es; \ 46.393 + pushl $11; \ 46.394 + call do_exit; \ 46.395 +.previous; \ 46.396 +.section __ex_table,"a";\ 46.397 + .align 4; \ 46.398 + .long 1b,6b; \ 46.399 + .long 2b,7b; \ 46.400 + .long 3b,8b; \ 46.401 + .long 4b,9b; \ 46.402 + .long 5b,10b; \ 46.403 +.previous 46.404 + 46.405 +ENTRY(coprocessor_error) 46.406 + pushl $0 46.407 + pushl $ SYMBOL_NAME(do_coprocessor_error) 46.408 + jmp error_code 46.409 + 46.410 +ENTRY(simd_coprocessor_error) 46.411 + pushl $0 46.412 + pushl $ SYMBOL_NAME(do_simd_coprocessor_error) 46.413 + jmp error_code 46.414 + 46.415 +ENTRY(device_not_available) 46.416 + pushl $-1 # mark this as an int 46.417 + SAVE_ALL 46.418 + GET_CURRENT(%ebx) 46.419 + call SYMBOL_NAME(math_state_restore) 46.420 + jmp ret_from_exception 46.421 + 46.422 +ENTRY(debug) 46.423 + pushl $0 46.424 + pushl $ SYMBOL_NAME(do_debug) 46.425 + jmp error_code 46.426 + 46.427 +ENTRY(int3) 46.428 + pushl $0 46.429 + pushl $ SYMBOL_NAME(do_int3) 46.430 + jmp error_code 46.431 + 46.432 +ENTRY(overflow) 46.433 + pushl $0 46.434 + pushl $ SYMBOL_NAME(do_overflow) 46.435 + jmp error_code 46.436 + 46.437 +ENTRY(bounds) 46.438 + pushl $0 46.439 + pushl $ SYMBOL_NAME(do_bounds) 46.440 + jmp error_code 46.441 + 46.442 +ENTRY(invalid_op) 46.443 + pushl $0 46.444 + pushl $ SYMBOL_NAME(do_invalid_op) 46.445 + jmp error_code 46.446 + 46.447 +ENTRY(coprocessor_segment_overrun) 46.448 + pushl $0 46.449 + pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun) 46.450 + jmp error_code 46.451 + 46.452 +ENTRY(double_fault) 46.453 + pushl $ SYMBOL_NAME(do_double_fault) 46.454 + jmp error_code 46.455 + 46.456 +ENTRY(invalid_TSS) 46.457 + pushl $ SYMBOL_NAME(do_invalid_TSS) 46.458 + jmp error_code 46.459 + 46.460 +ENTRY(segment_not_present) 46.461 + pushl $ SYMBOL_NAME(do_segment_not_present) 46.462 + jmp error_code 46.463 + 46.464 +ENTRY(stack_segment) 46.465 + pushl $ SYMBOL_NAME(do_stack_segment) 46.466 + jmp error_code 46.467 + 46.468 +ENTRY(general_protection) 46.469 + pushl $ SYMBOL_NAME(do_general_protection) 46.470 + jmp error_code 46.471 + 46.472 +ENTRY(alignment_check) 46.473 + pushl $ SYMBOL_NAME(do_alignment_check) 46.474 + jmp error_code 46.475 + 46.476 +# This handler is special, because it gets an extra value on its stack, 46.477 +# which is the linear faulting address. 46.478 +#define PAGE_FAULT_STUB(_name1, _name2) \ 46.479 +ENTRY(_name1) \ 46.480 + pushl %ds ; \ 46.481 + pushl %eax ; \ 46.482 + xorl %eax,%eax ; \ 46.483 + pushl %ebp ; \ 46.484 + pushl %edi ; \ 46.485 + pushl %esi ; \ 46.486 + pushl %edx ; \ 46.487 + decl %eax /* eax = -1 */ ; \ 46.488 + pushl %ecx ; \ 46.489 + pushl %ebx ; \ 46.490 + GET_CURRENT(%ebx) ; \ 46.491 + cld ; \ 46.492 + movl %es,%ecx ; \ 46.493 + movl ORIG_EAX(%esp), %esi /* get the error code */ ; \ 46.494 + movl ES(%esp), %edi /* get the faulting address */ ; \ 46.495 + movl %eax, ORIG_EAX(%esp) ; \ 46.496 + movl %ecx, ES(%esp) ; \ 46.497 + movl %esp,%edx ; \ 46.498 + pushl %edi /* push the faulting address */ ; \ 46.499 + pushl %esi /* push the error code */ ; \ 46.500 + pushl %edx /* push the pt_regs pointer */ ; \ 46.501 + movl $(__KERNEL_DS),%edx ; \ 46.502 + movl %edx,%ds ; \ 46.503 + movl %edx,%es ; \ 46.504 + call SYMBOL_NAME(_name2) ; \ 46.505 + addl $12,%esp ; \ 46.506 + jmp ret_from_exception ; 46.507 +PAGE_FAULT_STUB(page_fault, do_page_fault) 46.508 + 46.509 +ENTRY(machine_check) 46.510 + pushl $0 46.511 + pushl $ SYMBOL_NAME(do_machine_check) 46.512 + jmp error_code 46.513 + 46.514 +ENTRY(fixup_4gb_segment) 46.515 + pushl $ SYMBOL_NAME(do_fixup_4gb_segment) 46.516 + jmp error_code 46.517 + 46.518 +.data 46.519 +ENTRY(sys_call_table) 46.520 + .long SYMBOL_NAME(sys_ni_syscall) /* 0 - old "setup()" system call*/ 46.521 + .long SYMBOL_NAME(sys_exit) 46.522 + .long SYMBOL_NAME(sys_fork) 46.523 + .long SYMBOL_NAME(sys_read) 46.524 + .long SYMBOL_NAME(sys_write) 46.525 + .long SYMBOL_NAME(sys_open) /* 5 */ 46.526 + .long SYMBOL_NAME(sys_close) 46.527 + .long SYMBOL_NAME(sys_waitpid) 46.528 + .long SYMBOL_NAME(sys_creat) 46.529 + .long SYMBOL_NAME(sys_link) 46.530 + .long SYMBOL_NAME(sys_unlink) /* 10 */ 46.531 + .long SYMBOL_NAME(sys_execve) 46.532 + .long SYMBOL_NAME(sys_chdir) 46.533 + .long SYMBOL_NAME(sys_time) 46.534 + .long SYMBOL_NAME(sys_mknod) 46.535 + .long SYMBOL_NAME(sys_chmod) /* 15 */ 46.536 + .long SYMBOL_NAME(sys_lchown16) 46.537 + .long SYMBOL_NAME(sys_ni_syscall) /* old break syscall holder */ 46.538 + .long SYMBOL_NAME(sys_stat) 46.539 + .long SYMBOL_NAME(sys_lseek) 46.540 + .long SYMBOL_NAME(sys_getpid) /* 20 */ 46.541 + .long SYMBOL_NAME(sys_mount) 46.542 + .long SYMBOL_NAME(sys_oldumount) 46.543 + .long SYMBOL_NAME(sys_setuid16) 46.544 + .long SYMBOL_NAME(sys_getuid16) 46.545 + .long SYMBOL_NAME(sys_stime) /* 25 */ 46.546 + .long SYMBOL_NAME(sys_ptrace) 46.547 + .long SYMBOL_NAME(sys_alarm) 46.548 + .long SYMBOL_NAME(sys_fstat) 46.549 + .long SYMBOL_NAME(sys_pause) 46.550 + .long SYMBOL_NAME(sys_utime) /* 30 */ 46.551 + .long SYMBOL_NAME(sys_ni_syscall) /* old stty syscall holder */ 46.552 + .long SYMBOL_NAME(sys_ni_syscall) /* old gtty syscall holder */ 46.553 + .long SYMBOL_NAME(sys_access) 46.554 + .long SYMBOL_NAME(sys_nice) 46.555 + .long SYMBOL_NAME(sys_ni_syscall) /* 35 */ /* old ftime syscall holder */ 46.556 + .long SYMBOL_NAME(sys_sync) 46.557 + .long SYMBOL_NAME(sys_kill) 46.558 + .long SYMBOL_NAME(sys_rename) 46.559 + .long SYMBOL_NAME(sys_mkdir) 46.560 + .long SYMBOL_NAME(sys_rmdir) /* 40 */ 46.561 + .long SYMBOL_NAME(sys_dup) 46.562 + .long SYMBOL_NAME(sys_pipe) 46.563 + .long SYMBOL_NAME(sys_times) 46.564 + .long SYMBOL_NAME(sys_ni_syscall) /* old prof syscall holder */ 46.565 + .long SYMBOL_NAME(sys_brk) /* 45 */ 46.566 + .long SYMBOL_NAME(sys_setgid16) 46.567 + .long SYMBOL_NAME(sys_getgid16) 46.568 + .long SYMBOL_NAME(sys_signal) 46.569 + .long SYMBOL_NAME(sys_geteuid16) 46.570 + .long SYMBOL_NAME(sys_getegid16) /* 50 */ 46.571 + .long SYMBOL_NAME(sys_acct) 46.572 + .long SYMBOL_NAME(sys_umount) /* recycled never used phys() */ 46.573 + .long SYMBOL_NAME(sys_ni_syscall) /* old lock syscall holder */ 46.574 + .long SYMBOL_NAME(sys_ioctl) 46.575 + .long SYMBOL_NAME(sys_fcntl) /* 55 */ 46.576 + .long SYMBOL_NAME(sys_ni_syscall) /* old mpx syscall holder */ 46.577 + .long SYMBOL_NAME(sys_setpgid) 46.578 + .long SYMBOL_NAME(sys_ni_syscall) /* old ulimit syscall holder */ 46.579 + .long SYMBOL_NAME(sys_olduname) 46.580 + .long SYMBOL_NAME(sys_umask) /* 60 */ 46.581 + .long SYMBOL_NAME(sys_chroot) 46.582 + .long SYMBOL_NAME(sys_ustat) 46.583 + .long SYMBOL_NAME(sys_dup2) 46.584 + .long SYMBOL_NAME(sys_getppid) 46.585 + .long SYMBOL_NAME(sys_getpgrp) /* 65 */ 46.586 + .long SYMBOL_NAME(sys_setsid) 46.587 + .long SYMBOL_NAME(sys_sigaction) 46.588 + .long SYMBOL_NAME(sys_sgetmask) 46.589 + .long SYMBOL_NAME(sys_ssetmask) 46.590 + .long SYMBOL_NAME(sys_setreuid16) /* 70 */ 46.591 + .long SYMBOL_NAME(sys_setregid16) 46.592 + .long SYMBOL_NAME(sys_sigsuspend) 46.593 + .long SYMBOL_NAME(sys_sigpending) 46.594 + .long SYMBOL_NAME(sys_sethostname) 46.595 + .long SYMBOL_NAME(sys_setrlimit) /* 75 */ 46.596 + .long SYMBOL_NAME(sys_old_getrlimit) 46.597 + .long SYMBOL_NAME(sys_getrusage) 46.598 + .long SYMBOL_NAME(sys_gettimeofday) 46.599 + .long SYMBOL_NAME(sys_settimeofday) 46.600 + .long SYMBOL_NAME(sys_getgroups16) /* 80 */ 46.601 + .long SYMBOL_NAME(sys_setgroups16) 46.602 + .long SYMBOL_NAME(old_select) 46.603 + .long SYMBOL_NAME(sys_symlink) 46.604 + .long SYMBOL_NAME(sys_lstat) 46.605 + .long SYMBOL_NAME(sys_readlink) /* 85 */ 46.606 + .long SYMBOL_NAME(sys_uselib) 46.607 + .long SYMBOL_NAME(sys_swapon) 46.608 + .long SYMBOL_NAME(sys_reboot) 46.609 + .long SYMBOL_NAME(old_readdir) 46.610 + .long SYMBOL_NAME(old_mmap) /* 90 */ 46.611 + .long SYMBOL_NAME(sys_munmap) 46.612 + .long SYMBOL_NAME(sys_truncate) 46.613 + .long SYMBOL_NAME(sys_ftruncate) 46.614 + .long SYMBOL_NAME(sys_fchmod) 46.615 + .long SYMBOL_NAME(sys_fchown16) /* 95 */ 46.616 + .long SYMBOL_NAME(sys_getpriority) 46.617 + .long SYMBOL_NAME(sys_setpriority) 46.618 + .long SYMBOL_NAME(sys_ni_syscall) /* old profil syscall holder */ 46.619 + .long SYMBOL_NAME(sys_statfs) 46.620 + .long SYMBOL_NAME(sys_fstatfs) /* 100 */ 46.621 + .long SYMBOL_NAME(sys_ioperm) 46.622 + .long SYMBOL_NAME(sys_socketcall) 46.623 + .long SYMBOL_NAME(sys_syslog) 46.624 + .long SYMBOL_NAME(sys_setitimer) 46.625 + .long SYMBOL_NAME(sys_getitimer) /* 105 */ 46.626 + .long SYMBOL_NAME(sys_newstat) 46.627 + .long SYMBOL_NAME(sys_newlstat) 46.628 + .long SYMBOL_NAME(sys_newfstat) 46.629 + .long SYMBOL_NAME(sys_uname) 46.630 + .long SYMBOL_NAME(sys_iopl) /* 110 */ 46.631 + .long SYMBOL_NAME(sys_vhangup) 46.632 + .long SYMBOL_NAME(sys_ni_syscall) /* old "idle" system call */ 46.633 + .long SYMBOL_NAME(sys_ni_syscall) /* was VM86 */ 46.634 + .long SYMBOL_NAME(sys_wait4) 46.635 + .long SYMBOL_NAME(sys_swapoff) /* 115 */ 46.636 + .long SYMBOL_NAME(sys_sysinfo) 46.637 + .long SYMBOL_NAME(sys_ipc) 46.638 + .long SYMBOL_NAME(sys_fsync) 46.639 + .long SYMBOL_NAME(sys_sigreturn) 46.640 + .long SYMBOL_NAME(sys_clone) /* 120 */ 46.641 + .long SYMBOL_NAME(sys_setdomainname) 46.642 + .long SYMBOL_NAME(sys_newuname) 46.643 + .long SYMBOL_NAME(sys_modify_ldt) 46.644 + .long SYMBOL_NAME(sys_adjtimex) 46.645 + .long SYMBOL_NAME(sys_mprotect) /* 125 */ 46.646 + .long SYMBOL_NAME(sys_sigprocmask) 46.647 + .long SYMBOL_NAME(sys_create_module) 46.648 + .long SYMBOL_NAME(sys_init_module) 46.649 + .long SYMBOL_NAME(sys_delete_module) 46.650 + .long SYMBOL_NAME(sys_get_kernel_syms) /* 130 */ 46.651 + .long SYMBOL_NAME(sys_quotactl) 46.652 + .long SYMBOL_NAME(sys_getpgid) 46.653 + .long SYMBOL_NAME(sys_fchdir) 46.654 + .long SYMBOL_NAME(sys_bdflush) 46.655 + .long SYMBOL_NAME(sys_sysfs) /* 135 */ 46.656 + .long SYMBOL_NAME(sys_personality) 46.657 + .long SYMBOL_NAME(sys_ni_syscall) /* for afs_syscall */ 46.658 + .long SYMBOL_NAME(sys_setfsuid16) 46.659 + .long SYMBOL_NAME(sys_setfsgid16) 46.660 + .long SYMBOL_NAME(sys_llseek) /* 140 */ 46.661 + .long SYMBOL_NAME(sys_getdents) 46.662 + .long SYMBOL_NAME(sys_select) 46.663 + .long SYMBOL_NAME(sys_flock) 46.664 + .long SYMBOL_NAME(sys_msync) 46.665 + .long SYMBOL_NAME(sys_readv) /* 145 */ 46.666 + .long SYMBOL_NAME(sys_writev) 46.667 + .long SYMBOL_NAME(sys_getsid) 46.668 + .long SYMBOL_NAME(sys_fdatasync) 46.669 + .long SYMBOL_NAME(sys_sysctl) 46.670 + .long SYMBOL_NAME(sys_mlock) /* 150 */ 46.671 + .long SYMBOL_NAME(sys_munlock) 46.672 + .long SYMBOL_NAME(sys_mlockall) 46.673 + .long SYMBOL_NAME(sys_munlockall) 46.674 + .long SYMBOL_NAME(sys_sched_setparam) 46.675 + .long SYMBOL_NAME(sys_sched_getparam) /* 155 */ 46.676 + .long SYMBOL_NAME(sys_sched_setscheduler) 46.677 + .long SYMBOL_NAME(sys_sched_getscheduler) 46.678 + .long SYMBOL_NAME(sys_sched_yield) 46.679 + .long SYMBOL_NAME(sys_sched_get_priority_max) 46.680 + .long SYMBOL_NAME(sys_sched_get_priority_min) /* 160 */ 46.681 + .long SYMBOL_NAME(sys_sched_rr_get_interval) 46.682 + .long SYMBOL_NAME(sys_nanosleep) 46.683 + .long SYMBOL_NAME(sys_mremap) 46.684 + .long SYMBOL_NAME(sys_setresuid16) 46.685 + .long SYMBOL_NAME(sys_getresuid16) /* 165 */ 46.686 + .long SYMBOL_NAME(sys_ni_syscall) /* was VM86 */ 46.687 + .long SYMBOL_NAME(sys_query_module) 46.688 + .long SYMBOL_NAME(sys_poll) 46.689 + .long SYMBOL_NAME(sys_nfsservctl) 46.690 + .long SYMBOL_NAME(sys_setresgid16) /* 170 */ 46.691 + .long SYMBOL_NAME(sys_getresgid16) 46.692 + .long SYMBOL_NAME(sys_prctl) 46.693 + .long SYMBOL_NAME(sys_rt_sigreturn) 46.694 + .long SYMBOL_NAME(sys_rt_sigaction) 46.695 + .long SYMBOL_NAME(sys_rt_sigprocmask) /* 175 */ 46.696 + .long SYMBOL_NAME(sys_rt_sigpending) 46.697 + .long SYMBOL_NAME(sys_rt_sigtimedwait) 46.698 + .long SYMBOL_NAME(sys_rt_sigqueueinfo) 46.699 + .long SYMBOL_NAME(sys_rt_sigsuspend) 46.700 + .long SYMBOL_NAME(sys_pread) /* 180 */ 46.701 + .long SYMBOL_NAME(sys_pwrite) 46.702 + .long SYMBOL_NAME(sys_chown16) 46.703 + .long SYMBOL_NAME(sys_getcwd) 46.704 + .long SYMBOL_NAME(sys_capget) 46.705 + .long SYMBOL_NAME(sys_capset) /* 185 */ 46.706 + .long SYMBOL_NAME(sys_sigaltstack) 46.707 + .long SYMBOL_NAME(sys_sendfile) 46.708 + .long SYMBOL_NAME(sys_ni_syscall) /* streams1 */ 46.709 + .long SYMBOL_NAME(sys_ni_syscall) /* streams2 */ 46.710 + .long SYMBOL_NAME(sys_vfork) /* 190 */ 46.711 + .long SYMBOL_NAME(sys_getrlimit) 46.712 + .long SYMBOL_NAME(sys_mmap2) 46.713 + .long SYMBOL_NAME(sys_truncate64) 46.714 + .long SYMBOL_NAME(sys_ftruncate64) 46.715 + .long SYMBOL_NAME(sys_stat64) /* 195 */ 46.716 + .long SYMBOL_NAME(sys_lstat64) 46.717 + .long SYMBOL_NAME(sys_fstat64) 46.718 + .long SYMBOL_NAME(sys_lchown) 46.719 + .long SYMBOL_NAME(sys_getuid) 46.720 + .long SYMBOL_NAME(sys_getgid) /* 200 */ 46.721 + .long SYMBOL_NAME(sys_geteuid) 46.722 + .long SYMBOL_NAME(sys_getegid) 46.723 + .long SYMBOL_NAME(sys_setreuid) 46.724 + .long SYMBOL_NAME(sys_setregid) 46.725 + .long SYMBOL_NAME(sys_getgroups) /* 205 */ 46.726 + .long SYMBOL_NAME(sys_setgroups) 46.727 + .long SYMBOL_NAME(sys_fchown) 46.728 + .long SYMBOL_NAME(sys_setresuid) 46.729 + .long SYMBOL_NAME(sys_getresuid) 46.730 + .long SYMBOL_NAME(sys_setresgid) /* 210 */ 46.731 + .long SYMBOL_NAME(sys_getresgid) 46.732 + .long SYMBOL_NAME(sys_chown) 46.733 + .long SYMBOL_NAME(sys_setuid) 46.734 + .long SYMBOL_NAME(sys_setgid) 46.735 + .long SYMBOL_NAME(sys_setfsuid) /* 215 */ 46.736 + .long SYMBOL_NAME(sys_setfsgid) 46.737 + .long SYMBOL_NAME(sys_pivot_root) 46.738 + .long SYMBOL_NAME(sys_mincore) 46.739 + .long SYMBOL_NAME(sys_madvise) 46.740 + .long SYMBOL_NAME(sys_getdents64) /* 220 */ 46.741 + .long SYMBOL_NAME(sys_fcntl64) 46.742 + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for TUX */ 46.743 + .long SYMBOL_NAME(sys_ni_syscall) /* Reserved for Security */ 46.744 + .long SYMBOL_NAME(sys_gettid) 46.745 + .long SYMBOL_NAME(sys_readahead) /* 225 */ 46.746 + .long SYMBOL_NAME(sys_setxattr) 46.747 + .long SYMBOL_NAME(sys_lsetxattr) 46.748 + .long SYMBOL_NAME(sys_fsetxattr) 46.749 + .long SYMBOL_NAME(sys_getxattr) 46.750 + .long SYMBOL_NAME(sys_lgetxattr) /* 230 */ 46.751 + .long SYMBOL_NAME(sys_fgetxattr) 46.752 + .long SYMBOL_NAME(sys_listxattr) 46.753 + .long SYMBOL_NAME(sys_llistxattr) 46.754 + .long SYMBOL_NAME(sys_flistxattr) 46.755 + .long SYMBOL_NAME(sys_removexattr) /* 235 */ 46.756 + .long SYMBOL_NAME(sys_lremovexattr) 46.757 + .long SYMBOL_NAME(sys_fremovexattr) 46.758 + .long SYMBOL_NAME(sys_tkill) 46.759 + .long SYMBOL_NAME(sys_sendfile64) 46.760 + .long SYMBOL_NAME(sys_ni_syscall) /* 240 reserved for futex */ 46.761 + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sched_setaffinity */ 46.762 + .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sched_getaffinity */ 46.763 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_set_thread_area */ 46.764 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_get_thread_area */ 46.765 + .long SYMBOL_NAME(sys_ni_syscall) /* 245 sys_io_setup */ 46.766 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_io_destroy */ 46.767 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_io_getevents */ 46.768 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_io_submit */ 46.769 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_io_cancel */ 46.770 + .long SYMBOL_NAME(sys_ni_syscall) /* 250 sys_alloc_hugepages */ 46.771 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_free_hugepages */ 46.772 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_exit_group */ 46.773 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_lookup_dcookie */ 46.774 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_create */ 46.775 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_ctl 255 */ 46.776 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_wait */ 46.777 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_remap_file_pages */ 46.778 + .long SYMBOL_NAME(sys_ni_syscall) /* sys_set_tid_address */ 46.779 + 46.780 + .rept NR_syscalls-(.-sys_call_table)/4 46.781 + .long SYMBOL_NAME(sys_ni_syscall) 46.782 + .endr
47.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 47.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/head.S Fri Jul 15 06:39:50 2005 -0700 47.3 @@ -0,0 +1,41 @@ 47.4 + 47.5 +.section __xen_guest 47.6 + .ascii "GUEST_OS=linux,GUEST_VER=2.4,XEN_VER=3.0,VIRT_BASE=0xC0000000" 47.7 + .ascii ",LOADER=generic" 47.8 + .byte 0 47.9 + 47.10 +.text 47.11 +#include <linux/config.h> 47.12 +#include <linux/threads.h> 47.13 +#include <linux/linkage.h> 47.14 +#include <asm/segment.h> 47.15 +#include <asm/page.h> 47.16 +#include <asm/pgtable.h> 47.17 +#include <asm/desc.h> 47.18 + 47.19 +ENTRY(stext) 47.20 +ENTRY(_stext) 47.21 + cld 47.22 + lss stack_start,%esp 47.23 + /* Copy the necessary stuff from xen_start_info structure. */ 47.24 + mov $SYMBOL_NAME(xen_start_info_union),%edi 47.25 + mov $128,%ecx 47.26 + rep movsl 47.27 + jmp SYMBOL_NAME(start_kernel) 47.28 + 47.29 +ENTRY(stack_start) 47.30 + .long SYMBOL_NAME(init_task_union)+8192, __KERNEL_DS 47.31 + 47.32 +.org 0x1000 47.33 +ENTRY(empty_zero_page) 47.34 + 47.35 +.org 0x2000 47.36 +ENTRY(default_ldt) 47.37 + 47.38 +.org 0x3000 47.39 +ENTRY(cpu0_pte_quicklist) 47.40 + 47.41 +.org 0x3400 47.42 +ENTRY(cpu0_pgd_quicklist) 47.43 + 47.44 +.org 0x3800
48.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 48.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/i386_ksyms.c Fri Jul 15 06:39:50 2005 -0700 48.3 @@ -0,0 +1,180 @@ 48.4 +#include <linux/config.h> 48.5 +#include <linux/module.h> 48.6 +#include <linux/smp.h> 48.7 +#include <linux/user.h> 48.8 +#include <linux/elfcore.h> 48.9 +#include <linux/mca.h> 48.10 +#include <linux/sched.h> 48.11 +#include <linux/in6.h> 48.12 +#include <linux/interrupt.h> 48.13 +#include <linux/smp_lock.h> 48.14 +#include <linux/pm.h> 48.15 +#include <linux/pci.h> 48.16 +#include <linux/apm_bios.h> 48.17 +#include <linux/kernel.h> 48.18 +#include <linux/string.h> 48.19 +#include <linux/tty.h> 48.20 + 48.21 +#include <asm/semaphore.h> 48.22 +#include <asm/processor.h> 48.23 +#include <asm/i387.h> 48.24 +#include <asm/uaccess.h> 48.25 +#include <asm/checksum.h> 48.26 +#include <asm/io.h> 48.27 +#include <asm/hardirq.h> 48.28 +#include <asm/delay.h> 48.29 +#include <asm/irq.h> 48.30 +#include <asm/mmx.h> 48.31 +#include <asm/desc.h> 48.32 +#include <asm/pgtable.h> 48.33 +#include <asm/pgalloc.h> 48.34 + 48.35 +extern void dump_thread(struct pt_regs *, struct user *); 48.36 +extern spinlock_t rtc_lock; 48.37 + 48.38 +#if defined(CONFIG_APMXXX) || defined(CONFIG_APM_MODULEXXX) 48.39 +extern void machine_real_restart(unsigned char *, int); 48.40 +EXPORT_SYMBOL(machine_real_restart); 48.41 +extern void default_idle(void); 48.42 +EXPORT_SYMBOL(default_idle); 48.43 +#endif 48.44 + 48.45 +#ifdef CONFIG_SMP 48.46 +extern void FASTCALL( __write_lock_failed(rwlock_t *rw)); 48.47 +extern void FASTCALL( __read_lock_failed(rwlock_t *rw)); 48.48 +#endif 48.49 + 48.50 +#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE) 48.51 +extern struct drive_info_struct drive_info; 48.52 +EXPORT_SYMBOL(drive_info); 48.53 +#endif 48.54 + 48.55 +// XXX extern unsigned long get_cmos_time(void); 48.56 + 48.57 +/* platform dependent support */ 48.58 +EXPORT_SYMBOL(boot_cpu_data); 48.59 +EXPORT_SYMBOL(dump_thread); 48.60 +EXPORT_SYMBOL(dump_fpu); 48.61 +EXPORT_SYMBOL(dump_extended_fpu); 48.62 +EXPORT_SYMBOL(__ioremap); 48.63 +EXPORT_SYMBOL(iounmap); 48.64 +EXPORT_SYMBOL(enable_irq); 48.65 +EXPORT_SYMBOL(disable_irq); 48.66 +EXPORT_SYMBOL(disable_irq_nosync); 48.67 +EXPORT_SYMBOL(probe_irq_mask); 48.68 +EXPORT_SYMBOL(kernel_thread); 48.69 +EXPORT_SYMBOL(pm_idle); 48.70 +EXPORT_SYMBOL(pm_power_off); 48.71 +EXPORT_SYMBOL(apm_info); 48.72 +//EXPORT_SYMBOL(gdt); 48.73 +EXPORT_SYMBOL(empty_zero_page); 48.74 +EXPORT_SYMBOL(phys_to_machine_mapping); 48.75 + 48.76 + 48.77 +#ifdef CONFIG_DEBUG_IOVIRT 48.78 +EXPORT_SYMBOL(__io_virt_debug); 48.79 +#endif 48.80 + 48.81 +EXPORT_SYMBOL_NOVERS(__down_failed); 48.82 +EXPORT_SYMBOL_NOVERS(__down_failed_interruptible); 48.83 +EXPORT_SYMBOL_NOVERS(__down_failed_trylock); 48.84 +EXPORT_SYMBOL_NOVERS(__up_wakeup); 48.85 +/* Networking helper routines. */ 48.86 +EXPORT_SYMBOL(csum_partial_copy_generic); 48.87 +/* Delay loops */ 48.88 +EXPORT_SYMBOL(__ndelay); 48.89 +EXPORT_SYMBOL(__udelay); 48.90 +EXPORT_SYMBOL(__delay); 48.91 +EXPORT_SYMBOL(__const_udelay); 48.92 + 48.93 +EXPORT_SYMBOL_NOVERS(__get_user_1); 48.94 +EXPORT_SYMBOL_NOVERS(__get_user_2); 48.95 +EXPORT_SYMBOL_NOVERS(__get_user_4); 48.96 + 48.97 +EXPORT_SYMBOL(strtok); 48.98 +EXPORT_SYMBOL(strpbrk); 48.99 +EXPORT_SYMBOL(strstr); 48.100 + 48.101 +EXPORT_SYMBOL(strncpy_from_user); 48.102 +EXPORT_SYMBOL(__strncpy_from_user); 48.103 +EXPORT_SYMBOL(clear_user); 48.104 +EXPORT_SYMBOL(__clear_user); 48.105 +EXPORT_SYMBOL(__generic_copy_from_user); 48.106 +EXPORT_SYMBOL(__generic_copy_to_user); 48.107 +EXPORT_SYMBOL(strnlen_user); 48.108 + 48.109 + 48.110 +EXPORT_SYMBOL(pci_alloc_consistent); 48.111 +EXPORT_SYMBOL(pci_free_consistent); 48.112 + 48.113 +#ifdef CONFIG_PCI 48.114 +EXPORT_SYMBOL(pcibios_penalize_isa_irq); 48.115 +EXPORT_SYMBOL(pci_mem_start); 48.116 +#endif 48.117 + 48.118 + 48.119 +#ifdef CONFIG_X86_USE_3DNOW 48.120 +EXPORT_SYMBOL(_mmx_memcpy); 48.121 +EXPORT_SYMBOL(mmx_clear_page); 48.122 +EXPORT_SYMBOL(mmx_copy_page); 48.123 +#endif 48.124 + 48.125 +#ifdef CONFIG_SMP 48.126 +EXPORT_SYMBOL(cpu_data); 48.127 +EXPORT_SYMBOL(kernel_flag_cacheline); 48.128 +EXPORT_SYMBOL(smp_num_cpus); 48.129 +EXPORT_SYMBOL(cpu_online_map); 48.130 +EXPORT_SYMBOL_NOVERS(__write_lock_failed); 48.131 +EXPORT_SYMBOL_NOVERS(__read_lock_failed); 48.132 + 48.133 +/* Global SMP irq stuff */ 48.134 +EXPORT_SYMBOL(synchronize_irq); 48.135 +EXPORT_SYMBOL(global_irq_holder); 48.136 +EXPORT_SYMBOL(__global_cli); 48.137 +EXPORT_SYMBOL(__global_sti); 48.138 +EXPORT_SYMBOL(__global_save_flags); 48.139 +EXPORT_SYMBOL(__global_restore_flags); 48.140 +EXPORT_SYMBOL(smp_call_function); 48.141 + 48.142 +/* TLB flushing */ 48.143 +EXPORT_SYMBOL(flush_tlb_page); 48.144 + 48.145 +/* HT support */ 48.146 +EXPORT_SYMBOL(smp_num_siblings); 48.147 +EXPORT_SYMBOL(cpu_sibling_map); 48.148 +#endif 48.149 + 48.150 +#ifdef CONFIG_X86_IO_APIC 48.151 +EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector); 48.152 +#endif 48.153 + 48.154 +#ifdef CONFIG_VT 48.155 +EXPORT_SYMBOL(screen_info); 48.156 +#endif 48.157 + 48.158 +EXPORT_SYMBOL(get_wchan); 48.159 + 48.160 +EXPORT_SYMBOL(rtc_lock); 48.161 + 48.162 +#undef memcpy 48.163 +#undef memset 48.164 +extern void * memset(void *,int,__kernel_size_t); 48.165 +extern void * memcpy(void *,const void *,__kernel_size_t); 48.166 +EXPORT_SYMBOL_NOVERS(memcpy); 48.167 +EXPORT_SYMBOL_NOVERS(memset); 48.168 + 48.169 +#ifdef CONFIG_HAVE_DEC_LOCK 48.170 +EXPORT_SYMBOL(atomic_dec_and_lock); 48.171 +#endif 48.172 + 48.173 +#ifdef CONFIG_MULTIQUAD 48.174 +EXPORT_SYMBOL(xquad_portio); 48.175 +#endif 48.176 + 48.177 +#include <asm/xen_proc.h> 48.178 +EXPORT_SYMBOL(create_xen_proc_entry); 48.179 +EXPORT_SYMBOL(remove_xen_proc_entry); 48.180 + 48.181 +EXPORT_SYMBOL(evtchn_do_upcall); 48.182 +EXPORT_SYMBOL(force_evtchn_callback); 48.183 +EXPORT_SYMBOL(HYPERVISOR_shared_info);
49.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 49.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/irq.c Fri Jul 15 06:39:50 2005 -0700 49.3 @@ -0,0 +1,1242 @@ 49.4 +/* 49.5 + * linux/arch/i386/kernel/irq.c 49.6 + * 49.7 + * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar 49.8 + * 49.9 + * This file contains the code used by various IRQ handling routines: 49.10 + * asking for different IRQ's should be done through these routines 49.11 + * instead of just grabbing them. Thus setups with different IRQ numbers 49.12 + * shouldn't result in any weird surprises, and installing new handlers 49.13 + * should be easier. 49.14 + */ 49.15 + 49.16 +/* 49.17 + * (mostly architecture independent, will move to kernel/irq.c in 2.5.) 49.18 + * 49.19 + * IRQs are in fact implemented a bit like signal handlers for the kernel. 49.20 + * Naturally it's not a 1:1 relation, but there are similarities. 49.21 + */ 49.22 + 49.23 +#include <linux/config.h> 49.24 +#include <linux/ptrace.h> 49.25 +#include <linux/errno.h> 49.26 +#include <linux/signal.h> 49.27 +#include <linux/sched.h> 49.28 +#include <linux/ioport.h> 49.29 +#include <linux/interrupt.h> 49.30 +#include <linux/timex.h> 49.31 +#include <linux/slab.h> 49.32 +#include <linux/random.h> 49.33 +#include <linux/smp_lock.h> 49.34 +#include <linux/init.h> 49.35 +#include <linux/kernel_stat.h> 49.36 +#include <linux/irq.h> 49.37 +#include <linux/proc_fs.h> 49.38 +#include <linux/seq_file.h> 49.39 + 49.40 +#include <asm/atomic.h> 49.41 +#include <asm/io.h> 49.42 +#include <asm/smp.h> 49.43 +#include <asm/system.h> 49.44 +#include <asm/bitops.h> 49.45 +#include <asm/uaccess.h> 49.46 +#include <asm/pgalloc.h> 49.47 +#include <asm/delay.h> 49.48 +#include <asm/desc.h> 49.49 +#include <asm/irq.h> 49.50 + 49.51 + 49.52 + 49.53 +/* 49.54 + * Linux has a controller-independent x86 interrupt architecture. 49.55 + * every controller has a 'controller-template', that is used 49.56 + * by the main code to do the right thing. Each driver-visible 49.57 + * interrupt source is transparently wired to the apropriate 49.58 + * controller. Thus drivers need not be aware of the 49.59 + * interrupt-controller. 49.60 + * 49.61 + * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC, 49.62 + * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC. 49.63 + * (IO-APICs assumed to be messaging to Pentium local-APICs) 49.64 + * 49.65 + * the code is designed to be easily extended with new/different 49.66 + * interrupt controllers, without having to do assembly magic. 49.67 + */ 49.68 + 49.69 +/* 49.70 + * Controller mappings for all interrupt sources: 49.71 + */ 49.72 +irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = 49.73 + { [0 ... NR_IRQS-1] = { 0, &no_irq_type, NULL, 0, SPIN_LOCK_UNLOCKED}}; 49.74 + 49.75 +static void register_irq_proc (unsigned int irq); 49.76 + 49.77 +/* 49.78 + * Special irq handlers. 49.79 + */ 49.80 + 49.81 +void no_action(int cpl, void *dev_id, struct pt_regs *regs) { } 49.82 + 49.83 +/* 49.84 + * Generic no controller code 49.85 + */ 49.86 + 49.87 +static void enable_none(unsigned int irq) { } 49.88 +static unsigned int startup_none(unsigned int irq) { return 0; } 49.89 +static void disable_none(unsigned int irq) { } 49.90 +static void ack_none(unsigned int irq) 49.91 +{ 49.92 +/* 49.93 + * 'what should we do if we get a hw irq event on an illegal vector'. 49.94 + * each architecture has to answer this themselves, it doesnt deserve 49.95 + * a generic callback i think. 49.96 + */ 49.97 +#if CONFIG_X86 49.98 + printk("unexpected IRQ trap at vector %02x\n", irq); 49.99 +#ifdef CONFIG_X86_LOCAL_APIC 49.100 + /* 49.101 + * Currently unexpected vectors happen only on SMP and APIC. 49.102 + * We _must_ ack these because every local APIC has only N 49.103 + * irq slots per priority level, and a 'hanging, unacked' IRQ 49.104 + * holds up an irq slot - in excessive cases (when multiple 49.105 + * unexpected vectors occur) that might lock up the APIC 49.106 + * completely. 49.107 + */ 49.108 + ack_APIC_irq(); 49.109 +#endif 49.110 +#endif 49.111 +} 49.112 + 49.113 +/* startup is the same as "enable", shutdown is same as "disable" */ 49.114 +#define shutdown_none disable_none 49.115 +#define end_none enable_none 49.116 + 49.117 +struct hw_interrupt_type no_irq_type = { 49.118 + "none", 49.119 + startup_none, 49.120 + shutdown_none, 49.121 + enable_none, 49.122 + disable_none, 49.123 + ack_none, 49.124 + end_none 49.125 +}; 49.126 + 49.127 +atomic_t irq_err_count; 49.128 +#ifdef CONFIG_X86_IO_APIC 49.129 +#ifdef APIC_MISMATCH_DEBUG 49.130 +atomic_t irq_mis_count; 49.131 +#endif 49.132 +#endif 49.133 + 49.134 +/* 49.135 + * Generic, controller-independent functions: 49.136 + */ 49.137 + 49.138 +int show_interrupts(struct seq_file *p, void *v) 49.139 +{ 49.140 + int i, j; 49.141 + struct irqaction * action; 49.142 + 49.143 + seq_printf(p, " "); 49.144 + for (j=0; j<smp_num_cpus; j++) 49.145 + seq_printf(p, "CPU%d ",j); 49.146 + seq_putc(p,'\n'); 49.147 + 49.148 + for (i = 0 ; i < NR_IRQS ; i++) { 49.149 + action = irq_desc[i].action; 49.150 + if (!action) 49.151 + continue; 49.152 + seq_printf(p, "%3d: ",i); 49.153 +#ifndef CONFIG_SMP 49.154 + seq_printf(p, "%10u ", kstat_irqs(i)); 49.155 +#else 49.156 + for (j = 0; j < smp_num_cpus; j++) 49.157 + seq_printf(p, "%10u ", 49.158 + kstat.irqs[cpu_logical_map(j)][i]); 49.159 +#endif 49.160 + seq_printf(p, " %14s", irq_desc[i].handler->typename); 49.161 + seq_printf(p, " %s", action->name); 49.162 + 49.163 + for (action=action->next; action; action = action->next) 49.164 + seq_printf(p, ", %s", action->name); 49.165 + seq_putc(p,'\n'); 49.166 + } 49.167 + seq_printf(p, "NMI: "); 49.168 + for (j = 0; j < smp_num_cpus; j++) 49.169 + seq_printf(p, "%10u ", 49.170 + nmi_count(cpu_logical_map(j))); 49.171 + seq_printf(p, "\n"); 49.172 +#if CONFIG_X86_LOCAL_APIC 49.173 + seq_printf(p, "LOC: "); 49.174 + for (j = 0; j < smp_num_cpus; j++) 49.175 + seq_printf(p, "%10u ", 49.176 + apic_timer_irqs[cpu_logical_map(j)]); 49.177 + seq_printf(p, "\n"); 49.178 +#endif 49.179 + seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); 49.180 +#ifdef CONFIG_X86_IO_APIC 49.181 +#ifdef APIC_MISMATCH_DEBUG 49.182 + seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count)); 49.183 +#endif 49.184 +#endif 49.185 + 49.186 + return 0; 49.187 +} 49.188 + 49.189 + 49.190 +/* 49.191 + * Global interrupt locks for SMP. Allow interrupts to come in on any 49.192 + * CPU, yet make cli/sti act globally to protect critical regions.. 49.193 + */ 49.194 + 49.195 +#ifdef CONFIG_SMP 49.196 +unsigned char global_irq_holder = NO_PROC_ID; 49.197 +unsigned volatile long global_irq_lock; /* pendantic: long for set_bit --RR */ 49.198 + 49.199 +extern void show_stack(unsigned long* esp); 49.200 + 49.201 +static void show(char * str) 49.202 +{ 49.203 + int i; 49.204 + int cpu = smp_processor_id(); 49.205 + 49.206 + printk("\n%s, CPU %d:\n", str, cpu); 49.207 + printk("irq: %d [",irqs_running()); 49.208 + for(i=0;i < smp_num_cpus;i++) 49.209 + printk(" %d",local_irq_count(i)); 49.210 + printk(" ]\nbh: %d [",spin_is_locked(&global_bh_lock) ? 1 : 0); 49.211 + for(i=0;i < smp_num_cpus;i++) 49.212 + printk(" %d",local_bh_count(i)); 49.213 + 49.214 + printk(" ]\nStack dumps:"); 49.215 + for(i = 0; i < smp_num_cpus; i++) { 49.216 + unsigned long esp; 49.217 + if (i == cpu) 49.218 + continue; 49.219 + printk("\nCPU %d:",i); 49.220 + esp = init_tss[i].esp0; 49.221 + if (!esp) { 49.222 + /* tss->esp0 is set to NULL in cpu_init(), 49.223 + * it's initialized when the cpu returns to user 49.224 + * space. -- manfreds 49.225 + */ 49.226 + printk(" <unknown> "); 49.227 + continue; 49.228 + } 49.229 + esp &= ~(THREAD_SIZE-1); 49.230 + esp += sizeof(struct task_struct); 49.231 + show_stack((void*)esp); 49.232 + } 49.233 + printk("\nCPU %d:",cpu); 49.234 + show_stack(NULL); 49.235 + printk("\n"); 49.236 +} 49.237 + 49.238 +#define MAXCOUNT 100000000 49.239 + 49.240 +/* 49.241 + * I had a lockup scenario where a tight loop doing 49.242 + * spin_unlock()/spin_lock() on CPU#1 was racing with 49.243 + * spin_lock() on CPU#0. CPU#0 should have noticed spin_unlock(), but 49.244 + * apparently the spin_unlock() information did not make it 49.245 + * through to CPU#0 ... nasty, is this by design, do we have to limit 49.246 + * 'memory update oscillation frequency' artificially like here? 49.247 + * 49.248 + * Such 'high frequency update' races can be avoided by careful design, but 49.249 + * some of our major constructs like spinlocks use similar techniques, 49.250 + * it would be nice to clarify this issue. Set this define to 0 if you 49.251 + * want to check whether your system freezes. I suspect the delay done 49.252 + * by SYNC_OTHER_CORES() is in correlation with 'snooping latency', but 49.253 + * i thought that such things are guaranteed by design, since we use 49.254 + * the 'LOCK' prefix. 49.255 + */ 49.256 +#define SUSPECTED_CPU_OR_CHIPSET_BUG_WORKAROUND 0 49.257 + 49.258 +#if SUSPECTED_CPU_OR_CHIPSET_BUG_WORKAROUND 49.259 +# define SYNC_OTHER_CORES(x) udelay(x+1) 49.260 +#else 49.261 +/* 49.262 + * We have to allow irqs to arrive between __sti and __cli 49.263 + */ 49.264 +# define SYNC_OTHER_CORES(x) __asm__ __volatile__ ("nop") 49.265 +#endif 49.266 + 49.267 +static inline void wait_on_irq(int cpu) 49.268 +{ 49.269 + int count = MAXCOUNT; 49.270 + 49.271 + for (;;) { 49.272 + 49.273 + /* 49.274 + * Wait until all interrupts are gone. Wait 49.275 + * for bottom half handlers unless we're 49.276 + * already executing in one.. 49.277 + */ 49.278 + if (!irqs_running()) 49.279 + if (local_bh_count(cpu) || !spin_is_locked(&global_bh_lock)) 49.280 + break; 49.281 + 49.282 + /* Duh, we have to loop. Release the lock to avoid deadlocks */ 49.283 + clear_bit(0,&global_irq_lock); 49.284 + 49.285 + for (;;) { 49.286 + if (!--count) { 49.287 + show("wait_on_irq"); 49.288 + count = ~0; 49.289 + } 49.290 + __sti(); 49.291 + SYNC_OTHER_CORES(cpu); 49.292 + __cli(); 49.293 + if (irqs_running()) 49.294 + continue; 49.295 + if (global_irq_lock) 49.296 + continue; 49.297 + if (!local_bh_count(cpu) && spin_is_locked(&global_bh_lock)) 49.298 + continue; 49.299 + if (!test_and_set_bit(0,&global_irq_lock)) 49.300 + break; 49.301 + } 49.302 + } 49.303 +} 49.304 + 49.305 +/* 49.306 + * This is called when we want to synchronize with 49.307 + * interrupts. We may for example tell a device to 49.308 + * stop sending interrupts: but to make sure there 49.309 + * are no interrupts that are executing on another 49.310 + * CPU we need to call this function. 49.311 + */ 49.312 +void synchronize_irq(void) 49.313 +{ 49.314 + if (irqs_running()) { 49.315 + /* Stupid approach */ 49.316 + cli(); 49.317 + sti(); 49.318 + } 49.319 +} 49.320 + 49.321 +static inline void get_irqlock(int cpu) 49.322 +{ 49.323 + if (test_and_set_bit(0,&global_irq_lock)) { 49.324 + /* do we already hold the lock? */ 49.325 + if ((unsigned char) cpu == global_irq_holder) 49.326 + return; 49.327 + /* Uhhuh.. Somebody else got it. Wait.. */ 49.328 + do { 49.329 + do { 49.330 + rep_nop(); 49.331 + } while (test_bit(0,&global_irq_lock)); 49.332 + } while (test_and_set_bit(0,&global_irq_lock)); 49.333 + } 49.334 + /* 49.335 + * We also to make sure that nobody else is running 49.336 + * in an interrupt context. 49.337 + */ 49.338 + wait_on_irq(cpu); 49.339 + 49.340 + /* 49.341 + * Ok, finally.. 49.342 + */ 49.343 + global_irq_holder = cpu; 49.344 +} 49.345 + 49.346 +/* 49.347 + * A global "cli()" while in an interrupt context 49.348 + * turns into just a local cli(). Interrupts 49.349 + * should use spinlocks for the (very unlikely) 49.350 + * case that they ever want to protect against 49.351 + * each other. 49.352 + * 49.353 + * If we already have local interrupts disabled, 49.354 + * this will not turn a local disable into a 49.355 + * global one (problems with spinlocks: this makes 49.356 + * save_flags+cli+sti usable inside a spinlock). 49.357 + */ 49.358 +void __global_cli(void) 49.359 +{ 49.360 + unsigned int flags; 49.361 + 49.362 + __save_flags(flags); 49.363 + if (!flags) { 49.364 + int cpu = smp_processor_id(); 49.365 + __cli(); 49.366 + if (!local_irq_count(cpu)) 49.367 + get_irqlock(cpu); 49.368 + } 49.369 +} 49.370 + 49.371 +void __global_sti(void) 49.372 +{ 49.373 + int cpu = smp_processor_id(); 49.374 + 49.375 + if (!local_irq_count(cpu)) 49.376 + release_irqlock(cpu); 49.377 + __sti(); 49.378 +} 49.379 + 49.380 +/* 49.381 + * SMP flags value to restore to: 49.382 + * 0 - global cli 49.383 + * 1 - global sti 49.384 + * 2 - local cli 49.385 + * 3 - local sti 49.386 + */ 49.387 +unsigned long __global_save_flags(void) 49.388 +{ 49.389 + int retval; 49.390 + int local_enabled; 49.391 + unsigned long flags; 49.392 + int cpu = smp_processor_id(); 49.393 + 49.394 + __save_flags(flags); 49.395 + local_enabled = !flags; 49.396 + /* default to local */ 49.397 + retval = 2 + local_enabled; 49.398 + 49.399 + /* check for global flags if we're not in an interrupt */ 49.400 + if (!local_irq_count(cpu)) { 49.401 + if (local_enabled) 49.402 + retval = 1; 49.403 + if (global_irq_holder == cpu) 49.404 + retval = 0; 49.405 + } 49.406 + return retval; 49.407 +} 49.408 + 49.409 +void __global_restore_flags(unsigned long flags) 49.410 +{ 49.411 + switch (flags) { 49.412 + case 0: 49.413 + __global_cli(); 49.414 + break; 49.415 + case 1: 49.416 + __global_sti(); 49.417 + break; 49.418 + case 2: 49.419 + __cli(); 49.420 + break; 49.421 + case 3: 49.422 + __sti(); 49.423 + break; 49.424 + default: 49.425 + printk("global_restore_flags: %08lx (%08lx)\n", 49.426 + flags, (&flags)[-1]); 49.427 + } 49.428 +} 49.429 + 49.430 +#endif 49.431 + 49.432 +/* 49.433 + * This should really return information about whether 49.434 + * we should do bottom half handling etc. Right now we 49.435 + * end up _always_ checking the bottom half, which is a 49.436 + * waste of time and is not what some drivers would 49.437 + * prefer. 49.438 + */ 49.439 +int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, struct irqaction * action) 49.440 +{ 49.441 + int status; 49.442 + int cpu = smp_processor_id(); 49.443 + 49.444 + irq_enter(cpu, irq); 49.445 + 49.446 + status = 1; /* Force the "do bottom halves" bit */ 49.447 + 49.448 + if (!(action->flags & SA_INTERRUPT)) 49.449 + __sti(); 49.450 + 49.451 + do { 49.452 + status |= action->flags; 49.453 + action->handler(irq, action->dev_id, regs); 49.454 + action = action->next; 49.455 + } while (action); 49.456 + if (status & SA_SAMPLE_RANDOM) 49.457 + add_interrupt_randomness(irq); 49.458 + __cli(); 49.459 + 49.460 + irq_exit(cpu, irq); 49.461 + 49.462 + return status; 49.463 +} 49.464 + 49.465 +/* 49.466 + * Generic enable/disable code: this just calls 49.467 + * down into the PIC-specific version for the actual 49.468 + * hardware disable after having gotten the irq 49.469 + * controller lock. 49.470 + */ 49.471 + 49.472 +/** 49.473 + * disable_irq_nosync - disable an irq without waiting 49.474 + * @irq: Interrupt to disable 49.475 + * 49.476 + * Disable the selected interrupt line. Disables and Enables are 49.477 + * nested. 49.478 + * Unlike disable_irq(), this function does not ensure existing 49.479 + * instances of the IRQ handler have completed before returning. 49.480 + * 49.481 + * This function may be called from IRQ context. 49.482 + */ 49.483 + 49.484 +inline void disable_irq_nosync(unsigned int irq) 49.485 +{ 49.486 + irq_desc_t *desc = irq_desc + irq; 49.487 + unsigned long flags; 49.488 + 49.489 + spin_lock_irqsave(&desc->lock, flags); 49.490 + if (!desc->depth++) { 49.491 + desc->status |= IRQ_DISABLED; 49.492 + desc->handler->disable(irq); 49.493 + } 49.494 + spin_unlock_irqrestore(&desc->lock, flags); 49.495 +} 49.496 + 49.497 +/** 49.498 + * disable_irq - disable an irq and wait for completion 49.499 + * @irq: Interrupt to disable 49.500 + * 49.501 + * Disable the selected interrupt line. Enables and Disables are 49.502 + * nested. 49.503 + * This function waits for any pending IRQ handlers for this interrupt 49.504 + * to complete before returning. If you use this function while 49.505 + * holding a resource the IRQ handler may need you will deadlock. 49.506 + * 49.507 + * This function may be called - with care - from IRQ context. 49.508 + */ 49.509 + 49.510 +void disable_irq(unsigned int irq) 49.511 +{ 49.512 + disable_irq_nosync(irq); 49.513 + 49.514 + if (!local_irq_count(smp_processor_id())) { 49.515 + do { 49.516 + barrier(); 49.517 + cpu_relax(); 49.518 + } while (irq_desc[irq].status & IRQ_INPROGRESS); 49.519 + } 49.520 +} 49.521 + 49.522 +/** 49.523 + * enable_irq - enable handling of an irq 49.524 + * @irq: Interrupt to enable 49.525 + * 49.526 + * Undoes the effect of one call to disable_irq(). If this 49.527 + * matches the last disable, processing of interrupts on this 49.528 + * IRQ line is re-enabled. 49.529 + * 49.530 + * This function may be called from IRQ context. 49.531 + */ 49.532 + 49.533 +void enable_irq(unsigned int irq) 49.534 +{ 49.535 + irq_desc_t *desc = irq_desc + irq; 49.536 + unsigned long flags; 49.537 + 49.538 + spin_lock_irqsave(&desc->lock, flags); 49.539 + switch (desc->depth) { 49.540 + case 1: { 49.541 + unsigned int status = desc->status & ~IRQ_DISABLED; 49.542 + desc->status = status; 49.543 + if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { 49.544 + desc->status = status | IRQ_REPLAY; 49.545 + hw_resend_irq(desc->handler,irq); 49.546 + } 49.547 + desc->handler->enable(irq); 49.548 + /* fall-through */ 49.549 + } 49.550 + default: 49.551 + desc->depth--; 49.552 + break; 49.553 + case 0: 49.554 + printk("enable_irq(%u) unbalanced from %p\n", irq, 49.555 + __builtin_return_address(0)); 49.556 + } 49.557 + spin_unlock_irqrestore(&desc->lock, flags); 49.558 +} 49.559 + 49.560 +/* 49.561 + * do_IRQ handles all normal device IRQ's (the special 49.562 + * SMP cross-CPU interrupts have their own specific 49.563 + * handlers). 49.564 + */ 49.565 +asmlinkage unsigned int do_IRQ(struct pt_regs *regs) 49.566 +{ 49.567 + /* 49.568 + * We ack quickly, we don't want the irq controller 49.569 + * thinking we're snobs just because some other CPU has 49.570 + * disabled global interrupts (we have already done the 49.571 + * INT_ACK cycles, it's too late to try to pretend to the 49.572 + * controller that we aren't taking the interrupt). 49.573 + * 49.574 + * 0 return value means that this irq is already being 49.575 + * handled by some other CPU. (or is disabled) 49.576 + */ 49.577 + int irq = regs->orig_eax & 0xff; /* high bits used in ret_from_ code */ 49.578 + int cpu = smp_processor_id(); 49.579 + irq_desc_t *desc = irq_desc + irq; 49.580 + struct irqaction * action; 49.581 + unsigned int status; 49.582 +#ifdef CONFIG_DEBUG_STACKOVERFLOW 49.583 + long esp; 49.584 + 49.585 + /* Debugging check for stack overflow: is there less than 1KB free? */ 49.586 + __asm__ __volatile__("andl %%esp,%0" : "=r" (esp) : "0" (8191)); 49.587 + if (unlikely(esp < (sizeof(struct task_struct) + 1024))) { 49.588 + extern void show_stack(unsigned long *); 49.589 + 49.590 + printk("do_IRQ: stack overflow: %ld\n", 49.591 + esp - sizeof(struct task_struct)); 49.592 + __asm__ __volatile__("movl %%esp,%0" : "=r" (esp)); 49.593 + show_stack((void *)esp); 49.594 + } 49.595 +#endif 49.596 + 49.597 + kstat.irqs[cpu][irq]++; 49.598 + spin_lock(&desc->lock); 49.599 + desc->handler->ack(irq); 49.600 + /* 49.601 + REPLAY is when Linux resends an IRQ that was dropped earlier 49.602 + WAITING is used by probe to mark irqs that are being tested 49.603 + */ 49.604 + status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); 49.605 + status |= IRQ_PENDING; /* we _want_ to handle it */ 49.606 + 49.607 + /* 49.608 + * If the IRQ is disabled for whatever reason, we cannot 49.609 + * use the action we have. 49.610 + */ 49.611 + action = NULL; 49.612 + if (!(status & (IRQ_DISABLED | IRQ_INPROGRESS))) { 49.613 + action = desc->action; 49.614 + status &= ~IRQ_PENDING; /* we commit to handling */ 49.615 + status |= IRQ_INPROGRESS; /* we are handling it */ 49.616 + } 49.617 + desc->status = status; 49.618 + 49.619 + /* 49.620 + * If there is no IRQ handler or it was disabled, exit early. 49.621 + Since we set PENDING, if another processor is handling 49.622 + a different instance of this same irq, the other processor 49.623 + will take care of it. 49.624 + */ 49.625 + if (!action) 49.626 + goto out; 49.627 + 49.628 + /* 49.629 + * Edge triggered interrupts need to remember 49.630 + * pending events. 49.631 + * This applies to any hw interrupts that allow a second 49.632 + * instance of the same irq to arrive while we are in do_IRQ 49.633 + * or in the handler. But the code here only handles the _second_ 49.634 + * instance of the irq, not the third or fourth. So it is mostly 49.635 + * useful for irq hardware that does not mask cleanly in an 49.636 + * SMP environment. 49.637 + */ 49.638 + for (;;) { 49.639 + spin_unlock(&desc->lock); 49.640 + handle_IRQ_event(irq, regs, action); 49.641 + spin_lock(&desc->lock); 49.642 + 49.643 + if (!(desc->status & IRQ_PENDING)) 49.644 + break; 49.645 + desc->status &= ~IRQ_PENDING; 49.646 + } 49.647 + desc->status &= ~IRQ_INPROGRESS; 49.648 +out: 49.649 + /* 49.650 + * The ->end() handler has to deal with interrupts which got 49.651 + * disabled while the handler was running. 49.652 + */ 49.653 + desc->handler->end(irq); 49.654 + spin_unlock(&desc->lock); 49.655 + 49.656 + if (softirq_pending(cpu)) 49.657 + do_softirq(); 49.658 + return 1; 49.659 +} 49.660 + 49.661 +/** 49.662 + * request_irq - allocate an interrupt line 49.663 + * @irq: Interrupt line to allocate 49.664 + * @handler: Function to be called when the IRQ occurs 49.665 + * @irqflags: Interrupt type flags 49.666 + * @devname: An ascii name for the claiming device 49.667 + * @dev_id: A cookie passed back to the handler function 49.668 + * 49.669 + * This call allocates interrupt resources and enables the 49.670 + * interrupt line and IRQ handling. From the point this 49.671 + * call is made your handler function may be invoked. Since 49.672 + * your handler function must clear any interrupt the board 49.673 + * raises, you must take care both to initialise your hardware 49.674 + * and to set up the interrupt handler in the right order. 49.675 + * 49.676 + * Dev_id must be globally unique. Normally the address of the 49.677 + * device data structure is used as the cookie. Since the handler 49.678 + * receives this value it makes sense to use it. 49.679 + * 49.680 + * If your interrupt is shared you must pass a non NULL dev_id 49.681 + * as this is required when freeing the interrupt. 49.682 + * 49.683 + * Flags: 49.684 + * 49.685 + * SA_SHIRQ Interrupt is shared 49.686 + * 49.687 + * SA_INTERRUPT Disable local interrupts while processing 49.688 + * 49.689 + * SA_SAMPLE_RANDOM The interrupt can be used for entropy 49.690 + * 49.691 + */ 49.692 + 49.693 +int request_irq(unsigned int irq, 49.694 + void (*handler)(int, void *, struct pt_regs *), 49.695 + unsigned long irqflags, 49.696 + const char * devname, 49.697 + void *dev_id) 49.698 +{ 49.699 + int retval; 49.700 + struct irqaction * action; 49.701 + 49.702 +#if 1 49.703 + /* 49.704 + * Sanity-check: shared interrupts should REALLY pass in 49.705 + * a real dev-ID, otherwise we'll have trouble later trying 49.706 + * to figure out which interrupt is which (messes up the 49.707 + * interrupt freeing logic etc). 49.708 + */ 49.709 + if (irqflags & SA_SHIRQ) { 49.710 + if (!dev_id) 49.711 + printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]); 49.712 + } 49.713 +#endif 49.714 + 49.715 + if (irq >= NR_IRQS) 49.716 + return -EINVAL; 49.717 + if (!handler) 49.718 + return -EINVAL; 49.719 + 49.720 + action = (struct irqaction *) 49.721 + kmalloc(sizeof(struct irqaction), GFP_KERNEL); 49.722 + if (!action) 49.723 + return -ENOMEM; 49.724 + 49.725 + action->handler = handler; 49.726 + action->flags = irqflags; 49.727 + action->mask = 0; 49.728 + action->name = devname; 49.729 + action->next = NULL; 49.730 + action->dev_id = dev_id; 49.731 + 49.732 + retval = setup_irq(irq, action); 49.733 + if (retval) 49.734 + kfree(action); 49.735 + return retval; 49.736 +} 49.737 + 49.738 +/* 49.739 + * Internal function to unregister an irqaction - typically used to 49.740 + * deallocate special interrupts that are part of the architecture. 49.741 + */ 49.742 +int teardown_irq(unsigned int irq, struct irqaction * old) 49.743 +{ 49.744 + irq_desc_t *desc; 49.745 + struct irqaction **p; 49.746 + unsigned long flags; 49.747 + 49.748 + if (irq >= NR_IRQS) 49.749 + return -ENOENT; 49.750 + 49.751 + desc = irq_desc + irq; 49.752 + spin_lock_irqsave(&desc->lock,flags); 49.753 + p = &desc->action; 49.754 + for (;;) { 49.755 + struct irqaction * action = *p; 49.756 + if (action) { 49.757 + struct irqaction **pp = p; 49.758 + p = &action->next; 49.759 + if (action != old) 49.760 + continue; 49.761 + 49.762 + /* Found it - now remove it from the list of entries */ 49.763 + *pp = action->next; 49.764 + if (!desc->action) { 49.765 + desc->status |= IRQ_DISABLED; 49.766 + desc->handler->shutdown(irq); 49.767 + } 49.768 + spin_unlock_irqrestore(&desc->lock,flags); 49.769 + 49.770 +#ifdef CONFIG_SMP 49.771 + /* Wait to make sure it's not being used on another CPU */ 49.772 + while (desc->status & IRQ_INPROGRESS) { 49.773 + barrier(); 49.774 + cpu_relax(); 49.775 + } 49.776 +#endif 49.777 + return 0; 49.778 + } 49.779 + printk("Trying to free free IRQ%d\n",irq); 49.780 + spin_unlock_irqrestore(&desc->lock,flags); 49.781 + return -ENOENT; 49.782 + } 49.783 +} 49.784 + 49.785 +/** 49.786 + * free_irq - free an interrupt 49.787 + * @irq: Interrupt line to free 49.788 + * @dev_id: Device identity to free 49.789 + * 49.790 + * Remove an interrupt handler. The handler is removed and if the 49.791 + * interrupt line is no longer in use by any driver it is disabled. 49.792 + * On a shared IRQ the caller must ensure the interrupt is disabled 49.793 + * on the card it drives before calling this function. The function 49.794 + * does not return until any executing interrupts for this IRQ 49.795 + * have completed. 49.796 + * 49.797 + * This function may be called from interrupt context. 49.798 + * 49.799 + * Bugs: Attempting to free an irq in a handler for the same irq hangs 49.800 + * the machine. 49.801 + */ 49.802 + 49.803 +void free_irq(unsigned int irq, void *dev_id) 49.804 +{ 49.805 + irq_desc_t *desc; 49.806 + struct irqaction *action; 49.807 + unsigned long flags; 49.808 + 49.809 + if (irq >= NR_IRQS) 49.810 + return; 49.811 + 49.812 + desc = irq_desc + irq; 49.813 + spin_lock_irqsave(&desc->lock,flags); 49.814 + for (action = desc->action; action != NULL; action = action->next) { 49.815 + if (action->dev_id != dev_id) 49.816 + continue; 49.817 + 49.818 + spin_unlock_irqrestore(&desc->lock,flags); 49.819 + 49.820 + if (teardown_irq(irq, action) == 0) 49.821 + kfree(action); 49.822 + return; 49.823 + } 49.824 + printk("Trying to free free IRQ%d\n",irq); 49.825 + spin_unlock_irqrestore(&desc->lock,flags); 49.826 + return; 49.827 +} 49.828 + 49.829 +/* 49.830 + * IRQ autodetection code.. 49.831 + * 49.832 + * This depends on the fact that any interrupt that 49.833 + * comes in on to an unassigned handler will get stuck 49.834 + * with "IRQ_WAITING" cleared and the interrupt 49.835 + * disabled. 49.836 + */ 49.837 + 49.838 +static DECLARE_MUTEX(probe_sem); 49.839 + 49.840 +/** 49.841 + * probe_irq_on - begin an interrupt autodetect 49.842 + * 49.843 + * Commence probing for an interrupt. The interrupts are scanned 49.844 + * and a mask of potential interrupt lines is returned. 49.845 + * 49.846 + */ 49.847 + 49.848 +unsigned long probe_irq_on(void) 49.849 +{ 49.850 + unsigned int i; 49.851 + irq_desc_t *desc; 49.852 + unsigned long val; 49.853 + unsigned long delay; 49.854 + 49.855 + down(&probe_sem); 49.856 + /* 49.857 + * something may have generated an irq long ago and we want to 49.858 + * flush such a longstanding irq before considering it as spurious. 49.859 + */ 49.860 + for (i = NR_PIRQS-1; i > 0; i--) { 49.861 + desc = irq_desc + i; 49.862 + 49.863 + spin_lock_irq(&desc->lock); 49.864 + if (!irq_desc[i].action) 49.865 + irq_desc[i].handler->startup(i); 49.866 + spin_unlock_irq(&desc->lock); 49.867 + } 49.868 + 49.869 + /* Wait for longstanding interrupts to trigger. */ 49.870 + for (delay = jiffies + HZ/50; time_after(delay, jiffies); ) 49.871 + /* about 20ms delay */ synchronize_irq(); 49.872 + 49.873 + /* 49.874 + * enable any unassigned irqs 49.875 + * (we must startup again here because if a longstanding irq 49.876 + * happened in the previous stage, it may have masked itself) 49.877 + */ 49.878 + for (i = NR_PIRQS-1; i > 0; i--) { 49.879 + desc = irq_desc + i; 49.880 + 49.881 + spin_lock_irq(&desc->lock); 49.882 + if (!desc->action) { 49.883 + desc->status |= IRQ_AUTODETECT | IRQ_WAITING; 49.884 + if (desc->handler->startup(i)) 49.885 + desc->status |= IRQ_PENDING; 49.886 + } 49.887 + spin_unlock_irq(&desc->lock); 49.888 + } 49.889 + 49.890 + /* 49.891 + * Wait for spurious interrupts to trigger 49.892 + */ 49.893 + for (delay = jiffies + HZ/10; time_after(delay, jiffies); ) 49.894 + /* about 100ms delay */ synchronize_irq(); 49.895 + 49.896 + /* 49.897 + * Now filter out any obviously spurious interrupts 49.898 + */ 49.899 + val = 0; 49.900 + for (i = 0; i < NR_PIRQS; i++) { 49.901 + irq_desc_t *desc = irq_desc + i; 49.902 + unsigned int status; 49.903 + 49.904 + spin_lock_irq(&desc->lock); 49.905 + status = desc->status; 49.906 + 49.907 + if (status & IRQ_AUTODETECT) { 49.908 + /* It triggered already - consider it spurious. */ 49.909 + if (!(status & IRQ_WAITING)) { 49.910 + desc->status = status & ~IRQ_AUTODETECT; 49.911 + desc->handler->shutdown(i); 49.912 + } else 49.913 + if (i < 32) 49.914 + val |= 1 << i; 49.915 + } 49.916 + spin_unlock_irq(&desc->lock); 49.917 + } 49.918 + 49.919 + return val; 49.920 +} 49.921 + 49.922 +/* 49.923 + * Return a mask of triggered interrupts (this 49.924 + * can handle only legacy ISA interrupts). 49.925 + */ 49.926 + 49.927 +/** 49.928 + * probe_irq_mask - scan a bitmap of interrupt lines 49.929 + * @val: mask of interrupts to consider 49.930 + * 49.931 + * Scan the ISA bus interrupt lines and return a bitmap of 49.932 + * active interrupts. The interrupt probe logic state is then 49.933 + * returned to its previous value. 49.934 + * 49.935 + * Note: we need to scan all the irq's even though we will 49.936 + * only return ISA irq numbers - just so that we reset them 49.937 + * all to a known state. 49.938 + */ 49.939 +unsigned int probe_irq_mask(unsigned long val) 49.940 +{ 49.941 + int i; 49.942 + unsigned int mask; 49.943 + 49.944 + mask = 0; 49.945 + for (i = 0; i < NR_PIRQS; i++) { 49.946 + irq_desc_t *desc = irq_desc + i; 49.947 + unsigned int status; 49.948 + 49.949 + spin_lock_irq(&desc->lock); 49.950 + status = desc->status; 49.951 + 49.952 + if (status & IRQ_AUTODETECT) { 49.953 + if (i < 16 && !(status & IRQ_WAITING)) 49.954 + mask |= 1 << i; 49.955 + 49.956 + desc->status = status & ~IRQ_AUTODETECT; 49.957 + desc->handler->shutdown(i); 49.958 + } 49.959 + spin_unlock_irq(&desc->lock); 49.960 + } 49.961 + up(&probe_sem); 49.962 + 49.963 + return mask & val; 49.964 +} 49.965 + 49.966 +/* 49.967 + * Return the one interrupt that triggered (this can 49.968 + * handle any interrupt source). 49.969 + */ 49.970 + 49.971 +/** 49.972 + * probe_irq_off - end an interrupt autodetect 49.973 + * @val: mask of potential interrupts (unused) 49.974 + * 49.975 + * Scans the unused interrupt lines and returns the line which 49.976 + * appears to have triggered the interrupt. If no interrupt was 49.977 + * found then zero is returned. If more than one interrupt is 49.978 + * found then minus the first candidate is returned to indicate 49.979 + * their is doubt. 49.980 + * 49.981 + * The interrupt probe logic state is returned to its previous 49.982 + * value. 49.983 + * 49.984 + * BUGS: When used in a module (which arguably shouldnt happen) 49.985 + * nothing prevents two IRQ probe callers from overlapping. The 49.986 + * results of this are non-optimal. 49.987 + */ 49.988 + 49.989 +int probe_irq_off(unsigned long val) 49.990 +{ 49.991 + int i, irq_found, nr_irqs; 49.992 + 49.993 + nr_irqs = 0; 49.994 + irq_found = 0; 49.995 + for (i = 0; i < NR_PIRQS; i++) { 49.996 + irq_desc_t *desc = irq_desc + i; 49.997 + unsigned int status; 49.998 + 49.999 + spin_lock_irq(&desc->lock); 49.1000 + status = desc->status; 49.1001 + 49.1002 + if (status & IRQ_AUTODETECT) { 49.1003 + if (!(status & IRQ_WAITING)) { 49.1004 + if (!nr_irqs) 49.1005 + irq_found = i; 49.1006 + nr_irqs++; 49.1007 + } 49.1008 + desc->status = status & ~IRQ_AUTODETECT; 49.1009 + desc->handler->shutdown(i); 49.1010 + } 49.1011 + spin_unlock_irq(&desc->lock); 49.1012 + } 49.1013 + up(&probe_sem); 49.1014 + 49.1015 + if (nr_irqs > 1) 49.1016 + irq_found = -irq_found; 49.1017 + return irq_found; 49.1018 +} 49.1019 + 49.1020 +/* this was setup_x86_irq but it seems pretty generic */ 49.1021 +int setup_irq(unsigned int irq, struct irqaction * new) 49.1022 +{ 49.1023 + int shared = 0; 49.1024 + unsigned long flags; 49.1025 + struct irqaction *old, **p; 49.1026 + irq_desc_t *desc = irq_desc + irq; 49.1027 + 49.1028 + /* 49.1029 + * Some drivers like serial.c use request_irq() heavily, 49.1030 + * so we have to be careful not to interfere with a 49.1031 + * running system. 49.1032 + */ 49.1033 + if (new->flags & SA_SAMPLE_RANDOM) { 49.1034 + /* 49.1035 + * This function might sleep, we want to call it first, 49.1036 + * outside of the atomic block. 49.1037 + * Yes, this might clear the entropy pool if the wrong 49.1038 + * driver is attempted to be loaded, without actually 49.1039 + * installing a new handler, but is this really a problem, 49.1040 + * only the sysadmin is able to do this. 49.1041 + */ 49.1042 + rand_initialize_irq(irq); 49.1043 + } 49.1044 + 49.1045 + /* 49.1046 + * The following block of code has to be executed atomically 49.1047 + */ 49.1048 + spin_lock_irqsave(&desc->lock,flags); 49.1049 + p = &desc->action; 49.1050 + if ((old = *p) != NULL) { 49.1051 + /* Can't share interrupts unless both agree to */ 49.1052 + if (!(old->flags & new->flags & SA_SHIRQ)) { 49.1053 + spin_unlock_irqrestore(&desc->lock,flags); 49.1054 + return -EBUSY; 49.1055 + } 49.1056 + 49.1057 + /* add new interrupt at end of irq queue */ 49.1058 + do { 49.1059 + p = &old->next; 49.1060 + old = *p; 49.1061 + } while (old); 49.1062 + shared = 1; 49.1063 + } 49.1064 + 49.1065 + *p = new; 49.1066 + 49.1067 + if (!shared) { 49.1068 + desc->depth = 0; 49.1069 + desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS); 49.1070 + desc->handler->startup(irq); 49.1071 + } 49.1072 + spin_unlock_irqrestore(&desc->lock,flags); 49.1073 + 49.1074 + register_irq_proc(irq); 49.1075 + return 0; 49.1076 +} 49.1077 + 49.1078 +static struct proc_dir_entry * root_irq_dir; 49.1079 +static struct proc_dir_entry * irq_dir [NR_IRQS]; 49.1080 + 49.1081 +#define HEX_DIGITS 8 49.1082 + 49.1083 +static unsigned int parse_hex_value (const char *buffer, 49.1084 + unsigned long count, unsigned long *ret) 49.1085 +{ 49.1086 + unsigned char hexnum [HEX_DIGITS]; 49.1087 + unsigned long value; 49.1088 + int i; 49.1089 + 49.1090 + if (!count) 49.1091 + return -EINVAL; 49.1092 + if (count > HEX_DIGITS) 49.1093 + count = HEX_DIGITS; 49.1094 + if (copy_from_user(hexnum, buffer, count)) 49.1095 + return -EFAULT; 49.1096 + 49.1097 + /* 49.1098 + * Parse the first 8 characters as a hex string, any non-hex char 49.1099 + * is end-of-string. '00e1', 'e1', '00E1', 'E1' are all the same. 49.1100 + */ 49.1101 + value = 0; 49.1102 + 49.1103 + for (i = 0; i < count; i++) { 49.1104 + unsigned int c = hexnum[i]; 49.1105 + 49.1106 + switch (c) { 49.1107 + case '0' ... '9': c -= '0'; break; 49.1108 + case 'a' ... 'f': c -= 'a'-10; break; 49.1109 + case 'A' ... 'F': c -= 'A'-10; break; 49.1110 + default: 49.1111 + goto out; 49.1112 + } 49.1113 + value = (value << 4) | c; 49.1114 + } 49.1115 +out: 49.1116 + *ret = value; 49.1117 + return 0; 49.1118 +} 49.1119 + 49.1120 +#if CONFIG_SMP 49.1121 + 49.1122 +static struct proc_dir_entry * smp_affinity_entry [NR_IRQS]; 49.1123 + 49.1124 +static unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL }; 49.1125 +static int irq_affinity_read_proc (char *page, char **start, off_t off, 49.1126 + int count, int *eof, void *data) 49.1127 +{ 49.1128 + if (count < HEX_DIGITS+1) 49.1129 + return -EINVAL; 49.1130 + return sprintf (page, "%08lx\n", irq_affinity[(long)data]); 49.1131 +} 49.1132 + 49.1133 +static int irq_affinity_write_proc (struct file *file, const char *buffer, 49.1134 + unsigned long count, void *data) 49.1135 +{ 49.1136 + int irq = (long) data, full_count = count, err; 49.1137 + unsigned long new_value; 49.1138 + 49.1139 + if (!irq_desc[irq].handler->set_affinity) 49.1140 + return -EIO; 49.1141 + 49.1142 + err = parse_hex_value(buffer, count, &new_value); 49.1143 + 49.1144 + /* 49.1145 + * Do not allow disabling IRQs completely - it's a too easy 49.1146 + * way to make the system unusable accidentally :-) At least 49.1147 + * one online CPU still has to be targeted. 49.1148 + */ 49.1149 + if (!(new_value & cpu_online_map)) 49.1150 + return -EINVAL; 49.1151 + 49.1152 + irq_affinity[irq] = new_value; 49.1153 + irq_desc[irq].handler->set_affinity(irq, new_value); 49.1154 + 49.1155 + return full_count; 49.1156 +} 49.1157 + 49.1158 +#endif 49.1159 + 49.1160 +static int prof_cpu_mask_read_proc (char *page, char **start, off_t off, 49.1161 + int count, int *eof, void *data) 49.1162 +{ 49.1163 + unsigned long *mask = (unsigned long *) data; 49.1164 + if (count < HEX_DIGITS+1) 49.1165 + return -EINVAL; 49.1166 + return sprintf (page, "%08lx\n", *mask); 49.1167 +} 49.1168 + 49.1169 +static int prof_cpu_mask_write_proc (struct file *file, const char *buffer, 49.1170 + unsigned long count, void *data) 49.1171 +{ 49.1172 + unsigned long *mask = (unsigned long *) data, full_count = count, err; 49.1173 + unsigned long new_value; 49.1174 + 49.1175 + err = parse_hex_value(buffer, count, &new_value); 49.1176 + if (err) 49.1177 + return err; 49.1178 + 49.1179 + *mask = new_value; 49.1180 + return full_count; 49.1181 +} 49.1182 + 49.1183 +#define MAX_NAMELEN 10 49.1184 + 49.1185 +static void register_irq_proc (unsigned int irq) 49.1186 +{ 49.1187 + char name [MAX_NAMELEN]; 49.1188 + 49.1189 + if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) || 49.1190 + irq_dir[irq]) 49.1191 + return; 49.1192 + 49.1193 + memset(name, 0, MAX_NAMELEN); 49.1194 + sprintf(name, "%d", irq); 49.1195 + 49.1196 + /* create /proc/irq/1234 */ 49.1197 + irq_dir[irq] = proc_mkdir(name, root_irq_dir); 49.1198 + 49.1199 +#if CONFIG_SMP 49.1200 + { 49.1201 + struct proc_dir_entry *entry; 49.1202 + 49.1203 + /* create /proc/irq/1234/smp_affinity */ 49.1204 + entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); 49.1205 + 49.1206 + if (entry) { 49.1207 + entry->nlink = 1; 49.1208 + entry->data = (void *)(long)irq; 49.1209 + entry->read_proc = irq_affinity_read_proc; 49.1210 + entry->write_proc = irq_affinity_write_proc; 49.1211 + } 49.1212 + 49.1213 + smp_affinity_entry[irq] = entry; 49.1214 + } 49.1215 +#endif 49.1216 +} 49.1217 + 49.1218 +unsigned long prof_cpu_mask = -1; 49.1219 + 49.1220 +void init_irq_proc (void) 49.1221 +{ 49.1222 + struct proc_dir_entry *entry; 49.1223 + int i; 49.1224 + 49.1225 + /* create /proc/irq */ 49.1226 + root_irq_dir = proc_mkdir("irq", 0); 49.1227 + 49.1228 + /* create /proc/irq/prof_cpu_mask */ 49.1229 + entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir); 49.1230 + 49.1231 + if (!entry) 49.1232 + return; 49.1233 + 49.1234 + entry->nlink = 1; 49.1235 + entry->data = (void *)&prof_cpu_mask; 49.1236 + entry->read_proc = prof_cpu_mask_read_proc; 49.1237 + entry->write_proc = prof_cpu_mask_write_proc; 49.1238 + 49.1239 + /* 49.1240 + * Create entries for all existing IRQs. 49.1241 + */ 49.1242 + for (i = 0; i < NR_IRQS; i++) 49.1243 + register_irq_proc(i); 49.1244 +} 49.1245 +
50.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 50.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/ldt.c Fri Jul 15 06:39:50 2005 -0700 50.3 @@ -0,0 +1,272 @@ 50.4 +/* 50.5 + * linux/kernel/ldt.c 50.6 + * 50.7 + * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds 50.8 + * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com> 50.9 + */ 50.10 + 50.11 +#include <linux/errno.h> 50.12 +#include <linux/sched.h> 50.13 +#include <linux/string.h> 50.14 +#include <linux/mm.h> 50.15 +#include <linux/smp.h> 50.16 +#include <linux/smp_lock.h> 50.17 +#include <linux/vmalloc.h> 50.18 +#include <linux/slab.h> 50.19 + 50.20 +#include <asm/mmu_context.h> 50.21 +#include <asm/uaccess.h> 50.22 +#include <asm/system.h> 50.23 +#include <asm/ldt.h> 50.24 +#include <asm/desc.h> 50.25 + 50.26 +#ifdef CONFIG_SMP /* avoids "defined but not used" warnig */ 50.27 +static void flush_ldt(void *mm) 50.28 +{ 50.29 + if (current->active_mm) 50.30 + load_LDT(¤t->active_mm->context); 50.31 +} 50.32 +#endif 50.33 + 50.34 +static int alloc_ldt(mm_context_t *pc, int mincount, int reload) 50.35 +{ 50.36 + void *oldldt; 50.37 + void *newldt; 50.38 + int oldsize; 50.39 + 50.40 + if (mincount <= pc->size) 50.41 + return 0; 50.42 + oldsize = pc->size; 50.43 + mincount = (mincount+511)&(~511); 50.44 + if (mincount*LDT_ENTRY_SIZE > PAGE_SIZE) 50.45 + newldt = vmalloc(mincount*LDT_ENTRY_SIZE); 50.46 + else 50.47 + newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL); 50.48 + 50.49 + if (!newldt) 50.50 + return -ENOMEM; 50.51 + 50.52 + if (oldsize) 50.53 + memcpy(newldt, pc->ldt, oldsize*LDT_ENTRY_SIZE); 50.54 + 50.55 + oldldt = pc->ldt; 50.56 + memset(newldt+oldsize*LDT_ENTRY_SIZE, 0, (mincount-oldsize)*LDT_ENTRY_SIZE); 50.57 + wmb(); 50.58 + pc->ldt = newldt; 50.59 + pc->size = mincount; 50.60 + if (reload) { 50.61 + make_pages_readonly( 50.62 + pc->ldt, 50.63 + (pc->size*LDT_ENTRY_SIZE)/PAGE_SIZE); 50.64 + load_LDT(pc); 50.65 +#ifdef CONFIG_SMP 50.66 + if (current->mm->cpu_vm_mask != (1<<smp_processor_id())) 50.67 + smp_call_function(flush_ldt, 0, 1, 1); 50.68 +#endif 50.69 + } 50.70 + wmb(); 50.71 + if (oldsize) { 50.72 + make_pages_writable( 50.73 + oldldt, (oldsize*LDT_ENTRY_SIZE)/PAGE_SIZE); 50.74 + if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE) 50.75 + vfree(oldldt); 50.76 + else 50.77 + kfree(oldldt); 50.78 + } 50.79 + return 0; 50.80 +} 50.81 + 50.82 +static inline int copy_ldt(mm_context_t *new, mm_context_t *old) 50.83 +{ 50.84 + int err = alloc_ldt(new, old->size, 0); 50.85 + if (err < 0) { 50.86 + printk(KERN_WARNING "ldt allocation failed\n"); 50.87 + new->size = 0; 50.88 + return err; 50.89 + } 50.90 + memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE); 50.91 + make_pages_readonly(new->ldt, (new->size*LDT_ENTRY_SIZE)/PAGE_SIZE); 50.92 + return 0; 50.93 +} 50.94 + 50.95 +/* 50.96 + * we do not have to muck with descriptors here, that is 50.97 + * done in switch_mm() as needed. 50.98 + */ 50.99 +int init_new_context(struct task_struct *tsk, struct mm_struct *mm) 50.100 +{ 50.101 + struct mm_struct * old_mm; 50.102 + int retval = 0; 50.103 + 50.104 + init_MUTEX(&mm->context.sem); 50.105 + mm->context.size = 0; 50.106 + old_mm = current->mm; 50.107 + if (old_mm && old_mm->context.size > 0) { 50.108 + down(&old_mm->context.sem); 50.109 + retval = copy_ldt(&mm->context, &old_mm->context); 50.110 + up(&old_mm->context.sem); 50.111 + } 50.112 + return retval; 50.113 +} 50.114 + 50.115 +/* 50.116 + * No need to lock the MM as we are the last user 50.117 + * Do not touch the ldt register, we are already 50.118 + * in the next thread. 50.119 + */ 50.120 +void destroy_context(struct mm_struct *mm) 50.121 +{ 50.122 + if (mm->context.size) { 50.123 + make_pages_writable( 50.124 + mm->context.ldt, 50.125 + (mm->context.size*LDT_ENTRY_SIZE)/PAGE_SIZE); 50.126 + if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE) 50.127 + vfree(mm->context.ldt); 50.128 + else 50.129 + kfree(mm->context.ldt); 50.130 + mm->context.size = 0; 50.131 + } 50.132 +} 50.133 + 50.134 +static int read_ldt(void * ptr, unsigned long bytecount) 50.135 +{ 50.136 + int err; 50.137 + unsigned long size; 50.138 + struct mm_struct * mm = current->mm; 50.139 + 50.140 + if (!mm->context.size) 50.141 + return 0; 50.142 + if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES) 50.143 + bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES; 50.144 + 50.145 + down(&mm->context.sem); 50.146 + size = mm->context.size*LDT_ENTRY_SIZE; 50.147 + if (size > bytecount) 50.148 + size = bytecount; 50.149 + 50.150 + err = 0; 50.151 + if (copy_to_user(ptr, mm->context.ldt, size)) 50.152 + err = -EFAULT; 50.153 + up(&mm->context.sem); 50.154 + if (err < 0) 50.155 + return err; 50.156 + if (size != bytecount) { 50.157 + /* zero-fill the rest */ 50.158 + clear_user(ptr+size, bytecount-size); 50.159 + } 50.160 + return bytecount; 50.161 +} 50.162 + 50.163 +static int read_default_ldt(void * ptr, unsigned long bytecount) 50.164 +{ 50.165 + int err; 50.166 + unsigned long size; 50.167 + void *address; 50.168 + 50.169 + err = 0; 50.170 + address = &default_ldt[0]; 50.171 + size = 5*sizeof(struct desc_struct); 50.172 + if (size > bytecount) 50.173 + size = bytecount; 50.174 + 50.175 + err = size; 50.176 + if (copy_to_user(ptr, address, size)) 50.177 + err = -EFAULT; 50.178 + 50.179 + return err; 50.180 +} 50.181 + 50.182 +static int write_ldt(void * ptr, unsigned long bytecount, int oldmode) 50.183 +{ 50.184 + struct mm_struct * mm = current->mm; 50.185 + __u32 entry_1, entry_2, *lp; 50.186 + unsigned long mach_lp; 50.187 + int error; 50.188 + struct modify_ldt_ldt_s ldt_info; 50.189 + 50.190 + error = -EINVAL; 50.191 + if (bytecount != sizeof(ldt_info)) 50.192 + goto out; 50.193 + error = -EFAULT; 50.194 + if (copy_from_user(&ldt_info, ptr, sizeof(ldt_info))) 50.195 + goto out; 50.196 + 50.197 + error = -EINVAL; 50.198 + if (ldt_info.entry_number >= LDT_ENTRIES) 50.199 + goto out; 50.200 + if (ldt_info.contents == 3) { 50.201 + if (oldmode) 50.202 + goto out; 50.203 + if (ldt_info.seg_not_present == 0) 50.204 + goto out; 50.205 + } 50.206 + 50.207 + down(&mm->context.sem); 50.208 + if (ldt_info.entry_number >= mm->context.size) { 50.209 + error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); 50.210 + if (error < 0) 50.211 + goto out_unlock; 50.212 + } 50.213 + 50.214 + lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->context.ldt); 50.215 + mach_lp = arbitrary_virt_to_machine(lp); 50.216 + 50.217 + /* Allow LDTs to be cleared by the user. */ 50.218 + if (ldt_info.base_addr == 0 && ldt_info.limit == 0) { 50.219 + if (oldmode || 50.220 + (ldt_info.contents == 0 && 50.221 + ldt_info.read_exec_only == 1 && 50.222 + ldt_info.seg_32bit == 0 && 50.223 + ldt_info.limit_in_pages == 0 && 50.224 + ldt_info.seg_not_present == 1 && 50.225 + ldt_info.useable == 0 )) { 50.226 + entry_1 = 0; 50.227 + entry_2 = 0; 50.228 + goto install; 50.229 + } 50.230 + } 50.231 + 50.232 + entry_1 = ((ldt_info.base_addr & 0x0000ffff) << 16) | 50.233 + (ldt_info.limit & 0x0ffff); 50.234 + entry_2 = (ldt_info.base_addr & 0xff000000) | 50.235 + ((ldt_info.base_addr & 0x00ff0000) >> 16) | 50.236 + (ldt_info.limit & 0xf0000) | 50.237 + ((ldt_info.read_exec_only ^ 1) << 9) | 50.238 + (ldt_info.contents << 10) | 50.239 + ((ldt_info.seg_not_present ^ 1) << 15) | 50.240 + (ldt_info.seg_32bit << 22) | 50.241 + (ldt_info.limit_in_pages << 23) | 50.242 + 0x7000; 50.243 + if (!oldmode) 50.244 + entry_2 |= (ldt_info.useable << 20); 50.245 + 50.246 + /* Install the new entry ... */ 50.247 +install: 50.248 + error = HYPERVISOR_update_descriptor(mach_lp, entry_1, entry_2); 50.249 + 50.250 +out_unlock: 50.251 + up(&mm->context.sem); 50.252 +out: 50.253 + return error; 50.254 +} 50.255 + 50.256 +asmlinkage int sys_modify_ldt(int func, void *ptr, unsigned long bytecount) 50.257 +{ 50.258 + int ret = -ENOSYS; 50.259 + 50.260 + switch (func) { 50.261 + case 0: 50.262 + ret = read_ldt(ptr, bytecount); 50.263 + break; 50.264 + case 1: 50.265 + ret = write_ldt(ptr, bytecount, 1); 50.266 + break; 50.267 + case 2: 50.268 + ret = read_default_ldt(ptr, bytecount); 50.269 + break; 50.270 + case 0x11: 50.271 + ret = write_ldt(ptr, bytecount, 0); 50.272 + break; 50.273 + } 50.274 + return ret; 50.275 +}
51.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 51.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/pci-pc.c Fri Jul 15 06:39:50 2005 -0700 51.3 @@ -0,0 +1,260 @@ 51.4 +/* 51.5 + * Low-Level PCI Support for PC 51.6 + * 51.7 + * (c) 1999--2000 Martin Mares <mj@ucw.cz> 51.8 + * 51.9 + * Adjusted to use Xen's interface by Rolf Neugebauer, Intel Research Cambridge 51.10 + * Further modifications by Keir Fraser, University of Cambridge 51.11 + */ 51.12 + 51.13 +#include <linux/config.h> 51.14 +#include <linux/types.h> 51.15 +#include <linux/kernel.h> 51.16 +#include <linux/sched.h> 51.17 +#include <linux/pci.h> 51.18 +#include <linux/init.h> 51.19 +#include <linux/ioport.h> 51.20 + 51.21 +#include <asm/segment.h> 51.22 +#include <asm/io.h> 51.23 + 51.24 +#include <asm-xen/xen-public/xen.h> 51.25 +#include <asm-xen/xen-public/physdev.h> 51.26 + 51.27 +#include "pci-i386.h" 51.28 + 51.29 +/* 51.30 + * NB. The following interface functions are not included here: 51.31 + * 1. void eisa_set_level_irq(unsigned int irq) 51.32 + * 2. irq_routing_table * __devinit pcibios_get_irq_routing_table(void) 51.33 + * 3. int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq) 51.34 + * All are used by the ACPI driver. This should be ported to Xen if it is 51.35 + * ever required -- Xen is the ultimate source for IRQ-routing knowledge. 51.36 + */ 51.37 + 51.38 +struct pci_ops *pci_root_ops = NULL; 51.39 + 51.40 +int (*pci_config_read)(int seg, int bus, int dev, int fn, 51.41 + int reg, int len, u32 *value) = NULL; 51.42 +int (*pci_config_write)(int seg, int bus, int dev, int fn, 51.43 + int reg, int len, u32 value) = NULL; 51.44 + 51.45 +unsigned int pci_probe = PCI_PROBE_BIOS; 51.46 + 51.47 +struct pci_fixup pcibios_fixups[] = { { 0 } }; 51.48 + 51.49 +static int pci_confx_read(int seg, int bus, int dev, int fn, int reg, 51.50 + int len, u32 *value) 51.51 +{ 51.52 + int ret; 51.53 + physdev_op_t op; 51.54 + 51.55 + if (bus > 255 || dev > 31 || fn > 7 || reg > 255) 51.56 + return -EINVAL; 51.57 + 51.58 + op.cmd = PHYSDEVOP_PCI_CFGREG_READ; 51.59 + op.u.pci_cfgreg_read.bus = bus; 51.60 + op.u.pci_cfgreg_read.dev = dev; 51.61 + op.u.pci_cfgreg_read.func = fn; 51.62 + op.u.pci_cfgreg_read.reg = reg; 51.63 + op.u.pci_cfgreg_read.len = len; 51.64 + 51.65 + if ( (ret = HYPERVISOR_physdev_op(&op)) != 0 ) 51.66 + return ret; 51.67 + 51.68 + *value = op.u.pci_cfgreg_read.value; 51.69 + 51.70 + return 0; 51.71 +} 51.72 + 51.73 +static int pci_confx_write(int seg, int bus, int dev, int fn, int reg, 51.74 + int len, u32 value) 51.75 +{ 51.76 + int ret; 51.77 + physdev_op_t op; 51.78 + 51.79 + if ((bus > 255 || dev > 31 || fn > 7 || reg > 255)) 51.80 + return -EINVAL; 51.81 + 51.82 + op.cmd = PHYSDEVOP_PCI_CFGREG_WRITE; 51.83 + op.u.pci_cfgreg_write.bus = bus; 51.84 + op.u.pci_cfgreg_write.dev = dev; 51.85 + op.u.pci_cfgreg_write.func = fn; 51.86 + op.u.pci_cfgreg_write.reg = reg; 51.87 + op.u.pci_cfgreg_write.len = len; 51.88 + op.u.pci_cfgreg_write.value = value; 51.89 + 51.90 + if ( (ret = HYPERVISOR_physdev_op(&op)) != 0 ) 51.91 + return ret; 51.92 + return 0; 51.93 +} 51.94 + 51.95 + 51.96 +static int pci_confx_read_config_byte(struct pci_dev *dev, 51.97 + int where, u8 *value) 51.98 +{ 51.99 + int result; 51.100 + u32 data; 51.101 + 51.102 + result = pci_confx_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 51.103 + PCI_FUNC(dev->devfn), where, 1, &data); 51.104 + 51.105 + *value = (u8)data; 51.106 + 51.107 + return result; 51.108 +} 51.109 + 51.110 +static int pci_confx_read_config_word(struct pci_dev *dev, 51.111 + int where, u16 *value) 51.112 +{ 51.113 + int result; 51.114 + u32 data; 51.115 + 51.116 + result = pci_confx_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 51.117 + PCI_FUNC(dev->devfn), where, 2, &data); 51.118 + 51.119 + *value = (u16)data; 51.120 + 51.121 + return result; 51.122 +} 51.123 + 51.124 +static int pci_confx_read_config_dword(struct pci_dev *dev, 51.125 + int where, u32 *value) 51.126 +{ 51.127 + return pci_confx_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 51.128 + PCI_FUNC(dev->devfn), where, 4, value); 51.129 +} 51.130 + 51.131 +static int pci_confx_write_config_byte(struct pci_dev *dev, 51.132 + int where, u8 value) 51.133 +{ 51.134 + return pci_confx_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 51.135 + PCI_FUNC(dev->devfn), where, 1, value); 51.136 +} 51.137 + 51.138 +static int pci_confx_write_config_word(struct pci_dev *dev, 51.139 + int where, u16 value) 51.140 +{ 51.141 + return pci_confx_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 51.142 + PCI_FUNC(dev->devfn), where, 2, value); 51.143 +} 51.144 + 51.145 +static int pci_confx_write_config_dword(struct pci_dev *dev, 51.146 + int where, u32 value) 51.147 +{ 51.148 + return pci_confx_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 51.149 + PCI_FUNC(dev->devfn), where, 4, value); 51.150 +} 51.151 + 51.152 +static struct pci_ops pci_conf_xen = { 51.153 + pci_confx_read_config_byte, 51.154 + pci_confx_read_config_word, 51.155 + pci_confx_read_config_dword, 51.156 + pci_confx_write_config_byte, 51.157 + pci_confx_write_config_word, 51.158 + pci_confx_write_config_dword 51.159 +}; 51.160 + 51.161 +void pcibios_penalize_isa_irq(int irq) 51.162 +{ 51.163 + /* nothing */ 51.164 +} 51.165 + 51.166 +void __devinit pcibios_fixup_bus(struct pci_bus *b) 51.167 +{ 51.168 + pci_read_bridge_bases(b); 51.169 +} 51.170 + 51.171 +struct pci_bus * __devinit pcibios_scan_root(int busnum) 51.172 +{ 51.173 + struct list_head *list; 51.174 + struct pci_bus *bus; 51.175 + 51.176 + list_for_each ( list, &pci_root_buses ) 51.177 + { 51.178 + bus = pci_bus_b(list); 51.179 + if ( bus->number == busnum ) 51.180 + return bus; 51.181 + } 51.182 + 51.183 + printk("PCI: Probing PCI hardware (bus %02x)\n", busnum); 51.184 + return pci_scan_bus(busnum, pci_root_ops, NULL); 51.185 +} 51.186 + 51.187 +void __init pcibios_init(void) 51.188 +{ 51.189 + int bus; 51.190 + physdev_op_t op; 51.191 + 51.192 + if ( !pci_probe ) 51.193 + return; 51.194 + 51.195 + pci_root_ops = &pci_conf_xen; 51.196 + pci_config_read = pci_confx_read; 51.197 + pci_config_write = pci_confx_write; 51.198 + 51.199 + pcibios_set_cacheline_size(); 51.200 + 51.201 + op.cmd = PHYSDEVOP_PCI_PROBE_ROOT_BUSES; 51.202 + if ( HYPERVISOR_physdev_op(&op) != 0 ) 51.203 + { 51.204 + printk(KERN_WARNING "PCI: System does not support PCI\n"); 51.205 + return; 51.206 + } 51.207 + 51.208 + printk(KERN_INFO "PCI: Probing PCI hardware\n"); 51.209 + for ( bus = 0; bus < 256; bus++ ) 51.210 + if ( test_bit(bus, &op.u.pci_probe_root_buses.busmask[0]) ) 51.211 + (void)pcibios_scan_root(bus); 51.212 + 51.213 + pcibios_resource_survey(); 51.214 +} 51.215 + 51.216 +char * __devinit pcibios_setup(char *str) 51.217 +{ 51.218 + if ( !strcmp(str, "off") ) 51.219 + pci_probe = 0; 51.220 + return NULL; 51.221 +} 51.222 + 51.223 +unsigned int pcibios_assign_all_busses(void) 51.224 +{ 51.225 + return 0; 51.226 +} 51.227 + 51.228 +int pcibios_enable_device(struct pci_dev *dev, int mask) 51.229 +{ 51.230 + int err; 51.231 + u8 pin; 51.232 + physdev_op_t op; 51.233 + 51.234 + /* Inform Xen that we are going to use this device. */ 51.235 + op.cmd = PHYSDEVOP_PCI_INITIALISE_DEVICE; 51.236 + op.u.pci_initialise_device.bus = dev->bus->number; 51.237 + op.u.pci_initialise_device.dev = PCI_SLOT(dev->devfn); 51.238 + op.u.pci_initialise_device.func = PCI_FUNC(dev->devfn); 51.239 + if ( (err = HYPERVISOR_physdev_op(&op)) != 0 ) 51.240 + return err; 51.241 + 51.242 + /* Now we can bind to the very final IRQ line. */ 51.243 + pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &pin); 51.244 + dev->irq = pin; 51.245 + 51.246 + /* Turn on device I/O and memory access as necessary. */ 51.247 + if ( (err = pcibios_enable_resources(dev, mask)) < 0 ) 51.248 + return err; 51.249 + 51.250 + /* Sanity-check that an interrupt-producing device is routed to an IRQ. */ 51.251 + pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); 51.252 + if ( pin != 0 ) 51.253 + { 51.254 + if ( dev->irq != 0 ) 51.255 + printk(KERN_INFO "PCI: Obtained IRQ %d for device %s\n", 51.256 + dev->irq, dev->slot_name); 51.257 + else 51.258 + printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of " 51.259 + "device %s.\n", 'A' + pin - 1, dev->slot_name); 51.260 + } 51.261 + 51.262 + return 0; 51.263 +}
52.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 52.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/process.c Fri Jul 15 06:39:50 2005 -0700 52.3 @@ -0,0 +1,448 @@ 52.4 +/* 52.5 + * linux/arch/i386/kernel/process.c 52.6 + * 52.7 + * Copyright (C) 1995 Linus Torvalds 52.8 + * 52.9 + * Pentium III FXSR, SSE support 52.10 + * Gareth Hughes <gareth@valinux.com>, May 2000 52.11 + */ 52.12 + 52.13 +/* 52.14 + * This file handles the architecture-dependent parts of process handling.. 52.15 + */ 52.16 + 52.17 +#define __KERNEL_SYSCALLS__ 52.18 +#include <stdarg.h> 52.19 + 52.20 +#include <linux/errno.h> 52.21 +#include <linux/sched.h> 52.22 +#include <linux/kernel.h> 52.23 +#include <linux/mm.h> 52.24 +#include <linux/smp.h> 52.25 +#include <linux/smp_lock.h> 52.26 +#include <linux/stddef.h> 52.27 +#include <linux/unistd.h> 52.28 +#include <linux/ptrace.h> 52.29 +#include <linux/slab.h> 52.30 +#include <linux/vmalloc.h> 52.31 +#include <linux/user.h> 52.32 +#include <linux/a.out.h> 52.33 +#include <linux/interrupt.h> 52.34 +#include <linux/config.h> 52.35 +#include <linux/delay.h> 52.36 +#include <linux/reboot.h> 52.37 +#include <linux/init.h> 52.38 +#include <linux/mc146818rtc.h> 52.39 + 52.40 +#include <asm/uaccess.h> 52.41 +#include <asm/pgtable.h> 52.42 +#include <asm/system.h> 52.43 +#include <asm/io.h> 52.44 +#include <asm/ldt.h> 52.45 +#include <asm/processor.h> 52.46 +#include <asm/i387.h> 52.47 +#include <asm/desc.h> 52.48 +#include <asm/mmu_context.h> 52.49 +#include <asm-xen/xen-public/physdev.h> 52.50 + 52.51 +#include <linux/irq.h> 52.52 + 52.53 +asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); 52.54 + 52.55 +int hlt_counter; 52.56 + 52.57 +/* 52.58 + * Powermanagement idle function, if any.. 52.59 + */ 52.60 +void (*pm_idle)(void); 52.61 + 52.62 +/* 52.63 + * Power off function, if any 52.64 + */ 52.65 +void (*pm_power_off)(void); 52.66 + 52.67 +void disable_hlt(void) 52.68 +{ 52.69 + hlt_counter++; 52.70 +} 52.71 + 52.72 +void enable_hlt(void) 52.73 +{ 52.74 + hlt_counter--; 52.75 +} 52.76 + 52.77 +/* 52.78 + * The idle thread. There's no useful work to be 52.79 + * done, so just try to conserve power and have a 52.80 + * low exit latency (ie sit in a loop waiting for 52.81 + * somebody to say that they'd like to reschedule) 52.82 + */ 52.83 +void cpu_idle (void) 52.84 +{ 52.85 + extern int set_timeout_timer(void); 52.86 + 52.87 + /* Endless idle loop with no priority at all. */ 52.88 + init_idle(); 52.89 + current->nice = 20; 52.90 + current->counter = -100; 52.91 + 52.92 + for ( ; ; ) 52.93 + { 52.94 + while ( !current->need_resched ) 52.95 + { 52.96 + __cli(); 52.97 + if ( current->need_resched ) 52.98 + { 52.99 + /* The race-free check for events failed. */ 52.100 + __sti(); 52.101 + break; 52.102 + } 52.103 + else if ( set_timeout_timer() == 0 ) 52.104 + { 52.105 + /* NB. Blocking reenable events in a race-free manner. */ 52.106 + HYPERVISOR_block(); 52.107 + } 52.108 + else 52.109 + { 52.110 + /* No race here: yielding will get us the CPU again anyway. */ 52.111 + __sti(); 52.112 + HYPERVISOR_yield(); 52.113 + } 52.114 + } 52.115 + schedule(); 52.116 + check_pgt_cache(); 52.117 + } 52.118 +} 52.119 + 52.120 +extern void show_trace(unsigned long* esp); 52.121 + 52.122 +void show_regs(struct pt_regs * regs) 52.123 +{ 52.124 + printk("\n"); 52.125 + printk("Pid: %d, comm: %20s\n", current->pid, current->comm); 52.126 + printk("EIP: %04x:[<%08lx>] CPU: %d",0xffff & regs->xcs,regs->eip, smp_processor_id()); 52.127 + if (regs->xcs & 2) 52.128 + printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp); 52.129 + printk(" EFLAGS: %08lx %s\n",regs->eflags, print_tainted()); 52.130 + printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", 52.131 + regs->eax,regs->ebx,regs->ecx,regs->edx); 52.132 + printk("ESI: %08lx EDI: %08lx EBP: %08lx", 52.133 + regs->esi, regs->edi, regs->ebp); 52.134 + printk(" DS: %04x ES: %04x\n", 52.135 + 0xffff & regs->xds,0xffff & regs->xes); 52.136 + 52.137 + show_trace(®s->esp); 52.138 +} 52.139 + 52.140 + 52.141 +/* 52.142 + * Create a kernel thread 52.143 + */ 52.144 +int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) 52.145 +{ 52.146 + long retval, d0; 52.147 + 52.148 + __asm__ __volatile__( 52.149 + "movl %%esp,%%esi\n\t" 52.150 + "int $0x80\n\t" /* Linux/i386 system call */ 52.151 + "cmpl %%esp,%%esi\n\t" /* child or parent? */ 52.152 + "je 1f\n\t" /* parent - jump */ 52.153 + /* Load the argument into eax, and push it. That way, it does 52.154 + * not matter whether the called function is compiled with 52.155 + * -mregparm or not. */ 52.156 + "movl %4,%%eax\n\t" 52.157 + "pushl %%eax\n\t" 52.158 + "call *%5\n\t" /* call fn */ 52.159 + "movl %3,%0\n\t" /* exit */ 52.160 + "int $0x80\n" 52.161 + "1:\t" 52.162 + :"=&a" (retval), "=&S" (d0) 52.163 + :"0" (__NR_clone), "i" (__NR_exit), 52.164 + "r" (arg), "r" (fn), 52.165 + "b" (flags | CLONE_VM) 52.166 + : "memory"); 52.167 + 52.168 + return retval; 52.169 +} 52.170 + 52.171 +/* 52.172 + * Free current thread data structures etc.. 52.173 + */ 52.174 +void exit_thread(void) 52.175 +{ 52.176 + /* nothing to do ... */ 52.177 +} 52.178 + 52.179 +void flush_thread(void) 52.180 +{ 52.181 + struct task_struct *tsk = current; 52.182 + 52.183 + memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8); 52.184 + 52.185 + /* 52.186 + * Forget coprocessor state.. 52.187 + */ 52.188 + clear_fpu(tsk); 52.189 + tsk->used_math = 0; 52.190 +} 52.191 + 52.192 +void release_thread(struct task_struct *dead_task) 52.193 +{ 52.194 + if (dead_task->mm) { 52.195 + // temporary debugging check 52.196 + if (dead_task->mm->context.size) { 52.197 + printk("WARNING: dead process %8s still has LDT? <%p/%08x>\n", 52.198 + dead_task->comm, 52.199 + dead_task->mm->context.ldt, 52.200 + dead_task->mm->context.size); 52.201 + BUG(); 52.202 + } 52.203 + } 52.204 + //release_x86_irqs(dead_task); 52.205 +} 52.206 + 52.207 + 52.208 +/* 52.209 + * Save a segment. 52.210 + */ 52.211 +#define savesegment(seg,value) \ 52.212 + asm volatile("movl %%" #seg ",%0":"=m" (*(int *)&(value))) 52.213 + 52.214 +int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, 52.215 + unsigned long unused, 52.216 + struct task_struct * p, struct pt_regs * regs) 52.217 +{ 52.218 + struct pt_regs * childregs; 52.219 + 52.220 + childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p)) - 1; 52.221 + struct_cpy(childregs, regs); 52.222 + childregs->eax = 0; 52.223 + childregs->esp = esp; 52.224 + 52.225 + p->thread.esp = (unsigned long) childregs; 52.226 + p->thread.esp0 = (unsigned long) (childregs+1); 52.227 + 52.228 + p->thread.eip = (unsigned long) ret_from_fork; 52.229 + 52.230 + savesegment(fs,p->thread.fs); 52.231 + savesegment(gs,p->thread.gs); 52.232 + 52.233 + unlazy_fpu(current); 52.234 + struct_cpy(&p->thread.i387, ¤t->thread.i387); 52.235 + 52.236 + p->thread.io_pl = current->thread.io_pl; 52.237 + 52.238 + return 0; 52.239 +} 52.240 + 52.241 +/* 52.242 + * fill in the user structure for a core dump.. 52.243 + */ 52.244 +void dump_thread(struct pt_regs * regs, struct user * dump) 52.245 +{ 52.246 + int i; 52.247 + 52.248 +/* changed the size calculations - should hopefully work better. lbt */ 52.249 + dump->magic = CMAGIC; 52.250 + dump->start_code = 0; 52.251 + dump->start_stack = regs->esp & ~(PAGE_SIZE - 1); 52.252 + dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT; 52.253 + dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT; 52.254 + dump->u_dsize -= dump->u_tsize; 52.255 + dump->u_ssize = 0; 52.256 + for (i = 0; i < 8; i++) 52.257 + dump->u_debugreg[i] = current->thread.debugreg[i]; 52.258 + 52.259 + if (dump->start_stack < TASK_SIZE) 52.260 + dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT; 52.261 + 52.262 + dump->regs.ebx = regs->ebx; 52.263 + dump->regs.ecx = regs->ecx; 52.264 + dump->regs.edx = regs->edx; 52.265 + dump->regs.esi = regs->esi; 52.266 + dump->regs.edi = regs->edi; 52.267 + dump->regs.ebp = regs->ebp; 52.268 + dump->regs.eax = regs->eax; 52.269 + dump->regs.ds = regs->xds; 52.270 + dump->regs.es = regs->xes; 52.271 + savesegment(fs,dump->regs.fs); 52.272 + savesegment(gs,dump->regs.gs); 52.273 + dump->regs.orig_eax = regs->orig_eax; 52.274 + dump->regs.eip = regs->eip; 52.275 + dump->regs.cs = regs->xcs; 52.276 + dump->regs.eflags = regs->eflags; 52.277 + dump->regs.esp = regs->esp; 52.278 + dump->regs.ss = regs->xss; 52.279 + 52.280 + dump->u_fpvalid = dump_fpu (regs, &dump->i387); 52.281 +} 52.282 + 52.283 +/* 52.284 + * switch_to(x,yn) should switch tasks from x to y. 52.285 + * 52.286 + * We fsave/fwait so that an exception goes off at the right time 52.287 + * (as a call from the fsave or fwait in effect) rather than to 52.288 + * the wrong process. Lazy FP saving no longer makes any sense 52.289 + * with modern CPU's, and this simplifies a lot of things (SMP 52.290 + * and UP become the same). 52.291 + * 52.292 + * NOTE! We used to use the x86 hardware context switching. The 52.293 + * reason for not using it any more becomes apparent when you 52.294 + * try to recover gracefully from saved state that is no longer 52.295 + * valid (stale segment register values in particular). With the 52.296 + * hardware task-switch, there is no way to fix up bad state in 52.297 + * a reasonable manner. 52.298 + * 52.299 + * The fact that Intel documents the hardware task-switching to 52.300 + * be slow is a fairly red herring - this code is not noticeably 52.301 + * faster. However, there _is_ some room for improvement here, 52.302 + * so the performance issues may eventually be a valid point. 52.303 + * More important, however, is the fact that this allows us much 52.304 + * more flexibility. 52.305 + */ 52.306 +void fastcall __switch_to(struct task_struct *prev_p, struct task_struct *next_p) 52.307 +{ 52.308 + struct thread_struct *next = &next_p->thread; 52.309 + physdev_op_t op; 52.310 + multicall_entry_t _mcl[8], *mcl = _mcl; 52.311 + 52.312 + /* 52.313 + * This is basically 'unlazy_fpu', except that we queue a multicall to 52.314 + * indicate FPU task switch, rather than synchronously trapping to Xen. 52.315 + */ 52.316 + if ( prev_p->flags & PF_USEDFPU ) 52.317 + { 52.318 + if ( cpu_has_fxsr ) 52.319 + asm volatile( "fxsave %0 ; fnclex" 52.320 + : "=m" (prev_p->thread.i387.fxsave) ); 52.321 + else 52.322 + asm volatile( "fnsave %0 ; fwait" 52.323 + : "=m" (prev_p->thread.i387.fsave) ); 52.324 + prev_p->flags &= ~PF_USEDFPU; 52.325 + mcl->op = __HYPERVISOR_fpu_taskswitch; 52.326 + mcl->args[0] = 1; 52.327 + mcl++; 52.328 + } 52.329 + 52.330 + mcl->op = __HYPERVISOR_stack_switch; 52.331 + mcl->args[0] = __KERNEL_DS; 52.332 + mcl->args[1] = next->esp0; 52.333 + mcl++; 52.334 + 52.335 + if ( prev_p->thread.io_pl != next->io_pl ) 52.336 + { 52.337 + op.cmd = PHYSDEVOP_SET_IOPL; 52.338 + op.u.set_iopl.iopl = next->io_pl; 52.339 + mcl->op = __HYPERVISOR_physdev_op; 52.340 + mcl->args[0] = (unsigned long)&op; 52.341 + mcl++; 52.342 + } 52.343 + 52.344 + (void)HYPERVISOR_multicall(_mcl, mcl - _mcl); 52.345 + 52.346 + /* 52.347 + * Restore %fs and %gs. 52.348 + */ 52.349 + loadsegment(fs, next->fs); 52.350 + loadsegment(gs, next->gs); 52.351 + 52.352 + /* 52.353 + * Now maybe reload the debug registers 52.354 + */ 52.355 + if ( next->debugreg[7] != 0 ) 52.356 + { 52.357 + HYPERVISOR_set_debugreg(0, next->debugreg[0]); 52.358 + HYPERVISOR_set_debugreg(1, next->debugreg[1]); 52.359 + HYPERVISOR_set_debugreg(2, next->debugreg[2]); 52.360 + HYPERVISOR_set_debugreg(3, next->debugreg[3]); 52.361 + /* no 4 and 5 */ 52.362 + HYPERVISOR_set_debugreg(6, next->debugreg[6]); 52.363 + HYPERVISOR_set_debugreg(7, next->debugreg[7]); 52.364 + } 52.365 +} 52.366 + 52.367 +asmlinkage int sys_fork(struct pt_regs regs) 52.368 +{ 52.369 + return do_fork(SIGCHLD, regs.esp, ®s, 0); 52.370 +} 52.371 + 52.372 +asmlinkage int sys_clone(struct pt_regs regs) 52.373 +{ 52.374 + unsigned long clone_flags; 52.375 + unsigned long newsp; 52.376 + 52.377 + clone_flags = regs.ebx; 52.378 + newsp = regs.ecx; 52.379 + if (!newsp) 52.380 + newsp = regs.esp; 52.381 + return do_fork(clone_flags, newsp, ®s, 0); 52.382 +} 52.383 + 52.384 +/* 52.385 + * This is trivial, and on the face of it looks like it 52.386 + * could equally well be done in user mode. 52.387 + * 52.388 + * Not so, for quite unobvious reasons - register pressure. 52.389 + * In user mode vfork() cannot have a stack frame, and if 52.390 + * done by calling the "clone()" system call directly, you 52.391 + * do not have enough call-clobbered registers to hold all 52.392 + * the information you need. 52.393 + */ 52.394 +asmlinkage int sys_vfork(struct pt_regs regs) 52.395 +{ 52.396 + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.esp, ®s, 0); 52.397 +} 52.398 + 52.399 +/* 52.400 + * sys_execve() executes a new program. 52.401 + */ 52.402 +asmlinkage int sys_execve(struct pt_regs regs) 52.403 +{ 52.404 + int error; 52.405 + char * filename; 52.406 + 52.407 + filename = getname((char *) regs.ebx); 52.408 + error = PTR_ERR(filename); 52.409 + if (IS_ERR(filename)) 52.410 + goto out; 52.411 + error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, ®s); 52.412 + if (error == 0) 52.413 + current->ptrace &= ~PT_DTRACE; 52.414 + putname(filename); 52.415 + out: 52.416 + return error; 52.417 +} 52.418 + 52.419 +/* 52.420 + * These bracket the sleeping functions.. 52.421 + */ 52.422 +extern void scheduling_functions_start_here(void); 52.423 +extern void scheduling_functions_end_here(void); 52.424 +#define first_sched ((unsigned long) scheduling_functions_start_here) 52.425 +#define last_sched ((unsigned long) scheduling_functions_end_here) 52.426 + 52.427 +unsigned long get_wchan(struct task_struct *p) 52.428 +{ 52.429 + unsigned long ebp, esp, eip; 52.430 + unsigned long stack_page; 52.431 + int count = 0; 52.432 + if (!p || p == current || p->state == TASK_RUNNING) 52.433 + return 0; 52.434 + stack_page = (unsigned long)p; 52.435 + esp = p->thread.esp; 52.436 + if (!stack_page || esp < stack_page || esp > 8188+stack_page) 52.437 + return 0; 52.438 + /* include/asm-i386/system.h:switch_to() pushes ebp last. */ 52.439 + ebp = *(unsigned long *) esp; 52.440 + do { 52.441 + if (ebp < stack_page || ebp > 8184+stack_page) 52.442 + return 0; 52.443 + eip = *(unsigned long *) (ebp+4); 52.444 + if (eip < first_sched || eip >= last_sched) 52.445 + return eip; 52.446 + ebp = *(unsigned long *) ebp; 52.447 + } while (count++ < 16); 52.448 + return 0; 52.449 +} 52.450 +#undef last_sched 52.451 +#undef first_sched
53.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 53.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/setup.c Fri Jul 15 06:39:50 2005 -0700 53.3 @@ -0,0 +1,1213 @@ 53.4 +/* 53.5 + * linux/arch/i386/kernel/setup.c 53.6 + * 53.7 + * Copyright (C) 1995 Linus Torvalds 53.8 + */ 53.9 + 53.10 +/* 53.11 + * This file handles the architecture-dependent parts of initialization 53.12 + */ 53.13 + 53.14 +#define __KERNEL_SYSCALLS__ 53.15 +static int errno; 53.16 +#include <linux/errno.h> 53.17 +#include <linux/sched.h> 53.18 +#include <linux/kernel.h> 53.19 +#include <linux/mm.h> 53.20 +#include <linux/stddef.h> 53.21 +#include <linux/unistd.h> 53.22 +#include <linux/ptrace.h> 53.23 +#include <linux/slab.h> 53.24 +#include <linux/user.h> 53.25 +#include <linux/a.out.h> 53.26 +#include <linux/tty.h> 53.27 +#include <linux/ioport.h> 53.28 +#include <linux/delay.h> 53.29 +#include <linux/config.h> 53.30 +#include <linux/init.h> 53.31 +#include <linux/apm_bios.h> 53.32 +#ifdef CONFIG_BLK_DEV_RAM 53.33 +#include <linux/blk.h> 53.34 +#endif 53.35 +#include <linux/highmem.h> 53.36 +#include <linux/bootmem.h> 53.37 +#include <linux/seq_file.h> 53.38 +#include <linux/reboot.h> 53.39 +#include <asm/processor.h> 53.40 +#include <linux/console.h> 53.41 +#include <linux/module.h> 53.42 +#include <asm/mtrr.h> 53.43 +#include <asm/uaccess.h> 53.44 +#include <asm/system.h> 53.45 +#include <asm/io.h> 53.46 +#include <asm/smp.h> 53.47 +#include <asm/msr.h> 53.48 +#include <asm/desc.h> 53.49 +#include <asm/dma.h> 53.50 +#include <asm/mpspec.h> 53.51 +#include <asm/mmu_context.h> 53.52 +#include <asm/ctrl_if.h> 53.53 +#include <asm/hypervisor.h> 53.54 +#include <asm-xen/xen-public/physdev.h> 53.55 +#include <linux/netdevice.h> 53.56 +#include <linux/rtnetlink.h> 53.57 +#include <linux/tqueue.h> 53.58 +#include <net/pkt_sched.h> /* dev_(de)activate */ 53.59 + 53.60 +/* 53.61 + * Point at the empty zero page to start with. We map the real shared_info 53.62 + * page as soon as fixmap is up and running. 53.63 + */ 53.64 +shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page; 53.65 + 53.66 +unsigned int *phys_to_machine_mapping, *pfn_to_mfn_frame_list; 53.67 + 53.68 +/* 53.69 + * Machine setup.. 53.70 + */ 53.71 + 53.72 +char ignore_irq13; /* set if exception 16 works */ 53.73 +struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; 53.74 + 53.75 +unsigned long mmu_cr4_features; 53.76 + 53.77 +unsigned char * vgacon_mmap; 53.78 + 53.79 +/* 53.80 + * Bus types .. 53.81 + */ 53.82 +#ifdef CONFIG_EISA 53.83 +int EISA_bus; 53.84 +#endif 53.85 +int MCA_bus; 53.86 + 53.87 +/* for MCA, but anyone else can use it if they want */ 53.88 +unsigned int machine_id; 53.89 +unsigned int machine_submodel_id; 53.90 +unsigned int BIOS_revision; 53.91 +unsigned int mca_pentium_flag; 53.92 + 53.93 +/* For PCI or other memory-mapped resources */ 53.94 +unsigned long pci_mem_start = 0x10000000; 53.95 + 53.96 +/* 53.97 + * Setup options 53.98 + */ 53.99 +struct drive_info_struct { char dummy[32]; } drive_info; 53.100 +struct screen_info screen_info; 53.101 +struct apm_info apm_info; 53.102 +struct sys_desc_table_struct { 53.103 + unsigned short length; 53.104 + unsigned char table[0]; 53.105 +}; 53.106 + 53.107 +unsigned char aux_device_present; 53.108 + 53.109 +extern int root_mountflags; 53.110 +extern char _text, _etext, _edata, _end; 53.111 + 53.112 +extern int blk_nohighio; 53.113 + 53.114 +int enable_acpi_smp_table; 53.115 + 53.116 +/* Raw start-of-day parameters from the hypervisor. */ 53.117 +union xen_start_info_union xen_start_info_union; 53.118 + 53.119 +#define COMMAND_LINE_SIZE MAX_GUEST_CMDLINE 53.120 +static char command_line[COMMAND_LINE_SIZE]; 53.121 +char saved_command_line[COMMAND_LINE_SIZE]; 53.122 + 53.123 +/* parse_mem_cmdline() 53.124 + * returns the value of the mem= boot param converted to pages or 0 53.125 + */ 53.126 +static int __init parse_mem_cmdline (char ** cmdline_p) 53.127 +{ 53.128 + char c = ' ', *to = command_line, *from = saved_command_line; 53.129 + int len = 0; 53.130 + unsigned long long bytes; 53.131 + int mem_param = 0; 53.132 + 53.133 + /* Save unparsed command line copy for /proc/cmdline */ 53.134 + memcpy(saved_command_line, xen_start_info.cmd_line, COMMAND_LINE_SIZE); 53.135 + saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; 53.136 + 53.137 + for (;;) { 53.138 + /* 53.139 + * "mem=nopentium" disables the 4MB page tables. 53.140 + * "mem=XXX[kKmM]" defines a memory region from HIGH_MEM 53.141 + * to <mem>, overriding the bios size. 53.142 + * "mem=XXX[KkmM]@XXX[KkmM]" defines a memory region from 53.143 + * <start> to <start>+<mem>, overriding the bios size. 53.144 + */ 53.145 + if (c == ' ' && !memcmp(from, "mem=", 4)) { 53.146 + if (to != command_line) 53.147 + to--; 53.148 + if (!memcmp(from+4, "nopentium", 9)) { 53.149 + from += 9+4; 53.150 + } else if (!memcmp(from+4, "exactmap", 8)) { 53.151 + from += 8+4; 53.152 + } else { 53.153 + bytes = memparse(from+4, &from); 53.154 + mem_param = bytes>>PAGE_SHIFT; 53.155 + if (*from == '@') 53.156 + (void)memparse(from+1, &from); 53.157 + } 53.158 + } 53.159 + 53.160 + c = *(from++); 53.161 + if (!c) 53.162 + break; 53.163 + if (COMMAND_LINE_SIZE <= ++len) 53.164 + break; 53.165 + *(to++) = c; 53.166 + } 53.167 + *to = '\0'; 53.168 + *cmdline_p = command_line; 53.169 + 53.170 + return mem_param; 53.171 +} 53.172 + 53.173 +/* 53.174 + * Every exception-fixup table is sorted (i.e., kernel main table, and every 53.175 + * module table. Some elements may be out of order if they reference text.init, 53.176 + * for example. 53.177 + */ 53.178 +static void sort_exception_table(struct exception_table_entry *start, 53.179 + struct exception_table_entry *end) 53.180 +{ 53.181 + struct exception_table_entry *p, *q, tmp; 53.182 + 53.183 + for ( p = start; p < end; p++ ) 53.184 + { 53.185 + for ( q = p-1; q > start; q-- ) 53.186 + if ( p->insn > q->insn ) 53.187 + break; 53.188 + if ( ++q != p ) 53.189 + { 53.190 + tmp = *p; 53.191 + memmove(q+1, q, (p-q)*sizeof(*p)); 53.192 + *q = tmp; 53.193 + } 53.194 + } 53.195 +} 53.196 + 53.197 +int xen_module_init(struct module *mod) 53.198 +{ 53.199 + sort_exception_table(mod->ex_table_start, mod->ex_table_end); 53.200 + return 0; 53.201 +} 53.202 + 53.203 +void __init setup_arch(char **cmdline_p) 53.204 +{ 53.205 + int i,j; 53.206 + unsigned long bootmap_size, start_pfn, lmax_low_pfn; 53.207 + int mem_param; /* user specified memory size in pages */ 53.208 + int boot_pfn; /* low pages available for bootmem */ 53.209 + physdev_op_t op; 53.210 + 53.211 + extern void hypervisor_callback(void); 53.212 + extern void failsafe_callback(void); 53.213 + 53.214 + extern unsigned long cpu0_pte_quicklist[]; 53.215 + extern unsigned long cpu0_pgd_quicklist[]; 53.216 + 53.217 + extern const struct exception_table_entry __start___ex_table[]; 53.218 + extern const struct exception_table_entry __stop___ex_table[]; 53.219 + 53.220 + extern char _stext; 53.221 + 53.222 + /* Force a quick death if the kernel panics. */ 53.223 + extern int panic_timeout; 53.224 + if ( panic_timeout == 0 ) 53.225 + panic_timeout = 1; 53.226 + 53.227 + /* Ensure that the kernel exception-fixup table is sorted. */ 53.228 + sort_exception_table(__start___ex_table, __stop___ex_table); 53.229 + 53.230 +#ifndef CONFIG_HIGHIO 53.231 + blk_nohighio = 1; 53.232 +#endif 53.233 + 53.234 + HYPERVISOR_vm_assist( 53.235 + VMASST_CMD_enable, VMASST_TYPE_4gb_segments); 53.236 + HYPERVISOR_vm_assist( 53.237 + VMASST_CMD_enable, VMASST_TYPE_writable_pagetables); 53.238 + 53.239 + HYPERVISOR_set_callbacks( 53.240 + __KERNEL_CS, (unsigned long)hypervisor_callback, 53.241 + __KERNEL_CS, (unsigned long)failsafe_callback); 53.242 + 53.243 + boot_cpu_data.pgd_quick = cpu0_pgd_quicklist; 53.244 + boot_cpu_data.pte_quick = cpu0_pte_quicklist; 53.245 + 53.246 + /* This must be initialized to UNNAMED_MAJOR for ipconfig to work 53.247 + properly. Setting ROOT_DEV to default to /dev/ram0 breaks initrd. */ 53.248 + ROOT_DEV = MKDEV(UNNAMED_MAJOR,0); 53.249 + memset(&drive_info, 0, sizeof(drive_info)); 53.250 + memset(&screen_info, 0, sizeof(screen_info)); 53.251 + 53.252 + /* This is drawn from a dump from vgacon:startup in standard Linux. */ 53.253 + screen_info.orig_video_mode = 3; 53.254 + screen_info.orig_video_isVGA = 1; 53.255 + screen_info.orig_video_lines = 25; 53.256 + screen_info.orig_video_cols = 80; 53.257 + screen_info.orig_video_ega_bx = 3; 53.258 + screen_info.orig_video_points = 16; 53.259 + 53.260 + memset(&apm_info.bios, 0, sizeof(apm_info.bios)); 53.261 + aux_device_present = 0; 53.262 +#ifdef CONFIG_BLK_DEV_RAM 53.263 + rd_image_start = 0; 53.264 + rd_prompt = 0; 53.265 + rd_doload = 0; 53.266 +#endif 53.267 + 53.268 + root_mountflags &= ~MS_RDONLY; 53.269 + init_mm.start_code = (unsigned long) &_text; 53.270 + init_mm.end_code = (unsigned long) &_etext; 53.271 + init_mm.end_data = (unsigned long) &_edata; 53.272 + init_mm.brk = (unsigned long) &_end; 53.273 + 53.274 + /* The mem= kernel command line param overrides the detected amount 53.275 + * of memory. For xenolinux, if this override is larger than detected 53.276 + * memory, then boot using only detected memory and make provisions to 53.277 + * use all of the override value. The hypervisor can give this 53.278 + * domain more memory later on and it will be added to the free 53.279 + * lists at that time. See claim_new_pages() in 53.280 + * arch/xen/drivers/balloon/balloon.c 53.281 + */ 53.282 + mem_param = parse_mem_cmdline(cmdline_p); 53.283 + if (mem_param < xen_start_info.nr_pages) 53.284 + mem_param = xen_start_info.nr_pages; 53.285 + 53.286 +#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) 53.287 +#define PFN_DOWN(x) ((x) >> PAGE_SHIFT) 53.288 +#define PFN_PHYS(x) ((x) << PAGE_SHIFT) 53.289 + 53.290 +/* 53.291 + * 128MB for vmalloc(), iomap(), kmap(), and fixaddr mappings. 53.292 + */ 53.293 +#define VMALLOC_RESERVE (unsigned long)(128 << 20) 53.294 +#define MAXMEM (unsigned long)(HYPERVISOR_VIRT_START-PAGE_OFFSET-VMALLOC_RESERVE) 53.295 +#define MAXMEM_PFN PFN_DOWN(MAXMEM) 53.296 +#define MAX_NONPAE_PFN (1 << 20) 53.297 + 53.298 + /* 53.299 + * Determine low and high memory ranges: 53.300 + */ 53.301 + lmax_low_pfn = max_pfn = mem_param; 53.302 + if (lmax_low_pfn > MAXMEM_PFN) { 53.303 + lmax_low_pfn = MAXMEM_PFN; 53.304 +#ifndef CONFIG_HIGHMEM 53.305 + /* Maximum memory usable is what is directly addressable */ 53.306 + printk(KERN_WARNING "Warning only %ldMB will be used.\n", 53.307 + MAXMEM>>20); 53.308 + if (max_pfn > MAX_NONPAE_PFN) 53.309 + printk(KERN_WARNING "Use a PAE enabled kernel.\n"); 53.310 + else 53.311 + printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n"); 53.312 + max_pfn = lmax_low_pfn; 53.313 +#else /* !CONFIG_HIGHMEM */ 53.314 +#ifndef CONFIG_X86_PAE 53.315 + if (max_pfn > MAX_NONPAE_PFN) { 53.316 + max_pfn = MAX_NONPAE_PFN; 53.317 + printk(KERN_WARNING "Warning only 4GB will be used.\n"); 53.318 + printk(KERN_WARNING "Use a PAE enabled kernel.\n"); 53.319 + } 53.320 +#endif /* !CONFIG_X86_PAE */ 53.321 +#endif /* !CONFIG_HIGHMEM */ 53.322 + } 53.323 + 53.324 +#ifdef CONFIG_HIGHMEM 53.325 + highstart_pfn = highend_pfn = max_pfn; 53.326 + if (max_pfn > MAXMEM_PFN) { 53.327 + highstart_pfn = MAXMEM_PFN; 53.328 + printk(KERN_NOTICE "%ldMB HIGHMEM available.\n", 53.329 + pages_to_mb(highend_pfn - highstart_pfn)); 53.330 + } 53.331 +#endif 53.332 + 53.333 + phys_to_machine_mapping = (unsigned int *)xen_start_info.mfn_list; 53.334 + cur_pgd = init_mm.pgd = (pgd_t *)xen_start_info.pt_base; 53.335 + 53.336 + start_pfn = (__pa(xen_start_info.pt_base) >> PAGE_SHIFT) + 53.337 + xen_start_info.nr_pt_frames; 53.338 + 53.339 + /* 53.340 + * Initialize the boot-time allocator, and free up all RAM. Then reserve 53.341 + * space for OS image, initrd, phys->machine table, bootstrap page table, 53.342 + * and the bootmem bitmap. 53.343 + * NB. There is definitely enough room for the bootmem bitmap in the 53.344 + * bootstrap page table. We are guaranteed to get >=512kB unused 'padding' 53.345 + * for our own use after all bootstrap elements 53.346 + * (see asm-xen/xen-public/xen.h). 53.347 + */ 53.348 + boot_pfn = min((int)xen_start_info.nr_pages,lmax_low_pfn); 53.349 + bootmap_size = init_bootmem(start_pfn,boot_pfn); 53.350 + free_bootmem(0, PFN_PHYS(boot_pfn)); 53.351 + reserve_bootmem(__pa(&_stext), 53.352 + PFN_PHYS(start_pfn) + bootmap_size + PAGE_SIZE-1 - 53.353 + __pa(&_stext)); 53.354 + 53.355 + /* init_bootmem() set the global max_low_pfn to boot_pfn. Now max_low_pfn 53.356 + * can be set to the override value. 53.357 + */ 53.358 + max_low_pfn = lmax_low_pfn; 53.359 + 53.360 +#ifdef CONFIG_BLK_DEV_INITRD 53.361 + if ( xen_start_info.mod_start != 0 ) 53.362 + { 53.363 + if ( (__pa(xen_start_info.mod_start) + xen_start_info.mod_len) <= 53.364 + (max_low_pfn << PAGE_SHIFT) ) 53.365 + { 53.366 + initrd_start = xen_start_info.mod_start; 53.367 + initrd_end = initrd_start + xen_start_info.mod_len; 53.368 + initrd_below_start_ok = 1; 53.369 + } 53.370 + else 53.371 + { 53.372 + printk(KERN_ERR "initrd extends beyond end of memory " 53.373 + "(0x%08lx > 0x%08lx)\ndisabling initrd\n", 53.374 + __pa(xen_start_info.mod_start) + xen_start_info.mod_len, 53.375 + max_low_pfn << PAGE_SHIFT); 53.376 + initrd_start = 0; 53.377 + } 53.378 + } 53.379 +#endif 53.380 + 53.381 + paging_init(); 53.382 + 53.383 + /* Make sure we have a correctly sized P->M table. */ 53.384 + if ( max_pfn != xen_start_info.nr_pages ) 53.385 + { 53.386 + phys_to_machine_mapping = alloc_bootmem_low_pages( 53.387 + max_pfn * sizeof(unsigned long)); 53.388 + if ( max_pfn > xen_start_info.nr_pages ) 53.389 + { 53.390 + memset(phys_to_machine_mapping, ~0, 53.391 + max_pfn * sizeof(unsigned long)); 53.392 + memcpy(phys_to_machine_mapping, 53.393 + (unsigned long *)xen_start_info.mfn_list, 53.394 + xen_start_info.nr_pages * sizeof(unsigned long)); 53.395 + } 53.396 + else 53.397 + { 53.398 + memcpy(phys_to_machine_mapping, 53.399 + (unsigned long *)xen_start_info.mfn_list, 53.400 + max_pfn * sizeof(unsigned long)); 53.401 + if (HYPERVISOR_dom_mem_op( 53.402 + MEMOP_decrease_reservation, 53.403 + (unsigned long *)xen_start_info.mfn_list + max_pfn, 53.404 + xen_start_info.nr_pages - max_pfn, 0) != 53.405 + (xen_start_info.nr_pages - max_pfn)) 53.406 + BUG(); 53.407 + } 53.408 + free_bootmem(__pa(xen_start_info.mfn_list), 53.409 + PFN_PHYS(PFN_UP(xen_start_info.nr_pages * 53.410 + sizeof(unsigned long)))); 53.411 + } 53.412 + 53.413 + pfn_to_mfn_frame_list = alloc_bootmem_low_pages(PAGE_SIZE); 53.414 + for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ ) 53.415 + { 53.416 + pfn_to_mfn_frame_list[j] = 53.417 + virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT; 53.418 + } 53.419 + HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list = 53.420 + virt_to_machine(pfn_to_mfn_frame_list) >> PAGE_SHIFT; 53.421 + 53.422 + op.cmd = PHYSDEVOP_SET_IOPL; 53.423 + op.u.set_iopl.iopl = current->thread.io_pl = 1; 53.424 + HYPERVISOR_physdev_op(&op); 53.425 + 53.426 + if (xen_start_info.flags & SIF_INITDOMAIN ) 53.427 + { 53.428 + if( !(xen_start_info.flags & SIF_PRIVILEGED) ) 53.429 + panic("Xen granted us console access but not privileged status"); 53.430 + 53.431 +#if defined(CONFIG_VT) 53.432 +#if defined(CONFIG_VGA_CONSOLE) 53.433 + conswitchp = &vga_con; 53.434 +#elif defined(CONFIG_DUMMY_CONSOLE) 53.435 + conswitchp = &dummy_con; 53.436 +#endif 53.437 +#endif 53.438 + } 53.439 +} 53.440 + 53.441 +static int cachesize_override __initdata = -1; 53.442 +static int __init cachesize_setup(char *str) 53.443 +{ 53.444 + get_option (&str, &cachesize_override); 53.445 + return 1; 53.446 +} 53.447 +__setup("cachesize=", cachesize_setup); 53.448 + 53.449 +static int __init highio_setup(char *str) 53.450 +{ 53.451 + printk("i386: disabling HIGHMEM block I/O\n"); 53.452 + blk_nohighio = 1; 53.453 + return 1; 53.454 +} 53.455 +__setup("nohighio", highio_setup); 53.456 + 53.457 +static int __init get_model_name(struct cpuinfo_x86 *c) 53.458 +{ 53.459 + unsigned int *v; 53.460 + char *p, *q; 53.461 + 53.462 + if (cpuid_eax(0x80000000) < 0x80000004) 53.463 + return 0; 53.464 + 53.465 + v = (unsigned int *) c->x86_model_id; 53.466 + cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]); 53.467 + cpuid(0x80000003, &v[4], &v[5], &v[6], &v[7]); 53.468 + cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]); 53.469 + c->x86_model_id[48] = 0; 53.470 + 53.471 + /* Intel chips right-justify this string for some dumb reason; 53.472 + undo that brain damage */ 53.473 + p = q = &c->x86_model_id[0]; 53.474 + while ( *p == ' ' ) 53.475 + p++; 53.476 + if ( p != q ) { 53.477 + while ( *p ) 53.478 + *q++ = *p++; 53.479 + while ( q <= &c->x86_model_id[48] ) 53.480 + *q++ = '\0'; /* Zero-pad the rest */ 53.481 + } 53.482 + 53.483 + return 1; 53.484 +} 53.485 + 53.486 + 53.487 +static void __init display_cacheinfo(struct cpuinfo_x86 *c) 53.488 +{ 53.489 + unsigned int n, dummy, ecx, edx, l2size; 53.490 + 53.491 + n = cpuid_eax(0x80000000); 53.492 + 53.493 + if (n >= 0x80000005) { 53.494 + cpuid(0x80000005, &dummy, &dummy, &ecx, &edx); 53.495 + printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n", 53.496 + edx>>24, edx&0xFF, ecx>>24, ecx&0xFF); 53.497 + c->x86_cache_size=(ecx>>24)+(edx>>24); 53.498 + } 53.499 + 53.500 + if (n < 0x80000006) /* Some chips just has a large L1. */ 53.501 + return; 53.502 + 53.503 + ecx = cpuid_ecx(0x80000006); 53.504 + l2size = ecx >> 16; 53.505 + 53.506 + /* AMD errata T13 (order #21922) */ 53.507 + if ((c->x86_vendor == X86_VENDOR_AMD) && (c->x86 == 6)) { 53.508 + if (c->x86_model == 3 && c->x86_mask == 0) /* Duron Rev A0 */ 53.509 + l2size = 64; 53.510 + if (c->x86_model == 4 && 53.511 + (c->x86_mask==0 || c->x86_mask==1)) /* Tbird rev A1/A2 */ 53.512 + l2size = 256; 53.513 + } 53.514 + 53.515 + /* Intel PIII Tualatin. This comes in two flavours. 53.516 + * One has 256kb of cache, the other 512. We have no way 53.517 + * to determine which, so we use a boottime override 53.518 + * for the 512kb model, and assume 256 otherwise. 53.519 + */ 53.520 + if ((c->x86_vendor == X86_VENDOR_INTEL) && (c->x86 == 6) && 53.521 + (c->x86_model == 11) && (l2size == 0)) 53.522 + l2size = 256; 53.523 + 53.524 + if (c->x86_vendor == X86_VENDOR_CENTAUR) { 53.525 + /* VIA C3 CPUs (670-68F) need further shifting. */ 53.526 + if ((c->x86 == 6) && 53.527 + ((c->x86_model == 7) || (c->x86_model == 8))) { 53.528 + l2size >>= 8; 53.529 + } 53.530 + 53.531 + /* VIA also screwed up Nehemiah stepping 1, and made 53.532 + it return '65KB' instead of '64KB' 53.533 + - Note, it seems this may only be in engineering samples. */ 53.534 + if ((c->x86==6) && (c->x86_model==9) && 53.535 + (c->x86_mask==1) && (l2size==65)) 53.536 + l2size -= 1; 53.537 + } 53.538 + 53.539 + /* Allow user to override all this if necessary. */ 53.540 + if (cachesize_override != -1) 53.541 + l2size = cachesize_override; 53.542 + 53.543 + if ( l2size == 0 ) 53.544 + return; /* Again, no L2 cache is possible */ 53.545 + 53.546 + c->x86_cache_size = l2size; 53.547 + 53.548 + printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n", 53.549 + l2size, ecx & 0xFF); 53.550 +} 53.551 + 53.552 +static void __init init_c3(struct cpuinfo_x86 *c) 53.553 +{ 53.554 + /* Test for Centaur Extended Feature Flags presence */ 53.555 + if (cpuid_eax(0xC0000000) >= 0xC0000001) { 53.556 + /* store Centaur Extended Feature Flags as 53.557 + * word 5 of the CPU capability bit array 53.558 + */ 53.559 + c->x86_capability[5] = cpuid_edx(0xC0000001); 53.560 + } 53.561 + 53.562 + switch (c->x86_model) { 53.563 + case 9: /* Nehemiah */ 53.564 + default: 53.565 + get_model_name(c); 53.566 + display_cacheinfo(c); 53.567 + break; 53.568 + } 53.569 +} 53.570 + 53.571 +static void __init init_centaur(struct cpuinfo_x86 *c) 53.572 +{ 53.573 + /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; 53.574 + 3DNow is IDd by bit 31 in extended CPUID (1*3231) anyway */ 53.575 + clear_bit(0*32+31, &c->x86_capability); 53.576 + 53.577 + switch (c->x86) { 53.578 + case 6: 53.579 + init_c3(c); 53.580 + break; 53.581 + default: 53.582 + panic("Unsupported Centaur CPU (%i)\n", c->x86); 53.583 + } 53.584 +} 53.585 + 53.586 +static int __init init_amd(struct cpuinfo_x86 *c) 53.587 +{ 53.588 + int r; 53.589 + 53.590 + /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; 53.591 + 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */ 53.592 + clear_bit(0*32+31, &c->x86_capability); 53.593 + 53.594 + r = get_model_name(c); 53.595 + 53.596 + switch(c->x86) 53.597 + { 53.598 + case 5: /* We don't like AMD K6 */ 53.599 + panic("Unsupported AMD processor\n"); 53.600 + case 6: /* An Athlon/Duron. We can trust the BIOS probably */ 53.601 + break; 53.602 + } 53.603 + 53.604 + display_cacheinfo(c); 53.605 + return r; 53.606 +} 53.607 + 53.608 + 53.609 +static void __init init_intel(struct cpuinfo_x86 *c) 53.610 +{ 53.611 + char *p = NULL; 53.612 + unsigned int l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */ 53.613 + 53.614 + if (c->cpuid_level > 1) { 53.615 + /* supports eax=2 call */ 53.616 + int i, j, n; 53.617 + int regs[4]; 53.618 + unsigned char *dp = (unsigned char *)regs; 53.619 + 53.620 + /* Number of times to iterate */ 53.621 + n = cpuid_eax(2) & 0xFF; 53.622 + 53.623 + for ( i = 0 ; i < n ; i++ ) { 53.624 + cpuid(2, ®s[0], ®s[1], ®s[2], ®s[3]); 53.625 + 53.626 + /* If bit 31 is set, this is an unknown format */ 53.627 + for ( j = 0 ; j < 3 ; j++ ) { 53.628 + if ( regs[j] < 0 ) regs[j] = 0; 53.629 + } 53.630 + 53.631 + /* Byte 0 is level count, not a descriptor */ 53.632 + for ( j = 1 ; j < 16 ; j++ ) { 53.633 + unsigned char des = dp[j]; 53.634 + unsigned char dl, dh; 53.635 + unsigned int cs; 53.636 + 53.637 + dh = des >> 4; 53.638 + dl = des & 0x0F; 53.639 + 53.640 + /* Black magic... */ 53.641 + 53.642 + switch ( dh ) 53.643 + { 53.644 + case 0: 53.645 + switch ( dl ) { 53.646 + case 6: 53.647 + /* L1 I cache */ 53.648 + l1i += 8; 53.649 + break; 53.650 + case 8: 53.651 + /* L1 I cache */ 53.652 + l1i += 16; 53.653 + break; 53.654 + case 10: 53.655 + /* L1 D cache */ 53.656 + l1d += 8; 53.657 + break; 53.658 + case 12: 53.659 + /* L1 D cache */ 53.660 + l1d += 16; 53.661 + break; 53.662 + default:; 53.663 + /* TLB, or unknown */ 53.664 + } 53.665 + break; 53.666 + case 2: 53.667 + if ( dl ) { 53.668 + /* L3 cache */ 53.669 + cs = (dl-1) << 9; 53.670 + l3 += cs; 53.671 + } 53.672 + break; 53.673 + case 4: 53.674 + if ( c->x86 > 6 && dl ) { 53.675 + /* P4 family */ 53.676 + /* L3 cache */ 53.677 + cs = 128 << (dl-1); 53.678 + l3 += cs; 53.679 + break; 53.680 + } 53.681 + /* else same as 8 - fall through */ 53.682 + case 8: 53.683 + if ( dl ) { 53.684 + /* L2 cache */ 53.685 + cs = 128 << (dl-1); 53.686 + l2 += cs; 53.687 + } 53.688 + break; 53.689 + case 6: 53.690 + if (dl > 5) { 53.691 + /* L1 D cache */ 53.692 + cs = 8<<(dl-6); 53.693 + l1d += cs; 53.694 + } 53.695 + break; 53.696 + case 7: 53.697 + if ( dl >= 8 ) 53.698 + { 53.699 + /* L2 cache */ 53.700 + cs = 64<<(dl-8); 53.701 + l2 += cs; 53.702 + } else { 53.703 + /* L0 I cache, count as L1 */ 53.704 + cs = dl ? (16 << (dl-1)) : 12; 53.705 + l1i += cs; 53.706 + } 53.707 + break; 53.708 + default: 53.709 + /* TLB, or something else we don't know about */ 53.710 + break; 53.711 + } 53.712 + } 53.713 + } 53.714 + if ( l1i || l1d ) 53.715 + printk(KERN_INFO "CPU: L1 I cache: %dK, L1 D cache: %dK\n", 53.716 + l1i, l1d); 53.717 + if ( l2 ) 53.718 + printk(KERN_INFO "CPU: L2 cache: %dK\n", l2); 53.719 + if ( l3 ) 53.720 + printk(KERN_INFO "CPU: L3 cache: %dK\n", l3); 53.721 + 53.722 + /* 53.723 + * This assumes the L3 cache is shared; it typically lives in 53.724 + * the northbridge. The L1 caches are included by the L2 53.725 + * cache, and so should not be included for the purpose of 53.726 + * SMP switching weights. 53.727 + */ 53.728 + c->x86_cache_size = l2 ? l2 : (l1i+l1d); 53.729 + } 53.730 + 53.731 + /* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it */ 53.732 + if ( c->x86 == 6 && c->x86_model < 3 && c->x86_mask < 3 ) 53.733 + clear_bit(X86_FEATURE_SEP, &c->x86_capability); 53.734 + 53.735 + /* Names for the Pentium II/Celeron processors 53.736 + detectable only by also checking the cache size. 53.737 + Dixon is NOT a Celeron. */ 53.738 + if (c->x86 == 6) { 53.739 + switch (c->x86_model) { 53.740 + case 5: 53.741 + if (l2 == 0) 53.742 + p = "Celeron (Covington)"; 53.743 + if (l2 == 256) 53.744 + p = "Mobile Pentium II (Dixon)"; 53.745 + break; 53.746 + 53.747 + case 6: 53.748 + if (l2 == 128) 53.749 + p = "Celeron (Mendocino)"; 53.750 + break; 53.751 + 53.752 + case 8: 53.753 + if (l2 == 128) 53.754 + p = "Celeron (Coppermine)"; 53.755 + break; 53.756 + } 53.757 + } 53.758 + 53.759 + if ( p ) 53.760 + strcpy(c->x86_model_id, p); 53.761 +} 53.762 + 53.763 +void __init get_cpu_vendor(struct cpuinfo_x86 *c) 53.764 +{ 53.765 + char *v = c->x86_vendor_id; 53.766 + 53.767 + if (!strcmp(v, "GenuineIntel")) 53.768 + c->x86_vendor = X86_VENDOR_INTEL; 53.769 + else if (!strcmp(v, "AuthenticAMD")) 53.770 + c->x86_vendor = X86_VENDOR_AMD; 53.771 + else if (!strcmp(v, "CentaurHauls")) 53.772 + c->x86_vendor = X86_VENDOR_CENTAUR; 53.773 + else 53.774 + c->x86_vendor = X86_VENDOR_UNKNOWN; 53.775 +} 53.776 + 53.777 +struct cpu_model_info { 53.778 + int vendor; 53.779 + int family; 53.780 + char *model_names[16]; 53.781 +}; 53.782 + 53.783 +/* Naming convention should be: <Name> [(<Codename>)] */ 53.784 +/* This table only is used unless init_<vendor>() below doesn't set it; */ 53.785 +/* in particular, if CPUID levels 0x80000002..4 are supported, this isn't used */ 53.786 +static struct cpu_model_info cpu_models[] __initdata = { 53.787 + { X86_VENDOR_INTEL, 6, 53.788 + { "Pentium Pro A-step", "Pentium Pro", NULL, "Pentium II (Klamath)", 53.789 + NULL, "Pentium II (Deschutes)", "Mobile Pentium II", 53.790 + "Pentium III (Katmai)", "Pentium III (Coppermine)", NULL, 53.791 + "Pentium III (Cascades)", NULL, NULL, NULL, NULL }}, 53.792 + { X86_VENDOR_AMD, 6, /* Is this this really necessary?? */ 53.793 + { "Athlon", "Athlon", 53.794 + "Athlon", NULL, "Athlon", NULL, 53.795 + NULL, NULL, NULL, 53.796 + NULL, NULL, NULL, NULL, NULL, NULL, NULL }} 53.797 +}; 53.798 + 53.799 +/* Look up CPU names by table lookup. */ 53.800 +static char __init *table_lookup_model(struct cpuinfo_x86 *c) 53.801 +{ 53.802 + struct cpu_model_info *info = cpu_models; 53.803 + int i; 53.804 + 53.805 + if ( c->x86_model >= 16 ) 53.806 + return NULL; /* Range check */ 53.807 + 53.808 + for ( i = 0 ; i < sizeof(cpu_models)/sizeof(struct cpu_model_info) ; i++ ) { 53.809 + if ( info->vendor == c->x86_vendor && 53.810 + info->family == c->x86 ) { 53.811 + return info->model_names[c->x86_model]; 53.812 + } 53.813 + info++; 53.814 + } 53.815 + return NULL; /* Not found */ 53.816 +} 53.817 + 53.818 + 53.819 + 53.820 +/* Standard macro to see if a specific flag is changeable */ 53.821 +static inline int flag_is_changeable_p(u32 flag) 53.822 +{ 53.823 + u32 f1, f2; 53.824 + 53.825 + asm("pushfl\n\t" 53.826 + "pushfl\n\t" 53.827 + "popl %0\n\t" 53.828 + "movl %0,%1\n\t" 53.829 + "xorl %2,%0\n\t" 53.830 + "pushl %0\n\t" 53.831 + "popfl\n\t" 53.832 + "pushfl\n\t" 53.833 + "popl %0\n\t" 53.834 + "popfl\n\t" 53.835 + : "=&r" (f1), "=&r" (f2) 53.836 + : "ir" (flag)); 53.837 + 53.838 + return ((f1^f2) & flag) != 0; 53.839 +} 53.840 + 53.841 + 53.842 +/* Probe for the CPUID instruction */ 53.843 +static int __init have_cpuid_p(void) 53.844 +{ 53.845 + return flag_is_changeable_p(X86_EFLAGS_ID); 53.846 +} 53.847 + 53.848 + 53.849 + 53.850 +#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) 53.851 +unsigned char eddnr; 53.852 +struct edd_info edd[EDDMAXNR]; 53.853 +unsigned int edd_disk80_sig; 53.854 +/** 53.855 + * copy_edd() - Copy the BIOS EDD information 53.856 + * from empty_zero_page into a safe place. 53.857 + * 53.858 + */ 53.859 +static inline void copy_edd(void) 53.860 +{ 53.861 + eddnr = EDD_NR; 53.862 + memcpy(edd, EDD_BUF, sizeof(edd)); 53.863 + edd_disk80_sig = DISK80_SIGNATURE_BUFFER; 53.864 +} 53.865 +#else 53.866 +static inline void copy_edd(void) {} 53.867 +#endif 53.868 + 53.869 +/* 53.870 + * This does the hard work of actually picking apart the CPU stuff... 53.871 + */ 53.872 +void __init identify_cpu(struct cpuinfo_x86 *c) 53.873 +{ 53.874 + int junk, i; 53.875 + u32 xlvl, tfms; 53.876 + 53.877 + c->loops_per_jiffy = loops_per_jiffy; 53.878 + c->x86_cache_size = -1; 53.879 + c->x86_vendor = X86_VENDOR_UNKNOWN; 53.880 + c->cpuid_level = -1; /* CPUID not detected */ 53.881 + c->x86_model = c->x86_mask = 0; /* So far unknown... */ 53.882 + c->x86_vendor_id[0] = '\0'; /* Unset */ 53.883 + c->x86_model_id[0] = '\0'; /* Unset */ 53.884 + memset(&c->x86_capability, 0, sizeof c->x86_capability); 53.885 + c->hard_math = 1; 53.886 + 53.887 + if ( !have_cpuid_p() ) { 53.888 + panic("Processor must support CPUID\n"); 53.889 + } else { 53.890 + /* CPU does have CPUID */ 53.891 + 53.892 + /* Get vendor name */ 53.893 + cpuid(0x00000000, &c->cpuid_level, 53.894 + (int *)&c->x86_vendor_id[0], 53.895 + (int *)&c->x86_vendor_id[8], 53.896 + (int *)&c->x86_vendor_id[4]); 53.897 + 53.898 + get_cpu_vendor(c); 53.899 + /* Initialize the standard set of capabilities */ 53.900 + /* Note that the vendor-specific code below might override */ 53.901 + 53.902 + /* Intel-defined flags: level 0x00000001 */ 53.903 + if ( c->cpuid_level >= 0x00000001 ) { 53.904 + u32 capability, excap; 53.905 + cpuid(0x00000001, &tfms, &junk, &excap, &capability); 53.906 + c->x86_capability[0] = capability; 53.907 + c->x86_capability[4] = excap; 53.908 + c->x86 = (tfms >> 8) & 15; 53.909 + c->x86_model = (tfms >> 4) & 15; 53.910 + if (c->x86 == 0xf) { 53.911 + c->x86 += (tfms >> 20) & 0xff; 53.912 + c->x86_model += ((tfms >> 16) & 0xF) << 4; 53.913 + } 53.914 + c->x86_mask = tfms & 15; 53.915 + } else { 53.916 + /* Have CPUID level 0 only - unheard of */ 53.917 + c->x86 = 4; 53.918 + } 53.919 + 53.920 + /* AMD-defined flags: level 0x80000001 */ 53.921 + xlvl = cpuid_eax(0x80000000); 53.922 + if ( (xlvl & 0xffff0000) == 0x80000000 ) { 53.923 + if ( xlvl >= 0x80000001 ) 53.924 + c->x86_capability[1] = cpuid_edx(0x80000001); 53.925 + if ( xlvl >= 0x80000004 ) 53.926 + get_model_name(c); /* Default name */ 53.927 + } 53.928 + 53.929 + /* Transmeta-defined flags: level 0x80860001 */ 53.930 + xlvl = cpuid_eax(0x80860000); 53.931 + if ( (xlvl & 0xffff0000) == 0x80860000 ) { 53.932 + if ( xlvl >= 0x80860001 ) 53.933 + c->x86_capability[2] = cpuid_edx(0x80860001); 53.934 + } 53.935 + } 53.936 + 53.937 + printk(KERN_DEBUG "CPU: Before vendor init, caps: %08x %08x %08x, vendor = %d\n", 53.938 + c->x86_capability[0], 53.939 + c->x86_capability[1], 53.940 + c->x86_capability[2], 53.941 + c->x86_vendor); 53.942 + 53.943 + /* 53.944 + * Vendor-specific initialization. In this section we 53.945 + * canonicalize the feature flags, meaning if there are 53.946 + * features a certain CPU supports which CPUID doesn't 53.947 + * tell us, CPUID claiming incorrect flags, or other bugs, 53.948 + * we handle them here. 53.949 + * 53.950 + * At the end of this section, c->x86_capability better 53.951 + * indicate the features this CPU genuinely supports! 53.952 + */ 53.953 + switch ( c->x86_vendor ) { 53.954 + case X86_VENDOR_AMD: 53.955 + init_amd(c); 53.956 + break; 53.957 + 53.958 + case X86_VENDOR_INTEL: 53.959 + init_intel(c); 53.960 + break; 53.961 + 53.962 + case X86_VENDOR_CENTAUR: 53.963 + init_centaur(c); 53.964 + break; 53.965 + 53.966 + default: 53.967 + printk("Unsupported CPU vendor (%d) -- please report!\n", 53.968 + c->x86_vendor); 53.969 + } 53.970 + 53.971 + printk(KERN_DEBUG "CPU: After vendor init, caps: %08x %08x %08x %08x\n", 53.972 + c->x86_capability[0], 53.973 + c->x86_capability[1], 53.974 + c->x86_capability[2], 53.975 + c->x86_capability[3]); 53.976 + 53.977 + 53.978 + /* If the model name is still unset, do table lookup. */ 53.979 + if ( !c->x86_model_id[0] ) { 53.980 + char *p; 53.981 + p = table_lookup_model(c); 53.982 + if ( p ) 53.983 + strcpy(c->x86_model_id, p); 53.984 + else 53.985 + /* Last resort... */ 53.986 + sprintf(c->x86_model_id, "%02x/%02x", 53.987 + c->x86_vendor, c->x86_model); 53.988 + } 53.989 + 53.990 + /* Now the feature flags better reflect actual CPU features! */ 53.991 + 53.992 + printk(KERN_DEBUG "CPU: After generic, caps: %08x %08x %08x %08x\n", 53.993 + c->x86_capability[0], 53.994 + c->x86_capability[1], 53.995 + c->x86_capability[2], 53.996 + c->x86_capability[3]); 53.997 + 53.998 + /* 53.999 + * On SMP, boot_cpu_data holds the common feature set between 53.1000 + * all CPUs; so make sure that we indicate which features are 53.1001 + * common between the CPUs. The first time this routine gets 53.1002 + * executed, c == &boot_cpu_data. 53.1003 + */ 53.1004 + if ( c != &boot_cpu_data ) { 53.1005 + /* AND the already accumulated flags with these */ 53.1006 + for ( i = 0 ; i < NCAPINTS ; i++ ) 53.1007 + boot_cpu_data.x86_capability[i] &= c->x86_capability[i]; 53.1008 + } 53.1009 + 53.1010 + printk(KERN_DEBUG "CPU: Common caps: %08x %08x %08x %08x\n", 53.1011 + boot_cpu_data.x86_capability[0], 53.1012 + boot_cpu_data.x86_capability[1], 53.1013 + boot_cpu_data.x86_capability[2], 53.1014 + boot_cpu_data.x86_capability[3]); 53.1015 +} 53.1016 + 53.1017 + 53.1018 +/* These need to match <asm/processor.h> */ 53.1019 +static char *cpu_vendor_names[] __initdata = { 53.1020 + "Intel", "Cyrix", "AMD", "UMC", "NexGen", "Centaur", "Rise", "Transmeta" }; 53.1021 + 53.1022 + 53.1023 +void __init print_cpu_info(struct cpuinfo_x86 *c) 53.1024 +{ 53.1025 + char *vendor = NULL; 53.1026 + 53.1027 + if (c->x86_vendor < sizeof(cpu_vendor_names)/sizeof(char *)) 53.1028 + vendor = cpu_vendor_names[c->x86_vendor]; 53.1029 + else if (c->cpuid_level >= 0) 53.1030 + vendor = c->x86_vendor_id; 53.1031 + 53.1032 + if (vendor && strncmp(c->x86_model_id, vendor, strlen(vendor))) 53.1033 + printk("%s ", vendor); 53.1034 + 53.1035 + if (!c->x86_model_id[0]) 53.1036 + printk("%d86", c->x86); 53.1037 + else 53.1038 + printk("%s", c->x86_model_id); 53.1039 + 53.1040 + if (c->x86_mask || c->cpuid_level >= 0) 53.1041 + printk(" stepping %02x\n", c->x86_mask); 53.1042 + else 53.1043 + printk("\n"); 53.1044 +} 53.1045 + 53.1046 +/* 53.1047 + * Get CPU information for use by the procfs. 53.1048 + */ 53.1049 +static int show_cpuinfo(struct seq_file *m, void *v) 53.1050 +{ 53.1051 + /* 53.1052 + * These flag bits must match the definitions in <asm/cpufeature.h>. 53.1053 + * NULL means this bit is undefined or reserved; either way it doesn't 53.1054 + * have meaning as far as Linux is concerned. Note that it's important 53.1055 + * to realize there is a difference between this table and CPUID -- if 53.1056 + * applications want to get the raw CPUID data, they should access 53.1057 + * /dev/cpu/<cpu_nr>/cpuid instead. 53.1058 + */ 53.1059 + static char *x86_cap_flags[] = { 53.1060 + /* Intel-defined */ 53.1061 + "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", 53.1062 + "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov", 53.1063 + "pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx", 53.1064 + "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe", 53.1065 + 53.1066 + /* AMD-defined */ 53.1067 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1068 + NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, 53.1069 + NULL, NULL, NULL, "mp", NULL, NULL, "mmxext", NULL, 53.1070 + NULL, NULL, NULL, NULL, NULL, "lm", "3dnowext", "3dnow", 53.1071 + 53.1072 + /* Transmeta-defined */ 53.1073 + "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, 53.1074 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1075 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1076 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1077 + 53.1078 + /* Other (Linux-defined) */ 53.1079 + "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", 53.1080 + NULL, NULL, NULL, NULL, 53.1081 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1082 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1083 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1084 + 53.1085 + /* Intel-defined (#2) */ 53.1086 + "pni", NULL, NULL, "monitor", "ds_cpl", NULL, NULL, "tm2", 53.1087 + "est", NULL, "cid", NULL, NULL, NULL, NULL, NULL, 53.1088 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1089 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1090 + 53.1091 + /* VIA/Cyrix/Centaur-defined */ 53.1092 + NULL, NULL, "xstore", NULL, NULL, NULL, NULL, NULL, 53.1093 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1094 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1095 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 53.1096 + 53.1097 + }; 53.1098 + struct cpuinfo_x86 *c = v; 53.1099 + int i, n = c - cpu_data; 53.1100 + int fpu_exception; 53.1101 + 53.1102 +#ifdef CONFIG_SMP 53.1103 + if (!(cpu_online_map & (1<<n))) 53.1104 + return 0; 53.1105 +#endif 53.1106 + seq_printf(m, "processor\t: %d\n" 53.1107 + "vendor_id\t: %s\n" 53.1108 + "cpu family\t: %d\n" 53.1109 + "model\t\t: %d\n" 53.1110 + "model name\t: %s\n", 53.1111 + n, 53.1112 + c->x86_vendor_id[0] ? c->x86_vendor_id : "unknown", 53.1113 + c->x86, 53.1114 + c->x86_model, 53.1115 + c->x86_model_id[0] ? c->x86_model_id : "unknown"); 53.1116 + 53.1117 + if (c->x86_mask || c->cpuid_level >= 0) 53.1118 + seq_printf(m, "stepping\t: %d\n", c->x86_mask); 53.1119 + else 53.1120 + seq_printf(m, "stepping\t: unknown\n"); 53.1121 + 53.1122 + if ( test_bit(X86_FEATURE_TSC, &c->x86_capability) ) { 53.1123 + seq_printf(m, "cpu MHz\t\t: %lu.%03lu\n", 53.1124 + cpu_khz / 1000, (cpu_khz % 1000)); 53.1125 + } 53.1126 + 53.1127 + /* Cache size */ 53.1128 + if (c->x86_cache_size >= 0) 53.1129 + seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); 53.1130 + 53.1131 + /* We use exception 16 if we have hardware math and we've either seen it or the CPU claims it is internal */ 53.1132 + fpu_exception = c->hard_math && (ignore_irq13 || cpu_has_fpu); 53.1133 + seq_printf(m, "fdiv_bug\t: %s\n" 53.1134 + "hlt_bug\t\t: %s\n" 53.1135 + "f00f_bug\t: %s\n" 53.1136 + "coma_bug\t: %s\n" 53.1137 + "fpu\t\t: %s\n" 53.1138 + "fpu_exception\t: %s\n" 53.1139 + "cpuid level\t: %d\n" 53.1140 + "wp\t\t: %s\n" 53.1141 + "flags\t\t:", 53.1142 + c->fdiv_bug ? "yes" : "no", 53.1143 + c->hlt_works_ok ? "no" : "yes", 53.1144 + c->f00f_bug ? "yes" : "no", 53.1145 + c->coma_bug ? "yes" : "no", 53.1146 + c->hard_math ? "yes" : "no", 53.1147 + fpu_exception ? "yes" : "no", 53.1148 + c->cpuid_level, 53.1149 + c->wp_works_ok ? "yes" : "no"); 53.1150 + 53.1151 + for ( i = 0 ; i < 32*NCAPINTS ; i++ ) 53.1152 + if ( test_bit(i, &c->x86_capability) && 53.1153 + x86_cap_flags[i] != NULL ) 53.1154 + seq_printf(m, " %s", x86_cap_flags[i]); 53.1155 + 53.1156 + seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n", 53.1157 + c->loops_per_jiffy/(500000/HZ), 53.1158 + (c->loops_per_jiffy/(5000/HZ)) % 100); 53.1159 + return 0; 53.1160 +} 53.1161 + 53.1162 +static void *c_start(struct seq_file *m, loff_t *pos) 53.1163 +{ 53.1164 + return *pos < NR_CPUS ? cpu_data + *pos : NULL; 53.1165 +} 53.1166 +static void *c_next(struct seq_file *m, void *v, loff_t *pos) 53.1167 +{ 53.1168 + ++*pos; 53.1169 + return c_start(m, pos); 53.1170 +} 53.1171 +static void c_stop(struct seq_file *m, void *v) 53.1172 +{ 53.1173 +} 53.1174 +struct seq_operations cpuinfo_op = { 53.1175 + start: c_start, 53.1176 + next: c_next, 53.1177 + stop: c_stop, 53.1178 + show: show_cpuinfo, 53.1179 +}; 53.1180 + 53.1181 +unsigned long cpu_initialized __initdata = 0; 53.1182 + 53.1183 +/* 53.1184 + * cpu_init() initializes state that is per-CPU. Some data is already 53.1185 + * initialized (naturally) in the bootstrap process, such as the GDT 53.1186 + * and IDT. We reload them nevertheless, this function acts as a 53.1187 + * 'CPU state barrier', nothing should get across. 53.1188 + */ 53.1189 +void __init cpu_init (void) 53.1190 +{ 53.1191 + int nr = smp_processor_id(); 53.1192 + 53.1193 + if (test_and_set_bit(nr, &cpu_initialized)) { 53.1194 + printk(KERN_WARNING "CPU#%d already initialized!\n", nr); 53.1195 + for (;;) __sti(); 53.1196 + } 53.1197 + printk(KERN_INFO "Initializing CPU#%d\n", nr); 53.1198 + 53.1199 + /* 53.1200 + * set up and load the per-CPU TSS and LDT 53.1201 + */ 53.1202 + atomic_inc(&init_mm.mm_count); 53.1203 + current->active_mm = &init_mm; 53.1204 + if(current->mm) 53.1205 + BUG(); 53.1206 + enter_lazy_tlb(&init_mm, current, nr); 53.1207 + 53.1208 + HYPERVISOR_stack_switch(__KERNEL_DS, current->thread.esp0); 53.1209 + 53.1210 + load_LDT(&init_mm.context); 53.1211 + 53.1212 + /* Force FPU initialization. */ 53.1213 + current->flags &= ~PF_USEDFPU; 53.1214 + current->used_math = 0; 53.1215 + stts(); 53.1216 +}
54.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 54.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/signal.c Fri Jul 15 06:39:50 2005 -0700 54.3 @@ -0,0 +1,717 @@ 54.4 +/* 54.5 + * linux/arch/i386/kernel/signal.c 54.6 + * 54.7 + * Copyright (C) 1991, 1992 Linus Torvalds 54.8 + * 54.9 + * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson 54.10 + * 2000-06-20 Pentium III FXSR, SSE support by Gareth Hughes 54.11 + */ 54.12 + 54.13 +#include <linux/sched.h> 54.14 +#include <linux/mm.h> 54.15 +#include <linux/smp.h> 54.16 +#include <linux/smp_lock.h> 54.17 +#include <linux/kernel.h> 54.18 +#include <linux/signal.h> 54.19 +#include <linux/errno.h> 54.20 +#include <linux/wait.h> 54.21 +#include <linux/ptrace.h> 54.22 +#include <linux/unistd.h> 54.23 +#include <linux/stddef.h> 54.24 +#include <linux/tty.h> 54.25 +#include <linux/personality.h> 54.26 +#include <asm/ucontext.h> 54.27 +#include <asm/uaccess.h> 54.28 +#include <asm/i387.h> 54.29 + 54.30 +#define DEBUG_SIG 0 54.31 + 54.32 +#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 54.33 + 54.34 +int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset)); 54.35 + 54.36 +int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from) 54.37 +{ 54.38 + if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t))) 54.39 + return -EFAULT; 54.40 + if (from->si_code < 0) 54.41 + return __copy_to_user(to, from, sizeof(siginfo_t)); 54.42 + else { 54.43 + int err; 54.44 + 54.45 + /* If you change siginfo_t structure, please be sure 54.46 + this code is fixed accordingly. 54.47 + It should never copy any pad contained in the structure 54.48 + to avoid security leaks, but must copy the generic 54.49 + 3 ints plus the relevant union member. */ 54.50 + err = __put_user(from->si_signo, &to->si_signo); 54.51 + err |= __put_user(from->si_errno, &to->si_errno); 54.52 + err |= __put_user((short)from->si_code, &to->si_code); 54.53 + /* First 32bits of unions are always present. */ 54.54 + err |= __put_user(from->si_pid, &to->si_pid); 54.55 + switch (from->si_code >> 16) { 54.56 + case __SI_FAULT >> 16: 54.57 + break; 54.58 + case __SI_CHLD >> 16: 54.59 + err |= __put_user(from->si_utime, &to->si_utime); 54.60 + err |= __put_user(from->si_stime, &to->si_stime); 54.61 + err |= __put_user(from->si_status, &to->si_status); 54.62 + default: 54.63 + err |= __put_user(from->si_uid, &to->si_uid); 54.64 + break; 54.65 + /* case __SI_RT: This is not generated by the kernel as of now. */ 54.66 + } 54.67 + return err; 54.68 + } 54.69 +} 54.70 + 54.71 +/* 54.72 + * Atomically swap in the new signal mask, and wait for a signal. 54.73 + */ 54.74 +asmlinkage int 54.75 +sys_sigsuspend(int history0, int history1, old_sigset_t mask) 54.76 +{ 54.77 + struct pt_regs * regs = (struct pt_regs *) &history0; 54.78 + sigset_t saveset; 54.79 + 54.80 + mask &= _BLOCKABLE; 54.81 + spin_lock_irq(¤t->sigmask_lock); 54.82 + saveset = current->blocked; 54.83 + siginitset(¤t->blocked, mask); 54.84 + recalc_sigpending(current); 54.85 + spin_unlock_irq(¤t->sigmask_lock); 54.86 + 54.87 + regs->eax = -EINTR; 54.88 + while (1) { 54.89 + current->state = TASK_INTERRUPTIBLE; 54.90 + schedule(); 54.91 + if (do_signal(regs, &saveset)) 54.92 + return -EINTR; 54.93 + } 54.94 +} 54.95 + 54.96 +asmlinkage int 54.97 +sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize) 54.98 +{ 54.99 + struct pt_regs * regs = (struct pt_regs *) &unewset; 54.100 + sigset_t saveset, newset; 54.101 + 54.102 + /* XXX: Don't preclude handling different sized sigset_t's. */ 54.103 + if (sigsetsize != sizeof(sigset_t)) 54.104 + return -EINVAL; 54.105 + 54.106 + if (copy_from_user(&newset, unewset, sizeof(newset))) 54.107 + return -EFAULT; 54.108 + sigdelsetmask(&newset, ~_BLOCKABLE); 54.109 + 54.110 + spin_lock_irq(¤t->sigmask_lock); 54.111 + saveset = current->blocked; 54.112 + current->blocked = newset; 54.113 + recalc_sigpending(current); 54.114 + spin_unlock_irq(¤t->sigmask_lock); 54.115 + 54.116 + regs->eax = -EINTR; 54.117 + while (1) { 54.118 + current->state = TASK_INTERRUPTIBLE; 54.119 + schedule(); 54.120 + if (do_signal(regs, &saveset)) 54.121 + return -EINTR; 54.122 + } 54.123 +} 54.124 + 54.125 +asmlinkage int 54.126 +sys_sigaction(int sig, const struct old_sigaction *act, 54.127 + struct old_sigaction *oact) 54.128 +{ 54.129 + struct k_sigaction new_ka, old_ka; 54.130 + int ret; 54.131 + 54.132 + if (act) { 54.133 + old_sigset_t mask; 54.134 + if (verify_area(VERIFY_READ, act, sizeof(*act)) || 54.135 + __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 54.136 + __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) 54.137 + return -EFAULT; 54.138 + __get_user(new_ka.sa.sa_flags, &act->sa_flags); 54.139 + __get_user(mask, &act->sa_mask); 54.140 + siginitset(&new_ka.sa.sa_mask, mask); 54.141 + } 54.142 + 54.143 + ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); 54.144 + 54.145 + if (!ret && oact) { 54.146 + if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || 54.147 + __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 54.148 + __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) 54.149 + return -EFAULT; 54.150 + __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 54.151 + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); 54.152 + } 54.153 + 54.154 + return ret; 54.155 +} 54.156 + 54.157 +asmlinkage int 54.158 +sys_sigaltstack(const stack_t *uss, stack_t *uoss) 54.159 +{ 54.160 + struct pt_regs *regs = (struct pt_regs *) &uss; 54.161 + return do_sigaltstack(uss, uoss, regs->esp); 54.162 +} 54.163 + 54.164 + 54.165 +/* 54.166 + * Do a signal return; undo the signal stack. 54.167 + */ 54.168 + 54.169 +struct sigframe 54.170 +{ 54.171 + char *pretcode; 54.172 + int sig; 54.173 + struct sigcontext sc; 54.174 + struct _fpstate fpstate; 54.175 + unsigned long extramask[_NSIG_WORDS-1]; 54.176 + char retcode[8]; 54.177 +}; 54.178 + 54.179 +struct rt_sigframe 54.180 +{ 54.181 + char *pretcode; 54.182 + int sig; 54.183 + struct siginfo *pinfo; 54.184 + void *puc; 54.185 + struct siginfo info; 54.186 + struct ucontext uc; 54.187 + struct _fpstate fpstate; 54.188 + char retcode[8]; 54.189 +}; 54.190 + 54.191 +static int 54.192 +restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *peax) 54.193 +{ 54.194 + unsigned int err = 0; 54.195 + 54.196 +#define COPY(x) err |= __get_user(regs->x, &sc->x) 54.197 + 54.198 +#define COPY_SEG(seg) \ 54.199 + { unsigned short tmp; \ 54.200 + err |= __get_user(tmp, &sc->seg); \ 54.201 + regs->x##seg = tmp; } 54.202 + 54.203 +#define COPY_SEG_STRICT(seg) \ 54.204 + { unsigned short tmp; \ 54.205 + err |= __get_user(tmp, &sc->seg); \ 54.206 + regs->x##seg = tmp|3; } 54.207 + 54.208 +#define GET_SEG(seg) \ 54.209 + { unsigned short tmp; \ 54.210 + err |= __get_user(tmp, &sc->seg); \ 54.211 + loadsegment(seg,tmp); } 54.212 + 54.213 + GET_SEG(gs); 54.214 + GET_SEG(fs); 54.215 + COPY_SEG(es); 54.216 + COPY_SEG(ds); 54.217 + COPY(edi); 54.218 + COPY(esi); 54.219 + COPY(ebp); 54.220 + COPY(esp); 54.221 + COPY(ebx); 54.222 + COPY(edx); 54.223 + COPY(ecx); 54.224 + COPY(eip); 54.225 + COPY_SEG_STRICT(cs); 54.226 + COPY_SEG_STRICT(ss); 54.227 + 54.228 + { 54.229 + unsigned int tmpflags; 54.230 + err |= __get_user(tmpflags, &sc->eflags); 54.231 + regs->eflags = (regs->eflags & ~0x40DD5) | (tmpflags & 0x40DD5); 54.232 + regs->orig_eax = -1; /* disable syscall checks */ 54.233 + } 54.234 + 54.235 + { 54.236 + struct _fpstate * buf; 54.237 + err |= __get_user(buf, &sc->fpstate); 54.238 + if (buf) { 54.239 + if (verify_area(VERIFY_READ, buf, sizeof(*buf))) 54.240 + goto badframe; 54.241 + err |= restore_i387(buf); 54.242 + } 54.243 + } 54.244 + 54.245 + err |= __get_user(*peax, &sc->eax); 54.246 + return err; 54.247 + 54.248 +badframe: 54.249 + return 1; 54.250 +} 54.251 + 54.252 +asmlinkage int sys_sigreturn(unsigned long __unused) 54.253 +{ 54.254 + struct pt_regs *regs = (struct pt_regs *) &__unused; 54.255 + struct sigframe *frame = (struct sigframe *)(regs->esp - 8); 54.256 + sigset_t set; 54.257 + int eax; 54.258 + 54.259 + if (verify_area(VERIFY_READ, frame, sizeof(*frame))) 54.260 + goto badframe; 54.261 + if (__get_user(set.sig[0], &frame->sc.oldmask) 54.262 + || (_NSIG_WORDS > 1 54.263 + && __copy_from_user(&set.sig[1], &frame->extramask, 54.264 + sizeof(frame->extramask)))) 54.265 + goto badframe; 54.266 + 54.267 + sigdelsetmask(&set, ~_BLOCKABLE); 54.268 + spin_lock_irq(¤t->sigmask_lock); 54.269 + current->blocked = set; 54.270 + recalc_sigpending(current); 54.271 + spin_unlock_irq(¤t->sigmask_lock); 54.272 + 54.273 + if (restore_sigcontext(regs, &frame->sc, &eax)) 54.274 + goto badframe; 54.275 + return eax; 54.276 + 54.277 +badframe: 54.278 + force_sig(SIGSEGV, current); 54.279 + return 0; 54.280 +} 54.281 + 54.282 +asmlinkage int sys_rt_sigreturn(unsigned long __unused) 54.283 +{ 54.284 + struct pt_regs *regs = (struct pt_regs *) &__unused; 54.285 + struct rt_sigframe *frame = (struct rt_sigframe *)(regs->esp - 4); 54.286 + sigset_t set; 54.287 + stack_t st; 54.288 + int eax; 54.289 + 54.290 + if (verify_area(VERIFY_READ, frame, sizeof(*frame))) 54.291 + goto badframe; 54.292 + if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) 54.293 + goto badframe; 54.294 + 54.295 + sigdelsetmask(&set, ~_BLOCKABLE); 54.296 + spin_lock_irq(¤t->sigmask_lock); 54.297 + current->blocked = set; 54.298 + recalc_sigpending(current); 54.299 + spin_unlock_irq(¤t->sigmask_lock); 54.300 + 54.301 + if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax)) 54.302 + goto badframe; 54.303 + 54.304 + if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) 54.305 + goto badframe; 54.306 + /* It is more difficult to avoid calling this function than to 54.307 + call it and ignore errors. */ 54.308 + do_sigaltstack(&st, NULL, regs->esp); 54.309 + 54.310 + return eax; 54.311 + 54.312 +badframe: 54.313 + force_sig(SIGSEGV, current); 54.314 + return 0; 54.315 +} 54.316 + 54.317 +/* 54.318 + * Set up a signal frame. 54.319 + */ 54.320 + 54.321 +static int 54.322 +setup_sigcontext(struct sigcontext *sc, struct _fpstate *fpstate, 54.323 + struct pt_regs *regs, unsigned long mask) 54.324 +{ 54.325 + int tmp, err = 0; 54.326 + 54.327 + tmp = 0; 54.328 + __asm__("movl %%gs,%0" : "=r"(tmp): "0"(tmp)); 54.329 + err |= __put_user(tmp, (unsigned int *)&sc->gs); 54.330 + __asm__("movl %%fs,%0" : "=r"(tmp): "0"(tmp)); 54.331 + err |= __put_user(tmp, (unsigned int *)&sc->fs); 54.332 + 54.333 + err |= __put_user(regs->xes, (unsigned int *)&sc->es); 54.334 + err |= __put_user(regs->xds, (unsigned int *)&sc->ds); 54.335 + err |= __put_user(regs->edi, &sc->edi); 54.336 + err |= __put_user(regs->esi, &sc->esi); 54.337 + err |= __put_user(regs->ebp, &sc->ebp); 54.338 + err |= __put_user(regs->esp, &sc->esp); 54.339 + err |= __put_user(regs->ebx, &sc->ebx); 54.340 + err |= __put_user(regs->edx, &sc->edx); 54.341 + err |= __put_user(regs->ecx, &sc->ecx); 54.342 + err |= __put_user(regs->eax, &sc->eax); 54.343 + err |= __put_user(current->thread.trap_no, &sc->trapno); 54.344 + err |= __put_user(current->thread.error_code, &sc->err); 54.345 + err |= __put_user(regs->eip, &sc->eip); 54.346 + err |= __put_user(regs->xcs, (unsigned int *)&sc->cs); 54.347 + err |= __put_user(regs->eflags, &sc->eflags); 54.348 + err |= __put_user(regs->esp, &sc->esp_at_signal); 54.349 + err |= __put_user(regs->xss, (unsigned int *)&sc->ss); 54.350 + 54.351 + tmp = save_i387(fpstate); 54.352 + if (tmp < 0) 54.353 + err = 1; 54.354 + else 54.355 + err |= __put_user(tmp ? fpstate : NULL, &sc->fpstate); 54.356 + 54.357 + /* non-iBCS2 extensions.. */ 54.358 + err |= __put_user(mask, &sc->oldmask); 54.359 + err |= __put_user(current->thread.cr2, &sc->cr2); 54.360 + 54.361 + return err; 54.362 +} 54.363 + 54.364 +/* 54.365 + * Determine which stack to use.. 54.366 + */ 54.367 +static inline void * 54.368 +get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size) 54.369 +{ 54.370 + unsigned long esp; 54.371 + 54.372 + /* Default to using normal stack */ 54.373 + esp = regs->esp; 54.374 + 54.375 + /* This is the X/Open sanctioned signal stack switching. */ 54.376 + if (ka->sa.sa_flags & SA_ONSTACK) { 54.377 + if (sas_ss_flags(esp) == 0) 54.378 + esp = current->sas_ss_sp + current->sas_ss_size; 54.379 + } 54.380 + 54.381 + /* This is the legacy signal stack switching. */ 54.382 + else if ((regs->xss & 0xffff) != __USER_DS && 54.383 + !(ka->sa.sa_flags & SA_RESTORER) && 54.384 + ka->sa.sa_restorer) { 54.385 + esp = (unsigned long) ka->sa.sa_restorer; 54.386 + } 54.387 + 54.388 + return (void *)((esp - frame_size) & -8ul); 54.389 +} 54.390 + 54.391 +static void setup_frame(int sig, struct k_sigaction *ka, 54.392 + sigset_t *set, struct pt_regs * regs) 54.393 +{ 54.394 + struct sigframe *frame; 54.395 + int err = 0; 54.396 + 54.397 + frame = get_sigframe(ka, regs, sizeof(*frame)); 54.398 + 54.399 + if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 54.400 + goto give_sigsegv; 54.401 + 54.402 + err |= __put_user((current->exec_domain 54.403 + && current->exec_domain->signal_invmap 54.404 + && sig < 32 54.405 + ? current->exec_domain->signal_invmap[sig] 54.406 + : sig), 54.407 + &frame->sig); 54.408 + if (err) 54.409 + goto give_sigsegv; 54.410 + 54.411 + err |= setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]); 54.412 + if (err) 54.413 + goto give_sigsegv; 54.414 + 54.415 + if (_NSIG_WORDS > 1) { 54.416 + err |= __copy_to_user(frame->extramask, &set->sig[1], 54.417 + sizeof(frame->extramask)); 54.418 + } 54.419 + if (err) 54.420 + goto give_sigsegv; 54.421 + 54.422 + /* Set up to return from userspace. If provided, use a stub 54.423 + already in userspace. */ 54.424 + if (ka->sa.sa_flags & SA_RESTORER) { 54.425 + err |= __put_user(ka->sa.sa_restorer, &frame->pretcode); 54.426 + } else { 54.427 + err |= __put_user(frame->retcode, &frame->pretcode); 54.428 + /* This is popl %eax ; movl $,%eax ; int $0x80 */ 54.429 + err |= __put_user(0xb858, (short *)(frame->retcode+0)); 54.430 + err |= __put_user(__NR_sigreturn, (int *)(frame->retcode+2)); 54.431 + err |= __put_user(0x80cd, (short *)(frame->retcode+6)); 54.432 + } 54.433 + 54.434 + if (err) 54.435 + goto give_sigsegv; 54.436 + 54.437 + /* Set up registers for signal handler */ 54.438 + regs->esp = (unsigned long) frame; 54.439 + regs->eip = (unsigned long) ka->sa.sa_handler; 54.440 + 54.441 + set_fs(USER_DS); 54.442 + regs->xds = __USER_DS; 54.443 + regs->xes = __USER_DS; 54.444 + regs->xss = __USER_DS; 54.445 + regs->xcs = __USER_CS; 54.446 + regs->eflags &= ~TF_MASK; 54.447 + 54.448 +#if DEBUG_SIG 54.449 + printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", 54.450 + current->comm, current->pid, frame, regs->eip, frame->pretcode); 54.451 +#endif 54.452 + 54.453 + return; 54.454 + 54.455 +give_sigsegv: 54.456 + if (sig == SIGSEGV) 54.457 + ka->sa.sa_handler = SIG_DFL; 54.458 + force_sig(SIGSEGV, current); 54.459 +} 54.460 + 54.461 +static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 54.462 + sigset_t *set, struct pt_regs * regs) 54.463 +{ 54.464 + struct rt_sigframe *frame; 54.465 + int err = 0; 54.466 + 54.467 + frame = get_sigframe(ka, regs, sizeof(*frame)); 54.468 + 54.469 + if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 54.470 + goto give_sigsegv; 54.471 + 54.472 + err |= __put_user((current->exec_domain 54.473 + && current->exec_domain->signal_invmap 54.474 + && sig < 32 54.475 + ? current->exec_domain->signal_invmap[sig] 54.476 + : sig), 54.477 + &frame->sig); 54.478 + err |= __put_user(&frame->info, &frame->pinfo); 54.479 + err |= __put_user(&frame->uc, &frame->puc); 54.480 + err |= copy_siginfo_to_user(&frame->info, info); 54.481 + if (err) 54.482 + goto give_sigsegv; 54.483 + 54.484 + /* Create the ucontext. */ 54.485 + err |= __put_user(0, &frame->uc.uc_flags); 54.486 + err |= __put_user(0, &frame->uc.uc_link); 54.487 + err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 54.488 + err |= __put_user(sas_ss_flags(regs->esp), 54.489 + &frame->uc.uc_stack.ss_flags); 54.490 + err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); 54.491 + err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate, 54.492 + regs, set->sig[0]); 54.493 + err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 54.494 + if (err) 54.495 + goto give_sigsegv; 54.496 + 54.497 + /* Set up to return from userspace. If provided, use a stub 54.498 + already in userspace. */ 54.499 + if (ka->sa.sa_flags & SA_RESTORER) { 54.500 + err |= __put_user(ka->sa.sa_restorer, &frame->pretcode); 54.501 + } else { 54.502 + err |= __put_user(frame->retcode, &frame->pretcode); 54.503 + /* This is movl $,%eax ; int $0x80 */ 54.504 + err |= __put_user(0xb8, (char *)(frame->retcode+0)); 54.505 + err |= __put_user(__NR_rt_sigreturn, (int *)(frame->retcode+1)); 54.506 + err |= __put_user(0x80cd, (short *)(frame->retcode+5)); 54.507 + } 54.508 + 54.509 + if (err) 54.510 + goto give_sigsegv; 54.511 + 54.512 + /* Set up registers for signal handler */ 54.513 + regs->esp = (unsigned long) frame; 54.514 + regs->eip = (unsigned long) ka->sa.sa_handler; 54.515 + 54.516 + set_fs(USER_DS); 54.517 + regs->xds = __USER_DS; 54.518 + regs->xes = __USER_DS; 54.519 + regs->xss = __USER_DS; 54.520 + regs->xcs = __USER_CS; 54.521 + regs->eflags &= ~TF_MASK; 54.522 + 54.523 +#if DEBUG_SIG 54.524 + printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", 54.525 + current->comm, current->pid, frame, regs->eip, frame->pretcode); 54.526 +#endif 54.527 + 54.528 + return; 54.529 + 54.530 +give_sigsegv: 54.531 + if (sig == SIGSEGV) 54.532 + ka->sa.sa_handler = SIG_DFL; 54.533 + force_sig(SIGSEGV, current); 54.534 +} 54.535 + 54.536 +/* 54.537 + * OK, we're invoking a handler 54.538 + */ 54.539 + 54.540 +static void 54.541 +handle_signal(unsigned long sig, struct k_sigaction *ka, 54.542 + siginfo_t *info, sigset_t *oldset, struct pt_regs * regs) 54.543 +{ 54.544 + /* Are we from a system call? */ 54.545 + if (regs->orig_eax >= 0) { 54.546 + /* If so, check system call restarting.. */ 54.547 + switch (regs->eax) { 54.548 + case -ERESTARTNOHAND: 54.549 + regs->eax = -EINTR; 54.550 + break; 54.551 + 54.552 + case -ERESTARTSYS: 54.553 + if (!(ka->sa.sa_flags & SA_RESTART)) { 54.554 + regs->eax = -EINTR; 54.555 + break; 54.556 + } 54.557 + /* fallthrough */ 54.558 + case -ERESTARTNOINTR: 54.559 + regs->eax = regs->orig_eax; 54.560 + regs->eip -= 2; 54.561 + } 54.562 + } 54.563 + 54.564 + /* Set up the stack frame */ 54.565 + if (ka->sa.sa_flags & SA_SIGINFO) 54.566 + setup_rt_frame(sig, ka, info, oldset, regs); 54.567 + else 54.568 + setup_frame(sig, ka, oldset, regs); 54.569 + 54.570 + if (ka->sa.sa_flags & SA_ONESHOT) 54.571 + ka->sa.sa_handler = SIG_DFL; 54.572 + 54.573 + if (!(ka->sa.sa_flags & SA_NODEFER)) { 54.574 + spin_lock_irq(¤t->sigmask_lock); 54.575 + sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); 54.576 + sigaddset(¤t->blocked,sig); 54.577 + recalc_sigpending(current); 54.578 + spin_unlock_irq(¤t->sigmask_lock); 54.579 + } 54.580 +} 54.581 + 54.582 +/* 54.583 + * Note that 'init' is a special process: it doesn't get signals it doesn't 54.584 + * want to handle. Thus you cannot kill init even with a SIGKILL even by 54.585 + * mistake. 54.586 + */ 54.587 +int fastcall do_signal(struct pt_regs *regs, sigset_t *oldset) 54.588 +{ 54.589 + siginfo_t info; 54.590 + struct k_sigaction *ka; 54.591 + 54.592 + /* 54.593 + * We want the common case to go fast, which 54.594 + * is why we may in certain cases get here from 54.595 + * kernel mode. Just return without doing anything 54.596 + * if so. 54.597 + */ 54.598 + if ((regs->xcs & 2) != 2) 54.599 + return 1; 54.600 + 54.601 + if (!oldset) 54.602 + oldset = ¤t->blocked; 54.603 + 54.604 + for (;;) { 54.605 + unsigned long signr; 54.606 + 54.607 + spin_lock_irq(¤t->sigmask_lock); 54.608 + signr = dequeue_signal(¤t->blocked, &info); 54.609 + spin_unlock_irq(¤t->sigmask_lock); 54.610 + 54.611 + if (!signr) 54.612 + break; 54.613 + 54.614 + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { 54.615 + /* Let the debugger run. */ 54.616 + current->exit_code = signr; 54.617 + current->state = TASK_STOPPED; 54.618 + notify_parent(current, SIGCHLD); 54.619 + schedule(); 54.620 + 54.621 + /* We're back. Did the debugger cancel the sig? */ 54.622 + if (!(signr = current->exit_code)) 54.623 + continue; 54.624 + current->exit_code = 0; 54.625 + 54.626 + /* The debugger continued. Ignore SIGSTOP. */ 54.627 + if (signr == SIGSTOP) 54.628 + continue; 54.629 + 54.630 + /* Update the siginfo structure. Is this good? */ 54.631 + if (signr != info.si_signo) { 54.632 + info.si_signo = signr; 54.633 + info.si_errno = 0; 54.634 + info.si_code = SI_USER; 54.635 + info.si_pid = current->p_pptr->pid; 54.636 + info.si_uid = current->p_pptr->uid; 54.637 + } 54.638 + 54.639 + /* If the (new) signal is now blocked, requeue it. */ 54.640 + if (sigismember(¤t->blocked, signr)) { 54.641 + send_sig_info(signr, &info, current); 54.642 + continue; 54.643 + } 54.644 + } 54.645 + 54.646 + ka = ¤t->sig->action[signr-1]; 54.647 + if (ka->sa.sa_handler == SIG_IGN) { 54.648 + if (signr != SIGCHLD) 54.649 + continue; 54.650 + /* Check for SIGCHLD: it's special. */ 54.651 + while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0) 54.652 + /* nothing */; 54.653 + continue; 54.654 + } 54.655 + 54.656 + if (ka->sa.sa_handler == SIG_DFL) { 54.657 + int exit_code = signr; 54.658 + 54.659 + /* Init gets no signals it doesn't want. */ 54.660 + if (current->pid == 1) 54.661 + continue; 54.662 + 54.663 + switch (signr) { 54.664 + case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG: 54.665 + continue; 54.666 + 54.667 + case SIGTSTP: case SIGTTIN: case SIGTTOU: 54.668 + if (is_orphaned_pgrp(current->pgrp)) 54.669 + continue; 54.670 + /* FALLTHRU */ 54.671 + 54.672 + case SIGSTOP: { 54.673 + struct signal_struct *sig; 54.674 + current->state = TASK_STOPPED; 54.675 + current->exit_code = signr; 54.676 + sig = current->p_pptr->sig; 54.677 + if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP)) 54.678 + notify_parent(current, SIGCHLD); 54.679 + schedule(); 54.680 + continue; 54.681 + } 54.682 + 54.683 + case SIGQUIT: case SIGILL: case SIGTRAP: 54.684 + case SIGABRT: case SIGFPE: case SIGSEGV: 54.685 + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: 54.686 + if (do_coredump(signr, regs)) 54.687 + exit_code |= 0x80; 54.688 + /* FALLTHRU */ 54.689 + 54.690 + default: 54.691 + sig_exit(signr, exit_code, &info); 54.692 + /* NOTREACHED */ 54.693 + } 54.694 + } 54.695 + 54.696 + /* Reenable any watchpoints before delivering the 54.697 + * signal to user space. The processor register will 54.698 + * have been cleared if the watchpoint triggered 54.699 + * inside the kernel. 54.700 + */ 54.701 + if ( current->thread.debugreg[7] != 0 ) 54.702 + HYPERVISOR_set_debugreg(7, current->thread.debugreg[7]); 54.703 + 54.704 + /* Whee! Actually deliver the signal. */ 54.705 + handle_signal(signr, ka, &info, oldset, regs); 54.706 + return 1; 54.707 + } 54.708 + 54.709 + /* Did we come from a system call? */ 54.710 + if (regs->orig_eax >= 0) { 54.711 + /* Restart the system call - no handlers present */ 54.712 + if (regs->eax == -ERESTARTNOHAND || 54.713 + regs->eax == -ERESTARTSYS || 54.714 + regs->eax == -ERESTARTNOINTR) { 54.715 + regs->eax = regs->orig_eax; 54.716 + regs->eip -= 2; 54.717 + } 54.718 + } 54.719 + return 0; 54.720 +}
55.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 55.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/time.c Fri Jul 15 06:39:50 2005 -0700 55.3 @@ -0,0 +1,721 @@ 55.4 +/* -*- Mode:C; c-basic-offset:4; tab-width:4 -*- 55.5 + **************************************************************************** 55.6 + * (C) 2002-2003 - Rolf Neugebauer - Intel Research Cambridge 55.7 + * (C) 2002-2003 - Keir Fraser - University of Cambridge 55.8 + **************************************************************************** 55.9 + * 55.10 + * File: arch/xen/kernel/time.c 55.11 + * Author: Rolf Neugebauer and Keir Fraser 55.12 + * 55.13 + * Description: Interface with Xen to get correct notion of time 55.14 + */ 55.15 + 55.16 +/* 55.17 + * linux/arch/i386/kernel/time.c 55.18 + * 55.19 + * Copyright (C) 1991, 1992, 1995 Linus Torvalds 55.20 + * 55.21 + * This file contains the PC-specific time handling details: 55.22 + * reading the RTC at bootup, etc.. 55.23 + * 1994-07-02 Alan Modra 55.24 + * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime 55.25 + * 1995-03-26 Markus Kuhn 55.26 + * fixed 500 ms bug at call to set_rtc_mmss, fixed DS12887 55.27 + * precision CMOS clock update 55.28 + * 1996-05-03 Ingo Molnar 55.29 + * fixed time warps in do_[slow|fast]_gettimeoffset() 55.30 + * 1997-09-10 Updated NTP code according to technical memorandum Jan '96 55.31 + * "A Kernel Model for Precision Timekeeping" by Dave Mills 55.32 + * 1998-09-05 (Various) 55.33 + * More robust do_fast_gettimeoffset() algorithm implemented 55.34 + * (works with APM, Cyrix 6x86MX and Centaur C6), 55.35 + * monotonic gettimeofday() with fast_get_timeoffset(), 55.36 + * drift-proof precision TSC calibration on boot 55.37 + * (C. Scott Ananian <cananian@alumni.princeton.edu>, Andrew D. 55.38 + * Balsa <andrebalsa@altern.org>, Philip Gladstone <philip@raptor.com>; 55.39 + * ported from 2.0.35 Jumbo-9 by Michael Krause <m.krause@tu-harburg.de>). 55.40 + * 1998-12-16 Andrea Arcangeli 55.41 + * Fixed Jumbo-9 code in 2.1.131: do_gettimeofday was missing 1 jiffy 55.42 + * because was not accounting lost_ticks. 55.43 + * 1998-12-24 Copyright (C) 1998 Andrea Arcangeli 55.44 + * Fixed a xtime SMP race (we need the xtime_lock rw spinlock to 55.45 + * serialize accesses to xtime/lost_ticks). 55.46 + */ 55.47 + 55.48 +#include <asm/smp.h> 55.49 +#include <asm/irq.h> 55.50 +#include <asm/msr.h> 55.51 +#include <asm/delay.h> 55.52 +#include <asm/mpspec.h> 55.53 +#include <asm/uaccess.h> 55.54 +#include <asm/processor.h> 55.55 + 55.56 +#include <asm/div64.h> 55.57 +#include <asm/hypervisor.h> 55.58 +#include <asm-xen/xen-public/dom0_ops.h> 55.59 + 55.60 +#include <linux/mc146818rtc.h> 55.61 +#include <linux/kernel.h> 55.62 +#include <linux/interrupt.h> 55.63 +#include <linux/time.h> 55.64 +#include <linux/init.h> 55.65 +#include <linux/smp.h> 55.66 +#include <linux/irq.h> 55.67 +#include <linux/sysctl.h> 55.68 +#include <linux/sysrq.h> 55.69 + 55.70 +spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; 55.71 +extern rwlock_t xtime_lock; 55.72 +extern unsigned long wall_jiffies; 55.73 + 55.74 +unsigned long cpu_khz; /* get this from Xen, used elsewhere */ 55.75 + 55.76 +static unsigned int rdtsc_bitshift; 55.77 +static u32 st_scale_f; /* convert ticks -> usecs */ 55.78 +static u32 st_scale_i; /* convert ticks -> usecs */ 55.79 + 55.80 +/* These are peridically updated in shared_info, and then copied here. */ 55.81 +static u32 shadow_tsc_stamp; 55.82 +static u64 shadow_system_time; 55.83 +static u32 shadow_time_version; 55.84 +static struct timeval shadow_tv; 55.85 + 55.86 +/* 55.87 + * We use this to ensure that gettimeofday() is monotonically increasing. We 55.88 + * only break this guarantee if the wall clock jumps backwards "a long way". 55.89 + */ 55.90 +static struct timeval last_seen_tv = {0,0}; 55.91 + 55.92 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST 55.93 +/* Periodically propagate synchronised time base to the RTC and to Xen. */ 55.94 +static long last_update_to_rtc, last_update_to_xen; 55.95 +#endif 55.96 + 55.97 +/* Periodically take synchronised time base from Xen, if we need it. */ 55.98 +static long last_update_from_xen; /* UTC seconds when last read Xen clock. */ 55.99 + 55.100 +/* Keep track of last time we did processing/updating of jiffies and xtime. */ 55.101 +static u64 processed_system_time; /* System time (ns) at last processing. */ 55.102 + 55.103 +#define NS_PER_TICK (1000000000ULL/HZ) 55.104 + 55.105 +#ifndef NSEC_PER_SEC 55.106 +#define NSEC_PER_SEC (1000000000L) 55.107 +#endif 55.108 + 55.109 +#define HANDLE_USEC_UNDERFLOW(_tv) \ 55.110 + do { \ 55.111 + while ( (_tv).tv_usec < 0 ) \ 55.112 + { \ 55.113 + (_tv).tv_usec += 1000000; \ 55.114 + (_tv).tv_sec--; \ 55.115 + } \ 55.116 + } while ( 0 ) 55.117 +#define HANDLE_USEC_OVERFLOW(_tv) \ 55.118 + do { \ 55.119 + while ( (_tv).tv_usec >= 1000000 ) \ 55.120 + { \ 55.121 + (_tv).tv_usec -= 1000000; \ 55.122 + (_tv).tv_sec++; \ 55.123 + } \ 55.124 + } while ( 0 ) 55.125 +static inline void __normalize_time(time_t *sec, s64 *nsec) 55.126 +{ 55.127 + while (*nsec >= NSEC_PER_SEC) { 55.128 + (*nsec) -= NSEC_PER_SEC; 55.129 + (*sec)++; 55.130 + } 55.131 + while (*nsec < 0) { 55.132 + (*nsec) += NSEC_PER_SEC; 55.133 + (*sec)--; 55.134 + } 55.135 +} 55.136 + 55.137 +/* Dynamically-mapped IRQs. */ 55.138 +static int time_irq, debug_irq; 55.139 + 55.140 +/* Does this guest OS track Xen time, or set its wall clock independently? */ 55.141 +static int independent_wallclock = 0; 55.142 +static int __init __independent_wallclock(char *str) 55.143 +{ 55.144 + independent_wallclock = 1; 55.145 + return 1; 55.146 +} 55.147 +__setup("independent_wallclock", __independent_wallclock); 55.148 +#define INDEPENDENT_WALLCLOCK() \ 55.149 + (independent_wallclock || (xen_start_info.flags & SIF_INITDOMAIN)) 55.150 + 55.151 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST 55.152 +/* 55.153 + * In order to set the CMOS clock precisely, set_rtc_mmss has to be 55.154 + * called 500 ms after the second nowtime has started, because when 55.155 + * nowtime is written into the registers of the CMOS clock, it will 55.156 + * jump to the next second precisely 500 ms later. Check the Motorola 55.157 + * MC146818A or Dallas DS12887 data sheet for details. 55.158 + * 55.159 + * BUG: This routine does not handle hour overflow properly; it just 55.160 + * sets the minutes. Usually you'll only notice that after reboot! 55.161 + */ 55.162 +static int set_rtc_mmss(unsigned long nowtime) 55.163 +{ 55.164 + int retval = 0; 55.165 + int real_seconds, real_minutes, cmos_minutes; 55.166 + unsigned char save_control, save_freq_select; 55.167 + 55.168 + /* gets recalled with irq locally disabled */ 55.169 + spin_lock(&rtc_lock); 55.170 + save_control = CMOS_READ(RTC_CONTROL); 55.171 + CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL); 55.172 + 55.173 + save_freq_select = CMOS_READ(RTC_FREQ_SELECT); 55.174 + CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT); 55.175 + 55.176 + cmos_minutes = CMOS_READ(RTC_MINUTES); 55.177 + if ( !(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD ) 55.178 + BCD_TO_BIN(cmos_minutes); 55.179 + 55.180 + /* 55.181 + * since we're only adjusting minutes and seconds, don't interfere with 55.182 + * hour overflow. This avoids messing with unknown time zones but requires 55.183 + * your RTC not to be off by more than 15 minutes 55.184 + */ 55.185 + real_seconds = nowtime % 60; 55.186 + real_minutes = nowtime / 60; 55.187 + if ( ((abs(real_minutes - cmos_minutes) + 15)/30) & 1 ) 55.188 + real_minutes += 30; /* correct for half hour time zone */ 55.189 + real_minutes %= 60; 55.190 + 55.191 + if ( abs(real_minutes - cmos_minutes) < 30 ) 55.192 + { 55.193 + if ( !(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD ) 55.194 + { 55.195 + BIN_TO_BCD(real_seconds); 55.196 + BIN_TO_BCD(real_minutes); 55.197 + } 55.198 + CMOS_WRITE(real_seconds,RTC_SECONDS); 55.199 + CMOS_WRITE(real_minutes,RTC_MINUTES); 55.200 + } 55.201 + else 55.202 + { 55.203 + printk(KERN_WARNING 55.204 + "set_rtc_mmss: can't update from %d to %d\n", 55.205 + cmos_minutes, real_minutes); 55.206 + retval = -1; 55.207 + } 55.208 + 55.209 + /* The following flags have to be released exactly in this order, 55.210 + * otherwise the DS12887 (popular MC146818A clone with integrated 55.211 + * battery and quartz) will not reset the oscillator and will not 55.212 + * update precisely 500 ms later. You won't find this mentioned in 55.213 + * the Dallas Semiconductor data sheets, but who believes data 55.214 + * sheets anyway ... -- Markus Kuhn 55.215 + */ 55.216 + CMOS_WRITE(save_control, RTC_CONTROL); 55.217 + CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); 55.218 + spin_unlock(&rtc_lock); 55.219 + 55.220 + return retval; 55.221 +} 55.222 +#endif 55.223 + 55.224 + 55.225 +/* 55.226 + * Reads a consistent set of time-base values from Xen, into a shadow data 55.227 + * area. Must be called with the xtime_lock held for writing. 55.228 + */ 55.229 +static void __get_time_values_from_xen(void) 55.230 +{ 55.231 + do { 55.232 + shadow_time_version = HYPERVISOR_shared_info->time_version2; 55.233 + rmb(); 55.234 + shadow_tv.tv_sec = HYPERVISOR_shared_info->wc_sec; 55.235 + shadow_tv.tv_usec = HYPERVISOR_shared_info->wc_usec; 55.236 + shadow_tsc_stamp = 55.237 + (u32)(HYPERVISOR_shared_info->tsc_timestamp >> rdtsc_bitshift); 55.238 + shadow_system_time = HYPERVISOR_shared_info->system_time; 55.239 + rmb(); 55.240 + } 55.241 + while ( shadow_time_version != HYPERVISOR_shared_info->time_version1 ); 55.242 +} 55.243 + 55.244 +#define TIME_VALUES_UP_TO_DATE \ 55.245 + ({ rmb(); (shadow_time_version == HYPERVISOR_shared_info->time_version2); }) 55.246 + 55.247 + 55.248 +/* 55.249 + * Returns the system time elapsed, in ns, since the current shadow_timestamp 55.250 + * was calculated. Must be called with the xtime_lock held for reading. 55.251 + */ 55.252 +static inline unsigned long __get_time_delta_usecs(void) 55.253 +{ 55.254 + s32 delta_tsc; 55.255 + u32 low; 55.256 + u64 delta, tsc; 55.257 + 55.258 + rdtscll(tsc); 55.259 + low = (u32)(tsc >> rdtsc_bitshift); 55.260 + delta_tsc = (s32)(low - shadow_tsc_stamp); 55.261 + if ( unlikely(delta_tsc < 0) ) delta_tsc = 0; 55.262 + delta = ((u64)delta_tsc * st_scale_f); 55.263 + delta >>= 32; 55.264 + delta += ((u64)delta_tsc * st_scale_i); 55.265 + 55.266 + return (unsigned long)delta; 55.267 +} 55.268 + 55.269 + 55.270 +/* 55.271 + * Returns the current time-of-day in UTC timeval format. 55.272 + */ 55.273 +void do_gettimeofday(struct timeval *tv) 55.274 +{ 55.275 + unsigned long flags, lost; 55.276 + struct timeval _tv; 55.277 + s64 nsec; 55.278 + 55.279 + again: 55.280 + read_lock_irqsave(&xtime_lock, flags); 55.281 + 55.282 + _tv.tv_usec = __get_time_delta_usecs(); 55.283 + if ( (lost = (jiffies - wall_jiffies)) != 0 ) 55.284 + _tv.tv_usec += lost * (1000000 / HZ); 55.285 + _tv.tv_sec = xtime.tv_sec; 55.286 + _tv.tv_usec += xtime.tv_usec; 55.287 + 55.288 + nsec = shadow_system_time - processed_system_time; 55.289 + __normalize_time(&_tv.tv_sec, &nsec); 55.290 + _tv.tv_usec += (long)nsec / 1000L; 55.291 + 55.292 + if ( unlikely(!TIME_VALUES_UP_TO_DATE) ) 55.293 + { 55.294 + /* 55.295 + * We may have blocked for a long time, rendering our calculations 55.296 + * invalid (e.g. the time delta may have overflowed). Detect that 55.297 + * and recalculate with fresh values. 55.298 + */ 55.299 + read_unlock_irqrestore(&xtime_lock, flags); 55.300 + write_lock_irqsave(&xtime_lock, flags); 55.301 + __get_time_values_from_xen(); 55.302 + write_unlock_irqrestore(&xtime_lock, flags); 55.303 + goto again; 55.304 + } 55.305 + 55.306 + HANDLE_USEC_OVERFLOW(_tv); 55.307 + 55.308 + /* Ensure that time-of-day is monotonically increasing. */ 55.309 + if ( (_tv.tv_sec < last_seen_tv.tv_sec) || 55.310 + ((_tv.tv_sec == last_seen_tv.tv_sec) && 55.311 + (_tv.tv_usec < last_seen_tv.tv_usec)) ) 55.312 + _tv = last_seen_tv; 55.313 + last_seen_tv = _tv; 55.314 + 55.315 + read_unlock_irqrestore(&xtime_lock, flags); 55.316 + 55.317 + *tv = _tv; 55.318 +} 55.319 + 55.320 + 55.321 +/* 55.322 + * Sets the current time-of-day based on passed-in UTC timeval parameter. 55.323 + */ 55.324 +void do_settimeofday(struct timeval *tv) 55.325 +{ 55.326 + struct timeval newtv; 55.327 + s64 nsec; 55.328 + suseconds_t usec; 55.329 + 55.330 + if ( !INDEPENDENT_WALLCLOCK() ) 55.331 + return; 55.332 + 55.333 + write_lock_irq(&xtime_lock); 55.334 + 55.335 + /* 55.336 + * Ensure we don't get blocked for a long time so that our time delta 55.337 + * overflows. If that were to happen then our shadow time values would 55.338 + * be stale, so we can retry with fresh ones. 55.339 + */ 55.340 + again: 55.341 + usec = tv->tv_usec - __get_time_delta_usecs(); 55.342 + 55.343 + nsec = shadow_system_time - processed_system_time; 55.344 + __normalize_time(&tv->tv_sec, &nsec); 55.345 + usec -= (long)nsec / 1000L; 55.346 + 55.347 + if ( unlikely(!TIME_VALUES_UP_TO_DATE) ) 55.348 + { 55.349 + __get_time_values_from_xen(); 55.350 + goto again; 55.351 + } 55.352 + tv->tv_usec = usec; 55.353 + 55.354 + HANDLE_USEC_UNDERFLOW(*tv); 55.355 + 55.356 + newtv = *tv; 55.357 + 55.358 + tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ); 55.359 + HANDLE_USEC_UNDERFLOW(*tv); 55.360 + 55.361 + xtime = *tv; 55.362 + time_adjust = 0; /* stop active adjtime() */ 55.363 + time_status |= STA_UNSYNC; 55.364 + time_maxerror = NTP_PHASE_LIMIT; 55.365 + time_esterror = NTP_PHASE_LIMIT; 55.366 + 55.367 + /* Reset all our running time counts. They make no sense now. */ 55.368 + last_seen_tv.tv_sec = 0; 55.369 + last_update_from_xen = 0; 55.370 + 55.371 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST 55.372 + if ( xen_start_info.flags & SIF_INITDOMAIN ) 55.373 + { 55.374 + dom0_op_t op; 55.375 + last_update_to_rtc = last_update_to_xen = 0; 55.376 + op.cmd = DOM0_SETTIME; 55.377 + op.u.settime.secs = newtv.tv_sec; 55.378 + op.u.settime.usecs = newtv.tv_usec; 55.379 + op.u.settime.system_time = shadow_system_time; 55.380 + write_unlock_irq(&xtime_lock); 55.381 + HYPERVISOR_dom0_op(&op); 55.382 + } 55.383 + else 55.384 +#endif 55.385 + { 55.386 + write_unlock_irq(&xtime_lock); 55.387 + } 55.388 +} 55.389 + 55.390 + 55.391 +asmlinkage long sys_stime(int *tptr) 55.392 +{ 55.393 + int value; 55.394 + struct timeval tv; 55.395 + 55.396 + if ( !capable(CAP_SYS_TIME) ) 55.397 + return -EPERM; 55.398 + 55.399 + if ( get_user(value, tptr) ) 55.400 + return -EFAULT; 55.401 + 55.402 + tv.tv_sec = value; 55.403 + tv.tv_usec = 0; 55.404 + 55.405 + do_settimeofday(&tv); 55.406 + 55.407 + return 0; 55.408 +} 55.409 + 55.410 + 55.411 +/* Convert jiffies to system time. Call with xtime_lock held for reading. */ 55.412 +static inline u64 __jiffies_to_st(unsigned long j) 55.413 +{ 55.414 + return processed_system_time + ((j - jiffies) * NS_PER_TICK); 55.415 +} 55.416 + 55.417 + 55.418 +static inline void do_timer_interrupt(int irq, void *dev_id, 55.419 + struct pt_regs *regs) 55.420 +{ 55.421 + s64 delta; 55.422 + unsigned long ticks = 0; 55.423 + long sec_diff; 55.424 + 55.425 + do { 55.426 + __get_time_values_from_xen(); 55.427 + 55.428 + delta = (s64)(shadow_system_time + 55.429 + ((s64)__get_time_delta_usecs() * 1000LL) - 55.430 + processed_system_time); 55.431 + } 55.432 + while ( !TIME_VALUES_UP_TO_DATE ); 55.433 + 55.434 + if ( unlikely(delta < 0) ) 55.435 + { 55.436 + printk("Timer ISR: Time went backwards: %lld\n", delta); 55.437 + return; 55.438 + } 55.439 + 55.440 + /* Process elapsed jiffies since last call. */ 55.441 + while ( delta >= NS_PER_TICK ) 55.442 + { 55.443 + ticks++; 55.444 + delta -= NS_PER_TICK; 55.445 + processed_system_time += NS_PER_TICK; 55.446 + } 55.447 + 55.448 + if ( ticks != 0 ) 55.449 + { 55.450 + do_timer_ticks(ticks); 55.451 + 55.452 + if ( user_mode(regs) ) 55.453 + update_process_times_us(ticks, 0); 55.454 + else 55.455 + update_process_times_us(0, ticks); 55.456 + } 55.457 + 55.458 + /* 55.459 + * Take synchronised time from Xen once a minute if we're not 55.460 + * synchronised ourselves, and we haven't chosen to keep an independent 55.461 + * time base. 55.462 + */ 55.463 + if ( !INDEPENDENT_WALLCLOCK() && 55.464 + ((time_status & STA_UNSYNC) != 0) && 55.465 + (xtime.tv_sec > (last_update_from_xen + 60)) ) 55.466 + { 55.467 + /* Adjust shadow timeval for jiffies that haven't updated xtime yet. */ 55.468 + shadow_tv.tv_usec -= (jiffies - wall_jiffies) * (1000000/HZ); 55.469 + HANDLE_USEC_UNDERFLOW(shadow_tv); 55.470 + 55.471 + /* 55.472 + * Reset our running time counts if they are invalidated by a warp 55.473 + * backwards of more than 500ms. 55.474 + */ 55.475 + sec_diff = xtime.tv_sec - shadow_tv.tv_sec; 55.476 + if ( unlikely(abs(sec_diff) > 1) || 55.477 + unlikely(((sec_diff * 1000000) + 55.478 + xtime.tv_usec - shadow_tv.tv_usec) > 500000) ) 55.479 + { 55.480 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST 55.481 + last_update_to_rtc = last_update_to_xen = 0; 55.482 +#endif 55.483 + last_seen_tv.tv_sec = 0; 55.484 + } 55.485 + 55.486 + /* Update our unsynchronised xtime appropriately. */ 55.487 + xtime = shadow_tv; 55.488 + 55.489 + last_update_from_xen = xtime.tv_sec; 55.490 + } 55.491 + 55.492 +#ifdef CONFIG_XEN_PRIVILEGED_GUEST 55.493 + if ( (xen_start_info.flags & SIF_INITDOMAIN) && 55.494 + ((time_status & STA_UNSYNC) == 0) ) 55.495 + { 55.496 + /* Send synchronised time to Xen approximately every minute. */ 55.497 + if ( xtime.tv_sec > (last_update_to_xen + 60) ) 55.498 + { 55.499 + dom0_op_t op; 55.500 + struct timeval tv = xtime; 55.501 + 55.502 + tv.tv_usec += (jiffies - wall_jiffies) * (1000000/HZ); 55.503 + HANDLE_USEC_OVERFLOW(tv); 55.504 + 55.505 + op.cmd = DOM0_SETTIME; 55.506 + op.u.settime.secs = tv.tv_sec; 55.507 + op.u.settime.usecs = tv.tv_usec; 55.508 + op.u.settime.system_time = shadow_system_time; 55.509 + HYPERVISOR_dom0_op(&op); 55.510 + 55.511 + last_update_to_xen = xtime.tv_sec; 55.512 + } 55.513 + 55.514 + /* 55.515 + * If we have an externally synchronized Linux clock, then update CMOS 55.516 + * clock accordingly every ~11 minutes. Set_rtc_mmss() has to be called 55.517 + * as close as possible to 500 ms before the new second starts. 55.518 + */ 55.519 + if ( (xtime.tv_sec > (last_update_to_rtc + 660)) && 55.520 + (xtime.tv_usec >= (500000 - ((unsigned) tick) / 2)) && 55.521 + (xtime.tv_usec <= (500000 + ((unsigned) tick) / 2)) ) 55.522 + { 55.523 + if ( set_rtc_mmss(xtime.tv_sec) == 0 ) 55.524 + last_update_to_rtc = xtime.tv_sec; 55.525 + else 55.526 + last_update_to_rtc = xtime.tv_sec - 600; 55.527 + } 55.528 + } 55.529 +#endif 55.530 +} 55.531 + 55.532 + 55.533 +static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 55.534 +{ 55.535 + write_lock(&xtime_lock); 55.536 + do_timer_interrupt(irq, NULL, regs); 55.537 + write_unlock(&xtime_lock); 55.538 +} 55.539 + 55.540 +static struct irqaction irq_timer = { 55.541 + timer_interrupt, 55.542 + SA_INTERRUPT, 55.543 + 0, 55.544 + "timer", 55.545 + NULL, 55.546 + NULL 55.547 +}; 55.548 + 55.549 + 55.550 +/* 55.551 + * This function works out when the the next timer function has to be 55.552 + * executed (by looking at the timer list) and sets the Xen one-shot 55.553 + * domain timer to the appropriate value. This is typically called in 55.554 + * cpu_idle() before the domain blocks. 55.555 + * 55.556 + * The function returns a non-0 value on error conditions. 55.557 + * 55.558 + * It must be called with interrupts disabled. 55.559 + */ 55.560 +extern spinlock_t timerlist_lock; 55.561 +int set_timeout_timer(void) 55.562 +{ 55.563 + struct timer_list *timer; 55.564 + u64 alarm = 0; 55.565 + int ret = 0; 55.566 + 55.567 + spin_lock(&timerlist_lock); 55.568 + 55.569 + /* 55.570 + * This is safe against long blocking (since calculations are not based on 55.571 + * TSC deltas). It is also safe against warped system time since 55.572 + * suspend-resume is cooperative and we would first get locked out. It is 55.573 + * safe against normal updates of jiffies since interrupts are off. 55.574 + */ 55.575 + if ( (timer = next_timer_event()) != NULL ) 55.576 + alarm = __jiffies_to_st(timer->expires); 55.577 + 55.578 + /* Tasks on the timer task queue expect to be executed on the next tick. */ 55.579 + if ( TQ_ACTIVE(tq_timer) ) 55.580 + alarm = __jiffies_to_st(jiffies + 1); 55.581 + 55.582 + /* Failure is pretty bad, but we'd best soldier on. */ 55.583 + if ( HYPERVISOR_set_timer_op(alarm) != 0 ) 55.584 + ret = -1; 55.585 + 55.586 + spin_unlock(&timerlist_lock); 55.587 + 55.588 + return ret; 55.589 +} 55.590 + 55.591 + 55.592 +/* Time debugging. */ 55.593 +static void dbg_time_int(int irq, void *dev_id, struct pt_regs *ptregs) 55.594 +{ 55.595 + unsigned long flags, j; 55.596 + u64 s_now, j_st; 55.597 + struct timeval s_tv, tv; 55.598 + 55.599 + struct timer_list *timer; 55.600 + u64 t_st; 55.601 + 55.602 + read_lock_irqsave(&xtime_lock, flags); 55.603 + s_tv.tv_sec = shadow_tv.tv_sec; 55.604 + s_tv.tv_usec = shadow_tv.tv_usec; 55.605 + s_now = shadow_system_time; 55.606 + read_unlock_irqrestore(&xtime_lock, flags); 55.607 + 55.608 + do_gettimeofday(&tv); 55.609 + 55.610 + j = jiffies; 55.611 + j_st = __jiffies_to_st(j); 55.612 + 55.613 + timer = next_timer_event(); 55.614 + t_st = __jiffies_to_st(timer->expires); 55.615 + 55.616 + printk(KERN_ALERT "time: shadow_st=0x%X:%08X\n", 55.617 + (u32)(s_now>>32), (u32)s_now); 55.618 + printk(KERN_ALERT "time: wct=%lds %ldus shadow_wct=%lds %ldus\n", 55.619 + tv.tv_sec, tv.tv_usec, s_tv.tv_sec, s_tv.tv_usec); 55.620 + printk(KERN_ALERT "time: jiffies=%lu(0x%X:%08X) timeout=%lu(0x%X:%08X)\n", 55.621 + jiffies,(u32)(j_st>>32), (u32)j_st, 55.622 + timer->expires,(u32)(t_st>>32), (u32)t_st); 55.623 + printk(KERN_ALERT "time: processed_system_time=0x%X:%08X\n", 55.624 + (u32)(processed_system_time>>32), (u32)processed_system_time); 55.625 + 55.626 +#ifdef CONFIG_MAGIC_SYSRQ 55.627 + handle_sysrq('t',NULL,NULL,NULL); 55.628 +#endif 55.629 +} 55.630 + 55.631 +static struct irqaction dbg_time = { 55.632 + dbg_time_int, 55.633 + SA_SHIRQ, 55.634 + 0, 55.635 + "timer_dbg", 55.636 + &dbg_time_int, 55.637 + NULL 55.638 +}; 55.639 + 55.640 +void __init time_init(void) 55.641 +{ 55.642 + unsigned long long alarm; 55.643 + u64 __cpu_khz, __cpu_ghz, cpu_freq, scale, scale2; 55.644 + unsigned int cpu_ghz; 55.645 + 55.646 + __cpu_khz = __cpu_ghz = cpu_freq = HYPERVISOR_shared_info->cpu_freq; 55.647 + do_div(__cpu_khz, 1000UL); 55.648 + cpu_khz = (u32)__cpu_khz; 55.649 + do_div(__cpu_ghz, 1000000000UL); 55.650 + cpu_ghz = (unsigned int)__cpu_ghz; 55.651 + 55.652 + printk("Xen reported: %lu.%03lu MHz processor.\n", 55.653 + cpu_khz / 1000, cpu_khz % 1000); 55.654 + 55.655 + xtime.tv_sec = HYPERVISOR_shared_info->wc_sec; 55.656 + xtime.tv_usec = HYPERVISOR_shared_info->wc_usec; 55.657 + processed_system_time = shadow_system_time; 55.658 + 55.659 + for ( rdtsc_bitshift = 0; cpu_ghz != 0; rdtsc_bitshift++, cpu_ghz >>= 1 ) 55.660 + continue; 55.661 + 55.662 + scale = 1000000LL << (32 + rdtsc_bitshift); 55.663 + do_div(scale, (u32)cpu_freq); 55.664 + 55.665 + if ( (cpu_freq >> 32) != 0 ) 55.666 + { 55.667 + scale2 = 1000000LL << rdtsc_bitshift; 55.668 + do_div(scale2, (u32)(cpu_freq>>32)); 55.669 + scale += scale2; 55.670 + } 55.671 + 55.672 + st_scale_f = scale & 0xffffffff; 55.673 + st_scale_i = scale >> 32; 55.674 + 55.675 + __get_time_values_from_xen(); 55.676 + processed_system_time = shadow_system_time; 55.677 + 55.678 + time_irq = bind_virq_to_irq(VIRQ_TIMER); 55.679 + debug_irq = bind_virq_to_irq(VIRQ_DEBUG); 55.680 + 55.681 + (void)setup_irq(time_irq, &irq_timer); 55.682 + (void)setup_irq(debug_irq, &dbg_time); 55.683 + 55.684 + rdtscll(alarm); 55.685 +} 55.686 + 55.687 +void time_suspend(void) 55.688 +{ 55.689 +} 55.690 + 55.691 +void time_resume(void) 55.692 +{ 55.693 + unsigned long flags; 55.694 + write_lock_irqsave(&xtime_lock, flags); 55.695 + /* Get timebases for new environment. */ 55.696 + __get_time_values_from_xen(); 55.697 + /* Reset our own concept of passage of system time. */ 55.698 + processed_system_time = shadow_system_time; 55.699 + /* Accept a warp in UTC (wall-clock) time. */ 55.700 + last_seen_tv.tv_sec = 0; 55.701 + /* Make sure we resync UTC time with Xen on next timer interrupt. */ 55.702 + last_update_from_xen = 0; 55.703 + write_unlock_irqrestore(&xtime_lock, flags); 55.704 +} 55.705 + 55.706 +/* 55.707 + * /proc/sys/xen: This really belongs in another file. It can stay here for 55.708 + * now however. 55.709 + */ 55.710 +static ctl_table xen_subtable[] = { 55.711 + {1, "independent_wallclock", &independent_wallclock, 55.712 + sizeof(independent_wallclock), 0644, NULL, proc_dointvec}, 55.713 + {0} 55.714 +}; 55.715 +static ctl_table xen_table[] = { 55.716 + {123, "xen", NULL, 0, 0555, xen_subtable}, 55.717 + {0} 55.718 +}; 55.719 +static int __init xen_sysctl_init(void) 55.720 +{ 55.721 + (void)register_sysctl_table(xen_table, 0); 55.722 + return 0; 55.723 +} 55.724 +__initcall(xen_sysctl_init);
56.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 56.2 +++ b/linux-2.4.30-xen-sparse/arch/xen/kernel/traps.c Fri Jul 15 06:39:50 2005 -0700 56.3 @@ -0,0 +1,619 @@ 56.4 +/* 56.5 + * linux/arch/i386/traps.c 56.6 + * 56.7 + * Copyright (C) 1991, 1992 Linus Torvalds 56.8 + * 56.9 + * Pentium III FXSR, SSE support 56.10 + * Gareth Hughes <gareth@valinux.com>, May 2000 56.11 + */ 56.12 + 56.13 +/* 56.14 + * 'Traps.c' handles hardware traps and faults after we have saved some 56.15 + * state in 'asm.s'. 56.16 + */ 56.17 +#include <linux/config.h> 56.18 +#include <linux/sched.h> 56.19 +#include <linux/kernel.h> 56.20 +#include <linux/string.h> 56.21 +#include <linux/errno.h> 56.22 +#include <linux/ptrace.h> 56.23 +#include <linux/timer.h> 56.24 +#include <linux/mm.h> 56.25 +#include <linux/init.h> 56.26 +#include <linux/delay.h> 56.27 +#include <linux/spinlock.h> 56.28 +#include <linux/interrupt.h> 56.29 +#include <linux/highmem.h> 56.30 + 56.31 +#include <asm/system.h> 56.32 +#include <asm/uaccess.h> 56.33 +#include <asm/io.h> 56.34 +#include <asm/atomic.h> 56.35 +#include <asm/debugreg.h> 56.36 +#include <asm/desc.h> 56.37 +#include <asm/i387.h> 56.38 + 56.39 +#include <asm/smp.h> 56.40 +#include <asm/pgalloc.h> 56.41 + 56.42 +#include <asm/hypervisor.h> 56.43 + 56.44 +#include <linux/irq.h> 56.45 +#include <linux/module.h> 56.46 + 56.47 +asmlinkage int system_call(void); 56.48 +asmlinkage void lcall7(void); 56.49 +asmlinkage void lcall27(void); 56.50 + 56.51 +asmlinkage void divide_error(void); 56.52 +asmlinkage void debug(void); 56.53 +asmlinkage void int3(void); 56.54 +asmlinkage void overflow(void); 56.55 +asmlinkage void bounds(void); 56.56 +asmlinkage void invalid_op(void); 56.57 +asmlinkage void device_not_available(void); 56.58 +asmlinkage void double_fault(void); 56.59 +asmlinkage void coprocessor_segment_overrun(void); 56.60 +asmlinkage void invalid_TSS(void); 56.61 +asmlinkage void segment_not_present(void); 56.62 +asmlinkage void stack_segment(void); 56.63 +asmlinkage void general_protection(void); 56.64 +asmlinkage void page_fault(void); 56.65 +asmlinkage void coprocessor_error(void); 56.66 +asmlinkage void simd_coprocessor_error(void); 56.67 +asmlinkage void alignment_check(void); 56.68 +asmlinkage void fixup_4gb_segment(void); 56.69 +asmlinkage void machine_check(void); 56.70 + 56.71 +int kstack_depth_to_print = 24; 56.72 + 56.73 + 56.74 +/* 56.75 + * If the address is either in the .text section of the 56.76 + * kernel, or in the vmalloc'ed module regions, it *may* 56.77 + * be the address of a calling routine 56.78 + */ 56.79 + 56.80 +#ifdef CONFIG_MODULES 56.81 + 56.82 +extern struct module *module_list; 56.83 +extern struct module kernel_module; 56.84 + 56.85 +static inline int kernel_text_address(unsigned long addr) 56.86 +{ 56.87 + int retval = 0; 56.88 + struct module *mod; 56.89 + 56.90 + if (addr >= (unsigned long) &_stext && 56.91 + addr <= (unsigned long) &_etext) 56.92 + return 1; 56.93 + 56.94 +