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.
49 lines
1.2 KiB
C
49 lines
1.2 KiB
C
/* linuxu: SHIM (third_party/linux/include/linux/pid.h)
|
|
*
|
|
* Refcounted pid API backed by linuxu/src/shims/task.c. There are no pid
|
|
* namespaces: virtual and global numbers are the task's tgid.
|
|
*/
|
|
#ifndef _LINUX_PID_H
|
|
#define _LINUX_PID_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/refcount.h>
|
|
#include <linux/spinlock.h>
|
|
|
|
struct task_struct;
|
|
struct pid_namespace;
|
|
|
|
|
|
|
|
extern struct pid *get_task_pid(struct task_struct *tsk, int type);
|
|
extern struct pid *get_pid(struct pid *pid);
|
|
extern void put_pid(struct pid *pid);
|
|
extern struct task_struct *pid_task(struct pid *pid, int type);
|
|
extern struct task_struct *get_pid_task(struct pid *pid, int type);
|
|
extern struct pid *find_get_pid(pid_t nr);
|
|
|
|
/* Linux returns 0 for a NULL pid. */
|
|
extern pid_t pid_vnr(struct pid *pid);
|
|
static inline pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns)
|
|
{
|
|
(void)ns;
|
|
return pid_vnr(pid);
|
|
}
|
|
|
|
#define pid_nr(pid) pid_nr_ns((pid), (struct pid_namespace *)NULL)
|
|
|
|
/* enum pid_type (vendor 2026 pid.h); PIDTYPE_PID must stay value 0 as in
|
|
* upstream. */
|
|
enum pid_type {
|
|
PIDTYPE_PID = 0,
|
|
PIDTYPE_PGID,
|
|
PIDTYPE_SID,
|
|
PIDTYPE_TGID,
|
|
PIDTYPE_MAX,
|
|
};
|
|
|
|
extern int task_pid_vnr(const struct task_struct *task);
|
|
|
|
|
|
#endif /* _LINUX_PID_H */
|