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