~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/misc/kgdbts.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
285
285
static int check_and_rewind_pc(char *put_str, char *arg)
286
286
{
287
287
        unsigned long addr = lookup_addr(arg);
 
288
        unsigned long ip;
288
289
        int offset = 0;
289
290
 
290
291
        kgdb_hex2mem(&put_str[1], (char *)kgdbts_gdb_regs,
291
292
                 NUMREGBYTES);
292
293
        gdb_regs_to_pt_regs(kgdbts_gdb_regs, &kgdbts_regs);
293
 
        v2printk("Stopped at IP: %lx\n", instruction_pointer(&kgdbts_regs));
294
 
#ifdef CONFIG_X86
295
 
        /* On x86 a breakpoint stop requires it to be decremented */
296
 
        if (addr + 1 == kgdbts_regs.ip)
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;
 
294
        ip = instruction_pointer(&kgdbts_regs);
 
295
        v2printk("Stopped at IP: %lx\n", ip);
 
296
#ifdef GDB_ADJUSTS_BREAK_OFFSET
 
297
        /* On some arches, a breakpoint stop requires it to be decremented */
 
298
        if (addr + BREAK_INSTR_SIZE == ip)
 
299
                offset = -BREAK_INSTR_SIZE;
302
300
#endif
303
 
        if (strcmp(arg, "silent") &&
304
 
                instruction_pointer(&kgdbts_regs) + offset != addr) {
 
301
        if (strcmp(arg, "silent") && ip + offset != addr) {
305
302
                eprintk("kgdbts: BP mismatch %lx expected %lx\n",
306
 
                           instruction_pointer(&kgdbts_regs) + offset, addr);
 
303
                           ip + offset, addr);
307
304
                return 1;
308
305
        }
309
 
#ifdef CONFIG_X86
310
 
        /* On x86 adjust the instruction pointer if needed */
311
 
        kgdbts_regs.ip += offset;
312
 
#elif defined(CONFIG_SUPERH)
313
 
        kgdbts_regs.pc += offset;
 
306
        /* Readjust the instruction pointer if needed */
 
307
        ip += offset;
 
308
#ifdef GDB_ADJUSTS_BREAK_OFFSET
 
309
        instruction_pointer_set(&kgdbts_regs, ip);
314
310
#endif
315
311
        return 0;
316
312
}