interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / gpu / driver / tests / dma_badfd.om

26 lines · 767 bytes Raw Blame History
1note Production chan/dma.om transport: anonymous CPU memory and invalid fd -1 only.
2note The compiler mutates vaddr during MAP_DMA validation even when the ioctl returns EBADF.
3note A second identical attempt must still reach EBADF rather than treating a CPU address as a handle.
4fn dbcheck ok bool to void
5if not ok
6exit 1
7end
8end
9fn main to int
10dbcheck eq mmwalloc 2147483648 4096 MMOK
11g = get mmwgen 0
12h = get mmwh 0
13dbcheck eq mmwpublish g MMESTATE
14dbcheck eq mmwdmap g -1 MMEIO
15dbcheck eq get mmwerr 0 -9
16dbcheck eq get mmwst 0 MMWOWN
17dbcheck eq mmwdmap g -1 MMEIO
18dbcheck eq get mmwerr 0 -9
19dbcheck eq get mmwst 0 MMWOWN
20mmwr64 2147483648 42
21dbcheck eq mapget h 0 8 42
22dbcheck eq mmwclose g MMOK
23dbcheck eq get mmwh 0 0
24dbcheck eq mmwdmap g -1 MMEGEN
25ret 0
26end