xref: /kvm-unit-tests/lib/s390x/asm/interrupt.h (revision a991ed2fb5eef30af4e402cc79bcbae067d43e6b)
1 /*
2  * Copyright (c) 2017 Red Hat Inc
3  *
4  * Authors:
5  *  David Hildenbrand <david@redhat.com>
6  *
7  * This code is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Library General Public License version 2.
9  */
10 #ifndef _ASMS390X_IRQ_H_
11 #define _ASMS390X_IRQ_H_
12 #include <asm/arch_def.h>
13 
14 #define EXT_IRQ_EMERGENCY_SIG	0x1201
15 #define EXT_IRQ_EXTERNAL_CALL	0x1202
16 #define EXT_IRQ_SERVICE_SIG	0x2401
17 
18 void register_pgm_cleanup_func(void (*f)(void));
19 void handle_pgm_int(void);
20 void handle_ext_int(void);
21 void handle_mcck_int(void);
22 void handle_io_int(void);
23 void handle_svc_int(void);
24 void expect_pgm_int(void);
25 void expect_ext_int(void);
26 uint16_t clear_pgm_int(void);
27 void check_pgm_int_code(uint16_t code);
28 
29 /* Activate low-address protection */
30 static inline void low_prot_enable(void)
31 {
32 	ctl_set_bit(0, 63 - 35);
33 }
34 
35 /* Disable low-address protection */
36 static inline void low_prot_disable(void)
37 {
38 	ctl_clear_bit(0, 63 - 35);
39 }
40 
41 #endif
42