0001
0002 #ifndef _S390_UAPI_RUNTIME_INSTR_H
0003 #define _S390_UAPI_RUNTIME_INSTR_H
0004
0005 #include <linux/types.h>
0006
0007 #define S390_RUNTIME_INSTR_START 0x1
0008 #define S390_RUNTIME_INSTR_STOP 0x2
0009
0010 struct runtime_instr_cb {
0011 __u64 rca;
0012 __u64 roa;
0013 __u64 rla;
0014
0015 __u32 v : 1;
0016 __u32 s : 1;
0017 __u32 k : 1;
0018 __u32 h : 1;
0019 __u32 a : 1;
0020 __u32 reserved1 : 3;
0021 __u32 ps : 1;
0022 __u32 qs : 1;
0023 __u32 pc : 1;
0024 __u32 qc : 1;
0025 __u32 reserved2 : 1;
0026 __u32 g : 1;
0027 __u32 u : 1;
0028 __u32 l : 1;
0029 __u32 key : 4;
0030 __u32 reserved3 : 8;
0031 __u32 t : 1;
0032 __u32 rgs : 3;
0033
0034 __u32 m : 4;
0035 __u32 n : 1;
0036 __u32 mae : 1;
0037 __u32 reserved4 : 2;
0038 __u32 c : 1;
0039 __u32 r : 1;
0040 __u32 b : 1;
0041 __u32 j : 1;
0042 __u32 e : 1;
0043 __u32 x : 1;
0044 __u32 reserved5 : 2;
0045 __u32 bpxn : 1;
0046 __u32 bpxt : 1;
0047 __u32 bpti : 1;
0048 __u32 bpni : 1;
0049 __u32 reserved6 : 2;
0050
0051 __u32 d : 1;
0052 __u32 f : 1;
0053 __u32 ic : 4;
0054 __u32 dc : 4;
0055
0056 __u64 reserved7;
0057 __u64 sf;
0058 __u64 rsic;
0059 __u64 reserved8;
0060 } __attribute__((__packed__, __aligned__(8)));
0061
0062 static inline void load_runtime_instr_cb(struct runtime_instr_cb *cb)
0063 {
0064 asm volatile(".insn rsy,0xeb0000000060,0,0,%0"
0065 : : "Q" (*cb));
0066 }
0067
0068 static inline void store_runtime_instr_cb(struct runtime_instr_cb *cb)
0069 {
0070 asm volatile(".insn rsy,0xeb0000000061,0,0,%0"
0071 : "=Q" (*cb) : : "cc");
0072 }
0073
0074 #endif