cmdline.c 774 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * cmdline.c: read the command line passed to us by the PROM.
  3. *
  4. * Copyright (C) 1998 Harald Koerfgen
  5. * Copyright (C) 2002, 2004 Maciej W. Rozycki
  6. */
  7. #include <linux/init.h>
  8. #include <linux/kernel.h>
  9. #include <linux/string.h>
  10. #include <linux/types.h>
  11. #include <asm/bootinfo.h>
  12. #include <asm/dec/prom.h>
  13. #undef PROM_DEBUG
  14. void __init prom_init_cmdline(s32 argc, s32 *argv, u32 magic)
  15. {
  16. char *arg;
  17. int start_arg, i;
  18. /*
  19. * collect args and prepare cmd_line
  20. */
  21. if (!prom_is_rex(magic))
  22. start_arg = 1;
  23. else
  24. start_arg = 2;
  25. for (i = start_arg; i < argc; i++) {
  26. arg = (void *)(long)(argv[i]);
  27. strcat(arcs_cmdline, arg);
  28. if (i < (argc - 1))
  29. strcat(arcs_cmdline, " ");
  30. }
  31. #ifdef PROM_DEBUG
  32. printk("arcs_cmdline: %s\n", &(arcs_cmdline[0]));
  33. #endif
  34. }