Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/mm.h
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | ||||||||||
#define VM_FAULT_HWPOISON (1 << 4) | #define VM_FAULT_HWPOISON (1 << 4) | |||||||||
#define VM_FAULT_HWPOISON_LARGE (1 << 5) | #define VM_FAULT_HWPOISON_LARGE (1 << 5) | |||||||||
#define VM_FAULT_SIGSEGV (1 << 6) | #define VM_FAULT_SIGSEGV (1 << 6) | |||||||||
#define VM_FAULT_NOPAGE (1 << 7) | #define VM_FAULT_NOPAGE (1 << 7) | |||||||||
#define VM_FAULT_LOCKED (1 << 8) | #define VM_FAULT_LOCKED (1 << 8) | |||||||||
#define VM_FAULT_RETRY (1 << 9) | #define VM_FAULT_RETRY (1 << 9) | |||||||||
#define VM_FAULT_FALLBACK (1 << 10) | #define VM_FAULT_FALLBACK (1 << 10) | |||||||||
#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV | \ | ||||||||||
VM_FAULT_HWPOISON |VM_FAULT_HWPOISON_LARGE | VM_FAULT_FALLBACK) | ||||||||||
#define FAULT_FLAG_WRITE (1 << 0) | #define FAULT_FLAG_WRITE (1 << 0) | |||||||||
#define FAULT_FLAG_MKWRITE (1 << 1) | #define FAULT_FLAG_MKWRITE (1 << 1) | |||||||||
#define FAULT_FLAG_ALLOW_RETRY (1 << 2) | #define FAULT_FLAG_ALLOW_RETRY (1 << 2) | |||||||||
#define FAULT_FLAG_RETRY_NOWAIT (1 << 3) | #define FAULT_FLAG_RETRY_NOWAIT (1 << 3) | |||||||||
#define FAULT_FLAG_KILLABLE (1 << 4) | #define FAULT_FLAG_KILLABLE (1 << 4) | |||||||||
#define FAULT_FLAG_TRIED (1 << 5) | #define FAULT_FLAG_TRIED (1 << 5) | |||||||||
#define FAULT_FLAG_USER (1 << 6) | #define FAULT_FLAG_USER (1 << 6) | |||||||||
#define FAULT_FLAG_REMOTE (1 << 7) | #define FAULT_FLAG_REMOTE (1 << 7) | |||||||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | io_remap_pfn_range(struct vm_area_struct *vma, | |||||||||
vm_memattr_t prot) | vm_memattr_t prot) | |||||||||
{ | { | |||||||||
vma->vm_page_prot = prot; | vma->vm_page_prot = prot; | |||||||||
vma->vm_pfn = pfn; | vma->vm_pfn = pfn; | |||||||||
vma->vm_len = size; | vma->vm_len = size; | |||||||||
return (0); | return (0); | |||||||||
} | } | |||||||||
vm_fault_t | ||||||||||
lkpi_vmf_insert_pfn_prot_locked(struct vm_area_struct *vma, unsigned long addr, | ||||||||||
markj: I don't really understand the namespacing rules for the linuxkpi. Is lkpi_* for functions that… | ||||||||||
Done Inline ActionsIMO linux_* belongs to linuxolator. And new LKPI code should use lkpi_ wulf: IMO linux_* belongs to linuxolator. And new LKPI code should use lkpi_ | ||||||||||
unsigned long pfn, pgprot_t prot); | ||||||||||
static inline vm_fault_t | ||||||||||
vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, | ||||||||||
unsigned long pfn, pgprot_t prot) | ||||||||||
{ | ||||||||||
vm_fault_t ret; | ||||||||||
VM_OBJECT_WLOCK(vma->vm_obj); | ||||||||||
ret = lkpi_vmf_insert_pfn_prot_locked(vma, addr, pfn, prot); | ||||||||||
VM_OBJECT_WUNLOCK(vma->vm_obj); | ||||||||||
return (ret); | ||||||||||
} | ||||||||||
#define vmf_insert_pfn_prot(...) \ | ||||||||||
Not Done Inline Actions<tab> character after define? hselasky: <tab> character after define? | ||||||||||
_Static_assert(false, \ | ||||||||||
Not Done Inline ActionsIt would be useful to have some comment explaining why this is here, IMHO. I presume it's to avoid races around vm_pfn_count? markj: It would be useful to have some comment explaining why this is here, IMHO. I presume it's to… | ||||||||||
Done Inline Actions
It is done by performance reasons. Description is updated. wulf: > It would be useful to have some comment explaining why this is here, IMHO. I presume it's to… | ||||||||||
"This function is always called in a loop. Consider using the locked version") | ||||||||||
Not Done Inline Actions
or "Consider use of the locked version" markj: or "Consider use of the locked version" | ||||||||||
static inline int | static inline int | |||||||||
apply_to_page_range(struct mm_struct *mm, unsigned long address, | apply_to_page_range(struct mm_struct *mm, unsigned long address, | |||||||||
unsigned long size, pte_fn_t fn, void *data) | unsigned long size, pte_fn_t fn, void *data) | |||||||||
{ | { | |||||||||
return (-ENOTSUP); | return (-ENOTSUP); | |||||||||
} | } | |||||||||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |
I don't really understand the namespacing rules for the linuxkpi. Is lkpi_* for functions that are not compatible with Linux but nonetheless are useful in ported code?