Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/sys add compat netbsd32 context.



details:   https://anonhg.NetBSD.org/src/rev/8805c1b24cb4
branches:  trunk
changeset: 584319:8805c1b24cb4
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Sep 13 03:22:54 2005 +0000

description:
add compat netbsd32 context.

diffstat:

 sys/compat/sys/ucontext.h |  75 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 75 insertions(+), 0 deletions(-)

diffs (79 lines):

diff -r 4c366bb1f6b8 -r 8805c1b24cb4 sys/compat/sys/ucontext.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/sys/ucontext.h Tue Sep 13 03:22:54 2005 +0000
@@ -0,0 +1,75 @@
+/*     $NetBSD: ucontext.h,v 1.1 2005/09/13 03:22:54 christos Exp $    */
+
+/*-
+ * Copyright (c) 1999, 2003 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein, and by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _COMPAT_SYS_UCONTEXT_H_
+#define _COMPAT_SYS_UCONTEXT_H_
+
+#if defined(_KERNEL_OPT)
+#include "opt_compat_netbsd32.h"
+#endif
+
+#include <compat/sys/sigtypes.h>
+
+#if defined(COMPAT_NETBSD32) && defined(_KERNEL)
+
+typedef struct __ucontext32       ucontext32_t;
+
+struct __ucontext32 {
+       unsigned int    uc_flags;       /* properties */
+       uint32_t        uc_link;        /* context to resume */
+       sigset_t        uc_sigmask;     /* signals blocked in this context */
+       stack32_t       uc_stack;       /* the stack used by this context */
+       mcontext32_t    uc_mcontext;    /* machine state */
+#if defined(_UC_MACHINE32_PAD)
+       int             __uc_pad[_UC_MACHINE32_PAD];
+#endif
+};
+
+#endif /* COMPAT_NETBSD32 && _KERNEL */
+
+#ifdef _KERNEL
+#ifdef COMPAT_NETBSD32
+struct lwp;
+void   getucontext32(struct lwp *, ucontext32_t *);
+int    setucontext32(struct lwp *, const ucontext32_t *);
+void   cpu_getmcontext32(struct lwp *, mcontext32_t *, unsigned int *);
+int    cpu_setmcontext32(struct lwp *, const mcontext32_t *, unsigned int);
+#endif /* COMPAT_NETBSD32 */
+#endif /* _KERNEL */
+
+#endif /* !_COMPAT_SYS_UCONTEXT_H_ */



Home | Main Index | Thread Index | Old Index