From:	SMTP%"DSJ@WKUVX1.WKU.EDU"  7-FEB-1995 12:47:23.51
To:	EVERHART
CC:	
Subj:	DECEMBER94.STEP2

From: DSJ-Mgr@WKUVX1.WKU.EDU
Message-Id: <199502071725.MAA23768@mx2.smtp.psi.net>
X-FileServer: Digital Systems Journal File Server <DSJ@WKUVX1.WKU.EDU>
Date: Tue, 07 Feb 1995 11:25:19 CST
Sender: DSJ-Mgr@WKUVX1.WKU.EDU
Errors-To: DSJ-Mgr@WKUVX1.WKU.EDU
Warnings-To: <>
Reply-To: DSJ@WKUVX1.WKU.EDU
Subject: DECEMBER94.STEP2
To: EVERHART@arisia.gce.com

$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))'
$!
$! This archive created:
$!  Name : STEP2
$!  By   : Hunter Goatley <goathunter@ALPHA.WKU.EDU>
$!  Date :  4-JAN-1995 09:16:35.39
$!  Using: VMS_SHARE 8.5-1, (C) 1993 Andy Harper, Kings College London UK
$!
$! Credit is due to these people for their original ideas:
$!    James Gray, Michael Bednarek 
$!
$! To unpack this archive:
$!    Minimum of VMS 4.4 (VAX) / OpenVMS 1.0 (Alpha) is required.
$!    Remove the headers of the first part, up to `cut here' line.
$!    Execute file as a command procedure.
$!
$! The following file(s) will be created after unpacking:
$!       1. STEP2.DSJ;1
$!
$ set="set"
$ set symbol/scope=(nolocal,noglobal)
$ f="SYS$SCRATCH:."+f$getjpi("","PID")+";"
$ if f$trnlnm("SHARE_UNPACK") .nes. "" then $ -
 f=f$parse("SHARE_UNPACK_TEMP",f)
$ e="write sys$error  ""%UNPACK"", "
$ w="write sys$output ""%UNPACK"", "
$ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!"
$ if f$getsyi("CPU") .gt. 127 then $ goto start
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto start
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$unpack:subroutine!P1=file,P2=chksum,P3=attrib,P4=size,P5=fileno,P6=filetotal
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'"
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn' File skipped"
$ delete 'f'*
$ exit
$dirok:
$ x=f$search(P1)
$ if x .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped"
$ delete 'f'*
$ exit
$file_absent:
$ w "-I-UNPACK, Unpacking ", P5, " of ", P6, " - ", P1, " - ", P4, " Blocks"
$ n=P1
$ if P3 .nes. "" then $ n=f
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT/NOJOURNAL 'f'/OUT='n'
PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t,
SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE;PROCEDURE SkipPartsep LOCAL m;
LOOP m:=MARK(NONE);EXITIF m=END_OF(CURRENT_BUFFER);DELETE(m);EXITIF INDEX(
ERASE_LINE,"-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;
PROCEDURE ProcessLine LOCAL c,s,l,b,n,p;s := ERASE_LINE;c := SUBSTR(s,1,1);s :=
 s-c;IF c = "X" THEN SPLIT_LINE; ENDIF;MOVE_HORIZONTAL(-1);l := LENGTH(s);p :=
 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);p := p+1;CASE c FROM ' ' TO '`' ['`']
: COPY_TEXT(ASCII(GetHex(s,p))); p:=p+2;[' ']: p:=p+1;[INRANGE,OUTRANGE]
: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE;PROCEDURE Decode(b)LOCAL m;
POSITION(BEGINNING_OF(b));LOOP m:=MARK(NONE);EXITIF m=END_OF(b);DELETE(m);
IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=1 THEN SkipPartSep;ELSE ProcessLine;
MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);t:="0123456789ABCDEF";f:=GET_INFO(
COMMAND_LINE,"file_name");o:=CREATE_BUFFER(f,f);Decode(o);WRITE_FILE(o,
GET_INFO(COMMAND_LINE,"output_file"));QUIT;
$ if p3 .eqs. "" then $ goto dl
$ open/write fdl &f
$ write fdl "RECORD"
$ write fdl P3
$ close fdl
$ w "-I-CONVRFM, Converting record format to ", P3
$ convert/fdl='f' 'f'-1 'f'
$ fa=f$getdvi(f$parse(f),"ALLDEVNAM")
$ Pa=f$getdvi(f$parse(P1),"ALLDEVNAM")
$ if fa .eqs. Pa then $ rename &f 'f$parse(P1)'
$ if fa .nes. Pa then $ copy &f 'f$parse(P1)'
$dl: delete 'f'*
$ checksum 'P1'
$ if checksum$checksum .nes. P2 then $ -
  e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ exit
$ endsubroutine
$start:
$!
$ create 'f'
X
X================`20C`20Include`20Sample`20for`20a`20Device`20Driver`20`20=====
V========
X#include`20<ccbdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Channel`20Con
Vtrol`20Block`20*/
X#include`20<crbdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Controller`20
VRequest`20Block`20*/
X#include`20<cramdef.h>`20`20`20`20`20`20`20`20`20`20`20`20/*`20Controller`20Re
Vgister`20Access`20Method`20*/
X#include`20<dcdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Device`20Co
Vdes`20*/
X#include`20<ddbdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Device`20Data
V`20Block`20*/
X#include`20<ddtdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Driver`20Disp
Vatch`20Table`20*/
X#include`20<devdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Device`20Char
Vacteristics`20*/
X#include`20<dptdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Driver`20Prol
Vogue`20Table`20*/
X#include`20<fdtdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Function`20De
Vcision`20Table`20*/
X#include`20<fkbdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Fork`20Block
V`20*/
X#include`20<idbdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Interrupt`20D
Vata`20Block`20*/
X#include`20<iocdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20IOC`20Constan
Vts`20*/
X#include`20<iodef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20I/O`20Funct
Vion`20Codes`20*/
X#include`20<irpdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20I/O`20Request
V`20Packet`20*/
X#include`20<orbdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Object`20Righ
Vts`20Block`20*/
X#include`20<pcbdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Process`20Con
Vtrol`20Block`20*/
X#include`20<msgdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Mailbox`20Mes
Vsage`20Codes`20*/
X#include`20<mtxdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20MUTEX`20Defin
Vitions`20*/
X#include`20<ssdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Status`20Co
Vdes`20*/
X#include`20<stsdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Status`20Valu
Ve`20Fields`20*/
X#include`20<ucbdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Unit`20Contro
Vl`20Block`20*/
X#include`20<vecdef.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20IDB`20Vector
V`20Definitions`20*/
X
X/*`20Function`20prototypes`20for`20system`20routines`20*/
X#include`20<exe_routines.h>`20`20`20`20`20`20`20/*`20Prototypes`20for`20exe_st
Vd$`20routines`20*/
X#include`20<ioc_routines.h>`20`20`20`20`20`20`20/*`20Prototypes`20for`20ioc_st
Vd$`20routines`20*/
X#include`20<sch_routines.h>`20`20`20`20`20`20`20/*`20Prototypes`20for`20sch_st
Vd$`20routines`20*/
X
X/*`20Define`20various`20device`20driver`20macros`20*/
X#include`20<vms_drivers.h>`20`20`20`20`20`20`20`20/*`20Device`20driver`20suppo
Vrt`20macros,`20including`20*/
X`09`09`09`09/*`20table`20initialization`20macros`20and`20prototypes*/
X
X/*`20Define`20the`20DEC`20C`20functions`20used`20by`20this`20driver`20*/
X#include`20<builtins.h>`20`20`20`20`20`20`20`20`20`20`20/*`20OpenVMS`20AXP`20s
Vpecific`20C`20builtin`20functions`20*/
X#include`20<string.h>`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20String`20rout
Vines`20provided`20by`20"kernel`20CRTL"`20*/
X
X
X=================`20Sample`20driver$init_tables()`20===================
X/*`20Define`20our`20UCB`20extensions`20*/
Xtypedef`20struct`20`7B
X`09UCB`20`20`20`20`20ucb$r_ucb`20;
X`09int`20`20`20`20`20ucb$l_xx_extension_1`20;
X`09int`20`20`20`20`20ucb$l_xx_extension_2`20;
X`7D`20XX_UCB`20;
X
X/*`20Function`20prototypes`20for`20some`20of`20the`20driver`20routines.`20`20N
Vote`20the
X`20`20`20passing`20of`20structures`20by`20argument`20registers`20rather`20than
V`20general
X`20`20`20purpose`20registers.`20`20*/
X
Xvoid`20xx$struc_init`20(CRB`20*crb,`20DDB`20*ddb,`20IDB`20*idb,`20ORB`20*orb,
V`20XX_UCB`20*ucb);
Xvoid`20xx$struc_reinit`20(CRB`20*crb,`20DDB`20*ddb,`20IDB`20*idb,`20ORB`20*orb
V,`20XX_UCB`20*ucb);
Xint`20`20xx$unit_init`20(IDB`20*idb,`20XX_UCB`20*ucb);
Xint`20`20xx$write`20(IRP`20*irp,`20PCB`20*pcb,`20XX_UCB`20*ucb,`20CCB`20*ccb);
V
Xint`20`20xx$setmode`20(IRP`20*irp,`20PCB`20*pcb,`20XX_UCB`20*ucb,`20CCB`20*ccb
V);
Xvoid`20xx$startio`20(IRP`20*irp,`20XX_UCB`20*ucb);
X
Xint`20driver$init_tables()`7B
X
X`20`20`20`20/*`20Linked`20in`20template`20DPT,`20DDT,`20and`20FDT.`20`20Comes
V`20from
X`20`20`20`20`20*`20VMS$VOLATILE_PRIVATE_INTERFACES.OLB`20library.
X`20`20`20`20`20*/
X`20`20`20`20extern`20DPT`20driver$dpt`20;
X`20`20`20`20extern`20DDT`20driver$ddt`20;
X`20`20`20`20extern`20FDT`20driver$fdt`20;
X
X`20`20`20`20/*`20Initialize`20the`20Driver`20Prologue`20Table`20(DPT)`20*/
X`20`20`20`20ini_dpt_name`20`20`20`20`20`20`20`20(`26driver$dpt,`20"XXDRIVER")
V`20;
X`20`20`20`20ini_dpt_defunits`20`20`20`20(`26driver$dpt,`201)`20;
X`20`20`20`20ini_dpt_ucbsize`20`20`20`20`20(`26driver$dpt,`20sizeof(XX_UCB))`20
V;
X`20`20`20`20ini_dpt_struc_init`20`20(`26driver$dpt,`20xx$struc_init)`20;
X`20`20`20`20ini_dpt_struc_reinit(`26driver$dpt,`20xx$struc_reinit)`20;
X`20`20`20`20ini_dpt_ucb_crams`20`20`20(`26driver$dpt,`20NUMBER_CRAMS)`20;
X`20`20`20`20ini_dpt_end`20`20`20`20`20`20`20`20`20(`26driver$dpt)`20;
X
X`20`20`20`20/*`20Initialize`20the`20Driver`20Dispatch`20Table`20(DDT)`20*/
X`20`20`20`20/*`20All`20functions`20not`20provided`20default`20to`20ioc_std$ret
Vurn`20*/
X`20`20`20`20ini_ddt_unitinit`20`20`20`20(`26driver$ddt,`20xx$unit_init);
X`20`20`20`20ini_ddt_start`20`20`20`20`20`20`20(`26driver$ddt,`20xx$startio);
X`20`20`20`20ini_ddt_cancel`20`20`20`20`20`20(`26driver$ddt,`20ioc_std$cancelio
V);
X`20`20`20`20ini_ddt_end`20`20`20`20`20`20`20`20`20(`26driver$ddt);
X
X`20`20`20`20/*`20Initialization`20the`20Function`20Decision`20Table`20(FDT)`20
V*/
X
X`20`20`20`20ini_fdt_act`20(`26driver$fdt,`20IO$_WRITELBLK,`20xx$write,`20BUFFE
VRED)`20;
X`20`20`20`20ini_fdt_act`20(`26driver$fdt,`20IO$_WRITEPBLK,`20xx$write,`20BUFFE
VRED)`20;
X`20`20`20`20ini_fdt_act`20(`26driver$fdt,`20IO$_WRITEVBLK,`20xx$write,`20BUFFE
VRED)`20;
X`20`20`20`20ini_fdt_act`20(`26driver$fdt,`20IO$_SETMODE,`20xx$setmode,`20BUFFE
VRED)`20;
X`20`20`20`20ini_fdt_act`20(`26driver$fdt,`20IO$_SETCHAR,`20xx$setmode,`20BUFFE
VRED)`20;
X`20`20`20`20ini_fdt_act`20(`26driver$fdt,`20IO$_SENSEMODE,`20exe_std$sensemode
V,`20BUFFERED)`20;
X`20`20`20`20ini_fdt_act`20(`26driver$fdt,`20IO$_SENSECHAR,`20exe_std$sensemode
V,`20BUFFERED)`20;
X`20`20`20`20ini_fdt_end`20(`26driver$fdt)`20;
X
X`20`20`20`20/*`20Done!`20*/
X
X`20`20`20`20return(SS$_NORMAL)`20;
X`7D
X
X
X=========`20Examples`20of`20various`20driver`20macros`20in`20FDT`20routines`20
V========
X
XTo`20queue`20the`20IRP`20to`20the`20STARTIO`20routine:
X
X`09return(call_qiodrvpkt(irp,`20(UCB`20*)ucb))`20;
X
XTo`20abort`20an`20I/O`20request`20and`20return`20an`20error`20status:
X
X`09return(call_abortio(irp,`20pcb,`20(UCB`20*)ucb,`20status))`20;
X
XTo`20complete`20and`20I/O`20request`20and`20return`20a`20completed`20IOSB:
X
X`09return(call_finishio(irp,`20(UCB`20*)ucb,`20SS$_NORMAL,`20devdepnd))`20;
X
XAquire`20a`20device`20lock:
X
X`09device_lock(ucb->ucb$r_ucb.ucb$l_dlck,`20RAISE_IPL,`20`26old_ipl)`20;
X
XRelease`20a`20device`20lock:
X
X`09device_unlock(ucb->ucb$r_ucb.ucb$l_dlck,`20old_ipl,`20SMP_RESTORE)`20;
X
XWait`20for`20Channel`20and`20Keep`20Primary`20Channel:
X
X`09wfikpch(xx$iodone_forkrtn,`20xx$timeout_rtn,`20irp,
X`09`090,`20ucb,`20TIMEOUT_SECS,`20old_ipl)`20;
X
XRequest`20completion`20of`20an`20I/O`20(such`20as`20from`20a`20fork`20routine)
V:
X
X`09ioc_std$reqcom(status,`20devdepnd,`20`26(ucb->ucb$r_ucb))`20;
X
X
X=============`20Compiling`20a`20driver`20in`20C`20=======================
X$`20CC`20/STANDARD=RELAXED_ANSI89`20-
X`09/INSTRUCTION=NOFLOATING_POINT`20-`20!`20Do`20not`20use`20floating`20registe
Vrs
X`09/EXTERN=STRICT-`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20!`20Contr
Vols`20the`20usage`20of`20externs
X`09/OBJ=XXDRIVER`20-
X`09XXDRIVER.C`20-
X`09+SYS$LIBRARY:SYS$LIB_C.TLB/LIBRARY`20!`20System`20macro/symbol`20library
X
X
X============`20Linking`20a`20high`20level`20language`20driver`20===========
X
X$`20LINK/ALPHA/USERLIB=PROC/NATIVE_ONLY/BPAGE=14/SECTION/REPLACE-
X`09/NODEMAND_ZERO/NOTRACEBACK/SYSEXE/NOSYSSHR-
X`09/SHARE=SYS$XXDRIVER-`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20!`20Driver
V`20image
X`09/DSF=SYS$XXDRIVER-`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20!`20De
Vbug`20symbol`20file
X`09/SYMBOL=SYS$XXDRIVER-`20`20`20`20`20`20`20`20`20`20`20`20`20`20!`20Symbol
V`20table
X`09/MAP=SYS$XXDRIVER/FULL/CROSS`20-`20`20`20`20`20!`20Map`20listing
X`09`09SYS$INPUT:/OPTIONS
X!
X!`20`20`20`20`20`20`20The`20LINK`20statement`20is`20pretty`20straight`20forwar
Vd,`20but`20the
X!`20`20`20`20`20`20`20options`20file`20is`20where`20the`20image`20gets`20put
V`20together`20in`20a
X!`20`20`20`20`20`20`20way`20that`20the`20$LOAD_DRIVER`20routine`20can`20correc
Vtly`20load`20it
X!`20`20`20`20`20`20`20into`20OpenVMS.
X!
X!`20`20`20Define`20symbol`20table`20for`20SDA`20using`20all`20global`20symbols
V,`20not`20just
X!`20`20`20universal`20ones
X!`20
XSYMBOL_TABLE=GLOBALS
X!
X!`20`20`20This`20cluster`20is`20used`20to`20control`20the`20order`20of`20symbo
Vl`20resolution.`20`20All
X!`20`20`20psects`20must`20be`20collected`20off`20of`20this`20cluster`20so`20th
Vat`20it`20generates
X!`20`20`20no`20image`20sections.
X!
XCLUSTER=VMSDRIVER,,,-
X`09!
X`09!`20`20`20Start`20with`20the`20driver`20module
X`09!
X`09XXDRIVER.OBJ,-
X`09!
X`09!`20`20`20Next`20process`20the`20private`20interfaces.`20`20(Only`20include
V`20BUGCHECK_CODES`20if
X`09!`20`20`20used`20by`20the`20driver`20module).`20`20The`20/LIB`20qualifier
V`20causes`20the`20linker`20to`20
X`09!`20`20`20resolve`20references`20in`20the`20driver`20module`20to`20DRIVER$I
VNI_xxx`20routines
X`09!`20`20`20(which`20are`20defined`20in`20the`20module`20DRIVER_TABLE_INIT).
V
X`09!
X`09SYS$LIBRARY:VMS$VOLATILE_PRIVATE_INTERFACES/INCLUDE=(BUGCHECK_CODES)/LIB,-
V
X`09!
X`09!`20`20`20Explicitly`20include`20routines`20for`20the`20initialization`20se
Vction`20-`20there
X`09!`20`20`20will`20be`20no`20outstanding`20references`20to`20cause`20this`20t
Vo`20happen`20when`20STARLET
X`09!`20`20`20is`20searched`20automatically.
X`09!
X`09SYS$LIBRARY:STARLET/INCLUDE:(SYS$DRIVER_INIT,SYS$DOINIT)
X
X!
X!`20`20`20Use`20the`20COLLECT`20statement`20to`20implicitly`20declare`20the`20
VNONPAGED_EXECUTE_PSECTS
X!`20`20`20cluster.`20`20Mark`20the`20cluster`20with`20the`20RESIDENT`20attribu
Vte`20so`20that`20the`20image`20
X!`20`20`20section`20produced`20is`20nonpaged.`20`20Collect`20only`20the`20code
V`20psect`20into`20the`20cluster.
X!
XCOLLECT=NONPAGED_EXECUTE_PSECTS/ATTRIBUTES=RESIDENT,-
X`09$CODE$
X
X!
X!`20`20`20Coerce`20the`20psect`20attributes`20on`20the`20different`20data`20ps
Vects`20to`20that`20they`20
X!`20`20`20all`20match.`20`20This`20will`20force`20NONPAGED_READWRITE_PSECTS`20
Vcluster`20to`20yield`20only
X!`20`20`20one`20image`20section.`20`20`20
X!
XPSECT_ATTR=$LINK$,WRT
XPSECT_ATTR=$INITIAL$,WRT
XPSECT_ATTR=$LITERAL$,NOPIC,NOSHR,WRT
XPSECT_ATTR=$READONLY$,NOPIC,NOSHR,WRT
XPSECT_ATTR=$$$105_PROLOGUE,NOPIC
XPSECT_ATTR=$$$110_DATA,NOPIC
XPSECT_ATTR=$$$115_LINKAGE,WRT
X
X!
X!`20`20`20Use`20a`20COLLECT`20statement`20to`20implicitly`20declare`20the`20NO
VNPAGED_DATA_PSECTS
X!`20`20`20cluster.`20`20Mark`20the`20cluster`20with`20the`20RESIDENT`20attribu
Vte`20so`20that`20the`20image`20
X!`20`20`20section`20produced`20is`20nonpaged.`20`20Collect`20all`20the`20data
V`20psects`20into`20the`20cluster.
X!
XCOLLECT=NONPAGED_READWRITE_PSECTS/ATTRIBUTES=RESIDENT,-
X`09!
X`09!`20`20`20Psect`20generated`20by`20BLISS`20modules
X`09!
X`09$PLIT$,-
X`09$INITIAL$,-
X`09$GLOBAL$,-
X`09$OWN$,-
X`09!
X`09!`20`20`20Psects`20generated`20by`20DRIVER_TABLES
X`09!
X`09$$$105_PROLOGUE,-
X`09$$$110_DATA,-
X`09$$$115_LINKAGE,-
X`09!
X`09!`20`20`20Standard`20Psects`20generated`20by`20all`20languages,
X`09!`20`20`20including`20the`20high`20level`20language`20driver`20module
X`09!
X`09$BSS$,-
X`09$DATA$,-
X`09$LINK$,-
X`09$LITERAL$,-
X`09$READONLY$
X
X!
X!`20`20`20Coerce`20the`20program`20section`20attributes`20for`20initialization
V`20code`20so`20
X!`20`20`20that`20code`20and`20data`20`20will`20be`20combined`20into`20a`20sing
Vle`20image`20section.`20`20
X!`20`20`20
XPSECT_ATTR=EXEC$INIT_CODE,NOSHR
X
X!
X!`20`20`20Use`20a`20COLLECT`20statement`20to`20implicitly`20declare`20the`20IN
VITIALIZATION_PSECTS
X!`20`20`20cluster.`20`20Mark`20the`20cluster`20with`20the`20INITIALIZATION_COD
VE`20attribute`20so`20that`20the`20image`20
X!`20`20`20section`20produced`20is`20identified`20as`20INITIALCOD.
X!
X!`20`20`20These`20program`20sections`20have`20special`20names`20so`20that`20wh
Ven`20the`20linker`20sorts`20them`20
X!`20`20`20alphabetically`20they`20will`20fall`20in`20the`20order:`20initializa
Vtion`20vector`20table,`20code,`20
X!`20`20`20linkage,`20build`20table`20vector.`20`20The`20order`20in`20which`20t
Vhey`20are`20collected`20does`20not`20affect
X!`20`20`20their`20order`20in`20the`20image`20section.
X!
X!`20`20`20This`20is`20the`20only`20place`20where`20code`20and`20data`20should
V`20reside`20in`20the
X!`20`20`20same`20section.
X!
X!`20`20`20NOTE:`20The`20linker`20will`20attach`20the`20fixup`20vectors`20to`20
Vthis`20cluster.`20`20This
X!`20`20`20`20`20`20`20`20`20is`20expected.
X!
XCOLLECT=INITIALIZATION_PSECTS/ATTRIBUTES=INITIALIZATION_CODE,-
X`09EXEC$INIT_000,-
X`09EXEC$INIT_001,-
X`09EXEC$INIT_002,-
X`09EXEC$INIT_CODE,-
X`09EXEC$INIT_LINKAGE,-
X`09EXEC$INIT_SSTBL_000,-
X`09EXEC$INIT_SSTBL_001,-
X`09EXEC$INIT_SSTBL_002
X
X
X
$ call unpack STEP2.DSJ;1 487411157 "" 20 1 1
$ v=f$verify(v)
$ exit
