xref: /linux/arch/powerpc/include/asm/asm-prototypes.h (revision ab520be8cd5d56867fc95cfbc34b90880faf1f9d)
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>
16 #include <asm/cacheflush.h>
17 #include <asm/checksum.h>
18 #include <linux/uaccess.h>
19 #include <asm/epapr_hcalls.h>
20 
21 #include <uapi/asm/ucontext.h>
22 
23 /* SMP */
24 extern struct thread_info *current_set[NR_CPUS];
25 extern struct thread_info *secondary_ti;
26 void start_secondary(void *unused);
27 
28 /* kexec */
29 struct paca_struct;
30 struct kimage;
31 extern struct paca_struct kexec_paca;
32 void kexec_copy_flush(struct kimage *image);
33 
34 /* pseries hcall tracing */
35 extern struct static_key hcall_tracepoint_key;
36 void __trace_hcall_entry(unsigned long opcode, unsigned long *args);
37 void __trace_hcall_exit(long opcode, unsigned long retval,
38 			unsigned long *retbuf);
39 /* OPAL tracing */
40 #ifdef HAVE_JUMP_LABEL
41 extern struct static_key opal_tracepoint_key;
42 #endif
43 
44 void __trace_opal_entry(unsigned long opcode, unsigned long *args);
45 void __trace_opal_exit(long opcode, unsigned long retval);
46 
47 /* VMX copying */
48 int enter_vmx_usercopy(void);
49 int exit_vmx_usercopy(void);
50 int enter_vmx_copy(void);
51 void * exit_vmx_copy(void *dest);
52 
53 /* Traps */
54 long machine_check_early(struct pt_regs *regs);
55 long hmi_exception_realmode(struct pt_regs *regs);
56 void SMIException(struct pt_regs *regs);
57 void handle_hmi_exception(struct pt_regs *regs);
58 void instruction_breakpoint_exception(struct pt_regs *regs);
59 void RunModeException(struct pt_regs *regs);
60 void single_step_exception(struct pt_regs *regs);
61 void program_check_exception(struct pt_regs *regs);
62 void alignment_exception(struct pt_regs *regs);
63 void StackOverflow(struct pt_regs *regs);
64 void nonrecoverable_exception(struct pt_regs *regs);
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);
78 void emulation_assist_interrupt(struct pt_regs *regs);
79 
80 /* signals, syscalls and interrupts */
81 #ifdef CONFIG_PPC64
82 int sys_swapcontext(struct ucontext __user *old_ctx,
83 		    struct ucontext __user *new_ctx,
84 		    long ctx_size, long r6, long r7, long r8, struct pt_regs *regs);
85 #else
86 long sys_swapcontext(struct ucontext __user *old_ctx,
87 		    struct ucontext __user *new_ctx,
88 		    int ctx_size, int r6, int r7, int r8, struct pt_regs *regs);
89 #endif
90 long sys_switch_endian(void);
91 notrace unsigned int __check_irq_replay(void);
92 void notrace restore_interrupts(void);
93 
94 /* ptrace */
95 long do_syscall_trace_enter(struct pt_regs *regs);
96 void do_syscall_trace_leave(struct pt_regs *regs);
97 
98 /* process */
99 void restore_math(struct pt_regs *regs);
100 void restore_tm_state(struct pt_regs *regs);
101 
102 /* prom_init (OpenFirmware) */
103 unsigned long __init prom_init(unsigned long r3, unsigned long r4,
104 			       unsigned long pp,
105 			       unsigned long r6, unsigned long r7,
106 			       unsigned long kbase);
107 
108 /* setup */
109 void __init early_setup(unsigned long dt_ptr);
110 void early_setup_secondary(void);
111 
112 /* time */
113 void accumulate_stolen_time(void);
114 
115 /* misc runtime */
116 extern u64 __bswapdi2(u64);
117 extern s64 __lshrdi3(s64, int);
118 extern s64 __ashldi3(s64, int);
119 extern s64 __ashrdi3(s64, int);
120 extern int __cmpdi2(s64, s64);
121 extern int __ucmpdi2(u64, u64);
122 
123 #endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */
124