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
omega-mv / gpu / driver / tests / uvme_notify.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Host eventfd and model ring only: no VFIO/device word is called. |
| 3 | fn main to int |
| 4 | if ne screate UVOK |
| 5 | ret 18 |
| 6 | end |
| 7 | if ne sadd UVBASE UV4K UVBASE 1 UVOK |
| 8 | ret 19 |
| 9 | end |
| 10 | put iqcmode 0 1 |
| 11 | put iqcstate 0 1 |
| 12 | cap = unirqmk |
| 13 | if not unvalid cap |
| 14 | ret 1 |
| 15 | end |
| 16 | r = unpump cap 0 |
| 17 | if ne r 0 |
| 18 | ret 2 |
| 19 | end |
| 20 | for j ulong 32 |
| 21 | put uvpkt j 0 |
| 22 | end |
| 23 | note Valid replayable read fault, VA=UVBASE. Word7 = valid|MMU-enabled|replay|kind1. |
| 24 | put uvpkt 12 1 |
| 25 | put uvpkt 28 129 |
| 26 | put uvpkt 31 192 |
| 27 | r = unpost cap |
| 28 | if ne r 0 |
| 29 | ret 3 |
| 30 | end |
| 31 | r = unpost cap |
| 32 | if ne r 0 |
| 33 | ret 4 |
| 34 | end |
| 35 | r = unpump cap 0 |
| 36 | if ne r 1 |
| 37 | ret 5 |
| 38 | end |
| 39 | if ne get unwakes 0 2 |
| 40 | ret 6 |
| 41 | end |
| 42 | if ne get fbn 0 1 |
| 43 | ret 7 |
| 44 | end |
| 45 | if ne get fbget 0 2 |
| 46 | ret 8 |
| 47 | end |
| 48 | note The eventfd drain ran the real model service: PTE then invalidate then replay. |
| 49 | if or ne get sen 0 1 ne get sev 2 UVREPLAY |
| 50 | ret 20 |
| 51 | end |
| 52 | if ne uvread UVBASE UV4K UVMAPPED |
| 53 | ret 21 |
| 54 | end |
| 55 | if ne get uvdpa 0 UVBASE |
| 56 | ret 22 |
| 57 | end |
| 58 | if ne iqctake 1 |
| 59 | ret 23 |
| 60 | end |
| 61 | if or ne iqcget 0 2 ne iqcget 2 UVBASE |
| 62 | ret 24 |
| 63 | end |
| 64 | if ne iqcack iqcget 1 0 |
| 65 | ret 25 |
| 66 | end |
| 67 | if ne iqctake 1 |
| 68 | ret 26 |
| 69 | end |
| 70 | if or ne iqcget 0 1 ne iqcget 2 UVBASE |
| 71 | ret 27 |
| 72 | end |
| 73 | if ne iqcack iqcget 1 0 |
| 74 | ret 28 |
| 75 | end |
| 76 | if ne unpump cap 0 0 |
| 77 | ret 9 |
| 78 | end |
| 79 | for j ulong 16 |
| 80 | r = unpost cap |
| 81 | if ne r 0 |
| 82 | ret 10 |
| 83 | end |
| 84 | end |
| 85 | r = unpost cap |
| 86 | if ne r long UVENOM |
| 87 | ret 11 |
| 88 | end |
| 89 | if ne get fbov 0 1 |
| 90 | ret 12 |
| 91 | end |
| 92 | if ne unpump cap 0 1 |
| 93 | ret 13 |
| 94 | end |
| 95 | if ne get unwakes 0 18 |
| 96 | ret 14 |
| 97 | end |
| 98 | if ne unclose cap 0 |
| 99 | ret 15 |
| 100 | end |
| 101 | if ne unpump cap 0 neg long 9 |
| 102 | ret 16 |
| 103 | end |
| 104 | if unvalid unirqmk |
| 105 | ret 17 |
| 106 | end |
| 107 | ret 0 |
| 108 | end |