arch/s390/include/asm/facility.h
Source file repositories/reference/linux-study-clean/arch/s390/include/asm/facility.h
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/include/asm/facility.h- Extension
.h- Size
- 3491 bytes
- Lines
- 143
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
Dependency Surface
asm/facility-defs.hlinux/minmax.hlinux/string.hlinux/types.hlinux/preempt.hasm/alternative.hasm/lowcore.h
Detected Declarations
function __set_facilityfunction __clear_facilityfunction __test_facilityfunction __test_facility_constantfunction test_facilityfunction __stfle_asmfunction __stflefunction stfle
Annotated Snippet
if (nr < sizeof(facilities_als) * 8) {
if (__test_facility(nr, &facilities_als))
return true;
}
return __test_facility_constant(nr);
}
return __test_facility(nr, &stfle_fac_list);
}
static inline unsigned long __stfle_asm(u64 *fac_list, int size)
{
unsigned long reg0 = size - 1;
asm volatile(
" lgr 0,%[reg0]\n"
" .insn s,0xb2b00000,%[list]\n" /* stfle */
" lgr %[reg0],0\n"
: [reg0] "+&d" (reg0), [list] "+Q" (*fac_list)
:
: "memory", "cc", "0");
return reg0;
}
/**
* stfle - Store facility list extended
* @fac_list: array where facility list can be stored
* @size: size of passed in array in double words
*/
static inline void __stfle(u64 *fac_list, int size)
{
unsigned long nr;
u32 stfl_fac_list;
asm volatile(
" stfl 0(0)\n"
: "=m" (get_lowcore()->stfl_fac_list));
stfl_fac_list = get_lowcore()->stfl_fac_list;
memcpy(fac_list, &stfl_fac_list, 4);
nr = 4; /* bytes stored by stfl */
if (stfl_fac_list & 0x01000000) {
/* More facility bits available with stfle */
nr = __stfle_asm(fac_list, size);
nr = min_t(unsigned long, (nr + 1) * 8, size * 8);
}
memset((char *)fac_list + nr, 0, size * 8 - nr);
}
static inline void stfle(u64 *fac_list, int size)
{
preempt_disable();
__stfle(fac_list, size);
preempt_enable();
}
/**
* stfle_size - Actual size of the facility list as specified by stfle
* (number of double words)
*/
unsigned int stfle_size(void);
#endif /* __ASM_FACILITY_H */
Annotation
- Immediate include surface: `asm/facility-defs.h`, `linux/minmax.h`, `linux/string.h`, `linux/types.h`, `linux/preempt.h`, `asm/alternative.h`, `asm/lowcore.h`.
- Detected declarations: `function __set_facility`, `function __clear_facility`, `function __test_facility`, `function __test_facility_constant`, `function test_facility`, `function __stfle_asm`, `function __stfle`, `function stfle`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.