libkvm: fix warning issues post-r291406
- Fix -Wunused warnings with *_native detection handlers by marking `kd` __unused, except with arm/mips, where a slightly more complicated scheme is required to handle the native case vs the non-native case. - Fix -Wmissing-variable-declarations warnings by marking struct kvm_arch objects static. Differential Revision: D10071 MFC after: 1 week Reviewed by: vangyzen Tested with: WIP test code (D10024) // kgdb7121 (i386 crash/kernel on amd64) Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
16fe28bb9f
commit
881b0edb8f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315697
@ -316,7 +316,7 @@ _amd64_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
|
||||
}
|
||||
|
||||
int
|
||||
_amd64_native(kvm_t *kd)
|
||||
_amd64_native(kvm_t *kd __unused)
|
||||
{
|
||||
|
||||
#ifdef __amd64__
|
||||
@ -326,7 +326,7 @@ _amd64_native(kvm_t *kd)
|
||||
#endif
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_amd64 = {
|
||||
static struct kvm_arch kvm_amd64 = {
|
||||
.ka_probe = _amd64_probe,
|
||||
.ka_initvtop = _amd64_initvtop,
|
||||
.ka_freevtop = _amd64_freevtop,
|
||||
|
@ -249,7 +249,11 @@ _kvm_mdopen(kvm_t *kd)
|
||||
#endif
|
||||
|
||||
int
|
||||
#ifdef __arm__
|
||||
_arm_native(kvm_t *kd)
|
||||
#else
|
||||
_arm_native(kvm_t *kd __unused)
|
||||
#endif
|
||||
{
|
||||
|
||||
#ifdef __arm__
|
||||
@ -263,7 +267,7 @@ _arm_native(kvm_t *kd)
|
||||
#endif
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_arm = {
|
||||
static struct kvm_arch kvm_arm = {
|
||||
.ka_probe = _arm_probe,
|
||||
.ka_initvtop = _arm_initvtop,
|
||||
.ka_freevtop = _arm_freevtop,
|
||||
|
@ -409,7 +409,7 @@ _i386_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
|
||||
}
|
||||
|
||||
int
|
||||
_i386_native(kvm_t *kd)
|
||||
_i386_native(kvm_t *kd __unused)
|
||||
{
|
||||
|
||||
#ifdef __i386__
|
||||
@ -419,7 +419,7 @@ _i386_native(kvm_t *kd)
|
||||
#endif
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_i386 = {
|
||||
static struct kvm_arch kvm_i386 = {
|
||||
.ka_probe = _i386_probe,
|
||||
.ka_initvtop = _i386_initvtop,
|
||||
.ka_freevtop = _i386_freevtop,
|
||||
|
@ -215,7 +215,7 @@ _aarch64_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
|
||||
}
|
||||
|
||||
static int
|
||||
_aarch64_native(kvm_t *kd)
|
||||
_aarch64_native(kvm_t *kd __unused)
|
||||
{
|
||||
|
||||
#ifdef __aarch64__
|
||||
@ -225,7 +225,7 @@ _aarch64_native(kvm_t *kd)
|
||||
#endif
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_aarch64_minidump = {
|
||||
static struct kvm_arch kvm_aarch64_minidump = {
|
||||
.ka_probe = _aarch64_minidump_probe,
|
||||
.ka_initvtop = _aarch64_minidump_initvtop,
|
||||
.ka_freevtop = _aarch64_minidump_freevtop,
|
||||
|
@ -297,7 +297,7 @@ _amd64_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
|
||||
return (_amd64_minidump_vatop(kd, va, pa));
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_amd64_minidump = {
|
||||
static struct kvm_arch kvm_amd64_minidump = {
|
||||
.ka_probe = _amd64_minidump_probe,
|
||||
.ka_initvtop = _amd64_minidump_initvtop,
|
||||
.ka_freevtop = _amd64_minidump_freevtop,
|
||||
|
@ -209,7 +209,7 @@ _arm_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
|
||||
return (0);
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_arm_minidump = {
|
||||
static struct kvm_arch kvm_arm_minidump = {
|
||||
.ka_probe = _arm_minidump_probe,
|
||||
.ka_initvtop = _arm_minidump_initvtop,
|
||||
.ka_freevtop = _arm_minidump_freevtop,
|
||||
|
@ -238,7 +238,7 @@ _i386_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
|
||||
return (_i386_minidump_vatop(kd, va, pa));
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_i386_minidump = {
|
||||
static struct kvm_arch kvm_i386_minidump = {
|
||||
.ka_probe = _i386_minidump_probe,
|
||||
.ka_initvtop = _i386_minidump_initvtop,
|
||||
.ka_freevtop = _i386_minidump_freevtop,
|
||||
|
@ -241,7 +241,11 @@ _mips_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
|
||||
}
|
||||
|
||||
static int
|
||||
#ifdef __mips__
|
||||
_mips_native(kvm_t *kd)
|
||||
#else
|
||||
_mips_native(kvm_t *kd __unused)
|
||||
#endif
|
||||
{
|
||||
|
||||
#ifdef __mips__
|
||||
@ -269,7 +273,7 @@ _mips_native(kvm_t *kd)
|
||||
#endif
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_mips_minidump = {
|
||||
static struct kvm_arch kvm_mips_minidump = {
|
||||
.ka_probe = _mips_minidump_probe,
|
||||
.ka_initvtop = _mips_minidump_initvtop,
|
||||
.ka_freevtop = _mips_minidump_freevtop,
|
||||
|
@ -214,7 +214,7 @@ _powerpc_kvatop(kvm_t *kd, kvaddr_t va, off_t *ofs)
|
||||
}
|
||||
|
||||
static int
|
||||
_powerpc_native(kvm_t *kd)
|
||||
_powerpc_native(kvm_t *kd __unused)
|
||||
{
|
||||
|
||||
#if defined(__powerpc__) && !defined(__powerpc64__)
|
||||
@ -224,7 +224,7 @@ _powerpc_native(kvm_t *kd)
|
||||
#endif
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_powerpc = {
|
||||
static struct kvm_arch kvm_powerpc = {
|
||||
.ka_probe = _powerpc_probe,
|
||||
.ka_initvtop = _powerpc_initvtop,
|
||||
.ka_freevtop = _powerpc_freevtop,
|
||||
|
@ -215,7 +215,7 @@ _powerpc64_kvatop(kvm_t *kd, kvaddr_t va, off_t *ofs)
|
||||
}
|
||||
|
||||
static int
|
||||
_powerpc64_native(kvm_t *kd)
|
||||
_powerpc64_native(kvm_t *kd __unused)
|
||||
{
|
||||
|
||||
#ifdef __powerpc64__
|
||||
@ -225,7 +225,7 @@ _powerpc64_native(kvm_t *kd)
|
||||
#endif
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_powerpc64 = {
|
||||
static struct kvm_arch kvm_powerpc64 = {
|
||||
.ka_probe = _powerpc64_probe,
|
||||
.ka_initvtop = _powerpc64_initvtop,
|
||||
.ka_freevtop = _powerpc64_freevtop,
|
||||
|
@ -221,7 +221,7 @@ _sparc64_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
|
||||
}
|
||||
|
||||
static int
|
||||
_sparc64_native(kvm_t *kd)
|
||||
_sparc64_native(kvm_t *kd __unused)
|
||||
{
|
||||
|
||||
#ifdef __sparc64__
|
||||
@ -231,7 +231,7 @@ _sparc64_native(kvm_t *kd)
|
||||
#endif
|
||||
}
|
||||
|
||||
struct kvm_arch kvm_sparc64 = {
|
||||
static struct kvm_arch kvm_sparc64 = {
|
||||
.ka_probe = _sparc64_probe,
|
||||
.ka_initvtop = _sparc64_initvtop,
|
||||
.ka_freevtop = _sparc64_freevtop,
|
||||
|
Loading…
Reference in New Issue
Block a user