tlb.cc (5323:75f7e6366a41) tlb.cc (5357:eecb5fd0be62)
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

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

71#include "mem/request.hh"
72
73#if FULL_SYSTEM
74#include "arch/x86/pagetable_walker.hh"
75#endif
76
77namespace X86ISA {
78
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

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

71#include "mem/request.hh"
72
73#if FULL_SYSTEM
74#include "arch/x86/pagetable_walker.hh"
75#endif
76
77namespace X86ISA {
78
79TLB::TLB(const Params *p) : SimObject(p), size(p->size)
79TLB::TLB(const Params *p) : SimObject(p), configAddress(0), size(p->size)
80{
81 tlb = new TlbEntry[size];
82 std::memset(tlb, 0, sizeof(TlbEntry) * size);
83
84 for (int x = 0; x < size; x++)
85 freeList.push_back(&tlb[x]);
86
87#if FULL_SYSTEM

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

143 while (!entryList.empty()) {
144 TlbEntry *entry = entryList.front();
145 entryList.pop_front();
146 freeList.push_back(entry);
147 }
148}
149
150void
80{
81 tlb = new TlbEntry[size];
82 std::memset(tlb, 0, sizeof(TlbEntry) * size);
83
84 for (int x = 0; x < size; x++)
85 freeList.push_back(&tlb[x]);
86
87#if FULL_SYSTEM

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

143 while (!entryList.empty()) {
144 TlbEntry *entry = entryList.front();
145 entryList.pop_front();
146 freeList.push_back(entry);
147 }
148}
149
150void
151TLB::setConfigAddress(uint32_t addr)
152{
153 configAddress = addr;
154}
155
156void
151TLB::invalidateNonGlobal()
152{
153 DPRINTF(TLB, "Invalidating all non global entries.\n");
154 EntryList::iterator entryIt;
155 for (entryIt = entryList.begin(); entryIt != entryList.end();) {
156 if (!(*entryIt)->global) {
157 freeList.push_back(*entryIt);
158 entryList.erase(entryIt++);

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

473 } else if (prefix == IntAddrPrefixIO) {
474 // TODO If CPL > IOPL or in virtual mode, check the I/O permission
475 // bitmap in the TSS.
476
477 Addr IOPort = vaddr & ~IntAddrPrefixMask;
478 // Make sure the address fits in the expected 16 bit IO address
479 // space.
480 assert(!(IOPort & ~0xFFFF));
157TLB::invalidateNonGlobal()
158{
159 DPRINTF(TLB, "Invalidating all non global entries.\n");
160 EntryList::iterator entryIt;
161 for (entryIt = entryList.begin(); entryIt != entryList.end();) {
162 if (!(*entryIt)->global) {
163 freeList.push_back(*entryIt);
164 entryList.erase(entryIt++);

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

479 } else if (prefix == IntAddrPrefixIO) {
480 // TODO If CPL > IOPL or in virtual mode, check the I/O permission
481 // bitmap in the TSS.
482
483 Addr IOPort = vaddr & ~IntAddrPrefixMask;
484 // Make sure the address fits in the expected 16 bit IO address
485 // space.
486 assert(!(IOPort & ~0xFFFF));
481 req->setPaddr(PhysAddrPrefixIO | IOPort);
487 if (IOPort == 0xCF8 && req->getSize() == 4) {
488 req->setMmapedIpr(true);
489 req->setPaddr(MISCREG_PCI_CONFIG_ADDRESS * sizeof(MiscReg));
490 } else if ((IOPort & ~mask(2)) == 0xCFC) {
491 Addr configAddress =
492 tc->readMiscRegNoEffect(MISCREG_PCI_CONFIG_ADDRESS);
493 if (bits(configAddress, 31, 31)) {
494 req->setPaddr(PhysAddrPrefixPciConfig |
495 bits(configAddress, 30, 0));
496 }
497 } else {
498 req->setPaddr(PhysAddrPrefixIO | IOPort);
499 }
482 return NoFault;
483 } else {
484 panic("Access to unrecognized internal address space %#x.\n",
485 prefix);
486 }
487 }
488
489 // Get cr0. This will tell us how to do translation. We'll assume it was

--- 134 unchanged lines hidden ---
500 return NoFault;
501 } else {
502 panic("Access to unrecognized internal address space %#x.\n",
503 prefix);
504 }
505 }
506
507 // Get cr0. This will tell us how to do translation. We'll assume it was

--- 134 unchanged lines hidden ---