Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/page.h
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | |||||
#undef btoc | #undef btoc | ||||
#define btoc(x) (((vm_offset_t)(x) + PAGE_SIZE - 1) >> PAGE_SHIFT) | #define btoc(x) (((vm_offset_t)(x) + PAGE_SIZE - 1) >> PAGE_SHIFT) | ||||
#undef round_page | #undef round_page | ||||
#define round_page(x) ((((uintptr_t)(x)) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) | #define round_page(x) ((((uintptr_t)(x)) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) | ||||
#undef trunc_page | #undef trunc_page | ||||
#define trunc_page(x) ((uintptr_t)(x) & ~(PAGE_SIZE - 1)) | #define trunc_page(x) ((uintptr_t)(x) & ~(PAGE_SIZE - 1)) | ||||
#if defined(__i386__) || defined(__amd64__) | #if defined(__i386__) || defined(__amd64__) | ||||
#undef clflush | |||||
#undef clflushopt | #undef clflushopt | ||||
static inline void | static inline void | ||||
lkpi_clflushopt(unsigned long addr) | lkpi_clflushopt(unsigned long addr) | ||||
{ | { | ||||
if (cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) | if (cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) | ||||
clflushopt(addr); | clflushopt(addr); | ||||
else if (cpu_feature & CPUID_CLFSH) | else if (cpu_feature & CPUID_CLFSH) | ||||
clflush(addr); | clflush(addr); | ||||
else | else | ||||
pmap_invalidate_cache(); | pmap_invalidate_cache(); | ||||
} | } | ||||
#define clflush(x) clflush((unsigned long)(x)) | |||||
#define clflushopt(x) lkpi_clflushopt((unsigned long)(x)) | #define clflushopt(x) lkpi_clflushopt((unsigned long)(x)) | ||||
#endif | #endif | ||||
#endif /* _LINUX_PAGE_H_ */ | #endif /* _LINUX_PAGE_H_ */ |