From a07bd21d4427c9f254aae8f6da10dabdaedea43e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 9 Jan 2009 10:48:30 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@594 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/templates/chcore.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/templates/chcore.c b/src/templates/chcore.c index 06e584089..65d8e155d 100644 --- a/src/templates/chcore.c +++ b/src/templates/chcore.c @@ -31,30 +31,67 @@ * because performance concerns. */ +/** + * Prints a message on the system console. + * @param msg pointer to the message + */ void sys_puts(char *msg) { } +/** + * Performs a context switch between two threads. + * @param otp the thread to be switched out + * @param ntp the thread to be switched in + */ void sys_switch(Thread *otp, Thread *ntp) { } +/** + * Kernel-unlock action. Usually this function just enables interrupts. + */ void sys_enable(void) { } +/** + * Kernel-lock action. Usually this function just disables interrupts. + */ void sys_disable(void) { } +/** + * Kernel-lock action from an interrupt handler. This function is invoked + * before invoking I-class APIs from interrupt handlers. The implementation + * is architecture dependent, in its simplest form it is void. + */ void sys_disable_from_isr(void) { } +/** + * Kernel-unlock action from an interrupt handler. This function is invoked + * after invoking I-class APIs from interrupt handlers. The implementation + * is architecture dependent, in its simplest form it is void. + */ void sys_enable_from_isr(void) { } +/** + * Enters an architecture-dependent halt mode. The function is meant to return + * when an interrupt becomes pending. The simplest implementation is an empty + * function but this will not take advantage of architecture-specific power + * saving modes. + */ void sys_wait_for_interrupt(void) { } +/** + * Halts the system. This function is invoked by the operating system when an + * unrecoverable error is detected (as example because a programming error in + * the application code that triggers an assertion while in debug mode). + */ void sys_halt(void) { - while(TRUE) { + sys_disable(); + while (TRUE) { } } -- cgit v1.2.3