1*ce099b40Smartin /* $NetBSD: kcore.h,v 1.4 2008/04/28 20:23:36 martin Exp $ */ 20217df38Spk 30217df38Spk /*- 40217df38Spk * Copyright (c) 1996 The NetBSD Foundation, Inc. 50217df38Spk * All rights reserved. 60217df38Spk * 70217df38Spk * This code is derived from software contributed to The NetBSD Foundation 80217df38Spk * by Paul Kranenburg. 90217df38Spk * 100217df38Spk * Redistribution and use in source and binary forms, with or without 110217df38Spk * modification, are permitted provided that the following conditions 120217df38Spk * are met: 130217df38Spk * 1. Redistributions of source code must retain the above copyright 140217df38Spk * notice, this list of conditions and the following disclaimer. 150217df38Spk * 2. Redistributions in binary form must reproduce the above copyright 160217df38Spk * notice, this list of conditions and the following disclaimer in the 170217df38Spk * documentation and/or other materials provided with the distribution. 180217df38Spk * 190217df38Spk * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 200217df38Spk * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 210217df38Spk * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22da7890c5Sjtc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23da7890c5Sjtc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 240217df38Spk * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 250217df38Spk * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 260217df38Spk * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 270217df38Spk * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 280217df38Spk * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 290217df38Spk * POSSIBILITY OF SUCH DAMAGE. 300217df38Spk */ 310217df38Spk 320217df38Spk /* 330217df38Spk * The layout of a kernel core on the dump device is as follows: 340217df38Spk * a `struct kcore_seg' of type CORE_CPU 350217df38Spk * a `struct cpu_kcore_hdr' 360217df38Spk * an array of `cpu_kcore_hdr.nmemseg' phys_ram_seg_t's 379b3d64edSpk * an array of `cpu_kcore_hdr.nsegmap' segmap structures 380217df38Spk * an array of `cpu_kcore_hdr.npmegs' PTEs (zero of these on sun4ms). 390217df38Spk */ 400217df38Spk 410217df38Spk typedef struct cpu_kcore_hdr { 420217df38Spk int cputype; /* CPU type associated with this dump */ 439b3d64edSpk u_long kernbase; /* copy of KERNBASE goes here */ 440217df38Spk int nmemseg; /* # of physical memory segments */ 459b3d64edSpk u_long memsegoffset; /* start of memseg array (relative */ 469b3d64edSpk /* to the start of this header) */ 479b3d64edSpk int nsegmap; /* # of segmaps following */ 489b3d64edSpk u_long segmapoffset; /* start of segmap array (relative */ 490217df38Spk /* to the start of this header) */ 500217df38Spk int npmeg; /* # of PMEGs; [sun4/sun4c] only */ 519b3d64edSpk u_long pmegoffset; /* start of pmeg array (relative */ 520217df38Spk /* to the start of this header) */ 530217df38Spk } cpu_kcore_hdr_t; 54