entry.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. /*
  2. * Low-level exception handling code
  3. *
  4. * Copyright (C) 2012 ARM Ltd.
  5. * Authors: Catalin Marinas <catalin.marinas@arm.com>
  6. * Will Deacon <will.deacon@arm.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include <linux/init.h>
  21. #include <linux/linkage.h>
  22. #include <asm/assembler.h>
  23. #include <asm/asm-offsets.h>
  24. #include <asm/errno.h>
  25. #include <asm/thread_info.h>
  26. #include <asm/unistd.h>
  27. #include <asm/unistd32.h>
  28. /*
  29. * Bad Abort numbers
  30. *-----------------
  31. */
  32. #define BAD_SYNC 0
  33. #define BAD_IRQ 1
  34. #define BAD_FIQ 2
  35. #define BAD_ERROR 3
  36. .macro kernel_entry, el, regsize = 64
  37. sub sp, sp, #S_FRAME_SIZE - S_LR // room for LR, SP, SPSR, ELR
  38. .if \regsize == 32
  39. mov w0, w0 // zero upper 32 bits of x0
  40. .endif
  41. push x28, x29
  42. push x26, x27
  43. push x24, x25
  44. push x22, x23
  45. push x20, x21
  46. push x18, x19
  47. push x16, x17
  48. push x14, x15
  49. push x12, x13
  50. push x10, x11
  51. push x8, x9
  52. push x6, x7
  53. push x4, x5
  54. push x2, x3
  55. push x0, x1
  56. .if \el == 0
  57. mrs x21, sp_el0
  58. .else
  59. add x21, sp, #S_FRAME_SIZE
  60. .endif
  61. mrs x22, elr_el1
  62. mrs x23, spsr_el1
  63. stp lr, x21, [sp, #S_LR]
  64. stp x22, x23, [sp, #S_PC]
  65. /*
  66. * Set syscallno to -1 by default (overridden later if real syscall).
  67. */
  68. .if \el == 0
  69. mvn x21, xzr
  70. str x21, [sp, #S_SYSCALLNO]
  71. .endif
  72. /*
  73. * Registers that may be useful after this macro is invoked:
  74. *
  75. * x21 - aborted SP
  76. * x22 - aborted PC
  77. * x23 - aborted PSTATE
  78. */
  79. .endm
  80. .macro kernel_exit, el, ret = 0
  81. ldp x21, x22, [sp, #S_PC] // load ELR, SPSR
  82. .if \el == 0
  83. ldr x23, [sp, #S_SP] // load return stack pointer
  84. .endif
  85. .if \ret
  86. ldr x1, [sp, #S_X1] // preserve x0 (syscall return)
  87. add sp, sp, S_X2
  88. .else
  89. pop x0, x1
  90. .endif
  91. pop x2, x3 // load the rest of the registers
  92. pop x4, x5
  93. pop x6, x7
  94. pop x8, x9
  95. msr elr_el1, x21 // set up the return data
  96. msr spsr_el1, x22
  97. .if \el == 0
  98. msr sp_el0, x23
  99. .endif
  100. pop x10, x11
  101. pop x12, x13
  102. pop x14, x15
  103. pop x16, x17
  104. pop x18, x19
  105. pop x20, x21
  106. pop x22, x23
  107. pop x24, x25
  108. pop x26, x27
  109. pop x28, x29
  110. ldr lr, [sp], #S_FRAME_SIZE - S_LR // load LR and restore SP
  111. eret // return to kernel
  112. .endm
  113. .macro get_thread_info, rd
  114. mov \rd, sp
  115. and \rd, \rd, #~((1 << 13) - 1) // top of 8K stack
  116. .endm
  117. /*
  118. * These are the registers used in the syscall handler, and allow us to
  119. * have in theory up to 7 arguments to a function - x0 to x6.
  120. *
  121. * x7 is reserved for the system call number in 32-bit mode.
  122. */
  123. sc_nr .req x25 // number of system calls
  124. scno .req x26 // syscall number
  125. stbl .req x27 // syscall table pointer
  126. tsk .req x28 // current thread_info
  127. /*
  128. * Interrupt handling.
  129. */
  130. .macro irq_handler
  131. ldr x1, handle_arch_irq
  132. mov x0, sp
  133. blr x1
  134. .endm
  135. .text
  136. /*
  137. * Exception vectors.
  138. */
  139. .align 11
  140. ENTRY(vectors)
  141. ventry el1_sync_invalid // Synchronous EL1t
  142. ventry el1_irq_invalid // IRQ EL1t
  143. ventry el1_fiq_invalid // FIQ EL1t
  144. ventry el1_error_invalid // Error EL1t
  145. ventry el1_sync // Synchronous EL1h
  146. ventry el1_irq // IRQ EL1h
  147. ventry el1_fiq_invalid // FIQ EL1h
  148. ventry el1_error_invalid // Error EL1h
  149. ventry el0_sync // Synchronous 64-bit EL0
  150. ventry el0_irq // IRQ 64-bit EL0
  151. ventry el0_fiq_invalid // FIQ 64-bit EL0
  152. ventry el0_error_invalid // Error 64-bit EL0
  153. #ifdef CONFIG_COMPAT
  154. ventry el0_sync_compat // Synchronous 32-bit EL0
  155. ventry el0_irq_compat // IRQ 32-bit EL0
  156. ventry el0_fiq_invalid_compat // FIQ 32-bit EL0
  157. ventry el0_error_invalid_compat // Error 32-bit EL0
  158. #else
  159. ventry el0_sync_invalid // Synchronous 32-bit EL0
  160. ventry el0_irq_invalid // IRQ 32-bit EL0
  161. ventry el0_fiq_invalid // FIQ 32-bit EL0
  162. ventry el0_error_invalid // Error 32-bit EL0
  163. #endif
  164. END(vectors)
  165. /*
  166. * Invalid mode handlers
  167. */
  168. .macro inv_entry, el, reason, regsize = 64
  169. kernel_entry el, \regsize
  170. mov x0, sp
  171. mov x1, #\reason
  172. mrs x2, esr_el1
  173. b bad_mode
  174. .endm
  175. el0_sync_invalid:
  176. inv_entry 0, BAD_SYNC
  177. ENDPROC(el0_sync_invalid)
  178. el0_irq_invalid:
  179. inv_entry 0, BAD_IRQ
  180. ENDPROC(el0_irq_invalid)
  181. el0_fiq_invalid:
  182. inv_entry 0, BAD_FIQ
  183. ENDPROC(el0_fiq_invalid)
  184. el0_error_invalid:
  185. inv_entry 0, BAD_ERROR
  186. ENDPROC(el0_error_invalid)
  187. #ifdef CONFIG_COMPAT
  188. el0_fiq_invalid_compat:
  189. inv_entry 0, BAD_FIQ, 32
  190. ENDPROC(el0_fiq_invalid_compat)
  191. el0_error_invalid_compat:
  192. inv_entry 0, BAD_ERROR, 32
  193. ENDPROC(el0_error_invalid_compat)
  194. #endif
  195. el1_sync_invalid:
  196. inv_entry 1, BAD_SYNC
  197. ENDPROC(el1_sync_invalid)
  198. el1_irq_invalid:
  199. inv_entry 1, BAD_IRQ
  200. ENDPROC(el1_irq_invalid)
  201. el1_fiq_invalid:
  202. inv_entry 1, BAD_FIQ
  203. ENDPROC(el1_fiq_invalid)
  204. el1_error_invalid:
  205. inv_entry 1, BAD_ERROR
  206. ENDPROC(el1_error_invalid)
  207. /*
  208. * EL1 mode handlers.
  209. */
  210. .align 6
  211. el1_sync:
  212. kernel_entry 1
  213. mrs x1, esr_el1 // read the syndrome register
  214. lsr x24, x1, #26 // exception class
  215. cmp x24, #0x25 // data abort in EL1
  216. b.eq el1_da
  217. cmp x24, #0x18 // configurable trap
  218. b.eq el1_undef
  219. cmp x24, #0x26 // stack alignment exception
  220. b.eq el1_sp_pc
  221. cmp x24, #0x22 // pc alignment exception
  222. b.eq el1_sp_pc
  223. cmp x24, #0x00 // unknown exception in EL1
  224. b.eq el1_undef
  225. cmp x24, #0x30 // debug exception in EL1
  226. b.ge el1_dbg
  227. b el1_inv
  228. el1_da:
  229. /*
  230. * Data abort handling
  231. */
  232. mrs x0, far_el1
  233. enable_dbg_if_not_stepping x2
  234. // re-enable interrupts if they were enabled in the aborted context
  235. tbnz x23, #7, 1f // PSR_I_BIT
  236. enable_irq
  237. 1:
  238. mov x2, sp // struct pt_regs
  239. bl do_mem_abort
  240. // disable interrupts before pulling preserved data off the stack
  241. disable_irq
  242. kernel_exit 1
  243. el1_sp_pc:
  244. /*
  245. * Stack or PC alignment exception handling
  246. */
  247. mrs x0, far_el1
  248. mov x1, x25
  249. mov x2, sp
  250. b do_sp_pc_abort
  251. el1_undef:
  252. /*
  253. * Undefined instruction
  254. */
  255. mov x0, sp
  256. b do_undefinstr
  257. el1_dbg:
  258. /*
  259. * Debug exception handling
  260. */
  261. tbz x24, #0, el1_inv // EL1 only
  262. mrs x0, far_el1
  263. mov x2, sp // struct pt_regs
  264. bl do_debug_exception
  265. kernel_exit 1
  266. el1_inv:
  267. // TODO: add support for undefined instructions in kernel mode
  268. mov x0, sp
  269. mov x1, #BAD_SYNC
  270. mrs x2, esr_el1
  271. b bad_mode
  272. ENDPROC(el1_sync)
  273. .align 6
  274. el1_irq:
  275. kernel_entry 1
  276. enable_dbg_if_not_stepping x0
  277. #ifdef CONFIG_TRACE_IRQFLAGS
  278. bl trace_hardirqs_off
  279. #endif
  280. #ifdef CONFIG_PREEMPT
  281. get_thread_info tsk
  282. ldr x24, [tsk, #TI_PREEMPT] // get preempt count
  283. add x0, x24, #1 // increment it
  284. str x0, [tsk, #TI_PREEMPT]
  285. #endif
  286. irq_handler
  287. #ifdef CONFIG_PREEMPT
  288. str x24, [tsk, #TI_PREEMPT] // restore preempt count
  289. cbnz x24, 1f // preempt count != 0
  290. ldr x0, [tsk, #TI_FLAGS] // get flags
  291. tbz x0, #TIF_NEED_RESCHED, 1f // needs rescheduling?
  292. bl el1_preempt
  293. 1:
  294. #endif
  295. #ifdef CONFIG_TRACE_IRQFLAGS
  296. bl trace_hardirqs_on
  297. #endif
  298. kernel_exit 1
  299. ENDPROC(el1_irq)
  300. #ifdef CONFIG_PREEMPT
  301. el1_preempt:
  302. mov x24, lr
  303. 1: enable_dbg
  304. bl preempt_schedule_irq // irq en/disable is done inside
  305. ldr x0, [tsk, #TI_FLAGS] // get new tasks TI_FLAGS
  306. tbnz x0, #TIF_NEED_RESCHED, 1b // needs rescheduling?
  307. ret x24
  308. #endif
  309. /*
  310. * EL0 mode handlers.
  311. */
  312. .align 6
  313. el0_sync:
  314. kernel_entry 0
  315. mrs x25, esr_el1 // read the syndrome register
  316. lsr x24, x25, #26 // exception class
  317. cmp x24, #0x15 // SVC in 64-bit state
  318. b.eq el0_svc
  319. adr lr, ret_from_exception
  320. cmp x24, #0x24 // data abort in EL0
  321. b.eq el0_da
  322. cmp x24, #0x20 // instruction abort in EL0
  323. b.eq el0_ia
  324. cmp x24, #0x07 // FP/ASIMD access
  325. b.eq el0_fpsimd_acc
  326. cmp x24, #0x2c // FP/ASIMD exception
  327. b.eq el0_fpsimd_exc
  328. cmp x24, #0x18 // configurable trap
  329. b.eq el0_undef
  330. cmp x24, #0x26 // stack alignment exception
  331. b.eq el0_sp_pc
  332. cmp x24, #0x22 // pc alignment exception
  333. b.eq el0_sp_pc
  334. cmp x24, #0x00 // unknown exception in EL0
  335. b.eq el0_undef
  336. cmp x24, #0x30 // debug exception in EL0
  337. b.ge el0_dbg
  338. b el0_inv
  339. #ifdef CONFIG_COMPAT
  340. .align 6
  341. el0_sync_compat:
  342. kernel_entry 0, 32
  343. mrs x25, esr_el1 // read the syndrome register
  344. lsr x24, x25, #26 // exception class
  345. cmp x24, #0x11 // SVC in 32-bit state
  346. b.eq el0_svc_compat
  347. adr lr, ret_from_exception
  348. cmp x24, #0x24 // data abort in EL0
  349. b.eq el0_da
  350. cmp x24, #0x20 // instruction abort in EL0
  351. b.eq el0_ia
  352. cmp x24, #0x07 // FP/ASIMD access
  353. b.eq el0_fpsimd_acc
  354. cmp x24, #0x28 // FP/ASIMD exception
  355. b.eq el0_fpsimd_exc
  356. cmp x24, #0x00 // unknown exception in EL0
  357. b.eq el0_undef
  358. cmp x24, #0x30 // debug exception in EL0
  359. b.ge el0_dbg
  360. b el0_inv
  361. el0_svc_compat:
  362. /*
  363. * AArch32 syscall handling
  364. */
  365. adr stbl, compat_sys_call_table // load compat syscall table pointer
  366. uxtw scno, w7 // syscall number in w7 (r7)
  367. mov sc_nr, #__NR_compat_syscalls
  368. b el0_svc_naked
  369. .align 6
  370. el0_irq_compat:
  371. kernel_entry 0, 32
  372. b el0_irq_naked
  373. #endif
  374. el0_da:
  375. /*
  376. * Data abort handling
  377. */
  378. mrs x0, far_el1
  379. disable_step x1
  380. isb
  381. enable_dbg
  382. // enable interrupts before calling the main handler
  383. enable_irq
  384. mov x1, x25
  385. mov x2, sp
  386. b do_mem_abort
  387. el0_ia:
  388. /*
  389. * Instruction abort handling
  390. */
  391. mrs x0, far_el1
  392. disable_step x1
  393. isb
  394. enable_dbg
  395. // enable interrupts before calling the main handler
  396. enable_irq
  397. orr x1, x25, #1 << 24 // use reserved ISS bit for instruction aborts
  398. mov x2, sp
  399. b do_mem_abort
  400. el0_fpsimd_acc:
  401. /*
  402. * Floating Point or Advanced SIMD access
  403. */
  404. mov x0, x25
  405. mov x1, sp
  406. b do_fpsimd_acc
  407. el0_fpsimd_exc:
  408. /*
  409. * Floating Point or Advanced SIMD exception
  410. */
  411. mov x0, x25
  412. mov x1, sp
  413. b do_fpsimd_exc
  414. el0_sp_pc:
  415. /*
  416. * Stack or PC alignment exception handling
  417. */
  418. mrs x0, far_el1
  419. disable_step x1
  420. isb
  421. enable_dbg
  422. // enable interrupts before calling the main handler
  423. enable_irq
  424. mov x1, x25
  425. mov x2, sp
  426. b do_sp_pc_abort
  427. el0_undef:
  428. /*
  429. * Undefined instruction
  430. */
  431. mov x0, sp
  432. b do_undefinstr
  433. el0_dbg:
  434. /*
  435. * Debug exception handling
  436. */
  437. tbnz x24, #0, el0_inv // EL0 only
  438. mrs x0, far_el1
  439. disable_step x1
  440. mov x1, x25
  441. mov x2, sp
  442. b do_debug_exception
  443. el0_inv:
  444. mov x0, sp
  445. mov x1, #BAD_SYNC
  446. mrs x2, esr_el1
  447. b bad_mode
  448. ENDPROC(el0_sync)
  449. .align 6
  450. el0_irq:
  451. kernel_entry 0
  452. el0_irq_naked:
  453. disable_step x1
  454. isb
  455. enable_dbg
  456. #ifdef CONFIG_TRACE_IRQFLAGS
  457. bl trace_hardirqs_off
  458. #endif
  459. get_thread_info tsk
  460. #ifdef CONFIG_PREEMPT
  461. ldr x24, [tsk, #TI_PREEMPT] // get preempt count
  462. add x23, x24, #1 // increment it
  463. str x23, [tsk, #TI_PREEMPT]
  464. #endif
  465. irq_handler
  466. #ifdef CONFIG_PREEMPT
  467. ldr x0, [tsk, #TI_PREEMPT]
  468. str x24, [tsk, #TI_PREEMPT]
  469. cmp x0, x23
  470. b.eq 1f
  471. mov x1, #0
  472. str x1, [x1] // BUG
  473. 1:
  474. #endif
  475. #ifdef CONFIG_TRACE_IRQFLAGS
  476. bl trace_hardirqs_on
  477. #endif
  478. b ret_to_user
  479. ENDPROC(el0_irq)
  480. /*
  481. * This is the return code to user mode for abort handlers
  482. */
  483. ret_from_exception:
  484. get_thread_info tsk
  485. b ret_to_user
  486. ENDPROC(ret_from_exception)
  487. /*
  488. * Register switch for AArch64. The callee-saved registers need to be saved
  489. * and restored. On entry:
  490. * x0 = previous task_struct (must be preserved across the switch)
  491. * x1 = next task_struct
  492. * Previous and next are guaranteed not to be the same.
  493. *
  494. */
  495. ENTRY(cpu_switch_to)
  496. add x8, x0, #THREAD_CPU_CONTEXT
  497. mov x9, sp
  498. stp x19, x20, [x8], #16 // store callee-saved registers
  499. stp x21, x22, [x8], #16
  500. stp x23, x24, [x8], #16
  501. stp x25, x26, [x8], #16
  502. stp x27, x28, [x8], #16
  503. stp x29, x9, [x8], #16
  504. str lr, [x8]
  505. add x8, x1, #THREAD_CPU_CONTEXT
  506. ldp x19, x20, [x8], #16 // restore callee-saved registers
  507. ldp x21, x22, [x8], #16
  508. ldp x23, x24, [x8], #16
  509. ldp x25, x26, [x8], #16
  510. ldp x27, x28, [x8], #16
  511. ldp x29, x9, [x8], #16
  512. ldr lr, [x8]
  513. mov sp, x9
  514. ret
  515. ENDPROC(cpu_switch_to)
  516. /*
  517. * This is the fast syscall return path. We do as little as possible here,
  518. * and this includes saving x0 back into the kernel stack.
  519. */
  520. ret_fast_syscall:
  521. disable_irq // disable interrupts
  522. ldr x1, [tsk, #TI_FLAGS]
  523. and x2, x1, #_TIF_WORK_MASK
  524. cbnz x2, fast_work_pending
  525. tbz x1, #TIF_SINGLESTEP, fast_exit
  526. disable_dbg
  527. enable_step x2
  528. fast_exit:
  529. kernel_exit 0, ret = 1
  530. /*
  531. * Ok, we need to do extra processing, enter the slow path.
  532. */
  533. fast_work_pending:
  534. str x0, [sp, #S_X0] // returned x0
  535. work_pending:
  536. tbnz x1, #TIF_NEED_RESCHED, work_resched
  537. /* TIF_SIGPENDING or TIF_NOTIFY_RESUME case */
  538. ldr x2, [sp, #S_PSTATE]
  539. mov x0, sp // 'regs'
  540. tst x2, #PSR_MODE_MASK // user mode regs?
  541. b.ne no_work_pending // returning to kernel
  542. enable_irq // enable interrupts for do_notify_resume()
  543. bl do_notify_resume
  544. b ret_to_user
  545. work_resched:
  546. enable_dbg
  547. bl schedule
  548. /*
  549. * "slow" syscall return path.
  550. */
  551. ret_to_user:
  552. disable_irq // disable interrupts
  553. ldr x1, [tsk, #TI_FLAGS]
  554. and x2, x1, #_TIF_WORK_MASK
  555. cbnz x2, work_pending
  556. tbz x1, #TIF_SINGLESTEP, no_work_pending
  557. disable_dbg
  558. enable_step x2
  559. no_work_pending:
  560. kernel_exit 0, ret = 0
  561. ENDPROC(ret_to_user)
  562. /*
  563. * This is how we return from a fork.
  564. */
  565. ENTRY(ret_from_fork)
  566. bl schedule_tail
  567. cbz x19, 1f // not a kernel thread
  568. mov x0, x20
  569. blr x19
  570. 1: get_thread_info tsk
  571. b ret_to_user
  572. ENDPROC(ret_from_fork)
  573. /*
  574. * SVC handler.
  575. */
  576. .align 6
  577. el0_svc:
  578. adrp stbl, sys_call_table // load syscall table pointer
  579. uxtw scno, w8 // syscall number in w8
  580. mov sc_nr, #__NR_syscalls
  581. el0_svc_naked: // compat entry point
  582. stp x0, scno, [sp, #S_ORIG_X0] // save the original x0 and syscall number
  583. disable_step x16
  584. isb
  585. enable_dbg
  586. enable_irq
  587. get_thread_info tsk
  588. ldr x16, [tsk, #TI_FLAGS] // check for syscall tracing
  589. tbnz x16, #TIF_SYSCALL_TRACE, __sys_trace // are we tracing syscalls?
  590. adr lr, ret_fast_syscall // return address
  591. cmp scno, sc_nr // check upper syscall limit
  592. b.hs ni_sys
  593. ldr x16, [stbl, scno, lsl #3] // address in the syscall table
  594. br x16 // call sys_* routine
  595. ni_sys:
  596. mov x0, sp
  597. b do_ni_syscall
  598. ENDPROC(el0_svc)
  599. /*
  600. * This is the really slow path. We're going to be doing context
  601. * switches, and waiting for our parent to respond.
  602. */
  603. __sys_trace:
  604. mov x1, sp
  605. mov w0, #0 // trace entry
  606. bl syscall_trace
  607. adr lr, __sys_trace_return // return address
  608. uxtw scno, w0 // syscall number (possibly new)
  609. mov x1, sp // pointer to regs
  610. cmp scno, sc_nr // check upper syscall limit
  611. b.hs ni_sys
  612. ldp x0, x1, [sp] // restore the syscall args
  613. ldp x2, x3, [sp, #S_X2]
  614. ldp x4, x5, [sp, #S_X4]
  615. ldp x6, x7, [sp, #S_X6]
  616. ldr x16, [stbl, scno, lsl #3] // address in the syscall table
  617. br x16 // call sys_* routine
  618. __sys_trace_return:
  619. str x0, [sp] // save returned x0
  620. mov x1, sp
  621. mov w0, #1 // trace exit
  622. bl syscall_trace
  623. b ret_to_user
  624. /*
  625. * Special system call wrappers.
  626. */
  627. ENTRY(sys_rt_sigreturn_wrapper)
  628. mov x0, sp
  629. b sys_rt_sigreturn
  630. ENDPROC(sys_rt_sigreturn_wrapper)
  631. ENTRY(handle_arch_irq)
  632. .quad 0