aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorSumit Singh <sumsingh@nvidia.com>2014-03-14 14:20:18 +0530
committerMoyster <oysterized@gmail.com>2016-09-10 12:07:08 +0200
commitc9e9fabea850ae38ba17d7ae8765858abb3f4307 (patch)
tree6ad5f7ac2d765218d55a2b9794c00428bd42420c /arch/arm64/include
parentb2f9f35fbc1fd14f8cf2f9a816497697860b4306 (diff)
ARM64: defining macros to optimize power usage
Here we have defined some macros such as cpu_relaxed_read, cpu_relaxed_read_long, cpu_read_relax in arch/arm64/include/asm/processor.h which will be used to enhance power optimization on Denver. bug 1440421 Here we are trying to improve power optimazation using some macros such Change-Id: I313e47b35e9a638fe81b7350887f59eeacc45bc1 Signed-off-by: Sumit Singh <sumsingh@nvidia.com> Reviewed-on: http://git-master/r/381950 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com> Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/processor.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index 3b7bb031f..89c84b118 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -3,6 +3,7 @@
*
* Copyright (C) 1995-1999 Russell King
* Copyright (C) 2012 ARM Ltd.
+ * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -33,6 +34,7 @@
#include <asm/hw_breakpoint.h>
#include <asm/ptrace.h>
#include <asm/types.h>
+#include <asm/atomic.h>
#ifdef __KERNEL__
#define STACK_TOP_MAX TASK_SIZE_64
@@ -124,6 +126,10 @@ unsigned long get_wchan(struct task_struct *p);
#define cpu_relax() barrier()
+#define cpu_relaxed_read(p) ldax32(p)
+#define cpu_relaxed_read_long(p) ldax64((u64 *)p)
+#define cpu_read_relax() wfe()
+
/* Thread switching */
extern struct task_struct *cpu_switch_to(struct task_struct *prev,
struct task_struct *next);
@@ -159,4 +165,6 @@ static inline void spin_lock_prefetch(const void *x)
#endif
+#include <asm-generic/processor.h>
+
#endif /* __ASM_PROCESSOR_H */