Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/include/vm.h
Show All 37 Lines | |||||
#define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHEABLE) | #define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHEABLE) | ||||
#define VM_MEMATTR_WRITE_COMBINING ((vm_memattr_t)PAT_WRITE_COMBINING) | #define VM_MEMATTR_WRITE_COMBINING ((vm_memattr_t)PAT_WRITE_COMBINING) | ||||
#define VM_MEMATTR_WRITE_THROUGH ((vm_memattr_t)PAT_WRITE_THROUGH) | #define VM_MEMATTR_WRITE_THROUGH ((vm_memattr_t)PAT_WRITE_THROUGH) | ||||
#define VM_MEMATTR_WRITE_PROTECTED ((vm_memattr_t)PAT_WRITE_PROTECTED) | #define VM_MEMATTR_WRITE_PROTECTED ((vm_memattr_t)PAT_WRITE_PROTECTED) | ||||
#define VM_MEMATTR_WRITE_BACK ((vm_memattr_t)PAT_WRITE_BACK) | #define VM_MEMATTR_WRITE_BACK ((vm_memattr_t)PAT_WRITE_BACK) | ||||
#define VM_MEMATTR_WEAK_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHED) | #define VM_MEMATTR_WEAK_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHED) | ||||
#define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK | #define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK | ||||
#define VM_MEMATTR_DEVICE VM_MEMATTR_UNCACHEABLE | |||||
kib: Why only for kernel?
Also, the recent change to pci_user.c can be simplified after your… | |||||
Done Inline ActionsIt would break the switch statement in usr.bin/vm/vmstat.c if we don't limit to just the kernel as it will have the same value twice. andrew: It would break the switch statement in `usr.bin/vm/vmstat.c` if we don't limit to just the… | |||||
Not Done Inline ActionsThen perhaps define MD name VM_MEMATTR_DEVMAP, present on all arches. It would be _UNCACHEABLE on x86, DEVICE on arm. pci_user.c would use _DEVMAP kib: Then perhaps define MD name VM_MEMATTR_DEVMAP, present on all arches. It would be _UNCACHEABLE… | |||||
Done Inline ActionsWe could also replace the switch statement with if else, e.g. D29703 andrew: We could also replace the switch statement with if else, e.g. D29703 | |||||
#endif /* !_MACHINE_VM_H_ */ | #endif /* !_MACHINE_VM_H_ */ |
Why only for kernel?
Also, the recent change to pci_user.c can be simplified after your introduction of VM_MEMATTR_DEVICE, look at line 1129.