2007-05-17 Carlos O'Donell <carlos@systemhalted.org>

* sysdeps/unix/sysv/linux/hppa/sysdep.h (PIC_REG_DEF): Define.
	(PIC_REG_USE): Define.
	(INLINE_SYSCALL): Use PIC_REG_DEF, PIC_REG_USE.
	(INTERNAL_SYSCALL): Likewise.
	(INTERNAL_SYSCALL_NCS): Likewise.
	* sysdeps/unix/sysv/linux/hppa/sysdep.c (syscall): Use
	PIC_REG_DEF, PIC_REG_USE.
This commit is contained in:
Carlos O'Donell 2007-05-18 01:59:52 +00:00
parent bdef6f9a42
commit d164f33b2a
3 changed files with 29 additions and 9 deletions

View File

@ -1,3 +1,13 @@
2007-05-17 Carlos O'Donell <carlos@systemhalted.org>
* sysdeps/unix/sysv/linux/hppa/sysdep.h (PIC_REG_DEF): Define.
(PIC_REG_USE): Define.
(INLINE_SYSCALL): Use PIC_REG_DEF, PIC_REG_USE.
(INTERNAL_SYSCALL): Likewise.
(INTERNAL_SYSCALL_NCS): Likewise.
* sysdeps/unix/sysv/linux/hppa/sysdep.c (syscall): Use
PIC_REG_DEF, PIC_REG_USE.
2007-05-01 Carlos O'Donell <carlos@systemhalted.org> 2007-05-01 Carlos O'Donell <carlos@systemhalted.org>
* sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h * sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h

View File

@ -1,4 +1,5 @@
/* Copyright (C) 1997, 1998, 2001, 2003 Free Software Foundation, Inc. /* Copyright (C) 1997, 1998, 2001, 2003, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -58,13 +59,14 @@ syscall (long int __sysno, ...)
{ {
register unsigned long int __res asm("r28"); register unsigned long int __res asm("r28");
PIC_REG_DEF
LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5) LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5)
asm volatile (SAVE_ASM_PIC asm volatile (SAVE_ASM_PIC
" ble 0x100(%%sr2, %%r0) \n" " ble 0x100(%%sr2, %%r0) \n"
" copy %1, %%r20 \n" " copy %1, %%r20 \n"
LOAD_ASM_PIC LOAD_ASM_PIC
: "=r" (__res) : "=r" (__res)
: "r" (__sysno) ASM_ARGS_6 : "r" (__sysno) PIC_REG_USE ASM_ARGS_6
: "memory", CALL_CLOB_REGS CLOB_ARGS_6); : "memory", CALL_CLOB_REGS CLOB_ARGS_6);
__sys_res = __res; __sys_res = __res;
} }

View File

@ -1,5 +1,6 @@
/* Assembler macros for PA-RISC. /* Assembler macros for PA-RISC.
Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. Copyright (C) 1999, 2001, 2002, 2003, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999. Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000. Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000.
@ -40,7 +41,9 @@
# define TREG_ASM "%r4" /* Cant clobber r3, it holds framemarker */ # define TREG_ASM "%r4" /* Cant clobber r3, it holds framemarker */
# define SAVE_ASM_PIC " copy %%r19, %" TREG_ASM "\n" # define SAVE_ASM_PIC " copy %%r19, %" TREG_ASM "\n"
# define LOAD_ASM_PIC " copy %" TREG_ASM ", %%r19\n" # define LOAD_ASM_PIC " copy %" TREG_ASM ", %%r19\n"
# define USING_TREG TREG_ASM, # define CLOB_TREG TREG_ASM ,
# define PIC_REG_DEF register unsigned long __r19 asm("r19");
# define PIC_REG_USE , "r" (__r19)
#else #else
# define TREG %r3 # define TREG %r3
# define SAVE_PIC(SREG) nop ASM_LINE_SEP # define SAVE_PIC(SREG) nop ASM_LINE_SEP
@ -49,7 +52,9 @@
# define TREG_ASM # define TREG_ASM
# define SAVE_ASM_PIC "nop \n" # define SAVE_ASM_PIC "nop \n"
# define LOAD_ASM_PIC "nop \n" # define LOAD_ASM_PIC "nop \n"
# define USING_TREG # define CLOB_TREG
# define PIC_REG_DEF
# define PIC_REG_USE
#endif #endif
#ifdef __ASSEMBLER__ #ifdef __ASSEMBLER__
@ -344,7 +349,7 @@ L(pre_end): ASM_LINE_SEP \
TREG is clobbered and use that register to save/restore r19 TREG is clobbered and use that register to save/restore r19
across the syscall. */ across the syscall. */
#define CALL_CLOB_REGS "%r1", "%r2", USING_TREG \ #define CALL_CLOB_REGS "%r1", "%r2", CLOB_TREG \
"%r20", "%r29", "%r31" "%r20", "%r29", "%r31"
#undef INLINE_SYSCALL #undef INLINE_SYSCALL
@ -353,6 +358,7 @@ L(pre_end): ASM_LINE_SEP \
long __sys_res; \ long __sys_res; \
{ \ { \
register unsigned long __res asm("r28"); \ register unsigned long __res asm("r28"); \
PIC_REG_DEF \
LOAD_ARGS_##nr(args) \ LOAD_ARGS_##nr(args) \
/* FIXME: HACK save/load r19 around syscall */ \ /* FIXME: HACK save/load r19 around syscall */ \
asm volatile( \ asm volatile( \
@ -361,7 +367,7 @@ L(pre_end): ASM_LINE_SEP \
" ldi %1, %%r20\n" \ " ldi %1, %%r20\n" \
LOAD_ASM_PIC \ LOAD_ASM_PIC \
: "=r" (__res) \ : "=r" (__res) \
: "i" (SYS_ify(name)) ASM_ARGS_##nr \ : "i" (SYS_ify(name)) PIC_REG_USE ASM_ARGS_##nr \
: "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \ : "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \
); \ ); \
__sys_res = (long)__res; \ __sys_res = (long)__res; \
@ -398,6 +404,7 @@ L(pre_end): ASM_LINE_SEP \
long __sys_res; \ long __sys_res; \
{ \ { \
register unsigned long __res asm("r28"); \ register unsigned long __res asm("r28"); \
PIC_REG_DEF \
LOAD_ARGS_##nr(args) \ LOAD_ARGS_##nr(args) \
/* FIXME: HACK save/load r19 around syscall */ \ /* FIXME: HACK save/load r19 around syscall */ \
asm volatile( \ asm volatile( \
@ -406,7 +413,7 @@ L(pre_end): ASM_LINE_SEP \
" ldi %1, %%r20\n" \ " ldi %1, %%r20\n" \
LOAD_ASM_PIC \ LOAD_ASM_PIC \
: "=r" (__res) \ : "=r" (__res) \
: "i" (SYS_ify(name)) ASM_ARGS_##nr \ : "i" (SYS_ify(name)) PIC_REG_USE ASM_ARGS_##nr \
: "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \ : "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \
); \ ); \
__sys_res = (long)__res; \ __sys_res = (long)__res; \
@ -422,6 +429,7 @@ L(pre_end): ASM_LINE_SEP \
long __sys_res; \ long __sys_res; \
{ \ { \
register unsigned long __res asm("r28"); \ register unsigned long __res asm("r28"); \
PIC_REG_DEF \
LOAD_ARGS_##nr(args) \ LOAD_ARGS_##nr(args) \
/* FIXME: HACK save/load r19 around syscall */ \ /* FIXME: HACK save/load r19 around syscall */ \
asm volatile( \ asm volatile( \
@ -430,7 +438,7 @@ L(pre_end): ASM_LINE_SEP \
" copy %1, %%r20\n" \ " copy %1, %%r20\n" \
LOAD_ASM_PIC \ LOAD_ASM_PIC \
: "=r" (__res) \ : "=r" (__res) \
: "r" (name) ASM_ARGS_##nr \ : "r" (name) PIC_REG_USE ASM_ARGS_##nr \
: "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \ : "memory", CALL_CLOB_REGS CLOB_ARGS_##nr \
); \ ); \
__sys_res = (long)__res; \ __sys_res = (long)__res; \