public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: evan.lloyd@arm.com
To: edk2-devel@ml01.01.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	Ryan Harkin <ryan.harkin@linaro.org>,
	Matteo Carlini <Matteo.Carlini@arm.com>
Subject: [PATCH 1/2] ArmPkg: Add CNTHCTL_EL2 support functions
Date: Tue, 16 May 2017 11:10:44 +0100	[thread overview]
Message-ID: <20170516101045.14288-2-evan.lloyd@arm.com> (raw)
In-Reply-To: <20170516101045.14288-1-evan.lloyd@arm.com>

From: Sami Mujawar <sami.mujawar@arm.com>

Added helper functions for reading and writing the
CNTHCTL_EL2 register.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
---
 ArmPkg/Include/Chipset/AArch64.h               | 12 +++++++++++-
 ArmPkg/Library/ArmLib/AArch64/AArch64Support.S | 10 ++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Include/Chipset/AArch64.h b/ArmPkg/Include/Chipset/AArch64.h
index cebfc5da426a44bb97505ed9c1da3b2b2e35a0cc..76c2cc735ef3196273b28c7a804048d8e1f6d123 100644
--- a/ArmPkg/Include/Chipset/AArch64.h
+++ b/ArmPkg/Include/Chipset/AArch64.h
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-  Copyright (c) 2011 - 2015, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2011 - 2017, ARM Ltd. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -235,4 +235,14 @@ ArmWriteCptr (
   IN  UINT64 Cptr
   );
 
+UINT32
+ArmReadCntHctl (
+  VOID
+  );
+
+VOID
+ArmWriteCntHctl (
+  IN UINT32 CntHctl
+  );
+
 #endif // __AARCH64_H__
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
index 6e8074a4868979d2fa3b850e1e588862179f829a..dde6a756528f3abf1bd5a142448e42122a9bd8fa 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
@@ -480,4 +480,14 @@ ASM_FUNC(ArmReadCurrentEL)
   mrs   x0, CurrentEL
   ret
 
+// UINT32 ArmReadCntHctl(VOID)
+ASM_FUNC(ArmReadCntHctl)
+  mrs   x0, cnthctl_el2
+  ret
+
+// VOID ArmWriteCntHctl(UINT32 CntHctl)
+ASM_FUNC(ArmWriteCntHctl)
+  msr   cnthctl_el2, x0
+  ret
+
 ASM_FUNCTION_REMOVE_IF_UNREFERENCED
-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")



  reply	other threads:[~2017-05-16 10:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 10:10 [PATCH 0/2] Initialize CNTHCTL evan.lloyd
2017-05-16 10:10 ` evan.lloyd [this message]
2017-05-16 10:10 ` [PATCH 2/2] ArmPlatformPkg: Timer access for non-secure EL1/0 evan.lloyd
2017-05-22 14:55 ` [PATCH 0/2] Initialize CNTHCTL Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170516101045.14288-2-evan.lloyd@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox