Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- um-linux-2.4.27-paolo/CREDITS | 3 um-linux-2.4.27-paolo/Documentation/Configure.help | 283 +- um-linux-2.4.27-paolo/MAINTAINERS | 8 um-linux-2.4.27-paolo/Makefile | 10 um-linux-2.4.27-paolo/arch/um/Makefile | 174 + um-linux-2.4.27-paolo/arch/um/Makefile-i386 | 35 um-linux-2.4.27-paolo/arch/um/Makefile-ia64 | 1 um-linux-2.4.27-paolo/arch/um/Makefile-os-Linux | 7 um-linux-2.4.27-paolo/arch/um/Makefile-ppc | 9 um-linux-2.4.27-paolo/arch/um/Makefile-skas | 20 um-linux-2.4.27-paolo/arch/um/Makefile-tt | 7 um-linux-2.4.27-paolo/arch/um/common.ld.in | 53 um-linux-2.4.27-paolo/arch/um/config.in | 105 um-linux-2.4.27-paolo/arch/um/config.release | 302 ++ um-linux-2.4.27-paolo/arch/um/config_block.in | 22 um-linux-2.4.27-paolo/arch/um/config_char.in | 37 um-linux-2.4.27-paolo/arch/um/config_net.in | 47 um-linux-2.4.27-paolo/arch/um/config_scsi.in | 30 um-linux-2.4.27-paolo/arch/um/defconfig | 423 +++ um-linux-2.4.27-paolo/arch/um/drivers/Makefile | 97 um-linux-2.4.27-paolo/arch/um/drivers/chan_kern.c | 519 +++ um-linux-2.4.27-paolo/arch/um/drivers/chan_user.c | 217 + um-linux-2.4.27-paolo/arch/um/drivers/cow.h | 41 um-linux-2.4.27-paolo/arch/um/drivers/cow_kern.c | 630 ++++ um-linux-2.4.27-paolo/arch/um/drivers/cow_sys.h | 48 um-linux-2.4.27-paolo/arch/um/drivers/cow_user.c | 375 ++ um-linux-2.4.27-paolo/arch/um/drivers/daemon.h | 35 um-linux-2.4.27-paolo/arch/um/drivers/daemon_kern.c | 113 um-linux-2.4.27-paolo/arch/um/drivers/daemon_user.c | 197 + um-linux-2.4.27-paolo/arch/um/drivers/fd.c | 97 um-linux-2.4.27-paolo/arch/um/drivers/harddog_kern.c | 194 + um-linux-2.4.27-paolo/arch/um/drivers/harddog_user.c | 143 + um-linux-2.4.27-paolo/arch/um/drivers/hostaudio_kern.c | 352 ++ um-linux-2.4.27-paolo/arch/um/drivers/line.c | 610 ++++ um-linux-2.4.27-paolo/arch/um/drivers/mcast.h | 30 um-linux-2.4.27-paolo/arch/um/drivers/mcast_kern.c | 145 + um-linux-2.4.27-paolo/arch/um/drivers/mcast_user.c | 177 + um-linux-2.4.27-paolo/arch/um/drivers/mconsole_kern.c | 560 ++++ um-linux-2.4.27-paolo/arch/um/drivers/mconsole_user.c | 215 + um-linux-2.4.27-paolo/arch/um/drivers/mmapper_kern.c | 151 + um-linux-2.4.27-paolo/arch/um/drivers/net_kern.c | 872 ++++++ um-linux-2.4.27-paolo/arch/um/drivers/net_user.c | 252 + um-linux-2.4.27-paolo/arch/um/drivers/null.c | 55 um-linux-2.4.27-paolo/arch/um/drivers/pcap_kern.c | 127 um-linux-2.4.27-paolo/arch/um/drivers/pcap_user.c | 143 + um-linux-2.4.27-paolo/arch/um/drivers/pcap_user.h | 31 um-linux-2.4.27-paolo/arch/um/drivers/port.h | 30 um-linux-2.4.27-paolo/arch/um/drivers/port_kern.c | 303 ++ um-linux-2.4.27-paolo/arch/um/drivers/port_user.c | 213 + um-linux-2.4.27-paolo/arch/um/drivers/pty.c | 148 + um-linux-2.4.27-paolo/arch/um/drivers/slip.h | 39 um-linux-2.4.27-paolo/arch/um/drivers/slip_kern.c | 109 um-linux-2.4.27-paolo/arch/um/drivers/slip_proto.h | 93 um-linux-2.4.27-paolo/arch/um/drivers/slip_user.c | 274 + um-linux-2.4.27-paolo/arch/um/drivers/slirp.h | 51 um-linux-2.4.27-paolo/arch/um/drivers/slirp_kern.c | 132 um-linux-2.4.27-paolo/arch/um/drivers/slirp_user.c | 201 + um-linux-2.4.27-paolo/arch/um/drivers/ssl.c | 300 ++ um-linux-2.4.27-paolo/arch/um/drivers/ssl.h | 23 um-linux-2.4.27-paolo/arch/um/drivers/stdio_console.c | 258 + um-linux-2.4.27-paolo/arch/um/drivers/stdio_console.h | 21 um-linux-2.4.27-paolo/arch/um/drivers/tty.c | 86 um-linux-2.4.27-paolo/arch/um/drivers/ubd_kern.c | 1396 ++++++++++ um-linux-2.4.27-paolo/arch/um/drivers/ubd_user.c | 377 ++ um-linux-2.4.27-paolo/arch/um/drivers/xterm.c | 201 + um-linux-2.4.27-paolo/arch/um/drivers/xterm.h | 22 um-linux-2.4.27-paolo/arch/um/drivers/xterm_kern.c | 82 um-linux-2.4.27-paolo/arch/um/dyn_link.ld.in | 171 + um-linux-2.4.27-paolo/arch/um/fs/Makefile | 23 um-linux-2.4.27-paolo/arch/um/fs/hostfs/Makefile | 24 um-linux-2.4.27-paolo/arch/um/fs/hostfs/hostfs.h | 69 um-linux-2.4.27-paolo/arch/um/fs/hostfs/hostfs_kern.c | 965 ++++++ um-linux-2.4.27-paolo/arch/um/fs/hostfs/hostfs_user.c | 359 ++ um-linux-2.4.27-paolo/arch/um/fs/hppfs/Makefile | 10 um-linux-2.4.27-paolo/arch/um/fs/hppfs/hppfs_kern.c | 737 +++++ um-linux-2.4.27-paolo/arch/um/include/2_5compat.h | 33 um-linux-2.4.27-paolo/arch/um/include/Makefile | 7 um-linux-2.4.27-paolo/arch/um/include/chan_kern.h | 56 um-linux-2.4.27-paolo/arch/um/include/chan_user.h | 66 um-linux-2.4.27-paolo/arch/um/include/choose-mode.h | 35 um-linux-2.4.27-paolo/arch/um/include/frame.h | 53 um-linux-2.4.27-paolo/arch/um/include/frame_kern.h | 34 um-linux-2.4.27-paolo/arch/um/include/frame_user.h | 23 um-linux-2.4.27-paolo/arch/um/include/helper.h | 27 um-linux-2.4.27-paolo/arch/um/include/init.h | 114 um-linux-2.4.27-paolo/arch/um/include/initrd.h | 22 um-linux-2.4.27-paolo/arch/um/include/irq_kern.h | 27 um-linux-2.4.27-paolo/arch/um/include/irq_user.h | 35 um-linux-2.4.27-paolo/arch/um/include/kern.h | 48 um-linux-2.4.27-paolo/arch/um/include/kern_util.h | 123 um-linux-2.4.27-paolo/arch/um/include/line.h | 103 um-linux-2.4.27-paolo/arch/um/include/mconsole.h | 103 um-linux-2.4.27-paolo/arch/um/include/mconsole_kern.h | 62 um-linux-2.4.27-paolo/arch/um/include/mem.h | 29 um-linux-2.4.27-paolo/arch/um/include/mem_kern.h | 30 um-linux-2.4.27-paolo/arch/um/include/mem_user.h | 81 um-linux-2.4.27-paolo/arch/um/include/mode.h | 30 um-linux-2.4.27-paolo/arch/um/include/mode_kern.h | 30 um-linux-2.4.27-paolo/arch/um/include/net_kern.h | 81 um-linux-2.4.27-paolo/arch/um/include/net_user.h | 66 um-linux-2.4.27-paolo/arch/um/include/os.h | 180 + um-linux-2.4.27-paolo/arch/um/include/process.h | 25 um-linux-2.4.27-paolo/arch/um/include/ptrace_user.h | 18 um-linux-2.4.27-paolo/arch/um/include/sigcontext.h | 25 um-linux-2.4.27-paolo/arch/um/include/sigio.h | 28 um-linux-2.4.27-paolo/arch/um/include/signal_kern.h | 22 um-linux-2.4.27-paolo/arch/um/include/signal_user.h | 26 um-linux-2.4.27-paolo/arch/um/include/skas_ptrace.h | 36 um-linux-2.4.27-paolo/arch/um/include/syscall_user.h | 23 um-linux-2.4.27-paolo/arch/um/include/sysdep-i386/checksum.h | 218 + um-linux-2.4.27-paolo/arch/um/include/sysdep-i386/frame.h | 29 um-linux-2.4.27-paolo/arch/um/include/sysdep-i386/frame_kern.h | 69 um-linux-2.4.27-paolo/arch/um/include/sysdep-i386/frame_user.h | 91 um-linux-2.4.27-paolo/arch/um/include/sysdep-i386/ptrace.h | 193 + um-linux-2.4.27-paolo/arch/um/include/sysdep-i386/ptrace_user.h | 62 um-linux-2.4.27-paolo/arch/um/include/sysdep-i386/sigcontext.h | 49 um-linux-2.4.27-paolo/arch/um/include/sysdep-i386/syscalls.h | 61 um-linux-2.4.27-paolo/arch/um/include/sysdep-ia64/ptrace.h | 26 um-linux-2.4.27-paolo/arch/um/include/sysdep-ia64/sigcontext.h | 20 um-linux-2.4.27-paolo/arch/um/include/sysdep-ia64/syscalls.h | 20 um-linux-2.4.27-paolo/arch/um/include/sysdep-ppc/ptrace.h | 104 um-linux-2.4.27-paolo/arch/um/include/sysdep-ppc/sigcontext.h | 62 um-linux-2.4.27-paolo/arch/um/include/sysdep-ppc/syscalls.h | 50 um-linux-2.4.27-paolo/arch/um/include/sysrq.h | 6 um-linux-2.4.27-paolo/arch/um/include/tempfile.h | 21 um-linux-2.4.27-paolo/arch/um/include/time_user.h | 17 um-linux-2.4.27-paolo/arch/um/include/tlb.h | 23 um-linux-2.4.27-paolo/arch/um/include/ubd_user.h | 79 um-linux-2.4.27-paolo/arch/um/include/um_mmu.h | 40 um-linux-2.4.27-paolo/arch/um/include/um_uaccess.h | 124 um-linux-2.4.27-paolo/arch/um/include/umid.h | 22 um-linux-2.4.27-paolo/arch/um/include/uml_uaccess.h | 28 um-linux-2.4.27-paolo/arch/um/include/umn.h | 27 um-linux-2.4.27-paolo/arch/um/include/user.h | 29 um-linux-2.4.27-paolo/arch/um/include/user_util.h | 103 um-linux-2.4.27-paolo/arch/um/kernel/Makefile | 73 um-linux-2.4.27-paolo/arch/um/kernel/checksum.c | 42 um-linux-2.4.27-paolo/arch/um/kernel/config.c.in | 32 um-linux-2.4.27-paolo/arch/um/kernel/exec_kern.c | 86 um-linux-2.4.27-paolo/arch/um/kernel/exitcode.c | 73 um-linux-2.4.27-paolo/arch/um/kernel/frame.c | 341 ++ um-linux-2.4.27-paolo/arch/um/kernel/frame_kern.c | 174 + um-linux-2.4.27-paolo/arch/um/kernel/gmon_syms.c | 20 um-linux-2.4.27-paolo/arch/um/kernel/gprof_syms.c | 20 um-linux-2.4.27-paolo/arch/um/kernel/helper.c | 170 + um-linux-2.4.27-paolo/arch/um/kernel/init_task.c | 61 um-linux-2.4.27-paolo/arch/um/kernel/initrd_kern.c | 59 um-linux-2.4.27-paolo/arch/um/kernel/initrd_user.c | 44 um-linux-2.4.27-paolo/arch/um/kernel/irq.c | 840 ++++++ um-linux-2.4.27-paolo/arch/um/kernel/irq_user.c | 424 +++ um-linux-2.4.27-paolo/arch/um/kernel/ksyms.c | 120 um-linux-2.4.27-paolo/arch/um/kernel/mem.c | 336 ++ um-linux-2.4.27-paolo/arch/um/kernel/mem_user.c | 216 + um-linux-2.4.27-paolo/arch/um/kernel/mprot.h | 6 um-linux-2.4.27-paolo/arch/um/kernel/physmem.c | 446 +++ um-linux-2.4.27-paolo/arch/um/kernel/process.c | 289 ++ um-linux-2.4.27-paolo/arch/um/kernel/process_kern.c | 396 ++ um-linux-2.4.27-paolo/arch/um/kernel/ptrace.c | 325 ++ um-linux-2.4.27-paolo/arch/um/kernel/reboot.c | 73 um-linux-2.4.27-paolo/arch/um/kernel/resource.c | 23 um-linux-2.4.27-paolo/arch/um/kernel/sigio_kern.c | 57 um-linux-2.4.27-paolo/arch/um/kernel/sigio_user.c | 438 +++ um-linux-2.4.27-paolo/arch/um/kernel/signal_kern.c | 369 ++ um-linux-2.4.27-paolo/arch/um/kernel/signal_user.c | 142 + um-linux-2.4.27-paolo/arch/um/kernel/skas/Makefile | 31 um-linux-2.4.27-paolo/arch/um/kernel/skas/exec_kern.c | 41 um-linux-2.4.27-paolo/arch/um/kernel/skas/exec_user.c | 61 um-linux-2.4.27-paolo/arch/um/kernel/skas/include/mmu.h | 27 um-linux-2.4.27-paolo/arch/um/kernel/skas/include/mode.h | 37 um-linux-2.4.27-paolo/arch/um/kernel/skas/include/mode_kern.h | 51 um-linux-2.4.27-paolo/arch/um/kernel/skas/include/proc_mm.h | 55 um-linux-2.4.27-paolo/arch/um/kernel/skas/include/ptrace-skas.h | 57 um-linux-2.4.27-paolo/arch/um/kernel/skas/include/skas.h | 49 um-linux-2.4.27-paolo/arch/um/kernel/skas/include/uaccess.h | 40 um-linux-2.4.27-paolo/arch/um/kernel/skas/mem.c | 30 um-linux-2.4.27-paolo/arch/um/kernel/skas/mem_user.c | 105 um-linux-2.4.27-paolo/arch/um/kernel/skas/mmu.c | 46 um-linux-2.4.27-paolo/arch/um/kernel/skas/process.c | 417 ++ um-linux-2.4.27-paolo/arch/um/kernel/skas/process_kern.c | 196 + um-linux-2.4.27-paolo/arch/um/kernel/skas/sys-i386/Makefile | 17 um-linux-2.4.27-paolo/arch/um/kernel/skas/sys-i386/sigcontext.c | 114 um-linux-2.4.27-paolo/arch/um/kernel/skas/syscall_kern.c | 42 um-linux-2.4.27-paolo/arch/um/kernel/skas/syscall_user.c | 46 um-linux-2.4.27-paolo/arch/um/kernel/skas/time.c | 30 um-linux-2.4.27-paolo/arch/um/kernel/skas/tlb.c | 153 + um-linux-2.4.27-paolo/arch/um/kernel/skas/trap_user.c | 66 um-linux-2.4.27-paolo/arch/um/kernel/skas/uaccess.c | 217 + um-linux-2.4.27-paolo/arch/um/kernel/skas/util/Makefile | 10 um-linux-2.4.27-paolo/arch/um/kernel/skas/util/mk_ptregs.c | 51 um-linux-2.4.27-paolo/arch/um/kernel/smp.c | 328 ++ um-linux-2.4.27-paolo/arch/um/kernel/sys_call_table.c | 496 +++ um-linux-2.4.27-paolo/arch/um/kernel/syscall_kern.c | 343 ++ um-linux-2.4.27-paolo/arch/um/kernel/syscall_user.c | 48 um-linux-2.4.27-paolo/arch/um/kernel/sysrq.c | 98 um-linux-2.4.27-paolo/arch/um/kernel/tempfile.c | 82 um-linux-2.4.27-paolo/arch/um/kernel/time.c | 172 + um-linux-2.4.27-paolo/arch/um/kernel/time_kern.c | 205 + um-linux-2.4.27-paolo/arch/um/kernel/tlb.c | 80 um-linux-2.4.27-paolo/arch/um/kernel/trap_kern.c | 220 + um-linux-2.4.27-paolo/arch/um/kernel/trap_user.c | 138 um-linux-2.4.27-paolo/arch/um/kernel/tt/Makefile | 39 um-linux-2.4.27-paolo/arch/um/kernel/tt/exec_kern.c | 84 um-linux-2.4.27-paolo/arch/um/kernel/tt/exec_user.c | 49 um-linux-2.4.27-paolo/arch/um/kernel/tt/gdb.c | 278 + um-linux-2.4.27-paolo/arch/um/kernel/tt/gdb_kern.c | 40 um-linux-2.4.27-paolo/arch/um/kernel/tt/include/debug.h | 29 um-linux-2.4.27-paolo/arch/um/kernel/tt/include/mmu.h | 23 um-linux-2.4.27-paolo/arch/um/kernel/tt/include/mode.h | 38 um-linux-2.4.27-paolo/arch/um/kernel/tt/include/mode_kern.h | 52 um-linux-2.4.27-paolo/arch/um/kernel/tt/include/ptrace-tt.h | 26 um-linux-2.4.27-paolo/arch/um/kernel/tt/include/tt.h | 46 um-linux-2.4.27-paolo/arch/um/kernel/tt/include/uaccess.h | 71 um-linux-2.4.27-paolo/arch/um/kernel/tt/ksyms.c | 28 um-linux-2.4.27-paolo/arch/um/kernel/tt/mem.c | 51 um-linux-2.4.27-paolo/arch/um/kernel/tt/mem_user.c | 49 um-linux-2.4.27-paolo/arch/um/kernel/tt/process_kern.c | 535 +++ um-linux-2.4.27-paolo/arch/um/kernel/tt/ptproxy/Makefile | 12 um-linux-2.4.27-paolo/arch/um/kernel/tt/ptproxy/proxy.c | 371 ++ um-linux-2.4.27-paolo/arch/um/kernel/tt/ptproxy/ptproxy.h | 61 um-linux-2.4.27-paolo/arch/um/kernel/tt/ptproxy/ptrace.c | 239 + um-linux-2.4.27-paolo/arch/um/kernel/tt/ptproxy/sysdep.c | 72 um-linux-2.4.27-paolo/arch/um/kernel/tt/ptproxy/sysdep.h | 25 um-linux-2.4.27-paolo/arch/um/kernel/tt/ptproxy/wait.c | 88 um-linux-2.4.27-paolo/arch/um/kernel/tt/ptproxy/wait.h | 15 um-linux-2.4.27-paolo/arch/um/kernel/tt/sys-i386/Makefile | 17 um-linux-2.4.27-paolo/arch/um/kernel/tt/sys-i386/sigcontext.c | 60 um-linux-2.4.27-paolo/arch/um/kernel/tt/syscall_kern.c | 142 + um-linux-2.4.27-paolo/arch/um/kernel/tt/syscall_user.c | 89 um-linux-2.4.27-paolo/arch/um/kernel/tt/time.c | 28 um-linux-2.4.27-paolo/arch/um/kernel/tt/tlb.c | 220 + um-linux-2.4.27-paolo/arch/um/kernel/tt/tracer.c | 454 +++ um-linux-2.4.27-paolo/arch/um/kernel/tt/trap_user.c | 59 um-linux-2.4.27-paolo/arch/um/kernel/tt/uaccess.c | 73 um-linux-2.4.27-paolo/arch/um/kernel/tt/uaccess_user.c | 98 um-linux-2.4.27-paolo/arch/um/kernel/tt/unmap.c | 31 um-linux-2.4.27-paolo/arch/um/kernel/tty_log.c | 228 + um-linux-2.4.27-paolo/arch/um/kernel/uaccess_user.c | 64 um-linux-2.4.27-paolo/arch/um/kernel/um_arch.c | 431 +++ um-linux-2.4.27-paolo/arch/um/kernel/umid.c | 327 ++ um-linux-2.4.27-paolo/arch/um/kernel/user_syms.c | 118 um-linux-2.4.27-paolo/arch/um/kernel/user_util.c | 164 + um-linux-2.4.27-paolo/arch/um/link.ld.in | 94 um-linux-2.4.27-paolo/arch/um/main.c | 199 + um-linux-2.4.27-paolo/arch/um/os-Linux/Makefile | 17 um-linux-2.4.27-paolo/arch/um/os-Linux/drivers/Makefile | 31 um-linux-2.4.27-paolo/arch/um/os-Linux/drivers/etap.h | 27 um-linux-2.4.27-paolo/arch/um/os-Linux/drivers/ethertap_kern.c | 122 um-linux-2.4.27-paolo/arch/um/os-Linux/drivers/ethertap_user.c | 238 + um-linux-2.4.27-paolo/arch/um/os-Linux/drivers/tuntap.h | 32 um-linux-2.4.27-paolo/arch/um/os-Linux/drivers/tuntap_kern.c | 105 um-linux-2.4.27-paolo/arch/um/os-Linux/drivers/tuntap_user.c | 224 + um-linux-2.4.27-paolo/arch/um/os-Linux/file.c | 668 ++++ um-linux-2.4.27-paolo/arch/um/os-Linux/include/file.h | 22 um-linux-2.4.27-paolo/arch/um/os-Linux/process.c | 148 + um-linux-2.4.27-paolo/arch/um/os-Linux/tty.c | 61 um-linux-2.4.27-paolo/arch/um/sys-i386/Makefile | 46 um-linux-2.4.27-paolo/arch/um/sys-i386/bugs.c | 222 + um-linux-2.4.27-paolo/arch/um/sys-i386/checksum.S | 460 +++ um-linux-2.4.27-paolo/arch/um/sys-i386/fault.c | 34 um-linux-2.4.27-paolo/arch/um/sys-i386/ksyms.c | 17 um-linux-2.4.27-paolo/arch/um/sys-i386/ldt.c | 94 um-linux-2.4.27-paolo/arch/um/sys-i386/ptrace.c | 365 ++ um-linux-2.4.27-paolo/arch/um/sys-i386/ptrace_user.c | 117 um-linux-2.4.27-paolo/arch/um/sys-i386/sigcontext.c | 80 um-linux-2.4.27-paolo/arch/um/sys-i386/syscalls.c | 68 um-linux-2.4.27-paolo/arch/um/sys-i386/sysrq.c | 30 um-linux-2.4.27-paolo/arch/um/sys-i386/time.c | 24 um-linux-2.4.27-paolo/arch/um/sys-i386/util/Makefile | 28 um-linux-2.4.27-paolo/arch/um/sys-i386/util/mk_sc.c | 52 um-linux-2.4.27-paolo/arch/um/sys-i386/util/mk_thread_kern.c | 22 um-linux-2.4.27-paolo/arch/um/sys-i386/util/mk_thread_user.c | 30 um-linux-2.4.27-paolo/arch/um/sys-ia64/Makefile | 26 um-linux-2.4.27-paolo/arch/um/sys-ppc/Makefile | 80 um-linux-2.4.27-paolo/arch/um/sys-ppc/misc.S | 116 um-linux-2.4.27-paolo/arch/um/sys-ppc/miscthings.c | 53 um-linux-2.4.27-paolo/arch/um/sys-ppc/ptrace.c | 28 um-linux-2.4.27-paolo/arch/um/sys-ppc/ptrace_user.c | 40 um-linux-2.4.27-paolo/arch/um/sys-ppc/sigcontext.c | 15 um-linux-2.4.27-paolo/arch/um/sys-ppc/sysrq.c | 43 um-linux-2.4.27-paolo/arch/um/util/Makefile | 26 um-linux-2.4.27-paolo/arch/um/util/mk_constants_kern.c | 25 um-linux-2.4.27-paolo/arch/um/util/mk_constants_user.c | 28 um-linux-2.4.27-paolo/arch/um/util/mk_task_kern.c | 17 um-linux-2.4.27-paolo/arch/um/util/mk_task_user.c | 30 um-linux-2.4.27-paolo/drivers/char/Makefile | 6 um-linux-2.4.27-paolo/drivers/char/mem.c | 13 um-linux-2.4.27-paolo/drivers/char/tty_io.c | 42 um-linux-2.4.27-paolo/drivers/net/setup.c | 4 um-linux-2.4.27-paolo/fs/bad_inode.c | 1 um-linux-2.4.27-paolo/include/asm-i386/hardirq.h | 1 um-linux-2.4.27-paolo/include/asm-um/a.out.h | 20 um-linux-2.4.27-paolo/include/asm-um/arch-signal-i386.h | 24 um-linux-2.4.27-paolo/include/asm-um/archparam-i386.h | 80 um-linux-2.4.27-paolo/include/asm-um/archparam-ppc.h | 41 um-linux-2.4.27-paolo/include/asm-um/atomic.h | 6 um-linux-2.4.27-paolo/include/asm-um/bitops.h | 6 um-linux-2.4.27-paolo/include/asm-um/boot.h | 6 um-linux-2.4.27-paolo/include/asm-um/bugs.h | 6 um-linux-2.4.27-paolo/include/asm-um/byteorder.h | 6 um-linux-2.4.27-paolo/include/asm-um/cache.h | 6 um-linux-2.4.27-paolo/include/asm-um/checksum.h | 6 um-linux-2.4.27-paolo/include/asm-um/cobalt.h | 6 um-linux-2.4.27-paolo/include/asm-um/current.h | 34 um-linux-2.4.27-paolo/include/asm-um/delay.h | 7 um-linux-2.4.27-paolo/include/asm-um/desc.h | 6 um-linux-2.4.27-paolo/include/asm-um/div64.h | 6 um-linux-2.4.27-paolo/include/asm-um/dma.h | 10 um-linux-2.4.27-paolo/include/asm-um/elf.h | 18 um-linux-2.4.27-paolo/include/asm-um/errno.h | 6 um-linux-2.4.27-paolo/include/asm-um/fcntl.h | 6 um-linux-2.4.27-paolo/include/asm-um/fixmap.h | 89 um-linux-2.4.27-paolo/include/asm-um/floppy.h | 6 um-linux-2.4.27-paolo/include/asm-um/hardirq.h | 6 um-linux-2.4.27-paolo/include/asm-um/hdreg.h | 6 um-linux-2.4.27-paolo/include/asm-um/highmem.h | 12 um-linux-2.4.27-paolo/include/asm-um/hw_irq.h | 10 um-linux-2.4.27-paolo/include/asm-um/ide.h | 6 um-linux-2.4.27-paolo/include/asm-um/init.h | 11 um-linux-2.4.27-paolo/include/asm-um/io.h | 25 um-linux-2.4.27-paolo/include/asm-um/ioctl.h | 6 um-linux-2.4.27-paolo/include/asm-um/ioctls.h | 6 um-linux-2.4.27-paolo/include/asm-um/ipc.h | 6 um-linux-2.4.27-paolo/include/asm-um/ipcbuf.h | 6 um-linux-2.4.27-paolo/include/asm-um/irq.h | 22 um-linux-2.4.27-paolo/include/asm-um/keyboard.h | 6 um-linux-2.4.27-paolo/include/asm-um/kmap_types.h | 11 um-linux-2.4.27-paolo/include/asm-um/linux_logo.h | 6 um-linux-2.4.27-paolo/include/asm-um/locks.h | 6 um-linux-2.4.27-paolo/include/asm-um/mca_dma.h | 6 um-linux-2.4.27-paolo/include/asm-um/mman.h | 6 um-linux-2.4.27-paolo/include/asm-um/mmu.h | 22 um-linux-2.4.27-paolo/include/asm-um/mmu_context.h | 72 um-linux-2.4.27-paolo/include/asm-um/module.h | 6 um-linux-2.4.27-paolo/include/asm-um/msgbuf.h | 6 um-linux-2.4.27-paolo/include/asm-um/mtrr.h | 6 um-linux-2.4.27-paolo/include/asm-um/namei.h | 6 um-linux-2.4.27-paolo/include/asm-um/page.h | 68 um-linux-2.4.27-paolo/include/asm-um/page_offset.h | 1 um-linux-2.4.27-paolo/include/asm-um/param.h | 22 um-linux-2.4.27-paolo/include/asm-um/pci.h | 6 um-linux-2.4.27-paolo/include/asm-um/pgalloc.h | 164 + um-linux-2.4.27-paolo/include/asm-um/pgtable.h | 413 ++ um-linux-2.4.27-paolo/include/asm-um/poll.h | 6 um-linux-2.4.27-paolo/include/asm-um/posix_types.h | 6 um-linux-2.4.27-paolo/include/asm-um/processor-generic.h | 177 + um-linux-2.4.27-paolo/include/asm-um/processor-i386.h | 35 um-linux-2.4.27-paolo/include/asm-um/processor-ppc.h | 15 um-linux-2.4.27-paolo/include/asm-um/ptrace-generic.h | 74 um-linux-2.4.27-paolo/include/asm-um/ptrace-i386.h | 46 um-linux-2.4.27-paolo/include/asm-um/resource.h | 6 um-linux-2.4.27-paolo/include/asm-um/rwlock.h | 6 um-linux-2.4.27-paolo/include/asm-um/rwsem.h | 10 um-linux-2.4.27-paolo/include/asm-um/scatterlist.h | 6 um-linux-2.4.27-paolo/include/asm-um/segment.h | 4 um-linux-2.4.27-paolo/include/asm-um/semaphore.h | 6 um-linux-2.4.27-paolo/include/asm-um/sembuf.h | 6 um-linux-2.4.27-paolo/include/asm-um/serial.h | 6 um-linux-2.4.27-paolo/include/asm-um/shmbuf.h | 6 um-linux-2.4.27-paolo/include/asm-um/shmparam.h | 6 um-linux-2.4.27-paolo/include/asm-um/sigcontext-generic.h | 6 um-linux-2.4.27-paolo/include/asm-um/sigcontext-i386.h | 6 um-linux-2.4.27-paolo/include/asm-um/sigcontext-ppc.h | 10 um-linux-2.4.27-paolo/include/asm-um/siginfo.h | 6 um-linux-2.4.27-paolo/include/asm-um/signal.h | 22 um-linux-2.4.27-paolo/include/asm-um/smp.h | 19 um-linux-2.4.27-paolo/include/asm-um/smplock.h | 6 um-linux-2.4.27-paolo/include/asm-um/socket.h | 6 um-linux-2.4.27-paolo/include/asm-um/sockios.h | 6 um-linux-2.4.27-paolo/include/asm-um/softirq.h | 13 um-linux-2.4.27-paolo/include/asm-um/spinlock.h | 10 um-linux-2.4.27-paolo/include/asm-um/stat.h | 6 um-linux-2.4.27-paolo/include/asm-um/statfs.h | 6 um-linux-2.4.27-paolo/include/asm-um/string.h | 7 um-linux-2.4.27-paolo/include/asm-um/system-generic.h | 50 um-linux-2.4.27-paolo/include/asm-um/system-i386.h | 39 um-linux-2.4.27-paolo/include/asm-um/system-ppc.h | 12 um-linux-2.4.27-paolo/include/asm-um/termbits.h | 6 um-linux-2.4.27-paolo/include/asm-um/termios.h | 6 um-linux-2.4.27-paolo/include/asm-um/timex.h | 18 um-linux-2.4.27-paolo/include/asm-um/tlb.h | 1 um-linux-2.4.27-paolo/include/asm-um/types.h | 6 um-linux-2.4.27-paolo/include/asm-um/uaccess.h | 99 um-linux-2.4.27-paolo/include/asm-um/ucontext.h | 6 um-linux-2.4.27-paolo/include/asm-um/unaligned.h | 6 um-linux-2.4.27-paolo/include/asm-um/unistd.h | 121 um-linux-2.4.27-paolo/include/asm-um/user.h | 6 um-linux-2.4.27-paolo/include/asm-um/vga.h | 6 um-linux-2.4.27-paolo/include/asm-um/xor.h | 6 um-linux-2.4.27-paolo/include/linux/blk.h | 18 um-linux-2.4.27-paolo/include/linux/fs.h | 8 um-linux-2.4.27-paolo/include/linux/ghash.h | 26 um-linux-2.4.27-paolo/include/linux/hostfs_fs_i.h | 21 um-linux-2.4.27-paolo/include/linux/hppfs_fs_i.h | 19 um-linux-2.4.27-paolo/include/linux/kernel.h | 2 um-linux-2.4.27-paolo/include/linux/kernel_stat.h | 2 um-linux-2.4.27-paolo/include/linux/mm.h | 27 um-linux-2.4.27-paolo/include/linux/proc_mm.h | 48 um-linux-2.4.27-paolo/include/linux/shmem_fs.h | 2 um-linux-2.4.27-paolo/include/linux/tty.h | 6 um-linux-2.4.27-paolo/init/do_mounts.c | 16 um-linux-2.4.27-paolo/kernel/panic.c | 2 um-linux-2.4.27-paolo/mm/Makefile | 1 um-linux-2.4.27-paolo/mm/mmap.c | 12 um-linux-2.4.27-paolo/mm/mprotect.c | 14 um-linux-2.4.27-paolo/mm/page_alloc.c | 1 um-linux-2.4.27-paolo/mm/proc_mm.c | 173 + um-linux-2.4.27-paolo/mm/shmem.c | 149 + 407 files changed, 39873 insertions(+), 50 deletions(-) diff -puN /dev/null arch/um/common.ld.in --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/common.ld.in 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,53 @@ + .kstrtab : { *(.kstrtab) } + + . = ALIGN(16); /* Exception table */ + __start___ex_table = .; + __ex_table : { *(__ex_table) } + __stop___ex_table = .; + + __start___ksymtab = .; /* Kernel symbol table */ + __ksymtab : { *(__ksymtab) } + __stop___ksymtab = .; + + .unprotected : { *(.unprotected) } + . = ALIGN(4096); + PROVIDE (_unprotected_end = .); + + . = ALIGN(4096); + __uml_setup_start = .; + .uml.setup.init : { *(.uml.setup.init) } + __uml_setup_end = .; + __uml_help_start = .; + .uml.help.init : { *(.uml.help.init) } + __uml_help_end = .; + __uml_postsetup_start = .; + .uml.postsetup.init : { *(.uml.postsetup.init) } + __uml_postsetup_end = .; + __setup_start = .; + .setup.init : { *(.setup.init) } + __setup_end = .; + __initcall_start = .; + .initcall.init : { *(.initcall.init) } + __initcall_end = .; + __uml_initcall_start = .; + .uml.initcall.init : { *(.uml.initcall.init) } + __uml_initcall_end = .; + __init_end = .; + __exitcall_begin = .; + .exitcall : { *(.exitcall.exit) } + __exitcall_end = .; + __uml_exitcall_begin = .; + .uml.exitcall : { *(.uml.exitcall.exit) } + __uml_exitcall_end = .; + + __preinit_array_start = .; + .preinit_array : { *(.preinit_array) } + __preinit_array_end = .; + __init_array_start = .; + .init_array : { *(.init_array) } + __init_array_end = .; + __fini_array_start = .; + .fini_array : { *(.fini_array) } + __fini_array_end = .; + + .data.init : { *(.data.init) } diff -puN /dev/null arch/um/config_block.in --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/config_block.in 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,22 @@ +mainmenu_option next_comment +comment 'Block Devices' + +bool 'Virtual block device' CONFIG_BLK_DEV_UBD +dep_bool ' Always do synchronous disk IO for UBD' CONFIG_BLK_DEV_UBD_SYNC $CONFIG_BLK_DEV_UBD +bool 'COW device' CONFIG_COW + +if [ "$CONFIG_BLK_DEV_UBD" = "y" -o "$CONFIG_COW" = "y" ] ; then + define_bool CONFIG_COW_COMMON y +fi + +tristate 'Loopback device support' CONFIG_BLK_DEV_LOOP +dep_tristate 'Network block device support' CONFIG_BLK_DEV_NBD $CONFIG_NET +tristate 'RAM disk support' CONFIG_BLK_DEV_RAM +if [ "$CONFIG_BLK_DEV_RAM" = "y" -o "$CONFIG_BLK_DEV_RAM" = "m" ]; then + int ' Default RAM disk size' CONFIG_BLK_DEV_RAM_SIZE 4096 +fi +dep_bool ' Initial RAM disk (initrd) support' CONFIG_BLK_DEV_INITRD $CONFIG_BLK_DEV_RAM + +tristate 'Example IO memory driver' CONFIG_MMAPPER + +endmenu diff -puN /dev/null arch/um/config_char.in --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/config_char.in 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,37 @@ +mainmenu_option next_comment +comment 'Character Devices' + +define_bool CONFIG_STDIO_CONSOLE y + +bool 'Virtual serial line' CONFIG_SSL + +bool 'file descriptor channel support' CONFIG_FD_CHAN +bool 'null channel support' CONFIG_NULL_CHAN +bool 'port channel support' CONFIG_PORT_CHAN +bool 'pty channel support' CONFIG_PTY_CHAN +bool 'tty channel support' CONFIG_TTY_CHAN +bool 'xterm channel support' CONFIG_XTERM_CHAN +string 'Default main console channel initialization' CONFIG_CON_ZERO_CHAN \ + "fd:0,fd:1" +string 'Default console channel initialization' CONFIG_CON_CHAN "xterm" +string 'Default serial line channel initialization' CONFIG_SSL_CHAN "pty" + + +bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS +if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then + int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256 +fi + +bool 'Watchdog Timer Support' CONFIG_WATCHDOG +dep_bool ' Disable watchdog shutdown on close' CONFIG_WATCHDOG_NOWAYOUT \ + $CONFIG_WATCHDOG +dep_tristate ' Software Watchdog' CONFIG_SOFT_WATCHDOG $CONFIG_WATCHDOG +dep_tristate ' UML watchdog' CONFIG_UML_WATCHDOG $CONFIG_WATCHDOG + +tristate 'Sound support' CONFIG_UML_SOUND +define_tristate CONFIG_SOUND $CONFIG_UML_SOUND +define_tristate CONFIG_HOSTAUDIO $CONFIG_UML_SOUND + +bool 'Enable tty logging' CONFIG_TTY_LOG + +endmenu diff -puN /dev/null arch/um/config.in --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/config.in 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,105 @@ +define_bool CONFIG_USERMODE y + +mainmenu_name "Linux/Usermode Kernel Configuration" + +define_bool CONFIG_ISA n +define_bool CONFIG_SBUS n +define_bool CONFIG_PCI n + +define_bool CONFIG_UID16 y + +define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM y + +mainmenu_option next_comment +comment 'Code maturity level options' +bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL +endmenu + +mainmenu_option next_comment +comment 'General Setup' + +bool 'Separate kernel address space support' CONFIG_MODE_SKAS + +# This is to ensure that at least one of the modes is enabled. When neither +# is present in defconfig, they default to N, which is bad. +if [ "$CONFIG_MODE_SKAS" != "y" ]; then + define_bool CONFIG_MODE_TT y +fi + +bool 'Tracing thread support' CONFIG_MODE_TT +if [ "$CONFIG_MODE_TT" != "y" ]; then + bool 'Statically linked binary when CONFIG_MODE_TT is disabled' CONFIG_STATIC_LINK +fi +bool 'Networking support' CONFIG_NET +bool 'System V IPC' CONFIG_SYSVIPC +bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT +bool 'Sysctl support' CONFIG_SYSCTL +tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT +tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF +tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC +tristate 'Host filesystem' CONFIG_HOSTFS +tristate 'Honeypot proc filesystem' CONFIG_HPPFS +bool 'Management console' CONFIG_MCONSOLE +dep_bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ $CONFIG_MCONSOLE +bool '2G/2G host address space split' CONFIG_HOST_2G_2G +bool 'Symmetric multi-processing support' CONFIG_UML_SMP +define_bool CONFIG_SMP $CONFIG_UML_SMP +int 'Nesting level' CONFIG_NEST_LEVEL 0 +int 'Kernel address space size (in .5G units)' CONFIG_KERNEL_HALF_GIGS 1 +bool 'Highmem support' CONFIG_HIGHMEM +bool '/proc/mm' CONFIG_PROC_MM +int 'Kernel stack size order' CONFIG_KERNEL_STACK_ORDER 2 +bool 'Real-time Clock' CONFIG_UML_REAL_TIME_CLOCK +endmenu + +mainmenu_option next_comment +comment 'Loadable module support' +bool 'Enable loadable module support' CONFIG_MODULES +if [ "$CONFIG_MODULES" = "y" ]; then +# MODVERSIONS does not yet work in this architecture +# bool ' Set version information on all module symbols' CONFIG_MODVERSIONS + bool ' Kernel module loader' CONFIG_KMOD +fi +endmenu + +source arch/um/config_char.in + +source arch/um/config_block.in + +define_bool CONFIG_NETDEVICES $CONFIG_NET + +if [ "$CONFIG_NET" = "y" ]; then + source arch/um/config_net.in + source net/Config.in +fi + +source fs/Config.in + +mainmenu_option next_comment +comment 'SCSI support' + +tristate 'SCSI support' CONFIG_SCSI + +if [ "$CONFIG_SCSI" != "n" ]; then + source arch/um/config_scsi.in +fi +endmenu + +source drivers/md/Config.in + +source drivers/mtd/Config.in + +source lib/Config.in + +mainmenu_option next_comment +comment 'Kernel hacking' +bool 'Debug memory allocations' CONFIG_DEBUG_SLAB +bool 'Enable kernel debugging symbols' CONFIG_DEBUGSYM +if [ "$CONFIG_XTERM_CHAN" = "y" ]; then + dep_bool 'Enable ptrace proxy' CONFIG_PT_PROXY $CONFIG_DEBUGSYM +else + define_bool CONFIG_PT_PROXY n +fi +dep_bool 'Enable gprof support' CONFIG_GPROF $CONFIG_DEBUGSYM +dep_bool 'Enable gcov support' CONFIG_GCOV $CONFIG_DEBUGSYM +endmenu diff -puN /dev/null arch/um/config_net.in --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/config_net.in 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,47 @@ +mainmenu_option next_comment +comment 'Network Devices' + +# UML virtual driver +bool 'Virtual network device' CONFIG_UML_NET + +dep_bool ' Ethertap transport' CONFIG_UML_NET_ETHERTAP $CONFIG_UML_NET +dep_bool ' TUN/TAP transport' CONFIG_UML_NET_TUNTAP $CONFIG_UML_NET +dep_bool ' SLIP transport' CONFIG_UML_NET_SLIP $CONFIG_UML_NET +dep_bool ' SLiRP transport' CONFIG_UML_NET_SLIRP $CONFIG_UML_NET +dep_bool ' Daemon transport' CONFIG_UML_NET_DAEMON $CONFIG_UML_NET +dep_bool ' Multicast transport' CONFIG_UML_NET_MCAST $CONFIG_UML_NET +dep_bool ' pcap transport' CONFIG_UML_NET_PCAP $CONFIG_UML_NET + +# Below are hardware-independent drivers mirrored from +# drivers/net/Config.in. It would be nice if Linux +# had HW independent drivers separated from the other +# but it does not. Until then each non-ISA/PCI arch +# needs to provide it's own menu of network drivers + +tristate 'Dummy net driver support' CONFIG_DUMMY +tristate 'Bonding driver support' CONFIG_BONDING +tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER +tristate 'Universal TUN/TAP device driver support' CONFIG_TUN +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + if [ "$CONFIG_NETLINK" = "y" ]; then + tristate 'Ethertap network tap (OBSOLETE)' CONFIG_ETHERTAP + fi +fi + +tristate 'PPP (point-to-point protocol) support' CONFIG_PPP +if [ ! "$CONFIG_PPP" = "n" ]; then + dep_bool ' PPP multilink support (EXPERIMENTAL)' CONFIG_PPP_MULTILINK $CONFIG_EXPERIMENTAL + dep_bool ' PPP filtering' CONFIG_PPP_FILTER $CONFIG_FILTER + dep_tristate ' PPP support for async serial ports' CONFIG_PPP_ASYNC $CONFIG_PPP + dep_tristate ' PPP support for sync tty ports' CONFIG_PPP_SYNC_TTY $CONFIG_PPP + dep_tristate ' PPP Deflate compression' CONFIG_PPP_DEFLATE $CONFIG_PPP + dep_tristate ' PPP BSD-Compress compression' CONFIG_PPP_BSDCOMP $CONFIG_PPP + dep_tristate ' PPP over Ethernet (EXPERIMENTAL)' CONFIG_PPPOE $CONFIG_PPP $CONFIG_EXPERIMENTAL +fi + +tristate 'SLIP (serial line) support' CONFIG_SLIP +dep_bool ' CSLIP compressed headers' CONFIG_SLIP_COMPRESSED $CONFIG_SLIP +dep_bool ' Keepalive and linefill' CONFIG_SLIP_SMART $CONFIG_SLIP +dep_bool ' Six bit SLIP encapsulation' CONFIG_SLIP_MODE_SLIP6 $CONFIG_SLIP + +endmenu diff -puN /dev/null arch/um/config.release --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/config.release 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,302 @@ +# +# Automatically generated make config: don't edit +# +CONFIG_USERMODE=y +# CONFIG_ISA is not set +# CONFIG_SBUS is not set +# CONFIG_PCI is not set +CONFIG_UID16=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# General Setup +# +CONFIG_NET=y +CONFIG_SYSVIPC=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_SYSCTL=y +CONFIG_BINFMT_AOUT=y +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=y +CONFIG_HOSTFS=y +# CONFIG_HPPFS is not set +CONFIG_MCONSOLE=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_HOST_2G_2G is not set +# CONFIG_UML_SMP is not set +# CONFIG_SMP is not set +CONFIG_NEST_LEVEL=0 +CONFIG_KERNEL_HALF_GIGS=1 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_KMOD=y + +# +# Character Devices +# +CONFIG_STDIO_CONSOLE=y +CONFIG_SSL=y +CONFIG_FD_CHAN=y +# CONFIG_NULL_CHAN is not set +CONFIG_PORT_CHAN=y +CONFIG_PTY_CHAN=y +CONFIG_TTY_CHAN=y +CONFIG_XTERM_CHAN=y +CONFIG_CON_ZERO_CHAN="fd:0,fd:1" +CONFIG_CON_CHAN="xterm" +CONFIG_SSL_CHAN="pty" +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 +# CONFIG_WATCHDOG is not set +CONFIG_UML_SOUND=y +CONFIG_SOUND=y +CONFIG_HOSTAUDIO=y +# CONFIG_TTY_LOG is not set + +# +# Block Devices +# +CONFIG_BLK_DEV_UBD=y +# CONFIG_BLK_DEV_UBD_SYNC is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_NBD=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_MMAPPER is not set +CONFIG_NETDEVICES=y + +# +# Network Devices +# +CONFIG_UML_NET=y +CONFIG_UML_NET_ETHERTAP=y +CONFIG_UML_NET_TUNTAP=y +CONFIG_UML_NET_SLIP=y +CONFIG_UML_NET_DAEMON=y +CONFIG_UML_NET_MCAST=y +CONFIG_DUMMY=y +CONFIG_BONDING=m +CONFIG_EQUALIZER=m +CONFIG_TUN=y +CONFIG_PPP=m +CONFIG_PPP_MULTILINK=y +# CONFIG_PPP_ASYNC is not set +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPPOE=m +CONFIG_SLIP=m + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +# CONFIG_NETLINK_DEV is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set + +# +# Appletalk devices +# +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# +# File systems +# +CONFIG_QUOTA=y +CONFIG_AUTOFS_FS=m +CONFIG_AUTOFS4_FS=m +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set +CONFIG_AFFS_FS=m +CONFIG_HFS_FS=m +CONFIG_BFS_FS=m +CONFIG_EXT3_FS=y +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_UMSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_EFS_FS=m +CONFIG_CRAMFS=m +CONFIG_TMPFS=y +CONFIG_RAMFS=y +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +# CONFIG_ZISOFS is not set +CONFIG_MINIX_FS=m +CONFIG_VXFS_FS=m +# CONFIG_NTFS_FS is not set +CONFIG_HPFS_FS=m +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +CONFIG_QNX4FS_FS=m +# CONFIG_QNX4FS_RW is not set +CONFIG_ROMFS_FS=m +CONFIG_EXT2_FS=y +CONFIG_SYSV_FS=m +CONFIG_UDF_FS=m +# CONFIG_UDF_RW is not set +CONFIG_UFS_FS=m +# CONFIG_UFS_FS_WRITE is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_ZISOFS_FS is not set +CONFIG_ZLIB_FS_INFLATE=m + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +# CONFIG_BLK_DEV_SD is not set +# CONFIG_CHR_DEV_ST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_DEBUG=m + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Kernel hacking +# +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUGSYM is not set diff -puN /dev/null arch/um/config_scsi.in --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/config_scsi.in 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,30 @@ +comment 'SCSI support type (disk, tape, CD-ROM)' + +dep_tristate ' SCSI disk support' CONFIG_BLK_DEV_SD $CONFIG_SCSI + +if [ "$CONFIG_BLK_DEV_SD" != "n" ]; then + int 'Maximum number of SCSI disks that can be loaded as modules' CONFIG_SD_EXTRA_DEVS 40 +fi + +dep_tristate ' SCSI tape support' CONFIG_CHR_DEV_ST $CONFIG_SCSI + +dep_tristate ' SCSI CD-ROM support' CONFIG_BLK_DEV_SR $CONFIG_SCSI + +if [ "$CONFIG_BLK_DEV_SR" != "n" ]; then + bool ' Enable vendor-specific extensions (for SCSI CDROM)' CONFIG_BLK_DEV_SR_VENDOR + int 'Maximum number of CDROM devices that can be loaded as modules' CONFIG_SR_EXTRA_DEVS 2 +fi +dep_tristate ' SCSI generic support' CONFIG_CHR_DEV_SG $CONFIG_SCSI + +comment 'Some SCSI devices (e.g. CD jukebox) support multiple LUNs' + +#if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + bool ' Enable extra checks in new queueing code' CONFIG_SCSI_DEBUG_QUEUES +#fi + +bool ' Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN + +bool ' Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS +bool ' SCSI logging facility' CONFIG_SCSI_LOGGING + +dep_tristate 'SCSI debugging host simulator (EXPERIMENTAL)' CONFIG_SCSI_DEBUG $CONFIG_SCSI diff -puN /dev/null arch/um/defconfig --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/defconfig 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,423 @@ +# +# Automatically generated make config: don't edit +# +CONFIG_USERMODE=y +# CONFIG_ISA is not set +# CONFIG_SBUS is not set +# CONFIG_PCI is not set +CONFIG_UID16=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# General Setup +# +CONFIG_MODE_SKAS=y +CONFIG_MODE_TT=y +CONFIG_NET=y +CONFIG_SYSVIPC=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_SYSCTL=y +CONFIG_BINFMT_AOUT=y +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=y +CONFIG_HOSTFS=y +CONFIG_HPPFS=y +CONFIG_MCONSOLE=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_HOST_2G_2G is not set +# CONFIG_UML_SMP is not set +# CONFIG_SMP is not set +CONFIG_NEST_LEVEL=0 +CONFIG_KERNEL_HALF_GIGS=1 +# CONFIG_HIGHMEM is not set +CONFIG_PROC_MM=y +CONFIG_KERNEL_STACK_ORDER=2 +CONFIG_UML_REAL_TIME_CLOCK=y + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_KMOD is not set + +# +# Character Devices +# +CONFIG_STDIO_CONSOLE=y +CONFIG_SSL=y +CONFIG_FD_CHAN=y +CONFIG_NULL_CHAN=y +CONFIG_PORT_CHAN=y +CONFIG_PTY_CHAN=y +CONFIG_TTY_CHAN=y +CONFIG_XTERM_CHAN=y +CONFIG_CON_ZERO_CHAN="fd:0,fd:1" +CONFIG_CON_CHAN="xterm" +CONFIG_SSL_CHAN="pty" +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 +# CONFIG_WATCHDOG is not set +# CONFIG_WATCHDOG_NOWAYOUT is not set +# CONFIG_SOFT_WATCHDOG is not set +# CONFIG_UML_WATCHDOG is not set +CONFIG_UML_SOUND=y +CONFIG_SOUND=y +CONFIG_HOSTAUDIO=y +# CONFIG_TTY_LOG is not set + +# +# Block Devices +# +CONFIG_BLK_DEV_UBD=y +# CONFIG_BLK_DEV_UBD_SYNC is not set +# CONFIG_COW is not set +CONFIG_COW_COMMON=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_NBD=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_MMAPPER is not set +CONFIG_NETDEVICES=y + +# +# Network Devices +# +CONFIG_UML_NET=y +CONFIG_UML_NET_ETHERTAP=y +CONFIG_UML_NET_TUNTAP=y +CONFIG_UML_NET_SLIP=y +CONFIG_UML_NET_SLIRP=y +CONFIG_UML_NET_DAEMON=y +CONFIG_UML_NET_MCAST=y +# CONFIG_UML_NET_PCAP is not set +CONFIG_DUMMY=y +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +CONFIG_TUN=y +CONFIG_PPP=y +# CONFIG_PPP_MULTILINK is not set +# CONFIG_PPP_FILTER is not set +# CONFIG_PPP_ASYNC is not set +# CONFIG_PPP_SYNC_TTY is not set +# CONFIG_PPP_DEFLATE is not set +# CONFIG_PPP_BSDCOMP is not set +# CONFIG_PPPOE is not set +CONFIG_SLIP=y +# CONFIG_SLIP_COMPRESSED is not set +# CONFIG_SLIP_SMART is not set +# CONFIG_SLIP_MODE_SLIP6 is not set + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +# CONFIG_NETLINK_DEV is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +CONFIG_IPV6_SCTP__=y +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set + +# +# Appletalk devices +# +# CONFIG_DEV_APPLETALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# +# File systems +# +CONFIG_QUOTA=y +# CONFIG_QFMT_V2 is not set +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +CONFIG_REISERFS_FS=y +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BEFS_DEBUG is not set +# CONFIG_BFS_FS is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +# CONFIG_JBD_DEBUG is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_UMSDOS_FS=y +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +CONFIG_JFFS_FS=y +CONFIG_JFFS_FS_VERBOSE=0 +CONFIG_JFFS_PROC_FS=y +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_CRAMFS is not set +# CONFIG_TMPFS is not set +CONFIG_RAMFS=y +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +# CONFIG_ZISOFS is not set +# CONFIG_JFS_FS is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_MINIX_FS=y +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +# CONFIG_NFS_FS is not set +# CONFIG_NFS_V3 is not set +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_ROOT_NFS is not set +# CONFIG_NFSD is not set +# CONFIG_NFSD_V3 is not set +# CONFIG_NFSD_TCP is not set +# CONFIG_SUNRPC is not set +# CONFIG_LOCKD is not set +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_ZISOFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +# CONFIG_BLK_DEV_SD is not set +# CONFIG_CHR_DEV_ST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_DEBUG=y + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# Memory Technology Devices (MTD) +# +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +# CONFIG_MTD_PARTITIONS is not set +# CONFIG_MTD_CONCAT is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set + +# +# RAM/ROM/Flash chip drivers +# +# CONFIG_MTD_CFI is not set +# CONFIG_MTD_JEDECPROBE is not set +# CONFIG_MTD_GEN_PROBE is not set +# CONFIG_MTD_CFI_INTELEXT is not set +# CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_CFI_STAA is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_OBSOLETE_CHIPS is not set +# CONFIG_MTD_AMDSTD is not set +# CONFIG_MTD_SHARP is not set +# CONFIG_MTD_JEDEC is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_PCI is not set +# CONFIG_MTD_PCMCIA is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_MTDRAM is not set +CONFIG_MTD_BLKMTD=y + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC1000 is not set +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOCPROBE is not set + +# +# NAND Flash Device Drivers +# +# CONFIG_MTD_NAND is not set + +# +# Library routines +# +# CONFIG_CRC32 is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y + +# +# Kernel hacking +# +# CONFIG_DEBUG_SLAB is not set +CONFIG_DEBUGSYM=y +CONFIG_PT_PROXY=y +# CONFIG_GPROF is not set +# CONFIG_GCOV is not set diff -puN /dev/null arch/um/drivers/chan_kern.c --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/chan_kern.c 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,519 @@ +/* + * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "chan_kern.h" +#include "user_util.h" +#include "kern.h" +#include "irq_user.h" +#include "sigio.h" +#include "line.h" + +static void *not_configged_init(char *str, int device, struct chan_opts *opts) +{ + printk(KERN_ERR "Using a channel type which is configured out of " + "UML\n"); + return(NULL); +} + +static int not_configged_open(int input, int output, int primary, void *data, + char **dev_out) +{ + printk(KERN_ERR "Using a channel type which is configured out of " + "UML\n"); + return(-ENODEV); +} + +static void not_configged_close(int fd, void *data) +{ + printk(KERN_ERR "Using a channel type which is configured out of " + "UML\n"); +} + +static int not_configged_read(int fd, char *c_out, void *data) +{ + printk(KERN_ERR "Using a channel type which is configured out of " + "UML\n"); + return(-EIO); +} + +static int not_configged_write(int fd, const char *buf, int len, void *data) +{ + printk(KERN_ERR "Using a channel type which is configured out of " + "UML\n"); + return(-EIO); +} + +static int not_configged_console_write(int fd, const char *buf, int len, + void *data) +{ + printk(KERN_ERR "Using a channel type which is configured out of " + "UML\n"); + return(-EIO); +} + +static int not_configged_window_size(int fd, void *data, unsigned short *rows, + unsigned short *cols) +{ + printk(KERN_ERR "Using a channel type which is configured out of " + "UML\n"); + return(-ENODEV); +} + +static void not_configged_free(void *data) +{ + printk(KERN_ERR "Using a channel type which is configured out of " + "UML\n"); +} + +static struct chan_ops not_configged_ops = { + .init = not_configged_init, + .open = not_configged_open, + .close = not_configged_close, + .read = not_configged_read, + .write = not_configged_write, + .console_write = not_configged_console_write, + .window_size = not_configged_window_size, + .free = not_configged_free, + .winch = 0, +}; + +static void tty_receive_char(struct tty_struct *tty, char ch) +{ + if(tty == NULL) return; + + if(I_IXON(tty) && !I_IXOFF(tty) && !tty->raw) { + if(ch == STOP_CHAR(tty)){ + stop_tty(tty); + return; + } + else if(ch == START_CHAR(tty)){ + start_tty(tty); + return; + } + } + + if((tty->flip.flag_buf_ptr == NULL) || + (tty->flip.char_buf_ptr == NULL)) + return; + tty_insert_flip_char(tty, ch, TTY_NORMAL); +} + +static int open_one_chan(struct chan *chan, int input, int output, int primary) +{ + int fd; + + if(chan->opened) return(0); + if(chan->ops->open == NULL) fd = 0; + else fd = (*chan->ops->open)(input, output, primary, chan->data, + &chan->dev); + if(fd < 0) return(fd); + chan->fd = fd; + + chan->opened = 1; + return(0); +} + +int open_chan(struct list_head *chans) +{ + struct list_head *ele; + struct chan *chan; + int ret, err = 0; + + list_for_each(ele, chans){ + chan = list_entry(ele, struct chan, list); + ret = open_one_chan(chan, chan->input, chan->output, + chan->primary); + if(chan->primary) err = ret; + } + return(err); +} + +void chan_enable_winch(struct list_head *chans, void *line) +{ + struct list_head *ele; + struct chan *chan; + + list_for_each(ele, chans){ + chan = list_entry(ele, struct chan, list); + if(chan->primary && chan->output && chan->ops->winch){ + register_winch(chan->fd, line); + return; + } + } +} + +void enable_chan(struct list_head *chans, void *data) +{ + struct list_head *ele; + struct chan *chan; + + list_for_each(ele, chans){ + chan = list_entry(ele, struct chan, list); + if(!chan->opened) continue; + + line_setup_irq(chan->fd, chan->input, chan->output, data); + } +} + +void close_chan(struct list_head *chans) +{ + struct list_head *ele; + struct chan *chan; + + /* Close in reverse order as open in case more than one of them + * refers to the same device and they save and restore that device's + * state. Then, the first one opened will have the original state, + * so it must be the last closed. + */ + for(ele = chans->prev; ele != chans; ele = ele->prev){ + chan = list_entry(ele, struct chan, list); + if(!chan->opened) continue; + if(chan->ops->close != NULL) + (*chan->ops->close)(chan->fd, chan->data); + chan->opened = 0; + chan->fd = -1; + } +} + +int write_chan(struct list_head *chans, const char *buf, int len, + int write_irq) +{ + struct list_head *ele; + struct chan *chan; + int n, ret = 0; + + list_for_each(ele, chans){ + chan = list_entry(ele, struct chan, list); + if(!chan->output || (chan->ops->write == NULL)) continue; + n = chan->ops->write(chan->fd, buf, len, chan->data); + if(chan->primary){ + ret = n; + if((ret == -EAGAIN) || ((ret >= 0) && (ret < len))){ + reactivate_fd(chan->fd, write_irq); + if(ret == -EAGAIN) ret = 0; + } + } + } + return(ret); +} + +int console_write_chan(struct list_head *chans, const char *buf, int len) +{ + struct list_head *ele; + struct chan *chan; + int n, ret = 0; + + list_for_each(ele, chans){ + chan = list_entry(ele, struct chan, list); + if(!chan->output || (chan->ops->console_write == NULL)) + continue; + n = chan->ops->console_write(chan->fd, buf, len, chan->data); + if(chan->primary) ret = n; + } + return(ret); +} + +int chan_window_size(struct list_head *chans, unsigned short *rows_out, + unsigned short *cols_out) +{ + struct list_head *ele; + struct chan *chan; + + list_for_each(ele, chans){ + chan = list_entry(ele, struct chan, list); + if(chan->primary){ + if(chan->ops->window_size == NULL) return(0); + return(chan->ops->window_size(chan->fd, chan->data, + rows_out, cols_out)); + } + } + return(0); +} + +void free_one_chan(struct chan *chan) +{ + list_del(&chan->list); + if(chan->ops->free != NULL) + (*chan->ops->free)(chan->data); + free_irq_by_fd(chan->fd); + if(chan->primary && chan->output) ignore_sigio_fd(chan->fd); + kfree(chan); +} + +void free_chan(struct list_head *chans) +{ + struct list_head *ele, *next; + struct chan *chan; + + list_for_each_safe(ele, next, chans){ + chan = list_entry(ele, struct chan, list); + free_one_chan(chan); + } +} + +static int one_chan_config_string(struct chan *chan, char *str, int size, + char **error_out) +{ + int n = 0; + + if(chan == NULL){ + CONFIG_CHUNK(str, size, n, "none", 1); + return(n); + } + + CONFIG_CHUNK(str, size, n, chan->ops->type, 0); + + if(chan->dev == NULL){ + CONFIG_CHUNK(str, size, n, "", 1); + return(n); + } + + CONFIG_CHUNK(str, size, n, ":", 0); + CONFIG_CHUNK(str, size, n, chan->dev, 0); + + return(n); +} + +static int chan_pair_config_string(struct chan *in, struct chan *out, + char *str, int size, char **error_out) +{ + int n; + + n = one_chan_config_string(in, str, size, error_out); + str += n; + size -= n; + + if(in == out){ + CONFIG_CHUNK(str, size, n, "", 1); + return(n); + } + + CONFIG_CHUNK(str, size, n, ",", 1); + n = one_chan_config_string(out, str, size, error_out); + str += n; + size -= n; + CONFIG_CHUNK(str, size, n, "", 1); + + return(n); +} + +int chan_config_string(struct list_head *chans, char *str, int size, + char **error_out) +{ + struct list_head *ele; + struct chan *chan, *in = NULL, *out = NULL; + + list_for_each(ele, chans){ + chan = list_entry(ele, struct chan, list); + if(!chan->primary) + continue; + if(chan->input) + in = chan; + if(chan->output) + out = chan; + } + + return(chan_pair_config_string(in, out, str, size, error_out)); +} + +struct chan_type { + char *key; + struct chan_ops *ops; +}; + +struct chan_type chan_table[] = { +#ifdef CONFIG_FD_CHAN + { "fd", &fd_ops }, +#else + { "fd", ¬_configged_ops }, +#endif + +#ifdef CONFIG_NULL_CHAN + { "null", &null_ops }, +#else + { "null", ¬_configged_ops }, +#endif + +#ifdef CONFIG_PORT_CHAN + { "port", &port_ops }, +#else + { "port", ¬_configged_ops }, +#endif + +#ifdef CONFIG_PTY_CHAN + { "pty", &pty_ops }, + { "pts", &pts_ops }, +#else + { "pty", ¬_configged_ops }, + { "pts", ¬_configged_ops }, +#endif + +#ifdef CONFIG_TTY_CHAN + { "tty", &tty_ops }, +#else + { "tty", ¬_configged_ops }, +#endif + +#ifdef CONFIG_XTERM_CHAN + { "xterm", &xterm_ops }, +#else + { "xterm", ¬_configged_ops }, +#endif +}; + +static struct chan *parse_chan(char *str, int pri, int device, + struct chan_opts *opts) +{ + struct chan_type *entry; + struct chan_ops *ops; + struct chan *chan; + void *data; + int i; + + ops = NULL; + data = NULL; + for(i = 0; i < sizeof(chan_table)/sizeof(chan_table[0]); i++){ + entry = &chan_table[i]; + if(!strncmp(str, entry->key, strlen(entry->key))){ + ops = entry->ops; + str += strlen(entry->key); + break; + } + } + if(ops == NULL){ + printk(KERN_ERR "parse_chan couldn't parse \"%s\"\n", + str); + return(NULL); + } + if(ops->init == NULL) return(NULL); + data = (*ops->init)(str, device, opts); + if(data == NULL) return(NULL); + + chan = kmalloc(sizeof(*chan), GFP_KERNEL); + if(chan == NULL) return(NULL); + *chan = ((struct chan) { .list = LIST_HEAD_INIT(chan->list), + .primary = 1, + .input = 0, + .output = 0, + .opened = 0, + .fd = -1, + .pri = pri, + .ops = ops, + .data = data }); + return(chan); +} + +int parse_chan_pair(char *str, struct list_head *chans, int pri, int device, + struct chan_opts *opts) +{ + struct chan *new, *chan; + char *in, *out; + + if(!list_empty(chans)){ + chan = list_entry(chans->next, struct chan, list); + if(chan->pri >= pri) return(0); + free_chan(chans); + INIT_LIST_HEAD(chans); + } + + out = strchr(str, ','); + if(out != NULL){ + in = str; + *out = '\0'; + out++; + new = parse_chan(in, pri, device, opts); + if(new == NULL) return(-1); + new->input = 1; + list_add(&new->list, chans); + + new = parse_chan(out, pri, device, opts); + if(new == NULL) return(-1); + list_add(&new->list, chans); + new->output = 1; + } + else { + new = parse_chan(str, pri, device, opts); + if(new == NULL) return(-1); + list_add(&new->list, chans); + new->input = 1; + new->output = 1; + } + return(0); +} + +int chan_out_fd(struct list_head *chans) +{ + struct list_head *ele; + struct chan *chan; + + list_for_each(ele, chans){ + chan = list_entry(ele, struct chan, list); + if(chan->primary && chan->output) + return(chan->fd); + } + return(-1); +} + +void chan_interrupt(struct list_head *chans, struct tq_struct *task, + struct tty_struct *tty, int irq, void *dev) +{ + struct list_head *ele, *next; + struct chan *chan; + int err; + char c; + + list_for_each_safe(ele, next, chans){ + chan = list_entry(ele, struct chan, list); + if(!chan->input || (chan->ops->read == NULL)) continue; + do { + if((tty != NULL) && + (tty->flip.count >= TTY_FLIPBUF_SIZE)){ + queue_task(task, &tq_timer); + goto out; + } + err = chan->ops->read(chan->fd, &c, chan->data); + if(err > 0) + tty_receive_char(tty, c); + } while(err > 0); + + if(err == 0) reactivate_fd(chan->fd, irq); + if(err == -EIO){ + if(chan->primary){ + if(tty != NULL) + tty_hangup(tty); + line_disable(dev, irq); + close_chan(chans); + free_chan(chans); + return; + } + else { + if(chan->ops->close != NULL) + chan->ops->close(chan->fd, chan->data); + free_one_chan(chan); + } + } + } + out: + if(tty) tty_flip_buffer_push(tty); +} + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/chan_user.c --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/chan_user.c 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,217 @@ +/* + * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) + * Licensed under the GPL + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kern_util.h" +#include "user_util.h" +#include "chan_user.h" +#include "user.h" +#include "helper.h" +#include "os.h" +#include "choose-mode.h" +#include "mode.h" + +void generic_close(int fd, void *unused) +{ + os_close_file(fd); +} + +int generic_read(int fd, char *c_out, void *unused) +{ + int n; + + n = os_read_file(fd, c_out, sizeof(*c_out)); + + if(n == -EAGAIN) + return(0); + else if(n == 0) + return(-EIO); + return(n); +} + +/* XXX Trivial wrapper around os_write_file */ + +int generic_write(int fd, const char *buf, int n, void *unused) +{ + return(os_write_file(fd, buf, n)); +} + +int generic_console_write(int fd, const char *buf, int n, void *unused) +{ + struct termios save, new; + int err; + + if(isatty(fd)){ + tcgetattr(fd, &save); + new = save; + new.c_oflag |= OPOST; + tcsetattr(fd, TCSAFLUSH, &new); + } + err = generic_write(fd, buf, n, NULL); + if(isatty(fd)) tcsetattr(fd, TCSAFLUSH, &save); + return(err); +} + +int generic_window_size(int fd, void *unused, unsigned short *rows_out, + unsigned short *cols_out) +{ + int rows, cols; + int ret; + + ret = os_window_size(fd, &rows, &cols); + if(ret < 0) + return(ret); + + ret = ((*rows_out != rows) || (*cols_out != cols)); + + *rows_out = rows; + *cols_out = cols; + + return(ret); +} + +void generic_free(void *data) +{ + kfree(data); +} + +static void winch_handler(int sig) +{ +} + +struct winch_data { + int pty_fd; + int pipe_fd; + int close_me; +}; + +static int winch_thread(void *arg) +{ + struct winch_data *data = arg; + sigset_t sigs; + int pty_fd, pipe_fd; + int count, err; + char c = 1; + + os_close_file(data->close_me); + pty_fd = data->pty_fd; + pipe_fd = data->pipe_fd; + count = os_write_file(pipe_fd, &c, sizeof(c)); + if(count != sizeof(c)) + printk("winch_thread : failed to write synchronization " + "byte, err = %d\n", -count); + + signal(SIGWINCH, winch_handler); + sigfillset(&sigs); + sigdelset(&sigs, SIGWINCH); + if(sigprocmask(SIG_SETMASK, &sigs, NULL) < 0){ + printk("winch_thread : sigprocmask failed, errno = %d\n", + errno); + exit(1); + } + + if(setsid() < 0){ + printk("winch_thread : setsid failed, errno = %d\n", errno); + exit(1); + } + + err = os_new_tty_pgrp(pty_fd, os_getpid()); + if(err < 0){ + printk("winch_thread : new_tty_pgrp failed, err = %d\n", -err); + exit(1); + } + + count = os_read_file(pipe_fd, &c, sizeof(c)); + if(count != sizeof(c)) + printk("winch_thread : failed to read synchronization byte, " + "err = %d\n", -count); + + while(1){ + pause(); + + count = os_write_file(pipe_fd, &c, sizeof(c)); + if(count != sizeof(c)) + printk("winch_thread : write failed, err = %d\n", + -count); + } +} + +static int winch_tramp(int fd, void *device_data, int *fd_out) +{ + struct winch_data data; + unsigned long stack; + int fds[2], pid, n, err; + char c; + + err = os_pipe(fds, 1, 1); + if(err < 0){ + printk("winch_tramp : os_pipe failed, err = %d\n", -err); + return(err); + } + + data = ((struct winch_data) { .pty_fd = fd, + .pipe_fd = fds[1], + .close_me = fds[0] } ); + pid = run_helper_thread(winch_thread, &data, 0, &stack, 0); + if(pid < 0){ + printk("fork of winch_thread failed - errno = %d\n", errno); + return(pid); + } + + os_close_file(fds[1]); + *fd_out = fds[0]; + n = os_read_file(fds[0], &c, sizeof(c)); + if(n != sizeof(c)){ + printk("winch_tramp : failed to read synchronization byte\n"); + printk("read failed, err = %d\n", -n); + printk("fd %d will not support SIGWINCH\n", fd); + *fd_out = -1; + } + return(pid); +} + +void register_winch(int fd, void *device_data) +{ + int pid, thread, thread_fd; + int count; + char c = 1; + + if(!isatty(fd)) + return; + + pid = tcgetpgrp(fd); + if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd, + device_data) && (pid == -1)){ + thread = winch_tramp(fd, device_data, &thread_fd); + if(fd != -1){ + register_winch_irq(thread_fd, fd, thread, device_data); + + count = os_write_file(thread_fd, &c, sizeof(c)); + if(count != sizeof(c)) + printk("register_winch : failed to write " + "synchronization byte, err = %d\n", + -count); + } + } +} + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/cow.h --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/cow.h 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,41 @@ +#ifndef __COW_H__ +#define __COW_H__ + +#include + +#if __BYTE_ORDER == __BIG_ENDIAN +# define ntohll(x) (x) +# define htonll(x) (x) +#elif __BYTE_ORDER == __LITTLE_ENDIAN +# define ntohll(x) bswap_64(x) +# define htonll(x) bswap_64(x) +#else +#error "__BYTE_ORDER not defined" +#endif + +extern int init_cow_file(int fd, char *cow_file, char *backing_file, + int sectorsize, int alignment, int *bitmap_offset_out, + unsigned long *bitmap_len_out, int *data_offset_out); + +extern int file_reader(__u64 offset, char *buf, int len, void *arg); +extern int read_cow_header(int (*reader)(__u64, char *, int, void *), + void *arg, __u32 *version_out, + char **backing_file_out, time_t *mtime_out, + __u64 *size_out, int *sectorsize_out, + __u32 *align_out, int *bitmap_offset_out); + +extern int write_cow_header(char *cow_file, int fd, char *backing_file, + int sectorsize, int alignment, long long *size); + +extern void cow_sizes(int version, __u64 size, int sectorsize, int align, + int bitmap_offset, unsigned long *bitmap_len_out, + int *data_offset_out); + +#endif + +/* + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/cow_kern.c --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/cow_kern.c 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,630 @@ +#define COW_MAJOR 60 +#define MAJOR_NR COW_MAJOR + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "2_5compat.h" +#include "cow.h" +#include "ubd_user.h" + +#define COW_SHIFT 4 + +struct cow { + int count; + char *cow_path; + dev_t cow_dev; + struct block_device *cow_bdev; + char *backing_path; + dev_t backing_dev; + struct block_device *backing_bdev; + int sectorsize; + unsigned long *bitmap; + unsigned long bitmap_len; + int bitmap_offset; + int data_offset; + devfs_handle_t devfs; + struct semaphore sem; + struct semaphore io_sem; + atomic_t working; + spinlock_t io_lock; + struct buffer_head *bh; + struct buffer_head *bhtail; + void *end_io; +}; + +#define DEFAULT_COW { \ + .count = 0, \ + .cow_path = NULL, \ + .cow_dev = 0, \ + .backing_path = NULL, \ + .backing_dev = 0, \ + .bitmap = NULL, \ + .bitmap_len = 0, \ + .bitmap_offset = 0, \ + .data_offset = 0, \ + .devfs = NULL, \ + .working = ATOMIC_INIT(0), \ + .io_lock = SPIN_LOCK_UNLOCKED, \ +} + +#define MAX_DEV (8) +#define MAX_MINOR (MAX_DEV << COW_SHIFT) + +struct cow cow_dev[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_COW }; + +/* Not modified by this driver */ +static int blk_sizes[MAX_MINOR] = { [ 0 ... MAX_MINOR - 1 ] = BLOCK_SIZE }; +static int hardsect_sizes[MAX_MINOR] = { [ 0 ... MAX_MINOR - 1 ] = 512 }; + +/* Protected by cow_lock */ +static int sizes[MAX_MINOR] = { [ 0 ... MAX_MINOR - 1 ] = 0 }; + +static struct hd_struct cow_part[MAX_MINOR] = + { [ 0 ... MAX_MINOR - 1 ] = { 0, 0, 0 } }; + +/* Protected by io_request_lock */ +static request_queue_t *cow_queue; + +static int cow_open(struct inode *inode, struct file *filp); +static int cow_release(struct inode * inode, struct file * file); +static int cow_ioctl(struct inode * inode, struct file * file, + unsigned int cmd, unsigned long arg); +static int cow_revalidate(kdev_t rdev); + +static struct block_device_operations cow_blops = { + .open = cow_open, + .release = cow_release, + .ioctl = cow_ioctl, + .revalidate = cow_revalidate, +}; + +/* Initialized in an initcall, and unchanged thereafter */ +devfs_handle_t cow_dir_handle; + +#define INIT_GENDISK(maj, name, parts, shift, bsizes, max, blops) \ +{ \ + .major = maj, \ + .major_name = name, \ + .minor_shift = shift, \ + .max_p = 1 << shift, \ + .part = parts, \ + .sizes = bsizes, \ + .nr_real = max, \ + .real_devices = NULL, \ + .next = NULL, \ + .fops = blops, \ + .de_arr = NULL, \ + .flags = 0 \ +} + +static spinlock_t cow_lock = SPIN_LOCK_UNLOCKED; + +static struct gendisk cow_gendisk = INIT_GENDISK(MAJOR_NR, "cow", cow_part, + COW_SHIFT, sizes, MAX_DEV, + &cow_blops); + +static int cow_add(int n) +{ + struct cow *dev = &cow_dev[n]; + char name[sizeof("nnnnnn\0")]; + int err = -ENODEV; + + if(dev->cow_path == NULL) + goto out; + + sprintf(name, "%d", n); + dev->devfs = devfs_register(cow_dir_handle, name, DEVFS_FL_REMOVABLE, + MAJOR_NR, n << COW_SHIFT, S_IFBLK | + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, + &cow_blops, NULL); + + init_MUTEX_LOCKED(&dev->sem); + init_MUTEX(&dev->io_sem); + + return(0); + + out: + return(err); +} + +/* + * Add buffer_head to back of pending list + */ +static void cow_add_bh(struct cow *cow, struct buffer_head *bh) +{ + unsigned long flags; + + spin_lock_irqsave(&cow->io_lock, flags); + if(cow->bhtail != NULL){ + cow->bhtail->b_reqnext = bh; + cow->bhtail = bh; + } + else { + cow->bh = bh; + cow->bhtail = bh; + } + spin_unlock_irqrestore(&cow->io_lock, flags); +} + +/* + * Grab first pending buffer + */ +static struct buffer_head *cow_get_bh(struct cow *cow) +{ + struct buffer_head *bh; + + spin_lock_irq(&cow->io_lock); + bh = cow->bh; + if(bh != NULL){ + if(bh == cow->bhtail) + cow->bhtail = NULL; + cow->bh = bh->b_reqnext; + bh->b_reqnext = NULL; + } + spin_unlock_irq(&cow->io_lock); + + return(bh); +} + +static void cow_handle_bh(struct cow *cow, struct buffer_head *bh, + struct buffer_head **cow_bh, int ncow_bh) +{ + int i; + + if(ncow_bh > 0) + ll_rw_block(WRITE, ncow_bh, cow_bh); + + for(i = 0; i < ncow_bh ; i++){ + wait_on_buffer(cow_bh[i]); + brelse(cow_bh[i]); + } + + ll_rw_block(WRITE, 1, &bh); + brelse(bh); +} + +static struct buffer_head *cow_new_bh(struct cow *dev, int sector) +{ + struct buffer_head *bh; + + sector = (dev->bitmap_offset + sector / 8) / dev->sectorsize; + bh = getblk(dev->cow_dev, sector, dev->sectorsize); + memcpy(bh->b_data, dev->bitmap + sector / (8 * sizeof(dev->bitmap[0])), + dev->sectorsize); + return(bh); +} + +/* Copied from loop.c, needed to avoid deadlocking in make_request. */ + +static int cow_thread(void *data) +{ + struct cow *dev = data; + struct buffer_head *bh; + + daemonize(); + exit_files(current); + + sprintf(current->comm, "cow%d", dev - cow_dev); + + spin_lock_irq(¤t->sigmask_lock); + sigfillset(¤t->blocked); + flush_signals(current); + spin_unlock_irq(¤t->sigmask_lock); + + atomic_inc(&dev->working); + + current->policy = SCHED_OTHER; + current->nice = -20; + + current->flags |= PF_NOIO; + + /* + * up sem, we are running + */ + up(&dev->sem); + + for(;;){ + int start, len, nbh, i, update_bitmap = 0; + struct buffer_head *cow_bh[2]; + + down_interruptible(&dev->io_sem); + /* + * could be upped because of tear-down, not because of + * pending work + */ + if(!atomic_read(&dev->working)) + break; + + bh = cow_get_bh(dev); + if(bh == NULL){ + printk(KERN_ERR "cow: missing bh\n"); + continue; + } + + start = bh->b_blocknr * bh->b_size / dev->sectorsize; + len = bh->b_size / dev->sectorsize; + for(i = 0; i < len ; i++){ + if(ubd_test_bit(start + i, + (unsigned char *) dev->bitmap)) + continue; + + update_bitmap = 1; + ubd_set_bit(start + i, (unsigned char *) dev->bitmap); + } + + cow_bh[0] = NULL; + cow_bh[1] = NULL; + nbh = 0; + if(update_bitmap){ + cow_bh[0] = cow_new_bh(dev, start); + nbh++; + if(start / dev->sectorsize != + (start + len) / dev->sectorsize){ + cow_bh[1] = cow_new_bh(dev, start + len); + nbh++; + } + } + + bh->b_dev = dev->cow_dev; + bh->b_blocknr += dev->data_offset / dev->sectorsize; + + cow_handle_bh(dev, bh, cow_bh, nbh); + + /* + * upped both for pending work and tear-down, lo_pending + * will hit zero then + */ + if(atomic_dec_and_test(&dev->working)) + break; + } + + up(&dev->sem); + return(0); +} + +static int cow_make_request(request_queue_t *q, int rw, struct buffer_head *bh) +{ + struct cow *dev; + int n, minor; + + minor = MINOR(bh->b_rdev); + n = minor >> COW_SHIFT; + dev = &cow_dev[n]; + + dev->end_io = NULL; + if(ubd_test_bit(bh->b_rsector, (unsigned char *) dev->bitmap)){ + bh->b_rdev = dev->cow_dev; + bh->b_rsector += dev->data_offset / dev->sectorsize; + } + else if(rw == WRITE){ + bh->b_dev = dev->cow_dev; + bh->b_blocknr += dev->data_offset / dev->sectorsize; + + cow_add_bh(dev, bh); + up(&dev->io_sem); + return(0); + } + else { + bh->b_rdev = dev->backing_dev; + } + + return(1); +} + +int cow_init(void) +{ + int i; + + cow_dir_handle = devfs_mk_dir (NULL, "cow", NULL); + if (devfs_register_blkdev(MAJOR_NR, "cow", &cow_blops)) { + printk(KERN_ERR "cow: unable to get major %d\n", MAJOR_NR); + return -1; + } + read_ahead[MAJOR_NR] = 8; /* 8 sector (4kB) read-ahead */ + blksize_size[MAJOR_NR] = blk_sizes; + blk_size[MAJOR_NR] = sizes; + INIT_HARDSECT(hardsect_size, MAJOR_NR, hardsect_sizes); + + cow_queue = BLK_DEFAULT_QUEUE(MAJOR_NR); + blk_init_queue(cow_queue, NULL); + INIT_ELV(cow_queue, &cow_queue->elevator); + blk_queue_make_request(cow_queue, cow_make_request); + + add_gendisk(&cow_gendisk); + + for(i=0;i 0){ + n = (left > blocksize) ? blocksize : left; + + bh = bread(dev, block, (n < 512) ? 512 : n); + if(bh == NULL) + return(-EIO); + + n -= offset; + memcpy(&buf[cur], bh->b_data + offset, n); + block++; + left -= n; + cur += n; + offset = 0; + brelse(bh); + } + + return(count); +} + +static int cow_open(struct inode *inode, struct file *filp) +{ + int (*dev_ioctl)(struct inode *, struct file *, unsigned int, + unsigned long); + mm_segment_t fs; + struct cow *dev; + __u64 size; + __u32 version, align; + time_t mtime; + char *backing_file; + int n, offset, err = 0; + + n = DEVICE_NR(inode->i_rdev); + if(n >= MAX_DEV) + return(-ENODEV); + dev = &cow_dev[n]; + offset = n << COW_SHIFT; + + spin_lock(&cow_lock); + + if(dev->count == 0){ + dev->cow_dev = name_to_kdev_t(dev->cow_path); + if(dev->cow_dev == 0){ + printk(KERN_ERR "cow_open - name_to_kdev_t(\"%s\") " + "failed\n", dev->cow_path); + err = -ENODEV; + } + + dev->backing_dev = name_to_kdev_t(dev->backing_path); + if(dev->backing_dev == 0){ + printk(KERN_ERR "cow_open - name_to_kdev_t(\"%s\") " + "failed\n", dev->backing_path); + err = -ENODEV; + } + + if(err) + goto out; + + dev->cow_bdev = bdget(dev->cow_dev); + if(dev->cow_bdev == NULL){ + printk(KERN_ERR "cow_open - bdget(\"%s\") failed\n", + dev->cow_path); + err = -ENOMEM; + } + dev->backing_bdev = bdget(dev->backing_dev); + if(dev->backing_bdev == NULL){ + printk(KERN_ERR "cow_open - bdget(\"%s\") failed\n", + dev->backing_path); + err = -ENOMEM; + } + + if(err) + goto out; + + err = blkdev_get(dev->cow_bdev, FMODE_READ|FMODE_WRITE, 0, + BDEV_RAW); + if(err){ + printk("cow_open - blkdev_get of COW device failed, " + "error = %d\n", err); + goto out; + } + + err = blkdev_get(dev->backing_bdev, FMODE_READ, 0, BDEV_RAW); + if(err){ + printk("cow_open - blkdev_get of backing device " + "failed, error = %d\n", err); + goto out; + } + + err = read_cow_header(reader, &dev->cow_dev, &version, + &backing_file, &mtime, &size, + &dev->sectorsize, &align, + &dev->bitmap_offset); + if(err){ + printk(KERN_ERR "cow_open - read_cow_header failed, " + "err = %d\n", err); + goto out; + } + + cow_sizes(version, size, dev->sectorsize, align, + dev->bitmap_offset, &dev->bitmap_len, + &dev->data_offset); + dev->bitmap = (void *) vmalloc(dev->bitmap_len); + if(dev->bitmap == NULL){ + err = -ENOMEM; + printk(KERN_ERR "Failed to vmalloc COW bitmap\n"); + goto out; + } + flush_tlb_kernel_vm(); + + err = reader(dev->bitmap_offset, (char *) dev->bitmap, + dev->bitmap_len, &dev->cow_dev); + if(err < 0){ + printk(KERN_ERR "Failed to read COW bitmap\n"); + vfree(dev->bitmap); + goto out; + } + + dev_ioctl = dev->backing_bdev->bd_op->ioctl; + fs = get_fs(); + set_fs(KERNEL_DS); + err = (*dev_ioctl)(inode, filp, BLKGETSIZE, + (unsigned long) &sizes[offset]); + set_fs(fs); + if(err){ + printk(KERN_ERR "cow_open - BLKGETSIZE failed, " + "error = %d\n", err); + goto out; + } + + kernel_thread(cow_thread, dev, + CLONE_FS | CLONE_FILES | CLONE_SIGHAND); + down(&dev->sem); + } + dev->count++; + out: + spin_unlock(&cow_lock); + return(err); +} + +static int cow_release(struct inode * inode, struct file * file) +{ + struct cow *dev; + int n, err; + + n = DEVICE_NR(inode->i_rdev); + if(n >= MAX_DEV) + return(-ENODEV); + dev = &cow_dev[n]; + + spin_lock(&cow_lock); + + if(--dev->count > 0) + goto out; + + err = blkdev_put(dev->cow_bdev, BDEV_RAW); + if(err) + printk("cow_release - blkdev_put of cow device failed, " + "error = %d\n", err); + bdput(dev->cow_bdev); + dev->cow_bdev = 0; + + err = blkdev_put(dev->backing_bdev, BDEV_RAW); + if(err) + printk("cow_release - blkdev_put of backing device failed, " + "error = %d\n", err); + bdput(dev->backing_bdev); + dev->backing_bdev = 0; + + out: + spin_unlock(&cow_lock); + return(0); +} + +static int cow_ioctl(struct inode * inode, struct file * file, + unsigned int cmd, unsigned long arg) +{ + struct cow *dev; + int (*dev_ioctl)(struct inode *, struct file *, unsigned int, + unsigned long); + int n; + + n = DEVICE_NR(inode->i_rdev); + if(n >= MAX_DEV) + return(-ENODEV); + dev = &cow_dev[n]; + + dev_ioctl = dev->backing_bdev->bd_op->ioctl; + return((*dev_ioctl)(inode, file, cmd, arg)); +} + +static int cow_revalidate(kdev_t rdev) +{ + printk(KERN_ERR "Need to implement cow_revalidate\n"); + return(0); +} + +static int parse_unit(char **ptr) +{ + char *str = *ptr, *end; + int n = -1; + + if(isdigit(*str)) { + n = simple_strtoul(str, &end, 0); + if(end == str) + return(-1); + *ptr = end; + } + else if (('a' <= *str) && (*str <= 'h')) { + n = *str - 'a'; + str++; + *ptr = str; + } + return(n); +} + +static int cow_setup(char *str) +{ + struct cow *dev; + char *cow_name, *backing_name; + int unit; + + unit = parse_unit(&str); + if(unit < 0){ + printk(KERN_ERR "cow_setup - Couldn't parse unit number\n"); + return(1); + } + + if(*str != '='){ + printk(KERN_ERR "cow_setup - Missing '=' after unit " + "number\n"); + return(1); + } + str++; + + cow_name = str; + backing_name = strchr(str, ','); + if(backing_name == NULL){ + printk(KERN_ERR "cow_setup - missing backing device name\n"); + return(0); + } + *backing_name = '\0'; + backing_name++; + + spin_lock(&cow_lock); + + dev = &cow_dev[unit]; + dev->cow_path = cow_name; + dev->backing_path = backing_name; + + spin_unlock(&cow_lock); + return(0); +} + +__setup("cow", cow_setup); + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/cow_sys.h --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/cow_sys.h 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,48 @@ +#ifndef __COW_SYS_H__ +#define __COW_SYS_H__ + +#include "kern_util.h" +#include "user_util.h" +#include "os.h" +#include "user.h" + +static inline void *cow_malloc(int size) +{ + return(um_kmalloc(size)); +} + +static inline void cow_free(void *ptr) +{ + kfree(ptr); +} + +#define cow_printf printk + +static inline char *cow_strdup(char *str) +{ + return(uml_strdup(str)); +} + +static inline int cow_seek_file(int fd, __u64 offset) +{ + return(os_seek_file(fd, offset)); +} + +static inline int cow_file_size(char *file, __u64 *size_out) +{ + return(os_file_size(file, size_out)); +} + +static inline int cow_write_file(int fd, char *buf, int size) +{ + return(os_write_file(fd, buf, size)); +} + +#endif + +/* + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/cow_user.c --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/cow_user.c 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,375 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "os.h" + +#include "cow.h" +#include "cow_sys.h" + +#define PATH_LEN_V1 256 + +struct cow_header_v1 { + int magic; + int version; + char backing_file[PATH_LEN_V1]; + time_t mtime; + __u64 size; + int sectorsize; +}; + +#define PATH_LEN_V2 MAXPATHLEN + +struct cow_header_v2 { + unsigned long magic; + unsigned long version; + char backing_file[PATH_LEN_V2]; + time_t mtime; + __u64 size; + int sectorsize; +}; + +/* Define PATH_LEN_V3 as the usual value of MAXPATHLEN, just hard-code it in + * case other systems have different values for MAXPATHLEN + */ +#define PATH_LEN_V3 4096 + +/* Changes from V2 - + * PATH_LEN_V3 as described above + * Explicitly specify field bit lengths for systems with different + * lengths for the usual C types. Not sure whether char or + * time_t should be changed, this can be changed later without + * breaking compatibility + * Add alignment field so that different alignments can be used for the + * bitmap and data + * Add cow_format field to allow for the possibility of different ways + * of specifying the COW blocks. For now, the only value is 0, + * for the traditional COW bitmap. + * Move the backing_file field to the end of the header. This allows + * for the possibility of expanding it into the padding required + * by the bitmap alignment. + * The bitmap and data portions of the file will be aligned as specified + * by the alignment field. This is to allow COW files to be + * put on devices with restrictions on access alignments, such as + * /dev/raw, with a 512 byte alignment restriction. This also + * allows the data to be more aligned more strictly than on + * sector boundaries. This is needed for ubd-mmap, which needs + * the data to be page aligned. + * Fixed (finally!) the rounding bug + */ + +struct cow_header_v3 { + __u32 magic; + __u32 version; + time_t mtime; + __u64 size; + __u32 sectorsize; + __u32 alignment; + __u32 cow_format; + char backing_file[PATH_LEN_V3]; +}; + +/* COW format definitions - for now, we have only the usual COW bitmap */ +#define COW_BITMAP 0 + +union cow_header { + struct cow_header_v1 v1; + struct cow_header_v2 v2; + struct cow_header_v3 v3; +}; + +#define COW_MAGIC 0x4f4f4f4d /* MOOO */ +#define COW_VERSION 3 + +#define DIV_ROUND(x, len) (((x) + (len) - 1) / (len)) +#define ROUND_UP(x, align) DIV_ROUND(x, align) * (align) + +void cow_sizes(int version, __u64 size, int sectorsize, int align, + int bitmap_offset, unsigned long *bitmap_len_out, + int *data_offset_out) +{ + if(version < 3){ + *bitmap_len_out = (size + sectorsize - 1) / (8 * sectorsize); + + *data_offset_out = bitmap_offset + *bitmap_len_out; + *data_offset_out = (*data_offset_out + sectorsize - 1) / + sectorsize; + *data_offset_out *= sectorsize; + } + else { + *bitmap_len_out = DIV_ROUND(size, sectorsize); + *bitmap_len_out = DIV_ROUND(*bitmap_len_out, 8); + + *data_offset_out = bitmap_offset + *bitmap_len_out; + *data_offset_out = ROUND_UP(*data_offset_out, align); + } +} + +static int absolutize(char *to, int size, char *from) +{ + char save_cwd[256], *slash; + int remaining; + + if(getcwd(save_cwd, sizeof(save_cwd)) == NULL) { + cow_printf("absolutize : unable to get cwd - errno = %d\n", + errno); + return(-1); + } + slash = strrchr(from, '/'); + if(slash != NULL){ + *slash = '\0'; + if(chdir(from)){ + *slash = '/'; + cow_printf("absolutize : Can't cd to '%s' - " + "errno = %d\n", from, errno); + return(-1); + } + *slash = '/'; + if(getcwd(to, size) == NULL){ + cow_printf("absolutize : unable to get cwd of '%s' - " + "errno = %d\n", from, errno); + return(-1); + } + remaining = size - strlen(to); + if(strlen(slash) + 1 > remaining){ + cow_printf("absolutize : unable to fit '%s' into %d " + "chars\n", from, size); + return(-1); + } + strcat(to, slash); + } + else { + if(strlen(save_cwd) + 1 + strlen(from) + 1 > size){ + cow_printf("absolutize : unable to fit '%s' into %d " + "chars\n", from, size); + return(-1); + } + strcpy(to, save_cwd); + strcat(to, "/"); + strcat(to, from); + } + chdir(save_cwd); + return(0); +} + +int write_cow_header(char *cow_file, int fd, char *backing_file, + int sectorsize, int alignment, long long *size) +{ + struct cow_header_v3 *header; + unsigned long modtime; + int err; + + err = cow_seek_file(fd, 0); + if(err < 0){ + cow_printf("write_cow_header - lseek failed, err = %d\n", -err); + goto out; + } + + err = -ENOMEM; + header = cow_malloc(sizeof(*header)); + if(header == NULL){ + cow_printf("Failed to allocate COW V3 header\n"); + goto out; + } + header->magic = htonl(COW_MAGIC); + header->version = htonl(COW_VERSION); + + err = -EINVAL; + if(strlen(backing_file) > sizeof(header->backing_file) - 1){ + cow_printf("Backing file name \"%s\" is too long - names are " + "limited to %d characters\n", backing_file, + sizeof(header->backing_file) - 1); + goto out_free; + } + + if(absolutize(header->backing_file, sizeof(header->backing_file), + backing_file)) + goto out_free; + + err = os_file_modtime(header->backing_file, &modtime); + if(err < 0){ + cow_printf("Backing file '%s' mtime request failed, " + "err = %d\n", header->backing_file, -err); + goto out_free; + } + + err = cow_file_size(header->backing_file, size); + if(err < 0){ + cow_printf("Couldn't get size of backing file '%s', " + "err = %d\n", header->backing_file, -err); + goto out_free; + } + + header->mtime = htonl(modtime); + header->size = htonll(*size); + header->sectorsize = htonl(sectorsize); + header->alignment = htonl(alignment); + header->cow_format = COW_BITMAP; + + err = os_write_file(fd, header, sizeof(*header)); + if(err != sizeof(*header)){ + cow_printf("Write of header to new COW file '%s' failed, " + "err = %d\n", cow_file, -err); + goto out_free; + } + err = 0; + out_free: + cow_free(header); + out: + return(err); +} + +int file_reader(__u64 offset, char *buf, int len, void *arg) +{ + int fd = *((int *) arg); + + return(pread(fd, buf, len, offset)); +} + +/* XXX Need to sanity-check the values read from the header */ + +int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, + __u32 *version_out, char **backing_file_out, + time_t *mtime_out, __u64 *size_out, + int *sectorsize_out, __u32 *align_out, + int *bitmap_offset_out) +{ + union cow_header *header; + char *file; + int err, n; + unsigned long version, magic; + + header = cow_malloc(sizeof(*header)); + if(header == NULL){ + cow_printf("read_cow_header - Failed to allocate header\n"); + return(-ENOMEM); + } + err = -EINVAL; + n = (*reader)(0, (char *) header, sizeof(*header), arg); + if(n < offsetof(typeof(header->v1), backing_file)){ + cow_printf("read_cow_header - short header\n"); + goto out; + } + + magic = header->v1.magic; + if(magic == COW_MAGIC) { + version = header->v1.version; + } + else if(magic == ntohl(COW_MAGIC)){ + version = ntohl(header->v1.version); + } + /* No error printed because the non-COW case comes through here */ + else goto out; + + *version_out = version; + + if(version == 1){ + if(n < sizeof(header->v1)){ + cow_printf("read_cow_header - failed to read V1 " + "header\n"); + goto out; + } + *mtime_out = header->v1.mtime; + *size_out = header->v1.size; + *sectorsize_out = header->v1.sectorsize; + *bitmap_offset_out = sizeof(header->v1); + *align_out = *sectorsize_out; + file = header->v1.backing_file; + } + else if(version == 2){ + if(n < sizeof(header->v2)){ + cow_printf("read_cow_header - failed to read V2 " + "header\n"); + goto out; + } + *mtime_out = ntohl(header->v2.mtime); + *size_out = ntohll(header->v2.size); + *sectorsize_out = ntohl(header->v2.sectorsize); + *bitmap_offset_out = sizeof(header->v2); + *align_out = *sectorsize_out; + file = header->v2.backing_file; + } + else if(version == 3){ + if(n < sizeof(header->v3)){ + cow_printf("read_cow_header - failed to read V2 " + "header\n"); + goto out; + } + *mtime_out = ntohl(header->v3.mtime); + *size_out = ntohll(header->v3.size); + *sectorsize_out = ntohl(header->v3.sectorsize); + *align_out = ntohl(header->v3.alignment); + *bitmap_offset_out = ROUND_UP(sizeof(header->v3), *align_out); + file = header->v3.backing_file; + } + else { + cow_printf("read_cow_header - invalid COW version\n"); + goto out; + } + err = -ENOMEM; + *backing_file_out = cow_strdup(file); + if(*backing_file_out == NULL){ + cow_printf("read_cow_header - failed to allocate backing " + "file\n"); + goto out; + } + err = 0; + out: + cow_free(header); + return(err); +} + +int init_cow_file(int fd, char *cow_file, char *backing_file, int sectorsize, + int alignment, int *bitmap_offset_out, + unsigned long *bitmap_len_out, int *data_offset_out) +{ + __u64 size, offset; + char zero = 0; + int err; + + err = write_cow_header(cow_file, fd, backing_file, sectorsize, + alignment, &size); + if(err) + goto out; + + *bitmap_offset_out = ROUND_UP(sizeof(struct cow_header_v3), alignment); + cow_sizes(COW_VERSION, size, sectorsize, alignment, *bitmap_offset_out, + bitmap_len_out, data_offset_out); + + offset = *data_offset_out + size - sizeof(zero); + err = cow_seek_file(fd, offset); + if(err < 0){ + cow_printf("cow bitmap lseek failed : err = %d\n", -err); + goto out; + } + + /* does not really matter how much we write it is just to set EOF + * this also sets the entire COW bitmap + * to zero without having to allocate it + */ + err = cow_write_file(fd, &zero, sizeof(zero)); + if(err != sizeof(zero)){ + cow_printf("Write of bitmap to new COW file '%s' failed, " + "err = %d\n", cow_file, -err); + err = -EINVAL; + goto out; + } + + return(0); + + out: + return(err); +} + +/* + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/daemon.h --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/daemon.h 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#include "net_user.h" + +#define SWITCH_VERSION 3 + +struct daemon_data { + char *sock_type; + char *ctl_sock; + void *ctl_addr; + void *data_addr; + void *local_addr; + int fd; + int control; + void *dev; +}; + +extern struct net_user_info daemon_user_info; + +extern int daemon_user_write(int fd, void *buf, int len, + struct daemon_data *pri); + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/daemon_kern.c --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/daemon_kern.c 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) and + * James Leu (jleu@mindspring.net). + * Copyright (C) 2001 by various other people who didn't put their name here. + * Licensed under the GPL. + */ + +#include "linux/kernel.h" +#include "linux/init.h" +#include "linux/netdevice.h" +#include "linux/etherdevice.h" +#include "net_kern.h" +#include "net_user.h" +#include "daemon.h" + +struct daemon_init { + char *sock_type; + char *ctl_sock; +}; + +void daemon_init(struct net_device *dev, void *data) +{ + struct uml_net_private *pri; + struct daemon_data *dpri; + struct daemon_init *init = data; + + init_etherdev(dev, 0); + pri = dev->priv; + dpri = (struct daemon_data *) pri->user; + *dpri = ((struct daemon_data) + { .sock_type = init->sock_type, + .ctl_sock = init->ctl_sock, + .ctl_addr = NULL, + .data_addr = NULL, + .local_addr = NULL, + .fd = -1, + .control = -1, + .dev = dev }); + + printk("daemon backend (uml_switch version %d) - %s:%s", + SWITCH_VERSION, dpri->sock_type, dpri->ctl_sock); + printk("\n"); +} + +static int daemon_read(int fd, struct sk_buff **skb, + struct uml_net_private *lp) +{ + *skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER); + if(*skb == NULL) return(-ENOMEM); + return(net_recvfrom(fd, (*skb)->mac.raw, + (*skb)->dev->mtu + ETH_HEADER_OTHER)); +} + +static int daemon_write(int fd, struct sk_buff **skb, + struct uml_net_private *lp) +{ + return(daemon_user_write(fd, (*skb)->data, (*skb)->len, + (struct daemon_data *) &lp->user)); +} + +static struct net_kern_info daemon_kern_info = { + .init = daemon_init, + .protocol = eth_protocol, + .read = daemon_read, + .write = daemon_write, +}; + +int daemon_setup(char *str, char **mac_out, void *data) +{ + struct daemon_init *init = data; + char *remain; + + *init = ((struct daemon_init) + { .sock_type = "unix", + .ctl_sock = "/tmp/uml.ctl" }); + + remain = split_if_spec(str, mac_out, &init->sock_type, &init->ctl_sock, + NULL); + if(remain != NULL) + printk(KERN_WARNING "daemon_setup : Ignoring data socket " + "specification\n"); + + return(1); +} + +static struct transport daemon_transport = { + .list = LIST_HEAD_INIT(daemon_transport.list), + .name = "daemon", + .setup = daemon_setup, + .user = &daemon_user_info, + .kern = &daemon_kern_info, + .private_size = sizeof(struct daemon_data), + .setup_size = sizeof(struct daemon_init), +}; + +static int register_daemon(void) +{ + register_transport(&daemon_transport); + return(1); +} + +__initcall(register_daemon); + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/daemon_user.c --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/daemon_user.c 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,197 @@ +/* + * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) and + * James Leu (jleu@mindspring.net). + * Copyright (C) 2001 by various other people who didn't put their name here. + * Licensed under the GPL. + */ + +#include +#include +#include +#include +#include +#include +#include "net_user.h" +#include "daemon.h" +#include "kern_util.h" +#include "user_util.h" +#include "user.h" +#include "os.h" + +#define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) + +enum request_type { REQ_NEW_CONTROL }; + +#define SWITCH_MAGIC 0xfeedface + +struct request_v3 { + uint32_t magic; + uint32_t version; + enum request_type type; + struct sockaddr_un sock; +}; + +static struct sockaddr_un *new_addr(void *name, int len) +{ + struct sockaddr_un *sun; + + sun = um_kmalloc(sizeof(struct sockaddr_un)); + if(sun == NULL){ + printk("new_addr: allocation of sockaddr_un failed\n"); + return(NULL); + } + sun->sun_family = AF_UNIX; + memcpy(sun->sun_path, name, len); + return(sun); +} + +static int connect_to_switch(struct daemon_data *pri) +{ + struct sockaddr_un *ctl_addr = pri->ctl_addr; + struct sockaddr_un *local_addr = pri->local_addr; + struct sockaddr_un *sun; + struct request_v3 req; + int fd, n, err; + + pri->control = socket(AF_UNIX, SOCK_STREAM, 0); + if(pri->control < 0){ + printk("daemon_open : control socket failed, errno = %d\n", + errno); + return(-errno); + } + + if(connect(pri->control, (struct sockaddr *) ctl_addr, + sizeof(*ctl_addr)) < 0){ + printk("daemon_open : control connect failed, errno = %d\n", + errno); + err = -errno; + goto out; + } + + fd = socket(AF_UNIX, SOCK_DGRAM, 0); + if(fd < 0){ + printk("daemon_open : data socket failed, errno = %d\n", + errno); + err = -errno; + goto out; + } + if(bind(fd, (struct sockaddr *) local_addr, sizeof(*local_addr)) < 0){ + printk("daemon_open : data bind failed, errno = %d\n", + errno); + err = -errno; + goto out_close; + } + + sun = um_kmalloc(sizeof(struct sockaddr_un)); + if(sun == NULL){ + printk("new_addr: allocation of sockaddr_un failed\n"); + err = -ENOMEM; + goto out_close; + } + + req.magic = SWITCH_MAGIC; + req.version = SWITCH_VERSION; + req.type = REQ_NEW_CONTROL; + req.sock = *local_addr; + n = os_write_file(pri->control, &req, sizeof(req)); + if(n != sizeof(req)){ + printk("daemon_open : control setup request failed, err = %d\n", + -n); + err = -ENOTCONN; + goto out; + } + + n = os_read_file(pri->control, sun, sizeof(*sun)); + if(n != sizeof(*sun)){ + printk("daemon_open : read of data socket failed, err = %d\n", + -n); + err = -ENOTCONN; + goto out_close; + } + + pri->data_addr = sun; + return(fd); + + out_close: + os_close_file(fd); + out: + os_close_file(pri->control); + return(err); +} + +static void daemon_user_init(void *data, void *dev) +{ + struct daemon_data *pri = data; + struct timeval tv; + struct { + char zero; + int pid; + int usecs; + } name; + + if(!strcmp(pri->sock_type, "unix")) + pri->ctl_addr = new_addr(pri->ctl_sock, + strlen(pri->ctl_sock) + 1); + name.zero = 0; + name.pid = os_getpid(); + gettimeofday(&tv, NULL); + name.usecs = tv.tv_usec; + pri->local_addr = new_addr(&name, sizeof(name)); + pri->dev = dev; + pri->fd = connect_to_switch(pri); + if(pri->fd < 0){ + kfree(pri->local_addr); + pri->local_addr = NULL; + } +} + +static int daemon_open(void *data) +{ + struct daemon_data *pri = data; + return(pri->fd); +} + +static void daemon_remove(void *data) +{ + struct daemon_data *pri = data; + + os_close_file(pri->fd); + os_close_file(pri->control); + if(pri->data_addr != NULL) kfree(pri->data_addr); + if(pri->ctl_addr != NULL) kfree(pri->ctl_addr); + if(pri->local_addr != NULL) kfree(pri->local_addr); +} + +int daemon_user_write(int fd, void *buf, int len, struct daemon_data *pri) +{ + struct sockaddr_un *data_addr = pri->data_addr; + + return(net_sendto(fd, buf, len, data_addr, sizeof(*data_addr))); +} + +static int daemon_set_mtu(int mtu, void *data) +{ + return(mtu); +} + +struct net_user_info daemon_user_info = { + .init = daemon_user_init, + .open = daemon_open, + .close = NULL, + .remove = daemon_remove, + .set_mtu = daemon_set_mtu, + .add_address = NULL, + .delete_address = NULL, + .max_packet = MAX_PACKET - ETH_HEADER_OTHER +}; + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/fd.c --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/fd.c 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#include +#include +#include +#include +#include "user.h" +#include "user_util.h" +#include "chan_user.h" + +struct fd_chan { + int fd; + int raw; + struct termios tt; + char str[sizeof("1234567890\0")]; +}; + +void *fd_init(char *str, int device, struct chan_opts *opts) +{ + struct fd_chan *data; + char *end; + int n; + + if(*str != ':'){ + printk("fd_init : channel type 'fd' must specify a file " + "descriptor\n"); + return(NULL); + } + str++; + n = strtoul(str, &end, 0); + if((*end != '\0') || (end == str)){ + printk("fd_init : couldn't parse file descriptor '%s'\n", str); + return(NULL); + } + data = um_kmalloc(sizeof(*data)); + if(data == NULL) return(NULL); + *data = ((struct fd_chan) { .fd = n, + .raw = opts->raw }); + return(data); +} + +int fd_open(int input, int output, int primary, void *d, char **dev_out) +{ + struct fd_chan *data = d; + + if(data->raw && isatty(data->fd)){ + tcgetattr(data->fd, &data->tt); + raw(data->fd, 0); + } + sprintf(data->str, "%d", data->fd); + *dev_out = data->str; + return(data->fd); +} + +void fd_close(int fd, void *d) +{ + struct fd_chan *data = d; + + if(data->raw && isatty(fd)){ + tcsetattr(fd, TCSAFLUSH, &data->tt); + data->raw = 0; + } +} + +int fd_console_write(int fd, const char *buf, int n, void *d) +{ + struct fd_chan *data = d; + + return(generic_console_write(fd, buf, n, &data->tt)); +} + +struct chan_ops fd_ops = { + .type = "fd", + .init = fd_init, + .open = fd_open, + .close = fd_close, + .read = generic_read, + .write = generic_write, + .console_write = fd_console_write, + .window_size = generic_window_size, + .free = generic_free, + .winch = 1, +}; + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/harddog_kern.c --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/harddog_kern.c 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,194 @@ +/* UML hardware watchdog, shamelessly stolen from: + * + * SoftDog 0.05: A Software Watchdog Device + * + * (c) Copyright 1996 Alan Cox , All Rights Reserved. + * http://www.redhat.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide + * warranty for any of this software. This material is provided + * "AS-IS" and at no charge. + * + * (c) Copyright 1995 Alan Cox + * + * Software only watchdog driver. Unlike its big brother the WDT501P + * driver this won't always recover a failed machine. + * + * 03/96: Angelo Haritsis : + * Modularised. + * Added soft_margin; use upon insmod to change the timer delay. + * NB: uses same minor as wdt (WATCHDOG_MINOR); we could use separate + * minors. + * + * 19980911 Alan Cox + * Made SMP safe for 2.3.x + * + * 20011127 Joel Becker (jlbec@evilplan.org> + * Added soft_noboot; Allows testing the softdog trigger without + * requiring a recompile. + * Added WDIOC_GETTIMEOUT and WDIOC_SETTIMOUT. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "helper.h" +#include "mconsole.h" + +MODULE_LICENSE("GPL"); + +/* Locked by the BKL in harddog_open and harddog_release */ +static int timer_alive; +static int harddog_in_fd = -1; +static int harddog_out_fd = -1; + +/* + * Allow only one person to hold it open + */ + +extern int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock); + +static int harddog_open(struct inode *inode, struct file *file) +{ + int err; + char *sock = NULL; + + lock_kernel(); + if(timer_alive) + return -EBUSY; +#ifdef CONFIG_HARDDOG_NOWAYOUT + MOD_INC_USE_COUNT; +#endif + +#ifdef CONFIG_MCONSOLE + sock = mconsole_notify_socket(); +#endif + err = start_watchdog(&harddog_in_fd, &harddog_out_fd, sock); + if(err) return(err); + + timer_alive = 1; + unlock_kernel(); + return 0; +} + +extern void stop_watchdog(int in_fd, int out_fd); + +static int harddog_release(struct inode *inode, struct file *file) +{ + /* + * Shut off the timer. + */ + lock_kernel(); + + stop_watchdog(harddog_in_fd, harddog_out_fd); + harddog_in_fd = -1; + harddog_out_fd = -1; + + timer_alive=0; + unlock_kernel(); + return 0; +} + +extern int ping_watchdog(int fd); + +static ssize_t harddog_write(struct file *file, const char *data, size_t len, + loff_t *ppos) +{ + /* Can't seek (pwrite) on this device */ + if (ppos != &file->f_pos) + return -ESPIPE; + + /* + * Refresh the timer. + */ + if(len) + return(ping_watchdog(harddog_out_fd)); + return 0; +} + +static int harddog_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + static struct watchdog_info ident = { + WDIOF_SETTIMEOUT, + 0, + "UML Hardware Watchdog" + }; + switch (cmd) { + default: + return -ENOTTY; + case WDIOC_GETSUPPORT: + if(copy_to_user((struct harddog_info *)arg, &ident, + sizeof(ident))) + return -EFAULT; + return 0; + case WDIOC_GETSTATUS: + case WDIOC_GETBOOTSTATUS: + return put_user(0,(int *)arg); + case WDIOC_KEEPALIVE: + return(ping_watchdog(harddog_out_fd)); + } +} + +static struct file_operations harddog_fops = { + .owner = THIS_MODULE, + .write = harddog_write, + .ioctl = harddog_ioctl, + .open = harddog_open, + .release = harddog_release, +}; + +static struct miscdevice harddog_miscdev = { + .minor = WATCHDOG_MINOR, + .name = "watchdog", + .fops = &harddog_fops, +}; + +static char banner[] __initdata = KERN_INFO "UML Watchdog Timer\n"; + +static int __init harddog_init(void) +{ + int ret; + + ret = misc_register(&harddog_miscdev); + + if (ret) + return ret; + + printk(banner); + + return(0); +} + +static void __exit harddog_exit(void) +{ + misc_deregister(&harddog_miscdev); +} + +module_init(harddog_init); +module_exit(harddog_exit); + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/harddog_user.c --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/harddog_user.c 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#include +#include +#include +#include "user_util.h" +#include "user.h" +#include "helper.h" +#include "mconsole.h" +#include "os.h" +#include "choose-mode.h" +#include "mode.h" + +struct dog_data { + int stdin; + int stdout; + int close_me[2]; +}; + +static void pre_exec(void *d) +{ + struct dog_data *data = d; + + dup2(data->stdin, 0); + dup2(data->stdout, 1); + dup2(data->stdout, 2); + os_close_file(data->stdin); + os_close_file(data->stdout); + os_close_file(data->close_me[0]); + os_close_file(data->close_me[1]); +} + +int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock) +{ + struct dog_data data; + int in_fds[2], out_fds[2], pid, n, err; + char pid_buf[sizeof("nnnnn\0")], c; + char *pid_args[] = { "/usr/bin/uml_watchdog", "-pid", pid_buf, NULL }; + char *mconsole_args[] = { "/usr/bin/uml_watchdog", "-mconsole", NULL, + NULL }; + char **args = NULL; + + err = os_pipe(in_fds, 1, 0); + if(err < 0){ + printk("harddog_open - os_pipe failed, err = %d\n", -err); + goto out; + } + + err = os_pipe(out_fds, 1, 0); + if(err < 0){ + printk("harddog_open - os_pipe failed, err = %d\n", -err); + goto out_close_in; + } + + data.stdin = out_fds[0]; + data.stdout = in_fds[1]; + data.close_me[0] = out_fds[1]; + data.close_me[1] = in_fds[0]; + + if(sock != NULL){ + mconsole_args[2] = sock; + args = mconsole_args; + } + else { + /* XXX The os_getpid() is not SMP correct */ + sprintf(pid_buf, "%d", CHOOSE_MODE(tracing_pid, os_getpid())); + args = pid_args; + } + + pid = run_helper(pre_exec, &data, args, NULL); + + os_close_file(out_fds[0]); + os_close_file(in_fds[1]); + + if(pid < 0){ + err = -pid; + printk("harddog_open - run_helper failed, errno = %d\n", -err); + goto out_close_out; + } + + n = os_read_file(in_fds[0], &c, sizeof(c)); + if(n == 0){ + printk("harddog_open - EOF on watchdog pipe\n"); + helper_wait(pid); + err = -EIO; + goto out_close_out; + } + else if(n < 0){ + printk("harddog_open - read of watchdog pipe failed, " + "err = %d\n", -n); + helper_wait(pid); + err = n; + goto out_close_out; + } + *in_fd_ret = in_fds[0]; + *out_fd_ret = out_fds[1]; + return(0); + + out_close_in: + os_close_file(in_fds[0]); + os_close_file(in_fds[1]); + out_close_out: + os_close_file(out_fds[0]); + os_close_file(out_fds[1]); + out: + return(err); +} + +void stop_watchdog(int in_fd, int out_fd) +{ + os_close_file(in_fd); + os_close_file(out_fd); +} + +int ping_watchdog(int fd) +{ + int n; + char c = '\n'; + + n = os_write_file(fd, &c, sizeof(c)); + if(n != sizeof(c)){ + printk("ping_watchdog - write failed, err = %d\n", -n); + if(n < 0) + return(n); + return(-EIO); + } + return 1; + +} + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -puN /dev/null arch/um/drivers/hostaudio_kern.c --- /dev/null 2005-04-15 01:44:05.698330744 +0200 +++ um-linux-2.4.27-paolo/arch/um/drivers/hostaudio_kern.c 2005-04-15 11:12:33.000000000 +0200 @@ -0,0 +1,352 @@ +/* + * Copyright (C) 2002 Steve Schmidtke + * Licensed under the GPL + */ + +#include "linux/config.h" +#include "linux/module.h" +#include "linux/init.h" +#include "linux/slab.h" +#include "linux/fs.h" +#include "linux/sound.h" +#include "linux/soundcard.h" +#include "asm/uaccess.h" +#include "kern_util.h" +#include "init.h" +#include "os.h" + +struct hostaudio_state { + int fd; +}; + +struct hostmixer_state { + int fd; +}; + +#define HOSTAUDIO_DEV_DSP "/dev/sound/dsp" +#define HOSTAUDIO_DEV_MIXER "/dev/sound/mixer" + +/* Only changed from linux_main at boot time */ +char *dsp = HOSTAUDIO_DEV_DSP; +char *mixer = HOSTAUDIO_DEV_MIXER; + +#define DSP_HELP \ +" This is used to specify the host dsp device to the hostaudio driver.\n" \ +" The default is \"" HOSTAUDIO_DEV_DSP "\".\n\n" + +#define MIXER_HELP \ +" This is used to specify the host mixer device to the hostaudio driver.\n" \ +" The default is \"" HOSTAUDIO_DEV_MIXER "\".\n\n" + +#ifndef MODULE +static int set_dsp(char *name, int *add) +{ + dsp = name; + return(0); +} + +__uml_setup("dsp=", set_dsp, "dsp=\n" DSP_HELP); + +static int set_mixer(char *name, int *add) +{ + mixer = name; + return(0); +} + +__uml_setup("mixer=", set_mixer, "mixer=\n" MIXER_HELP); + +#else /*MODULE*/ + +MODULE_PARM(dsp, "s"); +MODULE_PARM_DESC(dsp, DSP_HELP); + +MODULE_PARM(mixer, "s"); +MODULE_PARM_DESC(mixer, MIXER_HELP); + +#endif + +/* /dev/dsp file operations */ + +static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count, + loff_t *ppos) +{ + struct hostaudio_state *state = file->private_data; + void *kbuf; + int err; + +#ifdef DEBUG + printk("hostaudio: read called, count = %d\n", count); +#endif + + kbuf = kmalloc(count, GFP_KERNEL); + if(kbuf == NULL) + return(-ENOMEM); + + err = os_read_file(state->fd, kbuf, count); + if(err < 0) + goto out; + + if(copy_to_user(buffer, kbuf, err)) + err = -EFAULT; + + out: + kfree(kbuf); + return(err); +} + +static ssize_t hostaudio_write(struct file *file, const char *buffer, + size_t count, loff_t *ppos) +{ + struct hostaudio_state *state = file->private_data; + void *kbuf; + int err; + +#ifdef DEBUG + printk("hostaudio: write called, count = %d\n", count); +#endif + + kbuf = kmalloc(count, GFP_KERNEL); + if(kbuf == NULL) + return(-ENOMEM); + + err = -EFAULT; + if(copy_from_user(kbuf, buffer, count)) + goto out; + + err = os_write_file(state->fd, kbuf, count); + if(err < 0) + goto out; + *ppos += err; + + out: + kfree(kbuf); + return(err); +} + +static unsigned int hostaudio_poll(struct file *file, + struct poll_table_struct *wait) +{ + unsigned int mask = 0; + +#ifdef DEBUG + printk("hostaudio: poll called (unimplemented)\n"); +#endif + + return(mask); +} + +static int hostaudio_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + struct hostaudio_state *state = file->private_data; + unsigned long data = 0; + int err; + +#ifdef DEBUG + printk("hostaudio: ioctl called, cmd = %u\n", cmd); +#endif + switch(cmd){ + case SNDCTL_DSP_SPEED: + case SNDCTL_DSP_STEREO: + case SNDCTL_DSP_GETBLKSIZE: + case SNDCTL_DSP_CHANNELS: + case SNDCTL_DSP_SUBDIVIDE: + case SNDCTL_DSP_SETFRAGMENT: + if(get_user(data, (int *) arg)) + return(-EFAULT); + break; + default: + break; + } + + err = os_ioctl_generic(state->fd, cmd, (unsigned long) &data); + + switch(cmd){ + case SNDCTL_DSP_SPEED: + case SNDCTL_DSP_STEREO: + case SNDCTL_DSP_GETBLKSIZE: + case SNDCTL_DSP_CHANNELS: + case SNDCTL_DSP_SUBDIVIDE: + case SNDCTL_DSP_SETFRAGMENT: + if(put_user(data, (int *) arg)) + return(-EFAULT); + break; + default: + break; + } + + return(err); +} + +static int hostaudio_open(struct inode *inode, struct file *file) +{ + struct hostaudio_state *state; + int r = 0, w = 0; + int ret; + +#ifdef DEBUG + printk("hostaudio: open called (host: %s)\n", dsp); +#endif + + state = kmalloc(sizeof(struct hostaudio_state), GFP_KERNEL); + if(state == NULL) + return(-ENOMEM); + + if(file->f_mode & FMODE_READ) r = 1; + if(file->f_mode & FMODE_WRITE) w = 1; + + ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0); + if(ret < 0){ + kfree(state); + return(ret); + } + + state->fd = ret; + file->private_data = state; + return(0); +} + +static int hostaudio_release(struct inode *inode, struct file *file) +{ + struct hostaudio_state *state = file->private_data; + +#ifdef DEBUG + printk("hostaudio: release called\n"); +#endif + + os_close_file(state->fd); + kfree(state); + + return(0); +} + +/* /dev/mixer file operations */ + +static int hostmixer_ioctl_mixdev(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + struct hostmixer_state *state = file->private_data; + +#ifdef DEBUG + printk("hostmixer: ioctl called\n"); +#endif + + return(os_ioctl_generic(state->fd, cmd, arg)); +} + +static int hostmixer_open_mixdev(struct inode *inode, struct file *file) +{ + struct hostmixer_state *state; + int r = 0, w = 0; + int ret; + +#ifdef DEBUG + printk("hostmixer: open called (host: %s)\n", mixer); +#endif + + state = kmalloc(sizeof(struct hostmixer_state), GFP_KERNEL); + if(state == NULL) return(-ENOMEM); + + if(file->f_mode & FMODE_READ) r = 1; + if(file->f_mode & FMODE_WRITE) w = 1; + + ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0); + + if(ret < 0){ + printk("hostaudio_open_mixdev failed to open '%s', err = %d\n", + dsp, -ret); + kfree(state); + return(ret); + } + + file->private_data = state; + return(0); +} + +static int hostmixer_release(struct inode *inode, struct file *file) +{ + struct hostmixer_state *state = file->private_data; + +#ifdef DEBUG + printk("hostmixer: release called\n"); +#endif + + os_close_file(state->fd); + kfree(state); + + return(0); +} + + +/* kernel module operations */ + +static struct file_operations hostaudio_fops = { + .owner = THIS_MODULE, + .llseek = no_llseek, + .read = hostaudio_read, + .write = hostaudio_write, + .poll = hostaudio_poll, + .ioctl = hostaudio_ioctl, + .mmap = NULL, + .open = hostaudio_open, + .release = hostaudio_release, +}; + +static struct file_operations hostmixer_fops = { + .owner = THIS_MODULE, + .llseek = no_llseek, + .ioctl = hostmixer_ioctl_mixdev, + .open = hostmixer_open_mixdev, + .release = hostmixer_release, +}; + +struct { + int dev_audio; + int dev_mixer; +} module_data; + +MODULE_AUTHOR("Steve Schmidtke"); +MODULE_DESCRIPTION("UML Audio Relay"); +MODULE_LICENSE("GPL"); + +static int __init hostaudio_init_module(void) +{ + printk(KERN_INFO "UML Audio Relay (host dsp = %s, host mixer = %s)\n", + dsp, mixer); + + module_data.dev_audio = register_sound_dsp(&hostaudio_fops, -1); + if(module_data.dev_audio < 0){ + printk(KERN_ERR "hostaudio: couldn't register DSP device!\n"); + return -ENODEV; + } + + module_data.dev_mixer = register_sound_mixer(&hostmixer_fops, -1); + if(module_data.dev_mixer < 0){ + printk(KERN_ERR "hostmixer: couldn't register mixer " + "device!\n"); + unregister_sound_dsp(module_data.dev_audio); + return -ENODEV; + } + + return 0; +} + +static void __exit hostaudio_cleanup_module (void) +{ + unregister_sound_mixer(module_data.dev_mixer); + unregister_sound_dsp(module_data.dev_audio); +} + +module_init(hostaudio_init_module); +module_exit(hostaudio_cleanup_module); + +/* + * Overrides for Emacs so that we follow Linus's tabbing