suspend.h 941 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2021 Western Digital Corporation or its affiliates.
  4. * Copyright (c) 2022 Ventana Micro Systems Inc.
  5. */
  6. #ifndef _ASM_RISCV_SUSPEND_H
  7. #define _ASM_RISCV_SUSPEND_H
  8. #include <asm/ptrace.h>
  9. struct suspend_context {
  10. /* Saved and restored by low-level functions */
  11. struct pt_regs regs;
  12. /* Saved and restored by high-level functions */
  13. unsigned long scratch;
  14. unsigned long tvec;
  15. unsigned long ie;
  16. #ifdef CONFIG_MMU
  17. unsigned long satp;
  18. #endif
  19. };
  20. /* Low-level CPU suspend entry function */
  21. int __cpu_suspend_enter(struct suspend_context *context);
  22. /* High-level CPU suspend which will save context and call finish() */
  23. int cpu_suspend(unsigned long arg,
  24. int (*finish)(unsigned long arg,
  25. unsigned long entry,
  26. unsigned long context));
  27. /* Low-level CPU resume entry function */
  28. int __cpu_resume_enter(unsigned long hartid, unsigned long context);
  29. #endif