xref: /openbsd-src/lib/libkvm/kvm_powerpc.c (revision 5b133f3f277e80f096764111e64f3a1284acb179)
1*5b133f3fSguenther /*	$OpenBSD: kvm_powerpc.c,v 1.13 2023/03/08 04:43:05 guenther Exp $	*/
2b51bd38dSrahnds 
3b51bd38dSrahnds /*-
4b51bd38dSrahnds  * Copyright (C) 1996 Wolfgang Solfrank.
5b51bd38dSrahnds  * Copyright (C) 1996 TooLs GmbH.
6b51bd38dSrahnds  * All rights reserved.
7b51bd38dSrahnds  *
8b51bd38dSrahnds  * Redistribution and use in source and binary forms, with or without
9b51bd38dSrahnds  * modification, are permitted provided that the following conditions
10b51bd38dSrahnds  * are met:
11b51bd38dSrahnds  * 1. Redistributions of source code must retain the above copyright
12b51bd38dSrahnds  *    notice, this list of conditions and the following disclaimer.
13b51bd38dSrahnds  * 2. Redistributions in binary form must reproduce the above copyright
14b51bd38dSrahnds  *    notice, this list of conditions and the following disclaimer in the
15b51bd38dSrahnds  *    documentation and/or other materials provided with the distribution.
16b51bd38dSrahnds  * 3. All advertising materials mentioning features or use of this software
17b51bd38dSrahnds  *    must display the following acknowledgement:
18b51bd38dSrahnds  *	This product includes software developed by TooLs GmbH.
19b51bd38dSrahnds  * 4. The name of TooLs GmbH may not be used to endorse or promote products
20b51bd38dSrahnds  *    derived from this software without specific prior written permission.
21b51bd38dSrahnds  *
22b51bd38dSrahnds  * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
23b51bd38dSrahnds  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24b51bd38dSrahnds  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25b51bd38dSrahnds  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26b51bd38dSrahnds  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27b51bd38dSrahnds  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28b51bd38dSrahnds  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29b51bd38dSrahnds  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30b51bd38dSrahnds  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31b51bd38dSrahnds  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32b51bd38dSrahnds  */
33b51bd38dSrahnds 
34b51bd38dSrahnds /*
35b51bd38dSrahnds  * PowerPC machine dependent routines for kvm.
36b51bd38dSrahnds  */
37b51bd38dSrahnds 
380e64ee4cSderaadt #include <sys/types.h>
390e64ee4cSderaadt #include <sys/signal.h>
40ec9e25e6Sderaadt #include <sys/proc.h>
41ec9e25e6Sderaadt #include <sys/stat.h>
42ec9e25e6Sderaadt #include <sys/kcore.h>
43ec9e25e6Sderaadt #include <unistd.h>
44ec9e25e6Sderaadt #include <nlist.h>
45ec9e25e6Sderaadt #include <kvm.h>
46ec9e25e6Sderaadt 
47ec9e25e6Sderaadt #include <uvm/uvm_extern.h>
48b51bd38dSrahnds 
49b7e5637aSmiod #include <stdlib.h>
50b51bd38dSrahnds #include <db.h>
51b51bd38dSrahnds #include <limits.h>
52b51bd38dSrahnds 
53b51bd38dSrahnds #include "kvm_private.h"
54b51bd38dSrahnds 
55b51bd38dSrahnds void
_kvm_freevtop(kvm_t * kd)56551fad64Sderaadt _kvm_freevtop(kvm_t *kd)
57b51bd38dSrahnds {
58b51bd38dSrahnds 	free(kd->vmst);
59551fad64Sderaadt 	kd->vmst = NULL;
60551fad64Sderaadt }
61b51bd38dSrahnds 
62b51bd38dSrahnds int
_kvm_initvtop(kvm_t * kd)63551fad64Sderaadt _kvm_initvtop(kvm_t *kd)
64b51bd38dSrahnds {
65551fad64Sderaadt 
66551fad64Sderaadt 	return (0);
67b51bd38dSrahnds }
68b51bd38dSrahnds 
69b51bd38dSrahnds int
_kvm_kvatop(kvm_t * kd,u_long va,paddr_t * pa)70fdd3f45bSmickey _kvm_kvatop(kvm_t *kd, u_long va, paddr_t *pa)
71b51bd38dSrahnds {
72b51bd38dSrahnds 	_kvm_err(kd, 0, "vatop not yet implemented!");
73551fad64Sderaadt 	return (0);
74b51bd38dSrahnds }
75b51bd38dSrahnds 
76b51bd38dSrahnds off_t
_kvm_pa2off(kvm_t * kd,paddr_t pa)77fdd3f45bSmickey _kvm_pa2off(kvm_t *kd, paddr_t pa)
78b51bd38dSrahnds {
79b51bd38dSrahnds 	_kvm_err(kd, 0, "pa2off not yet implemented!");
80551fad64Sderaadt 	return (0);
81b51bd38dSrahnds }
82