xref: /openbsd/lib/libkvm/kvm_powerpc64.c (revision d415bd75)
1 /*	$OpenBSD: kvm_powerpc64.c,v 1.3 2021/12/01 21:45:19 deraadt Exp $	*/
2 
3 /*
4  * Copyright (c) 2007 Miodrag Vallat.
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice, this permission notice, and the disclaimer below
9  * appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #include <sys/types.h>
21 #include <sys/kcore.h>
22 
23 #include <unistd.h>
24 #include <stdlib.h>
25 #include <nlist.h>
26 #include <kvm.h>
27 
28 #include <db.h>
29 
30 #include "kvm_private.h"
31 
32 #include <machine/cpu.h>
33 #include <machine/kcore.h>
34 #include <machine/pte.h>
35 #include <machine/vmparam.h>
36 
37 void
38 _kvm_freevtop(kvm_t *kd)
39 {
40 }
41 
42 int
43 _kvm_initvtop(kvm_t *kd)
44 {
45 	return (0);
46 }
47 
48 /*
49  * Translate a kernel virtual address to a physical address by walking
50  * the kernel page tables.
51  */
52 int
53 _kvm_kvatop(kvm_t *kd, u_long va, paddr_t *pa)
54 {
55 	if (ISALIVE(kd)) {
56 		_kvm_err(kd, 0, "vatop called in live kernel!");
57 		return (0);
58 	}
59 
60 	_kvm_err(kd, 0, "%s not yet implemented", __func__);
61 	*pa = (paddr_t)-1;
62 	return (0);
63 }
64 
65 /*
66  * Translate a physical address to a file offset in the crash dump.
67  */
68 off_t
69 _kvm_pa2off(kvm_t *kd, paddr_t pa)
70 {
71 	_kvm_err(kd, 0, "%s not yet implemented", __func__);
72 	return (0);
73 }
74