0001
0002
0003 #ifndef __LINUX_ARM_SDEI_H
0004 #define __LINUX_ARM_SDEI_H
0005
0006 #include <uapi/linux/arm_sdei.h>
0007
0008 #include <acpi/ghes.h>
0009
0010 #ifdef CONFIG_ARM_SDE_INTERFACE
0011 #include <asm/sdei.h>
0012 #endif
0013
0014
0015 #ifndef sdei_arch_get_entry_point
0016 #define sdei_arch_get_entry_point(conduit) (0)
0017 #endif
0018
0019
0020
0021
0022
0023 typedef int (sdei_event_callback)(u32 event, struct pt_regs *regs, void *arg);
0024
0025
0026
0027
0028
0029 int sdei_event_register(u32 event_num, sdei_event_callback *cb, void *arg);
0030
0031
0032
0033
0034
0035 int sdei_event_unregister(u32 event_num);
0036
0037 int sdei_event_enable(u32 event_num);
0038 int sdei_event_disable(u32 event_num);
0039
0040
0041 int sdei_register_ghes(struct ghes *ghes, sdei_event_callback *normal_cb,
0042 sdei_event_callback *critical_cb);
0043 int sdei_unregister_ghes(struct ghes *ghes);
0044
0045 #ifdef CONFIG_ARM_SDE_INTERFACE
0046
0047 int sdei_mask_local_cpu(void);
0048 int sdei_unmask_local_cpu(void);
0049 void __init sdei_init(void);
0050 #else
0051 static inline int sdei_mask_local_cpu(void) { return 0; }
0052 static inline int sdei_unmask_local_cpu(void) { return 0; }
0053 static inline void sdei_init(void) { }
0054 #endif
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 struct sdei_registered_event {
0068
0069 struct pt_regs interrupted_regs;
0070
0071 sdei_event_callback *callback;
0072 void *callback_arg;
0073 u32 event_num;
0074 u8 priority;
0075 };
0076
0077
0078 int notrace sdei_event_handler(struct pt_regs *regs,
0079 struct sdei_registered_event *arg);
0080
0081
0082 int sdei_api_event_context(u32 query, u64 *result);
0083
0084 #endif