From bb650f9a4990206e0d731dbad03b52ca5830bb0e Mon Sep 17 00:00:00 2001 From: bernie Date: Sat, 29 Sep 2007 16:57:39 +0000 Subject: [PATCH] Better sparse support. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@816 38d2e660-2303-0410-9eaa-f027e97ec537 --- cfg/cpu_detect.h | 6 ------ cfg/module.h | 2 +- config.mk | 13 ++++++++----- os/hptime.c | 5 +++-- os/hptime.h | 6 ------ rules.mk | 6 ++++++ 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/cfg/cpu_detect.h b/cfg/cpu_detect.h index a2248cf7..75c6f13a 100755 --- a/cfg/cpu_detect.h +++ b/cfg/cpu_detect.h @@ -11,12 +11,6 @@ #ifndef CPU_DETECT_H #define CPU_DETECT_H -/* sparse? */ -#ifdef __CHECKER__ - /* Any random CPU will do */ - #define __arm__ -#endif - #if defined(__arm__) /* GCC */ \ || defined(__ARM4TM__) /* IAR: defined for all cores >= 4tm */ #define CPU_ARM 1 diff --git a/cfg/module.h b/cfg/module.h index 750368aa..21f87150 100755 --- a/cfg/module.h +++ b/cfg/module.h @@ -46,7 +46,7 @@ * * \see MOD_INIT(), MOD_CHECK() */ -#define MOD_DEFINE(module) DB(bool module ## _initialized;) +#define MOD_DEFINE(module) DB(extern bool module ## _initialized; bool module ## _initialized;) /** * Check that \a module was already initialized. diff --git a/config.mk b/config.mk index e78f4e13..a7bf757f 100755 --- a/config.mk +++ b/config.mk @@ -10,6 +10,9 @@ # Author: Bernardo Innocenti # # $Log$ +# Revision 1.12 2007/09/29 16:57:39 bernie +# Better sparse support. +# # Revision 1.11 2007/09/29 15:54:14 bernie # Make demo Qt emulator compile again. # @@ -86,6 +89,11 @@ RM = rm -f RM_R = rm -rf RN = mv MKDIR_P = mkdir -p +SHELL = /bin/sh +CHECKER = sparse +DOXYGEN = doxygen +AVRDUDE = avrdude +FLEXCAT = $(top_srcdir)/tools/flexcat/flexcat # For conversion from ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. COFFCONVERT=$(OBJCOPY) \ @@ -99,11 +107,6 @@ INCDIR = -I. -Ihw LIBDIR = lib OBJDIR = obj OUTDIR = images -SHELL = /bin/sh -DOXYGEN = doxygen -UISP = uisp -AVRDUDE = avrdude -FLEXCAT = $(top_srcdir)/tools/flexcat/flexcat # output format can be srec, ihex (avrobj is always created) FORMAT = srec diff --git a/os/hptime.c b/os/hptime.c index 7be9ea20..77183230 100755 --- a/os/hptime.c +++ b/os/hptime.c @@ -36,13 +36,14 @@ hptime_t hptime_get(void) #elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) -#include +#include /* for gettimeofday() */ +#include /* for NULL */ hptime_t hptime_get(void) { struct timeval tv; - gettimeofday(&tv, 0); + gettimeofday(&tv, NULL); return (hptime_t)tv.tv_sec * HPTIME_TICKS_PER_SECOND + (hptime_t)tv.tv_usec; } diff --git a/os/hptime.h b/os/hptime.h index 9d9336ed..a5072cca 100755 --- a/os/hptime.h +++ b/os/hptime.h @@ -12,12 +12,6 @@ #ifndef HPTIME_H #define HPTIME_H -/* sparse? */ -#ifdef __CHECKER__ - /* Any random OS would do */ - #define __unix__ -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/rules.mk b/rules.mk index 990fc39d..41d1e1cb 100755 --- a/rules.mk +++ b/rules.mk @@ -24,6 +24,12 @@ Q := @ L := @echo endif +# Checker build +ifeq ($(C),1) +CC = $(CHECKER) +CFLAGS += -Wundef -D__x86_64__=1 -D__unix__=1 -D__linux__=1 -D__STDC_VERSION__=199901L +endif + # Initialize $(top_srcdir) with current directory, unless it was already initialized top_srcdir ?= $(shell pwd) -- 2.25.1