diff options
| author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2022-04-20 18:09:30 +0200 |
|---|---|---|
| committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2022-05-19 12:11:51 +0200 |
| commit | 3b7c5e8adf9ca64f8dd70279076de085ea6369d7 (patch) | |
| tree | cdfea93835f92e9bcb2b8605cdf9e815d8d98bbd /tools/thermal/lib/mainloop.h | |
| parent | 47c4b0de080adc125526aa80221c4e3ffbf97b6d (diff) | |
tools/thermal: Add util library
The next changes will provide a couple of tools using some common
functions provided by this library.
It provides basic wrappers for:
- mainloop
- logging
- timestamp
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20220420160933.347088-3-daniel.lezcano@linaro.org
Diffstat (limited to 'tools/thermal/lib/mainloop.h')
| -rw-r--r-- | tools/thermal/lib/mainloop.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/thermal/lib/mainloop.h b/tools/thermal/lib/mainloop.h new file mode 100644 index 000000000000..89b61e89d905 --- /dev/null +++ b/tools/thermal/lib/mainloop.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +/* Copyright (C) 2022, Linaro Ltd - Daniel Lezcano <daniel.lezcano@linaro.org> */ +#ifndef __THERMAL_TOOLS_MAINLOOP_H +#define __THERMAL_TOOLS_MAINLOOP_H + +typedef int (*mainloop_callback_t)(int fd, void *data); + +extern int mainloop(unsigned int timeout); +extern int mainloop_add(int fd, mainloop_callback_t cb, void *data); +extern int mainloop_del(int fd); +extern void mainloop_exit(void); +extern int mainloop_init(void); +extern void mainloop_fini(void); + +#endif |
