Home | History | Annotate | Line # | Download | only in aarch64
linux_machdep.h revision 1.1
      1  1.1  ryo /*	$NetBSD: linux_machdep.h,v 1.1 2021/09/23 06:56:27 ryo Exp $	*/
      2  1.1  ryo 
      3  1.1  ryo /*-
      4  1.1  ryo  * Copyright (c) 2021 The NetBSD Foundation, Inc.
      5  1.1  ryo  * All rights reserved.
      6  1.1  ryo  *
      7  1.1  ryo  * Redistribution and use in source and binary forms, with or without
      8  1.1  ryo  * modification, are permitted provided that the following conditions
      9  1.1  ryo  * are met:
     10  1.1  ryo  * 1. Redistributions of source code must retain the above copyright
     11  1.1  ryo  *    notice, this list of conditions and the following disclaimer.
     12  1.1  ryo  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  ryo  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  ryo  *    documentation and/or other materials provided with the distribution.
     15  1.1  ryo  *
     16  1.1  ryo  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     17  1.1  ryo  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     18  1.1  ryo  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     19  1.1  ryo  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     20  1.1  ryo  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21  1.1  ryo  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22  1.1  ryo  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     23  1.1  ryo  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     24  1.1  ryo  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     25  1.1  ryo  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     26  1.1  ryo  * POSSIBILITY OF SUCH DAMAGE.
     27  1.1  ryo  */
     28  1.1  ryo 
     29  1.1  ryo #ifndef _AARCH64_LINUX_MACHDEP_H
     30  1.1  ryo #define _AARCH64_LINUX_MACHDEP_H
     31  1.1  ryo 
     32  1.1  ryo #include <aarch64/reg.h>
     33  1.1  ryo #include <compat/linux/common/linux_types.h>
     34  1.1  ryo #include <compat/linux/common/linux_signal.h>
     35  1.1  ryo #include <compat/linux/common/linux_siginfo.h>
     36  1.1  ryo 
     37  1.1  ryo /* from $LINUXSRC/arch/arm64/include/uapi/asm/sigcontext.h */
     38  1.1  ryo struct linux_aarch64_ctx {
     39  1.1  ryo 	uint32_t magic;
     40  1.1  ryo 	uint32_t size;
     41  1.1  ryo };
     42  1.1  ryo 
     43  1.1  ryo #define FPSIMD_MAGIC	0x46508001
     44  1.1  ryo struct fpsimd_context {
     45  1.1  ryo 	struct linux_aarch64_ctx head;
     46  1.1  ryo 	uint32_t fpsr;
     47  1.1  ryo 	uint32_t fpcr;
     48  1.1  ryo 	union fpelem vregs[32];
     49  1.1  ryo };
     50  1.1  ryo 
     51  1.1  ryo /* from $LINUXSRC/arch/arm64/include/uapi/asm/sigcontext.h */
     52  1.1  ryo struct linux_sigcontext {
     53  1.1  ryo 	uint64_t fault_address;
     54  1.1  ryo 	uint64_t regs[31];
     55  1.1  ryo 	uint64_t sp;
     56  1.1  ryo 	uint64_t pc;
     57  1.1  ryo 	uint64_t pstate;
     58  1.1  ryo 	uint8_t __reserved[4096] __attribute__((__aligned__(16)));
     59  1.1  ryo };
     60  1.1  ryo 
     61  1.1  ryo /* from $LINUXSRC/arch/arm64/include/uapi/asm/ucontext.h */
     62  1.1  ryo struct linux_ucontext {
     63  1.1  ryo 	unsigned long luc_flags;
     64  1.1  ryo 	struct linux_ucontext *luc_link;
     65  1.1  ryo 	linux_stack_t luc_stack;
     66  1.1  ryo 	linux_sigset_t luc_sigmask;
     67  1.1  ryo 	uint8_t __reserved[1024 / 8 - sizeof(linux_sigset_t)];
     68  1.1  ryo 	struct linux_sigcontext luc_mcontext;
     69  1.1  ryo };
     70  1.1  ryo 
     71  1.1  ryo /* from $LINUXSRC/arch/arm64/kernel/signal.c */
     72  1.1  ryo struct linux_rt_sigframe {
     73  1.1  ryo 	struct linux_siginfo info;
     74  1.1  ryo 	struct linux_ucontext uc;
     75  1.1  ryo };
     76  1.1  ryo 
     77  1.1  ryo 
     78  1.1  ryo #ifdef _KERNEL
     79  1.1  ryo __BEGIN_DECLS
     80  1.1  ryo void linux_syscall_intern(struct proc *);
     81  1.1  ryo __END_DECLS
     82  1.1  ryo #endif /* !_KERNEL */
     83  1.1  ryo 
     84  1.1  ryo #endif /* !_AARCH64_LINUX_MACHDEP_H */
     85