Ignore:
Timestamp:
Jun 18, 2017, 10:06:41 PM (7 years ago)
Author:
alain
Message:

Introduce syscalls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/cluster.h

    r19 r23  
    44 * authors  Ghassan Almaless (2008,2009,2010,2011,2012)
    55 *          Mohamed Lamine Karaoui (2015)
    6  *          Alain Greiner (2016)
     6 *          Alain Greiner (2016,2017)
    77 *
    88 * Copyright (c) UPMC Sorbonne Universites
     
    4949struct core_s;
    5050struct process_s;
    51 struct device_s;
    5251
    5352
     
    5655 * For any process P, the process descriptor is replicated in all clusters containing
    5756 * at least one thread of process P, but only the "reference" cluster descriptor contains
    58  * the reference (complete) structures such as the GPT, the VSL, or the FDT.
    59  * The "owner" cluster is in charge to allocate a lpid (local process index),
    60  * for all process owned by a cluster K, and to register the "reference" cluster for
    61  * all process owned by K.
     57 * the reference (complete) GPT, VSL, and FDT structures.
     58 * The "owner" cluster K is in charge to allocate a lpid (local process index),
     59 * to the owned processes, and to register the "reference" cluster for these processes.
    6260 *
    6361 * Warning : the "owner" cluster, and the "reference" cluster can be different clusters.
    6462 *
    6563 * The process manager of a cluster K maintains three structures:
    66  * 1) The pref_tbl[] is an array indexed by lpid, for all processes owned by cluster K.
     64 * 1) The pref_tbl[] is an array indexed by lpid. There is one entry per owned process.
    6765 *    Each entry contains an extended pointer on the reference process descriptor.
     66 *
    6867 * 2) The local_root is the root of the local list of process descriptors in cluster K.
    6968 *    A process descriptor P is present in K, as soon as P has a thread in cluster K.
    70  * 3) The copies_root[] array is indexed by lpid. Each entry contains the root of
    71  *    the xlist of copies for a given process owned by cluster K.
     69 *
     70 * 3) The copies_root[] array is indexed by lpid. There is one entry per owned process,
     71 *    and each each entry contains the root of the xlist of copies for this process.
    7272 ******************************************************************************************/
    7373
     
    7878    uint32_t          pref_nr;                /*! number of processes owned by cluster    */
    7979
    80     list_entry_t      local_root;             /*! root of list of process in cluster      */
    81     spinlock_t        local_lock;             /*! lock protecting access to local list    */
     80    xlist_entry_t     local_root;             /*! root of list of process in cluster      */
     81    remote_spinlock_t local_lock;             /*! lock protecting access to local list    */
    8282    uint32_t          local_nr;               /*! number of process in cluster            */
    8383
     
    9696typedef struct cluster_s
    9797{
    98         spinlock_t        kcm_lock;           /*! local, protect creation of KCM allocators   */
     98        spinlock_t        kcm_lock;        /*! local, protect creation of KCM allocators      */
    9999
    100100    // global parameters
    101101
    102         uint32_t          paddr_width;        /*! numer of bits in physical address           */
    103     uint32_t          x_width;            /*! number of bits to code x_size  (can be 0)   */
    104     uint32_t          y_width;            /*! number of bits to code y_size  (can be 0)   */
    105         uint32_t          x_size;             /*! number of clusters in a row    (can be 1)   */
    106         uint32_t          y_size;             /*! number of clusters in a column (can be 1)   */
    107         cxy_t             io_cxy;             /*! io cluster identifier                       */
    108     uint32_t          dqdt_root_level;    /*! index of root node in dqdt_tbl[]            */
     102        uint32_t          paddr_width;     /*! numer of bits in physical address              */
     103    uint32_t          x_width;         /*! number of bits to code x_size  (can be 0)      */
     104    uint32_t          y_width;         /*! number of bits to code y_size  (can be 0)      */
     105        uint32_t          x_size;          /*! number of clusters in a row    (can be 1)      */
     106        uint32_t          y_size;          /*! number of clusters in a column (can be 1)      */
     107        cxy_t             io_cxy;          /*! io cluster identifier                          */
     108    uint32_t          dqdt_root_level; /*! index of root node in dqdt_tbl[]               */
    109109
    110110    // local parameters
    111111
    112         uint32_t          cores_nr;           /*! number of cores in cluster                  */
    113     uint32_t          cores_in_kernel;    /*! number of cores currently in kernel mode    */
     112        uint32_t          cores_nr;        /*! number of cores in cluster                     */
     113    uint32_t          cores_in_kernel; /*! number of cores currently in kernel mode       */
    114114
    115115        core_t            core_tbl[CONFIG_MAX_LOCAL_CORES];         /*! embedded cores        */
    116116
    117         ppm_t             ppm;                /*! embedded kernel page manager                */
    118         khm_t             khm;                /*! embedded kernel heap manager                */
    119         kcm_t             kcm;                /*! embedded kernel cache manager (for KCMs)    */
     117        ppm_t             ppm;             /*! embedded kernel page manager                   */
     118        khm_t             khm;             /*! embedded kernel heap manager                   */
     119        kcm_t             kcm;             /*! embedded kernel cache manager (for KCMs)       */
    120120
    121121    kcm_t           * kcm_tbl[KMEM_TYPES_NR];         /*! pointers on allocated KCMs      */
    122122
    123     uint32_t          ram_size;           /*! physical memory size                        */
    124     uint32_t          ram_base;           /*! physical memory base (local address)        */
    125 
    126         rpc_fifo_t        rpc_fifo;           /*! cluster RPC fifo (shared)                   */
    127         list_entry_t      devlist;            /*! root of list of devices in cluster          */
    128     struct device_s * icu;                /*! pointer on local XCU device                 */
    129 
    130     int32_t           pages_var;          /*! pages number increment from last update     */
    131     int32_t           threads_var;        /*! threads number increment from last update   */
     123    uint32_t          ram_size;        /*! physical memory size                           */
     124    uint32_t          ram_base;        /*! physical memory base (local address)           */
     125
     126        rpc_fifo_t        rpc_fifo;        /*! cluster RPC fifo (shared)                      */
     127        list_entry_t      devlist;         /*! root of list of devices in cluster             */
     128
     129    int32_t           pages_var;       /*! pages number increment from last DQQT update   */
     130    int32_t           threads_var;     /*! threads number increment from last DQDT update */
    132131
    133132        dqdt_node_t       dqdt_tbl[CONFIG_MAX_DQDT_DEPTH];     /*! embedded DQDT nodes        */
    134133
    135     pmgr_t            pmgr;               /*! embedded process manager                    */
     134    pmgr_t            pmgr;            /*! embedded process manager                       */
    136135
    137136        char              name[CONFIG_SYSFS_NAME_LEN];
     
    192191/******************************************************************************************
    193192 * This function returns an extended pointer on the reference process descriptor
    194  * from the process PID.  It can be called by any thread running in any cluster,
    195  * as it uses a RPC to the owner cluster if the current cluster is not the owner.
     193 * from the process PID. This PID can be be different from the calling thread process.
     194 * It can be called by any thread running in any cluster,
    196195 ******************************************************************************************
    197196 * @ pid  : process identifier.
    198  * @ return extended pointer on the reference process descriptor.
     197 * @ return extended pointer on reference process if success / return XPTR_NULL if error.
    199198 *****************************************************************************************/
    200199xptr_t cluster_get_reference_process_from_pid( pid_t pid );
Note: See TracChangeset for help on using the changeset viewer.