hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/mips/kernel/kgdb.c
....@@ -208,23 +208,16 @@
208208 ".set\treorder");
209209 }
210210
211
-static void kgdb_call_nmi_hook(void *ignored)
211
+void kgdb_call_nmi_hook(void *ignored)
212212 {
213213 mm_segment_t old_fs;
214214
215215 old_fs = get_fs();
216
- set_fs(get_ds());
216
+ set_fs(KERNEL_DS);
217217
218218 kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
219219
220220 set_fs(old_fs);
221
-}
222
-
223
-void kgdb_roundup_cpus(unsigned long flags)
224
-{
225
- local_irq_enable();
226
- smp_call_function(kgdb_call_nmi_hook, NULL, 0);
227
- local_irq_disable();
228221 }
229222
230223 static int compute_signal(int tt)
....@@ -326,7 +319,7 @@
326319
327320 /* Kernel mode. Set correct address limit */
328321 old_fs = get_fs();
329
- set_fs(get_ds());
322
+ set_fs(KERNEL_DS);
330323
331324 if (atomic_read(&kgdb_active) != -1)
332325 kgdb_nmicallback(smp_processor_id(), regs);
....@@ -395,18 +388,16 @@
395388 return -1;
396389 }
397390
398
-struct kgdb_arch arch_kgdb_ops;
391
+const struct kgdb_arch arch_kgdb_ops = {
392
+#ifdef CONFIG_CPU_BIG_ENDIAN
393
+ .gdb_bpt_instr = { spec_op << 2, 0x00, 0x00, break_op },
394
+#else
395
+ .gdb_bpt_instr = { break_op, 0x00, 0x00, spec_op << 2 },
396
+#endif
397
+};
399398
400399 int kgdb_arch_init(void)
401400 {
402
- union mips_instruction insn = {
403
- .r_format = {
404
- .opcode = spec_op,
405
- .func = break_op,
406
- }
407
- };
408
- memcpy(arch_kgdb_ops.gdb_bpt_instr, insn.byte, BREAK_INSTR_SIZE);
409
-
410401 register_die_notifier(&kgdb_notifier);
411402
412403 return 0;