mirror of
https://github.com/lemonade-sdk/mac_linuxgpu.git
synced 2026-11-22 23:57:31 -10:00
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.
20 lines
698 B
C
20 lines
698 B
C
/* In-process anonymous files with owned descriptor references. */
|
|
#ifndef __LINUX_ANON_INODES_H
|
|
#define __LINUX_ANON_INODES_H
|
|
#include <linux/fs.h>
|
|
#include <linux/file.h>
|
|
static inline int anon_inode_getfd(const char *name,
|
|
const struct file_operations *fops, void *priv, int flags)
|
|
{
|
|
int fd = get_unused_fd_flags(flags);
|
|
if (fd < 0) return fd;
|
|
struct file *file = anon_inode_getfile(name, fops, priv, flags);
|
|
if (IS_ERR(file)) { put_unused_fd(fd); return PTR_ERR(file); }
|
|
fd_install(fd, file);
|
|
return fd;
|
|
}
|
|
static inline int anon_inode_getfd_compat(const char *name,
|
|
const struct file_operations *fops, void *priv, int flags)
|
|
{ return anon_inode_getfd(name, fops, priv, flags); }
|
|
#endif
|