Merge remote-tracking branch 'origin/master' into Extra-VAXen

This commit is contained in:
Mark Pizzolato 2012-02-02 08:24:09 -08:00
commit 30ef557968
9 changed files with 34 additions and 22 deletions

View file

@ -1924,7 +1924,7 @@ if (err != 0) { /* error? */
if (rq_dte (cp, uptr, ST_DRV)) /* post err log */
rq_rw_end (cp, uptr, EF_LOG, ST_DRV); /* if ok, report err */
perror ("RQ I/O error");
if (!(uptr->flags | UNIT_RAW))
if (!(uptr->flags & UNIT_RAW))
clearerr (uptr->fileref);
return SCPE_IOERR;
}

View file

@ -327,7 +327,7 @@ REG clk_reg[] = {
DEVICE clk_dev = {
"TODR", &clk_unit, clk_reg, NULL,
1, 0, 8, 1, 0, 0,
1, 0, 8, 4, 0, 32,
NULL, NULL, &clk_reset,
NULL, &clk_attach, &clk_detach,
NULL, 0

View file

@ -101,8 +101,6 @@ int32 clk_tps = 100; /* ticks/second */
int32 todr_reg = 0; /* TODR register */
int32 todr_blow = 1; /* TODR battery low */
struct todr_battery_info {
char toy_gmtbase_a[16]; /* Platform independent Text format of toy_gmtbase */
char toy_gmtbasemsec_a[16]; /* Platform independent Text format of toy_gmtbasemsec */
uint32 toy_gmtbase; /* GMT base of set value */
uint32 toy_gmtbasemsec; /* The milliseconds of the set value */
};
@ -234,7 +232,7 @@ MTAB clk_mod[] = {
DEVICE clk_dev = {
"CLK", &clk_unit, clk_reg, clk_mod,
1, 0, 8, 1, 0, 0,
1, 0, 8, 4, 0, 32,
NULL, NULL, &clk_reset,
NULL, &clk_attach, &clk_detach,
&clk_dib, 0
@ -429,8 +427,6 @@ if (0 == todr_reg) /* clock running? */
#define TOY_MAX_SECS (0x40000000/25)
clock_gettime(CLOCK_REALTIME, &now); /* get curr time */
toy->toy_gmtbase = strtoul(toy->toy_gmtbase_a, NULL, 0);
toy->toy_gmtbasemsec = strtoul(toy->toy_gmtbasemsec_a, NULL, 0);
base.tv_sec = toy->toy_gmtbase;
base.tv_nsec = toy->toy_gmtbasemsec * 1000000;
sim_timespec_diff (&val, &now, &base);
@ -457,8 +453,6 @@ val.tv_nsec = (((uint32)data) % 100) * 10000000;
sim_timespec_diff (&base, &now, &val); /* base = now - data */
toy->toy_gmtbase = (uint32)base.tv_sec;
toy->toy_gmtbasemsec = base.tv_nsec/1000000;
sprintf(toy->toy_gmtbase_a, "0x%08X", toy->toy_gmtbase);
sprintf(toy->toy_gmtbasemsec_a, "0x%08X", toy->toy_gmtbasemsec);
todr_reg = data;
if (data)
todr_blow = 0;

View file

@ -26,6 +26,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Check for required build dependencies"
CommandLine="if not exist ../../windows-build/winpcap/Wpdpack/Include/pcap.h goto _notice&#x0D;&#x0A;if not exist ../../windows-build/pthreads/pthread.h goto _notice&#x0D;&#x0A;goto _good&#x0D;&#x0A;&#x0D;&#x0A;:_notice&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ** The required build support is not available. **&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;type 0ReadMe_Projects.txt&#x0D;&#x0A;exit 1&#x0D;&#x0A;&#x0D;&#x0A;:_good&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@ -106,6 +108,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Check for required build dependencies"
CommandLine="if not exist ../../windows-build/winpcap/Wpdpack/Include/pcap.h goto _notice&#x0D;&#x0A;if not exist ../../windows-build/pthreads/pthread.h goto _notice&#x0D;&#x0A;goto _good&#x0D;&#x0A;&#x0D;&#x0A;:_notice&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ** The required build support is not available. **&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;type 0ReadMe_Projects.txt&#x0D;&#x0A;exit 1&#x0D;&#x0A;&#x0D;&#x0A;:_good&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"

View file

@ -26,8 +26,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Build Dependent ROM include File(s)"
CommandLine="pushd ..&#x0D;&#x0A;$(TargetDir)BuildROMs&#x0D;&#x0A;popd&#x0D;&#x0A;"
Description="Build Dependent ROM include File(s) &amp; Check for required build dependencies"
CommandLine="pushd ..&#x0D;&#x0A;$(TargetDir)BuildROMs&#x0D;&#x0A;popd&#x0D;&#x0A;&#x0D;&#x0A;if not exist ../../windows-build/winpcap/Wpdpack/Include/pcap.h goto _notice&#x0D;&#x0A;if not exist ../../windows-build/pthreads/pthread.h goto _notice&#x0D;&#x0A;goto _good&#x0D;&#x0A;&#x0D;&#x0A;:_notice&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ** The required build support is not available. **&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;type 0ReadMe_Projects.txt&#x0D;&#x0A;exit 1&#x0D;&#x0A;&#x0D;&#x0A;:_good&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@ -112,8 +112,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Build Dependent ROM include File(s)"
CommandLine="pushd ..&#x0D;&#x0A;$(TargetDir)BuildROMs&#x0D;&#x0A;popd&#x0D;&#x0A;"
Description="Build Dependent ROM include File(s) &amp; Check for required build dependencies"
CommandLine="pushd ..&#x0D;&#x0A;$(TargetDir)BuildROMs&#x0D;&#x0A;popd&#x0D;&#x0A;&#x0D;&#x0A;if not exist ../../windows-build/winpcap/Wpdpack/Include/pcap.h goto _notice&#x0D;&#x0A;if not exist ../../windows-build/pthreads/pthread.h goto _notice&#x0D;&#x0A;goto _good&#x0D;&#x0A;&#x0D;&#x0A;:_notice&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ** The required build support is not available. **&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;type 0ReadMe_Projects.txt&#x0D;&#x0A;exit 1&#x0D;&#x0A;&#x0D;&#x0A;:_good&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"

View file

@ -26,8 +26,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Build Dependent ROM include File(s)"
CommandLine="pushd ..&#x0D;&#x0A;$(TargetDir)BuildROMs&#x0D;&#x0A;popd&#x0D;&#x0A;"
Description="Build Dependent ROM include File(s) &amp; Check for required build dependencies"
CommandLine="pushd ..&#x0D;&#x0A;$(TargetDir)BuildROMs&#x0D;&#x0A;popd&#x0D;&#x0A;&#x0D;&#x0A;if not exist ../../windows-build/winpcap/Wpdpack/Include/pcap.h goto _notice&#x0D;&#x0A;if not exist ../../windows-build/pthreads/pthread.h goto _notice&#x0D;&#x0A;goto _good&#x0D;&#x0A;&#x0D;&#x0A;:_notice&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ** The required build support is not available. **&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;type 0ReadMe_Projects.txt&#x0D;&#x0A;exit 1&#x0D;&#x0A;&#x0D;&#x0A;:_good&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@ -111,8 +111,8 @@
>
<Tool
Name="VCPreBuildEventTool"
Description="Build Dependent ROM include File(s)"
CommandLine="pushd ..&#x0D;&#x0A;$(TargetDir)BuildROMs&#x0D;&#x0A;popd&#x0D;&#x0A;"
Description="Build Dependent ROM include File(s) &amp; Check for required build dependencies"
CommandLine="pushd ..&#x0D;&#x0A;$(TargetDir)BuildROMs&#x0D;&#x0A;popd&#x0D;&#x0A;&#x0D;&#x0A;if not exist ../../windows-build/winpcap/Wpdpack/Include/pcap.h goto _notice&#x0D;&#x0A;if not exist ../../windows-build/pthreads/pthread.h goto _notice&#x0D;&#x0A;goto _good&#x0D;&#x0A;&#x0D;&#x0A;:_notice&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ** The required build support is not available. **&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;echo ****************************************************&#x0D;&#x0A;type 0ReadMe_Projects.txt&#x0D;&#x0A;exit 1&#x0D;&#x0A;&#x0D;&#x0A;:_good&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"

12
scp.c
View file

@ -2725,8 +2725,18 @@ for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { /* loop thru devices */
WRITE_I (uptr->u6);
WRITE_I (uptr->flags); /* [V2.10] flags */
WRITE_I (uptr->capac); /* [V3.5] capacity */
if (uptr->flags & UNIT_ATT)
if (uptr->flags & UNIT_ATT) {
fputs (uptr->filename, sfile);
if ((uptr->flags & UNIT_BUF) && /* writable buffered */
uptr->hwmark && /* files need to be */
((uptr->flags & UNIT_RO) == 0)) { /* written on save */
uint32 cap = (uptr->hwmark + dptr->aincr - 1) / dptr->aincr;
rewind (uptr->fileref);
sim_fwrite (uptr->filebuf, SZ_D (dptr), cap, uptr->fileref);
fclose (uptr->fileref); /* flush data and state */
uptr->fileref = sim_fopen (uptr->filename, "rb+");/* reopen r/w */
}
}
fputc ('\n', sfile);
if (((uptr->flags & (UNIT_FIX + UNIT_ATTABLE)) == UNIT_FIX) &&
(dptr->examine != NULL) &&

View file

@ -2660,7 +2660,7 @@ VHD_DynamicDiskHeader Dynamic;
uint32 *BAT = NULL;
time_t now;
uint32 i;
FILE *File;
FILE *File = NULL;
uint32 Status = 0;
uint32 BytesPerSector = 512;
uint64 SizeInBytes = ((uint64)SizeInSectors)*BytesPerSector;
@ -2833,7 +2833,7 @@ CreateDifferencingVirtualDisk(const char *szVHDPath,
const char *szParentVHDPath)
{
uint32 BytesPerSector = 512;
VHDHANDLE hVHD;
VHDHANDLE hVHD = NULL;
VHD_Footer ParentFooter;
VHD_DynamicDiskHeader ParentDynamic;
uint32 ParentTimeStamp;

View file

@ -57,7 +57,6 @@
#include "sim_defs.h"
static unsigned char sim_flip[FLIP_SIZE];
int32 sim_end = 1; /* 1 = little */
/* OS-independent, endian independent binary I/O package
@ -141,11 +140,13 @@ size_t sim_fwrite (void *bptr, size_t size, size_t count, FILE *fptr)
size_t c, nelem, nbuf, lcnt, total;
int32 i;
unsigned char *sptr;
unsigned char *sim_flip;
if ((size == 0) || (count == 0)) /* check arguments */
return 0;
if (sim_end || (size == sizeof (char))) /* le or byte? */
return fwrite (bptr, size, count, fptr); /* done */
sim_flip = (unsigned char *)malloc(FLIP_SIZE);
nelem = FLIP_SIZE / size; /* elements in buffer */
nbuf = count / nelem; /* number buffers */
lcnt = count % nelem; /* count in last buf */
@ -158,10 +159,13 @@ for (i = (int32)nbuf; i > 0; i--) { /* loop on buffers */
sim_buf_copy_swapped (sim_flip, sptr, size, c);
sptr = sptr + size * count;
c = fwrite (sim_flip, size, c, fptr);
if (c == 0)
if (c == 0) {
free(sim_flip);
return total;
}
total = total + c;
}
free(sim_flip);
return total;
}