From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by mx.groups.io with SMTP id smtpd.web11.155.1607363689437649703 for ; Mon, 07 Dec 2020 09:54:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=kiVDX/qv; spf=pass (domain: nuviainc.com, ip: 209.85.216.65, mailfrom: rebecca@nuviainc.com) Received: by mail-pj1-f65.google.com with SMTP id l23so44044pjg.1 for ; Mon, 07 Dec 2020 09:54:49 -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=kiVDX/qvO8W3Rt8otJgopYsau3+MD0lgsskaPASvkrCxDgVcyR7BmVr+BlO31B36FX UG1fPUg5a1FzaJX9thqTQT8vhTllIkWLRqa/z2jvHYHx0//5QdhKMoG6+pkIVUlU7MQi IEU6GY1ohZCBjWXpgen+ItrPaNF3RtakoXKHBbB5g0vFoQDBjV4qRJ0EferJOJzAyksu ovxFNvvQPFcVIFOF3PQ+9DqAivhab+TkHYhFqAS0bzpdFhL9gkHytrhR99CB6Q0mRXIY 4hO6XVnEFQMKKtLmQnnzY3fNTph8stnHlk3TTqI+kqp5hzTXtwNEFPhBoZNMXAjfeb4m 6Ojg== 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=auxYgBlkOmU43Tccr9FQrkUMFwCnYFGDmDNq78kNJSV6A3mn6V5i4kUgVELjDbVjXH HsNU7TwVQSukQWMNSK0Ro24yB9Yypc7ypggx39HGd14rxkE5WileaOQGHmEWGZlS4yNo af14vD48QPUUVVHv8ECPzYKdUQn3i1KsottUgwNQEvvQz4KkyNafnp479FFd3Snp6Y1d esoi+kUdq06t5s5hW2Bq0LLaM18vWEFEVw9BV2gM3rIfKfd54Oetb6DlWWzMd9CweBCF rEgF9TKVXEHSax4Lz5KMlfU60znw6An72v89KkGuBnS+qMyEaYobDuTAqczBqoYIihe0 3ccg== X-Gm-Message-State: AOAM532nKlFDMfQZKIKd48ugc3ezpB0nYTPThVt2v2CmNUdmpppoCKY+ WnLd7X7V85oe4h8BEBnjytw30lb30zJx7ehsE90861NeNJx854KGFATwRT0Ir2WJEvIcfCfgZcl kGQCBU37Un0Awn+Oo3UFHvB7mGf3uMgxTXQ1bG+OKxK6acD9wbjiOG9D2weRm7IeIKpVUs3/B X-Google-Smtp-Source: ABdhPJx4O//OBp3H7qHFl0yADir79zPS01SHsUw4jlh0VM0zXezhtt91L4fpDCoEFbVwrJXrpPFI6w== X-Received: by 2002:a17:90a:73c2:: with SMTP id n2mr3757764pjk.37.1607363688642; Mon, 07 Dec 2020 09:54:48 -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 nm6sm2369pjb.25.2020.12.07.09.54.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 09:54:48 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Michael D Kinney , Liming Gao , Zhiguang Liu , Leif Lindholm , Ard Biesheuvel Subject: [PATCH v4 07/10] ArmPkg: Fix the return type of the ReadCCSIDR function Date: Mon, 7 Dec 2020 10:54:24 -0700 Message-Id: <20201207175427.28712-8-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201207175427.28712-1-rebecca@nuviainc.com> References: <20201207175427.28712-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