-/* $OpenBSD: bus_space.c,v 1.25 2014/11/16 12:30:56 deraadt Exp $ */
+/* $OpenBSD: bus_space.c,v 1.26 2015/04/25 21:31:24 guenther Exp $ */
/* $NetBSD: bus_space.c,v 1.2 2003/03/14 18:47:53 christos Exp $ */
/*-
int dummy3;
int __x;
u_int32_t port = h + o;
- __asm volatile(" cld ;"
+ __asm volatile(
"1: inb %w1,%%al ;"
" stosb ;"
" incl %1 ;"
int dummy3;
int __x;
u_int32_t port = h + o;
- __asm volatile(" cld ;"
+ __asm volatile(
"1: inw %w1,%%ax ;"
" stosw ;"
" addl $2,%1 ;"
int dummy3;
int __x;
u_int32_t port = h + o;
- __asm volatile("cld ;"
+ __asm volatile(
"1: inl %w1,%%eax ;"
" stosl ;"
" addl $4,%1 ;"
int dummy3;
int __x;
u_int32_t port = h + o;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsb ;"
" outb %%al,%w1 ;"
" incl %1 ;"
int dummy3;
int __x;
u_int32_t port = h + o;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsw ;"
" outw %%ax,%w1 ;"
" addl $2,%1 ;"
int dummy3;
int __x;
u_int32_t port = h + o;
- __asm volatile(" cld ;"
+ __asm volatile(
"1: lodsl ;"
" outl %%eax,%w1 ;"
" addl $4,%1 ;"
int dummy2;
void *dummy3;
int __x;
- __asm volatile(" cld ;"
+ __asm volatile(
"1: movb (%2),%%al ;"
" stosb ;"
" loop 1b" :
int dummy2;
void *dummy3;
int __x;
- __asm volatile(" cld ;"
+ __asm volatile(
"1: movw (%2),%%ax ;"
" stosw ;"
" loop 1b" :
int dummy2;
void *dummy3;
int __x;
- __asm volatile(" cld ;"
+ __asm volatile(
"1: movl (%2),%%eax ;"
" stosl ;"
" loop 1b" :
int dummy2;
void *dummy3;
int __x;
- __asm volatile(" cld ;"
+ __asm volatile(
"1: movq (%2),%%rax ;"
" stosq ;"
" loop 1b" :
int dummy1;
void *dummy2;
int dummy3;
- __asm volatile(" cld ;"
+ __asm volatile(
" repne ;"
" movsb" :
"=S" (dummy1), "=D" (dummy2), "=c" (dummy3) :
int dummy1;
void *dummy2;
int dummy3;
- __asm volatile(" cld ;"
+ __asm volatile(
" repne ;"
" movsw" :
"=S" (dummy1), "=D" (dummy2), "=c" (dummy3) :
int dummy1;
void *dummy2;
int dummy3;
- __asm volatile("cld ;"
+ __asm volatile(
" repne ;"
" movsl" :
"=S" (dummy1), "=D" (dummy2), "=c" (dummy3) :
int dummy1;
void *dummy2;
int dummy3;
- __asm volatile("cld ;"
+ __asm volatile(
" repne ;"
" movsq" :
"=S" (dummy1), "=D" (dummy2), "=c" (dummy3) :
int dummy2;
void *dummy3;
int __x;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsb ;"
" movb %%al,(%2) ;"
" loop 1b" :
int dummy2;
void *dummy3;
int __x;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsw ;"
" movw %%ax,(%2) ;"
" loop 1b" :
int dummy2;
void *dummy3;
int __x;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsl ;"
" movl %%eax,(%2) ;"
" loop 1b" :
int dummy2;
void *dummy3;
int __x;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsq ;"
" movq %%rax,(%2) ;"
" loop 1b" :
int dummy1;
void *dummy2;
int dummy3;
- __asm volatile("cld ;"
+ __asm volatile(
" repne ;"
" movsb" :
"=D" (dummy1), "=S" (dummy2), "=c" (dummy3) :
int dummy1;
void *dummy2;
int dummy3;
- __asm volatile("cld ;"
+ __asm volatile(
" repne ;"
" movsw" :
"=D" (dummy1), "=S" (dummy2), "=c" (dummy3) :
int dummy1;
void *dummy2;
int dummy3;
- __asm volatile("cld ;"
+ __asm volatile(
" repne ;"
" movsl" :
"=D" (dummy1), "=S" (dummy2), "=c" (dummy3) :
int dummy1;
void *dummy2;
int dummy3;
- __asm volatile("cld ;"
+ __asm volatile(
" repne ;"
" movsq" :
"=D" (dummy1), "=S" (dummy2), "=c" (dummy3) :
-/* $OpenBSD: copy.S,v 1.6 2015/01/16 10:17:51 sf Exp $ */
+/* $OpenBSD: copy.S,v 1.7 2015/04/25 21:31:24 guenther Exp $ */
/* $NetBSD: copy.S,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*
subq %rsi,%rax
cmpq %rcx,%rax # overlapping?
jb 1f
- cld # nope, copy forward
- shrq $3,%rcx # copy by 64-bit words
+ shrq $3,%rcx # nope, copy forward by 64-bit words
rep
movsq
leaq _C_LABEL(copy_fault)(%rip),%r11
movq %r11,PCB_ONFAULT(%rdx)
SMAP_STAC
- cld
movq %rax,%rcx
shrq $3,%rcx
rep
ja _C_LABEL(copy_efault)
3: /* bcopy(%rsi, %rdi, %rax); */
- cld
movq %rax,%rcx
shrq $3,%rcx
rep
movq %rax,%r8
1: incq %rdx
- cld
1: decq %rdx
jz 2f
movq %rax,%r8
1: incq %rdx
- cld
1: decq %rdx
jz 2f
movq %rdx,%r8
incq %rdx
- cld
1: decq %rdx
jz 4f
-/* $OpenBSD: pio.h,v 1.4 2014/03/29 18:09:28 guenther Exp $ */
+/* $OpenBSD: pio.h,v 1.5 2015/04/25 21:31:24 guenther Exp $ */
/* $NetBSD: pio.h,v 1.2 2003/02/27 11:22:46 fvdl Exp $ */
/*-
{
void *dummy1;
int dummy2;
- __asm volatile("cld\n\trepne\n\tinsb" :
+ __asm volatile("repne\n\tinsb" :
"=D" (dummy1), "=c" (dummy2) :
"d" (port), "0" (addr), "1" (cnt) :
"memory");
{
void *dummy1;
int dummy2;
- __asm volatile("cld\n\trepne\n\tinsw" :
+ __asm volatile("repne\n\tinsw" :
"=D" (dummy1), "=c" (dummy2) :
"d" (port), "0" (addr), "1" (cnt) :
"memory");
{
void *dummy1;
int dummy2;
- __asm volatile("cld\n\trepne\n\tinsl" :
+ __asm volatile("repne\n\tinsl" :
"=D" (dummy1), "=c" (dummy2) :
"d" (port), "0" (addr), "1" (cnt) :
"memory");
{
void *dummy1;
int dummy2;
- __asm volatile("cld\n\trepne\n\toutsb" :
+ __asm volatile("repne\n\toutsb" :
"=S" (dummy1), "=c" (dummy2) :
"d" (port), "0" (addr), "1" (cnt));
}
{
void *dummy1;
int dummy2;
- __asm volatile("cld\n\trepne\n\toutsw" :
+ __asm volatile("repne\n\toutsw" :
"=S" (dummy1), "=c" (dummy2) :
"d" (port), "0" (addr), "1" (cnt));
}
{
void *dummy1;
int dummy2;
- __asm volatile("cld\n\trepne\n\toutsl" :
+ __asm volatile("repne\n\toutsl" :
"=S" (dummy1), "=c" (dummy2) :
"d" (port), "0" (addr), "1" (cnt));
}
-/* $OpenBSD: bus_space.c,v 1.8 2014/10/17 20:37:57 sthen Exp $ */
+/* $OpenBSD: bus_space.c,v 1.9 2015/04/25 21:31:24 guenther Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
* All rights reserved.
void *_addr = a;
int _port = h + o;
- __asm volatile("cld ;"
+ __asm volatile(
"1: inb %w2,%%al ;"
" stosb ;"
" incl %2 ;"
void *_addr = a;
int _port = h + o;
- __asm volatile("cld ;"
+ __asm volatile(
"1: inw %w2,%%ax ;"
" stosw ;"
" addl $2,%2 ;"
void *_addr = a;
int _port = h + o;
- __asm volatile("cld ;"
+ __asm volatile(
"1: inl %w2,%%eax ;"
" stosl ;"
" addl $4,%2 ;"
const void *_addr = a;
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsb ;"
" outb %%al,%w0 ;"
" incl %0 ;"
const void *_addr = a;
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsw ;"
" outw %%ax,%w0 ;"
" addl $2,%0 ;"
const void *_addr = a;
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsl ;"
" outl %%eax,%w0 ;"
" addl $4,%0 ;"
{
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: outb %b2, %w1 ;"
" loop 1b" :
"+c" (_cnt) : "d" (h + o), "a" (v) :
{
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: outw %w2, %w1 ;"
" loop 1b" :
"+c" (_cnt) : "d" (h + o), "a" (v) :
{
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: outl %2,%w1 ;"
" loop 1b" :
"+c" (_cnt) : "d" (h + o), "a" (v) :
{
void *_addr=a;
int _cnt=cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: movb (%2),%%al ;"
" stosb ;"
" loop 1b" :
{
void *_addr=a;
int _cnt=cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: movw (%2),%%ax ;"
" stosw ;"
" loop 1b" :
{
void *_addr=a;
int _cnt=cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: movl (%2),%%eax ;"
" stosl ;"
" loop 1b" :
const void *_addr=a;
int _cnt=cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsb ;"
" movb %%al,(%2) ;"
" loop 1b" :
const void *_addr = a;
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsw ;"
" movw %%ax,(%2) ;"
" loop 1b" :
const void *_addr=a;
int _cnt=cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: lodsl ;"
" movl %%eax,(%2) ;"
" loop 1b" :
{
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: movb %b2, (%1) ;"
" loop 1b" :
"+c" (_cnt) : "D" (h + o), "a" (v) :
{
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: movw %w2, (%1) ;"
" loop 1b" :
"+c" (_cnt) : "D" (h + o), "a" (v) :
{
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
"1: movl %2,(%1) ;"
" loop 1b" :
"+c" (_cnt) : "D" (h + o), "a" (v) :
int _port = h + o;
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
" repne ;"
" stosb" :
"+D" (_port), "+c" (_cnt) : "a" (v) :
int _port = h + o;
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
" repne ;"
" stosw" :
"+D" (_port), "+c" (_cnt) : "a" (v) :
int _port = h + o;
int _cnt = cnt;
- __asm volatile("cld ;"
+ __asm volatile(
" repne ;"
" stosl" :
"+D" (_port), "+c" (_cnt) : "a" (v) :
-/* $OpenBSD: kvm86call.S,v 1.6 2010/04/05 22:42:43 kettenis Exp $ */
+/* $OpenBSD: kvm86call.S,v 1.7 2015/04/25 21:31:24 guenther Exp $ */
/* $NetBSD: kvm86call.S,v 1.7 2006/04/11 17:14:07 drochner Exp $ */
/*-
movl vm86frame,%edi /* target frame location */
movl SCRARGFRAME,%esi /* source (set on entry) */
movl $FRAMESIZE/4,%ecx /* sizeof(struct trapframe)/4 */
- cld
rep
movsl /* copy frame to new stack */
movl 8(%ebp),%esi /* source */
movl SCRARGFRAME,%edi /* destination */
movl $FRAMESIZE/4,%ecx /* size */
- cld
rep
movsl /* copy frame to original frame */
-/* $OpenBSD: locore.s,v 1.155 2015/04/24 12:52:38 kettenis Exp $ */
+/* $OpenBSD: locore.s,v 1.156 2015/04/25 21:31:24 guenther Exp $ */
/* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */
/*-
subl %edi,%ecx # size of tables
shrl $2,%ecx
xorl %eax, %eax
- cld
rep
stosl
subl %esi,%eax
cmpl %ecx,%eax # overlapping?
jb 1f
- cld # nope, copy forward
- shrl $2,%ecx # copy by 32-bit words
+ shrl $2,%ecx # nope, copy forward by 32-bit words
rep
movsl
movl 24+FPADD(%esp),%ecx
SMAP_STAC
/* bcopy(%esi, %edi, %eax); */
- cld
movl %eax,%ecx
shrl $2,%ecx
rep
ja _C_LABEL(copy_fault)
/* bcopy(%esi, %edi, %eax); */
- cld
movl %eax,%ecx
shrl $2,%ecx
rep
movl %eax,20+FPADD(%esp)
1: incl %edx
- cld
1: decl %edx
jz 2f
movl %eax,20+FPADD(%esp)
1: incl %edx
- cld
1: decl %edx
jz 2f
movl 16+FPADD(%esp),%edi # edi = to
movl 20+FPADD(%esp),%edx # edx = maxlen
incl %edx
- cld
1: decl %edx
jz 4f
movl 8(%esp),%edi
movl 12(%esp),%edx
- cld /* set fill direction forward */
xorl %eax,%eax /* set fill data to 0 */
/*
movl 12(%esp), %edi
movl $1024, %ecx
- cld
ALIGN_TEXT
1:
movl %edi, %cr3
addl $KERNBASE, %edi /* and make it back virtual again */
movl $8, %ecx
- cld
rep
movsl
-/* $OpenBSD: vector.s,v 1.18 2013/11/28 19:30:46 brad Exp $ */
+/* $OpenBSD: vector.s,v 1.19 2015/04/25 21:31:24 guenther Exp $ */
/* $NetBSD: vector.s,v 1.32 1996/01/07 21:29:47 mycroft Exp $ */
/*
* If the interrupt frame is made more flexible, INTR can push %eax first and
* decide the ipending case with less overhead, e.g., by avoiding loading the
* segment registers.
- *
- * XXX
- * Should we do a cld on every system entry to avoid the requirement for
- * scattered cld's?
*/
.globl _C_LABEL(isa_strayintr)
-/* $OpenBSD: pio.h,v 1.11 2014/03/29 18:09:29 guenther Exp $ */
+/* $OpenBSD: pio.h,v 1.12 2015/04/25 21:31:24 guenther Exp $ */
/* $NetBSD: pio.h,v 1.13 1996/03/08 20:15:23 cgd Exp $ */
/*
static __inline void
insb(int port, void *addr, int cnt)
{
- __asm volatile("cld\n\trepne\n\tinsb"
+ __asm volatile("repne\n\tinsb"
: "+D" (addr), "+c" (cnt) : "d" (port) : "memory", "cc");
}
static __inline void
insw(int port, void *addr, int cnt)
{
- __asm volatile("cld\n\trepne\n\tinsw"
+ __asm volatile("repne\n\tinsw"
: "+D" (addr), "+c" (cnt) : "d" (port) : "memory", "cc");
}
static __inline void
insl(int port, void *addr, int cnt)
{
- __asm volatile("cld\n\trepne\n\tinsl"
+ __asm volatile("repne\n\tinsl"
: "+D" (addr), "+c" (cnt) : "d" (port) : "memory", "cc");
}
static __inline void
outsb(int port, const void *addr, int cnt)
{
- __asm volatile("cld\n\trepne\n\toutsb"
+ __asm volatile("repne\n\toutsb"
: "+S" (addr), "+c" (cnt) : "d" (port) : "cc");
}
static __inline void
outsw(int port, const void *addr, int cnt)
{
- __asm volatile("cld\n\trepne\n\toutsw"
+ __asm volatile("repne\n\toutsw"
: "+S" (addr), "+c" (cnt) : "d" (port) : "cc");
}
static __inline void
outsl(int port, const void *addr, int cnt)
{
- __asm volatile("cld\n\trepne\n\toutsl"
+ __asm volatile("repne\n\toutsl"
: "+S" (addr), "+c" (cnt) : "d" (port) : "cc");
}