Home | History | Annotate | Line # | Download | only in include
      1 /* $NetBSD: types.h,v 1.21 2022/11/03 09:04:56 skrll Exp $ */
      2 
      3 /*-
      4  * Copyright (c) 2014 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Matt Thomas of 3am Software Foundry.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  *
     19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  * POSSIBILITY OF SUCH DAMAGE.
     30  */
     31 
     32 #ifndef	_AARCH64_TYPES_H_
     33 #define _AARCH64_TYPES_H_
     34 
     35 #ifdef __aarch64__
     36 
     37 #ifdef _KERNEL_OPT
     38 #include "opt_pmap.h"
     39 #endif
     40 
     41 #include <sys/cdefs.h>
     42 #include <sys/featuretest.h>
     43 #include <arm/int_types.h>
     44 
     45 #if defined(_KERNEL) || defined(_KMEMUSER) || defined(_KERNTYPES) ||	\
     46     defined(_STANDALONE)
     47 typedef	unsigned long	vm_offset_t;	/* deprecated */
     48 typedef	unsigned long	vm_size_t;	/* deprecated */
     49 
     50 typedef unsigned long	paddr_t;
     51 typedef unsigned long	psize_t;
     52 typedef unsigned long	vaddr_t;
     53 typedef unsigned long	vsize_t;
     54 #define PRIxPADDR	"lx"
     55 #define PRIxPSIZE	"lx"
     56 #define PRIuPSIZE	"lu"
     57 #define PRIxVADDR	"lx"
     58 #define PRIxVSIZE	"lx"
     59 #define PRIuVSIZE	"lu"
     60 
     61 typedef __uint64_t register_t;
     62 typedef __uint32_t register32_t;
     63 #define PRIxREGISTER	PRIx64
     64 #define PRIxREGISTER32	PRIx32
     65 
     66 typedef unsigned int	tlb_asid_t;
     67 
     68 #if defined(_KERNEL)
     69 #define LBL_X19	0
     70 #define LBL_X20	1
     71 #define LBL_X21	2
     72 #define LBL_X22	3
     73 #define LBL_X23	4
     74 #define LBL_X24	5
     75 #define LBL_X25	6
     76 #define LBL_X26	7
     77 #define LBL_X27	8
     78 #define LBL_X28	9
     79 #define LBL_X29	10
     80 #define LBL_LR	11
     81 #define LBL_SP	12
     82 #define LBL_MAX	13
     83 typedef struct label_t {	/* Used by setjmp & longjmp */
     84 	register_t lb_reg[LBL_MAX];	/* x19 .. x30, sp */
     85 } label_t;
     86 #endif
     87 
     88 #endif
     89 
     90 /*
     91  * This should have always been an 8-bit type.
     92  */
     93 typedef	unsigned char	__cpu_simple_lock_nv_t;
     94 typedef __uint64_t __register_t;
     95 
     96 #define __SIMPLELOCK_LOCKED	1
     97 #define __SIMPLELOCK_UNLOCKED	0
     98 
     99 #define __HAVE_ATOMIC64_OPS
    100 #define __HAVE_BUS_SPACE_8
    101 #define __HAVE_COMMON___TLS_GET_ADDR
    102 #define __HAVE_CPU_COUNTER
    103 #define __HAVE_CPU_DATA_FIRST
    104 #define __HAVE_FAST_SOFTINTS
    105 #define __HAVE_MINIMAL_EMUL
    106 #define __HAVE_MM_MD_DIRECT_MAPPED_PHYS
    107 #define __HAVE_MM_MD_KERNACC
    108 #define __HAVE_NEW_STYLE_BUS_H
    109 #define __HAVE_OLD_DISKLABEL	/* compatibility */
    110 #define __HAVE_SYSCALL_INTERN
    111 #define __HAVE_TLS_VARIANT_I
    112 #define __HAVE___LWP_GETPRIVATE_FAST
    113 #define __HAVE_UCAS_FULL
    114 
    115 #if defined(_KERNEL) || defined(_KMEMUSER)
    116 #define PCU_FPU			0
    117 #define PCU_UNIT_COUNT		1
    118 #endif
    119 
    120 #if defined(_KERNEL)
    121 #define __HAVE_RAS
    122 #endif
    123 
    124 #if defined(PMAP_MI)
    125 /* XXX temporary */
    126 #define __HAVE_UNLOCKED_PMAP
    127 #endif
    128 
    129 #elif defined(__arm__)
    130 
    131 #include <arm/types.h>
    132 
    133 #endif
    134 
    135 #endif	/* _AARCH64_TYPES_H_ */
    136