From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by mx.groups.io with SMTP id smtpd.web11.3042.1606782891698551753 for ; Mon, 30 Nov 2020 16:34:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=pQqw/ofo; spf=pass (domain: nuviainc.com, ip: 209.85.215.195, mailfrom: rebecca@nuviainc.com) Received: by mail-pg1-f195.google.com with SMTP id e23so130674pgk.12 for ; Mon, 30 Nov 2020 16:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yUuZ6oLNZQN7uKxtzRiqZdFNYPpRs6sVBLEqUTF6U/4=; b=pQqw/ofo+GKi+ZNuslgnrUuZMAZESHCnXFr5kjA6YSvSpiuIUv2CGqGU0bjITVpEs6 p/7gW3Wc/xzCl7RA8BpgQJ+L1HzTLooblhy8nik64pmaeG3Off6cVmxJQc0+S+37KqUp 1esEJXQUftQLuRjzvHcRz/4cujsy/TKCL2thCWIpXoK4EvpvTLn/8TT2M5QTnJw+Wy7n 1zJuz+uKAHSm2Ye7CwNeu6jI1AfBm05MnFz3TA+EA9DAj6SZg+ZoHBiC9F3NRfMYzWn7 yzrjXvs+AAM7H9nDG9OfiFLwXg+UhSOtF9lybQwEve8XXmei1O+TC3johmYfCIeBsBez O/gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yUuZ6oLNZQN7uKxtzRiqZdFNYPpRs6sVBLEqUTF6U/4=; b=PXLogNwc0E54nbYV06DVVPZfwKHEMheySeRtLrKDLs2X5fFfmQBqkOSRH++B3ewhYR uuep8fvq0oHxQ2afj+D+WLcH5Q5NVzaxOS+6dJGqdDmBPtMFKWuBYlt+UL1ZJSQcOvjd JA+fjpxgtsCYDbXcWbHOjnLCpe/BYzotdJpuo5nOYiMSCZvGEgo3FwIOvChGEX0d8Erp IWEggIF3DNLPdVBsx53+pBPuVKf8G0YR3iAtbj9AWKkagF+1hxyXYL5BBBALTwLQ5NN5 2v98gtoZD0famSGE+Ew6qY1+9Cyzii/cMSBYJZFqiDC5e4LPuz9SKRyik7A3O7Qd7SRF lR/w== X-Gm-Message-State: AOAM532UJCUdvz//sPgCTMOALPNcZlkY8fgK7B6cXG7i4q/0vjgP7nXc TgVSX0dlCtakXlgRqedd/+HkIgoL2dislOPtWGc3Xa/ihFR0N95iismui/E+F4Rs/1+a5SvynvZ AqfSJCETZPLx0BXX5xLU05nae+AwJ8J49uPit6YCKPFG98+USDYFOrO8yZALWvvm00Jnjn4+D X-Google-Smtp-Source: ABdhPJy5edDuIlhoha2LuCvL8minnsu53c+QOD8w5awYW7TXKiV/79izxE4D2P7iSMw1w+OmXtBLhA== X-Received: by 2002:aa7:96e3:0:b029:197:9547:4994 with SMTP id i3-20020aa796e30000b029019795474994mr247518pfq.60.1606782890854; Mon, 30 Nov 2020 16:34:50 -0800 (PST) Return-Path: 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 22sm57899pjb.40.2020.11.30.16.34.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 16:34:49 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Michael D Kinney , Liming Gao , Zhiguang Liu , Leif Lindholm , Ard Biesheuvel , Sami Mujawar Subject: [PATCH v4 07/11] ArmPkg: Fix the return type of the ReadCCSIDR function Date: Mon, 30 Nov 2020 17:33:54 -0700 Message-Id: <20201201003358.8780-8-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201201003358.8780-1-rebecca@nuviainc.com> References: <20201201003358.8780-1-rebecca@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Rebecca Cran --- ArmPkg/Library/ArmLib/ArmLibPrivate.h | 2 +- ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S | 2 +- ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ArmPkg/Library/ArmLib/ArmLibPrivate.h b/ArmPkg/Library/ArmLib/ArmLibPrivate.h index 2e90739eb858..5eecbc0e1c43 100644 --- a/ArmPkg/Library/ArmLib/ArmLibPrivate.h +++ b/ArmPkg/Library/ArmLib/ArmLibPrivate.h @@ -61,7 +61,7 @@ CPSRRead ( VOID ); -UINT32 +UINTN ReadCCSIDR ( IN UINT32 CSSELR ); diff --git a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S b/ArmPkg/Library/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 -// 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 -// UINT32 +// UINTN // ReadCCSIDR ( // IN UINT32 CSSELR // ) -- 2.26.2