interrupts.hh (3521:0b0b3551def0) interrupts.hh (3633:524f2aadbc89)
1/*
2 * Copyright (c) 2006 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;

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

44 uint64_t interrupts[NumInterruptLevels];
45 uint64_t intstatus;
46
47 public:
48 Interrupts()
49 {
50 memset(interrupts, 0, sizeof(interrupts));
51 intstatus = 0;
1/*
2 * Copyright (c) 2006 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;

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

44 uint64_t interrupts[NumInterruptLevels];
45 uint64_t intstatus;
46
47 public:
48 Interrupts()
49 {
50 memset(interrupts, 0, sizeof(interrupts));
51 intstatus = 0;
52 newInfoSet = false;
52 }
53
54 void post(int int_num, int index)
55 {
56 DPRINTF(Interrupt, "Interrupt %d:%d posted\n", int_num, index);
57
58 if (int_num < 0 || int_num >= NumInterruptLevels)
59 panic("int_num out of bounds\n");

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

132 // See table 4-19 of 21164 hardware reference
133 ipl = i;
134 summary |= (ULL(1) << i);
135 }
136 }
137 }
138
139 if (ipl && ipl > tc->readMiscReg(IPR_IPLR)) {
53 }
54
55 void post(int int_num, int index)
56 {
57 DPRINTF(Interrupt, "Interrupt %d:%d posted\n", int_num, index);
58
59 if (int_num < 0 || int_num >= NumInterruptLevels)
60 panic("int_num out of bounds\n");

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

133 // See table 4-19 of 21164 hardware reference
134 ipl = i;
135 summary |= (ULL(1) << i);
136 }
137 }
138 }
139
140 if (ipl && ipl > tc->readMiscReg(IPR_IPLR)) {
140 tc->setMiscReg(IPR_ISR, summary);
141 tc->setMiscReg(IPR_INTID, ipl);
142
143 /* The following needs to be added back in somehow */
144 // Checker needs to know these two registers were updated.
145/*#if USE_CHECKER
146 if (this->checker) {
147 this->checker->threadBase()->setMiscReg(IPR_ISR, summary);
148 this->checker->threadBase()->setMiscReg(IPR_INTID, ipl);
149 }
150#endif*/
151
141// assert(!newInfoSet);
142 newIpl = ipl;
143 newSummary = newSummary;
144 newInfoSet = true;
152 DPRINTF(Flow, "Interrupt! IPLR=%d ipl=%d summary=%x\n",
153 tc->readMiscReg(IPR_IPLR), ipl, summary);
154
155 return new InterruptFault;
156 } else {
157 return NoFault;
158 }
159 }
160
145 DPRINTF(Flow, "Interrupt! IPLR=%d ipl=%d summary=%x\n",
146 tc->readMiscReg(IPR_IPLR), ipl, summary);
147
148 return new InterruptFault;
149 } else {
150 return NoFault;
151 }
152 }
153
154 void updateIntrInfo(ThreadContext *tc)
155 {
156 assert(newInfoSet);
157 tc->setMiscReg(IPR_ISR, newSummary);
158 tc->setMiscReg(IPR_INTID, newIpl);
159 newInfoSet = false;
160 }
161
161 private:
162 private:
163 bool newInfoSet;
164 int newIpl;
165 int newSummary;
162 };
163}
164
165#endif
166
166 };
167}
168
169#endif
170