code wiki / _hdl_build / nx_mmbench_lib.nx
nx_mmbench_lib.nx
buildroot/runtime/_hdl_build/nx_mmbench_lib.nx
about
nx_mmbench_lib.nx -- the TESTABLE CORE of the media-manager + companion ruler.
Shared by nx_mmbench (the shipping tool) AND nx_mmbench_gate (the proof), so the gate's negative
control exercises THE CODE THAT ACTUALLY SHIPS rather than a copy of it (rule 15 / refbench shape).
The whole honesty claim of the ruler rests on aud() below: if aud() does not really downgrade an
unbacked claim, every coverage number the tool prints is decoration. The gate mutation-tests it.
license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_mmbench.nxnx_mmbench_gate.nx
structs
| none |
consts
| 10 | const V_HAVE: i64 = 2 |
| 11 | const V_PART: i64 = 1 |
| 12 | const V_GAP: i64 = 0 |
| 13 | const MMB_SCRATCH: i64 = 32 |
| 63 | const MMB_BINCAP: i64 = 4194304 // 4 MiB scan cap -- DECLARED (law L011), never a silent partial |
functions
| 15 | func sw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 16 | func sn(v: i64) -> i64 |
| 30 | func have(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd<0 { return 0 } sys_close(fd); return 1 } |
| 39 | func aud(v: i64, ev: i64) -> i64 |
| 58 | func wired(wire: i64) -> i64 |
| 73 | func bin_ref(binpath: *u8, needle: *u8) -> i64 |
| 109 | func wired_ref(wire: i64, sb: i64, needle: i64) -> i64 |
| 118 | func usable(built_v: i64, wire: i64) -> i64 |
| 123 | func usable_ref(built_v: i64, wire: i64, sb: i64, needle: i64) -> i64 calls 1: wired_ref |
| 127 | func vstr(v: i64) -> *u8 { if v==2 { return "HAVE" as *u8 } if v==1 { return "PARTIAL" as *u8 } return "GAP" as *u8 } called by 1: main |
| 128 | func streq(a: *u8, b: *u8) -> i64 |