Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>

authored by

Helge Deller and committed by
Kyle McMartin
79793455 513e7ecd

+32 -48
+5 -5
arch/parisc/hpux/entry_hpux.S
··· 18 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 20 21 + #include <asm/unistd.h> 22 + #include <asm/assembly.h> 21 23 #include <linux/sys.h> 22 24 #include <linux/linkage.h> 23 - #include <asm/unistd.h> 24 25 25 - #define ENTRY_NAME(_name_) .word _name_ 26 + #define ENTRY_NAME(_name_) ASM_ULONG_INSN _name_ 26 27 27 28 .section .rodata,"a" 28 - .align 4 29 - .export hpux_call_table 30 29 .import hpux_unimplemented_wrapper 31 - hpux_call_table: 30 + ENTRY(hpux_call_table) 32 31 ENTRY_NAME(sys_ni_syscall) /* 0 */ 33 32 ENTRY_NAME(sys_exit) 34 33 ENTRY_NAME(hpux_fork_wrapper) ··· 541 542 ENTRY_NAME(hpux_unimplemented_wrapper) /* 510 */ 542 543 ENTRY_NAME(hpux_unimplemented_wrapper) 543 544 ENTRY_NAME(hpux_unimplemented_wrapper) 545 + END(hpux_call_table) 544 546 .end 545 547
+7 -16
arch/parisc/hpux/gate.S
··· 12 12 #include <asm/asm-offsets.h> 13 13 #include <asm/unistd.h> 14 14 #include <asm/errno.h> 15 + #include <linux/linkage.h> 15 16 16 - #ifdef __LP64__ 17 - .level 2.0w 18 - #else 19 - .level 1.1 20 - #endif 17 + .level LEVEL 21 18 .text 22 19 23 - #ifdef __LP64__ 24 - #define FRAME_SIZE 128 25 - #else 26 - #define FRAME_SIZE 64 27 - #endif 28 20 .import hpux_call_table 29 21 .import hpux_syscall_exit,code 30 - .export hpux_gateway_page 31 22 32 23 .align 4096 33 - hpux_gateway_page: 24 + ENTRY(hpux_gateway_page) 34 25 nop 35 - #ifdef __LP64__ 26 + #ifdef CONFIG_64BIT 36 27 #warning NEEDS WORK for 64-bit 37 28 #endif 38 29 ldw -64(%r30), %r29 ;! 8th argument ··· 92 101 ldo R%hpux_call_table(%r21), %r21 93 102 comiclr,>>= __NR_HPUX_syscalls, %r22, %r0 94 103 b,n syscall_nosys 95 - ldwx,s %r22(%r21), %r21 104 + LDREGX %r22(%r21), %r21 96 105 ldil L%hpux_syscall_exit,%r2 97 106 be 0(%sr7,%r21) 98 107 ldo R%hpux_syscall_exit(%r2),%r2 ··· 101 110 ldil L%hpux_syscall_exit,%r1 102 111 be R%hpux_syscall_exit(%sr7,%r1) 103 112 ldo -ENOSYS(%r0),%r28 113 + ENDPROC(hpux_gateway_page) 104 114 105 115 .align 4096 106 - .export end_hpux_gateway_page 107 - end_hpux_gateway_page: 116 + ENTRY(end_hpux_gateway_page)
+1 -1
arch/parisc/hpux/sys_hpux.c
··· 511 511 512 512 513 513 /* Table of syscall names and handle for unimplemented routines */ 514 - static const char *syscall_names[] = { 514 + static const char * const syscall_names[] = { 515 515 "nosys", /* 0 */ 516 516 "exit", 517 517 "fork",
+19 -26
arch/parisc/hpux/wrappers.S
··· 20 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 21 */ 22 22 23 - #ifdef __LP64__ 23 + #ifdef CONFIG_64BIT 24 24 #warning PA64 support needs more work...did first cut 25 25 #endif 26 26 27 27 #include <asm/asm-offsets.h> 28 28 #include <asm/assembly.h> 29 29 #include <asm/signal.h> 30 + #include <linux/linkage.h> 30 31 31 - #ifdef __LP64__ 32 - .level 2.0w 33 - #else 34 - .level 1.1 35 - #endif 32 + .level LEVEL 36 33 .text 37 34 38 35 /* These should probably go in a header file somewhere. ··· 38 41 * register save/restore macros. 39 42 */ 40 43 .macro reg_save regs 41 - #ifdef __LP64__ 44 + #ifdef CONFIG_64BIT 42 45 #warning NEEDS WORK for 64-bit 43 46 #endif 44 47 STREG %r3, PT_GR3(\regs) ··· 79 82 .endm 80 83 81 84 82 - .export hpux_fork_wrapper 83 - .export hpux_child_return 84 85 .import sys_fork 85 86 86 - hpux_fork_wrapper: 87 + ENTRY(hpux_fork_wrapper) 87 88 ldo TASK_REGS-TASK_SZ_ALGN-64(%r30),%r1 ;! get pt regs 88 89 ;! pointer in task 89 90 reg_save %r1 ··· 123 128 fork_exit: 124 129 bv %r0(%r2) 125 130 nop 131 + ENDPROC(hpux_fork_wrapper) 126 132 127 133 /* Set the return value for the child */ 128 134 129 - hpux_child_return: 135 + ENTRY(hpux_child_return) 130 136 #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) 131 - bl schedule_tail, %r2 132 - nop 137 + bl,n schedule_tail, %r2 133 138 #endif 134 139 135 140 LDREG TASK_PT_GR19-TASK_SZ_ALGN-128(%r30),%r2 136 141 b fork_return 137 142 copy %r0,%r28 143 + ENDPROC(hpux_child_return) 138 144 139 - .export hpux_execve_wrapper 140 - .export hpux_execv_wrapper 141 145 .import hpux_execve 142 146 143 - hpux_execv_wrapper: 147 + ENTRY(hpux_execv_wrapper) 144 148 copy %r0,%r24 /* NULL environment */ 145 149 146 - hpux_execve_wrapper: 150 + ENTRY(hpux_execve_wrapper) 147 151 148 152 ldo TASK_REGS-TASK_SZ_ALGN-64(%r30),%r1 ;! get pt regs 149 153 ··· 181 187 exec_error: 182 188 bv %r0(%r19) 183 189 nop 190 + ENDPROC(hpux_execv_wrapper) 184 191 185 - .export hpux_pipe_wrapper 186 192 .import hpux_pipe 187 193 188 194 /* HP-UX expects pipefd's returned in r28 & r29 */ 189 195 190 - hpux_pipe_wrapper: 196 + ENTRY(hpux_pipe_wrapper) 191 197 STREG %r2,-20(%r30) 192 198 ldo 64(%r30),%r30 193 199 bl hpux_pipe,%r2 ··· 206 212 pipe_exit: 207 213 bv %r0(%r2) 208 214 ldo -64(%r30),%r30 215 + ENDPROC(hpux_pipe_wrapper) 209 216 210 - .export hpux_syscall_exit 211 217 .import syscall_exit 212 218 213 - hpux_syscall_exit: 214 - 219 + ENTRY(hpux_syscall_exit) 215 220 /* 216 221 * 217 222 * HP-UX call return conventions: ··· 239 246 ldo 1(%r0),%r22 240 247 241 248 no_error: 242 - b syscall_exit 243 - nop 249 + b,n syscall_exit 250 + ENDPROC(hpux_syscall_exit) 244 251 245 - .export hpux_unimplemented_wrapper 246 252 .import hpux_unimplemented 247 253 248 - hpux_unimplemented_wrapper: 254 + ENTRY(hpux_unimplemented_wrapper) 249 255 b hpux_unimplemented 250 256 STREG %r22,-64(%r30) /* overwrite arg8 with syscall number */ 257 + ENDPROC(hpux_unimplemented_wrapper)