direct-io.hg

changeset 484:b6f13a6cdded

bitkeeper revision 1.258 (3efc5218v9et-leaVGHVRu-faTh56g)

update to official 2.4.21 kernel from 2.4.21-pre4
author iap10@labyrinth.cl.cam.ac.uk
date Fri Jun 27 14:18:00 2003 +0000 (2003-06-27)
parents 0d6b14f25be6
children c6258eb58cde
files .rootkeys xenolinux-2.4.21-pre4-sparse/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/boot/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/config.in xenolinux-2.4.21-pre4-sparse/arch/xeno/defconfig xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/balloon/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/balloon/balloon.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.h 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/block/xl_segment_proc.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/console.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_block.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_core.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_memory.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_ops.h xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/sched_ops.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/vfr.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/network.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/entry.S xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/head.S xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/hypervisor.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/i386_ksyms.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ioport.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/irq.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ldt.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/signal.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/time.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/traps.c xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/delay.c xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/fault.c xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/get_unmapped_area.c xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/hypervisor.c xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/init.c xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/mmu_context.c xenolinux-2.4.21-pre4-sparse/arch/xeno/vmlinux.lds xenolinux-2.4.21-pre4-sparse/drivers/block/genhd.c xenolinux-2.4.21-pre4-sparse/drivers/block/ll_rw_blk.c xenolinux-2.4.21-pre4-sparse/drivers/char/tty_io.c xenolinux-2.4.21-pre4-sparse/fs/exec.c xenolinux-2.4.21-pre4-sparse/include/asm-xeno/bugs.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/desc.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/fixmap.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/highmem.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hw_irq.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/io.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/irq.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/keyboard.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mmu.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mmu_context.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/multicall.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/page.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/pgalloc.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/pgtable-2level.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/pgtable.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ptrace.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/segment.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/smp.h xenolinux-2.4.21-pre4-sparse/include/asm-xeno/system.h xenolinux-2.4.21-pre4-sparse/include/linux/major.h xenolinux-2.4.21-pre4-sparse/include/linux/sunrpc/debug.h xenolinux-2.4.21-pre4-sparse/init/do_mounts.c xenolinux-2.4.21-pre4-sparse/kernel/panic.c xenolinux-2.4.21-pre4-sparse/lndir-rel xenolinux-2.4.21-pre4-sparse/mkbuildtree xenolinux-2.4.21-pre4-sparse/mm/memory.c xenolinux-2.4.21-pre4-sparse/mm/mremap.c xenolinux-2.4.21-pre4-sparse/mm/swapfile.c xenolinux-2.4.21-sparse/Makefile xenolinux-2.4.21-sparse/arch/xeno/Makefile xenolinux-2.4.21-sparse/arch/xeno/boot/Makefile xenolinux-2.4.21-sparse/arch/xeno/config.in xenolinux-2.4.21-sparse/arch/xeno/defconfig xenolinux-2.4.21-sparse/arch/xeno/drivers/balloon/Makefile xenolinux-2.4.21-sparse/arch/xeno/drivers/balloon/balloon.c xenolinux-2.4.21-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h xenolinux-2.4.21-sparse/arch/xeno/drivers/block/Makefile xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.c xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.h xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_ide.c xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_scsi.c xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment.c xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment_proc.c xenolinux-2.4.21-sparse/arch/xeno/drivers/console/Makefile xenolinux-2.4.21-sparse/arch/xeno/drivers/console/console.c xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/Makefile xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_block.c xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_memory.c xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_ops.h xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/sched_ops.c xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/vfr.c xenolinux-2.4.21-sparse/arch/xeno/drivers/network/Makefile xenolinux-2.4.21-sparse/arch/xeno/drivers/network/network.c xenolinux-2.4.21-sparse/arch/xeno/kernel/Makefile xenolinux-2.4.21-sparse/arch/xeno/kernel/entry.S xenolinux-2.4.21-sparse/arch/xeno/kernel/head.S xenolinux-2.4.21-sparse/arch/xeno/kernel/hypervisor.c xenolinux-2.4.21-sparse/arch/xeno/kernel/i386_ksyms.c xenolinux-2.4.21-sparse/arch/xeno/kernel/ioport.c xenolinux-2.4.21-sparse/arch/xeno/kernel/irq.c xenolinux-2.4.21-sparse/arch/xeno/kernel/ldt.c xenolinux-2.4.21-sparse/arch/xeno/kernel/process.c xenolinux-2.4.21-sparse/arch/xeno/kernel/setup.c xenolinux-2.4.21-sparse/arch/xeno/kernel/signal.c xenolinux-2.4.21-sparse/arch/xeno/kernel/time.c xenolinux-2.4.21-sparse/arch/xeno/kernel/traps.c xenolinux-2.4.21-sparse/arch/xeno/lib/Makefile xenolinux-2.4.21-sparse/arch/xeno/lib/delay.c xenolinux-2.4.21-sparse/arch/xeno/mm/Makefile xenolinux-2.4.21-sparse/arch/xeno/mm/fault.c xenolinux-2.4.21-sparse/arch/xeno/mm/get_unmapped_area.c xenolinux-2.4.21-sparse/arch/xeno/mm/hypervisor.c xenolinux-2.4.21-sparse/arch/xeno/mm/init.c xenolinux-2.4.21-sparse/arch/xeno/mm/mmu_context.c xenolinux-2.4.21-sparse/arch/xeno/vmlinux.lds xenolinux-2.4.21-sparse/drivers/block/genhd.c xenolinux-2.4.21-sparse/drivers/block/ll_rw_blk.c xenolinux-2.4.21-sparse/drivers/char/tty_io.c xenolinux-2.4.21-sparse/fs/exec.c xenolinux-2.4.21-sparse/include/asm-xeno/bugs.h xenolinux-2.4.21-sparse/include/asm-xeno/desc.h xenolinux-2.4.21-sparse/include/asm-xeno/fixmap.h xenolinux-2.4.21-sparse/include/asm-xeno/highmem.h xenolinux-2.4.21-sparse/include/asm-xeno/hw_irq.h xenolinux-2.4.21-sparse/include/asm-xeno/hypervisor.h xenolinux-2.4.21-sparse/include/asm-xeno/io.h xenolinux-2.4.21-sparse/include/asm-xeno/irq.h xenolinux-2.4.21-sparse/include/asm-xeno/keyboard.h xenolinux-2.4.21-sparse/include/asm-xeno/mmu.h xenolinux-2.4.21-sparse/include/asm-xeno/mmu_context.h xenolinux-2.4.21-sparse/include/asm-xeno/multicall.h xenolinux-2.4.21-sparse/include/asm-xeno/page.h xenolinux-2.4.21-sparse/include/asm-xeno/pgalloc.h xenolinux-2.4.21-sparse/include/asm-xeno/pgtable-2level.h xenolinux-2.4.21-sparse/include/asm-xeno/pgtable.h xenolinux-2.4.21-sparse/include/asm-xeno/processor.h xenolinux-2.4.21-sparse/include/asm-xeno/ptrace.h xenolinux-2.4.21-sparse/include/asm-xeno/segment.h xenolinux-2.4.21-sparse/include/asm-xeno/smp.h xenolinux-2.4.21-sparse/include/asm-xeno/system.h xenolinux-2.4.21-sparse/include/linux/major.h xenolinux-2.4.21-sparse/include/linux/sunrpc/debug.h xenolinux-2.4.21-sparse/init/do_mounts.c xenolinux-2.4.21-sparse/kernel/panic.c xenolinux-2.4.21-sparse/lndir-rel xenolinux-2.4.21-sparse/mkbuildtree xenolinux-2.4.21-sparse/mm/memory.c xenolinux-2.4.21-sparse/mm/mremap.c xenolinux-2.4.21-sparse/mm/swapfile.c
line diff
     1.1 --- a/.rootkeys	Tue Jun 24 12:05:12 2003 +0000
     1.2 +++ b/.rootkeys	Fri Jun 27 14:18:00 2003 +0000
     1.3 @@ -469,85 +469,85 @@ 3eb3c87fPL2T_zBb0bHlbZY-ACEKRw xen/tools
     1.4  3eb3c87fmKYTC5GCh_rydFakZp9ayw xen/tools/figlet/README
     1.5  3eb3c87fdQKQ5OBGbM-KjZfi9Us4ng xen/tools/figlet/figlet.c
     1.6  3eb3c87fS7DNbg0i6yhFs28UIqAK5g xen/tools/figlet/xen.flf
     1.7 -3e5a4e6589G-U42lFKs43plskXoFxQ xenolinux-2.4.21-pre4-sparse/Makefile
     1.8 -3e5a4e65IEPjnWPZ5w3TxS5scV8Ewg xenolinux-2.4.21-pre4-sparse/arch/xeno/Makefile
     1.9 -3e5a4e65n-KhsEAs-A4ULiStBp-r6w xenolinux-2.4.21-pre4-sparse/arch/xeno/boot/Makefile
    1.10 -3e5a4e65OV_j_DBtjzt5vej771AJsA xenolinux-2.4.21-pre4-sparse/arch/xeno/config.in
    1.11 -3e5a4e65TNEycLeXqPSXQJQm_xGecA xenolinux-2.4.21-pre4-sparse/arch/xeno/defconfig
    1.12 -3e6377f5xwPfYZkPHPrDbEq1PRN7uQ xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/balloon/Makefile
    1.13 -3e6377f8Me8IqtvEhb70XFgOvqQH7A xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/balloon/balloon.c
    1.14 -3e6377fbMjXWAQd0XN0FWv4fDEo6fg xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h
    1.15 -3e5a4e65iHEuC5sjFhj42XALYbLVRw xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/Makefile
    1.16 -3e5a4e65pP5spJErBW69pJxSSdK9RA xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.c
    1.17 -3e67f822FOPwqHiaRKbrskgWgoNL5g xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.h
    1.18 -3e677190SjkzJIvFifRVeYpIZOCtYA xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_ide.c
    1.19 -3e677193nOKKTLJzcAu4SYdbZaia8g xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_scsi.c
    1.20 -3e676eb5RXnHzSHgA1BvM0B1aIm4qg xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment.c
    1.21 -3e5d129aDldt6geU2-2SzBae34sQzg xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment_proc.c
    1.22 -3e5a4e65G3e2s0ghPMgiJ-gBTUJ0uQ xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/Makefile
    1.23 -3e5a4e651TH-SXHoufurnWjgl5bfOA xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/console.c
    1.24 -3e5a4e656nfFISThfbyXQOA6HN6YHw xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/Makefile
    1.25 -3e5a4e65Cc7io-vynYob10SlqXTjAQ xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_block.c
    1.26 -3e5a4e65BXtftInNHUC2PjDfPhdZZA xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_core.c
    1.27 -3e5a4e65uXAx05p6B1-HU2tijuw8qA xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_memory.c
    1.28 -3e5a4e65EOOLlPwXnhSuX-iVdWLmnA xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_ops.h
    1.29 -3e6dba59C8o0kBks7UZ4IW_FY853Aw xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/sched_ops.c
    1.30 -3e5a4e65gfn_ltB8ujHMVFApnTTNRQ xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/vfr.c
    1.31 -3e5a4e65gZBRBB6RsSVg1c9iahigAw xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/Makefile
    1.32 -3e5a4e65ZxKrbFetVB84JhrTyZ1YuQ xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/network.c
    1.33 -3e5a4e65lWzkiPXsZdzPt2RNnJGG1g xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/Makefile
    1.34 -3e5a4e65_hqfuxtGG8IUy6wRM86Ecg xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/entry.S
    1.35 -3e5a4e65Hy_1iUvMTPsNqGNXd9uFpg xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/head.S
    1.36 -3e5a4e65ibVQmwlOn0j3sVH_j_6hAg xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/hypervisor.c
    1.37 -3e5a4e65RMGcuA-HCn3-wNx3fFQwdg xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/i386_ksyms.c
    1.38 -3e5a4e65MEvZhlr070sK5JsfAQlv7Q xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ioport.c
    1.39 -3e5a4e653U6cELGv528IxOLHvCq8iA xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/irq.c
    1.40 -3e5a4e65muT6SU3ck47IP87Q7Ti5hA xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ldt.c
    1.41 -3e5a4e65IGt3WwQDNiL4h-gYWgNTWQ xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
    1.42 -3e5a4e66tR-qJMLj3MppcKqmvuI2XQ xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c
    1.43 -3e5a4e66fWSTagLGU2P8BGFGRjhDiw xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/signal.c
    1.44 -3e5a4e66N__lUXNwzQ-eADRzK9LXuQ xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/time.c
    1.45 -3e5a4e66aHCbQ_F5QZ8VeyikLmuRZQ xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/traps.c
    1.46 -3e5a4e66-9_NczrVMbuQkoSLyXckIw xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/Makefile
    1.47 -3e5a4e6637ZDk0BvFEC-aFQs599-ng xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/delay.c
    1.48 -3e5a4e66croVgpcJyJuF2ycQw0HuJw xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/Makefile
    1.49 -3e5a4e66l8Q5Tv-6B3lQIRmaVbFPzg xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/fault.c
    1.50 -3e5a4e66TyNNUEXkr5RxqvQhXK1MQA xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/get_unmapped_area.c
    1.51 -3e5a4e668SE9rixq4ahho9rNhLUUFQ xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/hypervisor.c
    1.52 -3e5a4e661gLzzff25pJooKIIWe7IWg xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/init.c
    1.53 -3e5a4e66U45cAIoHmxg0y1e1XhzVCA xenolinux-2.4.21-pre4-sparse/arch/xeno/mm/mmu_context.c
    1.54 -3e5a4e66qRlSTcjafidMB6ulECADvg xenolinux-2.4.21-pre4-sparse/arch/xeno/vmlinux.lds
    1.55 -3ea53c6em6uzVHSiGqrbbAVofyRY_g xenolinux-2.4.21-pre4-sparse/drivers/block/genhd.c
    1.56 -3e5a4e66mrtlmV75L1tjKDg8RaM5gA xenolinux-2.4.21-pre4-sparse/drivers/block/ll_rw_blk.c
    1.57 -3e5a4e66rw65CxyolW9PKz4GG42RcA xenolinux-2.4.21-pre4-sparse/drivers/char/tty_io.c
    1.58 -3e5a4e669uzIE54VwucPYtGwXLAbzA xenolinux-2.4.21-pre4-sparse/fs/exec.c
    1.59 -3e5a4e66wbeCpsJgVf_U8Jde-CNcsA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/bugs.h
    1.60 -3e5a4e66HdSkvIV6SJ1evG_xmTmXHA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/desc.h
    1.61 -3e5a4e66SYp_UpAVcF8Lc1wa3Qtgzw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/fixmap.h
    1.62 -3e5a4e67w_DWgjIJ17Tlossu1LGujQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/highmem.h
    1.63 -3e5a4e67YtcyDLQsShhCfQwPSELfvA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hw_irq.h
    1.64 -3e5a4e677VBavzM1UZIEcH1B-RlXMA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor.h
    1.65 -3e5a4e67Ulv-Ll8Zp4j2GwMwQ8aAXQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/io.h
    1.66 -3e5a4e673p7PEOyHFm3nHkYX6HQYBg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/irq.h
    1.67 -3ead095db_LRUXnxaqs0dA1DWhPoQQ xenolinux-2.4.21-pre4-sparse/include/asm-xeno/keyboard.h
    1.68 -3e5a4e67zoNch27qYhEBpr2k6SABOg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mmu.h
    1.69 -3e5a4e678ddsQOpbSiRdy1GRcDc9WA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/mmu_context.h
    1.70 -3e7270deQqtGPSnFxcW4AvJZuTUWfg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/multicall.h
    1.71 -3e5a4e67mnQfh-R8KcQCaVo2Oho6yg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/page.h
    1.72 -3e5a4e67uTYU5oEnIDjxuaez8njjqg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/pgalloc.h
    1.73 -3e5a4e67X7JyupgdYkgDX19Huj2sAw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/pgtable-2level.h
    1.74 -3e5a4e67gr4NLGtQ5CvSLimMYZlkOA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/pgtable.h
    1.75 -3e5a4e676uK4xErTBDH6XJREn9LSyg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/processor.h
    1.76 -3e5a4e67AJPjW-zL7p-xWuA6IVeH1g xenolinux-2.4.21-pre4-sparse/include/asm-xeno/ptrace.h
    1.77 -3e5a4e68uJz-xI0IBVMD7xRLQKJDFg xenolinux-2.4.21-pre4-sparse/include/asm-xeno/segment.h
    1.78 -3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA xenolinux-2.4.21-pre4-sparse/include/asm-xeno/smp.h
    1.79 -3e5a4e68mTr0zcp9SXDbnd-XLrrfxw xenolinux-2.4.21-pre4-sparse/include/asm-xeno/system.h
    1.80 -3e5a4e68WLX3B8owTvktP3HHOtznPQ xenolinux-2.4.21-pre4-sparse/include/linux/major.h
    1.81 -3e5a4e686V0nioX2ZpFf056sgvdiQw xenolinux-2.4.21-pre4-sparse/include/linux/sunrpc/debug.h
    1.82 -3e5a4e68W_hpMlM3u_-QOKMp3gzcwQ xenolinux-2.4.21-pre4-sparse/init/do_mounts.c
    1.83 -3e5a4e68TJJavrunYwTAnLRSBxSYqQ xenolinux-2.4.21-pre4-sparse/kernel/panic.c
    1.84 -3eba8f878XjouY21EkQBXwYBsPsipQ xenolinux-2.4.21-pre4-sparse/lndir-rel
    1.85 -3e6e7c1efbQe93xCvOpOVCnXTMmQ5w xenolinux-2.4.21-pre4-sparse/mkbuildtree
    1.86 -3e5a4e68GxCIaFH4sy01v1wjapetaA xenolinux-2.4.21-pre4-sparse/mm/memory.c
    1.87 -3e5a4e681xMPdF9xCMwpyfuYMySU5g xenolinux-2.4.21-pre4-sparse/mm/mremap.c
    1.88 -3e5a4e683HKVU-sxtagrDasRB8eBVw xenolinux-2.4.21-pre4-sparse/mm/swapfile.c
    1.89 +3e5a4e6589G-U42lFKs43plskXoFxQ xenolinux-2.4.21-sparse/Makefile
    1.90 +3e5a4e65IEPjnWPZ5w3TxS5scV8Ewg xenolinux-2.4.21-sparse/arch/xeno/Makefile
    1.91 +3e5a4e65n-KhsEAs-A4ULiStBp-r6w xenolinux-2.4.21-sparse/arch/xeno/boot/Makefile
    1.92 +3e5a4e65OV_j_DBtjzt5vej771AJsA xenolinux-2.4.21-sparse/arch/xeno/config.in
    1.93 +3e5a4e65TNEycLeXqPSXQJQm_xGecA xenolinux-2.4.21-sparse/arch/xeno/defconfig
    1.94 +3e6377f5xwPfYZkPHPrDbEq1PRN7uQ xenolinux-2.4.21-sparse/arch/xeno/drivers/balloon/Makefile
    1.95 +3e6377f8Me8IqtvEhb70XFgOvqQH7A xenolinux-2.4.21-sparse/arch/xeno/drivers/balloon/balloon.c
    1.96 +3e6377fbMjXWAQd0XN0FWv4fDEo6fg xenolinux-2.4.21-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h
    1.97 +3e5a4e65iHEuC5sjFhj42XALYbLVRw xenolinux-2.4.21-sparse/arch/xeno/drivers/block/Makefile
    1.98 +3e5a4e65pP5spJErBW69pJxSSdK9RA xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.c
    1.99 +3e67f822FOPwqHiaRKbrskgWgoNL5g xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.h
   1.100 +3e677190SjkzJIvFifRVeYpIZOCtYA xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_ide.c
   1.101 +3e677193nOKKTLJzcAu4SYdbZaia8g xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_scsi.c
   1.102 +3e676eb5RXnHzSHgA1BvM0B1aIm4qg xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment.c
   1.103 +3e5d129aDldt6geU2-2SzBae34sQzg xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment_proc.c
   1.104 +3e5a4e65G3e2s0ghPMgiJ-gBTUJ0uQ xenolinux-2.4.21-sparse/arch/xeno/drivers/console/Makefile
   1.105 +3e5a4e651TH-SXHoufurnWjgl5bfOA xenolinux-2.4.21-sparse/arch/xeno/drivers/console/console.c
   1.106 +3e5a4e656nfFISThfbyXQOA6HN6YHw xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/Makefile
   1.107 +3e5a4e65Cc7io-vynYob10SlqXTjAQ xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_block.c
   1.108 +3e5a4e65BXtftInNHUC2PjDfPhdZZA xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c
   1.109 +3e5a4e65uXAx05p6B1-HU2tijuw8qA xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_memory.c
   1.110 +3e5a4e65EOOLlPwXnhSuX-iVdWLmnA xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_ops.h
   1.111 +3e6dba59C8o0kBks7UZ4IW_FY853Aw xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/sched_ops.c
   1.112 +3e5a4e65gfn_ltB8ujHMVFApnTTNRQ xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/vfr.c
   1.113 +3e5a4e65gZBRBB6RsSVg1c9iahigAw xenolinux-2.4.21-sparse/arch/xeno/drivers/network/Makefile
   1.114 +3e5a4e65ZxKrbFetVB84JhrTyZ1YuQ xenolinux-2.4.21-sparse/arch/xeno/drivers/network/network.c
   1.115 +3e5a4e65lWzkiPXsZdzPt2RNnJGG1g xenolinux-2.4.21-sparse/arch/xeno/kernel/Makefile
   1.116 +3e5a4e65_hqfuxtGG8IUy6wRM86Ecg xenolinux-2.4.21-sparse/arch/xeno/kernel/entry.S
   1.117 +3e5a4e65Hy_1iUvMTPsNqGNXd9uFpg xenolinux-2.4.21-sparse/arch/xeno/kernel/head.S
   1.118 +3e5a4e65ibVQmwlOn0j3sVH_j_6hAg xenolinux-2.4.21-sparse/arch/xeno/kernel/hypervisor.c
   1.119 +3e5a4e65RMGcuA-HCn3-wNx3fFQwdg xenolinux-2.4.21-sparse/arch/xeno/kernel/i386_ksyms.c
   1.120 +3e5a4e65MEvZhlr070sK5JsfAQlv7Q xenolinux-2.4.21-sparse/arch/xeno/kernel/ioport.c
   1.121 +3e5a4e653U6cELGv528IxOLHvCq8iA xenolinux-2.4.21-sparse/arch/xeno/kernel/irq.c
   1.122 +3e5a4e65muT6SU3ck47IP87Q7Ti5hA xenolinux-2.4.21-sparse/arch/xeno/kernel/ldt.c
   1.123 +3e5a4e65IGt3WwQDNiL4h-gYWgNTWQ xenolinux-2.4.21-sparse/arch/xeno/kernel/process.c
   1.124 +3e5a4e66tR-qJMLj3MppcKqmvuI2XQ xenolinux-2.4.21-sparse/arch/xeno/kernel/setup.c
   1.125 +3e5a4e66fWSTagLGU2P8BGFGRjhDiw xenolinux-2.4.21-sparse/arch/xeno/kernel/signal.c
   1.126 +3e5a4e66N__lUXNwzQ-eADRzK9LXuQ xenolinux-2.4.21-sparse/arch/xeno/kernel/time.c
   1.127 +3e5a4e66aHCbQ_F5QZ8VeyikLmuRZQ xenolinux-2.4.21-sparse/arch/xeno/kernel/traps.c
   1.128 +3e5a4e66-9_NczrVMbuQkoSLyXckIw xenolinux-2.4.21-sparse/arch/xeno/lib/Makefile
   1.129 +3e5a4e6637ZDk0BvFEC-aFQs599-ng xenolinux-2.4.21-sparse/arch/xeno/lib/delay.c
   1.130 +3e5a4e66croVgpcJyJuF2ycQw0HuJw xenolinux-2.4.21-sparse/arch/xeno/mm/Makefile
   1.131 +3e5a4e66l8Q5Tv-6B3lQIRmaVbFPzg xenolinux-2.4.21-sparse/arch/xeno/mm/fault.c
   1.132 +3e5a4e66TyNNUEXkr5RxqvQhXK1MQA xenolinux-2.4.21-sparse/arch/xeno/mm/get_unmapped_area.c
   1.133 +3e5a4e668SE9rixq4ahho9rNhLUUFQ xenolinux-2.4.21-sparse/arch/xeno/mm/hypervisor.c
   1.134 +3e5a4e661gLzzff25pJooKIIWe7IWg xenolinux-2.4.21-sparse/arch/xeno/mm/init.c
   1.135 +3e5a4e66U45cAIoHmxg0y1e1XhzVCA xenolinux-2.4.21-sparse/arch/xeno/mm/mmu_context.c
   1.136 +3e5a4e66qRlSTcjafidMB6ulECADvg xenolinux-2.4.21-sparse/arch/xeno/vmlinux.lds
   1.137 +3ea53c6em6uzVHSiGqrbbAVofyRY_g xenolinux-2.4.21-sparse/drivers/block/genhd.c
   1.138 +3e5a4e66mrtlmV75L1tjKDg8RaM5gA xenolinux-2.4.21-sparse/drivers/block/ll_rw_blk.c
   1.139 +3e5a4e66rw65CxyolW9PKz4GG42RcA xenolinux-2.4.21-sparse/drivers/char/tty_io.c
   1.140 +3e5a4e669uzIE54VwucPYtGwXLAbzA xenolinux-2.4.21-sparse/fs/exec.c
   1.141 +3e5a4e66wbeCpsJgVf_U8Jde-CNcsA xenolinux-2.4.21-sparse/include/asm-xeno/bugs.h
   1.142 +3e5a4e66HdSkvIV6SJ1evG_xmTmXHA xenolinux-2.4.21-sparse/include/asm-xeno/desc.h
   1.143 +3e5a4e66SYp_UpAVcF8Lc1wa3Qtgzw xenolinux-2.4.21-sparse/include/asm-xeno/fixmap.h
   1.144 +3e5a4e67w_DWgjIJ17Tlossu1LGujQ xenolinux-2.4.21-sparse/include/asm-xeno/highmem.h
   1.145 +3e5a4e67YtcyDLQsShhCfQwPSELfvA xenolinux-2.4.21-sparse/include/asm-xeno/hw_irq.h
   1.146 +3e5a4e677VBavzM1UZIEcH1B-RlXMA xenolinux-2.4.21-sparse/include/asm-xeno/hypervisor.h
   1.147 +3e5a4e67Ulv-Ll8Zp4j2GwMwQ8aAXQ xenolinux-2.4.21-sparse/include/asm-xeno/io.h
   1.148 +3e5a4e673p7PEOyHFm3nHkYX6HQYBg xenolinux-2.4.21-sparse/include/asm-xeno/irq.h
   1.149 +3ead095db_LRUXnxaqs0dA1DWhPoQQ xenolinux-2.4.21-sparse/include/asm-xeno/keyboard.h
   1.150 +3e5a4e67zoNch27qYhEBpr2k6SABOg xenolinux-2.4.21-sparse/include/asm-xeno/mmu.h
   1.151 +3e5a4e678ddsQOpbSiRdy1GRcDc9WA xenolinux-2.4.21-sparse/include/asm-xeno/mmu_context.h
   1.152 +3e7270deQqtGPSnFxcW4AvJZuTUWfg xenolinux-2.4.21-sparse/include/asm-xeno/multicall.h
   1.153 +3e5a4e67mnQfh-R8KcQCaVo2Oho6yg xenolinux-2.4.21-sparse/include/asm-xeno/page.h
   1.154 +3e5a4e67uTYU5oEnIDjxuaez8njjqg xenolinux-2.4.21-sparse/include/asm-xeno/pgalloc.h
   1.155 +3e5a4e67X7JyupgdYkgDX19Huj2sAw xenolinux-2.4.21-sparse/include/asm-xeno/pgtable-2level.h
   1.156 +3e5a4e67gr4NLGtQ5CvSLimMYZlkOA xenolinux-2.4.21-sparse/include/asm-xeno/pgtable.h
   1.157 +3e5a4e676uK4xErTBDH6XJREn9LSyg xenolinux-2.4.21-sparse/include/asm-xeno/processor.h
   1.158 +3e5a4e67AJPjW-zL7p-xWuA6IVeH1g xenolinux-2.4.21-sparse/include/asm-xeno/ptrace.h
   1.159 +3e5a4e68uJz-xI0IBVMD7xRLQKJDFg xenolinux-2.4.21-sparse/include/asm-xeno/segment.h
   1.160 +3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA xenolinux-2.4.21-sparse/include/asm-xeno/smp.h
   1.161 +3e5a4e68mTr0zcp9SXDbnd-XLrrfxw xenolinux-2.4.21-sparse/include/asm-xeno/system.h
   1.162 +3e5a4e68WLX3B8owTvktP3HHOtznPQ xenolinux-2.4.21-sparse/include/linux/major.h
   1.163 +3e5a4e686V0nioX2ZpFf056sgvdiQw xenolinux-2.4.21-sparse/include/linux/sunrpc/debug.h
   1.164 +3e5a4e68W_hpMlM3u_-QOKMp3gzcwQ xenolinux-2.4.21-sparse/init/do_mounts.c
   1.165 +3e5a4e68TJJavrunYwTAnLRSBxSYqQ xenolinux-2.4.21-sparse/kernel/panic.c
   1.166 +3eba8f878XjouY21EkQBXwYBsPsipQ xenolinux-2.4.21-sparse/lndir-rel
   1.167 +3e6e7c1efbQe93xCvOpOVCnXTMmQ5w xenolinux-2.4.21-sparse/mkbuildtree
   1.168 +3e5a4e68GxCIaFH4sy01v1wjapetaA xenolinux-2.4.21-sparse/mm/memory.c
   1.169 +3e5a4e681xMPdF9xCMwpyfuYMySU5g xenolinux-2.4.21-sparse/mm/mremap.c
   1.170 +3e5a4e683HKVU-sxtagrDasRB8eBVw xenolinux-2.4.21-sparse/mm/swapfile.c
     2.1 --- a/xenolinux-2.4.21-pre4-sparse/Makefile	Tue Jun 24 12:05:12 2003 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,578 +0,0 @@
     2.4 -VERSION = 2
     2.5 -PATCHLEVEL = 4
     2.6 -SUBLEVEL = 21
     2.7 -EXTRAVERSION = -pre4-xeno
     2.8 -
     2.9 -KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
    2.10 -
    2.11 -ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
    2.12 -
    2.13 -# Xeno hack XXX
    2.14 -ARCH    := xeno
    2.15 -SUBARCH := i386
    2.16 -
    2.17 -KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
    2.18 -
    2.19 -CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
    2.20 -	  else if [ -x /bin/bash ]; then echo /bin/bash; \
    2.21 -	  else echo sh; fi ; fi)
    2.22 -TOPDIR	:= $(shell /bin/pwd)
    2.23 -
    2.24 -HPATH   	= $(TOPDIR)/include
    2.25 -FINDHPATH	= $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
    2.26 -
    2.27 -HOSTCC  	= gcc
    2.28 -HOSTCFLAGS	= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
    2.29 -
    2.30 -CROSS_COMPILE 	=
    2.31 -
    2.32 -#
    2.33 -# Include the make variables (CC, etc...)
    2.34 -#
    2.35 -
    2.36 -AS		= $(CROSS_COMPILE)as
    2.37 -LD		= $(CROSS_COMPILE)ld
    2.38 -CC		= $(CROSS_COMPILE)gcc
    2.39 -CPP		= $(CC) -E
    2.40 -AR		= $(CROSS_COMPILE)ar
    2.41 -NM		= $(CROSS_COMPILE)nm
    2.42 -STRIP		= $(CROSS_COMPILE)strip
    2.43 -OBJCOPY		= $(CROSS_COMPILE)objcopy
    2.44 -OBJDUMP		= $(CROSS_COMPILE)objdump
    2.45 -MAKEFILES	= $(TOPDIR)/.config
    2.46 -GENKSYMS	= /sbin/genksyms
    2.47 -DEPMOD		= /sbin/depmod
    2.48 -MODFLAGS	= -DMODULE
    2.49 -CFLAGS_KERNEL	=
    2.50 -PERL		= perl
    2.51 -
    2.52 -export	VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
    2.53 -	CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
    2.54 -	CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS MODFLAGS PERL
    2.55 -
    2.56 -all:	do-it-all
    2.57 -
    2.58 -#
    2.59 -# Make "config" the default target if there is no configuration file or
    2.60 -# "depend" the target if there is no top-level dependency information.
    2.61 -#
    2.62 -
    2.63 -ifeq (.config,$(wildcard .config))
    2.64 -include .config
    2.65 -ifeq (.depend,$(wildcard .depend))
    2.66 -include .depend
    2.67 -do-it-all:	Version vmlinux
    2.68 -else
    2.69 -CONFIGURATION = depend
    2.70 -do-it-all:	depend
    2.71 -endif
    2.72 -else
    2.73 -CONFIGURATION = config
    2.74 -do-it-all:	config
    2.75 -endif
    2.76 -
    2.77 -#
    2.78 -# INSTALL_PATH specifies where to place the updated kernel and system map
    2.79 -# images.  Uncomment if you want to place them anywhere other than root.
    2.80 -#
    2.81 -
    2.82 -#export	INSTALL_PATH=/boot
    2.83 -
    2.84 -#
    2.85 -# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
    2.86 -# relocations required by build roots.  This is not defined in the
    2.87 -# makefile but the arguement can be passed to make if needed.
    2.88 -#
    2.89 -
    2.90 -MODLIB	:= $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
    2.91 -export MODLIB
    2.92 -
    2.93 -#
    2.94 -# standard CFLAGS
    2.95 -#
    2.96 -
    2.97 -CPPFLAGS := -D__KERNEL__ -I$(HPATH)
    2.98 -
    2.99 -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
   2.100 -	  -fno-strict-aliasing -fno-common
   2.101 -ifndef CONFIG_FRAME_POINTER
   2.102 -CFLAGS += -fomit-frame-pointer
   2.103 -endif
   2.104 -AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
   2.105 -
   2.106 -#
   2.107 -# ROOT_DEV specifies the default root-device when making the image.
   2.108 -# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
   2.109 -# the default of FLOPPY is used by 'build'.
   2.110 -# This is i386 specific.
   2.111 -#
   2.112 -
   2.113 -export ROOT_DEV = CURRENT
   2.114 -
   2.115 -#
   2.116 -# If you want to preset the SVGA mode, uncomment the next line and
   2.117 -# set SVGA_MODE to whatever number you want.
   2.118 -# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
   2.119 -# The number is the same as you would ordinarily press at bootup.
   2.120 -# This is i386 specific.
   2.121 -#
   2.122 -
   2.123 -export SVGA_MODE = -DSVGA_MODE=NORMAL_VGA
   2.124 -
   2.125 -#
   2.126 -# If you want the RAM disk device, define this to be the size in blocks.
   2.127 -# This is i386 specific.
   2.128 -#
   2.129 -
   2.130 -#export RAMDISK = -DRAMDISK=512
   2.131 -
   2.132 -CORE_FILES	=kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
   2.133 -NETWORKS	=net/network.o
   2.134 -
   2.135 -LIBS		=$(TOPDIR)/lib/lib.a
   2.136 -SUBDIRS		=kernel drivers mm fs net ipc lib
   2.137 -
   2.138 -DRIVERS-n :=
   2.139 -DRIVERS-y :=
   2.140 -DRIVERS-m :=
   2.141 -DRIVERS-  :=
   2.142 -
   2.143 -DRIVERS-$(CONFIG_ACPI) += drivers/acpi/acpi.o
   2.144 -DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o
   2.145 -DRIVERS-y += drivers/char/char.o \
   2.146 -	drivers/block/block.o \
   2.147 -	drivers/misc/misc.o \
   2.148 -	drivers/net/net.o
   2.149 -DRIVERS-$(CONFIG_AGP) += drivers/char/agp/agp.o
   2.150 -DRIVERS-$(CONFIG_DRM_NEW) += drivers/char/drm/drm.o
   2.151 -DRIVERS-$(CONFIG_DRM_OLD) += drivers/char/drm-4.0/drm.o
   2.152 -DRIVERS-$(CONFIG_NUBUS) += drivers/nubus/nubus.a
   2.153 -DRIVERS-$(CONFIG_NET_FC) += drivers/net/fc/fc.o
   2.154 -DRIVERS-$(CONFIG_DEV_APPLETALK) += drivers/net/appletalk/appletalk.o
   2.155 -DRIVERS-$(CONFIG_TR) += drivers/net/tokenring/tr.o
   2.156 -DRIVERS-$(CONFIG_WAN) += drivers/net/wan/wan.o
   2.157 -DRIVERS-$(CONFIG_ARCNET) += drivers/net/arcnet/arcnetdrv.o
   2.158 -DRIVERS-$(CONFIG_ATM) += drivers/atm/atm.o
   2.159 -DRIVERS-$(CONFIG_IDE) += drivers/ide/idedriver.o
   2.160 -DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
   2.161 -DRIVERS-$(CONFIG_SCSI) += drivers/scsi/scsidrv.o
   2.162 -DRIVERS-$(CONFIG_FUSION_BOOT) += drivers/message/fusion/fusion.o
   2.163 -DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394drv.o
   2.164 -
   2.165 -ifneq ($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR)$(CONFIG_PARIDE_PCD),)
   2.166 -DRIVERS-y += drivers/cdrom/driver.o
   2.167 -endif
   2.168 -
   2.169 -DRIVERS-$(CONFIG_SOUND) += drivers/sound/sounddrivers.o
   2.170 -DRIVERS-$(CONFIG_PCI) += drivers/pci/driver.o
   2.171 -DRIVERS-$(CONFIG_MTD) += drivers/mtd/mtdlink.o
   2.172 -DRIVERS-$(CONFIG_PCMCIA) += drivers/pcmcia/pcmcia.o
   2.173 -DRIVERS-$(CONFIG_NET_PCMCIA) += drivers/net/pcmcia/pcmcia_net.o
   2.174 -DRIVERS-$(CONFIG_NET_WIRELESS) += drivers/net/wireless/wireless_net.o
   2.175 -DRIVERS-$(CONFIG_PCMCIA_CHRDEV) += drivers/char/pcmcia/pcmcia_char.o
   2.176 -DRIVERS-$(CONFIG_DIO) += drivers/dio/dio.a
   2.177 -DRIVERS-$(CONFIG_SBUS) += drivers/sbus/sbus_all.o
   2.178 -DRIVERS-$(CONFIG_ZORRO) += drivers/zorro/driver.o
   2.179 -DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
   2.180 -DRIVERS-$(CONFIG_PPC32) += drivers/macintosh/macintosh.o
   2.181 -DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o
   2.182 -DRIVERS-$(CONFIG_ISAPNP) += drivers/pnp/pnp.o
   2.183 -DRIVERS-$(CONFIG_SGI_IP22) += drivers/sgi/sgi.a
   2.184 -DRIVERS-$(CONFIG_VT) += drivers/video/video.o
   2.185 -DRIVERS-$(CONFIG_PARIDE) += drivers/block/paride/paride.a
   2.186 -DRIVERS-$(CONFIG_HAMRADIO) += drivers/net/hamradio/hamradio.o
   2.187 -DRIVERS-$(CONFIG_TC) += drivers/tc/tc.a
   2.188 -DRIVERS-$(CONFIG_USB) += drivers/usb/usbdrv.o
   2.189 -DRIVERS-y +=drivers/media/media.o
   2.190 -DRIVERS-$(CONFIG_INPUT) += drivers/input/inputdrv.o
   2.191 -DRIVERS-$(CONFIG_HIL) += drivers/hil/hil.o
   2.192 -DRIVERS-$(CONFIG_I2O) += drivers/message/i2o/i2o.o
   2.193 -DRIVERS-$(CONFIG_IRDA) += drivers/net/irda/irda.o
   2.194 -DRIVERS-$(CONFIG_I2C) += drivers/i2c/i2c.o
   2.195 -DRIVERS-$(CONFIG_PHONE) += drivers/telephony/telephony.o
   2.196 -DRIVERS-$(CONFIG_MD) += drivers/md/mddev.o
   2.197 -DRIVERS-$(CONFIG_GSC) += drivers/gsc/gscbus.o
   2.198 -DRIVERS-$(CONFIG_BLUEZ) += drivers/bluetooth/bluetooth.o
   2.199 -DRIVERS-$(CONFIG_HOTPLUG_PCI) += drivers/hotplug/vmlinux-obj.o
   2.200 -DRIVERS-$(CONFIG_ISDN_BOOL) += drivers/isdn/vmlinux-obj.o
   2.201 -
   2.202 -DRIVERS := $(DRIVERS-y)
   2.203 -
   2.204 -
   2.205 -# files removed with 'make clean'
   2.206 -CLEAN_FILES = \
   2.207 -	kernel/ksyms.lst include/linux/compile.h \
   2.208 -	vmlinux System.map \
   2.209 -	.tmp* \
   2.210 -	drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \
   2.211 -	drivers/char/conmakehash \
   2.212 -	drivers/char/drm/*-mod.c \
   2.213 -	drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist \
   2.214 -	drivers/zorro/devlist.h drivers/zorro/gen-devlist \
   2.215 -	drivers/sound/bin2hex drivers/sound/hex2hex \
   2.216 -	drivers/atm/fore200e_mkfirm drivers/atm/{pca,sba}*{.bin,.bin1,.bin2} \
   2.217 -	drivers/scsi/aic7xxx/aicasm/aicasm \
   2.218 -	drivers/scsi/aic7xxx/aicasm/aicasm_gram.c \
   2.219 -	drivers/scsi/aic7xxx/aicasm/aicasm_gram.h \
   2.220 -	drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.c \
   2.221 -	drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.h \
   2.222 -	drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.c \
   2.223 -	drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \
   2.224 -	drivers/scsi/aic7xxx/aicasm/aicdb.h \
   2.225 -	drivers/scsi/aic7xxx/aicasm/y.tab.h \
   2.226 -	drivers/scsi/53c700_d.h \
   2.227 -	net/khttpd/make_times_h \
   2.228 -	net/khttpd/times.h \
   2.229 -	submenu*
   2.230 -# directories removed with 'make clean'
   2.231 -CLEAN_DIRS = \
   2.232 -	modules
   2.233 -
   2.234 -# files removed with 'make mrproper'
   2.235 -MRPROPER_FILES = \
   2.236 -	include/linux/autoconf.h include/linux/version.h \
   2.237 -	drivers/net/hamradio/soundmodem/sm_tbl_{afsk1200,afsk2666,fsk9600}.h \
   2.238 -	drivers/net/hamradio/soundmodem/sm_tbl_{hapn4800,psk4800}.h \
   2.239 -	drivers/net/hamradio/soundmodem/sm_tbl_{afsk2400_7,afsk2400_8}.h \
   2.240 -	drivers/net/hamradio/soundmodem/gentbl \
   2.241 -	drivers/sound/*_boot.h drivers/sound/.*.boot \
   2.242 -	drivers/sound/msndinit.c \
   2.243 -	drivers/sound/msndperm.c \
   2.244 -	drivers/sound/pndsperm.c \
   2.245 -	drivers/sound/pndspini.c \
   2.246 -	drivers/atm/fore200e_*_fw.c drivers/atm/.fore200e_*.fw \
   2.247 -	.version .config* config.in config.old \
   2.248 -	scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp \
   2.249 -	scripts/lxdialog/*.o scripts/lxdialog/lxdialog \
   2.250 -	.menuconfig.log \
   2.251 -	include/asm \
   2.252 -	.hdepend scripts/mkdep scripts/split-include scripts/docproc \
   2.253 -	$(TOPDIR)/include/linux/modversions.h \
   2.254 -	kernel.spec
   2.255 -
   2.256 -# directories removed with 'make mrproper'
   2.257 -MRPROPER_DIRS = \
   2.258 -	include/config \
   2.259 -	$(TOPDIR)/include/linux/modules
   2.260 -
   2.261 -
   2.262 -include arch/$(ARCH)/Makefile
   2.263 -
   2.264 -# Extra cflags for kbuild 2.4.  The default is to forbid includes by kernel code
   2.265 -# from user space headers.  Some UML code requires user space headers, in the
   2.266 -# UML Makefiles add 'kbuild_2_4_nostdinc :=' before include Rules.make.  No
   2.267 -# other kernel code should include user space headers, if you need
   2.268 -# 'kbuild_2_4_nostdinc :=' or -I/usr/include for kernel code and you are not UML
   2.269 -# then your code is broken!  KAO.
   2.270 -
   2.271 -kbuild_2_4_nostdinc	:= -nostdinc -iwithprefix include
   2.272 -export kbuild_2_4_nostdinc
   2.273 -
   2.274 -export	CPPFLAGS CFLAGS CFLAGS_KERNEL AFLAGS AFLAGS_KERNEL
   2.275 -
   2.276 -export	NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS
   2.277 -
   2.278 -.S.s:
   2.279 -	$(CPP) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -o $*.s $<
   2.280 -.S.o:
   2.281 -	$(CC) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -c -o $*.o $<
   2.282 -
   2.283 -Version: dummy
   2.284 -	@rm -f include/linux/compile.h
   2.285 -
   2.286 -boot: vmlinux
   2.287 -	@$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C arch/$(ARCH)/boot
   2.288 -
   2.289 -vmlinux: include/linux/version.h $(CONFIGURATION) init/main.o init/version.o init/do_mounts.o linuxsubdirs
   2.290 -	$(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o init/do_mounts.o \
   2.291 -		--start-group \
   2.292 -		$(CORE_FILES) \
   2.293 -		$(DRIVERS) \
   2.294 -		$(NETWORKS) \
   2.295 -		$(LIBS) \
   2.296 -		--end-group \
   2.297 -		-o vmlinux
   2.298 -	$(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
   2.299 -
   2.300 -symlinks:
   2.301 -	rm -f include/asm
   2.302 -	( cd include ; ln -sf asm-$(ARCH) asm)
   2.303 -	@if [ ! -d include/linux/modules ]; then \
   2.304 -		mkdir include/linux/modules; \
   2.305 -	fi
   2.306 -
   2.307 -oldconfig: symlinks
   2.308 -	$(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
   2.309 -
   2.310 -xconfig: symlinks
   2.311 -	$(MAKE) -C scripts kconfig.tk
   2.312 -	wish -f scripts/kconfig.tk
   2.313 -
   2.314 -menuconfig: include/linux/version.h symlinks
   2.315 -	$(MAKE) -C scripts/lxdialog all
   2.316 -	$(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in
   2.317 -
   2.318 -config: symlinks
   2.319 -	$(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in
   2.320 -
   2.321 -include/config/MARKER: scripts/split-include include/linux/autoconf.h
   2.322 -	scripts/split-include include/linux/autoconf.h include/config
   2.323 -	@ touch include/config/MARKER
   2.324 -
   2.325 -linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
   2.326 -
   2.327 -$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/linux/version.h include/config/MARKER
   2.328 -	$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C $(patsubst _dir_%, %, $@)
   2.329 -
   2.330 -$(TOPDIR)/include/linux/version.h: include/linux/version.h
   2.331 -$(TOPDIR)/include/linux/compile.h: include/linux/compile.h
   2.332 -
   2.333 -newversion:
   2.334 -	. scripts/mkversion > .tmpversion
   2.335 -	@mv -f .tmpversion .version
   2.336 -
   2.337 -uts_len		:= 64
   2.338 -uts_truncate	:= sed -e 's/\(.\{1,$(uts_len)\}\).*/\1/'
   2.339 -
   2.340 -include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion
   2.341 -	@echo -n \#`cat .version` > .ver1
   2.342 -	@if [ -n "$(CONFIG_SMP)" ] ; then echo -n " SMP" >> .ver1; fi
   2.343 -	@if [ -f .name ]; then  echo -n \-`cat .name` >> .ver1; fi
   2.344 -	@LANG=C echo ' '`date` >> .ver1
   2.345 -	@echo \#define UTS_VERSION \"`cat .ver1 | $(uts_truncate)`\" > .ver
   2.346 -	@LANG=C echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> .ver
   2.347 -	@echo \#define LINUX_COMPILE_BY \"`whoami`\" >> .ver
   2.348 -	@echo \#define LINUX_COMPILE_HOST \"`hostname | $(uts_truncate)`\" >> .ver
   2.349 -	@([ -x /bin/dnsdomainname ] && /bin/dnsdomainname > .ver1) || \
   2.350 -	 ([ -x /bin/domainname ] && /bin/domainname > .ver1) || \
   2.351 -	 echo > .ver1
   2.352 -	@echo \#define LINUX_COMPILE_DOMAIN \"`cat .ver1 | $(uts_truncate)`\" >> .ver
   2.353 -	@echo \#define LINUX_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -1`\" >> .ver
   2.354 -	@mv -f .ver $@
   2.355 -	@rm -f .ver1
   2.356 -
   2.357 -include/linux/version.h: ./Makefile
   2.358 -	@expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
   2.359 -	  (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
   2.360 -	@echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
   2.361 -	@echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
   2.362 -	@echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver
   2.363 -	@mv -f .ver $@
   2.364 -
   2.365 -comma	:= ,
   2.366 -
   2.367 -init/version.o: init/version.c include/linux/compile.h include/config/MARKER
   2.368 -	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) -DUTS_MACHINE='"$(SUBARCH)"' -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o init/version.o init/version.c
   2.369 -
   2.370 -init/main.o: init/main.c include/config/MARKER
   2.371 -	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $<
   2.372 -
   2.373 -init/do_mounts.o: init/do_mounts.c include/config/MARKER
   2.374 -	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $<
   2.375 -
   2.376 -fs lib mm ipc kernel drivers net: dummy
   2.377 -	$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
   2.378 -
   2.379 -TAGS: dummy
   2.380 -	{ find include/asm-${ARCH} -name '*.h' -print ; \
   2.381 -	find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print ; \
   2.382 -	find $(SUBDIRS) init arch/${ARCH} -name '*.[chS]' ; } | grep -v SCCS | grep -v '\.svn' | etags -
   2.383 -
   2.384 -# Exuberant ctags works better with -I
   2.385 -tags: dummy
   2.386 -	CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
   2.387 -	ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
   2.388 -	find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
   2.389 -	find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a
   2.390 -
   2.391 -ifdef CONFIG_MODULES
   2.392 -ifdef CONFIG_MODVERSIONS
   2.393 -MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h
   2.394 -endif
   2.395 -
   2.396 -.PHONY: modules
   2.397 -modules: $(patsubst %, _mod_%, $(SUBDIRS))
   2.398 -
   2.399 -.PHONY: $(patsubst %, _mod_%, $(SUBDIRS))
   2.400 -$(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER
   2.401 -	$(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules
   2.402 -
   2.403 -.PHONY: modules_install
   2.404 -modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS)) _modinst_post
   2.405 -
   2.406 -.PHONY: _modinst_
   2.407 -_modinst_:
   2.408 -	@rm -rf $(MODLIB)/kernel
   2.409 -	@rm -f $(MODLIB)/build
   2.410 -	@mkdir -p $(MODLIB)/kernel
   2.411 -	@ln -s $(TOPDIR) $(MODLIB)/build
   2.412 -
   2.413 -# If System.map exists, run depmod.  This deliberately does not have a
   2.414 -# dependency on System.map since that would run the dependency tree on
   2.415 -# vmlinux.  This depmod is only for convenience to give the initial
   2.416 -# boot a modules.dep even before / is mounted read-write.  However the
   2.417 -# boot script depmod is the master version.
   2.418 -ifeq "$(strip $(INSTALL_MOD_PATH))" ""
   2.419 -depmod_opts	:=
   2.420 -else
   2.421 -depmod_opts	:= -b $(INSTALL_MOD_PATH) -r
   2.422 -endif
   2.423 -.PHONY: _modinst_post
   2.424 -_modinst_post: _modinst_post_pcmcia
   2.425 -#	if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
   2.426 -
   2.427 -# Backwards compatibilty symlinks for people still using old versions
   2.428 -# of pcmcia-cs with hard coded pathnames on insmod.  Remove
   2.429 -# _modinst_post_pcmcia for kernel 2.4.1.
   2.430 -.PHONY: _modinst_post_pcmcia
   2.431 -_modinst_post_pcmcia:
   2.432 -	cd $(MODLIB); \
   2.433 -	mkdir -p pcmcia; \
   2.434 -	find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
   2.435 -
   2.436 -.PHONY: $(patsubst %, _modinst_%, $(SUBDIRS))
   2.437 -$(patsubst %, _modinst_%, $(SUBDIRS)) :
   2.438 -	$(MAKE) -C $(patsubst _modinst_%, %, $@) modules_install
   2.439 -
   2.440 -# modules disabled....
   2.441 -
   2.442 -else
   2.443 -modules modules_install: dummy
   2.444 -	@echo
   2.445 -	@echo "The present kernel configuration has modules disabled."
   2.446 -	@echo "Type 'make config' and enable loadable module support."
   2.447 -	@echo "Then build a kernel with module support enabled."
   2.448 -	@echo
   2.449 -	@exit 1
   2.450 -endif
   2.451 -
   2.452 -clean:	archclean
   2.453 -	find . \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f -print \
   2.454 -		| grep -v lxdialog/ | xargs rm -f
   2.455 -	rm -f $(CLEAN_FILES)
   2.456 -	rm -rf $(CLEAN_DIRS)
   2.457 -	$(MAKE) -C Documentation/DocBook clean
   2.458 -
   2.459 -mrproper: clean archmrproper
   2.460 -	find . \( -size 0 -o -name .depend \) -type f -print | xargs rm -f
   2.461 -	rm -f $(MRPROPER_FILES)
   2.462 -	rm -rf $(MRPROPER_DIRS)
   2.463 -	$(MAKE) -C Documentation/DocBook mrproper
   2.464 -
   2.465 -distclean: mrproper
   2.466 -	rm -f core `find . \( -not -type d \) -and \
   2.467 -		\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
   2.468 -		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
   2.469 -		-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
   2.470 -
   2.471 -backup: mrproper
   2.472 -	cd .. && tar cf - linux/ | gzip -9 > backup.gz
   2.473 -	sync
   2.474 -
   2.475 -sgmldocs: 
   2.476 -	chmod 755 $(TOPDIR)/scripts/docgen
   2.477 -	chmod 755 $(TOPDIR)/scripts/gen-all-syms
   2.478 -	chmod 755 $(TOPDIR)/scripts/kernel-doc
   2.479 -	$(MAKE) -C $(TOPDIR)/Documentation/DocBook books
   2.480 -
   2.481 -psdocs: sgmldocs
   2.482 -	$(MAKE) -C Documentation/DocBook ps
   2.483 -
   2.484 -pdfdocs: sgmldocs
   2.485 -	$(MAKE) -C Documentation/DocBook pdf
   2.486 -
   2.487 -htmldocs: sgmldocs
   2.488 -	$(MAKE) -C Documentation/DocBook html
   2.489 -
   2.490 -mandocs:
   2.491 -	chmod 755 $(TOPDIR)/scripts/kernel-doc
   2.492 -	chmod 755 $(TOPDIR)/scripts/split-man
   2.493 -	$(MAKE) -C Documentation/DocBook man
   2.494 -
   2.495 -sums:
   2.496 -	find . -type f -print | sort | xargs sum > .SUMS
   2.497 -
   2.498 -dep-files: scripts/mkdep archdep include/linux/version.h
   2.499 -	scripts/mkdep -- init/*.c > .depend
   2.500 -	scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
   2.501 -	$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
   2.502 -ifdef CONFIG_MODVERSIONS
   2.503 -	$(MAKE) update-modverfile
   2.504 -endif
   2.505 -
   2.506 -ifdef CONFIG_MODVERSIONS
   2.507 -MODVERFILE := $(TOPDIR)/include/linux/modversions.h
   2.508 -else
   2.509 -MODVERFILE :=
   2.510 -endif
   2.511 -export	MODVERFILE
   2.512 -
   2.513 -depend dep: dep-files
   2.514 -
   2.515 -checkconfig:
   2.516 -	find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkconfig.pl
   2.517 -
   2.518 -checkhelp:
   2.519 -	find * -name [cC]onfig.in -print | sort | xargs $(PERL) -w scripts/checkhelp.pl
   2.520 -
   2.521 -checkincludes:
   2.522 -	find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl
   2.523 -
   2.524 -ifdef CONFIGURATION
   2.525 -..$(CONFIGURATION):
   2.526 -	@echo
   2.527 -	@echo "You have a bad or nonexistent" .$(CONFIGURATION) ": running 'make" $(CONFIGURATION)"'"
   2.528 -	@echo
   2.529 -	$(MAKE) $(CONFIGURATION)
   2.530 -	@echo
   2.531 -	@echo "Successful. Try re-making (ignore the error that follows)"
   2.532 -	@echo
   2.533 -	exit 1
   2.534 -
   2.535 -#dummy: ..$(CONFIGURATION)
   2.536 -dummy:
   2.537 -
   2.538 -else
   2.539 -
   2.540 -dummy:
   2.541 -
   2.542 -endif
   2.543 -
   2.544 -include Rules.make
   2.545 -
   2.546 -#
   2.547 -# This generates dependencies for the .h files.
   2.548 -#
   2.549 -
   2.550 -scripts/mkdep: scripts/mkdep.c
   2.551 -	$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
   2.552 -
   2.553 -scripts/split-include: scripts/split-include.c
   2.554 -	$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
   2.555 -
   2.556 -#
   2.557 -# RPM target
   2.558 -#
   2.559 -#	If you do a make spec before packing the tarball you can rpm -ta it
   2.560 -#
   2.561 -spec:
   2.562 -	. scripts/mkspec >kernel.spec
   2.563 -
   2.564 -#
   2.565 -#	Build a tar ball, generate an rpm from it and pack the result
   2.566 -#	There arw two bits of magic here
   2.567 -#	1) The use of /. to avoid tar packing just the symlink
   2.568 -#	2) Removing the .dep files as they have source paths in them that
   2.569 -#	   will become invalid
   2.570 -#
   2.571 -rpm:	clean spec
   2.572 -	find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f
   2.573 -	set -e; \
   2.574 -	cd $(TOPDIR)/.. ; \
   2.575 -	ln -sf $(TOPDIR) $(KERNELPATH) ; \
   2.576 -	tar -cvz --exclude CVS -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
   2.577 -	rm $(KERNELPATH) ; \
   2.578 -	cd $(TOPDIR) ; \
   2.579 -	. scripts/mkversion > .version ; \
   2.580 -	rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
   2.581 -	rm $(TOPDIR)/../$(KERNELPATH).tar.gz
     3.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/Makefile	Tue Jun 24 12:05:12 2003 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,101 +0,0 @@
     3.4 -#
     3.5 -# xeno/Makefile
     3.6 -#
     3.7 -# This file is included by the global makefile so that you can add your own
     3.8 -# architecture-specific flags and dependencies. Remember to do have actions
     3.9 -# for "archclean" and "archdep" for cleaning up and making dependencies for
    3.10 -# this architecture
    3.11 -#
    3.12 -# This file is subject to the terms and conditions of the GNU General Public
    3.13 -# License.  See the file "COPYING" in the main directory of this archive
    3.14 -# for more details.
    3.15 -#
    3.16 -# Copyright (C) 1994 by Linus Torvalds
    3.17 -#
    3.18 -# 19990713  Artur Skawina <skawina@geocities.com>
    3.19 -#           Added '-march' and '-mpreferred-stack-boundary' support
    3.20 -#
    3.21 -
    3.22 -LD=$(CROSS_COMPILE)ld -m elf_i386
    3.23 -OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
    3.24 -LDFLAGS=-e stext
    3.25 -LINKFLAGS =-T $(TOPDIR)/arch/xeno/vmlinux.lds $(LDFLAGS)
    3.26 -
    3.27 -CFLAGS += -pipe
    3.28 -
    3.29 -# prevent gcc from keeping the stack 16 byte aligned
    3.30 -CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi)
    3.31 -
    3.32 -ifdef CONFIG_M686
    3.33 -CFLAGS += -march=i686
    3.34 -endif
    3.35 -
    3.36 -ifdef CONFIG_MPENTIUMIII
    3.37 -CFLAGS += -march=i686
    3.38 -endif
    3.39 -
    3.40 -ifdef CONFIG_MPENTIUM4
    3.41 -CFLAGS += -march=i686
    3.42 -endif
    3.43 -
    3.44 -ifdef CONFIG_MK7
    3.45 -CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi) 
    3.46 -endif
    3.47 -
    3.48 -HEAD := arch/xeno/kernel/head.o arch/xeno/kernel/init_task.o
    3.49 -
    3.50 -SUBDIRS += arch/xeno/kernel arch/xeno/mm arch/xeno/lib
    3.51 -SUBDIRS += arch/xeno/drivers/console arch/xeno/drivers/network
    3.52 -SUBDIRS += arch/xeno/drivers/dom0 arch/xeno/drivers/block
    3.53 -SUBDIRS += arch/xeno/drivers/balloon
    3.54 -
    3.55 -CORE_FILES += arch/xeno/kernel/kernel.o arch/xeno/mm/mm.o
    3.56 -CORE_FILES += arch/xeno/drivers/console/con.o
    3.57 -CORE_FILES += arch/xeno/drivers/block/blk.o
    3.58 -CORE_FILES += arch/xeno/drivers/network/net.o
    3.59 -CORE_FILES += arch/xeno/drivers/dom0/dom0.o
    3.60 -CORE_FILES += arch/xeno/drivers/balloon/balloon_driver.o
    3.61 -LIBS := $(TOPDIR)/arch/xeno/lib/lib.a $(LIBS) $(TOPDIR)/arch/xeno/lib/lib.a
    3.62 -
    3.63 -arch/xeno/kernel: dummy
    3.64 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xeno/kernel
    3.65 -
    3.66 -arch/xeno/mm: dummy
    3.67 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xeno/mm
    3.68 -
    3.69 -arch/xeno/drivers/console: dummy
    3.70 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xeno/drivers/console
    3.71 -
    3.72 -arch/xeno/drivers/network: dummy
    3.73 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xeno/drivers/network
    3.74 -
    3.75 -arch/xeno/drivers/block: dummy
    3.76 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xeno/drivers/block
    3.77 -
    3.78 -arch/xeno/drivers/dom0: dummy
    3.79 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xeno/drivers/dom0
    3.80 -
    3.81 -arch/xeno/drivers/balloon: dummy
    3.82 -	$(MAKE) linuxsubdirs SUBDIRS=arch/xeno/drivers/balloon
    3.83 -
    3.84 -MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
    3.85 -
    3.86 -vmlinux: arch/xeno/vmlinux.lds
    3.87 -
    3.88 -FORCE: ;
    3.89 -
    3.90 -.PHONY: bzImage compressed clean archclean archmrproper archdep
    3.91 -
    3.92 -bzImage: vmlinux
    3.93 -	@$(MAKEBOOT) image.gz
    3.94 -
    3.95 -install: bzImage
    3.96 -	cp -a arch/$(ARCH)/boot/image.gz ../install/boot/xenolinux.gz
    3.97 -
    3.98 -archclean:
    3.99 -	@$(MAKEBOOT) clean
   3.100 -
   3.101 -archmrproper:
   3.102 -
   3.103 -archdep:
   3.104 -	@$(MAKEBOOT) dep
     4.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/boot/Makefile	Tue Jun 24 12:05:12 2003 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,22 +0,0 @@
     4.4 -#
     4.5 -# arch/xeno/boot/Makefile
     4.6 -#
     4.7 -
     4.8 -image.gz: image
     4.9 -	gzip -f -9 < $< > $@
    4.10 -
    4.11 -image: $(TOPDIR)/vmlinux
    4.12 -	# Guest OS header -- first 8 bytes are identifier 'XenoGues'.
    4.13 -	echo -e -n 'XenoGues' >$@ 
    4.14 -	# Guest OS header -- next 4 bytes are load address (0xC0000000).
    4.15 -	echo -e -n '\000\000\000\300' >>$@
    4.16 -	$(OBJCOPY) $< image.body
    4.17 -	# Guest OS header is immediately followed by raw OS image.
    4.18 -	# Start address must be at byte 0.
    4.19 -	cat image.body >>$@
    4.20 -	rm -f image.body
    4.21 -
    4.22 -dep:
    4.23 -
    4.24 -clean:
    4.25 -	rm -f image image.gz
     5.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/config.in	Tue Jun 24 12:05:12 2003 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,165 +0,0 @@
     5.4 -#
     5.5 -# For a description of the syntax of this configuration file,
     5.6 -# see Documentation/kbuild/config-language.txt.
     5.7 -#
     5.8 -mainmenu_name "Linux Kernel Configuration"
     5.9 -
    5.10 -define_bool CONFIG_XENO y
    5.11 -
    5.12 -define_bool CONFIG_X86 y
    5.13 -define_bool CONFIG_ISA y
    5.14 -define_bool CONFIG_SBUS n
    5.15 -
    5.16 -define_bool CONFIG_UID16 y
    5.17 -
    5.18 -mainmenu_option next_comment
    5.19 -comment 'Code maturity level options'
    5.20 -bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL
    5.21 -endmenu
    5.22 -
    5.23 -mainmenu_option next_comment
    5.24 -comment 'Loadable module support'
    5.25 -bool 'Enable loadable module support' CONFIG_MODULES
    5.26 -if [ "$CONFIG_MODULES" = "y" ]; then
    5.27 -   bool '  Set version information on all module symbols' CONFIG_MODVERSIONS
    5.28 -   bool '  Kernel module loader' CONFIG_KMOD
    5.29 -fi
    5.30 -endmenu
    5.31 -
    5.32 -mainmenu_option next_comment
    5.33 -comment 'Processor type and features'
    5.34 -choice 'Processor family' \
    5.35 -	"Pentium-Pro/Celeron/Pentium-II		CONFIG_M686 \
    5.36 -	 Pentium-III/Celeron(Coppermine)	CONFIG_MPENTIUMIII \
    5.37 -	 Pentium-4				CONFIG_MPENTIUM4 \
    5.38 -	 Athlon/Duron/K7			CONFIG_MK7" Pentium-Pro
    5.39 -
    5.40 -   define_bool CONFIG_X86_WP_WORKS_OK y
    5.41 -   define_bool CONFIG_X86_INVLPG y
    5.42 -   define_bool CONFIG_X86_CMPXCHG y
    5.43 -   define_bool CONFIG_X86_XADD y
    5.44 -   define_bool CONFIG_X86_BSWAP y
    5.45 -   define_bool CONFIG_X86_POPAD_OK y
    5.46 -   define_bool CONFIG_RWSEM_GENERIC_SPINLOCK n
    5.47 -   define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM y
    5.48 -
    5.49 -   define_bool CONFIG_X86_GOOD_APIC y
    5.50 -   define_bool CONFIG_X86_PGE y
    5.51 -   define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
    5.52 -   define_bool CONFIG_X86_TSC y
    5.53 -
    5.54 -if [ "$CONFIG_M686" = "y" ]; then
    5.55 -   define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    5.56 -fi
    5.57 -if [ "$CONFIG_MPENTIUMIII" = "y" ]; then
    5.58 -   define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    5.59 -fi
    5.60 -if [ "$CONFIG_MPENTIUM4" = "y" ]; then
    5.61 -   define_int  CONFIG_X86_L1_CACHE_SHIFT 7
    5.62 -fi
    5.63 -if [ "$CONFIG_MK7" = "y" ]; then
    5.64 -   define_int  CONFIG_X86_L1_CACHE_SHIFT 6
    5.65 -   define_bool CONFIG_X86_USE_3DNOW y
    5.66 -fi
    5.67 -
    5.68 -choice 'High Memory Support' \
    5.69 -	"off    CONFIG_NOHIGHMEM \
    5.70 -	 4GB    CONFIG_HIGHMEM4G \
    5.71 -	 64GB   CONFIG_HIGHMEM64G" off
    5.72 -if [ "$CONFIG_HIGHMEM4G" = "y" ]; then
    5.73 -   define_bool CONFIG_HIGHMEM y
    5.74 -fi
    5.75 -if [ "$CONFIG_HIGHMEM64G" = "y" ]; then
    5.76 -   define_bool CONFIG_HIGHMEM y
    5.77 -   define_bool CONFIG_X86_PAE y
    5.78 -fi
    5.79 -
    5.80 -#bool 'Symmetric multi-processing support' CONFIG_SMP
    5.81 -#if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then
    5.82 -#   define_bool CONFIG_HAVE_DEC_LOCK y
    5.83 -#fi
    5.84 -endmenu
    5.85 -
    5.86 -mainmenu_option next_comment
    5.87 -comment 'General setup'
    5.88 -
    5.89 -bool 'Networking support' CONFIG_NET
    5.90 -
    5.91 -bool 'System V IPC' CONFIG_SYSVIPC
    5.92 -bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
    5.93 -bool 'Sysctl support' CONFIG_SYSCTL
    5.94 -if [ "$CONFIG_PROC_FS" = "y" ]; then
    5.95 -   choice 'Kernel core (/proc/kcore) format' \
    5.96 -	"ELF		CONFIG_KCORE_ELF	\
    5.97 -	 A.OUT		CONFIG_KCORE_AOUT" ELF
    5.98 -fi
    5.99 -tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
   5.100 -tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
   5.101 -tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
   5.102 -
   5.103 -endmenu
   5.104 -
   5.105 -if [ "$CONFIG_NET" = "y" ]; then
   5.106 -   source net/Config.in
   5.107 -fi
   5.108 -
   5.109 -
   5.110 -#
   5.111 -# Block device driver configuration
   5.112 -#
   5.113 -mainmenu_option next_comment
   5.114 -comment 'Block devices'
   5.115 -tristate 'Loopback device support' CONFIG_BLK_DEV_LOOP
   5.116 -dep_tristate 'Network block device support' CONFIG_BLK_DEV_NBD $CONFIG_NET
   5.117 -tristate 'RAM disk support' CONFIG_BLK_DEV_RAM
   5.118 -if [ "$CONFIG_BLK_DEV_RAM" = "y" -o "$CONFIG_BLK_DEV_RAM" = "m" ]; then
   5.119 -   int '  Default RAM disk size' CONFIG_BLK_DEV_RAM_SIZE 4096
   5.120 -fi
   5.121 -dep_bool '  Initial RAM disk (initrd) support' CONFIG_BLK_DEV_INITRD $CONFIG_BLK_DEV_RAM
   5.122 -bool 'Per partition statistics in /proc/partitions' CONFIG_BLK_STATS
   5.123 -bool 'XenoLinux virtual block device support' CONFIG_XENOLINUX_BLOCK
   5.124 -endmenu
   5.125 -define_bool CONFIG_BLK_DEV_IDE_MODES n
   5.126 -define_bool CONFIG_BLK_DEV_HD n
   5.127 -
   5.128 -
   5.129 -mainmenu_option next_comment
   5.130 -comment 'Character devices'
   5.131 -
   5.132 -bool 'Xen console support' CONFIG_XEN_CONSOLE
   5.133 -comment 'The options below are alpha-stage and will probably not work'
   5.134 -bool 'Virtual terminal' CONFIG_VT
   5.135 -if [ "$CONFIG_VT" = "y" ]; then
   5.136 -   bool '  Support for console on virtual terminal' CONFIG_VT_CONSOLE
   5.137 -   bool '  Support for VGA Video' CONFIG_VGA_CONSOLE
   5.138 -   bool '  Support for Dummy Video (for testing)' CONFIG_DUMMY_CONSOLE
   5.139 -   bool '  PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE
   5.140 -fi
   5.141 -
   5.142 -bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
   5.143 -if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
   5.144 -   int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256
   5.145 -fi
   5.146 -
   5.147 -endmenu
   5.148 -
   5.149 -source fs/Config.in
   5.150 -
   5.151 -mainmenu_option next_comment
   5.152 -comment 'Kernel hacking'
   5.153 -
   5.154 -bool 'Kernel debugging' CONFIG_DEBUG_KERNEL
   5.155 -if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then
   5.156 -   bool '  Debug high memory support' CONFIG_DEBUG_HIGHMEM
   5.157 -   bool '  Debug memory allocations' CONFIG_DEBUG_SLAB
   5.158 -   bool '  Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT
   5.159 -   bool '  Magic SysRq key' CONFIG_MAGIC_SYSRQ
   5.160 -   bool '  Spinlock debugging' CONFIG_DEBUG_SPINLOCK
   5.161 -   bool '  Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE
   5.162 -   bool '  Load all symbols for debugging' CONFIG_KALLSYMS
   5.163 -   bool '  Compile the kernel with frame pointers' CONFIG_FRAME_POINTER
   5.164 -fi
   5.165 -
   5.166 -endmenu
   5.167 -
   5.168 -source lib/Config.in
     6.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/defconfig	Tue Jun 24 12:05:12 2003 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,283 +0,0 @@
     6.4 -#
     6.5 -# Automatically generated make config: don't edit
     6.6 -#
     6.7 -CONFIG_XENO=y
     6.8 -CONFIG_X86=y
     6.9 -CONFIG_ISA=y
    6.10 -# CONFIG_SBUS is not set
    6.11 -CONFIG_UID16=y
    6.12 -
    6.13 -#
    6.14 -# Code maturity level options
    6.15 -#
    6.16 -# CONFIG_EXPERIMENTAL is not set
    6.17 -
    6.18 -#
    6.19 -# Loadable module support
    6.20 -#
    6.21 -CONFIG_MODULES=y
    6.22 -CONFIG_MODVERSIONS=y
    6.23 -CONFIG_KMOD=y
    6.24 -
    6.25 -#
    6.26 -# Processor type and features
    6.27 -#
    6.28 -CONFIG_M686=y
    6.29 -# CONFIG_MPENTIUMIII is not set
    6.30 -# CONFIG_MPENTIUM4 is not set
    6.31 -# CONFIG_MK7 is not set
    6.32 -CONFIG_X86_WP_WORKS_OK=y
    6.33 -CONFIG_X86_INVLPG=y
    6.34 -CONFIG_X86_CMPXCHG=y
    6.35 -CONFIG_X86_XADD=y
    6.36 -CONFIG_X86_BSWAP=y
    6.37 -CONFIG_X86_POPAD_OK=y
    6.38 -# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
    6.39 -CONFIG_RWSEM_XCHGADD_ALGORITHM=y
    6.40 -CONFIG_X86_GOOD_APIC=y
    6.41 -CONFIG_X86_PGE=y
    6.42 -CONFIG_X86_USE_PPRO_CHECKSUM=y
    6.43 -CONFIG_X86_TSC=y
    6.44 -CONFIG_X86_L1_CACHE_SHIFT=5
    6.45 -CONFIG_NOHIGHMEM=y
    6.46 -# CONFIG_HIGHMEM4G is not set
    6.47 -# CONFIG_HIGHMEM64G is not set
    6.48 -
    6.49 -#
    6.50 -# General setup
    6.51 -#
    6.52 -CONFIG_NET=y
    6.53 -CONFIG_SYSVIPC=y
    6.54 -# CONFIG_BSD_PROCESS_ACCT is not set
    6.55 -CONFIG_SYSCTL=y
    6.56 -CONFIG_KCORE_ELF=y
    6.57 -# CONFIG_KCORE_AOUT is not set
    6.58 -CONFIG_BINFMT_AOUT=y
    6.59 -CONFIG_BINFMT_ELF=y
    6.60 -# CONFIG_BINFMT_MISC is not set
    6.61 -
    6.62 -#
    6.63 -# Networking options
    6.64 -#
    6.65 -CONFIG_PACKET=y
    6.66 -CONFIG_PACKET_MMAP=y
    6.67 -# CONFIG_NETLINK_DEV is not set
    6.68 -# CONFIG_NETFILTER is not set
    6.69 -CONFIG_FILTER=y
    6.70 -CONFIG_UNIX=y
    6.71 -CONFIG_INET=y
    6.72 -# CONFIG_IP_MULTICAST is not set
    6.73 -# CONFIG_IP_ADVANCED_ROUTER is not set
    6.74 -CONFIG_IP_PNP=y
    6.75 -# CONFIG_IP_PNP_DHCP is not set
    6.76 -# CONFIG_IP_PNP_BOOTP is not set
    6.77 -# CONFIG_IP_PNP_RARP is not set
    6.78 -# CONFIG_NET_IPIP is not set
    6.79 -# CONFIG_NET_IPGRE is not set
    6.80 -# CONFIG_INET_ECN is not set
    6.81 -# CONFIG_SYN_COOKIES is not set
    6.82 -# CONFIG_VLAN_8021Q is not set
    6.83 -
    6.84 -#
    6.85 -#  
    6.86 -#
    6.87 -# CONFIG_IPX is not set
    6.88 -# CONFIG_ATALK is not set
    6.89 -
    6.90 -#
    6.91 -# Appletalk devices
    6.92 -#
    6.93 -# CONFIG_DEV_APPLETALK is not set
    6.94 -# CONFIG_DECNET is not set
    6.95 -# CONFIG_BRIDGE is not set
    6.96 -
    6.97 -#
    6.98 -# QoS and/or fair queueing
    6.99 -#
   6.100 -# CONFIG_NET_SCHED is not set
   6.101 -
   6.102 -#
   6.103 -# Network testing
   6.104 -#
   6.105 -# CONFIG_NET_PKTGEN is not set
   6.106 -
   6.107 -#
   6.108 -# Block devices
   6.109 -#
   6.110 -# CONFIG_BLK_DEV_FD is not set
   6.111 -# CONFIG_BLK_DEV_XD is not set
   6.112 -# CONFIG_PARIDE is not set
   6.113 -# CONFIG_BLK_CPQ_DA is not set
   6.114 -# CONFIG_BLK_CPQ_CISS_DA is not set
   6.115 -# CONFIG_CISS_SCSI_TAPE is not set
   6.116 -# CONFIG_BLK_DEV_DAC960 is not set
   6.117 -# CONFIG_BLK_DEV_UMEM is not set
   6.118 -CONFIG_BLK_DEV_LOOP=y
   6.119 -CONFIG_BLK_DEV_NBD=y
   6.120 -CONFIG_BLK_DEV_RAM=y
   6.121 -CONFIG_BLK_DEV_RAM_SIZE=4096
   6.122 -CONFIG_BLK_DEV_INITRD=y
   6.123 -# CONFIG_BLK_STATS is not set
   6.124 -CONFIG_XENOLINUX_BLOCK=y
   6.125 -# CONFIG_BLK_DEV_IDE_MODES is not set
   6.126 -# CONFIG_BLK_DEV_HD is not set
   6.127 -
   6.128 -#
   6.129 -# Character devices
   6.130 -#
   6.131 -CONFIG_XEN_CONSOLE=y
   6.132 -# CONFIG_VT is not set
   6.133 -# CONFIG_VGA_CONSOLE is not set
   6.134 -# CONFIG_DUMMY_CONSOLE is not set
   6.135 -# CONFIG_PSMOUSE is not set
   6.136 -# CONFIG_UNIX98_PTYS is not set
   6.137 -
   6.138 -#
   6.139 -# File systems
   6.140 -#
   6.141 -# CONFIG_QUOTA is not set
   6.142 -CONFIG_AUTOFS_FS=y
   6.143 -CONFIG_AUTOFS4_FS=y
   6.144 -# CONFIG_REISERFS_FS is not set
   6.145 -# CONFIG_REISERFS_CHECK is not set
   6.146 -# CONFIG_REISERFS_PROC_INFO is not set
   6.147 -# CONFIG_ADFS_FS is not set
   6.148 -# CONFIG_ADFS_FS_RW is not set
   6.149 -# CONFIG_AFFS_FS is not set
   6.150 -# CONFIG_HFS_FS is not set
   6.151 -# CONFIG_BEFS_FS is not set
   6.152 -# CONFIG_BEFS_DEBUG is not set
   6.153 -# CONFIG_BFS_FS is not set
   6.154 -CONFIG_EXT3_FS=y
   6.155 -CONFIG_JBD=y
   6.156 -# CONFIG_JBD_DEBUG is not set
   6.157 -# CONFIG_FAT_FS is not set
   6.158 -# CONFIG_MSDOS_FS is not set
   6.159 -# CONFIG_UMSDOS_FS is not set
   6.160 -# CONFIG_VFAT_FS is not set
   6.161 -# CONFIG_EFS_FS is not set
   6.162 -# CONFIG_JFFS_FS is not set
   6.163 -# CONFIG_JFFS2_FS is not set
   6.164 -# CONFIG_CRAMFS is not set
   6.165 -CONFIG_TMPFS=y
   6.166 -CONFIG_RAMFS=y
   6.167 -CONFIG_ISO9660_FS=y
   6.168 -CONFIG_JOLIET=y
   6.169 -CONFIG_ZISOFS=y
   6.170 -# CONFIG_JFS_FS is not set
   6.171 -# CONFIG_JFS_DEBUG is not set
   6.172 -# CONFIG_JFS_STATISTICS is not set
   6.173 -# CONFIG_MINIX_FS is not set
   6.174 -# CONFIG_VXFS_FS is not set
   6.175 -# CONFIG_NTFS_FS is not set
   6.176 -# CONFIG_NTFS_RW is not set
   6.177 -# CONFIG_HPFS_FS is not set
   6.178 -CONFIG_PROC_FS=y
   6.179 -# CONFIG_DEVFS_FS is not set
   6.180 -# CONFIG_DEVFS_MOUNT is not set
   6.181 -# CONFIG_DEVFS_DEBUG is not set
   6.182 -# CONFIG_DEVPTS_FS is not set
   6.183 -# CONFIG_QNX4FS_FS is not set
   6.184 -# CONFIG_QNX4FS_RW is not set
   6.185 -# CONFIG_ROMFS_FS is not set
   6.186 -CONFIG_EXT2_FS=y
   6.187 -# CONFIG_SYSV_FS is not set
   6.188 -# CONFIG_UDF_FS is not set
   6.189 -# CONFIG_UDF_RW is not set
   6.190 -# CONFIG_UFS_FS is not set
   6.191 -# CONFIG_UFS_FS_WRITE is not set
   6.192 -
   6.193 -#
   6.194 -# Network File Systems
   6.195 -#
   6.196 -# CONFIG_CODA_FS is not set
   6.197 -# CONFIG_INTERMEZZO_FS is not set
   6.198 -CONFIG_NFS_FS=y
   6.199 -CONFIG_NFS_V3=y
   6.200 -CONFIG_ROOT_NFS=y
   6.201 -CONFIG_NFSD=y
   6.202 -CONFIG_NFSD_V3=y
   6.203 -# CONFIG_NFSD_TCP is not set
   6.204 -CONFIG_SUNRPC=y
   6.205 -CONFIG_LOCKD=y
   6.206 -CONFIG_LOCKD_V4=y
   6.207 -# CONFIG_SMB_FS is not set
   6.208 -# CONFIG_NCP_FS is not set
   6.209 -# CONFIG_NCPFS_PACKET_SIGNING is not set
   6.210 -# CONFIG_NCPFS_IOCTL_LOCKING is not set
   6.211 -# CONFIG_NCPFS_STRONG is not set
   6.212 -# CONFIG_NCPFS_NFS_NS is not set
   6.213 -# CONFIG_NCPFS_OS2_NS is not set
   6.214 -# CONFIG_NCPFS_SMALLDOS is not set
   6.215 -# CONFIG_NCPFS_NLS is not set
   6.216 -# CONFIG_NCPFS_EXTRAS is not set
   6.217 -CONFIG_ZISOFS_FS=y
   6.218 -
   6.219 -#
   6.220 -# Partition Types
   6.221 -#
   6.222 -# CONFIG_PARTITION_ADVANCED is not set
   6.223 -CONFIG_MSDOS_PARTITION=y
   6.224 -# CONFIG_SMB_NLS is not set
   6.225 -CONFIG_NLS=y
   6.226 -
   6.227 -#
   6.228 -# Native Language Support
   6.229 -#
   6.230 -CONFIG_NLS_DEFAULT="iso8559-1"
   6.231 -# CONFIG_NLS_CODEPAGE_437 is not set
   6.232 -# CONFIG_NLS_CODEPAGE_737 is not set
   6.233 -# CONFIG_NLS_CODEPAGE_775 is not set
   6.234 -# CONFIG_NLS_CODEPAGE_850 is not set
   6.235 -# CONFIG_NLS_CODEPAGE_852 is not set
   6.236 -# CONFIG_NLS_CODEPAGE_855 is not set
   6.237 -# CONFIG_NLS_CODEPAGE_857 is not set
   6.238 -# CONFIG_NLS_CODEPAGE_860 is not set
   6.239 -# CONFIG_NLS_CODEPAGE_861 is not set
   6.240 -# CONFIG_NLS_CODEPAGE_862 is not set
   6.241 -# CONFIG_NLS_CODEPAGE_863 is not set
   6.242 -# CONFIG_NLS_CODEPAGE_864 is not set
   6.243 -# CONFIG_NLS_CODEPAGE_865 is not set
   6.244 -# CONFIG_NLS_CODEPAGE_866 is not set
   6.245 -# CONFIG_NLS_CODEPAGE_869 is not set
   6.246 -# CONFIG_NLS_CODEPAGE_936 is not set
   6.247 -# CONFIG_NLS_CODEPAGE_950 is not set
   6.248 -# CONFIG_NLS_CODEPAGE_932 is not set
   6.249 -# CONFIG_NLS_CODEPAGE_949 is not set
   6.250 -# CONFIG_NLS_CODEPAGE_874 is not set
   6.251 -# CONFIG_NLS_ISO8859_8 is not set
   6.252 -# CONFIG_NLS_CODEPAGE_1250 is not set
   6.253 -# CONFIG_NLS_CODEPAGE_1251 is not set
   6.254 -CONFIG_NLS_ISO8859_1=y
   6.255 -# CONFIG_NLS_ISO8859_2 is not set
   6.256 -# CONFIG_NLS_ISO8859_3 is not set
   6.257 -# CONFIG_NLS_ISO8859_4 is not set
   6.258 -# CONFIG_NLS_ISO8859_5 is not set
   6.259 -# CONFIG_NLS_ISO8859_6 is not set
   6.260 -# CONFIG_NLS_ISO8859_7 is not set
   6.261 -# CONFIG_NLS_ISO8859_9 is not set
   6.262 -# CONFIG_NLS_ISO8859_13 is not set
   6.263 -# CONFIG_NLS_ISO8859_14 is not set
   6.264 -# CONFIG_NLS_ISO8859_15 is not set
   6.265 -# CONFIG_NLS_KOI8_R is not set
   6.266 -# CONFIG_NLS_KOI8_U is not set
   6.267 -# CONFIG_NLS_UTF8 is not set
   6.268 -
   6.269 -#
   6.270 -# Kernel hacking
   6.271 -#
   6.272 -CONFIG_DEBUG_KERNEL=y
   6.273 -# CONFIG_DEBUG_HIGHMEM is not set
   6.274 -# CONFIG_DEBUG_SLAB is not set
   6.275 -# CONFIG_DEBUG_IOVIRT is not set
   6.276 -# CONFIG_MAGIC_SYSRQ is not set
   6.277 -# CONFIG_DEBUG_SPINLOCK is not set
   6.278 -# CONFIG_DEBUG_BUGVERBOSE is not set
   6.279 -CONFIG_KALLSYMS=y
   6.280 -# CONFIG_FRAME_POINTER is not set
   6.281 -
   6.282 -#
   6.283 -# Library routines
   6.284 -#
   6.285 -CONFIG_ZLIB_INFLATE=y
   6.286 -# CONFIG_ZLIB_DEFLATE is not set
     7.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/balloon/Makefile	Tue Jun 24 12:05:12 2003 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,3 +0,0 @@
     7.4 -O_TARGET := balloon_driver.o
     7.5 -obj-y := balloon.o
     7.6 -include $(TOPDIR)/Rules.make
     8.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/balloon/balloon.c	Tue Jun 24 12:05:12 2003 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,282 +0,0 @@
     8.4 -/******************************************************************************
     8.5 - * balloon.c
     8.6 - *
     8.7 - * Xeno balloon driver - enables returning/claiming memory to/from xen
     8.8 - *
     8.9 - * Copyright (c) 2003, B Dragovic
    8.10 - */
    8.11 -
    8.12 -#include <linux/config.h>
    8.13 -#include <linux/module.h>
    8.14 -#include <linux/kernel.h>
    8.15 -#include <linux/sched.h>
    8.16 -#include <linux/errno.h>
    8.17 -#include <linux/proc_fs.h>
    8.18 -
    8.19 -#include <linux/mm.h>
    8.20 -#include <linux/mman.h>
    8.21 -#include <linux/smp_lock.h>
    8.22 -#include <linux/pagemap.h>
    8.23 -
    8.24 -#include <asm/hypervisor.h>
    8.25 -#include <asm/pgalloc.h>
    8.26 -#include <asm/pgtable.h>
    8.27 -#include <asm/uaccess.h>
    8.28 -#include <asm/tlb.h>
    8.29 -
    8.30 -#include "dom_mem_ops.h"
    8.31 -
    8.32 -/* USER DEFINES -- THESE SHOULD BE COPIED TO USER-SPACE TOOLS */
    8.33 -#define USER_INFLATE_BALLOON  1   /* return mem to hypervisor */
    8.34 -#define USER_DEFLATE_BALLOON  2   /* claim mem from hypervisor */
    8.35 -typedef struct user_balloon_op {
    8.36 -    unsigned int  op;
    8.37 -    unsigned long size;
    8.38 -} user_balloon_op_t;
    8.39 -/* END OF USER DEFINE */
    8.40 -
    8.41 -/* Dead entry written into ballon-owned entries in the PMT. */
    8.42 -#define DEAD 0xdeadbeef
    8.43 -
    8.44 -#define BALLOON_ENTRY    "balloon"
    8.45 -extern struct proc_dir_entry *xeno_base;
    8.46 -
    8.47 -static struct proc_dir_entry *balloon_pde;
    8.48 -unsigned long credit;
    8.49 -
    8.50 -static inline unsigned long get_ppte(unsigned long addr)
    8.51 -{
    8.52 -    unsigned long ppte;
    8.53 -    pgd_t *pgd; pmd_t *pmd; pte_t *ptep;
    8.54 -    pgd = pgd_offset_k(addr);
    8.55 -
    8.56 -    if ( pgd_none(*pgd) || pgd_bad(*pgd) ) BUG();
    8.57 -
    8.58 -    pmd = pmd_offset(pgd, addr);
    8.59 -    if ( pmd_none(*pmd) || pmd_bad(*pmd) ) BUG();
    8.60 -
    8.61 -    ptep = pte_offset(pmd, addr);
    8.62 -    ppte = (unsigned long)__pa(ptep);
    8.63 -
    8.64 -    return ppte;
    8.65 -}
    8.66 -
    8.67 -/* main function for relinquishing bit of memory */
    8.68 -static unsigned long inflate_balloon(unsigned long num_pages)
    8.69 -{
    8.70 -    dom_mem_op_t dom_mem_op;
    8.71 -    unsigned long *parray;
    8.72 -    unsigned long *currp;
    8.73 -    unsigned long curraddr;
    8.74 -    unsigned long ret = 0;
    8.75 -    unsigned long vaddr;
    8.76 -    unsigned long i, j;
    8.77 -
    8.78 -    parray = (unsigned long *)kmalloc(num_pages *
    8.79 -                                      sizeof(unsigned long), GFP_KERNEL);
    8.80 -    currp = parray;
    8.81 -
    8.82 -    for ( i = 0; i < num_pages; i++ )
    8.83 -    {
    8.84 -        /* try to obtain a free page, has to be done with GFP_ATOMIC
    8.85 -         * as we do not want to sleep indefinately.
    8.86 -         */
    8.87 -        vaddr = __get_free_page(GFP_ATOMIC);
    8.88 -
    8.89 -        /* if allocation fails, free all reserved pages */
    8.90 -        if(!vaddr){
    8.91 -            printk("Unable to inflate balloon by %ld, only %ld pages free.",
    8.92 -                   num_pages, i);
    8.93 -            currp = parray;
    8.94 -            for(j = 0; j < i; j++){
    8.95 -                free_page(*currp++);
    8.96 -            }
    8.97 -            goto cleanup;
    8.98 -        }
    8.99 -
   8.100 -        *currp++ = vaddr;
   8.101 -    }
   8.102 -
   8.103 -
   8.104 -    currp = parray;
   8.105 -    for ( i = 0; i < num_pages; i++ )
   8.106 -    {
   8.107 -        curraddr = *currp;
   8.108 -        *currp = virt_to_machine(*currp) >> PAGE_SHIFT;
   8.109 -        queue_l1_entry_update(get_ppte(curraddr) | PGREQ_NORMAL, 0);
   8.110 -        phys_to_machine_mapping[__pa(curraddr) >> PAGE_SHIFT] = DEAD;
   8.111 -        currp++;
   8.112 -    }
   8.113 -
   8.114 -    XENO_flush_page_update_queue();
   8.115 -
   8.116 -    dom_mem_op.op = BALLOON_INFLATE_OP;
   8.117 -    dom_mem_op.u.balloon_inflate.size  = num_pages;
   8.118 -    dom_mem_op.u.balloon_inflate.pages = parray;
   8.119 -    if ( (ret = HYPERVISOR_dom_mem_op(&dom_mem_op)) != num_pages )
   8.120 -    {
   8.121 -        printk("Unable to inflate balloon, error %lx\n", ret);
   8.122 -        goto cleanup;
   8.123 -    }
   8.124 -
   8.125 -    credit += num_pages;
   8.126 -    ret = num_pages;
   8.127 -
   8.128 - cleanup:
   8.129 -    kfree(parray);
   8.130 -
   8.131 -    return ret;
   8.132 -}
   8.133 -
   8.134 -/* install new mem pages obtained by deflate_balloon. function walks 
   8.135 - * phys->machine mapping table looking for DEAD entries and populates
   8.136 - * them.
   8.137 - */
   8.138 -static unsigned long process_new_pages(unsigned long * parray, 
   8.139 -                                       unsigned long num)
   8.140 -{
   8.141 -    /* currently, this function is rather simplistic as 
   8.142 -     * it is assumed that domain reclaims only number of 
   8.143 -     * pages previously released. this is to change soon
   8.144 -     * and the code to extend page tables etc. will be 
   8.145 -     * incorporated here.
   8.146 -     */
   8.147 -     
   8.148 -    unsigned long tot_pages = start_info.nr_pages;   
   8.149 -    unsigned long * curr = parray;
   8.150 -    unsigned long num_installed;
   8.151 -    unsigned long i;
   8.152 -
   8.153 -    num_installed = 0;
   8.154 -    for ( i = 0; (i < tot_pages) && (num_installed < num); i++ )
   8.155 -    {
   8.156 -        if ( phys_to_machine_mapping[i] == DEAD )
   8.157 -        {
   8.158 -            printk(KERN_ALERT "bd240 debug: proc_new_pages: i %lx, mpt %lx, %lx\n", i, i << PAGE_SHIFT, get_ppte((unsigned long)__va(i << PAGE_SHIFT)) | PGREQ_NORMAL);
   8.159 -            phys_to_machine_mapping[i] = *curr;
   8.160 -            queue_l1_entry_update((i << PAGE_SHIFT) | PGREQ_MPT_UPDATE, i);
   8.161 -            queue_l1_entry_update(
   8.162 -                get_ppte((unsigned long)__va(i << PAGE_SHIFT)) | PGREQ_NORMAL, 
   8.163 -                ((*curr) << PAGE_SHIFT) | L1_PROT);
   8.164 -
   8.165 -            *curr = (unsigned long)__va(i << PAGE_SHIFT);
   8.166 -            curr++;
   8.167 -            num_installed++;
   8.168 -        }
   8.169 -    }
   8.170 -
   8.171 -    /* now, this is tricky (and will also change for machine addrs that 
   8.172 -      * are mapped to not previously released addresses). we free pages
   8.173 -      * that were allocated by get_free_page (the mappings are different 
   8.174 -      * now, of course).
   8.175 -      */
   8.176 -    curr = parray;
   8.177 -    for ( i = 0; i < num_installed; i++ )
   8.178 -    {
   8.179 -        free_page(*curr);
   8.180 -        curr++;
   8.181 -    }
   8.182 -
   8.183 -    return num_installed;
   8.184 -}
   8.185 -
   8.186 -unsigned long deflate_balloon(unsigned long num_pages)
   8.187 -{
   8.188 -    dom_mem_op_t dom_mem_op;
   8.189 -    unsigned long ret;
   8.190 -    unsigned long * parray;
   8.191 -
   8.192 -    printk(KERN_ALERT "bd240 debug: deflate balloon called for %lx pages\n", num_pages);
   8.193 -
   8.194 -    if ( num_pages > credit )
   8.195 -    {
   8.196 -        printk("Can not allocate more pages than previously released.\n");
   8.197 -        return -EAGAIN;
   8.198 -    }
   8.199 -
   8.200 -    parray = (unsigned long *)kmalloc(num_pages * sizeof(unsigned long), 
   8.201 -                                      GFP_KERNEL);
   8.202 -
   8.203 -    dom_mem_op.op = BALLOON_DEFLATE_OP;
   8.204 -    dom_mem_op.u.balloon_deflate.size = num_pages;
   8.205 -    dom_mem_op.u.balloon_deflate.pages = parray;
   8.206 -    if((ret = HYPERVISOR_dom_mem_op(&dom_mem_op)) != num_pages){
   8.207 -        printk("Unable to deflate balloon, error %lx\n", ret);
   8.208 -        goto cleanup;
   8.209 -    }
   8.210 -
   8.211 -    if((ret = process_new_pages(parray, num_pages)) < num_pages){
   8.212 -        printk("Unable to deflate balloon by specified %lx pages, only %lx.\n",
   8.213 -               num_pages, ret);
   8.214 -        goto cleanup;
   8.215 -    }
   8.216 -
   8.217 -    ret = num_pages;
   8.218 -    credit -= num_pages;
   8.219 -
   8.220 - cleanup:
   8.221 -    kfree(parray);
   8.222 -
   8.223 -    return ret;
   8.224 -}
   8.225 -
   8.226 -static int balloon_write(struct file *file, const char *buffer,
   8.227 -                         u_long count, void *data)
   8.228 -{
   8.229 -    user_balloon_op_t bop;
   8.230 -
   8.231 -    /* Only admin can play with the balloon :) */
   8.232 -    if ( !capable(CAP_SYS_ADMIN) )
   8.233 -        return -EPERM;
   8.234 -
   8.235 -    if ( copy_from_user(&bop, buffer, sizeof(bop)) )
   8.236 -        return -EFAULT;
   8.237 -
   8.238 -    switch ( bop.op )
   8.239 -    {
   8.240 -    case USER_INFLATE_BALLOON:
   8.241 -        if ( inflate_balloon(bop.size) < bop.size )
   8.242 -            return -EAGAIN;
   8.243 -        break;
   8.244 -        
   8.245 -    case USER_DEFLATE_BALLOON:
   8.246 -        deflate_balloon(bop.size);
   8.247 -        break;
   8.248 -
   8.249 -    default:
   8.250 -        printk("Unknown command to balloon driver.");
   8.251 -        return -EFAULT;
   8.252 -    }
   8.253 -
   8.254 -    return sizeof(bop);
   8.255 -}
   8.256 -
   8.257 -/*
   8.258 - * main balloon driver initialization function.
   8.259 - */
   8.260 -static int __init init_module(void)
   8.261 -{
   8.262 -    printk(KERN_ALERT "Starting Xeno Balloon driver\n");
   8.263 -
   8.264 -    credit = 0;
   8.265 -
   8.266 -    balloon_pde = create_proc_entry(BALLOON_ENTRY, 0600, xeno_base);
   8.267 -    if ( balloon_pde == NULL )
   8.268 -    {
   8.269 -        printk(KERN_ALERT "Unable to create balloon driver proc entry!");
   8.270 -        return -1;
   8.271 -    }
   8.272 -
   8.273 -    balloon_pde->write_proc = balloon_write;
   8.274 -
   8.275 -    return 0;
   8.276 -}
   8.277 -
   8.278 -static void __exit cleanup_module(void)
   8.279 -{
   8.280 -}
   8.281 -
   8.282 -module_init(init_module);
   8.283 -module_exit(cleanup_module);
   8.284 -
   8.285 -
     9.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h	Tue Jun 24 12:05:12 2003 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,32 +0,0 @@
     9.4 -/******************************************************************************
     9.5 - * dom_mem_ops.h
     9.6 - *
     9.7 - * Header file supporting domain related memory operations. N.B. keep in sync
     9.8 - * with xen version. 
     9.9 - *
    9.10 - * Copyright (c) 2003, B Dragovic
    9.11 - */
    9.12 -
    9.13 -#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)
    9.14 -#define BALLOON_DEFLATE_OP   0
    9.15 -#define BALLOON_INFLATE_OP   1
    9.16 -
    9.17 -typedef struct balloon_deflate_op {
    9.18 -    unsigned long   size;
    9.19 -    unsigned long   * pages;
    9.20 -} balloon_def_op_t;
    9.21 -
    9.22 -typedef struct balloon_inflate_op {
    9.23 -    unsigned long   size;
    9.24 -    unsigned long   * pages;
    9.25 -} balloon_inf_op_t;
    9.26 -
    9.27 -typedef struct dom_mem_ops
    9.28 -{
    9.29 -    unsigned int op;
    9.30 -    union
    9.31 -    {
    9.32 -        balloon_def_op_t balloon_deflate;
    9.33 -        balloon_inf_op_t balloon_inflate;
    9.34 -    }u;
    9.35 -} dom_mem_op_t;
    10.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/Makefile	Tue Jun 24 12:05:12 2003 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,3 +0,0 @@
    10.4 -O_TARGET := blk.o
    10.5 -obj-y := xl_block.o xl_ide.o xl_scsi.o xl_segment.o xl_segment_proc.o
    10.6 -include $(TOPDIR)/Rules.make
    11.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.c	Tue Jun 24 12:05:12 2003 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,589 +0,0 @@
    11.4 -/******************************************************************************
    11.5 - * xl_block.c
    11.6 - * 
    11.7 - * Xenolinux virtual block-device driver.
    11.8 - * 
    11.9 - */
   11.10 -
   11.11 -#include "xl_block.h"
   11.12 -#include <linux/blk.h>
   11.13 -#include <linux/cdrom.h>
   11.14 -
   11.15 -typedef unsigned char byte; /* from linux/ide.h */
   11.16 -
   11.17 -#define XLBLK_RESPONSE_IRQ _EVENT_BLK_RESP
   11.18 -#define DEBUG_IRQ          _EVENT_DEBUG 
   11.19 -
   11.20 -static blk_ring_t *blk_ring;
   11.21 -static unsigned int resp_cons; /* Response consumer for comms ring. */
   11.22 -static unsigned int req_prod;  /* Private request producer.         */
   11.23 -static xen_disk_info_t xlblk_disk_info;
   11.24 -static int xlblk_control_msg_pending;
   11.25 -
   11.26 -#define RING_FULL (BLK_RING_INC(req_prod) == resp_cons)
   11.27 -
   11.28 -/*
   11.29 - * Request queues with outstanding work, but ring is currently full.
   11.30 - * We need no special lock here, as we always access this with the
   11.31 - * io_request_lock held. We only need a small maximum list.
   11.32 - */
   11.33 -#define MAX_PENDING 8
   11.34 -static request_queue_t *pending_queues[MAX_PENDING];
   11.35 -static int nr_pending;
   11.36 -
   11.37 -static kdev_t        sg_dev;
   11.38 -static int           sg_operation = -1;
   11.39 -static unsigned long sg_next_sect;
   11.40 -#define DISABLE_SCATTERGATHER() (sg_operation = -1)
   11.41 -
   11.42 -static inline void signal_requests_to_xen(void)
   11.43 -{
   11.44 -    DISABLE_SCATTERGATHER();
   11.45 -    blk_ring->req_prod = req_prod;
   11.46 -    HYPERVISOR_block_io_op();
   11.47 -}
   11.48 -
   11.49 -/* Convert from a XenoLinux major device to the Xen-level 'physical' device */
   11.50 -inline unsigned short xldev_to_physdev(kdev_t xldev) 
   11.51 -{
   11.52 -    unsigned short physdev = 0;
   11.53 -
   11.54 -    switch ( MAJOR(xldev) ) 
   11.55 -    { 
   11.56 -    case XLIDE_MAJOR_0: 
   11.57 -        physdev = XENDEV_IDE + (0*XLIDE_DEVS_PER_MAJOR) +
   11.58 -            (MINOR(xldev) >> XLIDE_PARTN_SHIFT);
   11.59 -	break; 
   11.60 -
   11.61 -    case XLIDE_MAJOR_1:
   11.62 -	physdev = XENDEV_IDE + (1*XLIDE_DEVS_PER_MAJOR) +
   11.63 -            (MINOR(xldev) >> XLIDE_PARTN_SHIFT);
   11.64 -        break;
   11.65 -
   11.66 -    case XLSCSI_MAJOR: 
   11.67 -        physdev = XENDEV_SCSI + (MINOR(xldev) >> XLSCSI_PARTN_SHIFT);
   11.68 -	break; 
   11.69 -
   11.70 -    case XLVIRT_MAJOR:
   11.71 -        physdev = XENDEV_VIRTUAL + (MINOR(xldev) >> XLVIRT_PARTN_SHIFT);
   11.72 -        break;
   11.73 -    } 
   11.74 -
   11.75 -    if ( physdev == 0 ) BUG();
   11.76 -
   11.77 -    return physdev;
   11.78 -}
   11.79 -
   11.80 -
   11.81 -static inline struct gendisk *xldev_to_gendisk(kdev_t xldev) 
   11.82 -{
   11.83 -    struct gendisk *gd = NULL;
   11.84 -
   11.85 -    switch ( MAJOR(xldev) ) 
   11.86 -    { 
   11.87 -    case XLIDE_MAJOR_0: 
   11.88 -        gd = xlide_gendisk[0];
   11.89 -	break; 
   11.90 -	
   11.91 -    case XLIDE_MAJOR_1: 
   11.92 -        gd = xlide_gendisk[1];
   11.93 -	break; 
   11.94 -	
   11.95 -    case XLSCSI_MAJOR: 
   11.96 -        gd = xlscsi_gendisk;
   11.97 -	break; 
   11.98 -
   11.99 -    case XLVIRT_MAJOR:
  11.100 -        gd = xlsegment_gendisk;
  11.101 -        break;
  11.102 -    }
  11.103 -
  11.104 -    if ( gd == NULL ) BUG();
  11.105 -
  11.106 -    return gd;
  11.107 -}
  11.108 -
  11.109 -
  11.110 -static inline xl_disk_t *xldev_to_xldisk(kdev_t xldev)
  11.111 -{
  11.112 -    struct gendisk *gd = xldev_to_gendisk(xldev);
  11.113 -    return (xl_disk_t *)gd->real_devices + 
  11.114 -        (MINOR(xldev) >> PARTN_SHIFT(xldev));
  11.115 -}
  11.116 -
  11.117 -
  11.118 -int xenolinux_block_open(struct inode *inode, struct file *filep)
  11.119 -{
  11.120 -    xl_disk_t *disk = xldev_to_xldisk(inode->i_rdev);
  11.121 -    disk->usage++;
  11.122 -    DPRINTK("xenolinux_block_open\n");
  11.123 -    return 0;
  11.124 -}
  11.125 -
  11.126 -
  11.127 -int xenolinux_block_release(struct inode *inode, struct file *filep)
  11.128 -{
  11.129 -    xl_disk_t *disk = xldev_to_xldisk(inode->i_rdev);
  11.130 -    disk->usage--;
  11.131 -    DPRINTK("xenolinux_block_release\n");
  11.132 -    return 0;
  11.133 -}
  11.134 -
  11.135 -/*
  11.136 - * handle ioctl calls
  11.137 - *
  11.138 - * individual ioctls are defined in /usr/include/linux/fs.h
  11.139 - */
  11.140 -
  11.141 -int xenolinux_block_ioctl(struct inode *inode, struct file *filep,
  11.142 -			  unsigned command, unsigned long argument)
  11.143 -{
  11.144 -    kdev_t dev = inode->i_rdev;
  11.145 -    struct hd_geometry *geo = (struct hd_geometry *)argument;
  11.146 -    struct gendisk *gd;     
  11.147 -    struct hd_struct *part; 
  11.148 -    
  11.149 -    DPRINTK("xenolinux_block_ioctl\n"); 
  11.150 -
  11.151 -    /* check permissions */
  11.152 -    if (!capable(CAP_SYS_ADMIN)) return -EPERM;
  11.153 -    if (!inode)                  return -EINVAL;
  11.154 -
  11.155 -    DPRINTK_IOCTL("command: 0x%x, argument: 0x%lx, dev: 0x%04x\n",
  11.156 -                  command, (long) argument, dev); 
  11.157 -  
  11.158 -    gd = xldev_to_gendisk(dev);
  11.159 -    part = &gd->part[MINOR(dev)]; 
  11.160 -
  11.161 -    switch ( command )
  11.162 -    {
  11.163 -    case BLKGETSIZE:
  11.164 -        DPRINTK_IOCTL("   BLKGETSIZE: %x %lx\n", BLKGETSIZE, part->nr_sects); 
  11.165 -	return put_user(part->nr_sects, (unsigned long *) argument);
  11.166 -
  11.167 -    case BLKRRPART:                               /* re-read partition table */
  11.168 -        DPRINTK_IOCTL("   BLKRRPART: %x\n", BLKRRPART); 
  11.169 -        return xenolinux_block_revalidate(dev);
  11.170 -
  11.171 -    case BLKSSZGET:
  11.172 -	switch ( MAJOR(dev) )
  11.173 -        {
  11.174 -	case XLIDE_MAJOR_0: 
  11.175 -	    DPRINTK_IOCTL("   BLKSSZGET: %x 0x%x\n", BLKSSZGET, 
  11.176 -			  xlide_hwsect(MINOR(dev)));
  11.177 -	    return xlide_hwsect(MINOR(dev)); 
  11.178 -
  11.179 -	case XLSCSI_MAJOR: 
  11.180 -	    DPRINTK_IOCTL("   BLKSSZGET: %x 0x%x\n", BLKSSZGET,
  11.181 -			  xlscsi_hwsect(MINOR(dev)));
  11.182 -	    return xlscsi_hwsect(MINOR(dev)); 
  11.183 -
  11.184 -        case XLVIRT_MAJOR:
  11.185 -	    DPRINTK_IOCTL("   BLKSSZGET: %x 0x%x\n", BLKSSZGET, 
  11.186 -			  xlsegment_hwsect(MINOR(dev)));
  11.187 -	    return xlsegment_hwsect(MINOR(dev)); 
  11.188 -
  11.189 -	default: 
  11.190 -	    printk(KERN_ALERT "BLKSSZGET ioctl() on bogus disk!\n"); 
  11.191 -            return 0;
  11.192 -	}
  11.193 -
  11.194 -    case BLKBSZGET:                                        /* get block size */
  11.195 -        DPRINTK_IOCTL("   BLKBSZGET: %x\n", BLKBSZGET);
  11.196 -        break;
  11.197 -
  11.198 -    case BLKBSZSET:                                        /* set block size */
  11.199 -        DPRINTK_IOCTL("   BLKBSZSET: %x\n", BLKBSZSET);
  11.200 -	break;
  11.201 -
  11.202 -    case BLKRASET:                                         /* set read-ahead */
  11.203 -        DPRINTK_IOCTL("   BLKRASET: %x\n", BLKRASET);
  11.204 -	break;
  11.205 -
  11.206 -    case BLKRAGET:                                         /* get read-ahead */
  11.207 -        DPRINTK_IOCTL("   BLKRAFET: %x\n", BLKRAGET);
  11.208 -	break;
  11.209 -
  11.210 -    case HDIO_GETGEO:
  11.211 -        /* note: these values are complete garbage */
  11.212 -        DPRINTK_IOCTL("   HDIO_GETGEO: %x\n", HDIO_GETGEO);
  11.213 -	if (!argument) return -EINVAL;
  11.214 -	if (put_user(0x00,  (unsigned long *) &geo->start)) return -EFAULT;
  11.215 -	if (put_user(0xff,  (byte *)&geo->heads)) return -EFAULT;
  11.216 -	if (put_user(0x3f,  (byte *)&geo->sectors)) return -EFAULT;
  11.217 -	if (put_user(0x106, (unsigned short *)&geo->cylinders)) return -EFAULT;
  11.218 -	return 0;
  11.219 -
  11.220 -    case HDIO_GETGEO_BIG: 
  11.221 -        /* note: these values are complete garbage */
  11.222 -        DPRINTK_IOCTL("   HDIO_GETGEO_BIG: %x\n", HDIO_GETGEO_BIG);
  11.223 -	if (!argument) return -EINVAL;
  11.224 -	if (put_user(0x00,  (unsigned long *) &geo->start))  return -EFAULT;
  11.225 -	if (put_user(0xff,  (byte *)&geo->heads))   return -EFAULT;
  11.226 -	if (put_user(0x3f,  (byte *)&geo->sectors)) return -EFAULT;
  11.227 -	if (put_user(0x106, (unsigned int *) &geo->cylinders)) return -EFAULT;
  11.228 -	return 0;
  11.229 -
  11.230 -    case CDROMMULTISESSION:
  11.231 -        printk("FIXME: support multisession CDs later\n");
  11.232 -        memset((struct cdrom_multisession *)argument, 0, 
  11.233 -               sizeof(struct cdrom_multisession));
  11.234 -        return 0;
  11.235 -
  11.236 -    default:
  11.237 -        printk("ioctl %08x not supported by xl_block\n", command);
  11.238 -	return -ENOSYS;
  11.239 -    }
  11.240 -    
  11.241 -    return 0;
  11.242 -}
  11.243 -
  11.244 -int xenolinux_block_check(kdev_t dev)
  11.245 -{
  11.246 -    DPRINTK("xenolinux_block_check\n");
  11.247 -    return 0;
  11.248 -}
  11.249 -
  11.250 -int xenolinux_block_revalidate(kdev_t dev)
  11.251 -{
  11.252 -    struct gendisk *gd = xldev_to_gendisk(dev);
  11.253 -    xl_disk_t *disk = xldev_to_xldisk(dev);
  11.254 -    unsigned long flags;
  11.255 -    int i, partn_shift = PARTN_SHIFT(dev);
  11.256 -    int xdev = dev & XENDEV_IDX_MASK;
  11.257 -    
  11.258 -    DPRINTK("xenolinux_block_revalidate: %d %d %d\n", 
  11.259 -	    dev, xdev, XENDEV_IDX_MASK);
  11.260 -
  11.261 -    spin_lock_irqsave(&io_request_lock, flags);
  11.262 -    if ( disk->usage > 1 )
  11.263 -    {
  11.264 -        spin_unlock_irqrestore(&io_request_lock, flags);
  11.265 -        return -EBUSY;
  11.266 -    }
  11.267 -    spin_unlock_irqrestore(&io_request_lock, flags);
  11.268 -
  11.269 -    for ( i = 0; i < (1 << partn_shift); i++ )
  11.270 -    {
  11.271 -        invalidate_device(xdev + i, 1);
  11.272 -        gd->part[xdev + i].start_sect = 0;
  11.273 -        gd->part[xdev + i].nr_sects = 0;
  11.274 -    }
  11.275 -
  11.276 -    grok_partitions(gd, MINOR(dev) >> partn_shift,
  11.277 -                    1 << partn_shift, disk->capacity);
  11.278 -
  11.279 -    return 0;
  11.280 -}
  11.281 -
  11.282 -
  11.283 -/*
  11.284 - * hypervisor_request
  11.285 - *
  11.286 - * request block io 
  11.287 - * 
  11.288 - * id: for guest use only.
  11.289 - * operation: XEN_BLOCK_{READ,WRITE,PROBE*,SEG*}
  11.290 - * buffer: buffer to read/write into. this should be a
  11.291 - *   virtual address in the guest os.
  11.292 - */
  11.293 -static int hypervisor_request(unsigned long   id,
  11.294 -                              int             operation,
  11.295 -                              char *          buffer,
  11.296 -                              unsigned long   sector_number,
  11.297 -                              unsigned short  nr_sectors,
  11.298 -                              kdev_t          device)
  11.299 -{
  11.300 -    unsigned long buffer_ma = phys_to_machine(virt_to_phys(buffer)); 
  11.301 -    kdev_t phys_device = (kdev_t) 0;
  11.302 -    struct gendisk *gd;
  11.303 -    blk_ring_req_entry_t *req;
  11.304 -    struct buffer_head *bh;
  11.305 -
  11.306 -    if ( nr_sectors >= (1<<9) ) BUG();
  11.307 -    if ( (buffer_ma & ((1<<9)-1)) != 0 ) BUG();
  11.308 -
  11.309 -    switch ( operation )
  11.310 -    {
  11.311 -    case XEN_BLOCK_SEG_CREATE:
  11.312 -    case XEN_BLOCK_SEG_DELETE:
  11.313 -    case XEN_BLOCK_PROBE_BLK:
  11.314 -    case XEN_BLOCK_PROBE_SEG:
  11.315 -        if ( RING_FULL ) return 1;
  11.316 -	phys_device = (kdev_t) 0;
  11.317 -	sector_number = 0;
  11.318 -        DISABLE_SCATTERGATHER();
  11.319 -        break;
  11.320 -
  11.321 -    case XEN_BLOCK_READ:
  11.322 -    case XEN_BLOCK_WRITE:
  11.323 -        phys_device = xldev_to_physdev(device);
  11.324 -	gd = xldev_to_gendisk(device); 
  11.325 -
  11.326 -	sector_number += gd->part[MINOR(device)].start_sect;
  11.327 -        if ( (sg_operation == operation) &&
  11.328 -             (sg_dev == phys_device) &&
  11.329 -             (sg_next_sect == sector_number) )
  11.330 -        {
  11.331 -            req = &blk_ring->ring[(req_prod-1)&(BLK_RING_SIZE-1)].req;
  11.332 -            bh = (struct buffer_head *)id;
  11.333 -            bh->b_reqnext = (struct buffer_head *)req->id;
  11.334 -            req->id = id;
  11.335 -            req->buffer_and_sects[req->nr_segments] = buffer_ma | nr_sectors;
  11.336 -            if ( ++req->nr_segments < MAX_BLK_SEGS )
  11.337 -                sg_next_sect += nr_sectors;
  11.338 -            else
  11.339 -                DISABLE_SCATTERGATHER();
  11.340 -            return 0;
  11.341 -        }
  11.342 -        else if ( RING_FULL )
  11.343 -        {
  11.344 -            return 1;
  11.345 -        }
  11.346 -        else
  11.347 -        {
  11.348 -            sg_operation = operation;
  11.349 -            sg_dev       = phys_device;
  11.350 -            sg_next_sect = sector_number + nr_sectors;
  11.351 -        }
  11.352 -        break;
  11.353 -
  11.354 -    default:
  11.355 -        panic("unknown op %d\n", operation);
  11.356 -    }
  11.357 -
  11.358 -    /* Fill out a communications ring structure. */
  11.359 -    req = &blk_ring->ring[req_prod].req;
  11.360 -    req->id            = id;
  11.361 -    req->operation     = operation;
  11.362 -    req->sector_number = sector_number;
  11.363 -    req->device        = phys_device;
  11.364 -    req->nr_segments   = 1;
  11.365 -    req->buffer_and_sects[0] = buffer_ma | nr_sectors;
  11.366 -    req_prod = BLK_RING_INC(req_prod);
  11.367 -
  11.368 -    return 0;
  11.369 -}
  11.370 -
  11.371 -
  11.372 -/*
  11.373 - * do_xlblk_request
  11.374 - *  read a block; request is in a request queue
  11.375 - */
  11.376 -void do_xlblk_request(request_queue_t *rq)
  11.377 -{
  11.378 -    struct request *req;
  11.379 -    struct buffer_head *bh, *next_bh;
  11.380 -    int rw, nsect, full, queued = 0;
  11.381 -    
  11.382 -    DPRINTK("xlblk.c::do_xlblk_request for '%s'\n", DEVICE_NAME); 
  11.383 -
  11.384 -    while ( !rq->plugged && !list_empty(&rq->queue_head))
  11.385 -    {
  11.386 -	if ( (req = blkdev_entry_next_request(&rq->queue_head)) == NULL ) 
  11.387 -	    goto out;
  11.388 -		
  11.389 -        DPRINTK("do_xlblk_request %p: cmd %i, sec %lx, (%li/%li) bh:%p\n",
  11.390 -                req, req->cmd, req->sector,
  11.391 -                req->current_nr_sectors, req->nr_sectors, req->bh);
  11.392 -
  11.393 -        rw = req->cmd;
  11.394 -        if ( rw == READA ) rw = READ;
  11.395 -        if ((rw != READ) && (rw != WRITE))
  11.396 -            panic("XenoLinux Virtual Block Device: bad cmd: %d\n", rw);
  11.397 -
  11.398 -	req->errors = 0;
  11.399 -
  11.400 -        bh = req->bh;
  11.401 -        while ( bh != NULL )
  11.402 -	{
  11.403 -            next_bh = bh->b_reqnext;
  11.404 -            bh->b_reqnext = NULL;
  11.405 -
  11.406 -            full = hypervisor_request(
  11.407 -                (unsigned long)bh,
  11.408 -                (rw == READ) ? XEN_BLOCK_READ : XEN_BLOCK_WRITE, 
  11.409 -                bh->b_data, bh->b_rsector, bh->b_size>>9, bh->b_rdev);
  11.410 -
  11.411 -            if ( full )
  11.412 -            {
  11.413 -                bh->b_reqnext = next_bh;
  11.414 -                pending_queues[nr_pending++] = rq;
  11.415 -                if ( nr_pending >= MAX_PENDING ) BUG();
  11.416 -                goto out;
  11.417 -            }
  11.418 -
  11.419 -            queued++;
  11.420 -
  11.421 -            /* Dequeue the buffer head from the request. */
  11.422 -            nsect = bh->b_size >> 9;
  11.423 -            bh = req->bh = next_bh;
  11.424 -            
  11.425 -            if ( bh != NULL )
  11.426 -            {
  11.427 -                /* There's another buffer head to do. Update the request. */
  11.428 -                req->hard_sector += nsect;
  11.429 -                req->hard_nr_sectors -= nsect;
  11.430 -                req->sector = req->hard_sector;
  11.431 -                req->nr_sectors = req->hard_nr_sectors;
  11.432 -                req->current_nr_sectors = bh->b_size >> 9;
  11.433 -                req->buffer = bh->b_data;
  11.434 -            }
  11.435 -            else
  11.436 -            {
  11.437 -                /* That was the last buffer head. Finalise the request. */
  11.438 -                if ( end_that_request_first(req, 1, "XenBlk") ) BUG();
  11.439 -                blkdev_dequeue_request(req);
  11.440 -                end_that_request_last(req);
  11.441 -            }
  11.442 -        }
  11.443 -    }
  11.444 -
  11.445 - out:
  11.446 -    if ( queued != 0 ) signal_requests_to_xen();
  11.447 -}
  11.448 -
  11.449 -
  11.450 -static void xlblk_response_int(int irq, void *dev_id, struct pt_regs *ptregs)
  11.451 -{
  11.452 -    int i; 
  11.453 -    unsigned long flags; 
  11.454 -    struct buffer_head *bh, *next_bh;
  11.455 -    
  11.456 -    spin_lock_irqsave(&io_request_lock, flags);	    
  11.457 -
  11.458 -    for ( i  = resp_cons;
  11.459 -	  i != blk_ring->resp_prod;
  11.460 -	  i  = BLK_RING_INC(i) )
  11.461 -    {
  11.462 -	blk_ring_resp_entry_t *bret = &blk_ring->ring[i].resp;
  11.463 -	switch (bret->operation)
  11.464 -	{
  11.465 -        case XEN_BLOCK_READ:
  11.466 -        case XEN_BLOCK_WRITE:
  11.467 -            if ( bret->status )
  11.468 -                printk(KERN_ALERT "Bad return from blkdev data request: %lx\n",
  11.469 -		       bret->status);
  11.470 -            for ( bh = (struct buffer_head *)bret->id; 
  11.471 -                  bh != NULL; 
  11.472 -                  bh = next_bh )
  11.473 -            {
  11.474 -                next_bh = bh->b_reqnext;
  11.475 -                bh->b_reqnext = NULL;
  11.476 -                bh->b_end_io(bh, !bret->status);
  11.477 -            }
  11.478 -	    break;
  11.479 -	    
  11.480 -        case XEN_BLOCK_SEG_CREATE:
  11.481 -        case XEN_BLOCK_SEG_DELETE:
  11.482 -        case XEN_BLOCK_PROBE_SEG:
  11.483 -        case XEN_BLOCK_PROBE_BLK:
  11.484 -            if ( bret->status )
  11.485 -                printk(KERN_ALERT "Bad return from blkdev control request\n");
  11.486 -            xlblk_control_msg_pending = 0;
  11.487 -            break;
  11.488 -	  
  11.489 -        default:
  11.490 -            BUG();
  11.491 -	}
  11.492 -    }
  11.493 -    
  11.494 -    resp_cons = i;
  11.495 -
  11.496 -    /* We kick pending request queues if the ring is reasonably empty. */
  11.497 -    if ( (nr_pending != 0) && 
  11.498 -         (((req_prod - resp_cons) & (BLK_RING_SIZE - 1)) < 
  11.499 -          (BLK_RING_SIZE >> 1)) )
  11.500 -    {
  11.501 -        /* Attempt to drain the queue, but bail if the ring becomes full. */
  11.502 -        while ( nr_pending != 0 )
  11.503 -        {
  11.504 -            do_xlblk_request(pending_queues[--nr_pending]);
  11.505 -            if ( RING_FULL ) break;
  11.506 -        }
  11.507 -    }
  11.508 -
  11.509 -    spin_unlock_irqrestore(&io_request_lock, flags);
  11.510 -}
  11.511 -
  11.512 -
  11.513 -/* Send a synchronous message to Xen. */
  11.514 -int xenolinux_control_msg(int operation, char *buffer, int size)
  11.515 -{
  11.516 -    unsigned long flags;
  11.517 -    char *aligned_buf;
  11.518 -
  11.519 -    /* We copy from an aligned buffer, as interface needs sector alignment. */
  11.520 -    aligned_buf = (char *)get_free_page(GFP_KERNEL);
  11.521 -    if ( aligned_buf == NULL ) BUG();
  11.522 -    memcpy(aligned_buf, buffer, size);
  11.523 -
  11.524 -    xlblk_control_msg_pending = 1;
  11.525 -    spin_lock_irqsave(&io_request_lock, flags);
  11.526 -    /* Note that size gets rounded up to a sector-sized boundary. */
  11.527 -    if ( hypervisor_request(0, operation, aligned_buf, 0, (size+511)/512, 0) )
  11.528 -        return -EAGAIN;
  11.529 -    signal_requests_to_xen();
  11.530 -    spin_unlock_irqrestore(&io_request_lock, flags);
  11.531 -    while ( xlblk_control_msg_pending ) barrier();
  11.532 -
  11.533 -    memcpy(buffer, aligned_buf, size);
  11.534 -    free_page((unsigned long)aligned_buf);
  11.535 -    
  11.536 -    return 0;
  11.537 -}
  11.538 -
  11.539 -
  11.540 -int __init xlblk_init(void)
  11.541 -{
  11.542 -    int error;
  11.543 -
  11.544 -    xlblk_control_msg_pending = 0;
  11.545 -    nr_pending = 0;
  11.546 -
  11.547 -    /* This mapping was created early at boot time. */
  11.548 -    blk_ring = (blk_ring_t *)fix_to_virt(FIX_BLKRING_BASE);
  11.549 -    blk_ring->req_prod = blk_ring->resp_prod = resp_cons = req_prod = 0;
  11.550 -    
  11.551 -    error = request_irq(XLBLK_RESPONSE_IRQ, xlblk_response_int, 
  11.552 -                        SA_SAMPLE_RANDOM, "xlblk-response", NULL);
  11.553 -    if ( error )
  11.554 -    {
  11.555 -	printk(KERN_ALERT "Could not allocate receive interrupt\n");
  11.556 -	goto fail;
  11.557 -    }
  11.558 -
  11.559 -    /* Probe for disk information. */
  11.560 -    memset(&xlblk_disk_info, 0, sizeof(xlblk_disk_info));
  11.561 -    error = xenolinux_control_msg(XEN_BLOCK_PROBE_BLK, 
  11.562 -                                  (char *)&xlblk_disk_info,
  11.563 -                                  sizeof(xen_disk_info_t));
  11.564 -    if ( error )
  11.565 -    {
  11.566 -        printk(KERN_ALERT "Could not probe disks (%d)\n", error);
  11.567 -        free_irq(XLBLK_RESPONSE_IRQ, NULL);
  11.568 -        goto fail;
  11.569 -    }
  11.570 -
  11.571 -    /* Pass the information to our fake IDE and SCSI susbystems. */
  11.572 -    xlide_init(&xlblk_disk_info);
  11.573 -    xlscsi_init(&xlblk_disk_info);
  11.574 -
  11.575 -    return 0;
  11.576 -
  11.577 - fail:
  11.578 -    return error;
  11.579 -}
  11.580 -
  11.581 -static void __exit xlblk_cleanup(void)
  11.582 -{
  11.583 -    xlide_cleanup();
  11.584 -    xlscsi_cleanup();
  11.585 -    free_irq(XLBLK_RESPONSE_IRQ, NULL);
  11.586 -}
  11.587 -
  11.588 -
  11.589 -#ifdef MODULE
  11.590 -module_init(xlblk_init);
  11.591 -module_exit(xlblk_cleanup);
  11.592 -#endif
    12.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.h	Tue Jun 24 12:05:12 2003 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,107 +0,0 @@
    12.4 -/******************************************************************************
    12.5 - * xl_block.h
    12.6 - * 
    12.7 - * Shared definitions between all levels of XenoLinux Virtual block devices.
    12.8 - */
    12.9 -
   12.10 -#ifndef __XL_BLOCK_H__
   12.11 -#define __XL_BLOCK_H__
   12.12 -
   12.13 -#include <linux/config.h>
   12.14 -#include <linux/module.h>
   12.15 -
   12.16 -#include <linux/kernel.h>
   12.17 -#include <linux/sched.h>
   12.18 -#include <linux/slab.h>
   12.19 -#include <linux/string.h>
   12.20 -#include <linux/errno.h>
   12.21 -
   12.22 -#include <linux/fs.h>
   12.23 -#include <linux/hdreg.h>
   12.24 -#include <linux/blkdev.h>
   12.25 -#include <linux/major.h>
   12.26 -
   12.27 -#include <asm/hypervisor-ifs/block.h>
   12.28 -#include <asm/hypervisor-ifs/hypervisor-if.h>
   12.29 -#include <asm/io.h>
   12.30 -#include <asm/atomic.h>
   12.31 -#include <asm/uaccess.h>
   12.32 -
   12.33 -#if 0
   12.34 -#define DPRINTK(_f, _a...) printk ( KERN_ALERT _f , ## _a )
   12.35 -#else
   12.36 -#define DPRINTK(_f, _a...) ((void)0)
   12.37 -#endif
   12.38 -
   12.39 -#if 0
   12.40 -#define DPRINTK_IOCTL(_f, _a...) printk ( KERN_ALERT _f , ## _a )
   12.41 -#else
   12.42 -#define DPRINTK_IOCTL(_f, _a...) ((void)0)
   12.43 -#endif
   12.44 -
   12.45 -/* XL IDE and SCSI use same major/minor numbers as normal Linux devices. */
   12.46 -#define XLIDE_MAJOR_0 IDE0_MAJOR
   12.47 -#define XLIDE_MAJOR_1 IDE1_MAJOR
   12.48 -#define XLSCSI_MAJOR SCSI_DISK0_MAJOR
   12.49 -
   12.50 -#define XLIDE_PARTN_SHIFT  6
   12.51 -#define XLSCSI_PARTN_SHIFT 4
   12.52 -#define XLVIRT_PARTN_SHIFT 4
   12.53 -
   12.54 -static inline int PARTN_SHIFT(kdev_t dev)
   12.55 -{
   12.56 -    switch ( MAJOR(dev) )
   12.57 -    {
   12.58 -    case XLIDE_MAJOR_0:
   12.59 -    case XLIDE_MAJOR_1:
   12.60 -        return XLIDE_PARTN_SHIFT;
   12.61 -    case XLSCSI_MAJOR:
   12.62 -        return XLSCSI_PARTN_SHIFT;
   12.63 -    case XLVIRT_MAJOR:
   12.64 -        return XLVIRT_PARTN_SHIFT;
   12.65 -    default:
   12.66 -        BUG();
   12.67 -    }
   12.68 -}
   12.69 -
   12.70 -#define XLIDE_DEVS_PER_MAJOR   2
   12.71 -#define XLSCSI_DEVS_PER_MAJOR 16
   12.72 -#define XLVIRT_DEVS_PER_MAJOR 16
   12.73 -
   12.74 -/*
   12.75 - * We have one of these per XL-IDE, XL-SCSI, and XL-VIRT device.
   12.76 - * They hang in an array off the gendisk structure. We may end up putting
   12.77 - * all kinds of interesting stuff here :-)
   12.78 - */
   12.79 -typedef struct xl_disk {
   12.80 -    int usage;
   12.81 -    unsigned long capacity;
   12.82 -} xl_disk_t;
   12.83 -
   12.84 -/* Generic layer. */
   12.85 -extern int xenolinux_control_msg(int operration, char *buffer, int size);
   12.86 -extern int xenolinux_block_open(struct inode *inode, struct file *filep);
   12.87 -extern int xenolinux_block_release(struct inode *inode, struct file *filep);
   12.88 -extern int xenolinux_block_ioctl(struct inode *inode, struct file *filep,
   12.89 -				 unsigned command, unsigned long argument);
   12.90 -extern int xenolinux_block_check(kdev_t dev);
   12.91 -extern int xenolinux_block_revalidate(kdev_t dev);
   12.92 -extern void do_xlblk_request (request_queue_t *rq); 
   12.93 -
   12.94 -/* Fake IDE subsystem. */
   12.95 -extern int  xlide_init(xen_disk_info_t *xdi);
   12.96 -extern int  xlide_hwsect(int minor); 
   12.97 -extern void xlide_cleanup(void); 
   12.98 -extern struct gendisk *xlide_gendisk[];
   12.99 -
  12.100 -/* Fake SCSI subsystem. */
  12.101 -extern int  xlscsi_init(xen_disk_info_t *xdi);
  12.102 -extern int  xlscsi_hwsect(int minor); 
  12.103 -extern void xlscsi_cleanup(void); 
  12.104 -extern struct gendisk *xlscsi_gendisk;
  12.105 -
  12.106 -/* Virtual block-device subsystem. */
  12.107 -extern int  xlsegment_hwsect(int minor); 
  12.108 -extern struct gendisk *xlsegment_gendisk;
  12.109 -
  12.110 -#endif /* __XL_BLOCK_H__ */
    13.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_ide.c	Tue Jun 24 12:05:12 2003 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,204 +0,0 @@
    13.4 -/******************************************************************************
    13.5 - * xl_ide.c
    13.6 - * 
    13.7 - * Xenolinux virtual IDE block-device driver.
    13.8 - */
    13.9 -
   13.10 -#include "xl_block.h"
   13.11 -#include <linux/blk.h>
   13.12 -
   13.13 -#define XLIDE_MAX         256
   13.14 -#define XLIDE_MAJOR_NAME "hd"
   13.15 -static int xlide_blksize_size[XLIDE_MAX];
   13.16 -static int xlide_hardsect_size[XLIDE_MAX];
   13.17 -static int xlide_max_sectors[XLIDE_MAX];
   13.18 -
   13.19 -#define XLIDE_NR_MAJORS     2
   13.20 -
   13.21 -struct gendisk *xlide_gendisk[XLIDE_NR_MAJORS] = { NULL };
   13.22 -
   13.23 -static struct block_device_operations xlide_block_fops = 
   13.24 -{
   13.25 -    open:               xenolinux_block_open,
   13.26 -    release:            xenolinux_block_release,
   13.27 -    ioctl:              xenolinux_block_ioctl,
   13.28 -    check_media_change: xenolinux_block_check,
   13.29 -    revalidate:         xenolinux_block_revalidate,
   13.30 -};
   13.31 -
   13.32 -int xlide_hwsect(int minor) 
   13.33 -{
   13.34 -    return xlide_hardsect_size[minor]; 
   13.35 -} 
   13.36 -
   13.37 -static int get_major(int major)
   13.38 -{
   13.39 -    int r = register_blkdev(major, XLIDE_MAJOR_NAME, &xlide_block_fops);
   13.40 -    if ( r < 0 )
   13.41 -        printk (KERN_ALERT "XL IDE: can't get major %d\n", XLIDE_MAJOR_0);
   13.42 -    return r;
   13.43 -}
   13.44 -
   13.45 -static void setup_major(struct gendisk **pgd, 
   13.46 -                        xen_disk_info_t *xdi, int base, int major)
   13.47 -{
   13.48 -    int i, minors, disk, units = XLIDE_DEVS_PER_MAJOR;
   13.49 -    unsigned short minor; 
   13.50 -    unsigned char buf[64];
   13.51 -    struct gendisk *gd;
   13.52 -
   13.53 -    blk_size[major]      = NULL;
   13.54 -    blksize_size[major]  = xlide_blksize_size + base*(1<<XLIDE_PARTN_SHIFT);
   13.55 -    hardsect_size[major] = xlide_hardsect_size + base*(1<<XLIDE_PARTN_SHIFT);
   13.56 -    max_sectors[major]   = xlide_max_sectors + base*(1<<XLIDE_PARTN_SHIFT);
   13.57 -    read_ahead[major]    = 8;
   13.58 -
   13.59 -    blk_init_queue(BLK_DEFAULT_QUEUE(major), do_xlblk_request);
   13.60 -
   13.61 -    /*
   13.62 -     * Turn off barking 'headactive' mode. We dequeue buffer heads as soon as 
   13.63 -     * we pass them down to Xen.
   13.64 -     */
   13.65 -    blk_queue_headactive(BLK_DEFAULT_QUEUE(major), 0);
   13.66 -
   13.67 -    /* Construct an appropriate gendisk structure. */
   13.68 -    minors    = units * (1<<XLIDE_PARTN_SHIFT);
   13.69 -    gd        = kmalloc(sizeof(struct gendisk), GFP_KERNEL);
   13.70 -    gd->sizes = kmalloc(minors * sizeof(int), GFP_KERNEL);
   13.71 -    gd->part  = kmalloc(minors * sizeof(struct hd_struct), GFP_KERNEL);
   13.72 -    gd->major        = major;
   13.73 -    gd->major_name   = XLIDE_MAJOR_NAME;
   13.74 -    gd->minor_shift  = XLIDE_PARTN_SHIFT; 
   13.75 -    gd->max_p	     = 1<<XLIDE_PARTN_SHIFT;
   13.76 -    gd->nr_real	     = units;           
   13.77 -    gd->real_devices = kmalloc(units * sizeof(xl_disk_t), GFP_KERNEL);
   13.78 -    gd->next	     = NULL;            
   13.79 -    gd->fops         = &xlide_block_fops;
   13.80 -    gd->de_arr       = kmalloc(sizeof(*gd->de_arr) * units, GFP_KERNEL);
   13.81 -    gd->flags	     = kmalloc(sizeof(*gd->flags) * units, GFP_KERNEL);
   13.82 -    memset(gd->sizes, 0, minors * sizeof(int));
   13.83 -    memset(gd->part,  0, minors * sizeof(struct hd_struct));
   13.84 -    memset(gd->de_arr, 0, sizeof(*gd->de_arr) * units);
   13.85 -    memset(gd->flags, 0, sizeof(*gd->flags) * units);
   13.86 -    memset(gd->real_devices, 0, sizeof(xl_disk_t) * units);
   13.87 -    *pgd = gd;
   13.88 -    add_gendisk(gd);
   13.89 -    
   13.90 -    /* Now register each disk in turn. */
   13.91 -    for ( i = 0; i < xdi->count; i++ )
   13.92 -    {
   13.93 -        disk  = xdi->disks[i].device & XENDEV_IDX_MASK;
   13.94 -        minor = (disk-base) << XLIDE_PARTN_SHIFT; 
   13.95 -
   13.96 -        if ( !IS_IDE_XENDEV(xdi->disks[i].device) ||
   13.97 -             (disk < base) || (disk >= (base + XLIDE_DEVS_PER_MAJOR)) ) 
   13.98 -            continue;
   13.99 -
  13.100 -        ((xl_disk_t *)gd->real_devices)[disk].capacity =
  13.101 -            xdi->disks[i].capacity;
  13.102 -
  13.103 -        switch (xdi->disks[i].type) 
  13.104 -        { 
  13.105 -        case XD_TYPE_CDROM:
  13.106 -            set_device_ro(MKDEV(major, minor), 1); 
  13.107 -
  13.108 -        case XD_TYPE_FLOPPY: 
  13.109 -        case XD_TYPE_TAPE:
  13.110 -            gd->flags[disk] = GENHD_FL_REMOVABLE; 
  13.111 -            printk(KERN_ALERT "Skipping partition check on %s /dev/%s\n", 
  13.112 -                   xdi->disks[i].type==XD_TYPE_CDROM ? "cdrom" : 
  13.113 -                   (xdi->disks[i].type==XD_TYPE_TAPE ? "tape" : "floppy"), 
  13.114 -                   disk_name(gd, minor, buf)); 
  13.115 -            break; 
  13.116 -
  13.117 -        case XD_TYPE_DISK: 
  13.118 -            register_disk(gd, 
  13.119 -                          MKDEV(major, minor), 
  13.120 -                          1<<XLIDE_PARTN_SHIFT, 
  13.121 -                          &xlide_block_fops, xdi->disks[i].capacity);
  13.122 -            break; 
  13.123 -
  13.124 -        default: 
  13.125 -            printk(KERN_ALERT "XenoLinux: unknown ide device type %d\n", 
  13.126 -                   xdi->disks[i].type); 
  13.127 -            break; 
  13.128 -        }
  13.129 -    }
  13.130 -
  13.131 -    return gd;
  13.132 -}
  13.133 -
  13.134 -
  13.135 -int xlide_init(xen_disk_info_t *xdi) 
  13.136 -{
  13.137 -    int i, units;
  13.138 -
  13.139 -    /* If we don't have any usable IDE devices we may as well bail now. */
  13.140 -    units = 0;
  13.141 -    for ( i = 0; i < xdi->count; i++ )
  13.142 -        if ( IS_IDE_XENDEV(xdi->disks[i].device) &&
  13.143 -             ((xdi->disks[i].device & XENDEV_IDX_MASK) <
  13.144 -              (XLIDE_NR_MAJORS*XLIDE_DEVS_PER_MAJOR)) ) 
  13.145 -            units++;
  13.146 -    if ( units == 0 ) return 0;
  13.147 -
  13.148 -    SET_MODULE_OWNER(&xlide_block_fops);
  13.149 -    
  13.150 -    if ( get_major(XLIDE_MAJOR_0) < 0 )
  13.151 -        return 0;
  13.152 -    if ( get_major(XLIDE_MAJOR_1) < 0 )
  13.153 -    {
  13.154 -        (void)unregister_blkdev(XLIDE_MAJOR_0, XLIDE_MAJOR_NAME);
  13.155 -        return 0;
  13.156 -    }
  13.157 -
  13.158 -    /* Initialize global arrays. */
  13.159 -    for ( i = 0; i < XLIDE_MAX; i++ )
  13.160 -    {
  13.161 -        xlide_blksize_size[i]  = 512;
  13.162 -        xlide_hardsect_size[i] = 512;
  13.163 -        xlide_max_sectors[i]   = 128;
  13.164 -    }
  13.165 -
  13.166 -    setup_major(&xlide_gendisk[0], xdi, 0*XLIDE_DEVS_PER_MAJOR, XLIDE_MAJOR_0);
  13.167 -    setup_major(&xlide_gendisk[1], xdi, 1*XLIDE_DEVS_PER_MAJOR, XLIDE_MAJOR_1);
  13.168 -
  13.169 -    return 0;
  13.170 -}
  13.171 -
  13.172 -
  13.173 -static void cleanup_major(int major)
  13.174 -{
  13.175 -    blk_cleanup_queue(BLK_DEFAULT_QUEUE(major));
  13.176 -
  13.177 -    read_ahead[major] = 0;
  13.178 -
  13.179 -    if ( blksize_size[major] != NULL )
  13.180 -    { 
  13.181 -	kfree(blksize_size[major]);
  13.182 -        blksize_size[major] = NULL;
  13.183 -    }
  13.184 -
  13.185 -    if ( hardsect_size[major] != NULL )
  13.186 -    { 
  13.187 -	kfree(hardsect_size[major]);
  13.188 -        hardsect_size[major] = NULL;
  13.189 -    }
  13.190 -    
  13.191 -    if ( max_sectors[major] != NULL )
  13.192 -    { 
  13.193 -	kfree(max_sectors[major]);
  13.194 -        max_sectors[major] = NULL;
  13.195 -    }
  13.196 -    
  13.197 -    (void)unregister_blkdev(major, XLIDE_MAJOR_NAME);
  13.198 -}
  13.199 -
  13.200 -void xlide_cleanup(void)
  13.201 -{
  13.202 -    if ( xlide_gendisk[0] == NULL ) return;
  13.203 -    xlide_gendisk[0] = NULL;
  13.204 -    cleanup_major(XLIDE_MAJOR_0);
  13.205 -    cleanup_major(XLIDE_MAJOR_1);
  13.206 -}
  13.207 -
    14.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_scsi.c	Tue Jun 24 12:05:12 2003 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,168 +0,0 @@
    14.4 -/******************************************************************************
    14.5 - * xl_scsi.c
    14.6 - * 
    14.7 - * Xenolinux virtual SCSI block-device driver.
    14.8 - */
    14.9 -
   14.10 -#include "xl_block.h"
   14.11 -
   14.12 -#define MAJOR_NR XLSCSI_MAJOR
   14.13 -#include <linux/blk.h>
   14.14 -
   14.15 -#define XLSCSI_MAX        256
   14.16 -#define XLSCSI_MAJOR_NAME "sd"
   14.17 -static int xlscsi_blksize_size[XLSCSI_MAX];
   14.18 -static int xlscsi_hardsect_size[XLSCSI_MAX];
   14.19 -static int xlscsi_max_sectors[XLSCSI_MAX];
   14.20 -
   14.21 -struct gendisk *xlscsi_gendisk = NULL;
   14.22 -
   14.23 -static struct block_device_operations xlscsi_block_fops = 
   14.24 -{
   14.25 -    open:               xenolinux_block_open,
   14.26 -    release:            xenolinux_block_release,
   14.27 -    ioctl:              xenolinux_block_ioctl,
   14.28 -    check_media_change: xenolinux_block_check,
   14.29 -    revalidate:         xenolinux_block_revalidate,
   14.30 -};
   14.31 -
   14.32 -
   14.33 -/* tiny inteface fn */
   14.34 -int xlscsi_hwsect(int minor) 
   14.35 -{
   14.36 -    return xlscsi_hardsect_size[minor]; 
   14.37 -} 
   14.38 -
   14.39 -
   14.40 -int xlscsi_init(xen_disk_info_t *xdi) 
   14.41 -{
   14.42 -    int i, result, units, minors, disk;
   14.43 -    struct gendisk *gd;
   14.44 -
   14.45 -    /* If we don't have any usable SCSI devices we may as well bail now. */
   14.46 -    units = 0;
   14.47 -    for ( i = 0; i < xdi->count; i++ )
   14.48 -        if ( IS_SCSI_XENDEV(xdi->disks[i].device) &&
   14.49 -             ((xdi->disks[i].device & XENDEV_IDX_MASK) <
   14.50 -              XLSCSI_DEVS_PER_MAJOR) ) 
   14.51 -            units++;
   14.52 -    if ( units == 0 ) return 0;
   14.53 -
   14.54 -    SET_MODULE_OWNER(&xlscsi_block_fops);
   14.55 -
   14.56 -    result = register_blkdev(XLSCSI_MAJOR, XLSCSI_MAJOR_NAME, 
   14.57 -                             &xlscsi_block_fops);
   14.58 -    if ( result < 0 )
   14.59 -    {
   14.60 -	printk (KERN_ALERT "XL SCSI: can't get major %d\n", XLSCSI_MAJOR);
   14.61 -	return result;
   14.62 -    }
   14.63 -
   14.64 -    /* Initialize global arrays. */
   14.65 -    for ( i = 0; i < XLSCSI_MAX; i++ )
   14.66 -    {
   14.67 -	xlscsi_blksize_size[i]  = 1024; //XXX 512;
   14.68 -	xlscsi_hardsect_size[i] = 512;
   14.69 -	xlscsi_max_sectors[i]   = 128*8; //XXX 128
   14.70 -    }
   14.71 -
   14.72 -    blk_size[XLSCSI_MAJOR]      = NULL;
   14.73 -    blksize_size[XLSCSI_MAJOR]  = xlscsi_blksize_size;
   14.74 -    hardsect_size[XLSCSI_MAJOR] = xlscsi_hardsect_size;
   14.75 -    max_sectors[XLSCSI_MAJOR]   = xlscsi_max_sectors;
   14.76 -    read_ahead[XLSCSI_MAJOR]    = NULL; //XXX8;
   14.77 -
   14.78 -    blk_init_queue(BLK_DEFAULT_QUEUE(XLSCSI_MAJOR), do_xlblk_request);
   14.79 -
   14.80 -    /*
   14.81 -     * Turn off barking 'headactive' mode. We dequeue buffer heads as
   14.82 -     * soon as we pass them down to Xen.
   14.83 -     */
   14.84 -    blk_queue_headactive(BLK_DEFAULT_QUEUE(XLSCSI_MAJOR), 0);
   14.85 -
   14.86 -    units = XLSCSI_MAX >> XLSCSI_PARTN_SHIFT;
   14.87 -
   14.88 -    /* Construct an appropriate gendisk structure. */
   14.89 -    minors    = units * (1<<XLSCSI_PARTN_SHIFT);
   14.90 -    gd        = kmalloc(sizeof(struct gendisk), GFP_KERNEL);
   14.91 -    gd->sizes = kmalloc(minors * sizeof(int), GFP_KERNEL);
   14.92 -    gd->part  = kmalloc(minors * sizeof(struct hd_struct), GFP_KERNEL);
   14.93 -    gd->major        = XLSCSI_MAJOR;
   14.94 -    gd->major_name   = XLSCSI_MAJOR_NAME;
   14.95 -    gd->minor_shift  = XLSCSI_PARTN_SHIFT; 
   14.96 -    gd->max_p	     = 1<<XLSCSI_PARTN_SHIFT;
   14.97 -    gd->nr_real	     = units;           
   14.98 -    gd->real_devices = kmalloc(units * sizeof(xl_disk_t), GFP_KERNEL);
   14.99 -    gd->next	     = NULL;            
  14.100 -    gd->fops         = &xlscsi_block_fops;
  14.101 -    gd->de_arr       = kmalloc(sizeof(*gd->de_arr) * units, GFP_KERNEL);
  14.102 -    gd->flags	     = kmalloc(sizeof(*gd->flags) * units, GFP_KERNEL);
  14.103 -    memset(gd->sizes, 0, minors * sizeof(int));
  14.104 -    memset(gd->part,  0, minors * sizeof(struct hd_struct));
  14.105 -    memset(gd->de_arr, 0, sizeof(*gd->de_arr) * units);
  14.106 -    memset(gd->flags, 0, sizeof(*gd->flags) * units);
  14.107 -    memset(gd->real_devices, 0, sizeof(xl_disk_t) * units);
  14.108 -    xlscsi_gendisk = gd;
  14.109 -    add_gendisk(gd);
  14.110 -
  14.111 -    /* Now register each disk in turn. */
  14.112 -    for ( i = 0; i < xdi->count; i++ )
  14.113 -    {
  14.114 -        disk = xdi->disks[i].device & XENDEV_IDX_MASK;
  14.115 -
  14.116 -        if ( !IS_SCSI_XENDEV(xdi->disks[i].device) || 
  14.117 -             (disk >= XLSCSI_DEVS_PER_MAJOR) )
  14.118 -            continue;
  14.119 -
  14.120 -        ((xl_disk_t *)gd->real_devices)[disk].capacity =
  14.121 -            xdi->disks[i].capacity;
  14.122 -        register_disk(gd,
  14.123 -                      MKDEV(XLSCSI_MAJOR, disk<<XLSCSI_PARTN_SHIFT), 
  14.124 -                      1<<XLSCSI_PARTN_SHIFT, 
  14.125 -                      &xlscsi_block_fops, 
  14.126 -                      xdi->disks[i].capacity);
  14.127 -    }
  14.128 -   
  14.129 -    printk(KERN_ALERT 
  14.130 -	   "XenoLinux Virtual SCSI Device Driver installed [device: %d]\n",
  14.131 -	   XLSCSI_MAJOR);
  14.132 -
  14.133 -    return 0;
  14.134 -}
  14.135 -
  14.136 -
  14.137 -void xlscsi_cleanup(void)
  14.138 -{
  14.139 -    if ( xlscsi_gendisk == NULL ) return;
  14.140 -
  14.141 -    blk_cleanup_queue(BLK_DEFAULT_QUEUE(XLSCSI_MAJOR));
  14.142 -
  14.143 -    xlscsi_gendisk = NULL;
  14.144 -
  14.145 -    read_ahead[XLSCSI_MAJOR] = 0;
  14.146 -
  14.147 -    if ( blksize_size[XLSCSI_MAJOR] != NULL )
  14.148 -    { 
  14.149 -	kfree(blksize_size[XLSCSI_MAJOR]);
  14.150 -        blksize_size[XLSCSI_MAJOR] = NULL;
  14.151 -    }
  14.152 -
  14.153 -    if ( hardsect_size[XLSCSI_MAJOR] != NULL )
  14.154 -    { 
  14.155 -	kfree(hardsect_size[XLSCSI_MAJOR]);
  14.156 -        hardsect_size[XLSCSI_MAJOR] = NULL;
  14.157 -    }
  14.158 -    
  14.159 -    if ( max_sectors[XLSCSI_MAJOR] != NULL )
  14.160 -    { 
  14.161 -	kfree(max_sectors[XLSCSI_MAJOR]);
  14.162 -        max_sectors[XLSCSI_MAJOR] = NULL;
  14.163 -    }
  14.164 -    
  14.165 -    if ( unregister_blkdev(XLSCSI_MAJOR, XLSCSI_MAJOR_NAME) != 0 )
  14.166 -    {
  14.167 -	printk(KERN_ALERT
  14.168 -	       "XenoLinux Virtual SCSI Device Driver uninstalled w/ errs\n");
  14.169 -    }
  14.170 -}
  14.171 -
    15.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment.c	Tue Jun 24 12:05:12 2003 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,182 +0,0 @@
    15.4 -/******************************************************************************
    15.5 - * xl_segment.c
    15.6 - * 
    15.7 - * Xenolinux virtual block-device driver (xvd).
    15.8 - * 
    15.9 - */
   15.10 -
   15.11 -#include "xl_block.h"
   15.12 -
   15.13 -#define MAJOR_NR XLVIRT_MAJOR
   15.14 -#include <linux/blk.h>
   15.15 -
   15.16 -/* Copied from linux/ide.h */
   15.17 -typedef unsigned char byte; 
   15.18 -
   15.19 -#define XLVIRT_MAX        256
   15.20 -#define XLVIRT_MAJOR_NAME "xvd"
   15.21 -static int xlseg_blksize_size[XLVIRT_MAX];
   15.22 -static int xlseg_hardsect_size[XLVIRT_MAX];
   15.23 -static int xlseg_max_sectors[XLVIRT_MAX];
   15.24 -
   15.25 -struct gendisk *xlsegment_gendisk = NULL;
   15.26 -
   15.27 -static xen_disk_info_t xlseg_disk_info;
   15.28 -
   15.29 -static struct block_device_operations xlsegment_block_fops = 
   15.30 -{
   15.31 -    open:               xenolinux_block_open,
   15.32 -    release:            xenolinux_block_release,
   15.33 -    ioctl:              xenolinux_block_ioctl,
   15.34 -    check_media_change: xenolinux_block_check,
   15.35 -    revalidate:         xenolinux_block_revalidate,
   15.36 -};
   15.37 -
   15.38 -
   15.39 -int xlsegment_hwsect(int minor) 
   15.40 -{
   15.41 -    return xlseg_hardsect_size[minor]; 
   15.42 -} 
   15.43 -
   15.44 -
   15.45 -int __init xlseg_init(void)
   15.46 -{
   15.47 -    int i, result, units, minors, disk;
   15.48 -    xen_disk_info_t *xdi = &xlseg_disk_info;
   15.49 -    struct gendisk *gd;
   15.50 -
   15.51 -    SET_MODULE_OWNER(&xlsegment_block_fops);
   15.52 -
   15.53 -    /* Probe for disk information. */
   15.54 -    memset(xdi, 0, sizeof(*xdi));
   15.55 -    xenolinux_control_msg(XEN_BLOCK_PROBE_SEG, (char *)xdi, sizeof(*xdi));
   15.56 -
   15.57 -    DPRINTK("xvd block device probe:\n");
   15.58 -    for ( i = 0; i < xdi->count; i++ )
   15.59 -    { 
   15.60 -	DPRINTK("  %2d: device: %d, capacity: %ld\n",
   15.61 -		i, xdi->disks[i].device, xdi->disks[i].capacity);
   15.62 -    }
   15.63 -
   15.64 -    result = register_blkdev(XLVIRT_MAJOR, XLVIRT_MAJOR_NAME,
   15.65 -                             &xlsegment_block_fops);
   15.66 -    if ( result < 0 )
   15.67 -    {
   15.68 -	printk(KERN_ALERT "XL Segment: can't get major %d\n", XLVIRT_MAJOR);
   15.69 -	return result;
   15.70 -    }
   15.71 -
   15.72 -    /* Initialize global arrays. */
   15.73 -    for (i = 0; i < XLVIRT_MAX; i++) 
   15.74 -    {
   15.75 -        xlseg_blksize_size[i]  = 512;
   15.76 -        xlseg_hardsect_size[i] = 512;
   15.77 -        xlseg_max_sectors[i]   = 128;
   15.78 -    }
   15.79 -
   15.80 -    blk_size[XLVIRT_MAJOR]      = NULL;
   15.81 -    blksize_size[XLVIRT_MAJOR]  = xlseg_blksize_size;
   15.82 -    hardsect_size[XLVIRT_MAJOR] = xlseg_hardsect_size;
   15.83 -    max_sectors[XLVIRT_MAJOR]   = xlseg_max_sectors;
   15.84 -    read_ahead[XLVIRT_MAJOR]    = 8;
   15.85 -
   15.86 -    blk_init_queue(BLK_DEFAULT_QUEUE(XLVIRT_MAJOR), do_xlblk_request);
   15.87 -
   15.88 -    /*
   15.89 -     * Turn off barking 'headactive' mode. We dequeue buffer heads as
   15.90 -     * soon as we pass them down to Xen.
   15.91 -     */
   15.92 -    blk_queue_headactive(BLK_DEFAULT_QUEUE(XLVIRT_MAJOR), 0);
   15.93 -
   15.94 -    units = XLVIRT_MAX >> XLVIRT_PARTN_SHIFT;
   15.95 -
   15.96 -    /* Construct an appropriate gendisk structure. */
   15.97 -    minors    = units * (1<<XLVIRT_PARTN_SHIFT);
   15.98 -    gd        = kmalloc(sizeof(struct gendisk), GFP_KERNEL);
   15.99 -    gd->sizes = kmalloc(minors * sizeof(int), GFP_KERNEL);
  15.100 -    gd->part  = kmalloc(minors * sizeof(struct hd_struct), GFP_KERNEL);
  15.101 -    gd->major        = XLVIRT_MAJOR;
  15.102 -    gd->major_name   = XLVIRT_MAJOR_NAME;
  15.103 -    gd->minor_shift  = XLVIRT_PARTN_SHIFT; 
  15.104 -    gd->max_p	     = 1<<XLVIRT_PARTN_SHIFT;
  15.105 -    gd->nr_real	     = units;           
  15.106 -    gd->real_devices = kmalloc(units * sizeof(xl_disk_t), GFP_KERNEL);
  15.107 -    gd->next	     = NULL;            
  15.108 -    gd->fops         = &xlsegment_block_fops;
  15.109 -    gd->de_arr       = kmalloc(sizeof(*gd->de_arr) * units, GFP_KERNEL);
  15.110 -    gd->flags	     = kmalloc(sizeof(*gd->flags) * units, GFP_KERNEL);
  15.111 -    memset(gd->sizes, 0, minors * sizeof(int));
  15.112 -    memset(gd->part,  0, minors * sizeof(struct hd_struct));
  15.113 -    memset(gd->de_arr, 0, sizeof(*gd->de_arr) * units);
  15.114 -    memset(gd->flags, 0, sizeof(*gd->flags) * units);
  15.115 -    memset(gd->real_devices, 0, sizeof(xl_disk_t) * units);
  15.116 -    xlsegment_gendisk = gd;
  15.117 -    add_gendisk(gd);
  15.118 -
  15.119 -    /* Now register each disk in turn. */
  15.120 -    for ( i = 0; i < xdi->count; i++ )
  15.121 -    {
  15.122 -        disk = xdi->disks[i].device & XENDEV_IDX_MASK;
  15.123 -
  15.124 -        if ( !IS_VIRTUAL_XENDEV(xdi->disks[i].device) || 
  15.125 -             (disk >= XLVIRT_DEVS_PER_MAJOR) )
  15.126 -            continue;
  15.127 -
  15.128 -        ((xl_disk_t *)gd->real_devices)[disk].capacity =
  15.129 -            xdi->disks[i].capacity;
  15.130 -        register_disk(gd, 
  15.131 -                      MKDEV(XLVIRT_MAJOR, disk<<XLVIRT_PARTN_SHIFT), 
  15.132 -                      1<<XLVIRT_PARTN_SHIFT, 
  15.133 -                      &xlsegment_block_fops, 
  15.134 -                      xdi->disks[i].capacity);
  15.135 -    }
  15.136 -
  15.137 -    printk(KERN_ALERT 
  15.138 -	   "XenoLinux Virtual Segment Device Driver installed [device: %d]\n",
  15.139 -	   XLVIRT_MAJOR);
  15.140 -
  15.141 -    return 0;
  15.142 -}
  15.143 -
  15.144 -
  15.145 -static void __exit xlseg_cleanup(void)
  15.146 -{
  15.147 -    if ( xlsegment_gendisk == NULL ) return;
  15.148 -
  15.149 -    blk_cleanup_queue(BLK_DEFAULT_QUEUE(XLVIRT_MAJOR));
  15.150 -
  15.151 -    xlsegment_gendisk = NULL;
  15.152 -
  15.153 -    read_ahead[XLVIRT_MAJOR] = 0;
  15.154 -
  15.155 -    if ( blksize_size[XLVIRT_MAJOR] != NULL )
  15.156 -    { 
  15.157 -	kfree(blksize_size[XLVIRT_MAJOR]);
  15.158 -        blksize_size[XLVIRT_MAJOR] = NULL;
  15.159 -    }
  15.160 -
  15.161 -    if ( hardsect_size[XLVIRT_MAJOR] != NULL )
  15.162 -    { 
  15.163 -	kfree(hardsect_size[XLVIRT_MAJOR]);
  15.164 -        hardsect_size[XLVIRT_MAJOR] = NULL;
  15.165 -    }
  15.166 -    
  15.167 -    if ( max_sectors[XLVIRT_MAJOR] != NULL )
  15.168 -    { 
  15.169 -	kfree(max_sectors[XLVIRT_MAJOR]);
  15.170 -        max_sectors[XLVIRT_MAJOR] = NULL;
  15.171 -    }
  15.172 -    
  15.173 -    if ( unregister_blkdev(XLVIRT_MAJOR, XLVIRT_MAJOR_NAME) != 0 )
  15.174 -    {
  15.175 -	printk(KERN_ALERT
  15.176 -	       "XenoLinux Virtual Segment Device Driver"
  15.177 -               " uninstalled w/ errs\n");
  15.178 -    }
  15.179 -}
  15.180 -
  15.181 -
  15.182 -#ifdef MODULE
  15.183 -module_init(xlseg_init);
  15.184 -module_exit(xlseg_cleanup);
  15.185 -#endif
    16.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment_proc.c	Tue Jun 24 12:05:12 2003 +0000
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,244 +0,0 @@
    16.4 -/*
    16.5 - * xl_segment_proc.c
    16.6 - * 
    16.7 - * XenoLinux virtual disk proc interface .
    16.8 - */
    16.9 -
   16.10 -#include "xl_block.h"
   16.11 -#include <linux/proc_fs.h>
   16.12 -#include <linux/delay.h>
   16.13 -
   16.14 -static struct proc_dir_entry *vhd;
   16.15 -
   16.16 -static int proc_read_vhd(char *page, char **start, off_t off,
   16.17 -			 int count, int *eof, void *data)
   16.18 -{
   16.19 -    return 0;
   16.20 -}
   16.21 -
   16.22 -#define isdelim(c) \
   16.23 -  (c==' '||c==','||c=='\n'||c=='\r'||c=='\t'||c==':'||c=='('||c==')' ? 1 : 0)
   16.24 -
   16.25 -char *get_string(char *string)                          /* a bit like strtok */
   16.26 -{
   16.27 -    static char *temp;
   16.28 -    int loop = 0;
   16.29 -
   16.30 -    if (string != NULL)	
   16.31 -        temp = string;
   16.32 -    else
   16.33 -        string = temp;
   16.34 -
   16.35 - try_again:
   16.36 -
   16.37 -    while (!isdelim(string[loop]))
   16.38 -    {
   16.39 -        if (string[loop] == '\0')
   16.40 -            return NULL;
   16.41 -        loop++;
   16.42 -    }
   16.43 -
   16.44 -    string[loop] = '\0';	
   16.45 -    temp = (string + loop + 1);
   16.46 -
   16.47 -    if (loop == 0)
   16.48 -    {
   16.49 -        string = temp;
   16.50 -        goto try_again;
   16.51 -    }
   16.52 -
   16.53 -    return string;
   16.54 -}
   16.55 -
   16.56 -
   16.57 -#define isdigit(c) (c >= '0' && c <= '9' ? 1 : 0)
   16.58 -unsigned long to_number(char *string)                                /* atoi */
   16.59 -{
   16.60 -    unsigned long value = 0;
   16.61 -
   16.62 -    if (string == NULL) return 0;
   16.63 -
   16.64 -    while (!isdigit(*string) && *string != '\0') string++;
   16.65 -
   16.66 -    while (isdigit(*string))
   16.67 -    {
   16.68 -        value = value * 10 + (*string - '0');
   16.69 -        string++;
   16.70 -    }
   16.71 -
   16.72 -    return value;
   16.73 -}
   16.74 -
   16.75 -static int proc_write_vhd(struct file *file, const char *buffer,
   16.76 -			  unsigned long count, void *data)
   16.77 -{
   16.78 -    char *local = kmalloc((count + 1) * sizeof(char), GFP_KERNEL);
   16.79 -    char *string;
   16.80 -    int loop;
   16.81 -    xv_disk_t xvd;
   16.82 -
   16.83 -    memset (&xvd, 0, sizeof(xvd));
   16.84 -
   16.85 -    if (copy_from_user(local, buffer, count))
   16.86 -    {
   16.87 -        return -EFAULT;
   16.88 -    }
   16.89 -    local[count] = '\0';
   16.90 -
   16.91 -    string = get_string(local); /* domain specifier */
   16.92 -    if (string == NULL)
   16.93 -    {
   16.94 -        return count;
   16.95 -    }
   16.96 -    if (*string != 'd' && *string != 'D')
   16.97 -    {
   16.98 -        printk (KERN_ALERT 
   16.99 -                "error: domain specifier missing [%s]. should be \"domain\".\n",
  16.100 -                string);
  16.101 -        return count;
  16.102 -    }
  16.103 -
  16.104 -    string = get_string(NULL); /* domain number */
  16.105 -    if (string == NULL)
  16.106 -    {
  16.107 -        printk (KERN_ALERT "error: domain number missing\n");
  16.108 -        return count;
  16.109 -    }
  16.110 -    xvd.domain = (int) to_number(string);
  16.111 -
  16.112 -    string = get_string(NULL);
  16.113 -    if (string && (strcmp(string, "RO") == 0 || strcmp(string, "ro") == 0))
  16.114 -    {
  16.115 -        xvd.mode = XEN_DISK_READ_ONLY;
  16.116 -    }
  16.117 -    else if (string && (strcmp(string, "RW") == 0 || strcmp(string, "rw") == 0))
  16.118 -    {
  16.119 -        xvd.mode = XEN_DISK_READ_WRITE;
  16.120 -    }
  16.121 -    else
  16.122 -    {
  16.123 -        printk (KERN_ALERT 
  16.124 -                "error: bad mode [%s]. should be \"rw\" or \"ro\".\n",
  16.125 -                string);
  16.126 -        return count;
  16.127 -    }
  16.128 -
  16.129 -    string = get_string(NULL);                           /* look for Segment */
  16.130 -    if (string == NULL || (*string != 's' && *string != 'S'))
  16.131 -    {
  16.132 -        printk (KERN_ALERT 
  16.133 -                "error: segment specifier missing [%s]. should be \"segment\".\n",
  16.134 -                string);
  16.135 -        return count;
  16.136 -    }
  16.137 -
  16.138 -    string = get_string(NULL);                             /* segment number */
  16.139 -    if (string == NULL)
  16.140 -    {
  16.141 -        printk (KERN_ALERT "error: segment number missing\n");
  16.142 -        return count;
  16.143 -    }
  16.144 -    xvd.segment = (int) to_number(string);
  16.145 -
  16.146 -    string = get_string(NULL);                           /* look for Extents */
  16.147 -    if (string == NULL || (*string != 'e' && *string != 'E'))
  16.148 -    {
  16.149 -        printk (KERN_ALERT 
  16.150 -                "error: extents specifier missing [%s]. should be \"extents\".\n",
  16.151 -                string);
  16.152 -        return count;
  16.153 -    }
  16.154 -
  16.155 -    string = get_string(NULL);                          /* number of extents */
  16.156 -    if (string == NULL)
  16.157 -    {
  16.158 -        printk (KERN_ALERT "error: number of extents missing\n");
  16.159 -        return count;
  16.160 -    }
  16.161 -    xvd.ext_count = (int) to_number(string);
  16.162 -
  16.163 -    /* ignore parenthesis */
  16.164 -
  16.165 -    for (loop = 0; loop < xvd.ext_count; loop++)
  16.166 -    {
  16.167 -        string = get_string(NULL);                          /* look for Disk */
  16.168 -        if (string == NULL || (*string != 'd' && *string != 'D'))
  16.169 -        {
  16.170 -            printk (KERN_ALERT 
  16.171 -                    "hmm, extent disk specifier missing [%s]. should be \"disk\".\n",
  16.172 -                    string);
  16.173 -            return count;
  16.174 -        }
  16.175 -        string = get_string(NULL);                            /* disk number */
  16.176 -        if (string == NULL)
  16.177 -        {
  16.178 -            printk (KERN_ALERT "error: disk number missing\n");
  16.179 -            return count;
  16.180 -        }
  16.181 -        xvd.extents[loop].disk = xldev_to_physdev((int) to_number(string));
  16.182 -
  16.183 -        string = get_string(NULL);                        /* look for Offset */
  16.184 -        if (string == NULL || (*string != 'o' && *string != 'O'))
  16.185 -        {
  16.186 -            printk (KERN_ALERT 
  16.187 -                    "error: disk offset missing [%s]. should be \"offset\".\n",
  16.188 -                    string);
  16.189 -            return count;
  16.190 -        }
  16.191 -        string = get_string(NULL);                                 /* offset */
  16.192 -        if (string == NULL)
  16.193 -        {
  16.194 -            printk (KERN_ALERT "error: offset missing\n");
  16.195 -            return count;
  16.196 -        }
  16.197 -        xvd.extents[loop].offset =  to_number(string);
  16.198 -
  16.199 -        string = get_string(NULL);                          /* look for Size */
  16.200 -        if (string == NULL || (*string != 's' && *string != 'S'))
  16.201 -        {
  16.202 -            printk (KERN_ALERT 
  16.203 -                    "error: extent size missing [%s]. should be \"size\".\n",
  16.204 -                    string);
  16.205 -            return count;
  16.206 -        }
  16.207 -        string = get_string(NULL);                                   /* size */
  16.208 -        if (string == NULL)
  16.209 -        {
  16.210 -            printk (KERN_ALERT "error: extent size missing\n");
  16.211 -            return count;
  16.212 -        }
  16.213 -        xvd.extents[loop].size =  to_number(string);
  16.214 -    }
  16.215 -
  16.216 -    xenolinux_control_msg(XEN_BLOCK_SEG_CREATE, (char *)&xvd, sizeof(xvd));
  16.217 -
  16.218 -    return count;
  16.219 -}
  16.220 -
  16.221 -/******************************************************************/
  16.222 -
  16.223 -int __init xlseg_proc_init(void)
  16.224 -{
  16.225 -    vhd = create_proc_entry("xeno/dom0/vhd", 0644, NULL);
  16.226 -    if (vhd == NULL)
  16.227 -    {
  16.228 -        panic ("xlseg_init: unable to create vhd proc entry\n");
  16.229 -    }
  16.230 -    vhd->data       = NULL;
  16.231 -    vhd->read_proc  = proc_read_vhd;
  16.232 -    vhd->write_proc = proc_write_vhd;
  16.233 -    vhd->owner      = THIS_MODULE;
  16.234 -
  16.235 -    printk(KERN_ALERT "XenoLinux Virtual Disk Device Monitor installed\n");
  16.236 -    return 0;
  16.237 -}
  16.238 -
  16.239 -static void __exit xlseg_proc_cleanup(void)
  16.240 -{
  16.241 -    printk(KERN_ALERT "XenoLinux Virtual Disk Device Monitor uninstalled\n");
  16.242 -}
  16.243 -
  16.244 -#ifdef MODULE
  16.245 -module_init(xlseg_proc_init);
  16.246 -module_exit(xlseg_proc_cleanup);
  16.247 -#endif
    17.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/Makefile	Tue Jun 24 12:05:12 2003 +0000
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,3 +0,0 @@
    17.4 -O_TARGET := con.o
    17.5 -obj-$(CONFIG_XEN_CONSOLE) := console.o
    17.6 -include $(TOPDIR)/Rules.make
    18.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/console.c	Tue Jun 24 12:05:12 2003 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,206 +0,0 @@
    18.4 -/******************************************************************************
    18.5 - * console.c
    18.6 - */
    18.7 -
    18.8 -#include <linux/config.h>
    18.9 -#include <linux/module.h>
   18.10 -#include <linux/errno.h>
   18.11 -#include <linux/signal.h>
   18.12 -#include <linux/sched.h>
   18.13 -#include <linux/interrupt.h>
   18.14 -#include <linux/tty.h>
   18.15 -#include <linux/tty_flip.h>
   18.16 -#include <linux/serial.h>
   18.17 -#include <linux/major.h>
   18.18 -#include <linux/ptrace.h>
   18.19 -#include <linux/ioport.h>
   18.20 -#include <linux/mm.h>
   18.21 -#include <linux/slab.h>
   18.22 -#include <linux/init.h>
   18.23 -#include <linux/console.h>
   18.24 -
   18.25 -#include <asm/io.h>
   18.26 -#include <asm/irq.h>
   18.27 -#include <asm/uaccess.h>
   18.28 -#include <asm/hypervisor.h>
   18.29 -
   18.30 -#define XENO_TTY_MINOR 123
   18.31 -
   18.32 -/******************** Kernel console driver ********************************/
   18.33 -
   18.34 -static void xen_console_write(struct console *co, const char *s, unsigned count)
   18.35 -{
   18.36 -#define STRLEN 256
   18.37 -    static char str[STRLEN];
   18.38 -    static int pos = 0;
   18.39 -    int len;
   18.40 -    
   18.41 -    /* We buffer output until we see a newline, or until the buffer is full. */
   18.42 -    while ( count != 0 )
   18.43 -    {
   18.44 -        len = ((STRLEN - pos) > count) ? count : STRLEN - pos;
   18.45 -        memcpy(str + pos, s, len);
   18.46 -        pos   += len;
   18.47 -        s     += len;
   18.48 -        count -= len;
   18.49 -        if ( (pos == STRLEN) || (str[pos-1] == '\n') )
   18.50 -        {
   18.51 -            (void)HYPERVISOR_console_write(str, pos);
   18.52 -            pos = 0;
   18.53 -        }
   18.54 -    }
   18.55 -}
   18.56 -
   18.57 -static kdev_t xen_console_device(struct console *c)
   18.58 -{
   18.59 -    /*
   18.60 -     * This is the magic that binds our "struct console" to our
   18.61 -     * "tty_struct", defined below.
   18.62 -     */
   18.63 -    return MKDEV(TTY_MAJOR, XENO_TTY_MINOR);
   18.64 -}
   18.65 -
   18.66 -static struct console xen_console_info = {
   18.67 -    name:		"xen_console",
   18.68 -    write:		xen_console_write,
   18.69 -    device:             xen_console_device,
   18.70 -    flags:		CON_PRINTBUFFER,
   18.71 -    index:		-1,
   18.72 -};
   18.73 -
   18.74 -void xen_console_init(void)
   18.75 -{
   18.76 -  register_console(&xen_console_info);
   18.77 -}
   18.78 -
   18.79 -
   18.80 -/******************** Initial /dev/console *********************************/
   18.81 -
   18.82 -
   18.83 -static struct tty_driver xeno_console_driver;
   18.84 -static int xeno_console_refcount;
   18.85 -static struct tty_struct *xeno_console_table[1];
   18.86 -static struct termios *xeno_console_termios[1];
   18.87 -static struct termios *xeno_console_termios_locked[1];
   18.88 -
   18.89 -static int xeno_console_write_room(struct tty_struct *tty)
   18.90 -{
   18.91 -    return INT_MAX;
   18.92 -}
   18.93 -
   18.94 -static int xeno_console_chars_in_buffer(struct tty_struct *tty)
   18.95 -{
   18.96 -    return 0;
   18.97 -}
   18.98 -
   18.99 -static inline int xeno_console_xmit(int ch)
  18.100 -{
  18.101 -    char _ch = ch;
  18.102 -    xen_console_write(NULL, &_ch, 1);
  18.103 -    return 1;
  18.104 -}
  18.105 -
  18.106 -static int xeno_console_write(struct tty_struct *tty, int from_user,
  18.107 -                       const u_char * buf, int count)
  18.108 -{
  18.109 -    int i;
  18.110 -
  18.111 -    if ( from_user && verify_area(VERIFY_READ, buf, count) )
  18.112 -    {
  18.113 -        return -EINVAL;
  18.114 -    }
  18.115 -
  18.116 -    for ( i = 0; i < count; i++ )
  18.117 -    {
  18.118 -        char ch;
  18.119 -        if ( from_user )
  18.120 -        {
  18.121 -            __get_user(ch, buf + i);
  18.122 -        }
  18.123 -        else
  18.124 -        {
  18.125 -            ch = buf[i];
  18.126 -        }
  18.127 -        xeno_console_xmit(ch);
  18.128 -    }
  18.129 -    return i;
  18.130 -}
  18.131 -
  18.132 -static void xeno_console_put_char(struct tty_struct *tty, u_char ch)
  18.133 -{
  18.134 -    xeno_console_xmit(ch);
  18.135 -}
  18.136 -
  18.137 -static int xeno_console_open(struct tty_struct *tty, struct file *filp)
  18.138 -{
  18.139 -    int line;
  18.140 -
  18.141 -    MOD_INC_USE_COUNT;
  18.142 -    line = MINOR(tty->device) - tty->driver.minor_start;
  18.143 -    if ( line )
  18.144 -    {
  18.145 -        MOD_DEC_USE_COUNT;
  18.146 -        return -ENODEV;
  18.147 -    }
  18.148 -
  18.149 -    tty->driver_data = NULL;
  18.150 -
  18.151 -    return 0;
  18.152 -}
  18.153 -
  18.154 -static void xeno_console_close(struct tty_struct *tty, struct file *filp)
  18.155 -{
  18.156 -    MOD_DEC_USE_COUNT;
  18.157 -}
  18.158 -
  18.159 -int __init xeno_con_init(void)
  18.160 -{
  18.161 -    memset(&xeno_console_driver, 0, sizeof(struct tty_driver));
  18.162 -    xeno_console_driver.magic           = TTY_DRIVER_MAGIC;
  18.163 -    xeno_console_driver.driver_name     = "xeno_console";
  18.164 -    xeno_console_driver.name            = "xencon";
  18.165 -    xeno_console_driver.major           = TTY_MAJOR;
  18.166 -    xeno_console_driver.minor_start     = XENO_TTY_MINOR;
  18.167 -    xeno_console_driver.num             = 1;
  18.168 -    xeno_console_driver.type            = TTY_DRIVER_TYPE_SERIAL;
  18.169 -    xeno_console_driver.subtype         = SERIAL_TYPE_NORMAL;
  18.170 -    xeno_console_driver.init_termios    = tty_std_termios;
  18.171 -    xeno_console_driver.flags           = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
  18.172 -    xeno_console_driver.refcount        = &xeno_console_refcount;
  18.173 -    xeno_console_driver.table           = xeno_console_table;
  18.174 -    xeno_console_driver.termios         = xeno_console_termios;
  18.175 -    xeno_console_driver.termios_locked  = xeno_console_termios_locked;
  18.176 -    /* Functions */
  18.177 -    xeno_console_driver.open            = xeno_console_open;
  18.178 -    xeno_console_driver.close           = xeno_console_close;
  18.179 -    xeno_console_driver.write           = xeno_console_write;
  18.180 -    xeno_console_driver.write_room      = xeno_console_write_room;
  18.181 -    xeno_console_driver.put_char        = xeno_console_put_char;
  18.182 -    xeno_console_driver.chars_in_buffer = xeno_console_chars_in_buffer;
  18.183 -
  18.184 -    if ( tty_register_driver(&xeno_console_driver) )
  18.185 -    {
  18.186 -        printk(KERN_ERR "Couldn't register Xeno console driver\n");
  18.187 -    }
  18.188 -    else
  18.189 -    {
  18.190 -        printk("Xeno console successfully installed\n");
  18.191 -    }
  18.192 -
  18.193 -    return 0;
  18.194 -}
  18.195 -
  18.196 -void __exit xeno_con_fini(void)
  18.197 -{
  18.198 -    int ret;
  18.199 -
  18.200 -    ret = tty_unregister_driver(&xeno_console_driver);
  18.201 -    if ( ret != 0 )
  18.202 -    {
  18.203 -        printk(KERN_ERR "Unable to unregister Xeno console driver: %d\n", ret);
  18.204 -    }
  18.205 -}
  18.206 -
  18.207 -module_init(xeno_con_init);
  18.208 -module_exit(xeno_con_fini);
  18.209 -
    19.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/Makefile	Tue Jun 24 12:05:12 2003 +0000
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,3 +0,0 @@
    19.4 -O_TARGET := dom0.o
    19.5 -obj-y := dom0_memory.o dom0_core.o vfr.o sched_ops.o
    19.6 -include $(TOPDIR)/Rules.make
    20.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_block.c	Tue Jun 24 12:05:12 2003 +0000
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,27 +0,0 @@
    20.4 -/*
    20.5 - * domain 0 block driver interface
    20.6 - *
    20.7 - */
    20.8 -
    20.9 -#include <linux/config.h>
   20.10 -#include <linux/module.h>
   20.11 -#include <linux/kernel.h>
   20.12 -#include <linux/sched.h>
   20.13 -
   20.14 -static int __init init_module(void)
   20.15 -{
   20.16 -  request_module("xl_block");
   20.17 -  printk("Successfully installed domain 0 block interface\n");
   20.18 -
   20.19 -
   20.20 -  return 0;
   20.21 -}
   20.22 -
   20.23 -static void __exit cleanup_module(void)
   20.24 -{
   20.25 -  printk("Successfully de-installed domain-0 block interface\n");
   20.26 -  return 0;
   20.27 -}
   20.28 -
   20.29 -module_init(init_module);
   20.30 -module_exit(cleanup_module);
    21.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_core.c	Tue Jun 24 12:05:12 2003 +0000
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,522 +0,0 @@
    21.4 -/******************************************************************************
    21.5 - * dom0_core.c
    21.6 - * 
    21.7 - * Interface to privileged domain-0 commands.
    21.8 - * 
    21.9 - * Copyright (c) 2002, K A Fraser, B Dragovic
   21.10 - */
   21.11 -
   21.12 -#include <linux/config.h>
   21.13 -#include <linux/module.h>
   21.14 -#include <linux/kernel.h>
   21.15 -#include <linux/sched.h>
   21.16 -#include <linux/slab.h>
   21.17 -#include <linux/string.h>
   21.18 -#include <linux/errno.h>
   21.19 -#include <linux/proc_fs.h>
   21.20 -
   21.21 -#include <linux/mm.h>
   21.22 -#include <linux/mman.h>
   21.23 -#include <linux/swap.h>
   21.24 -#include <linux/smp_lock.h>
   21.25 -#include <linux/swapctl.h>
   21.26 -#include <linux/iobuf.h>
   21.27 -#include <linux/highmem.h>
   21.28 -#include <linux/pagemap.h>
   21.29 -#include <linux/seq_file.h>
   21.30 -
   21.31 -#include <asm/pgalloc.h>
   21.32 -#include <asm/pgtable.h>
   21.33 -#include <asm/uaccess.h>
   21.34 -#include <asm/tlb.h>
   21.35 -
   21.36 -#include "dom0_ops.h"
   21.37 -
   21.38 -#define TRUE  1
   21.39 -#define FALSE 0
   21.40 -
   21.41 -/* Private proc-file data structures. */
   21.42 -typedef struct proc_data {
   21.43 -    unsigned int domain;
   21.44 -    unsigned long map_size;
   21.45 -} dom_procdata_t;
   21.46 -
   21.47 -typedef struct proc_mem_data {
   21.48 -    unsigned long pfn;
   21.49 -    int tot_pages;
   21.50 -} proc_memdata_t;
   21.51 -
   21.52 -#define XENO_BASE       "xeno"
   21.53 -#define DOM0_CMD_INTF   "dom0_cmd"
   21.54 -#define DOM0_NEWDOM     "new_dom_data"
   21.55 -#define DOM_LIST_INTF   "domains"
   21.56 -
   21.57 -#define MAX_LEN         16
   21.58 -#define DOM_DIR         "dom"
   21.59 -#define DOM_MEM         "mem"
   21.60 -#define DOM_VIF         "vif"
   21.61 -#define DOM_USAGE       "usage"
   21.62 -
   21.63 -#define MAP_DISCONT     1
   21.64 -
   21.65 -struct proc_dir_entry *xeno_base;
   21.66 -static struct proc_dir_entry *dom0_cmd_intf;
   21.67 -static struct proc_dir_entry *proc_ft;
   21.68 -static struct proc_dir_entry *dom_list_intf;
   21.69 -
   21.70 -unsigned long direct_mmap(unsigned long, unsigned long, pgprot_t, int, int);
   21.71 -int direct_unmap(unsigned long, unsigned long);
   21.72 -int direct_disc_unmap(unsigned long, unsigned long, int);
   21.73 -
   21.74 -static unsigned char readbuf[1204];
   21.75 -
   21.76 -static int cmd_read_proc(char *page, char **start, off_t off,
   21.77 -                          int count, int *eof, void *data)
   21.78 -{
   21.79 -    strcpy(page, readbuf);
   21.80 -    *readbuf = '\0';
   21.81 -    *eof = 1;
   21.82 -    *start = page;
   21.83 -    return strlen(page);
   21.84 -}
   21.85 -
   21.86 -static ssize_t dom_vif_read(struct file * file, char * buff, size_t size, loff_t * off)
   21.87 -{
   21.88 -    int hyp_buf[32];
   21.89 -    char buf[128];
   21.90 -    network_op_t op;
   21.91 -    static int finished = 0;
   21.92 -
   21.93 -    if ( finished ) 
   21.94 -    {
   21.95 -        finished = 0;
   21.96 -        return 0;
   21.97 -    }
   21.98 -    
   21.99 -    op.cmd = NETWORK_OP_VIFQUERY;
  21.100 -    op.u.vif_query.domain = (unsigned int)
  21.101 -        ((struct proc_dir_entry *)file->f_dentry->d_inode->u.generic_ip)->data;
  21.102 -    op.u.vif_query.buf = hyp_buf;
  21.103 -
  21.104 -    (void) HYPERVISOR_network_op(&op);
  21.105 -
  21.106 -    if(hyp_buf[0] < 0) {
  21.107 -        strcpy(buf, "Error getting domain's vif list from hypervisor.\n");
  21.108 -    } else {
  21.109 -        int i;
  21.110 -        int len = 0;
  21.111 -        strcpy(buf, "No vif found");
  21.112 -
  21.113 -        for(i = 1; i <= hyp_buf[0] && len < 127; i++)
  21.114 -            len += snprintf(buf + len, 127 - len, "%d\n", hyp_buf[i]);
  21.115 -    }
  21.116 -
  21.117 -    if (*off >= (strlen(buf)+1)) return 0;
  21.118 -    
  21.119 -    copy_to_user(buff, buf, strlen(buf));
  21.120 -    
  21.121 -    finished = 1;
  21.122 -    
  21.123 -    return strlen(buf)+1;
  21.124 -}
  21.125 -
  21.126 -struct file_operations dom_vif_ops = {
  21.127 -    read:    dom_vif_read
  21.128 -};
  21.129 -
  21.130 -static ssize_t dom_usage_read(struct file * file, char * buff, size_t size, loff_t * off)
  21.131 -{
  21.132 -    char str[256];
  21.133 -    int vifs[32];
  21.134 -    dom0_op_t op;
  21.135 -    network_op_t netop;
  21.136 -    int i, end;
  21.137 -    unsigned int domain;
  21.138 -    static int finished = 0;
  21.139 -
  21.140 -    if ( finished )
  21.141 -    {
  21.142 -        finished = 0;
  21.143 -        return 0;
  21.144 -    }
  21.145 -
  21.146 -    domain = (unsigned int)
  21.147 -        ((struct proc_dir_entry *)file->f_dentry->d_inode->u.generic_ip)->data;
  21.148 -    op.cmd = DOM0_GETDOMAININFO;
  21.149 -
  21.150 -    op.u.getdominfo.domain = domain;
  21.151 -
  21.152 -    (void) HYPERVISOR_dom0_op(&op);
  21.153 -
  21.154 -    end = snprintf(str, 256, "cpu: %lld\n", op.u.getdominfo.cpu_time);
  21.155 -
  21.156 -    netop.cmd = NETWORK_OP_VIFQUERY;
  21.157 -    netop.u.vif_query.domain = domain;
  21.158 -    netop.u.vif_query.buf = vifs;
  21.159 -
  21.160 -    (void) HYPERVISOR_network_op(&netop);
  21.161 -
  21.162 -    for(i = 1; i <= vifs[0]; i++) {
  21.163 -        netop.cmd = NETWORK_OP_VIFGETINFO;
  21.164 -        netop.u.vif_getinfo.domain = domain;
  21.165 -        netop.u.vif_getinfo.vif = vifs[i];
  21.166 -
  21.167 -        (void) HYPERVISOR_network_op(&netop);
  21.168 -
  21.169 -        end += snprintf(str + end, 255 - end,
  21.170 -                "vif%d: sent %lld bytes (%lld packets) "
  21.171 -                "received %lld bytes (%lld packets)\n",
  21.172 -                vifs[i],
  21.173 -                netop.u.vif_getinfo.total_bytes_sent,
  21.174 -                netop.u.vif_getinfo.total_packets_sent,
  21.175 -                netop.u.vif_getinfo.total_bytes_received,
  21.176 -                netop.u.vif_getinfo.total_packets_received);
  21.177 -    }
  21.178 -
  21.179 -    if (*off >= end + 1) return 0;
  21.180 -    
  21.181 -    copy_to_user(buff, str, end);
  21.182 -
  21.183 -    finished = 1;
  21.184 -
  21.185 -    return end + 1;
  21.186 -}
  21.187 -
  21.188 -struct file_operations dom_usage_ops = {
  21.189 -    read:    dom_usage_read
  21.190 -};
  21.191 -
  21.192 -
  21.193 -static void create_proc_dom_entries(int dom)
  21.194 -{
  21.195 -    struct proc_dir_entry * dir;
  21.196 -    dom_procdata_t * dom_data;
  21.197 -    char dir_name[MAX_LEN];
  21.198 -    struct proc_dir_entry * file;
  21.199 -
  21.200 -    snprintf(dir_name, MAX_LEN, "%s%d", DOM_DIR, dom);
  21.201 -
  21.202 -    dom_data = (dom_procdata_t *)kmalloc(sizeof(dom_procdata_t), GFP_KERNEL);
  21.203 -    dom_data->domain = dom;
  21.204 -
  21.205 -    dir = proc_mkdir(dir_name, xeno_base);
  21.206 -    dir->data = dom_data;
  21.207 -    
  21.208 -    file = create_proc_entry(DOM_VIF, 0600, dir);
  21.209 -    if (file != NULL)
  21.210 -    {
  21.211 -        file->owner         = THIS_MODULE;
  21.212 -        file->nlink         = 1;
  21.213 -        file->proc_fops     = &dom_vif_ops;
  21.214 -        file->data          = (void *) dom;
  21.215 -    }
  21.216 -
  21.217 -    file = create_proc_entry(DOM_USAGE, 0600, dir);
  21.218 -    if (file != NULL)
  21.219 -    {
  21.220 -        file->owner         = THIS_MODULE;
  21.221 -        file->nlink         = 1;
  21.222 -        file->proc_fops     = &dom_usage_ops;
  21.223 -        file->data          = (void *) dom;
  21.224 -    }
  21.225 -}
  21.226 -
  21.227 -static ssize_t dom_mem_write(struct file * file, const char * buff, 
  21.228 -	size_t size , loff_t * off)
  21.229 -{
  21.230 -    dom_mem_t mem_data;
  21.231 -    
  21.232 -    copy_from_user(&mem_data, (dom_mem_t *)buff, sizeof(dom_mem_t));
  21.233 -    
  21.234 -    if(direct_disc_unmap(mem_data.vaddr, mem_data.start_pfn, 
  21.235 -        mem_data.tot_pages) == 0){
  21.236 -        return sizeof(sizeof(dom_mem_t));
  21.237 -    } else {
  21.238 -        return -1;
  21.239 -    }
  21.240 -}
  21.241 -
  21.242 -static ssize_t dom_mem_read(struct file * file, char * buff, size_t size, loff_t * off)
  21.243 -{
  21.244 -    unsigned long addr;
  21.245 -    pgprot_t prot;
  21.246 -
  21.247 -    proc_memdata_t * mem_data = (proc_memdata_t *)((struct proc_dir_entry *)file->f_dentry->d_inode->u.generic_ip)->data;
  21.248 -
  21.249 -    prot = PAGE_SHARED; 
  21.250 -
  21.251 -    /* remap the range using xen specific routines */
  21.252 -
  21.253 -    addr = direct_mmap(mem_data->pfn << PAGE_SHIFT, mem_data->tot_pages << PAGE_SHIFT, prot, MAP_DISCONT, mem_data->tot_pages);
  21.254 -    
  21.255 -    copy_to_user((unsigned long *)buff, &addr, sizeof(addr));
  21.256 -
  21.257 -    return sizeof(addr);
  21.258 -}
  21.259 -
  21.260 -struct file_operations dom_mem_ops = {
  21.261 -    read:    dom_mem_read,
  21.262 -    write:   dom_mem_write,
  21.263 -};
  21.264 -
  21.265 -static int dom_map_mem(unsigned int dom, unsigned long pfn, int tot_pages)
  21.266 -{
  21.267 -    int ret = -ENOENT;
  21.268 -    struct proc_dir_entry * pd = xeno_base->subdir;
  21.269 -    struct proc_dir_entry * file;
  21.270 -    proc_memdata_t * memdata;
  21.271 -
  21.272 -    while(pd != NULL){
  21.273 -
  21.274 -        if((pd->mode & S_IFDIR) && ((dom_procdata_t *)pd->data)->domain == dom){
  21.275 -
  21.276 -            /* check if there is already an entry for mem and if so
  21.277 -             * remove it.
  21.278 -             */
  21.279 -            remove_proc_entry(DOM_MEM, pd);
  21.280 -
  21.281 -            /* create new entry with parameters describing what to do
  21.282 -             * when it is mmaped.
  21.283 -             */
  21.284 -            file = create_proc_entry(DOM_MEM, 0600, pd);
  21.285 -            if(file != NULL)
  21.286 -            {
  21.287 -                file->owner = THIS_MODULE;
  21.288 -                file->nlink = 1;
  21.289 -                file->proc_fops = &dom_mem_ops;
  21.290 -
  21.291 -                memdata = (proc_memdata_t *)kmalloc(sizeof(proc_memdata_t), GFP_KERNEL);
  21.292 -                memdata->pfn = pfn;
  21.293 -                memdata->tot_pages = tot_pages;
  21.294 -                file->data = memdata;
  21.295 -
  21.296 -                ret = 0;
  21.297 -                break;
  21.298 -            }
  21.299 -
  21.300 -            ret = -EAGAIN;
  21.301 -            break;
  21.302 -        }                    
  21.303 -        pd = pd->next;
  21.304 -    }
  21.305 -
  21.306 -    return ret;
  21.307 -}
  21.308 -
  21.309 -/* function used to retrieve data associated with new domain */
  21.310 -static ssize_t dom_data_read(struct file * file, char * buff, size_t size, loff_t * off)
  21.311 -{
  21.312 -    dom0_newdomain_t * dom_data = (dom0_newdomain_t *)
  21.313 -        ((struct proc_dir_entry *)file->f_dentry->d_inode->u.generic_ip)->data;
  21.314 -
  21.315 -    copy_to_user((dom0_newdomain_t *)buff, dom_data, sizeof(dom0_newdomain_t));
  21.316 -
  21.317 -    remove_proc_entry(DOM0_NEWDOM, xeno_base);
  21.318 -
  21.319 -    kfree(dom_data);
  21.320 -
  21.321 -    return sizeof(dom0_newdomain_t);
  21.322 -}
  21.323 -
  21.324 -struct file_operations newdom_data_fops = {
  21.325 -    read:    dom_data_read,
  21.326 -};
  21.327 -
  21.328 -static int cmd_write_proc(struct file *file, const char *buffer, 
  21.329 -                           u_long count, void *data)
  21.330 -{
  21.331 -    dom0_op_t op;
  21.332 -    int ret = 0;
  21.333 -    struct proc_dir_entry * new_dom_id;
  21.334 -    dom0_newdomain_t * params;
  21.335 -    int i;
  21.336 -    unsigned long p;
  21.337 -    
  21.338 -    copy_from_user(&op, buffer, sizeof(dom0_op_t));
  21.339 -
  21.340 -    /* do some sanity checks */
  21.341 -    if(op.cmd > MAX_CMD){
  21.342 -        ret = -ENOSYS;
  21.343 -        goto out;
  21.344 -    }
  21.345 -
  21.346 -    if ( op.cmd == MAP_DOM_MEM )
  21.347 -    {
  21.348 -        ret = dom_map_mem(op.u.dommem.domain, op.u.dommem.start_pfn, 
  21.349 -                        op.u.dommem.tot_pages); 
  21.350 -    }
  21.351 -    else if ( op.cmd == DO_PGUPDATES )
  21.352 -    {
  21.353 -        ret = HYPERVISOR_pt_update(op.u.pgupdate.pgt_update_arr,
  21.354 -                                   op.u.pgupdate.num_pgt_updates);
  21.355 -    }
  21.356 -    else
  21.357 -    {
  21.358 -        ret = HYPERVISOR_dom0_op(&op);
  21.359 -
  21.360 -        /* if new domain created, create proc entries */
  21.361 -        if(op.cmd == DOM0_CREATEDOMAIN) {
  21.362 -            create_proc_dom_entries(ret);
  21.363 -
  21.364 -            params = (dom0_newdomain_t *)kmalloc(sizeof(dom0_newdomain_t),
  21.365 -                GFP_KERNEL);
  21.366 -            params->memory_kb = op.u.newdomain.memory_kb;
  21.367 -            params->pg_head = op.u.newdomain.pg_head;
  21.368 -            params->num_vifs = op.u.newdomain.num_vifs;
  21.369 -            params->domain = op.u.newdomain.domain;
  21.370 -
  21.371 -            /* now notify user space of the new domain's id */
  21.372 -            new_dom_id = create_proc_entry(DOM0_NEWDOM, 0600, xeno_base);
  21.373 -            if ( new_dom_id != NULL )
  21.374 -            {
  21.375 -                new_dom_id->owner      = THIS_MODULE;
  21.376 -                new_dom_id->nlink      = 1;
  21.377 -                new_dom_id->proc_fops  = &newdom_data_fops; 
  21.378 -                new_dom_id->data       = (void *)params; 
  21.379 -            }
  21.380 -
  21.381 -        }
  21.382 -
  21.383 -    }
  21.384 -    
  21.385 -out:
  21.386 -    return ret;
  21.387 -    
  21.388 -}
  21.389 -
  21.390 -/***********************************************************************
  21.391 - *
  21.392 - * Implementation of /proc/xeno/domains
  21.393 - */
  21.394 -
  21.395 -static dom0_op_t proc_domains_op;
  21.396 -static int proc_domains_finished;
  21.397 -static rwlock_t proc_xeno_domains_lock = RW_LOCK_UNLOCKED;
  21.398 -
  21.399 -static void *xeno_domains_next(struct seq_file *s, void *v, loff_t *pos)
  21.400 -{
  21.401 -  int ret;
  21.402 -
  21.403 -  if (pos != NULL) { ++ (*pos); }
  21.404 -  if (!proc_domains_finished) {
  21.405 -    proc_domains_op.u.getdominfo.domain ++;
  21.406 -    ret = HYPERVISOR_dom0_op(&proc_domains_op);
  21.407 -    if (ret < 0) proc_domains_finished = TRUE;
  21.408 -  }
  21.409 -  
  21.410 -  return (proc_domains_finished) ? NULL : &proc_domains_op;
  21.411 -}
  21.412 -
  21.413 -static void *xeno_domains_start(struct seq_file *s, loff_t *ppos)
  21.414 -{ 
  21.415 -  loff_t pos = *ppos;
  21.416 -  
  21.417 -  write_lock (&proc_xeno_domains_lock);
  21.418 -  proc_domains_op.cmd = DOM0_GETDOMAININFO;
  21.419 -  proc_domains_op.u.getdominfo.domain = 0;
  21.420 -  (void)HYPERVISOR_dom0_op(&proc_domains_op);
  21.421 -  proc_domains_finished = FALSE;
  21.422 -  
  21.423 -  while (pos > 0) {
  21.424 -    pos --;
  21.425 -    xeno_domains_next (s, NULL, NULL);
  21.426 -  }
  21.427 -  
  21.428 -  return (proc_domains_finished) ? NULL : &proc_domains_op;
  21.429 -}
  21.430 -
  21.431 -static void xeno_domains_stop(struct seq_file *s, void *v)
  21.432 -{ 
  21.433 -  write_unlock (&proc_xeno_domains_lock);
  21.434 -}
  21.435 -
  21.436 -static int xeno_domains_show(struct seq_file *s, void *v)
  21.437 -{ 
  21.438 -  dom0_op_t *di = v;
  21.439 -  
  21.440 -  /*
  21.441 -   * Output one domain's details to dom0.
  21.442 -   *
  21.443 -   * If you update this format string then change xi_list to match.
  21.444 -   */
  21.445 -
  21.446 -  seq_printf (s, 
  21.447 -              "%8d %2d %1d %2d %8d %8ld %p %8d %s\n",
  21.448 -              di -> u.getdominfo.domain, 
  21.449 -              di -> u.getdominfo.processor,
  21.450 -              di -> u.getdominfo.has_cpu,
  21.451 -              di -> u.getdominfo.state,
  21.452 -              di -> u.getdominfo.hyp_events,
  21.453 -              di -> u.getdominfo.mcu_advance,
  21.454 -              di -> u.getdominfo.pg_head,
  21.455 -              di -> u.getdominfo.tot_pages,
  21.456 -              di -> u.getdominfo.name);
  21.457 -
  21.458 -  return 0;
  21.459 -}
  21.460 -
  21.461 -struct seq_operations xeno_domains_op = {
  21.462 -        .start          = xeno_domains_start,
  21.463 -        .next           = xeno_domains_next,
  21.464 -        .stop           = xeno_domains_stop,
  21.465 -        .show           = xeno_domains_show,
  21.466 -};
  21.467 -
  21.468 -static int xeno_domains_open(struct inode *inode, struct file *file)
  21.469 -{
  21.470 -        return seq_open(file, &xeno_domains_op);
  21.471 -}
  21.472 -
  21.473 -static struct file_operations proc_xeno_domains_operations = {
  21.474 -        open:           xeno_domains_open,
  21.475 -        read:           seq_read,
  21.476 -        llseek:         seq_lseek,
  21.477 -        release:        seq_release,
  21.478 -};
  21.479 -
  21.480 -/***********************************************************************/
  21.481 -
  21.482 -
  21.483 -
  21.484 -static int __init init_module(void)
  21.485 -{
  21.486 -    /* xeno proc root setup */
  21.487 -    xeno_base = proc_mkdir(XENO_BASE, &proc_root); 
  21.488 -
  21.489 -    /* xeno control interface */
  21.490 -    *readbuf = '\0';
  21.491 -    dom0_cmd_intf = create_proc_entry (DOM0_CMD_INTF, 0600, xeno_base);
  21.492 -    if ( dom0_cmd_intf != NULL )
  21.493 -    {
  21.494 -        dom0_cmd_intf->owner      = THIS_MODULE;
  21.495 -        dom0_cmd_intf->nlink      = 1;
  21.496 -        dom0_cmd_intf->read_proc  = cmd_read_proc;
  21.497 -        dom0_cmd_intf->write_proc = cmd_write_proc;
  21.498 -    }
  21.499 -
  21.500 -    /* domain list interface */
  21.501 -    dom_list_intf = create_proc_entry (DOM_LIST_INTF, 0400, xeno_base);
  21.502 -    if ( dom_list_intf != NULL )
  21.503 -      {
  21.504 -        dom_list_intf -> owner = THIS_MODULE;
  21.505 -        dom_list_intf -> nlink = 1;
  21.506 -        dom_list_intf -> proc_fops = &proc_xeno_domains_operations;
  21.507 -      }
  21.508 -
  21.509 -    /* set up /proc entries for dom 0 */
  21.510 -    create_proc_dom_entries(0);
  21.511 -
  21.512 -    return 0;
  21.513 -}
  21.514 -
  21.515 -
  21.516 -static void __exit cleanup_module(void)
  21.517 -{
  21.518 -    if ( dom0_cmd_intf == NULL ) return;
  21.519 -    remove_proc_entry("dom0", &proc_root);
  21.520 -    dom0_cmd_intf = NULL;
  21.521 -}
  21.522 -
  21.523 -
  21.524 -module_init(init_module);
  21.525 -module_exit(cleanup_module);
    22.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_memory.c	Tue Jun 24 12:05:12 2003 +0000
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,368 +0,0 @@
    22.4 -#include <linux/slab.h>
    22.5 -#include <linux/mm.h>
    22.6 -#include <linux/mman.h>
    22.7 -#include <linux/swap.h>
    22.8 -#include <linux/smp_lock.h>
    22.9 -#include <linux/swapctl.h>
   22.10 -#include <linux/iobuf.h>
   22.11 -#include <linux/highmem.h>
   22.12 -#include <linux/pagemap.h>
   22.13 -#include <linux/list.h>
   22.14 -
   22.15 -#include <asm/pgalloc.h>
   22.16 -#include <asm/uaccess.h>
   22.17 -#include <asm/tlb.h>
   22.18 -#include <asm/mmu.h>
   22.19 -
   22.20 -#include "dom0_ops.h"
   22.21 -
   22.22 -#define MAP_CONT    0
   22.23 -#define MAP_DISCONT 1
   22.24 -
   22.25 -extern struct list_head * find_direct(struct list_head *, unsigned long);
   22.26 -
   22.27 -/*
   22.28 - * bd240: functions below perform direct mapping to the real physical pages
   22.29 - * needed for mapping various hypervisor specific structures needed in dom0
   22.30 - * userspace by various management applications such as domain builder etc.
   22.31 - */
   22.32 -
   22.33 -#define direct_set_pte(pteptr, pteval) queue_l1_entry_update(__pa(pteptr)|PGREQ_UNCHECKED_UPDATE, (pteval).pte_low)
   22.34 -
   22.35 -#define direct_pte_clear(pteptr) queue_l1_entry_update(__pa(pteptr)|PGREQ_UNCHECKED_UPDATE, 0)
   22.36 -
   22.37 -#define __direct_pte(x) ((pte_t) { (x) } )
   22.38 -#define __direct_mk_pte(page_nr,pgprot) __direct_pte(((page_nr) << PAGE_SHIFT) | pgprot_val(pgprot))
   22.39 -#define direct_mk_pte_phys(physpage, pgprot)   __direct_mk_pte((physpage) >> PAGE_SHIFT, pgprot)
   22.40 -
   22.41 -static inline void forget_pte(pte_t page)
   22.42 -{
   22.43 -    if (!pte_none(page)) {
   22.44 -        printk("forget_pte: old mapping existed!\n");
   22.45 -        BUG();
   22.46 -    }
   22.47 -}
   22.48 -
   22.49 -static inline void direct_remappte_range(pte_t * pte, unsigned long address, unsigned long size,
   22.50 -	unsigned long phys_addr, pgprot_t prot)
   22.51 -{
   22.52 -	unsigned long end;
   22.53 -
   22.54 -	address &= ~PMD_MASK;
   22.55 -	end = address + size;
   22.56 -	if (end > PMD_SIZE)
   22.57 -		end = PMD_SIZE;
   22.58 -	do {
   22.59 -		pte_t oldpage;
   22.60 -		oldpage = ptep_get_and_clear(pte);
   22.61 -
   22.62 - 		direct_set_pte(pte, direct_mk_pte_phys(phys_addr, prot));
   22.63 -
   22.64 -		forget_pte(oldpage);
   22.65 -		address += PAGE_SIZE;
   22.66 -		phys_addr += PAGE_SIZE;
   22.67 -		pte++;
   22.68 -	} while (address && (address < end));
   22.69 -
   22.70 -}
   22.71 -
   22.72 -static inline int direct_remappmd_range(struct mm_struct *mm, pmd_t * pmd, unsigned long address, unsigned long size,
   22.73 -	unsigned long phys_addr, pgprot_t prot)
   22.74 -{
   22.75 -	unsigned long end;
   22.76 -
   22.77 -	address &= ~PGDIR_MASK;
   22.78 -	end = address + size;
   22.79 -	if (end > PGDIR_SIZE)
   22.80 -		end = PGDIR_SIZE;
   22.81 -	phys_addr -= address;
   22.82 -	do {
   22.83 -		pte_t * pte = pte_alloc(mm, pmd, address);
   22.84 -		if (!pte)
   22.85 -			return -ENOMEM;
   22.86 -		direct_remappte_range(pte, address, end - address, address + phys_addr, prot);
   22.87 -		address = (address + PMD_SIZE) & PMD_MASK;
   22.88 -		pmd++;
   22.89 -	} while (address && (address < end));
   22.90 -	return 0;
   22.91 -}
   22.92 -
   22.93 -/*  Note: this is only safe if the mm semaphore is held when called. */
   22.94 -int direct_remap_page_range(unsigned long from, unsigned long phys_addr, unsigned long size, pgprot_t prot)
   22.95 -{
   22.96 -	int error = 0;
   22.97 -	pgd_t * dir;
   22.98 -	unsigned long beg = from;
   22.99 -	unsigned long end = from + size;
  22.100 -	struct mm_struct *mm = current->mm;
  22.101 -
  22.102 -	phys_addr -= from;
  22.103 -	dir = pgd_offset(mm, from);
  22.104 -	flush_cache_range(mm, beg, end);
  22.105 -	if (from >= end)
  22.106 -		BUG();
  22.107 -
  22.108 -	spin_lock(&mm->page_table_lock);
  22.109 -	do {
  22.110 -		pmd_t *pmd = pmd_alloc(mm, dir, from);
  22.111 -		error = -ENOMEM;
  22.112 -		if (!pmd)
  22.113 -			break;
  22.114 -		error = direct_remappmd_range(mm, pmd, from, end - from, phys_addr + from, prot);
  22.115 -		if (error)
  22.116 -			break;
  22.117 -		from = (from + PGDIR_SIZE) & PGDIR_MASK;
  22.118 -		dir++;
  22.119 -	} while (from && (from < end));
  22.120 -	spin_unlock(&mm->page_table_lock);
  22.121 -	flush_tlb_range(mm, beg, end);
  22.122 -	return error;
  22.123 -}
  22.124 -
  22.125 -/* 
  22.126 - * used for remapping discontiguous bits of domain's memory, pages to map are
  22.127 - * found from frame table beginning at the given first_pg index
  22.128 - */ 
  22.129 -int direct_remap_disc_page_range(unsigned long from, 
  22.130 -                unsigned long first_pg, int tot_pages, pgprot_t prot)
  22.131 -{
  22.132 -    dom0_op_t dom0_op;
  22.133 -    unsigned long *pfns = get_free_page(GFP_KERNEL);
  22.134 -    unsigned long start = from;
  22.135 -    int pages, i;
  22.136 -
  22.137 -    while ( tot_pages != 0 )
  22.138 -    {
  22.139 -        dom0_op.cmd = DOM0_GETMEMLIST;
  22.140 -        dom0_op.u.getmemlist.start_pfn = first_pg;
  22.141 -        pages = 1023;
  22.142 -        dom0_op.u.getmemlist.num_pfns = 1024;
  22.143 -        if ( tot_pages < 1024 )
  22.144 -            dom0_op.u.getmemlist.num_pfns = pages = tot_pages;
  22.145 -        dom0_op.u.getmemlist.buffer = pfns;
  22.146 -        (void)HYPERVISOR_dom0_op(&dom0_op);
  22.147 -        first_pg = pfns[1023]; 
  22.148 -
  22.149 -        for ( i = 0; i < pages; i++ )
  22.150 -        {
  22.151 -            if(direct_remap_page_range(start, pfns[i] << PAGE_SHIFT, 
  22.152 -                                       PAGE_SIZE, prot))
  22.153 -                goto out;
  22.154 -            start += PAGE_SIZE;
  22.155 -            tot_pages--;
  22.156 -        }
  22.157 -    }
  22.158 -
  22.159 -out:
  22.160 -    free_page(pfns);
  22.161 -    return tot_pages;
  22.162 -} 
  22.163 -           
  22.164 -/* below functions replace standard sys_mmap and sys_munmap which are absolutely useless
  22.165 - * for direct memory mapping. direct_zap* functions are minor ammendments to the 
  22.166 - * original versions in mm/memory.c. the changes are to enable unmapping of real physical
  22.167 - * addresses.
  22.168 - */
  22.169 -
  22.170 -unsigned long direct_mmap(unsigned long phys_addr, unsigned long size, 
  22.171 -                pgprot_t prot, int flag, int tot_pages)
  22.172 -{
  22.173 -    direct_mmap_node_t * dmmap;
  22.174 -    struct list_head * entry;
  22.175 -    unsigned long addr;
  22.176 -    int ret = 0;
  22.177 -    
  22.178 -    if(!capable(CAP_SYS_ADMIN)){
  22.179 -        ret = -EPERM;
  22.180 -        goto out;
  22.181 -    }
  22.182 -
  22.183 -    /* get unmapped area invokes xen specific arch_get_unmapped_area */
  22.184 -    addr = get_unmapped_area(NULL, 0, size, 0, 0);
  22.185 -    if(addr & ~PAGE_MASK){
  22.186 -        ret = -ENOMEM;
  22.187 -        goto out;
  22.188 -    }
  22.189 -
  22.190 -    /* add node on the list of directly mapped areas, make sure the
  22.191 -     * list remains sorted.
  22.192 -     */ 
  22.193 -    dmmap = (direct_mmap_node_t *)kmalloc(sizeof(direct_mmap_node_t), GFP_KERNEL);
  22.194 -    dmmap->vm_start = addr;
  22.195 -    dmmap->vm_end = addr + size;
  22.196 -	entry = find_direct(&current->mm->context.direct_list, addr);
  22.197 -	if(entry != &current->mm->context.direct_list){
  22.198 -		list_add_tail(&dmmap->list, entry);
  22.199 -	} else {
  22.200 -    	list_add_tail(&dmmap->list, &current->mm->context.direct_list);
  22.201 -	}
  22.202 -
  22.203 -    /* and perform the mapping */
  22.204 -    if(flag == MAP_DISCONT){
  22.205 -        ret = direct_remap_disc_page_range(addr, phys_addr >> PAGE_SHIFT, 
  22.206 -            tot_pages, prot);
  22.207 -    } else {
  22.208 -        ret = direct_remap_page_range(addr, phys_addr, size, prot);
  22.209 -    }
  22.210 -
  22.211 -    if(ret == 0)
  22.212 -        ret = addr;
  22.213 -
  22.214 -out: 
  22.215 -    return ret;
  22.216 -}
  22.217 -
  22.218 -/* most of the checks, refcnt updates, cache stuff have been thrown out as they are not
  22.219 - * needed
  22.220 - */
  22.221 -static inline int direct_zap_pte_range(mmu_gather_t *tlb, pmd_t * pmd, unsigned long address, 
  22.222 -                unsigned long size)
  22.223 -{
  22.224 -	unsigned long offset;
  22.225 -	pte_t * ptep;
  22.226 -	int freed = 0;
  22.227 -
  22.228 -	if (pmd_none(*pmd))
  22.229 -		return 0;
  22.230 -	if (pmd_bad(*pmd)) {
  22.231 -		pmd_ERROR(*pmd);
  22.232 -		pmd_clear(pmd);
  22.233 -		return 0;
  22.234 -	}
  22.235 -	ptep = pte_offset(pmd, address);
  22.236 -	offset = address & ~PMD_MASK;
  22.237 -	if (offset + size > PMD_SIZE)
  22.238 -		size = PMD_SIZE - offset;
  22.239 -	size &= PAGE_MASK;
  22.240 -	for (offset=0; offset < size; ptep++, offset += PAGE_SIZE) {
  22.241 -		pte_t pte = *ptep;
  22.242 -		if (pte_none(pte))
  22.243 -			continue;
  22.244 -		freed ++;
  22.245 -		direct_pte_clear(ptep);
  22.246 -	}
  22.247 -
  22.248 -	return freed;
  22.249 -}
  22.250 -
  22.251 -static inline int direct_zap_pmd_range(mmu_gather_t *tlb, pgd_t * dir, 
  22.252 -                unsigned long address, unsigned long size)
  22.253 -{
  22.254 -	pmd_t * pmd;
  22.255 -	unsigned long end;
  22.256 -	int freed;
  22.257 -
  22.258 -	if (pgd_none(*dir))
  22.259 -		return 0;
  22.260 -	if (pgd_bad(*dir)) {
  22.261 -		pgd_ERROR(*dir);
  22.262 -		pgd_clear(dir);
  22.263 -		return 0;
  22.264 -	}
  22.265 -	pmd = pmd_offset(dir, address);
  22.266 -	end = address + size;
  22.267 -	if (end > ((address + PGDIR_SIZE) & PGDIR_MASK))
  22.268 -		end = ((address + PGDIR_SIZE) & PGDIR_MASK);
  22.269 -	freed = 0;
  22.270 -	do {
  22.271 -		freed += direct_zap_pte_range(tlb, pmd, address, end - address);
  22.272 -		address = (address + PMD_SIZE) & PMD_MASK; 
  22.273 -		pmd++;
  22.274 -	} while (address < end);
  22.275 -	return freed;
  22.276 -}
  22.277 -
  22.278 -/*
  22.279 - * remove user pages in a given range.
  22.280 - */
  22.281 -void direct_zap_page_range(struct mm_struct *mm, unsigned long address, unsigned long size)
  22.282 -{
  22.283 -	mmu_gather_t *tlb;
  22.284 -	pgd_t * dir;
  22.285 -	unsigned long start = address, end = address + size;
  22.286 -	int freed = 0;
  22.287 -
  22.288 -	dir = pgd_offset(mm, address);
  22.289 -
  22.290 -	/*
  22.291 -	 * This is a long-lived spinlock. That's fine.
  22.292 -	 * There's no contention, because the page table
  22.293 -	 * lock only protects against kswapd anyway, and
  22.294 -	 * even if kswapd happened to be looking at this
  22.295 -	 * process we _want_ it to get stuck.
  22.296 -	 */
  22.297 -	if (address >= end)
  22.298 -		BUG();
  22.299 -	spin_lock(&mm->page_table_lock);
  22.300 -	flush_cache_range(mm, address, end);
  22.301 -	tlb = tlb_gather_mmu(mm);
  22.302 -
  22.303 -	do {
  22.304 -		freed += direct_zap_pmd_range(tlb, dir, address, end - address);
  22.305 -		address = (address + PGDIR_SIZE) & PGDIR_MASK;
  22.306 -		dir++;
  22.307 -	} while (address && (address < end));
  22.308 -
  22.309 -	/* this will flush any remaining tlb entries */
  22.310 -	tlb_finish_mmu(tlb, start, end);
  22.311 -
  22.312 -    /* decrementing rss removed */
  22.313 -
  22.314 -	spin_unlock(&mm->page_table_lock);
  22.315 -}
  22.316 -
  22.317 -int direct_unmap(unsigned long addr, unsigned long size)
  22.318 -{
  22.319 -    direct_mmap_node_t * node;
  22.320 -    struct list_head * curr;
  22.321 -    struct list_head * direct_list = &current->mm->context.direct_list;    
  22.322 -
  22.323 -    curr = direct_list->next;
  22.324 -    while(curr != direct_list){
  22.325 -        node = list_entry(curr, direct_mmap_node_t, list);
  22.326 -        if(node->vm_start == addr)
  22.327 -            break;
  22.328 -        curr = curr->next;
  22.329 -    }
  22.330 -
  22.331 -    if(curr == direct_list)
  22.332 -        return -1;
  22.333 -
  22.334 -    list_del(&node->list);
  22.335 -    kfree(node);
  22.336 -
  22.337 -    direct_zap_page_range(current->mm, addr, size);
  22.338 - 
  22.339 -    return 0;
  22.340 -}
  22.341 -
  22.342 -int direct_disc_unmap(unsigned long from, unsigned long first_pg, int tot_pages)
  22.343 -{
  22.344 -    int count = 0;
  22.345 -    direct_mmap_node_t * node;
  22.346 -    struct list_head * curr;
  22.347 -    struct list_head * direct_list = &current->mm->context.direct_list;    
  22.348 -
  22.349 -    curr = direct_list->next;
  22.350 -    while(curr != direct_list){
  22.351 -        node = list_entry(curr, direct_mmap_node_t, list);
  22.352 -
  22.353 -        if(node->vm_start == from)
  22.354 -            break;
  22.355 -        curr = curr->next;
  22.356 -    }
  22.357 -
  22.358 -    if(curr == direct_list)
  22.359 -        return -1;
  22.360 -
  22.361 -    list_del(&node->list);
  22.362 -    kfree(node);
  22.363 -
  22.364 -    while(count < tot_pages){
  22.365 -            direct_zap_page_range(current->mm, from, PAGE_SIZE);
  22.366 -            from += PAGE_SIZE;
  22.367 -            count++;
  22.368 -    }
  22.369 -
  22.370 -    return 0;
  22.371 -} 
    23.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/dom0_ops.h	Tue Jun 24 12:05:12 2003 +0000
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,57 +0,0 @@
    23.4 -/******************************************************************************
    23.5 - * dom0_ops.h
    23.6 - * 
    23.7 - * Process command requests from domain-0 guest OS.
    23.8 - * This file includes the Xen part of the interface, plus the extra stuff
    23.9 - * that is dealt with by Xenolinux without being handed down to Xen.
   23.10 - * 
   23.11 - * Copyright (c) 2002-2003, K A Fraser, B Dragovic
   23.12 - */
   23.13 -
   23.14 -#ifndef __DOM0_DOM0_OPS_H__
   23.15 -#define __DOM0_DOM0_OPS_H__
   23.16 -
   23.17 -/* External users of this header file will include Xen's version separately. */
   23.18 -#ifdef __KERNEL__
   23.19 -#define NO_DOM0_OP_T
   23.20 -#include <asm/hypervisor-ifs/dom0_ops.h>
   23.21 -#endif
   23.22 -
   23.23 -/* Extra commands dealt with by Xenolinux. */
   23.24 -#define MAP_DOM_MEM        14
   23.25 -#define DO_PGUPDATES       15
   23.26 -#define MAX_CMD            16
   23.27 -
   23.28 -typedef struct dom_mem 
   23.29 -{
   23.30 -    unsigned int domain;
   23.31 -    unsigned long vaddr;
   23.32 -    unsigned long start_pfn;
   23.33 -    int tot_pages;
   23.34 -} dom_mem_t;
   23.35 -
   23.36 -typedef struct dom_pgupdate
   23.37 -{
   23.38 -    unsigned long pgt_update_arr;
   23.39 -    unsigned long num_pgt_updates;
   23.40 -} dom_pgupdate_t;
   23.41 -
   23.42 -typedef struct dom0_op_st
   23.43 -{
   23.44 -    unsigned long cmd;
   23.45 -    union
   23.46 -    {
   23.47 -        dom0_newdomain_t newdomain;
   23.48 -        dom0_killdomain_t killdomain;
   23.49 -        dom0_getmemlist_t getmemlist;
   23.50 -        dom0_bvtctl_t bvtctl;
   23.51 -        dom0_adjustdom_t adjustdom;
   23.52 -        dom_mem_t dommem;
   23.53 -        dom_pgupdate_t pgupdate;
   23.54 -        dom_meminfo_t meminfo;
   23.55 -        dom0_getdominfo_t getdominfo;
   23.56 -   }
   23.57 -    u;
   23.58 -} dom0_op_t;
   23.59 -
   23.60 -#endif /* __DOM0_DOM0_OPS_H__ */
    24.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/sched_ops.c	Tue Jun 24 12:05:12 2003 +0000
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,137 +0,0 @@
    24.4 -/* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
    24.5 - ****************************************************************************
    24.6 - * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
    24.7 - ****************************************************************************
    24.8 - *
    24.9 - *        File: sched_ops.c
   24.10 - *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
   24.11 - *     Changes: 
   24.12 - *              
   24.13 - *        Date: Mar 2003
   24.14 - * 
   24.15 - * Environment: XenoLinux
   24.16 - * Description: Dom0 Control interface to scheduler in Xen
   24.17 - *
   24.18 - * code based on Andy's vfr parsing code
   24.19 - *
   24.20 - * Commands understood by the interface:
   24.21 - *
   24.22 - * C <context swith allowance>
   24.23 - * S <did> <mcu advance> <warp> <warp limit> <unwarp limit>
   24.24 - *
   24.25 - ****************************************************************************
   24.26 - * $Id: c-insert.c,v 1.7 2002/11/08 16:04:34 rn Exp $
   24.27 - ****************************************************************************
   24.28 - */
   24.29 -
   24.30 -#include <linux/config.h>
   24.31 -#include <linux/module.h>
   24.32 -#include <linux/kernel.h>
   24.33 -#include <linux/sched.h>
   24.34 -#include <linux/ctype.h>
   24.35 -#include <linux/string.h>
   24.36 -#include <linux/errno.h>
   24.37 -#include <linux/proc_fs.h>
   24.38 -
   24.39 -#include "dom0_ops.h"
   24.40 -
   24.41 -#define SCHED_ENTRY    "sched"
   24.42 -extern struct proc_dir_entry *xeno_base;
   24.43 -static struct proc_dir_entry *sched_pde;
   24.44 -
   24.45 -static unsigned char readbuf[1024];
   24.46 -
   24.47 -static int sched_read_proc(char *page, char **start, off_t off,
   24.48 -                           int count, int *eof, void *data)
   24.49 -{   
   24.50 -    strcpy(page, readbuf);
   24.51 -    *readbuf = '\0';
   24.52 -    *eof = 1;
   24.53 -    *start = page;
   24.54 -    return strlen(page);
   24.55 -}
   24.56 -
   24.57 -
   24.58 -static int sched_write_proc(struct file *file, const char *buffer,
   24.59 -                            u_long count, void *data)
   24.60 -{
   24.61 -    dom0_op_t op;
   24.62 -
   24.63 -    int ret, len;
   24.64 -    int ts, te, tl; /* token start, end, and length */
   24.65 -
   24.66 -    /* Only admin can adjust scheduling parameters */
   24.67 -    if ( !capable(CAP_SYS_ADMIN) )
   24.68 -        return -EPERM;
   24.69 -
   24.70 -    /* parse the commands  */
   24.71 -    len = count;
   24.72 -    ts = te = 0;
   24.73 -
   24.74 -    while ( count && isspace(buffer[ts]) ) { ts++; count--; } /*skip spaces*/
   24.75 -    te = ts;
   24.76 -    while ( count && !isspace(buffer[te]) ) { te++; count--; } /*command end*/
   24.77 -    if ( te <= ts ) goto bad;
   24.78 -    tl = te - ts;
   24.79 -
   24.80 -    if ( strncmp(&buffer[ts], "C", tl) == 0 ) {
   24.81 -        op.cmd = DOM0_BVTCTL;
   24.82 -    } else if ( strncmp(&buffer[ts], "S", tl) == 0 ) {
   24.83 -        op.cmd = DOM0_ADJUSTDOM;
   24.84 -    } else
   24.85 -        goto bad;
   24.86 -
   24.87 -    /* skip whitspaces and get first parameter */
   24.88 -    ts = te; while ( count &&  isspace(buffer[ts]) ) { ts++; count--; }
   24.89 -    te = ts; while ( count && !isspace(buffer[te]) ) { te++; count--; }
   24.90 -    if ( te <= ts ) goto bad;
   24.91 -    tl = te - ts;
   24.92 -    if ( !isdigit(buffer[ts]) ) goto bad;
   24.93 -
   24.94 -    if (op.cmd == DOM0_BVTCTL) {
   24.95 -        /* get context switch allowance  */
   24.96 -        sscanf(&buffer[ts], "%lu", &op.u.bvtctl.ctx_allow);
   24.97 -    } else if (op.cmd == DOM0_ADJUSTDOM) {
   24.98 -        sscanf(&buffer[ts], "%u %lu %lu %lu %lu",
   24.99 -               &op.u.adjustdom.domain,
  24.100 -               &op.u.adjustdom.mcu_adv,
  24.101 -               &op.u.adjustdom.warp,
  24.102 -               &op.u.adjustdom.warpl,
  24.103 -               &op.u.adjustdom.warpu);
  24.104 -    }
  24.105 -    ret = HYPERVISOR_dom0_op(&op);
  24.106 -    return sizeof(op);
  24.107 -    
  24.108 - bad:
  24.109 -    return -EINVAL;
  24.110 -
  24.111 -}
  24.112 -
  24.113 -
  24.114 -/*
  24.115 - * main scheduler interface driver driver initialization function.
  24.116 - */
  24.117 -static int __init init_module(void)
  24.118 -{
  24.119 -    printk(KERN_ALERT "Starting Domain Scheduler Control Interface\n");
  24.120 -
  24.121 -    sched_pde = create_proc_entry(SCHED_ENTRY, 0600, xeno_base);
  24.122 -    if ( sched_pde == NULL )
  24.123 -    {
  24.124 -        printk(KERN_ALERT "Unable to create dom scheduler proc entry!");
  24.125 -        return -1;
  24.126 -    }
  24.127 -
  24.128 -    sched_pde->read_proc  = sched_read_proc;
  24.129 -    sched_pde->write_proc = sched_write_proc;
  24.130 -
  24.131 -    return 0;
  24.132 -}
  24.133 -
  24.134 -static void __exit cleanup_module(void)
  24.135 -{
  24.136 -}
  24.137 -
  24.138 -module_init(init_module);
  24.139 -module_exit(cleanup_module);
  24.140 -
    25.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/dom0/vfr.c	Tue Jun 24 12:05:12 2003 +0000
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,321 +0,0 @@
    25.4 -/******************************************************************************
    25.5 - * vfr.c
    25.6 - *
    25.7 - * Interface to the virtual firewall/router.
    25.8 - *
    25.9 - */
   25.10 -
   25.11 -#include <linux/config.h>
   25.12 -#include <linux/module.h>
   25.13 -#include <linux/kernel.h>
   25.14 -#include <linux/sched.h>
   25.15 -#include <linux/slab.h>
   25.16 -#include <linux/string.h>
   25.17 -#include <linux/errno.h>
   25.18 -#include <linux/proc_fs.h>
   25.19 -
   25.20 -#include <asm/hypervisor-ifs/network.h>
   25.21 -
   25.22 -static struct proc_dir_entry *proc_vfr;
   25.23 -
   25.24 -static unsigned char readbuf[1024];
   25.25 -
   25.26 -/* Helpers, implemented at the bottom. */
   25.27 -u32 getipaddr(const char *buff, unsigned int len);
   25.28 -u16 antous(const char *buff, int len);
   25.29 -int anton(const char *buff, int len);
   25.30 -
   25.31 -static int vfr_read_proc(char *page, char **start, off_t off,
   25.32 -                         int count, int *eof, void *data)
   25.33 -{   
   25.34 -    strcpy(page, readbuf);
   25.35 -    *readbuf = '\0';
   25.36 -    *eof = 1;
   25.37 -    *start = page;
   25.38 -    return strlen(page);
   25.39 -}
   25.40 -
   25.41 -/* The format for the vfr interface is as follows:
   25.42 - *
   25.43 - *  COMMAND <field>=<val> [<field>=<val> [...]]
   25.44 - *
   25.45 - *  where:
   25.46 - *
   25.47 - *  COMMAND = { ACCEPT | COUNT }
   25.48 - *
   25.49 - *  field=val pairs are as follows:
   25.50 - *
   25.51 - *  field = { srcaddr | dstaddr }
   25.52 - *      val is a dot seperated, numeric IP address.
   25.53 - *
   25.54 - *  field = { srcport | dstport }
   25.55 - *      val is a (16-bit) unsigned int
   25.56 - *
   25.57 - *  field = { proto }
   25.58 - *      val = { IP | TCP | UDP | ARP }
   25.59 - *
   25.60 - */
   25.61 -
   25.62 -#define isspace(_x) ( ((_x)==' ')  || ((_x)=='\t') || ((_x)=='\v') || \
   25.63 -		      ((_x)=='\f') || ((_x)=='\r') || ((_x)=='\n') )
   25.64 -
   25.65 -static int vfr_write_proc(struct file *file, const char *buffer,
   25.66 -                          u_long count, void *data)
   25.67 -{
   25.68 -    network_op_t op;
   25.69 -    int ret, len;
   25.70 -    int ts, te, tl; // token start, end, and length
   25.71 -    int fs, fe, fl; // field.
   25.72 -
   25.73 -    len = count;
   25.74 -    ts = te = 0;
   25.75 -
   25.76 -    memset(&op, 0, sizeof(network_op_t));
   25.77 -
   25.78 -    // get the command:
   25.79 -    while ( count && isspace(buffer[ts]) ) { ts++; count--; } // skip spaces.
   25.80 -    te = ts;
   25.81 -    while ( count && !isspace(buffer[te]) ) { te++; count--; } // command end
   25.82 -    if ( te <= ts ) goto bad;
   25.83 -    tl = te - ts;
   25.84 -  
   25.85 -    if ( strncmp(&buffer[ts], "ADD", tl) == 0 )
   25.86 -    {
   25.87 -        op.cmd = NETWORK_OP_ADDRULE;
   25.88 -    }
   25.89 -    else if ( strncmp(&buffer[ts], "DELETE", tl) == 0 )
   25.90 -    {
   25.91 -        op.cmd = NETWORK_OP_DELETERULE;
   25.92 -    }
   25.93 -    else if ( strncmp(&buffer[ts], "PRINT", tl) == 0 )
   25.94 -    {
   25.95 -        op.cmd = NETWORK_OP_GETRULELIST;
   25.96 -        goto doneparsing;
   25.97 -    }
   25.98 -        
   25.99 -    ts = te;
  25.100 -  
  25.101 -    // get the action
  25.102 -    while ( count && (buffer[ts] == ' ') ) { ts++; count--; } // skip spaces.
  25.103 -    te = ts;
  25.104 -    while ( count && (buffer[te] != ' ') ) { te++; count--; } // command end
  25.105 -    if ( te <= ts ) goto bad;
  25.106 -    tl = te - ts;
  25.107 -
  25.108 -    if ( strncmp(&buffer[ts], "ACCEPT", tl) == 0 ) 
  25.109 -    {
  25.110 -        op.u.net_rule.action = NETWORK_ACTION_ACCEPT;
  25.111 -        goto keyval;
  25.112 -    }
  25.113 -    if ( strncmp(&buffer[ts], "COUNT", tl) == 0 ) 
  25.114 -    {
  25.115 -        op.u.net_rule.action = NETWORK_ACTION_COUNT;
  25.116 -        goto keyval;
  25.117 -    }
  25.118 -   
  25.119 -    // default case;
  25.120 -    return (len);
  25.121 -  
  25.122 -
  25.123 -    // get the key=val pairs.
  25.124 - keyval:
  25.125 -    while (count)
  25.126 -    {
  25.127 -        //get field
  25.128 -        ts = te; while ( count && isspace(buffer[ts]) ) { ts++; count--; }
  25.129 -        te = ts;
  25.130 -        while ( count && !isspace(buffer[te]) && (buffer[te] != '=') ) 
  25.131 -        { te++; count--; }
  25.132 -        if ( te <= ts )
  25.133 -            goto doneparsing;
  25.134 -        tl = te - ts;
  25.135 -        fs = ts; fe = te; fl = tl; // save the field markers.
  25.136 -        // skip "   =   " (ignores extra equals.)
  25.137 -        while ( count && (isspace(buffer[te]) || (buffer[te] == '=')) ) 
  25.138 -        { te++; count--; }
  25.139 -        ts = te;
  25.140 -        while ( count && !isspace(buffer[te]) ) { te++; count--; }
  25.141 -        tl = te - ts;
  25.142 -
  25.143 -        if ( (fl <= 0) || (tl <= 0) ) goto bad;
  25.144 -
  25.145 -        /* NB. Prefix matches must go first! */
  25.146 -        if (strncmp(&buffer[fs], "src", fl) == 0)
  25.147 -        {
  25.148 -            op.u.net_rule.src_vif = VIF_ANY_INTERFACE;
  25.149 -        }
  25.150 -        else if (strncmp(&buffer[fs], "dst", fl) == 0)
  25.151 -        {
  25.152 -            op.u.net_rule.dst_vif = VIF_PHYSICAL_INTERFACE;
  25.153 -        }
  25.154 -        else if (strncmp(&buffer[fs], "srcaddr", fl) == 0) 
  25.155 -        {  
  25.156 -            op.u.net_rule.src_addr = getipaddr(&buffer[ts], tl);
  25.157 -        }
  25.158 -        else if (strncmp(&buffer[fs], "dstaddr", fl) == 0)
  25.159 -        {    
  25.160 -            op.u.net_rule.dst_addr = getipaddr(&buffer[ts], tl);
  25.161 -        }
  25.162 -        else if (strncmp(&buffer[fs], "srcaddrmask", fl) == 0) 
  25.163 -        {
  25.164 -            op.u.net_rule.src_addr_mask = getipaddr(&buffer[ts], tl);
  25.165 -        }
  25.166 -        else if (strncmp(&buffer[fs], "dstaddrmask", fl) == 0)
  25.167 -        {
  25.168 -            op.u.net_rule.dst_addr_mask = getipaddr(&buffer[ts], tl);
  25.169 -        }
  25.170 -        else if (strncmp(&buffer[fs], "srcport", fl) == 0)
  25.171 -        {
  25.172 -            op.u.net_rule.src_port = antous(&buffer[ts], tl);
  25.173 -        }
  25.174 -        else if (strncmp(&buffer[fs], "dstport", fl) == 0)
  25.175 -        {
  25.176 -            op.u.net_rule.dst_port = antous(&buffer[ts], tl);
  25.177 -        }
  25.178 -        else if (strncmp(&buffer[fs], "srcportmask", fl) == 0)
  25.179 -        {
  25.180 -            op.u.net_rule.src_port_mask = antous(&buffer[ts], tl);
  25.181 -        }
  25.182 -        else if (strncmp(&buffer[fs], "dstportmask", fl) == 0)
  25.183 -        {
  25.184 -            op.u.net_rule.dst_port_mask = antous(&buffer[ts], tl);
  25.185 -        }
  25.186 -        else if (strncmp(&buffer[fs], "srcdom", fl) == 0)
  25.187 -        {
  25.188 -            op.u.net_rule.src_vif |= anton(&buffer[ts], tl)<<VIF_DOMAIN_SHIFT;
  25.189 -        }
  25.190 -        else if (strncmp(&buffer[fs], "srcidx", fl) == 0)
  25.191 -        {
  25.192 -            op.u.net_rule.src_vif |= anton(&buffer[ts], tl);
  25.193 -        }
  25.194 -        else if (strncmp(&buffer[fs], "dstdom", fl) == 0)
  25.195 -        {
  25.196 -            op.u.net_rule.dst_vif |= anton(&buffer[ts], tl)<<VIF_DOMAIN_SHIFT;
  25.197 -        }
  25.198 -        else if (strncmp(&buffer[fs], "dstidx", fl) == 0)
  25.199 -        {
  25.200 -            op.u.net_rule.dst_vif |= anton(&buffer[ts], tl);
  25.201 -        }
  25.202 -        else if ( (strncmp(&buffer[fs], "proto", fl) == 0))
  25.203 -        {	
  25.204 -            if (strncmp(&buffer[ts], "any", tl) == 0) 
  25.205 -                op.u.net_rule.proto = NETWORK_PROTO_ANY; 
  25.206 -            if (strncmp(&buffer[ts], "ip", tl) == 0)
  25.207 -                op.u.net_rule.proto = NETWORK_PROTO_IP;
  25.208 -            if (strncmp(&buffer[ts], "tcp", tl) == 0) 
  25.209 -                op.u.net_rule.proto = NETWORK_PROTO_TCP;
  25.210 -            if (strncmp(&buffer[ts], "udp", tl) == 0)
  25.211 -                op.u.net_rule.proto = NETWORK_PROTO_UDP;
  25.212 -            if (strncmp(&buffer[ts], "arp", tl) == 0)
  25.213 -                op.u.net_rule.proto = NETWORK_PROTO_ARP;
  25.214 -        }
  25.215 -    }
  25.216 -
  25.217 - doneparsing:  
  25.218 -    ret = HYPERVISOR_network_op(&op);
  25.219 -    return(len);
  25.220 -
  25.221 - bad:
  25.222 -    return(len);
  25.223 -    
  25.224 -    
  25.225 -}
  25.226 -
  25.227 -static int __init init_module(void)
  25.228 -{
  25.229 -    *readbuf = '\0';
  25.230 -    proc_vfr = create_proc_entry ("vfr", 0600, &proc_root);
  25.231 -    if ( proc_vfr != NULL )
  25.232 -    {
  25.233 -        proc_vfr->owner      = THIS_MODULE;
  25.234 -        proc_vfr->nlink      = 1;
  25.235 -        proc_vfr->read_proc  = vfr_read_proc;
  25.236 -        proc_vfr->write_proc = vfr_write_proc;
  25.237 -        printk("Successfully installed virtual firewall/router interface\n");
  25.238 -    }
  25.239 -    return 0;
  25.240 -}
  25.241 -
  25.242 -static void __exit cleanup_module(void)
  25.243 -{
  25.244 -    if ( proc_vfr == NULL ) return;
  25.245 -    remove_proc_entry("vfr", &proc_root);
  25.246 -    proc_vfr = NULL;
  25.247 -}
  25.248 -
  25.249 -module_init(init_module);
  25.250 -module_exit(cleanup_module);
  25.251 -
  25.252 -/* Helper functions start here: */
  25.253 -
  25.254 -int anton(const char *buff, int len)
  25.255 -{
  25.256 -    int ret;
  25.257 -    char c;
  25.258 -    int sign = 1;
  25.259 -    
  25.260 -    ret = 0;
  25.261 -
  25.262 -    if (len == 0) return 0;
  25.263 -    if (*buff == '-') { sign = -1; buff++; len--; }
  25.264 -
  25.265 -    while ( (len) && ((c = *buff) >= '0') && (c <= '9') )
  25.266 -    {
  25.267 -        ret *= 10;
  25.268 -        ret += c - '0';
  25.269 -        buff++; len--;
  25.270 -    }
  25.271 -
  25.272 -    ret *= sign;
  25.273 -    return ret;
  25.274 -}
  25.275 -    
  25.276 -u16 antous(const char *buff, int len)
  25.277 -{
  25.278 -    u16 ret;
  25.279 -    char c;
  25.280 -
  25.281 -    ret = 0;
  25.282 -
  25.283 -    while ( (len) && ((c = *buff) >= '0') && (c <= '9') )
  25.284 -    {
  25.285 -        ret *= 10;
  25.286 -        ret += c - '0';
  25.287 -        buff++; len--;
  25.288 -    }
  25.289 -
  25.290 -    return ret;
  25.291 -}
  25.292 -
  25.293 -u32 getipaddr(const char *buff, unsigned int len)
  25.294 -{
  25.295 -    char c;
  25.296 -    u32 ret, val;
  25.297 -
  25.298 -    ret = 0; val = 0;
  25.299 -
  25.300 -    while ( len )
  25.301 -    {
  25.302 -        if (!((((c = *buff) >= '0') && ( c <= '9')) || ( c == '.' ) ) ) 
  25.303 -        {
  25.304 -            return(0); // malformed.
  25.305 -        }
  25.306 -
  25.307 -        if ( c == '.' ) {
  25.308 -            if (val > 255) return (0); //malformed.
  25.309 -            ret = ret << 8; 
  25.310 -            ret += val;
  25.311 -            val = 0;
  25.312 -            len--; buff++;
  25.313 -            continue;
  25.314 -        }
  25.315 -        val *= 10;
  25.316 -        val += c - '0';
  25.317 -        buff++; len--;
  25.318 -    }
  25.319 -    ret = ret << 8;
  25.320 -    ret += val;
  25.321 -
  25.322 -    return (ret);
  25.323 -}
  25.324 -
    26.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/Makefile	Tue Jun 24 12:05:12 2003 +0000
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,3 +0,0 @@
    26.4 -O_TARGET := net.o
    26.5 -obj-y := network.o
    26.6 -include $(TOPDIR)/Rules.make
    27.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/network.c	Tue Jun 24 12:05:12 2003 +0000
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,608 +0,0 @@
    27.4 -/******************************************************************************
    27.5 - * network.c
    27.6 - * 
    27.7 - * Virtual network driver for XenoLinux.
    27.8 - * 
    27.9 - * Copyright (c) 2002-2003, K A Fraser
   27.10 - */
   27.11 -
   27.12 -#include <linux/config.h>
   27.13 -#include <linux/module.h>
   27.14 -
   27.15 -#include <linux/kernel.h>
   27.16 -#include <linux/sched.h>
   27.17 -#include <linux/slab.h>
   27.18 -#include <linux/string.h>
   27.19 -#include <linux/errno.h>
   27.20 -
   27.21 -#include <linux/netdevice.h>
   27.22 -#include <linux/inetdevice.h>
   27.23 -#include <linux/etherdevice.h>
   27.24 -#include <linux/skbuff.h>
   27.25 -#include <linux/init.h>
   27.26 -
   27.27 -#include <asm/io.h>
   27.28 -#include <net/sock.h>
   27.29 -#include <net/pkt_sched.h>
   27.30 -
   27.31 -#define NET_TX_IRQ _EVENT_NET_TX
   27.32 -#define NET_RX_IRQ _EVENT_NET_RX
   27.33 -
   27.34 -#define TX_MAX_ENTRIES (TX_RING_SIZE - 2)
   27.35 -#define RX_MAX_ENTRIES (RX_RING_SIZE - 2)
   27.36 -
   27.37 -#define TX_RING_INC(_i)    (((_i)+1) & (TX_RING_SIZE-1))
   27.38 -#define RX_RING_INC(_i)    (((_i)+1) & (RX_RING_SIZE-1))
   27.39 -#define TX_RING_ADD(_i,_j) (((_i)+(_j)) & (TX_RING_SIZE-1))
   27.40 -#define RX_RING_ADD(_i,_j) (((_i)+(_j)) & (RX_RING_SIZE-1))
   27.41 -
   27.42 -#define RX_BUF_SIZE ((PAGE_SIZE/2)+1) /* Fool the slab allocator :-) */
   27.43 -
   27.44 -static void network_rx_int(int irq, void *dev_id, struct pt_regs *ptregs);
   27.45 -static void network_tx_int(int irq, void *dev_id, struct pt_regs *ptregs);
   27.46 -static void network_tx_buf_gc(struct net_device *dev);
   27.47 -static void network_alloc_rx_buffers(struct net_device *dev);
   27.48 -static void network_free_rx_buffers(struct net_device *dev);
   27.49 -static void cleanup_module(void);
   27.50 -
   27.51 -static struct list_head dev_list;
   27.52 -
   27.53 -struct net_private
   27.54 -{
   27.55 -    struct list_head list;
   27.56 -    struct net_device *dev;
   27.57 -
   27.58 -    struct net_device_stats stats;
   27.59 -    atomic_t tx_entries;
   27.60 -    unsigned int rx_resp_cons, tx_resp_cons, tx_full;
   27.61 -    net_ring_t *net_ring;
   27.62 -    net_idx_t  *net_idx;
   27.63 -    spinlock_t tx_lock;
   27.64 -    unsigned int idx; /* Domain-specific index of this VIF. */
   27.65 -
   27.66 -    /*
   27.67 -     * {tx,rx}_skbs store outstanding skbuffs. The first entry in each
   27.68 -     * array is an index into a chain of free entries.
   27.69 -     */
   27.70 -    struct sk_buff *tx_skbs[TX_RING_SIZE];
   27.71 -    struct sk_buff *rx_skbs[RX_RING_SIZE];
   27.72 -};
   27.73 -
   27.74 -/* Access macros for acquiring freeing slots in {tx,rx}_skbs[]. */
   27.75 -#define ADD_ID_TO_FREELIST(_list, _id)             \
   27.76 -    (_list)[(_id)] = (_list)[0];                   \
   27.77 -    (_list)[0]     = (void *)(unsigned long)(_id);
   27.78 -#define GET_ID_FROM_FREELIST(_list)                \
   27.79 - ({ unsigned long _id = (unsigned long)(_list)[0]; \
   27.80 -    (_list)[0]  = (_list)[_id];                    \
   27.81 -    _id; })
   27.82 -
   27.83 -
   27.84 -static void dbg_network_int(int irq, void *dev_id, struct pt_regs *ptregs)
   27.85 -{
   27.86 -    struct net_device *dev = (struct net_device *)dev_id;
   27.87 -    struct net_private *np = dev->priv;
   27.88 -    printk(KERN_ALERT "tx_full = %d, tx_entries = %d, tx_resp_cons = %d,"
   27.89 -           " tx_req_prod = %d, tx_resp_prod = %d, tx_event = %d, state=%d\n",
   27.90 -           np->tx_full, atomic_read(&np->tx_entries), np->tx_resp_cons, 
   27.91 -           np->net_idx->tx_req_prod, np->net_idx->tx_resp_prod, 
   27.92 -           np->net_idx->tx_event,
   27.93 -           test_bit(__LINK_STATE_XOFF, &dev->state));
   27.94 -    printk(KERN_ALERT "rx_resp_cons = %d,"
   27.95 -           " rx_req_prod = %d, rx_resp_prod = %d, rx_event = %d\n",
   27.96 -           np->rx_resp_cons, np->net_idx->rx_req_prod,
   27.97 -           np->net_idx->rx_resp_prod, np->net_idx->rx_event);
   27.98 -}
   27.99 -
  27.100 -
  27.101 -static int network_open(struct net_device *dev)
  27.102 -{
  27.103 -    struct net_private *np = dev->priv;
  27.104 -    int i, error = 0;
  27.105 -
  27.106 -    np->rx_resp_cons = np->tx_resp_cons = np->tx_full = 0;
  27.107 -    memset(&np->stats, 0, sizeof(np->stats));
  27.108 -    spin_lock_init(&np->tx_lock);
  27.109 -    atomic_set(&np->tx_entries, 0);
  27.110 -    memset(np->net_ring, 0, sizeof(*np->net_ring));
  27.111 -    memset(np->net_idx, 0, sizeof(*np->net_idx));
  27.112 -
  27.113 -    /* Initialise {tx,rx}_skbs to be a free chain containing every entry. */
  27.114 -    for ( i = 0; i < TX_RING_SIZE; i++ )
  27.115 -        np->tx_skbs[i] = (void *)(i+1);
  27.116 -    for ( i = 0; i < RX_RING_SIZE; i++ )
  27.117 -        np->rx_skbs[i] = (void *)(i+1);
  27.118 -
  27.119 -    network_alloc_rx_buffers(dev);
  27.120 -
  27.121 -    error = request_irq(NET_RX_IRQ, network_rx_int, 
  27.122 -                        SA_SAMPLE_RANDOM, "net-rx", dev);
  27.123 -    if ( error )
  27.124 -    {
  27.125 -        printk(KERN_WARNING "%s: Could not allocate receive interrupt\n",
  27.126 -               dev->name);
  27.127 -        network_free_rx_buffers(dev);
  27.128 -        goto fail;
  27.129 -    }
  27.130 -
  27.131 -    error = request_irq(NET_TX_IRQ, network_tx_int, 
  27.132 -                        SA_SAMPLE_RANDOM, "net-tx", dev);
  27.133 -    if ( error )
  27.134 -    {
  27.135 -        printk(KERN_WARNING "%s: Could not allocate transmit interrupt\n",
  27.136 -               dev->name);
  27.137 -        free_irq(NET_RX_IRQ, dev);
  27.138 -        network_free_rx_buffers(dev);
  27.139 -        goto fail;
  27.140 -    }
  27.141 -
  27.142 -    error = request_irq(_EVENT_DEBUG, dbg_network_int, SA_SHIRQ,
  27.143 -                        "debug", dev);
  27.144 -    if ( error )
  27.145 -    {
  27.146 -        printk(KERN_WARNING "%s: Non-fatal error -- no debug interrupt\n",
  27.147 -               dev->name);
  27.148 -    }
  27.149 -
  27.150 -    printk("XenoLinux Virtual Network Driver installed as %s\n", dev->name);
  27.151 -
  27.152 -    netif_start_queue(dev);
  27.153 -
  27.154 -    MOD_INC_USE_COUNT;
  27.155 -
  27.156 -    return 0;
  27.157 -
  27.158 - fail:
  27.159 -    kfree(np);
  27.160 -    return error;
  27.161 -}
  27.162 -
  27.163 -
  27.164 -static void network_tx_buf_gc(struct net_device *dev)
  27.165 -{
  27.166 -    unsigned int i;
  27.167 -    struct net_private *np = dev->priv;
  27.168 -    struct sk_buff *skb;
  27.169 -    unsigned long flags;
  27.170 -    unsigned int prod;
  27.171 -    tx_entry_t *tx_ring = np->net_ring->tx_ring;
  27.172 -
  27.173 -    spin_lock_irqsave(&np->tx_lock, flags);
  27.174 -
  27.175 -    do {
  27.176 -        prod = np->net_idx->tx_resp_prod;
  27.177 -
  27.178 -        for ( i = np->tx_resp_cons; i != prod; i = TX_RING_INC(i) )
  27.179 -        {
  27.180 -            skb = np->tx_skbs[tx_ring[i].resp.id];
  27.181 -            ADD_ID_TO_FREELIST(np->tx_skbs, tx_ring[i].resp.id);
  27.182 -            dev_kfree_skb_any(skb);
  27.183 -            atomic_dec(&np->tx_entries);
  27.184 -        }
  27.185 -        
  27.186 -        np->tx_resp_cons = prod;
  27.187 -        
  27.188 -        /* Set a new event, then check for race with update of tx_cons. */
  27.189 -        np->net_idx->tx_event =
  27.190 -            TX_RING_ADD(prod, (atomic_read(&np->tx_entries)>>1) + 1);
  27.191 -        smp_mb();
  27.192 -    }
  27.193 -    while ( prod != np->net_idx->tx_resp_prod );
  27.194 -
  27.195 -    if ( np->tx_full && (atomic_read(&np->tx_entries) < TX_MAX_ENTRIES) )
  27.196 -    {
  27.197 -        np->tx_full = 0;
  27.198 -        netif_wake_queue(dev);
  27.199 -    }
  27.200 -
  27.201 -    spin_unlock_irqrestore(&np->tx_lock, flags);
  27.202 -}
  27.203 -
  27.204 -inline pte_t *get_ppte(void *addr)
  27.205 -{
  27.206 -    pgd_t *pgd; pmd_t *pmd; pte_t *pte;
  27.207 -    pgd = pgd_offset_k(   (unsigned long)addr);
  27.208 -    pmd = pmd_offset(pgd, (unsigned long)addr);
  27.209 -    pte = pte_offset(pmd, (unsigned long)addr);
  27.210 -    return pte;
  27.211 -}
  27.212 -
  27.213 -static void network_alloc_rx_buffers(struct net_device *dev)
  27.214 -{
  27.215 -    unsigned int i, id;
  27.216 -    struct net_private *np = dev->priv;
  27.217 -    struct sk_buff *skb;
  27.218 -    unsigned int end = RX_RING_ADD(np->rx_resp_cons, RX_MAX_ENTRIES);    
  27.219 -
  27.220 -    for ( i = np->net_idx->rx_req_prod; i != end; i = RX_RING_INC(i) )
  27.221 -    {
  27.222 -        skb = dev_alloc_skb(RX_BUF_SIZE);
  27.223 -        if ( skb == NULL ) break;
  27.224 -        skb->dev = dev;
  27.225 -
  27.226 -        id = GET_ID_FROM_FREELIST(np->rx_skbs);
  27.227 -        np->rx_skbs[id] = skb;
  27.228 -
  27.229 -        np->net_ring->rx_ring[i].req.id   = (unsigned short)id;
  27.230 -        np->net_ring->rx_ring[i].req.addr = 
  27.231 -            virt_to_machine(get_ppte(skb->head));
  27.232 -    }
  27.233 -
  27.234 -    np->net_idx->rx_req_prod = i;
  27.235 -
  27.236 -    np->net_idx->rx_event = RX_RING_INC(np->rx_resp_cons);
  27.237 -
  27.238 -    /*
  27.239 -     * We may have allocated buffers which have entries outstanding in
  27.240 -     * the page update queue -- make sure we flush those first!
  27.241 -     */
  27.242 -    flush_page_update_queue();
  27.243 -    HYPERVISOR_net_update();
  27.244 -}
  27.245 -
  27.246 -
  27.247 -static void network_free_rx_buffers(struct net_device *dev)
  27.248 -{
  27.249 -    unsigned int i;
  27.250 -    struct net_private *np = dev->priv;
  27.251 -    struct sk_buff *skb;    
  27.252 -
  27.253 -    for ( i  = np->rx_resp_cons; 
  27.254 -          i != np->net_idx->rx_req_prod; 
  27.255 -          i  = RX_RING_INC(i) )
  27.256 -    {
  27.257 -        skb = np->rx_skbs[np->net_ring->rx_ring[i].req.id];
  27.258 -        dev_kfree_skb_any(skb);
  27.259 -    }
  27.260 -}
  27.261 -
  27.262 -static int network_start_xmit(struct sk_buff *skb, struct net_device *dev)
  27.263 -{
  27.264 -    unsigned int i, id;
  27.265 -    struct net_private *np = (struct net_private *)dev->priv;
  27.266 -
  27.267 -    if ( np->tx_full )
  27.268 -    {
  27.269 -        printk(KERN_ALERT "%s: full queue wasn't stopped!\n", dev->name);
  27.270 -        netif_stop_queue(dev);
  27.271 -        return -ENOBUFS;
  27.272 -    }
  27.273 -    i = np->net_idx->tx_req_prod;
  27.274 -
  27.275 -    if ( (((unsigned long)skb->data & ~PAGE_MASK) + skb->len) >= PAGE_SIZE )
  27.276 -    {
  27.277 -        struct sk_buff *new_skb = dev_alloc_skb(RX_BUF_SIZE);
  27.278 -        if ( new_skb == NULL ) return 1;
  27.279 -        skb_put(new_skb, skb->len);
  27.280 -        memcpy(new_skb->data, skb->data, skb->len);
  27.281 -        dev_kfree_skb(skb);
  27.282 -        skb = new_skb;
  27.283 -    }   
  27.284 -    
  27.285 -    id = GET_ID_FROM_FREELIST(np->tx_skbs);
  27.286 -    np->tx_skbs[id] = skb;
  27.287 -
  27.288 -    np->net_ring->tx_ring[i].req.id   = (unsigned short)id;
  27.289 -    np->net_ring->tx_ring[i].req.addr =
  27.290 -        phys_to_machine(virt_to_phys(skb->data));
  27.291 -    np->net_ring->tx_ring[i].req.size = skb->len;
  27.292 -    np->net_idx->tx_req_prod = TX_RING_INC(i);
  27.293 -    atomic_inc(&np->tx_entries);
  27.294 -
  27.295 -    np->stats.tx_bytes += skb->len;
  27.296 -    np->stats.tx_packets++;
  27.297 -
  27.298 -    spin_lock_irq(&np->tx_lock);
  27.299 -    if ( atomic_read(&np->tx_entries) >= TX_MAX_ENTRIES )
  27.300 -    {
  27.301 -        np->tx_full = 1;
  27.302 -        netif_stop_queue(dev);
  27.303 -    }
  27.304 -    spin_unlock_irq(&np->tx_lock);
  27.305 -
  27.306 -    network_tx_buf_gc(dev);
  27.307 -
  27.308 -    HYPERVISOR_net_update();
  27.309 -
  27.310 -    return 0;
  27.311 -}
  27.312 -
  27.313 -
  27.314 -static void network_rx_int(int irq, void *dev_id, struct pt_regs *ptregs)
  27.315 -{
  27.316 -    unsigned int i;
  27.317 -    struct net_device *dev = (struct net_device *)dev_id;
  27.318 -    struct net_private *np = dev->priv;
  27.319 -    struct sk_buff *skb;
  27.320 -    rx_resp_entry_t *rx;
  27.321 -    
  27.322 - again:
  27.323 -    for ( i  = np->rx_resp_cons; 
  27.324 -          i != np->net_idx->rx_resp_prod; 
  27.325 -          i  = RX_RING_INC(i) )
  27.326 -    {
  27.327 -        rx  = &np->net_ring->rx_ring[i].resp;
  27.328 -
  27.329 -        skb = np->rx_skbs[rx->id];
  27.330 -        ADD_ID_TO_FREELIST(np->rx_skbs, rx->id);
  27.331 -
  27.332 -        if ( rx->status != RING_STATUS_OK )
  27.333 -        {
  27.334 -            printk(KERN_ALERT "bad buffer on RX ring!(%d)\n", rx->status);
  27.335 -            dev_kfree_skb_any(skb);
  27.336 -            continue;
  27.337 -        }
  27.338 -
  27.339 -        /*
  27.340 -         * Set up shinfo -- from alloc_skb This was particularily nasty:  the
  27.341 -         * shared info is hidden at the back of the data area (presumably so it
  27.342 -         * can be shared), but on page flip it gets very spunked.
  27.343 -         */
  27.344 -        atomic_set(&(skb_shinfo(skb)->dataref), 1);
  27.345 -        skb_shinfo(skb)->nr_frags = 0;
  27.346 -        skb_shinfo(skb)->frag_list = NULL;
  27.347 -                                
  27.348 -        phys_to_machine_mapping[virt_to_phys(skb->head) >> PAGE_SHIFT] =
  27.349 -            (*(unsigned long *)get_ppte(skb->head)) >> PAGE_SHIFT;
  27.350 -
  27.351 -        if ( rx->offset < 16 )
  27.352 -        {
  27.353 -            printk(KERN_ALERT "need pkt offset >= 16 (got %d)\n", rx->offset);
  27.354 -            dev_kfree_skb_any(skb);
  27.355 -            continue;
  27.356 -        }
  27.357 -        
  27.358 -        skb_reserve(skb, rx->offset - 16);
  27.359 -
  27.360 -        skb_put(skb, rx->size);
  27.361 -        skb->protocol = eth_type_trans(skb, dev);
  27.362 -
  27.363 -        np->stats.rx_packets++;
  27.364 -
  27.365 -        np->stats.rx_bytes += rx->size;
  27.366 -        netif_rx(skb);
  27.367 -        dev->last_rx = jiffies;
  27.368 -    }
  27.369 -
  27.370 -    np->rx_resp_cons = i;
  27.371 -
  27.372 -    network_alloc_rx_buffers(dev);
  27.373 -    
  27.374 -    /* Deal with hypervisor racing our resetting of rx_event. */
  27.375 -    smp_mb();
  27.376 -    if ( np->net_idx->rx_resp_prod != i ) goto again;
  27.377 -}
  27.378 -
  27.379 -
  27.380 -static void network_tx_int(int irq, void *dev_id, struct pt_regs *ptregs)
  27.381 -{
  27.382 -    struct net_device *dev = (struct net_device *)dev_id;
  27.383 -    network_tx_buf_gc(dev);
  27.384 -}
  27.385 -
  27.386 -
  27.387 -int network_close(struct net_device *dev)
  27.388 -{
  27.389 -    netif_stop_queue(dev);
  27.390 -
  27.391 -    free_irq(NET_RX_IRQ, dev);
  27.392 -    free_irq(NET_TX_IRQ, dev);
  27.393 -
  27.394 -    /*
  27.395 -     * XXXX This cannot be done safely until be have a proper interface
  27.396 -     * for setting up and tearing down virtual interfaces on the fly.
  27.397 -     * Currently the receive buffers are locked down by Xen and we have
  27.398 -     * no sensible way of retrieving them.
  27.399 -     */
  27.400 -#if 0
  27.401 -    network_free_rx_buffers(dev);
  27.402 -    kfree(np->net_ring->rx_ring);
  27.403 -    kfree(np->net_ring->tx_ring);
  27.404 -#endif
  27.405 -
  27.406 -    MOD_DEC_USE_COUNT;
  27.407 -
  27.408 -    return 0;
  27.409 -}
  27.410 -
  27.411 -
  27.412 -static struct net_device_stats *network_get_stats(struct net_device *dev)
  27.413 -{
  27.414 -    struct net_private *np = (struct net_private *)dev->priv;
  27.415 -    return &np->stats;
  27.416 -}
  27.417 -
  27.418 -
  27.419 -/*
  27.420 - * This notifier is installed for domain 0 only.
  27.421 - * All other domains have VFR rules installed on their behalf by domain 0
  27.422 - * when they are created. For bootstrap, Xen creates wildcard rules for
  27.423 - * domain 0 -- this notifier is used to detect when we find our proper
  27.424 - * IP address, so we can poke down proper rules and remove the wildcards.
  27.425 - */
  27.426 -static int inetdev_notify(struct notifier_block *this, 
  27.427 -                          unsigned long event, 
  27.428 -                          void *ptr)
  27.429 -{
  27.430 -    struct in_ifaddr  *ifa  = (struct in_ifaddr *)ptr; 
  27.431 -    struct net_device *dev = ifa->ifa_dev->dev;
  27.432 -    struct list_head  *ent;
  27.433 -    struct net_private *np;
  27.434 -    int idx = -1;
  27.435 -    network_op_t op;
  27.436 -    static int removed_bootstrap_rules = 0;
  27.437 -
  27.438 -    list_for_each ( ent, &dev_list )
  27.439 -    {
  27.440 -        np  = list_entry(dev_list.next, struct net_private, list);
  27.441 -        if ( np->dev == dev )
  27.442 -            idx = np->idx;
  27.443 -    }
  27.444 -
  27.445 -    if ( idx == -1 )
  27.446 -        goto out;
  27.447 -    
  27.448 -    memset(&op, 0, sizeof(op));
  27.449 -    op.u.net_rule.proto         = NETWORK_PROTO_ANY;
  27.450 -    op.u.net_rule.action        = NETWORK_ACTION_ACCEPT;
  27.451 -
  27.452 -    if ( event == NETDEV_UP )
  27.453 -        op.cmd = NETWORK_OP_ADDRULE;
  27.454 -    else if ( event == NETDEV_DOWN )
  27.455 -        op.cmd = NETWORK_OP_DELETERULE;
  27.456 -    else
  27.457 -        goto out;
  27.458 -
  27.459 -    op.u.net_rule.src_vif       = idx;
  27.460 -    op.u.net_rule.dst_vif       = VIF_PHYSICAL_INTERFACE;
  27.461 -    op.u.net_rule.src_addr      = ntohl(ifa->ifa_address);
  27.462 -    op.u.net_rule.src_addr_mask = ~0UL;
  27.463 -    op.u.net_rule.dst_addr      = 0;
  27.464 -    op.u.net_rule.dst_addr_mask = 0;
  27.465 -    (void)HYPERVISOR_network_op(&op);
  27.466 -    
  27.467 -    op.u.net_rule.src_vif       = VIF_ANY_INTERFACE;
  27.468 -    op.u.net_rule.dst_vif       = idx;
  27.469 -    op.u.net_rule.src_addr      = 0;
  27.470 -    op.u.net_rule.src_addr_mask = 0;    
  27.471 -    op.u.net_rule.dst_addr      = ntohl(ifa->ifa_address);
  27.472 -    op.u.net_rule.dst_addr_mask = ~0UL;
  27.473 -    (void)HYPERVISOR_network_op(&op);
  27.474 -
  27.475 -    /*
  27.476 -     * When the first real interface is brought up we delete the start-of-day
  27.477 -     * bootstrap rules -- they were only installed to allow an initial DHCP
  27.478 -     * request and response.
  27.479 -     */
  27.480 -    if ( (idx == 0) && (event == NETDEV_UP) && !removed_bootstrap_rules )
  27.481 -    {
  27.482 -        memset(&op, 0, sizeof(op));
  27.483 -        op.cmd = NETWORK_OP_DELETERULE;
  27.484 -        op.u.net_rule.proto         = NETWORK_PROTO_ANY;
  27.485 -        op.u.net_rule.action        = NETWORK_ACTION_ACCEPT;
  27.486 -        op.u.net_rule.src_vif       = 0;
  27.487 -        op.u.net_rule.dst_vif       = VIF_PHYSICAL_INTERFACE;
  27.488 -        (void)HYPERVISOR_network_op(&op);
  27.489 -        op.u.net_rule.src_vif       = VIF_ANY_INTERFACE;
  27.490 -        op.u.net_rule.dst_vif       = 0;
  27.491 -        (void)HYPERVISOR_network_op(&op);
  27.492 -
  27.493 -        removed_bootstrap_rules = 1;
  27.494 -    }
  27.495 -    
  27.496 - out:
  27.497 -    return NOTIFY_DONE;
  27.498 -}
  27.499 -
  27.500 -static struct notifier_block notifier_inetdev = {
  27.501 -    .notifier_call  = inetdev_notify,
  27.502 -    .next           = NULL,
  27.503 -    .priority       = 0
  27.504 -};
  27.505 -
  27.506 -
  27.507 -int __init init_module(void)
  27.508 -{
  27.509 -    int i, fixmap_idx=-1, err;
  27.510 -    struct net_device *dev;
  27.511 -    struct net_private *np;
  27.512 -
  27.513 -    INIT_LIST_HEAD(&dev_list);
  27.514 -
  27.515 -    if ( start_info.dom_id == 0 )
  27.516 -    {
  27.517 -        /*
  27.518 -         * Domain 0 creates wildcard rules to allow DHCP to find its first IP
  27.519 -         * address. These wildcard rules are deleted when the first inet
  27.520 -         * interface is brought up.
  27.521 -         */
  27.522 -        network_op_t op;
  27.523 -        memset(&op, 0, sizeof(op));
  27.524 -        op.cmd = NETWORK_OP_ADDRULE;
  27.525 -        op.u.net_rule.proto         = NETWORK_PROTO_ANY;
  27.526 -        op.u.net_rule.action        = NETWORK_ACTION_ACCEPT;
  27.527 -        op.u.net_rule.src_vif       = 0;
  27.528 -        op.u.net_rule.dst_vif       = VIF_PHYSICAL_INTERFACE;
  27.529 -        (void)HYPERVISOR_network_op(&op);
  27.530 -        op.u.net_rule.src_vif       = VIF_ANY_INTERFACE;
  27.531 -        op.u.net_rule.dst_vif       = 0;
  27.532 -        (void)HYPERVISOR_network_op(&op);        
  27.533 -
  27.534 -        /*
  27.535 -         * Domain 0 must poke its own network rules as it discovers its IP
  27.536 -         * addresses. All other domains have a privileged "parent" to do this
  27.537 -         * for them at start of day.
  27.538 -         */
  27.539 -        (void)register_inetaddr_notifier(&notifier_inetdev);
  27.540 -    }
  27.541 -
  27.542 -    for ( i = 0; i < MAX_DOMAIN_VIFS; i++ )
  27.543 -    {
  27.544 -        if ( start_info.net_rings[i] == 0 )
  27.545 -            continue;
  27.546 -
  27.547 -        /* We actually only support up to 4 vifs right now. */
  27.548 -        if ( ++fixmap_idx == 4 )
  27.549 -            break;
  27.550 -
  27.551 -        dev = alloc_etherdev(sizeof(struct net_private));
  27.552 -        if ( dev == NULL )
  27.553 -        {
  27.554 -            err = -ENOMEM;
  27.555 -            goto fail;
  27.556 -        }
  27.557 -
  27.558 -        set_fixmap(FIX_NETRING0_BASE+fixmap_idx, start_info.net_rings[i]);
  27.559 -
  27.560 -        np = dev->priv;
  27.561 -        np->net_ring = (net_ring_t *)fix_to_virt(FIX_NETRING0_BASE+fixmap_idx);
  27.562 -        np->net_idx  = &HYPERVISOR_shared_info->net_idx[i];
  27.563 -        np->idx      = i;
  27.564 -
  27.565 -        SET_MODULE_OWNER(dev);
  27.566 -        dev->open            = network_open;
  27.567 -        dev->hard_start_xmit = network_start_xmit;
  27.568 -        dev->stop            = network_close;
  27.569 -        dev->get_stats       = network_get_stats;
  27.570 -
  27.571 -        memcpy(dev->dev_addr, start_info.net_vmac[i], ETH_ALEN);
  27.572 -
  27.573 -        if ( (err = register_netdev(dev)) != 0 )
  27.574 -        {
  27.575 -            kfree(dev);
  27.576 -            goto fail;
  27.577 -        }
  27.578 -
  27.579 -        np->dev = dev;
  27.580 -        list_add(&np->list, &dev_list);
  27.581 -    }
  27.582 -
  27.583 -    return 0;
  27.584 -
  27.585 - fail:
  27.586 -    cleanup_module();
  27.587 -    return err;
  27.588 -}
  27.589 -
  27.590 -
  27.591 -static void cleanup_module(void)
  27.592 -{
  27.593 -    struct net_private *np;
  27.594 -    struct net_device *dev;
  27.595 -
  27.596 -    while ( !list_empty(&dev_list) )
  27.597 -    {
  27.598 -        np = list_entry(dev_list.next, struct net_private, list);
  27.599 -        list_del(&np->list);
  27.600 -        dev = np->dev;
  27.601 -        unregister_netdev(dev);
  27.602 -        kfree(dev);
  27.603 -    }
  27.604 -
  27.605 -    if ( start_info.dom_id == 0 )
  27.606 -        (void)unregister_inetaddr_notifier(&notifier_inetdev);
  27.607 -}
  27.608 -
  27.609 -
  27.610 -module_init(init_module);
  27.611 -module_exit(cleanup_module);
    28.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/Makefile	Tue Jun 24 12:05:12 2003 +0000
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,15 +0,0 @@
    28.4 -
    28.5 -.S.o:
    28.6 -	$(CC) $(AFLAGS) -traditional -c $< -o $*.o
    28.7 -
    28.8 -all: kernel.o head.o init_task.o
    28.9 -
   28.10 -O_TARGET := kernel.o
   28.11 -
   28.12 -export-objs     := i386_ksyms.o 
   28.13 -
   28.14 -obj-y	:= process.o semaphore.o signal.o entry.o traps.o irq.o  \
   28.15 -		ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o \
   28.16 -		i386_ksyms.o i387.o hypervisor.o
   28.17 -
   28.18 -include $(TOPDIR)/Rules.make
    29.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/entry.S	Tue Jun 24 12:05:12 2003 +0000
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,773 +0,0 @@
    29.4 -/*
    29.5 - *  linux/arch/i386/entry.S
    29.6 - *
    29.7 - *  Copyright (C) 1991, 1992  Linus Torvalds
    29.8 - */
    29.9 -
   29.10 -/*
   29.11 - * entry.S contains the system-call and fault low-level handling routines.
   29.12 - * This also contains the timer-interrupt handler, as well as all interrupts
   29.13 - * and faults that can result in a task-switch.
   29.14 - *
   29.15 - * NOTE: This code handles signal-recognition, which happens every time
   29.16 - * after a timer-interrupt and after each system call.
   29.17 - *
   29.18 - * I changed all the .align's to 4 (16 byte alignment), as that's faster
   29.19 - * on a 486.
   29.20 - *
   29.21 - * Stack layout in 'ret_from_system_call':
   29.22 - * 	ptrace needs to have all regs on the stack.
   29.23 - *	if the order here is changed, it needs to be
   29.24 - *	updated in fork.c:copy_process, signal.c:do_signal,
   29.25 - *	ptrace.c and ptrace.h
   29.26 - *
   29.27 - *	 0(%esp) - %ebx
   29.28 - *	 4(%esp) - %ecx
   29.29 - *	 8(%esp) - %edx
   29.30 - *       C(%esp) - %esi
   29.31 - *	10(%esp) - %edi
   29.32 - *	14(%esp) - %ebp
   29.33 - *	18(%esp) - %eax
   29.34 - *	1C(%esp) - %ds
   29.35 - *	20(%esp) - %es
   29.36 - *	24(%esp) - orig_eax
   29.37 - *	28(%esp) - %eip
   29.38 - *	2C(%esp) - %cs
   29.39 - *	30(%esp) - %eflags
   29.40 - *	34(%esp) - %oldesp
   29.41 - *	38(%esp) - %oldss
   29.42 - *
   29.43 - * "current" is in register %ebx during any slow entries.
   29.44 - */
   29.45 -
   29.46 -#include <linux/config.h>
   29.47 -#include <linux/sys.h>
   29.48 -#include <linux/linkage.h>
   29.49 -#include <asm/segment.h>
   29.50 -#include <asm/smp.h>
   29.51 -
   29.52 -EBX		= 0x00
   29.53 -ECX		= 0x04
   29.54 -EDX		= 0x08
   29.55 -ESI		= 0x0C
   29.56 -EDI		= 0x10
   29.57 -EBP		= 0x14
   29.58 -EAX		= 0x18
   29.59 -DS		= 0x1C
   29.60 -ES		= 0x20
   29.61 -ORIG_EAX	= 0x24
   29.62 -EIP		= 0x28
   29.63 -CS		= 0x2C
   29.64 -EFLAGS		= 0x30
   29.65 -OLDESP		= 0x34
   29.66 -OLDSS		= 0x38
   29.67 -
   29.68 -CF_MASK		= 0x00000001
   29.69 -TF_MASK		= 0x00000100
   29.70 -IF_MASK		= 0x00000200
   29.71 -DF_MASK		= 0x00000400
   29.72 -NT_MASK		= 0x00004000
   29.73 -
   29.74 -/*
   29.75 - * these are offsets into the task-struct.
   29.76 - */
   29.77 -state		=  0
   29.78 -flags		=  4
   29.79 -sigpending	=  8
   29.80 -addr_limit	= 12
   29.81 -exec_domain	= 16
   29.82 -need_resched	= 20
   29.83 -tsk_ptrace	= 24
   29.84 -processor	= 52
   29.85 -
   29.86 -ENOSYS = 38
   29.87 -
   29.88 -
   29.89 -#define SAVE_ALL \
   29.90 -	cld; \
   29.91 -	pushl %es; \
   29.92 -	pushl %ds; \
   29.93 -	pushl %eax; \
   29.94 -	pushl %ebp; \
   29.95 -	pushl %edi; \
   29.96 -	pushl %esi; \
   29.97 -	pushl %edx; \
   29.98 -	pushl %ecx; \
   29.99 -	pushl %ebx; \
  29.100 -	movl $(__KERNEL_DS),%edx; \
  29.101 -	movl %edx,%ds; \
  29.102 -	movl %edx,%es;
  29.103 -
  29.104 -#define RESTORE_ALL	\
  29.105 -	popl %ebx;	\
  29.106 -	popl %ecx;	\
  29.107 -	popl %edx;	\
  29.108 -	popl %esi;	\
  29.109 -	popl %edi;	\
  29.110 -	popl %ebp;	\
  29.111 -	popl %eax;	\
  29.112 -1:	popl %ds;	\
  29.113 -2:	popl %es;	\
  29.114 -	addl $4,%esp;	\
  29.115 -3:	iret;		\
  29.116 -.section .fixup,"ax";	\
  29.117 -4:	movl $0,(%esp);	\
  29.118 -	jmp 1b;		\
  29.119 -5:	movl $0,(%esp);	\
  29.120 -	jmp 2b;		\
  29.121 -6:	pushl %ss;	\
  29.122 -	popl %ds;	\
  29.123 -	pushl %ss;	\
  29.124 -	popl %es;	\
  29.125 -	pushl $11;	\
  29.126 -	call do_exit;	\
  29.127 -.previous;		\
  29.128 -.section __ex_table,"a";\
  29.129 -	.align 4;	\
  29.130 -	.long 1b,4b;	\
  29.131 -	.long 2b,5b;	\
  29.132 -	.long 3b,6b;	\
  29.133 -.previous
  29.134 -
  29.135 -#define GET_CURRENT(reg) \
  29.136 -	movl $-8192, reg; \
  29.137 -	andl %esp, reg
  29.138 -
  29.139 -ENTRY(lcall7)
  29.140 -	pushfl			# We get a different stack layout with call
  29.141 -	pushl %eax		# gates, which has to be cleaned up later..
  29.142 -	SAVE_ALL
  29.143 -	movl EIP(%esp),%eax	# due to call gates, this is eflags, not eip..
  29.144 -	movl CS(%esp),%edx	# this is eip..
  29.145 -	movl EFLAGS(%esp),%ecx	# and this is cs..
  29.146 -	movl %eax,EFLAGS(%esp)	#
  29.147 -	andl $~(NT_MASK|TF_MASK|DF_MASK), %eax
  29.148 -	pushl %eax
  29.149 -	popfl
  29.150 -	movl %edx,EIP(%esp)	# Now we move them to their "normal" places
  29.151 -	movl %ecx,CS(%esp)	#
  29.152 -	movl %esp,%ebx
  29.153 -	pushl %ebx
  29.154 -	andl $-8192,%ebx	# GET_CURRENT
  29.155 -	movl exec_domain(%ebx),%edx	# Get the execution domain
  29.156 -	movl 4(%edx),%edx	# Get the lcall7 handler for the domain
  29.157 -	pushl $0x7
  29.158 -	call *%edx
  29.159 -	addl $4, %esp
  29.160 -	popl %eax
  29.161 -	jmp ret_from_sys_call
  29.162 -
  29.163 -ENTRY(lcall27)
  29.164 -	pushfl			# We get a different stack layout with call
  29.165 -	pushl %eax		# gates, which has to be cleaned up later..
  29.166 -	SAVE_ALL
  29.167 -	movl EIP(%esp),%eax	# due to call gates, this is eflags, not eip..
  29.168 -	movl CS(%esp),%edx	# this is eip..
  29.169 -	movl EFLAGS(%esp),%ecx	# and this is cs..
  29.170 -	movl %eax,EFLAGS(%esp)	#
  29.171 -	andl $~(NT_MASK|TF_MASK|DF_MASK), %eax
  29.172 -	pushl %eax
  29.173 -	popfl
  29.174 -	movl %edx,EIP(%esp)	# Now we move them to their "normal" places
  29.175 -	movl %ecx,CS(%esp)	#
  29.176 -	movl %esp,%ebx
  29.177 -	pushl %ebx
  29.178 -	andl $-8192,%ebx	# GET_CURRENT
  29.179 -	movl exec_domain(%ebx),%edx	# Get the execution domain
  29.180 -	movl 4(%edx),%edx	# Get the lcall7 handler for the domain
  29.181 -	pushl $0x27
  29.182 -	call *%edx
  29.183 -	addl $4, %esp
  29.184 -	popl %eax
  29.185 -	jmp ret_from_sys_call
  29.186 -
  29.187 -        
  29.188 -ENTRY(ret_from_fork)
  29.189 -	pushl %ebx
  29.190 -	call SYMBOL_NAME(schedule_tail)
  29.191 -	addl $4, %esp
  29.192 -	GET_CURRENT(%ebx)
  29.193 -	testb $0x02,tsk_ptrace(%ebx)	# PT_TRACESYS
  29.194 -	jne tracesys_exit
  29.195 -	jmp	ret_from_sys_call
  29.196 -
  29.197 -/*
  29.198 - * Return to user mode is not as complex as all this looks,
  29.199 - * but we want the default path for a system call return to
  29.200 - * go as quickly as possible which is why some of this is
  29.201 - * less clear than it otherwise should be.
  29.202 - */
  29.203 -
  29.204 -ENTRY(system_call)
  29.205 -	pushl %eax			# save orig_eax
  29.206 -	SAVE_ALL
  29.207 -	GET_CURRENT(%ebx)
  29.208 -	testb $0x02,tsk_ptrace(%ebx)	# PT_TRACESYS
  29.209 -	jne tracesys
  29.210 -	cmpl $(NR_syscalls),%eax
  29.211 -	jae badsys
  29.212 -	call *SYMBOL_NAME(sys_call_table)(,%eax,4)
  29.213 -	movl %eax,EAX(%esp)		# save the return value
  29.214 -ENTRY(ret_from_sys_call)
  29.215 -        movl SYMBOL_NAME(HYPERVISOR_shared_info),%esi
  29.216 -        btrl $EVENTS_MASTER_ENABLE_BIT,4(%esi) # make tests atomic
  29.217 -ret_syscall_tests:      
  29.218 -	cmpl $0,need_resched(%ebx)
  29.219 -	jne reschedule
  29.220 -	cmpl $0,sigpending(%ebx)
  29.221 -	je   safesti                    # ensure need_resched updates are seen
  29.222 -signal_return:
  29.223 -	btsl $EVENTS_MASTER_ENABLE_BIT,4(%esi) # reenable event callbacks
  29.224 -	movl %esp,%eax
  29.225 -	xorl %edx,%edx
  29.226 -	call SYMBOL_NAME(do_signal)
  29.227 -	jmp  ret_from_sys_call
  29.228 -
  29.229 -	ALIGN
  29.230 -restore_all:
  29.231 -	RESTORE_ALL
  29.232 -
  29.233 -	ALIGN
  29.234 -tracesys:
  29.235 -	movl $-ENOSYS,EAX(%esp)
  29.236 -	call SYMBOL_NAME(syscall_trace)
  29.237 -	movl ORIG_EAX(%esp),%eax
  29.238 -	cmpl $(NR_syscalls),%eax
  29.239 -	jae tracesys_exit
  29.240 -	call *SYMBOL_NAME(sys_call_table)(,%eax,4)
  29.241 -	movl %eax,EAX(%esp)		# save the return value
  29.242 -tracesys_exit:
  29.243 -	call SYMBOL_NAME(syscall_trace)
  29.244 -	jmp ret_from_sys_call
  29.245 -badsys:
  29.246 -	movl $-ENOSYS,EAX(%esp)
  29.247 -	jmp ret_from_sys_call
  29.248 -
  29.249 -	ALIGN
  29.250 -ENTRY(ret_from_intr)
  29.251 -	GET_CURRENT(%ebx)
  29.252 -ret_from_exception:
  29.253 -	movb CS(%esp),%al
  29.254 -	testl $2,%eax
  29.255 -	jne ret_from_sys_call
  29.256 -	jmp restore_all
  29.257 -
  29.258 -	ALIGN
  29.259 -reschedule:
  29.260 -        btsl $EVENTS_MASTER_ENABLE_BIT,4(%esi) # reenable event callbacks
  29.261 -	call SYMBOL_NAME(schedule)             # test
  29.262 -	jmp ret_from_sys_call
  29.263 -
  29.264 -ENTRY(divide_error)
  29.265 -	pushl $0		# no error code
  29.266 -	pushl $ SYMBOL_NAME(do_divide_error)
  29.267 -	ALIGN
  29.268 -error_code:
  29.269 -	pushl %ds
  29.270 -	pushl %eax
  29.271 -	xorl %eax,%eax
  29.272 -	pushl %ebp
  29.273 -	pushl %edi
  29.274 -	pushl %esi
  29.275 -	pushl %edx
  29.276 -	decl %eax			# eax = -1
  29.277 -	pushl %ecx
  29.278 -	pushl %ebx
  29.279 -	GET_CURRENT(%ebx)
  29.280 -	cld
  29.281 -	movl %es,%ecx
  29.282 -	movl ORIG_EAX(%esp), %esi	# get the error code
  29.283 -	movl ES(%esp), %edi		# get the function address
  29.284 -	movl %eax, ORIG_EAX(%esp)
  29.285 -	movl %ecx, ES(%esp)
  29.286 -	movl %esp,%edx
  29.287 -	pushl %esi			# push the error code
  29.288 -	pushl %edx			# push the pt_regs pointer
  29.289 -	movl $(__KERNEL_DS),%edx
  29.290 -	movl %edx,%ds
  29.291 -	movl %edx,%es
  29.292 -	call *%edi
  29.293 -	addl $8,%esp
  29.294 -	jmp ret_from_exception
  29.295 -
  29.296 -# A note on the "critical region" in our callback handler.
  29.297 -# We want to avoid stacking callback handlers due to events occurring
  29.298 -# during handling of the last event. To do this, we keep events disabled
  29.299 -# until we've done all processing. HOWEVER, we must enable events before
  29.300 -# popping the stack frame (can't be done atomically) and so it would still
  29.301 -# be possible to get enough handler activations to overflow the stack.
  29.302 -# Although unlikely, bugs of that kind are hard to track down, so we'd
  29.303 -# like to avoid the possibility.
  29.304 -# So, on entry to the handler we detect whether we interrupted an
  29.305 -# existing activation in its critical region -- if so, we pop the current
  29.306 -# activation and restart the handler using the previous one.
  29.307 -ENTRY(hypervisor_callback)
  29.308 -        pushl %eax
  29.309 -        SAVE_ALL
  29.310 -        GET_CURRENT(%ebx)
  29.311 -        movl EIP(%esp),%eax
  29.312 -        cmpl $scrit,%eax
  29.313 -        jb   11f
  29.314 -        cmpl $ecrit,%eax
  29.315 -        jb   critical_region_fixup
  29.316 -11:     push %esp
  29.317 -        call do_hypervisor_callback
  29.318 -        add  $4,%esp
  29.319 -        movl SYMBOL_NAME(HYPERVISOR_shared_info),%esi
  29.320 -        xorl %eax,%eax
  29.321 -        movb CS(%esp),%cl
  29.322 -	test $2,%cl          # slow return to ring 2 or 3
  29.323 -	jne  ret_syscall_tests
  29.324 -safesti:btsl $EVENTS_MASTER_ENABLE_BIT,4(%esi) # reenable event callbacks
  29.325 -scrit:  /**** START OF CRITICAL REGION ****/
  29.326 -        cmpl %eax,(%esi)
  29.327 -        jne  14f              # process more events if necessary...
  29.328 -        RESTORE_ALL
  29.329 -14:     btrl $EVENTS_MASTER_ENABLE_BIT,4(%esi)
  29.330 -        jmp  11b
  29.331 -ecrit:  /**** END OF CRITICAL REGION ****/
  29.332 -# [How we do the fixup]. We want to merge the current stack frame with the
  29.333 -# just-interrupted frame. How we do this depends on where in the critical
  29.334 -# region the interrupted handler was executing, and so how many saved
  29.335 -# registers are in each frame. We do this quickly using the lookup table
  29.336 -# 'critical_fixup_table'. For each byte offset in the critical region, it
  29.337 -# provides the number of bytes which have already been popped from the
  29.338 -# interrupted stack frame. 
  29.339 -critical_region_fixup:
  29.340 -        addl $critical_fixup_table-scrit,%eax
  29.341 -        movzbl (%eax),%eax    # %eax contains num bytes popped
  29.342 -        mov  %esp,%esi
  29.343 -        add  %eax,%esi        # %esi points at end of src region
  29.344 -        mov  %esp,%edi
  29.345 -        add  $0x34,%edi       # %edi points at end of dst region
  29.346 -        mov  %eax,%ecx
  29.347 -        shr  $2,%ecx          # convert words to bytes
  29.348 -        je   16f              # skip loop if nothing to copy
  29.349 -15:     subl $4,%esi          # pre-decrementing copy loop
  29.350 -        subl $4,%edi
  29.351 -        movl (%esi),%eax
  29.352 -        movl %eax,(%edi)
  29.353 -        loop 15b
  29.354 -16:     movl %edi,%esp        # final %edi is top of merged stack
  29.355 -        jmp  11b
  29.356 -        
  29.357 -critical_fixup_table:        
  29.358 -        .byte 0x00,0x00                       # cmpl %eax,(%esi)
  29.359 -        .byte 0x00,0x00                       # jne  14f
  29.360 -        .byte 0x00                            # pop  %ebx
  29.361 -        .byte 0x04                            # pop  %ecx
  29.362 -        .byte 0x08                            # pop  %edx
  29.363 -        .byte 0x0c                            # pop  %esi
  29.364 -        .byte 0x10                            # pop  %edi
  29.365 -        .byte 0x14                            # pop  %ebp
  29.366 -        .byte 0x18                            # pop  %eax
  29.367 -        .byte 0x1c                            # pop  %ds
  29.368 -        .byte 0x20                            # pop  %es
  29.369 -        .byte 0x24,0x24,0x24                  # add  $4,%esp
  29.370 -        .byte 0x28                            # iret
  29.371 -        .byte 0x00,0x00,0x00,0x00,0x00        # btrl $31,4(%esi)
  29.372 -        .byte 0x00,0x00                       # jmp  11b
  29.373 -
  29.374 -# Hypervisor uses this for application faults while it executes.
  29.375 -ENTRY(failsafe_callback)
  29.376 -1:      pop  %ds
  29.377 -2:      pop  %es
  29.378 -3:      pop  %fs
  29.379 -4:      pop  %gs
  29.380 -5:      iret
  29.381 -.section .fixup,"ax";	\
  29.382 -6:	movl $0,(%esp);	\
  29.383 -	jmp 1b;		\
  29.384 -7:	movl $0,(%esp);	\
  29.385 -	jmp 2b;		\
  29.386 -8:	movl $0,(%esp);	\
  29.387 -	jmp 3b;		\
  29.388 -9:	movl $0,(%esp);	\
  29.389 -	jmp 4b;		\
  29.390 -10:	pushl %ss;	\
  29.391 -	popl %ds;	\
  29.392 -	pushl %ss;	\
  29.393 -	popl %es;	\
  29.394 -	pushl $11;	\
  29.395 -	call do_exit;	\
  29.396 -.previous;		\
  29.397 -.section __ex_table,"a";\
  29.398 -	.align 4;	\
  29.399 -	.long 1b,6b;	\
  29.400 -	.long 2b,7b;	\
  29.401 -	.long 3b,8b;	\
  29.402 -	.long 4b,9b;	\
  29.403 -	.long 5b,10b;	\
  29.404 -.previous
  29.405 -        
  29.406 -ENTRY(coprocessor_error)
  29.407 -	pushl $0
  29.408 -	pushl $ SYMBOL_NAME(do_coprocessor_error)
  29.409 -	jmp error_code
  29.410 -
  29.411 -ENTRY(simd_coprocessor_error)
  29.412 -	pushl $0
  29.413 -	pushl $ SYMBOL_NAME(do_simd_coprocessor_error)
  29.414 -	jmp error_code
  29.415 -
  29.416 -ENTRY(device_not_available)
  29.417 -	pushl $-1		# mark this as an int
  29.418 -	SAVE_ALL
  29.419 -	GET_CURRENT(%ebx)
  29.420 -	call SYMBOL_NAME(math_state_restore)
  29.421 -	jmp ret_from_exception
  29.422 -
  29.423 -ENTRY(debug)
  29.424 -	pushl $0
  29.425 -	pushl $ SYMBOL_NAME(do_debug)
  29.426 -	jmp error_code
  29.427 -
  29.428 -ENTRY(int3)
  29.429 -	pushl $0
  29.430 -	pushl $ SYMBOL_NAME(do_int3)
  29.431 -	jmp error_code
  29.432 -
  29.433 -ENTRY(overflow)
  29.434 -	pushl $0
  29.435 -	pushl $ SYMBOL_NAME(do_overflow)
  29.436 -	jmp error_code
  29.437 -
  29.438 -ENTRY(bounds)
  29.439 -	pushl $0
  29.440 -	pushl $ SYMBOL_NAME(do_bounds)
  29.441 -	jmp error_code
  29.442 -
  29.443 -ENTRY(invalid_op)
  29.444 -	pushl $0
  29.445 -	pushl $ SYMBOL_NAME(do_invalid_op)
  29.446 -	jmp error_code
  29.447 -
  29.448 -ENTRY(coprocessor_segment_overrun)
  29.449 -	pushl $0
  29.450 -	pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun)
  29.451 -	jmp error_code
  29.452 -
  29.453 -ENTRY(double_fault)
  29.454 -	pushl $ SYMBOL_NAME(do_double_fault)
  29.455 -	jmp error_code
  29.456 -
  29.457 -ENTRY(invalid_TSS)
  29.458 -	pushl $ SYMBOL_NAME(do_invalid_TSS)
  29.459 -	jmp error_code
  29.460 -
  29.461 -ENTRY(segment_not_present)
  29.462 -	pushl $ SYMBOL_NAME(do_segment_not_present)
  29.463 -	jmp error_code
  29.464 -
  29.465 -ENTRY(stack_segment)
  29.466 -	pushl $ SYMBOL_NAME(do_stack_segment)
  29.467 -	jmp error_code
  29.468 -
  29.469 -ENTRY(general_protection)
  29.470 -	pushl $ SYMBOL_NAME(do_general_protection)
  29.471 -	jmp error_code
  29.472 -
  29.473 -ENTRY(alignment_check)
  29.474 -	pushl $ SYMBOL_NAME(do_alignment_check)
  29.475 -	jmp error_code
  29.476 -
  29.477 -# This handler is special, because it gets an extra value on its stack,
  29.478 -# which is the linear faulting address.
  29.479 -ENTRY(page_fault)
  29.480 -	pushl %ds
  29.481 -	pushl %eax
  29.482 -	xorl %eax,%eax
  29.483 -	pushl %ebp
  29.484 -	pushl %edi
  29.485 -	pushl %esi
  29.486 -	pushl %edx
  29.487 -	decl %eax			# eax = -1
  29.488 -	pushl %ecx
  29.489 -	pushl %ebx
  29.490 -	GET_CURRENT(%ebx)
  29.491 -	cld
  29.492 -	movl %es,%ecx
  29.493 -	movl ORIG_EAX(%esp), %esi	# get the error code
  29.494 -	movl ES(%esp), %edi		# get the faulting address
  29.495 -	movl %eax, ORIG_EAX(%esp)
  29.496 -	movl %ecx, ES(%esp)
  29.497 -	movl %esp,%edx
  29.498 -        pushl %edi                      # push the faulting address
  29.499 -	pushl %esi			# push the error code
  29.500 -	pushl %edx			# push the pt_regs pointer
  29.501 -	movl $(__KERNEL_DS),%edx
  29.502 -	movl %edx,%ds
  29.503 -	movl %edx,%es
  29.504 -	call SYMBOL_NAME(do_page_fault)
  29.505 -	addl $12,%esp
  29.506 -	jmp ret_from_exception
  29.507 -
  29.508 -ENTRY(machine_check)
  29.509 -	pushl $0
  29.510 -	pushl $ SYMBOL_NAME(do_machine_check)
  29.511 -	jmp error_code
  29.512 -
  29.513 -ENTRY(spurious_interrupt_bug)
  29.514 -	pushl $0
  29.515 -	pushl $ SYMBOL_NAME(do_spurious_interrupt_bug)
  29.516 -	jmp error_code
  29.517 -
  29.518 -.data
  29.519 -ENTRY(sys_call_table)
  29.520 -	.long SYMBOL_NAME(sys_ni_syscall)	/* 0  -  old "setup()" system call*/
  29.521 -	.long SYMBOL_NAME(sys_exit)
  29.522 -	.long SYMBOL_NAME(sys_fork)
  29.523 -	.long SYMBOL_NAME(sys_read)
  29.524 -	.long SYMBOL_NAME(sys_write)
  29.525 -	.long SYMBOL_NAME(sys_open)		/* 5 */
  29.526 -	.long SYMBOL_NAME(sys_close)
  29.527 -	.long SYMBOL_NAME(sys_waitpid)
  29.528 -	.long SYMBOL_NAME(sys_creat)
  29.529 -	.long SYMBOL_NAME(sys_link)
  29.530 -	.long SYMBOL_NAME(sys_unlink)		/* 10 */
  29.531 -	.long SYMBOL_NAME(sys_execve)
  29.532 -	.long SYMBOL_NAME(sys_chdir)
  29.533 -	.long SYMBOL_NAME(sys_time)
  29.534 -	.long SYMBOL_NAME(sys_mknod)
  29.535 -	.long SYMBOL_NAME(sys_chmod)		/* 15 */
  29.536 -	.long SYMBOL_NAME(sys_lchown16)
  29.537 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old break syscall holder */
  29.538 -	.long SYMBOL_NAME(sys_stat)
  29.539 -	.long SYMBOL_NAME(sys_lseek)
  29.540 -	.long SYMBOL_NAME(sys_getpid)		/* 20 */
  29.541 -	.long SYMBOL_NAME(sys_mount)
  29.542 -	.long SYMBOL_NAME(sys_oldumount)
  29.543 -	.long SYMBOL_NAME(sys_setuid16)
  29.544 -	.long SYMBOL_NAME(sys_getuid16)
  29.545 -	.long SYMBOL_NAME(sys_stime)		/* 25 */
  29.546 -	.long SYMBOL_NAME(sys_ptrace)
  29.547 -	.long SYMBOL_NAME(sys_alarm)
  29.548 -	.long SYMBOL_NAME(sys_fstat)
  29.549 -	.long SYMBOL_NAME(sys_pause)
  29.550 -	.long SYMBOL_NAME(sys_utime)		/* 30 */
  29.551 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old stty syscall holder */
  29.552 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old gtty syscall holder */
  29.553 -	.long SYMBOL_NAME(sys_access)
  29.554 -	.long SYMBOL_NAME(sys_nice)
  29.555 -	.long SYMBOL_NAME(sys_ni_syscall)	/* 35 */		/* old ftime syscall holder */
  29.556 -	.long SYMBOL_NAME(sys_sync)
  29.557 -	.long SYMBOL_NAME(sys_kill)
  29.558 -	.long SYMBOL_NAME(sys_rename)
  29.559 -	.long SYMBOL_NAME(sys_mkdir)
  29.560 -	.long SYMBOL_NAME(sys_rmdir)		/* 40 */
  29.561 -	.long SYMBOL_NAME(sys_dup)
  29.562 -	.long SYMBOL_NAME(sys_pipe)
  29.563 -	.long SYMBOL_NAME(sys_times)
  29.564 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old prof syscall holder */
  29.565 -	.long SYMBOL_NAME(sys_brk)		/* 45 */
  29.566 -	.long SYMBOL_NAME(sys_setgid16)
  29.567 -	.long SYMBOL_NAME(sys_getgid16)
  29.568 -	.long SYMBOL_NAME(sys_signal)
  29.569 -	.long SYMBOL_NAME(sys_geteuid16)
  29.570 -	.long SYMBOL_NAME(sys_getegid16)	/* 50 */
  29.571 -	.long SYMBOL_NAME(sys_acct)
  29.572 -	.long SYMBOL_NAME(sys_umount)					/* recycled never used phys() */
  29.573 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old lock syscall holder */
  29.574 -	.long SYMBOL_NAME(sys_ioctl)
  29.575 -	.long SYMBOL_NAME(sys_fcntl)		/* 55 */
  29.576 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old mpx syscall holder */
  29.577 -	.long SYMBOL_NAME(sys_setpgid)
  29.578 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old ulimit syscall holder */
  29.579 -	.long SYMBOL_NAME(sys_olduname)
  29.580 -	.long SYMBOL_NAME(sys_umask)		/* 60 */
  29.581 -	.long SYMBOL_NAME(sys_chroot)
  29.582 -	.long SYMBOL_NAME(sys_ustat)
  29.583 -	.long SYMBOL_NAME(sys_dup2)
  29.584 -	.long SYMBOL_NAME(sys_getppid)
  29.585 -	.long SYMBOL_NAME(sys_getpgrp)		/* 65 */
  29.586 -	.long SYMBOL_NAME(sys_setsid)
  29.587 -	.long SYMBOL_NAME(sys_sigaction)
  29.588 -	.long SYMBOL_NAME(sys_sgetmask)
  29.589 -	.long SYMBOL_NAME(sys_ssetmask)
  29.590 -	.long SYMBOL_NAME(sys_setreuid16)	/* 70 */
  29.591 -	.long SYMBOL_NAME(sys_setregid16)
  29.592 -	.long SYMBOL_NAME(sys_sigsuspend)
  29.593 -	.long SYMBOL_NAME(sys_sigpending)
  29.594 -	.long SYMBOL_NAME(sys_sethostname)
  29.595 -	.long SYMBOL_NAME(sys_setrlimit)	/* 75 */
  29.596 -	.long SYMBOL_NAME(sys_old_getrlimit)
  29.597 -	.long SYMBOL_NAME(sys_getrusage)
  29.598 -	.long SYMBOL_NAME(sys_gettimeofday)
  29.599 -	.long SYMBOL_NAME(sys_settimeofday)
  29.600 -	.long SYMBOL_NAME(sys_getgroups16)	/* 80 */
  29.601 -	.long SYMBOL_NAME(sys_setgroups16)
  29.602 -	.long SYMBOL_NAME(old_select)
  29.603 -	.long SYMBOL_NAME(sys_symlink)
  29.604 -	.long SYMBOL_NAME(sys_lstat)
  29.605 -	.long SYMBOL_NAME(sys_readlink)		/* 85 */
  29.606 -	.long SYMBOL_NAME(sys_uselib)
  29.607 -	.long SYMBOL_NAME(sys_swapon)
  29.608 -	.long SYMBOL_NAME(sys_reboot)
  29.609 -	.long SYMBOL_NAME(old_readdir)
  29.610 -	.long SYMBOL_NAME(old_mmap)		/* 90 */
  29.611 -	.long SYMBOL_NAME(sys_munmap)
  29.612 -	.long SYMBOL_NAME(sys_truncate)
  29.613 -	.long SYMBOL_NAME(sys_ftruncate)
  29.614 -	.long SYMBOL_NAME(sys_fchmod)
  29.615 -	.long SYMBOL_NAME(sys_fchown16)		/* 95 */
  29.616 -	.long SYMBOL_NAME(sys_getpriority)
  29.617 -	.long SYMBOL_NAME(sys_setpriority)
  29.618 -	.long SYMBOL_NAME(sys_ni_syscall)				/* old profil syscall holder */
  29.619 -	.long SYMBOL_NAME(sys_statfs)
  29.620 -	.long SYMBOL_NAME(sys_fstatfs)		/* 100 */
  29.621 -	.long SYMBOL_NAME(sys_ioperm)
  29.622 -	.long SYMBOL_NAME(sys_socketcall)
  29.623 -	.long SYMBOL_NAME(sys_syslog)
  29.624 -	.long SYMBOL_NAME(sys_setitimer)
  29.625 -	.long SYMBOL_NAME(sys_getitimer)	/* 105 */
  29.626 -	.long SYMBOL_NAME(sys_newstat)
  29.627 -	.long SYMBOL_NAME(sys_newlstat)
  29.628 -	.long SYMBOL_NAME(sys_newfstat)
  29.629 -	.long SYMBOL_NAME(sys_uname)
  29.630 -	.long SYMBOL_NAME(sys_iopl)		/* 110 */
  29.631 -	.long SYMBOL_NAME(sys_vhangup)
  29.632 -	.long SYMBOL_NAME(sys_ni_syscall)	/* old "idle" system call */
  29.633 -	.long SYMBOL_NAME(sys_ni_syscall) /* was VM86 */
  29.634 -	.long SYMBOL_NAME(sys_wait4)
  29.635 -	.long SYMBOL_NAME(sys_swapoff)		/* 115 */
  29.636 -	.long SYMBOL_NAME(sys_sysinfo)
  29.637 -	.long SYMBOL_NAME(sys_ipc)
  29.638 -	.long SYMBOL_NAME(sys_fsync)
  29.639 -	.long SYMBOL_NAME(sys_sigreturn)
  29.640 -	.long SYMBOL_NAME(sys_clone)		/* 120 */
  29.641 -	.long SYMBOL_NAME(sys_setdomainname)
  29.642 -	.long SYMBOL_NAME(sys_newuname)
  29.643 -	.long SYMBOL_NAME(sys_modify_ldt)
  29.644 -	.long SYMBOL_NAME(sys_adjtimex)
  29.645 -	.long SYMBOL_NAME(sys_mprotect)		/* 125 */
  29.646 -	.long SYMBOL_NAME(sys_sigprocmask)
  29.647 -	.long SYMBOL_NAME(sys_create_module)
  29.648 -	.long SYMBOL_NAME(sys_init_module)
  29.649 -	.long SYMBOL_NAME(sys_delete_module)
  29.650 -	.long SYMBOL_NAME(sys_get_kernel_syms)	/* 130 */
  29.651 -	.long SYMBOL_NAME(sys_quotactl)
  29.652 -	.long SYMBOL_NAME(sys_getpgid)
  29.653 -	.long SYMBOL_NAME(sys_fchdir)
  29.654 -	.long SYMBOL_NAME(sys_bdflush)
  29.655 -	.long SYMBOL_NAME(sys_sysfs)		/* 135 */
  29.656 -	.long SYMBOL_NAME(sys_personality)
  29.657 -	.long SYMBOL_NAME(sys_ni_syscall)	/* for afs_syscall */
  29.658 -	.long SYMBOL_NAME(sys_setfsuid16)
  29.659 -	.long SYMBOL_NAME(sys_setfsgid16)
  29.660 -	.long SYMBOL_NAME(sys_llseek)		/* 140 */
  29.661 -	.long SYMBOL_NAME(sys_getdents)
  29.662 -	.long SYMBOL_NAME(sys_select)
  29.663 -	.long SYMBOL_NAME(sys_flock)
  29.664 -	.long SYMBOL_NAME(sys_msync)
  29.665 -	.long SYMBOL_NAME(sys_readv)		/* 145 */
  29.666 -	.long SYMBOL_NAME(sys_writev)
  29.667 -	.long SYMBOL_NAME(sys_getsid)
  29.668 -	.long SYMBOL_NAME(sys_fdatasync)
  29.669 -	.long SYMBOL_NAME(sys_sysctl)
  29.670 -	.long SYMBOL_NAME(sys_mlock)		/* 150 */
  29.671 -	.long SYMBOL_NAME(sys_munlock)
  29.672 -	.long SYMBOL_NAME(sys_mlockall)
  29.673 -	.long SYMBOL_NAME(sys_munlockall)
  29.674 -	.long SYMBOL_NAME(sys_sched_setparam)
  29.675 -	.long SYMBOL_NAME(sys_sched_getparam)   /* 155 */
  29.676 -	.long SYMBOL_NAME(sys_sched_setscheduler)
  29.677 -	.long SYMBOL_NAME(sys_sched_getscheduler)
  29.678 -	.long SYMBOL_NAME(sys_sched_yield)
  29.679 -	.long SYMBOL_NAME(sys_sched_get_priority_max)
  29.680 -	.long SYMBOL_NAME(sys_sched_get_priority_min)  /* 160 */
  29.681 -	.long SYMBOL_NAME(sys_sched_rr_get_interval)
  29.682 -	.long SYMBOL_NAME(sys_nanosleep)
  29.683 -	.long SYMBOL_NAME(sys_mremap)
  29.684 -	.long SYMBOL_NAME(sys_setresuid16)
  29.685 -	.long SYMBOL_NAME(sys_getresuid16)	/* 165 */
  29.686 -	.long SYMBOL_NAME(sys_ni_syscall) /* was VM86 */
  29.687 -	.long SYMBOL_NAME(sys_query_module)
  29.688 -	.long SYMBOL_NAME(sys_poll)
  29.689 -	.long SYMBOL_NAME(sys_nfsservctl)
  29.690 -	.long SYMBOL_NAME(sys_setresgid16)	/* 170 */
  29.691 -	.long SYMBOL_NAME(sys_getresgid16)
  29.692 -	.long SYMBOL_NAME(sys_prctl)
  29.693 -	.long SYMBOL_NAME(sys_rt_sigreturn)
  29.694 -	.long SYMBOL_NAME(sys_rt_sigaction)
  29.695 -	.long SYMBOL_NAME(sys_rt_sigprocmask)	/* 175 */
  29.696 -	.long SYMBOL_NAME(sys_rt_sigpending)
  29.697 -	.long SYMBOL_NAME(sys_rt_sigtimedwait)
  29.698 -	.long SYMBOL_NAME(sys_rt_sigqueueinfo)
  29.699 -	.long SYMBOL_NAME(sys_rt_sigsuspend)
  29.700 -	.long SYMBOL_NAME(sys_pread)		/* 180 */
  29.701 -	.long SYMBOL_NAME(sys_pwrite)
  29.702 -	.long SYMBOL_NAME(sys_chown16)
  29.703 -	.long SYMBOL_NAME(sys_getcwd)
  29.704 -	.long SYMBOL_NAME(sys_capget)
  29.705 -	.long SYMBOL_NAME(sys_capset)           /* 185 */
  29.706 -	.long SYMBOL_NAME(sys_sigaltstack)
  29.707 -	.long SYMBOL_NAME(sys_sendfile)
  29.708 -	.long SYMBOL_NAME(sys_ni_syscall)		/* streams1 */
  29.709 -	.long SYMBOL_NAME(sys_ni_syscall)		/* streams2 */
  29.710 -	.long SYMBOL_NAME(sys_vfork)            /* 190 */
  29.711 -	.long SYMBOL_NAME(sys_getrlimit)
  29.712 -	.long SYMBOL_NAME(sys_mmap2)
  29.713 -	.long SYMBOL_NAME(sys_truncate64)
  29.714 -	.long SYMBOL_NAME(sys_ftruncate64)
  29.715 -	.long SYMBOL_NAME(sys_stat64)		/* 195 */
  29.716 -	.long SYMBOL_NAME(sys_lstat64)
  29.717 -	.long SYMBOL_NAME(sys_fstat64)
  29.718 -	.long SYMBOL_NAME(sys_lchown)
  29.719 -	.long SYMBOL_NAME(sys_getuid)
  29.720 -	.long SYMBOL_NAME(sys_getgid)		/* 200 */
  29.721 -	.long SYMBOL_NAME(sys_geteuid)
  29.722 -	.long SYMBOL_NAME(sys_getegid)
  29.723 -	.long SYMBOL_NAME(sys_setreuid)
  29.724 -	.long SYMBOL_NAME(sys_setregid)
  29.725 -	.long SYMBOL_NAME(sys_getgroups)	/* 205 */
  29.726 -	.long SYMBOL_NAME(sys_setgroups)
  29.727 -	.long SYMBOL_NAME(sys_fchown)
  29.728 -	.long SYMBOL_NAME(sys_setresuid)
  29.729 -	.long SYMBOL_NAME(sys_getresuid)
  29.730 -	.long SYMBOL_NAME(sys_setresgid)	/* 210 */
  29.731 -	.long SYMBOL_NAME(sys_getresgid)
  29.732 -	.long SYMBOL_NAME(sys_chown)
  29.733 -	.long SYMBOL_NAME(sys_setuid)
  29.734 -	.long SYMBOL_NAME(sys_setgid)
  29.735 -	.long SYMBOL_NAME(sys_setfsuid)		/* 215 */
  29.736 -	.long SYMBOL_NAME(sys_setfsgid)
  29.737 -	.long SYMBOL_NAME(sys_pivot_root)
  29.738 -	.long SYMBOL_NAME(sys_mincore)
  29.739 -	.long SYMBOL_NAME(sys_madvise)
  29.740 -	.long SYMBOL_NAME(sys_getdents64)	/* 220 */
  29.741 -	.long SYMBOL_NAME(sys_fcntl64)
  29.742 -	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for TUX */
  29.743 -	.long SYMBOL_NAME(sys_ni_syscall)	/* Reserved for Security */
  29.744 -	.long SYMBOL_NAME(sys_gettid)
  29.745 -	.long SYMBOL_NAME(sys_readahead)	/* 225 */
  29.746 -	.long SYMBOL_NAME(sys_setxattr)
  29.747 -	.long SYMBOL_NAME(sys_lsetxattr)
  29.748 -	.long SYMBOL_NAME(sys_fsetxattr)
  29.749 -	.long SYMBOL_NAME(sys_getxattr)
  29.750 -	.long SYMBOL_NAME(sys_lgetxattr)	/* 230 */
  29.751 -	.long SYMBOL_NAME(sys_fgetxattr)
  29.752 -	.long SYMBOL_NAME(sys_listxattr)
  29.753 -	.long SYMBOL_NAME(sys_llistxattr)
  29.754 -	.long SYMBOL_NAME(sys_flistxattr)
  29.755 -	.long SYMBOL_NAME(sys_removexattr)	/* 235 */
  29.756 -	.long SYMBOL_NAME(sys_lremovexattr)
  29.757 -	.long SYMBOL_NAME(sys_fremovexattr)
  29.758 - 	.long SYMBOL_NAME(sys_tkill)
  29.759 -	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for sendfile64 */
  29.760 -	.long SYMBOL_NAME(sys_ni_syscall)	/* 240 reserved for futex */
  29.761 -	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for sched_setaffinity */
  29.762 -	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for sched_getaffinity */
  29.763 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_set_thread_area */
  29.764 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_get_thread_area */
  29.765 -	.long SYMBOL_NAME(sys_ni_syscall)	/* 245 sys_io_setup */
  29.766 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_io_destroy */
  29.767 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_io_getevents */
  29.768 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_io_submit */
  29.769 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_io_cancel */
  29.770 -	.long SYMBOL_NAME(sys_ni_syscall)	/* 250 sys_alloc_hugepages */
  29.771 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_free_hugepages */
  29.772 -	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_exit_group */
  29.773 -
  29.774 -	.rept NR_syscalls-(.-sys_call_table)/4
  29.775 -		.long SYMBOL_NAME(sys_ni_syscall)
  29.776 -	.endr
    30.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/head.S	Tue Jun 24 12:05:12 2003 +0000
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,70 +0,0 @@
    30.4 -
    30.5 -.text
    30.6 -#include <linux/config.h>
    30.7 -#include <linux/threads.h>
    30.8 -#include <linux/linkage.h>
    30.9 -#include <asm/segment.h>
   30.10 -#include <asm/page.h>
   30.11 -#include <asm/pgtable.h>
   30.12 -#include <asm/desc.h>
   30.13 -
   30.14 -/* Offsets in start_info structure */
   30.15 -#define SHARED_INFO  4
   30.16 -#define MOD_START   12
   30.17 -#define MOD_LEN     16
   30.18 -                
   30.19 -startup_32:
   30.20 -        cld
   30.21 -        
   30.22 -        lss stack_start,%esp
   30.23 -
   30.24 -        /* Copy initrd somewhere safe before it's clobbered by BSS. */
   30.25 -        mov  MOD_LEN(%esi),%ecx
   30.26 -        shr  $2,%ecx
   30.27 -        jz   2f        /* bail from copy loop if no initrd */
   30.28 -        mov  $SYMBOL_NAME(_end),%edi
   30.29 -        add  MOD_LEN(%esi),%edi
   30.30 -        mov  MOD_START(%esi),%eax
   30.31 -        add  MOD_LEN(%esi),%eax
   30.32 -1:      sub  $4,%eax
   30.33 -        sub  $4,%edi
   30.34 -        mov  (%eax),%ebx
   30.35 -        mov  %ebx,(%edi)
   30.36 -        loop 1b
   30.37 -        mov  %edi,MOD_START(%esi)
   30.38 -                
   30.39 -        /* Clear BSS first so that there are no surprises... */
   30.40 -2:      xorl %eax,%eax
   30.41 -	movl $SYMBOL_NAME(__bss_start),%edi
   30.42 -	movl $SYMBOL_NAME(_end),%ecx
   30.43 -	subl %edi,%ecx
   30.44 -	rep stosb
   30.45 -
   30.46 -        /* Copy the necessary stuff from start_info structure. */
   30.47 -        /* We need to copy shared_info early, so that sti/cli work */
   30.48 -        mov  SHARED_INFO(%esi),%eax
   30.49 -        mov  %eax,SYMBOL_NAME(HYPERVISOR_shared_info)
   30.50 -        mov  $SYMBOL_NAME(start_info_union),%edi
   30.51 -        mov  $128,%ecx
   30.52 -        rep movsl
   30.53 -                
   30.54 -        jmp SYMBOL_NAME(start_kernel)
   30.55 -
   30.56 -ENTRY(stack_start)
   30.57 -	.long SYMBOL_NAME(init_task_union)+8192, __KERNEL_DS
   30.58 -
   30.59 -.org 0x1000
   30.60 -ENTRY(empty_zero_page)
   30.61 -
   30.62 -.org 0x2000
   30.63 -ENTRY(default_ldt)
   30.64 -
   30.65 -.org 0x3000
   30.66 -ENTRY(cpu0_pte_quicklist)
   30.67 -
   30.68 -.org 0x3400
   30.69 -ENTRY(cpu0_pgd_quicklist)
   30.70 -        
   30.71 -.org 0x3800
   30.72 -ENTRY(stext)
   30.73 -ENTRY(_stext)
    31.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/hypervisor.c	Tue Jun 24 12:05:12 2003 +0000
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,128 +0,0 @@
    31.4 -/******************************************************************************
    31.5 - * hypervisor.c
    31.6 - * 
    31.7 - * Communication to/from hypervisor.
    31.8 - * 
    31.9 - * Copyright (c) 2002, K A Fraser
   31.10 - */
   31.11 -
   31.12 -#include <linux/config.h>
   31.13 -#include <asm/atomic.h>
   31.14 -#include <linux/irq.h>
   31.15 -#include <asm/hypervisor.h>
   31.16 -#include <asm/system.h>
   31.17 -#include <asm/ptrace.h>
   31.18 -
   31.19 -multicall_entry_t multicall_list[8];
   31.20 -int nr_multicall_ents = 0;
   31.21 -
   31.22 -static unsigned long event_mask = 0;
   31.23 -
   31.24 -void frobb(void) {}
   31.25 -
   31.26 -void do_hypervisor_callback(struct pt_regs *regs)
   31.27 -{
   31.28 -    unsigned long events, flags;
   31.29 -    shared_info_t *shared = HYPERVISOR_shared_info;
   31.30 -
   31.31 -    do {
   31.32 -        /* Specialised local_irq_save(). */
   31.33 -        flags = test_and_clear_bit(EVENTS_MASTER_ENABLE_BIT, 
   31.34 -                                   &shared->events_mask);
   31.35 -        barrier();
   31.36 -
   31.37 -        events  = xchg(&shared->events, 0);
   31.38 -        events &= event_mask;
   31.39 -
   31.40 -        __asm__ __volatile__ (
   31.41 -            "   push %1                            ;"
   31.42 -            "   sub  $4,%%esp                      ;"
   31.43 -            "   jmp  2f                            ;"
   31.44 -            "1: btrl %%eax,%0                      ;" /* clear bit     */
   31.45 -            "   mov  %%eax,(%%esp)                 ;"
   31.46 -            "   call do_IRQ                        ;" /* do_IRQ(event) */
   31.47 -            "2: bsfl %0,%%eax                      ;" /* %eax == bit # */
   31.48 -            "   jnz  1b                            ;"
   31.49 -            "   add  $8,%%esp                      ;"
   31.50 -            /* we use %ebx because it is callee-saved */
   31.51 -            : : "b" (events), "r" (regs)
   31.52 -            /* clobbered by callback function calls */
   31.53 -            : "eax", "ecx", "edx", "memory" ); 
   31.54 -
   31.55 -        /* Specialised local_irq_restore(). */
   31.56 -        if ( flags ) set_bit(EVENTS_MASTER_ENABLE_BIT, &shared->events_mask);
   31.57 -        barrier();
   31.58 -    }
   31.59 -    while ( shared->events );
   31.60 -}
   31.61 -
   31.62 -
   31.63 -
   31.64 -/*
   31.65 - * Define interface to generic handling in irq.c
   31.66 - */
   31.67 -
   31.68 -static void shutdown_hypervisor_event(unsigned int irq)
   31.69 -{
   31.70 -    clear_bit(irq, &event_mask);
   31.71 -    clear_bit(irq, &HYPERVISOR_shared_info->events_mask);
   31.72 -}
   31.73 -
   31.74 -static void enable_hypervisor_event(unsigned int irq)
   31.75 -{
   31.76 -    set_bit(irq, &event_mask);
   31.77 -    set_bit(irq, &HYPERVISOR_shared_info->events_mask);
   31.78 -    if ( test_bit(EVENTS_MASTER_ENABLE_BIT, 
   31.79 -                  &HYPERVISOR_shared_info->events_mask) )
   31.80 -        do_hypervisor_callback(NULL);
   31.81 -}
   31.82 -
   31.83 -static void disable_hypervisor_event(unsigned int irq)
   31.84 -{
   31.85 -    clear_bit(irq, &event_mask);
   31.86 -    clear_bit(irq, &HYPERVISOR_shared_info->events_mask);
   31.87 -}
   31.88 -
   31.89 -static void ack_hypervisor_event(unsigned int irq)
   31.90 -{
   31.91 -    if ( !(event_mask & (1<<irq)) )
   31.92 -    {
   31.93 -        printk("Unexpected hypervisor event %d\n", irq);
   31.94 -        atomic_inc(&irq_err_count);
   31.95 -    }
   31.96 -    set_bit(irq, &HYPERVISOR_shared_info->events_mask);
   31.97 -}
   31.98 -
   31.99 -static unsigned int startup_hypervisor_event(unsigned int irq)
  31.100 -{
  31.101 -    enable_hypervisor_event(irq);
  31.102 -    return 0;
  31.103 -}
  31.104 -
  31.105 -static void end_hypervisor_event(unsigned int irq)
  31.106 -{
  31.107 -}
  31.108 -
  31.109 -static struct hw_interrupt_type hypervisor_irq_type = {
  31.110 -    "Hypervisor-event",
  31.111 -    startup_hypervisor_event,
  31.112 -    shutdown_hypervisor_event,
  31.113 -    enable_hypervisor_event,
  31.114 -    disable_hypervisor_event,
  31.115 -    ack_hypervisor_event,
  31.116 -    end_hypervisor_event,
  31.117 -    NULL
  31.118 -};
  31.119 -
  31.120 -void __init init_IRQ(void)
  31.121 -{
  31.122 -    int i;
  31.123 -
  31.124 -    for ( i = 0; i < NR_IRQS; i++ )
  31.125 -    {
  31.126 -        irq_desc[i].status  = IRQ_DISABLED;
  31.127 -        irq_desc[i].action  = 0;
  31.128 -        irq_desc[i].depth   = 1;
  31.129 -        irq_desc[i].handler = &hypervisor_irq_type;
  31.130 -    }
  31.131 -}
    32.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/i386_ksyms.c	Tue Jun 24 12:05:12 2003 +0000
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,154 +0,0 @@
    32.4 -#include <linux/config.h>
    32.5 -#include <linux/module.h>
    32.6 -#include <linux/smp.h>
    32.7 -#include <linux/user.h>
    32.8 -#include <linux/elfcore.h>
    32.9 -#include <linux/mca.h>
   32.10 -#include <linux/sched.h>
   32.11 -#include <linux/in6.h>
   32.12 -#include <linux/interrupt.h>
   32.13 -#include <linux/smp_lock.h>
   32.14 -#include <linux/pm.h>
   32.15 -//XXX ??? #include <linux/pci.h>
   32.16 -#include <linux/apm_bios.h>
   32.17 -#include <linux/kernel.h>
   32.18 -#include <linux/string.h>
   32.19 -#include <linux/tty.h>
   32.20 -
   32.21 -#include <asm/semaphore.h>
   32.22 -#include <asm/processor.h>
   32.23 -#include <asm/i387.h>
   32.24 -#include <asm/uaccess.h>
   32.25 -#include <asm/checksum.h>
   32.26 -#include <asm/io.h>
   32.27 -#include <asm/hardirq.h>
   32.28 -#include <asm/delay.h>
   32.29 -#include <asm/irq.h>
   32.30 -#include <asm/mmx.h>
   32.31 -#include <asm/desc.h>
   32.32 -#include <asm/pgtable.h>
   32.33 -#include <asm/pgalloc.h>
   32.34 -
   32.35 -extern void dump_thread(struct pt_regs *, struct user *);
   32.36 -extern spinlock_t rtc_lock;
   32.37 -
   32.38 -#if defined(CONFIG_APMXXX) || defined(CONFIG_APM_MODULEXXX)
   32.39 -extern void machine_real_restart(unsigned char *, int);
   32.40 -EXPORT_SYMBOL(machine_real_restart);
   32.41 -extern void default_idle(void);
   32.42 -EXPORT_SYMBOL(default_idle);
   32.43 -#endif
   32.44 -
   32.45 -#ifdef CONFIG_SMP
   32.46 -extern void FASTCALL( __write_lock_failed(rwlock_t *rw));
   32.47 -extern void FASTCALL( __read_lock_failed(rwlock_t *rw));
   32.48 -#endif
   32.49 -
   32.50 -#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
   32.51 -extern struct drive_info_struct drive_info;
   32.52 -EXPORT_SYMBOL(drive_info);
   32.53 -#endif
   32.54 -
   32.55 -// XXX extern unsigned long get_cmos_time(void);
   32.56 -
   32.57 -/* platform dependent support */
   32.58 -EXPORT_SYMBOL(boot_cpu_data);
   32.59 -EXPORT_SYMBOL(__verify_write);
   32.60 -EXPORT_SYMBOL(dump_thread);
   32.61 -EXPORT_SYMBOL(dump_fpu);
   32.62 -EXPORT_SYMBOL(dump_extended_fpu);
   32.63 -EXPORT_SYMBOL(enable_irq);
   32.64 -EXPORT_SYMBOL(disable_irq);
   32.65 -EXPORT_SYMBOL(disable_irq_nosync);
   32.66 -EXPORT_SYMBOL(probe_irq_mask);
   32.67 -EXPORT_SYMBOL(kernel_thread);
   32.68 -EXPORT_SYMBOL(pm_idle);
   32.69 -EXPORT_SYMBOL(pm_power_off);
   32.70 -EXPORT_SYMBOL(apm_info);
   32.71 -//EXPORT_SYMBOL(gdt);
   32.72 -EXPORT_SYMBOL(empty_zero_page);
   32.73 -
   32.74 -#ifdef CONFIG_DEBUG_IOVIRT
   32.75 -EXPORT_SYMBOL(__io_virt_debug);
   32.76 -#endif
   32.77 -
   32.78 -EXPORT_SYMBOL_NOVERS(__down_failed);
   32.79 -EXPORT_SYMBOL_NOVERS(__down_failed_interruptible);
   32.80 -EXPORT_SYMBOL_NOVERS(__down_failed_trylock);
   32.81 -EXPORT_SYMBOL_NOVERS(__up_wakeup);
   32.82 -/* Networking helper routines. */
   32.83 -EXPORT_SYMBOL(csum_partial_copy_generic);
   32.84 -/* Delay loops */
   32.85 -EXPORT_SYMBOL(__udelay);
   32.86 -EXPORT_SYMBOL(__delay);
   32.87 -EXPORT_SYMBOL(__const_udelay);
   32.88 -
   32.89 -EXPORT_SYMBOL_NOVERS(__get_user_1);
   32.90 -EXPORT_SYMBOL_NOVERS(__get_user_2);
   32.91 -EXPORT_SYMBOL_NOVERS(__get_user_4);
   32.92 -
   32.93 -EXPORT_SYMBOL(strtok);
   32.94 -EXPORT_SYMBOL(strpbrk);
   32.95 -EXPORT_SYMBOL(strstr);
   32.96 -
   32.97 -EXPORT_SYMBOL(strncpy_from_user);
   32.98 -EXPORT_SYMBOL(__strncpy_from_user);
   32.99 -EXPORT_SYMBOL(clear_user);
  32.100 -EXPORT_SYMBOL(__clear_user);
  32.101 -EXPORT_SYMBOL(__generic_copy_from_user);
  32.102 -EXPORT_SYMBOL(__generic_copy_to_user);
  32.103 -EXPORT_SYMBOL(strnlen_user);
  32.104 -
  32.105 -#ifdef CONFIG_X86_USE_3DNOW
  32.106 -EXPORT_SYMBOL(_mmx_memcpy);
  32.107 -EXPORT_SYMBOL(mmx_clear_page);
  32.108 -EXPORT_SYMBOL(mmx_copy_page);
  32.109 -#endif
  32.110 -
  32.111 -#ifdef CONFIG_SMP
  32.112 -EXPORT_SYMBOL(cpu_data);
  32.113 -EXPORT_SYMBOL(kernel_flag_cacheline);
  32.114 -EXPORT_SYMBOL(smp_num_cpus);
  32.115 -EXPORT_SYMBOL(cpu_online_map);
  32.116 -EXPORT_SYMBOL_NOVERS(__write_lock_failed);
  32.117 -EXPORT_SYMBOL_NOVERS(__read_lock_failed);
  32.118 -
  32.119 -/* Global SMP irq stuff */
  32.120 -EXPORT_SYMBOL(synchronize_irq);
  32.121 -EXPORT_SYMBOL(global_irq_holder);
  32.122 -EXPORT_SYMBOL(__global_cli);
  32.123 -EXPORT_SYMBOL(__global_sti);
  32.124 -EXPORT_SYMBOL(__global_save_flags);
  32.125 -EXPORT_SYMBOL(__global_restore_flags);
  32.126 -EXPORT_SYMBOL(smp_call_function);
  32.127 -
  32.128 -/* TLB flushing */
  32.129 -EXPORT_SYMBOL(flush_tlb_page);
  32.130 -#endif
  32.131 -
  32.132 -#ifdef CONFIG_X86_IO_APIC
  32.133 -EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector);
  32.134 -#endif
  32.135 -
  32.136 -#ifdef CONFIG_VT
  32.137 -EXPORT_SYMBOL(screen_info);
  32.138 -#endif
  32.139 -
  32.140 -EXPORT_SYMBOL(get_wchan);
  32.141 -
  32.142 -EXPORT_SYMBOL(rtc_lock);
  32.143 -
  32.144 -#undef memcpy
  32.145 -#undef memset
  32.146 -extern void * memset(void *,int,__kernel_size_t);
  32.147 -extern void * memcpy(void *,const void *,__kernel_size_t);
  32.148 -EXPORT_SYMBOL_NOVERS(memcpy);
  32.149 -EXPORT_SYMBOL_NOVERS(memset);
  32.150 -
  32.151 -#ifdef CONFIG_HAVE_DEC_LOCK
  32.152 -EXPORT_SYMBOL(atomic_dec_and_lock);
  32.153 -#endif
  32.154 -
  32.155 -#ifdef CONFIG_MULTIQUAD
  32.156 -EXPORT_SYMBOL(xquad_portio);
  32.157 -#endif
    33.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ioport.c	Tue Jun 24 12:05:12 2003 +0000
    33.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.3 @@ -1,46 +0,0 @@
    33.4 -#include <linux/sched.h>
    33.5 -#include <linux/kernel.h>
    33.6 -#include <linux/errno.h>
    33.7 -#include <linux/types.h>
    33.8 -#include <linux/stddef.h>
    33.9 -
   33.10 -
   33.11 -asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on)
   33.12 -{
   33.13 -    /* No IO permission! Selective IO perms aren't virtualised yet. */
   33.14 -    return -EPERM;
   33.15 -}
   33.16 -
   33.17 -
   33.18 -asmlinkage int sys_iopl(unsigned long unused)
   33.19 -{
   33.20 -    struct pt_regs *regs = (struct pt_regs *)&unused;
   33.21 -    unsigned int new_io_pl = regs->ebx & 3;
   33.22 -    unsigned int old_io_pl = current->thread.io_pl;
   33.23 -    unsigned int new_hypercall_pl = (regs->ebx >> 2) & 3;
   33.24 -    unsigned int old_hypercall_pl = current->thread.hypercall_pl;
   33.25 -
   33.26 -    /* Need "raw I/O" privileges for direct port access. */
   33.27 -    if ( (new_io_pl > old_io_pl) && 
   33.28 -         (!capable(CAP_SYS_RAWIO) || !(start_info.flags & SIF_PRIVILEGED)) )
   33.29 -        return -EPERM;
   33.30 -
   33.31 -    /* Just need generic root/admin privileges for direct hypercall access. */
   33.32 -    if ( (new_hypercall_pl > old_hypercall_pl) && !capable(CAP_SYS_ADMIN) )
   33.33 -        return -EPERM;
   33.34 -
   33.35 -    /* Maintain OS privileges even if user attempts to relinquish them. */
   33.36 -    if ( new_hypercall_pl == 0 )
   33.37 -        new_hypercall_pl = 1;
   33.38 -    if ( (new_io_pl == 0) && (start_info.flags & SIF_PRIVILEGED) )
   33.39 -        new_io_pl = 1;
   33.40 -
   33.41 -    /* Change our version of the privilege levels. */
   33.42 -    current->thread.io_pl        = new_io_pl;
   33.43 -    current->thread.hypercall_pl = new_hypercall_pl;
   33.44 -
   33.45 -    /* Force the change at ring 0. */
   33.46 -    HYPERVISOR_set_priv_levels(new_io_pl, new_hypercall_pl);
   33.47 -
   33.48 -    return 0;
   33.49 -}
    34.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/irq.c	Tue Jun 24 12:05:12 2003 +0000
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,1136 +0,0 @@
    34.4 -/*
    34.5 - *	linux/arch/i386/kernel/irq.c
    34.6 - *
    34.7 - *	Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
    34.8 - *
    34.9 - * This file contains the code used by various IRQ handling routines:
   34.10 - * asking for different IRQ's should be done through these routines
   34.11 - * instead of just grabbing them. Thus setups with different IRQ numbers
   34.12 - * shouldn't result in any weird surprises, and installing new handlers
   34.13 - * should be easier.
   34.14 - */
   34.15 -
   34.16 -/*
   34.17 - * (mostly architecture independent, will move to kernel/irq.c in 2.5.)
   34.18 - *
   34.19 - * IRQs are in fact implemented a bit like signal handlers for the kernel.
   34.20 - * Naturally it's not a 1:1 relation, but there are similarities.
   34.21 - */
   34.22 -
   34.23 -#include <linux/config.h>
   34.24 -#include <linux/ptrace.h>
   34.25 -#include <linux/errno.h>
   34.26 -#include <linux/signal.h>
   34.27 -#include <linux/sched.h>
   34.28 -#include <linux/ioport.h>
   34.29 -#include <linux/interrupt.h>
   34.30 -#include <linux/timex.h>
   34.31 -#include <linux/slab.h>
   34.32 -#include <linux/random.h>
   34.33 -#include <linux/smp_lock.h>
   34.34 -#include <linux/init.h>
   34.35 -#include <linux/kernel_stat.h>
   34.36 -#include <linux/irq.h>
   34.37 -#include <linux/proc_fs.h>
   34.38 -
   34.39 -#include <asm/atomic.h>
   34.40 -#include <asm/io.h>
   34.41 -#include <asm/smp.h>
   34.42 -#include <asm/system.h>
   34.43 -#include <asm/bitops.h>
   34.44 -#include <asm/uaccess.h>
   34.45 -#include <asm/pgalloc.h>
   34.46 -#include <asm/delay.h>
   34.47 -#include <asm/desc.h>
   34.48 -#include <asm/irq.h>
   34.49 -
   34.50 -
   34.51 -
   34.52 -/*
   34.53 - * Linux has a controller-independent x86 interrupt architecture.
   34.54 - * every controller has a 'controller-template', that is used
   34.55 - * by the main code to do the right thing. Each driver-visible
   34.56 - * interrupt source is transparently wired to the apropriate
   34.57 - * controller. Thus drivers need not be aware of the
   34.58 - * interrupt-controller.
   34.59 - *
   34.60 - * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
   34.61 - * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
   34.62 - * (IO-APICs assumed to be messaging to Pentium local-APICs)
   34.63 - *
   34.64 - * the code is designed to be easily extended with new/different
   34.65 - * interrupt controllers, without having to do assembly magic.
   34.66 - */
   34.67 -
   34.68 -/*
   34.69 - * Controller mappings for all interrupt sources:
   34.70 - */
   34.71 -irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned =
   34.72 -	{ [0 ... NR_IRQS-1] = { 0, &no_irq_type, NULL, 0, SPIN_LOCK_UNLOCKED}};
   34.73 -
   34.74 -static void register_irq_proc (unsigned int irq);
   34.75 -
   34.76 -/*
   34.77 - * Special irq handlers.
   34.78 - */
   34.79 -
   34.80 -void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
   34.81 -
   34.82 -/*
   34.83 - * Generic no controller code
   34.84 - */
   34.85 -
   34.86 -static void enable_none(unsigned int irq) { }
   34.87 -static unsigned int startup_none(unsigned int irq) { return 0; }
   34.88 -static void disable_none(unsigned int irq) { }
   34.89 -static void ack_none(unsigned int irq)
   34.90 -{
   34.91 -	printk("unexpected IRQ trap at vector %02x\n", irq);
   34.92 -}
   34.93 -
   34.94 -/* startup is the same as "enable", shutdown is same as "disable" */
   34.95 -#define shutdown_none	disable_none
   34.96 -#define end_none	enable_none
   34.97 -
   34.98 -struct hw_interrupt_type no_irq_type = {
   34.99 -	"none",
  34.100 -	startup_none,
  34.101 -	shutdown_none,
  34.102 -	enable_none,
  34.103 -	disable_none,
  34.104 -	ack_none,
  34.105 -	end_none
  34.106 -};
  34.107 -
  34.108 -atomic_t irq_err_count;
  34.109 -#ifdef CONFIG_X86_IO_APIC
  34.110 -#ifdef APIC_MISMATCH_DEBUG
  34.111 -atomic_t irq_mis_count;
  34.112 -#endif
  34.113 -#endif
  34.114 -
  34.115 -/*
  34.116 - * Generic, controller-independent functions:
  34.117 - */
  34.118 -
  34.119 -int get_irq_list(char *buf)
  34.120 -{
  34.121 -	int i, j;
  34.122 -	struct irqaction * action;
  34.123 -	char *p = buf;
  34.124 -
  34.125 -	p += sprintf(p, "           ");
  34.126 -	for (j=0; j<smp_num_cpus; j++)
  34.127 -		p += sprintf(p, "CPU%d       ",j);
  34.128 -	*p++ = '\n';
  34.129 -
  34.130 -	for (i = 0 ; i < NR_IRQS ; i++) {
  34.131 -		action = irq_desc[i].action;
  34.132 -		if (!action) 
  34.133 -			continue;
  34.134 -		p += sprintf(p, "%3d: ",i);
  34.135 -#ifndef CONFIG_SMP
  34.136 -		p += sprintf(p, "%10u ", kstat_irqs(i));
  34.137 -#else
  34.138 -		for (j = 0; j < smp_num_cpus; j++)
  34.139 -			p += sprintf(p, "%10u ",
  34.140 -				kstat.irqs[cpu_logical_map(j)][i]);
  34.141 -#endif
  34.142 -		p += sprintf(p, " %14s", irq_desc[i].handler->typename);
  34.143 -		p += sprintf(p, "  %s", action->name);
  34.144 -
  34.145 -		for (action=action->next; action; action = action->next)
  34.146 -			p += sprintf(p, ", %s", action->name);
  34.147 -		*p++ = '\n';
  34.148 -	}
  34.149 -	p += sprintf(p, "NMI: ");
  34.150 -	for (j = 0; j < smp_num_cpus; j++)
  34.151 -		p += sprintf(p, "%10u ",
  34.152 -			nmi_count(cpu_logical_map(j)));
  34.153 -	p += sprintf(p, "\n");
  34.154 -#if CONFIG_X86_LOCAL_APIC
  34.155 -	p += sprintf(p, "LOC: ");
  34.156 -	for (j = 0; j < smp_num_cpus; j++)
  34.157 -		p += sprintf(p, "%10u ",
  34.158 -			apic_timer_irqs[cpu_logical_map(j)]);
  34.159 -	p += sprintf(p, "\n");
  34.160 -#endif
  34.161 -	p += sprintf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
  34.162 -#ifdef CONFIG_X86_IO_APIC
  34.163 -#ifdef APIC_MISMATCH_DEBUG
  34.164 -	p += sprintf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));
  34.165 -#endif
  34.166 -#endif
  34.167 -	return p - buf;
  34.168 -}
  34.169 -
  34.170 -
  34.171 -/*
  34.172 - * Global interrupt locks for SMP. Allow interrupts to come in on any
  34.173 - * CPU, yet make cli/sti act globally to protect critical regions..
  34.174 - */
  34.175 -
  34.176 -#ifdef CONFIG_SMP
  34.177 -unsigned char global_irq_holder = NO_PROC_ID;
  34.178 -unsigned volatile long global_irq_lock; /* pendantic: long for set_bit --RR */
  34.179 -
  34.180 -extern void show_stack(unsigned long* esp);
  34.181 -
  34.182 -static void show(char * str)
  34.183 -{
  34.184 -	int i;
  34.185 -	int cpu = smp_processor_id();
  34.186 -
  34.187 -	printk("\n%s, CPU %d:\n", str, cpu);
  34.188 -	printk("irq:  %d [",irqs_running());
  34.189 -	for(i=0;i < smp_num_cpus;i++)
  34.190 -		printk(" %d",local_irq_count(i));
  34.191 -	printk(" ]\nbh:   %d [",spin_is_locked(&global_bh_lock) ? 1 : 0);
  34.192 -	for(i=0;i < smp_num_cpus;i++)
  34.193 -		printk(" %d",local_bh_count(i));
  34.194 -
  34.195 -	printk(" ]\nStack dumps:");
  34.196 -	for(i = 0; i < smp_num_cpus; i++) {
  34.197 -		unsigned long esp;
  34.198 -		if (i == cpu)
  34.199 -			continue;
  34.200 -		printk("\nCPU %d:",i);
  34.201 -		esp = init_tss[i].esp0;
  34.202 -		if (!esp) {
  34.203 -			/* tss->esp0 is set to NULL in cpu_init(),
  34.204 -			 * it's initialized when the cpu returns to user
  34.205 -			 * space. -- manfreds
  34.206 -			 */
  34.207 -			printk(" <unknown> ");
  34.208 -			continue;
  34.209 -		}
  34.210 -		esp &= ~(THREAD_SIZE-1);
  34.211 -		esp += sizeof(struct task_struct);
  34.212 -		show_stack((void*)esp);
  34.213 - 	}
  34.214 -	printk("\nCPU %d:",cpu);
  34.215 -	show_stack(NULL);
  34.216 -	printk("\n");
  34.217 -}
  34.218 -	
  34.219 -#define MAXCOUNT 100000000
  34.220 -
  34.221 -/*
  34.222 - * I had a lockup scenario where a tight loop doing
  34.223 - * spin_unlock()/spin_lock() on CPU#1 was racing with
  34.224 - * spin_lock() on CPU#0. CPU#0 should have noticed spin_unlock(), but
  34.225 - * apparently the spin_unlock() information did not make it
  34.226 - * through to CPU#0 ... nasty, is this by design, do we have to limit
  34.227 - * 'memory update oscillation frequency' artificially like here?
  34.228 - *
  34.229 - * Such 'high frequency update' races can be avoided by careful design, but
  34.230 - * some of our major constructs like spinlocks use similar techniques,
  34.231 - * it would be nice to clarify this issue. Set this define to 0 if you
  34.232 - * want to check whether your system freezes.  I suspect the delay done
  34.233 - * by SYNC_OTHER_CORES() is in correlation with 'snooping latency', but
  34.234 - * i thought that such things are guaranteed by design, since we use
  34.235 - * the 'LOCK' prefix.
  34.236 - */
  34.237 -#define SUSPECTED_CPU_OR_CHIPSET_BUG_WORKAROUND 0
  34.238 -
  34.239 -#if SUSPECTED_CPU_OR_CHIPSET_BUG_WORKAROUND
  34.240 -# define SYNC_OTHER_CORES(x) udelay(x+1)
  34.241 -#else
  34.242 -/*
  34.243 - * We have to allow irqs to arrive between __sti and __cli
  34.244 - */
  34.245 -# define SYNC_OTHER_CORES(x) __asm__ __volatile__ ("nop")
  34.246 -#endif
  34.247 -
  34.248 -static inline void wait_on_irq(int cpu)
  34.249 -{
  34.250 -	int count = MAXCOUNT;
  34.251 -
  34.252 -	for (;;) {
  34.253 -
  34.254 -		/*
  34.255 -		 * Wait until all interrupts are gone. Wait
  34.256 -		 * for bottom half handlers unless we're
  34.257 -		 * already executing in one..
  34.258 -		 */
  34.259 -		if (!irqs_running())
  34.260 -			if (local_bh_count(cpu) || !spin_is_locked(&global_bh_lock))
  34.261 -				break;
  34.262 -
  34.263 -		/* Duh, we have to loop. Release the lock to avoid deadlocks */
  34.264 -		clear_bit(0,&global_irq_lock);
  34.265 -
  34.266 -		for (;;) {
  34.267 -			if (!--count) {
  34.268 -				show("wait_on_irq");
  34.269 -				count = ~0;
  34.270 -			}
  34.271 -			__sti();
  34.272 -			SYNC_OTHER_CORES(cpu);
  34.273 -			__cli();
  34.274 -			if (irqs_running())
  34.275 -				continue;
  34.276 -			if (global_irq_lock)
  34.277 -				continue;
  34.278 -			if (!local_bh_count(cpu) && spin_is_locked(&global_bh_lock))
  34.279 -				continue;
  34.280 -			if (!test_and_set_bit(0,&global_irq_lock))
  34.281 -				break;
  34.282 -		}
  34.283 -	}
  34.284 -}
  34.285 -
  34.286 -/*
  34.287 - * This is called when we want to synchronize with
  34.288 - * interrupts. We may for example tell a device to
  34.289 - * stop sending interrupts: but to make sure there
  34.290 - * are no interrupts that are executing on another
  34.291 - * CPU we need to call this function.
  34.292 - */
  34.293 -void synchronize_irq(void)
  34.294 -{
  34.295 -	if (irqs_running()) {
  34.296 -		/* Stupid approach */
  34.297 -		cli();
  34.298 -		sti();
  34.299 -	}
  34.300 -}
  34.301 -
  34.302 -static inline void get_irqlock(int cpu)
  34.303 -{
  34.304 -	if (test_and_set_bit(0,&global_irq_lock)) {
  34.305 -		/* do we already hold the lock? */
  34.306 -		if ((unsigned char) cpu == global_irq_holder)
  34.307 -			return;
  34.308 -		/* Uhhuh.. Somebody else got it. Wait.. */
  34.309 -		do {
  34.310 -			do {
  34.311 -				rep_nop();
  34.312 -			} while (test_bit(0,&global_irq_lock));
  34.313 -		} while (test_and_set_bit(0,&global_irq_lock));		
  34.314 -	}
  34.315 -	/* 
  34.316 -	 * We also to make sure that nobody else is running
  34.317 -	 * in an interrupt context. 
  34.318 -	 */
  34.319 -	wait_on_irq(cpu);
  34.320 -
  34.321 -	/*
  34.322 -	 * Ok, finally..
  34.323 -	 */
  34.324 -	global_irq_holder = cpu;
  34.325 -}
  34.326 -
  34.327 -void __global_cli(void)
  34.328 -{
  34.329 -    panic("__global_cli");
  34.330 -}
  34.331 -
  34.332 -void __global_sti(void)
  34.333 -{
  34.334 -    panic("__global_sti");
  34.335 -}
  34.336 -
  34.337 -/*
  34.338 - * SMP flags value to restore to:
  34.339 - * 0 - global cli
  34.340 - * 1 - global sti
  34.341 - * 2 - local cli
  34.342 - * 3 - local sti
  34.343 - */
  34.344 -unsigned long __global_save_flags(void)
  34.345 -{
  34.346 -    panic("__global_save_flags");
  34.347 -}
  34.348 -
  34.349 -void __global_restore_flags(unsigned long flags)
  34.350 -{
  34.351 -    panic("__global_restore_flags");
  34.352 -}
  34.353 -
  34.354 -#endif
  34.355 -
  34.356 -/*
  34.357 - * This should really return information about whether
  34.358 - * we should do bottom half handling etc. Right now we
  34.359 - * end up _always_ checking the bottom half, which is a
  34.360 - * waste of time and is not what some drivers would
  34.361 - * prefer.
  34.362 - */
  34.363 -int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, struct irqaction * action)
  34.364 -{
  34.365 -	int status;
  34.366 -	int cpu = smp_processor_id();
  34.367 -
  34.368 -	irq_enter(cpu, irq);
  34.369 -
  34.370 -	status = 1;	/* Force the "do bottom halves" bit */
  34.371 -
  34.372 -	if (!(action->flags & SA_INTERRUPT))
  34.373 -		__sti();
  34.374 -
  34.375 -	do {
  34.376 -		status |= action->flags;
  34.377 -		action->handler(irq, action->dev_id, regs);
  34.378 -		action = action->next;
  34.379 -	} while (action);
  34.380 -	if (status & SA_SAMPLE_RANDOM)
  34.381 -		add_interrupt_randomness(irq);
  34.382 -	__cli();
  34.383 -
  34.384 -	irq_exit(cpu, irq);
  34.385 -
  34.386 -	return status;
  34.387 -}
  34.388 -
  34.389 -/*
  34.390 - * Generic enable/disable code: this just calls
  34.391 - * down into the PIC-specific version for the actual
  34.392 - * hardware disable after having gotten the irq
  34.393 - * controller lock. 
  34.394 - */
  34.395 - 
  34.396 -/**
  34.397 - *	disable_irq_nosync - disable an irq without waiting
  34.398 - *	@irq: Interrupt to disable
  34.399 - *
  34.400 - *	Disable the selected interrupt line.  Disables and Enables are
  34.401 - *	nested.
  34.402 - *	Unlike disable_irq(), this function does not ensure existing
  34.403 - *	instances of the IRQ handler have completed before returning.
  34.404 - *
  34.405 - *	This function may be called from IRQ context.
  34.406 - */
  34.407 - 
  34.408 -inline void disable_irq_nosync(unsigned int irq)
  34.409 -{
  34.410 -	irq_desc_t *desc = irq_desc + irq;
  34.411 -	unsigned long flags;
  34.412 -
  34.413 -	spin_lock_irqsave(&desc->lock, flags);
  34.414 -	if (!desc->depth++) {
  34.415 -		desc->status |= IRQ_DISABLED;
  34.416 -		desc->handler->disable(irq);
  34.417 -	}
  34.418 -	spin_unlock_irqrestore(&desc->lock, flags);
  34.419 -}
  34.420 -
  34.421 -/**
  34.422 - *	disable_irq - disable an irq and wait for completion
  34.423 - *	@irq: Interrupt to disable
  34.424 - *
  34.425 - *	Disable the selected interrupt line.  Enables and Disables are
  34.426 - *	nested.
  34.427 - *	This function waits for any pending IRQ handlers for this interrupt
  34.428 - *	to complete before returning. If you use this function while
  34.429 - *	holding a resource the IRQ handler may need you will deadlock.
  34.430 - *
  34.431 - *	This function may be called - with care - from IRQ context.
  34.432 - */
  34.433 - 
  34.434 -void disable_irq(unsigned int irq)
  34.435 -{
  34.436 -	disable_irq_nosync(irq);
  34.437 -
  34.438 -	if (!local_irq_count(smp_processor_id())) {
  34.439 -		do {
  34.440 -			barrier();
  34.441 -			cpu_relax();
  34.442 -		} while (irq_desc[irq].status & IRQ_INPROGRESS);
  34.443 -	}
  34.444 -}
  34.445 -
  34.446 -/**
  34.447 - *	enable_irq - enable handling of an irq
  34.448 - *	@irq: Interrupt to enable
  34.449 - *
  34.450 - *	Undoes the effect of one call to disable_irq().  If this
  34.451 - *	matches the last disable, processing of interrupts on this
  34.452 - *	IRQ line is re-enabled.
  34.453 - *
  34.454 - *	This function may be called from IRQ context.
  34.455 - */
  34.456 - 
  34.457 -void enable_irq(unsigned int irq)
  34.458 -{
  34.459 -	irq_desc_t *desc = irq_desc + irq;
  34.460 -	unsigned long flags;
  34.461 -
  34.462 -	spin_lock_irqsave(&desc->lock, flags);
  34.463 -	switch (desc->depth) {
  34.464 -	case 1: {
  34.465 -		unsigned int status = desc->status & ~IRQ_DISABLED;
  34.466 -		desc->status = status;
  34.467 -		if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
  34.468 -			desc->status = status | IRQ_REPLAY;
  34.469 -			hw_resend_irq(desc->handler,irq);
  34.470 -		}
  34.471 -		desc->handler->enable(irq);
  34.472 -		/* fall-through */
  34.473 -	}
  34.474 -	default:
  34.475 -		desc->depth--;
  34.476 -		break;
  34.477 -	case 0:
  34.478 -		printk("enable_irq(%u) unbalanced from %p\n", irq,
  34.479 -		       __builtin_return_address(0));
  34.480 -	}
  34.481 -	spin_unlock_irqrestore(&desc->lock, flags);
  34.482 -}
  34.483 -
  34.484 -/*
  34.485 - * do_IRQ handles all normal device IRQ's (the special
  34.486 - * SMP cross-CPU interrupts have their own specific
  34.487 - * handlers).
  34.488 - */
  34.489 -asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs)
  34.490 -{	
  34.491 -	/* 
  34.492 -	 * We ack quickly, we don't want the irq controller
  34.493 -	 * thinking we're snobs just because some other CPU has
  34.494 -	 * disabled global interrupts (we have already done the
  34.495 -	 * INT_ACK cycles, it's too late to try to pretend to the
  34.496 -	 * controller that we aren't taking the interrupt).
  34.497 -	 *
  34.498 -	 * 0 return value means that this irq is already being
  34.499 -	 * handled by some other CPU. (or is disabled)
  34.500 -	 */
  34.501 -	int cpu = smp_processor_id();
  34.502 -	irq_desc_t *desc = irq_desc + irq;
  34.503 -	struct irqaction * action;
  34.504 -	unsigned int status;
  34.505 -#ifdef CONFIG_DEBUG_STACKOVERFLOW
  34.506 -	long esp;
  34.507 -
  34.508 -	/* Debugging check for stack overflow: is there less than 1KB free? */
  34.509 -	__asm__ __volatile__("andl %%esp,%0" : "=r" (esp) : "0" (8191));
  34.510 -	if (unlikely(esp < (sizeof(struct task_struct) + 1024))) {
  34.511 -		extern void show_stack(unsigned long *);
  34.512 -
  34.513 -		printk("do_IRQ: stack overflow: %ld\n",
  34.514 -			esp - sizeof(struct task_struct));
  34.515 -		__asm__ __volatile__("movl %%esp,%0" : "=r" (esp));
  34.516 -		show_stack((void *)esp);
  34.517 -	}
  34.518 -#endif
  34.519 -
  34.520 -	kstat.irqs[cpu][irq]++;
  34.521 -	spin_lock(&desc->lock);
  34.522 -	desc->handler->ack(irq);
  34.523 -	/*
  34.524 -	   REPLAY is when Linux resends an IRQ that was dropped earlier
  34.525 -	   WAITING is used by probe to mark irqs that are being tested
  34.526 -	   */
  34.527 -	status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING);
  34.528 -	status |= IRQ_PENDING; /* we _want_ to handle it */
  34.529 -
  34.530 -	/*
  34.531 -	 * If the IRQ is disabled for whatever reason, we cannot
  34.532 -	 * use the action we have.
  34.533 -	 */
  34.534 -	action = NULL;
  34.535 -	if (!(status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
  34.536 -		action = desc->action;
  34.537 -		status &= ~IRQ_PENDING; /* we commit to handling */
  34.538 -		status |= IRQ_INPROGRESS; /* we are handling it */
  34.539 -	}
  34.540 -	desc->status = status;
  34.541 -
  34.542 -	/*
  34.543 -	 * If there is no IRQ handler or it was disabled, exit early.
  34.544 -	   Since we set PENDING, if another processor is handling
  34.545 -	   a different instance of this same irq, the other processor
  34.546 -	   will take care of it.
  34.547 -	 */
  34.548 -	if (!action)
  34.549 -		goto out;
  34.550 -
  34.551 -	/*
  34.552 -	 * Edge triggered interrupts need to remember
  34.553 -	 * pending events.
  34.554 -	 * This applies to any hw interrupts that allow a second
  34.555 -	 * instance of the same irq to arrive while we are in do_IRQ
  34.556 -	 * or in the handler. But the code here only handles the _second_
  34.557 -	 * instance of the irq, not the third or fourth. So it is mostly
  34.558 -	 * useful for irq hardware that does not mask cleanly in an
  34.559 -	 * SMP environment.
  34.560 -	 */
  34.561 -	for (;;) {
  34.562 -		spin_unlock(&desc->lock);
  34.563 -		handle_IRQ_event(irq, regs, action);
  34.564 -		spin_lock(&desc->lock);
  34.565 -		
  34.566 -		if (!(desc->status & IRQ_PENDING))
  34.567 -			break;
  34.568 -		desc->status &= ~IRQ_PENDING;
  34.569 -	}
  34.570 -	desc->status &= ~IRQ_INPROGRESS;
  34.571 -out:
  34.572 -	/*
  34.573 -	 * The ->end() handler has to deal with interrupts which got
  34.574 -	 * disabled while the handler was running.
  34.575 -	 */
  34.576 -	desc->handler->end(irq);
  34.577 -	spin_unlock(&desc->lock);
  34.578 -
  34.579 -	if (softirq_pending(cpu))
  34.580 -		do_softirq();
  34.581 -	return 1;
  34.582 -}
  34.583 -
  34.584 -/**
  34.585 - *	request_irq - allocate an interrupt line
  34.586 - *	@irq: Interrupt line to allocate
  34.587 - *	@handler: Function to be called when the IRQ occurs
  34.588 - *	@irqflags: Interrupt type flags
  34.589 - *	@devname: An ascii name for the claiming device
  34.590 - *	@dev_id: A cookie passed back to the handler function
  34.591 - *
  34.592 - *	This call allocates interrupt resources and enables the
  34.593 - *	interrupt line and IRQ handling. From the point this
  34.594 - *	call is made your handler function may be invoked. Since
  34.595 - *	your handler function must clear any interrupt the board 
  34.596 - *	raises, you must take care both to initialise your hardware
  34.597 - *	and to set up the interrupt handler in the right order.
  34.598 - *
  34.599 - *	Dev_id must be globally unique. Normally the address of the
  34.600 - *	device data structure is used as the cookie. Since the handler
  34.601 - *	receives this value it makes sense to use it.
  34.602 - *
  34.603 - *	If your interrupt is shared you must pass a non NULL dev_id
  34.604 - *	as this is required when freeing the interrupt.
  34.605 - *
  34.606 - *	Flags:
  34.607 - *
  34.608 - *	SA_SHIRQ		Interrupt is shared
  34.609 - *
  34.610 - *	SA_INTERRUPT		Disable local interrupts while processing
  34.611 - *
  34.612 - *	SA_SAMPLE_RANDOM	The interrupt can be used for entropy
  34.613 - *
  34.614 - */
  34.615 - 
  34.616 -int request_irq(unsigned int irq, 
  34.617 -		void (*handler)(int, void *, struct pt_regs *),
  34.618 -		unsigned long irqflags, 
  34.619 -		const char * devname,
  34.620 -		void *dev_id)
  34.621 -{
  34.622 -	int retval;
  34.623 -	struct irqaction * action;
  34.624 -
  34.625 -#if 1
  34.626 -	/*
  34.627 -	 * Sanity-check: shared interrupts should REALLY pass in
  34.628 -	 * a real dev-ID, otherwise we'll have trouble later trying
  34.629 -	 * to figure out which interrupt is which (messes up the
  34.630 -	 * interrupt freeing logic etc).
  34.631 -	 */
  34.632 -	if (irqflags & SA_SHIRQ) {
  34.633 -		if (!dev_id)
  34.634 -			printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]);
  34.635 -	}
  34.636 -#endif
  34.637 -
  34.638 -	if (irq >= NR_IRQS)
  34.639 -		return -EINVAL;
  34.640 -	if (!handler)
  34.641 -		return -EINVAL;
  34.642 -
  34.643 -	action = (struct irqaction *)
  34.644 -			kmalloc(sizeof(struct irqaction), GFP_KERNEL);
  34.645 -	if (!action)
  34.646 -		return -ENOMEM;
  34.647 -
  34.648 -	action->handler = handler;
  34.649 -	action->flags = irqflags;
  34.650 -	action->mask = 0;
  34.651 -	action->name = devname;
  34.652 -	action->next = NULL;
  34.653 -	action->dev_id = dev_id;
  34.654 -
  34.655 -	retval = setup_irq(irq, action);
  34.656 -	if (retval)
  34.657 -		kfree(action);
  34.658 -	return retval;
  34.659 -}
  34.660 -
  34.661 -/**
  34.662 - *	free_irq - free an interrupt
  34.663 - *	@irq: Interrupt line to free
  34.664 - *	@dev_id: Device identity to free
  34.665 - *
  34.666 - *	Remove an interrupt handler. The handler is removed and if the
  34.667 - *	interrupt line is no longer in use by any driver it is disabled.
  34.668 - *	On a shared IRQ the caller must ensure the interrupt is disabled
  34.669 - *	on the card it drives before calling this function. The function
  34.670 - *	does not return until any executing interrupts for this IRQ
  34.671 - *	have completed.
  34.672 - *
  34.673 - *	This function may be called from interrupt context. 
  34.674 - *
  34.675 - *	Bugs: Attempting to free an irq in a handler for the same irq hangs
  34.676 - *	      the machine.
  34.677 - */
  34.678 - 
  34.679 -void free_irq(unsigned int irq, void *dev_id)
  34.680 -{
  34.681 -	irq_desc_t *desc;
  34.682 -	struct irqaction **p;
  34.683 -	unsigned long flags;
  34.684 -
  34.685 -	if (irq >= NR_IRQS)
  34.686 -		return;
  34.687 -
  34.688 -	desc = irq_desc + irq;
  34.689 -	spin_lock_irqsave(&desc->lock,flags);
  34.690 -	p = &desc->action;
  34.691 -	for (;;) {
  34.692 -		struct irqaction * action = *p;
  34.693 -		if (action) {
  34.694 -			struct irqaction **pp = p;
  34.695 -			p = &action->next;
  34.696 -			if (action->dev_id != dev_id)
  34.697 -				continue;
  34.698 -
  34.699 -			/* Found it - now remove it from the list of entries */
  34.700 -			*pp = action->next;
  34.701 -			if (!desc->action) {
  34.702 -				desc->status |= IRQ_DISABLED;
  34.703 -				desc->handler->shutdown(irq);
  34.704 -			}
  34.705 -			spin_unlock_irqrestore(&desc->lock,flags);
  34.706 -
  34.707 -#ifdef CONFIG_SMP
  34.708 -			/* Wait to make sure it's not being used on another CPU */
  34.709 -			while (desc->status & IRQ_INPROGRESS) {
  34.710 -				barrier();
  34.711 -				cpu_relax();
  34.712 -			}
  34.713 -#endif
  34.714 -			kfree(action);
  34.715 -			return;
  34.716 -		}
  34.717 -		printk("Trying to free free IRQ%d\n",irq);
  34.718 -		spin_unlock_irqrestore(&desc->lock,flags);
  34.719 -		return;
  34.720 -	}
  34.721 -}
  34.722 -
  34.723 -/*
  34.724 - * IRQ autodetection code..
  34.725 - *
  34.726 - * This depends on the fact that any interrupt that
  34.727 - * comes in on to an unassigned handler will get stuck
  34.728 - * with "IRQ_WAITING" cleared and the interrupt
  34.729 - * disabled.
  34.730 - */
  34.731 -
  34.732 -static DECLARE_MUTEX(probe_sem);
  34.733 -
  34.734 -/**
  34.735 - *	probe_irq_on	- begin an interrupt autodetect
  34.736 - *
  34.737 - *	Commence probing for an interrupt. The interrupts are scanned
  34.738 - *	and a mask of potential interrupt lines is returned.
  34.739 - *
  34.740 - */
  34.741 - 
  34.742 -unsigned long probe_irq_on(void)
  34.743 -{
  34.744 -	unsigned int i;
  34.745 -	irq_desc_t *desc;
  34.746 -	unsigned long val;
  34.747 -	unsigned long delay;
  34.748 -
  34.749 -	down(&probe_sem);
  34.750 -	/* 
  34.751 -	 * something may have generated an irq long ago and we want to
  34.752 -	 * flush such a longstanding irq before considering it as spurious. 
  34.753 -	 */
  34.754 -	for (i = NR_IRQS-1; i > 0; i--)  {
  34.755 -		desc = irq_desc + i;
  34.756 -
  34.757 -		spin_lock_irq(&desc->lock);
  34.758 -		if (!irq_desc[i].action) 
  34.759 -			irq_desc[i].handler->startup(i);
  34.760 -		spin_unlock_irq(&desc->lock);
  34.761 -	}
  34.762 -
  34.763 -	/* Wait for longstanding interrupts to trigger. */
  34.764 -	for (delay = jiffies + HZ/50; time_after(delay, jiffies); )
  34.765 -		/* about 20ms delay */ synchronize_irq();
  34.766 -
  34.767 -	/*
  34.768 -	 * enable any unassigned irqs
  34.769 -	 * (we must startup again here because if a longstanding irq
  34.770 -	 * happened in the previous stage, it may have masked itself)
  34.771 -	 */
  34.772 -	for (i = NR_IRQS-1; i > 0; i--) {
  34.773 -		desc = irq_desc + i;
  34.774 -
  34.775 -		spin_lock_irq(&desc->lock);
  34.776 -		if (!desc->action) {
  34.777 -			desc->status |= IRQ_AUTODETECT | IRQ_WAITING;
  34.778 -			if (desc->handler->startup(i))
  34.779 -				desc->status |= IRQ_PENDING;
  34.780 -		}
  34.781 -		spin_unlock_irq(&desc->lock);
  34.782 -	}
  34.783 -
  34.784 -	/*
  34.785 -	 * Wait for spurious interrupts to trigger
  34.786 -	 */
  34.787 -	for (delay = jiffies + HZ/10; time_after(delay, jiffies); )
  34.788 -		/* about 100ms delay */ synchronize_irq();
  34.789 -
  34.790 -	/*
  34.791 -	 * Now filter out any obviously spurious interrupts
  34.792 -	 */
  34.793 -	val = 0;
  34.794 -	for (i = 0; i < NR_IRQS; i++) {
  34.795 -		irq_desc_t *desc = irq_desc + i;
  34.796 -		unsigned int status;
  34.797 -
  34.798 -		spin_lock_irq(&desc->lock);
  34.799 -		status = desc->status;
  34.800 -
  34.801 -		if (status & IRQ_AUTODETECT) {
  34.802 -			/* It triggered already - consider it spurious. */
  34.803 -			if (!(status & IRQ_WAITING)) {
  34.804 -				desc->status = status & ~IRQ_AUTODETECT;
  34.805 -				desc->handler->shutdown(i);
  34.806 -			} else
  34.807 -				if (i < 32)
  34.808 -					val |= 1 << i;
  34.809 -		}
  34.810 -		spin_unlock_irq(&desc->lock);
  34.811 -	}
  34.812 -
  34.813 -	return val;
  34.814 -}
  34.815 -
  34.816 -/*
  34.817 - * Return a mask of triggered interrupts (this
  34.818 - * can handle only legacy ISA interrupts).
  34.819 - */
  34.820 - 
  34.821 -/**
  34.822 - *	probe_irq_mask - scan a bitmap of interrupt lines
  34.823 - *	@val:	mask of interrupts to consider
  34.824 - *
  34.825 - *	Scan the ISA bus interrupt lines and return a bitmap of
  34.826 - *	active interrupts. The interrupt probe logic state is then
  34.827 - *	returned to its previous value.
  34.828 - *
  34.829 - *	Note: we need to scan all the irq's even though we will
  34.830 - *	only return ISA irq numbers - just so that we reset them
  34.831 - *	all to a known state.
  34.832 - */
  34.833 -unsigned int probe_irq_mask(unsigned long val)
  34.834 -{
  34.835 -	int i;
  34.836 -	unsigned int mask;
  34.837 -
  34.838 -	mask = 0;
  34.839 -	for (i = 0; i < NR_IRQS; i++) {
  34.840 -		irq_desc_t *desc = irq_desc + i;
  34.841 -		unsigned int status;
  34.842 -
  34.843 -		spin_lock_irq(&desc->lock);
  34.844 -		status = desc->status;
  34.845 -
  34.846 -		if (status & IRQ_AUTODETECT) {
  34.847 -			if (i < 16 && !(status & IRQ_WAITING))
  34.848 -				mask |= 1 << i;
  34.849 -
  34.850 -			desc->status = status & ~IRQ_AUTODETECT;
  34.851 -			desc->handler->shutdown(i);
  34.852 -		}
  34.853 -		spin_unlock_irq(&desc->lock);
  34.854 -	}
  34.855 -	up(&probe_sem);
  34.856 -
  34.857 -	return mask & val;
  34.858 -}
  34.859 -
  34.860 -/*
  34.861 - * Return the one interrupt that triggered (this can
  34.862 - * handle any interrupt source).
  34.863 - */
  34.864 -
  34.865 -/**
  34.866 - *	probe_irq_off	- end an interrupt autodetect
  34.867 - *	@val: mask of potential interrupts (unused)
  34.868 - *
  34.869 - *	Scans the unused interrupt lines and returns the line which
  34.870 - *	appears to have triggered the interrupt. If no interrupt was
  34.871 - *	found then zero is returned. If more than one interrupt is
  34.872 - *	found then minus the first candidate is returned to indicate
  34.873 - *	their is doubt.
  34.874 - *
  34.875 - *	The interrupt probe logic state is returned to its previous
  34.876 - *	value.
  34.877 - *
  34.878 - *	BUGS: When used in a module (which arguably shouldnt happen)
  34.879 - *	nothing prevents two IRQ probe callers from overlapping. The
  34.880 - *	results of this are non-optimal.
  34.881 - */
  34.882 - 
  34.883 -int probe_irq_off(unsigned long val)
  34.884 -{
  34.885 -	int i, irq_found, nr_irqs;
  34.886 -
  34.887 -	nr_irqs = 0;
  34.888 -	irq_found = 0;
  34.889 -	for (i = 0; i < NR_IRQS; i++) {
  34.890 -		irq_desc_t *desc = irq_desc + i;
  34.891 -		unsigned int status;
  34.892 -
  34.893 -		spin_lock_irq(&desc->lock);
  34.894 -		status = desc->status;
  34.895 -
  34.896 -		if (status & IRQ_AUTODETECT) {
  34.897 -			if (!(status & IRQ_WAITING)) {
  34.898 -				if (!nr_irqs)
  34.899 -					irq_found = i;
  34.900 -				nr_irqs++;
  34.901 -			}
  34.902 -			desc->status = status & ~IRQ_AUTODETECT;
  34.903 -			desc->handler->shutdown(i);
  34.904 -		}
  34.905 -		spin_unlock_irq(&desc->lock);
  34.906 -	}
  34.907 -	up(&probe_sem);
  34.908 -
  34.909 -	if (nr_irqs > 1)
  34.910 -		irq_found = -irq_found;
  34.911 -	return irq_found;
  34.912 -}
  34.913 -
  34.914 -/* this was setup_x86_irq but it seems pretty generic */
  34.915 -int setup_irq(unsigned int irq, struct irqaction * new)
  34.916 -{
  34.917 -	int shared = 0;
  34.918 -	unsigned long flags;
  34.919 -	struct irqaction *old, **p;
  34.920 -	irq_desc_t *desc = irq_desc + irq;
  34.921 -
  34.922 -	/*
  34.923 -	 * Some drivers like serial.c use request_irq() heavily,
  34.924 -	 * so we have to be careful not to interfere with a
  34.925 -	 * running system.
  34.926 -	 */
  34.927 -	if (new->flags & SA_SAMPLE_RANDOM) {
  34.928 -		/*
  34.929 -		 * This function might sleep, we want to call it first,
  34.930 -		 * outside of the atomic block.
  34.931 -		 * Yes, this might clear the entropy pool if the wrong
  34.932 -		 * driver is attempted to be loaded, without actually
  34.933 -		 * installing a new handler, but is this really a problem,
  34.934 -		 * only the sysadmin is able to do this.
  34.935 -		 */
  34.936 -		rand_initialize_irq(irq);
  34.937 -	}
  34.938 -
  34.939 -	/*
  34.940 -	 * The following block of code has to be executed atomically
  34.941 -	 */
  34.942 -	spin_lock_irqsave(&desc->lock,flags);
  34.943 -	p = &desc->action;
  34.944 -	if ((old = *p) != NULL) {
  34.945 -		/* Can't share interrupts unless both agree to */
  34.946 -		if (!(old->flags & new->flags & SA_SHIRQ)) {
  34.947 -			spin_unlock_irqrestore(&desc->lock,flags);
  34.948 -			return -EBUSY;
  34.949 -		}
  34.950 -
  34.951 -		/* add new interrupt at end of irq queue */
  34.952 -		do {
  34.953 -			p = &old->next;
  34.954 -			old = *p;
  34.955 -		} while (old);
  34.956 -		shared = 1;
  34.957 -	}
  34.958 -
  34.959 -	*p = new;
  34.960 -
  34.961 -	if (!shared) {
  34.962 -		desc->depth = 0;
  34.963 -		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING);
  34.964 -		desc->handler->startup(irq);
  34.965 -	}
  34.966 -	spin_unlock_irqrestore(&desc->lock,flags);
  34.967 -
  34.968 -	register_irq_proc(irq);
  34.969 -	return 0;
  34.970 -}
  34.971 -
  34.972 -static struct proc_dir_entry * root_irq_dir;
  34.973 -static struct proc_dir_entry * irq_dir [NR_IRQS];
  34.974 -
  34.975 -#define HEX_DIGITS 8
  34.976 -
  34.977 -static unsigned int parse_hex_value (const char *buffer,
  34.978 -		unsigned long count, unsigned long *ret)
  34.979 -{
  34.980 -	unsigned char hexnum [HEX_DIGITS];
  34.981 -	unsigned long value;
  34.982 -	int i;
  34.983 -
  34.984 -	if (!count)
  34.985 -		return -EINVAL;
  34.986 -	if (count > HEX_DIGITS)
  34.987 -		count = HEX_DIGITS;
  34.988 -	if (copy_from_user(hexnum, buffer, count))
  34.989 -		return -EFAULT;
  34.990 -
  34.991 -	/*
  34.992 -	 * Parse the first 8 characters as a hex string, any non-hex char
  34.993 -	 * is end-of-string. '00e1', 'e1', '00E1', 'E1' are all the same.
  34.994 -	 */
  34.995 -	value = 0;
  34.996 -
  34.997 -	for (i = 0; i < count; i++) {
  34.998 -		unsigned int c = hexnum[i];
  34.999 -
 34.1000 -		switch (c) {
 34.1001 -			case '0' ... '9': c -= '0'; break;
 34.1002 -			case 'a' ... 'f': c -= 'a'-10; break;
 34.1003 -			case 'A' ... 'F': c -= 'A'-10; break;
 34.1004 -		default:
 34.1005 -			goto out;
 34.1006 -		}
 34.1007 -		value = (value << 4) | c;
 34.1008 -	}
 34.1009 -out:
 34.1010 -	*ret = value;
 34.1011 -	return 0;
 34.1012 -}
 34.1013 -
 34.1014 -#if CONFIG_SMP
 34.1015 -
 34.1016 -static struct proc_dir_entry * smp_affinity_entry [NR_IRQS];
 34.1017 -
 34.1018 -static unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL };
 34.1019 -static int irq_affinity_read_proc (char *page, char **start, off_t off,
 34.1020 -			int count, int *eof, void *data)
 34.1021 -{
 34.1022 -	if (count < HEX_DIGITS+1)
 34.1023 -		return -EINVAL;
 34.1024 -	return sprintf (page, "%08lx\n", irq_affinity[(long)data]);
 34.1025 -}
 34.1026 -
 34.1027 -static int irq_affinity_write_proc (struct file *file, const char *buffer,
 34.1028 -					unsigned long count, void *data)
 34.1029 -{
 34.1030 -	int irq = (long) data, full_count = count, err;
 34.1031 -	unsigned long new_value;
 34.1032 -
 34.1033 -	if (!irq_desc[irq].handler->set_affinity)
 34.1034 -		return -EIO;
 34.1035 -
 34.1036 -	err = parse_hex_value(buffer, count, &new_value);
 34.1037 -
 34.1038 -	/*
 34.1039 -	 * Do not allow disabling IRQs completely - it's a too easy
 34.1040 -	 * way to make the system unusable accidentally :-) At least
 34.1041 -	 * one online CPU still has to be targeted.
 34.1042 -	 */
 34.1043 -	if (!(new_value & cpu_online_map))
 34.1044 -		return -EINVAL;
 34.1045 -
 34.1046 -	irq_affinity[irq] = new_value;
 34.1047 -	irq_desc[irq].handler->set_affinity(irq, new_value);
 34.1048 -
 34.1049 -	return full_count;
 34.1050 -}
 34.1051 -
 34.1052 -#endif
 34.1053 -
 34.1054 -static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
 34.1055 -			int count, int *eof, void *data)
 34.1056 -{
 34.1057 -	unsigned long *mask = (unsigned long *) data;
 34.1058 -	if (count < HEX_DIGITS+1)
 34.1059 -		return -EINVAL;
 34.1060 -	return sprintf (page, "%08lx\n", *mask);
 34.1061 -}
 34.1062 -
 34.1063 -static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
 34.1064 -					unsigned long count, void *data)
 34.1065 -{
 34.1066 -	unsigned long *mask = (unsigned long *) data, full_count = count, err;
 34.1067 -	unsigned long new_value;
 34.1068 -
 34.1069 -	err = parse_hex_value(buffer, count, &new_value);
 34.1070 -	if (err)
 34.1071 -		return err;
 34.1072 -
 34.1073 -	*mask = new_value;
 34.1074 -	return full_count;
 34.1075 -}
 34.1076 -
 34.1077 -#define MAX_NAMELEN 10
 34.1078 -
 34.1079 -static void register_irq_proc (unsigned int irq)
 34.1080 -{
 34.1081 -	char name [MAX_NAMELEN];
 34.1082 -
 34.1083 -	if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
 34.1084 -			irq_dir[irq])
 34.1085 -		return;
 34.1086 -
 34.1087 -	memset(name, 0, MAX_NAMELEN);
 34.1088 -	sprintf(name, "%d", irq);
 34.1089 -
 34.1090 -	/* create /proc/irq/1234 */
 34.1091 -	irq_dir[irq] = proc_mkdir(name, root_irq_dir);
 34.1092 -
 34.1093 -#if CONFIG_SMP
 34.1094 -	{
 34.1095 -		struct proc_dir_entry *entry;
 34.1096 -
 34.1097 -		/* create /proc/irq/1234/smp_affinity */
 34.1098 -		entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
 34.1099 -
 34.1100 -		if (entry) {
 34.1101 -			entry->nlink = 1;
 34.1102 -			entry->data = (void *)(long)irq;
 34.1103 -			entry->read_proc = irq_affinity_read_proc;
 34.1104 -			entry->write_proc = irq_affinity_write_proc;
 34.1105 -		}
 34.1106 -
 34.1107 -		smp_affinity_entry[irq] = entry;
 34.1108 -	}
 34.1109 -#endif
 34.1110 -}
 34.1111 -
 34.1112 -unsigned long prof_cpu_mask = -1;
 34.1113 -
 34.1114 -void init_irq_proc (void)
 34.1115 -{
 34.1116 -	struct proc_dir_entry *entry;
 34.1117 -	int i;
 34.1118 -
 34.1119 -	/* create /proc/irq */
 34.1120 -	root_irq_dir = proc_mkdir("irq", 0);
 34.1121 -
 34.1122 -	/* create /proc/irq/prof_cpu_mask */
 34.1123 -	entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
 34.1124 -
 34.1125 -	if (!entry)
 34.1126 -	    return;
 34.1127 -
 34.1128 -	entry->nlink = 1;
 34.1129 -	entry->data = (void *)&prof_cpu_mask;
 34.1130 -	entry->read_proc = prof_cpu_mask_read_proc;
 34.1131 -	entry->write_proc = prof_cpu_mask_write_proc;
 34.1132 -
 34.1133 -	/*
 34.1134 -	 * Create entries for all existing IRQs.
 34.1135 -	 */
 34.1136 -	for (i = 0; i < NR_IRQS; i++)
 34.1137 -		register_irq_proc(i);
 34.1138 -}
 34.1139 -
    35.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/ldt.c	Tue Jun 24 12:05:12 2003 +0000
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,169 +0,0 @@
    35.4 -/*
    35.5 - * linux/kernel/ldt.c
    35.6 - *
    35.7 - * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds
    35.8 - * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
    35.9 - */
   35.10 -
   35.11 -#include <linux/errno.h>
   35.12 -#include <linux/sched.h>
   35.13 -#include <linux/string.h>
   35.14 -#include <linux/mm.h>
   35.15 -#include <linux/smp.h>
   35.16 -#include <linux/smp_lock.h>
   35.17 -#include <linux/vmalloc.h>
   35.18 -
   35.19 -#include <asm/uaccess.h>
   35.20 -#include <asm/system.h>
   35.21 -#include <asm/ldt.h>
   35.22 -#include <asm/desc.h>
   35.23 -
   35.24 -/*
   35.25 - * read_ldt() is not really atomic - this is not a problem since
   35.26 - * synchronization of reads and writes done to the LDT has to be
   35.27 - * assured by user-space anyway. Writes are atomic, to protect
   35.28 - * the security checks done on new descriptors.
   35.29 - */
   35.30 -static int read_ldt(void * ptr, unsigned long bytecount)
   35.31 -{
   35.32 -    int err;
   35.33 -    unsigned long size;
   35.34 -    struct mm_struct * mm = current->mm;
   35.35 -
   35.36 -    err = 0;
   35.37 -    if (!mm->context.segments)
   35.38 -        goto out;
   35.39 -
   35.40 -    size = LDT_ENTRIES*LDT_ENTRY_SIZE;
   35.41 -    if (size > bytecount)
   35.42 -        size = bytecount;
   35.43 -
   35.44 -    err = size;
   35.45 -    if (copy_to_user(ptr, mm->context.segments, size))
   35.46 -        err = -EFAULT;
   35.47 - out:
   35.48 -    return err;
   35.49 -}
   35.50 -
   35.51 -static int read_default_ldt(void * ptr, unsigned long bytecount)
   35.52 -{
   35.53 -    int err;
   35.54 -    unsigned long size;
   35.55 -    void *address;
   35.56 -
   35.57 -    err = 0;
   35.58 -    address = &default_ldt[0];
   35.59 -    size = sizeof(struct desc_struct);
   35.60 -    if (size > bytecount)
   35.61 -        size = bytecount;
   35.62 -
   35.63 -    err = size;
   35.64 -    if (copy_to_user(ptr, address, size))
   35.65 -        err = -EFAULT;
   35.66 -
   35.67 -    return err;
   35.68 -}
   35.69 -
   35.70 -static int write_ldt(void * ptr, unsigned long bytecount, int oldmode)
   35.71 -{
   35.72 -    struct mm_struct * mm = current->mm;
   35.73 -    __u32 entry_1, entry_2, *lp;
   35.74 -    unsigned long phys_lp;
   35.75 -    int error;
   35.76 -    struct modify_ldt_ldt_s ldt_info;
   35.77 -
   35.78 -    error = -EINVAL;
   35.79 -    if (bytecount != sizeof(ldt_info))
   35.80 -        goto out;
   35.81 -    error = -EFAULT; 	
   35.82 -    if (copy_from_user(&ldt_info, ptr, sizeof(ldt_info)))
   35.83 -        goto out;
   35.84 -
   35.85 -    error = -EINVAL;
   35.86 -    if (ldt_info.entry_number >= LDT_ENTRIES)
   35.87 -        goto out;
   35.88 -    if (ldt_info.contents == 3) {
   35.89 -        if (oldmode)
   35.90 -            goto out;
   35.91 -        if (ldt_info.seg_not_present == 0)
   35.92 -            goto out;
   35.93 -    }
   35.94 -
   35.95 -    down_write(&mm->mmap_sem);
   35.96 -    if (!mm->context.segments) {
   35.97 -        void * segments = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
   35.98 -        error = -ENOMEM;
   35.99 -        if (!segments)
  35.100 -            goto out_unlock;
  35.101 -        memset(segments, 0, LDT_ENTRIES*LDT_ENTRY_SIZE);
  35.102 -        make_pages_readonly(segments, (LDT_ENTRIES*LDT_ENTRY_SIZE)/PAGE_SIZE);
  35.103 -        wmb();
  35.104 -        mm->context.segments = segments;
  35.105 -        mm->context.cpuvalid = 1UL << smp_processor_id();
  35.106 -        load_LDT(mm);
  35.107 -        flush_page_update_queue();
  35.108 -    }
  35.109 -
  35.110 -    lp = (__u32 *)((ldt_info.entry_number<<3) + (char *)mm->context.segments);
  35.111 -    phys_lp = arbitrary_virt_to_phys(lp);
  35.112 -
  35.113 -    /* Allow LDTs to be cleared by the user. */
  35.114 -    if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
  35.115 -        if (oldmode ||
  35.116 -            (ldt_info.contents == 0		&&
  35.117 -             ldt_info.read_exec_only == 1	&&
  35.118 -             ldt_info.seg_32bit == 0		&&
  35.119 -             ldt_info.limit_in_pages == 0	&&
  35.120 -             ldt_info.seg_not_present == 1	&&
  35.121 -             ldt_info.useable == 0 )) {
  35.122 -            entry_1 = 0;
  35.123 -            entry_2 = 0;
  35.124 -            goto install;
  35.125 -        }
  35.126 -    }
  35.127 -
  35.128 -    entry_1 = ((ldt_info.base_addr & 0x0000ffff) << 16) |
  35.129 -        (ldt_info.limit & 0x0ffff);
  35.130 -    entry_2 = (ldt_info.base_addr & 0xff000000) |
  35.131 -        ((ldt_info.base_addr & 0x00ff0000) >> 16) |
  35.132 -        (ldt_info.limit & 0xf0000) |
  35.133 -        ((ldt_info.read_exec_only ^ 1) << 9) |
  35.134 -        (ldt_info.contents << 10) |
  35.135 -        ((ldt_info.seg_not_present ^ 1) << 15) |
  35.136 -        (ldt_info.seg_32bit << 22) |
  35.137 -        (ldt_info.limit_in_pages << 23) |
  35.138 -        0x7000;
  35.139 -    if (!oldmode)
  35.140 -        entry_2 |= (ldt_info.useable << 20);
  35.141 -
  35.142 -    /* Install the new entry ...  */
  35.143 - install:
  35.144 -    HYPERVISOR_update_descriptor(phys_lp, entry_1, entry_2);
  35.145 -    error = 0;
  35.146 -
  35.147 - out_unlock:
  35.148 -    up_write(&mm->mmap_sem);
  35.149 - out:
  35.150 -    return error;
  35.151 -}
  35.152 -
  35.153 -asmlinkage int sys_modify_ldt(int func, void *ptr, unsigned long bytecount)
  35.154 -{
  35.155 -    int ret = -ENOSYS;
  35.156 -
  35.157 -    switch (func) {
  35.158 -    case 0:
  35.159 -        ret = read_ldt(ptr, bytecount);
  35.160 -        break;
  35.161 -    case 1:
  35.162 -        ret = write_ldt(ptr, bytecount, 1);
  35.163 -        break;
  35.164 -    case 2:
  35.165 -        ret = read_default_ldt(ptr, bytecount);
  35.166 -        break;
  35.167 -    case 0x11:
  35.168 -        ret = write_ldt(ptr, bytecount, 0);
  35.169 -        break;
  35.170 -    }
  35.171 -    return ret;
  35.172 -}
    36.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c	Tue Jun 24 12:05:12 2003 +0000
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,487 +0,0 @@
    36.4 -/*
    36.5 - *  linux/arch/i386/kernel/process.c
    36.6 - *
    36.7 - *  Copyright (C) 1995  Linus Torvalds
    36.8 - *
    36.9 - *  Pentium III FXSR, SSE support
   36.10 - *	Gareth Hughes <gareth@valinux.com>, May 2000
   36.11 - */
   36.12 -
   36.13 -/*
   36.14 - * This file handles the architecture-dependent parts of process handling..
   36.15 - */
   36.16 -
   36.17 -#define __KERNEL_SYSCALLS__
   36.18 -#include <stdarg.h>
   36.19 -
   36.20 -#include <linux/errno.h>
   36.21 -#include <linux/sched.h>
   36.22 -#include <linux/kernel.h>
   36.23 -#include <linux/mm.h>
   36.24 -#include <linux/smp.h>
   36.25 -#include <linux/smp_lock.h>
   36.26 -#include <linux/stddef.h>
   36.27 -#include <linux/unistd.h>
   36.28 -#include <linux/ptrace.h>
   36.29 -#include <linux/slab.h>
   36.30 -#include <linux/vmalloc.h>
   36.31 -#include <linux/user.h>
   36.32 -#include <linux/a.out.h>
   36.33 -#include <linux/interrupt.h>
   36.34 -#include <linux/config.h>
   36.35 -#include <linux/delay.h>
   36.36 -#include <linux/reboot.h>
   36.37 -#include <linux/init.h>
   36.38 -#include <linux/mc146818rtc.h>
   36.39 -
   36.40 -#include <asm/uaccess.h>
   36.41 -#include <asm/pgtable.h>
   36.42 -#include <asm/system.h>
   36.43 -#include <asm/io.h>
   36.44 -#include <asm/ldt.h>
   36.45 -#include <asm/processor.h>
   36.46 -#include <asm/i387.h>
   36.47 -#include <asm/desc.h>
   36.48 -#include <asm/mmu_context.h>
   36.49 -#include <asm/multicall.h>
   36.50 -
   36.51 -#include <linux/irq.h>
   36.52 -
   36.53 -asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
   36.54 -
   36.55 -int hlt_counter;
   36.56 -
   36.57 -/*
   36.58 - * Powermanagement idle function, if any..
   36.59 - */
   36.60 -void (*pm_idle)(void);
   36.61 -
   36.62 -/*
   36.63 - * Power off function, if any
   36.64 - */
   36.65 -void (*pm_power_off)(void);
   36.66 -
   36.67 -void disable_hlt(void)
   36.68 -{
   36.69 -    hlt_counter++;
   36.70 -}
   36.71 -
   36.72 -void enable_hlt(void)
   36.73 -{
   36.74 -    hlt_counter--;
   36.75 -}
   36.76 -
   36.77 -/*
   36.78 - * The idle thread. There's no useful work to be
   36.79 - * done, so just try to conserve power and have a
   36.80 - * low exit latency (ie sit in a loop waiting for
   36.81 - * somebody to say that they'd like to reschedule)
   36.82 - */
   36.83 -void cpu_idle (void)
   36.84 -{
   36.85 -    /* endless idle loop with no priority at all */
   36.86 -    init_idle();
   36.87 -    current->nice = 20;
   36.88 -    current->counter = -100;
   36.89 -
   36.90 -    while (1) {
   36.91 -        while (!current->need_resched)
   36.92 -            HYPERVISOR_yield();
   36.93 -        schedule();
   36.94 -        check_pgt_cache();
   36.95 -    }
   36.96 -}
   36.97 -
   36.98 -void machine_restart(char * __unused)
   36.99 -{
  36.100 -    HYPERVISOR_exit();
  36.101 -}
  36.102 -
  36.103 -void machine_halt(void)
  36.104 -{
  36.105 -    HYPERVISOR_exit();
  36.106 -}
  36.107 -
  36.108 -void machine_power_off(void)
  36.109 -{
  36.110 -    HYPERVISOR_exit();
  36.111 -}
  36.112 -
  36.113 -extern void show_trace(unsigned long* esp);
  36.114 -
  36.115 -void show_regs(struct pt_regs * regs)
  36.116 -{
  36.117 -    printk("\n");
  36.118 -    printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
  36.119 -    printk("EIP: %04x:[<%08lx>] CPU: %d",0xffff & regs->xcs,regs->eip, smp_processor_id());
  36.120 -    if (regs->xcs & 2)
  36.121 -        printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
  36.122 -    printk(" EFLAGS: %08lx    %s\n",regs->eflags, print_tainted());
  36.123 -    printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
  36.124 -           regs->eax,regs->ebx,regs->ecx,regs->edx);
  36.125 -    printk("ESI: %08lx EDI: %08lx EBP: %08lx",
  36.126 -           regs->esi, regs->edi, regs->ebp);
  36.127 -    printk(" DS: %04x ES: %04x\n",
  36.128 -           0xffff & regs->xds,0xffff & regs->xes);
  36.129 -
  36.130 -    show_trace(&regs->esp);
  36.131 -}
  36.132 -
  36.133 -/*
  36.134 - * No need to lock the MM as we are the last user
  36.135 - */
  36.136 -void release_segments(struct mm_struct *mm)
  36.137 -{
  36.138 -    void * ldt = mm->context.segments;
  36.139 -
  36.140 -    /*
  36.141 -     * free the LDT
  36.142 -     */
  36.143 -    if (ldt) {
  36.144 -        mm->context.segments = NULL;
  36.145 -        clear_LDT();
  36.146 -        make_pages_writeable(ldt, (LDT_ENTRIES*LDT_ENTRY_SIZE)/PAGE_SIZE);
  36.147 -        flush_page_update_queue();
  36.148 -        vfree(ldt);
  36.149 -    }
  36.150 -}
  36.151 -
  36.152 -/*
  36.153 - * Create a kernel thread
  36.154 - */
  36.155 -int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
  36.156 -{
  36.157 -    long retval, d0;
  36.158 -
  36.159 -    __asm__ __volatile__(
  36.160 -        "movl %%esp,%%esi\n\t"
  36.161 -        "int $0x80\n\t"		/* Linux/i386 system call */
  36.162 -        "cmpl %%esp,%%esi\n\t"	/* child or parent? */
  36.163 -        "je 1f\n\t"		/* parent - jump */
  36.164 -        /* Load the argument into eax, and push it.  That way, it does
  36.165 -         * not matter whether the called function is compiled with
  36.166 -         * -mregparm or not.  */
  36.167 -        "movl %4,%%eax\n\t"
  36.168 -        "pushl %%eax\n\t"		
  36.169 -        "call *%5\n\t"		/* call fn */
  36.170 -        "movl %3,%0\n\t"	/* exit */
  36.171 -        "int $0x80\n"
  36.172 -        "1:\t"
  36.173 -        :"=&a" (retval), "=&S" (d0)
  36.174 -        :"0" (__NR_clone), "i" (__NR_exit),
  36.175 -        "r" (arg), "r" (fn),
  36.176 -        "b" (flags | CLONE_VM)
  36.177 -        : "memory");
  36.178 -
  36.179 -    return retval;
  36.180 -}
  36.181 -
  36.182 -/*
  36.183 - * Free current thread data structures etc..
  36.184 - */
  36.185 -void exit_thread(void)
  36.186 -{
  36.187 -    /* nothing to do ... */
  36.188 -}
  36.189 -
  36.190 -void flush_thread(void)
  36.191 -{
  36.192 -    struct task_struct *tsk = current;
  36.193 -
  36.194 -    memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8);
  36.195 -
  36.196 -    /*
  36.197 -     * Forget coprocessor state..
  36.198 -     */
  36.199 -    clear_fpu(tsk);
  36.200 -    tsk->used_math = 0;
  36.201 -}
  36.202 -
  36.203 -void release_thread(struct task_struct *dead_task)
  36.204 -{
  36.205 -    if (dead_task->mm) {
  36.206 -        void * ldt = dead_task->mm->context.segments;
  36.207 -
  36.208 -        // temporary debugging check
  36.209 -        if (ldt) {
  36.210 -            printk("WARNING: dead process %8s still has LDT? <%p>\n",
  36.211 -                   dead_task->comm, ldt);
  36.212 -            BUG();
  36.213 -        }
  36.214 -    }
  36.215 -}
  36.216 -
  36.217 -/*
  36.218 - * we do not have to muck with descriptors here, that is
  36.219 - * done in switch_mm() as needed.
  36.220 - */
  36.221 -void copy_segments(struct task_struct *p, struct mm_struct *new_mm)
  36.222 -{
  36.223 -    struct mm_struct * old_mm;
  36.224 -    void *old_ldt, *ldt;
  36.225 -
  36.226 -    ldt = NULL;
  36.227 -    old_mm = current->mm;
  36.228 -    if (old_mm && (old_ldt = old_mm->context.segments) != NULL) {
  36.229 -        /*
  36.230 -         * Completely new LDT, we initialize it from the parent:
  36.231 -         */
  36.232 -        ldt = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
  36.233 -        if ( ldt == NULL )
  36.234 -        {
  36.235 -            printk(KERN_WARNING "ldt allocation failed\n");
  36.236 -        }
  36.237 -        else
  36.238 -        {
  36.239 -            memcpy(ldt, old_ldt, LDT_ENTRIES*LDT_ENTRY_SIZE);
  36.240 -            make_pages_readonly(ldt, (LDT_ENTRIES*LDT_ENTRY_SIZE)/PAGE_SIZE);
  36.241 -        }
  36.242 -    }
  36.243 -    new_mm->context.segments = ldt;
  36.244 -    new_mm->context.cpuvalid = ~0UL;	/* valid on all CPU's - they can't have stale data */
  36.245 -}
  36.246 -
  36.247 -/*
  36.248 - * Save a segment.
  36.249 - */
  36.250 -#define savesegment(seg,value) \
  36.251 -	asm volatile("movl %%" #seg ",%0":"=m" (*(int *)&(value)))
  36.252 -
  36.253 -int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
  36.254 -                unsigned long unused,
  36.255 -                struct task_struct * p, struct pt_regs * regs)
  36.256 -{
  36.257 -    struct pt_regs * childregs;
  36.258 -    unsigned long eflags;
  36.259 -
  36.260 -    childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p)) - 1;
  36.261 -    struct_cpy(childregs, regs);
  36.262 -    childregs->eax = 0;
  36.263 -    childregs->esp = esp;
  36.264 -
  36.265 -    p->thread.esp = (unsigned long) childregs;
  36.266 -    p->thread.esp0 = (unsigned long) (childregs+1);
  36.267 -
  36.268 -    p->thread.eip = (unsigned long) ret_from_fork;
  36.269 -
  36.270 -    savesegment(fs,p->thread.fs);
  36.271 -    savesegment(gs,p->thread.gs);
  36.272 -
  36.273 -    unlazy_fpu(current);
  36.274 -    struct_cpy(&p->thread.i387, &current->thread.i387);
  36.275 -
  36.276 -
  36.277 -    __asm__ __volatile__ ( "pushfl; popl %0" : "=r" (eflags) : );
  36.278 -    p->thread.io_pl = (eflags >> 12) & 3;
  36.279 -
  36.280 -    /* We're careful with hypercall privileges. Don't allow inheritance. */
  36.281 -    p->thread.hypercall_pl = 1;
  36.282 -
  36.283 -    return 0;
  36.284 -}
  36.285 -
  36.286 -/*
  36.287 - * fill in the user structure for a core dump..
  36.288 - */
  36.289 -void dump_thread(struct pt_regs * regs, struct user * dump)
  36.290 -{
  36.291 -    int i;
  36.292 -
  36.293 -/* changed the size calculations - should hopefully work better. lbt */
  36.294 -    dump->magic = CMAGIC;
  36.295 -    dump->start_code = 0;
  36.296 -    dump->start_stack = regs->esp & ~(PAGE_SIZE - 1);
  36.297 -    dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
  36.298 -    dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT;
  36.299 -    dump->u_dsize -= dump->u_tsize;
  36.300 -    dump->u_ssize = 0;
  36.301 -    for (i = 0; i < 8; i++)
  36.302 -        dump->u_debugreg[i] = current->thread.debugreg[i];  
  36.303 -
  36.304 -    if (dump->start_stack < TASK_SIZE)
  36.305 -        dump->u_ssize = ((unsigned long) (TASK_SIZE - dump->start_stack)) >> PAGE_SHIFT;
  36.306 -
  36.307 -    dump->regs.ebx = regs->ebx;
  36.308 -    dump->regs.ecx = regs->ecx;
  36.309 -    dump->regs.edx = regs->edx;
  36.310 -    dump->regs.esi = regs->esi;
  36.311 -    dump->regs.edi = regs->edi;
  36.312 -    dump->regs.ebp = regs->ebp;
  36.313 -    dump->regs.eax = regs->eax;
  36.314 -    dump->regs.ds = regs->xds;
  36.315 -    dump->regs.es = regs->xes;
  36.316 -    savesegment(fs,dump->regs.fs);
  36.317 -    savesegment(gs,dump->regs.gs);
  36.318 -    dump->regs.orig_eax = regs->orig_eax;
  36.319 -    dump->regs.eip = regs->eip;
  36.320 -    dump->regs.cs = regs->xcs;
  36.321 -    dump->regs.eflags = regs->eflags;
  36.322 -    dump->regs.esp = regs->esp;
  36.323 -    dump->regs.ss = regs->xss;
  36.324 -
  36.325 -    dump->u_fpvalid = dump_fpu (regs, &dump->i387);
  36.326 -}
  36.327 -
  36.328 -/*
  36.329 - *	switch_to(x,yn) should switch tasks from x to y.
  36.330 - *
  36.331 - * We fsave/fwait so that an exception goes off at the right time
  36.332 - * (as a call from the fsave or fwait in effect) rather than to
  36.333 - * the wrong process. Lazy FP saving no longer makes any sense
  36.334 - * with modern CPU's, and this simplifies a lot of things (SMP
  36.335 - * and UP become the same).
  36.336 - *
  36.337 - * NOTE! We used to use the x86 hardware context switching. The
  36.338 - * reason for not using it any more becomes apparent when you
  36.339 - * try to recover gracefully from saved state that is no longer
  36.340 - * valid (stale segment register values in particular). With the
  36.341 - * hardware task-switch, there is no way to fix up bad state in
  36.342 - * a reasonable manner.
  36.343 - *
  36.344 - * The fact that Intel documents the hardware task-switching to
  36.345 - * be slow is a fairly red herring - this code is not noticeably
  36.346 - * faster. However, there _is_ some room for improvement here,
  36.347 - * so the performance issues may eventually be a valid point.
  36.348 - * More important, however, is the fact that this allows us much
  36.349 - * more flexibility.
  36.350 - */
  36.351 -void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
  36.352 -{
  36.353 -    struct thread_struct *prev = &prev_p->thread,
  36.354 -        *next = &next_p->thread;
  36.355 -
  36.356 -    __cli();
  36.357 -
  36.358 -    MULTICALL_flush_page_update_queue();
  36.359 -
  36.360 -    /*
  36.361 -     * This is basically 'unlazy_fpu', except that we queue a multicall to 
  36.362 -     * indicate FPU task switch, rather than synchronously trapping to Xen.
  36.363 -     */
  36.364 -    if ( prev_p->flags & PF_USEDFPU )
  36.365 -    {
  36.366 -	if ( cpu_has_fxsr )
  36.367 -            asm volatile( "fxsave %0 ; fnclex"
  36.368 -                          : "=m" (prev_p->thread.i387.fxsave) );
  36.369 -	else
  36.370 -            asm volatile( "fnsave %0 ; fwait"
  36.371 -                          : "=m" (prev_p->thread.i387.fsave) );
  36.372 -	prev_p->flags &= ~PF_USEDFPU;
  36.373 -        queue_multicall0(__HYPERVISOR_fpu_taskswitch);
  36.374 -    }
  36.375 -
  36.376 -    queue_multicall2(__HYPERVISOR_stack_switch, __KERNEL_DS, next->esp0);
  36.377 -    /* Next call will silently fail if we are a non-privileged guest OS. */
  36.378 -    queue_multicall2(__HYPERVISOR_set_priv_levels,
  36.379 -                     next->io_pl, next->hypercall_pl);
  36.380 -
  36.381 -    /* EXECUTE ALL TASK SWITCH XEN SYSCALLS AT THIS POINT. */
  36.382 -    execute_multicall_list();
  36.383 -    __sti();
  36.384 -
  36.385 -    /*
  36.386 -     * Restore %fs and %gs.
  36.387 -     */
  36.388 -    loadsegment(fs, next->fs);
  36.389 -    loadsegment(gs, next->gs);
  36.390 -
  36.391 -    /*
  36.392 -     * Now maybe reload the debug registers
  36.393 -     */
  36.394 -    if ( next->debugreg[7] != 0 )
  36.395 -    {
  36.396 -        HYPERVISOR_set_debugreg(0, next->debugreg[0]);
  36.397 -        HYPERVISOR_set_debugreg(1, next->debugreg[1]);
  36.398 -        HYPERVISOR_set_debugreg(2, next->debugreg[2]);
  36.399 -        HYPERVISOR_set_debugreg(3, next->debugreg[3]);
  36.400 -        /* no 4 and 5 */
  36.401 -        HYPERVISOR_set_debugreg(6, next->debugreg[6]);
  36.402 -        HYPERVISOR_set_debugreg(7, next->debugreg[7]);
  36.403 -    }
  36.404 -}
  36.405 -
  36.406 -asmlinkage int sys_fork(struct pt_regs regs)
  36.407 -{
  36.408 -    return do_fork(SIGCHLD, regs.esp, &regs, 0);
  36.409 -}
  36.410 -
  36.411 -asmlinkage int sys_clone(struct pt_regs regs)
  36.412 -{
  36.413 -    unsigned long clone_flags;
  36.414 -    unsigned long newsp;
  36.415 -
  36.416 -    clone_flags = regs.ebx;
  36.417 -    newsp = regs.ecx;
  36.418 -    if (!newsp)
  36.419 -        newsp = regs.esp;
  36.420 -    return do_fork(clone_flags, newsp, &regs, 0);
  36.421 -}
  36.422 -
  36.423 -/*
  36.424 - * This is trivial, and on the face of it looks like it
  36.425 - * could equally well be done in user mode.
  36.426 - *
  36.427 - * Not so, for quite unobvious reasons - register pressure.
  36.428 - * In user mode vfork() cannot have a stack frame, and if
  36.429 - * done by calling the "clone()" system call directly, you
  36.430 - * do not have enough call-clobbered registers to hold all
  36.431 - * the information you need.
  36.432 - */
  36.433 -asmlinkage int sys_vfork(struct pt_regs regs)
  36.434 -{
  36.435 -    return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.esp, &regs, 0);
  36.436 -}
  36.437 -
  36.438 -/*
  36.439 - * sys_execve() executes a new program.
  36.440 - */
  36.441 -asmlinkage int sys_execve(struct pt_regs regs)
  36.442 -{
  36.443 -    int error;
  36.444 -    char * filename;
  36.445 -
  36.446 -    filename = getname((char *) regs.ebx);
  36.447 -    error = PTR_ERR(filename);
  36.448 -    if (IS_ERR(filename))
  36.449 -        goto out;
  36.450 -    error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, &regs);
  36.451 -    if (error == 0)
  36.452 -        current->ptrace &= ~PT_DTRACE;
  36.453 -    putname(filename);
  36.454 - out:
  36.455 -    return error;
  36.456 -}
  36.457 -
  36.458 -/*
  36.459 - * These bracket the sleeping functions..
  36.460 - */
  36.461 -extern void scheduling_functions_start_here(void);
  36.462 -extern void scheduling_functions_end_here(void);
  36.463 -#define first_sched	((unsigned long) scheduling_functions_start_here)
  36.464 -#define last_sched	((unsigned long) scheduling_functions_end_here)
  36.465 -
  36.466 -unsigned long get_wchan(struct task_struct *p)
  36.467 -{
  36.468 -    unsigned long ebp, esp, eip;
  36.469 -    unsigned long stack_page;
  36.470 -    int count = 0;
  36.471 -    if (!p || p == current || p->state == TASK_RUNNING)
  36.472 -        return 0;
  36.473 -    stack_page = (unsigned long)p;
  36.474 -    esp = p->thread.esp;
  36.475 -    if (!stack_page || esp < stack_page || esp > 8188+stack_page)
  36.476 -        return 0;
  36.477 -    /* include/asm-i386/system.h:switch_to() pushes ebp last. */
  36.478 -    ebp = *(unsigned long *) esp;
  36.479 -    do {
  36.480 -        if (ebp < stack_page || ebp > 8184+stack_page)
  36.481 -            return 0;
  36.482 -        eip = *(unsigned long *) (ebp+4);
  36.483 -        if (eip < first_sched || eip >= last_sched)
  36.484 -            return eip;
  36.485 -        ebp = *(unsigned long *) ebp;
  36.486 -    } while (count++ < 16);
  36.487 -    return 0;
  36.488 -}
  36.489 -#undef last_sched
  36.490 -#undef first_sched
    37.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c	Tue Jun 24 12:05:12 2003 +0000
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,1027 +0,0 @@
    37.4 -/*
    37.5 - *  linux/arch/i386/kernel/setup.c
    37.6 - *
    37.7 - *  Copyright (C) 1995  Linus Torvalds
    37.8 - */
    37.9 -
   37.10 -/*
   37.11 - * This file handles the architecture-dependent parts of initialization
   37.12 - */
   37.13 -
   37.14 -#include <linux/errno.h>
   37.15 -#include <linux/sched.h>
   37.16 -#include <linux/kernel.h>
   37.17 -#include <linux/mm.h>
   37.18 -#include <linux/stddef.h>
   37.19 -#include <linux/unistd.h>
   37.20 -#include <linux/ptrace.h>
   37.21 -#include <linux/slab.h>
   37.22 -#include <linux/user.h>
   37.23 -#include <linux/a.out.h>
   37.24 -#include <linux/tty.h>
   37.25 -#include <linux/ioport.h>
   37.26 -#include <linux/delay.h>
   37.27 -#include <linux/config.h>
   37.28 -#include <linux/init.h>
   37.29 -#include <linux/apm_bios.h>
   37.30 -#ifdef CONFIG_BLK_DEV_RAM
   37.31 -#include <linux/blk.h>
   37.32 -#endif
   37.33 -#include <linux/highmem.h>
   37.34 -#include <linux/bootmem.h>
   37.35 -#include <linux/seq_file.h>
   37.36 -#include <asm/processor.h>
   37.37 -#include <linux/console.h>
   37.38 -#include <asm/mtrr.h>
   37.39 -#include <asm/uaccess.h>
   37.40 -#include <asm/system.h>
   37.41 -#include <asm/io.h>
   37.42 -#include <asm/smp.h>
   37.43 -#include <asm/msr.h>
   37.44 -#include <asm/desc.h>
   37.45 -#include <asm/dma.h>
   37.46 -#include <asm/mpspec.h>
   37.47 -#include <asm/mmu_context.h>
   37.48 -#include <asm/hypervisor.h>
   37.49 -
   37.50 -shared_info_t *HYPERVISOR_shared_info;
   37.51 -
   37.52 -unsigned long *phys_to_machine_mapping;
   37.53 -
   37.54 -/*
   37.55 - * Machine setup..
   37.56 - */
   37.57 -
   37.58 -char ignore_irq13;		/* set if exception 16 works */
   37.59 -struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
   37.60 -
   37.61 -unsigned long mmu_cr4_features;
   37.62 -
   37.63 -/*
   37.64 - * Bus types ..
   37.65 - */
   37.66 -#ifdef CONFIG_EISA
   37.67 -int EISA_bus;
   37.68 -#endif
   37.69 -int MCA_bus;
   37.70 -
   37.71 -/* for MCA, but anyone else can use it if they want */
   37.72 -unsigned int machine_id;
   37.73 -unsigned int machine_submodel_id;
   37.74 -unsigned int BIOS_revision;
   37.75 -unsigned int mca_pentium_flag;
   37.76 -
   37.77 -/* For PCI or other memory-mapped resources */
   37.78 -unsigned long pci_mem_start = 0x10000000;
   37.79 -
   37.80 -/*
   37.81 - * Setup options
   37.82 - */
   37.83 -struct drive_info_struct { char dummy[32]; } drive_info;
   37.84 -struct screen_info screen_info;
   37.85 -struct apm_info apm_info;
   37.86 -struct sys_desc_table_struct {
   37.87 -    unsigned short length;
   37.88 -    unsigned char table[0];
   37.89 -};
   37.90 -
   37.91 -unsigned char aux_device_present;
   37.92 -
   37.93 -extern int root_mountflags;
   37.94 -extern char _text, _etext, _edata, _end;
   37.95 -
   37.96 -int enable_acpi_smp_table;
   37.97 -
   37.98 -/* Raw start-of-day parameters from the hypervisor. */
   37.99 -union start_info_union start_info_union;
  37.100 -
  37.101 -#define COMMAND_LINE_SIZE 256
  37.102 -static char command_line[COMMAND_LINE_SIZE];
  37.103 -char saved_command_line[COMMAND_LINE_SIZE];
  37.104 -
  37.105 -static void __init parse_mem_cmdline (char ** cmdline_p)
  37.106 -{
  37.107 -    char c = ' ', *to = command_line, *from = saved_command_line;
  37.108 -    int len = 0;
  37.109 -
  37.110 -    /* Save unparsed command line copy for /proc/cmdline */
  37.111 -    memcpy(saved_command_line, start_info.cmd_line, COMMAND_LINE_SIZE);
  37.112 -    saved_command_line[COMMAND_LINE_SIZE-1] = '\0';
  37.113 -
  37.114 -    for (;;) {
  37.115 -        /*
  37.116 -         * "mem=nopentium" disables the 4MB page tables.
  37.117 -         * "mem=XXX[kKmM]" defines a memory region from HIGH_MEM
  37.118 -         * to <mem>, overriding the bios size.
  37.119 -         * "mem=XXX[KkmM]@XXX[KkmM]" defines a memory region from
  37.120 -         * <start> to <start>+<mem>, overriding the bios size.
  37.121 -         */
  37.122 -        if (c == ' ' && !memcmp(from, "mem=", 4)) {
  37.123 -            if (to != command_line)
  37.124 -                to--;
  37.125 -            if (!memcmp(from+4, "nopentium", 9)) {
  37.126 -                from += 9+4;
  37.127 -            } else if (!memcmp(from+4, "exactmap", 8)) {
  37.128 -                from += 8+4;
  37.129 -            } else {
  37.130 -                (void)memparse(from+4, &from);
  37.131 -                if (*from == '@')
  37.132 -                    (void)memparse(from+1, &from);
  37.133 -            }
  37.134 -        }
  37.135 -
  37.136 -        c = *(from++);
  37.137 -        if (!c)
  37.138 -            break;
  37.139 -        if (COMMAND_LINE_SIZE <= ++len)
  37.140 -            break;
  37.141 -        *(to++) = c;
  37.142 -    }
  37.143 -    *to = '\0';
  37.144 -    *cmdline_p = command_line;
  37.145 -}
  37.146 -
  37.147 -void __init setup_arch(char **cmdline_p)
  37.148 -{
  37.149 -    unsigned long start_pfn, max_pfn, max_low_pfn;
  37.150 -    unsigned long bootmap_size;
  37.151 -    unsigned long i;
  37.152 -
  37.153 -    extern void hypervisor_callback(void);
  37.154 -    extern void failsafe_callback(void);
  37.155 -
  37.156 -    extern unsigned long cpu0_pte_quicklist[];
  37.157 -    extern unsigned long cpu0_pgd_quicklist[];
  37.158 -
  37.159 -    HYPERVISOR_set_callbacks(
  37.160 -        __KERNEL_CS, (unsigned long)hypervisor_callback,
  37.161 -        __KERNEL_CS, (unsigned long)failsafe_callback);
  37.162 -
  37.163 -    boot_cpu_data.pgd_quick = cpu0_pgd_quicklist;
  37.164 -    boot_cpu_data.pte_quick = cpu0_pte_quicklist;
  37.165 -
  37.166 -    ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
  37.167 -    memset(&drive_info, 0, sizeof(drive_info));
  37.168 -    memset(&screen_info, 0, sizeof(screen_info));
  37.169 -    // this is drawn from a dump from vgacon:startup in standard linux
  37.170 -    screen_info.orig_video_mode = 3; 
  37.171 -    screen_info.orig_video_isVGA = 1;
  37.172 -    screen_info.orig_video_lines = 25;
  37.173 -    screen_info.orig_video_cols = 80;
  37.174 -    screen_info.orig_video_ega_bx = 3;
  37.175 -    screen_info.orig_video_points = 16;
  37.176 -
  37.177 -    memset(&apm_info.bios, 0, sizeof(apm_info.bios));
  37.178 -    aux_device_present = 0; 
  37.179 -#ifdef CONFIG_BLK_DEV_RAM
  37.180 -    rd_image_start = 0;
  37.181 -    rd_prompt = 0;
  37.182 -    rd_doload = 0;
  37.183 -#endif
  37.184 -
  37.185 -    root_mountflags &= ~MS_RDONLY;
  37.186 -    init_mm.start_code = (unsigned long) &_text;
  37.187 -    init_mm.end_code = (unsigned long) &_etext;
  37.188 -    init_mm.end_data = (unsigned long) &_edata;
  37.189 -    init_mm.brk = (unsigned long) &_end;
  37.190 -
  37.191 -    parse_mem_cmdline(cmdline_p);
  37.192 -
  37.193 -#define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
  37.194 -#define PFN_DOWN(x)	((x) >> PAGE_SHIFT)
  37.195 -#define PFN_PHYS(x)	((x) << PAGE_SHIFT)
  37.196 -
  37.197 -/*
  37.198 - * 128MB for vmalloc and initrd
  37.199 - */
  37.200 -#define VMALLOC_RESERVE	(unsigned long)(128 << 20)
  37.201 -#define MAXMEM		(unsigned long)(HYPERVISOR_VIRT_START-PAGE_OFFSET-VMALLOC_RESERVE)
  37.202 -#define MAXMEM_PFN	PFN_DOWN(MAXMEM)
  37.203 -#define MAX_NONPAE_PFN	(1 << 20)
  37.204 -
  37.205 -    /*
  37.206 -     * partially used pages are not usable - thus
  37.207 -     * we are rounding upwards:
  37.208 -     */
  37.209 -#ifdef CONFIG_BLK_DEV_INITRD
  37.210 -    if ( start_info.mod_start )
  37.211 -        start_pfn = PFN_UP(__pa(start_info.mod_start + start_info.mod_len));
  37.212 -    else
  37.213 -#endif
  37.214 -    start_pfn = PFN_UP(__pa(&_end));
  37.215 -    max_pfn = start_info.nr_pages;
  37.216 -
  37.217 -    /*
  37.218 -     * Determine low and high memory ranges:
  37.219 -     */
  37.220 -    max_low_pfn = max_pfn;
  37.221 -    if (max_low_pfn > MAXMEM_PFN) {
  37.222 -        max_low_pfn = MAXMEM_PFN;
  37.223 -#ifndef CONFIG_HIGHMEM
  37.224 -        /* Maximum memory usable is what is directly addressable */
  37.225 -        printk(KERN_WARNING "Warning only %ldMB will be used.\n",
  37.226 -               MAXMEM>>20);
  37.227 -        if (max_pfn > MAX_NONPAE_PFN)
  37.228 -            printk(KERN_WARNING "Use a PAE enabled kernel.\n");
  37.229 -        else
  37.230 -            printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
  37.231 -#else /* !CONFIG_HIGHMEM */
  37.232 -#ifndef CONFIG_X86_PAE
  37.233 -        if (max_pfn > MAX_NONPAE_PFN) {
  37.234 -            max_pfn = MAX_NONPAE_PFN;
  37.235 -            printk(KERN_WARNING "Warning only 4GB will be used.\n");
  37.236 -            printk(KERN_WARNING "Use a PAE enabled kernel.\n");
  37.237 -        }
  37.238 -#endif /* !CONFIG_X86_PAE */
  37.239 -#endif /* !CONFIG_HIGHMEM */
  37.240 -    }
  37.241 -
  37.242 -#ifdef CONFIG_HIGHMEM
  37.243 -    highstart_pfn = highend_pfn = max_pfn;
  37.244 -    if (max_pfn > MAXMEM_PFN) {
  37.245 -        highstart_pfn = MAXMEM_PFN;
  37.246 -        printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
  37.247 -               pages_to_mb(highend_pfn - highstart_pfn));
  37.248 -    }
  37.249 -#endif
  37.250 -
  37.251 -    /*
  37.252 -     * Initialize the boot-time allocator, and free up all RAM.
  37.253 -     * Then reserve space for OS image, and the bootmem bitmap.
  37.254 -     */
  37.255 -    bootmap_size = init_bootmem(start_pfn, max_low_pfn);
  37.256 -    free_bootmem(0, PFN_PHYS(max_low_pfn));
  37.257 -    reserve_bootmem(0, PFN_PHYS(start_pfn) + bootmap_size + PAGE_SIZE-1);
  37.258 -
  37.259 -    /* Now reserve space for the hypervisor-provided page tables. */
  37.260 -    {
  37.261 -        unsigned long *pgd = (unsigned long *)start_info.pt_base;
  37.262 -        unsigned long  pte;
  37.263 -        int i;
  37.264 -        reserve_bootmem(__pa(pgd), PAGE_SIZE);
  37.265 -        for ( i = 0; i < (HYPERVISOR_VIRT_START>>22); i++ )
  37.266 -        {
  37.267 -            unsigned long pgde = *pgd++;
  37.268 -            if ( !(pgde & 1) ) continue;
  37.269 -            pte = machine_to_phys(pgde & PAGE_MASK);
  37.270 -            reserve_bootmem(pte, PAGE_SIZE);
  37.271 -        }
  37.272 -    }
  37.273 -    cur_pgd = init_mm.pgd = (pgd_t *)start_info.pt_base;
  37.274 -
  37.275 -    /* Now initialise the physical->machine mapping table. */
  37.276 -    phys_to_machine_mapping = alloc_bootmem(max_pfn * sizeof(unsigned long));
  37.277 -    for ( i = 0; i < max_pfn; i++ )
  37.278 -    {
  37.279 -        unsigned long pgde, *ppte;
  37.280 -        unsigned long pfn = i + (PAGE_OFFSET >> PAGE_SHIFT);
  37.281 -        pgde = *((unsigned long *)start_info.pt_base + (pfn >> 10));
  37.282 -        ppte = (unsigned long *)machine_to_phys(pgde & PAGE_MASK) + (pfn&1023);
  37.283 -        phys_to_machine_mapping[i] = 
  37.284 -            (*(unsigned long *)__va(ppte)) >> PAGE_SHIFT;
  37.285 -    }
  37.286 -
  37.287 -#ifdef CONFIG_BLK_DEV_INITRD
  37.288 -    if (start_info.mod_start) {
  37.289 -        if ((__pa(start_info.mod_start) + start_info.mod_len) <= 
  37.290 -            (max_low_pfn << PAGE_SHIFT)) {
  37.291 -            initrd_start = start_info.mod_start;
  37.292 -            initrd_end   = initrd_start + start_info.mod_len;
  37.293 -            initrd_below_start_ok = 1;
  37.294 -        }
  37.295 -        else {
  37.296 -            printk(KERN_ERR "initrd extends beyond end of memory "
  37.297 -                   "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
  37.298 -                   __pa(start_info.mod_start) + start_info.mod_len,
  37.299 -                   max_low_pfn << PAGE_SHIFT);
  37.300 -            initrd_start = 0;
  37.301 -        }
  37.302 -    }
  37.303 -#endif
  37.304 -
  37.305 -    paging_init();
  37.306 -
  37.307 -    current->thread.hypercall_pl = 1;
  37.308 -    if ( start_info.flags & SIF_PRIVILEGED ) {
  37.309 -        current->thread.io_pl = 1;
  37.310 -        /* We are privileged guest os - should have IO privileges. */
  37.311 -        if( HYPERVISOR_set_priv_levels(1, 1) )
  37.312 -            panic("Unable to obtain IOPL, despite being SIF_PRIVILEGED");
  37.313 -    }
  37.314 -
  37.315 -    if(start_info.flags & SIF_CONSOLE)
  37.316 -    {
  37.317 -        if( !(start_info.flags & SIF_PRIVILEGED) )
  37.318 -            panic("Xen granted us console access but not privileged status");
  37.319 -
  37.320 -#ifdef CONFIG_VT
  37.321 -#if defined(CONFIG_VGA_CONSOLE)
  37.322 -        conswitchp = &vga_con;
  37.323 -#elif defined(CONFIG_DUMMY_CONSOLE)
  37.324 -        conswitchp = &dummy_con;
  37.325 -#endif
  37.326 -#endif
  37.327 -    }
  37.328 -}
  37.329 -
  37.330 -static int cachesize_override __initdata = -1;
  37.331 -static int __init cachesize_setup(char *str)
  37.332 -{
  37.333 -    get_option (&str, &cachesize_override);
  37.334 -    return 1;
  37.335 -}
  37.336 -__setup("cachesize=", cachesize_setup);
  37.337 -
  37.338 -
  37.339 -static int __init get_model_name(struct cpuinfo_x86 *c)
  37.340 -{
  37.341 -    unsigned int *v;
  37.342 -    char *p, *q;
  37.343 -
  37.344 -    if (cpuid_eax(0x80000000) < 0x80000004)
  37.345 -        return 0;
  37.346 -
  37.347 -    v = (unsigned int *) c->x86_model_id;
  37.348 -    cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]);
  37.349 -    cpuid(0x80000003, &v[4], &v[5], &v[6], &v[7]);
  37.350 -    cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]);
  37.351 -    c->x86_model_id[48] = 0;
  37.352 -
  37.353 -    /* Intel chips right-justify this string for some dumb reason;
  37.354 -       undo that brain damage */
  37.355 -    p = q = &c->x86_model_id[0];
  37.356 -    while ( *p == ' ' )
  37.357 -        p++;
  37.358 -    if ( p != q ) {
  37.359 -        while ( *p )
  37.360 -            *q++ = *p++;
  37.361 -        while ( q <= &c->x86_model_id[48] )
  37.362 -            *q++ = '\0';	/* Zero-pad the rest */
  37.363 -    }
  37.364 -
  37.365 -    return 1;
  37.366 -}
  37.367 -
  37.368 -
  37.369 -static void __init display_cacheinfo(struct cpuinfo_x86 *c)
  37.370 -{
  37.371 -    unsigned int n, dummy, ecx, edx, l2size;
  37.372 -
  37.373 -    n = cpuid_eax(0x80000000);
  37.374 -
  37.375 -    if (n >= 0x80000005) {
  37.376 -        cpuid(0x80000005, &dummy, &dummy, &ecx, &edx);
  37.377 -        printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n",
  37.378 -               edx>>24, edx&0xFF, ecx>>24, ecx&0xFF);
  37.379 -        c->x86_cache_size=(ecx>>24)+(edx>>24);	
  37.380 -    }
  37.381 -
  37.382 -    if (n < 0x80000006)	/* Some chips just has a large L1. */
  37.383 -        return;
  37.384 -
  37.385 -    ecx = cpuid_ecx(0x80000006);
  37.386 -    l2size = ecx >> 16;
  37.387 -
  37.388 -    /* AMD errata T13 (order #21922) */
  37.389 -    if ((c->x86_vendor == X86_VENDOR_AMD) && (c->x86 == 6)) {
  37.390 -        if (c->x86_model == 3 && c->x86_mask == 0)	/* Duron Rev A0 */
  37.391 -            l2size = 64;
  37.392 -        if (c->x86_model == 4 &&
  37.393 -            (c->x86_mask==0 || c->x86_mask==1))	/* Tbird rev A1/A2 */
  37.394 -            l2size = 256;
  37.395 -    }
  37.396 -
  37.397 -    /* Intel PIII Tualatin. This comes in two flavours.
  37.398 -     * One has 256kb of cache, the other 512. We have no way
  37.399 -     * to determine which, so we use a boottime override
  37.400 -     * for the 512kb model, and assume 256 otherwise.
  37.401 -     */
  37.402 -    if ((c->x86_vendor == X86_VENDOR_INTEL) && (c->x86 == 6) &&
  37.403 -        (c->x86_model == 11) && (l2size == 0))
  37.404 -        l2size = 256;
  37.405 -
  37.406 -    /* VIA C3 CPUs (670-68F) need further shifting. */
  37.407 -    if (c->x86_vendor == X86_VENDOR_CENTAUR && (c->x86 == 6) &&
  37.408 -        ((c->x86_model == 7) || (c->x86_model == 8))) {
  37.409 -        l2size = l2size >> 8;
  37.410 -    }
  37.411 -
  37.412 -    /* Allow user to override all this if necessary. */
  37.413 -    if (cachesize_override != -1)
  37.414 -        l2size = cachesize_override;
  37.415 -
  37.416 -    if ( l2size == 0 )
  37.417 -        return;		/* Again, no L2 cache is possible */
  37.418 -
  37.419 -    c->x86_cache_size = l2size;
  37.420 -
  37.421 -    printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n",
  37.422 -           l2size, ecx & 0xFF);
  37.423 -}
  37.424 -
  37.425 -
  37.426 -static int __init init_amd(struct cpuinfo_x86 *c)
  37.427 -{
  37.428 -    int r;
  37.429 -
  37.430 -    /* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
  37.431 -       3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
  37.432 -    clear_bit(0*32+31, &c->x86_capability);
  37.433 -	
  37.434 -    r = get_model_name(c);
  37.435 -
  37.436 -    switch(c->x86)
  37.437 -    {
  37.438 -    case 6:	/* An Athlon/Duron. We can trust the BIOS probably */
  37.439 -        break;		
  37.440 -    default:
  37.441 -        panic("Unsupported AMD processor\n");
  37.442 -    }
  37.443 -
  37.444 -    display_cacheinfo(c);
  37.445 -    return r;
  37.446 -}
  37.447 -
  37.448 -
  37.449 -static void __init init_intel(struct cpuinfo_x86 *c)
  37.450 -{
  37.451 -    char *p = NULL;
  37.452 -    unsigned int l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
  37.453 -
  37.454 -    if (c->cpuid_level > 1) {
  37.455 -        /* supports eax=2  call */
  37.456 -        int i, j, n;
  37.457 -        int regs[4];
  37.458 -        unsigned char *dp = (unsigned char *)regs;
  37.459 -
  37.460 -        /* Number of times to iterate */
  37.461 -        n = cpuid_eax(2) & 0xFF;
  37.462 -
  37.463 -        for ( i = 0 ; i < n ; i++ ) {
  37.464 -            cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
  37.465 -			
  37.466 -            /* If bit 31 is set, this is an unknown format */
  37.467 -            for ( j = 0 ; j < 3 ; j++ ) {
  37.468 -                if ( regs[j] < 0 ) regs[j] = 0;
  37.469 -            }
  37.470 -
  37.471 -            /* Byte 0 is level count, not a descriptor */
  37.472 -            for ( j = 1 ; j < 16 ; j++ ) {
  37.473 -                unsigned char des = dp[j];
  37.474 -                unsigned char dl, dh;
  37.475 -                unsigned int cs;
  37.476 -
  37.477 -                dh = des >> 4;
  37.478 -                dl = des & 0x0F;
  37.479 -
  37.480 -				/* Black magic... */
  37.481 -
  37.482 -                switch ( dh )
  37.483 -                {
  37.484 -                case 0:
  37.485 -                    switch ( dl ) {
  37.486 -                    case 6:
  37.487 -                        /* L1 I cache */
  37.488 -                        l1i += 8;
  37.489 -                        break;
  37.490 -                    case 8:
  37.491 -                        /* L1 I cache */
  37.492 -                        l1i += 16;
  37.493 -                        break;
  37.494 -                    case 10:
  37.495 -                        /* L1 D cache */
  37.496 -                        l1d += 8;
  37.497 -                        break;
  37.498 -                    case 12:
  37.499 -                        /* L1 D cache */
  37.500 -                        l1d += 16;
  37.501 -                        break;
  37.502 -                    default:;
  37.503 -                        /* TLB, or unknown */
  37.504 -                    }
  37.505 -                    break;
  37.506 -                case 2:
  37.507 -                    if ( dl ) {
  37.508 -                        /* L3 cache */
  37.509 -                        cs = (dl-1) << 9;
  37.510 -                        l3 += cs;
  37.511 -                    }
  37.512 -                    break;
  37.513 -                case 4:
  37.514 -                    if ( c->x86 > 6 && dl ) {
  37.515 -                        /* P4 family */
  37.516 -                        /* L3 cache */
  37.517 -                        cs = 128 << (dl-1);
  37.518 -                        l3 += cs;
  37.519 -                        break;
  37.520 -                    }
  37.521 -                    /* else same as 8 - fall through */
  37.522 -                case 8:
  37.523 -                    if ( dl ) {
  37.524 -                        /* L2 cache */
  37.525 -                        cs = 128 << (dl-1);
  37.526 -                        l2 += cs;
  37.527 -                    }
  37.528 -                    break;
  37.529 -                case 6:
  37.530 -                    if (dl > 5) {
  37.531 -                        /* L1 D cache */
  37.532 -                        cs = 8<<(dl-6);
  37.533 -                        l1d += cs;
  37.534 -                    }
  37.535 -                    break;
  37.536 -                case 7:
  37.537 -                    if ( dl >= 8 ) 
  37.538 -                    {
  37.539 -                        /* L2 cache */
  37.540 -                        cs = 64<<(dl-8);
  37.541 -                        l2 += cs;
  37.542 -                    } else {
  37.543 -                        /* L0 I cache, count as L1 */
  37.544 -                        cs = dl ? (16 << (dl-1)) : 12;
  37.545 -                        l1i += cs;
  37.546 -                    }
  37.547 -                    break;
  37.548 -                default:
  37.549 -                    /* TLB, or something else we don't know about */
  37.550 -                    break;
  37.551 -                }
  37.552 -            }
  37.553 -        }
  37.554 -        if ( l1i || l1d )
  37.555 -            printk(KERN_INFO "CPU: L1 I cache: %dK, L1 D cache: %dK\n",
  37.556 -                   l1i, l1d);
  37.557 -        if ( l2 )
  37.558 -            printk(KERN_INFO "CPU: L2 cache: %dK\n", l2);
  37.559 -        if ( l3 )
  37.560 -            printk(KERN_INFO "CPU: L3 cache: %dK\n", l3);
  37.561 -
  37.562 -        /*
  37.563 -         * This assumes the L3 cache is shared; it typically lives in
  37.564 -         * the northbridge.  The L1 caches are included by the L2
  37.565 -         * cache, and so should not be included for the purpose of
  37.566 -         * SMP switching weights.
  37.567 -         */
  37.568 -        c->x86_cache_size = l2 ? l2 : (l1i+l1d);
  37.569 -    }
  37.570 -
  37.571 -    /* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it */
  37.572 -    if ( c->x86 == 6 && c->x86_model < 3 && c->x86_mask < 3 )
  37.573 -        clear_bit(X86_FEATURE_SEP, &c->x86_capability);
  37.574 -	
  37.575 -    /* Names for the Pentium II/Celeron processors 
  37.576 -       detectable only by also checking the cache size.
  37.577 -       Dixon is NOT a Celeron. */
  37.578 -    if (c->x86 == 6) {
  37.579 -        switch (c->x86_model) {
  37.580 -        case 5:
  37.581 -            if (l2 == 0)
  37.582 -                p = "Celeron (Covington)";
  37.583 -            if (l2 == 256)
  37.584 -                p = "Mobile Pentium II (Dixon)";
  37.585 -            break;
  37.586 -			
  37.587 -        case 6:
  37.588 -            if (l2 == 128)
  37.589 -                p = "Celeron (Mendocino)";
  37.590 -            break;
  37.591 -			
  37.592 -        case 8:
  37.593 -            if (l2 == 128)
  37.594 -                p = "Celeron (Coppermine)";
  37.595 -            break;
  37.596 -        }
  37.597 -    }
  37.598 -
  37.599 -    if ( p )
  37.600 -        strcpy(c->x86_model_id, p);
  37.601 -}
  37.602 -
  37.603 -void __init get_cpu_vendor(struct cpuinfo_x86 *c)
  37.604 -{
  37.605 -    char *v = c->x86_vendor_id;
  37.606 -
  37.607 -    if (!strcmp(v, "GenuineIntel"))
  37.608 -        c->x86_vendor = X86_VENDOR_INTEL;
  37.609 -    else if (!strcmp(v, "AuthenticAMD"))
  37.610 -        c->x86_vendor = X86_VENDOR_AMD;
  37.611 -    else
  37.612 -        c->x86_vendor = X86_VENDOR_UNKNOWN;
  37.613 -}
  37.614 -
  37.615 -struct cpu_model_info {
  37.616 -    int vendor;
  37.617 -    int family;
  37.618 -    char *model_names[16];
  37.619 -};
  37.620 -
  37.621 -/* Naming convention should be: <Name> [(<Codename>)] */
  37.622 -/* This table only is used unless init_<vendor>() below doesn't set it; */
  37.623 -/* in particular, if CPUID levels 0x80000002..4 are supported, this isn't used */
  37.624 -static struct cpu_model_info cpu_models[] __initdata = {
  37.625 -    { X86_VENDOR_INTEL,	6,
  37.626 -      { "Pentium Pro A-step", "Pentium Pro", NULL, "Pentium II (Klamath)", 
  37.627 -        NULL, "Pentium II (Deschutes)", "Mobile Pentium II",
  37.628 -        "Pentium III (Katmai)", "Pentium III (Coppermine)", NULL,
  37.629 -        "Pentium III (Cascades)", NULL, NULL, NULL, NULL }},
  37.630 -    { X86_VENDOR_AMD,	6, /* Is this this really necessary?? */
  37.631 -      { "Athlon", "Athlon",
  37.632 -        "Athlon", NULL, "Athlon", NULL,
  37.633 -        NULL, NULL, NULL,
  37.634 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL }}
  37.635 -};
  37.636 -
  37.637 -/* Look up CPU names by table lookup. */
  37.638 -static char __init *table_lookup_model(struct cpuinfo_x86 *c)
  37.639 -{
  37.640 -    struct cpu_model_info *info = cpu_models;
  37.641 -    int i;
  37.642 -
  37.643 -    if ( c->x86_model >= 16 )
  37.644 -        return NULL;	/* Range check */
  37.645 -
  37.646 -    for ( i = 0 ; i < sizeof(cpu_models)/sizeof(struct cpu_model_info) ; i++ ) {
  37.647 -        if ( info->vendor == c->x86_vendor &&
  37.648 -             info->family == c->x86 ) {
  37.649 -            return info->model_names[c->x86_model];
  37.650 -        }
  37.651 -        info++;
  37.652 -    }
  37.653 -    return NULL;		/* Not found */
  37.654 -}
  37.655 -
  37.656 -
  37.657 -
  37.658 -/* Standard macro to see if a specific flag is changeable */
  37.659 -static inline int flag_is_changeable_p(u32 flag)
  37.660 -{
  37.661 -    u32 f1, f2;
  37.662 -
  37.663 -    asm("pushfl\n\t"
  37.664 -        "pushfl\n\t"
  37.665 -        "popl %0\n\t"
  37.666 -        "movl %0,%1\n\t"
  37.667 -        "xorl %2,%0\n\t"
  37.668 -        "pushl %0\n\t"
  37.669 -        "popfl\n\t"
  37.670 -        "pushfl\n\t"
  37.671 -        "popl %0\n\t"
  37.672 -        "popfl\n\t"
  37.673 -        : "=&r" (f1), "=&r" (f2)
  37.674 -        : "ir" (flag));
  37.675 -
  37.676 -    return ((f1^f2) & flag) != 0;
  37.677 -}
  37.678 -
  37.679 -
  37.680 -/* Probe for the CPUID instruction */
  37.681 -static int __init have_cpuid_p(void)
  37.682 -{
  37.683 -    return flag_is_changeable_p(X86_EFLAGS_ID);
  37.684 -}
  37.685 -
  37.686 -
  37.687 -
  37.688 -/*
  37.689 - * This does the hard work of actually picking apart the CPU stuff...
  37.690 - */
  37.691 -void __init identify_cpu(struct cpuinfo_x86 *c)
  37.692 -{
  37.693 -    int junk, i;
  37.694 -    u32 xlvl, tfms;
  37.695 -
  37.696 -    c->loops_per_jiffy = loops_per_jiffy;
  37.697 -    c->x86_cache_size = -1;
  37.698 -    c->x86_vendor = X86_VENDOR_UNKNOWN;
  37.699 -    c->cpuid_level = -1;	/* CPUID not detected */
  37.700 -    c->x86_model = c->x86_mask = 0;	/* So far unknown... */
  37.701 -    c->x86_vendor_id[0] = '\0'; /* Unset */
  37.702 -    c->x86_model_id[0] = '\0';  /* Unset */
  37.703 -    memset(&c->x86_capability, 0, sizeof c->x86_capability);
  37.704 -    c->hard_math = 1;
  37.705 -
  37.706 -    if ( !have_cpuid_p() ) {
  37.707 -        panic("Processor must support CPUID\n");
  37.708 -    } else {
  37.709 -        /* CPU does have CPUID */
  37.710 -
  37.711 -        /* Get vendor name */
  37.712 -        cpuid(0x00000000, &c->cpuid_level,
  37.713 -              (int *)&c->x86_vendor_id[0],
  37.714 -              (int *)&c->x86_vendor_id[8],
  37.715 -              (int *)&c->x86_vendor_id[4]);
  37.716 -		
  37.717 -        get_cpu_vendor(c);
  37.718 -        /* Initialize the standard set of capabilities */
  37.719 -        /* Note that the vendor-specific code below might override */
  37.720 -
  37.721 -        /* Intel-defined flags: level 0x00000001 */
  37.722 -        if ( c->cpuid_level >= 0x00000001 ) {
  37.723 -            cpuid(0x00000001, &tfms, &junk, &junk,
  37.724 -                  &c->x86_capability[0]);
  37.725 -            c->x86 = (tfms >> 8) & 15;
  37.726 -            c->x86_model = (tfms >> 4) & 15;
  37.727 -            c->x86_mask = tfms & 15;
  37.728 -        } else {
  37.729 -            /* Have CPUID level 0 only - unheard of */
  37.730 -            c->x86 = 4;
  37.731 -        }
  37.732 -
  37.733 -        /* AMD-defined flags: level 0x80000001 */
  37.734 -        xlvl = cpuid_eax(0x80000000);
  37.735 -        if ( (xlvl & 0xffff0000) == 0x80000000 ) {
  37.736 -            if ( xlvl >= 0x80000001 )
  37.737 -                c->x86_capability[1] = cpuid_edx(0x80000001);
  37.738 -            if ( xlvl >= 0x80000004 )
  37.739 -                get_model_name(c); /* Default name */
  37.740 -        }
  37.741 -
  37.742 -        /* Transmeta-defined flags: level 0x80860001 */
  37.743 -        xlvl = cpuid_eax(0x80860000);
  37.744 -        if ( (xlvl & 0xffff0000) == 0x80860000 ) {
  37.745 -            if (  xlvl >= 0x80860001 )
  37.746 -                c->x86_capability[2] = cpuid_edx(0x80860001);
  37.747 -        }
  37.748 -    }
  37.749 -
  37.750 -    printk(KERN_DEBUG "CPU: Before vendor init, caps: %08x %08x %08x, vendor = %d\n",
  37.751 -           c->x86_capability[0],
  37.752 -           c->x86_capability[1],
  37.753 -           c->x86_capability[2],
  37.754 -           c->x86_vendor);
  37.755 -
  37.756 -    /*
  37.757 -     * Vendor-specific initialization.  In this section we
  37.758 -     * canonicalize the feature flags, meaning if there are
  37.759 -     * features a certain CPU supports which CPUID doesn't
  37.760 -     * tell us, CPUID claiming incorrect flags, or other bugs,
  37.761 -     * we handle them here.
  37.762 -     *
  37.763 -     * At the end of this section, c->x86_capability better
  37.764 -     * indicate the features this CPU genuinely supports!
  37.765 -     */
  37.766 -    switch ( c->x86_vendor ) {
  37.767 -    case X86_VENDOR_AMD:
  37.768 -        init_amd(c);
  37.769 -        break;
  37.770 -
  37.771 -    case X86_VENDOR_INTEL:
  37.772 -        init_intel(c);
  37.773 -        break;
  37.774 -
  37.775 -    default:
  37.776 -        panic("Unsupported CPU vendor\n");
  37.777 -    }
  37.778 -	
  37.779 -    printk(KERN_DEBUG "CPU: After vendor init, caps: %08x %08x %08x %08x\n",
  37.780 -           c->x86_capability[0],
  37.781 -           c->x86_capability[1],
  37.782 -           c->x86_capability[2],
  37.783 -           c->x86_capability[3]);
  37.784 -
  37.785 -
  37.786 -    /* If the model name is still unset, do table lookup. */
  37.787 -    if ( !c->x86_model_id[0] ) {
  37.788 -        char *p;
  37.789 -        p = table_lookup_model(c);
  37.790 -        if ( p )
  37.791 -            strcpy(c->x86_model_id, p);
  37.792 -        else
  37.793 -            /* Last resort... */
  37.794 -            sprintf(c->x86_model_id, "%02x/%02x",
  37.795 -                    c->x86_vendor, c->x86_model);
  37.796 -    }
  37.797 -
  37.798 -    /* Now the feature flags better reflect actual CPU features! */
  37.799 -
  37.800 -    printk(KERN_DEBUG "CPU:     After generic, caps: %08x %08x %08x %08x\n",
  37.801 -           c->x86_capability[0],
  37.802 -           c->x86_capability[1],
  37.803 -           c->x86_capability[2],
  37.804 -           c->x86_capability[3]);
  37.805 -
  37.806 -    /*
  37.807 -     * On SMP, boot_cpu_data holds the common feature set between
  37.808 -     * all CPUs; so make sure that we indicate which features are
  37.809 -     * common between the CPUs.  The first time this routine gets
  37.810 -     * executed, c == &boot_cpu_data.
  37.811 -     */
  37.812 -    if ( c != &boot_cpu_data ) {
  37.813 -        /* AND the already accumulated flags with these */
  37.814 -        for ( i = 0 ; i < NCAPINTS ; i++ )
  37.815 -            boot_cpu_data.x86_capability[i] &= c->x86_capability[i];
  37.816 -    }
  37.817 -
  37.818 -    printk(KERN_DEBUG "CPU:             Common caps: %08x %08x %08x %08x\n",
  37.819 -           boot_cpu_data.x86_capability[0],
  37.820 -           boot_cpu_data.x86_capability[1],
  37.821 -           boot_cpu_data.x86_capability[2],
  37.822 -           boot_cpu_data.x86_capability[3]);
  37.823 -}
  37.824 -
  37.825 -
  37.826 -/* These need to match <asm/processor.h> */
  37.827 -static char *cpu_vendor_names[] __initdata = {
  37.828 -    "Intel", "Cyrix", "AMD", "UMC", "NexGen", "Centaur", "Rise", "Transmeta" };
  37.829 -
  37.830 -
  37.831 -void __init print_cpu_info(struct cpuinfo_x86 *c)
  37.832 -{
  37.833 -    char *vendor = NULL;
  37.834 -
  37.835 -    if (c->x86_vendor < sizeof(cpu_vendor_names)/sizeof(char *))
  37.836 -        vendor = cpu_vendor_names[c->x86_vendor];
  37.837 -    else if (c->cpuid_level >= 0)
  37.838 -        vendor = c->x86_vendor_id;
  37.839 -
  37.840 -    if (vendor && strncmp(c->x86_model_id, vendor, strlen(vendor)))
  37.841 -        printk("%s ", vendor);
  37.842 -
  37.843 -    if (!c->x86_model_id[0])
  37.844 -        printk("%d86", c->x86);
  37.845 -    else
  37.846 -        printk("%s", c->x86_model_id);
  37.847 -
  37.848 -    if (c->x86_mask || c->cpuid_level >= 0) 
  37.849 -        printk(" stepping %02x\n", c->x86_mask);
  37.850 -    else
  37.851 -        printk("\n");
  37.852 -}
  37.853 -
  37.854 -/*
  37.855 - *	Get CPU information for use by the procfs.
  37.856 - */
  37.857 -static int show_cpuinfo(struct seq_file *m, void *v)
  37.858 -{
  37.859 -    /* 
  37.860 -     * These flag bits must match the definitions in <asm/cpufeature.h>.
  37.861 -     * NULL means this bit is undefined or reserved; either way it doesn't
  37.862 -     * have meaning as far as Linux is concerned.  Note that it's important
  37.863 -     * to realize there is a difference between this table and CPUID -- if
  37.864 -     * applications want to get the raw CPUID data, they should access
  37.865 -     * /dev/cpu/<cpu_nr>/cpuid instead.
  37.866 -	 */
  37.867 -    static char *x86_cap_flags[] = {
  37.868 -        /* Intel-defined */
  37.869 -        "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
  37.870 -        "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
  37.871 -        "pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
  37.872 -        "fxsr", "sse", "sse2", "ss", NULL, "tm", "ia64", NULL,
  37.873 -
  37.874 -        /* AMD-defined */
  37.875 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  37.876 -        NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
  37.877 -        NULL, NULL, NULL, NULL, NULL, NULL, "mmxext", NULL,
  37.878 -        NULL, NULL, NULL, NULL, NULL, "lm", "3dnowext", "3dnow",
  37.879 -
  37.880 -        /* Transmeta-defined */
  37.881 -        "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
  37.882 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  37.883 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  37.884 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  37.885 -
  37.886 -        /* Other (Linux-defined) */
  37.887 -        "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", NULL, NULL, NULL, NULL,
  37.888 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  37.889 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  37.890 -        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  37.891 -    };
  37.892 -    struct cpuinfo_x86 *c = v;
  37.893 -    int i, n = c - cpu_data;
  37.894 -    int fpu_exception;
  37.895 -
  37.896 -#ifdef CONFIG_SMP
  37.897 -    if (!(cpu_online_map & (1<<n)))
  37.898 -        return 0;
  37.899 -#endif
  37.900 -    seq_printf(m, "processor\t: %d\n"
  37.901 -               "vendor_id\t: %s\n"
  37.902 -               "cpu family\t: %d\n"
  37.903 -               "model\t\t: %d\n"
  37.904 -               "model name\t: %s\n",
  37.905 -               n,
  37.906 -               c->x86_vendor_id[0] ? c->x86_vendor_id : "unknown",
  37.907 -               c->x86,
  37.908 -               c->x86_model,
  37.909 -               c->x86_model_id[0] ? c->x86_model_id : "unknown");
  37.910 -
  37.911 -    if (c->x86_mask || c->cpuid_level >= 0)
  37.912 -        seq_printf(m, "stepping\t: %d\n", c->x86_mask);
  37.913 -    else
  37.914 -        seq_printf(m, "stepping\t: unknown\n");
  37.915 -
  37.916 -    if ( test_bit(X86_FEATURE_TSC, &c->x86_capability) ) {
  37.917 -        seq_printf(m, "cpu MHz\t\t: %lu.%03lu\n",
  37.918 -                   cpu_khz / 1000, (cpu_khz % 1000));
  37.919 -    }
  37.920 -
  37.921 -    /* Cache size */
  37.922 -    if (c->x86_cache_size >= 0)
  37.923 -        seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
  37.924 -	
  37.925 -	/* We use exception 16 if we have hardware math and we've either seen it or the CPU claims it is internal */
  37.926 -    fpu_exception = c->hard_math && (ignore_irq13 || cpu_has_fpu);
  37.927 -    seq_printf(m, "fdiv_bug\t: %s\n"
  37.928 -               "hlt_bug\t\t: %s\n"
  37.929 -               "f00f_bug\t: %s\n"
  37.930 -               "coma_bug\t: %s\n"
  37.931 -               "fpu\t\t: %s\n"
  37.932 -               "fpu_exception\t: %s\n"
  37.933 -               "cpuid level\t: %d\n"
  37.934 -               "wp\t\t: %s\n"
  37.935 -               "flags\t\t:",
  37.936 -               c->fdiv_bug ? "yes" : "no",
  37.937 -               c->hlt_works_ok ? "no" : "yes",
  37.938 -               c->f00f_bug ? "yes" : "no",
  37.939 -               c->coma_bug ? "yes" : "no",
  37.940 -               c->hard_math ? "yes" : "no",
  37.941 -               fpu_exception ? "yes" : "no",
  37.942 -               c->cpuid_level,
  37.943 -               c->wp_works_ok ? "yes" : "no");
  37.944 -
  37.945 -    for ( i = 0 ; i < 32*NCAPINTS ; i++ )
  37.946 -        if ( test_bit(i, &c->x86_capability) &&
  37.947 -             x86_cap_flags[i] != NULL )
  37.948 -            seq_printf(m, " %s", x86_cap_flags[i]);
  37.949 -
  37.950 -    seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n",
  37.951 -               c->loops_per_jiffy/(500000/HZ),
  37.952 -               (c->loops_per_jiffy/(5000/HZ)) % 100);
  37.953 -    return 0;
  37.954 -}
  37.955 -
  37.956 -static void *c_start(struct seq_file *m, loff_t *pos)
  37.957 -{
  37.958 -    return *pos < NR_CPUS ? cpu_data + *pos : NULL;
  37.959 -}
  37.960 -static void *c_next(struct seq_file *m, void *v, loff_t *pos)
  37.961 -{
  37.962 -    ++*pos;
  37.963 -    return c_start(m, pos);
  37.964 -}
  37.965 -static void c_stop(struct seq_file *m, void *v)
  37.966 -{
  37.967 -}
  37.968 -struct seq_operations cpuinfo_op = {
  37.969 -    start:	c_start,
  37.970 -    next:	c_next,
  37.971 -    stop:	c_stop,
  37.972 -    show:	show_cpuinfo,
  37.973 -};
  37.974 -
  37.975 -unsigned long cpu_initialized __initdata = 0;
  37.976 -
  37.977 -/*
  37.978 - * cpu_init() initializes state that is per-CPU. Some data is already
  37.979 - * initialized (naturally) in the bootstrap process, such as the GDT
  37.980 - * and IDT. We reload them nevertheless, this function acts as a
  37.981 - * 'CPU state barrier', nothing should get across.
  37.982 - */
  37.983 -void __init cpu_init (void)
  37.984 -{
  37.985 -    int nr = smp_processor_id();
  37.986 -
  37.987 -    if (test_and_set_bit(nr, &cpu_initialized)) {
  37.988 -        printk(KERN_WARNING "CPU#%d already initialized!\n", nr);
  37.989 -        for (;;) __sti();
  37.990 -    }
  37.991 -    printk(KERN_INFO "Initializing CPU#%d\n", nr);
  37.992 -
  37.993 -    /*
  37.994 -     * set up and load the per-CPU TSS and LDT
  37.995 -     */
  37.996 -    atomic_inc(&init_mm.mm_count);
  37.997 -    current->active_mm = &init_mm;
  37.998 -    if(current->mm)
  37.999 -        BUG();
 37.1000 -    enter_lazy_tlb(&init_mm, current, nr);
 37.1001 -
 37.1002 -    HYPERVISOR_stack_switch(__KERNEL_DS, current->thread.esp0);
 37.1003 -
 37.1004 -    load_LDT(&init_mm);
 37.1005 -    flush_page_update_queue();
 37.1006 -
 37.1007 -    /* Force FPU initialization. */
 37.1008 -    current->flags &= ~PF_USEDFPU;
 37.1009 -    current->used_math = 0;
 37.1010 -    stts();
 37.1011 -}
 37.1012 -
 37.1013 -
 37.1014 -/******************************************************************************
 37.1015 - * Time-to-die callback handling.
 37.1016 - */
 37.1017 -
 37.1018 -static void time_to_die(int irq, void *unused, struct pt_regs *regs)
 37.1019 -{
 37.1020 -    extern void ctrl_alt_del(void);
 37.1021 -    ctrl_alt_del();
 37.1022 -}
 37.1023 -
 37.1024 -static int __init setup_death_event(void)
 37.1025 -{
 37.1026 -    (void)request_irq(_EVENT_DIE, time_to_die, 0, "die", NULL);
 37.1027 -    return 0;
 37.1028 -}
 37.1029 -
 37.1030 -__initcall(setup_death_event);
    38.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/signal.c	Tue Jun 24 12:05:12 2003 +0000
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,717 +0,0 @@
    38.4 -/*
    38.5 - *  linux/arch/i386/kernel/signal.c
    38.6 - *
    38.7 - *  Copyright (C) 1991, 1992  Linus Torvalds
    38.8 - *
    38.9 - *  1997-11-28  Modified for POSIX.1b signals by Richard Henderson
   38.10 - *  2000-06-20  Pentium III FXSR, SSE support by Gareth Hughes
   38.11 - */
   38.12 -
   38.13 -#include <linux/sched.h>
   38.14 -#include <linux/mm.h>
   38.15 -#include <linux/smp.h>
   38.16 -#include <linux/smp_lock.h>
   38.17 -#include <linux/kernel.h>
   38.18 -#include <linux/signal.h>
   38.19 -#include <linux/errno.h>
   38.20 -#include <linux/wait.h>
   38.21 -#include <linux/ptrace.h>
   38.22 -#include <linux/unistd.h>
   38.23 -#include <linux/stddef.h>
   38.24 -#include <linux/tty.h>
   38.25 -#include <linux/personality.h>
   38.26 -#include <asm/ucontext.h>
   38.27 -#include <asm/uaccess.h>
   38.28 -#include <asm/i387.h>
   38.29 -
   38.30 -#define DEBUG_SIG 0
   38.31 -
   38.32 -#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
   38.33 -
   38.34 -int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
   38.35 -
   38.36 -int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from)
   38.37 -{
   38.38 -	if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t)))
   38.39 -		return -EFAULT;
   38.40 -	if (from->si_code < 0)
   38.41 -		return __copy_to_user(to, from, sizeof(siginfo_t));
   38.42 -	else {
   38.43 -		int err;
   38.44 -
   38.45 -		/* If you change siginfo_t structure, please be sure
   38.46 -		   this code is fixed accordingly.
   38.47 -		   It should never copy any pad contained in the structure
   38.48 -		   to avoid security leaks, but must copy the generic
   38.49 -		   3 ints plus the relevant union member.  */
   38.50 -		err = __put_user(from->si_signo, &to->si_signo);
   38.51 -		err |= __put_user(from->si_errno, &to->si_errno);
   38.52 -		err |= __put_user((short)from->si_code, &to->si_code);
   38.53 -		/* First 32bits of unions are always present.  */
   38.54 -		err |= __put_user(from->si_pid, &to->si_pid);
   38.55 -		switch (from->si_code >> 16) {
   38.56 -		case __SI_FAULT >> 16:
   38.57 -			break;
   38.58 -		case __SI_CHLD >> 16:
   38.59 -			err |= __put_user(from->si_utime, &to->si_utime);
   38.60 -			err |= __put_user(from->si_stime, &to->si_stime);
   38.61 -			err |= __put_user(from->si_status, &to->si_status);
   38.62 -		default:
   38.63 -			err |= __put_user(from->si_uid, &to->si_uid);
   38.64 -			break;
   38.65 -		/* case __SI_RT: This is not generated by the kernel as of now.  */
   38.66 -		}
   38.67 -		return err;
   38.68 -	}
   38.69 -}
   38.70 -
   38.71 -/*
   38.72 - * Atomically swap in the new signal mask, and wait for a signal.
   38.73 - */
   38.74 -asmlinkage int
   38.75 -sys_sigsuspend(int history0, int history1, old_sigset_t mask)
   38.76 -{
   38.77 -	struct pt_regs * regs = (struct pt_regs *) &history0;
   38.78 -	sigset_t saveset;
   38.79 -
   38.80 -	mask &= _BLOCKABLE;
   38.81 -	spin_lock_irq(&current->sigmask_lock);
   38.82 -	saveset = current->blocked;
   38.83 -	siginitset(&current->blocked, mask);
   38.84 -	recalc_sigpending(current);
   38.85 -	spin_unlock_irq(&current->sigmask_lock);
   38.86 -
   38.87 -	regs->eax = -EINTR;
   38.88 -	while (1) {
   38.89 -		current->state = TASK_INTERRUPTIBLE;
   38.90 -		schedule();
   38.91 -		if (do_signal(regs, &saveset))
   38.92 -			return -EINTR;
   38.93 -	}
   38.94 -}
   38.95 -
   38.96 -asmlinkage int
   38.97 -sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize)
   38.98 -{
   38.99 -	struct pt_regs * regs = (struct pt_regs *) &unewset;
  38.100 -	sigset_t saveset, newset;
  38.101 -
  38.102 -	/* XXX: Don't preclude handling different sized sigset_t's.  */
  38.103 -	if (sigsetsize != sizeof(sigset_t))
  38.104 -		return -EINVAL;
  38.105 -
  38.106 -	if (copy_from_user(&newset, unewset, sizeof(newset)))
  38.107 -		return -EFAULT;
  38.108 -	sigdelsetmask(&newset, ~_BLOCKABLE);
  38.109 -
  38.110 -	spin_lock_irq(&current->sigmask_lock);
  38.111 -	saveset = current->blocked;
  38.112 -	current->blocked = newset;
  38.113 -	recalc_sigpending(current);
  38.114 -	spin_unlock_irq(&current->sigmask_lock);
  38.115 -
  38.116 -	regs->eax = -EINTR;
  38.117 -	while (1) {
  38.118 -		current->state = TASK_INTERRUPTIBLE;
  38.119 -		schedule();
  38.120 -		if (do_signal(regs, &saveset))
  38.121 -			return -EINTR;
  38.122 -	}
  38.123 -}
  38.124 -
  38.125 -asmlinkage int 
  38.126 -sys_sigaction(int sig, const struct old_sigaction *act,
  38.127 -	      struct old_sigaction *oact)
  38.128 -{
  38.129 -	struct k_sigaction new_ka, old_ka;
  38.130 -	int ret;
  38.131 -
  38.132 -	if (act) {
  38.133 -		old_sigset_t mask;
  38.134 -		if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
  38.135 -		    __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
  38.136 -		    __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
  38.137 -			return -EFAULT;
  38.138 -		__get_user(new_ka.sa.sa_flags, &act->sa_flags);
  38.139 -		__get_user(mask, &act->sa_mask);
  38.140 -		siginitset(&new_ka.sa.sa_mask, mask);
  38.141 -	}
  38.142 -
  38.143 -	ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
  38.144 -
  38.145 -	if (!ret && oact) {
  38.146 -		if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
  38.147 -		    __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
  38.148 -		    __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
  38.149 -			return -EFAULT;
  38.150 -		__put_user(old_ka.sa.sa_flags, &oact->sa_flags);
  38.151 -		__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
  38.152 -	}
  38.153 -
  38.154 -	return ret;
  38.155 -}
  38.156 -
  38.157 -asmlinkage int
  38.158 -sys_sigaltstack(const stack_t *uss, stack_t *uoss)
  38.159 -{
  38.160 -	struct pt_regs *regs = (struct pt_regs *) &uss;
  38.161 -	return do_sigaltstack(uss, uoss, regs->esp);
  38.162 -}
  38.163 -
  38.164 -
  38.165 -/*
  38.166 - * Do a signal return; undo the signal stack.
  38.167 - */
  38.168 -
  38.169 -struct sigframe
  38.170 -{
  38.171 -	char *pretcode;
  38.172 -	int sig;
  38.173 -	struct sigcontext sc;