1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /* TOC (Transfer of Control) handler. */
7 #include <asm/assembly.h>
8 #include <linux/threads.h>
9 #include <linux/linkage.h>
13 .import toc_stack,data
15 ENTRY_CFI(toc_handler)
16 load32 PA(toc_stack),%sp
19 /* get per-cpu toc_stack address. */
21 tophys %r1,%r2 /* task_struct */
22 LDREG TASK_TI_CPU(%r2),%r4 /* cpu */
23 load32 PA(__per_cpu_offset),%r1
29 * setup pt_regs on stack and save the
30 * floating point registers. PIM_TOC doesn't
31 * save fp registers, so we're doing it here.
34 ldo PT_SZ_ALGN(%sp), %sp
38 0: cmpb,<<,n %r1,%sp,0b
41 ldo PT_FR0(%arg0),%r25
45 load32 PA(swapper_pg_dir),%r4
67 ENDPROC_CFI(toc_handler)
70 * keep this checksum here, as it is part of the toc_handler
71 * spanned by toc_handler_size (all words in toc_handler are
72 * added in PDC and the sum must equal to zero.
74 SYM_DATA(toc_handler_csum, .long 0)
75 SYM_DATA(toc_handler_size, .long . - toc_handler)