Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCP: Fix scp_asynch_check cross-thread interference #333

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis/deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
install_osx() {
brew update
brew install pkg-config pcre libpng libedit sdl2 freetype2 sdl2_ttf \
vde cmake gnu-getopt coreutils
vde cmake gnu-getopt coreutils zlib
}

install_arch_linux() {
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ option(SIMH_PACKAGE_SUFFIX
option(MAC_UNIVERSAL
"macOS universal binary flag: TRUE -> build universal binaries, FALSE -> don't."
${MAC_UNIVERSAL_OPTVAL})
option(DONT_USE_AIO_INTRINSICS
"Don't use compiler/platform intrinsics for AIO, revert to lock-based AIO"
FALSE)

# Places where CMake should look for dependent package configuration fragments and artifacts:
set(SIMH_PREFIX_PATH_LIST)
Expand Down
9 changes: 7 additions & 2 deletions Ibm1130/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ add_simulator(ibm1130
ibm1130_t2741.c
INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}
TEST_ARGS "-g"
LABEL Ibm1130
PKG_FAMILY ibm_family
TEST ibm1130)

if (WIN32)
## Add GUI support, compile in resources:
target_compile_definitions(ibm1130 PRIVATE GUI_SUPPORT)
## missing source in IBM1130? ## target_sources(ibm1130 PRIVATE ibm1130.c)
endif()
target_sources(ibm1130 PRIVATE ibm1130.rc)
endif()

# IBM 1130 utilities:
# add_subdirectory(utils)
4 changes: 4 additions & 0 deletions PDP10/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ add_simulator(pdp10-ka
FEATURE_INT64
FEATURE_VIDEO
FEATURE_DISPLAY
USES_AIO
LABEL PDP10
PKG_FAMILY pdp10_family
TEST ka10)
Expand Down Expand Up @@ -161,6 +162,7 @@ add_simulator(pdp10-ki
FEATURE_INT64
FEATURE_VIDEO
FEATURE_DISPLAY
USES_AIO
LABEL PDP10
PKG_FAMILY pdp10_family
TEST ki10)
Expand Down Expand Up @@ -193,6 +195,7 @@ add_simulator(pdp10-kl
DEFINES
KL=1
FEATURE_INT64
USES_AIO
LABEL PDP10
PKG_FAMILY pdp10_family
TEST kl10)
Expand Down Expand Up @@ -220,6 +223,7 @@ add_simulator(pdp10-ks
DEFINES
KS=1
FEATURE_INT64
USES_AIO
LABEL PDP10
PKG_FAMILY pdp10_family
TEST ks10)
Expand Down
46 changes: 28 additions & 18 deletions README-CMake.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,25 +511,22 @@ or video support.

# List the supported command line flags:
$ cmake/cmake-builder.sh --help
Configure and build simh simulators on Linux and *nix-like platforms.
** cmake version 3.18.4

Subdirectories:
cmake/build-unix: Makefile-based build simulators
cmake/build-ninja: Ninja build-based simulators
CMake suite maintained and supported by Kitware (kitware.com/cmake).
Configure and build simh simulators on Linux and *nix-like platforms.

Options:
--------
Compile/Build options:
----------------------
--clean (-x) Remove the build subdirectory
--generate (-g) Generate the build environment, don't compile/build
--parallel (-p) Enable build parallelism (parallel builds)
--nonetwork Build simulators without network support
--novideo Build simulators without video support
--notest Do not execute 'ctest' test cases
--noinstall Do not install SIMH simulators.
--testonly Do not build, execute the 'ctest' test cases
--installonly Do not build, install the SIMH simulators

--flavor (-f) Specifies the build flavor. Valid flavors are:
--flavor (-f) [Required] Specifies the build flavor. Valid flavors are:
unix
ninja
xcode
Expand All @@ -541,8 +538,7 @@ or video support.
--config (-c) Specifies the build configuration: 'Release' or 'Debug'

--target Build a specific simulator or simulators. Separate multiple
targets by separating with a comma,
e.g. "--target pdp8,pdp11,vax750,altairz80,3b2"
targets with a comma, e.g. "--target pdp8,pdp11,vax750,altairz80,3b2"
--lto Enable Link Time Optimization (LTO) in Release builds
--debugWall Enable maximal warnings in Debug builds
--cppcheck Enable cppcheck static code analysis rules
Expand All @@ -553,6 +549,17 @@ or video support.

--verbose Turn on verbose build output

SIMH feature control options:
-----------------------------
--nonetwork Build simulators without network support
--novideo Build simulators without video support
--no-aio-intrinsics
Do not use compiler/platform intrinsics to implement AIO
functions (aka "lock-free" AIO), reverts to lock-based AIO
if threading libraries are detected.

Other options:
--------------
--help (-h) Print this help.
```

Expand All @@ -569,17 +576,17 @@ or video support.
PS C:\...\open-simh> Get-Help -deatailed cmake\cmake-builder.ps1

NAME
C:\Users\bsm21317\play\open-simh\cmake\cmake-builder.ps1
C:\...\play\open-simh\cmake\cmake-builder.ps1

SYNOPSIS
Configure and build SIMH's dependencies and simulators using the Microsoft Visual
Studio C compiler or MinGW-W64-based gcc compiler.


SYNTAX
C:\Users\bsm21317\play\open-simh\cmake\cmake-builder.ps1 [[-flavor] <String>] [[-config] <String>] [[-cpack_suffix] <String>] [[-target] <String>]
[-clean] [-help] [-nonetwork] [-novideo] [-notest] [-noinstall] [-parallel] [-generate] [-regenerate] [-testonly] [-installOnly] [-windeprecation]
[-package] [-lto] [-debugWall] [-cppcheck] [<CommonParameters>]
C:\...\play\open-simh\cmake\cmake-builder.ps1 [[-flavor] <String>] [[-config] <String>] [[-cpack_suffix] <String>] [[-target]
<String[]>] [-clean] [-help] [-nonetwork] [-novideo] [-noaioinstrinsics] [-notest] [-noinstall] [-parallel] [-generate] [-testonly]
[-installOnly] [-windeprecation] [-lto] [-debugWall] [-cppcheck] [<CommonParameters>]


DESCRIPTION
Expand All @@ -588,9 +595,9 @@ or video support.

1. Configure and generate the build environment selected by '-flavor' option.
2. Build missing runtime dependencies and the simulator suite with the compiler
configuration selected by the '-config' option. The "Release" configuration
generates optimized executables; the "Debug" configuration generates
development executables with debugger information.
configuration selected by the '-config' option. The "Release" configuration
generates optimized executables; the "Debug" configuration generates
development executables with debugger information.
3. Test the simulators

There is an install phase that can be invoked separately as part of the SIMH
Expand Down Expand Up @@ -624,6 +631,9 @@ or video support.
mingw-make MinGW GCC/mingw32-make
mingw-ninja MinGW GCC/ninja

-config <String>
The target build configuration. Valid values: "Release" and "Debug"

[...truncated for brevity...]
```

Expand Down
4 changes: 2 additions & 2 deletions VAX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,12 @@ add_simulator(vax8200
vax_sys.c
vax_syscm.c
vax_watch.c
vax_uw.c
vax820_stddev.c
vax820_bi.c
vax820_mem.c
vax820_uba.c
vax820_ka.c
vax_uw.c
vax820_syslist.c
${PDP11D}/pdp11_rl.c
${PDP11D}/pdp11_rq.c
Expand Down Expand Up @@ -615,12 +615,12 @@ add_simulator(vax8600
vax_mmu.c
vax_sys.c
vax_syscm.c
vax_uw.c
vax860_stddev.c
vax860_sbia.c
vax860_abus.c
vax780_uba.c
vax7x0_mba.c
vax_uw.c
vax860_syslist.c
${PDP11D}/pdp11_rl.c
${PDP11D}/pdp11_rq.c
Expand Down
3 changes: 1 addition & 2 deletions cmake/cmake-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ showHelp()
cat <<EOF
Configure and build simh simulators on Linux and *nix-like platforms.

-Compile/Build options:
-----------------------
Compile/Build options:
--clean (-x) Remove the build subdirectory
--generate (-g) Generate the build environment, don't compile/build
--cache '--generate' and show CMake's variable cache
Expand Down
6 changes: 5 additions & 1 deletion cmake/pthreads-dep.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ if (WITH_ASYNC)
else ()
set(AIO_FLAGS DONT_USE_READER_THREAD)
endif ()
else()

if (DONT_USE_AIO_INTRINSICS)
target_compile_definitions(thread_lib INTERFACE DONT_USE_AIO_INTRINSICS)
endif ()
else ()
target_compile_definitions(thread_lib INTERFACE DONT_USE_READER_THREAD)
set(THREADING_PKG_STATUS "asynchronous I/O disabled.")
endif()
22 changes: 11 additions & 11 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -675,13 +675,13 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin)
OS_CCDEFS += -DHAVE_LIBPNG
OS_LDFLAGS += -lpng
$(info using libpng: $(call find_lib,png) $(call find_include,png))
ifneq (,$(call find_include,zlib))
ifneq (,$(call find_lib,z))
OS_CCDEFS += -DHAVE_ZLIB
OS_LDFLAGS += -lz
$(info using zlib: $(call find_lib,z) $(call find_include,zlib))
endif
endif
endif
endif
ifneq (,$(call find_include,zlib))
ifneq (,$(call find_lib,z))
OS_CCDEFS += -DHAVE_ZLIB
OS_LDFLAGS += -lz
$(info using zlib: $(call find_lib,z) $(call find_include,zlib))
endif
endif
ifneq (,$(call find_include,glob))
Expand Down Expand Up @@ -2073,7 +2073,7 @@ KA10 = ${KA10D}/kx10_cpu.c ${KA10D}/kx10_sys.c ${KA10D}/kx10_df.c \
${KA10D}/ka10_ai.c ${KA10D}/ka10_iii.c ${KA10D}/kx10_disk.c \
${KA10D}/ka10_pclk.c ${KA10D}/ka10_tv.c ${KA10D}/ka10_dd.c \
${KA10D}/kx10_ddc.c ${DISPLAYL} ${DISPLAY340} ${DISPLAYIII}
KA10_OPT = -DKA=1 -DUSE_INT64 -I ${KA10D} -DUSE_SIM_CARD ${NETWORK_OPT} ${DISPLAY_OPT} ${KA10_DISPLAY_OPT}
KA10_OPT = -DKA=1 -DUSE_INT64 -I ${KA10D} -DUSE_SIM_CARD ${NETWORK_OPT} ${DISPLAY_OPT} ${KA10_DISPLAY_OPT} ${AIO_CCDEFS}
ifneq (${PANDA_LIGHTS},)
# ONLY for Panda display.
KA10_OPT += -DPANDA_LIGHTS
Expand All @@ -2093,7 +2093,7 @@ KI10 = ${KI10D}/kx10_cpu.c ${KI10D}/kx10_sys.c ${KI10D}/kx10_df.c \
${KI10D}/kx10_cp.c ${KI10D}/kx10_tu.c ${KI10D}/kx10_rs.c \
${KI10D}/kx10_imp.c ${KI10D}/kx10_dpy.c ${KI10D}/kx10_disk.c \
${KI10D}/kx10_ddc.c ${KI10D}/kx10_tym.c ${DISPLAYL} ${DISPLAY340}
KI10_OPT = -DKI=1 -DUSE_INT64 -I ${KI10D} -DUSE_SIM_CARD ${NETWORK_OPT} ${DISPLAY_OPT} ${KI10_DISPLAY_OPT}
KI10_OPT = -DKI=1 -DUSE_INT64 -I ${KI10D} -DUSE_SIM_CARD ${NETWORK_OPT} ${DISPLAY_OPT} ${KI10_DISPLAY_OPT} ${AIO_CCDEFS}
ifneq (${PANDA_LIGHTS},)
# ONLY for Panda display.
KI10_OPT += -DPANDA_LIGHTS
Expand All @@ -2109,15 +2109,15 @@ KL10 = ${KL10D}/kx10_cpu.c ${KL10D}/kx10_sys.c ${KL10D}/kx10_df.c \
${KL10D}/kx10_rp.c ${KL10D}/kx10_tu.c ${KL10D}/kx10_rs.c \
${KL10D}/kx10_imp.c ${KL10D}/kl10_fe.c ${KL10D}/ka10_pd.c \
${KL10D}/ka10_ch10.c ${KL10D}/kl10_nia.c ${KL10D}/kx10_disk.c
KL10_OPT = -DKL=1 -DUSE_INT64 -I $(KL10D) -DUSE_SIM_CARD ${NETWORK_OPT}
KL10_OPT = -DKL=1 -DUSE_INT64 -I $(KL10D) -DUSE_SIM_CARD ${NETWORK_OPT} ${AIO_CCDEFS}

KS10D = ${SIMHD}/PDP10
KS10 = ${KS10D}/kx10_cpu.c ${KS10D}/kx10_sys.c ${KS10D}/kx10_disk.c \
${KS10D}/ks10_cty.c ${KS10D}/ks10_uba.c ${KS10D}/kx10_rh.c \
${KS10D}/kx10_rp.c ${KS10D}/kx10_tu.c ${KS10D}/ks10_dz.c \
${KS10D}/ks10_tcu.c ${KS10D}/ks10_lp.c ${KS10D}/ks10_ch11.c \
${KS10D}/ks10_kmc.c ${KS10D}/ks10_dup.c ${KS10D}/kx10_imp.c
KS10_OPT = -DKS=1 -DUSE_INT64 -I $(KS10D) -I $(PDP11D) ${NETWORK_OPT}
KS10_OPT = -DKS=1 -DUSE_INT64 -I $(KS10D) -I $(PDP11D) ${NETWORK_OPT} ${AIO_CCDEFS}

ATT3B2D = ${SIMHD}/3B2
ATT3B2M400 = ${ATT3B2D}/3b2_cpu.c ${ATT3B2D}/3b2_sys.c \
Expand Down
Loading
Loading