Source('i82094aa.cc')
DebugFlag('I82094AA')
- SimObject('X86IntPin.py')
Source('intdev.cc')
DebugFlag('IntDevice')
+++ /dev/null
-# Copyright (c) 2008 The Regents of The University of Michigan
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met: redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer;
-# redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution;
-# neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Authors: Gabe Black
-
-from m5.params import *
-from m5.SimObject import SimObject
-
-# A generic pin to drive an interrupt signal generated by a device.
-class X86IntSourcePin(SimObject):
- type = 'X86IntSourcePin'
- cxx_class = 'X86ISA::IntSourcePin'
- cxx_header = "dev/x86/intdev.hh"
-
-# A generic pin to receive an interrupt signal generated by another device.
-class X86IntSinkPin(SimObject):
- type = 'X86IntSinkPin'
- cxx_class = 'X86ISA::IntSinkPin'
- cxx_header = "dev/x86/intdev.hh"
-
- device = Param.SimObject("Device this pin belongs to")
- number = Param.Int("The pin number on the device")
-
-# An interrupt line which is driven by a source pin and drives a sink pin.
-class X86IntLine(SimObject):
- type = 'X86IntLine'
- cxx_class = 'X86ISA::IntLine'
- cxx_header = "dev/x86/intdev.hh"
-
- source = Param.X86IntSourcePin("Pin driving this line")
- sink = Param.X86IntSinkPin("Pin driven by this line")
class X86RTC : public MC146818
{
public:
- std::vector<::IntSourcePin<X86RTC> *> intPin;
+ std::vector<IntSourcePin<X86RTC> *> intPin;
X86RTC(EventManager *em, const std::string &n, const struct tm time,
bool bcd, Tick frequency, int int_pin_count) :
MC146818(em, n, time, bcd, frequency)
{
for (int i = 0; i < int_pin_count; i++) {
- intPin.push_back(new ::IntSourcePin<X86RTC>(
+ intPin.push_back(new IntSourcePin<X86RTC>(
csprintf("%s.int_pin[%d]", n, i), i, this));
}
}
commandByte.keyboardFullInt = 1;
for (int i = 0; i < p->port_keyboard_int_pin_connection_count; i++) {
- keyboardIntPin.push_back(new ::IntSourcePin<I8042>(
+ keyboardIntPin.push_back(new IntSourcePin<I8042>(
csprintf("%s.keyboard_int_pin[%d]", name(), i), i, this));
}
for (int i = 0; i < p->port_mouse_int_pin_connection_count; i++) {
- mouseIntPin.push_back(new ::IntSourcePin<I8042>(
+ mouseIntPin.push_back(new IntSourcePin<I8042>(
csprintf("%s.mouse_int_pin[%d]", name(), i), i, this));
}
}
static const uint16_t NoCommand = (uint16_t)(-1);
uint16_t lastCommand;
- std::vector<::IntSourcePin<I8042> *> mouseIntPin;
- std::vector<::IntSourcePin<I8042> *> keyboardIntPin;
+ std::vector<IntSourcePin<I8042> *> mouseIntPin;
+ std::vector<IntSourcePin<I8042> *> keyboardIntPin;
PS2Device *mouse;
PS2Device *keyboard;
}
for (int i = 0; i < p->port_inputs_connection_count; i++)
- inputs.push_back(new ::IntSinkPin<I82094AA>(
+ inputs.push_back(new IntSinkPin<I82094AA>(
csprintf("%s.inputs[%d]", name(), i), i, this));
}
RedirTableEntry redirTable[TableSize];
bool pinStates[TableSize];
- std::vector<::IntSinkPin<I82094AA> *> inputs;
+ std::vector<IntSinkPin<I82094AA> *> inputs;
public:
typedef I82094AAParams Params;
X86Intel8254Timer pit;
- std::vector<::IntSourcePin<I8254> *> intPin;
+ std::vector<IntSourcePin<I8254> *> intPin;
void counterInterrupt(unsigned int num);
pit(p->name, this)
{
for (int i = 0; i < p->port_int_pin_connection_count; i++) {
- intPin.push_back(new ::IntSourcePin<I8254>(csprintf(
+ intPin.push_back(new IntSourcePin<I8254>(csprintf(
"%s.int_pin[%d]", name(), i), i, this));
}
}
readIRR(true), initControlWord(0), autoEOI(false)
{
for (int i = 0; i < p->port_output_connection_count; i++) {
- output.push_back(new ::IntSourcePin<I8259>(
+ output.push_back(new IntSourcePin<I8259>(
csprintf("%s.output[%d]", name(), i), i, this));
}
panic_if(in_count >= NumLines,
"I8259 only supports 8 inputs, but there are %d.", in_count);
for (int i = 0; i < in_count; i++) {
- inputs.push_back(new ::IntSinkPin<I8259>(
+ inputs.push_back(new IntSinkPin<I8259>(
csprintf("%s.inputs[%d]", name(), i), i, this));
}
void init() override;
Tick latency;
- std::vector<::IntSourcePin<I8259> *> output;
- std::vector<::IntSinkPin<I8259> *> inputs;
+ std::vector<IntSourcePin<I8259> *> output;
+ std::vector<IntSinkPin<I8259> *> inputs;
Enums::X86I8259CascadeMode mode;
I8259 * slave;
panic("Int port not connected to anything!");
}
}
-
-X86ISA::IntSourcePin *
-X86IntSourcePinParams::create()
-{
- return new X86ISA::IntSourcePin(this);
-}
-
-X86ISA::IntSinkPin *
-X86IntSinkPinParams::create()
-{
- return new X86ISA::IntSinkPin(this);
-}
-
-X86ISA::IntLine *
-X86IntLineParams::create()
-{
- return new X86ISA::IntLine(this);
-}
#include "arch/x86/intmessage.hh"
#include "arch/x86/x86_traits.hh"
#include "mem/mport.hh"
-#include "params/X86IntLine.hh"
-#include "params/X86IntSinkPin.hh"
-#include "params/X86IntSourcePin.hh"
#include "sim/sim_object.hh"
namespace X86ISA {
virtual void init();
- virtual void
- signalInterrupt(int line)
- {
- panic("signalInterrupt not implemented.\n");
- }
-
- virtual void
- raiseInterruptPin(int number)
- {
- panic("raiseInterruptPin not implemented.\n");
- }
-
- virtual void
- lowerInterruptPin(int number)
- {
- panic("lowerInterruptPin not implemented.\n");
- }
-
virtual Tick
recvMessage(PacketPtr pkt)
{
}
};
-class IntSinkPin : public SimObject
-{
- public:
- IntDevice * device;
- int number;
-
- typedef X86IntSinkPinParams Params;
-
- const Params *
- params() const
- {
- return dynamic_cast<const Params *>(_params);
- }
-
- IntSinkPin(Params *p) : SimObject(p),
- device(dynamic_cast<IntDevice *>(p->device)), number(p->number)
- {
- assert(device);
- }
-};
-
-class IntSourcePin : public SimObject
-{
- protected:
- std::vector<IntSinkPin *> sinks;
-
- public:
- typedef X86IntSourcePinParams Params;
-
- const Params *
- params() const
- {
- return dynamic_cast<const Params *>(_params);
- }
-
- void
- addSink(IntSinkPin *sink)
- {
- sinks.push_back(sink);
- }
-
- void
- raise()
- {
- for (int i = 0; i < sinks.size(); i++) {
- const IntSinkPin &pin = *sinks[i];
- pin.device->raiseInterruptPin(pin.number);
- }
- }
-
- void
- lower()
- {
- for (int i = 0; i < sinks.size(); i++) {
- const IntSinkPin &pin = *sinks[i];
- pin.device->lowerInterruptPin(pin.number);
- }
- }
-
- IntSourcePin(Params *p) : SimObject(p)
- {}
-};
-
-class IntLine : public SimObject
-{
- protected:
- IntSourcePin *source;
- IntSinkPin *sink;
-
- public:
- typedef X86IntLineParams Params;
-
- const Params *
- params() const
- {
- return dynamic_cast<const Params *>(_params);
- }
-
- IntLine(Params *p) : SimObject(p), source(p->source), sink(p->sink)
- {
- source->addSink(sink);
- }
-};
-
} // namespace X86ISA
#endif //__DEV_X86_INTDEV_HH__