|
|
DataMuseum.dkPresents historical artifacts from the history of: Bogika Butler |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Bogika Butler Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 23936 (0x5d80)
Types: TextFile
Names: »COMDEF.PAS«
└─⟦8592db80f⟧ Bits:30009789/_.ft.Ibm2.50007350.imd Mogens Pelles Zilog 80,000 / EOS projekt
└─⟦this⟧ »COMDEF.PAS«
(*
***********************************************************************
* Copyright 1984 by *
* NCR Corporation *
* Dayton, Ohio U.S.A. *
* All Rights Reserved *
***********************************************************************
* EOS Software produced by: *
* NCR Systems Engineering - Copenhagen *
* Copenhagen *
* DENMARK *
***********************************************************************
* EOS Software rewritten by: *
* Lars G. Jakobsen *
* Metanic Aps. *
* DK-3660 Stenloese *
* DENMARK *
* *
* Copyright 1986 by Metanic Aps. *
***********************************************************************
*)
(*
This file defines constants, data types and primitive operations
on abstract datatypes.
Names of constants and fields of structures complies with the
names used by NCR secp in the Motorola EXORmacs 680000 implementation
of the kernel.
*)
TYPE
RefStore = long; (* Used to represent assembler chaining
fields instead of ordinary pascal
pointers *)
(*---------------------------------------------------------------------
CHAIN AND MEMBER *)
TYPE
ChainType = RECORD
Next: RefStore; (* next element, always meaningful *)
Prev: RefStore; (* previous element, always meaningful *)
END;
MemberType = RECORD
Chain: ChainType;
Ch_hold: RefStore; (* Addr of structure holding chain head *)
END;
CONST
Ch_siz = 4; (* Number of word in chain *)
Member = 6; (* Number of word in member element *)
(*---------------------------------------------------------------------
SIZE TYPE *)
TYPE
SizeType = RECORD
UserPart: long; (* no. of bytes in user part *)
KnelPart: word; (* no. of bytes in kernel part *)
END;
CONST
Sz_siz = 6; (* size of size type *)
Sz_typ = 3; (* number of words in size type *)
(*--------------------------------------------------------------------
POINTER AND FORMAL POINTER *)
TYPE
PointerKindType =
(pt_nil (* nil often set with clear instruction *)
,pt_obj (* refObj *)
,pt_env (* refEnv ( <= pt_env means simple ref) *)
,pt_own (* ownSet *)
,pt_man (* manSet *)
,pt_int (* interrupt pointer, always local (refers to a code segment)*)
,pt_mmu (* mmuDescription ref to object (not a real pointer) *)
,pt_seg (* segmentDescription ref to object (not a real pointer) *)
);
(* VOID argument encoded as 6 = pt_mmu. Used for argument check *)
pt_voi = (.pt_int..pt_seg.); (* *** ??? *** *)
PointerInfoKindType = (interrupt_pointer, non_interrupt_pointer);
PointerInfoBaseType =
(* Comments describe the meaning of the elements belonging to the set *)
(.pt_lsc (* 0 local scope pointer *)
,pt_tsc (* 1 temp scope pointer *)
,pt_fsc (* 2 formal scope pointer *)
,pt_cc (* 3 simple pointer with call capability (0 if nil) *)
,pt_con (* 4 manager enforces copy control (0 if nil) *)
,pt_io (* 5 simple pointer with io-lock (0 if nil) *)
,pt_res (* 6 simple pointer with resident lock (0 if nil ) *)
,pt_ret (* 7 formal return pointer (also=1 for dummy actual) *)
.)
PointerInfoSetType = SET of PointerInfoBaseType;
PointerInfoType = RECORD
(* The Pascal interpretation of PointerInfoType is based on
the declarations in kernel.comdef.sa page 2 and the usage
shown at entry simplpt of kernel.mmprocs.sa page 41. *)
CASE PointerInfoKindType OF
interrupt_pointer: (* For interrupt pointers all bits of pt_inf
represent the interrupt vector number *)
(pt_inf: byte
);
non_interrupt_pointer:
(pt_inf: PointerInfoSetType
)
END;
PointerCommonPartType = RECORD
Pointer: memberType;
(* ownset and manset: pointer -> obj or env
refobj and refenv: obj or env -> pointer
nil: empty chain.
ch_hold (named pt_ref):
ownset, manset, nil: not used.
refobj and refenv: addr of obj or env.
*)
pt_kin: PointerKindType;
(* pointer kind. See above *)
pt_inf: PointerInfoType;
(* pointer inf. See above. pt_kin+pt_inf=word *)
END;
PointerFormalPartType = RECORD
(* part only present for formal pointers *)
fp_act: memberType; (* actual: env or ctx -> formal pointer
ch_hold (named fp_str):
addr of env or ctx structure, 0 if dummy
*)
fp_off: word; (* actual pointer offset within env or ctx *)
END;
PointerType = RECORD
Common: PointerCommonPartType
END;
FormalPointerType = RECORD
Common: PointerCommonPartType;
Formal: PointerFormalPartType
END;
CONST
pt_siz = sizeof(PointerCommonPartType);
(* size of non-formal pointer *)
fp_siz = sizeof(FormalPointerType);
(* size of formal pointer *)
(* fp_siz must be less than or equal to fp_pow2 = 32 *)
fp_pow2 = 32;
pt_mask = (2**15)/fp_pow2 - 1;
(* mask for pointer index <= 2**15/fp_siz *)
(*--------------------------------------------------------------------
OBJECT COMMON PART *)
TYPE
ObjectKindType =
(OB_GEOB (* 0 General object *)
,OB_GAOB (* 1 Gate object *)
,OB_COOB (* 2 Condition object *)
,OB_OPOB (* 3 Open object *)
,OB_DOOB (* 4 Dormant object *)
,OB_PROB (* 5 Process object *)
,OB_EXOB (* 6 Extension object (Kind not visible to user) *)
,OB_SEOB (* 7 Segment object (emb or non-emb, subsegm or root segm) *)
,OB_ALLO (* 8 Allocate *)
,OB_SCHE (* 9 Internal scheduler *)
);
ObjectStateBaseType =
(OB_REEN (* 0 Reentrant object (only general objects) *)
,OB_EMB (* 1 Embedded object (only general objects) *)
,OB_SUB (* 2 Subsegment object *)
,OB_OCC (* 3 Owner has call capability (only general objects) *)
,OB_READ (* 4 Read allowed (only segment objects) *)
,OB_WRIT (* 5 Write allowed (only segment objects) *)
,OB_EXEC (* 6 Execute allowed (only segment objects) *)
,OB_ABOR (* 7 Aborted object (General and segment objects) *)
);
ObjectStateType = SET OF ObjectStateBaseType;
CONST
OB_SEGM: ObjectStateType = (. OB_READ, OB_WRIT, OB_EXEC .);
OB_SUBS: ObjectStateType = (. OB_SUB, OB_SEGM .);
TYPE
ObjectCommonPartType = RECORD
Owner: MemberType;
(* Ownset -> Object
OB_Own = Ch_hold: addr. of owner env or ctx *)
OB_Off: word;
(* Owner pointer offset in env or ctx
(0 for initial owner pointer) *)
OB_Ref: ChainType;
(* Referred by: Object -> RefObj, SebSegm, MMUdescr *)
OB_Res: word;
(* Resident Count: Non segment object = #res_pt
to object *)
OB_SizK: word;
(* Size of kernel part (used also for emb obj) *)
OB_Kin: ObjectKindType;
(* See above *)
OB_Sta: ObjectStateType;
(* See above *)
OB_Spa: RefStore;
(* *** ??? *** *)
(* Space descr: Top Object, abs. ddr.
Disagrees with size of object during
relocation (not used for embedded objects) *)
END;
CONST
OB_Siz = sizeof(ObjectCommonPartType);
(*--------------------------------------------------------------------
SPACE DESCRIPTION, PRESENT ONLY FOR NON-EMBEDDED OBJECTS
ADDRESSES RELATIVE TO TOP OF KERNEL PART See kernel.comdef.sa p 3. *)
TYPE
SpaceDescriptionType = RECORD
Sp_env: ChainType; (* Envelope stack: Object -> env *)
Sp_fre: SizeType; (* Free bytes. User and kernel part *)
Sp_FirU: long; (* First free. User part *)
Sp_Firk: long; (* First free. Kernel part *)
Sp_SizU: long; (* Total size. User part *)
END;
(*--------------------------------------------------------------------
GATE OBJECT *)
TYPE
GateChainArrayIndexType =
(GA_lok (* Locking: Gate -> processes waiting on gate.lock *)
,GA_relok (* Relocking: Gate -> Processes relocking after being
signalled *)
,GA_splok (* Speed reloking: Gate -> Processes relocking after
speed up or time out *)
);
GateStateType =
(open
,locked
);
GateLevelType =
(Normal
,device1
,device2
,device3
,device4
,device5
,device6
,device7
);
ObjectGatePartType = RECORD
GA_sch: PointerCommonPartType;
(* ObjRef to Scheduler obj or nil *)
GA_set: ChainType;
(* ManSet: Gate -> Cond *)
GA_array: ARRAY (. GateChainArrayIndexType .) OF ChainType;
GA_sta: GateStateType; (* open = 0, locked = 2**7=128 *)
(* *** ??? *** could it be boolean ??? *)
GA_lev: GateLevelType
END;
GateObjectType = RECORD
ObjectCommonPart: ObjectCommonPartType;
ObjectGatePart: ObjectGatePartType
END;
CONST
GA_siz = sizeof(GateObjectType);
(*--------------------------------------------------------------------
CONDITION OBJECT *)
TYPE
ObjectConditionPartType = RECORD
CO_man: MemberType; (* Manager: manset in gate -> condition
CO_GA = ch_hold: addr. of managing
gate object. 0 when cond is aborted *)
CO_wait: ChainType; (* Waiting: condition -> processes
waiting on cond.wait *)
END;
ConditionObjectType = RECORD
CommonPart: ObjectCommonPartType;
ConditionPart: ObjectConditionPartType
END;
CONST
CO_Siz = sizeof(ConditionObjectType);
(*--------------------------------------------------------------------
EXTENSION AND PROCESS OBJECT *)
TYPE
ObjectExtensionPartType = RECORD
EX_ctx: ChainType; (* Contexts: Extension obj-> ctx *)
EX_ext: MemberType; (* Extension: Process obj -> ext
EX_pr = CH_hold = address of process obj *)
END;
RegisterType = long;
RegisterSaveAreaType = ARRAY (. RegisterSaveAreaIndexType .) OF
RegisterType;
TimeType = RECORD
MSL: long;
LSL: long
END;
ProcessPriorityType = ();
(* *** ??? *** *)
ProcessStateType = (run (* 0 *)
,wait (* 2 *)
,d_wait (* 4 *)
,lock (* 6 *)
,signld (* 8 *)
);
SynchronizationResultType = ();
(* *** ??? *** *)
ObjectProcessPartType = RECORD
PR_main: ChainType; (* Main queue: Gate locking, gate relocking,
gate speed lock, timer or
driving -> process *)
PR_aux: MemberType; (* Aux queue: Condition, running, se_wait,
pr_term, mm_queue -> process
PR_con = CH_hold = address of
condition object or undef *)
PR_term: ChainType; (* Proc. waiting for terminate: proc->proc *)
PR_d0.a3: RegisterSaveAreaType;
(* Register save area: Used between time slices.
Alloc saves part of stack, not gers. *)
PR_timo: TimeType; (* Time out: 64 bit point in time for
reschedule *)
PR_cpu: TimeType; (* Cpu time: No of usec used by the process
(64bits) *)
PR_pri: ProcessPriorityType;
(* Priority: Used for interrupt level and
lock control *)
PR_sta: ProcessStateType;
(* Used when a "process" is speeded up *)
PR_syn: SynchonizationResultType;
(* Result of a sync_func. (e.g. wait) *)
END;
ExtensionObjectType = RECORD
CommonPart: ObjectCommonPartType;
ExtensionPart: ObjectExtensionPartType
END;
ProcessObjectType = RECORD
CommonPart: ObjectCommonPartType;
ExtensionPart: ObjectExtensionPartType;
ProcessPart: ObjectProcessPartType
END;
CONST
EX_siz = sizeof(ExtensionObjectType);
PR_siz = sizeof(ProcessObjectType);
(*--------------------------------------------------------------------
SEGMENT AND SUBSEGMENT OBJECT *)
TYPE
ObjectSegmentPartType = RECORD
SE_io: word; (* IO_count: #io_refs to segment and to
sub segments *)
SE_fir: PhysicalAddressType;
(* First physical address of user segment
(even). Undefined when segment is aborted *)
SE_len: long; (* Length of user segment (even). Undefined
when segment is aborted *)
SE_wait: ChainType; (* IO_count_wait: segm -> proc waiting for
io_count to become 0 *)
END;
ObjectSubSegmentPartType = RECORD
SU_p: PointerType; (* Points to base segment or subsegment.
SU_ref = PT_ref = address of base segment
or sub segment (0 if
base segment removed)
SU_kin = PT_kin = Kind (=subsegment(=PT_seg))
SU_inf = PT_inf Not used. *)
END;
SegmentObjectType = RECORD
CommonPart: ObjectCommonPartType;
SegmentPart: ObjectSegmentPartType
END;
SubSegmentObjectType = RECORD
CommonPart: ObjectCommonPartType;
SegmentPart: ObjectSegmentPartType;
SubSegmentPart: ObjectSubSegmentPartType
END;
CONST
SE_siz = sizeof(SegmentObjectType);
SU_siz = sizeof(SubSegmentObjectType);
(*--------------------------------------------------------------------
MMU DESCRIPTOR (ONLY USED AS PART OF CONTEXT) *)
TYPE
MMU_RegisterIndexType = (First_logical (* first log. // 256 *)
,Last_logical (* last log. // 256 *)
,Offset (* offset //256
(logical + offset =
physical) *)
,Flags (* bit0=1: ENABLE
bit1=1: READ ONLY *)
);
MMU_RegisterType = ARRAY (. MMU_RegisterIndexType .) OF word;
MMU_SaveAreaKindType = (MMU_RegKind, D&'_RegKind);
MMU_saveAreaType = RECORD
(* The pascal interpretation is based on the comment in line
253 in file comdef.sa page 6. *)
CASE MMU_SaveAreaKindType OF
MMU_RegKind:
(MMU_Regs: MMU_RegisterType
);
D67_RegKind:
(d6
,d7: RegisterType
)
END;
MMU_DescriptorType = RECORD
MM_map: PointerType;
(* Points to segment or sub segment mapped
MM_ref = PT_ref = address of segment or sub
segment object. 0 if unmapped or
base segment removed.
MM_kin = PT_kin = MMU_descriptor (=PT_MMU) *)
MM_reg: MMU_SaveAreaType;
(* MMU register contents. Also used to save d6/d7
(=result) during delete context (del_ctx) in
knelop. *)
END;
CONST
MM_siz = sizeof(MMU_DescriptorType);
(*--------------------------------------------------------------------
GENERAL OBJECT *)
TYPE
ObjectGeneralPartType = RECORD
GE_ex: ChainType; (* Executed by: General obj -> ctx *)
GE_con: word; (* Control procedure <= 0 *)
GE_temp: word; (* No of temp pointers in contexts
(incl T(0)) *)
GE_temd: long; (* No of bytes in temp stack, > 0,
< MAX-AR_MAXVAL *)
GE_stk: SizeType; (* Size of required free call stack *)
GE_stkm: RefStore; (* Logical address for mapping temp stack:
FL_tempd = $200000 for normal objects *)
GE_ent: RefStore; (* Logical address for entry *)
END;
GeneralObjectType = RECORD
CommonPart: ObjectCommonPartType;
GeneralPart: ObjectGeneralPartType
END;
CONST
GE_siz = sizeof(GeneralObjectType);
(*--------------------------------------------------------------------
STACK ELEMENT: COMMON PART OF ENVELOPES AND CONTEXTS *)
(* Embedded segments and subsegments allocated here *)
TYPE
StackCommonPartType = RECORD
ST_mem: MemberType; (* Various usage: Head -> stack element
ST_ref = CH_hold = address of entity
holding head *)
ST_word: word; (* Various usage *)
ST_stk: MemberType; (* Stack: Head -> stack element
ST_hold = CH_hold = addrass of object
holding stack element *)
ST_act: ChainType; (* Actual: Stack element -> formal pointer *)
ST_top: word; (* Top pointers, relative to stack element *)
ST_fir: word; (* First embedded, relative to stack element *)
ST_res: word; (* Resident count: <> 0 when stack
element is resident *)
ST_io: word; (* io_count: #simple pointers with io_cap
in element *)
END;
(* Pointers allocated here *)
(* NOTE: Size of envelope/contextincluding pointers and embedded
structures is always:
TOP POINTERS - FIRST EMBEDDED
(ST_top - ST_fir) *)
CONST
ST_siz = sizeof(StackCommonPartType);
(*--------------------------------------------------------------------
ENVELOPE *)
TYPE
StackEnvelopePartType = RECORD
EN_mst: MemberType; (* Manager: Manset -> envelope
EN_man = CH_hold = address of manager
envelope (0 if dummy manager) (also
term_proc = 0 for dummy manager) *)
EN_off: word; (* Manset pointer offset in manager envelope *)
EN_stk: MemberType; (* Envelope stack: object -> envelope
EN_obj = CH_hold = addrass of object
holding envelope *)
EN_act: ChainType; (* Actual: Envelope -> formal pointer *)
EN_topl: word; (* Top local pointers, relative to envelope *)
EN_fir: word; (* First embedded, relative to envelope *)
EN_res: word; (* Resident count: #res_pt to env + #driv_pt
in env + #res_ctx in the obj having
env as primary env. <> 0 when envelope
is resident *)
EN_io: word; (* io_count: #simple pointers with io_cap
in envelope *)
(* END OF COMMON PART *)
EN_ref: ChainType; (* Referred by: Env -> refEnv pointers *)
EN_term: word; (* Termination procedure:
< 0: Normal
= 0: Dummy or dummy manager
= 1: Term procedure called *)
EN_termr: SizeType; (* Termination requirement: Free stack needed
to enter term procedure, use call stack
or dealloc stack+delete locals and older
envelopes *)
EN_fix: SizeType; (* Fixed term requirement: Fixed stack needed
to enter term procedure and use dealloc
stack *)
EN_max: SizeType; (* Max stack: Free stack sufficient to delete
all locals in envelope *)
EN_cou: word; (* Number of "locals" with term req = max for
both components. "Locals" are logically
owned objects and older envelopes.
EN_cou may be zero in case max components
are from different "locals" *)
END;
CONST
EN_siz = sizeof(EnvelopeType);
(* Size of envelope excluding local pointers *)
(*--------------------------------------------------------------------
*)
(*--------------------------------------------------------------------
*)
(*--------------------------------------------------------------------
*)
(*--------------------------------------------------------------------
*)
(*--------------------------------------------------------------------
*)
(*--------------------------------------------------------------------
*)
«eof»