summaryrefslogtreecommitdiff
path: root/kern/linux/linux_system.hh
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-08-23 11:47:12 -0400
committerNathan Binkert <binkertn@umich.edu>2005-08-23 11:47:12 -0400
commitc0de2e7f122924683b5ae2a3a7ce50ce90cf9d73 (patch)
tree0b63b65955fa4f23d79153f874b626ad0a8101d7 /kern/linux/linux_system.hh
parentc761aaae652b101959a6f5e182b67f841727de85 (diff)
downloadgem5-c0de2e7f122924683b5ae2a3a7ce50ce90cf9d73.tar.xz
Clean up the passing of the boot command line to the kernel.
kern/linux/linux_system.cc: Don't hard code the address of the command line in the kernel, instead, deduce it from the location of known symbols. don't use strcpy, it's dangerous. kern/linux/linux_system.hh: Don't hard code the address of the command line in the kernel, instead, deduce it from the location of known symbols. --HG-- extra : convert_revision : 128b1d5dbd00b0b8571707da99f86f76e29abfd1
Diffstat (limited to 'kern/linux/linux_system.hh')
-rw-r--r--kern/linux/linux_system.hh26
1 files changed, 20 insertions, 6 deletions
diff --git a/kern/linux/linux_system.hh b/kern/linux/linux_system.hh
index 32b92f310..2ddddbc1a 100644
--- a/kern/linux/linux_system.hh
+++ b/kern/linux/linux_system.hh
@@ -29,12 +29,6 @@
#ifndef __KERN_LINUX_LINUX_SYSTEM_HH__
#define __KERN_LINUX_LINUX_SYSTEM_HH__
-/**
- * MAGIC address where the kernel arguments should go. Defined as
- * PARAM in linux kernel alpha-asm.
- */
-const Addr PARAM_ADDR = ULL(0xfffffc000030a000);
-
class ExecContext;
class BreakPCEvent;
@@ -53,6 +47,26 @@ class PrintThreadInfo;
class LinuxSystem : public System
{
private:
+ /**
+ * Addresses defining where the kernel bootloader places various
+ * elements. Details found in include/asm-alpha/system.h
+ */
+ Addr KernelStart; // Lookup the symbol swapper_pg_dir
+
+ public:
+ Addr InitStack() const { return KernelStart + 0x02000; }
+ Addr EmptyPGT() const { return KernelStart + 0x04000; }
+ Addr EmptyPGE() const { return KernelStart + 0x08000; }
+ Addr ZeroPGE() const { return KernelStart + 0x0A000; }
+ Addr StartAddr() const { return KernelStart + 0x10000; }
+
+ Addr Param() const { return ZeroPGE() + 0x0; }
+ Addr CommandLine() const { return Param() + 0x0; }
+ Addr InitrdStart() const { return Param() + 0x100; }
+ Addr InitrdSize() const { return Param() + 0x108; }
+ static const int CommandLineSize = 256;
+
+ private:
#ifndef NDEBUG
/** Event to halt the simulator if the kernel calls panic() */
BreakPCEvent *kernelPanicEvent;