|
|
DataMuseum.dkPresents historical artifacts from the history of: RC3500 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC3500 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 7680 (0x1e00)
Types: TextFileVerbose
Names: »em3502env«
└─⟦041268bb6⟧ Bits:30003098 SW2001/2/3.02 RC3502 Operating System
└─⟦6fc3bf78b⟧
└─⟦this⟧ »em3502env«
em3502env;
(***********************************************************************)
(* *)
(* entity management environment *)
(* *)
(* description: *)
(* the em3502env defines the most common used constants and types *)
(* used by lcp's *)
(* *)
(* date init changes *)
(* ----------------------------------------------------------------- *)
(* 851128 oer initial version *)
(***********************************************************************)
const
time_lgt = 12; (* digits in time in supervisor message *)
sp_head_lgt = 17; (* length of supervisor head (bytes) *)
event_buf_size = 300; (* no. of bytes in an event buffer *)
sup_buf_size = 300; (* no. of bytes in a supervisor message buffer *)
sp_buf_lgt = sup_buf_size;
type
(*********************************)
(**** supervisor messages ****)
(*********************************)
lcp_ident_type = packed record
i: bit;
id: 0..32767;
end;
req_ans_type = (req, ans);
mess_ev_type = (mess, event);
ncp_cntr_type = (no_ncp_cntr, ncp_cntr);
rep_func_type = (start_rep, stop_rep);
rej_func_type = (no_reject, reject);
stat_cntr_type = (no_reset_stat, reset_stat);
sp_type_type = packed record
req_ans : req_ans_type;
mess_ev : mess_ev_type;
ncp_control : ncp_cntr_type;
rep_func : rep_func_type;
rej_func : rej_func_type;
stat_cntr : stat_cntr_type;
?,? : bit;
end;
basic_type = (lcp_cntr, (* lcp control operation *)
lcp_sense, (* lcp sense operation *)
lcp_get_stat, (* lcp get statistics operation *)
lcp_event); (* lcp event operation *)
lcp_oper_type = packed record
modif : 0..63;
basic : basic_type;
end;
sp_status_bit = (sp_status_15, (* module dependent status bit *)
sp_status_14, (* module dependent status bit *)
sp_status_13, (* module dependent status bit *)
sp_status_12, (* module dependent status bit *)
sp_status_11, (* module dependent status bit *)
sp_status_10, (* module dependent status bit *)
ncp_status, (* ncp originated status *)
rep_res_lack, (* lack of repeat function resources *)
no_free_res, (* no free resources available *)
dupl_func, (* duplicate function *)
out_of_range, (* out of range *)
illegal_state, (* illegal state *)
data_error, (* error found in supervisor data *)
lcp_unknown, (* lcp with specified receiver_id not connected *)
ill_lcp_oper, (* illegal lcp_oper *)
chain); (* indicate chained supervisor messages *)
time_digit = 0..15;
sp_head_type = packed record
receiver_id : lcp_ident_type;
sender_id : lcp_ident_type;
seq_no : byte;
sp_type : sp_type_type;
lcp_oper : lcp_oper_type;
status : set of sp_status_bit;
time : packed array(1..time_lgt) of time_digit;
bytecount : integer;
end;
\f
const
(**********************************************)
(**** u1 values in messages to the ncp ****)
(**********************************************)
connect_lcp = 4;
disconnect_lcp = 8;
wait_message = 12; (* wait for a supervisor message *)
req_event_buf = 16; (* get an event buffer, if any free *)
wait_event_buf = 20; (* wait forever for an event buffer *)
exception_lcp = 24; (* exception in the connected lcp *)
(************************************************)
(**** u1 values in messages from the ncp ****)
(************************************************)
sup_mess_buf = 12 + 3; (* supervisor message buffer from the ncp *)
event_buf_req = 16 + 3; (* event buffer, when no wait *)
event_buf_wait = 20 + 3; (* event buffer, when waited forever *)
\f
(**************************)
(**** lcp messages ****)
(**************************)
type
lcp_conn_type = record (* used in lcp connection *)
first,
last,
next : integer;
lcp_ident : lcp_ident_type;
end;
lcp_disc_type = lcp_conn_type; (* used in lcp disconnection *)
lcp_exc_type = record (* used in exception in lcp *)
first, last, next : integer;
lcp_ident : lcp_ident_type;
excode : integer;
end;
\f
(*********************************)
(**** ncp procedure types ****)
(*********************************)
em_zone_type = record
ncp_semp : ! ^semaphore;
main : ! ^semaphore;
event_spool : semaphore;
event_buf_reqs : semaphore;
? : pool 0;
? : reference;
lcp_id : integer;
no_of_used_bytes : integer;
no_of_free_bytes : integer;
no_of_lost_events : integer;
? : integer;
end;
event_head_type = record
typ : byte;
bytecount : byte;
end;
\f
(*********************************)
(**** external procedures ****)
(*********************************)
procedure em_initzone(
var z : em_zone_type; (* The lcp zone to be intiated *)
sp_wait_heads : integer; (* The no of headers to wait for lcp mess *)
lcp_id : integer; (* The lcp_id of the lcp zone *)
ncp : ^semaphore; (* The ncp semaphore pointer *)
main : ^semaphore; (* The main sem pointer of the process *)
event_stream : byte; (* The u4 val of the event request header *)
mess_stream : byte); (* The u4 val of the wait message headers *)
external;
procedure em_receive_request(
var z : em_zone_type; (* The internal em_zone *)
var msg : reference; (* The message received from the NCP *)
var basic_oper : basic_type; (* The basic lcp operation *)
var modif_oper : integer ; (* The modif of the lcp operation *)
var lower, upper : integer); (* The lower and upper indexes of the *)
(* sense and get statistics operations *)
external;
procedure em_pack_event(
var lcp_z : em_zone_type; (* The internal em_zone *)
var event : event_head_type);(* The event head of the event record *)
external;
procedure em_send_spooled_events(
var lcp_z : em_zone_type; (* The interna{ em_zone *)
var msg : reference); (* The event buffer received from the NCP*)
external;
procedure em_break(
var z : em_zone_type; (* The LCP zone of the module*)
exc_code : integer); (* The exception code*)
external;
procedure em_exclude(
var z : em_zone_type);
external;
(********************************************************************)
(* *)
(* end of entity management environment *)
(* *)
(********************************************************************)
.
«eof»