arch/powerpc/kernel/prom_init.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/prom_init.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/prom_init.c- Extension
.c- Size
- 88954 bytes
- Lines
- 3431
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/stdarg.hlinux/kernel.hlinux/string.hlinux/init.hlinux/threads.hlinux/spinlock.hlinux/types.hlinux/pci.hlinux/proc_fs.hlinux/delay.hlinux/initrd.hlinux/bitops.hlinux/pgtable.hlinux/printk.hlinux/of.hlinux/of_fdt.hasm/prom.hasm/rtas.hasm/page.hasm/processor.hasm/interrupt.hasm/irq.hasm/io.hasm/smp.hasm/mmu.hasm/iommu.hasm/btext.hasm/sections.hasm/setup.hasm/asm-prototypes.hasm/ultravisor-api.hlinux/linux_logo.h
Detected Declarations
struct prom_argsstruct prom_tstruct mem_map_entrystruct platform_supportstruct option_vector1struct option_vector2struct option_vector3struct option_vector4struct option_vector5struct option_vector6struct option_vector7struct ibm_arch_vecstruct chrpnotestruct chrpdescstruct rpanotestruct rpadescfunction enter_promfunction prom_strcmpfunction prom_strscpy_padfunction prom_strncmpfunction prom_strlenfunction prom_memcmpfunction prom_strlcatfunction prom_strtoboolfunction call_promfunction call_prom_retfunction prom_printfunction prom_print_hexfunction prom_print_decfunction prom_printffunction prom_claimfunction __attribute__function prom_next_nodefunction prom_getpropfunction prom_getproplenfunction add_stringfunction tohexfunction prom_setpropfunction prom_strtoulfunction prom_memparsefunction early_cmdline_parsefunction prom_count_smt_threadsfunction prom_parse_mmu_modelfunction prom_parse_xive_modelfunction prom_parse_platform_supportfunction prom_check_platform_supportfunction prom_send_capabilitiesfunction fail
Annotated Snippet
struct prom_args {
__be32 service;
__be32 nargs;
__be32 nret;
__be32 args[10];
};
struct prom_t {
ihandle root;
phandle chosen;
int cpu;
ihandle stdout;
ihandle mmumap;
ihandle memory;
};
struct mem_map_entry {
__be64 base;
__be64 size;
};
typedef __be32 cell_t;
extern void __start(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7, unsigned long r8,
unsigned long r9);
#ifdef CONFIG_PPC64
extern int enter_prom(struct prom_args *args, unsigned long entry);
#else
static inline int enter_prom(struct prom_args *args, unsigned long entry)
{
return ((int (*)(struct prom_args *))entry)(args);
}
#endif
extern void copy_and_flush(unsigned long dest, unsigned long src,
unsigned long size, unsigned long offset);
/* prom structure */
static struct prom_t __prombss prom;
static unsigned long __prombss prom_entry;
static char __prombss of_stdout_device[256];
static char __prombss prom_scratch[256];
static unsigned long __prombss dt_header_start;
static unsigned long __prombss dt_struct_start, dt_struct_end;
static unsigned long __prombss dt_string_start, dt_string_end;
static unsigned long __prombss prom_initrd_start, prom_initrd_end;
#ifdef CONFIG_PPC64
static int __prombss prom_iommu_force_on;
static int __prombss prom_iommu_off;
static unsigned long __prombss prom_tce_alloc_start;
static unsigned long __prombss prom_tce_alloc_end;
#endif
#ifdef CONFIG_PPC_PSERIES
static bool __prombss prom_radix_disable;
static bool __prombss prom_radix_gtse_disable;
static bool __prombss prom_xive_disable;
#endif
#ifdef CONFIG_PPC_SVM
static bool __prombss prom_svm_enable;
#endif
struct platform_support {
bool hash_mmu;
bool radix_mmu;
bool radix_gtse;
bool xive;
};
/* Platforms codes are now obsolete in the kernel. Now only used within this
* file and ultimately gone too. Feel free to change them if you need, they
* are not shared with anything outside of this file anymore
*/
#define PLATFORM_PSERIES 0x0100
#define PLATFORM_PSERIES_LPAR 0x0101
#define PLATFORM_LPAR 0x0001
#define PLATFORM_POWERMAC 0x0400
#define PLATFORM_GENERIC 0x0500
static int __prombss of_platform;
static char __prombss prom_cmd_line[COMMAND_LINE_SIZE];
Annotation
- Immediate include surface: `linux/stdarg.h`, `linux/kernel.h`, `linux/string.h`, `linux/init.h`, `linux/threads.h`, `linux/spinlock.h`, `linux/types.h`, `linux/pci.h`.
- Detected declarations: `struct prom_args`, `struct prom_t`, `struct mem_map_entry`, `struct platform_support`, `struct option_vector1`, `struct option_vector2`, `struct option_vector3`, `struct option_vector4`, `struct option_vector5`, `struct option_vector6`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.