Skip to content
Snippets Groups Projects
Commit d7c61684 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

Clear interrupts immediately after triggering them

parent d79b1a83
No related branches found
No related tags found
No related merge requests found
#include "os.h"
#include "test/test.h"
#include "machine.h"
#include "arch/posix/irq.h"
#include <stdio.h>
extern "C" {
......@@ -8,6 +9,11 @@ extern const uint32_t _sdata_os_canonical, _edata_os_canonical;
extern const uint32_t _sdata_arch_canonical, _edata_arch_canonical;
}
void do_trigger_interrupt(uint8_t i) {
Machine::trigger_interrupt_from_user(i);
arch::irq.clear_interrupts();
}
// **********************************************************************
// Murmur3 implementation
//
......@@ -99,6 +105,10 @@ uint32_t hash_os_state() {
return first_hash ^ second_hash;
}
namespace arch {
extern void *OS_H5_ip;
}
void hex_os_state() {
const uint8_t *start = (const uint8_t*)&_sdata_os_canonical;
const uint8_t *end = (const uint8_t*)&_edata_os_canonical;
......
......@@ -101,7 +101,7 @@ triggerInterrupts (Just ints) ident = do
decision <- decisionNumber
return $
" if (" <> decisionMaker decision <> ") {\n"
<> " Machine::trigger_interrupt_from_user(" <> T.pack (show int) <> ");\n"
<> " do_trigger_interrupt(" <> T.pack (show int) <> ");\n"
<> " _triggeredSomeInterrupt = 1;\n"
<> " " <> printOSState AtBasicBlockType ident "__func__" <> ";\n"
<> " }\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment