gem5 [DEVELOP-FOR-25.1]
Loading...
Searching...
No Matches
host.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions are
16 * met: redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer;
18 * redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution;
21 * neither the name of the copyright holders nor the names of its
22 * contributors may be used to endorse or promote products derived from
23 * this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef __DEV_PCI_HOST_HH__
39#define __DEV_PCI_HOST_HH__
40
41#include "base/addr_range.hh"
42#include "dev/pci/types.hh"
43#include "dev/pci/upstream.hh"
44#include "params/PciHost.hh"
45
46namespace gem5
47{
48
49struct GenericPciHostParams;
50
51class Platform;
52
73class PciHost : public PciUpstream
74{
75 public:
76 PciHost(const PciHostParams &p);
77 virtual ~PciHost();
78};
79
109{
110 public:
111 GenericPciHost(const GenericPciHostParams &p);
112 virtual ~GenericPciHost();
113
114 AddrRange getConfigAddrRange() const override;
115
116 protected: // PciUpstream
117 AddrRange interfaceConfigRange(const PciDevAddr &dev_addr) const override;
118
119 Addr
120 interfacePioAddr(const PciDevAddr &dev_addr, Addr pci_addr) const override
121 {
122 return pciPioBase + pci_addr;
123 }
124
125 Addr
126 interfaceMemAddr(const PciDevAddr &dev_addr, Addr pci_addr) const override
127 {
128 return pciMemBase + pci_addr;
129 }
130
131 Addr
132 interfaceDmaAddr(const PciDevAddr &dev_addr, Addr pci_addr) const override
133 {
134 return pciDmaBase + pci_addr;
135 }
136
138 getBusNum() const override
139 {
140 return 0;
141 }
142
143 protected: // Interrupt handling
144 void interfacePostInt(const PciDevAddr &addr, PciIntPin pin) override;
145 void interfaceClearInt(const PciDevAddr &addr, PciIntPin pin) override;
146
147 virtual uint32_t mapPciInterrupt(const PciDevAddr &dev_addr,
148 PciIntPin pin) const;
149
150 protected:
152
155 const uint8_t confDeviceBits;
156
160};
161
162} // namespace gem5
163
164#endif // __DEV_PCI_HOST_HH__
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Definition addr_range.hh:82
Addr interfaceMemAddr(const PciDevAddr &dev_addr, Addr pci_addr) const override
Calculate the physical address of a non-prefetchable memory location in the PCI address space.
Definition host.hh:126
Addr interfaceDmaAddr(const PciDevAddr &dev_addr, Addr pci_addr) const override
Calculate the physical address of a prefetchable memory location in the PCI address space.
Definition host.hh:132
PciBusNum getBusNum() const override
Get the PCI bus number assign to that upstream.
Definition host.hh:138
Addr interfacePioAddr(const PciDevAddr &dev_addr, Addr pci_addr) const override
Calculate the physical address of an IO location on the PCI bus.
Definition host.hh:120
const uint8_t confDeviceBits
Definition host.hh:155
virtual uint32_t mapPciInterrupt(const PciDevAddr &dev_addr, PciIntPin pin) const
Definition host.cc:102
const Addr confBase
Definition host.hh:153
GenericPciHost(const GenericPciHostParams &p)
Definition host.cc:59
void interfaceClearInt(const PciDevAddr &addr, PciIntPin pin) override
Post an interrupt to the CPU.
Definition host.cc:96
const Addr pciMemBase
Definition host.hh:158
AddrRange interfaceConfigRange(const PciDevAddr &dev_addr) const override
Calculate the physical address range of the PCI device configuration space.
Definition host.cc:80
const Addr confSize
Definition host.hh:154
virtual ~GenericPciHost()
Definition host.cc:69
AddrRange getConfigAddrRange() const override
Get the range for the configuration memory space for which this PCI upstream is responsible.
Definition host.cc:74
const Addr pciDmaBase
Definition host.hh:159
Platform & platform
Definition host.hh:151
void interfacePostInt(const PciDevAddr &addr, PciIntPin pin) override
Post an interrupt to the CPU.
Definition host.cc:90
const Addr pciPioBase
Definition host.hh:157
PciHost(const PciHostParams &p)
Definition host.cc:52
virtual ~PciHost()
Definition host.cc:55
PciUpstream(const Params &p)
Definition upstream.cc:69
Bitfield< 0 > p
Bitfield< 3 > addr
Definition types.hh:84
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
PciIntPin
Definition types.hh:74
uint8_t PciBusNum
Definition types.hh:46
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147

Generated on Mon Oct 27 2025 04:13:02 for gem5 by doxygen 1.14.0