?? LEFT := 1, RIGHT := 110 ??
*copy osd$default_pragmats
MODULE bam$tape_block_manager_ring1;

  { This module exists only to contain certain variables which are tuning and/or debugging }
  { parameters for tape block management.  These variables are packaged in ring 1 so that }
  { their values will be shared by all jobs in the system. }

  { Set_system_attribute commands exist to modify the values of these variables.  See module }
  { sym$system_constant_manager for the names of the attributes.  These values can, or course, }
  { also be modified with the system core debugger if necessary. }

?? PUSH (LISTEXT := ON) ??
*copyc ost$status
?? POP ??

?? TITLE := 'System wide variables for tape block management', EJECT ??

  { The following variable controls the maximum MAX_BLOCK_LENGTH which will be allowed for tape files. }
  { Any attempt to open a tape with a MAXBL larger than this value will be rejected by tape block }
  { management. }

  VAR
    bav$max_allowed_tape_block_size: [STATIC, XDCL, #GATE] integer := 7FFFFFFFF(16);

  { The value of the following variable controls the decision to use direct tape I/O. }
  { If the max_block_length specified by the user is larger than this value direct I/O }
  { will be used. }

  VAR
    bav$max_indirect_tape_block: [STATIC, XDCL, #GATE] integer :=  65536;

  { The value of the following variable is the maximum number of bytes which will be }
  { used in a tape buffer group.  The users max_block_length is divided by this number to }
  { determine the number of tape blocks to be read or written in each physical I/O call. }

  VAR
    bav$max_bytes_per_tape_io: [STATIC, XDCL, #GATE] integer := 196608;

  { The following variable is here to help with debugging  of direct I/O.  This variable is }
  { normally FALSE.  If it is set TRUE then all tape I/O  will be done direct, regardless of }
  { the MAXBL specified by the user. }

  VAR
    bav$force_direct_tape_io: [STATIC, XDCL, #GATE] boolean := FALSE;

  { The following variable is here to help evaluate the performance if the memory management }
  { strategy used in tape block management.  If this variable is TRUE, block management will }
  { use mmp$assign_pages, mmp$check_if_pages_in_memory and mmp$conditional_free to manage the }
  { assignment of real memory to tape buffers.  If this variable is FALSE, block management }
  { will use mmp$advise_in to rapidly bring data into memory, and will take no special action }
  { to free space when it is no longer needed. }

  VAR
    bav$use_assign_pages_for_tape: [STATIC, XDCL, #GATE] boolean := TRUE;

  { The following variable controls the enforcement of tape security.
  {
  {   TRUE
  {     Enforcement of security in ANSI VOL1 and HDR1 labels is enabled.
  {     Labeled external and unlabeled tape access is controlled via capabilities.
  {     Expiration_date is enforced.
  {
  {   FALSE
  {     Enforcement of security in ANSI VOL1 and HDR1 labels is disabled.
  {     Labeled external and unlabeled tape access is not controlled.
  {     Expiration_date is enforced.
  {

  VAR
    bav$enforce_tape_security: [STATIC, XDCL] bat$tape_validation_state := bac$no_tape_validation;

  { The following variable controls the use of tape management site hooks.
  { The system maintains the following tape validation states:
  {
  {   No Validation (bac$no_tape_validation):
  {     Tape management site hooks are not called in this state.
  {     The system is in this state during deadstart and until the state is changed by a
  {     CHANGE_TAPE_VALIDATION command which can be inserted in the SITE_STARTUP_COMMANDS file.
  {
  {   Validation On (bac$tape_validation_on):
  {     Tape management site hooks are called in this state with a value of TRUE in the
  {     TAPE_VALIDATION_STATE parameter which is passed to each of the site tape validation interfaces.
  {     This is set by specifying a value of TRUE for the VALIDATE_TAPE_ACCESS parameter
  {     on the CHANGE_TAPE_VALIDATION command
  {
  {   Validation Off (bac$tape_validation_off):
  {     Tape management site hooks are called in this state with a value of FALSE in the
  {     TAPE_VALIDATION_STATE parameter which is passed to each of the site tape validation interfaces.
  {     This state is selected by specifying a value of FALSE for the VALIDATE_TAPE_ACCESS parameter
  {     on the CHANGE_TAPE_VALIDATION command.
  {

  VAR
    bav$tape_validation_state: [STATIC, XDCL] bat$tape_validation_state := bac$no_tape_validation;

*copyc bat$tape_validation_state

?? EJECT ??

{
{ This procedure returns the current tape validation state.
{

  PROCEDURE [XDCL, #GATE] bap$fetch_tape_validation_r1 (
    VAR tape_validation_state: bat$tape_validation_state;
    VAR status: ost$status);

    tape_validation_state := bav$tape_validation_state;

  PROCEND bap$fetch_tape_validation_r1;

?? EJECT ??

{
{ This procedure returns the current tape security state.
{

  PROCEDURE [XDCL, #GATE] bap$get_tape_security_state_r1 (
    VAR enforce_tape_security : bat$tape_validation_state);

    enforce_tape_security := bav$enforce_tape_security;

  PROCEND bap$get_tape_security_state_r1;

?? EJECT ??

{
{ This procedure changes tape security state.
{

  PROCEDURE [XDCL, #GATE] bap$put_tape_security_state_r1 (
        enforce_tape_security: bat$tape_validation_state);

    bav$enforce_tape_security := enforce_tape_security;

  PROCEND bap$put_tape_security_state_r1;
?? EJECT ??

{
{ This procedure changes the tape validation state.
{

  PROCEDURE [XDCL, #GATE] bap$store_tape_validation_r1 (
        tape_validation_state: bat$tape_validation_state;
    VAR status: ost$status);

    bav$tape_validation_state := tape_validation_state;

  PROCEND bap$store_tape_validation_r1;

MODEND bam$tape_block_manager_ring1;




