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: "Michael L. Hitch" <mhitch%lightning.msu.montana.edu@localhost>
To: Anders Magnusson <ragge%ludd.ltu.se@localhost>
Cc: Christos Zoulas <christos%zoulas.com@localhost>, 
gnats-bugs%NetBSD.org@localhost
Subject: Re: port-vax/41139: pipe(2) seems broken on VAX
Date: Wed, 8 Apr 2009 12:57:29 -0600 (MDT)

 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
 
    I did a 64K-4 byte copy so that aligned copies stay aligned, and also 
 changed one register so that the destination address didn't need to be 
 adjusted between the movc3 instructions.
 
    I've got the same think in kcopy, but haven't added anything to deal 
 with overlapping copies yet.  At the moment, if there are any overlapping 
 copies >= 64K, it's broken anyway since most of the copy is't going to 
 happen anyway with the old kcopy.
 
 > The cvs problem is most likely something else, it existed before the fast 
 > pipe code.
 
    Well, I just did a cvs update to anoncvs using ssh and had no problems 
 doing it - which I don't think I had ever seen before.
 
 --
 Michael L. Hitch                       mhitch%montana.edu@localhost
 Computer Consultant
 Information Technology Center
 Montana State University       Bozeman, MT     USA
 


Home | Main Index | Thread Index | Old Index