mirror of
https://github.com/lemonade-sdk/mac_linuxgpu.git
synced 2026-11-23 08:59:28 -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.
19 lines
697 B
C
19 lines
697 B
C
/* linuxu: EDITED (vendor vdso/align.h inlined) */
|
|
#ifndef _LINUX_ALIGN_H
|
|
#define _LINUX_ALIGN_H
|
|
|
|
#include <linux/compiler.h>
|
|
|
|
#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
|
|
#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
|
|
|
|
/* @a is a power of 2 value */
|
|
#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
|
|
#define ALIGN_DOWN(x, a) ((x) & ~((typeof(x))(a) - 1))
|
|
#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
|
|
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
|
|
#define PTR_ALIGN_DOWN(p, a) ((typeof(p))ALIGN_DOWN((unsigned long)(p), (a)))
|
|
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
|
|
|
|
#endif /* _LINUX_ALIGN_H */
|