Files
fail/core/SAL/bochs/Interrupt.ah
hsc b70b6fb43a another directory rename: failstar -> fail
"failstar" sounds like a name for a cruise liner from the 80s.  As "*" isn't a
desirable part of directory names, just name the whole thing "fail/", the core
parts being stored in "fail/core/".

Additionally fixing two build system dependency issues:
 - missing jobserver -> protomessages dependency
 - broken bochs -> fail dependency (add_custom_target DEPENDS only allows plain
   file dependencies ... cmake for the win)


git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@956 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
2012-03-08 19:43:02 +00:00

41 lines
1.1 KiB
Plaintext

#ifndef __INTERRUPT_AH__
#define __INTERRUPT_AH__
#include "../../AspectConfig.hpp"
#if CONFIG_EVENT_INTERRUPT == 1
#include "../../../bochs/bochs.h"
#include "../../../bochs/cpu/cpu.h"
#include "../SALInst.hpp"
aspect Interrupt
{
// cpu/exception.cc
pointcut interrupt_method() = "void bx_cpu_c::interrupt(...)";
advice execution (interrupt_method()) : before ()
{
// There are six different type-arguments for the interrupt-method
// in cpu.h (lines 3867-3872):
// - BX_EXTERNAL_INTERRUPT = 0,
// - BX_NMI = 2,
// - BX_HARDWARE_EXCEPTION = 3,
// - BX_SOFTWARE_INTERRUPT = 4,
// - BX_PRIVILEGED_SOFTWARE_INTERRUPT = 5,
// - BX_SOFTWARE_EXCEPTION = 6
// Only the first and the second types are relevant for this aspect.
unsigned vector = *(tjp->arg<0>());
unsigned type = *(tjp->arg<1>());
if(type == BX_EXTERNAL_INTERRUPT)
sal::simulator.onInterruptEvent(vector, false);
else if(type == BX_NMI)
sal::simulator.onInterruptEvent(vector, true);
}
};
#endif // CONFIG_EVENT_INTERRUPT
#endif /* __INTERRUPT_AH__ */