aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/templates/chcore.c39
1 files changed, 38 insertions, 1 deletions
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) {
}
}