diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-03-03 06:24:01 +0000 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-03-03 06:24:01 +0000 |
commit | 68ad1533096ab736c534cb29364a1a93e1010306 (patch) | |
tree | 1499c0085d1e4de76b37827e6d691f91364bc396 /src/python/swig/pyevent.hh | |
parent | 23dc5099a4bca9e38a286d867c4eccd7db3c09c1 (diff) | |
parent | ffe6bebb05c30b0f1d7cde5ad5b94a2551938630 (diff) | |
download | gem5-68ad1533096ab736c534cb29364a1a93e1010306.tar.xz |
Merge zizzer.eecs.umich.edu:/bk/newmem
into ahchoo.blinky.homelinux.org:/home/gblack/m5/newmem-sparc32
--HG--
extra : convert_revision : bbd0def502e423e64e2c4f6415a4b043b60c7f90
Diffstat (limited to 'src/python/swig/pyevent.hh')
-rw-r--r-- | src/python/swig/pyevent.hh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/python/swig/pyevent.hh b/src/python/swig/pyevent.hh index 16af85a84..65e80e9e4 100644 --- a/src/python/swig/pyevent.hh +++ b/src/python/swig/pyevent.hh @@ -32,6 +32,7 @@ #define __PYTHON_SWIG_PYEVENT_HH__ #include "sim/eventq.hh" +#include "sim/sim_events.hh" class PythonEvent : public Event { @@ -45,4 +46,29 @@ class PythonEvent : public Event virtual void process(); }; +inline void +create(PyObject *object, Tick when) +{ + new PythonEvent(object, when); +} + +inline Event * +createCountedDrain() +{ + return new CountedDrainEvent(); +} + +inline void +cleanupCountedDrain(Event *counted_drain) +{ + CountedDrainEvent *event = + dynamic_cast<CountedDrainEvent *>(counted_drain); + if (event == NULL) { + fatal("Called cleanupCountedDrain() on an event that was not " + "a CountedDrainEvent."); + } + assert(event->getCount() == 0); + delete event; +} + #endif // __PYTHON_SWIG_PYEVENT_HH__ |