page_table.hh (10556:1e3b3c7a0cba) | page_table.hh (10558:426665ec11a9) |
---|---|
1/* 2 * Copyright (c) 2014 Advanced Micro Devices, Inc. 3 * Copyright (c) 2003 The Regents of The University of Michigan 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 71 unchanged lines hidden (view full) --- 80 assert(isPowerOf2(pageSize)); 81 pTableCache[0].valid = false; 82 pTableCache[1].valid = false; 83 pTableCache[2].valid = false; 84 } 85 86 virtual ~PageTableBase() {}; 87 | 1/* 2 * Copyright (c) 2014 Advanced Micro Devices, Inc. 3 * Copyright (c) 2003 The Regents of The University of Michigan 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 71 unchanged lines hidden (view full) --- 80 assert(isPowerOf2(pageSize)); 81 pTableCache[0].valid = false; 82 pTableCache[1].valid = false; 83 pTableCache[2].valid = false; 84 } 85 86 virtual ~PageTableBase() {}; 87 |
88 /* generic page table mapping flags 89 * unset | set 90 * bit 0 - no-clobber | clobber 91 * bit 1 - present | not-present 92 * bit 2 - cacheable | uncacheable 93 * bit 3 - read-write | read-only 94 */ 95 enum MappingFlags : uint32_t { 96 Clobber = 1, 97 NotPresent = 2, 98 Uncacheable = 4, 99 ReadOnly = 8, 100 }; 101 |
|
88 virtual void initState(ThreadContext* tc) = 0; 89 90 // for DPRINTF compatibility 91 const std::string name() const { return _name; } 92 93 Addr pageAlign(Addr a) { return (a & ~offsetMask); } 94 Addr pageOffset(Addr a) { return (a & offsetMask); } 95 | 102 virtual void initState(ThreadContext* tc) = 0; 103 104 // for DPRINTF compatibility 105 const std::string name() const { return _name; } 106 107 Addr pageAlign(Addr a) { return (a & ~offsetMask); } 108 Addr pageOffset(Addr a) { return (a & offsetMask); } 109 |
110 /** 111 * Maps a virtual memory region to a physical memory region. 112 * @param vaddr The starting virtual address of the region. 113 * @param paddr The starting physical address where the region is mapped. 114 * @param size The length of the region. 115 * @param flags Generic mapping flags that can be set by or-ing values 116 * from MappingFlags enum. 117 */ |
|
96 virtual void map(Addr vaddr, Addr paddr, int64_t size, | 118 virtual void map(Addr vaddr, Addr paddr, int64_t size, |
97 bool clobber = false) = 0; | 119 uint64_t flags = 0) = 0; |
98 virtual void remap(Addr vaddr, int64_t size, Addr new_vaddr) = 0; 99 virtual void unmap(Addr vaddr, int64_t size) = 0; 100 101 /** 102 * Check if any pages in a region are already allocated 103 * @param vaddr The starting virtual address of the region. 104 * @param size The length of the region. 105 * @return True if no pages in the region are mapped. --- 86 unchanged lines hidden (view full) --- 192 Addr _pageSize = TheISA::PageBytes); 193 194 ~FuncPageTable(); 195 196 void initState(ThreadContext* tc) 197 { 198 } 199 | 120 virtual void remap(Addr vaddr, int64_t size, Addr new_vaddr) = 0; 121 virtual void unmap(Addr vaddr, int64_t size) = 0; 122 123 /** 124 * Check if any pages in a region are already allocated 125 * @param vaddr The starting virtual address of the region. 126 * @param size The length of the region. 127 * @return True if no pages in the region are mapped. --- 86 unchanged lines hidden (view full) --- 214 Addr _pageSize = TheISA::PageBytes); 215 216 ~FuncPageTable(); 217 218 void initState(ThreadContext* tc) 219 { 220 } 221 |
200 void map(Addr vaddr, Addr paddr, int64_t size, bool clobber = false); | 222 void map(Addr vaddr, Addr paddr, int64_t size, 223 uint64_t flags = 0); |
201 void remap(Addr vaddr, int64_t size, Addr new_vaddr); 202 void unmap(Addr vaddr, int64_t size); 203 204 /** 205 * Check if any pages in a region are already allocated 206 * @param vaddr The starting virtual address of the region. 207 * @param size The length of the region. 208 * @return True if no pages in the region are mapped. --- 31 unchanged lines hidden --- | 224 void remap(Addr vaddr, int64_t size, Addr new_vaddr); 225 void unmap(Addr vaddr, int64_t size); 226 227 /** 228 * Check if any pages in a region are already allocated 229 * @param vaddr The starting virtual address of the region. 230 * @param size The length of the region. 231 * @return True if no pages in the region are mapped. --- 31 unchanged lines hidden --- |