xref: /aosp_15_r20/external/coreboot/util/nvramtool/cmos_ops.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef CMOS_OPS_H
4 #define CMOS_OPS_H
5 
6 #include "common.h"
7 #include "layout.h"
8 
9 #define CMOS_OP_BAD_ENUM_VALUE (CMOS_OP_RESULT_START + 0)
10 #define CMOS_OP_NEGATIVE_INT (CMOS_OP_RESULT_START + 1)
11 #define CMOS_OP_INVALID_INT (CMOS_OP_RESULT_START + 2)
12 #define CMOS_OP_RESERVED (CMOS_OP_RESULT_START + 3)
13 #define CMOS_OP_VALUE_TOO_WIDE (CMOS_OP_RESULT_START + 4)
14 #define CMOS_OP_NO_MATCHING_ENUM (CMOS_OP_RESULT_START + 5)
15 
16 int prepare_cmos_read(const cmos_entry_t * e);
17 int prepare_cmos_write(const cmos_entry_t * e, const char value_str[],
18 		       unsigned long long *value);
19 uint16_t cmos_checksum_read(void);
20 void cmos_checksum_write(uint16_t checksum);
21 uint16_t cmos_checksum_compute(void);
22 void cmos_checksum_verify(void);
23 
24 #endif				/* CMOS_OPS_H */
25