Commit e6f0fdf1 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds

[PATCH] x86 savesegment() cleanup

"savesegment()" is declared in multiple places. Clean up and declare
it just once in <asm/system.h>
parent bb5f2af5
...@@ -330,12 +330,6 @@ extern int (*console_blank_hook)(int); ...@@ -330,12 +330,6 @@ extern int (*console_blank_hook)(int);
*/ */
#define DEFAULT_BOUNCE_INTERVAL (3 * HZ) #define DEFAULT_BOUNCE_INTERVAL (3 * HZ)
/*
* Save a segment register away
*/
#define savesegment(seg, where) \
__asm__ __volatile__("movl %%" #seg ",%0" : "=m" (where))
/* /*
* Maximum number of events stored * Maximum number of events stored
*/ */
......
...@@ -274,12 +274,6 @@ void release_thread(struct task_struct *dead_task) ...@@ -274,12 +274,6 @@ void release_thread(struct task_struct *dead_task)
release_x86_irqs(dead_task); release_x86_irqs(dead_task);
} }
/*
* Save a segment.
*/
#define savesegment(seg,value) \
asm volatile("movl %%" #seg ",%0":"=m" (*(int *)&(value)))
int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
unsigned long unused, unsigned long unused,
struct task_struct * p, struct pt_regs * regs) struct task_struct * p, struct pt_regs * regs)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/user.h> #include <asm/user.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/system.h> /* for savesegment */
#include <linux/utsname.h> #include <linux/utsname.h>
...@@ -58,11 +59,6 @@ typedef struct user_fxsr_struct elf_fpxregset_t; ...@@ -58,11 +59,6 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2) #define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
/* Wow, the "main" arch needs arch dependent functions too.. :) */
#define savesegment(seg,value) \
asm volatile("movl %%" #seg ",%0":"=m" (*(int *)&(value)))
/* regs is struct pt_regs, pr_reg is elf_gregset_t (which is /* regs is struct pt_regs, pr_reg is elf_gregset_t (which is
now struct_user_regs, they are different) */ now struct_user_regs, they are different) */
......
...@@ -94,6 +94,12 @@ static inline unsigned long _get_base(char * addr) ...@@ -94,6 +94,12 @@ static inline unsigned long _get_base(char * addr)
".previous" \ ".previous" \
: :"m" (*(unsigned int *)&(value))) : :"m" (*(unsigned int *)&(value)))
/*
* Save a segment register away
*/
#define savesegment(seg, value) \
asm volatile("movl %%" #seg ",%0":"=m" (*(int *)&(value)))
/* /*
* Clear and set 'TS' bit respectively * Clear and set 'TS' bit respectively
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment