PageRenderTime 33ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/arch/sparc/prom/init_64.c

https://bitbucket.org/cresqo/cm7-p500-kernel
C | 57 lines | 30 code | 14 blank | 13 comment | 6 complexity | 05a6a58371006b5d0d0bf8cd39e88395 MD5 | raw file
Possible License(s): LGPL-2.0, AGPL-1.0, GPL-2.0
  1. /*
  2. * init.c: Initialize internal variables used by the PROM
  3. * library functions.
  4. *
  5. * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  6. * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  7. */
  8. #include <linux/kernel.h>
  9. #include <linux/init.h>
  10. #include <linux/string.h>
  11. #include <linux/ctype.h>
  12. #include <asm/openprom.h>
  13. #include <asm/oplib.h>
  14. /* OBP version string. */
  15. char prom_version[80];
  16. /* The root node of the prom device tree. */
  17. int prom_stdin, prom_stdout;
  18. int prom_chosen_node;
  19. /* You must call prom_init() before you attempt to use any of the
  20. * routines in the prom library. It returns 0 on success, 1 on
  21. * failure. It gets passed the pointer to the PROM vector.
  22. */
  23. extern void prom_cif_init(void *, void *);
  24. void __init prom_init(void *cif_handler, void *cif_stack)
  25. {
  26. int node;
  27. prom_cif_init(cif_handler, cif_stack);
  28. prom_chosen_node = prom_finddevice(prom_chosen_path);
  29. if (!prom_chosen_node || prom_chosen_node == -1)
  30. prom_halt();
  31. prom_stdin = prom_getint(prom_chosen_node, "stdin");
  32. prom_stdout = prom_getint(prom_chosen_node, "stdout");
  33. node = prom_finddevice("/openprom");
  34. if (!node || node == -1)
  35. prom_halt();
  36. prom_getstring(node, "version", prom_version, sizeof(prom_version));
  37. prom_printf("\n");
  38. }
  39. void __init prom_init_report(void)
  40. {
  41. printk("PROMLIB: Sun IEEE Boot Prom '%s'\n", prom_version);
  42. printk("PROMLIB: Root node compatible: %s\n", prom_root_compatible);
  43. }