ua2005.cc (2650:a012c079984a) ua2005.cc (2651:76db2c628241)
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;

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

51 case MISCREG_SOFTINT_CLR:
52 return setRegWithEffect(miscReg, ~val & softint, xc);
53 case MISCREG_SOFTINT_SET:
54 return setRegWithEffect(miscReg, val | softint, xc);
55
56 case MISCREG_TICK_CMPR:
57 if (isNonPriv())
58 return new PrivilegedOpcode;
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;

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

51 case MISCREG_SOFTINT_CLR:
52 return setRegWithEffect(miscReg, ~val & softint, xc);
53 case MISCREG_SOFTINT_SET:
54 return setRegWithEffect(miscReg, val | softint, xc);
55
56 case MISCREG_TICK_CMPR:
57 if (isNonPriv())
58 return new PrivilegedOpcode;
59 if (tickCompare == NULL)
60 tickCompare = new TickCompareEvent(this, xc);
59 setReg(miscReg, val);
60 if (tick_cmprFields.int_dis && tickCompare.scheduled())
61 tickCompare.deschedule();
62 time = tick_cmprFields.tick_cmpr - tickFields.counter;
63 if (!tick_cmprFields.int_dis && time > 0)
64 tickCompare.schedule(time * xc->getCpuPtr()->cycles(1));
65 return NoFault;
66

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

73 assert(sys != NULL);
74 sys->sysTick = curTick/Clock::Int::ns - val & ~Bit64;
75 stickFields.npt = val & Bit64 ? 1 : 0;
76 return NoFault;
77
78 case MISCREG_STICK_CMPR:
79 if (isNonPriv())
80 return new PrivilegedOpcode;
61 setReg(miscReg, val);
62 if (tick_cmprFields.int_dis && tickCompare.scheduled())
63 tickCompare.deschedule();
64 time = tick_cmprFields.tick_cmpr - tickFields.counter;
65 if (!tick_cmprFields.int_dis && time > 0)
66 tickCompare.schedule(time * xc->getCpuPtr()->cycles(1));
67 return NoFault;
68

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

75 assert(sys != NULL);
76 sys->sysTick = curTick/Clock::Int::ns - val & ~Bit64;
77 stickFields.npt = val & Bit64 ? 1 : 0;
78 return NoFault;
79
80 case MISCREG_STICK_CMPR:
81 if (isNonPriv())
82 return new PrivilegedOpcode;
83 if (sTickCompare == NULL)
84 sTickCompare = new STickCompareEvent(this, xc);
81 sys = dynamic_cast<SparcSystem*>(xc->getSystemPtr());
82 assert(sys != NULL);
83 setReg(miscReg, val);
84 if (stick_cmprFields.int_dis && sTickCompare.scheduled())
85 sTickCompare.deschedule();
86 time = stick_cmprFields.tick_cmpr - sys->sysTick;
87 if (!stick_cmprFields.int_dis && time > 0)
88 sTickCompare.schedule(time * Clock::Int::ns);

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

115 return NoFault;
116
117 case MISCREG_STRAND_STS_REG:
118 setReg(miscReg, strandStatusReg);
119 return NoFault;
120 case MISCREG_HSTICK_CMPR:
121 if (isNonPriv())
122 return new PrivilegedOpcode;
85 sys = dynamic_cast<SparcSystem*>(xc->getSystemPtr());
86 assert(sys != NULL);
87 setReg(miscReg, val);
88 if (stick_cmprFields.int_dis && sTickCompare.scheduled())
89 sTickCompare.deschedule();
90 time = stick_cmprFields.tick_cmpr - sys->sysTick;
91 if (!stick_cmprFields.int_dis && time > 0)
92 sTickCompare.schedule(time * Clock::Int::ns);

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

119 return NoFault;
120
121 case MISCREG_STRAND_STS_REG:
122 setReg(miscReg, strandStatusReg);
123 return NoFault;
124 case MISCREG_HSTICK_CMPR:
125 if (isNonPriv())
126 return new PrivilegedOpcode;
127 if (hSTickCompare == NULL)
128 hSTickCompare = new HSTickCompareEvent(this, xc);
123 sys = dynamic_cast<SparcSystem*>(xc->getSystemPtr());
124 assert(sys != NULL);
125 setReg(miscReg, val);
126 if (hstick_cmprFields.int_dis && hSTickCompare.scheduled())
127 hSTickCompare.deschedule();
128 int64_t time = hstick_cmprFields.tick_cmpr - sys->sysTick;
129 if (!hstick_cmprFields.int_dis && time > 0)
130 hSTickCompare.schedule(time * Clock::Int::ns);

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

190 return hstick_cmpr;
191
192 default:
193 fault = new IllegalInstruction;
194 return 0;
195 }
196}
197
129 sys = dynamic_cast<SparcSystem*>(xc->getSystemPtr());
130 assert(sys != NULL);
131 setReg(miscReg, val);
132 if (hstick_cmprFields.int_dis && hSTickCompare.scheduled())
133 hSTickCompare.deschedule();
134 int64_t time = hstick_cmprFields.tick_cmpr - sys->sysTick;
135 if (!hstick_cmprFields.int_dis && time > 0)
136 hSTickCompare.schedule(time * Clock::Int::ns);

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

196 return hstick_cmpr;
197
198 default:
199 fault = new IllegalInstruction;
200 return 0;
201 }
202}
203
204void
205MiscRegFile::processTickCompare(ExecContext *xc)
206{
207 panic("tick compare not implemented\n");
208}
198
209
210void
211MiscRegFile::processSTickCompare(ExecContext *xc)
212{
213 panic("tick compare not implemented\n");
214}
215
216void
217MiscRegFile::processHSTickCompare(ExecContext *xc)
218{
219 panic("tick compare not implemented\n");
220}
221
199}; // namespace SparcISA
222}; // namespace SparcISA