lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428785283-20501-7-git-send-email-richard@nod.at>
Date:	Sat, 11 Apr 2015 22:47:45 +0200
From:	Richard Weinberger <richard@....at>
To:	linux-arch@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, rth@...ddle.net,
	ink@...assic.park.msu.ru, mattst88@...il.com, vgupta@...opsys.com,
	linux@....linux.org.uk, catalin.marinas@....com,
	will.deacon@....com, hskinnemoen@...il.com, egtvedt@...fundet.no,
	realmz6@...il.com, msalter@...hat.com, a-jacquiot@...com,
	starvik@...s.com, jesper.nilsson@...s.com, dhowells@...hat.com,
	rkuo@...eaurora.org, tony.luck@...el.com, fenghua.yu@...el.com,
	geert@...ux-m68k.org, james.hogan@...tec.com, monstr@...str.eu,
	ralf@...ux-mips.org, yasutake.koichi@...panasonic.com,
	lftan@...era.com, jonas@...thpole.se, jejb@...isc-linux.org,
	deller@....de, benh@...nel.crashing.org, paulus@...ba.org,
	mpe@...erman.id.au, schwidefsky@...ibm.com,
	heiko.carstens@...ibm.com, liqin.linux@...il.com,
	lennox.wu@...il.com, davem@...emloft.net, cmetcalf@...hip.com,
	jdike@...toit.com, akpm@...ux-foundation.org, oleg@...hat.com,
	hch@...radead.org, viro@...iv.linux.org.uk,
	torvalds@...ux-foundation.org, Richard Weinberger <richard@....at>
Subject: [PATCH 06/24] blackfin: Autogenerate offsets in struct thread_info

Maintaining offsets by hand is no fun.

Signed-off-by: Richard Weinberger <richard@....at>
---
 arch/blackfin/include/asm/thread_info.h | 9 ---------
 arch/blackfin/kernel/asm-offsets.c      | 6 ++++++
 arch/blackfin/kernel/traps.c            | 1 +
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
index 57c3a8b..962be3f 100644
--- a/arch/blackfin/include/asm/thread_info.h
+++ b/arch/blackfin/include/asm/thread_info.h
@@ -76,15 +76,6 @@ static inline struct thread_info *current_thread_info(void)
 #endif				/* __ASSEMBLY__ */
 
 /*
- * Offsets in thread_info structure, used in assembly code
- */
-#define TI_TASK		0
-#define TI_EXECDOMAIN	4
-#define TI_FLAGS	8
-#define TI_CPU		12
-#define TI_PREEMPT	16
-
-/*
  * thread information flag bit numbers
  */
 #define TIF_SYSCALL_TRACE	0	/* syscall trace active */
diff --git a/arch/blackfin/kernel/asm-offsets.c b/arch/blackfin/kernel/asm-offsets.c
index 37fcae9..486560a 100644
--- a/arch/blackfin/kernel/asm-offsets.c
+++ b/arch/blackfin/kernel/asm-offsets.c
@@ -42,6 +42,12 @@ int main(void)
 	DEFINE(THREAD_PC, offsetof(struct thread_struct, pc));
 	DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE);
 
+	/* offsets in thread_info struct */
+	OFFSET(TI_TASK, thread_info, task);
+	OFFSET(TI_FLAGS, thread_info, flags);
+	OFFSET(TI_CPU, thread_info, cpu);
+	OFFSET(TI_PREEMPT, thread_info, preempt_count);
+
 	/* offsets into the pt_regs */
 	DEFINE(PT_ORIG_R0, offsetof(struct pt_regs, orig_r0));
 	DEFINE(PT_ORIG_P0, offsetof(struct pt_regs, orig_p0));
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index de5c2c3..1ed85dd 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -18,6 +18,7 @@
 #include <asm/fixed_code.h>
 #include <asm/pseudo_instructions.h>
 #include <asm/pda.h>
+#include <asm/asm-offsets.h>
 
 #ifdef CONFIG_KGDB
 # include <linux/kgdb.h>
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ