xref: /linux/arch/s390/kernel/facility.c (revision 1a562c0d44974d3cf89c6cc5c34c708c08af420e)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright IBM Corp. 2023
4  */
5 
6 #include <asm/facility.h>
7 
8 unsigned int stfle_size(void)
9 {
10 	static unsigned int size;
11 	unsigned int r;
12 	u64 dummy;
13 
14 	r = READ_ONCE(size);
15 	if (!r) {
16 		r = __stfle_asm(&dummy, 1) + 1;
17 		WRITE_ONCE(size, r);
18 	}
19 	return r;
20 }
21 EXPORT_SYMBOL(stfle_size);
22