linuxkpi: Define pat_enabled()

This new <asm/memtype.h> header is included from <linux/pci.h> because
that's how it is included in Linux too. DRM drivers depend on this.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39052
This commit is contained in:
Jean-Sébastien Pédron 2023-02-20 21:45:24 +01:00
parent 899becbfcb
commit 83df72e5fb
No known key found for this signature in database
GPG Key ID: 39E99761A5FD94CC
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,18 @@
/* Public domain. */
#ifndef _LINUXKPI_ASM_MEMTYPE_H_
#define _LINUXKPI_ASM_MEMTYPE_H_
#if defined(__amd64__) || defined(__i386__)
#include <asm/cpufeature.h>
static inline bool
pat_enabled(void)
{
return (boot_cpu_has(X86_FEATURE_PAT));
}
#endif
#endif /* _LINUXKPI_ASM_MEMTYPE_H_ */

View File

@ -57,6 +57,7 @@
#include <linux/compiler.h>
#include <linux/errno.h>
#include <asm/atomic.h>
#include <asm/memtype.h>
#include <linux/device.h>
#include <linux/pci_ids.h>
#include <linux/pm.h>