From a15f42686ef5dd7316c3b67360651f4d30d1ac2a Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Sun, 10 Mar 2019 15:12:45 -0400 Subject: [PATCH] KA10: Close TMXR line when TEN11 connection goes away. --- PDP10/ka10_cpu.c | 4 ++-- PDP10/ka10_ten11.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/PDP10/ka10_cpu.c b/PDP10/ka10_cpu.c index d2cfd2c..6a7419a 100644 --- a/PDP10/ka10_cpu.c +++ b/PDP10/ka10_cpu.c @@ -1675,7 +1675,7 @@ int Mem_read_its(int flag, int cur_context, int fetch) { sim_interval--; if (!page_lookup_its(AB, flag, &addr, 0, cur_context, fetch)) return 1; - if (QTEN11 && T11RANGE(addr)) { + if (T11RANGE(addr) && QTEN11) { if (ten11_read (addr, &MB)) { nxm_flag = 1; return 1; @@ -1709,7 +1709,7 @@ int Mem_write_its(int flag, int cur_context) { sim_interval--; if (!page_lookup_its(AB, flag, &addr, 1, cur_context, 0)) return 1; - if (QTEN11 && T11RANGE(addr)) { + if (T11RANGE(addr) && QTEN11) { if (ten11_write (addr, MB)) { nxm_flag = 1; return 1; diff --git a/PDP10/ka10_ten11.c b/PDP10/ka10_ten11.c index f734c15..b8ae7c0 100644 --- a/PDP10/ka10_ten11.c +++ b/PDP10/ka10_ten11.c @@ -34,7 +34,11 @@ #include #include +#ifndef NUM_DEVS_TEN11 +#define NUM_DEVS_TEN11 0 +#endif +#if (NUM_DEVS_TEN11 > 0) /* Rubin 10-11 pager. */ static uint64 ten11_pager[256]; @@ -170,6 +174,11 @@ static void build (unsigned char *request, unsigned char octet) static t_stat ten11_svc (UNIT *uptr) { + tmxr_poll_rx (&ten11_desc); + if (ten11_ldsc.rcve && !ten11_ldsc.conn) { + ten11_ldsc.rcve = 0; + tmxr_reset_ln (&ten11_ldsc); + } if (tmxr_poll_conn(&ten11_desc) >= 0) { sim_debug(DBG_CMD, &ten11_dev, "got connection\n"); ten11_ldsc.rcve = 1; @@ -208,6 +217,8 @@ static int error (const char *message) { sim_debug (DBG_TRC, &ten11_dev, "%s\r\n", message); sim_debug (DBG_TRC, &ten11_dev, "CLOSE\r\n"); + ten11_ldsc.rcve = 0; + tmxr_reset_ln (&ten11_ldsc); return -1; } @@ -403,3 +414,4 @@ int ten11_write (int addr, uint64 data) } return 0; } +#endif