1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2012 Freescale Semiconductor, Inc.
6 #include <linux/export.h>
7 #include <linux/threads.h>
8 #include <asm/epapr_hcalls.h>
11 #include <asm/cputable.h>
12 #include <asm/thread_info.h>
13 #include <asm/ppc_asm.h>
14 #include <asm/asm-compat.h>
15 #include <asm/asm-offsets.h>
18 /* epapr_ev_idle() was derived from e500_idle() */
19 _GLOBAL(epapr_ev_idle)
20 PPC_LL r4, TI_LOCAL_FLAGS(r2) /* set napping bit */
21 ori r4, r4,_TLF_NAPPING /* so when we take an exception */
22 PPC_STL r4, TI_LOCAL_FLAGS(r2) /* it will return to our caller */
24 #ifdef CONFIG_BOOKE_OR_40x
33 LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
35 .global epapr_ev_idle_start
43 * Guard against spurious wakeups from a hypervisor --
44 * only interrupt will cause us to return to LR due to
50 /* Hypercall entry point. Will be patched with device tree instructions. */
51 .global epapr_hypercall_start
52 epapr_hypercall_start:
58 EXPORT_SYMBOL(epapr_hypercall_start)