Deleted Added
sdiff udiff text old ( 6041:949a8304e7f9 ) new ( 6046:8ac37d77fa74 )
full compact
1/*
2 * Copyright (c) 2008 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 *

--- 46 unchanged lines hidden (view full) ---

55 * Authors: Gabe Black
56 */
57
58#include "arch/x86/apicregs.hh"
59#include "arch/x86/interrupts.hh"
60#include "arch/x86/intmessage.hh"
61#include "cpu/base.hh"
62#include "mem/packet_access.hh"
63
64int
65divideFromConf(uint32_t conf)
66{
67 // This figures out what division we want from the division configuration
68 // register in the local APIC. The encoding is a little odd but it can
69 // be deciphered fairly easily.
70 int shift = ((conf & 0x8) >> 1) | (conf & 0x3);

--- 290 unchanged lines hidden (view full) ---

361 panic("Local APIC Arbitration Priority register unimplemented.\n");
362 break;
363 case APIC_PROCESSOR_PRIORITY:
364 panic("Local APIC Processor Priority register unimplemented.\n");
365 break;
366 case APIC_ERROR_STATUS:
367 regs[APIC_INTERNAL_STATE] &= ~ULL(0x1);
368 break;
369 case APIC_INTERRUPT_COMMAND_LOW:
370 panic("Local APIC Interrupt Command low"
371 " register unimplemented.\n");
372 break;
373 case APIC_INTERRUPT_COMMAND_HIGH:
374 panic("Local APIC Interrupt Command high"
375 " register unimplemented.\n");
376 break;
377 case APIC_CURRENT_COUNT:
378 {
379 if (apicTimerEvent.scheduled()) {
380 assert(clock);
381 // Compute how many m5 ticks happen per count.
382 uint64_t ticksPerCount = clock *
383 divideFromConf(regs[APIC_DIVIDE_CONFIGURATION]);
384 // Compute how many m5 ticks are left.

--- 69 unchanged lines hidden (view full) ---

454 } else {
455 regs[APIC_INTERNAL_STATE] |= ULL(0x1);
456 return;
457 }
458
459 }
460 break;
461 case APIC_INTERRUPT_COMMAND_LOW:
462 panic("Local APIC Interrupt Command low"
463 " register unimplemented.\n");
464 break;
465 case APIC_INTERRUPT_COMMAND_HIGH:
466 panic("Local APIC Interrupt Command high"
467 " register unimplemented.\n");
468 break;
469 case APIC_LVT_TIMER:
470 case APIC_LVT_THERMAL_SENSOR:
471 case APIC_LVT_PERFORMANCE_MONITORING_COUNTERS:
472 case APIC_LVT_LINT0:
473 case APIC_LVT_LINT1:
474 case APIC_LVT_ERROR:
475 {
476 uint64_t readOnlyMask = (1 << 12) | (1 << 14);

--- 142 unchanged lines hidden ---