root/src/dps8/dps8_disk.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * vim: filetype=c:tabstop=4:ai:expandtab
   3  * SPDX-License-Identifier: ICU
   4  * scspell-id: 26ac6f06-f62e-11ec-ab75-80ee73e9b8e7
   5  *
   6  * ---------------------------------------------------------------------------
   7  *
   8  * Copyright (c) 2007-2013 Michael Mondy
   9  * Copyright (c) 2012-2016 Harry Reed
  10  * Copyright (c) 2013-2016 Charles Anthony
  11  * Copyright (c) 2021-2023 The DPS8M Development Team
  12  *
  13  * All rights reserved.
  14  *
  15  * This software is made available under the terms of the ICU
  16  * License, version 1.8.1 or later.  For more details, see the
  17  * LICENSE.md file at the top-level directory of this distribution.
  18  *
  19  * ---------------------------------------------------------------------------
  20  */
  21 
  22 extern DEVICE dsk_dev;
  23 extern UNIT dsk_unit [N_DSK_UNITS_MAX];
  24 
  25 extern DEVICE ipc_dev;
  26 extern UNIT ipc_unit [N_IPC_UNITS_MAX];
  27 
  28 extern DEVICE msp_dev;
  29 extern UNIT msp_unit [N_IPC_UNITS_MAX];
  30 
  31 struct dsk_state
  32   {
  33     uint typeIdx;
  34     enum
  35       {
  36         disk_no_mode, disk_rd_clr_stats, disk_rd_status_reg, disk_rd_config,
  37         disk_rd, disk_seek_512, disk_wr, disk_seek_64, disk_special_seek,
  38         disk_rd_ctrl_reg
  39       } io_mode;
  40     uint tAndDCapac;
  41     bool seekValid; // True if seekPosition contains a valid seek address.
  42     uint seekPosition;
  43     char device_name [MAX_DEV_NAME_LEN];
  44 #ifdef LOCKLESS
  45     pthread_mutex_t dsk_lock;
  46 #endif
  47   };
  48 
  49 // Disk types
  50 //
  51 //  D500
  52 //  D451
  53 //  D400
  54 //  D190
  55 //  D181
  56 //  D501
  57 //  3380
  58 //  3381
  59 
  60 enum seekSize_t { seek_64, seek_512};
  61 struct diskType_t
  62   {
  63     char * typename;
  64     uint capac;
  65     uint firstDevNumber;
  66     bool removable;
  67     enum seekSize_t seekSize; // false: seek 64  true: seek 512
  68     uint sectorSizeWords;
  69     uint dau_type;
  70   };
  71 extern struct diskType_t diskTypes [];
  72 
  73 struct msp_state_s
  74   {
  75     char device_name [MAX_DEV_NAME_LEN];
  76   };
  77 extern struct msp_state_s msp_states [N_MSP_UNITS_MAX];
  78 
  79 extern struct dsk_state dsk_states [N_DSK_UNITS_MAX];
  80 
  81 void disk_init(void);
  82 t_stat attachDisk (char * label);
  83 iom_cmd_rc_t dsk_iom_cmd (uint iomUnitIdx, uint chan);
  84 t_stat loadDisk (uint dsk_unit_idx, const char * disk_filename, bool ro);
  85 t_stat unloadDisk (uint dsk_unit_idx);
  86 t_stat signal_disk_ready (uint dsk_unit_idx);

/* [previous][next][first][last][top][bottom][index][help] */