summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-01-14 22:28:30 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:15:24 +0200
commit3574e6d2024f5d8d0a0a78ce7785eda92571a81e (patch)
tree33e86bfe6cddb99f51b99440e63c10ef2c0b4aac
parent69e15247bf8b82792b7c1d041ae5babb63a63862 (diff)
2004-01-15 Alfred M. Szmidt <ams@kemisten.nu>
* linux/dev/include/asm-i386/string.h (memscan): Don't use multi-line string literals for asm(). * linux/dev/include/asm-i386/segment.h (__generic_memcpy_tofs) (__generic_memcpy_fromfs): Likewise. * i386/i386/proc_reg.h (flush_instr_queue): Likewise. * i386/i386/gdt.c (gdt_init): Likewise.
-rw-r--r--i386/i386/gdt.c23
-rw-r--r--i386/i386/proc_reg.h6
-rw-r--r--linux/dev/include/asm-i386/segment.h72
-rw-r--r--linux/dev/include/asm-i386/string.h10
4 files changed, 54 insertions, 57 deletions
diff --git a/i386/i386/gdt.c b/i386/i386/gdt.c
index d855111..6766051 100644
--- a/i386/i386/gdt.c
+++ b/i386/i386/gdt.c
@@ -72,17 +72,16 @@ gdt_init()
We must load ds and es with 0 before loading them with KERNEL_DS
because some processors will "optimize out" the loads
if the previous selector values happen to be the same. */
- asm volatile("
- ljmp %0,$1f
- 1:
- movw %w2,%%ds
- movw %w2,%%es
- movw %w2,%%fs
- movw %w2,%%gs
-
- movw %w1,%%ds
- movw %w1,%%es
- movw %w1,%%ss
- " : : "i" (KERNEL_CS), "r" (KERNEL_DS), "r" (0));
+ asm volatile("ljmp %0,$1f\n"
+ "1:\n"
+ "movw %w2,%%ds\n"
+ "movw %w2,%%es\n"
+ "movw %w2,%%fs\n"
+ "movw %w2,%%gs\n"
+
+ "movw %w1,%%ds\n"
+ "movw %w1,%%es\n"
+ "movw %w1,%%ss\n"
+ : : "i" (KERNEL_CS), "r" (KERNEL_DS), "r" (0));
}
diff --git a/i386/i386/proc_reg.h b/i386/i386/proc_reg.h
index 1aa646b..4a3cb53 100644
--- a/i386/i386/proc_reg.h
+++ b/i386/i386/proc_reg.h
@@ -139,10 +139,8 @@ set_eflags(unsigned eflags)
but it's often used immediately after setting one,
to flush the instruction queue. */
#define flush_instr_queue() \
- asm("
- jmp 0f
- 0:
- ")
+ asm("jmp 0f\n" \
+ "0:\n")
#endif /* __GNUC__ */
#endif /* ASSEMBLER */
diff --git a/linux/dev/include/asm-i386/segment.h b/linux/dev/include/asm-i386/segment.h
index db06caa..d3f6d27 100644
--- a/linux/dev/include/asm-i386/segment.h
+++ b/linux/dev/include/asm-i386/segment.h
@@ -96,24 +96,24 @@ static inline unsigned long __get_user(const void * y, int size)
static inline void __generic_memcpy_tofs(void * to, const void * from, unsigned long n)
{
__asm__ volatile
- (" cld
- push %%es
- push %%fs
- cmpl $3,%0
- pop %%es
- jbe 1f
- movl %%edi,%%ecx
- negl %%ecx
- andl $3,%%ecx
- subl %%ecx,%0
- rep; movsb
- movl %0,%%ecx
- shrl $2,%%ecx
- rep; movsl
- andl $3,%0
- 1: movl %0,%%ecx
- rep; movsb
- pop %%es"
+ ("cld\n"
+ "push %%es\n"
+ "push %%fs\n"
+ "cmpl $3,%0\n"
+ "pop %%es\n"
+ "jbe 1f\n"
+ "movl %%edi,%%ecx\n"
+ "negl %%ecx\n"
+ "andl $3,%%ecx\n"
+ "subl %%ecx,%0\n"
+ "rep; movsb\n"
+ "movl %0,%%ecx\n"
+ "shrl $2,%%ecx\n"
+ "rep; movsl\n"
+ "andl $3,%0\n"
+ "1: movl %0,%%ecx\n"
+ "rep; movsb\n"
+ "pop %%es\n"
:"=abd" (n)
:"0" (n),"D" ((long) to),"S" ((long) from)
:"cx","di","si");
@@ -184,24 +184,24 @@ __asm__("cld\n\t" \
static inline void __generic_memcpy_fromfs(void * to, const void * from, unsigned long n)
{
- __asm__ volatile
- (" cld
- cmpl $3,%0
- jbe 1f
- movl %%edi,%%ecx
- negl %%ecx
- andl $3,%%ecx
- subl %%ecx,%0
- fs; rep; movsb
- movl %0,%%ecx
- shrl $2,%%ecx
- fs; rep; movsl
- andl $3,%0
- 1: movl %0,%%ecx
- fs; rep; movsb"
- :"=abd" (n)
- :"0" (n),"D" ((long) to),"S" ((long) from)
- :"cx","di","si", "memory");
+ __asm__ volatile
+ ("cld\n"
+ "cmpl $3,%0\n"
+ "jbe 1f\n"
+ "movl %%edi,%%ecx\n"
+ "negl %%ecx\n"
+ "andl $3,%%ecx\n"
+ "subl %%ecx,%0\n"
+ "fs; rep; movsb\n"
+ "movl %0,%%ecx\n"
+ "shrl $2,%%ecx\n"
+ "fs; rep; movsl\n"
+ "andl $3,%0\n"
+ "1:movl %0,%%ecx\n"
+ "fs; rep; movsb\n"
+ :"=abd" (n)
+ :"0" (n),"D" ((long) to),"S" ((long) from)
+ :"cx","di","si", "memory");
}
static inline void __constant_memcpy_fromfs(void * to, const void * from, unsigned long n)
diff --git a/linux/dev/include/asm-i386/string.h b/linux/dev/include/asm-i386/string.h
index 8417d4a..bdb7545 100644
--- a/linux/dev/include/asm-i386/string.h
+++ b/linux/dev/include/asm-i386/string.h
@@ -473,11 +473,11 @@ extern inline void * memscan(void * addr, int c, size_t size)
{
if (!size)
return addr;
- __asm__("cld
- repnz; scasb
- jnz 1f
- dec %%edi
-1: "
+ __asm__("cld\n"
+ "repnz; scasb\n"
+ "jnz 1f\n"
+ "dec %%edi\n"
+ "1:\n"
: "=D" (addr), "=c" (size)
: "0" (addr), "1" (size), "a" (c));
return addr;