forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-16 50a212ec906f7524620675f0c57357691c26c81f
kernel/arch/xtensa/kernel/hw_breakpoint.c
....@@ -12,7 +12,7 @@
1212 #include <linux/log2.h>
1313 #include <linux/percpu.h>
1414 #include <linux/perf_event.h>
15
-#include <variant/core.h>
15
+#include <asm/core.h>
1616
1717 /* Breakpoint currently in use for each IBREAKA. */
1818 static DEFINE_PER_CPU(struct perf_event *, bp_on_reg[XCHAL_NUM_IBREAK]);
....@@ -101,30 +101,30 @@
101101 switch (sr) {
102102 #if XCHAL_NUM_IBREAK > 0
103103 case SREG_IBREAKA + 0:
104
- WSR(v, SREG_IBREAKA + 0);
104
+ xtensa_set_sr(v, SREG_IBREAKA + 0);
105105 break;
106106 #endif
107107 #if XCHAL_NUM_IBREAK > 1
108108 case SREG_IBREAKA + 1:
109
- WSR(v, SREG_IBREAKA + 1);
109
+ xtensa_set_sr(v, SREG_IBREAKA + 1);
110110 break;
111111 #endif
112112
113113 #if XCHAL_NUM_DBREAK > 0
114114 case SREG_DBREAKA + 0:
115
- WSR(v, SREG_DBREAKA + 0);
115
+ xtensa_set_sr(v, SREG_DBREAKA + 0);
116116 break;
117117 case SREG_DBREAKC + 0:
118
- WSR(v, SREG_DBREAKC + 0);
118
+ xtensa_set_sr(v, SREG_DBREAKC + 0);
119119 break;
120120 #endif
121121 #if XCHAL_NUM_DBREAK > 1
122122 case SREG_DBREAKA + 1:
123
- WSR(v, SREG_DBREAKA + 1);
123
+ xtensa_set_sr(v, SREG_DBREAKA + 1);
124124 break;
125125
126126 case SREG_DBREAKC + 1:
127
- WSR(v, SREG_DBREAKC + 1);
127
+ xtensa_set_sr(v, SREG_DBREAKC + 1);
128128 break;
129129 #endif
130130 }
....@@ -150,8 +150,8 @@
150150 unsigned long ibreakenable;
151151
152152 xtensa_wsr(info->address, SREG_IBREAKA + reg);
153
- RSR(ibreakenable, SREG_IBREAKENABLE);
154
- WSR(ibreakenable | (1 << reg), SREG_IBREAKENABLE);
153
+ ibreakenable = xtensa_get_sr(SREG_IBREAKENABLE);
154
+ xtensa_set_sr(ibreakenable | (1 << reg), SREG_IBREAKENABLE);
155155 }
156156
157157 static void set_dbreak_regs(int reg, struct perf_event *bp)
....@@ -214,8 +214,9 @@
214214 /* Breakpoint */
215215 i = free_slot(this_cpu_ptr(bp_on_reg), XCHAL_NUM_IBREAK, bp);
216216 if (i >= 0) {
217
- RSR(ibreakenable, SREG_IBREAKENABLE);
218
- WSR(ibreakenable & ~(1 << i), SREG_IBREAKENABLE);
217
+ ibreakenable = xtensa_get_sr(SREG_IBREAKENABLE);
218
+ xtensa_set_sr(ibreakenable & ~(1 << i),
219
+ SREG_IBREAKENABLE);
219220 }
220221 } else {
221222 /* Watchpoint */