aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJohn Dyson <dyson@FreeBSD.org>1997-01-22 06:15:27 +0000
committerJohn Dyson <dyson@FreeBSD.org>1997-01-22 06:15:27 +0000
commit8130eff80a64c166c2becafd2352185a99ba0c5f (patch)
tree451a113863b8f6e876958ca419a7c02e00759d39 /sys
parent07e23a12b84627ee3f761746446212841e757805 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/support.S52
-rw-r--r--sys/amd64/amd64/support.s52
-rw-r--r--sys/i386/i386/support.s52
3 files changed, 114 insertions, 42 deletions
diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S
index 60d38944f25d..959a992d0a09 100644
--- a/sys/amd64/amd64/support.S
+++ b/sys/amd64/amd64/support.S
@@ -674,13 +674,18 @@ ENTRY(generic_copyout)
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
-1: /* check PTE for each page */
- movb _PTmap(%edx),%al
- andb $0x07,%al /* Pages must be VALID + USERACC + WRITABLE */
- cmpb $0x07,%al
- je 2f
-
- /* simulate a trap */
+ 1: /* check PTE for each page */
+ leal _PTmap(%edx),%eax
+ shrl $IDXSHIFT,%eax
+ andb $0xfc,%al
+ testb $0x01,_PTmap(%eax) /* PTE Page must be VALID */
+ je 4f
+ movb _PTmap(%edx),%al
+ andb $0x07,%al /* Pages must be VALID + USERACC + WRITABLE */
+ cmpb $0x07,%al
+ je 2f
+
+4: /* simulate a trap */
pushl %edx
pushl %ecx
shll $IDXSHIFT,%edx
@@ -1146,16 +1151,21 @@ ENTRY(suword)
movl %edx,%eax
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
+
+ leal _PTmap(%edx),%ecx
+ shrl $IDXSHIFT,%ecx
+ andb $0xfc,%cl
+ testb $0x01,_PTmap(%ecx) /* PTE Page must be VALID */
+ je 4f
movb _PTmap(%edx),%dl
- andb $0x7,%dl /* must be VALID + USERACC + WRITE */
+ andb $0x7,%dl /* must be VALID + USERACC + WRITE */
cmpb $0x7,%dl
je 1f
/* simulate a trap */
- pushl %eax
+4: pushl %eax
call _trapwrite
popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
testl %eax,%eax
jnz fusufault
1:
@@ -1169,6 +1179,7 @@ ENTRY(suword)
movl 8(%esp),%eax
movl %eax,(%edx)
xorl %eax,%eax
+ movl _curpcb,%ecx
movl %eax,PCB_ONFAULT(%ecx)
ret
@@ -1188,16 +1199,21 @@ ENTRY(susword)
movl %edx,%eax
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
+
+ leal _PTmap(%edx),%ecx
+ shrl $IDXSHIFT,%ecx
+ andb $0xfc,%cl
+ testb $0x01,_PTmap(%ecx) /* PTE Page must be VALID */
+ je 4f
movb _PTmap(%edx),%dl
andb $0x7,%dl /* must be VALID + USERACC + WRITE */
cmpb $0x7,%dl
je 1f
- /* simulate a trap */
+4: /* simulate a trap */
pushl %eax
call _trapwrite
popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
testl %eax,%eax
jnz fusufault
1:
@@ -1211,6 +1227,7 @@ ENTRY(susword)
movw 8(%esp),%ax
movw %ax,(%edx)
xorl %eax,%eax
+ movl _curpcb,%ecx /* restore trashed register */
movl %eax,PCB_ONFAULT(%ecx)
ret
@@ -1230,16 +1247,22 @@ ENTRY(subyte)
movl %edx,%eax
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
+
+ leal _PTmap(%edx),%ecx
+ shrl $IDXSHIFT,%ecx
+ andb $0xfc,%cl
+ testb $0x01,_PTmap(%ecx) /* PTE Page must be VALID */
+ je 4f
+
movb _PTmap(%edx),%dl
andb $0x7,%dl /* must be VALID + USERACC + WRITE */
cmpb $0x7,%dl
je 1f
- /* simulate a trap */
+4: /* simulate a trap */
pushl %eax
call _trapwrite
popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
testl %eax,%eax
jnz fusufault
1:
@@ -1253,6 +1276,7 @@ ENTRY(subyte)
movb 8(%esp),%al
movb %al,(%edx)
xorl %eax,%eax
+ movl _curpcb,%ecx /* restore trashed register */
movl %eax,PCB_ONFAULT(%ecx)
ret
diff --git a/sys/amd64/amd64/support.s b/sys/amd64/amd64/support.s
index 60d38944f25d..959a992d0a09 100644
--- a/sys/amd64/amd64/support.s
+++ b/sys/amd64/amd64/support.s
@@ -674,13 +674,18 @@ ENTRY(generic_copyout)
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
-1: /* check PTE for each page */
- movb _PTmap(%edx),%al
- andb $0x07,%al /* Pages must be VALID + USERACC + WRITABLE */
- cmpb $0x07,%al
- je 2f
-
- /* simulate a trap */
+ 1: /* check PTE for each page */
+ leal _PTmap(%edx),%eax
+ shrl $IDXSHIFT,%eax
+ andb $0xfc,%al
+ testb $0x01,_PTmap(%eax) /* PTE Page must be VALID */
+ je 4f
+ movb _PTmap(%edx),%al
+ andb $0x07,%al /* Pages must be VALID + USERACC + WRITABLE */
+ cmpb $0x07,%al
+ je 2f
+
+4: /* simulate a trap */
pushl %edx
pushl %ecx
shll $IDXSHIFT,%edx
@@ -1146,16 +1151,21 @@ ENTRY(suword)
movl %edx,%eax
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
+
+ leal _PTmap(%edx),%ecx
+ shrl $IDXSHIFT,%ecx
+ andb $0xfc,%cl
+ testb $0x01,_PTmap(%ecx) /* PTE Page must be VALID */
+ je 4f
movb _PTmap(%edx),%dl
- andb $0x7,%dl /* must be VALID + USERACC + WRITE */
+ andb $0x7,%dl /* must be VALID + USERACC + WRITE */
cmpb $0x7,%dl
je 1f
/* simulate a trap */
- pushl %eax
+4: pushl %eax
call _trapwrite
popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
testl %eax,%eax
jnz fusufault
1:
@@ -1169,6 +1179,7 @@ ENTRY(suword)
movl 8(%esp),%eax
movl %eax,(%edx)
xorl %eax,%eax
+ movl _curpcb,%ecx
movl %eax,PCB_ONFAULT(%ecx)
ret
@@ -1188,16 +1199,21 @@ ENTRY(susword)
movl %edx,%eax
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
+
+ leal _PTmap(%edx),%ecx
+ shrl $IDXSHIFT,%ecx
+ andb $0xfc,%cl
+ testb $0x01,_PTmap(%ecx) /* PTE Page must be VALID */
+ je 4f
movb _PTmap(%edx),%dl
andb $0x7,%dl /* must be VALID + USERACC + WRITE */
cmpb $0x7,%dl
je 1f
- /* simulate a trap */
+4: /* simulate a trap */
pushl %eax
call _trapwrite
popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
testl %eax,%eax
jnz fusufault
1:
@@ -1211,6 +1227,7 @@ ENTRY(susword)
movw 8(%esp),%ax
movw %ax,(%edx)
xorl %eax,%eax
+ movl _curpcb,%ecx /* restore trashed register */
movl %eax,PCB_ONFAULT(%ecx)
ret
@@ -1230,16 +1247,22 @@ ENTRY(subyte)
movl %edx,%eax
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
+
+ leal _PTmap(%edx),%ecx
+ shrl $IDXSHIFT,%ecx
+ andb $0xfc,%cl
+ testb $0x01,_PTmap(%ecx) /* PTE Page must be VALID */
+ je 4f
+
movb _PTmap(%edx),%dl
andb $0x7,%dl /* must be VALID + USERACC + WRITE */
cmpb $0x7,%dl
je 1f
- /* simulate a trap */
+4: /* simulate a trap */
pushl %eax
call _trapwrite
popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
testl %eax,%eax
jnz fusufault
1:
@@ -1253,6 +1276,7 @@ ENTRY(subyte)
movb 8(%esp),%al
movb %al,(%edx)
xorl %eax,%eax
+ movl _curpcb,%ecx /* restore trashed register */
movl %eax,PCB_ONFAULT(%ecx)
ret
diff --git a/sys/i386/i386/support.s b/sys/i386/i386/support.s
index 60d38944f25d..959a992d0a09 100644
--- a/sys/i386/i386/support.s
+++ b/sys/i386/i386/support.s
@@ -674,13 +674,18 @@ ENTRY(generic_copyout)
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
-1: /* check PTE for each page */
- movb _PTmap(%edx),%al
- andb $0x07,%al /* Pages must be VALID + USERACC + WRITABLE */
- cmpb $0x07,%al
- je 2f
-
- /* simulate a trap */
+ 1: /* check PTE for each page */
+ leal _PTmap(%edx),%eax
+ shrl $IDXSHIFT,%eax
+ andb $0xfc,%al
+ testb $0x01,_PTmap(%eax) /* PTE Page must be VALID */
+ je 4f
+ movb _PTmap(%edx),%al
+ andb $0x07,%al /* Pages must be VALID + USERACC + WRITABLE */
+ cmpb $0x07,%al
+ je 2f
+
+4: /* simulate a trap */
pushl %edx
pushl %ecx
shll $IDXSHIFT,%edx
@@ -1146,16 +1151,21 @@ ENTRY(suword)
movl %edx,%eax
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
+
+ leal _PTmap(%edx),%ecx
+ shrl $IDXSHIFT,%ecx
+ andb $0xfc,%cl
+ testb $0x01,_PTmap(%ecx) /* PTE Page must be VALID */
+ je 4f
movb _PTmap(%edx),%dl
- andb $0x7,%dl /* must be VALID + USERACC + WRITE */
+ andb $0x7,%dl /* must be VALID + USERACC + WRITE */
cmpb $0x7,%dl
je 1f
/* simulate a trap */
- pushl %eax
+4: pushl %eax
call _trapwrite
popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
testl %eax,%eax
jnz fusufault
1:
@@ -1169,6 +1179,7 @@ ENTRY(suword)
movl 8(%esp),%eax
movl %eax,(%edx)
xorl %eax,%eax
+ movl _curpcb,%ecx
movl %eax,PCB_ONFAULT(%ecx)
ret
@@ -1188,16 +1199,21 @@ ENTRY(susword)
movl %edx,%eax
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
+
+ leal _PTmap(%edx),%ecx
+ shrl $IDXSHIFT,%ecx
+ andb $0xfc,%cl
+ testb $0x01,_PTmap(%ecx) /* PTE Page must be VALID */
+ je 4f
movb _PTmap(%edx),%dl
andb $0x7,%dl /* must be VALID + USERACC + WRITE */
cmpb $0x7,%dl
je 1f
- /* simulate a trap */
+4: /* simulate a trap */
pushl %eax
call _trapwrite
popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
testl %eax,%eax
jnz fusufault
1:
@@ -1211,6 +1227,7 @@ ENTRY(susword)
movw 8(%esp),%ax
movw %ax,(%edx)
xorl %eax,%eax
+ movl _curpcb,%ecx /* restore trashed register */
movl %eax,PCB_ONFAULT(%ecx)
ret
@@ -1230,16 +1247,22 @@ ENTRY(subyte)
movl %edx,%eax
shrl $IDXSHIFT,%edx
andb $0xfc,%dl
+
+ leal _PTmap(%edx),%ecx
+ shrl $IDXSHIFT,%ecx
+ andb $0xfc,%cl
+ testb $0x01,_PTmap(%ecx) /* PTE Page must be VALID */
+ je 4f
+
movb _PTmap(%edx),%dl
andb $0x7,%dl /* must be VALID + USERACC + WRITE */
cmpb $0x7,%dl
je 1f
- /* simulate a trap */
+4: /* simulate a trap */
pushl %eax
call _trapwrite
popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
testl %eax,%eax
jnz fusufault
1:
@@ -1253,6 +1276,7 @@ ENTRY(subyte)
movb 8(%esp),%al
movb %al,(%edx)
xorl %eax,%eax
+ movl _curpcb,%ecx /* restore trashed register */
movl %eax,PCB_ONFAULT(%ecx)
ret