pagetable.hh (3826:e35adf01a285) pagetable.hh (4070:74449a198a44)
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 31 unchanged lines hidden (view full) ---

40
41namespace SparcISA
42{
43struct VAddr
44{
45 VAddr(Addr a) { panic("not implemented yet."); }
46};
47
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 31 unchanged lines hidden (view full) ---

40
41namespace SparcISA
42{
43struct VAddr
44{
45 VAddr(Addr a) { panic("not implemented yet."); }
46};
47
48class TteTag
49{
50 private:
51 uint64_t entry;
52 bool populated;
53
54 public:
55 TteTag() : entry(0), populated(false) {}
56 TteTag(uint64_t e) : entry(e), populated(true) {}
57 const TteTag &operator=(uint64_t e) { populated = true;
58 entry = e; return *this; }
59 bool valid() const {assert(populated); return !bits(entry,62,62); }
60 Addr va() const {assert(populated); return bits(entry,41,0); }
61};
62
63
48class PageTableEntry
49{
50 public:
51 enum EntryType {
52 sun4v,
53 sun4u,
54 invalid
55 };

--- 49 unchanged lines hidden (view full) ---

105 static int pageSizes[6];
106
107
108 uint64_t operator()() const { assert(populated); return entry4u; }
109 const PageTableEntry &operator=(uint64_t e) { populated = true;
110 entry4u = e; return *this; }
111
112 const PageTableEntry &operator=(const PageTableEntry &e)
64class PageTableEntry
65{
66 public:
67 enum EntryType {
68 sun4v,
69 sun4u,
70 invalid
71 };

--- 49 unchanged lines hidden (view full) ---

121 static int pageSizes[6];
122
123
124 uint64_t operator()() const { assert(populated); return entry4u; }
125 const PageTableEntry &operator=(uint64_t e) { populated = true;
126 entry4u = e; return *this; }
127
128 const PageTableEntry &operator=(const PageTableEntry &e)
113 { populated = true; entry4u = e.entry4u; return *this; }
129 { populated = true; entry4u = e.entry4u; type = e.type; return *this; }
114
115 bool valid() const { return bits(entry4u,63,63) && populated; }
116 uint8_t _size() const { assert(populated);
117 return bits(entry4u, 62,61) |
118 bits(entry4u, 48,48) << 2; }
119 Addr size() const { assert(_size() < 6); return pageSizes[_size()]; }
130
131 bool valid() const { return bits(entry4u,63,63) && populated; }
132 uint8_t _size() const { assert(populated);
133 return bits(entry4u, 62,61) |
134 bits(entry4u, 48,48) << 2; }
135 Addr size() const { assert(_size() < 6); return pageSizes[_size()]; }
136 Addr sizeMask() const { assert(_size() < 6); return pageSizes[_size()]-1;}
120 bool ie() const { return bits(entry4u, 59,59); }
121 Addr pfn() const { assert(populated); return bits(entry4u,39,13); }
122 Addr paddr() const { assert(populated); return mbits(entry4u, 39,13);}
123 bool locked() const { assert(populated); return bits(entry4u,6,6); }
124 bool cv() const { assert(populated); return bits(entry4u,4,4); }
125 bool cp() const { assert(populated); return bits(entry4u,5,5); }
126 bool priv() const { assert(populated); return bits(entry4u,2,2); }
127 bool writable() const { assert(populated); return bits(entry4u,1,1); }
128 bool nofault() const { assert(populated); return bits(entry4u,60,60); }
129 bool sideffect() const { assert(populated); return bits(entry4u,3,3); }
137 bool ie() const { return bits(entry4u, 59,59); }
138 Addr pfn() const { assert(populated); return bits(entry4u,39,13); }
139 Addr paddr() const { assert(populated); return mbits(entry4u, 39,13);}
140 bool locked() const { assert(populated); return bits(entry4u,6,6); }
141 bool cv() const { assert(populated); return bits(entry4u,4,4); }
142 bool cp() const { assert(populated); return bits(entry4u,5,5); }
143 bool priv() const { assert(populated); return bits(entry4u,2,2); }
144 bool writable() const { assert(populated); return bits(entry4u,1,1); }
145 bool nofault() const { assert(populated); return bits(entry4u,60,60); }
146 bool sideffect() const { assert(populated); return bits(entry4u,3,3); }
147 Addr paddrMask() const { assert(populated);
148 return mbits(entry4u, 39,13) & ~sizeMask(); }
130};
131
132struct TlbRange {
133 Addr va;
134 Addr size;
135 int contextId;
136 int partitionId;
137 bool real;

--- 51 unchanged lines hidden ---
149};
150
151struct TlbRange {
152 Addr va;
153 Addr size;
154 int contextId;
155 int partitionId;
156 bool real;

--- 51 unchanged lines hidden ---