Commit 7b16831d authored by Thomas Bogendoerfer's avatar Thomas Bogendoerfer Committed by Paul Burton

MIPS: arc: use function argument for passing argc/argv to prom_init_cmdline

prom_argc and prom_argv are only used by prom_init_cmdline(), so
we could pass them directly as function argument.
Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
parent cbd09241
...@@ -17,6 +17,12 @@ ...@@ -17,6 +17,12 @@
#undef DEBUG_CMDLINE #undef DEBUG_CMDLINE
/*
* A 32-bit ARC PROM pass arguments and environment as 32-bit pointer.
* These macro take care of sign extension.
*/
#define prom_argv(index) ((char *) (long)argv[(index)])
static char *ignored[] = { static char *ignored[] = {
"ConsoleIn=", "ConsoleIn=",
"ConsoleOut=", "ConsoleOut=",
...@@ -32,14 +38,14 @@ static char *used_arc[][2] = { ...@@ -32,14 +38,14 @@ static char *used_arc[][2] = {
{ "OSLoadOptions=", "" } { "OSLoadOptions=", "" }
}; };
static char * __init move_firmware_args(char* cp) static char __init *move_firmware_args(int argc, LONG *argv, char *cp)
{ {
char *s; char *s;
int actr, i; int actr, i;
actr = 1; /* Always ignore argv[0] */ actr = 1; /* Always ignore argv[0] */
while (actr < prom_argc) { while (actr < argc) {
for(i = 0; i < ARRAY_SIZE(used_arc); i++) { for(i = 0; i < ARRAY_SIZE(used_arc); i++) {
int len = strlen(used_arc[i][0]); int len = strlen(used_arc[i][0]);
...@@ -64,7 +70,7 @@ static char * __init move_firmware_args(char* cp) ...@@ -64,7 +70,7 @@ static char * __init move_firmware_args(char* cp)
return cp; return cp;
} }
void __init prom_init_cmdline(void) void __init prom_init_cmdline(int argc, LONG *argv)
{ {
char *cp; char *cp;
int actr, i; int actr, i;
...@@ -76,9 +82,9 @@ void __init prom_init_cmdline(void) ...@@ -76,9 +82,9 @@ void __init prom_init_cmdline(void)
* Move ARC variables to the beginning to make sure they can be * Move ARC variables to the beginning to make sure they can be
* overridden by later arguments. * overridden by later arguments.
*/ */
cp = move_firmware_args(cp); cp = move_firmware_args(argc, argv, cp);
while (actr < prom_argc) { while (actr < argc) {
for (i = 0; i < ARRAY_SIZE(ignored); i++) { for (i = 0; i < ARRAY_SIZE(ignored); i++) {
int len = strlen(ignored[i]); int len = strlen(ignored[i]);
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
/* Master romvec interface. */ /* Master romvec interface. */
struct linux_romvec *romvec; struct linux_romvec *romvec;
int prom_argc;
LONG *_prom_argv;
#if defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC32) #if defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC32)
/* stack for calling 32bit ARC prom */ /* stack for calling 32bit ARC prom */
...@@ -32,9 +30,6 @@ void __init prom_init(void) ...@@ -32,9 +30,6 @@ void __init prom_init(void)
romvec = ROMVECTOR; romvec = ROMVECTOR;
prom_argc = fw_arg0;
_prom_argv = (LONG *) fw_arg1;
if (pb->magic != 0x53435241) { if (pb->magic != 0x53435241) {
printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n", printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n",
(unsigned long) pb->magic); (unsigned long) pb->magic);
...@@ -42,7 +37,7 @@ void __init prom_init(void) ...@@ -42,7 +37,7 @@ void __init prom_init(void)
; ;
} }
prom_init_cmdline(); prom_init_cmdline(fw_arg0, (LONG *)fw_arg1);
prom_identify_arch(); prom_identify_arch();
printk(KERN_INFO "PROMLIB: ARC firmware Version %d Revision %d\n", printk(KERN_INFO "PROMLIB: ARC firmware Version %d Revision %d\n",
pb->ver, pb->rev); pb->ver, pb->rev);
......
...@@ -15,13 +15,6 @@ ...@@ -15,13 +15,6 @@
#include <asm/sgiarcs.h> #include <asm/sgiarcs.h>
extern struct linux_romvec *romvec; extern struct linux_romvec *romvec;
extern int prom_argc;
extern LONG *_prom_argv;
/* A 32-bit ARC PROM pass arguments and environment as 32-bit pointer.
These macros take care of sign extension. */
#define prom_argv(index) ((char *) (long) _prom_argv[(index)])
extern int prom_flags; extern int prom_flags;
...@@ -55,7 +48,7 @@ extern void prom_identify_arch(void); ...@@ -55,7 +48,7 @@ extern void prom_identify_arch(void);
extern PCHAR ArcGetEnvironmentVariable(PCHAR name); extern PCHAR ArcGetEnvironmentVariable(PCHAR name);
/* ARCS command line parsing. */ /* ARCS command line parsing. */
extern void prom_init_cmdline(void); extern void prom_init_cmdline(int argc, LONG *argv);
/* File operations. */ /* File operations. */
extern LONG ArcRead(ULONG fd, PVOID buf, ULONG num, PULONG cnt); extern LONG ArcRead(ULONG fd, PVOID buf, ULONG num, PULONG cnt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment