SCCS-vsn: sys/i386/i386/locore.s 1.3
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)locore.s 1.2 (Berkeley) %G%
+ * @(#)locore.s 1.3 (Berkeley) %G%
+/* IBM "compatible" nop */
+#define NOP jmp 7f ; nop ; 7:
+
/*
* User structure is UPAGES at top of user space.
*/
/*
* User structure is UPAGES at top of user space.
*/
.globl _inb
_inb: movl 4(%esp),%edx
subl %eax,%eax # clr eax
.globl _inb
_inb: movl 4(%esp),%edx
subl %eax,%eax # clr eax
ret
.globl _outb
_outb: movl 4(%esp),%edx
movl 8(%esp),%eax
ret
.globl _outb
_outb: movl 4(%esp),%edx
movl 8(%esp),%eax
- .globl _copyout
- .globl _copyin
+ pushl %esi
+ pushl %edi
+ movl 12(%esp),%esi
+ movl 16(%esp),%edi
+ movl 20(%esp),%ecx
+ # shll $2,%ecx
+ # cld
+ # rep
+ # movsl
+ # movl 20(%esp),%ecx
+ # andl $3,%ecx
+ rep
+ movsb
+ popl %edi
+ popl %esi
+ xorl %eax,%eax
+ ret
+
+ .globl _copyout
+ movl $cpyflt,_nofault # in case we page/protection violate
+ pushl %esi
+ pushl %edi
+ movl 12(%esp),%esi
+ movl 16(%esp),%edi
+ movl 20(%esp),%ecx
+ # shrl $2,%ecx
+ cld
+ # rep
+ # movsl
+ # movl 20(%esp),%ecx
+ # andl $3,%ecx
+ rep
+ movsb
+ popl %edi
+ popl %esi
+ xorl %eax,%eax
+ movl %eax,_nofault
+ ret
+
+ .globl _copyin
+ movl $cpyflt,_nofault # in case we page/protection violate
pushl %esi
pushl %edi
movl 12(%esp),%esi
movl 16(%esp),%edi
movl 20(%esp),%ecx
pushl %esi
pushl %edi
movl 12(%esp),%esi
movl 16(%esp),%edi
movl 20(%esp),%ecx
+ # rep
+ # movsl
+ # movl 20(%esp),%ecx
+ # andl $3,%ecx
rep
movsb
popl %edi
popl %esi
rep
movsb
popl %edi
popl %esi
+ xorl %eax,%eax
+ movl %eax,_nofault
+cpyflt: popl %edi
+ popl %esi
+ xorl %eax,%eax
+ movl %eax,_nofault
+ movl $EFAULT,%eax
+ ret
+
+
# insw(port,addr,cnt)
.globl _insw
_insw:
# insw(port,addr,cnt)
.globl _insw
_insw:
movl 12(%esp),%edi
movl 16(%esp),%ecx
cld
movl 12(%esp),%edi
movl 16(%esp),%ecx
cld
.byte 0x66,0xf2,0x6d # rep insw
.byte 0x66,0xf2,0x6d # rep insw
movl %edi,%eax
popl %edi
ret
movl %edi,%eax
popl %edi
ret
movl 12(%esp),%esi
movl 16(%esp),%ecx
cld
movl 12(%esp),%esi
movl 16(%esp),%ecx
cld
.byte 0x66,0xf2,0x6f # rep outsw
.byte 0x66,0xf2,0x6f # rep outsw
movl %esi,%eax
popl %esi
ret
movl %esi,%eax
popl %esi
ret
movw %ax,xxx
lgdt xxx
jmp 1f
movw %ax,xxx
lgdt xxx
jmp 1f
1: movw $0x10,%ax
movw %ax,%ds
movw %ax,%es
1: movw $0x10,%ax
movw %ax,%ds
movw %ax,%es