code wiki / _hdl_build / nx_deploy_stage_lib.nx
nx_deploy_stage_lib.nx
buildroot/runtime/_hdl_build/nx_deploy_stage_lib.nx
about
ELF-magic admission and exact-byte staging into a .new slot.
This preserves ordinary source permissions and verifies copied bytes; it does
not establish that an ELF is valid for execution. Legacy1024-byte admission
remains explicit pending format-aware admission; no64MiB content ceiling.
Caller owns trusted stage directories. File and directory sync outcomes are
recorded separately from visibility. Promotion and runtime health are separate.
license_tier: ORIGINAL
dependencies 1 imports · 5 importers
imports: nx_fio.nx
imported by: nx_deploy_stage.nxnx_deploy_stage_gate.nxnx_stage_canonical_gate_t188.nxnx_stage_emitter_canonical_gate_t188.nxnx_stage_emitter_note_gate_t188.nx
structs
| 37 | struct NxDeployStageResult |
consts
| 9 | const DS_MAGIC_1024: i64 = 1024 |
| 10 | const DS_MAGIC_4096: i64 = 4096 |
| 11 | const DS_MAGIC_2000: i64 = 2000 |
| 13 | const DS_MINSZ: i64 = 1024 // smallest plausible ELF; a smaller "binary" is a failed/torn build |
functions
| 15 | func ds_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } called by 1: main |
| 16 | func ds_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 17 | func ds_cat(d: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; var o: i64=off; while s[i]!=(0 as u8){d[o]=s[i]; o=o+1; i=i+1} return o } called by 1: ds_stage_core |
| 18 | func ds_catn(d: *u8, off: i64, v: i64) -> i64 |
| 25 | func ds_dst_is_new(dst: *u8) -> i64 |
| 40 | func ds_stat_word(stat:*u8,offset:i64)->i64 |
| 43 | func ds_stage_result_init(r:*NxDeployStageResult)->i64 |
| 46 | func ds_source_prepare(src:*u8,region:*NxFileReadRegion,stat:*u8,digest:*u8,r:*NxDeployStageResult)->i64 |
| 81 | func ds_src_size(src:*u8)->i64 |
| 95 | func ds_stage_core(src:*u8,dst:*u8,r:*NxDeployStageResult)->i64 called by 3: mainds_stagemain calls 11: ds_stage_result_initds_dst_is_newds_lenfio_region_initds_source_prepareds_cat+5 |
| 221 | func ds_stage(src:*u8,dst:*u8)->i64 |
| 229 | func ds_out_fd(fd:i64,s:*u8,n:i64)->i64 |
| 233 | func ds_text_fd(fd:i64,s:*u8)->i64{return ds_out_fd(fd,s,ds_len(s))} |
| 234 | func ds_json_fd(fd:i64,s:*u8)->i64 |
| 252 | func ds_digits_fd(fd:i64,v:i64)->i64 |
| 257 | func ds_num_fd(fd:i64,v:i64)->i64 |
| 260 | func ds_emit_result(fd:i64,src:*u8,dst:*u8,r:*NxDeployStageResult)->i64 |
| 278 | func ds_emit(src:*u8,dst:*u8,rc:i64,sz:i64)->i64 |
| 287 | func ds_selftest() -> i64 |