+2006-03-05 David S. Miller <davem@sunset.davemloft.net>
+
+ * shlib-versions: Use sparc64.*- for CPU patterns.
+
2006-03-05 Roland McGrath <roland@frob.com>
* bits/resource.h (RLIMIT_SBSIZE, RLIMIT_AS, RLIMIT_VMEM): Define.
+2006-03-05 David S. Miller <davem@sunset.davemloft.net>
+
+ * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
+ Use __syscall_error.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
+
2006-03-02 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
s390-.*-.* WORDSIZE64 s390x-@VENDOR@-@OS@
powerpc64-.*-.* WORDSIZE32 powerpc-@VENDOR@-@OS@
powerpc.*-.*-.* WORDSIZE64 powerpc64-@VENDOR@-@OS@
-sparc64-.*-.* WORDSIZE32 sparc-@VENDOR@-@OS@
+sparc64.*-.*-.* WORDSIZE32 sparc-@VENDOR@-@OS@
sparc.*-.*-.* WORDSIZE64 sparc64-@VENDOR@-@OS@
# Configuration Library=version Earliest symbol set (optional)
# ------------- --------------- ------------------------------
# The interface to -lm depends mostly only on cpu, not on operating system.
-sparc64-.*-linux.* libm=6 GLIBC_2.2
+sparc64.*-.*-linux.* libm=6 GLIBC_2.2
alpha.*-.*-linux.* libm=6.1
ia64-.*-linux.* libm=6.1 GLIBC_2.2
sh.*-.*-linux.* libm=6 GLIBC_2.2
alpha.*-.*-linux.* libc=6.1
ia64-.*-linux.* libc=6.1 GLIBC_2.2
sh.*-.*-linux.* libc=6 GLIBC_2.2
-sparc64-.*-linux.* libc=6 GLIBC_2.2
+sparc64.*-.*-linux.* libc=6 GLIBC_2.2
.*-.*-linux.* libc=6
# libmachuser.so.1 corresponds to mach/*.defs as of Utah's UK22 release.
# The dynamic loader also requires different names.
i.86-.*-linux.* ld=ld-linux.so.2
-sparc64-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2
+sparc64.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2
sparc.*-.*-linux.* ld=ld-linux.so.2
alpha.*-.*-linux.* ld=ld-linux.so.2
sh.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2
alpha.*-.*-linux.* libBrokenLocale=1.1
ia64-.*-.* libBrokenLocale=1 GLIBC_2.2
sh.*-.*-.* libBrokenLocale=1 GLIBC_2.2
-sparc64-.*-.* libBrokenLocale=1 GLIBC_2.2
+sparc64.*-.*-.* libBrokenLocale=1 GLIBC_2.2
.*-.*-.* libBrokenLocale=1
# The real-time library from POSIX.1b.
.globl _dl_runtime_resolve
.type _dl_runtime_resolve, @function
_dl_runtime_resolve:
+ cfi_startproc
+
save %sp, -104, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register (%o7, %i7)
+
ld [%g2 + 8], %o0
srl %g1, 10, %o1
call _dl_fixup
sub %o1, 4*12, %o1
jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_resolve, .-_dl_runtime_resolve
/* For the profiling cases we pass in our stack frame
.globl _dl_profile_save_regs
.type _dl_profile_save_regs, @function
_dl_profile_save_regs:
+ cfi_startproc
+
std %l0, [%sp + ( 0 * 8)]
std %l2, [%sp + ( 1 * 8)]
std %l4, [%sp + ( 2 * 8)]
ld [%sp + (8 * 8)], %l4
retl
st %l4, [%sp + (8 * 8)]
+
+ cfi_endproc
+
.size _dl_profile_save_regs, .-_dl_profile_save_regs
/* If we are going to call pltexit, then we must replicate
.globl _dl_profile_invoke
.type _dl_profile_invoke, @function
_dl_profile_invoke:
+ cfi_startproc
+
sub %sp, %l0, %sp
1:
srl %l0, 3, %l7
jmpl %i7 + 8, %g0
restore
+ cfi_endproc
+
+ .size _dl_profile_invoke, .-_dl_profile_invoke
+
/* %g1: PLT offset loaded by PLT entry
* %g2: callers PC, which is PLT0 + 4, and we store the
* link map at PLT0 + 12, therefore we add 8 to get
.globl _dl_runtime_profile
.type _dl_runtime_profile, @function
_dl_runtime_profile:
+ cfi_startproc
+
cmp %fp, 0
be,a 1f
mov 104, %g3
sub %fp, %sp, %g3
1: save %sp, -104, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+
ld [%g2 + 8], %o0
srl %g1, 10, %o1
mov %i7, %o2
1: jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_profile, .-_dl_runtime_profile
.global _start
.type _start,#function
_start:
+ cfi_startproc
#ifdef SHARED
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
drop their arguments. */
mov %g0, %fp
sub %sp, 6*4, %sp
+ cfi_adjust_cfa_offset(6*4)
/* Extract the arguments and environment as encoded on the stack. The
argument info starts after one register window (16 words) past the SP. */
/* Die very horribly if exit returns. */
unimp
+ cfi_endproc
+
.size _start, .-_start
/* Define a symbol for the first piece of initialized data. */
.text
.align 4
-0: cmp %o2, 0
+ENTRY(__memchr)
+ andcc %o1, 0xff, %o1
+ sll %o1, 8, %g6
+ andcc %o0, 3, %g0
+ or %o1, %g6, %g6
+ sll %g6, 16, %o3
+ be 10f
+ or %o3, %g6, %g2
+ cmp %o2, 0
be 9f
sethi %hi(0x80808080), %o4
ldub [%o0], %g4
clr %o0
1: retl
sub %o0, 1, %o0
-
-ENTRY(__memchr)
- andcc %o1, 0xff, %o1
- sll %o1, 8, %g6
- andcc %o0, 3, %g0
- or %o1, %g6, %g6
- sll %g6, 16, %o3
- bne 0b
- or %o3, %g6, %g2
- sethi %hi(0x80808080), %o4
+10: sethi %hi(0x80808080), %o4
or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o5
5: and %o2, 3, %g1
.text
.align 4
-70: andcc %o1, 1, %g0
- be 4f
- andcc %o1, 2, %g0
-
- ldub [%o1 - 1], %g2
- sub %o1, 1, %o1
- stb %g2, [%o0 - 1]
- sub %o2, 1, %o2
- be 3f
- sub %o0, 1, %o0
-4: lduh [%o1 - 2], %g2
- sub %o1, 2, %o1
- sth %g2, [%o0 - 2]
- sub %o2, 2, %o2
- b 3f
- sub %o0, 2, %o0
-
ENTRY(bcopy)
mov %o0, %o3
mov %o1, %o0
mov %o3, %o1
END(bcopy)
+
ENTRY(memmove)
cmp %o0, %o1
st %o0, [%sp + 64]
cmp %o2, 15
bleu 91f
andcc %o1, 3, %g0
- bne 70b
-3: andcc %o1, 4, %g0
+ be 3f
+ nop
+
+ andcc %o1, 1, %g0
+ be 4f
+ andcc %o1, 2, %g0
+
+ ldub [%o1 - 1], %g2
+ sub %o1, 1, %o1
+ stb %g2, [%o0 - 1]
+ sub %o2, 1, %o2
+ be 3f
+ sub %o0, 1, %o0
+4: lduh [%o1 - 2], %g2
+ sub %o1, 2, %o1
+ sth %g2, [%o0 - 2]
+ sub %o2, 2, %o2
+ sub %o0, 2, %o0
+
+3: andcc %o1, 4, %g0
be 2f
mov %o2, %g1
.text
.align 4
-10: ldub [%o1], %o5
+
+ENTRY(__stpcpy)
+ andcc %o1, 3, %g0
+ be 20f
+ sethi %hi(0x80808080), %o4
+
+ ldub [%o1], %o5
stb %o5, [%o0]
cmp %o5, 0
add %o0, 1, %o0
1: retl
add %o0, -1, %o0
-ENTRY(__stpcpy)
- andcc %o1, 3, %g0
- bne 10b
- sethi %hi(0x80808080), %o4
- or %o4, %lo(0x80808080), %o3
+20: or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o4
5: or %o4, %lo(0x01010101), %o2
6: andcc %o0, 3, %g0
.text
.align 4
-10: cmp %o4, 2
- be 1f
- cmp %o4, 3
- ldub [%o1], %o5
- add %o1, 1, %o1
- stb %o5, [%o0]
- be 3f
- cmp %o5, 0
- be 0f
- add %o0, 1, %o0
-1: lduh [%o1], %o5
- add %o1, 2, %o1
- srl %o5, 8, %o4
- cmp %o4, 0
- stb %o4, [%o0]
- bne,a 2f
- stb %o5, [%o0 + 1]
- retl
- mov %g2, %o0
-2: andcc %o5, 0xff, %o5
- bne 4f
- add %o0, 2, %o0
- retl
- mov %g2, %o0
-3: bne 4f
- add %o0, 1, %o0
- retl
- mov %g2, %o0
-11: ldub [%o0], %o5
+ENTRY(strcat)
+ mov %o0, %g2
+ andcc %o0, 3, %g0
+ be 30f
+ sethi %hi(0x80808080), %o4
+
+ ldub [%o0], %o5
cmp %o5, 0
be 1f
add %o0, 1, %o0
b 3f
sub %o0, 1, %o0
-ENTRY(strcat)
- mov %o0, %g2
- andcc %o0, 3, %g0
- bne 11b
- sethi %hi(0x80808080), %o4
- or %o4, %lo(0x80808080), %o3
+30: or %o4, %lo(0x80808080), %o3
7: sethi %hi(0x01010101), %o4
8: or %o4, %lo(0x01010101), %o2
9: ld [%o0], %o5
ld [%o0], %o5
sub %o0, 1, %o0
3: andcc %o1, 3, %o4
- bne 10b
-4: andcc %o0, 3, %g3
+ be 4f
+ nop
+
+ cmp %o4, 2
+ be 11f
+ cmp %o4, 3
+ ldub [%o1], %o5
+ add %o1, 1, %o1
+ stb %o5, [%o0]
+ be 13f
+ cmp %o5, 0
+ be 0f
+ add %o0, 1, %o0
+11: lduh [%o1], %o5
+ add %o1, 2, %o1
+ srl %o5, 8, %o4
+ cmp %o4, 0
+ stb %o4, [%o0]
+ bne,a 12f
+ stb %o5, [%o0 + 1]
+ retl
+ mov %g2, %o0
+12: andcc %o5, 0xff, %o5
+ bne 4f
+ add %o0, 2, %o0
+ retl
+ mov %g2, %o0
+13: bne 4f
+ add %o0, 1, %o0
+ retl
+ mov %g2, %o0
+
+4: andcc %o0, 3, %g3
bne 12f
1: ld [%o1], %o5
add %o1, 4, %o1
.text
.align 4
-10: ldub [%o0], %g4
+ENTRY(strchr)
+ andcc %o1, 0xff, %o1
+ be 12f
+ sll %o1, 8, %o2
+ andcc %o0, 3, %g0
+ or %o1, %o2, %o2
+ sethi %hi(0x80808080), %o4
+ sll %o2, 16, %o3
+ be 13f
+ or %o3, %o2, %g2
+
+ ldub [%o0], %g4
cmp %g4, %o1
- be 1f
+ be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
or %o4, %lo(0x80808080), %o3
ldub [%o0], %g4
cmp %g4, %o1
- be 1f
+ be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
sethi %hi(0x01010101), %o5
ldub [%o0], %g4
cmp %g4, %o1
- be 1f
+ be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
or %o5, %lo(0x01010101), %o2
b 6f
ld [%o0], %g4
-1: retl
+11: retl
sub %o0, 1, %o0
-ENTRY(strchr)
- andcc %o1, 0xff, %o1
- be 12f
- sll %o1, 8, %o2
- andcc %o0, 3, %g0
- or %o1, %o2, %o2
- sethi %hi(0x80808080), %o4
- sll %o2, 16, %o3
- bne 10b
- or %o3, %o2, %g2
- or %o4, %lo(0x80808080), %o3
+13: or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o5
5: or %o5, %lo(0x01010101), %o2
7: ld [%o0], %g4
.text
.align 4
-10: ldub [%o0], %o4
+
+ENTRY(strcmp)
+ andcc %o0, 3, %g0
+ be 13f
+ sethi %hi(0x80808080), %g1
+
+ ldub [%o0], %o4
add %o0, 1, %o0
ldub [%o1], %o5
cmp %o4, 0
2: retl
mov %o4, %o0
-ENTRY(strcmp)
- andcc %o0, 3, %g0
- bne 10b
- sethi %hi(0x80808080), %g1
- or %g1, %lo(0x80808080), %o3
+13: or %g1, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %g1
5: andcc %o1, 3, %g2
bne 12f
.text
.align 4
-1: ldub [%o1], %o5
+
+ENTRY(strcpy)
+ mov %o0, %g2
+ andcc %o1, 3, %g0
+ be 10f
+ sethi %hi(0x80808080), %o4
+
+ ldub [%o1], %o5
stb %o5, [%o0]
cmp %o5, 0
add %o0, 1, %o0
b 6f
andcc %o0, 3, %g3
-ENTRY(strcpy)
- mov %o0, %g2
- andcc %o1, 3, %g0
- bne 1b
- sethi %hi(0x80808080), %o4
- or %o4, %lo(0x80808080), %o3
+10: or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o4
5: andcc %o0, 3, %g3
6: bne 10f
.text
.align 4
-10: ldub [%o0], %o5
+
+ENTRY(strlen)
+ mov %o0, %o1
+ andcc %o0, 3, %g0
+ be 20f
+ sethi %hi(0x80808080), %o4
+
+ ldub [%o0], %o5
cmp %o5, 0
- be 1f
+ be 21f
add %o0, 1, %o0
andcc %o0, 3, %g0
be 4f
or %o4, %lo(0x80808080), %o3
ldub [%o0], %o5
cmp %o5, 0
- be 2f
+ be 22f
add %o0, 1, %o0
andcc %o0, 3, %g0
be 5f
sethi %hi(0x01010101), %o4
ldub [%o0], %o5
cmp %o5, 0
- be 3f
+ be 23f
add %o0, 1, %o0
b 11f
or %o4, %lo(0x01010101), %o2
-1: retl
+21: retl
mov 0, %o0
-2: retl
+22: retl
mov 1, %o0
-3: retl
+23: retl
mov 2, %o0
-ENTRY(strlen)
- mov %o0, %o1
- andcc %o0, 3, %g0
- bne 10b
- sethi %hi(0x80808080), %o4
- or %o4, %lo(0x80808080), %o3
+20: or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o4
5: or %o4, %lo(0x01010101), %o2
11: ld [%o0], %o5
.globl _dl_runtime_resolve_0
.type _dl_runtime_resolve_0, @function
_dl_runtime_resolve_0:
+ cfi_startproc
+
save %sp, -192, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+
sethi %hi(1047552), %l2
ldx [%g4 + 32 + 8], %o0
sub %g1, %g4, %l0
sllx %l0, 3, %o1
jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_resolve_0, .-_dl_runtime_resolve_0
/* %g1: PLT offset loaded by PLT entry
.globl _dl_runtime_resolve_1
.type _dl_runtime_resolve_1, @function
_dl_runtime_resolve_1:
+ cfi_startproc
+
save %sp, -192, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+
srlx %g1, 12, %o1
ldx [%g4 + 8], %o0
add %o1, %o1, %o3
add %o1, %o3, %o1
jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_resolve_1, .-_dl_runtime_resolve_1
/* For the profiling cases we pass in our stack frame
.globl _dl_profile_save_regs
.type _dl_profile_save_regs, @function
_dl_profile_save_regs:
+ cfi_startproc
+
stx %l0, [%sp + STACK_BIAS + ( 0 * 8)]
stx %l1, [%sp + STACK_BIAS + ( 1 * 8)]
stx %l2, [%sp + STACK_BIAS + ( 2 * 8)]
std %f28, [%sp + STACK_BIAS + (30 * 8)]
retl
std %f30, [%sp + STACK_BIAS + (31 * 8)]
+
+ cfi_endproc
+
.size _dl_profile_save_regs, .-_dl_profile_save_regs
/* If we are going to call pltexit, then we must replicate
.globl _dl_profile_invoke
.type _dl_profile_invoke, @function
_dl_profile_invoke:
+ cfi_startproc
+
sub %sp, %l0, %sp
1:
srlx %l0, 3, %l7
jmpl %i7 + 8, %g0
restore
+ cfi_endproc
+
+ .size _dl_profile_invoke, .-_dl_profile_invoke
+
/* %g1: PLT offset loaded by PLT entry
* %g4: callers PC, which is PLT0 + 24, therefore we
* add (32 + 8) to get the address of PLT2 which
.globl _dl_runtime_profile_0
.type _dl_runtime_profile_0, @function
_dl_runtime_profile_0:
+ cfi_startproc
+
brz,a,pn %fp, 1f
mov 192, %g5
sub %fp, %sp, %g5
1: save %sp, -336, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+
sethi %hi(1047552), %l2
ldx [%g4 + 32 + 8], %o0
sub %g1, %g4, %l0
1: jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_profile_0, .-_dl_runtime_profile_0
/* %g1: PLT offset loaded by PLT entry
.globl _dl_runtime_profile_1
.type _dl_runtime_profile_1, @function
_dl_runtime_profile_1:
+ cfi_startproc
+
brz,a,pn %fp, 1f
mov 192, %g5
sub %fp, %sp, %g5
1: save %sp, -336, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+
srlx %g1, 12, %o1
ldx [%g4 + 8], %o0
add %o1, %o1, %o3
1: jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_resolve_1, .-_dl_runtime_resolve_1
.global _start
.type _start,#function
_start:
+ cfi_startproc
#ifdef SHARED
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
drop their arguments. */
mov %g0, %fp
sub %sp, 6*8, %sp
+ cfi_adjust_cfa_offset(6*8)
/* Extract the arguments and environment as encoded on the stack. The
argument info starts after one register window (16 words) past the SP,
/* Die very horribly if exit returns. */
illtrap 0
+ cfi_endproc
+
.size _start, .-_start
/* Define a symbol for the first piece of initialized data. */
END(bcopy)
.align 32
+ENTRY(__memcpy_large)
200: be,pt %xcc, 201f /* CTI */
andcc %o0, 0x38, %g5 /* IEU1 Group */
mov 8, %g1 /* IEU0 */
stb %o5, [%o0 - 1] /* Store */
209: retl
mov %g4, %o0
+END(__memcpy_large)
#ifdef USE_BPR
END(memcpy)
.align 32
+ENTRY(__memmove_slowpath)
228: andcc %o2, 1, %g0 /* IEU1 Group */
be,pt %icc, 2f+4 /* CTI */
1: ldub [%o1 - 1], %o5 /* LOAD Group */
mov %g4, %o0
219: retl
nop
+END(__memmove_slowpath)
.align 32
ENTRY(memmove)
sllx %o2, 32, %g1
ba,pt %XCC, 1f
or %g1, %o2, %o2
+END(memset)
ENTRY(__bzero)
clr %o2
retl
mov %o3, %o0
END(__bzero)
-END(memset)
libc_hidden_builtin_def (memset)
weak_alias (__bzero, bzero)
64bit-predefine = __sparc_v9__ __arch64__
+
+ifeq ($(subdir),rt)
+librt-routines += rt-sysdep
+endif
--- /dev/null
+#include <sysdep.c>
#include <asm/errno.h>
#include <asm/unistd.h>
#include <tcb-offsets.h>
+#include <sysdep.h>
#define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000
pid_t *ptid, void *tls, pid_t *ctid); */
.text
- .align 4
- .globl __clone
- .type __clone,@function
-
-__clone:
+ENTRY (__clone)
save %sp,-96,%sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
/* sanity check arguments */
orcc %i0,%g0,%g2
tst %o1
bne __thread_start
nop
- ret
+ jmpl %i7 + 8, %g0
restore %o0,%g0,%o0
.Lerror:
call __errno_location
or %g0,EINVAL,%i0
st %i0,[%o0]
- ret
+ jmpl %i7 + 8, %g0
restore %g0,-1,%o0
-
- .size __clone, .-__clone
+END(__clone)
.type __thread_start,@function
-
__thread_start:
+ cfi_startproc
+
#ifdef RESET_PID
sethi %hi(CLONE_THREAD), %l0
andcc %g4, %l0, %g0
call _exit,0
nop
+ cfi_endproc
+
.size __thread_start, .-__thread_start
weak_alias (__clone, clone)
#include <sysdep.h>
- .globl __libc_pipe
-ENTRY (__libc_pipe)
- mov %o0, %o2 /* Save PIPEDES. */
- mov SYS_ify(pipe),%g1
- ta 0x10
- bcs __syscall_error_handler
- nop
- st %o0, [%o2] /* PIPEDES[0] = %o0; */
- st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */
+ .text
+ .globl __syscall_error
+ENTRY(__libc_pipe)
+ mov %o0, %o2 /* Save PIPEDES. */
+ mov SYS_ify(pipe),%g1
+ ta 0x10
+ bcc 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: st %o0, [%o2] /* PIPEDES[0] = %o0; */
+ st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */
retl
- clr %o0
- SYSCALL_ERROR_HANDLER
+ clr %o0
+END(__libc_pipe)
-PSEUDO_END (__libc_pipe)
weak_alias (__libc_pipe, __pipe)
libc_hidden_def (__pipe)
weak_alias (__libc_pipe, pipe)
# endif
#endif
-.globl __socket
+ .globl __syscall_error
ENTRY (__socket)
/* Drop up to 6 arguments (recvfrom) into the memory allocated by
add %sp, 68, %o1 /* arg 2: parameter block */
LOADSYSCALL(socketcall)
t 0x10
- bcs __syscall_error_handler
- nop
- retl
+ bcc 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: jmpl %o7 + 8, %g0
nop
#if defined NEED_CANCELLATION && defined CENABLE
.Lsocket_cancel:
- cfi_startproc
save %sp, -96, %sp
- cfi_def_cfa_register (%fp)
+ cfi_def_cfa_register(%fp)
cfi_window_save
- cfi_register (%o7, %i7)
+ cfi_register(%o7, %i7)
CENABLE
nop
mov %o0, %l0
mov P(SOCKOP_,socket), %o0
LOADSYSCALL(socketcall)
t 0x10
- bcs __syscall_error_handler2
+ bcc 1f
mov %o0, %l1
- CDISABLE
+ CDISABLE;
+ mov %l0, %o0;
+ call __syscall_error;
+ mov %l1, %o0;
+ b 1f
+ mov -1, %l1;
+1: CDISABLE
mov %l0, %o0
- jmpl %i7 + 8, %g0
+2: jmpl %i7 + 8, %g0
restore %g0, %l1, %o0
- cfi_endproc
- SYSCALL_ERROR_HANDLER2
#endif
- SYSCALL_ERROR_HANDLER
-
END (__socket)
#ifndef NO_WEAK_ALIAS
02111-1307 USA. */
#include <sysdep.h>
+
.text
-ENTRY (syscall)
+ .globl __syscall_error
+ENTRY(syscall)
mov %o0, %g1
mov %o1, %o0
mov %o2, %o1
mov %o4, %o3
mov %o5, %o4
ta 0x10
- bcs __syscall_error_handler
- nop
- retl
+ bcc 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: retl
nop
- SYSCALL_ERROR_HANDLER
-
-PSEUDO_END (syscall)
+END(syscall)
#undef PSEUDO
#undef PSEUDO_NOERRNO
#undef PSEUDO_ERRVAL
+#undef PSEUDO_END
#undef ENTRY
#undef END
#undef LOC
-#define ENTRY(name) \
- .global C_SYMBOL_NAME(name); \
- .align 4;\
- C_LABEL(name);\
- .type name,@function;
+#define ENTRY(name) \
+ .align 4; \
+ .global C_SYMBOL_NAME(name); \
+ .type name, @function; \
+C_LABEL(name) \
+ cfi_startproc;
-#define END(name) \
+#define END(name) \
+ cfi_endproc; \
.size name, . - name
#define LOC(name) .L##name
-#ifdef LINKER_HANDLES_R_SPARC_WDISP22
-/* Unfortunately, we cannot do this yet. Linker doesn't seem to
- handle R_SPARC_WDISP22 against non-STB_LOCAL symbols properly . */
-# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \
- .section .gnu.linkonce.t.handler,"ax",@progbits; \
- .globl handler; \
- .hidden handler; \
- .type handler,@function; \
-handler:
-#else
-# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \
- .subsection 3; \
-handler:
-#endif
-
-#if RTLD_PRIVATE_ERRNO
-# define SYSCALL_ERROR_HANDLER \
- .section .gnu.linkonce.t.__sparc_get_pic_l7,"ax",@progbits; \
- .globl __sparc_get_pic_l7; \
- .hidden __sparc_get_pic_l7; \
- .type __sparc_get_pic_l7,@function; \
-__sparc_get_pic_l7: \
- retl; \
- add %o7, %l7, %l7; \
- .previous; \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- save %sp,-96,%sp; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
- call __sparc_get_pic_l7; \
- add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
- ld [%l7 + rtld_errno], %l0; \
- st %i0, [%l0]; \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-#elif USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# ifdef SHARED
-# define SYSCALL_ERROR_HANDLER \
- .section .gnu.linkonce.t.__sparc_get_pic_l7,"ax",@progbits; \
- .globl __sparc_get_pic_l7; \
- .hidden __sparc_get_pic_l7; \
- .type __sparc_get_pic_l7,@function; \
-__sparc_get_pic_l7: \
- retl; \
- add %o7, %l7, %l7; \
- .previous; \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- save %sp,-96,%sp; \
- sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %l1; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
- call __sparc_get_pic_l7; \
- add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
- add %l1, %tie_lo10(SYSCALL_ERROR_ERRNO), %l1; \
- ld [%l7 + %l1], %l1, %tie_ld(SYSCALL_ERROR_ERRNO); \
- st %i0, [%g7 + %l1], %tie_add(SYSCALL_ERROR_ERRNO); \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-# else
-# define SYSCALL_ERROR_HANDLER \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_), %g2; \
- add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
- add %g2, %lo(_GLOBAL_OFFSET_TABLE_), %g2; \
- ld [%g2 + %g1], %g1, %tie_ld(SYSCALL_ERROR_ERRNO); \
- st %o0, [%g7 + %g1], %tie_add(SYSCALL_ERROR_ERRNO); \
- jmpl %o7+8, %g0; \
- mov -1, %o0; \
- .previous;
-# endif
-#else
-# define SYSCALL_ERROR_HANDLER \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- .global __errno_location; \
- .type __errno_location,@function; \
- save %sp, -96, %sp; \
- call __errno_location; \
- nop; \
- st %i0, [%o0]; \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-#endif
-
-#define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x10; \
- bcs __syscall_error_handler; \
- nop; \
- SYSCALL_ERROR_HANDLER
-
-#define PSEUDO_NOERRNO(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x10
-
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x10
+ /* If the offset to __syscall_error fits into a signed 22-bit
+ * immediate branch offset, the linker will relax the call into
+ * a normal branch.
+ */
+#define PSEUDO(name, syscall_name, args) \
+ .text; \
+ .globl __syscall_error; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x10; \
+ bcc 1f; \
+ mov %o7, %g1; \
+ call __syscall_error; \
+ mov %g1, %o7; \
+1:
+
+#define PSEUDO_NOERRNO(name, syscall_name, args)\
+ .text; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x10;
+
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+ .text; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x10;
+
+#define PSEUDO_END(name) \
+ END(name)
#else /* __ASSEMBLER__ */
#endif
.text
-ENTRY(__brk)
+ENTRY (__brk)
save %sp, -192, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
#ifdef PIC
1: call 2f
sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
sub %g0, 1, %i0
jmpl %i7+8, %g0
restore
-
- .size __brk, .-__brk
+END (__brk)
weak_alias (__brk, brk)
#include <asm/errno.h>
#include <asm/unistd.h>
#include <tcb-offsets.h>
+#include <sysdep.h>
#define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000
.register %g3,#scratch
.text
- .align 4
- .globl __clone
- .type __clone,@function
-__clone:
+ENTRY (__clone)
save %sp, -192, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
/* sanity check arguments */
brz,pn %i0, 99f /* fn non-NULL? */
nop
brnz,pn %o1, __thread_start
nop
- ret
+ jmpl %i7 + 8, %g0
restore %o0, %g0, %o0
99:
#ifndef _LIBC_REENTRANT
nop
st %i0, [%o0]
#endif
- ret
+ jmpl %i7 + 8, %g0
restore %g0,-1,%o0
- .size __clone, .-__clone
+END(__clone)
.type __thread_start,@function
__thread_start:
+ cfi_startproc
#ifdef RESET_PID
sethi %hi(CLONE_THREAD), %l0
andcc %g4, %l0, %g0
mov %g3,%o0
call _exit,0
nop
- .size __thread_start, .-__thread_start
+ cfi_endproc
+
+ .size __thread_start, .-__thread_start
weak_alias (__clone, clone)
#include <sysdep.h>
-ENTRY (__libc_pipe)
+ .text
+
+ .globl __syscall_error
+ENTRY(__libc_pipe)
mov %o0, %o2 /* Save PIPEDES. */
LOADSYSCALL(pipe)
ta 0x6d
- bcs,pn %xcc, __syscall_error_handler
- nop
- st %o0, [%o2] /* PIPEDES[0] = %o0; */
+ bcc,pt %xcc, 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: st %o0, [%o2] /* PIPEDES[0] = %o0; */
st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */
retl
clr %o0
- SYSCALL_ERROR_HANDLER
-PSEUDO_END (__libc_pipe)
+END(__libc_pipe)
weak_alias (__libc_pipe, __pipe)
libc_hidden_def (__pipe)
.weak setcontext
ENTRY(setcontext)
- mov 1, %o1
+ ba,pt %xcc, 1f
+ mov 1, %o1
+
+END(setcontext)
/* int __setcontext(ucontext_t *ctx, int restoremask); */
ENTRY(__setcontext)
- ldx [%o0 + UC_SIGMASK], %o2
+1: ldx [%o0 + UC_SIGMASK], %o2
stx %o2, [%o0 + __UC_SIGMASK]
ta 0x6f
/* int setjmp(jmp_buf) */
ENTRY(setjmp)
- set 1, %o1
+ ba,pt %xcc, __sigsetjmp_local
+ set 1, %o1
END(setjmp)
/* int __sigsetjmp(jmp_buf, savemask) */
# endif
#endif
-.globl __socket
-ENTRY (__socket)
+ .globl __syscall_error
+ENTRY(__socket)
/* Drop up to 6 arguments (recvfrom) into the memory allocated by
the caller for varargs, since that's really what we have. */
LOADSYSCALL(socketcall)
ta 0x6d
- bcs,pn %xcc, __syscall_error_handler
- nop
- retl
+ bcc,pt %xcc, 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: retl
nop
#if defined NEED_CANCELLATION && defined CENABLE
.Lsocket_cancel:
- cfi_startproc
save %sp, -160, %sp
cfi_def_cfa_register (%fp)
cfi_window_save
LOADSYSCALL(socketcall)
ta 0x6d
- bcs,pn %xcc, __syscall_error_handler2
+ bcc,pt %xcc, 1f
mov %o0, %l1
- CDISABLE
+ CDISABLE;
+ mov %l0, %o0;
+ call __syscall_error;
+ mov %l1, %o0;
+ ba,pt %xcc, 2f
+ mov -1, %l1;
+1: CDISABLE
mov %l0, %o0
- jmpl %i7 + 8, %g0
+2: jmpl %i7 + 8, %g0
restore %g0, %l1, %o0
- cfi_endproc
- SYSCALL_ERROR_HANDLER2
#endif
- SYSCALL_ERROR_HANDLER
-
-END (__socket)
+END(__socket)
#ifndef NO_WEAK_ALIAS
weak_alias (__socket, socket)
#include <sysdep.h>
.text
-ENTRY (syscall)
-
+ .globl __syscall_error
+ENTRY(syscall)
mov %o0,%g1
mov %o1,%o0
mov %o2,%o1
ta 0x6d
- bcs,pn %xcc,__syscall_error_handler
- nop
- retl
+ bcc,pt %xcc, 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: retl
nop
-
- SYSCALL_ERROR_HANDLER
-
-PSEUDO_END (syscall)
+END(syscall)
#undef PSEUDO
#undef PSEUDO_NOERRNO
#undef PSEUDO_ERRVAL
-#undef ENTRY
-
-#define ENTRY(name) \
- .global C_SYMBOL_NAME(name); \
- .align 2; \
- C_LABEL(name); \
- .type name,@function;
-
-#ifdef LINKER_HANDLES_R_SPARC_WDISP22
-/* Unfortunately, we cannot do this yet. Linker doesn't seem to
- handle R_SPARC_WDISP22 against non-STB_LOCAL symbols properly . */
-# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \
- .section .gnu.linkonce.t.handler,"ax",@progbits; \
- .globl handler; \
- .hidden handler; \
- .type handler,@function; \
-handler:
-#else
-# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \
- .subsection 3; \
-handler:
-#endif
-
-#if RTLD_PRIVATE_ERRNO
-# define SYSCALL_ERROR_HANDLER \
- .section .gnu.linkonce.t.__sparc64.get_pic.l7,"ax",@progbits; \
- .globl __sparc64.get_pic.l7; \
- .hidden __sparc64.get_pic.l7; \
- .type __sparc64.get_pic.l7,@function; \
-__sparc64.get_pic.l7: \
- retl; \
- add %o7, %l7, %l7; \
- .previous; \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- save %sp, -192, %sp; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
- call __sparc64.get_pic.l7; \
- add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
- sethi %hi(rtld_errno), %g1; \
- or %g1, %lo(rtld_errno), %g1; \
- ldx [%l7 + %g1], %l0; \
- st %i0, [%l0]; \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-#elif USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# ifdef SHARED
-# define SYSCALL_ERROR_HANDLER \
- .section .gnu.linkonce.t.__sparc64.get_pic.l7,"ax",@progbits; \
- .globl __sparc64.get_pic.l7; \
- .hidden __sparc64.get_pic.l7; \
- .type __sparc64.get_pic.l7,@function; \
-__sparc64.get_pic.l7: \
- retl; \
- add %o7, %l7, %l7; \
- .previous; \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- save %sp,-192,%sp; \
- sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %l1; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
- call __sparc64.get_pic.l7; \
- add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
- add %l1, %tie_lo10(SYSCALL_ERROR_ERRNO), %l1; \
- ldx [%l7 + %l1], %l1, %tie_ldx(SYSCALL_ERROR_ERRNO); \
- st %i0, [%g7 + %l1], %tie_add(SYSCALL_ERROR_ERRNO); \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-# else
-# define SYSCALL_ERROR_HANDLER \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_), %g4; \
- add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
- add %g4, %lo(_GLOBAL_OFFSET_TABLE_), %g4; \
- ldx [%g4 + %g1], %g1, %tie_ldx(SYSCALL_ERROR_ERRNO); \
- st %o0, [%g7 + %g1], %tie_add(SYSCALL_ERROR_ERRNO); \
- jmpl %o7+8, %g0; \
- mov -1, %o0; \
- .previous;
-# endif
-#else
-# define SYSCALL_ERROR_HANDLER \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- .global __errno_location; \
- .type __errno_location,@function; \
- save %sp, -192, %sp; \
- call __errno_location; \
- nop; \
- st %i0, [%o0]; \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-#endif
-
-#define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x6d; \
- bcs,pn %xcc, __syscall_error_handler; \
- nop; \
- SYSCALL_ERROR_HANDLER
-
-#define PSEUDO_NOERRNO(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x6d
-
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x6d
-
#undef PSEUDO_END
-#define PSEUDO_END(name) \
- .size name,.-name
-
-#undef PSEUDO_END_NOERRNO
-#define PSEUDO_END_NOERRNO(name) \
- .size name,.-name
+#undef ENTRY
+#undef END
-#undef PSEUDO_END_ERRVAL
-#define PSEUDO_END_ERRVAL(name) \
- .size name,.-name
+#define ENTRY(name) \
+ .align 4; \
+ .global C_SYMBOL_NAME(name); \
+ .type name, @function; \
+C_LABEL(name) \
+ cfi_startproc;
+
+#define END(name) \
+ cfi_endproc; \
+ .size name, . - name
+
+ /* If the offset to __syscall_error fits into a signed 22-bit
+ * immediate branch offset, the linker will relax the call into
+ * a normal branch.
+ */
+#define PSEUDO(name, syscall_name, args) \
+ .text; \
+ .globl __syscall_error; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x6d; \
+ bcc,pt %xcc, 1f; \
+ mov %o7, %g1; \
+ call __syscall_error; \
+ mov %g1, %o7; \
+1:
+
+#define PSEUDO_NOERRNO(name, syscall_name, args)\
+ .text; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x6d;
+
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+ .text; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x6d;
+
+#define PSEUDO_END(name) \
+ END(name)
-#undef END
-#define END(name) \
- .size name,.-name
/* Careful here! This "ret" define can interfere; use jmpl if unsure. */
#define ret retl; nop
+++ /dev/null
-/* Nothing to do here. */
--- /dev/null
+#include <sysdeps/unix/sysv/linux/powerpc/sysdep.c>