Merge tag 'kbuild-v4.21-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-2.6-block.git] / arch / powerpc / kernel / epapr_hcalls.S
CommitLineData
2e1ae9c0
LYB
1/*
2 * Copyright (C) 2012 Freescale Semiconductor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include <linux/threads.h>
2f979de8 11#include <asm/epapr_hcalls.h>
2e1ae9c0
LYB
12#include <asm/reg.h>
13#include <asm/page.h>
14#include <asm/cputable.h>
15#include <asm/thread_info.h>
16#include <asm/ppc_asm.h>
2f979de8 17#include <asm/asm-compat.h>
2e1ae9c0 18#include <asm/asm-offsets.h>
9445aa1a 19#include <asm/export.h>
2e1ae9c0 20
f070986a 21#ifndef CONFIG_PPC64
2f979de8
LYB
22/* epapr_ev_idle() was derived from e500_idle() */
23_GLOBAL(epapr_ev_idle)
24 CURRENT_THREAD_INFO(r3, r1)
25 PPC_LL r4, TI_LOCAL_FLAGS(r3) /* set napping bit */
26 ori r4, r4,_TLF_NAPPING /* so when we take an exception */
27 PPC_STL r4, TI_LOCAL_FLAGS(r3) /* it will return to our caller */
28
29 wrteei 1
30
31idle_loop:
32 LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
33
34.global epapr_ev_idle_start
35epapr_ev_idle_start:
36 li r3, -1
37 nop
38 nop
39 nop
40
41 /*
42 * Guard against spurious wakeups from a hypervisor --
43 * only interrupt will cause us to return to LR due to
44 * _TLF_NAPPING.
45 */
46 b idle_loop
f070986a 47#endif
2f979de8 48
2e1ae9c0
LYB
49/* Hypercall entry point. Will be patched with device tree instructions. */
50.global epapr_hypercall_start
51epapr_hypercall_start:
52 li r3, -1
53 nop
54 nop
55 nop
56 blr
9445aa1a 57EXPORT_SYMBOL(epapr_hypercall_start)