1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright (c) 2018 Red Hat Inc 4 * 5 * Authors: 6 * David Hildenbrand <david@redhat.com> 7 */ 8 #ifndef _ASMS390X_FLOAT_H_ 9 #define _ASMS390X_FLOAT_H_ 10 set_fpc(uint32_t fpc)11static inline void set_fpc(uint32_t fpc) 12 { 13 asm volatile(" lfpc %0\n" : : "m"(fpc) ); 14 } 15 get_fpc(void)16static inline uint32_t get_fpc(void) 17 { 18 uint32_t fpc; 19 20 asm volatile(" stfpc %0\n" : "=m"(fpc)); 21 22 return fpc; 23 } 24 get_fpc_dxc(void)25static inline uint8_t get_fpc_dxc(void) 26 { 27 return get_fpc() >> 8; 28 } 29 set_fpc_dxc(uint8_t dxc)30static inline void set_fpc_dxc(uint8_t dxc) 31 { 32 uint32_t fpc = get_fpc(); 33 34 fpc = (fpc & ~0xff00) | ((uint32_t)dxc) << 8; 35 36 set_fpc(fpc); 37 } 38 afp_enable(void)39static inline void afp_enable(void) 40 { 41 ctl_set_bit(0, CTL0_AFP); 42 } 43 afp_disable(void)44static inline void afp_disable(void) 45 { 46 ctl_clear_bit(0, CTL0_AFP); 47 } 48 49 #endif 50