Commit 79793455 authored by Helge Deller's avatar Helge Deller Committed by Kyle McMartin

[PARISC] add ENTRY()/ENDPROC() and simplify assembly of HP/UX emulation code

Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarKyle McMartin <kyle@parisc-linux.org>
parent 513e7ecd
...@@ -18,17 +18,16 @@ ...@@ -18,17 +18,16 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <asm/unistd.h>
#include <asm/assembly.h>
#include <linux/sys.h> #include <linux/sys.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/unistd.h>
#define ENTRY_NAME(_name_) .word _name_ #define ENTRY_NAME(_name_) ASM_ULONG_INSN _name_
.section .rodata,"a" .section .rodata,"a"
.align 4
.export hpux_call_table
.import hpux_unimplemented_wrapper .import hpux_unimplemented_wrapper
hpux_call_table: ENTRY(hpux_call_table)
ENTRY_NAME(sys_ni_syscall) /* 0 */ ENTRY_NAME(sys_ni_syscall) /* 0 */
ENTRY_NAME(sys_exit) ENTRY_NAME(sys_exit)
ENTRY_NAME(hpux_fork_wrapper) ENTRY_NAME(hpux_fork_wrapper)
...@@ -542,5 +541,6 @@ hpux_call_table: ...@@ -542,5 +541,6 @@ hpux_call_table:
ENTRY_NAME(hpux_unimplemented_wrapper) /* 510 */ ENTRY_NAME(hpux_unimplemented_wrapper) /* 510 */
ENTRY_NAME(hpux_unimplemented_wrapper) ENTRY_NAME(hpux_unimplemented_wrapper)
ENTRY_NAME(hpux_unimplemented_wrapper) ENTRY_NAME(hpux_unimplemented_wrapper)
END(hpux_call_table)
.end .end
...@@ -12,27 +12,18 @@ ...@@ -12,27 +12,18 @@
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <asm/errno.h> #include <asm/errno.h>
#include <linux/linkage.h>
#ifdef __LP64__ .level LEVEL
.level 2.0w
#else
.level 1.1
#endif
.text .text
#ifdef __LP64__
#define FRAME_SIZE 128
#else
#define FRAME_SIZE 64
#endif
.import hpux_call_table .import hpux_call_table
.import hpux_syscall_exit,code .import hpux_syscall_exit,code
.export hpux_gateway_page
.align 4096 .align 4096
hpux_gateway_page: ENTRY(hpux_gateway_page)
nop nop
#ifdef __LP64__ #ifdef CONFIG_64BIT
#warning NEEDS WORK for 64-bit #warning NEEDS WORK for 64-bit
#endif #endif
ldw -64(%r30), %r29 ;! 8th argument ldw -64(%r30), %r29 ;! 8th argument
...@@ -101,7 +92,7 @@ hpux_gateway_page: ...@@ -101,7 +92,7 @@ hpux_gateway_page:
ldo R%hpux_call_table(%r21), %r21 ldo R%hpux_call_table(%r21), %r21
comiclr,>>= __NR_HPUX_syscalls, %r22, %r0 comiclr,>>= __NR_HPUX_syscalls, %r22, %r0
b,n syscall_nosys b,n syscall_nosys
ldwx,s %r22(%r21), %r21 LDREGX %r22(%r21), %r21
ldil L%hpux_syscall_exit,%r2 ldil L%hpux_syscall_exit,%r2
be 0(%sr7,%r21) be 0(%sr7,%r21)
ldo R%hpux_syscall_exit(%r2),%r2 ldo R%hpux_syscall_exit(%r2),%r2
...@@ -110,7 +101,7 @@ syscall_nosys: ...@@ -110,7 +101,7 @@ syscall_nosys:
ldil L%hpux_syscall_exit,%r1 ldil L%hpux_syscall_exit,%r1
be R%hpux_syscall_exit(%sr7,%r1) be R%hpux_syscall_exit(%sr7,%r1)
ldo -ENOSYS(%r0),%r28 ldo -ENOSYS(%r0),%r28
ENDPROC(hpux_gateway_page)
.align 4096 .align 4096
.export end_hpux_gateway_page ENTRY(end_hpux_gateway_page)
end_hpux_gateway_page:
...@@ -511,7 +511,7 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2) ...@@ -511,7 +511,7 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
/* Table of syscall names and handle for unimplemented routines */ /* Table of syscall names and handle for unimplemented routines */
static const char *syscall_names[] = { static const char * const syscall_names[] = {
"nosys", /* 0 */ "nosys", /* 0 */
"exit", "exit",
"fork", "fork",
......
...@@ -20,19 +20,16 @@ ...@@ -20,19 +20,16 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#ifdef __LP64__ #ifdef CONFIG_64BIT
#warning PA64 support needs more work...did first cut #warning PA64 support needs more work...did first cut
#endif #endif
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/assembly.h> #include <asm/assembly.h>
#include <asm/signal.h> #include <asm/signal.h>
#include <linux/linkage.h>
#ifdef __LP64__ .level LEVEL
.level 2.0w
#else
.level 1.1
#endif
.text .text
/* These should probably go in a header file somewhere. /* These should probably go in a header file somewhere.
...@@ -41,7 +38,7 @@ ...@@ -41,7 +38,7 @@
* register save/restore macros. * register save/restore macros.
*/ */
.macro reg_save regs .macro reg_save regs
#ifdef __LP64__ #ifdef CONFIG_64BIT
#warning NEEDS WORK for 64-bit #warning NEEDS WORK for 64-bit
#endif #endif
STREG %r3, PT_GR3(\regs) STREG %r3, PT_GR3(\regs)
...@@ -82,11 +79,9 @@ ...@@ -82,11 +79,9 @@
.endm .endm
.export hpux_fork_wrapper
.export hpux_child_return
.import sys_fork .import sys_fork
hpux_fork_wrapper: ENTRY(hpux_fork_wrapper)
ldo TASK_REGS-TASK_SZ_ALGN-64(%r30),%r1 ;! get pt regs ldo TASK_REGS-TASK_SZ_ALGN-64(%r30),%r1 ;! get pt regs
;! pointer in task ;! pointer in task
reg_save %r1 reg_save %r1
...@@ -128,27 +123,26 @@ fork_return: ...@@ -128,27 +123,26 @@ fork_return:
fork_exit: fork_exit:
bv %r0(%r2) bv %r0(%r2)
nop nop
ENDPROC(hpux_fork_wrapper)
/* Set the return value for the child */ /* Set the return value for the child */
hpux_child_return: ENTRY(hpux_child_return)
#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
bl schedule_tail, %r2 bl,n schedule_tail, %r2
nop
#endif #endif
LDREG TASK_PT_GR19-TASK_SZ_ALGN-128(%r30),%r2 LDREG TASK_PT_GR19-TASK_SZ_ALGN-128(%r30),%r2
b fork_return b fork_return
copy %r0,%r28 copy %r0,%r28
ENDPROC(hpux_child_return)
.export hpux_execve_wrapper
.export hpux_execv_wrapper
.import hpux_execve .import hpux_execve
hpux_execv_wrapper: ENTRY(hpux_execv_wrapper)
copy %r0,%r24 /* NULL environment */ copy %r0,%r24 /* NULL environment */
hpux_execve_wrapper: ENTRY(hpux_execve_wrapper)
ldo TASK_REGS-TASK_SZ_ALGN-64(%r30),%r1 ;! get pt regs ldo TASK_REGS-TASK_SZ_ALGN-64(%r30),%r1 ;! get pt regs
...@@ -187,13 +181,13 @@ hpux_execve_wrapper: ...@@ -187,13 +181,13 @@ hpux_execve_wrapper:
exec_error: exec_error:
bv %r0(%r19) bv %r0(%r19)
nop nop
ENDPROC(hpux_execv_wrapper)
.export hpux_pipe_wrapper
.import hpux_pipe .import hpux_pipe
/* HP-UX expects pipefd's returned in r28 & r29 */ /* HP-UX expects pipefd's returned in r28 & r29 */
hpux_pipe_wrapper: ENTRY(hpux_pipe_wrapper)
STREG %r2,-20(%r30) STREG %r2,-20(%r30)
ldo 64(%r30),%r30 ldo 64(%r30),%r30
bl hpux_pipe,%r2 bl hpux_pipe,%r2
...@@ -212,12 +206,11 @@ hpux_pipe_wrapper: ...@@ -212,12 +206,11 @@ hpux_pipe_wrapper:
pipe_exit: pipe_exit:
bv %r0(%r2) bv %r0(%r2)
ldo -64(%r30),%r30 ldo -64(%r30),%r30
ENDPROC(hpux_pipe_wrapper)
.export hpux_syscall_exit
.import syscall_exit .import syscall_exit
hpux_syscall_exit: ENTRY(hpux_syscall_exit)
/* /*
* *
* HP-UX call return conventions: * HP-UX call return conventions:
...@@ -246,12 +239,12 @@ hpux_syscall_exit: ...@@ -246,12 +239,12 @@ hpux_syscall_exit:
ldo 1(%r0),%r22 ldo 1(%r0),%r22
no_error: no_error:
b syscall_exit b,n syscall_exit
nop ENDPROC(hpux_syscall_exit)
.export hpux_unimplemented_wrapper
.import hpux_unimplemented .import hpux_unimplemented
hpux_unimplemented_wrapper: ENTRY(hpux_unimplemented_wrapper)
b hpux_unimplemented b hpux_unimplemented
STREG %r22,-64(%r30) /* overwrite arg8 with syscall number */ STREG %r22,-64(%r30) /* overwrite arg8 with syscall number */
ENDPROC(hpux_unimplemented_wrapper)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment