mirror of
https://github.com/rcornwell/sims.git
synced 2026-04-28 20:59:01 +00:00
SCP: Updated top level to current.
This commit is contained in:
33
sim_disk.c
33
sim_disk.c
@@ -51,6 +51,7 @@ Public routines:
|
||||
sim_disk_set_async enable asynchronous operation
|
||||
sim_disk_clr_async disable asynchronous operation
|
||||
sim_disk_data_trace debug support
|
||||
sim_disk_test unit test routine
|
||||
|
||||
Internal routines:
|
||||
|
||||
@@ -216,7 +217,7 @@ static void _disk_completion_dispatch (UNIT *uptr)
|
||||
struct disk_context *ctx = (struct disk_context *)uptr->disk_ctx;
|
||||
DISK_PCALLBACK callback = ctx->callback;
|
||||
|
||||
sim_debug_unit (ctx->dbit, uptr, "_disk_completion_dispatch(unit=%d, dop=%d, callback=%p)\n", (int)(uptr-ctx->dptr->units), ctx->io_dop, ctx->callback);
|
||||
sim_debug_unit (ctx->dbit, uptr, "_disk_completion_dispatch(unit=%d, dop=%d, callback=%p)\n", (int)(uptr-ctx->dptr->units), ctx->io_dop, (void *)(ctx->callback));
|
||||
|
||||
if (ctx->io_dop != DOP_DONE)
|
||||
abort(); /* horribly wrong, stop */
|
||||
@@ -301,7 +302,7 @@ static struct sim_disk_fmt fmts[] = {
|
||||
{ "SIMH", 0, DKUF_F_STD, NULL},
|
||||
{ "RAW", 0, DKUF_F_RAW, sim_os_disk_implemented_raw},
|
||||
{ "VHD", 0, DKUF_F_VHD, sim_vhd_disk_implemented},
|
||||
{ NULL, 0, 0}
|
||||
{ NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
/* Set disk format */
|
||||
@@ -1095,7 +1096,6 @@ static uint16
|
||||
ODSChecksum (void *Buffer, uint16 WordCount)
|
||||
{
|
||||
int i;
|
||||
uint16 Sum = 0;
|
||||
uint16 CheckSum = 0;
|
||||
uint16 *Buf = (uint16 *)Buffer;
|
||||
|
||||
@@ -1177,12 +1177,10 @@ if ((Scb.scb_w_cluster != Home.hm2_w_cluster) ||
|
||||
(Scb.scb_b_strucver != Home.hm2_b_strucver) ||
|
||||
(Scb.scb_b_struclev != Home.hm2_b_struclev))
|
||||
goto Return_Cleanup;
|
||||
if (!sim_quiet) {
|
||||
sim_printf ("%s%d: '%s' Contains ODS%d File system\n", sim_dname (dptr), (int)(uptr-dptr->units), uptr->filename, Home.hm2_b_struclev);
|
||||
sim_printf ("%s%d: Volume Name: %12.12s ", sim_dname (dptr), (int)(uptr-dptr->units), Home.hm2_t_volname);
|
||||
sim_printf ("Format: %12.12s ", Home.hm2_t_format);
|
||||
sim_printf ("Sectors In Volume: %u\n", Scb.scb_l_volsize);
|
||||
}
|
||||
sim_messagef (SCPE_OK, "%s%d: '%s' Contains ODS%d File system\n", sim_dname (dptr), (int)(uptr-dptr->units), uptr->filename, Home.hm2_b_struclev);
|
||||
sim_messagef (SCPE_OK, "%s%d: Volume Name: %12.12s ", sim_dname (dptr), (int)(uptr-dptr->units), Home.hm2_t_volname);
|
||||
sim_messagef (SCPE_OK, "Format: %12.12s ", Home.hm2_t_format);
|
||||
sim_messagef (SCPE_OK, "Sectors In Volume: %u\n", Scb.scb_l_volsize);
|
||||
ret_val = ((t_offset)Scb.scb_l_volsize) * 512;
|
||||
|
||||
Return_Cleanup:
|
||||
@@ -1996,7 +1994,7 @@ if (!(uptr->flags & UNIT_ATT)) /* attached? */
|
||||
sim_debug_unit (ctx->dbit, uptr, "sim_disk_reset(unit=%d)\n", (int)(uptr-ctx->dptr->units));
|
||||
|
||||
_sim_disk_io_flush(uptr);
|
||||
AIO_VALIDATE;
|
||||
AIO_VALIDATE(uptr);
|
||||
AIO_UPDATE_QUEUE;
|
||||
return SCPE_OK;
|
||||
}
|
||||
@@ -2107,7 +2105,7 @@ for (i = 0; (stat == SCPE_OK) && (i < sec) && (i < 10); i++, da += wds)
|
||||
stat = SCPE_IOERR;
|
||||
break;
|
||||
}
|
||||
if (wds != sim_fwrite (buf, sizeof (uint16), wds, uptr->fileref))
|
||||
if ((size_t)wds != sim_fwrite (buf, sizeof (uint16), wds, uptr->fileref))
|
||||
stat = SCPE_IOERR;
|
||||
}
|
||||
free (buf);
|
||||
@@ -3884,10 +3882,10 @@ void *handle;
|
||||
handle = dlopen("libuuid." S__STR(HAVE_DLOPEN), RTLD_NOW|RTLD_GLOBAL);
|
||||
if (handle)
|
||||
uuid_generate_c = (void (*)(void *))((size_t)dlsym(handle, "uuid_generate"));
|
||||
if (uuid_generate_c)
|
||||
uuid_generate_c(uuidaddr);
|
||||
else
|
||||
_rand_uuid_gen (uuidaddr);
|
||||
if (uuid_generate_c)
|
||||
uuid_generate_c(uuidaddr);
|
||||
else
|
||||
_rand_uuid_gen (uuidaddr);
|
||||
if (handle)
|
||||
dlclose(handle);
|
||||
}
|
||||
@@ -4663,3 +4661,8 @@ struct disk_context *ctx = (struct disk_context *)uptr->disk_ctx;
|
||||
return WriteVirtualDiskSectors(hVHD, buf, sects, sectswritten, ctx->sector_size, lba);
|
||||
}
|
||||
#endif
|
||||
|
||||
t_stat sim_disk_test (DEVICE *dptr)
|
||||
{
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user