xref: /netbsd-src/sys/dev/acpi/apei_interp.h (revision 4f770de5f66563383ee89b6def85e56e2bda7731)
1*4f770de5Sriastradh /*	$NetBSD: apei_interp.h,v 1.2 2024/03/22 20:48:05 riastradh Exp $	*/
24b159fe5Sriastradh 
34b159fe5Sriastradh /*-
44b159fe5Sriastradh  * Copyright (c) 2024 The NetBSD Foundation, Inc.
54b159fe5Sriastradh  * All rights reserved.
64b159fe5Sriastradh  *
74b159fe5Sriastradh  * Redistribution and use in source and binary forms, with or without
84b159fe5Sriastradh  * modification, are permitted provided that the following conditions
94b159fe5Sriastradh  * are met:
104b159fe5Sriastradh  * 1. Redistributions of source code must retain the above copyright
114b159fe5Sriastradh  *    notice, this list of conditions and the following disclaimer.
124b159fe5Sriastradh  * 2. Redistributions in binary form must reproduce the above copyright
134b159fe5Sriastradh  *    notice, this list of conditions and the following disclaimer in the
144b159fe5Sriastradh  *    documentation and/or other materials provided with the distribution.
154b159fe5Sriastradh  *
164b159fe5Sriastradh  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
174b159fe5Sriastradh  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
184b159fe5Sriastradh  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
194b159fe5Sriastradh  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
204b159fe5Sriastradh  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
214b159fe5Sriastradh  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
224b159fe5Sriastradh  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
234b159fe5Sriastradh  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
244b159fe5Sriastradh  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
254b159fe5Sriastradh  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
264b159fe5Sriastradh  * POSSIBILITY OF SUCH DAMAGE.
274b159fe5Sriastradh  */
284b159fe5Sriastradh 
294b159fe5Sriastradh #ifndef	_SYS_DEV_ACPI_APEI_INTERP_H_
304b159fe5Sriastradh #define	_SYS_DEV_ACPI_APEI_INTERP_H_
314b159fe5Sriastradh 
324b159fe5Sriastradh #include <sys/types.h>
334b159fe5Sriastradh 
344b159fe5Sriastradh struct acpi_whea_header;
354b159fe5Sriastradh struct apei_interp;
36*4f770de5Sriastradh struct apei_mapreg;
374b159fe5Sriastradh 
384b159fe5Sriastradh struct apei_interp *apei_interp_create(const char *,
394b159fe5Sriastradh     const char *const *, unsigned,
404b159fe5Sriastradh     const char *const *, unsigned,
41*4f770de5Sriastradh     const bool *,
424b159fe5Sriastradh     bool (*)(struct acpi_whea_header *, uint32_t, uint32_t),
43*4f770de5Sriastradh     void (*)(struct acpi_whea_header *, struct apei_mapreg *, void *,
44*4f770de5Sriastradh 	uint32_t *, uint32_t));
454b159fe5Sriastradh void apei_interp_destroy(struct apei_interp *);
464b159fe5Sriastradh 
474b159fe5Sriastradh void apei_interp_pass1_load(struct apei_interp *, uint32_t,
484b159fe5Sriastradh     struct acpi_whea_header *);
494b159fe5Sriastradh void apei_interp_pass2_verify(struct apei_interp *, uint32_t,
504b159fe5Sriastradh     struct acpi_whea_header *);
514b159fe5Sriastradh void apei_interp_pass3_alloc(struct apei_interp *);
524b159fe5Sriastradh void apei_interp_pass4_assemble(struct apei_interp *, uint32_t,
534b159fe5Sriastradh     struct acpi_whea_header *);
544b159fe5Sriastradh void apei_interp_pass5_verify(struct apei_interp *);
554b159fe5Sriastradh 
564b159fe5Sriastradh void apei_interpret(struct apei_interp *, unsigned, void *);
574b159fe5Sriastradh 
584b159fe5Sriastradh #endif	/* _SYS_DEV_ACPI_APEI_INTERP_H_ */
59