s390/ctl_reg: add union type for control register 0
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 1 Jan 2014 15:08:37 +0000 (16:08 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 22 Apr 2014 11:24:36 +0000 (13:24 +0200)
Add 'union ctlreg0_bits' to easily allow setting and testing bits of
control register 0 bits.
This patch only adds the bits needed for the new guest access functions.
Other bits and control registers can be added when needed.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/include/asm/ctl_reg.h

index 4e63f1a13600a4e126d470138e074d2e4e98682d..31ab9f346d7e37f1c7ce8048db783ba4a15d128c 100644 (file)
@@ -57,6 +57,20 @@ static inline void __ctl_clear_bit(unsigned int cr, unsigned int bit)
 void smp_ctl_set_bit(int cr, int bit);
 void smp_ctl_clear_bit(int cr, int bit);
 
+union ctlreg0 {
+       unsigned long val;
+       struct {
+#ifdef CONFIG_64BIT
+               unsigned long      : 32;
+#endif
+               unsigned long      : 3;
+               unsigned long lap  : 1; /* Low-address-protection control */
+               unsigned long      : 4;
+               unsigned long edat : 1; /* Enhanced-DAT-enablement control */
+               unsigned long      : 23;
+       };
+};
+
 #ifdef CONFIG_SMP
 # define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
 # define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)