mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
LinuxKPI: Add more #ifdef VM_MEMATTR_WRITE_COMBINING guards
One of the three uses is already guarded; this guards the remaining ones
to support architectures like riscv that do not provide write-combining,
and is needed to build drm-kmod on riscv.
Reviewed by: hselasky, manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31999
(cherry picked from commit 8167c92f65)
This commit is contained in:
parent
94bbe32a44
commit
e79989d823
2 changed files with 8 additions and 0 deletions
|
|
@ -411,8 +411,12 @@ void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr);
|
|||
#define ioremap(addr, size) \
|
||||
_ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE)
|
||||
#endif
|
||||
#ifdef VM_MEMATTR_WRITE_COMBINING
|
||||
#define ioremap_wc(addr, size) \
|
||||
_ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING)
|
||||
#else
|
||||
#define ioremap_wc(addr, size) ioremap_nocache(addr, size)
|
||||
#endif
|
||||
#define ioremap_wb(addr, size) \
|
||||
_ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK)
|
||||
void iounmap(void *addr);
|
||||
|
|
|
|||
|
|
@ -76,8 +76,12 @@ pgprot2cachemode(pgprot_t prot)
|
|||
#define clear_page(page) memset(page, 0, PAGE_SIZE)
|
||||
#define pgprot_noncached(prot) \
|
||||
(((prot) & VM_PROT_ALL) | cachemode2protval(VM_MEMATTR_UNCACHEABLE))
|
||||
#ifdef VM_MEMATTR_WRITE_COMBINING
|
||||
#define pgprot_writecombine(prot) \
|
||||
(((prot) & VM_PROT_ALL) | cachemode2protval(VM_MEMATTR_WRITE_COMBINING))
|
||||
#else
|
||||
#define pgprot_writecombine(prot) pgprot_noncached(prot)
|
||||
#endif
|
||||
|
||||
#undef PAGE_MASK
|
||||
#define PAGE_MASK (~(PAGE_SIZE-1))
|
||||
|
|
|
|||
Loading…
Reference in a new issue