omega-gpu-driver
aien-dev/omega-gpu-driver
Brought by drakestapleton
omega-gpu-driver / tests / uvme_offsets.c
| 1 | /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | * A read-only host offsetof oracle, not an endpoint implementation. */ |
| 3 | #include <linux/fuse.h> |
| 4 | #include <stddef.h> |
| 5 | #include <stdio.h> |
| 6 | #define SIZE(t) printf(#t " %zu\n", sizeof(struct t)) |
| 7 | #define OFF(t,f) printf(#t "." #f " %zu\n", offsetof(struct t,f)) |
| 8 | int main(void) { |
| 9 | SIZE(fuse_in_header); OFF(fuse_in_header,unique); OFF(fuse_in_header,pid); OFF(fuse_in_header,total_extlen); |
| 10 | SIZE(fuse_out_header); OFF(fuse_out_header,error); OFF(fuse_out_header,unique); |
| 11 | SIZE(cuse_init_in); SIZE(cuse_init_out); OFF(cuse_init_out,flags); OFF(cuse_init_out,max_read); OFF(cuse_init_out,spare); |
| 12 | SIZE(fuse_open_in); SIZE(fuse_open_out); OFF(fuse_open_out,open_flags); |
| 13 | SIZE(fuse_release_in); SIZE(fuse_flush_in); |
| 14 | SIZE(fuse_ioctl_in); OFF(fuse_ioctl_in,flags); OFF(fuse_ioctl_in,cmd); OFF(fuse_ioctl_in,arg); OFF(fuse_ioctl_in,in_size); OFF(fuse_ioctl_in,out_size); |
| 15 | SIZE(fuse_ioctl_out); OFF(fuse_ioctl_out,flags); OFF(fuse_ioctl_out,in_iovs); OFF(fuse_ioctl_out,out_iovs); |
| 16 | SIZE(fuse_ioctl_iovec); OFF(fuse_ioctl_iovec,len); |
| 17 | printf("flags %u %u %u %u\n", CUSE_UNRESTRICTED_IOCTL, FUSE_IOCTL_UNRESTRICTED, FUSE_IOCTL_RETRY, FOPEN_DIRECT_IO | FOPEN_NOFLUSH); |
| 18 | return 0; |
| 19 | } |