VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/ArmPkg/Library/ArmFfaLib/ArmFfaStandaloneMmLib.c@ 108794

Last change on this file since 108794 was 108794, checked in by vboxsync, 2 weeks ago

Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643

  • Property svn:eol-style set to native
File size: 2.1 KB
Line 
1/** @file
2 Arm Ffa library code for StandaloneMmCore.
3
4 Copyright (c) 2024, Arm Limited. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 @par Glossary:
8 - FF-A - Firmware Framework for Arm A-profile
9
10 @par Reference(s):
11 - Arm Firmware Framework for Arm A-Profile [https://developer.arm.com/documentation/den0077/latest]
12
13**/
14
15#include <PiMm.h>
16
17#include <Library/ArmLib.h>
18#include <Library/ArmSmcLib.h>
19#include <Library/ArmFfaLib.h>
20#include <Library/BaseLib.h>
21#include <Library/BaseMemoryLib.h>
22#include <Library/DebugLib.h>
23
24#include "ArmFfaCommon.h"
25
26/**
27 Get mapped Rx/Tx buffers.
28
29 @param [out] TxBuffer Address of TxBuffer
30 @param [out] TxBufferSize Size of TxBuffer
31 @param [out] RxBuffer Address of RxBuffer
32 @param [out] RxBufferSize Size of RxBuffer
33
34 @retval EFI_SUCCESS
35 @retval Others Error.
36
37**/
38EFI_STATUS
39EFIAPI
40ArmFfaLibGetRxTxBuffers (
41 OUT VOID **TxBuffer,
42 OUT UINT64 *TxBufferSize,
43 OUT VOID **RxBuffer,
44 OUT UINT64 *RxBufferSize
45 )
46{
47 /*
48 * StandaloneMm doesn't use Rx/Tx buffer.
49 * So, return EFI_UNSUPPORTED.
50 */
51 return EFI_UNSUPPORTED;
52}
53
54/**
55 ArmFfaLib Constructor.
56
57 @param [in] ImageHandle The firmware allocated handle for the EFI image
58 @param [in] MmSystemTable A pointer to the Management mode System Table
59
60 @retval EFI_SUCCESS Success
61 @retval Others Error
62
63**/
64EFI_STATUS
65EFIAPI
66ArmFfaStandaloneMmLibConstructor (
67 IN EFI_HANDLE ImageHandle,
68 IN EFI_MM_SYSTEM_TABLE *MmSystemTable
69 )
70{
71 EFI_STATUS Status;
72
73 Status = ArmFfaLibCommonInit ();
74 if (Status == EFI_UNSUPPORTED) {
75 /*
76 * EFI_UNSUPPORTED means FF-A interface isn't available.
77 * However, for Standalone MM modules, FF-A availability is not required.
78 * i.e. Standalone MM could use SpmMm as a legitimate protocol.
79 * Thus, returning EFI_SUCCESS here to avoid the entrypoint to assert.
80 */
81 return EFI_SUCCESS;
82 }
83
84 if (EFI_ERROR (Status)) {
85 DEBUG ((DEBUG_ERROR, "%a failed. Status = %r\n", __func__, Status));
86 }
87
88 return Status;
89}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette