gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
i82094aa.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 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;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * Authors: Gabe Black
29  */
30 
31 #ifndef __DEV_X86_I82094AA_HH__
32 #define __DEV_X86_I82094AA_HH__
33 
34 #include <map>
35 
36 #include "base/bitunion.hh"
37 #include "dev/x86/intdev.hh"
38 #include "dev/io_device.hh"
39 #include "params/I82094AA.hh"
40 
41 namespace X86ISA
42 {
43 
44 class I8259;
45 class Interrupts;
46 
47 class I82094AA : public BasicPioDevice, public IntDevice
48 {
49  public:
50  BitUnion64(RedirTableEntry)
51  Bitfield<63, 32> topDW;
52  Bitfield<55, 32> topReserved;
53  Bitfield<31, 0> bottomDW;
54  Bitfield<31, 17> bottomReserved;
55  Bitfield<63, 56> dest;
56  Bitfield<16> mask;
57  Bitfield<15> trigger;
58  Bitfield<14> remoteIRR;
59  Bitfield<13> polarity;
60  Bitfield<12> deliveryStatus;
61  Bitfield<11> destMode;
62  Bitfield<10, 8> deliveryMode;
63  Bitfield<7, 0> vector;
64  EndBitUnion(RedirTableEntry)
65 
66  protected:
67  I8259 * extIntPic;
68 
69  uint8_t regSel;
70  uint8_t initialApicId;
71  uint8_t id;
72  uint8_t arbId;
73 
75 
76  static const uint8_t TableSize = 24;
77  // This implementation is based on version 0x11, but 0x14 avoids having
78  // to deal with the arbitration and APIC bus guck.
79  static const uint8_t APICVersion = 0x14;
80 
81  RedirTableEntry redirTable[TableSize];
82  bool pinStates[TableSize];
83 
84  public:
85  typedef I82094AAParams Params;
86 
87  const Params *
88  params() const
89  {
90  return dynamic_cast<const Params *>(_params);
91  }
92 
93  I82094AA(Params *p);
94 
95  void init() override;
96 
97  Tick read(PacketPtr pkt) override;
98  Tick write(PacketPtr pkt) override;
99 
100  AddrRangeList getIntAddrRange() const override;
101 
102  void writeReg(uint8_t offset, uint32_t value);
103  uint32_t readReg(uint8_t offset);
104 
105  BaseMasterPort &getMasterPort(const std::string &if_name,
106  PortID idx = InvalidPortID) override;
107 
108  Tick recvResponse(PacketPtr pkt) override;
109 
110  void signalInterrupt(int line) override;
111  void raiseInterruptPin(int number) override;
112  void lowerInterruptPin(int number) override;
113 
114  void serialize(CheckpointOut &cp) const override;
115  void unserialize(CheckpointIn &cp) override;
116 };
117 
118 } // namespace X86ISA
119 
120 #endif //__DEV_X86_SOUTH_BRIDGE_I8254_HH__
Bitfield< 15 > trigger
Definition: i82094aa.hh:57
offset
Definition: misc.hh:977
bool pinStates[TableSize]
Definition: i82094aa.hh:82
Bitfield< 31, 17 > bottomReserved
Definition: i82094aa.hh:54
const PortID InvalidPortID
Definition: types.hh:182
void init() override
Definition: i82094aa.cc:63
I82094AA(Params *p)
Definition: i82094aa.cc:42
void lowerInterruptPin(int number) override
Definition: i82094aa.cc:266
EndBitUnion(TriggerIntMessage) namespace DeliveryMode
Definition: intmessage.hh:50
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: i82094aa.cc:120
PioDeviceParams Params
Definition: io_device.hh:116
Bitfield< 13 > polarity
Definition: i82094aa.hh:59
BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a master port with a given name and index.
Definition: i82094aa.cc:74
Tick recvResponse(PacketPtr pkt) override
Definition: i82094aa.cc:92
I82094AAParams Params
Definition: i82094aa.hh:85
static const uint8_t TableSize
Definition: i82094aa.hh:76
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: i82094aa.cc:273
Bitfield< 10, 8 > deliveryMode
Definition: i82094aa.hh:62
void raiseInterruptPin(int number) override
Definition: i82094aa.cc:257
uint32_t readReg(uint8_t offset)
Definition: i82094aa.cc:164
uint64_t Tick
Tick count type.
Definition: types.hh:63
BitUnion64(RedirTableEntry) Bitfield< 63
uint8_t arbId
Definition: i82094aa.hh:72
Bitfield< 16 > mask
Definition: i82094aa.hh:56
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: i82094aa.cc:101
Bitfield< 12 > deliveryStatus
Definition: i82094aa.hh:60
Bitfield< 14 > remoteIRR
Definition: i82094aa.hh:58
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
void writeReg(uint8_t offset, uint32_t value)
Definition: i82094aa.cc:139
uint8_t initialApicId
Definition: i82094aa.hh:70
Bitfield< 31, 0 > bottomDW
Definition: i82094aa.hh:53
EndBitUnion(RedirTableEntry) protected uint8_t regSel
Definition: i82094aa.hh:64
AddrRangeList getIntAddrRange() const override
Definition: i82094aa.cc:82
Bitfield< 55, 32 > topReserved
Definition: i82094aa.hh:52
Bitfield< 7, 0 > vector
Definition: i82094aa.hh:63
std::ostream CheckpointOut
Definition: serialize.hh:67
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
Definition: port.hh:115
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: i82094aa.cc:286
uint64_t lowestPriorityOffset
Definition: i82094aa.hh:74
const SimObjectParams * _params
Cached copy of the object parameters.
Definition: sim_object.hh:107
RedirTableEntry redirTable[TableSize]
Definition: i82094aa.hh:81
static const uint8_t APICVersion
Definition: i82094aa.hh:79
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:181
Bitfield< 0 > p
Definition: pagetable.hh:95
void signalInterrupt(int line) override
Definition: i82094aa.cc:189
Bitfield< 11 > destMode
Definition: i82094aa.hh:61
Bitfield< 63, 56 > dest
Definition: i82094aa.hh:55
const Params * params() const
Definition: i82094aa.hh:88

Generated on Fri Jun 9 2017 13:03:47 for gem5 by doxygen 1.8.6