Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright (C) 2012 Freescale Semiconductor, Inc.
0004  */
0005 
0006 #include <linux/threads.h>
0007 #include <asm/epapr_hcalls.h>
0008 #include <asm/reg.h>
0009 #include <asm/page.h>
0010 #include <asm/cputable.h>
0011 #include <asm/thread_info.h>
0012 #include <asm/ppc_asm.h>
0013 #include <asm/asm-compat.h>
0014 #include <asm/asm-offsets.h>
0015 #include <asm/export.h>
0016 
0017 #ifndef CONFIG_PPC64
0018 /* epapr_ev_idle() was derived from e500_idle() */
0019 _GLOBAL(epapr_ev_idle)
0020     PPC_LL  r4, TI_LOCAL_FLAGS(r2)  /* set napping bit */
0021     ori r4, r4,_TLF_NAPPING /* so when we take an exception */
0022     PPC_STL r4, TI_LOCAL_FLAGS(r2)  /* it will return to our caller */
0023 
0024     wrteei  1
0025 
0026 idle_loop:
0027     LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
0028 
0029 .global epapr_ev_idle_start
0030 epapr_ev_idle_start:
0031     li  r3, -1
0032     nop
0033     nop
0034     nop
0035 
0036     /*
0037      * Guard against spurious wakeups from a hypervisor --
0038      * only interrupt will cause us to return to LR due to
0039      * _TLF_NAPPING.
0040      */
0041     b   idle_loop
0042 #endif
0043 
0044 /* Hypercall entry point. Will be patched with device tree instructions. */
0045 .global epapr_hypercall_start
0046 epapr_hypercall_start:
0047     li  r3, -1
0048     nop
0049     nop
0050     nop
0051     blr
0052 EXPORT_SYMBOL(epapr_hypercall_start)