File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ struct suspend_context {
18
18
unsigned long ie ;
19
19
#ifdef CONFIG_MMU
20
20
unsigned long satp ;
21
+ unsigned long stimecmp ;
22
+ #if __riscv_xlen < 64
23
+ unsigned long stimecmph ;
24
+ #endif
21
25
#endif
22
26
};
23
27
Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ void suspend_save_csrs(struct suspend_context *context)
30
30
*/
31
31
32
32
#ifdef CONFIG_MMU
33
+ if (riscv_has_extension_unlikely (RISCV_ISA_EXT_SSTC )) {
34
+ context -> stimecmp = csr_read (CSR_STIMECMP );
35
+ #if __riscv_xlen < 64
36
+ context -> stimecmph = csr_read (CSR_STIMECMPH );
37
+ #endif
38
+ }
39
+
33
40
context -> satp = csr_read (CSR_SATP );
34
41
#endif
35
42
}
@@ -43,6 +50,13 @@ void suspend_restore_csrs(struct suspend_context *context)
43
50
csr_write (CSR_IE , context -> ie );
44
51
45
52
#ifdef CONFIG_MMU
53
+ if (riscv_has_extension_unlikely (RISCV_ISA_EXT_SSTC )) {
54
+ csr_write (CSR_STIMECMP , context -> stimecmp );
55
+ #if __riscv_xlen < 64
56
+ csr_write (CSR_STIMECMPH , context -> stimecmph );
57
+ #endif
58
+ }
59
+
46
60
csr_write (CSR_SATP , context -> satp );
47
61
#endif
48
62
}
You can’t perform that action at this time.
0 commit comments