Deleted Added
sdiff udiff text old ( 10412:6400a2ab4e22 ) new ( 10905:a6ca6831e775 )
full compact
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * Copyright (c) 2008 The Hewlett-Packard Development Company
4 * Copyright (c) 2013 Advanced Micro Devices, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are

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

237
238 if (event->flags.isSet(Event::AutoDelete) && !event->scheduled())
239 delete event;
240
241 return NULL;
242}
243
244void
245Event::serialize(CheckpointOut &cp) const
246{
247 SERIALIZE_SCALAR(_when);
248 SERIALIZE_SCALAR(_priority);
249 short _flags = flags;
250 SERIALIZE_SCALAR(_flags);
251}
252
253void
254Event::unserialize(CheckpointIn &cp)
255{
256}
257
258void
259Event::unserializeEvent(CheckpointIn &cp, EventQueue *eventq)
260{
261 if (scheduled())
262 eventq->deschedule(this);
263
264 UNSERIALIZE_SCALAR(_when);
265 UNSERIALIZE_SCALAR(_priority);
266
267 short _flags;

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

285
286 if (wasScheduled) {
287 DPRINTF(Config, "rescheduling at %d\n", _when);
288 eventq->schedule(this, _when);
289 }
290}
291
292void
293EventQueue::serialize(CheckpointOut &cp) const
294{
295 std::list<Event *> eventPtrs;
296
297 int numEvents = 0;
298 Event *nextBin = head;
299 while (nextBin) {
300 Event *nextInBin = nextBin;
301
302 while (nextInBin) {
303 if (nextInBin->flags.isSet(Event::AutoSerialize)) {
304 eventPtrs.push_back(nextInBin);
305 paramOut(cp, csprintf("event%d", numEvents++),
306 nextInBin->name());
307 }
308 nextInBin = nextInBin->nextInBin;
309 }
310
311 nextBin = nextBin->nextBin;
312 }
313
314 SERIALIZE_SCALAR(numEvents);
315
316 for (Event *ev : eventPtrs)
317 ev->serializeSection(cp, ev->name());
318}
319
320void
321EventQueue::unserialize(CheckpointIn &cp)
322{
323 int numEvents;
324 UNSERIALIZE_SCALAR(numEvents);
325
326 std::string eventName;
327 for (int i = 0; i < numEvents; i++) {
328 // get the pointer value associated with the event
329 paramIn(cp, csprintf("event%d", i), eventName);
330
331 // create the event based on its pointer value
332 Serializable::create(cp, eventName);
333 }
334}
335
336void
337EventQueue::dump() const

--- 147 unchanged lines hidden ---