From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by mx.groups.io with SMTP id smtpd.web08.76.1612803909733019238 for ; Mon, 08 Feb 2021 09:05:10 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=GurAk2l5; spf=pass (domain: gmx.de, ip: 212.227.17.22, mailfrom: xypron.glpk@gmx.de) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612803891; bh=CjE/ADJ6GWUIeCQCMbpPhC4YsFDyyLivVCsol+L4Kqs=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=GurAk2l5tHYduFCCqoYKCGYijEvfn4egHG5QquKT2mzSgH7GLeqM5aD4KIQlRFmmA rle25GyCspPI24ocYVOp8Zx7bmfdUpXrDm5Uw22g9iuicMyr4dR++RobYI4kuvuISN 2gxSO11e96xghABpwUBKflQRSVZv3JnOh1OouM2c= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.70] ([62.143.246.89]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MryTF-1letjr37mH-00nust; Mon, 08 Feb 2021 18:04:50 +0100 Subject: Re: [edk2-devel] [edk2-test PATCH v1 2/2] SctPkg: Enable RISCV64 support using AARCH64 sources To: Daniel Schaefer , Leif Lindholm , devel@edk2.groups.io Cc: Abner Chang , Gilbert Chen , Eric Jin , G Edhaya Chandran , Barton Gao , Samer El-Haj-Mahmoud References: <20201201161752.23734-1-daniel.schaefer@hpe.com> <20201201161752.23734-3-daniel.schaefer@hpe.com> <20201202120436.GE1664@vanye> From: "Heinrich Schuchardt" Message-ID: <7741f08d-efeb-e959-7118-fb74474e3424@gmx.de> Date: Mon, 8 Feb 2021 18:04:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K1:IIQpBCafvMC8qJu8Djefji+cnifYIsZgFPTe99VxcWclZ966U3n 7OLNWRf/54Bw8tMsgJKL4EupUCtdehygw7wF6fi4gmfViypmRWyZ9EJE1iiNWZCD8OnzInq Da5o1oyGIvkG4DXoAZsg2MCdDB1ccVZVjMd6KRSEdVLkuNB1NCOSeohUGtpHrx2yt1LuV9i cXQgysMHfh4owSqwnNPjw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:CRkaisD2O4s=:retYxvKf05CiX0HFdQLEBs 6xvJjA3EBKEKqDOhlOxmsm1q/piTcpImv4agCfsrMNE16zR90AA6XCzcIstEqedKo6/GXNljE pcsVzxmtP7+BZURfF1lnqADpb6uBqyuA212cGCAsGa04j7+FECX2yIi5egfgW2IMUgjqjSTip TWXAWNKQxqQeLYNpwEH69HUP1MVofa983A/bogE34uSeeQojESysFs8xpm9WMhyAWqoBRDRrv e6xKlBL2LeF1YBCV2abuCrnYUhx+i5EqdO6eXbPBVGtgJSNZtlQ2gt3aAGbJs5KnLIvUmguqE /kUDCWNaj1OjmjwFUZvWEVJvA/35BbJIJ31+xV8bPXiMXwFGXS2av1ToYsO8Pal+6M8W5QCz1 MZ4uPLlXSX9/rJgI35uFm1j/laoKlfwku5tjWTyYvZcFg1ojrSt7Daxp04g2zsmD2t6wUyfW4 M4Taop1eDRj2zczCkDgq1aYUR7GyXBp8mnRZjhr0RnBJbUGCfQdBsY6cbS1gqeyl2Ppw+GEZ3 Mua8vvaOgotqKL8ryaZh52s3uY3nFfYktcKB3ka63q0VMmLs4UtnjAb0lJ6Yr6fadxGxt6HXt rqtTElYALkfJUMddNwsvIoBPfzhy327CWkDUHsXAE9pO84v3y/uFwqRxjm9eavFPTdmmzILQ3 kr08Mko5WLxczjKQ909gRyamLUc1TPbwIkG4R1XytpZqTcAadSxYRqCMMS98YKfUDZ5RuKPFF YCyWh9/8ST3FhckKNNgZ7iJpagCARuKmJ+ehBumUz3uXOtPZ8c6euugXantxvLsttPZtC4LmQ psOt1QbXFUzyOSFZlYRMS0xIRy1NZR0dx1mHKvwwxagMAGsFa+EkyteNGzC0AsYjVa4z5E26g CIOK9o5bMRoFai0U6Hcg== Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 08.02.21 16:09, Daniel Schaefer wrote: > Hi Leif, > > thanks very much for the review! > I've cleaned up the patchset and addressed the issues. I'll send out > another set soon. > See comments below. > > Thanks, > Daniel > > On 12/2/20 8:04 PM, Leif Lindholm wrote: >> On Wed, Dec 02, 2020 at 00:17:52 +0800, Daniel Schaefer wrote: >>> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3042 >>> >>> TODO: Need to check whether we can avoid copying Aarch64 sources. >>> >>> Cc: Leif Lindholm >>> Cc: Heinrich Schuchardt >>> Cc: Abner Chang >>> Cc: Gilbert Chen >>> Cc: Eric Jin >>> Cc: G Edhaya Chandran >>> Cc: Barton Gao >>> Cc: Samer El-Haj-Mahmoud >>> Signed-off-by: Daniel Schaefer >>> --- >>> =C2=A0 >>> uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> |=C2=A0 32 +++ >>> =C2=A0 >>> uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> |=C2=A0 45 ++++ >>> =C2=A0 >>> uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> |=C2=A0 45 ++++ >>> =C2=A0 >>> uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> | 182 +++++++++++++ >>> =C2=A0 >>> uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> |=C2=A0 88 +++++++ >>> =C2=A0 >>> uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c=C2=A0=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> |=C2=A0 68 +++++ >>> =C2=A0 >>> uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 >>> | 134 ++++++++++ >>> =C2=A0 >>> uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 >>> |=C2=A0 48 ++++ >>> =C2=A0 >>> uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/R= iscv64/DebugSupportBBTestCacheFunction.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> | 137 ++++++++++ >>> =C2=A0 >>> uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/R= iscv64/DebugSupportBBTestExceptionCallbackFunction.c >>> | 276 ++++++++++++++++++++ >>> =C2=A0 >>> uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/R= iscv64/PlatformIsa.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> |=C2=A0 30 +++ >>> =C2=A0 >>> uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/Riscv64/= TimerInterrupt.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 >>> |=C2=A0 51 ++++ >>> =C2=A0 >>> uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/E= ntsLibPlat.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> |=C2=A0 55 ++++ >>> =C2=A0 >>> uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/I= nitPlat.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> |=C2=A0 55 ++++ >>> =C2=A0 14 files changed, 1246 insertions(+) >>> >>> diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h >>> b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h >>> new file mode 100644 >>> index 00000000..ee7c656b >>> --- /dev/null >>> +++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h >>> @@ -0,0 +1,32 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2012 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 SctLibPlat.h >>> + >>> +Abstract: >>> + >>> +=C2=A0 AArch64 specific defines >> >> *cough* > > For the next patch series I went through everything and made sure that > there's no Aarch64 or ARM anymore. > >>> + >>> +--*/ >>> + >>> +#ifndef _EFI_LIB_PLAT_H_ >>> +#define _EFI_LIB_PLAT_H_ >> >> No leading _ in macros. > > This is a common pattern in the code. Even in EDK2. > >>> + >>> +#define MIN_ALIGNMENT_SIZE=C2=A0 8 >>> + >>> +#endif >>> diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c >>> b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c >>> new file mode 100644 >>> index 00000000..a48bb2f3 >>> --- /dev/null >>> +++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c >>> @@ -0,0 +1,45 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2012 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 initplat.c >>> + >>> +Abstract: >>> + >>> +=C2=A0 Math routines for compatibility with native EFI library routin= es. >>> + >>> +--*/ >>> + >>> +#include "SctLibInternal.h" >>> + >>> +VOID >>> +InitializeLibPlatform ( >>> +=C2=A0=C2=A0=C2=A0 IN EFI_HANDLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 ImageHandle, >>> +=C2=A0=C2=A0=C2=A0 IN EFI_SYSTEM_TABLE=C2=A0=C2=A0=C2=A0=C2=A0 *Syste= mTable >>> +=C2=A0=C2=A0=C2=A0 ) >>> + >>> +{ >>> +=C2=A0 // No platform-specific initializations >>> +} >>> + >>> +UINT64 >>> +SctReadTsc ( >>> +=C2=A0 VOID >>> +=C2=A0 ) >>> +{ >>> +=C2=A0 return 0; >>> +} >>> diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S >>> b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S >>> new file mode 100644 >>> index 00000000..8bc2c624 >>> --- /dev/null >>> +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S >>> @@ -0,0 +1,45 @@ >>> +## @file >>> +# >>> +#=C2=A0 Copyright 2010 - 2012 Unified EFI, Inc.
>>> +#=C2=A0 Copyright (c) 2012, ARM Ltd. All rights reserved.
>>> +#=C2=A0 Copyright (c) 2020, Hewlett Packard Enterprise Development LP= .
>>> +# >>> +#=C2=A0 This program and the accompanying materials >>> +#=C2=A0 are licensed and made available under the terms and condition= s of >>> the BSD License >>> +#=C2=A0 which accompanies this distribution.=C2=A0 The full text of t= he >>> license may be found at >>> +#=C2=A0 http://opensource.org/licenses/bsd-license.php >>> +# >>> +#=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS= " >>> BASIS, >>> +#=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXP= RESS >>> OR IMPLIED. >>> +# >>> +## >>> +# >>> +# >>> +#/*++ >>> +# >>> +# Module Name: >>> +# >>> +#=C2=A0 GoVirtual.S >>> +# >>> +#--*/ >>> +#start of the code section >>> +.text >>> +/* FIXME: Should alignment be different on Aarch64? */ >> >> 1) FIXME >> 2) Aarch64. > > I have no idea why the alignment would be 3 on other platforms, so I > don't know how to fix it. > If anyone knows more, please let me know. I'll just change the comment > to say Riscv64. > >>> +.align 3 Both on Aarch64 and on RISC-V an odd alignment value makes no sense. .align 8 should do no harm. But is it needed? Best regards Heinrich >>> + >>> +.global JumpToTestFunc >>> +.type JumpToTestFunc, %function >>> + >>> +#--------------------------------------------------------------------= ---------- >>> >>> +# VOID >>> +# JumpToTestFunc ( >>> +#=C2=A0=C2=A0 IN=C2=A0 UINTN=C2=A0 FuncPointer, >>> +#=C2=A0=C2=A0 IN=C2=A0 UNITN=C2=A0 ConfigInfo >>> +#=C2=A0=C2=A0 ) >>> +# TODO: Make sure this code is correct >> >> No TODO. >> Should this set really be called an RFC? > > Yes, sorry, it's more of an RFC. I wanted to get it out before > Heinrich's talk at OSFC, so he could mention it. > The code works as confirmed by Heinrich, I just hadn't cleaned it up yet= . > >>> +JumpToTestFunc: >>> +=C2=A0=C2=A0=C2=A0 mv x2, x0 >>> +=C2=A0=C2=A0=C2=A0 mv x0, x1 >>> + >>> +=C2=A0=C2=A0=C2=A0 // Jump to Virtual function >>> +=C2=A0=C2=A0=C2=A0 jalr x2 >>> diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c >>> b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c >>> new file mode 100644 >>> index 00000000..397b3514 >>> --- /dev/null >>> +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c >>> @@ -0,0 +1,182 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2012 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2012, ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 VirtualMemory.c >>> + >>> +--*/ >>> + >>> +#include "SCRTApp.h" >>> + >>> +#define VIRT_TO_PHYS_OFFSET=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (0x80= 000000)=C2=A0=C2=A0=C2=A0=C2=A0 //2G >>> + >>> +BOOLEAN=C2=A0=C2=A0=C2=A0=C2=A0 HighAddress =3D FALSE; >>> +UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PageTable=C2=A0=C2=A0 =3D 0= ; >>> + >>> + >>> +VOID >>> +ConvertRuntimeFuncPtr ( >>> +=C2=A0 IN OUT UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *VirtualFunc >>> +=C2=A0 ) >>> +/*++ >>> + >>> +Routine Description: >>> + >>> +=C2=A0 Change RuntimeTestFunc physical address to virtual address >>> + >>> +Arguments: >>> + >>> +=C2=A0 VirtualFunc=C2=A0 - On input, RuntimeTestFunc physical address= . >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 On output, RuntimeTest virtual address. >>> + >>> +Returns: >>> + >>> +=C2=A0 NONE >>> + >>> +--*/ >>> +{ >>> +=C2=A0=C2=A0=C2=A0 /*Note: It is presumed that on ARM v5, V6 and V7 a= rchitectures >>> +=C2=A0=C2=A0=C2=A0=C2=A0 * the MMU is configured and enabled in PEI p= hase. As VirtualFunc >>> +=C2=A0=C2=A0=C2=A0=C2=A0 * is already mapped to virtual memory, don't= have to do >>> anything here. >>> +=C2=A0=C2=A0=C2=A0=C2=A0 */ >>> +=C2=A0 /* FIXME: Is it the same on ARM v8? */ >> >> FIXME? >> (Even if it's copied, it's wrong :) >> ARM in general. > > Fixed. Even in Riscv64 we enabled identity mapped MMU before PEI. > >>> +} >>> + >>> + >>> +EFI_STATUS >>> +DoMemoryAllocation ( >>> +=C2=A0 IN UINTN PhysicalFunc >>> +=C2=A0 ) >>> +/*++ >>> + >>> +Routine Description: >>> + >>> +=C2=A0 Allocate memory and create the PageTable to set up >>> physical-virtual map. >>> + >>> +Arguments: >>> + >>> +=C2=A0 PhysicalFunc=C2=A0 - Physical address where RuntimeTestFunc lo= cates. >>> + >>> +Returns: >>> + >>> +=C2=A0 EFI_STATUS >>> + >>> +--*/ >>> +{ >>> +=C2=A0 EFI_STATUS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status; >>> +=C2=A0 EFI_PHYSICAL_ADDRESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= AllocateMemory; >>> + >>> +=C2=A0 //create new page tables or use existing page tables. >>> +=C2=A0 // >>> +=C2=A0 // Allocate PageTable memory close to this Application image >>> location in >>> +=C2=A0 // the system memory. In this way, it is safe for page table m= emory. >>> +=C2=A0 // >>> +=C2=A0 AllocateMemory =3D PhysicalFunc; >>> + >>> +=C2=A0 Status =3D tBS->AllocatePages ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AllocateMaxAddress, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EfiRuntimeServicesData, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &AllocateMemory >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> + >>> +=C2=A0 if (EFI_ERROR(Status)) { >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> +=C2=A0 } >>> + >>> +=C2=A0 PageTable =3D (UINTN)AllocateMemory; >>> +=C2=A0 return EFI_SUCCESS; >>> +} >>> + >>> + >>> +VOID >>> +PrepareVirtualAddressMap ( >>> +=C2=A0 IN UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 MemoryMapSize, >>> +=C2=A0 IN UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 DescriptorSize, >>> +=C2=A0 IN EFI_MEMORY_DESCRIPTOR=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *= MemoryMap, >>> +=C2=A0 IN EFI_MEMORY_DESCRIPTOR=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *= VirtualMemoryMap, >>> +=C2=A0 IN OUT UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *VirtualMapSi= ze >>> +=C2=A0 ) >>> +/*++ >>> + >>> +Routine Description: >>> + >>> +=C2=A0 Construct VirtualAddressMap from physical address to virtual a= ddress >>> + >>> +Arguments: >>> + >>> +=C2=A0 MemoryMapSize=C2=A0=C2=A0=C2=A0=C2=A0 - The size, in bytes, of= the MemoryMap buffer >>> +=C2=A0 DescriptorSize=C2=A0=C2=A0=C2=A0 - The size, in bytes, of an i= ndividual >>> EFI_MEMORY_DESCRIPTOR >>> +=C2=A0 MemoryMap=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - A = pointer to the current memory map >>> +=C2=A0 VirtualMemoryMap=C2=A0 - A pointer to the modified virtual mem= ory map >>> +=C2=A0 VirtualMapSize=C2=A0=C2=A0=C2=A0 - A pointer to the size, in b= ytes, of the >>> VirtualMemoryMap buffer >>> + >>> +Returns: >>> + >>> +=C2=A0 NONE >>> + >>> +--*/ >>> +{ >>> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0 Index; >>> +=C2=A0 *VirtualMapSize=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D = 0; >>> + >>> +=C2=A0 // >>> +=C2=A0 // Copy entries that need runtime mapping to construct >>> virtualMemoryMap >>> +=C2=A0 // >>> +=C2=A0 for (Index =3D 0; Index < (MemoryMapSize / DescriptorSize); In= dex++) { >>> +=C2=A0=C2=A0=C2=A0 if ((MemoryMap->Attribute & EFI_MEMORY_RUNTIME) = =3D=3D >>> EFI_MEMORY_RUNTIME) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SctCopyMem ((VOID *) VirtualMemoryMap,= (VOID *) MemoryMap, >>> DescriptorSize); >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 VirtualMemoryMap->VirtualStart=C2=A0 = =3D >>> VirtualMemoryMap->PhysicalStart; >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *VirtualMapSize +=3D DescriptorSize; >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 VirtualMemoryMap =3D NextMemoryDescrip= tor (VirtualMemoryMap, >>> DescriptorSize); >>> +=C2=A0=C2=A0=C2=A0 } >>> + >>> +=C2=A0=C2=A0=C2=A0 MemoryMap =3D NextMemoryDescriptor (MemoryMap, Des= criptorSize); >>> +=C2=A0 } >>> +} >>> + >>> + >>> + >>> +VOID >>> +JumpVirtualMode( >>> +=C2=A0 IN UINTN VirtualFunc, >>> +=C2=A0 IN UINTN HandOffAddr >>> +=C2=A0 ) >>> +/*++ >>> + >>> +Routine Description: >>> + >>> +=C2=A0 Enable virtual addressing mode, and jump to RuntimeTestFunc in >>> virtual address >>> + >>> +Arguments: >>> + >>> +=C2=A0 VirtualFunc=C2=A0 - RuntimeTestFunc virtual address >>> +=C2=A0 HandOffAddr=C2=A0 - Configuration Data Address >>> + >>> +Returns: >>> + >>> +=C2=A0 NONE >>> + >>> +--*/ >>> +{ >>> +=C2=A0 // >>> +=C2=A0 // Note: It is assumed that the MMU and page tables are config= ured >>> on ARM platforms >>> +=C2=A0 // based on ARM v5 v6 and v7 architecture. >>> +=C2=A0 // >>> +=C2=A0 /* FIXME: Is it the same on ARM v8? */ >>> +=C2=A0=C2=A0=C2=A0 JumpToTestFunc(VirtualFunc, HandOffAddr); >> >> Again. > > Same. > >>> +} >>> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c >>> b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c >>> new file mode 100644 >>> index 00000000..6161d596 >>> --- /dev/null >>> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c >>> @@ -0,0 +1,88 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2012 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> + >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 Debug.c >>> + >>> +--*/ >>> + >>> +#include "SCRTDriver.h" >>> + >>> +UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mHandOffPtr=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 =3D=C2=A0 0; >>> +EFI_PHYSICAL_ADDRESS=C2=A0 mIoPortSpaceAddress =3D 0; >>> + >>> + >>> +EFI_STATUS >>> +ConsumeHandOff ( >>> +=C2=A0 IN=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= HandOffAddr, >>> +=C2=A0 OUT CONF_INFO=C2=A0=C2=A0=C2=A0=C2=A0 *ConfigData >>> +=C2=A0 ) >>> +{ >>> +=C2=A0=C2=A0 RUNTIME_HANDOFF=C2=A0=C2=A0 *HandOffPtr; >>> +=C2=A0=C2=A0 // >>> +=C2=A0=C2=A0 // First fix the memory address of hand off data. >>> +=C2=A0=C2=A0 // >>> +=C2=A0=C2=A0 FixAddress(&HandOffAddr); >>> +=C2=A0=C2=A0 mHandOffPtr =3D HandOffAddr; >>> +=C2=A0=C2=A0 HandOffPtr=C2=A0 =3D (RUNTIME_HANDOFF*)mHandOffPtr; >>> +=C2=A0=C2=A0 *ConfigData =3D=C2=A0 HandOffPtr->ConfigureInfo; >>> + >>> +=C2=A0=C2=A0 if (!HandOffPtr->DebuggerInfo.MmioFlag){ >>> +=C2=A0=C2=A0=C2=A0=C2=A0 // >>> +=C2=A0=C2=A0=C2=A0=C2=A0 // If debug port is I/O mapped, fix IoBase A= ddress. >>> +=C2=A0=C2=A0=C2=A0=C2=A0 // >>> +=C2=A0=C2=A0=C2=A0=C2=A0 FixAddress(&HandOffPtr->DebuggerInfo.IoBase)= ; >>> +=C2=A0=C2=A0=C2=A0=C2=A0 mIoPortSpaceAddress =3D HandOffPtr->Debugger= Info.IoBase; >> >> Looks redundant on !x86 >> >>> +=C2=A0=C2=A0 } else { >>> +=C2=A0=C2=A0=C2=A0=C2=A0 // >>> +=C2=A0=C2=A0=C2=A0=C2=A0 // If debug port is MMIO, fix MmioBase Addre= ss. >>> +=C2=A0=C2=A0=C2=A0=C2=A0 // >>> +=C2=A0=C2=A0=C2=A0=C2=A0 FixAddress(&HandOffPtr->DebuggerInfo.MmioBas= e); >>> +=C2=A0=C2=A0 } >>> + >>> +=C2=A0=C2=A0 return EFI_SUCCESS; >>> +} >>> + >>> + >>> +EFI_STATUS >>> +Send2UART ( >>> +=C2=A0 CHAR8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *String >>> +=C2=A0 ) >>> +{ >>> +=C2=A0 // >>> +=C2=A0 // TODO: On ARM platforms use platform specific functions to >>> +=C2=A0 // write the data to UART. >>> +=C2=A0 // >> >> Ye gods... > > Reminder that this is copied from the ARM sources. > In this case I'll just replace ARM by RISC-V. > >>> +=C2=A0 return EFI_SUCCESS; >>> +} >>> + >>> + >>> + >>> +EFI_STATUS >>> +DebugWorker ( >>> +=C2=A0 IN CHAR8=C2=A0=C2=A0=C2=A0 *String >>> +=C2=A0 ) >>> +{ >>> +=C2=A0 EFI_STATUS=C2=A0=C2=A0=C2=A0 Status; >>> + >>> +=C2=A0 // >>> +=C2=A0 // Send text message to registered UART. >>> +=C2=A0 // >>> +=C2=A0 Status =3D Send2UART(String); >>> +=C2=A0 return Status; >>> +} >>> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c >>> b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c >>> new file mode 100644 >>> index 00000000..cc8d9869 >>> --- /dev/null >>> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c >>> @@ -0,0 +1,68 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2012 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> + >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 Dump.c >>> + >>> +--*/ >>> + >>> +#include "SCRTDriver.h" >>> + >>> +VOID >>> +DumpRuntimeTable() >>> +{ >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= Dump Runtime Table=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("Header Signature =3D 0x%x\n", VRT->Hdr.Signature); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= GetTime Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("GetTime @ 0x%x\n", VRT->GetTime); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= SetTime Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("SetTime @ 0x%x\n", VRT->SetTime); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= GetWakeupTime >>> Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("GetWakeupTime @ 0x%x\n", VRT->GetWakeupTime); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= SetWakeupTime >>> Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("SetWakeupTime @ 0x%x\n", VRT->SetWakeupTime); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= GetVariable Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("GetVariable @ 0x%x\n", VRT->GetVariable); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= GetNextVariableName >>> Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("GetNextVariableName @ 0x%x\n", VRT->GetNextVariabl= eName); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= SetVariable Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("SetVariable @ 0x%x\n", VRT->SetVariable); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= GetNextHighMonotonicCount >>> Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("GetNextHighMonotonicCount @ 0x%x\n", >>> VRT->GetNextHighMonotonicCount); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= ResetSystem Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("ResetSystem @ 0x%x\n", VRT->ResetSystem); >>> +#if 0 >> >> Better to delete if not usable, but why disabled for AArch64 in the >> first place? > > Not sure. It's also commented out in the X86 and IPF source files. > I'll keep it. I think it would be more confusing if RISC-V was the only > platform > that didn't have this. > >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= UpdateCapsule >>> Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("UpdateCapsule @ 0x%x\n", VRT->UpdateCapsule); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= QueryCapsuleCapabilities >>> Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("QueryCapsuleCapabilities @ 0x%x\n", >>> VRT->QueryCapsuleCapabilities); >>> + >>> +=C2=A0 SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= QueryVariableInfo >>> Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); >>> +=C2=A0 SctAPrint ("QueryVariableInfo @ 0x%x\n", VRT->QueryVariableInf= o); >>> +#endif >>> +} >>> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c >>> b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c >>> new file mode 100644 >>> index 00000000..b925e151 >>> --- /dev/null >>> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c >>> @@ -0,0 +1,134 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2012 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
>> >> More trailing spaces than usual in line above. >> (The below block has 3 of them in every copy.) > > This pattern is present in almost all files in the repo. > Should we follow up with a second patch series to fix that? > In this repo there are tons of things to clean up... > Some files have CRLF and an additional LF at the end of every line. > >>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> + >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 Io.c >>> + >>> +--*/ >>> + >>> +#include "Io.h" >>> + >>> +EFI_STATUS >>> +EFIAPI >>> +CpuIoServiceWrite ( >>> +=C2=A0 IN EFI_PEI_CPU_IO_PPI_WIDTH=C2=A0 Width, >>> +=C2=A0 IN UINT64=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 User= Address, >>> +=C2=A0 IN UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 C= ount, >>> +=C2=A0 IN VOID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 *UserBuffer >>> +=C2=A0 ) >>> +/*++ >>> + >>> +Routine Description: >>> + >>> +=C2=A0 Perform the port I/O write service >>> + >>> +Arguments: >>> + >>> +=C2=A0 Width=C2=A0=C2=A0 - Width of the port I/O operation >>> +=C2=A0 Address - Base address of the port I/O operation >>> +=C2=A0 Count=C2=A0=C2=A0 - Count of the number of accesses to perform >>> +=C2=A0 Buffer=C2=A0 - Pointer to the source buffer from which to writ= e data >>> + >>> +Returns: >>> + >>> +=C2=A0 EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0 - The data was written. >>> +=C2=A0 EFI_INVALID_PARAMETER - Width is invalid. >>> +=C2=A0 EFI_INVALID_PARAMETER - Buffer is NULL. >>> +=C2=A0 EFI_UNSUPPORTED=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - The Buff= er is not aligned for the given >>> Width. >>> +=C2=A0 EFI_UNSUPPORTED=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - The addr= ess range specified by Address, >>> Width, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 and Count is not valid. >>> + >>> +--*/ >>> +{ >>> +=C2=A0 return EFI_UNSUPPORTED; >>> +} >>> + >>> + >>> +EFI_STATUS >>> +EfiIoWrite ( >>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0 EFI_PEI_CPU_IO_PPI_WIDTH=C2=A0 Widt= h, >>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0 UINT64=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 Address, >>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 Count, >>> +=C2=A0 IN OUT VOID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 *Buffer >>> +=C2=A0 ) >>> +/*++ >>> + >>> +Routine Description: >>> +=C2=A0 Perform an IO write into Buffer. >>> + >>> +Arguments: >>> +=C2=A0 Width=C2=A0=C2=A0 - Width of write transaction, and repeat ope= ration to use >>> +=C2=A0 Address - IO address to write >>> +=C2=A0 Count=C2=A0=C2=A0 - Number of times to write the IO address. >>> +=C2=A0 Buffer=C2=A0 - Buffer to write data from. size is Width * Coun= t >>> + >>> +Returns: >>> +=C2=A0 Status code >>> + >>> +--*/ >>> +{ >>> +=C2=A0 return CpuIoServiceWrite(Width, Address, Count, Buffer); >>> +} >>> + >>> + >>> +EFI_STATUS >>> +EfiIoRead ( >>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0 EFI_PEI_CPU_IO_PPI_WIDTH=C2=A0 Widt= h, >>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0 UINT64=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 Address, >>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 Count, >>> +=C2=A0 IN OUT VOID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 *Buffer >>> +=C2=A0 ) >>> +/*++ >>> + >>> +Routine Description: >>> +=C2=A0 Perform an IO read into Buffer. >>> + >>> +Arguments: >>> +=C2=A0 Width=C2=A0=C2=A0 - Width of read transaction, and repeat oper= ation to use >>> +=C2=A0 Address - IO address to read >>> +=C2=A0 Count=C2=A0=C2=A0 - Number of times to read the IO address. >>> +=C2=A0 Buffer=C2=A0 - Buffer to read data into. size is Width * Count >>> + >>> +Returns: >>> +=C2=A0 Status code >>> + >>> +--*/ >>> +{ >>> +=C2=A0 return EFI_UNSUPPORTED; >>> +} >>> + >>> + >>> +VOID >>> +FixAddress ( >>> +=C2=A0 IN UINTN=C2=A0=C2=A0=C2=A0=C2=A0 *PhyAddress >>> +=C2=A0 ) >>> +{ >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 //Note: On ARM platforms d= on't have to do this as all the >>> functions are virtually mapped. >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> >> ARM >> >>> +} >>> + >>> +// Quick port to ARM >>> + >>> +VOID >>> +Port80 ( >>> +=C2=A0 UINT8 Number >>> +=C2=A0 ) >>> +{ >>> +=C2=A0 //EFI_SCT_DEBUG ((EFI_SCT_D_ERROR, L"Port80 %02x", Number)); >> >> Eew. > > That function is used in some tests, that's why it's here and in both AR= Ms. > >>> +} >>> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h >>> b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h >>> new file mode 100644 >>> index 00000000..1e78b3e4 >>> --- /dev/null >>> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h >>> @@ -0,0 +1,48 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2012 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >> >> Trailing spaces. >> >>> +**/ >>> + >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 Debug.h >>> + >>> +--*/ >>> + >>> +#ifndef _IA32_IO_ACCESS_H >>> +#define _IA32_IO_ACCESS_H >> >> Srsly? > > Reminder again, that this is a file that I copied ;) > This header wasn't necessary so I removed in in my next patch series. > >>> + >>> +#include "SCRTDriver.h" >>> + >>> +#define IA32_MAX_IO_ADDRESS=C2=A0=C2=A0 0xFFFF >>> + >>> +#define IA32API >>> + >>> + >>> +typedef union { >>> +=C2=A0 UINT8=C2=A0 VOLATILE=C2=A0 *buf; >>> +=C2=A0 UINT8=C2=A0 VOLATILE=C2=A0 *ui8; >>> +=C2=A0 UINT16 VOLATILE=C2=A0 *ui16; >>> +=C2=A0 UINT32 VOLATILE=C2=A0 *ui32; >>> +=C2=A0 UINT64 VOLATILE=C2=A0 *ui64; >>> +=C2=A0 UINTN=C2=A0 VOLATILE=C2=A0 ui; >>> +} PTR; >>> + >>> +// This address is assuming a pure PC architecture. Not required? >>> +#define=C2=A0=C2=A0 VIRT_TO_PHYS_OFFSET=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (0x80000000)=C2=A0=C2=A0=C2=A0=C2=A0 = //2G >>> + >>> + >>> + >>> +#endif >>> diff --git >>> a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest= /Riscv64/DebugSupportBBTestCacheFunction.c >>> b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest= /Riscv64/DebugSupportBBTestCacheFunction.c >>> >>> new file mode 100644 >>> index 00000000..96ee7b57 >>> --- /dev/null >>> +++ >>> b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest= /Riscv64/DebugSupportBBTestCacheFunction.c >>> >>> @@ -0,0 +1,137 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2016 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 DebugSupportBBTestCacheFunction.c >>> + >>> +Abstract: >>> + >>> +=C2=A0 Interface Function Test Cases of Debug Support Protocol >>> + >>> +--*/ >>> + >>> + >>> +#include "DebugSupportBBTestMain.h" >>> + >>> +/** >>> + *=C2=A0 Entrypoint for >>> EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache() Function Test. >>> + *=C2=A0 @param This a pointer of EFI_BB_TEST_PROTOCOL. >>> + *=C2=A0 @param ClientInterface a pointer to the interface to be test= ed. >>> + *=C2=A0 @param TestLevel test "thoroughness" control. >>> + *=C2=A0 @param SupportHandle a handle containing protocols required. >>> + *=C2=A0 @return EFI_SUCCESS Finish the test successfully. >>> + */ >>> +// >>> +// TDS 3.5 >>> +// >>> +EFI_STATUS >>> +BBTestInvalidateInstructionCacheFunctionAutoTest ( >>> +=C2=A0 IN EFI_BB_TEST_PROTOCOL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *T= his, >>> +=C2=A0 IN VOID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 *ClientInterface, >>> +=C2=A0 IN EFI_TEST_LEVEL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 TestLevel, >>> +=C2=A0 IN EFI_HANDLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SupportHandle >>> +=C2=A0 ) >>> +{ >>> +=C2=A0 EFI_STANDARD_TEST_LIBRARY_PROTOCOL=C2=A0=C2=A0 *StandardLib; >>> +=C2=A0 EFI_STATUS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status; >>> +=C2=A0 EFI_DEBUG_SUPPORT_PROTOCOL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0 *DebugSupport; >>> +=C2=A0 EFI_TEST_ASSERTION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Asserti= onType; >>> +=C2=A0 UINT64=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Start; >>> +=C2=A0 UINT64=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Length; >>> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MaxProcessorInde= x; >>> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ProcessorIndex; >>> + >>> +=C2=A0 // >>> +=C2=A0 // Get the Standard Library Interface >>> +=C2=A0 // >>> +=C2=A0 Status =3D gtBS->HandleProtocol ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SupportHandle, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &gEfiStandardTestLibraryGuid, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (VOID **) &StandardLib >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> + >>> +=C2=A0 if (EFI_ERROR(Status)) { >>> +=C2=A0=C2=A0=C2=A0 StandardLib->RecordAssertion ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 StandardLib, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EFI_TEST_ASSERTION_FAILED, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gTestGenericFailureGuid, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 L"BS.HandleProtocol - Handle stand= ard test library", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 L"%a:%d:Status - %r", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 __FILE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINTN)__LINE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> +=C2=A0 } >>> + >>> +=C2=A0 DebugSupport =3D (EFI_DEBUG_SUPPORT_PROTOCOL *)ClientInterface= ; >>> + >>> +=C2=A0 if (DebugSupport->Isa !=3D PlatformIsa) { >>> +=C2=A0=C2=A0=C2=A0 return EFI_SUCCESS; >>> +=C2=A0 } >>> + >>> +=C2=A0 Status =3D DebugSupport->GetMaximumProcessorIndex (DebugSuppor= t, >>> &MaxProcessorIndex); >>> +=C2=A0 if (EFI_ERROR(Status)) { >>> +=C2=A0=C2=A0=C2=A0 StandardLib->RecordAssertion ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 StandardLib, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EFI_TEST_ASSERTION_FAILED, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gTestGenericFailureGuid, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> L"EFI_DEBUG_SUPPORT_PROTOCOL.GetMaximumProcessorIndex", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 L"%a:%d:Status - %r", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 __FILE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINTN)__LINE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> +=C2=A0 } >>> + >>> +=C2=A0 for (ProcessorIndex =3D 0; ProcessorIndex <=3D MaxProcessorInd= ex; >>> ProcessorIndex++) { >>> + >>> +=C2=A0=C2=A0=C2=A0 // >>> +=C2=A0=C2=A0=C2=A0 // Assertion Point 3.5.2.1 >>> +=C2=A0=C2=A0=C2=A0 // Invoke InvalidateInstructionCache and verify in= terface >>> correctness. >>> +=C2=A0=C2=A0=C2=A0 // >>> + >>> +=C2=A0=C2=A0=C2=A0 // The Physical base of the memory range to be inv= alidated. >>> +=C2=A0=C2=A0=C2=A0 Start=C2=A0 =3D 0x0; >>> + >>> +=C2=A0=C2=A0=C2=A0 // The minimum number of bytes in the processor's = instruction >>> cache to be invalidated. >>> +=C2=A0=C2=A0=C2=A0 Length =3D 0x0; >>> + >>> +=C2=A0=C2=A0=C2=A0 Status =3D DebugSupport->InvalidateInstructionCach= e (DebugSupport, >>> ProcessorIndex, (VOID*)&Start, Length); >>> + >>> +=C2=A0=C2=A0=C2=A0 if (EFI_ERROR(Status)) { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_F= AILED; >>> +=C2=A0=C2=A0=C2=A0 } else { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_P= ASSED; >>> +=C2=A0=C2=A0=C2=A0 } >>> + >>> +=C2=A0=C2=A0=C2=A0 StandardLib->RecordAssertion ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 StandardLib, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 AssertionType, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 gDebugSupportBBTestFunctionAssertionGuid015, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> L"EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache - Invoke this >>> function and verify interface correctness", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 L"%a:%d:Status - %r", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 __FILE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINTN)__LINE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> +=C2=A0 } >>> + >>> +=C2=A0 return EFI_SUCCESS; >>> +} >>> + >>> diff --git >>> a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest= /Riscv64/DebugSupportBBTestExceptionCallbackFunction.c >>> b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest= /Riscv64/DebugSupportBBTestExceptionCallbackFunction.c >>> >>> new file mode 100644 >>> index 00000000..c27c0c0c >>> --- /dev/null >>> +++ >>> b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest= /Riscv64/DebugSupportBBTestExceptionCallbackFunction.c >>> >>> @@ -0,0 +1,276 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2016 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 DebugSupportBBExceptionCallbackFunction.c >>> + >>> +Abstract: >>> + >>> +=C2=A0 Interface Function Test Cases of Debug Support Protocol >>> + >>> +--*/ >>> + >>> + >>> +#include "DebugSupportBBTestMain.h" >>> + >>> +extern volatile=C2=A0 UINTN InvokedExceptionCallback; >>> +extern volatile=C2=A0 UINTN InvokedPeriodicCallback; >>> + >>> +extern EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa; >>> + >>> +void >>> +SoftwareBreak ( >>> +=C2=A0 void >>> +=C2=A0 ) >>> +{ >>> +=C2=A0 // Not ported to ARM yet >> >> Eew. >> >>> +=C2=A0 ASSERT (FALSE); >>> +} >>> + >>> +/** >>> + *=C2=A0 Entrypoint for >>> EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback() Function Test. >>> + *=C2=A0 @param This a pointer of EFI_BB_TEST_PROTOCOL. >>> + *=C2=A0 @param ClientInterface a pointer to the interface to be test= ed. >>> + *=C2=A0 @param TestLevel test "thoroughness" control. >>> + *=C2=A0 @param SupportHandle a handle containing protocols required. >>> + *=C2=A0 @return EFI_SUCCESS Finish the test successfully. >>> + */ >>> +// >>> +// TDS 3.4 >>> +// >>> +EFI_STATUS >>> +BBTestRegisterExceptionCallbackFunctionManualTest ( >>> +=C2=A0 IN EFI_BB_TEST_PROTOCOL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *T= his, >>> +=C2=A0 IN VOID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 *ClientInterface, >>> +=C2=A0 IN EFI_TEST_LEVEL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 TestLevel, >>> +=C2=A0 IN EFI_HANDLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SupportHandle >>> +=C2=A0 ) >>> +{ >>> +=C2=A0 EFI_STANDARD_TEST_LIBRARY_PROTOCOL=C2=A0=C2=A0 *StandardLib; >>> +=C2=A0 EFI_STATUS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status; >>> +=C2=A0 EFI_DEBUG_SUPPORT_PROTOCOL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= = =C2=A0=C2=A0=C2=A0=C2=A0 *DebugSupport; >>> +=C2=A0 EFI_TEST_ASSERTION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Asserti= onType; >>> + >>> +=C2=A0 DebugSupport =3D (EFI_DEBUG_SUPPORT_PROTOCOL *)ClientInterface= ; >>> + >>> +=C2=A0 if (DebugSupport->Isa !=3D PlatformIsa) { >>> +=C2=A0=C2=A0=C2=A0 return EFI_SUCCESS; >>> +=C2=A0 } >>> + >>> +=C2=A0 // >>> +=C2=A0 // Get the Standard Library Interface >>> +=C2=A0 // >>> +=C2=A0 Status =3D gtBS->HandleProtocol ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SupportHandle, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &gEfiStandardTestLibraryGuid, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (VOID **) &StandardLib >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> + >>> +=C2=A0 if (EFI_ERROR(Status)) { >>> +=C2=A0=C2=A0=C2=A0 StandardLib->RecordAssertion ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 StandardLib, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EFI_TEST_ASSERTION_FAILED, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gTestGenericFailureGuid, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 L"BS.HandleProtocol - Handle stand= ard test library", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 L"%a:%d:Status - %r", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 __FILE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINTN)__LINE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> +=C2=A0 } >>> + >>> +=C2=A0 // >>> +=C2=A0 // Assertion Point 3.4.2.1 >>> +=C2=A0 // Invoke RegisterExceptionCallback() to install an interrupt >>> handler function. >>> +=C2=A0 // >>> +=C2=A0 InvokedExceptionCallback =3D FALSE; >>> +=C2=A0 // FIXME: Is it normal that we use EXCEPT_IA32_BREAKPOINT here= ? >>> +=C2=A0 // Shouldn't we define proper constants for ARM exceptions in >>> DebugSupportProtocol.h file? >>> +=C2=A0 Status =3D DebugSupport->RegisterExceptionCallback (DebugSuppo= rt, 0, >>> ExceptionCallback, EXCEPT_IA32_BREAKPOINT); >>> + >>> +=C2=A0 if ((Status =3D=3D EFI_SUCCESS) || (Status =3D=3D EFI_ALREADY_= STARTED)) { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_PASSED; >>> +=C2=A0 } else { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_FAILED; >>> +=C2=A0 } >>> + >>> +=C2=A0 StandardLib->RecordAssertion ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 StandardLib, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 AssertionType, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 gDebugSupportBBTestFunctionAssertionGuid009, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Invoke this >>> function and verify interface correctness", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 L"%a:%d:Status - %r", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 __FILE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINTN)__LINE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> + >>> +=C2=A0 // >>> +=C2=A0 // If the callback function is already registed, return >>> +=C2=A0 // >>> +=C2=A0 if (EFI_ERROR(Status)) { >>> +=C2=A0=C2=A0=C2=A0 return EFI_SUCCESS; >>> +=C2=A0 } >>> + >>> +=C2=A0 // >>> +=C2=A0 // Test the callback function registed. >>> +=C2=A0 // >>> + >>> +=C2=A0 // >>> +=C2=A0 // Call SoftwareBreak to invoke the interrupt handler function= . >>> +=C2=A0 // >>> +=C2=A0 SoftwareBreak (); >>> + >>> +=C2=A0 if (InvokedExceptionCallback =3D=3D FALSE) { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_FAILED; >>> +=C2=A0 } else { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_PASSED; >>> +=C2=A0 } >>> + >>> +=C2=A0 StandardLib->RecordAssertion ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 StandardLib, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 AssertionType, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 gDebugSupportBBTestFunctionAssertionGuid010, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Verify the >>> callback function was invoked.", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 L"%a:%d:Status - %r", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 __FILE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINTN)__LINE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> + >>> +=C2=A0 // >>> +=C2=A0 // Assertion Point 3.4.2.2 >>> +=C2=A0 // Invoke RegisterPeriodicCallback() to install the Periodic >>> interrupt handler function. >>> +=C2=A0 // Verify the two callback functions can be both invoked. >>> +=C2=A0 // >>> +=C2=A0 InvokedExceptionCallback =3D FALSE; >>> +=C2=A0 InvokedPeriodicCallback=C2=A0 =3D FALSE; >>> + >>> +=C2=A0 Status =3D DebugSupport->RegisterPeriodicCallback (DebugSuppor= t, 0, >>> PeriodicCallback); >>> +=C2=A0 if (EFI_ERROR(Status)) { >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> +=C2=A0 } >>> + >>> +=C2=A0 // >>> +=C2=A0 // Wait the PeriodicCallback to be invoked. >>> +=C2=A0 // >>> +=C2=A0 gtBS->Stall (500000); >>> + >>> +=C2=A0 // >>> +=C2=A0 // Call SoftwareBreak to invoke the interrupt handler function= . >>> +=C2=A0 // >>> +=C2=A0 SoftwareBreak (); >>> + >>> +=C2=A0 if ((InvokedExceptionCallback =3D=3D TRUE) && (InvokedPeriodic= Callback >>> =3D=3D TRUE)) { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_PASSED; >>> +=C2=A0 } else { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_FAILED; >>> +=C2=A0 } >>> + >>> +=C2=A0 StandardLib->RecordAssertion ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 StandardLib, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 AssertionType, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 gDebugSupportBBTestFunctionAssertionGuid011, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Verify the >>> two callback functions can be both invoked.", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 L"%a:%d:Status - %r", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 __FILE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINTN)__LINE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> + >>> +=C2=A0 // >>> +=C2=A0 // Uninstall the Periodic callback function. >>> +=C2=A0 // >>> +=C2=A0 Status =3D DebugSupport->RegisterPeriodicCallback (DebugSuppor= t, 0, >>> NULL); >>> +=C2=A0 if (EFI_ERROR(Status)) { >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> +=C2=A0 } >>> + >>> +=C2=A0 // >>> +=C2=A0 // Assertion Point 3.4.2.3 >>> +=C2=A0 // Invoke RegisterExceptionCallback() to install another inter= rupt >>> handler function. >>> +=C2=A0 // >>> +=C2=A0 Status =3D DebugSupport->RegisterExceptionCallback (DebugSuppo= rt, 0, >>> ExceptionCallback1, EXCEPT_IA32_BREAKPOINT); >>> + >>> +=C2=A0 if (Status !=3D EFI_ALREADY_STARTED) { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_FAILED; >>> +=C2=A0 } else { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_PASSED; >>> +=C2=A0 } >>> + >>> +=C2=A0 StandardLib->RecordAssertion ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 StandardLib, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 AssertionType, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 gDebugSupportBBTestFunctionAssertionGuid012, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Register >>> another callback function.", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 L"%a:%d:Status - %r", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 __FILE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINTN)__LINE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> + >>> +=C2=A0 // >>> +=C2=A0 // Assertion Point 3.4.2.4 >>> +=C2=A0 // Invoke RegisterExceptionCallback() to unstall the interrupt >>> handler function. >>> +=C2=A0 // >>> +=C2=A0 Status =3D DebugSupport->RegisterExceptionCallback (DebugSuppo= rt, 0, >>> NULL, EXCEPT_IA32_BREAKPOINT); >>> + >>> +=C2=A0 if (EFI_ERROR(Status)) { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_FAILED; >>> +=C2=A0 } else { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_PASSED; >>> +=C2=A0 } >>> + >>> +=C2=A0 StandardLib->RecordAssertion ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 StandardLib, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 AssertionType, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 gDebugSupportBBTestFunctionAssertionGuid013, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Invoke this >>> function to uninstall the interrupt handler function", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 L"%a:%d:Status - %r", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 __FILE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINTN)__LINE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> + >>> +=C2=A0 InvokedExceptionCallback =3D FALSE; >>> + >>> +=C2=A0 // >>> +=C2=A0 // Call SoftwareBreak to invoke the interrupt handler function= . >>> +=C2=A0 // >>> +=C2=A0 SoftwareBreak (); >>> + >>> +=C2=A0 if (InvokedExceptionCallback !=3D FALSE) { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_FAILED; >>> +=C2=A0 } else { >>> +=C2=A0=C2=A0=C2=A0 AssertionType =3D EFI_TEST_ASSERTION_PASSED; >>> +=C2=A0 } >>> + >>> +=C2=A0 StandardLib->RecordAssertion ( >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 StandardLib, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 AssertionType, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 gDebugSupportBBTestFunctionAssertionGuid014, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 >>> L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Verify the >>> callback function wasn't invoked", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 L"%a:%d:Status - %r", >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 __FILE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINTN)__LINE__, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> + >>> +=C2=A0 return EFI_SUCCESS; >>> +} >>> + >>> diff --git >>> a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest= /Riscv64/PlatformIsa.c >>> b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest= /Riscv64/PlatformIsa.c >>> >>> new file mode 100644 >>> index 00000000..8334f601 >>> --- /dev/null >>> +++ >>> b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest= /Riscv64/PlatformIsa.c >>> >>> @@ -0,0 +1,30 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2012 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 PlatformIsa.c >>> + >>> +Abstract: >>> + >>> +=C2=A0 Platform related Isa definition. >>> + >>> +--*/ >>> + >>> +#include "DebugSupportBBTestMain.h" >>> + >>> +EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa =3D IsaAArch64; >>> + >>> diff --git >>> a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/Riscv6= 4/TimerInterrupt.c >>> b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/Riscv6= 4/TimerInterrupt.c >>> >>> new file mode 100644 >>> index 00000000..1c1940e5 >>> --- /dev/null >>> +++ >>> b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/Riscv6= 4/TimerInterrupt.c >>> >>> @@ -0,0 +1,51 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2010 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2010, Intel Corporation. All rights reserved. >>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> +/** >>> + *=C2=A0 Ipf Source file for Mask/Unmask TimerInterrupt. >>> + */ >>> +/*++ >>> + >>> +Module Name: >>> +=C2=A0 TimerInterrupt.c >>> + >>> +Abstract: >>> +=C2=A0 Ipf Source file for Mask/Unmask TimerInterrupt. >>> + >>> +Author(s): >>> + >>> + >>> +References: >>> +=C2=A0 EFI Specification 1.10 >>> +=C2=A0 EFI/Tiano DXE Test Case Writer's Guide >>> + >>> +Revision History: >>> +=C2=A0 Initial 10-20-2002 >>> +=C2=A0 Version 0.01 >>> + >>> +--*/ >>> + >>> +#include "UsbHcTest.h" >>> + >>> +VOID MaskTimerInterrupt() >>> +{ >>> +=C2=A0 // TBD >>> +=C2=A0 return; >>> +} >>> + >>> +VOID UnmaskTimerInterrupt() >>> +{ >>> +=C2=A0 // TBD >>> +=C2=A0 return; >>> +} >>> diff --git >>> a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64= /EntsLibPlat.h >>> b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64= /EntsLibPlat.h >>> >>> new file mode 100644 >>> index 00000000..ff781aee >>> --- /dev/null >>> +++ >>> b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64= /EntsLibPlat.h >>> >>> @@ -0,0 +1,55 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2012 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2010 - 2012, ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 EntsLibPlat.h >>> + >>> +Abstract: >>> + >>> +=C2=A0 AArch64 specific defines >>> + >>> +--*/ >>> + >>> +#ifndef _EFI_LIB_PLAT_H_ >>> +#define _EFI_LIB_PLAT_H_ >> >> No leading _. >> >> / >> =C2=A0=C2=A0=C2=A0=C2=A0 Leif >> >>> + >>> +#define MIN_ALIGNMENT_SIZE=C2=A0 8 >>> + >>> +VOID >>> +EntsInitializeLibPlatform ( >>> +=C2=A0 IN EFI_HANDLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ImageHandle, >>> +=C2=A0 IN EFI_SYSTEM_TABLE=C2=A0=C2=A0=C2=A0=C2=A0 *SystemTable >>> +=C2=A0 ) >>> +/*++ >>> + >>> +Routine Description: >>> + >>> +=C2=A0 Initialize platform. >>> + >>> +Arguments: >>> + >>> +=C2=A0 ImageHandle=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0 - The image handle. >>> +=C2=A0 SystemTable=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0 - The system table. >>> + >>> +Returns: >>> + >>> +=C2=A0 None. >>> + >>> +--*/ >>> +; >>> + >>> +#endif >>> diff --git >>> a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64= /InitPlat.c >>> b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64= /InitPlat.c >>> >>> new file mode 100644 >>> index 00000000..70a509a4 >>> --- /dev/null >>> +++ >>> b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64= /InitPlat.c >>> >>> @@ -0,0 +1,55 @@ >>> +/** @file >>> + >>> +=C2=A0 Copyright 2006 - 2012 Unified EFI, Inc.
>>> +=C2=A0 Copyright (c) 2010 - 2012, ARM Ltd. All rights reserved.
>>> + >>> +=C2=A0 This program and the accompanying materials >>> +=C2=A0 are licensed and made available under the terms and conditions= of >>> the BSD License >>> +=C2=A0 which accompanies this distribution.=C2=A0 The full text of th= e license >>> may be found at >>> +=C2=A0 http://opensource.org/licenses/bsd-license.php >>> + >>> +=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"= BASIS, >>> +=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS >>> OR IMPLIED. >>> + >>> +**/ >>> +/*++ >>> + >>> +Module Name: >>> + >>> +=C2=A0 InitPlat.c >>> + >>> +Abstract: >>> + >>> +=C2=A0 Math routines for compatibility with native EFI library routin= es. >>> + >>> +--*/ >>> + >>> +#include "Efi.h" >>> +#include "EntsLibPlat.h" >>> + >>> +VOID >>> +EntsInitializeLibPlatform ( >>> +=C2=A0 IN EFI_HANDLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ImageHandle, >>> +=C2=A0 IN EFI_SYSTEM_TABLE=C2=A0=C2=A0=C2=A0=C2=A0 *SystemTable >>> +=C2=A0 ) >>> +/*++ >>> + >>> +Routine Description: >>> + >>> +=C2=A0 Initialize platform. >>> + >>> +Arguments: >>> + >>> +=C2=A0 ImageHandle=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0 - The image handle. >>> +=C2=A0 SystemTable=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= = =A0=C2=A0 - The system table. >>> + >>> +Returns: >>> + >>> +=C2=A0 None. >>> + >>> +--*/ >>> +{ >>> +=C2=A0 // >>> +=C2=A0 // No platform-specific initializations >>> +=C2=A0 // >>> +} >>> --=C2=A0 >>> 2.28.0 >>> >>> >>> >>>=20 >>> >>>