From wlbr!news Wed Jun 5 21:14:25 PDT 1991 Article: 296 of comp.bugs.2bsd Newsgroups: comp.bugs.2bsd Path: wlbr!news From: sms@wlv.imsd.contel.com (Steven M. Schultz) Subject: spl "ed script" improvement for KDJ-11 Message-ID: <1991Jun6.041250.23277@wlbr.imsd.contel.com> Sender: news@wlbr.imsd.contel.com (news) Nntp-Posting-Host: wlv.imsd.contel.com Organization: Contel Federal Systems Date: Thu, 6 Jun 91 04:12:50 GMT Subject: spl "ed script" improvement for KDJ-11 Index: /sys/conf/config,spl/ 2.11BSD Description: The 'ed' scripts which convert calls to the splN() functions do not take advantage of the fact that the KDJ-11 processor has the 'spl' instruction. Repeat-By: Examine the generated code in a kernel generated for "PDP11=73" kernel. Not that the C statement: "s = spl5()" generates the sequence "mfps r0; mtps $0240" rather than the shorter/faster "mfps r0; spl 5". In the networking the same C statement generates "mov 0177776,r0; movb $0240, 0177776" rather than the shorter/faster sequence "mfps r0; movb $0240, 0177776". Also, the assembler knows about the 'spl', 'mfps' and 'mtps' instructions - there is no need to define them at the beginning of the scripts. Two new scripts are included. :splfix.mfps uses the 'mfps' and 'spl' instructions and is used to edit the kernel files when compiling a kernel with PDP11=73 (or 83,84,94). :splfix.movb+mfps uses the 'mfps' and 'movb' instructions because 'spl' and 'mtps' are not legal in supervisor mode (used bu the networking). The 84, 93 and 94 were added to the same case as the 73 in the 'config' script. The 84 was deleted from the 44/70 case. Fix: Apply the patch "/tmp/dif" (multiple files updated by it) and install the new scripts ":splfix.mfps" and "splfix.movb+mfps". #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. cd /sys/conf # 4. Execute the file with /bin/sh (not csh) to create: # /tmp/dif # spl/:splfix.mfps # spl/:splfix.movb+mfps # spl_3com/:splfix.mfps # spl_3com/:splfix.movb+mfps # This archive created: Wed Jun 5 20:22:39 1991 export PATH; PATH=/bin:/usr/bin:$PATH if test -f '/tmp/dif' then echo shar: "will not over-write existing file '/tmp/dif'" else sed 's/^X//' << \SHAR_EOF > '/tmp/dif' X*** spl/:splfix.mtps.old Mon May 2 08:08:46 1988 X--- spl/:splfix.mtps Wed Jun 5 14:26:45 1991 X*************** X*** 1,7 **** X- 0a X- mfps = 106700^tst X- mtps = 106400^tst X- . X g/jsr pc,__spl0/s//mtps $0/ X g/jsr pc,__spl1/s//mtps $40/ X g/jsr pc,__splsof/s//mtps $40/ X--- 1,3 ---- X*** spl/:splfix.profil.old Mon May 2 08:08:46 1988 X--- spl/:splfix.profil Wed Jun 5 14:28:08 1991 X*************** X*** 1,6 **** X- 0a X- spl = 230 X- . X g/jsr pc,__spl0/s//spl 0/ X g/jsr pc,__spl1/s//spl 1/ X g/jsr pc,__splsof/s//spl 1/ X--- 1,3 ---- X*** spl/:splfix.spl.old Mon May 2 08:08:47 1988 X--- spl/:splfix.spl Wed Jun 5 14:27:43 1991 X*************** X*** 1,6 **** X- 0a X- spl = 230 X- . X g/jsr pc,__spl0/s//spl 0/ X g/jsr pc,__spl1/s//spl 1/ X g/jsr pc,__splsof/s//spl 1/ X--- 1,3 ---- X*** spl_3com/:splfix.mtps.old Mon May 2 08:09:07 1988 X--- spl_3com/:splfix.mtps Wed Jun 5 14:31:40 1991 X*************** X*** 1,7 **** X- 0a X- mfps = 106700^tst X- mtps = 106400^tst X- . X g/jsr pc,__spl0/s//mtps $0/ X g/jsr pc,__spl1/s//mtps $40/ X g/jsr pc,__splsof/s//mtps $40/ X--- 1,3 ---- X*** spl_3com/:splfix.profil.old Mon May 2 08:09:08 1988 X--- spl_3com/:splfix.profil Wed Jun 5 14:31:51 1991 X*************** X*** 1,6 **** X- 0a X- spl = 230 X- . X g/jsr pc,__spl0/s//spl 0/ X g/jsr pc,__spl1/s//spl 1/ X g/jsr pc,__splsof/s//spl 1/ X--- 1,3 ---- X*** spl_3com/:splfix.spl.old Mon May 2 08:09:08 1988 X--- spl_3com/:splfix.spl Wed Jun 5 14:31:58 1991 X*************** X*** 1,6 **** X- 0a X- spl = 230 X- . X g/jsr pc,__spl0/s//spl 0/ X g/jsr pc,__spl1/s//spl 1/ X g/jsr pc,__splsof/s//spl 1/ X--- 1,3 ---- X*** config.old Wed Aug 22 18:29:05 1990 X--- config Wed Jun 5 15:52:56 1991 X*************** X*** 60,65 **** X--- 60,66 ---- X case $PDP11 in X 23|24|34) X KERN_NONSEP=YES X+ NETFIX=:splfix.mtps X SPLFIX=:splfix.mtps;; X GENERIC) X # if [ $NONFP = NO ]; then X*************** X*** 68,87 **** X # fi X # eventually: KERN_NONSEP=YES X KERN_NONSEP=NO X SPLFIX=:splfix.movb;; X 35|40|60) X KERN_NONSEP=YES X SPLFIX=:splfix.movb;; X! 53|73|83) X KERN_NONSEP=NO X! SPLFIX=:splfix.mtps;; X! 44|45|50|55|70|84) X KERN_NONSEP=NO X SPLFIX=:splfix.spl;; X *) X echo "$0: unrecognized PDP11 type $PDP11." X echo 'use GENERIC, 23, 24, 34, 35, 40, 44, 45, 50, 53, 55,' X! echo ' 60, 70, 73, 83, 84.' X exit 1;; X esac X X--- 69,92 ---- X # fi X # eventually: KERN_NONSEP=YES X KERN_NONSEP=NO X+ NETFIX=:splfix.movb X SPLFIX=:splfix.movb;; X 35|40|60) X KERN_NONSEP=YES X+ NETFIX=:splfix.movb X SPLFIX=:splfix.movb;; X! 53|73|83|84|93|94) X KERN_NONSEP=NO X! NETFIX=:splfix.movb+mfps X! SPLFIX=:splfix.mfps;; X! 44|45|50|55|70) X KERN_NONSEP=NO X+ NETFIX=:splfix.movb X SPLFIX=:splfix.spl;; X *) X echo "$0: unrecognized PDP11 type $PDP11." X echo 'use GENERIC, 23, 24, 34, 35, 40, 44, 45, 50, 53, 55,' X! echo ' 60, 70, 73, 83, 84, 93, 94' X exit 1;; X esac X X*************** X*** 100,111 **** X echo "Copying standard files to ../$MACHINE." X if [ $NEC = 0 ]; then X if [ $UCB_NET = YES ]; then X! cp spl/:splfix.movb ../$MACHINE/NETSPLFIX X fi X cp spl/$SPLFIX ../$MACHINE/SPLFIX X else X if [ $UCB_NET = YES ]; then X! cp spl_3com/:splfix.movb ../$MACHINE/NETSPLFIX X fi X cp spl_3com/$SPLFIX ../$MACHINE/SPLFIX X fi X--- 105,116 ---- X echo "Copying standard files to ../$MACHINE." X if [ $NEC = 0 ]; then X if [ $UCB_NET = YES ]; then X! cp spl/$NETFIX ../$MACHINE/NETSPLFIX X fi X cp spl/$SPLFIX ../$MACHINE/SPLFIX X else X if [ $UCB_NET = YES ]; then X! cp spl_3com/$NETFIX ../$MACHINE/NETSPLFIX X fi X cp spl_3com/$SPLFIX ../$MACHINE/SPLFIX X fi SHAR_EOF fi if test -f 'spl/:splfix.mfps' then echo shar: "will not over-write existing file 'spl/:splfix.mfps'" else sed 's/^X//' << \SHAR_EOF > 'spl/:splfix.mfps' Xg/jsr pc,__spl0/s//spl 0/ Xg/jsr pc,__spl1/s//spl 1/ Xg/jsr pc,__splsof/s//spl 1/ Xg/jsr pc,__spl2/s//spl 2/ Xg/jsr pc,__splnet/s//spl 2/ Xg/jsr pc,__spl3/s//spl 3/ Xg/jsr pc,__spl4/s//spl 4/ Xg/jsr pc,__spl5/s//spl 5/ Xg/jsr pc,__splbio/s//spl 5/ Xg/jsr pc,__splimp/s//spl 5/ Xg/jsr pc,__spltty/s//spl 5/ Xg/jsr pc,__spl6/s//spl 6/ Xg/jsr pc,__splclo/s//spl 6/ Xg/jsr pc,__spl7/s//spl 7/ Xg/jsr pc,__splhig/s//spl 7/ Xg/jsr pc,_spl0/s//mfps r0;spl 0/ Xg/jsr pc,_spl1/s//mfps r0;spl 1/ Xg/jsr pc,_splsoft/s//mfps r0;spl 1/ Xg/jsr pc,_spl2/s//mfps r0;spl 2/ Xg/jsr pc,_splnet/s//mfps r0;spl 2/ Xg/jsr pc,_spl3/s//mfps r0;spl 3/ Xg/jsr pc,_spl4/s//mfps r0;spl 4/ Xg/jsr pc,_spl5/s//mfps r0;spl 5/ Xg/jsr pc,_splbio/s//mfps r0;spl 5/ Xg/jsr pc,_splimp/s//mfps r0;spl 5/ Xg/jsr pc,_spltty/s//mfps r0;spl 5/ Xg/jsr pc,_spl6/s//mfps r0;spl 6/ Xg/jsr pc,_splcloc/s//mfps r0;spl 6/ Xg/jsr pc,_spl7/s//mfps r0;spl 7/ Xg/jsr pc,_splhigh/s//mfps r0;spl 7/ Xw Xq SHAR_EOF fi if test -f 'spl/:splfix.movb+mfps' then echo shar: "will not over-write existing file 'spl/:splfix.movb+mfps'" else sed 's/^X//' << \SHAR_EOF > 'spl/:splfix.movb+mfps' Xg/jsr pc,__spl0/s//clrb 177776/ Xg/jsr pc,__spl1/s//movb $40, 177776/ Xg/jsr pc,__splsof/s//movb $40, 177776/ Xg/jsr pc,__spl2/s//movb $100, 177776/ Xg/jsr pc,__splnet/s//movb $100, 177776/ Xg/jsr pc,__spl3/s//movb $140, 177776/ Xg/jsr pc,__spl4/s//movb $200, 177776/ Xg/jsr pc,__spl5/s//movb $240, 177776/ Xg/jsr pc,__splimp/s//movb $240, 177776/ Xg/jsr pc,__splbio/s//movb $240, 177776/ Xg/jsr pc,__spltty/s//movb $240, 177776/ Xg/jsr pc,__spl6/s//movb $300, 177776/ Xg/jsr pc,__splclo/s//movb $300, 177776/ Xg/jsr pc,__spl7/s//movb $340, 177776/ Xg/jsr pc,__splhig/s//movb $340, 177776/ Xg/jsr pc,_spl0/s//mfps r0;clrb 177776/ Xg/jsr pc,_spl1/s//mfps r0;movb $40, 177776/ Xg/jsr pc,_splsoft/s//mfps r0;movb $40, 177776/ Xg/jsr pc,_spl2/s//mfps r0;movb $100, 177776/ Xg/jsr pc,_splnet/s//mfps r0;movb $100, 177776/ Xg/jsr pc,_spl3/s//mfps r0;movb $140, 177776/ Xg/jsr pc,_spl4/s//mfps r0;movb $200, 177776/ Xg/jsr pc,_spl5/s//mfps r0;movb $240, 177776/ Xg/jsr pc,_splbio/s//mfps r0;movb $240, 177776/ Xg/jsr pc,_splimp/s//mfps r0;movb $240, 177776/ Xg/jsr pc,_spltty/s//mfps r0;movb $240, 177776/ Xg/jsr pc,_spl6/s//mfps r0;movb $300, 177776/ Xg/jsr pc,_splcloc/s//mfps r0;movb $300, 177776/ Xg/jsr pc,_spl7/s//mfps r0;movb $340,177776/ Xg/jsr pc,_splhigh/s//mfps r0;movb $340, 177776/ Xw Xq SHAR_EOF fi if test -f 'spl_3com/:splfix.mfps' then echo shar: "will not over-write existing file 'spl_3com/:splfix.mfps'" else sed 's/^X//' << \SHAR_EOF > 'spl_3com/:splfix.mfps' Xg/jsr pc,__spl0/s//spl 0/ Xg/jsr pc,__spl1/s//spl 1/ Xg/jsr pc,__splsof/s//spl 1/ Xg/jsr pc,__spl2/s//spl 2/ Xg/jsr pc,__splnet/s//spl 2/ Xg/jsr pc,__spl3/s//spl 3/ Xg/jsr pc,__spl4/s//spl 4/ Xg/jsr pc,__spl5/s//spl 5/ Xg/jsr pc,__splimp/s//spl 6/ Xg/jsr pc,__splbio/s//spl 5/ Xg/jsr pc,__spltty/s//spl 5/ Xg/jsr pc,__spl6/s//spl 6/ Xg/jsr pc,__splclo/s//spl 6/ Xg/jsr pc,__spl7/s//spl 7/ Xg/jsr pc,__splhig/s//spl 7/ Xg/jsr pc,_spl0/s//mfps r0;spl 0/ Xg/jsr pc,_spl1/s//mfps r0;spl 1/ Xg/jsr pc,_splsoft/s//mfps r0;spl 1/ Xg/jsr pc,_spl2/s//mfps r0;spl 2/ Xg/jsr pc,_splnet/s//mfps r0;spl 2/ Xg/jsr pc,_spl3/s//mfps r0;spl 3/ Xg/jsr pc,_spl4/s//mfps r0;spl 4/ Xg/jsr pc,_spl5/s//mfps r0;spl 5/ Xg/jsr pc,_splbio/s//mfps r0;spl 5/ Xg/jsr pc,_splimp/s//mfps r0;spl 6/ Xg/jsr pc,_spltty/s//mfps r0;spl 5/ Xg/jsr pc,_spl6/s//mfps r0;spl 6/ Xg/jsr pc,_splcloc/s//mfps r0;spl 6/ Xg/jsr pc,_spl7/s//mfps r0;spl 7/ Xg/jsr pc,_splhigh/s//mfps r0;spl 7/ Xw Xq SHAR_EOF fi if test -f 'spl_3com/:splfix.movb+mfps' then echo shar: "will not over-write existing file 'spl_3com/:splfix.movb+mfps'" else sed 's/^X//' << \SHAR_EOF > 'spl_3com/:splfix.movb+mfps' Xg/jsr pc,__spl0/s//clrb 177776/ Xg/jsr pc,__spl1/s//movb $40, 177776/ Xg/jsr pc,__splsof/s//movb $40, 177776/ Xg/jsr pc,__spl2/s//movb $100, 177776/ Xg/jsr pc,__splnet/s//movb $100, 177776/ Xg/jsr pc,__spl3/s//movb $140, 177776/ Xg/jsr pc,__spl4/s//movb $200, 177776/ Xg/jsr pc,__spl5/s//movb $240, 177776/ Xg/jsr pc,__splimp/s//movb $300, 177776/ Xg/jsr pc,__splbio/s//movb $240, 177776/ Xg/jsr pc,__spltty/s//movb $240, 177776/ Xg/jsr pc,__spl6/s//movb $300, 177776/ Xg/jsr pc,__splclo/s//movb $300, 177776/ Xg/jsr pc,__spl7/s//movb $340, 177776/ Xg/jsr pc,__splhig/s//movb $340, 177776/ Xg/jsr pc,_spl0/s//mfps r0;clrb 177776/ Xg/jsr pc,_spl1/s//mfps r0;movb $40, 177776/ Xg/jsr pc,_splsoft/s//mfps r0;movb $40, 177776/ Xg/jsr pc,_spl2/s//mfps r0;movb $100, 177776/ Xg/jsr pc,_splnet/s//mfps r0;movb $100, 177776/ Xg/jsr pc,_spl3/s//mfps r0;movb $140, 177776/ Xg/jsr pc,_spl4/s//mfps r0;movb $200, 177776/ Xg/jsr pc,_spl5/s//mfps r0;movb $240, 177776/ Xg/jsr pc,_splbio/s//mfps r0;movb $240, 177776/ Xg/jsr pc,_splimp/s//mfps r0;movb $300, 177776/ Xg/jsr pc,_spltty/s//mfps r0;movb $240, 177776/ Xg/jsr pc,_spl6/s//mfps r0;movb $300, 177776/ Xg/jsr pc,_splcloc/s//mfps r0;movb $300, 177776/ Xg/jsr pc,_spl7/s//mfps r0;movb $340,177776/ Xg/jsr pc,_splhigh/s//mfps r0;movb $340, 177776/ Xw Xq SHAR_EOF fi exit 0 # End of shell archive