arch/s390/kernel/setup.c
Source file repositories/reference/linux-study-clean/arch/s390/kernel/setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/kernel/setup.c- Extension
.c- Size
- 28183 bytes
- Lines
- 1017
- 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/errno.hlinux/export.hlinux/sched.hlinux/sched/task.hlinux/cpu.hlinux/kernel.hlinux/memblock.hlinux/mm.hlinux/stddef.hlinux/unistd.hlinux/ptrace.hlinux/random.hlinux/user.hlinux/tty.hlinux/ioport.hlinux/delay.hlinux/init.hlinux/initrd.hlinux/root_dev.hlinux/console.hlinux/kernel_stat.hlinux/dma-map-ops.hlinux/device.hlinux/notifier.hlinux/pfn.hlinux/ctype.hlinux/reboot.hlinux/topology.hlinux/kexec.hlinux/crash_dump.hlinux/memory.hlinux/start_kernel.h
Detected Declarations
function condev_setupfunction set_preferred_consolefunction conmode_setupfunction conmode_defaultfunction setup_zfcpdumpfunction setup_zfcpdumpfunction machine_haltfunction machine_power_offfunction stack_allocfunction stack_freefunction stack_alloc_earlyfunction setup_lowcorefunction setup_resourcesfunction for_each_mem_rangefunction setup_memory_endfunction offlinedfunction reserve_pgtablesfunction reserve_crashkernelfunction reserve_initrdfunction reserve_certificate_listfunction reserve_physmem_infofunction free_physmem_infofunction memblock_add_physmem_infofunction setup_high_memoryfunction reserve_lowcorefunction reserve_kernelfunction setup_memoryfunction relocate_amode31_sectionfunction setup_crfunction setup_randomnessfunction setup_control_program_codefunction log_component_listfunction print_rb_entryfunction setup_archfunction arch_cpu_finalize_initexport console_modeexport console_devnoexport console_irqexport vm_layoutexport zlib_dfltcc_supportexport stfle_fac_listexport VMALLOC_STARTexport VMALLOC_ENDexport vmemmapexport lowcore_ptrexport pm_power_off
Annotated Snippet
#include <linux/start_kernel.h>
#include <linux/hugetlb.h>
#include <linux/kmemleak.h>
#include <asm/archrandom.h>
#include <asm/boot_data.h>
#include <asm/machine.h>
#include <asm/ipl.h>
#include <asm/facility.h>
#include <asm/smp.h>
#include <asm/mmu_context.h>
#include <asm/cpcmd.h>
#include <asm/abs_lowcore.h>
#include <asm/nmi.h>
#include <asm/irq.h>
#include <asm/page.h>
#include <asm/ptrace.h>
#include <asm/sections.h>
#include <asm/ebcdic.h>
#include <asm/diag.h>
#include <asm/os_info.h>
#include <asm/sclp.h>
#include <asm/stacktrace.h>
#include <asm/sysinfo.h>
#include <asm/numa.h>
#include <asm/alternative.h>
#include <asm/nospec-branch.h>
#include <asm/physmem_info.h>
#include <asm/maccess.h>
#include <asm/uv.h>
#include <asm/asm-offsets.h>
#include "entry.h"
/*
* Machine setup..
*/
unsigned int console_mode = 0;
EXPORT_SYMBOL(console_mode);
unsigned int console_devno = -1;
EXPORT_SYMBOL(console_devno);
unsigned int console_irq = -1;
EXPORT_SYMBOL(console_irq);
/*
* Some code and data needs to stay below 2 GB, even when the kernel would be
* relocated above 2 GB, because it has to use 31 bit addresses.
* Such code and data is part of the .amode31 section.
*/
char __amode31_ref *__samode31 = _samode31;
char __amode31_ref *__eamode31 = _eamode31;
char __amode31_ref *__stext_amode31 = _stext_amode31;
char __amode31_ref *__etext_amode31 = _etext_amode31;
struct exception_table_entry __amode31_ref *__start_amode31_ex_table = _start_amode31_ex_table;
struct exception_table_entry __amode31_ref *__stop_amode31_ex_table = _stop_amode31_ex_table;
/*
* Control registers CR2, CR5 and CR15 are initialized with addresses
* of tables that must be placed below 2G which is handled by the AMODE31
* sections.
* Because the AMODE31 sections are relocated below 2G at startup,
* the content of control registers CR2, CR5 and CR15 must be updated
* with new addresses after the relocation. The initial initialization of
* control registers occurs in head.S and then gets updated again after AMODE31
* relocation. We must access the relevant AMODE31 tables indirectly via
* pointers placed in the .amode31.refs linker section. Those pointers get
* updated automatically during AMODE31 relocation and always contain a valid
* address within AMODE31 sections.
*/
static __amode31_data u32 __ctl_duct_amode31[16] __aligned(64);
static __amode31_data u64 __ctl_aste_amode31[8] __aligned(64) = {
[1] = 0xffffffffffffffff
};
static __amode31_data u32 __ctl_duald_amode31[32] __aligned(128) = {
0x80000000, 0, 0, 0,
0x80000000, 0, 0, 0,
0x80000000, 0, 0, 0,
0x80000000, 0, 0, 0,
0x80000000, 0, 0, 0,
0x80000000, 0, 0, 0,
0x80000000, 0, 0, 0,
0x80000000, 0, 0, 0
};
static __amode31_data u32 __ctl_linkage_stack_amode31[8] __aligned(64) = {
0, 0, 0x89000000, 0,
Annotation
- Immediate include surface: `linux/errno.h`, `linux/export.h`, `linux/sched.h`, `linux/sched/task.h`, `linux/cpu.h`, `linux/kernel.h`, `linux/memblock.h`, `linux/mm.h`.
- Detected declarations: `function condev_setup`, `function set_preferred_console`, `function conmode_setup`, `function conmode_default`, `function setup_zfcpdump`, `function setup_zfcpdump`, `function machine_halt`, `function machine_power_off`, `function stack_alloc`, `function stack_free`.
- 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.