diff options
-rw-r--r-- | demos/LPC214x-GCC/chconf.h | 8 | ||||
-rw-r--r-- | demos/LPC214x-GCC/chtypes.h | 2 | ||||
-rw-r--r-- | demos/Win32-MSVS/chtypes.h | 2 | ||||
-rw-r--r-- | demos/Win32-MinGW/chtypes.h | 2 | ||||
-rw-r--r-- | docs/Doxyfile | 72 | ||||
-rw-r--r-- | ports/ARM7-LPC214x/GCC/lpc214x_serial.h | 6 | ||||
-rw-r--r-- | readme.txt | 17 | ||||
-rw-r--r-- | src/chschd.c | 12 | ||||
-rw-r--r-- | src/chsem.c | 28 | ||||
-rw-r--r-- | src/chthreads.c | 1 | ||||
-rw-r--r-- | src/include/delta.h | 14 | ||||
-rw-r--r-- | src/include/threads.h | 5 | ||||
-rw-r--r-- | src/templates/chtypes.h | 2 |
13 files changed, 84 insertions, 87 deletions
diff --git a/demos/LPC214x-GCC/chconf.h b/demos/LPC214x-GCC/chconf.h index 30670c8fd..bb03058c8 100644 --- a/demos/LPC214x-GCC/chconf.h +++ b/demos/LPC214x-GCC/chconf.h @@ -72,7 +72,7 @@ /** Configuration option: if specified then the Semaphores APIs with priority
* shift are included in the kernel.
* @note requires \p CH_USE_SEMAPHORES.*/
-#define CH_USE_RT_SEMAPHORES
+//#define CH_USE_RT_SEMAPHORES
/** Configuration option: if specified then the Events APIs are included in
* the kernel.*/
@@ -82,7 +82,7 @@ * function is included in the kernel.
* @note requires \p CH_USE_EVENTS.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
-#define CH_USE_EVENTS_TIMEOUT
+//#define CH_USE_EVENTS_TIMEOUT
/** Configuration option: if specified then the Synchronous Messages APIs are
* included in the kernel.*/
@@ -92,13 +92,13 @@ * function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
-#define CH_USE_MESSAGES_TIMEOUT
+//#define CH_USE_MESSAGES_TIMEOUT
/** Configuration option: if specified then the \p chMsgSendWithEvent()
* function is included in the kernel.
* @note requires \p CH_USE_MESSAGES.
* @note requires \p CH_USE_VIRTUAL_TIMERS.*/
-#define CH_USE_MESSAGES_EVENT
+//#define CH_USE_MESSAGES_EVENT
/** Configuration option: if specified then the
* \p chThdGetExitEventSource() function is included in the kernel.
diff --git a/demos/LPC214x-GCC/chtypes.h b/demos/LPC214x-GCC/chtypes.h index 49c7c6c38..48bf7a7d9 100644 --- a/demos/LPC214x-GCC/chtypes.h +++ b/demos/LPC214x-GCC/chtypes.h @@ -33,7 +33,7 @@ typedef BYTE8 t_tmode;
typedef BYTE8 t_tstate;
-typedef LONG32 t_prio;
+typedef WORD16 t_prio;
typedef PTR_EQ t_msg;
typedef LONG32 t_eventid;
typedef ULONG32 t_eventmask;
diff --git a/demos/Win32-MSVS/chtypes.h b/demos/Win32-MSVS/chtypes.h index f7d05b855..33eb4b963 100644 --- a/demos/Win32-MSVS/chtypes.h +++ b/demos/Win32-MSVS/chtypes.h @@ -33,7 +33,7 @@ typedef BYTE8 t_tmode;
typedef BYTE8 t_tstate;
-typedef LONG32 t_prio;
+typedef WORD16 t_prio;
typedef PTR_EQ t_msg;
typedef LONG32 t_eventid;
typedef ULONG32 t_eventmask;
diff --git a/demos/Win32-MinGW/chtypes.h b/demos/Win32-MinGW/chtypes.h index 49c7c6c38..48bf7a7d9 100644 --- a/demos/Win32-MinGW/chtypes.h +++ b/demos/Win32-MinGW/chtypes.h @@ -33,7 +33,7 @@ typedef BYTE8 t_tmode;
typedef BYTE8 t_tstate;
-typedef LONG32 t_prio;
+typedef WORD16 t_prio;
typedef PTR_EQ t_msg;
typedef LONG32 t_eventid;
typedef ULONG32 t_eventmask;
diff --git a/docs/Doxyfile b/docs/Doxyfile index 6cc09c5d9..d3b18072b 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = ChibiOS/RT -PROJECT_NUMBER = "0.2.1 alpha" +PROJECT_NUMBER = "0.2.0 alpha" OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English @@ -26,7 +26,7 @@ ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = "C:/Documents and Settings/Administrator/" -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES MULTILINE_CPP_IS_BRIEF = NO @@ -34,7 +34,7 @@ DETAILS_AT_TOP = YES INHERIT_DOCS = NO SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 2 -ALIASES = +ALIASES = OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_JAVA = NO BUILTIN_STL_SUPPORT = NO @@ -64,11 +64,11 @@ GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = +ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = NO SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- @@ -78,7 +78,7 @@ WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- @@ -115,15 +115,15 @@ FILE_PATTERNS = *.c \ *.py \ *.ddf RECURSIVE = YES -EXCLUDE = +EXCLUDE = EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing @@ -141,20 +141,20 @@ VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = +CHM_FILE = +HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO @@ -171,8 +171,8 @@ LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = +EXTRA_PACKAGES = +LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO @@ -184,8 +184,8 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- @@ -198,8 +198,8 @@ MAN_LINKS = NO #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = +XML_SCHEMA = +XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output @@ -211,16 +211,16 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = PREDEFINED = __JUST_STUBS__ \ __DOXIGEN__ \ CH_USE_VIRTUAL_TIMERS \ @@ -242,18 +242,18 @@ PREDEFINED = __JUST_STUBS__ \ CH_USE_MESSAGES \ CH_USE_MESSAGES_TIMEOUT \ CH_USE_MESSAGES_EVENT -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration::additions related to external references #--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = +TAGFILES = +GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO HIDE_UNDOC_RELATIONS = YES @@ -270,8 +270,8 @@ CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = +DOT_PATH = +DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 1000 @@ -280,6 +280,6 @@ DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- -# Configuration::additions related to the search engine +# Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO diff --git a/ports/ARM7-LPC214x/GCC/lpc214x_serial.h b/ports/ARM7-LPC214x/GCC/lpc214x_serial.h index 1eaba687b..340856fdc 100644 --- a/ports/ARM7-LPC214x/GCC/lpc214x_serial.h +++ b/ports/ARM7-LPC214x/GCC/lpc214x_serial.h @@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _LPC214x_SERIAL_H_
-#define _LPC214x_SERIAL_H_
+#ifndef _LPC2000_SERIAL_H_
+#define _LPC2000_SERIAL_H_
void InitSerial(void);
void SetUARTI(UART *u, int speed, int lcr, int fcr);
@@ -27,4 +27,4 @@ void UART1IrqHandler(void); extern FullDuplexDriver COM1, COM2;
-#endif /* _LPC214x_SERIAL_H_*/
+#endif /* _LPC2000_SERIAL_H_*/
diff --git a/readme.txt b/readme.txt index 07fc0c508..cda64a64b 100644 --- a/readme.txt +++ b/readme.txt @@ -11,10 +11,8 @@ under ./demos/.
./ports/ - Architecture/compiler specific portable files.
./demos/ - Demo programs for specific archtectures/boards.
-./docs/Doxifile - Doxigen project file.
-./docs/index.html - ChibiOS/RT documentation (after running doxigen). The
- documentation is also available on the project web
- page: http://chibios.sourceforge.net/
+./docs/doxifile - Doxigen project file.
+./docs/index.html - ChibiOS/RT documentation (after running doxigen).
Current ports under ./demos:
@@ -32,15 +30,6 @@ LPC214x-GCC - ChibiOS/RT port for ARM7 LPC2148, the demo targets the *** Releases ***
*****************************************************************************
-*** 0.2.1 ***
-- Optimizations in the RT semaphores subsystem. The support for this
- subsystem should still be considered experimental and further changes may
- happen in future versions.
-- Bug fix in the virtual timers handling code, now the timers can be re-armed
- from within the callback code in order to create periodic virtual timers.
-- Modified the t_prio type in the demos to be 32bits wide instead of 16bits,
- this results in a better code in critical sections of the kernel.
-
*** 0.2.0 ***
- Introduced support for ARM in thumb mode.
- Optimized context switching when thumb-interworking is not required, one
@@ -52,4 +41,4 @@ LPC214x-GCC - ChibiOS/RT port for ARM7 LPC2148, the demo targets the - Renamed makefiles to Makefiles, upper case M.
*** 0.1.0 ***
-- First alpha release
+- First alpha release
\ No newline at end of file diff --git a/src/chschd.c b/src/chschd.c index a046f4fbf..b38fe366f 100644 --- a/src/chschd.c +++ b/src/chschd.c @@ -188,7 +188,17 @@ void chSchTimerHandlerI(void) { #endif
#ifdef CH_USE_VIRTUAL_TIMERS
- chVTDoTickI();
+ if (&dlist != (DeltaList *)dlist.dl_next) {
+ VirtualTimer *vtp;
+
+ --dlist.dl_next->vt_dtime;
+ while (!(vtp = dlist.dl_next)->vt_dtime) {
+ vtp->vt_prev->vt_next = vtp->vt_next;
+ vtp->vt_next->vt_prev = vtp->vt_prev;
+ vtp->vt_func(vtp->vt_par);
+ vtp->vt_func = 0; // Required, flags the timer as triggered.
+ }
+ }
#endif
}
diff --git a/src/chsem.c b/src/chsem.c index 058187050..1eab23ea4 100644 --- a/src/chsem.c +++ b/src/chsem.c @@ -288,7 +288,7 @@ void chSemLowerPrioSignal(Semaphore *sp) { chSysLock();
if (!--currp->p_rtcnt) {
- currp->p_prio -= MEPRIO;
+ currp->p_prio = currp->p_bakprio;
if (sp->s_cnt++ < 0)
chSchReadyI(dequeue(sp->s_queue.p_next));
chSchRescheduleI();
@@ -308,11 +308,14 @@ void chSemLowerPrioSignal(Semaphore *sp) { * option is enabled in \p chconf.h.
*/
void chSemRaisePrioSignalWait(Semaphore *sps, Semaphore *spw) {
+ BOOL flag;
chSysLock();
if (sps->s_cnt++ < 0)
- chSchReadyI(dequeue(sps->s_queue.p_next));
+ chSchReadyI(dequeue(sps->s_queue.p_next)), flag = TRUE;
+ else
+ flag = FALSE;
if (--spw->s_cnt < 0) {
prioenq(currp, &spw->s_queue);
@@ -320,14 +323,20 @@ void chSemRaisePrioSignalWait(Semaphore *sps, Semaphore *spw) { if (!currp->p_rtcnt++)
currp->p_prio += MEPRIO;
+
+ chSysUnlock();
+ return;
}
- else {
- if (!currp->p_rtcnt++)
- currp->p_prio += MEPRIO;
- chSchRescheduleI();
+ if (!currp->p_rtcnt++) {
+ currp->p_bakprio = currp->p_prio;
+ currp->p_prio += MEPRIO;
+ flag = TRUE;
}
+ if( flag)
+ chSchRescheduleI();
+
chSysUnlock();
}
@@ -340,20 +349,21 @@ void chSemRaisePrioSignalWait(Semaphore *sps, Semaphore *spw) { * option is enabled in \p chconf.h.
*/
void chSemLowerPrioSignalWait(Semaphore *sps, Semaphore *spw) {
+ BOOL flag = FALSE;
chSysLock();
if (!--currp->p_rtcnt)
- currp->p_prio -= MEPRIO;
+ currp->p_prio = currp->p_bakprio, flag = TRUE;
if (sps->s_cnt++ < 0)
- chSchReadyI(dequeue(sps->s_queue.p_next));
+ chSchReadyI(dequeue(sps->s_queue.p_next)), flag = TRUE;
if (--spw->s_cnt < 0) {
enqueue(currp, &spw->s_queue); // enqueue() because the spw is a normal sem.
chSchGoSleepI(PRWTSEM);
}
- else
+ else if (flag)
chSchRescheduleI();
chSysUnlock();
diff --git a/src/chthreads.c b/src/chthreads.c index 59c361116..8f7112647 100644 --- a/src/chthreads.c +++ b/src/chthreads.c @@ -61,6 +61,7 @@ void _InitThread(t_prio prio, t_tmode mode, Thread *tp) { tp->p_rdymsg = RDY_OK;
#ifdef CH_USE_RT_SEMAPHORES
tp->p_rtcnt = 0;
+ tp->p_bakprio = prio;
#endif
#ifdef CH_USE_WAITEXIT
tp->p_waiting.p_next = (Thread *)&tp->p_waiting;
diff --git a/src/include/delta.h b/src/include/delta.h index 14f5b550e..2ae4d887f 100644 --- a/src/include/delta.h +++ b/src/include/delta.h @@ -69,20 +69,6 @@ typedef struct { extern DeltaList dlist;
-#define chVTDoTickI() \
- if (&dlist != (DeltaList *)dlist.dl_next) { \
- VirtualTimer *vtp; \
- \
- --dlist.dl_next->vt_dtime; \
- while (!(vtp = dlist.dl_next)->vt_dtime) { \
- t_vtfunc fn = vtp->vt_func; \
- vtp->vt_func = 0; \
- vtp->vt_prev->vt_next = vtp->vt_next; \
- vtp->vt_next->vt_prev = vtp->vt_prev; \
- fn(vtp->vt_par); \
- } \
- }
-
/*
* Virtual Timers APIs.
*/
diff --git a/src/include/threads.h b/src/include/threads.h index f170ce368..d8937433f 100644 --- a/src/include/threads.h +++ b/src/include/threads.h @@ -80,7 +80,7 @@ struct Thread { #endif
};
/** Machine dependent processor context.*/
- Context p_ctx;
+ Context p_ctx;
/*
* Start of the optional fields. Note, the null thread may also let its
* stack overwrite the following fields since it never uses semaphores,
@@ -104,8 +104,9 @@ struct Thread { #endif
#ifdef CH_USE_RT_SEMAPHORES
/** Priority backup after acquiring a RT semaphore.*/
+ t_prio p_bakprio;
/** RT semaphores depth counter.*/
- int p_rtcnt;
+ WORD16 p_rtcnt;
#endif
};
diff --git a/src/templates/chtypes.h b/src/templates/chtypes.h index 891b850c2..0d6547311 100644 --- a/src/templates/chtypes.h +++ b/src/templates/chtypes.h @@ -40,7 +40,7 @@ typedef BYTE8 t_tmode;
typedef BYTE8 t_tstate;
-typedef LONG32 t_prio;
+typedef WORD16 t_prio;
typedef PTR_EQ t_msg;
typedef LONG32 t_eventid;
typedef ULONG32 t_eventmask;
|