Abstract killing TLP channel handlers out into a function.

This commit is contained in:
Adam Sampson 2008-03-12 10:47:19 +00:00
parent 8880413128
commit f2d3280cee
2 changed files with 16 additions and 4 deletions

View File

@ -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\

View File

@ -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