cregit-Linux how code gets into the kernel

Release 4.14 arch/s390/include/asm/ctl_reg.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright IBM Corp. 1999, 2009
 *
 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
 */

#ifndef __ASM_CTL_REG_H

#define __ASM_CTL_REG_H

#include <linux/bug.h>


#define __ctl_load(array, low, high) do {                            \
        typedef struct { char _[sizeof(array)]; } addrtype;             \
                                                                        \
        BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
        asm volatile(                                                   \
                "       lctlg   %1,%2,%0\n"                             \
                :                                                       \
                : "Q" (*(addrtype *)(&array)), "i" (low), "i" (high)    \
                : "memory");                                            \
} while (0)


#define __ctl_store(array, low, high) do {                            \
        typedef struct { char _[sizeof(array)]; } addrtype;             \
                                                                        \
        BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
        asm volatile(                                                   \
                "       stctg   %1,%2,%0\n"                             \
                : "=Q" (*(addrtype *)(&array))                          \
                : "i" (low), "i" (high));                               \
} while (0)


static inline void __ctl_set_bit(unsigned int cr, unsigned int bit) { unsigned long reg; __ctl_store(reg, cr, cr); reg |= 1UL << bit; __ctl_load(reg, cr, cr); }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens3786.05%150.00%
David Howells613.95%150.00%
Total43100.00%2100.00%


static inline void __ctl_clear_bit(unsigned int cr, unsigned int bit) { unsigned long reg; __ctl_store(reg, cr, cr); reg &= ~(1UL << bit); __ctl_load(reg, cr, cr); }

Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens4086.96%150.00%
David Howells613.04%150.00%
Total46100.00%2100.00%

void smp_ctl_set_bit(int cr, int bit); void smp_ctl_clear_bit(int cr, int bit); union ctlreg0 { unsigned long val; struct { unsigned long : 32; unsigned long : 3; unsigned long lap : 1; /* Low-address-protection control */ unsigned long : 4; unsigned long edat : 1; /* Enhanced-DAT-enablement control */ unsigned long : 2; unsigned long iep : 1; /* Instruction-Execution-Protection */ unsigned long : 1; unsigned long afp : 1; /* AFP-register control */ unsigned long vx : 1; /* Vector enablement control */ unsigned long : 7; unsigned long sssm : 1; /* Service signal subclass mask */ unsigned long : 9; }; }; #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) #else # define ctl_set_bit(cr, bit) __ctl_set_bit(cr, bit) # define ctl_clear_bit(cr, bit) __ctl_clear_bit(cr, bit) #endif #endif /* __ASM_CTL_REG_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Heiko Carstens15957.19%555.56%
David Howells10236.69%111.11%
Christian Bornträger134.68%111.11%
Michael Holzheu31.08%111.11%
Greg Kroah-Hartman10.36%111.11%
Total278100.00%9100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.