[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190507225121.18676-1-ynorov@marvell.com>
Date: Tue, 7 May 2019 15:51:21 -0700
From: Yury Norov <yury.norov@...il.com>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@....fr>,
Breno Leitao <leitao@...ian.org>,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Cc: Yury Norov <ynorov@...vell.com>, Yury Norov <yury.norov@...il.com>
Subject: [PATCH] powerpc: restore current_thread_info()
Commit ed1cd6deb013 ("powerpc: Activate CONFIG_THREAD_INFO_IN_TASK")
removes the function current_thread_info(). It's wrong because the
function is used in non-arch code and is part of API.
For my series of arm64/ilp32, after applying the patch
https://github.com/norov/linux/commit/b269e51eee66ffec3008a3effb12363b91754e49
it causes build break.
This patch restores current_thread_info().
Signed-off-by: Yury Norov <ynorov@...vell.com>
---
arch/powerpc/include/asm/thread_info.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 8e1d0195ac36..f700bc80a607 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -19,6 +19,7 @@
#ifndef __ASSEMBLY__
#include <linux/cache.h>
+#include <asm/current.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/accounting.h>
@@ -57,6 +58,11 @@ struct thread_info {
#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
/* how to get the thread information struct from C */
+static inline struct thread_info *current_thread_info(void)
+{
+ return (struct thread_info *)current;
+}
+
extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
#ifdef CONFIG_PPC_BOOK3S_64
--
2.17.1
Powered by blists - more mailing lists