xref: /openbsd-src/sys/arch/sparc64/include/kcore.h (revision d874cce4b1d9fe6b41c9e4f2117a77d8a4a37b92)
1*d874cce4Sray /*	$OpenBSD: kcore.h,v 1.3 2008/06/26 05:42:13 ray Exp $	*/
2284584b0Sjason /*	$NetBSD: kcore.h,v 1.4 2000/08/01 00:40:26 eeh Exp $	*/
3284584b0Sjason 
4284584b0Sjason /*-
5284584b0Sjason  * Copyright (c) 1996 The NetBSD Foundation, Inc.
6284584b0Sjason  * All rights reserved.
7284584b0Sjason  *
8284584b0Sjason  * This code is derived from software contributed to The NetBSD Foundation
9284584b0Sjason  * by Paul Kranenburg.
10284584b0Sjason  *
11284584b0Sjason  * Redistribution and use in source and binary forms, with or without
12284584b0Sjason  * modification, are permitted provided that the following conditions
13284584b0Sjason  * are met:
14284584b0Sjason  * 1. Redistributions of source code must retain the above copyright
15284584b0Sjason  *    notice, this list of conditions and the following disclaimer.
16284584b0Sjason  * 2. Redistributions in binary form must reproduce the above copyright
17284584b0Sjason  *    notice, this list of conditions and the following disclaimer in the
18284584b0Sjason  *    documentation and/or other materials provided with the distribution.
19284584b0Sjason  *
20284584b0Sjason  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21284584b0Sjason  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22284584b0Sjason  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23284584b0Sjason  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24284584b0Sjason  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25284584b0Sjason  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26284584b0Sjason  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27284584b0Sjason  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28284584b0Sjason  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29284584b0Sjason  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30284584b0Sjason  * POSSIBILITY OF SUCH DAMAGE.
31284584b0Sjason  */
32284584b0Sjason 
33284584b0Sjason /*
34284584b0Sjason  * The layout of a kernel core on the dump device is as follows:
35284584b0Sjason  *	a `struct kcore_seg' of type CORE_CPU
36284584b0Sjason  *	a `struct cpu_kcore_hdr'
37284584b0Sjason  */
38284584b0Sjason 
39284584b0Sjason typedef struct cpu_kcore_hdr {
40284584b0Sjason 	int		cputype;	/* CPU type associated with this dump */
41284584b0Sjason 
42284584b0Sjason 	int		nmemseg;	/* # of physical memory segments */
43284584b0Sjason 	uint64_t	memsegoffset;	/* start of memseg array (relative */
44284584b0Sjason 					/*  to the start of this header) */
45284584b0Sjason 
46284584b0Sjason 	int		nsegmap;	/* # of kernel segs */
47284584b0Sjason 	uint64_t	segmapoffset;	/* start of segmap array (relative */
48284584b0Sjason 					/*  to the start of this header) */
49284584b0Sjason 
50284584b0Sjason 	uint64_t	kernbase;	/* copy of KERNBASE goes here */
51284584b0Sjason 	uint64_t	cpubase;	/* Pointer to cpu_info structure */
52284584b0Sjason 
53284584b0Sjason 	uint64_t	ktextbase;	/* Virtual start of text segment */
54284584b0Sjason 	uint64_t	ktextp;		/* Physical address of 4MB locked TLB */
55284584b0Sjason 	uint64_t	ktextsz;	/* Size of locked kernel text segment. */
56284584b0Sjason 
57284584b0Sjason 	uint64_t	kdatabase;	/* Virtual start of data segment */
58284584b0Sjason 	uint64_t	kdatap;		/* Physical address of 4MB locked TLB */
59284584b0Sjason 	uint64_t	kdatasz;	/* Size of locked kernel data segment. */
60284584b0Sjason 
61284584b0Sjason } cpu_kcore_hdr_t;
62