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