Remove hardware breakpoint support from ia64 lite patch. This will be unused
by kgdb until subsequent support is included. Follow up patches will eliminate
hardware breakpoint support from core-lite.patch and other arches; coming
soon.
Signed-off-by: Bob Picco <[EMAIL PROTECTED]>
arch/ia64/kernel/kgdb.c | 187 ------------------------------------------------
1 file changed, 187 deletions(-)
Index: linux-2.6.21-kgdb/arch/ia64/kernel/kgdb.c
===================================================================
--- linux-2.6.21-kgdb.orig/arch/ia64/kernel/kgdb.c 2007-05-10
09:31:22.000000000 -0400
+++ linux-2.6.21-kgdb/arch/ia64/kernel/kgdb.c 2007-05-10 10:17:01.000000000
-0400
@@ -576,190 +576,6 @@ int kgdb_arch_remove_breakpoint(unsigned
return kgdb_set_mem((char *)addr, (char *)bundle, BREAK_INSTR_SIZE);
}
-static int hw_breakpoint_init;
-
-void do_init_hw_break(void)
-{
- s64 status;
- int i;
-
- hw_breakpoint_init = 1;
-
-#ifdef CONFIG_IA64_HP_SIM
- hw_break_total_ibr = 8;
- hw_break_total_dbr = 8;
- status = 0;
-#else
- status = ia64_pal_debug_info(&hw_break_total_ibr, &hw_break_total_dbr);
-#endif
-
- if (status) {
- printk(KERN_INFO "do_init_hw_break: pal call failed %d\n",
- (int)status);
- return;
- }
-
- if (HW_BREAKPOINT > MAX_HW_BREAKPOINT) {
- printk(KERN_INFO "do_init_hw_break: %d exceeds max %d\n",
- (int)HW_BREAKPOINT, (int)MAX_HW_BREAKPOINT);
-
- while ((HW_BREAKPOINT > MAX_HW_BREAKPOINT)
- && hw_break_total_ibr != 1)
- hw_break_total_ibr--;
- while (HW_BREAKPOINT > MAX_HW_BREAKPOINT)
- hw_break_total_dbr--;
- }
-
- breakinfo = hwbreaks;
-
- memset(breakinfo, 0, HW_BREAKPOINT * sizeof(struct hw_breakpoint));
-
- for (i = 0; i < hw_break_total_dbr; i++)
- breakinfo[i].capable = HWCAP_DBR;
-
- for (; i < HW_BREAKPOINT; i++)
- breakinfo[i].capable = HWCAP_IBR;
-
- return;
-}
-
-void kgdb_correct_hw_break(void)
-{
- int breakno;
-
- if (!breakinfo)
- return;
-
- for (breakno = 0; breakno < HW_BREAKPOINT; breakno++) {
- if (breakinfo[breakno].enabled) {
- if (breakinfo[breakno].capable & HWCAP_IBR) {
- int ibreakno = breakno - hw_break_total_dbr;
- ia64_set_ibr(ibreakno << 1,
- breakinfo[breakno].addr);
- ia64_set_ibr((ibreakno << 1) + 1,
- (~breakinfo[breakno].mask &
- ((1UL << 56UL) - 1)) |
- (1UL << 56UL) | (1UL << 63UL));
- } else {
- ia64_set_dbr(breakno << 1,
- breakinfo[breakno].addr);
- ia64_set_dbr((breakno << 1) + 1,
- (~breakinfo[breakno].
- mask & ((1UL << 56UL) - 1)) |
- (1UL << 56UL) |
- (breakinfo[breakno].type << 62UL));
- }
- } else {
- if (breakinfo[breakno].capable & HWCAP_IBR)
- ia64_set_ibr(((breakno -
- hw_break_total_dbr) << 1) + 1,
- 0);
- else
- ia64_set_dbr((breakno << 1) + 1, 0);
- }
- }
-
- return;
-}
-
-int hardware_breakpoint(unsigned long addr, int length, int type, int action)
-{
- int breakno, found, watch;
- unsigned long mask;
- extern unsigned long _start[];
-
- if (!hw_breakpoint_init)
- do_init_hw_break();
-
- if (!breakinfo)
- return 0;
- else if (addr == (unsigned long)_start)
- return 1;
-
- if (type == WATCH_ACCESS)
- mask = HWCAP_DBR;
- else
- mask = 1UL << type;
-
- for (watch = 0, found = 0, breakno = 0; breakno < HW_BREAKPOINT;
- breakno++) {
- if (action) {
- if (breakinfo[breakno].enabled
- || !(breakinfo[breakno].capable & mask))
- continue;
- breakinfo[breakno].enabled = 1;
- breakinfo[breakno].type = type;
- breakinfo[breakno].mask = length - 1;
- breakinfo[breakno].addr = addr;
- watch = breakno;
- } else if (breakinfo[breakno].enabled &&
- ((length < 0 && breakinfo[breakno].addr == addr) ||
- ((breakinfo[breakno].capable & mask) &&
- (breakinfo[breakno].mask == (length - 1)) &&
- (breakinfo[breakno].addr == addr)))) {
- breakinfo[breakno].enabled = 0;
- breakinfo[breakno].type = 0UL;
- } else
- continue;
- found++;
- if (type != WATCH_ACCESS)
- break;
- else if (found == 2)
- break;
- else
- mask = HWCAP_IBR;
- }
-
- if (type == WATCH_ACCESS && found == 1) {
- breakinfo[watch].enabled = 0;
- found = 0;
- }
-
- mb();
- return found;
-}
-
-int kgdb_arch_set_hw_breakpoint(unsigned long addr, int len,
- enum kgdb_bptype type)
-{
- return hardware_breakpoint(addr, len, type - '1', 1);
-}
-
-int kgdb_arch_remove_hw_breakpoint(unsigned long addr, int len,
- enum kgdb_bptype type)
-{
- return hardware_breakpoint(addr, len, type - '1', 0);
-}
-
-int kgdb_remove_hw_break(unsigned long addr)
-{
- return hardware_breakpoint(addr, 8, WATCH_INSTRUCTION, 0);
-
-}
-
-void kgdb_remove_all_hw_break(void)
-{
- int i;
-
- for (i = 0; i < HW_BREAKPOINT; i++)
- memset(&breakinfo[i], 0, sizeof(struct hw_breakpoint));
-}
-
-int kgdb_set_hw_break(unsigned long addr)
-{
- return hardware_breakpoint(addr, 8, WATCH_INSTRUCTION, 1);
-}
-
-void kgdb_disable_hw_debug(struct pt_regs *regs)
-{
- unsigned long hw_breakpoint_status;
-
- hw_breakpoint_status = ia64_getreg(_IA64_REG_PSR);
- if (hw_breakpoint_status & IA64_PSR_DB)
- ia64_setreg(_IA64_REG_PSR_L,
- hw_breakpoint_status ^ IA64_PSR_DB);
-}
-
volatile static struct smp_unw {
struct unw_frame_info *unw;
struct task_struct *task;
@@ -1124,8 +940,5 @@ static void do_kgdb_handle_exception(str
}
struct kgdb_arch arch_kgdb_ops = {
- .set_hw_breakpoint = kgdb_arch_set_hw_breakpoint,
- .remove_hw_breakpoint = kgdb_arch_remove_hw_breakpoint,
.gdb_bpt_instr = {0xcc},
- .flags = KGDB_HW_BREAKPOINT,
};
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport