Index: head/emulators/simh/Makefile =================================================================== --- head/emulators/simh/Makefile (revision 547262) +++ head/emulators/simh/Makefile (revision 547263) @@ -1,68 +1,68 @@ # Created by: jraynard # $FreeBSD$ PORTNAME= simh PORTVERSION= 3.9.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= emulators MASTER_SITES= http://simh.trailing-edge.com/sources/:src \ http://www.ml1.org.uk/distfiles/:pdf \ http://www.ancientgeek.org.uk/distfiles/:pdf DISTNAME= ${PORTNAME}v${PORTVERSION:R:S/.//}-${PORTVERSION:E} DISTFILES= ${PORTNAME}v${PORTVERSION:R:S/.//}-${PORTVERSION:E}.zip:src \ ${PORTNAME}_docpdf.zip:pdf MAINTAINER= bob@eager.cx COMMENT= Emulates classic DEC, HP, GRI, IBM, Altair, SDS, Honeywell, and others LICENSE= MIT NO_WRKSUBDIR= yes USES= gmake dos2unix zip DOS2UNIX_GLOB= *.c *.h *.txt *.mak *.ini makefile CFLAGS+= -Wno-format-extra-args -Wno-comment MAKE_ENV= GCC="${CC}" CFLAGS_O="${CFLAGS}" USE_NETWORK=1 MAKEFILE= makefile SUB_FILES= pkg-message simh.1 READMES= 0readme_${PORTVERSION:R:S/.//}.txt 0readme_ethernet.txt PORTDOCS= ${READMES} pdf/* OPTIONS_DEFINE= DOCS .include .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == i386 CFLAGS+= -Wno-logical-op-parentheses -Wno-bitwise-op-parentheses -Wno-shift-negative-value .endif pre-patch: @${MKDIR} ${WRKSRC}/BIN post-patch: @${REINPLACE_CMD} -e \ '/shell ldconfig/s|^|#| ; \ /-O2/s| = | ?= |' ${WRKSRC}/makefile @${REINPLACE_CMD} -e \ 's|%%DATADIR%%|${DATADIR}|' ${WRKSRC}/VAX/vax_sysdev.c post-build: # eclipse, gri and nova conflict with other ports, prefix with simh- @${MV} ${WRKSRC}/BIN/eclipse ${WRKSRC}/BIN/simh-eclipse @${MV} ${WRKSRC}/BIN/gri ${WRKSRC}/BIN/simh-gri @${MV} ${WRKSRC}/BIN/nova ${WRKSRC}/BIN/simh-nova do-install: ${INSTALL_PROGRAM} ${WRKSRC}/BIN/* ${STAGEDIR}${PREFIX}/bin @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKSRC}/VAX/ka655x.bin ${STAGEDIR}${DATADIR} ${INSTALL_MAN} ${WRKDIR}/simh.1 ${STAGEDIR}${MANPREFIX}/man/man1 do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR}/pdf (cd ${WRKSRC} && ${INSTALL_DATA} ${READMES} ${STAGEDIR}${DOCSDIR}) (cd ${WRKSRC} && ${COPYTREE_SHARE} pdf ${STAGEDIR}${DOCSDIR}) .include Index: head/emulators/simh/files/patch-AltairZ80_i86.h =================================================================== --- head/emulators/simh/files/patch-AltairZ80_i86.h (nonexistent) +++ head/emulators/simh/files/patch-AltairZ80_i86.h (revision 547263) @@ -0,0 +1,10 @@ +--- AltairZ80/i86.h.orig 2020-09-01 09:55:27 UTC ++++ AltairZ80/i86.h +@@ -215,7 +215,6 @@ struct pc_env + }; + + /* GLOBAL */ +-volatile int intr; + + void halt_sys (PC_ENV *sys); + void fetch_decode_modrm (PC_ENV *m, uint16 *mod, uint16 *regh, uint16 *regl); Property changes on: head/emulators/simh/files/patch-AltairZ80_i86.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/simh/files/patch-AltairZ80_i86__decode.c =================================================================== --- head/emulators/simh/files/patch-AltairZ80_i86__decode.c (nonexistent) +++ head/emulators/simh/files/patch-AltairZ80_i86__decode.c (revision 547263) @@ -0,0 +1,10 @@ +--- AltairZ80/i86_decode.c.orig 2020-09-01 09:55:27 UTC ++++ AltairZ80/i86_decode.c +@@ -46,6 +46,7 @@ extern uint32 PCX; /* external view of PC + extern uint32 sim_brk_summ; + extern UNIT cpu_unit; + ++volatile int intr; + void i86_intr_raise(PC_ENV *m,uint8 intrnum); + void cpu8086reset(void); + t_stat sim_instr_8086(void); Property changes on: head/emulators/simh/files/patch-AltairZ80_i86__decode.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/simh/files/patch-AltairZ80_i86__ops.c =================================================================== --- head/emulators/simh/files/patch-AltairZ80_i86__ops.c (nonexistent) +++ head/emulators/simh/files/patch-AltairZ80_i86__ops.c (revision 547263) @@ -0,0 +1,10 @@ +--- AltairZ80/i86_ops.c.orig 2020-09-01 09:55:27 UTC ++++ AltairZ80/i86_ops.c +@@ -109,6 +109,7 @@ extern uint32 in(const uint32 Port); + */ + + extern uint8 parity_tab[]; ++extern volatile int intr; + + static void i86op_illegal_op(PC_ENV *m) + { Property changes on: head/emulators/simh/files/patch-AltairZ80_i86__ops.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/simh/files/patch-makefile =================================================================== --- head/emulators/simh/files/patch-makefile (revision 547262) +++ head/emulators/simh/files/patch-makefile (revision 547263) @@ -1,54 +1,72 @@ ---- makefile.orig 2016-12-01 22:43:43 UTC +--- makefile.orig 2020-09-01 10:06:51 UTC +++ makefile -@@ -110,7 +110,7 @@ ifeq ($(WIN32),) #*nix Environments (&& +@@ -110,7 +110,7 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) PCAPLIB = wpcap LIBEXT = a else - LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g') -+########## LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g') ++########### LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g') ifneq (,$(LDSEARCH)) LIBPATH := $(LDSEARCH) endif @@ -300,7 +300,7 @@ ifneq ($(DEBUG),) CFLAGS_O = -O0 BUILD_FEATURES = - debugging support else - CFLAGS_O = -O2 + CFLAGS_O ?= -O2 LDFLAGS_O = GCC_MAJOR_VERSION = $(firstword $(subst ., ,$(GCC_VERSION))) ifneq (3,$(GCC_MAJOR_VERSION)) @@ -309,9 +309,9 @@ else endif GCC_OPTIMIZERS = $(shell $(GCC_OPTIMIZERS_CMD)) endif - ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS))) - NO_LTO = 1 - endif +# ifneq (,$(findstring $(GCC_VERSION),$(LTO_EXCLUDE_VERSIONS))) +# NO_LTO = 1 +# endif ifneq (,$(findstring -finline-functions,$(GCC_OPTIMIZERS))) CFLAGS_O += -finline-functions endif @@ -330,12 +330,14 @@ else ifneq (,$(findstring -fstrict-overflow,$(GCC_OPTIMIZERS))) CFLAGS_O += -fno-strict-overflow endif - ifeq (,$(NO_LTO)) - ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS))) - CFLAGS_O += -flto -fwhole-program - LDFLAGS_O += -flto -fwhole-program - endif - endif +# ifeq (,$(NO_LTO)) +# ifneq (,$(findstring -flto,$(GCC_OPTIMIZERS))) +# ifneq (,$(findstring -fwhole-program,$(GCC_OPTIMIZERS))) +# CFLAGS_O += -flto -fwhole-program +# LDFLAGS_O += -flto -fwhole-program +# endif +# endif +# endif BUILD_FEATURES = - compiler optimizations and no debugging support endif ifneq (3,$(GCC_MAJOR_VERSION)) +@@ -523,7 +525,7 @@ IBM1130 = ${IBM1130D}/ibm1130_cpu.c ${IBM1130D}/ibm113 + ${IBM1130D}/ibm1130_fmt.c ${IBM1130D}/ibm1130_ptrp.c \ + ${IBM1130D}/ibm1130_plot.c ${IBM1130D}/ibm1130_sca.c \ + ${IBM1130D}/ibm1130_t2741.c +-IBM1130_OPT = -I ${IBM1130D} ++IBM1130_OPT = -I ${IBM1130D} -D HAVE_VM_INIT + + + ID16D = Interdata +@@ -570,7 +572,7 @@ ALTAIRZ80 = ${ALTAIRZ80D}/altairz80_cpu.c ${ALTAIRZ80D + ${ALTAIRZ80D}/s100_scp300f.c ${ALTAIRZ80D}/sim_imd.c \ + ${ALTAIRZ80D}/wd179x.c ${ALTAIRZ80D}/s100_hdc1001.c \ + ${ALTAIRZ80D}/s100_if3.c ${ALTAIRZ80D}/s100_adcs6.c +-ALTAIRZ80_OPT = -I ${ALTAIRZ80D} ++ALTAIRZ80_OPT = -I ${ALTAIRZ80D} -D HAVE_VM_INIT + + + GRID = GRI Index: head/emulators/simh/files/patch-scp.c =================================================================== --- head/emulators/simh/files/patch-scp.c (revision 547262) +++ head/emulators/simh/files/patch-scp.c (revision 547263) @@ -1,196 +1,213 @@ ---- scp.c.orig 2016-12-01 22:43:43 UTC +--- scp.c.orig 2020-09-01 10:06:51 UTC +++ scp.c -@@ -678,14 +678,14 @@ else if (*argv[0]) { +@@ -266,10 +266,14 @@ extern t_stat fprint_sym (FILE *ofile, t_addr addr, t_ + extern t_stat parse_sym (char *cptr, t_addr addr, UNIT *uptr, t_value *val, + int32 sw); + +-/* The per-simulator init routine is a weak global that defaults to NULL ++/* The per-simulator init routine is only required for a few machines + The other per-simulator pointers can be overrriden by the init routine */ + +-void (*sim_vm_init) (void); ++#ifdef HAVE_VM_INIT ++extern void (*sim_vm_init) (void); ++#else ++void (*sim_vm_init) (void) = NULL; ++#endif + char* (*sim_vm_read) (char *ptr, int32 size, FILE *stream) = NULL; + void (*sim_vm_post) (t_bool from_scp) = NULL; + CTAB *sim_vm_cmd = NULL; +@@ -678,14 +682,14 @@ else if (*argv[0]) { char nbuf[PATH_MAX + 7], *np; /* "path.ini" */ nbuf[0] = '"'; /* starting " */ strncpy (nbuf + 1, argv[0], PATH_MAX + 1); /* copy sim name */ - if (np = match_ext (nbuf, "EXE")) /* remove .exe */ + if ((np = match_ext (nbuf, "EXE"))) /* remove .exe */ *np = 0; strcat (nbuf, ".ini\""); /* add .ini" */ stat = do_cmd (-1, nbuf); /* proc cmd file */ } while (stat != SCPE_EXIT) { /* in case exit */ - if (cptr = sim_brk_getact (cbuf, CBUFSIZE)) /* pending action? */ + if ((cptr = sim_brk_getact (cbuf, CBUFSIZE))) /* pending action? */ printf ("sim> %s\n", cptr); /* echo */ else if (sim_vm_read != NULL) { /* sim routine? */ printf ("sim> "); /* prompt */ -@@ -700,7 +700,7 @@ while (stat != SCPE_EXIT) { +@@ -700,7 +704,7 @@ while (stat != SCPE_EXIT) { fprintf (sim_log, "sim> %s\n", cptr); cptr = get_glyph (cptr, gbuf, 0); /* get command glyph */ sim_switches = 0; /* init switches */ - if (cmdp = find_cmd (gbuf)) /* lookup command */ + if ((cmdp = find_cmd (gbuf))) /* lookup command */ stat = cmdp->action (cmdp->arg, cptr); /* if found, exec */ else stat = SCPE_UNK; if (stat >= SCPE_BASE) { /* error? */ -@@ -767,7 +767,7 @@ if (*cptr) { +@@ -767,7 +771,7 @@ if (*cptr) { cptr = get_glyph (cptr, gbuf, 0); if (*cptr) return SCPE_2MARG; - if (cmdp = find_cmd (gbuf)) { + if ((cmdp = find_cmd (gbuf))) { fputs (cmdp->help, stdout); if (sim_log) fputs (cmdp->help, sim_log); -@@ -911,7 +911,7 @@ do { +@@ -911,7 +915,7 @@ do { cptr = get_glyph (cptr, gbuf, 0); /* get command glyph */ sim_switches = 0; /* init switches */ isdo = FALSE; - if (cmdp = find_cmd (gbuf)) { /* lookup command */ + if ((cmdp = find_cmd (gbuf))) { /* lookup command */ isdo = (cmdp->action == &do_cmd); if (isdo) { /* DO command? */ if (flag >= DO_NEST_LVL) /* nest too deep? */ -@@ -1091,18 +1091,18 @@ if (*cptr == 0) +@@ -1091,18 +1095,18 @@ if (*cptr == 0) return SCPE_2FARG; cptr = get_glyph (cptr, gbuf, 0); /* get glob/dev/unit */ -if (dptr = find_dev (gbuf)) { /* device match? */ +if ((dptr = find_dev (gbuf))) { /* device match? */ uptr = dptr->units; /* first unit */ ctbr = set_dev_tab; /* global table */ lvl = MTAB_VDV; /* device match */ } -else if (dptr = find_unit (gbuf, &uptr)) { /* unit match? */ +else if ((dptr = find_unit (gbuf, &uptr))) { /* unit match? */ if (uptr == NULL) /* invalid unit */ return SCPE_NXUN; ctbr = set_unit_tab; /* global table */ lvl = MTAB_VUN; /* unit match */ } -else if (gcmdp = find_ctab (set_glob_tab, gbuf)) /* global? */ +else if ((gcmdp = find_ctab (set_glob_tab, gbuf))) /* global? */ return gcmdp->action (gcmdp->arg, cptr); /* do the rest */ else return SCPE_NXDEV; /* no match */ if (*cptr == 0) /* must be more */ -@@ -1110,7 +1110,7 @@ if (*cptr == 0) +@@ -1110,7 +1114,7 @@ if (*cptr == 0) while (*cptr != 0) { /* do all mods */ cptr = get_glyph (svptr = cptr, gbuf, ','); /* get modifier */ - if (cvptr = strchr (gbuf, '=')) /* = value? */ + if ((cvptr = strchr (gbuf, '='))) /* = value? */ *cvptr++ = 0; for (mptr = dptr->modifiers; mptr && (mptr->mask != 0); mptr++) { if ((mptr->mstring) && /* match string */ -@@ -1123,7 +1123,7 @@ while (*cptr != 0) { +@@ -1123,7 +1127,7 @@ while (*cptr != 0) { if (mptr->valid) { /* validation rtn? */ if (cvptr && (mptr->mask & MTAB_NC)) { get_glyph_nc (svptr, gbuf, ','); - if (cvptr = strchr (gbuf, '=')) + if ((cvptr = strchr (gbuf, '='))) *cvptr++ = 0; } r = mptr->valid (uptr, mptr->match, cvptr, mptr->desc); -@@ -1156,7 +1156,7 @@ while (*cptr != 0) { +@@ -1156,7 +1160,7 @@ while (*cptr != 0) { } /* end if match */ } /* end for */ if (!mptr || (mptr->mask == 0)) { /* no match? */ - if (glbr = find_c1tab (ctbr, gbuf)) { /* global match? */ + if ((glbr = find_c1tab (ctbr, gbuf))) { /* global match? */ r = glbr->action (dptr, uptr, glbr->arg, cvptr); /* do global */ if (r != SCPE_OK) return r; -@@ -1349,15 +1349,15 @@ GET_SWITCHES (cptr); +@@ -1349,15 +1353,15 @@ GET_SWITCHES (cptr); if (*cptr == 0) /* must be more */ return SCPE_2FARG; cptr = get_glyph (cptr, gbuf, 0); /* get next glyph */ -if (shptr = find_shtab (show_glob_tab, gbuf)) /* global? */ +if ((shptr = find_shtab (show_glob_tab, gbuf))) /* global? */ return shptr->action (ofile, NULL, NULL, shptr->arg, cptr); -if (dptr = find_dev (gbuf)) { /* device match? */ +if ((dptr = find_dev (gbuf))) { /* device match? */ uptr = dptr->units; /* first unit */ shtb = show_dev_tab; /* global table */ lvl = MTAB_VDV; /* device match */ } -else if (dptr = find_unit (gbuf, &uptr)) { /* unit match? */ +else if ((dptr = find_unit (gbuf, &uptr))) { /* unit match? */ if (uptr == NULL) /* invalid unit */ return SCPE_NXUN; if (uptr->flags & UNIT_DIS) /* disabled? */ -@@ -1377,7 +1377,7 @@ if (dptr->modifiers == NULL) +@@ -1377,7 +1381,7 @@ if (dptr->modifiers == NULL) while (*cptr != 0) { /* do all mods */ cptr = get_glyph (cptr, gbuf, ','); /* get modifier */ - if (cvptr = strchr (gbuf, '=')) /* = value? */ + if ((cvptr = strchr (gbuf, '='))) /* = value? */ *cvptr++ = 0; for (mptr = dptr->modifiers; mptr->mask != 0; mptr++) { if (((mptr->mask & MTAB_XTD)? /* right level? */ -@@ -1396,7 +1396,7 @@ while (*cptr != 0) { +@@ -1396,7 +1400,7 @@ while (*cptr != 0) { } /* end if */ } /* end for */ if (mptr->mask == 0) { /* no match? */ - if (shptr = find_shtab (shtb, gbuf)) /* global match? */ + if ((shptr = find_shtab (shtb, gbuf))) /* global match? */ shptr->action (ofile, dptr, uptr, shptr->arg, cptr); else return SCPE_ARG; } /* end if */ -@@ -1800,7 +1800,7 @@ if (sim_brk_types == 0) +@@ -1800,7 +1804,7 @@ if (sim_brk_types == 0) return SCPE_NOFNC; if ((dptr == NULL) || (uptr == NULL)) return SCPE_IERR; -if (aptr = strchr (cptr, ';')) { /* ;action? */ +if ((aptr = strchr (cptr, ';'))) { /* ;action? */ if (flg != SSH_ST) /* only on SET */ return SCPE_ARG; *aptr++ = 0; /* separate strings */ -@@ -3699,7 +3699,7 @@ if ((cptr == NULL) || (*cptr == 0)) +@@ -3699,7 +3703,7 @@ if ((cptr == NULL) || (*cptr == 0)) return SCPE_ARG; strncpy (gbuf, cptr, CBUFSIZE); addrp = gbuf; /* default addr */ -if (portp = strchr (gbuf, ':')) /* x:y? split */ +if ((portp = strchr (gbuf, ':'))) /* x:y? split */ *portp++ = 0; else if (strchr (gbuf, '.')) /* x.y...? */ portp = NULL; -@@ -3782,7 +3782,7 @@ DEVICE *dptr; +@@ -3782,7 +3786,7 @@ DEVICE *dptr; if (uptr == NULL) /* arg error? */ return NULL; -if (dptr = find_dev (cptr)) { /* exact match? */ +if ((dptr = find_dev (cptr))) { /* exact match? */ if (qdisable (dptr)) /* disabled? */ return NULL; *uptr = dptr->units; /* unit 0 */ -@@ -3862,7 +3862,7 @@ REG *rptr, *srptr = NULL; +@@ -3862,7 +3866,7 @@ REG *rptr, *srptr = NULL; for (i = 0; (dptr = sim_devices[i]) != 0; i++) { /* all dev */ if (dptr->flags & DEV_DIS) /* skip disabled */ continue; - if (rptr = find_reg (cptr, optr, dptr)) { /* found? */ + if ((rptr = find_reg (cptr, optr, dptr))) { /* found? */ if (srptr) /* ambig? err */ return NULL; srptr = rptr; /* save reg */ -@@ -4080,15 +4080,15 @@ const char logstr[] = "|&^", cmpstr[] = +@@ -4080,15 +4084,15 @@ const char logstr[] = "|&^", cmpstr[] = "=!><"; logval = cmpval = 0; if (*cptr == 0) /* check for clause */ return NULL; -for (logop = cmpop = -1; c = *cptr++; ) { /* loop thru clauses */ - if (sptr = strchr (logstr, c)) { /* check for mask */ +for (logop = cmpop = -1; (c = *cptr++); ) { /* loop thru clauses */ + if ((sptr = strchr (logstr, c))) { /* check for mask */ logop = (int32)(sptr - logstr); logval = strtotv (cptr, &tptr, radix); if (cptr == tptr) return NULL; cptr = tptr; } - else if (sptr = strchr (cmpstr, c)) { /* check for boolop */ + else if ((sptr = strchr (cmpstr, c))) { /* check for boolop */ cmpop = (int32)(sptr - cmpstr); if (*cptr == '=') { cmpop = cmpop + strlen (cmpstr); -@@ -4753,7 +4753,7 @@ while (isspace (*sim_brk_act)) +@@ -4753,7 +4757,7 @@ while (isspace (*sim_brk_act)) sim_brk_act++; if (*sim_brk_act == 0) /* now empty? */ return (sim_brk_act = NULL); -if (ep = strchr (sim_brk_act, ';')) { /* cmd delimiter? */ +if ((ep = strchr (sim_brk_act, ';'))) { /* cmd delimiter? */ lnt = ep - sim_brk_act; /* cmd length */ memcpy (buf, sim_brk_act, lnt + 1); /* copy with ; */ buf[lnt] = 0; /* erase ; */