mirror of git://sourceware.org/git/glibc.git
Mon Jun 10 17:50:31 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/unix/alpha/sysdep.h: Move error-handling code in PSEUDO to PSEUDO_END to improve branch-prediction. Include .frame directive to make syscalls debugabble. (PSEUDO_END): New macro. * sysdeps/unix/alpha/sysdep.h, sysdeps/alpha/bb_init_func.S, sysdeps/unix/sysv/linux/alpha/brk.S: Use ldiq instead of ldi since latter is illegal under DEC Unix.
This commit is contained in:
parent
e3829e904a
commit
bb486e187e
|
@ -58,25 +58,27 @@ Cambridge, MA 02139, USA. */
|
||||||
.frame sp, 0, ra
|
.frame sp, 0, ra
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Note that while it's better structurally, going back to set errno
|
/* Mark the end of function SYM. */
|
||||||
can make things confusing if you're debugging---it looks like it's jumping
|
#undef END
|
||||||
backwards into the previous fn. */
|
#define END(sym) .end sym
|
||||||
|
|
||||||
|
/* Note that PSEUDO/PSEUDO_END use label number 1996---do not use a
|
||||||
|
label of that number between those two macros! */
|
||||||
|
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
#define PSEUDO(name, syscall_name, args) \
|
#define PSEUDO(name, syscall_name, args) \
|
||||||
.globl name; \
|
.globl name; \
|
||||||
.align 3; \
|
.align 3; \
|
||||||
.ent name,0; \
|
.ent name,0; \
|
||||||
\
|
\
|
||||||
1: br gp, 2f; \
|
|
||||||
2: ldgp gp, 0(gp); \
|
|
||||||
jmp zero, syscall_error; \
|
|
||||||
\
|
|
||||||
name##: \
|
name##: \
|
||||||
ldi v0, SYS_ify(syscall_name); \
|
.frame sp, 0, ra \
|
||||||
|
.prologue 1; /* yes, we do use gp */ \
|
||||||
|
ldiq v0, SYS_ify(syscall_name); \
|
||||||
.set noat; \
|
.set noat; \
|
||||||
call_pal PAL_callsys; \
|
call_pal PAL_callsys; \
|
||||||
.set at; \
|
.set at; \
|
||||||
bne a3, 1b; \
|
bne a3, 1996f; \
|
||||||
3:
|
3:
|
||||||
#else
|
#else
|
||||||
#define PSEUDO(name, syscall_name, args) \
|
#define PSEUDO(name, syscall_name, args) \
|
||||||
|
@ -84,21 +86,35 @@ name##: \
|
||||||
.align 3; \
|
.align 3; \
|
||||||
.ent name,0; \
|
.ent name,0; \
|
||||||
\
|
\
|
||||||
1: br gp, 2f; \
|
|
||||||
2: ldgp gp, 0(gp); \
|
|
||||||
jmp zero, syscall_error; \
|
|
||||||
\
|
|
||||||
name/**/: \
|
name/**/: \
|
||||||
ldi v0, SYS_ify(syscall_name); \
|
.frame sp, 0, ra \
|
||||||
|
.prologue 1; /* yes, we do use gp */ \
|
||||||
|
ldiq v0, SYS_ify(syscall_name); \
|
||||||
.set noat; \
|
.set noat; \
|
||||||
call_pal PAL_callsys; \
|
call_pal PAL_callsys; \
|
||||||
.set at; \
|
.set at; \
|
||||||
bne a3, 1b; \
|
bne a3, 1996f; \
|
||||||
3:
|
3:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef END
|
#undef PSEUDO_END
|
||||||
#define END(sym) .end sym
|
|
||||||
|
#ifdef PIC
|
||||||
|
/* When building a shared library, we can use a branch since the text
|
||||||
|
section of the library is much smaller than 4MB. If we ever break
|
||||||
|
this assumption, the linker will tell us. */
|
||||||
|
# define PSEUDO_END(sym) \
|
||||||
|
1996: \
|
||||||
|
br zero, __syscall_error; \
|
||||||
|
END(sym)
|
||||||
|
#else
|
||||||
|
# define PSEUDO_END(sym) \
|
||||||
|
1996: \
|
||||||
|
br gp, 2f; \
|
||||||
|
2: ldgp gp, 0(gp); \
|
||||||
|
jmp zero, __syscall_error; \
|
||||||
|
END(sym)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define r0 v0
|
#define r0 v0
|
||||||
#define r1 a4
|
#define r1 a4
|
||||||
|
|
Loading…
Reference in New Issue