blob: d1f991eb5dae8184d51b017e41911d6153be3e0b [file] [log] [blame]
Stefan Reinauer36c83402009-03-01 10:16:01 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2009 coresystems GmbH
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
Paul Menzela46a7122013-02-23 18:37:27 +010017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Stefan Reinauer36c83402009-03-01 10:16:01 +000018 */
19
20#ifndef __TYPES_H
21#define __TYPES_H
22#include <stdint.h>
23#include <stddef.h>
Stefan Reinauer36c83402009-03-01 10:16:01 +000024
Alexandru Gagniucfe9e30d2013-11-23 17:46:04 -060025/**
26 * Coreboot error codes
27 *
28 * When building functions that return a status or an error code, use cb_err as
29 * the return type. When failure reason needs to be communicated by the return
30 * value, define a it here. Start new enum groups with values in decrements of
31 * 100.
32 */
33enum cb_err {
34 CB_SUCCESS = 0, /**< Call completed succesfully */
35 CB_ERR = -1, /**< Generic error code */
36 CB_ERR_ARG = -2, /**< Invalid argument */
Alexandru Gagniucd7134e02013-11-23 18:54:44 -060037
38 /* NVRAM/CMOS errors */
39 CB_CMOS_OTABLE_DISABLED = -100, /**< Option table disabled */
40 CB_CMOS_LAYOUT_NOT_FOUND = -101, /**< Layout file not found */
41 CB_CMOS_OPTION_NOT_FOUND = -102, /**< Option string not found */
42 CB_CMOS_ACCESS_ERROR = -103, /**< CMOS access error */
43 CB_CMOS_CHECKSUM_INVALID = -104, /**< CMOS checksum is invalid */
Alexandru Gagniucfe9e30d2013-11-23 17:46:04 -060044};
45
46#endif /* __TYPES_H */