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-2024 The DPS8M Development Team
  12  *
  13  * This software is made available under the terms of the ICU License.
  14  * See the LICENSE.md file at the top-level directory of this distribution.
  15  *
  16  * ---------------------------------------------------------------------------
  17  */
  18 
  19 extern DEVICE dsk_dev;
  20 extern UNIT dsk_unit [N_DSK_UNITS_MAX];
  21 
  22 extern DEVICE ipc_dev;
  23 extern UNIT ipc_unit [N_IPC_UNITS_MAX];
  24 
  25 extern DEVICE msp_dev;
  26 extern UNIT msp_unit [N_IPC_UNITS_MAX];
  27 
  28 struct dsk_state
  29   {
  30     uint typeIdx;
  31     enum
  32       {
  33         disk_no_mode, disk_rd_clr_stats, disk_rd_status_reg, disk_rd_config,
  34         disk_rd, disk_seek_512, disk_wr, disk_seek_64, disk_special_seek,
  35         disk_rd_ctrl_reg
  36       } io_mode;
  37     uint tAndDCapac;
  38     bool seekValid; // True if seekPosition contains a valid seek address.
  39     uint seekPosition;
  40     char device_name [MAX_DEV_NAME_LEN];
  41 #if defined(LOCKLESS)
  42     pthread_mutex_t dsk_lock;
  43 #endif
  44   };
  45 
  46 // Disk types
  47 //
  48 //  D500
  49 //  D451
  50 //  D400
  51 //  D190
  52 //  D181
  53 //  D501
  54 //  3380
  55 //  3381
  56 
  57 enum seekSize_t { seek_64, seek_512};
  58 struct diskType_t
  59   {
  60     char * typename;
  61     uint capac;
  62     uint firstDevNumber;
  63     bool removable;
  64     enum seekSize_t seekSize; // false: seek 64  true: seek 512
  65     uint sectorSizeWords;
  66     uint dau_type;
  67   };
  68 extern struct diskType_t diskTypes [];
  69 
  70 struct msp_state_s
  71   {
  72     char device_name [MAX_DEV_NAME_LEN];
  73   };
  74 extern struct msp_state_s msp_states [N_MSP_UNITS_MAX];
  75 
  76 extern struct dsk_state dsk_states [N_DSK_UNITS_MAX];
  77 
  78 void disk_init(void);
  79 t_stat attachDisk (char * label);
  80 iom_cmd_rc_t dsk_iom_cmd (uint iomUnitIdx, uint chan);
  81 t_stat loadDisk (uint dsk_unit_idx, const char * disk_filename, bool ro);
  82 t_stat unloadDisk (uint dsk_unit_idx);
  83 t_stat signal_disk_ready (uint dsk_unit_idx);

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