init.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
- /*
- * init.c: PROM library initialisation code.
- *
- * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
- */
- #include <linux/mm.h>
- #include <asm/bootinfo.h>
- #include <asm/addrspace.h>
- #include <asm/hp-lj/asic.h>
- #include <linux/bootmem.h>
- #include "utils.h"
- #define Delimiter "CMDLINE="
- const char CommandLine[] = Delimiter
- "root=/dev/hda3 ";
- char arcs_cmdline[CL_SIZE];
- int __init prom_init(int argc, char ** argv, char **envp)
- {
- ulong mem_size = get_mem_avail();
- int reserve_size = 0;
- printk("Total Memory: %ld bytesn", mem_size);
- reserve_buffer(CommandLine, mem_size);
- reserve_size = get_reserved_buffer_size();
- mem_size -= reserve_size;
- add_memory_region(0x0,mem_size, BOOT_MEM_RAM);
- add_memory_region(mem_size,reserve_size, BOOT_MEM_RESERVED);
- printk("Main Memory: %ld bytesn", mem_size);
- printk("Reserved Memory: %ld bytes at 0x%08xn",
- get_reserved_buffer_size(), (ulong)get_reserved_buffer());
- printk("Detected %s ASICn", GetAsicName());
- mips_machgroup = MACH_GROUP_HP_LJ;
- mips_machtype = MACH_UNKNOWN;
- strcpy(arcs_cmdline, CommandLine+strlen(Delimiter));
- return 0;
- }
- void prom_free_prom_memory (void)
- {
- }