All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.10-rc3-mm1] m32r: Update include/asm-m32r/thread_info.h (0/2)
@ 2004-12-17 11:06 Hirokazu Takata
  2004-12-17 11:13 ` [PATCH 2.6.10-rc3-mm1] m32r: include/asm-m32r/thread_info.h minor updates (1/2) Hirokazu Takata
  2004-12-17 11:13 ` [PATCH 2.6.10-rc3-mm1] m32r: Use kmalloc for m32r stacks (2/2) Hirokazu Takata
  0 siblings, 2 replies; 3+ messages in thread
From: Hirokazu Takata @ 2004-12-17 11:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, takata

Hi,

This patchset updates include/asm-m32r/thread_info.h.
Please apply.

Thank you.

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
---

[PATCH 2.6.10-rc3-mm1] m32r: include/asm-m32r/thread_info.h minor updates (1/2)
- Use THREAD_SIZE for __ASSEMBLY__ portion.
- Update comments.
- Fix a typo: user-thead --> user-thread.

[PATCH 2.6.10-rc3-mm1] m32r: Use kmalloc for m32r stacks (2/2)
- Use kmalloc for m32r stacks (cf. changeset 1.1046.533.10)
- Update for CONFIG_DEBUG_STACK_USAGE

--
Hirokazu Takata <takata@linux-m32r.org>
Linux/M32R Project:  http://www.linux-m32r.org/



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2.6.10-rc3-mm1] m32r: include/asm-m32r/thread_info.h minor updates (1/2)
  2004-12-17 11:06 [PATCH 2.6.10-rc3-mm1] m32r: Update include/asm-m32r/thread_info.h (0/2) Hirokazu Takata
@ 2004-12-17 11:13 ` Hirokazu Takata
  2004-12-17 11:13 ` [PATCH 2.6.10-rc3-mm1] m32r: Use kmalloc for m32r stacks (2/2) Hirokazu Takata
  1 sibling, 0 replies; 3+ messages in thread
From: Hirokazu Takata @ 2004-12-17 11:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, takata

[PATCH 2.6.10-rc3-mm1] m32r: include/asm-m32r/thread_info.h minor updates (1/2)
- Use THREAD_SIZE for __ASSEMBLY__ portion.
- Update comments.
- Fix a typo: user-thead --> user-thread.

NOTE: Now there are two THREAD_SIZE definitions in the following patch,
one is in C part and the other is in __ASSEMBLY__ part.
I'm going to consolidate these THREAD_SIZE definitions.  So, I have to
change PAGE_SIZE definition of include/asm-m32r/page.h to be includable
into asm portion...

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
---

 include/asm-m32r/thread_info.h |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)


diff -ruNp a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h
--- a/include/asm-m32r/thread_info.h	2004-12-16 12:52:41.000000000 +0900
+++ b/include/asm-m32r/thread_info.h	2004-12-16 13:39:33.000000000 +0900
@@ -1,12 +1,13 @@
-/* thread_info.h: i386 low-level thread information
+#ifndef _ASM_M32R_THREAD_INFO_H
+#define _ASM_M32R_THREAD_INFO_H
+
+/* thread_info.h: m32r low-level thread information
  *
  * Copyright (C) 2002  David Howells (dhowells@redhat.com)
  * - Incorporating suggestions made by Linus Torvalds and Dave Miller
+ * Copyright (C) 2004  Hirokazu Takata <takata at linux-m32r.org>
  */
 
-#ifndef _ASM_THREAD_INFO_H
-#define _ASM_THREAD_INFO_H
-
 #ifdef __KERNEL__
 
 #ifndef __ASSEMBLY__
@@ -30,7 +31,7 @@ struct thread_info {
 	__s32			preempt_count; /* 0 => preemptable, <0 => BUG */
 
 	mm_segment_t		addr_limit;	/* thread address space:
-					 	   0-0xBFFFFFFF for user-thead
+					 	   0-0xBFFFFFFF for user-thread
 						   0-0xFFFFFFFF for kernel-thread
 						*/
 	struct restart_block    restart_block;
@@ -77,22 +78,23 @@ struct thread_info {
 #define init_thread_info	(init_thread_union.thread_info)
 #define init_stack		(init_thread_union.stack)
 
+#define THREAD_SIZE (2*PAGE_SIZE)
+
 /* how to get the thread information struct from C */
 static inline struct thread_info *current_thread_info(void)
 {
 	struct thread_info *ti;
 
 	__asm__ __volatile__ (
-		"ldi	%0, #0xffffe000;	\n\t"
-		"and	%0, sp;			\n\t"
-		: "=r" (ti)
+		"ldi	%0, #%1			\n\t"
+		"and	%0, sp			\n\t"
+		: "=r" (ti) : "i" (~(THREAD_SIZE - 1))
 	);
 
 	return ti;
 }
 
 /* thread information allocation */
-#define THREAD_SIZE (2*PAGE_SIZE)
 #define alloc_thread_info(task) \
 	((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
 #define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
@@ -116,10 +118,12 @@ static inline unsigned int get_thread_fa
 
 #else /* !__ASSEMBLY__ */
 
+#define THREAD_SIZE	8192
+
 /* how to get the thread information struct from ASM */
 #define GET_THREAD_INFO(reg)	GET_THREAD_INFO reg
 	.macro GET_THREAD_INFO reg
-	ldi	\reg, #0xffffe000
+	ldi	\reg, #-THREAD_SIZE
 	and	\reg, sp
 	.endm
 
@@ -162,4 +170,4 @@ static inline unsigned int get_thread_fa
 
 #endif /* __KERNEL__ */
 
-#endif /* _ASM_THREAD_INFO_H */
+#endif /* _ASM_M32R_THREAD_INFO_H */

--
Hirokazu Takata <takata@linux-m32r.org>
Linux/M32R Project:  http://www.linux-m32r.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2.6.10-rc3-mm1] m32r: Use kmalloc for m32r stacks (2/2)
  2004-12-17 11:06 [PATCH 2.6.10-rc3-mm1] m32r: Update include/asm-m32r/thread_info.h (0/2) Hirokazu Takata
  2004-12-17 11:13 ` [PATCH 2.6.10-rc3-mm1] m32r: include/asm-m32r/thread_info.h minor updates (1/2) Hirokazu Takata
@ 2004-12-17 11:13 ` Hirokazu Takata
  1 sibling, 0 replies; 3+ messages in thread
From: Hirokazu Takata @ 2004-12-17 11:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, takata

[PATCH 2.6.10-rc3-mm1] m32r: Use kmalloc for m32r stacks (2/2)
- Use kmalloc for m32r stacks (cf. changeset 1.1046.533.10)
- Update for CONFIG_DEBUG_STACK_USAGE

This modification was taken from include/asm-i386/thread_info.h.

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
---

 include/asm-m32r/thread_info.h |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)


diff -ruNp a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h
--- a/include/asm-m32r/thread_info.h	2004-12-16 13:41:57.000000000 +0900
+++ b/include/asm-m32r/thread_info.h	2004-12-16 13:42:32.000000000 +0900
@@ -95,9 +95,21 @@ static inline struct thread_info *curren
 }
 
 /* thread information allocation */
-#define alloc_thread_info(task) \
-	((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
-#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
+#if CONFIG_DEBUG_STACK_USAGE
+#define alloc_thread_info(tsk)					\
+	({							\
+		struct thread_info *ret;			\
+	 							\
+	 	ret = kmalloc(THREAD_SIZE, GFP_KERNEL);		\
+	 	if (ret)					\
+	 		memset(ret, 0, THREAD_SIZE);		\
+	 	ret;						\
+	 })
+#else
+#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
+#endif
+
+#define free_thread_info(info) kfree(info)
 #define get_thread_info(ti) get_task_struct((ti)->task)
 #define put_thread_info(ti) put_task_struct((ti)->task)
 
--
Hirokazu Takata <takata@linux-m32r.org>
Linux/M32R Project:  http://www.linux-m32r.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-12-17 11:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-17 11:06 [PATCH 2.6.10-rc3-mm1] m32r: Update include/asm-m32r/thread_info.h (0/2) Hirokazu Takata
2004-12-17 11:13 ` [PATCH 2.6.10-rc3-mm1] m32r: include/asm-m32r/thread_info.h minor updates (1/2) Hirokazu Takata
2004-12-17 11:13 ` [PATCH 2.6.10-rc3-mm1] m32r: Use kmalloc for m32r stacks (2/2) Hirokazu Takata

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.