interrupts.hh (3520:4f4a2054fd85) interrupts.hh (3521:0b0b3551def0)
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;

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

83 void clear_all()
84 {
85 DPRINTF(Interrupt, "Interrupts all cleared\n");
86
87 memset(interrupts, 0, sizeof(interrupts));
88 intstatus = 0;
89 }
90
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;

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

83 void clear_all()
84 {
85 DPRINTF(Interrupt, "Interrupts all cleared\n");
86
87 memset(interrupts, 0, sizeof(interrupts));
88 intstatus = 0;
89 }
90
91 bool check_interrupt(int int_num) const {
92 if (int_num > NumInterruptLevels)
93 panic("int_num out of bounds\n");
94
95 return interrupts[int_num] != 0;
96 }
97
98 bool check_interrupts() const { return intstatus != 0; }
99
100 void serialize(std::ostream &os)
101 {
102 SERIALIZE_ARRAY(interrupts, NumInterruptLevels);
103 SERIALIZE_SCALAR(intstatus);
104 }
105
106 void unserialize(Checkpoint *cp, const std::string &section)
107 {
108 UNSERIALIZE_ARRAY(interrupts, NumInterruptLevels);
109 UNSERIALIZE_SCALAR(intstatus);
110 }
111
91 void serialize(std::ostream &os)
92 {
93 SERIALIZE_ARRAY(interrupts, NumInterruptLevels);
94 SERIALIZE_SCALAR(intstatus);
95 }
96
97 void unserialize(Checkpoint *cp, const std::string &section)
98 {
99 UNSERIALIZE_ARRAY(interrupts, NumInterruptLevels);
100 UNSERIALIZE_SCALAR(intstatus);
101 }
102
103 bool check_interrupts(ThreadContext * tc) const
104 {
105 return (intstatus != 0) && !(tc->readPC() & 0x3);
106 }
107
112 Fault getInterrupt(ThreadContext * tc)
113 {
114 int ipl = 0;
115 int summary = 0;
116
117 if (tc->readMiscReg(IPR_ASTRR))
118 panic("asynchronous traps not implemented\n");
119

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

158
159 return new InterruptFault;
160 } else {
161 return NoFault;
162 }
163 }
164
165 private:
108 Fault getInterrupt(ThreadContext * tc)
109 {
110 int ipl = 0;
111 int summary = 0;
112
113 if (tc->readMiscReg(IPR_ASTRR))
114 panic("asynchronous traps not implemented\n");
115

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

154
155 return new InterruptFault;
156 } else {
157 return NoFault;
158 }
159 }
160
161 private:
166 uint64_t intr_status() const { return intstatus; }
167 };
168}
169
170#endif
171
162 };
163}
164
165#endif
166