Skip to content

Commit

Permalink
Miscellaneous tweaks:
Browse files Browse the repository at this point in the history
reverse_bits, tkcount, STRLCPY, RTRIM et al.
Improved w32_basename, w32_dirname.
dlerror() ==> strerror(GetLastError())
arraysize ==> _countof
script runtest timeout duration
BFR_VSNPRINTF: identical for Window/Linux
hdl_setpath: MSVC 'stat' fix
HTML web page consistency
  • Loading branch information
Fish-Git committed May 14, 2017
1 parent eae2a6f commit cdc014a
Show file tree
Hide file tree
Showing 59 changed files with 933 additions and 1,186 deletions.
2 changes: 1 addition & 1 deletion README.WIN64
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ HOW TO COMPILE HERCULES FOR AMD64
Studio since the Hercules provided Visual Studio Solution expects it.


2. Open the "Hercules.sln" Solution file.
2. Open the "Hercules_VS2008.sln" Solution file.


3. Select your desired Solution Configuration (Debug or Release) and
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The Hercules System/370, ESA/390, and z/Architecture Emulator

## The unofficial SoftDevLabs version of Hercules 4.0 (Hyperion)
## The SoftDevLabs version of Hercules 4.0 (Hyperion)

**Hercules** is an open source software implementation of the mainframe
System/370 and ESA/390 architectures, in addition to the latest 64-bit
Expand All @@ -11,10 +11,11 @@ and Mac OS X.
Hercules is [OSI Certified Open Source Software](http://www.opensource.org/)
licensed under the terms of the [Q Public Licence](http://fish-git.github.io/html/herclic.html).

This version of Hercules 4.0 Hyperion is my unofficial development version
This version of Hercules 4.0 Hyperion is a SoftDevLabs development version
of the Hercules emulator and contains bleeding edge changes made by myself
to either fix bugs that may still exist in the official version
or other unofficial (unsanctioned) enhancements
to either fix bugs that may still exist in either the original 4.0 version
of Hercules Hyperion or fixes and/or enhancements to my SoftDevLabs version
of Hercules Hyperion.

Hercules was created by Roger Bowler.
Jay Maynard "the Tron Guy" was the maintainer from 2000 to 2012.
Expand Down
26 changes: 13 additions & 13 deletions SoftFloat/include/softfloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ All such modifications placed in the public domain by Stephen R. Orso
#ifndef softfloat_h
#define softfloat_h 1

#if !defined(false)
#include <stdbool.h>
#if !defined(false)
#include <stdbool.h>
#endif
#if !defined(int32_t)
#include <stdint.h> /* C99 standard integers */
#if !defined(int32_t)
#include <stdint.h> /* C99 standard integers */
#endif

#include "softfloat_types.h"
Expand All @@ -84,7 +84,7 @@ All such modifications placed in the public domain by Stephen R. Orso
defined __ICL || /* ..Intel C or */ \
defined __DMC__ || /* ..Digital Mars C or */ \
defined __BORLANDC__ ) /* ..Borland (Embarcadero) C */
# define SF_THREAD_LOCAL __declspec(thread)
# define SF_THREAD_LOCAL __declspec(thread)

/* note that ICC (linux) and Clang are reportedly covered by __GNUC__ */
# elif defined __GNUC__ || /* ..GNG C or variants or */ \
Expand Down Expand Up @@ -112,7 +112,7 @@ enum {
/*----------------------------------------------------------------------------
| Software floating-point rounding mode.
*----------------------------------------------------------------------------*/
#ifdef IBM_IEEE
#ifdef IBM_IEEE
extern SF_THREAD_LOCAL uint_fast8_t softfloat_roundingMode;
#else
extern uint_fast8_t softfloat_roundingMode;
Expand Down Expand Up @@ -155,23 +155,23 @@ enum {
| trappability is dependent on the caller's state, not Softfloat's, these
| values are generated for every rounding.
|
| The 128-bit rounded significand is stored with the binary point between
| the second and third bits (from the left).
| The 128-bit rounded significand is stored with the binary point between
| the second and third bits (from the left).
|
| -----------------------------------------------
| bit | 0 1 V 2 3 4 5 6 7 8 9 10 11 12 13 14... 127 |
| Place value | 2 1 | fractional portion of significand |
| -----------------------------------------------
|
| Note: place value is one higher than the power of two for that digit position.
| Note: place value is one higher than the power of two for that digit position.
|
| Examples:
| decimal 3 is represented as 11.000000000000000 ... 000
| decimal 1 is represented as 01.000000000000000 ... 000
|
| The exponent bias is reduced by one to account for this; the leftmost digit
| appears only when rounding or arithmetic generate a carry into the 2's
| position.
| appears only when rounding or arithmetic generate a carry into the 2's
| position.
|
| The booleans softfloat_rawInexact and softfloat_rawIncre preserve the
| status of the original result. For non-trap results, the original result
Expand All @@ -184,7 +184,7 @@ enum {
| softfloat_exceptionFlags value that reports tiny because that flag is part
| of the external interface of Softfloat, not part of the internal state.
|
| The routines fxxx_returnScaledResult() uses these values to generate
| The routines fxxx_returnScaledResult() uses these values to generate
| scaled results.
*----------------------------------------------------------------------------*/

Expand Down Expand Up @@ -215,7 +215,7 @@ float128_t f128_scaledResult(int_fast16_t); /* return scaled float128 result
*----------------------------------------------------------------------------*/

/* IBM_IEEE versions of Softfloat do not require function functionality; all
traps are detected and managed by the caller. A macro (above) defines
traps are detected and managed by the caller. A macro (above) defines
the logical or that is at the core of softfloat_raiseFlags() */

#ifndef IBM_IEEE
Expand Down
4 changes: 2 additions & 2 deletions SoftFloat/include/softfloat_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef softfloat_types_h
#define softfloat_types_h 1

#if !defined(int32_t)
#include <stdint.h> /* C99 standard integers */
#if !defined(int32_t)
#include <stdint.h> /* C99 standard integers */
#endif

/*----------------------------------------------------------------------------
Expand Down
67 changes: 67 additions & 0 deletions _TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,70 @@
but having it opens other interesting possibilities)

-------------------------------------------------------------------------------
qeth.c (my CTCI-WIN "SETVMAC" fix):



case IPA_CMD_SETVMAC: /* 0x25 */
{
MPC_IPA_MAC *ipa_mac = (MPC_IPA_MAC*)(ipa+1);
char tthwaddr[32] = {0}; // 11:22:33:44:55:66
#if defined(OPTION_W32_CTCI) // WE SHOULD NOT CHANGE THE MAC OF THE TUN
int flags, rc = 0;
#endif /*defined(OPTION_W32_CTCI)*/
MSGBUF( tthwaddr, "%02X:%02X:%02X:%02X:%02X:%02X"
,ipa_mac->macaddr[0]
,ipa_mac->macaddr[1]
,ipa_mac->macaddr[2]
,ipa_mac->macaddr[3]
,ipa_mac->macaddr[4]
,ipa_mac->macaddr[5]
);
DBGTRC(dev, " IPA_CMD_SETVMAC: ifname=%s hwaddr=%s\n",
grp->ttifname, tthwaddr );

#if defined(OPTION_W32_CTCI) // WE SHOULD NOT CHANGE THE MAC OF THE TUN
/*
** If the interface is already enabled/up we need to
** temporarily bring it down (disable it) so we can
** change the MAC address and then afterwards bring
** it back up again (enable it).
*/
VERIFY( TUNTAP_GetFlags( grp->ttifname, &flags ) == 0 );

if (flags & IFF_UP)
VERIFY( qeth_disable_interface( dev, grp ) == 0);

rc = TUNTAP_SetMACAddr( grp->ttifname, tthwaddr );

if (flags & IFF_UP)
VERIFY( qeth_enable_interface( dev, grp ) == 0);

if (rc != 0)
{
char msgbuf[256];
MSGBUF( msgbuf,
"IPA_CMD_SETVMAC: TUNTAP_SetMACAddr(%s,%s) failed",
grp->ttifname, tthwaddr );
qeth_errnum_msg( dev, grp, rc, "E", msgbuf );
STORE_HW(ipa->rc,IPA_RC_FFFF);
}
else
{
if (grp->tthwaddr)
free( grp->tthwaddr );
grp->tthwaddr = strdup( tthwaddr );
memcpy( grp->iMAC, ipa_mac->macaddr, IFHWADDRLEN );
#else /*defined(OPTION_W32_CTCI)*/
{
#endif /*defined(OPTION_W32_CTCI)*/
if (register_mac(ipa_mac->macaddr,MAC_TYPE_UNICST,grp))
STORE_HW(ipa->rc,IPA_RC_OK);
else
STORE_HW(ipa->rc,IPA_RC_L2_DUP_MAC);
}
}
break;


-------------------------------------------------------------------------------
4 changes: 2 additions & 2 deletions _dynamic_version.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@
if not defined VERS_BLD set "VERS_BLD=0"

::--------------------------------------------------------------
:: Make it PAINFULLY CLEAR this is an UNOFFICIAL "SDL" version
:: of 4.0 Hyperion and not an "Official" 4.0 Hyperion version
:: Make it PAINFULLY CLEAR this is a *SOFTDEVLABS* version
:: of 4.0 Hyperion and not the original 4.0 Hyperion version,
:: by appending the string "-SDL" to the end of the "VERSION".
::--------------------------------------------------------------

Expand Down
34 changes: 28 additions & 6 deletions cckddasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5404,7 +5404,7 @@ void cckd_command_help()
, " trace=<n> Set trace table size (0 ... 200000)"
, " wr=<n> Set number writer threads ( 1 ... 9)"

, NULL
, NULL
};

for (i=0; help[i] != NULL; i++ )
Expand Down Expand Up @@ -5560,22 +5560,27 @@ int rc;
/* If p == NULL, then just keyword syntax (no "=value") */
if (!p)
{
/* Parse the keyword */
/* Parse the keyword... */

// Display cckd help
if ( CMD(kw,help,4 ) )
{
if (!cmd) return 0;
cckd_command_help();
}
// Display current cckd statistics
else if ( CMD(kw,stats,4) )
{
if (!cmd) return 0;
cckd_command_stats ();
}
// Display current cckd options
else if ( CMD(kw,opts,4) )
{
if (!cmd) return 0;
cckd_command_opts();
}
// Enable CCKD debugging
else if ( CMD(kw,debug,5) )
{
if (!cmd) return 0;
Expand All @@ -5601,6 +5606,8 @@ int rc;
}
/* If rc == 1 && c == 0, then "keyword=value" syntax */
/* Please keep the below tests in alphabetical order! */

// Compression to be used
else if ( CMD(kw,comp,4) )
{
if (val < -1 || (val > 0 && (val & ~cckdblk.comps)))
Expand All @@ -5624,6 +5631,7 @@ int rc;
return -1;
}
}
// Compression parameter to be used
else if ( CMD(kw,compparm,8) )
{
if (val < -1 || val > 9)
Expand All @@ -5638,6 +5646,7 @@ int rc;
opts = 1;
}
}
// Set the free pending value
else if ( CMD(kw,freepend,8) )
{
if (val < -1 || val > CCKD_MAX_FREEPEND)
Expand All @@ -5652,6 +5661,7 @@ int rc;
opts = 1;
}
}
// Turn fsync on or off
else if ( CMD(kw,fsync,5) )
{
if (val < 0 || val > 1)
Expand All @@ -5666,6 +5676,7 @@ int rc;
opts = 1;
}
}
// Garbage collection interval
else if ( CMD(kw,gcint,5) )
{
if (val < 1 || val > 60)
Expand All @@ -5680,6 +5691,7 @@ int rc;
opts = 1;
}
}
// Garbage collection parameter
else if ( CMD(kw,gcparm,6) )
{
if (val < -8 || val > 8)
Expand All @@ -5694,6 +5706,7 @@ int rc;
opts = 1;
}
}
// Start garbage collector
else if ( CMD(kw,gcstart,7) )
{
if (val < 0 || val > 1)
Expand Down Expand Up @@ -5753,6 +5766,7 @@ int rc;
}
}
}
// Check for null linux tracks
else if ( CMD(kw,linuxnull,5) )
{
if (val < 0 || val > 1)
Expand All @@ -5767,7 +5781,8 @@ int rc;
opts = 1;
}
}
else if ( CMD(kw,nostress,8) )
// Turn off stats report at close
else if ( CMD(kw,nosfd,5) )
{
if (val < 0 || val > 1)
{
Expand All @@ -5777,11 +5792,12 @@ int rc;
}
else
{
cckdblk.nostress = val;
cckdblk.nosfd = val;
opts = 1;
}
}
else if ( CMD(kw,nosfd,5) )
// Turn stress writes on or off
else if ( CMD(kw,nostress,8) )
{
if (val < 0 || val > 1)
{
Expand All @@ -5791,10 +5807,11 @@ int rc;
}
else
{
cckdblk.nosfd = val;
cckdblk.nostress = val;
opts = 1;
}
}
// Number readahead threads
else if ( CMD(kw,ra,2) )
{
if (val < CCKD_MIN_RA || val > CCKD_MAX_RA)
Expand All @@ -5809,6 +5826,7 @@ int rc;
opts = 1;
}
}
// Readahead queue size
else if ( CMD(kw,raq,3) )
{
if (val < 0 || val > CCKD_MAX_RA_SIZE)
Expand All @@ -5823,6 +5841,7 @@ int rc;
opts = 1;
}
}
// Number of tracks to readahead
else if ( CMD(kw,rat,3) )
{
if (val < 0 || val > CCKD_MAX_RA_SIZE)
Expand All @@ -5837,6 +5856,7 @@ int rc;
opts = 1;
}
}
// Number of trace table entries
else if ( CMD(kw,trace,5) )
{
if (val < 0 || val > CCKD_MAX_TRACE)
Expand Down Expand Up @@ -5880,6 +5900,7 @@ int rc;
opts = 1;
}
}
// Number writer threads
else if ( CMD(kw,wr,2) )
{
if (val < CCKD_MIN_WRITER || val > CCKD_MAX_WRITER)
Expand All @@ -5894,6 +5915,7 @@ int rc;
opts = 1;
}
}
// Unknown option
else
{
// "CCKD file: invalid cckd keyword: %s"
Expand Down
2 changes: 1 addition & 1 deletion cmdtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ void *panel_command (void *cmdline)
/* Every command will be stored in history list,
EXCEPT: null commands, script commands, scp input,
and "silent" commands (prefixed with '-') */
if (*pCmdLine != 0 && !FindSCRCTL(thread_id()))
if (*pCmdLine != 0 && !FindSCRCTL( thread_id() ))
{
if (!(*pCmdLine == '-')) /* (normal command?) */
{
Expand Down
Loading

0 comments on commit cdc014a

Please sign in to comment.