timer_sp804.cc (7587:177151a54462) | timer_sp804.cc (7733:08d6a773d1b6) |
---|---|
1/* 2 * Copyright (c) 2010 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 205 unchanged lines hidden (view full) --- 214 215 // Free-running 216 if (control.timerMode == 0) 217 restartCounter(0xffffffff); 218 else 219 restartCounter(loadValue); 220} 221 | 1/* 2 * Copyright (c) 2010 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 205 unchanged lines hidden (view full) --- 214 215 // Free-running 216 if (control.timerMode == 0) 217 restartCounter(0xffffffff); 218 else 219 restartCounter(loadValue); 220} 221 |
222void 223Sp804::Timer::serialize(std::ostream &os) 224{ 225 DPRINTF(Checkpoint, "Serializing Arm Sp804\n"); 226 SERIALIZE_SCALAR(intNum); 227 SERIALIZE_SCALAR(clock); |
|
222 | 228 |
229 uint32_t control_serial = control; 230 SERIALIZE_SCALAR(control_serial); 231 232 SERIALIZE_SCALAR(rawInt); 233 SERIALIZE_SCALAR(pendingInt); 234 SERIALIZE_SCALAR(loadValue); 235 236 bool is_in_event = zeroEvent.scheduled(); 237 SERIALIZE_SCALAR(is_in_event); 238 239 Tick event_time; 240 if (is_in_event){ 241 event_time = zeroEvent.when(); 242 SERIALIZE_SCALAR(event_time); 243 } 244} 245 |
|
223void | 246void |
247Sp804::Timer::unserialize(Checkpoint *cp, const std::string §ion) 248{ 249 DPRINTF(Checkpoint, "Unserializing Arm Sp804\n"); 250 251 UNSERIALIZE_SCALAR(intNum); 252 UNSERIALIZE_SCALAR(clock); 253 254 uint32_t control_serial; 255 UNSERIALIZE_SCALAR(control_serial); 256 control = control_serial; 257 258 UNSERIALIZE_SCALAR(rawInt); 259 UNSERIALIZE_SCALAR(pendingInt); 260 UNSERIALIZE_SCALAR(loadValue); 261 262 bool is_in_event; 263 UNSERIALIZE_SCALAR(is_in_event); 264 265 Tick event_time; 266 if (is_in_event){ 267 UNSERIALIZE_SCALAR(event_time); 268 parent->schedule(zeroEvent, event_time); 269 } 270} 271 272 273 274void |
|
224Sp804::serialize(std::ostream &os) 225{ | 275Sp804::serialize(std::ostream &os) 276{ |
226 panic("Need to implement serialization\n"); | 277 nameOut(os, csprintf("%s.timer0", name())); 278 timer0.serialize(os); 279 nameOut(os, csprintf("%s.timer1", name())); 280 timer1.serialize(os); |
227} 228 229void 230Sp804::unserialize(Checkpoint *cp, const std::string §ion) 231{ | 281} 282 283void 284Sp804::unserialize(Checkpoint *cp, const std::string §ion) 285{ |
232 panic("Need to implement serialization\n"); | 286 timer0.unserialize(cp, csprintf("%s.timer0", section)); 287 timer1.unserialize(cp, csprintf("%s.timer1", section)); |
233} 234 235Sp804 * 236Sp804Params::create() 237{ 238 return new Sp804(this); 239} | 288} 289 290Sp804 * 291Sp804Params::create() 292{ 293 return new Sp804(this); 294} |