arch/parisc/kernel/setup.c

Source file repositories/reference/linux-study-clean/arch/parisc/kernel/setup.c

File Facts

System
Linux kernel
Corpus path
arch/parisc/kernel/setup.c
Extension
.c
Size
7953 bytes
Lines
312
Domain
Architecture Layer
Bucket
arch/parisc
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.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <linux/start_kernel.h>

#include <asm/cacheflush.h>
#include <asm/processor.h>
#include <asm/sections.h>
#include <asm/pdc.h>
#include <asm/led.h>
#include <asm/pdc_chassis.h>
#include <asm/io.h>
#include <asm/setup.h>
#include <asm/unwind.h>
#include <asm/smp.h>

static char __initdata command_line[COMMAND_LINE_SIZE];

static void __init setup_cmdline(char **cmdline_p)
{
	extern unsigned int boot_args[];
	char *p;

	*cmdline_p = command_line;

	/* boot_args[0] is free-mem start, boot_args[1] is ptr to command line */
	if (boot_args[0] < 64)
		return;	/* return if called from hpux boot loader */

	/* Collect stuff passed in from the boot loader */
	strscpy(boot_command_line, (char *)__va(boot_args[1]),
		COMMAND_LINE_SIZE);

	/* autodetect console type (if not done by palo yet) */
	p = boot_command_line;
	if (!str_has_prefix(p, "console=") && !strstr(p, " console=")) {
		strlcat(p, " console=", COMMAND_LINE_SIZE);
		if (PAGE0->mem_cons.cl_class == CL_DUPLEX)
			strlcat(p, "ttyS0", COMMAND_LINE_SIZE);
		else
			strlcat(p, "tty0", COMMAND_LINE_SIZE);
	}

	/* default to use early console */
	if (!strstr(p, "earlycon"))
		strlcat(p, " earlycon=pdc", COMMAND_LINE_SIZE);

#ifdef CONFIG_BLK_DEV_INITRD
	/* did palo pass us a ramdisk? */
	if (boot_args[2] != 0) {
		initrd_start = (unsigned long)__va(boot_args[2]);
		initrd_end = (unsigned long)__va(boot_args[3]);
	}
#endif

	strscpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
}

#ifdef CONFIG_PA11
static void __init dma_ops_init(void)
{
	switch (boot_cpu_data.cpu_type) {
	case pcx:
		/*
		 * We've got way too many dependencies on 1.1 semantics
		 * to support 1.0 boxes at this point.
		 */
		panic(	"PA-RISC Linux currently only supports machines that conform to\n"
			"the PA-RISC 1.1 or 2.0 architecture specification.\n");

	case pcxl2:
	default:
		break;
	}
}
#endif

void __init setup_arch(char **cmdline_p)
{
	unwind_init();

	init_per_cpu(smp_processor_id());	/* Set Modes & Enable FP */

#ifdef CONFIG_64BIT
	printk(KERN_INFO "The 64-bit Kernel has started...\n");
#else
	printk(KERN_INFO "The 32-bit Kernel has started...\n");
#endif

	printk(KERN_INFO "Kernel default page size is %d KB. Huge pages ",
		(int)(PAGE_SIZE / 1024));
#ifdef CONFIG_HUGETLB_PAGE
	printk(KERN_CONT "enabled with %d MB physical and %d MB virtual size",

Annotation

Implementation Notes