From: bernie Date: Sat, 23 Aug 2008 07:40:14 +0000 (+0000) Subject: BREAKPOINT: move from cpu/irq.h to cpu/attr.h X-Git-Tag: 2.0.0~257 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=e6339d49f97766bd1825d6f07ec44ec864d5ebfe;p=bertos.git BREAKPOINT: move from cpu/irq.h to cpu/attr.h git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1677 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cpu/attr.h b/bertos/cpu/attr.h index 02c745e5..28274a71 100644 --- a/bertos/cpu/attr.h +++ b/bertos/cpu/attr.h @@ -28,7 +28,6 @@ * * Copyright 2004, 2005, 2006, 2007, 2008 Develer S.r.l. (http://www.develer.com/) * Copyright 2004 Giovanni Bajo - * * --> * * \brief CPU-specific attributes. @@ -75,8 +74,6 @@ #elif CPU_X86 - #define NOP asm volatile ("nop") - #define CPU_REGS_CNT 7 #define CPU_BYTE_ORDER CPU_LITTLE_ENDIAN #define CPU_HARVARD 0 @@ -93,7 +90,12 @@ #endif /// Valid pointers should be >= than this value (used for debug) - #define CPU_RAM_START 0x1000 + #define CPU_RAM_START 0x1000 + + #ifdef __GNUC__ + #define NOP asm volatile ("nop") + #define BREAKPOINT asm volatile ("int 3" ::) + #endif #elif CPU_ARM @@ -121,6 +123,7 @@ #endif #define NOP asm volatile ("mov r0,r0" ::) + #define BREAKPOINT /* asm("bkpt 0") DOES NOT WORK */ #if CONFIG_FAST_MEM /** @@ -154,19 +157,20 @@ #elif CPU_PPC - #define NOP asm volatile ("nop" ::) - #define CPU_REG_BITS (CPU_PPC32 ? 32 : 64) #define CPU_REGS_CNT FIXME #define CPU_BYTE_ORDER (__BIG_ENDIAN__ ? CPU_BIG_ENDIAN : CPU_LITTLE_ENDIAN) #define CPU_HARVARD 0 /// Valid pointers should be >= than this value (used for debug) - #define CPU_RAM_START 0x1000 + #define CPU_RAM_START 0x1000 -#elif CPU_DSP56K + #ifdef __GNUC__ + #define NOP asm volatile ("nop" ::) + #define BREAKPOINT asm volatile ("twge 2,2" ::) + #endif - #define NOP asm(nop) +#elif CPU_DSP56K #define CPU_REG_BITS 16 #define CPU_REGS_CNT FIXME @@ -181,7 +185,10 @@ #define SIZEOF_PTR 1 /// Valid pointers should be >= than this value (used for debug) - #define CPU_RAM_START 0x200 + #define CPU_RAM_START 0x200 + + #define NOP asm(nop) + #define BREAKPOINT asm(debug) #elif CPU_AVR @@ -193,12 +200,16 @@ #define CPU_HARVARD 1 /// Valid pointers should be >= than this value (used for debug) - #define CPU_RAM_START 0x100 + #define CPU_RAM_START 0x100 #else #error No CPU_... defined. #endif +#ifndef BREAKPOINT +#define BREAKPOINT /* nop */ +#endif + #ifndef FAST_FUNC /// Function attribute for use with performance critical code. #define FAST_FUNC /* */ diff --git a/bertos/cpu/irq.h b/bertos/cpu/irq.h index f47d7082..22d11e1f 100644 --- a/bertos/cpu/irq.h +++ b/bertos/cpu/irq.h @@ -60,9 +60,6 @@ #define IRQ_RESTORE(x) FIXME #endif /* OS_EMBEDDED */ - #ifdef __GNUC__ - #define BREAKPOINT asm volatile ("int 3" ::) - #endif #elif CPU_ARM @@ -96,8 +93,6 @@ #define IRQ_ENABLED() \ ((bool)(get_CPSR() & 0xb0)) - #define BREAKPOINT /* asm("bkpt 0") DOES NOT WORK */ - #else /* !__IAR_SYSTEMS_ICC__ */ #define IRQ_DISABLE \ @@ -168,13 +163,8 @@ #define IRQ_ENABLED() FIXME #endif /* OS_EMBEDDED */ - #ifdef __GNUC__ - #define BREAKPOINT asm volatile ("twge 2,2" ::) - #endif - #elif CPU_DSP56K - #define BREAKPOINT asm(debug) #define IRQ_DISABLE do { asm(bfset #0x0200,SR); asm(nop); } while (0) #define IRQ_ENABLE do { asm(bfclr #0x0200,SR); asm(nop); } while (0) @@ -280,9 +270,5 @@ } while (0) -#ifndef BREAKPOINT -#define BREAKPOINT /* nop */ -#endif - #endif /* CPU_IRQ_H */ diff --git a/bertos/drv/kdebug.c b/bertos/drv/kdebug.c index d929bbbf..7e5eaaa7 100644 --- a/bertos/drv/kdebug.c +++ b/bertos/drv/kdebug.c @@ -28,7 +28,6 @@ * * Copyright 2003, 2004, 2005, 2006, 2007 Develer S.r.l. (http://www.develer.com/) * Copyright 2000, 2001, 2002 Bernie Innocenti - * * --> * * \brief General pourpose debug support for embedded systems (implementation). @@ -43,7 +42,6 @@ #include #include -#include #include #include