1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;
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
47
48
49
50
51
52
53
54
55
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;
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);