BREAKPOINT, IRQ_RUNNING(), IRQ_GETSTATE(): New DSP56K macros.
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 15 Mar 2005 00:20:09 +0000 (00:20 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 15 Mar 2005 00:20:09 +0000 (00:20 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@394 38d2e660-2303-0410-9eaa-f027e97ec537

cpu.h

diff --git a/cpu.h b/cpu.h
index a198d7d19cbcf1ab1d800ccc03455bff0d713bf8..2f4086229d6b72e57e6166584e7ebfd70219afbd 100755 (executable)
--- a/cpu.h
+++ b/cpu.h
@@ -17,6 +17,9 @@
 
 /*#*
  *#* $Log$
+ *#* Revision 1.30  2005/03/15 00:20:09  bernie
+ *#* BREAKPOINT, IRQ_RUNNING(), IRQ_GETSTATE(): New DSP56K macros.
+ *#*
  *#* Revision 1.29  2005/02/16 20:33:24  bernie
  *#* Preliminary PPC support.
  *#*
 #elif CPU_DSP56K
 
        #define NOP                     asm(nop)
+       #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)
 
        #define IRQ_RESTORE(x)  \
                do { (void)x; asm(move x,SR); } while (0)
 
+       static inline bool irq_running(void)
+       {
+               extern void *user_sp;
+               return !!user_sp;
+       }
+       #define IRQ_RUNNING() irq_running()
+
+       static inline bool irq_getstate(void)
+       {
+               uint16_t x;
+               asm(move SR,x);
+               return !(x & 0x0200);
+       }
+       #define IRQ_GETSTATE() irq_getstate()
+
+
 
        typedef uint16_t cpuflags_t;
        typedef unsigned int cpustack_t;
 #ifndef CPU_BITS_PER_PTR
 #define CPU_BITS_PER_PTR    (SIZEOF_PTR * CPU_BITS_PER_CHAR)
 #endif
+
+#ifndef BREAKPOINT
+#define BREAKPOINT /* nop */
+#endif
+
 /*\}*/
 
 /* Sanity checks for the above definitions */