diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 35766fca..21208d4d 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -30,7 +30,8 @@ The full set of tests is only run for tagged releases. ### New features - new tools - - ibrtools/Rfd: added, encapsulates a file descriptor + - ibrtools/Rfd: added, encapsulates a raw file descriptor + - ibrtools/RfileFd: add, encapsulates basic file operations ### Changes - tools changes @@ -39,6 +40,8 @@ The full set of tests is only run for tagged releases. - librtcltools/RtclStats: Rename Collect->Exec, not longer const; add -reset - libr*/*: Stats() not longer const; use RtclStats::Exec() - librtools/RparseUrl: add DirName,FileName,FileStem,FileType + - librw11/Rw11VirtDisk(File): use RfileFd + - librw11/Rw11Cpu: MemWriteByte(): use AddMembe() - derive ReventFd and RtimerFd from Rfd - generic_so.mk: use -scrUuv for ar to avoid "'u' modifier ignored" - tools/oskit/hook/hook_ibmon_*.tcl: check ibmon availability diff --git a/tools/src/librlinktpp/RtclRlinkConnect.cpp b/tools/src/librlinktpp/RtclRlinkConnect.cpp index 7ee983c1..3ff75254 100644 --- a/tools/src/librlinktpp/RtclRlinkConnect.cpp +++ b/tools/src/librlinktpp/RtclRlinkConnect.cpp @@ -1,18 +1,10 @@ -// $Id: RtclRlinkConnect.cpp 1160 2019-06-07 17:30:17Z mueller $ -// +// $Id: RtclRlinkConnect.cpp 1175 2019-06-30 06:13:17Z mueller $ +// SPDX-License-Identifier: GPL-3.0-or-later // Copyright 2011-2019 by Walter F.J. Mueller -// -// This program is free software; you may redistribute and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation, either version 3, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY -// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for complete details. // // Revision History: // Date Rev Version Comment +// 2019-06-29 1175 1.6.12 M_log(): add missing OptValid() call // 2019-06-07 1160 1.6.11 use RtclStats::Exec() // 2019-03-10 1121 1.6.10 M_exec(): tranfer BlockDone values after rblk // 2019-02-23 1114 1.6.9 use std::bind instead of lambda @@ -736,6 +728,7 @@ int RtclRlinkConnect::M_log(RtclArgs& args) if (opt == "-error") tag = 'E'; if (opt == "-fatal") tag = 'F'; } + if (!args.OptValid()) return kERR; string msg; if (!args.GetArg("msg", msg)) return kERR; diff --git a/tools/src/librlinktpp/RtclRlinkPort.cpp b/tools/src/librlinktpp/RtclRlinkPort.cpp index 4a5eb539..faa0d5b9 100644 --- a/tools/src/librlinktpp/RtclRlinkPort.cpp +++ b/tools/src/librlinktpp/RtclRlinkPort.cpp @@ -1,18 +1,10 @@ -// $Id: RtclRlinkPort.cpp 1160 2019-06-07 17:30:17Z mueller $ -// +// $Id: RtclRlinkPort.cpp 1175 2019-06-30 06:13:17Z mueller $ +// SPDX-License-Identifier: GPL-3.0-or-later // Copyright 2013-2019 by Walter F.J. Mueller -// -// This program is free software; you may redistribute and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation, either version 3, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY -// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for complete details. // // Revision History: // Date Rev Version Comment +// 2019-06-29 1175 1.4.6 DoRaw{Read,Rblk}(): add missing OptValid() call // 2019-06-07 1160 1.4.5 use RtclStats::Exec() // 2019-02-23 1114 1.4.4 use std::bind instead of lambda // 2018-12-22 1091 1.4.3 M_Open(): drop move() (-Wpessimizing-move fix) @@ -32,7 +24,6 @@ // --------------------------------------------------------------------------- /*! - \file \brief Implemenation of class RtclRlinkPort. */ @@ -324,6 +315,7 @@ int RtclRlinkPort::DoRawRead(RtclArgs& args, RlinkPort& port) if (!args.GetArg("tsec", timeout, 0.)) return kERR; } } + if (!args.OptValid()) return kERR; RerrMsg emsg; Rtime tused; @@ -371,6 +363,7 @@ int RtclRlinkPort::DoRawRblk(RtclArgs& args, RlinkPort& port, size_t& errcnt) if (!args.GetArg("tsec", timeout, 0.)) return kERR; } } + if (!args.OptValid()) return kERR; RerrMsg emsg; Rtime tused; diff --git a/tools/src/librtcltools/RtclCmdBase.cpp b/tools/src/librtcltools/RtclCmdBase.cpp index 2550cbfc..c057fbca 100644 --- a/tools/src/librtcltools/RtclCmdBase.cpp +++ b/tools/src/librtcltools/RtclCmdBase.cpp @@ -1,18 +1,10 @@ -// $Id: RtclCmdBase.cpp 1083 2018-12-15 19:19:16Z mueller $ -// -// Copyright 2011-2018 by Walter F.J. Mueller -// -// This program is free software; you may redistribute and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation, either version 3, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY -// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for complete details. +// $Id: RtclCmdBase.cpp 1175 2019-06-30 06:13:17Z mueller $ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright 2011-2019 by Walter F.J. Mueller // // Revision History: // Date Rev Version Comment +// 2019-06-29 1175 1.1.4 GetArgsDump(): add missing OptValid() call // 2018-12-15 1083 1.1.3 AddMeth(): use rval ref and move semantics // 2018-11-09 1066 1.1.2 use auto // 2017-04-02 865 1.1.1 add GetArgsDump() @@ -26,7 +18,6 @@ // --------------------------------------------------------------------------- /*! - \file \brief Implemenation of RtclCmdBase. */ @@ -183,7 +174,7 @@ bool RtclCmdBase::GetArgsDump(RtclArgs& args, int& detail) else { detail = 0;} } - return true; + return args.OptValid(); } //------------------------------------------+----------------------------------- diff --git a/tools/src/librw11/Rw11Cpu.cpp b/tools/src/librw11/Rw11Cpu.cpp index 46cb3e80..bdba3edd 100644 --- a/tools/src/librw11/Rw11Cpu.cpp +++ b/tools/src/librw11/Rw11Cpu.cpp @@ -1,18 +1,10 @@ -// $Id: Rw11Cpu.cpp 1143 2019-05-01 13:25:51Z mueller $ -// +// $Id: Rw11Cpu.cpp 1175 2019-06-30 06:13:17Z mueller $ +// SPDX-License-Identifier: GPL-3.0-or-later // Copyright 2013-2019 by Walter F.J. Mueller -// -// This program is free software; you may redistribute and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation, either version 3, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY -// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for complete details. // // Revision History: // Date Rev Version Comment +// 2019-06-29 1175 1.2.20 MemWriteByte(): use membe // 2019-04-30 1143 1.2.19 add m9312 setup and HasM9312() // 2019-04-19 1133 1.2.18 add ExecWibr(),ExecRibr(); LoadAbs(): better trace // 2019-04-13 1131 1.2.17 add defs for w11 cpu component addresses; add @@ -50,9 +42,9 @@ // --------------------------------------------------------------------------- /*! - \file \brief Implemenation of Rw11Cpu. */ + #include #include #include @@ -566,23 +558,12 @@ bool Rw11Cpu::MemWriteByte(uint32_t addr, uint8_t data, RerrMsg& emsg) return false; } - // FIXME_code: this is a kludge because membe only works for ibus, not for - // memory. When pdp11_vmbox is fixed a single write can be used. RlinkCommandList clist; + uint16_t be = (addr & 0x01) ? kCPMEMBE_M_BE1 : kCPMEMBE_M_BE0; + uint16_t wdata = (uint16_t(data)<<8) | data; // fill byte into word AddLalh(clist, addr&0x3ffffe, kCPAH_M_22BIT); // setup address - int irm = clist.AddRreg(fBase+kCPMEM); // read word - if (!Server().Exec(clist, emsg)) return false; - uint16_t word = clist[irm].Data(); // get word - - if ((addr & 0x1) == 0) { // even address - word = (word & 0xff00) | uint16_t(data); - } else { // odd address - word = (word & 0x00ff) | (uint16_t(data)<<8); - } - - clist.Clear(); - AddLalh(clist, addr&0x3ffffe, kCPAH_M_22BIT); // setup address - clist.AddWreg(fBase+kCPMEM, word); // write word + AddMembe(clist, be); // setup byte enable + clist.AddWreg(fBase+kCPMEM, wdata); // and finally write byte if (!Server().Exec(clist, emsg)) return false; return true; } diff --git a/tools/src/librwxxtpp/RtclRw11Cpu.cpp b/tools/src/librwxxtpp/RtclRw11Cpu.cpp index b1565be9..91569714 100644 --- a/tools/src/librwxxtpp/RtclRw11Cpu.cpp +++ b/tools/src/librwxxtpp/RtclRw11Cpu.cpp @@ -1,18 +1,10 @@ -// $Id: RtclRw11Cpu.cpp 1160 2019-06-07 17:30:17Z mueller $ -// +// $Id: RtclRw11Cpu.cpp 1175 2019-06-30 06:13:17Z mueller $ +// SPDX-License-Identifier: GPL-3.0-or-later // Copyright 2013-2019 by Walter F.J. Mueller -// -// This program is free software; you may redistribute and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation, either version 3, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY -// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for complete details. // // Revision History: // Date Rev Version Comment +// 2019-06-29 1175 1.2.33 M_ldabs(): add missing OptValid() call // 2019-06-07 1160 1.2.32 use RtclStats::Exec() // 2019-04-30 1143 1.2.31 add HasM9312() getter // 2019-04-12 1131 1.2.30 BUGFIX: M_wtcpu(): check cpu attn in no-server case @@ -846,6 +838,7 @@ int RtclRw11Cpu::M_wtcpu(RtclArgs& args) while (args.NextOpt(opt, optset)) { if (opt == "-reset") reset = true; } + if (!args.OptValid()) return kERR; if (!args.GetArg("tout", dtout, 0.001)) return kERR; if (!args.AllDone()) return kERR; @@ -980,6 +973,7 @@ int RtclRw11Cpu::M_ldabs(RtclArgs& args) while (args.NextOpt(opt, optset)) { if (opt == "-trace") trace = true; } + if (!args.OptValid()) return kERR; string file; string varstart; @@ -1025,6 +1019,7 @@ int RtclRw11Cpu::M_ldasm(RtclArgs& args) if (!args.GetArg("??file", file)) return kERR; } } + if (!args.OptValid()) return kERR; if (file.length() == 0) { if (!args.GetArg("code", code)) return kERR;