1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use of this software in source and binary forms, 6 * with or without modification, are permitted provided that the 7 * following conditions are met: 8 * --- 48 unchanged lines hidden (view full) --- 57 58#ifndef __ARCH_X86_INTERRUPTS_HH__ 59#define __ARCH_X86_INTERRUPTS_HH__ 60 61#include "arch/x86/apicregs.hh" 62#include "arch/x86/faults.hh" 63#include "cpu/thread_context.hh" 64#include "dev/io_device.hh" |
65#include "dev/x86/intdev.hh" |
66#include "params/X86LocalApic.hh" 67#include "sim/eventq.hh" |
68 69class ThreadContext; 70 71namespace X86ISA 72{ 73 |
74class Interrupts : public BasicPioDevice, IntDev |
75{ 76 protected: 77 uint32_t regs[NUM_APIC_REGS]; 78 Tick latency; 79 Tick clock; 80 81 class ApicTimerEvent : public Event 82 { --- 20 unchanged lines hidden (view full) --- 103 const Params * 104 params() const 105 { 106 return dynamic_cast<const Params *>(_params); 107 } 108 109 Tick read(PacketPtr pkt); 110 Tick write(PacketPtr pkt); |
111 Tick recvMessage(PacketPtr pkt); |
112 113 void addressRanges(AddrRangeList &range_list) 114 { 115 range_list.clear(); 116 range_list.push_back(RangeEx(x86LocalAPICAddress(0, 0), 117 x86LocalAPICAddress(0, 0) + PageBytes)); 118 } 119 |
120 void getIntAddrRange(AddrRangeList &range_list) 121 { 122 range_list.clear(); 123 range_list.push_back(RangeEx(x86InterruptAddress(0, 0), 124 x86InterruptAddress(0, 0) + PhysAddrAPICRangeSize)); 125 } 126 |
127 uint32_t readReg(ApicRegIndex miscReg); 128 void setReg(ApicRegIndex reg, uint32_t val); 129 void setRegNoEffect(ApicRegIndex reg, uint32_t val) 130 { 131 regs[reg] = val; 132 } 133 |
134 Interrupts(Params * p) : BasicPioDevice(p), IntDev(this), |
135 latency(p->pio_latency), clock(0) 136 { 137 pioSize = PageBytes; 138 //Set the local apic DFR to the flat model. 139 regs[APIC_DESTINATION_FORMAT] = (uint32_t)(-1); 140 memset(regs, 0, sizeof(regs)); 141 clear_all(); 142 } 143 |
144 Port *getPort(const std::string &if_name, int idx = -1) 145 { 146 if (if_name == "int_port") 147 return intPort; 148 return BasicPioDevice::getPort(if_name, idx); 149 } 150 |
151 int InterruptLevel(uint64_t softint) 152 { 153 panic("Interrupts::InterruptLevel unimplemented!\n"); 154 return 0; 155 } 156 157 void post(int int_num, int index) 158 { --- 42 unchanged lines hidden --- |