Angel Pons | 32859fc | 2020-04-02 23:48:27 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Kyösti Mälkki | cbf9571 | 2020-01-05 08:05:45 +0200 | [diff] [blame] | 2 | |
Kyösti Mälkki | 919923d | 2014-01-28 10:02:53 +0200 | [diff] [blame] | 3 | #ifndef _OPTION_H_ |
| 4 | #define _OPTION_H_ |
| 5 | |
Kyösti Mälkki | 919923d | 2014-01-28 10:02:53 +0200 | [diff] [blame] | 6 | #include <types.h> |
Kyösti Mälkki | cbf9571 | 2020-01-05 08:05:45 +0200 | [diff] [blame] | 7 | |
Kyösti Mälkki | b2680a1 | 2020-01-04 18:04:39 +0200 | [diff] [blame] | 8 | void sanitize_cmos(void); |
| 9 | |
Kyösti Mälkki | cbf9571 | 2020-01-05 08:05:45 +0200 | [diff] [blame] | 10 | enum cb_err cmos_set_option(const char *name, void *val); |
| 11 | enum cb_err cmos_get_option(void *dest, const char *name); |
| 12 | |
| 13 | static inline enum cb_err set_option(const char *name, void *val) |
Kyösti Mälkki | 919923d | 2014-01-28 10:02:53 +0200 | [diff] [blame] | 14 | { |
Kyösti Mälkki | cbf9571 | 2020-01-05 08:05:45 +0200 | [diff] [blame] | 15 | if (CONFIG(USE_OPTION_TABLE)) |
| 16 | return cmos_set_option(name, val); |
| 17 | |
Kyösti Mälkki | 919923d | 2014-01-28 10:02:53 +0200 | [diff] [blame] | 18 | return CB_CMOS_OTABLE_DISABLED; |
| 19 | } |
Kyösti Mälkki | cbf9571 | 2020-01-05 08:05:45 +0200 | [diff] [blame] | 20 | |
| 21 | static inline enum cb_err get_option(void *dest, const char *name) |
| 22 | { |
| 23 | if (CONFIG(USE_OPTION_TABLE)) |
| 24 | return cmos_get_option(dest, name); |
| 25 | |
| 26 | return CB_CMOS_OTABLE_DISABLED; |
| 27 | } |
Kyösti Mälkki | 919923d | 2014-01-28 10:02:53 +0200 | [diff] [blame] | 28 | |
| 29 | #endif /* _OPTION_H_ */ |