From fae60c164e284864cfabea515db6ba28d601b71d Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Wed, 1 Aug 2007 16:59:14 -0400 Subject: Arguments: Get rid of duplicate code for the Arguments class in each architecture. Move the argument files to src/sim and add a utility.cc file with a function getArguments() that returns the given argument in the architecture specific fashion. getArguments() was getArg() is the architecture specific Argument class and has had all magic numbers replaced with meaningful constants. Also add a function to the Argument class for testing if an argument is NULL. --HG-- rename : src/arch/alpha/arguments.cc => src/sim/arguments.cc rename : src/arch/alpha/arguments.hh => src/sim/arguments.hh extra : convert_revision : 8b93667bafaa03b52aadb64d669adfe835266b8e --- src/kern/linux/events.cc | 4 ++-- src/kern/linux/printk.cc | 4 ++-- src/kern/linux/printk.hh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/kern/linux') diff --git a/src/kern/linux/events.cc b/src/kern/linux/events.cc index 42fa63a27..bfff816ca 100644 --- a/src/kern/linux/events.cc +++ b/src/kern/linux/events.cc @@ -29,7 +29,7 @@ * Ali Saidi */ -#include "arch/arguments.hh" +#include "sim/arguments.hh" #include "base/trace.hh" #include "cpu/thread_context.hh" #include "kern/linux/events.hh" @@ -46,7 +46,7 @@ DebugPrintkEvent::process(ThreadContext *tc) { if (DTRACE(DebugPrintf)) { std::stringstream ss; - TheISA::Arguments args(tc); + Arguments args(tc); Printk(ss, args); StringWrap name(tc->getSystemPtr()->name() + ".dprintk"); DPRINTFN("%s", ss.str()); diff --git a/src/kern/linux/printk.cc b/src/kern/linux/printk.cc index 866353e31..24e28e666 100644 --- a/src/kern/linux/printk.cc +++ b/src/kern/linux/printk.cc @@ -32,7 +32,7 @@ #include #include -#include "arch/arguments.hh" +#include "sim/arguments.hh" #include "base/trace.hh" #include "kern/linux/printk.hh" @@ -40,7 +40,7 @@ using namespace std; void -Printk(stringstream &out, TheISA::Arguments args) +Printk(stringstream &out, Arguments args) { char *p = (char *)args++; diff --git a/src/kern/linux/printk.hh b/src/kern/linux/printk.hh index 20dfb430f..da9564b7e 100644 --- a/src/kern/linux/printk.hh +++ b/src/kern/linux/printk.hh @@ -36,8 +36,8 @@ #include -class TheISA::Arguments; +class Arguments; -void Printk(std::stringstream &out, TheISA::Arguments args); +void Printk(std::stringstream &out, Arguments args); #endif // __PRINTK_HH__ -- cgit v1.2.3