From 7acb4554bb0022f19a42a9de8b4c10a850cdc73c Mon Sep 17 00:00:00 2001 From: Richard Cornwell Date: Thu, 12 Mar 2020 00:10:15 -0400 Subject: [PATCH] KA10: Removed PACK definition, add polling if async eth fails. --- PDP10/kl10_nia.c | 25 +++++++++---------------- PDP10/kx10_imp.c | 15 --------------- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/PDP10/kl10_nia.c b/PDP10/kl10_nia.c index 1c3a2e34..d0b0bd62 100644 --- a/PDP10/kl10_nia.c +++ b/PDP10/kl10_nia.c @@ -198,21 +198,6 @@ #define NIA_CNT_RS8 053 /* Reserved for ucode */ #define NIA_CNT_LEN 054 /* # of counters */ -#ifdef _MSC_VER -# define PACKED_BEGIN __pragma( pack(push, 1) ) -# define PACKED_END __pragma( pack(pop) ) -# define QEMU_PACKED -#else -# define PACKED_BEGIN -#if defined(_WIN32) -# define PACKED_END __attribute__((gcc_struct, packed)) -# define QEMU_PACKED __attribute__((gcc_struct, packed)) -#else -# define PACKED_END __attribute__((packed)) -# define QEMU_PACKED __attribute__((packed)) -#endif -#endif - typedef uint32 in_addr_T; #define ETHTYPE_ARP 0x0806 @@ -352,6 +337,7 @@ struct nia_device { uint64 status; /* Status of device. */ uint32 uver[4]; /* Version information */ int r_pkt; /* Packet pending */ + int poll; /* Need to poll receiver */ } nia_data; @@ -1496,6 +1482,8 @@ t_stat nia_eth_srv(UNIT * uptr) struct nia_eth_hdr *hdr; uint16 type; + if (nia_data.poll) + sim_clock_coschedule(uptr, 1000); /* continue poll */ /* Check if we need to get a packet */ while (nia_data.r_pkt == 0) { if (eth_read(&nia_data.etherface, &nia_data.rec_buff, NULL) <= 0) @@ -1636,7 +1624,12 @@ t_stat nia_attach(UNIT* uptr, CONST char* cptr) /* Allow Asynchronous inbound packets */ - eth_set_async (&nia_data.etherface, 0); + if (eth_set_async (&nia_data.etherface, 0) == SCPE_OK) + nia_data.poll = 0; + else { + nia_data.poll = 1; + sim_activate (&nia_unit[0], 100); + } return SCPE_OK; } diff --git a/PDP10/kx10_imp.c b/PDP10/kx10_imp.c index dd74f208..53323ed2 100644 --- a/PDP10/kx10_imp.c +++ b/PDP10/kx10_imp.c @@ -130,21 +130,6 @@ #define ILEN u6 /* Size of input buffer in bits */ -#ifdef _MSC_VER -# define PACKED_BEGIN __pragma( pack(push, 1) ) -# define PACKED_END __pragma( pack(pop) ) -# define QEMU_PACKED -#else -# define PACKED_BEGIN -#if defined(_WIN32) -# define PACKED_END __attribute__((gcc_struct, packed)) -# define QEMU_PACKED __attribute__((gcc_struct, packed)) -#else -# define PACKED_END __attribute__((packed)) -# define QEMU_PACKED __attribute__((packed)) -#endif -#endif - #define IMP_ARPTAB_SIZE 64 #define IMP_ARP_MAX_AGE 100