forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/alpha/kernel/entry.S
....@@ -473,7 +473,7 @@
473473 bne $3, strace
474474 beq $4, 1f
475475 ldq $27, 0($5)
476
-1: jsr $26, ($27), alpha_ni_syscall
476
+1: jsr $26, ($27), sys_ni_syscall
477477 ldgp $gp, 0($26)
478478 blt $0, $syscall_error /* the call failed */
479479 stq $0, 0($sp)
....@@ -544,7 +544,7 @@
544544 .align 4
545545 .type work_pending, @function
546546 work_pending:
547
- and $17, _TIF_NOTIFY_RESUME | _TIF_SIGPENDING, $2
547
+ and $17, _TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL, $2
548548 bne $2, $work_notifysig
549549
550550 $work_resched:
....@@ -587,7 +587,7 @@
587587 /* get the system call pointer.. */
588588 lda $1, NR_SYSCALLS($31)
589589 lda $2, sys_call_table
590
- lda $27, alpha_ni_syscall
590
+ lda $27, sys_ni_syscall
591591 cmpult $0, $1, $1
592592 s8addq $0, $2, $2
593593 beq $1, 1f
....@@ -791,7 +791,7 @@
791791
792792 /*
793793 * Special system calls. Most of these are special in that they either
794
- * have to play switch_stack games or in some way use the pt_regs struct.
794
+ * have to play switch_stack games.
795795 */
796796
797797 .macro fork_like name
....@@ -812,46 +812,41 @@
812812 fork_like vfork
813813 fork_like clone
814814
815
+.macro sigreturn_like name
815816 .align 4
816
- .globl sys_sigreturn
817
- .ent sys_sigreturn
818
-sys_sigreturn:
817
+ .globl sys_\name
818
+ .ent sys_\name
819
+sys_\name:
819820 .prologue 0
820821 lda $9, ret_from_straced
821822 cmpult $26, $9, $9
822823 lda $sp, -SWITCH_STACK_SIZE($sp)
823
- jsr $26, do_sigreturn
824
+ jsr $26, do_\name
824825 bne $9, 1f
825826 jsr $26, syscall_trace_leave
826827 1: br $1, undo_switch_stack
827828 br ret_from_sys_call
828
-.end sys_sigreturn
829
+.end sys_\name
830
+.endm
831
+
832
+sigreturn_like sigreturn
833
+sigreturn_like rt_sigreturn
829834
830835 .align 4
831
- .globl sys_rt_sigreturn
832
- .ent sys_rt_sigreturn
833
-sys_rt_sigreturn:
836
+ .globl alpha_syscall_zero
837
+ .ent alpha_syscall_zero
838
+alpha_syscall_zero:
834839 .prologue 0
835
- lda $9, ret_from_straced
836
- cmpult $26, $9, $9
837
- lda $sp, -SWITCH_STACK_SIZE($sp)
838
- jsr $26, do_rt_sigreturn
839
- bne $9, 1f
840
- jsr $26, syscall_trace_leave
841
-1: br $1, undo_switch_stack
842
- br ret_from_sys_call
843
-.end sys_rt_sigreturn
844
-
845
- .align 4
846
- .globl alpha_ni_syscall
847
- .ent alpha_ni_syscall
848
-alpha_ni_syscall:
849
- .prologue 0
850
- /* Special because it also implements overflow handling via
851
- syscall number 0. And if you recall, zero is a special
852
- trigger for "not an error". Store large non-zero there. */
840
+ /* Special because it needs to do something opposite to
841
+ force_successful_syscall_return(). We use the saved
842
+ syscall number for that, zero meaning "not an error".
843
+ That works nicely, but for real syscall 0 we need to
844
+ make sure that this logics doesn't get confused.
845
+ Store a non-zero there - -ENOSYS we need in register
846
+ for our return value will do just fine.
847
+ */
853848 lda $0, -ENOSYS
854849 unop
855850 stq $0, 0($sp)
856851 ret
857
-.end alpha_ni_syscall
852
+.end alpha_syscall_zero