aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorMichael Mueller <mimu@linux.vnet.ibm.com>2013-06-20 09:11:39 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-06-26 15:10:25 -0400
commit32089246e36dffbadba66fc94a246678fccfd5a2 (patch)
treef5533dc03ff02868437d60bd32577f1a4e33f08a /arch/s390
parent749d3f9c8179a26f87a1427e95229fc94ef40cc1 (diff)
s390/facility: decompose test_facility()
The patch decomposes the function test_facility() into its API test_facility() and its implementation __test_facility(). This allows to reuse the implementation with a different API. Patch is used to prepare checkin of SIE satellite code. Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/facility.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/s390/include/asm/facility.h b/arch/s390/include/asm/facility.h
index 2ee66a65f2d4..0aa6a7ed95a3 100644
--- a/arch/s390/include/asm/facility.h
+++ b/arch/s390/include/asm/facility.h
@@ -13,6 +13,16 @@
13 13
14#define MAX_FACILITY_BIT (256*8) /* stfle_fac_list has 256 bytes */ 14#define MAX_FACILITY_BIT (256*8) /* stfle_fac_list has 256 bytes */
15 15
16static inline int __test_facility(unsigned long nr, void *facilities)
17{
18 unsigned char *ptr;
19
20 if (nr >= MAX_FACILITY_BIT)
21 return 0;
22 ptr = (unsigned char *) facilities + (nr >> 3);
23 return (*ptr & (0x80 >> (nr & 7))) != 0;
24}
25
16/* 26/*
17 * The test_facility function uses the bit odering where the MSB is bit 0. 27 * The test_facility function uses the bit odering where the MSB is bit 0.
18 * That makes it easier to query facility bits with the bit number as 28 * That makes it easier to query facility bits with the bit number as
@@ -20,12 +30,7 @@
20 */ 30 */
21static inline int test_facility(unsigned long nr) 31static inline int test_facility(unsigned long nr)
22{ 32{
23 unsigned char *ptr; 33 return __test_facility(nr, &S390_lowcore.stfle_fac_list);
24
25 if (nr >= MAX_FACILITY_BIT)
26 return 0;
27 ptr = (unsigned char *) &S390_lowcore.stfle_fac_list + (nr >> 3);
28 return (*ptr & (0x80 >> (nr & 7))) != 0;
29} 34}
30 35
31/** 36/**