* [PATCH 3/6] powerpc: Add ppr in thread_info struct
@ 2012-09-09 11:40 Haren Myneni
0 siblings, 0 replies; only message in thread
From: Haren Myneni @ 2012-09-09 11:40 UTC (permalink / raw)
To: benh, paulus, anton, mikey; +Cc: linuxppc-dev
ppr in thread_info is used to save PPR and restore it before process exits
from kernel.
This patch sets the default priority to 3 when tasks are created such
that users can use 4 for higher priority tasks.
Signed-off-by: Haren Myneni <haren@us.ibm.com>
---
arch/powerpc/include/asm/thread_info.h | 11 +++++++++++
arch/powerpc/kernel/asm-offsets.c | 1 +
2 files changed, 12 insertions(+)
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index faf9352..ea53542 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -46,10 +46,20 @@ struct thread_info {
struct restart_block restart_block;
unsigned long local_flags; /* private flags for thread */
+ unsigned long ppr; /* SMT Thread status register */
/* low level flags - has atomic operations done on it */
unsigned long flags ____cacheline_aligned_in_smp;
};
+#ifdef CONFIG_PPC64
+/* Default SMT priority to (11- 13bits). */
+/* .ppr is Used to save/restore only on P7 or later */
+#define INIT_PPR \
+ .ppr = (3ull << 50),
+#else
+#define INIT_PPR
+#endif
+
/*
* macros/functions for gaining access to the thread information structure
*/
@@ -62,6 +72,7 @@ struct thread_info {
.restart_block = { \
.fn = do_no_restart_syscall, \
}, \
+ INIT_PPR \
.flags = 0, \
}
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index e899572..1c2c066 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -128,6 +128,7 @@ int main(void)
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
#ifdef CONFIG_PPC64
+ DEFINE(TI_PPR, offsetof(struct thread_info, ppr));
DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size));
DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_dline_size));
DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, dlines_per_page));
--
1.7.10.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-09-09 11:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-09 11:40 [PATCH 3/6] powerpc: Add ppr in thread_info struct Haren Myneni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox