aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2008-11-18 04:48:22 -0500
committerBryan Wu <cooloney@kernel.org>2008-11-18 04:48:22 -0500
commit89c6c139a57e27617850ddc7df90e267374a1a5c (patch)
tree5157a001ba89cec67c953da495fb7a50f05dd0f9
parent09c1db922dd5b41e6421a5a7a94c1282ee881e81 (diff)
Blackfin arch: fix off-by-one errors on end of memory range
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/kernel/kgdb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c
index a895927fcc30..2af3a886c145 100644
--- a/arch/blackfin/kernel/kgdb.c
+++ b/arch/blackfin/kernel/kgdb.c
@@ -643,7 +643,7 @@ int kgdb_ebin2mem(char *buf, char *mem, int count)
643 return EFAULT; 643 return EFAULT;
644 } 644 }
645 } else if ((cpu == 0 && (unsigned int)mem >= L1_CODE_START && 645 } else if ((cpu == 0 && (unsigned int)mem >= L1_CODE_START &&
646 (unsigned int)(mem + count) < L1_CODE_START + L1_CODE_LENGTH) 646 (unsigned int)(mem + count) <= L1_CODE_START + L1_CODE_LENGTH)
647#ifdef CONFIG_SMP 647#ifdef CONFIG_SMP
648 || (cpu == 1 && (unsigned int)mem >= COREB_L1_CODE_START && 648 || (cpu == 1 && (unsigned int)mem >= COREB_L1_CODE_START &&
649 (unsigned int)(mem + count) <= 649 (unsigned int)(mem + count) <=
@@ -758,11 +758,11 @@ int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr)
758 758
759 if ((cpu == 0 && (unsigned int)addr >= L1_CODE_START 759 if ((cpu == 0 && (unsigned int)addr >= L1_CODE_START
760 && (unsigned int)(addr + BREAK_INSTR_SIZE) 760 && (unsigned int)(addr + BREAK_INSTR_SIZE)
761 < L1_CODE_START + L1_CODE_LENGTH) 761 <= L1_CODE_START + L1_CODE_LENGTH)
762#ifdef CONFIG_SMP 762#ifdef CONFIG_SMP
763 || (cpu == 1 && (unsigned int)addr >= COREB_L1_CODE_START 763 || (cpu == 1 && (unsigned int)addr >= COREB_L1_CODE_START
764 && (unsigned int)(addr + BREAK_INSTR_SIZE) 764 && (unsigned int)(addr + BREAK_INSTR_SIZE)
765 < COREB_L1_CODE_START + L1_CODE_LENGTH) 765 <= COREB_L1_CODE_START + L1_CODE_LENGTH)
766#endif 766#endif
767 ) { 767 ) {
768 /* access L1 instruction SRAM */ 768 /* access L1 instruction SRAM */
@@ -789,7 +789,7 @@ int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr)
789int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle) 789int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle)
790{ 790{
791 if ((unsigned int)addr >= L1_CODE_START && 791 if ((unsigned int)addr >= L1_CODE_START &&
792 (unsigned int)(addr + BREAK_INSTR_SIZE) < 792 (unsigned int)(addr + BREAK_INSTR_SIZE) <=
793 L1_CODE_START + L1_CODE_LENGTH) { 793 L1_CODE_START + L1_CODE_LENGTH) {
794 /* access L1 instruction SRAM */ 794 /* access L1 instruction SRAM */
795 if (dma_memcpy((void *)addr, bundle, BREAK_INSTR_SIZE) == NULL) 795 if (dma_memcpy((void *)addr, bundle, BREAK_INSTR_SIZE) == NULL)