MODULE mlm$invoke_mli_helper;
*copyc OSD$DEFAULT_PRAGMATS

{  The purpose of this request is to call the mli helper routine (which must
{  run in ring 1) from ring 3.

?? PUSH (LISTEXT := ON) ??
*copyc I#CALL_MONITOR
*copyc OSD$VIRTUAL_ADDRESS
*copyc osv$170_os_type
*copyc TMC$WAIT_TIMES
*copyc ost$caller_identifier
*copyc TMT$RB_DELAY

  PROCEDURE [XREF] mlp$initialize_helper;

  VAR
    mlv$enabled: [XREF] boolean;

  PROCEDURE [XREF] mlp$help_c170;
?? POP ??

  PROCEDURE [XDCL, #GATE] mlp$invoke_mli_helper;

  VAR
    delay: tmt$rb_delay,
    id: ost$caller_identifier;

  IF osv$170_os_type = osc$ot7_none THEN
    RETURN;
  IFEND;
  #caller_id (id);
  IF id.ring > osc$tsrv_ring THEN
    RETURN;
  ELSE
      IF NOT mlv$enabled THEN
        RETURN;
      IFEND;

      mlp$initialize_helper;

      WHILE TRUE DO
        mlp$help_c170;
        delay.reqcode := syc$rc_delay;
        delay.requested_wait_time := tmc$infinite_wait;
        delay.expected_wait_time := #free_running_clock (0) + 20000000;
        i#call_monitor (#LOC (delay), #SIZE (delay));
      WHILEND;
  IFEND;

PROCEND mlp$invoke_mli_helper;
MODEND mlm$invoke_mli_helper
