reipl_diag.c 874 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * This file contains the implementation of the
  3. * Linux re-IPL support
  4. *
  5. * (C) Copyright IBM Corp. 2005
  6. *
  7. * Author(s): Volker Sameske (sameske@de.ibm.com)
  8. *
  9. */
  10. #include <linux/kernel.h>
  11. static unsigned int reipl_diag_rc1;
  12. static unsigned int reipl_diag_rc2;
  13. /*
  14. * re-IPL the system using the last used IPL parameters
  15. */
  16. void reipl_diag(void)
  17. {
  18. asm volatile (
  19. " la %%r4,0\n"
  20. " la %%r5,0\n"
  21. " diag %%r4,%2,0x308\n"
  22. "0:\n"
  23. " st %%r4,%0\n"
  24. " st %%r5,%1\n"
  25. ".section __ex_table,\"a\"\n"
  26. #ifdef CONFIG_64BIT
  27. " .align 8\n"
  28. " .quad 0b, 0b\n"
  29. #else
  30. " .align 4\n"
  31. " .long 0b, 0b\n"
  32. #endif
  33. ".previous\n"
  34. : "=m" (reipl_diag_rc1), "=m" (reipl_diag_rc2)
  35. : "d" (3) : "cc", "4", "5" );
  36. }