Ignore:
Timestamp:
Jan 13, 2014, 3:20:29 PM (11 years ago)
Author:
cfuguet
Message:
  • Adding new task context information: THREAD INDEX.

This value can be accessed by USER applications to get the
thread index of the current task. This thread index
corresponds to the index in a vspace.

The value of this index can be forced in the vspace part
of the XML description file using the trdid field in the
task description. When this value is missing, for each
task, a value from 0 to N-1 will be assigned, where N is
the number of task in the vspace.

The user application access this value through the
giet_thread_id() function defined in the stdio library
which uses the SYSCALL_THREAD_ID to access the task
context information.

  • Supporting mono TTY platforms

When the GIET_MONO_TTY constant defined in the giet_config
file, contains a value different than 0, all tasks will
share the TTY[0]. If this is the case, in the stdio
library, the giet_tty_printf() function will take the TTY
hardware lock before writing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_kernel/sys_handler.c

    r263 r267  
    4848    &_fb_sync_write,       /* 0x10 */
    4949    &_fb_sync_read,        /* 0x11 */
    50     &_sys_ukn,             /* 0x12 */
    51     &_sys_ukn,             /* 0x13 */
     50    &_thread_id,           /* 0x12 */
     51    &_tty_get_release_lock,/* 0x13 */
    5252    &_sys_ukn,             /* 0x14 */
    5353    &_sys_ukn,             /* 0x15 */
     
    180180{
    181181    return _get_context_slot(CTX_GTID_ID);
     182}
     183
     184/////////////////////////////////////////////////////////////////////////////
     185// _thread_id()
     186// Returns current thread index.
     187/////////////////////////////////////////////////////////////////////////////
     188unsigned int _thread_id()
     189{
     190    return _get_context_slot(CTX_TRDID_ID);
     191}
     192
     193/////////////////////////////////////////////////////////////////////////////
     194// _tty_get_release_lock(int val)
     195// Get or release the hardware TTY lock depending on val (0: get,1: release)
     196/////////////////////////////////////////////////////////////////////////////
     197int _tty_get_release_lock(unsigned int val)
     198{
     199    unsigned int channel = _get_context_slot(CTX_TTY_ID);
     200
     201    if      ( val == 0 ) _tty_get_lock(channel);
     202    else if ( val == 1 ) _tty_release_lock(channel);
     203    else return -1; // Wrong action
     204
     205    return 0;
    182206}
    183207
Note: See TracChangeset for help on using the changeset viewer.