summaryrefslogtreecommitdiff
path: root/src/arch/x86/x86_traits.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2008-10-12 11:08:00 -0700
committerGabe Black <gblack@eecs.umich.edu>2008-10-12 11:08:00 -0700
commit42ebebf99a7d6ce2358b152f643b52c7946f9202 (patch)
tree2255b51553c45c650a94950b1654cdec917ff339 /src/arch/x86/x86_traits.hh
parentd9f9c967fbe651e09d444e460a9b1c5a450b1cd2 (diff)
downloadgem5-42ebebf99a7d6ce2358b152f643b52c7946f9202.tar.xz
X86: Make the local APIC accessible through the memory system directly, and make the timer work.
Diffstat (limited to 'src/arch/x86/x86_traits.hh')
-rw-r--r--src/arch/x86/x86_traits.hh17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/arch/x86/x86_traits.hh b/src/arch/x86/x86_traits.hh
index f46279c81..6b4671a08 100644
--- a/src/arch/x86/x86_traits.hh
+++ b/src/arch/x86/x86_traits.hh
@@ -55,11 +55,13 @@
* Authors: Gabe Black
*/
-#include "sim/host.hh"
-
#ifndef __ARCH_X86_X86TRAITS_HH__
#define __ARCH_X86_X86TRAITS_HH__
+#include <assert.h>
+
+#include "sim/host.hh"
+
namespace X86ISA
{
const int NumMicroIntRegs = 16;
@@ -90,6 +92,10 @@ namespace X86ISA
const Addr PhysAddrPrefixIO = ULL(0x8000000000000000);
const Addr PhysAddrPrefixPciConfig = ULL(0xC000000000000000);
+ const Addr PhysAddrPrefixLocalAPIC = ULL(0xA000000000000000);
+ // Each APIC gets two pages. One page is used for local apics to field
+ // accesses from the CPU, and the other is for all APICs to communicate.
+ const Addr PhysAddrAPICRangeSize = 1 << 12;
static inline Addr
x86IOAddress(const uint32_t port)
@@ -102,6 +108,13 @@ namespace X86ISA
{
return PhysAddrPrefixPciConfig | addr;
}
+
+ static inline Addr
+ x86LocalAPICAddress(const uint8_t id, const uint16_t addr)
+ {
+ assert(addr < (1 << 12));
+ return PhysAddrPrefixLocalAPIC | (id * (1 << 12)) | addr;
+ }
}
#endif //__ARCH_X86_X86TRAITS_HH__