Commit 00a2911c authored by Oliver Horst's avatar Oliver Horst
Browse files

Merge branch 'wiesboeck-master-patch-82188' into 'master'

Section about the syscall interface.

See merge request !3
parents 9091692a 8054f4ce
......@@ -422,6 +422,23 @@ in case of cmake this was accomplished by selecting the right component config.
please note that within toki all component recipes, i.e., those things that are actively developed, are build with the help of the external src module. This allows us to have a regular local working copy where the code resides well structured in one folder, separated from the build-system and temporary build files. please copy this style for your new recipes.
##### Adding new syscalls for your toki components
To enable user applications to communicate with toki's FreeRTOS kernel and system components, toki provides a system call interface which offers system functions to applications through libc. A list of the already available syscalls can be found in ``$YOCTO_DIR/components/freertos-plus/include/freertos+/stdlib/syscalls.h``. Among other things this, file contains the definition of the syscalls.
```c
#ifdef __ASSEMBLER__ /* START SYSCALL INTERFACE DESCRIPTION */
SYSCALL_TABLE_ENTRY(xQueueGenericSend, 0)
SYSCALL_TABLE_ENTRY(xQueuePeek, 1)
SYSCALL_TABLE_ENTRY(xQueuePeekFromISR, 2)
...
SYSCALL_TABLE_ENTRY(uxHalGetCpuId, 101)
#endif /* __ASSEMBLER__ - END SYSCALL INTERFACE DESCRIPTION */
```
Any function available in the kernel binary - including functions from statically linked libraries - can be made available by adding an entry with the respective function name to the list. New entries can be appended to the list by adding a new SYSCALL_TABLE_ENTRY and choosing the next available syscall number. By adding an entry to this list, the function will be added to the syscall table. It will also be made available in newlib to be used by applications.
For reference, the specific implementation of the kernel side and application side of the syscall interface can be found in the following files. They do __NOT__ have to be altered to add syscalls to the interface!
- Kernel side: ``$YOCTO_DIR/components/freertos-portable/GCC/ARM_CA53_64_BIT/src/freertos+/stdlib/syscall_table.S``
- Application side: ``$YOCTO_DIR/components/newlib/newlib/libc/sys/freertos/syscalls.S``
### Integrating new components into the toki-pull-upstream process
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment