From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (NAM02-BL2-obe.outbound.protection.outlook.com [40.92.3.97]) by mx.groups.io with SMTP id smtpd.web10.8769.1603152010314484942 for ; Mon, 19 Oct 2020 17:00:10 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=HSrlJjPi; spf=pass (domain: outlook.com, ip: 40.92.3.97, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dIJyCztG0gO+R2Gf5UlmI+zHHls0abofA56c7S01AvxRojXOXUHDmu/FxVhu7PXzz8rDjJlZoAOAURz2y56Aua18l2RjBx69vQDY+gWFZYdF2PieiS61TIwYDrRpJn9akSKJZ80QO9nCn9CUiowXrr6eqAO25t5tR0kBObL6/oTioDL3hcDExY8Bg5bM7G8O6L3aCRQj+jkliajajzoWwUpegB81nUvJxkireRXLJQdIiHeigP4BsDwnevcHiG6yYatP9VwKCLfi3rZcDOB5cDwtwNJgYm1fuAFEvZTcYBjMwlzlwch88TNDvFjRGHzFThIjbH/4wDTe/zJDqpVKGg== 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=kZw6XDgCd7fMs7c2KtkSJWK+cR48u1gfVv30aXLR/Zc=; b=oafV9vJ0+LvHZCeIUvqsKTJQOr309ey8G1iX0PH8q6FkVHZjUC8pO1FE/sJGFxaHsnTSkJLWA7p5Yz6B7ebGLn2y2RRYTnmKx6NEN4W0MCs3/2IXhi9j+X9ncCuARnvUDQzr3AwnWHtAeWCgG+ycSxhn2PrxHpMl/AGWTYv6lbKAbJDHalyXFXinWFkR5gdc3vzwMFsMvqfA858QogSHR2Y3yuuJ24NCxgr3G10W8EtEgEvL+zR957TGvdTJX79N9X1hLJ+kAhtmxoHdsqFLecMDtCWpSbEE1AY5JI5a+rZudL1Z0hvvUJQJUZZ3rGZ/S5IcbvX718XeT9W2Tv/1bg== 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=kZw6XDgCd7fMs7c2KtkSJWK+cR48u1gfVv30aXLR/Zc=; b=HSrlJjPiFnAQ5Q/iacUOBs/Ahm6KkYTsRXuYRnbZ9SLVVB/xb0JJQGImwlwvsfos2cfN24umio36k5FPBQFVrK2ZWEzW6VzuXNb/2+4Tq1fq1vdBhOZJgy6Pc9sJ0Cl4NrZtsey8oBcztlLUtqxFOVExXoLTMptZBw1RBmsG4ERu6tPNLPMxl/GkyoZiP7VP8qScL0Zv98tB6iJmSAvwJJHezd2KCsRpeZrMZ6DjfpVo4D5Tyc5EaJtPLCpW8+4qilkyio7mFKM6wv7joU7Hsse4l4HX0cwArevJX3y+Wmg4zvHD04mFhoOrJ2BUrE0PAvfkivbARIddbZdGAbFUUQ== Received: from CY1NAM02FT029.eop-nam02.prod.protection.outlook.com (10.152.74.59) by CY1NAM02HT095.eop-nam02.prod.protection.outlook.com (10.152.75.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Tue, 20 Oct 2020 00:00:08 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2a01:111:e400:7e45::4e) by CY1NAM02FT029.mail.protection.outlook.com (2a01:111:e400:7e45::399) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Tue, 20 Oct 2020 00:00:08 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:CDB639C8556AC40EF1E5755AF4BED08A6B7644B66689C52BADF58E9C7F300262;UpperCasedChecksum:017B68C554669E1DC906E2A5A45F8B2E86D1B12340B5606E088133F1CA8B9DF2;SizeAsReceived:7663;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.3477.028; Tue, 20 Oct 2020 00:00:07 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io CC: Liming Gao , Michael D Kinney , Guomin Jiang , Wei6 Xu Subject: [PATCH v6 2/6] FmpDevicePkg: Add Last Attempt Status header files Date: Mon, 19 Oct 2020 16:59:35 -0700 Message-ID: X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201019235939.2320-1-michael.kubacki@outlook.com> References: <20201019235939.2320-1-michael.kubacki@outlook.com> X-TMN: [ltIjdBhiIctgtYr0R2O3ukG3y2iQR0vtHSvEApSn2fs5ppBnxmNhm5HZHvGOYavw] X-ClientProxiedBy: MWHPR14CA0067.namprd14.prod.outlook.com (2603:10b6:300:81::29) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20201019235939.2320-3-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2001:4898:80e8:2:819c:275:72be:ff50) by MWHPR14CA0067.namprd14.prod.outlook.com (2603:10b6:300:81::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Tue, 20 Oct 2020 00:00:07 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 2b2df5c4-0521-4e85-0f71-08d8748b1acf X-MS-TrafficTypeDiagnostic: CY1NAM02HT095: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y07Z9SMqjLm1xINlrj7SHrF3A0dlJ3PNCkBw4yQqLo76sasVKWEQxXhBnA65JtG2U2KQkeafhMCC4PoHI4YGWRAjC+IeaoKR2ybQBGVjC4VHuRQ9v81CbcuigYG8/MpRP0WjUWOup+hHTdGaNnsVd0VGf4fpB2f/PG3qG0q5rPdBQLwF+7m+NR5uT9VfaF/zpoFof6t6C0jWGyw+BEELJQ== X-MS-Exchange-AntiSpam-MessageData: fp9KZRq9xaCM7jE2YJic02TaM41lY5pD5y3SfC26gKcEXAAYI6J+IBGKoQ8oDxyXAN9OJ762Al8n1ea3Dj4t9/Ed/mIUeaaT8sdbZPQwMSQF+4WHV9OYTRnxjvUwRsMeJLuqkMTDPUGXE6fYQIzFbAjhDIH1+8GB0QUQieTCWFJNsIkOCSroiKEo6qjWYtBE92BPECH066MdzewQ3D1M1w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b2df5c4-0521-4e85-0f71-08d8748b1acf X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2020 00:00:07.4467 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT029.eop-nam02.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: CY1NAM02HT095 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 Acked-by: Liming Gao Reviewed-by: Wei6 Xu --- 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..de865a2e3d26 --- /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