From: Ali Saidi Date: Tue, 6 Feb 2007 23:47:42 +0000 (-0500) Subject: merge my index fix and lisa's fix X-Git-Tag: m5_2.0_beta3~74^2~8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8ffd12e807bd05a57bbe8857dbff0ecaf217fe64;p=gem5.git merge my index fix and lisa's fix --HG-- extra : convert_revision : 5f2c7d46c96fa061bbfb66edf188d405ca600020 --- 8ffd12e807bd05a57bbe8857dbff0ecaf217fe64 diff --cc src/arch/sparc/interrupts.hh index 3af4f6342,42bbfc5cf..dc3b235fe --- a/src/arch/sparc/interrupts.hh +++ b/src/arch/sparc/interrupts.hh @@@ -46,97 -46,67 +46,69 @@@ enum interrupts_t num_interrupt_types }; - class Interrupts - { + class Interrupts + { - private: + private: - bool interrupts[num_interrupt_types]; - int numPosted; + bool interrupts[num_interrupt_types]; + int numPosted; - public: - Interrupts() - { - for (int i = 0; i < num_interrupt_types; ++i) { - interrupts[i] = false; - } - numPosted = 0; + public: + Interrupts() + { + for (int i = 0; i < num_interrupt_types; ++i) { + interrupts[i] = false; } + numPosted = 0; + } - void post(int int_type) - { - if (int_type < 0 || int_type >= num_interrupt_types) - panic("posting unknown interrupt!\n"); - - if (interrupts[int_type] == false) { - interrupts[int_type] = true; - ++numPosted; - } + void post(int int_type) + { + if (int_type < 0 || int_type >= num_interrupt_types) + panic("posting unknown interrupt!\n"); - interrupts[int_type] = true; - ++numPosted; ++ if (interrupts[int_type] == false) { ++ interrupts[int_type] = true; ++ ++numPosted; + } + } - void post(int int_num, int index) - { - - } + void post(int int_num, int index) + { - void clear(int int_num, int index) - { + } - } + void clear(int int_num, int index) + { - void clear_all() - { + } - } + void clear_all() + { - bool check_interrupts(ThreadContext * tc) const - { - if (numPosted) - return true; - else - return false; - } + } - Fault getInterrupt(ThreadContext * tc) - { - int hpstate = tc->readMiscReg(MISCREG_HPSTATE); - int pstate = tc->readMiscReg(MISCREG_PSTATE); - bool ie = pstate & PSTATE::ie; - - // THESE ARE IN ORDER OF PRIORITY - // since there are early returns, and the highest - // priority interrupts should get serviced, - // it is v. important that new interrupts are inserted - // in the right order of processing - if (hpstate & HPSTATE::hpriv) { - if (ie) { - if (interrupts[hstick_match]) { - if (tc->readMiscReg(MISCREG_HINTP) & 1) { - interrupts[hstick_match] = false; - --numPosted; - return new HstickMatch; - } - } - if (interrupts[interrupt_vector]) { - interrupts[interrupt_vector] = false; - --numPosted; - //HAVEN'T IMPLed THIS YET - return NoFault; - } - } else { - if (interrupts[hstick_match]) { - return NoFault; - } + bool check_interrupts(ThreadContext * tc) const + { + if (numPosted) + return true; + else + return false; + } - } - } else { - if (interrupts[trap_level_zero]) { - if ((pstate & HPSTATE::tlz) && (tc->readMiscReg(MISCREG_TL) == 0)) { - interrupts[trap_level_zero] = false; - --numPosted; - return new TrapLevelZero; - } - } + Fault getInterrupt(ThreadContext * tc) + { + int hpstate = tc->readMiscReg(MISCREG_HPSTATE); + int pstate = tc->readMiscReg(MISCREG_PSTATE); + bool ie = pstate & PSTATE::ie; + + // THESE ARE IN ORDER OF PRIORITY + // since there are early returns, and the highest + // priority interrupts should get serviced, + // it is v. important that new interrupts are inserted + // in the right order of processing + if (hpstate & HPSTATE::hpriv) { + if (ie) { if (interrupts[hstick_match]) { if (tc->readMiscReg(MISCREG_HINTP) & 1) { interrupts[hstick_match] = false;