arch/s390/mm/extmem.c
Source file repositories/reference/linux-study-clean/arch/s390/mm/extmem.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/mm/extmem.c- Extension
.c- Size
- 16770 bytes
- Lines
- 679
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/string.hlinux/spinlock.hlinux/list.hlinux/slab.hlinux/export.hlinux/memblock.hlinux/ctype.hlinux/ioport.hlinux/refcount.hlinux/pgtable.hasm/machine.hasm/diag.hasm/page.hasm/ebcdic.hasm/errno.hasm/extmem.hasm/cpcmd.hasm/setup.hasm/asm.h
Detected Declarations
struct qrangestruct qout64struct qin64struct dcss_segmentfunction dcss_mknamefunction segment_by_namefunction dcss_diagfunction dcss_diag_translate_rcfunction query_segment_typefunction segment_typefunction segment_overlaps_othersfunction __segment_loadfunction segment_loadfunction segment_modify_sharedfunction __dcss_diag_purge_on_cpu_0function segment_unloadfunction segment_savefunction segment_loadexport segment_loadexport segment_unloadexport segment_saveexport segment_typeexport segment_modify_sharedexport segment_warning
Annotated Snippet
struct qrange {
unsigned long start; /* last byte type */
unsigned long end; /* last byte reserved */
};
struct qout64 {
unsigned long segstart;
unsigned long segend;
int segcnt;
int segrcnt;
struct qrange range[6];
};
struct qin64 {
char qopcode;
char rsrv1[3];
char qrcode;
char rsrv2[3];
char qname[8];
unsigned int qoutptr;
short int qoutlen;
};
struct dcss_segment {
struct list_head list;
char dcss_name[8];
char res_name[16];
unsigned long start_addr;
unsigned long end;
refcount_t ref_count;
int do_nonshared;
unsigned int vm_segtype;
struct qrange range[6];
int segcnt;
struct resource *res;
};
static DEFINE_MUTEX(dcss_lock);
static LIST_HEAD(dcss_list);
static char *segtype_string[] = { "SW", "EW", "SR", "ER", "SN", "EN", "SC",
"EW/EN-MIXED" };
static int loadshr_scode = DCSS_LOADSHRX;
static int loadnsr_scode = DCSS_LOADNSRX;
static int purgeseg_scode = DCSS_PURGESEG;
static int segext_scode = DCSS_SEGEXTX;
/*
* Create the 8 bytes, ebcdic VM segment name from
* an ascii name.
*/
static void
dcss_mkname(char *name, char *dcss_name)
{
int i;
for (i = 0; i < 8; i++) {
if (name[i] == '\0')
break;
dcss_name[i] = toupper(name[i]);
}
for (; i < 8; i++)
dcss_name[i] = ' ';
ASCEBC(dcss_name, 8);
}
/*
* search all segments in dcss_list, and return the one
* namend *name. If not found, return NULL.
*/
static struct dcss_segment *
segment_by_name (char *name)
{
char dcss_name[9];
struct list_head *l;
struct dcss_segment *tmp, *retval = NULL;
BUG_ON(!mutex_is_locked(&dcss_lock));
dcss_mkname (name, dcss_name);
list_for_each (l, &dcss_list) {
tmp = list_entry (l, struct dcss_segment, list);
if (memcmp(tmp->dcss_name, dcss_name, 8) == 0) {
retval = tmp;
break;
}
}
return retval;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/string.h`, `linux/spinlock.h`, `linux/list.h`, `linux/slab.h`, `linux/export.h`, `linux/memblock.h`, `linux/ctype.h`.
- Detected declarations: `struct qrange`, `struct qout64`, `struct qin64`, `struct dcss_segment`, `function dcss_mkname`, `function segment_by_name`, `function dcss_diag`, `function dcss_diag_translate_rc`, `function query_segment_type`, `function segment_type`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.