Skip to content

Instantly share code, notes, and snippets.

@arichardson
Created November 23, 2016 14:23
Show Gist options
  • Save arichardson/9f6918a173492dfcdc389015101519fb to your computer and use it in GitHub Desktop.
Save arichardson/9f6918a173492dfcdc389015101519fb to your computer and use it in GitHub Desktop.
# 1 "<built-in>"
# 1 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
/*-
* Copyright (c) 2012-2016 Robert N. M. Watson
* Copyright (c) 2014 SRI International
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*/
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 1 3 4
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Berkeley Software Design, Inc.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)cdefs.h 8.8 (Berkeley) 1/9/95
* $FreeBSD$
*/
#ifndef _SYS_CDEFS_H_
#define _SYS_CDEFS_H_
/*
* Testing against Clang-specific extensions.
*/
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
# 45 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __has_extension
#define __has_extension __has_feature
#endif
# 48 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __has_feature
#define __has_feature(x) 0
#endif
# 51 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __has_include
#define __has_include(x) 0
#endif
# 54 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
# 57 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__cplusplus)
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
#else
# 62 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __BEGIN_DECLS
#define __END_DECLS
#endif
# 65 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* This code has been put in place to help reduce the addition of
* compiler specific defines in FreeBSD code. It helps to aid in
* having a compiler-agnostic source tree.
*/
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#if __GNUC__ >= 3 || defined(__INTEL_COMPILER)
#define __GNUCLIKE_ASM 3
#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS
#else
# 78 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE_ASM 2
#endif
# 80 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE___TYPEOF 1
#define __GNUCLIKE___OFFSETOF 1
#define __GNUCLIKE___SECTION 1
#ifndef __INTEL_COMPILER
#define __GNUCLIKE_CTOR_SECTION_HANDLING 1
#endif
# 87 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE_BUILTIN_CONSTANT_P 1
#if defined(__INTEL_COMPILER) && defined(__cplusplus) && \
__INTEL_COMPILER < 800
#undef __GNUCLIKE_BUILTIN_CONSTANT_P
#endif
# 93 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3)
#define __GNUCLIKE_BUILTIN_VARARGS 1
#define __GNUCLIKE_BUILTIN_STDARG 1
#define __GNUCLIKE_BUILTIN_VAALIST 1
#endif
# 99 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__GNUC__)
#define __GNUC_VA_LIST_COMPATIBILITY 1
#endif
# 103 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Compiler memory barriers, specific to gcc and clang.
*/
#if defined(__GNUC__)
#define __compiler_membar() __asm __volatile(" " : : : "memory")
#endif
# 110 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __INTEL_COMPILER
#define __GNUCLIKE_BUILTIN_NEXT_ARG 1
#define __GNUCLIKE_MATH_BUILTIN_RELOPS
#endif
# 115 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE_BUILTIN_MEMCPY 1
/* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */
#define __CC_SUPPORTS_INLINE 1
#define __CC_SUPPORTS___INLINE 1
#define __CC_SUPPORTS___INLINE__ 1
#define __CC_SUPPORTS___FUNC__ 1
#define __CC_SUPPORTS_WARNING 1
#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */
#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1
#endif /* __GNUC__ || __INTEL_COMPILER */
# 131 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Macro to test if we're using a specific version of gcc or later.
*/
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define __GNUC_PREREQ__(ma, mi) \
(__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))
#else
# 139 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GNUC_PREREQ__(ma, mi) 0
#endif
# 141 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
* with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
* The __CONCAT macro is a bit tricky to use if it must work in non-ANSI
* mode -- there must be no spaces between its arguments, and for nested
* __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also
* concatenate double-quoted strings produced by the __STRING macro, but
* this only works with ANSI C.
*
* __XSTRING is like __STRING, but it expands any macros in its argument
* first. It is only available with ANSI C.
*/
#if defined(__STDC__) || defined(__cplusplus)
#define __P(protos) protos /* full-blown ANSI C */
#define __CONCAT1(x,y) x ## y
#define __CONCAT(x,y) __CONCAT1(x,y)
#define __STRING(x) #x /* stringify without expanding x */
#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
#define __const const /* define reserved names to standard */
#define __signed signed
#define __volatile volatile
#if defined(__cplusplus)
#define __inline inline /* convert to C++ keyword */
#else
# 167 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if !(defined(__CC_SUPPORTS___INLINE))
#define __inline /* delete GCC keyword */
#endif /* ! __CC_SUPPORTS___INLINE */
# 170 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* !__cplusplus */
# 171 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#else /* !(__STDC__ || __cplusplus) */
# 173 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __P(protos) () /* traditional C preprocessor */
#define __CONCAT(x,y) x/**/y
#define __STRING(x) "x"
#if !defined(__CC_SUPPORTS___INLINE)
#define __const /* delete pseudo-ANSI C keywords */
#define __inline
#define __signed
#define __volatile
/*
* In non-ANSI C environments, new programs will want ANSI-only C keywords
* deleted from the program and old programs will want them left alone.
* When using a compiler other than gcc, programs using the ANSI C keywords
* const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
* When using "gcc -traditional", we assume that this is the intent; if
* __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
*/
#ifndef NO_ANSI_KEYWORDS
#define const /* delete ANSI C keywords */
#define inline
#define signed
#define volatile
#endif /* !NO_ANSI_KEYWORDS */
# 196 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* !__CC_SUPPORTS___INLINE */
# 197 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* !(__STDC__ || __cplusplus) */
# 198 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Compiler-dependent macros to help declare dead (non-returning) and
* pure (no side effects) functions, and unused variables. They are
* null except for versions of gcc that are known to support the features
* properly (old versions of gcc-2 supported the dead and pure features
* in a different (wrong) way). If we do not provide an implementation
* for a given compiler, let the compile fail if it is told to use
* a feature that we cannot live without.
*/
#ifdef lint
#define __dead2
#define __pure2
#define __unused
#define __packed
#define __aligned(x)
#define __alloc_align(x)
#define __alloc_size(x)
#define __section(x)
#define __weak_symbol
#else
# 219 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __weak_symbol __attribute__((__weak__))
#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER)
#define __dead2
#define __pure2
#define __unused
#endif
# 225 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER)
#define __dead2 __attribute__((__noreturn__))
#define __pure2 __attribute__((__const__))
#define __unused
/* XXX Find out what to do for __packed, __aligned and __section */
#endif
# 231 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(2, 7) || defined(__INTEL_COMPILER)
#define __dead2 __attribute__((__noreturn__))
#define __pure2 __attribute__((__const__))
#define __unused __attribute__((__unused__))
#define __used __attribute__((__used__))
#define __packed __attribute__((__packed__))
#define __aligned(x) __attribute__((__aligned__(x)))
#define __section(x) __attribute__((__section__(x)))
#endif
# 240 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__)
#define __alloc_size(x) __attribute__((__alloc_size__(x)))
#else
# 243 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __alloc_size(x)
#endif
# 245 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__)
#define __alloc_align(x) __attribute__((__alloc_align__(x)))
#else
# 248 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __alloc_align(x)
#endif
# 250 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* lint */
# 251 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if !__GNUC_PREREQ__(2, 95)
#define __alignof(x) __offsetof(struct { char __a; x __b; }, __b)
#endif
# 255 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Keywords added in C11.
*/
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || defined(lint)
#if !__has_extension(c_alignas)
#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
__has_extension(cxx_alignas)
#define _Alignas(x) alignas(x)
#else
# 267 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* XXX: Only emulates _Alignas(constant-expression); not _Alignas(type-name). */
#define _Alignas(x) __aligned(x)
#endif
# 270 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 271 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__cplusplus) && __cplusplus >= 201103L
#define _Alignof(x) alignof(x)
#else
# 275 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define _Alignof(x) __alignof(x)
#endif
# 277 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if !defined(__cplusplus) && !__has_extension(c_atomic) && \
!__has_extension(cxx_atomic)
/*
* No native support for _Atomic(). Place object in structure to prevent
* most forms of direct non-atomic access.
*/
#define _Atomic(T) struct { T volatile __val; }
#endif
# 286 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__cplusplus) && __cplusplus >= 201103L
#define _Noreturn [[noreturn]]
#else
# 290 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define _Noreturn __dead2
#endif
# 292 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if !__has_extension(c_static_assert)
#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
__has_extension(cxx_static_assert)
#define _Static_assert(x, y) static_assert(x, y)
#elif __GNUC_PREREQ__(4,6)
# 298 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* Nothing, gcc 4.6 and higher has _Static_assert built-in */
#elif defined(__COUNTER__)
# 300 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define _Static_assert(x, y) __Static_assert(x, __COUNTER__)
#define __Static_assert(x, y) ___Static_assert(x, y)
#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1] \
__unused
#else
# 305 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define _Static_assert(x, y) struct __hack
#endif
# 307 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 308 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if !__has_extension(c_thread_local)
/*
* XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode
* without actually supporting the thread_local keyword. Don't check for
* the presence of C++11 when defining _Thread_local.
*/
#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \
__has_extension(cxx_thread_local)
#define _Thread_local thread_local
#else
# 319 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define _Thread_local __thread
#endif
# 321 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 322 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */
# 324 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Emulation of C11 _Generic(). Unlike the previously defined C11
* keywords, it is not possible to implement this using exactly the same
* syntax. Therefore implement something similar under the name
* __generic(). Unlike _Generic(), this macro can only distinguish
* between a single type, so it requires nested invocations to
* distinguish multiple cases.
*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
__has_extension(c_generic_selections)
#define __generic(expr, t, yes, no) \
_Generic(expr, t: yes, default: no)
#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
# 339 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __generic(expr, t, yes, no) \
__builtin_choose_expr( \
__builtin_types_compatible_p(__typeof(expr), t), yes, no)
#endif
# 343 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* C99 Static array indices in function parameter declarations. Syntax such as:
* void bar(int myArray[static 10]);
* is allowed in C99 but not in C++. Define __min_size appropriately so
* headers using it can be compiled in either language. Use like this:
* void bar(int myArray[__min_size(10)]);
*/
#if !defined(__cplusplus) && \
(!defined(__STDC_VERSION) || (__STDC_VERSION__ >= 199901))
#define __min_size(x) static (x)
#else
# 355 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __min_size(x) (x)
#endif
# 357 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(2, 96)
#define __malloc_like __attribute__((__malloc__))
#define __pure __attribute__((__pure__))
#else
# 362 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __malloc_like
#define __pure
#endif
# 365 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
#define __always_inline __attribute__((__always_inline__))
#else
# 369 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __always_inline
#endif
# 371 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(3, 1)
#define __noinline __attribute__ ((__noinline__))
#else
# 375 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __noinline
#endif
# 377 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(3, 3)
#define __nonnull(x) __attribute__((__nonnull__(x)))
#define __nonnull_all __attribute__((__nonnull__))
#else
# 382 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __nonnull(x)
#define __nonnull_all
#endif
# 385 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(3, 4)
#define __fastcall __attribute__((__fastcall__))
#define __result_use_check __attribute__((__warn_unused_result__))
#else
# 390 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __fastcall
#define __result_use_check
#endif
# 393 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(4, 1)
#define __returns_twice __attribute__((__returns_twice__))
#else
# 397 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __returns_twice
#endif
# 399 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable)
#define __unreachable() __builtin_unreachable()
#else
# 403 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __unreachable() ((void)0)
#endif
# 405 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* XXX: should use `#if __STDC_VERSION__ < 199901'. */
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
#define __func__ NULL
#endif
# 410 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
#define __LONG_LONG_SUPPORTED
#endif
# 414 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* C++11 exposes a load of C99 stuff */
#if defined(__cplusplus) && __cplusplus >= 201103L
#define __LONG_LONG_SUPPORTED
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
# 421 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
# 424 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 425 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* GCC 2.95 provides `__restrict' as an extension to C90 to support the
* C99-specific `restrict' type qualifier. We happen to use `__restrict' as
* a way to define the `restrict' type qualifier without disturbing older
* software that is unaware of C99 keywords.
*/
#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95)
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint)
#define __restrict
#else
# 436 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __restrict restrict
#endif
# 438 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 439 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* GNU C version 2.96 adds explicit branch prediction so that
* the CPU back-end can hint the processor and also so that
* code blocks can be reordered such that the predicted path
* sees a more linear flow, thus improving cache behavior, etc.
*
* The following two macros provide us with a way to utilize this
* compiler feature. Use __predict_true() if you expect the expression
* to evaluate to true, and __predict_false() if you expect the
* expression to evaluate to false.
*
* A few notes about usage:
*
* * Generally, __predict_false() error condition checks (unless
* you have some _strong_ reason to do otherwise, in which case
* document it), and/or __predict_true() `no-error' condition
* checks, assuming you want to optimize for the no-error case.
*
* * Other than that, if you don't know the likelihood of a test
* succeeding from empirical or other `hard' evidence, don't
* make predictions.
*
* * These are meant to be used in places that are run `a lot'.
* It is wasteful to make predictions in code that is run
* seldomly (e.g. at subsystem initialization time) as the
* basic block reordering that this affects can often generate
* larger code.
*/
#if __GNUC_PREREQ__(2, 96)
#define __predict_true(exp) __builtin_expect((exp), 1)
#define __predict_false(exp) __builtin_expect((exp), 0)
#else
# 472 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __predict_true(exp) (exp)
#define __predict_false(exp) (exp)
#endif
# 475 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(4, 0)
#define __null_sentinel __attribute__((__sentinel__))
#define __exported __attribute__((__visibility__("default")))
#define __hidden __attribute__((__visibility__("hidden")))
#else
# 481 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __null_sentinel
#define __exported
#define __hidden
#endif
# 485 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
* require it.
*/
#if __GNUC_PREREQ__(4, 1)
#define __offsetof(type, field) __builtin_offsetof(type, field)
#else
# 493 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __cplusplus
#define __offsetof(type, field) \
((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field))
#else
# 497 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __offsetof(type, field) \
(__offsetof__ (reinterpret_cast <__size_t> \
(&reinterpret_cast <const volatile char &> \
(static_cast<type *> (0)->field))))
#endif
# 502 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 503 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __rangeof(type, start, end) \
(__offsetof(type, end) - __offsetof(type, start))
/*
* Given the pointer x to the member m of the struct s, return
* a pointer to the containing structure. When using GCC, we first
* assign pointer x to a local variable, to check that its type is
* compatible with member m.
*/
#if __GNUC_PREREQ__(3, 1)
#define __containerof(x, s, m) ({ \
const volatile __typeof(((s *)0)->m) *__x = (x); \
__DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\
})
#else
# 518 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __containerof(x, s, m) \
__DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m))
#endif
# 521 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Compiler-dependent macros to declare that functions take printf-like
* or scanf-like arguments. They are null except for versions of gcc
* that are known to support the features properly (old versions of gcc-2
* didn't permit keeping the keywords out of the application namespace).
*/
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
#define __printflike(fmtarg, firstvararg)
#define __scanflike(fmtarg, firstvararg)
#define __format_arg(fmtarg)
#define __strfmonlike(fmtarg, firstvararg)
#define __strftimelike(fmtarg, firstvararg)
#else
# 535 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#define __scanflike(fmtarg, firstvararg) \
__attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg)))
#define __strfmonlike(fmtarg, firstvararg) \
__attribute__((__format__ (__strfmon__, fmtarg, firstvararg)))
#define __strftimelike(fmtarg, firstvararg) \
__attribute__((__format__ (__strftime__, fmtarg, firstvararg)))
#endif
# 545 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* FORTIFY_SOURCE, and perhaps other compiler-specific features, require
* the use of non-standard inlining. In general we should try to avoid
* using these but GCC-compatible compilers tend to support the extensions
* well enough to use them in limited cases.
*/
#if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__)
#define __gnu_inline __attribute__((__gnu_inline__, __artificial__))
#else
# 556 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __gnu_inline __attribute__((__gnu_inline__))
#endif /* artificial */
# 558 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#else
# 559 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __gnu_inline
#endif
# 561 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \
defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define __printf0like(fmtarg, firstvararg) \
__attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
#else
# 568 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __printf0like(fmtarg, firstvararg)
#endif
# 570 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#ifndef __INTEL_COMPILER
#define __strong_reference(sym,aliassym) \
extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
#endif
# 576 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifdef __STDC__
#define __weak_reference(sym,alias) \
__asm__(".weak " #alias); \
__asm__(".equ " #alias ", " #sym)
#define __warn_references(sym,msg) \
__asm__(".section .gnu.warning." #sym); \
__asm__(".asciz \"" msg "\""); \
__asm__(".previous")
#define __sym_compat(sym,impl,verid) \
__asm__(".symver " #impl ", " #sym "@" #verid)
#define __sym_default(sym,impl,verid) \
__asm__(".symver " #impl ", " #sym "@@" #verid)
#else
# 589 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __weak_reference(sym,alias) \
__asm__(".weak alias"); \
__asm__(".equ alias, sym")
#define __warn_references(sym,msg) \
__asm__(".section .gnu.warning.sym"); \
__asm__(".asciz \"msg\""); \
__asm__(".previous")
#define __sym_compat(sym,impl,verid) \
__asm__(".symver impl, sym@verid")
#define __sym_default(impl,sym,verid) \
__asm__(".symver impl, sym@@verid")
#endif /* __STDC__ */
# 601 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* __GNUC__ || __INTEL_COMPILER */
# 602 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GLOBL1(sym) __asm__(".globl " #sym)
#define __GLOBL(sym) __GLOBL1(sym)
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
#else
# 609 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* The following definition might not work well if used in header files,
* but it should be better than nothing. If you want a "do nothing"
* version, then it should generate some harmless declaration, such as:
* #define __IDSTRING(name,string) struct __hack
*/
#define __IDSTRING(name,string) static const char name[] __unused = string
#endif
# 617 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Embed the rcs id of a source file in the resulting library. Note that in
* more recent ELF binutils, we use .ident allowing the ID to be stripped.
* Usage:
* __FBSDID("$FreeBSD$");
*/
#ifndef __FBSDID
#if !defined(lint) && !defined(STRIP_FBSDID)
#define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
#else
# 628 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __FBSDID(s) struct __hack
#endif
# 630 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 631 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __RCSID
#ifndef NO__RCSID
#define __RCSID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
#else
# 636 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __RCSID(s) struct __hack
#endif
# 638 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 639 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __RCSID_SOURCE
#ifndef NO__RCSID_SOURCE
#define __RCSID_SOURCE(s) __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s)
#else
# 644 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __RCSID_SOURCE(s) struct __hack
#endif
# 646 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 647 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __SCCSID
#ifndef NO__SCCSID
#define __SCCSID(s) __IDSTRING(__CONCAT(__sccsid_,__LINE__),s)
#else
# 652 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __SCCSID(s) struct __hack
#endif
# 654 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 655 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __COPYRIGHT
#ifndef NO__COPYRIGHT
#define __COPYRIGHT(s) __IDSTRING(__CONCAT(__copyright_,__LINE__),s)
#else
# 660 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __COPYRIGHT(s) struct __hack
#endif
# 662 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 663 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __DECONST
#if !__has_feature(capabilities)
#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var))
#else
# 668 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __DECONST(type, var) ((type)(__intcap_t)(__capability const void *)(var))
#endif
# 670 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 671 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __DEVOLATILE
#if !__has_feature(capabilities)
#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var))
#else
# 676 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __DEVOLATILE(type, var) ((type)(__intcap_t)(__capability volatile void *)(var))
#endif
# 678 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 679 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __DEQUALIFY
#if !__has_feature(capabilities)
#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var))
#else
# 684 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __DEQUALIFY(type, var) ((type)(__intcap_t)(__capability const volatile void *)(var))
#endif
# 686 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 687 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*-
* The following definitions are an extension of the behavior originally
* implemented in <sys/_posix.h>, but with a different level of granularity.
* POSIX.1 requires that the macros we test be defined before any standard
* header file is included.
*
* Here's a quick run-down of the versions:
* defined(_POSIX_SOURCE) 1003.1-1988
* _POSIX_C_SOURCE == 1 1003.1-1990
* _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option
* _POSIX_C_SOURCE == 199309 1003.1b-1993
* _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995,
* and the omnibus ISO/IEC 9945-1: 1996
* _POSIX_C_SOURCE == 200112 1003.1-2001
* _POSIX_C_SOURCE == 200809 1003.1-2008
*
* In addition, the X/Open Portability Guide, which is now the Single UNIX
* Specification, defines a feature-test macro which indicates the version of
* that specification, and which subsumes _POSIX_C_SOURCE.
*
* Our macros begin with two underscores to avoid namespace screwage.
*/
/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */
#define _POSIX_C_SOURCE 199009
#endif
# 716 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199209
#endif
# 722 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
#ifdef _XOPEN_SOURCE
#if _XOPEN_SOURCE - 0 >= 700
#define __XSI_VISIBLE 700
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809
#elif _XOPEN_SOURCE - 0 >= 600
# 730 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __XSI_VISIBLE 600
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112
#elif _XOPEN_SOURCE - 0 >= 500
# 734 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __XSI_VISIBLE 500
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199506
#endif
# 738 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 739 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Deal with all versions of POSIX. The ordering relative to the tests above is
* important.
*/
#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 198808
#endif
# 747 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifdef _POSIX_C_SOURCE
#if _POSIX_C_SOURCE >= 200809
#define __POSIX_VISIBLE 200809
#define __ISO_C_VISIBLE 1999
#elif _POSIX_C_SOURCE >= 200112
# 752 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 200112
#define __ISO_C_VISIBLE 1999
#elif _POSIX_C_SOURCE >= 199506
# 755 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199506
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199309
# 758 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199309
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199209
# 761 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199209
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199009
# 764 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199009
#define __ISO_C_VISIBLE 1990
#else
# 767 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 198808
#define __ISO_C_VISIBLE 0
#endif /* _POSIX_C_SOURCE */
# 770 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#else
# 771 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*-
* Deal with _ANSI_SOURCE:
* If it is defined, and no other compilation environment is explicitly
* requested, then define our internal feature-test macros to zero. This
* makes no difference to the preprocessor (undefined symbols in preprocessing
* expressions are defined to have value zero), but makes it more convenient for
* a test program to print out the values.
*
* If a program mistakenly defines _ANSI_SOURCE and some other macro such as
* _POSIX_C_SOURCE, we will assume that it wants the broader compilation
* environment (and in fact we will never get here).
*/
#if defined(_ANSI_SOURCE) /* Hide almost everything. */
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1990
#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */
# 789 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1999
#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */
# 794 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 2011
#else /* Default environment: show everything. */
# 799 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 200809
#define __XSI_VISIBLE 700
#define __BSD_VISIBLE 1
#define __ISO_C_VISIBLE 2011
#endif
# 804 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 805 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__mips) || defined(__powerpc64__) || defined(__riscv__)
#define __NO_TLS 1
#endif
# 809 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Old versions of GCC use non-standard ARM arch symbols; acle-compat.h
* translates them to __ARM_ARCH and the modern feature symbols defined by ARM.
*/
#if defined(__arm__) && !defined(__ARM_ARCH)
#if 0 /* expanded by -frewrite-includes */
#include <machine/acle-compat.h>
#endif /* expanded by -frewrite-includes */
# 815 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
# 816 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 817 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Type Safety Checking
*
* Clang provides additional attributes to enable checking type safety
* properties that cannot be enforced by the C type system.
*/
#if __has_attribute(__argument_with_type_tag__) && \
__has_attribute(__type_tag_for_datatype__) && !defined(lint)
#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \
__attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx)))
#define __datatype_type_tag(kind, type) \
__attribute__((__type_tag_for_datatype__(kind, type)))
#else
# 832 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx)
#define __datatype_type_tag(kind, type)
#endif
# 835 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Lock annotations.
*
* Clang provides support for doing basic thread-safety tests at
* compile-time, by marking which locks will/should be held when
* entering/leaving a functions.
*
* Furthermore, it is also possible to annotate variables and structure
* members to enforce that they are only accessed when certain locks are
* held.
*/
#if __has_extension(c_thread_safety_attributes)
#define __lock_annotate(x) __attribute__((x))
#else
# 851 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __lock_annotate(x)
#endif
# 853 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* Structure implements a lock. */
#define __lockable __lock_annotate(lockable)
/* Function acquires an exclusive or shared lock. */
#define __locks_exclusive(...) \
__lock_annotate(exclusive_lock_function(__VA_ARGS__))
#define __locks_shared(...) \
__lock_annotate(shared_lock_function(__VA_ARGS__))
/* Function attempts to acquire an exclusive or shared lock. */
#define __trylocks_exclusive(...) \
__lock_annotate(exclusive_trylock_function(__VA_ARGS__))
#define __trylocks_shared(...) \
__lock_annotate(shared_trylock_function(__VA_ARGS__))
/* Function releases a lock. */
#define __unlocks(...) __lock_annotate(unlock_function(__VA_ARGS__))
/* Function asserts that an exclusive or shared lock is held. */
#define __asserts_exclusive(...) \
__lock_annotate(assert_exclusive_lock(__VA_ARGS__))
#define __asserts_shared(...) \
__lock_annotate(assert_shared_lock(__VA_ARGS__))
/* Function requires that an exclusive or shared lock is or is not held. */
#define __requires_exclusive(...) \
__lock_annotate(exclusive_locks_required(__VA_ARGS__))
#define __requires_shared(...) \
__lock_annotate(shared_locks_required(__VA_ARGS__))
#define __requires_unlocked(...) \
__lock_annotate(locks_excluded(__VA_ARGS__))
/* Function should not be analyzed. */
#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis)
/* Guard variables and structure members by lock. */
#define __guarded_by(x) __lock_annotate(guarded_by(x))
#define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x))
/* Specify that a file requires capabilities */
#if __has_feature(capabilities)
#define __REQUIRE_CAPABILITIES
#else
# 897 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __REQUIRE_CAPABILITIES \
_Pragma("GCC error \"This file requires a capability-aware compiler\"")
#endif
# 900 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* !_SYS_CDEFS_H_ */
# 902 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
# 33 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if !__has_feature(capabilities)
#error "This code requires a CHERI-aware compiler"
#endif
# 37 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 1 3 4
/*-
* Copyright (c) 1982, 1986, 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)types.h 8.6 (Berkeley) 2/19/95
* $FreeBSD$
*/
#ifndef _SYS_TYPES_H_
#define _SYS_TYPES_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 41 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 42 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
/* Machine type dependent parameters. */
#if 0 /* expanded by -frewrite-includes */
#include <machine/endian.h>
#endif /* expanded by -frewrite-includes */
# 44 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 1 3 4
/*-
* Copyright (c) 1987, 1991 Regents of the University of California.
* All rights reserved.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)endian.h 7.8 (Berkeley) 4/3/91
* $FreeBSD$
*/
#ifndef _MACHINE_ENDIAN_H_
#define _MACHINE_ENDIAN_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#ifndef __ASSEMBLER__
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 1 3 4
/*-
* Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef _SYS__TYPES_H_
#define _SYS__TYPES_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_types.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 1 3 4
/*-
* Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* 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 University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
* From: @(#)types.h 8.3 (Berkeley) 1/5/94
* from: src/sys/i386/include/_types.h,v 1.12 2005/07/02 23:13:31 thompsa
* $FreeBSD$
*/
#ifndef _MACHINE__TYPES_H_
#define _MACHINE__TYPES_H_
#ifndef _SYS_CDEFS_H_
#error this file needs sys/cdefs.h as a prerequisite
#endif
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
/*
* Basic types upon which most other types are built.
*/
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
#ifdef __mips_n64
typedef long __int64_t;
typedef unsigned long __uint64_t;
#else
# 60 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#ifndef lint
__extension__
#endif
# 63 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
/* LONGLONG */
typedef long long __int64_t;
#ifndef lint
__extension__
#endif
# 68 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
/* LONGLONG */
typedef unsigned long long __uint64_t;
#endif
# 71 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
/*
* Standard type definitions.
*/
typedef __int32_t __clock_t; /* clock()... */
typedef double __double_t;
typedef float __float_t;
#ifdef __mips_n64
#ifndef __CHERI_PURE_CAPABILITY__
typedef __int64_t __critical_t;
typedef __int64_t __intfptr_t;
typedef __int64_t __intptr_t;
#else
# 84 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __intcap_t __critical_t;
typedef __intcap_t __intfptr_t;
typedef __intcap_t __intptr_t;
#endif
# 88 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#else
# 89 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int32_t __critical_t;
typedef __int32_t __intfptr_t;
typedef __int32_t __intptr_t;
#endif
# 93 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int64_t __intmax_t;
typedef __int32_t __int_fast8_t;
typedef __int32_t __int_fast16_t;
typedef __int32_t __int_fast32_t;
typedef __int64_t __int_fast64_t;
typedef __int8_t __int_least8_t;
typedef __int16_t __int_least16_t;
typedef __int32_t __int_least32_t;
typedef __int64_t __int_least64_t;
#if defined(__mips_n64) || defined(__mips_n32)
typedef __int64_t __register_t;
typedef __int64_t f_register_t;
#else
# 106 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int32_t __register_t;
typedef __int32_t f_register_t;
#endif
# 109 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#ifdef __mips_n64
typedef __int64_t __ptrdiff_t;
typedef __int64_t __segsz_t;
typedef __uint64_t __size_t;
typedef __int64_t __ssize_t;
#ifndef __CHERI_PURE_CAPABILITY__
typedef __uint64_t __uintfptr_t;
typedef __uint64_t __uintptr_t;
#else
# 118 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __uintcap_t __uintfptr_t;
typedef __uintcap_t __uintptr_t;
#endif
# 121 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#else
# 122 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */
typedef __int32_t __segsz_t; /* segment size (in pages) */
typedef __uint32_t __size_t; /* sizeof() */
typedef __int32_t __ssize_t; /* byte count or error */
typedef __uint32_t __uintfptr_t;
typedef __uint32_t __uintptr_t;
#endif
# 129 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int64_t __time_t; /* time()... */
typedef __uint64_t __uintmax_t;
typedef __uint32_t __uint_fast8_t;
typedef __uint32_t __uint_fast16_t;
typedef __uint32_t __uint_fast32_t;
typedef __uint64_t __uint_fast64_t;
typedef __uint8_t __uint_least8_t;
typedef __uint16_t __uint_least16_t;
typedef __uint32_t __uint_least32_t;
typedef __uint64_t __uint_least64_t;
#if defined(__mips_n64) || defined(__mips_n32)
typedef __uint64_t __u_register_t;
#else
# 142 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __uint32_t __u_register_t;
#endif
# 144 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#ifdef __mips_n64
typedef __uint64_t __vm_offset_t;
typedef __uint64_t __vm_size_t;
#else
# 148 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __uint32_t __vm_offset_t;
typedef __uint32_t __vm_size_t;
#endif
# 151 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */
typedef __uint64_t __vm_paddr_t;
#else
# 154 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __uint32_t __vm_paddr_t;
#endif
# 156 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int64_t __vm_ooffset_t;
typedef __uint64_t __vm_pindex_t;
typedef int ___wchar_t;
#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */
#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */
/*
* Unusual type definitions.
*/
#ifdef __GNUCLIKE_BUILTIN_VARARGS
typedef __builtin_va_list __va_list; /* internally known to gcc */
#else
# 170 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef char * __va_list;
#endif /* __GNUCLIKE_BUILTIN_VARARGS */
# 172 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \
&& !defined(__NO_GNUC_VA_LIST)
#define __GNUC_VA_LIST
typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
#endif
# 177 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#endif /* !_MACHINE__TYPES_H_ */
# 179 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
# 34 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 2 3 4
/*
* Standard type definitions.
*/
typedef __int32_t __blksize_t; /* file block size */
typedef __int64_t __blkcnt_t; /* file block count */
typedef __int32_t __clockid_t; /* clock_gettime()... */
typedef __uint32_t __fflags_t; /* file flags */
typedef __uint64_t __fsblkcnt_t;
typedef __uint64_t __fsfilcnt_t;
typedef __uint32_t __gid_t;
typedef __int64_t __id_t; /* can hold a gid_t, pid_t, or uid_t */
typedef __uint32_t __ino_t; /* inode number */
typedef long __key_t; /* IPC key (for Sys V IPC) */
typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) */
typedef __uint16_t __mode_t; /* permissions */
typedef int __accmode_t; /* access permissions */
typedef int __nl_item;
typedef __uint16_t __nlink_t; /* link count */
typedef __int64_t __off_t; /* file offset */
typedef __int64_t __off64_t; /* file offset (alias) */
typedef __int32_t __pid_t; /* process [group] */
typedef __int64_t __rlim_t; /* resource limit - intentionally */
/* signed, because of legacy code */
/* that uses -1 for RLIM_INFINITY */
typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef long __suseconds_t; /* microseconds (signed) */
typedef struct __timer *__timer_t; /* timer_gettime()... */
typedef struct __mq *__mqd_t; /* mq_open()... */
typedef __uint32_t __uid_t;
typedef unsigned int __useconds_t; /* microseconds (unsigned) */
typedef int __cpuwhich_t; /* which parameter for cpuset. */
typedef int __cpulevel_t; /* level parameter for cpuset. */
typedef int __cpusetid_t; /* cpuset identifier. */
/*
* Unusual type definitions.
*/
/*
* rune_t is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
* it looks like 10646 will be a 31 bit standard. This means that if your
* ints cannot hold 32 bits, you will be in trouble. The reason an int was
* chosen over a long is that the is*() and to*() routines take ints (says
* ANSI C), but they use __ct_rune_t instead of int.
*
* NOTE: rune_t is not covered by ANSI nor other standards, and should not
* be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and
* rune_t must be the same type. Also, wint_t should be able to hold all
* members of the largest character set plus one extra value (WEOF), and
* must be at least 16 bits.
*/
typedef int __ct_rune_t; /* arg type for ctype funcs */
typedef __ct_rune_t __rune_t; /* rune_t (see above) */
typedef __ct_rune_t __wint_t; /* wint_t (see above) */
/* Clang already provides these types as built-ins, but only in C++ mode. */
#if !defined(__clang__) || !defined(__cplusplus)
typedef __uint_least16_t __char16_t;
typedef __uint_least32_t __char32_t;
#endif
# 97 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
/* In C++11, char16_t and char32_t are built-in types. */
#if defined(__cplusplus) && __cplusplus >= 201103L
#define _CHAR16_T_DECLARED
#define _CHAR32_T_DECLARED
#endif
# 102 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
typedef struct {
long long __max_align1 __aligned(_Alignof(long long));
long double __max_align2 __aligned(_Alignof(long double));
} __max_align_t;
typedef __uint32_t __dev_t; /* device number */
typedef __uint32_t __fixpt_t; /* fixed point number */
/*
* mbstate_t is an opaque object to keep conversion state during multibyte
* stream conversions.
*/
typedef union {
char __mbstate8[128];
__int64_t _mbstateL; /* for alignment */
} __mbstate_t;
typedef __uintmax_t __rman_res_t;
#endif /* !_SYS__TYPES_H_ */
# 124 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 2 3 4
#endif
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#ifdef __cplusplus
extern "C" {
#endif
# 44 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
/*
* Definitions for byte order, according to byte significance from low
* address to high.
*/
#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
#ifdef __MIPSEB__
#define _BYTE_ORDER _BIG_ENDIAN
#else
# 56 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#define _BYTE_ORDER _LITTLE_ENDIAN
#endif /* __MIBSEB__ */
# 58 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
/*
* Deprecated variants that don't have enough underscores to be useful in more
* strict namespaces.
*/
#if __BSD_VISIBLE
#define LITTLE_ENDIAN _LITTLE_ENDIAN
#define BIG_ENDIAN _BIG_ENDIAN
#define PDP_ENDIAN _PDP_ENDIAN
#define BYTE_ORDER _BYTE_ORDER
#endif
# 69 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#ifndef __ASSEMBLER__
#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) && defined(__OPTIMIZE__)
#define __is_constant(x) __builtin_constant_p(x)
#else
# 74 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#define __is_constant(x) 0
#endif
# 76 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#define __bswap16_const(x) (((x) >> 8) | (((x) << 8) & 0xff00))
#define __bswap32_const(x) (((x) >> 24) | (((x) >> 8) & 0xff00) | \
(((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000))
#define __bswap64_const(x) (((x) >> 56) | (((x) >> 40) & 0xff00) | \
(((x) >> 24) & 0xff0000) | (((x) >> 8) & 0xff000000) | \
(((x) << 8) & ((__uint64_t)0xff << 32)) | \
(((x) << 24) & ((__uint64_t)0xff << 40)) | \
(((x) << 40) & ((__uint64_t)0xff << 48)) | (((x) << 56)))
static __inline __uint16_t
__bswap16_var(__uint16_t _x)
{
return ((_x >> 8) | ((_x << 8) & 0xff00));
}
static __inline __uint32_t
__bswap32_var(__uint32_t _x)
{
return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) |
((_x << 24) & 0xff000000));
}
static __inline __uint64_t
__bswap64_var(__uint64_t _x)
{
return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) |
((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) |
((_x << 24) & ((__uint64_t)0xff << 40)) |
((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56)));
}
#define __bswap16(x) ((__uint16_t)(__is_constant((x)) ? \
__bswap16_const((__uint16_t)(x)) : __bswap16_var((__uint16_t)(x))))
#define __bswap32(x) ((__uint32_t)(__is_constant((x)) ? \
__bswap32_const((__uint32_t)(x)) : __bswap32_var((__uint32_t)(x))))
#define __bswap64(x) ((__uint64_t)(__is_constant((x)) ? \
__bswap64_const((__uint64_t)(x)) : __bswap64_var((__uint64_t)(x))))
#ifdef __MIPSEB__
#define __htonl(x) ((__uint32_t)(x))
#define __htons(x) ((__uint16_t)(x))
#define __ntohl(x) ((__uint32_t)(x))
#define __ntohs(x) ((__uint16_t)(x))
/*
* Define the order of 32-bit words in 64-bit words.
*/
/*
* XXXMIPS: Additional parentheses to make gcc more happy.
*/
#define _QUAD_HIGHWORD 0
#define _QUAD_LOWWORD 1
#else
# 132 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0
#define __ntohl(x) (__bswap32((x)))
#define __ntohs(x) (__bswap16((x)))
#define __htonl(x) (__bswap32((x)))
#define __htons(x) (__bswap16((x)))
#endif /* _MIPSEB */
# 139 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#endif /* _ASSEMBLER_ */
# 141 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#ifdef __cplusplus
}
#endif
# 145 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#endif /* !_MACHINE_ENDIAN_H_ */
# 147 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
# 45 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 45 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthreadtypes.h>
#endif /* expanded by -frewrite-includes */
# 47 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_pthreadtypes.h" 1 3 4
/*
* Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
* Copyright (c) 1995-1998 by John Birrell <jb@cimlogic.com.au>
* All rights reserved.
*
* 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 Chris Provenzano.
* 4. The name of Chris Provenzano may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``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 CHRIS PROVENZANO 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.
*
* $FreeBSD$
*/
#ifndef _SYS__PTHREADTYPES_H_
#define _SYS__PTHREADTYPES_H_
/*
* Forward structure definitions.
*
* These are mostly opaque to the user.
*/
struct pthread;
struct pthread_attr;
struct pthread_cond;
struct pthread_cond_attr;
struct pthread_mutex;
struct pthread_mutex_attr;
struct pthread_once;
struct pthread_rwlock;
struct pthread_rwlockattr;
struct pthread_barrier;
struct pthread_barrier_attr;
struct pthread_spinlock;
/*
* Primitive system data type definitions required by P1003.1c.
*
* Note that P1003.1c specifies that there are no defined comparison
* or assignment operators for the types pthread_attr_t, pthread_cond_t,
* pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t.
*/
#ifndef _PTHREAD_T_DECLARED
typedef struct pthread *pthread_t;
#define _PTHREAD_T_DECLARED
#endif
# 68 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_pthreadtypes.h" 3 4
typedef struct pthread_attr *pthread_attr_t;
typedef struct pthread_mutex *pthread_mutex_t;
typedef struct pthread_mutex_attr *pthread_mutexattr_t;
typedef struct pthread_cond *pthread_cond_t;
typedef struct pthread_cond_attr *pthread_condattr_t;
typedef int pthread_key_t;
typedef struct pthread_once pthread_once_t;
typedef struct pthread_rwlock *pthread_rwlock_t;
typedef struct pthread_rwlockattr *pthread_rwlockattr_t;
typedef struct pthread_barrier *pthread_barrier_t;
typedef struct pthread_barrierattr *pthread_barrierattr_t;
typedef struct pthread_spinlock *pthread_spinlock_t;
/*
* Additional type definitions:
*
* Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for
* use in header symbols.
*/
typedef void *pthread_addr_t;
typedef void *(*pthread_startroutine_t)(void *);
/*
* Once definitions.
*/
struct pthread_once {
int state;
pthread_mutex_t mutex;
};
#endif /* ! _SYS__PTHREADTYPES_H_ */
# 99 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_pthreadtypes.h" 3 4
# 48 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 2 3 4
#if __BSD_VISIBLE
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
#ifndef _KERNEL
typedef unsigned short ushort; /* Sys V compatibility */
typedef unsigned int uint; /* Sys V compatibility */
#endif
# 58 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#endif
# 59 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
/*
* XXX POSIX sized integrals that should appear only in <sys/stdint.h>.
*/
#if 0 /* expanded by -frewrite-includes */
#include <sys/_stdint.h>
#endif /* expanded by -frewrite-includes */
# 63 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 1 3 4
/*-
* Copyright (c) 2011 David E. O'Brien <obrien@FreeBSD.org>
* Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef _SYS__STDINT_H_
#define _SYS__STDINT_H_
#ifndef _INT8_T_DECLARED
typedef __int8_t int8_t;
#define _INT8_T_DECLARED
#endif
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _INT16_T_DECLARED
typedef __int16_t int16_t;
#define _INT16_T_DECLARED
#endif
# 42 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _INT32_T_DECLARED
typedef __int32_t int32_t;
#define _INT32_T_DECLARED
#endif
# 47 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _INT64_T_DECLARED
typedef __int64_t int64_t;
#define _INT64_T_DECLARED
#endif
# 52 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT8_T_DECLARED
typedef __uint8_t uint8_t;
#define _UINT8_T_DECLARED
#endif
# 57 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT16_T_DECLARED
typedef __uint16_t uint16_t;
#define _UINT16_T_DECLARED
#endif
# 62 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT32_T_DECLARED
typedef __uint32_t uint32_t;
#define _UINT32_T_DECLARED
#endif
# 67 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT64_T_DECLARED
typedef __uint64_t uint64_t;
#define _UINT64_T_DECLARED
#endif
# 72 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _INTPTR_T_DECLARED
typedef __intptr_t intptr_t;
#define _INTPTR_T_DECLARED
#endif
# 77 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINTPTR_T_DECLARED
typedef __uintptr_t uintptr_t;
#define _UINTPTR_T_DECLARED
#endif
# 81 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _INTMAX_T_DECLARED
typedef __intmax_t intmax_t;
#define _INTMAX_T_DECLARED
#endif
# 85 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINTMAX_T_DECLARED
typedef __uintmax_t uintmax_t;
#define _UINTMAX_T_DECLARED
#endif
# 89 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#if __has_attribute(memory_address)
#define __memory_address __attribute__((memory_address))
#else
# 93 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#define __memory_address
#endif
# 95 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifdef __CHERI_PURE_CAPABILITY__
typedef __memory_address __uintcap_t vaddr_t;
#else
# 99 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
typedef __memory_address __uintptr_t vaddr_t;
#endif
# 101 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#endif /* !_SYS__STDINT_H_ */
# 103 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
# 64 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 2 3 4
typedef __uint8_t u_int8_t; /* unsigned integrals (deprecated) */
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;
typedef __uint64_t u_quad_t; /* quads (deprecated) */
typedef __int64_t quad_t;
typedef quad_t * qaddr_t;
typedef char * caddr_t; /* core address */
typedef const char * c_caddr_t; /* core address, pointer to const */
#ifndef _BLKSIZE_T_DECLARED
typedef __blksize_t blksize_t;
#define _BLKSIZE_T_DECLARED
#endif
# 81 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __cpuwhich_t cpuwhich_t;
typedef __cpulevel_t cpulevel_t;
typedef __cpusetid_t cpusetid_t;
#ifndef _BLKCNT_T_DECLARED
typedef __blkcnt_t blkcnt_t;
#define _BLKCNT_T_DECLARED
#endif
# 90 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _CLOCK_T_DECLARED
typedef __clock_t clock_t;
#define _CLOCK_T_DECLARED
#endif
# 95 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _CLOCKID_T_DECLARED
typedef __clockid_t clockid_t;
#define _CLOCKID_T_DECLARED
#endif
# 100 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __critical_t critical_t; /* Critical section value */
typedef __int64_t daddr_t; /* disk address */
#ifndef _DEV_T_DECLARED
typedef __dev_t dev_t; /* device number or struct cdev */
#define _DEV_T_DECLARED
#endif
# 108 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _FFLAGS_T_DECLARED
typedef __fflags_t fflags_t; /* file flags */
#define _FFLAGS_T_DECLARED
#endif
# 113 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __fixpt_t fixpt_t; /* fixed point number */
#ifndef _FSBLKCNT_T_DECLARED /* for statvfs() */
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
#define _FSBLKCNT_T_DECLARED
#endif
# 121 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _GID_T_DECLARED
typedef __gid_t gid_t; /* group id */
#define _GID_T_DECLARED
#endif
# 126 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _IN_ADDR_T_DECLARED
typedef __uint32_t in_addr_t; /* base type for internet address */
#define _IN_ADDR_T_DECLARED
#endif
# 131 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _IN_PORT_T_DECLARED
typedef __uint16_t in_port_t;
#define _IN_PORT_T_DECLARED
#endif
# 136 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _ID_T_DECLARED
typedef __id_t id_t; /* can hold a uid_t or pid_t */
#define _ID_T_DECLARED
#endif
# 141 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _INO_T_DECLARED
typedef __ino_t ino_t; /* inode number */
#define _INO_T_DECLARED
#endif
# 146 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _KEY_T_DECLARED
typedef __key_t key_t; /* IPC key (for Sys V IPC) */
#define _KEY_T_DECLARED
#endif
# 151 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _LWPID_T_DECLARED
typedef __lwpid_t lwpid_t; /* Thread ID (a.k.a. LWP) */
#define _LWPID_T_DECLARED
#endif
# 156 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _MODE_T_DECLARED
typedef __mode_t mode_t; /* permissions */
#define _MODE_T_DECLARED
#endif
# 161 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _ACCMODE_T_DECLARED
typedef __accmode_t accmode_t; /* access permissions */
#define _ACCMODE_T_DECLARED
#endif
# 166 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _NLINK_T_DECLARED
typedef __nlink_t nlink_t; /* link count */
#define _NLINK_T_DECLARED
#endif
# 171 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _OFF_T_DECLARED
typedef __off_t off_t; /* file offset */
#define _OFF_T_DECLARED
#endif
# 176 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _OFF64_T_DECLARED
typedef __off64_t off64_t; /* file offset (alias) */
#define _OFF64_T_DECLARED
#endif
# 181 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t; /* process id */
#define _PID_T_DECLARED
#endif
# 186 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __register_t register_t;
#ifndef _RLIM_T_DECLARED
typedef __rlim_t rlim_t; /* resource limit */
#define _RLIM_T_DECLARED
#endif
# 193 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __int64_t sbintime_t;
typedef __segsz_t segsz_t; /* segment size (in pages) */
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 202 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif
# 207 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _SUSECONDS_T_DECLARED
typedef __suseconds_t suseconds_t; /* microseconds (signed) */
#define _SUSECONDS_T_DECLARED
#endif
# 212 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 217 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _TIMER_T_DECLARED
typedef __timer_t timer_t;
#define _TIMER_T_DECLARED
#endif
# 222 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _MQD_T_DECLARED
typedef __mqd_t mqd_t;
#define _MQD_T_DECLARED
#endif
# 227 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __u_register_t u_register_t;
#ifndef _UID_T_DECLARED
typedef __uid_t uid_t; /* user id */
#define _UID_T_DECLARED
#endif
# 234 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _USECONDS_T_DECLARED
typedef __useconds_t useconds_t; /* microseconds (unsigned) */
#define _USECONDS_T_DECLARED
#endif
# 239 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _CAP_IOCTL_T_DECLARED
#define _CAP_IOCTL_T_DECLARED
typedef unsigned long cap_ioctl_t;
#endif
# 244 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _CAP_RIGHTS_T_DECLARED
#define _CAP_RIGHTS_T_DECLARED
struct cap_rights;
typedef struct cap_rights cap_rights_t;
#endif
# 251 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __vm_offset_t vm_offset_t;
typedef __vm_ooffset_t vm_ooffset_t;
typedef __vm_paddr_t vm_paddr_t;
typedef __vm_pindex_t vm_pindex_t;
typedef __vm_size_t vm_size_t;
typedef __rman_res_t rman_res_t;
#ifdef _KERNEL
typedef int boolean_t;
typedef struct device *device_t;
typedef __intfptr_t intfptr_t;
/*
* XXX this is fixed width for historical reasons. It should have had type
* __int_fast32_t. Fixed-width types should not be used unless binary
* compatibility is essential. Least-width types should be used even less
* since they provide smaller benefits.
*
* XXX should be MD.
*
* XXX this is bogus in -current, but still used for spl*().
*/
typedef __uint32_t intrmask_t; /* Interrupt mask (spl, xxx_imask...) */
typedef __uintfptr_t uintfptr_t;
typedef __uint64_t uoff_t;
typedef char vm_memattr_t; /* memory attribute codes */
typedef struct vm_page *vm_page_t;
#if !defined(__bool_true_false_are_defined) && !defined(__cplusplus)
#define __bool_true_false_are_defined 1
#define false 0
#define true 1
#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER)
typedef int _Bool;
#endif
# 289 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef _Bool bool;
#endif /* !__bool_true_false_are_defined && !__cplusplus */
# 291 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#define offsetof(type, field) __offsetof(type, field)
#endif /* !_KERNEL */
# 295 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
/*
* The following are all things that really shouldn't exist in this header,
* since its purpose is to provide typedefs, not miscellaneous doodads.
*/
#ifdef __POPCNT__
#define __bitcount64(x) __builtin_popcountll((__uint64_t)(x))
#define __bitcount32(x) __builtin_popcount((__uint32_t)(x))
#define __bitcount16(x) __builtin_popcount((__uint16_t)(x))
#define __bitcountl(x) __builtin_popcountl((unsigned long)(x))
#define __bitcount(x) __builtin_popcount((unsigned int)(x))
#else
# 308 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
/*
* Population count algorithm using SWAR approach
* - "SIMD Within A Register".
*/
static __inline __uint16_t
__bitcount16(__uint16_t _x)
{
_x = (_x & 0x5555) + ((_x & 0xaaaa) >> 1);
_x = (_x & 0x3333) + ((_x & 0xcccc) >> 2);
_x = (_x + (_x >> 4)) & 0x0f0f;
_x = (_x + (_x >> 8)) & 0x00ff;
return (_x);
}
static __inline __uint32_t
__bitcount32(__uint32_t _x)
{
_x = (_x & 0x55555555) + ((_x & 0xaaaaaaaa) >> 1);
_x = (_x & 0x33333333) + ((_x & 0xcccccccc) >> 2);
_x = (_x + (_x >> 4)) & 0x0f0f0f0f;
_x = (_x + (_x >> 8));
_x = (_x + (_x >> 16)) & 0x000000ff;
return (_x);
}
#ifdef __LP64__
static __inline __uint64_t
__bitcount64(__uint64_t _x)
{
_x = (_x & 0x5555555555555555) + ((_x & 0xaaaaaaaaaaaaaaaa) >> 1);
_x = (_x & 0x3333333333333333) + ((_x & 0xcccccccccccccccc) >> 2);
_x = (_x + (_x >> 4)) & 0x0f0f0f0f0f0f0f0f;
_x = (_x + (_x >> 8));
_x = (_x + (_x >> 16));
_x = (_x + (_x >> 32)) & 0x000000ff;
return (_x);
}
#define __bitcountl(x) __bitcount64((unsigned long)(x))
#else
# 351 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
static __inline __uint64_t
__bitcount64(__uint64_t _x)
{
return (__bitcount32(_x >> 32) + __bitcount32(_x));
}
#define __bitcountl(x) __bitcount32((unsigned long)(x))
#endif
# 360 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#define __bitcount(x) __bitcount32((unsigned int)(x))
#endif
# 362 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#if __BSD_VISIBLE
#if 0 /* expanded by -frewrite-includes */
#include <sys/select.h>
#endif /* expanded by -frewrite-includes */
# 365 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 1 3 4
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* $FreeBSD$
*/
#ifndef _SYS_SELECT_H_
#define _SYS_SELECT_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 35 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_sigset.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_sigset.h" 1 3 4
/*-
* Copyright (c) 1982, 1986, 1989, 1991, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)signal.h 8.4 (Berkeley) 5/4/95
* $FreeBSD$
*/
#ifndef _SYS__SIGSET_H_
#define _SYS__SIGSET_H_
/*
* sigset_t macros.
*/
#define _SIG_WORDS 4
#define _SIG_MAXSIG 128
#define _SIG_IDX(sig) ((sig) - 1)
#define _SIG_WORD(sig) (_SIG_IDX(sig) >> 5)
#define _SIG_BIT(sig) (1 << (_SIG_IDX(sig) & 31))
#define _SIG_VALID(sig) ((sig) <= _SIG_MAXSIG && (sig) > 0)
typedef struct __sigset {
__uint32_t __bits[_SIG_WORDS];
} __sigset_t;
#if defined(_KERNEL) && defined(COMPAT_43)
typedef unsigned int osigset_t;
#endif
# 58 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_sigset.h" 3 4
#endif /* !_SYS__SIGSET_H_ */
# 60 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_sigset.h" 3 4
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timeval.h>
#endif /* expanded by -frewrite-includes */
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 1 3 4
/*-
* Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef _SYS__TIMEVAL_H_
#define _SYS__TIMEVAL_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 3 4
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 3 4
#ifndef _SUSECONDS_T_DECLARED
typedef __suseconds_t suseconds_t;
#define _SUSECONDS_T_DECLARED
#endif
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 43 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 3 4
/*
* Structure returned by gettimeofday(2) system call, and used in other calls.
*/
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* and microseconds */
};
#endif /* !_SYS__TIMEVAL_H_ */
# 53 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 3 4
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/timespec.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 1 3 4
/*-
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
* from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp
* $FreeBSD$
*/
#ifndef _SYS_TIMESPEC_H_
#define _SYS_TIMESPEC_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timespec.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timespec.h" 1 3 4
/*-
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
* from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp
* $FreeBSD$
*/
#ifndef _SYS__TIMESPEC_H_
#define _SYS__TIMESPEC_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timespec.h" 3 4
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timespec.h" 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 43 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timespec.h" 3 4
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
};
#endif /* !_SYS__TIMESPEC_H_ */
# 50 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timespec.h" 3 4
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 2 3 4
#if __BSD_VISIBLE
#define TIMEVAL_TO_TIMESPEC(tv, ts) \
do { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
} while (0)
#define TIMESPEC_TO_TIMEVAL(tv, ts) \
do { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
} while (0)
#endif /* __BSD_VISIBLE */
# 53 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
/*
* Structure defined by POSIX.1b to be like a itimerval, but with
* timespecs. Used in the timer_*() system calls.
*/
struct itimerspec {
struct timespec it_interval;
struct timespec it_value;
};
#endif /* _SYS_TIMESPEC_H_ */
# 64 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
# 41 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 2 3 4
typedef unsigned long __fd_mask;
#if __BSD_VISIBLE
typedef __fd_mask fd_mask;
#endif
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#ifndef _SIGSET_T_DECLARED
#define _SIGSET_T_DECLARED
typedef __sigset_t sigset_t;
#endif
# 51 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
/*
* Select uses bit masks of file descriptors in longs. These macros
* manipulate such bit fields (the filesystem macros use chars).
* FD_SETSIZE may be defined by the user, but the default here should
* be enough for most uses.
*/
#ifndef FD_SETSIZE
#define FD_SETSIZE 1024
#endif
# 61 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#define _NFDBITS (sizeof(__fd_mask) * 8) /* bits per mask */
#if __BSD_VISIBLE
#define NFDBITS _NFDBITS
#endif
# 66 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#ifndef _howmany
#define _howmany(x, y) (((x) + ((y) - 1)) / (y))
#endif
# 70 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
typedef struct fd_set {
__fd_mask __fds_bits[_howmany(FD_SETSIZE, _NFDBITS)];
} fd_set;
#if __BSD_VISIBLE
#define fds_bits __fds_bits
#endif
# 77 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#define __fdset_mask(n) ((__fd_mask)1 << ((n) % _NFDBITS))
#define FD_CLR(n, p) ((p)->__fds_bits[(n)/_NFDBITS] &= ~__fdset_mask(n))
#if __BSD_VISIBLE
#define FD_COPY(f, t) (void)(*(t) = *(f))
#endif
# 83 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#define FD_ISSET(n, p) (((p)->__fds_bits[(n)/_NFDBITS] & __fdset_mask(n)) != 0)
#define FD_SET(n, p) ((p)->__fds_bits[(n)/_NFDBITS] |= __fdset_mask(n))
#define FD_ZERO(p) do { \
fd_set *_p; \
__size_t _n; \
\
_p = (p); \
_n = _howmany(FD_SETSIZE, _NFDBITS); \
while (_n > 0) \
_p->__fds_bits[--_n] = 0; \
} while (0)
#ifndef _KERNEL
__BEGIN_DECLS
int pselect(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict,
const struct timespec *__restrict, const sigset_t *__restrict);
#ifndef _SELECT_DECLARED
#define _SELECT_DECLARED
/* XXX missing restrict type-qualifier */
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
#endif
# 105 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
__END_DECLS
#endif /* !_KERNEL */
# 107 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#endif /* _SYS_SELECT_H_ */
# 109 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 366 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 2 3 4
/*
* minor() gives a cookie instead of an index since we don't want to
* change the meanings of bits 0-15 or waste time and space shifting
* bits 16-31 for devices that don't use them.
*/
#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */
#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
/*
* These declarations belong elsewhere, but are repeated here and in
* <stdio.h> to give broken programs a better chance of working with
* 64-bit off_t's.
*/
#ifndef _KERNEL
__BEGIN_DECLS
#ifndef _FTRUNCATE_DECLARED
#define _FTRUNCATE_DECLARED
int ftruncate(int, off_t);
#endif
# 387 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _LSEEK_DECLARED
#define _LSEEK_DECLARED
off_t lseek(int, off_t, int);
#endif
# 391 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _MMAP_DECLARED
#define _MMAP_DECLARED
void * mmap(void *, size_t, int, int, int, off_t);
#endif
# 395 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _TRUNCATE_DECLARED
#define _TRUNCATE_DECLARED
int truncate(const char *, off_t);
#endif
# 399 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
__END_DECLS
#endif /* !_KERNEL */
# 401 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#endif /* __BSD_VISIBLE */
# 403 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#endif /* !_SYS_TYPES_H_ */
# 405 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 39 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <sys/sysctl.h>
#endif /* expanded by -frewrite-includes */
# 39 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 1 3 4
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Mike Karels at Berkeley Software Design, Inc.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)sysctl.h 8.1 (Berkeley) 6/2/93
* $FreeBSD$
*/
#ifndef _SYS_SYSCTL_H_
#define _SYS_SYSCTL_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/queue.h>
#endif /* expanded by -frewrite-includes */
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 1 3 4
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)queue.h 8.5 (Berkeley) 8/20/94
* $FreeBSD$
*/
#ifndef _SYS_QUEUE_H_
#define _SYS_QUEUE_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
/*
* This file defines four types of data structures: singly-linked lists,
* singly-linked tail queues, lists and tail queues.
*
* A singly-linked list is headed by a single forward pointer. The elements
* are singly linked for minimum space and pointer manipulation overhead at
* the expense of O(n) removal for arbitrary elements. New elements can be
* added to the list after an existing element or at the head of the list.
* Elements being removed from the head of the list should use the explicit
* macro for this purpose for optimum efficiency. A singly-linked list may
* only be traversed in the forward direction. Singly-linked lists are ideal
* for applications with large datasets and few or no removals or for
* implementing a LIFO queue.
*
* A singly-linked tail queue is headed by a pair of pointers, one to the
* head of the list and the other to the tail of the list. The elements are
* singly linked for minimum space and pointer manipulation overhead at the
* expense of O(n) removal for arbitrary elements. New elements can be added
* to the list after an existing element, at the head of the list, or at the
* end of the list. Elements being removed from the head of the tail queue
* should use the explicit macro for this purpose for optimum efficiency.
* A singly-linked tail queue may only be traversed in the forward direction.
* Singly-linked tail queues are ideal for applications with large datasets
* and few or no removals or for implementing a FIFO queue.
*
* A list is headed by a single forward pointer (or an array of forward
* pointers for a hash table header). The elements are doubly linked
* so that an arbitrary element can be removed without a need to
* traverse the list. New elements can be added to the list before
* or after an existing element or at the head of the list. A list
* may be traversed in either direction.
*
* A tail queue is headed by a pair of pointers, one to the head of the
* list and the other to the tail of the list. The elements are doubly
* linked so that an arbitrary element can be removed without a need to
* traverse the list. New elements can be added to the list before or
* after an existing element, at the head of the list, or at the end of
* the list. A tail queue may be traversed in either direction.
*
* For details on the use of these macros, see the queue(3) manual page.
*
* Below is a summary of implemented functions where:
* + means the macro is available
* - means the macro is not available
* s means the macro is available but is slow (runs in O(n) time)
*
* SLIST LIST STAILQ TAILQ
* _HEAD + + + +
* _CLASS_HEAD + + + +
* _HEAD_INITIALIZER + + + +
* _ENTRY + + + +
* _CLASS_ENTRY + + + +
* _INIT + + + +
* _EMPTY + + + +
* _FIRST + + + +
* _NEXT + + + +
* _PREV - + - +
* _LAST - - + +
* _FOREACH + + + +
* _FOREACH_FROM + + + +
* _FOREACH_SAFE + + + +
* _FOREACH_FROM_SAFE + + + +
* _FOREACH_REVERSE - - - +
* _FOREACH_REVERSE_FROM - - - +
* _FOREACH_REVERSE_SAFE - - - +
* _FOREACH_REVERSE_FROM_SAFE - - - +
* _INSERT_HEAD + + + +
* _INSERT_BEFORE - + - +
* _INSERT_AFTER + + + +
* _INSERT_TAIL - - + +
* _CONCAT s s + +
* _REMOVE_AFTER + - + -
* _REMOVE_HEAD + - + -
* _REMOVE s + s +
* _SWAP + + + +
*
*/
#ifdef QUEUE_MACRO_DEBUG
#warn Use QUEUE_MACRO_DEBUG_TRACE and/or QUEUE_MACRO_DEBUG_TRASH
#define QUEUE_MACRO_DEBUG_TRACE
#define QUEUE_MACRO_DEBUG_TRASH
#endif
# 120 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#ifdef QUEUE_MACRO_DEBUG_TRACE
/* Store the last 2 places the queue element or head was altered */
struct qm_trace {
unsigned long lastline;
unsigned long prevline;
const char *lastfile;
const char *prevfile;
};
#define TRACEBUF struct qm_trace trace;
#define TRACEBUF_INITIALIZER { __LINE__, 0, __FILE__, NULL } ,
#define QMD_TRACE_HEAD(head) do { \
(head)->trace.prevline = (head)->trace.lastline; \
(head)->trace.prevfile = (head)->trace.lastfile; \
(head)->trace.lastline = __LINE__; \
(head)->trace.lastfile = __FILE__; \
} while (0)
#define QMD_TRACE_ELEM(elem) do { \
(elem)->trace.prevline = (elem)->trace.lastline; \
(elem)->trace.prevfile = (elem)->trace.lastfile; \
(elem)->trace.lastline = __LINE__; \
(elem)->trace.lastfile = __FILE__; \
} while (0)
#else /* !QUEUE_MACRO_DEBUG_TRACE */
# 148 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#define QMD_TRACE_ELEM(elem)
#define QMD_TRACE_HEAD(head)
#define TRACEBUF
#define TRACEBUF_INITIALIZER
#endif /* QUEUE_MACRO_DEBUG_TRACE */
# 153 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#ifdef QUEUE_MACRO_DEBUG_TRASH
#define TRASHIT(x) do {(x) = (void *)-1;} while (0)
#define QMD_IS_TRASHED(x) ((x) == (void *)(intptr_t)-1)
#else /* !QUEUE_MACRO_DEBUG_TRASH */
# 158 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#define TRASHIT(x)
#define QMD_IS_TRASHED(x) 0
#endif /* QUEUE_MACRO_DEBUG_TRASH */
# 161 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#if defined(QUEUE_MACRO_DEBUG_TRACE) || defined(QUEUE_MACRO_DEBUG_TRASH)
#define QMD_SAVELINK(name, link) void **name = (void *)&(link)
#else /* !QUEUE_MACRO_DEBUG_TRACE && !QUEUE_MACRO_DEBUG_TRASH */
# 165 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#define QMD_SAVELINK(name, link)
#endif /* QUEUE_MACRO_DEBUG_TRACE || QUEUE_MACRO_DEBUG_TRASH */
# 167 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#ifdef __cplusplus
/*
* In C++ there can be structure lists and class lists:
*/
#define QUEUE_TYPEOF(type) type
#else
# 174 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#define QUEUE_TYPEOF(type) struct type
#endif
# 176 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
/*
* Singly-linked List declarations.
*/
#define SLIST_HEAD(name, type) \
struct name { \
struct type *slh_first; /* first element */ \
}
#define SLIST_CLASS_HEAD(name, type) \
struct name { \
class type *slh_first; /* first element */ \
}
#define SLIST_HEAD_INITIALIZER(head) \
{ NULL }
#define SLIST_ENTRY(type) \
struct { \
struct type *sle_next; /* next element */ \
}
#define SLIST_CLASS_ENTRY(type) \
struct { \
class type *sle_next; /* next element */ \
}
/*
* Singly-linked List functions.
*/
#if (defined(_KERNEL) && defined(INVARIANTS))
#define QMD_SLIST_CHECK_PREVPTR(prevp, elm) do { \
if (*(prevp) != (elm)) \
panic("Bad prevptr *(%p) == %p != %p", \
(prevp), *(prevp), (elm)); \
} while (0)
#else
# 213 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#define QMD_SLIST_CHECK_PREVPTR(prevp, elm)
#endif
# 215 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#define SLIST_CONCAT(head1, head2, type, field) do { \
QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head1); \
if (curelm == NULL) { \
if ((SLIST_FIRST(head1) = SLIST_FIRST(head2)) != NULL) \
SLIST_INIT(head2); \
} else if (SLIST_FIRST(head2) != NULL) { \
while (SLIST_NEXT(curelm, field) != NULL) \
curelm = SLIST_NEXT(curelm, field); \
SLIST_NEXT(curelm, field) = SLIST_FIRST(head2); \
SLIST_INIT(head2); \
} \
} while (0)
#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
#define SLIST_FIRST(head) ((head)->slh_first)
#define SLIST_FOREACH(var, head, field) \
for ((var) = SLIST_FIRST((head)); \
(var); \
(var) = SLIST_NEXT((var), field))
#define SLIST_FOREACH_FROM(var, head, field) \
for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \
(var); \
(var) = SLIST_NEXT((var), field))
#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
for ((var) = SLIST_FIRST((head)); \
(var) && ((tvar) = SLIST_NEXT((var), field), 1); \
(var) = (tvar))
#define SLIST_FOREACH_FROM_SAFE(var, head, field, tvar) \
for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \
(var) && ((tvar) = SLIST_NEXT((var), field), 1); \
(var) = (tvar))
#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
for ((varp) = &SLIST_FIRST((head)); \
((var) = *(varp)) != NULL; \
(varp) = &SLIST_NEXT((var), field))
#define SLIST_INIT(head) do { \
SLIST_FIRST((head)) = NULL; \
} while (0)
#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
SLIST_NEXT((slistelm), field) = (elm); \
} while (0)
#define SLIST_INSERT_HEAD(head, elm, field) do { \
SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
SLIST_FIRST((head)) = (elm); \
} while (0)
#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
#define SLIST_REMOVE(head, elm, type, field) do { \
QMD_SAVELINK(oldnext, (elm)->field.sle_next); \
if (SLIST_FIRST((head)) == (elm)) { \
SLIST_REMOVE_HEAD((head), field); \
} \
else { \
QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head); \
while (SLIST_NEXT(curelm, field) != (elm)) \
curelm = SLIST_NEXT(curelm, field); \
SLIST_REMOVE_AFTER(curelm, field); \
} \
TRASHIT(*oldnext); \
} while (0)
#define SLIST_REMOVE_AFTER(elm, field) do { \
SLIST_NEXT(elm, field) = \
SLIST_NEXT(SLIST_NEXT(elm, field), field); \
} while (0)
#define SLIST_REMOVE_HEAD(head, field) do { \
SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
} while (0)
#define SLIST_REMOVE_PREVPTR(prevp, elm, field) do { \
QMD_SLIST_CHECK_PREVPTR(prevp, elm); \
*(prevp) = SLIST_NEXT(elm, field); \
TRASHIT((elm)->field.sle_next); \
} while (0)
#define SLIST_SWAP(head1, head2, type) do { \
QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1); \
SLIST_FIRST(head1) = SLIST_FIRST(head2); \
SLIST_FIRST(head2) = swap_first; \
} while (0)
/*
* Singly-linked Tail queue declarations.
*/
#define STAILQ_HEAD(name, type) \
struct name { \
struct type *stqh_first;/* first element */ \
struct type **stqh_last;/* addr of last next element */ \
}
#define STAILQ_CLASS_HEAD(name, type) \
struct name { \
class type *stqh_first; /* first element */ \
class type **stqh_last; /* addr of last next element */ \
}
#define STAILQ_HEAD_INITIALIZER(head) \
{ NULL, &(head).stqh_first }
#define STAILQ_ENTRY(type) \
struct { \
struct type *stqe_next; /* next element */ \
}
#define STAILQ_CLASS_ENTRY(type) \
struct { \
class type *stqe_next; /* next element */ \
}
/*
* Singly-linked Tail queue functions.
*/
#define STAILQ_CONCAT(head1, head2) do { \
if (!STAILQ_EMPTY((head2))) { \
*(head1)->stqh_last = (head2)->stqh_first; \
(head1)->stqh_last = (head2)->stqh_last; \
STAILQ_INIT((head2)); \
} \
} while (0)
#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
#define STAILQ_FIRST(head) ((head)->stqh_first)
#define STAILQ_FOREACH(var, head, field) \
for((var) = STAILQ_FIRST((head)); \
(var); \
(var) = STAILQ_NEXT((var), field))
#define STAILQ_FOREACH_FROM(var, head, field) \
for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \
(var); \
(var) = STAILQ_NEXT((var), field))
#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
for ((var) = STAILQ_FIRST((head)); \
(var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
(var) = (tvar))
#define STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \
for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \
(var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
(var) = (tvar))
#define STAILQ_INIT(head) do { \
STAILQ_FIRST((head)) = NULL; \
(head)->stqh_last = &STAILQ_FIRST((head)); \
} while (0)
#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \
if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
STAILQ_NEXT((tqelm), field) = (elm); \
} while (0)
#define STAILQ_INSERT_HEAD(head, elm, field) do { \
if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
STAILQ_FIRST((head)) = (elm); \
} while (0)
#define STAILQ_INSERT_TAIL(head, elm, field) do { \
STAILQ_NEXT((elm), field) = NULL; \
*(head)->stqh_last = (elm); \
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
} while (0)
#define STAILQ_LAST(head, type, field) \
(STAILQ_EMPTY((head)) ? NULL : \
__containerof((head)->stqh_last, \
QUEUE_TYPEOF(type), field.stqe_next))
#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
#define STAILQ_REMOVE(head, elm, type, field) do { \
QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \
if (STAILQ_FIRST((head)) == (elm)) { \
STAILQ_REMOVE_HEAD((head), field); \
} \
else { \
QUEUE_TYPEOF(type) *curelm = STAILQ_FIRST(head); \
while (STAILQ_NEXT(curelm, field) != (elm)) \
curelm = STAILQ_NEXT(curelm, field); \
STAILQ_REMOVE_AFTER(head, curelm, field); \
} \
TRASHIT(*oldnext); \
} while (0)
#define STAILQ_REMOVE_AFTER(head, elm, field) do { \
if ((STAILQ_NEXT(elm, field) = \
STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
} while (0)
#define STAILQ_REMOVE_HEAD(head, field) do { \
if ((STAILQ_FIRST((head)) = \
STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
(head)->stqh_last = &STAILQ_FIRST((head)); \
} while (0)
#define STAILQ_SWAP(head1, head2, type) do { \
QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1); \
QUEUE_TYPEOF(type) **swap_last = (head1)->stqh_last; \
STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \
(head1)->stqh_last = (head2)->stqh_last; \
STAILQ_FIRST(head2) = swap_first; \
(head2)->stqh_last = swap_last; \
if (STAILQ_EMPTY(head1)) \
(head1)->stqh_last = &STAILQ_FIRST(head1); \
if (STAILQ_EMPTY(head2)) \
(head2)->stqh_last = &STAILQ_FIRST(head2); \
} while (0)
/*
* List declarations.
*/
#define LIST_HEAD(name, type) \
struct name { \
struct type *lh_first; /* first element */ \
}
#define LIST_CLASS_HEAD(name, type) \
struct name { \
class type *lh_first; /* first element */ \
}
#define LIST_HEAD_INITIALIZER(head) \
{ NULL }
#define LIST_ENTRY(type) \
struct { \
struct type *le_next; /* next element */ \
struct type **le_prev; /* address of previous next element */ \
}
#define LIST_CLASS_ENTRY(type) \
struct { \
class type *le_next; /* next element */ \
class type **le_prev; /* address of previous next element */ \
}
/*
* List functions.
*/
#if (defined(_KERNEL) && defined(INVARIANTS))
#define QMD_LIST_CHECK_HEAD(head, field) do { \
if (LIST_FIRST((head)) != NULL && \
LIST_FIRST((head))->field.le_prev != \
&LIST_FIRST((head))) \
panic("Bad list head %p first->prev != head", (head)); \
} while (0)
#define QMD_LIST_CHECK_NEXT(elm, field) do { \
if (LIST_NEXT((elm), field) != NULL && \
LIST_NEXT((elm), field)->field.le_prev != \
&((elm)->field.le_next)) \
panic("Bad link elm %p next->prev != elm", (elm)); \
} while (0)
#define QMD_LIST_CHECK_PREV(elm, field) do { \
if (*(elm)->field.le_prev != (elm)) \
panic("Bad link elm %p prev->next != elm", (elm)); \
} while (0)
#else
# 494 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#define QMD_LIST_CHECK_HEAD(head, field)
#define QMD_LIST_CHECK_NEXT(elm, field)
#define QMD_LIST_CHECK_PREV(elm, field)
#endif /* (_KERNEL && INVARIANTS) */
# 498 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#define LIST_CONCAT(head1, head2, type, field) do { \
QUEUE_TYPEOF(type) *curelm = LIST_FIRST(head1); \
if (curelm == NULL) { \
if ((LIST_FIRST(head1) = LIST_FIRST(head2)) != NULL) { \
LIST_FIRST(head2)->field.le_prev = \
&LIST_FIRST((head1)); \
LIST_INIT(head2); \
} \
} else if (LIST_FIRST(head2) != NULL) { \
while (LIST_NEXT(curelm, field) != NULL) \
curelm = LIST_NEXT(curelm, field); \
LIST_NEXT(curelm, field) = LIST_FIRST(head2); \
LIST_FIRST(head2)->field.le_prev = &LIST_NEXT(curelm, field); \
LIST_INIT(head2); \
} \
} while (0)
#define LIST_EMPTY(head) ((head)->lh_first == NULL)
#define LIST_FIRST(head) ((head)->lh_first)
#define LIST_FOREACH(var, head, field) \
for ((var) = LIST_FIRST((head)); \
(var); \
(var) = LIST_NEXT((var), field))
#define LIST_FOREACH_FROM(var, head, field) \
for ((var) = ((var) ? (var) : LIST_FIRST((head))); \
(var); \
(var) = LIST_NEXT((var), field))
#define LIST_FOREACH_SAFE(var, head, field, tvar) \
for ((var) = LIST_FIRST((head)); \
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
(var) = (tvar))
#define LIST_FOREACH_FROM_SAFE(var, head, field, tvar) \
for ((var) = ((var) ? (var) : LIST_FIRST((head))); \
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
(var) = (tvar))
#define LIST_INIT(head) do { \
LIST_FIRST((head)) = NULL; \
} while (0)
#define LIST_INSERT_AFTER(listelm, elm, field) do { \
QMD_LIST_CHECK_NEXT(listelm, field); \
if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
LIST_NEXT((listelm), field)->field.le_prev = \
&LIST_NEXT((elm), field); \
LIST_NEXT((listelm), field) = (elm); \
(elm)->field.le_prev = &LIST_NEXT((listelm), field); \
} while (0)
#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
QMD_LIST_CHECK_PREV(listelm, field); \
(elm)->field.le_prev = (listelm)->field.le_prev; \
LIST_NEXT((elm), field) = (listelm); \
*(listelm)->field.le_prev = (elm); \
(listelm)->field.le_prev = &LIST_NEXT((elm), field); \
} while (0)
#define LIST_INSERT_HEAD(head, elm, field) do { \
QMD_LIST_CHECK_HEAD((head), field); \
if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
LIST_FIRST((head)) = (elm); \
(elm)->field.le_prev = &LIST_FIRST((head)); \
} while (0)
#define LIST_NEXT(elm, field) ((elm)->field.le_next)
#define LIST_PREV(elm, head, type, field) \
((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \
__containerof((elm)->field.le_prev, \
QUEUE_TYPEOF(type), field.le_next))
#define LIST_REMOVE(elm, field) do { \
QMD_SAVELINK(oldnext, (elm)->field.le_next); \
QMD_SAVELINK(oldprev, (elm)->field.le_prev); \
QMD_LIST_CHECK_NEXT(elm, field); \
QMD_LIST_CHECK_PREV(elm, field); \
if (LIST_NEXT((elm), field) != NULL) \
LIST_NEXT((elm), field)->field.le_prev = \
(elm)->field.le_prev; \
*(elm)->field.le_prev = LIST_NEXT((elm), field); \
TRASHIT(*oldnext); \
TRASHIT(*oldprev); \
} while (0)
#define LIST_SWAP(head1, head2, type, field) do { \
QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \
LIST_FIRST((head1)) = LIST_FIRST((head2)); \
LIST_FIRST((head2)) = swap_tmp; \
if ((swap_tmp = LIST_FIRST((head1))) != NULL) \
swap_tmp->field.le_prev = &LIST_FIRST((head1)); \
if ((swap_tmp = LIST_FIRST((head2))) != NULL) \
swap_tmp->field.le_prev = &LIST_FIRST((head2)); \
} while (0)
/*
* Tail queue declarations.
*/
#define TAILQ_HEAD(name, type) \
struct name { \
struct type *tqh_first; /* first element */ \
struct type **tqh_last; /* addr of last next element */ \
TRACEBUF \
}
#define TAILQ_CLASS_HEAD(name, type) \
struct name { \
class type *tqh_first; /* first element */ \
class type **tqh_last; /* addr of last next element */ \
TRACEBUF \
}
#define TAILQ_HEAD_INITIALIZER(head) \
{ NULL, &(head).tqh_first, TRACEBUF_INITIALIZER }
#define TAILQ_ENTRY(type) \
struct { \
struct type *tqe_next; /* next element */ \
struct type **tqe_prev; /* address of previous next element */ \
TRACEBUF \
}
#define TAILQ_CLASS_ENTRY(type) \
struct { \
class type *tqe_next; /* next element */ \
class type **tqe_prev; /* address of previous next element */ \
TRACEBUF \
}
/*
* Tail queue functions.
*/
#if (defined(_KERNEL) && defined(INVARIANTS))
#define QMD_TAILQ_CHECK_HEAD(head, field) do { \
if (!TAILQ_EMPTY(head) && \
TAILQ_FIRST((head))->field.tqe_prev != \
&TAILQ_FIRST((head))) \
panic("Bad tailq head %p first->prev != head", (head)); \
} while (0)
#define QMD_TAILQ_CHECK_TAIL(head, field) do { \
if (*(head)->tqh_last != NULL) \
panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); \
} while (0)
#define QMD_TAILQ_CHECK_NEXT(elm, field) do { \
if (TAILQ_NEXT((elm), field) != NULL && \
TAILQ_NEXT((elm), field)->field.tqe_prev != \
&((elm)->field.tqe_next)) \
panic("Bad link elm %p next->prev != elm", (elm)); \
} while (0)
#define QMD_TAILQ_CHECK_PREV(elm, field) do { \
if (*(elm)->field.tqe_prev != (elm)) \
panic("Bad link elm %p prev->next != elm", (elm)); \
} while (0)
#else
# 661 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#define QMD_TAILQ_CHECK_HEAD(head, field)
#define QMD_TAILQ_CHECK_TAIL(head, headname)
#define QMD_TAILQ_CHECK_NEXT(elm, field)
#define QMD_TAILQ_CHECK_PREV(elm, field)
#endif /* (_KERNEL && INVARIANTS) */
# 666 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
#define TAILQ_CONCAT(head1, head2, field) do { \
if (!TAILQ_EMPTY(head2)) { \
*(head1)->tqh_last = (head2)->tqh_first; \
(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
(head1)->tqh_last = (head2)->tqh_last; \
TAILQ_INIT((head2)); \
QMD_TRACE_HEAD(head1); \
QMD_TRACE_HEAD(head2); \
} \
} while (0)
#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
#define TAILQ_FIRST(head) ((head)->tqh_first)
#define TAILQ_FOREACH(var, head, field) \
for ((var) = TAILQ_FIRST((head)); \
(var); \
(var) = TAILQ_NEXT((var), field))
#define TAILQ_FOREACH_FROM(var, head, field) \
for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \
(var); \
(var) = TAILQ_NEXT((var), field))
#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
for ((var) = TAILQ_FIRST((head)); \
(var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
(var) = (tvar))
#define TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \
for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \
(var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
(var) = (tvar))
#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
for ((var) = TAILQ_LAST((head), headname); \
(var); \
(var) = TAILQ_PREV((var), headname, field))
#define TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field) \
for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \
(var); \
(var) = TAILQ_PREV((var), headname, field))
#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \
for ((var) = TAILQ_LAST((head), headname); \
(var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
(var) = (tvar))
#define TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar) \
for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \
(var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
(var) = (tvar))
#define TAILQ_INIT(head) do { \
TAILQ_FIRST((head)) = NULL; \
(head)->tqh_last = &TAILQ_FIRST((head)); \
QMD_TRACE_HEAD(head); \
} while (0)
#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
QMD_TAILQ_CHECK_NEXT(listelm, field); \
if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
TAILQ_NEXT((elm), field)->field.tqe_prev = \
&TAILQ_NEXT((elm), field); \
else { \
(head)->tqh_last = &TAILQ_NEXT((elm), field); \
QMD_TRACE_HEAD(head); \
} \
TAILQ_NEXT((listelm), field) = (elm); \
(elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
QMD_TRACE_ELEM(&(elm)->field); \
QMD_TRACE_ELEM(&(listelm)->field); \
} while (0)
#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
QMD_TAILQ_CHECK_PREV(listelm, field); \
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
TAILQ_NEXT((elm), field) = (listelm); \
*(listelm)->field.tqe_prev = (elm); \
(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
QMD_TRACE_ELEM(&(elm)->field); \
QMD_TRACE_ELEM(&(listelm)->field); \
} while (0)
#define TAILQ_INSERT_HEAD(head, elm, field) do { \
QMD_TAILQ_CHECK_HEAD(head, field); \
if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
TAILQ_FIRST((head))->field.tqe_prev = \
&TAILQ_NEXT((elm), field); \
else \
(head)->tqh_last = &TAILQ_NEXT((elm), field); \
TAILQ_FIRST((head)) = (elm); \
(elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
QMD_TRACE_HEAD(head); \
QMD_TRACE_ELEM(&(elm)->field); \
} while (0)
#define TAILQ_INSERT_TAIL(head, elm, field) do { \
QMD_TAILQ_CHECK_TAIL(head, field); \
TAILQ_NEXT((elm), field) = NULL; \
(elm)->field.tqe_prev = (head)->tqh_last; \
*(head)->tqh_last = (elm); \
(head)->tqh_last = &TAILQ_NEXT((elm), field); \
QMD_TRACE_HEAD(head); \
QMD_TRACE_ELEM(&(elm)->field); \
} while (0)
#define TAILQ_LAST(head, headname) \
(*(((struct headname *)((head)->tqh_last))->tqh_last))
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
#define TAILQ_PREV(elm, headname, field) \
(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
#define TAILQ_REMOVE(head, elm, field) do { \
QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \
QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \
QMD_TAILQ_CHECK_NEXT(elm, field); \
QMD_TAILQ_CHECK_PREV(elm, field); \
if ((TAILQ_NEXT((elm), field)) != NULL) \
TAILQ_NEXT((elm), field)->field.tqe_prev = \
(elm)->field.tqe_prev; \
else { \
(head)->tqh_last = (elm)->field.tqe_prev; \
QMD_TRACE_HEAD(head); \
} \
*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
TRASHIT(*oldnext); \
TRASHIT(*oldprev); \
QMD_TRACE_ELEM(&(elm)->field); \
} while (0)
#define TAILQ_SWAP(head1, head2, type, field) do { \
QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \
QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last; \
(head1)->tqh_first = (head2)->tqh_first; \
(head1)->tqh_last = (head2)->tqh_last; \
(head2)->tqh_first = swap_first; \
(head2)->tqh_last = swap_last; \
if ((swap_first = (head1)->tqh_first) != NULL) \
swap_first->field.tqe_prev = &(head1)->tqh_first; \
else \
(head1)->tqh_last = &(head1)->tqh_first; \
if ((swap_first = (head2)->tqh_first) != NULL) \
swap_first->field.tqe_prev = &(head2)->tqh_first; \
else \
(head2)->tqh_last = &(head2)->tqh_first; \
} while (0)
#endif /* !_SYS_QUEUE_H_ */
# 820 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/queue.h" 3 4
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 2 3 4
struct thread;
/*
* Definitions for sysctl call. The sysctl call uses a hierarchical name
* for objects that can be examined or modified. The name is expressed as
* a sequence of integers. Like a file path name, the meaning of each
* component depends on its place in the hierarchy. The top-level and kern
* identifiers are defined here, and other identifiers are defined in the
* respective subsystem header files.
*/
#define CTL_MAXNAME 24 /* largest number of components supported */
/*
* Each subsystem defined by sysctl defines a list of variables
* for that subsystem. Each name is either a node with further
* levels defined below it, or it is a leaf of some particular
* type given below. Each sysctl level defines a set of name/type
* pairs to be used by sysctl(8) in manipulating the subsystem.
*/
struct ctlname {
char *ctl_name; /* subsystem name */
int ctl_type; /* type of name */
};
#define CTLTYPE 0xf /* mask for the type */
#define CTLTYPE_NODE 1 /* name is a node */
#define CTLTYPE_INT 2 /* name describes an integer */
#define CTLTYPE_STRING 3 /* name describes a string */
#define CTLTYPE_S64 4 /* name describes a signed 64-bit number */
#define CTLTYPE_OPAQUE 5 /* name describes a structure */
#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */
#define CTLTYPE_UINT 6 /* name describes an unsigned integer */
#define CTLTYPE_LONG 7 /* name describes a long */
#define CTLTYPE_ULONG 8 /* name describes an unsigned long */
#define CTLTYPE_U64 9 /* name describes an unsigned 64-bit number */
#define CTLTYPE_U8 0xa /* name describes an unsigned 8-bit number */
#define CTLTYPE_U16 0xb /* name describes an unsigned 16-bit number */
#define CTLTYPE_S8 0xc /* name describes a signed 8-bit number */
#define CTLTYPE_S16 0xd /* name describes a signed 16-bit number */
#define CTLTYPE_S32 0xe /* name describes a signed 32-bit number */
#define CTLTYPE_U32 0xf /* name describes an unsigned 32-bit number */
#define CTLFLAG_RD 0x80000000 /* Allow reads of variable */
#define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */
#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
#define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */
#define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */
#define CTLFLAG_DYN 0x02000000 /* Dynamic oid - can be freed */
#define CTLFLAG_SKIP 0x01000000 /* Skip this sysctl when listing */
#define CTLMASK_SECURE 0x00F00000 /* Secure level */
#define CTLFLAG_TUN 0x00080000 /* Default value is loaded from getenv() */
#define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN)
#define CTLFLAG_RWTUN (CTLFLAG_RW|CTLFLAG_TUN)
#define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */
#define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */
#define CTLFLAG_DYING 0x00010000 /* Oid is being removed */
#define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */
#define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */
#define CTLFLAG_STATS 0x00002000 /* Statistics, not a tuneable */
#define CTLFLAG_NOFETCH 0x00001000 /* Don't fetch tunable from getenv() */
#define CTLFLAG_CAPRW (CTLFLAG_CAPRD|CTLFLAG_CAPWR)
/*
* Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1.
*
* Secure when the securelevel is raised to at least N.
*/
#define CTLSHIFT_SECURE 20
#define CTLFLAG_SECURE1 (CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE))
#define CTLFLAG_SECURE2 (CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE))
#define CTLFLAG_SECURE3 (CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE))
/*
* USE THIS instead of a hardwired number from the categories below
* to get dynamically assigned sysctl entries using the linker-set
* technology. This is the way nearly all new sysctl variables should
* be implemented.
* e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
*/
#define OID_AUTO (-1)
/*
* The starting number for dynamically-assigned entries. WARNING!
* ALL static sysctl entries should have numbers LESS than this!
*/
#define CTL_AUTO_START 0x100
#ifdef _KERNEL
#if 0 /* expanded by -frewrite-includes */
#include <sys/linker_set.h>
#endif /* expanded by -frewrite-includes */
# 130 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
# 131 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
#ifdef KLD_MODULE
/* XXX allow overspecification of type in external kernel modules */
#define SYSCTL_CT_ASSERT_MASK CTLTYPE
#else
# 136 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
#define SYSCTL_CT_ASSERT_MASK 0
#endif
# 138 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \
intmax_t arg2, struct sysctl_req *req
/* definitions for sysctl_req 'lock' member */
#define REQ_UNWIRED 1
#define REQ_WIRED 2
/* definitions for sysctl_req 'flags' member */
#if defined(__amd64__) || defined(__powerpc64__) ||\
(defined(__mips__) && defined(__mips_n64))
#define SCTL_MASK32 1 /* 32 bit emulation */
#endif
# 151 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
#ifdef COMPAT_CHERIABI
#define SCTL_CHERIABI 2 /* CheriABI support */
#endif
# 154 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
/*
* This describes the access space for a sysctl request. This is needed
* so that we can use the interface from the kernel or from user-space.
*/
struct sysctl_req {
struct thread *td; /* used for access checking */
int lock; /* wiring state */
void *oldptr;
size_t oldlen;
size_t oldidx;
int (*oldfunc)(struct sysctl_req *, const void *, size_t);
void *newptr;
size_t newlen;
size_t newidx;
int (*newfunc)(struct sysctl_req *, void *, size_t);
size_t validlen;
int flags;
};
SLIST_HEAD(sysctl_oid_list, sysctl_oid);
/*
* This describes one "oid" in the MIB tree. Potentially more nodes can
* be hidden behind it, expanded by the handler.
*/
struct sysctl_oid {
struct sysctl_oid_list oid_children;
struct sysctl_oid_list *oid_parent;
SLIST_ENTRY(sysctl_oid) oid_link;
int oid_number;
u_int oid_kind;
void *oid_arg1;
intmax_t oid_arg2;
const char *oid_name;
int (*oid_handler)(SYSCTL_HANDLER_ARGS);
const char *oid_fmt;
int oid_refcnt;
u_int oid_running;
const char *oid_descr;
};
#define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l)
#define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l)
#define SYSCTL_OUT_STR(r, p) (r->oldfunc)(r, p, strlen(p) + 1)
int sysctl_handle_bool(SYSCTL_HANDLER_ARGS);
int sysctl_handle_8(SYSCTL_HANDLER_ARGS);
int sysctl_handle_16(SYSCTL_HANDLER_ARGS);
int sysctl_handle_32(SYSCTL_HANDLER_ARGS);
int sysctl_handle_64(SYSCTL_HANDLER_ARGS);
int sysctl_handle_int(SYSCTL_HANDLER_ARGS);
int sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS);
int sysctl_handle_long(SYSCTL_HANDLER_ARGS);
int sysctl_handle_string(SYSCTL_HANDLER_ARGS);
int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS);
int sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS);
int sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS);
int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS);
int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS);
int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS);
int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS);
int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS);
/*
* These functions are used to add/remove an oid from the mib.
*/
void sysctl_register_oid(struct sysctl_oid *oidp);
void sysctl_unregister_oid(struct sysctl_oid *oidp);
/* Declare a static oid to allow child oids to be added to it. */
#define SYSCTL_DECL(name) \
extern struct sysctl_oid sysctl__##name
/* Hide these in macros. */
#define SYSCTL_CHILDREN(oid_ptr) (&(oid_ptr)->oid_children)
#define SYSCTL_PARENT(oid_ptr) \
(((oid_ptr)->oid_parent != &sysctl__children) ? \
__containerof((oid_ptr)->oid_parent, struct sysctl_oid, \
oid_children) : (struct sysctl_oid *)NULL)
#define SYSCTL_STATIC_CHILDREN(oid_name) (&sysctl__##oid_name.oid_children)
/* === Structs and macros related to context handling. === */
/* All dynamically created sysctls can be tracked in a context list. */
struct sysctl_ctx_entry {
struct sysctl_oid *entry;
TAILQ_ENTRY(sysctl_ctx_entry) link;
};
TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define SYSCTL_NODE_CHILDREN(parent, name) \
sysctl__##parent##_##name.oid_children
#ifndef NO_SYSCTL_DESCR
#define __DESCR(d) d
#else
# 254 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
#define __DESCR(d) ""
#endif
# 256 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
/* This macro is only for internal use */
#define SYSCTL_OID_RAW(id, parent_child_head, nbr, name, kind, a1, a2, handler, fmt, descr) \
struct sysctl_oid id = { \
.oid_parent = (parent_child_head), \
.oid_children = SLIST_HEAD_INITIALIZER(&id.oid_children), \
.oid_number = (nbr), \
.oid_kind = (kind), \
.oid_arg1 = (a1), \
.oid_arg2 = (a2), \
.oid_name = (name), \
.oid_handler = (handler), \
.oid_fmt = (fmt), \
.oid_descr = __DESCR(descr) \
}; \
DATA_SET(sysctl_set, id)
/* This constructs a static "raw" MIB oid. */
#define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
static SYSCTL_OID_RAW(sysctl__##parent##_##name, \
SYSCTL_CHILDREN(&sysctl__##parent), \
nbr, #name, kind, a1, a2, handler, fmt, descr)
/* This constructs a global "raw" MIB oid. */
#define SYSCTL_OID_GLOBAL(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
SYSCTL_OID_RAW(sysctl__##parent##_##name, \
SYSCTL_CHILDREN(&sysctl__##parent), \
nbr, #name, kind, a1, a2, handler, fmt, descr)
#define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, __DESCR(descr))
/* This constructs a root node from which other nodes can hang. */
#define SYSCTL_ROOT_NODE(nbr, name, access, handler, descr) \
SYSCTL_OID_RAW(sysctl___##name, &sysctl__children, \
nbr, #name, CTLTYPE_NODE|(access), NULL, 0, \
handler, "N", descr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE)
/* This constructs a node from which other oids can hang. */
#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
SYSCTL_OID_GLOBAL(parent, nbr, name, CTLTYPE_NODE|(access), \
NULL, 0, handler, "N", descr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE)
#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \
({ \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE); \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \
NULL, 0, handler, "N", __DESCR(descr)); \
})
#define SYSCTL_ADD_ROOT_NODE(ctx, nbr, name, access, handler, descr) \
({ \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE); \
sysctl_add_oid(ctx, &sysctl__children, nbr, name, \
CTLTYPE_NODE|(access), \
NULL, 0, handler, "N", __DESCR(descr)); \
})
/* Oid for a string. len can be 0 to indicate '\0' termination. */
#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \
arg, len, sysctl_handle_string, "A", descr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING)
#define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \
({ \
char *__arg = (arg); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING); \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access), \
__arg, len, sysctl_handle_string, "A", __DESCR(descr)); \
})
/* Oid for a bool. If ptr is NULL, val is returned. */
#define SYSCTL_NULL_BOOL_PTR ((bool *)NULL)
#define SYSCTL_BOOL(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_U8 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_bool, "CU", descr); \
CTASSERT(((access) & CTLTYPE) == 0 && \
sizeof(bool) == sizeof(*(ptr)))
#define SYSCTL_ADD_BOOL(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
bool *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_U8 | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_bool, "CU", __DESCR(descr)); \
})
/* Oid for a signed 8-bit int. If ptr is NULL, val is returned. */
#define SYSCTL_NULL_S8_PTR ((int8_t *)NULL)
#define SYSCTL_S8(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_S8 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_8, "C", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S8) && \
sizeof(int8_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_S8(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
int8_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S8); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_S8 | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_8, "C", __DESCR(descr)); \
})
/* Oid for an unsigned 8-bit int. If ptr is NULL, val is returned. */
#define SYSCTL_NULL_U8_PTR ((uint8_t *)NULL)
#define SYSCTL_U8(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_U8 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_8, "CU", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U8) && \
sizeof(uint8_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_U8(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
uint8_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U8); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_U8 | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_8, "CU", __DESCR(descr)); \
})
/* Oid for a signed 16-bit int. If ptr is NULL, val is returned. */
#define SYSCTL_NULL_S16_PTR ((int16_t *)NULL)
#define SYSCTL_S16(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_S16 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_16, "S", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S16) && \
sizeof(int16_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_S16(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
int16_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S16); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_S16 | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_16, "S", __DESCR(descr)); \
})
/* Oid for an unsigned 16-bit int. If ptr is NULL, val is returned. */
#define SYSCTL_NULL_U16_PTR ((uint16_t *)NULL)
#define SYSCTL_U16(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_U16 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_16, "SU", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U16) && \
sizeof(uint16_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_U16(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
uint16_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U16); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_U16 | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_16, "SU", __DESCR(descr)); \
})
/* Oid for a signed 32-bit int. If ptr is NULL, val is returned. */
#define SYSCTL_NULL_S32_PTR ((int32_t *)NULL)
#define SYSCTL_S32(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_S32 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_32, "I", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S32) && \
sizeof(int32_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_S32(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
int32_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S32); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_S32 | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_32, "I", __DESCR(descr)); \
})
/* Oid for an unsigned 32-bit int. If ptr is NULL, val is returned. */
#define SYSCTL_NULL_U32_PTR ((uint32_t *)NULL)
#define SYSCTL_U32(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_U32 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_32, "IU", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U32) && \
sizeof(uint32_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_U32(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
uint32_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U32); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_U32 | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_32, "IU", __DESCR(descr)); \
})
/* Oid for a signed 64-bit int. If ptr is NULL, val is returned. */
#define SYSCTL_NULL_S64_PTR ((int64_t *)NULL)
#define SYSCTL_S64(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_64, "Q", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64) && \
sizeof(int64_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_S64(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
int64_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_64, "Q", __DESCR(descr)); \
})
/* Oid for an unsigned 64-bit int. If ptr is NULL, val is returned. */
#define SYSCTL_NULL_U64_PTR ((uint64_t *)NULL)
#define SYSCTL_U64(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_64, "QU", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64) && \
sizeof(uint64_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_U64(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
uint64_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_64, "QU", __DESCR(descr)); \
})
/* Oid for an int. If ptr is SYSCTL_NULL_INT_PTR, val is returned. */
#define SYSCTL_NULL_INT_PTR ((int *)NULL)
#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_int, "I", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT) && \
sizeof(int) == sizeof(*(ptr)))
#define SYSCTL_ADD_INT(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
int *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_int, "I", __DESCR(descr)); \
})
/* Oid for an unsigned int. If ptr is NULL, val is returned. */
#define SYSCTL_NULL_UINT_PTR ((unsigned *)NULL)
#define SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_int, "IU", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_UINT) && \
sizeof(unsigned) == sizeof(*(ptr)))
#define SYSCTL_ADD_UINT(ctx, parent, nbr, name, access, ptr, val, descr) \
({ \
unsigned *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_UINT); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \
__ptr, val, sysctl_handle_int, "IU", __DESCR(descr)); \
})
/* Oid for a long. The pointer must be non NULL. */
#define SYSCTL_NULL_LONG_PTR ((long *)NULL)
#define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_LONG | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_long, "L", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_LONG) && \
sizeof(long) == sizeof(*(ptr)))
#define SYSCTL_ADD_LONG(ctx, parent, nbr, name, access, ptr, descr) \
({ \
long *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_LONG); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_LONG | CTLFLAG_MPSAFE | (access), \
__ptr, 0, sysctl_handle_long, "L", __DESCR(descr)); \
})
/* Oid for an unsigned long. The pointer must be non NULL. */
#define SYSCTL_NULL_ULONG_PTR ((unsigned long *)NULL)
#define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_long, "LU", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG) && \
sizeof(unsigned long) == sizeof(*(ptr)))
#define SYSCTL_ADD_ULONG(ctx, parent, nbr, name, access, ptr, descr) \
({ \
unsigned long *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \
__ptr, 0, sysctl_handle_long, "LU", __DESCR(descr)); \
})
/* Oid for a quad. The pointer must be non NULL. */
#define SYSCTL_NULL_QUAD_PTR ((int64_t *)NULL)
#define SYSCTL_QUAD(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_64, "Q", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64) && \
sizeof(int64_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_QUAD(ctx, parent, nbr, name, access, ptr, descr) \
({ \
int64_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_S64 | CTLFLAG_MPSAFE | (access), \
__ptr, 0, sysctl_handle_64, "Q", __DESCR(descr)); \
})
#define SYSCTL_NULL_UQUAD_PTR ((uint64_t *)NULL)
#define SYSCTL_UQUAD(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
ptr, val, sysctl_handle_64, "QU", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64) && \
sizeof(uint64_t) == sizeof(*(ptr)))
#define SYSCTL_ADD_UQUAD(ctx, parent, nbr, name, access, ptr, descr) \
({ \
uint64_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
__ptr, 0, sysctl_handle_64, "QU", __DESCR(descr)); \
})
/* Oid for a CPU dependent variable */
#define SYSCTL_ADD_UAUTO(ctx, parent, nbr, name, access, ptr, descr) \
({ \
struct sysctl_oid *__ret; \
CTASSERT((sizeof(uint64_t) == sizeof(*(ptr)) || \
sizeof(unsigned) == sizeof(*(ptr))) && \
((access) & CTLTYPE) == 0); \
if (sizeof(uint64_t) == sizeof(*(ptr))) { \
__ret = sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
(ptr), 0, sysctl_handle_64, "QU", \
__DESCR(descr)); \
} else { \
__ret = sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_UINT | CTLFLAG_MPSAFE | (access), \
(ptr), 0, sysctl_handle_int, "IU", \
__DESCR(descr)); \
} \
__ret; \
})
/* Oid for a 64-bit unsigned counter(9). The pointer must be non NULL. */
#define SYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
(ptr), 0, sysctl_handle_counter_u64, "QU", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64) && \
sizeof(counter_u64_t) == sizeof(*(ptr)) && \
sizeof(uint64_t) == sizeof(**(ptr)))
#define SYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, descr) \
({ \
counter_u64_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
__ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \
})
/* Oid for an array of counter(9)s. The pointer and length must be non zero. */
#define SYSCTL_COUNTER_U64_ARRAY(parent, nbr, name, access, ptr, len, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \
(ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \
CTASSERT((((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) && \
sizeof(counter_u64_t) == sizeof(*(ptr)) && \
sizeof(uint64_t) == sizeof(**(ptr)))
#define SYSCTL_ADD_COUNTER_U64_ARRAY(ctx, parent, nbr, name, access, \
ptr, len, descr) \
({ \
counter_u64_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \
__ptr, len, sysctl_handle_counter_u64_array, "S", \
__DESCR(descr)); \
})
/* Oid for an opaque object. Specified by a pointer and a length. */
#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
ptr, len, sysctl_handle_opaque, fmt, descr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE)
#define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr) \
({ \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
ptr, len, sysctl_handle_opaque, fmt, __DESCR(descr)); \
})
/* Oid for a struct. Specified by a pointer and a type. */
#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \
SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
ptr, sizeof(struct type), sysctl_handle_opaque, \
"S," #type, descr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE)
#define SYSCTL_ADD_STRUCT(ctx, parent, nbr, name, access, ptr, type, descr) \
({ \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
(ptr), sizeof(struct type), \
sysctl_handle_opaque, "S," #type, __DESCR(descr)); \
})
/* Oid for a procedure. Specified by a pointer and an arg. */
#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
SYSCTL_OID(parent, nbr, name, (access), \
ptr, arg, handler, fmt, descr); \
CTASSERT(((access) & CTLTYPE) != 0)
#define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
({ \
CTASSERT(((access) & CTLTYPE) != 0); \
sysctl_add_oid(ctx, parent, nbr, name, (access), \
(ptr), (arg), (handler), (fmt), __DESCR(descr)); \
})
/* Oid to handle limits on uma(9) zone specified by pointer. */
#define SYSCTL_UMA_MAX(parent, nbr, name, access, ptr, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \
(ptr), 0, sysctl_handle_uma_zone_max, "I", descr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT)
#define SYSCTL_ADD_UMA_MAX(ctx, parent, nbr, name, access, ptr, descr) \
({ \
uma_zone_t __ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \
__ptr, 0, sysctl_handle_uma_zone_max, "I", __DESCR(descr)); \
})
/* Oid to obtain current use of uma(9) zone specified by pointer. */
#define SYSCTL_UMA_CUR(parent, nbr, name, access, ptr, descr) \
SYSCTL_OID(parent, nbr, name, \
CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \
(ptr), 0, sysctl_handle_uma_zone_cur, "I", descr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT)
#define SYSCTL_ADD_UMA_CUR(ctx, parent, nbr, name, access, ptr, descr) \
({ \
uma_zone_t __ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_INT); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \
__ptr, 0, sysctl_handle_uma_zone_cur, "I", __DESCR(descr)); \
})
/*
* A macro to generate a read-only sysctl to indicate the presence of optional
* kernel features.
*/
#define FEATURE(name, desc) \
SYSCTL_INT(_kern_features, OID_AUTO, name, CTLFLAG_RD | CTLFLAG_CAPRD, \
SYSCTL_NULL_INT_PTR, 1, desc)
#endif /* _KERNEL */
# 786 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
/*
* Top-level identifiers
*/
#define CTL_UNSPEC 0 /* unused */
#define CTL_KERN 1 /* "high kernel": proc, limits */
#define CTL_VM 2 /* virtual memory */
#define CTL_VFS 3 /* filesystem, mount type is next */
#define CTL_NET 4 /* network, see socket.h */
#define CTL_DEBUG 5 /* debugging parameters */
#define CTL_HW 6 /* generic cpu/io */
#define CTL_MACHDEP 7 /* machine dependent */
#define CTL_USER 8 /* user-level */
#define CTL_P1003_1B 9 /* POSIX 1003.1B */
/*
* CTL_KERN identifiers
*/
#define KERN_OSTYPE 1 /* string: system version */
#define KERN_OSRELEASE 2 /* string: system release */
#define KERN_OSREV 3 /* int: system revision */
#define KERN_VERSION 4 /* string: compile time info */
#define KERN_MAXVNODES 5 /* int: max vnodes */
#define KERN_MAXPROC 6 /* int: max processes */
#define KERN_MAXFILES 7 /* int: max open files */
#define KERN_ARGMAX 8 /* int: max arguments to exec */
#define KERN_SECURELVL 9 /* int: system security level */
#define KERN_HOSTNAME 10 /* string: hostname */
#define KERN_HOSTID 11 /* int: host identifier */
#define KERN_CLOCKRATE 12 /* struct: struct clockrate */
#define KERN_VNODE 13 /* struct: vnode structures */
#define KERN_PROC 14 /* struct: process entries */
#define KERN_FILE 15 /* struct: file entries */
#define KERN_PROF 16 /* node: kernel profiling info */
#define KERN_POSIX1 17 /* int: POSIX.1 version */
#define KERN_NGROUPS 18 /* int: # of supplemental group ids */
#define KERN_JOB_CONTROL 19 /* int: is job control available */
#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
#define KERN_NISDOMAINNAME 22 /* string: YP domain name */
#define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */
#define KERN_OSRELDATE 24 /* int: kernel release date */
#define KERN_NTP_PLL 25 /* node: NTP PLL control */
#define KERN_BOOTFILE 26 /* string: name of booted kernel */
#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
#define KERN_DUMPDEV 29 /* struct cdev *: device to dump on */
#define KERN_IPC 30 /* node: anything related to IPC */
#define KERN_DUMMY 31 /* unused */
#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
#define KERN_USRSTACK 33 /* int: address of USRSTACK */
#define KERN_LOGSIGEXIT 34 /* int: do we log sigexit procs? */
#define KERN_IOV_MAX 35 /* int: value of UIO_MAXIOV */
#define KERN_HOSTUUID 36 /* string: host UUID identifier */
#define KERN_ARND 37 /* int: from arc4rand() */
#define KERN_MAXPHYS 38 /* int: MAXPHYS value */
/*
* KERN_PROC subtypes
*/
#define KERN_PROC_ALL 0 /* everything */
#define KERN_PROC_PID 1 /* by process id */
#define KERN_PROC_PGRP 2 /* by process group id */
#define KERN_PROC_SESSION 3 /* by session of pid */
#define KERN_PROC_TTY 4 /* by controlling tty */
#define KERN_PROC_UID 5 /* by effective uid */
#define KERN_PROC_RUID 6 /* by real uid */
#define KERN_PROC_ARGS 7 /* get/set arguments/proctitle */
#define KERN_PROC_PROC 8 /* only return procs */
#define KERN_PROC_SV_NAME 9 /* get syscall vector name */
#define KERN_PROC_RGID 10 /* by real group id */
#define KERN_PROC_GID 11 /* by effective group id */
#define KERN_PROC_PATHNAME 12 /* path to executable */
#define KERN_PROC_OVMMAP 13 /* Old VM map entries for process */
#define KERN_PROC_OFILEDESC 14 /* Old file descriptors for process */
#define KERN_PROC_KSTACK 15 /* Kernel stacks for process */
#define KERN_PROC_INC_THREAD 0x10 /*
* modifier for pid, pgrp, tty,
* uid, ruid, gid, rgid and proc
* This effectively uses 16-31
*/
#define KERN_PROC_VMMAP 32 /* VM map entries for process */
#define KERN_PROC_FILEDESC 33 /* File descriptors for process */
#define KERN_PROC_GROUPS 34 /* process groups */
#define KERN_PROC_ENV 35 /* get environment */
#define KERN_PROC_AUXV 36 /* get ELF auxiliary vector */
#define KERN_PROC_RLIMIT 37 /* process resource limits */
#define KERN_PROC_PS_STRINGS 38 /* get ps_strings location */
#define KERN_PROC_UMASK 39 /* process umask */
#define KERN_PROC_OSREL 40 /* osreldate for process binary */
#define KERN_PROC_SIGTRAMP 41 /* signal trampoline location */
#define KERN_PROC_CWD 42 /* process current working directory */
#define KERN_PROC_NFDS 43 /* number of open file descriptors */
#define KERN_PROC_SBCLASSES 44 /* get sandbox classes */
#define KERN_PROC_SBMETHODS 45 /* get sandbox methods */
#define KERN_PROC_SBOBJECTS 46 /* get sandbox objects */
/*
* KERN_IPC identifiers
*/
#define KIPC_MAXSOCKBUF 1 /* int: max size of a socket buffer */
#define KIPC_SOCKBUF_WASTE 2 /* int: wastage factor in sockbuf */
#define KIPC_SOMAXCONN 3 /* int: max length of connection q */
#define KIPC_MAX_LINKHDR 4 /* int: max length of link header */
#define KIPC_MAX_PROTOHDR 5 /* int: max length of network header */
#define KIPC_MAX_HDR 6 /* int: max total length of headers */
#define KIPC_MAX_DATALEN 7 /* int: max length of data? */
/*
* CTL_HW identifiers
*/
#define HW_MACHINE 1 /* string: machine class */
#define HW_MODEL 2 /* string: specific machine model */
#define HW_NCPU 3 /* int: number of cpus */
#define HW_BYTEORDER 4 /* int: machine byte order */
#define HW_PHYSMEM 5 /* int: total memory */
#define HW_USERMEM 6 /* int: non-kernel memory */
#define HW_PAGESIZE 7 /* int: software page size */
#define HW_DISKNAMES 8 /* strings: disk drive names */
#define HW_DISKSTATS 9 /* struct: diskstats[] */
#define HW_FLOATINGPT 10 /* int: has HW floating point? */
#define HW_MACHINE_ARCH 11 /* string: machine architecture */
#define HW_REALMEM 12 /* int: 'real' memory */
/*
* CTL_USER definitions
*/
#define USER_CS_PATH 1 /* string: _CS_PATH */
#define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */
#define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */
#define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */
#define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */
#define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */
#define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */
#define USER_LINE_MAX 8 /* int: LINE_MAX */
#define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */
#define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */
#define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */
#define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */
#define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */
#define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */
#define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */
#define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */
#define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */
#define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */
#define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */
#define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */
#define CTL_P1003_1B_ASYNCHRONOUS_IO 1 /* boolean */
#define CTL_P1003_1B_MAPPED_FILES 2 /* boolean */
#define CTL_P1003_1B_MEMLOCK 3 /* boolean */
#define CTL_P1003_1B_MEMLOCK_RANGE 4 /* boolean */
#define CTL_P1003_1B_MEMORY_PROTECTION 5 /* boolean */
#define CTL_P1003_1B_MESSAGE_PASSING 6 /* boolean */
#define CTL_P1003_1B_PRIORITIZED_IO 7 /* boolean */
#define CTL_P1003_1B_PRIORITY_SCHEDULING 8 /* boolean */
#define CTL_P1003_1B_REALTIME_SIGNALS 9 /* boolean */
#define CTL_P1003_1B_SEMAPHORES 10 /* boolean */
#define CTL_P1003_1B_FSYNC 11 /* boolean */
#define CTL_P1003_1B_SHARED_MEMORY_OBJECTS 12 /* boolean */
#define CTL_P1003_1B_SYNCHRONIZED_IO 13 /* boolean */
#define CTL_P1003_1B_TIMERS 14 /* boolean */
#define CTL_P1003_1B_AIO_LISTIO_MAX 15 /* int */
#define CTL_P1003_1B_AIO_MAX 16 /* int */
#define CTL_P1003_1B_AIO_PRIO_DELTA_MAX 17 /* int */
#define CTL_P1003_1B_DELAYTIMER_MAX 18 /* int */
#define CTL_P1003_1B_MQ_OPEN_MAX 19 /* int */
#define CTL_P1003_1B_PAGESIZE 20 /* int */
#define CTL_P1003_1B_RTSIG_MAX 21 /* int */
#define CTL_P1003_1B_SEM_NSEMS_MAX 22 /* int */
#define CTL_P1003_1B_SEM_VALUE_MAX 23 /* int */
#define CTL_P1003_1B_SIGQUEUE_MAX 24 /* int */
#define CTL_P1003_1B_TIMER_MAX 25 /* int */
#define CTL_P1003_1B_MAXID 26
#ifdef _KERNEL
/*
* Declare some common oids.
*/
extern struct sysctl_oid_list sysctl__children;
SYSCTL_DECL(_kern);
SYSCTL_DECL(_kern_features);
SYSCTL_DECL(_kern_ipc);
SYSCTL_DECL(_kern_proc);
SYSCTL_DECL(_kern_sched);
SYSCTL_DECL(_kern_sched_stats);
SYSCTL_DECL(_sysctl);
SYSCTL_DECL(_vm);
SYSCTL_DECL(_vm_stats);
SYSCTL_DECL(_vm_stats_misc);
SYSCTL_DECL(_vfs);
SYSCTL_DECL(_net);
SYSCTL_DECL(_debug);
SYSCTL_DECL(_debug_sizeof);
SYSCTL_DECL(_dev);
SYSCTL_DECL(_hw);
SYSCTL_DECL(_hw_bus);
SYSCTL_DECL(_hw_bus_devices);
SYSCTL_DECL(_hw_bus_info);
SYSCTL_DECL(_machdep);
SYSCTL_DECL(_user);
SYSCTL_DECL(_compat);
SYSCTL_DECL(_regression);
SYSCTL_DECL(_security);
SYSCTL_DECL(_security_bsd);
extern char machine[];
extern char osrelease[];
extern char ostype[];
extern char kern_ident[];
/* Dynamic oid handling */
struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist,
struct sysctl_oid_list *parent, int nbr, const char *name, int kind,
void *arg1, intmax_t arg2, int (*handler)(SYSCTL_HANDLER_ARGS),
const char *fmt, const char *descr);
int sysctl_remove_name(struct sysctl_oid *parent, const char *name, int del,
int recurse);
void sysctl_rename_oid(struct sysctl_oid *oidp, const char *name);
int sysctl_move_oid(struct sysctl_oid *oidp,
struct sysctl_oid_list *parent);
int sysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse);
int sysctl_ctx_init(struct sysctl_ctx_list *clist);
int sysctl_ctx_free(struct sysctl_ctx_list *clist);
struct sysctl_ctx_entry *sysctl_ctx_entry_add(struct sysctl_ctx_list *clist,
struct sysctl_oid *oidp);
struct sysctl_ctx_entry *sysctl_ctx_entry_find(struct sysctl_ctx_list *clist,
struct sysctl_oid *oidp);
int sysctl_ctx_entry_del(struct sysctl_ctx_list *clist,
struct sysctl_oid *oidp);
int kernel_sysctl(struct thread *td, int *name, u_int namelen, void *old,
size_t *oldlenp, void *new, size_t newlen, size_t *retval,
int flags);
int kernel_sysctlbyname(struct thread *td, char *name, void *old,
size_t *oldlenp, void *new, size_t newlen, size_t *retval,
int flags);
int userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
size_t *oldlenp, int inkernel, void *new, size_t newlen,
size_t *retval, int flags);
int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid,
int *nindx, struct sysctl_req *req);
void sysctl_wlock(void);
void sysctl_wunlock(void);
int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len);
struct sbuf;
struct sbuf *sbuf_new_for_sysctl(struct sbuf *, char *, int,
struct sysctl_req *);
#else /* !_KERNEL */
# 1037 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 1037 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
# 1038 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
__BEGIN_DECLS
int sysctl(const int *, u_int, void *, size_t *, const void *, size_t);
int sysctlbyname(const char *, void *, size_t *, const void *, size_t);
int sysctlnametomib(const char *, int *, size_t *);
__END_DECLS
#endif /* _KERNEL */
# 1045 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
#endif /* !_SYS_SYSCTL_H_ */
# 1047 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/sysctl.h" 3 4
# 40 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <sys/time.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 1 3 4
/*-
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
* $FreeBSD$
*/
#ifndef _SYS_TIME_H_
#define _SYS_TIME_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timeval.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/timespec.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of dst correction */
};
#define DST_NONE 0 /* not on dst */
#define DST_USA 1 /* USA style dst */
#define DST_AUST 2 /* Australian style dst */
#define DST_WET 3 /* Western European dst */
#define DST_MET 4 /* Middle European dst */
#define DST_EET 5 /* Eastern European dst */
#define DST_CAN 6 /* Canada */
#if __BSD_VISIBLE
struct bintime {
time_t sec;
uint64_t frac;
};
static __inline void
bintime_addx(struct bintime *_bt, uint64_t _x)
{
uint64_t _u;
_u = _bt->frac;
_bt->frac += _x;
if (_u > _bt->frac)
_bt->sec++;
}
static __inline void
bintime_add(struct bintime *_bt, const struct bintime *_bt2)
{
uint64_t _u;
_u = _bt->frac;
_bt->frac += _bt2->frac;
if (_u > _bt->frac)
_bt->sec++;
_bt->sec += _bt2->sec;
}
static __inline void
bintime_sub(struct bintime *_bt, const struct bintime *_bt2)
{
uint64_t _u;
_u = _bt->frac;
_bt->frac -= _bt2->frac;
if (_u < _bt->frac)
_bt->sec--;
_bt->sec -= _bt2->sec;
}
static __inline void
bintime_mul(struct bintime *_bt, u_int _x)
{
uint64_t _p1, _p2;
_p1 = (_bt->frac & 0xffffffffull) * _x;
_p2 = (_bt->frac >> 32) * _x + (_p1 >> 32);
_bt->sec *= _x;
_bt->sec += (_p2 >> 32);
_bt->frac = (_p2 << 32) | (_p1 & 0xffffffffull);
}
static __inline void
bintime_shift(struct bintime *_bt, int _exp)
{
if (_exp > 0) {
_bt->sec <<= _exp;
_bt->sec |= _bt->frac >> (64 - _exp);
_bt->frac <<= _exp;
} else if (_exp < 0) {
_bt->frac >>= -_exp;
_bt->frac |= (uint64_t)_bt->sec << (64 + _exp);
_bt->sec >>= -_exp;
}
}
#define bintime_clear(a) ((a)->sec = (a)->frac = 0)
#define bintime_isset(a) ((a)->sec || (a)->frac)
#define bintime_cmp(a, b, cmp) \
(((a)->sec == (b)->sec) ? \
((a)->frac cmp (b)->frac) : \
((a)->sec cmp (b)->sec))
#define SBT_1S ((sbintime_t)1 << 32)
#define SBT_1M (SBT_1S * 60)
#define SBT_1MS (SBT_1S / 1000)
#define SBT_1US (SBT_1S / 1000000)
#define SBT_1NS (SBT_1S / 1000000000)
#define SBT_MAX 0x7fffffffffffffffLL
static __inline int
sbintime_getsec(sbintime_t _sbt)
{
return (_sbt >> 32);
}
static __inline sbintime_t
bttosbt(const struct bintime _bt)
{
return (((sbintime_t)_bt.sec << 32) + (_bt.frac >> 32));
}
static __inline struct bintime
sbttobt(sbintime_t _sbt)
{
struct bintime _bt;
_bt.sec = _sbt >> 32;
_bt.frac = _sbt << 32;
return (_bt);
}
/*-
* Background information:
*
* When converting between timestamps on parallel timescales of differing
* resolutions it is historical and scientific practice to round down rather
* than doing 4/5 rounding.
*
* The date changes at midnight, not at noon.
*
* Even at 15:59:59.999999999 it's not four'o'clock.
*
* time_second ticks after N.999999999 not after N.4999999999
*/
static __inline void
bintime2timespec(const struct bintime *_bt, struct timespec *_ts)
{
_ts->tv_sec = _bt->sec;
_ts->tv_nsec = ((uint64_t)1000000000 *
(uint32_t)(_bt->frac >> 32)) >> 32;
}
static __inline void
timespec2bintime(const struct timespec *_ts, struct bintime *_bt)
{
_bt->sec = _ts->tv_sec;
/* 18446744073 = int(2^64 / 1000000000) */
_bt->frac = _ts->tv_nsec * (uint64_t)18446744073LL;
}
static __inline void
bintime2timeval(const struct bintime *_bt, struct timeval *_tv)
{
_tv->tv_sec = _bt->sec;
_tv->tv_usec = ((uint64_t)1000000 * (uint32_t)(_bt->frac >> 32)) >> 32;
}
static __inline void
timeval2bintime(const struct timeval *_tv, struct bintime *_bt)
{
_bt->sec = _tv->tv_sec;
/* 18446744073709 = int(2^64 / 1000000) */
_bt->frac = _tv->tv_usec * (uint64_t)18446744073709LL;
}
static __inline struct timespec
sbttots(sbintime_t _sbt)
{
struct timespec _ts;
_ts.tv_sec = _sbt >> 32;
_ts.tv_nsec = ((uint64_t)1000000000 * (uint32_t)_sbt) >> 32;
return (_ts);
}
static __inline sbintime_t
tstosbt(struct timespec _ts)
{
return (((sbintime_t)_ts.tv_sec << 32) +
(_ts.tv_nsec * (((uint64_t)1 << 63) / 500000000) >> 32));
}
static __inline struct timeval
sbttotv(sbintime_t _sbt)
{
struct timeval _tv;
_tv.tv_sec = _sbt >> 32;
_tv.tv_usec = ((uint64_t)1000000 * (uint32_t)_sbt) >> 32;
return (_tv);
}
static __inline sbintime_t
tvtosbt(struct timeval _tv)
{
return (((sbintime_t)_tv.tv_sec << 32) +
(_tv.tv_usec * (((uint64_t)1 << 63) / 500000) >> 32));
}
#endif /* __BSD_VISIBLE */
# 243 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#ifdef _KERNEL
/* Operations on timespecs */
#define timespecclear(tvp) ((tvp)->tv_sec = (tvp)->tv_nsec = 0)
#define timespecisset(tvp) ((tvp)->tv_sec || (tvp)->tv_nsec)
#define timespeccmp(tvp, uvp, cmp) \
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))
#define timespecadd(vvp, uvp) \
do { \
(vvp)->tv_sec += (uvp)->tv_sec; \
(vvp)->tv_nsec += (uvp)->tv_nsec; \
if ((vvp)->tv_nsec >= 1000000000) { \
(vvp)->tv_sec++; \
(vvp)->tv_nsec -= 1000000000; \
} \
} while (0)
#define timespecsub(vvp, uvp) \
do { \
(vvp)->tv_sec -= (uvp)->tv_sec; \
(vvp)->tv_nsec -= (uvp)->tv_nsec; \
if ((vvp)->tv_nsec < 0) { \
(vvp)->tv_sec--; \
(vvp)->tv_nsec += 1000000000; \
} \
} while (0)
/* Operations on timevals. */
#define timevalclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
#define timevalisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#define timevalcmp(tvp, uvp, cmp) \
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_usec cmp (uvp)->tv_usec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))
/* timevaladd and timevalsub are not inlined */
#endif /* _KERNEL */
# 284 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#ifndef _KERNEL /* NetBSD/OpenBSD compatible interfaces */
#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#define timercmp(tvp, uvp, cmp) \
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_usec cmp (uvp)->tv_usec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))
#define timeradd(tvp, uvp, vvp) \
do { \
(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
if ((vvp)->tv_usec >= 1000000) { \
(vvp)->tv_sec++; \
(vvp)->tv_usec -= 1000000; \
} \
} while (0)
#define timersub(tvp, uvp, vvp) \
do { \
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
if ((vvp)->tv_usec < 0) { \
(vvp)->tv_sec--; \
(vvp)->tv_usec += 1000000; \
} \
} while (0)
#endif
# 312 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
/*
* Names of the interval timers, and structure
* defining a timer setting.
*/
#define ITIMER_REAL 0
#define ITIMER_VIRTUAL 1
#define ITIMER_PROF 2
struct itimerval {
struct timeval it_interval; /* timer interval */
struct timeval it_value; /* current value */
};
/*
* Getkerninfo clock information structure
*/
struct clockinfo {
int hz; /* clock frequency */
int tick; /* micro-seconds per hz tick */
int spare;
int stathz; /* statistics clock frequency */
int profhz; /* profiling clock frequency */
};
/* These macros are also in time.h. */
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#define CLOCK_VIRTUAL 1
#define CLOCK_PROF 2
#define CLOCK_MONOTONIC 4
#define CLOCK_UPTIME 5 /* FreeBSD-specific. */
#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */
#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */
#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */
#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */
#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */
#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */
#define CLOCK_SECOND 13 /* FreeBSD-specific. */
#define CLOCK_THREAD_CPUTIME_ID 14
#define CLOCK_PROCESS_CPUTIME_ID 15
#endif
# 354 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#ifndef TIMER_ABSTIME
#define TIMER_RELTIME 0x0 /* relative timer */
#define TIMER_ABSTIME 0x1 /* absolute timer */
#endif
# 359 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#if __BSD_VISIBLE
#define CPUCLOCK_WHICH_PID 0
#define CPUCLOCK_WHICH_TID 1
#endif
# 364 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#ifdef _KERNEL
/*
* Kernel to clock driver interface.
*/
void inittodr(time_t base);
void resettodr(void);
extern volatile time_t time_second;
extern volatile time_t time_uptime;
extern struct bintime tc_tick_bt;
extern sbintime_t tc_tick_sbt;
extern struct bintime tick_bt;
extern sbintime_t tick_sbt;
extern int tc_precexp;
extern int tc_timepercentage;
extern struct bintime bt_timethreshold;
extern struct bintime bt_tickthreshold;
extern sbintime_t sbt_timethreshold;
extern sbintime_t sbt_tickthreshold;
/*
* Functions for looking at our clock: [get]{bin,nano,micro}[up]time()
*
* Functions without the "get" prefix returns the best timestamp
* we can produce in the given format.
*
* "bin" == struct bintime == seconds + 64 bit fraction of seconds.
* "nano" == struct timespec == seconds + nanoseconds.
* "micro" == struct timeval == seconds + microseconds.
*
* Functions containing "up" returns time relative to boot and
* should be used for calculating time intervals.
*
* Functions without "up" returns UTC time.
*
* Functions with the "get" prefix returns a less precise result
* much faster than the functions without "get" prefix and should
* be used where a precision of 1/hz seconds is acceptable or where
* performance is priority. (NB: "precision", _not_ "resolution" !)
*/
void binuptime(struct bintime *bt);
void nanouptime(struct timespec *tsp);
void microuptime(struct timeval *tvp);
static __inline sbintime_t
sbinuptime(void)
{
struct bintime _bt;
binuptime(&_bt);
return (bttosbt(_bt));
}
void bintime(struct bintime *bt);
void nanotime(struct timespec *tsp);
void microtime(struct timeval *tvp);
void getbinuptime(struct bintime *bt);
void getnanouptime(struct timespec *tsp);
void getmicrouptime(struct timeval *tvp);
static __inline sbintime_t
getsbinuptime(void)
{
struct bintime _bt;
getbinuptime(&_bt);
return (bttosbt(_bt));
}
void getbintime(struct bintime *bt);
void getnanotime(struct timespec *tsp);
void getmicrotime(struct timeval *tvp);
void getboottime(struct timeval *boottime);
void getboottimebin(struct bintime *boottimebin);
/* Other functions */
int itimerdecr(struct itimerval *itp, int usec);
int itimerfix(struct timeval *tv);
int ppsratecheck(struct timeval *, int *, int);
int ratecheck(struct timeval *, const struct timeval *);
void timevaladd(struct timeval *t1, const struct timeval *t2);
void timevalsub(struct timeval *t1, const struct timeval *t2);
int tvtohz(struct timeval *tv);
#define TC_DEFAULTPERC 5
#define BT2FREQ(bt) \
(((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \
((bt)->frac >> 1))
#define SBT2FREQ(sbt) ((SBT_1S + ((sbt) >> 1)) / (sbt))
#define FREQ2BT(freq, bt) \
{ \
(bt)->sec = 0; \
(bt)->frac = ((uint64_t)0x8000000000000000 / (freq)) << 1; \
}
#define TIMESEL(sbt, sbt2) \
(((sbt2) >= sbt_timethreshold) ? \
((*(sbt) = getsbinuptime()), 1) : ((*(sbt) = sbinuptime()), 0))
#else /* !_KERNEL */
# 472 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <time.h>
#endif /* expanded by -frewrite-includes */
# 472 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 1 3 4
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* 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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)time.h 8.3 (Berkeley) 1/21/94
*/
/*
* $FreeBSD$
*/
#ifndef _TIME_H_
#define _TIME_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 44 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
# 45 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 45 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 1 3 4
/*-
* Copyright (c) 2003 Marcel Moolenaar
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef NULL
#if !defined(__cplusplus)
#define NULL ((void *)0)
#else
# 34 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#if __cplusplus >= 201103L
#define NULL nullptr
#elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#define NULL __null
#else
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#if defined(__LP64__)
#define NULL (0L)
#else
# 42 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#define NULL 0
#endif /* __LP64__ */
# 44 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#endif /* __GNUG__ */
# 45 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#endif /* !__cplusplus */
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#endif
# 48 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
# 47 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE
/*
* Frequency of the clock ticks reported by times(). Deprecated - use
* sysconf(_SC_CLK_TCK) instead. (Removed in 1003.1-2001.)
*/
#define CLK_TCK 128
#endif
# 55 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
/* Frequency of the clock ticks reported by clock(). */
#define CLOCKS_PER_SEC 128
#ifndef _CLOCK_T_DECLARED
typedef __clock_t clock_t;
#define _CLOCK_T_DECLARED
#endif
# 63 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 68 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 73 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if __POSIX_VISIBLE >= 199309
/*
* New in POSIX 1003.1b-1993.
*/
#ifndef _CLOCKID_T_DECLARED
typedef __clockid_t clockid_t;
#define _CLOCKID_T_DECLARED
#endif
# 82 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#ifndef _TIMER_T_DECLARED
typedef __timer_t timer_t;
#define _TIMER_T_DECLARED
#endif
# 87 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/timespec.h>
#endif /* expanded by -frewrite-includes */
# 88 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
# 89 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#endif /* __POSIX_VISIBLE >= 199309 */
# 90 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if __POSIX_VISIBLE >= 200112
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t;
#define _PID_T_DECLARED
#endif
# 96 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#endif
# 97 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
/* These macros are also in sys/time.h. */
#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112
#define CLOCK_REALTIME 0
#ifdef __BSD_VISIBLE
#define CLOCK_VIRTUAL 1
#define CLOCK_PROF 2
#endif
# 105 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#define CLOCK_MONOTONIC 4
#define CLOCK_UPTIME 5 /* FreeBSD-specific. */
#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */
#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */
#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */
#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */
#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */
#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */
#define CLOCK_SECOND 13 /* FreeBSD-specific. */
#define CLOCK_THREAD_CPUTIME_ID 14
#define CLOCK_PROCESS_CPUTIME_ID 15
#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */
# 117 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112
#if __BSD_VISIBLE
#define TIMER_RELTIME 0x0 /* relative timer */
#endif
# 122 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#define TIMER_ABSTIME 0x1 /* absolute timer */
#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 */
# 124 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
struct tm {
int tm_sec; /* seconds after the minute [0-60] */
int tm_min; /* minutes after the hour [0-59] */
int tm_hour; /* hours since midnight [0-23] */
int tm_mday; /* day of the month [1-31] */
int tm_mon; /* months since January [0-11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday [0-6] */
int tm_yday; /* days since January 1 [0-365] */
int tm_isdst; /* Daylight Savings Time flag */
long tm_gmtoff; /* offset from UTC in seconds */
char *tm_zone; /* timezone abbreviation */
};
#if __POSIX_VISIBLE
extern char *tzname[];
#endif
# 142 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
__BEGIN_DECLS
char *asctime(const struct tm *);
clock_t clock(void);
char *ctime(const time_t *);
double difftime(time_t, time_t);
/* XXX missing: getdate() */
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
time_t mktime(struct tm *);
size_t strftime(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict);
time_t time(time_t *);
#if __POSIX_VISIBLE >= 200112
struct sigevent;
int timer_create(clockid_t, struct sigevent *__restrict, timer_t *__restrict);
int timer_delete(timer_t);
int timer_gettime(timer_t, struct itimerspec *);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const struct itimerspec *__restrict,
struct itimerspec *__restrict);
#endif
# 164 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if __POSIX_VISIBLE
void tzset(void);
#endif
# 167 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if __POSIX_VISIBLE >= 199309
int clock_getres(clockid_t, struct timespec *);
int clock_gettime(clockid_t, struct timespec *);
int clock_settime(clockid_t, const struct timespec *);
/* XXX missing: clock_nanosleep() */
int nanosleep(const struct timespec *, struct timespec *);
#endif /* __POSIX_VISIBLE >= 199309 */
# 175 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if __POSIX_VISIBLE >= 200112
int clock_getcpuclockid(pid_t, clockid_t *);
#endif
# 179 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if __POSIX_VISIBLE >= 199506
char *asctime_r(const struct tm *, char *);
char *ctime_r(const time_t *, char *);
struct tm *gmtime_r(const time_t *, struct tm *);
struct tm *localtime_r(const time_t *, struct tm *);
#endif
# 186 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if __XSI_VISIBLE
char *strptime(const char * __restrict, const char * __restrict,
struct tm * __restrict);
#endif
# 191 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if __BSD_VISIBLE
char *timezone(int, int); /* XXX XSI conflict */
void tzsetwall(void);
time_t timelocal(struct tm * const);
time_t timegm(struct tm * const);
int timer_oshandle_np(timer_t timerid);
#endif /* __BSD_VISIBLE */
# 199 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_time.h>
#endif /* expanded by -frewrite-includes */
# 201 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_time.h" 1 3 4
/*-
* Copyright (c) 2011, 2012 The FreeBSD Foundation
* All rights reserved.
*
* This software was developed by David Chisnall under sponsorship from
* the FreeBSD Foundation.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_time.h" 3 4
/*
* This file is included from both locale.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from locale.h.
*/
#ifndef _XLOCALE_LOCALE1_H
#define _XLOCALE_LOCALE1_H
size_t strftime_l(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict, locale_t) __strftimelike(3, 0);
#endif /* _XLOCALE_LOCALE1_H */
# 49 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_time.h" 3 4
#ifdef _XLOCALE_H_
#ifndef _XLOCALE_LOCALE2_H
#define _XLOCALE_LOCALE2_H
char *strptime_l(const char * __restrict, const char * __restrict,
struct tm * __restrict, locale_t);
#endif /* _XLOCALE_LOCALE2_H */
# 58 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_time.h" 3 4
#endif /* _XLOCALE_H_ */
# 59 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_time.h" 3 4
# 202 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 2 3 4
#endif
# 203 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
__END_DECLS
#endif /* !_TIME_H_ */
# 206 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/time.h" 3 4
# 473 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 474 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
# 475 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/select.h>
#endif /* expanded by -frewrite-includes */
# 475 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
# 476 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
__BEGIN_DECLS
int setitimer(int, const struct itimerval *, struct itimerval *);
int utimes(const char *, const struct timeval *);
#if __BSD_VISIBLE
int adjtime(const struct timeval *, struct timeval *);
int clock_getcpuclockid2(id_t, int, clockid_t *);
int futimes(int, const struct timeval *);
int futimesat(int, const char *, const struct timeval [2]);
int lutimes(const char *, const struct timeval *);
int settimeofday(const struct timeval *, const struct timezone *);
#endif
# 489 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#if __XSI_VISIBLE
int getitimer(int, struct itimerval *);
int gettimeofday(struct timeval *, struct timezone *);
#endif
# 494 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
__END_DECLS
#endif /* !_KERNEL */
# 498 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
#endif /* !_SYS_TIME_H_ */
# 500 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/time.h" 3 4
# 41 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <machine/cherireg.h>
#endif /* expanded by -frewrite-includes */
# 42 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 1 3 4
/*-
* Copyright (c) 2011-2016 Robert N. M. Watson
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _MIPS_INCLUDE_CHERIREG_H_
#define _MIPS_INCLUDE_CHERIREG_H_
/*
* The size of in-memory capabilities in bytes; minimum alignment is also
* assumed to be this size.
*/
#if defined(_MIPS_SZCAP) && (_MIPS_SZCAP != 128) && (_MIPS_SZCAP != 256)
#error "_MIPS_SZCAP defined but neither 128 nor 256"
#endif
# 41 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
#if defined(CPU_CHERI128) || (defined(_MIPS_SZCAP) && (_MIPS_SZCAP == 128))
#define CHERICAP_SIZE 16
#define CHERICAP_SHIFT 4
#else
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
#define CHERICAP_SIZE 32
#define CHERICAP_SHIFT 5
#endif
# 49 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
/*
* CHERI ISA-defined constants for capabilities -- suitable for inclusion from
* assembly source code.
*
* XXXRW: CHERI_UNSEALED is not currently considered part of the perms word,
* but perhaps it should be.
*/
#define CHERI_PERM_GLOBAL (1 << 0) /* 0x00000001 */
#define CHERI_PERM_EXECUTE (1 << 1) /* 0x00000002 */
#define CHERI_PERM_LOAD (1 << 2) /* 0x00000004 */
#define CHERI_PERM_STORE (1 << 3) /* 0x00000008 */
#define CHERI_PERM_LOAD_CAP (1 << 4) /* 0x00000010 */
#define CHERI_PERM_STORE_CAP (1 << 5) /* 0x00000020 */
#define CHERI_PERM_STORE_LOCAL_CAP (1 << 6) /* 0x00000040 */
#define CHERI_PERM_SEAL (1 << 7) /* 0x00000080 */
#define CHERI_PERM_RESERVED0 (1 << 8) /* 0x00000100 */
#define CHERI_PERM_RESERVED1 (1 << 9) /* 0x00000200 */
#define CHERI_PERM_SYSTEM_REGS (1 << 10) /* 0x00000400 */
/*
* User-defined permission bits.
*
* 256-bit CHERI has a substantially larger number of user-defined
* permissions.
*/
#define CHERI256_PERM_USER0 (1 << 15) /* 0x00008000 */
#define CHERI256_PERM_USER1 (1 << 16) /* 0x00010000 */
#define CHERI256_PERM_USER2 (1 << 17) /* 0x00020000 */
#define CHERI256_PERM_USER3 (1 << 18) /* 0x00040000 */
#define CHERI256_PERM_USER4 (1 << 19) /* 0x00080000 */
#define CHERI256_PERM_USER5 (1 << 20) /* 0x00100000 */
#define CHERI256_PERM_USER6 (1 << 21) /* 0x00200000 */
#define CHERI256_PERM_USER7 (1 << 22) /* 0x00400000 */
#define CHERI256_PERM_USER8 (1 << 23) /* 0x00800000 */
#define CHERI256_PERM_USER9 (1 << 24) /* 0x01000000 */
#define CHERI256_PERM_USER10 (1 << 25) /* 0x02000000 */
#define CHERI256_PERM_USER11 (1 << 26) /* 0x04000000 */
#define CHERI256_PERM_USER12 (1 << 27) /* 0x08000000 */
#define CHERI256_PERM_USER13 (1 << 28) /* 0x10000000 */
#define CHERI256_PERM_USER14 (1 << 29) /* 0x20000000 */
#define CHERI256_PERM_USER15 (1 << 30) /* 0x40000000 */
#define CHERI128_PERM_USER0 (1 << 15) /* 0x00008000 */
#define CHERI128_PERM_USER1 (1 << 16) /* 0x00010000 */
#define CHERI128_PERM_USER2 (1 << 17) /* 0x00020000 */
#define CHERI128_PERM_USER3 (1 << 18) /* 0x00040000 */
#if (CHERICAP_SIZE == 32)
#define CHERI_PERM_USER0 CHERI256_PERM_USER0
#define CHERI_PERM_USER1 CHERI256_PERM_USER1
#define CHERI_PERM_USER2 CHERI256_PERM_USER2
#define CHERI_PERM_USER3 CHERI256_PERM_USER3
#define CHERI_PERM_USER4 CHERI256_PERM_USER4
#define CHERI_PERM_USER5 CHERI256_PERM_USER5
#define CHERI_PERM_USER6 CHERI256_PERM_USER6
#define CHERI_PERM_USER7 CHERI256_PERM_USER7
#define CHERI_PERM_USER8 CHERI256_PERM_USER8
#define CHERI_PERM_USER9 CHERI256_PERM_USER9
#define CHERI_PERM_USER10 CHERI256_PERM_USER10
#define CHERI_PERM_USER11 CHERI256_PERM_USER11
#define CHERI_PERM_USER12 CHERI256_PERM_USER12
#define CHERI_PERM_USER13 CHERI256_PERM_USER13
#define CHERI_PERM_USER14 CHERI256_PERM_USER14
#define CHERI_PERM_USER15 CHERI256_PERM_USER15
#else /* (!(CHERICAP_SIZE == 32)) */
# 115 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
#define CHERI_PERM_USER0 CHERI128_PERM_USER0
#define CHERI_PERM_USER1 CHERI128_PERM_USER1
#define CHERI_PERM_USER2 CHERI128_PERM_USER2
#define CHERI_PERM_USER3 CHERI128_PERM_USER3
#endif /* (!(CHERICAP_SIZE == 32)) */
# 120 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
/*
* The kernel snags one for the user-defined permissions for the purposes of
* authorising system calls from $pcc. This is a bit of an oddity: normally,
* we check permissions on data capabilities, not code capabilities, but
* aligns with 'privilege' checks: e.g., $epcc access. We may wish to switch
* to another model, such as having userspace register one or more class
* capabilities as suitable for privilege.
*/
#define CHERI_PERM_SYSCALL CHERI_PERM_USER0
/*
* Use another user-defined permission to restrict the ability to change
* the page mapping underlying a capability. This can't be the same
* permission bit as CHERI_PERM_SYSCALL because $pcc should not confer the
* right rewrite or remap executable memory.
*/
#define CHERI_PERM_CHERIABI_VMMAP CHERI_PERM_USER1
/*
* Macros defining initial permission sets for various scenarios; details
* depend on the permissions available on 256-bit or 128-bit CHERI:
*
* CHERI_PERM_USER_PRIVS: Mask of all available user-defined permissions
* CHERI_PERM_PRIV: Mask of all available hardware-defined permissions
*/
#if (CHERICAP_SIZE == 32)
#define CHERI_PERM_USER_PRIVS \
(CHERI_PERM_USER0 | CHERI_PERM_USER1 | CHERI_PERM_USER2 | \
CHERI_PERM_USER3 | CHERI_PERM_USER4 | CHERI_PERM_USER5 | \
CHERI_PERM_USER6 | CHERI_PERM_USER7 | CHERI_PERM_USER8 | \
CHERI_PERM_USER9 | CHERI_PERM_USER10 | CHERI_PERM_USER11 | \
CHERI_PERM_USER12 | CHERI_PERM_USER13 | CHERI_PERM_USER14 | \
CHERI_PERM_USER15)
#else /* (!(CHERICAP_SIZE == 32)) */
# 155 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
#define CHERI_PERM_USER_PRIVS \
(CHERI_PERM_USER0 | CHERI_PERM_USER1 | CHERI_PERM_USER2 | \
CHERI_PERM_USER3)
#endif /* (!(CHERICAP_SIZE == 32)) */
# 159 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
/*
* No variation between 256-bit and 128-bit CHERI for privileged capability
* permissions -- at least, not anymore.
*/
#define CHERI_PERM_KERN \
(CHERI_PERM_GLOBAL | CHERI_PERM_EXECUTE | \
CHERI_PERM_LOAD | CHERI_PERM_STORE | CHERI_PERM_LOAD_CAP | \
CHERI_PERM_STORE_CAP | CHERI_PERM_STORE_LOCAL_CAP | \
CHERI_PERM_SEAL | CHERI_PERM_RESERVED0 | CHERI_PERM_RESERVED1 | \
CHERI_PERM_SYSTEM_REGS | CHERI_PERM_USER_PRIVS)
/*
* Root "object-type" capability for the kernel. This can be used neither as
* a data nor code capability.
*/
#define CHERI_PERM_KERN_TYPE (CHERI_PERM_GLOBAL | CHERI_PERM_SEAL)
/*
* Basic userspace permission mask; CHERI_PERM_EXECUTE will be added for
* executable capabilities ($pcc); CHERI_PERM_STORE, CHERI_PERM_STORE_CAP,
* and CHERI_PERM_STORE_LOCAL_CAP will be added for data permissions ($c0).
*
* No variation required between 256-bit and 128-bit CHERI.
*/
#define CHERI_PERM_USER \
(CHERI_PERM_GLOBAL | CHERI_PERM_LOAD | CHERI_PERM_LOAD_CAP | \
(CHERI_PERM_USER_PRIVS & ~CHERI_PERM_CHERIABI_VMMAP))
#define CHERI_PERM_USER_CODE (CHERI_PERM_USER | CHERI_PERM_EXECUTE)
/*
* XXX-BD: _DATA should not include _VMMAP, but malloc needs rework to
* fix.
*/
#define CHERI_PERM_USER_DATA (CHERI_PERM_USER | CHERI_PERM_STORE | \
CHERI_PERM_STORE_CAP | \
CHERI_PERM_STORE_LOCAL_CAP | \
CHERI_PERM_CHERIABI_VMMAP)
/*
* Root "object-type" capability -- queried via sysarch(2) when libcheri needs
* to allocate types. This can be used neither as a data nor code capability.
*
* No variation required between 256-bit and 128-bit CHERI.
*/
#define CHERI_PERM_USER_TYPE (CHERI_PERM_GLOBAL | CHERI_PERM_SEAL)
/*
* The CHERI object-type space is split between userspace and kernel,
* permitting kernel object references to be delegated to userspace (if
* desired). Currently, we provide 23 bits of namespace to each, with the top
* bit set for kernel object types, but it is easy to imagine other splits.
* User and kernel software should be written so as to not place assumptions
* about the specific values used here, as they may change.
*/
#define CHERI_OTYPE_USER_MIN (0)
#define CHERI_OTYPE_USER_MAX ((1 << 23) - 1)
#define CHERI_OTYPE_KERN_MIN (1 << 24)
#define CHERI_OTYPE_KERN_MAX ((1 << 24) - 1)
#define CHERI_OTYPE_ISKERN(x) (((x) & (1 << 23)) != 0)
#define CHERI_OTYPE_ISUSER(x) (!(CHERI_OTYPE_ISKERN(x)))
/*
* Definition for kernel "privileged" capability able to name the entire
* address space.
*
* No variation required between 256-bit and 128-bit CHERI.
*/
#define CHERI_CAP_KERN_PERMS CHERI_PERM_KERN
#define CHERI_CAP_KERN_BASE 0x0
#define CHERI_CAP_KERN_LENGTH 0xffffffffffffffff
#define CHERI_CAP_KERN_OFFSET 0x0
#define CHERI_CAP_KERN_TYPE_PERMS CHERI_PERM_KERN_TYPE
#define CHERI_CAP_KERN_TYPE_BASE CHERI_OTYPE_KERN_MIN
#define CHERI_CAP_KERN_TYPE_LENGTH \
(CHERI_OTYPE_KERN_MAX - CHERI_OTYPE_KERN_MIN)
#define CHERI_CAP_KERN_TYPE_OFFSET 0x0
/*
* Definition for userspace "unprivileged" capability able to name the user
* portion of the address space.
*
* No variation required between 256-bit and 128-bit CHERI.
*/
#define CHERI_CAP_USER_CODE_PERMS CHERI_PERM_USER_CODE
#define CHERI_CAP_USER_CODE_BASE MIPS_XUSEG_START
#define CHERI_CAP_USER_CODE_LENGTH (MIPS_XUSEG_END - MIPS_XUSEG_START)
#define CHERI_CAP_USER_CODE_OFFSET 0x0
#define CHERI_CAP_USER_DATA_PERMS CHERI_PERM_USER_DATA
#define CHERI_CAP_USER_DATA_BASE MIPS_XUSEG_START
#define CHERI_CAP_USER_DATA_LENGTH (MIPS_XUSEG_END - MIPS_XUSEG_START)
#define CHERI_CAP_USER_DATA_OFFSET 0x0
#define CHERI_CAP_USER_TYPE_PERMS CHERI_PERM_USER_TYPE
#define CHERI_CAP_USER_TYPE_BASE CHERI_OTYPE_USER_MIN
#define CHERI_CAP_USER_TYPE_LENGTH \
(CHERI_OTYPE_USER_MAX - CHERI_OTYPE_USER_MIN + 1)
#define CHERI_CAP_USER_TYPE_OFFSET 0x0
#define CHERI_CAP_USER_MMAP_PERMS \
(CHERI_PERM_USER_DATA | CHERI_PERM_USER_CODE | CHERI_PERM_CHERIABI_VMMAP)
#define CHERI_CAP_USER_MMAP_BASE MIPS_XUSEG_START
#define CHERI_CAP_USER_MMAP_LENGTH (MIPS_XUSEG_END - MIPS_XUSEG_START)
#define CHERI_CAP_USER_MMAP_OFFSET 0x0
/*
* A blend of hardware and software allocation of capability registers.
* Ideally, this list wouldn't exist here, but be purely in the assembler.
*/
#define CHERI_CR_C0 0 /* MIPS fetch/load/store capability. */
#define CHERI_CR_DDC CHERI_CR_C0
#define CHERI_CR_C1 1
#define CHERI_CR_C2 2
#define CHERI_CR_C3 3
#define CHERI_CR_C4 4
#define CHERI_CR_C5 5
#define CHERI_CR_C6 6
#define CHERI_CR_C7 7
#define CHERI_CR_C8 8
#define CHERI_CR_C9 9
#define CHERI_CR_C10 10
#define CHERI_CR_C11 11
#define CHERI_CR_STC CHERI_CR_C11
#define CHERI_CR_C12 12
#define CHERI_CR_C13 13
#define CHERI_CR_C14 14
#define CHERI_CR_C15 15
#define CHERI_CR_C16 16
#define CHERI_CR_C17 17
#define CHERI_CR_C18 18
#define CHERI_CR_C19 19
#define CHERI_CR_C20 20
#define CHERI_CR_C21 21
#define CHERI_CR_C22 22
#define CHERI_CR_C23 23
#define CHERI_CR_C24 24
#define CHERI_CR_C25 25
#define CHERI_CR_C26 26
#define CHERI_CR_IDC CHERI_CR_C26
#define CHERI_CR_C27 27
#define CHERI_CR_KR1C CHERI_CR_C27
#define CHERI_CR_C28 28
#define CHERI_CR_KR2C CHERI_CR_C28
#define CHERI_CR_C29 29
#define CHERI_CR_KCC CHERI_CR_C29
#define CHERI_CR_C30 30
#define CHERI_CR_KDC CHERI_CR_C30
#define CHERI_CR_C31 31
#define CHERI_CR_EPCC CHERI_CR_C31
#define CHERI_CR_CTEMP0 CHERI_CR_C13 /* C capability manipulation. */
#define CHERI_CR_CTEMP1 CHERI_CR_C14 /* C capability manipulation. */
#define CHERI_CR_SEC0 CHERI_CR_KR2C /* Saved $c0 in exception handler. */
/*
* Offsets of registers in struct cheri_kframe -- must match the definition in
* cheri.h.
*/
#define CHERIKFRAME_OFF_C17 0
#define CHERIKFRAME_OFF_C18 1
#define CHERIKFRAME_OFF_C19 2
#define CHERIKFRAME_OFF_C20 3
#define CHERIKFRAME_OFF_C21 4
#define CHERIKFRAME_OFF_C22 5
#define CHERIKFRAME_OFF_C23 6
#define CHERIKFRAME_OFF_C24 7
/*
* List of CHERI capability cause code constants, which are used to
* characterise various CP2 exceptions.
*/
#define CHERI_EXCCODE_NONE 0x00
#define CHERI_EXCCODE_LENGTH 0x01
#define CHERI_EXCCODE_TAG 0x02
#define CHERI_EXCCODE_SEAL 0x03
#define CHERI_EXCCODE_TYPE 0x04
#define CHERI_EXCCODE_CALL 0x05
#define CHERI_EXCCODE_RETURN 0x06
#define CHERI_EXCCODE_UNDERFLOW 0x07
#define CHERI_EXCCODE_USER_PERM 0x08
#define CHERI_EXCCODE_PERM_USER CHERI_EXCCODE_USER_PERM
#define CHERI_EXCCODE_TLBSTORE 0x09
#define CHERI_EXCCODE_IMPRECISE 0x0a
#define _CHERI_EXCCODE_RESERVED0b 0x0b
#define _CHERI_EXCCODE_RESERVED0c 0x0c
#define _CHERI_EXCCODE_RESERVED0d 0x0d
#define _CHERI_EXCCODE_RESERVED0e 0x0e
#define _CHERI_EXCCODE_RESERVED0f 0x0f
#define CHERI_EXCCODE_GLOBAL 0x10
#define CHERI_EXCCODE_PERM_EXECUTE 0x11
#define CHERI_EXCCODE_PERM_LOAD 0x12
#define CHERI_EXCCODE_PERM_STORE 0x13
#define CHERI_EXCCODE_PERM_LOADCAP 0x14
#define CHERI_EXCCODE_PERM_STORECAP 0x15
#define CHERI_EXCCODE_STORE_LOCALCAP 0x16
#define CHERI_EXCCODE_PERM_SEAL 0x17
#define CHERI_EXCCODE_SYSTEM_REGS 0x18
#define _CHERI_EXCCODE_RESERVED19 0x19
#define _CHERI_EXCCODE_RESERVED1a 0x1a
#define _CHERI_EXCCODE_RESERVED1b 0x1b
#define _CHERI_EXCCODE_RESERVED1c 0x1c
#define _CHERI_EXCCODE_RESERVED1d 0x1d
#define _CHERI_EXCCODE_RESERVED1e 0x1e
#define _CHERI_EXCCODE_RESERVED1f 0x1f
/*
* User-defined CHERI exception codes are numbered 128...255.
*/
#define CHERI_EXCCODE_SW_BASE 0x80
#define CHERI_EXCCODE_SW_LOCALARG 0x80 /* Non-global CCall argument. */
#define CHERI_EXCCODE_SW_LOCALRET 0x81 /* Non-global CReturn value. */
#define CHERI_EXCCODE_SW_CCALLREGS 0x82 /* Incorrect CCall registers. */
/*
* How to turn the cause register into an exception code and register number.
*/
#define CHERI_CAPCAUSE_EXCCODE_MASK 0xff00
#define CHERI_CAPCAUSE_EXCCODE_SHIFT 8
#define CHERI_CAPCAUSE_REGNUM_MASK 0xff
/*
* Location of the CHERI CCall/CReturn software-path exception vector.
*/
#define CHERI_CCALL_EXC_VEC ((intptr_t)(int32_t)0x80000280)
#if CHERICAP_SIZE == 32
#define CHERI_ALIGN_SHIFT(l) 0ULL
#define CHERI_SEAL_ALIGN_SHIFT(l) 0ULL
#else /* (!(CHERICAP_SIZE == 32)) */
# 391 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
#define CHERI_BASELEN_BITS 20
#define CHERI_SEAL_BASELEN_BITS 5
#define CHERI_SLOP_BITS 2
#define CHERI_ADDR_BITS 64
#define CHERI_SEAL_MIN_ALIGN 12
/*
* Use __builtin_clzll() to implement flsll() on clang where emission of
* DCLZ instructions is correctly conditionalized.
*/
#ifdef __clang__
#define _flsll(x) (64 - __builtin_clzll(x))
#else
# 405 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
#define _flsll(x) flsll(x)
#endif
# 407 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
#define CHERI_ALIGN_SHIFT(l) \
((_flsll(l) <= (CHERI_BASELEN_BITS - CHERI_SLOP_BITS)) ? 0ULL : \
(_flsll(l) - (CHERI_BASELEN_BITS - CHERI_SLOP_BITS)))
#define _CHERI_SEAL_ALIGN_SHIFT(l) \
((_flsll(l) <= (CHERI_SEAL_BASELEN_BITS)) ? 0ULL : \
(_flsll(l) - (CHERI_SEAL_BASELEN_BITS)))
#define CHERI_SEAL_ALIGN_SHIFT(l) \
(_CHERI_SEAL_ALIGN_SHIFT(l) < CHERI_SEAL_MIN_ALIGN ? \
CHERI_SEAL_MIN_ALIGN : _CHERI_SEAL_ALIGN_SHIFT(l))
#endif /* (!(CHERICAP_SIZE == 32)) */
# 417 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
#define CHERI_ALIGN_MASK(l) ~(~0ULL << CHERI_ALIGN_SHIFT(l))
#define CHERI_SEAL_ALIGN_MASK(l) ~(~0ULL << CHERI_SEAL_ALIGN_SHIFT(l))
#endif /* _MIPS_INCLUDE_CHERIREG_H_ */
# 422 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cherireg.h" 3 4
# 43 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <machine/cpuregs.h>
#endif /* expanded by -frewrite-includes */
# 43 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 1 3 4
/* $NetBSD: cpuregs.h,v 1.70 2006/05/15 02:26:54 simonb Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell and Rick Macklem.
*
* 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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)machConst.h 8.1 (Berkeley) 6/10/93
*
* machConst.h --
*
* Machine dependent constants.
*
* Copyright (C) 1989 Digital Equipment Corporation.
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appears in all copies.
* Digital Equipment Corporation makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* from: Header: /sprite/src/kernel/mach/ds3100.md/RCS/machConst.h,
* v 9.2 89/10/21 15:55:22 jhh Exp SPRITE (DECWRL)
* from: Header: /sprite/src/kernel/mach/ds3100.md/RCS/machAddrs.h,
* v 1.2 89/08/15 18:28:21 rab Exp SPRITE (DECWRL)
* from: Header: /sprite/src/kernel/vm/ds3100.md/RCS/vmPmaxConst.h,
* v 9.1 89/09/18 17:33:00 shirriff Exp SPRITE (DECWRL)
*
* $FreeBSD$
*/
#ifndef _MIPS_CPUREGS_H_
#define _MIPS_CPUREGS_H_
/*
* Address space.
* 32-bit mips CPUS partition their 32-bit address space into four segments:
*
* kuseg 0x00000000 - 0x7fffffff User virtual mem, mapped
* kseg0 0x80000000 - 0x9fffffff Physical memory, cached, unmapped
* kseg1 0xa0000000 - 0xbfffffff Physical memory, uncached, unmapped
* kseg2 0xc0000000 - 0xffffffff kernel-virtual, mapped
*
* Caching of mapped addresses is controlled by bits in the TLB entry.
*/
#define MIPS_KSEG0_LARGEST_PHYS (0x20000000)
#define MIPS_KSEG0_PHYS_MASK (0x1fffffff)
#define MIPS_XKPHYS_LARGEST_PHYS (0x10000000000) /* 40 bit PA */
#define MIPS_XKPHYS_PHYS_MASK (0x0ffffffffff)
#ifndef LOCORE
#define MIPS_KUSEG_START 0x00000000
#define MIPS_KSEG0_START ((intptr_t)(int32_t)0x80000000)
#define MIPS_KSEG0_END ((intptr_t)(int32_t)0x9fffffff)
#define MIPS_KSEG1_START ((intptr_t)(int32_t)0xa0000000)
#define MIPS_KSEG1_END ((intptr_t)(int32_t)0xbfffffff)
#define MIPS_KSSEG_START ((intptr_t)(int32_t)0xc0000000)
#define MIPS_KSSEG_END ((intptr_t)(int32_t)0xdfffffff)
#define MIPS_KSEG3_START ((intptr_t)(int32_t)0xe0000000)
#define MIPS_KSEG3_END ((intptr_t)(int32_t)0xffffffff)
#define MIPS_KSEG2_START MIPS_KSSEG_START
#define MIPS_KSEG2_END MIPS_KSSEG_END
#endif
# 91 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#define MIPS_PHYS_TO_KSEG0(x) ((uintptr_t)(x) | MIPS_KSEG0_START)
#define MIPS_PHYS_TO_KSEG1(x) ((uintptr_t)(x) | MIPS_KSEG1_START)
#define MIPS_KSEG0_TO_PHYS(x) ((uintptr_t)(x) & MIPS_KSEG0_PHYS_MASK)
#define MIPS_KSEG1_TO_PHYS(x) ((uintptr_t)(x) & MIPS_KSEG0_PHYS_MASK)
#define MIPS_IS_KSEG0_ADDR(x) \
(((vm_offset_t)(x) >= MIPS_KSEG0_START) && \
((vm_offset_t)(x) <= MIPS_KSEG0_END))
#define MIPS_IS_KSEG1_ADDR(x) \
(((vm_offset_t)(x) >= MIPS_KSEG1_START) && \
((vm_offset_t)(x) <= MIPS_KSEG1_END))
#define MIPS_IS_VALID_PTR(x) (MIPS_IS_KSEG0_ADDR(x) || \
MIPS_IS_KSEG1_ADDR(x))
/*
* Cache Coherency Attributes:
* UC: Uncached.
* UA: Uncached accelerated.
* C: Cacheable, coherency unspecified.
* CNC: Cacheable non-coherent.
* CC: Cacheable coherent.
* CCS: Cacheable coherent, shared read.
* CCE: Cacheable coherent, exclusive read.
* CCEW: Cacheable coherent, exclusive write.
* CCUOW: Cacheable coherent, update on write.
*
* Note that some bits vary in meaning across implementations (and that the
* listing here is no doubt incomplete) and that the optimal cached mode varies
* between implementations. 0x02 is required to be UC and 0x03 is required to
* be a least C.
*
* We define the following logical bits:
* UNCACHED:
* The optimal uncached mode for the target CPU type. This must
* be suitable for use in accessing memory-mapped devices.
* CACHED: The optional cached mode for the target CPU type.
*/
#define MIPS_CCA_UC 0x02 /* Uncached. */
#define MIPS_CCA_C 0x03 /* Cacheable, coherency unspecified. */
#if defined(CPU_R4000) || defined(CPU_R10000)
#define MIPS_CCA_CNC 0x03
#define MIPS_CCA_CCE 0x04
#define MIPS_CCA_CCEW 0x05
#ifdef CPU_R4000
#define MIPS_CCA_CCUOW 0x06
#endif
# 141 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#ifdef CPU_R10000
#define MIPS_CCA_UA 0x07
#endif
# 145 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#define MIPS_CCA_CACHED MIPS_CCA_CCEW
#endif /* defined(CPU_R4000) || defined(CPU_R10000) */
# 148 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#if defined(CPU_SB1)
#define MIPS_CCA_CC 0x05 /* Cacheable Coherent. */
#endif
# 152 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#if defined(CPU_MIPS74K)
#define MIPS_CCA_UNCACHED 0x02
#define MIPS_CCA_CACHED 0x03
#endif
# 157 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
/*
* 1004K and 1074K cores, as well as interAptiv and proAptiv cores, support
* Cacheable Coherent CCAs 0x04 and 0x05, as well as Cacheable non-Coherent
* CCA 0x03 and Uncached Accelerated CCA 0x07
*/
#if defined(CPU_MIPS1004K) || defined(CPU_MIPS1074K) || \
defined(CPU_INTERAPTIV) || defined(CPU_PROAPTIV)
#define MIPS_CCA_CNC 0x03
#define MIPS_CCA_CCE 0x04
#define MIPS_CCA_CCS 0x05
#define MIPS_CCA_UA 0x07
/* We use shared read CCA for CACHED CCA */
#define MIPS_CCA_CACHED MIPS_CCA_CCS
#endif
# 173 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#ifndef MIPS_CCA_UNCACHED
#define MIPS_CCA_UNCACHED MIPS_CCA_UC
#endif
# 177 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
/*
* If we don't know which cached mode to use and there is a cache coherent
* mode, use it. If there is not a cache coherent mode, use the required
* cacheable mode.
*/
#ifndef MIPS_CCA_CACHED
#ifdef MIPS_CCA_CC
#define MIPS_CCA_CACHED MIPS_CCA_CC
#else
# 187 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#define MIPS_CCA_CACHED MIPS_CCA_C
#endif
# 189 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#endif
# 190 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#define MIPS_PHYS_TO_XKPHYS(cca,x) \
((0x2ULL << 62) | ((unsigned long long)(cca) << 59) | (x))
#define MIPS_PHYS_TO_XKPHYS_CACHED(x) \
((0x2ULL << 62) | ((unsigned long long)(MIPS_CCA_CACHED) << 59) | (x))
#define MIPS_PHYS_TO_XKPHYS_UNCACHED(x) \
((0x2ULL << 62) | ((unsigned long long)(MIPS_CCA_UNCACHED) << 59) | (x))
#define MIPS_XKPHYS_TO_PHYS(x) ((uintptr_t)(x) & MIPS_XKPHYS_PHYS_MASK)
#define MIPS_XKPHYS_START 0x8000000000000000
#define MIPS_XKPHYS_END 0xbfffffffffffffff
#define MIPS_XUSEG_START 0x0000000000000000
#define MIPS_XUSEG_END 0x0000010000000000
#define MIPS_XKSEG_START 0xc000000000000000
#define MIPS_XKSEG_END 0xc00000ff80000000
#define MIPS_XKSEG_COMPAT32_START 0xffffffff80000000
#define MIPS_XKSEG_COMPAT32_END 0xffffffffffffffff
#define MIPS_XKSEG_TO_COMPAT32(va) ((va) & 0xffffffff)
#ifdef __mips_n64
#define MIPS_DIRECT_MAPPABLE(pa) 1
#define MIPS_PHYS_TO_DIRECT(pa) MIPS_PHYS_TO_XKPHYS_CACHED(pa)
#define MIPS_PHYS_TO_DIRECT_UNCACHED(pa) MIPS_PHYS_TO_XKPHYS_UNCACHED(pa)
#define MIPS_DIRECT_TO_PHYS(va) MIPS_XKPHYS_TO_PHYS(va)
#else
# 216 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#define MIPS_DIRECT_MAPPABLE(pa) ((pa) < MIPS_KSEG0_LARGEST_PHYS)
#define MIPS_PHYS_TO_DIRECT(pa) MIPS_PHYS_TO_KSEG0(pa)
#define MIPS_PHYS_TO_DIRECT_UNCACHED(pa) MIPS_PHYS_TO_KSEG1(pa)
#define MIPS_DIRECT_TO_PHYS(va) MIPS_KSEG0_TO_PHYS(va)
#endif
# 221 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
/* CPU dependent mtc0 hazard hook */
#if defined(CPU_CNMIPS) || defined(CPU_RMI) || defined(CPU_BERI)
#define COP0_SYNC
#elif defined(CPU_NLM)
# 226 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#define COP0_SYNC .word 0xc0 /* ehb */
#elif defined(CPU_SB1)
# 228 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop
#elif defined(CPU_MIPS24K) || defined(CPU_MIPS34K) || \
defined(CPU_MIPS74K) || defined(CPU_MIPS1004K) || \
defined(CPU_MIPS1074K) || defined(CPU_INTERAPTIV) || \
defined(CPU_PROAPTIV)
# 233 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
/*
* According to MIPS32tm Architecture for Programmers, Vol.II, rev. 2.00:
* "As EHB becomes standard in MIPS implementations, the previous SSNOPs can be
* removed, leaving only the EHB".
* Also, all MIPS32 Release 2 implementations have the EHB instruction, which
* resolves all execution hazards. The same goes for MIPS32 Release 3.
*/
#define COP0_SYNC .word 0xc0 /* ehb */
#else
# 242 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
/*
* Pick a reasonable default based on the "typical" spacing described in the
* "CP0 Hazards" chapter of MIPS Architecture Book Vol III.
*/
#define COP0_SYNC ssnop; ssnop; ssnop; ssnop; .word 0xc0;
#endif
# 248 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#define COP0_HAZARD_FPUENABLE nop; nop; nop; nop;
/*
* The bits in the cause register.
*
* Bits common to r3000 and r4000:
*
* MIPS_CR_BR_DELAY Exception happened in branch delay slot.
* MIPS_CR_COP_ERR Coprocessor error.
* MIPS_CR_IP Interrupt pending bits defined below.
* (same meaning as in CAUSE register).
* MIPS_CR_EXC_CODE The exception type (see exception codes below).
*
* Differences:
* r3k has 4 bits of execption type, r4k has 5 bits.
*/
#define MIPS_CR_BR_DELAY 0x80000000
#define MIPS_CR_COP_ERR 0x30000000
#define MIPS_CR_EXC_CODE 0x0000007C /* five bits */
#define MIPS_CR_IP 0x0000FF00
#define MIPS_CR_EXC_CODE_SHIFT 2
#define MIPS_CR_COP_ERR_SHIFT 28
/*
* The bits in the status register. All bits are active when set to 1.
*
* R3000 status register fields:
* MIPS_SR_COP_USABILITY Control the usability of the four coprocessors.
* MIPS_SR_TS TLB shutdown.
*
* MIPS_SR_INT_IE Master (current) interrupt enable bit.
*
* Differences:
* r3k has cache control is via frobbing SR register bits, whereas the
* r4k cache control is via explicit instructions.
* r3k has a 3-entry stack of kernel/user bits, whereas the
* r4k has kernel/supervisor/user.
*/
#define MIPS_SR_COP_USABILITY 0xf0000000
#define MIPS_SR_COP_0_BIT 0x10000000
#define MIPS_SR_COP_1_BIT 0x20000000
#define MIPS_SR_COP_2_BIT 0x40000000
/* r4k and r3k differences, see below */
#define MIPS_SR_MX 0x01000000 /* MIPS64 */
#define MIPS_SR_PX 0x00800000 /* MIPS64 */
#define MIPS_SR_BEV 0x00400000 /* Use boot exception vector */
#define MIPS_SR_TS 0x00200000
#define MIPS_SR_DE 0x00010000
#define MIPS_SR_INT_IE 0x00000001
/*#define MIPS_SR_MBZ 0x0f8000c0*/ /* Never used, true for r3k */
#define MIPS_SR_INT_MASK 0x0000ff00
/*
* R4000 status register bit definitons,
* where different from r2000/r3000.
*/
#define MIPS_SR_XX 0x80000000
#define MIPS_SR_RP 0x08000000
#define MIPS_SR_FR 0x04000000
#define MIPS_SR_RE 0x02000000
#define MIPS_SR_DIAG_DL 0x01000000 /* QED 52xx */
#define MIPS_SR_DIAG_IL 0x00800000 /* QED 52xx */
#define MIPS_SR_SR 0x00100000
#define MIPS_SR_NMI 0x00080000 /* MIPS32/64 */
#define MIPS_SR_DIAG_CH 0x00040000
#define MIPS_SR_DIAG_CE 0x00020000
#define MIPS_SR_DIAG_PE 0x00010000
#define MIPS_SR_EIE 0x00010000 /* TX79/R5900 */
#define MIPS_SR_KX 0x00000080
#define MIPS_SR_SX 0x00000040
#define MIPS_SR_UX 0x00000020
#define MIPS_SR_KSU_MASK 0x00000018
#define MIPS_SR_KSU_USER 0x00000010
#define MIPS_SR_KSU_SUPER 0x00000008
#define MIPS_SR_KSU_KERNEL 0x00000000
#define MIPS_SR_ERL 0x00000004
#define MIPS_SR_EXL 0x00000002
/*
* The interrupt masks.
* If a bit in the mask is 1 then the interrupt is enabled (or pending).
*/
#define MIPS_INT_MASK 0xff00
#define MIPS_INT_MASK_5 0x8000
#define MIPS_INT_MASK_4 0x4000
#define MIPS_INT_MASK_3 0x2000
#define MIPS_INT_MASK_2 0x1000
#define MIPS_INT_MASK_1 0x0800
#define MIPS_INT_MASK_0 0x0400
#define MIPS_HARD_INT_MASK 0xfc00
#define MIPS_SOFT_INT_MASK_1 0x0200
#define MIPS_SOFT_INT_MASK_0 0x0100
/*
* The bits in the MIPS3 config register.
*
* bit 0..5: R/W, Bit 6..31: R/O
*/
/* kseg0 coherency algorithm - see MIPS3_TLB_ATTR values */
#define MIPS_CONFIG_K0_MASK 0x00000007
/*
* R/W Update on Store Conditional
* 0: Store Conditional uses coherency algorithm specified by TLB
* 1: Store Conditional uses cacheable coherent update on write
*/
#define MIPS_CONFIG_CU 0x00000008
#define MIPS_CONFIG_DB 0x00000010 /* Primary D-cache line size */
#define MIPS_CONFIG_IB 0x00000020 /* Primary I-cache line size */
#define MIPS_CONFIG_CACHE_L1_LSIZE(config, bit) \
(((config) & (bit)) ? 32 : 16)
#define MIPS_CONFIG_DC_MASK 0x000001c0 /* Primary D-cache size */
#define MIPS_CONFIG_DC_SHIFT 6
#define MIPS_CONFIG_IC_MASK 0x00000e00 /* Primary I-cache size */
#define MIPS_CONFIG_IC_SHIFT 9
#define MIPS_CONFIG_C_DEFBASE 0x1000 /* default base 2^12 */
/* Cache size mode indication: available only on Vr41xx CPUs */
#define MIPS_CONFIG_CS 0x00001000
#define MIPS_CONFIG_C_4100BASE 0x0400 /* base is 2^10 if CS=1 */
#define MIPS_CONFIG_CACHE_SIZE(config, mask, base, shift) \
((base) << (((config) & (mask)) >> (shift)))
/* External cache enable: Controls L2 for R5000/Rm527x and L3 for Rm7000 */
#define MIPS_CONFIG_SE 0x00001000
/* Block ordering: 0: sequential, 1: sub-block */
#define MIPS_CONFIG_EB 0x00002000
/* ECC mode - 0: ECC mode, 1: parity mode */
#define MIPS_CONFIG_EM 0x00004000
/* BigEndianMem - 0: kernel and memory are little endian, 1: big endian */
#define MIPS_CONFIG_BE 0x00008000
/* Dirty Shared coherency state - 0: enabled, 1: disabled */
#define MIPS_CONFIG_SM 0x00010000
/* Secondary Cache - 0: present, 1: not present */
#define MIPS_CONFIG_SC 0x00020000
/* System Port width - 0: 64-bit, 1: 32-bit (QED RM523x), 2,3: reserved */
#define MIPS_CONFIG_EW_MASK 0x000c0000
#define MIPS_CONFIG_EW_SHIFT 18
/* Secondary Cache port width - 0: 128-bit data path to S-cache, 1: reserved */
#define MIPS_CONFIG_SW 0x00100000
/* Split Secondary Cache Mode - 0: I/D mixed, 1: I/D separated by SCAddr(17) */
#define MIPS_CONFIG_SS 0x00200000
/* Secondary Cache line size */
#define MIPS_CONFIG_SB_MASK 0x00c00000
#define MIPS_CONFIG_SB_SHIFT 22
#define MIPS_CONFIG_CACHE_L2_LSIZE(config) \
(0x10 << (((config) & MIPS_CONFIG_SB_MASK) >> MIPS_CONFIG_SB_SHIFT))
/* Write back data rate */
#define MIPS_CONFIG_EP_MASK 0x0f000000
#define MIPS_CONFIG_EP_SHIFT 24
/* System clock ratio - this value is CPU dependent */
#define MIPS_CONFIG_EC_MASK 0x70000000
#define MIPS_CONFIG_EC_SHIFT 28
/* Master-Checker Mode - 1: enabled */
#define MIPS_CONFIG_CM 0x80000000
/*
* The bits in the MIPS4 config register.
*/
/*
* Location of exception vectors.
*
* Common vectors: reset and UTLB miss.
*/
#define MIPS_RESET_EXC_VEC ((intptr_t)(int32_t)0xBFC00000)
#define MIPS_UTLB_MISS_EXC_VEC ((intptr_t)(int32_t)0x80000000)
/*
* MIPS-III exception vectors
*/
#define MIPS_XTLB_MISS_EXC_VEC ((intptr_t)(int32_t)0x80000080)
#define MIPS_CACHE_ERR_EXC_VEC ((intptr_t)(int32_t)0x80000100)
#define MIPS_GEN_EXC_VEC ((intptr_t)(int32_t)0x80000180)
/*
* MIPS32/MIPS64 (and some MIPS3) dedicated interrupt vector.
*/
#define MIPS_INTR_EXC_VEC 0x80000200
/*
* Coprocessor 0 registers:
*
* v--- width for mips I,III,32,64
* (3=32bit, 6=64bit, i=impl dep)
* 0 MIPS_COP_0_TLB_INDEX 3333 TLB Index.
* 1 MIPS_COP_0_TLB_RANDOM 3333 TLB Random.
* 2 MIPS_COP_0_TLB_LO0 .636 r4k TLB entry low.
* 3 MIPS_COP_0_TLB_LO1 .636 r4k TLB entry low, extended.
* 4 MIPS_COP_0_TLB_CONTEXT 3636 TLB Context.
* 4/2 MIPS_COP_0_USERLOCAL ..36 UserLocal.
* 5 MIPS_COP_0_TLB_PG_MASK .333 TLB Page Mask register.
* 6 MIPS_COP_0_TLB_WIRED .333 Wired TLB number.
* 7 MIPS_COP_0_HWRENA ..33 rdHWR Enable.
* 8 MIPS_COP_0_BAD_VADDR 3636 Bad virtual address.
* 9 MIPS_COP_0_COUNT .333 Count register.
* 10 MIPS_COP_0_TLB_HI 3636 TLB entry high.
* 11 MIPS_COP_0_COMPARE .333 Compare (against Count).
* 12 MIPS_COP_0_STATUS 3333 Status register.
* 13 MIPS_COP_0_CAUSE 3333 Exception cause register.
* 14 MIPS_COP_0_EXC_PC 3636 Exception PC.
* 15 MIPS_COP_0_PRID 3333 Processor revision identifier.
* 15/1 MIPS_COP_0_EBASE ..3? Exception Base.
* 15/2 MIPS_COP_0_CDMM ..3? Common Device Memory Map.
* 15/6 MIPS_COP_0_CINFO ...3 Core count/id (BERI).
* 15/7 MIPS_COP_0_TINFO ...3 Thread count/id (BERI).
* 16 MIPS_COP_0_CONFIG 3333 Configuration register.
* 16/1 MIPS_COP_0_CONFIG1 ..33 Configuration register 1.
* 16/2 MIPS_COP_0_CONFIG2 ..33 Configuration register 2.
* 16/3 MIPS_COP_0_CONFIG3 ..33 Configuration register 3.
* 16/4 MIPS_COP_0_CONFIG4 ..33 Configuration register 4.
* 17 MIPS_COP_0_LLADDR .336 Load Linked Address.
* 18 MIPS_COP_0_WATCH_LO .336 WatchLo register.
* 19 MIPS_COP_0_WATCH_HI .333 WatchHi register.
* 20 MIPS_COP_0_TLB_XCONTEXT .6.6 TLB XContext register.
* 23 MIPS_COP_0_DEBUG .... Debug JTAG register.
* 24 MIPS_COP_0_DEPC .... DEPC JTAG register.
* 25 MIPS_COP_0_PERFCNT ..36 Performance Counter register.
* 26 MIPS_COP_0_ECC .3ii ECC / Error Control register.
* 27 MIPS_COP_0_CACHE_ERR .3ii Cache Error register.
* 28/0 MIPS_COP_0_TAG_LO .3ii Cache TagLo register (instr).
* 28/1 MIPS_COP_0_DATA_LO ..ii Cache DataLo register (instr).
* 28/2 MIPS_COP_0_TAG_LO ..ii Cache TagLo register (data).
* 28/3 MIPS_COP_0_DATA_LO ..ii Cache DataLo register (data).
* 29/0 MIPS_COP_0_TAG_HI .3ii Cache TagHi register (instr).
* 29/1 MIPS_COP_0_DATA_HI ..ii Cache DataHi register (instr).
* 29/2 MIPS_COP_0_TAG_HI ..ii Cache TagHi register (data).
* 29/3 MIPS_COP_0_DATA_HI ..ii Cache DataHi register (data).
* 30 MIPS_COP_0_ERROR_PC .636 Error EPC register.
* 31 MIPS_COP_0_DESAVE .... DESAVE JTAG register.
*/
/* Deal with inclusion from an assembly file. */
#if defined(_LOCORE) || defined(LOCORE)
#define _(n) $n
#else
# 503 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#define _(n) n
#endif
# 505 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
#define MIPS_COP_0_TLB_INDEX _(0)
#define MIPS_COP_0_TLB_RANDOM _(1)
/* Name and meaning of TLB bits for $2 differ on r3k and r4k. */
#define MIPS_COP_0_TLB_CONTEXT _(4)
/* $5 and $6 new with MIPS-III */
#define MIPS_COP_0_BAD_VADDR _(8)
#define MIPS_COP_0_TLB_HI _(10)
#define MIPS_COP_0_STATUS _(12)
#define MIPS_COP_0_CAUSE _(13)
#define MIPS_COP_0_EXC_PC _(14)
#define MIPS_COP_0_PRID _(15)
/* MIPS-III */
#define MIPS_COP_0_TLB_LO0 _(2)
#define MIPS_COP_0_TLB_LO1 _(3)
#define MIPS_COP_0_TLB_PG_MASK _(5)
#define MIPS_COP_0_TLB_WIRED _(6)
#define MIPS_COP_0_COUNT _(9)
#define MIPS_COP_0_COMPARE _(11)
#define MIPS_COP_0_CONFIG _(16)
#define MIPS_COP_0_LLADDR _(17)
#define MIPS_COP_0_WATCH_LO _(18)
#define MIPS_COP_0_WATCH_HI _(19)
#define MIPS_COP_0_TLB_XCONTEXT _(20)
#define MIPS_COP_0_ECC _(26)
#define MIPS_COP_0_CACHE_ERR _(27)
#define MIPS_COP_0_TAG_LO _(28)
#define MIPS_COP_0_TAG_HI _(29)
#define MIPS_COP_0_ERROR_PC _(30)
/* MIPS32/64 */
#define MIPS_COP_0_USERLOCAL _(4) /* sel 2 is userlevel register */
#define MIPS_COP_0_HWRENA _(7)
#define MIPS_COP_0_DEBUG _(23)
#define MIPS_COP_0_DEPC _(24)
#define MIPS_COP_0_PERFCNT _(25)
#define MIPS_COP_0_DATA_LO _(28)
#define MIPS_COP_0_DATA_HI _(29)
#define MIPS_COP_0_DESAVE _(31)
/* BERI */
#if defined(CPU_BERI)
#define MIPS_COP_0_EXC_INS _(8) /* sel 1 encoding of instruction causing exception */
#endif
# 555 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
/* MIPS32 Config register definitions */
#define MIPS_MMU_NONE 0x00 /* No MMU present */
#define MIPS_MMU_TLB 0x01 /* Standard TLB */
#define MIPS_MMU_BAT 0x02 /* Standard BAT */
#define MIPS_MMU_FIXED 0x03 /* Standard fixed mapping */
/*
* Config Register Fields
* (See "MIPS Architecture for Programmers Volume III", MD00091, Table 9.39)
*/
#define MIPS_CONFIG0_M 0x80000000 /* Flag: Config1 is present. */
#define MIPS_CONFIG0_MT_MASK 0x00000380 /* bits 9..7 MMU Type */
#define MIPS_CONFIG0_MT_SHIFT 7
#define MIPS_CONFIG0_BE 0x00008000 /* data is big-endian */
#define MIPS_CONFIG0_VI 0x00000008 /* inst cache is virtual */
/*
* Config1 Register Fields
* (See "MIPS Architecture for Programmers Volume III", MD00091, Table 9-1)
*/
#define MIPS_CONFIG1_M 0x80000000 /* Flag: Config2 is present. */
#define MIPS_CONFIG1_TLBSZ_MASK 0x7E000000 /* bits 30..25 # tlb entries minus one */
#define MIPS_CONFIG1_TLBSZ_SHIFT 25
#define MIPS_CONFIG1_IS_MASK 0x01C00000 /* bits 24..22 icache sets per way */
#define MIPS_CONFIG1_IS_SHIFT 22
#define MIPS_CONFIG1_IL_MASK 0x00380000 /* bits 21..19 icache line size */
#define MIPS_CONFIG1_IL_SHIFT 19
#define MIPS_CONFIG1_IA_MASK 0x00070000 /* bits 18..16 icache associativity */
#define MIPS_CONFIG1_IA_SHIFT 16
#define MIPS_CONFIG1_DS_MASK 0x0000E000 /* bits 15..13 dcache sets per way */
#define MIPS_CONFIG1_DS_SHIFT 13
#define MIPS_CONFIG1_DL_MASK 0x00001C00 /* bits 12..10 dcache line size */
#define MIPS_CONFIG1_DL_SHIFT 10
#define MIPS_CONFIG1_DA_MASK 0x00000380 /* bits 9.. 7 dcache associativity */
#define MIPS_CONFIG1_DA_SHIFT 7
#define MIPS_CONFIG1_LOWBITS 0x0000007F
#define MIPS_CONFIG1_C2 0x00000040 /* Coprocessor 2 implemented */
#define MIPS_CONFIG1_MD 0x00000020 /* MDMX ASE implemented (MIPS64) */
#define MIPS_CONFIG1_PC 0x00000010 /* Performance counters implemented */
#define MIPS_CONFIG1_WR 0x00000008 /* Watch registers implemented */
#define MIPS_CONFIG1_CA 0x00000004 /* MIPS16e ISA implemented */
#define MIPS_CONFIG1_EP 0x00000002 /* EJTAG implemented */
#define MIPS_CONFIG1_FP 0x00000001 /* FPU implemented */
/*
* Config2 Register Fields
* (See "MIPS Architecture for Programmers Volume III", MD00091, Table 9.40)
*/
#define MIPS_CONFIG2_M 0x80000000 /* Flag: Config3 is present. */
#define MIPS_CONFIG2_SA_SHIFT 0 /* Secondary cache associativity */
#define MIPS_CONFIG2_SA_MASK 0xf
#define MIPS_CONFIG2_SL_SHIFT 4 /* Secondary cache line size */
#define MIPS_CONFIG2_SL_MASK 0xf
#define MIPS_CONFIG2_SS_SHIFT 8 /* Secondary cache sets per way */
#define MIPS_CONFIG2_SS_MASK 0xf
/*
* Config3 Register Fields
* (See "MIPS Architecture for Programmers Volume III", MD00091, Table 9.41)
*/
#define MIPS_CONFIG3_M 0x80000000 /* Flag: Config4 is present */
#define MIPS_CONFIG3_CMGCR_MASK 0x20000000 /* Coherence manager present */
#define MIPS_CONFIG3_ULR 0x00002000 /* UserLocal reg implemented */
/*
* Config2 Register Fields
* (See "MIPS Architecture for Programmers Volume III", MD00091, Table 9.40)
*/
#define MIPS_CONFIG2_M 0x80000000 /* Flag: Config3 is present. */
/*
* Config3 Register Fields
* (See "MIPS Architecture for Programmers Volume III", MD00091, Table 9.41)
*/
#define MIPS_CONFIG3_M 0x80000000 /* Flag: Config4 is present */
#define MIPS_CONFIG3_ULR 0x00002000 /* UserLocal reg implemented */
#define MIPS_CONFIG4_MMUSIZEEXT 0x000000FF /* bits 7.. 0 MMU Size Extension */
#define MIPS_CONFIG4_MMUEXTDEF 0x0000C000 /* bits 15.14 MMU Extension Definition */
#define MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT 0x00004000 /* This values denotes CONFIG4 bits */
/*
* Values for the code field in a break instruction.
*/
#define MIPS_BREAK_INSTR 0x0000000d
#define MIPS_BREAK_VAL_MASK 0x03ff0000
#define MIPS_BREAK_VAL_SHIFT 16
#define MIPS_BREAK_KDB_VAL 512
#define MIPS_BREAK_SSTEP_VAL 513
#define MIPS_BREAK_BRKPT_VAL 514
#define MIPS_BREAK_SOVER_VAL 515
#define MIPS_BREAK_DDB_VAL 516
#define MIPS_BREAK_KDB (MIPS_BREAK_INSTR | \
(MIPS_BREAK_KDB_VAL << MIPS_BREAK_VAL_SHIFT))
#define MIPS_BREAK_SSTEP (MIPS_BREAK_INSTR | \
(MIPS_BREAK_SSTEP_VAL << MIPS_BREAK_VAL_SHIFT))
#define MIPS_BREAK_BRKPT (MIPS_BREAK_INSTR | \
(MIPS_BREAK_BRKPT_VAL << MIPS_BREAK_VAL_SHIFT))
#define MIPS_BREAK_SOVER (MIPS_BREAK_INSTR | \
(MIPS_BREAK_SOVER_VAL << MIPS_BREAK_VAL_SHIFT))
#define MIPS_BREAK_DDB (MIPS_BREAK_INSTR | \
(MIPS_BREAK_DDB_VAL << MIPS_BREAK_VAL_SHIFT))
/*
* Mininum and maximum cache sizes.
*/
#define MIPS_MIN_CACHE_SIZE (16 * 1024)
#define MIPS_MAX_CACHE_SIZE (256 * 1024)
#define MIPS_MAX_PCACHE_SIZE (32 * 1024) /* max. primary cache size */
/*
* The floating point version and status registers.
*/
#define MIPS_FPU_ID $0
#define MIPS_FPU_CSR $31
/*
* The floating point coprocessor status register bits.
*/
#define MIPS_FPU_ROUNDING_BITS 0x00000003
#define MIPS_FPU_ROUND_RN 0x00000000
#define MIPS_FPU_ROUND_RZ 0x00000001
#define MIPS_FPU_ROUND_RP 0x00000002
#define MIPS_FPU_ROUND_RM 0x00000003
#define MIPS_FPU_STICKY_BITS 0x0000007c
#define MIPS_FPU_STICKY_INEXACT 0x00000004
#define MIPS_FPU_STICKY_UNDERFLOW 0x00000008
#define MIPS_FPU_STICKY_OVERFLOW 0x00000010
#define MIPS_FPU_STICKY_DIV0 0x00000020
#define MIPS_FPU_STICKY_INVALID 0x00000040
#define MIPS_FPU_ENABLE_BITS 0x00000f80
#define MIPS_FPU_ENABLE_INEXACT 0x00000080
#define MIPS_FPU_ENABLE_UNDERFLOW 0x00000100
#define MIPS_FPU_ENABLE_OVERFLOW 0x00000200
#define MIPS_FPU_ENABLE_DIV0 0x00000400
#define MIPS_FPU_ENABLE_INVALID 0x00000800
#define MIPS_FPU_EXCEPTION_BITS 0x0003f000
#define MIPS_FPU_EXCEPTION_INEXACT 0x00001000
#define MIPS_FPU_EXCEPTION_UNDERFLOW 0x00002000
#define MIPS_FPU_EXCEPTION_OVERFLOW 0x00004000
#define MIPS_FPU_EXCEPTION_DIV0 0x00008000
#define MIPS_FPU_EXCEPTION_INVALID 0x00010000
#define MIPS_FPU_EXCEPTION_UNIMPL 0x00020000
#define MIPS_FPU_COND_BIT 0x00800000
#define MIPS_FPU_FLUSH_BIT 0x01000000 /* r4k, MBZ on r3k */
#define MIPS_FPC_MBZ_BITS 0xfe7c0000
/*
* Constants to determine if have a floating point instruction.
*/
#define MIPS_OPCODE_SHIFT 26
#define MIPS_OPCODE_C1 0x11
/*
* Bits defined for for the HWREna (CP0 register 7, select 0).
*/
#define MIPS_HWRENA_CPUNUM (1<<0) /* CPU number program is running on */
#define MIPS_HWRENA_SYNCI_STEP (1<<1) /* Address step sized used with SYNCI */
#define MIPS_HWRENA_CC (1<<2) /* Hi Res cycle counter */
#define MIPS_HWRENA_CCRES (1<<3) /* Cycle counter resolution */
#define MIPS_HWRENA_UL (1<<29) /* UserLocal Register */
#define MIPS_HWRENA_IMPL30 (1<<30) /* Implementation-dependent 30 */
#define MIPS_HWRENA_IMPL31 (1<<31) /* Implementation-dependent 31 */
/* Coherence manager constants */
#define MIPS_CMGCRB_BASE 11
#define MIPS_CMGCRF_BASE (~((1 << MIPS_CMGCRB_BASE) - 1))
/*
* Bits defined for for the HWREna (CP0 register 7, select 0).
*/
#define MIPS_HWRENA_CPUNUM (1<<0) /* CPU number program is running on */
#define MIPS_HWRENA_SYNCI_STEP (1<<1) /* Address step sized used with SYNCI */
#define MIPS_HWRENA_CC (1<<2) /* Hi Res cycle counter */
#define MIPS_HWRENA_CCRES (1<<3) /* Cycle counter resolution */
#define MIPS_HWRENA_UL (1<<29) /* UserLocal Register */
#define MIPS_HWRENA_IMPL30 (1<<30) /* Implementation-dependent 30 */
#define MIPS_HWRENA_IMPL31 (1<<31) /* Implementation-dependent 31 */
#endif /* _MIPS_CPUREGS_H_ */
# 738 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cpuregs.h" 3 4
# 44 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <cheri/cheri.h>
#endif /* expanded by -frewrite-includes */
# 45 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 1 3 4
/*-
* Copyright (c) 2011-2016 Robert N. M. Watson
* Copyright (c) 2015 SRI International
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _SYS_CHERI_H_
#define _SYS_CHERI_H_
#ifdef _KERNEL
#if 0 /* expanded by -frewrite-includes */
#include <sys/sysctl.h> /* SYSCTL_DECL() */
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/systm.h> /* CTASSERT() */
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
#endif
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
# 41 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/cherireg.h> /* CHERICAP_SIZE. */
#endif /* expanded by -frewrite-includes */
# 42 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
# 43 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
/*
* Canonical C-language representation of a capability for compilers that
* don't support capabilities directly. The in-memory layout is sensitive to
* the microarchitecture, and hence treated as opaque. Fields must be
* accessed via the ISA.
*/
struct chericap {
uint8_t c_data[CHERICAP_SIZE];
} __packed __aligned(CHERICAP_SIZE);
#ifdef _KERNEL
CTASSERT(sizeof(struct chericap) == CHERICAP_SIZE);
#endif
# 56 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
/*
* Canonical C-language representation of a CHERI object capability -- code and
* data capabilities in registers or memory.
*/
struct cheri_object {
#if !defined(_KERNEL) && __has_feature(capabilities)
__capability void *co_codecap;
__capability void *co_datacap;
#else
# 66 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
struct chericap co_codecap;
struct chericap co_datacap;
#endif
# 69 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
};
#if !defined(_KERNEL) && __has_feature(capabilities)
#define CHERI_OBJECT_INIT_NULL {NULL, NULL}
#define CHERI_OBJECT_ISNULL(co) \
((co).co_codecap == NULL && (co).co_datacap == NULL)
#endif
# 76 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
/*
* Data structure describing CHERI's sigaltstack-like extensions to signal
* delivery. In the event that a thread takes a signal when $pcc doesn't hold
* CHERI_PERM_SYSCALL, we will need to install new $pcc, $ddc, $stc, and $idc
* state, and move execution to the per-thread alternative stack, whose
* pointer should (presumably) be relative to the $ddc/$stc defined here.
*/
struct cheri_signal {
#if !defined(_KERNEL) && __has_feature(capabilities)
__capability void *csig_pcc;
__capability void *csig_ddc;
__capability void *csig_stc;
__capability void *csig_idc;
__capability void *csig_default_stack;
__capability void *csig_sigcode;
#else
# 93 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
struct chericap csig_pcc;
struct chericap csig_ddc;
struct chericap csig_stc;
struct chericap csig_idc;
struct chericap csig_default_stack;
struct chericap csig_sigcode;
#endif
# 100 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
};
/*
* Per-thread CHERI CCall/CReturn stack, which preserves the calling PC/PCC/
* IDC across CCall so that CReturn can restore them.
*
* XXXRW: This is a very early experiment -- it's not clear if this idea will
* persist in its current form, or at all. For more complex userspace
* language, there's a reasonable expectation that it, rather than the kernel,
* will want to manage the idea of a "trusted stack".
*
* XXXRW: This is currently part of the kernel-user ABI due to the
* CHERI_GET_STACK and CHERI_SET_STACK sysarch() calls. In due course we need
* to revise those APIs and differentiate the kernel-internal representation
* from the public one.
*/
struct cheri_stack_frame {
register_t _csf_pad0; /* Used to be MIPS program counter. */
register_t _csf_pad1;
register_t _csf_pad2;
register_t _csf_pad3;
#if !defined(_KERNEL) && __has_feature(capabilities)
__capability void *csf_pcc;
__capability void *csf_idc;
#else
# 125 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
struct chericap csf_pcc;
struct chericap csf_idc;
#endif
# 128 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
};
#define CHERI_STACK_DEPTH 8 /* XXXRW: 8 is a nice round number. */
struct cheri_stack {
register_t cs_tsp; /* Byte offset, not frame index. */
register_t cs_tsize; /* Stack size, in bytes. */
register_t _cs_pad0;
register_t _cs_pad1;
struct cheri_stack_frame cs_frames[CHERI_STACK_DEPTH];
} __aligned(CHERICAP_SIZE);
#define CHERI_FRAME_SIZE sizeof(struct cheri_stack_frame)
#define CHERI_STACK_SIZE (CHERI_STACK_DEPTH * CHERI_FRAME_SIZE)
/*
* APIs that act on C language representations of capabilities -- but not
* capabilities themselves.
*/
#ifdef _KERNEL
void cheri_capability_copy(struct chericap *cp_to,
struct chericap *cp_from);
void cheri_capability_set(struct chericap *cp, uint32_t uperms,
void *basep, size_t length, off_t off);
void cheri_capability_set_null(struct chericap *cp);
void cheri_capability_setoffset(struct chericap *cp, register_t offset);
/*
* CHERI capability utility functions.
*/
void cheri_bcopy(void *src, void *dst, size_t len);
void *cheri_memcpy(void *dst, void *src, size_t len);
/*
* CHERI context management functions.
*/
struct cheri_frame;
struct thread;
struct trapframe;
const char *cheri_exccode_string(uint8_t exccode);
void cheri_exec_setregs(struct thread *td, u_long entry_addr);
void cheri_log_cheri_frame(struct trapframe *frame);
void cheri_log_exception(struct trapframe *frame, int trap_type);
void cheri_log_exception_registers(struct trapframe *frame);
void cheri_newthread_setregs(struct thread *td);
int cheri_syscall_authorize(struct thread *td, u_int code,
int nargs, register_t *args);
int cheri_signal_sandboxed(struct thread *td);
void cheri_sendsig(struct thread *td);
void cheri_trapframe_from_cheriframe(struct trapframe *frame,
struct cheri_frame *cfp);
void cheri_trapframe_to_cheriframe(struct trapframe *frame,
struct cheri_frame *cfp);
/*
* Functions to set up and manipulate CHERI contexts and stacks.
*/
struct pcb;
struct sysarch_args;
void cheri_signal_copy(struct pcb *dst, struct pcb *src);
void cheri_stack_copy(struct pcb *dst, struct pcb *src);
void cheri_stack_init(struct pcb *pcb);
int cheri_stack_unwind(struct thread *td, struct trapframe *tf,
int signum);
int cheri_sysarch_getstack(struct thread *td, struct sysarch_args *uap);
int cheri_sysarch_gettypecap(struct thread *td, struct sysarch_args *uap);
int cheri_sysarch_setstack(struct thread *td, struct sysarch_args *uap);
void cheri_typecap_copy(struct pcb *dst, struct pcb *src);
/*
* Global sysctl definitions.
*/
SYSCTL_DECL(_security_cheri);
SYSCTL_DECL(_security_cheri_stats);
extern u_int security_cheri_debugger_on_sandbox_signal;
extern u_int security_cheri_debugger_on_sandbox_syscall;
extern u_int security_cheri_debugger_on_sandbox_unwind;
extern u_int security_cheri_debugger_on_sigprot;
extern u_int security_cheri_sandboxed_signals;
extern u_int security_cheri_syscall_violations;
/*
* Functions exposed to machine-independent code that must interact with
* CHERI-specific features; e.g., ktrace.
*/
struct ktr_ccall;
struct ktr_creturn;
struct ktr_cexception;
struct thr_param_c;
void cheriabi_thr_new_md(struct thread *parent_td,
struct thr_param_c *param);
void ktrccall_mdfill(struct pcb *pcb, struct ktr_ccall *kc);
void ktrcreturn_mdfill(struct pcb *pcb, struct ktr_creturn *kr);
void ktrcexception_mdfill(struct trapframe *frame,
struct ktr_cexception *ke);
#endif /* !_KERNEL */
# 223 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
/*
* Nested include of machine-dependent definitions, which likely depend on
* first having defined chericap.h.
*/
#if 0 /* expanded by -frewrite-includes */
#include <machine/cheri.h>
#endif /* expanded by -frewrite-includes */
# 228 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 1 3 4
/*-
* Copyright (c) 2011-2016 Robert N. M. Watson
* Copyright (c) 2015 SRI International
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _MIPS_INCLUDE_CHERI_H_
#define _MIPS_INCLUDE_CHERI_H_
#ifdef _KERNEL
#if 0 /* expanded by -frewrite-includes */
#include <sys/sysctl.h> /* SYSCTL_DECL() */
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/systm.h> /* CTASSERT() */
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
#endif
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/cherireg.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
# 41 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 42 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
# 43 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
/*
* In the past, struct cheri_frame was the in-kernel and kernel<->user
* structure holding CHERI register state for context switching. It is now a
* public structure for kernel<->user interaction (e.g., signals), and struct
* trapframe is used within the kernel. Regardless, correct preservation of
* state in this structure is critical to both correctness and security.
*/
struct cheri_frame {
/* DDC has special properties for MIPS load/store instructions. */
#if !defined(_KERNEL) && __has_feature(capabilities)
__capability void *cf_ddc;
#else
# 56 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
struct chericap cf_ddc;
#endif
# 58 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
/*
* General-purpose capabilities -- note, numbering is from v1.17 of
* the CHERI ISA spec (ISAv5 draft).
*/
#if !defined(_KERNEL) && __has_feature(capabilities)
__capability void *cf_c1, *cf_c2, *cf_c3, *cf_c4;
__capability void *cf_c5, *cf_c6, *cf_c7;
__capability void *cf_c8, *cf_c9, *cf_c10, *cf_stc, *cf_c12;
__capability void *cf_c13, *cf_c14, *cf_c15, *cf_c16, *cf_c17;
__capability void *cf_c18, *cf_c19, *cf_c20, *cf_c21, *cf_c22;
__capability void *cf_c23, *cf_c24, *cf_c25, *cf_idc;
#else
# 71 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
struct chericap cf_c1, cf_c2, cf_c3, cf_c4;
struct chericap cf_c5, cf_c6, cf_c7;
struct chericap cf_c8, cf_c9, cf_c10, cf_stc, cf_c12;
struct chericap cf_c13, cf_c14, cf_c15, cf_c16, cf_c17;
struct chericap cf_c18, cf_c19, cf_c20, cf_c21, cf_c22;
struct chericap cf_c23, cf_c24, cf_c25, cf_idc;
#endif
# 78 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
/*
* Program counter capability -- extracted from exception frame EPCC.
*/
#if !defined(_KERNEL) && __has_feature(capabilities)
__capability void *cf_pcc;
#else
# 85 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
struct chericap cf_pcc;
#endif
# 87 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
/*
* Padded out non-capability registers.
*
* XXXRW: The comment below on only updating for CP2 exceptions is
* incorrect, but should be made correct.
*/
register_t cf_capcause; /* Updated only on CP2 exceptions. */
register_t _cf_pad0[1];
#if (defined(CPU_CHERI) && !defined(CPU_CHERI128)) || (defined(_MIPS_SZCAP) && (_MIPS_SZCAP == 256))
register_t _cf_pad1[2];
#endif
# 99 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
};
#ifdef _KERNEL
/* 28 capability registers + capcause + padding. */
CTASSERT(sizeof(struct cheri_frame) == (29 * CHERICAP_SIZE));
#endif
# 105 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
#ifdef _KERNEL
/*
* Data structure defining kernel per-thread caller-save state used in
* voluntary context switches. This is morally equivalent to pcb_context[].
*/
struct cheri_kframe {
struct chericap ckf_c17;
struct chericap ckf_c18;
struct chericap ckf_c19;
struct chericap ckf_c20;
struct chericap ckf_c21;
struct chericap ckf_c22;
struct chericap ckf_c23;
struct chericap ckf_c24;
};
#endif
# 122 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
/*
* CHERI capability register manipulation macros.
*/
#define CHERI_CGETBASE(v, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgetbase %0, $c%1\n" \
".set pop\n" \
: "=r" (v) : "i" (cb)); \
} while (0)
#define CHERI_CGETLEN(v, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgetlen %0, $c%1\n" \
".set pop\n" \
: "=r" (v) :"i" (cb)); \
} while (0)
#define CHERI_CGETOFFSET(v, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgetoffset %0, $c%1\n" \
".set pop\n" \
: "=r" (v) : "i" (cb)); \
} while (0)
#define CHERI_CGETTAG(v, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgettag %0, $c%1\n" \
".set pop\n" \
: "=r" (v) : "i" (cb)); \
} while (0)
#define CHERI_CGETSEALED(v, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgetsealed %0, $c%1\n" \
".set pop\n" \
: "=r" (v) : "i" (cb)); \
} while (0)
#define CHERI_CGETPERM(v, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgetperm %0, $c%1\n" \
".set pop\n" \
: "=r" (v) : "i" (cb)); \
} while (0)
#define CHERI_CGETTYPE(v, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgettype %0, $c%1\n" \
".set pop\n" \
: "=r" (v) : "i" (cb)); \
} while (0)
#define CHERI_CGETCAUSE(v) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgetcause %0\n" \
".set pop\n" \
: "=r" (v)); \
} while (0)
#define CHERI_CTOPTR(v, cb, ct) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"ctoptr %0, $c%1, $c%2\n" \
".set pop\n" \
: "=r" (v) : "i" (cb), "i" (ct)); \
} while (0)
/*
* Implement a CToInt similar to CToPtr but without the tag check, which will
* be useful to extract integer interpretations of untagged capabilities. One
* property of this conversion is that, since the capability might be
* untagged, we can't assume that (base + offset) < (max capability address),
* and so significant care should be taken -- ideally this variant would only
* be used when we know that the capability is untagged and holds a value that
* must be an integer (due to types or other compile-time information).
*
* This may someday be an instruction. If so, it could directly return the
* cursor, rather than extract (base, offset).
*/
#define CHERI_CTOINT(v, cb) do { \
register_t _base, _offset; \
\
CHERI_CGETBASE(_base, cb); \
CHERI_CGETOFFSET(_offset, cb); \
v = (__typeof__(v))(_base + _offset); \
} while (0)
/*
* Note that despite effectively being a CMove, CGetDefault doesn't require a
* memory clobber: if it's writing to $ddc, it's a nop; otherwise, it's not
* writing to $ddc so no clobber is needed.
*/
#define CHERI_CGETDEFAULT(cd) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgetdefault $c%0\n" \
".set pop\n" \
: : "i" (cd)); \
} while (0)
/*
* Instructions that check capability values and could throw exceptions; no
* capability-register value changes, so no clobbers required.
*/
#define CHERI_CCHECKPERM(cs, v) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"ccheckperm $c%0, %1\n" \
".set pop\n" \
: : "i" (cd), "r" (v)); \
} while (0)
#define CHERI_CCHECKTYPE(cs, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cchecktype $c%0, $c%1\n" \
".set pop\n" \
: : "i" (cs), "i" (cb)); \
} while (0)
/*
* Instructions relating to capability invocation, return, sealing, and
* unsealing. Memory clobbers are required for register manipulation when
* targeting $ddc. They are also required for both CCall and CReturn to
* ensure that any memory write-back is done before invocation.
*
* XXXRW: Is the latter class of cases required?
*/
#define CHERI_CSEAL(cd, cs, ct) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cseal $c%0, $c%1, $c%2\n" \
".set pop\n" \
: : "i" (cd), "i" (cs), "i" (ct) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cseal $c%0, $c%1, $c%2\n" \
".set pop\n" \
: : "i" (cd), "i" (cs), "i" (ct)); \
} while (0)
#define CHERI_CUNSEAL(cd, cb, ct) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cunseal $c%0, $c%1, $c%2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "i" (ct) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cunseal $c%0, $c%1, $c%2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "i" (ct)); \
} while (0)
#define CHERI_CCALL(cs, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"ccall $c%0, $c%1\n" \
".set pop\n" \
: : "i" (cs), "i" (cb) : "memory"); \
} while (0)
#define CHERI_CRETURN() do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"creturn\n" \
".set pop\n" \
: : : "memory"); \
} while (0)
/*
* Capability store; while this doesn't muck with $ddc, it does require a
* memory clobber.
*/
#define CHERI_CSC(cs, cb, regbase, offset) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csc $c%0, %1, %2($c%3)\n" \
".set pop\n" \
: : "i" (cs), "r" (regbase), "i" (offset), "i" (cb) : \
"memory"); \
} while (0)
/*
* Data stores; while these don't muck with $ddc, they do require memory
* clobbers.
*/
#define CHERI_CSB(rs, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csb %0, %1, %2($c%3)\n" \
".set pop\n" \
: : "r" (rs), "r" (rt), "i" (offset), "i" (cb) : "memory"); \
} while (0)
#define CHERI_CSH(rs, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csh %0, %1, %2($c%3)\n" \
".set pop\n" \
: : "r" (rs), "r" (rt), "i" (offset), "i" (cb) : "memory"); \
} while (0)
#define CHERI_CSW(rs, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csw %0, %1, %2($c%3)\n" \
".set pop\n" \
: : "r" (rs), "r" (rt), "i" (offset), "i" (cb) : "memory"); \
} while (0)
#define CHERI_CSD(rs, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csd %0, %1, %2($c%3)\n" \
".set pop\n" \
: : "r" (rs), "r" (rt), "i" (offset), "i" (cb) : "memory"); \
} while (0)
/*
* Data loads: while these don't much with $ddc, they do require memory
* clobbers.
*/
#define CHERI_CLB(rd, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"clb %0, %1, %2($c%3)\n" \
".set pop\n" \
: "=r" (rd) : "r" (rt), "i" (offset),"i" (cb) : "memory"); \
} while (0)
#define CHERI_CLH(rd, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"clh %0, %1, %2($c%3)\n" \
".set pop\n" \
: "=r" (rd) : "r" (rt), "i" (offset), "i" (cb) : "memory"); \
} while (0)
#define CHERI_CLW(rd, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"clw %0, %1, %2($c%3)\n" \
".set pop\n" \
: "=r" (rd) : "r" (rt), "i" (offset), "i" (cb) : "memory"); \
} while (0)
#define CHERI_CLD(rd, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cld %0, %1, %2($c%3)\n" \
".set pop\n" \
: "=r" (rd) : "r" (rt), "i" (offset), "i" (cb) : "memory"); \
} while (0)
#define CHERI_CLBU(rd, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"clbu %0, %1, %2($c%3)\n" \
".set pop\n" \
: "=r" (rd) : "r" (rt), "i" (offset), "i" (cb) : "memory"); \
} while (0)
#define CHERI_CLHU(rd, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"clhu %0, %1, %2($c%3)\n" \
".set pop\n" \
: "=r" (rd) : "r" (rt), "i" (offset), "i" (cb) : "memory"); \
} while (0)
#define CHERI_CLWU(rd, rt, offset, cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"clwu %0, %1, %2($c%3)\n" \
".set pop\n" \
: "=r" (rd) : "r" (rt), "i" (offset), "i" (cb) : "memory"); \
} while (0)
/*
* Routines that modify or replace values in capability registers, and that if
* if used on $ddc, require the compiler to write registers back to memory,
* and reload afterwards, since we may effectively be changing the compiler-
* visible address space. This is also necessary for permissions changes as
* well, to ensure that write-back occurs before a possible loss of store
* permission.
*/
#define CHERI_CGETPCC(v, cd) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgetpcc %0, $c%1\n" \
".set pop\n" \
: "=r" (v) : "i" (cd) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cgetpcc %0, $c%1\n" \
".set pop\n" \
: "=r" (v) : "i" (cd)); \
} while (0)
#define CHERI_CINCBASE(cd, cb, v) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cincbase $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cincbase $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v)); \
} while (0)
#define CHERI_CINCOFFSET(cd, cb, v) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cincoffset $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cincoffset $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v)); \
} while (0)
#if (defined(CPU_CHERI) && !defined(CPU_CHERI128)) || (defined(_MIPS_SZCAP) && (_MIPS_SZCAP == 256))
#define CHERI_CMOVE(cd, cb) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cmove $c%0, $c%1\n" \
".set pop\n" \
: : "i" (cd), "i" (cb) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cmove $c%0, $c%1\n" \
".set pop\n" \
: : "i" (cd), "i" (cb)); \
} while (0)
#else /* 128-bit CHERI */
# 521 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
#define CHERI_CMOVE(cd, cb) CHERI_CINCOFFSET(cd, cb, 0)
#endif /* 128-bit CHERI */
# 523 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
#define CHERI_CSETDEFAULT(cb) do { \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csetdefault %c%0\n" \
".set pop\n" \
: : "i" (cb) : "memory"); \
} while (0)
#define CHERI_CSETLEN(cd, cb, v) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csetlen $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csetlen $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v)); \
} while (0)
#define CHERI_CSETOFFSET(cd, cb, v) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csetoffset $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csetoffset $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v)); \
} while (0)
#define CHERI_CCLEARTAG(cd, cb) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"ccleartag $c%0, $c%1\n" \
".set pop\n" \
: : "i" (cd), "i" (cb) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"ccleartag $c%0, $c%1\n" \
".set pop\n" \
: : "i" (cd), "i" (cb)); \
} while (0)
#define CHERI_CANDPERM(cd, cb, v) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"candperm $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"candperm $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v)); \
} while (0)
#define CHERI_CSETBOUNDS(cd, cb, v) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csetbounds $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"csetbounds $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v)); \
} while (0)
#define CHERI_CFROMPTR(cd, cb, v) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cfromptr $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v) : "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"cfromptr $c%0, $c%1, %2\n" \
".set pop\n" \
: : "i" (cd), "i" (cb), "r" (v)); \
} while (0)
#define CHERI_CLC(cd, cb, regbase, offset) do { \
if ((cd) == 0) \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"clc $c%0, %1, %2($c%3)\n" \
".set pop\n" \
: : "i" (cd), "r" (regbase), "i" (offset), "i" (cb) \
: "memory"); \
else \
__asm__ __volatile__ ( \
".set push\n" \
".set noreorder\n" \
"clc $c%0, %1, %2($c%3)\n" \
".set pop\n" \
: : "i" (cd), "r" (regbase), "i" (offset), \
"i" (cb)); \
} while (0)
/*
* Utility functions for the kernel -- as they depend on $kdc.
*/
#ifdef _KERNEL
static inline void
cheri_capability_load(u_int crn_to, struct chericap *cp)
{
CHERI_CLC(crn_to, CHERI_CR_KDC, cp, 0);
}
static inline void
cheri_capability_store(u_int crn_from, struct chericap *cp)
{
CHERI_CSC(crn_from, CHERI_CR_KDC, cp, 0);
}
#endif
# 672 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
/*
* Routines for measuring time -- depends on a later MIPS userspace cycle
* counter.
*/
static __inline uint32_t
cheri_get_cyclecount(void)
{
uint64_t _time;
__asm__ __volatile__ (
".set push\n"
".set noreorder\n"
"rdhwr %0, $2\n"
".set pop\n"
: "=r" (_time));
return (_time & 0xffffffff);
}
/*
* Special marker NOPs recognised by analyse_trace.py to start / stop region
* of interest in trace.
*/
#define CHERI_START_TRACE do { \
__asm__ __volatile__("li $0, 0xbeef"); \
} while(0)
#define CHERI_STOP_TRACE do { \
__asm__ __volatile__("li $0, 0xdead"); \
} while(0)
#ifdef _KERNEL
#define CHERI_CAP_PRINT(crn) do { \
uintmax_t c_perms, c_otype, c_base, c_length, c_offset; \
u_int ctag, c_sealed; \
\
CHERI_CGETTAG(ctag, (crn)); \
CHERI_CGETSEALED(c_sealed, (crn)); \
CHERI_CGETPERM(c_perms, (crn)); \
CHERI_CGETTYPE(c_otype, (crn)); \
CHERI_CGETBASE(c_base, (crn)); \
CHERI_CGETLEN(c_length, (crn)); \
CHERI_CGETOFFSET(c_offset, (crn)); \
printf("v:%u s:%u p:%08jx b:%016jx l:%016jx o:%jx t:%jx\n", \
ctag, c_sealed, c_perms, c_base, c_length, c_offset, \
c_otype); \
} while (0)
#define CHERI_REG_PRINT(crn, num) do { \
printf("$c%02u: ", num); \
CHERI_CAP_PRINT(crn); \
} while (0)
static inline void
cheri_capability_print(struct chericap *cp)
{
CHERI_CLC(CHERI_CR_CTEMP0, CHERI_CR_KDC, cp, 0);
CHERI_CAP_PRINT(CHERI_CR_CTEMP0);
}
#ifdef DDB
#define DB_CHERI_CAP_PRINT(crn) do { \
uintmax_t c_perms, c_otype, c_base, c_length, c_offset; \
u_int ctag, c_sealed; \
\
CHERI_CGETTAG(ctag, (crn)); \
CHERI_CGETSEALED(c_sealed, (crn)); \
CHERI_CGETPERM(c_perms, (crn)); \
CHERI_CGETTYPE(c_otype, (crn)); \
CHERI_CGETBASE(c_base, (crn)); \
CHERI_CGETLEN(c_length, (crn)); \
CHERI_CGETOFFSET(c_offset, (crn)); \
db_printf("v:%u s:%u p:%08jx b:%016jx l:%016jx o:%jx t:%jx\n", \
ctag, c_sealed, c_perms, c_base, c_length, c_offset, \
c_otype); \
} while (0)
#define DB_CHERI_REG_PRINT(crn, num) do { \
db_printf("$c%02u: ", num); \
DB_CHERI_CAP_PRINT(crn); \
} while (0)
#endif /* !DDB */
# 753 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
#endif /* !_KERNEL */
# 754 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
#endif /* _MIPS_INCLUDE_CHERI_H_ */
# 756 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheri.h" 3 4
# 229 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 2 3 4
#endif /* _SYS_CHERI_H_ */
# 231 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri.h" 3 4
# 46 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <cheri/cheric.h>
#endif /* expanded by -frewrite-includes */
# 46 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 1 3 4
/*-
* Copyright (c) 2013-2016 Robert N. M. Watson
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _SYS_CHERIC_H_
#define _SYS_CHERIC_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 34 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
# 35 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 35 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/cherireg.h> /* Permission definitions. */
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
#if !defined(_KERNEL) && __has_feature(capabilities)
/*
* Programmer-friendly macros for CHERI-aware C code -- requires use of
* CHERI-aware Clang/LLVM, and full capability context switching, so not yet
* usable in the kernel.
*/
#define cheri_getlen(x) __builtin_cheri_get_cap_length( \
__DECONST(__capability void *, (x)))
#define cheri_getbase(x) __builtin_cheri_get_cap_base( \
__DECONST(__capability void *, (x)))
#define cheri_getoffset(x) __builtin_cheri_cap_offset_get( \
__DECONST(__capability void *, (x)))
#define cheri_getperm(x) __builtin_cheri_get_cap_perms( \
__DECONST(__capability void *, (x)))
#define cheri_getsealed(x) __builtin_cheri_get_cap_sealed( \
__DECONST(__capability void *, (x)))
#define cheri_gettag(x) __builtin_cheri_get_cap_tag( \
__DECONST(__capability void *, (x)))
#define cheri_gettype(x) __builtin_cheri_get_cap_type( \
__DECONST(__capability void *, (x)))
#define cheri_andperm(x, y) __builtin_cheri_and_cap_perms( \
__DECONST(__capability void *, (x)), (y))
#define cheri_cleartag(x) __builtin_cheri_clear_cap_tag( \
__DECONST(__capability void *, (x)))
#define cheri_incoffset(x, y) __builtin_cheri_cap_offset_increment( \
__DECONST(__capability void *, (x)), (y))
#define cheri_setoffset(x, y) __builtin_cheri_cap_offset_set( \
__DECONST(__capability void *, (x)), (y))
#define cheri_seal(x, y) __builtin_cheri_seal_cap( \
__DECONST(__capability void *, (x)), \
__DECONST(__capability void *, (y)))
#define cheri_unseal(x, y) __builtin_cheri_unseal_cap( \
__DECONST(__capability void *, (x)), \
__DECONST(__capability void *, (y)))
#define cheri_getcause() __builtin_cheri_get_cause()
#define cheri_setcause(x) __builtin_cheri_set_cause(x)
#define cheri_ccheckperm(c, p) __builtin_cheri_check_perms( \
__DECONST(__capability void *, (c)), (p))
#define cheri_cchecktype(c, t) __builtin_cheri_check_type( \
__DECONST(__capability void *, (c)), (t))
#define cheri_getdefault() __builtin_cheri_get_global_data_cap()
#define cheri_getidc() __builtin_cheri_get_invoke_data_cap()
#define cheri_getkr0c() __builtin_cheri_get_kernel_cap1()
#define cheri_getkr1c() __builtin_cheri_get_kernel_cap2()
#define cheri_getkcc() __builtin_cheri_get_kernel_code_cap()
#define cheri_getkdc() __builtin_cheri_get_kernel_data_cap()
#define cheri_getepcc() __builtin_cheri_get_exception_program_counter_cap()
#define cheri_getpcc() __builtin_cheri_get_program_counter_cap()
#define cheri_getstack() __builtin_memcap_stack_get()
#define cheri_local(c) cheri_andperm((c), ~CHERI_PERM_GLOBAL)
#define cheri_csetbounds(x, y) __builtin_memcap_bounds_set( \
__DECONST(__capability void *, (x)), (y))
/*
* Two variations on cheri_ptr() based on whether we are looking for a code or
* data capability. The compiler's use of CFromPtr will be with respect to
* $ddc or $pcc depending on the type of the pointer derived, so we need to
* use types to differentiate the two versions at compile time. We don't
* provide the full set of function variations for code pointers as they
* haven't proven necessary as yet.
*
* XXXRW: Ideally, casting via a function pointer would cause the compiler to
* derive the capability using CFromPtr on $pcc rather than on $ddc. This
* appears not currently to be the case, so manually derive using
* cheri_getpcc() for now.
*/
static __inline __capability void *
cheri_codeptr(const void *ptr, size_t len)
{
#ifdef NOTYET
__capability void (*c)(void) = ptr;
#else
# 118 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
__capability void *c = cheri_setoffset(cheri_getpcc(),
(vaddr_t)ptr);
#endif
# 121 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
/* Assume CFromPtr without base set, availability of CSetBounds. */
return (cheri_csetbounds(c, len));
}
static __inline __capability void *
cheri_codeptrperm(const void *ptr, size_t len, register_t perm)
{
return (cheri_andperm(cheri_codeptr(ptr, len),
perm | CHERI_PERM_GLOBAL));
}
static __inline __capability void *
cheri_ptr(const void *ptr, size_t len)
{
/* Assume CFromPtr without base set, availability of CSetBounds. */
return (cheri_csetbounds((const __capability void *)ptr, len));
}
static __inline __capability void *
cheri_ptrperm(const void *ptr, size_t len, register_t perm)
{
return (cheri_andperm(cheri_ptr(ptr, len), perm | CHERI_PERM_GLOBAL));
}
static __inline __capability void *
cheri_ptrpermoff(const void *ptr, size_t len, register_t perm, off_t off)
{
return (cheri_setoffset(cheri_ptrperm(ptr, len, perm), off));
}
/*
* Construct a capability suitable to describe a type identified by 'ptr';
* set it to zero-length with the offset equal to the base. The caller must
* provide a root capability (in the old world order, derived from $ddc, but
* in the new world order, likely extracted from the kernel using sysarch(2)).
*
* The caller may wish to assert various properties about the returned
* capability, including that CHERI_PERM_SEAL is set.
*/
static __inline __capability void *
cheri_maketype(__capability void *root_type, register_t type)
{
__capability void *c;
c = root_type;
c = cheri_setoffset(c, type); /* Set type as desired. */
c = cheri_csetbounds(c, 1); /* ISA implies length of 1. */
c = cheri_andperm(c, CHERI_PERM_GLOBAL | CHERI_PERM_SEAL); /* Perms. */
return (c);
}
static __inline __capability void *
cheri_zerocap(void)
{
return (__capability void *)0;
}
#define CHERI_PRINT_PTR(ptr) \
printf("%s: " #ptr " b:%016jx l:%016zx o:%jx\n", __func__, \
cheri_getbase((const __capability void *)(ptr)), \
cheri_getlen((const __capability void *)(ptr)), \
cheri_getoffset((const __capability void *)(ptr)))
#endif
# 189 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/cheric.h>
#endif /* expanded by -frewrite-includes */
# 190 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheric.h" 1 3 4
/*-
* Copyright (c) 2013-2016 Robert N. M. Watson
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _MIPS_INCLUDE_CHERIC_H_
#define _MIPS_INCLUDE_CHERIC_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 34 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheric.h" 3 4
# 35 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheric.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <cheri/cheri.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheric.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheric.h" 3 4
#if !defined(_KERNEL) && __has_feature(capabilities)
#define cheri_getreg(x) ({ \
__capability void *_cap; \
__asm __volatile ("cmove %0, $c" #x : "=C" (_cap)); \
_cap; \
})
#define cheri_setreg(x, cap) do { \
if ((x) == 0) \
__asm __volatile ("cmove $c" #x ", %0" : : "C" (cap) : \
"memory"); \
else \
__asm __volatile ("cmove $c" #x ", %0" : : "C" (cap)); \
} while (0)
#endif
# 53 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheric.h" 3 4
#endif /* _MIPS_INCLUDE_CHERIC_H_ */
# 55 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/cheric.h" 3 4
# 191 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 2 3 4
#endif /* _SYS_CHERIC_H_ */
# 193 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheric.h" 3 4
# 47 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <cheri/cheri_fd.h>
#endif /* expanded by -frewrite-includes */
# 47 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri_fd.h" 1 3 4
/*-
* Copyright (c) 2014-2015 Robert N. M. Watson
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _CHERI_FD_H_
#define _CHERI_FD_H_
extern __capability vm_offset_t *cheri_fd_vtable;
extern struct cheri_object cheri_fd;
#ifdef CHERI_FD_INTERNAL
#define CHERI_FD_CCALL \
__attribute__((cheri_ccallee)) \
__attribute__((cheri_method_suffix("_c"))) \
__attribute__((cheri_method_class(cheri_fd)))
#else
# 43 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri_fd.h" 3 4
#define CHERI_FD_CCALL \
__attribute__((cheri_ccall)) \
__attribute__((cheri_method_suffix("_c"))) \
__attribute__((cheri_method_class(cheri_fd)))
#endif
# 48 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri_fd.h" 3 4
/*
* Interfaces to create/revoke/destroy cheri_fd objects with ambient
* authority.
*/
int cheri_fd_new(int fd, struct cheri_object *cop);
void cheri_fd_revoke(struct cheri_object co);
void cheri_fd_destroy(struct cheri_object co);
/*
* All methods return the following structure, which fits in register return
* values for the calling convention. In practice, retval0 is what we think
* of as the normal return value for each method; retval1 holds an errno value
* if retval0 == -1. This is near-identical to the semantics of the kernel's
* td_retval[0,1].
*/
struct cheri_fd_ret {
register_t cfr_retval0; /* Actual return value. */
register_t cfr_retval1; /* errno if cfr_retval0 == -1. */
};
/*
* Methods that can be invoked on cheri_fd objects regardless of ambient
* authority.
*/
struct stat;
CHERI_FD_CCALL
struct cheri_fd_ret cheri_fd_fstat(__capability struct stat *sb_c);
CHERI_FD_CCALL
struct cheri_fd_ret cheri_fd_lseek(off_t offset, int whence);
CHERI_FD_CCALL
struct cheri_fd_ret cheri_fd_read(__capability void *buf_c,
size_t nbytes);
CHERI_FD_CCALL
struct cheri_fd_ret cheri_fd_write(__capability const void *buf_c,
size_t nbytes);
#endif /* !_CHERI_FD_H_ */
# 87 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/cheri_fd.h" 3 4
# 48 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <cheri/sandbox.h>
#endif /* expanded by -frewrite-includes */
# 48 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/sandbox.h" 1 3 4
/*-
* Copyright (c) 2012-2015 Robert N. M. Watson
* Copyright (c) 2015 SRI International
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _SANDBOX_H_
#define _SANDBOX_H_
/*
* This section defines the interface between 'inside' and 'outside' the
* sandbox model.
*/
/*
* Per-sandbox meta-data structure mapped read-only within the sandbox at a
* fixed address to allow sandboxed code to find its stack, heap, etc.
*
* NB: This data structure (and its base address) are part of the ABI between
* libcheri and programs running in sandboxes. Only ever append to this,
* don't modify the order, lengths, or interpretations of existing fields. If
* this reaches a page in size, then allocation code in sandbox.c will need
* updating. See also sandbox.c and sandboxasm.h.
*/
struct sandbox_metadata {
register_t sbm_heapbase; /* Offset: 0 */
register_t sbm_heaplen; /* Offset: 8 */
uint64_t _sbm_reserved0; /* Offset: 16 */
uint64_t _sbm_reserved1; /* Offset: 24 */
struct cheri_object sbm_system_object; /* Offset: 32 */
#if __has_feature(capabilities)
__capability vm_offset_t *sbm_vtable; /* Cap-offset: 2 */
__capability void *sbm_stackcap; /* Cap-offset: 3 */
#else
# 60 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/sandbox.h" 3 4
struct chericap sbm_vtable;
struct chericap sbm_stackcap;
#endif
# 63 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/sandbox.h" 3 4
};
/*
* This section defines interfaces for setting up, invoking, resetting, and
* destroying sandbox classes and objects.
*/
extern int sb_verbose;
/**
* The CHERI error number variable. If the stack is forcibly unwound as the
* result of signal delivery during a ccall invocation, this will be set to the
* signal number of the signal inside the sandbox. If a ccall invocation
* returns normally then this value is unmodified.
*/
extern _Thread_local int cherierrno;
struct sandbox_class;
int sandbox_class_new(const char *path, size_t maxmapsize,
struct sandbox_class **sbcpp);
int sandbox_class_method_declare(struct sandbox_class *sbcp,
u_int methodnum, const char *methodname);
void sandbox_class_destroy(struct sandbox_class *sbcp);
int sandbox_class_method_get_number(struct sandbox_class *sbcp,
const char *name);
struct sandbox_object;
int sandbox_object_new(struct sandbox_class *sbcp, size_t heaplen,
struct sandbox_object **sbopp);
int sandbox_object_new_flags(struct sandbox_class *sbcp, size_t heaplen,
uint flags, struct sandbox_object **sbopp);
/**
* Reset the stack of a sandbox. This is a temporary API until libcheri
* becomes responsible for managing a pool of stacks.
*/
int sandbox_object_stack_reset(struct sandbox_object *sbop);
int sandbox_object_reset(struct sandbox_object *sbop);
#if __has_feature(capabilities)
register_t sandbox_object_cinvoke(struct sandbox_object *sbop,
register_t methodnum, register_t a1,
register_t a2, register_t a3, register_t a4,
register_t a5, register_t a6, register_t a7,
__capability void *c3, __capability void *c4,
__capability void *c5, __capability void *c6,
__capability void *c7, __capability void *c8,
__capability void *c9, __capability void *c10);
#endif
# 110 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/sandbox.h" 3 4
register_t sandbox_object_invoke(struct sandbox_object *sbop,
register_t methodnum, register_t a1,
register_t a2, register_t a3, register_t a4,
register_t a5, register_t a6, register_t a7,
struct chericap *c3p, struct chericap *c4p,
struct chericap *c5p, struct chericap *c6p,
struct chericap *c7p, struct chericap *c8p,
struct chericap *c9p, struct chericap *c10p);
void sandbox_object_destroy(struct sandbox_object *sbop);
/*
* Flags for sandbox_object_new_flags():
*/
#define SANDBOX_OBJECT_FLAG_CONSOLE 0x00000001 /* printf(), etc. */
#define SANDBOX_OBJECT_FLAG_ALLOCFREE 0x00000002 /* calloc(), free(). */
#define SANDBOX_OBJECT_FLAG_USERFN 0x00000004 /* User callbacks. */
/*
* API to query the object-capability pair for the sandbox itself
*/
struct cheri_object sandbox_object_getobject(struct sandbox_object *sbop);
#if __has_feature(capabilities)
/**
* Get the sandbox's global data capability.
*/
__capability void *
sandbox_object_getsandboxdata(struct sandbox_object *sbop);
/**
* Get the sandbox's stack. This is a temporary API and should go away once
* libcheri is responsible for managing a pool of stacks and clearing them.
*/
__capability void *
sandbox_object_getsandboxstack(struct sandbox_object *sbop);
#endif
# 146 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/sandbox.h" 3 4
/*
* API to query system capabilities for use by sandboxes.
*/
struct cheri_object sandbox_object_getsystemobject(
struct sandbox_object *sbop);
#endif /* !_SANDBOX_H_ */
# 154 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheri/sandbox.h" 3 4
# 49 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <cheritest-helper.h>
#endif /* expanded by -frewrite-includes */
# 50 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheritest-helper.h" 1 3 4
/*-
* Copyright (c) 2013-2016 Robert N. M. Watson
* Copyright (c) 2014-2015 SRI International
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _LIBEXEC_CHERITEST_CHERITEST_HELPER_H_
#define _LIBEXEC_CHERITEST_CHERITEST_HELPER_H_
#define CHERITEST_HELPER_CAP_FAULT_CP2_BOUND 1
#define CHERITEST_HELPER_CAP_FAULT_CP2_PERM_LOAD 2
#define CHERITEST_HELPER_CAP_FAULT_CP2_PERM_STORE 3
#define CHERITEST_HELPER_CAP_FAULT_CP2_TAG 4
#define CHERITEST_HELPER_CAP_FAULT_CP2_SEAL 5
#define CHERITEST_HELPER_VM_FAULT_RFAULT 1
#define CHERITEST_HELPER_VM_FAULT_WFAULT 2
#define CHERITEST_HELPER_VM_FAULT_XFAULT 3
/*
* We use system-class extensions to allow cheritest-helper code to call back
* into cheritest to exercise various cases (e.g., stack-related tests).
* These are the corresponding method numbers.
*/
#define CHERITEST_USERFN_RETURNARG (CHERI_SYSTEM_USER_BASE)
#define CHERITEST_USERFN_GETSTACK (CHERI_SYSTEM_USER_BASE + 1)
#define CHERITEST_USERFN_SETSTACK (CHERI_SYSTEM_USER_BASE + 2)
/*
* Constants used to test BSS, .data, and constructor-based variable
* initialisation in sandboxes.
*/
#define CHERITEST_VALUE_BSS 0x00 /* Of course. */
#define CHERITEST_VALUE_DATA 0xaa
#define CHERITEST_VALUE_INVALID 0xbb
#define CHERITEST_VALUE_CONSTRUCTOR 0xcc
#ifdef LIST_ONLY
#define CHERITEST_CCALL
#define CHERITEST_CCALL2
#define BEGIN_CAPABILITIES
#define END_CAPABILITIES
#else
# 70 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheritest-helper.h" 3 4
#if __has_feature(pointer_interpretation)
#define BEGIN_CAPABILITIES \
_Pragma("pointer_interpretation push") \
_Pragma("pointer_interpretation capability")
#define END_CAPABILITIES \
_Pragma("pointer_interpretation pop")
#else
# 77 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheritest-helper.h" 3 4
#error Compiler does not support capabilities.
#endif
# 79 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheritest-helper.h" 3 4
extern struct cheri_object cheritest;
#ifdef CHERITEST_INTERNAL
#define CHERITEST_CCALL \
__attribute__((cheri_ccallee)) \
__attribute__((cheri_method_class(cheritest)))
#else
# 85 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheritest-helper.h" 3 4
#define CHERITEST_CCALL \
__attribute__((cheri_ccall)) \
__attribute__((cheri_method_suffix("_cap"))) \
__attribute__((cheri_method_class(cheritest)))
#endif
# 90 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheritest-helper.h" 3 4
extern struct cheri_object cheritest2;
#ifdef CHERITEST_INTERNAL
#define CHERITEST_CCALL2 \
__attribute__((cheri_ccallee)) \
__attribute__((cheri_method_class(cheritest2)))
#else
# 96 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheritest-helper.h" 3 4
#define CHERITEST_CCALL2 \
__attribute__((cheri_ccall)) \
__attribute__((cheri_method_suffix("_cap"))) \
__attribute__((cheri_method_class(cheritest2)))
#endif
# 101 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheritest-helper.h" 3 4
#endif
# 102 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheritest-helper.h" 3 4
struct cheri_object;
BEGIN_CAPABILITIES
CHERITEST_CCALL int invoke_divzero(void);
CHERITEST_CCALL int invoke_cheri_system_helloworld(void);
CHERITEST_CCALL int invoke_cheri_system_puts(void);
CHERITEST_CCALL int invoke_cheri_system_putchar(void);
CHERITEST_CCALL int invoke_cheri_system_printf(void);
CHERITEST_CCALL int invoke_abort(void);
CHERITEST_CCALL int invoke_md5(size_t len, char *data_input,
char *data_output);
CHERITEST_CCALL int invoke_cap_fault(register_t op);
CHERITEST_CCALL int invoke_vm_fault(register_t op);
CHERITEST_CCALL int invoke_syscall(void);
CHERITEST_CCALL int invoke_fd_fstat_c(struct cheri_object fd_object);
CHERITEST_CCALL int invoke_fd_lseek_c(struct cheri_object fd_object);
CHERITEST_CCALL int invoke_fd_read_c(struct cheri_object fd_object,
void *buf, size_t nbytes);
CHERITEST_CCALL int invoke_fd_write_c(struct cheri_object fd_object,
char *arg, size_t nbytes);
CHERITEST_CCALL int invoke_malloc(void);
CHERITEST_CCALL int invoke_system_calloc(void);
CHERITEST_CCALL int invoke_clock_gettime(void);
CHERITEST_CCALL int invoke_libcheri_userfn(register_t arg, size_t len);
CHERITEST_CCALL int invoke_libcheri_userfn_setstack(register_t arg);
CHERITEST_CCALL int invoke_libcheri_save_capability_in_heap(
void *data_input);
CHERITEST_CCALL register_t invoke_store_capability_in_bss(void *);
CHERITEST_CCALL register_t invoke_store_local_capability_in_bss(void *);
CHERITEST_CCALL register_t invoke_store_capability_in_stack(void *);
CHERITEST_CCALL register_t invoke_store_local_capability_in_stack(void *);
CHERITEST_CCALL void *invoke_return_capability(void *);
CHERITEST_CCALL void *invoke_return_local_capability(void *);
CHERITEST_CCALL register_t invoke_get_var_bss(void);
CHERITEST_CCALL register_t invoke_get_var_data(void);
CHERITEST_CCALL register_t invoke_set_var_data(register_t v);
CHERITEST_CCALL register_t invoke_get_var_constructor(void);
struct zstream_proxy;
CHERITEST_CCALL register_t invoke_inflate(struct zstream_proxy *zspp);
CHERITEST_CCALL register_t invoke_spin(void);
/* Test calling with a different default object */
CHERITEST_CCALL2 int call_invoke_md5(size_t len, char *data_input,
char *data_output);
CHERITEST_CCALL int sandbox_test_ptrdiff(void);
CHERITEST_CCALL int sandbox_test_varargs(void);
CHERITEST_CCALL int sandbox_test_va_copy(void);
END_CAPABILITIES
#endif /* !_LIBEXEC_CHERITEST_CHERITEST_HELPER_H_ */
# 157 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/cheritest-helper.h" 3 4
# 51 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <err.h>
#endif /* expanded by -frewrite-includes */
# 51 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/err.h" 1 3 4
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* 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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)err.h 8.1 (Berkeley) 6/2/93
* $FreeBSD$
*/
#ifndef _ERR_H_
#define _ERR_H_
/*
* Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two
* places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
* of them here we may collide with the utility's includes. It's unreasonable
* for utilities to have to include one of them to include err.h, so we get
* __va_list from <sys/_types.h> and use it.
*/
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 43 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/err.h" 3 4
# 44 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/err.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 44 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/err.h" 3 4
# 45 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/err.h" 3 4
__BEGIN_DECLS
void err(int, const char *, ...) __dead2 __printf0like(2, 3);
void verr(int, const char *, __va_list) __dead2 __printf0like(2, 0);
void errc(int, int, const char *, ...) __dead2 __printf0like(3, 4);
void verrc(int, int, const char *, __va_list) __dead2
__printf0like(3, 0);
void errx(int, const char *, ...) __dead2 __printf0like(2, 3);
void verrx(int, const char *, __va_list) __dead2 __printf0like(2, 0);
void warn(const char *, ...) __printf0like(1, 2);
void vwarn(const char *, __va_list) __printf0like(1, 0);
void warnc(int, const char *, ...) __printf0like(2, 3);
void vwarnc(int, const char *, __va_list) __printf0like(2, 0);
void warnx(const char *, ...) __printflike(1, 2);
void vwarnx(const char *, __va_list) __printflike(1, 0);
void err_set_file(void *);
void err_set_exit(void (*)(int));
__END_DECLS
#endif /* !_ERR_H_ */
# 65 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/err.h" 3 4
# 52 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <fcntl.h>
#endif /* expanded by -frewrite-includes */
# 52 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 1 3 4
/*-
* Copyright (c) 1983, 1990, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)fcntl.h 8.3 (Berkeley) 1/21/94
* $FreeBSD$
*/
#ifndef _SYS_FCNTL_H_
#define _SYS_FCNTL_H_
/*
* This file includes the definitions for open and fcntl
* described by POSIX for <fcntl.h>; it also includes
* related kernel definitions.
*/
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 47 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
# 48 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 48 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
# 49 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#ifndef _MODE_T_DECLARED
typedef __mode_t mode_t;
#define _MODE_T_DECLARED
#endif
# 54 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#ifndef _OFF_T_DECLARED
typedef __off_t off_t;
#define _OFF_T_DECLARED
#endif
# 59 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t;
#define _PID_T_DECLARED
#endif
# 64 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
/*
* File status flags: these are used by open(2), fcntl(2).
* They are also used (indirectly) in the kernel file structure f_flags,
* which is a superset of the open/fcntl flags. Open flags and f_flags
* are inter-convertible using OFLAGS(fflags) and FFLAGS(oflags).
* Open/fcntl flags begin with O_; kernel-internal flags begin with F.
*/
/* open-only flags */
#define O_RDONLY 0x0000 /* open for reading only */
#define O_WRONLY 0x0001 /* open for writing only */
#define O_RDWR 0x0002 /* open for reading and writing */
#define O_ACCMODE 0x0003 /* mask for above modes */
/*
* Kernel encoding of open mode; separate read and write bits that are
* independently testable: 1 greater than the above.
*
* XXX
* FREAD and FWRITE are excluded from the #ifdef _KERNEL so that TIOCFLUSH,
* which was documented to use FREAD/FWRITE, continues to work.
*/
#if __BSD_VISIBLE
#define FREAD 0x0001
#define FWRITE 0x0002
#endif
# 90 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#define O_NONBLOCK 0x0004 /* no delay */
#define O_APPEND 0x0008 /* set append mode */
#if __BSD_VISIBLE
#define O_SHLOCK 0x0010 /* open with shared file lock */
#define O_EXLOCK 0x0020 /* open with exclusive file lock */
#define O_ASYNC 0x0040 /* signal pgrp when data ready */
#define O_FSYNC 0x0080 /* synchronous writes */
#endif
# 98 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#define O_SYNC 0x0080 /* POSIX synonym for O_FSYNC */
#if __POSIX_VISIBLE >= 200809
#define O_NOFOLLOW 0x0100 /* don't follow symlinks */
#endif
# 102 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#define O_CREAT 0x0200 /* create if nonexistent */
#define O_TRUNC 0x0400 /* truncate to zero length */
#define O_EXCL 0x0800 /* error if already exists */
#ifdef _KERNEL
#define FHASLOCK 0x4000 /* descriptor holds advisory lock */
#endif
# 108 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
/* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */
#define O_NOCTTY 0x8000 /* don't assign controlling terminal */
#if __BSD_VISIBLE
/* Attempt to bypass buffer cache */
#define O_DIRECT 0x00010000
#endif
# 116 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __POSIX_VISIBLE >= 200809
#define O_DIRECTORY 0x00020000 /* Fail if not directory */
#define O_EXEC 0x00040000 /* Open for execute only */
#endif
# 121 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#ifdef _KERNEL
#define FEXEC O_EXEC
#endif
# 124 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __POSIX_VISIBLE >= 200809
/* Defined by POSIX 1003.1-2008; BSD default, but reserve for future use. */
#define O_TTY_INIT 0x00080000 /* Restore default termios attributes */
#define O_CLOEXEC 0x00100000
#endif
# 131 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __BSD_VISIBLE
#define O_VERIFY 0x00200000 /* open only after verification */
#endif
# 135 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
/*
* XXX missing O_DSYNC, O_RSYNC.
*/
#ifdef _KERNEL
/* Only for devfs d_close() flags. */
#define FLASTCLOSE O_DIRECTORY
#define FREVOKE O_VERIFY
/* Only for fo_close() from half-succeeded open */
#define FOPENFAILED O_TTY_INIT
/* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */
#define FFLAGS(oflags) ((oflags) & O_EXEC ? (oflags) : (oflags) + 1)
#define OFLAGS(fflags) ((fflags) & O_EXEC ? (fflags) : (fflags) - 1)
/* bits to save after open */
#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT|FEXEC)
/* bits settable by fcntl(F_SETFL, ...) */
#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FRDAHEAD|O_DIRECT)
#if defined(COMPAT_FREEBSD7) || defined(COMPAT_FREEBSD6) || \
defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4)
/*
* Set by shm_open(3) in older libc's to get automatic MAP_ASYNC
* behavior for POSIX shared memory objects (which are otherwise
* implemented as plain files).
*/
#define FPOSIXSHM O_NOFOLLOW
#undef FCNTLFLAGS
#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM|FRDAHEAD| \
O_DIRECT)
#endif
# 169 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#endif
# 170 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
/*
* The O_* flags used to have only F* names, which were used in the kernel
* and by fcntl. We retain the F* names for the kernel f_flag field
* and for backward compatibility for fcntl. These flags are deprecated.
*/
#if __BSD_VISIBLE
#define FAPPEND O_APPEND /* kernel/compat */
#define FASYNC O_ASYNC /* kernel/compat */
#define FFSYNC O_FSYNC /* kernel */
#define FNONBLOCK O_NONBLOCK /* kernel */
#define FNDELAY O_NONBLOCK /* compat */
#define O_NDELAY O_NONBLOCK /* compat */
#endif
# 184 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
/*
* We are out of bits in f_flag (which is a short). However,
* the flag bits not set in FMASK are only meaningful in the
* initial open syscall. Those bits can thus be given a
* different meaning for fcntl(2).
*/
#if __BSD_VISIBLE
/* Read ahead */
#define FRDAHEAD O_CREAT
#endif
# 195 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __POSIX_VISIBLE >= 200809
/*
* Magic value that specify the use of the current working directory
* to determine the target of relative file paths in the openat() and
* similar syscalls.
*/
#define AT_FDCWD -100
/*
* Miscellaneous flags for the *at() syscalls.
*/
#define AT_EACCESS 0x100 /* Check access using effective user and group ID */
#define AT_SYMLINK_NOFOLLOW 0x200 /* Do not follow symbolic links */
#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic link */
#define AT_REMOVEDIR 0x800 /* Remove directory instead of file */
#endif
# 212 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
/*
* Constants used for fcntl(2)
*/
/* command values */
#define F_DUPFD 0 /* duplicate file descriptor */
#define F_GETFD 1 /* get file descriptor flags */
#define F_SETFD 2 /* set file descriptor flags */
#define F_GETFL 3 /* get file status flags */
#define F_SETFL 4 /* set file status flags */
#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
#define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */
#define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */
#endif
# 227 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __BSD_VISIBLE
#define F_OGETLK 7 /* get record locking information */
#define F_OSETLK 8 /* set record locking information */
#define F_OSETLKW 9 /* F_SETLK; wait if blocked */
#define F_DUP2FD 10 /* duplicate file descriptor to arg */
#endif
# 233 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#define F_GETLK 11 /* get record locking information */
#define F_SETLK 12 /* set record locking information */
#define F_SETLKW 13 /* F_SETLK; wait if blocked */
#if __BSD_VISIBLE
#define F_SETLK_REMOTE 14 /* debugging support for remote locks */
#define F_READAHEAD 15 /* read ahead */
#define F_RDAHEAD 16 /* Darwin compatible read ahead */
#endif
# 241 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __POSIX_VISIBLE >= 200809
#define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */
#endif
# 244 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __BSD_VISIBLE
#define F_DUP2FD_CLOEXEC 18 /* Like F_DUP2FD, but FD_CLOEXEC is set */
#endif
# 247 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
/* file descriptor flags (F_GETFD, F_SETFD) */
#define FD_CLOEXEC 1 /* close-on-exec flag */
/* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */
#define F_RDLCK 1 /* shared or read lock */
#define F_UNLCK 2 /* unlock */
#define F_WRLCK 3 /* exclusive or write lock */
#if __BSD_VISIBLE
#define F_UNLCKSYS 4 /* purge locks for a given system ID */
#define F_CANCEL 5 /* cancel an async lock request */
#endif
# 259 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#ifdef _KERNEL
#define F_WAIT 0x010 /* Wait until lock is granted */
#define F_FLOCK 0x020 /* Use flock(2) semantics for lock */
#define F_POSIX 0x040 /* Use POSIX semantics for lock */
#define F_REMOTE 0x080 /* Lock owner is remote NFS client */
#define F_NOINTR 0x100 /* Ignore signals when waiting */
#endif
# 266 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
/*
* Advisory file segment locking data type -
* information passed to system by user
*/
struct flock {
off_t l_start; /* starting offset */
off_t l_len; /* len = 0 means until end of file */
pid_t l_pid; /* lock owner */
short l_type; /* lock type: read/write, etc. */
short l_whence; /* type of l_start */
int l_sysid; /* remote system id or zero for local */
};
#if __BSD_VISIBLE
/*
* Old advisory file segment locking data type,
* before adding l_sysid.
*/
struct __oflock {
off_t l_start; /* starting offset */
off_t l_len; /* len = 0 means until end of file */
pid_t l_pid; /* lock owner */
short l_type; /* lock type: read/write, etc. */
short l_whence; /* type of l_start */
};
#endif
# 293 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __BSD_VISIBLE
/* lock operations for flock(2) */
#define LOCK_SH 0x01 /* shared file lock */
#define LOCK_EX 0x02 /* exclusive file lock */
#define LOCK_NB 0x04 /* don't block when locking */
#define LOCK_UN 0x08 /* unlock file */
#endif
# 301 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __POSIX_VISIBLE >= 200112
/*
* Advice to posix_fadvise
*/
#define POSIX_FADV_NORMAL 0 /* no special treatment */
#define POSIX_FADV_RANDOM 1 /* expect random page references */
#define POSIX_FADV_SEQUENTIAL 2 /* expect sequential page references */
#define POSIX_FADV_WILLNEED 3 /* will need these pages */
#define POSIX_FADV_DONTNEED 4 /* dont need these pages */
#define POSIX_FADV_NOREUSE 5 /* access data only once */
#endif
# 313 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#ifndef _KERNEL
__BEGIN_DECLS
int open(const char *, int, ...);
int creat(const char *, mode_t);
int fcntl(int, int, ...);
#if __BSD_VISIBLE
int flock(int, int);
#endif
# 322 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __POSIX_VISIBLE >= 200809
int openat(int, const char *, int, ...);
#endif
# 325 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#if __POSIX_VISIBLE >= 200112
int posix_fadvise(int, off_t, off_t, int);
int posix_fallocate(int, off_t, off_t);
#endif
# 329 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
__END_DECLS
#endif
# 331 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
#endif /* !_SYS_FCNTL_H_ */
# 333 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/fcntl.h" 3 4
# 53 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 53 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/output-debug/sdk256/bin/../lib/clang/3.8.0/include/inttypes.h" 1 3 4
/*===---- inttypes.h - Standard header for integer printf macros ----------===*\
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
\*===----------------------------------------------------------------------===*/
#ifndef __CLANG_INTTYPES_H
#define __CLANG_INTTYPES_H
#if 0 /* expanded by -frewrite-includes */
#include_next <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 26 "/home/alr48/cheri/output-debug/sdk256/bin/../lib/clang/3.8.0/include/inttypes.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 1 3 4
/*-
* Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef _INTTYPES_H_
#define _INTTYPES_H_
#if 0 /* expanded by -frewrite-includes */
#include <machine/_inttypes.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_inttypes.h" 1 3 4
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* 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.
*
* 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.
*
* From: $NetBSD: int_fmtio.h,v 1.2 2001/04/26 16:25:21 kleink Exp $
* from: src/sys/i386/include/_inttypes.h,v 1.2 2002/06/30 05:48:02 mike
* $FreeBSD$
*/
#ifndef _MACHINE_INTTYPES_H_
#define _MACHINE_INTTYPES_H_
/*
* Macros for format specifiers.
*/
#ifdef __mips_n64
#define __PRI64 "l"
#ifndef __CHERI_PURE_CAPABILITY__
#define __PRIptr "l"
#else
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_inttypes.h" 3 4
#define __PRIptr "P"
#endif
# 48 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_inttypes.h" 3 4
#else
# 49 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_inttypes.h" 3 4
#define __PRI64 "ll"
#define __PRIptr
#endif
# 52 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_inttypes.h" 3 4
/* fprintf(3) macros for signed integers. */
#define PRId8 "d" /* int8_t */
#define PRId16 "d" /* int16_t */
#define PRId32 "d" /* int32_t */
#define PRId64 __PRI64"d" /* int64_t */
#define PRIdLEAST8 "d" /* int_least8_t */
#define PRIdLEAST16 "d" /* int_least16_t */
#define PRIdLEAST32 "d" /* int_least32_t */
#define PRIdLEAST64 __PRI64"d" /* int_least64_t */
#define PRIdFAST8 "d" /* int_fast8_t */
#define PRIdFAST16 "d" /* int_fast16_t */
#define PRIdFAST32 "d" /* int_fast32_t */
#define PRIdFAST64 __PRI64"d" /* int_fast64_t */
#define PRIdMAX "jd" /* intmax_t */
#define PRIdPTR __PRIptr"d" /* intptr_t */
#define PRIi8 "i" /* int8_t */
#define PRIi16 "i" /* int16_t */
#define PRIi32 "i" /* int32_t */
#define PRIi64 __PRI64"i" /* int64_t */
#define PRIiLEAST8 "i" /* int_least8_t */
#define PRIiLEAST16 "i" /* int_least16_t */
#define PRIiLEAST32 "i" /* int_least32_t */
#define PRIiLEAST64 __PRI64"i" /* int_least64_t */
#define PRIiFAST8 "i" /* int_fast8_t */
#define PRIiFAST16 "i" /* int_fast16_t */
#define PRIiFAST32 "i" /* int_fast32_t */
#define PRIiFAST64 __PRI64"i" /* int_fast64_t */
#define PRIiMAX "ji" /* intmax_t */
#define PRIiPTR __PRIptr"i" /* intptr_t */
/* fprintf(3) macros for unsigned integers. */
#define PRIo8 "o" /* uint8_t */
#define PRIo16 "o" /* uint16_t */
#define PRIo32 "o" /* uint32_t */
#define PRIo64 __PRI64"o" /* uint64_t */
#define PRIoLEAST8 "o" /* uint_least8_t */
#define PRIoLEAST16 "o" /* uint_least16_t */
#define PRIoLEAST32 "o" /* uint_least32_t */
#define PRIoLEAST64 __PRI64"o" /* uint_least64_t */
#define PRIoFAST8 "o" /* uint_fast8_t */
#define PRIoFAST16 "o" /* uint_fast16_t */
#define PRIoFAST32 "o" /* uint_fast32_t */
#define PRIoFAST64 __PRI64"o" /* uint_fast64_t */
#define PRIoMAX "jo" /* uintmax_t */
#define PRIoPTR __PRIptr"o" /* uintptr_t */
#define PRIu8 "u" /* uint8_t */
#define PRIu16 "u" /* uint16_t */
#define PRIu32 "u" /* uint32_t */
#define PRIu64 __PRI64"u" /* uint64_t */
#define PRIuLEAST8 "u" /* uint_least8_t */
#define PRIuLEAST16 "u" /* uint_least16_t */
#define PRIuLEAST32 "u" /* uint_least32_t */
#define PRIuLEAST64 __PRI64"u" /* uint_least64_t */
#define PRIuFAST8 "u" /* uint_fast8_t */
#define PRIuFAST16 "u" /* uint_fast16_t */
#define PRIuFAST32 "u" /* uint_fast32_t */
#define PRIuFAST64 __PRI64"u" /* uint_fast64_t */
#define PRIuMAX "ju" /* uintmax_t */
#define PRIuPTR __PRIptr"u" /* uintptr_t */
#define PRIx8 "x" /* uint8_t */
#define PRIx16 "x" /* uint16_t */
#define PRIx32 "x" /* uint32_t */
#define PRIx64 __PRI64"x" /* uint64_t */
#define PRIxLEAST8 "x" /* uint_least8_t */
#define PRIxLEAST16 "x" /* uint_least16_t */
#define PRIxLEAST32 "x" /* uint_least32_t */
#define PRIxLEAST64 __PRI64"x" /* uint_least64_t */
#define PRIxFAST8 "x" /* uint_fast8_t */
#define PRIxFAST16 "x" /* uint_fast16_t */
#define PRIxFAST32 "x" /* uint_fast32_t */
#define PRIxFAST64 __PRI64"x" /* uint_fast64_t */
#define PRIxMAX "jx" /* uintmax_t */
#define PRIxPTR __PRIptr"x" /* uintptr_t */
#define PRIX8 "X" /* uint8_t */
#define PRIX16 "X" /* uint16_t */
#define PRIX32 "X" /* uint32_t */
#define PRIX64 __PRI64"X" /* uint64_t */
#define PRIXLEAST8 "X" /* uint_least8_t */
#define PRIXLEAST16 "X" /* uint_least16_t */
#define PRIXLEAST32 "X" /* uint_least32_t */
#define PRIXLEAST64 __PRI64"X" /* uint_least64_t */
#define PRIXFAST8 "X" /* uint_fast8_t */
#define PRIXFAST16 "X" /* uint_fast16_t */
#define PRIXFAST32 "X" /* uint_fast32_t */
#define PRIXFAST64 __PRI64"X" /* uint_fast64_t */
#define PRIXMAX "jX" /* uintmax_t */
#define PRIXPTR __PRIptr"X" /* uintptr_t */
/* fscanf(3) macros for signed integers. */
#define SCNd8 "hhd" /* int8_t */
#define SCNd16 "hd" /* int16_t */
#define SCNd32 "d" /* int32_t */
#define SCNd64 __PRI64"d" /* int64_t */
#define SCNdLEAST8 "hhd" /* int_least8_t */
#define SCNdLEAST16 "hd" /* int_least16_t */
#define SCNdLEAST32 "d" /* int_least32_t */
#define SCNdLEAST64 __PRI64"d" /* int_least64_t */
#define SCNdFAST8 "d" /* int_fast8_t */
#define SCNdFAST16 "d" /* int_fast16_t */
#define SCNdFAST32 "d" /* int_fast32_t */
#define SCNdFAST64 __PRI64"d" /* int_fast64_t */
#define SCNdMAX "jd" /* intmax_t */
#define SCNdPTR __PRIptr"d" /* intptr_t */
#define SCNi8 "hhi" /* int8_t */
#define SCNi16 "hi" /* int16_t */
#define SCNi32 "i" /* int32_t */
#define SCNi64 __PRI64"i" /* int64_t */
#define SCNiLEAST8 "hhi" /* int_least8_t */
#define SCNiLEAST16 "hi" /* int_least16_t */
#define SCNiLEAST32 "i" /* int_least32_t */
#define SCNiLEAST64 __PRI64"i" /* int_least64_t */
#define SCNiFAST8 "i" /* int_fast8_t */
#define SCNiFAST16 "i" /* int_fast16_t */
#define SCNiFAST32 "i" /* int_fast32_t */
#define SCNiFAST64 __PRI64"i" /* int_fast64_t */
#define SCNiMAX "ji" /* intmax_t */
#define SCNiPTR __PRIptr"i" /* intptr_t */
/* fscanf(3) macros for unsigned integers. */
#define SCNo8 "hho" /* uint8_t */
#define SCNo16 "ho" /* uint16_t */
#define SCNo32 "o" /* uint32_t */
#define SCNo64 __PRI64"o" /* uint64_t */
#define SCNoLEAST8 "hho" /* uint_least8_t */
#define SCNoLEAST16 "ho" /* uint_least16_t */
#define SCNoLEAST32 "o" /* uint_least32_t */
#define SCNoLEAST64 __PRI64"o" /* uint_least64_t */
#define SCNoFAST8 "o" /* uint_fast8_t */
#define SCNoFAST16 "o" /* uint_fast16_t */
#define SCNoFAST32 "o" /* uint_fast32_t */
#define SCNoFAST64 __PRI64"o" /* uint_fast64_t */
#define SCNoMAX "jo" /* uintmax_t */
#define SCNoPTR __PRIptr"o" /* uintptr_t */
#define SCNu8 "hhu" /* uint8_t */
#define SCNu16 "hu" /* uint16_t */
#define SCNu32 "u" /* uint32_t */
#define SCNu64 __PRI64"u" /* uint64_t */
#define SCNuLEAST8 "hhu" /* uint_least8_t */
#define SCNuLEAST16 "hu" /* uint_least16_t */
#define SCNuLEAST32 "u" /* uint_least32_t */
#define SCNuLEAST64 __PRI64"u" /* uint_least64_t */
#define SCNuFAST8 "u" /* uint_fast8_t */
#define SCNuFAST16 "u" /* uint_fast16_t */
#define SCNuFAST32 "u" /* uint_fast32_t */
#define SCNuFAST64 __PRI64"u" /* uint_fast64_t */
#define SCNuMAX "ju" /* uintmax_t */
#define SCNuPTR __PRIptr"u" /* uintptr_t */
#define SCNx8 "hhx" /* uint8_t */
#define SCNx16 "hx" /* uint16_t */
#define SCNx32 "x" /* uint32_t */
#define SCNx64 __PRI64"x" /* uint64_t */
#define SCNxLEAST8 "hhx" /* uint_least8_t */
#define SCNxLEAST16 "hx" /* uint_least16_t */
#define SCNxLEAST32 "x" /* uint_least32_t */
#define SCNxLEAST64 __PRI64"x" /* uint_least64_t */
#define SCNxFAST8 "x" /* uint_fast8_t */
#define SCNxFAST16 "x" /* uint_fast16_t */
#define SCNxFAST32 "x" /* uint_fast32_t */
#define SCNxFAST64 __PRI64"x" /* uint_fast64_t */
#define SCNxMAX "jx" /* uintmax_t */
#define SCNxPTR __PRIptr"x" /* uintptr_t */
#endif /* !_MACHINE_INTTYPES_H_ */
# 227 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_inttypes.h" 3 4
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/stdint.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 1 3 4
/*-
* Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef _SYS_STDINT_H_
#define _SYS_STDINT_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 3 4
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 3 4
# 34 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_stdint.h>
#endif /* expanded by -frewrite-includes */
# 35 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 1 3 4
/*-
* Copyright (c) 2001, 2002 Mike Barcroft <mike@FreeBSD.org>
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* 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.
*
* from: src/sys/i386/include/_stdint.h,v 1.2 2004/05/18 16:04:57 stefanf
* $FreeBSD$
*/
#ifndef _MACHINE__STDINT_H_
#define _MACHINE__STDINT_H_
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
#define INT8_C(c) (c)
#define INT16_C(c) (c)
#define INT32_C(c) (c)
#define UINT8_C(c) (c)
#define UINT16_C(c) (c)
#define UINT32_C(c) (c ## U)
#ifdef __mips_n64
#define INT64_C(c) (c ## L)
#define UINT64_C(c) (c ## UL)
#else
# 58 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif
# 61 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#define INTMAX_C(c) INT64_C(c)
#define UINTMAX_C(c) UINT64_C(c)
#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
# 66 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
#ifndef __INT64_C
#ifdef __mips_n64
#define __INT64_C(c) (c ## L)
#define __UINT64_C(c) (c ## UL)
#else
# 74 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#define __INT64_C(c) (c ## LL)
#define __UINT64_C(c) (c ## ULL)
#endif
# 77 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#endif
# 78 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
/*
* ISO/IEC 9899:1999
* 7.18.2.1 Limits of exact-width integer types
*/
/* Minimum values of exact-width signed integer types. */
#define INT8_MIN (-0x7f-1)
#define INT16_MIN (-0x7fff-1)
#define INT32_MIN (-0x7fffffff-1)
#define INT64_MIN (-__INT64_C(0x7fffffffffffffff)-1)
/* Maximum values of exact-width signed integer types. */
#define INT8_MAX 0x7f
#define INT16_MAX 0x7fff
#define INT32_MAX 0x7fffffff
#define INT64_MAX __INT64_C(0x7fffffffffffffff)
/* Maximum values of exact-width unsigned integer types. */
#define UINT8_MAX 0xff
#define UINT16_MAX 0xffff
#define UINT32_MAX 0xffffffff
#define UINT64_MAX __UINT64_C(0xffffffffffffffff)
/*
* ISO/IEC 9899:1999
* 7.18.2.2 Limits of minimum-width integer types
*/
/* Minimum values of minimum-width signed integer types. */
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MIN INT64_MIN
/* Maximum values of minimum-width signed integer types. */
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MAX INT64_MAX
/* Maximum values of minimum-width unsigned integer types. */
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
/*
* ISO/IEC 9899:1999
* 7.18.2.3 Limits of fastest minimum-width integer types
*/
/* Minimum values of fastest minimum-width signed integer types. */
#define INT_FAST8_MIN INT32_MIN
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST64_MIN INT64_MIN
/* Maximum values of fastest minimum-width signed integer types. */
#define INT_FAST8_MAX INT32_MAX
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MAX INT64_MAX
/* Maximum values of fastest minimum-width unsigned integer types. */
#define UINT_FAST8_MAX UINT32_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
/*
* ISO/IEC 9899:1999
* 7.18.2.4 Limits of integer types capable of holding object pointers
*/
#ifdef __mips_n64
#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
#define UINTPTR_MAX UINT64_MAX
#else
# 154 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX
#define UINTPTR_MAX UINT32_MAX
#endif
# 158 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
/*
* ISO/IEC 9899:1999
* 7.18.2.5 Limits of greatest-width integer types
*/
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
/*
* ISO/IEC 9899:1999
* 7.18.3 Limits of other integer types
*/
#ifdef __mips_n64
/* Limits of ptrdiff_t. */
#define PTRDIFF_MIN INT64_MIN
#define PTRDIFF_MAX INT64_MAX
/* Limit of size_t. */
#define SIZE_MAX UINT64_MAX
#else
# 179 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
/* Limits of ptrdiff_t. */
#define PTRDIFF_MIN INT32_MIN
#define PTRDIFF_MAX INT32_MAX
/* Limit of size_t. */
#define SIZE_MAX UINT32_MAX
#endif
# 186 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
/* Limits of sig_atomic_t. */
#define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX
/* Limits of wint_t. */
#define WINT_MIN INT32_MIN
#define WINT_MAX INT32_MAX
#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
# 196 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#endif /* !_MACHINE__STDINT_H_ */
# 198 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_stdint.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 3 4
typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;
typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;
typedef __int_fast8_t int_fast8_t;
typedef __int_fast16_t int_fast16_t;
typedef __int_fast32_t int_fast32_t;
typedef __int_fast64_t int_fast64_t;
typedef __uint_fast8_t uint_fast8_t;
typedef __uint_fast16_t uint_fast16_t;
typedef __uint_fast32_t uint_fast32_t;
typedef __uint_fast64_t uint_fast64_t;
/* GNU and Darwin define this and people seem to think it's portable */
#if defined(UINTPTR_MAX) && defined(UINT64_MAX) && (UINTPTR_MAX == UINT64_MAX)
#define __WORDSIZE 64
#else
# 62 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 3 4
#define __WORDSIZE 32
#endif
# 64 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 3 4
/* Limits of wchar_t. */
#define WCHAR_MIN __WCHAR_MIN
#define WCHAR_MAX __WCHAR_MAX
#endif /* !_SYS_STDINT_H_ */
# 70 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/stdint.h" 3 4
# 34 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 2 3 4
#ifndef __cplusplus
#ifndef _WCHAR_T_DECLARED
typedef ___wchar_t wchar_t;
#define _WCHAR_T_DECLARED
#endif
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 3 4
#endif
# 41 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 3 4
typedef struct {
intmax_t quot; /* Quotient. */
intmax_t rem; /* Remainder. */
} imaxdiv_t;
__BEGIN_DECLS
#ifdef _XLOCALE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_inttypes.h>
#endif /* expanded by -frewrite-includes */
# 49 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 3 4
# 50 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 3 4
#endif
# 51 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 3 4
intmax_t imaxabs(intmax_t) __pure2;
imaxdiv_t imaxdiv(intmax_t, intmax_t) __pure2;
intmax_t strtoimax(const char * __restrict, char ** __restrict, int);
uintmax_t strtoumax(const char * __restrict, char ** __restrict, int);
intmax_t wcstoimax(const wchar_t * __restrict,
wchar_t ** __restrict, int);
uintmax_t wcstoumax(const wchar_t * __restrict,
wchar_t ** __restrict, int);
__END_DECLS
#endif /* !_INTTYPES_H_ */
# 63 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/inttypes.h" 3 4
# 27 "/home/alr48/cheri/output-debug/sdk256/bin/../lib/clang/3.8.0/include/inttypes.h" 2 3 4
#if defined(_MSC_VER) && _MSC_VER < 1900
/* MSVC headers define int32_t as int, but PRIx32 as "lx" instead of "x".
* This triggers format warnings, so fix it up here. */
#undef PRId32
#undef PRIdLEAST32
#undef PRIdFAST32
#undef PRIi32
#undef PRIiLEAST32
#undef PRIiFAST32
#undef PRIo32
#undef PRIoLEAST32
#undef PRIoFAST32
#undef PRIu32
#undef PRIuLEAST32
#undef PRIuFAST32
#undef PRIx32
#undef PRIxLEAST32
#undef PRIxFAST32
#undef PRIX32
#undef PRIXLEAST32
#undef PRIXFAST32
#undef SCNd32
#undef SCNdLEAST32
#undef SCNdFAST32
#undef SCNi32
#undef SCNiLEAST32
#undef SCNiFAST32
#undef SCNo32
#undef SCNoLEAST32
#undef SCNoFAST32
#undef SCNu32
#undef SCNuLEAST32
#undef SCNuFAST32
#undef SCNx32
#undef SCNxLEAST32
#undef SCNxFAST32
#define PRId32 "d"
#define PRIdLEAST32 "d"
#define PRIdFAST32 "d"
#define PRIi32 "i"
#define PRIiLEAST32 "i"
#define PRIiFAST32 "i"
#define PRIo32 "o"
#define PRIoLEAST32 "o"
#define PRIoFAST32 "o"
#define PRIu32 "u"
#define PRIuLEAST32 "u"
#define PRIuFAST32 "u"
#define PRIx32 "x"
#define PRIxLEAST32 "x"
#define PRIxFAST32 "x"
#define PRIX32 "X"
#define PRIXLEAST32 "X"
#define PRIXFAST32 "X"
#define SCNd32 "d"
#define SCNdLEAST32 "d"
#define SCNdFAST32 "d"
#define SCNi32 "i"
#define SCNiLEAST32 "i"
#define SCNiFAST32 "i"
#define SCNo32 "o"
#define SCNoLEAST32 "o"
#define SCNoFAST32 "o"
#define SCNu32 "u"
#define SCNuLEAST32 "u"
#define SCNuFAST32 "u"
#define SCNx32 "x"
#define SCNxLEAST32 "x"
#define SCNxFAST32 "x"
#endif
# 101 "/home/alr48/cheri/output-debug/sdk256/bin/../lib/clang/3.8.0/include/inttypes.h" 3 4
#endif /* __CLANG_INTTYPES_H */
# 103 "/home/alr48/cheri/output-debug/sdk256/bin/../lib/clang/3.8.0/include/inttypes.h" 3 4
# 54 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 54 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 1 3 4
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
*
* 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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)stdio.h 8.5 (Berkeley) 4/29/95
* $FreeBSD$
*/
#ifndef _STDIO_H_
#define _STDIO_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
# 41 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 41 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
# 42 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
typedef __off_t fpos_t;
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 49 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __POSIX_VISIBLE >= 200809
#ifndef _OFF_T_DECLARED
#define _OFF_T_DECLARED
typedef __off_t off_t;
#endif
# 55 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#ifndef _SSIZE_T_DECLARED
#define _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#endif
# 59 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#endif
# 60 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#ifndef _OFF64_T_DECLARED
#define _OFF64_T_DECLARED
typedef __off64_t off64_t;
#endif
# 65 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
#ifndef _VA_LIST_DECLARED
typedef __va_list va_list;
#define _VA_LIST_DECLARED
#endif
# 71 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#endif
# 72 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#define _FSTDIO /* Define for new stdio with functions. */
/*
* NB: to fit things in six character monocase externals, the stdio
* code uses the prefix `__s' for stdio objects, typically followed
* by a three-character attempt at a mnemonic.
*/
/* stdio buffers */
struct __sbuf {
unsigned char *_base;
int _size;
};
/*
* stdio state variables.
*
* The following always hold:
*
* if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
* _lbfsize is -_bf._size, else _lbfsize is 0
* if _flags&__SRD, _w is 0
* if _flags&__SWR, _r is 0
*
* This ensures that the getc and putc macros (or inline functions) never
* try to write or read from a file that is in `read' or `write' mode.
* (Moreover, they can, and do, automatically switch from read mode to
* write mode, and back, on "r+" and "w+" files.)
*
* _lbfsize is used only to make the inline line-buffered output stream
* code as compact as possible.
*
* _ub, _up, and _ur are used when ungetc() pushes back more characters
* than fit in the current _bf, or when ungetc() pushes back a character
* that does not match the previous one in _bf. When this happens,
* _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
* _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
*
* Certain members of __sFILE are accessed directly via macros or
* inline functions. To preserve ABI compat, these members must not
* be disturbed. These members are marked below with (*).
*/
struct __sFILE {
unsigned char *_p; /* (*) current position in (some) buffer */
int _r; /* (*) read space left for getc() */
int _w; /* (*) write space left for putc() */
short _flags; /* (*) flags, below; this FILE is free if 0 */
short _file; /* (*) fileno, if Unix descriptor, else -1 */
struct __sbuf _bf; /* (*) the buffer (at least 1 byte, if !NULL) */
int _lbfsize; /* (*) 0 or -_bf._size, for inline putc */
/* operations */
void *_cookie; /* (*) cookie passed to io functions */
int (*_close)(void *);
int (*_read)(void *, char *, int);
fpos_t (*_seek)(void *, fpos_t, int);
int (*_write)(void *, const char *, int);
/* separate buffer for long sequences of ungetc() */
struct __sbuf _ub; /* ungetc buffer */
unsigned char *_up; /* saved _p when _p is doing ungetc data */
int _ur; /* saved _r when _r is counting ungetc data */
/* tricks to meet minimum requirements even when malloc() fails */
unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
unsigned char _nbuf[1]; /* guarantee a getc() buffer */
/* separate buffer for fgetln() when line crosses buffer boundary */
struct __sbuf _lb; /* buffer for fgetln() */
/* Unix stdio files get aligned to block boundaries on fseek() */
int _blksize; /* stat.st_blksize (may be != _bf._size) */
fpos_t _offset; /* current lseek offset */
struct pthread_mutex *_fl_mutex; /* used for MT-safety */
struct pthread *_fl_owner; /* current owner */
int _fl_count; /* recursive lock count */
int _orientation; /* orientation for fwide() */
__mbstate_t _mbstate; /* multibyte conversion state */
int _flags2; /* additional flags */
};
#ifndef _STDFILE_DECLARED
#define _STDFILE_DECLARED
typedef struct __sFILE FILE;
#endif
# 158 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#ifndef _STDSTREAM_DECLARED
__BEGIN_DECLS
extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
__END_DECLS
#define _STDSTREAM_DECLARED
#endif
# 166 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#define __SLBF 0x0001 /* line buffered */
#define __SNBF 0x0002 /* unbuffered */
#define __SRD 0x0004 /* OK to read */
#define __SWR 0x0008 /* OK to write */
/* RD and WR are never simultaneously asserted */
#define __SRW 0x0010 /* open for reading & writing */
#define __SEOF 0x0020 /* found EOF */
#define __SERR 0x0040 /* found error */
#define __SMBF 0x0080 /* _bf._base is from malloc */
#define __SAPP 0x0100 /* fdopen()ed in append mode */
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
#define __SOPT 0x0400 /* do fseek() optimization */
#define __SNPT 0x0800 /* do not do fseek() optimization */
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
#define __SMOD 0x2000 /* true => fgetln modified _p text */
#define __SALC 0x4000 /* allocate string space dynamically */
#define __SIGN 0x8000 /* ignore this file in _fwalk */
#define __S2OAP 0x0001 /* O_APPEND mode is set */
/*
* The following three definitions are for ANSI C, which took them
* from System V, which brilliantly took internal interface macros and
* made them official arguments to setvbuf(), without renaming them.
* Hence, these ugly _IOxxx names are *supposed* to appear in user code.
*
* Although numbered as their counterparts above, the implementation
* does not rely on this.
*/
#define _IOFBF 0 /* setvbuf should set fully buffered */
#define _IOLBF 1 /* setvbuf should set line buffered */
#define _IONBF 2 /* setvbuf should set unbuffered */
#define BUFSIZ 1024 /* size of buffer used by setbuf */
#define EOF (-1)
/*
* FOPEN_MAX is a minimum maximum, and is the number of streams that
* stdio can provide without attempting to allocate further resources
* (which could fail). Do not use this for anything.
*/
/* must be == _POSIX_STREAM_MAX <limits.h> */
#ifndef FOPEN_MAX
#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
#endif
# 212 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
#if __XSI_VISIBLE
#define P_tmpdir "/tmp/"
#endif
# 218 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
#define TMP_MAX 308915776
#ifndef SEEK_SET
#define SEEK_SET 0 /* set file offset to offset */
#endif
# 224 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#ifndef SEEK_CUR
#define SEEK_CUR 1 /* set file offset to current plus offset */
#endif
# 227 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#ifndef SEEK_END
#define SEEK_END 2 /* set file offset to EOF plus offset */
#endif
# 230 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#define stdin __stdinp
#define stdout __stdoutp
#define stderr __stderrp
__BEGIN_DECLS
#ifdef _XLOCALE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_stdio.h>
#endif /* expanded by -frewrite-includes */
# 237 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
# 238 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#endif
# 239 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
/*
* Functions defined in ANSI C standard.
*/
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE * __restrict, fpos_t * __restrict);
char *fgets(char * __restrict, int, FILE * __restrict);
FILE *fopen(const char * __restrict, const char * __restrict);
int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3);
int fputc(int, FILE *);
int fputs(const char * __restrict, FILE * __restrict);
size_t fread(void * __restrict, size_t, size_t, FILE * __restrict);
FILE *freopen(const char * __restrict, const char * __restrict, FILE * __restrict);
int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3);;
int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict);
int getc(FILE *);
int getchar(void);
char *gets(char *);
void perror(const char *);
int printf(const char * __restrict, ...) __printflike(1, 2);
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
int rename(const char *, const char *);
void rewind(FILE *);
int scanf(const char * __restrict, ...) __scanflike(1, 2);
void setbuf(FILE * __restrict, char * __restrict);
int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3);
int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
FILE *tmpfile(void);
char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE * __restrict, const char * __restrict,
__va_list);
int vprintf(const char * __restrict, __va_list);
int vsprintf(char * __restrict, const char * __restrict,
__va_list);
#if __ISO_C_VISIBLE >= 1999
int snprintf(char * __restrict, size_t, const char * __restrict,
...) __printflike(3, 4);
int vfscanf(FILE * __restrict, const char * __restrict, __va_list)
__scanflike(2, 0);
int vscanf(const char * __restrict, __va_list) __scanflike(1, 0);
int vsnprintf(char * __restrict, size_t, const char * __restrict,
__va_list) __printflike(3, 0);
int vsscanf(const char * __restrict, const char * __restrict, __va_list)
__scanflike(2, 0);
#endif
# 297 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
/*
* Functions defined in all versions of POSIX 1003.1.
*/
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE <= 199506)
#define L_cuserid 17 /* size for cuserid(3); MAXLOGNAME, legacy */
#endif
# 304 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __POSIX_VISIBLE
#define L_ctermid 1024 /* size for ctermid(3); PATH_MAX */
char *ctermid(char *);
FILE *fdopen(int, const char *);
int fileno(FILE *);
#endif /* __POSIX_VISIBLE */
# 312 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __POSIX_VISIBLE >= 199209
int pclose(FILE *);
FILE *popen(const char *, const char *);
#endif
# 317 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __POSIX_VISIBLE >= 199506
int ftrylockfile(FILE *);
void flockfile(FILE *);
void funlockfile(FILE *);
/*
* These are normally used through macros as defined below, but POSIX
* requires functions as well.
*/
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
#endif
# 332 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __BSD_VISIBLE
void clearerr_unlocked(FILE *);
int feof_unlocked(FILE *);
int ferror_unlocked(FILE *);
int fileno_unlocked(FILE *);
#endif
# 338 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __POSIX_VISIBLE >= 200112
int fseeko(FILE *, __off_t, int);
__off_t ftello(FILE *);
#endif
# 343 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __BSD_VISIBLE || __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600
int getw(FILE *);
int putw(int, FILE *);
#endif /* BSD or X/Open before issue 6 */
# 348 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __XSI_VISIBLE
char *tempnam(const char *, const char *);
#endif
# 352 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __POSIX_VISIBLE >= 200809
FILE *fmemopen(void * __restrict, size_t, const char * __restrict);
ssize_t getdelim(char ** __restrict, size_t * __restrict, int,
FILE * __restrict);
FILE *open_memstream(char **, size_t *);
int renameat(int, const char *, int, const char *);
int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0);
/* _WITH_GETLINE to allow pre 11 sources to build on 11+ systems */
ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
int dprintf(int, const char * __restrict, ...) __printflike(2, 3);
#endif /* __POSIX_VISIBLE >= 200809 */
# 364 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
/*
* Routines that are purely local.
*/
#if __BSD_VISIBLE
int asprintf(char **, const char *, ...) __printflike(2, 3);
char *ctermid_r(char *);
void fcloseall(void);
int fdclose(FILE *, int *);
char *fgetln(FILE *, size_t *);
const char *fmtcheck(const char *, const char *) __format_arg(2);
int fpurge(FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);
int vasprintf(char **, const char *, __va_list)
__printflike(2, 0);
/*
* The system error table contains messages for the first sys_nerr
* positive errno values. Use strerror() or strerror_r() from <string.h>
* instead.
*/
extern const int sys_nerr;
extern const char * const sys_errlist[];
/*
* Stdio function-access interface.
*/
FILE *funopen(const void *,
int (*)(void *, char *, int),
int (*)(void *, const char *, int),
fpos_t (*)(void *, fpos_t, int),
int (*)(void *));
#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
typedef __ssize_t cookie_read_function_t(void *, char *, size_t);
typedef __ssize_t cookie_write_function_t(void *, const char *, size_t);
typedef int cookie_seek_function_t(void *, off64_t *, int);
typedef int cookie_close_function_t(void *);
typedef struct {
cookie_read_function_t *read;
cookie_write_function_t *write;
cookie_seek_function_t *seek;
cookie_close_function_t *close;
} cookie_io_functions_t;
FILE *fopencookie(void *, const char *, cookie_io_functions_t);
/*
* Portability hacks. See <sys/types.h>.
*/
#ifndef _FTRUNCATE_DECLARED
#define _FTRUNCATE_DECLARED
int ftruncate(int, __off_t);
#endif
# 419 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#ifndef _LSEEK_DECLARED
#define _LSEEK_DECLARED
__off_t lseek(int, __off_t, int);
#endif
# 423 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#ifndef _MMAP_DECLARED
#define _MMAP_DECLARED
void *mmap(void *, size_t, int, int, int, __off_t);
#endif
# 427 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#ifndef _TRUNCATE_DECLARED
#define _TRUNCATE_DECLARED
int truncate(const char *, __off_t);
#endif
# 431 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#endif /* __BSD_VISIBLE */
# 432 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
/*
* Functions internal to the implementation.
*/
int __srget(FILE *);
int __swbuf(int, FILE *);
/*
* The __sfoo macros are here so that we can
* define function versions in the C library.
*/
#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
#if defined(__GNUC__) && defined(__STDC__)
static __inline int __sputc(int _c, FILE *_p) {
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
else
return (__swbuf(_c, _p));
}
#else
# 452 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
/*
* This has been tuned to generate reasonable code on the vax using pcc.
*/
#define __sputc(c, p) \
(--(p)->_w < 0 ? \
(p)->_w >= (p)->_lbfsize ? \
(*(p)->_p = (c)), *(p)->_p != '\n' ? \
(int)*(p)->_p++ : \
__swbuf('\n', p) : \
__swbuf((int)(c), p) : \
(*(p)->_p = (c), (int)*(p)->_p++))
#endif
# 464 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
extern int __isthreaded;
#ifndef __cplusplus
#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
#define __sferror(p) (((p)->_flags & __SERR) != 0)
#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
#define __sfileno(p) ((p)->_file)
#define feof(p) (!__isthreaded ? __sfeof(p) : (feof)(p))
#define ferror(p) (!__isthreaded ? __sferror(p) : (ferror)(p))
#define clearerr(p) (!__isthreaded ? __sclearerr(p) : (clearerr)(p))
#if __POSIX_VISIBLE
#define fileno(p) (!__isthreaded ? __sfileno(p) : (fileno)(p))
#endif
# 482 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#define getc(fp) (!__isthreaded ? __sgetc(fp) : (getc)(fp))
#define putc(x, fp) (!__isthreaded ? __sputc(x, fp) : (putc)(x, fp))
#define getchar() getc(stdin)
#define putchar(x) putc(x, stdout)
#if __BSD_VISIBLE
/*
* See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12
* B.8.2.7 for the rationale behind the *_unlocked() macros.
*/
#define feof_unlocked(p) __sfeof(p)
#define ferror_unlocked(p) __sferror(p)
#define clearerr_unlocked(p) __sclearerr(p)
#define fileno_unlocked(p) __sfileno(p)
#endif
# 499 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#if __POSIX_VISIBLE >= 199506
#define getc_unlocked(fp) __sgetc(fp)
#define putc_unlocked(x, fp) __sputc(x, fp)
#define getchar_unlocked() getc_unlocked(stdin)
#define putchar_unlocked(x) putc_unlocked(x, stdout)
#endif
# 506 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
#endif /* __cplusplus */
# 507 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
__END_DECLS
#endif /* !_STDIO_H_ */
# 510 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdio.h" 3 4
# 55 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 55 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 1 3 4
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* 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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)stdlib.h 8.5 (Berkeley) 5/19/95
* $FreeBSD$
*/
#ifndef _STDLIB_H_
#define _STDLIB_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#if __BSD_VISIBLE
#ifndef _RUNE_T_DECLARED
typedef __rune_t rune_t;
#define _RUNE_T_DECLARED
#endif
# 45 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#endif
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 51 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#ifndef __cplusplus
#ifndef _WCHAR_T_DECLARED
typedef ___wchar_t wchar_t;
#define _WCHAR_T_DECLARED
#endif
# 57 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#endif
# 58 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
typedef struct {
int quot; /* quotient */
int rem; /* remainder */
} div_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#define RAND_MAX 0x7ffffffd
__BEGIN_DECLS
#ifdef _XLOCALE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_stdlib.h>
#endif /* expanded by -frewrite-includes */
# 76 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
# 77 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#endif
# 78 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
extern int __mb_cur_max;
extern int ___mb_cur_max(void);
#define MB_CUR_MAX ((size_t)___mb_cur_max())
_Noreturn void abort(void);
int abs(int) __pure2;
int atexit(void (*)(void));
double atof(const char *);
int atoi(const char *);
long atol(const char *);
void *bsearch(const void *, const void *, size_t,
size_t, int (*)(const void *, const void *));
void *calloc(size_t, size_t) __malloc_like __result_use_check
__alloc_size(1) __alloc_size(2);
div_t div(int, int) __pure2;
_Noreturn void exit(int);
void free(void *);
char *getenv(const char *);
long labs(long) __pure2;
ldiv_t ldiv(long, long) __pure2;
void *malloc(size_t) __malloc_like __result_use_check __alloc_size(1);
int mblen(const char *, size_t);
size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
void qsort(void *, size_t, size_t,
int (*)(const void *, const void *));
int rand(void);
void *realloc(void *, size_t) __result_use_check __alloc_size(2);
void srand(unsigned);
double strtod(const char * __restrict, char ** __restrict);
float strtof(const char * __restrict, char ** __restrict);
long strtol(const char * __restrict, char ** __restrict, int);
long double
strtold(const char * __restrict, char ** __restrict);
unsigned long
strtoul(const char * __restrict, char ** __restrict, int);
int system(const char *);
int wctomb(char *, wchar_t);
size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
/*
* Functions added in C99 which we make conditionally available in the
* BSD^C89 namespace if the compiler supports `long long'.
* The #if test is more complicated than it ought to be because
* __BSD_VISIBLE implies __ISO_C_VISIBLE == 1999 *even if* `long long'
* is not supported in the compilation environment (which therefore means
* that it can't really be ISO C99).
*
* (The only other extension made by C99 in thie header is _Exit().)
*/
#if __ISO_C_VISIBLE >= 1999 || defined(__cplusplus)
#ifdef __LONG_LONG_SUPPORTED
/* LONGLONG */
typedef struct {
long long quot;
long long rem;
} lldiv_t;
/* LONGLONG */
long long
atoll(const char *);
/* LONGLONG */
long long
llabs(long long) __pure2;
/* LONGLONG */
lldiv_t lldiv(long long, long long) __pure2;
/* LONGLONG */
long long
strtoll(const char * __restrict, char ** __restrict, int);
/* LONGLONG */
unsigned long long
strtoull(const char * __restrict, char ** __restrict, int);
#endif /* __LONG_LONG_SUPPORTED */
# 151 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
_Noreturn void _Exit(int);
#endif /* __ISO_C_VISIBLE >= 1999 */
# 154 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
/*
* If we're in a mode greater than C99, expose C11 functions.
*/
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1)
__alloc_size(2);
int at_quick_exit(void (*)(void));
_Noreturn void
quick_exit(int);
#endif /* __ISO_C_VISIBLE >= 2011 */
# 165 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
/*
* Extensions made by POSIX relative to C.
*/
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
char *realpath(const char * __restrict, char * __restrict);
#endif
# 171 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#if __POSIX_VISIBLE >= 199506
int rand_r(unsigned *); /* (TSF) */
#endif
# 174 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#if __POSIX_VISIBLE >= 200112
int posix_memalign(void **, size_t, size_t) __nonnull(1); /* (ADV) */
int setenv(const char *, const char *, int);
int unsetenv(const char *);
#endif
# 179 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE
int getsubopt(char **, char *const *, char **);
#ifndef _MKDTEMP_DECLARED
char *mkdtemp(char *);
#define _MKDTEMP_DECLARED
#endif
# 186 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#ifndef _MKSTEMP_DECLARED
int mkstemp(char *);
#define _MKSTEMP_DECLARED
#endif
# 190 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */
# 191 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
/*
* The only changes to the XSI namespace in revision 6 were the deletion
* of the ttyslot() and valloc() functions, which FreeBSD never declared
* in this header. For revision 7, ecvt(), fcvt(), and gcvt(), which
* FreeBSD also does not have, and mktemp(), are to be deleted.
*/
#if __XSI_VISIBLE
/* XXX XSI requires pollution from <sys/wait.h> here. We'd rather not. */
long a64l(const char *);
double drand48(void);
/* char *ecvt(double, int, int * __restrict, int * __restrict); */
double erand48(unsigned short[3]);
/* char *fcvt(double, int, int * __restrict, int * __restrict); */
/* char *gcvt(double, int, int * __restrict, int * __restrict); */
int grantpt(int);
char *initstate(unsigned int, char *, size_t);
long jrand48(unsigned short[3]);
char *l64a(long);
void lcong48(unsigned short[7]);
long lrand48(void);
#if !defined(_MKTEMP_DECLARED) && (__BSD_VISIBLE || __XSI_VISIBLE <= 600)
char *mktemp(char *);
#define _MKTEMP_DECLARED
#endif
# 216 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
long mrand48(void);
long nrand48(unsigned short[3]);
int posix_openpt(int);
char *ptsname(int);
int putenv(char *);
long random(void);
unsigned short
*seed48(unsigned short[3]);
char *setstate(/* const */ char *);
void srand48(long);
void srandom(unsigned int);
int unlockpt(int);
#endif /* __XSI_VISIBLE */
# 229 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
#if __BSD_VISIBLE
extern const char *malloc_conf;
extern void (*malloc_message)(void *, const char *);
/*
* The alloca() function can't be implemented in C, and on some
* platforms it can't be implemented at all as a callable function.
* The GNU C compiler provides a built-in alloca() which we can use;
* in all other cases, provide a prototype, mainly to pacify various
* incarnations of lint. On platforms where alloca() is not in libc,
* programs which use it will fail to link when compiled with non-GNU
* compilers.
*/
#if __GNUC__ >= 2 || defined(__INTEL_COMPILER)
#undef alloca /* some GNU bits try to get cute and define this on their own */
#define alloca(sz) __builtin_alloca(sz)
#elif defined(lint)
# 247 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
void *alloca(size_t);
#endif
# 249 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
void abort2(const char *, int, void **) __dead2;
__uint32_t
arc4random(void);
void arc4random_addrandom(unsigned char *, int);
void arc4random_buf(void *, size_t);
void arc4random_stir(void);
__uint32_t
arc4random_uniform(__uint32_t);
#ifdef __BLOCKS__
int atexit_b(void (^)(void));
void *bsearch_b(const void *, const void *, size_t,
size_t, int (^)(const void *, const void *));
#endif
# 263 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
char *getbsize(int *, long *);
/* getcap(3) functions */
char *cgetcap(char *, const char *, int);
int cgetclose(void);
int cgetent(char **, char **, const char *);
int cgetfirst(char **, char **);
int cgetmatch(const char *, const char *);
int cgetnext(char **, char **);
int cgetnum(char *, const char *, long *);
int cgetset(const char *);
int cgetstr(char *, const char *, char **);
int cgetustr(char *, const char *, char **);
int daemon(int, int);
char *devname(__dev_t, __mode_t);
char *devname_r(__dev_t, __mode_t, char *, int);
char *fdevname(int);
char *fdevname_r(int, char *, int);
int getloadavg(double [], int);
const char *
getprogname(void);
int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
#ifdef __BLOCKS__
int heapsort_b(void *, size_t, size_t, int (^)(const void *, const void *));
void qsort_b(void *, size_t, size_t,
int (^)(const void *, const void *));
#endif
# 291 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
int l64a_r(long, char *, int);
int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
#ifdef __BLOCKS__
int mergesort_b(void *, size_t, size_t, int (^)(const void *, const void *));
#endif
# 296 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
int mkostemp(char *, int);
int mkostemps(char *, int, int);
void qsort_r(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *));
int radixsort(const unsigned char **, int, const unsigned char *,
unsigned);
void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2)
__alloc_size(3);
void *reallocf(void *, size_t) __alloc_size(2);
int rpmatch(const char *);
void setprogname(const char *);
int sradixsort(const unsigned char **, int, const unsigned char *,
unsigned);
void sranddev(void);
void srandomdev(void);
long long
strtonum(const char *, long long, long long, const char **);
/* Deprecated interfaces, to be removed in FreeBSD 6.0. */
__int64_t
strtoq(const char *, char **, int);
__uint64_t
strtouq(const char *, char **, int);
#if __has_feature(capabilities)
long strtol_c(__capability const char * __restrict,
__capability char ** __restrict, int);
long double
strtold_c(__capability const char * __restrict,
__capability char ** __restrict);
#endif
# 327 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
extern char *suboptarg; /* getsubopt(3) external variable */
#endif /* __BSD_VISIBLE */
# 330 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
__END_DECLS
#endif /* !_STDLIB_H_ */
# 333 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdlib.h" 3 4
# 56 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 56 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 1 3 4
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* 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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)string.h 8.1 (Berkeley) 6/2/93
* $FreeBSD$
*/
#ifndef _STRING_H_
#define _STRING_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
/*
* Prototype functions which were historically defined in <string.h>, but
* are required by POSIX to be prototyped in <strings.h>.
*/
#if __BSD_VISIBLE
#if 0 /* expanded by -frewrite-includes */
#include <strings.h>
#endif /* expanded by -frewrite-includes */
# 45 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 1 3 4
/*-
* Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef _STRINGS_H_
#define _STRINGS_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
# 34 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
__BEGIN_DECLS
#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
int bcmp(const void *, const void *, size_t) __pure; /* LEGACY */
void bcopy(const void *, void *, size_t); /* LEGACY */
void bzero(void *, size_t); /* LEGACY */
#endif
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
#if __BSD_VISIBLE
void explicit_bzero(void *, size_t);
#endif
# 49 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
#if __XSI_VISIBLE
int ffs(int) __pure2;
#endif
# 52 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
#if __BSD_VISIBLE
int ffsl(long) __pure2;
int ffsll(long long) __pure2;
int fls(int) __pure2;
int flsl(long) __pure2;
int flsll(long long) __pure2;
#endif
# 59 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
char *index(const char *, int) __pure; /* LEGACY */
char *rindex(const char *, int) __pure; /* LEGACY */
#endif
# 63 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
int strcasecmp(const char *, const char *) __pure;
int strncasecmp(const char *, const char *, size_t) __pure;
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_strings.h>
#endif /* expanded by -frewrite-includes */
# 67 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_strings.h" 1 3 4
/*-
* Copyright (c) 2011, 2012 The FreeBSD Foundation
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_strings.h" 3 4
/*
* This file is included from both strings.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from string.h.
*/
#ifndef _XLOCALE_STRINGS1_H
#define _XLOCALE_STRINGS1_H
/*
* POSIX2008 functions
*/
int strcasecmp_l(const char *, const char *, locale_t);
int strncasecmp_l(const char *, const char *, size_t, locale_t);
#endif /* _XLOCALE_STRINGS1_H */
# 49 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_strings.h" 3 4
# 68 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 2 3 4
#endif
# 69 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
__END_DECLS
#endif /* _STRINGS_H_ */
# 72 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/strings.h" 3 4
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 2 3 4
#endif
# 47 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 52 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
__BEGIN_DECLS
#if __XSI_VISIBLE >= 600
void *memccpy(void * __restrict, const void * __restrict, int, size_t);
#endif
# 57 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
void *memchr(const void *, int, size_t) __pure;
#if __BSD_VISIBLE
void *memrchr(const void *, int, size_t) __pure;
#endif
# 61 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
int memcmp(const void *, const void *, size_t) __pure;
void *memcpy(void * __restrict, const void * __restrict, size_t);
#if __BSD_VISIBLE
void *memmem(const void *, size_t, const void *, size_t) __pure;
#endif
# 66 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
void *memmove(void *, const void *, size_t);
void *memset(void *, int, size_t);
#if __POSIX_VISIBLE >= 200809
char *stpcpy(char * __restrict, const char * __restrict);
char *stpncpy(char * __restrict, const char * __restrict, size_t);
#endif
# 72 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
#if __BSD_VISIBLE
char *strcasestr(const char *, const char *) __pure;
#endif
# 75 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
char *strcat(char * __restrict, const char * __restrict);
char *strchr(const char *, int) __pure;
#if __BSD_VISIBLE
char *strchrnul(const char*, int) __pure;
#endif
# 80 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
int strcmp(const char *, const char *) __pure;
int strcoll(const char *, const char *);
char *strcpy(char * __restrict, const char * __restrict);
size_t strcspn(const char *, const char *) __pure;
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
char *strdup(const char *) __malloc_like;
#endif
# 87 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
char *strerror(int);
#if __POSIX_VISIBLE >= 200112
int strerror_r(int, char *, size_t);
#endif
# 91 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
#if __BSD_VISIBLE
size_t strlcat(char * __restrict, const char * __restrict, size_t);
size_t strlcpy(char * __restrict, const char * __restrict, size_t);
#endif
# 95 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
size_t strlen(const char *) __pure;
#if __BSD_VISIBLE
void strmode(int, char *);
#endif
# 99 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
char *strncat(char * __restrict, const char * __restrict, size_t);
int strncmp(const char *, const char *, size_t) __pure;
char *strncpy(char * __restrict, const char * __restrict, size_t);
#if __POSIX_VISIBLE >= 200809
char *strndup(const char *, size_t) __malloc_like;
size_t strnlen(const char *, size_t) __pure;
#endif
# 106 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
#if __BSD_VISIBLE
char *strnstr(const char *, const char *, size_t) __pure;
#endif
# 109 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
char *strpbrk(const char *, const char *) __pure;
char *strrchr(const char *, int) __pure;
#if __BSD_VISIBLE
char *strsep(char **, const char *);
#endif
# 114 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
#if __POSIX_VISIBLE >= 200809
char *strsignal(int);
#endif
# 117 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
size_t strspn(const char *, const char *) __pure;
char *strstr(const char *, const char *) __pure;
char *strtok(char * __restrict, const char * __restrict);
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
char *strtok_r(char *, const char *, char **);
#endif
# 123 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
size_t strxfrm(char * __restrict, const char * __restrict, size_t);
#if __BSD_VISIBLE
#ifndef _SWAB_DECLARED
#define _SWAB_DECLARED
#ifndef _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif /* _SIZE_T_DECLARED */
# 133 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
void swab(const void * __restrict, void * __restrict, ssize_t);
#endif /* _SWAB_DECLARED */
# 136 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
#if __has_feature(capabilities)
__capability const void *
memchr_c_const(__capability const void *, int, size_t) __pure;
__capability void
*memchr_c(__capability const void *, int, size_t) __pure;
int memcmp_c(__capability const void *, __capability const void *, size_t)
__pure;
__capability void
*memcpy_c(__capability void * __restrict,
__capability const void * __restrict, size_t);
void *memcpy_c_fromcap(void * __restrict,
__capability const void * __restrict, size_t);
__capability void
*memcpy_c_tocap(__capability void * __restrict,
const void * __restrict, size_t);
__capability void
*memmove_c(__capability void * __restrict,
__capability const void * __restrict, size_t);
__capability void
*memset_c(__capability void *, int, size_t);
__capability char
*strchr_c(__capability const char *, int) __pure;
int strcmp_c(__capability const char *,
__capability const char *s2) __pure;
__capability char
*strcpy_c(__capability char * __restrict,
__capability const char * __restrict);
int strncmp_c(__capability const char *, __capability const char *,
size_t) __pure;
__capability char
*strncpy_c(__capability char * __restrict, __capability const char * __restrict,
size_t);
char *strncpy_c_fromcap(char * __restrict,
__capability const char * __restrict, size_t);
__capability char
*strncpy_c_tocap(__capability char * __restrict,
const char * __restrict, size_t);
size_t strnlen_c(__capability const char *, size_t) __pure;
#endif
# 177 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
int timingsafe_bcmp(const void *, const void *, size_t);
int timingsafe_memcmp(const void *, const void *, size_t);
#endif /* __BSD_VISIBLE */
# 181 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_string.h>
#endif /* expanded by -frewrite-includes */
# 183 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_string.h" 1 3 4
/*-
* Copyright (c) 2011, 2012 The FreeBSD Foundation
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*
* $FreeBSD$
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 33 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_string.h" 3 4
/*
* This file is included from both string.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from string.h.
*/
#ifndef _XLOCALE_STRING1_H
#define _XLOCALE_STRING1_H
/*
* POSIX2008 functions
*/
int strcoll_l(const char *, const char *, locale_t);
size_t strxfrm_l(char *, const char *, size_t, locale_t);
#endif /* _XLOCALE_STRING1_H */
# 49 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_string.h" 3 4
/*
* xlocale extensions
*/
#ifdef _XLOCALE_H_
#ifndef _XLOCALE_STRING2_H
#define _XLOCALE_STRING2_H
char *strcasestr_l(const char *, const char *, locale_t);
#endif /* _XLOCALE_STRING2_H */
# 59 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_string.h" 3 4
#endif /* _XLOCALE_H_ */
# 60 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/xlocale/_string.h" 3 4
# 184 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 2 3 4
#endif
# 185 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
__END_DECLS
#endif /* _STRING_H_ */
# 188 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/string.h" 3 4
# 57 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <sysexits.h>
#endif /* expanded by -frewrite-includes */
# 57 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sysexits.h" 1 3 4
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
*
* 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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)sysexits.h 8.1 (Berkeley) 6/2/93
*
* $FreeBSD$
*/
#ifndef _SYSEXITS_H_
#define _SYSEXITS_H_
/*
* SYSEXITS.H -- Exit status codes for system programs.
*
* This include file attempts to categorize possible error
* exit statuses for system programs, notably delivermail
* and the Berkeley network.
*
* Error numbers begin at EX__BASE to reduce the possibility of
* clashing with other exit statuses that random programs may
* already return. The meaning of the codes is approximately
* as follows:
*
* EX_USAGE -- The command was used incorrectly, e.g., with
* the wrong number of arguments, a bad flag, a bad
* syntax in a parameter, or whatever.
* EX_DATAERR -- The input data was incorrect in some way.
* This should only be used for user's data & not
* system files.
* EX_NOINPUT -- An input file (not a system file) did not
* exist or was not readable. This could also include
* errors like "No message" to a mailer (if it cared
* to catch it).
* EX_NOUSER -- The user specified did not exist. This might
* be used for mail addresses or remote logins.
* EX_NOHOST -- The host specified did not exist. This is used
* in mail addresses or network requests.
* EX_UNAVAILABLE -- A service is unavailable. This can occur
* if a support program or file does not exist. This
* can also be used as a catchall message when something
* you wanted to do doesn't work, but you don't know
* why.
* EX_SOFTWARE -- An internal software error has been detected.
* This should be limited to non-operating system related
* errors as possible.
* EX_OSERR -- An operating system error has been detected.
* This is intended to be used for such things as "cannot
* fork", "cannot create pipe", or the like. It includes
* things like getuid returning a user that does not
* exist in the passwd file.
* EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
* etc.) does not exist, cannot be opened, or has some
* sort of error (e.g., syntax error).
* EX_CANTCREAT -- A (user specified) output file cannot be
* created.
* EX_IOERR -- An error occurred while doing I/O on some file.
* EX_TEMPFAIL -- temporary failure, indicating something that
* is not really an error. In sendmail, this means
* that a mailer (e.g.) could not create a connection,
* and the request should be reattempted later.
* EX_PROTOCOL -- the remote system returned something that
* was "not possible" during a protocol exchange.
* EX_NOPERM -- You did not have sufficient permission to
* perform the operation. This is not intended for
* file system problems, which should use NOINPUT or
* CANTCREAT, but rather for higher level permissions.
*/
#define EX_OK 0 /* successful termination */
#define EX__BASE 64 /* base value for error messages */
#define EX_USAGE 64 /* command line usage error */
#define EX_DATAERR 65 /* data format error */
#define EX_NOINPUT 66 /* cannot open input */
#define EX_NOUSER 67 /* addressee unknown */
#define EX_NOHOST 68 /* host name unknown */
#define EX_UNAVAILABLE 69 /* service unavailable */
#define EX_SOFTWARE 70 /* internal software error */
#define EX_OSERR 71 /* system error (e.g., can't fork) */
#define EX_OSFILE 72 /* critical OS file missing */
#define EX_CANTCREAT 73 /* can't create (user) output file */
#define EX_IOERR 74 /* input/output error */
#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
#define EX_PROTOCOL 76 /* remote error in protocol */
#define EX_NOPERM 77 /* permission denied */
#define EX_CONFIG 78 /* configuration error */
#define EX__MAX 78 /* maximum listed value */
#endif /* !_SYSEXITS_H_ */
# 117 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sysexits.h" 3 4
# 58 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <unistd.h>
#endif /* expanded by -frewrite-includes */
# 58 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 1 3 4
/*-
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* 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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)unistd.h 8.12 (Berkeley) 4/27/95
* $FreeBSD$
*/
#ifndef _UNISTD_H_
#define _UNISTD_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h> /* XXX adds too much pollution. */
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/unistd.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
# 1 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 1 3 4
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* 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.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)unistd.h 8.2 (Berkeley) 1/7/94
* $FreeBSD$
*/
#ifndef _SYS_UNISTD_H_
#define _SYS_UNISTD_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
# 37 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
/*
* POSIX options and option groups we unconditionally do or don't
* implement. Those options which are implemented (or not) entirely
* in user mode are defined in <unistd.h>. Please keep this list in
* alphabetical order.
*
* Anything which is defined as zero below **must** have an
* implementation for the corresponding sysconf() which is able to
* determine conclusively whether or not the feature is supported.
* Anything which is defined as other than -1 below **must** have
* complete headers, types, and function declarations as specified by
* the POSIX standard; however, if the relevant sysconf() function
* returns -1, the functions may be stubbed out.
*/
#define _POSIX_ADVISORY_INFO 200112L
#define _POSIX_ASYNCHRONOUS_IO 200112L
#define _POSIX_CHOWN_RESTRICTED 1
#define _POSIX_CLOCK_SELECTION (-1)
#define _POSIX_CPUTIME 200112L
#define _POSIX_FSYNC 200112L
#define _POSIX_IPV6 0
#define _POSIX_JOB_CONTROL 1
#define _POSIX_MAPPED_FILES 200112L
#define _POSIX_MEMLOCK (-1)
#define _POSIX_MEMLOCK_RANGE 200112L
#define _POSIX_MEMORY_PROTECTION 200112L
#define _POSIX_MESSAGE_PASSING 200112L
#define _POSIX_MONOTONIC_CLOCK 200112L
#define _POSIX_NO_TRUNC 1
#define _POSIX_PRIORITIZED_IO (-1)
#define _POSIX_PRIORITY_SCHEDULING 200112L
#define _POSIX_RAW_SOCKETS 200112L
#define _POSIX_REALTIME_SIGNALS 200112L
#define _POSIX_SEMAPHORES 200112L
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
#define _POSIX_SPORADIC_SERVER (-1)
#define _POSIX_SYNCHRONIZED_IO (-1)
#define _POSIX_TIMEOUTS 200112L
#define _POSIX_TIMERS 200112L
#define _POSIX_TYPED_MEMORY_OBJECTS (-1)
#define _POSIX_VDISABLE 0xff
#if __XSI_VISIBLE
#define _XOPEN_SHM 1
#define _XOPEN_STREAMS (-1)
#endif
# 84 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
/*
* Although we have saved user/group IDs, we do not use them in setuid
* as described in POSIX 1003.1, because the feature does not work for
* root. We use the saved IDs in seteuid/setegid, which are not currently
* part of the POSIX 1003.1 specification. XXX revisit for 1003.1-2001
* as this is now mandatory.
*/
#ifdef _NOT_AVAILABLE
#define _POSIX_SAVED_IDS 1 /* saved set-user-ID and set-group-ID */
#endif
# 95 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
/* Define the POSIX.1 version we target for compliance. */
#define _POSIX_VERSION 200112L
/* access function */
#define F_OK 0 /* test for existence of file */
#define X_OK 0x01 /* test for execute or search permission */
#define W_OK 0x02 /* test for write permission */
#define R_OK 0x04 /* test for read permission */
/* whence values for lseek(2) */
#ifndef SEEK_SET
#define SEEK_SET 0 /* set file offset to offset */
#define SEEK_CUR 1 /* set file offset to current plus offset */
#define SEEK_END 2 /* set file offset to EOF plus offset */
#endif
# 111 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
#if __BSD_VISIBLE
#define SEEK_DATA 3 /* set file offset to next data past offset */
#define SEEK_HOLE 4 /* set file offset to next hole past offset */
#endif
# 115 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
#ifndef _POSIX_SOURCE
/* whence values for lseek(2); renamed by POSIX 1003.1 */
#define L_SET SEEK_SET
#define L_INCR SEEK_CUR
#define L_XTND SEEK_END
#endif
# 122 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
/* configurable pathname variables */
#define _PC_LINK_MAX 1
#define _PC_MAX_CANON 2
#define _PC_MAX_INPUT 3
#define _PC_NAME_MAX 4
#define _PC_PATH_MAX 5
#define _PC_PIPE_BUF 6
#define _PC_CHOWN_RESTRICTED 7
#define _PC_NO_TRUNC 8
#define _PC_VDISABLE 9
#if __POSIX_VISIBLE >= 199309
#define _PC_ASYNC_IO 53
#define _PC_PRIO_IO 54
#define _PC_SYNC_IO 55
#endif
# 139 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
#if __POSIX_VISIBLE >= 200112
#define _PC_ALLOC_SIZE_MIN 10
#define _PC_FILESIZEBITS 12
#define _PC_REC_INCR_XFER_SIZE 14
#define _PC_REC_MAX_XFER_SIZE 15
#define _PC_REC_MIN_XFER_SIZE 16
#define _PC_REC_XFER_ALIGN 17
#define _PC_SYMLINK_MAX 18
#endif
# 149 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
#if __BSD_VISIBLE
#define _PC_ACL_EXTENDED 59
#define _PC_ACL_PATH_MAX 60
#define _PC_CAP_PRESENT 61
#define _PC_INF_PRESENT 62
#define _PC_MAC_PRESENT 63
#define _PC_ACL_NFS4 64
#endif
# 158 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
/* From OpenSolaris, used by SEEK_DATA/SEEK_HOLE. */
#define _PC_MIN_HOLE_SIZE 21
#if __BSD_VISIBLE
/*
* rfork() options.
*
* XXX currently, some operations without RFPROC set are not supported.
*/
#define RFNAMEG (1<<0) /* UNIMPL new plan9 `name space' */
#define RFENVG (1<<1) /* UNIMPL copy plan9 `env space' */
#define RFFDG (1<<2) /* copy fd table */
#define RFNOTEG (1<<3) /* UNIMPL create new plan9 `note group' */
#define RFPROC (1<<4) /* change child (else changes curproc) */
#define RFMEM (1<<5) /* share `address space' */
#define RFNOWAIT (1<<6) /* give child to init */
#define RFCNAMEG (1<<10) /* UNIMPL zero plan9 `name space' */
#define RFCENVG (1<<11) /* UNIMPL zero plan9 `env space' */
#define RFCFDG (1<<12) /* close all fds, zero fd table */
#define RFTHREAD (1<<13) /* enable kernel thread support */
#define RFSIGSHARE (1<<14) /* share signal handlers */
#define RFLINUXTHPN (1<<16) /* do linux clone exit parent notification */
#define RFSTOPPED (1<<17) /* leave child in a stopped state */
#define RFHIGHPID (1<<18) /* use a pid higher than 10 (idleproc) */
#define RFTSIGZMB (1<<19) /* select signal for exit parent notification */
#define RFTSIGSHIFT 20 /* selected signal number is in bits 20-27 */
#define RFTSIGMASK 0xFF
#define RFTSIGNUM(flags) (((flags) >> RFTSIGSHIFT) & RFTSIGMASK)
#define RFTSIGFLAGS(signum) ((signum) << RFTSIGSHIFT)
#define RFPROCDESC (1<<28) /* return a process descriptor */
#define RFPPWAIT (1<<31) /* parent sleeps until child exits (vfork) */
#define RFFLAGS (RFFDG | RFPROC | RFMEM | RFNOWAIT | RFCFDG | \
RFTHREAD | RFSIGSHARE | RFLINUXTHPN | RFSTOPPED | RFHIGHPID | RFTSIGZMB | \
RFPROCDESC | RFPPWAIT)
#define RFKERNELONLY (RFSTOPPED | RFHIGHPID | RFPPWAIT | RFPROCDESC)
#endif /* __BSD_VISIBLE */
# 196 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
#endif /* !_SYS_UNISTD_H_ */
# 198 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/unistd.h" 3 4
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 39 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
# 41 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#ifndef _GID_T_DECLARED
typedef __gid_t gid_t;
#define _GID_T_DECLARED
#endif
# 46 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#ifndef _OFF_T_DECLARED
typedef __off_t off_t;
#define _OFF_T_DECLARED
#endif
# 51 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t;
#define _PID_T_DECLARED
#endif
# 56 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 61 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#ifndef _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif
# 66 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#ifndef _UID_T_DECLARED
typedef __uid_t uid_t;
#define _UID_T_DECLARED
#endif
# 71 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#ifndef _USECONDS_T_DECLARED
typedef __useconds_t useconds_t;
#define _USECONDS_T_DECLARED
#endif
# 76 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#define STDIN_FILENO 0 /* standard input file descriptor */
#define STDOUT_FILENO 1 /* standard output file descriptor */
#define STDERR_FILENO 2 /* standard error file descriptor */
#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
#define F_ULOCK 0 /* unlock locked section */
#define F_LOCK 1 /* lock a section for exclusive use */
#define F_TLOCK 2 /* test and lock a section for exclusive use */
#define F_TEST 3 /* test a section for locks by other procs */
#endif
# 87 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
/*
* POSIX options and option groups we unconditionally do or don't
* implement. This list includes those options which are exclusively
* implemented (or not) in user mode. Please keep this list in
* alphabetical order.
*
* Anything which is defined as zero below **must** have an
* implementation for the corresponding sysconf() which is able to
* determine conclusively whether or not the feature is supported.
* Anything which is defined as other than -1 below **must** have
* complete headers, types, and function declarations as specified by
* the POSIX standard; however, if the relevant sysconf() function
* returns -1, the functions may be stubbed out.
*/
#define _POSIX_BARRIERS 200112L
#define _POSIX_CPUTIME 200112L
#define _POSIX_READER_WRITER_LOCKS 200112L
#define _POSIX_REGEXP 1
#define _POSIX_SHELL 1
#define _POSIX_SPAWN 200112L
#define _POSIX_SPIN_LOCKS 200112L
#define _POSIX_THREAD_ATTR_STACKADDR 200112L
#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
#define _POSIX_THREAD_CPUTIME 200112L
#define _POSIX_THREAD_PRIO_INHERIT 200112L
#define _POSIX_THREAD_PRIO_PROTECT 200112L
#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
#define _POSIX_THREAD_PROCESS_SHARED 200112L
#define _POSIX_THREAD_SAFE_FUNCTIONS -1
#define _POSIX_THREAD_SPORADIC_SERVER -1
#define _POSIX_THREADS 200112L
#define _POSIX_TRACE -1
#define _POSIX_TRACE_EVENT_FILTER -1
#define _POSIX_TRACE_INHERIT -1
#define _POSIX_TRACE_LOG -1
#define _POSIX2_C_BIND 200112L /* mandatory */
#define _POSIX2_C_DEV -1 /* need c99 utility */
#define _POSIX2_CHAR_TERM 1
#define _POSIX2_FORT_DEV -1 /* need fort77 utility */
#define _POSIX2_FORT_RUN 200112L
#define _POSIX2_LOCALEDEF -1
#define _POSIX2_PBS -1
#define _POSIX2_PBS_ACCOUNTING -1
#define _POSIX2_PBS_CHECKPOINT -1
#define _POSIX2_PBS_LOCATE -1
#define _POSIX2_PBS_MESSAGE -1
#define _POSIX2_PBS_TRACK -1
#define _POSIX2_SW_DEV -1 /* XXX ??? */
#define _POSIX2_UPE 200112L
#define _V6_ILP32_OFF32 -1
#define _V6_ILP32_OFFBIG 0
#define _V6_LP64_OFF64 0
#define _V6_LPBIG_OFFBIG -1
#if __XSI_VISIBLE
#define _XOPEN_CRYPT -1 /* XXX ??? */
#define _XOPEN_ENH_I18N -1 /* mandatory in XSI */
#define _XOPEN_LEGACY -1
#define _XOPEN_REALTIME -1
#define _XOPEN_REALTIME_THREADS -1
#define _XOPEN_UNIX -1
#endif
# 150 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
/* Define the POSIX.2 version we target for compliance. */
#define _POSIX2_VERSION 199212L
/*
* POSIX-style system configuration variable accessors (for the
* sysconf function). The kernel does not directly implement the
* sysconf() interface; rather, a C library stub translates references
* to sysconf() into calls to sysctl() using a giant switch statement.
* Those that are marked `user' are implemented entirely in the C
* library and never query the kernel. pathconf() is implemented
* directly by the kernel so those are not defined here.
*/
#define _SC_ARG_MAX 1
#define _SC_CHILD_MAX 2
#define _SC_CLK_TCK 3
#define _SC_NGROUPS_MAX 4
#define _SC_OPEN_MAX 5
#define _SC_JOB_CONTROL 6
#define _SC_SAVED_IDS 7
#define _SC_VERSION 8
#define _SC_BC_BASE_MAX 9 /* user */
#define _SC_BC_DIM_MAX 10 /* user */
#define _SC_BC_SCALE_MAX 11 /* user */
#define _SC_BC_STRING_MAX 12 /* user */
#define _SC_COLL_WEIGHTS_MAX 13 /* user */
#define _SC_EXPR_NEST_MAX 14 /* user */
#define _SC_LINE_MAX 15 /* user */
#define _SC_RE_DUP_MAX 16 /* user */
#define _SC_2_VERSION 17 /* user */
#define _SC_2_C_BIND 18 /* user */
#define _SC_2_C_DEV 19 /* user */
#define _SC_2_CHAR_TERM 20 /* user */
#define _SC_2_FORT_DEV 21 /* user */
#define _SC_2_FORT_RUN 22 /* user */
#define _SC_2_LOCALEDEF 23 /* user */
#define _SC_2_SW_DEV 24 /* user */
#define _SC_2_UPE 25 /* user */
#define _SC_STREAM_MAX 26 /* user */
#define _SC_TZNAME_MAX 27 /* user */
#if __POSIX_VISIBLE >= 199309
#define _SC_ASYNCHRONOUS_IO 28
#define _SC_MAPPED_FILES 29
#define _SC_MEMLOCK 30
#define _SC_MEMLOCK_RANGE 31
#define _SC_MEMORY_PROTECTION 32
#define _SC_MESSAGE_PASSING 33
#define _SC_PRIORITIZED_IO 34
#define _SC_PRIORITY_SCHEDULING 35
#define _SC_REALTIME_SIGNALS 36
#define _SC_SEMAPHORES 37
#define _SC_FSYNC 38
#define _SC_SHARED_MEMORY_OBJECTS 39
#define _SC_SYNCHRONIZED_IO 40
#define _SC_TIMERS 41
#define _SC_AIO_LISTIO_MAX 42
#define _SC_AIO_MAX 43
#define _SC_AIO_PRIO_DELTA_MAX 44
#define _SC_DELAYTIMER_MAX 45
#define _SC_MQ_OPEN_MAX 46
#define _SC_PAGESIZE 47
#define _SC_RTSIG_MAX 48
#define _SC_SEM_NSEMS_MAX 49
#define _SC_SEM_VALUE_MAX 50
#define _SC_SIGQUEUE_MAX 51
#define _SC_TIMER_MAX 52
#endif
# 218 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if __POSIX_VISIBLE >= 200112
#define _SC_2_PBS 59 /* user */
#define _SC_2_PBS_ACCOUNTING 60 /* user */
#define _SC_2_PBS_CHECKPOINT 61 /* user */
#define _SC_2_PBS_LOCATE 62 /* user */
#define _SC_2_PBS_MESSAGE 63 /* user */
#define _SC_2_PBS_TRACK 64 /* user */
#define _SC_ADVISORY_INFO 65
#define _SC_BARRIERS 66 /* user */
#define _SC_CLOCK_SELECTION 67
#define _SC_CPUTIME 68
#define _SC_FILE_LOCKING 69
#define _SC_GETGR_R_SIZE_MAX 70 /* user */
#define _SC_GETPW_R_SIZE_MAX 71 /* user */
#define _SC_HOST_NAME_MAX 72
#define _SC_LOGIN_NAME_MAX 73
#define _SC_MONOTONIC_CLOCK 74
#define _SC_MQ_PRIO_MAX 75
#define _SC_READER_WRITER_LOCKS 76 /* user */
#define _SC_REGEXP 77 /* user */
#define _SC_SHELL 78 /* user */
#define _SC_SPAWN 79 /* user */
#define _SC_SPIN_LOCKS 80 /* user */
#define _SC_SPORADIC_SERVER 81
#define _SC_THREAD_ATTR_STACKADDR 82 /* user */
#define _SC_THREAD_ATTR_STACKSIZE 83 /* user */
#define _SC_THREAD_CPUTIME 84 /* user */
#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 /* user */
#define _SC_THREAD_KEYS_MAX 86 /* user */
#define _SC_THREAD_PRIO_INHERIT 87 /* user */
#define _SC_THREAD_PRIO_PROTECT 88 /* user */
#define _SC_THREAD_PRIORITY_SCHEDULING 89 /* user */
#define _SC_THREAD_PROCESS_SHARED 90 /* user */
#define _SC_THREAD_SAFE_FUNCTIONS 91 /* user */
#define _SC_THREAD_SPORADIC_SERVER 92 /* user */
#define _SC_THREAD_STACK_MIN 93 /* user */
#define _SC_THREAD_THREADS_MAX 94 /* user */
#define _SC_TIMEOUTS 95 /* user */
#define _SC_THREADS 96 /* user */
#define _SC_TRACE 97 /* user */
#define _SC_TRACE_EVENT_FILTER 98 /* user */
#define _SC_TRACE_INHERIT 99 /* user */
#define _SC_TRACE_LOG 100 /* user */
#define _SC_TTY_NAME_MAX 101 /* user */
#define _SC_TYPED_MEMORY_OBJECTS 102
#define _SC_V6_ILP32_OFF32 103 /* user */
#define _SC_V6_ILP32_OFFBIG 104 /* user */
#define _SC_V6_LP64_OFF64 105 /* user */
#define _SC_V6_LPBIG_OFFBIG 106 /* user */
#define _SC_IPV6 118
#define _SC_RAW_SOCKETS 119
#define _SC_SYMLOOP_MAX 120
#endif
# 272 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if __XSI_VISIBLE
#define _SC_ATEXIT_MAX 107 /* user */
#define _SC_IOV_MAX 56
#define _SC_PAGE_SIZE _SC_PAGESIZE
#define _SC_XOPEN_CRYPT 108 /* user */
#define _SC_XOPEN_ENH_I18N 109 /* user */
#define _SC_XOPEN_LEGACY 110 /* user */
#define _SC_XOPEN_REALTIME 111
#define _SC_XOPEN_REALTIME_THREADS 112
#define _SC_XOPEN_SHM 113
#define _SC_XOPEN_STREAMS 114
#define _SC_XOPEN_UNIX 115
#define _SC_XOPEN_VERSION 116
#define _SC_XOPEN_XCU_VERSION 117 /* user */
#endif
# 288 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if __BSD_VISIBLE
#define _SC_NPROCESSORS_CONF 57
#define _SC_NPROCESSORS_ONLN 58
#define _SC_CPUSET_SIZE 122
#endif
# 294 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
/* Extensions found in Solaris and Linux. */
#define _SC_PHYS_PAGES 121
/* Keys for the confstr(3) function. */
#if __POSIX_VISIBLE >= 199209
#define _CS_PATH 1 /* default value of PATH */
#endif
# 302 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if __POSIX_VISIBLE >= 200112
#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2
#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3
#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4
#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5
#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6
#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7
#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8
#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9
#define _CS_POSIX_V6_LP64_OFF64_LIBS 10
#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11
#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12
#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14
#endif
# 318 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
__BEGIN_DECLS
/* 1003.1-1990 */
void _exit(int) __dead2;
int access(const char *, int);
unsigned int alarm(unsigned int);
int chdir(const char *);
int chown(const char *, uid_t, gid_t);
int close(int);
void closefrom(int);
int dup(int);
int dup2(int, int);
int execl(const char *, const char *, ...) __null_sentinel;
int execle(const char *, const char *, ...);
int execlp(const char *, const char *, ...) __null_sentinel;
int execv(const char *, char * const *);
int execve(const char *, char * const *, char * const *);
int execvp(const char *, char * const *);
pid_t fork(void);
long fpathconf(int, int);
char *getcwd(char *, size_t);
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
int getgroups(int, gid_t []);
char *getlogin(void);
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getppid(void);
uid_t getuid(void);
int isatty(int);
int link(const char *, const char *);
#ifndef _LSEEK_DECLARED
#define _LSEEK_DECLARED
off_t lseek(int, off_t, int);
#endif
# 354 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
long pathconf(const char *, int);
int pause(void);
int pipe(int *);
ssize_t read(int, void *, size_t);
int rmdir(const char *);
int setgid(gid_t);
int setpgid(pid_t, pid_t);
pid_t setsid(void);
int setuid(uid_t);
unsigned int sleep(unsigned int);
long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
char *ttyname(int);
int ttyname_r(int, char *, size_t);
int unlink(const char *);
ssize_t write(int, const void *, size_t);
/* 1003.2-1992 */
#if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE
size_t confstr(int, char *, size_t);
#ifndef _GETOPT_DECLARED
#define _GETOPT_DECLARED
int getopt(int, char * const [], const char *);
extern char *optarg; /* getopt(3) external variables */
extern int optind, opterr, optopt;
#endif /* _GETOPT_DECLARED */
# 382 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#endif
# 383 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
/* ISO/IEC 9945-1: 1996 */
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
int fsync(int);
int fdatasync(int);
/*
* ftruncate() was in the POSIX Realtime Extension (it's used for shared
* memory), but truncate() was not.
*/
#ifndef _FTRUNCATE_DECLARED
#define _FTRUNCATE_DECLARED
int ftruncate(int, off_t);
#endif
# 397 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#endif
# 398 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if __POSIX_VISIBLE >= 199506
int getlogin_r(char *, int);
#endif
# 402 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
/* 1003.1-2001 */
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
int fchown(int, uid_t, gid_t);
ssize_t readlink(const char * __restrict, char * __restrict, size_t);
#endif
# 408 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if __POSIX_VISIBLE >= 200112
int gethostname(char *, size_t);
int setegid(gid_t);
int seteuid(uid_t);
#endif
# 413 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
/* 1003.1-2008 */
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE
int getsid(pid_t _pid);
int fchdir(int);
int getpgid(pid_t _pid);
int lchown(const char *, uid_t, gid_t);
ssize_t pread(int, void *, size_t, off_t);
ssize_t pwrite(int, const void *, size_t, off_t);
/* See comment at ftruncate() above. */
#ifndef _TRUNCATE_DECLARED
#define _TRUNCATE_DECLARED
int truncate(const char *, off_t);
#endif
# 428 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */
# 429 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if __POSIX_VISIBLE >= 200809
int faccessat(int, const char *, int, int);
int fchownat(int, const char *, uid_t, gid_t, int);
int fexecve(int, char *const [], char *const []);
int linkat(int, const char *, int, const char *, int);
ssize_t readlinkat(int, const char * __restrict, char * __restrict, size_t);
int symlinkat(const char *, int, const char *);
int unlinkat(int, const char *, int);
#endif /* __POSIX_VISIBLE >= 200809 */
# 439 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
/*
* symlink() was originally in POSIX.1a, which was withdrawn after
* being overtaken by events (1003.1-2001). It was in XPG4.2, and of
* course has been in BSD since 4.2.
*/
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402
int symlink(const char * __restrict, const char * __restrict);
#endif
# 448 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
/* X/Open System Interfaces */
#if __XSI_VISIBLE
char *crypt(const char *, const char *);
long gethostid(void);
int lockf(int, int, off_t);
int nice(int);
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
#ifndef _SWAB_DECLARED
#define _SWAB_DECLARED
void swab(const void * __restrict, void * __restrict, ssize_t);
#endif /* _SWAB_DECLARED */
# 462 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
void sync(void);
#endif /* __XSI_VISIBLE */
# 466 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if (__XSI_VISIBLE && __XSI_VISIBLE <= 500) || __BSD_VISIBLE
int brk(const void *);
int chroot(const char *);
int getdtablesize(void);
int getpagesize(void) __pure2;
char *getpass(const char *);
void *sbrk(intptr_t);
#endif
# 475 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if (__XSI_VISIBLE && __XSI_VISIBLE <= 600) || __BSD_VISIBLE
char *getwd(char *); /* obsoleted by getcwd() */
useconds_t
ualarm(useconds_t, useconds_t);
int usleep(useconds_t);
pid_t vfork(void) __returns_twice;
#endif
# 483 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if __BSD_VISIBLE
struct timeval; /* select(2) */
struct crypt_data {
int initialized; /* For compatibility with glibc. */
char __buf[256]; /* Buffer returned by crypt_r(). */
};
int acct(const char *);
int async_daemon(void);
int check_utility_compat(const char *);
const char *
crypt_get_format(void);
char *crypt_r(const char *, const char *, struct crypt_data *);
int crypt_set_format(const char *);
int dup3(int, int, int);
int eaccess(const char *, int);
void endusershell(void);
int exect(const char *, char * const *, char * const *);
int execvP(const char *, const char *, char * const *);
int feature_present(const char *);
char *fflagstostr(u_long);
int getdomainname(char *, int);
int getgrouplist(const char *, gid_t, gid_t *, int *);
int getloginclass(char *, size_t);
mode_t getmode(const void *, mode_t);
int getosreldate(void);
int getpeereid(int, uid_t *, gid_t *);
int getresgid(gid_t *, gid_t *, gid_t *);
int getresuid(uid_t *, uid_t *, uid_t *);
char *getusershell(void);
int initgroups(const char *, gid_t);
int iruserok(unsigned long, int, const char *, const char *);
int iruserok_sa(const void *, int, int, const char *, const char *);
int issetugid(void);
void __FreeBSD_libc_enter_restricted_mode(void);
long lpathconf(const char *, int);
#ifndef _MKDTEMP_DECLARED
char *mkdtemp(char *);
#define _MKDTEMP_DECLARED
#endif
# 525 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#ifndef _MKNOD_DECLARED
int mknod(const char *, mode_t, dev_t);
#define _MKNOD_DECLARED
#endif
# 529 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#ifndef _MKSTEMP_DECLARED
int mkstemp(char *);
#define _MKSTEMP_DECLARED
#endif
# 533 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
int mkstemps(char *, int);
#ifndef _MKTEMP_DECLARED
char *mktemp(char *);
#define _MKTEMP_DECLARED
#endif
# 538 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
int nfssvc(int, void *);
int nlm_syscall(int, int, int, char **);
int pipe2(int *, int);
int profil(char *, size_t, vm_offset_t, int);
int rcmd(char **, int, const char *, const char *, const char *, int *);
int rcmd_af(char **, int, const char *,
const char *, const char *, int *, int);
int rcmdsh(char **, int, const char *,
const char *, const char *, const char *);
char *re_comp(const char *);
int re_exec(const char *);
int reboot(int);
int revoke(const char *);
pid_t rfork(int);
pid_t rfork_thread(int, void *, int (*)(void *), void *);
int rresvport(int *);
int rresvport_af(int *, int);
int ruserok(const char *, int, const char *, const char *);
#if __BSD_VISIBLE
#ifndef _SELECT_DECLARED
#define _SELECT_DECLARED
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
#endif
# 561 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#endif
# 562 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
int setdomainname(const char *, int);
int setgroups(int, const gid_t *);
void sethostid(long);
int sethostname(const char *, int);
int setlogin(const char *);
int setloginclass(const char *);
void *setmode(const char *);
int setpgrp(pid_t, pid_t); /* obsoleted by setpgid() */
void setproctitle(const char *_fmt, ...) __printf0like(1, 2);
int setresgid(gid_t, gid_t, gid_t);
int setresuid(uid_t, uid_t, uid_t);
int setrgid(gid_t);
int setruid(uid_t);
void setusershell(void);
int strtofflags(char **, u_long *, u_long *);
int swapon(const char *);
int swapoff(const char *);
int syscall(int, ...);
off_t __syscall(quad_t, ...);
int undelete(const char *);
int unwhiteout(const char *);
void *valloc(size_t); /* obsoleted by malloc() */
#ifndef _OPTRESET_DECLARED
#define _OPTRESET_DECLARED
extern int optreset; /* getopt(3) external variable */
#endif
# 589 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#if __has_feature(capabilities)
ssize_t write_c(int, __capability const void *, size_t);
#endif
# 593 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
#endif /* __BSD_VISIBLE */
# 594 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
__END_DECLS
#endif /* !_UNISTD_H_ */
# 597 "/home/alr48/cheri/build-debug/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/unistd.h" 3 4
# 59 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
#if 0 /* expanded by -frewrite-includes */
#include "cheritest.h"
#endif /* expanded by -frewrite-includes */
# 60 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
# 1 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest.h" 1
/*-
* Copyright (c) 2012-2016 Robert N. M. Watson
* Copyright (c) 2014 SRI International
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _CHERITEST_H_
#define _CHERITEST_H_
#define CHERI_CAP_PRINT(cap) do { \
printf("tag %ju s %ju perms %08jx type %016jx\n", \
(uintmax_t)cheri_gettag(cap), \
(uintmax_t)cheri_getsealed(cap), \
(uintmax_t)cheri_getperm(cap), \
(uintmax_t)cheri_gettype(cap)); \
printf("\tbase %016jx length %016jx\n", \
(uintmax_t)cheri_getbase(cap), \
(uintmax_t)cheri_getlen(cap)); \
} while (0)
#define CHERI_CAPREG_PRINT(crn) do { \
__capability void *cap; \
if (crn == 0) \
cap = cheri_getdefault(); \
else \
cap = cheri_getreg(crn); \
printf("C%u ", crn); \
CHERI_CAP_PRINT(cap); \
} while (0)
#define CHERI_PCC_PRINT() do { \
__capability void *cap; \
cap = cheri_getpcc(); \
printf("PCC "); \
CHERI_CAP_PRINT(cap); \
} while (0)
/*
* Shared memory interface between tests and the test controller process.
*/
#define TESTRESULT_STR_LEN 1024
struct cheritest_child_state {
/* Fields filled in by the child signal handler. */
int ccs_signum;
register_t ccs_mips_cause;
register_t ccs_cp2_cause;
int ccs_unwound; /* If any trusted-stack frames unwound. */
/* Fields filled in by the test itself. */
int ccs_testresult;
char ccs_testresult_str[TESTRESULT_STR_LEN];
};
extern struct cheritest_child_state *ccsp;
/*
* If the test runs to completion, it must set ccs_testresult to SUCCESS or
* FAILURE. If the latter, it should also fill ccs_testresult_str with a
* suitable message to display to the user.
*/
#define TESTRESULT_UNKNOWN 0 /* Default initialisation. */
#define TESTRESULT_SUCCESS 1 /* Test declares success. */
#define TESTRESULT_FAILURE 2 /* Test declares failure. */
/*
* Description structure for each test -- passed to the test in case it needs
* access to configuration state, such as strings passed to/from stdio.
*/
#define CT_FLAG_SIGNAL 0x00000001 /* Should fault; checks signum. */
#define CT_FLAG_MIPS_EXCCODE 0x00000002 /* Check MIPS exception code. */
#define CT_FLAG_CP2_EXCCODE 0x00000004 /* Check CP2 exception code. */
#define CT_FLAG_STDOUT_STRING 0x00000008 /* Check stdout for a string. */
#define CT_FLAG_STDIN_STRING 0x00000010 /* Provide string on stdin. */
#define CT_FLAG_STDOUT_IGNORE 0x00000020 /* Standard output produced,
but not checkable */
#define CT_FLAG_SLOW 0x00000040 /* Test is expected to take a
long time to run */
#define CT_FLAG_SIGNAL_UNWIND 0x00000080 /* Should fault and unwind
trusted stack; checks signum
and result. */
#define CHERITEST_SANDBOX_UNWOUND 0x123456789ULL
struct cheri_test {
const char *ct_name;
const char *ct_desc;
int ct_arg; /* 0: ct_func; otherwise ct_func_arg. */
void (*ct_func)(const struct cheri_test *);
void (*ct_func_arg)(const struct cheri_test *, int);
const char * (*ct_check_xfail)(const char *);
u_int ct_flags;
int ct_signum;
register_t ct_mips_exccode;
register_t ct_cp2_exccode;
const char *ct_stdin_string;
const char *ct_stdout_string;
const char *ct_xfail_reason;
};
/*
* Useful APIs for tests. These terminate the process returning either
* success or failure with a test-defined, human-readable string describing
* the error.
*/
void cheritest_failure_err(const char *msg, ...) __dead2 __printflike(1, 2);
void cheritest_failure_errx(const char *msg, ...) __dead2 __printflike(1, 2);
void cheritest_success(void) __dead2;
void signal_handler_clear(int sig);
/* cheritest_bounds_heap.c */
void test_bounds_calloc(const struct cheri_test *ctp);
/* cheritest_bounds_stack.c */
void test_bounds_stack_static_uint8(const struct cheri_test *ctp);
void test_bounds_stack_static_uint16(const struct cheri_test *ctp);
void test_bounds_stack_static_uint32(const struct cheri_test *ctp);
void test_bounds_stack_static_uint64(const struct cheri_test *ctp);
void test_bounds_stack_static_cap(const struct cheri_test *ctp);
void test_bounds_stack_static_16(const struct cheri_test *ctp);
void test_bounds_stack_static_32(const struct cheri_test *ctp);
void test_bounds_stack_static_64(const struct cheri_test *ctp);
void test_bounds_stack_static_128(const struct cheri_test *ctp);
void test_bounds_stack_static_256(const struct cheri_test *ctp);
void test_bounds_stack_static_512(const struct cheri_test *ctp);
void test_bounds_stack_static_1024(const struct cheri_test *ctp);
void test_bounds_stack_static_2048(const struct cheri_test *ctp);
void test_bounds_stack_static_4096(const struct cheri_test *ctp);
void test_bounds_stack_static_8192(const struct cheri_test *ctp);
void test_bounds_stack_static_16384(const struct cheri_test *ctp);
void test_bounds_stack_static_32768(const struct cheri_test *ctp);
void test_bounds_stack_static_65536(const struct cheri_test *ctp);
void test_bounds_stack_static_131072(const struct cheri_test *ctp);
void test_bounds_stack_static_262144(const struct cheri_test *ctp);
void test_bounds_stack_static_524288(const struct cheri_test *ctp);
void test_bounds_stack_static_1048576(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_uint8(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_uint16(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_uint32(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_uint64(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_cap(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_16(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_32(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_64(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_128(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_256(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_512(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_1024(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_2048(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_4096(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_8192(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_16384(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_32768(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_65536(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_131072(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_262144(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_524288(const struct cheri_test *ctp);
void test_bounds_stack_dynamic_1048576(const struct cheri_test *ctp);
/* cheritest_ccall.c */
void cheritest_ccall_setup(void);
void test_nofault_ccall_creturn(const struct cheri_test *ctp);
void test_nofault_ccall_nop_creturn(const struct cheri_test *ctp);
void test_nofault_ccall_dli_creturn(const struct cheri_test *ctp);
void test_fault_creturn(const struct cheri_test *ctp);
void test_fault_ccall_code_untagged(const struct cheri_test *ctp);
void test_fault_ccall_data_untagged(const struct cheri_test *ctp);
void test_fault_ccall_code_unsealed(const struct cheri_test *ctp);
void test_fault_ccall_data_unsealed(const struct cheri_test *ctp);
void test_fault_ccall_typemismatch(const struct cheri_test *ctp);
void test_fault_ccall_code_noexecute(const struct cheri_test *ctp);
void test_fault_ccall_data_execute(const struct cheri_test *ctp);
/* cheritest_cheriabi.c */
void test_cheriabi_mmap_nospace(const struct cheri_test *ctp);
void test_cheriabi_mmap_perms(const struct cheri_test *ctp);
/* cheritest_fault.c */
void test_fault_bounds(const struct cheri_test *ctp);
void test_fault_cgetcause(const struct cheri_test *ctp);
void test_nofault_cfromptr(const struct cheri_test *ctp);
void test_fault_perm_load(const struct cheri_test *ctp);
void test_nofault_perm_load(const struct cheri_test *ctp);
void test_fault_perm_store(const struct cheri_test *ctp);
void test_nofault_perm_store(const struct cheri_test *ctp);
void test_fault_tag(const struct cheri_test *ctp);
void test_fault_ccheck_user_fail(const struct cheri_test *ctp);
void test_fault_read_kr1c(const struct cheri_test *ctp);
void test_fault_read_kr2c(const struct cheri_test *ctp);
void test_fault_read_kcc(const struct cheri_test *ctp);
void test_fault_read_kdc(const struct cheri_test *ctp);
void test_fault_read_epcc(const struct cheri_test *ctp);
void test_nofault_ccheck_user_pass(const struct cheri_test *ctp);
void test_sandbox_cp2_bound_catch(const struct cheri_test *ctp);
void test_sandbox_cp2_bound_nocatch(const struct cheri_test *ctp);
void test_sandbox_cp2_perm_load_catch(const struct cheri_test *ctp);
void test_sandbox_cp2_perm_load_nocatch(const struct cheri_test *ctp);
void test_sandbox_cp2_perm_store_catch(const struct cheri_test *ctp);
void test_sandbox_cp2_perm_store_nocatch(const struct cheri_test *ctp);
void test_sandbox_cp2_tag_catch(const struct cheri_test *ctp);
void test_sandbox_cp2_tag_nocatch(const struct cheri_test *ctp);
void test_sandbox_cp2_seal_catch(const struct cheri_test *ctp);
void test_sandbox_cp2_seal_nocatch(const struct cheri_test *ctp);
void test_sandbox_divzero_catch(const struct cheri_test *ctp);
void test_sandbox_divzero_nocatch(const struct cheri_test *ctp);
void test_sandbox_vm_rfault_catch(const struct cheri_test *ctp);
void test_sandbox_vm_rfault_nocatch(const struct cheri_test *ctp);
void test_sandbox_vm_wfault_catch(const struct cheri_test *ctp);
void test_sandbox_vm_wfault_nocatch(const struct cheri_test *ctp);
void test_sandbox_vm_xfault_catch(const struct cheri_test *ctp);
void test_sandbox_vm_xfault_nocatch(const struct cheri_test *ctp);
/* cheritest_fd.c */
#define CHERITEST_FD_READ_STR "read123"
#define CHERITEST_FD_WRITE_STR "write123"
extern int zero_fd;
extern struct cheri_object stdin_fd_object;
extern struct cheri_object stdout_fd_object;
extern struct cheri_object zero_fd_object;
void test_sandbox_fd_fstat(const struct cheri_test *ctp);
void test_sandbox_fd_lseek(const struct cheri_test *ctp);
void test_sandbox_fd_read(const struct cheri_test *ctp);
void test_sandbox_fd_read_revoke(const struct cheri_test *ctp);
void test_sandbox_fd_write(const struct cheri_test *ctp);
void test_sandbox_fd_write_revoke(const struct cheri_test *ctp);
/* cheritest_libcheri.c */
extern struct sandbox_class *cheritest_classp;
extern struct sandbox_object *cheritest_objectp;
void test_sandbox_abort(const struct cheri_test *ctp);
void test_sandbox_cs_calloc(const struct cheri_test *ctp);
void test_sandbox_cs_clock_gettime(const struct cheri_test *ctp);
void test_sandbox_cs_clock_gettime_default(const struct cheri_test *ctp);
void test_sandbox_cs_clock_gettime_deny(const struct cheri_test *ctp);
void test_sandbox_cs_helloworld(const struct cheri_test *ctp);
void test_sandbox_cs_putchar(const struct cheri_test *ctp);
void test_sandbox_cs_puts(const struct cheri_test *ctp);
void test_sandbox_malloc(const struct cheri_test *ctp);
void test_sandbox_md5_ccall(const struct cheri_test *ctp, int class2);
void test_sandbox_printf(const struct cheri_test *ctp);
void test_sandbox_ptrdiff(const struct cheri_test *ctp);
void test_sandbox_varargs(const struct cheri_test *ctp);
void test_sandbox_va_copy(const struct cheri_test *ctp);
void test_sandbox_spin(const struct cheri_test *ctp);
void test_sandbox_userfn(const struct cheri_test *ctp);
void test_2sandbox_newdestroy(const struct cheri_test *ctp);
int cheritest_libcheri_setup(void);
void cheritest_libcheri_destroy(void);
/* cheritest_local.c */
void test_sandbox_store_global_capability_in_bss(
const struct cheri_test *ctp);
void test_sandbox_store_local_capability_in_bss_catch(
const struct cheri_test *ctp);
void test_sandbox_store_local_capability_in_bss_nocatch(
const struct cheri_test *ctp);
void test_sandbox_store_global_capability_in_stack(
const struct cheri_test *ctp);
void test_sandbox_store_local_capability_in_stack(
const struct cheri_test *ctp);
void test_sandbox_return_global_capability(const struct cheri_test *ctp);
void test_sandbox_return_local_capability_catch(
const struct cheri_test *ctp);
void test_sandbox_return_local_capability_nocatch(
const struct cheri_test *ctp);
void test_sandbox_pass_local_capability_arg(const struct cheri_test *ctp);
/* cheritest_stack.c */
register_t cheritest_libcheri_userfn_getstack(void);
register_t cheritest_libcheri_userfn_setstack(register_t arg);
void test_sandbox_getstack(const struct cheri_test *ctp);
void test_sandbox_setstack(const struct cheri_test *ctp);
void test_sandbox_setstack_nop(const struct cheri_test *ctp);
/* cheritest_string.c */
void test_string_memcpy(const struct cheri_test *ctp);
void test_string_memcpy_c(const struct cheri_test *ctp);
void test_string_memmove(const struct cheri_test *ctp);
void test_string_memmove_c(const struct cheri_test *ctp);
/* cheritest_syscall.c */
void test_sandbox_syscall(const struct cheri_test *ctp);
/* cheritest_registers.c */
void test_initregs_default(const struct cheri_test *ctp);
void test_initregs_stack(const struct cheri_test *ctp);
void test_initregs_idc(const struct cheri_test *ctp);
void test_initregs_pcc(const struct cheri_test *ctp);
void test_copyregs(const struct cheri_test *ctp);
void test_listregs(const struct cheri_test *ctp);
/* cheritest_var.c */
void test_sandbox_var_bss(const struct cheri_test *ctp);
void test_sandbox_var_data(const struct cheri_test *ctp);
void test_sandbox_var_data_getset(const struct cheri_test *ctp);
void test_2sandbox_var_data_getset(const struct cheri_test *ctp);
void test_sandbox_var_constructor(const struct cheri_test *ctp);
/* cheritest_vm.c */
void cheritest_vm_tag_mmap_anon(const struct cheri_test *ctp __unused);
void cheritest_vm_tag_shm_open_anon_shared(const struct cheri_test *ctp
__unused);
void cheritest_vm_tag_shm_open_anon_private(const struct cheri_test *ctp
__unused);
void cheritest_vm_tag_dev_zero_shared(const struct cheri_test *ctp
__unused);
void cheritest_vm_tag_dev_zero_private(const struct cheri_test *ctp
__unused);
void cheritest_vm_notag_tmpfile_shared(const struct cheri_test *ctp __unused);
void cheritest_vm_tag_tmpfile_private(const struct cheri_test *ctp __unused);
void cheritest_vm_tag_tmpfile_private_prefault(const struct cheri_test *ctp
__unused);
void cheritest_vm_cow_read(const struct cheri_test *ctp);
void cheritest_vm_cow_write(const struct cheri_test *ctp);
const char *xfail_need_writable_tmp(const char *name);
const char *xfail_need_writable_non_tmpfs_tmp(const char *name);
/* cheritest_vm_swap.c */
void cheritest_vm_swap(const struct cheri_test *ctp __unused);
const char *xfail_swap_required(const char *name);
/* cheritest_zlib.c */
void test_deflate_zeroes(const struct cheri_test *ctp);
void test_inflate_zeroes(const struct cheri_test *ctp);
void test_sandbox_inflate_zeroes(const struct cheri_test *ctp);
#ifdef CHERI_C_TESTS
#define DECLARE_TEST(name, desc) \
void cheri_c_test_ ## name(const struct cheri_test *ctp __unused);
#define DECLARE_TEST_FAULT(name, desc) /* Not supported */
#if 0 /* expanded by -frewrite-includes */
#include <cheri_c_testdecls.h>
#endif /* expanded by -frewrite-includes */
# 358 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest.h"
# 359 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest.h"
#undef DECLARE_TEST
#endif
# 361 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest.h"
#endif /* !_CHERITEST_H_ */
# 363 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest.h"
# 61 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c" 2
void
test_copyregs(const struct cheri_test *ctp __unused)
{
CHERI_CGETDEFAULT(2);
CHERI_CGETDEFAULT(3);
CHERI_CGETDEFAULT(4);
CHERI_CGETDEFAULT(5);
CHERI_CGETDEFAULT(6);
CHERI_CGETDEFAULT(7);
cheritest_success();
}
void
test_listregs(const struct cheri_test *ctp __unused)
{
/*
* Because of the assembly generated by CP2_CR_GET(), can't use a loop
* -- register numbers must be available at compile-time.
*/
printf("CP2 registers:\n");
CHERI_CAPREG_PRINT(0);
CHERI_CAPREG_PRINT(1);
CHERI_CAPREG_PRINT(2);
CHERI_CAPREG_PRINT(3);
CHERI_CAPREG_PRINT(4);
CHERI_CAPREG_PRINT(5);
CHERI_CAPREG_PRINT(6);
CHERI_CAPREG_PRINT(7);
CHERI_CAPREG_PRINT(8);
CHERI_CAPREG_PRINT(9);
CHERI_CAPREG_PRINT(10);
CHERI_CAPREG_PRINT(11);
CHERI_CAPREG_PRINT(12);
CHERI_CAPREG_PRINT(13);
CHERI_CAPREG_PRINT(14);
CHERI_CAPREG_PRINT(15);
CHERI_CAPREG_PRINT(16);
CHERI_CAPREG_PRINT(17);
CHERI_CAPREG_PRINT(18);
CHERI_CAPREG_PRINT(19);
CHERI_CAPREG_PRINT(20);
CHERI_CAPREG_PRINT(21);
CHERI_CAPREG_PRINT(22);
CHERI_CAPREG_PRINT(23);
CHERI_CAPREG_PRINT(24);
CHERI_CAPREG_PRINT(25);
CHERI_CAPREG_PRINT(26);
CHERI_PCC_PRINT();
cheritest_success();
}
/*
* These tests assume that the compiler and run-time libraries won't muck with
* the global registers in question -- which is true at the time of writing.
*
* However, in the future, it could be that they are modified -- e.g., to
* differentiate memory capabilities from class-type capabilities. In that
* case, these tests would need to check the original capability values saved
* during process startup -- and also the new expected values.
*/
static void
check_initreg_code(__capability void *c)
{
register_t v;
/* Base. */
v = cheri_getbase(c);
if (v != CHERI_CAP_USER_CODE_BASE)
cheritest_failure_errx("base %jx (expected %jx)", v,
(uintmax_t)CHERI_CAP_USER_CODE_BASE);
/* Length. */
v = cheri_getlen(c);
if (v != CHERI_CAP_USER_CODE_LENGTH)
cheritest_failure_errx("length 0x%jx (expected 0x%jx)", v,
CHERI_CAP_USER_CODE_LENGTH);
/* Offset. */
v = cheri_getoffset(c);
if (v != CHERI_CAP_USER_CODE_OFFSET)
cheritest_failure_errx("offset %jx (expected %jx)", v,
(uintmax_t)CHERI_CAP_USER_CODE_OFFSET);
/* Type -- should be zero for an unsealed capability. */
v = cheri_gettype(c);
if (v != 0)
cheritest_failure_errx("otype %jx (expected %jx)", v, 0);
/* Permissions. */
v = cheri_getperm(c);
if (v != CHERI_CAP_USER_CODE_PERMS)
cheritest_failure_errx("perms %jx (expected %jx)", v,
(uintmax_t)CHERI_CAP_USER_CODE_PERMS);
/* Sealed bit. */
v = cheri_getsealed(c);
if (v != 0)
cheritest_failure_errx("sealed %jx (expected 0)", v);
/* Tag bit. */
v = cheri_gettag(c);
if (v != 1)
cheritest_failure_errx("tag %jx (expected 1)", v);
cheritest_success();
}
static void
check_initreg_data(__capability void *c)
{
register_t v;
/* Base. */
v = cheri_getbase(c);
if (v != CHERI_CAP_USER_DATA_BASE)
cheritest_failure_errx("base %jx (expected %jx)", v,
(uintmax_t)CHERI_CAP_USER_DATA_BASE);
/* Length. */
v = cheri_getlen(c);
if (v != CHERI_CAP_USER_DATA_LENGTH)
cheritest_failure_errx("length 0x%jx (expected 0x%jx)", v,
CHERI_CAP_USER_DATA_LENGTH);
/* Offset. */
v = cheri_getoffset(c);
if (v != CHERI_CAP_USER_DATA_OFFSET)
cheritest_failure_errx("offset %jx (expected %jx)", v,
(uintmax_t)CHERI_CAP_USER_DATA_OFFSET);
/* Type -- should be zero for an unsealed capability. */
v = cheri_gettype(c);
if (v != 0)
cheritest_failure_errx("otype %jx (expected %jx)", v, 0);
/* Permissions. */
v = cheri_getperm(c);
if (v != CHERI_CAP_USER_DATA_PERMS)
cheritest_failure_errx("perms %jx (expected %jx)", v,
(uintmax_t)CHERI_CAP_USER_DATA_PERMS);
/* Sealed bit. */
v = cheri_getsealed(c);
if (v != 0)
cheritest_failure_errx("sealed %jx (expected 0)", v);
/* Tag bit. */
v = cheri_gettag(c);
if (v != 1)
cheritest_failure_errx("tag %jx (expected 1)", v);
cheritest_success();
}
void
test_initregs_default(const struct cheri_test *ctp __unused)
{
check_initreg_data(cheri_getdefault());
}
/*
* Outside of CheriABI, we expect the stack capability to be the same as the
* default data capability, since we need the stack pointer ($sp) to be usable
* relative to either capability.
*
* Inside CheriABI, the stack capability should contain only the specific
* address range used for the stack. We could try to capture the same logic
* here as used in the kernel to select the stack -- but it seems more
* sensible to simply assert that the capability is not the same as the
* default capability for the MIPS ABI.
*/
void
test_initregs_stack(const struct cheri_test *ctp __unused)
#ifndef __CHERI_PURE_CAPABILITY__
{
check_initreg_data(cheri_getstack());
}
#else
# 242 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
{
__capability void *c = cheri_getstack();
register_t v;
/* Base. */
v = cheri_getbase(c);
if (v == CHERI_CAP_USER_DATA_BASE)
cheritest_failure_errx("base %jx (did not expect %jx)", v,
(uintmax_t)CHERI_CAP_USER_DATA_BASE);
/* Length. */
v = cheri_getlen(c);
if (v == CHERI_CAP_USER_DATA_LENGTH)
cheritest_failure_errx("length 0x%jx (did not expect 0x%jx)",
v, CHERI_CAP_USER_DATA_LENGTH);
/* Offset. */
v = cheri_getoffset(c);
if (v != CHERI_CAP_USER_DATA_OFFSET)
cheritest_failure_errx("offset %jx (expected %jx)", v,
(uintmax_t)CHERI_CAP_USER_DATA_OFFSET);
/* Type -- should be zero for an unsealed capability. */
v = cheri_gettype(c);
if (v != 0)
cheritest_failure_errx("otype %jx (expected %jx)", v, 0);
/* Permissions. */
v = cheri_getperm(c);
if (v != CHERI_CAP_USER_DATA_PERMS)
cheritest_failure_errx("perms %jx (expected %jx)", v,
(uintmax_t)CHERI_CAP_USER_DATA_PERMS);
/* Sealed bit. */
v = cheri_getsealed(c);
if (v != 0)
cheritest_failure_errx("sealed %jx (expected 0)", v);
/* Tag bit. */
v = cheri_gettag(c);
if (v != 1)
cheritest_failure_errx("tag %jx (expected 1)", v);
cheritest_success();
}
#endif
# 287 "/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c"
void
test_initregs_idc(const struct cheri_test *ctp __unused)
{
check_initreg_data(cheri_getidc());
}
void
test_initregs_pcc(const struct cheri_test *ctp __unused)
{
__capability void *c;
/* $pcc includes $pc, so clear that for the purposes of the check. */
c = cheri_getpcc();
c = cheri_setoffset(c, 0);
check_initreg_code(c);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment