Changes between Version 7 and Version 8 of kernel_switch


Ignore:
Timestamp:
Dec 9, 2016, 5:52:00 PM (7 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kernel_switch

    v7 v8  
    55The [source:soft/giet_vm/giet_kernel/ctx_handler.c ctx_handler.c] and [source:soft/giet_vm/giet_kernel/ctx_handler.h ctx_handler.h] files define the data structure and functions used to handle threads contexts. They are prefixed by "_" to remind that they can only be executed by a processor in kernel mode.
    66
    7 The GIET_VM threads try to implement the POSIX threads. A thread is statically allocated to a physical processor, as defined in the mapping, and the GIET-VM does not support thread migration. There is one scheduler per processor, and the max number of threads on one single processor cannot be larger than 13. A thread can be in three different states:
    8  * '''RUNNING''' the thread is currently executed.
    9  * '''RUNNABLE''' the thread is not running, but can be selected for execution at the next TICK.
    10  * '''BLOCKED''' the thread is blocked, waiting on a condition defined in the NORUN context slot.
     7
     8== __thread context definition__ ==
    119
    1210A thread context is an array of 64 words = 256 bytes.
     
    4442|| [7] $7    || [15] $15  || [23] $23  || [31] RA    || [39] PTPR  || [47] HBA        || [55] ***            ||
    4543
     44== __thread states__ ==
     45
     46A thread is statically allocated to a physical processor, as defined in the mapping, and the GIET-VM does not support thread migration. There is one scheduler per processor, and the max number of threads on one single processor cannot be larger than 13.  The giet VM supports both user threads, that can dymamically activated by the applications, using the POSIX threads API), and kernel threads that are statically created at kernel init, to support background tasks.
     47
     48Both User and Kernel threads can be in three different states:
     49 * '''RUNNING''' the thread is currently executed.
     50 * '''RUNNABLE''' the thread is not running, but can be selected for execution at the next TICK.
     51 * '''BLOCKED''' the thread is blocked, waiting on a condition defined in the NORUN context slot.
     52
     53The various blocking causes are defined below:
     54|| nmnemonic                || cause                          ||
     55|| NORUN_MASK_THREAD        || thread not activated           ||
     56|| NORUN_MASK_IOC           || blocked on IOC transfer        ||
     57|| NORUN_MASK_COPROC        || blocked on COPROC transfer     ||
     58|| NORUN_MASK_TTY           || blocked on TTY_RX transfer     ||
     59|| NORUN_MASK_NIC_RX_FULL   || blocked on NIC RX FIFO full    ||
     60|| NORUN_MASK_NIC_RX_EMPTY  || blocked on NIC TX QUEUE empty  ||
     61|| NORUN_MASK_NIC_TX_FULL   || blocked on NIC RX QUEUE full   ||
     62|| NORUN_MASK_NIC_TX_EMPTY  || blocked on NIC TX FIFO empty   ||
     63
     64
     65== __acccess functions__ ==
    4666
    4767 === void '''_ctx_block'''( unsigned int norun_cause ) ===