source: mainline/uspace/srv/sysman/unit.h@ 6efec7e3

Last change on this file since 6efec7e3 was 6efec7e3, checked in by Matthieu Riolo <matthieu.riolo@…>, 6 years ago

Unit polymorphism (simple mount), debug logging

  • Property mode set to 100644
File size: 642 bytes
Line 
1#ifndef SYSMAN_UNIT_H
2#define SYSMAN_UNIT_H
3
4#include <adt/list.h>
5#include <fibril_synch.h>
6
7#include "unit_mnt.h"
8#include "unit_cfg.h"
9#include "unit_tgt.h"
10#include "unit_types.h"
11
12struct unit {
13 link_t units;
14
15 unit_type_t type;
16
17 unit_state_t state;
18 fibril_mutex_t state_mtx;
19 fibril_condvar_t state_cv;
20
21 list_t dependencies;
22 list_t dependants;
23
24 union {
25 unit_mnt_t mnt;
26 unit_cfg_t cfg;
27 } data;
28};
29
30
31extern unit_t *unit_create(unit_type_t);
32extern void unit_destroy(unit_t **);
33
34// TODO add flags argument with explicit notification?
35extern void unit_set_state(unit_t *, unit_state_t);
36
37extern int unit_start(unit_t *);
38
39#endif
Note: See TracBrowser for help on using the repository browser.