arch/s390/include/asm/pgalloc.h
Source file repositories/reference/linux-study-clean/arch/s390/include/asm/pgalloc.h
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/include/asm/pgalloc.h- Extension
.h- Size
- 4869 bytes
- Lines
- 180
- 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/threads.hlinux/string.hlinux/gfp.hlinux/mm.h
Detected Declarations
function crst_table_initfunction check_asce_limitfunction p4d_freefunction pud_freefunction pmd_freefunction pgd_populatefunction p4d_populatefunction pud_populatefunction pgd_freefunction pmd_populate
Annotated Snippet
#ifndef _S390_PGALLOC_H
#define _S390_PGALLOC_H
#include <linux/threads.h>
#include <linux/string.h>
#include <linux/gfp.h>
#include <linux/mm.h>
#define CRST_ALLOC_ORDER 2
unsigned long *crst_table_alloc_noprof(struct mm_struct *);
#define crst_table_alloc(...) alloc_hooks(crst_table_alloc_noprof(__VA_ARGS__))
void crst_table_free(struct mm_struct *, unsigned long *);
unsigned long *page_table_alloc_noprof(struct mm_struct *);
#define page_table_alloc(...) alloc_hooks(page_table_alloc_noprof(__VA_ARGS__))
void page_table_free(struct mm_struct *, unsigned long *);
static inline void crst_table_init(unsigned long *crst, unsigned long entry)
{
memset64((u64 *)crst, entry, _CRST_ENTRIES);
}
int crst_table_upgrade(struct mm_struct *mm, unsigned long limit);
static inline unsigned long check_asce_limit(struct mm_struct *mm, unsigned long addr,
unsigned long len)
{
int rc;
if (addr + len > mm->context.asce_limit &&
addr + len <= TASK_SIZE) {
rc = crst_table_upgrade(mm, addr + len);
if (rc)
return (unsigned long) rc;
}
return addr;
}
static inline p4d_t *p4d_alloc_one_noprof(struct mm_struct *mm, unsigned long address)
{
unsigned long *table = crst_table_alloc_noprof(mm);
if (!table)
return NULL;
crst_table_init(table, _REGION2_ENTRY_EMPTY);
pagetable_p4d_ctor(virt_to_ptdesc(table));
return (p4d_t *) table;
}
#define p4d_alloc_one(...) alloc_hooks(p4d_alloc_one_noprof(__VA_ARGS__))
static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d)
{
if (mm_p4d_folded(mm))
return;
pagetable_dtor(virt_to_ptdesc(p4d));
crst_table_free(mm, (unsigned long *) p4d);
}
static inline pud_t *pud_alloc_one_noprof(struct mm_struct *mm, unsigned long address)
{
unsigned long *table = crst_table_alloc_noprof(mm);
if (!table)
return NULL;
crst_table_init(table, _REGION3_ENTRY_EMPTY);
pagetable_pud_ctor(virt_to_ptdesc(table));
return (pud_t *) table;
}
#define pud_alloc_one(...) alloc_hooks(pud_alloc_one_noprof(__VA_ARGS__))
static inline void pud_free(struct mm_struct *mm, pud_t *pud)
{
if (mm_pud_folded(mm))
return;
pagetable_dtor(virt_to_ptdesc(pud));
crst_table_free(mm, (unsigned long *) pud);
}
static inline pmd_t *pmd_alloc_one_noprof(struct mm_struct *mm, unsigned long vmaddr)
{
unsigned long *table = crst_table_alloc_noprof(mm);
if (!table)
return NULL;
crst_table_init(table, _SEGMENT_ENTRY_EMPTY);
Annotation
- Immediate include surface: `linux/threads.h`, `linux/string.h`, `linux/gfp.h`, `linux/mm.h`.
- Detected declarations: `function crst_table_init`, `function check_asce_limit`, `function p4d_free`, `function pud_free`, `function pmd_free`, `function pgd_populate`, `function p4d_populate`, `function pud_populate`, `function pgd_free`, `function pmd_populate`.
- 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.