diff --git a/backends/GenerateC.hs b/backends/GenerateC.hs index e008c96..d4a3f0c 100644 --- a/backends/GenerateC.hs +++ b/backends/GenerateC.hs @@ -182,12 +182,12 @@ cgenTopLevel s tell [" (wptr"] sequence_ [tell [", &", c] | c <- chans] tell [");\n\ - \\n\ - \ bool b = true;\n"] - sequence_ [tell [" ChanOut (wptr, &", kc, ", &b, sizeof b);\n"] - | kc <- killChans] + \\n"] + sequence_ [tell [" ", func, "_kill (wptr, &", kc, ");\n"] + | (func, kc) <- zip funcs killChans] tell [" LightProcBarrierWait (wptr, &bar);\n\ + \\n\ \ Shutdown (wptr);\n\ \}\n\ \\n\ diff --git a/support/tock_support_cif.h b/support/tock_support_cif.h index f56b641..e497ccc 100644 --- a/support/tock_support_cif.h +++ b/support/tock_support_cif.h @@ -53,6 +53,11 @@ static void tock_tlp_input (Workspace wptr) { // FIXME: Implement using killable BSC } +static void tock_tlp_input_kill (Workspace wptr, Channel *kill) occam_unused; +static void tock_tlp_input_kill (Workspace wptr, Channel *kill) { + // FIXME: Implement +} + static void tock_tlp_output (Workspace wptr) occam_unused; static void tock_tlp_output (Workspace wptr) { Channel *in = ProcGetParam (wptr, 0, Channel *); @@ -77,6 +82,13 @@ static void tock_tlp_output (Workspace wptr) { } } } + +static void tock_tlp_output_kill (Workspace wptr, Channel *kill) occam_unused; +static void tock_tlp_output_kill (Workspace wptr, Channel *kill) { + bool b = true; + + ChanOut (wptr, kill, &b, sizeof b); +} //}}} #endif