diff options
author | Leandro Lupori <luporl@FreeBSD.org> | 2020-02-06 13:21:59 +0000 |
---|---|---|
committer | Leandro Lupori <luporl@FreeBSD.org> | 2020-02-06 13:21:59 +0000 |
commit | 38cf2a4334fbc5b90761b1fd0199ac93ea83630f (patch) | |
tree | 5074546fc07397127d184948ea43915e3e91fa55 /lib/libkvm/kvm_minidump_powerpc64.c | |
parent | 210176ad76ee0f1d1ac9ca8d6d63dc5f5fc66427 (diff) | |
download | src-38cf2a4334fbc5b90761b1fd0199ac93ea83630f.tar.gz src-38cf2a4334fbc5b90761b1fd0199ac93ea83630f.zip |
Implement kvm_kerndisp
This change adds a new libkvm function, kvm_kerndisp(), that can be used to
retrieve the kernel displacement, that is the difference between the kernel's
base virtual address at run time and the kernel base virtual address specified
in the kernel image file.
This will be used by kgdb, to properly relocate kernel symbols, when needed.
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D23285
Notes
Notes:
svn path=/head/; revision=357615
Diffstat (limited to 'lib/libkvm/kvm_minidump_powerpc64.c')
-rw-r--r-- | lib/libkvm/kvm_minidump_powerpc64.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libkvm/kvm_minidump_powerpc64.c b/lib/libkvm/kvm_minidump_powerpc64.c index 39c8d03fefa6..6e95b40aab2a 100644 --- a/lib/libkvm/kvm_minidump_powerpc64.c +++ b/lib/libkvm/kvm_minidump_powerpc64.c @@ -184,6 +184,12 @@ _powerpc64_native(kvm_t *kd __unused) #endif } +static kssize_t +_powerpc64_kerndisp(kvm_t *kd) +{ + return (kd->vmst->hdr.startkernel - PPC64_KERNBASE); +} + static int _powerpc64_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) { @@ -197,6 +203,7 @@ static struct kvm_arch kvm_powerpc64_minidump = { .ka_kvatop = _powerpc64_minidump_kvatop, .ka_walk_pages = _powerpc64_minidump_walk_pages, .ka_native = _powerpc64_native, + .ka_kerndisp = _powerpc64_kerndisp, }; KVM_ARCH(kvm_powerpc64_minidump); |