Skip to content

Commit 98ec187

Browse files
committed
kgdb: remove post_primary_code references
Remove all the references to the kgdb_post_primary_code. This function serves no useful purpose because you can obtain the same information from the "struct kgdb_state *ks" from with in the debugger, if for some reason you want the data. Also remove the unintentional duplicate assignment for ks->ex_vector. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent 84c08fd commit 98ec187

3 files changed

Lines changed: 0 additions & 51 deletions

File tree

arch/x86/kernel/kgdb.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,8 @@
4747
#include <asm/debugreg.h>
4848
#include <asm/apicdef.h>
4949
#include <asm/system.h>
50-
5150
#include <asm/apic.h>
5251

53-
/*
54-
* Put the error code here just in case the user cares:
55-
*/
56-
static int gdb_x86errcode;
57-
58-
/*
59-
* Likewise, the vector number here (since GDB only gets the signal
60-
* number through the usual means, and that's not very specific):
61-
*/
62-
static int gdb_x86vector = -1;
63-
6452
/**
6553
* pt_regs_to_gdb_regs - Convert ptrace regs to GDB regs
6654
* @gdb_regs: A pointer to hold the registers in the order GDB wants.
@@ -399,23 +387,6 @@ void kgdb_disable_hw_debug(struct pt_regs *regs)
399387
}
400388
}
401389

402-
/**
403-
* kgdb_post_primary_code - Save error vector/code numbers.
404-
* @regs: Original pt_regs.
405-
* @e_vector: Original error vector.
406-
* @err_code: Original error code.
407-
*
408-
* This is needed on architectures which support SMP and KGDB.
409-
* This function is called after all the slave cpus have been put
410-
* to a know spin state and the primary CPU has control over KGDB.
411-
*/
412-
void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
413-
{
414-
/* primary processor is completely in the debugger */
415-
gdb_x86vector = e_vector;
416-
gdb_x86errcode = err_code;
417-
}
418-
419390
#ifdef CONFIG_SMP
420391
/**
421392
* kgdb_roundup_cpus - Get other CPUs into a holding pattern

include/linux/kgdb.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,6 @@ struct pt_regs;
3535
*/
3636
extern int kgdb_skipexception(int exception, struct pt_regs *regs);
3737

38-
/**
39-
* kgdb_post_primary_code - (optional) Save error vector/code numbers.
40-
* @regs: Original pt_regs.
41-
* @e_vector: Original error vector.
42-
* @err_code: Original error code.
43-
*
44-
* This is usually needed on architectures which support SMP and
45-
* KGDB. This function is called after all the secondary cpus have
46-
* been put to a know spin state and the primary CPU has control over
47-
* KGDB.
48-
*/
49-
extern void kgdb_post_primary_code(struct pt_regs *regs, int e_vector,
50-
int err_code);
51-
5238
/**
5339
* kgdb_disable_hw_debug - (optional) Disable hardware debugging hook
5440
* @regs: Current &struct pt_regs.

kernel/debug/debug_core.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,6 @@ int __weak kgdb_skipexception(int exception, struct pt_regs *regs)
203203
return 0;
204204
}
205205

206-
void __weak
207-
kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
208-
{
209-
return;
210-
}
211-
212206
/**
213207
* kgdb_disable_hw_debug - Disable hardware debugging while we in kgdb.
214208
* @regs: Current &struct pt_regs.
@@ -588,7 +582,6 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
588582
* At this point the primary processor is completely
589583
* in the debugger and all secondary CPUs are quiescent
590584
*/
591-
kgdb_post_primary_code(ks->linux_regs, ks->ex_vector, ks->err_code);
592585
dbg_deactivate_sw_breakpoints();
593586
kgdb_single_step = 0;
594587
kgdb_contthread = current;
@@ -678,7 +671,6 @@ kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs *regs)
678671
ks->cpu = raw_smp_processor_id();
679672
ks->ex_vector = evector;
680673
ks->signo = signo;
681-
ks->ex_vector = evector;
682674
ks->err_code = ecode;
683675
ks->kgdb_usethreadid = 0;
684676
ks->linux_regs = regs;

0 commit comments

Comments
 (0)