11.2Sriastrad/*	$NetBSD: execregs.h,v 1.2 2025/02/28 16:08:19 riastradh Exp $	*/
21.1Sriastrad
31.1Sriastrad/*-
41.1Sriastrad * Copyright (c) 2025 The NetBSD Foundation, Inc.
51.1Sriastrad * All rights reserved.
61.1Sriastrad *
71.1Sriastrad * Redistribution and use in source and binary forms, with or without
81.1Sriastrad * modification, are permitted provided that the following conditions
91.1Sriastrad * are met:
101.1Sriastrad * 1. Redistributions of source code must retain the above copyright
111.1Sriastrad *    notice, this list of conditions and the following disclaimer.
121.1Sriastrad * 2. Redistributions in binary form must reproduce the above copyright
131.1Sriastrad *    notice, this list of conditions and the following disclaimer in the
141.1Sriastrad *    documentation and/or other materials provided with the distribution.
151.1Sriastrad *
161.1Sriastrad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
171.1Sriastrad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
181.1Sriastrad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
191.1Sriastrad * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
201.1Sriastrad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
211.1Sriastrad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
221.1Sriastrad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
231.1Sriastrad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
241.1Sriastrad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
251.1Sriastrad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
261.1Sriastrad * POSSIBILITY OF SUCH DAMAGE.
271.1Sriastrad */
281.1Sriastrad
291.1Sriastrad#ifndef	TESTS_KERNEL_ARCH_HPPA_EXECREGS_H
301.1Sriastrad#define	TESTS_KERNEL_ARCH_HPPA_EXECREGS_H
311.1Sriastrad
321.1Sriastrad#include <sys/cdefs.h>
331.1Sriastrad
341.2Sriastrad#define	NEXECREGS	96
351.1Sriastrad
361.1Sriastrad#ifndef _LOCORE
371.1Sriastrad
381.1Sriastrad#include <unistd.h>
391.1Sriastrad
401.1Sriastrad/*
411.1Sriastrad * Ordered by struct struct trapframe in sys/arch/hppa/include/frame.h
421.1Sriastrad * for convenience of auditing.  Must match h_execregs.S.
431.1Sriastrad */
441.1Sriastradstatic const char *const regname[] = {
451.1Sriastrad	"t1",
461.1Sriastrad	"t2",
471.1Sriastrad	/* sp: stack pointer */
481.1Sriastrad	"t3",
491.1Sriastrad	/* various privileged stuff */
501.1Sriastrad	"sar",
511.1Sriastrad	"r1",
521.1Sriastrad	"rp",
531.1Sriastrad	/* r3: frame pointer (set to initial stack pointer) */
541.1Sriastrad	"r4",
551.1Sriastrad	"r5",
561.1Sriastrad	"r6",
571.1Sriastrad	"r70",
581.1Sriastrad	"r8",
591.1Sriastrad	"r9",
601.1Sriastrad	"r10",
611.1Sriastrad	"r11",
621.1Sriastrad	"r12",
631.1Sriastrad	"r13",
641.1Sriastrad	"r14",
651.1Sriastrad	"r15",
661.1Sriastrad	"r16",
671.1Sriastrad	"r17",
681.1Sriastrad	"r18",
691.1Sriastrad	"t4",
701.1Sriastrad	"arg3",
711.1Sriastrad	"arg2",
721.1Sriastrad	"arg1",
731.1Sriastrad	/* arg0: ps_strings */
741.1Sriastrad	"dp",
751.1Sriastrad	"ret0",
761.1Sriastrad	"ret1",
771.1Sriastrad	"r31",
781.1Sriastrad	"cr27",
791.1Sriastrad	"cr28",
801.2Sriastrad
811.2Sriastrad	"psw",	/* user-visible PSW bits: C/B and V */
821.2Sriastrad
831.2Sriastrad	/* Floating-point registers */
841.2Sriastrad	"fr0l",
851.2Sriastrad	"fr0r",
861.2Sriastrad	"fr1l",
871.2Sriastrad	"fr1r",
881.2Sriastrad	"fr2l",
891.2Sriastrad	"fr2r",
901.2Sriastrad	"fr3l",
911.2Sriastrad	"fr3r",
921.2Sriastrad	"fr4l",
931.2Sriastrad	"fr4r",
941.2Sriastrad	"fr5l",
951.2Sriastrad	"fr5r",
961.2Sriastrad	"fr6l",
971.2Sriastrad	"fr6r",
981.2Sriastrad	"fr7l",
991.2Sriastrad	"fr7r",
1001.2Sriastrad	"fr8l",
1011.2Sriastrad	"fr8r",
1021.2Sriastrad	"fr9l",
1031.2Sriastrad	"fr9r",
1041.2Sriastrad	"fr10l",
1051.2Sriastrad	"fr10r",
1061.2Sriastrad	"fr11l",
1071.2Sriastrad	"fr11r",
1081.2Sriastrad	"fr12l",
1091.2Sriastrad	"fr12r",
1101.2Sriastrad	"fr13l",
1111.2Sriastrad	"fr13r",
1121.2Sriastrad	"fr14l",
1131.2Sriastrad	"fr14r",
1141.2Sriastrad	"fr15l",
1151.2Sriastrad	"fr15r",
1161.2Sriastrad	"fr16l",
1171.2Sriastrad	"fr16r",
1181.2Sriastrad	"fr17l",
1191.2Sriastrad	"fr17r",
1201.2Sriastrad	"fr18l",
1211.2Sriastrad	"fr18r",
1221.2Sriastrad	"fr19l",
1231.2Sriastrad	"fr19r",
1241.2Sriastrad	"fr20l",
1251.2Sriastrad	"fr20r",
1261.2Sriastrad	"fr21l",
1271.2Sriastrad	"fr21r",
1281.2Sriastrad	"fr22l",
1291.2Sriastrad	"fr22r",
1301.2Sriastrad	"fr23l",
1311.2Sriastrad	"fr23r",
1321.2Sriastrad	"fr24l",
1331.2Sriastrad	"fr24r",
1341.2Sriastrad	"fr25l",
1351.2Sriastrad	"fr25r",
1361.2Sriastrad	"fr26l",
1371.2Sriastrad	"fr26r",
1381.2Sriastrad	"fr27l",
1391.2Sriastrad	"fr27r",
1401.2Sriastrad	"fr28l",
1411.2Sriastrad	"fr28r",
1421.2Sriastrad	"fr29l",
1431.2Sriastrad	"fr29r",
1441.2Sriastrad	"fr30l",
1451.2Sriastrad	"fr30r",
1461.2Sriastrad	"fr31l",
1471.2Sriastrad	"fr31r",
1481.1Sriastrad};
1491.1Sriastrad
1501.1Sriastrad__CTASSERT(NEXECREGS == __arraycount(regname));
1511.1Sriastrad
1521.1Sriastradint	execregschild(char *);
1531.1Sriastradpid_t	spawnregschild(char *, int);
1541.1Sriastrad
1551.1Sriastrad#endif	/* _LOCORE */
1561.1Sriastrad
1571.1Sriastrad#endif	/* TESTS_KERNEL_ARCH_HPPA_EXECREGS_H */
158