Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/aienux/disk/nvme_bare_a64efi.om # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / aienux / disk / nvme_bare_a64efi.om` 72 lines ยท 1431 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 2 note aienux/disk/nvme_bare_a64efi.om: Bare-metal target a64efi backend for nvme_ro_bare.om. 3 note Uses target a64efi fwld/fwst/fwsys intrinsics (docs/A64-EFI.md). 4 note Overflow-safe CNTVCT_EL0 ms clock: (t / frq) * 1000 + ((t % frq) * 1000) / frq. 5 note Requires Piece 1 platform hooks: 6 note a64_dsb_sy() -> void 7 note a64_dc_civac_range(pa ulong, len ulong) -> void 8 9 fn nvme_mmio_r32 addr ulong to ulong 10 ret fwld addr 4 11 end 12 13 fn nvme_mmio_r64 addr ulong to ulong 14 ret fwld addr 8 15 end 16 17 fn nvme_mmio_w32 addr ulong val ulong to void 18 z = fwst addr 4 val 19 end 20 21 fn nvme_mmio_w64 addr ulong val ulong to void 22 z = fwst addr 8 val 23 end 24 25 fn nvme_dma_r32 addr ulong to ulong 26 ret fwld addr 4 27 end 28 29 fn nvme_dma_w32 addr ulong val ulong to void 30 z = fwst addr 4 val 31 end 32 33 fn nvme_dma_w64 addr ulong val ulong to void 34 z = fwst addr 8 val 35 end 36 37 fn nvme_dma_r8 addr ulong to ulong 38 ret fwld addr 1 39 end 40 41 fn nvme_dma_zero addr ulong size ulong to void 42 i = ulong 0 43 while lt i size bound `9223372036854775807` 44 if le add i 8 size 45 z = fwst add addr i 8 0 46 i = add i 8 47 else 48 z = fwst add addr i 1 0 49 i = add i 1 50 end 51 end 52 end 53 54 fn nvme_now_ms to ulong 55 t = fwsys 2 56 frq = fwsys 3 57 if lt frq 1000 58 ret 0 59 end 60 sec_ms = mul div t frq 1000 61 rem_ms = div mul rem t frq 1000 frq 62 ret add sec_ms rem_ms 63 end 64 65 fn nvme_dsb_sy to void 66 a64_dsb_sy 67 end 68 69 fn nvme_wb_clean_inv pa ulong nbytes ulong to void 70 a64_dc_civac_range pa nbytes 71 a64_dsb_sy 72 end