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_boot/boot.c

    r263 r267  
    11571157    //   are reserved for the kernel (context switch)
    11581158
    1159     unsigned int alloc_tty_channel = 1;            // TTY channel allocator
     1159    unsigned int alloc_tty_channel = 0;            // TTY channel allocator
    11601160    unsigned int alloc_nic_channel = 0;            // NIC channel allocator
    11611161    unsigned int alloc_cma_channel = 0;            // CMA channel allocator
    11621162    unsigned int alloc_hba_channel = 0;            // IOC channel allocator
    11631163    unsigned int alloc_tim_channel[X_SIZE*Y_SIZE]; // user TIMER allocators
     1164
     1165    if (!GIET_MONO_TTY) alloc_tty_channel++;
    11641166
    11651167    /////////////////////////////////////////////////////////////////////////
     
    13641366                }
    13651367                ctx_tty = alloc_tty_channel;
    1366                 alloc_tty_channel++;
     1368                if (!GIET_MONO_TTY) alloc_tty_channel++;
    13671369            }
    13681370            // ctx_nic : NIC channel global index provided by the global allocator
     
    14681470            // get local task index in scheduler
    14691471            unsigned int ltid = psched->tasks;
     1472
     1473            // get vspace thread index
     1474            unsigned int thread_id = task[task_id].trdid;
    14701475
    14711476            if (ltid >= IDLE_TASK_INDEX)
     
    15001505            psched->context[ltid][CTX_LTID_ID]  = ltid;
    15011506            psched->context[ltid][CTX_GTID_ID]  = task_id;
     1507            psched->context[ltid][CTX_TRDID_ID] = thread_id;
    15021508            psched->context[ltid][CTX_VSID_ID]  = vspace_id;
    15031509            psched->context[ltid][CTX_RUN_ID]   = 1;
     
    15051511#if BOOT_DEBUG_SCHED
    15061512_puts("\nTask ");
    1507 _puts( task[task_id].name );
    1508 _puts(" (");
    15091513_putd( task_id );
    1510 _puts(") allocated to processor ");
     1514_puts(" allocated to processor ");
    15111515_putd( gpid );
    15121516_puts("\n  - ctx[LTID]   = ");
     
    15361540_puts("\n  - ctx[VSID]   = ");
    15371541_putd( psched->context[ltid][CTX_VSID_ID] );
     1542_puts("\n  - ctx[TRDID]  = ");
     1543_putd( psched->context[ltid][CTX_TRDID_ID] );
    15381544_puts("\n");
    15391545#endif
Note: See TracChangeset for help on using the changeset viewer.