| 1 | = GIET-VM / Task context access functions = |
| 2 | |
| 3 | [[PageOutline]] |
| 4 | |
| 5 | The [source:soft/giet_vm/giet_common/utils.c utils.c] and [source:soft/giet_vm/giet_common/utils.h util.h] files define the functions used to access task contexts. |
| 6 | |
| 7 | They are prefixed by "_" to remind that they can only be executed by a processor in kernel mode. |
| 8 | |
| 9 | === unsigned int _get_current_task_id( void ) === |
| 10 | This function returns the local index of the currently running task from the processor scheduler. |
| 11 | |
| 12 | === unsigned int _get_task_slot( unsigned int gpid, unsigned int ltid, unsigned int slot ) |
| 13 | This function returns the content of a context ''slot'' for a task identified by the the ''gpid'' argument |
| 14 | (global processor index), and the ''ltid'' argument (local task index on the processor). |
| 15 | |
| 16 | === void _set_task_slot( unsigned int gpid, unsigned int ltid, unsigned int slot, unsigned int value ) |
| 17 | This function writes ''value'' in the the context ''slot'' of the task identified by the the ''gpid'' argument |
| 18 | (global processor index), and the ''ltid'' argument (local task index on the processor). |
| 19 | |
| 20 | === unsigned int _get_context_slot( unsigned int slot ) |
| 21 | This function returns the content of a context ''slot'' for the calling task. |
| 22 | |
| 23 | === void _set_task_slot( unsigned int slot, unsigned int value ) |
| 24 | This function writes ''value'' in the the context ''slot'' of the running task. |