checksum-oostubs: another possible outcome (CLI+HLT)

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1055 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hsc
2012-04-11 15:21:13 +00:00
parent 6eddff0305
commit 4b2b00011d
3 changed files with 12 additions and 1 deletions

View File

@ -19,7 +19,8 @@ message OOStuBSProtoMsg {
enum ResultType {
FINISHED = 1;
TRAP = 2;
UNKNOWN = 3;
HALT = 3;
UNKNOWN = 4;
}
optional ResultType resulttype = 6;

View File

@ -195,6 +195,7 @@ bool ChecksumOOStuBSExperiment::run()
// --- aftermath ---
// four possible outcomes:
// - guest causes a trap, "crashes"
// - guest reaches a "weird" state, stops with CLI+HLT ("panic")
// - guest runs OOSTUBS_NUMINSTR+OOSTUBS_RECOVERYINSTR instructions but
// never reaches finish()
// - guest reaches finish() within OOSTUBS_NUMINSTR+OOSTUBS_RECOVERYINSTR
@ -205,6 +206,9 @@ bool ChecksumOOStuBSExperiment::run()
// catch traps as "extraordinary" ending
fi::TrapEvent ev_trap(fi::ANY_TRAP);
sal::simulator.addEvent(&ev_trap);
// OOStuBS' way to terminally halt (CLI+HLT)
fi::BPEvent ev_halt(OOSTUBS_FUNC_CPU_HALT);
sal::simulator.addEvent(&ev_halt);
// remaining instructions until "normal" ending
fi::BPEvent ev_done(fi::ANY_ADDR);
ev_done.setCounter(OOSTUBS_NUMINSTR + OOSTUBS_RECOVERYINSTR - instr_offset);
@ -246,6 +250,9 @@ bool ChecksumOOStuBSExperiment::run()
if (ev == &ev_done) {
log << std::dec << "Result FINISHED" << endl;
param.msg.set_resulttype(param.msg.FINISHED);
} else if (ev == &ev_halt) {
log << std::dec << "Result HALT #" << endl;
param.msg.set_resulttype(param.msg.HALT);
} else if (ev == &ev_trap) {
log << std::dec << "Result TRAP #" << ev_trap.getTriggerNumber() << endl;
param.msg.set_resulttype(param.msg.TRAP);

View File

@ -11,6 +11,9 @@
// empty function that is called explicitly when the experiment finished
// nm -C ecc.elf|fgrep "finished()"
#define OOSTUBS_FUNC_FINISH 0x001093f0
// function executing HLT with no chance for further progress (after panic())
// nm -C ecc.elf|fgrep cpu_halt
#define OOSTUBS_FUNC_CPU_HALT 0x00100987
// number of instructions the target executes under non-error conditions from ENTRY to DONE:
// (result of experiment's step #2)
#define OOSTUBS_NUMINSTR 0x4a3401