| @@ -9,6 +9,16 @@ |
| 9 | 9 | * |
| 10 | 10 | * Fast paths (tagging, dup/drop, yield/preemption checks) are static inline |
| 11 | 11 | * so generated code never pays a call for the common case. |
| 12 | + * |
| 13 | + * Two audiences. Generated code may use everything here. C bindings |
| 14 | + * (`@extern` functions written by hand or by `tilc bindgen`; ADR 0005 and |
| 15 | + * 0015) use only: value tagging (tl_int, tl_int_get, tl_is_ptr, TL_UNIT, |
| 16 | + * ...), tl_dup and tl_drop, strings (tl_string_from, tl_string_len, |
| 17 | + * tl_string_ptr, tl_string_cstr), tl_int_to_i64 and tl_int_from_i64, |
| 18 | + * floats (tl_float_from, tl_float_get), resources (tl_resource_new, |
| 19 | + * tl_resource_get), the prelude builders (tl_bool, tl_some, tl_ok, |
| 20 | + * tl_error), tl_panic_str and callbacks (tl_callback_*). Everything else |
| 21 | + * is for generated code only. |
| 12 | 22 | */ |
| 13 | 23 | #ifndef TILRT_H |
| 14 | 24 | #define TILRT_H |
| @@ -135,7 +145,7 @@ typedef struct tl_ctx { |
| 135 | 145 | int32_t reductions; /* decremented on function entry; <= 0 -> tl_preempt */ |
| 136 | 146 | uint64_t yield_marker; /* TL_YIELD_FINAL: marker of the target handler */ |
| 137 | 147 | tl_value yield_value; /* owned payload: op argument or panic/exit reason */ |
| 138 | | − void *evv; /* evidence vector (M3/M5; opaque in ABI v0) */ |
| 148 | + void *evv; /* unused (null): handlers are values (ADR 0010) */ |
| 139 | 149 | void *rt; /* runtime-private */ |
| 140 | 150 | tl_value xargs[TL_XARGS]; /* call arguments after the sixth (Revision 1) */ |
| 141 | 151 | } tl_ctx; |
| @@ -376,7 +386,9 @@ static inline tl_value tl_string_cstr(tl_ctx *ctx, const char *s) { |
| 376 | 386 | return tl_string_from(ctx, s, strlen(s)); |
| 377 | 387 | } |
| 378 | 388 | |
| 379 | | −/* Scheduling and actors (M0: single scheduler thread, no mailboxes yet) */ |
| 389 | +/* Scheduling and actors (runtime/tilrt/src/sched.rs). Compiled programs |
| 390 | + * use std/process through tl_root_cap; tl_spawn and tl_kill are the M0 |
| 391 | + * spike's (runtime/spike/spike.c). */ |
| 380 | 392 | void tl_preempt(tl_ctx *ctx); |
| 381 | 393 | tl_value tl_spawn(tl_ctx *ctx, tl_value closure); /* consumes closure; returns pid */ |
| 382 | 394 | void tl_kill(tl_ctx *ctx, tl_value pid); /* async exit signal */ |