Ignore:
Timestamp:
Jun 27, 2017, 10:24:13 AM (4 years ago)
Author:
alain
Message:

Fix bug in kernel_init, and reduce size of remote_fifo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/remote_fifo.h

    r14 r68  
    11/*
    2  * remote_fifo.h - kernel generic SRMW FIFO
     2 * remote_fifo.h - Lock-less Single-Reader Multiple-Writers FIFO
    33 *
    4  * Authors : Mohamed Lamine Karaoui / Alain Greiner (2016)
     4 * Authors : Mohamed Lamine Karaoui (2015)
     5 *           Alain Greiner (2016,2017)
    56 *
    67 * Copyright (c) UPMC Sorbonne Universites
     
    3334 * This structure defines a generic, single reader, multiple writers
    3435 * remote FIFO, that is used by the RPCs for inter cluster communications.
    35  * The accesses are implemented using a lock-free algorithm, as it
    36  * uses a ticket based mechanism to handle concurrent access between
    37  * the multiple writers.
    38  * Each FIF0 slot can contain one full cache line, even if RPCs store only
    39  * an extended pointer on the RPC descriptor in each slot.
     36 * The accesses are implemented using a lock-free algorithm, as it uses a ticket
     37 * based mechanism to handle concurrent access between multiple writers.
     38 * Each FIF0 slot can contain one 64 bits integer.
    4039 * In case of FIFO full, the writer deschedule without blocking, to retry later.
    4140 *
    4241 * WARNING : the number of slots is statically defined by the global
    4342 * configuration parameter CONFIG_REMOTE_FIFO_SLOTS for all fifos, requiring
    44  * CACHE_LINE_SIZE * CONFIG_REMOTE_FIFO_SLOTS bytes for each FIFO...
     43 * 12 * CONFIG_REMOTE_FIFO_SLOTS bytes for each FIFO.
    4544 ***********************************************************************************/
     45
    4646typedef struct remote_fifo_s
    4747{
    4848        volatile uint32_t  wr_id;                            /*! write slot index      */
    4949        volatile uint32_t  rd_id;                            /*! read  slot index      */
    50     volatile bool_t    valid[CONFIG_REMOTE_FIFO_SLOTS];  /*! empty slot if false   */
    51         cacheline_t        data[CONFIG_REMOTE_FIFO_SLOTS];   /*! fifo slot content     */
     50    volatile uint32_t  valid[CONFIG_REMOTE_FIFO_SLOTS];  /*! empty slot if 0       */
     51        uint64_t           data[CONFIG_REMOTE_FIFO_SLOTS];   /*! fifo slot content     */
    5252}
    5353remote_fifo_t;
     
    7272 ***********************************************************************************/
    7373error_t local_fifo_get_item( remote_fifo_t * fifo,
    74                              void          * item,
    75                              uint32_t        size );
     74                             uint64_t      * item );
    7675
    7776/************************************************************************************
     
    8483 * @ fifo    : extended pointer to the fifo in remote cluster.
    8584 * @ item    : pointer on a local buffer containing the item to be stored.
    86  * @ size    : actual number of bytes in one item.
    87  * @ first   : return value (true if first item registered in remote fifo)
     85 * @ first   : [out] true if first item registered in remote fifo.
    8886 * @ return  0 on success / EBUSY if a contention has been detected.
    8987 ***********************************************************************************/
    9088error_t remote_fifo_put_item( xptr_t     fifo,
    91                               void     * item,
    92                               uint32_t   size,
     89                              uint64_t * item,
    9390                              bool_t   * first );
    9491
Note: See TracChangeset for help on using the changeset viewer.