* [uml-devel] [PATCH 1/10] UML - _switch_to code consolidation
@ 2005-09-14 21:55 ` Jeff Dike
0 siblings, 0 replies; 10+ messages in thread
From: Jeff Dike @ 2005-09-14 21:55 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, user-mode-linux-devel, Allan Graves
This patch moves code that is in both switch_to_tt and
switch_to_skas to the top level _switch_to function, keeping us from
duplicating code. It is required for the stack trace patch to work
properly.
Signed-off-by: Allan Graves <allan.graves@gmail.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Index: linux-2.6.13/arch/um/kernel/process_kern.c
===================================================================
--- linux-2.6.13.orig/arch/um/kernel/process_kern.c 2005-09-13 16:04:11.000000000 -0400
+++ linux-2.6.13/arch/um/kernel/process_kern.c 2005-09-13 16:08:18.000000000 -0400
@@ -113,8 +113,16 @@
void *_switch_to(void *prev, void *next, void *last)
{
- return(CHOOSE_MODE(switch_to_tt(prev, next),
- switch_to_skas(prev, next)));
+ struct task_struct *from = prev;
+ struct task_struct *to= next;
+
+ to->thread.prev_sched = from;
+ set_current(to);
+
+ CHOOSE_MODE_PROC(switch_to_tt, switch_to_skas, prev, next);
+
+ return(current->thread.prev_sched);
+
}
void interrupt_end(void)
Index: linux-2.6.13/arch/um/kernel/skas/include/mode_kern-skas.h
===================================================================
--- linux-2.6.13.orig/arch/um/kernel/skas/include/mode_kern-skas.h 2005-09-13 16:04:12.000000000 -0400
+++ linux-2.6.13/arch/um/kernel/skas/include/mode_kern-skas.h 2005-09-13 16:08:18.000000000 -0400
@@ -11,7 +11,7 @@
#include "asm/ptrace.h"
extern void flush_thread_skas(void);
-extern void *switch_to_skas(void *prev, void *next);
+extern void switch_to_skas(void *prev, void *next);
extern void start_thread_skas(struct pt_regs *regs, unsigned long eip,
unsigned long esp);
extern int copy_thread_skas(int nr, unsigned long clone_flags,
Index: linux-2.6.13/arch/um/kernel/skas/process_kern.c
===================================================================
--- linux-2.6.13.orig/arch/um/kernel/skas/process_kern.c 2005-09-13 16:05:34.000000000 -0400
+++ linux-2.6.13/arch/um/kernel/skas/process_kern.c 2005-09-13 16:08:18.000000000 -0400
@@ -24,7 +24,7 @@
#include "proc_mm.h"
#include "registers.h"
-void *switch_to_skas(void *prev, void *next)
+void switch_to_skas(void *prev, void *next)
{
struct task_struct *from, *to;
@@ -35,16 +35,11 @@
if(current->pid == 0)
switch_timers(0);
- to->thread.prev_sched = from;
- set_current(to);
-
switch_threads(&from->thread.mode.skas.switch_buf,
to->thread.mode.skas.switch_buf);
if(current->pid == 0)
switch_timers(1);
-
- return(current->thread.prev_sched);
}
extern void schedule_tail(struct task_struct *prev);
Index: linux-2.6.13/arch/um/kernel/tt/include/mode_kern-tt.h
===================================================================
--- linux-2.6.13.orig/arch/um/kernel/tt/include/mode_kern-tt.h 2005-09-13 16:04:12.000000000 -0400
+++ linux-2.6.13/arch/um/kernel/tt/include/mode_kern-tt.h 2005-09-13 16:08:18.000000000 -0400
@@ -11,7 +11,7 @@
#include "asm/ptrace.h"
#include "asm/uaccess.h"
-extern void *switch_to_tt(void *prev, void *next);
+extern void switch_to_tt(void *prev, void *next);
extern void flush_thread_tt(void);
extern void start_thread_tt(struct pt_regs *regs, unsigned long eip,
unsigned long esp);
Index: linux-2.6.13/arch/um/kernel/tt/process_kern.c
===================================================================
--- linux-2.6.13.orig/arch/um/kernel/tt/process_kern.c 2005-09-13 16:04:11.000000000 -0400
+++ linux-2.6.13/arch/um/kernel/tt/process_kern.c 2005-09-13 16:08:38.000000000 -0400
@@ -26,7 +26,7 @@
#include "init.h"
#include "tt.h"
-void *switch_to_tt(void *prev, void *next, void *last)
+int switch_to_tt(void *prev, void *next, void *last)
{
struct task_struct *from, *to, *prev_sched;
unsigned long flags;
@@ -36,8 +36,6 @@
from = prev;
to = next;
- to->thread.prev_sched = from;
-
cpu = from->thread_info->cpu;
if(cpu == 0)
forward_interrupts(to->thread.mode.tt.extern_pid);
@@ -53,7 +51,6 @@
forward_pending_sigio(to->thread.mode.tt.extern_pid);
c = 0;
- set_current(to);
err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c));
if(err != sizeof(c))
@@ -85,8 +82,6 @@
flush_tlb_all();
local_irq_restore(flags);
-
- return(current->thread.prev_sched);
}
void release_thread_tt(struct task_struct *task)
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/10] UML - _switch_to code consolidation
@ 2005-09-14 21:55 ` Jeff Dike
0 siblings, 0 replies; 10+ messages in thread
From: Jeff Dike @ 2005-09-14 21:55 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, user-mode-linux-devel, Allan Graves
This patch moves code that is in both switch_to_tt and
switch_to_skas to the top level _switch_to function, keeping us from
duplicating code. It is required for the stack trace patch to work
properly.
Signed-off-by: Allan Graves <allan.graves@gmail.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Index: linux-2.6.13/arch/um/kernel/process_kern.c
===================================================================
--- linux-2.6.13.orig/arch/um/kernel/process_kern.c 2005-09-13 16:04:11.000000000 -0400
+++ linux-2.6.13/arch/um/kernel/process_kern.c 2005-09-13 16:08:18.000000000 -0400
@@ -113,8 +113,16 @@
void *_switch_to(void *prev, void *next, void *last)
{
- return(CHOOSE_MODE(switch_to_tt(prev, next),
- switch_to_skas(prev, next)));
+ struct task_struct *from = prev;
+ struct task_struct *to= next;
+
+ to->thread.prev_sched = from;
+ set_current(to);
+
+ CHOOSE_MODE_PROC(switch_to_tt, switch_to_skas, prev, next);
+
+ return(current->thread.prev_sched);
+
}
void interrupt_end(void)
Index: linux-2.6.13/arch/um/kernel/skas/include/mode_kern-skas.h
===================================================================
--- linux-2.6.13.orig/arch/um/kernel/skas/include/mode_kern-skas.h 2005-09-13 16:04:12.000000000 -0400
+++ linux-2.6.13/arch/um/kernel/skas/include/mode_kern-skas.h 2005-09-13 16:08:18.000000000 -0400
@@ -11,7 +11,7 @@
#include "asm/ptrace.h"
extern void flush_thread_skas(void);
-extern void *switch_to_skas(void *prev, void *next);
+extern void switch_to_skas(void *prev, void *next);
extern void start_thread_skas(struct pt_regs *regs, unsigned long eip,
unsigned long esp);
extern int copy_thread_skas(int nr, unsigned long clone_flags,
Index: linux-2.6.13/arch/um/kernel/skas/process_kern.c
===================================================================
--- linux-2.6.13.orig/arch/um/kernel/skas/process_kern.c 2005-09-13 16:05:34.000000000 -0400
+++ linux-2.6.13/arch/um/kernel/skas/process_kern.c 2005-09-13 16:08:18.000000000 -0400
@@ -24,7 +24,7 @@
#include "proc_mm.h"
#include "registers.h"
-void *switch_to_skas(void *prev, void *next)
+void switch_to_skas(void *prev, void *next)
{
struct task_struct *from, *to;
@@ -35,16 +35,11 @@
if(current->pid == 0)
switch_timers(0);
- to->thread.prev_sched = from;
- set_current(to);
-
switch_threads(&from->thread.mode.skas.switch_buf,
to->thread.mode.skas.switch_buf);
if(current->pid == 0)
switch_timers(1);
-
- return(current->thread.prev_sched);
}
extern void schedule_tail(struct task_struct *prev);
Index: linux-2.6.13/arch/um/kernel/tt/include/mode_kern-tt.h
===================================================================
--- linux-2.6.13.orig/arch/um/kernel/tt/include/mode_kern-tt.h 2005-09-13 16:04:12.000000000 -0400
+++ linux-2.6.13/arch/um/kernel/tt/include/mode_kern-tt.h 2005-09-13 16:08:18.000000000 -0400
@@ -11,7 +11,7 @@
#include "asm/ptrace.h"
#include "asm/uaccess.h"
-extern void *switch_to_tt(void *prev, void *next);
+extern void switch_to_tt(void *prev, void *next);
extern void flush_thread_tt(void);
extern void start_thread_tt(struct pt_regs *regs, unsigned long eip,
unsigned long esp);
Index: linux-2.6.13/arch/um/kernel/tt/process_kern.c
===================================================================
--- linux-2.6.13.orig/arch/um/kernel/tt/process_kern.c 2005-09-13 16:04:11.000000000 -0400
+++ linux-2.6.13/arch/um/kernel/tt/process_kern.c 2005-09-13 16:08:38.000000000 -0400
@@ -26,7 +26,7 @@
#include "init.h"
#include "tt.h"
-void *switch_to_tt(void *prev, void *next, void *last)
+int switch_to_tt(void *prev, void *next, void *last)
{
struct task_struct *from, *to, *prev_sched;
unsigned long flags;
@@ -36,8 +36,6 @@
from = prev;
to = next;
- to->thread.prev_sched = from;
-
cpu = from->thread_info->cpu;
if(cpu == 0)
forward_interrupts(to->thread.mode.tt.extern_pid);
@@ -53,7 +51,6 @@
forward_pending_sigio(to->thread.mode.tt.extern_pid);
c = 0;
- set_current(to);
err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c));
if(err != sizeof(c))
@@ -85,8 +82,6 @@
flush_tlb_all();
local_irq_restore(flags);
-
- return(current->thread.prev_sched);
}
void release_thread_tt(struct task_struct *task)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [uml-devel] Re: [PATCH 1/10] UML - _switch_to code consolidation
2005-09-14 21:55 ` Jeff Dike
@ 2005-09-15 5:30 ` Andrew Morton
-1 siblings, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2005-09-15 5:30 UTC (permalink / raw)
To: Jeff Dike; +Cc: linux-kernel, user-mode-linux-devel, allan.graves
Which if any of these are -rc material? uml-return-a-real-error-code.patch?
Thanks.
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/10] UML - _switch_to code consolidation
@ 2005-09-15 5:30 ` Andrew Morton
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2005-09-15 5:30 UTC (permalink / raw)
To: Jeff Dike; +Cc: linux-kernel, user-mode-linux-devel, allan.graves
Which if any of these are -rc material? uml-return-a-real-error-code.patch?
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [uml-devel] Re: [PATCH 1/10] UML - _switch_to code consolidation
2005-09-14 21:55 ` Jeff Dike
@ 2005-09-15 9:58 ` Pavel Machek
-1 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2005-09-15 9:58 UTC (permalink / raw)
To: Jeff Dike; +Cc: akpm, linux-kernel, user-mode-linux-devel, Allan Graves
Hi!
> This patch moves code that is in both switch_to_tt and
> switch_to_skas to the top level _switch_to function, keeping us from
> duplicating code. It is required for the stack trace patch to work
> properly.
>
> Signed-off-by: Allan Graves <allan.graves@gmail.com>
> Signed-off-by: Jeff Dike <jdike@addtoit.com>
>
> Index: linux-2.6.13/arch/um/kernel/process_kern.c
> ===================================================================
> --- linux-2.6.13.orig/arch/um/kernel/process_kern.c 2005-09-13 16:04:11.000000000 -0400
> +++ linux-2.6.13/arch/um/kernel/process_kern.c 2005-09-13 16:08:18.000000000 -0400
> @@ -113,8 +113,16 @@
>
> void *_switch_to(void *prev, void *next, void *last)
> {
> - return(CHOOSE_MODE(switch_to_tt(prev, next),
> - switch_to_skas(prev, next)));
> + struct task_struct *from = prev;
> + struct task_struct *to= next;
> +
> + to->thread.prev_sched = from;
> + set_current(to);
> +
> + CHOOSE_MODE_PROC(switch_to_tt, switch_to_skas, prev, next);
> +
> + return(current->thread.prev_sched);
> +
> }
I sense a whitespace damage here.
Pavel
--
if you have sharp zaurus hardware you don't need... you know my address
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/10] UML - _switch_to code consolidation
@ 2005-09-15 9:58 ` Pavel Machek
0 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2005-09-15 9:58 UTC (permalink / raw)
To: Jeff Dike; +Cc: akpm, linux-kernel, user-mode-linux-devel, Allan Graves
Hi!
> This patch moves code that is in both switch_to_tt and
> switch_to_skas to the top level _switch_to function, keeping us from
> duplicating code. It is required for the stack trace patch to work
> properly.
>
> Signed-off-by: Allan Graves <allan.graves@gmail.com>
> Signed-off-by: Jeff Dike <jdike@addtoit.com>
>
> Index: linux-2.6.13/arch/um/kernel/process_kern.c
> ===================================================================
> --- linux-2.6.13.orig/arch/um/kernel/process_kern.c 2005-09-13 16:04:11.000000000 -0400
> +++ linux-2.6.13/arch/um/kernel/process_kern.c 2005-09-13 16:08:18.000000000 -0400
> @@ -113,8 +113,16 @@
>
> void *_switch_to(void *prev, void *next, void *last)
> {
> - return(CHOOSE_MODE(switch_to_tt(prev, next),
> - switch_to_skas(prev, next)));
> + struct task_struct *from = prev;
> + struct task_struct *to= next;
> +
> + to->thread.prev_sched = from;
> + set_current(to);
> +
> + CHOOSE_MODE_PROC(switch_to_tt, switch_to_skas, prev, next);
> +
> + return(current->thread.prev_sched);
> +
> }
I sense a whitespace damage here.
Pavel
--
if you have sharp zaurus hardware you don't need... you know my address
^ permalink raw reply [flat|nested] 10+ messages in thread
* [uml-devel] Re: [PATCH 1/10] UML - _switch_to code consolidation
2005-09-15 5:30 ` Andrew Morton
@ 2005-09-15 19:21 ` Jeff Dike
-1 siblings, 0 replies; 10+ messages in thread
From: Jeff Dike @ 2005-09-15 19:21 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, user-mode-linux-devel, allan.graves
On Wed, Sep 14, 2005 at 10:30:35PM -0700, Andrew Morton wrote:
> Which if any of these are -rc material? uml-return-a-real-error-code.patch?
I consider them all to be 2.6.14 material, which is why I sent them.
With the exception of uml-breakpoint-an-arbitrary-thread.patch, which
adds a bit of functionality, they are all bug fixes and code
movement/cleanup. In order of my preference of reaching mainline:
uml-remove-include-of-asm-elfh.patch
serious bug - this fixes the x86_64 build
uml-preserve-errno-in-error-paths.patch
serious bug - if you hit some of these, UML will hang
uml-return-a-real-error-code.patch
a small bug, almost a cleanup
uml-remove-a-useless-include.patch
uml-remove-an-unused-file.patch
uml-remove-some-build-warnings.patch
code cleanup
uml-move-libc-code-out-of-mem_userc-and-tempfilec.patch
uml-merge-mem_userc-and-memc.patch
code movement
uml-_switch_to-code-consolidation.patch
code cleanup - can be omitted from mainline if
uml-breakpoint-an-arbitrary-thread.patch is
uml-breakpoint-an-arbitrary-thread.patch
functionality
Jeff
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/10] UML - _switch_to code consolidation
@ 2005-09-15 19:21 ` Jeff Dike
0 siblings, 0 replies; 10+ messages in thread
From: Jeff Dike @ 2005-09-15 19:21 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, user-mode-linux-devel, allan.graves
On Wed, Sep 14, 2005 at 10:30:35PM -0700, Andrew Morton wrote:
> Which if any of these are -rc material? uml-return-a-real-error-code.patch?
I consider them all to be 2.6.14 material, which is why I sent them.
With the exception of uml-breakpoint-an-arbitrary-thread.patch, which
adds a bit of functionality, they are all bug fixes and code
movement/cleanup. In order of my preference of reaching mainline:
uml-remove-include-of-asm-elfh.patch
serious bug - this fixes the x86_64 build
uml-preserve-errno-in-error-paths.patch
serious bug - if you hit some of these, UML will hang
uml-return-a-real-error-code.patch
a small bug, almost a cleanup
uml-remove-a-useless-include.patch
uml-remove-an-unused-file.patch
uml-remove-some-build-warnings.patch
code cleanup
uml-move-libc-code-out-of-mem_userc-and-tempfilec.patch
uml-merge-mem_userc-and-memc.patch
code movement
uml-_switch_to-code-consolidation.patch
code cleanup - can be omitted from mainline if
uml-breakpoint-an-arbitrary-thread.patch is
uml-breakpoint-an-arbitrary-thread.patch
functionality
Jeff
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [uml-devel] Re: [PATCH 1/10] UML - _switch_to code consolidation
2005-09-15 9:58 ` Pavel Machek
@ 2005-09-16 18:55 ` Blaisorblade
-1 siblings, 0 replies; 10+ messages in thread
From: Blaisorblade @ 2005-09-16 18:55 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Pavel Machek, Jeff Dike, akpm, linux-kernel
On Thursday 15 September 2005 11:58, Pavel Machek wrote:
> Hi!
>
> I sense a whitespace damage here.
Yes, it seems definitely that getting Jeff to use tabs consistently is a
daunting task, since when he started removing the Emacs annotations from the
files.
Apart for parentheses excess in return and missing spaces with if and such...
Jeff, have you moved that to your emacs settings or not yet?
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [uml-devel] Re: [PATCH 1/10] UML - _switch_to code consolidation
@ 2005-09-16 18:55 ` Blaisorblade
0 siblings, 0 replies; 10+ messages in thread
From: Blaisorblade @ 2005-09-16 18:55 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Pavel Machek, Jeff Dike, akpm, linux-kernel
On Thursday 15 September 2005 11:58, Pavel Machek wrote:
> Hi!
>
> I sense a whitespace damage here.
Yes, it seems definitely that getting Jeff to use tabs consistently is a
daunting task, since when he started removing the Emacs annotations from the
files.
Apart for parentheses excess in return and missing spaces with if and such...
Jeff, have you moved that to your emacs settings or not yet?
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-09-16 19:06 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-14 21:55 [uml-devel] [PATCH 1/10] UML - _switch_to code consolidation Jeff Dike
2005-09-14 21:55 ` Jeff Dike
2005-09-15 5:30 ` [uml-devel] " Andrew Morton
2005-09-15 5:30 ` Andrew Morton
2005-09-15 19:21 ` [uml-devel] " Jeff Dike
2005-09-15 19:21 ` Jeff Dike
2005-09-15 9:58 ` [uml-devel] " Pavel Machek
2005-09-15 9:58 ` Pavel Machek
2005-09-16 18:55 ` [uml-devel] " Blaisorblade
2005-09-16 18:55 ` Blaisorblade
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.