arch/sh/kernel/setup.c
Source file repositories/reference/linux-study-clean/arch/sh/kernel/setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sh/kernel/setup.c- Extension
.c- Size
- 9529 bytes
- Lines
- 407
- Domain
- Architecture Layer
- Bucket
- arch/sh
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ioport.hlinux/init.hlinux/initrd.hlinux/console.hlinux/root_dev.hlinux/utsname.hlinux/nodemask.hlinux/cpu.hlinux/pfn.hlinux/fs.hlinux/mm.hlinux/kexec.hlinux/module.hlinux/smp.hlinux/err.hlinux/crash_dump.hlinux/mmzone.hlinux/clk.hlinux/delay.hlinux/platform_device.hlinux/memblock.hlinux/of.hlinux/of_fdt.hlinux/uaccess.huapi/linux/mount.hasm/io.hasm/page.hasm/elf.hasm/sections.hasm/irq.hasm/setup.hasm/clock.h
Detected Declarations
function early_parse_memfunction check_for_initrdfunction calibrate_delayfunction __add_active_rangefunction plat_early_device_setupfunction setup_archfunction generic_mode_pinsfunction test_mode_pinfunction arch_cpu_finalize_initexport cpu_dataexport sh_mvexport memory_startexport memory_end
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* arch/sh/kernel/setup.c
*
* This file handles the architecture-dependent parts of initialization
*
* Copyright (C) 1999 Niibe Yutaka
* Copyright (C) 2002 - 2010 Paul Mundt
*/
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/initrd.h>
#include <linux/console.h>
#include <linux/root_dev.h>
#include <linux/utsname.h>
#include <linux/nodemask.h>
#include <linux/cpu.h>
#include <linux/pfn.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/kexec.h>
#include <linux/module.h>
#include <linux/smp.h>
#include <linux/err.h>
#include <linux/crash_dump.h>
#include <linux/mmzone.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/memblock.h>
#include <linux/of.h>
#include <linux/of_fdt.h>
#include <linux/uaccess.h>
#include <uapi/linux/mount.h>
#include <asm/io.h>
#include <asm/page.h>
#include <asm/elf.h>
#include <asm/sections.h>
#include <asm/irq.h>
#include <asm/setup.h>
#include <asm/clock.h>
#include <asm/smp.h>
#include <asm/mmu_context.h>
#include <asm/mmzone.h>
#include <asm/processor.h>
#include <asm/sparsemem.h>
#include <asm/platform_early.h>
/*
* Initialize loops_per_jiffy as 10000000 (1000MIPS).
* This value will be used at the very early stage of serial setup.
* The bigger value means no problem.
*/
struct sh_cpuinfo cpu_data[NR_CPUS] __read_mostly = {
[0] = {
.type = CPU_SH_NONE,
.family = CPU_FAMILY_UNKNOWN,
.loops_per_jiffy = 10000000,
.phys_bits = MAX_PHYSMEM_BITS,
},
};
EXPORT_SYMBOL(cpu_data);
/*
* The machine vector. First entry in .machvec.init, or clobbered by
* sh_mv= on the command line, prior to .machvec.init teardown.
*/
struct sh_machine_vector sh_mv = { .mv_name = "generic", };
EXPORT_SYMBOL(sh_mv);
extern int root_mountflags;
#define RAMDISK_IMAGE_START_MASK 0x07FF
#define RAMDISK_PROMPT_FLAG 0x8000
#define RAMDISK_LOAD_FLAG 0x4000
static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, };
static struct resource code_resource = {
.name = "Kernel code",
.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
};
static struct resource data_resource = {
.name = "Kernel data",
.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
};
static struct resource bss_resource = {
.name = "Kernel bss",
Annotation
- Immediate include surface: `linux/ioport.h`, `linux/init.h`, `linux/initrd.h`, `linux/console.h`, `linux/root_dev.h`, `linux/utsname.h`, `linux/nodemask.h`, `linux/cpu.h`.
- Detected declarations: `function early_parse_mem`, `function check_for_initrd`, `function calibrate_delay`, `function __add_active_range`, `function plat_early_device_setup`, `function setup_arch`, `function generic_mode_pins`, `function test_mode_pin`, `function arch_cpu_finalize_init`, `export cpu_data`.
- Atlas domain: Architecture Layer / arch/sh.
- Implementation status: integration 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.