1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 #if !defined(SIM_DISK_H_)
40 # define SIM_DISK_H_ 0
41
42
43
44 typedef uint32 t_seccnt;
45 typedef uint32 t_lba;
46
47
48
49 # define DKUF_V_WLK (UNIT_V_UF + 0)
50 # define DKUF_V_FMT (UNIT_V_UF + 1)
51 # define DKUF_W_FMT 2
52 # define DKUF_N_FMT (1u << DKUF_W_FMT)
53 # define DKUF_M_FMT ((1u << DKUF_W_FMT) - 1)
54 # define DKUF_F_STD 0
55 # define DKUF_V_UF (DKUF_V_FMT + DKUF_W_FMT)
56 # define DKUF_WLK (1u << DKUF_V_WLK)
57 # define DKUF_FMT (DKUF_M_FMT << DKUF_V_FMT)
58 # define DKUF_WRP (DKUF_WLK | UNIT_RO)
59 # define DK_F_STD (DKUF_F_STD << DKUF_V_FMT)
60 # define DK_GET_FMT(u) (((u)->flags >> DKUF_V_FMT) & DKUF_M_FMT)
61
62
63
64 # define DKSE_OK 0
65
66 typedef void (*DISK_PCALLBACK)(UNIT *unit, t_stat status);
67
68
69
70 t_stat sim_disk_attach (UNIT *uptr, const char *cptr, size_t sector_size, size_t xfer_element_size, t_bool dontautosize,
71 uint32 debugbit, const char *drivetype, uint32 pdp11_tracksize, int completion_delay);
72 t_stat sim_disk_detach (UNIT *uptr);
73 t_stat sim_disk_attach_help(FILE *st, DEVICE *dptr, const UNIT *uptr, int32 flag, const char *cptr);
74 t_stat sim_disk_rdsect (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectsread, t_seccnt sects);
75 t_stat sim_disk_rdsect_a (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectsread, t_seccnt sects, DISK_PCALLBACK callback);
76 t_stat sim_disk_wrsect (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectswritten, t_seccnt sects);
77 t_stat sim_disk_wrsect_a (UNIT *uptr, t_lba lba, uint8 *buf, t_seccnt *sectswritten, t_seccnt sects, DISK_PCALLBACK callback);
78 t_stat sim_disk_unload (UNIT *uptr);
79 t_stat sim_disk_set_fmt (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
80 t_stat sim_disk_show_fmt (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
81 t_stat sim_disk_set_capac (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
82 t_stat sim_disk_show_capac (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
83 t_stat sim_disk_reset (UNIT *uptr);
84 t_stat sim_disk_perror (UNIT *uptr, const char *msg);
85 t_stat sim_disk_clearerr (UNIT *uptr);
86 t_bool sim_disk_isavailable (UNIT *uptr);
87 t_bool sim_disk_isavailable_a (UNIT *uptr, DISK_PCALLBACK callback);
88 t_bool sim_disk_wrp (UNIT *uptr);
89 t_offset sim_disk_size (UNIT *uptr);
90 t_bool sim_disk_vhd_support (void);
91 t_bool sim_disk_raw_support (void);
92 void sim_disk_data_trace (UNIT *uptr, const uint8 *data, size_t lba, size_t len, const char* txt, int detail, uint32 reason);
93
94 #endif