xref: /freebsd/sys/arm/include/dump.h (revision bdb9ab0dd925b804280af9ecbdb01ceea66a6088)
1*bdb9ab0dSMark Johnston /*-
2*bdb9ab0dSMark Johnston  * Copyright (c) 2014 EMC Corp.
3*bdb9ab0dSMark Johnston  * Author: Conrad Meyer <conrad.meyer@isilon.com>
4*bdb9ab0dSMark Johnston  * All rights reserved.
5*bdb9ab0dSMark Johnston  *
6*bdb9ab0dSMark Johnston  * Redistribution and use in source and binary forms, with or without
7*bdb9ab0dSMark Johnston  * modification, are permitted provided that the following conditions
8*bdb9ab0dSMark Johnston  * are met:
9*bdb9ab0dSMark Johnston  * 1. Redistributions of source code must retain the above copyright
10*bdb9ab0dSMark Johnston  *    notice, this list of conditions and the following disclaimer.
11*bdb9ab0dSMark Johnston  * 2. Redistributions in binary form must reproduce the above copyright
12*bdb9ab0dSMark Johnston  *    notice, this list of conditions and the following disclaimer in the
13*bdb9ab0dSMark Johnston  *    documentation and/or other materials provided with the distribution.
14*bdb9ab0dSMark Johnston  *
15*bdb9ab0dSMark Johnston  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*bdb9ab0dSMark Johnston  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*bdb9ab0dSMark Johnston  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*bdb9ab0dSMark Johnston  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*bdb9ab0dSMark Johnston  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*bdb9ab0dSMark Johnston  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*bdb9ab0dSMark Johnston  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*bdb9ab0dSMark Johnston  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*bdb9ab0dSMark Johnston  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*bdb9ab0dSMark Johnston  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*bdb9ab0dSMark Johnston  * SUCH DAMAGE.
26*bdb9ab0dSMark Johnston  *
27*bdb9ab0dSMark Johnston  * $FreeBSD$
28*bdb9ab0dSMark Johnston  */
29*bdb9ab0dSMark Johnston 
30*bdb9ab0dSMark Johnston #ifndef _MACHINE_DUMP_H_
31*bdb9ab0dSMark Johnston #define	_MACHINE_DUMP_H_
32*bdb9ab0dSMark Johnston 
33*bdb9ab0dSMark Johnston #define	KERNELDUMP_ARCH_VERSION	KERNELDUMP_ARM_VERSION
34*bdb9ab0dSMark Johnston #define	EM_VALUE		EM_ARM
35*bdb9ab0dSMark Johnston /* XXX: I suppose 20 should be enough. */
36*bdb9ab0dSMark Johnston #define	DUMPSYS_MD_PA_NPAIRS	20
37*bdb9ab0dSMark Johnston #define	DUMPSYS_NUM_AUX_HDRS	1
38*bdb9ab0dSMark Johnston 
39*bdb9ab0dSMark Johnston void dumpsys_wbinv_all(void);
40*bdb9ab0dSMark Johnston int dumpsys_write_aux_headers(struct dumperinfo *di);
41*bdb9ab0dSMark Johnston 
42*bdb9ab0dSMark Johnston static inline void
43*bdb9ab0dSMark Johnston dumpsys_pa_init(void)
44*bdb9ab0dSMark Johnston {
45*bdb9ab0dSMark Johnston 
46*bdb9ab0dSMark Johnston 	dumpsys_gen_pa_init();
47*bdb9ab0dSMark Johnston }
48*bdb9ab0dSMark Johnston 
49*bdb9ab0dSMark Johnston static inline struct dump_pa *
50*bdb9ab0dSMark Johnston dumpsys_pa_next(struct dump_pa *p)
51*bdb9ab0dSMark Johnston {
52*bdb9ab0dSMark Johnston 
53*bdb9ab0dSMark Johnston 	return (dumpsys_gen_pa_next(p));
54*bdb9ab0dSMark Johnston }
55*bdb9ab0dSMark Johnston 
56*bdb9ab0dSMark Johnston static inline void
57*bdb9ab0dSMark Johnston dumpsys_unmap_chunk(vm_paddr_t pa, size_t s, void *va)
58*bdb9ab0dSMark Johnston {
59*bdb9ab0dSMark Johnston 
60*bdb9ab0dSMark Johnston 	dumpsys_gen_unmap_chunk(pa, s, va);
61*bdb9ab0dSMark Johnston }
62*bdb9ab0dSMark Johnston 
63*bdb9ab0dSMark Johnston static inline int
64*bdb9ab0dSMark Johnston dumpsys(struct dumperinfo *di)
65*bdb9ab0dSMark Johnston {
66*bdb9ab0dSMark Johnston 
67*bdb9ab0dSMark Johnston 	return (dumpsys_generic(di));
68*bdb9ab0dSMark Johnston }
69*bdb9ab0dSMark Johnston 
70*bdb9ab0dSMark Johnston #endif  /* !_MACHINE_DUMP_H_ */
71