diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/pc80/mc146818rtc.h | 15 | ||||
-rw-r--r-- | src/include/types.h | 7 |
2 files changed, 17 insertions, 5 deletions
diff --git a/src/include/pc80/mc146818rtc.h b/src/include/pc80/mc146818rtc.h index 170a433d8d..ef48a361d3 100644 --- a/src/include/pc80/mc146818rtc.h +++ b/src/include/pc80/mc146818rtc.h @@ -1,6 +1,8 @@ #ifndef PC80_MC146818RTC_H #define PC80_MC146818RTC_H +#include <types.h> + #ifndef RTC_BASE_PORT #define RTC_BASE_PORT 0x70 #endif @@ -171,13 +173,16 @@ static inline void cmos_write32(u8 offset, u32 value) void rtc_init(int invalid); void rtc_check_update_cmos_date(u8 has_century); #if CONFIG_USE_OPTION_TABLE -int set_option(const char *name, void *val); -int get_option(void *dest, const char *name); +enum cb_err set_option(const char *name, void *val); +enum cb_err get_option(void *dest, const char *name); unsigned read_option_lowlevel(unsigned start, unsigned size, unsigned def); #else -static inline int set_option(const char *name __attribute__((unused)), void *val __attribute__((unused))) { return -2; }; -static inline int get_option(void *dest __attribute__((unused)), - const char *name __attribute__((unused))) { return -2; } +static inline enum cb_err set_option(const char *name __attribute__((unused)), + void *val __attribute__((unused))) + { return CB_CMOS_OTABLE_DISABLED; }; +static inline enum cb_err get_option(void *dest __attribute__((unused)), + const char *name __attribute__((unused))) + { return CB_CMOS_OTABLE_DISABLED; } #define read_option_lowlevel(start, size, def) def #endif #else diff --git a/src/include/types.h b/src/include/types.h index 180fa3a68a..d1f991eb5d 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -34,6 +34,13 @@ enum cb_err { CB_SUCCESS = 0, /**< Call completed succesfully */ CB_ERR = -1, /**< Generic error code */ CB_ERR_ARG = -2, /**< Invalid argument */ + + /* NVRAM/CMOS errors */ + CB_CMOS_OTABLE_DISABLED = -100, /**< Option table disabled */ + CB_CMOS_LAYOUT_NOT_FOUND = -101, /**< Layout file not found */ + CB_CMOS_OPTION_NOT_FOUND = -102, /**< Option string not found */ + CB_CMOS_ACCESS_ERROR = -103, /**< CMOS access error */ + CB_CMOS_CHECKSUM_INVALID = -104, /**< CMOS checksum is invalid */ }; #endif /* __TYPES_H */ |