1
0
mirror of https://github.com/wfjm/w11.git synced 2026-02-09 18:11:40 +00:00

use AddMembe(); add missing OptValid() calls

This commit is contained in:
wfjm
2019-07-06 08:50:51 +02:00
parent 3c92b79224
commit 923628555e
6 changed files with 32 additions and 76 deletions

View File

@@ -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 <W.F.J.Mueller@gsi.de>
//
// 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;

View File

@@ -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 <W.F.J.Mueller@gsi.de>
//
// 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;

View File

@@ -1,18 +1,10 @@
// $Id: RtclCmdBase.cpp 1083 2018-12-15 19:19:16Z mueller $
//
// Copyright 2011-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// 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 <W.F.J.Mueller@gsi.de>
//
// 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();
}
//------------------------------------------+-----------------------------------

View File

@@ -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 <W.F.J.Mueller@gsi.de>
//
// 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 <stdlib.h>
#include <fcntl.h>
#include <errno.h>
@@ -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;
}

View File

@@ -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 <W.F.J.Mueller@gsi.de>
//
// 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;