From c7b67cff0eab340b5c58f168f4b44bdbc38f6d9b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 10 Jan 2008 13:52:44 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@173 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/Doxyfile | 2 +- docs/index.html | 2 +- readme.txt | 4 ++++ src/chschd.c | 2 -- src/include/threads.h | 23 +++++++++-------------- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/docs/Doxyfile b/docs/Doxyfile index 1672eaa7c..191480d19 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = ChibiOS/RT -PROJECT_NUMBER = "0.5.1 beta" +PROJECT_NUMBER = "0.5.2 beta" OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English diff --git a/docs/index.html b/docs/index.html index ae0284cae..0eb82a19d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -13,7 +13,7 @@ Homepage Current -Version 0.5.1
+Version 0.5.2
-
Project on SourceForge
Documentation
diff --git a/readme.txt b/readme.txt index 36e94e505..c3e734385 100644 --- a/readme.txt +++ b/readme.txt @@ -39,6 +39,10 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not complete yet. *** Releases *** ***************************************************************************** +*** 0.5.2 *** +- Small reordering in the fields of the Thread structure in order to optimize + the space when messages are not used. + *** 0.5.1 *** - NEW: Priority enqueing for messages can be optionally enabled by specifying the P_MSGBYPRIO option when creating a message server thread. diff --git a/src/chschd.c b/src/chschd.c index f18169c20..0507f8e5c 100644 --- a/src/chschd.c +++ b/src/chschd.c @@ -62,13 +62,11 @@ void chSchReadyI(Thread *tp, t_msg msg) { tp->p_state = PRREADY; tp->p_rdymsg = msg; -// prio_insert(tp, &rlist.r_queue); while (cp->p_prio >= tp->p_prio) cp = cp->p_next; /* Insertion on p_prev.*/ tp->p_prev = (tp->p_next = cp)->p_prev; tp->p_prev->p_next = cp->p_prev = tp; - } /** diff --git a/src/include/threads.h b/src/include/threads.h index 2d731ee1e..ba53e6158 100644 --- a/src/include/threads.h +++ b/src/include/threads.h @@ -53,10 +53,10 @@ struct Thread { * thread in the system. */ union { -#ifdef CH_USE_TRACE - /** Kernel object where the thread is waiting on.*/ - void *p_wtobjp; -#endif + /** Thread wakeup code (only valid when exiting the \p PRREADY state).*/ + t_msg p_rdymsg; + /** The thread exit code (only while in \p PREXIT state).*/ + t_msg p_exitcode; #ifdef CH_USE_SEMAPHORES /** Semaphore where the thread is waiting on (only in \p PRWTSEM state).*/ Semaphore *p_wtsemp; @@ -69,20 +69,14 @@ struct Thread { /** Destination thread for message send (only in \p PRSNDMSG state).*/ Thread *p_wtthdp; #endif - }; - union { - /** Thread wakeup code, normally set to \p RDY_OK by the \p chSchReadyI() - * (only while in \p PRREADY state).*/ - t_msg p_rdymsg; - /** The thread exit code (only while in \p PREXIT state).*/ - t_msg p_exitcode; #ifdef CH_USE_EVENTS /** Enabled events mask (only while in \p PRWTEVENT state).*/ t_eventmask p_ewmask; #endif -#ifdef CH_USE_MESSAGES - /** Message (only while in \p PRSNDMSG state).*/ - t_msg p_msg; +#ifdef CH_USE_TRACE + /** Kernel object where the thread is waiting on. It is only valid when + the thread is some sleeping states.*/ + void *p_wtobjp; #endif }; /** Machine dependent processor context.*/ @@ -100,6 +94,7 @@ struct Thread { #endif #ifdef CH_USE_MESSAGES ThreadsQueue p_msgqueue; + t_msg p_msg; #endif #ifdef CH_USE_EVENTS /** Pending events mask.*/