Skip to content

Commit

Permalink
Handle base system LinuxKPI addition after 1300517.
Browse files Browse the repository at this point in the history
  • Loading branch information
wulf7 committed Oct 13, 2021
1 parent d2c1fbe commit a9cfb53
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/drm_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
#if defined(CONFIG_X86)
#include <asm/smp.h>

#if __FreeBSD_version <= 1400033
#if ((__FreeBSD_version <= 1400033) && (__FreeBSD_version >= 1400000) || \
(__FreeBSD_version <= 1300516))
#define clflushopt(addr) linux_clflushopt(addr)
#endif

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/drm_os_freebsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ do { \
({ __typeof__(*(ptr)) __tmp; \
memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })

#if __FreeBSD_version <= 1400033
#if ((__FreeBSD_version <= 1400033) && (__FreeBSD_version >= 1400000) || \
(__FreeBSD_version <= 1300516))
#define page_to_phys(x) VM_PAGE_TO_PHYS(x)
#endif

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
#ifdef __FreeBSD__
/* CEM: Make sure we got the Linux version */
CTASSERT(PAGE_MASK != (PAGE_SIZE - 1));
#if __FreeBSD_version <= 1400033
#if ((__FreeBSD_version <= 1400033) && (__FreeBSD_version >= 1400000) || \
(__FreeBSD_version <= 1300516))
#define clflushopt linux_clflushopt
#endif
#include <linux/capability.h>
Expand Down
3 changes: 2 additions & 1 deletion linuxkpi/gplv2/include/linux/highmem.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <sys/param.h>
#if __FreeBSD_version <= 1400033
#if ((__FreeBSD_version <= 1400033) && (__FreeBSD_version >= 1400000) || \
(__FreeBSD_version <= 1300516))
#ifndef _LINUX_HIGHMEM_H_
#define _LINUX_HIGHMEM_H_

Expand Down
6 changes: 4 additions & 2 deletions linuxkpi/gplv2/include/linux/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include_next <linux/page.h>

#include <sys/param.h>
#if __FreeBSD_version <= 1400033
#if ((__FreeBSD_version <= 1400033) && (__FreeBSD_version >= 1400000) || \
(__FreeBSD_version <= 1300516))
#define PAGE_KERNEL_IO 0x0000

/* XXX note that this is incomplete */
Expand All @@ -31,7 +32,8 @@ int set_pages_wb(vm_page_t page, int numpages);
int set_pages_uc(vm_page_t page, int numpages);
int set_pages_wc(vm_page_t page, int numpages);

#if __FreeBSD_version <= 1400033
#if ((__FreeBSD_version <= 1400033) && (__FreeBSD_version >= 1400000) || \
(__FreeBSD_version <= 1300516))
vm_paddr_t page_to_phys(vm_page_t page);

void unmap_mapping_range(void *obj, loff_t const holebegin,
Expand Down
3 changes: 2 additions & 1 deletion linuxkpi/gplv2/include/linux/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
#include_next <linux/scatterlist.h>

#include <sys/param.h>
#if __FreeBSD_version <= 1400033
#if ((__FreeBSD_version <= 1400033) && (__FreeBSD_version >= 1400000) || \
(__FreeBSD_version <= 1300516))
static inline size_t
sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents,
const void *buf, size_t buflen)
Expand Down
6 changes: 4 additions & 2 deletions linuxkpi/gplv2/src/linux_page.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@

#include <asm/set_memory.h>

#if __FreeBSD_version <= 1400033
#if ((__FreeBSD_version <= 1400033) && (__FreeBSD_version >= 1400000) || \
(__FreeBSD_version <= 1300516))
#if defined(__LP64__)
#define LINUXKPI_HAVE_DMAP
#else
Expand Down Expand Up @@ -213,7 +214,8 @@ arch_io_free_memtype_wc(resource_size_t start, resource_size_t size)
set_memory_wb(start, size >> PAGE_SHIFT);
}

#if __FreeBSD_version <= 1400033
#if ((__FreeBSD_version <= 1400033) && (__FreeBSD_version >= 1400000) || \
(__FreeBSD_version <= 1300516))
vm_paddr_t
page_to_phys(vm_page_t page)
{
Expand Down

0 comments on commit a9cfb53

Please sign in to comment.