From nobody Mon Nov 25 12:51:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+70302+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70302+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1610642210; cv=none; d=zohomail.com; s=zohoarc; b=Lbv/jXTijeNm2wCnsS7j3svJryeBeHAYNf97uYMrJjgSwqMqEk+aClYurN6lW8wW0C/+P8MTJ7Cga/C+Cg5GYo5b2jwEKQckVRs7p8dAHYhI1XyTYBh8KlcYg3HzIoORGiYaPBEEaMyeorJ/CQd0Sb+/hSXtTxPsZKgycoJPqhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610642210; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=5XQmMrPbgZh8pa4U7RCzV6KR/LxhtCZIEMRtyS/myOo=; b=A19HOveTQkLHk7G1i8/f3Uv3WAIWRbZ9wHrIU9MDyfEh8ERHARB7V5pWRplPJJGuJVu4v8bXku+Nbtyz2CMqZJaOGb8b0Dxj/x4rTVsQSnZxg98oFRW8A3hOX908WMAyqeDxBvCjVx3oOGpbRc2qQJ1ZW/htaTctQh2FPCT/G6w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70302+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1610642210610338.9720144245049; Thu, 14 Jan 2021 08:36:50 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id clArYY1788612xpGxQdNmI6t; Thu, 14 Jan 2021 08:36:50 -0800 X-Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by mx.groups.io with SMTP id smtpd.web10.4046.1610642204701234235 for ; Thu, 14 Jan 2021 08:36:44 -0800 X-Received: by mail-io1-f41.google.com with SMTP id b19so9848572ioa.9 for ; Thu, 14 Jan 2021 08:36:44 -0800 (PST) X-Gm-Message-State: jTFJCw4xmYbS7jpJf9IDYZxIx1787277AA= X-Google-Smtp-Source: ABdhPJxDk3D5gJf4tauDsA542GhmKtBNSKPWOp48uA8qg7XOLlvUY9p0HSUsuR55QTzYYfNkZkdz6g== X-Received: by 2002:a92:cb44:: with SMTP id f4mr7210242ilq.131.1610642203897; Thu, 14 Jan 2021 08:36:43 -0800 (PST) X-Received: from cube.nuviainc.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id y5sm3711920ilj.35.2021.01.14.08.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 08:36:43 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Leif Lindholm , Ard Biesheuvel , nd@arm.com, Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu , Sami Mujawar Subject: [edk2-devel] [PATCH v6 07/22] ArmPkg: Fix the return type of the ReadCCSIDR function Date: Thu, 14 Jan 2021 09:36:13 -0700 Message-Id: <20210114163628.31952-8-rebecca@nuviainc.com> In-Reply-To: <20210114163628.31952-1-rebecca@nuviainc.com> References: <20210114163628.31952-1-rebecca@nuviainc.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1610642210; bh=+cH5ZHOWHufBLaR1xU52241mxPeFPTInbGTF/5H7Oy8=; h=Cc:Date:From:Reply-To:Subject:To; b=LxATvZf14IA12MS2K+L3fPEtVG6bJaqksRixvxapfDRWz75Jjot/KBMGp7NMlsuvziH 4PQw5hEURS4W/QAUr6i0+RLST30TNl7u/Vl/sucY6zTQ8NWizxTretk0aKeSfo6HNcM5V 2KSOnIfOSXxP8gFx1Jx08KdrII1+WG8ex6s= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" When CCIDX is supported, the Current Cache Size ID Register contains data above 32 bits: namely the number of sets. Avoid truncating this by returning a UINTN instead of UINT32. On AARCH32, the expanded number of sets data can be read via the CCSIDR2 register. Also, add Doxygen comments for the function. Signed-off-by: Rebecca Cran Reviewed-by: Sami Mujawar Reviewed-by: Leif Lindholm --- ArmPkg/Library/ArmLib/ArmLibPrivate.h | 9 ++++++++- ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S | 2 +- ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S | 2 +- ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ArmPkg/Library/ArmLib/ArmLibPrivate.h b/ArmPkg/Library/ArmLib/= ArmLibPrivate.h index 2e90739eb858..8959bdd9d73c 100644 --- a/ArmPkg/Library/ArmLib/ArmLibPrivate.h +++ b/ArmPkg/Library/ArmLib/ArmLibPrivate.h @@ -61,7 +61,14 @@ CPSRRead ( VOID ); =20 -UINT32 +/** Reads the CCSIDR register for the specified cache. + + @param CSSELR The CSSELR cache selection register value. + + @return The contents of the CCSIDR_EL1 register for the specified cache,= when in AARCH64 mode. + Returns the contents of the CCSIDR register in AARCH32 mode. +**/ +UINTN ReadCCSIDR ( IN UINT32 CSSELR ); diff --git a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S b/ArmPkg/Libra= ry/ArmLib/AArch64/ArmLibSupportV8.S index 0e8d21e2264f..0ae75e4cb9f9 100644 --- a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S +++ b/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S @@ -84,7 +84,7 @@ ASM_FUNC(ArmDisableAllExceptions) ret =20 =20 -// UINT32 +// UINTN // ReadCCSIDR ( // IN UINT32 CSSELR // ) diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S b/ArmPkg/Library/A= rmLib/Arm/ArmLibSupportV7.S index a60a2f634132..af61dbee5261 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S +++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S @@ -64,7 +64,7 @@ ASM_FUNC(ArmReadIdMmfr4) mrc p15,0,r0,c0,c2,6 @ Read ID_MMFR4 Register bx lr =20 -// UINT32 +// UINTN // ReadCCSIDR ( // IN UINT32 CSSELR // ) diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm b/ArmPkg/Library= /ArmLib/Arm/ArmLibSupportV7.asm index 1679b09b797a..81f3cb79994c 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm +++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm @@ -68,7 +68,7 @@ mrc p15,0,r0,c0,c2,6 ; Read ID_MMFR4 Register bx LR =20 -// UINT32 +// UINTN // ReadCCSIDR ( // IN UINT32 CSSELR // ) --=20 2.26.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#70302): https://edk2.groups.io/g/devel/message/70302 Mute This Topic: https://groups.io/mt/79679243/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-