direct-io.hg

changeset 304:9121aa1e3f33

bitkeeper revision 1.126 (3e71fc20anCOs2KFyD3-AMyHjdJQfg)

resolve merge conflicts manually
author rn@wyvis.research.intel-research.net
date Fri Mar 14 15:58:24 2003 +0000 (2003-03-14)
parents 4ace704a143f 8d97a5bf81d2
children 6e398cd3bf49
files .bk-to-hg .hg-to-bk .rootkeys BitKeeper/etc/logging_ok xen/arch/i386/apic.c xen/arch/i386/io_apic.c xen/arch/i386/irq.c xen/arch/i386/setup.c xen/common/ac_timer.c xen/common/kernel.c xen/common/keyhandler.c xen/common/perfc.c xen/drivers/block/xen_block.c xen/drivers/block/xen_segment.c xen/drivers/char/xen_kbd.c xen/drivers/char/xen_serial.c xen/drivers/ide/ide-xeno.c xen/drivers/net/tg3.c xen/drivers/scsi/scsi.c xen/drivers/scsi/sd.c xen/include/asm-i386/irq.h xen/include/asm-i386/pci.h xen/include/asm-i386/smpboot.h xen/include/xeno/perfc.h xen/include/xeno/perfc_defn.h xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_ide.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_scsi.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/network.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/init_task.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ptrace.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/semaphore.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/sys_i386.c xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/dec_and_lock.c xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/getuser.S xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/iodebug.c xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/memcpy.c xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/mmx.c xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/old-checksum.c xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/strstr.c xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/usercopy.c xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/extable.c xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/pageattr.c xenolinux-2.4.21-pre4-sparse/include/asm-xeno/a.out.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/apic.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/apicdef.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/atomic.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/bitops.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/boot.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/byteorder.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/cache.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/checksum.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/cpufeature.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/current.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/debugreg.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/delay.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/div64.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/dma.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/elf.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/errno.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/fcntl.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/floppy.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hardirq.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hdreg.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/i387.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ide.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/init.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/io_apic.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ioctl.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ioctls.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ipc.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ipcbuf.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/keyboard.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/kmap_types.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ldt.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/linux_logo.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/locks.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/math_emu.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mc146818rtc.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mca_dma.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mman.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mmx.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/module.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mpspec.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/msgbuf.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/msr.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mtrr.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/namei.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/param.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/parport.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/poll.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/posix_types.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/resource.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/rwlock.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/rwsem.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/scatterlist.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/semaphore.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sembuf.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/serial.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/setup.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/shmbuf.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/shmparam.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sigcontext.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/siginfo.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/signal.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/smplock.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/socket.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sockios.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/softirq.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/spinlock.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/stat.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/statfs.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/string-486.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/string.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/termbits.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/termios.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/timex.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/tlb.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/types.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/uaccess.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ucontext.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/unaligned.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/unistd.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/user.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/vga.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/xor.h xenolinux-2.4.21-pre4-sparse/mkbuildtree
line diff
     1.1 --- a/.bk-to-hg	Fri Mar 14 15:48:09 2003 +0000
     1.2 +++ b/.bk-to-hg	Fri Mar 14 15:58:24 2003 +0000
     1.3 @@ -4,7 +4,5 @@ test -L old/xenolinux-2.4.16-sparse/incl
     1.4  rm      old/xenolinux-2.4.16-sparse/include/asm-xeno/hypervisor-ifs
     1.5  test -L tools/domain_builder/dom0_ops.h
     1.6  rm      tools/domain_builder/dom0_ops.h
     1.7 -test -L xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor-ifs
     1.8 -rm      xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor-ifs
     1.9  (find -depth -type d -print | xargs -r rmdir 2>/dev/null) || true
    1.10  exit 0
     2.1 --- a/.hg-to-bk	Fri Mar 14 15:48:09 2003 +0000
     2.2 +++ b/.hg-to-bk	Fri Mar 14 15:58:24 2003 +0000
     2.3 @@ -8,9 +8,5 @@ ln -s ../../../xen-2.4.16/include/hyperv
     2.4  mkdir -p tools
     2.5  mkdir -p tools/domain_builder
     2.6  ln -s ../../xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_ops.h tools/domain_builder/dom0_ops.h
     2.7 -mkdir -p xenolinux-2.4.21-pre4-sparse
     2.8 -mkdir -p xenolinux-2.4.21-pre4-sparse/include
     2.9 -mkdir -p xenolinux-2.4.21-pre4-sparse/include/asm-xeno
    2.10 -ln -s ../../../xen/include/hypervisor-ifs xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor-ifs
    2.11  (find -depth -type d -print | xargs -r rmdir 2>/dev/null) || true
    2.12  exit 0
     3.1 --- a/.rootkeys	Fri Mar 14 15:48:09 2003 +0000
     3.2 +++ b/.rootkeys	Fri Mar 14 15:58:24 2003 +0000
     3.3 @@ -497,150 +497,52 @@ 3e5a4e65Hy_1iUvMTPsNqGNXd9uFpg xenolinux
     3.4  3e5a4e65ibVQmwlOn0j3sVH_j_6hAg xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/hypervisor.c
     3.5  3e5a4e65RMGcuA-HCn3-wNx3fFQwdg xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/i386_ksyms.c
     3.6  3e5a4e65JfSHwduNJO6j-upYnjoWLA xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/i387.c
     3.7 -3e5a4e65tzCYKTX26zdI8rk2m48BDA xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/init_task.c
     3.8  3e5a4e65MEvZhlr070sK5JsfAQlv7Q xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ioport.c
     3.9  3e5a4e653U6cELGv528IxOLHvCq8iA xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/irq.c
    3.10  3e5a4e65muT6SU3ck47IP87Q7Ti5hA xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ldt.c
    3.11  3e5a4e65IGt3WwQDNiL4h-gYWgNTWQ xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
    3.12 -3e5a4e65vXUggUHe9b_D9q0CNcZmQg xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ptrace.c
    3.13 -3e5a4e66StFP0OPSNngVwPJ4cJDy4g xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/semaphore.c
    3.14  3e5a4e66tR-qJMLj3MppcKqmvuI2XQ xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c
    3.15  3e5a4e66fWSTagLGU2P8BGFGRjhDiw xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/signal.c
    3.16 -3e5a4e66Id8AWFANwLRFP4mKJgIFQw xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/sys_i386.c
    3.17  3e5a4e66N__lUXNwzQ-eADRzK9LXuQ xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/time.c
    3.18  3e5a4e66aHCbQ_F5QZ8VeyikLmuRZQ xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/traps.c
    3.19  3e5a4e66-9_NczrVMbuQkoSLyXckIw xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/Makefile
    3.20 -3e5a4e66pZtp3RawntDpdofnJEvHIg xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S
    3.21 -3e5a4e660Zju423CmC6q_-ZdObYhuA xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/dec_and_lock.c
    3.22  3e5a4e6637ZDk0BvFEC-aFQs599-ng xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/delay.c
    3.23 -3e5a4e66Cf-sjHkzP95oIJ6hBC1pOA xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/getuser.S
    3.24 -3e5a4e66s_LxC8VI5vqmr-TPOdJYsw xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/iodebug.c
    3.25 -3e5a4e667pxnNndXVcVxVNBvZezxhw xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/memcpy.c
    3.26 -3e5a4e66MHYcXyO9DndD8k0DDBovYw xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/mmx.c
    3.27 -3e5a4e669xZJQRPtO8oiRIqMwChrLg xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/old-checksum.c
    3.28 -3e5a4e66RzO4JzKOAraCe2dnQ5m-yw xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/strstr.c
    3.29 -3e5a4e66us6VmRaduHUnWiKcAONyLA xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/usercopy.c
    3.30  3e5a4e66croVgpcJyJuF2ycQw0HuJw xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/Makefile
    3.31 -3e5a4e661LP_6AdxThMuysfcYtOexA xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/extable.c
    3.32  3e5a4e66l8Q5Tv-6B3lQIRmaVbFPzg xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/fault.c
    3.33  3e5a4e66TyNNUEXkr5RxqvQhXK1MQA xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/get_unmapped_area.c
    3.34  3e5a4e668SE9rixq4ahho9rNhLUUFQ xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/hypervisor.c
    3.35  3e5a4e661gLzzff25pJooKIIWe7IWg xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/init.c
    3.36  3e5a4e66U45cAIoHmxg0y1e1XhzVCA xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/mmu_context.c
    3.37 -3e5a4e66_jLCqAOBvqAy5N4mP7hmBA xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/pageattr.c
    3.38  3e5a4e66qRlSTcjafidMB6ulECADvg xenolinux-2.4.21-pre4-sparse/arch/xeno/vmlinux.lds
    3.39  3e5a4e668yELUdtr3HiJZBIqxqUyuA xenolinux-2.4.21-pre4-sparse/drivers/block/Config.in
    3.40  3e5a4e66mrtlmV75L1tjKDg8RaM5gA xenolinux-2.4.21-pre4-sparse/drivers/block/ll_rw_blk.c
    3.41  3e5a4e66rw65CxyolW9PKz4GG42RcA xenolinux-2.4.21-pre4-sparse/drivers/char/tty_io.c
    3.42  3e5a4e669uzIE54VwucPYtGwXLAbzA xenolinux-2.4.21-pre4-sparse/fs/exec.c
    3.43 -3e5a4e66HUJwJfJBBOilIN7LeL0twg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/a.out.h
    3.44 -3e5a4e66nv3Esm5N8FS5r0qs-l7A0w xenolinux-2.4.21-pre4-sparse/include/asm-xeno/apic.h
    3.45 -3e5a4e66BHReK8U7xl4qqZMXvFXihQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/apicdef.h
    3.46 -3e5a4e668V7Eo08_6qmVoevzFrlxGQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/atomic.h
    3.47 -3e5a4e66FNm4qKYGsIMdX6DGJ1pI1g xenolinux-2.4.21-pre4-sparse/include/asm-xeno/bitops.h
    3.48 -3e5a4e66zkP-aEQkEtznyyp-e7tUGA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/boot.h
    3.49  3e5a4e66wbeCpsJgVf_U8Jde-CNcsA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/bugs.h
    3.50 -3e5a4e66wTE9HEEjsnOHrijDB8iXrQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/byteorder.h
    3.51 -3e5a4e66VqboK-qHV-HxmSflMh4VqQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/cache.h
    3.52 -3e5a4e66bTVzeqJUJQiu67FWoHM5iw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/checksum.h
    3.53 -3e5a4e66JVArkZ-0_pav3AsvKbftdw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/cpufeature.h
    3.54 -3e5a4e66cCx28DaXo1U_nKvVX-5Y5w xenolinux-2.4.21-pre4-sparse/include/asm-xeno/current.h
    3.55 -3e5a4e66o7NZjoJZjzJa-Z7XcGmGqg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/debugreg.h
    3.56 -3e5a4e66rpzD2c7pNKF0XLbHzxb24A xenolinux-2.4.21-pre4-sparse/include/asm-xeno/delay.h
    3.57  3e5a4e66HdSkvIV6SJ1evG_xmTmXHA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/desc.h
    3.58 -3e5a4e66GP6AL7wpHyxcsHOH4cJ4BQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/div64.h
    3.59 -3e5a4e66wJ9hmUtY2rLWliznHdjWaw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/dma.h
    3.60 -3e5a4e667P_1mO6v1YFRZ-ocfpiyVQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/elf.h
    3.61 -3e5a4e66qeYk1odm2esnGypmiMcxqw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/errno.h
    3.62 -3e5a4e663pDK4oQnfbuT38CR04cXDQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/fcntl.h
    3.63  3e5a4e66SYp_UpAVcF8Lc1wa3Qtgzw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/fixmap.h
    3.64 -3e5a4e67fsayUJFE3A24CKZoUDI88A xenolinux-2.4.21-pre4-sparse/include/asm-xeno/floppy.h
    3.65 -3e5a4e67uPmwPbjvF7YGsG2hX-3oBQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hardirq.h
    3.66 -3e5a4e67P_6RRoCzUiQt_gyx6lmyWw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hdreg.h
    3.67  3e5a4e67w_DWgjIJ17Tlossu1LGujQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/highmem.h
    3.68  3e5a4e67YtcyDLQsShhCfQwPSELfvA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hw_irq.h
    3.69 -3e00b957NB9Iz667rjRZg5YAJqoKCg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor-ifs
    3.70  3e5a4e677VBavzM1UZIEcH1B-RlXMA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor.h
    3.71 -3e5a4e679TYbXAUiURvTeX4cFb1RlQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/i387.h
    3.72 -3e5a4e672eNAzAKUZsefsPdmsH19hA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ide.h
    3.73 -3e5a4e67XHl6b9C1Oqv79FiE1T3ybg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/init.h
    3.74  3e5a4e67Ulv-Ll8Zp4j2GwMwQ8aAXQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/io.h
    3.75 -3e5a4e67cWGE9V1O6DSwvj5KtkY04g xenolinux-2.4.21-pre4-sparse/include/asm-xeno/io_apic.h
    3.76 -3e5a4e67-vXNELtSK-qDSYyK55febg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ioctl.h
    3.77 -3e5a4e67iqnkteX3g1IFQ-0Hf-vyuA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ioctls.h
    3.78 -3e5a4e674l2NZF3klG30JX_auXUBgA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ipc.h
    3.79 -3e5a4e678dxUg9lvKOXvH1s5a9GNsA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ipcbuf.h
    3.80  3e5a4e673p7PEOyHFm3nHkYX6HQYBg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/irq.h
    3.81 -3e5a4e67nfnw10Wsugp5ZeMYFO_Eeg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/keyboard.h
    3.82 -3e5a4e67FbgZ92JO9Vp2CKlW6z7wjA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/kmap_types.h
    3.83 -3e5a4e674VIvXJxlOtz7LjtNAJttAA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ldt.h
    3.84 -3e5a4e67X2GwDXstxQeuIyr65hdOig xenolinux-2.4.21-pre4-sparse/include/asm-xeno/linux_logo.h
    3.85 -3e5a4e67mLXkDcU-aaeMByYb1-3v7Q xenolinux-2.4.21-pre4-sparse/include/asm-xeno/locks.h
    3.86 -3e5a4e67g8B4DjzsIajoy1_mlxlvLg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/math_emu.h
    3.87 -3e5a4e67J6JsiPWb0AwWZzQcOLbKKw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mc146818rtc.h
    3.88 -3e5a4e67otTxTEz6CA4vVHE-CFLGkQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mca_dma.h
    3.89 -3e5a4e67hSfhasW1McVONBMITBY28g xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mman.h
    3.90  3e5a4e67zoNch27qYhEBpr2k6SABOg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mmu.h
    3.91  3e5a4e678ddsQOpbSiRdy1GRcDc9WA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mmu_context.h
    3.92 -3e5a4e67YQ_cLDcJjIsd8XTCk3w4rg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mmx.h
    3.93 -3e5a4e67Zv1yObwNLd_9AYbyGTTvSw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/module.h
    3.94 -3e5a4e67C-czbgW6YxgEbJG1e9aPGg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mpspec.h
    3.95 -3e5a4e67swa8teSCnQDQvpV90xYiZQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/msgbuf.h
    3.96 -3e5a4e67U1TsB9azleujfFZm3E5i3w xenolinux-2.4.21-pre4-sparse/include/asm-xeno/msr.h
    3.97 -3e5a4e67f6dvHFEisaZ4wCR2t3a0yw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mtrr.h
    3.98 -3e5a4e67Kd-KWcgJON9dfcJEQD9hdg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/namei.h
    3.99  3e5a4e67mnQfh-R8KcQCaVo2Oho6yg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/page.h
   3.100 -3e5a4e67IYaS0RnLo3SntreGd59gMA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/param.h
   3.101 -3e5a4e67nvdHRk38knQeDl-0Z2j6_Q xenolinux-2.4.21-pre4-sparse/include/asm-xeno/parport.h
   3.102  3e5a4e67uTYU5oEnIDjxuaez8njjqg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/pgalloc.h
   3.103  3e5a4e67X7JyupgdYkgDX19Huj2sAw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/pgtable-2level.h
   3.104  3e5a4e67w3ckNdrTEgqiSiYYAYMwOQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/pgtable-3level.h
   3.105  3e5a4e67gr4NLGtQ5CvSLimMYZlkOA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/pgtable.h
   3.106 -3e5a4e671OnIMxuFE59yynI-qvwKCA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/poll.h
   3.107 -3e5a4e67o7FLcNPHjwyw5vb01EQTCg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/posix_types.h
   3.108  3e5a4e676uK4xErTBDH6XJREn9LSyg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h
   3.109  3e5a4e67AJPjW-zL7p-xWuA6IVeH1g xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ptrace.h
   3.110 -3e5a4e67tIfXJYRQFxfRbcpZ25vqfw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/resource.h
   3.111 -3e5a4e68E-U7HbKdTBaYoo3ZISdxuQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/rwlock.h
   3.112 -3e5a4e68unR4ktSClycraOPanwxvTg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/rwsem.h
   3.113 -3e5a4e68DATgqBYbF9W2Pkw5fGZBRg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/scatterlist.h
   3.114  3e5a4e68uJz-xI0IBVMD7xRLQKJDFg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/segment.h
   3.115 -3e5a4e68Ug8hqChUpD2m_IDQSiu8jw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/semaphore.h
   3.116 -3e5a4e68uFNNH3YQvZS1EnL0v_E6ew xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sembuf.h
   3.117 -3e5a4e689R_c0pr8Ycb-w6zveleWEw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/serial.h
   3.118 -3e5a4e682D6yseOVKoJIx6HafkEKJw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/setup.h
   3.119 -3e5a4e680_gLjMSi1Ql0nUnqCoQSyQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/shmbuf.h
   3.120 -3e5a4e68PFVCbzUszQ4anRN8iZ1DUg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/shmparam.h
   3.121 -3e5a4e689rAyWPwrwdvtJEkrtVw1rA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sigcontext.h
   3.122 -3e5a4e68D7dXWzciOKbyG1G3l3yt0w xenolinux-2.4.21-pre4-sparse/include/asm-xeno/siginfo.h
   3.123 -3e5a4e68soo0VsYXn1HYv2XeUnlxgw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/signal.h
   3.124  3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/smp.h
   3.125 -3e5a4e688pv8zI1Z3wciLUik3c2iEw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/smplock.h
   3.126 -3e5a4e68jaQZMOApQVZiq7T_gGPZhw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/socket.h
   3.127 -3e5a4e68wlnX8Huhsl0gd7VgmiA8uA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sockios.h
   3.128 -3e5a4e68tuqUkZ3kyZGk6BZ1hrkXyw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/softirq.h
   3.129 -3e5a4e68viR5sAz1SvKnPNrpKmlAZA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/spinlock.h
   3.130 -3e5a4e68nUxBYfOOLm0_cZN7XM-3LQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/stat.h
   3.131 -3e5a4e68my8BhpsHYBD63VUrxLXRCg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/statfs.h
   3.132 -3e5a4e68W6piFzx4c4kiqwNB-h8PbQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/string-486.h
   3.133 -3e5a4e68gFzDdQZEy91vkcdKWubf2g xenolinux-2.4.21-pre4-sparse/include/asm-xeno/string.h
   3.134  3e5a4e68mTr0zcp9SXDbnd-XLrrfxw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/system.h
   3.135 -3e5a4e686Tful7frKeVbjeeWZ4S0nA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/termbits.h
   3.136 -3e5a4e68fZcskF52zTGHdiF_yoVBiw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/termios.h
   3.137 -3e5a4e68t8oGxTdC3i40nPjFwW00_g xenolinux-2.4.21-pre4-sparse/include/asm-xeno/timex.h
   3.138 -3e5a4e685uCbimBjS_2iGxUqptPYiQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/tlb.h
   3.139 -3e5a4e68Elybq23T6RnEt6vopg3mxg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/types.h
   3.140 -3e5a4e68NeADbbaqoo4emjpU5xcaqA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/uaccess.h
   3.141 -3e5a4e68HMMGyb6iBvG-qVbd9hODaQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ucontext.h
   3.142 -3e5a4e68m2MrAb54gFw8n-ZGNEu-Fw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/unaligned.h
   3.143 -3e5a4e68vggReonfTJ1gdzYjFaOSKw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/unistd.h
   3.144 -3e5a4e68QPC4T0aOA61QgK2SGDPVVA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/user.h
   3.145 -3e5a4e68g2boOp0d45bjtwugxQ8zNw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/vga.h
   3.146 -3e5a4e68AB-TTHj1oXtqVJvUo9jzIg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/xor.h
   3.147  3e5a4e68WLX3B8owTvktP3HHOtznPQ xenolinux-2.4.21-pre4-sparse/include/linux/major.h
   3.148  3e5a4e686V0nioX2ZpFf056sgvdiQw xenolinux-2.4.21-pre4-sparse/include/linux/sunrpc/debug.h
   3.149  3e5a4e68W_hpMlM3u_-QOKMp3gzcwQ xenolinux-2.4.21-pre4-sparse/init/do_mounts.c
   3.150  3e5a4e68TJJavrunYwTAnLRSBxSYqQ xenolinux-2.4.21-pre4-sparse/kernel/panic.c
   3.151 +3e6e7c1efbQe93xCvOpOVCnXTMmQ5w xenolinux-2.4.21-pre4-sparse/mkbuildtree
   3.152  3e5a4e68GxCIaFH4sy01v1wjapetaA xenolinux-2.4.21-pre4-sparse/mm/memory.c
   3.153  3e5a4e681xMPdF9xCMwpyfuYMySU5g xenolinux-2.4.21-pre4-sparse/mm/mremap.c
   3.154  3e5a4e683HKVU-sxtagrDasRB8eBVw xenolinux-2.4.21-pre4-sparse/mm/swapfile.c
     4.1 --- a/BitKeeper/etc/logging_ok	Fri Mar 14 15:48:09 2003 +0000
     4.2 +++ b/BitKeeper/etc/logging_ok	Fri Mar 14 15:58:24 2003 +0000
     4.3 @@ -6,6 +6,7 @@ bd240@boulderdash.cl.cam.ac.uk
     4.4  iap10@labyrinth.cl.cam.ac.uk
     4.5  kaf24@labyrinth.cl.cam.ac.uk
     4.6  kaf24@plym.cl.cam.ac.uk
     4.7 +kaf24@scramble.cl.cam.ac.uk
     4.8  kaf24@striker.cl.cam.ac.uk
     4.9  lynx@idefix.cl.cam.ac.uk
    4.10  rn@wyvis.camb.intel-research.net
     6.1 --- a/xen/arch/i386/io_apic.c	Fri Mar 14 15:48:09 2003 +0000
     6.2 +++ b/xen/arch/i386/io_apic.c	Fri Mar 14 15:58:24 2003 +0000
     6.3 @@ -826,7 +826,6 @@ void __init print_IO_APIC(void)
     6.4  			UNEXPECTED_IO_APIC();
     6.5  	}
     6.6  
     6.7 -#if 0
     6.8  	printk(KERN_DEBUG ".... IRQ redirection table:\n");
     6.9  
    6.10  	printk(KERN_DEBUG " NR Log Phy Mask Trig IRR Pol"
    6.11 @@ -871,7 +870,6 @@ void __init print_IO_APIC(void)
    6.12  			entry = irq_2_pin + entry->next;
    6.13  		}
    6.14  		printk("\n");
    6.15 -#endif
    6.16  	}
    6.17  
    6.18  	printk(KERN_INFO ".................................... done.\n");
     7.1 --- a/xen/arch/i386/irq.c	Fri Mar 14 15:48:09 2003 +0000
     7.2 +++ b/xen/arch/i386/irq.c	Fri Mar 14 15:58:24 2003 +0000
     7.3 @@ -537,7 +537,9 @@ asmlinkage unsigned int do_IRQ(struct pt
     7.4          do_softirq();
     7.5  
     7.6      rdtscl(cc_end);
     7.7 -    perfc_adda(irq_time, cpu, cc_end - cc_start);
     7.8 +
     7.9 +    if(!action || (!(action->flags & SA_NOPROFILE)) )
    7.10 +        perfc_adda(irq_time, cpu, cc_end - cc_start);
    7.11  
    7.12      return 1;
    7.13  }
     8.1 --- a/xen/arch/i386/setup.c	Fri Mar 14 15:48:09 2003 +0000
     8.2 +++ b/xen/arch/i386/setup.c	Fri Mar 14 15:58:24 2003 +0000
     8.3 @@ -292,7 +292,7 @@ void __init start_of_day(void)
     8.4      extern void initialize_keytable(); 
     8.5      extern void initialize_serial(void);
     8.6      extern void initialize_keyboard(void);
     8.7 -
     8.8 +    extern int opt_nosmp;
     8.9      unsigned long low_mem_size;
    8.10      
    8.11      /*
    8.12 @@ -327,7 +327,11 @@ void __init start_of_day(void)
    8.13  #ifndef CONFIG_SMP    
    8.14      APIC_init_uniprocessor();
    8.15  #else
    8.16 -    smp_boot_cpus(); /*
    8.17 +    if( opt_nosmp )
    8.18 +	APIC_init_uniprocessor();
    8.19 +    else
    8.20 +    	smp_boot_cpus(); 
    8.21 +		     /*
    8.22                        * Does loads of stuff, including kicking the local
    8.23                        * APIC, and the IO APIC after other CPUs are booted.
    8.24                        * Each IRQ is preferably handled by IO-APIC, but
    10.1 --- a/xen/common/kernel.c	Fri Mar 14 15:48:09 2003 +0000
    10.2 +++ b/xen/common/kernel.c	Fri Mar 14 15:58:24 2003 +0000
    10.3 @@ -41,7 +41,7 @@ unsigned int opt_ser_baud = 9600;  /* de
    10.4  unsigned int opt_dom0_mem = 16000; /* default kbytes for DOM0 */
    10.5  unsigned int opt_ne_base = 0; /* NE2k NICs cannot be probed */
    10.6  unsigned char opt_ifname[10] = "eth0";
    10.7 -int opt_noht=0, opt_noacpi=0;
    10.8 +int opt_noht=0, opt_noacpi=0, opt_nosmp;
    10.9  enum { OPT_IP, OPT_STR, OPT_UINT, OPT_BOOL };
   10.10  static struct {
   10.11      unsigned char *name;
   10.12 @@ -55,6 +55,7 @@ static struct {
   10.13      { "ifname",   OPT_STR,  &opt_ifname },
   10.14      { "noht",     OPT_BOOL, &opt_noht },
   10.15      { "noacpi",   OPT_BOOL, &opt_noacpi },
   10.16 +    { "nosmp",    OPT_BOOL, &opt_nosmp },
   10.17      { NULL,       0,        NULL     }
   10.18  };
   10.19  
    11.1 --- a/xen/common/keyhandler.c	Fri Mar 14 15:48:09 2003 +0000
    11.2 +++ b/xen/common/keyhandler.c	Fri Mar 14 15:58:24 2003 +0000
    11.3 @@ -17,18 +17,18 @@ void add_key_handler(u_char key, key_han
    11.4      char *str; 
    11.5  
    11.6      if(key_table[key].handler != NULL) 
    11.7 -    printk("Warning: overwriting handler for key 0x%x\n", key); 
    11.8 +	printk("Warning: overwriting handler for key 0x%x\n", key); 
    11.9  
   11.10      key_table[key].handler = handler; 
   11.11  
   11.12      str = key_table[key].desc; 
   11.13      for(i = 0; i < STR_MAX; i++) {
   11.14 -    if(*desc) 
   11.15 -        *str++ = *desc++; 
   11.16 -    else break; 
   11.17 +	if(*desc) 
   11.18 +	    *str++ = *desc++; 
   11.19 +	else break; 
   11.20      }
   11.21      if (i == STR_MAX) 
   11.22 -    key_table[key].desc[STR_MAX-1] = '\0'; 
   11.23 +	key_table[key].desc[STR_MAX-1] = '\0'; 
   11.24  
   11.25      return; 
   11.26  }
   11.27 @@ -39,21 +39,21 @@ key_handler *get_key_handler(u_char key)
   11.28  }
   11.29  
   11.30  
   11.31 -void show_handlers(u_char key, void *dev_id, struct pt_regs *regs) 
   11.32 +static void show_handlers(u_char key, void *dev_id, struct pt_regs *regs) 
   11.33  {
   11.34      int i; 
   11.35  
   11.36      printk("'%c' pressed -> showing installed handlers\n", key); 
   11.37      for(i=0; i < KEY_MAX; i++) 
   11.38 -    if(key_table[i].handler) 
   11.39 -        printk(" key '%c' (ascii '%02x') => %s\n", 
   11.40 -            (i<33 || i>126)?(' '):(i),i,
   11.41 -            key_table[i].desc);
   11.42 +	if(key_table[i].handler) 
   11.43 +	    printk(" key '%c' (ascii '%02x') => %s\n", 
   11.44 +			(i<33 || i>126)?(' '):(i),i,
   11.45 +			key_table[i].desc);
   11.46      return; 
   11.47  }
   11.48  
   11.49  
   11.50 -void dump_registers(u_char key, void *dev_id, struct pt_regs *regs) 
   11.51 +static void dump_registers(u_char key, void *dev_id, struct pt_regs *regs) 
   11.52  {
   11.53      extern void show_registers(struct pt_regs *regs); 
   11.54  
   11.55 @@ -62,13 +62,21 @@ void dump_registers(u_char key, void *de
   11.56      return; 
   11.57  }
   11.58  
   11.59 -void halt_machine(u_char key, void *dev_id, struct pt_regs *regs) 
   11.60 +static void halt_machine(u_char key, void *dev_id, struct pt_regs *regs) 
   11.61  {
   11.62      printk("'%c' pressed -> rebooting machine\n", key); 
   11.63      machine_restart(NULL); 
   11.64      return; 
   11.65  }
   11.66  
   11.67 +static void kill_dom0(u_char key, void *dev_id, struct pt_regs *regs) 
   11.68 +{
   11.69 +    printk("'%c' pressed -> gracefully rebooting machine\n", key); 
   11.70 +    kill_other_domain(0, 0);
   11.71 +    return;
   11.72 +}
   11.73 +
   11.74 +
   11.75  /* XXX SMH: this is keir's fault */
   11.76  static char *task_states[] = 
   11.77  { 
   11.78 @@ -90,16 +98,16 @@ void do_task_queues(u_char key, void *de
   11.79      p = &idle0_task;
   11.80      do {
   11.81          printk("Xen: DOM %d, CPU %d [has=%c], state = %s, "
   11.82 -           "hyp_events = %08x\n", 
   11.83 -           p->domain, p->processor, p->has_cpu ? 'T':'F', 
   11.84 -           task_states[p->state], p->hyp_events); 
   11.85 -    s = p->shared_info; 
   11.86 -    if(!is_idle_task(p)) {
   11.87 -        printk("Guest: events = %08lx, event_enable = %08lx\n", 
   11.88 -           s->events, s->events_enable); 
   11.89 -        printk("Notifying guest...\n"); 
   11.90 -        set_bit(_EVENT_DEBUG, &s->events); 
   11.91 -    }
   11.92 +	       "hyp_events = %08x\n", 
   11.93 +	       p->domain, p->processor, p->has_cpu ? 'T':'F', 
   11.94 +	       task_states[p->state], p->hyp_events); 
   11.95 +	s = p->shared_info; 
   11.96 +	if(!is_idle_task(p)) {
   11.97 +	    printk("Guest: events = %08lx, event_enable = %08lx\n", 
   11.98 +		   s->events, s->events_enable); 
   11.99 +	    printk("Notifying guest...\n"); 
  11.100 +	    set_bit(_EVENT_DEBUG, &s->events); 
  11.101 +	}
  11.102      } while ( (p = p->next_task) != &idle0_task );
  11.103  
  11.104      read_unlock_irqrestore(&tasklist_lock, flags); 
  11.105 @@ -118,16 +126,17 @@ void initialize_keytable()
  11.106  
  11.107      /* first initialize key handler table */
  11.108      for(i = 0; i < KEY_MAX; i++) 
  11.109 -    key_table[i].handler = (key_handler *)NULL; 
  11.110 -    
  11.111 +	key_table[i].handler = (key_handler *)NULL; 
  11.112 +	
  11.113      /* setup own handlers */
  11.114      add_key_handler('a', dump_timerq,    "dump ac_timer queues");
  11.115      add_key_handler('d', dump_registers, "dump registers"); 
  11.116 -    add_key_handler('h', show_handlers,  "show this message");
  11.117 +    add_key_handler('h', show_handlers, "show this message");
  11.118      add_key_handler('p', perfc_printall, "print performance counters"); 
  11.119      add_key_handler('P', perfc_reset,    "reset performance counters"); 
  11.120      add_key_handler('q', do_task_queues, "dump task queues + guest state");
  11.121 -    add_key_handler('r', dump_runq,      "dump run queue"); 
  11.122 +    add_key_handler('r', dump_runq,      "dump run queues");
  11.123 +    add_key_handler('B', kill_dom0,      "reboot machine gracefully"); 
  11.124      add_key_handler('R', halt_machine,   "reboot machine ungracefully"); 
  11.125      
  11.126      return; 
    12.1 --- a/xen/common/perfc.c	Fri Mar 14 15:48:09 2003 +0000
    12.2 +++ b/xen/common/perfc.c	Fri Mar 14 15:58:24 2003 +0000
    12.3 @@ -47,18 +47,18 @@ void __perfc_print (unsigned long counte
    12.4        return;
    12.5    }
    12.6    if (element_size == 0) {                              /* single counter */
    12.7 -      printf ("%10ld  0x%08lx  %s\n", counter[0], counter[0],
    12.8 +      printf ("%10lu  0x%08lx  %s\n", counter[0], counter[0],
    12.9                perfc_name[loop] + 2 + num);
   12.10    } else if (cpus) {                                    /* counter per CPU  */
   12.11        for (loop = 0; loop < smp_num_cpus; loop++) {
   12.12 -          printf ("%10ld  0x%08lx  cpu[%02d] %s\n", 
   12.13 +          printf ("%10lu  0x%08lx  cpu[%02d] %s\n", 
   12.14                    counter[loop], counter[loop], 
   12.15                    loop, perfc_name[loop]);
   12.16        }
   12.17        
   12.18    } else {                                             /* show entire array */
   12.19        for (loop = 0; loop < element_size; loop++) {
   12.20 -          printf ("%10ld  0x%08lx  %s:%d\n", 
   12.21 +          printf ("%10lu  0x%08lx  %s:%d\n", 
   12.22                    counter[loop], counter[loop], 
   12.23                    perfc_name[loop] + 2 + num, loop);
   12.24        }
   12.25 @@ -103,6 +103,8 @@ void perfc_printall (u_char key, void *d
   12.26          }
   12.27      }
   12.28  
   12.29 +    //perfc_reset( key, dev_id, regs );
   12.30 +
   12.31      return;
   12.32  }
   12.33  
    13.1 --- a/xen/drivers/block/xen_block.c	Fri Mar 14 15:48:09 2003 +0000
    13.2 +++ b/xen/drivers/block/xen_block.c	Fri Mar 14 15:58:24 2003 +0000
    13.3 @@ -17,10 +17,8 @@
    13.4  #include <xeno/keyhandler.h>
    13.5  #include <xeno/interrupt.h>
    13.6  #include <xeno/segment.h>
    13.7 -#include <asm/domain_page.h> /* TEST_READ_VALIDITY */
    13.8  
    13.9 -#if 1
   13.10 -#define TEST_READ_VALIDITY
   13.11 +#if 0
   13.12  #define DPRINTK(_f, _a...) printk( _f , ## _a )
   13.13  #else
   13.14  #define DPRINTK(_f, _a...) ((void)0)
   13.15 @@ -206,16 +204,6 @@ static void end_block_io_op(struct buffe
   13.16          DPRINTK("Buffer not up-to-date at end of operation\n");
   13.17          pending_req->status = 1;
   13.18      }
   13.19 -#ifdef TEST_READ_VALIDITY
   13.20 -    else if ( pending_req->operation == READ )
   13.21 -    {
   13.22 -        unsigned long *buff = map_domain_mem(virt_to_phys(bh->b_data));
   13.23 -        if ( (buff[  0] == 0xdeadbeef) &&
   13.24 -             (buff[127] == 0xdeadbeef) )
   13.25 -            printk("An unmodified buffer at sector %ld\n", bh->b_rsector);
   13.26 -        unmap_domain_mem(buff);
   13.27 -    }
   13.28 -#endif
   13.29  
   13.30      unlock_buffer(pending_req->domain, 
   13.31                    virt_to_phys(bh->b_data), 
   13.32 @@ -616,12 +604,6 @@ static void dispatch_rw_block_io(struct 
   13.33          } 
   13.34          else
   13.35          {
   13.36 -#ifdef TEST_READ_VALIDITY
   13.37 -            unsigned long *buff = map_domain_mem(phys_seg[i].buffer);
   13.38 -            buff[  0] = 0xdeadbeef;
   13.39 -            buff[127] = 0xdeadbeef;
   13.40 -            unmap_domain_mem(buff);
   13.41 -#endif
   13.42              bh->b_state = (1 << BH_Mapped) | (1 << BH_Read);
   13.43          }
   13.44  
    14.1 --- a/xen/drivers/block/xen_segment.c	Fri Mar 14 15:48:09 2003 +0000
    14.2 +++ b/xen/drivers/block/xen_segment.c	Fri Mar 14 15:58:24 2003 +0000
    14.3 @@ -101,6 +101,7 @@ void xen_segment_probe(struct task_struc
    14.4  {
    14.5      int loop, i;
    14.6      xen_disk_info_t *xdi = map_domain_mem(virt_to_phys(raw_xdi));
    14.7 +    unsigned long capacity = 0, device;
    14.8  
    14.9      for ( loop = 0; loop < XEN_MAX_SEGMENTS; loop++ )
   14.10      {
   14.11 @@ -108,13 +109,12 @@ void xen_segment_probe(struct task_struc
   14.12               (xsegments[loop].domain != p->domain) )
   14.13              continue;
   14.14  
   14.15 -        xdi->disks[xdi->count].device = 
   14.16 -            MK_VIRTUAL_XENDEV(xsegments[loop].segment_number);
   14.17 +        device = MK_VIRTUAL_XENDEV(xsegments[loop].segment_number);
   14.18          for ( i = 0; i < xsegments[loop].num_extents; i++ )
   14.19 -        {
   14.20 -            xdi->disks[xdi->count].capacity += 
   14.21 -                xsegments[loop].extents[i].size;
   14.22 -        }
   14.23 +            capacity += xsegments[loop].extents[i].size;
   14.24 +
   14.25 +        xdi->disks[xdi->count].device   = device;
   14.26 +        xdi->disks[xdi->count].capacity = capacity;
   14.27          xdi->count++;
   14.28      }
   14.29  
    15.1 --- a/xen/drivers/char/xen_kbd.c	Fri Mar 14 15:48:09 2003 +0000
    15.2 +++ b/xen/drivers/char/xen_kbd.c	Fri Mar 14 15:58:24 2003 +0000
    15.3 @@ -1,4 +1,5 @@
    15.4  #include <asm-i386/io.h>
    15.5 +#include <asm-i386/irq.h>
    15.6  #include <xeno/sched.h>    /* this has request_irq() proto for some reason */
    15.7  #include <xeno/keyhandler.h>  
    15.8  
    15.9 @@ -183,7 +184,7 @@ static void keyboard_interrupt(int irq, 
   15.10  
   15.11  void initialize_keyboard()
   15.12  {
   15.13 -    if(request_irq(KEYBOARD_IRQ, keyboard_interrupt, 0, "keyboard", NULL))
   15.14 +    if(request_irq(KEYBOARD_IRQ, keyboard_interrupt, SA_NOPROFILE, "keyboard", NULL))
   15.15  	printk("initialize_keyboard: failed to alloc IRQ %d\n", KEYBOARD_IRQ); 
   15.16  
   15.17      return; 
    16.1 --- a/xen/drivers/char/xen_serial.c	Fri Mar 14 15:48:09 2003 +0000
    16.2 +++ b/xen/drivers/char/xen_serial.c	Fri Mar 14 15:58:24 2003 +0000
    16.3 @@ -85,6 +85,6 @@ void initialize_serial()
    16.4      outb(NS16550_MCR_OUT2, SERIAL_BASE + NS16550_MCR);   /* Modem control */
    16.5      outb(NS16550_IER_ERDAI, SERIAL_BASE + NS16550_IER ); /* Setup interrupts */
    16.6  
    16.7 -    if((rc = request_irq(4, serial_rx_int, 0, "serial", 0)))
    16.8 +    if((rc = request_irq(4, serial_rx_int, SA_NOPROFILE, "serial", 0)))
    16.9  	printk("initialize_serial: failed to get IRQ4, rc=%d\n", rc); 
   16.10  }
    17.1 --- a/xen/drivers/ide/ide-xeno.c	Fri Mar 14 15:48:09 2003 +0000
    17.2 +++ b/xen/drivers/ide/ide-xeno.c	Fri Mar 14 15:58:24 2003 +0000
    17.3 @@ -12,7 +12,7 @@ void ide_probe_devices(xen_disk_info_t* 
    17.4      int loop;
    17.5      unsigned int unit;
    17.6      xen_disk_info_t *xen_xdi = map_domain_mem(virt_to_phys(xdi));
    17.7 -    unsigned long capacity;
    17.8 +    unsigned long capacity, device;
    17.9      ide_drive_t *drive;
   17.10      
   17.11      for ( loop = 0; loop < MAX_HWIFS; loop++ )
   17.12 @@ -25,9 +25,10 @@ void ide_probe_devices(xen_disk_info_t* 
   17.13              drive = &hwif->drives[unit];
   17.14              if ( !drive->present ) continue;
   17.15              
   17.16 +            device   = MK_IDE_XENDEV((loop * MAX_DRIVES) + unit);
   17.17              capacity = current_capacity(drive);
   17.18 -            xen_xdi->disks[xen_xdi->count].device =
   17.19 -                MK_IDE_XENDEV((loop * MAX_DRIVES) + unit);
   17.20 +
   17.21 +            xen_xdi->disks[xen_xdi->count].device   = device;
   17.22              xen_xdi->disks[xen_xdi->count].capacity = capacity;
   17.23              xen_xdi->count++;
   17.24  
    18.1 --- a/xen/drivers/net/tg3.c	Fri Mar 14 15:48:09 2003 +0000
    18.2 +++ b/xen/drivers/net/tg3.c	Fri Mar 14 15:58:24 2003 +0000
    18.3 @@ -2099,6 +2099,12 @@ static void tg3_interrupt(int irq, void 
    18.4  	{
    18.5  	  int budget = 1000;
    18.6  	  tg3_poll( dev, &budget );
    18.7 +
    18.8 +	  tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
    18.9 +		       0x00000000);
   18.10 +	  tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW);
   18.11 +
   18.12 +
   18.13  	}
   18.14  #endif
   18.15  
    19.1 --- a/xen/drivers/scsi/scsi.c	Fri Mar 14 15:48:09 2003 +0000
    19.2 +++ b/xen/drivers/scsi/scsi.c	Fri Mar 14 15:58:24 2003 +0000
    19.3 @@ -855,6 +855,7 @@ void scsi_wait_req (Scsi_Request * SRpnt
    19.4              *(int *)(SRpnt->sr_request.waiting) = 0; 
    19.5          } 
    19.6      }
    19.7 +printk("*");
    19.8  #endif
    19.9  
   19.10  
    20.1 --- a/xen/drivers/scsi/sd.c	Fri Mar 14 15:48:09 2003 +0000
    20.2 +++ b/xen/drivers/scsi/sd.c	Fri Mar 14 15:58:24 2003 +0000
    20.3 @@ -1320,17 +1320,21 @@ void scsi_probe_devices(xen_disk_info_t 
    20.4      Scsi_Disk *sd; 
    20.5      int i;
    20.6      xen_disk_info_t *xen_xdi = map_domain_mem(virt_to_phys(xdi));
    20.7 +    unsigned long capacity, device;
    20.8  
    20.9      for ( sd = rscsi_disks, i = 0; i < sd_template.dev_max; i++, sd++ )
   20.10      {
   20.11          if ( sd->device == NULL ) continue;
   20.12  
   20.13 -        xen_xdi->disks[xen_xdi->count].device   = MK_SCSI_XENDEV(i);
   20.14 -        xen_xdi->disks[xen_xdi->count].capacity = sd->capacity; 
   20.15 +        device   = MK_SCSI_XENDEV(i);
   20.16 +        capacity = sd->capacity;
   20.17 +
   20.18 +        xen_xdi->disks[xen_xdi->count].device   = device;
   20.19 +        xen_xdi->disks[xen_xdi->count].capacity = capacity; 
   20.20          xen_xdi->count++; 
   20.21                  
   20.22          printk("Disk %d: SCSI-XENO capacity %dkB (%dMB)\n",
   20.23 -               xen_xdi->count, sd->capacity>>1, sd->capacity>>11);
   20.24 +               xen_xdi->count, capacity>>1, capacity>>11);
   20.25      }
   20.26  
   20.27      unmap_domain_mem(xen_xdi);
    21.1 --- a/xen/include/asm-i386/irq.h	Fri Mar 14 15:48:09 2003 +0000
    21.2 +++ b/xen/include/asm-i386/irq.h	Fri Mar 14 15:58:24 2003 +0000
    21.3 @@ -8,6 +8,7 @@
    21.4  
    21.5  #define SA_INTERRUPT    0x20000000
    21.6  #define SA_SHIRQ        0x04000000
    21.7 +#define SA_NOPROFILE	0x02000000
    21.8  
    21.9  #define SA_SAMPLE_RANDOM  0   /* Linux driver compatibility */
   21.10  
    22.1 --- a/xen/include/asm-i386/pci.h	Fri Mar 14 15:48:09 2003 +0000
    22.2 +++ b/xen/include/asm-i386/pci.h	Fri Mar 14 15:58:24 2003 +0000
    22.3 @@ -151,17 +151,17 @@ static inline int pci_map_sg(struct pci_
    22.4   	for (i = 0; i < nents; i++ ) {
    22.5   		if (sg[i].address && sg[i].page)
    22.6   			out_of_line_bug();
    22.7 -
    22.8 -		/* not worth checking since NULL is ok says SMH */
    22.9  #if 0
   22.10 - 		else if (!sg[i].address && !sg[i].page)
   22.11 +		/* Invalid check, since address==0 is valid. */
   22.12 +		else if (!sg[i].address && !sg[i].page)
   22.13   			out_of_line_bug();
   22.14  #endif
   22.15   
   22.16 - 		if (sg[i].address)
   22.17 +		/* XXX Switched round, since address==0 is valid. */
   22.18 + 		if (sg[i].page)
   22.19 + 			sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset;
   22.20 + 		else
   22.21   			sg[i].dma_address = virt_to_bus(sg[i].address);
   22.22 - 		else
   22.23 - 			sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset;
   22.24   	}
   22.25   
   22.26  	flush_write_buffers();
    23.1 --- a/xen/include/asm-i386/smpboot.h	Fri Mar 14 15:48:09 2003 +0000
    23.2 +++ b/xen/include/asm-i386/smpboot.h	Fri Mar 14 15:58:24 2003 +0000
    23.3 @@ -116,6 +116,15 @@ static inline int target_cpus(void)
    23.4  	return cpu_online_map;
    23.5  }
    23.6  #else
    23.7 -#define target_cpus() (0x01)
    23.8 +/* KAF Xen: Round-robin allocate IRQs to CPUs. */
    23.9 +static inline int target_cpus(void)
   23.10 +{
   23.11 +    static unsigned int cpu_field = 1;
   23.12 +    do { 
   23.13 +        cpu_field <<= 1; 
   23.14 +        if ( cpu_field == 0x100 ) cpu_field = 1; /* logical field == 8 bits */ 
   23.15 +    } while ( (cpu_field & cpu_online_map) == 0 );
   23.16 +    return cpu_field;
   23.17 +}
   23.18  #endif
   23.19  #endif
    26.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.c	Fri Mar 14 15:48:09 2003 +0000
    26.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.c	Fri Mar 14 15:58:24 2003 +0000
    26.3 @@ -522,8 +522,8 @@ int __init xlblk_init(void)
    26.4      blk_ring = (blk_ring_t *)fix_to_virt(FIX_BLKRING_BASE);
    26.5      blk_ring->req_prod = blk_ring->resp_prod = resp_cons = req_prod = 0;
    26.6      
    26.7 -    error = request_irq(XLBLK_RESPONSE_IRQ, xlblk_response_int, 0, 
    26.8 -			"xlblk-response", NULL);
    26.9 +    error = request_irq(XLBLK_RESPONSE_IRQ, xlblk_response_int, 
   26.10 +                        SA_SAMPLE_RANDOM, "xlblk-response", NULL);
   26.11      if ( error )
   26.12      {
   26.13  	printk(KERN_ALERT "Could not allocate receive interrupt\n");
    27.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_ide.c	Fri Mar 14 15:48:09 2003 +0000
    27.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_ide.c	Fri Mar 14 15:58:24 2003 +0000
    27.3 @@ -18,7 +18,7 @@ static int xlide_blksize_size[XLIDE_MAX]
    27.4  static int xlide_hardsect_size[XLIDE_MAX];
    27.5  static int xlide_max_sectors[XLIDE_MAX];
    27.6  
    27.7 -struct gendisk *xlide_gendisk;
    27.8 +struct gendisk *xlide_gendisk = NULL;
    27.9  
   27.10  static struct block_device_operations xlide_block_fops = 
   27.11  {
   27.12 @@ -41,6 +41,13 @@ int xlide_init(xen_disk_info_t *xdi)
   27.13      int i, result, units, minors, disk;
   27.14      struct gendisk *gd;
   27.15  
   27.16 +    /* If we don't have any usable IDE devices we may as well bail now. */
   27.17 +    units = 0;
   27.18 +    for ( i = 0; i < xdi->count; i++ )
   27.19 +        if ( IS_IDE_XENDEV(xdi->disks[i].device) &&
   27.20 +             ((xdi->disks[i].device & XENDEV_IDX_MASK) < 16) ) units++;
   27.21 +    if ( units == 0 ) return 0;
   27.22 +
   27.23      SET_MODULE_OWNER(&xlide_block_fops);
   27.24  
   27.25      result = register_blkdev(XLIDE_MAJOR, XLIDE_MAJOR_NAME, 
   27.26 @@ -73,13 +80,6 @@ int xlide_init(xen_disk_info_t *xdi)
   27.27       */
   27.28      blk_queue_headactive(BLK_DEFAULT_QUEUE(XLIDE_MAJOR), 0);
   27.29  
   27.30 -    /* If we don't have any usable IDE devices we may as well bail now. */
   27.31 -    units = 0;
   27.32 -    for ( i = 0; i < xdi->count; i++ )
   27.33 -        if ( IS_IDE_XENDEV(xdi->disks[i].device) &&
   27.34 -             ((xdi->disks[i].device & XENDEV_IDX_MASK) < 16) ) units++;
   27.35 -    if ( units == 0 ) return 0;
   27.36 -
   27.37      /* We may register up to 16 devices in a sparse identifier space. */
   27.38      units = 16;
   27.39  
   27.40 @@ -133,6 +133,8 @@ int xlide_init(xen_disk_info_t *xdi)
   27.41  
   27.42  void xlide_cleanup(void)
   27.43  {
   27.44 +    if ( xlide_gendisk == NULL ) return;
   27.45 +
   27.46      blk_cleanup_queue(BLK_DEFAULT_QUEUE(XLIDE_MAJOR));
   27.47  
   27.48      xlide_gendisk = NULL;
    28.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_scsi.c	Fri Mar 14 15:48:09 2003 +0000
    28.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_scsi.c	Fri Mar 14 15:58:24 2003 +0000
    28.3 @@ -42,6 +42,13 @@ int xlscsi_init(xen_disk_info_t *xdi)
    28.4      int i, result, units, minors, disk;
    28.5      struct gendisk *gd;
    28.6  
    28.7 +    /* If we don't have any usable SCSI devices we may as well bail now. */
    28.8 +    units = 0;
    28.9 +    for ( i = 0; i < xdi->count; i++ )
   28.10 +        if ( IS_SCSI_XENDEV(xdi->disks[i].device) &&
   28.11 +             ((xdi->disks[i].device & XENDEV_IDX_MASK) < 16) ) units++;
   28.12 +    if ( units == 0 ) return 0;
   28.13 +
   28.14      SET_MODULE_OWNER(&xlscsi_block_fops);
   28.15  
   28.16      result = register_blkdev(XLSCSI_MAJOR, XLSCSI_MAJOR_NAME, 
   28.17 @@ -55,16 +62,16 @@ int xlscsi_init(xen_disk_info_t *xdi)
   28.18      /* Initialize global arrays. */
   28.19      for ( i = 0; i < XLSCSI_MAX; i++ )
   28.20      {
   28.21 -	xlscsi_blksize_size[i]  = 512;
   28.22 +	xlscsi_blksize_size[i]  = 1024; //XXX 512;
   28.23  	xlscsi_hardsect_size[i] = 512;
   28.24 -	xlscsi_max_sectors[i]   = 128;
   28.25 +	xlscsi_max_sectors[i]   = 128*8; //XXX 128
   28.26      }
   28.27  
   28.28      blk_size[XLSCSI_MAJOR]      = NULL;
   28.29      blksize_size[XLSCSI_MAJOR]  = xlscsi_blksize_size;
   28.30      hardsect_size[XLSCSI_MAJOR] = xlscsi_hardsect_size;
   28.31      max_sectors[XLSCSI_MAJOR]   = xlscsi_max_sectors;
   28.32 -    read_ahead[XLSCSI_MAJOR]    = 8;
   28.33 +    read_ahead[XLSCSI_MAJOR]    = NULL; //XXX8;
   28.34  
   28.35      blk_init_queue(BLK_DEFAULT_QUEUE(XLSCSI_MAJOR), do_xlblk_request);
   28.36  
   28.37 @@ -74,13 +81,6 @@ int xlscsi_init(xen_disk_info_t *xdi)
   28.38       */
   28.39      blk_queue_headactive(BLK_DEFAULT_QUEUE(XLSCSI_MAJOR), 0);
   28.40  
   28.41 -    /* If we don't have any usable SCSI devices we may as well bail now. */
   28.42 -    units = 0;
   28.43 -    for ( i = 0; i < xdi->count; i++ )
   28.44 -        if ( IS_SCSI_XENDEV(xdi->disks[i].device) &&
   28.45 -             ((xdi->disks[i].device & XENDEV_IDX_MASK) < 16) ) units++;
   28.46 -    if ( units == 0 ) return 0;
   28.47 -
   28.48      /* We may register up to 16 devices in a sparse identifier space. */
   28.49      units = 16;
   28.50  
   28.51 @@ -134,6 +134,8 @@ int xlscsi_init(xen_disk_info_t *xdi)
   28.52  
   28.53  void xlscsi_cleanup(void)
   28.54  {
   28.55 +    if ( xlscsi_gendisk == NULL ) return;
   28.56 +
   28.57      blk_cleanup_queue(BLK_DEFAULT_QUEUE(XLSCSI_MAJOR));
   28.58  
   28.59      xlscsi_gendisk = NULL;
    29.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment.c	Fri Mar 14 15:48:09 2003 +0000
    29.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment.c	Fri Mar 14 15:58:24 2003 +0000
    29.3 @@ -21,7 +21,7 @@ static int xlseg_blksize_size[XLVIRT_MAX
    29.4  static int xlseg_hardsect_size[XLVIRT_MAX];
    29.5  static int xlseg_max_sectors[XLVIRT_MAX];
    29.6  
    29.7 -struct gendisk *xlsegment_gendisk;
    29.8 +struct gendisk *xlsegment_gendisk = NULL;
    29.9  
   29.10  static xen_disk_info_t xlseg_disk_info;
   29.11  
   29.12 @@ -148,6 +148,8 @@ int __init xlseg_init(void)
   29.13  
   29.14  static void __exit xlseg_cleanup(void)
   29.15  {
   29.16 +    if ( xlsegment_gendisk == NULL ) return;
   29.17 +
   29.18      blk_cleanup_queue(BLK_DEFAULT_QUEUE(XLVIRT_MAJOR));
   29.19  
   29.20      xlsegment_gendisk = NULL;
    30.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/network.c	Fri Mar 14 15:48:09 2003 +0000
    30.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/network.c	Fri Mar 14 15:58:24 2003 +0000
    30.3 @@ -116,8 +116,8 @@ static int network_open(struct net_devic
    30.4  
    30.5      network_alloc_rx_buffers(dev);
    30.6  
    30.7 -    error = request_irq(NET_RX_IRQ, network_rx_int, 0, 
    30.8 -                        "net-rx", dev);
    30.9 +    error = request_irq(NET_RX_IRQ, network_rx_int, 
   30.10 +                        SA_SAMPLE_RANDOM, "net-rx", dev);
   30.11      if ( error )
   30.12      {
   30.13          printk(KERN_WARNING "%s: Could not allocate receive interrupt\n",
   30.14 @@ -126,8 +126,8 @@ static int network_open(struct net_devic
   30.15          goto fail;
   30.16      }
   30.17  
   30.18 -    error = request_irq(NET_TX_IRQ, network_tx_int, 0, 
   30.19 -                        "net-tx", dev);
   30.20 +    error = request_irq(NET_TX_IRQ, network_tx_int, 
   30.21 +                        SA_SAMPLE_RANDOM, "net-tx", dev);
   30.22      if ( error )
   30.23      {
   30.24          printk(KERN_WARNING "%s: Could not allocate transmit interrupt\n",
    31.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/init_task.c	Fri Mar 14 15:48:09 2003 +0000
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,33 +0,0 @@
    31.4 -#include <linux/mm.h>
    31.5 -#include <linux/sched.h>
    31.6 -#include <linux/init.h>
    31.7 -
    31.8 -#include <asm/uaccess.h>
    31.9 -#include <asm/pgtable.h>
   31.10 -#include <asm/desc.h>
   31.11 -
   31.12 -static struct fs_struct init_fs = INIT_FS;
   31.13 -static struct files_struct init_files = INIT_FILES;
   31.14 -static struct signal_struct init_signals = INIT_SIGNALS;
   31.15 -struct mm_struct init_mm = INIT_MM(init_mm);
   31.16 -
   31.17 -/*
   31.18 - * Initial task structure.
   31.19 - *
   31.20 - * We need to make sure that this is 8192-byte aligned due to the
   31.21 - * way process stacks are handled. This is done by having a special
   31.22 - * "init_task" linker map entry..
   31.23 - */
   31.24 -union task_union init_task_union 
   31.25 -	__attribute__((__section__(".data.init_task"))) =
   31.26 -		{ INIT_TASK(init_task_union.task) };
   31.27 -
   31.28 -/*
   31.29 - * per-CPU TSS segments. Threads are completely 'soft' on Linux,
   31.30 - * no more per-task TSS's. The TSS size is kept cacheline-aligned
   31.31 - * so they are allowed to end up in the .data.cacheline_aligned
   31.32 - * section. Since TSS's are completely CPU-local, we want them
   31.33 - * on exact cacheline boundaries, to eliminate cacheline ping-pong.
   31.34 - */ 
   31.35 -struct tss_struct init_tss[NR_CPUS] __cacheline_aligned = { [0 ... NR_CPUS-1] = INIT_TSS };
   31.36 -
    32.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ptrace.c	Fri Mar 14 15:48:09 2003 +0000
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,454 +0,0 @@
    32.4 -/* ptrace.c */
    32.5 -/* By Ross Biro 1/23/92 */
    32.6 -/*
    32.7 - * Pentium III FXSR, SSE support
    32.8 - *	Gareth Hughes <gareth@valinux.com>, May 2000
    32.9 - */
   32.10 -
   32.11 -#include <linux/kernel.h>
   32.12 -#include <linux/sched.h>
   32.13 -#include <linux/mm.h>
   32.14 -#include <linux/smp.h>
   32.15 -#include <linux/smp_lock.h>
   32.16 -#include <linux/errno.h>
   32.17 -#include <linux/ptrace.h>
   32.18 -#include <linux/user.h>
   32.19 -
   32.20 -#include <asm/uaccess.h>
   32.21 -#include <asm/pgtable.h>
   32.22 -#include <asm/system.h>
   32.23 -#include <asm/processor.h>
   32.24 -#include <asm/i387.h>
   32.25 -#include <asm/debugreg.h>
   32.26 -
   32.27 -/*
   32.28 - * does not yet catch signals sent when the child dies.
   32.29 - * in exit.c or in signal.c.
   32.30 - */
   32.31 -
   32.32 -/* determines which flags the user has access to. */
   32.33 -/* 1 = access 0 = no access */
   32.34 -#define FLAG_MASK 0x00044dd5
   32.35 -
   32.36 -/* set's the trap flag. */
   32.37 -#define TRAP_FLAG 0x100
   32.38 -
   32.39 -/*
   32.40 - * Offset of eflags on child stack..
   32.41 - */
   32.42 -#define EFL_OFFSET ((EFL-2)*4-sizeof(struct pt_regs))
   32.43 -
   32.44 -/*
   32.45 - * this routine will get a word off of the processes privileged stack. 
   32.46 - * the offset is how far from the base addr as stored in the TSS.  
   32.47 - * this routine assumes that all the privileged stacks are in our
   32.48 - * data space.
   32.49 - */   
   32.50 -static inline int get_stack_long(struct task_struct *task, int offset)
   32.51 -{
   32.52 -	unsigned char *stack;
   32.53 -
   32.54 -	stack = (unsigned char *)task->thread.esp0;
   32.55 -	stack += offset;
   32.56 -	return (*((int *)stack));
   32.57 -}
   32.58 -
   32.59 -/*
   32.60 - * this routine will put a word on the processes privileged stack. 
   32.61 - * the offset is how far from the base addr as stored in the TSS.  
   32.62 - * this routine assumes that all the privileged stacks are in our
   32.63 - * data space.
   32.64 - */
   32.65 -static inline int put_stack_long(struct task_struct *task, int offset,
   32.66 -	unsigned long data)
   32.67 -{
   32.68 -	unsigned char * stack;
   32.69 -
   32.70 -	stack = (unsigned char *) task->thread.esp0;
   32.71 -	stack += offset;
   32.72 -	*(unsigned long *) stack = data;
   32.73 -	return 0;
   32.74 -}
   32.75 -
   32.76 -static int putreg(struct task_struct *child,
   32.77 -	unsigned long regno, unsigned long value)
   32.78 -{
   32.79 -	switch (regno >> 2) {
   32.80 -		case FS:
   32.81 -			if (value && (value & 3) != 3)
   32.82 -				return -EIO;
   32.83 -			child->thread.fs = value;
   32.84 -			return 0;
   32.85 -		case GS:
   32.86 -			if (value && (value & 3) != 3)
   32.87 -				return -EIO;
   32.88 -			child->thread.gs = value;
   32.89 -			return 0;
   32.90 -		case DS:
   32.91 -		case ES:
   32.92 -			if (value && (value & 3) != 3)
   32.93 -				return -EIO;
   32.94 -			value &= 0xffff;
   32.95 -			break;
   32.96 -		case SS:
   32.97 -		case CS:
   32.98 -			if ((value & 3) != 3)
   32.99 -				return -EIO;
  32.100 -			value &= 0xffff;
  32.101 -			break;
  32.102 -		case EFL:
  32.103 -			value &= FLAG_MASK;
  32.104 -			value |= get_stack_long(child, EFL_OFFSET) & ~FLAG_MASK;
  32.105 -			break;
  32.106 -	}
  32.107 -	if (regno > GS*4)
  32.108 -		regno -= 2*4;
  32.109 -	put_stack_long(child, regno - sizeof(struct pt_regs), value);
  32.110 -	return 0;
  32.111 -}
  32.112 -
  32.113 -static unsigned long getreg(struct task_struct *child,
  32.114 -	unsigned long regno)
  32.115 -{
  32.116 -	unsigned long retval = ~0UL;
  32.117 -
  32.118 -	switch (regno >> 2) {
  32.119 -		case FS:
  32.120 -			retval = child->thread.fs;
  32.121 -			break;
  32.122 -		case GS:
  32.123 -			retval = child->thread.gs;
  32.124 -			break;
  32.125 -		case DS:
  32.126 -		case ES:
  32.127 -		case SS:
  32.128 -		case CS:
  32.129 -			retval = 0xffff;
  32.130 -			/* fall through */
  32.131 -		default:
  32.132 -			if (regno > GS*4)
  32.133 -				regno -= 2*4;
  32.134 -			regno = regno - sizeof(struct pt_regs);
  32.135 -			retval &= get_stack_long(child, regno);
  32.136 -	}
  32.137 -	return retval;
  32.138 -}
  32.139 -
  32.140 -/*
  32.141 - * Called by kernel/ptrace.c when detaching..
  32.142 - *
  32.143 - * Make sure the single step bit is not set.
  32.144 - */
  32.145 -void ptrace_disable(struct task_struct *child)
  32.146 -{ 
  32.147 -	long tmp;
  32.148 -
  32.149 -	tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG;
  32.150 -	put_stack_long(child, EFL_OFFSET, tmp);
  32.151 -}
  32.152 -
  32.153 -asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
  32.154 -{
  32.155 -	struct task_struct *child;
  32.156 -	struct user * dummy = NULL;
  32.157 -	int i, ret;
  32.158 -
  32.159 -	lock_kernel();
  32.160 -	ret = -EPERM;
  32.161 -	if (request == PTRACE_TRACEME) {
  32.162 -		/* are we already being traced? */
  32.163 -		if (current->ptrace & PT_PTRACED)
  32.164 -			goto out;
  32.165 -		/* set the ptrace bit in the process flags. */
  32.166 -		current->ptrace |= PT_PTRACED;
  32.167 -		ret = 0;
  32.168 -		goto out;
  32.169 -	}
  32.170 -	ret = -ESRCH;
  32.171 -	read_lock(&tasklist_lock);
  32.172 -	child = find_task_by_pid(pid);
  32.173 -	if (child)
  32.174 -		get_task_struct(child);
  32.175 -	read_unlock(&tasklist_lock);
  32.176 -	if (!child)
  32.177 -		goto out;
  32.178 -
  32.179 -	ret = -EPERM;
  32.180 -	if (pid == 1)		/* you may not mess with init */
  32.181 -		goto out_tsk;
  32.182 -
  32.183 -	if (request == PTRACE_ATTACH) {
  32.184 -		ret = ptrace_attach(child);
  32.185 -		goto out_tsk;
  32.186 -	}
  32.187 -
  32.188 -	ret = ptrace_check_attach(child, request == PTRACE_KILL);
  32.189 -	if (ret < 0)
  32.190 -		goto out_tsk;
  32.191 -
  32.192 -	switch (request) {
  32.193 -	/* when I and D space are separate, these will need to be fixed. */
  32.194 -	case PTRACE_PEEKTEXT: /* read word at location addr. */ 
  32.195 -	case PTRACE_PEEKDATA: {
  32.196 -		unsigned long tmp;
  32.197 -		int copied;
  32.198 -
  32.199 -		copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
  32.200 -		ret = -EIO;
  32.201 -		if (copied != sizeof(tmp))
  32.202 -			break;
  32.203 -		ret = put_user(tmp,(unsigned long *) data);
  32.204 -		break;
  32.205 -	}
  32.206 -
  32.207 -	/* read the word at location addr in the USER area. */
  32.208 -	case PTRACE_PEEKUSR: {
  32.209 -		unsigned long tmp;
  32.210 -
  32.211 -		ret = -EIO;
  32.212 -		if ((addr & 3) || addr < 0 || 
  32.213 -		    addr > sizeof(struct user) - 3)
  32.214 -			break;
  32.215 -
  32.216 -		tmp = 0;  /* Default return condition */
  32.217 -		if(addr < FRAME_SIZE*sizeof(long))
  32.218 -			tmp = getreg(child, addr);
  32.219 -		if(addr >= (long) &dummy->u_debugreg[0] &&
  32.220 -		   addr <= (long) &dummy->u_debugreg[7]){
  32.221 -			addr -= (long) &dummy->u_debugreg[0];
  32.222 -			addr = addr >> 2;
  32.223 -			tmp = child->thread.debugreg[addr];
  32.224 -		}
  32.225 -		ret = put_user(tmp,(unsigned long *) data);
  32.226 -		break;
  32.227 -	}
  32.228 -
  32.229 -	/* when I and D space are separate, this will have to be fixed. */
  32.230 -	case PTRACE_POKETEXT: /* write the word at location addr. */
  32.231 -	case PTRACE_POKEDATA:
  32.232 -		ret = 0;
  32.233 -		if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
  32.234 -			break;
  32.235 -		ret = -EIO;
  32.236 -		break;
  32.237 -
  32.238 -	case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
  32.239 -		ret = -EIO;
  32.240 -		if ((addr & 3) || addr < 0 || 
  32.241 -		    addr > sizeof(struct user) - 3)
  32.242 -			break;
  32.243 -
  32.244 -		if (addr < FRAME_SIZE*sizeof(long)) {
  32.245 -			ret = putreg(child, addr, data);
  32.246 -			break;
  32.247 -		}
  32.248 -		/* We need to be very careful here.  We implicitly
  32.249 -		   want to modify a portion of the task_struct, and we
  32.250 -		   have to be selective about what portions we allow someone
  32.251 -		   to modify. */
  32.252 -
  32.253 -		  ret = -EIO;
  32.254 -		  if(addr >= (long) &dummy->u_debugreg[0] &&
  32.255 -		     addr <= (long) &dummy->u_debugreg[7]){
  32.256 -
  32.257 -			  if(addr == (long) &dummy->u_debugreg[4]) break;
  32.258 -			  if(addr == (long) &dummy->u_debugreg[5]) break;
  32.259 -			  if(addr < (long) &dummy->u_debugreg[4] &&
  32.260 -			     ((unsigned long) data) >= TASK_SIZE-3) break;
  32.261 -			  
  32.262 -			  if(addr == (long) &dummy->u_debugreg[7]) {
  32.263 -				  data &= ~DR_CONTROL_RESERVED;
  32.264 -				  for(i=0; i<4; i++)
  32.265 -					  if ((0x5f54 >> ((data >> (16 + 4*i)) & 0xf)) & 1)
  32.266 -						  goto out_tsk;
  32.267 -			  }
  32.268 -
  32.269 -			  addr -= (long) &dummy->u_debugreg;
  32.270 -			  addr = addr >> 2;
  32.271 -			  child->thread.debugreg[addr] = data;
  32.272 -			  ret = 0;
  32.273 -		  }
  32.274 -		  break;
  32.275 -
  32.276 -	case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
  32.277 -	case PTRACE_CONT: { /* restart after signal. */
  32.278 -		long tmp;
  32.279 -
  32.280 -		ret = -EIO;
  32.281 -		if ((unsigned long) data > _NSIG)
  32.282 -			break;
  32.283 -		if (request == PTRACE_SYSCALL)
  32.284 -			child->ptrace |= PT_TRACESYS;
  32.285 -		else
  32.286 -			child->ptrace &= ~PT_TRACESYS;
  32.287 -		child->exit_code = data;
  32.288 -	/* make sure the single step bit is not set. */
  32.289 -		tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG;
  32.290 -		put_stack_long(child, EFL_OFFSET,tmp);
  32.291 -		wake_up_process(child);
  32.292 -		ret = 0;
  32.293 -		break;
  32.294 -	}
  32.295 -
  32.296 -/*
  32.297 - * make the child exit.  Best I can do is send it a sigkill. 
  32.298 - * perhaps it should be put in the status that it wants to 
  32.299 - * exit.
  32.300 - */
  32.301 -	case PTRACE_KILL: {
  32.302 -		long tmp;
  32.303 -
  32.304 -		ret = 0;
  32.305 -		if (child->state == TASK_ZOMBIE)	/* already dead */
  32.306 -			break;
  32.307 -		child->exit_code = SIGKILL;
  32.308 -		/* make sure the single step bit is not set. */
  32.309 -		tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG;
  32.310 -		put_stack_long(child, EFL_OFFSET, tmp);
  32.311 -		wake_up_process(child);
  32.312 -		break;
  32.313 -	}
  32.314 -
  32.315 -	case PTRACE_SINGLESTEP: {  /* set the trap flag. */
  32.316 -		long tmp;
  32.317 -
  32.318 -		ret = -EIO;
  32.319 -		if ((unsigned long) data > _NSIG)
  32.320 -			break;
  32.321 -		child->ptrace &= ~PT_TRACESYS;
  32.322 -		if ((child->ptrace & PT_DTRACE) == 0) {
  32.323 -			/* Spurious delayed TF traps may occur */
  32.324 -			child->ptrace |= PT_DTRACE;
  32.325 -		}
  32.326 -		tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG;
  32.327 -		put_stack_long(child, EFL_OFFSET, tmp);
  32.328 -		child->exit_code = data;
  32.329 -		/* give it a chance to run. */
  32.330 -		wake_up_process(child);
  32.331 -		ret = 0;
  32.332 -		break;
  32.333 -	}
  32.334 -
  32.335 -	case PTRACE_DETACH:
  32.336 -		/* detach a process that was attached. */
  32.337 -		ret = ptrace_detach(child, data);
  32.338 -		break;
  32.339 -
  32.340 -	case PTRACE_GETREGS: { /* Get all gp regs from the child. */
  32.341 -	  	if (!access_ok(VERIFY_WRITE, (unsigned *)data, FRAME_SIZE*sizeof(long))) {
  32.342 -			ret = -EIO;
  32.343 -			break;
  32.344 -		}
  32.345 -		for ( i = 0; i < FRAME_SIZE*sizeof(long); i += sizeof(long) ) {
  32.346 -			__put_user(getreg(child, i),(unsigned long *) data);
  32.347 -			data += sizeof(long);
  32.348 -		}
  32.349 -		ret = 0;
  32.350 -		break;
  32.351 -	}
  32.352 -
  32.353 -	case PTRACE_SETREGS: { /* Set all gp regs in the child. */
  32.354 -		unsigned long tmp;
  32.355 -	  	if (!access_ok(VERIFY_READ, (unsigned *)data, FRAME_SIZE*sizeof(long))) {
  32.356 -			ret = -EIO;
  32.357 -			break;
  32.358 -		}
  32.359 -		for ( i = 0; i < FRAME_SIZE*sizeof(long); i += sizeof(long) ) {
  32.360 -			__get_user(tmp, (unsigned long *) data);
  32.361 -			putreg(child, i, tmp);
  32.362 -			data += sizeof(long);
  32.363 -		}
  32.364 -		ret = 0;
  32.365 -		break;
  32.366 -	}
  32.367 -
  32.368 -	case PTRACE_GETFPREGS: { /* Get the child FPU state. */
  32.369 -		if (!access_ok(VERIFY_WRITE, (unsigned *)data,
  32.370 -			       sizeof(struct user_i387_struct))) {
  32.371 -			ret = -EIO;
  32.372 -			break;
  32.373 -		}
  32.374 -		ret = 0;
  32.375 -		if ( !child->used_math )
  32.376 -			load_empty_fpu(child);
  32.377 -		get_fpregs((struct user_i387_struct *)data, child);
  32.378 -		break;
  32.379 -	}
  32.380 -
  32.381 -	case PTRACE_SETFPREGS: { /* Set the child FPU state. */
  32.382 -		if (!access_ok(VERIFY_READ, (unsigned *)data,
  32.383 -			       sizeof(struct user_i387_struct))) {
  32.384 -			ret = -EIO;
  32.385 -			break;
  32.386 -		}
  32.387 -		child->used_math = 1;
  32.388 -		set_fpregs(child, (struct user_i387_struct *)data);
  32.389 -		ret = 0;
  32.390 -		break;
  32.391 -	}
  32.392 -
  32.393 -	case PTRACE_GETFPXREGS: { /* Get the child extended FPU state. */
  32.394 -		if (!access_ok(VERIFY_WRITE, (unsigned *)data,
  32.395 -			       sizeof(struct user_fxsr_struct))) {
  32.396 -			ret = -EIO;
  32.397 -			break;
  32.398 -		}
  32.399 -		if ( !child->used_math )
  32.400 -			load_empty_fpu(child);
  32.401 -		ret = get_fpxregs((struct user_fxsr_struct *)data, child);
  32.402 -		break;
  32.403 -	}
  32.404 -
  32.405 -	case PTRACE_SETFPXREGS: { /* Set the child extended FPU state. */
  32.406 -		if (!access_ok(VERIFY_READ, (unsigned *)data,
  32.407 -			       sizeof(struct user_fxsr_struct))) {
  32.408 -			ret = -EIO;
  32.409 -			break;
  32.410 -		}
  32.411 -		child->used_math = 1;
  32.412 -		ret = set_fpxregs(child, (struct user_fxsr_struct *)data);
  32.413 -		break;
  32.414 -	}
  32.415 -
  32.416 -	case PTRACE_SETOPTIONS: {
  32.417 -		if (data & PTRACE_O_TRACESYSGOOD)
  32.418 -			child->ptrace |= PT_TRACESYSGOOD;
  32.419 -		else
  32.420 -			child->ptrace &= ~PT_TRACESYSGOOD;
  32.421 -		ret = 0;
  32.422 -		break;
  32.423 -	}
  32.424 -
  32.425 -	default:
  32.426 -		ret = -EIO;
  32.427 -		break;
  32.428 -	}
  32.429 -out_tsk:
  32.430 -	free_task_struct(child);
  32.431 -out:
  32.432 -	unlock_kernel();
  32.433 -	return ret;
  32.434 -}
  32.435 -
  32.436 -asmlinkage void syscall_trace(void)
  32.437 -{
  32.438 -	if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) !=
  32.439 -			(PT_PTRACED|PT_TRACESYS))
  32.440 -		return;
  32.441 -	/* the 0x80 provides a way for the tracing parent to distinguish
  32.442 -	   between a syscall stop and SIGTRAP delivery */
  32.443 -	current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
  32.444 -					? 0x80 : 0);
  32.445 -	current->state = TASK_STOPPED;
  32.446 -	notify_parent(current, SIGCHLD);
  32.447 -	schedule();
  32.448 -	/*
  32.449 -	 * this isn't the same as continuing with a signal, but it will do
  32.450 -	 * for normal use.  strace only continues with a signal if the
  32.451 -	 * stopping signal is not SIGTRAP.  -brl
  32.452 -	 */
  32.453 -	if (current->exit_code) {
  32.454 -		send_sig(current->exit_code, current, 1);
  32.455 -		current->exit_code = 0;
  32.456 -	}
  32.457 -}
    33.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/semaphore.c	Fri Mar 14 15:48:09 2003 +0000
    33.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.3 @@ -1,291 +0,0 @@
    33.4 -/*
    33.5 - * i386 semaphore implementation.
    33.6 - *
    33.7 - * (C) Copyright 1999 Linus Torvalds
    33.8 - *
    33.9 - * Portions Copyright 1999 Red Hat, Inc.
   33.10 - *
   33.11 - *	This program is free software; you can redistribute it and/or
   33.12 - *	modify it under the terms of the GNU General Public License
   33.13 - *	as published by the Free Software Foundation; either version
   33.14 - *	2 of the License, or (at your option) any later version.
   33.15 - *
   33.16 - * rw semaphores implemented November 1999 by Benjamin LaHaise <bcrl@redhat.com>
   33.17 - */
   33.18 -#include <linux/config.h>
   33.19 -#include <linux/sched.h>
   33.20 -#include <asm/semaphore.h>
   33.21 -
   33.22 -/*
   33.23 - * Semaphores are implemented using a two-way counter:
   33.24 - * The "count" variable is decremented for each process
   33.25 - * that tries to acquire the semaphore, while the "sleeping"
   33.26 - * variable is a count of such acquires.
   33.27 - *
   33.28 - * Notably, the inline "up()" and "down()" functions can
   33.29 - * efficiently test if they need to do any extra work (up
   33.30 - * needs to do something only if count was negative before
   33.31 - * the increment operation.
   33.32 - *
   33.33 - * "sleeping" and the contention routine ordering is
   33.34 - * protected by the semaphore spinlock.
   33.35 - *
   33.36 - * Note that these functions are only called when there is
   33.37 - * contention on the lock, and as such all this is the
   33.38 - * "non-critical" part of the whole semaphore business. The
   33.39 - * critical part is the inline stuff in <asm/semaphore.h>
   33.40 - * where we want to avoid any extra jumps and calls.
   33.41 - */
   33.42 -
   33.43 -/*
   33.44 - * Logic:
   33.45 - *  - only on a boundary condition do we need to care. When we go
   33.46 - *    from a negative count to a non-negative, we wake people up.
   33.47 - *  - when we go from a non-negative count to a negative do we
   33.48 - *    (a) synchronize with the "sleeper" count and (b) make sure
   33.49 - *    that we're on the wakeup list before we synchronize so that
   33.50 - *    we cannot lose wakeup events.
   33.51 - */
   33.52 -
   33.53 -void __up(struct semaphore *sem)
   33.54 -{
   33.55 -	wake_up(&sem->wait);
   33.56 -}
   33.57 -
   33.58 -static spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED;
   33.59 -
   33.60 -void __down(struct semaphore * sem)
   33.61 -{
   33.62 -	struct task_struct *tsk = current;
   33.63 -	DECLARE_WAITQUEUE(wait, tsk);
   33.64 -	tsk->state = TASK_UNINTERRUPTIBLE;
   33.65 -	add_wait_queue_exclusive(&sem->wait, &wait);
   33.66 -
   33.67 -	spin_lock_irq(&semaphore_lock);
   33.68 -	sem->sleepers++;
   33.69 -	for (;;) {
   33.70 -		int sleepers = sem->sleepers;
   33.71 -
   33.72 -		/*
   33.73 -		 * Add "everybody else" into it. They aren't
   33.74 -		 * playing, because we own the spinlock.
   33.75 -		 */
   33.76 -		if (!atomic_add_negative(sleepers - 1, &sem->count)) {
   33.77 -			sem->sleepers = 0;
   33.78 -			break;
   33.79 -		}
   33.80 -		sem->sleepers = 1;	/* us - see -1 above */
   33.81 -		spin_unlock_irq(&semaphore_lock);
   33.82 -
   33.83 -		schedule();
   33.84 -		tsk->state = TASK_UNINTERRUPTIBLE;
   33.85 -		spin_lock_irq(&semaphore_lock);
   33.86 -	}
   33.87 -	spin_unlock_irq(&semaphore_lock);
   33.88 -	remove_wait_queue(&sem->wait, &wait);
   33.89 -	tsk->state = TASK_RUNNING;
   33.90 -	wake_up(&sem->wait);
   33.91 -}
   33.92 -
   33.93 -int __down_interruptible(struct semaphore * sem)
   33.94 -{
   33.95 -	int retval = 0;
   33.96 -	struct task_struct *tsk = current;
   33.97 -	DECLARE_WAITQUEUE(wait, tsk);
   33.98 -	tsk->state = TASK_INTERRUPTIBLE;
   33.99 -	add_wait_queue_exclusive(&sem->wait, &wait);
  33.100 -
  33.101 -	spin_lock_irq(&semaphore_lock);
  33.102 -	sem->sleepers ++;
  33.103 -	for (;;) {
  33.104 -		int sleepers = sem->sleepers;
  33.105 -
  33.106 -		/*
  33.107 -		 * With signals pending, this turns into
  33.108 -		 * the trylock failure case - we won't be
  33.109 -		 * sleeping, and we* can't get the lock as
  33.110 -		 * it has contention. Just correct the count
  33.111 -		 * and exit.
  33.112 -		 */
  33.113 -		if (signal_pending(current)) {
  33.114 -			retval = -EINTR;
  33.115 -			sem->sleepers = 0;
  33.116 -			atomic_add(sleepers, &sem->count);
  33.117 -			break;
  33.118 -		}
  33.119 -
  33.120 -		/*
  33.121 -		 * Add "everybody else" into it. They aren't
  33.122 -		 * playing, because we own the spinlock. The
  33.123 -		 * "-1" is because we're still hoping to get
  33.124 -		 * the lock.
  33.125 -		 */
  33.126 -		if (!atomic_add_negative(sleepers - 1, &sem->count)) {
  33.127 -			sem->sleepers = 0;
  33.128 -			break;
  33.129 -		}
  33.130 -		sem->sleepers = 1;	/* us - see -1 above */
  33.131 -		spin_unlock_irq(&semaphore_lock);
  33.132 -
  33.133 -		schedule();
  33.134 -		tsk->state = TASK_INTERRUPTIBLE;
  33.135 -		spin_lock_irq(&semaphore_lock);
  33.136 -	}
  33.137 -	spin_unlock_irq(&semaphore_lock);
  33.138 -	tsk->state = TASK_RUNNING;
  33.139 -	remove_wait_queue(&sem->wait, &wait);
  33.140 -	wake_up(&sem->wait);
  33.141 -	return retval;
  33.142 -}
  33.143 -
  33.144 -/*
  33.145 - * Trylock failed - make sure we correct for
  33.146 - * having decremented the count.
  33.147 - *
  33.148 - * We could have done the trylock with a
  33.149 - * single "cmpxchg" without failure cases,
  33.150 - * but then it wouldn't work on a 386.
  33.151 - */
  33.152 -int __down_trylock(struct semaphore * sem)
  33.153 -{
  33.154 -	int sleepers;
  33.155 -	unsigned long flags;
  33.156 -
  33.157 -	spin_lock_irqsave(&semaphore_lock, flags);
  33.158 -	sleepers = sem->sleepers + 1;
  33.159 -	sem->sleepers = 0;
  33.160 -
  33.161 -	/*
  33.162 -	 * Add "everybody else" and us into it. They aren't
  33.163 -	 * playing, because we own the spinlock.
  33.164 -	 */
  33.165 -	if (!atomic_add_negative(sleepers, &sem->count))
  33.166 -		wake_up(&sem->wait);
  33.167 -
  33.168 -	spin_unlock_irqrestore(&semaphore_lock, flags);
  33.169 -	return 1;
  33.170 -}
  33.171 -
  33.172 -
  33.173 -/*
  33.174 - * The semaphore operations have a special calling sequence that
  33.175 - * allow us to do a simpler in-line version of them. These routines
  33.176 - * need to convert that sequence back into the C sequence when
  33.177 - * there is contention on the semaphore.
  33.178 - *
  33.179 - * %ecx contains the semaphore pointer on entry. Save the C-clobbered
  33.180 - * registers (%eax, %edx and %ecx) except %eax when used as a return
  33.181 - * value..
  33.182 - */
  33.183 -asm(
  33.184 -".text\n"
  33.185 -".align 4\n"
  33.186 -".globl __down_failed\n"
  33.187 -"__down_failed:\n\t"
  33.188 -#if defined(CONFIG_FRAME_POINTER)
  33.189 -	"pushl %ebp\n\t"
  33.190 -	"movl  %esp,%ebp\n\t"
  33.191 -#endif
  33.192 -	"pushl %eax\n\t"
  33.193 -	"pushl %edx\n\t"
  33.194 -	"pushl %ecx\n\t"
  33.195 -	"call __down\n\t"
  33.196 -	"popl %ecx\n\t"
  33.197 -	"popl %edx\n\t"
  33.198 -	"popl %eax\n\t"
  33.199 -#if defined(CONFIG_FRAME_POINTER)
  33.200 -	"movl %ebp,%esp\n\t"
  33.201 -	"popl %ebp\n\t"
  33.202 -#endif
  33.203 -	"ret"
  33.204 -);
  33.205 -
  33.206 -asm(
  33.207 -".text\n"
  33.208 -".align 4\n"
  33.209 -".globl __down_failed_interruptible\n"
  33.210 -"__down_failed_interruptible:\n\t"
  33.211 -#if defined(CONFIG_FRAME_POINTER)
  33.212 -	"pushl %ebp\n\t"
  33.213 -	"movl  %esp,%ebp\n\t"
  33.214 -#endif
  33.215 -	"pushl %edx\n\t"
  33.216 -	"pushl %ecx\n\t"
  33.217 -	"call __down_interruptible\n\t"
  33.218 -	"popl %ecx\n\t"
  33.219 -	"popl %edx\n\t"
  33.220 -#if defined(CONFIG_FRAME_POINTER)
  33.221 -	"movl %ebp,%esp\n\t"
  33.222 -	"popl %ebp\n\t"
  33.223 -#endif
  33.224 -	"ret"
  33.225 -);
  33.226 -
  33.227 -asm(
  33.228 -".text\n"
  33.229 -".align 4\n"
  33.230 -".globl __down_failed_trylock\n"
  33.231 -"__down_failed_trylock:\n\t"
  33.232 -#if defined(CONFIG_FRAME_POINTER)
  33.233 -	"pushl %ebp\n\t"
  33.234 -	"movl  %esp,%ebp\n\t"
  33.235 -#endif
  33.236 -	"pushl %edx\n\t"
  33.237 -	"pushl %ecx\n\t"
  33.238 -	"call __down_trylock\n\t"
  33.239 -	"popl %ecx\n\t"
  33.240 -	"popl %edx\n\t"
  33.241 -#if defined(CONFIG_FRAME_POINTER)
  33.242 -	"movl %ebp,%esp\n\t"
  33.243 -	"popl %ebp\n\t"
  33.244 -#endif
  33.245 -	"ret"
  33.246 -);
  33.247 -
  33.248 -asm(
  33.249 -".text\n"
  33.250 -".align 4\n"
  33.251 -".globl __up_wakeup\n"
  33.252 -"__up_wakeup:\n\t"
  33.253 -	"pushl %eax\n\t"
  33.254 -	"pushl %edx\n\t"
  33.255 -	"pushl %ecx\n\t"
  33.256 -	"call __up\n\t"
  33.257 -	"popl %ecx\n\t"
  33.258 -	"popl %edx\n\t"
  33.259 -	"popl %eax\n\t"
  33.260 -	"ret"
  33.261 -);
  33.262 -
  33.263 -/*
  33.264 - * rw spinlock fallbacks
  33.265 - */
  33.266 -#if defined(CONFIG_SMP)
  33.267 -asm(
  33.268 -".text\n"
  33.269 -".align	4\n"
  33.270 -".globl	__write_lock_failed\n"
  33.271 -"__write_lock_failed:\n\t"
  33.272 -	LOCK "addl	$" RW_LOCK_BIAS_STR ",(%eax)\n"
  33.273 -"1:	rep; nop\n\t"
  33.274 -	"cmpl	$" RW_LOCK_BIAS_STR ",(%eax)\n\t"
  33.275 -	"jne	1b\n\t"
  33.276 -	LOCK "subl	$" RW_LOCK_BIAS_STR ",(%eax)\n\t"
  33.277 -	"jnz	__write_lock_failed\n\t"
  33.278 -	"ret"
  33.279 -);
  33.280 -
  33.281 -asm(
  33.282 -".text\n"
  33.283 -".align	4\n"
  33.284 -".globl	__read_lock_failed\n"
  33.285 -"__read_lock_failed:\n\t"
  33.286 -	LOCK "incl	(%eax)\n"
  33.287 -"1:	rep; nop\n\t"
  33.288 -	"cmpl	$1,(%eax)\n\t"
  33.289 -	"js	1b\n\t"
  33.290 -	LOCK "decl	(%eax)\n\t"
  33.291 -	"js	__read_lock_failed\n\t"
  33.292 -	"ret"
  33.293 -);
  33.294 -#endif
    34.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/sys_i386.c	Fri Mar 14 15:48:09 2003 +0000
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,256 +0,0 @@
    34.4 -/*
    34.5 - * linux/arch/i386/kernel/sys_i386.c
    34.6 - *
    34.7 - * This file contains various random system calls that
    34.8 - * have a non-standard calling sequence on the Linux/i386
    34.9 - * platform.
   34.10 - */
   34.11 -
   34.12 -#include <linux/errno.h>
   34.13 -#include <linux/sched.h>
   34.14 -#include <linux/mm.h>
   34.15 -#include <linux/smp.h>
   34.16 -#include <linux/smp_lock.h>
   34.17 -#include <linux/sem.h>
   34.18 -#include <linux/msg.h>
   34.19 -#include <linux/shm.h>
   34.20 -#include <linux/stat.h>
   34.21 -#include <linux/mman.h>
   34.22 -#include <linux/file.h>
   34.23 -#include <linux/utsname.h>
   34.24 -
   34.25 -#include <asm/uaccess.h>
   34.26 -#include <asm/ipc.h>
   34.27 -
   34.28 -/*
   34.29 - * sys_pipe() is the normal C calling standard for creating
   34.30 - * a pipe. It's not the way Unix traditionally does this, though.
   34.31 - */
   34.32 -asmlinkage int sys_pipe(unsigned long * fildes)
   34.33 -{
   34.34 -	int fd[2];
   34.35 -	int error;
   34.36 -
   34.37 -	error = do_pipe(fd);
   34.38 -	if (!error) {
   34.39 -		if (copy_to_user(fildes, fd, 2*sizeof(int)))
   34.40 -			error = -EFAULT;
   34.41 -	}
   34.42 -	return error;
   34.43 -}
   34.44 -
   34.45 -/* common code for old and new mmaps */
   34.46 -static inline long do_mmap2(
   34.47 -	unsigned long addr, unsigned long len,
   34.48 -	unsigned long prot, unsigned long flags,
   34.49 -	unsigned long fd, unsigned long pgoff)
   34.50 -{
   34.51 -	int error = -EBADF;
   34.52 -	struct file * file = NULL;
   34.53 -
   34.54 -	flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
   34.55 -	if (!(flags & MAP_ANONYMOUS)) {
   34.56 -		file = fget(fd);
   34.57 -		if (!file)
   34.58 -			goto out;
   34.59 -	}
   34.60 -
   34.61 -	down_write(&current->mm->mmap_sem);
   34.62 -	error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
   34.63 -	up_write(&current->mm->mmap_sem);
   34.64 -
   34.65 -	if (file)
   34.66 -		fput(file);
   34.67 -out:
   34.68 -	return error;
   34.69 -}
   34.70 -
   34.71 -asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
   34.72 -	unsigned long prot, unsigned long flags,
   34.73 -	unsigned long fd, unsigned long pgoff)
   34.74 -{
   34.75 -	return do_mmap2(addr, len, prot, flags, fd, pgoff);
   34.76 -}
   34.77 -
   34.78 -/*
   34.79 - * Perform the select(nd, in, out, ex, tv) and mmap() system
   34.80 - * calls. Linux/i386 didn't use to be able to handle more than
   34.81 - * 4 system call parameters, so these system calls used a memory
   34.82 - * block for parameter passing..
   34.83 - */
   34.84 -
   34.85 -struct mmap_arg_struct {
   34.86 -	unsigned long addr;
   34.87 -	unsigned long len;
   34.88 -	unsigned long prot;
   34.89 -	unsigned long flags;
   34.90 -	unsigned long fd;
   34.91 -	unsigned long offset;
   34.92 -};
   34.93 -
   34.94 -asmlinkage int old_mmap(struct mmap_arg_struct *arg)
   34.95 -{
   34.96 -	struct mmap_arg_struct a;
   34.97 -	int err = -EFAULT;
   34.98 -
   34.99 -	if (copy_from_user(&a, arg, sizeof(a)))
  34.100 -		goto out;
  34.101 -
  34.102 -	err = -EINVAL;
  34.103 -	if (a.offset & ~PAGE_MASK)
  34.104 -		goto out;
  34.105 -
  34.106 -	err = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT);
  34.107 -out:
  34.108 -	return err;
  34.109 -}
  34.110 -
  34.111 -
  34.112 -extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
  34.113 -
  34.114 -struct sel_arg_struct {
  34.115 -	unsigned long n;
  34.116 -	fd_set *inp, *outp, *exp;
  34.117 -	struct timeval *tvp;
  34.118 -};
  34.119 -
  34.120 -asmlinkage int old_select(struct sel_arg_struct *arg)
  34.121 -{
  34.122 -	struct sel_arg_struct a;
  34.123 -
  34.124 -	if (copy_from_user(&a, arg, sizeof(a)))
  34.125 -		return -EFAULT;
  34.126 -	/* sys_select() does the appropriate kernel locking */
  34.127 -	return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
  34.128 -}
  34.129 -
  34.130 -/*
  34.131 - * sys_ipc() is the de-multiplexer for the SysV IPC calls..
  34.132 - *
  34.133 - * This is really horribly ugly.
  34.134 - */
  34.135 -asmlinkage int sys_ipc (uint call, int first, int second,
  34.136 -			int third, void *ptr, long fifth)
  34.137 -{
  34.138 -	int version, ret;
  34.139 -
  34.140 -	version = call >> 16; /* hack for backward compatibility */
  34.141 -	call &= 0xffff;
  34.142 -
  34.143 -	switch (call) {
  34.144 -	case SEMOP:
  34.145 -		return sys_semop (first, (struct sembuf *)ptr, second);
  34.146 -	case SEMGET:
  34.147 -		return sys_semget (first, second, third);
  34.148 -	case SEMCTL: {
  34.149 -		union semun fourth;
  34.150 -		if (!ptr)
  34.151 -			return -EINVAL;
  34.152 -		if (get_user(fourth.__pad, (void **) ptr))
  34.153 -			return -EFAULT;
  34.154 -		return sys_semctl (first, second, third, fourth);
  34.155 -	}
  34.156 -
  34.157 -	case MSGSND:
  34.158 -		return sys_msgsnd (first, (struct msgbuf *) ptr, 
  34.159 -				   second, third);
  34.160 -	case MSGRCV:
  34.161 -		switch (version) {
  34.162 -		case 0: {
  34.163 -			struct ipc_kludge tmp;
  34.164 -			if (!ptr)
  34.165 -				return -EINVAL;
  34.166 -			
  34.167 -			if (copy_from_user(&tmp,
  34.168 -					   (struct ipc_kludge *) ptr, 
  34.169 -					   sizeof (tmp)))
  34.170 -				return -EFAULT;
  34.171 -			return sys_msgrcv (first, tmp.msgp, second,
  34.172 -					   tmp.msgtyp, third);
  34.173 -		}
  34.174 -		default:
  34.175 -			return sys_msgrcv (first,
  34.176 -					   (struct msgbuf *) ptr,
  34.177 -					   second, fifth, third);
  34.178 -		}
  34.179 -	case MSGGET:
  34.180 -		return sys_msgget ((key_t) first, second);
  34.181 -	case MSGCTL:
  34.182 -		return sys_msgctl (first, second, (struct msqid_ds *) ptr);
  34.183 -
  34.184 -	case SHMAT:
  34.185 -		switch (version) {
  34.186 -		default: {
  34.187 -			ulong raddr;
  34.188 -			ret = sys_shmat (first, (char *) ptr, second, &raddr);
  34.189 -			if (ret)
  34.190 -				return ret;
  34.191 -			return put_user (raddr, (ulong *) third);
  34.192 -		}
  34.193 -		case 1:	/* iBCS2 emulator entry point */
  34.194 -			if (!segment_eq(get_fs(), get_ds()))
  34.195 -				return -EINVAL;
  34.196 -			return sys_shmat (first, (char *) ptr, second, (ulong *) third);
  34.197 -		}
  34.198 -	case SHMDT: 
  34.199 -		return sys_shmdt ((char *)ptr);
  34.200 -	case SHMGET:
  34.201 -		return sys_shmget (first, second, third);
  34.202 -	case SHMCTL:
  34.203 -		return sys_shmctl (first, second,
  34.204 -				   (struct shmid_ds *) ptr);
  34.205 -	default:
  34.206 -		return -EINVAL;
  34.207 -	}
  34.208 -}
  34.209 -
  34.210 -/*
  34.211 - * Old cruft
  34.212 - */
  34.213 -asmlinkage int sys_uname(struct old_utsname * name)
  34.214 -{
  34.215 -	int err;
  34.216 -	if (!name)
  34.217 -		return -EFAULT;
  34.218 -	down_read(&uts_sem);
  34.219 -	err=copy_to_user(name, &system_utsname, sizeof (*name));
  34.220 -	up_read(&uts_sem);
  34.221 -	return err?-EFAULT:0;
  34.222 -}
  34.223 -
  34.224 -asmlinkage int sys_olduname(struct oldold_utsname * name)
  34.225 -{
  34.226 -	int error;
  34.227 -
  34.228 -	if (!name)
  34.229 -		return -EFAULT;
  34.230 -	if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
  34.231 -		return -EFAULT;
  34.232 -  
  34.233 -  	down_read(&uts_sem);
  34.234 -	
  34.235 -	error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
  34.236 -	error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
  34.237 -	error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
  34.238 -	error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
  34.239 -	error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
  34.240 -	error |= __put_user(0,name->release+__OLD_UTS_LEN);
  34.241 -	error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
  34.242 -	error |= __put_user(0,name->version+__OLD_UTS_LEN);
  34.243 -	error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
  34.244 -	error |= __put_user(0,name->machine+__OLD_UTS_LEN);
  34.245 -	
  34.246 -	up_read(&uts_sem);
  34.247 -	
  34.248 -	error = error ? -EFAULT : 0;
  34.249 -
  34.250 -	return error;
  34.251 -}
  34.252 -
  34.253 -asmlinkage int sys_pause(void)
  34.254 -{
  34.255 -	current->state = TASK_INTERRUPTIBLE;
  34.256 -	schedule();
  34.257 -	return -ERESTARTNOHAND;
  34.258 -}
  34.259 -
    35.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/checksum.S	Fri Mar 14 15:48:09 2003 +0000
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,496 +0,0 @@
    35.4 -/*
    35.5 - * INET		An implementation of the TCP/IP protocol suite for the LINUX
    35.6 - *		operating system.  INET is implemented using the  BSD Socket
    35.7 - *		interface as the means of communication with the user level.
    35.8 - *
    35.9 - *		IP/TCP/UDP checksumming routines
   35.10 - *
   35.11 - * Authors:	Jorge Cwik, <jorge@laser.satlink.net>
   35.12 - *		Arnt Gulbrandsen, <agulbra@nvg.unit.no>
   35.13 - *		Tom May, <ftom@netcom.com>
   35.14 - *              Pentium Pro/II routines:
   35.15 - *              Alexander Kjeldaas <astor@guardian.no>
   35.16 - *              Finn Arne Gangstad <finnag@guardian.no>
   35.17 - *		Lots of code moved from tcp.c and ip.c; see those files
   35.18 - *		for more names.
   35.19 - *
   35.20 - * Changes:     Ingo Molnar, converted csum_partial_copy() to 2.1 exception
   35.21 - *			     handling.
   35.22 - *		Andi Kleen,  add zeroing on error
   35.23 - *                   converted to pure assembler
   35.24 - *
   35.25 - *		This program is free software; you can redistribute it and/or
   35.26 - *		modify it under the terms of the GNU General Public License
   35.27 - *		as published by the Free Software Foundation; either version
   35.28 - *		2 of the License, or (at your option) any later version.
   35.29 - */
   35.30 -
   35.31 -#include <linux/config.h>
   35.32 -#include <asm/errno.h>
   35.33 -				
   35.34 -/*
   35.35 - * computes a partial checksum, e.g. for TCP/UDP fragments
   35.36 - */
   35.37 -
   35.38 -/*	
   35.39 -unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
   35.40 - */
   35.41 -		
   35.42 -.text
   35.43 -.align 4
   35.44 -.globl csum_partial								
   35.45 -		
   35.46 -#ifndef CONFIG_X86_USE_PPRO_CHECKSUM
   35.47 -
   35.48 -	  /*		
   35.49 -	   * Experiments with Ethernet and SLIP connections show that buff
   35.50 -	   * is aligned on either a 2-byte or 4-byte boundary.  We get at
   35.51 -	   * least a twofold speedup on 486 and Pentium if it is 4-byte aligned.
   35.52 -	   * Fortunately, it is easy to convert 2-byte alignment to 4-byte
   35.53 -	   * alignment for the unrolled loop.
   35.54 -	   */		
   35.55 -csum_partial:	
   35.56 -	pushl %esi
   35.57 -	pushl %ebx
   35.58 -	movl 20(%esp),%eax	# Function arg: unsigned int sum
   35.59 -	movl 16(%esp),%ecx	# Function arg: int len
   35.60 -	movl 12(%esp),%esi	# Function arg: unsigned char *buff
   35.61 -	testl $3, %esi		# Check alignment.
   35.62 -	jz 2f			# Jump if alignment is ok.
   35.63 -	testl $1, %esi		# Check alignment.
   35.64 -	jz 10f			# Jump if alignment is boundary of 2bytes.
   35.65 -
   35.66 -	# buf is odd
   35.67 -	dec %ecx
   35.68 -	jl 8f
   35.69 -	movzbl (%esi), %ebx
   35.70 -	adcl %ebx, %eax
   35.71 -	roll $8, %eax
   35.72 -	inc %esi
   35.73 -	testl $2, %esi
   35.74 -	jz 2f
   35.75 -10:
   35.76 -	subl $2, %ecx		# Alignment uses up two bytes.
   35.77 -	jae 1f			# Jump if we had at least two bytes.
   35.78 -	addl $2, %ecx		# ecx was < 2.  Deal with it.
   35.79 -	jmp 4f
   35.80 -1:	movw (%esi), %bx
   35.81 -	addl $2, %esi
   35.82 -	addw %bx, %ax
   35.83 -	adcl $0, %eax
   35.84 -2:
   35.85 -	movl %ecx, %edx
   35.86 -	shrl $5, %ecx
   35.87 -	jz 2f
   35.88 -	testl %esi, %esi
   35.89 -1:	movl (%esi), %ebx
   35.90 -	adcl %ebx, %eax
   35.91 -	movl 4(%esi), %ebx
   35.92 -	adcl %ebx, %eax
   35.93 -	movl 8(%esi), %ebx
   35.94 -	adcl %ebx, %eax
   35.95 -	movl 12(%esi), %ebx
   35.96 -	adcl %ebx, %eax
   35.97 -	movl 16(%esi), %ebx
   35.98 -	adcl %ebx, %eax
   35.99 -	movl 20(%esi), %ebx
  35.100 -	adcl %ebx, %eax
  35.101 -	movl 24(%esi), %ebx
  35.102 -	adcl %ebx, %eax
  35.103 -	movl 28(%esi), %ebx
  35.104 -	adcl %ebx, %eax
  35.105 -	lea 32(%esi), %esi
  35.106 -	dec %ecx
  35.107 -	jne 1b
  35.108 -	adcl $0, %eax
  35.109 -2:	movl %edx, %ecx
  35.110 -	andl $0x1c, %edx
  35.111 -	je 4f
  35.112 -	shrl $2, %edx		# This clears CF
  35.113 -3:	adcl (%esi), %eax
  35.114 -	lea 4(%esi), %esi
  35.115 -	dec %edx
  35.116 -	jne 3b
  35.117 -	adcl $0, %eax
  35.118 -4:	andl $3, %ecx
  35.119 -	jz 7f
  35.120 -	cmpl $2, %ecx
  35.121 -	jb 5f
  35.122 -	movw (%esi),%cx
  35.123 -	leal 2(%esi),%esi
  35.124 -	je 6f
  35.125 -	shll $16,%ecx
  35.126 -5:	movb (%esi),%cl
  35.127 -6:	addl %ecx,%eax
  35.128 -	adcl $0, %eax 
  35.129 -7:	
  35.130 -	testl $1, 12(%esp)
  35.131 -	jz 8f
  35.132 -	roll $8, %eax
  35.133 -8:
  35.134 -	popl %ebx
  35.135 -	popl %esi
  35.136 -	ret
  35.137 -
  35.138 -#else
  35.139 -
  35.140 -/* Version for PentiumII/PPro */
  35.141 -
  35.142 -csum_partial:
  35.143 -	pushl %esi
  35.144 -	pushl %ebx
  35.145 -	movl 20(%esp),%eax	# Function arg: unsigned int sum
  35.146 -	movl 16(%esp),%ecx	# Function arg: int len
  35.147 -	movl 12(%esp),%esi	# Function arg:	const unsigned char *buf
  35.148 -
  35.149 -	testl $3, %esi         
  35.150 -	jnz 25f                 
  35.151 -10:
  35.152 -	movl %ecx, %edx
  35.153 -	movl %ecx, %ebx
  35.154 -	andl $0x7c, %ebx
  35.155 -	shrl $7, %ecx
  35.156 -	addl %ebx,%esi
  35.157 -	shrl $2, %ebx  
  35.158 -	negl %ebx
  35.159 -	lea 45f(%ebx,%ebx,2), %ebx
  35.160 -	testl %esi, %esi
  35.161 -	jmp *%ebx
  35.162 -
  35.163 -	# Handle 2-byte-aligned regions
  35.164 -20:	addw (%esi), %ax
  35.165 -	lea 2(%esi), %esi
  35.166 -	adcl $0, %eax
  35.167 -	jmp 10b
  35.168 -25:
  35.169 -	testl $1, %esi         
  35.170 -	jz 30f                 
  35.171 -	# buf is odd
  35.172 -	dec %ecx
  35.173 -	jl 90f
  35.174 -	movzbl (%esi), %ebx
  35.175 -	addl %ebx, %eax
  35.176 -	adcl $0, %eax
  35.177 -	roll $8, %eax
  35.178 -	inc %esi
  35.179 -	testl $2, %esi
  35.180 -	jz 10b
  35.181 -
  35.182 -30:	subl $2, %ecx          
  35.183 -	ja 20b                 
  35.184 -	je 32f
  35.185 -	addl $2, %ecx
  35.186 -	jz 80f
  35.187 -	movzbl (%esi),%ebx	# csumming 1 byte, 2-aligned
  35.188 -	addl %ebx, %eax
  35.189 -	adcl $0, %eax
  35.190 -	jmp 80f
  35.191 -32:
  35.192 -	addw (%esi), %ax	# csumming 2 bytes, 2-aligned
  35.193 -	adcl $0, %eax
  35.194 -	jmp 80f
  35.195 -
  35.196 -40: 
  35.197 -	addl -128(%esi), %eax
  35.198 -	adcl -124(%esi), %eax
  35.199 -	adcl -120(%esi), %eax
  35.200 -	adcl -116(%esi), %eax   
  35.201 -	adcl -112(%esi), %eax   
  35.202 -	adcl -108(%esi), %eax
  35.203 -	adcl -104(%esi), %eax
  35.204 -	adcl -100(%esi), %eax
  35.205 -	adcl -96(%esi), %eax
  35.206 -	adcl -92(%esi), %eax
  35.207 -	adcl -88(%esi), %eax
  35.208 -	adcl -84(%esi), %eax
  35.209 -	adcl -80(%esi), %eax
  35.210 -	adcl -76(%esi), %eax
  35.211 -	adcl -72(%esi), %eax
  35.212 -	adcl -68(%esi), %eax
  35.213 -	adcl -64(%esi), %eax     
  35.214 -	adcl -60(%esi), %eax     
  35.215 -	adcl -56(%esi), %eax     
  35.216 -	adcl -52(%esi), %eax   
  35.217 -	adcl -48(%esi), %eax   
  35.218 -	adcl -44(%esi), %eax
  35.219 -	adcl -40(%esi), %eax
  35.220 -	adcl -36(%esi), %eax
  35.221 -	adcl -32(%esi), %eax
  35.222 -	adcl -28(%esi), %eax
  35.223 -	adcl -24(%esi), %eax
  35.224 -	adcl -20(%esi), %eax
  35.225 -	adcl -16(%esi), %eax
  35.226 -	adcl -12(%esi), %eax
  35.227 -	adcl -8(%esi), %eax
  35.228 -	adcl -4(%esi), %eax
  35.229 -45:
  35.230 -	lea 128(%esi), %esi
  35.231 -	adcl $0, %eax
  35.232 -	dec %ecx
  35.233 -	jge 40b
  35.234 -	movl %edx, %ecx
  35.235 -50:	andl $3, %ecx
  35.236 -	jz 80f
  35.237 -
  35.238 -	# Handle the last 1-3 bytes without jumping
  35.239 -	notl %ecx		# 1->2, 2->1, 3->0, higher bits are masked
  35.240 -	movl $0xffffff,%ebx	# by the shll and shrl instructions
  35.241 -	shll $3,%ecx
  35.242 -	shrl %cl,%ebx
  35.243 -	andl -128(%esi),%ebx	# esi is 4-aligned so should be ok
  35.244 -	addl %ebx,%eax
  35.245 -	adcl $0,%eax
  35.246 -80: 
  35.247 -	testl $1, 12(%esp)
  35.248 -	jz 90f
  35.249 -	roll $8, %eax
  35.250 -90: 
  35.251 -	popl %ebx
  35.252 -	popl %esi
  35.253 -	ret
  35.254 -				
  35.255 -#endif
  35.256 -
  35.257 -/*
  35.258 -unsigned int csum_partial_copy_generic (const char *src, char *dst,
  35.259 -				  int len, int sum, int *src_err_ptr, int *dst_err_ptr)
  35.260 - */ 
  35.261 -
  35.262 -/*
  35.263 - * Copy from ds while checksumming, otherwise like csum_partial
  35.264 - *
  35.265 - * The macros SRC and DST specify the type of access for the instruction.
  35.266 - * thus we can call a custom exception handler for all access types.
  35.267 - *
  35.268 - * FIXME: could someone double-check whether I haven't mixed up some SRC and
  35.269 - *	  DST definitions? It's damn hard to trigger all cases.  I hope I got
  35.270 - *	  them all but there's no guarantee.
  35.271 - */
  35.272 -
  35.273 -#define SRC(y...)			\
  35.274 -	9999: y;			\
  35.275 -	.section __ex_table, "a";	\
  35.276 -	.long 9999b, 6001f	;	\
  35.277 -	.previous
  35.278 -
  35.279 -#define DST(y...)			\
  35.280 -	9999: y;			\
  35.281 -	.section __ex_table, "a";	\
  35.282 -	.long 9999b, 6002f	;	\
  35.283 -	.previous
  35.284 -
  35.285 -.align 4
  35.286 -.globl csum_partial_copy_generic
  35.287 -				
  35.288 -#ifndef CONFIG_X86_USE_PPRO_CHECKSUM
  35.289 -
  35.290 -#define ARGBASE 16		
  35.291 -#define FP		12
  35.292 -		
  35.293 -csum_partial_copy_generic:
  35.294 -	subl  $4,%esp	
  35.295 -	pushl %edi
  35.296 -	pushl %esi
  35.297 -	pushl %ebx
  35.298 -	movl ARGBASE+16(%esp),%eax	# sum
  35.299 -	movl ARGBASE+12(%esp),%ecx	# len
  35.300 -	movl ARGBASE+4(%esp),%esi	# src
  35.301 -	movl ARGBASE+8(%esp),%edi	# dst
  35.302 -
  35.303 -	testl $2, %edi			# Check alignment. 
  35.304 -	jz 2f				# Jump if alignment is ok.
  35.305 -	subl $2, %ecx			# Alignment uses up two bytes.
  35.306 -	jae 1f				# Jump if we had at least two bytes.
  35.307 -	addl $2, %ecx			# ecx was < 2.  Deal with it.
  35.308 -	jmp 4f
  35.309 -SRC(1:	movw (%esi), %bx	)
  35.310 -	addl $2, %esi
  35.311 -DST(	movw %bx, (%edi)	)
  35.312 -	addl $2, %edi
  35.313 -	addw %bx, %ax	
  35.314 -	adcl $0, %eax
  35.315 -2:
  35.316 -	movl %ecx, FP(%esp)
  35.317 -	shrl $5, %ecx
  35.318 -	jz 2f
  35.319 -	testl %esi, %esi
  35.320 -SRC(1:	movl (%esi), %ebx	)
  35.321 -SRC(	movl 4(%esi), %edx	)
  35.322 -	adcl %ebx, %eax
  35.323 -DST(	movl %ebx, (%edi)	)
  35.324 -	adcl %edx, %eax
  35.325 -DST(	movl %edx, 4(%edi)	)
  35.326 -
  35.327 -SRC(	movl 8(%esi), %ebx	)
  35.328 -SRC(	movl 12(%esi), %edx	)
  35.329 -	adcl %ebx, %eax
  35.330 -DST(	movl %ebx, 8(%edi)	)
  35.331 -	adcl %edx, %eax
  35.332 -DST(	movl %edx, 12(%edi)	)
  35.333 -
  35.334 -SRC(	movl 16(%esi), %ebx 	)
  35.335 -SRC(	movl 20(%esi), %edx	)
  35.336 -	adcl %ebx, %eax
  35.337 -DST(	movl %ebx, 16(%edi)	)
  35.338 -	adcl %edx, %eax
  35.339 -DST(	movl %edx, 20(%edi)	)
  35.340 -
  35.341 -SRC(	movl 24(%esi), %ebx	)
  35.342 -SRC(	movl 28(%esi), %edx	)
  35.343 -	adcl %ebx, %eax
  35.344 -DST(	movl %ebx, 24(%edi)	)
  35.345 -	adcl %edx, %eax
  35.346 -DST(	movl %edx, 28(%edi)	)
  35.347 -
  35.348 -	lea 32(%esi), %esi
  35.349 -	lea 32(%edi), %edi
  35.350 -	dec %ecx
  35.351 -	jne 1b
  35.352 -	adcl $0, %eax
  35.353 -2:	movl FP(%esp), %edx
  35.354 -	movl %edx, %ecx
  35.355 -	andl $0x1c, %edx
  35.356 -	je 4f
  35.357 -	shrl $2, %edx			# This clears CF
  35.358 -SRC(3:	movl (%esi), %ebx	)
  35.359 -	adcl %ebx, %eax
  35.360 -DST(	movl %ebx, (%edi)	)
  35.361 -	lea 4(%esi), %esi
  35.362 -	lea 4(%edi), %edi
  35.363 -	dec %edx
  35.364 -	jne 3b
  35.365 -	adcl $0, %eax
  35.366 -4:	andl $3, %ecx
  35.367 -	jz 7f
  35.368 -	cmpl $2, %ecx
  35.369 -	jb 5f
  35.370 -SRC(	movw (%esi), %cx	)
  35.371 -	leal 2(%esi), %esi
  35.372 -DST(	movw %cx, (%edi)	)
  35.373 -	leal 2(%edi), %edi
  35.374 -	je 6f
  35.375 -	shll $16,%ecx
  35.376 -SRC(5:	movb (%esi), %cl	)
  35.377 -DST(	movb %cl, (%edi)	)
  35.378 -6:	addl %ecx, %eax
  35.379 -	adcl $0, %eax
  35.380 -7:
  35.381 -5000:
  35.382 -
  35.383 -# Exception handler:
  35.384 -.section .fixup, "ax"							
  35.385 -
  35.386 -6001:
  35.387 -	movl ARGBASE+20(%esp), %ebx	# src_err_ptr
  35.388 -	movl $-EFAULT, (%ebx)
  35.389 -
  35.390 -	# zero the complete destination - computing the rest
  35.391 -	# is too much work 
  35.392 -	movl ARGBASE+8(%esp), %edi	# dst
  35.393 -	movl ARGBASE+12(%esp), %ecx	# len
  35.394 -	xorl %eax,%eax
  35.395 -	rep ; stosb
  35.396 -
  35.397 -	jmp 5000b
  35.398 -
  35.399 -6002:
  35.400 -	movl ARGBASE+24(%esp), %ebx	# dst_err_ptr
  35.401 -	movl $-EFAULT,(%ebx)
  35.402 -	jmp 5000b
  35.403 -
  35.404 -.previous
  35.405 -
  35.406 -	popl %ebx
  35.407 -	popl %esi
  35.408 -	popl %edi
  35.409 -	popl %ecx			# equivalent to addl $4,%esp
  35.410 -	ret	
  35.411 -
  35.412 -#else
  35.413 -
  35.414 -/* Version for PentiumII/PPro */
  35.415 -
  35.416 -#define ROUND1(x) \
  35.417 -	SRC(movl x(%esi), %ebx	)	;	\
  35.418 -	addl %ebx, %eax			;	\
  35.419 -	DST(movl %ebx, x(%edi)	)	; 
  35.420 -
  35.421 -#define ROUND(x) \
  35.422 -	SRC(movl x(%esi), %ebx	)	;	\
  35.423 -	adcl %ebx, %eax			;	\
  35.424 -	DST(movl %ebx, x(%edi)	)	;
  35.425 -
  35.426 -#define ARGBASE 12
  35.427 -		
  35.428 -csum_partial_copy_generic:
  35.429 -	pushl %ebx
  35.430 -	pushl %edi
  35.431 -	pushl %esi
  35.432 -	movl ARGBASE+4(%esp),%esi	#src
  35.433 -	movl ARGBASE+8(%esp),%edi	#dst	
  35.434 -	movl ARGBASE+12(%esp),%ecx	#len
  35.435 -	movl ARGBASE+16(%esp),%eax	#sum
  35.436 -#	movl %ecx, %edx  
  35.437 -	movl %ecx, %ebx  
  35.438 -	movl %esi, %edx
  35.439 -	shrl $6, %ecx     
  35.440 -	andl $0x3c, %ebx  
  35.441 -	negl %ebx
  35.442 -	subl %ebx, %esi  
  35.443 -	subl %ebx, %edi  
  35.444 -	lea  -1(%esi),%edx
  35.445 -	andl $-32,%edx
  35.446 -	lea 3f(%ebx,%ebx), %ebx
  35.447 -	testl %esi, %esi 
  35.448 -	jmp *%ebx
  35.449 -1:	addl $64,%esi
  35.450 -	addl $64,%edi 
  35.451 -	SRC(movb -32(%edx),%bl)	; SRC(movb (%edx),%bl)
  35.452 -	ROUND1(-64) ROUND(-60) ROUND(-56) ROUND(-52)	
  35.453 -	ROUND (-48) ROUND(-44) ROUND(-40) ROUND(-36)	
  35.454 -	ROUND (-32) ROUND(-28) ROUND(-24) ROUND(-20)	
  35.455 -	ROUND (-16) ROUND(-12) ROUND(-8)  ROUND(-4)	
  35.456 -3:	adcl $0,%eax
  35.457 -	addl $64, %edx
  35.458 -	dec %ecx
  35.459 -	jge 1b
  35.460 -4:	movl ARGBASE+12(%esp),%edx	#len
  35.461 -	andl $3, %edx
  35.462 -	jz 7f
  35.463 -	cmpl $2, %edx
  35.464 -	jb 5f
  35.465 -SRC(	movw (%esi), %dx         )
  35.466 -	leal 2(%esi), %esi
  35.467 -DST(	movw %dx, (%edi)         )
  35.468 -	leal 2(%edi), %edi
  35.469 -	je 6f
  35.470 -	shll $16,%edx
  35.471 -5:
  35.472 -SRC(	movb (%esi), %dl         )
  35.473 -DST(	movb %dl, (%edi)         )
  35.474 -6:	addl %edx, %eax
  35.475 -	adcl $0, %eax
  35.476 -7:
  35.477 -.section .fixup, "ax"
  35.478 -6001:	movl	ARGBASE+20(%esp), %ebx	# src_err_ptr	
  35.479 -	movl $-EFAULT, (%ebx)
  35.480 -	# zero the complete destination (computing the rest is too much work)
  35.481 -	movl ARGBASE+8(%esp),%edi	# dst
  35.482 -	movl ARGBASE+12(%esp),%ecx	# len
  35.483 -	xorl %eax,%eax
  35.484 -	rep; stosb
  35.485 -	jmp 7b
  35.486 -6002:	movl ARGBASE+24(%esp), %ebx	# dst_err_ptr
  35.487 -	movl $-EFAULT, (%ebx)
  35.488 -	jmp  7b			
  35.489 -.previous				
  35.490 -
  35.491 -	popl %esi
  35.492 -	popl %edi
  35.493 -	popl %ebx
  35.494 -	ret
  35.495 -				
  35.496 -#undef ROUND
  35.497 -#undef ROUND1		
  35.498 -		
  35.499 -#endif
    36.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/dec_and_lock.c	Fri Mar 14 15:48:09 2003 +0000
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,40 +0,0 @@
    36.4 -/*
    36.5 - * x86 version of "atomic_dec_and_lock()" using
    36.6 - * the atomic "cmpxchg" instruction.
    36.7 - *
    36.8 - * (For CPU's lacking cmpxchg, we use the slow
    36.9 - * generic version, and this one never even gets
   36.10 - * compiled).
   36.11 - */
   36.12 -
   36.13 -#include <linux/spinlock.h>
   36.14 -#include <asm/atomic.h>
   36.15 -
   36.16 -int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
   36.17 -{
   36.18 -	int counter;
   36.19 -	int newcount;
   36.20 -
   36.21 -repeat:
   36.22 -	counter = atomic_read(atomic);
   36.23 -	newcount = counter-1;
   36.24 -
   36.25 -	if (!newcount)
   36.26 -		goto slow_path;
   36.27 -
   36.28 -	asm volatile("lock; cmpxchgl %1,%2"
   36.29 -		:"=a" (newcount)
   36.30 -		:"r" (newcount), "m" (atomic->counter), "0" (counter));
   36.31 -
   36.32 -	/* If the above failed, "eax" will have changed */
   36.33 -	if (newcount != counter)
   36.34 -		goto repeat;
   36.35 -	return 0;
   36.36 -
   36.37 -slow_path:
   36.38 -	spin_lock(lock);
   36.39 -	if (atomic_dec_and_test(atomic))
   36.40 -		return 1;
   36.41 -	spin_unlock(lock);
   36.42 -	return 0;
   36.43 -}
    37.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/getuser.S	Fri Mar 14 15:48:09 2003 +0000
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,73 +0,0 @@
    37.4 -/*
    37.5 - * __get_user functions.
    37.6 - *
    37.7 - * (C) Copyright 1998 Linus Torvalds
    37.8 - *
    37.9 - * These functions have a non-standard call interface
   37.10 - * to make them more efficient, especially as they
   37.11 - * return an error value in addition to the "real"
   37.12 - * return value.
   37.13 - */
   37.14 -
   37.15 -/*
   37.16 - * __get_user_X
   37.17 - *
   37.18 - * Inputs:	%eax contains the address
   37.19 - *
   37.20 - * Outputs:	%eax is error code (0 or -EFAULT)
   37.21 - *		%edx contains zero-extended value
   37.22 - *
   37.23 - * These functions should not modify any other registers,
   37.24 - * as they get called from within inline assembly.
   37.25 - */
   37.26 -
   37.27 -addr_limit = 12
   37.28 -
   37.29 -.text
   37.30 -.align 4
   37.31 -.globl __get_user_1
   37.32 -__get_user_1:
   37.33 -	movl %esp,%edx
   37.34 -	andl $0xffffe000,%edx
   37.35 -	cmpl addr_limit(%edx),%eax
   37.36 -	jae bad_get_user
   37.37 -1:	movzbl (%eax),%edx
   37.38 -	xorl %eax,%eax
   37.39 -	ret
   37.40 -
   37.41 -.align 4
   37.42 -.globl __get_user_2
   37.43 -__get_user_2:
   37.44 -	addl $1,%eax
   37.45 -	movl %esp,%edx
   37.46 -	jc bad_get_user
   37.47 -	andl $0xffffe000,%edx
   37.48 -	cmpl addr_limit(%edx),%eax
   37.49 -	jae bad_get_user
   37.50 -2:	movzwl -1(%eax),%edx
   37.51 -	xorl %eax,%eax
   37.52 -	ret
   37.53 -
   37.54 -.align 4
   37.55 -.globl __get_user_4
   37.56 -__get_user_4:
   37.57 -	addl $3,%eax
   37.58 -	movl %esp,%edx
   37.59 -	jc bad_get_user
   37.60 -	andl $0xffffe000,%edx
   37.61 -	cmpl addr_limit(%edx),%eax
   37.62 -	jae bad_get_user
   37.63 -3:	movl -3(%eax),%edx
   37.64 -	xorl %eax,%eax
   37.65 -	ret
   37.66 -
   37.67 -bad_get_user:
   37.68 -	xorl %edx,%edx
   37.69 -	movl $-14,%eax
   37.70 -	ret
   37.71 -
   37.72 -.section __ex_table,"a"
   37.73 -	.long 1b,bad_get_user
   37.74 -	.long 2b,bad_get_user
   37.75 -	.long 3b,bad_get_user
   37.76 -.previous
    38.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/iodebug.c	Fri Mar 14 15:48:09 2003 +0000
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,19 +0,0 @@
    38.4 -#include <asm/io.h>
    38.5 -
    38.6 -void * __io_virt_debug(unsigned long x, const char *file, int line)
    38.7 -{
    38.8 -	if (x < PAGE_OFFSET) {
    38.9 -		printk("io mapaddr 0x%05lx not valid at %s:%d!\n", x, file, line);
   38.10 -		return __va(x);
   38.11 -	}
   38.12 -	return (void *)x;
   38.13 -}
   38.14 -
   38.15 -unsigned long __io_phys_debug(unsigned long x, const char *file, int line)
   38.16 -{
   38.17 -	if (x < PAGE_OFFSET) {
   38.18 -		printk("io mapaddr 0x%05lx not valid at %s:%d!\n", x, file, line);
   38.19 -		return x;
   38.20 -	}
   38.21 -	return __pa(x);
   38.22 -}
    39.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/memcpy.c	Fri Mar 14 15:48:09 2003 +0000
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,19 +0,0 @@
    39.4 -#include <linux/config.h>
    39.5 -#include <linux/string.h>
    39.6 -
    39.7 -#undef memcpy
    39.8 -#undef memset
    39.9 -
   39.10 -void * memcpy(void * to, const void * from, size_t n)
   39.11 -{
   39.12 -#ifdef CONFIG_X86_USE_3DNOW
   39.13 -	return __memcpy3d(to, from, n);
   39.14 -#else
   39.15 -	return __memcpy(to, from, n);
   39.16 -#endif
   39.17 -}
   39.18 -
   39.19 -void * memset(void * s, int c, size_t count)
   39.20 -{
   39.21 -	return __memset(s, c, count);
   39.22 -}
    40.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/mmx.c	Fri Mar 14 15:48:09 2003 +0000
    40.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.3 @@ -1,399 +0,0 @@
    40.4 -#include <linux/config.h>
    40.5 -#include <linux/types.h>
    40.6 -#include <linux/string.h>
    40.7 -#include <linux/sched.h>
    40.8 -
    40.9 -#include <asm/i387.h>
   40.10 -#include <asm/hardirq.h> 
   40.11 -
   40.12 -
   40.13 -/*
   40.14 - *	MMX 3DNow! library helper functions
   40.15 - *
   40.16 - *	To do:
   40.17 - *	We can use MMX just for prefetch in IRQ's. This may be a win. 
   40.18 - *		(reported so on K6-III)
   40.19 - *	We should use a better code neutral filler for the short jump
   40.20 - *		leal ebx. [ebx] is apparently best for K6-2, but Cyrix ??
   40.21 - *	We also want to clobber the filler register so we dont get any
   40.22 - *		register forwarding stalls on the filler. 
   40.23 - *
   40.24 - *	Add *user handling. Checksums are not a win with MMX on any CPU
   40.25 - *	tested so far for any MMX solution figured.
   40.26 - *
   40.27 - *	22/09/2000 - Arjan van de Ven 
   40.28 - *		Improved for non-egineering-sample Athlons 
   40.29 - *
   40.30 - */
   40.31 - 
   40.32 -void *_mmx_memcpy(void *to, const void *from, size_t len)
   40.33 -{
   40.34 -	void *p;
   40.35 -	int i;
   40.36 -
   40.37 -	if (in_interrupt())
   40.38 -		return __memcpy(to, from, len);
   40.39 -
   40.40 -	p = to;
   40.41 -	i = len >> 6; /* len/64 */
   40.42 -
   40.43 -	kernel_fpu_begin();
   40.44 -
   40.45 -	__asm__ __volatile__ (
   40.46 -		"1: prefetch (%0)\n"		/* This set is 28 bytes */
   40.47 -		"   prefetch 64(%0)\n"
   40.48 -		"   prefetch 128(%0)\n"
   40.49 -		"   prefetch 192(%0)\n"
   40.50 -		"   prefetch 256(%0)\n"
   40.51 -		"2:  \n"
   40.52 -		".section .fixup, \"ax\"\n"
   40.53 -		"3: movw $0x1AEB, 1b\n"	/* jmp on 26 bytes */
   40.54 -		"   jmp 2b\n"
   40.55 -		".previous\n"
   40.56 -		".section __ex_table,\"a\"\n"
   40.57 -		"	.align 4\n"
   40.58 -		"	.long 1b, 3b\n"
   40.59 -		".previous"
   40.60 -		: : "r" (from) );
   40.61 -		
   40.62 -	
   40.63 -	for(; i>5; i--)
   40.64 -	{
   40.65 -		__asm__ __volatile__ (
   40.66 -		"1:  prefetch 320(%0)\n"
   40.67 -		"2:  movq (%0), %%mm0\n"
   40.68 -		"  movq 8(%0), %%mm1\n"
   40.69 -		"  movq 16(%0), %%mm2\n"
   40.70 -		"  movq 24(%0), %%mm3\n"
   40.71 -		"  movq %%mm0, (%1)\n"
   40.72 -		"  movq %%mm1, 8(%1)\n"
   40.73 -		"  movq %%mm2, 16(%1)\n"
   40.74 -		"  movq %%mm3, 24(%1)\n"
   40.75 -		"  movq 32(%0), %%mm0\n"
   40.76 -		"  movq 40(%0), %%mm1\n"
   40.77 -		"  movq 48(%0), %%mm2\n"
   40.78 -		"  movq 56(%0), %%mm3\n"
   40.79 -		"  movq %%mm0, 32(%1)\n"
   40.80 -		"  movq %%mm1, 40(%1)\n"
   40.81 -		"  movq %%mm2, 48(%1)\n"
   40.82 -		"  movq %%mm3, 56(%1)\n"
   40.83 -		".section .fixup, \"ax\"\n"
   40.84 -		"3: movw $0x05EB, 1b\n"	/* jmp on 5 bytes */
   40.85 -		"   jmp 2b\n"
   40.86 -		".previous\n"
   40.87 -		".section __ex_table,\"a\"\n"
   40.88 -		"	.align 4\n"
   40.89 -		"	.long 1b, 3b\n"
   40.90 -		".previous"
   40.91 -		: : "r" (from), "r" (to) : "memory");
   40.92 -		from+=64;
   40.93 -		to+=64;
   40.94 -	}
   40.95 -
   40.96 -	for(; i>0; i--)
   40.97 -	{
   40.98 -		__asm__ __volatile__ (
   40.99 -		"  movq (%0), %%mm0\n"
  40.100 -		"  movq 8(%0), %%mm1\n"
  40.101 -		"  movq 16(%0), %%mm2\n"
  40.102 -		"  movq 24(%0), %%mm3\n"
  40.103 -		"  movq %%mm0, (%1)\n"
  40.104 -		"  movq %%mm1, 8(%1)\n"
  40.105 -		"  movq %%mm2, 16(%1)\n"
  40.106 -		"  movq %%mm3, 24(%1)\n"
  40.107 -		"  movq 32(%0), %%mm0\n"
  40.108 -		"  movq 40(%0), %%mm1\n"
  40.109 -		"  movq 48(%0), %%mm2\n"
  40.110 -		"  movq 56(%0), %%mm3\n"
  40.111 -		"  movq %%mm0, 32(%1)\n"
  40.112 -		"  movq %%mm1, 40(%1)\n"
  40.113 -		"  movq %%mm2, 48(%1)\n"
  40.114 -		"  movq %%mm3, 56(%1)\n"
  40.115 -		: : "r" (from), "r" (to) : "memory");
  40.116 -		from+=64;
  40.117 -		to+=64;
  40.118 -	}
  40.119 -	/*
  40.120 -	 *	Now do the tail of the block
  40.121 -	 */
  40.122 -	__memcpy(to, from, len&63);
  40.123 -	kernel_fpu_end();
  40.124 -	return p;
  40.125 -}
  40.126 -
  40.127 -#ifdef CONFIG_MK7
  40.128 -
  40.129 -/*
  40.130 - *	The K7 has streaming cache bypass load/store. The Cyrix III, K6 and
  40.131 - *	other MMX using processors do not.
  40.132 - */
  40.133 -
  40.134 -static void fast_clear_page(void *page)
  40.135 -{
  40.136 -	int i;
  40.137 -
  40.138 -	kernel_fpu_begin();
  40.139 -	
  40.140 -	__asm__ __volatile__ (
  40.141 -		"  pxor %%mm0, %%mm0\n" : :
  40.142 -	);
  40.143 -
  40.144 -	for(i=0;i<4096/64;i++)
  40.145 -	{
  40.146 -		__asm__ __volatile__ (
  40.147 -		"  movntq %%mm0, (%0)\n"
  40.148 -		"  movntq %%mm0, 8(%0)\n"
  40.149 -		"  movntq %%mm0, 16(%0)\n"
  40.150 -		"  movntq %%mm0, 24(%0)\n"
  40.151 -		"  movntq %%mm0, 32(%0)\n"
  40.152 -		"  movntq %%mm0, 40(%0)\n"
  40.153 -		"  movntq %%mm0, 48(%0)\n"
  40.154 -		"  movntq %%mm0, 56(%0)\n"
  40.155 -		: : "r" (page) : "memory");
  40.156 -		page+=64;
  40.157 -	}
  40.158 -	/* since movntq is weakly-ordered, a "sfence" is needed to become
  40.159 -	 * ordered again.
  40.160 -	 */
  40.161 -	__asm__ __volatile__ (
  40.162 -		"  sfence \n" : :
  40.163 -	);
  40.164 -	kernel_fpu_end();
  40.165 -}
  40.166 -
  40.167 -static void fast_copy_page(void *to, void *from)
  40.168 -{
  40.169 -	int i;
  40.170 -
  40.171 -	kernel_fpu_begin();
  40.172 -
  40.173 -	/* maybe the prefetch stuff can go before the expensive fnsave...
  40.174 -	 * but that is for later. -AV
  40.175 -	 */
  40.176 -	__asm__ __volatile__ (
  40.177 -		"1: prefetch (%0)\n"
  40.178 -		"   prefetch 64(%0)\n"
  40.179 -		"   prefetch 128(%0)\n"
  40.180 -		"   prefetch 192(%0)\n"
  40.181 -		"   prefetch 256(%0)\n"
  40.182 -		"2:  \n"
  40.183 -		".section .fixup, \"ax\"\n"
  40.184 -		"3: movw $0x1AEB, 1b\n"	/* jmp on 26 bytes */
  40.185 -		"   jmp 2b\n"
  40.186 -		".previous\n"
  40.187 -		".section __ex_table,\"a\"\n"
  40.188 -		"	.align 4\n"
  40.189 -		"	.long 1b, 3b\n"
  40.190 -		".previous"
  40.191 -		: : "r" (from) );
  40.192 -
  40.193 -	for(i=0; i<(4096-320)/64; i++)
  40.194 -	{
  40.195 -		__asm__ __volatile__ (
  40.196 -		"1: prefetch 320(%0)\n"
  40.197 -		"2: movq (%0), %%mm0\n"
  40.198 -		"   movntq %%mm0, (%1)\n"
  40.199 -		"   movq 8(%0), %%mm1\n"
  40.200 -		"   movntq %%mm1, 8(%1)\n"
  40.201 -		"   movq 16(%0), %%mm2\n"
  40.202 -		"   movntq %%mm2, 16(%1)\n"
  40.203 -		"   movq 24(%0), %%mm3\n"
  40.204 -		"   movntq %%mm3, 24(%1)\n"
  40.205 -		"   movq 32(%0), %%mm4\n"
  40.206 -		"   movntq %%mm4, 32(%1)\n"
  40.207 -		"   movq 40(%0), %%mm5\n"
  40.208 -		"   movntq %%mm5, 40(%1)\n"
  40.209 -		"   movq 48(%0), %%mm6\n"
  40.210 -		"   movntq %%mm6, 48(%1)\n"
  40.211 -		"   movq 56(%0), %%mm7\n"
  40.212 -		"   movntq %%mm7, 56(%1)\n"
  40.213 -		".section .fixup, \"ax\"\n"
  40.214 -		"3: movw $0x05EB, 1b\n"	/* jmp on 5 bytes */
  40.215 -		"   jmp 2b\n"
  40.216 -		".previous\n"
  40.217 -		".section __ex_table,\"a\"\n"
  40.218 -		"	.align 4\n"
  40.219 -		"	.long 1b, 3b\n"
  40.220 -		".previous"
  40.221 -		: : "r" (from), "r" (to) : "memory");
  40.222 -		from+=64;
  40.223 -		to+=64;
  40.224 -	}
  40.225 -	for(i=(4096-320)/64; i<4096/64; i++)
  40.226 -	{
  40.227 -		__asm__ __volatile__ (
  40.228 -		"2: movq (%0), %%mm0\n"
  40.229 -		"   movntq %%mm0, (%1)\n"
  40.230 -		"   movq 8(%0), %%mm1\n"
  40.231 -		"   movntq %%mm1, 8(%1)\n"
  40.232 -		"   movq 16(%0), %%mm2\n"
  40.233 -		"   movntq %%mm2, 16(%1)\n"
  40.234 -		"   movq 24(%0), %%mm3\n"
  40.235 -		"   movntq %%mm3, 24(%1)\n"
  40.236 -		"   movq 32(%0), %%mm4\n"
  40.237 -		"   movntq %%mm4, 32(%1)\n"
  40.238 -		"   movq 40(%0), %%mm5\n"
  40.239 -		"   movntq %%mm5, 40(%1)\n"
  40.240 -		"   movq 48(%0), %%mm6\n"
  40.241 -		"   movntq %%mm6, 48(%1)\n"
  40.242 -		"   movq 56(%0), %%mm7\n"
  40.243 -		"   movntq %%mm7, 56(%1)\n"
  40.244 -		: : "r" (from), "r" (to) : "memory");
  40.245 -		from+=64;
  40.246 -		to+=64;
  40.247 -	}
  40.248 -	/* since movntq is weakly-ordered, a "sfence" is needed to become
  40.249 -	 * ordered again.
  40.250 -	 */
  40.251 -	__asm__ __volatile__ (
  40.252 -		"  sfence \n" : :
  40.253 -	);
  40.254 -	kernel_fpu_end();
  40.255 -}
  40.256 -
  40.257 -#else
  40.258 -
  40.259 -/*
  40.260 - *	Generic MMX implementation without K7 specific streaming
  40.261 - */
  40.262 - 
  40.263 -static void fast_clear_page(void *page)
  40.264 -{
  40.265 -	int i;
  40.266 -	
  40.267 -	kernel_fpu_begin();
  40.268 -	
  40.269 -	__asm__ __volatile__ (
  40.270 -		"  pxor %%mm0, %%mm0\n" : :
  40.271 -	);
  40.272 -
  40.273 -	for(i=0;i<4096/128;i++)
  40.274 -	{
  40.275 -		__asm__ __volatile__ (
  40.276 -		"  movq %%mm0, (%0)\n"
  40.277 -		"  movq %%mm0, 8(%0)\n"
  40.278 -		"  movq %%mm0, 16(%0)\n"
  40.279 -		"  movq %%mm0, 24(%0)\n"
  40.280 -		"  movq %%mm0, 32(%0)\n"
  40.281 -		"  movq %%mm0, 40(%0)\n"
  40.282 -		"  movq %%mm0, 48(%0)\n"
  40.283 -		"  movq %%mm0, 56(%0)\n"
  40.284 -		"  movq %%mm0, 64(%0)\n"
  40.285 -		"  movq %%mm0, 72(%0)\n"
  40.286 -		"  movq %%mm0, 80(%0)\n"
  40.287 -		"  movq %%mm0, 88(%0)\n"
  40.288 -		"  movq %%mm0, 96(%0)\n"
  40.289 -		"  movq %%mm0, 104(%0)\n"
  40.290 -		"  movq %%mm0, 112(%0)\n"
  40.291 -		"  movq %%mm0, 120(%0)\n"
  40.292 -		: : "r" (page) : "memory");
  40.293 -		page+=128;
  40.294 -	}
  40.295 -
  40.296 -	kernel_fpu_end();
  40.297 -}
  40.298 -
  40.299 -static void fast_copy_page(void *to, void *from)
  40.300 -{
  40.301 -	int i;
  40.302 -	
  40.303 -	
  40.304 -	kernel_fpu_begin();
  40.305 -
  40.306 -	__asm__ __volatile__ (
  40.307 -		"1: prefetch (%0)\n"
  40.308 -		"   prefetch 64(%0)\n"
  40.309 -		"   prefetch 128(%0)\n"
  40.310 -		"   prefetch 192(%0)\n"
  40.311 -		"   prefetch 256(%0)\n"
  40.312 -		"2:  \n"
  40.313 -		".section .fixup, \"ax\"\n"
  40.314 -		"3: movw $0x1AEB, 1b\n"	/* jmp on 26 bytes */
  40.315 -		"   jmp 2b\n"
  40.316 -		".previous\n"
  40.317 -		".section __ex_table,\"a\"\n"
  40.318 -		"	.align 4\n"
  40.319 -		"	.long 1b, 3b\n"
  40.320 -		".previous"
  40.321 -		: : "r" (from) );
  40.322 -
  40.323 -	for(i=0; i<4096/64; i++)
  40.324 -	{
  40.325 -		__asm__ __volatile__ (
  40.326 -		"1: prefetch 320(%0)\n"
  40.327 -		"2: movq (%0), %%mm0\n"
  40.328 -		"   movq 8(%0), %%mm1\n"
  40.329 -		"   movq 16(%0), %%mm2\n"
  40.330 -		"   movq 24(%0), %%mm3\n"
  40.331 -		"   movq %%mm0, (%1)\n"
  40.332 -		"   movq %%mm1, 8(%1)\n"
  40.333 -		"   movq %%mm2, 16(%1)\n"
  40.334 -		"   movq %%mm3, 24(%1)\n"
  40.335 -		"   movq 32(%0), %%mm0\n"
  40.336 -		"   movq 40(%0), %%mm1\n"
  40.337 -		"   movq 48(%0), %%mm2\n"
  40.338 -		"   movq 56(%0), %%mm3\n"
  40.339 -		"   movq %%mm0, 32(%1)\n"
  40.340 -		"   movq %%mm1, 40(%1)\n"
  40.341 -		"   movq %%mm2, 48(%1)\n"
  40.342 -		"   movq %%mm3, 56(%1)\n"
  40.343 -		".section .fixup, \"ax\"\n"
  40.344 -		"3: movw $0x05EB, 1b\n"	/* jmp on 5 bytes */
  40.345 -		"   jmp 2b\n"
  40.346 -		".previous\n"
  40.347 -		".section __ex_table,\"a\"\n"
  40.348 -		"	.align 4\n"
  40.349 -		"	.long 1b, 3b\n"
  40.350 -		".previous"
  40.351 -		: : "r" (from), "r" (to) : "memory");
  40.352 -		from+=64;
  40.353 -		to+=64;
  40.354 -	}
  40.355 -	kernel_fpu_end();
  40.356 -}
  40.357 -
  40.358 -
  40.359 -#endif
  40.360 -
  40.361 -/*
  40.362 - *	Favour MMX for page clear and copy. 
  40.363 - */
  40.364 -
  40.365 -static void slow_zero_page(void * page)
  40.366 -{
  40.367 -	int d0, d1;
  40.368 -	__asm__ __volatile__( \
  40.369 -		"cld\n\t" \
  40.370 -		"rep ; stosl" \
  40.371 -		: "=&c" (d0), "=&D" (d1)
  40.372 -		:"a" (0),"1" (page),"0" (1024)
  40.373 -		:"memory");
  40.374 -}
  40.375 - 
  40.376 -void mmx_clear_page(void * page)
  40.377 -{
  40.378 -	if(in_interrupt())
  40.379 -		slow_zero_page(page);
  40.380 -	else
  40.381 -		fast_clear_page(page);
  40.382 -}
  40.383 -
  40.384 -static void slow_copy_page(void *to, void *from)
  40.385 -{
  40.386 -	int d0, d1, d2;
  40.387 -	__asm__ __volatile__( \
  40.388 -		"cld\n\t" \
  40.389 -		"rep ; movsl" \
  40.390 -		: "=&c" (d0), "=&D" (d1), "=&S" (d2) \
  40.391 -		: "0" (1024),"1" ((long) to),"2" ((long) from) \
  40.392 -		: "memory");
  40.393 -}
  40.394 -  
  40.395 -
  40.396 -void mmx_copy_page(void *to, void *from)
  40.397 -{
  40.398 -	if(in_interrupt())
  40.399 -		slow_copy_page(to, from);
  40.400 -	else
  40.401 -		fast_copy_page(to, from);
  40.402 -}
    41.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/old-checksum.c	Fri Mar 14 15:48:09 2003 +0000
    41.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.3 @@ -1,19 +0,0 @@
    41.4 -/*
    41.5 - * FIXME: old compatibility stuff, will be removed soon.
    41.6 - */
    41.7 -
    41.8 -#include <net/checksum.h>
    41.9 -
   41.10 -unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum)
   41.11 -{
   41.12 -	int src_err=0, dst_err=0;
   41.13 -
   41.14 -	sum = csum_partial_copy_generic ( src, dst, len, sum, &src_err, &dst_err);
   41.15 -
   41.16 -	if (src_err || dst_err)
   41.17 -		printk("old csum_partial_copy_fromuser(), tell mingo to convert me.\n");
   41.18 -
   41.19 -	return sum;
   41.20 -}
   41.21 -
   41.22 -
    42.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/strstr.c	Fri Mar 14 15:48:09 2003 +0000
    42.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.3 @@ -1,31 +0,0 @@
    42.4 -#include <linux/string.h>
    42.5 -
    42.6 -char * strstr(const char * cs,const char * ct)
    42.7 -{
    42.8 -int	d0, d1;
    42.9 -register char * __res;
   42.10 -__asm__ __volatile__(
   42.11 -	"movl %6,%%edi\n\t"
   42.12 -	"repne\n\t"
   42.13 -	"scasb\n\t"
   42.14 -	"notl %%ecx\n\t"
   42.15 -	"decl %%ecx\n\t"	/* NOTE! This also sets Z if searchstring='' */
   42.16 -	"movl %%ecx,%%edx\n"
   42.17 -	"1:\tmovl %6,%%edi\n\t"
   42.18 -	"movl %%esi,%%eax\n\t"
   42.19 -	"movl %%edx,%%ecx\n\t"
   42.20 -	"repe\n\t"
   42.21 -	"cmpsb\n\t"
   42.22 -	"je 2f\n\t"		/* also works for empty string, see above */
   42.23 -	"xchgl %%eax,%%esi\n\t"
   42.24 -	"incl %%esi\n\t"
   42.25 -	"cmpb $0,-1(%%eax)\n\t"
   42.26 -	"jne 1b\n\t"
   42.27 -	"xorl %%eax,%%eax\n\t"
   42.28 -	"2:"
   42.29 -	:"=a" (__res), "=&c" (d0), "=&S" (d1)
   42.30 -	:"0" (0), "1" (0xffffffff), "2" (cs), "g" (ct)
   42.31 -	:"dx", "di");
   42.32 -return __res;
   42.33 -}
   42.34 -
    43.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/usercopy.c	Fri Mar 14 15:48:09 2003 +0000
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,190 +0,0 @@
    43.4 -/* 
    43.5 - * User address space access functions.
    43.6 - * The non inlined parts of asm-i386/uaccess.h are here.
    43.7 - *
    43.8 - * Copyright 1997 Andi Kleen <ak@muc.de>
    43.9 - * Copyright 1997 Linus Torvalds
   43.10 - */
   43.11 -#include <linux/config.h>
   43.12 -#include <asm/uaccess.h>
   43.13 -#include <asm/mmx.h>
   43.14 -
   43.15 -#ifdef CONFIG_X86_USE_3DNOW_AND_WORKS
   43.16 -
   43.17 -unsigned long
   43.18 -__generic_copy_to_user(void *to, const void *from, unsigned long n)
   43.19 -{
   43.20 -	if (access_ok(VERIFY_WRITE, to, n))
   43.21 -	{
   43.22 -		if(n<512)
   43.23 -			__copy_user(to,from,n);
   43.24 -		else
   43.25 -			mmx_copy_user(to,from,n);
   43.26 -	}
   43.27 -	return n;
   43.28 -}
   43.29 -
   43.30 -unsigned long
   43.31 -__generic_copy_from_user(void *to, const void *from, unsigned long n)
   43.32 -{
   43.33 -	if (access_ok(VERIFY_READ, from, n))
   43.34 -	{
   43.35 -		if(n<512)
   43.36 -			__copy_user_zeroing(to,from,n);
   43.37 -		else
   43.38 -			mmx_copy_user_zeroing(to, from, n);
   43.39 -	}
   43.40 -	else
   43.41 -		memset(to, 0, n);
   43.42 -	return n;
   43.43 -}
   43.44 -
   43.45 -#else
   43.46 -
   43.47 -unsigned long
   43.48 -__generic_copy_to_user(void *to, const void *from, unsigned long n)
   43.49 -{
   43.50 -	prefetch(from);
   43.51 -	if (access_ok(VERIFY_WRITE, to, n))
   43.52 -		__copy_user(to,from,n);
   43.53 -	return n;
   43.54 -}
   43.55 -
   43.56 -unsigned long
   43.57 -__generic_copy_from_user(void *to, const void *from, unsigned long n)
   43.58 -{
   43.59 -	prefetchw(to);
   43.60 -	if (access_ok(VERIFY_READ, from, n))
   43.61 -		__copy_user_zeroing(to,from,n);
   43.62 -	else
   43.63 -		memset(to, 0, n);
   43.64 -	return n;
   43.65 -}
   43.66 -
   43.67 -#endif
   43.68 -
   43.69 -/*
   43.70 - * Copy a null terminated string from userspace.
   43.71 - */
   43.72 -
   43.73 -#define __do_strncpy_from_user(dst,src,count,res)			   \
   43.74 -do {									   \
   43.75 -	int __d0, __d1, __d2;						   \
   43.76 -	__asm__ __volatile__(						   \
   43.77 -		"	testl %1,%1\n"					   \
   43.78 -		"	jz 2f\n"					   \
   43.79 -		"0:	lodsb\n"					   \
   43.80 -		"	stosb\n"					   \
   43.81 -		"	testb %%al,%%al\n"				   \
   43.82 -		"	jz 1f\n"					   \
   43.83 -		"	decl %1\n"					   \
   43.84 -		"	jnz 0b\n"					   \
   43.85 -		"1:	subl %1,%0\n"					   \
   43.86 -		"2:\n"							   \
   43.87 -		".section .fixup,\"ax\"\n"				   \
   43.88 -		"3:	movl %5,%0\n"					   \
   43.89 -		"	jmp 2b\n"					   \
   43.90 -		".previous\n"						   \
   43.91 -		".section __ex_table,\"a\"\n"				   \
   43.92 -		"	.align 4\n"					   \
   43.93 -		"	.long 0b,3b\n"					   \
   43.94 -		".previous"						   \
   43.95 -		: "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1),	   \
   43.96 -		  "=&D" (__d2)						   \
   43.97 -		: "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \
   43.98 -		: "memory");						   \
   43.99 -} while (0)
  43.100 -
  43.101 -long
  43.102 -__strncpy_from_user(char *dst, const char *src, long count)
  43.103 -{
  43.104 -	long res;
  43.105 -	__do_strncpy_from_user(dst, src, count, res);
  43.106 -	return res;
  43.107 -}
  43.108 -
  43.109 -long
  43.110 -strncpy_from_user(char *dst, const char *src, long count)
  43.111 -{
  43.112 -	long res = -EFAULT;
  43.113 -	if (access_ok(VERIFY_READ, src, 1))
  43.114 -		__do_strncpy_from_user(dst, src, count, res);
  43.115 -	return res;
  43.116 -}
  43.117 -
  43.118 -
  43.119 -/*
  43.120 - * Zero Userspace
  43.121 - */
  43.122 -
  43.123 -#define __do_clear_user(addr,size)					\
  43.124 -do {									\
  43.125 -	int __d0;							\
  43.126 -  	__asm__ __volatile__(						\
  43.127 -		"0:	rep; stosl\n"					\
  43.128 -		"	movl %2,%0\n"					\
  43.129 -		"1:	rep; stosb\n"					\
  43.130 -		"2:\n"							\
  43.131 -		".section .fixup,\"ax\"\n"				\
  43.132 -		"3:	lea 0(%2,%0,4),%0\n"				\
  43.133 -		"	jmp 2b\n"					\
  43.134 -		".previous\n"						\
  43.135 -		".section __ex_table,\"a\"\n"				\
  43.136 -		"	.align 4\n"					\
  43.137 -		"	.long 0b,3b\n"					\
  43.138 -		"	.long 1b,2b\n"					\
  43.139 -		".previous"						\
  43.140 -		: "=&c"(size), "=&D" (__d0)				\
  43.141 -		: "r"(size & 3), "0"(size / 4), "1"(addr), "a"(0));	\
  43.142 -} while (0)
  43.143 -
  43.144 -unsigned long
  43.145 -clear_user(void *to, unsigned long n)
  43.146 -{
  43.147 -	if (access_ok(VERIFY_WRITE, to, n))
  43.148 -		__do_clear_user(to, n);
  43.149 -	return n;
  43.150 -}
  43.151 -
  43.152 -unsigned long
  43.153 -__clear_user(void *to, unsigned long n)
  43.154 -{
  43.155 -	__do_clear_user(to, n);
  43.156 -	return n;
  43.157 -}
  43.158 -
  43.159 -/*
  43.160 - * Return the size of a string (including the ending 0)
  43.161 - *
  43.162 - * Return 0 on exception, a value greater than N if too long
  43.163 - */
  43.164 -
  43.165 -long strnlen_user(const char *s, long n)
  43.166 -{
  43.167 -	unsigned long mask = -__addr_ok(s);
  43.168 -	unsigned long res, tmp;
  43.169 -
  43.170 -	__asm__ __volatile__(
  43.171 -		"	testl %0, %0\n"
  43.172 -		"	jz 3f\n"
  43.173 -		"	andl %0,%%ecx\n"
  43.174 -		"0:	repne; scasb\n"
  43.175 -		"	setne %%al\n"
  43.176 -		"	subl %%ecx,%0\n"
  43.177 -		"	addl %0,%%eax\n"
  43.178 -		"1:\n"
  43.179 -		".section .fixup,\"ax\"\n"
  43.180 -		"2:	xorl %%eax,%%eax\n"
  43.181 -		"	jmp 1b\n"
  43.182 -		"3:	movb $1,%%al\n"
  43.183 -		"	jmp 1b\n"
  43.184 -		".previous\n"
  43.185 -		".section __ex_table,\"a\"\n"
  43.186 -		"	.align 4\n"
  43.187 -		"	.long 0b,2b\n"
  43.188 -		".previous"
  43.189 -		:"=r" (n), "=D" (s), "=a" (res), "=c" (tmp)
  43.190 -		:"0" (n), "1" (s), "2" (0), "3" (mask)
  43.191 -		:"cc");
  43.192 -	return res & mask;
  43.193 -}
    44.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/extable.c	Fri Mar 14 15:48:09 2003 +0000
    44.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.3 @@ -1,62 +0,0 @@
    44.4 -/*
    44.5 - * linux/arch/i386/mm/extable.c
    44.6 - */
    44.7 -
    44.8 -#include <linux/config.h>
    44.9 -#include <linux/module.h>
   44.10 -#include <linux/spinlock.h>
   44.11 -#include <asm/uaccess.h>
   44.12 -
   44.13 -extern const struct exception_table_entry __start___ex_table[];
   44.14 -extern const struct exception_table_entry __stop___ex_table[];
   44.15 -
   44.16 -static inline unsigned long
   44.17 -search_one_table(const struct exception_table_entry *first,
   44.18 -		 const struct exception_table_entry *last,
   44.19 -		 unsigned long value)
   44.20 -{
   44.21 -        while (first <= last) {
   44.22 -		const struct exception_table_entry *mid;
   44.23 -		long diff;
   44.24 -
   44.25 -		mid = (last - first) / 2 + first;
   44.26 -		diff = mid->insn - value;
   44.27 -                if (diff == 0)
   44.28 -                        return mid->fixup;
   44.29 -                else if (diff < 0)
   44.30 -                        first = mid+1;
   44.31 -                else
   44.32 -                        last = mid-1;
   44.33 -        }
   44.34 -        return 0;
   44.35 -}
   44.36 -
   44.37 -extern spinlock_t modlist_lock;
   44.38 -
   44.39 -unsigned long
   44.40 -search_exception_table(unsigned long addr)
   44.41 -{
   44.42 -	unsigned long ret = 0;
   44.43 -	
   44.44 -#ifndef CONFIG_MODULES
   44.45 -	/* There is only the kernel to search.  */
   44.46 -	ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
   44.47 -	return ret;
   44.48 -#else
   44.49 -	unsigned long flags;
   44.50 -	/* The kernel is the last "module" -- no need to treat it special.  */
   44.51 -	struct module *mp;
   44.52 -
   44.53 -	spin_lock_irqsave(&modlist_lock, flags);
   44.54 -	for (mp = module_list; mp != NULL; mp = mp->next) {
   44.55 -		if (mp->ex_table_start == NULL || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING)))
   44.56 -			continue;
   44.57 -		ret = search_one_table(mp->ex_table_start,
   44.58 -				       mp->ex_table_end - 1, addr);
   44.59 -		if (ret)
   44.60 -			break;
   44.61 -	}
   44.62 -	spin_unlock_irqrestore(&modlist_lock, flags);
   44.63 -	return ret;
   44.64 -#endif
   44.65 -}
    45.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/pageattr.c	Fri Mar 14 15:48:09 2003 +0000
    45.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.3 @@ -1,175 +0,0 @@
    45.4 -/* 
    45.5 - * Copyright 2002 Andi Kleen, SuSE Labs. 
    45.6 - * Thanks to Ben LaHaise for precious feedback.
    45.7 - */ 
    45.8 -
    45.9 -#include <linux/config.h>
   45.10 -#include <linux/mm.h>
   45.11 -#include <linux/sched.h>
   45.12 -#include <linux/highmem.h>
   45.13 -#include <linux/module.h>
   45.14 -#include <asm/uaccess.h>
   45.15 -#include <asm/processor.h>
   45.16 -
   45.17 -/* Should move most of this stuff into the appropiate includes */
   45.18 -#define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1))
   45.19 -#define LARGE_PAGE_SIZE (1UL << PMD_SHIFT)
   45.20 -
   45.21 -static inline pte_t *lookup_address(unsigned long address) 
   45.22 -{ 
   45.23 -	pmd_t *pmd;	
   45.24 -	pgd_t *pgd = pgd_offset(&init_mm, address); 
   45.25 -
   45.26 -	if (pgd_none(*pgd))
   45.27 -		return NULL; 
   45.28 -	if (pgd_val(*pgd) & _PAGE_PSE)
   45.29 -		return (pte_t *)pgd; 
   45.30 -	pmd = pmd_offset(pgd, address); 	       
   45.31 -	if (pmd_none(*pmd))
   45.32 -		return NULL; 
   45.33 -	if (pmd_val(*pmd) & _PAGE_PSE) 
   45.34 -		return (pte_t *)pmd; 
   45.35 -    return pte_offset(pmd, address);
   45.36 -} 
   45.37 -
   45.38 -static struct page *split_large_page(unsigned long address, pgprot_t prot)
   45.39 -{ 
   45.40 -	int i; 
   45.41 -	unsigned long addr;
   45.42 -	struct page *base = alloc_pages(GFP_KERNEL, 0);
   45.43 -	pte_t *pbase;
   45.44 -	if (!base) 
   45.45 -		return NULL;
   45.46 -	address = __pa(address);
   45.47 -	addr = address & LARGE_PAGE_MASK; 
   45.48 -	pbase = (pte_t *)page_address(base);
   45.49 -	for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) {
   45.50 -		pbase[i] = mk_pte_phys(addr, 
   45.51 -				      addr == address ? prot : PAGE_KERNEL);
   45.52 -	}
   45.53 -	return base;
   45.54 -} 
   45.55 -
   45.56 -static void flush_kernel_map(void * address) 
   45.57 -{ 
   45.58 -	if (!test_bit(X86_FEATURE_SELFSNOOP, boot_cpu_data.x86_capability)) {
   45.59 -		/* Could use CLFLUSH here if the CPU supports it (Hammer,P4) */
   45.60 -		if (boot_cpu_data.x86_model >= 4) 
   45.61 -			asm volatile("wbinvd":::"memory"); 	
   45.62 -	} 
   45.63 -
   45.64 -	/* Do global flush here to work around large page flushing errata 
   45.65 -	   in some early Athlons */
   45.66 -	__flush_tlb_all(); 	
   45.67 -}
   45.68 -
   45.69 -static void set_pmd_pte(pte_t *kpte, unsigned long address, pte_t pte) 
   45.70 -{ 
   45.71 -	set_pte_atomic(kpte, pte); 	/* change init_mm */
   45.72 -#ifndef CONFIG_X86_PAE
   45.73 -	{
   45.74 -		struct list_head *l;
   45.75 -		spin_lock(&mmlist_lock);
   45.76 -		list_for_each(l, &init_mm.mmlist) { 
   45.77 -			struct mm_struct *mm = list_entry(l, struct mm_struct, mmlist);
   45.78 -			pmd_t *pmd = pmd_offset(pgd_offset(mm, address), address);
   45.79 -			set_pte_atomic((pte_t *)pmd, pte);
   45.80 -		} 
   45.81 -		spin_unlock(&mmlist_lock);
   45.82 -	}
   45.83 -#endif
   45.84 -}
   45.85 -
   45.86 -/* no more special protections in this 2/4MB area - revert to a
   45.87 -   large page again. */
   45.88 -static inline void revert_page(struct page *kpte_page, unsigned long address)
   45.89 -{
   45.90 -	pte_t *linear = (pte_t *) 
   45.91 -		pmd_offset(pgd_offset(&init_mm, address), address);
   45.92 -	set_pmd_pte(linear,  address,
   45.93 -		mk_pte_phys(__pa(address & LARGE_PAGE_MASK),
   45.94 -			    MAKE_GLOBAL(_KERNPG_TABLE|_PAGE_PSE)));
   45.95 -}	
   45.96 - 
   45.97 -/*
   45.98 - * Change the page attributes of an page in the linear mapping.
   45.99 - *
  45.100 - * This should be used when a page is mapped with a different caching policy
  45.101 - * than write-back somewhere - some CPUs do not like it when mappings with
  45.102 - * different caching policies exist. This changes the page attributes of the
  45.103 - * in kernel linear mapping too.
  45.104 - * 
  45.105 - * The caller needs to ensure that there are no conflicting mappings elsewhere.
  45.106 - * This function only deals with the kernel linear map.
  45.107 - * When page is in highmem it must never be kmap'ed.
  45.108 - */
  45.109 -static int 
  45.110 -__change_page_attr(struct page *page, pgprot_t prot, struct page **oldpage) 
  45.111 -{ 
  45.112 -	pte_t *kpte; 
  45.113 -	unsigned long address;
  45.114 -	struct page *kpte_page;
  45.115 -
  45.116 -#ifdef CONFIG_HIGHMEM
  45.117 -	if (page >= highmem_start_page) 
  45.118 -		BUG(); 
  45.119 -#endif
  45.120 -	address = (unsigned long)page_address(page);
  45.121 -	kpte = lookup_address(address);
  45.122 -	if (!kpte) 
  45.123 -		return -EINVAL; 
  45.124 -	kpte_page = virt_to_page(((unsigned long)kpte) & PAGE_MASK);
  45.125 -	if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) { 
  45.126 -		if ((pte_val(*kpte) & _PAGE_PSE) == 0) {
  45.127 -			pte_t old = *kpte;
  45.128 -			pte_t standard = mk_pte(page, PAGE_KERNEL); 
  45.129 -
  45.130 -			set_pte_atomic(kpte, mk_pte(page, prot)); 
  45.131 -			if (pte_same(old,standard))
  45.132 -				atomic_inc(&kpte_page->count);
  45.133 -		} else {
  45.134 -			struct page *split = split_large_page(address, prot); 
  45.135 -			if (!split)
  45.136 -				return -ENOMEM;
  45.137 -			atomic_inc(&kpte_page->count); 	
  45.138 -			set_pmd_pte(kpte,address,mk_pte(split, PAGE_KERNEL));
  45.139 -		}	
  45.140 -	} else if ((pte_val(*kpte) & _PAGE_PSE) == 0) { 
  45.141 -		set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL));
  45.142 -		atomic_dec(&kpte_page->count); 
  45.143 -	}
  45.144 -
  45.145 -	if (cpu_has_pse && (atomic_read(&kpte_page->count) == 1)) { 
  45.146 -		*oldpage = kpte_page;
  45.147 -		revert_page(kpte_page, address);
  45.148 -	} 
  45.149 -	return 0;
  45.150 -} 
  45.151 -
  45.152 -int change_page_attr(struct page *page, int numpages, pgprot_t prot)
  45.153 -{
  45.154 -	int err = 0; 
  45.155 -	struct page *fpage; 
  45.156 -	int i; 
  45.157 -
  45.158 -	down_write(&init_mm.mmap_sem);
  45.159 -	for (i = 0; i < numpages; i++, page++) { 
  45.160 -		fpage = NULL;
  45.161 -		err = __change_page_attr(page, prot, &fpage); 
  45.162 -		if (err) 
  45.163 -			break; 
  45.164 -		if (fpage || i == numpages-1) { 
  45.165 -			void *address = page_address(page);
  45.166 -#ifdef CONFIG_SMP 
  45.167 -			smp_call_function(flush_kernel_map, address, 1, 1);
  45.168 -#endif	
  45.169 -			flush_kernel_map(address);
  45.170 -			if (fpage)
  45.171 -				__free_page(fpage);
  45.172 -		} 
  45.173 -	} 	
  45.174 -	up_write(&init_mm.mmap_sem); 
  45.175 -	return err;
  45.176 -}
  45.177 -
  45.178 -EXPORT_SYMBOL(change_page_attr);
    46.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/a.out.h	Fri Mar 14 15:48:09 2003 +0000
    46.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.3 @@ -1,26 +0,0 @@
    46.4 -#ifndef __I386_A_OUT_H__
    46.5 -#define __I386_A_OUT_H__
    46.6 -
    46.7 -struct exec
    46.8 -{
    46.9 -  unsigned long a_info;		/* Use macros N_MAGIC, etc for access */
   46.10 -  unsigned a_text;		/* length of text, in bytes */
   46.11 -  unsigned a_data;		/* length of data, in bytes */
   46.12 -  unsigned a_bss;		/* length of uninitialized data area for file, in bytes */
   46.13 -  unsigned a_syms;		/* length of symbol table data in file, in bytes */
   46.14 -  unsigned a_entry;		/* start address */
   46.15 -  unsigned a_trsize;		/* length of relocation info for text, in bytes */
   46.16 -  unsigned a_drsize;		/* length of relocation info for data, in bytes */
   46.17 -};
   46.18 -
   46.19 -#define N_TRSIZE(a)	((a).a_trsize)
   46.20 -#define N_DRSIZE(a)	((a).a_drsize)
   46.21 -#define N_SYMSIZE(a)	((a).a_syms)
   46.22 -
   46.23 -#ifdef __KERNEL__
   46.24 -
   46.25 -#define STACK_TOP	TASK_SIZE
   46.26 -
   46.27 -#endif
   46.28 -
   46.29 -#endif /* __A_OUT_GNU_H__ */
    47.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/apic.h	Fri Mar 14 15:48:09 2003 +0000
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,99 +0,0 @@
    47.4 -#ifndef __ASM_APIC_H
    47.5 -#define __ASM_APIC_H
    47.6 -
    47.7 -#include <linux/config.h>
    47.8 -#include <linux/pm.h>
    47.9 -#include <asm/apicdef.h>
   47.10 -#include <asm/system.h>
   47.11 -
   47.12 -#ifdef CONFIG_X86_LOCAL_APIC
   47.13 -
   47.14 -#define APIC_DEBUG 0
   47.15 -
   47.16 -#if APIC_DEBUG
   47.17 -#define Dprintk(x...) printk(x)
   47.18 -#else
   47.19 -#define Dprintk(x...)
   47.20 -#endif
   47.21 -
   47.22 -/*
   47.23 - * Basic functions accessing APICs.
   47.24 - */
   47.25 -
   47.26 -static __inline void apic_write(unsigned long reg, unsigned long v)
   47.27 -{
   47.28 -	*((volatile unsigned long *)(APIC_BASE+reg)) = v;
   47.29 -}
   47.30 -
   47.31 -static __inline void apic_write_atomic(unsigned long reg, unsigned long v)
   47.32 -{
   47.33 -	xchg((volatile unsigned long *)(APIC_BASE+reg), v);
   47.34 -}
   47.35 -
   47.36 -static __inline unsigned long apic_read(unsigned long reg)
   47.37 -{
   47.38 -	return *((volatile unsigned long *)(APIC_BASE+reg));
   47.39 -}
   47.40 -
   47.41 -static __inline__ void apic_wait_icr_idle(void)
   47.42 -{
   47.43 -	do { } while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY );
   47.44 -}
   47.45 -
   47.46 -#ifdef CONFIG_X86_GOOD_APIC
   47.47 -# define FORCE_READ_AROUND_WRITE 0
   47.48 -# define apic_read_around(x)
   47.49 -# define apic_write_around(x,y) apic_write((x),(y))
   47.50 -#else
   47.51 -# define FORCE_READ_AROUND_WRITE 1
   47.52 -# define apic_read_around(x) apic_read(x)
   47.53 -# define apic_write_around(x,y) apic_write_atomic((x),(y))
   47.54 -#endif
   47.55 -
   47.56 -static inline void ack_APIC_irq(void)
   47.57 -{
   47.58 -	/*
   47.59 -	 * ack_APIC_irq() actually gets compiled as a single instruction:
   47.60 -	 * - a single rmw on Pentium/82489DX
   47.61 -	 * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
   47.62 -	 * ... yummie.
   47.63 -	 */
   47.64 -
   47.65 -	/* Docs say use 0 for future compatibility */
   47.66 -	apic_write_around(APIC_EOI, 0);
   47.67 -}
   47.68 -
   47.69 -extern int get_maxlvt(void);
   47.70 -extern void clear_local_APIC(void);
   47.71 -extern void connect_bsp_APIC (void);
   47.72 -extern void disconnect_bsp_APIC (void);
   47.73 -extern void disable_local_APIC (void);
   47.74 -extern int verify_local_APIC (void);
   47.75 -extern void cache_APIC_registers (void);
   47.76 -extern void sync_Arb_IDs (void);
   47.77 -extern void init_bsp_APIC (void);
   47.78 -extern void setup_local_APIC (void);
   47.79 -extern void init_apic_mappings (void);
   47.80 -extern void smp_local_timer_interrupt (struct pt_regs * regs);
   47.81 -extern void setup_APIC_clocks (void);
   47.82 -extern void setup_apic_nmi_watchdog (void);
   47.83 -extern inline void nmi_watchdog_tick (struct pt_regs * regs);
   47.84 -extern int APIC_init_uniprocessor (void);
   47.85 -extern void disable_APIC_timer(void);
   47.86 -extern void enable_APIC_timer(void);
   47.87 -
   47.88 -extern struct pm_dev *apic_pm_register(pm_dev_t, unsigned long, pm_callback);
   47.89 -extern void apic_pm_unregister(struct pm_dev*);
   47.90 -
   47.91 -extern unsigned int apic_timer_irqs [NR_CPUS];
   47.92 -extern int check_nmi_watchdog (void);
   47.93 -
   47.94 -extern unsigned int nmi_watchdog;
   47.95 -#define NMI_NONE	0
   47.96 -#define NMI_IO_APIC	1
   47.97 -#define NMI_LOCAL_APIC	2
   47.98 -#define NMI_INVALID	3
   47.99 -
  47.100 -#endif /* CONFIG_X86_LOCAL_APIC */
  47.101 -
  47.102 -#endif /* __ASM_APIC_H */
    48.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/apicdef.h	Fri Mar 14 15:48:09 2003 +0000
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,378 +0,0 @@
    48.4 -#ifndef __ASM_APICDEF_H
    48.5 -#define __ASM_APICDEF_H
    48.6 -
    48.7 -/*
    48.8 - * Constants for various Intel APICs. (local APIC, IOAPIC, etc.)
    48.9 - *
   48.10 - * Alan Cox <Alan.Cox@linux.org>, 1995.
   48.11 - * Ingo Molnar <mingo@redhat.com>, 1999, 2000
   48.12 - */
   48.13 -
   48.14 -#define		APIC_DEFAULT_PHYS_BASE	0xfee00000
   48.15 - 
   48.16 -#define		APIC_ID		0x20
   48.17 -#define			APIC_ID_MASK		(0x0F<<24)
   48.18 -#define			GET_APIC_ID(x)		(((x)>>24)&0x0F)
   48.19 -#define		APIC_LVR	0x30
   48.20 -#define			APIC_LVR_MASK		0xFF00FF
   48.21 -#define			GET_APIC_VERSION(x)	((x)&0xFF)
   48.22 -#define			GET_APIC_MAXLVT(x)	(((x)>>16)&0xFF)
   48.23 -#define			APIC_INTEGRATED(x)	((x)&0xF0)
   48.24 -#define		APIC_TASKPRI	0x80
   48.25 -#define			APIC_TPRI_MASK		0xFF
   48.26 -#define		APIC_ARBPRI	0x90
   48.27 -#define			APIC_ARBPRI_MASK	0xFF
   48.28 -#define		APIC_PROCPRI	0xA0
   48.29 -#define		APIC_EOI	0xB0
   48.30 -#define			APIC_EIO_ACK		0x0		/* Write this to the EOI register */
   48.31 -#define		APIC_RRR	0xC0
   48.32 -#define		APIC_LDR	0xD0
   48.33 -#define			APIC_LDR_MASK		(0xFF<<24)
   48.34 -#define			GET_APIC_LOGICAL_ID(x)	(((x)>>24)&0xFF)
   48.35 -#define			SET_APIC_LOGICAL_ID(x)	(((x)<<24))
   48.36 -#define			APIC_ALL_CPUS		0xFF
   48.37 -#define		APIC_DFR	0xE0
   48.38 -#define			APIC_DFR_CLUSTER	0x0FFFFFFFul	/* Clustered */
   48.39 -#define			APIC_DFR_FLAT		0xFFFFFFFFul	/* Flat mode */
   48.40 -#define		APIC_SPIV	0xF0
   48.41 -#define			APIC_SPIV_FOCUS_DISABLED	(1<<9)
   48.42 -#define			APIC_SPIV_APIC_ENABLED		(1<<8)
   48.43 -#define		APIC_ISR	0x100
   48.44 -#define		APIC_TMR	0x180
   48.45 -#define 	APIC_IRR	0x200
   48.46 -#define 	APIC_ESR	0x280
   48.47 -#define			APIC_ESR_SEND_CS	0x00001
   48.48 -#define			APIC_ESR_RECV_CS	0x00002
   48.49 -#define			APIC_ESR_SEND_ACC	0x00004
   48.50 -#define			APIC_ESR_RECV_ACC	0x00008
   48.51 -#define			APIC_ESR_SENDILL	0x00020
   48.52 -#define			APIC_ESR_RECVILL	0x00040
   48.53 -#define			APIC_ESR_ILLREGA	0x00080
   48.54 -#define		APIC_ICR	0x300
   48.55 -#define			APIC_DEST_SELF		0x40000
   48.56 -#define			APIC_DEST_ALLINC	0x80000
   48.57 -#define			APIC_DEST_ALLBUT	0xC0000
   48.58 -#define			APIC_ICR_RR_MASK	0x30000
   48.59 -#define			APIC_ICR_RR_INVALID	0x00000
   48.60 -#define			APIC_ICR_RR_INPROG	0x10000
   48.61 -#define			APIC_ICR_RR_VALID	0x20000
   48.62 -#define			APIC_INT_LEVELTRIG	0x08000
   48.63 -#define			APIC_INT_ASSERT		0x04000
   48.64 -#define			APIC_ICR_BUSY		0x01000
   48.65 -#define			APIC_DEST_PHYSICAL	0x00000
   48.66 -#define			APIC_DEST_LOGICAL	0x00800
   48.67 -#define			APIC_DM_FIXED		0x00000
   48.68 -#define			APIC_DM_LOWEST		0x00100
   48.69 -#define			APIC_DM_SMI		0x00200
   48.70 -#define			APIC_DM_REMRD		0x00300
   48.71 -#define			APIC_DM_NMI		0x00400
   48.72 -#define			APIC_DM_INIT		0x00500
   48.73 -#define			APIC_DM_STARTUP		0x00600
   48.74 -#define			APIC_DM_EXTINT		0x00700
   48.75 -#define			APIC_VECTOR_MASK	0x000FF
   48.76 -#define		APIC_ICR2	0x310
   48.77 -#define			GET_APIC_DEST_FIELD(x)	(((x)>>24)&0xFF)
   48.78 -#define			SET_APIC_DEST_FIELD(x)	((x)<<24)
   48.79 -#define		APIC_LVTT	0x320
   48.80 -#define		APIC_LVTPC	0x340
   48.81 -#define		APIC_LVT0	0x350
   48.82 -#define			APIC_LVT_TIMER_BASE_MASK	(0x3<<18)
   48.83 -#define			GET_APIC_TIMER_BASE(x)		(((x)>>18)&0x3)
   48.84 -#define			SET_APIC_TIMER_BASE(x)		(((x)<<18))
   48.85 -#define			APIC_TIMER_BASE_CLKIN		0x0
   48.86 -#define			APIC_TIMER_BASE_TMBASE		0x1
   48.87 -#define			APIC_TIMER_BASE_DIV		0x2
   48.88 -#define			APIC_LVT_TIMER_PERIODIC		(1<<17)
   48.89 -#define			APIC_LVT_MASKED			(1<<16)
   48.90 -#define			APIC_LVT_LEVEL_TRIGGER		(1<<15)
   48.91 -#define			APIC_LVT_REMOTE_IRR		(1<<14)
   48.92 -#define			APIC_INPUT_POLARITY		(1<<13)
   48.93 -#define			APIC_SEND_PENDING		(1<<12)
   48.94 -#define			GET_APIC_DELIVERY_MODE(x)	(((x)>>8)&0x7)
   48.95 -#define			SET_APIC_DELIVERY_MODE(x,y)	(((x)&~0x700)|((y)<<8))
   48.96 -#define				APIC_MODE_FIXED		0x0
   48.97 -#define				APIC_MODE_NMI		0x4
   48.98 -#define				APIC_MODE_EXINT		0x7
   48.99 -#define 	APIC_LVT1	0x360
  48.100 -#define		APIC_LVTERR	0x370
  48.101 -#define		APIC_TMICT	0x380
  48.102 -#define		APIC_TMCCT	0x390
  48.103 -#define		APIC_TDCR	0x3E0
  48.104 -#define			APIC_TDR_DIV_TMBASE	(1<<2)
  48.105 -#define			APIC_TDR_DIV_1		0xB
  48.106 -#define			APIC_TDR_DIV_2		0x0
  48.107 -#define			APIC_TDR_DIV_4		0x1
  48.108 -#define			APIC_TDR_DIV_8		0x2
  48.109 -#define			APIC_TDR_DIV_16		0x3
  48.110 -#define			APIC_TDR_DIV_32		0x8
  48.111 -#define			APIC_TDR_DIV_64		0x9
  48.112 -#define			APIC_TDR_DIV_128	0xA
  48.113 -
  48.114 -#define APIC_BASE (fix_to_virt(FIX_APIC_BASE))
  48.115 -
  48.116 -#ifdef CONFIG_X86_CLUSTERED_APIC
  48.117 -#define MAX_IO_APICS 32
  48.118 -#else
  48.119 -#define MAX_IO_APICS 8
  48.120 -#endif
  48.121 -
  48.122 -
  48.123 -/*
  48.124 - * The broadcast ID is 0xF for old APICs and 0xFF for xAPICs.  SAPICs
  48.125 - * don't broadcast (yet?), but if they did, they might use 0xFFFF.
  48.126 - */
  48.127 -#define APIC_BROADCAST_ID_XAPIC (0xFF)
  48.128 -#define APIC_BROADCAST_ID_APIC  (0x0F)
  48.129 -
  48.130 -/*
  48.131 - * the local APIC register structure, memory mapped. Not terribly well
  48.132 - * tested, but we might eventually use this one in the future - the
  48.133 - * problem why we cannot use it right now is the P5 APIC, it has an
  48.134 - * errata which cannot take 8-bit reads and writes, only 32-bit ones ...
  48.135 - */
  48.136 -#define u32 unsigned int
  48.137 -
  48.138 -#define lapic ((volatile struct local_apic *)APIC_BASE)
  48.139 -
  48.140 -struct local_apic {
  48.141 -
  48.142 -/*000*/	struct { u32 __reserved[4]; } __reserved_01;
  48.143 -
  48.144 -/*010*/	struct { u32 __reserved[4]; } __reserved_02;
  48.145 -
  48.146 -/*020*/	struct { /* APIC ID Register */
  48.147 -		u32   __reserved_1	: 24,
  48.148 -			phys_apic_id	:  4,
  48.149 -			__reserved_2	:  4;
  48.150 -		u32 __reserved[3];
  48.151 -	} id;
  48.152 -
  48.153 -/*030*/	const
  48.154 -	struct { /* APIC Version Register */
  48.155 -		u32   version		:  8,
  48.156 -			__reserved_1	:  8,
  48.157 -			max_lvt		:  8,
  48.158 -			__reserved_2	:  8;
  48.159 -		u32 __reserved[3];
  48.160 -	} version;
  48.161 -
  48.162 -/*040*/	struct { u32 __reserved[4]; } __reserved_03;
  48.163 -
  48.164 -/*050*/	struct { u32 __reserved[4]; } __reserved_04;
  48.165 -
  48.166 -/*060*/	struct { u32 __reserved[4]; } __reserved_05;
  48.167 -
  48.168 -/*070*/	struct { u32 __reserved[4]; } __reserved_06;
  48.169 -
  48.170 -/*080*/	struct { /* Task Priority Register */
  48.171 -		u32   priority	:  8,
  48.172 -			__reserved_1	: 24;
  48.173 -		u32 __reserved_2[3];
  48.174 -	} tpr;
  48.175 -
  48.176 -/*090*/	const
  48.177 -	struct { /* Arbitration Priority Register */
  48.178 -		u32   priority	:  8,
  48.179 -			__reserved_1	: 24;
  48.180 -		u32 __reserved_2[3];
  48.181 -	} apr;
  48.182 -
  48.183 -/*0A0*/	const
  48.184 -	struct { /* Processor Priority Register */
  48.185 -		u32   priority	:  8,
  48.186 -			__reserved_1	: 24;
  48.187 -		u32 __reserved_2[3];
  48.188 -	} ppr;
  48.189 -
  48.190 -/*0B0*/	struct { /* End Of Interrupt Register */
  48.191 -		u32   eoi;
  48.192 -		u32 __reserved[3];
  48.193 -	} eoi;
  48.194 -
  48.195 -/*0C0*/	struct { u32 __reserved[4]; } __reserved_07;
  48.196 -
  48.197 -/*0D0*/	struct { /* Logical Destination Register */
  48.198 -		u32   __reserved_1	: 24,
  48.199 -			logical_dest	:  8;
  48.200 -		u32 __reserved_2[3];
  48.201 -	} ldr;
  48.202 -
  48.203 -/*0E0*/	struct { /* Destination Format Register */
  48.204 -		u32   __reserved_1	: 28,
  48.205 -			model		:  4;
  48.206 -		u32 __reserved_2[3];
  48.207 -	} dfr;
  48.208 -
  48.209 -/*0F0*/	struct { /* Spurious Interrupt Vector Register */
  48.210 -		u32	spurious_vector	:  8,
  48.211 -			apic_enabled	:  1,
  48.212 -			focus_cpu	:  1,
  48.213 -			__reserved_2	: 22;
  48.214 -		u32 __reserved_3[3];
  48.215 -	} svr;
  48.216 -
  48.217 -/*100*/	struct { /* In Service Register */
  48.218 -/*170*/		u32 bitfield;
  48.219 -		u32 __reserved[3];
  48.220 -	} isr [8];
  48.221 -
  48.222 -/*180*/	struct { /* Trigger Mode Register */
  48.223 -/*1F0*/		u32 bitfield;
  48.224 -		u32 __reserved[3];
  48.225 -	} tmr [8];
  48.226 -
  48.227 -/*200*/	struct { /* Interrupt Request Register */
  48.228 -/*270*/		u32 bitfield;
  48.229 -		u32 __reserved[3];
  48.230 -	} irr [8];
  48.231 -
  48.232 -/*280*/	union { /* Error Status Register */
  48.233 -		struct {
  48.234 -			u32   send_cs_error			:  1,
  48.235 -				receive_cs_error		:  1,
  48.236 -				send_accept_error		:  1,
  48.237 -				receive_accept_error		:  1,
  48.238 -				__reserved_1			:  1,
  48.239 -				send_illegal_vector		:  1,
  48.240 -				receive_illegal_vector		:  1,
  48.241 -				illegal_register_address	:  1,
  48.242 -				__reserved_2			: 24;
  48.243 -			u32 __reserved_3[3];
  48.244 -		} error_bits;
  48.245 -		struct {
  48.246 -			u32 errors;
  48.247 -			u32 __reserved_3[3];
  48.248 -		} all_errors;
  48.249 -	} esr;
  48.250 -
  48.251 -/*290*/	struct { u32 __reserved[4]; } __reserved_08;
  48.252 -
  48.253 -/*2A0*/	struct { u32 __reserved[4]; } __reserved_09;
  48.254 -
  48.255 -/*2B0*/	struct { u32 __reserved[4]; } __reserved_10;
  48.256 -
  48.257 -/*2C0*/	struct { u32 __reserved[4]; } __reserved_11;
  48.258 -
  48.259 -/*2D0*/	struct { u32 __reserved[4]; } __reserved_12;
  48.260 -
  48.261 -/*2E0*/	struct { u32 __reserved[4]; } __reserved_13;
  48.262 -
  48.263 -/*2F0*/	struct { u32 __reserved[4]; } __reserved_14;
  48.264 -
  48.265 -/*300*/	struct { /* Interrupt Command Register 1 */
  48.266 -		u32   vector			:  8,
  48.267 -			delivery_mode		:  3,
  48.268 -			destination_mode	:  1,
  48.269 -			delivery_status		:  1,
  48.270 -			__reserved_1		:  1,
  48.271 -			level			:  1,
  48.272 -			trigger			:  1,
  48.273 -			__reserved_2		:  2,
  48.274 -			shorthand		:  2,
  48.275 -			__reserved_3		:  12;
  48.276 -		u32 __reserved_4[3];
  48.277 -	} icr1;
  48.278 -
  48.279 -/*310*/	struct { /* Interrupt Command Register 2 */
  48.280 -		union {
  48.281 -			u32   __reserved_1	: 24,
  48.282 -				phys_dest	:  4,
  48.283 -				__reserved_2	:  4;
  48.284 -			u32   __reserved_3	: 24,
  48.285 -				logical_dest	:  8;
  48.286 -		} dest;
  48.287 -		u32 __reserved_4[3];
  48.288 -	} icr2;
  48.289 -
  48.290 -/*320*/	struct { /* LVT - Timer */
  48.291 -		u32   vector		:  8,
  48.292 -			__reserved_1	:  4,
  48.293 -			delivery_status	:  1,
  48.294 -			__reserved_2	:  3,
  48.295 -			mask		:  1,
  48.296 -			timer_mode	:  1,
  48.297 -			__reserved_3	: 14;
  48.298 -		u32 __reserved_4[3];
  48.299 -	} lvt_timer;
  48.300 -
  48.301 -/*330*/	struct { u32 __reserved[4]; } __reserved_15;
  48.302 -
  48.303 -/*340*/	struct { /* LVT - Performance Counter */
  48.304 -		u32   vector		:  8,
  48.305 -			delivery_mode	:  3,
  48.306 -			__reserved_1	:  1,
  48.307 -			delivery_status	:  1,
  48.308 -			__reserved_2	:  3,
  48.309 -			mask		:  1,
  48.310 -			__reserved_3	: 15;
  48.311 -		u32 __reserved_4[3];
  48.312 -	} lvt_pc;
  48.313 -
  48.314 -/*350*/	struct { /* LVT - LINT0 */
  48.315 -		u32   vector		:  8,
  48.316 -			delivery_mode	:  3,
  48.317 -			__reserved_1	:  1,
  48.318 -			delivery_status	:  1,
  48.319 -			polarity	:  1,
  48.320 -			remote_irr	:  1,
  48.321 -			trigger		:  1,
  48.322 -			mask		:  1,
  48.323 -			__reserved_2	: 15;
  48.324 -		u32 __reserved_3[3];
  48.325 -	} lvt_lint0;
  48.326 -
  48.327 -/*360*/	struct { /* LVT - LINT1 */
  48.328 -		u32   vector		:  8,
  48.329 -			delivery_mode	:  3,
  48.330 -			__reserved_1	:  1,
  48.331 -			delivery_status	:  1,
  48.332 -			polarity	:  1,
  48.333 -			remote_irr	:  1,
  48.334 -			trigger		:  1,
  48.335 -			mask		:  1,
  48.336 -			__reserved_2	: 15;
  48.337 -		u32 __reserved_3[3];
  48.338 -	} lvt_lint1;
  48.339 -
  48.340 -/*370*/	struct { /* LVT - Error */
  48.341 -		u32   vector		:  8,
  48.342 -			__reserved_1	:  4,
  48.343 -			delivery_status	:  1,
  48.344 -			__reserved_2	:  3,
  48.345 -			mask		:  1,
  48.346 -			__reserved_3	: 15;
  48.347 -		u32 __reserved_4[3];
  48.348 -	} lvt_error;
  48.349 -
  48.350 -/*380*/	struct { /* Timer Initial Count Register */
  48.351 -		u32   initial_count;
  48.352 -		u32 __reserved_2[3];
  48.353 -	} timer_icr;
  48.354 -
  48.355 -/*390*/	const
  48.356 -	struct { /* Timer Current Count Register */
  48.357 -		u32   curr_count;
  48.358 -		u32 __reserved_2[3];
  48.359 -	} timer_ccr;
  48.360 -
  48.361 -/*3A0*/	struct { u32 __reserved[4]; } __reserved_16;
  48.362 -
  48.363 -/*3B0*/	struct { u32 __reserved[4]; } __reserved_17;
  48.364 -
  48.365 -/*3C0*/	struct { u32 __reserved[4]; } __reserved_18;
  48.366 -
  48.367 -/*3D0*/	struct { u32 __reserved[4]; } __reserved_19;
  48.368 -
  48.369 -/*3E0*/	struct { /* Timer Divide Configuration Register */
  48.370 -		u32   divisor		:  4,
  48.371 -			__reserved_1	: 28;
  48.372 -		u32 __reserved_2[3];
  48.373 -	} timer_dcr;
  48.374 -
  48.375 -/*3F0*/	struct { u32 __reserved[4]; } __reserved_20;
  48.376 -
  48.377 -} __attribute__ ((packed));
  48.378 -
  48.379 -#undef u32
  48.380 -
  48.381 -#endif
    49.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/atomic.h	Fri Mar 14 15:48:09 2003 +0000
    49.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.3 @@ -1,204 +0,0 @@
    49.4 -#ifndef __ARCH_I386_ATOMIC__
    49.5 -#define __ARCH_I386_ATOMIC__
    49.6 -
    49.7 -#include <linux/config.h>
    49.8 -
    49.9 -/*
   49.10 - * Atomic operations that C can't guarantee us.  Useful for
   49.11 - * resource counting etc..
   49.12 - */
   49.13 -
   49.14 -#ifdef CONFIG_SMP
   49.15 -#define LOCK "lock ; "
   49.16 -#else
   49.17 -#define LOCK ""
   49.18 -#endif
   49.19 -
   49.20 -/*
   49.21 - * Make sure gcc doesn't try to be clever and move things around
   49.22 - * on us. We need to use _exactly_ the address the user gave us,
   49.23 - * not some alias that contains the same information.
   49.24 - */
   49.25 -typedef struct { volatile int counter; } atomic_t;
   49.26 -
   49.27 -#define ATOMIC_INIT(i)	{ (i) }
   49.28 -
   49.29 -/**
   49.30 - * atomic_read - read atomic variable
   49.31 - * @v: pointer of type atomic_t
   49.32 - * 
   49.33 - * Atomically reads the value of @v.  Note that the guaranteed
   49.34 - * useful range of an atomic_t is only 24 bits.
   49.35 - */ 
   49.36 -#define atomic_read(v)		((v)->counter)
   49.37 -
   49.38 -/**
   49.39 - * atomic_set - set atomic variable
   49.40 - * @v: pointer of type atomic_t
   49.41 - * @i: required value
   49.42 - * 
   49.43 - * Atomically sets the value of @v to @i.  Note that the guaranteed
   49.44 - * useful range of an atomic_t is only 24 bits.
   49.45 - */ 
   49.46 -#define atomic_set(v,i)		(((v)->counter) = (i))
   49.47 -
   49.48 -/**
   49.49 - * atomic_add - add integer to atomic variable
   49.50 - * @i: integer value to add
   49.51 - * @v: pointer of type atomic_t
   49.52 - * 
   49.53 - * Atomically adds @i to @v.  Note that the guaranteed useful range
   49.54 - * of an atomic_t is only 24 bits.
   49.55 - */
   49.56 -static __inline__ void atomic_add(int i, atomic_t *v)
   49.57 -{
   49.58 -	__asm__ __volatile__(
   49.59 -		LOCK "addl %1,%0"
   49.60 -		:"=m" (v->counter)
   49.61 -		:"ir" (i), "m" (v->counter));
   49.62 -}
   49.63 -
   49.64 -/**
   49.65 - * atomic_sub - subtract the atomic variable
   49.66 - * @i: integer value to subtract
   49.67 - * @v: pointer of type atomic_t
   49.68 - * 
   49.69 - * Atomically subtracts @i from @v.  Note that the guaranteed
   49.70 - * useful range of an atomic_t is only 24 bits.
   49.71 - */
   49.72 -static __inline__ void atomic_sub(int i, atomic_t *v)
   49.73 -{
   49.74 -	__asm__ __volatile__(
   49.75 -		LOCK "subl %1,%0"
   49.76 -		:"=m" (v->counter)
   49.77 -		:"ir" (i), "m" (v->counter));
   49.78 -}
   49.79 -
   49.80 -/**
   49.81 - * atomic_sub_and_test - subtract value from variable and test result
   49.82 - * @i: integer value to subtract
   49.83 - * @v: pointer of type atomic_t
   49.84 - * 
   49.85 - * Atomically subtracts @i from @v and returns
   49.86 - * true if the result is zero, or false for all
   49.87 - * other cases.  Note that the guaranteed
   49.88 - * useful range of an atomic_t is only 24 bits.
   49.89 - */
   49.90 -static __inline__ int atomic_sub_and_test(int i, atomic_t *v)
   49.91 -{
   49.92 -	unsigned char c;
   49.93 -
   49.94 -	__asm__ __volatile__(
   49.95 -		LOCK "subl %2,%0; sete %1"
   49.96 -		:"=m" (v->counter), "=qm" (c)
   49.97 -		:"ir" (i), "m" (v->counter) : "memory");
   49.98 -	return c;
   49.99 -}
  49.100 -
  49.101 -/**
  49.102 - * atomic_inc - increment atomic variable
  49.103 - * @v: pointer of type atomic_t
  49.104 - * 
  49.105 - * Atomically increments @v by 1.  Note that the guaranteed
  49.106 - * useful range of an atomic_t is only 24 bits.
  49.107 - */ 
  49.108 -static __inline__ void atomic_inc(atomic_t *v)
  49.109 -{
  49.110 -	__asm__ __volatile__(
  49.111 -		LOCK "incl %0"
  49.112 -		:"=m" (v->counter)
  49.113 -		:"m" (v->counter));
  49.114 -}
  49.115 -
  49.116 -/**
  49.117 - * atomic_dec - decrement atomic variable
  49.118 - * @v: pointer of type atomic_t
  49.119 - * 
  49.120 - * Atomically decrements @v by 1.  Note that the guaranteed
  49.121 - * useful range of an atomic_t is only 24 bits.
  49.122 - */ 
  49.123 -static __inline__ void atomic_dec(atomic_t *v)
  49.124 -{
  49.125 -	__asm__ __volatile__(
  49.126 -		LOCK "decl %0"
  49.127 -		:"=m" (v->counter)
  49.128 -		:"m" (v->counter));
  49.129 -}
  49.130 -
  49.131 -/**
  49.132 - * atomic_dec_and_test - decrement and test
  49.133 - * @v: pointer of type atomic_t
  49.134 - * 
  49.135 - * Atomically decrements @v by 1 and
  49.136 - * returns true if the result is 0, or false for all other
  49.137 - * cases.  Note that the guaranteed
  49.138 - * useful range of an atomic_t is only 24 bits.
  49.139 - */ 
  49.140 -static __inline__ int atomic_dec_and_test(atomic_t *v)
  49.141 -{
  49.142 -	unsigned char c;
  49.143 -
  49.144 -	__asm__ __volatile__(
  49.145 -		LOCK "decl %0; sete %1"
  49.146 -		:"=m" (v->counter), "=qm" (c)
  49.147 -		:"m" (v->counter) : "memory");
  49.148 -	return c != 0;
  49.149 -}
  49.150 -
  49.151 -/**
  49.152 - * atomic_inc_and_test - increment and test 
  49.153 - * @v: pointer of type atomic_t
  49.154 - * 
  49.155 - * Atomically increments @v by 1
  49.156 - * and returns true if the result is zero, or false for all
  49.157 - * other cases.  Note that the guaranteed
  49.158 - * useful range of an atomic_t is only 24 bits.
  49.159 - */ 
  49.160 -static __inline__ int atomic_inc_and_test(atomic_t *v)
  49.161 -{
  49.162 -	unsigned char c;
  49.163 -
  49.164 -	__asm__ __volatile__(
  49.165 -		LOCK "incl %0; sete %1"
  49.166 -		:"=m" (v->counter), "=qm" (c)
  49.167 -		:"m" (v->counter) : "memory");
  49.168 -	return c != 0;
  49.169 -}
  49.170 -
  49.171 -/**
  49.172 - * atomic_add_negative - add and test if negative
  49.173 - * @v: pointer of type atomic_t
  49.174 - * @i: integer value to add
  49.175 - * 
  49.176 - * Atomically adds @i to @v and returns true
  49.177 - * if the result is negative, or false when
  49.178 - * result is greater than or equal to zero.  Note that the guaranteed
  49.179 - * useful range of an atomic_t is only 24 bits.
  49.180 - */ 
  49.181 -static __inline__ int atomic_add_negative(int i, atomic_t *v)
  49.182 -{
  49.183 -	unsigned char c;
  49.184 -
  49.185 -	__asm__ __volatile__(
  49.186 -		LOCK "addl %2,%0; sets %1"
  49.187 -		:"=m" (v->counter), "=qm" (c)
  49.188 -		:"ir" (i), "m" (v->counter) : "memory");
  49.189 -	return c;
  49.190 -}
  49.191 -
  49.192 -/* These are x86-specific, used by some header files */
  49.193 -#define atomic_clear_mask(mask, addr) \
  49.194 -__asm__ __volatile__(LOCK "andl %0,%1" \
  49.195 -: : "r" (~(mask)),"m" (*addr) : "memory")
  49.196 -
  49.197 -#define atomic_set_mask(mask, addr) \
  49.198 -__asm__ __volatile__(LOCK "orl %0,%1" \
  49.199 -: : "r" (mask),"m" (*addr) : "memory")
  49.200 -
  49.201 -/* Atomic operations are already serializing on x86 */
  49.202 -#define smp_mb__before_atomic_dec()	barrier()
  49.203 -#define smp_mb__after_atomic_dec()	barrier()
  49.204 -#define smp_mb__before_atomic_inc()	barrier()
  49.205 -#define smp_mb__after_atomic_inc()	barrier()
  49.206 -
  49.207 -#endif
    50.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/bitops.h	Fri Mar 14 15:48:09 2003 +0000
    50.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.3 @@ -1,384 +0,0 @@
    50.4 -#ifndef _I386_BITOPS_H
    50.5 -#define _I386_BITOPS_H
    50.6 -
    50.7 -/*
    50.8 - * Copyright 1992, Linus Torvalds.
    50.9 - */
   50.10 -
   50.11 -#include <linux/config.h>
   50.12 -
   50.13 -/*
   50.14 - * These have to be done with inline assembly: that way the bit-setting
   50.15 - * is guaranteed to be atomic. All bit operations return 0 if the bit
   50.16 - * was cleared before the operation and != 0 if it was not.
   50.17 - *
   50.18 - * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
   50.19 - */
   50.20 -
   50.21 -#ifdef CONFIG_SMP
   50.22 -#define LOCK_PREFIX "lock ; "
   50.23 -#else
   50.24 -#define LOCK_PREFIX ""
   50.25 -#endif
   50.26 -
   50.27 -#define ADDR (*(volatile long *) addr)
   50.28 -
   50.29 -/**
   50.30 - * set_bit - Atomically set a bit in memory
   50.31 - * @nr: the bit to set
   50.32 - * @addr: the address to start counting from
   50.33 - *
   50.34 - * This function is atomic and may not be reordered.  See __set_bit()
   50.35 - * if you do not require the atomic guarantees.
   50.36 - * Note that @nr may be almost arbitrarily large; this function is not
   50.37 - * restricted to acting on a single-word quantity.
   50.38 - */
   50.39 -static __inline__ void set_bit(int nr, volatile void * addr)
   50.40 -{
   50.41 -	__asm__ __volatile__( LOCK_PREFIX
   50.42 -		"btsl %1,%0"
   50.43 -		:"=m" (ADDR)
   50.44 -		:"Ir" (nr));
   50.45 -}
   50.46 -
   50.47 -/**
   50.48 - * __set_bit - Set a bit in memory
   50.49 - * @nr: the bit to set
   50.50 - * @addr: the address to start counting from
   50.51 - *
   50.52 - * Unlike set_bit(), this function is non-atomic and may be reordered.
   50.53 - * If it's called on the same region of memory simultaneously, the effect
   50.54 - * may be that only one operation succeeds.
   50.55 - */
   50.56 -static __inline__ void __set_bit(int nr, volatile void * addr)
   50.57 -{
   50.58 -	__asm__(
   50.59 -		"btsl %1,%0"
   50.60 -		:"=m" (ADDR)
   50.61 -		:"Ir" (nr));
   50.62 -}
   50.63 -
   50.64 -/**
   50.65 - * clear_bit - Clears a bit in memory
   50.66 - * @nr: Bit to clear
   50.67 - * @addr: Address to start counting from
   50.68 - *
   50.69 - * clear_bit() is atomic and may not be reordered.  However, it does
   50.70 - * not contain a memory barrier, so if it is used for locking purposes,
   50.71 - * you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit()
   50.72 - * in order to ensure changes are visible on other processors.
   50.73 - */
   50.74 -static __inline__ void clear_bit(int nr, volatile void * addr)
   50.75 -{
   50.76 -	__asm__ __volatile__( LOCK_PREFIX
   50.77 -		"btrl %1,%0"
   50.78 -		:"=m" (ADDR)
   50.79 -		:"Ir" (nr));
   50.80 -}
   50.81 -#define smp_mb__before_clear_bit()	barrier()
   50.82 -#define smp_mb__after_clear_bit()	barrier()
   50.83 -
   50.84 -/**
   50.85 - * __change_bit - Toggle a bit in memory
   50.86 - * @nr: the bit to set
   50.87 - * @addr: the address to start counting from
   50.88 - *
   50.89 - * Unlike change_bit(), this function is non-atomic and may be reordered.
   50.90 - * If it's called on the same region of memory simultaneously, the effect
   50.91 - * may be that only one operation succeeds.
   50.92 - */
   50.93 -static __inline__ void __change_bit(int nr, volatile void * addr)
   50.94 -{
   50.95 -	__asm__ __volatile__(
   50.96 -		"btcl %1,%0"
   50.97 -		:"=m" (ADDR)
   50.98 -		:"Ir" (nr));
   50.99 -}
  50.100 -
  50.101 -/**
  50.102 - * change_bit - Toggle a bit in memory
  50.103 - * @nr: Bit to clear
  50.104 - * @addr: Address to start counting from
  50.105 - *
  50.106 - * change_bit() is atomic and may not be reordered.
  50.107 - * Note that @nr may be almost arbitrarily large; this function is not
  50.108 - * restricted to acting on a single-word quantity.
  50.109 - */
  50.110 -static __inline__ void change_bit(int nr, volatile void * addr)
  50.111 -{
  50.112 -	__asm__ __volatile__( LOCK_PREFIX
  50.113 -		"btcl %1,%0"
  50.114 -		:"=m" (ADDR)
  50.115 -		:"Ir" (nr));
  50.116 -}
  50.117 -
  50.118 -/**
  50.119 - * test_and_set_bit - Set a bit and return its old value
  50.120 - * @nr: Bit to set
  50.121 - * @addr: Address to count from
  50.122 - *
  50.123 - * This operation is atomic and cannot be reordered.  
  50.124 - * It also implies a memory barrier.
  50.125 - */
  50.126 -static __inline__ int test_and_set_bit(int nr, volatile void * addr)
  50.127 -{
  50.128 -	int oldbit;
  50.129 -
  50.130 -	__asm__ __volatile__( LOCK_PREFIX
  50.131 -		"btsl %2,%1\n\tsbbl %0,%0"
  50.132 -		:"=r" (oldbit),"=m" (ADDR)
  50.133 -		:"Ir" (nr) : "memory");
  50.134 -	return oldbit;
  50.135 -}
  50.136 -
  50.137 -/**
  50.138 - * __test_and_set_bit - Set a bit and return its old value
  50.139 - * @nr: Bit to set
  50.140 - * @addr: Address to count from
  50.141 - *
  50.142 - * This operation is non-atomic and can be reordered.  
  50.143 - * If two examples of this operation race, one can appear to succeed
  50.144 - * but actually fail.  You must protect multiple accesses with a lock.
  50.145 - */
  50.146 -static __inline__ int __test_and_set_bit(int nr, volatile void * addr)
  50.147 -{
  50.148 -	int oldbit;
  50.149 -
  50.150 -	__asm__(
  50.151 -		"btsl %2,%1\n\tsbbl %0,%0"
  50.152 -		:"=r" (oldbit),"=m" (ADDR)
  50.153 -		:"Ir" (nr));
  50.154 -	return oldbit;
  50.155 -}
  50.156 -
  50.157 -/**
  50.158 - * test_and_clear_bit - Clear a bit and return its old value
  50.159 - * @nr: Bit to set
  50.160 - * @addr: Address to count from
  50.161 - *
  50.162 - * This operation is atomic and cannot be reordered.  
  50.163 - * It also implies a memory barrier.
  50.164 - */
  50.165 -static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
  50.166 -{
  50.167 -	int oldbit;
  50.168 -
  50.169 -	__asm__ __volatile__( LOCK_PREFIX
  50.170 -		"btrl %2,%1\n\tsbbl %0,%0"
  50.171 -		:"=r" (oldbit),"=m" (ADDR)
  50.172 -		:"Ir" (nr) : "memory");
  50.173 -	return oldbit;
  50.174 -}
  50.175 -
  50.176 -/**
  50.177 - * __test_and_clear_bit - Clear a bit and return its old value
  50.178 - * @nr: Bit to set
  50.179 - * @addr: Address to count from
  50.180 - *
  50.181 - * This operation is non-atomic and can be reordered.  
  50.182 - * If two examples of this operation race, one can appear to succeed
  50.183 - * but actually fail.  You must protect multiple accesses with a lock.
  50.184 - */
  50.185 -static __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
  50.186 -{
  50.187 -	int oldbit;
  50.188 -
  50.189 -	__asm__(
  50.190 -		"btrl %2,%1\n\tsbbl %0,%0"
  50.191 -		:"=r" (oldbit),"=m" (ADDR)
  50.192 -		:"Ir" (nr));
  50.193 -	return oldbit;
  50.194 -}
  50.195 -
  50.196 -/* WARNING: non atomic and it can be reordered! */
  50.197 -static __inline__ int __test_and_change_bit(int nr, volatile void * addr)
  50.198 -{
  50.199 -	int oldbit;
  50.200 -
  50.201 -	__asm__ __volatile__(
  50.202 -		"btcl %2,%1\n\tsbbl %0,%0"
  50.203 -		:"=r" (oldbit),"=m" (ADDR)
  50.204 -		:"Ir" (nr) : "memory");
  50.205 -	return oldbit;
  50.206 -}
  50.207 -
  50.208 -/**
  50.209 - * test_and_change_bit - Change a bit and return its new value
  50.210 - * @nr: Bit to set
  50.211 - * @addr: Address to count from
  50.212 - *
  50.213 - * This operation is atomic and cannot be reordered.  
  50.214 - * It also implies a memory barrier.
  50.215 - */
  50.216 -static __inline__ int test_and_change_bit(int nr, volatile void * addr)
  50.217 -{
  50.218 -	int oldbit;
  50.219 -
  50.220 -	__asm__ __volatile__( LOCK_PREFIX
  50.221 -		"btcl %2,%1\n\tsbbl %0,%0"
  50.222 -		:"=r" (oldbit),"=m" (ADDR)
  50.223 -		:"Ir" (nr) : "memory");
  50.224 -	return oldbit;
  50.225 -}
  50.226 -
  50.227 -#if 0 /* Fool kernel-doc since it doesn't do macros yet */
  50.228 -/**
  50.229 - * test_bit - Determine whether a bit is set
  50.230 - * @nr: bit number to test
  50.231 - * @addr: Address to start counting from
  50.232 - */
  50.233 -static int test_bit(int nr, const volatile void * addr);
  50.234 -#endif
  50.235 -
  50.236 -static __inline__ int constant_test_bit(int nr, const volatile void * addr)
  50.237 -{
  50.238 -	return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
  50.239 -}
  50.240 -
  50.241 -static __inline__ int variable_test_bit(int nr, volatile void * addr)
  50.242 -{
  50.243 -	int oldbit;
  50.244 -
  50.245 -	__asm__ __volatile__(
  50.246 -		"btl %2,%1\n\tsbbl %0,%0"
  50.247 -		:"=r" (oldbit)
  50.248 -		:"m" (ADDR),"Ir" (nr));
  50.249 -	return oldbit;
  50.250 -}
  50.251 -
  50.252 -#define test_bit(nr,addr) \
  50.253 -(__builtin_constant_p(nr) ? \
  50.254 - constant_test_bit((nr),(addr)) : \
  50.255 - variable_test_bit((nr),(addr)))
  50.256 -
  50.257 -/**
  50.258 - * find_first_zero_bit - find the first zero bit in a memory region
  50.259 - * @addr: The address to start the search at
  50.260 - * @size: The maximum size to search
  50.261 - *
  50.262 - * Returns the bit-number of the first zero bit, not the number of the byte
  50.263 - * containing a bit.
  50.264 - */
  50.265 -static __inline__ int find_first_zero_bit(void * addr, unsigned size)
  50.266 -{
  50.267 -	int d0, d1, d2;
  50.268 -	int res;
  50.269 -
  50.270 -	if (!size)
  50.271 -		return 0;
  50.272 -	/* This looks at memory. Mark it volatile to tell gcc not to move it around */
  50.273 -	__asm__ __volatile__(
  50.274 -		"movl $-1,%%eax\n\t"
  50.275 -		"xorl %%edx,%%edx\n\t"
  50.276 -		"repe; scasl\n\t"
  50.277 -		"je 1f\n\t"
  50.278 -		"xorl -4(%%edi),%%eax\n\t"
  50.279 -		"subl $4,%%edi\n\t"
  50.280 -		"bsfl %%eax,%%edx\n"
  50.281 -		"1:\tsubl %%ebx,%%edi\n\t"
  50.282 -		"shll $3,%%edi\n\t"
  50.283 -		"addl %%edi,%%edx"
  50.284 -		:"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
  50.285 -		:"1" ((size + 31) >> 5), "2" (addr), "b" (addr));
  50.286 -	return res;
  50.287 -}
  50.288 -
  50.289 -/**
  50.290 - * find_next_zero_bit - find the first zero bit in a memory region
  50.291 - * @addr: The address to base the search on
  50.292 - * @offset: The bitnumber to start searching at
  50.293 - * @size: The maximum size to search
  50.294 - */
  50.295 -static __inline__ int find_next_zero_bit (void * addr, int size, int offset)
  50.296 -{
  50.297 -	unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
  50.298 -	int set = 0, bit = offset & 31, res;
  50.299 -	
  50.300 -	if (bit) {
  50.301 -		/*
  50.302 -		 * Look for zero in first byte
  50.303 -		 */
  50.304 -		__asm__("bsfl %1,%0\n\t"
  50.305 -			"jne 1f\n\t"
  50.306 -			"movl $32, %0\n"
  50.307 -			"1:"
  50.308 -			: "=r" (set)
  50.309 -			: "r" (~(*p >> bit)));
  50.310 -		if (set < (32 - bit))
  50.311 -			return set + offset;
  50.312 -		set = 32 - bit;
  50.313 -		p++;
  50.314 -	}
  50.315 -	/*
  50.316 -	 * No zero yet, search remaining full bytes for a zero
  50.317 -	 */
  50.318 -	res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
  50.319 -	return (offset + set + res);
  50.320 -}
  50.321 -
  50.322 -/**
  50.323 - * ffz - find first zero in word.
  50.324 - * @word: The word to search
  50.325 - *
  50.326 - * Undefined if no zero exists, so code should check against ~0UL first.
  50.327 - */
  50.328 -static __inline__ unsigned long ffz(unsigned long word)
  50.329 -{
  50.330 -	__asm__("bsfl %1,%0"
  50.331 -		:"=r" (word)
  50.332 -		:"r" (~word));
  50.333 -	return word;
  50.334 -}
  50.335 -
  50.336 -#ifdef __KERNEL__
  50.337 -
  50.338 -/**
  50.339 - * ffs - find first bit set
  50.340 - * @x: the word to search
  50.341 - *
  50.342 - * This is defined the same way as
  50.343 - * the libc and compiler builtin ffs routines, therefore
  50.344 - * differs in spirit from the above ffz (man ffs).
  50.345 - */
  50.346 -static __inline__ int ffs(int x)
  50.347 -{
  50.348 -	int r;
  50.349 -
  50.350 -	__asm__("bsfl %1,%0\n\t"
  50.351 -		"jnz 1f\n\t"
  50.352 -		"movl $-1,%0\n"
  50.353 -		"1:" : "=r" (r) : "rm" (x));
  50.354 -	return r+1;
  50.355 -}
  50.356 -
  50.357 -/**
  50.358 - * hweightN - returns the hamming weight of a N-bit word
  50.359 - * @x: the word to weigh
  50.360 - *
  50.361 - * The Hamming Weight of a number is the total number of bits set in it.
  50.362 - */
  50.363 -
  50.364 -#define hweight32(x) generic_hweight32(x)
  50.365 -#define hweight16(x) generic_hweight16(x)
  50.366 -#define hweight8(x) generic_hweight8(x)
  50.367 -
  50.368 -#endif /* __KERNEL__ */
  50.369 -
  50.370 -#ifdef __KERNEL__
  50.371 -
  50.372 -#define ext2_set_bit                 __test_and_set_bit
  50.373 -#define ext2_clear_bit               __test_and_clear_bit
  50.374 -#define ext2_test_bit                test_bit
  50.375 -#define ext2_find_first_zero_bit     find_first_zero_bit
  50.376 -#define ext2_find_next_zero_bit      find_next_zero_bit
  50.377 -
  50.378 -/* Bitmap functions for the minix filesystem.  */
  50.379 -#define minix_test_and_set_bit(nr,addr) __test_and_set_bit(nr,addr)
  50.380 -#define minix_set_bit(nr,addr) __set_bit(nr,addr)
  50.381 -#define minix_test_and_clear_bit(nr,addr) __test_and_clear_bit(nr,addr)
  50.382 -#define minix_test_bit(nr,addr) test_bit(nr,addr)
  50.383 -#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
  50.384 -
  50.385 -#endif /* __KERNEL__ */
  50.386 -
  50.387 -#endif /* _I386_BITOPS_H */
    51.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/boot.h	Fri Mar 14 15:48:09 2003 +0000
    51.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.3 @@ -1,15 +0,0 @@
    51.4 -#ifndef _LINUX_BOOT_H
    51.5 -#define _LINUX_BOOT_H
    51.6 -
    51.7 -/* Don't touch these, unless you really know what you're doing. */
    51.8 -#define DEF_INITSEG	0x9000
    51.9 -#define DEF_SYSSEG	0x1000
   51.10 -#define DEF_SETUPSEG	0x9020
   51.11 -#define DEF_SYSSIZE	0x7F00
   51.12 -
   51.13 -/* Internal svga startup constants */
   51.14 -#define NORMAL_VGA	0xffff		/* 80x25 mode */
   51.15 -#define EXTENDED_VGA	0xfffe		/* 80x50 mode */
   51.16 -#define ASK_VGA		0xfffd		/* ask for it at bootup */
   51.17 -
   51.18 -#endif
    52.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/byteorder.h	Fri Mar 14 15:48:09 2003 +0000
    52.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.3 @@ -1,47 +0,0 @@
    52.4 -#ifndef _I386_BYTEORDER_H
    52.5 -#define _I386_BYTEORDER_H
    52.6 -
    52.7 -#include <asm/types.h>
    52.8 -
    52.9 -#ifdef __GNUC__
   52.10 -
   52.11 -/* For avoiding bswap on i386 */
   52.12 -#ifdef __KERNEL__
   52.13 -#include <linux/config.h>
   52.14 -#endif
   52.15 -
   52.16 -static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
   52.17 -{
   52.18 -#ifdef CONFIG_X86_BSWAP
   52.19 -	__asm__("bswap %0" : "=r" (x) : "0" (x));
   52.20 -#else
   52.21 -	__asm__("xchgb %b0,%h0\n\t"	/* swap lower bytes	*/
   52.22 -		"rorl $16,%0\n\t"	/* swap words		*/
   52.23 -		"xchgb %b0,%h0"		/* swap higher bytes	*/
   52.24 -		:"=q" (x)
   52.25 -		: "0" (x));
   52.26 -#endif
   52.27 -	return x;
   52.28 -}
   52.29 -
   52.30 -static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
   52.31 -{
   52.32 -	__asm__("xchgb %b0,%h0"		/* swap bytes		*/ \
   52.33 -		: "=q" (x) \
   52.34 -		:  "0" (x)); \
   52.35 -		return x;
   52.36 -}
   52.37 -
   52.38 -#define __arch__swab32(x) ___arch__swab32(x)
   52.39 -#define __arch__swab16(x) ___arch__swab16(x)
   52.40 -
   52.41 -#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
   52.42 -#  define __BYTEORDER_HAS_U64__
   52.43 -#  define __SWAB_64_THRU_32__
   52.44 -#endif
   52.45 -
   52.46 -#endif /* __GNUC__ */
   52.47 -
   52.48 -#include <linux/byteorder/little_endian.h>
   52.49 -
   52.50 -#endif /* _I386_BYTEORDER_H */
    53.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/cache.h	Fri Mar 14 15:48:09 2003 +0000
    53.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.3 @@ -1,13 +0,0 @@
    53.4 -/*
    53.5 - * include/asm-i386/cache.h
    53.6 - */
    53.7 -#ifndef __ARCH_I386_CACHE_H
    53.8 -#define __ARCH_I386_CACHE_H
    53.9 -
   53.10 -#include <linux/config.h>
   53.11 -
   53.12 -/* L1 cache line size */
   53.13 -#define L1_CACHE_SHIFT	(CONFIG_X86_L1_CACHE_SHIFT)
   53.14 -#define L1_CACHE_BYTES	(1 << L1_CACHE_SHIFT)
   53.15 -
   53.16 -#endif
    54.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/checksum.h	Fri Mar 14 15:48:09 2003 +0000
    54.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.3 @@ -1,195 +0,0 @@
    54.4 -#ifndef _I386_CHECKSUM_H
    54.5 -#define _I386_CHECKSUM_H
    54.6 -
    54.7 -
    54.8 -/*
    54.9 - * computes the checksum of a memory block at buff, length len,
   54.10 - * and adds in "sum" (32-bit)
   54.11 - *
   54.12 - * returns a 32-bit number suitable for feeding into itself
   54.13 - * or csum_tcpudp_magic
   54.14 - *
   54.15 - * this function must be called with even lengths, except
   54.16 - * for the last fragment, which may be odd
   54.17 - *
   54.18 - * it's best to have buff aligned on a 32-bit boundary
   54.19 - */
   54.20 -asmlinkage unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
   54.21 -
   54.22 -/*
   54.23 - * the same as csum_partial, but copies from src while it
   54.24 - * checksums, and handles user-space pointer exceptions correctly, when needed.
   54.25 - *
   54.26 - * here even more important to align src and dst on a 32-bit (or even
   54.27 - * better 64-bit) boundary
   54.28 - */
   54.29 -
   54.30 -asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, int len, int sum,
   54.31 -						   int *src_err_ptr, int *dst_err_ptr);
   54.32 -
   54.33 -/*
   54.34 - *	Note: when you get a NULL pointer exception here this means someone
   54.35 - *	passed in an incorrect kernel address to one of these functions.
   54.36 - *
   54.37 - *	If you use these functions directly please don't forget the
   54.38 - *	verify_area().
   54.39 - */
   54.40 -static __inline__
   54.41 -unsigned int csum_partial_copy_nocheck ( const char *src, char *dst,
   54.42 -					int len, int sum)
   54.43 -{
   54.44 -	return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL);
   54.45 -}
   54.46 -
   54.47 -static __inline__
   54.48 -unsigned int csum_partial_copy_from_user ( const char *src, char *dst,
   54.49 -						int len, int sum, int *err_ptr)
   54.50 -{
   54.51 -	return csum_partial_copy_generic ( src, dst, len, sum, err_ptr, NULL);
   54.52 -}
   54.53 -
   54.54 -/*
   54.55 - * These are the old (and unsafe) way of doing checksums, a warning message will be
   54.56 - * printed if they are used and an exeption occurs.
   54.57 - *
   54.58 - * these functions should go away after some time.
   54.59 - */
   54.60 -
   54.61 -#define csum_partial_copy_fromuser csum_partial_copy
   54.62 -unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum);
   54.63 -
   54.64 -/*
   54.65 - *	This is a version of ip_compute_csum() optimized for IP headers,
   54.66 - *	which always checksum on 4 octet boundaries.
   54.67 - *
   54.68 - *	By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by
   54.69 - *	Arnt Gulbrandsen.
   54.70 - */
   54.71 -static inline unsigned short ip_fast_csum(unsigned char * iph,
   54.72 -					  unsigned int ihl)
   54.73 -{
   54.74 -	unsigned int sum;
   54.75 -
   54.76 -	__asm__ __volatile__(
   54.77 -	    "movl (%1), %0	;\n"
   54.78 -	    "subl $4, %2	;\n"
   54.79 -	    "jbe 2f		;\n"
   54.80 -	    "addl 4(%1), %0	;\n"
   54.81 -	    "adcl 8(%1), %0	;\n"
   54.82 -	    "adcl 12(%1), %0	;\n"
   54.83 -"1:	    adcl 16(%1), %0	;\n"
   54.84 -	    "lea 4(%1), %1	;\n"
   54.85 -	    "decl %2		;\n"
   54.86 -	    "jne 1b		;\n"
   54.87 -	    "adcl $0, %0	;\n"
   54.88 -	    "movl %0, %2	;\n"
   54.89 -	    "shrl $16, %0	;\n"
   54.90 -	    "addw %w2, %w0	;\n"
   54.91 -	    "adcl $0, %0	;\n"
   54.92 -	    "notl %0		;\n"
   54.93 -"2:				;\n"
   54.94 -	/* Since the input registers which are loaded with iph and ipl
   54.95 -	   are modified, we must also specify them as outputs, or gcc
   54.96 -	   will assume they contain their original values. */
   54.97 -	: "=r" (sum), "=r" (iph), "=r" (ihl)
   54.98 -	: "1" (iph), "2" (ihl));
   54.99 -	return(sum);
  54.100 -}
  54.101 -
  54.102 -/*
  54.103 - *	Fold a partial checksum
  54.104 - */
  54.105 -
  54.106 -static inline unsigned int csum_fold(unsigned int sum)
  54.107 -{
  54.108 -	__asm__(
  54.109 -		"addl %1, %0		;\n"
  54.110 -		"adcl $0xffff, %0	;\n"
  54.111 -		: "=r" (sum)
  54.112 -		: "r" (sum << 16), "0" (sum & 0xffff0000)
  54.113 -	);
  54.114 -	return (~sum) >> 16;
  54.115 -}
  54.116 -
  54.117 -static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
  54.118 -						   unsigned long daddr,
  54.119 -						   unsigned short len,
  54.120 -						   unsigned short proto,
  54.121 -						   unsigned int sum)
  54.122 -{
  54.123 -    __asm__(
  54.124 -	"addl %1, %0	;\n"
  54.125 -	"adcl %2, %0	;\n"
  54.126 -	"adcl %3, %0	;\n"
  54.127 -	"adcl $0, %0	;\n"
  54.128 -	: "=r" (sum)
  54.129 -	: "g" (daddr), "g"(saddr), "g"((ntohs(len)<<16)+proto*256), "0"(sum));
  54.130 -    return sum;
  54.131 -}
  54.132 -
  54.133 -/*
  54.134 - * computes the checksum of the TCP/UDP pseudo-header
  54.135 - * returns a 16-bit checksum, already complemented
  54.136 - */
  54.137 -static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
  54.138 -						   unsigned long daddr,
  54.139 -						   unsigned short len,
  54.140 -						   unsigned short proto,
  54.141 -						   unsigned int sum)
  54.142 -{
  54.143 -	return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
  54.144 -}
  54.145 -
  54.146 -/*
  54.147 - * this routine is used for miscellaneous IP-like checksums, mainly
  54.148 - * in icmp.c
  54.149 - */
  54.150 -
  54.151 -static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
  54.152 -{
  54.153 -    return csum_fold (csum_partial(buff, len, 0));
  54.154 -}
  54.155 -
  54.156 -#define _HAVE_ARCH_IPV6_CSUM
  54.157 -static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
  54.158 -						     struct in6_addr *daddr,
  54.159 -						     __u32 len,
  54.160 -						     unsigned short proto,
  54.161 -						     unsigned int sum)
  54.162 -{
  54.163 -	__asm__(
  54.164 -		"addl 0(%1), %0		;\n"
  54.165 -		"adcl 4(%1), %0		;\n"
  54.166 -		"adcl 8(%1), %0		;\n"
  54.167 -		"adcl 12(%1), %0	;\n"
  54.168 -		"adcl 0(%2), %0		;\n"
  54.169 -		"adcl 4(%2), %0		;\n"
  54.170 -		"adcl 8(%2), %0		;\n"
  54.171 -		"adcl 12(%2), %0	;\n"
  54.172 -		"adcl %3, %0		;\n"
  54.173 -		"adcl %4, %0		;\n"
  54.174 -		"adcl $0, %0		;\n"
  54.175 -		: "=&r" (sum)
  54.176 -		: "r" (saddr), "r" (daddr),
  54.177 -		  "r"(htonl(len)), "r"(htonl(proto)), "0"(sum));
  54.178 -
  54.179 -	return csum_fold(sum);
  54.180 -}
  54.181 -
  54.182 -/*
  54.183 - *	Copy and checksum to user
  54.184 - */
  54.185 -#define HAVE_CSUM_COPY_USER
  54.186 -static __inline__ unsigned int csum_and_copy_to_user(const char *src, char *dst,
  54.187 -				    int len, int sum, int *err_ptr)
  54.188 -{
  54.189 -	if (access_ok(VERIFY_WRITE, dst, len))
  54.190 -		return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr);
  54.191 -
  54.192 -	if (len)
  54.193 -		*err_ptr = -EFAULT;
  54.194 -
  54.195 -	return -1; /* invalid checksum */
  54.196 -}
  54.197 -
  54.198 -#endif
    55.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/cpufeature.h	Fri Mar 14 15:48:09 2003 +0000
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,76 +0,0 @@
    55.4 -/*
    55.5 - * cpufeature.h
    55.6 - *
    55.7 - * Defines x86 CPU feature bits
    55.8 - */
    55.9 -
   55.10 -#ifndef __ASM_I386_CPUFEATURE_H
   55.11 -#define __ASM_I386_CPUFEATURE_H
   55.12 -
   55.13 -/* Sample usage: CPU_FEATURE_P(cpu.x86_capability, FPU) */
   55.14 -#define CPU_FEATURE_P(CAP, FEATURE) test_bit(CAP, X86_FEATURE_##FEATURE ##_BIT)
   55.15 -
   55.16 -#define NCAPINTS	4	/* Currently we have 4 32-bit words worth of info */
   55.17 -
   55.18 -/* Intel-defined CPU features, CPUID level 0x00000001, word 0 */
   55.19 -#define X86_FEATURE_FPU		(0*32+ 0) /* Onboard FPU */
   55.20 -#define X86_FEATURE_VME		(0*32+ 1) /* Virtual Mode Extensions */
   55.21 -#define X86_FEATURE_DE		(0*32+ 2) /* Debugging Extensions */
   55.22 -#define X86_FEATURE_PSE 	(0*32+ 3) /* Page Size Extensions */
   55.23 -#define X86_FEATURE_TSC		(0*32+ 4) /* Time Stamp Counter */
   55.24 -#define X86_FEATURE_MSR		(0*32+ 5) /* Model-Specific Registers, RDMSR, WRMSR */
   55.25 -#define X86_FEATURE_PAE		(0*32+ 6) /* Physical Address Extensions */
   55.26 -#define X86_FEATURE_MCE		(0*32+ 7) /* Machine Check Architecture */
   55.27 -#define X86_FEATURE_CX8		(0*32+ 8) /* CMPXCHG8 instruction */
   55.28 -#define X86_FEATURE_APIC	(0*32+ 9) /* Onboard APIC */
   55.29 -#define X86_FEATURE_SEP		(0*32+11) /* SYSENTER/SYSEXIT */
   55.30 -#define X86_FEATURE_MTRR	(0*32+12) /* Memory Type Range Registers */
   55.31 -#define X86_FEATURE_PGE		(0*32+13) /* Page Global Enable */
   55.32 -#define X86_FEATURE_MCA		(0*32+14) /* Machine Check Architecture */
   55.33 -#define X86_FEATURE_CMOV	(0*32+15) /* CMOV instruction (FCMOVCC and FCOMI too if FPU present) */
   55.34 -#define X86_FEATURE_PAT		(0*32+16) /* Page Attribute Table */
   55.35 -#define X86_FEATURE_PSE36	(0*32+17) /* 36-bit PSEs */
   55.36 -#define X86_FEATURE_PN		(0*32+18) /* Processor serial number */
   55.37 -#define X86_FEATURE_CLFLSH	(0*32+19) /* Supports the CLFLUSH instruction */
   55.38 -#define X86_FEATURE_DTES	(0*32+21) /* Debug Trace Store */
   55.39 -#define X86_FEATURE_ACPI	(0*32+22) /* ACPI via MSR */
   55.40 -#define X86_FEATURE_MMX		(0*32+23) /* Multimedia Extensions */
   55.41 -#define X86_FEATURE_FXSR	(0*32+24) /* FXSAVE and FXRSTOR instructions (fast save and restore */
   55.42 -				          /* of FPU context), and CR4.OSFXSR available */
   55.43 -#define X86_FEATURE_XMM		(0*32+25) /* Streaming SIMD Extensions */
   55.44 -#define X86_FEATURE_XMM2	(0*32+26) /* Streaming SIMD Extensions-2 */
   55.45 -#define X86_FEATURE_SELFSNOOP	(0*32+27) /* CPU self snoop */
   55.46 -#define X86_FEATURE_HT		(0*32+28) /* Hyper-Threading */
   55.47 -#define X86_FEATURE_ACC		(0*32+29) /* Automatic clock control */
   55.48 -#define X86_FEATURE_IA64	(0*32+30) /* IA-64 processor */
   55.49 -
   55.50 -/* AMD-defined CPU features, CPUID level 0x80000001, word 1 */
   55.51 -/* Don't duplicate feature flags which are redundant with Intel! */
   55.52 -#define X86_FEATURE_SYSCALL	(1*32+11) /* SYSCALL/SYSRET */
   55.53 -#define X86_FEATURE_MMXEXT	(1*32+22) /* AMD MMX extensions */
   55.54 -#define X86_FEATURE_LM		(1*32+29) /* Long Mode (x86-64) */
   55.55 -#define X86_FEATURE_3DNOWEXT	(1*32+30) /* AMD 3DNow! extensions */
   55.56 -#define X86_FEATURE_3DNOW	(1*32+31) /* 3DNow! */
   55.57 -
   55.58 -/* Transmeta-defined CPU features, CPUID level 0x80860001, word 2 */
   55.59 -#define X86_FEATURE_RECOVERY	(2*32+ 0) /* CPU in recovery mode */
   55.60 -#define X86_FEATURE_LONGRUN	(2*32+ 1) /* Longrun power control */
   55.61 -#define X86_FEATURE_LRTI	(2*32+ 3) /* LongRun table interface */
   55.62 -
   55.63 -/* Other features, Linux-defined mapping, word 3 */
   55.64 -/* This range is used for feature bits which conflict or are synthesized */
   55.65 -#define X86_FEATURE_CXMMX	(3*32+ 0) /* Cyrix MMX extensions */
   55.66 -#define X86_FEATURE_K6_MTRR	(3*32+ 1) /* AMD K6 nonstandard MTRRs */
   55.67 -#define X86_FEATURE_CYRIX_ARR	(3*32+ 2) /* Cyrix ARRs (= MTRRs) */
   55.68 -#define X86_FEATURE_CENTAUR_MCR	(3*32+ 3) /* Centaur MCRs (= MTRRs) */
   55.69 -
   55.70 -#define cpu_has(c, bit)            test_bit(bit, (c)->x86_capability)
   55.71 -
   55.72 -#endif /* __ASM_I386_CPUFEATURE_H */
   55.73 -
   55.74 -/* 
   55.75 - * Local Variables:
   55.76 - * mode:c
   55.77 - * comment-column:42
   55.78 - * End:
   55.79 - */
    56.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/current.h	Fri Mar 14 15:48:09 2003 +0000
    56.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.3 @@ -1,15 +0,0 @@
    56.4 -#ifndef _I386_CURRENT_H
    56.5 -#define _I386_CURRENT_H
    56.6 -
    56.7 -struct task_struct;
    56.8 -
    56.9 -static inline struct task_struct * get_current(void)
   56.10 -{
   56.11 -	struct task_struct *current;
   56.12 -	__asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL));
   56.13 -	return current;
   56.14 - }
   56.15 - 
   56.16 -#define current get_current()
   56.17 -
   56.18 -#endif /* !(_I386_CURRENT_H) */
    57.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/debugreg.h	Fri Mar 14 15:48:09 2003 +0000
    57.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.3 @@ -1,64 +0,0 @@
    57.4 -#ifndef _I386_DEBUGREG_H
    57.5 -#define _I386_DEBUGREG_H
    57.6 -
    57.7 -
    57.8 -/* Indicate the register numbers for a number of the specific
    57.9 -   debug registers.  Registers 0-3 contain the addresses we wish to trap on */
   57.10 -#define DR_FIRSTADDR 0        /* u_debugreg[DR_FIRSTADDR] */
   57.11 -#define DR_LASTADDR 3         /* u_debugreg[DR_LASTADDR]  */
   57.12 -
   57.13 -#define DR_STATUS 6           /* u_debugreg[DR_STATUS]     */
   57.14 -#define DR_CONTROL 7          /* u_debugreg[DR_CONTROL] */
   57.15 -
   57.16 -/* Define a few things for the status register.  We can use this to determine
   57.17 -   which debugging register was responsible for the trap.  The other bits
   57.18 -   are either reserved or not of interest to us. */
   57.19 -
   57.20 -#define DR_TRAP0	(0x1)		/* db0 */
   57.21 -#define DR_TRAP1	(0x2)		/* db1 */
   57.22 -#define DR_TRAP2	(0x4)		/* db2 */
   57.23 -#define DR_TRAP3	(0x8)		/* db3 */
   57.24 -
   57.25 -#define DR_STEP		(0x4000)	/* single-step */
   57.26 -#define DR_SWITCH	(0x8000)	/* task switch */
   57.27 -
   57.28 -/* Now define a bunch of things for manipulating the control register.
   57.29 -   The top two bytes of the control register consist of 4 fields of 4
   57.30 -   bits - each field corresponds to one of the four debug registers,
   57.31 -   and indicates what types of access we trap on, and how large the data
   57.32 -   field is that we are looking at */
   57.33 -
   57.34 -#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
   57.35 -#define DR_CONTROL_SIZE 4   /* 4 control bits per register */
   57.36 -
   57.37 -#define DR_RW_EXECUTE (0x0)   /* Settings for the access types to trap on */
   57.38 -#define DR_RW_WRITE (0x1)
   57.39 -#define DR_RW_READ (0x3)
   57.40 -
   57.41 -#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
   57.42 -#define DR_LEN_2 (0x4)
   57.43 -#define DR_LEN_4 (0xC)
   57.44 -
   57.45 -/* The low byte to the control register determine which registers are
   57.46 -   enabled.  There are 4 fields of two bits.  One bit is "local", meaning
   57.47 -   that the processor will reset the bit after a task switch and the other
   57.48 -   is global meaning that we have to explicitly reset the bit.  With linux,
   57.49 -   you can use either one, since we explicitly zero the register when we enter
   57.50 -   kernel mode. */
   57.51 -
   57.52 -#define DR_LOCAL_ENABLE_SHIFT 0    /* Extra shift to the local enable bit */
   57.53 -#define DR_GLOBAL_ENABLE_SHIFT 1   /* Extra shift to the global enable bit */
   57.54 -#define DR_ENABLE_SIZE 2           /* 2 enable bits per register */
   57.55 -
   57.56 -#define DR_LOCAL_ENABLE_MASK (0x55)  /* Set  local bits for all 4 regs */
   57.57 -#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
   57.58 -
   57.59 -/* The second byte to the control register has a few special things.
   57.60 -   We can slow the instruction pipeline for instructions coming via the
   57.61 -   gdt or the ldt if we want to.  I am not sure why this is an advantage */
   57.62 -
   57.63 -#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */
   57.64 -#define DR_LOCAL_SLOWDOWN (0x100)   /* Local slow the pipeline */
   57.65 -#define DR_GLOBAL_SLOWDOWN (0x200)  /* Global slow the pipeline */
   57.66 -
   57.67 -#endif
    58.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/delay.h	Fri Mar 14 15:48:09 2003 +0000
    58.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.3 @@ -1,20 +0,0 @@
    58.4 -#ifndef _I386_DELAY_H
    58.5 -#define _I386_DELAY_H
    58.6 -
    58.7 -/*
    58.8 - * Copyright (C) 1993 Linus Torvalds
    58.9 - *
   58.10 - * Delay routines calling functions in arch/i386/lib/delay.c
   58.11 - */
   58.12 - 
   58.13 -extern void __bad_udelay(void);
   58.14 -
   58.15 -extern void __udelay(unsigned long usecs);
   58.16 -extern void __const_udelay(unsigned long usecs);
   58.17 -extern void __delay(unsigned long loops);
   58.18 -
   58.19 -#define udelay(n) (__builtin_constant_p(n) ? \
   58.20 -	((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
   58.21 -	__udelay(n))
   58.22 -
   58.23 -#endif /* defined(_I386_DELAY_H) */
    59.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/div64.h	Fri Mar 14 15:48:09 2003 +0000
    59.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.3 @@ -1,17 +0,0 @@
    59.4 -#ifndef __I386_DIV64
    59.5 -#define __I386_DIV64
    59.6 -
    59.7 -#define do_div(n,base) ({ \
    59.8 -	unsigned long __upper, __low, __high, __mod; \
    59.9 -	asm("":"=a" (__low), "=d" (__high):"A" (n)); \
   59.10 -	__upper = __high; \
   59.11 -	if (__high) { \
   59.12 -		__upper = __high % (base); \
   59.13 -		__high = __high / (base); \
   59.14 -	} \
   59.15 -	asm("divl %2":"=a" (__low), "=d" (__mod):"rm" (base), "0" (__low), "1" (__upper)); \
   59.16 -	asm("":"=A" (n):"a" (__low),"d" (__high)); \
   59.17 -	__mod; \
   59.18 -})
   59.19 -
   59.20 -#endif
    60.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/dma.h	Fri Mar 14 15:48:09 2003 +0000
    60.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.3 @@ -1,298 +0,0 @@
    60.4 -/* $Id: dma.h,v 1.7 1992/12/14 00:29:34 root Exp root $
    60.5 - * linux/include/asm/dma.h: Defines for using and allocating dma channels.
    60.6 - * Written by Hennus Bergman, 1992.
    60.7 - * High DMA channel support & info by Hannu Savolainen
    60.8 - * and John Boyd, Nov. 1992.
    60.9 - */
   60.10 -
   60.11 -#ifndef _ASM_DMA_H
   60.12 -#define _ASM_DMA_H
   60.13 -
   60.14 -#include <linux/config.h>
   60.15 -#include <linux/spinlock.h>	/* And spinlocks */
   60.16 -#include <asm/io.h>		/* need byte IO */
   60.17 -#include <linux/delay.h>
   60.18 -
   60.19 -
   60.20 -#ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER
   60.21 -#define dma_outb	outb_p
   60.22 -#else
   60.23 -#define dma_outb	outb
   60.24 -#endif
   60.25 -
   60.26 -#define dma_inb		inb
   60.27 -
   60.28 -/*
   60.29 - * NOTES about DMA transfers:
   60.30 - *
   60.31 - *  controller 1: channels 0-3, byte operations, ports 00-1F
   60.32 - *  controller 2: channels 4-7, word operations, ports C0-DF
   60.33 - *
   60.34 - *  - ALL registers are 8 bits only, regardless of transfer size
   60.35 - *  - channel 4 is not used - cascades 1 into 2.
   60.36 - *  - channels 0-3 are byte - addresses/counts are for physical bytes
   60.37 - *  - channels 5-7 are word - addresses/counts are for physical words
   60.38 - *  - transfers must not cross physical 64K (0-3) or 128K (5-7) boundaries
   60.39 - *  - transfer count loaded to registers is 1 less than actual count
   60.40 - *  - controller 2 offsets are all even (2x offsets for controller 1)
   60.41 - *  - page registers for 5-7 don't use data bit 0, represent 128K pages
   60.42 - *  - page registers for 0-3 use bit 0, represent 64K pages
   60.43 - *
   60.44 - * DMA transfers are limited to the lower 16MB of _physical_ memory.  
   60.45 - * Note that addresses loaded into registers must be _physical_ addresses,
   60.46 - * not logical addresses (which may differ if paging is active).
   60.47 - *
   60.48 - *  Address mapping for channels 0-3:
   60.49 - *
   60.50 - *   A23 ... A16 A15 ... A8  A7 ... A0    (Physical addresses)
   60.51 - *    |  ...  |   |  ... |   |  ... |
   60.52 - *    |  ...  |   |  ... |   |  ... |
   60.53 - *    |  ...  |   |  ... |   |  ... |
   60.54 - *   P7  ...  P0  A7 ... A0  A7 ... A0   
   60.55 - * |    Page    | Addr MSB | Addr LSB |   (DMA registers)
   60.56 - *
   60.57 - *  Address mapping for channels 5-7:
   60.58 - *
   60.59 - *   A23 ... A17 A16 A15 ... A9 A8 A7 ... A1 A0    (Physical addresses)
   60.60 - *    |  ...  |   \   \   ... \  \  \  ... \  \
   60.61 - *    |  ...  |    \   \   ... \  \  \  ... \  (not used)
   60.62 - *    |  ...  |     \   \   ... \  \  \  ... \
   60.63 - *   P7  ...  P1 (0) A7 A6  ... A0 A7 A6 ... A0   
   60.64 - * |      Page      |  Addr MSB   |  Addr LSB  |   (DMA registers)
   60.65 - *
   60.66 - * Again, channels 5-7 transfer _physical_ words (16 bits), so addresses
   60.67 - * and counts _must_ be word-aligned (the lowest address bit is _ignored_ at
   60.68 - * the hardware level, so odd-byte transfers aren't possible).
   60.69 - *
   60.70 - * Transfer count (_not # bytes_) is limited to 64K, represented as actual
   60.71 - * count - 1 : 64K => 0xFFFF, 1 => 0x0000.  Thus, count is always 1 or more,
   60.72 - * and up to 128K bytes may be transferred on channels 5-7 in one operation. 
   60.73 - *
   60.74 - */
   60.75 -
   60.76 -#define MAX_DMA_CHANNELS	8
   60.77 -
   60.78 -/* The maximum address that we can perform a DMA transfer to on this platform */
   60.79 -#define MAX_DMA_ADDRESS      (PAGE_OFFSET+0x1000000)
   60.80 -
   60.81 -/* 8237 DMA controllers */
   60.82 -#define IO_DMA1_BASE	0x00	/* 8 bit slave DMA, channels 0..3 */
   60.83 -#define IO_DMA2_BASE	0xC0	/* 16 bit master DMA, ch 4(=slave input)..7 */
   60.84 -
   60.85 -/* DMA controller registers */
   60.86 -#define DMA1_CMD_REG		0x08	/* command register (w) */
   60.87 -#define DMA1_STAT_REG		0x08	/* status register (r) */
   60.88 -#define DMA1_REQ_REG            0x09    /* request register (w) */
   60.89 -#define DMA1_MASK_REG		0x0A	/* single-channel mask (w) */
   60.90 -#define DMA1_MODE_REG		0x0B	/* mode register (w) */
   60.91 -#define DMA1_CLEAR_FF_REG	0x0C	/* clear pointer flip-flop (w) */
   60.92 -#define DMA1_TEMP_REG           0x0D    /* Temporary Register (r) */
   60.93 -#define DMA1_RESET_REG		0x0D	/* Master Clear (w) */
   60.94 -#define DMA1_CLR_MASK_REG       0x0E    /* Clear Mask */
   60.95 -#define DMA1_MASK_ALL_REG       0x0F    /* all-channels mask (w) */
   60.96 -
   60.97 -#define DMA2_CMD_REG		0xD0	/* command register (w) */
   60.98 -#define DMA2_STAT_REG		0xD0	/* status register (r) */
   60.99 -#define DMA2_REQ_REG            0xD2    /* request register (w) */
  60.100 -#define DMA2_MASK_REG		0xD4	/* single-channel mask (w) */
  60.101 -#define DMA2_MODE_REG		0xD6	/* mode register (w) */
  60.102 -#define DMA2_CLEAR_FF_REG	0xD8	/* clear pointer flip-flop (w) */
  60.103 -#define DMA2_TEMP_REG           0xDA    /* Temporary Register (r) */
  60.104 -#define DMA2_RESET_REG		0xDA	/* Master Clear (w) */
  60.105 -#define DMA2_CLR_MASK_REG       0xDC    /* Clear Mask */
  60.106 -#define DMA2_MASK_ALL_REG       0xDE    /* all-channels mask (w) */
  60.107 -
  60.108 -#define DMA_ADDR_0              0x00    /* DMA address registers */
  60.109 -#define DMA_ADDR_1              0x02
  60.110 -#define DMA_ADDR_2              0x04
  60.111 -#define DMA_ADDR_3              0x06
  60.112 -#define DMA_ADDR_4              0xC0
  60.113 -#define DMA_ADDR_5              0xC4
  60.114 -#define DMA_ADDR_6              0xC8
  60.115 -#define DMA_ADDR_7              0xCC
  60.116 -
  60.117 -#define DMA_CNT_0               0x01    /* DMA count registers */
  60.118 -#define DMA_CNT_1               0x03
  60.119 -#define DMA_CNT_2               0x05
  60.120 -#define DMA_CNT_3               0x07
  60.121 -#define DMA_CNT_4               0xC2
  60.122 -#define DMA_CNT_5               0xC6
  60.123 -#define DMA_CNT_6               0xCA
  60.124 -#define DMA_CNT_7               0xCE
  60.125 -
  60.126 -#define DMA_PAGE_0              0x87    /* DMA page registers */
  60.127 -#define DMA_PAGE_1              0x83
  60.128 -#define DMA_PAGE_2              0x81
  60.129 -#define DMA_PAGE_3              0x82
  60.130 -#define DMA_PAGE_5              0x8B
  60.131 -#define DMA_PAGE_6              0x89
  60.132 -#define DMA_PAGE_7              0x8A
  60.133 -
  60.134 -#define DMA_MODE_READ	0x44	/* I/O to memory, no autoinit, increment, single mode */
  60.135 -#define DMA_MODE_WRITE	0x48	/* memory to I/O, no autoinit, increment, single mode */
  60.136 -#define DMA_MODE_CASCADE 0xC0   /* pass thru DREQ->HRQ, DACK<-HLDA only */
  60.137 -
  60.138 -#define DMA_AUTOINIT	0x10
  60.139 -
  60.140 -
  60.141 -extern spinlock_t  dma_spin_lock;
  60.142 -
  60.143 -static __inline__ unsigned long claim_dma_lock(void)
  60.144 -{
  60.145 -	unsigned long flags;
  60.146 -	spin_lock_irqsave(&dma_spin_lock, flags);
  60.147 -	return flags;
  60.148 -}
  60.149 -
  60.150 -static __inline__ void release_dma_lock(unsigned long flags)
  60.151 -{
  60.152 -	spin_unlock_irqrestore(&dma_spin_lock, flags);
  60.153 -}
  60.154 -
  60.155 -/* enable/disable a specific DMA channel */
  60.156 -static __inline__ void enable_dma(unsigned int dmanr)
  60.157 -{
  60.158 -	if (dmanr<=3)
  60.159 -		dma_outb(dmanr,  DMA1_MASK_REG);
  60.160 -	else
  60.161 -		dma_outb(dmanr & 3,  DMA2_MASK_REG);
  60.162 -}
  60.163 -
  60.164 -static __inline__ void disable_dma(unsigned int dmanr)
  60.165 -{
  60.166 -	if (dmanr<=3)
  60.167 -		dma_outb(dmanr | 4,  DMA1_MASK_REG);
  60.168 -	else
  60.169 -		dma_outb((dmanr & 3) | 4,  DMA2_MASK_REG);
  60.170 -}
  60.171 -
  60.172 -/* Clear the 'DMA Pointer Flip Flop'.
  60.173 - * Write 0 for LSB/MSB, 1 for MSB/LSB access.
  60.174 - * Use this once to initialize the FF to a known state.
  60.175 - * After that, keep track of it. :-)
  60.176 - * --- In order to do that, the DMA routines below should ---
  60.177 - * --- only be used while holding the DMA lock ! ---
  60.178 - */
  60.179 -static __inline__ void clear_dma_ff(unsigned int dmanr)
  60.180 -{
  60.181 -	if (dmanr<=3)
  60.182 -		dma_outb(0,  DMA1_CLEAR_FF_REG);
  60.183 -	else
  60.184 -		dma_outb(0,  DMA2_CLEAR_FF_REG);
  60.185 -}
  60.186 -
  60.187 -/* set mode (above) for a specific DMA channel */
  60.188 -static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
  60.189 -{
  60.190 -	if (dmanr<=3)
  60.191 -		dma_outb(mode | dmanr,  DMA1_MODE_REG);
  60.192 -	else
  60.193 -		dma_outb(mode | (dmanr&3),  DMA2_MODE_REG);
  60.194 -}
  60.195 -
  60.196 -/* Set only the page register bits of the transfer address.
  60.197 - * This is used for successive transfers when we know the contents of
  60.198 - * the lower 16 bits of the DMA current address register, but a 64k boundary
  60.199 - * may have been crossed.
  60.200 - */
  60.201 -static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
  60.202 -{
  60.203 -	switch(dmanr) {
  60.204 -		case 0:
  60.205 -			dma_outb(pagenr, DMA_PAGE_0);
  60.206 -			break;
  60.207 -		case 1:
  60.208 -			dma_outb(pagenr, DMA_PAGE_1);
  60.209 -			break;
  60.210 -		case 2:
  60.211 -			dma_outb(pagenr, DMA_PAGE_2);
  60.212 -			break;
  60.213 -		case 3:
  60.214 -			dma_outb(pagenr, DMA_PAGE_3);
  60.215 -			break;
  60.216 -		case 5:
  60.217 -			dma_outb(pagenr & 0xfe, DMA_PAGE_5);
  60.218 -			break;
  60.219 -		case 6:
  60.220 -			dma_outb(pagenr & 0xfe, DMA_PAGE_6);
  60.221 -			break;
  60.222 -		case 7:
  60.223 -			dma_outb(pagenr & 0xfe, DMA_PAGE_7);
  60.224 -			break;
  60.225 -	}
  60.226 -}
  60.227 -
  60.228 -
  60.229 -/* Set transfer address & page bits for specific DMA channel.
  60.230 - * Assumes dma flipflop is clear.
  60.231 - */
  60.232 -static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
  60.233 -{
  60.234 -	set_dma_page(dmanr, a>>16);
  60.235 -	if (dmanr <= 3)  {
  60.236 -	    dma_outb( a & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
  60.237 -            dma_outb( (a>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
  60.238 -	}  else  {
  60.239 -	    dma_outb( (a>>1) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
  60.240 -	    dma_outb( (a>>9) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
  60.241 -	}
  60.242 -}
  60.243 -
  60.244 -
  60.245 -/* Set transfer size (max 64k for DMA1..3, 128k for DMA5..7) for
  60.246 - * a specific DMA channel.
  60.247 - * You must ensure the parameters are valid.
  60.248 - * NOTE: from a manual: "the number of transfers is one more
  60.249 - * than the initial word count"! This is taken into account.
  60.250 - * Assumes dma flip-flop is clear.
  60.251 - * NOTE 2: "count" represents _bytes_ and must be even for channels 5-7.
  60.252 - */
  60.253 -static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
  60.254 -{
  60.255 -        count--;
  60.256 -	if (dmanr <= 3)  {
  60.257 -	    dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
  60.258 -	    dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
  60.259 -        } else {
  60.260 -	    dma_outb( (count>>1) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
  60.261 -	    dma_outb( (count>>9) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
  60.262 -        }
  60.263 -}
  60.264 -
  60.265 -
  60.266 -/* Get DMA residue count. After a DMA transfer, this
  60.267 - * should return zero. Reading this while a DMA transfer is
  60.268 - * still in progress will return unpredictable results.
  60.269 - * If called before the channel has been used, it may return 1.
  60.270 - * Otherwise, it returns the number of _bytes_ left to transfer.
  60.271 - *
  60.272 - * Assumes DMA flip-flop is clear.
  60.273 - */
  60.274 -static __inline__ int get_dma_residue(unsigned int dmanr)
  60.275 -{
  60.276 -	unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE
  60.277 -					 : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE;
  60.278 -
  60.279 -	/* using short to get 16-bit wrap around */
  60.280 -	unsigned short count;
  60.281 -
  60.282 -	count = 1 + dma_inb(io_port);
  60.283 -	count += dma_inb(io_port) << 8;
  60.284 -	
  60.285 -	return (dmanr<=3)? count : (count<<1);
  60.286 -}
  60.287 -
  60.288 -
  60.289 -/* These are in kernel/dma.c: */
  60.290 -extern int request_dma(unsigned int dmanr, const char * device_id);	/* reserve a DMA channel */
  60.291 -extern void free_dma(unsigned int dmanr);	/* release it again */
  60.292 -
  60.293 -/* From PCI */
  60.294 -
  60.295 -#ifdef CONFIG_PCI
  60.296 -extern int isa_dma_bridge_buggy;
  60.297 -#else
  60.298 -#define isa_dma_bridge_buggy 	(0)
  60.299 -#endif
  60.300 -
  60.301 -#endif /* _ASM_DMA_H */
    61.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/elf.h	Fri Mar 14 15:48:09 2003 +0000
    61.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.3 @@ -1,104 +0,0 @@
    61.4 -#ifndef __ASMi386_ELF_H
    61.5 -#define __ASMi386_ELF_H
    61.6 -
    61.7 -/*
    61.8 - * ELF register definitions..
    61.9 - */
   61.10 -
   61.11 -#include <asm/ptrace.h>
   61.12 -#include <asm/user.h>
   61.13 -
   61.14 -#include <linux/utsname.h>
   61.15 -
   61.16 -typedef unsigned long elf_greg_t;
   61.17 -
   61.18 -#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
   61.19 -typedef elf_greg_t elf_gregset_t[ELF_NGREG];
   61.20 -
   61.21 -typedef struct user_i387_struct elf_fpregset_t;
   61.22 -typedef struct user_fxsr_struct elf_fpxregset_t;
   61.23 -
   61.24 -/*
   61.25 - * This is used to ensure we don't load something for the wrong architecture.
   61.26 - */
   61.27 -#define elf_check_arch(x) \
   61.28 -	(((x)->e_machine == EM_386) || ((x)->e_machine == EM_486))
   61.29 -
   61.30 -/*
   61.31 - * These are used to set parameters in the core dumps.
   61.32 - */
   61.33 -#define ELF_CLASS	ELFCLASS32
   61.34 -#define ELF_DATA	ELFDATA2LSB
   61.35 -#define ELF_ARCH	EM_386
   61.36 -
   61.37 -/* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx
   61.38 -   contains a pointer to a function which might be registered using `atexit'.
   61.39 -   This provides a mean for the dynamic linker to call DT_FINI functions for
   61.40 -   shared libraries that have been loaded before the code runs.
   61.41 -
   61.42 -   A value of 0 tells we have no such handler. 
   61.43 -
   61.44 -   We might as well make sure everything else is cleared too (except for %esp),
   61.45 -   just to make things more deterministic.
   61.46 - */
   61.47 -#define ELF_PLAT_INIT(_r)	do { \
   61.48 -	_r->ebx = 0; _r->ecx = 0; _r->edx = 0; \
   61.49 -	_r->esi = 0; _r->edi = 0; _r->ebp = 0; \
   61.50 -	_r->eax = 0; \
   61.51 -} while (0)
   61.52 -
   61.53 -#define USE_ELF_CORE_DUMP
   61.54 -#define ELF_EXEC_PAGESIZE	4096
   61.55 -
   61.56 -/* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
   61.57 -   use of this is to invoke "./ld.so someprog" to test out a new version of
   61.58 -   the loader.  We need to make sure that it is out of the way of the program
   61.59 -   that it will "exec", and that there is sufficient room for the brk.  */
   61.60 -
   61.61 -#define ELF_ET_DYN_BASE         (TASK_SIZE / 3 * 2)
   61.62 -
   61.63 -/* Wow, the "main" arch needs arch dependent functions too.. :) */
   61.64 -
   61.65 -/* regs is struct pt_regs, pr_reg is elf_gregset_t (which is
   61.66 -   now struct_user_regs, they are different) */
   61.67 -
   61.68 -#define ELF_CORE_COPY_REGS(pr_reg, regs)		\
   61.69 -	pr_reg[0] = regs->ebx;				\
   61.70 -	pr_reg[1] = regs->ecx;				\
   61.71 -	pr_reg[2] = regs->edx;				\
   61.72 -	pr_reg[3] = regs->esi;				\
   61.73 -	pr_reg[4] = regs->edi;				\
   61.74 -	pr_reg[5] = regs->ebp;				\
   61.75 -	pr_reg[6] = regs->eax;				\
   61.76 -	pr_reg[7] = regs->xds;				\
   61.77 -	pr_reg[8] = regs->xes;				\
   61.78 -	/* fake once used fs and gs selectors? */	\
   61.79 -	pr_reg[9] = regs->xds;	/* was fs and __fs */	\
   61.80 -	pr_reg[10] = regs->xds;	/* was gs and __gs */	\
   61.81 -	pr_reg[11] = regs->orig_eax;			\
   61.82 -	pr_reg[12] = regs->eip;				\
   61.83 -	pr_reg[13] = regs->xcs;				\
   61.84 -	pr_reg[14] = regs->eflags;			\
   61.85 -	pr_reg[15] = regs->esp;				\
   61.86 -	pr_reg[16] = regs->xss;
   61.87 -
   61.88 -/* This yields a mask that user programs can use to figure out what
   61.89 -   instruction set this CPU supports.  This could be done in user space,
   61.90 -   but it's not easy, and we've already done it here.  */
   61.91 -
   61.92 -#define ELF_HWCAP	(boot_cpu_data.x86_capability[0])
   61.93 -
   61.94 -/* This yields a string that ld.so will use to load implementation
   61.95 -   specific libraries for optimization.  This is more specific in
   61.96 -   intent than poking at uname or /proc/cpuinfo.
   61.97 -
   61.98 -   For the moment, we have only optimizations for the Intel generations,
   61.99 -   but that could change... */
  61.100 -
  61.101 -#define ELF_PLATFORM  (system_utsname.machine)
  61.102 -
  61.103 -#ifdef __KERNEL__
  61.104 -#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
  61.105 -#endif
  61.106 -
  61.107 -#endif
    62.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/errno.h	Fri Mar 14 15:48:09 2003 +0000
    62.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.3 @@ -1,132 +0,0 @@
    62.4 -#ifndef _I386_ERRNO_H
    62.5 -#define _I386_ERRNO_H
    62.6 -
    62.7 -#define	EPERM		 1	/* Operation not permitted */
    62.8 -#define	ENOENT		 2	/* No such file or directory */
    62.9 -#define	ESRCH		 3	/* No such process */
   62.10 -#define	EINTR		 4	/* Interrupted system call */
   62.11 -#define	EIO		 5	/* I/O error */
   62.12 -#define	ENXIO		 6	/* No such device or address */
   62.13 -#define	E2BIG		 7	/* Argument list too long */
   62.14 -#define	ENOEXEC		 8	/* Exec format error */
   62.15 -#define	EBADF		 9	/* Bad file number */
   62.16 -#define	ECHILD		10	/* No child processes */
   62.17 -#define	EAGAIN		11	/* Try again */
   62.18 -#define	ENOMEM		12	/* Out of memory */
   62.19 -#define	EACCES		13	/* Permission denied */
   62.20 -#define	EFAULT		14	/* Bad address */
   62.21 -#define	ENOTBLK		15	/* Block device required */
   62.22 -#define	EBUSY		16	/* Device or resource busy */
   62.23 -#define	EEXIST		17	/* File exists */
   62.24 -#define	EXDEV		18	/* Cross-device link */
   62.25 -#define	ENODEV		19	/* No such device */
   62.26 -#define	ENOTDIR		20	/* Not a directory */
   62.27 -#define	EISDIR		21	/* Is a directory */
   62.28 -#define	EINVAL		22	/* Invalid argument */
   62.29 -#define	ENFILE		23	/* File table overflow */
   62.30 -#define	EMFILE		24	/* Too many open files */
   62.31 -#define	ENOTTY		25	/* Not a typewriter */
   62.32 -#define	ETXTBSY		26	/* Text file busy */
   62.33 -#define	EFBIG		27	/* File too large */
   62.34 -#define	ENOSPC		28	/* No space left on device */
   62.35 -#define	ESPIPE		29	/* Illegal seek */
   62.36 -#define	EROFS		30	/* Read-only file system */
   62.37 -#define	EMLINK		31	/* Too many links */
   62.38 -#define	EPIPE		32	/* Broken pipe */
   62.39 -#define	EDOM		33	/* Math argument out of domain of func */
   62.40 -#define	ERANGE		34	/* Math result not representable */
   62.41 -#define	EDEADLK		35	/* Resource deadlock would occur */
   62.42 -#define	ENAMETOOLONG	36	/* File name too long */
   62.43 -#define	ENOLCK		37	/* No record locks available */
   62.44 -#define	ENOSYS		38	/* Function not implemented */
   62.45 -#define	ENOTEMPTY	39	/* Directory not empty */
   62.46 -#define	ELOOP		40	/* Too many symbolic links encountered */
   62.47 -#define	EWOULDBLOCK	EAGAIN	/* Operation would block */
   62.48 -#define	ENOMSG		42	/* No message of desired type */
   62.49 -#define	EIDRM		43	/* Identifier removed */
   62.50 -#define	ECHRNG		44	/* Channel number out of range */
   62.51 -#define	EL2NSYNC	45	/* Level 2 not synchronized */
   62.52 -#define	EL3HLT		46	/* Level 3 halted */
   62.53 -#define	EL3RST		47	/* Level 3 reset */
   62.54 -#define	ELNRNG		48	/* Link number out of range */
   62.55 -#define	EUNATCH		49	/* Protocol driver not attached */
   62.56 -#define	ENOCSI		50	/* No CSI structure available */
   62.57 -#define	EL2HLT		51	/* Level 2 halted */
   62.58 -#define	EBADE		52	/* Invalid exchange */
   62.59 -#define	EBADR		53	/* Invalid request descriptor */
   62.60 -#define	EXFULL		54	/* Exchange full */
   62.61 -#define	ENOANO		55	/* No anode */
   62.62 -#define	EBADRQC		56	/* Invalid request code */
   62.63 -#define	EBADSLT		57	/* Invalid slot */
   62.64 -
   62.65 -#define	EDEADLOCK	EDEADLK
   62.66 -
   62.67 -#define	EBFONT		59	/* Bad font file format */
   62.68 -#define	ENOSTR		60	/* Device not a stream */
   62.69 -#define	ENODATA		61	/* No data available */
   62.70 -#define	ETIME		62	/* Timer expired */
   62.71 -#define	ENOSR		63	/* Out of streams resources */
   62.72 -#define	ENONET		64	/* Machine is not on the network */
   62.73 -#define	ENOPKG		65	/* Package not installed */
   62.74 -#define	EREMOTE		66	/* Object is remote */
   62.75 -#define	ENOLINK		67	/* Link has been severed */
   62.76 -#define	EADV		68	/* Advertise error */
   62.77 -#define	ESRMNT		69	/* Srmount error */
   62.78 -#define	ECOMM		70	/* Communication error on send */
   62.79 -#define	EPROTO		71	/* Protocol error */
   62.80 -#define	EMULTIHOP	72	/* Multihop attempted */
   62.81 -#define	EDOTDOT		73	/* RFS specific error */
   62.82 -#define	EBADMSG		74	/* Not a data message */
   62.83 -#define	EOVERFLOW	75	/* Value too large for defined data type */
   62.84 -#define	ENOTUNIQ	76	/* Name not unique on network */
   62.85 -#define	EBADFD		77	/* File descriptor in bad state */
   62.86 -#define	EREMCHG		78	/* Remote address changed */
   62.87 -#define	ELIBACC		79	/* Can not access a needed shared library */
   62.88 -#define	ELIBBAD		80	/* Accessing a corrupted shared library */
   62.89 -#define	ELIBSCN		81	/* .lib section in a.out corrupted */
   62.90 -#define	ELIBMAX		82	/* Attempting to link in too many shared libraries */
   62.91 -#define	ELIBEXEC	83	/* Cannot exec a shared library directly */
   62.92 -#define	EILSEQ		84	/* Illegal byte sequence */
   62.93 -#define	ERESTART	85	/* Interrupted system call should be restarted */
   62.94 -#define	ESTRPIPE	86	/* Streams pipe error */
   62.95 -#define	EUSERS		87	/* Too many users */
   62.96 -#define	ENOTSOCK	88	/* Socket operation on non-socket */
   62.97 -#define	EDESTADDRREQ	89	/* Destination address required */
   62.98 -#define	EMSGSIZE	90	/* Message too long */
   62.99 -#define	EPROTOTYPE	91	/* Protocol wrong type for socket */
  62.100 -#define	ENOPROTOOPT	92	/* Protocol not available */
  62.101 -#define	EPROTONOSUPPORT	93	/* Protocol not supported */
  62.102 -#define	ESOCKTNOSUPPORT	94	/* Socket type not supported */
  62.103 -#define	EOPNOTSUPP	95	/* Operation not supported on transport endpoint */
  62.104 -#define	EPFNOSUPPORT	96	/* Protocol family not supported */
  62.105 -#define	EAFNOSUPPORT	97	/* Address family not supported by protocol */
  62.106 -#define	EADDRINUSE	98	/* Address already in use */
  62.107 -#define	EADDRNOTAVAIL	99	/* Cannot assign requested address */
  62.108 -#define	ENETDOWN	100	/* Network is down */
  62.109 -#define	ENETUNREACH	101	/* Network is unreachable */
  62.110 -#define	ENETRESET	102	/* Network dropped connection because of reset */
  62.111 -#define	ECONNABORTED	103	/* Software caused connection abort */
  62.112 -#define	ECONNRESET	104	/* Connection reset by peer */
  62.113 -#define	ENOBUFS		105	/* No buffer space available */
  62.114 -#define	EISCONN		106	/* Transport endpoint is already connected */
  62.115 -#define	ENOTCONN	107	/* Transport endpoint is not connected */
  62.116 -#define	ESHUTDOWN	108	/* Cannot send after transport endpoint shutdown */
  62.117 -#define	ETOOMANYREFS	109	/* Too many references: cannot splice */
  62.118 -#define	ETIMEDOUT	110	/* Connection timed out */
  62.119 -#define	ECONNREFUSED	111	/* Connection refused */
  62.120 -#define	EHOSTDOWN	112	/* Host is down */
  62.121 -#define	EHOSTUNREACH	113	/* No route to host */
  62.122 -#define	EALREADY	114	/* Operation already in progress */
  62.123 -#define	EINPROGRESS	115	/* Operation now in progress */
  62.124 -#define	ESTALE		116	/* Stale NFS file handle */
  62.125 -#define	EUCLEAN		117	/* Structure needs cleaning */
  62.126 -#define	ENOTNAM		118	/* Not a XENIX named type file */
  62.127 -#define	ENAVAIL		119	/* No XENIX semaphores available */
  62.128 -#define	EISNAM		120	/* Is a named type file */
  62.129 -#define	EREMOTEIO	121	/* Remote I/O error */
  62.130 -#define	EDQUOT		122	/* Quota exceeded */
  62.131 -
  62.132 -#define	ENOMEDIUM	123	/* No medium found */
  62.133 -#define	EMEDIUMTYPE	124	/* Wrong medium type */
  62.134 -
  62.135 -#endif
    63.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/fcntl.h	Fri Mar 14 15:48:09 2003 +0000
    63.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.3 @@ -1,87 +0,0 @@
    63.4 -#ifndef _I386_FCNTL_H
    63.5 -#define _I386_FCNTL_H
    63.6 -
    63.7 -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
    63.8 -   located on an ext2 file system */
    63.9 -#define O_ACCMODE	   0003
   63.10 -#define O_RDONLY	     00
   63.11 -#define O_WRONLY	     01
   63.12 -#define O_RDWR		     02
   63.13 -#define O_CREAT		   0100	/* not fcntl */
   63.14 -#define O_EXCL		   0200	/* not fcntl */
   63.15 -#define O_NOCTTY	   0400	/* not fcntl */
   63.16 -#define O_TRUNC		  01000	/* not fcntl */
   63.17 -#define O_APPEND	  02000
   63.18 -#define O_NONBLOCK	  04000
   63.19 -#define O_NDELAY	O_NONBLOCK
   63.20 -#define O_SYNC		 010000
   63.21 -#define FASYNC		 020000	/* fcntl, for BSD compatibility */
   63.22 -#define O_DIRECT	 040000	/* direct disk access hint */
   63.23 -#define O_LARGEFILE	0100000
   63.24 -#define O_DIRECTORY	0200000	/* must be a directory */
   63.25 -#define O_NOFOLLOW	0400000 /* don't follow links */
   63.26 -
   63.27 -#define F_DUPFD		0	/* dup */
   63.28 -#define F_GETFD		1	/* get close_on_exec */
   63.29 -#define F_SETFD		2	/* set/clear close_on_exec */
   63.30 -#define F_GETFL		3	/* get file->f_flags */
   63.31 -#define F_SETFL		4	/* set file->f_flags */
   63.32 -#define F_GETLK		5
   63.33 -#define F_SETLK		6
   63.34 -#define F_SETLKW	7
   63.35 -
   63.36 -#define F_SETOWN	8	/*  for sockets. */
   63.37 -#define F_GETOWN	9	/*  for sockets. */
   63.38 -#define F_SETSIG	10	/*  for sockets. */
   63.39 -#define F_GETSIG	11	/*  for sockets. */
   63.40 -
   63.41 -#define F_GETLK64	12	/*  using 'struct flock64' */
   63.42 -#define F_SETLK64	13
   63.43 -#define F_SETLKW64	14
   63.44 -
   63.45 -/* for F_[GET|SET]FL */
   63.46 -#define FD_CLOEXEC	1	/* actually anything with low bit set goes */
   63.47 -
   63.48 -/* for posix fcntl() and lockf() */
   63.49 -#define F_RDLCK		0
   63.50 -#define F_WRLCK		1
   63.51 -#define F_UNLCK		2
   63.52 -
   63.53 -/* for old implementation of bsd flock () */
   63.54 -#define F_EXLCK		4	/* or 3 */
   63.55 -#define F_SHLCK		8	/* or 4 */
   63.56 -
   63.57 -/* for leases */
   63.58 -#define F_INPROGRESS	16
   63.59 -
   63.60 -/* operations for bsd flock(), also used by the kernel implementation */
   63.61 -#define LOCK_SH		1	/* shared lock */
   63.62 -#define LOCK_EX		2	/* exclusive lock */
   63.63 -#define LOCK_NB		4	/* or'd with one of the above to prevent
   63.64 -				   blocking */
   63.65 -#define LOCK_UN		8	/* remove lock */
   63.66 -
   63.67 -#define LOCK_MAND	32	/* This is a mandatory flock */
   63.68 -#define LOCK_READ	64	/* ... Which allows concurrent read operations */
   63.69 -#define LOCK_WRITE	128	/* ... Which allows concurrent write operations */
   63.70 -#define LOCK_RW		192	/* ... Which allows concurrent read & write ops */
   63.71 -
   63.72 -struct flock {
   63.73 -	short l_type;
   63.74 -	short l_whence;
   63.75 -	off_t l_start;
   63.76 -	off_t l_len;
   63.77 -	pid_t l_pid;
   63.78 -};
   63.79 -
   63.80 -struct flock64 {
   63.81 -	short  l_type;
   63.82 -	short  l_whence;
   63.83 -	loff_t l_start;
   63.84 -	loff_t l_len;
   63.85 -	pid_t  l_pid;
   63.86 -};
   63.87 -
   63.88 -#define F_LINUX_SPECIFIC_BASE	1024
   63.89 -
   63.90 -#endif
    64.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/floppy.h	Fri Mar 14 15:48:09 2003 +0000
    64.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.3 @@ -1,320 +0,0 @@
    64.4 -/*
    64.5 - * Architecture specific parts of the Floppy driver
    64.6 - *
    64.7 - * This file is subject to the terms and conditions of the GNU General Public
    64.8 - * License.  See the file "COPYING" in the main directory of this archive
    64.9 - * for more details.
   64.10 - *
   64.11 - * Copyright (C) 1995
   64.12 - */
   64.13 -#ifndef __ASM_I386_FLOPPY_H
   64.14 -#define __ASM_I386_FLOPPY_H
   64.15 -
   64.16 -#include <linux/vmalloc.h>
   64.17 -
   64.18 -
   64.19 -/*
   64.20 - * The DMA channel used by the floppy controller cannot access data at
   64.21 - * addresses >= 16MB
   64.22 - *
   64.23 - * Went back to the 1MB limit, as some people had problems with the floppy
   64.24 - * driver otherwise. It doesn't matter much for performance anyway, as most
   64.25 - * floppy accesses go through the track buffer.
   64.26 - */
   64.27 -#define _CROSS_64KB(a,s,vdma) \
   64.28 -(!vdma && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
   64.29 -
   64.30 -#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1)
   64.31 -
   64.32 -
   64.33 -#define SW fd_routine[use_virtual_dma&1]
   64.34 -#define CSW fd_routine[can_use_virtual_dma & 1]
   64.35 -
   64.36 -
   64.37 -#define fd_inb(port)			inb_p(port)
   64.38 -#define fd_outb(port,value)		outb_p(port,value)
   64.39 -
   64.40 -#define fd_request_dma()        CSW._request_dma(FLOPPY_DMA,"floppy")
   64.41 -#define fd_free_dma()           CSW._free_dma(FLOPPY_DMA)
   64.42 -#define fd_enable_irq()         enable_irq(FLOPPY_IRQ)
   64.43 -#define fd_disable_irq()        disable_irq(FLOPPY_IRQ)
   64.44 -#define fd_free_irq()		free_irq(FLOPPY_IRQ, NULL)
   64.45 -#define fd_get_dma_residue()    SW._get_dma_residue(FLOPPY_DMA)
   64.46 -#define fd_dma_mem_alloc(size)	SW._dma_mem_alloc(size)
   64.47 -#define fd_dma_setup(addr, size, mode, io) SW._dma_setup(addr, size, mode, io)
   64.48 -
   64.49 -#define FLOPPY_CAN_FALLBACK_ON_NODMA
   64.50 -
   64.51 -static int virtual_dma_count;
   64.52 -static int virtual_dma_residue;
   64.53 -static char *virtual_dma_addr;
   64.54 -static int virtual_dma_mode;
   64.55 -static int doing_pdma;
   64.56 -
   64.57 -static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
   64.58 -{
   64.59 -	register unsigned char st;
   64.60 -
   64.61 -#undef TRACE_FLPY_INT
   64.62 -#define NO_FLOPPY_ASSEMBLER
   64.63 -
   64.64 -#ifdef TRACE_FLPY_INT
   64.65 -	static int calls=0;
   64.66 -	static int bytes=0;
   64.67 -	static int dma_wait=0;
   64.68 -#endif
   64.69 -	if(!doing_pdma) {
   64.70 -		floppy_interrupt(irq, dev_id, regs);
   64.71 -		return;
   64.72 -	}
   64.73 -
   64.74 -#ifdef TRACE_FLPY_INT
   64.75 -	if(!calls)
   64.76 -		bytes = virtual_dma_count;
   64.77 -#endif
   64.78 -
   64.79 -#ifndef NO_FLOPPY_ASSEMBLER
   64.80 -	__asm__ (
   64.81 -       "testl %1,%1"
   64.82 -	"je 3f"
   64.83 -"1:	inb %w4,%b0"
   64.84 -	"andb $160,%b0"
   64.85 -	"cmpb $160,%b0"
   64.86 -	"jne 2f"
   64.87 -	"incw %w4"
   64.88 -	"testl %3,%3"
   64.89 -	"jne 4f"
   64.90 -	"inb %w4,%b0"
   64.91 -	"movb %0,(%2)"
   64.92 -	"jmp 5f"
   64.93 -"4:    	movb (%2),%0"
   64.94 -	"outb %b0,%w4"
   64.95 -"5:	decw %w4"
   64.96 -	"outb %0,$0x80"
   64.97 -	"decl %1"
   64.98 -	"incl %2"
   64.99 -	"testl %1,%1"
  64.100 -	"jne 1b"
  64.101 -"3:	inb %w4,%b0"
  64.102 -"2:	"
  64.103 -       : "=a" ((char) st), 
  64.104 -       "=c" ((long) virtual_dma_count), 
  64.105 -       "=S" ((long) virtual_dma_addr)
  64.106 -       : "b" ((long) virtual_dma_mode),
  64.107 -       "d" ((short) virtual_dma_port+4), 
  64.108 -       "1" ((long) virtual_dma_count),
  64.109 -       "2" ((long) virtual_dma_addr));
  64.110 -#else	
  64.111 -	{
  64.112 -		register int lcount;
  64.113 -		register char *lptr;
  64.114 -
  64.115 -		st = 1;
  64.116 -		for(lcount=virtual_dma_count, lptr=virtual_dma_addr; 
  64.117 -		    lcount; lcount--, lptr++) {
  64.118 -			st=inb(virtual_dma_port+4) & 0xa0 ;
  64.119 -			if(st != 0xa0) 
  64.120 -				break;
  64.121 -			if(virtual_dma_mode)
  64.122 -				outb_p(*lptr, virtual_dma_port+5);
  64.123 -			else
  64.124 -				*lptr = inb_p(virtual_dma_port+5);
  64.125 -		}
  64.126 -		virtual_dma_count = lcount;
  64.127 -		virtual_dma_addr = lptr;
  64.128 -		st = inb(virtual_dma_port+4);
  64.129 -	}
  64.130 -#endif
  64.131 -
  64.132 -#ifdef TRACE_FLPY_INT
  64.133 -	calls++;
  64.134 -#endif
  64.135 -	if(st == 0x20)
  64.136 -		return;
  64.137 -	if(!(st & 0x20)) {
  64.138 -		virtual_dma_residue += virtual_dma_count;
  64.139 -		virtual_dma_count=0;
  64.140 -#ifdef TRACE_FLPY_INT
  64.141 -		printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", 
  64.142 -		       virtual_dma_count, virtual_dma_residue, calls, bytes,
  64.143 -		       dma_wait);
  64.144 -		calls = 0;
  64.145 -		dma_wait=0;
  64.146 -#endif
  64.147 -		doing_pdma = 0;
  64.148 -		floppy_interrupt(irq, dev_id, regs);
  64.149 -		return;
  64.150 -	}
  64.151 -#ifdef TRACE_FLPY_INT
  64.152 -	if(!virtual_dma_count)
  64.153 -		dma_wait++;
  64.154 -#endif
  64.155 -}
  64.156 -
  64.157 -static void fd_disable_dma(void)
  64.158 -{
  64.159 -	if(! (can_use_virtual_dma & 1))
  64.160 -		disable_dma(FLOPPY_DMA);
  64.161 -	doing_pdma = 0;
  64.162 -	virtual_dma_residue += virtual_dma_count;
  64.163 -	virtual_dma_count=0;
  64.164 -}
  64.165 -
  64.166 -static int vdma_request_dma(unsigned int dmanr, const char * device_id)
  64.167 -{
  64.168 -	return 0;
  64.169 -}
  64.170 -
  64.171 -static void vdma_nop(unsigned int dummy)
  64.172 -{
  64.173 -}
  64.174 -
  64.175 -
  64.176 -static int vdma_get_dma_residue(unsigned int dummy)
  64.177 -{
  64.178 -	return virtual_dma_count + virtual_dma_residue;
  64.179 -}
  64.180 -
  64.181 -
  64.182 -static int fd_request_irq(void)
  64.183 -{
  64.184 -	if(can_use_virtual_dma)
  64.185 -		return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
  64.186 -						   "floppy", NULL);
  64.187 -	else
  64.188 -		return request_irq(FLOPPY_IRQ, floppy_interrupt,
  64.189 -						   SA_INTERRUPT|SA_SAMPLE_RANDOM,
  64.190 -						   "floppy", NULL);	
  64.191 -
  64.192 -}
  64.193 -
  64.194 -static unsigned long dma_mem_alloc(unsigned long size)
  64.195 -{
  64.196 -	return __get_dma_pages(GFP_KERNEL,get_order(size));
  64.197 -}
  64.198 -
  64.199 -
  64.200 -static unsigned long vdma_mem_alloc(unsigned long size)
  64.201 -{
  64.202 -	return (unsigned long) vmalloc(size);
  64.203 -
  64.204 -}
  64.205 -
  64.206 -#define nodma_mem_alloc(size) vdma_mem_alloc(size)
  64.207 -
  64.208 -static void _fd_dma_mem_free(unsigned long addr, unsigned long size)
  64.209 -{
  64.210 -	if((unsigned int) addr >= (unsigned int) high_memory)
  64.211 -		return vfree((void *)addr);
  64.212 -	else
  64.213 -		free_pages(addr, get_order(size));		
  64.214 -}
  64.215 -
  64.216 -#define fd_dma_mem_free(addr, size)  _fd_dma_mem_free(addr, size) 
  64.217 -
  64.218 -static void _fd_chose_dma_mode(char *addr, unsigned long size)
  64.219 -{
  64.220 -	if(can_use_virtual_dma == 2) {
  64.221 -		if((unsigned int) addr >= (unsigned int) high_memory ||
  64.222 -		   virt_to_bus(addr) >= 0x1000000 ||
  64.223 -		   _CROSS_64KB(addr, size, 0))
  64.224 -			use_virtual_dma = 1;
  64.225 -		else
  64.226 -			use_virtual_dma = 0;
  64.227 -	} else {
  64.228 -		use_virtual_dma = can_use_virtual_dma & 1;
  64.229 -	}
  64.230 -}
  64.231 -
  64.232 -#define fd_chose_dma_mode(addr, size) _fd_chose_dma_mode(addr, size)
  64.233 -
  64.234 -
  64.235 -static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
  64.236 -{
  64.237 -	doing_pdma = 1;
  64.238 -	virtual_dma_port = io;
  64.239 -	virtual_dma_mode = (mode  == DMA_MODE_WRITE);
  64.240 -	virtual_dma_addr = addr;
  64.241 -	virtual_dma_count = size;
  64.242 -	virtual_dma_residue = 0;
  64.243 -	return 0;
  64.244 -}
  64.245 -
  64.246 -static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
  64.247 -{
  64.248 -#ifdef FLOPPY_SANITY_CHECK
  64.249 -	if (CROSS_64KB(addr, size)) {
  64.250 -		printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size);
  64.251 -		return -1;
  64.252 -	}
  64.253 -#endif
  64.254 -	/* actual, physical DMA */
  64.255 -	doing_pdma = 0;
  64.256 -	clear_dma_ff(FLOPPY_DMA);
  64.257 -	set_dma_mode(FLOPPY_DMA,mode);
  64.258 -	set_dma_addr(FLOPPY_DMA,virt_to_bus(addr));
  64.259 -	set_dma_count(FLOPPY_DMA,size);
  64.260 -	enable_dma(FLOPPY_DMA);
  64.261 -	return 0;
  64.262 -}
  64.263 -
  64.264 -struct fd_routine_l {
  64.265 -	int (*_request_dma)(unsigned int dmanr, const char * device_id);
  64.266 -	void (*_free_dma)(unsigned int dmanr);
  64.267 -	int (*_get_dma_residue)(unsigned int dummy);
  64.268 -	unsigned long (*_dma_mem_alloc) (unsigned long size);
  64.269 -	int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
  64.270 -} fd_routine[] = {
  64.271 -	{
  64.272 -		request_dma,
  64.273 -		free_dma,
  64.274 -		get_dma_residue,
  64.275 -		dma_mem_alloc,
  64.276 -		hard_dma_setup
  64.277 -	},
  64.278 -	{
  64.279 -		vdma_request_dma,
  64.280 -		vdma_nop,
  64.281 -		vdma_get_dma_residue,
  64.282 -		vdma_mem_alloc,
  64.283 -		vdma_dma_setup
  64.284 -	}
  64.285 -};
  64.286 -
  64.287 -
  64.288 -static int FDC1 = 0x3f0;
  64.289 -static int FDC2 = -1;
  64.290 -
  64.291 -/*
  64.292 - * Floppy types are stored in the rtc's CMOS RAM and so rtc_lock
  64.293 - * is needed to prevent corrupted CMOS RAM in case "insmod floppy"
  64.294 - * coincides with another rtc CMOS user.		Paul G.
  64.295 - */
  64.296 -#define FLOPPY0_TYPE	({				\
  64.297 -	unsigned long flags;				\
  64.298 -	unsigned char val;				\
  64.299 -	spin_lock_irqsave(&rtc_lock, flags);		\
  64.300 -	val = (CMOS_READ(0x10) >> 4) & 15;		\
  64.301 -	spin_unlock_irqrestore(&rtc_lock, flags);	\
  64.302 -	val;						\
  64.303 -})
  64.304 -
  64.305 -#define FLOPPY1_TYPE	({				\
  64.306 -	unsigned long flags;				\
  64.307 -	unsigned char val;				\
  64.308 -	spin_lock_irqsave(&rtc_lock, flags);		\
  64.309 -	val = CMOS_READ(0x10) & 15;			\
  64.310 -	spin_unlock_irqrestore(&rtc_lock, flags);	\
  64.311 -	val;						\
  64.312 -})
  64.313 -
  64.314 -#define N_FDC 2
  64.315 -#define N_DRIVE 8
  64.316 -
  64.317 -#define FLOPPY_MOTOR_MASK 0xf0
  64.318 -
  64.319 -#define AUTO_DMA
  64.320 -
  64.321 -#define EXTRA_FLOPPY_PARAMS
  64.322 -
  64.323 -#endif /* __ASM_I386_FLOPPY_H */
    65.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hardirq.h	Fri Mar 14 15:48:09 2003 +0000
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,91 +0,0 @@
    65.4 -#ifndef __ASM_HARDIRQ_H
    65.5 -#define __ASM_HARDIRQ_H
    65.6 -
    65.7 -#include <linux/config.h>
    65.8 -#include <linux/threads.h>
    65.9 -#include <linux/irq.h>
   65.10 -
   65.11 -/* assembly code in softirq.h is sensitive to the offsets of these fields */
   65.12 -typedef struct {
   65.13 -	unsigned int __softirq_pending;
   65.14 -	unsigned int __local_irq_count;
   65.15 -	unsigned int __local_bh_count;
   65.16 -	unsigned int __syscall_count;
   65.17 -	struct task_struct * __ksoftirqd_task; /* waitqueue is too large */
   65.18 -	unsigned int __nmi_count;	/* arch dependent */
   65.19 -} ____cacheline_aligned irq_cpustat_t;
   65.20 -
   65.21 -#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
   65.22 -
   65.23 -/*
   65.24 - * Are we in an interrupt context? Either doing bottom half
   65.25 - * or hardware interrupt processing?
   65.26 - */
   65.27 -#define in_interrupt() ({ int __cpu = smp_processor_id(); \
   65.28 -	(local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
   65.29 -
   65.30 -#define in_irq() (local_irq_count(smp_processor_id()) != 0)
   65.31 -
   65.32 -#ifndef CONFIG_SMP
   65.33 -
   65.34 -#define hardirq_trylock(cpu)	(local_irq_count(cpu) == 0)
   65.35 -#define hardirq_endlock(cpu)	do { } while (0)
   65.36 -
   65.37 -#define irq_enter(cpu, irq)	(local_irq_count(cpu)++)
   65.38 -#define irq_exit(cpu, irq)	(local_irq_count(cpu)--)
   65.39 -
   65.40 -#define synchronize_irq()	barrier()
   65.41 -
   65.42 -#else
   65.43 -
   65.44 -#include <asm/atomic.h>
   65.45 -#include <asm/smp.h>
   65.46 -
   65.47 -extern unsigned char global_irq_holder;
   65.48 -extern unsigned volatile long global_irq_lock; /* long for set_bit -RR */
   65.49 -
   65.50 -static inline int irqs_running (void)
   65.51 -{
   65.52 -	int i;
   65.53 -
   65.54 -	for (i = 0; i < smp_num_cpus; i++)
   65.55 -		if (local_irq_count(i))
   65.56 -			return 1;
   65.57 -	return 0;
   65.58 -}
   65.59 -
   65.60 -static inline void release_irqlock(int cpu)
   65.61 -{
   65.62 -	/* if we didn't own the irq lock, just ignore.. */
   65.63 -	if (global_irq_holder == (unsigned char) cpu) {
   65.64 -		global_irq_holder = NO_PROC_ID;
   65.65 -		clear_bit(0,&global_irq_lock);
   65.66 -	}
   65.67 -}
   65.68 -
   65.69 -static inline void irq_enter(int cpu, int irq)
   65.70 -{
   65.71 -	++local_irq_count(cpu);
   65.72 -
   65.73 -	while (test_bit(0,&global_irq_lock)) {
   65.74 -		cpu_relax();
   65.75 -	}
   65.76 -}
   65.77 -
   65.78 -static inline void irq_exit(int cpu, int irq)
   65.79 -{
   65.80 -	--local_irq_count(cpu);
   65.81 -}
   65.82 -
   65.83 -static inline int hardirq_trylock(int cpu)
   65.84 -{
   65.85 -	return !local_irq_count(cpu) && !test_bit(0,&global_irq_lock);
   65.86 -}
   65.87 -
   65.88 -#define hardirq_endlock(cpu)	do { } while (0)
   65.89 -
   65.90 -extern void synchronize_irq(void);
   65.91 -
   65.92 -#endif /* CONFIG_SMP */
   65.93 -
   65.94 -#endif /* __ASM_HARDIRQ_H */
    66.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hdreg.h	Fri Mar 14 15:48:09 2003 +0000
    66.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.3 @@ -1,13 +0,0 @@
    66.4 -/*
    66.5 - *  linux/include/asm-i386/hdreg.h
    66.6 - *
    66.7 - *  Copyright (C) 1994-1996  Linus Torvalds & authors
    66.8 - */
    66.9 -
   66.10 -#ifndef __ASMi386_HDREG_H
   66.11 -#define __ASMi386_HDREG_H
   66.12 -
   66.13 -//typedef unsigned short ide_ioreg_t;
   66.14 -typedef unsigned long ide_ioreg_t;
   66.15 -
   66.16 -#endif /* __ASMi386_HDREG_H */
    67.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/i387.h	Fri Mar 14 15:48:09 2003 +0000
    67.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.3 @@ -1,89 +0,0 @@
    67.4 -/*
    67.5 - * include/asm-i386/i387.h
    67.6 - *
    67.7 - * Copyright (C) 1994 Linus Torvalds
    67.8 - *
    67.9 - * Pentium III FXSR, SSE support
   67.10 - * General FPU state handling cleanups
   67.11 - *	Gareth Hughes <gareth@valinux.com>, May 2000
   67.12 - */
   67.13 -
   67.14 -#ifndef __ASM_I386_I387_H
   67.15 -#define __ASM_I386_I387_H
   67.16 -
   67.17 -#include <linux/sched.h>
   67.18 -#include <asm/processor.h>
   67.19 -#include <asm/sigcontext.h>
   67.20 -#include <asm/user.h>
   67.21 -
   67.22 -extern void init_fpu(void);
   67.23 -/*
   67.24 - * FPU lazy state save handling...
   67.25 - */
   67.26 -extern void save_init_fpu( struct task_struct *tsk );
   67.27 -extern void restore_fpu( struct task_struct *tsk );
   67.28 -
   67.29 -extern void kernel_fpu_begin(void);
   67.30 -#define kernel_fpu_end() stts()
   67.31 -
   67.32 -
   67.33 -#define unlazy_fpu( tsk ) do { \
   67.34 -	if ( tsk->flags & PF_USEDFPU ) \
   67.35 -		save_init_fpu( tsk ); \
   67.36 -} while (0)
   67.37 -
   67.38 -#define clear_fpu( tsk ) do { \
   67.39 -	if ( tsk->flags & PF_USEDFPU ) { \
   67.40 -		asm volatile("fwait"); \
   67.41 -		tsk->flags &= ~PF_USEDFPU; \
   67.42 -		stts(); \
   67.43 -	} \
   67.44 -} while (0)
   67.45 -
   67.46 -/*
   67.47 - * FPU state interaction...
   67.48 - */
   67.49 -extern unsigned short get_fpu_cwd( struct task_struct *tsk );
   67.50 -extern unsigned short get_fpu_swd( struct task_struct *tsk );
   67.51 -extern unsigned short get_fpu_twd( struct task_struct *tsk );
   67.52 -extern unsigned short get_fpu_mxcsr( struct task_struct *tsk );
   67.53 -
   67.54 -extern void set_fpu_cwd( struct task_struct *tsk, unsigned short cwd );
   67.55 -extern void set_fpu_swd( struct task_struct *tsk, unsigned short swd );
   67.56 -extern void set_fpu_twd( struct task_struct *tsk, unsigned short twd );
   67.57 -extern void set_fpu_mxcsr( struct task_struct *tsk, unsigned short mxcsr );
   67.58 -
   67.59 -#define load_mxcsr( val ) do { \
   67.60 -	unsigned long __mxcsr = ((unsigned long)(val) & 0xffbf); \
   67.61 -	asm volatile( "ldmxcsr %0" : : "m" (__mxcsr) ); \
   67.62 -} while (0)
   67.63 -
   67.64 -/*
   67.65 - * Signal frame handlers...
   67.66 - */
   67.67 -extern int save_i387( struct _fpstate *buf );
   67.68 -extern int restore_i387( struct _fpstate *buf );
   67.69 -
   67.70 -/*
   67.71 - * ptrace request handers...
   67.72 - */
   67.73 -extern int get_fpregs( struct user_i387_struct *buf,
   67.74 -		       struct task_struct *tsk );
   67.75 -extern int set_fpregs( struct task_struct *tsk,
   67.76 -		       struct user_i387_struct *buf );
   67.77 -
   67.78 -extern int get_fpxregs( struct user_fxsr_struct *buf,
   67.79 -			struct task_struct *tsk );
   67.80 -extern int set_fpxregs( struct task_struct *tsk,
   67.81 -			struct user_fxsr_struct *buf );
   67.82 -extern void load_empty_fpu(struct task_struct *);
   67.83 -
   67.84 -/*
   67.85 - * FPU state for core dumps...
   67.86 - */
   67.87 -extern int dump_fpu( struct pt_regs *regs,
   67.88 -		     struct user_i387_struct *fpu );
   67.89 -extern int dump_extended_fpu( struct pt_regs *regs,
   67.90 -			      struct user_fxsr_struct *fpu );
   67.91 -
   67.92 -#endif /* __ASM_I386_I387_H */
    68.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ide.h	Fri Mar 14 15:48:09 2003 +0000
    68.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.3 @@ -1,92 +0,0 @@
    68.4 -/*
    68.5 - *  linux/include/asm-i386/ide.h
    68.6 - *
    68.7 - *  Copyright (C) 1994-1996  Linus Torvalds & authors
    68.8 - */
    68.9 -
   68.10 -/*
   68.11 - *  This file contains the i386 architecture specific IDE code.
   68.12 - */
   68.13 -
   68.14 -#ifndef __ASMi386_IDE_H
   68.15 -#define __ASMi386_IDE_H
   68.16 -
   68.17 -#ifdef __KERNEL__
   68.18 -
   68.19 -#include <linux/config.h>
   68.20 -
   68.21 -#ifndef MAX_HWIFS
   68.22 -# ifdef CONFIG_BLK_DEV_IDEPCI
   68.23 -#define MAX_HWIFS	10
   68.24 -# else
   68.25 -#define MAX_HWIFS	6
   68.26 -# endif
   68.27 -#endif
   68.28 -
   68.29 -static __inline__ int ide_default_irq(ide_ioreg_t base)
   68.30 -{
   68.31 -	switch (base) {
   68.32 -		case 0x1f0: return 14;
   68.33 -		case 0x170: return 15;
   68.34 -		case 0x1e8: return 11;
   68.35 -		case 0x168: return 10;
   68.36 -		case 0x1e0: return 8;
   68.37 -		case 0x160: return 12;
   68.38 -		default:
   68.39 -			return 0;
   68.40 -	}
   68.41 -}
   68.42 -
   68.43 -static __inline__ ide_ioreg_t ide_default_io_base(int index)
   68.44 -{
   68.45 -	switch (index) {
   68.46 -		case 0:	return 0x1f0;
   68.47 -		case 1:	return 0x170;
   68.48 -		case 2: return 0x1e8;
   68.49 -		case 3: return 0x168;
   68.50 -		case 4: return 0x1e0;
   68.51 -		case 5: return 0x160;
   68.52 -		default:
   68.53 -			return 0;
   68.54 -	}
   68.55 -}
   68.56 -
   68.57 -static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
   68.58 -{
   68.59 -	ide_ioreg_t reg = data_port;
   68.60 -	int i;
   68.61 -
   68.62 -	for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
   68.63 -		hw->io_ports[i] = reg;
   68.64 -		reg += 1;
   68.65 -	}
   68.66 -	if (ctrl_port) {
   68.67 -		hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
   68.68 -	} else {
   68.69 -		hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206;
   68.70 -	}
   68.71 -	if (irq != NULL)
   68.72 -		*irq = 0;
   68.73 -	hw->io_ports[IDE_IRQ_OFFSET] = 0;
   68.74 -}
   68.75 -
   68.76 -static __inline__ void ide_init_default_hwifs(void)
   68.77 -{
   68.78 -#ifndef CONFIG_BLK_DEV_IDEPCI
   68.79 -	hw_regs_t hw;
   68.80 -	int index;
   68.81 -
   68.82 -	for(index = 0; index < MAX_HWIFS; index++) {
   68.83 -		memset(&hw, 0, sizeof hw);
   68.84 -		ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
   68.85 -		hw.irq = ide_default_irq(ide_default_io_base(index));
   68.86 -		ide_register_hw(&hw, NULL);
   68.87 -	}
   68.88 -#endif /* CONFIG_BLK_DEV_IDEPCI */
   68.89 -}
   68.90 -
   68.91 -#include <asm-generic/ide_iops.h>
   68.92 -
   68.93 -#endif /* __KERNEL__ */
   68.94 -
   68.95 -#endif /* __ASMi386_IDE_H */
    69.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/init.h	Fri Mar 14 15:48:09 2003 +0000
    69.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.3 @@ -1,1 +0,0 @@
    69.4 -#error "<asm/init.h> should never be used - use <linux/init.h> instead"
    70.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/io_apic.h	Fri Mar 14 15:48:09 2003 +0000
    70.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.3 @@ -1,148 +0,0 @@
    70.4 -#ifndef __ASM_IO_APIC_H
    70.5 -#define __ASM_IO_APIC_H
    70.6 -
    70.7 -#include <linux/config.h>
    70.8 -#include <asm/types.h>
    70.9 -
   70.10 -/*
   70.11 - * Intel IO-APIC support for SMP and UP systems.
   70.12 - *
   70.13 - * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar
   70.14 - */
   70.15 -
   70.16 -#ifdef CONFIG_X86_IO_APIC
   70.17 -
   70.18 -#define APIC_MISMATCH_DEBUG
   70.19 -
   70.20 -#define IO_APIC_BASE(idx) \
   70.21 -		((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \
   70.22 -		+ (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
   70.23 -
   70.24 -/*
   70.25 - * The structure of the IO-APIC:
   70.26 - */
   70.27 -struct IO_APIC_reg_00 {
   70.28 -	__u32	__reserved_2	: 24,
   70.29 -		ID		:  4,
   70.30 -		__reserved_1	:  4;
   70.31 -} __attribute__ ((packed));
   70.32 -
   70.33 -struct IO_APIC_reg_01 {
   70.34 -	__u32	version		:  8,
   70.35 -		__reserved_2	:  7,
   70.36 -		PRQ		:  1,
   70.37 -		entries		:  8,
   70.38 -		__reserved_1	:  8;
   70.39 -} __attribute__ ((packed));
   70.40 -
   70.41 -struct IO_APIC_reg_02 {
   70.42 -	__u32	__reserved_2	: 24,
   70.43 -		arbitration	:  4,
   70.44 -		__reserved_1	:  4;
   70.45 -} __attribute__ ((packed));
   70.46 -
   70.47 -/*
   70.48 - * # of IO-APICs and # of IRQ routing registers
   70.49 - */
   70.50 -extern int nr_ioapics;
   70.51 -extern int nr_ioapic_registers[MAX_IO_APICS];
   70.52 -
   70.53 -enum ioapic_irq_destination_types {
   70.54 -	dest_Fixed = 0,
   70.55 -	dest_LowestPrio = 1,
   70.56 -	dest_SMI = 2,
   70.57 -	dest__reserved_1 = 3,
   70.58 -	dest_NMI = 4,
   70.59 -	dest_INIT = 5,
   70.60 -	dest__reserved_2 = 6,
   70.61 -	dest_ExtINT = 7
   70.62 -};
   70.63 -
   70.64 -struct IO_APIC_route_entry {
   70.65 -	__u32	vector		:  8,
   70.66 -		delivery_mode	:  3,	/* 000: FIXED
   70.67 -					 * 001: lowest prio
   70.68 -					 * 111: ExtINT
   70.69 -					 */
   70.70 -		dest_mode	:  1,	/* 0: physical, 1: logical */
   70.71 -		delivery_status	:  1,
   70.72 -		polarity	:  1,
   70.73 -		irr		:  1,
   70.74 -		trigger		:  1,	/* 0: edge, 1: level */
   70.75 -		mask		:  1,	/* 0: enabled, 1: disabled */
   70.76 -		__reserved_2	: 15;
   70.77 -
   70.78 -	union {		struct { __u32
   70.79 -					__reserved_1	: 24,
   70.80 -					physical_dest	:  4,
   70.81 -					__reserved_2	:  4;
   70.82 -			} physical;
   70.83 -
   70.84 -			struct { __u32
   70.85 -					__reserved_1	: 24,
   70.86 -					logical_dest	:  8;
   70.87 -			} logical;
   70.88 -	} dest;
   70.89 -
   70.90 -} __attribute__ ((packed));
   70.91 -
   70.92 -/*
   70.93 - * MP-BIOS irq configuration table structures:
   70.94 - */
   70.95 -
   70.96 -/* I/O APIC entries */
   70.97 -extern struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
   70.98 -
   70.99 -/* # of MP IRQ source entries */
  70.100 -extern int mp_irq_entries;
  70.101 -
  70.102 -/* MP IRQ source entries */
  70.103 -extern struct mpc_config_intsrc *mp_irqs;
  70.104 -
  70.105 -/* non-0 if default (table-less) MP configuration */
  70.106 -extern int mpc_default_type;
  70.107 -
  70.108 -static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
  70.109 -{
  70.110 -	*IO_APIC_BASE(apic) = reg;
  70.111 -	return *(IO_APIC_BASE(apic)+4);
  70.112 -}
  70.113 -
  70.114 -static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
  70.115 -{
  70.116 -	*IO_APIC_BASE(apic) = reg;
  70.117 -	*(IO_APIC_BASE(apic)+4) = value;
  70.118 -}
  70.119 -
  70.120 -/*
  70.121 - * Re-write a value: to be used for read-modify-write
  70.122 - * cycles where the read already set up the index register.
  70.123 - */
  70.124 -static inline void io_apic_modify(unsigned int apic, unsigned int value)
  70.125 -{
  70.126 -	*(IO_APIC_BASE(apic)+4) = value;
  70.127 -}
  70.128 -
  70.129 -/*
  70.130 - * Synchronize the IO-APIC and the CPU by doing
  70.131 - * a dummy read from the IO-APIC
  70.132 - */
  70.133 -static inline void io_apic_sync(unsigned int apic)
  70.134 -{
  70.135 -	(void) *(IO_APIC_BASE(apic)+4);
  70.136 -}
  70.137 -
  70.138 -/* 1 if "noapic" boot option passed */
  70.139 -extern int skip_ioapic_setup;
  70.140 -
  70.141 -/*
  70.142 - * If we use the IO-APIC for IRQ routing, disable automatic
  70.143 - * assignment of PCI IRQ's.
  70.144 - */
  70.145 -#define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup)
  70.146 -
  70.147 -#else  /* !CONFIG_X86_IO_APIC */
  70.148 -#define io_apic_assign_pci_irqs 0
  70.149 -#endif
  70.150 -
  70.151 -#endif
    71.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ioctl.h	Fri Mar 14 15:48:09 2003 +0000
    71.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.3 @@ -1,75 +0,0 @@
    71.4 -/* $Id: ioctl.h,v 1.5 1993/07/19 21:53:50 root Exp root $
    71.5 - *
    71.6 - * linux/ioctl.h for Linux by H.H. Bergman.
    71.7 - */
    71.8 -
    71.9 -#ifndef _ASMI386_IOCTL_H
   71.10 -#define _ASMI386_IOCTL_H
   71.11 -
   71.12 -/* ioctl command encoding: 32 bits total, command in lower 16 bits,
   71.13 - * size of the parameter structure in the lower 14 bits of the
   71.14 - * upper 16 bits.
   71.15 - * Encoding the size of the parameter structure in the ioctl request
   71.16 - * is useful for catching programs compiled with old versions
   71.17 - * and to avoid overwriting user space outside the user buffer area.
   71.18 - * The highest 2 bits are reserved for indicating the ``access mode''.
   71.19 - * NOTE: This limits the max parameter size to 16kB -1 !
   71.20 - */
   71.21 -
   71.22 -/*
   71.23 - * The following is for compatibility across the various Linux
   71.24 - * platforms.  The i386 ioctl numbering scheme doesn't really enforce
   71.25 - * a type field.  De facto, however, the top 8 bits of the lower 16
   71.26 - * bits are indeed used as a type field, so we might just as well make
   71.27 - * this explicit here.  Please be sure to use the decoding macros
   71.28 - * below from now on.
   71.29 - */
   71.30 -#define _IOC_NRBITS	8
   71.31 -#define _IOC_TYPEBITS	8
   71.32 -#define _IOC_SIZEBITS	14
   71.33 -#define _IOC_DIRBITS	2
   71.34 -
   71.35 -#define _IOC_NRMASK	((1 << _IOC_NRBITS)-1)
   71.36 -#define _IOC_TYPEMASK	((1 << _IOC_TYPEBITS)-1)
   71.37 -#define _IOC_SIZEMASK	((1 << _IOC_SIZEBITS)-1)
   71.38 -#define _IOC_DIRMASK	((1 << _IOC_DIRBITS)-1)
   71.39 -
   71.40 -#define _IOC_NRSHIFT	0
   71.41 -#define _IOC_TYPESHIFT	(_IOC_NRSHIFT+_IOC_NRBITS)
   71.42 -#define _IOC_SIZESHIFT	(_IOC_TYPESHIFT+_IOC_TYPEBITS)
   71.43 -#define _IOC_DIRSHIFT	(_IOC_SIZESHIFT+_IOC_SIZEBITS)
   71.44 -
   71.45 -/*
   71.46 - * Direction bits.
   71.47 - */
   71.48 -#define _IOC_NONE	0U
   71.49 -#define _IOC_WRITE	1U
   71.50 -#define _IOC_READ	2U
   71.51 -
   71.52 -#define _IOC(dir,type,nr,size) \
   71.53 -	(((dir)  << _IOC_DIRSHIFT) | \
   71.54 -	 ((type) << _IOC_TYPESHIFT) | \
   71.55 -	 ((nr)   << _IOC_NRSHIFT) | \
   71.56 -	 ((size) << _IOC_SIZESHIFT))
   71.57 -
   71.58 -/* used to create numbers */
   71.59 -#define _IO(type,nr)		_IOC(_IOC_NONE,(type),(nr),0)
   71.60 -#define _IOR(type,nr,size)	_IOC(_IOC_READ,(type),(nr),sizeof(size))
   71.61 -#define _IOW(type,nr,size)	_IOC(_IOC_WRITE,(type),(nr),sizeof(size))
   71.62 -#define _IOWR(type,nr,size)	_IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
   71.63 -
   71.64 -/* used to decode ioctl numbers.. */
   71.65 -#define _IOC_DIR(nr)		(((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
   71.66 -#define _IOC_TYPE(nr)		(((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
   71.67 -#define _IOC_NR(nr)		(((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
   71.68 -#define _IOC_SIZE(nr)		(((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
   71.69 -
   71.70 -/* ...and for the drivers/sound files... */
   71.71 -
   71.72 -#define IOC_IN		(_IOC_WRITE << _IOC_DIRSHIFT)
   71.73 -#define IOC_OUT		(_IOC_READ << _IOC_DIRSHIFT)
   71.74 -#define IOC_INOUT	((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
   71.75 -#define IOCSIZE_MASK	(_IOC_SIZEMASK << _IOC_SIZESHIFT)
   71.76 -#define IOCSIZE_SHIFT	(_IOC_SIZESHIFT)
   71.77 -
   71.78 -#endif /* _ASMI386_IOCTL_H */
    72.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ioctls.h	Fri Mar 14 15:48:09 2003 +0000
    72.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.3 @@ -1,82 +0,0 @@
    72.4 -#ifndef __ARCH_I386_IOCTLS_H__
    72.5 -#define __ARCH_I386_IOCTLS_H__
    72.6 -
    72.7 -#include <asm/ioctl.h>
    72.8 -
    72.9 -/* 0x54 is just a magic number to make these relatively unique ('T') */
   72.10 -
   72.11 -#define TCGETS		0x5401
   72.12 -#define TCSETS		0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
   72.13 -#define TCSETSW		0x5403
   72.14 -#define TCSETSF		0x5404
   72.15 -#define TCGETA		0x5405
   72.16 -#define TCSETA		0x5406
   72.17 -#define TCSETAW		0x5407
   72.18 -#define TCSETAF		0x5408
   72.19 -#define TCSBRK		0x5409
   72.20 -#define TCXONC		0x540A
   72.21 -#define TCFLSH		0x540B
   72.22 -#define TIOCEXCL	0x540C
   72.23 -#define TIOCNXCL	0x540D
   72.24 -#define TIOCSCTTY	0x540E
   72.25 -#define TIOCGPGRP	0x540F
   72.26 -#define TIOCSPGRP	0x5410
   72.27 -#define TIOCOUTQ	0x5411
   72.28 -#define TIOCSTI		0x5412
   72.29 -#define TIOCGWINSZ	0x5413
   72.30 -#define TIOCSWINSZ	0x5414
   72.31 -#define TIOCMGET	0x5415
   72.32 -#define TIOCMBIS	0x5416
   72.33 -#define TIOCMBIC	0x5417
   72.34 -#define TIOCMSET	0x5418
   72.35 -#define TIOCGSOFTCAR	0x5419
   72.36 -#define TIOCSSOFTCAR	0x541A
   72.37 -#define FIONREAD	0x541B
   72.38 -#define TIOCINQ		FIONREAD
   72.39 -#define TIOCLINUX	0x541C
   72.40 -#define TIOCCONS	0x541D
   72.41 -#define TIOCGSERIAL	0x541E
   72.42 -#define TIOCSSERIAL	0x541F
   72.43 -#define TIOCPKT		0x5420
   72.44 -#define FIONBIO		0x5421
   72.45 -#define TIOCNOTTY	0x5422
   72.46 -#define TIOCSETD	0x5423
   72.47 -#define TIOCGETD	0x5424
   72.48 -#define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
   72.49 -#define TIOCTTYGSTRUCT	0x5426  /* For debugging only */
   72.50 -#define TIOCSBRK	0x5427  /* BSD compatibility */
   72.51 -#define TIOCCBRK	0x5428  /* BSD compatibility */
   72.52 -#define TIOCGSID	0x5429  /* Return the session ID of FD */
   72.53 -#define TIOCGPTN	_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
   72.54 -#define TIOCSPTLCK	_IOW('T',0x31, int)  /* Lock/unlock Pty */
   72.55 -
   72.56 -#define FIONCLEX	0x5450  /* these numbers need to be adjusted. */
   72.57 -#define FIOCLEX		0x5451
   72.58 -#define FIOASYNC	0x5452
   72.59 -#define TIOCSERCONFIG	0x5453
   72.60 -#define TIOCSERGWILD	0x5454
   72.61 -#define TIOCSERSWILD	0x5455
   72.62 -#define TIOCGLCKTRMIOS	0x5456
   72.63 -#define TIOCSLCKTRMIOS	0x5457
   72.64 -#define TIOCSERGSTRUCT	0x5458 /* For debugging only */
   72.65 -#define TIOCSERGETLSR   0x5459 /* Get line status register */
   72.66 -#define TIOCSERGETMULTI 0x545A /* Get multiport config  */
   72.67 -#define TIOCSERSETMULTI 0x545B /* Set multiport config */
   72.68 -
   72.69 -#define TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
   72.70 -#define TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
   72.71 -#define TIOCGHAYESESP   0x545E  /* Get Hayes ESP configuration */
   72.72 -#define TIOCSHAYESESP   0x545F  /* Set Hayes ESP configuration */
   72.73 -
   72.74 -/* Used for packet mode */
   72.75 -#define TIOCPKT_DATA		 0
   72.76 -#define TIOCPKT_FLUSHREAD	 1
   72.77 -#define TIOCPKT_FLUSHWRITE	 2
   72.78 -#define TIOCPKT_STOP		 4
   72.79 -#define TIOCPKT_START		 8
   72.80 -#define TIOCPKT_NOSTOP		16
   72.81 -#define TIOCPKT_DOSTOP		32
   72.82 -
   72.83 -#define TIOCSER_TEMT    0x01	/* Transmitter physically empty */
   72.84 -
   72.85 -#endif
    73.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ipc.h	Fri Mar 14 15:48:09 2003 +0000
    73.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.3 @@ -1,31 +0,0 @@
    73.4 -#ifndef __i386_IPC_H__
    73.5 -#define __i386_IPC_H__
    73.6 -
    73.7 -/* 
    73.8 - * These are used to wrap system calls on x86.
    73.9 - *
   73.10 - * See arch/i386/kernel/sys_i386.c for ugly details..
   73.11 - */
   73.12 -struct ipc_kludge {
   73.13 -	struct msgbuf *msgp;
   73.14 -	long msgtyp;
   73.15 -};
   73.16 -
   73.17 -#define SEMOP		 1
   73.18 -#define SEMGET		 2
   73.19 -#define SEMCTL		 3
   73.20 -#define MSGSND		11
   73.21 -#define MSGRCV		12
   73.22 -#define MSGGET		13
   73.23 -#define MSGCTL		14
   73.24 -#define SHMAT		21
   73.25 -#define SHMDT		22
   73.26 -#define SHMGET		23
   73.27 -#define SHMCTL		24
   73.28 -
   73.29 -/* Used by the DIPC package, try and avoid reusing it */
   73.30 -#define DIPC            25
   73.31 -
   73.32 -#define IPCCALL(version,op)	((version)<<16 | (op))
   73.33 -
   73.34 -#endif
    74.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ipcbuf.h	Fri Mar 14 15:48:09 2003 +0000
    74.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.3 @@ -1,29 +0,0 @@
    74.4 -#ifndef __i386_IPCBUF_H__
    74.5 -#define __i386_IPCBUF_H__
    74.6 -
    74.7 -/*
    74.8 - * The ipc64_perm structure for i386 architecture.
    74.9 - * Note extra padding because this structure is passed back and forth
   74.10 - * between kernel and user space.
   74.11 - *
   74.12 - * Pad space is left for:
   74.13 - * - 32-bit mode_t and seq
   74.14 - * - 2 miscellaneous 32-bit values
   74.15 - */
   74.16 -
   74.17 -struct ipc64_perm
   74.18 -{
   74.19 -	__kernel_key_t		key;
   74.20 -	__kernel_uid32_t	uid;
   74.21 -	__kernel_gid32_t	gid;
   74.22 -	__kernel_uid32_t	cuid;
   74.23 -	__kernel_gid32_t	cgid;
   74.24 -	__kernel_mode_t		mode;
   74.25 -	unsigned short		__pad1;
   74.26 -	unsigned short		seq;
   74.27 -	unsigned short		__pad2;
   74.28 -	unsigned long		__unused1;
   74.29 -	unsigned long		__unused2;
   74.30 -};
   74.31 -
   74.32 -#endif /* __i386_IPCBUF_H__ */
    75.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/keyboard.h	Fri Mar 14 15:48:09 2003 +0000
    75.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.3 @@ -1,72 +0,0 @@
    75.4 -/*
    75.5 - *  linux/include/asm-i386/keyboard.h
    75.6 - *
    75.7 - *  Created 3 Nov 1996 by Geert Uytterhoeven
    75.8 - */
    75.9 -
   75.10 -/*
   75.11 - *  This file contains the i386 architecture specific keyboard definitions
   75.12 - */
   75.13 -
   75.14 -#ifndef _I386_KEYBOARD_H
   75.15 -#define _I386_KEYBOARD_H
   75.16 -
   75.17 -#ifdef __KERNEL__
   75.18 -
   75.19 -#include <linux/kernel.h>
   75.20 -#include <linux/ioport.h>
   75.21 -#include <linux/kd.h>
   75.22 -#include <linux/pm.h>
   75.23 -#include <asm/io.h>
   75.24 -
   75.25 -#define KEYBOARD_IRQ			1
   75.26 -#define DISABLE_KBD_DURING_INTERRUPTS	0
   75.27 -
   75.28 -extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
   75.29 -extern int pckbd_getkeycode(unsigned int scancode);
   75.30 -extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
   75.31 -			   char raw_mode);
   75.32 -extern char pckbd_unexpected_up(unsigned char keycode);
   75.33 -extern void pckbd_leds(unsigned char leds);
   75.34 -extern void pckbd_init_hw(void);
   75.35 -extern int pckbd_pm_resume(struct pm_dev *, pm_request_t, void *);
   75.36 -extern pm_callback pm_kbd_request_override;
   75.37 -extern unsigned char pckbd_sysrq_xlate[128];
   75.38 -
   75.39 -#define kbd_setkeycode		pckbd_setkeycode
   75.40 -#define kbd_getkeycode		pckbd_getkeycode
   75.41 -#define kbd_translate		pckbd_translate
   75.42 -#define kbd_unexpected_up	pckbd_unexpected_up
   75.43 -#define kbd_leds		pckbd_leds
   75.44 -#define kbd_init_hw		pckbd_init_hw
   75.45 -#define kbd_sysrq_xlate		pckbd_sysrq_xlate
   75.46 -
   75.47 -#define SYSRQ_KEY 0x54
   75.48 -
   75.49 -/* resource allocation */
   75.50 -#define kbd_request_region()
   75.51 -#define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, \
   75.52 -                                             "keyboard", NULL)
   75.53 -
   75.54 -/* How to access the keyboard macros on this platform.  */
   75.55 -#define kbd_read_input() inb(KBD_DATA_REG)
   75.56 -#define kbd_read_status() inb(KBD_STATUS_REG)
   75.57 -#define kbd_write_output(val) outb(val, KBD_DATA_REG)
   75.58 -#define kbd_write_command(val) outb(val, KBD_CNTL_REG)
   75.59 -
   75.60 -/* Some stoneage hardware needs delays after some operations.  */
   75.61 -#define kbd_pause() do { } while(0)
   75.62 -
   75.63 -/*
   75.64 - * Machine specific bits for the PS/2 driver
   75.65 - */
   75.66 -
   75.67 -#define AUX_IRQ 12
   75.68 -
   75.69 -#define aux_request_irq(hand, dev_id)					\
   75.70 -	request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id)
   75.71 -
   75.72 -#define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id)
   75.73 -
   75.74 -#endif /* __KERNEL__ */
   75.75 -#endif /* _I386_KEYBOARD_H */
    76.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/kmap_types.h	Fri Mar 14 15:48:09 2003 +0000
    76.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.3 @@ -1,14 +0,0 @@
    76.4 -#ifndef _ASM_KMAP_TYPES_H
    76.5 -#define _ASM_KMAP_TYPES_H
    76.6 -
    76.7 -enum km_type {
    76.8 -	KM_BOUNCE_READ,
    76.9 -	KM_SKB_SUNRPC_DATA,
   76.10 -	KM_SKB_DATA_SOFTIRQ,
   76.11 -	KM_USER0,
   76.12 -	KM_USER1,
   76.13 -	KM_BH_IRQ,
   76.14 -	KM_TYPE_NR
   76.15 -};
   76.16 -
   76.17 -#endif
    77.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ldt.h	Fri Mar 14 15:48:09 2003 +0000
    77.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.3 @@ -1,32 +0,0 @@
    77.4 -/*
    77.5 - * ldt.h
    77.6 - *
    77.7 - * Definitions of structures used with the modify_ldt system call.
    77.8 - */
    77.9 -#ifndef _LINUX_LDT_H
   77.10 -#define _LINUX_LDT_H
   77.11 -
   77.12 -/* Maximum number of LDT entries supported. */
   77.13 -#define LDT_ENTRIES	8192
   77.14 -/* The size of each LDT entry. */
   77.15 -#define LDT_ENTRY_SIZE	8
   77.16 -
   77.17 -#ifndef __ASSEMBLY__
   77.18 -struct modify_ldt_ldt_s {
   77.19 -	unsigned int  entry_number;
   77.20 -	unsigned long base_addr;
   77.21 -	unsigned int  limit;
   77.22 -	unsigned int  seg_32bit:1;
   77.23 -	unsigned int  contents:2;
   77.24 -	unsigned int  read_exec_only:1;
   77.25 -	unsigned int  limit_in_pages:1;
   77.26 -	unsigned int  seg_not_present:1;
   77.27 -	unsigned int  useable:1;
   77.28 -};
   77.29 -
   77.30 -#define MODIFY_LDT_CONTENTS_DATA	0
   77.31 -#define MODIFY_LDT_CONTENTS_STACK	1
   77.32 -#define MODIFY_LDT_CONTENTS_CODE	2
   77.33 -
   77.34 -#endif /* !__ASSEMBLY__ */
   77.35 -#endif
    78.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/linux_logo.h	Fri Mar 14 15:48:09 2003 +0000
    78.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.3 @@ -1,27 +0,0 @@
    78.4 -/* $Id: linux_logo.h,v 1.8 1998/07/30 16:30:24 jj Exp $
    78.5 - * include/asm-i386/linux_logo.h: This is a linux logo
    78.6 - *                                to be displayed on boot.
    78.7 - *
    78.8 - * Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu)
    78.9 - * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
   78.10 - *
   78.11 - * You can put anything here, but:
   78.12 - * LINUX_LOGO_COLORS has to be less than 224
   78.13 - * image size has to be 80x80
   78.14 - * values have to start from 0x20
   78.15 - * (i.e. RGB(linux_logo_red[0],
   78.16 - *	     linux_logo_green[0],
   78.17 - *	     linux_logo_blue[0]) is color 0x20)
   78.18 - * BW image has to be 80x80 as well, with MS bit
   78.19 - * on the left
   78.20 - * Serial_console ascii image can be any size,
   78.21 - * but should contain %s to display the version
   78.22 - */
   78.23 - 
   78.24 -#include <linux/init.h>
   78.25 -#include <linux/version.h>
   78.26 -
   78.27 -#define linux_logo_banner "Linux/ia32 version " UTS_RELEASE
   78.28 -
   78.29 -#include <linux/linux_logo.h>
   78.30 -
    79.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/locks.h	Fri Mar 14 15:48:09 2003 +0000
    79.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.3 @@ -1,135 +0,0 @@
    79.4 -/*
    79.5 - *	SMP locks primitives for building ix86 locks
    79.6 - *	(not yet used).
    79.7 - *
    79.8 - *		Alan Cox, alan@redhat.com, 1995
    79.9 - */
   79.10 - 
   79.11 -/*
   79.12 - *	This would be much easier but far less clear and easy
   79.13 - *	to borrow for other processors if it was just assembler.
   79.14 - */
   79.15 -
   79.16 -static __inline__ void prim_spin_lock(struct spinlock *sp)
   79.17 -{
   79.18 -	int processor=smp_processor_id();
   79.19 -	
   79.20 -	/*
   79.21 -	 *	Grab the lock bit
   79.22 -	 */
   79.23 -	 
   79.24 -	while(lock_set_bit(0,&sp->lock))
   79.25 -	{
   79.26 -		/*
   79.27 -		 *	Failed, but that's cos we own it!
   79.28 -		 */
   79.29 -		 
   79.30 -		if(sp->cpu==processor)
   79.31 -		{
   79.32 -			sp->users++;
   79.33 -			return 0;
   79.34 -		}
   79.35 -		/*
   79.36 -		 *	Spin in the cache S state if possible
   79.37 -		 */
   79.38 -		while(sp->lock)
   79.39 -		{
   79.40 -			/*
   79.41 -			 *	Wait for any invalidates to go off
   79.42 -			 */
   79.43 -			 
   79.44 -			if(smp_invalidate_needed&(1<<processor))
   79.45 -				while(lock_clear_bit(processor,&smp_invalidate_needed))
   79.46 -					local_flush_tlb();
   79.47 -			sp->spins++;
   79.48 -		}
   79.49 -		/*
   79.50 -		 *	Someone wrote the line, we go 'I' and get
   79.51 -		 *	the cache entry. Now try to regrab
   79.52 -		 */
   79.53 -	}
   79.54 -	sp->users++;sp->cpu=processor;
   79.55 -	return 1;
   79.56 -}
   79.57 -
   79.58 -/*
   79.59 - *	Release a spin lock
   79.60 - */
   79.61 - 
   79.62 -static __inline__ int prim_spin_unlock(struct spinlock *sp)
   79.63 -{
   79.64 -	/* This is safe. The decrement is still guarded by the lock. A multilock would
   79.65 -	   not be safe this way */
   79.66 -	if(!--sp->users)
   79.67 -	{
   79.68 -		sp->cpu= NO_PROC_ID;lock_clear_bit(0,&sp->lock);
   79.69 -		return 1;
   79.70 -	}
   79.71 -	return 0;
   79.72 -}
   79.73 -
   79.74 -
   79.75 -/*
   79.76 - *	Non blocking lock grab
   79.77 - */
   79.78 - 
   79.79 -static __inline__ int prim_spin_lock_nb(struct spinlock *sp)
   79.80 -{
   79.81 -	if(lock_set_bit(0,&sp->lock))
   79.82 -		return 0;		/* Locked already */
   79.83 -	sp->users++;
   79.84 -	return 1;			/* We got the lock */
   79.85 -}
   79.86 -
   79.87 -
   79.88 -/*
   79.89 - *	These wrap the locking primitives up for usage
   79.90 - */
   79.91 - 
   79.92 -static __inline__ void spinlock(struct spinlock *sp)
   79.93 -{
   79.94 -	if(sp->priority<current->lock_order)
   79.95 -		panic("lock order violation: %s (%d)\n", sp->name, current->lock_order);
   79.96 -	if(prim_spin_lock(sp))
   79.97 -	{
   79.98 -		/*
   79.99 -		 *	We got a new lock. Update the priority chain
  79.100 -		 */
  79.101 -		sp->oldpri=current->lock_order;
  79.102 -		current->lock_order=sp->priority;
  79.103 -	}
  79.104 -}
  79.105 -
  79.106 -static __inline__ void spinunlock(struct spinlock *sp)
  79.107 -{
  79.108 -	int pri;
  79.109 -	if(current->lock_order!=sp->priority)
  79.110 -		panic("lock release order violation %s (%d)\n", sp->name, current->lock_order);
  79.111 -	pri=sp->oldpri;
  79.112 -	if(prim_spin_unlock(sp))
  79.113 -	{
  79.114 -		/*
  79.115 -		 *	Update the debugging lock priority chain. We dumped
  79.116 -		 *	our last right to the lock.
  79.117 -		 */
  79.118 -		current->lock_order=sp->pri;
  79.119 -	}	
  79.120 -}
  79.121 -
  79.122 -static __inline__ void spintestlock(struct spinlock *sp)
  79.123 -{
  79.124 -	/*
  79.125 -	 *	We do no sanity checks, it's legal to optimistically
  79.126 -	 *	get a lower lock.
  79.127 -	 */
  79.128 -	prim_spin_lock_nb(sp);
  79.129 -}
  79.130 -
  79.131 -static __inline__ void spintestunlock(struct spinlock *sp)
  79.132 -{
  79.133 -	/*
  79.134 -	 *	A testlock doesn't update the lock chain so we
  79.135 -	 *	must not update it on free
  79.136 -	 */
  79.137 -	prim_spin_unlock(sp);
  79.138 -}
    80.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/math_emu.h	Fri Mar 14 15:48:09 2003 +0000
    80.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.3 @@ -1,35 +0,0 @@
    80.4 -#ifndef _I386_MATH_EMU_H
    80.5 -#define _I386_MATH_EMU_H
    80.6 -
    80.7 -#include <asm/sigcontext.h>
    80.8 -
    80.9 -int restore_i387_soft(void *s387, struct _fpstate *buf);
   80.10 -int save_i387_soft(void *s387, struct _fpstate * buf);
   80.11 -
   80.12 -/* This structure matches the layout of the data saved to the stack
   80.13 -   following a device-not-present interrupt, part of it saved
   80.14 -   automatically by the 80386/80486.
   80.15 -   */
   80.16 -struct info {
   80.17 -	long ___orig_eip;
   80.18 -	long ___ebx;
   80.19 -	long ___ecx;
   80.20 -	long ___edx;
   80.21 -	long ___esi;
   80.22 -	long ___edi;
   80.23 -	long ___ebp;
   80.24 -	long ___eax;
   80.25 -	long ___ds;
   80.26 -	long ___es;
   80.27 -	long ___orig_eax;
   80.28 -	long ___eip;
   80.29 -	long ___cs;
   80.30 -	long ___eflags;
   80.31 -	long ___esp;
   80.32 -	long ___ss;
   80.33 -	long ___vm86_es; /* This and the following only in vm86 mode */
   80.34 -	long ___vm86_ds;
   80.35 -	long ___vm86_fs;
   80.36 -	long ___vm86_gs;
   80.37 -};
   80.38 -#endif
    81.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mc146818rtc.h	Fri Mar 14 15:48:09 2003 +0000
    81.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.3 @@ -1,29 +0,0 @@
    81.4 -/*
    81.5 - * Machine dependent access functions for RTC registers.
    81.6 - */
    81.7 -#ifndef _ASM_MC146818RTC_H
    81.8 -#define _ASM_MC146818RTC_H
    81.9 -
   81.10 -#include <asm/io.h>
   81.11 -
   81.12 -#ifndef RTC_PORT
   81.13 -#define RTC_PORT(x)	(0x70 + (x))
   81.14 -#define RTC_ALWAYS_BCD	1	/* RTC operates in binary mode */
   81.15 -#endif
   81.16 -
   81.17 -/*
   81.18 - * The yet supported machines all access the RTC index register via
   81.19 - * an ISA port access but the way to access the date register differs ...
   81.20 - */
   81.21 -#define CMOS_READ(addr) ({ \
   81.22 -outb_p((addr),RTC_PORT(0)); \
   81.23 -inb_p(RTC_PORT(1)); \
   81.24 -})
   81.25 -#define CMOS_WRITE(val, addr) ({ \
   81.26 -outb_p((addr),RTC_PORT(0)); \
   81.27 -outb_p((val),RTC_PORT(1)); \
   81.28 -})
   81.29 -
   81.30 -#define RTC_IRQ 8
   81.31 -
   81.32 -#endif /* _ASM_MC146818RTC_H */
    82.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mca_dma.h	Fri Mar 14 15:48:09 2003 +0000
    82.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.3 @@ -1,202 +0,0 @@
    82.4 -#ifndef MCA_DMA_H
    82.5 -#define MCA_DMA_H
    82.6 -
    82.7 -#include <asm/io.h>
    82.8 -#include <linux/ioport.h>
    82.9 -
   82.10 -/*
   82.11 - * Microchannel specific DMA stuff.  DMA on an MCA machine is fairly similar to
   82.12 - *   standard PC dma, but it certainly has its quirks.  DMA register addresses
   82.13 - *   are in a different place and there are some added functions.  Most of this
   82.14 - *   should be pretty obvious on inspection.  Note that the user must divide
   82.15 - *   count by 2 when using 16-bit dma; that is not handled by these functions.
   82.16 - *
   82.17 - * Ramen Noodles are yummy.
   82.18 - * 
   82.19 - *  1998 Tymm Twillman <tymm@computer.org>  
   82.20 - */
   82.21 -
   82.22 -/*
   82.23 - * Registers that are used by the DMA controller; FN is the function register 
   82.24 - *   (tell the controller what to do) and EXE is the execution register (how
   82.25 - *   to do it)
   82.26 - */
   82.27 -
   82.28 -#define MCA_DMA_REG_FN  0x18
   82.29 -#define MCA_DMA_REG_EXE 0x1A 
   82.30 -
   82.31 -/*
   82.32 - * Functions that the DMA controller can do
   82.33 - */
   82.34 -
   82.35 -#define MCA_DMA_FN_SET_IO       0x00
   82.36 -#define MCA_DMA_FN_SET_ADDR     0x20
   82.37 -#define MCA_DMA_FN_GET_ADDR     0x30
   82.38 -#define MCA_DMA_FN_SET_COUNT    0x40
   82.39 -#define MCA_DMA_FN_GET_COUNT    0x50
   82.40 -#define MCA_DMA_FN_GET_STATUS   0x60
   82.41 -#define MCA_DMA_FN_SET_MODE     0x70
   82.42 -#define MCA_DMA_FN_SET_ARBUS    0x80
   82.43 -#define MCA_DMA_FN_MASK         0x90
   82.44 -#define MCA_DMA_FN_RESET_MASK   0xA0
   82.45 -#define MCA_DMA_FN_MASTER_CLEAR 0xD0
   82.46 -
   82.47 -/*
   82.48 - * Modes (used by setting MCA_DMA_FN_MODE in the function register)
   82.49 - * 
   82.50 - * Note that the MODE_READ is read from memory (write to device), and
   82.51 - *   MODE_WRITE is vice-versa.  
   82.52 - */
   82.53 -
   82.54 -#define MCA_DMA_MODE_XFER  0x04  /* read by default */
   82.55 -#define MCA_DMA_MODE_READ  0x04  /* same as XFER */
   82.56 -#define MCA_DMA_MODE_WRITE 0x08  /* OR with MODE_XFER to use */
   82.57 -#define MCA_DMA_MODE_IO    0x01  /* DMA from IO register */
   82.58 -#define MCA_DMA_MODE_16    0x40  /* 16 bit xfers */
   82.59 -
   82.60 -
   82.61 -/**
   82.62 - *	mca_enable_dma	-	channel to enable DMA on
   82.63 - *	@dmanr: DMA channel
   82.64 - *
   82.65 - *	Enable the MCA bus DMA on a channel. This can be called from
   82.66 - *	IRQ context.
   82.67 - */
   82.68 -
   82.69 -static __inline__ void mca_enable_dma(unsigned int dmanr)
   82.70 -{
   82.71 -	outb(MCA_DMA_FN_RESET_MASK | dmanr, MCA_DMA_REG_FN);
   82.72 -}
   82.73 -
   82.74 -/**
   82.75 - *	mca_disble_dma	-	channel to disable DMA on
   82.76 - *	@dmanr: DMA channel
   82.77 - *
   82.78 - *	Enable the MCA bus DMA on a channel. This can be called from
   82.79 - *	IRQ context.
   82.80 - */
   82.81 -
   82.82 -static __inline__ void mca_disable_dma(unsigned int dmanr)
   82.83 -{
   82.84 -	outb(MCA_DMA_FN_MASK | dmanr, MCA_DMA_REG_FN);
   82.85 -}
   82.86 -
   82.87 -/**
   82.88 - *	mca_set_dma_addr -	load a 24bit DMA address
   82.89 - *	@dmanr: DMA channel
   82.90 - *	@a: 24bit bus address
   82.91 - *
   82.92 - *	Load the address register in the DMA controller. This has a 24bit
   82.93 - *	limitation (16Mb). 
   82.94 - */
   82.95 -
   82.96 -static __inline__ void mca_set_dma_addr(unsigned int dmanr, unsigned int a)
   82.97 -{
   82.98 -	outb(MCA_DMA_FN_SET_ADDR | dmanr, MCA_DMA_REG_FN);
   82.99 -	outb(a & 0xff, MCA_DMA_REG_EXE);
  82.100 -	outb((a >> 8) & 0xff, MCA_DMA_REG_EXE);
  82.101 -	outb((a >> 16) & 0xff, MCA_DMA_REG_EXE);
  82.102 -}
  82.103 -
  82.104 -/**
  82.105 - *	mca_get_dma_addr -	load a 24bit DMA address
  82.106 - *	@dmanr: DMA channel
  82.107 - *
  82.108 - *	Read the address register in the DMA controller. This has a 24bit
  82.109 - *	limitation (16Mb). The return is a bus address.
  82.110 - */
  82.111 -
  82.112 -static __inline__ unsigned int mca_get_dma_addr(unsigned int dmanr)
  82.113 -{
  82.114 -	unsigned int addr;
  82.115 -
  82.116 -	outb(MCA_DMA_FN_GET_ADDR | dmanr, MCA_DMA_REG_FN);
  82.117 -	addr = inb(MCA_DMA_REG_EXE);
  82.118 -	addr |= inb(MCA_DMA_REG_EXE) << 8;
  82.119 -	addr |= inb(MCA_DMA_REG_EXE) << 16;  
  82.120 -
  82.121 -	return addr;
  82.122 -}
  82.123 -
  82.124 -/**
  82.125 - *	mca_set_dma_count -	load a 16bit transfer count
  82.126 - *	@dmanr: DMA channel
  82.127 - *	@count: count
  82.128 - *
  82.129 - *	Set the DMA count for this channel. This can be up to 64Kbytes.
  82.130 - *	Setting a count of zero will not do what you expect.
  82.131 - */
  82.132 -
  82.133 -static __inline__ void mca_set_dma_count(unsigned int dmanr, unsigned int count)
  82.134 -{
  82.135 -	count--;  /* transfers one more than count -- correct for this */
  82.136 -
  82.137 -	outb(MCA_DMA_FN_SET_COUNT | dmanr, MCA_DMA_REG_FN);
  82.138 -	outb(count & 0xff, MCA_DMA_REG_EXE);
  82.139 -	outb((count >> 8) & 0xff, MCA_DMA_REG_EXE);
  82.140 -}
  82.141 -
  82.142 -/**
  82.143 - *	mca_get_dma_residue -	get the remaining bytes to transfer
  82.144 - *	@dmanr: DMA channel
  82.145 - *
  82.146 - *	This function returns the number of bytes left to transfer
  82.147 - *	on this DMA channel.
  82.148 - */
  82.149 -
  82.150 -static __inline__ unsigned int mca_get_dma_residue(unsigned int dmanr)
  82.151 -{
  82.152 -	unsigned short count;
  82.153 -
  82.154 -	outb(MCA_DMA_FN_GET_COUNT | dmanr, MCA_DMA_REG_FN);
  82.155 -	count = 1 + inb(MCA_DMA_REG_EXE);
  82.156 -	count += inb(MCA_DMA_REG_EXE) << 8;
  82.157 -
  82.158 -	return count;
  82.159 -}
  82.160 -
  82.161 -/**
  82.162 - *	mca_set_dma_io -	set the port for an I/O transfer
  82.163 - *	@dmanr: DMA channel
  82.164 - *	@io_addr: an I/O port number
  82.165 - *
  82.166 - *	Unlike the ISA bus DMA controllers the DMA on MCA bus can transfer
  82.167 - *	with an I/O port target.
  82.168 - */
  82.169 -
  82.170 -static __inline__ void mca_set_dma_io(unsigned int dmanr, unsigned int io_addr)
  82.171 -{
  82.172 -	/*
  82.173 -	 * DMA from a port address -- set the io address
  82.174 -	 */
  82.175 -	
  82.176 -	outb(MCA_DMA_FN_SET_IO | dmanr, MCA_DMA_REG_FN);
  82.177 -	outb(io_addr & 0xff, MCA_DMA_REG_EXE);
  82.178 -	outb((io_addr >>  8) & 0xff, MCA_DMA_REG_EXE);
  82.179 -}
  82.180 -
  82.181 -/**
  82.182 - *	mca_set_dma_mode -	set the DMA mode
  82.183 - *	@dmanr: DMA channel
  82.184 - *	@mode: mode to set
  82.185 - *
  82.186 - *	The DMA controller supports several modes. The mode values you can
  82.187 - *	set are :
  82.188 - *
  82.189 - *	%MCA_DMA_MODE_READ when reading from the DMA device.
  82.190 - *
  82.191 - *	%MCA_DMA_MODE_WRITE to writing to the DMA device.
  82.192 - *
  82.193 - *	%MCA_DMA_MODE_IO to do DMA to or from an I/O port.
  82.194 - *
  82.195 - *	%MCA_DMA_MODE_16 to do 16bit transfers.
  82.196 - *
  82.197 - */
  82.198 -
  82.199 -static __inline__ void mca_set_dma_mode(unsigned int dmanr, unsigned int mode)
  82.200 -{
  82.201 -	outb(MCA_DMA_FN_SET_MODE | dmanr, MCA_DMA_REG_FN);
  82.202 -	outb(mode, MCA_DMA_REG_EXE);
  82.203 -}
  82.204 -
  82.205 -#endif /* MCA_DMA_H */
    83.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mman.h	Fri Mar 14 15:48:09 2003 +0000
    83.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.3 @@ -1,38 +0,0 @@
    83.4 -#ifndef __I386_MMAN_H__
    83.5 -#define __I386_MMAN_H__
    83.6 -
    83.7 -#define PROT_READ	0x1		/* page can be read */
    83.8 -#define PROT_WRITE	0x2		/* page can be written */
    83.9 -#define PROT_EXEC	0x4		/* page can be executed */
   83.10 -#define PROT_NONE	0x0		/* page can not be accessed */
   83.11 -
   83.12 -#define MAP_SHARED	0x01		/* Share changes */
   83.13 -#define MAP_PRIVATE	0x02		/* Changes are private */
   83.14 -#define MAP_TYPE	0x0f		/* Mask for type of mapping */
   83.15 -#define MAP_FIXED	0x10		/* Interpret addr exactly */
   83.16 -#define MAP_ANONYMOUS	0x20		/* don't use a file */
   83.17 -
   83.18 -#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
   83.19 -#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
   83.20 -#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
   83.21 -#define MAP_LOCKED	0x2000		/* pages are locked */
   83.22 -#define MAP_NORESERVE	0x4000		/* don't check for reservations */
   83.23 -
   83.24 -#define MS_ASYNC	1		/* sync memory asynchronously */
   83.25 -#define MS_INVALIDATE	2		/* invalidate the caches */
   83.26 -#define MS_SYNC		4		/* synchronous memory sync */
   83.27 -
   83.28 -#define MCL_CURRENT	1		/* lock all current mappings */
   83.29 -#define MCL_FUTURE	2		/* lock all future mappings */
   83.30 -
   83.31 -#define MADV_NORMAL	0x0		/* default page-in behavior */
   83.32 -#define MADV_RANDOM	0x1		/* page-in minimum required */
   83.33 -#define MADV_SEQUENTIAL	0x2		/* read-ahead aggressively */
   83.34 -#define MADV_WILLNEED	0x3		/* pre-fault pages */
   83.35 -#define MADV_DONTNEED	0x4		/* discard these pages */
   83.36 -
   83.37 -/* compatibility flags */
   83.38 -#define MAP_ANON	MAP_ANONYMOUS
   83.39 -#define MAP_FILE	0
   83.40 -
   83.41 -#endif /* __I386_MMAN_H__ */
    84.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mmx.h	Fri Mar 14 15:48:09 2003 +0000
    84.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.3 @@ -1,14 +0,0 @@
    84.4 -#ifndef _ASM_MMX_H
    84.5 -#define _ASM_MMX_H
    84.6 -
    84.7 -/*
    84.8 - *	MMX 3Dnow! helper operations
    84.9 - */
   84.10 -
   84.11 -#include <linux/types.h>
   84.12 - 
   84.13 -extern void *_mmx_memcpy(void *to, const void *from, size_t size);
   84.14 -extern void mmx_clear_page(void *page);
   84.15 -extern void mmx_copy_page(void *to, void *from);
   84.16 -
   84.17 -#endif
    85.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/module.h	Fri Mar 14 15:48:09 2003 +0000
    85.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.3 @@ -1,12 +0,0 @@
    85.4 -#ifndef _ASM_I386_MODULE_H
    85.5 -#define _ASM_I386_MODULE_H
    85.6 -/*
    85.7 - * This file contains the i386 architecture specific module code.
    85.8 - */
    85.9 -
   85.10 -#define module_map(x)		vmalloc(x)
   85.11 -#define module_unmap(x)		vfree(x)
   85.12 -#define module_arch_init(x)	(0)
   85.13 -#define arch_init_modules(x)	do { } while (0)
   85.14 -
   85.15 -#endif /* _ASM_I386_MODULE_H */
    86.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mpspec.h	Fri Mar 14 15:48:09 2003 +0000
    86.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.3 @@ -1,223 +0,0 @@
    86.4 -#ifndef __ASM_MPSPEC_H
    86.5 -#define __ASM_MPSPEC_H
    86.6 -
    86.7 -/*
    86.8 - * Structure definitions for SMP machines following the
    86.9 - * Intel Multiprocessing Specification 1.1 and 1.4.
   86.10 - */
   86.11 -
   86.12 -/*
   86.13 - * This tag identifies where the SMP configuration
   86.14 - * information is. 
   86.15 - */
   86.16 - 
   86.17 -#define SMP_MAGIC_IDENT	(('_'<<24)|('P'<<16)|('M'<<8)|'_')
   86.18 -
   86.19 -/*
   86.20 - * a maximum of 16 APICs with the current APIC ID architecture.
   86.21 - * xAPICs can have up to 256.  SAPICs have 16 ID bits.
   86.22 - */
   86.23 -#ifdef CONFIG_X86_CLUSTERED_APIC
   86.24 -#define MAX_APICS 256
   86.25 -#else
   86.26 -#define MAX_APICS 16
   86.27 -#endif
   86.28 -
   86.29 -#define MAX_MPC_ENTRY 1024
   86.30 -
   86.31 -struct intel_mp_floating
   86.32 -{
   86.33 -	char mpf_signature[4];		/* "_MP_" 			*/
   86.34 -	unsigned long mpf_physptr;	/* Configuration table address	*/
   86.35 -	unsigned char mpf_length;	/* Our length (paragraphs)	*/
   86.36 -	unsigned char mpf_specification;/* Specification version	*/
   86.37 -	unsigned char mpf_checksum;	/* Checksum (makes sum 0)	*/
   86.38 -	unsigned char mpf_feature1;	/* Standard or configuration ? 	*/
   86.39 -	unsigned char mpf_feature2;	/* Bit7 set for IMCR|PIC	*/
   86.40 -	unsigned char mpf_feature3;	/* Unused (0)			*/
   86.41 -	unsigned char mpf_feature4;	/* Unused (0)			*/
   86.42 -	unsigned char mpf_feature5;	/* Unused (0)			*/
   86.43 -};
   86.44 -
   86.45 -struct mp_config_table
   86.46 -{
   86.47 -	char mpc_signature[4];
   86.48 -#define MPC_SIGNATURE "PCMP"
   86.49 -	unsigned short mpc_length;	/* Size of table */
   86.50 -	char  mpc_spec;			/* 0x01 */
   86.51 -	char  mpc_checksum;
   86.52 -	char  mpc_oem[8];
   86.53 -	char  mpc_productid[12];
   86.54 -	unsigned long mpc_oemptr;	/* 0 if not present */
   86.55 -	unsigned short mpc_oemsize;	/* 0 if not present */
   86.56 -	unsigned short mpc_oemcount;
   86.57 -	unsigned long mpc_lapic;	/* APIC address */
   86.58 -	unsigned long reserved;
   86.59 -};
   86.60 -
   86.61 -/* Followed by entries */
   86.62 -
   86.63 -#define	MP_PROCESSOR	0
   86.64 -#define	MP_BUS		1
   86.65 -#define	MP_IOAPIC	2
   86.66 -#define	MP_INTSRC	3
   86.67 -#define	MP_LINTSRC	4
   86.68 -#define	MP_TRANSLATION  192  /* Used by IBM NUMA-Q to describe node locality */
   86.69 -
   86.70 -struct mpc_config_processor
   86.71 -{
   86.72 -	unsigned char mpc_type;
   86.73 -	unsigned char mpc_apicid;	/* Local APIC number */
   86.74 -	unsigned char mpc_apicver;	/* Its versions */
   86.75 -	unsigned char mpc_cpuflag;
   86.76 -#define CPU_ENABLED		1	/* Processor is available */
   86.77 -#define CPU_BOOTPROCESSOR	2	/* Processor is the BP */
   86.78 -	unsigned long mpc_cpufeature;		
   86.79 -#define CPU_STEPPING_MASK 0x0F
   86.80 -#define CPU_MODEL_MASK	0xF0
   86.81 -#define CPU_FAMILY_MASK	0xF00
   86.82 -	unsigned long mpc_featureflag;	/* CPUID feature value */
   86.83 -	unsigned long mpc_reserved[2];
   86.84 -};
   86.85 -
   86.86 -struct mpc_config_bus
   86.87 -{
   86.88 -	unsigned char mpc_type;
   86.89 -	unsigned char mpc_busid;
   86.90 -	unsigned char mpc_bustype[6] __attribute((packed));
   86.91 -};
   86.92 -
   86.93 -/* List of Bus Type string values, Intel MP Spec. */
   86.94 -#define BUSTYPE_EISA	"EISA"
   86.95 -#define BUSTYPE_ISA	"ISA"
   86.96 -#define BUSTYPE_INTERN	"INTERN"	/* Internal BUS */
   86.97 -#define BUSTYPE_MCA	"MCA"
   86.98 -#define BUSTYPE_VL	"VL"		/* Local bus */
   86.99 -#define BUSTYPE_PCI	"PCI"
  86.100 -#define BUSTYPE_PCMCIA	"PCMCIA"
  86.101 -#define BUSTYPE_CBUS	"CBUS"
  86.102 -#define BUSTYPE_CBUSII	"CBUSII"
  86.103 -#define BUSTYPE_FUTURE	"FUTURE"
  86.104 -#define BUSTYPE_MBI	"MBI"
  86.105 -#define BUSTYPE_MBII	"MBII"
  86.106 -#define BUSTYPE_MPI	"MPI"
  86.107 -#define BUSTYPE_MPSA	"MPSA"
  86.108 -#define BUSTYPE_NUBUS	"NUBUS"
  86.109 -#define BUSTYPE_TC	"TC"
  86.110 -#define BUSTYPE_VME	"VME"
  86.111 -#define BUSTYPE_XPRESS	"XPRESS"
  86.112 -
  86.113 -struct mpc_config_ioapic
  86.114 -{
  86.115 -	unsigned char mpc_type;
  86.116 -	unsigned char mpc_apicid;
  86.117 -	unsigned char mpc_apicver;
  86.118 -	unsigned char mpc_flags;
  86.119 -#define MPC_APIC_USABLE		0x01
  86.120 -	unsigned long mpc_apicaddr;
  86.121 -};
  86.122 -
  86.123 -struct mpc_config_intsrc
  86.124 -{
  86.125 -	unsigned char mpc_type;
  86.126 -	unsigned char mpc_irqtype;
  86.127 -	unsigned short mpc_irqflag;
  86.128 -	unsigned char mpc_srcbus;
  86.129 -	unsigned char mpc_srcbusirq;
  86.130 -	unsigned char mpc_dstapic;
  86.131 -	unsigned char mpc_dstirq;
  86.132 -};
  86.133 -
  86.134 -enum mp_irq_source_types {
  86.135 -	mp_INT = 0,
  86.136 -	mp_NMI = 1,
  86.137 -	mp_SMI = 2,
  86.138 -	mp_ExtINT = 3
  86.139 -};
  86.140 -
  86.141 -#define MP_IRQDIR_DEFAULT	0
  86.142 -#define MP_IRQDIR_HIGH		1
  86.143 -#define MP_IRQDIR_LOW		3
  86.144 -
  86.145 -
  86.146 -struct mpc_config_lintsrc
  86.147 -{
  86.148 -	unsigned char mpc_type;
  86.149 -	unsigned char mpc_irqtype;
  86.150 -	unsigned short mpc_irqflag;
  86.151 -	unsigned char mpc_srcbusid;
  86.152 -	unsigned char mpc_srcbusirq;
  86.153 -	unsigned char mpc_destapic;	
  86.154 -#define MP_APIC_ALL	0xFF
  86.155 -	unsigned char mpc_destapiclint;
  86.156 -};
  86.157 -
  86.158 -struct mp_config_oemtable
  86.159 -{
  86.160 -	char oem_signature[4];
  86.161 -#define MPC_OEM_SIGNATURE "_OEM"
  86.162 -	unsigned short oem_length;	/* Size of table */
  86.163 -	char  oem_rev;			/* 0x01 */
  86.164 -	char  oem_checksum;
  86.165 -	char  mpc_oem[8];
  86.166 -};
  86.167 -
  86.168 -struct mpc_config_translation
  86.169 -{
  86.170 -        unsigned char mpc_type;
  86.171 -        unsigned char trans_len;
  86.172 -        unsigned char trans_type;
  86.173 -        unsigned char trans_quad;
  86.174 -        unsigned char trans_global;
  86.175 -        unsigned char trans_local;
  86.176 -        unsigned short trans_reserved;
  86.177 -};
  86.178 -
  86.179 -/*
  86.180 - *	Default configurations
  86.181 - *
  86.182 - *	1	2 CPU ISA 82489DX
  86.183 - *	2	2 CPU EISA 82489DX neither IRQ 0 timer nor IRQ 13 DMA chaining
  86.184 - *	3	2 CPU EISA 82489DX
  86.185 - *	4	2 CPU MCA 82489DX
  86.186 - *	5	2 CPU ISA+PCI
  86.187 - *	6	2 CPU EISA+PCI
  86.188 - *	7	2 CPU MCA+PCI
  86.189 - */
  86.190 -
  86.191 -#ifdef CONFIG_MULTIQUAD
  86.192 -#define MAX_IRQ_SOURCES 512
  86.193 -#else /* !CONFIG_MULTIQUAD */
  86.194 -#define MAX_IRQ_SOURCES 256
  86.195 -#endif /* CONFIG_MULTIQUAD */
  86.196 -
  86.197 -#define MAX_MP_BUSSES 32
  86.198 -enum mp_bustype {
  86.199 -	MP_BUS_ISA = 1,
  86.200 -	MP_BUS_EISA,
  86.201 -	MP_BUS_PCI,
  86.202 -	MP_BUS_MCA
  86.203 -};
  86.204 -extern int *mp_bus_id_to_type;
  86.205 -extern int *mp_bus_id_to_node;
  86.206 -extern int *mp_bus_id_to_local;
  86.207 -extern int *mp_bus_id_to_pci_bus;
  86.208 -extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
  86.209 -
  86.210 -extern unsigned int boot_cpu_physical_apicid;
  86.211 -extern unsigned long phys_cpu_present_map;
  86.212 -extern int smp_found_config;
  86.213 -extern void find_smp_config (void);
  86.214 -extern void get_smp_config (void);
  86.215 -extern int nr_ioapics;
  86.216 -extern int apic_version [MAX_APICS];
  86.217 -extern int mp_irq_entries;
  86.218 -extern struct mpc_config_intsrc *mp_irqs;
  86.219 -extern int mpc_default_type;
  86.220 -extern int mp_current_pci_id;
  86.221 -extern unsigned long mp_lapic_addr;
  86.222 -extern int pic_mode;
  86.223 -extern int using_apic_timer;
  86.224 -
  86.225 -#endif
  86.226 -
    87.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/msgbuf.h	Fri Mar 14 15:48:09 2003 +0000
    87.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.3 @@ -1,31 +0,0 @@
    87.4 -#ifndef _I386_MSGBUF_H
    87.5 -#define _I386_MSGBUF_H
    87.6 -
    87.7 -/* 
    87.8 - * The msqid64_ds structure for i386 architecture.
    87.9 - * Note extra padding because this structure is passed back and forth
   87.10 - * between kernel and user space.
   87.11 - *
   87.12 - * Pad space is left for:
   87.13 - * - 64-bit time_t to solve y2038 problem
   87.14 - * - 2 miscellaneous 32-bit values
   87.15 - */
   87.16 -
   87.17 -struct msqid64_ds {
   87.18 -	struct ipc64_perm msg_perm;
   87.19 -	__kernel_time_t msg_stime;	/* last msgsnd time */
   87.20 -	unsigned long	__unused1;
   87.21 -	__kernel_time_t msg_rtime;	/* last msgrcv time */
   87.22 -	unsigned long	__unused2;
   87.23 -	__kernel_time_t msg_ctime;	/* last change time */
   87.24 -	unsigned long	__unused3;
   87.25 -	unsigned long  msg_cbytes;	/* current number of bytes on queue */
   87.26 -	unsigned long  msg_qnum;	/* number of messages in queue */
   87.27 -	unsigned long  msg_qbytes;	/* max number of bytes on queue */
   87.28 -	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */
   87.29 -	__kernel_pid_t msg_lrpid;	/* last receive pid */
   87.30 -	unsigned long  __unused4;
   87.31 -	unsigned long  __unused5;
   87.32 -};
   87.33 -
   87.34 -#endif /* _I386_MSGBUF_H */
    88.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/msr.h	Fri Mar 14 15:48:09 2003 +0000
    88.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.3 @@ -1,121 +0,0 @@
    88.4 -#ifndef __ASM_MSR_H
    88.5 -#define __ASM_MSR_H
    88.6 -
    88.7 -/*
    88.8 - * Access to machine-specific registers (available on 586 and better only)
    88.9 - * Note: the rd* operations modify the parameters directly (without using
   88.10 - * pointer indirection), this allows gcc to optimize better
   88.11 - */
   88.12 -
   88.13 -#define rdmsr(msr,val1,val2) \
   88.14 -     __asm__ __volatile__("rdmsr" \
   88.15 -			  : "=a" (val1), "=d" (val2) \
   88.16 -			  : "c" (msr))
   88.17 -
   88.18 -#define wrmsr(msr,val1,val2) \
   88.19 -     __asm__ __volatile__("wrmsr" \
   88.20 -			  : /* no outputs */ \
   88.21 -			  : "c" (msr), "a" (val1), "d" (val2))
   88.22 -
   88.23 -#define rdtsc(low,high) \
   88.24 -     __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
   88.25 -
   88.26 -#define rdtscl(low) \
   88.27 -     __asm__ __volatile__("rdtsc" : "=a" (low) : : "edx")
   88.28 -
   88.29 -#define rdtscll(val) \
   88.30 -     __asm__ __volatile__("rdtsc" : "=A" (val))
   88.31 -
   88.32 -#define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
   88.33 -
   88.34 -#define rdpmc(counter,low,high) \
   88.35 -     __asm__ __volatile__("rdpmc" \
   88.36 -			  : "=a" (low), "=d" (high) \
   88.37 -			  : "c" (counter))
   88.38 -
   88.39 -/* symbolic names for some interesting MSRs */
   88.40 -/* Intel defined MSRs. */
   88.41 -#define MSR_IA32_P5_MC_ADDR		0
   88.42 -#define MSR_IA32_P5_MC_TYPE		1
   88.43 -#define MSR_IA32_PLATFORM_ID		0x17
   88.44 -#define MSR_IA32_EBL_CR_POWERON		0x2a
   88.45 -
   88.46 -#define MSR_IA32_APICBASE		0x1b
   88.47 -#define MSR_IA32_APICBASE_BSP		(1<<8)
   88.48 -#define MSR_IA32_APICBASE_ENABLE	(1<<11)
   88.49 -#define MSR_IA32_APICBASE_BASE		(0xfffff<<12)
   88.50 -
   88.51 -#define MSR_IA32_UCODE_WRITE		0x79
   88.52 -#define MSR_IA32_UCODE_REV		0x8b
   88.53 -
   88.54 -#define MSR_IA32_BBL_CR_CTL		0x119
   88.55 -
   88.56 -#define MSR_IA32_MCG_CAP		0x179
   88.57 -#define MSR_IA32_MCG_STATUS		0x17a
   88.58 -#define MSR_IA32_MCG_CTL		0x17b
   88.59 -
   88.60 -#define MSR_IA32_THERM_CONTROL		0x19a
   88.61 -#define MSR_IA32_THERM_INTERRUPT	0x19b
   88.62 -#define MSR_IA32_THERM_STATUS		0x19c
   88.63 -#define MSR_IA32_MISC_ENABLE		0x1a0
   88.64 -
   88.65 -#define MSR_IA32_DEBUGCTLMSR		0x1d9
   88.66 -#define MSR_IA32_LASTBRANCHFROMIP	0x1db
   88.67 -#define MSR_IA32_LASTBRANCHTOIP		0x1dc
   88.68 -#define MSR_IA32_LASTINTFROMIP		0x1dd
   88.69 -#define MSR_IA32_LASTINTTOIP		0x1de
   88.70 -
   88.71 -#define MSR_IA32_MC0_CTL		0x400
   88.72 -#define MSR_IA32_MC0_STATUS		0x401
   88.73 -#define MSR_IA32_MC0_ADDR		0x402
   88.74 -#define MSR_IA32_MC0_MISC		0x403
   88.75 -
   88.76 -#define MSR_P6_PERFCTR0			0xc1
   88.77 -#define MSR_P6_PERFCTR1			0xc2
   88.78 -#define MSR_P6_EVNTSEL0			0x186
   88.79 -#define MSR_P6_EVNTSEL1			0x187
   88.80 -
   88.81 -/* AMD Defined MSRs */
   88.82 -#define MSR_K6_EFER			0xC0000080
   88.83 -#define MSR_K6_STAR			0xC0000081
   88.84 -#define MSR_K6_WHCR			0xC0000082
   88.85 -#define MSR_K6_UWCCR			0xC0000085
   88.86 -#define MSR_K6_EPMR			0xC0000086
   88.87 -#define MSR_K6_PSOR			0xC0000087
   88.88 -#define MSR_K6_PFIR			0xC0000088
   88.89 -
   88.90 -#define MSR_K7_EVNTSEL0			0xC0010000
   88.91 -#define MSR_K7_PERFCTR0			0xC0010004
   88.92 -#define MSR_K7_HWCR			0xC0010015
   88.93 -#define MSR_K7_CLK_CTL			0xC001001b
   88.94 -#define MSR_K7_FID_VID_CTL		0xC0010041
   88.95 -#define MSR_K7_VID_STATUS		0xC0010042
   88.96 -
   88.97 -/* Centaur-Hauls/IDT defined MSRs. */
   88.98 -#define MSR_IDT_FCR1			0x107
   88.99 -#define MSR_IDT_FCR2			0x108
  88.100 -#define MSR_IDT_FCR3			0x109
  88.101 -#define MSR_IDT_FCR4			0x10a
  88.102 -
  88.103 -#define MSR_IDT_MCR0			0x110
  88.104 -#define MSR_IDT_MCR1			0x111
  88.105 -#define MSR_IDT_MCR2			0x112
  88.106 -#define MSR_IDT_MCR3			0x113
  88.107 -#define MSR_IDT_MCR4			0x114
  88.108 -#define MSR_IDT_MCR5			0x115
  88.109 -#define MSR_IDT_MCR6			0x116
  88.110 -#define MSR_IDT_MCR7			0x117
  88.111 -#define MSR_IDT_MCR_CTRL		0x120
  88.112 -
  88.113 -/* VIA Cyrix defined MSRs*/
  88.114 -#define MSR_VIA_FCR			0x1107
  88.115 -#define MSR_VIA_LONGHAUL		0x110a
  88.116 -#define MSR_VIA_BCR2			0x1147
  88.117 -
  88.118 -/* Transmeta defined MSRs */
  88.119 -#define MSR_TMTA_LONGRUN_CTRL		0x80868010
  88.120 -#define MSR_TMTA_LONGRUN_FLAGS		0x80868011
  88.121 -#define MSR_TMTA_LRTI_READOUT		0x80868018
  88.122 -#define MSR_TMTA_LRTI_VOLT_MHZ		0x8086801a
  88.123 -
  88.124 -#endif /* __ASM_MSR_H */
    89.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mtrr.h	Fri Mar 14 15:48:09 2003 +0000
    89.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.3 @@ -1,127 +0,0 @@
    89.4 -/*  Generic MTRR (Memory Type Range Register) ioctls.
    89.5 -
    89.6 -    Copyright (C) 1997-1999  Richard Gooch
    89.7 -
    89.8 -    This library is free software; you can redistribute it and/or
    89.9 -    modify it under the terms of the GNU Library General Public
   89.10 -    License as published by the Free Software Foundation; either
   89.11 -    version 2 of the License, or (at your option) any later version.
   89.12 -
   89.13 -    This library is distributed in the hope that it will be useful,
   89.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   89.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   89.16 -    Library General Public License for more details.
   89.17 -
   89.18 -    You should have received a copy of the GNU Library General Public
   89.19 -    License along with this library; if not, write to the Free
   89.20 -    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   89.21 -
   89.22 -    Richard Gooch may be reached by email at  rgooch@atnf.csiro.au
   89.23 -    The postal address is:
   89.24 -      Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
   89.25 -*/
   89.26 -#ifndef _LINUX_MTRR_H
   89.27 -#define _LINUX_MTRR_H
   89.28 -
   89.29 -#include <linux/config.h>
   89.30 -#include <linux/ioctl.h>
   89.31 -
   89.32 -#define	MTRR_IOCTL_BASE	'M'
   89.33 -
   89.34 -struct mtrr_sentry
   89.35 -{
   89.36 -    unsigned long base;    /*  Base address     */
   89.37 -    unsigned long size;    /*  Size of region   */
   89.38 -    unsigned int type;     /*  Type of region   */
   89.39 -};
   89.40 -
   89.41 -struct mtrr_gentry
   89.42 -{
   89.43 -    unsigned int regnum;   /*  Register number  */
   89.44 -    unsigned long base;    /*  Base address     */
   89.45 -    unsigned long size;    /*  Size of region   */
   89.46 -    unsigned int type;     /*  Type of region   */
   89.47 -};
   89.48 -
   89.49 -/*  These are the various ioctls  */
   89.50 -#define MTRRIOC_ADD_ENTRY        _IOW(MTRR_IOCTL_BASE,  0, struct mtrr_sentry)
   89.51 -#define MTRRIOC_SET_ENTRY        _IOW(MTRR_IOCTL_BASE,  1, struct mtrr_sentry)
   89.52 -#define MTRRIOC_DEL_ENTRY        _IOW(MTRR_IOCTL_BASE,  2, struct mtrr_sentry)
   89.53 -#define MTRRIOC_GET_ENTRY        _IOWR(MTRR_IOCTL_BASE, 3, struct mtrr_gentry)
   89.54 -#define MTRRIOC_KILL_ENTRY       _IOW(MTRR_IOCTL_BASE,  4, struct mtrr_sentry)
   89.55 -#define MTRRIOC_ADD_PAGE_ENTRY   _IOW(MTRR_IOCTL_BASE,  5, struct mtrr_sentry)
   89.56 -#define MTRRIOC_SET_PAGE_ENTRY   _IOW(MTRR_IOCTL_BASE,  6, struct mtrr_sentry)
   89.57 -#define MTRRIOC_DEL_PAGE_ENTRY   _IOW(MTRR_IOCTL_BASE,  7, struct mtrr_sentry)
   89.58 -#define MTRRIOC_GET_PAGE_ENTRY   _IOWR(MTRR_IOCTL_BASE, 8, struct mtrr_gentry)
   89.59 -#define MTRRIOC_KILL_PAGE_ENTRY  _IOW(MTRR_IOCTL_BASE,  9, struct mtrr_sentry)
   89.60 -
   89.61 -/*  These are the region types  */
   89.62 -#define MTRR_TYPE_UNCACHABLE 0
   89.63 -#define MTRR_TYPE_WRCOMB     1
   89.64 -/*#define MTRR_TYPE_         2*/
   89.65 -/*#define MTRR_TYPE_         3*/
   89.66 -#define MTRR_TYPE_WRTHROUGH  4
   89.67 -#define MTRR_TYPE_WRPROT     5
   89.68 -#define MTRR_TYPE_WRBACK     6
   89.69 -#define MTRR_NUM_TYPES       7
   89.70 -
   89.71 -#ifdef MTRR_NEED_STRINGS
   89.72 -static char *mtrr_strings[MTRR_NUM_TYPES] =
   89.73 -{
   89.74 -    "uncachable",               /* 0 */
   89.75 -    "write-combining",          /* 1 */
   89.76 -    "?",                        /* 2 */
   89.77 -    "?",                        /* 3 */
   89.78 -    "write-through",            /* 4 */
   89.79 -    "write-protect",            /* 5 */
   89.80 -    "write-back",               /* 6 */
   89.81 -};
   89.82 -#endif
   89.83 -
   89.84 -#ifdef __KERNEL__
   89.85 -
   89.86 -/*  The following functions are for use by other drivers  */
   89.87 -# ifdef CONFIG_MTRR
   89.88 -extern int mtrr_add (unsigned long base, unsigned long size,
   89.89 -		     unsigned int type, char increment);
   89.90 -extern int mtrr_add_page (unsigned long base, unsigned long size,
   89.91 -		     unsigned int type, char increment);
   89.92 -extern int mtrr_del (int reg, unsigned long base, unsigned long size);
   89.93 -extern int mtrr_del_page (int reg, unsigned long base, unsigned long size);
   89.94 -extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi);
   89.95 -#  else
   89.96 -static __inline__ int mtrr_add (unsigned long base, unsigned long size,
   89.97 -				unsigned int type, char increment)
   89.98 -{
   89.99 -    return -ENODEV;
  89.100 -}
  89.101 -static __inline__ int mtrr_add_page (unsigned long base, unsigned long size,
  89.102 -				unsigned int type, char increment)
  89.103 -{
  89.104 -    return -ENODEV;
  89.105 -}
  89.106 -static __inline__ int mtrr_del (int reg, unsigned long base,
  89.107 -				unsigned long size)
  89.108 -{
  89.109 -    return -ENODEV;
  89.110 -}
  89.111 -static __inline__ int mtrr_del_page (int reg, unsigned long base,
  89.112 -				unsigned long size)
  89.113 -{
  89.114 -    return -ENODEV;
  89.115 -}
  89.116 -
  89.117 -static __inline__ void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) {;}
  89.118 -
  89.119 -#  endif
  89.120 -
  89.121 -/*  The following functions are for initialisation: don't use them!  */
  89.122 -extern int mtrr_init (void);
  89.123 -#  if defined(CONFIG_SMP) && defined(CONFIG_MTRR)
  89.124 -extern void mtrr_init_boot_cpu (void);
  89.125 -extern void mtrr_init_secondary_cpu (void);
  89.126 -#  endif
  89.127 -
  89.128 -#endif
  89.129 -
  89.130 -#endif  /*  _LINUX_MTRR_H  */
    90.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/namei.h	Fri Mar 14 15:48:09 2003 +0000
    90.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.3 @@ -1,17 +0,0 @@
    90.4 -/* $Id: namei.h,v 1.1 1996/12/13 14:48:21 jj Exp $
    90.5 - * linux/include/asm-i386/namei.h
    90.6 - *
    90.7 - * Included from linux/fs/namei.c
    90.8 - */
    90.9 -
   90.10 -#ifndef __I386_NAMEI_H
   90.11 -#define __I386_NAMEI_H
   90.12 -
   90.13 -/* This dummy routine maybe changed to something useful
   90.14 - * for /usr/gnemul/ emulation stuff.
   90.15 - * Look at asm-sparc/namei.h for details.
   90.16 - */
   90.17 -
   90.18 -#define __emul_prefix() NULL
   90.19 -
   90.20 -#endif /* __I386_NAMEI_H */
    91.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/param.h	Fri Mar 14 15:48:09 2003 +0000
    91.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.3 @@ -1,24 +0,0 @@
    91.4 -#ifndef _ASMi386_PARAM_H
    91.5 -#define _ASMi386_PARAM_H
    91.6 -
    91.7 -#ifndef HZ
    91.8 -#define HZ 100
    91.9 -#endif
   91.10 -
   91.11 -#define EXEC_PAGESIZE	4096
   91.12 -
   91.13 -#ifndef NGROUPS
   91.14 -#define NGROUPS		32
   91.15 -#endif
   91.16 -
   91.17 -#ifndef NOGROUP
   91.18 -#define NOGROUP		(-1)
   91.19 -#endif
   91.20 -
   91.21 -#define MAXHOSTNAMELEN	64	/* max length of hostname */
   91.22 -
   91.23 -#ifdef __KERNEL__
   91.24 -# define CLOCKS_PER_SEC	100	/* frequency at which times() counts */
   91.25 -#endif
   91.26 -
   91.27 -#endif
    92.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/parport.h	Fri Mar 14 15:48:09 2003 +0000
    92.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.3 @@ -1,18 +0,0 @@
    92.4 -/*
    92.5 - * parport.h: ia32-specific parport initialisation
    92.6 - *
    92.7 - * Copyright (C) 1999, 2000  Tim Waugh <tim@cyberelk.demon.co.uk>
    92.8 - *
    92.9 - * This file should only be included by drivers/parport/parport_pc.c.
   92.10 - */
   92.11 -
   92.12 -#ifndef _ASM_I386_PARPORT_H
   92.13 -#define _ASM_I386_PARPORT_H 1
   92.14 -
   92.15 -static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
   92.16 -static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
   92.17 -{
   92.18 -	return parport_pc_find_isa_ports (autoirq, autodma);
   92.19 -}
   92.20 -
   92.21 -#endif /* !(_ASM_I386_PARPORT_H) */
    93.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/poll.h	Fri Mar 14 15:48:09 2003 +0000
    93.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.3 @@ -1,25 +0,0 @@
    93.4 -#ifndef __i386_POLL_H
    93.5 -#define __i386_POLL_H
    93.6 -
    93.7 -/* These are specified by iBCS2 */
    93.8 -#define POLLIN		0x0001
    93.9 -#define POLLPRI		0x0002
   93.10 -#define POLLOUT		0x0004
   93.11 -#define POLLERR		0x0008
   93.12 -#define POLLHUP		0x0010
   93.13 -#define POLLNVAL	0x0020
   93.14 -
   93.15 -/* The rest seem to be more-or-less nonstandard. Check them! */
   93.16 -#define POLLRDNORM	0x0040
   93.17 -#define POLLRDBAND	0x0080
   93.18 -#define POLLWRNORM	0x0100
   93.19 -#define POLLWRBAND	0x0200
   93.20 -#define POLLMSG		0x0400
   93.21 -
   93.22 -struct pollfd {
   93.23 -	int fd;
   93.24 -	short events;
   93.25 -	short revents;
   93.26 -};
   93.27 -
   93.28 -#endif
    94.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/posix_types.h	Fri Mar 14 15:48:09 2003 +0000
    94.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.3 @@ -1,80 +0,0 @@
    94.4 -#ifndef __ARCH_I386_POSIX_TYPES_H
    94.5 -#define __ARCH_I386_POSIX_TYPES_H
    94.6 -
    94.7 -/*
    94.8 - * This file is generally used by user-level software, so you need to
    94.9 - * be a little careful about namespace pollution etc.  Also, we cannot
   94.10 - * assume GCC is being used.
   94.11 - */
   94.12 -
   94.13 -typedef unsigned short	__kernel_dev_t;
   94.14 -typedef unsigned long	__kernel_ino_t;
   94.15 -typedef unsigned short	__kernel_mode_t;
   94.16 -typedef unsigned short	__kernel_nlink_t;
   94.17 -typedef long		__kernel_off_t;
   94.18 -typedef int		__kernel_pid_t;
   94.19 -typedef unsigned short	__kernel_ipc_pid_t;
   94.20 -typedef unsigned short	__kernel_uid_t;
   94.21 -typedef unsigned short	__kernel_gid_t;
   94.22 -typedef unsigned int	__kernel_size_t;
   94.23 -typedef int		__kernel_ssize_t;
   94.24 -typedef int		__kernel_ptrdiff_t;
   94.25 -typedef long		__kernel_time_t;
   94.26 -typedef long		__kernel_suseconds_t;
   94.27 -typedef long		__kernel_clock_t;
   94.28 -typedef int		__kernel_daddr_t;
   94.29 -typedef char *		__kernel_caddr_t;
   94.30 -typedef unsigned short	__kernel_uid16_t;
   94.31 -typedef unsigned short	__kernel_gid16_t;
   94.32 -typedef unsigned int	__kernel_uid32_t;
   94.33 -typedef unsigned int	__kernel_gid32_t;
   94.34 -
   94.35 -typedef unsigned short	__kernel_old_uid_t;
   94.36 -typedef unsigned short	__kernel_old_gid_t;
   94.37 -
   94.38 -#ifdef __GNUC__
   94.39 -typedef long long	__kernel_loff_t;
   94.40 -#endif
   94.41 -
   94.42 -typedef struct {
   94.43 -#if defined(__KERNEL__) || defined(__USE_ALL)
   94.44 -	int	val[2];
   94.45 -#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
   94.46 -	int	__val[2];
   94.47 -#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
   94.48 -} __kernel_fsid_t;
   94.49 -
   94.50 -#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
   94.51 -
   94.52 -#undef	__FD_SET
   94.53 -#define __FD_SET(fd,fdsetp) \
   94.54 -		__asm__ __volatile__("btsl %1,%0": \
   94.55 -			"=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
   94.56 -
   94.57 -#undef	__FD_CLR
   94.58 -#define __FD_CLR(fd,fdsetp) \
   94.59 -		__asm__ __volatile__("btrl %1,%0": \
   94.60 -			"=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
   94.61 -
   94.62 -#undef	__FD_ISSET
   94.63 -#define __FD_ISSET(fd,fdsetp) (__extension__ ({ \
   94.64 -		unsigned char __result; \
   94.65 -		__asm__ __volatile__("btl %1,%2 ; setb %0" \
   94.66 -			:"=q" (__result) :"r" ((int) (fd)), \
   94.67 -			"m" (*(__kernel_fd_set *) (fdsetp))); \
   94.68 -		__result; }))
   94.69 -
   94.70 -#undef	__FD_ZERO
   94.71 -#define __FD_ZERO(fdsetp) \
   94.72 -do { \
   94.73 -	int __d0, __d1; \
   94.74 -	__asm__ __volatile__("cld ; rep ; stosl" \
   94.75 -			:"=m" (*(__kernel_fd_set *) (fdsetp)), \
   94.76 -			  "=&c" (__d0), "=&D" (__d1) \
   94.77 -			:"a" (0), "1" (__FDSET_LONGS), \
   94.78 -			"2" ((__kernel_fd_set *) (fdsetp)) : "memory"); \
   94.79 -} while (0)
   94.80 -
   94.81 -#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
   94.82 -
   94.83 -#endif
    95.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/resource.h	Fri Mar 14 15:48:09 2003 +0000
    95.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.3 @@ -1,47 +0,0 @@
    95.4 -#ifndef _I386_RESOURCE_H
    95.5 -#define _I386_RESOURCE_H
    95.6 -
    95.7 -/*
    95.8 - * Resource limits
    95.9 - */
   95.10 -
   95.11 -#define RLIMIT_CPU	0		/* CPU time in ms */
   95.12 -#define RLIMIT_FSIZE	1		/* Maximum filesize */
   95.13 -#define RLIMIT_DATA	2		/* max data size */
   95.14 -#define RLIMIT_STACK	3		/* max stack size */
   95.15 -#define RLIMIT_CORE	4		/* max core file size */
   95.16 -#define RLIMIT_RSS	5		/* max resident set size */
   95.17 -#define RLIMIT_NPROC	6		/* max number of processes */
   95.18 -#define RLIMIT_NOFILE	7		/* max number of open files */
   95.19 -#define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
   95.20 -#define RLIMIT_AS	9		/* address space limit */
   95.21 -#define RLIMIT_LOCKS	10		/* maximum file locks held */
   95.22 -
   95.23 -#define RLIM_NLIMITS	11
   95.24 -
   95.25 -/*
   95.26 - * SuS says limits have to be unsigned.
   95.27 - * Which makes a ton more sense anyway.
   95.28 - */
   95.29 -#define RLIM_INFINITY	(~0UL)
   95.30 -
   95.31 -#ifdef __KERNEL__
   95.32 -
   95.33 -#define INIT_RLIMITS					\
   95.34 -{							\
   95.35 -	{ RLIM_INFINITY, RLIM_INFINITY },		\
   95.36 -	{ RLIM_INFINITY, RLIM_INFINITY },		\
   95.37 -	{ RLIM_INFINITY, RLIM_INFINITY },		\
   95.38 -	{      _STK_LIM, RLIM_INFINITY },		\
   95.39 -	{             0, RLIM_INFINITY },		\
   95.40 -	{ RLIM_INFINITY, RLIM_INFINITY },		\
   95.41 -	{             0,             0 },		\
   95.42 -	{      INR_OPEN,     INR_OPEN  },		\
   95.43 -	{ RLIM_INFINITY, RLIM_INFINITY },		\
   95.44 -	{ RLIM_INFINITY, RLIM_INFINITY },		\
   95.45 -        { RLIM_INFINITY, RLIM_INFINITY },		\
   95.46 -}
   95.47 -
   95.48 -#endif /* __KERNEL__ */
   95.49 -
   95.50 -#endif
    96.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/rwlock.h	Fri Mar 14 15:48:09 2003 +0000
    96.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.3 @@ -1,83 +0,0 @@
    96.4 -/* include/asm-i386/rwlock.h
    96.5 - *
    96.6 - *	Helpers used by both rw spinlocks and rw semaphores.
    96.7 - *
    96.8 - *	Based in part on code from semaphore.h and
    96.9 - *	spinlock.h Copyright 1996 Linus Torvalds.
   96.10 - *
   96.11 - *	Copyright 1999 Red Hat, Inc.
   96.12 - *
   96.13 - *	Written by Benjamin LaHaise.
   96.14 - *
   96.15 - *	This program is free software; you can redistribute it and/or
   96.16 - *	modify it under the terms of the GNU General Public License
   96.17 - *	as published by the Free Software Foundation; either version
   96.18 - *	2 of the License, or (at your option) any later version.
   96.19 - */
   96.20 -#ifndef _ASM_I386_RWLOCK_H
   96.21 -#define _ASM_I386_RWLOCK_H
   96.22 -
   96.23 -#define RW_LOCK_BIAS		 0x01000000
   96.24 -#define RW_LOCK_BIAS_STR	"0x01000000"
   96.25 -
   96.26 -#define __build_read_lock_ptr(rw, helper)   \
   96.27 -	asm volatile(LOCK "subl $1,(%0)\n\t" \
   96.28 -		     "js 2f\n" \
   96.29 -		     "1:\n" \
   96.30 -		     LOCK_SECTION_START("") \
   96.31 -		     "2:\tcall " helper "\n\t" \
   96.32 -		     "jmp 1b\n" \
   96.33 -		     LOCK_SECTION_END \
   96.34 -		     ::"a" (rw) : "memory")
   96.35 -
   96.36 -#define __build_read_lock_const(rw, helper)   \
   96.37 -	asm volatile(LOCK "subl $1,%0\n\t" \
   96.38 -		     "js 2f\n" \
   96.39 -		     "1:\n" \
   96.40 -		     LOCK_SECTION_START("") \
   96.41 -		     "2:\tpushl %%eax\n\t" \
   96.42 -		     "leal %0,%%eax\n\t" \
   96.43 -		     "call " helper "\n\t" \
   96.44 -		     "popl %%eax\n\t" \
   96.45 -		     "jmp 1b\n" \
   96.46 -		     LOCK_SECTION_END \
   96.47 -		     :"=m" (*(volatile int *)rw) : : "memory")
   96.48 -
   96.49 -#define __build_read_lock(rw, helper)	do { \
   96.50 -						if (__builtin_constant_p(rw)) \
   96.51 -							__build_read_lock_const(rw, helper); \
   96.52 -						else \
   96.53 -							__build_read_lock_ptr(rw, helper); \
   96.54 -					} while (0)
   96.55 -
   96.56 -#define __build_write_lock_ptr(rw, helper) \
   96.57 -	asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
   96.58 -		     "jnz 2f\n" \
   96.59 -		     "1:\n" \
   96.60 -		     LOCK_SECTION_START("") \
   96.61 -		     "2:\tcall " helper "\n\t" \
   96.62 -		     "jmp 1b\n" \
   96.63 -		     LOCK_SECTION_END \
   96.64 -		     ::"a" (rw) : "memory")
   96.65 -
   96.66 -#define __build_write_lock_const(rw, helper) \
   96.67 -	asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
   96.68 -		     "jnz 2f\n" \
   96.69 -		     "1:\n" \
   96.70 -		     LOCK_SECTION_START("") \
   96.71 -		     "2:\tpushl %%eax\n\t" \
   96.72 -		     "leal %0,%%eax\n\t" \
   96.73 -		     "call " helper "\n\t" \
   96.74 -		     "popl %%eax\n\t" \
   96.75 -		     "jmp 1b\n" \
   96.76 -		     LOCK_SECTION_END \
   96.77 -		     :"=m" (*(volatile int *)rw) : : "memory")
   96.78 -
   96.79 -#define __build_write_lock(rw, helper)	do { \
   96.80 -						if (__builtin_constant_p(rw)) \
   96.81 -							__build_write_lock_const(rw, helper); \
   96.82 -						else \
   96.83 -							__build_write_lock_ptr(rw, helper); \
   96.84 -					} while (0)
   96.85 -
   96.86 -#endif
    97.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/rwsem.h	Fri Mar 14 15:48:09 2003 +0000
    97.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.3 @@ -1,264 +0,0 @@
    97.4 -/* rwsem.h: R/W semaphores implemented using XADD/CMPXCHG for i486+
    97.5 - *
    97.6 - * Written by David Howells (dhowells@redhat.com).
    97.7 - *
    97.8 - * Derived from asm-i386/semaphore.h
    97.9 - *
   97.10 - * Trylock by Brian Watson (Brian.J.Watson@compaq.com).
   97.11 - *
   97.12 - *
   97.13 - * The MSW of the count is the negated number of active writers and waiting
   97.14 - * lockers, and the LSW is the total number of active locks
   97.15 - *
   97.16 - * The lock count is initialized to 0 (no active and no waiting lockers).
   97.17 - *
   97.18 - * When a writer subtracts WRITE_BIAS, it'll get 0xffff0001 for the case of an
   97.19 - * uncontended lock. This can be determined because XADD returns the old value.
   97.20 - * Readers increment by 1 and see a positive value when uncontended, negative
   97.21 - * if there are writers (and maybe) readers waiting (in which case it goes to
   97.22 - * sleep).
   97.23 - *
   97.24 - * The value of WAITING_BIAS supports up to 32766 waiting processes. This can
   97.25 - * be extended to 65534 by manually checking the whole MSW rather than relying
   97.26 - * on the S flag.
   97.27 - *
   97.28 - * The value of ACTIVE_BIAS supports up to 65535 active processes.
   97.29 - *
   97.30 - * This should be totally fair - if anything is waiting, a process that wants a
   97.31 - * lock will go to the back of the queue. When the currently active lock is
   97.32 - * released, if there's a writer at the front of the queue, then that and only
   97.33 - * that will be woken up; if there's a bunch of consequtive readers at the
   97.34 - * front, then they'll all be woken up, but no other readers will be.
   97.35 - */
   97.36 -
   97.37 -#ifndef _I386_RWSEM_H
   97.38 -#define _I386_RWSEM_H
   97.39 -
   97.40 -#ifndef _LINUX_RWSEM_H
   97.41 -#error please dont include asm/rwsem.h directly, use linux/rwsem.h instead
   97.42 -#endif
   97.43 -
   97.44 -#ifdef __KERNEL__
   97.45 -
   97.46 -#include <linux/list.h>
   97.47 -#include <linux/spinlock.h>
   97.48 -
   97.49 -struct rwsem_waiter;
   97.50 -
   97.51 -extern struct rw_semaphore *FASTCALL(rwsem_down_read_failed(struct rw_semaphore *sem));
   97.52 -extern struct rw_semaphore *FASTCALL(rwsem_down_write_failed(struct rw_semaphore *sem));
   97.53 -extern struct rw_semaphore *FASTCALL(rwsem_wake(struct rw_semaphore *));
   97.54 -
   97.55 -/*
   97.56 - * the semaphore definition
   97.57 - */
   97.58 -struct rw_semaphore {
   97.59 -	signed long		count;
   97.60 -#define RWSEM_UNLOCKED_VALUE		0x00000000
   97.61 -#define RWSEM_ACTIVE_BIAS		0x00000001
   97.62 -#define RWSEM_ACTIVE_MASK		0x0000ffff
   97.63 -#define RWSEM_WAITING_BIAS		(-0x00010000)
   97.64 -#define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
   97.65 -#define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
   97.66 -	spinlock_t		wait_lock;
   97.67 -	struct list_head	wait_list;
   97.68 -#if RWSEM_DEBUG
   97.69 -	int			debug;
   97.70 -#endif
   97.71 -};
   97.72 -
   97.73 -/*
   97.74 - * initialisation
   97.75 - */
   97.76 -#if RWSEM_DEBUG
   97.77 -#define __RWSEM_DEBUG_INIT      , 0
   97.78 -#else
   97.79 -#define __RWSEM_DEBUG_INIT	/* */
   97.80 -#endif
   97.81 -
   97.82 -#define __RWSEM_INITIALIZER(name) \
   97.83 -{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \
   97.84 -	__RWSEM_DEBUG_INIT }
   97.85 -
   97.86 -#define DECLARE_RWSEM(name) \
   97.87 -	struct rw_semaphore name = __RWSEM_INITIALIZER(name)
   97.88 -
   97.89 -static inline void init_rwsem(struct rw_semaphore *sem)
   97.90 -{
   97.91 -	sem->count = RWSEM_UNLOCKED_VALUE;
   97.92 -	spin_lock_init(&sem->wait_lock);
   97.93 -	INIT_LIST_HEAD(&sem->wait_list);
   97.94 -#if RWSEM_DEBUG
   97.95 -	sem->debug = 0;
   97.96 -#endif
   97.97 -}
   97.98 -
   97.99 -/*
  97.100 - * lock for reading
  97.101 - */
  97.102 -static inline void __down_read(struct rw_semaphore *sem)
  97.103 -{
  97.104 -	__asm__ __volatile__(
  97.105 -		"# beginning down_read\n\t"
  97.106 -LOCK_PREFIX	"  incl      (%%eax)\n\t" /* adds 0x00000001, returns the old value */
  97.107 -		"  js        2f\n\t" /* jump if we weren't granted the lock */
  97.108 -		"1:\n\t"
  97.109 -		LOCK_SECTION_START("")
  97.110 -		"2:\n\t"
  97.111 -		"  pushl     %%ecx\n\t"
  97.112 -		"  pushl     %%edx\n\t"
  97.113 -		"  call      rwsem_down_read_failed\n\t"
  97.114 -		"  popl      %%edx\n\t"
  97.115 -		"  popl      %%ecx\n\t"
  97.116 -		"  jmp       1b\n"
  97.117 -		LOCK_SECTION_END
  97.118 -		"# ending down_read\n\t"
  97.119 -		: "+m"(sem->count)
  97.120 -		: "a"(sem)
  97.121 -		: "memory", "cc");
  97.122 -}
  97.123 -
  97.124 -/*
  97.125 - * trylock for reading -- returns 1 if successful, 0 if contention
  97.126 - */
  97.127 -static inline int __down_read_trylock(struct rw_semaphore *sem)
  97.128 -{
  97.129 -	__s32 result, tmp;
  97.130 -	__asm__ __volatile__(
  97.131 -		"# beginning __down_read_trylock\n\t"
  97.132 -		"  movl      %0,%1\n\t"
  97.133 -		"1:\n\t"
  97.134 -		"  movl	     %1,%2\n\t"
  97.135 -		"  addl      %3,%2\n\t"
  97.136 -		"  jle	     2f\n\t"
  97.137 -LOCK_PREFIX	"  cmpxchgl  %2,%0\n\t"
  97.138 -		"  jnz	     1b\n\t"
  97.139 -		"2:\n\t"
  97.140 -		"# ending __down_read_trylock\n\t"
  97.141 -		: "+m"(sem->count), "=&a"(result), "=&r"(tmp)
  97.142 -		: "i"(RWSEM_ACTIVE_READ_BIAS)
  97.143 -		: "memory", "cc");
  97.144 -	return result>=0 ? 1 : 0;
  97.145 -}
  97.146 -
  97.147 -/*
  97.148 - * lock for writing
  97.149 - */
  97.150 -static inline void __down_write(struct rw_semaphore *sem)
  97.151 -{
  97.152 -	int tmp;
  97.153 -
  97.154 -	tmp = RWSEM_ACTIVE_WRITE_BIAS;
  97.155 -	__asm__ __volatile__(
  97.156 -		"# beginning down_write\n\t"
  97.157 -LOCK_PREFIX	"  xadd      %0,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
  97.158 -		"  testl     %0,%0\n\t" /* was the count 0 before? */
  97.159 -		"  jnz       2f\n\t" /* jump if we weren't granted the lock */
  97.160 -		"1:\n\t"
  97.161 -		LOCK_SECTION_START("")
  97.162 -		"2:\n\t"
  97.163 -		"  pushl     %%ecx\n\t"
  97.164 -		"  call      rwsem_down_write_failed\n\t"
  97.165 -		"  popl      %%ecx\n\t"
  97.166 -		"  jmp       1b\n"
  97.167 -		LOCK_SECTION_END
  97.168 -		"# ending down_write"
  97.169 -		: "+d"(tmp), "+m"(sem->count)
  97.170 -		: "a"(sem)
  97.171 -		: "memory", "cc");
  97.172 -}
  97.173 -
  97.174 -/*
  97.175 - * trylock for writing -- returns 1 if successful, 0 if contention
  97.176 - */
  97.177 -static inline int __down_write_trylock(struct rw_semaphore *sem)
  97.178 -{
  97.179 -	signed long ret = cmpxchg(&sem->count,
  97.180 -				  RWSEM_UNLOCKED_VALUE, 
  97.181 -				  RWSEM_ACTIVE_WRITE_BIAS);
  97.182 -	if (ret == RWSEM_UNLOCKED_VALUE)
  97.183 -		return 1;
  97.184 -	return 0;
  97.185 -}
  97.186 -
  97.187 -/*
  97.188 - * unlock after reading
  97.189 - */
  97.190 -static inline void __up_read(struct rw_semaphore *sem)
  97.191 -{
  97.192 -	__s32 tmp = -RWSEM_ACTIVE_READ_BIAS;
  97.193 -	__asm__ __volatile__(
  97.194 -		"# beginning __up_read\n\t"
  97.195 -LOCK_PREFIX	"  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
  97.196 -		"  js        2f\n\t" /* jump if the lock is being waited upon */
  97.197 -		"1:\n\t"
  97.198 -		LOCK_SECTION_START("")
  97.199 -		"2:\n\t"
  97.200 -		"  decw      %%dx\n\t" /* do nothing if still outstanding active readers */
  97.201 -		"  jnz       1b\n\t"
  97.202 -		"  pushl     %%ecx\n\t"
  97.203 -		"  call      rwsem_wake\n\t"
  97.204 -		"  popl      %%ecx\n\t"
  97.205 -		"  jmp       1b\n"
  97.206 -		LOCK_SECTION_END
  97.207 -		"# ending __up_read\n"
  97.208 -		: "+m"(sem->count), "+d"(tmp)
  97.209 -		: "a"(sem)
  97.210 -		: "memory", "cc");
  97.211 -}
  97.212 -
  97.213 -/*
  97.214 - * unlock after writing
  97.215 - */
  97.216 -static inline void __up_write(struct rw_semaphore *sem)
  97.217 -{
  97.218 -	__asm__ __volatile__(
  97.219 -		"# beginning __up_write\n\t"
  97.220 -		"  movl      %2,%%edx\n\t"
  97.221 -LOCK_PREFIX	"  xaddl     %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> 0x00000000 */
  97.222 -		"  jnz       2f\n\t" /* jump if the lock is being waited upon */
  97.223 -		"1:\n\t"
  97.224 -		LOCK_SECTION_START("")
  97.225 -		"2:\n\t"
  97.226 -		"  decw      %%dx\n\t" /* did the active count reduce to 0? */
  97.227 -		"  jnz       1b\n\t" /* jump back if not */
  97.228 -		"  pushl     %%ecx\n\t"
  97.229 -		"  call      rwsem_wake\n\t"
  97.230 -		"  popl      %%ecx\n\t"
  97.231 -		"  jmp       1b\n"
  97.232 -		LOCK_SECTION_END
  97.233 -		"# ending __up_write\n"
  97.234 -		: "+m"(sem->count)
  97.235 -		: "a"(sem), "i"(-RWSEM_ACTIVE_WRITE_BIAS)
  97.236 -		: "memory", "cc", "edx");
  97.237 -}
  97.238 -
  97.239 -/*
  97.240 - * implement atomic add functionality
  97.241 - */
  97.242 -static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
  97.243 -{
  97.244 -	__asm__ __volatile__(
  97.245 -LOCK_PREFIX	"addl %1,%0"
  97.246 -		:"=m"(sem->count)
  97.247 -		:"ir"(delta), "m"(sem->count));
  97.248 -}
  97.249 -
  97.250 -/*
  97.251 - * implement exchange and add functionality
  97.252 - */
  97.253 -static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
  97.254 -{
  97.255 -	int tmp = delta;
  97.256 -
  97.257 -	__asm__ __volatile__(
  97.258 -LOCK_PREFIX	"xadd %0,(%2)"
  97.259 -		: "+r"(tmp), "=m"(sem->count)
  97.260 -		: "r"(sem), "m"(sem->count)
  97.261 -		: "memory");
  97.262 -
  97.263 -	return tmp+delta;
  97.264 -}
  97.265 -
  97.266 -#endif /* __KERNEL__ */
  97.267 -#endif /* _I386_RWSEM_H */
    98.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/scatterlist.h	Fri Mar 14 15:48:09 2003 +0000
    98.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.3 @@ -1,34 +0,0 @@
    98.4 -#ifndef _I386_SCATTERLIST_H
    98.5 -#define _I386_SCATTERLIST_H
    98.6 -
    98.7 -/*
    98.8 - * Drivers must set either ->address or (preferred) ->page and ->offset
    98.9 - * to indicate where data must be transferred to/from.
   98.10 - *
   98.11 - * Using ->page is recommended since it handles highmem data as well as
   98.12 - * low mem. ->address is restricted to data which has a virtual mapping, and
   98.13 - * it will go away in the future. Updating to ->page can be automated very
   98.14 - * easily -- something like
   98.15 - *
   98.16 - * sg->address = some_ptr;
   98.17 - *
   98.18 - * can be rewritten as
   98.19 - *
   98.20 - * sg->page = virt_to_page(some_ptr);
   98.21 - * sg->offset = (unsigned long) some_ptr & ~PAGE_MASK;
   98.22 - *
   98.23 - * and that's it. There's no excuse for not highmem enabling YOUR driver. /jens
   98.24 - */
   98.25 -struct scatterlist {
   98.26 -    char *  address;    /* Location data is to be transferred to, NULL for
   98.27 -			 * highmem page */
   98.28 -    struct page * page; /* Location for highmem page, if any */
   98.29 -    unsigned int offset;/* for highmem, page offset */
   98.30 -
   98.31 -    dma_addr_t dma_address;
   98.32 -    unsigned int length;
   98.33 -};
   98.34 -
   98.35 -#define ISA_DMA_THRESHOLD (0x00ffffff)
   98.36 -
   98.37 -#endif /* !(_I386_SCATTERLIST_H) */
    99.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/semaphore.h	Fri Mar 14 15:48:09 2003 +0000
    99.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.3 @@ -1,222 +0,0 @@
    99.4 -#ifndef _I386_SEMAPHORE_H
    99.5 -#define _I386_SEMAPHORE_H
    99.6 -
    99.7 -#include <linux/linkage.h>
    99.8 -
    99.9 -#ifdef __KERNEL__
   99.10 -
   99.11 -/*
   99.12 - * SMP- and interrupt-safe semaphores..
   99.13 - *
   99.14 - * (C) Copyright 1996 Linus Torvalds
   99.15 - *
   99.16 - * Modified 1996-12-23 by Dave Grothe <dave@gcom.com> to fix bugs in
   99.17 - *                     the original code and to make semaphore waits
   99.18 - *                     interruptible so that processes waiting on
   99.19 - *                     semaphores can be killed.
   99.20 - * Modified 1999-02-14 by Andrea Arcangeli, split the sched.c helper
   99.21 - *		       functions in asm/sempahore-helper.h while fixing a
   99.22 - *		       potential and subtle race discovered by Ulrich Schmid
   99.23 - *		       in down_interruptible(). Since I started to play here I
   99.24 - *		       also implemented the `trylock' semaphore operation.
   99.25 - *          1999-07-02 Artur Skawina <skawina@geocities.com>
   99.26 - *                     Optimized "0(ecx)" -> "(ecx)" (the assembler does not
   99.27 - *                     do this). Changed calling sequences from push/jmp to
   99.28 - *                     traditional call/ret.
   99.29 - * Modified 2001-01-01 Andreas Franck <afranck@gmx.de>
   99.30 - *		       Some hacks to ensure compatibility with recent
   99.31 - *		       GCC snapshots, to avoid stack corruption when compiling
   99.32 - *		       with -fomit-frame-pointer. It's not sure if this will
   99.33 - *		       be fixed in GCC, as our previous implementation was a
   99.34 - *		       bit dubious.
   99.35 - *
   99.36 - * If you would like to see an analysis of this implementation, please
   99.37 - * ftp to gcom.com and download the file
   99.38 - * /pub/linux/src/semaphore/semaphore-2.0.24.tar.gz.
   99.39 - *
   99.40 - */
   99.41 -
   99.42 -#include <asm/system.h>
   99.43 -#include <asm/atomic.h>
   99.44 -#include <linux/wait.h>
   99.45 -#include <linux/rwsem.h>
   99.46 -
   99.47 -struct semaphore {
   99.48 -	atomic_t count;
   99.49 -	int sleepers;
   99.50 -	wait_queue_head_t wait;
   99.51 -#if WAITQUEUE_DEBUG
   99.52 -	long __magic;
   99.53 -#endif
   99.54 -};
   99.55 -
   99.56 -#if WAITQUEUE_DEBUG
   99.57 -# define __SEM_DEBUG_INIT(name) \
   99.58 -		, (int)&(name).__magic
   99.59 -#else
   99.60 -# define __SEM_DEBUG_INIT(name)
   99.61 -#endif
   99.62 -
   99.63 -#define __SEMAPHORE_INITIALIZER(name,count) \
   99.64 -{ ATOMIC_INIT(count), 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
   99.65 -	__SEM_DEBUG_INIT(name) }
   99.66 -
   99.67 -#define __MUTEX_INITIALIZER(name) \
   99.68 -	__SEMAPHORE_INITIALIZER(name,1)
   99.69 -
   99.70 -#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
   99.71 -	struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
   99.72 -
   99.73 -#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
   99.74 -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
   99.75 -
   99.76 -static inline void sema_init (struct semaphore *sem, int val)
   99.77 -{
   99.78 -/*
   99.79 - *	*sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val);
   99.80 - *
   99.81 - * i'd rather use the more flexible initialization above, but sadly
   99.82 - * GCC 2.7.2.3 emits a bogus warning. EGCS doesnt. Oh well.
   99.83 - */
   99.84 -	atomic_set(&sem->count, val);
   99.85 -	sem->sleepers = 0;
   99.86 -	init_waitqueue_head(&sem->wait);
   99.87 -#if WAITQUEUE_DEBUG
   99.88 -	sem->__magic = (int)&sem->__magic;
   99.89 -#endif
   99.90 -}
   99.91 -
   99.92 -static inline void init_MUTEX (struct semaphore *sem)
   99.93 -{
   99.94 -	sema_init(sem, 1);
   99.95 -}
   99.96 -
   99.97 -static inline void init_MUTEX_LOCKED (struct semaphore *sem)
   99.98 -{
   99.99 -	sema_init(sem, 0);
  99.100 -}
  99.101 -
  99.102 -asmlinkage void __down_failed(void /* special register calling convention */);
  99.103 -asmlinkage int  __down_failed_interruptible(void  /* params in registers */);
  99.104 -asmlinkage int  __down_failed_trylock(void  /* params in registers */);
  99.105 -asmlinkage void __up_wakeup(void /* special register calling convention */);
  99.106 -
  99.107 -asmlinkage void __down(struct semaphore * sem);
  99.108 -asmlinkage int  __down_interruptible(struct semaphore * sem);
  99.109 -asmlinkage int  __down_trylock(struct semaphore * sem);
  99.110 -asmlinkage void __up(struct semaphore * sem);
  99.111 -
  99.112 -/*
  99.113 - * This is ugly, but we want the default case to fall through.
  99.114 - * "__down_failed" is a special asm handler that calls the C
  99.115 - * routine that actually waits. See arch/i386/kernel/semaphore.c
  99.116 - */
  99.117 -static inline void down(struct semaphore * sem)
  99.118 -{
  99.119 -#if WAITQUEUE_DEBUG
  99.120 -	CHECK_MAGIC(sem->__magic);
  99.121 -#endif
  99.122 -
  99.123 -	__asm__ __volatile__(
  99.124 -		"# atomic down operation\n\t"
  99.125 -		LOCK "decl %0\n\t"     /* --sem->count */
  99.126 -		"js 2f\n"
  99.127 -		"1:\n"
  99.128 -		LOCK_SECTION_START("")
  99.129 -		"2:\tcall __down_failed\n\t"
  99.130 -		"jmp 1b\n"
  99.131 -		LOCK_SECTION_END
  99.132 -		:"=m" (sem->count)
  99.133 -		:"c" (sem)
  99.134 -		:"memory");
  99.135 -}
  99.136 -
  99.137 -/*
  99.138 - * Interruptible try to acquire a semaphore.  If we obtained
  99.139 - * it, return zero.  If we were interrupted, returns -EINTR
  99.140 - */
  99.141 -static inline int down_interruptible(struct semaphore * sem)
  99.142 -{
  99.143 -	int result;
  99.144 -
  99.145 -#if WAITQUEUE_DEBUG
  99.146 -	CHECK_MAGIC(sem->__magic);
  99.147 -#endif
  99.148 -
  99.149 -	__asm__ __volatile__(
  99.150 -		"# atomic interruptible down operation\n\t"
  99.151 -		LOCK "decl %1\n\t"     /* --sem->count */
  99.152 -		"js 2f\n\t"
  99.153 -		"xorl %0,%0\n"
  99.154 -		"1:\n"
  99.155 -		LOCK_SECTION_START("")
  99.156 -		"2:\tcall __down_failed_interruptible\n\t"
  99.157 -		"jmp 1b\n"
  99.158 -		LOCK_SECTION_END
  99.159 -		:"=a" (result), "=m" (sem->count)
  99.160 -		:"c" (sem)
  99.161 -		:"memory");
  99.162 -	return result;
  99.163 -}
  99.164 -
  99.165 -/*
  99.166 - * Non-blockingly attempt to down() a semaphore.
  99.167 - * Returns zero if we acquired it
  99.168 - */
  99.169 -static inline int down_trylock(struct semaphore * sem)
  99.170 -{
  99.171 -	int result;
  99.172 -
  99.173 -#if WAITQUEUE_DEBUG
  99.174 -	CHECK_MAGIC(sem->__magic);
  99.175 -#endif
  99.176 -
  99.177 -	__asm__ __volatile__(
  99.178 -		"# atomic interruptible down operation\n\t"
  99.179 -		LOCK "decl %1\n\t"     /* --sem->count */
  99.180 -		"js 2f\n\t"
  99.181 -		"xorl %0,%0\n"
  99.182 -		"1:\n"
  99.183 -		LOCK_SECTION_START("")
  99.184 -		"2:\tcall __down_failed_trylock\n\t"
  99.185 -		"jmp 1b\n"
  99.186 -		LOCK_SECTION_END
  99.187 -		:"=a" (result), "=m" (sem->count)
  99.188 -		:"c" (sem)
  99.189 -		:"memory");
  99.190 -	return result;
  99.191 -}
  99.192 -
  99.193 -/*
  99.194 - * Note! This is subtle. We jump to wake people up only if
  99.195 - * the semaphore was negative (== somebody was waiting on it).
  99.196 - * The default case (no contention) will result in NO
  99.197 - * jumps for both down() and up().
  99.198 - */
  99.199 -static inline void up(struct semaphore * sem)
  99.200 -{
  99.201 -#if WAITQUEUE_DEBUG
  99.202 -	CHECK_MAGIC(sem->__magic);
  99.203 -#endif
  99.204 -	__asm__ __volatile__(
  99.205 -		"# atomic up operation\n\t"
  99.206 -		LOCK "incl %0\n\t"     /* ++sem->count */
  99.207 -		"jle 2f\n"
  99.208 -		"1:\n"
  99.209 -		LOCK_SECTION_START("")
  99.210 -		"2:\tcall __up_wakeup\n\t"
  99.211 -		"jmp 1b\n"
  99.212 -		LOCK_SECTION_END
  99.213 -		".subsection 0\n"
  99.214 -		:"=m" (sem->count)
  99.215 -		:"c" (sem)
  99.216 -		:"memory");
  99.217 -}
  99.218 -
  99.219 -static inline int sem_getcount(struct semaphore *sem)
  99.220 -{
  99.221 -	return atomic_read(&sem->count);
  99.222 -}
  99.223 -
  99.224 -#endif
  99.225 -#endif
   100.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sembuf.h	Fri Mar 14 15:48:09 2003 +0000
   100.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.3 @@ -1,25 +0,0 @@
   100.4 -#ifndef _I386_SEMBUF_H
   100.5 -#define _I386_SEMBUF_H
   100.6 -
   100.7 -/* 
   100.8 - * The semid64_ds structure for i386 architecture.
   100.9 - * Note extra padding because this structure is passed back and forth
  100.10 - * between kernel and user space.
  100.11 - *
  100.12 - * Pad space is left for:
  100.13 - * - 64-bit time_t to solve y2038 problem
  100.14 - * - 2 miscellaneous 32-bit values
  100.15 - */
  100.16 -
  100.17 -struct semid64_ds {
  100.18 -	struct ipc64_perm sem_perm;		/* permissions .. see ipc.h */
  100.19 -	__kernel_time_t	sem_otime;		/* last semop time */
  100.20 -	unsigned long	__unused1;
  100.21 -	__kernel_time_t	sem_ctime;		/* last change time */
  100.22 -	unsigned long	__unused2;
  100.23 -	unsigned long	sem_nsems;		/* no. of semaphores in array */
  100.24 -	unsigned long	__unused3;
  100.25 -	unsigned long	__unused4;
  100.26 -};
  100.27 -
  100.28 -#endif /* _I386_SEMBUF_H */
   101.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/serial.h	Fri Mar 14 15:48:09 2003 +0000
   101.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.3 @@ -1,148 +0,0 @@
   101.4 -/*
   101.5 - * include/asm-i386/serial.h
   101.6 - */
   101.7 -
   101.8 -#include <linux/config.h>
   101.9 -
  101.10 -/*
  101.11 - * This assumes you have a 1.8432 MHz clock for your UART.
  101.12 - *
  101.13 - * It'd be nice if someone built a serial card with a 24.576 MHz
  101.14 - * clock, since the 16550A is capable of handling a top speed of 1.5
  101.15 - * megabits/second; but this requires the faster clock.
  101.16 - */
  101.17 -#define BASE_BAUD ( 1843200 / 16 )
  101.18 -
  101.19 -/* Standard COM flags (except for COM4, because of the 8514 problem) */
  101.20 -#ifdef CONFIG_SERIAL_DETECT_IRQ
  101.21 -#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
  101.22 -#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
  101.23 -#else
  101.24 -#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
  101.25 -#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
  101.26 -#endif
  101.27 -
  101.28 -#ifdef CONFIG_SERIAL_MANY_PORTS
  101.29 -#define FOURPORT_FLAGS ASYNC_FOURPORT
  101.30 -#define ACCENT_FLAGS 0
  101.31 -#define BOCA_FLAGS 0
  101.32 -#define HUB6_FLAGS 0
  101.33 -#define RS_TABLE_SIZE	64
  101.34 -#else
  101.35 -#define RS_TABLE_SIZE
  101.36 -#endif
  101.37 -
  101.38 -#define MCA_COM_FLAGS	(STD_COM_FLAGS|ASYNC_BOOT_ONLYMCA)
  101.39 -
  101.40 -/*
  101.41 - * The following define the access methods for the HUB6 card. All
  101.42 - * access is through two ports for all 24 possible chips. The card is
  101.43 - * selected through the high 2 bits, the port on that card with the
  101.44 - * "middle" 3 bits, and the register on that port with the bottom
  101.45 - * 3 bits.
  101.46 - *
  101.47 - * While the access port and interrupt is configurable, the default
  101.48 - * port locations are 0x302 for the port control register, and 0x303
  101.49 - * for the data read/write register. Normally, the interrupt is at irq3
  101.50 - * but can be anything from 3 to 7 inclusive. Note that using 3 will
  101.51 - * require disabling com2.
  101.52 - */
  101.53 -
  101.54 -#define C_P(card,port) (((card)<<6|(port)<<3) + 1)
  101.55 -
  101.56 -#define STD_SERIAL_PORT_DEFNS			\
  101.57 -	/* UART CLK   PORT IRQ     FLAGS        */			\
  101.58 -	{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },	/* ttyS0 */	\
  101.59 -	{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },	/* ttyS1 */	\
  101.60 -	{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },	/* ttyS2 */	\
  101.61 -	{ 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },	/* ttyS3 */
  101.62 -
  101.63 -/*
  101.64 - * HCDP_SERIAL_PORT_DEFNS should be placed in exactly the same slot 
  101.65 - * in rs_table as defined by HCDP_SERIAL_CONSOLE_PORT in 
  101.66 - * include/linux/serial.h
  101.67 - */
  101.68 -#define HCDP_SERIAL_PORT_DEFNS	\
  101.69 -	{ 0, BASE_BAUD, -1, 0, STD_COM_FLAGS},		/* ttySx device
  101.70 -							   in comments sucks.
  101.71 -							   You add an entry
  101.72 -							   and you get to edit 
  101.73 -							   boatloads of these 
  101.74 -							   comments. Not worth
  101.75 -							   it */
  101.76 -
  101.77 -
  101.78 -#ifdef CONFIG_SERIAL_MANY_PORTS
  101.79 -#define EXTRA_SERIAL_PORT_DEFNS			\
  101.80 -	{ 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, 	/* ttyS4 */	\
  101.81 -	{ 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS },	/* ttyS5 */	\
  101.82 -	{ 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS },	/* ttyS6 */	\
  101.83 -	{ 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS },	/* ttyS7 */	\
  101.84 -	{ 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS },	/* ttyS8 */	\
  101.85 -	{ 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS },	/* ttyS9 */	\
  101.86 -	{ 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS },	/* ttyS10 */	\
  101.87 -	{ 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS },	/* ttyS11 */	\
  101.88 -	{ 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS },	/* ttyS12 */	\
  101.89 -	{ 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS },	/* ttyS13 */	\
  101.90 -	{ 0, BASE_BAUD, 0x000, 0, 0 },	/* ttyS14 (spare) */		\
  101.91 -	{ 0, BASE_BAUD, 0x000, 0, 0 },	/* ttyS15 (spare) */		\
  101.92 -	{ 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS },	/* ttyS16 */	\
  101.93 -	{ 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS },	/* ttyS17 */	\
  101.94 -	{ 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS },	/* ttyS18 */	\
  101.95 -	{ 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS },	/* ttyS19 */	\
  101.96 -	{ 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS },	/* ttyS20 */	\
  101.97 -	{ 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS },	/* ttyS21 */	\
  101.98 -	{ 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS },	/* ttyS22 */	\
  101.99 -	{ 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS },	/* ttyS23 */	\
 101.100 -	{ 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS },	/* ttyS24 */	\
 101.101 -	{ 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS },	/* ttyS25 */	\
 101.102 -	{ 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS },	/* ttyS26 */	\
 101.103 -	{ 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS },	/* ttyS27 */	\
 101.104 -	{ 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS },	/* ttyS28 */	\
 101.105 -	{ 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS },	/* ttyS29 */	\
 101.106 -	{ 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS },	/* ttyS30 */	\
 101.107 -	{ 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS },	/* ttyS31 */
 101.108 -#else
 101.109 -#define EXTRA_SERIAL_PORT_DEFNS
 101.110 -#endif
 101.111 -
 101.112 -/* You can have up to four HUB6's in the system, but I've only
 101.113 - * included two cards here for a total of twelve ports.
 101.114 - */
 101.115 -#if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
 101.116 -#define HUB6_SERIAL_PORT_DFNS		\
 101.117 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) },  /* ttyS32 */	\
 101.118 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) },  /* ttyS33 */	\
 101.119 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) },  /* ttyS34 */	\
 101.120 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) },  /* ttyS35 */	\
 101.121 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) },  /* ttyS36 */	\
 101.122 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) },  /* ttyS37 */	\
 101.123 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) },  /* ttyS38 */	\
 101.124 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) },  /* ttyS39 */	\
 101.125 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) },  /* ttyS40 */	\
 101.126 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) },  /* ttyS41 */	\
 101.127 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) },  /* ttyS42 */	\
 101.128 -	{ 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) },  /* ttyS43 */
 101.129 -#else
 101.130 -#define HUB6_SERIAL_PORT_DFNS
 101.131 -#endif
 101.132 -
 101.133 -#ifdef CONFIG_MCA
 101.134 -#define MCA_SERIAL_PORT_DFNS			\
 101.135 -	{ 0, BASE_BAUD, 0x3220, 3, MCA_COM_FLAGS },	\
 101.136 -	{ 0, BASE_BAUD, 0x3228, 3, MCA_COM_FLAGS },	\
 101.137 -	{ 0, BASE_BAUD, 0x4220, 3, MCA_COM_FLAGS },	\
 101.138 -	{ 0, BASE_BAUD, 0x4228, 3, MCA_COM_FLAGS },	\
 101.139 -	{ 0, BASE_BAUD, 0x5220, 3, MCA_COM_FLAGS },	\
 101.140 -	{ 0, BASE_BAUD, 0x5228, 3, MCA_COM_FLAGS },
 101.141 -#else
 101.142 -#define MCA_SERIAL_PORT_DFNS
 101.143 -#endif
 101.144 -
 101.145 -#define SERIAL_PORT_DFNS		\
 101.146 -	STD_SERIAL_PORT_DEFNS		\
 101.147 -	HCDP_SERIAL_PORT_DEFNS		\
 101.148 -	EXTRA_SERIAL_PORT_DEFNS		\
 101.149 -	HUB6_SERIAL_PORT_DFNS		\
 101.150 -	MCA_SERIAL_PORT_DFNS
 101.151 -
   102.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/setup.h	Fri Mar 14 15:48:09 2003 +0000
   102.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.3 @@ -1,10 +0,0 @@
   102.4 -/*
   102.5 - *	Just a place holder. We don't want to have to test x86 before
   102.6 - *	we include stuff
   102.7 - */
   102.8 -
   102.9 -#ifndef _i386_SETUP_H
  102.10 -#define _i386_SETUP_H
  102.11 -
  102.12 -
  102.13 -#endif /* _i386_SETUP_H */
   103.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/shmbuf.h	Fri Mar 14 15:48:09 2003 +0000
   103.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.3 @@ -1,42 +0,0 @@
   103.4 -#ifndef _I386_SHMBUF_H
   103.5 -#define _I386_SHMBUF_H
   103.6 -
   103.7 -/* 
   103.8 - * The shmid64_ds structure for i386 architecture.
   103.9 - * Note extra padding because this structure is passed back and forth
  103.10 - * between kernel and user space.
  103.11 - *
  103.12 - * Pad space is left for:
  103.13 - * - 64-bit time_t to solve y2038 problem
  103.14 - * - 2 miscellaneous 32-bit values
  103.15 - */
  103.16 -
  103.17 -struct shmid64_ds {
  103.18 -	struct ipc64_perm	shm_perm;	/* operation perms */
  103.19 -	size_t			shm_segsz;	/* size of segment (bytes) */
  103.20 -	__kernel_time_t		shm_atime;	/* last attach time */
  103.21 -	unsigned long		__unused1;
  103.22 -	__kernel_time_t		shm_dtime;	/* last detach time */
  103.23 -	unsigned long		__unused2;
  103.24 -	__kernel_time_t		shm_ctime;	/* last change time */
  103.25 -	unsigned long		__unused3;
  103.26 -	__kernel_pid_t		shm_cpid;	/* pid of creator */
  103.27 -	__kernel_pid_t		shm_lpid;	/* pid of last operator */
  103.28 -	unsigned long		shm_nattch;	/* no. of current attaches */
  103.29 -	unsigned long		__unused4;
  103.30 -	unsigned long		__unused5;
  103.31 -};
  103.32 -
  103.33 -struct shminfo64 {
  103.34 -	unsigned long	shmmax;
  103.35 -	unsigned long	shmmin;
  103.36 -	unsigned long	shmmni;
  103.37 -	unsigned long	shmseg;
  103.38 -	unsigned long	shmall;
  103.39 -	unsigned long	__unused1;
  103.40 -	unsigned long	__unused2;
  103.41 -	unsigned long	__unused3;
  103.42 -	unsigned long	__unused4;
  103.43 -};
  103.44 -
  103.45 -#endif /* _I386_SHMBUF_H */
   104.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/shmparam.h	Fri Mar 14 15:48:09 2003 +0000
   104.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.3 @@ -1,6 +0,0 @@
   104.4 -#ifndef _ASMI386_SHMPARAM_H
   104.5 -#define _ASMI386_SHMPARAM_H
   104.6 -
   104.7 -#define	SHMLBA PAGE_SIZE		 /* attach addr a multiple of this */
   104.8 -
   104.9 -#endif /* _ASMI386_SHMPARAM_H */
   105.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sigcontext.h	Fri Mar 14 15:48:09 2003 +0000
   105.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.3 @@ -1,83 +0,0 @@
   105.4 -#ifndef _ASMi386_SIGCONTEXT_H
   105.5 -#define _ASMi386_SIGCONTEXT_H
   105.6 -
   105.7 -/*
   105.8 - * As documented in the iBCS2 standard..
   105.9 - *
  105.10 - * The first part of "struct _fpstate" is just the normal i387
  105.11 - * hardware setup, the extra "status" word is used to save the
  105.12 - * coprocessor status word before entering the handler.
  105.13 - *
  105.14 - * Pentium III FXSR, SSE support
  105.15 - *	Gareth Hughes <gareth@valinux.com>, May 2000
  105.16 - *
  105.17 - * The FPU state data structure has had to grow to accomodate the
  105.18 - * extended FPU state required by the Streaming SIMD Extensions.
  105.19 - * There is no documented standard to accomplish this at the moment.
  105.20 - */
  105.21 -struct _fpreg {
  105.22 -	unsigned short significand[4];
  105.23 -	unsigned short exponent;
  105.24 -};
  105.25 -
  105.26 -struct _fpxreg {
  105.27 -	unsigned short significand[4];
  105.28 -	unsigned short exponent;
  105.29 -	unsigned short padding[3];
  105.30 -};
  105.31 -
  105.32 -struct _xmmreg {
  105.33 -	unsigned long element[4];
  105.34 -};
  105.35 -
  105.36 -struct _fpstate {
  105.37 -	/* Regular FPU environment */
  105.38 -	unsigned long 	cw;
  105.39 -	unsigned long	sw;
  105.40 -	unsigned long	tag;
  105.41 -	unsigned long	ipoff;
  105.42 -	unsigned long	cssel;
  105.43 -	unsigned long	dataoff;
  105.44 -	unsigned long	datasel;
  105.45 -	struct _fpreg	_st[8];
  105.46 -	unsigned short	status;
  105.47 -	unsigned short	magic;		/* 0xffff = regular FPU data only */
  105.48 -
  105.49 -	/* FXSR FPU environment */
  105.50 -	unsigned long	_fxsr_env[6];	/* FXSR FPU env is ignored */
  105.51 -	unsigned long	mxcsr;
  105.52 -	unsigned long	reserved;
  105.53 -	struct _fpxreg	_fxsr_st[8];	/* FXSR FPU reg data is ignored */
  105.54 -	struct _xmmreg	_xmm[8];
  105.55 -	unsigned long	padding[56];
  105.56 -};
  105.57 -
  105.58 -#define X86_FXSR_MAGIC		0x0000
  105.59 -
  105.60 -struct sigcontext {
  105.61 -	unsigned short gs, __gsh;
  105.62 -	unsigned short fs, __fsh;
  105.63 -	unsigned short es, __esh;
  105.64 -	unsigned short ds, __dsh;
  105.65 -	unsigned long edi;
  105.66 -	unsigned long esi;
  105.67 -	unsigned long ebp;
  105.68 -	unsigned long esp;
  105.69 -	unsigned long ebx;
  105.70 -	unsigned long edx;
  105.71 -	unsigned long ecx;
  105.72 -	unsigned long eax;
  105.73 -	unsigned long trapno;
  105.74 -	unsigned long err;
  105.75 -	unsigned long eip;
  105.76 -	unsigned short cs, __csh;
  105.77 -	unsigned long eflags;
  105.78 -	unsigned long esp_at_signal;
  105.79 -	unsigned short ss, __ssh;
  105.80 -	struct _fpstate * fpstate;
  105.81 -	unsigned long oldmask;
  105.82 -	unsigned long cr2;
  105.83 -};
  105.84 -
  105.85 -
  105.86 -#endif
   106.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/siginfo.h	Fri Mar 14 15:48:09 2003 +0000
   106.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.3 @@ -1,233 +0,0 @@
   106.4 -#ifndef _I386_SIGINFO_H
   106.5 -#define _I386_SIGINFO_H
   106.6 -
   106.7 -#include <linux/types.h>
   106.8 -
   106.9 -/* XXX: This structure was copied from the Alpha; is there an iBCS version?  */
  106.10 -
  106.11 -typedef union sigval {
  106.12 -	int sival_int;
  106.13 -	void *sival_ptr;
  106.14 -} sigval_t;
  106.15 -
  106.16 -#define SI_MAX_SIZE	128
  106.17 -#define SI_PAD_SIZE	((SI_MAX_SIZE/sizeof(int)) - 3)
  106.18 -
  106.19 -typedef struct siginfo {
  106.20 -	int si_signo;
  106.21 -	int si_errno;
  106.22 -	int si_code;
  106.23 -
  106.24 -	union {
  106.25 -		int _pad[SI_PAD_SIZE];
  106.26 -
  106.27 -		/* kill() */
  106.28 -		struct {
  106.29 -			pid_t _pid;		/* sender's pid */
  106.30 -			uid_t _uid;		/* sender's uid */
  106.31 -		} _kill;
  106.32 -
  106.33 -		/* POSIX.1b timers */
  106.34 -		struct {
  106.35 -			unsigned int _timer1;
  106.36 -			unsigned int _timer2;
  106.37 -		} _timer;
  106.38 -
  106.39 -		/* POSIX.1b signals */
  106.40 -		struct {
  106.41 -			pid_t _pid;		/* sender's pid */
  106.42 -			uid_t _uid;		/* sender's uid */
  106.43 -			sigval_t _sigval;
  106.44 -		} _rt;
  106.45 -
  106.46 -		/* SIGCHLD */
  106.47 -		struct {
  106.48 -			pid_t _pid;		/* which child */
  106.49 -			uid_t _uid;		/* sender's uid */
  106.50 -			int _status;		/* exit code */
  106.51 -			clock_t _utime;
  106.52 -			clock_t _stime;
  106.53 -		} _sigchld;
  106.54 -
  106.55 -		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
  106.56 -		struct {
  106.57 -			void *_addr; /* faulting insn/memory ref. */
  106.58 -		} _sigfault;
  106.59 -
  106.60 -		/* SIGPOLL */
  106.61 -		struct {
  106.62 -			int _band;	/* POLL_IN, POLL_OUT, POLL_MSG */
  106.63 -			int _fd;
  106.64 -		} _sigpoll;
  106.65 -	} _sifields;
  106.66 -} siginfo_t;
  106.67 -
  106.68 -/*
  106.69 - * How these fields are to be accessed.
  106.70 - */
  106.71 -#define si_pid		_sifields._kill._pid
  106.72 -#define si_uid		_sifields._kill._uid
  106.73 -#define si_status	_sifields._sigchld._status
  106.74 -#define si_utime	_sifields._sigchld._utime
  106.75 -#define si_stime	_sifields._sigchld._stime
  106.76 -#define si_value	_sifields._rt._sigval
  106.77 -#define si_int		_sifields._rt._sigval.sival_int
  106.78 -#define si_ptr		_sifields._rt._sigval.sival_ptr
  106.79 -#define si_addr		_sifields._sigfault._addr
  106.80 -#define si_band		_sifields._sigpoll._band
  106.81 -#define si_fd		_sifields._sigpoll._fd
  106.82 -
  106.83 -#ifdef __KERNEL__
  106.84 -#define __SI_MASK	0xffff0000
  106.85 -#define __SI_KILL	(0 << 16)
  106.86 -#define __SI_TIMER	(1 << 16)
  106.87 -#define __SI_POLL	(2 << 16)
  106.88 -#define __SI_FAULT	(3 << 16)
  106.89 -#define __SI_CHLD	(4 << 16)
  106.90 -#define __SI_RT		(5 << 16)
  106.91 -#define __SI_CODE(T,N)	((T) << 16 | ((N) & 0xffff))
  106.92 -#else
  106.93 -#define __SI_KILL	0
  106.94 -#define __SI_TIMER	0
  106.95 -#define __SI_POLL	0
  106.96 -#define __SI_FAULT	0
  106.97 -#define __SI_CHLD	0
  106.98 -#define __SI_RT		0
  106.99 -#define __SI_CODE(T,N)	(N)
 106.100 -#endif
 106.101 -
 106.102 -/*
 106.103 - * si_code values
 106.104 - * Digital reserves positive values for kernel-generated signals.
 106.105 - */
 106.106 -#define SI_USER		0		/* sent by kill, sigsend, raise */
 106.107 -#define SI_KERNEL	0x80		/* sent by the kernel from somewhere */
 106.108 -#define SI_QUEUE	-1		/* sent by sigqueue */
 106.109 -#define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */
 106.110 -#define SI_MESGQ	-3		/* sent by real time mesq state change */
 106.111 -#define SI_ASYNCIO	-4		/* sent by AIO completion */
 106.112 -#define SI_SIGIO	-5		/* sent by queued SIGIO */
 106.113 -#define SI_TKILL	-6		/* sent by tkill system call */
 106.114 -
 106.115 -#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
 106.116 -#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
 106.117 -
 106.118 -/*
 106.119 - * SIGILL si_codes
 106.120 - */
 106.121 -#define ILL_ILLOPC	(__SI_FAULT|1)	/* illegal opcode */
 106.122 -#define ILL_ILLOPN	(__SI_FAULT|2)	/* illegal operand */
 106.123 -#define ILL_ILLADR	(__SI_FAULT|3)	/* illegal addressing mode */
 106.124 -#define ILL_ILLTRP	(__SI_FAULT|4)	/* illegal trap */
 106.125 -#define ILL_PRVOPC	(__SI_FAULT|5)	/* privileged opcode */
 106.126 -#define ILL_PRVREG	(__SI_FAULT|6)	/* privileged register */
 106.127 -#define ILL_COPROC	(__SI_FAULT|7)	/* coprocessor error */
 106.128 -#define ILL_BADSTK	(__SI_FAULT|8)	/* internal stack error */
 106.129 -#define NSIGILL		8
 106.130 -
 106.131 -/*
 106.132 - * SIGFPE si_codes
 106.133 - */
 106.134 -#define FPE_INTDIV	(__SI_FAULT|1)	/* integer divide by zero */
 106.135 -#define FPE_INTOVF	(__SI_FAULT|2)	/* integer overflow */
 106.136 -#define FPE_FLTDIV	(__SI_FAULT|3)	/* floating point divide by zero */
 106.137 -#define FPE_FLTOVF	(__SI_FAULT|4)	/* floating point overflow */
 106.138 -#define FPE_FLTUND	(__SI_FAULT|5)	/* floating point underflow */
 106.139 -#define FPE_FLTRES	(__SI_FAULT|6)	/* floating point inexact result */
 106.140 -#define FPE_FLTINV	(__SI_FAULT|7)	/* floating point invalid operation */
 106.141 -#define FPE_FLTSUB	(__SI_FAULT|8)	/* subscript out of range */
 106.142 -#define NSIGFPE		8
 106.143 -
 106.144 -/*
 106.145 - * SIGSEGV si_codes
 106.146 - */
 106.147 -#define SEGV_MAPERR	(__SI_FAULT|1)	/* address not mapped to object */
 106.148 -#define SEGV_ACCERR	(__SI_FAULT|2)	/* invalid permissions for mapped object */
 106.149 -#define NSIGSEGV	2
 106.150 -
 106.151 -/*
 106.152 - * SIGBUS si_codes
 106.153 - */
 106.154 -#define BUS_ADRALN	(__SI_FAULT|1)	/* invalid address alignment */
 106.155 -#define BUS_ADRERR	(__SI_FAULT|2)	/* non-existant physical address */
 106.156 -#define BUS_OBJERR	(__SI_FAULT|3)	/* object specific hardware error */
 106.157 -#define NSIGBUS		3
 106.158 -
 106.159 -/*
 106.160 - * SIGTRAP si_codes
 106.161 - */
 106.162 -#define TRAP_BRKPT	(__SI_FAULT|1)	/* process breakpoint */
 106.163 -#define TRAP_TRACE	(__SI_FAULT|2)	/* process trace trap */
 106.164 -#define NSIGTRAP	2
 106.165 -
 106.166 -/*
 106.167 - * SIGCHLD si_codes
 106.168 - */
 106.169 -#define CLD_EXITED	(__SI_CHLD|1)	/* child has exited */
 106.170 -#define CLD_KILLED	(__SI_CHLD|2)	/* child was killed */
 106.171 -#define CLD_DUMPED	(__SI_CHLD|3)	/* child terminated abnormally */
 106.172 -#define CLD_TRAPPED	(__SI_CHLD|4)	/* traced child has trapped */
 106.173 -#define CLD_STOPPED	(__SI_CHLD|5)	/* child has stopped */
 106.174 -#define CLD_CONTINUED	(__SI_CHLD|6)	/* stopped child has continued */
 106.175 -#define NSIGCHLD	6
 106.176 -
 106.177 -/*
 106.178 - * SIGPOLL si_codes
 106.179 - */
 106.180 -#define POLL_IN		(__SI_POLL|1)	/* data input available */
 106.181 -#define POLL_OUT	(__SI_POLL|2)	/* output buffers available */
 106.182 -#define POLL_MSG	(__SI_POLL|3)	/* input message available */
 106.183 -#define POLL_ERR	(__SI_POLL|4)	/* i/o error */
 106.184 -#define POLL_PRI	(__SI_POLL|5)	/* high priority input available */
 106.185 -#define POLL_HUP	(__SI_POLL|6)	/* device disconnected */
 106.186 -#define NSIGPOLL	6
 106.187 -
 106.188 -/*
 106.189 - * sigevent definitions
 106.190 - * 
 106.191 - * It seems likely that SIGEV_THREAD will have to be handled from 
 106.192 - * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
 106.193 - * thread manager then catches and does the appropriate nonsense.
 106.194 - * However, everything is written out here so as to not get lost.
 106.195 - */
 106.196 -#define SIGEV_SIGNAL	0	/* notify via signal */
 106.197 -#define SIGEV_NONE	1	/* other notification: meaningless */
 106.198 -#define SIGEV_THREAD	2	/* deliver via thread creation */
 106.199 -
 106.200 -#define SIGEV_MAX_SIZE	64
 106.201 -#define SIGEV_PAD_SIZE	((SIGEV_MAX_SIZE/sizeof(int)) - 3)
 106.202 -
 106.203 -typedef struct sigevent {
 106.204 -	sigval_t sigev_value;
 106.205 -	int sigev_signo;
 106.206 -	int sigev_notify;
 106.207 -	union {
 106.208 -		int _pad[SIGEV_PAD_SIZE];
 106.209 -
 106.210 -		struct {
 106.211 -			void (*_function)(sigval_t);
 106.212 -			void *_attribute;	/* really pthread_attr_t */
 106.213 -		} _sigev_thread;
 106.214 -	} _sigev_un;
 106.215 -} sigevent_t;
 106.216 -
 106.217 -#define sigev_notify_function	_sigev_un._sigev_thread._function
 106.218 -#define sigev_notify_attributes	_sigev_un._sigev_thread._attribute
 106.219 -
 106.220 -#ifdef __KERNEL__
 106.221 -#include <linux/string.h>
 106.222 -
 106.223 -static inline void copy_siginfo(siginfo_t *to, siginfo_t *from)
 106.224 -{
 106.225 -	if (from->si_code < 0)
 106.226 -		memcpy(to, from, sizeof(siginfo_t));
 106.227 -	else
 106.228 -		/* _sigchld is currently the largest know union member */
 106.229 -		memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
 106.230 -}
 106.231 -
 106.232 -extern int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from);
 106.233 -
 106.234 -#endif /* __KERNEL__ */
 106.235 -
 106.236 -#endif
   107.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/signal.h	Fri Mar 14 15:48:09 2003 +0000
   107.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.3 @@ -1,221 +0,0 @@
   107.4 -#ifndef _ASMi386_SIGNAL_H
   107.5 -#define _ASMi386_SIGNAL_H
   107.6 -
   107.7 -#include <linux/types.h>
   107.8 -
   107.9 -/* Avoid too many header ordering problems.  */
  107.10 -struct siginfo;
  107.11 -
  107.12 -#ifdef __KERNEL__
  107.13 -/* Most things should be clean enough to redefine this at will, if care
  107.14 -   is taken to make libc match.  */
  107.15 -
  107.16 -#define _NSIG		64
  107.17 -#define _NSIG_BPW	32
  107.18 -#define _NSIG_WORDS	(_NSIG / _NSIG_BPW)
  107.19 -
  107.20 -typedef unsigned long old_sigset_t;		/* at least 32 bits */
  107.21 -
  107.22 -typedef struct {
  107.23 -	unsigned long sig[_NSIG_WORDS];
  107.24 -} sigset_t;
  107.25 -
  107.26 -#else
  107.27 -/* Here we must cater to libcs that poke about in kernel headers.  */
  107.28 -
  107.29 -#define NSIG		32
  107.30 -typedef unsigned long sigset_t;
  107.31 -
  107.32 -#endif /* __KERNEL__ */
  107.33 -
  107.34 -#define SIGHUP		 1
  107.35 -#define SIGINT		 2
  107.36 -#define SIGQUIT		 3
  107.37 -#define SIGILL		 4
  107.38 -#define SIGTRAP		 5
  107.39 -#define SIGABRT		 6
  107.40 -#define SIGIOT		 6
  107.41 -#define SIGBUS		 7
  107.42 -#define SIGFPE		 8
  107.43 -#define SIGKILL		 9
  107.44 -#define SIGUSR1		10
  107.45 -#define SIGSEGV		11
  107.46 -#define SIGUSR2		12
  107.47 -#define SIGPIPE		13
  107.48 -#define SIGALRM		14
  107.49 -#define SIGTERM		15
  107.50 -#define SIGSTKFLT	16
  107.51 -#define SIGCHLD		17
  107.52 -#define SIGCONT		18
  107.53 -#define SIGSTOP		19
  107.54 -#define SIGTSTP		20
  107.55 -#define SIGTTIN		21
  107.56 -#define SIGTTOU		22
  107.57 -#define SIGURG		23
  107.58 -#define SIGXCPU		24
  107.59 -#define SIGXFSZ		25
  107.60 -#define SIGVTALRM	26
  107.61 -#define SIGPROF		27
  107.62 -#define SIGWINCH	28
  107.63 -#define SIGIO		29
  107.64 -#define SIGPOLL		SIGIO
  107.65 -/*
  107.66 -#define SIGLOST		29
  107.67 -*/
  107.68 -#define SIGPWR		30
  107.69 -#define SIGSYS		31
  107.70 -#define	SIGUNUSED	31
  107.71 -
  107.72 -/* These should not be considered constants from userland.  */
  107.73 -#define SIGRTMIN	32
  107.74 -#define SIGRTMAX	(_NSIG-1)
  107.75 -
  107.76 -/*
  107.77 - * SA_FLAGS values:
  107.78 - *
  107.79 - * SA_ONSTACK indicates that a registered stack_t will be used.
  107.80 - * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  107.81 - * SA_RESTART flag to get restarting signals (which were the default long ago)
  107.82 - * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  107.83 - * SA_RESETHAND clears the handler when the signal is delivered.
  107.84 - * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  107.85 - * SA_NODEFER prevents the current signal from being masked in the handler.
  107.86 - *
  107.87 - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  107.88 - * Unix names RESETHAND and NODEFER respectively.
  107.89 - */
  107.90 -#define SA_NOCLDSTOP	0x00000001
  107.91 -#define SA_NOCLDWAIT	0x00000002 /* not supported yet */
  107.92 -#define SA_SIGINFO	0x00000004
  107.93 -#define SA_ONSTACK	0x08000000
  107.94 -#define SA_RESTART	0x10000000
  107.95 -#define SA_NODEFER	0x40000000
  107.96 -#define SA_RESETHAND	0x80000000
  107.97 -
  107.98 -#define SA_NOMASK	SA_NODEFER
  107.99 -#define SA_ONESHOT	SA_RESETHAND
 107.100 -#define SA_INTERRUPT	0x20000000 /* dummy -- ignored */
 107.101 -
 107.102 -#define SA_RESTORER	0x04000000
 107.103 -
 107.104 -/* 
 107.105 - * sigaltstack controls
 107.106 - */
 107.107 -#define SS_ONSTACK	1
 107.108 -#define SS_DISABLE	2
 107.109 -
 107.110 -#define MINSIGSTKSZ	2048
 107.111 -#define SIGSTKSZ	8192
 107.112 -
 107.113 -#ifdef __KERNEL__
 107.114 -
 107.115 -/*
 107.116 - * These values of sa_flags are used only by the kernel as part of the
 107.117 - * irq handling routines.
 107.118 - *
 107.119 - * SA_INTERRUPT is also used by the irq handling routines.
 107.120 - * SA_SHIRQ is for shared interrupt support on PCI and EISA.
 107.121 - */
 107.122 -#define SA_PROBE		SA_ONESHOT
 107.123 -#define SA_SAMPLE_RANDOM	SA_RESTART
 107.124 -#define SA_SHIRQ		0x04000000
 107.125 -#endif
 107.126 -
 107.127 -#define SIG_BLOCK          0	/* for blocking signals */
 107.128 -#define SIG_UNBLOCK        1	/* for unblocking signals */
 107.129 -#define SIG_SETMASK        2	/* for setting the signal mask */
 107.130 -
 107.131 -/* Type of a signal handler.  */
 107.132 -typedef void (*__sighandler_t)(int);
 107.133 -
 107.134 -#define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
 107.135 -#define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
 107.136 -#define SIG_ERR	((__sighandler_t)-1)	/* error return from signal */
 107.137 -
 107.138 -#ifdef __KERNEL__
 107.139 -struct old_sigaction {
 107.140 -	__sighandler_t sa_handler;
 107.141 -	old_sigset_t sa_mask;
 107.142 -	unsigned long sa_flags;
 107.143 -	void (*sa_restorer)(void);
 107.144 -};
 107.145 -
 107.146 -struct sigaction {
 107.147 -	__sighandler_t sa_handler;
 107.148 -	unsigned long sa_flags;
 107.149 -	void (*sa_restorer)(void);
 107.150 -	sigset_t sa_mask;		/* mask last for extensibility */
 107.151 -};
 107.152 -
 107.153 -struct k_sigaction {
 107.154 -	struct sigaction sa;
 107.155 -};
 107.156 -#else
 107.157 -/* Here we must cater to libcs that poke about in kernel headers.  */
 107.158 -
 107.159 -struct sigaction {
 107.160 -	union {
 107.161 -	  __sighandler_t _sa_handler;
 107.162 -	  void (*_sa_sigaction)(int, struct siginfo *, void *);
 107.163 -	} _u;
 107.164 -	sigset_t sa_mask;
 107.165 -	unsigned long sa_flags;
 107.166 -	void (*sa_restorer)(void);
 107.167 -};
 107.168 -
 107.169 -#define sa_handler	_u._sa_handler
 107.170 -#define sa_sigaction	_u._sa_sigaction
 107.171 -
 107.172 -#endif /* __KERNEL__ */
 107.173 -
 107.174 -typedef struct sigaltstack {
 107.175 -	void *ss_sp;
 107.176 -	int ss_flags;
 107.177 -	size_t ss_size;
 107.178 -} stack_t;
 107.179 -
 107.180 -#ifdef __KERNEL__
 107.181 -#include <asm/sigcontext.h>
 107.182 -
 107.183 -#define __HAVE_ARCH_SIG_BITOPS
 107.184 -
 107.185 -static __inline__ void sigaddset(sigset_t *set, int _sig)
 107.186 -{
 107.187 -	__asm__("btsl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc");
 107.188 -}
 107.189 -
 107.190 -static __inline__ void sigdelset(sigset_t *set, int _sig)
 107.191 -{
 107.192 -	__asm__("btrl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc");
 107.193 -}
 107.194 -
 107.195 -static __inline__ int __const_sigismember(sigset_t *set, int _sig)
 107.196 -{
 107.197 -	unsigned long sig = _sig - 1;
 107.198 -	return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
 107.199 -}
 107.200 -
 107.201 -static __inline__ int __gen_sigismember(sigset_t *set, int _sig)
 107.202 -{
 107.203 -	int ret;
 107.204 -	__asm__("btl %2,%1\n\tsbbl %0,%0"
 107.205 -		: "=r"(ret) : "m"(*set), "Ir"(_sig-1) : "cc");
 107.206 -	return ret;
 107.207 -}
 107.208 -
 107.209 -#define sigismember(set,sig)			\
 107.210 -	(__builtin_constant_p(sig) ?		\
 107.211 -	 __const_sigismember((set),(sig)) :	\
 107.212 -	 __gen_sigismember((set),(sig)))
 107.213 -
 107.214 -#define sigmask(sig)	(1UL << ((sig) - 1))
 107.215 -
 107.216 -static __inline__ int sigfindinword(unsigned long word)
 107.217 -{
 107.218 -	__asm__("bsfl %1,%0" : "=r"(word) : "rm"(word) : "cc");
 107.219 -	return word;
 107.220 -}
 107.221 -
 107.222 -#endif /* __KERNEL__ */
 107.223 -
 107.224 -#endif
   108.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/smplock.h	Fri Mar 14 15:48:09 2003 +0000
   108.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.3 @@ -1,81 +0,0 @@
   108.4 -#ifndef __ASM_SMPLOCK_H
   108.5 -#define __ASM_SMPLOCK_H
   108.6 -
   108.7 -/*
   108.8 - * <asm/smplock.h>
   108.9 - *
  108.10 - * i386 SMP lock implementation
  108.11 - */
  108.12 -#include <linux/interrupt.h>
  108.13 -#include <linux/spinlock.h>
  108.14 -#include <linux/sched.h>
  108.15 -#include <asm/current.h>
  108.16 -
  108.17 -extern spinlock_cacheline_t kernel_flag_cacheline;  
  108.18 -#define kernel_flag kernel_flag_cacheline.lock      
  108.19 -
  108.20 -#define kernel_locked()		spin_is_locked(&kernel_flag)
  108.21 -
  108.22 -/*
  108.23 - * Release global kernel lock and global interrupt lock
  108.24 - */
  108.25 -#define release_kernel_lock(task, cpu) \
  108.26 -do { \
  108.27 -	if (task->lock_depth >= 0) \
  108.28 -		spin_unlock(&kernel_flag); \
  108.29 -	release_irqlock(cpu); \
  108.30 -	__sti(); \
  108.31 -} while (0)
  108.32 -
  108.33 -/*
  108.34 - * Re-acquire the kernel lock
  108.35 - */
  108.36 -#define reacquire_kernel_lock(task) \
  108.37 -do { \
  108.38 -	if (task->lock_depth >= 0) \
  108.39 -		spin_lock(&kernel_flag); \
  108.40 -} while (0)
  108.41 -
  108.42 -
  108.43 -/*
  108.44 - * Getting the big kernel lock.
  108.45 - *
  108.46 - * This cannot happen asynchronously,
  108.47 - * so we only need to worry about other
  108.48 - * CPU's.
  108.49 - */
  108.50 -static __inline__ void lock_kernel(void)
  108.51 -{
  108.52 -#if 1
  108.53 -	if (!++current->lock_depth)
  108.54 -		spin_lock(&kernel_flag);
  108.55 -#else
  108.56 -	__asm__ __volatile__(
  108.57 -		"incl %1\n\t"
  108.58 -		"jne 9f"
  108.59 -		spin_lock_string
  108.60 -		"\n9:"
  108.61 -		:"=m" (__dummy_lock(&kernel_flag)),
  108.62 -		 "=m" (current->lock_depth));
  108.63 -#endif
  108.64 -}
  108.65 -
  108.66 -static __inline__ void unlock_kernel(void)
  108.67 -{
  108.68 -	if (current->lock_depth < 0)
  108.69 -		out_of_line_bug();
  108.70 -#if 1
  108.71 -	if (--current->lock_depth < 0)
  108.72 -		spin_unlock(&kernel_flag);
  108.73 -#else
  108.74 -	__asm__ __volatile__(
  108.75 -		"decl %1\n\t"
  108.76 -		"jns 9f\n\t"
  108.77 -		spin_unlock_string
  108.78 -		"\n9:"
  108.79 -		:"=m" (__dummy_lock(&kernel_flag)),
  108.80 -		 "=m" (current->lock_depth));
  108.81 -#endif
  108.82 -}
  108.83 -
  108.84 -#endif /* __ASM_SMPLOCK_H */
   109.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/socket.h	Fri Mar 14 15:48:09 2003 +0000
   109.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.3 @@ -1,64 +0,0 @@
   109.4 -#ifndef _ASM_SOCKET_H
   109.5 -#define _ASM_SOCKET_H
   109.6 -
   109.7 -#include <asm/sockios.h>
   109.8 -
   109.9 -/* For setsockopt(2) */
  109.10 -#define SOL_SOCKET	1
  109.11 -
  109.12 -#define SO_DEBUG	1
  109.13 -#define SO_REUSEADDR	2
  109.14 -#define SO_TYPE		3
  109.15 -#define SO_ERROR	4
  109.16 -#define SO_DONTROUTE	5
  109.17 -#define SO_BROADCAST	6
  109.18 -#define SO_SNDBUF	7
  109.19 -#define SO_RCVBUF	8
  109.20 -#define SO_KEEPALIVE	9
  109.21 -#define SO_OOBINLINE	10
  109.22 -#define SO_NO_CHECK	11
  109.23 -#define SO_PRIORITY	12
  109.24 -#define SO_LINGER	13
  109.25 -#define SO_BSDCOMPAT	14
  109.26 -/* To add :#define SO_REUSEPORT 15 */
  109.27 -#define SO_PASSCRED	16
  109.28 -#define SO_PEERCRED	17
  109.29 -#define SO_RCVLOWAT	18
  109.30 -#define SO_SNDLOWAT	19
  109.31 -#define SO_RCVTIMEO	20
  109.32 -#define SO_SNDTIMEO	21
  109.33 -
  109.34 -/* Security levels - as per NRL IPv6 - don't actually do anything */
  109.35 -#define SO_SECURITY_AUTHENTICATION		22
  109.36 -#define SO_SECURITY_ENCRYPTION_TRANSPORT	23
  109.37 -#define SO_SECURITY_ENCRYPTION_NETWORK		24
  109.38 -
  109.39 -#define SO_BINDTODEVICE	25
  109.40 -
  109.41 -/* Socket filtering */
  109.42 -#define SO_ATTACH_FILTER        26
  109.43 -#define SO_DETACH_FILTER        27
  109.44 -
  109.45 -#define SO_PEERNAME		28
  109.46 -#define SO_TIMESTAMP		29
  109.47 -#define SCM_TIMESTAMP		SO_TIMESTAMP
  109.48 -
  109.49 -#define SO_ACCEPTCONN		30
  109.50 -
  109.51 -/* Nasty libc5 fixup - bletch */
  109.52 -#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
  109.53 -/* Socket types. */
  109.54 -#define SOCK_STREAM	1		/* stream (connection) socket	*/
  109.55 -#define SOCK_DGRAM	2		/* datagram (conn.less) socket	*/
  109.56 -#define SOCK_RAW	3		/* raw socket			*/
  109.57 -#define SOCK_RDM	4		/* reliably-delivered message	*/
  109.58 -#define SOCK_SEQPACKET	5		/* sequential packet socket	*/
  109.59 -#define SOCK_PACKET	10		/* linux specific way of	*/
  109.60 -					/* getting packets at the dev	*/
  109.61 -					/* level.  For writing rarp and	*/
  109.62 -					/* other similar things on the	*/
  109.63 -					/* user level.			*/
  109.64 -#define	SOCK_MAX	(SOCK_PACKET+1)
  109.65 -#endif
  109.66 -
  109.67 -#endif /* _ASM_SOCKET_H */
   110.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/sockios.h	Fri Mar 14 15:48:09 2003 +0000
   110.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.3 @@ -1,12 +0,0 @@
   110.4 -#ifndef __ARCH_I386_SOCKIOS__
   110.5 -#define __ARCH_I386_SOCKIOS__
   110.6 -
   110.7 -/* Socket-level I/O control calls. */
   110.8 -#define FIOSETOWN 	0x8901
   110.9 -#define SIOCSPGRP	0x8902
  110.10 -#define FIOGETOWN	0x8903
  110.11 -#define SIOCGPGRP	0x8904
  110.12 -#define SIOCATMARK	0x8905
  110.13 -#define SIOCGSTAMP	0x8906		/* Get stamp */
  110.14 -
  110.15 -#endif
   111.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/softirq.h	Fri Mar 14 15:48:09 2003 +0000
   111.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.3 @@ -1,48 +0,0 @@
   111.4 -#ifndef __ASM_SOFTIRQ_H
   111.5 -#define __ASM_SOFTIRQ_H
   111.6 -
   111.7 -#include <asm/atomic.h>
   111.8 -#include <asm/hardirq.h>
   111.9 -
  111.10 -#define __cpu_bh_enable(cpu) \
  111.11 -		do { barrier(); local_bh_count(cpu)--; } while (0)
  111.12 -#define cpu_bh_disable(cpu) \
  111.13 -		do { local_bh_count(cpu)++; barrier(); } while (0)
  111.14 -
  111.15 -#define local_bh_disable()	cpu_bh_disable(smp_processor_id())
  111.16 -#define __local_bh_enable()	__cpu_bh_enable(smp_processor_id())
  111.17 -
  111.18 -#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
  111.19 -
  111.20 -/*
  111.21 - * NOTE: this assembly code assumes:
  111.22 - *
  111.23 - *    (char *)&local_bh_count - 8 == (char *)&softirq_pending
  111.24 - *
  111.25 - * If you change the offsets in irq_stat then you have to
  111.26 - * update this code as well.
  111.27 - */
  111.28 -#define local_bh_enable()						\
  111.29 -do {									\
  111.30 -	unsigned int *ptr = &local_bh_count(smp_processor_id());	\
  111.31 -									\
  111.32 -	barrier();							\
  111.33 -	if (!--*ptr)							\
  111.34 -		__asm__ __volatile__ (					\
  111.35 -			"cmpl $0, -8(%0);"				\
  111.36 -			"jnz 2f;"					\
  111.37 -			"1:;"						\
  111.38 -									\
  111.39 -			LOCK_SECTION_START("")				\
  111.40 -			"2: pushl %%eax; pushl %%ecx; pushl %%edx;"	\
  111.41 -			"call %c1;"					\
  111.42 -			"popl %%edx; popl %%ecx; popl %%eax;"		\
  111.43 -			"jmp 1b;"					\
  111.44 -			LOCK_SECTION_END				\
  111.45 -									\
  111.46 -		: /* no output */					\
  111.47 -		: "r" (ptr), "i" (do_softirq)				\
  111.48 -		/* no registers clobbered */ );				\
  111.49 -} while (0)
  111.50 -
  111.51 -#endif	/* __ASM_SOFTIRQ_H */
   112.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/spinlock.h	Fri Mar 14 15:48:09 2003 +0000
   112.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.3 @@ -1,212 +0,0 @@
   112.4 -#ifndef __ASM_SPINLOCK_H
   112.5 -#define __ASM_SPINLOCK_H
   112.6 -
   112.7 -#include <asm/atomic.h>
   112.8 -#include <asm/rwlock.h>
   112.9 -#include <asm/page.h>
  112.10 -#include <linux/config.h>
  112.11 -
  112.12 -extern int printk(const char * fmt, ...)
  112.13 -	__attribute__ ((format (printf, 1, 2)));
  112.14 -
  112.15 -/* It seems that people are forgetting to
  112.16 - * initialize their spinlocks properly, tsk tsk.
  112.17 - * Remember to turn this off in 2.4. -ben
  112.18 - */
  112.19 -#if defined(CONFIG_DEBUG_SPINLOCK)
  112.20 -#define SPINLOCK_DEBUG	1
  112.21 -#else
  112.22 -#define SPINLOCK_DEBUG	0
  112.23 -#endif
  112.24 -
  112.25 -/*
  112.26 - * Your basic SMP spinlocks, allowing only a single CPU anywhere
  112.27 - */
  112.28 -
  112.29 -typedef struct {
  112.30 -	volatile unsigned int lock;
  112.31 -#if SPINLOCK_DEBUG
  112.32 -	unsigned magic;
  112.33 -#endif
  112.34 -} spinlock_t;
  112.35 -
  112.36 -#define SPINLOCK_MAGIC	0xdead4ead
  112.37 -
  112.38 -#if SPINLOCK_DEBUG
  112.39 -#define SPINLOCK_MAGIC_INIT	, SPINLOCK_MAGIC
  112.40 -#else
  112.41 -#define SPINLOCK_MAGIC_INIT	/* */
  112.42 -#endif
  112.43 -
  112.44 -#define SPIN_LOCK_UNLOCKED (spinlock_t) { 1 SPINLOCK_MAGIC_INIT }
  112.45 -
  112.46 -#define spin_lock_init(x)	do { *(x) = SPIN_LOCK_UNLOCKED; } while(0)
  112.47 -
  112.48 -/*
  112.49 - * Simple spin lock operations.  There are two variants, one clears IRQ's
  112.50 - * on the local processor, one does not.
  112.51 - *
  112.52 - * We make no fairness assumptions. They have a cost.
  112.53 - */
  112.54 -
  112.55 -#define spin_is_locked(x)	(*(volatile signed char *)(&(x)->lock) <= 0)
  112.56 -#define spin_unlock_wait(x)	do { barrier(); } while(spin_is_locked(x))
  112.57 -
  112.58 -#define spin_lock_string \
  112.59 -	"\n1:\t" \
  112.60 -	"lock ; decb %0\n\t" \
  112.61 -	"js 2f\n" \
  112.62 -	LOCK_SECTION_START("") \
  112.63 -	"2:\t" \
  112.64 -	"cmpb $0,%0\n\t" \
  112.65 -	"rep;nop\n\t" \
  112.66 -	"jle 2b\n\t" \
  112.67 -	"jmp 1b\n" \
  112.68 -	LOCK_SECTION_END
  112.69 -
  112.70 -/*
  112.71 - * This works. Despite all the confusion.
  112.72 - * (except on PPro SMP or if we are using OOSTORE)
  112.73 - * (PPro errata 66, 92)
  112.74 - */
  112.75 - 
  112.76 -#if !defined(CONFIG_X86_OOSTORE) && !defined(CONFIG_X86_PPRO_FENCE)
  112.77 -
  112.78 -#define spin_unlock_string \
  112.79 -	"movb $1,%0" \
  112.80 -		:"=m" (lock->lock) : : "memory"
  112.81 -
  112.82 -
  112.83 -static inline void spin_unlock(spinlock_t *lock)
  112.84 -{
  112.85 -#if SPINLOCK_DEBUG
  112.86 -	if (lock->magic != SPINLOCK_MAGIC)
  112.87 -		BUG();
  112.88 -	if (!spin_is_locked(lock))
  112.89 -		BUG();
  112.90 -#endif
  112.91 -	__asm__ __volatile__(
  112.92 -		spin_unlock_string
  112.93 -	);
  112.94 -}
  112.95 -
  112.96 -#else
  112.97 -
  112.98 -#define spin_unlock_string \
  112.99 -	"xchgb %b0, %1" \
 112.100 -		:"=q" (oldval), "=m" (lock->lock) \
 112.101 -		:"0" (oldval) : "memory"
 112.102 -
 112.103 -static inline void spin_unlock(spinlock_t *lock)
 112.104 -{
 112.105 -	char oldval = 1;
 112.106 -#if SPINLOCK_DEBUG
 112.107 -	if (lock->magic != SPINLOCK_MAGIC)
 112.108 -		BUG();
 112.109 -	if (!spin_is_locked(lock))
 112.110 -		BUG();
 112.111 -#endif
 112.112 -	__asm__ __volatile__(
 112.113 -		spin_unlock_string
 112.114 -	);
 112.115 -}
 112.116 -
 112.117 -#endif
 112.118 -
 112.119 -static inline int spin_trylock(spinlock_t *lock)
 112.120 -{
 112.121 -	char oldval;
 112.122 -	__asm__ __volatile__(
 112.123 -		"xchgb %b0,%1"
 112.124 -		:"=q" (oldval), "=m" (lock->lock)
 112.125 -		:"0" (0) : "memory");
 112.126 -	return oldval > 0;
 112.127 -}
 112.128 -
 112.129 -static inline void spin_lock(spinlock_t *lock)
 112.130 -{
 112.131 -#if SPINLOCK_DEBUG
 112.132 -	__label__ here;
 112.133 -here:
 112.134 -	if (lock->magic != SPINLOCK_MAGIC) {
 112.135 -printk("eip: %p\n", &&here);
 112.136 -		BUG();
 112.137 -	}
 112.138 -#endif
 112.139 -	__asm__ __volatile__(
 112.140 -		spin_lock_string
 112.141 -		:"=m" (lock->lock) : : "memory");
 112.142 -}
 112.143 -
 112.144 -
 112.145 -/*
 112.146 - * Read-write spinlocks, allowing multiple readers
 112.147 - * but only one writer.
 112.148 - *
 112.149 - * NOTE! it is quite common to have readers in interrupts
 112.150 - * but no interrupt writers. For those circumstances we
 112.151 - * can "mix" irq-safe locks - any writer needs to get a
 112.152 - * irq-safe write-lock, but readers can get non-irqsafe
 112.153 - * read-locks.
 112.154 - */
 112.155 -typedef struct {
 112.156 -	volatile unsigned int lock;
 112.157 -#if SPINLOCK_DEBUG
 112.158 -	unsigned magic;
 112.159 -#endif
 112.160 -} rwlock_t;
 112.161 -
 112.162 -#define RWLOCK_MAGIC	0xdeaf1eed
 112.163 -
 112.164 -#if SPINLOCK_DEBUG
 112.165 -#define RWLOCK_MAGIC_INIT	, RWLOCK_MAGIC
 112.166 -#else
 112.167 -#define RWLOCK_MAGIC_INIT	/* */
 112.168 -#endif
 112.169 -
 112.170 -#define RW_LOCK_UNLOCKED (rwlock_t) { RW_LOCK_BIAS RWLOCK_MAGIC_INIT }
 112.171 -
 112.172 -#define rwlock_init(x)	do { *(x) = RW_LOCK_UNLOCKED; } while(0)
 112.173 -
 112.174 -/*
 112.175 - * On x86, we implement read-write locks as a 32-bit counter
 112.176 - * with the high bit (sign) being the "contended" bit.
 112.177 - *
 112.178 - * The inline assembly is non-obvious. Think about it.
 112.179 - *
 112.180 - * Changed to use the same technique as rw semaphores.  See
 112.181 - * semaphore.h for details.  -ben
 112.182 - */
 112.183 -/* the spinlock helpers are in arch/i386/kernel/semaphore.c */
 112.184 -
 112.185 -static inline void read_lock(rwlock_t *rw)
 112.186 -{
 112.187 -#if SPINLOCK_DEBUG
 112.188 -	if (rw->magic != RWLOCK_MAGIC)
 112.189 -		BUG();
 112.190 -#endif
 112.191 -	__build_read_lock(rw, "__read_lock_failed");
 112.192 -}
 112.193 -
 112.194 -static inline void write_lock(rwlock_t *rw)
 112.195 -{
 112.196 -#if SPINLOCK_DEBUG
 112.197 -	if (rw->magic != RWLOCK_MAGIC)
 112.198 -		BUG();
 112.199 -#endif
 112.200 -	__build_write_lock(rw, "__write_lock_failed");
 112.201 -}
 112.202 -
 112.203 -#define read_unlock(rw)		asm volatile("lock ; incl %0" :"=m" ((rw)->lock) : : "memory")
 112.204 -#define write_unlock(rw)	asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ",%0":"=m" ((rw)->lock) : : "memory")
 112.205 -
 112.206 -static inline int write_trylock(rwlock_t *lock)
 112.207 -{
 112.208 -	atomic_t *count = (atomic_t *)lock;
 112.209 -	if (atomic_sub_and_test(RW_LOCK_BIAS, count))
 112.210 -		return 1;
 112.211 -	atomic_add(RW_LOCK_BIAS, count);
 112.212 -	return 0;
 112.213 -}
 112.214 -
 112.215 -#endif /* __ASM_SPINLOCK_H */
   113.1 --- a/xenolinux-2.4.21-pre4-sparse/include/asm-xeno/stat.h	Fri Mar 14 15:48:09 2003 +0000
   113.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.3 @@ -1,78 +0,0 @@
   113.4 -#ifndef _I386_STAT_H
   113.5 -#define _I386_STAT_H
   113.6 -
   113.7 -struct __old_kernel_stat {
   113.8 -	unsigned short st_dev;
   113.9 -	unsigned short st_ino;
  113.10 -	unsigned short st_mode;
  113.11 -	unsigned short st_nlink;
  113.12 -	unsigned short st_uid;
  113.13 -	unsigned short st_gid;
  113.14 -	unsigned short st_rdev;
  113.15 -	unsigned long  st_size;
  113.16 -	unsigned long  st_atime;
  113.17 -	unsigned long  st_mtime;
  113.18 -	unsigned long  st_ctime;
  113.19 -};
  113.20 -
  113.21 -struct stat {
  113.22 -	unsigned short st_dev;
  113.23 -	unsigned short __pad1;
  113.24 -	unsigned long st_ino;
  113.25 -	unsigned short st_mode;
  113.26 -	unsigned short st_nlink;
  113.27 -	unsigned short st_uid;
  113.28 -	unsigned short st_gid;
  113.29 -	unsigned short st_rdev;
  113.30 -	unsigned short __pad2;
  113.31 -	unsigned long  st_size;
  113.32 -	unsigned long  st_blksize;
  113.33 -	unsigned long  st_blocks;
  113.34 -	unsigned long  st_atime;
  113.35 -	unsigned long  __unused1;
  113.36 -	unsigned long  st_mtime;
  113.37 -	unsigned long  __unused2;
  113.38 -	unsigned long  st_ctime;
  113.39 -	unsigned long  __unused3;
  113.40 -	unsigned long  __unused4;
  113.41 -	unsigned long  __unused5;
  113.42 -};
  113.43 -
  113.44 -/* This matches struct stat64 in glibc2.1, hence the absolutely
  113.45 - * insane amounts of padding around dev_t's.
  113.46 - */
  113