From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.66]) by mx.groups.io with SMTP id smtpd.web12.10594.1639398702806837373 for ; Mon, 13 Dec 2021 04:31:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=zHvVUHuP; spf=pass (domain: arm.com, ip: 40.107.5.66, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H8qzEUtZQ8x/arv5wmxkyerYYH0GCwPsCgFUFs21TRI=; b=zHvVUHuPaUNIPbTqbvjEQTuX1qNyTjZW7/1Y83qIjqVcvXh14cK0l7rlnZsolz+MM/wd7lVaCRejKVz3QVluOy0gpMRMMnL0syVvcevNhuiDD2dKsYFKtPaet455quvsYICCQfCBHtW0bdAEM1E5I9J8jzsG1IuZ0vBlotnO6h8= Received: from DU2PR04CA0154.eurprd04.prod.outlook.com (2603:10a6:10:2b0::9) by AM0PR08MB3954.eurprd08.prod.outlook.com (2603:10a6:208:130::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.11; Mon, 13 Dec 2021 12:31:33 +0000 Received: from DB5EUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b0:cafe::39) by DU2PR04CA0154.outlook.office365.com (2603:10a6:10:2b0::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.16 via Frontend Transport; Mon, 13 Dec 2021 12:31:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT043.mail.protection.outlook.com (10.152.20.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12 via Frontend Transport; Mon, 13 Dec 2021 12:31:33 +0000 Received: ("Tessian outbound 1cd1a01725a6:v110"); Mon, 13 Dec 2021 12:31:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 93872b36a229f579 X-CR-MTA-TID: 64aa7808 Received: from ec4a86b5b71e.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 80C021ED-4FD7-4ED2-A440-F25653CCF7CF.1; Mon, 13 Dec 2021 12:31:12 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ec4a86b5b71e.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 13 Dec 2021 12:31:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JurJEBEDHSf6vCf9Y8uNxoQhWR3JArKyxtr+IaPgYCVfkkjSLieMeBTqEe/qqmcW9gliPcx4jxJ7BzLU59cMYmqXtWme7K8t3Cbsh9Dn77xAZK8ypsvUWfFspW1EnPZU3Pv6ULMN2VGS3y82ZXrDtGq4UyLFjubeFrvDceM4FTAt6hwZuhCcdNfQRSe6/bqViUfnz9kK8hOo4Y30+mIWJ3cGwhqBVx5i32heOjWWEyGnqk2t65KdeMF2Hzo94y+E0KxxY6JdwiJ0qxhpsQ0HAPHYUksKSj2UoH5UUCsM+QIHf7095jRHuzkCA6dTAYKiASpzkHCM923iqbteYWKPDA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H8qzEUtZQ8x/arv5wmxkyerYYH0GCwPsCgFUFs21TRI=; b=IeXicFXBatUeUoqg1INhxDDuKDxwv9xO0cKZlKUKCXJWuTX04dgnd7lKmTpu2Tgf7zmdSP8Jx1ZjLNDcjU3Z5VkzZilng+0FkbiowcEOWpFNCHTk3dNzCxGWIbls17WNnhtGAVw4iDua3X/N0Gmi+CuJGTgIUvToNsoZ2ryyoVSk5v9vfKaWCkD3us93adg3250ou1K+OJc5FhUuhyeEFVB1AYcCwJazRULVNFWpW7to4b/ZZ4Ecd7Vj5TrFVuuk5NzbbMLI8sKjVTNdjXAzxqBHvuZ+itc4c8TGjb2tyIXee7d1JsMzHa8ldRqYl5eaJdItlsWP1XzWOs+Rpg8Vvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H8qzEUtZQ8x/arv5wmxkyerYYH0GCwPsCgFUFs21TRI=; b=zHvVUHuPaUNIPbTqbvjEQTuX1qNyTjZW7/1Y83qIjqVcvXh14cK0l7rlnZsolz+MM/wd7lVaCRejKVz3QVluOy0gpMRMMnL0syVvcevNhuiDD2dKsYFKtPaet455quvsYICCQfCBHtW0bdAEM1E5I9J8jzsG1IuZ0vBlotnO6h8= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AM7PR08MB5447.eurprd08.prod.outlook.com (2603:10a6:20b:10b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.16; Mon, 13 Dec 2021 12:31:10 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::bdcf:cfa6:b2bb:38ac]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::bdcf:cfa6:b2bb:38ac%6]) with mapi id 15.20.4755.021; Mon, 13 Dec 2021 12:31:10 +0000 Subject: Re: [PATCH v2 1/2] ArmPkg: Add SMC helper functions To: Rebecca Cran , devel@edk2.groups.io, Ard Biesheuvel , Gerd Hoffmann , Samer El-Haj-Mahmoud , Leif Lindholm , nd References: <20211101221153.18620-1-rebecca@nuviainc.com> <20211101221153.18620-2-rebecca@nuviainc.com> From: "Sami Mujawar" Message-ID: Date: Mon, 13 Dec 2021 12:31:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20211101221153.18620-2-rebecca@nuviainc.com> X-ClientProxiedBy: LO4P123CA0320.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:197::19) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 Received: from [10.1.196.43] (217.140.106.50) by LO4P123CA0320.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:197::19) with Microsoft SMTP Server (version=TLS1_2, cipher=) via Frontend Transport; Mon, 13 Dec 2021 12:31:10 +0000 X-MS-Office365-Filtering-Correlation-Id: 7e114025-d6be-4360-dd87-08d9be347f7c X-MS-TrafficTypeDiagnostic: AM7PR08MB5447:EE_|DB5EUR03FT043:EE_|AM0PR08MB3954:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Fn+Der7/zgrw+r6qHRJyVsTt0SBuRd5KPGH649LBcwKmUJadPbUOswn1agn3daUKy0VUbFXkNAwAOTJrO5CotWqAcGvX1Xx5noiQE3OigcSD4ITm6R160M1sd/O8Ork15xfB8g38L/GGVBvsbQu4mK7HjQdFBTuuk0FqouTzJZQ81l1Zne4G5QozwMG0DBcAKT6vo7FFLVa0GMqRb29RS1g7h3rz2qkIZgpHqgT65wZTq4Gkqu+mZRKTS64sp6qAOdaBxFwd9nxpReiAdcpiqEQ5MsBsUliSoQxnQMnCL3/F7Bat/04doFoGDDFHyZa+wRrLgcL4l6yBT7p6tibQkcKViD3wH4AzVRdNrGx9wLGlaPEnA1tDm5cj9YpizEJixmr++DXIBnMAegVqE14R7w0Qk2HcI15nQzec96F0m82hOYeLAJ/qOir4+WLh4Y6wdMeeiEHMZdw1WIQUOWkK8deOm5yFdLRk8lzBj6eUFHja+cwONm3IdiziKuykafCEbDgh8P2pkfXrBIqsWBAPQ6cabWGlnMZcAIS5RUKfxptu1R4W3yucUC7CfmTueKbswc+Da7K355990kg4InIrBHZmTilAbiGmAujYtyBs1cn5SrxMv2hDZM6wz2/sYPs0V8krh2QKMd588K+z1ttqq4ptqrhbYxwAdysbN4uhjvSzaoCz+JULINlu+aq1dtOirkAS9M2gy8IUCpxghPIyV/cwduC65xwUR3ncBT1iKo8sbM4uYH+o8fgLYLoGDVESrBFmIVUEhFt9TsCSM7Lypw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(66946007)(8936002)(31696002)(8676002)(6486002)(44832011)(16576012)(53546011)(52116002)(66476007)(316002)(2906002)(31686004)(6636002)(508600001)(86362001)(66556008)(83380400001)(2616005)(38100700002)(5660300002)(36756003)(26005)(186003)(38350700002)(956004)(110136005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5447 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ed72e794-f10e-42be-3958-08d9be3471d2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EpX6YJSSGSnCr0aIFdNbXxBnh/06hWPe/vPZzA711KMOIvSEuYbFyIC2iwuXJshiwV7C+JBquyOZlvt1a4qmFEgWQVqfw8vvHKZSAa7CX16PAAhTqRDanHqLK5gK314eojYbL+6gXOCzLx/RnfSYTkfoKVVV7GumC4ydX9MC2Px+jietsIkJqGrmgDkkYOVjc+WXBV4b+fC7d+Yq5ewId85VbQfy6OXLv+ZNrcr0ZNXNWRG5KFBTG1/CyUrrJvgJZOI9Z/fRCjh2bPC+61QizHouh8o3rk38AAfq9JIlvq2gX3Yr8mM8EnPgGPlCzSP5ALgUeUPjQWz+BMmG+Anrqr0jO6NZIDefnb+r3PfPx3CfcwFfvH26oMTbxVUC+3EbjZbWyJSHSozX54l0LZYBh7X5Mz1b5/vAcMXd6MqIPhTowvHqDymE1bbr5MKNvU5NCDxWMx0RdRT38Z7TiWxewGm2Blko97Bp9qUal+m8AOuCYGzB2DSRUDRGl3wmQrZVJn+VrOdDymOHIwgxNqj8xh3yXvkHfcQe06jgS+RLaX9oI0jdFJW3gC3ICd4rfGO7RreMzPYIGnniLKCc8Xb9IO775swSey75k76eyshneJw9C7kJbL+iEuppOcDwR396T5C3hYU8Q90RfvurJmXBk11Fk6OuSvoHYKJh74tJWFSVcXm1tOVxF159nYOA22zUiZ1MBeTSInTKQWz4jK5egW8j+P++0/Ye76TGWiW1lqU= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(31696002)(2906002)(82310400004)(53546011)(8676002)(47076005)(8936002)(16576012)(110136005)(83380400001)(316002)(5660300002)(6636002)(356005)(26005)(81166007)(44832011)(36756003)(956004)(6486002)(508600001)(2616005)(186003)(86362001)(336012)(70586007)(31686004)(70206006)(36860700001)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2021 12:31:33.5977 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e114025-d6be-4360-dd87-08d9be347f7c X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3954 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-GB Hi Rebecca, Thank you for this patch series. The patch series does not apply on top of latest master, which I believe is due to the Uncrustify changes. I have some minor suggestions marked inline as [SAMI]. Otherwise this patch looks good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 01/11/2021 10:11 PM, Rebecca Cran wrote: > Add functions ArmCallSmc0/1/2/3 to do SMC calls with 0, 1, 2 or 3 > arguments. > The functions return up to 3 values. > > Signed-off-by: Rebecca Cran > --- > ArmPkg/Include/Library/ArmSmcLib.h | 73 ++++++++++++ > ArmPkg/Library/ArmSmcLib/ArmSmc.c | 122 ++++++++++++++++++++ > ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf | 3 + > ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c | 85 ++++++++++++++ > 4 files changed, 283 insertions(+) > > diff --git a/ArmPkg/Include/Library/ArmSmcLib.h b/ArmPkg/Include/Library/= ArmSmcLib.h > index ced60b3c1147..343ae7f40ad2 100644 > --- a/ArmPkg/Include/Library/ArmSmcLib.h > +++ b/ArmPkg/Include/Library/ArmSmcLib.h > @@ -1,5 +1,6 @@ > /** @file > * > +* Copyright (c) 2021, NUVIA Inc. All rights reserved.
> * Copyright (c) 2012-2014, ARM Limited. All rights reserved. > * > * SPDX-License-Identifier: BSD-2-Clause-Patent > @@ -37,4 +38,76 @@ ArmCallSmc ( > IN OUT ARM_SMC_ARGS *Args > ); > > +/** Trigger an SMC call with 3 arguments. > + > + @param Function The SMC function. > + @param Arg1 Argument/result. > + @param Arg2 Argument/result. > + @param Arg3 Argument/result. > + > + @return The SMC error code. > + > +**/ > +UINTN > +ArmCallSmc3 ( > + IN UINTN Function, > + IN OUT UINTN *Arg1, > + IN OUT UINTN *Arg2, > + IN OUT UINTN *Arg3 > + ); > + > +/** Trigger an SMC call with 2 arguments. > + > + @param Function The SMC function. > + @param Arg1 Argument/result. > + @param Arg2 Argument/result. > + @param Arg3 Result. > + > + @return The SMC error code. > + > +**/ > +UINTN > +ArmCallSmc2 ( > + IN UINTN Function, > + IN OUT UINTN *Arg1, > + IN OUT UINTN *Arg2, > + OUT UINTN *Arg3 > + ); > + > +/** Trigger an SMC call with 1 argument. > + > + @param Function The SMC function. > + @param Arg1 Argument/result. > + @param Arg2 Result. > + @param Arg3 Result. > + > + @return The SMC error code. > + > +**/ > +UINTN > +ArmCallSmc1 ( > + IN UINTN Function, > + IN OUT UINTN *Arg1, > + OUT UINTN *Arg2, > + OUT UINTN *Arg3 > + ); > + > +/** Trigger an SMC call with 0 arguments. > + > + @param Function The SMC function. > + @param Arg1 Result. > + @param Arg2 Result. > + @param Arg3 Result. > + > + @return The SMC error code. > + > +**/ > +UINTN > +ArmCallSmc0 ( > + IN UINTN Function, > + OUT UINTN *Arg1, > + OUT UINTN *Arg2, > + OUT UINTN *Arg3 > + ); > + > #endif // ARM_SMC_LIB_H_ > diff --git a/ArmPkg/Library/ArmSmcLib/ArmSmc.c b/ArmPkg/Library/ArmSmcLib= /ArmSmc.c > new file mode 100644 > index 000000000000..d596003a857e > --- /dev/null > +++ b/ArmPkg/Library/ArmSmcLib/ArmSmc.c > @@ -0,0 +1,122 @@ > +/** @file > + SMC helper functions. > + > + Copyright (c) 2021, NUVIA Inc. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > + > +/** Triggers an SMC call with 3 arguments. > + > + @param Function The SMC function. > + @param Arg1 Argument/result. [SAMI] It may be good to document that these parameters are optional. I believe the OPTIONAL tag can be used in the function prototype as well. Similar comment for other functions as well. > + @param Arg2 Argument/result. > + @param Arg3 Argument/result. > + > + @return The SMC error code. > +**/ > +UINTN > +ArmCallSmc3 ( > + IN UINTN Function, > + IN OUT UINTN *Arg1, > + IN OUT UINTN *Arg2, > + IN OUT UINTN *Arg3 > + ) > +{ > + ARM_SMC_ARGS Args; > + UINTN ErrorCode; > + > + Args.Arg0 =3D Function; [SAMI] I think it would be good to zero initialise Args before use. > + > + if (Arg1 !=3D NULL) { > + Args.Arg1 =3D *Arg1; > + } > + if (Arg2 !=3D NULL) { > + Args.Arg2 =3D *Arg2; > + } > + if (Arg3 !=3D NULL) { > + Args.Arg3 =3D *Arg3; > + } > + > + ArmCallSmc (&Args); > + > + ErrorCode =3D Args.Arg0; > + > + if (Arg1 !=3D NULL) { > + *Arg1 =3D Args.Arg1; > + } > + if (Arg2 !=3D NULL) { > + *Arg2 =3D Args.Arg2; > + } > + if (Arg3 !=3D NULL) { > + *Arg3 =3D Args.Arg3; > + } > + > + return ErrorCode; > +} > + > +/** Trigger an SMC call with 2 arguments. > + > + @param Function The SMC function. > + @param Arg1 Argument/result. > + @param Arg2 Argument/result. > + @param Arg3 Result. > + > + @return The SMC error code. > + > +**/ > +UINTN > +ArmCallSmc2 ( > + IN UINTN Function, > + IN OUT UINTN *Arg1, > + IN OUT UINTN *Arg2, > + OUT UINTN *Arg3 > + ) > +{ > + return ArmCallSmc3 (Function, Arg1, Arg2, Arg3); > +} > + > +/** Trigger an SMC call with 1 argument. > + > + @param Function The SMC function. > + @param Arg1 Argument/result. > + @param Arg2 Result. > + @param Arg3 Result. > + > + @return The SMC error code. > + > +**/ > +UINTN > +ArmCallSmc1 ( > + IN UINTN Function, > + IN OUT UINTN *Arg1, > + OUT UINTN *Arg2, > + OUT UINTN *Arg3 > + ) > +{ > + return ArmCallSmc3 (Function, Arg1, Arg2, Arg3); > +} > + > +/** Trigger an SMC call with 0 arguments. > + > + @param Function The SMC function. > + @param Arg1 Result. > + @param Arg2 Result. > + @param Arg3 Result. > + > + @return The SMC error code. > + > +**/ > +UINTN > +ArmCallSmc0 ( > + IN UINTN Function, > + OUT UINTN *Arg1, > + OUT UINTN *Arg2, > + OUT UINTN *Arg3 > + ) > +{ > + return ArmCallSmc3 (Function, Arg1, Arg2, Arg3); > +} > diff --git a/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf b/ArmPkg/Library/ArmS= mcLib/ArmSmcLib.inf > index 4f4b09f4528a..a89f9203fb7e 100644 > --- a/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf > +++ b/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf > @@ -20,6 +20,9 @@ > [Sources.AARCH64] > AArch64/ArmSmc.S > > +[Sources] > + ArmSmc.c > + > [Packages] > MdePkg/MdePkg.dec > ArmPkg/ArmPkg.dec > diff --git a/ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c b/ArmPkg/Librar= y/ArmSmcLibNull/ArmSmcLibNull.c > index 2d79aadaf1fa..ca1b8830a119 100644 > --- a/ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c > +++ b/ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c > @@ -1,4 +1,5 @@ > // > +// Copyright (c) 2021, NUVIA Inc. All rights reserved. > // Copyright (c) 2016, Linaro Limited. All rights reserved. > // > // SPDX-License-Identifier: BSD-2-Clause-Patent > @@ -7,6 +8,7 @@ > > #include > #include > +#include > > VOID > ArmCallSmc ( > @@ -14,3 +16,86 @@ ArmCallSmc ( > ) > { > } > + > +/** Triggers an SMC call with 3 arguments. > + > + @param Function The SMC function. > + @param Arg1 Argument/result. > + @param Arg2 Argument/result. > + @param Arg3 Argument/result. > + > + @return The SMC error code. > +**/ > +UINTN > +ArmCallSmc3 ( > + IN UINTN Function, > + IN OUT UINTN *Arg1, > + IN OUT UINTN *Arg2, > + IN OUT UINTN *Arg3 > + ) > +{ > + return SMC_ARCH_CALL_NOT_SUPPORTED; > +} > + > +/** Trigger an SMC call with 2 arguments. > + > + @param Function The SMC function. > + @param Arg1 Argument/result. > + @param Arg2 Argument/result. > + @param Arg3 Result. > + > + @return The SMC error code. > + > +**/ > +UINTN > +ArmCallSmc2 ( > + IN UINTN Function, > + IN OUT UINTN *Arg1, > + IN OUT UINTN *Arg2, > + OUT UINTN *Arg3 > + ) > +{ > + return SMC_ARCH_CALL_NOT_SUPPORTED; > +} > + > +/** Trigger an SMC call with 1 argument. > + > + @param Function The SMC function. > + @param Arg1 Argument/result. > + @param Arg2 Result. > + @param Arg3 Result. > + > + @return The SMC error code. > + > +**/ > +UINTN > +ArmCallSmc1 ( > + IN UINTN Function, > + IN OUT UINTN *Arg1, > + OUT UINTN *Arg2, > + OUT UINTN *Arg3 > + ) > +{ > + return SMC_ARCH_CALL_NOT_SUPPORTED; > +} > + > +/** Trigger an SMC call with 0 arguments. > + > + @param Function The SMC function. > + @param Arg1 Result. > + @param Arg2 Result. > + @param Arg3 Result. > + > + @return The SMC error code. > + > +**/ > +UINTN > +ArmCallSmc0 ( > + IN UINTN Function, > + OUT UINTN *Arg1, > + OUT UINTN *Arg2, > + OUT UINTN *Arg3 > + ) > +{ > + return SMC_ARCH_CALL_NOT_SUPPORTED; > +} IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.