Commit | Line | Data |
---|---|---|
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 DA |
25 | /* SMP */ |
26 | extern struct thread_info *current_set[NR_CPUS]; | |
27 | extern struct thread_info *secondary_ti; | |
28 | void start_secondary(void *unused); | |
29 | ||
30 | /* kexec */ | |
31 | struct paca_struct; | |
32 | struct kimage; | |
33 | extern struct paca_struct kexec_paca; | |
34 | void kexec_copy_flush(struct kimage *image); | |
35 | ||
36 | /* pseries hcall tracing */ | |
37 | extern struct static_key hcall_tracepoint_key; | |
38 | void __trace_hcall_entry(unsigned long opcode, unsigned long *args); | |
8f2133cc | 39 | void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf); |
42f5b4ca DA |
40 | /* OPAL tracing */ |
41 | #ifdef HAVE_JUMP_LABEL | |
42 | extern struct static_key opal_tracepoint_key; | |
43 | #endif | |
44 | ||
45 | void __trace_opal_entry(unsigned long opcode, unsigned long *args); | |
46 | void __trace_opal_exit(long opcode, unsigned long retval); | |
47 | ||
48 | /* VMX copying */ | |
49 | int enter_vmx_usercopy(void); | |
50 | int exit_vmx_usercopy(void); | |
d58badfb SG |
51 | int enter_vmx_ops(void); |
52 | void *exit_vmx_ops(void *dest); | |
42f5b4ca DA |
53 | |
54 | /* Traps */ | |
55 | long machine_check_early(struct pt_regs *regs); | |
56 | long hmi_exception_realmode(struct pt_regs *regs); | |
57 | void SMIException(struct pt_regs *regs); | |
58 | void handle_hmi_exception(struct pt_regs *regs); | |
59 | void instruction_breakpoint_exception(struct pt_regs *regs); | |
60 | void RunModeException(struct pt_regs *regs); | |
03465f89 NP |
61 | void single_step_exception(struct pt_regs *regs); |
62 | void program_check_exception(struct pt_regs *regs); | |
42f5b4ca DA |
63 | void alignment_exception(struct pt_regs *regs); |
64 | void StackOverflow(struct pt_regs *regs); | |
42f5b4ca DA |
65 | void kernel_fp_unavailable_exception(struct pt_regs *regs); |
66 | void altivec_unavailable_exception(struct pt_regs *regs); | |
67 | void vsx_unavailable_exception(struct pt_regs *regs); | |
68 | void fp_unavailable_tm(struct pt_regs *regs); | |
69 | void altivec_unavailable_tm(struct pt_regs *regs); | |
70 | void vsx_unavailable_tm(struct pt_regs *regs); | |
71 | void facility_unavailable_exception(struct pt_regs *regs); | |
72 | void TAUException(struct pt_regs *regs); | |
73 | void altivec_assist_exception(struct pt_regs *regs); | |
74 | void unrecoverable_exception(struct pt_regs *regs); | |
75 | void kernel_bad_stack(struct pt_regs *regs); | |
76 | void system_reset_exception(struct pt_regs *regs); | |
77 | void machine_check_exception(struct pt_regs *regs); | |
03465f89 | 78 | void emulation_assist_interrupt(struct pt_regs *regs); |
48e7b769 NP |
79 | long do_slb_fault(struct pt_regs *regs, unsigned long ea); |
80 | void do_bad_slb_fault(struct pt_regs *regs, unsigned long ea, long err); | |
42f5b4ca | 81 | |
0545d543 | 82 | /* signals, syscalls and interrupts */ |
0545d543 DA |
83 | long sys_swapcontext(struct ucontext __user *old_ctx, |
84 | struct ucontext __user *new_ctx, | |
f3675644 AV |
85 | long ctx_size); |
86 | #ifdef CONFIG_PPC32 | |
87 | long sys_debug_setcontext(struct ucontext __user *ctx, | |
88 | int ndbg, struct sig_dbg_op __user *dbg); | |
bf7fb32d MM |
89 | int |
90 | ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct timeval __user *tvp); | |
e82d70cf MM |
91 | unsigned long __init early_init(unsigned long dt_ptr); |
92 | void __init machine_init(u64 dt_ptr); | |
0545d543 | 93 | #endif |
e82d70cf | 94 | |
bf7fb32d MM |
95 | long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, |
96 | u32 len_high, u32 len_low); | |
0545d543 DA |
97 | long sys_switch_endian(void); |
98 | notrace unsigned int __check_irq_replay(void); | |
99 | void notrace restore_interrupts(void); | |
100 | ||
101 | /* ptrace */ | |
102 | long do_syscall_trace_enter(struct pt_regs *regs); | |
103 | void do_syscall_trace_leave(struct pt_regs *regs); | |
104 | ||
105 | /* process */ | |
106 | void restore_math(struct pt_regs *regs); | |
107 | void restore_tm_state(struct pt_regs *regs); | |
108 | ||
109 | /* prom_init (OpenFirmware) */ | |
110 | unsigned long __init prom_init(unsigned long r3, unsigned long r4, | |
111 | unsigned long pp, | |
112 | unsigned long r6, unsigned long r7, | |
113 | unsigned long kbase); | |
114 | ||
115 | /* setup */ | |
116 | void __init early_setup(unsigned long dt_ptr); | |
117 | void early_setup_secondary(void); | |
118 | ||
119 | /* time */ | |
120 | void accumulate_stolen_time(void); | |
121 | ||
9e5f6884 NP |
122 | /* misc runtime */ |
123 | extern u64 __bswapdi2(u64); | |
124 | extern s64 __lshrdi3(s64, int); | |
125 | extern s64 __ashldi3(s64, int); | |
126 | extern s64 __ashrdi3(s64, int); | |
127 | extern int __cmpdi2(s64, s64); | |
128 | extern int __ucmpdi2(u64, u64); | |
129 | ||
b3a7864c | 130 | /* tracing */ |
99ad5032 | 131 | void _mcount(void); |
b3a7864c | 132 | unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip); |
99ad5032 | 133 | |
7672691a PM |
134 | void pnv_power9_force_smt4_catch(void); |
135 | void pnv_power9_force_smt4_release(void); | |
136 | ||
caa3be92 | 137 | /* Transaction memory related */ |
eacbb218 SG |
138 | void tm_enable(void); |
139 | void tm_disable(void); | |
140 | void tm_abort(uint8_t cause); | |
caa3be92 SG |
141 | |
142 | struct kvm_vcpu; | |
143 | void _kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu, u64 guest_msr); | |
144 | void _kvmppc_save_tm_pr(struct kvm_vcpu *vcpu, u64 guest_msr); | |
145 | ||
ee13cb24 ME |
146 | /* Patch sites */ |
147 | extern s32 patch__call_flush_count_cache; | |
148 | extern s32 patch__flush_count_cache_return; | |
fa54a981 | 149 | extern s32 patch__memset_nocache, patch__memcpy_nocache; |
ee13cb24 ME |
150 | |
151 | extern long flush_count_cache; | |
152 | ||
7854f754 PM |
153 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM |
154 | void kvmppc_save_tm_hv(struct kvm_vcpu *vcpu, u64 msr, bool preserve_nv); | |
155 | void kvmppc_restore_tm_hv(struct kvm_vcpu *vcpu, u64 msr, bool preserve_nv); | |
156 | #else | |
157 | static inline void kvmppc_save_tm_hv(struct kvm_vcpu *vcpu, u64 msr, | |
158 | bool preserve_nv) { } | |
159 | static inline void kvmppc_restore_tm_hv(struct kvm_vcpu *vcpu, u64 msr, | |
160 | bool preserve_nv) { } | |
161 | #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ | |
162 | ||
41f4e631 PM |
163 | void kvmhv_save_host_pmu(void); |
164 | void kvmhv_load_host_pmu(void); | |
165 | void kvmhv_save_guest_pmu(struct kvm_vcpu *vcpu, bool pmu_in_use); | |
166 | void kvmhv_load_guest_pmu(struct kvm_vcpu *vcpu); | |
167 | ||
95a6432c PM |
168 | int __kvmhv_vcpu_entry_p9(struct kvm_vcpu *vcpu); |
169 | ||
4bad7779 PM |
170 | long kvmppc_h_set_dabr(struct kvm_vcpu *vcpu, unsigned long dabr); |
171 | long kvmppc_h_set_xdabr(struct kvm_vcpu *vcpu, unsigned long dabr, | |
172 | unsigned long dabrx); | |
173 | ||
42f5b4ca | 174 | #endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */ |