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; --- 18 unchanged lines hidden (view full) --- 27 * 28 * Authors: Gabe Black 29 */ 30 31#ifndef __DEV_X86_INTDEV_HH__ 32#define __DEV_X86_INTDEV_HH__ 33 34#include <assert.h> |
35#include <string> |
36 |
37#include "arch/x86/x86_traits.hh" 38#include "mem/mem_object.hh" 39#include "mem/mport.hh" |
40#include "sim/sim_object.hh" 41#include "params/X86IntPin.hh" 42 43namespace X86ISA { 44 45class IntDev 46{ |
47 protected: 48 class IntPort : public MessagePort 49 { 50 IntDev * device; 51 Tick latency; 52 Addr intAddr; 53 public: 54 IntPort(const std::string &_name, MemObject * _parent, 55 IntDev *dev, Tick _latency) : 56 MessagePort(_name, _parent), device(dev), latency(_latency) 57 { 58 } 59 60 void getDeviceAddressRanges(AddrRangeList &resp, bool &snoop) 61 { 62 snoop = false; 63 device->getIntAddrRange(resp); 64 } 65 66 Tick recvMessage(PacketPtr pkt) 67 { 68 return device->recvMessage(pkt); 69 } 70 71 void recvStatusChange(Status status) 72 { 73 if (status == RangeChange) { 74 sendStatusChange(Port::RangeChange); 75 } 76 } 77 78 }; 79 80 IntPort * intPort; 81 |
82 public: |
83 IntDev(MemObject * parent, Tick latency = 0) 84 { 85 if (parent != NULL) { 86 intPort = new IntPort(parent->name() + ".int_port", 87 parent, this, latency); 88 } else { 89 intPort = NULL; 90 } 91 } 92 |
93 virtual ~IntDev() 94 {} |
95 |
96 virtual void |
97 signalInterrupt(int line) 98 { 99 panic("signalInterrupt not implemented.\n"); 100 } 101 102 virtual Tick 103 recvMessage(PacketPtr pkt) 104 { 105 panic("recvMessage not implemented.\n"); 106 return 0; 107 } 108 109 virtual void 110 getIntAddrRange(AddrRangeList &range_list) 111 { 112 panic("intAddrRange not implemented.\n"); 113 } |
114}; 115 116class IntPin : public SimObject 117{ 118 protected: 119 IntDev * device; 120 int line; 121 --- 25 unchanged lines hidden --- |