test/cycles/job.rad 663 B raw
1
//! A private worker instance that exits normally or raises a CPU fault.
2
use support;
3
export mod abi;
4
export mod sys;
5
6
/// Worker startup values supplied by its controller.
7
record Env: Copy {
8
    /// Readable argument memory.
9
    argsPointer: *opaque,
10
    /// Zero selects normal exit; one selects a fault.
11
    argsSize: u64,
12
    /// Installed event capability.
13
    eventsHandle: u64,
14
    /// Shared event-ring address.
15
    eventsPointer: u64,
16
}
17
18
/// Check private dependency state before the selected terminal operation.
19
@default fn main(env: *Env) {
20
    assert support::advance() == 1;
21
    if env.argsSize == 0 {
22
        sys::exit(9);
23
    }
24
    assert false;
25
}