From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 041E4D80144 for ; Fri, 29 Sep 2023 22:11:12 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=GycuG7CsSPb2Z5FcJU5s3s0+qRTGvbEyic5/ZUZTd8I=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696025471; v=1; b=DL4u1zFMapl7Fh+H7z8GtBxWbNmQloolc3ZYnthwYqat0mSsKO9Iq9ZRhFIgyR1vIyF9+hdv uRMj7OIfNSmzABj7FEu0qeRzuoRfAjwsnWIhBuhgzBLDmZnNBzfwRU8x3kFq/C8qpj2FxC3Mm/u TjIc4OcGH0sjgE3KPej5xK6U= X-Received: by 127.0.0.2 with SMTP id R3ovYY7687511xVBrHsRnK2G; Fri, 29 Sep 2023 15:11:11 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.30622.1696025471074929015 for ; Fri, 29 Sep 2023 15:11:11 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="361773016" X-IronPort-AV: E=Sophos;i="6.03,188,1694761200"; d="scan'208";a="361773016" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 15:11:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="785225694" X-IronPort-AV: E=Sophos;i="6.03,188,1694761200"; d="scan'208";a="785225694" X-Received: from nldesimo-desk.amr.corp.intel.com ([10.241.240.72]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 15:11:10 -0700 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Andrew Fish , Ray Ni , Michael D Kinney , Chasel Chiu Subject: [edk2-devel] [PATCH v1] Add EFI_STATUS return to EMU_THUNK_PROTOCOL.SetTime() Date: Fri, 29 Sep 2023 15:10:51 -0700 Message-Id: <20230929221051.1701-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nathaniel.l.desimone@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NaY9CgcUDLXcjHyp913hx6hBx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=DL4u1zFM; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) There is an inconsistency between the UNIX and Windows implementations of EMU_THUNK_PROTOCOL.SetTime(). The Windows version returns an EFI_STATUS value whereas the the UNIX implementation is VOID. However, the UNIX implementation is an unimplemented stub whereas the Windows version is implementated. The current EMU_THUNK_PROTOCOL function pointer definition specifies a VOID return type. However, EMU_THUNK_PROTOCOL.SetTime() is close to the spec defined gRT->SetTime() except for missing the EFI_STATUS return type. Therefore, I conclude that the most sensible reconciliation is to add the EFI_STATUS return type to the protocol definition. Cc: Andrew Fish Cc: Ray Ni Cc: Michael D Kinney Cc: Chasel Chiu Signed-off-by: Nate DeSimone --- EmulatorPkg/Include/Protocol/EmuThunk.h | 5 +++-- EmulatorPkg/Unix/Host/EmuThunk.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/EmulatorPkg/Include/Protocol/EmuThunk.h b/EmulatorPkg/Include/Protocol/EmuThunk.h index c419d0a677..bdd57f410b 100644 --- a/EmulatorPkg/Include/Protocol/EmuThunk.h +++ b/EmulatorPkg/Include/Protocol/EmuThunk.h @@ -2,6 +2,7 @@ Emulator Thunk to abstract OS services from pure EFI code Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.
+ Copyright (c) 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -148,12 +149,12 @@ VOID typedef VOID (EFIAPI *EMU_GET_TIME)( - OUT EFI_TIME *Time, + OUT EFI_TIME *Time, OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL ); typedef -VOID +EFI_STATUS (EFIAPI *EMU_SET_TIME)( IN EFI_TIME *Time ); diff --git a/EmulatorPkg/Unix/Host/EmuThunk.c b/EmulatorPkg/Unix/Host/EmuThunk.c index ee0843eebf..c57c105a53 100644 --- a/EmulatorPkg/Unix/Host/EmuThunk.c +++ b/EmulatorPkg/Unix/Host/EmuThunk.c @@ -387,14 +387,14 @@ SecGetTime ( } } -VOID +EFI_STATUS SecSetTime ( IN EFI_TIME *Time ) { // Don't change the time on the system // We could save delta to localtime() and have SecGetTime adjust return values? - return; + return EFI_UNSUPPORTED; } EFI_STATUS -- 2.39.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109227): https://edk2.groups.io/g/devel/message/109227 Mute This Topic: https://groups.io/mt/101667662/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-