page_table.cc (8601:af28085882dc) page_table.cc (8641:4d3ecac1abec)
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;

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

88{
89 assert(pageOffset(vaddr) == 0);
90 assert(pageOffset(new_vaddr) == 0);
91
92 DPRINTF(MMU, "moving pages from vaddr %08p to %08p, size = %d\n", vaddr,
93 new_vaddr, size);
94
95 for (; size > 0; size -= pageSize, vaddr += pageSize, new_vaddr += pageSize) {
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;

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

88{
89 assert(pageOffset(vaddr) == 0);
90 assert(pageOffset(new_vaddr) == 0);
91
92 DPRINTF(MMU, "moving pages from vaddr %08p to %08p, size = %d\n", vaddr,
93 new_vaddr, size);
94
95 for (; size > 0; size -= pageSize, vaddr += pageSize, new_vaddr += pageSize) {
96 PTableItr iter = pTable.find(vaddr);
96 assert(pTable.find(vaddr) != pTable.end());
97
97
98 assert(iter != pTable.end());
99
100 pTable[new_vaddr] = pTable[vaddr];
101 pTable.erase(vaddr);
102 pTable[new_vaddr].updateVaddr(new_vaddr);
103 updateCache(new_vaddr, pTable[new_vaddr]);
104 }
105}
106
107void
108PageTable::unmap(Addr vaddr, int64_t size)
109{
110 assert(pageOffset(vaddr) == 0);
111
112 DPRINTF(MMU, "Unmapping page: %#x-%#x\n", vaddr, vaddr+ size);
113
114 for (; size > 0; size -= pageSize, vaddr += pageSize) {
98 pTable[new_vaddr] = pTable[vaddr];
99 pTable.erase(vaddr);
100 pTable[new_vaddr].updateVaddr(new_vaddr);
101 updateCache(new_vaddr, pTable[new_vaddr]);
102 }
103}
104
105void
106PageTable::unmap(Addr vaddr, int64_t size)
107{
108 assert(pageOffset(vaddr) == 0);
109
110 DPRINTF(MMU, "Unmapping page: %#x-%#x\n", vaddr, vaddr+ size);
111
112 for (; size > 0; size -= pageSize, vaddr += pageSize) {
115 PTableItr iter = pTable.find(vaddr);
113 assert(pTable.find(vaddr) != pTable.end());
116
114
117 assert(iter != pTable.end());
118
119 pTable.erase(vaddr);
120 }
121
122}
123
124bool
125PageTable::isUnmapped(Addr vaddr, int64_t size)
126{

--- 111 unchanged lines hidden ---
115 pTable.erase(vaddr);
116 }
117
118}
119
120bool
121PageTable::isUnmapped(Addr vaddr, int64_t size)
122{

--- 111 unchanged lines hidden ---