Explorar o código

Merge branch 'for-linus' of git://github.com/richardweinberger/linux

* 'for-linus' of git://github.com/richardweinberger/linux: (90 commits)
  um: fix ubd cow size
  um: Fix kmalloc argument order in um/vdso/vma.c
  um: switch to use of drivers/Kconfig
  UserModeLinux-HOWTO.txt: fix a typo
  UserModeLinux-HOWTO.txt: remove ^H characters
  um: we need sys/user.h only on i386
  um: merge delay_{32,64}.c
  um: distribute exports to where exported stuff is defined
  um: kill system-um.h
  um: generic ftrace.h will do...
  um: segment.h is x86-only and needed only there
  um: asm/pda.h is not needed anymore
  um: hw_irq.h can go generic as well
  um: switch to generic-y
  um: clean Kconfig up a bit
  um: a couple of missing dependencies...
  um: kill useless argument of free_chan() and free_one_chan()
  um: unify ptrace_user.h
  um: unify KSTK_...
  um: fix gcov build breakage
  ...
Linus Torvalds %!s(int64=13) %!d(string=hai) anos
pai
achega
de0a5345a5
Modificáronse 100 ficheiros con 549 adicións e 1077 borrados
  1. 266 266
      Documentation/virtual/uml/UserModeLinux-HOWTO.txt
  2. 1 113
      arch/um/Kconfig.char
  3. 1 22
      arch/um/Kconfig.rest
  4. 6 0
      arch/um/Kconfig.um
  5. 26 23
      arch/um/Makefile
  6. 0 26
      arch/um/Makefile-x86_64
  7. 3 3
      arch/um/drivers/chan.h
  8. 6 6
      arch/um/drivers/chan_kern.c
  9. 6 3
      arch/um/drivers/chan_user.c
  10. 0 0
      arch/um/drivers/chan_user.h
  11. 0 1
      arch/um/drivers/cow_sys.h
  12. 0 1
      arch/um/drivers/daemon_user.c
  13. 0 2
      arch/um/drivers/fd.c
  14. 0 1
      arch/um/drivers/harddog_user.c
  15. 1 1
      arch/um/drivers/line.c
  16. 0 0
      arch/um/drivers/line.h
  17. 0 0
      arch/um/drivers/mconsole.h
  18. 0 0
      arch/um/drivers/mconsole_kern.h
  19. 0 2
      arch/um/drivers/mconsole_user.c
  20. 0 2
      arch/um/drivers/net_user.c
  21. 0 2
      arch/um/drivers/pcap_user.c
  22. 0 2
      arch/um/drivers/port_user.c
  23. 0 2
      arch/um/drivers/pty.c
  24. 0 2
      arch/um/drivers/slip_user.c
  25. 0 2
      arch/um/drivers/slirp_user.c
  26. 1 3
      arch/um/drivers/ssl.c
  27. 1 2
      arch/um/drivers/stdio_console.c
  28. 0 2
      arch/um/drivers/tty.c
  29. 30 3
      arch/um/drivers/ubd_kern.c
  30. 0 1
      arch/um/drivers/ubd_user.c
  31. 0 0
      arch/um/drivers/ubd_user.h
  32. 0 2
      arch/um/drivers/umcast_user.c
  33. 0 2
      arch/um/drivers/vde_user.c
  34. 0 2
      arch/um/drivers/xterm.c
  35. 3 0
      arch/um/include/asm/Kbuild
  36. 0 6
      arch/um/include/asm/bug.h
  37. 0 6
      arch/um/include/asm/checksum.h
  38. 0 6
      arch/um/include/asm/cputime.h
  39. 0 7
      arch/um/include/asm/device.h
  40. 0 6
      arch/um/include/asm/emergency-restart.h
  41. 0 1
      arch/um/include/asm/ftrace.h
  42. 0 6
      arch/um/include/asm/futex.h
  43. 0 1
      arch/um/include/asm/hardirq.h
  44. 0 7
      arch/um/include/asm/hw_irq.h
  45. 0 1
      arch/um/include/asm/irq_regs.h
  46. 37 1
      arch/um/include/asm/irqflags.h
  47. 0 1
      arch/um/include/asm/kdebug.h
  48. 17 5
      arch/um/include/asm/mmu.h
  49. 2 5
      arch/um/include/asm/mmu_context.h
  50. 1 1
      arch/um/include/asm/page.h
  51. 0 1
      arch/um/include/asm/page_offset.h
  52. 0 21
      arch/um/include/asm/pda.h
  53. 0 6
      arch/um/include/asm/percpu.h
  54. 0 7
      arch/um/include/asm/ptrace-generic.h
  55. 0 7
      arch/um/include/asm/sections.h
  56. 0 47
      arch/um/include/asm/system.h
  57. 0 6
      arch/um/include/asm/topology.h
  58. 84 5
      arch/um/include/asm/uaccess.h
  59. 0 6
      arch/um/include/asm/xor.h
  60. 1 1
      arch/um/include/shared/as-layout.h
  61. 0 1
      arch/um/include/shared/common-offsets.h
  62. 0 12
      arch/um/include/shared/initrd.h
  63. 0 18
      arch/um/include/shared/kern.h
  64. 0 1
      arch/um/include/shared/kern_util.h
  65. 0 37
      arch/um/include/shared/ldt.h
  66. 0 20
      arch/um/include/shared/mem_kern.h
  67. 1 12
      arch/um/include/shared/os.h
  68. 0 17
      arch/um/include/shared/process.h
  69. 2 1
      arch/um/include/shared/ptrace_user.h
  70. 0 6
      arch/um/include/shared/skas_ptregs.h
  71. 0 12
      arch/um/include/shared/syscall.h
  72. 0 9
      arch/um/include/shared/task.h
  73. 0 15
      arch/um/include/shared/tlb.h
  74. 1 1
      arch/um/include/shared/um_malloc.h
  75. 0 24
      arch/um/include/shared/um_mmu.h
  76. 0 97
      arch/um/include/shared/um_uaccess.h
  77. 4 3
      arch/um/include/shared/user.h
  78. 1 1
      arch/um/kernel/Makefile
  79. 10 8
      arch/um/kernel/exec.c
  80. 0 15
      arch/um/kernel/gmon_syms.c
  81. 2 2
      arch/um/kernel/initrd.c
  82. 1 0
      arch/um/kernel/irq.c
  83. 1 37
      arch/um/kernel/ksyms.c
  84. 2 0
      arch/um/kernel/mem.c
  85. 12 9
      arch/um/kernel/physmem.c
  86. 3 1
      arch/um/kernel/process.c
  87. 0 1
      arch/um/kernel/signal.c
  88. 0 1
      arch/um/kernel/skas/clone.c
  89. 6 0
      arch/um/kernel/skas/uaccess.c
  90. 3 2
      arch/um/kernel/tlb.c
  91. 2 1
      arch/um/kernel/trap.c
  92. 0 33
      arch/um/kernel/uaccess.c
  93. 2 0
      arch/um/kernel/um_arch.c
  94. 3 3
      arch/um/os-Linux/Makefile
  95. 0 2
      arch/um/os-Linux/aio.c
  96. 0 2
      arch/um/os-Linux/drivers/ethertap_user.c
  97. 0 2
      arch/um/os-Linux/drivers/tuntap_user.c
  98. 0 1
      arch/um/os-Linux/elf_aux.c
  99. 0 2
      arch/um/os-Linux/file.c
  100. 0 2
      arch/um/os-Linux/helper.c

+ 266 - 266
Documentation/virtual/uml/UserModeLinux-HOWTO.txt

@@ -134,13 +134,13 @@
 
 
   ______________________________________________________________________
   ______________________________________________________________________
 
 
-  11..  IInnttrroodduuccttiioonn
+  1.  Introduction
 
 
   Welcome to User Mode Linux.  It's going to be fun.
   Welcome to User Mode Linux.  It's going to be fun.
 
 
 
 
 
 
-  11..11..  HHooww iiss UUsseerr MMooddee LLiinnuuxx DDiiffffeerreenntt??
+  1.1.  How is User Mode Linux Different?
 
 
   Normally, the Linux Kernel talks straight to your hardware (video
   Normally, the Linux Kernel talks straight to your hardware (video
   card, keyboard, hard drives, etc), and any programs which run ask the
   card, keyboard, hard drives, etc), and any programs which run ask the
@@ -181,7 +181,7 @@
 
 
 
 
 
 
-  11..22..  WWhhyy WWoouulldd II WWaanntt UUsseerr MMooddee LLiinnuuxx??
+  1.2.  Why Would I Want User Mode Linux?
 
 
 
 
   1. If User Mode Linux crashes, your host kernel is still fine.
   1. If User Mode Linux crashes, your host kernel is still fine.
@@ -206,12 +206,12 @@
 
 
 
 
 
 
-  22..  CCoommppiilliinngg tthhee kkeerrnneell aanndd mmoodduulleess
+  2.  Compiling the kernel and modules
 
 
 
 
 
 
 
 
-  22..11..  CCoommppiilliinngg tthhee kkeerrnneell
+  2.1.  Compiling the kernel
 
 
 
 
   Compiling the user mode kernel is just like compiling any other
   Compiling the user mode kernel is just like compiling any other
@@ -322,7 +322,7 @@
   bug fixes and enhancements that have gone into subsequent releases.
   bug fixes and enhancements that have gone into subsequent releases.
 
 
 
 
-  22..22..  CCoommppiilliinngg aanndd iinnssttaalllliinngg kkeerrnneell mmoodduulleess
+  2.2.  Compiling and installing kernel modules
 
 
   UML modules are built in the same way as the native kernel (with the
   UML modules are built in the same way as the native kernel (with the
   exception of the 'ARCH=um' that you always need for UML):
   exception of the 'ARCH=um' that you always need for UML):
@@ -386,19 +386,19 @@
 
 
 
 
 
 
-  22..33..  CCoommppiilliinngg aanndd iinnssttaalllliinngg uummll__uuttiilliittiieess
+  2.3.  Compiling and installing uml_utilities
 
 
   Many features of the UML kernel require a user-space helper program,
   Many features of the UML kernel require a user-space helper program,
   so a uml_utilities package is distributed separately from the kernel
   so a uml_utilities package is distributed separately from the kernel
   patch which provides these helpers. Included within this is:
   patch which provides these helpers. Included within this is:
 
 
-  +o  port-helper - Used by consoles which connect to xterms or ports
+  o  port-helper - Used by consoles which connect to xterms or ports
 
 
-  +o  tunctl - Configuration tool to create and delete tap devices
+  o  tunctl - Configuration tool to create and delete tap devices
 
 
-  +o  uml_net - Setuid binary for automatic tap device configuration
+  o  uml_net - Setuid binary for automatic tap device configuration
 
 
-  +o  uml_switch - User-space virtual switch required for daemon
+  o  uml_switch - User-space virtual switch required for daemon
      transport
      transport
 
 
      The uml_utilities tree is compiled with:
      The uml_utilities tree is compiled with:
@@ -423,11 +423,11 @@
 
 
 
 
 
 
-  33..  RRuunnnniinngg UUMMLL aanndd llooggggiinngg iinn
+  3.  Running UML and logging in
 
 
 
 
 
 
-  33..11..  RRuunnnniinngg UUMMLL
+  3.1.  Running UML
 
 
   It runs on 2.2.15 or later, and all 2.4 kernels.
   It runs on 2.2.15 or later, and all 2.4 kernels.
 
 
@@ -454,7 +454,7 @@
 
 
 
 
 
 
-  33..22..  LLooggggiinngg iinn
+  3.2.  Logging in
 
 
 
 
 
 
@@ -468,7 +468,7 @@
 
 
   There are a couple of other ways to log in:
   There are a couple of other ways to log in:
 
 
-  +o  On a virtual console
+  o  On a virtual console
 
 
 
 
 
 
@@ -480,7 +480,7 @@
 
 
 
 
 
 
-  +o  Over the serial line
+  o  Over the serial line
 
 
 
 
      In the boot output, find a line that looks like:
      In the boot output, find a line that looks like:
@@ -503,7 +503,7 @@
 
 
 
 
 
 
-  +o  Over the net
+  o  Over the net
 
 
 
 
      If the network is running, then you can telnet to the virtual
      If the network is running, then you can telnet to the virtual
@@ -514,13 +514,13 @@
   down and the process will exit.
   down and the process will exit.
 
 
 
 
-  33..33..  EExxaammpplleess
+  3.3.  Examples
 
 
   Here are some examples of UML in action:
   Here are some examples of UML in action:
 
 
-  +o  A login session <http://user-mode-linux.sourceforge.net/login.html>
+  o  A login session <http://user-mode-linux.sourceforge.net/login.html>
 
 
-  +o  A virtual network <http://user-mode-linux.sourceforge.net/net.html>
+  o  A virtual network <http://user-mode-linux.sourceforge.net/net.html>
 
 
 
 
 
 
@@ -528,12 +528,12 @@
 
 
 
 
 
 
-  44..  UUMMLL oonn 22GG//22GG hhoossttss
+  4.  UML on 2G/2G hosts
 
 
 
 
 
 
 
 
-  44..11..  IInnttrroodduuccttiioonn
+  4.1.  Introduction
 
 
 
 
   Most Linux machines are configured so that the kernel occupies the
   Most Linux machines are configured so that the kernel occupies the
@@ -546,7 +546,7 @@
 
 
 
 
 
 
-  44..22..  TThhee pprroobblleemm
+  4.2.  The problem
 
 
 
 
   The prebuilt UML binaries on this site will not run on 2G/2G hosts
   The prebuilt UML binaries on this site will not run on 2G/2G hosts
@@ -558,7 +558,7 @@
 
 
 
 
 
 
-  44..33..  TThhee ssoolluuttiioonn
+  4.3.  The solution
 
 
 
 
   The fix for this is to rebuild UML from source after enabling
   The fix for this is to rebuild UML from source after enabling
@@ -576,7 +576,7 @@
 
 
 
 
 
 
-  55..  SSeettttiinngg uupp sseerriiaall lliinneess aanndd ccoonnssoolleess
+  5.  Setting up serial lines and consoles
 
 
 
 
   It is possible to attach UML serial lines and consoles to many types
   It is possible to attach UML serial lines and consoles to many types
@@ -586,12 +586,12 @@
   You can attach them to host ptys, ttys, file descriptors, and ports.
   You can attach them to host ptys, ttys, file descriptors, and ports.
   This allows you to do things like
   This allows you to do things like
 
 
-  +o  have a UML console appear on an unused host console,
+  o  have a UML console appear on an unused host console,
 
 
-  +o  hook two virtual machines together by having one attach to a pty
+  o  hook two virtual machines together by having one attach to a pty
      and having the other attach to the corresponding tty
      and having the other attach to the corresponding tty
 
 
-  +o  make a virtual machine accessible from the net by attaching a
+  o  make a virtual machine accessible from the net by attaching a
      console to a port on the host.
      console to a port on the host.
 
 
 
 
@@ -599,7 +599,7 @@
 
 
 
 
 
 
-  55..11..  SSppeecciiffyyiinngg tthhee ddeevviiccee
+  5.1.  Specifying the device
 
 
   Devices are specified with "con" or "ssl" (console or serial line,
   Devices are specified with "con" or "ssl" (console or serial line,
   respectively), optionally with a device number if you are talking
   respectively), optionally with a device number if you are talking
@@ -626,13 +626,13 @@
 
 
 
 
 
 
-  55..22..  SSppeecciiffyyiinngg tthhee cchhaannnneell
+  5.2.  Specifying the channel
 
 
   There are a number of different types of channels to attach a UML
   There are a number of different types of channels to attach a UML
   device to, each with a different way of specifying exactly what to
   device to, each with a different way of specifying exactly what to
   attach to.
   attach to.
 
 
-  +o  pseudo-terminals - device=pty pts terminals - device=pts
+  o  pseudo-terminals - device=pty pts terminals - device=pts
 
 
 
 
      This will cause UML to allocate a free host pseudo-terminal for the
      This will cause UML to allocate a free host pseudo-terminal for the
@@ -640,20 +640,20 @@
      log.  You access it by attaching a terminal program to the
      log.  You access it by attaching a terminal program to the
      corresponding tty:
      corresponding tty:
 
 
-  +o  screen /dev/pts/n
+  o  screen /dev/pts/n
 
 
-  +o  screen /dev/ttyxx
+  o  screen /dev/ttyxx
 
 
-  +o  minicom -o -p /dev/ttyxx - minicom seems not able to handle pts
+  o  minicom -o -p /dev/ttyxx - minicom seems not able to handle pts
      devices
      devices
 
 
-  +o  kermit - start it up, 'open' the device, then 'connect'
+  o  kermit - start it up, 'open' the device, then 'connect'
 
 
 
 
 
 
 
 
 
 
-  +o  terminals - device=tty:tty device file
+  o  terminals - device=tty:tty device file
 
 
 
 
      This will make UML attach the device to the specified tty (i.e
      This will make UML attach the device to the specified tty (i.e
@@ -672,7 +672,7 @@
 
 
 
 
 
 
-  +o  xterms - device=xterm
+  o  xterms - device=xterm
 
 
 
 
      UML will run an xterm and the device will be attached to it.
      UML will run an xterm and the device will be attached to it.
@@ -681,7 +681,7 @@
 
 
 
 
 
 
-  +o  Port - device=port:port number
+  o  Port - device=port:port number
 
 
 
 
      This will attach the UML devices to the specified host port.
      This will attach the UML devices to the specified host port.
@@ -725,7 +725,7 @@
 
 
 
 
 
 
-  +o  already-existing file descriptors - device=file descriptor
+  o  already-existing file descriptors - device=file descriptor
 
 
 
 
      If you set up a file descriptor on the UML command line, you can
      If you set up a file descriptor on the UML command line, you can
@@ -743,7 +743,7 @@
 
 
 
 
 
 
-  +o  Nothing - device=null
+  o  Nothing - device=null
 
 
 
 
      This allows the device to be opened, in contrast to 'none', but
      This allows the device to be opened, in contrast to 'none', but
@@ -754,7 +754,7 @@
 
 
 
 
 
 
-  +o  None - device=none
+  o  None - device=none
 
 
 
 
      This causes the device to disappear.
      This causes the device to disappear.
@@ -770,7 +770,7 @@
 
 
 
 
 
 
-  will cause serial line 3 to accept input on the host's /dev/tty3 and
+  will cause serial line 3 to accept input on the host's /dev/tty2 and
   display output on an xterm.  That's a silly example - the most common
   display output on an xterm.  That's a silly example - the most common
   use of this syntax is to reattach the main console to stdin and stdout
   use of this syntax is to reattach the main console to stdin and stdout
   as shown above.
   as shown above.
@@ -785,7 +785,7 @@
 
 
 
 
 
 
-  55..33..  EExxaammpplleess
+  5.3.  Examples
 
 
   There are a number of interesting things you can do with this
   There are a number of interesting things you can do with this
   capability.
   capability.
@@ -838,7 +838,7 @@
   prompt of the other virtual machine.
   prompt of the other virtual machine.
 
 
 
 
-  66..  SSeettttiinngg uupp tthhee nneettwwoorrkk
+  6.  Setting up the network
 
 
 
 
 
 
@@ -858,19 +858,19 @@
   There are currently five transport types available for a UML virtual
   There are currently five transport types available for a UML virtual
   machine to exchange packets with other hosts:
   machine to exchange packets with other hosts:
 
 
-  +o  ethertap
+  o  ethertap
 
 
-  +o  TUN/TAP
+  o  TUN/TAP
 
 
-  +o  Multicast
+  o  Multicast
 
 
-  +o  a switch daemon
+  o  a switch daemon
 
 
-  +o  slip
+  o  slip
 
 
-  +o  slirp
+  o  slirp
 
 
-  +o  pcap
+  o  pcap
 
 
      The TUN/TAP, ethertap, slip, and slirp transports allow a UML
      The TUN/TAP, ethertap, slip, and slirp transports allow a UML
      instance to exchange packets with the host.  They may be directed
      instance to exchange packets with the host.  They may be directed
@@ -893,28 +893,28 @@
   With so many host transports, which one should you use?  Here's when
   With so many host transports, which one should you use?  Here's when
   you should use each one:
   you should use each one:
 
 
-  +o  ethertap - if you want access to the host networking and it is
+  o  ethertap - if you want access to the host networking and it is
      running 2.2
      running 2.2
 
 
-  +o  TUN/TAP - if you want access to the host networking and it is
+  o  TUN/TAP - if you want access to the host networking and it is
      running 2.4.  Also, the TUN/TAP transport is able to use a
      running 2.4.  Also, the TUN/TAP transport is able to use a
      preconfigured device, allowing it to avoid using the setuid uml_net
      preconfigured device, allowing it to avoid using the setuid uml_net
      helper, which is a security advantage.
      helper, which is a security advantage.
 
 
-  +o  Multicast - if you want a purely virtual network and you don't want
+  o  Multicast - if you want a purely virtual network and you don't want
      to set up anything but the UML
      to set up anything but the UML
 
 
-  +o  a switch daemon - if you want a purely virtual network and you
+  o  a switch daemon - if you want a purely virtual network and you
      don't mind running the daemon in order to get somewhat better
      don't mind running the daemon in order to get somewhat better
      performance
      performance
 
 
-  +o  slip - there is no particular reason to run the slip backend unless
+  o  slip - there is no particular reason to run the slip backend unless
      ethertap and TUN/TAP are just not available for some reason
      ethertap and TUN/TAP are just not available for some reason
 
 
-  +o  slirp - if you don't have root access on the host to setup
+  o  slirp - if you don't have root access on the host to setup
      networking, or if you don't want to allocate an IP to your UML
      networking, or if you don't want to allocate an IP to your UML
 
 
-  +o  pcap - not much use for actual network connectivity, but great for
+  o  pcap - not much use for actual network connectivity, but great for
      monitoring traffic on the host
      monitoring traffic on the host
 
 
      Ethertap is available on 2.4 and works fine.  TUN/TAP is preferred
      Ethertap is available on 2.4 and works fine.  TUN/TAP is preferred
@@ -926,7 +926,7 @@
      exploit the helper's root privileges.
      exploit the helper's root privileges.
 
 
 
 
-  66..11..  GGeenneerraall sseettuupp
+  6.1.  General setup
 
 
   First, you must have the virtual network enabled in your UML.  If are
   First, you must have the virtual network enabled in your UML.  If are
   running a prebuilt kernel from this site, everything is already
   running a prebuilt kernel from this site, everything is already
@@ -995,7 +995,7 @@
 
 
 
 
 
 
-  66..22..  UUsseerrssppaaccee ddaaeemmoonnss
+  6.2.  Userspace daemons
 
 
   You will likely need the setuid helper, or the switch daemon, or both.
   You will likely need the setuid helper, or the switch daemon, or both.
   They are both installed with the RPM and deb, so if you've installed
   They are both installed with the RPM and deb, so if you've installed
@@ -1011,7 +1011,7 @@
 
 
 
 
 
 
-  66..33..  SSppeecciiffyyiinngg eetthheerrnneett aaddddrreesssseess
+  6.3.  Specifying ethernet addresses
 
 
   Below, you will see that the TUN/TAP, ethertap, and daemon interfaces
   Below, you will see that the TUN/TAP, ethertap, and daemon interfaces
   allow you to specify hardware addresses for the virtual ethernet
   allow you to specify hardware addresses for the virtual ethernet
@@ -1023,11 +1023,11 @@
   sufficient to guarantee a unique hardware address for the device.  A
   sufficient to guarantee a unique hardware address for the device.  A
   couple of exceptions are:
   couple of exceptions are:
 
 
-  +o  Another set of virtual ethernet devices are on the same network and
+  o  Another set of virtual ethernet devices are on the same network and
      they are assigned hardware addresses using a different scheme which
      they are assigned hardware addresses using a different scheme which
      may conflict with the UML IP address-based scheme
      may conflict with the UML IP address-based scheme
 
 
-  +o  You aren't going to use the device for IP networking, so you don't
+  o  You aren't going to use the device for IP networking, so you don't
      assign the device an IP address
      assign the device an IP address
 
 
      If you let the driver provide the hardware address, you should make
      If you let the driver provide the hardware address, you should make
@@ -1049,7 +1049,7 @@
 
 
 
 
 
 
-  66..44..  UUMMLL iinntteerrffaaccee sseettuupp
+  6.4.  UML interface setup
 
 
   Once the network devices have been described on the command line, you
   Once the network devices have been described on the command line, you
   should boot UML and log in.
   should boot UML and log in.
@@ -1131,7 +1131,7 @@
 
 
 
 
 
 
-  66..55..  MMuullttiiccaasstt
+  6.5.  Multicast
 
 
   The simplest way to set up a virtual network between multiple UMLs is
   The simplest way to set up a virtual network between multiple UMLs is
   to use the mcast transport.  This was written by Harald Welte and is
   to use the mcast transport.  This was written by Harald Welte and is
@@ -1194,7 +1194,7 @@
 
 
 
 
 
 
-  66..66..  TTUUNN//TTAAPP wwiitthh tthhee uummll__nneett hheellppeerr
+  6.6.  TUN/TAP with the uml_net helper
 
 
   TUN/TAP is the preferred mechanism on 2.4 to exchange packets with the
   TUN/TAP is the preferred mechanism on 2.4 to exchange packets with the
   host.  The TUN/TAP backend has been in UML since 2.4.9-3um.
   host.  The TUN/TAP backend has been in UML since 2.4.9-3um.
@@ -1247,10 +1247,10 @@
   There are a couple potential problems with running the TUN/TAP
   There are a couple potential problems with running the TUN/TAP
   transport on a 2.4 host kernel
   transport on a 2.4 host kernel
 
 
-  +o  TUN/TAP seems not to work on 2.4.3 and earlier.  Upgrade the host
+  o  TUN/TAP seems not to work on 2.4.3 and earlier.  Upgrade the host
      kernel or use the ethertap transport.
      kernel or use the ethertap transport.
 
 
-  +o  With an upgraded kernel, TUN/TAP may fail with
+  o  With an upgraded kernel, TUN/TAP may fail with
 
 
 
 
        File descriptor in bad state
        File descriptor in bad state
@@ -1269,7 +1269,7 @@
 
 
 
 
 
 
-  66..77..  TTUUNN//TTAAPP wwiitthh aa pprreeccoonnffiigguurreedd ttaapp ddeevviiccee
+  6.7.  TUN/TAP with a preconfigured tap device
 
 
   If you prefer not to have UML use uml_net (which is somewhat
   If you prefer not to have UML use uml_net (which is somewhat
   insecure), with UML 2.4.17-11, you can set up a TUN/TAP device
   insecure), with UML 2.4.17-11, you can set up a TUN/TAP device
@@ -1277,7 +1277,7 @@
   there is no need for root assistance.  Setting up the device is done
   there is no need for root assistance.  Setting up the device is done
   as follows:
   as follows:
 
 
-  +o  Create the device with tunctl (available from the UML utilities
+  o  Create the device with tunctl (available from the UML utilities
      tarball)
      tarball)
 
 
 
 
@@ -1291,7 +1291,7 @@
   where uid is the user id or username that UML will be run as.  This
   where uid is the user id or username that UML will be run as.  This
   will tell you what device was created.
   will tell you what device was created.
 
 
-  +o  Configure the device IP (change IP addresses and device name to
+  o  Configure the device IP (change IP addresses and device name to
      suit)
      suit)
 
 
 
 
@@ -1303,7 +1303,7 @@
 
 
 
 
 
 
-  +o  Set up routing and arping if desired - this is my recipe, there are
+  o  Set up routing and arping if desired - this is my recipe, there are
      other ways of doing the same thing
      other ways of doing the same thing
 
 
 
 
@@ -1338,7 +1338,7 @@
   utility which reads the information from a config file and sets up
   utility which reads the information from a config file and sets up
   devices at boot time.
   devices at boot time.
 
 
-  +o  Rather than using up two IPs and ARPing for one of them, you can
+  o  Rather than using up two IPs and ARPing for one of them, you can
      also provide direct access to your LAN by the UML by using a
      also provide direct access to your LAN by the UML by using a
      bridge.
      bridge.
 
 
@@ -1417,7 +1417,7 @@
   Note that 'br0' should be setup using ifconfig with the existing IP
   Note that 'br0' should be setup using ifconfig with the existing IP
   address of eth0, as eth0 no longer has its own IP.
   address of eth0, as eth0 no longer has its own IP.
 
 
-  +o
+  o
 
 
 
 
      Also, the /dev/net/tun device must be writable by the user running
      Also, the /dev/net/tun device must be writable by the user running
@@ -1438,11 +1438,11 @@
   devices and chgrp /dev/net/tun to that group with mode 664 or 660.
   devices and chgrp /dev/net/tun to that group with mode 664 or 660.
 
 
 
 
-  +o  Once the device is set up, run UML with 'eth0=tuntap,device name'
+  o  Once the device is set up, run UML with 'eth0=tuntap,device name'
      (i.e. 'eth0=tuntap,tap0') on the command line (or do it with the
      (i.e. 'eth0=tuntap,tap0') on the command line (or do it with the
      mconsole config command).
      mconsole config command).
 
 
-  +o  Bring the eth device up in UML and you're in business.
+  o  Bring the eth device up in UML and you're in business.
 
 
      If you don't want that tap device any more, you can make it non-
      If you don't want that tap device any more, you can make it non-
      persistent with
      persistent with
@@ -1465,7 +1465,7 @@
 
 
 
 
 
 
-  66..88..  EEtthheerrttaapp
+  6.8.  Ethertap
 
 
   Ethertap is the general mechanism on 2.2 for userspace processes to
   Ethertap is the general mechanism on 2.2 for userspace processes to
   exchange packets with the kernel.
   exchange packets with the kernel.
@@ -1561,9 +1561,9 @@
 
 
 
 
 
 
-  66..99..  TThhee sswwiittcchh ddaaeemmoonn
+  6.9.  The switch daemon
 
 
-  NNoottee: This is the daemon formerly known as uml_router, but which was
+  Note: This is the daemon formerly known as uml_router, but which was
   renamed so the network weenies of the world would stop growling at me.
   renamed so the network weenies of the world would stop growling at me.
 
 
 
 
@@ -1649,7 +1649,7 @@
 
 
 
 
 
 
-  66..1100..  SSlliipp
+  6.10.  Slip
 
 
   Slip is another, less general, mechanism for a process to communicate
   Slip is another, less general, mechanism for a process to communicate
   with the host networking.  In contrast to the ethertap interface,
   with the host networking.  In contrast to the ethertap interface,
@@ -1681,7 +1681,7 @@
 
 
 
 
 
 
-  66..1111..  SSlliirrpp
+  6.11.  Slirp
 
 
   slirp uses an external program, usually /usr/bin/slirp, to provide IP
   slirp uses an external program, usually /usr/bin/slirp, to provide IP
   only networking connectivity through the host. This is similar to IP
   only networking connectivity through the host. This is similar to IP
@@ -1737,7 +1737,7 @@
 
 
 
 
 
 
-  66..1122..  ppccaapp
+  6.12.  pcap
 
 
   The pcap transport is attached to a UML ethernet device on the command
   The pcap transport is attached to a UML ethernet device on the command
   line or with uml_mconsole with the following syntax:
   line or with uml_mconsole with the following syntax:
@@ -1777,7 +1777,7 @@
 
 
 
 
 
 
-  66..1133..  SSeettttiinngg uupp tthhee hhoosstt yyoouurrsseellff
+  6.13.  Setting up the host yourself
 
 
   If you don't specify an address for the host side of the ethertap or
   If you don't specify an address for the host side of the ethertap or
   slip device, UML won't do any setup on the host.  So this is what is
   slip device, UML won't do any setup on the host.  So this is what is
@@ -1785,7 +1785,7 @@
   192.168.0.251 and a UML-side IP of 192.168.0.250 - adjust to suit your
   192.168.0.251 and a UML-side IP of 192.168.0.250 - adjust to suit your
   own network):
   own network):
 
 
-  +o  The device needs to be configured with its IP address.  Tap devices
+  o  The device needs to be configured with its IP address.  Tap devices
      are also configured with an mtu of 1484.  Slip devices are
      are also configured with an mtu of 1484.  Slip devices are
      configured with a point-to-point address pointing at the UML ip
      configured with a point-to-point address pointing at the UML ip
      address.
      address.
@@ -1805,7 +1805,7 @@
 
 
 
 
 
 
-  +o  If a tap device is being set up, a route is set to the UML IP.
+  o  If a tap device is being set up, a route is set to the UML IP.
 
 
 
 
        UML# route add -host 192.168.0.250 gw 192.168.0.251
        UML# route add -host 192.168.0.250 gw 192.168.0.251
@@ -1814,7 +1814,7 @@
 
 
 
 
 
 
-  +o  To allow other hosts on your network to see the virtual machine,
+  o  To allow other hosts on your network to see the virtual machine,
      proxy arp is set up for it.
      proxy arp is set up for it.
 
 
 
 
@@ -1824,7 +1824,7 @@
 
 
 
 
 
 
-  +o  Finally, the host is set up to route packets.
+  o  Finally, the host is set up to route packets.
 
 
 
 
        host#  echo 1 > /proc/sys/net/ipv4/ip_forward
        host#  echo 1 > /proc/sys/net/ipv4/ip_forward
@@ -1838,12 +1838,12 @@
 
 
 
 
 
 
-  77..  SShhaarriinngg FFiilleessyysstteemmss bbeettwweeeenn VViirrttuuaall MMaacchhiinneess
+  7.  Sharing Filesystems between Virtual Machines
 
 
 
 
 
 
 
 
-  77..11..  AA wwaarrnniinngg
+  7.1.  A warning
 
 
   Don't attempt to share filesystems simply by booting two UMLs from the
   Don't attempt to share filesystems simply by booting two UMLs from the
   same file.  That's the same thing as booting two physical machines
   same file.  That's the same thing as booting two physical machines
@@ -1851,7 +1851,7 @@
 
 
 
 
 
 
-  77..22..  UUssiinngg llaayyeerreedd bblloocckk ddeevviicceess
+  7.2.  Using layered block devices
 
 
   The way to share a filesystem between two virtual machines is to use
   The way to share a filesystem between two virtual machines is to use
   the copy-on-write (COW) layering capability of the ubd block driver.
   the copy-on-write (COW) layering capability of the ubd block driver.
@@ -1896,7 +1896,7 @@
 
 
 
 
 
 
-  77..33..  NNoottee!!
+  7.3.  Note!
 
 
   When checking the size of the COW file in order to see the gobs of
   When checking the size of the COW file in order to see the gobs of
   space that you're saving, make sure you use 'ls -ls' to see the actual
   space that you're saving, make sure you use 'ls -ls' to see the actual
@@ -1926,7 +1926,7 @@
 
 
 
 
 
 
-  77..44..  AAnnootthheerr wwaarrnniinngg
+  7.4.  Another warning
 
 
   Once a filesystem is being used as a readonly backing file for a COW
   Once a filesystem is being used as a readonly backing file for a COW
   file, do not boot directly from it or modify it in any way.  Doing so
   file, do not boot directly from it or modify it in any way.  Doing so
@@ -1952,7 +1952,7 @@
 
 
 
 
 
 
-  77..55..  uummll__mmoooo :: MMeerrggiinngg aa CCOOWW ffiillee wwiitthh iittss bbaacckkiinngg ffiillee
+  7.5.  uml_moo : Merging a COW file with its backing file
 
 
   Depending on how you use UML and COW devices, it may be advisable to
   Depending on how you use UML and COW devices, it may be advisable to
   merge the changes in the COW file into the backing file every once in
   merge the changes in the COW file into the backing file every once in
@@ -2001,7 +2001,7 @@
 
 
 
 
 
 
-  88..  CCrreeaattiinngg ffiilleessyysstteemmss
+  8.  Creating filesystems
 
 
 
 
   You may want to create and mount new UML filesystems, either because
   You may want to create and mount new UML filesystems, either because
@@ -2015,7 +2015,7 @@
   should be easy to translate to the filesystem of your choice.
   should be easy to translate to the filesystem of your choice.
 
 
 
 
-  88..11..  CCrreeaattee tthhee ffiilleessyysstteemm ffiillee
+  8.1.  Create the filesystem file
 
 
   dd is your friend.  All you need to do is tell dd to create an empty
   dd is your friend.  All you need to do is tell dd to create an empty
   file of the appropriate size.  I usually make it sparse to save time
   file of the appropriate size.  I usually make it sparse to save time
@@ -2032,7 +2032,7 @@
 
 
 
 
 
 
-  88..22..  AAssssiiggnn tthhee ffiillee ttoo aa UUMMLL ddeevviiccee
+  8.2.  Assign the file to a UML device
 
 
   Add an argument like the following to the UML command line:
   Add an argument like the following to the UML command line:
 
 
@@ -2045,7 +2045,7 @@
 
 
 
 
 
 
-  88..33..  CCrreeaattiinngg aanndd mmoouunnttiinngg tthhee ffiilleessyysstteemm
+  8.3.  Creating and mounting the filesystem
 
 
   Make sure that the filesystem is available, either by being built into
   Make sure that the filesystem is available, either by being built into
   the kernel, or available as a module, then boot up UML and log in.  If
   the kernel, or available as a module, then boot up UML and log in.  If
@@ -2096,7 +2096,7 @@
 
 
 
 
 
 
-  99..  HHoosstt ffiillee aacccceessss
+  9.  Host file access
 
 
 
 
   If you want to access files on the host machine from inside UML, you
   If you want to access files on the host machine from inside UML, you
@@ -2112,7 +2112,7 @@
   files contained in it just as you would on the host.
   files contained in it just as you would on the host.
 
 
 
 
-  99..11..  UUssiinngg hhoossttffss
+  9.1.  Using hostfs
 
 
   To begin with, make sure that hostfs is available inside the virtual
   To begin with, make sure that hostfs is available inside the virtual
   machine with
   machine with
@@ -2151,7 +2151,7 @@
 
 
 
 
 
 
-  99..22..  hhoossttffss aass tthhee rroooott ffiilleessyysstteemm
+  9.2.  hostfs as the root filesystem
 
 
   It's possible to boot from a directory hierarchy on the host using
   It's possible to boot from a directory hierarchy on the host using
   hostfs rather than using the standard filesystem in a file.
   hostfs rather than using the standard filesystem in a file.
@@ -2194,20 +2194,20 @@
   UML should then boot as it does normally.
   UML should then boot as it does normally.
 
 
 
 
-  99..33..  BBuuiillddiinngg hhoossttffss
+  9.3.  Building hostfs
 
 
   If you need to build hostfs because it's not in your kernel, you have
   If you need to build hostfs because it's not in your kernel, you have
   two choices:
   two choices:
 
 
 
 
 
 
-  +o  Compiling hostfs into the kernel:
+  o  Compiling hostfs into the kernel:
 
 
 
 
      Reconfigure the kernel and set the 'Host filesystem' option under
      Reconfigure the kernel and set the 'Host filesystem' option under
 
 
 
 
-  +o  Compiling hostfs as a module:
+  o  Compiling hostfs as a module:
 
 
 
 
      Reconfigure the kernel and set the 'Host filesystem' option under
      Reconfigure the kernel and set the 'Host filesystem' option under
@@ -2228,7 +2228,7 @@
 
 
 
 
 
 
-  1100..  TThhee MMaannaaggeemmeenntt CCoonnssoollee
+  10.  The Management Console
 
 
 
 
 
 
@@ -2240,15 +2240,15 @@
 
 
   There are a number of things you can do with the mconsole interface:
   There are a number of things you can do with the mconsole interface:
 
 
-  +o  get the kernel version
+  o  get the kernel version
 
 
-  +o  add and remove devices
+  o  add and remove devices
 
 
-  +o  halt or reboot the machine
+  o  halt or reboot the machine
 
 
-  +o  Send SysRq commands
+  o  Send SysRq commands
 
 
-  +o  Pause and resume the UML
+  o  Pause and resume the UML
 
 
 
 
   You need the mconsole client (uml_mconsole) which is present in CVS
   You need the mconsole client (uml_mconsole) which is present in CVS
@@ -2300,28 +2300,28 @@
 
 
   You'll get a prompt, at which you can run one of these commands:
   You'll get a prompt, at which you can run one of these commands:
 
 
-  +o  version
+  o  version
 
 
-  +o  halt
+  o  halt
 
 
-  +o  reboot
+  o  reboot
 
 
-  +o  config
+  o  config
 
 
-  +o  remove
+  o  remove
 
 
-  +o  sysrq
+  o  sysrq
 
 
-  +o  help
+  o  help
 
 
-  +o  cad
+  o  cad
 
 
-  +o  stop
+  o  stop
 
 
-  +o  go
+  o  go
 
 
 
 
-  1100..11..  vveerrssiioonn
+  10.1.  version
 
 
   This takes no arguments.  It prints the UML version.
   This takes no arguments.  It prints the UML version.
 
 
@@ -2342,7 +2342,7 @@
 
 
 
 
 
 
-  1100..22..  hhaalltt aanndd rreebboooott
+  10.2.  halt and reboot
 
 
   These take no arguments.  They shut the machine down immediately, with
   These take no arguments.  They shut the machine down immediately, with
   no syncing of disks and no clean shutdown of userspace.  So, they are
   no syncing of disks and no clean shutdown of userspace.  So, they are
@@ -2357,7 +2357,7 @@
 
 
 
 
 
 
-  1100..33..  ccoonnffiigg
+  10.3.  config
 
 
   "config" adds a new device to the virtual machine.  Currently the ubd
   "config" adds a new device to the virtual machine.  Currently the ubd
   and network drivers support this.  It takes one argument, which is the
   and network drivers support this.  It takes one argument, which is the
@@ -2378,7 +2378,7 @@
 
 
 
 
 
 
-  1100..44..  rreemmoovvee
+  10.4.  remove
 
 
   "remove" deletes a device from the system.  Its argument is just the
   "remove" deletes a device from the system.  Its argument is just the
   name of the device to be removed. The device must be idle in whatever
   name of the device to be removed. The device must be idle in whatever
@@ -2397,7 +2397,7 @@
 
 
 
 
 
 
-  1100..55..  ssyyssrrqq
+  10.5.  sysrq
 
 
   This takes one argument, which is a single letter.  It calls the
   This takes one argument, which is a single letter.  It calls the
   generic kernel's SysRq driver, which does whatever is called for by
   generic kernel's SysRq driver, which does whatever is called for by
@@ -2407,14 +2407,14 @@
 
 
 
 
 
 
-  1100..66..  hheellpp
+  10.6.  help
 
 
   "help" returns a string listing the valid commands and what each one
   "help" returns a string listing the valid commands and what each one
   does.
   does.
 
 
 
 
 
 
-  1100..77..  ccaadd
+  10.7.  cad
 
 
   This invokes the Ctl-Alt-Del action on init.  What exactly this ends
   This invokes the Ctl-Alt-Del action on init.  What exactly this ends
   up doing is up to /etc/inittab.  Normally, it reboots the machine.
   up doing is up to /etc/inittab.  Normally, it reboots the machine.
@@ -2432,7 +2432,7 @@
 
 
 
 
 
 
-  1100..88..  ssttoopp
+  10.8.  stop
 
 
   This puts the UML in a loop reading mconsole requests until a 'go'
   This puts the UML in a loop reading mconsole requests until a 'go'
   mconsole command is received. This is very useful for making backups
   mconsole command is received. This is very useful for making backups
@@ -2448,7 +2448,7 @@
 
 
 
 
 
 
-  1100..99..  ggoo
+  10.9.  go
 
 
   This resumes a UML after being paused by a 'stop' command. Note that
   This resumes a UML after being paused by a 'stop' command. Note that
   when the UML has resumed, TCP connections may have timed out and if
   when the UML has resumed, TCP connections may have timed out and if
@@ -2462,10 +2462,10 @@
 
 
 
 
 
 
-  1111..  KKeerrnneell ddeebbuuggggiinngg
+  11.  Kernel debugging
 
 
 
 
-  NNoottee:: The interface that makes debugging, as described here, possible
+  Note: The interface that makes debugging, as described here, possible
   is present in 2.4.0-test6 kernels and later.
   is present in 2.4.0-test6 kernels and later.
 
 
 
 
@@ -2485,7 +2485,7 @@
 
 
 
 
 
 
-  1111..11..  SSttaarrttiinngg tthhee kkeerrnneell uunnddeerr ggddbb
+  11.1.  Starting the kernel under gdb
 
 
   You can have the kernel running under the control of gdb from the
   You can have the kernel running under the control of gdb from the
   beginning by putting 'debug' on the command line.  You will get an
   beginning by putting 'debug' on the command line.  You will get an
@@ -2498,7 +2498,7 @@
   There is a transcript of a debugging session  here <debug-
   There is a transcript of a debugging session  here <debug-
   session.html> , with breakpoints being set in the scheduler and in an
   session.html> , with breakpoints being set in the scheduler and in an
   interrupt handler.
   interrupt handler.
-  1111..22..  EExxaammiinniinngg sslleeeeppiinngg pprroocceesssseess
+  11.2.  Examining sleeping processes
 
 
   Not every bug is evident in the currently running process.  Sometimes,
   Not every bug is evident in the currently running process.  Sometimes,
   processes hang in the kernel when they shouldn't because they've
   processes hang in the kernel when they shouldn't because they've
@@ -2516,7 +2516,7 @@
 
 
   Now what you do is this:
   Now what you do is this:
 
 
-  +o  detach from the current thread
+  o  detach from the current thread
 
 
 
 
        (UML gdb)  det
        (UML gdb)  det
@@ -2525,7 +2525,7 @@
 
 
 
 
 
 
-  +o  attach to the thread you are interested in
+  o  attach to the thread you are interested in
 
 
 
 
        (UML gdb)  att <host pid>
        (UML gdb)  att <host pid>
@@ -2534,7 +2534,7 @@
 
 
 
 
 
 
-  +o  look at its stack and anything else of interest
+  o  look at its stack and anything else of interest
 
 
 
 
        (UML gdb)  bt
        (UML gdb)  bt
@@ -2545,7 +2545,7 @@
   Note that you can't do anything at this point that requires that a
   Note that you can't do anything at this point that requires that a
   process execute, e.g. calling a function
   process execute, e.g. calling a function
 
 
-  +o  when you're done looking at that process, reattach to the current
+  o  when you're done looking at that process, reattach to the current
      thread and continue it
      thread and continue it
 
 
 
 
@@ -2569,12 +2569,12 @@
 
 
 
 
 
 
-  1111..33..  RRuunnnniinngg dddddd oonn UUMMLL
+  11.3.  Running ddd on UML
 
 
   ddd works on UML, but requires a special kludge.  The process goes
   ddd works on UML, but requires a special kludge.  The process goes
   like this:
   like this:
 
 
-  +o  Start ddd
+  o  Start ddd
 
 
 
 
        host% ddd linux
        host% ddd linux
@@ -2583,14 +2583,14 @@
 
 
 
 
 
 
-  +o  With ps, get the pid of the gdb that ddd started.  You can ask the
+  o  With ps, get the pid of the gdb that ddd started.  You can ask the
      gdb to tell you, but for some reason that confuses things and
      gdb to tell you, but for some reason that confuses things and
      causes a hang.
      causes a hang.
 
 
-  +o  run UML with 'debug=parent gdb-pid=<pid>' added to the command line
+  o  run UML with 'debug=parent gdb-pid=<pid>' added to the command line
      - it will just sit there after you hit return
      - it will just sit there after you hit return
 
 
-  +o  type 'att 1' to the ddd gdb and you will see something like
+  o  type 'att 1' to the ddd gdb and you will see something like
 
 
 
 
        0xa013dc51 in __kill ()
        0xa013dc51 in __kill ()
@@ -2602,12 +2602,12 @@
 
 
 
 
 
 
-  +o  At this point, type 'c', UML will boot up, and you can use ddd just
+  o  At this point, type 'c', UML will boot up, and you can use ddd just
      as you do on any other process.
      as you do on any other process.
 
 
 
 
 
 
-  1111..44..  DDeebbuuggggiinngg mmoodduulleess
+  11.4.  Debugging modules
 
 
   gdb has support for debugging code which is dynamically loaded into
   gdb has support for debugging code which is dynamically loaded into
   the process.  This support is what is needed to debug kernel modules
   the process.  This support is what is needed to debug kernel modules
@@ -2823,7 +2823,7 @@
 
 
 
 
 
 
-  1111..55..  AAttttaacchhiinngg ggddbb ttoo tthhee kkeerrnneell
+  11.5.  Attaching gdb to the kernel
 
 
   If you don't have the kernel running under gdb, you can attach gdb to
   If you don't have the kernel running under gdb, you can attach gdb to
   it later by sending the tracing thread a SIGUSR1.  The first line of
   it later by sending the tracing thread a SIGUSR1.  The first line of
@@ -2857,7 +2857,7 @@
 
 
 
 
 
 
-  1111..66..  UUssiinngg aalltteerrnnaattee ddeebbuuggggeerrss
+  11.6.  Using alternate debuggers
 
 
   UML has support for attaching to an already running debugger rather
   UML has support for attaching to an already running debugger rather
   than starting gdb itself.  This is present in CVS as of 17 Apr 2001.
   than starting gdb itself.  This is present in CVS as of 17 Apr 2001.
@@ -2886,7 +2886,7 @@
   An example of an alternate debugger is strace.  You can strace the
   An example of an alternate debugger is strace.  You can strace the
   actual kernel as follows:
   actual kernel as follows:
 
 
-  +o  Run the following in a shell
+  o  Run the following in a shell
 
 
 
 
        host%
        host%
@@ -2894,10 +2894,10 @@
 
 
 
 
 
 
-  +o  Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out
+  o  Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out
      by the previous command
      by the previous command
 
 
-  +o  Hit return in the shell, and UML will start running, and strace
+  o  Hit return in the shell, and UML will start running, and strace
      output will start accumulating in the output file.
      output will start accumulating in the output file.
 
 
      Note that this is different from running
      Note that this is different from running
@@ -2917,9 +2917,9 @@
 
 
 
 
 
 
-  1122..  KKeerrnneell ddeebbuuggggiinngg eexxaammpplleess
+  12.  Kernel debugging examples
 
 
-  1122..11..  TThhee ccaassee ooff tthhee hhuunngg ffsscckk
+  12.1.  The case of the hung fsck
 
 
   When booting up the kernel, fsck failed, and dropped me into a shell
   When booting up the kernel, fsck failed, and dropped me into a shell
   to fix things up.  I ran fsck -y, which hung:
   to fix things up.  I ran fsck -y, which hung:
@@ -3154,9 +3154,9 @@
 
 
   The interesting things here are :
   The interesting things here are :
 
 
-  +o  There are two segfaults on this stack (frames 9 and 14)
+  o  There are two segfaults on this stack (frames 9 and 14)
 
 
-  +o  The first faulting address (frame 11) is 0x50000800
+  o  The first faulting address (frame 11) is 0x50000800
 
 
   (gdb) p (void *)1342179328
   (gdb) p (void *)1342179328
   $16 = (void *) 0x50000800
   $16 = (void *) 0x50000800
@@ -3399,7 +3399,7 @@
   on will be somewhat clearer.
   on will be somewhat clearer.
 
 
 
 
-  1122..22..  EEppiissooddee 22:: TThhee ccaassee ooff tthhee hhuunngg ffsscckk
+  12.2.  Episode 2: The case of the hung fsck
 
 
   After setting a trap in the SEGV handler for accesses to the signal
   After setting a trap in the SEGV handler for accesses to the signal
   thread's stack, I reran the kernel.
   thread's stack, I reran the kernel.
@@ -3788,12 +3788,12 @@
 
 
 
 
 
 
-  1133..  WWhhaatt ttoo ddoo wwhheenn UUMMLL ddooeessnn''tt wwoorrkk
+  13.  What to do when UML doesn't work
 
 
 
 
 
 
 
 
-  1133..11..  SSttrraannggee ccoommppiillaattiioonn eerrrroorrss wwhheenn yyoouu bbuuiilldd ffrroomm ssoouurrccee
+  13.1.  Strange compilation errors when you build from source
 
 
   As of test11, it is necessary to have "ARCH=um" in the environment or
   As of test11, it is necessary to have "ARCH=um" in the environment or
   on the make command line for all steps in building UML, including
   on the make command line for all steps in building UML, including
@@ -3824,8 +3824,8 @@
 
 
 
 
 
 
-  1133..33..  AA vvaarriieettyy ooff ppaanniiccss aanndd hhaannggss wwiitthh //ttmmpp oonn aa rreeiisseerrffss  ffiilleessyyss--
-  tteemm
+  13.3.  A variety of panics and hangs with /tmp on a reiserfs  filesys-
+  tem
 
 
   I saw this on reiserfs 3.5.21 and it seems to be fixed in 3.5.27.
   I saw this on reiserfs 3.5.21 and it seems to be fixed in 3.5.27.
   Panics preceded by
   Panics preceded by
@@ -3842,8 +3842,8 @@
 
 
 
 
 
 
-  1133..44..  TThhee ccoommppiillee ffaaiillss wwiitthh eerrrroorrss aabboouutt ccoonnfflliiccttiinngg ttyyppeess ffoorr
-  ''ooppeenn'',, ''dduupp'',, aanndd ''wwaaiittppiidd''
+  13.4.  The compile fails with errors about conflicting types for
+  'open', 'dup', and 'waitpid'
 
 
   This happens when you build in /usr/src/linux.  The UML build makes
   This happens when you build in /usr/src/linux.  The UML build makes
   the include/asm link point to include/asm-um.  /usr/include/asm points
   the include/asm link point to include/asm-um.  /usr/include/asm points
@@ -3854,14 +3854,14 @@
 
 
 
 
 
 
-  1133..55..  UUMMLL ddooeessnn''tt wwoorrkk wwhheenn //ttmmpp iiss aann NNFFSS ffiilleessyysstteemm
+  13.5.  UML doesn't work when /tmp is an NFS filesystem
 
 
   This seems to be a similar situation with the ReiserFS problem above.
   This seems to be a similar situation with the ReiserFS problem above.
   Some versions of NFS seems not to handle mmap correctly, which UML
   Some versions of NFS seems not to handle mmap correctly, which UML
   depends on.  The workaround is have /tmp be a non-NFS directory.
   depends on.  The workaround is have /tmp be a non-NFS directory.
 
 
 
 
-  1133..66..  UUMMLL hhaannggss oonn bboooott wwhheenn ccoommppiilleedd wwiitthh ggpprrooff ssuuppppoorrtt
+  13.6.  UML hangs on boot when compiled with gprof support
 
 
   If you build UML with gprof support and, early in the boot, it does
   If you build UML with gprof support and, early in the boot, it does
   this
   this
@@ -3878,7 +3878,7 @@
 
 
 
 
 
 
-  1133..77..  ssyyssllooggdd ddiieess wwiitthh aa SSIIGGTTEERRMM oonn ssttaarrttuupp
+  13.7.  syslogd dies with a SIGTERM on startup
 
 
   The exact boot error depends on the distribution that you're booting,
   The exact boot error depends on the distribution that you're booting,
   but Debian produces this:
   but Debian produces this:
@@ -3897,17 +3897,17 @@
 
 
 
 
 
 
-  1133..88..  TTUUNN//TTAAPP nneettwwoorrkkiinngg ddooeessnn''tt wwoorrkk oonn aa 22..44 hhoosstt
+  13.8.  TUN/TAP networking doesn't work on a 2.4 host
 
 
   There are a couple of problems which were
   There are a couple of problems which were
   <http://www.geocrawler.com/lists/3/SourceForge/597/0/> name="pointed
   <http://www.geocrawler.com/lists/3/SourceForge/597/0/> name="pointed
   out">  by Tim Robinson <timro at trkr dot net>
   out">  by Tim Robinson <timro at trkr dot net>
 
 
-  +o  It doesn't work on hosts running 2.4.7 (or thereabouts) or earlier.
+  o  It doesn't work on hosts running 2.4.7 (or thereabouts) or earlier.
      The fix is to upgrade to something more recent and then read the
      The fix is to upgrade to something more recent and then read the
      next item.
      next item.
 
 
-  +o  If you see
+  o  If you see
 
 
 
 
        File descriptor in bad state
        File descriptor in bad state
@@ -3921,8 +3921,8 @@
 
 
 
 
 
 
-  1133..99..  YYoouu ccaann nneettwwoorrkk ttoo tthhee hhoosstt bbuutt nnoott ttoo ootthheerr mmaacchhiinneess oonn tthhee
-  nneett
+  13.9.  You can network to the host but not to other machines on the
+  net
 
 
   If you can connect to the host, and the host can connect to UML, but
   If you can connect to the host, and the host can connect to UML, but
   you cannot connect to any other machines, then you may need to enable
   you cannot connect to any other machines, then you may need to enable
@@ -3972,7 +3972,7 @@
 
 
 
 
 
 
-  1133..1100..  II hhaavvee nnoo rroooott aanndd II wwaanntt ttoo ssccrreeaamm
+  13.10.  I have no root and I want to scream
 
 
   Thanks to Birgit Wahlich for telling me about this strange one.  It
   Thanks to Birgit Wahlich for telling me about this strange one.  It
   turns out that there's a limit of six environment variables on the
   turns out that there's a limit of six environment variables on the
@@ -3987,7 +3987,7 @@
 
 
 
 
 
 
-  1133..1111..  UUMMLL bbuuiilldd ccoonnfflliicctt bbeettwweeeenn ppttrraaccee..hh aanndd uuccoonntteexxtt..hh
+  13.11.  UML build conflict between ptrace.h and ucontext.h
 
 
   On some older systems, /usr/include/asm/ptrace.h and
   On some older systems, /usr/include/asm/ptrace.h and
   /usr/include/sys/ucontext.h define the same names.  So, when they're
   /usr/include/sys/ucontext.h define the same names.  So, when they're
@@ -4007,7 +4007,7 @@
 
 
 
 
 
 
-  1133..1122..  TThhee UUMMLL BBooggooMMiippss iiss eexxaaccttllyy hhaallff tthhee hhoosstt''ss BBooggooMMiippss
+  13.12.  The UML BogoMips is exactly half the host's BogoMips
 
 
   On i386 kernels, there are two ways of running the loop that is used
   On i386 kernels, there are two ways of running the loop that is used
   to calculate the BogoMips rating, using the TSC if it's there or using
   to calculate the BogoMips rating, using the TSC if it's there or using
@@ -4019,7 +4019,7 @@
 
 
 
 
 
 
-  1133..1133..  WWhheenn yyoouu rruunn UUMMLL,, iitt iimmmmeeddiiaatteellyy sseeggffaauullttss
+  13.13.  When you run UML, it immediately segfaults
 
 
   If the host is configured with the 2G/2G address space split, that's
   If the host is configured with the 2G/2G address space split, that's
   why.  See ``UML on 2G/2G hosts''  for the details on getting UML to
   why.  See ``UML on 2G/2G hosts''  for the details on getting UML to
@@ -4027,7 +4027,7 @@
 
 
 
 
 
 
-  1133..1144..  xxtteerrmmss aappppeeaarr,, tthheenn iimmmmeeddiiaatteellyy ddiissaappppeeaarr
+  13.14.  xterms appear, then immediately disappear
 
 
   If you're running an up to date kernel with an old release of
   If you're running an up to date kernel with an old release of
   uml_utilities, the port-helper program will not work properly, so
   uml_utilities, the port-helper program will not work properly, so
@@ -4039,7 +4039,7 @@
 
 
 
 
 
 
-  1133..1155..  AAnnyy ootthheerr ppaanniicc,, hhaanngg,, oorr ssttrraannggee bbeehhaavviioorr
+  13.15.  Any other panic, hang, or strange behavior
 
 
   If you're seeing truly strange behavior, such as hangs or panics that
   If you're seeing truly strange behavior, such as hangs or panics that
   happen in random places, or you try running the debugger to see what's
   happen in random places, or you try running the debugger to see what's
@@ -4059,7 +4059,7 @@
 
 
   If you want to be super-helpful, read ``Diagnosing Problems'' and
   If you want to be super-helpful, read ``Diagnosing Problems'' and
   follow the instructions contained therein.
   follow the instructions contained therein.
-  1144..  DDiiaaggnnoossiinngg PPrroobblleemmss
+  14.  Diagnosing Problems
 
 
 
 
   If you get UML to crash, hang, or otherwise misbehave, you should
   If you get UML to crash, hang, or otherwise misbehave, you should
@@ -4078,7 +4078,7 @@
   ``Kernel debugging''  UML first.
   ``Kernel debugging''  UML first.
 
 
 
 
-  1144..11..  CCaassee 11 :: NNoorrmmaall kkeerrnneell ppaanniiccss
+  14.1.  Case 1 : Normal kernel panics
 
 
   The most common case is for a normal thread to panic.  To debug this,
   The most common case is for a normal thread to panic.  To debug this,
   you will need to run it under the debugger (add 'debug' to the command
   you will need to run it under the debugger (add 'debug' to the command
@@ -4128,7 +4128,7 @@
   to get that information from the faulting ip.
   to get that information from the faulting ip.
 
 
 
 
-  1144..22..  CCaassee 22 :: TTrraacciinngg tthhrreeaadd ppaanniiccss
+  14.2.  Case 2 : Tracing thread panics
 
 
   The less common and more painful case is when the tracing thread
   The less common and more painful case is when the tracing thread
   panics.  In this case, the kernel debugger will be useless because it
   panics.  In this case, the kernel debugger will be useless because it
@@ -4161,7 +4161,7 @@
   backtrace in and wait for our crack debugging team to fix the problem.
   backtrace in and wait for our crack debugging team to fix the problem.
 
 
 
 
-  1144..33..  CCaassee 33 :: TTrraacciinngg tthhrreeaadd ppaanniiccss ccaauusseedd bbyy ootthheerr tthhrreeaaddss
+  14.3.  Case 3 : Tracing thread panics caused by other threads
 
 
   However, there are cases where the misbehavior of another thread
   However, there are cases where the misbehavior of another thread
   caused the problem.  The most common panic of this type is:
   caused the problem.  The most common panic of this type is:
@@ -4227,7 +4227,7 @@
 
 
 
 
 
 
-  1144..44..  CCaassee 44 :: HHaannggss
+  14.4.  Case 4 : Hangs
 
 
   Hangs seem to be fairly rare, but they sometimes happen.  When a hang
   Hangs seem to be fairly rare, but they sometimes happen.  When a hang
   happens, we need a backtrace from the offending process.  Run the
   happens, we need a backtrace from the offending process.  Run the
@@ -4257,7 +4257,7 @@
 
 
 
 
 
 
-  1155..  TThhaannkkss
+  15.  Thanks
 
 
 
 
   A number of people have helped this project in various ways, and this
   A number of people have helped this project in various ways, and this
@@ -4274,20 +4274,20 @@
   bookkeeping lapses and I forget about contributions.
   bookkeeping lapses and I forget about contributions.
 
 
 
 
-  1155..11..  CCooddee aanndd DDooccuummeennttaattiioonn
+  15.1.  Code and Documentation
 
 
   Rusty Russell <rusty at linuxcare.com.au>  -
   Rusty Russell <rusty at linuxcare.com.au>  -
 
 
-  +o  wrote the  HOWTO <http://user-mode-
+  o  wrote the  HOWTO <http://user-mode-
      linux.sourceforge.net/UserModeLinux-HOWTO.html>
      linux.sourceforge.net/UserModeLinux-HOWTO.html>
 
 
-  +o  prodded me into making this project official and putting it on
+  o  prodded me into making this project official and putting it on
      SourceForge
      SourceForge
 
 
-  +o  came up with the way cool UML logo <http://user-mode-
+  o  came up with the way cool UML logo <http://user-mode-
      linux.sourceforge.net/uml-small.png>
      linux.sourceforge.net/uml-small.png>
 
 
-  +o  redid the config process
+  o  redid the config process
 
 
 
 
   Peter Moulder <reiter at netspace.net.au>  - Fixed my config and build
   Peter Moulder <reiter at netspace.net.au>  - Fixed my config and build
@@ -4296,18 +4296,18 @@
 
 
   Bill Stearns <wstearns at pobox.com>  -
   Bill Stearns <wstearns at pobox.com>  -
 
 
-  +o  HOWTO updates
+  o  HOWTO updates
 
 
-  +o  lots of bug reports
+  o  lots of bug reports
 
 
-  +o  lots of testing
+  o  lots of testing
 
 
-  +o  dedicated a box (uml.ists.dartmouth.edu) to support UML development
+  o  dedicated a box (uml.ists.dartmouth.edu) to support UML development
 
 
-  +o  wrote the mkrootfs script, which allows bootable filesystems of
+  o  wrote the mkrootfs script, which allows bootable filesystems of
      RPM-based distributions to be cranked out
      RPM-based distributions to be cranked out
 
 
-  +o  cranked out a large number of filesystems with said script
+  o  cranked out a large number of filesystems with said script
 
 
 
 
   Jim Leu <jleu at mindspring.com>  - Wrote the virtual ethernet driver
   Jim Leu <jleu at mindspring.com>  - Wrote the virtual ethernet driver
@@ -4375,176 +4375,176 @@
 
 
   David Coulson <http://davidcoulson.net>  -
   David Coulson <http://davidcoulson.net>  -
 
 
-  +o  Set up the usermodelinux.org <http://usermodelinux.org>  site,
+  o  Set up the usermodelinux.org <http://usermodelinux.org>  site,
      which is a great way of keeping the UML user community on top of
      which is a great way of keeping the UML user community on top of
      UML goings-on.
      UML goings-on.
 
 
-  +o  Site documentation and updates
+  o  Site documentation and updates
 
 
-  +o  Nifty little UML management daemon  UMLd
+  o  Nifty little UML management daemon  UMLd
      <http://uml.openconsultancy.com/umld/>
      <http://uml.openconsultancy.com/umld/>
 
 
-  +o  Lots of testing and bug reports
+  o  Lots of testing and bug reports
 
 
 
 
 
 
 
 
-  1155..22..  FFlluusshhiinngg oouutt bbuuggss
+  15.2.  Flushing out bugs
 
 
 
 
 
 
-  +o  Yuri Pudgorodsky
+  o  Yuri Pudgorodsky
 
 
-  +o  Gerald Britton
+  o  Gerald Britton
 
 
-  +o  Ian Wehrman
+  o  Ian Wehrman
 
 
-  +o  Gord Lamb
+  o  Gord Lamb
 
 
-  +o  Eugene Koontz
+  o  Eugene Koontz
 
 
-  +o  John H. Hartman
+  o  John H. Hartman
 
 
-  +o  Anders Karlsson
+  o  Anders Karlsson
 
 
-  +o  Daniel Phillips
+  o  Daniel Phillips
 
 
-  +o  John Fremlin
+  o  John Fremlin
 
 
-  +o  Rainer Burgstaller
+  o  Rainer Burgstaller
 
 
-  +o  James Stevenson
+  o  James Stevenson
 
 
-  +o  Matt Clay
+  o  Matt Clay
 
 
-  +o  Cliff Jefferies
+  o  Cliff Jefferies
 
 
-  +o  Geoff Hoff
+  o  Geoff Hoff
 
 
-  +o  Lennert Buytenhek
+  o  Lennert Buytenhek
 
 
-  +o  Al Viro
+  o  Al Viro
 
 
-  +o  Frank Klingenhoefer
+  o  Frank Klingenhoefer
 
 
-  +o  Livio Baldini Soares
+  o  Livio Baldini Soares
 
 
-  +o  Jon Burgess
+  o  Jon Burgess
 
 
-  +o  Petru Paler
+  o  Petru Paler
 
 
-  +o  Paul
+  o  Paul
 
 
-  +o  Chris Reahard
+  o  Chris Reahard
 
 
-  +o  Sverker Nilsson
+  o  Sverker Nilsson
 
 
-  +o  Gong Su
+  o  Gong Su
 
 
-  +o  johan verrept
+  o  johan verrept
 
 
-  +o  Bjorn Eriksson
+  o  Bjorn Eriksson
 
 
-  +o  Lorenzo Allegrucci
+  o  Lorenzo Allegrucci
 
 
-  +o  Muli Ben-Yehuda
+  o  Muli Ben-Yehuda
 
 
-  +o  David Mansfield
+  o  David Mansfield
 
 
-  +o  Howard Goff
+  o  Howard Goff
 
 
-  +o  Mike Anderson
+  o  Mike Anderson
 
 
-  +o  John Byrne
+  o  John Byrne
 
 
-  +o  Sapan J. Batia
+  o  Sapan J. Batia
 
 
-  +o  Iris Huang
+  o  Iris Huang
 
 
-  +o  Jan Hudec
+  o  Jan Hudec
 
 
-  +o  Voluspa
+  o  Voluspa
 
 
 
 
 
 
 
 
-  1155..33..  BBuugglleettss aanndd cclleeaann--uuppss
+  15.3.  Buglets and clean-ups
 
 
 
 
 
 
-  +o  Dave Zarzycki
+  o  Dave Zarzycki
 
 
-  +o  Adam Lazur
+  o  Adam Lazur
 
 
-  +o  Boria Feigin
+  o  Boria Feigin
 
 
-  +o  Brian J. Murrell
+  o  Brian J. Murrell
 
 
-  +o  JS
+  o  JS
 
 
-  +o  Roman Zippel
+  o  Roman Zippel
 
 
-  +o  Wil Cooley
+  o  Wil Cooley
 
 
-  +o  Ayelet Shemesh
+  o  Ayelet Shemesh
 
 
-  +o  Will Dyson
+  o  Will Dyson
 
 
-  +o  Sverker Nilsson
+  o  Sverker Nilsson
 
 
-  +o  dvorak
+  o  dvorak
 
 
-  +o  v.naga srinivas
+  o  v.naga srinivas
 
 
-  +o  Shlomi Fish
+  o  Shlomi Fish
 
 
-  +o  Roger Binns
+  o  Roger Binns
 
 
-  +o  johan verrept
+  o  johan verrept
 
 
-  +o  MrChuoi
+  o  MrChuoi
 
 
-  +o  Peter Cleve
+  o  Peter Cleve
 
 
-  +o  Vincent Guffens
+  o  Vincent Guffens
 
 
-  +o  Nathan Scott
+  o  Nathan Scott
 
 
-  +o  Patrick Caulfield
+  o  Patrick Caulfield
 
 
-  +o  jbearce
+  o  jbearce
 
 
-  +o  Catalin Marinas
+  o  Catalin Marinas
 
 
-  +o  Shane Spencer
+  o  Shane Spencer
 
 
-  +o  Zou Min
+  o  Zou Min
 
 
 
 
-  +o  Ryan Boder
+  o  Ryan Boder
 
 
-  +o  Lorenzo Colitti
+  o  Lorenzo Colitti
 
 
-  +o  Gwendal Grignou
+  o  Gwendal Grignou
 
 
-  +o  Andre' Breiler
+  o  Andre' Breiler
 
 
-  +o  Tsutomu Yasuda
+  o  Tsutomu Yasuda
 
 
 
 
 
 
-  1155..44..  CCaassee SSttuuddiieess
+  15.4.  Case Studies
 
 
 
 
-  +o  Jon Wright
+  o  Jon Wright
 
 
-  +o  William McEwan
+  o  William McEwan
 
 
-  +o  Michael Richardson
+  o  Michael Richardson
 
 
 
 
 
 
-  1155..55..  OOtthheerr ccoonnttrriibbuuttiioonnss
+  15.5.  Other contributions
 
 
 
 
   Bill Carr <Bill.Carr at compaq.com>  made the Red Hat mkrootfs script
   Bill Carr <Bill.Carr at compaq.com>  made the Red Hat mkrootfs script

+ 1 - 113
arch/um/Kconfig.char

@@ -1,5 +1,4 @@
-
-menu "Character Devices"
+menu "UML Character Devices"
 
 
 config STDERR_CONSOLE
 config STDERR_CONSOLE
 	bool "stderr console"
 	bool "stderr console"
@@ -105,92 +104,6 @@ config SSL_CHAN
           this if you expect the UML that you build to be run in environments
           this if you expect the UML that you build to be run in environments
           which don't have a set of /dev/pty* devices.
           which don't have a set of /dev/pty* devices.
 
 
-config UNIX98_PTYS
-	bool "Unix98 PTY support"
-	help
-	  A pseudo terminal (PTY) is a software device consisting of two
-	  halves: a master and a slave. The slave device behaves identical to
-	  a physical terminal; the master device is used by a process to
-	  read data from and write data to the slave, thereby emulating a
-	  terminal. Typical programs for the master side are telnet servers
-	  and xterms.
-
-	  Linux has traditionally used the BSD-like names /dev/ptyxx for
-	  masters and /dev/ttyxx for slaves of pseudo terminals. This scheme
-	  has a number of problems. The GNU C library glibc 2.1 and later,
-	  however, supports the Unix98 naming standard: in order to acquire a
-	  pseudo terminal, a process opens /dev/ptmx; the number of the pseudo
-	  terminal is then made available to the process and the pseudo
-	  terminal slave can be accessed as /dev/pts/<number>. What was
-	  traditionally /dev/ttyp2 will then be /dev/pts/2, for example.
-
-	  All modern Linux systems use the Unix98 ptys.  Say Y unless
-	  you're on an embedded system and want to conserve memory.
-
-config LEGACY_PTYS
-	bool "Legacy (BSD) PTY support"
-	default y
-	help
-	  A pseudo terminal (PTY) is a software device consisting of two
-	  halves: a master and a slave. The slave device behaves identical to
-	  a physical terminal; the master device is used by a process to
-	  read data from and write data to the slave, thereby emulating a
-	  terminal. Typical programs for the master side are telnet servers
-	  and xterms.
-
-	  Linux has traditionally used the BSD-like names /dev/ptyxx
-	  for masters and /dev/ttyxx for slaves of pseudo
-	  terminals. This scheme has a number of problems, including
-	  security.  This option enables these legacy devices; on most
-	  systems, it is safe to say N.
-
-config RAW_DRIVER
-        tristate "RAW driver (/dev/raw/rawN)"
-	depends on BLOCK
-        help
-          The raw driver permits block devices to be bound to /dev/raw/rawN.
-          Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O.
-          See the raw(8) manpage for more details.
-
-          Applications should preferably open the device (eg /dev/hda1)
-          with the O_DIRECT flag.
-
-config MAX_RAW_DEVS
-        int "Maximum number of RAW devices to support (1-8192)"
-        depends on RAW_DRIVER
-        default "256"
-        help
-          The maximum number of RAW devices that are supported.
-          Default is 256. Increase this number in case you need lots of
-          raw devices.
-
-config LEGACY_PTY_COUNT
-	int "Maximum number of legacy PTY in use"
-	depends on LEGACY_PTYS
-	default "256"
-	help
-	  The maximum number of legacy PTYs that can be used at any one time.
-	  The default is 256, and should be more than enough.  Embedded
-	  systems may want to reduce this to save memory.
-
-	  When not in use, each legacy PTY occupies 12 bytes on 32-bit
-	  architectures and 24 bytes on 64-bit architectures.
-
-config WATCHDOG
-	bool "Watchdog Timer Support"
-
-config WATCHDOG_NOWAYOUT
-	bool "Disable watchdog shutdown on close"
-	depends on WATCHDOG
-
-config SOFT_WATCHDOG
-	tristate "Software Watchdog"
-	depends on WATCHDOG
-
-config UML_WATCHDOG
-	tristate "UML watchdog"
-	depends on WATCHDOG
-
 config UML_SOUND
 config UML_SOUND
 	tristate "Sound support"
 	tristate "Sound support"
 	help
 	help
@@ -211,29 +124,4 @@ config HOSTAUDIO
 	tristate
 	tristate
 	default UML_SOUND
 	default UML_SOUND
 
 
-#It is selected elsewhere, so kconfig would warn without this.
-config HW_RANDOM
-	tristate
-	default n
-
-config UML_RANDOM
-	tristate "Hardware random number generator"
-	help
-	  This option enables UML's "hardware" random number generator.  It
-	  attaches itself to the host's /dev/random, supplying as much entropy
-	  as the host has, rather than the small amount the UML gets from its
-	  own drivers.  It registers itself as a standard hardware random number
-	  generator, major 10, minor 183, and the canonical device name is
-	  /dev/hwrng.
-	  The way to make use of this is to install the rng-tools package
-	  (check your distro, or download from
-	  http://sourceforge.net/projects/gkernel/).  rngd periodically reads
-	  /dev/hwrng and injects the entropy into /dev/random.
-
-config MMAPPER
-	tristate "iomem emulation driver"
-	help
-	  This driver allows a host file to be used as emulated IO memory inside
-	  UML.
-
 endmenu
 endmenu

+ 1 - 22
arch/um/Kconfig.rest

@@ -2,20 +2,14 @@ source "init/Kconfig"
 
 
 source "kernel/Kconfig.freezer"
 source "kernel/Kconfig.freezer"
 
 
-source "drivers/block/Kconfig"
-
 source "arch/um/Kconfig.char"
 source "arch/um/Kconfig.char"
 
 
-source "drivers/base/Kconfig"
+source "drivers/Kconfig"
 
 
 source "net/Kconfig"
 source "net/Kconfig"
 
 
 source "arch/um/Kconfig.net"
 source "arch/um/Kconfig.net"
 
 
-source "drivers/net/Kconfig"
-
-source "drivers/connector/Kconfig"
-
 source "fs/Kconfig"
 source "fs/Kconfig"
 
 
 source "security/Kconfig"
 source "security/Kconfig"
@@ -24,19 +18,4 @@ source "crypto/Kconfig"
 
 
 source "lib/Kconfig"
 source "lib/Kconfig"
 
 
-source "drivers/scsi/Kconfig"
-
-source "drivers/md/Kconfig"
-
-if BROKEN
-	source "drivers/mtd/Kconfig"
-endif
-
-source "drivers/leds/Kconfig"
-
-#This is just to shut up some Kconfig warnings, so no prompt.
-config INPUT
-	tristate
-	default n
-
 source "arch/um/Kconfig.debug"
 source "arch/um/Kconfig.debug"

+ 6 - 0
arch/um/Kconfig.um

@@ -148,5 +148,11 @@ config KERNEL_STACK_ORDER
 	  be 1 << order pages.  The default is OK unless you're running Valgrind
 	  be 1 << order pages.  The default is OK unless you're running Valgrind
 	  on UML, in which case, set this to 3.
 	  on UML, in which case, set this to 3.
 
 
+config MMAPPER
+	tristate "iomem emulation driver"
+	help
+	  This driver allows a host file to be used as emulated IO memory inside
+	  UML.
+
 config NO_DMA
 config NO_DMA
 	def_bool y
 	def_bool y

+ 26 - 23
arch/um/Makefile

@@ -20,15 +20,27 @@ core-y			+= $(ARCH_DIR)/kernel/		\
 
 
 MODE_INCLUDE	+= -I$(srctree)/$(ARCH_DIR)/include/shared/skas
 MODE_INCLUDE	+= -I$(srctree)/$(ARCH_DIR)/include/shared/skas
 
 
+HEADER_ARCH 	:= $(SUBARCH)
+
+# Additional ARCH settings for x86
+ifeq ($(SUBARCH),i386)
+        HEADER_ARCH := x86
+endif
+ifeq ($(SUBARCH),x86_64)
+        HEADER_ARCH := x86
+endif
+
+HOST_DIR := arch/$(HEADER_ARCH)
+
 include $(srctree)/$(ARCH_DIR)/Makefile-skas
 include $(srctree)/$(ARCH_DIR)/Makefile-skas
+include $(srctree)/$(HOST_DIR)/Makefile.um
+
+core-y += $(HOST_DIR)/um/
 
 
 SHARED_HEADERS	:= $(ARCH_DIR)/include/shared
 SHARED_HEADERS	:= $(ARCH_DIR)/include/shared
 ARCH_INCLUDE	:= -I$(srctree)/$(SHARED_HEADERS)
 ARCH_INCLUDE	:= -I$(srctree)/$(SHARED_HEADERS)
-ARCH_INCLUDE	+= -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared
-ifneq ($(KBUILD_SRC),)
-ARCH_INCLUDE	+= -I$(SHARED_HEADERS)
-endif
-KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)
+ARCH_INCLUDE	+= -I$(srctree)/$(HOST_DIR)/um/shared
+KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/um
 
 
 # -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so
 # -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so
 # named - it's a common symbol in libpcap, so we get a binary which crashes.
 # named - it's a common symbol in libpcap, so we get a binary which crashes.
@@ -47,14 +59,12 @@ KBUILD_AFLAGS += $(ARCH_INCLUDE)
 
 
 USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
 USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
 	$(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
 	$(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
-	$(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64
-
-include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
+	$(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include
 
 
 #This will adjust *FLAGS accordingly to the platform.
 #This will adjust *FLAGS accordingly to the platform.
 include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
 include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
 
 
-KBUILD_CPPFLAGS += -I$(srctree)/arch/$(HEADER_ARCH)/include
+KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include
 
 
 # -Derrno=kernel_errno - This turns all kernel references to errno into
 # -Derrno=kernel_errno - This turns all kernel references to errno into
 # kernel_errno to separate them from the libc errno.  This allows -fno-common
 # kernel_errno to separate them from the libc errno.  This allows -fno-common
@@ -84,10 +94,9 @@ define archhelp
   echo '		   find in the kernel root.'
   echo '		   find in the kernel root.'
 endef
 endef
 
 
-KBUILD_KCONFIG := arch/um/Kconfig.$(HEADER_ARCH)
+KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
 
 
-archprepare: $(SHARED_HEADERS)/user_constants.h
-archprepare: $(SHARED_HEADERS)/kern_constants.h
+archprepare: include/generated/user_constants.h
 
 
 LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
 LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
 LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
 LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
@@ -118,9 +127,7 @@ endef
 
 
 # When cleaning we don't include .config, so we don't include
 # When cleaning we don't include .config, so we don't include
 # TT or skas makefiles and don't clean skas_ptregs.h.
 # TT or skas makefiles and don't clean skas_ptregs.h.
-CLEAN_FILES += linux x.i gmon.out \
-	$(SHARED_HEADERS)/user_constants.h \
-	$(SHARED_HEADERS)/kern_constants.h
+CLEAN_FILES += linux x.i gmon.out
 
 
 archclean:
 archclean:
 	@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
 	@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
@@ -128,8 +135,8 @@ archclean:
 
 
 # Generated files
 # Generated files
 
 
-$(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE
-	$(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(SUBARCH) $@
+$(HOST_DIR)/um/user-offsets.s: FORCE
+	$(Q)$(MAKE) $(build)=$(HOST_DIR)/um $@
 
 
 define filechk_gen-asm-offsets
 define filechk_gen-asm-offsets
         (set -e; \
         (set -e; \
@@ -144,11 +151,7 @@ define filechk_gen-asm-offsets
          echo ""; )
          echo ""; )
 endef
 endef
 
 
-$(SHARED_HEADERS)/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s
+include/generated/user_constants.h: $(HOST_DIR)/um/user-offsets.s
 	$(call filechk,gen-asm-offsets)
 	$(call filechk,gen-asm-offsets)
 
 
-$(SHARED_HEADERS)/kern_constants.h:
-	$(Q)mkdir -p $(dir $@)
-	$(Q)echo '#include "../../../../include/generated/asm-offsets.h"' >$@
-
-export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH
+export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS DEV_NULL_PATH

+ 0 - 26
arch/um/Makefile-x86_64

@@ -1,26 +0,0 @@
-# Copyright 2003 - 2004 Pathscale, Inc
-# Released under the GPL
-
-core-y += arch/um/sys-x86_64/ arch/x86/crypto/
-START := 0x60000000
-
-_extra_flags_ = -fno-builtin -m64
-
-KBUILD_CFLAGS += $(_extra_flags_)
-
-CHECKFLAGS  += -m64 -D__x86_64__
-KBUILD_AFLAGS += -m64
-LDFLAGS += -m elf_x86_64
-KBUILD_CPPFLAGS += -m64
-
-ELF_ARCH := i386:x86-64
-ELF_FORMAT := elf64-x86-64
-HEADER_ARCH := x86
-
-# Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.
-
-LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
-LINK-y += -m64
-
-# Do unit-at-a-time unconditionally on x86_64, following the host
-KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)

+ 3 - 3
arch/um/include/shared/chan_kern.h → arch/um/drivers/chan.h

@@ -6,9 +6,9 @@
 #ifndef __CHAN_KERN_H__
 #ifndef __CHAN_KERN_H__
 #define __CHAN_KERN_H__
 #define __CHAN_KERN_H__
 
 
-#include "linux/tty.h"
-#include "linux/list.h"
-#include "linux/console.h"
+#include <linux/tty.h>
+#include <linux/list.h>
+#include <linux/console.h>
 #include "chan_user.h"
 #include "chan_user.h"
 #include "line.h"
 #include "line.h"
 
 

+ 6 - 6
arch/um/drivers/chan_kern.c

@@ -6,7 +6,7 @@
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/tty.h>
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
 #include <linux/tty_flip.h>
-#include "chan_kern.h"
+#include "chan.h"
 #include "os.h"
 #include "os.h"
 
 
 #ifdef CONFIG_NOCONFIG_CHAN
 #ifdef CONFIG_NOCONFIG_CHAN
@@ -358,11 +358,11 @@ int chan_window_size(struct list_head *chans, unsigned short *rows_out,
 	return 0;
 	return 0;
 }
 }
 
 
-static void free_one_chan(struct chan *chan, int delay_free_irq)
+static void free_one_chan(struct chan *chan)
 {
 {
 	list_del(&chan->list);
 	list_del(&chan->list);
 
 
-	close_one_chan(chan, delay_free_irq);
+	close_one_chan(chan, 0);
 
 
 	if (chan->ops->free != NULL)
 	if (chan->ops->free != NULL)
 		(*chan->ops->free)(chan->data);
 		(*chan->ops->free)(chan->data);
@@ -372,14 +372,14 @@ static void free_one_chan(struct chan *chan, int delay_free_irq)
 	kfree(chan);
 	kfree(chan);
 }
 }
 
 
-static void free_chan(struct list_head *chans, int delay_free_irq)
+static void free_chan(struct list_head *chans)
 {
 {
 	struct list_head *ele, *next;
 	struct list_head *ele, *next;
 	struct chan *chan;
 	struct chan *chan;
 
 
 	list_for_each_safe(ele, next, chans) {
 	list_for_each_safe(ele, next, chans) {
 		chan = list_entry(ele, struct chan, list);
 		chan = list_entry(ele, struct chan, list);
-		free_one_chan(chan, delay_free_irq);
+		free_one_chan(chan);
 	}
 	}
 }
 }
 
 
@@ -547,7 +547,7 @@ int parse_chan_pair(char *str, struct line *line, int device,
 	char *in, *out;
 	char *in, *out;
 
 
 	if (!list_empty(chans)) {
 	if (!list_empty(chans)) {
-		free_chan(chans, 0);
+		free_chan(chans);
 		INIT_LIST_HEAD(chans);
 		INIT_LIST_HEAD(chans);
 	}
 	}
 
 

+ 6 - 3
arch/um/drivers/chan_user.c

@@ -11,10 +11,8 @@
 #include <termios.h>
 #include <termios.h>
 #include <sys/ioctl.h>
 #include <sys/ioctl.h>
 #include "chan_user.h"
 #include "chan_user.h"
-#include "kern_constants.h"
 #include "os.h"
 #include "os.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 void generic_close(int fd, void *unused)
 void generic_close(int fd, void *unused)
 {
 {
@@ -283,7 +281,12 @@ void register_winch(int fd, struct tty_struct *tty)
 		return;
 		return;
 
 
 	pid = tcgetpgrp(fd);
 	pid = tcgetpgrp(fd);
-	if (!is_skas_winch(pid, fd, tty) && (pid == -1)) {
+	if (is_skas_winch(pid, fd, tty)) {
+		register_winch_irq(-1, fd, -1, tty, 0);
+		return;
+	}
+
+	if (pid == -1) {
 		thread = winch_tramp(fd, tty, &thread_fd, &stack);
 		thread = winch_tramp(fd, tty, &thread_fd, &stack);
 		if (thread < 0)
 		if (thread < 0)
 			return;
 			return;

+ 0 - 0
arch/um/include/shared/chan_user.h → arch/um/drivers/chan_user.h


+ 0 - 1
arch/um/drivers/cow_sys.h

@@ -3,7 +3,6 @@
 
 
 #include "kern_util.h"
 #include "kern_util.h"
 #include "os.h"
 #include "os.h"
-#include "user.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
 
 
 static inline void *cow_malloc(int size)
 static inline void *cow_malloc(int size)

+ 0 - 1
arch/um/drivers/daemon_user.c

@@ -17,7 +17,6 @@
 #include "net_user.h"
 #include "net_user.h"
 #include "os.h"
 #include "os.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 enum request_type { REQ_NEW_CONTROL };
 enum request_type { REQ_NEW_CONTROL };
 
 

+ 0 - 2
arch/um/drivers/fd.c

@@ -9,10 +9,8 @@
 #include <errno.h>
 #include <errno.h>
 #include <termios.h>
 #include <termios.h>
 #include "chan_user.h"
 #include "chan_user.h"
-#include "kern_constants.h"
 #include "os.h"
 #include "os.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 struct fd_chan {
 struct fd_chan {
 	int fd;
 	int fd;

+ 0 - 1
arch/um/drivers/harddog_user.c

@@ -7,7 +7,6 @@
 #include <unistd.h>
 #include <unistd.h>
 #include <errno.h>
 #include <errno.h>
 #include "os.h"
 #include "os.h"
-#include "user.h"
 
 
 struct dog_data {
 struct dog_data {
 	int stdin;
 	int stdin;

+ 1 - 1
arch/um/drivers/line.c

@@ -7,7 +7,7 @@
 #include "linux/kd.h"
 #include "linux/kd.h"
 #include "linux/sched.h"
 #include "linux/sched.h"
 #include "linux/slab.h"
 #include "linux/slab.h"
-#include "chan_kern.h"
+#include "chan.h"
 #include "irq_kern.h"
 #include "irq_kern.h"
 #include "irq_user.h"
 #include "irq_user.h"
 #include "kern_util.h"
 #include "kern_util.h"

+ 0 - 0
arch/um/include/shared/line.h → arch/um/drivers/line.h


+ 0 - 0
arch/um/include/shared/mconsole.h → arch/um/drivers/mconsole.h


+ 0 - 0
arch/um/include/shared/mconsole_kern.h → arch/um/drivers/mconsole_kern.h


+ 0 - 2
arch/um/drivers/mconsole_user.c

@@ -10,9 +10,7 @@
 #include <sys/socket.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
 #include <sys/uio.h>
 #include <sys/un.h>
 #include <sys/un.h>
-#include "kern_constants.h"
 #include "mconsole.h"
 #include "mconsole.h"
-#include "user.h"
 
 
 static struct mconsole_command commands[] = {
 static struct mconsole_command commands[] = {
 	/*
 	/*

+ 0 - 2
arch/um/drivers/net_user.c

@@ -12,10 +12,8 @@
 #include <sys/socket.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
 #include "net_user.h"
 #include "net_user.h"
-#include "kern_constants.h"
 #include "os.h"
 #include "os.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 int tap_open_common(void *dev, char *gate_addr)
 int tap_open_common(void *dev, char *gate_addr)
 {
 {

+ 0 - 2
arch/um/drivers/pcap_user.c

@@ -9,9 +9,7 @@
 #include <asm/types.h>
 #include <asm/types.h>
 #include "net_user.h"
 #include "net_user.h"
 #include "pcap_user.h"
 #include "pcap_user.h"
-#include "kern_constants.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 #define PCAP_FD(p) (*(int *)(p))
 #define PCAP_FD(p) (*(int *)(p))
 
 

+ 0 - 2
arch/um/drivers/port_user.c

@@ -10,11 +10,9 @@
 #include <unistd.h>
 #include <unistd.h>
 #include <netinet/in.h>
 #include <netinet/in.h>
 #include "chan_user.h"
 #include "chan_user.h"
-#include "kern_constants.h"
 #include "os.h"
 #include "os.h"
 #include "port.h"
 #include "port.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 struct port_chan {
 struct port_chan {
 	int raw;
 	int raw;

+ 0 - 2
arch/um/drivers/pty.c

@@ -12,10 +12,8 @@
 #include <termios.h>
 #include <termios.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include "chan_user.h"
 #include "chan_user.h"
-#include "kern_constants.h"
 #include "os.h"
 #include "os.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 struct pty_chan {
 struct pty_chan {
 	void (*announce)(char *dev_name, int dev);
 	void (*announce)(char *dev_name, int dev);

+ 0 - 2
arch/um/drivers/slip_user.c

@@ -11,12 +11,10 @@
 #include <string.h>
 #include <string.h>
 #include <sys/termios.h>
 #include <sys/termios.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
-#include "kern_constants.h"
 #include "net_user.h"
 #include "net_user.h"
 #include "os.h"
 #include "os.h"
 #include "slip.h"
 #include "slip.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 static int slip_user_init(void *data, void *dev)
 static int slip_user_init(void *data, void *dev)
 {
 {

+ 0 - 2
arch/um/drivers/slirp_user.c

@@ -7,11 +7,9 @@
 #include <errno.h>
 #include <errno.h>
 #include <string.h>
 #include <string.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
-#include "kern_constants.h"
 #include "net_user.h"
 #include "net_user.h"
 #include "os.h"
 #include "os.h"
 #include "slirp.h"
 #include "slirp.h"
-#include "user.h"
 
 
 static int slirp_user_init(void *data, void *dev)
 static int slirp_user_init(void *data, void *dev)
 {
 {

+ 1 - 3
arch/um/drivers/ssl.c

@@ -12,10 +12,8 @@
 #include "linux/console.h"
 #include "linux/console.h"
 #include "asm/termbits.h"
 #include "asm/termbits.h"
 #include "asm/irq.h"
 #include "asm/irq.h"
-#include "line.h"
 #include "ssl.h"
 #include "ssl.h"
-#include "chan_kern.h"
-#include "kern.h"
+#include "chan.h"
 #include "init.h"
 #include "init.h"
 #include "irq_user.h"
 #include "irq_user.h"
 #include "mconsole_kern.h"
 #include "mconsole_kern.h"

+ 1 - 2
arch/um/drivers/stdio_console.c

@@ -20,8 +20,7 @@
 #include "asm/current.h"
 #include "asm/current.h"
 #include "asm/irq.h"
 #include "asm/irq.h"
 #include "stdio_console.h"
 #include "stdio_console.h"
-#include "line.h"
-#include "chan_kern.h"
+#include "chan.h"
 #include "irq_user.h"
 #include "irq_user.h"
 #include "mconsole_kern.h"
 #include "mconsole_kern.h"
 #include "init.h"
 #include "init.h"

+ 0 - 2
arch/um/drivers/tty.c

@@ -7,10 +7,8 @@
 #include <fcntl.h>
 #include <fcntl.h>
 #include <termios.h>
 #include <termios.h>
 #include "chan_user.h"
 #include "chan_user.h"
-#include "kern_constants.h"
 #include "os.h"
 #include "os.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 struct tty_chan {
 struct tty_chan {
 	char *dev;
 	char *dev;

+ 30 - 3
arch/um/drivers/ubd_kern.c

@@ -46,7 +46,6 @@
 #include "asm/tlbflush.h"
 #include "asm/tlbflush.h"
 #include "mem_user.h"
 #include "mem_user.h"
 #include "kern_util.h"
 #include "kern_util.h"
-#include "kern.h"
 #include "mconsole_kern.h"
 #include "mconsole_kern.h"
 #include "init.h"
 #include "init.h"
 #include "irq_user.h"
 #include "irq_user.h"
@@ -54,7 +53,6 @@
 #include "ubd_user.h"
 #include "ubd_user.h"
 #include "os.h"
 #include "os.h"
 #include "mem.h"
 #include "mem.h"
-#include "mem_kern.h"
 #include "cow.h"
 #include "cow.h"
 
 
 enum ubd_req { UBD_READ, UBD_WRITE };
 enum ubd_req { UBD_READ, UBD_WRITE };
@@ -513,8 +511,37 @@ __uml_exitcall(kill_io_thread);
 static inline int ubd_file_size(struct ubd *ubd_dev, __u64 *size_out)
 static inline int ubd_file_size(struct ubd *ubd_dev, __u64 *size_out)
 {
 {
 	char *file;
 	char *file;
+	int fd;
+	int err;
+
+	__u32 version;
+	__u32 align;
+	char *backing_file;
+	time_t mtime;
+	unsigned long long size;
+	int sector_size;
+	int bitmap_offset;
+
+	if (ubd_dev->file && ubd_dev->cow.file) {
+		file = ubd_dev->cow.file;
+
+		goto out;
+	}
 
 
-	file = ubd_dev->cow.file ? ubd_dev->cow.file : ubd_dev->file;
+	fd = os_open_file(ubd_dev->file, global_openflags, 0);
+	if (fd < 0)
+		return fd;
+
+	err = read_cow_header(file_reader, &fd, &version, &backing_file, \
+		&mtime, &size, &sector_size, &align, &bitmap_offset);
+	os_close_file(fd);
+
+	if(err == -EINVAL)
+		file = ubd_dev->file;
+	else
+		file = backing_file;
+
+out:
 	return os_file_size(file, size_out);
 	return os_file_size(file, size_out);
 }
 }
 
 

+ 0 - 1
arch/um/drivers/ubd_user.c

@@ -16,7 +16,6 @@
 #include <sys/mman.h>
 #include <sys/mman.h>
 #include <sys/param.h>
 #include <sys/param.h>
 #include "asm/types.h"
 #include "asm/types.h"
-#include "user.h"
 #include "ubd_user.h"
 #include "ubd_user.h"
 #include "os.h"
 #include "os.h"
 #include "cow.h"
 #include "cow.h"

+ 0 - 0
arch/um/include/shared/ubd_user.h → arch/um/drivers/ubd_user.h


+ 0 - 2
arch/um/drivers/umcast_user.c

@@ -15,11 +15,9 @@
 #include <unistd.h>
 #include <unistd.h>
 #include <errno.h>
 #include <errno.h>
 #include <netinet/in.h>
 #include <netinet/in.h>
-#include "kern_constants.h"
 #include "umcast.h"
 #include "umcast.h"
 #include "net_user.h"
 #include "net_user.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 static struct sockaddr_in *new_addr(char *addr, unsigned short port)
 static struct sockaddr_in *new_addr(char *addr, unsigned short port)
 {
 {

+ 0 - 2
arch/um/drivers/vde_user.c

@@ -6,10 +6,8 @@
 #include <stddef.h>
 #include <stddef.h>
 #include <errno.h>
 #include <errno.h>
 #include <libvdeplug.h>
 #include <libvdeplug.h>
-#include "kern_constants.h"
 #include "net_user.h"
 #include "net_user.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 #include "vde.h"
 #include "vde.h"
 
 
 static int vde_user_init(void *data, void *dev)
 static int vde_user_init(void *data, void *dev)

+ 0 - 2
arch/um/drivers/xterm.c

@@ -11,10 +11,8 @@
 #include <string.h>
 #include <string.h>
 #include <termios.h>
 #include <termios.h>
 #include "chan_user.h"
 #include "chan_user.h"
-#include "kern_constants.h"
 #include "os.h"
 #include "os.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 #include "xterm.h"
 #include "xterm.h"
 
 
 struct xterm_chan {
 struct xterm_chan {

+ 3 - 0
arch/um/include/asm/Kbuild

@@ -0,0 +1,3 @@
+generic-y += bug.h cputime.h device.h emergency-restart.h futex.h hardirq.h
+generic-y += hw_irq.h irq_regs.h kdebug.h percpu.h sections.h topology.h xor.h
+generic-y += ftrace.h

+ 0 - 6
arch/um/include/asm/bug.h

@@ -1,6 +0,0 @@
-#ifndef __UM_BUG_H
-#define __UM_BUG_H
-
-#include <asm-generic/bug.h>
-
-#endif

+ 0 - 6
arch/um/include/asm/checksum.h

@@ -1,6 +0,0 @@
-#ifndef __UM_CHECKSUM_H
-#define __UM_CHECKSUM_H
-
-#include "sysdep/checksum.h"
-
-#endif

+ 0 - 6
arch/um/include/asm/cputime.h

@@ -1,6 +0,0 @@
-#ifndef __UM_CPUTIME_H
-#define __UM_CPUTIME_H
-
-#include <asm-generic/cputime.h>
-
-#endif /* __UM_CPUTIME_H */

+ 0 - 7
arch/um/include/asm/device.h

@@ -1,7 +0,0 @@
-/*
- * Arch specific extensions to struct device
- *
- * This file is released under the GPLv2
- */
-#include <asm-generic/device.h>
-

+ 0 - 6
arch/um/include/asm/emergency-restart.h

@@ -1,6 +0,0 @@
-#ifndef _ASM_EMERGENCY_RESTART_H
-#define _ASM_EMERGENCY_RESTART_H
-
-#include <asm-generic/emergency-restart.h>
-
-#endif /* _ASM_EMERGENCY_RESTART_H */

+ 0 - 1
arch/um/include/asm/ftrace.h

@@ -1 +0,0 @@
-/* empty */

+ 0 - 6
arch/um/include/asm/futex.h

@@ -1,6 +0,0 @@
-#ifndef _ASM_FUTEX_H
-#define _ASM_FUTEX_H
-
-#include <asm-generic/futex.h>
-
-#endif

+ 0 - 1
arch/um/include/asm/hardirq.h

@@ -1 +0,0 @@
-#include <asm-generic/hardirq.h>

+ 0 - 7
arch/um/include/asm/hw_irq.h

@@ -1,7 +0,0 @@
-#ifndef _ASM_UM_HW_IRQ_H
-#define _ASM_UM_HW_IRQ_H
-
-#include "asm/irq.h"
-#include "asm/archparam.h"
-
-#endif

+ 0 - 1
arch/um/include/asm/irq_regs.h

@@ -1 +0,0 @@
-#include <asm-generic/irq_regs.h>

+ 37 - 1
arch/um/include/asm/irqflags.h

@@ -1,6 +1,42 @@
 #ifndef __UM_IRQFLAGS_H
 #ifndef __UM_IRQFLAGS_H
 #define __UM_IRQFLAGS_H
 #define __UM_IRQFLAGS_H
 
 
-/* Empty for now */
+extern int get_signals(void);
+extern int set_signals(int enable);
+extern void block_signals(void);
+extern void unblock_signals(void);
+
+static inline unsigned long arch_local_save_flags(void)
+{
+	return get_signals();
+}
+
+static inline void arch_local_irq_restore(unsigned long flags)
+{
+	set_signals(flags);
+}
+
+static inline void arch_local_irq_enable(void)
+{
+	unblock_signals();
+}
+
+static inline void arch_local_irq_disable(void)
+{
+	block_signals();
+}
+
+static inline unsigned long arch_local_irq_save(void)
+{
+	unsigned long flags;
+	flags = arch_local_save_flags();
+	arch_local_irq_disable();
+	return flags;
+}
+
+static inline bool arch_irqs_disabled(void)
+{
+	return arch_local_save_flags() == 0;
+}
 
 
 #endif
 #endif

+ 0 - 1
arch/um/include/asm/kdebug.h

@@ -1 +0,0 @@
-#include <asm-generic/kdebug.h>

+ 17 - 5
arch/um/include/asm/mmu.h

@@ -1,12 +1,24 @@
 /* 
 /* 
- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
  * Licensed under the GPL
  */
  */
 
 
-#ifndef __MMU_H
-#define __MMU_H
+#ifndef __ARCH_UM_MMU_H
+#define __ARCH_UM_MMU_H
 
 
-#include "um_mmu.h"
+#include "mm_id.h"
+#include <asm/mm_context.h>
 
 
-#endif
+typedef struct mm_context {
+	struct mm_id id;
+	struct uml_arch_mm_context arch;
+	struct page **stub_pages;
+} mm_context_t;
+
+extern void __switch_mm(struct mm_id * mm_idp);
 
 
+/* Avoid tangled inclusion with asm/ldt.h */
+extern long init_new_ldt(struct mm_context *to_mm, struct mm_context *from_mm);
+extern void free_ldt(struct mm_context *mm);
+
+#endif

+ 2 - 5
arch/um/include/asm/mmu_context.h

@@ -6,15 +6,12 @@
 #ifndef __UM_MMU_CONTEXT_H
 #ifndef __UM_MMU_CONTEXT_H
 #define __UM_MMU_CONTEXT_H
 #define __UM_MMU_CONTEXT_H
 
 
-#include "linux/sched.h"
-#include "um_mmu.h"
+#include <linux/sched.h>
+#include <asm/mmu.h>
 
 
 extern void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm);
 extern void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm);
 extern void arch_exit_mmap(struct mm_struct *mm);
 extern void arch_exit_mmap(struct mm_struct *mm);
 
 
-#define get_mmu_context(task) do ; while(0)
-#define activate_context(tsk) do ; while(0)
-
 #define deactivate_mm(tsk,mm)	do { } while (0)
 #define deactivate_mm(tsk,mm)	do { } while (0)
 
 
 extern void force_flush_all(void);
 extern void force_flush_all(void);

+ 1 - 1
arch/um/include/asm/page.h

@@ -19,7 +19,7 @@
 struct page;
 struct page;
 
 
 #include <linux/types.h>
 #include <linux/types.h>
-#include <sysdep/vm-flags.h>
+#include <asm/vm-flags.h>
 
 
 /*
 /*
  * These are used to make use of C type-checking..
  * These are used to make use of C type-checking..

+ 0 - 1
arch/um/include/asm/page_offset.h

@@ -1 +0,0 @@
-#define PAGE_OFFSET_RAW (uml_physmem)

+ 0 - 21
arch/um/include/asm/pda.h

@@ -1,21 +0,0 @@
-/*
- * Copyright 2003 PathScale, Inc.
- *
- * Licensed under the GPL
- */
-
-#ifndef __UM_PDA_X86_64_H
-#define __UM_PDA_X86_64_H
-
-/* XXX */
-struct foo {
-	unsigned int __softirq_pending;
-	unsigned int __nmi_count;
-};
-
-extern struct foo me;
-
-#define read_pda(me) (&me)
-
-#endif
-

+ 0 - 6
arch/um/include/asm/percpu.h

@@ -1,6 +0,0 @@
-#ifndef __UM_PERCPU_H
-#define __UM_PERCPU_H
-
-#include <asm-generic/percpu.h>
-
-#endif /* __UM_PERCPU_H */

+ 0 - 7
arch/um/include/asm/ptrace-generic.h

@@ -23,17 +23,10 @@ struct pt_regs {
 #define PT_REGS_IP(r) UPT_IP(&(r)->regs)
 #define PT_REGS_IP(r) UPT_IP(&(r)->regs)
 #define PT_REGS_SP(r) UPT_SP(&(r)->regs)
 #define PT_REGS_SP(r) UPT_SP(&(r)->regs)
 
 
-#define PT_REG(r, reg) UPT_REG(&(r)->regs, reg)
-#define PT_REGS_SET(r, reg, val) UPT_SET(&(r)->regs, reg, val)
-
-#define PT_REGS_SET_SYSCALL_RETURN(r, res) \
-	UPT_SET_SYSCALL_RETURN(&(r)->regs, res)
 #define PT_REGS_RESTART_SYSCALL(r) UPT_RESTART_SYSCALL(&(r)->regs)
 #define PT_REGS_RESTART_SYSCALL(r) UPT_RESTART_SYSCALL(&(r)->regs)
 
 
 #define PT_REGS_SYSCALL_NR(r) UPT_SYSCALL_NR(&(r)->regs)
 #define PT_REGS_SYSCALL_NR(r) UPT_SYSCALL_NR(&(r)->regs)
 
 
-#define PT_REGS_SC(r) UPT_SC(&(r)->regs)
-
 #define instruction_pointer(regs) PT_REGS_IP(regs)
 #define instruction_pointer(regs) PT_REGS_IP(regs)
 
 
 struct task_struct;
 struct task_struct;

+ 0 - 7
arch/um/include/asm/sections.h

@@ -1,7 +0,0 @@
-#ifndef _UM_SECTIONS_H
-#define _UM_SECTIONS_H
-
-/* nothing to see, move along */
-#include <asm-generic/sections.h>
-
-#endif

+ 0 - 47
arch/um/include/asm/system.h

@@ -1,47 +0,0 @@
-#ifndef __UM_SYSTEM_GENERIC_H
-#define __UM_SYSTEM_GENERIC_H
-
-#include "sysdep/system.h"
-
-extern int get_signals(void);
-extern int set_signals(int enable);
-extern void block_signals(void);
-extern void unblock_signals(void);
-
-static inline unsigned long arch_local_save_flags(void)
-{
-	return get_signals();
-}
-
-static inline void arch_local_irq_restore(unsigned long flags)
-{
-	set_signals(flags);
-}
-
-static inline void arch_local_irq_enable(void)
-{
-	unblock_signals();
-}
-
-static inline void arch_local_irq_disable(void)
-{
-	block_signals();
-}
-
-static inline unsigned long arch_local_irq_save(void)
-{
-	unsigned long flags;
-	flags = arch_local_save_flags();
-	arch_local_irq_disable();
-	return flags;
-}
-
-static inline bool arch_irqs_disabled(void)
-{
-	return arch_local_save_flags() == 0;
-}
-
-extern void *_switch_to(void *prev, void *next, void *last);
-#define switch_to(prev, next, last) prev = _switch_to(prev, next, last)
-
-#endif

+ 0 - 6
arch/um/include/asm/topology.h

@@ -1,6 +0,0 @@
-#ifndef _ASM_UM_TOPOLOGY_H
-#define _ASM_UM_TOPOLOGY_H
-
-#include <asm-generic/topology.h>
-
-#endif

+ 84 - 5
arch/um/include/asm/uaccess.h

@@ -6,15 +6,15 @@
 #ifndef __UM_UACCESS_H
 #ifndef __UM_UACCESS_H
 #define __UM_UACCESS_H
 #define __UM_UACCESS_H
 
 
-#include <asm/errno.h>
-#include <asm/processor.h>
-
 /* thread_info has a mm_segment_t in it, so put the definition up here */
 /* thread_info has a mm_segment_t in it, so put the definition up here */
 typedef struct {
 typedef struct {
 	unsigned long seg;
 	unsigned long seg;
 } mm_segment_t;
 } mm_segment_t;
 
 
-#include "linux/thread_info.h"
+#include <linux/thread_info.h>
+#include <linux/errno.h>
+#include <asm/processor.h>
+#include <asm/elf.h>
 
 
 #define VERIFY_READ 0
 #define VERIFY_READ 0
 #define VERIFY_WRITE 1
 #define VERIFY_WRITE 1
@@ -38,7 +38,86 @@ typedef struct {
 
 
 #define segment_eq(a, b) ((a).seg == (b).seg)
 #define segment_eq(a, b) ((a).seg == (b).seg)
 
 
-#include "um_uaccess.h"
+#define __under_task_size(addr, size) \
+	(((unsigned long) (addr) < TASK_SIZE) && \
+	 (((unsigned long) (addr) + (size)) < TASK_SIZE))
+
+#define __access_ok_vsyscall(type, addr, size) \
+	 ((type == VERIFY_READ) && \
+	  ((unsigned long) (addr) >= FIXADDR_USER_START) && \
+	  ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \
+	  ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))
+
+#define __addr_range_nowrap(addr, size) \
+	((unsigned long) (addr) <= ((unsigned long) (addr) + (size)))
+
+#define access_ok(type, addr, size) \
+	(__addr_range_nowrap(addr, size) && \
+	 (__under_task_size(addr, size) || \
+	  __access_ok_vsyscall(type, addr, size) || \
+	  segment_eq(get_fs(), KERNEL_DS)))
+
+extern int copy_from_user(void *to, const void __user *from, int n);
+extern int copy_to_user(void __user *to, const void *from, int n);
+
+/*
+ * strncpy_from_user: - Copy a NUL terminated string from userspace.
+ * @dst:   Destination address, in kernel space.  This buffer must be at
+ *         least @count bytes long.
+ * @src:   Source address, in user space.
+ * @count: Maximum number of bytes to copy, including the trailing NUL.
+ *
+ * Copies a NUL-terminated string from userspace to kernel space.
+ *
+ * On success, returns the length of the string (not including the trailing
+ * NUL).
+ *
+ * If access to userspace fails, returns -EFAULT (some data may have been
+ * copied).
+ *
+ * If @count is smaller than the length of the string, copies @count bytes
+ * and returns @count.
+ */
+
+extern int strncpy_from_user(char *dst, const char __user *src, int count);
+
+/*
+ * __clear_user: - Zero a block of memory in user space, with less checking.
+ * @to:   Destination address, in user space.
+ * @n:    Number of bytes to zero.
+ *
+ * Zero a block of memory in user space.  Caller must check
+ * the specified block with access_ok() before calling this function.
+ *
+ * Returns number of bytes that could not be cleared.
+ * On success, this will be zero.
+ */
+extern int __clear_user(void __user *mem, int len);
+
+/*
+ * clear_user: - Zero a block of memory in user space.
+ * @to:   Destination address, in user space.
+ * @n:    Number of bytes to zero.
+ *
+ * Zero a block of memory in user space.
+ *
+ * Returns number of bytes that could not be cleared.
+ * On success, this will be zero.
+ */
+extern int clear_user(void __user *mem, int len);
+
+/*
+ * strlen_user: - Get the size of a string in user space.
+ * @str: The string to measure.
+ * @n:   The maximum valid length
+ *
+ * Get the size of a NUL-terminated string in user space.
+ *
+ * Returns the size of the string INCLUDING the terminating NUL.
+ * On exception, returns 0.
+ * If the string is too long, returns a value greater than @n.
+ */
+extern int strnlen_user(const void __user *str, int len);
 
 
 #define __copy_from_user(to, from, n) copy_from_user(to, from, n)
 #define __copy_from_user(to, from, n) copy_from_user(to, from, n)
 
 

+ 0 - 6
arch/um/include/asm/xor.h

@@ -1,6 +0,0 @@
-#ifndef __UM_XOR_H
-#define __UM_XOR_H
-
-#include "asm-generic/xor.h"
-
-#endif

+ 1 - 1
arch/um/include/shared/as-layout.h

@@ -6,7 +6,7 @@
 #ifndef __START_H__
 #ifndef __START_H__
 #define __START_H__
 #define __START_H__
 
 
-#include "kern_constants.h"
+#include <generated/asm-offsets.h>
 
 
 /*
 /*
  * Stolen from linux/const.h, which can't be directly included since
  * Stolen from linux/const.h, which can't be directly included since

+ 0 - 1
arch/um/include/shared/common-offsets.h

@@ -2,7 +2,6 @@
 
 
 DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE);
 DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE);
 
 
-OFFSET(HOST_TASK_REGS, task_struct, thread.regs);
 OFFSET(HOST_TASK_PID, task_struct, pid);
 OFFSET(HOST_TASK_PID, task_struct, pid);
 
 
 DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE);
 DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE);

+ 0 - 12
arch/um/include/shared/initrd.h

@@ -1,12 +0,0 @@
-/*
- * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#ifndef __INITRD_USER_H__
-#define __INITRD_USER_H__
-
-extern int load_initrd(char *filename, void *buf, int size);
-
-#endif
-

+ 0 - 18
arch/um/include/shared/kern.h

@@ -13,28 +13,10 @@
  * includes.
  * includes.
  */
  */
 
 
-extern int errno;
-
-extern int clone(int (*proc)(void *), void *sp, int flags, void *data);
-extern int sleep(int);
 extern int printf(const char *fmt, ...);
 extern int printf(const char *fmt, ...);
-extern char *strerror(int errnum);
-extern char *ptsname(int __fd);
-extern int munmap(void *, int);
 extern void *sbrk(int increment);
 extern void *sbrk(int increment);
-extern void *malloc(int size);
-extern void perror(char *err);
-extern int kill(int pid, int sig);
-extern int getuid(void);
-extern int getgid(void);
 extern int pause(void);
 extern int pause(void);
-extern int write(int, const void *, int);
 extern void exit(int);
 extern void exit(int);
-extern int close(int);
-extern int read(unsigned int, char *, int);
-extern int pipe(int *);
-extern int sched_yield(void);
-extern int ptrace(int op, int pid, long addr, long data);
 
 
 #endif
 #endif
 
 

+ 0 - 1
arch/um/include/shared/kern_util.h

@@ -21,7 +21,6 @@ extern unsigned long alloc_stack(int order, int atomic);
 extern void free_stack(unsigned long stack, int order);
 extern void free_stack(unsigned long stack, int order);
 
 
 extern int do_signal(void);
 extern int do_signal(void);
-extern void copy_sc(struct uml_pt_regs *regs, void *from);
 extern void interrupt_end(void);
 extern void interrupt_end(void);
 extern void relay_signal(int sig, struct uml_pt_regs *regs);
 extern void relay_signal(int sig, struct uml_pt_regs *regs);
 
 

+ 0 - 37
arch/um/include/shared/ldt.h

@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2004 Fujitsu Siemens Computers GmbH
- * Licensed under the GPL
- *
- * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
- */
-
-#ifndef __ASM_LDT_H
-#define __ASM_LDT_H
-
-#include <linux/mutex.h>
-#include <sysdep/host_ldt.h>
-
-extern void ldt_host_info(void);
-
-#define LDT_PAGES_MAX \
-	((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE)
-#define LDT_ENTRIES_PER_PAGE \
-	(PAGE_SIZE/LDT_ENTRY_SIZE)
-#define LDT_DIRECT_ENTRIES \
-	((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE)
-
-struct ldt_entry {
-	__u32 a;
-	__u32 b;
-};
-
-typedef struct uml_ldt {
-	int entry_count;
-	struct mutex lock;
-	union {
-		struct ldt_entry * pages[LDT_PAGES_MAX];
-		struct ldt_entry entries[LDT_DIRECT_ENTRIES];
-	} u;
-} uml_ldt_t;
-
-#endif

+ 0 - 20
arch/um/include/shared/mem_kern.h

@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2003 Jeff Dike (jdike@addtoit.com)
- * Licensed under the GPL
- */
-
-#ifndef __MEM_KERN_H__
-#define __MEM_KERN_H__
-
-#include "linux/list.h"
-#include "linux/types.h"
-
-struct remapper {
-	struct list_head list;
-	int (*proc)(int, unsigned long, int, __u64);
-};
-
-extern void register_remapper(struct remapper *info);
-
-#endif
-

+ 1 - 12
arch/um/include/shared/os.h

@@ -10,7 +10,6 @@
 #include "irq_user.h"
 #include "irq_user.h"
 #include "longjmp.h"
 #include "longjmp.h"
 #include "mm_id.h"
 #include "mm_id.h"
-#include "sysdep/tls.h"
 
 
 #define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR))
 #define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR))
 
 
@@ -203,12 +202,6 @@ extern int os_drop_memory(void *addr, int length);
 extern int can_drop_memory(void);
 extern int can_drop_memory(void);
 extern void os_flush_stdout(void);
 extern void os_flush_stdout(void);
 
 
-/* uaccess.c */
-extern unsigned long __do_user_copy(void *to, const void *from, int n,
-				    void **fault_addr, jmp_buf **fault_catcher,
-				    void (*op)(void *to, const void *from,
-					       int n), int *faulted_out);
-
 /* execvp.c */
 /* execvp.c */
 extern int execvp_noalloc(char *buf, const char *file, char *const argv[]);
 extern int execvp_noalloc(char *buf, const char *file, char *const argv[]);
 /* helper.c */
 /* helper.c */
@@ -218,10 +211,6 @@ extern int run_helper_thread(int (*proc)(void *), void *arg,
 extern int helper_wait(int pid);
 extern int helper_wait(int pid);
 
 
 
 
-/* tls.c */
-extern int os_set_thread_area(user_desc_t *info, int pid);
-extern int os_get_thread_area(user_desc_t *info, int pid);
-
 /* umid.c */
 /* umid.c */
 extern int umid_file_name(char *name, char *buf, int len);
 extern int umid_file_name(char *name, char *buf, int len);
 extern int set_umid(char *name);
 extern int set_umid(char *name);
@@ -231,7 +220,7 @@ extern char *get_umid(void);
 extern void timer_init(void);
 extern void timer_init(void);
 extern void set_sigstack(void *sig_stack, int size);
 extern void set_sigstack(void *sig_stack, int size);
 extern void remove_sigstack(void);
 extern void remove_sigstack(void);
-extern void set_handler(int sig, void (*handler)(int), int flags, ...);
+extern void set_handler(int sig);
 extern int change_sig(int signal, int on);
 extern int change_sig(int signal, int on);
 extern void block_signals(void);
 extern void block_signals(void);
 extern void unblock_signals(void);
 extern void unblock_signals(void);

+ 0 - 17
arch/um/include/shared/process.h

@@ -1,17 +0,0 @@
-/* 
- * Copyright (C) 2000 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com)
- * Licensed under the GPL
- */
-
-#ifndef __PROCESS_H__
-#define __PROCESS_H__
-
-#include <signal.h>
-
-/* Copied from linux/compiler-gcc.h since we can't include it directly */
-#define barrier() __asm__ __volatile__("": : :"memory")
-
-extern void sig_handler(int sig, struct sigcontext *sc);
-extern void alarm_handler(int sig, struct sigcontext *sc);
-
-#endif

+ 2 - 1
arch/um/include/shared/ptrace_user.h

@@ -6,7 +6,8 @@
 #ifndef __PTRACE_USER_H__
 #ifndef __PTRACE_USER_H__
 #define __PTRACE_USER_H__
 #define __PTRACE_USER_H__
 
 
-#include "sysdep/ptrace_user.h"
+#include <sys/ptrace.h>
+#include <sysdep/ptrace_user.h>
 
 
 extern int ptrace_getregs(long pid, unsigned long *regs_out);
 extern int ptrace_getregs(long pid, unsigned long *regs_out);
 extern int ptrace_setregs(long pid, unsigned long *regs_in);
 extern int ptrace_setregs(long pid, unsigned long *regs_in);

+ 0 - 6
arch/um/include/shared/skas_ptregs.h

@@ -1,6 +0,0 @@
-#ifndef __SKAS_PT_REGS_
-#define __SKAS_PT_REGS_
-
-#include <user_constants.h>
-
-#endif

+ 0 - 12
arch/um/include/shared/syscall.h

@@ -1,12 +0,0 @@
-/*
- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#ifndef __SYSCALL_USER_H
-#define __SYSCALL_USER_H
-
-extern int record_syscall_start(int syscall);
-extern void record_syscall_end(int index, long result);
-
-#endif

+ 0 - 9
arch/um/include/shared/task.h

@@ -1,9 +0,0 @@
-#ifndef __TASK_H
-#define __TASK_H
-
-#include <kern_constants.h>
-
-#define TASK_REGS(task) ((struct uml_pt_regs *) &(((char *) (task))[HOST_TASK_REGS]))
-#define TASK_PID(task) *((int *) &(((char *) (task))[HOST_TASK_PID]))
-
-#endif

+ 0 - 15
arch/um/include/shared/tlb.h

@@ -1,15 +0,0 @@
-/* 
- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#ifndef __TLB_H__
-#define __TLB_H__
-
-#include "um_mmu.h"
-
-extern void force_flush_all(void);
-extern int flush_tlb_kernel_range_common(unsigned long start,
-					 unsigned long end);
-
-#endif

+ 1 - 1
arch/um/include/shared/um_malloc.h

@@ -6,7 +6,7 @@
 #ifndef __UM_MALLOC_H__
 #ifndef __UM_MALLOC_H__
 #define __UM_MALLOC_H__
 #define __UM_MALLOC_H__
 
 
-#include "kern_constants.h"
+#include <generated/asm-offsets.h>
 
 
 extern void *uml_kmalloc(int size, int flags);
 extern void *uml_kmalloc(int size, int flags);
 extern void kfree(const void *ptr);
 extern void kfree(const void *ptr);

+ 0 - 24
arch/um/include/shared/um_mmu.h

@@ -1,24 +0,0 @@
-/* 
- * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
- * Licensed under the GPL
- */
-
-#ifndef __ARCH_UM_MMU_H
-#define __ARCH_UM_MMU_H
-
-#include "mm_id.h"
-#include "ldt.h"
-
-typedef struct mm_context {
-	struct mm_id id;
-	struct uml_ldt ldt;
-	struct page **stub_pages;
-} mm_context_t;
-
-extern void __switch_mm(struct mm_id * mm_idp);
-
-/* Avoid tangled inclusion with asm/ldt.h */
-extern long init_new_ldt(struct mm_context *to_mm, struct mm_context *from_mm);
-extern void free_ldt(struct mm_context *mm);
-
-#endif

+ 0 - 97
arch/um/include/shared/um_uaccess.h

@@ -1,97 +0,0 @@
-/* 
- * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
- * Licensed under the GPL
- */
-
-#ifndef __ARCH_UM_UACCESS_H
-#define __ARCH_UM_UACCESS_H
-
-#include <asm/elf.h>
-#include <asm/fixmap.h>
-#include "sysdep/archsetjmp.h"
-
-#define __under_task_size(addr, size) \
-	(((unsigned long) (addr) < TASK_SIZE) && \
-	 (((unsigned long) (addr) + (size)) < TASK_SIZE))
-
-#define __access_ok_vsyscall(type, addr, size) \
-	 ((type == VERIFY_READ) && \
-	  ((unsigned long) (addr) >= FIXADDR_USER_START) && \
-	  ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \
-	  ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))
-
-#define __addr_range_nowrap(addr, size) \
-	((unsigned long) (addr) <= ((unsigned long) (addr) + (size)))
-
-#define access_ok(type, addr, size) \
-	(__addr_range_nowrap(addr, size) && \
-	 (__under_task_size(addr, size) || \
-	  __access_ok_vsyscall(type, addr, size) || \
-	  segment_eq(get_fs(), KERNEL_DS)))
-
-extern int copy_from_user(void *to, const void __user *from, int n);
-extern int copy_to_user(void __user *to, const void *from, int n);
-
-extern int __do_copy_to_user(void *to, const void *from, int n,
-			     void **fault_addr, jmp_buf **fault_catcher);
-
-/*
- * strncpy_from_user: - Copy a NUL terminated string from userspace.
- * @dst:   Destination address, in kernel space.  This buffer must be at
- *         least @count bytes long.
- * @src:   Source address, in user space.
- * @count: Maximum number of bytes to copy, including the trailing NUL.
- *
- * Copies a NUL-terminated string from userspace to kernel space.
- *
- * On success, returns the length of the string (not including the trailing
- * NUL).
- *
- * If access to userspace fails, returns -EFAULT (some data may have been
- * copied).
- *
- * If @count is smaller than the length of the string, copies @count bytes
- * and returns @count.
- */
-
-extern int strncpy_from_user(char *dst, const char __user *src, int count);
-
-/*
- * __clear_user: - Zero a block of memory in user space, with less checking.
- * @to:   Destination address, in user space.
- * @n:    Number of bytes to zero.
- *
- * Zero a block of memory in user space.  Caller must check
- * the specified block with access_ok() before calling this function.
- *
- * Returns number of bytes that could not be cleared.
- * On success, this will be zero.
- */
-extern int __clear_user(void __user *mem, int len);
-
-/*
- * clear_user: - Zero a block of memory in user space.
- * @to:   Destination address, in user space.
- * @n:    Number of bytes to zero.
- *
- * Zero a block of memory in user space.
- *
- * Returns number of bytes that could not be cleared.
- * On success, this will be zero.
- */
-extern int clear_user(void __user *mem, int len);
-
-/*
- * strlen_user: - Get the size of a string in user space.
- * @str: The string to measure.
- * @n:   The maximum valid length
- *
- * Get the size of a NUL-terminated string in user space.
- *
- * Returns the size of the string INCLUDING the terminating NUL.
- * On exception, returns 0.
- * If the string is too long, returns a value greater than @n.
- */
-extern int strnlen_user(const void __user *str, int len);
-
-#endif

+ 4 - 3
arch/um/include/shared/user.h

@@ -6,7 +6,7 @@
 #ifndef __USER_H__
 #ifndef __USER_H__
 #define __USER_H__
 #define __USER_H__
 
 
-#include "kern_constants.h"
+#include <generated/asm-offsets.h>
 
 
 /*
 /*
  * The usual definition - copied here because the kernel provides its own,
  * The usual definition - copied here because the kernel provides its own,
@@ -36,10 +36,11 @@ static inline int printk(const char *fmt, ...)
 }
 }
 #endif
 #endif
 
 
-extern void schedule(void);
 extern int in_aton(char *str);
 extern int in_aton(char *str);
-extern int open_gdb_chan(void);
 extern size_t strlcpy(char *, const char *, size_t);
 extern size_t strlcpy(char *, const char *, size_t);
 extern size_t strlcat(char *, const char *, size_t);
 extern size_t strlcat(char *, const char *, size_t);
 
 
+/* Copied from linux/compiler-gcc.h since we can't include it directly */
+#define barrier() __asm__ __volatile__("": : :"memory")
+
 #endif
 #endif

+ 1 - 1
arch/um/kernel/Makefile

@@ -11,7 +11,7 @@ clean-files :=
 
 
 obj-y = config.o exec.o exitcode.o init_task.o irq.o ksyms.o mem.o \
 obj-y = config.o exec.o exitcode.o init_task.o irq.o ksyms.o mem.o \
 	physmem.o process.o ptrace.o reboot.o sigio.o \
 	physmem.o process.o ptrace.o reboot.o sigio.o \
-	signal.o smp.o syscall.o sysrq.o time.o tlb.o trap.o uaccess.o \
+	signal.o smp.o syscall.o sysrq.o time.o tlb.o trap.o \
 	um_arch.o umid.o skas/
 	um_arch.o umid.o skas/
 
 
 obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
 obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o

+ 10 - 8
arch/um/kernel/exec.c

@@ -3,14 +3,15 @@
  * Licensed under the GPL
  * Licensed under the GPL
  */
  */
 
 
-#include "linux/stddef.h"
-#include "linux/fs.h"
-#include "linux/ptrace.h"
-#include "linux/sched.h"
-#include "linux/slab.h"
-#include "asm/current.h"
-#include "asm/processor.h"
-#include "asm/uaccess.h"
+#include <linux/stddef.h>
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/ptrace.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <asm/current.h>
+#include <asm/processor.h>
+#include <asm/uaccess.h>
 #include "as-layout.h"
 #include "as-layout.h"
 #include "mem_user.h"
 #include "mem_user.h"
 #include "skas.h"
 #include "skas.h"
@@ -41,6 +42,7 @@ void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
 	PT_REGS_IP(regs) = eip;
 	PT_REGS_IP(regs) = eip;
 	PT_REGS_SP(regs) = esp;
 	PT_REGS_SP(regs) = esp;
 }
 }
+EXPORT_SYMBOL(start_thread);
 
 
 static long execve1(const char *file,
 static long execve1(const char *file,
 		    const char __user *const __user *argv,
 		    const char __user *const __user *argv,

+ 0 - 15
arch/um/kernel/gmon_syms.c

@@ -7,18 +7,3 @@
 
 
 extern void __bb_init_func(void *)  __attribute__((weak));
 extern void __bb_init_func(void *)  __attribute__((weak));
 EXPORT_SYMBOL(__bb_init_func);
 EXPORT_SYMBOL(__bb_init_func);
-
-/*
- * This is defined (and referred to in profiling stub code) only by some GCC
- * versions in libgcov.
- *
- * Since SuSE backported the fix, we cannot handle it depending on GCC version.
- * So, unconditionally export it. But also give it a weak declaration, which
- * will be overridden by any other one.
- */
-
-extern void __gcov_init(void *) __attribute__((weak));
-EXPORT_SYMBOL(__gcov_init);
-
-extern void __gcov_merge_add(void *) __attribute__((weak));
-EXPORT_SYMBOL(__gcov_merge_add);

+ 2 - 2
arch/um/kernel/initrd.c

@@ -7,12 +7,12 @@
 #include "linux/bootmem.h"
 #include "linux/bootmem.h"
 #include "linux/initrd.h"
 #include "linux/initrd.h"
 #include "asm/types.h"
 #include "asm/types.h"
-#include "initrd.h"
 #include "init.h"
 #include "init.h"
 #include "os.h"
 #include "os.h"
 
 
 /* Changed by uml_initrd_setup, which is a setup */
 /* Changed by uml_initrd_setup, which is a setup */
 static char *initrd __initdata = NULL;
 static char *initrd __initdata = NULL;
+static int load_initrd(char *filename, void *buf, int size);
 
 
 static int __init read_initrd(void)
 static int __init read_initrd(void)
 {
 {
@@ -62,7 +62,7 @@ __uml_setup("initrd=", uml_initrd_setup,
 "    name of the file containing the image.\n\n"
 "    name of the file containing the image.\n\n"
 );
 );
 
 
-int load_initrd(char *filename, void *buf, int size)
+static int load_initrd(char *filename, void *buf, int size)
 {
 {
 	int fd, n;
 	int fd, n;
 
 

+ 1 - 0
arch/um/kernel/irq.c

@@ -258,6 +258,7 @@ void deactivate_fd(int fd, int irqnum)
 
 
 	ignore_sigio_fd(fd);
 	ignore_sigio_fd(fd);
 }
 }
+EXPORT_SYMBOL(deactivate_fd);
 
 
 /*
 /*
  * Called just before shutdown in order to provide a clean exec
  * Called just before shutdown in order to provide a clean exec

+ 1 - 37
arch/um/kernel/ksyms.c

@@ -3,33 +3,11 @@
  * Licensed under the GPL
  * Licensed under the GPL
  */
  */
 
 
-#include "linux/module.h"
-#include "linux/syscalls.h"
-#include "asm/tlbflush.h"
-#include "asm/uaccess.h"
-#include "as-layout.h"
-#include "kern_util.h"
-#include "mem_user.h"
+#include <linux/module.h>
 #include "os.h"
 #include "os.h"
 
 
-EXPORT_SYMBOL(uml_physmem);
 EXPORT_SYMBOL(set_signals);
 EXPORT_SYMBOL(set_signals);
 EXPORT_SYMBOL(get_signals);
 EXPORT_SYMBOL(get_signals);
-EXPORT_SYMBOL(kernel_thread);
-EXPORT_SYMBOL(sys_waitpid);
-EXPORT_SYMBOL(flush_tlb_range);
-
-EXPORT_SYMBOL(high_physmem);
-EXPORT_SYMBOL(empty_zero_page);
-EXPORT_SYMBOL(handle_page_fault);
-EXPORT_SYMBOL(find_iomem);
-
-EXPORT_SYMBOL(strnlen_user);
-EXPORT_SYMBOL(strncpy_from_user);
-EXPORT_SYMBOL(copy_to_user);
-EXPORT_SYMBOL(copy_from_user);
-EXPORT_SYMBOL(clear_user);
-EXPORT_SYMBOL(uml_strdup);
 
 
 EXPORT_SYMBOL(os_stat_fd);
 EXPORT_SYMBOL(os_stat_fd);
 EXPORT_SYMBOL(os_stat_file);
 EXPORT_SYMBOL(os_stat_file);
@@ -57,24 +35,10 @@ EXPORT_SYMBOL(os_connect_socket);
 EXPORT_SYMBOL(os_accept_connection);
 EXPORT_SYMBOL(os_accept_connection);
 EXPORT_SYMBOL(os_rcv_fd);
 EXPORT_SYMBOL(os_rcv_fd);
 EXPORT_SYMBOL(run_helper);
 EXPORT_SYMBOL(run_helper);
-EXPORT_SYMBOL(start_thread);
 EXPORT_SYMBOL(os_major);
 EXPORT_SYMBOL(os_major);
 EXPORT_SYMBOL(os_minor);
 EXPORT_SYMBOL(os_minor);
 EXPORT_SYMBOL(os_makedev);
 EXPORT_SYMBOL(os_makedev);
 
 
 EXPORT_SYMBOL(add_sigio_fd);
 EXPORT_SYMBOL(add_sigio_fd);
 EXPORT_SYMBOL(ignore_sigio_fd);
 EXPORT_SYMBOL(ignore_sigio_fd);
-EXPORT_SYMBOL(deactivate_fd);
 EXPORT_SYMBOL(sigio_broken);
 EXPORT_SYMBOL(sigio_broken);
-
-#ifdef CONFIG_SMP
-
-/* required for SMP */
-
-extern void __write_lock_failed(rwlock_t *rw);
-EXPORT_SYMBOL(__write_lock_failed);
-
-extern void __read_lock_failed(rwlock_t *rw);
-EXPORT_SYMBOL(__read_lock_failed);
-
-#endif

+ 2 - 0
arch/um/kernel/mem.c

@@ -4,6 +4,7 @@
  */
  */
 
 
 #include <linux/stddef.h>
 #include <linux/stddef.h>
+#include <linux/module.h>
 #include <linux/bootmem.h>
 #include <linux/bootmem.h>
 #include <linux/highmem.h>
 #include <linux/highmem.h>
 #include <linux/mm.h>
 #include <linux/mm.h>
@@ -20,6 +21,7 @@
 
 
 /* allocated in paging_init, zeroed in mem_init, and unchanged thereafter */
 /* allocated in paging_init, zeroed in mem_init, and unchanged thereafter */
 unsigned long *empty_zero_page = NULL;
 unsigned long *empty_zero_page = NULL;
+EXPORT_SYMBOL(empty_zero_page);
 /* allocated in paging_init and unchanged thereafter */
 /* allocated in paging_init and unchanged thereafter */
 static unsigned long *empty_bad_page = NULL;
 static unsigned long *empty_bad_page = NULL;
 
 

+ 12 - 9
arch/um/kernel/physmem.c

@@ -3,20 +3,22 @@
  * Licensed under the GPL
  * Licensed under the GPL
  */
  */
 
 
-#include "linux/bootmem.h"
-#include "linux/mm.h"
-#include "linux/pfn.h"
-#include "asm/page.h"
-#include "as-layout.h"
-#include "init.h"
-#include "kern.h"
-#include "mem_user.h"
-#include "os.h"
+#include <linux/module.h>
+#include <linux/bootmem.h>
+#include <linux/mm.h>
+#include <linux/pfn.h>
+#include <asm/page.h>
+#include <as-layout.h>
+#include <init.h>
+#include <kern.h>
+#include <mem_user.h>
+#include <os.h>
 
 
 static int physmem_fd = -1;
 static int physmem_fd = -1;
 
 
 /* Changed during early boot */
 /* Changed during early boot */
 unsigned long high_physmem;
 unsigned long high_physmem;
+EXPORT_SYMBOL(high_physmem);
 
 
 extern unsigned long long physmem_size;
 extern unsigned long long physmem_size;
 
 
@@ -184,6 +186,7 @@ unsigned long find_iomem(char *driver, unsigned long *len_out)
 
 
 	return 0;
 	return 0;
 }
 }
+EXPORT_SYMBOL(find_iomem);
 
 
 static int setup_iomem(void)
 static int setup_iomem(void)
 {
 {

+ 3 - 1
arch/um/kernel/process.c

@@ -20,12 +20,12 @@
 #include <linux/threads.h>
 #include <linux/threads.h>
 #include <asm/current.h>
 #include <asm/current.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
+#include <asm/mmu_context.h>
 #include <asm/uaccess.h>
 #include <asm/uaccess.h>
 #include "as-layout.h"
 #include "as-layout.h"
 #include "kern_util.h"
 #include "kern_util.h"
 #include "os.h"
 #include "os.h"
 #include "skas.h"
 #include "skas.h"
-#include "tlb.h"
 
 
 /*
 /*
  * This is a per-cpu array.  A processor only modifies its entry and it only
  * This is a per-cpu array.  A processor only modifies its entry and it only
@@ -78,6 +78,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 		      &current->thread.regs, 0, NULL, NULL);
 		      &current->thread.regs, 0, NULL, NULL);
 	return pid;
 	return pid;
 }
 }
+EXPORT_SYMBOL(kernel_thread);
 
 
 static inline void set_current(struct task_struct *task)
 static inline void set_current(struct task_struct *task)
 {
 {
@@ -286,6 +287,7 @@ char *uml_strdup(const char *string)
 {
 {
 	return kstrdup(string, GFP_KERNEL);
 	return kstrdup(string, GFP_KERNEL);
 }
 }
+EXPORT_SYMBOL(uml_strdup);
 
 
 int copy_to_user_proc(void __user *to, void *from, int size)
 int copy_to_user_proc(void __user *to, void *from, int size)
 {
 {

+ 0 - 1
arch/um/kernel/signal.c

@@ -11,7 +11,6 @@
 #include <asm/unistd.h>
 #include <asm/unistd.h>
 #include "frame_kern.h"
 #include "frame_kern.h"
 #include "kern_util.h"
 #include "kern_util.h"
-#include <sysdep/sigcontext.h>
 
 
 EXPORT_SYMBOL(block_signals);
 EXPORT_SYMBOL(block_signals);
 EXPORT_SYMBOL(unblock_signals);
 EXPORT_SYMBOL(unblock_signals);

+ 0 - 1
arch/um/kernel/skas/clone.c

@@ -8,7 +8,6 @@
 #include <asm/unistd.h>
 #include <asm/unistd.h>
 #include <sys/time.h>
 #include <sys/time.h>
 #include "as-layout.h"
 #include "as-layout.h"
-#include "kern_constants.h"
 #include "ptrace_user.h"
 #include "ptrace_user.h"
 #include "stub-data.h"
 #include "stub-data.h"
 #include "sysdep/stub.h"
 #include "sysdep/stub.h"

+ 6 - 0
arch/um/kernel/skas/uaccess.c

@@ -6,6 +6,7 @@
 #include <linux/err.h>
 #include <linux/err.h>
 #include <linux/highmem.h>
 #include <linux/highmem.h>
 #include <linux/mm.h>
 #include <linux/mm.h>
+#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/sched.h>
 #include <asm/current.h>
 #include <asm/current.h>
 #include <asm/page.h>
 #include <asm/page.h>
@@ -149,6 +150,7 @@ int copy_from_user(void *to, const void __user *from, int n)
 	       buffer_op((unsigned long) from, n, 0, copy_chunk_from_user, &to):
 	       buffer_op((unsigned long) from, n, 0, copy_chunk_from_user, &to):
 	       n;
 	       n;
 }
 }
+EXPORT_SYMBOL(copy_from_user);
 
 
 static int copy_chunk_to_user(unsigned long to, int len, void *arg)
 static int copy_chunk_to_user(unsigned long to, int len, void *arg)
 {
 {
@@ -170,6 +172,7 @@ int copy_to_user(void __user *to, const void *from, int n)
 	       buffer_op((unsigned long) to, n, 1, copy_chunk_to_user, &from) :
 	       buffer_op((unsigned long) to, n, 1, copy_chunk_to_user, &from) :
 	       n;
 	       n;
 }
 }
+EXPORT_SYMBOL(copy_to_user);
 
 
 static int strncpy_chunk_from_user(unsigned long from, int len, void *arg)
 static int strncpy_chunk_from_user(unsigned long from, int len, void *arg)
 {
 {
@@ -204,6 +207,7 @@ int strncpy_from_user(char *dst, const char __user *src, int count)
 		return -EFAULT;
 		return -EFAULT;
 	return strnlen(dst, count);
 	return strnlen(dst, count);
 }
 }
+EXPORT_SYMBOL(strncpy_from_user);
 
 
 static int clear_chunk(unsigned long addr, int len, void *unused)
 static int clear_chunk(unsigned long addr, int len, void *unused)
 {
 {
@@ -226,6 +230,7 @@ int clear_user(void __user *mem, int len)
 	return access_ok(VERIFY_WRITE, mem, len) ?
 	return access_ok(VERIFY_WRITE, mem, len) ?
 	       buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL) : len;
 	       buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL) : len;
 }
 }
+EXPORT_SYMBOL(clear_user);
 
 
 static int strnlen_chunk(unsigned long str, int len, void *arg)
 static int strnlen_chunk(unsigned long str, int len, void *arg)
 {
 {
@@ -251,3 +256,4 @@ int strnlen_user(const void __user *str, int len)
 		return count + 1;
 		return count + 1;
 	return -EFAULT;
 	return -EFAULT;
 }
 }
+EXPORT_SYMBOL(strnlen_user);

+ 3 - 2
arch/um/kernel/tlb.c

@@ -4,6 +4,7 @@
  */
  */
 
 
 #include <linux/mm.h>
 #include <linux/mm.h>
+#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/sched.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/tlbflush.h>
@@ -11,7 +12,6 @@
 #include "mem_user.h"
 #include "mem_user.h"
 #include "os.h"
 #include "os.h"
 #include "skas.h"
 #include "skas.h"
-#include "tlb.h"
 
 
 struct host_vm_change {
 struct host_vm_change {
 	struct host_vm_op {
 	struct host_vm_op {
@@ -287,7 +287,7 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
 	}
 	}
 }
 }
 
 
-int flush_tlb_kernel_range_common(unsigned long start, unsigned long end)
+static int flush_tlb_kernel_range_common(unsigned long start, unsigned long end)
 {
 {
 	struct mm_struct *mm;
 	struct mm_struct *mm;
 	pgd_t *pgd;
 	pgd_t *pgd;
@@ -499,6 +499,7 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
 		flush_tlb_kernel_range_common(start, end);
 		flush_tlb_kernel_range_common(start, end);
 	else fix_range(vma->vm_mm, start, end, 0);
 	else fix_range(vma->vm_mm, start, end, 0);
 }
 }
+EXPORT_SYMBOL(flush_tlb_range);
 
 
 void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
 void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
 			unsigned long end)
 			unsigned long end)

+ 2 - 1
arch/um/kernel/trap.c

@@ -6,6 +6,7 @@
 #include <linux/mm.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/sched.h>
 #include <linux/hardirq.h>
 #include <linux/hardirq.h>
+#include <linux/module.h>
 #include <asm/current.h>
 #include <asm/current.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/tlbflush.h>
@@ -14,7 +15,6 @@
 #include "kern_util.h"
 #include "kern_util.h"
 #include "os.h"
 #include "os.h"
 #include "skas.h"
 #include "skas.h"
-#include "sysdep/sigcontext.h"
 
 
 /*
 /*
  * Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by
  * Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by
@@ -112,6 +112,7 @@ out_of_memory:
 	pagefault_out_of_memory();
 	pagefault_out_of_memory();
 	return 0;
 	return 0;
 }
 }
+EXPORT_SYMBOL(handle_page_fault);
 
 
 static void show_segv_info(struct uml_pt_regs *regs)
 static void show_segv_info(struct uml_pt_regs *regs)
 {
 {

+ 0 - 33
arch/um/kernel/uaccess.c

@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk)
- * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
- * Licensed under the GPL
- */
-
-/*
- * These are here rather than tt/uaccess.c because skas mode needs them in
- * order to do SIGBUS recovery when a tmpfs mount runs out of room.
- */
-
-#include <linux/string.h>
-#include "os.h"
-
-static void __do_copy(void *to, const void *from, int n)
-{
-	memcpy(to, from, n);
-}
-
-
-int __do_copy_to_user(void *to, const void *from, int n,
-		      void **fault_addr, jmp_buf **fault_catcher)
-{
-	unsigned long fault;
-	int faulted;
-
-	fault = __do_user_copy(to, from, n, fault_addr, fault_catcher,
-			       __do_copy, &faulted);
-	if (!faulted)
-		return 0;
-	else
-		return n - (fault - (unsigned long) to);
-}

+ 2 - 0
arch/um/kernel/um_arch.c

@@ -102,6 +102,8 @@ const struct seq_operations cpuinfo_op = {
 
 
 /* Set in linux_main */
 /* Set in linux_main */
 unsigned long uml_physmem;
 unsigned long uml_physmem;
+EXPORT_SYMBOL(uml_physmem);
+
 unsigned long uml_reserved; /* Also modified in mem_init */
 unsigned long uml_reserved; /* Also modified in mem_init */
 unsigned long start_vm;
 unsigned long start_vm;
 unsigned long end_vm;
 unsigned long end_vm;

+ 3 - 3
arch/um/os-Linux/Makefile

@@ -4,14 +4,14 @@
 #
 #
 
 
 obj-y = aio.o execvp.o file.o helper.o irq.o main.o mem.o process.o \
 obj-y = aio.o execvp.o file.o helper.o irq.o main.o mem.o process.o \
-	registers.o sigio.o signal.o start_up.o time.o tty.o uaccess.o \
-	umid.o tls.o user_syms.o util.o drivers/ sys-$(SUBARCH)/ skas/
+	registers.o sigio.o signal.o start_up.o time.o tty.o \
+	umid.o user_syms.o util.o drivers/ skas/
 
 
 obj-$(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) += elf_aux.o
 obj-$(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) += elf_aux.o
 
 
 USER_OBJS := $(user-objs-y) aio.o elf_aux.o execvp.o file.o helper.o irq.o \
 USER_OBJS := $(user-objs-y) aio.o elf_aux.o execvp.o file.o helper.o irq.o \
 	main.o mem.o process.o registers.o sigio.o signal.o start_up.o time.o \
 	main.o mem.o process.o registers.o sigio.o signal.o start_up.o time.o \
-	tty.o tls.o uaccess.o umid.o util.o
+	tty.o umid.o util.o
 
 
 CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
 CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
 
 

+ 0 - 2
arch/um/os-Linux/aio.c

@@ -11,10 +11,8 @@
 #include <asm/unistd.h>
 #include <asm/unistd.h>
 #include "aio.h"
 #include "aio.h"
 #include "init.h"
 #include "init.h"
-#include "kern_constants.h"
 #include "kern_util.h"
 #include "kern_util.h"
 #include "os.h"
 #include "os.h"
-#include "user.h"
 
 
 struct aio_thread_req {
 struct aio_thread_req {
 	enum aio_type type;
 	enum aio_type type;

+ 0 - 2
arch/um/os-Linux/drivers/ethertap_user.c

@@ -13,11 +13,9 @@
 #include <sys/socket.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
 #include "etap.h"
 #include "etap.h"
-#include "kern_constants.h"
 #include "os.h"
 #include "os.h"
 #include "net_user.h"
 #include "net_user.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 #define MAX_PACKET ETH_MAX_PACKET
 #define MAX_PACKET ETH_MAX_PACKET
 
 

+ 0 - 2
arch/um/os-Linux/drivers/tuntap_user.c

@@ -13,11 +13,9 @@
 #include <sys/socket.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
 #include <sys/uio.h>
 #include <sys/uio.h>
-#include "kern_constants.h"
 #include "kern_util.h"
 #include "kern_util.h"
 #include "os.h"
 #include "os.h"
 #include "tuntap.h"
 #include "tuntap.h"
-#include "user.h"
 
 
 static int tuntap_user_init(void *data, void *dev)
 static int tuntap_user_init(void *data, void *dev)
 {
 {

+ 0 - 1
arch/um/os-Linux/elf_aux.c

@@ -12,7 +12,6 @@
 #include "init.h"
 #include "init.h"
 #include "elf_user.h"
 #include "elf_user.h"
 #include "mem_user.h"
 #include "mem_user.h"
-#include <kern_constants.h>
 
 
 typedef Elf32_auxv_t elf_auxv_t;
 typedef Elf32_auxv_t elf_auxv_t;
 
 

+ 0 - 2
arch/um/os-Linux/file.c

@@ -13,9 +13,7 @@
 #include <sys/socket.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <sys/un.h>
 #include <sys/un.h>
-#include "kern_constants.h"
 #include "os.h"
 #include "os.h"
-#include "user.h"
 
 
 static void copy_stat(struct uml_stat *dst, const struct stat64 *src)
 static void copy_stat(struct uml_stat *dst, const struct stat64 *src)
 {
 {

+ 0 - 2
arch/um/os-Linux/helper.c

@@ -10,11 +10,9 @@
 #include <linux/limits.h>
 #include <linux/limits.h>
 #include <sys/socket.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
-#include "kern_constants.h"
 #include "kern_util.h"
 #include "kern_util.h"
 #include "os.h"
 #include "os.h"
 #include "um_malloc.h"
 #include "um_malloc.h"
-#include "user.h"
 
 
 struct helper_data {
 struct helper_data {
 	void (*pre_exec)(void*);
 	void (*pre_exec)(void*);

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio