blob: 6622a0a1fa16fea146b1e7505032f80a701675d9 [file] [log] [blame]
Angel Pons32859fc2020-04-02 23:48:27 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Kyösti Mälkkicbf95712020-01-05 08:05:45 +02003
Kyösti Mälkki919923d2014-01-28 10:02:53 +02004#ifndef _OPTION_H_
5#define _OPTION_H_
6
Kyösti Mälkki919923d2014-01-28 10:02:53 +02007#include <types.h>
Kyösti Mälkkicbf95712020-01-05 08:05:45 +02008
Kyösti Mälkkib2680a12020-01-04 18:04:39 +02009void sanitize_cmos(void);
10
Kyösti Mälkkicbf95712020-01-05 08:05:45 +020011enum cb_err cmos_set_option(const char *name, void *val);
12enum cb_err cmos_get_option(void *dest, const char *name);
13
14static inline enum cb_err set_option(const char *name, void *val)
Kyösti Mälkki919923d2014-01-28 10:02:53 +020015{
Kyösti Mälkkicbf95712020-01-05 08:05:45 +020016 if (CONFIG(USE_OPTION_TABLE))
17 return cmos_set_option(name, val);
18
Kyösti Mälkki919923d2014-01-28 10:02:53 +020019 return CB_CMOS_OTABLE_DISABLED;
20}
Kyösti Mälkkicbf95712020-01-05 08:05:45 +020021
22static 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älkki919923d2014-01-28 10:02:53 +020029
30#endif /* _OPTION_H_ */