fw.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2012 MIPS Technologies, Inc.
  7. */
  8. #ifndef __ASM_FW_H_
  9. #define __ASM_FW_H_
  10. #include <asm/bootinfo.h> /* For cleaner code... */
  11. enum fw_memtypes {
  12. fw_dontuse,
  13. fw_code,
  14. fw_free,
  15. };
  16. typedef struct {
  17. unsigned long base; /* Within KSEG0 */
  18. unsigned int size; /* bytes */
  19. enum fw_memtypes type; /* fw_memtypes */
  20. } fw_memblock_t;
  21. /* Maximum number of memory block descriptors. */
  22. #define FW_MAX_MEMBLOCKS 32
  23. extern int fw_argc;
  24. extern int *_fw_argv;
  25. extern int *_fw_envp;
  26. /*
  27. * Most firmware like YAMON, PMON, etc. pass arguments and environment
  28. * variables as 32-bit pointers. These take care of sign extension.
  29. */
  30. #define fw_argv(index) ((char *)(long)_fw_argv[(index)])
  31. #define fw_envp(index) ((char *)(long)_fw_envp[(index)])
  32. extern void fw_init_cmdline(void);
  33. extern char *fw_getcmdline(void);
  34. extern fw_memblock_t *fw_getmdesc(void);
  35. extern void fw_meminit(void);
  36. extern char *fw_getenv(char *name);
  37. extern unsigned long fw_getenvl(char *name);
  38. extern void fw_init_early_console(char port);
  39. #endif /* __ASM_FW_H_ */