2 * Generic PROM routines
4 * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/string.h>
16 #include <asm/bootinfo.h>
18 #include <prom/generic.h>
20 static int *_prom_argc;
21 static char **_prom_argv;
22 static char **_prom_envp;
24 char *generic_prom_getenv(char *envname)
30 for (env = _prom_envp; *env != NULL; env++) {
31 if (strcmp(envname, *env++) == 0) {
40 int generic_prom_present(void)
42 _prom_argc = (int *)fw_arg0;
43 _prom_argv = (char **)fw_arg1;
44 _prom_envp = (char **)fw_arg2;