Browse Source

sprinklings of 'ifstep()'

'the big disk case' no longer sets vars and calls dodisk, would take more space
to additionally do the 'stepping' argument (see cd\* in generated MAKEDEV)
OPENBSD_3_1
todd 23 years ago
parent
commit
473abb40a2
2 changed files with 20 additions and 18 deletions
  1. +10
    -12
      src/etc/MAKEDEV.mi
  2. +10
    -6
      src/etc/MAKEDEV.sub

+ 10
- 12
src/etc/MAKEDEV.mi View File

@ -1,6 +1,6 @@
include(MAKEDEV.sub)dnl include(MAKEDEV.sub)dnl
dnl dnl
vers(a,{-$OpenBSD: MAKEDEV.mi,v 1.5 2002/01/07 06:25:32 todd Exp $-})dnl
vers(a,{-$OpenBSD: MAKEDEV.mi,v 1.6 2002/01/07 06:54:10 todd Exp $-})dnl
dnl dnl
divert(1)dnl divert(1)dnl
{-#-} {-#-}
@ -234,10 +234,10 @@ __devitem(ofdisk,ofdisk*,OpenFirmware disks)dnl
__devitem(hd,{-hd*-},HP300 HP-IB disks)dnl __devitem(hd,{-hd*-},HP300 HP-IB disks)dnl
__devitem(cd,{-cd*-},SCSI cdrom drives)dnl __devitem(cd,{-cd*-},SCSI cdrom drives)dnl
__devitem(acd,acd*,ATAPI cdrom drives)dnl __devitem(acd,acd*,ATAPI cdrom drives)dnl
_mkdev(cd,cd*,{-dodisk2 cd $U major_cd_b major_cd_c $U 0{--}dnl
-})dnl
_mkdev(cd,cd*,{-dodisk2 cd $U major_cd_b major_cd_c $U 0{--}ifstep(cd)-})dnl
__devitem(mcd,mcd*,Mitsumi cdrom drives)dnl __devitem(mcd,mcd*,Mitsumi cdrom drives)dnl
_mkdev(mcd,mcd*,{-dodisk2 mcd $U major_mcd_b major_mcd_c $U 0-})dnl
_mkdev(mcd,mcd*,{-dodisk2 mcd $U major_mcd_b major_mcd_c $U 0{--}ifstep(mcd)dnl
-})dnl
__devitem(ch,{-ch*-},SCSI media changer)dnl __devitem(ch,{-ch*-},SCSI media changer)dnl
_mcdev(ch,ch*,ch,{-major_ch_c-},660,operator)dnl _mcdev(ch,ch*,ch,{-major_ch_c-},660,operator)dnl
__devitem(uk,uk*,SCSI Unknown device)dnl __devitem(uk,uk*,SCSI Unknown device)dnl
@ -250,7 +250,7 @@ __devitem(ses,ses*,SES/SAF-TE SCSI devices)dnl
_mkdev(ses,ses*,{-M ses$U c major_ses_c $U 640 operator-})dnl _mkdev(ses,ses*,{-M ses$U c major_ses_c $U 640 operator-})dnl
__devitem(ramd,ramdisk,makes all devices for a ramdisk kernel)dnl arc __devitem(ramd,ramdisk,makes all devices for a ramdisk kernel)dnl arc
__devitem(rd,{-rd*-},"ramdisk" pseudo-disks)dnl __devitem(rd,{-rd*-},"ramdisk" pseudo-disks)dnl
_mkdev(rd,rd*,{-dodisk2 rd $U major_rd_b major_rd_c $U 0-})dnl
_mkdev(rd,rd*,{-dodisk2 rd $U major_rd_b major_rd_c $U 0{--}ifstep(rd)-})dnl
__devitem(xd,xd*,Xylogic 753/7053 disks)dnl __devitem(xd,xd*,Xylogic 753/7053 disks)dnl
__devitem(xy,xy*,{- Xylogic 450/451 disks-})dnl __devitem(xy,xy*,{- Xylogic 450/451 disks-})dnl
__devitem(flo,{-fd*-},{-Floppy disk drives (3 1/2"{-,-} 5 1/4")-})dnl __devitem(flo,{-fd*-},{-Floppy disk drives (3 1/2"{-,-} 5 1/4")-})dnl
@ -297,8 +297,8 @@ __devitem(wd,{-wd*-},{-"winchester" disk drives (ST506,IDE,ESDI,RLL,...)-})dnl
__devitem(ccd,ccd*,concatenated disk devices)dnl __devitem(ccd,ccd*,concatenated disk devices)dnl
__devitem(raid,raid*,RAIDframe disk devices)dnl __devitem(raid,raid*,RAIDframe disk devices)dnl
__devitem(vnd,vnd*,"file" pseudo-disks)dnl __devitem(vnd,vnd*,"file" pseudo-disks)dnl
_mkdev(vnd,vnd*,{-dodisk vnd $U major_vnd_b major_vnd_c $U 0
dodisk svnd $U major_vnd_b major_vnd_c $U 128-})dnl
_mkdev(vnd,vnd*,{-dodisk vnd $U major_vnd_b major_vnd_c $U 0{--}ifstep(vnd)
dodisk svnd $U major_vnd_b major_vnd_c $U 128{--}ifstep(vnd)-})dnl
dnl dnl
dnl For normal disk devices, add a disk_q entry; anything else define like dnl For normal disk devices, add a disk_q entry; anything else define like
dnl the rest (such as vnd above). dnl the rest (such as vnd above).
@ -318,8 +318,7 @@ _mkdev(loc,local,{-test -s $T.local && sh $T.local-})dnl
_mkdev({-disks-},{-undefine({-C_ase-})show_disks()undefine({-C_ase-})-}, _mkdev({-disks-},{-undefine({-C_ase-})show_disks()undefine({-C_ase-})-},
{-case $i in {-case $i in
show_disks2()dnl show_disks2()dnl
esac
dodisk $n $U $b $c $U 0-})dnl
esac-})dnl
__mkdev({-disks-}){--}dnl __mkdev({-disks-}){--}dnl
dnl dnl
__devtitle(cons,Console ports)dnl __devtitle(cons,Console ports)dnl
@ -341,8 +340,7 @@ _mkdev({-wsdisp-},ttyC*,{-U=${i##ttyC}
[0-9a-f]) M ttyC$U c major_wsdisp_c {-$(( 16#$U ))-} 600 ;; [0-9a-f]) M ttyC$U c major_wsdisp_c {-$(( 16#$U ))-} 600 ;;
cfg) M ttyCcfg c major_wsdisp_c 255 ;; cfg) M ttyCcfg c major_wsdisp_c 255 ;;
*) echo bad unit $U for $i; exit 1;; *) echo bad unit $U for $i; exit 1;;
esac
-})dnl
esac-})dnl
__devitem(wskbd,wskbd*,wscons keyboards)dnl __devitem(wskbd,wskbd*,wscons keyboards)dnl
_mkdev(wskbd,wskbd*,{-M wskbd$U c major_wskbd_c $U 600-})dnl _mkdev(wskbd,wskbd*,{-M wskbd$U c major_wskbd_c $U 600-})dnl
__devitem(wsmux,wsmux,wscons keyboard/mouse mux devices)dnl __devitem(wsmux,wsmux,wscons keyboard/mouse mux devices)dnl
@ -584,7 +582,7 @@ divert(0)dnl
# #
show_vers()dnl <-- now that all files are included, show versions show_vers()dnl <-- now that all files are included, show versions
# #
# $Open{--}BSD$
{-#-} $Open{--}BSD$
dnl dnl
divert(2)dnl divert(2)dnl
PATH=/sbin:/usr/sbin:/bin:/usr/bin PATH=/sbin:/usr/sbin:/bin:/usr/bin


+ 10
- 6
src/etc/MAKEDEV.sub View File

@ -1,4 +1,4 @@
dnl $OpenBSD: MAKEDEV.sub,v 1.3 2002/01/07 06:25:32 todd Exp $
dnl $OpenBSD: MAKEDEV.sub,v 1.4 2002/01/07 06:54:10 todd Exp $
dnl dnl
dnl Copyright (c) 2001 Todd T. Fries <todd@OpenBSD.org> dnl Copyright (c) 2001 Todd T. Fries <todd@OpenBSD.org>
dnl All rights reserved. dnl All rights reserved.
@ -74,8 +74,8 @@ dnl store a version string for 'this' file
dnl dnl
dnl vers ( uniqueidstring, versionstring, subdir ) dnl vers ( uniqueidstring, versionstring, subdir )
dnl dnl
dnl example1: vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.3 2002/01/07 06:25:32 todd Exp $-})
dnl example2: vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.3 2002/01/07 06:25:32 todd Exp $-},etc.MACHINE)
dnl example1: vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.4 2002/01/07 06:54:10 todd Exp $-})
dnl example2: vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.4 2002/01/07 06:54:10 todd Exp $-},etc.MACHINE)
dnl dnl
dnl if subdir is defined, prepend it to the filename in the version string dnl if subdir is defined, prepend it to the filename in the version string
dnl dnl
@ -86,7 +86,7 @@ define({-vers-},
dnl dnl
dnl Version info for this file: dnl Version info for this file:
dnl dnl
vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.3 2002/01/07 06:25:32 todd Exp $-})dnl
vers(__file__,{-$OpenBSD: MAKEDEV.sub,v 1.4 2002/01/07 06:54:10 todd Exp $-})dnl
dnl dnl
dnl dnl
define({-_addsubdir-}, define({-_addsubdir-},
@ -186,6 +186,10 @@ dnl _DEV 'ifelse' .. $3 - major_$1_b
dnl dnl
ifelse($3,,,{-define(major_$1_b,$3)-})dnl ifelse($3,,,{-define(major_$1_b,$3)-})dnl
dnl dnl
dnl _DEV 'ifelse' .. $4 - step_$1
dnl
ifelse($4,,,{-define(step_$1,{-$4-})-})dnl
dnl
dnl Some magic here, defining a devitem also defines another dnl Some magic here, defining a devitem also defines another
dnl string so that later we can check if a particular devitem was dnl string so that later we can check if a particular devitem was
dnl defined, and thus determine if the devices themselves are to dnl defined, and thus determine if the devices themselves are to
@ -244,7 +248,7 @@ dnl for showing disks
dnl dnl
define({-CasE-}, define({-CasE-},
{-ifdev({-$1-}, {-ifdev({-$1-},
{- $1*) n=$1 b=major_$1_b c=major_$1_c;;
{- $1*) dodisk $1 $U major_$1_b major_$1_c $U 0{--}ifstep($1);;
-})-})dnl -})-})dnl
dnl dnl
dnl dnl
@ -302,4 +306,4 @@ dnl
dnl ifstep(devstr) dnl ifstep(devstr)
dnl .. if stepping is defined for the particular device, emit ' step', else dnl .. if stepping is defined for the particular device, emit ' step', else
dnl nothing dnl nothing
define({-ifstep-},{-ifdef({-step_$1-},{- -}step_$1)-})dnl
define({-ifstep-},{-ifdef({-step_$1-},{- -}step_$1{--})-})dnl

Loading…
Cancel
Save