diff options
| author | Jaymes Wilks <mjwilks@us.ibm.com> | 2016-11-04 10:53:04 -0500 |
|---|---|---|
| committer | Matthew A. Ploetz <maploetz@us.ibm.com> | 2016-12-12 18:00:15 -0500 |
| commit | 3cc8333f39c18fc836a9b8fcf84535d6748d0b1e (patch) | |
| tree | c71b28c77d0df0da33ac0e2d1b87d2bfcf4290cc /src/include | |
| parent | 8f2f91b900739efa6acf737f720dfeb7059b30ba (diff) | |
| download | talos-hostboot-3cc8333f39c18fc836a9b8fcf84535d6748d0b1e.tar.gz talos-hostboot-3cc8333f39c18fc836a9b8fcf84535d6748d0b1e.zip | |
Secure PNORRP port resync from p8
Brings SPNORRP p9 up to date with the latest changes from p8.
Change-Id: I9e80199ffad1b3082339069264560029e83a3d78
RTC:163078
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32260
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/errno.h | 33 | ||||
| -rw-r--r-- | src/include/usr/secureboot/service.H | 11 |
2 files changed, 40 insertions, 4 deletions
diff --git a/src/include/errno.h b/src/include/errno.h index 4664f18f8..9e75d50fe 100644 --- a/src/include/errno.h +++ b/src/include/errno.h @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -23,12 +25,18 @@ #ifndef _ERRNO_H #define _ERRNO_H +#include <map> + +// Map to to store strings of errorno codes +typedef std::map<int, const char*> ErrorNoNames; + #define ENOENT 2 // No such file or directory #define EIO 5 // I/O error #define ENXIO 6 // No such device or address #define ENOEXEC 8 // Exec format error #define EBADF 9 // Bad file descriptor #define EAGAIN 11 // Try again +#define EACCES 13 // Permission denied #define EFAULT 14 // Bad address #define EINVAL 22 // Invalid argument #define ENFILE 23 // Too many open files in system @@ -38,4 +46,27 @@ #define EWOULDBLOCK EAGAIN // operation would block +// @Brief Initialize an ErrorNoNames map +// Note: All keys and values are preceded with a '-', this is because the +// the errno's will be set to 2's complement when there's an error. +inline ErrorNoNames init_map() +{ + ErrorNoNames l_map; + l_map[-ENOENT] = "-ENOENT"; + l_map[-EIO] = "-EIO"; + l_map[-ENXIO] = "-ENXIO"; + l_map[-ENOEXEC] = "-ENOEXEC"; + l_map[-EBADF] = "-EBADF"; + l_map[-EAGAIN] = "-EAGAIN"; + l_map[-EACCES] = "-EACCES"; + l_map[-EFAULT] = "-EFAULT"; + l_map[-EINVAL] = "-EINVAL"; + l_map[-ENFILE] = "-ENFILE"; + l_map[-EDEADLK] = "-EDEADLK"; + l_map[-ETIME] = "-ETIME"; + l_map[-EALREADY] = "-EALREADY"; + l_map[-EWOULDBLOCK] = "-EWOULDBLOCK"; + return l_map; +}; + #endif diff --git a/src/include/usr/secureboot/service.H b/src/include/usr/secureboot/service.H index 577b27284..d138250ad 100644 --- a/src/include/usr/secureboot/service.H +++ b/src/include/usr/secureboot/service.H @@ -104,10 +104,15 @@ namespace SECUREBOOT /** * @brief Common secureboot handler for secureboot failures. * Properly handles callouts etc. - * - * @return i_err - Error log to cascade through failure path. + * @param[in/out] io_err Reference to error log handle. Caller's handle + * will be nullified. Handle must not be NULL, or function asserts. + * @param[in] i_waitForShutdown Whether to wait for system to shutdown (and + * never return from this call) or not (and return from this call). + * In general, code should wait for shutdown unless early in boot before + * basic services are up, or in a resource provider path. */ - void handleSecurebootFailure(errlHndl_t &i_err); + void handleSecurebootFailure( + errlHndl_t &io_err, bool i_waitForShutdown = true); } |

