compiler/
kernel/
lib/
scripts/
seed/
sublime/
test/
acceptance/
boot/
bootstrap/
cycles/
dispatch/
loader/
mmio/
native/
packages/
pages/
runtime/
scheduling/
shared/
app.rad
601 B
build.rad
6.5 KiB
run
636 B
support.rad
419 B
slots/
smp/
support/
sync/
termination/
tests/
trap/
package-golden
1.6 KiB
run
3.1 KiB
runner.rad
10.5 KiB
vim/
.gitignore
336 B
.gitsigners
112 B
CONTRIBUTING
2.1 KiB
LICENSE
1.1 KiB
Makefile
9.2 KiB
README
2.5 KiB
STYLE
2.5 KiB
std.lib
1.5 KiB
std.lib.test
662 B
test/shared/app.rad
raw
| 1 | //! Shared entry with callbacks, initialized data pointers, and private counters. |
| 2 | |
| 3 | use support; |
| 4 | |
| 5 | /// Callback table contains a linked dependency function address. |
| 6 | static CALLBACKS: [fn() -> i32; 1] = [support::read]; |
| 7 | /// The slice contains a pointer into this domain's string storage. |
| 8 | static TEXT: *[u8] = "xy"; |
| 9 | /// Number of calls in the current domain. |
| 10 | static calls: i32 = 0; |
| 11 | |
| 12 | /// Read dependency state through calls and data, then advance private state. |
| 13 | @default export fn main() -> i32 { |
| 14 | set calls += 1; |
| 15 | return support::read() + CALLBACKS[0]() + support::value + TEXT[0] as i32 + calls; |
| 16 | } |