From 451e41c6e957cdcb97e0a041e0d7a97ed99f1ecc Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 29 Jun 2005 22:16:40 -0400 Subject: [PATCH 1/4] Fix uninitialized variables in ide controller dev/ide_ctrl.cc: Initialize variables to zero to avoid uninitialized usage. --HG-- extra : convert_revision : 98fd0bfc2b7530938c6ab3a55345d0e594098238 --- dev/ide_ctrl.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/ide_ctrl.cc b/dev/ide_ctrl.cc index 0037e06e0..785f18ae8 100644 --- a/dev/ide_ctrl.cc +++ b/dev/ide_ctrl.cc @@ -103,6 +103,8 @@ IdeController::IdeController(Params *p) // setup the disks attached to controller memset(disks, 0, sizeof(IdeDisk *) * 4); + dev[0] = 0; + dev[1] = 0; if (params()->disks.size() > 3) panic("IDE controllers support a maximum of 4 devices attached!\n"); From ec1f689d0db9e1839e1b5a8f67f12d19f56c85e3 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 29 Jun 2005 22:20:38 -0400 Subject: [PATCH 2/4] Easier remote debugging at boot time. sim/system.cc: Add a global variable that will tell the remote debugger to wait when a given CPU is is registered. --HG-- extra : convert_revision : a093c9331daa675d4b59a321e53a5da6ea292c40 --- sim/system.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sim/system.cc b/sim/system.cc index 6f7d53f6b..47ffc4b01 100644 --- a/sim/system.cc +++ b/sim/system.cc @@ -203,6 +203,8 @@ System::breakpoint() return remoteGDB[0]->trap(ALPHA_KENTRY_INT); } +int rgdb_wait = -1; + int System::registerExecContext(ExecContext *xc, int id) { @@ -229,7 +231,8 @@ System::registerExecContext(ExecContext *xc, int id) * Uncommenting this line waits for a remote debugger to connect * to the simulator before continuing. */ - //gdbl->accept(); + if (rgdb_wait != -1 && rgdb_wait == id) + gdbl->accept(); if (remoteGDB.size() <= id) { remoteGDB.resize(id + 1); From 5107b3bc83b5e5f4acbb7113843f942b14346ac2 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Thu, 30 Jun 2005 00:42:27 -0400 Subject: [PATCH 3/4] Fixes for cygwin compile. dev/ide_atareg.h: Need endian.h for LITTLE_ENDIAN. sim/syscall_emul.hh: Need to include sys/fcntl.h to get O_BINARY. --HG-- extra : convert_revision : 606f9506dc483f3952dcc65b8ba25c28001f2c43 --- dev/ide_atareg.h | 7 +++++++ sim/syscall_emul.hh | 3 +++ 2 files changed, 10 insertions(+) diff --git a/dev/ide_atareg.h b/dev/ide_atareg.h index a3a2bd604..5320529c8 100644 --- a/dev/ide_atareg.h +++ b/dev/ide_atareg.h @@ -33,7 +33,14 @@ #ifndef _DEV_ATA_ATAREG_H_ #define _DEV_ATA_ATAREG_H_ +#if defined(linux) +#include +#else +#include +#endif + #define ATA_BYTE_ORDER LITTLE_ENDIAN + /* * Drive parameter structure for ATA/ATAPI. * Bit fields: WDC_* : common to ATA/ATAPI diff --git a/sim/syscall_emul.hh b/sim/syscall_emul.hh index 417531cc3..d061f868e 100644 --- a/sim/syscall_emul.hh +++ b/sim/syscall_emul.hh @@ -37,6 +37,9 @@ #include #include +#ifdef __CYGWIN32__ +#include // for O_BINARY +#endif #include "base/intmath.hh" // for RoundUp #include "mem/functional/functional.hh"