lkml.org 
[lkml]   [2003]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: asm (lidt) question
On Tue, 22 Jul 2003 10:31:37 -0700 (PDT) Davide Libenzi <davidel@xmailserver.org> wrote:

| On Tue, 22 Jul 2003, Jamie Lokier wrote:
|
| > Davide Libenzi wrote:
| > > IMHO, since "var" is really an output parameter.
| >
| > "var" is read, not written.
| > I think you are confusing "lidt" with "sidt".
|
| Actually I don't even know what I was confusing, since L and S are not
| there for nothing ;) And yes, the form with =m as input parameter should
| be corrected, even if it generates the same code.

Yes, less confusion is better, so here's a patch to use the
same reasonable syntax in all places.

Look OK? Generates the same code, as Davide pointed out.

--
~Randy


patch_name: lidt_norm.patch
patch_version: 2003-07-22.11:47:21
author: Randy.Dunlap <rddunlap@osdl.org>
description: normalize lidt/lgdt syntax usage
product: Linux
product_versions: 2.6.0-test1
diffstat: =
arch/i386/kernel/cpu/common.c | 4 ++--
arch/i386/kernel/traps.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)


diff -Naur ./arch/i386/kernel/cpu/common.c~lidt ./arch/i386/kernel/cpu/common.c
--- ./arch/i386/kernel/cpu/common.c~lidt 2003-07-13 20:29:29.000000000 -0700
+++ ./arch/i386/kernel/cpu/common.c 2003-07-22 11:41:05.000000000 -0700
@@ -480,8 +480,8 @@
*/
memcpy(thread->tls_array, cpu_gdt_table[cpu], GDT_ENTRY_TLS_ENTRIES * 8);

- __asm__ __volatile__("lgdt %0": "=m" (cpu_gdt_descr[cpu]));
- __asm__ __volatile__("lidt %0": "=m" (idt_descr));
+ __asm__ __volatile__("lgdt %0": :"m" (cpu_gdt_descr[cpu]));
+ __asm__ __volatile__("lidt %0": :"m" (idt_descr));

/*
* Delete NT
diff -Naur ./arch/i386/kernel/traps.c~lidt ./arch/i386/kernel/traps.c
--- ./arch/i386/kernel/traps.c~lidt 2003-07-13 20:31:20.000000000 -0700
+++ ./arch/i386/kernel/traps.c 2003-07-22 11:39:31.000000000 -0700
@@ -780,7 +780,7 @@
* it uses the read-only mapped virtual address.
*/
idt_descr.address = fix_to_virt(FIX_F00F_IDT);
- __asm__ __volatile__("lidt %0": "=m" (idt_descr));
+ __asm__ __volatile__("lidt %0": :"m" (idt_descr));
}
#endif

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.073 / U:2.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site