/*1* bootstr.c: Boot string/argument acquisition from the PROM.2*3* Copyright(C) 1995 David S. Miller ([email protected])4* Copyright(C) 1996,1998 Jakub Jelinek ([email protected])5*/67#include <linux/string.h>8#include <linux/init.h>9#include <asm/oplib.h>1011/* WARNING: The boot loader knows that these next three variables come one right12* after another in the .data section. Do not move this stuff into13* the .bss section or it will break things.14*/1516#define BARG_LEN 25617struct {18int bootstr_len;19int bootstr_valid;20char bootstr_buf[BARG_LEN];21} bootstr_info = {22.bootstr_len = BARG_LEN,23#ifdef CONFIG_CMDLINE24.bootstr_valid = 1,25.bootstr_buf = CONFIG_CMDLINE,26#endif27};2829char * __init30prom_getbootargs(void)31{32/* This check saves us from a panic when bootfd patches args. */33if (bootstr_info.bootstr_valid)34return bootstr_info.bootstr_buf;35prom_getstring(prom_chosen_node, "bootargs",36bootstr_info.bootstr_buf, BARG_LEN);37bootstr_info.bootstr_valid = 1;38return bootstr_info.bootstr_buf;39}404142