1 #ifndef _ASMARM64_PROCESSOR_H_ 2 #define _ASMARM64_PROCESSOR_H_ 3 /* 4 * Copyright (C) 2014, Red Hat Inc, Andrew Jones <drjones@redhat.com> 5 * 6 * This work is licensed under the terms of the GNU LGPL, version 2. 7 */ 8 #include <asm/ptrace.h> 9 10 enum vector { 11 EL1T_SYNC, 12 EL1T_IRQ, 13 EL1T_FIQ, 14 EL1T_ERROR, 15 EL1H_SYNC, 16 EL1H_IRQ, 17 EL1H_FIQ, 18 EL1H_ERROR, 19 EL0_SYNC_64, 20 EL0_IRQ_64, 21 EL0_FIQ_64, 22 EL0_ERROR_64, 23 EL0_SYNC_32, 24 EL0_IRQ_32, 25 EL0_FIQ_32, 26 EL0_ERROR_32, 27 VECTOR_MAX, 28 }; 29 30 #define EC_MAX 64 31 32 typedef void (*vector_fn)(enum vector v, struct pt_regs *regs, 33 unsigned int esr); 34 typedef void (*exception_fn)(struct pt_regs *regs, unsigned int esr); 35 extern void install_vector_handler(enum vector v, vector_fn fn); 36 extern void install_exception_handler(enum vector v, unsigned int ec, 37 exception_fn fn); 38 39 extern void show_regs(struct pt_regs *regs); 40 extern void *get_sp(void); 41 42 static inline unsigned long current_level(void) 43 { 44 unsigned long el; 45 asm volatile("mrs %0, CurrentEL" : "=r" (el)); 46 return el & 0xc; 47 } 48 49 extern bool user_mode; 50 extern void start_usr(void (*func)(void *arg), void *arg, unsigned long sp_usr); 51 52 #endif /* _ASMARM64_PROCESSOR_H_ */ 53