Files
geramyloveless 953cf0149c mac_linuxgpu: upstream Linux amdgpu on macOS
Runs the unmodified upstream Linux amdgpu and amdkfd drivers on Apple
Silicon Macs inside a DriverKit system extension, for AMD GPUs attached
over Thunderbolt. The Linux sources come from a pinned submodule and are
compiled against linuxu, a userspace implementation of the Linux kernel
APIs they use. Includes the HSA runtime, the host installer app, the
setup and firmware fetch scripts, and the offline test suite.
2026-10-02 18:49:17 -07:00

40 lines
1.0 KiB
C

/* linuxu: SHIM (third_party/linux/include/linux/sync_file.h)
*
* The struct is complete (vendor 2026 layout) because the driver
* dereferences sync_file->file (amdgpu_cs.c fd_install path).
*/
#ifndef __LINUX_SYNC_FILE_H
#define __LINUX_SYNC_FILE_H
#include <linux/types.h>
#include <linux/list.h>
#include <linux/wait.h>
#include <linux/dma-fence.h>
struct file;
struct sync_file {
struct file *file;
char user_name[32];
wait_queue_head_t wq;
unsigned long flags;
struct dma_fence *fence;
};
extern struct sync_file *sync_file_create(struct dma_fence *fence);
extern void sync_file_put(struct sync_file *sf);
extern void sync_file_destroy(struct sync_file *sf);
/*
* sync.c includes sync_file.h BEFORE dma-fence.h; the driver and the
* rest of the tree always have struct dma_fence complete by the time
* sync_file_create() is called, so forward-declare it here to keep this
* header self-contained in that include order.
*/
struct dma_fence;
struct dma_fence *sync_file_get_fence(int fd);
#endif /* __LINUX_SYNC_FILE_H */