diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/misc/kgdbts.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/misc/kgdbts.c')
-rw-r--r-- | drivers/misc/kgdbts.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c index e4ff50b95a5e..72450237a0f4 100644 --- a/drivers/misc/kgdbts.c +++ b/drivers/misc/kgdbts.c | |||
@@ -295,6 +295,10 @@ static int check_and_rewind_pc(char *put_str, char *arg) | |||
295 | /* On x86 a breakpoint stop requires it to be decremented */ | 295 | /* On x86 a breakpoint stop requires it to be decremented */ |
296 | if (addr + 1 == kgdbts_regs.ip) | 296 | if (addr + 1 == kgdbts_regs.ip) |
297 | offset = -1; | 297 | offset = -1; |
298 | #elif defined(CONFIG_SUPERH) | ||
299 | /* On SUPERH a breakpoint stop requires it to be decremented */ | ||
300 | if (addr + 2 == kgdbts_regs.pc) | ||
301 | offset = -2; | ||
298 | #endif | 302 | #endif |
299 | if (strcmp(arg, "silent") && | 303 | if (strcmp(arg, "silent") && |
300 | instruction_pointer(&kgdbts_regs) + offset != addr) { | 304 | instruction_pointer(&kgdbts_regs) + offset != addr) { |
@@ -305,6 +309,8 @@ static int check_and_rewind_pc(char *put_str, char *arg) | |||
305 | #ifdef CONFIG_X86 | 309 | #ifdef CONFIG_X86 |
306 | /* On x86 adjust the instruction pointer if needed */ | 310 | /* On x86 adjust the instruction pointer if needed */ |
307 | kgdbts_regs.ip += offset; | 311 | kgdbts_regs.ip += offset; |
312 | #elif defined(CONFIG_SUPERH) | ||
313 | kgdbts_regs.pc += offset; | ||
308 | #endif | 314 | #endif |
309 | return 0; | 315 | return 0; |
310 | } | 316 | } |
@@ -712,6 +718,12 @@ static int run_simple_test(int is_get_char, int chr) | |||
712 | 718 | ||
713 | /* End of packet == #XX so look for the '#' */ | 719 | /* End of packet == #XX so look for the '#' */ |
714 | if (put_buf_cnt > 3 && put_buf[put_buf_cnt - 3] == '#') { | 720 | if (put_buf_cnt > 3 && put_buf[put_buf_cnt - 3] == '#') { |
721 | if (put_buf_cnt >= BUFMAX) { | ||
722 | eprintk("kgdbts: ERROR: put buffer overflow on" | ||
723 | " '%s' line %i\n", ts.name, ts.idx); | ||
724 | put_buf_cnt = 0; | ||
725 | return 0; | ||
726 | } | ||
715 | put_buf[put_buf_cnt] = '\0'; | 727 | put_buf[put_buf_cnt] = '\0'; |
716 | v2printk("put%i: %s\n", ts.idx, put_buf); | 728 | v2printk("put%i: %s\n", ts.idx, put_buf); |
717 | /* Trigger check here */ | 729 | /* Trigger check here */ |
@@ -885,16 +897,16 @@ static void kgdbts_run_tests(void) | |||
885 | int nmi_sleep = 0; | 897 | int nmi_sleep = 0; |
886 | int i; | 898 | int i; |
887 | 899 | ||
888 | ptr = strstr(config, "F"); | 900 | ptr = strchr(config, 'F'); |
889 | if (ptr) | 901 | if (ptr) |
890 | fork_test = simple_strtol(ptr + 1, NULL, 10); | 902 | fork_test = simple_strtol(ptr + 1, NULL, 10); |
891 | ptr = strstr(config, "S"); | 903 | ptr = strchr(config, 'S'); |
892 | if (ptr) | 904 | if (ptr) |
893 | do_sys_open_test = simple_strtol(ptr + 1, NULL, 10); | 905 | do_sys_open_test = simple_strtol(ptr + 1, NULL, 10); |
894 | ptr = strstr(config, "N"); | 906 | ptr = strchr(config, 'N'); |
895 | if (ptr) | 907 | if (ptr) |
896 | nmi_sleep = simple_strtol(ptr+1, NULL, 10); | 908 | nmi_sleep = simple_strtol(ptr+1, NULL, 10); |
897 | ptr = strstr(config, "I"); | 909 | ptr = strchr(config, 'I'); |
898 | if (ptr) | 910 | if (ptr) |
899 | sstep_test = simple_strtol(ptr+1, NULL, 10); | 911 | sstep_test = simple_strtol(ptr+1, NULL, 10); |
900 | 912 | ||