Changeset 49da044 in mainline for uspace/srv/bd/hr/fge.c


Ignore:
Timestamp:
2025-05-20T19:24:46Z (4 weeks ago)
Author:
Miroslav Cimerman <mc@…>
Children:
da80de9
Parents:
c5b60e25
Message:

hr: fge: move types to fge.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/hr/fge.c

    rc5b60e25 r49da044  
    5353#include "fge.h"
    5454
    55 /* forward declarations */
    56 struct fge_fibril_data;
    57 typedef struct fge_fibril_data fge_fibril_data_t;
    58 struct wu_queue;
    59 typedef struct wu_queue wu_queue_t;
    60 
    6155static void *hr_fpool_make_storage(hr_fpool_t *, ssize_t *);
    6256static void hr_fpool_group_epilogue(hr_fpool_t *);
     
    6660static void wu_queue_pop(wu_queue_t *, fge_fibril_data_t *);
    6761static ssize_t hr_fpool_get_free_slot(hr_fpool_t *);
    68 
    69 struct fge_fibril_data {
    70         hr_wu_t wu; /* work unit function pointer */
    71         void *arg; /* work unit function argument */
    72         hr_fgroup_t *group; /* back-pointer to group */
    73         ssize_t memslot; /* index to pool bitmap slot */
    74 };
    75 
    76 struct wu_queue {
    77         fibril_mutex_t lock;
    78         fibril_condvar_t not_empty;
    79         fibril_condvar_t not_full;
    80         fge_fibril_data_t *fexecs; /* circ-buf memory */
    81         circ_buf_t cbuf;
    82 };
    83 
    84 struct hr_fpool {
    85         fibril_mutex_t lock;
    86         bitmap_t bitmap; /* memory slot bitmap */
    87         wu_queue_t queue;
    88         fid_t *fibrils;
    89         uint8_t *wu_storage; /* pre-allocated pool storage */
    90         size_t fibril_cnt;
    91         size_t max_wus;
    92         size_t active_groups;
    93         bool stop;
    94         size_t wu_size;
    95         size_t wu_storage_free_count;
    96         fibril_condvar_t all_wus_done;
    97 };
    98 
    99 struct hr_fgroup {
    100         hr_fpool_t *pool;/* back-pointer to pool */
    101         size_t wu_cnt;/* upper bound of work units */
    102         size_t submitted; /* number of submitted jobs */
    103         size_t reserved_cnt; /* no. of reserved wu storage slots */
    104         size_t reserved_avail;
    105         size_t *memslots; /* indices to pool bitmap */
    106         void *own_mem; /* own allocated memory */
    107         size_t own_used; /* own memory slots used counter */
    108         errno_t final_errno; /* agreggated errno */
    109         size_t finished_okay; /* no. of wus that ended with EOK */
    110         size_t finished_fail; /* no. of wus that ended with != EOK */
    111         fibril_mutex_t lock;
    112         fibril_condvar_t all_done;
    113 };
    11462
    11563hr_fpool_t *hr_fpool_create(size_t fibril_cnt, size_t max_wus,
Note: See TracChangeset for help on using the changeset viewer.