about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/i386')
-rw-r--r--sysdeps/mach/hurd/i386/Dist3
-rw-r--r--sysdeps/mach/hurd/i386/init-first.c25
-rw-r--r--sysdeps/mach/hurd/i386/longjmp-ts.c3
-rw-r--r--sysdeps/mach/hurd/i386/tls.h4
-rw-r--r--sysdeps/mach/hurd/i386/trampoline.c7
5 files changed, 20 insertions, 22 deletions
diff --git a/sysdeps/mach/hurd/i386/Dist b/sysdeps/mach/hurd/i386/Dist
new file mode 100644
index 0000000000..82c44df00b
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/Dist
@@ -0,0 +1,3 @@
+static-start.S
+sys/io.h
+ioperm.c
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index f9a7a58deb..caa232026d 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/i386/init-first.c
@@ -1,6 +1,5 @@
 /* Initialization code run first thing by the ELF startup code.  For i386/Hurd.
-   Copyright (C) 1995,96,97,98,99,2000,01,02,03,04,05
-	Free Software Foundation, Inc.
+   Copyright (C) 1995,96,97,98,99,2000,01,02,03,04 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -55,7 +54,7 @@ extern int __libc_argc attribute_hidden;
 extern char **__libc_argv attribute_hidden;
 extern char **_dl_argv;
 
-extern void *(*_cthread_init_routine) (void) __attribute__ ((weak));
+void *(*_cthread_init_routine) (void); /* Returns new SP to use.  */
 void (*_cthread_exit_routine) (int status) __attribute__ ((__noreturn__));
 
 /* Things that want to be run before _hurd_init or much anything else.
@@ -204,7 +203,7 @@ init (int *data)
      code as the return address, and the argument data immediately above
      that on the stack.  */
 
-  if (&_cthread_init_routine && _cthread_init_routine)
+  if (_cthread_init_routine)
     {
       /* Initialize cthreads, which will allocate us a new stack to run on.  */
       int *newsp = (*_cthread_init_routine) ();
@@ -272,7 +271,7 @@ init (int *data)
       /* The argument data is just above the stack frame we will unwind by
 	 returning.  Mutate our own return address to run the code below.  */
       usercode = data[-1];
-      data[-1] = (int) &call_init1;
+      ((void **) data)[-1] = call_init1;
       /* Force USERCODE into %eax and &init1 into %ecx, which are not
 	 restored by function return.  */
       asm volatile ("# a %0 c %1" : : "a" (usercode), "c" (&init1));
@@ -320,11 +319,11 @@ first_init (void)
    stack set up just as the user will see it, so it can switch stacks.  */
 
 void
-_dl_init_first (void)
+_dl_init_first (int argc, ...)
 {
   first_init ();
 
-  init ((int *) __builtin_frame_address (0) + 2);
+  init (&argc);
 }
 #endif
 
@@ -351,23 +350,21 @@ strong_alias (posixland_init, __libc_init_first);
    This poorly-named function is called by static-start.S,
    which should not exist at all.  */
 void
-_hurd_stack_setup (void)
+_hurd_stack_setup (volatile int argc, ...)
 {
-  intptr_t caller = (intptr_t) __builtin_return_address (0);
-
   void doinit (intptr_t *data)
     {
       /* This function gets called with the argument data at TOS.  */
-      void doinit1 (void)
+      void doinit1 (volatile int argc, ...)
 	{
-	  init ((int *) __builtin_frame_address (0) + 2);
+	  init ((int *) &argc);
 	}
 
       /* Push the user return address after the argument data, and then
          jump to `doinit1' (above), so it is as if __libc_init_first's
          caller had called `doinit1' with the argument data already on the
          stack.  */
-      *--data = caller;
+      *--data = (&argc)[-1];
       asm volatile ("movl %0, %%esp\n" /* Switch to new outermost stack.  */
 		    "movl $0, %%ebp\n" /* Clear outermost frame pointer.  */
 		    "jmp *%1" : : "r" (data), "r" (&doinit1) : "sp");
@@ -376,7 +373,7 @@ _hurd_stack_setup (void)
 
   first_init ();
 
-  _hurd_startup ((void **) __builtin_frame_address (0) + 2, &doinit);
+  _hurd_startup ((void **) &argc, &doinit);
 }
 #endif
 
diff --git a/sysdeps/mach/hurd/i386/longjmp-ts.c b/sysdeps/mach/hurd/i386/longjmp-ts.c
index c902002cbc..586ce6b015 100644
--- a/sysdeps/mach/hurd/i386/longjmp-ts.c
+++ b/sysdeps/mach/hurd/i386/longjmp-ts.c
@@ -1,5 +1,5 @@
 /* Perform a `longjmp' on a Mach thread_state.  i386 version.
-   Copyright (C) 1991, 1994, 1995, 1997, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1994, 1995, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,6 @@
 
 #include <hurd/signal.h>
 #include <setjmp.h>
-#include <jmpbuf-offsets.h>
 #include <mach/thread_status.h>
 
 
diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h
index 223a47d2f2..ff849716e0 100644
--- a/sysdeps/mach/hurd/i386/tls.h
+++ b/sysdeps/mach/hurd/i386/tls.h
@@ -98,7 +98,7 @@ _hurd_tls_init (tcbhead_t *tcb, int secondcall)
     {
       /* Fetch the selector set by the first call.  */
       int sel;
-      asm ("mov %%gs, %w0" : "=q" (sel) : "0" (0));
+      asm ("mov %%gs, %w0" : "=q" (sel));
       if (__builtin_expect (sel, 0x50) & 4) /* LDT selector */
 	{
 	  error_t err = __i386_set_ldt (tcb->self, sel, &desc, 1);
@@ -151,7 +151,7 @@ _hurd_tls_fork (thread_t child, struct i386_thread_state *state)
 {
   /* Fetch the selector set by _hurd_tls_init.  */
   int sel;
-  asm ("mov %%gs, %w0" : "=q" (sel) : "0" (0));
+  asm ("mov %%gs, %w0" : "=q" (sel));
   if (sel == state->ds)		/* _hurd_tls_init was never called.  */
     return 0;
 
diff --git a/sysdeps/mach/hurd/i386/trampoline.c b/sysdeps/mach/hurd/i386/trampoline.c
index dddc6f3ef6..781a0441dc 100644
--- a/sysdeps/mach/hurd/i386/trampoline.c
+++ b/sysdeps/mach/hurd/i386/trampoline.c
@@ -1,6 +1,5 @@
 /* Set thread_state for sighandler, and sigcontext to recover.  i386 version.
-   Copyright (C) 1994,1995,1996,1997,1998,1999,2005
-	Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -20,11 +19,11 @@
 
 #include <hurd/signal.h>
 #include <hurd/userlink.h>
-#include <thread_state.h>
+#include "thread_state.h"
 #include <assert.h>
 #include <errno.h>
 #include "hurdfault.h"
-#include <intr-msg.h>
+#include "intr-msg.h"
 
 
 struct sigcontext *