Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_page.h
Show First 20 Lines • Show All 583 Lines • ▼ Show 20 Lines | |||||
* machine-independent layer. | * machine-independent layer. | ||||
*/ | */ | ||||
#define PS_ALL_DIRTY 0x1 | #define PS_ALL_DIRTY 0x1 | ||||
#define PS_ALL_VALID 0x2 | #define PS_ALL_VALID 0x2 | ||||
#define PS_NONE_BUSY 0x4 | #define PS_NONE_BUSY 0x4 | ||||
extern struct bitset *vm_page_dump; | extern struct bitset *vm_page_dump; | ||||
extern long vm_page_dump_pages; | extern long vm_page_dump_pages; | ||||
extern vm_paddr_t dump_avail[]; | |||||
adrian: hi!
This is a duplicate definition; the original definition is in vm_phys.h and it's tripping… | |||||
kibUnsubmitted Not Done Inline ActionsShow exact compiler message for this case. kib: Show exact compiler message for this case. | |||||
kevansUnsubmitted Not Done Inline Actions--- kern_dump.o --- In file included from /usr/src/sys/kern/kern_dump.c:41: /usr/src/sys/vm/vm_phys.h:50:19: error: redundant redeclaration of 'dump_avail' [-Werror=redundant-decls] 50 | extern vm_paddr_t dump_avail[PHYS_AVAIL_COUNT]; | ^~~~~~~~~~ In file included from /usr/src/sys/kern/kern_dump.c:40: /usr/src/sys/vm/vm_page.h:592:19: note: previous declaration of 'dump_avail' was here 592 | extern vm_paddr_t dump_avail[]; | ^~~~~~~~~~ kevans: ```
--- kern_dump.o --- … | |||||
kibUnsubmitted Not Done Inline ActionsDoes the following help ? diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h index 438f83d46e9..ec248c79b5d 100644 --- a/sys/vm/vm_phys.h +++ b/sys/vm/vm_phys.h @@ -47,7 +47,7 @@ #endif extern vm_paddr_t phys_avail[PHYS_AVAIL_COUNT]; -extern vm_paddr_t dump_avail[PHYS_AVAIL_COUNT]; +extern vm_paddr_t dump_avail[]; /* Domains must be dense (non-sparse) and zero-based. */ struct mem_affinity { kib: Does the following help ?
```
diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h
index… | |||||
kevansUnsubmitted Not Done Inline ActionsNegative: In file included from /usr/src/sys/kern/kern_malloc.c:82: /usr/src/sys/vm/vm_phys.h:50:19: error: redundant redeclaration of 'dump_avail' [-Werror=redundant-decls] 50 | extern vm_paddr_t dump_avail[]; | ^~~~~~~~~~ In file included from /usr/src/sys/kern/kern_malloc.c:81: /usr/src/sys/vm/vm_page.h:592:19: note: previous declaration of 'dump_avail' was here 592 | extern vm_paddr_t dump_avail[]; | ^~~~~~~~~~ kevans: Negative:
```
In file included from /usr/src/sys/kern/kern_malloc.c:82… | |||||
static inline void | static inline void | ||||
dump_add_page(vm_paddr_t pa) | dump_add_page(vm_paddr_t pa) | ||||
{ | { | ||||
BIT_SET_ATOMIC(vm_page_dump_pages, pa >> PAGE_SHIFT, vm_page_dump); | vm_pindex_t adj; | ||||
int i; | |||||
adj = 0; | |||||
for (i = 0; dump_avail[i + 1] != 0; i += 2) { | |||||
if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) { | |||||
BIT_SET_ATOMIC(vm_page_dump_pages, | |||||
(pa >> PAGE_SHIFT) - (dump_avail[i] >> PAGE_SHIFT) + | |||||
adj, vm_page_dump); | |||||
return; | |||||
} | } | ||||
adj += howmany(dump_avail[i + 1], PAGE_SIZE) - | |||||
dump_avail[i] / PAGE_SIZE; | |||||
} | |||||
} | |||||
static inline void | static inline void | ||||
dump_drop_page(vm_paddr_t pa) | dump_drop_page(vm_paddr_t pa) | ||||
{ | { | ||||
BIT_CLR_ATOMIC(vm_page_dump_pages, pa >> PAGE_SHIFT, vm_page_dump); | vm_pindex_t adj; | ||||
int i; | |||||
adj = 0; | |||||
for (i = 0; dump_avail[i + 1] != 0; i += 2) { | |||||
if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) { | |||||
BIT_CLR_ATOMIC(vm_page_dump_pages, | |||||
(pa >> PAGE_SHIFT) - (dump_avail[i] >> PAGE_SHIFT) + | |||||
adj, vm_page_dump); | |||||
return; | |||||
} | } | ||||
adj += howmany(dump_avail[i + 1], PAGE_SIZE) - | |||||
dump_avail[i] / PAGE_SIZE; | |||||
} | |||||
} | |||||
static inline vm_paddr_t | |||||
vm_page_dump_index_to_pa(int bit) | |||||
{ | |||||
int i, tot; | |||||
for (i = 0; dump_avail[i + 1] != 0; i += 2) { | |||||
tot = howmany(dump_avail[i + 1], PAGE_SIZE) - | |||||
dump_avail[i] / PAGE_SIZE; | |||||
if (bit < tot) | |||||
return ((vm_paddr_t)bit * PAGE_SIZE + | |||||
dump_avail[i] & ~PAGE_MASK); | |||||
bit -= tot; | |||||
} | |||||
return ((vm_paddr_t)NULL); | |||||
} | |||||
#define VM_PAGE_DUMP_FOREACH(pa) \ | #define VM_PAGE_DUMP_FOREACH(pa) \ | ||||
for (vm_pindex_t __b = BIT_FFS(vm_page_dump_pages, vm_page_dump); \ | for (vm_pindex_t __b = BIT_FFS(vm_page_dump_pages, vm_page_dump); \ | ||||
(pa) = (__b - 1) * PAGE_SIZE, __b != 0; \ | (pa) = vm_page_dump_index_to_pa(__b - 1), __b != 0; \ | ||||
__b = BIT_FFS_AT(vm_page_dump_pages, vm_page_dump, __b)) | __b = BIT_FFS_AT(vm_page_dump_pages, vm_page_dump, __b)) | ||||
bool vm_page_busy_acquire(vm_page_t m, int allocflags); | bool vm_page_busy_acquire(vm_page_t m, int allocflags); | ||||
void vm_page_busy_downgrade(vm_page_t m); | void vm_page_busy_downgrade(vm_page_t m); | ||||
int vm_page_busy_tryupgrade(vm_page_t m); | int vm_page_busy_tryupgrade(vm_page_t m); | ||||
void vm_page_busy_sleep(vm_page_t m, const char *msg, bool nonshared); | void vm_page_busy_sleep(vm_page_t m, const char *msg, bool nonshared); | ||||
void vm_page_busy_sleep_unlocked(vm_object_t obj, vm_page_t m, | void vm_page_busy_sleep_unlocked(vm_object_t obj, vm_page_t m, | ||||
vm_pindex_t pindex, const char *wmesg, bool nonshared); | vm_pindex_t pindex, const char *wmesg, bool nonshared); | ||||
▲ Show 20 Lines • Show All 405 Lines • Show Last 20 Lines |
hi!
This is a duplicate definition; the original definition is in vm_phys.h and it's tripping up gcc-6 with redundant declarations warnings-as-errors enabled.
Do these functions need to be inlined nowdays?