From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.92.47.68]) by mx.groups.io with SMTP id smtpd.web12.491.1602796325480569708 for ; Thu, 15 Oct 2020 14:12:05 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=m5BVQxMh; spf=pass (domain: outlook.com, ip: 40.92.47.68, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gnjluGxn+fwNPupONjb72SPIftheHod+8Csw0RFnuj1uZev6pDOws5Ktlfda1LH0WvaHYJklm5ve4xB47GQUDILxtH2JJxd0eaS6IU8Gb6KCchVAWopTl00MrxpLm2+kRWeXZgRUTjKRIdfI762Wf0qzgDKmya/7ywM34SrLjTQAQAJFp0zbVHHrRRPoxzgv0kpBTN0LrVAe85U++82dYWZEAkuV2euJFsZqW6URPOrsbmQB+C937sQnjSt/CsYgF8QJ85OPsg/A1n2XQvVtUKrDfltE14MBLleVED5qinCXoSCv1FDUE/ZTkU3UTCrOe4JdSceNTYJdxoKvg+maUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F7Aw1HwwWfqzZuFba04o9U24XO6MR6RsrlCAOwuAhkg=; b=R3tNq8+XB+3089DIcP/8AEu4sXWRJnbl203fqdtEcbFMbb6MHtuzsZlifhY+kTFED7HLsB7CMQ4WszjI9J2mT+lI1Ei6lPduIMa/dj3S+fXIwAVn7Dq/YdGHkAcoKfejfGYvuyrg/Z+BHgp6vdw2QSuK/NEeDPvahj2i3to1pWVkd75vHkf26HdrUIyYoeBc73E8rffolOPIZ22W8JBbi3Ud4QtvtmZI+O7weGuMJBUwmwX20AG/tI9FK7/xdBzVocCLOrrRXEx6F46LL1wi2pqFpx/VzfWh99+LHg77K7++MRDFhYq/CKoXc/OocYQ+RfIzyfWQKYZcuqI2RIugAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F7Aw1HwwWfqzZuFba04o9U24XO6MR6RsrlCAOwuAhkg=; b=m5BVQxMhoj0ZZJ1ZxQnNyUVWWqMq1eWrAqNtoZK/i7PxWerOiac1yEg1DM3w2rAH0n9VvejrkhHl6FaUpk/y3aQiBGkQqfkOwPOeToLoT/KbSg0OJ/Nt6dC/qKpFdh/PPWkGa0eZF1dLrbN/P238TuE1ANqM5uwK1K8p4hD1fFAP5xcnvYUbmHmhilRMxo1r6VPu0IZm1JQlh+vdTWCx0ekeKMudTRaM7VgNSSWFSHWF0t17TC4d755NP5EygEzgkx3CmECXKcQ5Hn4CC93lhuR5s+I0YuwDYSTHlprpWNeobNgd32sihgonrGMeXvik723UQqDEBjT5lFTsntfcWA== Received: from DM6NAM04FT027.eop-NAM04.prod.protection.outlook.com (2a01:111:e400:7ea3::50) by DM6NAM04HT057.eop-NAM04.prod.protection.outlook.com (2a01:111:e400:7ea3::115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.27; Thu, 15 Oct 2020 21:12:04 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2a01:111:e400:7ea3::53) by DM6NAM04FT027.mail.protection.outlook.com (2a01:111:e400:7ea3::334) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.27 via Frontend Transport; Thu, 15 Oct 2020 21:12:04 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:11A52A789FD368BD3C7B45EA8B7EA1166A71506CEC4588D8ECEF6A94FD73980F;UpperCasedChecksum:A4DED0CD01E749571715A3240636CAA71C5724C6B68C107612EFDCE24BF8D5B2;SizeAsReceived:7665;Count:47 Received: from MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::858f:bd50:1b65:e803]) by MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::858f:bd50:1b65:e803%7]) with mapi id 15.20.3455.031; Thu, 15 Oct 2020 21:12:04 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io CC: Liming Gao , Michael D Kinney , Guomin Jiang , Wei6 Xu Subject: [PATCH v5 2/6] FmpDevicePkg: Add Last Attempt Status header files Date: Thu, 15 Oct 2020 14:11:17 -0700 Message-ID: X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201015211121.1927-1-michael.kubacki@outlook.com> References: <20201015211121.1927-1-michael.kubacki@outlook.com> X-TMN: [VsA056E3jJhjaT7wBTp6j323rVS0yF5DUplOoeZ2DV8SmjFwK0vIl9KGxtR3Q5Zg] X-ClientProxiedBy: MWHPR22CA0029.namprd22.prod.outlook.com (2603:10b6:300:69::15) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20201015211121.1927-3-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2001:4898:80e8:8:d168:ab8a:5f17:7fc6) by MWHPR22CA0029.namprd22.prod.outlook.com (2603:10b6:300:69::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20 via Frontend Transport; Thu, 15 Oct 2020 21:12:03 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 78426122-846a-4e86-d855-08d8714ef704 X-MS-TrafficTypeDiagnostic: DM6NAM04HT057: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ovt24Ddr+dXaZl7Q1SrU/jPUEfbKPR8FKCbIxk/N+I8C6kT/7NqHC4vhNQndIo7pi0c+0Hp1VFxE0+iJkS7Z8fnVsvTT6dSiJYjvtQrjwEfq6AzSyRajeD5wGK/8fkOk8q5YDyQTgvfrsoWlKvjjQWnUw2a3CMcdRqtuQiE1GNvfREhR6tmquJhXE4RaQvDis6Srj/QZaKzuXMCCE6GDIQ== X-MS-Exchange-AntiSpam-MessageData: EZ5xRTh3hSkdNBFKIPjJaeXbcJjXs+ZqhNxQKeyH1tChbBAtbOodX2eJlUQpH+udoxFF6LkCQELXhQ+Lq/+bFziMQncdsCfgzPn0V2uZ08m6YjBxn9Wb2fNBMERkKR8xc3WKrGt4LRtyC86Ap+cwV20bZEGBYTBNuANdXq2N0kB+c/kjISvXH2b2j55URHEDfT2ADpPRZItxn8vmeQRfsA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78426122-846a-4e86-d855-08d8714ef704 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2020 21:12:04.0631 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DM6NAM04FT027.eop-NAM04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM04HT057 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Michael Kubacki Introduces a public and a private header file to define more granular usage of the UEFI Specification defined unsuccessful vendor range for Last Attempt Status codes. The unsuccessful vendor range is described in UEFI Specification 2.8A section 23.4. The public header file Include/LastAttemptStatus.h defines ranges within the unsuccessful vendor range. At a high-level, the two main ranges are defined are the FMP Reserved range and the Device Library Reserved range. The FMP Reserved range is reserved for usage of components within FmpDevicePkg. PrivateInclude/FmpLastAttemptStatus.h contains usage details and specific Last Attempt Status code definitions. The Device Library Reserved range is reserved for usage by FmpDeviceLib instances. Each library may define custom Last Attempt Status codes within the bounds defined in Include/LastAttemptStatus.h: [LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE, LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE] Cc: Liming Gao Cc: Michael D Kinney Cc: Guomin Jiang Cc: Wei6 Xu Signed-off-by: Michael Kubacki --- FmpDevicePkg/Include/LastAttemptStatus.h | 81 ++++++++++++++++++= ++ FmpDevicePkg/PrivateInclude/FmpLastAttemptStatus.h | 81 ++++++++++++++++++= ++ 2 files changed, 162 insertions(+) diff --git a/FmpDevicePkg/Include/LastAttemptStatus.h b/FmpDevicePkg/Includ= e/LastAttemptStatus.h new file mode 100644 index 000000000000..0dcd1ef71621 --- /dev/null +++ b/FmpDevicePkg/Include/LastAttemptStatus.h @@ -0,0 +1,81 @@ +/** @file + Defines last attempt status code ranges within the UEFI Specification + defined unsuccessful vendor range. + + Copyright (c) Microsoft Corporation.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __LAST_ATTEMPT_STATUS_H__ +#define __LAST_ATTEMPT_STATUS_H__ + +/// +/// Last Attempt Status Unsuccessful Vendor Range Map +/// +/// Update this map any time new ranges are added. Pre-existing range defi= nitions cannot be modified +/// to keep status code definitions consistent over time. +/// +/// START | END | Usage +/// ------------------------------------------------------------------| +/// 0x1000 | 0x17FF | FmpDevicePkg | +/// 0x1000 | 0x107F | FmpDxe driver | +/// 0x1080 | 0x109F | FmpDependencyLib | +/// 0x10A0 | 0x10BF | FmpDependencyCheckLib | +/// 0x10C0 | 0x17FF | Unused. Available for future expansion. | +/// 0x1800 | 0x1FFF | FmpDeviceLib instances implementation | +/// 0x2000 | 0x3FFF | Unused. Available for future expansion. | +/// + +/// +/// The minimum value of the FMP reserved range. +/// +#define LAST_ATTEMPT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE = 0x1000 + +/// +/// The maximum value of the FMP reserved range. +/// +#define LAST_ATTEMPT_STATUS_FMP_RESERVED_MAX_ERROR_CODE_VALUE = 0x1FFF + +/// +/// The minimum value allowed for FmpDxe driver-specific errors. +/// +#define LAST_ATTEMPT_STATUS_DRIVER_MIN_ERROR_CODE_VALUE = 0x1000 + +/// +/// The maximum value allowed for FmpDxe driver-specific errors. +/// +#define LAST_ATTEMPT_STATUS_DRIVER_MAX_ERROR_CODE_VALUE = 0x107F + +/// +/// The minimum value allowed for FmpDependencyLib related errors. +/// +#define LAST_ATTEMPT_STATUS_FMP_DEPENDENCY_LIB_MIN_ERROR_CODE_VALUE = 0x1080 + +/// +/// The maximum value allowed for FmpDependencyLib related errors. +/// +#define LAST_ATTEMPT_STATUS_FMP_DEPENDENCY_LIB_MAX_ERROR_CODE_VALUE = 0x109F + +/// +/// The minimum value allowed for FmpDependencyCheckLib related errors. +/// +#define LAST_ATTEMPT_STATUS_FMP_DEPENDENCY_CHECK_LIB_MIN_ERROR_CODE_VALUE = 0x10A0 + +/// +/// The maximum value allowed for FmpDependencyCheckLib related errors. +/// +#define LAST_ATTEMPT_STATUS_FMP_DEPENDENCY_CHECK_LIB_MAX_ERROR_CODE_VALUE = 0x10BF + +/// +/// The minimum value allowed for FMP device library errors. +/// +#define LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE = 0x1800 + +/// +/// The maximum value allowed for FMP device library errors. +/// +#define LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE = 0x1FFF + +#endif diff --git a/FmpDevicePkg/PrivateInclude/FmpLastAttemptStatus.h b/FmpDevice= Pkg/PrivateInclude/FmpLastAttemptStatus.h new file mode 100644 index 000000000000..a0cc94f69955 --- /dev/null +++ b/FmpDevicePkg/PrivateInclude/FmpLastAttemptStatus.h @@ -0,0 +1,81 @@ +/** @file + Defines private last attempt status codes used in FmpDevicePkg. + + Copyright (c) Microsoft Corporation.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __FMP_LAST_ATTEMPT_STATUS_H__ +#define __FMP_LAST_ATTEMPT_STATUS_H__ + +/// +/// Last attempt status codes defined for additional granularity in FmpDev= icePkg components. +/// +/// These codes are defined within the last attempt status FMP reserved ra= nge which extends from +/// LAST_ATTEMPT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE to LAST_ATTEMPT_= STATUS_FMP_RESERVED_MAX_ERROR_CODE_VALUE. +/// +/// The following last attempt status code ranges are currently defined fo= r the corresponding component: +/// * LAST_ATTEMPT_STATUS_DRIVER - FMP driver +/// * LAST_ATTEMPT_STATUS_DEPENDENCY - FMP dependency functionality +/// +/// Future last attempt status code additions in FmpDevicePkg should be ad= ded as follows: +/// * FmpDxe driver: Onto the end of the LAST_ATTEMPT_STATUS_DRIVER_ERRO= R range +/// * FMP dependency functionality: Onto the end of the LAST_ATTEMPT_STA= TUS_DEPENDENCY_ERROR range +/// * Other components: Add a new range onto the end of the last existin= g range in the enum within the limits of +/// [LAST_ATTEMPT_STATUS_FMP_RESERVED_MIN_ERROR_CODE_VALUE,LAST_ATTEMP= T_STATUS_FMP_RESERVED_MAX_ERROR_CODE_VALUE] +/// +/// The value of pre-existing last attempt status codes should never be mo= dified to ensure the values remain +/// consistent over time. +/// +enum LAST_ATTEMPT_STATUS_EXPANDED_ERROR_LIST +{ + /// + /// Last attempt status codes used in FmpDxe + /// + LAST_ATTEMPT_STATUS_DRIVER_ERROR_GET_FMP_HEADER =3D LAST= _ATTEMPT_STATUS_DRIVER_MIN_ERROR_CODE_VALUE, + LAST_ATTEMPT_STATUS_DRIVER_ERROR_PROGRESS_CALLBACK_ERROR , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_CHECK_POWER_API , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_CHECK_SYS_THERMAL_API , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_THERMAL , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_CHECK_SYS_ENV_API , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_SYSTEM_ENV , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_GET_FMP_HEADER_SIZE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_GET_ALL_HEADER_SIZE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_GET_FMP_HEADER_VERSION , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_IMAGE_NOT_PROVIDED , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_IMAGE_NOT_UPDATABLE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_INVALID_CERTIFICATE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_INVALID_IMAGE_INDEX , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_INVALID_KEY_LENGTH , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_INVALID_KEY_LENGTH_VALUE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_VERSION_TOO_LOW , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_DEVICE_LOCKED , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_IMAGE_AUTH_FAILURE , + LAST_ATTEMPT_STATUS_DRIVER_ERROR_PROTOCOL_ARG_MISSING , + + /// + /// Last attempt status codes used in FmpDependencyLib + /// + LAST_ATTEMPT_STATUS_DEPENDENCY_LIB_ERROR_GET_DEPEX_FAILURE =3D = LAST_ATTEMPT_STATUS_FMP_DEPENDENCY_LIB_MIN_ERROR_CODE_VALUE, + LAST_ATTEMPT_STATUS_DEPENDENCY_LIB_ERROR_NO_END_OPCODE , + LAST_ATTEMPT_STATUS_DEPENDENCY_LIB_ERROR_UNKNOWN_OPCODE , + LAST_ATTEMPT_STATUS_DEPENDENCY_LIB_ERROR_GUID_BEYOND_DEPEX , + LAST_ATTEMPT_STATUS_DEPENDENCY_LIB_ERROR_VERSION_BEYOND_DEPEX , + LAST_ATTEMPT_STATUS_DEPENDENCY_LIB_ERROR_VERSION_STR_BEYOND_DEPEX , + LAST_ATTEMPT_STATUS_DEPENDENCY_LIB_ERROR_FMP_NOT_FOUND , + LAST_ATTEMPT_STATUS_DEPENDENCY_LIB_ERROR_PUSH_FAILURE , + LAST_ATTEMPT_STATUS_DEPENDENCY_LIB_ERROR_POP_FAILURE , + + // + // Last attempt status codes used in FmpDependencyCheckLib + // + LAST_ATTEMPT_STATUS_DEPENDENCY_CHECK_LIB_ERROR_FMP_PROTOCOL_NOT_FOUND = =3D LAST_ATTEMPT_STATUS_FMP_DEPENDENCY_CHECK_LIB_MIN_ERROR_CODE_V= ALUE, + LAST_ATTEMPT_STATUS_DEPENDENCY_CHECK_LIB_ERROR_MEM_ALLOC_FMP_INFO_BUFFER= _FAILED , + LAST_ATTEMPT_STATUS_DEPENDENCY_CHECK_LIB_ERROR_MEM_ALLOC_DESC_VER_BUFFER= _FAILED , + LAST_ATTEMPT_STATUS_DEPENDENCY_CHECK_LIB_ERROR_MEM_ALLOC_DESC_SIZE_BUFFE= R_FAILED , + LAST_ATTEMPT_STATUS_DEPENDENCY_CHECK_LIB_ERROR_MEM_ALLOC_FMP_VER_BUFFER_= FAILED +}; + +#endif --=20 2.28.0.windows.1