NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-vax/41139: pipe(2) seems broken on VAX
The following reply was made to PR port-vax/41139; it has been noted by GNATS.
From: Anders Magnusson <ragge%ludd.ltu.se@localhost>
To: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, mhitch%lightning.msu.montana.edu@localhost,
gnats-admin%NetBSD.org@localhost, netbsd-bugs%NetBSD.org@localhost
Subject: Re: port-vax/41139: pipe(2) seems broken on VAX
Date: Fri, 10 Apr 2009 09:00:23 +0200
Izumi Tsutsui wrote:
> mhitch%lightning.msu.montana.edu@localhost wrote:
>
>> On Wed, 8 Apr 2009, Anders Magnusson wrote:
>>
>> > It may be worth trying, but it also may require significantly more code.
>> > The movc3 instruction handles overlapping copies, but if the data block
>> is
>> > larger than 64k then it must be done manually. This is only a problem
>> for kcopy,
>> > copy{in,out} should not overlap :-)
>>
>> It's not all that much code, at least for copy{in,out}:
>>
>> ENTRY(copyout, 0)
>> movl 8(%ap),%r3
>> blss 3f # kernel space
>> movl 4(%ap),%r1
>> brb 2f
>>
>> ENTRY(copyin, 0)
>> movl 4(%ap),%r1
>> blss 3f # kernel space
>> 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
>
> This fixes the pipe problem on 5.0.
> Should we commit it and pull up to 5.0?
>
Please do.
For an overlaying kcopy, it might be an idea to look at the memcpy code in
libkern.
-- Ragge
Home |
Main Index |
Thread Index |
Old Index