Page MenuHomeFreeBSD

D45057.diff
No OneTemporary

D45057.diff

diff --git a/sys/compat/linuxkpi/common/include/asm/set_memory.h b/sys/compat/linuxkpi/common/include/asm/set_memory.h
--- a/sys/compat/linuxkpi/common/include/asm/set_memory.h
+++ b/sys/compat/linuxkpi/common/include/asm/set_memory.h
@@ -34,26 +34,20 @@
static inline int
set_memory_uc(unsigned long addr, int numpages)
{
- vm_offset_t va;
vm_size_t len;
- va = PHYS_TO_DMAP(addr);
- len = numpages << PAGE_SHIFT;
-
- return (-pmap_change_attr(va, len, VM_MEMATTR_UNCACHEABLE));
+ len = (vm_size_t)numpages << PAGE_SHIFT;
+ return (-pmap_change_attr(addr, len, VM_MEMATTR_UNCACHEABLE));
}
static inline int
set_memory_wc(unsigned long addr, int numpages)
{
#ifdef VM_MEMATTR_WRITE_COMBINING
- vm_offset_t va;
vm_size_t len;
- va = PHYS_TO_DMAP(addr);
- len = numpages << PAGE_SHIFT;
-
- return (-pmap_change_attr(va, len, VM_MEMATTR_WRITE_COMBINING));
+ len = (vm_size_t)numpages << PAGE_SHIFT;
+ return (-pmap_change_attr(addr, len, VM_MEMATTR_WRITE_COMBINING));
#else
return (set_memory_uc(addr, numpages));
#endif
@@ -62,13 +56,10 @@
static inline int
set_memory_wb(unsigned long addr, int numpages)
{
- vm_offset_t va;
vm_size_t len;
- va = PHYS_TO_DMAP(addr);
- len = numpages << PAGE_SHIFT;
-
- return (-pmap_change_attr(va, len, VM_MEMATTR_WRITE_BACK));
+ len = (vm_size_t)numpages << PAGE_SHIFT;
+ return (-pmap_change_attr(addr, len, VM_MEMATTR_WRITE_BACK));
}
static inline int

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 27, 8:03 AM (2 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16190494
Default Alt Text
D45057.diff (1 KB)

Event Timeline