Make this package build with recent C++. With thanks to Bill Squier,

Krister Walfridsson and Soda for their help.

mmm, progress...
This commit is contained in:
agc 2004-08-12 19:59:51 +00:00
parent a194fd1772
commit 9bfaf4aae9
7 changed files with 288 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.5 2003/08/14 09:31:39 agc Exp $
$NetBSD: distinfo,v 1.6 2004/08/12 19:59:51 agc Exp $
SHA1 (swarm-0.61.tar.gz) = 36ed52671f8be2cf8e799efd94a48b2919979d2c
Size (swarm-0.61.tar.gz) = 395061 bytes
@ -6,3 +6,9 @@ SHA1 (patch-aa) = 47bf38f1f6ffde193d4bbe03c8968c92ab66d406
SHA1 (patch-ab) = 9859132762130859692614242f32022750db5a3f
SHA1 (patch-ac) = 57f5103fde8c1380ddd78c58dfd57c5368d92bfd
SHA1 (patch-ad) = a5a46138f385875511434f342654ad5e234f6647
SHA1 (patch-ae) = 5b42d3332b6e1a7f5c8e94fa54007444a9de92b5
SHA1 (patch-af) = 28479b4dd547cf55f4fb3968846140abf8f2dd5d
SHA1 (patch-ag) = c20ab04004bfe2982376c03b8411b698e6ba275f
SHA1 (patch-ah) = 806ce24ca3048953aa11f9c228c7cd759acc28c6
SHA1 (patch-ai) = 03c5cf845928361926fec3983a8c2c3bdd1c449f
SHA1 (patch-aj) = ab261d34eda8b8f7307fb40e798205515169ddea

View file

@ -0,0 +1,126 @@
$NetBSD: patch-ae,v 1.1 2004/08/12 19:59:51 agc Exp $
--- core.cpp 2004/08/12 17:16:45 1.1
+++ core.cpp 2004/08/12 17:17:18
@@ -26,7 +26,7 @@
#include "core.h"
#include "isa.h"
#include <string.h>
-#include <iostream.h>
+#include <iostream>
#include "disarm.h"
#ifndef ARM6
#include "booth.h"
@@ -34,6 +34,8 @@
#include "memory.cpp"
+using namespace std;
+
static const char* mode_str[16] = {"reset", "fiq", "irq", "svc",
NULL, NULL, NULL, "abort",
NULL, NULL, NULL, "undef",
@@ -4031,22 +4033,29 @@
{
char str[80];
- cout.form("-------------------------------------------------------------------------------\n");
- cout.form("SWARM Core debug dump\n\n");
+ cout << "-------------------------------------------------------------------------------\n";
+ cout << "SWARM Core debug dump\n\n";
- cout.form("Registers:");
+ cout << "Registers:";
for (int j = 0; j < 4; j++)
{
- for (int i = 0; i < 4; i++)
- cout.form(" 0x%08X", m_regsWorking[i + (j * 4)]);
- cout.form("\n\t ");
+ for (int i = 0; i < 4; i++) {
+ cout << " ";
+ cout << hex << m_regsWorking[i + (j * 4)];
+ }
+ cout << "\n\t ";
}
- cout.form(" 0x%08X", m_regsWorking[16]);
+ cout << " ";
+ cout << hex << m_regsWorking[16];
- if (m_mode == M_FIQ)
- cout.form("\tSPSR_%s[0x%08x]\n\n", mode_str[m_mode & 0xF], m_regsFiq[7]);
- else if ((m_mode == M_USER) || (m_mode == M_SYSTEM))
- cout.form("\n\n");
+ if (m_mode == M_FIQ) {
+ cout << "\tSPSR_";
+ cout << mode_str[m_mode & 0xF];
+ cout << "[";
+ cout << hex << m_regsFiq[7];
+ cout << "]\n\n";
+ } else if ((m_mode == M_USER) || (m_mode == M_SYSTEM))
+ cout << "\n\n";
else
{
uint32_t* temp;
@@ -4060,31 +4069,50 @@
temp = NULL; break; // ???
}
- if (temp != NULL)
- cout.form("\tSPSR_%s[0x%08x]\n\n", mode_str[m_mode & 0xF], temp[2]);
+ if (temp != NULL) {
+ cout << "\tSPSR_";
+ cout << mode_str[m_mode & 0xF];
+ cout << "[";
+ cout << hex << temp[2];
+ cout << "]\n\n";
+ }
}
- cout.form("Instruction Pipe (top is current instruction):\n");
+ cout << "Instruction Pipe (top is current instruction):\n";
for (int i = 2; i > 0; i--)
{
- cout.form("\t0x%08X - ", m_iPipe[i]);
+ cout << "\t0x";
+ cout << hex << m_iPipe[i];
+ cout << " - ";
memset(str, 0, 80);
CDisarm::Decode(m_iPipe[i], str);
- cout.form("%s\n", str);
+ cout << str;
+ cout << "\n";
}
if (m_busCurrent != NULL)
{
- cout.form("\t0x%08X - ", m_busCurrent->Din);
+ cout << "\t0x";
+ cout << hex << m_busCurrent->Din;
+ cout << " - ";
memset(str, 0, 80);
CDisarm::Decode(m_busCurrent->Din, str);
- cout.form("%s (suspect if bad address error)\n", str);
+ cout << str;
+ cout << " (suspect if bad address error)\n";
}
- cout.form("Instruction Stage last executed - %d\n\n", m_nCtrlCur);
-
- cout.form("DIn reg = 0x%08X DOut reg = 0x%08X Addr reg = 0x%08X\n",
- m_regDataIn, m_regDataOut, m_regAddr);
+ cout << "Instruction Stage last executed - ";
+ cout << dec << m_nCtrlCur;
+ cout << "\n\n";
+
+ cout << "DIn reg = 0x";
+ cout << hex << m_regDataIn;
+ cout << " DOut reg = 0x";
+ cout << hex << m_regDataOut;
+ cout << " Addr reg = 0x";
+ cout << hex << m_regAddr;
+ cout << "\n";
+ cout << dec;
- cout.form("-------------------------------------------------------------------------------\n");
+ cout << "-------------------------------------------------------------------------------\n";
}

View file

@ -0,0 +1,41 @@
$NetBSD: patch-af,v 1.1 2004/08/12 19:59:51 agc Exp $
--- main.cpp 2004/08/12 18:28:49 1.1
+++ main.cpp 2004/08/12 18:29:57
@@ -34,11 +34,13 @@
#endif
#include "cache.h"
#include "direct.h"
-#include <iostream.h>
+#include <iostream>
#include <sys/stat.h>
#include "libc.h"
#include "syscopro.h"
+using namespace std;
+
#define FAST_CYCLE 1
#define SLOW_CYCLE 4
@@ -491,15 +493,18 @@
}
DebuggerRepeatCount--;
}
-#endif DEBUGGER
+#endif /* DEBUGGER */
// Do we need to do anything with the bus?
if (pinout.benable == 1)
{
// Quick sanity check
if (pinout.address >= MEMORY_SIZE)
{
- cerr.form("SWARM failing: Bad address - 0x%08X\n",
- pinout.address);
+ cerr << "SWARM failing: Bad address - 0x";
+ cerr << hex << pinout.address;
+ cerr << "\n";
+
+ cerr << dec;
pArm->DebugDump();

View file

@ -0,0 +1,57 @@
$NetBSD: patch-ag,v 1.1 2004/08/12 19:59:51 agc Exp $
--- syscopro.cpp 2004/08/12 18:34:07 1.1
+++ syscopro.cpp 2004/08/12 18:37:39
@@ -26,10 +26,12 @@
#include "syscopro.h"
#include <string.h>
#include "isa.h"
-#include <iostream.h>
+#include <iostream>
#include "memory.cpp"
+using namespace std;
+
// Defines a dull ARM7 type processor ID. Make = ARM, Arch = 3, rest NULL
#define SWARM_ID 0x41007000
@@ -486,22 +488,28 @@
{
char str[80];
- cout.form("-------------------------------------------------------------------------------\n");
- cout.form("System coprocessor debug dump\n\n");
+ cout << "-------------------------------------------------------------------------------\n";
+ cout << "System coprocessor debug dump\n\n";
- cout.form("Registers:");
+ cout << "Registers:";
for (int j = 0; j < 4; j++)
{
- for (int i = 0; i < 4; i++)
- cout.form(" 0x%08X", m_regsWorking[i + (j * 4)]);
- cout.form("\n\t ");
+ for (int i = 0; i < 4; i++) {
+ cout << " 0x";
+ cout << hex << m_regsWorking[i + (j * 4)];
+ }
+ cout << "\n\t ";
}
- cout.form("\n");
+ cout << "\n";
- cout.form("DIn reg = 0x%08X DOut reg = 0x%08X\n",
- m_regDataIn, m_regDataOut);
+ cout << "DIn reg = 0x";
+ cout << hex << m_regDataIn;
+ cout << " DOut reg = 0x",
+ cout << hex << m_regDataOut;
+ cout << "\n";
+ cout << dec;
- cout.form("-------------------------------------------------------------------------------\n");
+ cout << "-------------------------------------------------------------------------------\n";
}

View file

@ -0,0 +1,22 @@
$NetBSD: patch-ah,v 1.1 2004/08/12 19:59:51 agc Exp $
--- armproc.h 2004/08/12 18:45:56 1.1
+++ armproc.h 2004/08/12 18:46:08
@@ -29,7 +29,7 @@
#include "core.h"
#include "cache.h"
#include "swi.h"
-#include <iostream.h>
+#include <iostream>
#include "copro.h"
#include "ostimer.h"
@@ -37,6 +37,8 @@
#include "lcdctrl.h"
#include "uartctrl.h"
+using namespace std;
+
enum PPROC {P_NORMAL, P_READING1, P_READING, P_WRITING1, P_INTWRITE};
typedef struct POTAG

View file

@ -0,0 +1,15 @@
$NetBSD: patch-ai,v 1.1 2004/08/12 19:59:51 agc Exp $
--- alu.cpp 2004/08/12 18:49:18 1.1
+++ alu.cpp 2004/08/12 18:49:37
@@ -24,7 +24,9 @@
#include "swarm.h"
#include "alu.h"
-#include <iostream.h>
+#include <iostream>
+
+using namespace std;
#define CARRY_FROM(_a,_b,_r) ((_a >> 31) ? ((_b >> 31) | ((~_r) >> 31)) : ((_b >> 31) * ((~_r) >> 31)))

View file

@ -0,0 +1,20 @@
$NetBSD: patch-aj,v 1.1 2004/08/12 19:59:51 agc Exp $
--- libc.cpp 2004/08/12 18:49:18 1.1
+++ libc.cpp 2004/08/12 18:50:21
@@ -31,12 +31,14 @@
#endif
#include <fcntl.h>
-#include <iostream.h>
+#include <iostream>
#include <errno.h>
#include <string.h>
#include "swi.h"
+using namespace std;
+
///////////////////////////////////////////////////////////////////////////////
// The gnuarm struct stat is in a different format to ours, so we need to
// get the data and then copy it field by field.