Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  linux/arch/arm/kernel/entry-common.S
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Copyright (C) 2000 Russell King
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <asm/assembler.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <asm/unistd.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <asm/ftrace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <asm/unwind.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <asm/memory.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #ifdef CONFIG_AEABI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <asm/unistd-oabi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 	.equ	NR_syscalls, __NR_syscalls
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #ifdef CONFIG_NEED_RET_TO_USER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <mach/entry-macro.S>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 	.macro  arch_ret_to_user, tmp1, tmp2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	.endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include "entry-header.S"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) saved_psr	.req	r8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #if defined(CONFIG_TRACE_IRQFLAGS) || defined(CONFIG_CONTEXT_TRACKING)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) saved_pc	.req	r9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #define TRACE(x...) x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) saved_pc	.req	lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #define TRACE(x...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	.section .entry.text,"ax",%progbits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	.align	5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #if !(IS_ENABLED(CONFIG_TRACE_IRQFLAGS) || IS_ENABLED(CONFIG_CONTEXT_TRACKING) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	IS_ENABLED(CONFIG_DEBUG_RSEQ))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  * This is the fast syscall return path.  We do as little as possible here,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  * such as avoiding writing r0 to the stack.  We only use this path if we
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  * have tracing, context tracking and rseq debug disabled - the overheads
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  * from those features make this path too inefficient.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) ret_fast_syscall:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) __ret_fast_syscall:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  UNWIND(.fnstart	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)  UNWIND(.cantunwind	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	disable_irq_notrace			@ disable interrupts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	ldr	r2, [tsk, #TI_ADDR_LIMIT]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	cmp	r2, #TASK_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	blne	addr_limit_check_failed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	ldr	r1, [tsk, #TI_FLAGS]		@ re-check for syscall tracing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	tst	r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	bne	fast_work_pending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	/* perform architecture specific actions before user return */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	arch_ret_to_user r1, lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	restore_user_regs fast = 1, offset = S_OFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)  UNWIND(.fnend		)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) ENDPROC(ret_fast_syscall)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	/* Ok, we need to do extra processing, enter the slow path. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) fast_work_pending:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	str	r0, [sp, #S_R0+S_OFF]!		@ returned r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	/* fall through to work_pending */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)  * The "replacement" ret_fast_syscall for when tracing, context tracking,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)  * or rseq debug is enabled.  As we will need to call out to some C functions,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75)  * we save r0 first to avoid needing to save registers around each C function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)  * call.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) ret_fast_syscall:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) __ret_fast_syscall:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)  UNWIND(.fnstart	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  UNWIND(.cantunwind	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	str	r0, [sp, #S_R0 + S_OFF]!	@ save returned r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) #if IS_ENABLED(CONFIG_DEBUG_RSEQ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	/* do_rseq_syscall needs interrupts enabled. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	mov	r0, sp				@ 'regs'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	bl	do_rseq_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	disable_irq_notrace			@ disable interrupts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	ldr	r2, [tsk, #TI_ADDR_LIMIT]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	cmp	r2, #TASK_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	blne	addr_limit_check_failed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	ldr	r1, [tsk, #TI_FLAGS]		@ re-check for syscall tracing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	tst	r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	beq	no_work_pending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  UNWIND(.fnend		)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) ENDPROC(ret_fast_syscall)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	/* Slower path - fall through to work_pending */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	tst	r1, #_TIF_SYSCALL_WORK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	bne	__sys_trace_return_nosave
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) slow_work_pending:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	mov	r0, sp				@ 'regs'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	mov	r2, why				@ 'syscall'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	bl	do_work_pending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	cmp	r0, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	beq	no_work_pending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	movlt	scno, #(__NR_restart_syscall - __NR_SYSCALL_BASE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	ldmia	sp, {r0 - r6}			@ have to reload r0 - r6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	b	local_restart			@ ... and off we go
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) ENDPROC(ret_fast_syscall)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)  * "slow" syscall return path.  "why" tells us if this was a real syscall.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)  * IRQs may be enabled here, so always disable them.  Note that we use the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)  * "notrace" version to avoid calling into the tracing code unnecessarily.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)  * do_work_pending() will update this state if necessary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) ENTRY(ret_to_user)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) ret_slow_syscall:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) #if IS_ENABLED(CONFIG_DEBUG_RSEQ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	/* do_rseq_syscall needs interrupts enabled. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	enable_irq_notrace			@ enable interrupts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	mov	r0, sp				@ 'regs'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	bl	do_rseq_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	disable_irq_notrace			@ disable interrupts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) ENTRY(ret_to_user_from_irq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	ldr	r2, [tsk, #TI_ADDR_LIMIT]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	cmp	r2, #TASK_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	blne	addr_limit_check_failed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	ldr	r1, [tsk, #TI_FLAGS]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	tst	r1, #_TIF_WORK_MASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	bne	slow_work_pending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) no_work_pending:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	asm_trace_hardirqs_on save = 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	/* perform architecture specific actions before user return */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	arch_ret_to_user r1, lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	ct_user_enter save = 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	restore_user_regs fast = 0, offset = 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) ENDPROC(ret_to_user_from_irq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) ENDPROC(ret_to_user)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)  * This is how we return from a fork.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) ENTRY(ret_from_fork)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	bl	schedule_tail
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	cmp	r5, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	movne	r0, r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	badrne	lr, 1f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	retne	r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 1:	get_thread_info tsk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	b	ret_slow_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) ENDPROC(ret_from_fork)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) /*=============================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)  * SWI handler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)  *-----------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	.align	5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) #ifdef CONFIG_HARDEN_BRANCH_HISTORY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) ENTRY(vector_bhb_loop8_swi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	sub	sp, sp, #PT_REGS_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	stmia	sp, {r0 - r12}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	mov	r8, #8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 1:	b	2f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 2:	subs	r8, r8, #1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	bne	1b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	dsb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	isb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	b	3f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) ENDPROC(vector_bhb_loop8_swi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	.align	5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) ENTRY(vector_bhb_bpiall_swi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	sub	sp, sp, #PT_REGS_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	stmia	sp, {r0 - r12}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	mcr	p15, 0, r8, c7, c5, 6	@ BPIALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	isb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	b	3f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) ENDPROC(vector_bhb_bpiall_swi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	.align	5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) ENTRY(vector_swi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #ifdef CONFIG_CPU_V7M
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	v7m_exception_entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	sub	sp, sp, #PT_REGS_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	stmia	sp, {r0 - r12}			@ Calling r0 - r12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 3:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)  ARM(	add	r8, sp, #S_PC		)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)  ARM(	stmdb	r8, {sp, lr}^		)	@ Calling sp, lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)  THUMB(	mov	r8, sp			)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)  THUMB(	store_user_sp_lr r8, r10, S_SP	)	@ calling sp, lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	mrs	saved_psr, spsr			@ called from non-FIQ mode, so ok.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)  TRACE(	mov	saved_pc, lr		)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	str	saved_pc, [sp, #S_PC]		@ Save calling PC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	str	saved_psr, [sp, #S_PSR]		@ Save CPSR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	str	r0, [sp, #S_OLD_R0]		@ Save OLD_R0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	zero_fp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	alignment_trap r10, ip, __cr_alignment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	asm_trace_hardirqs_on save=0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	enable_irq_notrace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	ct_user_exit save=0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	 * Get the system call number.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) #if defined(CONFIG_OABI_COMPAT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	 * If we have CONFIG_OABI_COMPAT then we need to look at the swi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	 * value to determine if it is an EABI or an old ABI call.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) #ifdef CONFIG_ARM_THUMB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	tst	saved_psr, #PSR_T_BIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	movne	r10, #0				@ no thumb OABI emulation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)  USER(	ldreq	r10, [saved_pc, #-4]	)	@ get SWI instruction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)  USER(	ldr	r10, [saved_pc, #-4]	)	@ get SWI instruction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)  ARM_BE8(rev	r10, r10)			@ little endian instruction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) #elif defined(CONFIG_AEABI)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	 * Pure EABI user space always put syscall number into scno (r7).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) #elif defined(CONFIG_ARM_THUMB)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	/* Legacy ABI only, possibly thumb mode. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	tst	saved_psr, #PSR_T_BIT		@ this is SPSR from save_user_regs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	addne	scno, r7, #__NR_SYSCALL_BASE	@ put OS number in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)  USER(	ldreq	scno, [saved_pc, #-4]	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	/* Legacy ABI only. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)  USER(	ldr	scno, [saved_pc, #-4]	)	@ get SWI instruction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 	/* saved_psr and saved_pc are now dead */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	uaccess_disable tbl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	adr	tbl, sys_call_table		@ load syscall table pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) #if defined(CONFIG_OABI_COMPAT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	 * If the swi argument is zero, this is an EABI call and we do nothing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	 * If this is an old ABI call, get the syscall number into scno and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	 * get the old ABI syscall table address.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	bics	r10, r10, #0xff000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	eorne	scno, r10, #__NR_OABI_SYSCALL_BASE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	ldrne	tbl, =sys_oabi_call_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) #elif !defined(CONFIG_AEABI)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	bic	scno, scno, #0xff000000		@ mask off SWI op-code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 	eor	scno, scno, #__NR_SYSCALL_BASE	@ check OS number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	get_thread_info tsk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 	 * Reload the registers that may have been corrupted on entry to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	 * the syscall assembly (by tracing or context tracking.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)  TRACE(	ldmia	sp, {r0 - r3}		)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) local_restart:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	ldr	r10, [tsk, #TI_FLAGS]		@ check for syscall tracing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 	stmdb	sp!, {r4, r5}			@ push fifth and sixth args
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	tst	r10, #_TIF_SYSCALL_WORK		@ are we tracing syscalls?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	bne	__sys_trace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 	invoke_syscall tbl, scno, r10, __ret_fast_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 	add	r1, sp, #S_OFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 2:	cmp	scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	eor	r0, scno, #__NR_SYSCALL_BASE	@ put OS number back
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	bcs	arm_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 	mov	why, #0				@ no longer a real syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	b	sys_ni_syscall			@ not private func
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) #if defined(CONFIG_OABI_COMPAT) || !defined(CONFIG_AEABI)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	 * We failed to handle a fault trying to access the page
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 	 * containing the swi instruction, but we're not really in a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	 * position to return -EFAULT. Instead, return back to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 	 * instruction and re-enter the user fault handling path trying
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 	 * to page it in. This will likely result in sending SEGV to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 	 * current task.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 9001:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 	sub	lr, saved_pc, #4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 	str	lr, [sp, #S_PC]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 	get_thread_info tsk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 	b	ret_fast_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) ENDPROC(vector_swi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 	 * This is the really slow path.  We're going to be doing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 	 * context switches, and waiting for our parent to respond.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) __sys_trace:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 	mov	r1, scno
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	add	r0, sp, #S_OFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	bl	syscall_trace_enter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 	mov	scno, r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	invoke_syscall tbl, scno, r10, __sys_trace_return, reload=1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 	cmp	scno, #-1			@ skip the syscall?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	bne	2b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 	add	sp, sp, #S_OFF			@ restore stack
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) __sys_trace_return_nosave:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 	enable_irq_notrace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 	mov	r0, sp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 	bl	syscall_trace_exit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	b	ret_slow_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) __sys_trace_return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 	str	r0, [sp, #S_R0 + S_OFF]!	@ save returned r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 	mov	r0, sp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 	bl	syscall_trace_exit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 	b	ret_slow_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 	.align	5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) #ifdef CONFIG_ALIGNMENT_TRAP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 	.type	__cr_alignment, #object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) __cr_alignment:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 	.word	cr_alignment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 	.ltorg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 	.macro	syscall_table_start, sym
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 	.equ	__sys_nr, 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 	.type	\sym, #object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) ENTRY(\sym)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 	.endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 	.macro	syscall, nr, func
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 	.ifgt	__sys_nr - \nr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 	.error	"Duplicated/unorded system call entry"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 	.endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 	.rept	\nr - __sys_nr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 	.long	sys_ni_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 	.endr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 	.long	\func
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 	.equ	__sys_nr, \nr + 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 	.endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 	.macro	syscall_table_end, sym
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 	.ifgt	__sys_nr - __NR_syscalls
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 	.error	"System call table too big"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 	.endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 	.rept	__NR_syscalls - __sys_nr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 	.long	sys_ni_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 	.endr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 	.size	\sym, . - \sym
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 	.endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) #define NATIVE(nr, func) syscall nr, func
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)  * This is the syscall table declaration for native ABI syscalls.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372)  * With EABI a couple syscalls are obsolete and defined as sys_ni_syscall.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 	syscall_table_start sys_call_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) #define COMPAT(nr, native, compat) syscall nr, native
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) #ifdef CONFIG_AEABI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) #include <calls-eabi.S>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) #include <calls-oabi.S>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) #undef COMPAT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 	syscall_table_end sys_call_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) /*============================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385)  * Special system call wrappers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) @ r0 = syscall number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) @ r8 = syscall table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) sys_syscall:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 		bic	scno, r0, #__NR_OABI_SYSCALL_BASE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 		cmp	scno, #__NR_syscall - __NR_SYSCALL_BASE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 		cmpne	scno, #NR_syscalls	@ check range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) #ifdef CONFIG_CPU_SPECTRE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 		movhs	scno, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 		csdb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 		stmialo	sp, {r5, r6}		@ shuffle args
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 		movlo	r0, r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 		movlo	r1, r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 		movlo	r2, r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 		movlo	r3, r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 		ldrlo	pc, [tbl, scno, lsl #2]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 		b	sys_ni_syscall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) ENDPROC(sys_syscall)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) sys_sigreturn_wrapper:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 		add	r0, sp, #S_OFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 		mov	why, #0		@ prevent syscall restart handling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 		b	sys_sigreturn
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) ENDPROC(sys_sigreturn_wrapper)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) sys_rt_sigreturn_wrapper:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 		add	r0, sp, #S_OFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 		mov	why, #0		@ prevent syscall restart handling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 		b	sys_rt_sigreturn
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) ENDPROC(sys_rt_sigreturn_wrapper)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) sys_statfs64_wrapper:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 		teq	r1, #88
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 		moveq	r1, #84
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 		b	sys_statfs64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) ENDPROC(sys_statfs64_wrapper)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) sys_fstatfs64_wrapper:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 		teq	r1, #88
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 		moveq	r1, #84
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 		b	sys_fstatfs64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) ENDPROC(sys_fstatfs64_wrapper)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431)  * Note: off_4k (r5) is always units of 4K.  If we can't do the requested
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432)  * offset, we return EINVAL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) sys_mmap2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 		str	r5, [sp, #4]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 		b	sys_mmap_pgoff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) ENDPROC(sys_mmap2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) #ifdef CONFIG_OABI_COMPAT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442)  * These are syscalls with argument register differences
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) sys_oabi_pread64:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 		stmia	sp, {r3, r4}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 		b	sys_pread64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) ENDPROC(sys_oabi_pread64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) sys_oabi_pwrite64:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 		stmia	sp, {r3, r4}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 		b	sys_pwrite64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) ENDPROC(sys_oabi_pwrite64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) sys_oabi_truncate64:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 		mov	r3, r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 		mov	r2, r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 		b	sys_truncate64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) ENDPROC(sys_oabi_truncate64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) sys_oabi_ftruncate64:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 		mov	r3, r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 		mov	r2, r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 		b	sys_ftruncate64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) ENDPROC(sys_oabi_ftruncate64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) sys_oabi_readahead:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 		str	r3, [sp]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 		mov	r3, r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 		mov	r2, r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 		b	sys_readahead
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) ENDPROC(sys_oabi_readahead)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475)  * Let's declare a second syscall table for old ABI binaries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476)  * using the compatibility syscall entries.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 	syscall_table_start sys_oabi_call_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) #define COMPAT(nr, native, compat) syscall nr, compat
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) #include <calls-oabi.S>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) 	syscall_table_end sys_oabi_call_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484)