LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC] alpha: vmlinux.lds cleanup - use THREAD_SIZE macro
@ 2008-02-26 19:51 Cyrill Gorcunov
  2008-02-27 18:57 ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Cyrill Gorcunov @ 2008-02-26 19:51 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Sam Ravnborg, LKML

This patch modifies thread_info.h header to be able to include it
into linker script and then we're able to use THREAD_SIZE in
vmlinux.lds

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>

---

COMPLETELY UNTESTED
Any comments are welcome!


Index: linux-2.6.git/arch/alpha/kernel/vmlinux.lds.S
===================================================================
--- linux-2.6.git.orig/arch/alpha/kernel/vmlinux.lds.S	2008-01-29 18:03:45.000000000 +0300
+++ linux-2.6.git/arch/alpha/kernel/vmlinux.lds.S	2008-02-26 21:49:59.000000000 +0300
@@ -1,5 +1,6 @@
 #include <asm-generic/vmlinux.lds.h>
 #include <asm/page.h>
+#include <asm/thread_info.h>
 
 OUTPUT_FORMAT("elf64-alpha")
 OUTPUT_ARCH(alpha)
@@ -88,7 +89,7 @@ SECTIONS
 
 	PERCPU(PAGE_SIZE)
 
-	. = ALIGN(2 * PAGE_SIZE);
+	. = ALIGN(THREAD_SIZE);
 	__init_end = .;
 	/* Freed after init ends here */
 
Index: linux-2.6.git/include/asm-alpha/thread_info.h
===================================================================
--- linux-2.6.git.orig/include/asm-alpha/thread_info.h	2008-01-21 19:35:26.000000000 +0300
+++ linux-2.6.git/include/asm-alpha/thread_info.h	2008-02-26 22:00:42.000000000 +0300
@@ -7,9 +7,7 @@
 #include <asm/processor.h>
 #include <asm/types.h>
 #include <asm/hwrpb.h>
-#endif
 
-#ifndef __ASSEMBLY__
 struct thread_info {
 	struct pcb_struct	pcb;		/* palcode state */
 
@@ -50,13 +48,14 @@ register struct thread_info *__current_t
 #define current_thread_info()  __current_thread_info
 
 /* Thread information allocation.  */
-#define THREAD_SIZE (2*PAGE_SIZE)
 #define alloc_thread_info(tsk) \
   ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
 #define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
 
 #endif /* __ASSEMBLY__ */
 
+#define THREAD_SIZE (2 * PAGE_SIZE)
+
 #define PREEMPT_ACTIVE		0x40000000
 
 /*
@@ -94,6 +93,8 @@ register struct thread_info *__current_t
 #define ALPHA_UAC_MASK		(1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \
 				 1 << TIF_UAC_SIGBUS)
 
+#ifndef __ASSEMBLY__
+
 #define SET_UNALIGN_CTL(task,value)	({				     \
 	task_thread_info(task)->flags = ((task_thread_info(task)->flags &    \
 		~ALPHA_UAC_MASK)					     \
@@ -112,5 +113,7 @@ register struct thread_info *__current_t
 		 (int __user *)(value));				\
 	})
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 #endif /* _ALPHA_THREAD_INFO_H */

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

* Re: [RFC] alpha: vmlinux.lds cleanup - use THREAD_SIZE macro
  2008-02-26 19:51 [RFC] alpha: vmlinux.lds cleanup - use THREAD_SIZE macro Cyrill Gorcunov
@ 2008-02-27 18:57 ` Sam Ravnborg
  2008-02-27 19:01   ` Cyrill Gorcunov
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2008-02-27 18:57 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: Richard Henderson, LKML

On Tue, Feb 26, 2008 at 10:51:59PM +0300, Cyrill Gorcunov wrote:
> This patch modifies thread_info.h header to be able to include it
> into linker script and then we're able to use THREAD_SIZE in
> vmlinux.lds
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

And I also build tested the patch and checked the
resulting .lds files.
And they were semantically equal.

	Sam

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

* Re: [RFC] alpha: vmlinux.lds cleanup - use THREAD_SIZE macro
  2008-02-27 18:57 ` Sam Ravnborg
@ 2008-02-27 19:01   ` Cyrill Gorcunov
  0 siblings, 0 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 2008-02-27 19:01 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Richard Henderson, LKML

[Sam Ravnborg - Wed, Feb 27, 2008 at 07:57:56PM +0100]
| On Tue, Feb 26, 2008 at 10:51:59PM +0300, Cyrill Gorcunov wrote:
| > This patch modifies thread_info.h header to be able to include it
| > into linker script and then we're able to use THREAD_SIZE in
| > vmlinux.lds
| > 
| > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
| 
| And I also build tested the patch and checked the
| resulting .lds files.
| And they were semantically equal.
| 
| 	Sam
| 

Thanks Sam, I'm almost complete with series on other archs.
Will send them soon (but maybe not today ;)

		- Cyrill -

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

end of thread, other threads:[~2008-02-27 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-26 19:51 [RFC] alpha: vmlinux.lds cleanup - use THREAD_SIZE macro Cyrill Gorcunov
2008-02-27 18:57 ` Sam Ravnborg
2008-02-27 19:01   ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).