projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
preempt: Cleanup
[bertos.git]
/
bertos
/
drv
/
timer.c
diff --git
a/bertos/drv/timer.c
b/bertos/drv/timer.c
index fe5ab89de35a6400ed89946862a9e82dcd30d6e3..485cc0229d2192796b6c2cfe2d1ae630654a9984 100644
(file)
--- a/
bertos/drv/timer.c
+++ b/
bertos/drv/timer.c
@@
-27,8
+27,7
@@
* the GNU General Public License.
*
* Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)
* the GNU General Public License.
*
* Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2000 Bernie Innocenti <bernie@codewiz.org>
- *
+ * Copyright 2000, 2008 Bernie Innocenti <bernie@codewiz.org>
* -->
*
* \brief Hardware independent timer driver (implementation)
* -->
*
* \brief Hardware independent timer driver (implementation)
@@
-55,7
+54,8
@@
* Try the CPU specific one for bare-metal environments.
*/
#if OS_HOSTED
* Try the CPU specific one for bare-metal environments.
*/
#if OS_HOSTED
- #include OS_CSOURCE(timer)
+ //#include OS_CSOURCE(timer)
+ #include <emul/timer_posix.c>
#else
#include CPU_CSOURCE(timer)
#endif
#else
#include CPU_CSOURCE(timer)
#endif
@@
-75,9
+75,6
@@
#endif
#if CONFIG_KERNEL
#endif
#if CONFIG_KERNEL
- #if CONFIG_KERN_PREEMPTIVE
- #include <hw/switch.h>
- #endif
#if CONFIG_KERN_SIGNALS
#include <kern/signal.h> /* sig_wait(), sig_check() */
#include <kern/proc.h> /* proc_current() */
#if CONFIG_KERN_SIGNALS
#include <kern/signal.h> /* sig_wait(), sig_check() */
#include <kern/proc.h> /* proc_current() */
@@
-107,7
+104,7
@@
volatile ticks_t _clock;
volatile ticks_t _clock;
-#if
ndef CONFIG_TIMER_DISABLE
_EVENTS
+#if
CONFIG_TIMER
_EVENTS
/**
* List of active asynchronous timers.
/**
* List of active asynchronous timers.
@@
-176,7
+173,7
@@
Timer *timer_abort(Timer *timer)
return timer;
}
return timer;
}
-#endif /* CONFIG_TIMER_
DISABLE_
EVENTS */
+#endif /* CONFIG_TIMER_EVENTS */
/**
/**
@@
-184,17
+181,14
@@
Timer *timer_abort(Timer *timer)
*/
void timer_delayTicks(ticks_t delay)
{
*/
void timer_delayTicks(ticks_t delay)
{
-#if defined(IRQ_ENABLED) && (!(ARCH & ARCH_EMUL))
/* We shouldn't sleep with interrupts disabled */
/* We shouldn't sleep with interrupts disabled */
- ASSERT(IRQ_ENABLED());
-#endif
-
+ ASSERT_IRQ_ENABLED();
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
Timer t;
ASSERT(!sig_check(SIG_SINGLE));
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
Timer t;
ASSERT(!sig_check(SIG_SINGLE));
- timer_set
_event_s
ignal(&t, proc_current(), SIG_SINGLE);
+ timer_set
S
ignal(&t, proc_current(), SIG_SINGLE);
timer_setDelay(&t, delay);
timer_add(&t);
sig_wait(SIG_SINGLE);
timer_setDelay(&t, delay);
timer_add(&t);
sig_wait(SIG_SINGLE);
@@
-215,7
+209,7
@@
void timer_delayTicks(ticks_t delay)
}
}
-#if
ndef CONFIG_TIMER_DISABLE
_UDELAY
+#if
CONFIG_TIMER
_UDELAY
/**
* Busy wait until the specified amount of high-precision ticks have elapsed.
/**
* Busy wait until the specified amount of high-precision ticks have elapsed.
@@
-261,7
+255,7
@@
void timer_delayHp(hptime_t delay)
timer_busyWait(delay);
}
timer_busyWait(delay);
}
-#endif /* CONFIG_TIMER_
DISABLE_
UDELAY */
+#endif /* CONFIG_TIMER_UDELAY */
/**
/**
@@
-279,9
+273,10
@@
DEFINE_TIMER_ISR
#pragma interrupt saveall
#endif
#pragma interrupt saveall
#endif
-#if
ndef CONFIG_TIMER_DISABLE
_EVENTS
+#if
CONFIG_TIMER
_EVENTS
Timer *timer;
#endif
Timer *timer;
#endif
+
/*
* On systems sharing IRQ line and vector, this check is needed
* to ensure that IRQ is generated by timer source.
/*
* On systems sharing IRQ line and vector, this check is needed
* to ensure that IRQ is generated by timer source.
@@
-297,7
+292,7
@@
DEFINE_TIMER_ISR
/* Update the master ms counter */
++_clock;
/* Update the master ms counter */
++_clock;
-#if
ndef CONFIG_TIMER_DISABLE
_EVENTS
+#if
CONFIG_TIMER
_EVENTS
/*
* Check the first timer request in the list and process
* it when it has expired. Repeat this check until the
/*
* Check the first timer request in the list and process
* it when it has expired. Repeat this check until the
@@
-318,7
+313,7
@@
DEFINE_TIMER_ISR
/* Execute the associated event */
event_do(&timer->expire);
}
/* Execute the associated event */
event_do(&timer->expire);
}
-#endif /* CONFIG_TIMER_
DISABLE_
EVENTS */
+#endif /* CONFIG_TIMER_EVENTS */
TIMER_STROBE_OFF;
}
TIMER_STROBE_OFF;
}
@@
-332,7
+327,7
@@
void timer_init(void)
{
TIMER_STROBE_INIT;
{
TIMER_STROBE_INIT;
-#if
ndef CONFIG_TIMER_DISABLE
_EVENTS
+#if
CONFIG_TIMER
_EVENTS
LIST_INIT(&timers_queue);
#endif
LIST_INIT(&timers_queue);
#endif