Explicit dependancy between CONFIG_KERN_PREEMPT and CONFIG_KERN.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 28 May 2010 16:20:16 +0000 (16:20 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 28 May 2010 16:20:16 +0000 (16:20 +0000)
This will disable the kernel related macros whem kernel is not enabled.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3880 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cfg/os.h
bertos/cpu/cortex-m3/hw/init_cm3.c
bertos/cpu/irq.h
bertos/drv/dc_motor.c
bertos/kern/proc_p.h

index 2089cc4fc1e977b69333b09ce7214a9d1339d12f..2e393599df04aa7a18dfb1b1a5604ca3c90c33fe 100644 (file)
                sigismember(&sigs__, SIGALRM) ? false : true; \
         })
 
-       #if CONFIG_KERN_PREEMPT
+       #if (CONFIG_KERN && CONFIG_KERN_PREEMPT)
                #define DECLARE_ISR_CONTEXT_SWITCH(vect)        \
                        void vect(UNUSED_ARG(int, arg));        \
                        INLINE void __isr_##vect(void);         \
index 079f08a31728acfd35feff4b0f11a8a895b3792d..8415cbfb089083d224b7231e13dec3e88ca0caae 100644 (file)
@@ -93,7 +93,7 @@ void __init2(void)
        /* Initialize IRQ vector table in RAM */
        sysirq_init();
 
-#if CONFIG_KERN_PREEMPT
+#if (CONFIG_KERN && CONFIG_KERN_PREEMPT)
        /*
         * Voluntary context switch handler.
         *
index 6eac70fdea50424752119224ac1165fc794f3a50..153f7861d2ba2d896fa02680c12461562ff853dc 100644 (file)
        }
        #define IRQ_RUNNING() irq_running()
 
-       #if CONFIG_KERN_PREEMPT
+       #if (CONFIG_KERN && CONFIG_KERN_PREEMPT)
 
                #define DECLARE_ISR_CONTEXT_SWITCH(func)                \
                void func(void);                                        \
 
                #define IRQ_ENABLED() ((CPU_READ_FLAGS() & 0xc0) != 0xc0)
 
-               #if CONFIG_KERN_PREEMPT
+               #if (CONFIG_KERN && CONFIG_KERN_PREEMPT)
                        EXTERN_C void asm_irq_switch_context(void);
 
                        /**
                ); \
                (bool)(sreg & 0x80); \
        })
-       #if CONFIG_KERN_PREEMPT
+       #if (CONFIG_KERN && CONFIG_KERN_PREEMPT)
                #define DECLARE_ISR_CONTEXT_SWITCH(vect)                \
                        INLINE void __isr_##vect(void);                 \
                        ISR(vect)                                       \
 
 
 #ifndef IRQ_PREEMPT_HANDLER
-       #if CONFIG_KERN_PREEMPT
+       #if (CONFIG_KERN && CONFIG_KERN_PREEMPT)
                /**
                 * Handle preemptive context switch inside timer IRQ.
                 */
index 13d8b769aaca72a9def91ff69382eb3c849298e7..75a05f3445d34aaf0b3fc02959b54332619aa83d 100644 (file)
@@ -82,7 +82,7 @@
 #define DC_MOTOR_SET_STATUS_DIR(status, dir) \
                (dir == POS_DIR ? DC_MOTOR_POS_DIR(status) : DC_MOTOR_NEG_DIR(status))
 
-#if CONFIG_KERN_PREEMPT
+#if (CONFIG_KERN && CONFIG_KERN_PREEMPT)
        #if CONFIG_DC_MOTOR_USE_SEM
                #include <kern/sem.h>
 
index 64fabb1290fef6052231bf3e682fb9c8a4830f49..5469dfcdf0408c5d63ef6e13bdbfe6dd4286dbad 100644 (file)
@@ -181,7 +181,12 @@ void proc_schedInit(void);
        void monitor_rename(Process *proc, const char *name);
 #endif /* CONFIG_KERN_MONITOR */
 
-#if CONFIG_KERN_PREEMPT
+/*
+ * Quantum related macros are used in the
+ * timer module and must be empty when
+ * kernel is disabled.
+ */
+#if (CONFIG_KERN && CONFIG_KERN_PREEMPT)
 INLINE int preempt_quantum(void)
 {
        extern int _proc_quantum;
@@ -200,7 +205,7 @@ INLINE void preempt_reset_quantum(void)
        extern int _proc_quantum;
        _proc_quantum = CONFIG_KERN_QUANTUM;
 }
-#else /* !CONFIG_KERN_PREEMPT */
+#else /* !(CONFIG_KERN && CONFIG_KERN_PREEMPT) */
 INLINE int preempt_quantum(void)
 {
        return 0;
@@ -213,6 +218,6 @@ INLINE void proc_decQuantum(void)
 INLINE void preempt_reset_quantum(void)
 {
 }
-#endif /* CONFIG_KERN_PREEMPT */
+#endif /* (CONFIG_KERN && CONFIG_KERN_PREEMPT) */
 
 #endif /* KERN_PROC_P_H */