Skip to content

Commit 0def12f

Browse files
Sia Jee Hengpalmer-dabbelt
authored andcommitted
RISC-V: Change suspend_save_csrs and suspend_restore_csrs to public function
Currently suspend_save_csrs() and suspend_restore_csrs() functions are statically defined in the suspend.c. Change the function's attribute to public so that the functions can be used by hibernation as well. Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com> Reviewed-by: Ley Foon Tan <leyfoon.tan@starfivetech.com> Reviewed-by: Mason Huo <mason.huo@starfivetech.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Link: https://lore.kernel.org/r/20230330064321.1008373-2-jeeheng.sia@starfivetech.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent fe15c26 commit 0def12f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

arch/riscv/include/asm/suspend.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ int cpu_suspend(unsigned long arg,
3333
/* Low-level CPU resume entry function */
3434
int __cpu_resume_enter(unsigned long hartid, unsigned long context);
3535

36+
/* Used to save and restore the CSRs */
37+
void suspend_save_csrs(struct suspend_context *context);
38+
void suspend_restore_csrs(struct suspend_context *context);
3639
#endif

arch/riscv/kernel/suspend.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <asm/csr.h>
99
#include <asm/suspend.h>
1010

11-
static void suspend_save_csrs(struct suspend_context *context)
11+
void suspend_save_csrs(struct suspend_context *context)
1212
{
1313
context->scratch = csr_read(CSR_SCRATCH);
1414
context->tvec = csr_read(CSR_TVEC);
@@ -29,7 +29,7 @@ static void suspend_save_csrs(struct suspend_context *context)
2929
#endif
3030
}
3131

32-
static void suspend_restore_csrs(struct suspend_context *context)
32+
void suspend_restore_csrs(struct suspend_context *context)
3333
{
3434
csr_write(CSR_SCRATCH, context->scratch);
3535
csr_write(CSR_TVEC, context->tvec);

0 commit comments

Comments
 (0)