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

22 lines
483 B
C

/* linuxu: SHIM (third_party/linux/include/linux/folio_batch.h) */
#ifndef __LINUX_FOLIO_BATCH_H
#define __LINUX_FOLIO_BATCH_H
#include <linux/mm.h>
static inline void folio_batch_init(struct folio_batch *l)
{
l->nr = 0;
}
static inline unsigned int folio_batch_count(const struct folio_batch *l)
{
return l->nr;
}
static inline bool folio_batch_add(struct folio_batch *l, void *folio)
{
if (l->nr >= 16)
return false;
l->folios[l->nr++] = folio;
return l->nr < 16;
}
#endif