Ignore:
Timestamp:
May 3, 2018, 5:51:22 PM (6 years ago)
Author:
alain
Message:

1/ Fix a bug in the Multithreaded "sort" applicationr:
The pthread_create() arguments must be declared as global variables.
2/ The exit syscall can be called by any thread of a process..

File:
1 edited

Legend:

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

    r438 r440  
    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
    101         uint32_t          paddr_width;       /*! numer of bits in physical address            */
    102     uint32_t          x_width;           /*! number of bits to code x_size  (can be 0)    */
    103     uint32_t          y_width;           /*! number of bits to code y_size  (can be 0)    */
    104         uint32_t          x_size;            /*! number of clusters in a row    (can be 1)    */
    105         uint32_t          y_size;            /*! number of clusters in a column (can be 1)    */
    106         cxy_t             io_cxy;            /*! io cluster identifier                        */
    107     uint32_t          dqdt_root_level;   /*! index of root node in dqdt_tbl[]             */
    108     uint32_t          nb_txt_channels;   /*! number of TXT channels                       */
    109     uint32_t          nb_nic_channels;   /*! number of NIC channels                       */
    110     uint32_t          nb_ioc_channels;   /*! number of IOC channels                       */
    111     uint32_t          nb_fbf_channels;   /*! number of FBF channels                       */
     101        uint32_t        paddr_width;       /*! numer of bits in physical address              */
     102    uint32_t        x_width;           /*! number of bits to code x_size  (can be 0)      */
     103    uint32_t        y_width;           /*! number of bits to code y_size  (can be 0)      */
     104        uint32_t        x_size;            /*! number of clusters in a row    (can be 1)      */
     105        uint32_t        y_size;            /*! number of clusters in a column (can be 1)      */
     106        cxy_t           io_cxy;            /*! io cluster identifier                          */
     107    uint32_t        dqdt_root_level;   /*! index of root node in dqdt_tbl[]               */
     108    uint32_t        nb_txt_channels;   /*! number of TXT channels                         */
     109    uint32_t        nb_nic_channels;   /*! number of NIC channels                         */
     110    uint32_t        nb_ioc_channels;   /*! number of IOC channels                         */
     111    uint32_t        nb_fbf_channels;   /*! number of FBF channels                         */
    112112
    113113    // local parameters
    114         uint32_t          cores_nr;          /*! actual number of cores in cluster            */
    115     uint32_t          ram_size;          /*! physical memory size                         */
    116     uint32_t          ram_base;          /*! physical memory base (local address)         */
    117 
    118         core_t            core_tbl[CONFIG_MAX_LOCAL_CORES];         /*! embedded cores        */
    119 
    120         list_entry_t      dev_root;          /*! root of list of devices in cluster           */
     114        uint32_t        cores_nr;          /*! actual number of cores in cluster              */
     115    uint32_t        ram_size;          /*! physical memory size                           */
     116    uint32_t        ram_base;          /*! physical memory base (local address)           */
     117
     118        core_t          core_tbl[CONFIG_MAX_LOCAL_CORES];    /*! embedded cores               */
     119
     120        list_entry_t    dev_root;          /*! root of list of devices in cluster             */
    121121
    122122    // memory allocators
    123         ppm_t             ppm;               /*! embedded kernel page manager                 */
    124         khm_t             khm;               /*! embedded kernel heap manager                 */
    125         kcm_t             kcm;               /*! embedded kernel cache manager (for KCMs)     */
    126 
    127     kcm_t           * kcm_tbl[KMEM_TYPES_NR];         /*! pointers on allocated KCMs      */
     123        ppm_t           ppm;               /*! embedded kernel page manager                   */
     124        khm_t           khm;               /*! embedded kernel heap manager                   */
     125        kcm_t           kcm;               /*! embedded kernel KCMs manager                   */
     126
     127    kcm_t         * kcm_tbl[KMEM_TYPES_NR];              /*! pointers on allocated KCMs   */
    128128
    129129    // RPC
    130         remote_fifo_t     rpc_fifo;          /*! RPC fifo (one per cluster)                   */
    131     uint32_t          rpc_threads;       /*! current number of RPC threads in cluster     */
     130        remote_fifo_t   rpc_fifo[CONFIG_MAX_LOCAL_CORES];    /*! one RPC FIFO per core        */
     131    uint32_t        rpc_threads[CONFIG_MAX_LOCAL_CORES]; /*! RPC threads per core         */
    132132
    133133    // DQDT
    134         dqdt_node_t       dqdt_tbl[CONFIG_DQDT_LEVELS_NR]; /*! embedded DQDT nodes in cluster */
     134        dqdt_node_t     dqdt_tbl[CONFIG_DQDT_LEVELS_NR];     /*! embedded DQDT nodes          */
    135135
    136136    // Local process manager
    137     pmgr_t            pmgr;            /*! embedded process manager                       */
    138 
    139     void            * pic_extend;      /*! PIC implementation specific extension          */
     137    pmgr_t          pmgr;              /*! embedded process manager                       */
     138
     139    void          * pic_extend;        /*! PIC implementation specific extension          */
    140140}
    141141cluster_t;
Note: See TracChangeset for help on using the changeset viewer.