1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
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
50
51
52
53
54
55
56
57
58
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;
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);