version 1.40, 2002/02/21 18:36:54 |
version 1.41, 2002/02/25 01:10:26 |
|
|
dnl in the description at the top of the generated MAKEDEV file: |
dnl in the description at the top of the generated MAKEDEV file: |
dnl |
dnl |
dnl __devitem(sca, sca*, Sugar Generic device)dnl |
dnl __devitem(sca, sca*, Sugar Generic device)dnl |
|
dnl __devitem(cry, crypto, hardware crypto access driver)dnl |
dnl |
dnl |
dnl This is ultimately shown as: |
dnl This is ultimately shown as: |
dnl |
dnl |
dnl # sca* Sugar Generic device |
dnl # sca* Sugar Generic device |
|
dnl # crypto hardware crypto access driver |
dnl |
dnl |
dnl Use '_mkdev(uniqueid, shell-pattern, {-shell-script-})dnl' to create |
dnl Use '_mkdev(uniqueid, shell-pattern, {-shell-script-})dnl' to create |
dnl a shell script fragment used to 'create' the device (be sure to match |
dnl a shell script fragment used to 'create' the device (be sure to match |
|
|
dnl |
dnl |
dnl _mkdev(sca, sca*, {-M sca$U c major_sca_c $U |
dnl _mkdev(sca, sca*, {-M sca$U c major_sca_c $U |
dnl M rsca$U b major_sca_b Add($U, 128)-})dnl |
dnl M rsca$U b major_sca_b Add($U, 128)-})dnl |
|
dnl _mkdev(cry, crypto, {-M crypto c major_cry_c 0-})dnl |
dnl |
dnl |
dnl This is ultimately expanded into: |
dnl This is ultimately expanded into: |
dnl |
dnl |
dnl sca*) M sca$U c 24 $U |
dnl sca*) |
dnl M sca$U b 42 $(($U+128));; |
dnl M sca$U c 24 $U |
|
dnl M sca$U b 42 $(($U+128)) |
|
dnl ;; |
dnl |
dnl |
|
dnl crypto) |
|
dnl M crypto c 47 0 |
|
dnl ;; |
|
dnl |
dnl In the MAKEDEV.md file, add a '_DEV(uniqueid, charmajor, blockmajor)' |
dnl In the MAKEDEV.md file, add a '_DEV(uniqueid, charmajor, blockmajor)' |
dnl entry: |
dnl entry: |
dnl |
dnl |
dnl _DEV(sca, 24, 42) |
dnl _DEV(sca, 24, 42) |
|
dnl _DEV(cry, 47) |
dnl |
dnl |
dnl Final step is to add an entry to the 'all' entry below. For a short |
dnl Final step is to use the 'target/twrget' macros to have the 'all)' target |
dnl example: |
dnl generate one or more device(s). Usage of 'target/twrget' is: |
|
dnl target(target_name, device_name [, append_string ] .. ) |
|
dnl twrget(target_name, uniqueid, device_name, [, append_string ] .. ) |
dnl |
dnl |
dnl _mkdev({-all-}, {-all-}, {-dnl |
dnl target_name a unique name that later is used as an argument to |
dnl _dl({-std-}, {-std-}, {-sca-}, {-sca0 sca1 sca2 sca3-})-})dnl |
dnl 'show_target()' (which expands all devices for a |
|
dnl given 'target_name'). |
|
dnl uniqueid same as 'uniqueid' above |
|
dnl device_name string representing the device to be mknod'ed |
|
dnl append_string for each append_string, `device_name' is prepended |
dnl |
dnl |
|
dnl Note: 'target(a,b,c)' is equivalent to 'twrget(a,b,b,c)' |
|
dnl |
|
dnl |
|
dnl For a short example: |
|
dnl |
|
dnl target(all, std)dnl |
|
dnl target(all, sca, 0, 1, 2, 3)dnl |
|
dnl twrget(all, cry, crypto)dnl |
|
dnl |
dnl would expand to: |
dnl would expand to: |
dnl |
dnl |
dnl all) |
dnl all) |
dnl R std sca0 sca1 sca2 sca3 |
dnl R std sca0 sca1 sca2 sca3 crypto |
dnl ;; |
dnl ;; |
dnl |
dnl |
dnl presuming '_DEV(sca..' and '_DEV(std)' were in the MAKEDEV.md file. |
dnl presuming '_DEV(sca, ?, ?)' and '_DEV(std)' were in the MAKEDEV.md file. |
dnl |
dnl |
dnl |
dnl |
dnl Everything is 'automatically' added to 'MAKEDEV' based on whether or |
dnl Everything is 'automatically' added to 'MAKEDEV' based on whether or |
dnl not the '_DEV()' entry has a corresponding _mkdev() and __devitem() |
dnl not the '_DEV()' entry has a corresponding _mkdev() and __devitem() |
dnl entry in MAKEDEV.sub (this file). |
dnl entry in MAKEDEV.mi (this file). |
dnl |
dnl |
dnl Note: be very wary of adding whitespace, carriage returns, or not |
dnl Note: be very wary of adding whitespace, carriage returns, or not |
dnl finishing a macro with ')dnl' .. otherwise, extra blank lines show up |
dnl finishing a macro with ')dnl' .. otherwise, extra blank lines show up |
|
|
dnl disk_q(rd) |
dnl disk_q(rd) |
dnl __devitem(rd, {-rd*-}, {-rd-})dnl |
dnl __devitem(rd, {-rd*-}, {-rd-})dnl |
dnl |
dnl |
|
dnl Note: not all disks are generated in 'all)'. (e.g. vax has a lot of |
|
dnl disks that are not generated by 'all)') |
dnl |
dnl |
|
dnl |
_mkdev(loc, local, {-test -s $T.local && sh $T.local-})dnl |
_mkdev(loc, local, {-test -s $T.local && sh $T.local-})dnl |
dnl |
dnl |
__devtitle(make, Device "make" file. Valid arguments)dnl |
__devtitle(make, Device "make" file. Valid arguments)dnl |
|
|
{-makes all known devices{-,-} including local devices. |
{-makes all known devices{-,-} including local devices. |
{-#-} Tries to make the ``standard'' number of each type.-})dnl |
{-#-} Tries to make the ``standard'' number of each type.-})dnl |
dnl |
dnl |
dnl 'all' is special. The 'D'evice 'L'ist (or _dl) macro checks to see if |
|
dnl a particular devices is in the MAKEDEV.md file, and if so, includes the |
|
dnl necessary devices. Otherwise the devices are not included in the 'all' |
|
dnl target. Note this keeps line lengths to less than column 70. For the |
|
dnl gory details see the definition of '_dl' in MAKEDEV.sub |
|
dnl |
dnl |
target(all, mcd, 0)dnl |
target(all, mcd, 0)dnl |
twrget(all, fdesc, fd)dnl |
twrget(all, fdesc, fd)dnl |
|
|
target(all, lpt, 0, 1, 2)dnl |
target(all, lpt, 0, 1, 2)dnl |
twrget(all, lpt, lpa, 0, 1, 2)dnl |
twrget(all, lpt, lpa, 0, 1, 2)dnl |
target(all, joy, 0, 1)dnl |
target(all, joy, 0, 1)dnl |
target(all, rnd, random)dnl |
twrget(all, rnd, random)dnl |
target(all, uk, 0)dnl |
target(all, uk, 0)dnl |
target(all, st, 0)dnl |
target(all, st, 0)dnl |
target(all, wt, 0)dnl |
target(all, wt, 0)dnl |
|
|
b) n=1 ;; |
b) n=1 ;; |
c) n=2 ;; |
c) n=2 ;; |
d) n=3 ;; |
d) n=3 ;; |
*) echo unknown cua device $i ;; |
*) echo unknown cua device $i ;; |
esac |
esac |
M cua$u c major_s64_czs_c Add($n, 128) 660 dialer uucp-})dnl |
M cua$u c major_s64_czs_c Add($n, 128) 660 dialer uucp-})dnl |
-})dnl |
-})dnl |
|
|
b) n=1 ;; |
b) n=1 ;; |
c) n=4 ;; |
c) n=4 ;; |
d) n=5 ;; |
d) n=5 ;; |
*) echo unknown cua device $i ;; |
*) echo unknown cua device $i ;; |
esac |
esac |
M cua$u c major_czs_c Add($n, 128) 660 dialer uucp-})dnl |
M cua$u c major_czs_c Add($n, 128) 660 dialer uucp-})dnl |
__devitem(arm_tty, tty*, {-alias for PC COM ports{-,-} this is what the system really wants-})dnl |
__devitem(arm_tty, tty*, {-alias for PC COM ports{-,-} this is what the system really wants-})dnl |
|
|
else |
else |
echo "$list" | sh |
echo "$list" | sh |
fi |
fi |
divert(3)dnl |
divert(3)dnl |
dnl |
dnl |
|
|
R() { |
R() { |