return EFAULT;
                }
        } else if ((cpu == 0 && (unsigned int)mem >= L1_CODE_START &&
-               (unsigned int)(mem + count) < L1_CODE_START + L1_CODE_LENGTH)
+               (unsigned int)(mem + count) <= L1_CODE_START + L1_CODE_LENGTH)
 #ifdef CONFIG_SMP
                || (cpu == 1 && (unsigned int)mem >= COREB_L1_CODE_START &&
                (unsigned int)(mem + count) <=
 
        if ((cpu == 0 && (unsigned int)addr >= L1_CODE_START
                && (unsigned int)(addr + BREAK_INSTR_SIZE)
-               < L1_CODE_START + L1_CODE_LENGTH)
+               <= L1_CODE_START + L1_CODE_LENGTH)
 #ifdef CONFIG_SMP
                || (cpu == 1 && (unsigned int)addr >= COREB_L1_CODE_START
                && (unsigned int)(addr + BREAK_INSTR_SIZE)
-               < COREB_L1_CODE_START + L1_CODE_LENGTH)
+               <= COREB_L1_CODE_START + L1_CODE_LENGTH)
 #endif
                ) {
                /* access L1 instruction SRAM */
 int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle)
 {
        if ((unsigned int)addr >= L1_CODE_START &&
-               (unsigned int)(addr + BREAK_INSTR_SIZE) <
+               (unsigned int)(addr + BREAK_INSTR_SIZE) <=
                        L1_CODE_START + L1_CODE_LENGTH) {
                /* access L1 instruction SRAM */
                if (dma_memcpy((void *)addr, bundle, BREAK_INSTR_SIZE) == NULL)