The friendly Operating System for the Internet of Things
thread_arch.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef THREAD_ARCH_H
20 #define THREAD_ARCH_H
21 
22 #include "kernel_defines.h"
23 
24 #ifdef __cplusplus
25  extern "C" {
26 #endif
27 
36 #ifdef COREIF_NG
37 #define thread_stack_init thread_arch_stack_init
38 #define thread_print_stack thread_arch_print_stack
39 #define cpu_switch_context_exit thread_arch_start_threading
40 #define thread_yield_higher thread_arch_yield
41 #endif
42 
47 typedef void *(*thread_task_func_t)(void *arg);
48 
59 char *thread_arch_stack_init(thread_task_func_t task_func, void *arg, void *stack_start, int stack_size);
60 
65 
70 
74 void *thread_arch_isr_stack_start(void);
75 
79 void thread_arch_stack_print(void);
80 
85 
89 void thread_arch_yield(void);
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif /* THREAD_ARCH_H */
96 
void thread_arch_yield(void)
Pause the current thread and schedule the next pending, if available.
void thread_arch_start_threading(void) NORETURN
Start threading by loading a threads initial information from the stack.
void thread_arch_stack_print(void)
Print the current stack to stdout.
int thread_arch_isr_stack_usage(void)
Get the number of bytes used on the ISR stack.
void * thread_arch_isr_stack_start(void)
Get the start of the ISR stack.
Common macros and compiler attributes/pragmas configuration.
void *(* thread_task_func_t)(void *arg)
Prototype for a thread entry function.
Definition: thread_arch.h:47
char * thread_arch_stack_init(thread_task_func_t task_func, void *arg, void *stack_start, int stack_size)
Initialize a thread's stack.
void * thread_arch_isr_stack_pointer(void)
Get the current ISR stack pointer.
#define NORETURN
The NORETURN keyword tells the compiler to assume that the function cannot return.