All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] apm.c redclares savesegment
@ 2002-12-30 11:59 Christoph Hellwig
  2003-01-02 15:45 ` Stephen Rothwell
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2002-12-30 11:59 UTC (permalink / raw)
  To: sfr, torvalds; +Cc: linux-kernel

.. but it could just use the generic version


--- 1.40/arch/i386/kernel/apm.c	Sun Nov 17 15:18:07 2002
+++ edited/arch/i386/kernel/apm.c	Mon Dec 30 02:10:53 2002
@@ -331,12 +331,6 @@
 #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
  */
 #define APM_MAX_EVENTS		20

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

* Re: [PATCH] apm.c redclares savesegment
  2002-12-30 11:59 [PATCH] apm.c redclares savesegment Christoph Hellwig
@ 2003-01-02 15:45 ` Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2003-01-02 15:45 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: torvalds, linux-kernel

Hi Chris, Linus,

On Mon, 30 Dec 2002 12:59:07 +0100 Christoph Hellwig <hch@lst.de> wrote:
>
> .. but it could just use the generic version

But asm/elf.h seems a strange place for it to be.  And there was
another one.


How about this?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.54/arch/i386/kernel/apm.c 2.5.54-saveseg/arch/i386/kernel/apm.c
--- 2.5.54/arch/i386/kernel/apm.c	2002-11-18 15:47:40.000000000 +1100
+++ 2.5.54-saveseg/arch/i386/kernel/apm.c	2003-01-03 02:20:57.000000000 +1100
@@ -331,12 +331,6 @@
 #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
  */
 #define APM_MAX_EVENTS		20
diff -ruN 2.5.54/arch/i386/kernel/process.c 2.5.54-saveseg/arch/i386/kernel/process.c
--- 2.5.54/arch/i386/kernel/process.c	2003-01-02 15:13:45.000000000 +1100
+++ 2.5.54-saveseg/arch/i386/kernel/process.c	2003-01-03 02:21:40.000000000 +1100
@@ -274,12 +274,6 @@
 	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,
 	unsigned long unused,
 	struct task_struct * p, struct pt_regs * regs)
diff -ruN 2.5.54/include/asm-i386/elf.h 2.5.54-saveseg/include/asm-i386/elf.h
--- 2.5.54/include/asm-i386/elf.h	2002-12-27 15:15:57.000000000 +1100
+++ 2.5.54-saveseg/include/asm-i386/elf.h	2003-01-03 02:22:48.000000000 +1100
@@ -8,6 +8,7 @@
 #include <asm/ptrace.h>
 #include <asm/user.h>
 #include <asm/processor.h>
+#include <asm/system.h>		/* for savesegment */
 
 #include <linux/utsname.h>
 
@@ -58,11 +59,6 @@
 
 #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
    now struct_user_regs, they are different) */
 
diff -ruN 2.5.54/include/asm-i386/system.h 2.5.54-saveseg/include/asm-i386/system.h
--- 2.5.54/include/asm-i386/system.h	2003-01-02 15:13:49.000000000 +1100
+++ 2.5.54-saveseg/include/asm-i386/system.h	2003-01-03 02:25:14.000000000 +1100
@@ -95,6 +95,12 @@
 		: :"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
  */
 #define clts() __asm__ __volatile__ ("clts")

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

end of thread, other threads:[~2003-01-02 15:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-30 11:59 [PATCH] apm.c redclares savesegment Christoph Hellwig
2003-01-02 15:45 ` Stephen Rothwell

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.