git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@425 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2008-09-05 13:04:28 +00:00
parent 737c82e787
commit 517440bad9
15 changed files with 273 additions and 8 deletions

View File

@ -34,6 +34,13 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
//#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
@ -172,6 +179,23 @@
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -34,6 +34,13 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
//#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
@ -172,6 +179,23 @@
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -34,6 +34,13 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
//#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
@ -172,6 +179,23 @@
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -34,6 +34,13 @@
* that this is not related to the compiler optimization options.*/
//#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
//#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
@ -172,6 +179,23 @@
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -34,6 +34,13 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
//#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
@ -172,6 +179,23 @@
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -34,6 +34,13 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
//#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
@ -172,6 +179,23 @@
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -34,6 +34,13 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
//#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
@ -172,6 +179,23 @@
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -34,6 +34,13 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
//#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
@ -172,6 +179,23 @@
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -35,6 +35,13 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
//#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
@ -173,6 +180,23 @@
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -29,16 +29,18 @@
#ifndef _CHCONF_H_
#define _CHCONF_H_
/*
* NOTE: this is just documentation for doxigen, the real configuration file
* is the one into the project directories.
*/
/** Configuration option: if specified then time efficient rather than space
* efficient code is used when two possible implementations exist, note
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
//#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
@ -177,6 +179,23 @@
*/
//#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -89,6 +89,8 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
not use the allocation services internally, it is up to the application
code to use the allocators in order to use dynamic system objects.
Both the allocators can be disabled and removed from the memory image.
- NEW: Added option macros in chconf.h to add custom fields and initialization
code to the Thread structure.
- FIX: Corrected the wrong definition of the chThdResumeI() macro.
- FIX: The API chSemWaitTimeout() was missing in the documentation.
- CHANGE: Now the chThdResume() asserts that the thread is in PRSUSPEND state

View File

@ -50,6 +50,9 @@ void init_thread(tprio_t prio, tmode_t mode, Thread *tp) {
#ifdef CH_USE_EXIT_EVENT
chEvtInit(&tp->p_exitesource);
#endif
#ifdef CH_USE_THREAD_EXT
THREAD_EXT_INIT(tp);
#endif
}
#ifdef CH_USE_DEBUG

View File

@ -28,9 +28,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#ifdef CH_USE_SLEEP
void chThdSleep(systime_t time);
#endif /* CH_USE_SLEEP */
#ifdef CH_USE_SYSTEMTIME
bool_t chSysInTimeWindow(systime_t start, systime_t end);
#endif /* CH_USE_SYSTEMTIME */

View File

@ -106,6 +106,9 @@ struct Thread {
/** Thread's own, non-inherited, priority. */
tprio_t p_realprio;
#endif
#ifdef CH_USE_THREAD_EXT
THREAD_EXT_FIELDS
#endif
};
/** Thread state: Ready to run, waiting on the ready list.*/

View File

@ -35,12 +35,19 @@
* that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED
/** Configuration option: it specified this option enables the \p Thread
* extension fields and initiazation code.
* @see THREAD_EXT_FIELDS
* @see THREAD_EXT_INIT
*/
#define CH_USE_THREAD_EXT
/** Configuration option: if specified then the Virtual Timers subsystem is
* included in the kernel.*/
#define CH_USE_VIRTUAL_TIMERS
/** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */
* robin scheduling algorithm on threads of equal priority.*/
#define CH_USE_ROUNDROBIN
/** Configuration option: if specified then the System Timer subsystem is
@ -173,6 +180,23 @@
*/
#define CH_USE_TRACE
/** User fields added to the end of the \p Thread structure if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_FIELDS \
struct { \
/* Add fields here.*/ \
};
/** User initialization code added to the \p chThdCreate() API if the
* \p CH_USE_THREAD_EXT option is enabled.
* @see CH_USE_THREAD_EXT
*/
#define THREAD_EXT_INIT(tp) { \
/* Add initialization code here.*/ \
}
#endif /* _CHCONF_H_ */
/** @} */