gem5  v21.1.0.2
mem_pool.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2021 Advanced Micro Devices, Inc.
3  * All rights reserved.
4  *
5  * For use for simulation and test purposes only
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  * this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from this
19  * software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef __MEM_POOL_HH__
35 #define __MEM_POOL_HH__
36 
37 #include "base/types.hh"
38 
39 namespace gem5
40 {
41 
42 class System;
43 
45 class MemPool
46 {
47  private:
49 
52 
55 
56  public:
58 
59  Counter freePage() const;
60  void setFreePage(Counter value);
61  Addr freePageAddr() const;
62  Counter totalPages() const;
63 
64  Counter allocatedPages() const;
65  Counter freePages() const;
66 
67  Addr allocatedBytes() const;
68  Addr freeBytes() const;
69  Addr totalBytes() const;
70 
71  Addr allocate(Addr npages);
72 };
73 
74 } // namespace gem5
75 
76 #endif // __MEM_POOL_HH__
gem5::MemPool::freeBytes
Addr freeBytes() const
Definition: mem_pool.cc:90
gem5::MemPool::sys
System * sys
Definition: mem_pool.hh:48
gem5::MemPool::freePages
Counter freePages() const
Definition: mem_pool.cc:78
gem5::X86ISA::system
Bitfield< 15 > system
Definition: misc.hh:1003
gem5::X86ISA::limit
BitfieldType< SegDescriptorLimit > limit
Definition: misc.hh:930
gem5::MemPool
Class for handling allocation of physical pages in SE mode.
Definition: mem_pool.hh:45
gem5::MemPool::totalPages
Counter totalPages() const
Definition: mem_pool.cc:66
gem5::MemPool::setFreePage
void setFreePage(Counter value)
Definition: mem_pool.cc:54
gem5::System
Definition: system.hh:77
gem5::MemPool::allocate
Addr allocate(Addr npages)
Definition: mem_pool.cc:102
gem5::MemPool::freePage
Counter freePage() const
Definition: mem_pool.cc:48
gem5::MemPool::totalBytes
Addr totalBytes() const
Definition: mem_pool.cc:96
gem5::MemPool::allocatedPages
Counter allocatedPages() const
Definition: mem_pool.cc:72
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::MemPool::allocatedBytes
Addr allocatedBytes() const
Definition: mem_pool.cc:84
gem5::MemPool::freePageAddr
Addr freePageAddr() const
Definition: mem_pool.cc:60
types.hh
gem5::statistics::Counter
double Counter
All counters are of 64-bit values.
Definition: types.hh:47
gem5::MemPool::freePageNum
Counter freePageNum
Page number to free memory.
Definition: mem_pool.hh:51
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::MemPool::_totalPages
Counter _totalPages
The size of the pool, in number of pages.
Definition: mem_pool.hh:54
gem5::MemPool::MemPool
MemPool(System *system, Addr ptr, Addr limit)
Definition: mem_pool.cc:41

Generated on Tue Sep 21 2021 12:25:48 for gem5 by doxygen 1.8.17