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 * --- 56 unchanged lines hidden (view full) --- 65#include "cpu/thread_context.hh" 66#include "dev/io_device.hh" 67#include "dev/x86/intdev.hh" 68#include "params/X86LocalApic.hh" 69#include "sim/eventq.hh" 70 71class ThreadContext; 72 |
73namespace X86ISA { |
74 75class Interrupts : public BasicPioDevice, IntDev 76{ 77 protected: 78 // Storage for the APIC registers 79 uint32_t regs[NUM_APIC_REGS]; 80 81 BitUnion32(LVTEntry) --- 101 unchanged lines hidden (view full) --- 183 void requestInterrupt(uint8_t vector, uint8_t deliveryMode, bool level); 184 185 public: 186 /* 187 * Params stuff. 188 */ 189 typedef X86LocalApicParams Params; 190 |
191 void 192 setClock(Tick newClock) |
193 { 194 clock = newClock; 195 } 196 197 const Params * 198 params() const 199 { 200 return dynamic_cast<const Params *>(_params); --- 37 unchanged lines hidden (view full) --- 238 } 239 240 /* 241 * Functions to access and manipulate the APIC's registers. 242 */ 243 244 uint32_t readReg(ApicRegIndex miscReg); 245 void setReg(ApicRegIndex reg, uint32_t val); |
246 void 247 setRegNoEffect(ApicRegIndex reg, uint32_t val) |
248 { 249 regs[reg] = val; 250 } 251 252 /* 253 * Constructor. 254 */ 255 |
256 Interrupts(Params * p) 257 : BasicPioDevice(p), IntDev(this), latency(p->pio_latency), clock(0), 258 apicTimerEvent(this), 259 pendingSmi(false), smiVector(0), 260 pendingNmi(false), nmiVector(0), 261 pendingExtInt(false), extIntVector(0), 262 pendingInit(false), initVector(0), 263 pendingUnmaskableInt(false) |
264 { 265 pioSize = PageBytes; 266 memset(regs, 0, sizeof(regs)); 267 //Set the local apic DFR to the flat model. 268 regs[APIC_DESTINATION_FORMAT] = (uint32_t)(-1); 269 ISRV = 0; 270 IRRV = 0; 271 } 272 273 /* 274 * Functions for retrieving interrupts for the CPU to handle. 275 */ 276 |
277 bool checkInterrupts(ThreadContext *tc) const; 278 Fault getInterrupt(ThreadContext *tc); 279 void updateIntrInfo(ThreadContext *tc); |
280 281 /* 282 * Serialization. 283 */ 284 |
285 void 286 serialize(std::ostream &os) |
287 { 288 panic("Interrupts::serialize unimplemented!\n"); 289 } 290 |
291 void 292 unserialize(Checkpoint *cp, const std::string §ion) |
293 { 294 panic("Interrupts::unserialize unimplemented!\n"); 295 } 296 297 /* 298 * Old functions needed for compatability but which will be phased out 299 * eventually. 300 */ |
301 void 302 post(int int_num, int index) |
303 { 304 panic("Interrupts::post unimplemented!\n"); 305 } 306 |
307 void 308 clear(int int_num, int index) |
309 { 310 panic("Interrupts::clear unimplemented!\n"); 311 } 312 |
313 void 314 clearAll() |
315 { |
316 panic("Interrupts::clearAll unimplemented!\n"); |
317 } 318}; 319 |
320} // namespace X86ISA |
321 322#endif // __ARCH_X86_INTERRUPTS_HH__ |