1 | // SPDX-License-Identifier: GPL-3.0-or-later |
2 | |
3 | #pragma once |
4 | |
5 | #include <stdnoreturn.h> |
6 | typedef void (*power_callback_t)(void *data); |
7 | |
8 | /** |
9 | * @brief Register a callback to be called when the system is about to shut down. |
10 | * |
11 | * @param callback The callback to be called. |
12 | * @param data The data to be passed to the callback. |
13 | */ |
14 | void power_register_shutdown_callback(power_callback_t callback, void *data); |
15 | |
16 | /** |
17 | * @brief Shutdown the system. |
18 | */ |
19 | [[noreturn]] void power_shutdown(void); |
20 | |