/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2* Copyright (C) 2012 Freescale Semiconductor, Inc.3*/45#include <linux/export.h>6#include <linux/threads.h>7#include <asm/epapr_hcalls.h>8#include <asm/reg.h>9#include <asm/page.h>10#include <asm/cputable.h>11#include <asm/thread_info.h>12#include <asm/ppc_asm.h>13#include <asm/asm-compat.h>14#include <asm/asm-offsets.h>1516#ifndef CONFIG_PPC6417/* epapr_ev_idle() was derived from e500_idle() */18_GLOBAL(epapr_ev_idle)19PPC_LL r4, TI_LOCAL_FLAGS(r2) /* set napping bit */20ori r4, r4,_TLF_NAPPING /* so when we take an exception */21PPC_STL r4, TI_LOCAL_FLAGS(r2) /* it will return to our caller */2223#ifdef CONFIG_BOOKE24wrteei 125#else26mfmsr r427ori r4, r4, MSR_EE28mtmsr r429#endif3031idle_loop:32LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))3334.global epapr_ev_idle_start35epapr_ev_idle_start:36li r3, -137nop38nop39nop4041/*42* Guard against spurious wakeups from a hypervisor --43* only interrupt will cause us to return to LR due to44* _TLF_NAPPING.45*/46b idle_loop47#endif4849/* Hypercall entry point. Will be patched with device tree instructions. */50.global epapr_hypercall_start51epapr_hypercall_start:52li r3, -153nop54nop55nop56blr57EXPORT_SYMBOL(epapr_hypercall_start)585960