diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2026-04-23 17:05:54 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2026-04-23 17:05:54 +0000 |
| commit | fe3e92e6868dce2ed94c98428b8df1f27ed3ef63 (patch) | |
| tree | 027b31b44e12081aab6c139aedb8b2a6a11bd86d /sys/compat/linuxkpi | |
| parent | c49cbf849dee9121ed3b972df56d240068d0423e (diff) | |
Diffstat (limited to 'sys/compat/linuxkpi')
4 files changed, 7 insertions, 8 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/highmem.h b/sys/compat/linuxkpi/common/include/linux/highmem.h index 1374712735ac..b704e77b6c2f 100644 --- a/sys/compat/linuxkpi/common/include/linux/highmem.h +++ b/sys/compat/linuxkpi/common/include/linux/highmem.h @@ -62,7 +62,7 @@ kmap(struct page *page) struct sf_buf *sf; if (PMAP_HAS_DMAP) { - return ((void *)PHYS_TO_DMAP(page_to_phys(page))); + return (PHYS_TO_DMAP(page_to_phys(page))); } else { sched_pin(); sf = sf_buf_alloc(page, SFB_NOWAIT | SFB_CPUPRIVATE); diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index 01ea282aa914..f89c150e7a3b 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -542,10 +542,10 @@ static inline int arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size) { #if defined(__amd64__) - vm_offset_t va; + void *va; va = PHYS_TO_DMAP(start); - return (-pmap_change_attr((void *)va, size, VM_MEMATTR_WRITE_COMBINING)); + return (-pmap_change_attr(va, size, VM_MEMATTR_WRITE_COMBINING)); #else return (0); #endif @@ -555,11 +555,11 @@ static inline void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size) { #if defined(__amd64__) - vm_offset_t va; + void *va; va = PHYS_TO_DMAP(start); - pmap_change_attr((void *)va, size, VM_MEMATTR_WRITE_BACK); + pmap_change_attr(va, size, VM_MEMATTR_WRITE_BACK); #endif } diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index 775ed499a7d0..c49c2179d359 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -656,7 +656,7 @@ sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents, break; vaddr = sf_buf_kva(sf); } else - vaddr = (char *)PHYS_TO_DMAP(page_to_phys(page)); + vaddr = PHYS_TO_DMAP(page_to_phys(page)); memcpy(buf, vaddr + sg->offset + offset, len); if (!PMAP_HAS_DMAP) sf_buf_free(sf); diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index 10ede3287bb4..39edb34545b7 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -87,8 +87,7 @@ linux_page_address(const struct page *page) { if (page->object != kernel_object) { - return (PMAP_HAS_DMAP ? - ((void *)(uintptr_t)PHYS_TO_DMAP(page_to_phys(page))) : + return (PMAP_HAS_DMAP ? PHYS_TO_DMAP(page_to_phys(page)) : NULL); } return ((void *)(uintptr_t)(VM_MIN_KERNEL_ADDRESS + |
