Apply patch from mhitch@:

Make copyin(9) and copyout(9) work with 64KB or larger data blocks.
Fixes broken pipe(2) problem mentioned in PR port-vax/41139. Ok'ed by ragge@.

Should be pulled up to netbsd-5.
This commit is contained in:
tsutsui 2009-04-10 13:40:38 +00:00
parent 7d3ba7cfe8
commit 0126759cb5
1 changed files with 13 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr.S,v 1.25 2008/08/29 18:25:02 matt Exp $ */
/* $NetBSD: subr.S,v 1.26 2009/04/10 13:40:38 tsutsui Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -440,7 +440,7 @@ JSBENTRY(Swtchto)
#
ENTRY(copyout, 0)
movl 8(%ap),%r2
movl 8(%ap),%r3
blss 3f # kernel space
movl 4(%ap),%r1
brb 2f
@ -448,13 +448,18 @@ ENTRY(copyout, 0)
ENTRY(copyin, 0)
movl 4(%ap),%r1
blss 3f # kernel space
movl 8(%ap),%r2
2: mfpr $PR_ESP,%r3
movab 1f,(%r3)
movc3 12(%ap),(%r1),(%r2)
1: mfpr $PR_ESP,%r3
clrl (%r3)
movl 8(%ap),%r3
2: mfpr $PR_ESP,%r2
movab 1f,(%r2)
4: tstw 14(%ap) # check if >= 64K
bneq 5f
movc3 12(%ap),(%r1),(%r3)
1: mfpr $PR_ESP,%r2
clrl (%r2)
ret
5: movc3 $0xfffc,(%r1),(%r3)
subl2 $0xfffc,12(%ap)
brb 4b
3: mnegl $1,%r0
ret