arch/s390/boot/ipl_parm.c
Source file repositories/reference/linux-study-clean/arch/s390/boot/ipl_parm.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/boot/ipl_parm.c- Extension
.c- Size
- 7834 bytes
- Lines
- 332
- 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.
- 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/init.hlinux/ctype.hlinux/pgtable.hasm/arch-stackprotector.hasm/abs_lowcore.hasm/page-states.hasm/machine.hasm/ebcdic.hasm/sclp.hasm/sections.hasm/boot_data.hasm/facility.hasm/setup.hasm/uv.hboot.h
Detected Declarations
function __diag308function store_ipl_parmblockfunction is_ipl_block_dumpfunction scpdata_lengthfunction ipl_block_get_ascii_scpdatafunction append_ipl_block_parmfunction has_ebcdic_charfunction setup_boot_command_linefunction modify_facilityfunction check_cleared_facilitiesfunction modify_fac_listfunction parse_boot_command_line
Annotated Snippet
if (!isascii(scp_data[i])) {
count = 0;
goto out;
}
if (!has_lowercase && islower(scp_data[i]))
has_lowercase = 1;
}
if (has_lowercase)
memcpy(dest, scp_data, count);
else
for (i = 0; i < count; i++)
dest[i] = tolower(scp_data[i]);
out:
dest[count] = '\0';
return count;
}
static void append_ipl_block_parm(void)
{
char *parm, *delim;
size_t len, rc = 0;
len = strlen(early_command_line);
delim = early_command_line + len; /* '\0' character position */
parm = early_command_line + len + 1; /* append right after '\0' */
switch (ipl_block.pb0_hdr.pbt) {
case IPL_PBT_CCW:
rc = ipl_block_get_ascii_vmparm(
parm, COMMAND_LINE_SIZE - len - 1, &ipl_block);
break;
case IPL_PBT_FCP:
case IPL_PBT_NVME:
case IPL_PBT_ECKD:
rc = ipl_block_get_ascii_scpdata(
parm, COMMAND_LINE_SIZE - len - 1, &ipl_block);
break;
}
if (rc) {
if (*parm == '=')
memmove(early_command_line, parm + 1, rc);
else
*delim = ' '; /* replace '\0' with space */
}
}
static inline int has_ebcdic_char(const char *str)
{
int i;
for (i = 0; str[i]; i++)
if (str[i] & 0x80)
return 1;
return 0;
}
void setup_boot_command_line(void)
{
parmarea.command_line[COMMAND_LINE_SIZE - 1] = 0;
/* convert arch command line to ascii if necessary */
if (has_ebcdic_char(parmarea.command_line))
EBCASC(parmarea.command_line, COMMAND_LINE_SIZE);
/* copy arch command line */
strscpy(early_command_line, strim(parmarea.command_line));
/* append IPL PARM data to the boot command line */
if (!is_prot_virt_guest() && ipl_block_valid)
append_ipl_block_parm();
}
static void modify_facility(unsigned long nr, bool clear)
{
if (clear)
__clear_facility(nr, stfle_fac_list);
else
__set_facility(nr, stfle_fac_list);
}
static void check_cleared_facilities(void)
{
unsigned long als[] = { FACILITIES_ALS };
int i;
for (i = 0; i < ARRAY_SIZE(als); i++) {
if ((stfle_fac_list[i] & als[i]) != als[i]) {
boot_emerg("The Linux kernel requires facilities cleared via command line option\n");
print_missing_facilities();
break;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/ctype.h`, `linux/pgtable.h`, `asm/arch-stackprotector.h`, `asm/abs_lowcore.h`, `asm/page-states.h`, `asm/machine.h`.
- Detected declarations: `function __diag308`, `function store_ipl_parmblock`, `function is_ipl_block_dump`, `function scpdata_length`, `function ipl_block_get_ascii_scpdata`, `function append_ipl_block_parm`, `function has_ebcdic_char`, `function setup_boot_command_line`, `function modify_facility`, `function check_cleared_facilities`.
- 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.