pci.cc (11930:2d22a73fa4c7) pci.cc (11932:98961d1b51ca)
1/*
1/*
2 * Copyright (c) 2014 ARM Limited
2 * Copyright (c) 2014, 2017 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

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

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 * Authors: Andreas Sandberg
38 */
39
40#include "dev/virtio/pci.hh"
41
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

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

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 * Authors: Andreas Sandberg
38 */
39
40#include "dev/virtio/pci.hh"
41
42#include "base/bitfield.hh"
42#include "debug/VIOIface.hh"
43#include "mem/packet_access.hh"
44#include "params/PciVirtIO.hh"
45
46PciVirtIO::PciVirtIO(const Params *params)
47 : PciDevice(params), queueNotify(0), interruptDeliveryPending(false),
48 vio(*params->vio), callbackKick(this)
49{
50 // Override the subsystem ID with the device ID from VirtIO
51 config.subsystemID = htole(vio.deviceId);
43#include "debug/VIOIface.hh"
44#include "mem/packet_access.hh"
45#include "params/PciVirtIO.hh"
46
47PciVirtIO::PciVirtIO(const Params *params)
48 : PciDevice(params), queueNotify(0), interruptDeliveryPending(false),
49 vio(*params->vio), callbackKick(this)
50{
51 // Override the subsystem ID with the device ID from VirtIO
52 config.subsystemID = htole(vio.deviceId);
52 BARSize[0] = BAR0_SIZE_BASE + vio.configSize;
53
53
54 // The kernel driver expects the BAR size to be an exact power of
55 // two. Nothing else is supported. Therefore, we need to force
56 // that alignment here. We do not touch vio.configSize as this is
57 // used to check accesses later on.
58 BARSize[0] = alignToPowerOfTwo(BAR0_SIZE_BASE + vio.configSize);
59
54 vio.registerKickCallback(&callbackKick);
55}
56
57PciVirtIO::~PciVirtIO()
58{
59}
60
61Tick

--- 165 unchanged lines hidden ---
60 vio.registerKickCallback(&callbackKick);
61}
62
63PciVirtIO::~PciVirtIO()
64{
65}
66
67Tick

--- 165 unchanged lines hidden ---