From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.76]) by mx.groups.io with SMTP id smtpd.web10.3648.1617107127711065934 for ; Tue, 30 Mar 2021 05:25:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=RIaKz1oh; spf=pass (domain: arm.com, ip: 40.107.21.76, mailfrom: sunny.wang@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=DWwdyjYBX+cyWckrG42hXYKwaXo+IvEKHH5PGxb6LvY=; b=RIaKz1ohc0SoesWVSMb6oTTxHzvnYbj6z75lht+5L3wDcYZxIUaWdXaRgjWNNjhIMnDCDTv/seEiacCyXhpSBREfakOHe9dpHYv2pYvLbZiCi5H6oMKofbikMsq/eV1uJl2OZjq2RtxhN/Tfrg03VvAtvLparRNpgynRwdUS+0c= Received: from AS8PR04CA0131.eurprd04.prod.outlook.com (2603:10a6:20b:127::16) by HE1PR0802MB2604.eurprd08.prod.outlook.com (2603:10a6:3:db::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.33; Tue, 30 Mar 2021 12:25:22 +0000 Received: from AM5EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:127:cafe::6e) by AS8PR04CA0131.outlook.office365.com (2603:10a6:20b:127::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24 via Frontend Transport; Tue, 30 Mar 2021 12:25:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; 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 AM5EUR03FT061.mail.protection.outlook.com (10.152.16.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Tue, 30 Mar 2021 12:25:21 +0000 Received: ("Tessian outbound f15357ab733e:v89"); Tue, 30 Mar 2021 12:25:21 +0000 X-CR-MTA-TID: 64aa7808 Received: from a3ca08cdad55.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 415F9D93-A3C6-4989-BF54-E584827D0F24.1; Tue, 30 Mar 2021 12:25:15 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a3ca08cdad55.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 30 Mar 2021 12:25:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RWpK7ELdpiuCkmeKV9fsjUlWDiLbkb8SVsMyCjhrKvz2O4hU+YCLm84mVEStZzzmhohPJ44dXnxm9WKuI2nzt2407XfEcfCxih1LaJAJxznlolUF+H3DayR4NmSuXKoja605lK2mrSiPpVor+nyrpQ4A/zUb4Dj0C/+XW0tlfKxoQGWO1DccZupCdmhfqVWReqBLCIkxus0Koz4u75c1NL0b3YpBRAKulDaA9ZtX2WmVf9h8DH8yH1kRCvQrqAeTRvakCNqEHgJB1gmMDjey/nQ3WVjp/n8yj++/9I/69PTvcOZ8Kd5tMZcJJzPdgGALoaT8aTljCzZAXOCcyqOaUg== 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-SenderADCheck; bh=DWwdyjYBX+cyWckrG42hXYKwaXo+IvEKHH5PGxb6LvY=; b=A5pktoz3CLJD7Ond/HILJj7jqolG3Q4DtyXTGdmQLRyp8qZHVTXy86J4up0gCJ3LazyBbHXmSKFOEsN5rdq0SK/sMHSdgsU5UpyRwc7g0Ar+SFwtDzOzxrhrsOcPPzfB0hanbNZAMuqEe0wn+ghf3fs8InPsTBgdUyLZnSQT1pF53Eunnu6ddIQmiphDxMR2PylIwyv/gbMP8GcIfZz2B58TwaVYL0deo6zcgdvFr/Qis2Mt5qyyuZBlXOopMoelVWkF7ELIGmVMX93YQxOKfo7+CC/VnT3mIRda6yGu8zVau7HE/FGYpzq2qeJYQC8PW/LUI9UGG3DFMoEuiAHCOA== 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=DWwdyjYBX+cyWckrG42hXYKwaXo+IvEKHH5PGxb6LvY=; b=RIaKz1ohc0SoesWVSMb6oTTxHzvnYbj6z75lht+5L3wDcYZxIUaWdXaRgjWNNjhIMnDCDTv/seEiacCyXhpSBREfakOHe9dpHYv2pYvLbZiCi5H6oMKofbikMsq/eV1uJl2OZjq2RtxhN/Tfrg03VvAtvLparRNpgynRwdUS+0c= Received: from DB8PR08MB3993.eurprd08.prod.outlook.com (2603:10a6:10:ad::26) by DB9PR08MB6763.eurprd08.prod.outlook.com (2603:10a6:10:2af::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25; Tue, 30 Mar 2021 12:25:14 +0000 Received: from DB8PR08MB3993.eurprd08.prod.outlook.com ([fe80::89f9:4e97:546d:2b97]) by DB8PR08MB3993.eurprd08.prod.outlook.com ([fe80::89f9:4e97:546d:2b97%6]) with mapi id 15.20.3977.033; Tue, 30 Mar 2021 12:25:14 +0000 From: "Sunny Wang" To: "Schaefer, Daniel" , "devel@edk2.groups.io" CC: G Edhaya Chandran , Barton Gao , Samer El-Haj-Mahmoud , Eric Jin , Arvin Chen , Leif Lindholm , Heinrich Schuchardt , "Chang, Abner (HPS SW/FW Technologist)" Subject: Re: [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch64 sources Thread-Topic: [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch64 sources Thread-Index: AQHXEKV9eQ/xuDtJF0GAvvF3cxbUw6qWfUdg Date: Tue, 30 Mar 2021 12:25:13 +0000 Message-ID: References: <20210304032116.24357-1-daniel.schaefer@hpe.com> <20210304032116.24357-2-daniel.schaefer@hpe.com> In-Reply-To: <20210304032116.24357-2-daniel.schaefer@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 20BB17D94EE94948BA4B3F338EFCB945.0 x-checkrecipientchecked: true Authentication-Results-Original: hpe.com; dkim=none (message not signed) header.d=none;hpe.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [61.231.198.221] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 981c6317-b1d4-43c7-e1d7-08d8f376e332 x-ms-traffictypediagnostic: DB9PR08MB6763:|HE1PR0802MB2604: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:5797;OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ltIPuWS8GZ/8KxB/XJ359jAoLJrY338EysqCm6W6JpntrHwHDKV3HB7zmWhRFvJCqPpGVS0cpB5hXBVESWWNiTwGk/BhfP68y10udF+nUEAwBRkigIBPaIw3ppmXMrFKiQFRAXBdjn8OCwTbrRQTQqVzN/z3CaANNdk8dZC9FAXhgUlt5nuOUB06KByJhVyfGgdRTovtxry0ok/4RUPaz3Tp7Z+TurbPw/cE971o3JLdEBNXgXXdHgZJ/5kBiinL6X4aJ2oHIvfm3WO889cTi0J7APIHFRdHHiunpD2Zzj9JwUxJgTNRK5QnrUe1+s5ncrsnNNQZ2YhhUW8KW8j8oMsh9XEIdVgevJsL/g6ogHTRWxY3bO4941D5Z2eoX90nnb48Wxb87HjHL3W4LRWl9CkYsFNEuOqm5oi9sGwEKeTlUlugEoAblSqdnlDP+LhhvdQR4SKwR05HDjehEsH/0feETxQOzu0JCJsBHu1cEhFiFve2BKl776y/dY7PqIt/v6qJDPblyURk3n4ODb1AG2YCSZ+3fAiBMR5UAV4CIZSmwTmYP2Rc8RUc0hoOC0GNvzhvoebqbSHPjpO+dQrQ+jsM4dBTQXcNFNEEq1FyQEHljLZdIWryRTZ1TZoLiwiiDFNZKXxA8VfdbTfn+JZDwgRsiS9oYj2R112WtzNryb3eQVdNa8KL29Ychmt/w9AMHXwcrTp7EfmJjeyVu6/Mf0WKc22Io73uPpqp+oEC3i4= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR08MB3993.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39860400002)(366004)(346002)(376002)(136003)(8936002)(83380400001)(86362001)(4326008)(7696005)(38100700001)(966005)(71200400001)(6506007)(53546011)(316002)(478600001)(186003)(15188155005)(2906002)(26005)(8676002)(296002)(52536014)(66446008)(64756008)(16799955002)(5660300002)(110136005)(66946007)(55016002)(66476007)(66556008)(76116006)(9686003)(19627235002)(54906003)(30864003)(33656002)(559001)(579004);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?+LFbnFja4SOK1ge9AcYMj/9eoNQ+Q7Fo1gfhMI49aoq8wOzb7Q5N+Ne4267t?= =?us-ascii?Q?EWEO96WsvJAiYQ49afzjnD9lkNJMrcXf5w0ocRe5THPPxhecSRKgS2GqhkSh?= =?us-ascii?Q?K1A0Ya8vi5HCB4o+t1CNBGlsVrRA2WLbkI7ADnR0pVB+dU5sUT3pesdaaTBN?= =?us-ascii?Q?Ra0pN6vGALnSbJ0J+DYWfvW7FNZ16q/tj3kESAkxP4FtQyBAjxCidC53DfKX?= =?us-ascii?Q?QxFYS44kVnLrvUrPPSjlrPhR7G9Ho29mYDuUSS32aPnc+/vCImyY1YFGFb3B?= =?us-ascii?Q?fLC8v6Nev5/z8nZa/Tuzsej8rci90C2vZNlf7bTH4t6dfiejgb7Ch2JLo4uI?= =?us-ascii?Q?Qtyw21ym+UvxDNu3+Oj7473s6VXC+NQdafZ90ccykL3gSR1wx0msrplic19Q?= =?us-ascii?Q?PARzLjm9g/tFclMxR04QZemlhfyyRKVSL8SvTIk0b2oMD9rsQT4osWZ5gkRX?= =?us-ascii?Q?28Uj0Na4GkKutTt8gjFHy+4oVYB/5u1h86WuhNXGt+HqU7xWWNB0lTIeNBf2?= =?us-ascii?Q?LlmmsjPf2c3hhsIadCC6xAVwHDSk8lPvLu+2B03ekFz+bMUqjONroN7tQUCz?= =?us-ascii?Q?oQNBXM1pO9kDqkhP2PDCoUJWZosTXpSP80A7LE1XQcDSxREuNN3mZvr1191u?= =?us-ascii?Q?6LLPv3zfzOM+rgE082GoLnJWDpCre7/RtkSMCYRWSQyUufq9LUXi0gGRuVRX?= =?us-ascii?Q?gVoInjimPWc58P4ccTt5GbYjzfsN2Gu/TZNNS8x+Wydf+xnazAMKSoTtDe/P?= =?us-ascii?Q?Alwc1MlWKcHRSgDzonhgaK1gB4xibb+L2GOkOKRIY17aquvzH6mmYiEb6Mqu?= =?us-ascii?Q?t0jo67PpQRSwUOe/j9ypSztbhTUleu+pyDXMKxbUsxgvVnH8dlMPytCmZ0xF?= =?us-ascii?Q?zoP3YsMv3nTBlPIZU94/6XjdXzu4djWd+3BalLfujOK5aD98tuCmuPzkfjo3?= =?us-ascii?Q?0uj4Ac8UZ6icd8y1Gr/ejtDFxSIlVa9+sv/a77Gzidsp5oruMfuscoiEfUWP?= =?us-ascii?Q?3xv37Nnn0No9mLH2BmbIZA/no0F8BNn6aDsnBDtBf9mZATCFqWHXNtl37IC3?= =?us-ascii?Q?8MRz9S1Tb7EutkEKEtSPSbM5QDp0icvo8Ejh3U+/Ea0d+6YFCKUM5tSN5kuj?= =?us-ascii?Q?bxWQaD521ZZsFXgiUSQ8c/YwXs5jgChWBqLOMjObUnMMMSEUCT51GX/F6Xbi?= =?us-ascii?Q?q/j01LsbjQZ6i7Q6Oc+76MzVFcvL2DWzIw2+4HZZClKhlL/hAsKw70Vkgkc2?= =?us-ascii?Q?OTh4qEH4euToEm78osjS0HfDfOpRpeslzFKxJ4gH19sRPV1wqRjt4/wUDuyP?= =?us-ascii?Q?388Trqrpqpb4na5PuifDGTss?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6763 Original-Authentication-Results: hpe.com; dkim=none (message not signed) header.d=none;hpe.com; dmarc=none action=none header.from=arm.com; Return-Path: Sunny.Wang@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 26fffca1-13fd-45b2-7b8c-08d8f376debf X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vQmv6IsKRma+ePk9DS3QDVdg1gpL1yTapFLXGQpTmtd8nGVvkN5B1OXQVxJTdo4gveySe0vTF4NwkxPPCcH9wxBylI1pe8zIgVTbwB9LUuTc/Vp1ydbaojMRHizz0ulK3Ar5rSjtG9apH2VRVrVEGy5fA2oGk0i+uwK1EVFvIgF7cnbVHkK826YSkL5e8RTNqzeemuq+sa+/zpzFKi6JhyrKEAVcQZgUBPNdkZYofQLkrgi88mlpAWN295+P1Mlqm5MA5GU3ImkSn9FTz9X1dpoa6DT7GOB3sbQ0Df0jkHi1y1UHy0piREK9svBxwOmi2jBsUbZuTn/XHzTvuYDMdtIIM3n5WcGWbFZoiHLrht8hA7+OxcG01nzgzdqJbK2Jzw2tc5fL7WEQriYJ+2q4sAci/DmDW/RT0M+UeiRusKmllvLaI0p7N5BeVpgyIT5K+YnSYl3SXEPYYvHyJEA+BiboxuMxqwKrTay/XkzBp04OkGwdcrrq+ZULFnqVZ0DiuElGnkthTGxpx85hw/tLv+1n/A3MJ+IeX3hNS6j1BgtSVvGskD2bywKx3K+8ms32zBdF+ioodMSnP5zZ/PyTAxbQalgmrMqrySrXX+Bp7Fv9jKyCXapkLYIicpp+B+gnVxvhbvPdh1XDqITYJJGi3fXi2EsLoxJph8u1VKrrWwox1FGwPOJeJIqXXB6BzBqQBnjPq4XqzKRgAyWJb54FPJV1Nk05jtSjyWWaKiFzRvrzbajFIDWLDW072MqK+hX993LvhbFQNXSJazvZQY4dXA== 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)(136003)(376002)(39860400002)(346002)(396003)(36840700001)(46966006)(26005)(186003)(86362001)(47076005)(16799955002)(55016002)(70586007)(7696005)(19627235002)(336012)(83380400001)(70206006)(2906002)(8676002)(15188155005)(9686003)(4326008)(966005)(33656002)(110136005)(316002)(6506007)(5660300002)(52536014)(8936002)(53546011)(30864003)(478600001)(82310400003)(82740400003)(36860700001)(81166007)(54906003)(356005)(2690400003)(579004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2021 12:25:21.5529 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 981c6317-b1d4-43c7-e1d7-08d8f376e332 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: AM5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2604 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Looks good to me. This only affects RISCV. Therefore, as long as you build = and run SCT on the RISCV platform, this change should be fine. Reviewed-by: Sunny Wang Best Regards, Sunny Wang -----Original Message----- From: Schaefer, Daniel Sent: Thursday, March 4, 2021 11:21 AM To: devel@edk2.groups.io Cc: G Edhaya Chandran ; Barton Gao ; Samer El-Haj-Mahmoud ; Eric Jin ; Arvin Chen ; Leif Lindholm ; Heinrich Schuchardt ; Chang, Abner (HPS = SW/FW Technologist) Subject: [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch= 64 sources The sources were copied from Aarch64. Follow-up commit will adapt them for = Riscv64. REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3042 Cc: G Edhaya Chandran Cc: Barton Gao Cc: Samer El-Haj-Mahmoud Cc: Eric Jin Cc: Arvin Chen Cc: Leif Lindholm Cc: Heinrich Schuchardt Cc: Abner Chang Signed-off-by: Daniel Schaefer --- uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h = | 32 +++ uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c = | 45 ++++ uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S = | 44 ++++ uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c = | 182 +++++++++++++ uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c = | 88 +++++++ uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c = | 68 +++++ uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c = | 134 ++++++++++ uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h = | 48 ++++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv= 64/DebugSupportBBTestCacheFunction.c | 137 ++++++++++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv= 64/DebugSupportBBTestExceptionCallbackFunction.c | 276 ++++++++++++++++++++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv= 64/PlatformIsa.c | 30 +++ uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsL= ibPlat.h | 55 ++++ uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitP= lat.c | 55 ++++ 13 files changed, 1194 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 + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + SctLibPlat.h + +Abstract: + + AArch64 specific defines + +--*/ + +#ifndef _EFI_LIB_PLAT_H_ +#define _EFI_LIB_PLAT_H_ + +#define MIN_ALIGNMENT_SIZE 8 + +#endif diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c b/uefi-sct/S= ctPkg/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 + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + initplat.c + +Abstract: + + Math routines for compatibility with native EFI library routines. + +--*/ + +#include "SctLibInternal.h" + +VOID +InitializeLibPlatform ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) + +{ + // No platform-specific initializations +} + +UINT64 +SctReadTsc ( + VOID + ) +{ + return 0; +} diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S b/uefi-sct/Sc= tPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S new file mode 100644 index 00000000..d223b36b --- /dev/null +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S @@ -0,0 +1,44 @@ +## @file +# +# Copyright 2010 - 2012 Unified EFI, Inc.
+# Copyright (c) 2012, ARM Ltd. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of +the BSD License +# which accompanies this distribution. The full text of the license +may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" +BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +## +# +# +#/*++ +# +# Module Name: +# +# GoVirtual.S +# +#--*/ +#start of the code section +.text +/* FIXME: Should alignment be different on Aarch64? */ +.align 3 + +.global JumpToTestFunc +.type JumpToTestFunc, %function + +#---------------------------------------------------------------------- +-------- +# VOID +# JumpToTestFunc ( +# IN UINTN FuncPointer, +# IN UNITN ConfigInfo +# ) +# +JumpToTestFunc: + mov x2, x0 + mov x0, x1 + + // Jump to Virtual function + blr x2 diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c b/uefi-sc= t/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 + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2012, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + VirtualMemory.c + +--*/ + +#include "SCRTApp.h" + +#define VIRT_TO_PHYS_OFFSET (0x80000000) //2G + +BOOLEAN HighAddress =3D FALSE; +UINTN PageTable =3D 0; + + +VOID +ConvertRuntimeFuncPtr ( + IN OUT UINTN *VirtualFunc + ) +/*++ + +Routine Description: + + Change RuntimeTestFunc physical address to virtual address + +Arguments: + + VirtualFunc - On input, RuntimeTestFunc physical address. + On output, RuntimeTest virtual address. + +Returns: + + NONE + +--*/ +{ + /*Note: It is presumed that on ARM v5, V6 and V7 architectures + * the MMU is configured and enabled in PEI phase. As + VirtualFunc + * is already mapped to virtual memory, don't have to do anything h= ere. + */ + /* FIXME: Is it the same on ARM v8? */ +} + + +EFI_STATUS +DoMemoryAllocation ( + IN UINTN PhysicalFunc + ) +/*++ + +Routine Description: + + Allocate memory and create the PageTable to set up physical-virtual map. + +Arguments: + + PhysicalFunc - Physical address where RuntimeTestFunc locates. + +Returns: + + EFI_STATUS + +--*/ +{ + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS AllocateMemory; + + //create new page tables or use existing page tables. + // + // Allocate PageTable memory close to this Application image location + in + // the system memory. In this way, it is safe for page table memory. + // + AllocateMemory =3D PhysicalFunc; + + Status =3D tBS->AllocatePages ( + AllocateMaxAddress, + EfiRuntimeServicesData, + 1, + &AllocateMemory + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + PageTable =3D (UINTN)AllocateMemory; + return EFI_SUCCESS; +} + + +VOID +PrepareVirtualAddressMap ( + IN UINTN MemoryMapSize, + IN UINTN DescriptorSize, + IN EFI_MEMORY_DESCRIPTOR *MemoryMap, + IN EFI_MEMORY_DESCRIPTOR *VirtualMemoryMap, + IN OUT UINTN *VirtualMapSize + ) +/*++ + +Routine Description: + + Construct VirtualAddressMap from physical address to virtual address + +Arguments: + + MemoryMapSize - The size, in bytes, of the MemoryMap buffer + DescriptorSize - The size, in bytes, of an individual EFI_MEMORY_DESC= RIPTOR + MemoryMap - A pointer to the current memory map + VirtualMemoryMap - A pointer to the modified virtual memory map + VirtualMapSize - A pointer to the size, in bytes, of the VirtualMemor= yMap buffer + +Returns: + + NONE + +--*/ +{ + UINTN Index; + *VirtualMapSize =3D 0; + + // + // Copy entries that need runtime mapping to construct + virtualMemoryMap + // + for (Index =3D 0; Index < (MemoryMapSize / DescriptorSize); Index++) { + if ((MemoryMap->Attribute & EFI_MEMORY_RUNTIME) =3D=3D + EFI_MEMORY_RUNTIME) { + SctCopyMem ((VOID *) VirtualMemoryMap, (VOID *) MemoryMap, + DescriptorSize); + VirtualMemoryMap->VirtualStart =3D + VirtualMemoryMap->PhysicalStart; + *VirtualMapSize +=3D DescriptorSize; + VirtualMemoryMap =3D NextMemoryDescriptor (VirtualMemoryMap, + DescriptorSize); + } + + MemoryMap =3D NextMemoryDescriptor (MemoryMap, DescriptorSize); + } +} + + + +VOID +JumpVirtualMode( + IN UINTN VirtualFunc, + IN UINTN HandOffAddr + ) +/*++ + +Routine Description: + + Enable virtual addressing mode, and jump to RuntimeTestFunc in + virtual address + +Arguments: + + VirtualFunc - RuntimeTestFunc virtual address + HandOffAddr - Configuration Data Address + +Returns: + + NONE + +--*/ +{ + // + // Note: It is assumed that the MMU and page tables are configured on + ARM platforms + // based on ARM v5 v6 and v7 architecture. + // + /* FIXME: Is it the same on ARM v8? */ + JumpToTestFunc(VirtualFunc, HandOffAddr); +} diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c b/uefi-sct/Sct= Pkg/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 + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +/*++ + +Module Name: + + Debug.c + +--*/ + +#include "SCRTDriver.h" + +UINTN mHandOffPtr =3D 0; +EFI_PHYSICAL_ADDRESS mIoPortSpaceAddress =3D 0; + + +EFI_STATUS +ConsumeHandOff ( + IN UINTN HandOffAddr, + OUT CONF_INFO *ConfigData + ) +{ + RUNTIME_HANDOFF *HandOffPtr; + // + // First fix the memory address of hand off data. + // + FixAddress(&HandOffAddr); + mHandOffPtr =3D HandOffAddr; + HandOffPtr =3D (RUNTIME_HANDOFF*)mHandOffPtr; + *ConfigData =3D HandOffPtr->ConfigureInfo; + + if (!HandOffPtr->DebuggerInfo.MmioFlag){ + // + // If debug port is I/O mapped, fix IoBase Address. + // + FixAddress(&HandOffPtr->DebuggerInfo.IoBase); + mIoPortSpaceAddress =3D HandOffPtr->DebuggerInfo.IoBase; + } else { + // + // If debug port is MMIO, fix MmioBase Address. + // + FixAddress(&HandOffPtr->DebuggerInfo.MmioBase); + } + + return EFI_SUCCESS; +} + + +EFI_STATUS +Send2UART ( + CHAR8 *String + ) +{ + // + // TODO: On ARM platforms use platform specific functions to + // write the data to UART. + // + return EFI_SUCCESS; +} + + + +EFI_STATUS +DebugWorker ( + IN CHAR8 *String + ) +{ + EFI_STATUS Status; + + // + // Send text message to registered UART. + // + Status =3D Send2UART(String); + return Status; +} diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c b/uefi-sct/SctP= kg/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 + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +/*++ + +Module Name: + + Dump.c + +--*/ + +#include "SCRTDriver.h" + +VOID +DumpRuntimeTable() +{ + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DDump Runti= me Table=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("Header Signature =3D 0x%x\n", VRT->Hdr.Signature); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DGetTime Se= rvice=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("GetTime @ 0x%x\n", VRT->GetTime); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DSetTime Se= rvice=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("SetTime @ 0x%x\n", VRT->SetTime); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DGetWakeupT= ime + Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("GetWakeupTime @ 0x%x\n", VRT->GetWakeupTime); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DSetWakeupT= ime + Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("SetWakeupTime @ 0x%x\n", VRT->SetWakeupTime); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DGetVariabl= e Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("GetVariable @ 0x%x\n", VRT->GetVariable); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DGetNextVar= iableName + Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("GetNextVariableName @ 0x%x\n", VRT->GetNextVariableName); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DSetVariabl= e Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("SetVariable @ 0x%x\n", VRT->SetVariable); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DGetNextHig= hMonotonicCount + Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("GetNextHighMonotonicCount @ 0x%x\n", + VRT->GetNextHighMonotonicCount); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DResetSyste= m Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("ResetSystem @ 0x%x\n", VRT->ResetSystem); +#if 0 + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DUpdateCaps= ule + Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("UpdateCapsule @ 0x%x\n", VRT->UpdateCapsule); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DQueryCapsu= leCapabilities + Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("QueryCapsuleCapabilities @ 0x%x\n", + VRT->QueryCapsuleCapabilities); + + SctAPrint ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DQueryVaria= bleInfo + Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + SctAPrint ("QueryVariableInfo @ 0x%x\n", VRT->QueryVariableInfo); +#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 + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +/*++ + +Module Name: + + Io.c + +--*/ + +#include "Io.h" + +EFI_STATUS +EFIAPI +CpuIoServiceWrite ( + IN EFI_PEI_CPU_IO_PPI_WIDTH Width, + IN UINT64 UserAddress, + IN UINTN Count, + IN VOID *UserBuffer + ) +/*++ + +Routine Description: + + Perform the port I/O write service + +Arguments: + + Width - Width of the port I/O operation + Address - Base address of the port I/O operation + Count - Count of the number of accesses to perform + Buffer - Pointer to the source buffer from which to write data + +Returns: + + EFI_SUCCESS - The data was written. + EFI_INVALID_PARAMETER - Width is invalid. + EFI_INVALID_PARAMETER - Buffer is NULL. + EFI_UNSUPPORTED - The Buffer is not aligned for the given Width. + EFI_UNSUPPORTED - The address range specified by Address, Width, + and Count is not valid. + +--*/ +{ + return EFI_UNSUPPORTED; +} + + +EFI_STATUS +EfiIoWrite ( + IN EFI_PEI_CPU_IO_PPI_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ) +/*++ + +Routine Description: + Perform an IO write into Buffer. + +Arguments: + Width - Width of write transaction, and repeat operation to use + Address - IO address to write + Count - Number of times to write the IO address. + Buffer - Buffer to write data from. size is Width * Count + +Returns: + Status code + +--*/ +{ + return CpuIoServiceWrite(Width, Address, Count, Buffer); +} + + +EFI_STATUS +EfiIoRead ( + IN EFI_PEI_CPU_IO_PPI_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ) +/*++ + +Routine Description: + Perform an IO read into Buffer. + +Arguments: + Width - Width of read transaction, and repeat operation to use + Address - IO address to read + Count - Number of times to read the IO address. + Buffer - Buffer to read data into. size is Width * Count + +Returns: + Status code + +--*/ +{ + return EFI_UNSUPPORTED; +} + + +VOID +FixAddress ( + IN UINTN *PhyAddress + ) +{ + // + //Note: On ARM platforms don't have to do this as all the f= unctions are virtually mapped. + // +} + +// Quick port to ARM + +VOID +Port80 ( + UINT8 Number + ) +{ + //EFI_SCT_DEBUG ((EFI_SCT_D_ERROR, L"Port80 %02x", Number)); +} 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 + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +/*++ + +Module Name: + + Debug.h + +--*/ + +#ifndef _IA32_IO_ACCESS_H +#define _IA32_IO_ACCESS_H + +#include "SCRTDriver.h" + +#define IA32_MAX_IO_ADDRESS 0xFFFF + +#define IA32API + + +typedef union { + UINT8 VOLATILE *buf; + UINT8 VOLATILE *ui8; + UINT16 VOLATILE *ui16; + UINT32 VOLATILE *ui32; + UINT64 VOLATILE *ui64; + UINTN VOLATILE ui; +} PTR; + +// This address is assuming a pure PC architecture. Not required? +#define VIRT_TO_PHYS_OFFSET (0x80000000) //2G + + + +#endif diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackB= oxTest/Riscv64/DebugSupportBBTestCacheFunction.c b/uefi-sct/SctPkg/TestCase= /UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCach= eFunction.c new file mode 100644 index 00000000..96ee7b57 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTe +++ st/Riscv64/DebugSupportBBTestCacheFunction.c @@ -0,0 +1,137 @@ +/** @file + + Copyright 2006 - 2016 Unified EFI, Inc.
+ Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + DebugSupportBBTestCacheFunction.c + +Abstract: + + Interface Function Test Cases of Debug Support Protocol + +--*/ + + +#include "DebugSupportBBTestMain.h" + +/** + * Entrypoint for EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache()= Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 3.5 +// +EFI_STATUS +BBTestInvalidateInstructionCacheFunctionAutoTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_DEBUG_SUPPORT_PROTOCOL *DebugSupport; + EFI_TEST_ASSERTION AssertionType; + UINT64 Start; + UINT64 Length; + UINTN MaxProcessorIndex; + UINTN ProcessorIndex; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.HandleProtocol - Handle standard test library", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + DebugSupport =3D (EFI_DEBUG_SUPPORT_PROTOCOL *)ClientInterface; + + if (DebugSupport->Isa !=3D PlatformIsa) { + return EFI_SUCCESS; + } + + Status =3D DebugSupport->GetMaximumProcessorIndex (DebugSupport, + &MaxProcessorIndex); + if (EFI_ERROR(Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + + L"EFI_DEBUG_SUPPORT_PROTOCOL.GetMaximumProcessorIndex", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + for (ProcessorIndex =3D 0; ProcessorIndex <=3D MaxProcessorIndex; + ProcessorIndex++) { + + // + // Assertion Point 3.5.2.1 + // Invoke InvalidateInstructionCache and verify interface correctness. + // + + // The Physical base of the memory range to be invalidated. + Start =3D 0x0; + + // The minimum number of bytes in the processor's instruction cache to= be invalidated. + Length =3D 0x0; + + Status =3D DebugSupport->InvalidateInstructionCache (DebugSupport, + ProcessorIndex, (VOID*)&Start, Length); + + if (EFI_ERROR(Status)) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid015, + + L"EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache - Invoke this + function and verify interface correctness", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + } + + return EFI_SUCCESS; +} + diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackB= oxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c b/uefi-sct/Sct= Pkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSuppo= rtBBTestExceptionCallbackFunction.c new file mode 100644 index 00000000..c27c0c0c --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTe +++ st/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c @@ -0,0 +1,276 @@ +/** @file + + Copyright 2006 - 2016 Unified EFI, Inc.
+ Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + DebugSupportBBExceptionCallbackFunction.c + +Abstract: + + Interface Function Test Cases of Debug Support Protocol + +--*/ + + +#include "DebugSupportBBTestMain.h" + +extern volatile UINTN InvokedExceptionCallback; +extern volatile UINTN InvokedPeriodicCallback; + +extern EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa; + +void +SoftwareBreak ( + void + ) +{ + // Not ported to ARM yet + ASSERT (FALSE); +} + +/** + * Entrypoint for EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback() = Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 3.4 +// +EFI_STATUS +BBTestRegisterExceptionCallbackFunctionManualTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_DEBUG_SUPPORT_PROTOCOL *DebugSupport; + EFI_TEST_ASSERTION AssertionType; + + DebugSupport =3D (EFI_DEBUG_SUPPORT_PROTOCOL *)ClientInterface; + + if (DebugSupport->Isa !=3D PlatformIsa) { + return EFI_SUCCESS; + } + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.HandleProtocol - Handle standard test library", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + // + // Assertion Point 3.4.2.1 + // Invoke RegisterExceptionCallback() to install an interrupt handler fu= nction. + // + InvokedExceptionCallback =3D FALSE; + // FIXME: Is it normal that we use EXCEPT_IA32_BREAKPOINT here? + // Shouldn't we define proper constants for ARM exceptions in DebugSuppo= rtProtocol.h file? + Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, + ExceptionCallback, EXCEPT_IA32_BREAKPOINT); + + if ((Status =3D=3D EFI_SUCCESS) || (Status =3D=3D EFI_ALREADY_STARTED)) = { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid009, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback + - Invoke this function and verify interface correctness", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // If the callback function is already registed, return + // + if (EFI_ERROR(Status)) { + return EFI_SUCCESS; + } + + // + // Test the callback function registed. + // + + // + // Call SoftwareBreak to invoke the interrupt handler function. + // + SoftwareBreak (); + + if (InvokedExceptionCallback =3D=3D FALSE) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid010, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback + - Verify the callback function was invoked.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Assertion Point 3.4.2.2 + // Invoke RegisterPeriodicCallback() to install the Periodic interrupt h= andler function. + // Verify the two callback functions can be both invoked. + // + InvokedExceptionCallback =3D FALSE; + InvokedPeriodicCallback =3D FALSE; + + Status =3D DebugSupport->RegisterPeriodicCallback (DebugSupport, 0, + PeriodicCallback); + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Wait the PeriodicCallback to be invoked. + // + gtBS->Stall (500000); + + // + // Call SoftwareBreak to invoke the interrupt handler function. + // + SoftwareBreak (); + + if ((InvokedExceptionCallback =3D=3D TRUE) && (InvokedPeriodicCallback = =3D=3D + TRUE)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid011, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback + - Verify the two callback functions can be both invoked.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Uninstall the Periodic callback function. + // + Status =3D DebugSupport->RegisterPeriodicCallback (DebugSupport, 0, + NULL); + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Assertion Point 3.4.2.3 + // Invoke RegisterExceptionCallback() to install another interrupt handl= er function. + // + Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, + ExceptionCallback1, EXCEPT_IA32_BREAKPOINT); + + if (Status !=3D EFI_ALREADY_STARTED) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid012, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback + - Register another callback function.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Assertion Point 3.4.2.4 + // Invoke RegisterExceptionCallback() to unstall the interrupt handler f= unction. + // + Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, + NULL, EXCEPT_IA32_BREAKPOINT); + + if (EFI_ERROR(Status)) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid013, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback + - Invoke this function to uninstall the interrupt handler function", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + InvokedExceptionCallback =3D FALSE; + + // + // Call SoftwareBreak to invoke the interrupt handler function. + // + SoftwareBreak (); + + if (InvokedExceptionCallback !=3D FALSE) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid014, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback + - Verify the callback function wasn't invoked", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + return EFI_SUCCESS; +} + diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackB= oxTest/Riscv64/PlatformIsa.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/D= ebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c new file mode 100644 index 00000000..8334f601 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTe +++ st/Riscv64/PlatformIsa.c @@ -0,0 +1,30 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + PlatformIsa.c + +Abstract: + + Platform related Isa definition. + +--*/ + +#include "DebugSupportBBTestMain.h" + +EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa =3D IsaAArch64; + diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/R= iscv64/EntsLibPlat.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENT= S/EasLib/Riscv64/EntsLibPlat.h new file mode 100644 index 00000000..ff781aee --- /dev/null +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv +++ 64/EntsLibPlat.h @@ -0,0 +1,55 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2010 - 2012, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + EntsLibPlat.h + +Abstract: + + AArch64 specific defines + +--*/ + +#ifndef _EFI_LIB_PLAT_H_ +#define _EFI_LIB_PLAT_H_ + +#define MIN_ALIGNMENT_SIZE 8 + +VOID +EntsInitializeLibPlatform ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Initialize platform. + +Arguments: + + ImageHandle - The image handle. + SystemTable - The system table. + +Returns: + + None. + +--*/ +; + +#endif diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/R= iscv64/InitPlat.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/E= asLib/Riscv64/InitPlat.c new file mode 100644 index 00000000..70a509a4 --- /dev/null +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv +++ 64/InitPlat.c @@ -0,0 +1,55 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2010 - 2012, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the + BSD License + which accompanies this distribution. The full text of the license + may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + InitPlat.c + +Abstract: + + Math routines for compatibility with native EFI library routines. + +--*/ + +#include "Efi.h" +#include "EntsLibPlat.h" + +VOID +EntsInitializeLibPlatform ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Initialize platform. + +Arguments: + + ImageHandle - The image handle. + SystemTable - The system table. + +Returns: + + None. + +--*/ +{ + // + // No platform-specific initializations + // +} -- 2.30.0 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.