Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1727761 > unrolled thread

[RFC 11/17] x86/asm: Add task_top_of_stack() to find the top of a task's stack

Started byAndy Lutomirski <luto@kernel.org>
First post2017-09-06 23:40 +0200
Last post2017-09-06 23:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC 11/17] x86/asm: Add task_top_of_stack() to find the top of a task's stack Andy Lutomirski <luto@kernel.org> - 2017-09-06 23:40 +0200

#1727761 — [RFC 11/17] x86/asm: Add task_top_of_stack() to find the top of a task's stack

FromAndy Lutomirski <luto@kernel.org>
Date2017-09-06 23:40 +0200
Subject[RFC 11/17] x86/asm: Add task_top_of_stack() to find the top of a task's stack
Message-ID<umQdc-7qi-21@gated-at.bofh.it>
This will let us get rid of a few places that hardcode accesses to
thread.sp0.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/include/asm/processor.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 85ddfc1a9bb5..f83fbf1b6dd9 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -788,6 +788,8 @@ static inline void spin_lock_prefetch(const void *x)
 #define TOP_OF_INIT_STACK ((unsigned long)&init_stack + sizeof(init_stack) - \
 			   TOP_OF_KERNEL_STACK_PADDING)
 
+#define task_top_of_stack(task) ((unsigned long)(task_pt_regs(task) + 1))
+
 #ifdef CONFIG_X86_32
 /*
  * User space process size: 3GB (default).
-- 
2.13.5

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web