Skip to content

Commit

Permalink
Add EFI_STATUS return to EMU_THUNK_PROTOCOL.SetTime()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Ray Ni <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Chasel Chiu <[email protected]>
Signed-off-by: Nate DeSimone <[email protected]>
  • Loading branch information
nate-desimone authored and mergify[bot] committed Jan 5, 2024
1 parent 5a2490d commit 9cf1d03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions EmulatorPkg/Include/Protocol/EmuThunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Emulator Thunk to abstract OS services from pure EFI code
Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
Expand Down Expand Up @@ -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
);
Expand Down
4 changes: 2 additions & 2 deletions EmulatorPkg/Unix/Host/EmuThunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9cf1d03

Please sign in to comment.