Stefan Reinauer | 36c8340 | 2009-03-01 10:16:01 +0000 | [diff] [blame] | 1 | /* |
| 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 Menzel | a46a712 | 2013-02-23 18:37:27 +0100 | [diff] [blame] | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Stefan Reinauer | 36c8340 | 2009-03-01 10:16:01 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #ifndef __TYPES_H |
| 21 | #define __TYPES_H |
| 22 | #include <stdint.h> |
| 23 | #include <stddef.h> |
Stefan Reinauer | 36c8340 | 2009-03-01 10:16:01 +0000 | [diff] [blame] | 24 | |
Alexandru Gagniuc | fe9e30d | 2013-11-23 17:46:04 -0600 | [diff] [blame] | 25 | /** |
| 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 | */ |
| 33 | enum cb_err { |
| 34 | CB_SUCCESS = 0, /**< Call completed succesfully */ |
| 35 | CB_ERR = -1, /**< Generic error code */ |
| 36 | CB_ERR_ARG = -2, /**< Invalid argument */ |
Alexandru Gagniuc | d7134e0 | 2013-11-23 18:54:44 -0600 | [diff] [blame] | 37 | |
| 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 */ |
Vladimir Serbinenko | 63e35f2 | 2014-01-26 03:55:01 +0100 | [diff] [blame] | 44 | |
| 45 | /* Keyboard test failures */ |
| 46 | CB_KBD_CONTROLLER_FAILURE = -200, |
| 47 | CB_KBD_INTERFACE_FAILURE = -201 |
Alexandru Gagniuc | fe9e30d | 2013-11-23 17:46:04 -0600 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | #endif /* __TYPES_H */ |