--- /dev/null
+/* $NetBSD: frame.h,v 1.8 2005/12/11 12:16:47 christos Exp $ */\r
+\r
+/*\r
+ * Copyright (c) 1994-1997 Mark Brinicombe.\r
+ * Copyright (c) 1994 Brini.\r
+ * All rights reserved.\r
+ *\r
+ * This code is derived from software written for Brini by Mark Brinicombe\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the distribution.\r
+ * 3. All advertising materials mentioning features or use of this software\r
+ * must display the following acknowledgement:\r
+ * This product includes software developed by Brini.\r
+ * 4. The name of the company nor the name of the author may be used to\r
+ * endorse or promote products derived from this software without specific\r
+ * prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+ * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\r
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ */\r
+/*\r
+ * arm/frame.h - Stack frames structures common to arm26 and arm32\r
+ */\r
+\r
+#ifndef _ARM_FRAME_H_\r
+#define _ARM_FRAME_H_\r
+\r
+#ifndef _LOCORE\r
+\r
+#include <sys/signal.h>\r
+#include <sys/sa.h>\r
+#include <sys/ucontext.h>\r
+\r
+/*\r
+ * Trap frame. Pushed onto the kernel stack on a trap (synchronous exception).\r
+ */\r
+\r
+typedef struct trapframe {\r
+ register_t tf_spsr; /* Zero on arm26 */\r
+ register_t tf_r0;\r
+ register_t tf_r1;\r
+ register_t tf_r2;\r
+ register_t tf_r3;\r
+ register_t tf_r4;\r
+ register_t tf_r5;\r
+ register_t tf_r6;\r
+ register_t tf_r7;\r
+ register_t tf_r8;\r
+ register_t tf_r9;\r
+ register_t tf_r10;\r
+ register_t tf_r11;\r
+ register_t tf_r12;\r
+ register_t tf_usr_sp;\r
+ register_t tf_usr_lr;\r
+ register_t tf_svc_sp; /* Not used on arm26 */\r
+ register_t tf_svc_lr; /* Not used on arm26 */\r
+ register_t tf_pc;\r
+} trapframe_t;\r
+\r
+/* Register numbers */\r
+#define tf_r13 tf_usr_sp\r
+#define tf_r14 tf_usr_lr\r
+#define tf_r15 tf_pc\r
+\r
+/*\r
+ * Signal frame. Pushed onto user stack before calling sigcode.\r
+ */\r
+#ifdef COMPAT_16\r
+struct sigframe_sigcontext {\r
+ struct sigcontext sf_sc;\r
+};\r
+#endif\r
+\r
+/* the pointers are use in the trampoline code to locate the ucontext */\r
+struct sigframe_siginfo {\r
+ siginfo_t sf_si; /* actual saved siginfo */\r
+ ucontext_t sf_uc; /* actual saved ucontext */\r
+};\r
+\r
+/*\r
+ * Scheduler activations upcall frame. Pushed onto user stack before\r
+ * calling an SA upcall.\r
+ */\r
+\r
+struct saframe {\r
+#if 0 /* in registers on entry to upcall */\r
+ int sa_type;\r
+ struct sa_t ** sa_sas;\r
+ int sa_events;\r
+ int sa_interrupted;\r
+#endif\r
+ void * sa_arg;\r
+};\r
+\r
+#ifdef _KERNEL\r
+__BEGIN_DECLS\r
+void sendsig_sigcontext(const ksiginfo_t *, const sigset_t *);\r
+void *getframe(struct lwp *, int, int *);\r
+__END_DECLS\r
+#define process_frame(l) ((l)->l_addr->u_pcb.pcb_tf)\r
+#endif\r
+\r
+#endif /* _LOCORE */\r
+\r
+#endif /* _ARM_FRAME_H_ */\r
+ \r
+/* End of frame.h */\r