wiki:kernel_context

Version 11 (modified by alain, 10 years ago) ( diff )

--

GIET-VM / Task context access functions

The utils.c​ and utils.h​ files define the functions used to access the task contexts. The codes used to identify the various context slots are defined here​.

These functions are prefixed by "_" to remind that they can only be executed by a processor in kernel mode.

1) unsigned int _get_thread_ltid( void )

This function returns the local index of the calling thread (scheduler index).

2) unsigned int _get_thread_trdid( void )

This function returns the global thread identifier of the calling thread (x<<24 + y<<16 + p<<8 + ltid).

3) unsigned int _get_task_slot( unsigned int x, unsigned int y, unsigned int p, unsigned int ltid, unsigned int slot )

This function returns the content of a context slot for any task running on any processor.

  • x : cluster x coordinate
  • y : cluster y coordinate
  • p : processor local index
  • ltid : task local index
  • slot : slot index

4) void _set_task_slot( unsigned int x, unsigned int y, unsigned int p, unsigned int ltid, unsigned int slot, unsigned int value )

This function updates the content of a context slot for any task running on any processor.

  • x : cluster x coordinate
  • y : cluster y coordinate
  • p : processor local index
  • ltid : task local index
  • slot : slot index

5) unsigned int _get_context_slot( unsigned int slot )

This function returns the content of a context slot for the calling task.

5) void _set_context_slot( unsigned int slot, unsigned int value )

This function updates the content of a context slot for the calling task.

Note: See TracWiki for help on using the wiki.