xref: /kvm-unit-tests/lib/s390x/asm/interrupt.h (revision 5b70cbdb7bc2ea65096b51565c75815cc95945b8)
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 handle_pgm_int(void);
19 void handle_ext_int(void);
20 void handle_mcck_int(void);
21 void handle_io_int(void);
22 void handle_svc_int(void);
23 void expect_pgm_int(void);
24 void expect_ext_int(void);
25 uint16_t clear_pgm_int(void);
26 void check_pgm_int_code(uint16_t code);
27 
28 /* Activate low-address protection */
29 static inline void low_prot_enable(void)
30 {
31 	ctl_set_bit(0, 63 - 35);
32 }
33 
34 /* Disable low-address protection */
35 static inline void low_prot_disable(void)
36 {
37 	ctl_clear_bit(0, 63 - 35);
38 }
39 
40 #endif
41