Deleted Added
sdiff udiff text old ( 2979:88f767122b58 ) new ( 3311:7eb47a60dbd4 )
full compact
1/*
2 * Copyright (c) 2003 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;

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

22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Steve Reinhardt
29 * Ron Dreslinski
30 */
31
32/**
33 * @file
34 * Definitions of page table.
35 */
36#include <string>
37#include <map>

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

92
93
94void
95PageTable::allocate(Addr vaddr, int64_t size)
96{
97 // starting address must be page aligned
98 assert(pageOffset(vaddr) == 0);
99
100 for (; size > 0; size -= pageSize, vaddr += pageSize) {
101 m5::hash_map<Addr,Addr>::iterator iter = pTable.find(vaddr);
102
103 if (iter != pTable.end()) {
104 // already mapped
105 fatal("PageTable::allocate: address 0x%x already mapped", vaddr);
106 }
107

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

154 assert(pageAlign(req->getVaddr() + req->getSize() - 1)
155 == pageAlign(req->getVaddr()));
156 if (!translate(req->getVaddr(), paddr)) {
157 return genPageTableFault(req->getVaddr());
158 }
159 req->setPaddr(paddr);
160 return page_check(req->getPaddr(), req->getSize());
161}