livepatch.h 955 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * livepatch.h - s390-specific Kernel Live Patching Core
  3. *
  4. * Copyright (c) 2013-2015 SUSE
  5. * Authors: Jiri Kosina
  6. * Vojtech Pavlik
  7. * Jiri Slaby
  8. */
  9. /*
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the Free
  12. * Software Foundation; either version 2 of the License, or (at your option)
  13. * any later version.
  14. */
  15. #ifndef ASM_LIVEPATCH_H
  16. #define ASM_LIVEPATCH_H
  17. #include <linux/module.h>
  18. #ifdef CONFIG_LIVEPATCH
  19. static inline int klp_check_compiler_support(void)
  20. {
  21. return 0;
  22. }
  23. static inline int klp_write_module_reloc(struct module *mod, unsigned long
  24. type, unsigned long loc, unsigned long value)
  25. {
  26. /* not supported yet */
  27. return -ENOSYS;
  28. }
  29. static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip)
  30. {
  31. regs->psw.addr = ip;
  32. }
  33. #else
  34. #error Live patching support is disabled; check CONFIG_LIVEPATCH
  35. #endif
  36. #endif