]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/blackfin/kernel/kgdb.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus
[linux-2.6-omap-h63xx.git] / arch / blackfin / kernel / kgdb.c
index 62c3032d843e4b1a3aa683df1547d5bfe191657e..b163f6d3330d4e0a9317ee116171f9718b5fd45d 100644 (file)
@@ -37,7 +37,7 @@ int gdb_bfin_vector = -1;
 #define IN_MEM(addr, size, l1_addr, l1_size) \
 ({ \
        unsigned long __addr = (unsigned long)(addr); \
-       (__addr >= l1_addr && __addr + (size) <= l1_addr + l1_size); \
+       (l1_size && __addr >= l1_addr && __addr + (size) <= l1_addr + l1_size); \
 })
 #define ASYNC_BANK_SIZE \
        (ASYNC_BANK0_SIZE + ASYNC_BANK1_SIZE + \
@@ -110,7 +110,7 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
  * Extracts ebp, esp and eip values understandable by gdb from the values
  * saved by switch_to.
  * thread.esp points to ebp. flags and ebp are pushed in switch_to hence esp
- * prior to entering switch_to is 8 greater then the value that is saved.
+ * prior to entering switch_to is 8 greater than the value that is saved.
  * If switch_to changes, change following code appropriately.
  */
 void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
@@ -495,10 +495,8 @@ static int validate_memory_access_address(unsigned long addr, int size)
 #endif
        }
 
-#if L2_LENGTH
        if (IN_MEM(addr, size, L2_START, L2_LENGTH))
                return 0;
-#endif
 
        return EFAULT;
 }
@@ -714,10 +712,8 @@ int kgdb_validate_break_address(unsigned long addr)
        else if (cpu == 1 && IN_MEM(addr, BREAK_INSTR_SIZE, COREB_L1_CODE_START, L1_CODE_LENGTH))
                return 0;
 #endif
-#if L2_LENGTH
        if (IN_MEM(addr, BREAK_INSTR_SIZE, L2_START, L2_LENGTH))
                return 0;
-#endif
 
        return EFAULT;
 }