aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-02-03 16:13:59 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-02-03 16:13:59 +0000
commit36deb792c105ce4900870abe69da77393ce7a692 (patch)
tree6edea4eec9246743540f417c5d1a005595428705
parent528e9fea357b8b24069d99657230ba28968f5d0c (diff)
downloadChibiOS-36deb792c105ce4900870abe69da77393ce7a692.tar.gz
ChibiOS-36deb792c105ce4900870abe69da77393ce7a692.tar.bz2
ChibiOS-36deb792c105ce4900870abe69da77393ce7a692.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@714 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--docs/ch.txt15
-rw-r--r--readme.txt2
-rw-r--r--src/chdebug.c2
-rw-r--r--src/chheap.c5
-rw-r--r--src/chschd.c2
-rw-r--r--src/chsys.c10
-rw-r--r--src/chvt.c2
-rw-r--r--src/include/debug.h4
-rw-r--r--src/include/heap.h2
-rw-r--r--src/include/scheduler.h2
-rw-r--r--src/include/vt.h2
11 files changed, 28 insertions, 20 deletions
diff --git a/docs/ch.txt b/docs/ch.txt
index e3e73da97..5e2fd2077 100644
--- a/docs/ch.txt
+++ b/docs/ch.txt
@@ -234,8 +234,13 @@
* becomes negative the thread is queued in the semaphore and suspended.
* - <b>Reset</b>: The semaphore counter is reset to a non-negative value
* and all the threads in the queue are released.
- * Semaphores can be used as guards for mutual exclusion code zones but
- * also have other uses, queues guards and counters as example.<br>
+ *
+ * Semaphores can be used as guards for mutual exclusion code zones (note that
+ * mutexes are recommended for this kind of use) but also have other uses,
+ * queues guards and counters as example.<br>
+ * Semaphores usually use FIFO queues but it is possible to make them
+ * order threads by priority by specifying CH_USE_SEMAPHORES_PRIORITY in
+ * @p chconf.h.<br>
* In order to use the Semaphores APIs the @p CH_USE_SEMAPHORES
* option must be specified in @p chconf.h.<br><br>
* @file semaphores.h Semaphores macros and structures.
@@ -256,6 +261,7 @@
* - <b>Unlock</b>: The mutex is released by the owner and the highest
* priority thread waiting in the queue, if any, is resumed and made owner
* of the mutex.
+ *
* In order to use the Event APIs the @p CH_USE_MUTEXES option must be
* specified in @p chconf.h.<br>
*
@@ -320,7 +326,7 @@
/**
* @defgroup Messages Messages
* @{
- * Synchronous inter-thread Messages.
+ * Synchronous inter-thread messages.
* <h2>Operation Mode</h2>
* Messages are an easy to use and fast IPC mechanism, threads can both serve
* messages and send messages to other threads, the mechanism allows data to
@@ -360,6 +366,7 @@
* - <b>Full duplex queue</b>, bidirectional queue where read and write
* operations can happen at the same time. Full duplex queues
* are implemented by pairing an input queue and an output queue together.
+ *
* In order to use the I/O queues the @p CH_USE_QUEUES option must
* be specified in @p chconf.h.<br>
* In order to use the half duplex queues the @p CH_USE_QUEUES_HALFDUPLEX
@@ -397,7 +404,7 @@
* The library code does not follow the same naming convention of the
* system APIs in order to make very clear that it is not "core" code.<br>
* The main difference is that library code is not formally tested in the
- * test suite but through usage in the various demo application.
+ * test suite but through usage in the various demo applications.
*/
/** @} */
diff --git a/readme.txt b/readme.txt
index a869bd09f..d4ba1a99c 100644
--- a/readme.txt
+++ b/readme.txt
@@ -101,6 +101,8 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
CH_IRQ_PROLOGUE() and CH_IRQ_EPILOGUE() in order to make very clear that
those are not functions but inlined code. Also introduced a new macro
CH_IRQ_HANDLER that should be used when declaring an interrupt handler.
+ CHANGE: Renamed several internal initialization functions by removing the
+ "ch" prefix because could not be considered system APIs.
- Improved ARM7 and Cortex-M3 support, new configuration options.
- Introduced the concept of interrupt classes, see the documentation.
- Introduced the concept of system states, see the documentation.
diff --git a/src/chdebug.c b/src/chdebug.c
index 238071cc4..41a0adc62 100644
--- a/src/chdebug.c
+++ b/src/chdebug.c
@@ -26,7 +26,7 @@ char *panicmsg;
/**
* @brief Debug subsystem initialization.
*/
-void chDbgInit(void) {
+void debug_init(void) {
#ifdef CH_USE_TRACE
dbgtb.tb_size = TRACE_BUFFER_SIZE;
diff --git a/src/chheap.c b/src/chheap.c
index 8ba55f9ad..c07212226 100644
--- a/src/chheap.c
+++ b/src/chheap.c
@@ -65,10 +65,9 @@ static struct {
/**
* @brief Initializes the allocator subsystem.
*
- * @note It is internally invoked, this function should not normally be
- * invoked from the user code.
+ * @note Internal use only.
*/
-void chHeapInit(void) {
+void heap_init(void) {
struct header *hp;
#if CH_HEAP_SIZE == 0
diff --git a/src/chschd.c b/src/chschd.c
index cc89682a8..2de941f0a 100644
--- a/src/chschd.c
+++ b/src/chschd.c
@@ -32,7 +32,7 @@ ReadyList rlist;
* @brief Scheduler initialization.
* @note Internally invoked by the @p chSysInit().
*/
-void chSchInit(void) {
+void scheduler_init(void) {
queue_init(&rlist);
rlist.r_prio = NOPRIO;
diff --git a/src/chsys.c b/src/chsys.c
index 1629796dd..807e2590f 100644
--- a/src/chsys.c
+++ b/src/chsys.c
@@ -57,17 +57,17 @@ void chSysInit(void) {
static Thread mainthread;
port_init();
- chSchInit();
- chDbgInit();
- chVTInit();
+ scheduler_init();
+ debug_init();
+ vt_init();
#ifdef CH_USE_HEAP
- chHeapInit();
+ heap_init();
#endif
+
/*
* Now this instructions flow becomes the main thread.
*/
(currp = init_thread(&mainthread, NORMALPRIO))->p_state = PRCURR;
-
chSysEnable();
/*
diff --git a/src/chvt.c b/src/chvt.c
index 7f63437ad..63bfd219e 100644
--- a/src/chvt.c
+++ b/src/chvt.c
@@ -31,7 +31,7 @@ VTList vtlist;
*
* @note Internal use only.
*/
-void chVTInit(void) {
+void vt_init(void) {
vtlist.vt_next = vtlist.vt_prev = (void *)&vtlist;
vtlist.vt_time = (systime_t)-1;
diff --git a/src/include/debug.h b/src/include/debug.h
index 631882fad..71a2613eb 100644
--- a/src/include/debug.h
+++ b/src/include/debug.h
@@ -62,7 +62,7 @@ extern char *dbglastmsg;
#ifdef __cplusplus
extern "C" {
#endif
- void chDbgInit(void);
+ void debug_init(void);
void chDbgPanic(char *msg);
#ifdef __cplusplus
}
@@ -83,7 +83,7 @@ extern "C" {
#else /* !CH_USE_DEBUG */
-#define chDbgInit()
+#define debug_init()
#define chDbgPanic(msg) {}
#define chDbgAssert(c, m) {(void)(c);}
diff --git a/src/include/heap.h b/src/include/heap.h
index b303fde1a..b8633f5cf 100644
--- a/src/include/heap.h
+++ b/src/include/heap.h
@@ -28,7 +28,7 @@
#ifdef __cplusplus
extern "C" {
#endif
- void chHeapInit(void);
+ void heap_init(void);
void *chHeapAlloc(size_t size);
void chHeapFree(void *p);
size_t chHeapStatus(size_t *sizep);
diff --git a/src/include/scheduler.h b/src/include/scheduler.h
index fde23a0ce..3d2f46e5e 100644
--- a/src/include/scheduler.h
+++ b/src/include/scheduler.h
@@ -75,7 +75,7 @@ extern ReadyList rlist;
#ifdef __cplusplus
extern "C" {
#endif
- void chSchInit(void);
+ void scheduler_init(void);
Thread *chSchReadyI(Thread *tp);
void chSchGoSleepS(tstate_t newstate);
msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time);
diff --git a/src/include/vt.h b/src/include/vt.h
index 73f2881a3..1e718da3a 100644
--- a/src/include/vt.h
+++ b/src/include/vt.h
@@ -99,7 +99,7 @@ extern VTList vtlist;
#ifdef __cplusplus
extern "C" {
#endif
- void chVTInit(void);
+ void vt_init(void);
void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par);
void chVTResetI(VirtualTimer *vtp);
bool_t chSysInTimeWindow(systime_t start, systime_t end);