arch/s390/include/asm/set_memory.h
Source file repositories/reference/linux-study-clean/arch/s390/include/asm/set_memory.h
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/include/asm/set_memory.h- Extension
.h- Size
- 2175 bytes
- Lines
- 69
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mutex.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#ifndef _ASMS390_SET_MEMORY_H
#define _ASMS390_SET_MEMORY_H
#include <linux/mutex.h>
extern struct mutex cpa_mutex;
enum {
_SET_MEMORY_RO_BIT,
_SET_MEMORY_RW_BIT,
_SET_MEMORY_NX_BIT,
_SET_MEMORY_X_BIT,
_SET_MEMORY_4K_BIT,
_SET_MEMORY_INV_BIT,
_SET_MEMORY_DEF_BIT,
};
#define SET_MEMORY_RO BIT(_SET_MEMORY_RO_BIT)
#define SET_MEMORY_RW BIT(_SET_MEMORY_RW_BIT)
#define SET_MEMORY_NX BIT(_SET_MEMORY_NX_BIT)
#define SET_MEMORY_X BIT(_SET_MEMORY_X_BIT)
#define SET_MEMORY_4K BIT(_SET_MEMORY_4K_BIT)
#define SET_MEMORY_INV BIT(_SET_MEMORY_INV_BIT)
#define SET_MEMORY_DEF BIT(_SET_MEMORY_DEF_BIT)
int __set_memory(unsigned long addr, unsigned long numpages, unsigned long flags);
#define set_memory_rox set_memory_rox
/*
* Generate two variants of each set_memory() function:
*
* set_memory_yy(unsigned long addr, int numpages);
* __set_memory_yy(void *start, void *end);
*
* The second variant exists for both convenience to avoid the usual
* (unsigned long) casts, but unlike the first variant it can also be used
* for areas larger than 8TB, which may happen at memory initialization.
*/
#define __SET_MEMORY_FUNC(fname, flags) \
static inline int fname(unsigned long addr, int numpages) \
{ \
return __set_memory(addr, numpages, (flags)); \
} \
\
static inline int __##fname(void *start, void *end) \
{ \
unsigned long numpages; \
\
numpages = (end - start) >> PAGE_SHIFT; \
return __set_memory((unsigned long)start, numpages, (flags)); \
}
__SET_MEMORY_FUNC(set_memory_ro, SET_MEMORY_RO)
__SET_MEMORY_FUNC(set_memory_rw, SET_MEMORY_RW)
__SET_MEMORY_FUNC(set_memory_nx, SET_MEMORY_NX)
__SET_MEMORY_FUNC(set_memory_x, SET_MEMORY_X)
__SET_MEMORY_FUNC(set_memory_rox, SET_MEMORY_RO | SET_MEMORY_X)
__SET_MEMORY_FUNC(set_memory_rwnx, SET_MEMORY_RW | SET_MEMORY_NX)
__SET_MEMORY_FUNC(set_memory_4k, SET_MEMORY_4K)
int set_direct_map_invalid_noflush(struct page *page);
int set_direct_map_default_noflush(struct page *page);
int set_direct_map_valid_noflush(struct page *page, unsigned nr, bool valid);
bool kernel_page_present(struct page *page);
#endif
Annotation
- Immediate include surface: `linux/mutex.h`.
- 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.