Optimize out VM_PHYSMEM_PTR_SWAP on architectures that have VM_PHYSSEG_MAX = 1
(hard to address two different array entries there w/o invoking undefined behaviour, and newer compilers complain about it).
This commit is contained in:
parent
a07180c32d
commit
dbe78631e3
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uvm_page.h,v 1.75 2012/05/05 20:45:35 rmind Exp $ */
|
||||
/* $NetBSD: uvm_page.h,v 1.76 2013/10/25 14:30:21 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||
@ -290,8 +290,12 @@ extern bool vm_page_zero_enable;
|
||||
*/
|
||||
|
||||
#define VM_PHYSMEM_PTR(i) (&vm_physmem[i])
|
||||
#if VM_PHYSSEG_MAX == 1
|
||||
#define VM_PHYSMEM_PTR_SWAP(i, j) /* impossible */
|
||||
#else
|
||||
#define VM_PHYSMEM_PTR_SWAP(i, j) \
|
||||
do { vm_physmem[(i)] = vm_physmem[(j)]; } while (0)
|
||||
#endif
|
||||
|
||||
extern struct vm_physseg vm_physmem[VM_PHYSSEG_MAX];
|
||||
extern int vm_nphysseg;
|
||||
|
Loading…
Reference in New Issue
Block a user