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.107.75.105]) by mx.groups.io with SMTP id smtpd.web12.6321.1609930593240877652 for ; Wed, 06 Jan 2021 02:56:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=iBlJAhel; spf=pass (domain: os.amperecomputing.com, ip: 40.107.75.105, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fVnp6xM6LV4rsjJ3Ff3rXJQ6sxpUifKWan7xQm81iRTGuDQ0W87SFlteg6g8Q9J/KPdAvfY/pPsj1qMeVFSMxKU8I14+LqgKPU0y+nWtAyFQW/m47yhXTLS/4oxNgjKaD9rxXiFlwA4N9M2SeSMXarUYZrkpXjRxKely8QRR1Fx1BNyT/vuYKaE/A50veY8VD1vcDzYqpuHFbNK5q6+XbTNzKhL5TVaapPck5f1xofatMNz3fpYWBxNYdrcYWKSGcBgkPf+ViFjCcMS4vdWqiHaXRELb51HJFsXipayUsyVZ65ttdz2RYa+Ump7OXbblgu0YteCmK+fpwBmhiXNqPw== 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=Xv9iptxFzQGR5JzVAboFdubIb88OUUeo6dXwE5ZZU28=; b=DKsrSh+6Urogeaz10hlK5HQbEc8kXyeEHZ8slIH9iPaoFUT/8BWkAf7DVaWdUkZiPt1Z7yVyX428w5a4FpFirUhILTpjoiMAWMVGGMecZ+umZlqLbyMKCn9COZc0mSnvxMCN6HysUqJnxg9Y5aDSUiyZ3xPQ0uAzhEAG692Kvag8FUAkNux9xEWUB7vKnxlN+ru7vsJfmwVB6KdSAGSpR9W859yOsCbxTEY4On7wmizG3wrqhf67dW6UNB903roU+qFoUwaYBF5JwMF3uwqu9M4xA0kBCgmQuh9cC591v0UCGPMV7IT5EyTE6436k0eTQeVXJ9b/+udy6maQCDfUJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xv9iptxFzQGR5JzVAboFdubIb88OUUeo6dXwE5ZZU28=; b=iBlJAhelFSS1n/i6quMYQFgDTSgTs9WGKG9knBZrtVrksjCLW1N8f1AJCm/SGQ0lvNoiiMXLcpa0uSDTDq/qOMjRb1amXvxmvt1PdOCD0FZiqjBCaxiGpOw/TAB/U8OFpBu+ZymmycFfwocza+9Djp03az+vG2ObdgnmnmPNkvc= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) by DM6PR01MB5051.prod.exchangelabs.com (2603:10b6:5:63::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Wed, 6 Jan 2021 10:56:30 +0000 Received: from DM6PR01MB5849.prod.exchangelabs.com ([fe80::c814:9a08:5c2e:4076]) by DM6PR01MB5849.prod.exchangelabs.com ([fe80::c814:9a08:5c2e:4076%5]) with mapi id 15.20.3721.024; Wed, 6 Jan 2021 10:56:29 +0000 From: "Nhi Pham" To: devel@edk2.groups.io Cc: Nhi Pham , Leif Lindholm , Ard Biesheuvel Subject: [PATCH 0/2] Reduce duplicate code in RTC modules Date: Wed, 6 Jan 2021 17:55:56 +0700 Message-Id: <20210106105558.9582-1-nhi@os.amperecomputing.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [118.69.219.201] X-ClientProxiedBy: HK2PR06CA0008.apcprd06.prod.outlook.com (2603:1096:202:2e::20) To DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (118.69.219.201) by HK2PR06CA0008.apcprd06.prod.outlook.com (2603:1096:202:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Wed, 6 Jan 2021 10:56:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f70d46d2-828b-4da0-a3ad-08d8b231b8ee X-MS-TrafficTypeDiagnostic: DM6PR01MB5051: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KDCQrxBTeSh0t0q+ge1vZMXCINgkFQywxj7kYv8T9j5UMQTKvmqBgtNDr2eII/OGOxeN0FWV6/QB/Vbp7YhV88qpmjoRtU+QBawmPTTjwjjrqo4c6CmyUTikoA07uOX7qKvdxNAvUhjkaWKNOmYqJvuIYpbwkyqVFDwhYiu4Civo4s9JT49Oh0Ll63+4jyLTQWm3Efo6rkdgRzkjsb/cvOVdH/KsErpemhzBJnNqGPZgY0IpEGvIOKMW3oxmyBzXwUMtWfFqTSfy1hdbX7D6pNowNUMWNNHfvSefYBi2Mtt0gBrQ77wxfXNEOVh/aqaeD64l5/WU/9yws1eTaeQRHUOt57KAgWKFKNAGShXOs/Ek4FFm3q08AWveiGx8wLvKRMyA7scj4UaBBm7CmzE4Z2dwrea3SENnDYFGqDFdktHvxeqNhqK7W/pcqRoIuojLDRXCjBUdEhY/Rn0NubxmbA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR01MB5849.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(346002)(376002)(39850400004)(396003)(136003)(66556008)(956004)(2616005)(4326008)(54906003)(316002)(5660300002)(6506007)(26005)(52116002)(66946007)(69590400011)(66476007)(186003)(2906002)(16526019)(8936002)(86362001)(4744005)(8676002)(6666004)(6486002)(6916009)(83380400001)(1076003)(478600001)(6512007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?9KvKOuqoGMqYGb5JyZwuYAeJ8l73ZeOp4f7qhzd3RmJd4EAQz3BiINvPRLu0?= =?us-ascii?Q?08DuKF6H6Wjrlmj5CLhrR4g2EwcVS7Uf72Vox92Tidoetxs+0w1HsXANBY1W?= =?us-ascii?Q?hUpY2HtTFUYH8StHg5uYet1/1lyY+xuImpkijbztBhZ7vxau8SXGoKRLxhEb?= =?us-ascii?Q?DVEcnVriwmQGPwk9jP3yNDJeqQ/lf9jdGMP2o3T5hITxF3XZ5LMpTaiUgF1j?= =?us-ascii?Q?5ys1DM3rfK3hxpEotTOBU/uECEasVhgdp92hCrfiTJRoD34NSVjyjsdixR+9?= =?us-ascii?Q?JJkP51k0s7b4Qeo7kL+RrIC98FSoF1si2p415qTc/XXOC3eR8R8m11vTCXGD?= =?us-ascii?Q?2CKlOwUBbjhsqTGT124P8vKXHUaziIRY3hM1OKpjEfrxlSZg5GoZIxlxtj+Z?= =?us-ascii?Q?u84pNvXjX2yOHvx329oNRwi577BKecbn1kgkDtoFiS+0D5YtdDrZnwnsMDLU?= =?us-ascii?Q?hmmcIqPvH+1tzXGq4O0ffb4plVLcAEOmdFdAhlgE+LlLsnt+G0fEm4q3tHjK?= =?us-ascii?Q?R5Bn4ipYBaTf/DskNnXuF37YV04FHK7U76wTQwZzctkTOzbVGEyj0iYWlvfG?= =?us-ascii?Q?pygqbhpGXHsYEDrw9musZbXvWofmPXFnDRbyIZ0smpBCiPUiWB9KEH8nYZf9?= =?us-ascii?Q?41ASbcXdFpxPZABY0Mjm1pIstr28FLZ/FykAQ1ugnTfz/Df/jrifuUayjQw2?= =?us-ascii?Q?G8rcQn+ryQMCxwCFJXWAp4E5RXLMDzbPIQ0+s0hOVF2KP0fN0pSYMxXR37md?= =?us-ascii?Q?wSmy7yOusA2RC/GAwdC3g4kG5dYbLT5do0RWPNHGY8SYCwsfp/EGdE3o5/yc?= =?us-ascii?Q?uQCZmDdHZ8pGgRHW+GmmBezvrpaLEW0W/gT1Kme4HmWnZZzumhpE+sbL8Mqv?= =?us-ascii?Q?f4StTAcerqioXRFV8XPkkQyY7m9E84vwl+O9JCvt0i3lYLyyUJv4/9OhwZpc?= =?us-ascii?Q?eE/APH1H8fkwBSINa7x6RBc4VnCplHwLMYDe2oY6YSj7zLpwV82j1zulsunW?= =?us-ascii?Q?TS6V?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB5849.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2021 10:56:29.7454 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-Network-Message-Id: f70d46d2-828b-4da0-a3ad-08d8b231b8ee X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IM+SqV8fBOQ88WA2AtkCL43JGxLdDcY9waAVCJzNNxu18S+wBkPu/K+h7/aMlV2q2PFseAUCA0LtL4OVoi2BmAcmn4MVMhSO+LKPsJS4Klg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB5051 Content-Type: text/plain This patch series replaces all time checking functions and leverage the helper function in TimeBaseLib library. Cc: Leif Lindholm Cc: Ard Biesheuvel Signed-off-by: Nhi Pham Nhi Pham (2): EmbeddedPkg/TimeBaseLib: Add function to check Timezone and Daylight EmbeddedPkg/RealTimeClockRuntimeDxe: Use helper functions from TimeBaseLib .../RealTimeClockRuntimeDxe.inf | 2 + EmbeddedPkg/Include/Library/TimeBaseLib.h | 13 +++ EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.c | 47 +++++++--- .../RealTimeClockRuntimeDxe/RealTimeClock.c | 88 +------------------ 4 files changed, 51 insertions(+), 99 deletions(-) -- 2.17.1