linux/arch/powerpc/include/asm/asm-prototypes.h
<<
>>
Prefs
   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#include <asm/dcr.h>
  21#include <asm/mmu_context.h>
  22
  23#include <uapi/asm/ucontext.h>
  24
  25/* SMP */
  26extern struct thread_info *current_set[NR_CPUS];
  27extern struct thread_info *secondary_ti;
  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);
  39void __trace_hcall_exit(long opcode, unsigned long retval,
  40                        unsigned long *retbuf);
  41/* OPAL tracing */
  42#ifdef HAVE_JUMP_LABEL
  43extern struct static_key opal_tracepoint_key;
  44#endif
  45
  46void __trace_opal_entry(unsigned long opcode, unsigned long *args);
  47void __trace_opal_exit(long opcode, unsigned long retval);
  48
  49/* VMX copying */
  50int enter_vmx_usercopy(void);
  51int exit_vmx_usercopy(void);
  52int enter_vmx_copy(void);
  53void * exit_vmx_copy(void *dest);
  54
  55/* Traps */
  56long machine_check_early(struct pt_regs *regs);
  57long hmi_exception_realmode(struct pt_regs *regs);
  58void SMIException(struct pt_regs *regs);
  59void handle_hmi_exception(struct pt_regs *regs);
  60void instruction_breakpoint_exception(struct pt_regs *regs);
  61void RunModeException(struct pt_regs *regs);
  62void single_step_exception(struct pt_regs *regs);
  63void program_check_exception(struct pt_regs *regs);
  64void alignment_exception(struct pt_regs *regs);
  65void slb_miss_bad_addr(struct pt_regs *regs);
  66void StackOverflow(struct pt_regs *regs);
  67void nonrecoverable_exception(struct pt_regs *regs);
  68void kernel_fp_unavailable_exception(struct pt_regs *regs);
  69void altivec_unavailable_exception(struct pt_regs *regs);
  70void vsx_unavailable_exception(struct pt_regs *regs);
  71void fp_unavailable_tm(struct pt_regs *regs);
  72void altivec_unavailable_tm(struct pt_regs *regs);
  73void vsx_unavailable_tm(struct pt_regs *regs);
  74void facility_unavailable_exception(struct pt_regs *regs);
  75void TAUException(struct pt_regs *regs);
  76void altivec_assist_exception(struct pt_regs *regs);
  77void unrecoverable_exception(struct pt_regs *regs);
  78void kernel_bad_stack(struct pt_regs *regs);
  79void system_reset_exception(struct pt_regs *regs);
  80void machine_check_exception(struct pt_regs *regs);
  81void emulation_assist_interrupt(struct pt_regs *regs);
  82
  83/* signals, syscalls and interrupts */
  84#ifdef CONFIG_PPC64
  85int sys_swapcontext(struct ucontext __user *old_ctx,
  86                    struct ucontext __user *new_ctx,
  87                    long ctx_size, long r6, long r7, long r8, struct pt_regs *regs);
  88#else
  89long sys_swapcontext(struct ucontext __user *old_ctx,
  90                    struct ucontext __user *new_ctx,
  91                    int ctx_size, int r6, int r7, int r8, struct pt_regs *regs);
  92int sys_debug_setcontext(struct ucontext __user *ctx,
  93                         int ndbg, struct sig_dbg_op __user *dbg,
  94                         int r6, int r7, int r8,
  95                         struct pt_regs *regs);
  96int
  97ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct timeval __user *tvp);
  98unsigned long __init early_init(unsigned long dt_ptr);
  99void __init machine_init(u64 dt_ptr);
 100#endif
 101
 102long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
 103                      u32 len_high, u32 len_low);
 104long sys_switch_endian(void);
 105notrace unsigned int __check_irq_replay(void);
 106void notrace restore_interrupts(void);
 107
 108/* ptrace */
 109long do_syscall_trace_enter(struct pt_regs *regs);
 110void do_syscall_trace_leave(struct pt_regs *regs);
 111
 112/* process */
 113void restore_math(struct pt_regs *regs);
 114void restore_tm_state(struct pt_regs *regs);
 115
 116/* prom_init (OpenFirmware) */
 117unsigned long __init prom_init(unsigned long r3, unsigned long r4,
 118                               unsigned long pp,
 119                               unsigned long r6, unsigned long r7,
 120                               unsigned long kbase);
 121
 122/* setup */
 123void __init early_setup(unsigned long dt_ptr);
 124void early_setup_secondary(void);
 125
 126/* time */
 127void accumulate_stolen_time(void);
 128
 129/* misc runtime */
 130extern u64 __bswapdi2(u64);
 131extern s64 __lshrdi3(s64, int);
 132extern s64 __ashldi3(s64, int);
 133extern s64 __ashrdi3(s64, int);
 134extern int __cmpdi2(s64, s64);
 135extern int __ucmpdi2(u64, u64);
 136
 137/* tracing */
 138void _mcount(void);
 139unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip);
 140
 141void pnv_power9_force_smt4_catch(void);
 142void pnv_power9_force_smt4_release(void);
 143
 144#endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */
 145