diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-02-20 23:18:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:40:49 -0400 |
commit | 513ad84bf60d96a6998bca10ed07c3d340449be8 (patch) | |
tree | 2a1600178aea7e130c5881ac861cb5aa69450937 /include/asm-x86/processor.h | |
parent | 1180e01de50c0c7683c6648251f32957bc2d7850 (diff) |
x86: de-macro start_thread()
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/processor.h')
-rw-r--r-- | include/asm-x86/processor.h | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index 43d2cc829a94..9054734589fe 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h | |||
@@ -817,20 +817,6 @@ static inline void spin_lock_prefetch(const void *x) | |||
817 | .io_bitmap = { [0 ... IO_BITMAP_LONGS] = ~0 }, \ | 817 | .io_bitmap = { [0 ... IO_BITMAP_LONGS] = ~0 }, \ |
818 | } | 818 | } |
819 | 819 | ||
820 | #define start_thread(regs, new_eip, new_esp) \ | ||
821 | do { \ | ||
822 | __asm__("movl %0,%%gs": :"r" (0)); \ | ||
823 | regs->fs = 0; \ | ||
824 | set_fs(USER_DS); \ | ||
825 | regs->ds = __USER_DS; \ | ||
826 | regs->es = __USER_DS; \ | ||
827 | regs->ss = __USER_DS; \ | ||
828 | regs->cs = __USER_CS; \ | ||
829 | regs->ip = new_eip; \ | ||
830 | regs->sp = new_esp; \ | ||
831 | } while (0) | ||
832 | |||
833 | |||
834 | extern unsigned long thread_saved_pc(struct task_struct *tsk); | 820 | extern unsigned long thread_saved_pc(struct task_struct *tsk); |
835 | 821 | ||
836 | #define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long)) | 822 | #define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long)) |
@@ -887,18 +873,6 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); | |||
887 | .x86_tss.sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ | 873 | .x86_tss.sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ |
888 | } | 874 | } |
889 | 875 | ||
890 | #define start_thread(regs, new_rip, new_rsp) do { \ | ||
891 | asm volatile("movl %0,%%fs; movl %0,%%es; movl %0,%%ds": :"r" (0)); \ | ||
892 | load_gs_index(0); \ | ||
893 | (regs)->ip = (new_rip); \ | ||
894 | (regs)->sp = (new_rsp); \ | ||
895 | write_pda(oldrsp, (new_rsp)); \ | ||
896 | (regs)->cs = __USER_CS; \ | ||
897 | (regs)->ss = __USER_DS; \ | ||
898 | (regs)->flags = 0x200; \ | ||
899 | set_fs(USER_DS); \ | ||
900 | } while (0) | ||
901 | |||
902 | /* | 876 | /* |
903 | * Return saved PC of a blocked thread. | 877 | * Return saved PC of a blocked thread. |
904 | * What is this good for? it will be always the scheduler or ret_from_fork. | 878 | * What is this good for? it will be always the scheduler or ret_from_fork. |
@@ -909,6 +883,9 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); | |||
909 | #define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */ | 883 | #define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */ |
910 | #endif /* CONFIG_X86_64 */ | 884 | #endif /* CONFIG_X86_64 */ |
911 | 885 | ||
886 | extern void start_thread(struct pt_regs *regs, unsigned long new_ip, | ||
887 | unsigned long new_sp); | ||
888 | |||
912 | /* | 889 | /* |
913 | * This decides where the kernel will search for a free chunk of vm | 890 | * This decides where the kernel will search for a free chunk of vm |
914 | * space during mmap's. | 891 | * space during mmap's. |