28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: diskimage.h,v 1.34 2006/12/30 13:31:00 debug Exp $ |
* $Id: diskimage.h,v 1.36 2007/03/24 06:39:29 debug Exp $ |
32 |
* |
* |
33 |
* Generic disk image functions. (See diskimage.c for more info.) |
* Generic disk image functions. (See diskimage.c for more info.) |
34 |
*/ |
*/ |
45 |
|
|
46 |
#define DISKIMAGE_TYPES { "(NONE)", "SCSI", "IDE", "FLOPPY" } |
#define DISKIMAGE_TYPES { "(NONE)", "SCSI", "IDE", "FLOPPY" } |
47 |
|
|
48 |
|
|
49 |
|
/* 512 bytes per overlay block. Don't change this. */ |
50 |
|
#define OVERLAY_BLOCK_SIZE 512 |
51 |
|
|
52 |
|
struct diskimage_overlay { |
53 |
|
char *overlay_basename; |
54 |
|
FILE *f_data; |
55 |
|
FILE *f_bitmap; |
56 |
|
}; |
57 |
|
|
58 |
struct diskimage { |
struct diskimage { |
59 |
struct diskimage *next; |
struct diskimage *next; |
60 |
int type; /* DISKIMAGE_SCSI, etc */ |
int type; /* DISKIMAGE_SCSI, etc */ |
61 |
int id; /* SCSI id */ |
int id; /* SCSI id */ |
62 |
|
|
63 |
|
/* Filename in host's file system: */ |
64 |
char *fname; |
char *fname; |
65 |
FILE *f; |
FILE *f; |
66 |
|
|
67 |
|
/* Overlays: */ |
68 |
|
int nr_of_overlays; |
69 |
|
struct diskimage_overlay *overlays; |
70 |
|
|
71 |
int chs_override; |
int chs_override; |
72 |
int cylinders; |
int cylinders; |
73 |
int heads; |
int heads; |
119 |
|
|
120 |
struct machine; |
struct machine; |
121 |
|
|
122 |
|
|
123 |
|
/* diskimage_scsicmd.c: */ |
124 |
struct scsi_transfer *scsi_transfer_alloc(void); |
struct scsi_transfer *scsi_transfer_alloc(void); |
125 |
void scsi_transfer_free(struct scsi_transfer *); |
void scsi_transfer_free(struct scsi_transfer *); |
126 |
void scsi_transfer_allocbuf(size_t *lenp, unsigned char **pp, |
void scsi_transfer_allocbuf(size_t *lenp, unsigned char **pp, |
127 |
size_t want_len, int clearflag); |
size_t want_len, int clearflag); |
128 |
|
int diskimage_scsicommand(struct cpu *cpu, int id, int type, |
129 |
|
struct scsi_transfer *); |
130 |
|
|
131 |
|
|
132 |
|
/* diskimage.c: */ |
133 |
int64_t diskimage_getsize(struct machine *machine, int id, int type); |
int64_t diskimage_getsize(struct machine *machine, int id, int type); |
134 |
int64_t diskimage_get_baseoffset(struct machine *machine, int id, int type); |
int64_t diskimage_get_baseoffset(struct machine *machine, int id, int type); |
135 |
void diskimage_getchs(struct machine *machine, int id, int type, |
void diskimage_getchs(struct machine *machine, int id, int type, |
136 |
int *c, int *h, int *s); |
int *c, int *h, int *s); |
137 |
int diskimage_scsicommand(struct cpu *cpu, int id, int type, |
int diskimage__internal_access(struct diskimage *d, int writeflag, |
138 |
struct scsi_transfer *); |
off_t offset, unsigned char *buf, size_t len); |
139 |
int diskimage_access(struct machine *machine, int id, int type, int writeflag, |
int diskimage_access(struct machine *machine, int id, int type, int writeflag, |
140 |
off_t offset, unsigned char *buf, size_t len); |
off_t offset, unsigned char *buf, size_t len); |
141 |
|
void diskimage_add_overlay(struct diskimage *d, char *overlay_basename); |
142 |
|
void diskimage_recalc_size(struct diskimage *d); |
143 |
int diskimage_exist(struct machine *machine, int id, int type); |
int diskimage_exist(struct machine *machine, int id, int type); |
144 |
int diskimage_bootdev(struct machine *machine, int *typep); |
int diskimage_bootdev(struct machine *machine, int *typep); |
145 |
int diskimage_add(struct machine *machine, char *fname); |
int diskimage_add(struct machine *machine, char *fname); |
149 |
int diskimage_is_a_tape(struct machine *machine, int id, int type); |
int diskimage_is_a_tape(struct machine *machine, int id, int type); |
150 |
void diskimage_dump_info(struct machine *machine); |
void diskimage_dump_info(struct machine *machine); |
151 |
|
|
152 |
|
|
153 |
/* |
/* |
154 |
* SCSI commands: |
* SCSI commands: |
155 |
*/ |
*/ |