18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
38c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
48c2ecf20Sopenharmony_ci * for more details.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 2012 MIPS Technologies, Inc.
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci#ifndef __ASM_FW_H_
98c2ecf20Sopenharmony_ci#define __ASM_FW_H_
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <asm/bootinfo.h>	/* For cleaner code... */
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciextern int fw_argc;
148c2ecf20Sopenharmony_ciextern int *_fw_argv;
158c2ecf20Sopenharmony_ciextern int *_fw_envp;
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/*
188c2ecf20Sopenharmony_ci * Most firmware like YAMON, PMON, etc. pass arguments and environment
198c2ecf20Sopenharmony_ci * variables as 32-bit pointers. These take care of sign extension.
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci#define fw_argv(index)		((char *)(long)_fw_argv[(index)])
228c2ecf20Sopenharmony_ci#define fw_envp(index)		((char *)(long)_fw_envp[(index)])
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciextern void fw_init_cmdline(void);
258c2ecf20Sopenharmony_ciextern char *fw_getcmdline(void);
268c2ecf20Sopenharmony_ciextern void fw_meminit(void);
278c2ecf20Sopenharmony_ciextern char *fw_getenv(char *name);
288c2ecf20Sopenharmony_ciextern unsigned long fw_getenvl(char *name);
298c2ecf20Sopenharmony_ciextern void fw_init_early_console(void);
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#endif /* __ASM_FW_H_ */
32