* 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)
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*
- * Copyright 2005,2008 Develer S.r.l. (http://www.develer.com/)
- *
+ * Copyright 2005, 2008 Develer S.r.l. (http://www.develer.com/)
* -->
*
* \version $Id$
*
* \author Bernie Innocenti <bernie@codewiz.org>
- *
* \brief Low-level timer module for Qt emulator (implementation).
*/
#include <cfg/compiler.h> // hptime.t
sigaction(SIGALRM, &sa, NULL);
// Setup POSIX realtime timer to interrupt every 1/TIMER_TICKS_PER_SEC.
- static struct itimerval itv =
+ static const struct itimerval itv =
{
{ 0, 1000000 / TIMER_TICKS_PER_SEC }, /* it_interval */
{ 0, 1000000 / TIMER_TICKS_PER_SEC } /* it_value */
setitimer(ITIMER_REAL, &itv, NULL);
}
+static void timer_hw_cleanup(void)
+{
+ static const struct itimerval itv =
+ {
+ { 0, 0 }, /* it_interval */
+ { 0, 0 } /* it_value */
+ };
+ setitimer(ITIMER_REAL, &itv, NULL);
+}
+
INLINE hptime_t timer_hw_hpread(void)
{
return hptime_get();
VERBOSE=1
CC=gcc
-CFLAGS="-W -Wall -Wextra -I. -Iemul -std=gnu99 -fno-builtin -D_DEBUG -D_TEST -DARCH=ARCH_EMUL"
+CFLAGS="-W -Wall -Wextra -Ibertos -Ibertos/emul -std=gnu99 -fno-builtin -D_DEBUG -D_TEST -DARCH=ARCH_EMUL"
CXX=g++
CXXFLAGS="$CFLAGS"
[ $VERBOSE -gt 0 ] && echo "Running $test..."
case "$test" in
*.cpp)
- $CXX $CXXFLAGS $test -o test || exit 1
- ./test || exit 1
- rm -f test
+ $CXX $CXXFLAGS $test -o images/testcase || exit 1
+ ./testcase || echo "FAILED: $test"
+ rm -f testcase
;;
*.c)
- $CC $CFLAGS $test -o test || exit 1
- ./test || exit 1
- rm -f test
+ $CC $CFLAGS $test -o testcase || exit 1
+ ./testcase || echo "FAILED: $test"
+ rm -f testcase
;;
esac
done