Arch-abstraction:
- Added include/x86-linux/ and include/linux/ subdirectories, with Makefile.am
  files.

- Overhauled the definitions of kernel types.  include/vg_kerneliface.h is now
  three files, include/linux/vki.h, include/x86-linux/vki_arch.h, and
  include/x86-linux/vki_arch_posixtypes.h.  These files separate the
  common/Linux and x86/Linux parts cleanly.  All code is copied verbatim from
  the relevant kernel headers, except that VKI_/vki_ prefixes are added as
  necessary to distinguish them from glibc types.  (This is done consistently,
  unlike previously when some types did not have the prefixes.)

  All code is clearly marked to show which particular header file it came from,
  and the Linux version used.  (I used 2.6.8.1, the most recent stable release,
  for all of them.)

  A few of the types changed;  this is because they changed between the older
  versions of Linux and the current 2.6.8.1.  I checked that all these changes
  were ok with respect to backwards compatibility for our purposes.

- vg_unsafe.h has been removed;  we are no longer including any kernel headers,
  as we have our own copies for everything.  This is because installed kernel
  headers are not reliable, and often cause compilation problems. (bug
  #92420 is a recent example)

- Removed some no-longer-needed header-presence tests from configure.in.

- Some code in the rest of Valgrind was changed to account for some slight
  changes in the names of our VKI_/vki_ kernel constants and types.

- Updated README_MISSING_SYSCALL_OR_IOCTL accordingly.

- Fixed off-by-one error with VKI_GDT_ENTRY_TLS_MAX (merged from stable branch)

The end result is that the kernel types situation should be much clearer, and
similar files can be created relatively easily for other architectures as
necessary.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2884 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c
index f2afc12..cc1404f 100644
--- a/coregrind/vg_main.c
+++ b/coregrind/vg_main.c
@@ -106,8 +106,8 @@
 // the VG_(*_end) vars name the byte one past the end of the section.
 Addr VG_(valgrind_last);
 
-vki_rlimit VG_(client_rlimit_data);
-vki_rlimit VG_(client_rlimit_stack);
+struct vki_rlimit VG_(client_rlimit_data);
+struct vki_rlimit VG_(client_rlimit_stack);
 
 /* This is set early to indicate whether this CPU has the
    SSE/fxsave/fxrestor features.  */
@@ -239,7 +239,7 @@
 
    if ((pid = fork()) == 0) {
       ptrace(PTRACE_TRACEME, 0, NULL, NULL);
-      VG_(kkill)(VG_(getpid)(), VKI_SIGSTOP);
+      VG_(kill)(VG_(getpid)(), VKI_SIGSTOP);
 
    } else if (pid > 0) {
       Int status;
@@ -301,7 +301,7 @@
          }
       }
 
-      VG_(kkill)(pid, VKI_SIGKILL);
+      VG_(kill)(pid, VKI_SIGKILL);
       VG_(waitpid)(pid, &status, 0);
    }
 }
@@ -987,12 +987,12 @@
       sizeof(char **) +			/* terminal NULL */
       auxsize +				/* auxv */
       ROUNDUP(stringsize, sizeof(int)) +/* strings (aligned) */
-      VKI_BYTES_PER_PAGE;		/* page for trampoline code */
+      VKI_PAGE_SIZE;		/* page for trampoline code */
 
    // decide where stack goes!
    VG_(clstk_end) = VG_(client_end);
 
-   VG_(client_trampoline_code) = VG_(clstk_end) - VKI_BYTES_PER_PAGE;
+   VG_(client_trampoline_code) = VG_(clstk_end) - VKI_PAGE_SIZE;
 
    /* cl_esp is the client's stack pointer */
    cl_esp = VG_(clstk_end) - stacksize;
@@ -1680,9 +1680,9 @@
      config_error("Please use absolute paths in "
                   "./configure --prefix=... or --libdir=...");
 
-   for (auxp = client_auxv; auxp[0] != VKI_AT_NULL; auxp += 2) {
+   for (auxp = client_auxv; auxp[0] != AT_NULL; auxp += 2) {
       switch(auxp[0]) {
-      case VKI_AT_SYSINFO:
+      case AT_SYSINFO:
 	 auxp[1] = (Int)(VG_(client_trampoline_code) + VG_(tramp_syscall_offset));
 	 break;
       }
@@ -2551,7 +2551,7 @@
    VgSchedReturnCode src;
    Int exitcode = 0;
    Int fatal_sigNo = -1;
-   vki_rlimit zero = { 0, 0 };
+   struct vki_rlimit zero = { 0, 0 };
    Int padfile;
    ThreadId last_run_tid = 0;    // Last thread the scheduler ran.