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 50E00740038 for ; Fri, 29 Sep 2023 22:12:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=5S8PkRuMelppu+XZs1e57V6pROk7W0qGrbacLhCxze8=; 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=1696025522; v=1; b=aOmUCbWQCaOWnkw60T7r3ISGv7YOXdJKHwG0BqIOxGJcobVjUEYz79qCoDscDT+xmNxc8EbT veqf7zk/YiUM3CRTWj9ZmOgXCamo7sL3gmto1bQ+fbT0nF48dAf3N+IHtaSGqVO+DhYuAx6H8Xk 2lbO4HdZFV5b/l/KYi82rYmU= X-Received: by 127.0.0.2 with SMTP id 1FTQYY7687511xce26NVXeSp; Fri, 29 Sep 2023 15:12:02 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.30500.1696025521993401019 for ; Fri, 29 Sep 2023 15:12:02 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="382301663" X-IronPort-AV: E=Sophos;i="6.03,188,1694761200"; d="scan'208";a="382301663" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 15:12:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="893582771" X-IronPort-AV: E=Sophos;i="6.03,188,1694761200"; d="scan'208";a="893582771" X-Received: from nldesimo-desk.amr.corp.intel.com ([10.241.240.72]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 15:10:46 -0700 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Andrew Fish , Ray Ni , Michael D Kinney , Chasel Chiu Subject: [edk2-devel] [PATCH v2] EmulatorPkg: Add EFI_STATUS return to EMU_THUNK_PROTOCOL.SetTime() Date: Fri, 29 Sep 2023 15:11:46 -0700 Message-Id: <20230929221146.1727-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: Lxn0kJOcz6qPYCwRwMI23y4Vx7686176AA= 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=aOmUCbWQ; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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 (#109228): https://edk2.groups.io/g/devel/message/109228 Mute This Topic: https://groups.io/mt/101667678/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-