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 void handle_pgm_int(void); 15 void expect_pgm_int(void); 16 void check_pgm_int_code(uint16_t code); 17 18 /* Activate low-address protection */ 19 static inline void low_prot_enable(void) 20 { 21 uint64_t cr0; 22 23 asm volatile (" stctg %%c0,%%c0,%0 " : : "Q"(cr0) : "memory"); 24 cr0 |= 1ULL << (63-35); 25 asm volatile (" lctlg %%c0,%%c0,%0 " : : "Q"(cr0)); 26 } 27 28 /* Disable low-address protection */ 29 static inline void low_prot_disable(void) 30 { 31 uint64_t cr0; 32 33 asm volatile (" stctg %%c0,%%c0,%0 " : : "Q"(cr0) : "memory"); 34 cr0 &= ~(1ULL << (63-35)); 35 asm volatile (" lctlg %%c0,%%c0,%0 " : : "Q"(cr0)); 36 } 37 38 #endif 39