Ignore:
Timestamp:
Jul 18, 2015, 3:00:42 PM (9 years ago)
Author:
alain
Message:

Modify the task activation/desactivation mechanism
to support the _kill_application() and _exec_application() system functions.
The RUN Boolean in task context has been replaced by the NORUN bit-vector.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_kernel/ctx_handler.h

    r556 r629  
    1414// is launched by the scheduler when there is no other runable task.
    1515/////////////////////////////////////////////////////////////////////////////////
    16 // A task context is an array of 64 words = 256 bytes.
     16// A task context is an array of 64 uint32 words => 256 bytes.
    1717// It contains copies of processor registers (when the task is preempted)
    18 // and some general informations associated to a task, such as the peripherals
    19 // allocated to the task (private peripheral channel)
     18// and some general informations associated to a task, such as the private
     19// peripheral channels allocated to the task, the vspace index, the various
     20// task index (local / global / application), and the runnable status.
    2021/////////////////////////////////////////////////////////////////////////////////
    2122// ctx[0] <- ***   |ctx[8] <- $8     |ctx[16]<- $16    |ctx[24]<- $24
     
    3031// ctx[32]<- EPC   |ctx[40]<- TTY    |ctx[48]<- TRDID  |ctx[56]<- ***
    3132// ctx[33]<- CR    |ctx[41]<- CMA_FB |ctx[49]<- GTID   |ctx[57]<- ***
    32 // ctx[34]<- SR    |ctx[42]<- CMA_RX |ctx[50]<- RUN    |ctx[58]<- ***
     33// ctx[34]<- SR    |ctx[42]<- CMA_RX |ctx[50]<- NORUN  |ctx[58]<- ***
    3334// ctx[35]<- BVAR  |ctx[43]<- CMA_TX |ctx[51]<- COPROC |ctx[59]<- ***
    3435// ctx[36]<- PTAB  |ctx[44]<- NIC_RX |ctx[52]<- ***    |ctx[60]<- ***
     
    4748/////////////////////////////////////////////////////////////////////////////////
    4849
    49 #define CTX_SP_ID        29  // Stack Pointer
    50 #define CTX_RA_ID        31  // Return Address
     50#define CTX_SP_ID        29    // Stack Pointer
     51#define CTX_RA_ID        31    // Return Address
    5152
    52 #define CTX_EPC_ID       32  // Exception Program Counter (CP0)
    53 #define CTX_CR_ID        33  // Cause Register (CP0)
    54 #define CTX_SR_ID        34  // Status Register (CP0)
    55 #define CTX_BVAR_ID      35      // Bad Virtual Address Register (CP0)
    56 #define CTX_PTAB_ID      36  // Page Table Virtual address
    57 #define CTX_LTID_ID      37  // Local  Task Index (in scheduler)
    58 #define CTX_VSID_ID      38  // Vspace Index     
    59 #define CTX_PTPR_ID      39  // Page Table Pointer Register (PADDR>>13)
     53#define CTX_EPC_ID       32    // Exception Program Counter (CP0)
     54#define CTX_CR_ID        33    // Cause Register (CP0)
     55#define CTX_SR_ID        34    // Status Register (CP0)
     56#define CTX_BVAR_ID      35        // Bad Virtual Address Register (CP0)
     57#define CTX_PTAB_ID      36    // Page Table Virtual address
     58#define CTX_LTID_ID      37    // Local  Task Index (in scheduler)
     59#define CTX_VSID_ID      38    // Vspace Index     
     60#define CTX_PTPR_ID      39    // Page Table Pointer Register (PADDR>>13)
    6061
    61 #define CTX_TTY_ID       40  // private TTY channel index 
    62 #define CTX_CMA_FB_ID    41  // private CMA channel index for FBF write
    63 #define CTX_CMA_RX_ID    42  // private CMA channel index for NIC_TX
    64 #define CTX_CMA_TX_ID    43  // private CMA channel index for NIC_RX
    65 #define CTX_NIC_RX_ID    44  // private NIC channel index RX transfer
    66 #define CTX_NIC_TX_ID    45  // private NIC channel index TX transfer
    67 #define CTX_TIM_ID       46  // ptivate TIM channel index
    68 #define CTX_HBA_ID       47  // private HBA channel index
     62#define CTX_TTY_ID       40    // private TTY channel index 
     63#define CTX_CMA_FB_ID    41    // private CMA channel index for FBF write
     64#define CTX_CMA_RX_ID    42    // private CMA channel index for NIC_TX
     65#define CTX_CMA_TX_ID    43    // private CMA channel index for NIC_RX
     66#define CTX_NIC_RX_ID    44    // private NIC channel index RX transfer
     67#define CTX_NIC_TX_ID    45    // private NIC channel index TX transfer
     68#define CTX_TIM_ID       46    // ptivate TIM channel index
     69#define CTX_HBA_ID       47    // private HBA channel index
    6970
    70 #define CTX_TRDID_ID     48  // Thread Task Index in vspace
    71 #define CTX_GTID_ID      49  // Global Task Index in all system
    72 #define CTX_RUN_ID       50  // Boolean: task runable
    73 #define CTX_COPROC_ID    51  // cluster_xy : coprocessor coordinates
     71#define CTX_TRDID_ID     48    // Thread Task Index in vspace
     72#define CTX_GTID_ID      49    // Global Task Index in all system
     73#define CTX_NORUN_ID     50    // bit-vector : task runable if all zero
     74#define CTX_COPROC_ID    51    // cluster_xy : coprocessor coordinates
    7475
    7576/////////////////////////////////////////////////////////////////////////////////
     77//    Definition of the NORUN bit-vector masks
     78/////////////////////////////////////////////////////////////////////////////////
     79
     80#define NORUN_MASK_TASK       0x00000001   // Task not active 
     81#define NORUN_MASK_IOC        0x00000002   // Task blocked on IOC transfer
     82#define NORUN_MASK_COPROC     0x00000004   // Task blocked on COPROC transfer
    7683
    7784/////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.