summaryrefslogtreecommitdiff
path: root/libc/sysdeps/unix/sysv/linux/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/unix/sysv/linux/sparc')
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S14
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S29
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/xstat.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h24
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sysdep.h5
6 files changed, 45 insertions, 32 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index d68bfeb0e..2307a2353 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/SPARC.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -49,6 +49,7 @@
# define O_NOFOLLOW 0x20000 /* don't follow links */
# define O_DIRECT 0x100000 /* direct disk access hint */
# define O_NOATIME 0x200000 /* Do not set atime. */
+# define O_CLOEXEC 0x400000 /* Set close_on_exit. */
#endif
#ifdef __USE_LARGEFILE64
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
index f91fc4f62..a64d8e519 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004
+/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu).
@@ -41,9 +41,9 @@ ENTRY (__clone)
/* sanity check arguments */
orcc %i0,%g0,%g2
- be .Lerror
+ be .Leinval
orcc %i1,%g0,%o1
- be .Lerror
+ be .Leinval
mov %i2,%o0
/* The child_stack is the top of the stack, allocate one
@@ -70,9 +70,11 @@ ENTRY (__clone)
jmpl %i7 + 8, %g0
restore %o0,%g0,%o0
+.Leinval:
+ mov EINVAL, %o0
.Lerror:
- call __errno_location
- or %g0,EINVAL,%i0
+ call HIDDEN_JUMPTARGET(__errno_location)
+ mov %o0, %i0
st %i0,[%o0]
jmpl %i7 + 8, %g0
restore %g0,-1,%o0
@@ -99,7 +101,7 @@ __thread_start:
mov %g0, %fp /* terminate backtrace */
call %g2
mov %g3,%o0
- call _exit,0
+ call HIDDEN_JUMPTARGET(_exit),0
nop
cfi_endproc
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
index ebfce9e2c..2bbbd8020 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu).
@@ -62,33 +62,16 @@ ENTRY (__clone)
/* Do the system call */
set __NR_clone, %g1
ta 0x6d
- bcs,pn %xcc, 99f
+ bcs,pn %xcc, 98f
nop
brnz,pn %o1, __thread_start
nop
jmpl %i7 + 8, %g0
restore %o0, %g0, %o0
-99:
-#ifndef _LIBC_REENTRANT
-#ifdef PIC
- call 1f
- sethi %hi(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7
-1: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7
- add %l7, %o7, %l7
- set EINVAL, %i0
- sethi %hi(errno), %g2
- or %g2, %lo(errno), %g2
- st %i0, [%l7+%g2]
-#else
- sethi %hi(errno), %g2
- set EINVAL, %i0
- st %i0, [%g2+%lo(errno)]
-#endif
-#else
- call __errno_location
- nop
+99: mov EINVAL, %o0
+98: call HIDDEN_JUMPTARGET(__errno_location)
+ mov %o0, %i0
st %i0, [%o0]
-#endif
jmpl %i7 + 8, %g0
restore %g0,-1,%o0
END(__clone)
@@ -112,7 +95,7 @@ __thread_start:
mov %g0, %fp /* terminate backtrace */
call %g2
mov %g3,%o0
- call _exit,0
+ call HIDDEN_JUMPTARGET(_exit),0
nop
cfi_endproc
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/xstat.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/xstat.c
index 9f4c02c78..71a51ccd8 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/xstat.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/xstat.c
@@ -1,3 +1,5 @@
+#include <kernel-features.h>
+
#include "../../i386/xstat.c"
#ifdef __NR_stat64
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h b/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
index 17907c4a3..a7b204b33 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Linux/SPARC version.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2006
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -183,6 +183,28 @@ enum __ptrace_request
#define PT_SETSIGINFO PTRACE_SETSIGINFO
};
+/* Options set using PTRACE_SETOPTIONS. */
+enum __ptrace_setoptions {
+ PTRACE_O_TRACESYSGOOD = 0x00000001,
+ PTRACE_O_TRACEFORK = 0x00000002,
+ PTRACE_O_TRACEVFORK = 0x00000004,
+ PTRACE_O_TRACECLONE = 0x00000008,
+ PTRACE_O_TRACEEXEC = 0x00000010,
+ PTRACE_O_TRACEVFORKDONE = 0x00000020,
+ PTRACE_O_TRACEEXIT = 0x00000040,
+ PTRACE_O_MASK = 0x0000007f
+};
+
+/* Wait extended result codes for the above trace options. */
+enum __ptrace_eventcodes {
+ PTRACE_EVENT_FORK = 1,
+ PTRACE_EVENT_VFORK = 2,
+ PTRACE_EVENT_CLONE = 3,
+ PTRACE_EVENT_EXEC = 4,
+ PTRACE_EVENT_VFORK_DONE = 5,
+ PTRACE_EVENT_EXIT = 6
+};
+
/* Perform process tracing functions. REQUEST is one of the values
above, and determines the action to be taken.
For all requests except PTRACE_TRACEME, PID specifies the process to be
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h b/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h
index a60937976..101638a53 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
@@ -149,5 +149,8 @@
})
+#ifdef __ASSEMBLER__
+# define JUMPTARGET(sym) sym
+#endif
#endif /* _LINUX_SPARC_SYSDEP_H */