powerpc/mm/hash64: Map all the kernel regions in the same 0xc range
[linux-2.6-block.git] / arch / powerpc / include / asm / asm-prototypes.h
CommitLineData
42f5b4ca
DA
1#ifndef _ASM_POWERPC_ASM_PROTOTYPES_H
2#define _ASM_POWERPC_ASM_PROTOTYPES_H
3/*
4 * This file is for prototypes of C functions that are only called
5 * from asm, and any associated variables.
6 *
7 * Copyright 2016, Daniel Axtens, IBM Corporation.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 */
14
15#include <linux/threads.h>
9e5f6884
NP
16#include <asm/cacheflush.h>
17#include <asm/checksum.h>
7c0f6ba6 18#include <linux/uaccess.h>
9e5f6884 19#include <asm/epapr_hcalls.h>
43a8888f
BH
20#include <asm/dcr.h>
21#include <asm/mmu_context.h>
42f5b4ca 22
0545d543
DA
23#include <uapi/asm/ucontext.h>
24
42f5b4ca 25/* SMP */
7c19c2e5
CL
26extern struct task_struct *current_set[NR_CPUS];
27extern struct task_struct *secondary_current;
42f5b4ca
DA
28void start_secondary(void *unused);
29
30/* kexec */
31struct paca_struct;
32struct kimage;
33extern struct paca_struct kexec_paca;
34void kexec_copy_flush(struct kimage *image);
35
36/* pseries hcall tracing */
37extern struct static_key hcall_tracepoint_key;
38void __trace_hcall_entry(unsigned long opcode, unsigned long *args);
8f2133cc 39void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf);
42f5b4ca 40
75d9fc7f
NP
41/* OPAL */
42int64_t __opal_call(int64_t a0, int64_t a1, int64_t a2, int64_t a3,
43 int64_t a4, int64_t a5, int64_t a6, int64_t a7,
44 int64_t opcode, uint64_t msr);
42f5b4ca
DA
45
46/* VMX copying */
47int enter_vmx_usercopy(void);
48int exit_vmx_usercopy(void);
d58badfb
SG
49int enter_vmx_ops(void);
50void *exit_vmx_ops(void *dest);
42f5b4ca
DA
51
52/* Traps */
53long machine_check_early(struct pt_regs *regs);
54long hmi_exception_realmode(struct pt_regs *regs);
55void SMIException(struct pt_regs *regs);
56void handle_hmi_exception(struct pt_regs *regs);
57void instruction_breakpoint_exception(struct pt_regs *regs);
58void RunModeException(struct pt_regs *regs);
03465f89
NP
59void single_step_exception(struct pt_regs *regs);
60void program_check_exception(struct pt_regs *regs);
42f5b4ca
DA
61void alignment_exception(struct pt_regs *regs);
62void StackOverflow(struct pt_regs *regs);
42f5b4ca
DA
63void kernel_fp_unavailable_exception(struct pt_regs *regs);
64void altivec_unavailable_exception(struct pt_regs *regs);
65void vsx_unavailable_exception(struct pt_regs *regs);
66void fp_unavailable_tm(struct pt_regs *regs);
67void altivec_unavailable_tm(struct pt_regs *regs);
68void vsx_unavailable_tm(struct pt_regs *regs);
69void facility_unavailable_exception(struct pt_regs *regs);
70void TAUException(struct pt_regs *regs);
71void altivec_assist_exception(struct pt_regs *regs);
72void unrecoverable_exception(struct pt_regs *regs);
73void kernel_bad_stack(struct pt_regs *regs);
74void system_reset_exception(struct pt_regs *regs);
75void machine_check_exception(struct pt_regs *regs);
03465f89 76void emulation_assist_interrupt(struct pt_regs *regs);
48e7b769
NP
77long do_slb_fault(struct pt_regs *regs, unsigned long ea);
78void do_bad_slb_fault(struct pt_regs *regs, unsigned long ea, long err);
42f5b4ca 79
0545d543 80/* signals, syscalls and interrupts */
0545d543
DA
81long sys_swapcontext(struct ucontext __user *old_ctx,
82 struct ucontext __user *new_ctx,
f3675644
AV
83 long ctx_size);
84#ifdef CONFIG_PPC32
85long sys_debug_setcontext(struct ucontext __user *ctx,
86 int ndbg, struct sig_dbg_op __user *dbg);
bf7fb32d
MM
87int
88ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct timeval __user *tvp);
e82d70cf
MM
89unsigned long __init early_init(unsigned long dt_ptr);
90void __init machine_init(u64 dt_ptr);
0545d543 91#endif
e82d70cf 92
bf7fb32d
MM
93long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
94 u32 len_high, u32 len_low);
0545d543
DA
95long sys_switch_endian(void);
96notrace unsigned int __check_irq_replay(void);
97void notrace restore_interrupts(void);
98
99/* ptrace */
100long do_syscall_trace_enter(struct pt_regs *regs);
101void do_syscall_trace_leave(struct pt_regs *regs);
102
103/* process */
104void restore_math(struct pt_regs *regs);
105void restore_tm_state(struct pt_regs *regs);
106
107/* prom_init (OpenFirmware) */
108unsigned long __init prom_init(unsigned long r3, unsigned long r4,
109 unsigned long pp,
110 unsigned long r6, unsigned long r7,
111 unsigned long kbase);
112
113/* setup */
114void __init early_setup(unsigned long dt_ptr);
115void early_setup_secondary(void);
116
117/* time */
118void accumulate_stolen_time(void);
119
9e5f6884
NP
120/* misc runtime */
121extern u64 __bswapdi2(u64);
122extern s64 __lshrdi3(s64, int);
123extern s64 __ashldi3(s64, int);
124extern s64 __ashrdi3(s64, int);
125extern int __cmpdi2(s64, s64);
126extern int __ucmpdi2(u64, u64);
127
b3a7864c 128/* tracing */
99ad5032 129void _mcount(void);
b3a7864c 130unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip);
99ad5032 131
7672691a
PM
132void pnv_power9_force_smt4_catch(void);
133void pnv_power9_force_smt4_release(void);
134
caa3be92 135/* Transaction memory related */
eacbb218
SG
136void tm_enable(void);
137void tm_disable(void);
138void tm_abort(uint8_t cause);
caa3be92
SG
139
140struct kvm_vcpu;
141void _kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu, u64 guest_msr);
142void _kvmppc_save_tm_pr(struct kvm_vcpu *vcpu, u64 guest_msr);
143
ee13cb24
ME
144/* Patch sites */
145extern s32 patch__call_flush_count_cache;
146extern s32 patch__flush_count_cache_return;
fa54a981 147extern s32 patch__memset_nocache, patch__memcpy_nocache;
ee13cb24
ME
148
149extern long flush_count_cache;
150
7854f754
PM
151#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
152void kvmppc_save_tm_hv(struct kvm_vcpu *vcpu, u64 msr, bool preserve_nv);
153void kvmppc_restore_tm_hv(struct kvm_vcpu *vcpu, u64 msr, bool preserve_nv);
154#else
155static inline void kvmppc_save_tm_hv(struct kvm_vcpu *vcpu, u64 msr,
156 bool preserve_nv) { }
157static inline void kvmppc_restore_tm_hv(struct kvm_vcpu *vcpu, u64 msr,
158 bool preserve_nv) { }
159#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
160
41f4e631
PM
161void kvmhv_save_host_pmu(void);
162void kvmhv_load_host_pmu(void);
163void kvmhv_save_guest_pmu(struct kvm_vcpu *vcpu, bool pmu_in_use);
164void kvmhv_load_guest_pmu(struct kvm_vcpu *vcpu);
165
95a6432c
PM
166int __kvmhv_vcpu_entry_p9(struct kvm_vcpu *vcpu);
167
4bad7779
PM
168long kvmppc_h_set_dabr(struct kvm_vcpu *vcpu, unsigned long dabr);
169long kvmppc_h_set_xdabr(struct kvm_vcpu *vcpu, unsigned long dabr,
170 unsigned long dabrx);
171
42f5b4ca 172#endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */