diff options
author | Jay Freeman <saurik@saurik.com> | 2008-03-06 17:26:18 +0000 |
---|---|---|
committer | Jay Freeman <saurik@saurik.com> | 2008-03-06 17:26:18 +0000 |
commit | 294906ee694d21bb40a5ddc71d1cdb6278455f83 (patch) | |
tree | 15d1c6482bc2fedbabbea5002290db240f84c779 | |
parent | 67d8a376ae087b3668b96f1affbab031827662cd (diff) |
Committing all the headers I changed.
git-svn-id: http://svn.telesphoreo.org/trunk@161 514c082c-b64e-11dc-b46d-3d985efe055d
31 files changed, 5306 insertions, 0 deletions
diff --git a/tool/headers/architecture/arm/fenv.h b/tool/headers/architecture/arm/fenv.h new file mode 100644 index 000000000..0b8130ee0 --- /dev/null +++ b/tool/headers/architecture/arm/fenv.h @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/******************************************************************************* +* * +* File: fenv.h * +* * +* Contains: typedefs and prototypes for C99 floating point environment. * +* * +*******************************************************************************/ + +#ifndef __FENV__ +#define __FENV__ + +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC fenv +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + A collection of functions designed to provide access to the floating + point environment for numerical programming. It is compliant with + the floating-point requirements in C99. + + Earlier versions of fenv.h were merely "modeled after" C9X. Many of the functions + that formerly returned ints now return void to be standard compliant. + + Note: There are actually two physical floating point environments on x86. There + is the one described by the x87 floating point control and status words, which applies + primarily to calculations done with long double on MacOS X for Intel. There is the + MXCSR which applies primarily to calculations done with scalar float, scalar double + and SSE/SSE2/SSE3. The high level interface, which uses FE_ macros as int arguments + to configure the fexcep_t, returns and works with values that represents the logical + OR of these two sets of flags or masks. That is, if a flag or mask is set in either + environment, it will be set in fexcept_t when the state is read. Likewise, setting + the mask using a fexcep_t will set that mask on both environments. For this reason, + changing the value of the MXCSR state or floating point control/status word state on + your own will make the results of the functions declared in this header undefined. + See below for details about how and when. Exception: you may change the FZ, DAZ, DE + and DM bits in the MXCSR independent of this interface and retain defined behavior, + so long as you do not change the other bits. It is suggested that developers who wish + this level of control access the bits in the fenv_t directly. They are direct copies + of the hardware special purpose registers of similar name. Please consult appropriate + Intel documentation for the processor about the meaning of various bits in each register. + + The file <fenv.h> declares many functions in support of numerical + programming. Programs that test flags or run under + non-default modes must do so under the effect of an enabling + "fenv_access" pragma. +*/ + +/******************************************************************************** +* * +* fenv_t is a type for representing the entire floating-point * +* environment in a single object. * +* * +* fexcept_t is a type for representing the floating-point * +* exception flag state collectively. * +* * +********************************************************************************/ +typedef struct { + unsigned short __control; /* A direct copy of the floaing point control word */ + unsigned short __status; /* A direct copy of the floaing point status word */ + unsigned int __mxcsr; /* A direct copy of the MXCSR */ + char __reserved[8]; /* Reserved for future expansion. */ +} fenv_t; + +typedef unsigned short fexcept_t; + +/* Definitions of floating-point exception macros */ +enum { + _FE_INEXACT = 0x0020, + _FE_DIVBYZERO = 0x0004, + _FE_UNDERFLOW = 0x0010, + _FE_OVERFLOW = 0x0008, + _FE_INVALID = 0x0001, + _FE_ALL_EXCEPT = 0x003D /* FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID*/ +}; + +#define FE_INEXACT _FE_INEXACT +#define FE_DIVBYZERO _FE_DIVBYZERO +#define FE_UNDERFLOW _FE_UNDERFLOW +#define FE_OVERFLOW _FE_OVERFLOW +#define FE_INVALID _FE_INVALID +#define FE_ALL_EXCEPT _FE_ALL_EXCEPT + +/* Definitions of rounding direction macros */ +enum { + _FE_TONEAREST = 0x0000, + _FE_TOWARDZERO = 0x0C00, + _FE_UPWARD = 0x0800, + _FE_DOWNWARD = 0x0400 +}; + +#define FE_TONEAREST _FE_TONEAREST +#define FE_TOWARDZERO _FE_TOWARDZERO +#define FE_UPWARD _FE_UPWARD +#define FE_DOWNWARD _FE_DOWNWARD + +/* default environment object */ +extern const fenv_t _FE_DFL_ENV; +#define FE_DFL_ENV &_FE_DFL_ENV /* pointer to default environment */ + +/******************************************************************************* +* A environment object that sets to defualt settings and in addition sets the * +* FZ and DAZ bits in the MXCSR, which causes flush-to-zero behavior of * +* denormals. When using this environment, denormals encountered by XMM based * +* calculation (which normally should be all single and double precision scalar * +* floating point calculations, and all SSE/SSE2/SSE3 computation) will be * +* treated as zero. Calculation results that are denormals will also be * +* truncated to zero. This calculation mode is not IEEE-754 compliant, but may * +* prevent lengthy stalls that occur in code that encounters denormals. It is * +* suggested that you do not use this mode unless you have established that * +* denormals are causing trouble for your code. Please use wisely. * +* * +* It is not possible to disable denorm stalls on calculation using the x87 FPU.* +*******************************************************************************/ +extern const fenv_t _FE_DFL_DISABLE_SSE_DENORMS_ENV; +#define FE_DFL_DISABLE_SSE_DENORMS_ENV &_FE_DFL_DISABLE_SSE_DENORMS_ENV + +/******************************************************************************* +* The following functions provide high level access to the exception flags.* +* The "int" input argument can be constructed by bitwise ORs of the * +* exception macros: for example: FE_OVERFLOW | FE_INEXACT. * +*******************************************************************************/ + +/******************************************************************************* +* The function "feclearexcept" clears the supported floating point * +* exceptions represented by its argument. * +*******************************************************************************/ + +extern int feclearexcept(int /*excepts*/); + + +/******************************************************************************* +* The function "fegetexceptflag" stores a implementation-defined * +* representation of the states of the floating-point status flags indicated * +* by its integer argument excepts in the object pointed to by the argument, * +* flagp. * +*******************************************************************************/ + +extern int fegetexceptflag(fexcept_t * /*flagp*/, int /*excepts*/); + + +/******************************************************************************* +* The function "feraiseexcept" raises the supported floating-point * +* exceptions represented by its argument. The order in which these * +* floating-point exceptions are raised is unspecified. * +*******************************************************************************/ + +extern int feraiseexcept(int /*excepts*/); + + +/******************************************************************************* +* The function "fesetexceptflag" sets or clears the floating point status * +* flags indicated by the argument excepts to the states stored in the * +* object pointed to by flagp. The value of the *flagp shall have been set * +* by a previous call to fegetexceptflag whose second argument represented * +* at least those floating-point exceptions represented by the argument * +* excepts. This function does not raise floating-point exceptions; it just * +* sets the state of the flags. * +*******************************************************************************/ + +extern int fesetexceptflag(const fexcept_t * /*flagp*/, int /*excepts*/); + + +/******************************************************************************* +* The function "fetestexcept" determines which of the specified subset of * +* the floating-point exception flags are currently set. The excepts * +* argument specifies the floating-point status flags to be queried. This * +* function returns the value of the bitwise OR of the floating-point * +* exception macros corresponding to the currently set floating-point * +* exceptions included in excepts. * +* * +* On MacOS X for Intel, the result is the value of union of the * +* corresponding result from the x87 and SSE floating point states. * +*******************************************************************************/ + +extern int fetestexcept(int /*excepts*/); + + +/******************************************************************************* +* The following functions provide control of rounding direction modes. * +*******************************************************************************/ + +/******************************************************************************* +* The function "fegetround" returns the value of the rounding direction * +* macro which represents the current rounding direction, or a negative * +* if there is no such rounding direction macro or the current rounding * +* direction is not determinable. * +*******************************************************************************/ + +extern int fegetround(void); + + +/******************************************************************************* +* The function "fesetround" establishes the rounding direction represented * +* by its argument "round". If the argument is not equal to the value of a * +* rounding direction macro, the rounding direction is not changed. It * +* returns zero if and only if the argument is equal to a rounding * +* direction macro. * +*******************************************************************************/ + +extern int fesetround(int /*round*/); + + +/******************************************************************************* +* The following functions manage the floating-point environment, exception * +* flags and dynamic modes, as one entity. * +*******************************************************************************/ + +/******************************************************************************* +* The fegetenv function stores the current floating-point enviornment in * +* the object pointed to by envp. * +*******************************************************************************/ +extern int fegetenv(fenv_t * /*envp*/); + +/******************************************************************************* +* The feholdexcept function saves the current floating-point environment in * +* the object pointed to by envp, clears the floating-point status flags, * +* and then installs a non-stop (continue on floating-point exceptions) * +* mode, if available, for all floating-point exceptions. The feholdexcept * +* function returns zero if and only if non-stop floating-point exceptions * +* handling was successfully installed. * +*******************************************************************************/ +extern int feholdexcept(fenv_t * /*envp*/); + +/******************************************************************************* +* The fesetnv function establishes the floating-point environment * +* represented by the object pointed to by envp. The argument envp shall * +* point to an object set by a call to fegetenv or feholdexcept, or equal to * +* a floating-point environment macro -- we define only *FE_DFL_ENV and * +* FE_DISABLE_SSE_DENORMS_ENV -- to be C99 standard compliant and portable * +* to other architectures. Note that fesetnv merely installs the state of * +* the floating-point status flags represented through its argument, and * +* does not raise these floating-point exceptions. * +* * +* On MacOS X for Intel you may test and set the bits in *envp yourself, * +* provided that you conditionalize the code appropriately to preserve * +* portability and you follow the various strictures and suggestions * +* provided by Intel in appropriate processor documentation. Please be aware * +* that because there are two hardware locations for setting and reading * +* floating point environment, this function (and others like it) are not * +* atomic -- that is, for a brief period of time during the function call * +* your new environment will have been applied to one but not both of the * +* floating point engines (x87 and SSE). In addition, the behavior of some * +* higher level interfaces (fegetround) is undefined if the x87 and SSE * +* floating point units rounding modes are configured differently. Please * +* use common sense. * +*******************************************************************************/ +extern int fesetenv(const fenv_t * /*envp*/); + +/******************************************************************************* +* The feupdateenv function saves the currently raised floating-point * +* exceptions in its automatic storage, installs the floating-point * +* environment represented by the object pointed to by envp, and then raises * +* the saved floating-point exceptions. The argument envp shall point to an * +* object set by a call to feholdexcept or fegetenv or equal a * +* floating-point environment macro. * +* * +* Please see the description of feholdexcept for additional ways to create * +* a fenv_t object, which are valid only for MacOS X for Intel. * +*******************************************************************************/ +extern int feupdateenv(const fenv_t * /*envp*/); + + +#ifdef __cplusplus +} +#endif + +#endif /* __FENV__ */ + diff --git a/tool/headers/architecture/arm/math.h b/tool/headers/architecture/arm/math.h new file mode 100644 index 000000000..cb264017a --- /dev/null +++ b/tool/headers/architecture/arm/math.h @@ -0,0 +1,611 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/******************************************************************************* +* * +* File: math.h * +* * +* Contains: typedefs, prototypes, and macros germane to C99 floating point.* +* * +*******************************************************************************/ +#ifndef __MATH__ +#define __MATH__ + +#include "sys/cdefs.h" /* For definition of __DARWIN_UNIX03 et al */ + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** +* Floating point data types * +******************************************************************************/ + +/* Define float_t and double_t per C standard, ISO/IEC 9899:1999 7.12 2, + taking advantage of GCC's __FLT_EVAL_METHOD__ (which a compiler may + define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a compiler + must and may define only in float.h). +*/ +#if __FLT_EVAL_METHOD__ == 0 + typedef float float_t; + typedef double double_t; +#elif __FLT_EVAL_METHOD__ == 1 + typedef double float_t; + typedef double double_t; +#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1 + typedef long double float_t; + typedef long double double_t; +#else /* __FLT_EVAL_METHOD__ */ + #error "Unsupported value of __FLT_EVAL_METHOD__." +#endif /* __FLT_EVAL_METHOD__ */ + + +#if defined(__GNUC__) + #define HUGE_VAL __builtin_huge_val() + #define HUGE_VALF __builtin_huge_valf() + #define HUGE_VALL __builtin_huge_vall() + #define NAN __builtin_nanf("0x7fc00000") /* Constant expression, can be used as initializer. */ + #define __MATH_H_ALWAYS_INLINE__ __attribute__ ((always_inline)) +#else + #define HUGE_VAL 1e500 + #define HUGE_VALF 1e50f + #define HUGE_VALL 1e5000L + #define NAN __nan( ) + #define __MATH_H_ALWAYS_INLINE__ +#endif + +#define INFINITY HUGE_VALF + + +/****************************************************************************** +* Taxonomy of floating point data types * +******************************************************************************/ + +enum { + _FP_NAN = 1, /* NaN */ + _FP_INFINITE = 2, /* + or - infinity */ + _FP_ZERO = 3, /* + or - zero */ + _FP_NORMAL = 4, /* all normal numbers */ + _FP_SUBNORMAL = 5, /* denormal numbers */ + _FP_SUPERNORMAL = 6 /* long double delivering > LDBL_DIG, e.g. 1. + 2^-1000 */ +}; + +#define FP_NAN _FP_NAN +#define FP_INFINITE _FP_INFINITE +#define FP_ZERO _FP_ZERO +#define FP_NORMAL _FP_NORMAL +#define FP_SUBNORMAL _FP_SUBNORMAL +#define FP_SUPERNORMAL _FP_SUPERNORMAL + +/* fma() *function call* is more costly than equivalent (in-line) multiply and add operations */ +/* For single and double precision, the cost isn't too bad, because we can fall back on higher */ +/* precision hardware, with the necessary range to handle infinite precision products. However, */ +/* expect the long double fma to be at least an order of magnitude slower than a simple multiply */ +/* and an add. */ +#undef FP_FAST_FMA +#undef FP_FAST_FMAF +#undef FP_FAST_FMAL + +/* The values returned by `ilogb' for 0 and NaN respectively. */ +#define FP_ILOGB0 (-2147483647 - 1) +#define FP_ILOGBNAN (-2147483647 - 1) + +/* Bitmasks for the math_errhandling macro. */ +#define MATH_ERRNO 1 /* errno set by math functions. */ +#define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */ + +#define math_errhandling (__math_errhandling()) +extern unsigned int __math_errhandling ( void ); + +/******************************************************************************** +* * +* Inquiry macros * +* * +* fpclassify Returns one of the FP_Å values. * +* isnormal Non-zero if and only if the argument x is normalized. * +* isfinite Non-zero if and only if the argument x is finite. * +* isnan Non-zero if and only if the argument x is a NaN. * +* signbit Non-zero if and only if the sign of the argument x is * +* negative. This includes, NaNs, infinities and zeros. * +* * +********************************************************************************/ + +#define fpclassify(x) \ + ( sizeof (x) == sizeof(float ) ? __fpclassifyf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __fpclassifyd((double)(x)) \ + : __fpclassify ((long double)(x))) + +extern int __fpclassifyf(float ); +extern int __fpclassifyd(double ); +extern int __fpclassify (long double); + +#if defined( __GNUC__ ) + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnormalf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isnormald((double)(x)) \ + : __inline_isnormal ((long double)(x))) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isfinitef((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isfinited((double)(x)) \ + : __inline_isfinite ((long double)(x))) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isinff((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isinfd((double)(x)) \ + : __inline_isinf ((long double)(x))) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnanf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isnand((double)(x)) \ + : __inline_isnan ((long double)(x))) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_signbitf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_signbitd((double)(x)) \ + : __inline_signbit((long double)(x))) + + static __inline__ int __inline_isfinitef (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinited (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinite (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinff (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinfd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinf (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnanf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnand (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnan (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormalf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormald (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormal (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbit (long double) __MATH_H_ALWAYS_INLINE__; + + static __inline__ int __inline_isinff( float __x ) { return __builtin_fabsf(__x) == __builtin_inff(); } + static __inline__ int __inline_isinfd( double __x ) { return __builtin_fabs(__x) == __builtin_inf(); } + static __inline__ int __inline_isinf( long double __x ) { return __builtin_fabsl(__x) == __builtin_infl(); } + static __inline__ int __inline_isfinitef( float __x ) { return __x == __x && __builtin_fabsf(__x) != __builtin_inff(); } + static __inline__ int __inline_isfinited( double __x ) { return __x == __x && __builtin_fabs(__x) != __builtin_inf(); } + static __inline__ int __inline_isfinite( long double __x ) { return __x == __x && __builtin_fabsl(__x) != __builtin_infl(); } + static __inline__ int __inline_isnanf( float __x ) { return __x != __x; } + static __inline__ int __inline_isnand( double __x ) { return __x != __x; } + static __inline__ int __inline_isnan( long double __x ) { return __x != __x; } + static __inline__ int __inline_signbitf( float __x ) { union{ float __f; unsigned int __u; }__u = {__x}; return (int)(__u.__u >> 31); } + static __inline__ int __inline_signbitd( double __x ) { union{ double __f; unsigned long long __u; }__u = {__x}; return (int)(__u.__u >> 63); } + static __inline__ int __inline_signbit( long double __x ){ union{ long double __ld; struct{ unsigned long long __m; short __sexp; }__p; }__u = {__x}; return (int) ((unsigned int) __u.__p.__sexp >> 15); } + static __inline__ int __inline_isnormalf( float __x ) { float fabsf = __builtin_fabsf(__x); if( __x != __x ) return 0; return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__; } + static __inline__ int __inline_isnormald( double __x ) { double fabsf = __builtin_fabs(__x); if( __x != __x ) return 0; return fabsf < __builtin_inf() && fabsf >= __DBL_MIN__; } + static __inline__ int __inline_isnormal( long double __x ) { long double fabsf = __builtin_fabsl(__x); if( __x != __x ) return 0; return fabsf < __builtin_infl() && fabsf >= __LDBL_MIN__; } + +#else + + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __isnormalf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isnormald((double)(x)) \ + : __isnormal ((long double)(x))) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __isfinitef((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isfinited((double)(x)) \ + : __isfinite ((long double)(x))) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __isinff((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isinfd((double)(x)) \ + : __isinf ((long double)(x))) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __isnanf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isnand((double)(x)) \ + : __isnan ((long double)(x))) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __signbitf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __signbitd((double)(x)) \ + : __signbitl((long double)(x))) + + + extern int __isnormalf (float ); + extern int __isnormald (double ); + extern int __isnormal (long double); + + extern int __isfinitef (float ); + extern int __isfinited (double ); + extern int __isfinite (long double); + + extern int __isinff (float ); + extern int __isinfd (double ); + extern int __isinf (long double); + + extern int __isnanf (float ); + extern int __isnand (double ); + extern int __isnan (long double); + + extern int __signbitf (float ); + extern int __signbitd (double ); + extern int __signbitl (long double); + +#endif + + + +/******************************************************************************** +* * +* Math Functions * +* * +********************************************************************************/ + +extern double acos( double ); +extern float acosf( float ); + +extern double asin( double ); +extern float asinf( float ); + +extern double atan( double ); +extern float atanf( float ); + +extern double atan2( double, double ); +extern float atan2f( float, float ); + +extern double cos( double ); +extern float cosf( float ); + +extern double sin( double ); +extern float sinf( float ); + +extern double tan( double ); +extern float tanf( float ); + +extern double acosh( double ); +extern float acoshf( float ); + +extern double asinh( double ); +extern float asinhf( float ); + +extern double atanh( double ); +extern float atanhf( float ); + +extern double cosh( double ); +extern float coshf( float ); + +extern double sinh( double ); +extern float sinhf( float ); + +extern double tanh( double ); +extern float tanhf( float ); + +extern double exp ( double ); +extern float expf ( float ); + +extern double exp2 ( double ); +extern float exp2f ( float ); + +extern double expm1 ( double ); +extern float expm1f ( float ); + +extern double log ( double ); +extern float logf ( float ); + +extern double log10 ( double ); +extern float log10f ( float ); + +extern double log2 ( double ); +extern float log2f ( float ); + +extern double log1p ( double ); +extern float log1pf ( float ); + +extern double logb ( double ); +extern float logbf ( float ); + +extern double modf ( double, double * ); +extern float modff ( float, float * ); + +extern double ldexp ( double, int ); +extern float ldexpf ( float, int ); + +extern double frexp ( double, int * ); +extern float frexpf ( float, int * ); + +extern int ilogb ( double ); +extern int ilogbf ( float ); + +extern double scalbn ( double, int ); +extern float scalbnf ( float, int ); + +extern double scalbln ( double, long int ); +extern float scalblnf ( float, long int ); + +extern double fabs( double ); +extern float fabsf( float ); + +extern double cbrt( double ); +extern float cbrtf( float ); + +extern double hypot ( double, double ); +extern float hypotf ( float, float ); + +extern double pow ( double, double ); +extern float powf ( float, float ); + +extern double sqrt( double ); +extern float sqrtf( float ); + +extern double erf( double ); +extern float erff( float ); + +extern double erfc( double ); +extern float erfcf( float ); + +extern double lgamma( double ); +extern float lgammaf( float ); + +extern double tgamma( double ); +extern float tgammaf( float ); + +extern double ceil ( double ); +extern float ceilf ( float ); + +extern double floor ( double ); +extern float floorf ( float ); + +extern double nearbyint ( double ); +extern float nearbyintf ( float ); + +extern double rint ( double ); +extern float rintf ( float ); + +extern long int lrint ( double ); +extern long int lrintf ( float ); + +extern long long int llrint ( double ); +extern long long int llrintf ( float ); + +extern double round ( double ); +extern float roundf ( float ); + +extern long int lround ( double ); +extern long int lroundf ( float ); + +extern long long int llround ( double ); +extern long long int llroundf ( float ); + +extern double trunc ( double ); +extern float truncf ( float ); + +extern double fmod ( double, double ); +extern float fmodf ( float, float ); + +extern double remainder ( double, double ); +extern float remainderf ( float, float ); + +extern double remquo ( double, double, int * ); +extern float remquof ( float, float, int * ); + +extern double copysign ( double, double ); +extern float copysignf ( float, float ); + +extern double nan( const char * ); +extern float nanf( const char * ); + +extern double nextafter ( double, double ); +extern float nextafterf ( float, float ); + +extern double fdim ( double, double ); +extern float fdimf ( float, float ); + +extern double fmax ( double, double ); +extern float fmaxf ( float, float ); + +extern double fmin ( double, double ); +extern float fminf ( float, float ); + +extern double fma ( double, double, double ); +extern float fmaf ( float, float, float ); + +extern long double acosl(long double); +extern long double asinl(long double); +extern long double atanl(long double); +extern long double atan2l(long double, long double); +extern long double cosl(long double); +extern long double sinl(long double); +extern long double tanl(long double); +extern long double acoshl(long double); +extern long double asinhl(long double); +extern long double atanhl(long double); +extern long double coshl(long double); +extern long double sinhl(long double); +extern long double tanhl(long double); +extern long double expl(long double); +extern long double exp2l(long double); +extern long double expm1l(long double); +extern long double logl(long double); +extern long double log10l(long double); +extern long double log2l(long double); +extern long double log1pl(long double); +extern long double logbl(long double); +extern long double modfl(long double, long double *); +extern long double ldexpl(long double, int); +extern long double frexpl(long double, int *); +extern int ilogbl(long double); +extern long double scalbnl(long double, int); +extern long double scalblnl(long double, long int); +extern long double fabsl(long double); +extern long double cbrtl(long double); +extern long double hypotl(long double, long double); +extern long double powl(long double, long double); +extern long double sqrtl(long double); +extern long double erfl(long double); +extern long double erfcl(long double); +extern long double lgammal(long double); +extern long double tgammal(long double); +extern long double ceill(long double); +extern long double floorl(long double); +extern long double nearbyintl(long double); +extern long double rintl(long double); +extern long int lrintl(long double); +extern long long int llrintl(long double); +extern long double roundl(long double); +extern long int lroundl(long double); +extern long long int llroundl(long double); +extern long double truncl(long double); +extern long double fmodl(long double, long double); +extern long double remainderl(long double, long double); +extern long double remquol(long double, long double, int *); +extern long double copysignl(long double, long double); +extern long double nanl(const char *); +extern long double nextafterl(long double, long double); +extern double nexttoward(double, long double); +extern float nexttowardf(float, long double); +extern long double nexttowardl(long double, long double); +extern long double fdiml(long double, long double); +extern long double fmaxl(long double, long double); +extern long double fminl(long double, long double); +extern long double fmal(long double, long double, long double); + +#define isgreater(x, y) __builtin_isgreater ((x),(y)) +#define isgreaterequal(x, y) __builtin_isgreaterequal ((x),(y)) +#define isless(x, y) __builtin_isless ((x),(y)) +#define islessequal(x, y) __builtin_islessequal ((x),(y)) +#define islessgreater(x, y) __builtin_islessgreater ((x),(y)) +#define isunordered(x, y) __builtin_isunordered ((x),(y)) + +extern double __inf( void ); +extern float __inff( void ); +extern long double __infl( void ); +extern float __nan( void ); /* 10.3 (and later) must retain in ABI for backward compatability */ + +#if !defined(_ANSI_SOURCE) +extern double j0 ( double ); + +extern double j1 ( double ); + +extern double jn ( int, double ); + +extern double y0 ( double ); + +extern double y1 ( double ); + +extern double yn ( int, double ); + +extern double scalb ( double, double ); + + +#define M_E 2.71828182845904523536028747135266250 /* e */ +#define M_LOG2E 1.44269504088896340735992468100189214 /* log 2e */ +#define M_LOG10E 0.434294481903251827651128918916605082 /* log 10e */ +#define M_LN2 0.693147180559945309417232121458176568 /* log e2 */ +#define M_LN10 2.30258509299404568401799145468436421 /* log e10 */ +#define M_PI 3.14159265358979323846264338327950288 /* pi */ +#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */ +#define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */ +#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */ +#define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */ +#define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */ +#define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */ +#define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */ + +#define MAXFLOAT ((float)3.40282346638528860e+38) +extern int signgam; /* required for unix 2003 */ + + +#endif /* !defined(_ANSI_SOURCE) */ + +#if !defined(__NOEXTENSIONS__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define __WANT_EXTENSIONS__ +#endif + +#ifdef __WANT_EXTENSIONS__ + +#define FP_SNAN FP_NAN +#define FP_QNAN FP_NAN + +extern long int rinttol ( double ); /* Legacy API: please use C99 lrint() instead. */ + +extern long int roundtol ( double ); /* Legacy API: please use C99 lround() instead. */ + +/* + * XOPEN/SVID + */ +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) +#if !defined(__cplusplus) +/* used by matherr below */ +struct exception { + int type; + char *name; + double arg1; + double arg2; + double retval; +}; +#endif + +#define HUGE MAXFLOAT + +/* + * set X_TLOSS = pi*2**52, which is possibly defined in <values.h> + * (one may replace the following line by "#include <values.h>") + */ + +#define X_TLOSS 1.41484755040568800000e+16 + +#define DOMAIN 1 +#define SING 2 +#define OVERFLOW 3 +#define UNDERFLOW 4 +#define TLOSS 5 +#define PLOSS 6 + +#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +extern int finite ( double ); /* Legacy API: please use C99 isfinite() instead. */ + +extern double gamma ( double ); /* Legacy API: please use C99 tgamma() instead. */ + +#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#if !defined(__cplusplus) +extern int matherr ( struct exception * ); +#endif + +/* + * IEEE Test Vector + */ +extern double significand ( double ); + +/* + * BSD math library entry points + */ +extern double drem ( double, double ); /* Legacy API: please use C99 remainder() instead. */ + +#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#endif /* __WANT_EXTENSIONS__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MATH__ */ diff --git a/tool/headers/arm/_limits.h b/tool/headers/arm/_limits.h new file mode 100644 index 000000000..7a5fb4191 --- /dev/null +++ b/tool/headers/arm/_limits.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _ARM__LIMITS_H_ +#define _ARM__LIMITS_H_ + +#define __DARWIN_CLK_TCK 100 /* ticks per second */ + +#endif /* _ARM__LIMITS_H_ */ + diff --git a/tool/headers/arm/_param.h b/tool/headers/arm/_param.h new file mode 100644 index 000000000..d0a7ddb5b --- /dev/null +++ b/tool/headers/arm/_param.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _ARM__PARAM_H_ +#define _ARM__PARAM_H_ + +#include <arm/_types.h> + +/* + * Round p (pointer or byte index) up to a correctly-aligned value for all + * data types (int, long, ...). The result is unsigned int and must be + * cast to any desired pointer type. + */ +#define __DARWIN_ALIGNBYTES (sizeof(__darwin_size_t) - 1) +#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES) + +#endif /* _ARM__PARAM_H_ */ diff --git a/tool/headers/arm/_structs.h b/tool/headers/arm/_structs.h new file mode 100644 index 000000000..d97503655 --- /dev/null +++ b/tool/headers/arm/_structs.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#include <sys/appleapiopts.h> + +#ifdef __need_mcontext_t +#ifndef __need_struct_mcontext +#define __need_struct_mcontext +#endif /* __need_struct_mcontext */ +#endif /* __need_mcontext_t */ + +#if defined(__need_struct_mcontext) +//#include <mach/i386/_structs.h> +#endif /* __need_struct_mcontext */ + + +#ifdef __need_struct_mcontext +#undef __need_struct_mcontext + +#ifndef _STRUCT_MCONTEXT32 +#if __DARWIN_UNIX03 +#define _STRUCT_MCONTEXT32 struct __darwin_mcontext32 +_STRUCT_MCONTEXT32 +{ +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_MCONTEXT32 struct mcontext32 +_STRUCT_MCONTEXT32 +{ +}; +#endif /* __DARWIN_UNIX03 */ +#endif /* _STRUCT_MCONTEXT32 */ + +#ifndef _STRUCT_MCONTEXT64 +#if __DARWIN_UNIX03 +#define _STRUCT_MCONTEXT64 struct __darwin_mcontext64 +_STRUCT_MCONTEXT64 +{ +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_MCONTEXT64 struct mcontext64 +_STRUCT_MCONTEXT64 +{ +}; +#endif /* __DARWIN_UNIX03 */ +#endif /* _STRUCT_MCONTEXT64 */ +#endif /* __need_struct_mcontext */ + +#ifdef __need_mcontext_t +#undef __need_mcontext_t +#ifndef _MCONTEXT_T +#define _MCONTEXT_T +#if defined(__LP64__) +typedef _STRUCT_MCONTEXT64 *mcontext_t; +#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64 +#else +typedef _STRUCT_MCONTEXT32 *mcontext_t; +#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT32 +#endif +#endif /* _MCONTEXT_T */ +#endif /* __need_mcontext_t */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef I386_MCONTEXT_SIZE +#define I386_MCONTEXT_SIZE sizeof(struct mcontext) +#endif /* I386_MCONTEXT_SIZE */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + diff --git a/tool/headers/arm/_types.h b/tool/headers/arm/_types.h new file mode 100644 index 000000000..a117d8a41 --- /dev/null +++ b/tool/headers/arm/_types.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_ARM__TYPES_H_ +#define _BSD_ARM__TYPES_H_ + +/* + * This header file contains integer types. It's intended to also contain + * flotaing point and other arithmetic types, as needed, later. + */ + +#ifdef __GNUC__ +typedef __signed char __int8_t; +#else /* !__GNUC__ */ +typedef char __int8_t; +#endif /* !__GNUC__ */ +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +typedef long long __int64_t; +typedef unsigned long long __uint64_t; + +typedef long __darwin_intptr_t; +typedef unsigned int __darwin_natural_t; + +/* + * The rune type below 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 __darwin_ct_rune_t instead of int. By changing it + * here, you lose a bit of ANSI conformance, but your programs will still + * work. + * + * NOTE: rune_t is not covered by ANSI nor other standards, and should not + * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and + * rune_t must be the same type. Also wint_t must be no narrower than + * wchar_t, and should also be able to hold all members of the largest + * character set plus one extra value (WEOF). wint_t must be at least 16 bits. + */ + +typedef int __darwin_ct_rune_t; /* ct_rune_t */ + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + long long _mbstateL; /* for alignment */ +} __mbstate_t; + +typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */ + +#if defined(__GNUC__) && defined(__PTRDIFF_TYPE__) +typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */ +#else +typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */ +#endif /* __GNUC__ */ + +#if defined(__GNUC__) && defined(__SIZE_TYPE__) +typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */ +#else +typedef unsigned long __darwin_size_t; /* sizeof() */ +#endif + +#if (__GNUC__ > 2) +typedef __builtin_va_list __darwin_va_list; /* va_list */ +#else +typedef void * __darwin_va_list; /* va_list */ +#endif + +#if defined(__GNUC__) && defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */ +#else +typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */ +#endif + +typedef __darwin_wchar_t __darwin_rune_t; /* rune_t */ + +#if defined(__GNUC__) && defined(__WINT_TYPE__) +typedef __WINT_TYPE__ __darwin_wint_t; /* wint_t */ +#else +typedef __darwin_ct_rune_t __darwin_wint_t; /* wint_t */ +#endif + +typedef unsigned long __darwin_clock_t; /* clock() */ +typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */ +typedef long __darwin_ssize_t; /* byte count or error */ +typedef long __darwin_time_t; /* time() */ + +#endif /* _BSD_ARM__TYPES_H_ */ diff --git a/tool/headers/arm/disklabel.h b/tool/headers/arm/disklabel.h new file mode 100644 index 000000000..283c9174d --- /dev/null +++ b/tool/headers/arm/disklabel.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _MACHINE_DISKLABEL_H_ +#define _MACHINE_DISKLABEL_H_ + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_OBSOLETE +#define LABELSECTOR (1024 / DEV_BSIZE) /* sector containing label */ +#define LABELOFFSET 0 /* offset of label in sector */ +#define MAXPARTITIONS 8 /* number of partitions */ +#define RAW_PART 2 /* raw partition: xx?c */ + +/* Just a dummy */ +struct cpu_disklabel { + int cd_dummy; /* must have one element. */ +}; +#endif /* __APPLE_API_OBSOLETE */ + +#endif /* _MACHINE_DISKLABEL_H_ */ diff --git a/tool/headers/arm/endian.h b/tool/headers/arm/endian.h new file mode 100644 index 000000000..887fd17f8 --- /dev/null +++ b/tool/headers/arm/endian.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +/* + * Copyright (c) 1987, 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. + * 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. + * + * @(#)endian.h 8.1 (Berkeley) 6/11/93 + */ + +#ifndef _ARM__ENDIAN_H_ +#define _ARM__ENDIAN_H_ + +/* + * Define _NOQUAD if the compiler does NOT support 64-bit integers. + */ +/* #define _NOQUAD */ + +/* + * Define the order of 32-bit words in 64-bit words. + */ +#define _QUAD_HIGHWORD 1 +#define _QUAD_LOWWORD 0 + +/* + * Definitions for byte order, according to byte significance from low + * address to high. + */ +#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ +#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ +#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ + +#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN + +#if defined(KERNEL) || !defined(_POSIX_C_SOURCE) + +#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN +#define BIG_ENDIAN __DARWIN_BIG_ENDIAN +#define PDP_ENDIAN __DARWIN_PDP_ENDIAN + +#define BYTE_ORDER __DARWIN_BYTE_ORDER + +#include <sys/_endian.h> + +#endif /* defined(KERNEL) || !defined(_POSIX_C_SOURCE) */ +#endif /* !_ARM__ENDIAN_H_ */ diff --git a/tool/headers/arm/limits.h b/tool/headers/arm/limits.h new file mode 100644 index 000000000..4b5f02404 --- /dev/null +++ b/tool/headers/arm/limits.h @@ -0,0 +1,107 @@ +/* + * Copyright (c) 1988, 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. + * + * @(#)limits.h 8.3 (Berkeley) 1/4/94 + */ + +#ifndef _ARM_LIMITS_H_ +#define _ARM_LIMITS_H_ + +#include <arm/_limits.h> + +#define CHAR_BIT 8 /* number of bits in a char */ +#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */ + +#define CLK_TCK __DARWIN_CLK_TCK /* ticks per second */ + +/* + * According to ANSI (section 2.2.4.2), the values below must be usable by + * #if preprocessing directives. Additionally, the expression must have the + * same type as would an expression that is an object of the corresponding + * type converted according to the integral promotions. The subtraction for + * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an + * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values + * are written as hex so that GCC will be quiet about large integer constants. + */ +#define SCHAR_MAX 127 /* min value for a signed char */ +#define SCHAR_MIN (-128) /* max value for a signed char */ + +#define UCHAR_MAX 255 /* max value for an unsigned char */ +#define CHAR_MAX 127 /* max value for a char */ +#define CHAR_MIN (-128) /* min value for a char */ + +#define USHRT_MAX 65535 /* max value for an unsigned short */ +#define SHRT_MAX 32767 /* max value for a short */ +#define SHRT_MIN (-32768) /* min value for a short */ + +#define UINT_MAX 0xffffffff /* max value for an unsigned int */ +#define INT_MAX 2147483647 /* max value for an int */ +#define INT_MIN (-2147483647-1) /* min value for an int */ + +#ifdef __LP64__ +#define ULONG_MAX 0xffffffffffffffffUL /* max unsigned long */ +#define LONG_MAX 0x7fffffffffffffffL /* max signed long */ +#define LONG_MIN (-0x7fffffffffffffffL-1) /* min signed long */ +#else /* !__LP64__ */ +#define ULONG_MAX 0xffffffffL /* max value for an unsigned long */ +#define LONG_MAX 2147483647L /* max value for a long */ +#define LONG_MIN (-2147483647L-1) /* min value for a long */ +#endif /* __LP64__ */ + +#define ULLONG_MAX 0xffffffffffffffffULL /* max unsigned long long */ +#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */ +#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */ + +#if !defined(_ANSI_SOURCE) +#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ + +#if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) +#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ + +#define UQUAD_MAX ULLONG_MAX +#define QUAD_MAX LLONG_MAX +#define QUAD_MIN LLONG_MIN + +#endif /* !_POSIX_C_SOURCE && !_XOPEN_SOURCE */ +#endif /* !_ANSI_SOURCE */ + +#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_C_SOURCE)) || defined(_XOPEN_SOURCE) +#ifdef __LP64__ +#define LONG_BIT 64 +#else /* !__LP64__ */ +#define LONG_BIT 32 +#endif /* __LP64__ */ +#define WORD_BIT 32 +#endif /* (!(_ANSI_SOURCE) && !(_POSIX_C_SOURCE)) || (_XOPEN_SOURCE) */ + +#endif /* _ARM_LIMITS_H_ */ diff --git a/tool/headers/arm/param.h b/tool/headers/arm/param.h new file mode 100644 index 000000000..0196a8cdf --- /dev/null +++ b/tool/headers/arm/param.h @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 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. + * 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. + * + * @(#)param.h 8.1 (Berkeley) 4/4/95 + */ + +/* + * Machine dependent constants for Intel 386. + */ + +#ifndef _ARM_PARAM_H_ +#define _ARM_PARAM_H_ + +/* + * Round p (pointer or byte index) up to a correctly-aligned value for all + * data types (int, long, ...). The result is unsigned int and must be + * cast to any desired pointer type. + */ +#define ALIGNBYTES 3 +#define ALIGN(p) (((unsigned int)(p) + ALIGNBYTES) &~ ALIGNBYTES) + +#define NBPG 4096 /* bytes/page */ +#define PGOFSET (NBPG-1) /* byte offset into page */ +#define PGSHIFT 12 /* LOG2(NBPG) */ + +#define DEV_BSIZE 512 +#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ +#define BLKDEV_IOSIZE 2048 +#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */ + +#define CLSIZE 1 +#define CLSIZELOG2 0 + +/* + * Constants related to network buffer management. + * MCLBYTES must be no larger than CLBYTES (the software page size), and, + * on machines that exchange pages of input or output buffers with mbuf + * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple + * of the hardware page size. + */ +#define MSIZE 256 /* size of an mbuf */ +#define MCLBYTES 2048 /* large enough for ether MTU */ +#define MCLSHIFT 11 +#define MCLOFSET (MCLBYTES - 1) +#ifndef NMBCLUSTERS +#ifdef GATEWAY +#define NMBCLUSTERS ((1024 * 1024) / MCLBYTES) /* cl map size: 1MB */ +#else +#define NMBCLUSTERS ((1024 * 512) / MCLBYTES) /* cl map size: 0.5MB */ +#endif +#endif + +/* + * Some macros for units conversion + */ +/* Core clicks (NeXT_page_size bytes) to segments and vice versa */ +#define ctos(x) (x) +#define stoc(x) (x) + +/* Core clicks (4096 bytes) to disk blocks */ +#define ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT)) +#define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT)) +#define dtob(x) ((x)<<DEV_BSHIFT) + +/* clicks to bytes */ +#define ctob(x) ((x)<<PGSHIFT) + +/* bytes to clicks */ +#define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) + +#ifdef __APPLE__ +#define btodb(bytes, devBlockSize) \ + ((unsigned)(bytes) / devBlockSize) +#define dbtob(db, devBlockSize) \ + ((unsigned)(db) * devBlockSize) +#else +#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ + ((unsigned)(bytes) >> DEV_BSHIFT) +#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ + ((unsigned)(db) << DEV_BSHIFT) +#endif + +/* + * Map a ``block device block'' to a file system block. + * This should be device dependent, and will be if we + * add an entry to cdevsw/bdevsw for that purpose. + * For now though just use DEV_BSIZE. + */ +#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE)) + +/* + * Macros to decode (and encode) processor status word. + */ +#define STATUS_WORD(rpl, ipl) (((ipl) << 8) | (rpl)) +#define USERMODE(x) (((x) & 3) == 3) +#define BASEPRI(x) (((x) & (255 << 8)) == 0) + + +#if defined(KERNEL) || defined(STANDALONE) +#define DELAY(n) delay(n) + +#else /* defined(KERNEL) || defined(STANDALONE) */ +#define DELAY(n) { register int N = (n); while (--N > 0); } +#endif /* defined(KERNEL) || defined(STANDALONE) */ + +#endif /* _ARM_PARAM_H_ */ diff --git a/tool/headers/arm/setjmp.h b/tool/headers/arm/setjmp.h new file mode 100644 index 000000000..6b74bccda --- /dev/null +++ b/tool/headers/arm/setjmp.h @@ -0,0 +1,23 @@ +#ifndef _BSD_ARM_SETJMP_H_ +#define _BSD_ARM_SETJMP_H_ + +#define _JBLEN 32 +typedef int jmp_buf[_JBLEN]; +typedef int sigjmp_buf[_JBLEN + 1]; + +int setjmp(jmp_buf env); +void longjmp(jmp_buf env, int val); + +#ifndef _ANSI_SOURCE +int _setjmp(jmp_buf env); +void _longjmp(jmp_buf, int val); +int sigsetjmp(sigjmp_buf env, int val); +void siglongjmp(sigjmp_buf env, int val); +#endif + +#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) +void longjmperror(void); +#endif + +#endif + diff --git a/tool/headers/arm/signal.h b/tool/headers/arm/signal.h new file mode 100644 index 000000000..fb949f788 --- /dev/null +++ b/tool/headers/arm/signal.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + */ + +#ifndef _ARM_SIGNAL_ +#define _ARM_SIGNAL_ 1 + +#ifndef _ANSI_SOURCE +typedef int sig_atomic_t; + +#ifndef _POSIX_C_SOURCE + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_OBSOLETE + +/* + * Information pushed on stack when a signal is delivered. + * This is used by the kernel to restore state following + * execution of the signal handler. It is also made available + * to the handler to allow it to properly restore state if + * a non-standard exit is performed. + */ +struct sigcontext { + int sc_onstack; /* sigstack state to restore */ + int sc_mask; /* signal mask to restore */ + unsigned int sc_r0; + unsigned int sc_r1; + unsigned int sc_r2; + unsigned int sc_r3; + unsigned int sc_r4; + unsigned int sc_r5; + unsigned int sc_r6; + unsigned int sc_r7; + unsigned int sc_r8; + unsigned int sc_r9; + unsigned int sc_r10; + unsigned int sc_r11; + unsigned int sc_r12; + unsigned int sc_r13; + unsigned int sc_r14; + unsigned int sc_r15; + unsigned int sc_r16; +}; + +#endif /* __APPLE_API_OBSOLETE */ +#endif /* ! _POSIX_C_SOURCE */ +#endif /* ! _ANSI_SOURCE */ + +#endif /* _ARM_SIGNAL_ */ + diff --git a/tool/headers/arm/types.h b/tool/headers/arm/types.h new file mode 100644 index 000000000..33285dd79 --- /dev/null +++ b/tool/headers/arm/types.h @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +/*- + * 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. + * + * @(#)types.h 8.3 (Berkeley) 1/5/94 + */ + +#ifndef _MACHTYPES_H_ +#define _MACHTYPES_H_ + +#ifndef __ASSEMBLER__ +#include <arm/_types.h> +#include <sys/cdefs.h> +/* + * Basic integral types. Omit the typedef if + * not possible for a machine/compiler combination. + */ +#ifndef _INT8_T +#define _INT8_T +typedef __signed char int8_t; +#endif +typedef unsigned char u_int8_t; +#ifndef _INT16_T +#define _INT16_T +typedef short int16_t; +#endif +typedef unsigned short u_int16_t; +#ifndef _INT32_T +#define _INT32_T +typedef int int32_t; +#endif +typedef unsigned int u_int32_t; +#ifndef _INT64_T +#define _INT64_T +typedef long long int64_t; +#endif +typedef unsigned long long u_int64_t; + +#if __LP64__ +typedef int64_t register_t; +#else +typedef int32_t register_t; +#endif + +#ifndef _INTPTR_T +#define _INTPTR_T +typedef __darwin_intptr_t intptr_t; +#endif +#ifndef _UINTPTR_T +#define _UINTPTR_T +typedef unsigned long int uintptr_t; +#endif + +/* These types are used for reserving the largest possible size. */ +// LP64todo - typedef mach_vm_address_t user_addr_t; /* varying length pointers from user space */ +// LP64todo - typedef mach_vm_size_t user_size_t; /* varying length values from user space (unsigned) */ +typedef u_int64_t user_addr_t; +typedef u_int64_t user_size_t; +typedef int64_t user_ssize_t; +typedef int64_t user_long_t; +typedef u_int64_t user_ulong_t; +typedef int64_t user_time_t; +#define USER_ADDR_NULL ((user_addr_t) 0) +#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr))) + +/* This defines the size of syscall arguments after copying into the kernel: */ +typedef u_int64_t syscall_arg_t; + +#ifndef __offsetof +#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) +#endif + +#endif /* __ASSEMBLER__ */ +#endif /* _MACHTYPES_H_ */ diff --git a/tool/headers/libkern/arm/Makefile b/tool/headers/libkern/arm/Makefile new file mode 100644 index 000000000..3fc89f6c4 --- /dev/null +++ b/tool/headers/libkern/arm/Makefile @@ -0,0 +1,36 @@ +export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd +export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def +export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule +export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir + +include $(MakeInc_cmd) +include $(MakeInc_def) + +INSTINC_SUBDIRS = + +INSTINC_SUBDIRS_PPC = + +INSTINC_SUBDIRS_I386 = + +EXPINC_SUBDIRS = ${INSTINC_SUBDIRS} + +EXPINC_SUBDIRS_PPC = ${INSTINC_SUBDIRS_PPC} + +EXPINC_SUBDIRS_I386 = ${INSTINC_SUBDIRS_I386} + +DATAFILES = \ + OSByteOrder.h \ + _OSByteOrder.h + +INSTALL_MD_LIST = ${DATAFILES} + +INSTALL_MD_DIR = libkern/i386 + +EXPORT_MD_LIST = ${DATAFILES} + +EXPORT_MD_DIR = libkern/i386 + +include $(MakeInc_rule) +include $(MakeInc_dir) + + diff --git a/tool/headers/libkern/arm/OSByteOrder.h b/tool/headers/libkern/arm/OSByteOrder.h new file mode 100644 index 000000000..0de325870 --- /dev/null +++ b/tool/headers/libkern/arm/OSByteOrder.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 1999-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_OSBYTEORDERI386_H +#define _OS_OSBYTEORDERI386_H + +#include <stdint.h> +#include <libkern/arm/_OSByteOrder.h> + +#if !defined(OS_INLINE) +#define OS_INLINE __DARWIN_OS_INLINE +#endif + +/* Functions for byte reversed loads. */ + +OS_INLINE +uint16_t +OSReadSwapInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint16_t result; + + result = *(volatile uint16_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt16(result); +} + +OS_INLINE +uint32_t +OSReadSwapInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint32_t result; + + result = *(volatile uint32_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt32(result); +} + +OS_INLINE +uint64_t +OSReadSwapInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint64_t result; + + result = *(volatile uint64_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt64(result); +} + +/* Functions for byte reversed stores. */ + +OS_INLINE +void +OSWriteSwapInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + *(volatile uint16_t *)((uintptr_t)base + byteOffset) = _OSSwapInt16(data); +} + +OS_INLINE +void +OSWriteSwapInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + *(volatile uint32_t *)((uintptr_t)base + byteOffset) = _OSSwapInt32(data); +} + +#if 0 +OS_INLINE +void +OSWriteSwapInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data); +} +#endif + +#endif /* ! _OS_OSBYTEORDERI386_H */ diff --git a/tool/headers/libkern/arm/_OSByteOrder.h b/tool/headers/libkern/arm/_OSByteOrder.h new file mode 100644 index 000000000..bb4b152e1 --- /dev/null +++ b/tool/headers/libkern/arm/_OSByteOrder.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS__OSBYTEORDERI386_H +#define _OS__OSBYTEORDERI386_H + +#if !defined(__DARWIN_OS_INLINE) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define __DARWIN_OS_INLINE static inline +# elif defined(__MWERKS__) || defined(__cplusplus) +# define __DARWIN_OS_INLINE static inline +# else +# define __DARWIN_OS_INLINE static __inline__ +# endif +#endif + +/* Generic byte swapping functions. */ + +__DARWIN_OS_INLINE +__uint16_t +_OSSwapInt16( + __uint16_t _data +) +{ + return ((_data << 8) | (_data >> 8)); +} + +__DARWIN_OS_INLINE +__uint32_t +_OSSwapInt32( + __uint32_t _data +) +{ + uint32_t tmp = _data; + __asm volatile ("EOR %1, %0, %0, ROR #16\n" + "BIC %1, %1, #0xff0000\n" + "MOV %0, %0, ROR #8\n" + "EOR %0, %0, %1, LSR #8\n" + : "=r" (_data), "=r" (tmp) + : "0" (_data), "1" (tmp)); + + return _data; +} + +__DARWIN_OS_INLINE +__uint64_t +_OSSwapInt64( + __uint64_t _data +) +{ + return (__uint64_t) _OSSwapInt32(_data & 0xffffffff) << 32 | _OSSwapInt32(_data >> 32 & 0xffffff); +} + +#endif /* ! _OS__OSBYTEORDERI386_H */ diff --git a/tool/headers/mach/arm/boolean.h b/tool/headers/mach/arm/boolean.h new file mode 100644 index 000000000..407fe8980 --- /dev/null +++ b/tool/headers/mach/arm/boolean.h @@ -0,0 +1,7 @@ +#ifndef _MACH_ARM_BOOLEAN_H_ +#define _MACH_ARM_BOOLEAN_H_ + +typedef int boolean_t; + +#endif + diff --git a/tool/headers/mach/arm/exception.h b/tool/headers/mach/arm/exception.h new file mode 100644 index 000000000..139da8203 --- /dev/null +++ b/tool/headers/mach/arm/exception.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _MACH_ARM_EXCEPTION_H_ +#define _MACH_ARM_EXCEPTION_H_ + +/* + * No machine dependent types for the 80386 + */ + +#define EXC_TYPES_COUNT 10 /* incl. illegal exception 0 */ + +/* + * Codes and subcodes for 80386 exceptions. + */ + +#define EXCEPTION_CODE_MAX 2 /* currently code and subcode */ + +/* + * EXC_BAD_INSTRUCTION + */ + +#define EXC_I386_INVOP 1 + +/* + * EXC_ARITHMETIC + */ + +#define EXC_I386_DIV 1 +#define EXC_I386_INTO 2 +#define EXC_I386_NOEXT 3 +#define EXC_I386_EXTOVR 4 +#define EXC_I386_EXTERR 5 +#define EXC_I386_EMERR 6 +#define EXC_I386_BOUND 7 +#define EXC_I386_SSEEXTERR 8 + +/* + * EXC_SOFTWARE + * Note: 0x10000-0x10003 in use for unix signal + */ + +/* + * EXC_BAD_ACCESS + */ + +/* + * EXC_BREAKPOINT + */ + +#define EXC_I386_SGL 1 +#define EXC_I386_BPT 2 + +#define EXC_I386_DIVERR 0 /* divide by 0 eprror */ +#define EXC_I386_SGLSTP 1 /* single step */ +#define EXC_I386_NMIFLT 2 /* NMI */ +#define EXC_I386_BPTFLT 3 /* breakpoint fault */ +#define EXC_I386_INTOFLT 4 /* INTO overflow fault */ +#define EXC_I386_BOUNDFLT 5 /* BOUND instruction fault */ +#define EXC_I386_INVOPFLT 6 /* invalid opcode fault */ +#define EXC_I386_NOEXTFLT 7 /* extension not available fault*/ +#define EXC_I386_DBLFLT 8 /* double fault */ +#define EXC_I386_EXTOVRFLT 9 /* extension overrun fault */ +#define EXC_I386_INVTSSFLT 10 /* invalid TSS fault */ +#define EXC_I386_SEGNPFLT 11 /* segment not present fault */ +#define EXC_I386_STKFLT 12 /* stack fault */ +#define EXC_I386_GPFLT 13 /* general protection fault */ +#define EXC_I386_PGFLT 14 /* page fault */ +#define EXC_I386_EXTERRFLT 16 /* extension error fault */ +#define EXC_I386_ALIGNFLT 17 /* Alignment fault */ +#define EXC_I386_ENDPERR 33 /* emulated extension error flt */ +#define EXC_I386_ENOEXTFLT 32 /* emulated ext not present */ + + +/* + * machine dependent exception masks + */ +#define EXC_MASK_MACHINE 0 + +#endif /* _MACH_ARM_EXCEPTION_H_ */ diff --git a/tool/headers/mach/arm/kern_return.h b/tool/headers/mach/arm/kern_return.h new file mode 100644 index 000000000..b90366e69 --- /dev/null +++ b/tool/headers/mach/arm/kern_return.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: kern_return.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1985 + * + * Machine-dependent kernel return definitions. + */ + +#ifndef _MACH_ARM_KERN_RETURN_H_ +#define _MACH_ARM_KERN_RETURN_H_ + +#ifndef ASSEMBLER +typedef int kern_return_t; +#endif /* ASSEMBLER */ + +#endif /* _MACH_ARM_KERN_RETURN_H_ */ diff --git a/tool/headers/mach/arm/processor_info.h b/tool/headers/mach/arm/processor_info.h new file mode 100644 index 000000000..e799be9ba --- /dev/null +++ b/tool/headers/mach/arm/processor_info.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * File: mach/arm/processor_info.h + * + * Data structure definitions for ARM specific processor control + */ + +#ifndef _MACH_ARM_PROCESSOR_INFO_H_ +#define _MACH_ARM_PROCESSOR_INFO_H_ + +#endif /* _MACH_ARM_PROCESSOR_INFO_H_ */ diff --git a/tool/headers/mach/arm/rpc.h b/tool/headers/mach/arm/rpc.h new file mode 100644 index 000000000..f72ca03ff --- /dev/null +++ b/tool/headers/mach/arm/rpc.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_ARM_RPC_H_ +#define _MACH_ARM_RPC_H_ + +#endif /* _MACH_ARM_RPC_H_ */ + diff --git a/tool/headers/mach/arm/task.h b/tool/headers/mach/arm/task.h new file mode 100644 index 000000000..8bc5a2ff2 --- /dev/null +++ b/tool/headers/mach/arm/task.h @@ -0,0 +1,1491 @@ +#ifndef _task_user_ +#define _task_user_ + +/* Module task */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef task_MSG_COUNT +#define task_MSG_COUNT 33 +#endif /* task_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine task_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_create +( + task_t target_task, + ledger_array_t ledgers, + mach_msg_type_number_t ledgersCnt, + boolean_t inherit_memory, + task_t *child_task +); + +/* Routine task_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_terminate +( + task_t target_task +); + +/* Routine task_threads */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_threads +( + task_t target_task, + thread_act_array_t *act_list, + mach_msg_type_number_t *act_listCnt +); + +/* Routine mach_ports_register */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_register +( + task_t target_task, + mach_port_array_t init_port_set, + mach_msg_type_number_t init_port_setCnt +); + +/* Routine mach_ports_lookup */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_lookup +( + task_t target_task, + mach_port_array_t *init_port_set, + mach_msg_type_number_t *init_port_setCnt +); + +/* Routine task_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_info +( + task_name_t target_task, + task_flavor_t flavor, + task_info_t task_info_out, + mach_msg_type_number_t *task_info_outCnt +); + +/* Routine task_set_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_info +( + task_t target_task, + task_flavor_t flavor, + task_info_t task_info_in, + mach_msg_type_number_t task_info_inCnt +); + +/* Routine task_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_suspend +( + task_t target_task +); + +/* Routine task_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_resume +( + task_t target_task +); + +/* Routine task_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_special_port +( + task_t task, + int which_port, + mach_port_t *special_port +); + +/* Routine task_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_special_port +( + task_t task, + int which_port, + mach_port_t special_port +); + +/* Routine thread_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create +( + task_t parent_task, + thread_act_t *child_act +); + +/* Routine thread_create_running */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create_running +( + task_t parent_task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt, + thread_act_t *child_act +); + +/* Routine task_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine task_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_exception_ports +( + task_t task, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine task_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_swap_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlerss, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine lock_set_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_create +( + task_t task, + lock_set_t *new_lock_set, + int n_ulocks, + int policy +); + +/* Routine lock_set_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_destroy +( + task_t task, + lock_set_t lock_set +); + +/* Routine semaphore_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_create +( + task_t task, + semaphore_t *semaphore, + int policy, + int value +); + +/* Routine semaphore_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_destroy +( + task_t task, + semaphore_t semaphore +); + +/* Routine task_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_set +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine task_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_get +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine task_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_sample +( + task_t task, + mach_port_t reply +); + +/* Routine task_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy +( + task_t task, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit, + boolean_t change +); + +/* Routine task_set_emulation */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation +( + task_t target_port, + vm_address_t routine_entry_pt, + int routine_number +); + +/* Routine task_get_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_emulation_vector +( + task_t task, + int *vector_start, + emulation_vector_t *emulation_vector, + mach_msg_type_number_t *emulation_vectorCnt +); + +/* Routine task_set_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation_vector +( + task_t task, + int vector_start, + emulation_vector_t emulation_vector, + mach_msg_type_number_t emulation_vectorCnt +); + +/* Routine task_set_ras_pc */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_ras_pc +( + task_t target_task, + vm_address_t basepc, + vm_address_t boundspc +); + +/* Routine task_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign +( + task_t task, + processor_set_t new_set, + boolean_t assign_threads +); + +/* Routine task_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign_default +( + task_t task, + boolean_t assign_threads +); + +/* Routine task_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_assignment +( + task_t task, + processor_set_name_t *assigned_set +); + +/* Routine task_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_policy +( + task_t task, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt, + boolean_t change +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__task_subsystem__defined +#define __Request__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t ledgers; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t ledgersCnt; + boolean_t inherit_memory; + } __Request__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Request__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_outCnt; + } __Request__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_inCnt; + integer_t task_info_in[10]; + } __Request__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int n_ulocks; + int policy; + } __Request__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t lock_set; + /* end of the kernel processed data */ + } __Request__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + int value; + } __Request__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Request__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + boolean_t change; + } __Request__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t routine_entry_pt; + int routine_number; + } __Request__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Request__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t basepc; + vm_address_t boundspc; + } __Request__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + boolean_t change; + } __Request__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__task_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__task_subsystem__defined +#define __RequestUnion__task_subsystem__defined +union __RequestUnion__task_subsystem { + __Request__task_create_t Request_task_create; + __Request__task_terminate_t Request_task_terminate; + __Request__task_threads_t Request_task_threads; + __Request__mach_ports_register_t Request_mach_ports_register; + __Request__mach_ports_lookup_t Request_mach_ports_lookup; + __Request__task_info_t Request_task_info; + __Request__task_set_info_t Request_task_set_info; + __Request__task_suspend_t Request_task_suspend; + __Request__task_resume_t Request_task_resume; + __Request__task_get_special_port_t Request_task_get_special_port; + __Request__task_set_special_port_t Request_task_set_special_port; + __Request__thread_create_t Request_thread_create; + __Request__thread_create_running_t Request_thread_create_running; + __Request__task_set_exception_ports_t Request_task_set_exception_ports; + __Request__task_get_exception_ports_t Request_task_get_exception_ports; + __Request__task_swap_exception_ports_t Request_task_swap_exception_ports; + __Request__lock_set_create_t Request_lock_set_create; + __Request__lock_set_destroy_t Request_lock_set_destroy; + __Request__semaphore_create_t Request_semaphore_create; + __Request__semaphore_destroy_t Request_semaphore_destroy; + __Request__task_policy_set_t Request_task_policy_set; + __Request__task_policy_get_t Request_task_policy_get; + __Request__task_sample_t Request_task_sample; + __Request__task_policy_t Request_task_policy; + __Request__task_set_emulation_t Request_task_set_emulation; + __Request__task_get_emulation_vector_t Request_task_get_emulation_vector; + __Request__task_set_emulation_vector_t Request_task_set_emulation_vector; + __Request__task_set_ras_pc_t Request_task_set_ras_pc; + __Request__task_assign_t Request_task_assign; + __Request__task_assign_default_t Request_task_assign_default; + __Request__task_get_assignment_t Request_task_get_assignment; + __Request__task_set_policy_t Request_task_set_policy; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__task_subsystem__defined +#define __Reply__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_task; + /* end of the kernel processed data */ + } __Reply__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t act_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t act_listCnt; + } __Reply__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Reply__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t task_info_outCnt; + integer_t task_info_out[10]; + } __Reply__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlerss[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_lock_set; + /* end of the kernel processed data */ + } __Reply__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Reply__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Reply__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__task_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__task_subsystem__defined +#define __ReplyUnion__task_subsystem__defined +union __ReplyUnion__task_subsystem { + __Reply__task_create_t Reply_task_create; + __Reply__task_terminate_t Reply_task_terminate; + __Reply__task_threads_t Reply_task_threads; + __Reply__mach_ports_register_t Reply_mach_ports_register; + __Reply__mach_ports_lookup_t Reply_mach_ports_lookup; + __Reply__task_info_t Reply_task_info; + __Reply__task_set_info_t Reply_task_set_info; + __Reply__task_suspend_t Reply_task_suspend; + __Reply__task_resume_t Reply_task_resume; + __Reply__task_get_special_port_t Reply_task_get_special_port; + __Reply__task_set_special_port_t Reply_task_set_special_port; + __Reply__thread_create_t Reply_thread_create; + __Reply__thread_create_running_t Reply_thread_create_running; + __Reply__task_set_exception_ports_t Reply_task_set_exception_ports; + __Reply__task_get_exception_ports_t Reply_task_get_exception_ports; + __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports; + __Reply__lock_set_create_t Reply_lock_set_create; + __Reply__lock_set_destroy_t Reply_lock_set_destroy; + __Reply__semaphore_create_t Reply_semaphore_create; + __Reply__semaphore_destroy_t Reply_semaphore_destroy; + __Reply__task_policy_set_t Reply_task_policy_set; + __Reply__task_policy_get_t Reply_task_policy_get; + __Reply__task_sample_t Reply_task_sample; + __Reply__task_policy_t Reply_task_policy; + __Reply__task_set_emulation_t Reply_task_set_emulation; + __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector; + __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector; + __Reply__task_set_ras_pc_t Reply_task_set_ras_pc; + __Reply__task_assign_t Reply_task_assign; + __Reply__task_assign_default_t Reply_task_assign_default; + __Reply__task_get_assignment_t Reply_task_get_assignment; + __Reply__task_set_policy_t Reply_task_set_policy; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ + +#ifndef subsystem_to_name_map_task +#define subsystem_to_name_map_task \ + { "task_create", 3400 },\ + { "task_terminate", 3401 },\ + { "task_threads", 3402 },\ + { "mach_ports_register", 3403 },\ + { "mach_ports_lookup", 3404 },\ + { "task_info", 3405 },\ + { "task_set_info", 3406 },\ + { "task_suspend", 3407 },\ + { "task_resume", 3408 },\ + { "task_get_special_port", 3409 },\ + { "task_set_special_port", 3410 },\ + { "thread_create", 3411 },\ + { "thread_create_running", 3412 },\ + { "task_set_exception_ports", 3413 },\ + { "task_get_exception_ports", 3414 },\ + { "task_swap_exception_ports", 3415 },\ + { "lock_set_create", 3416 },\ + { "lock_set_destroy", 3417 },\ + { "semaphore_create", 3418 },\ + { "semaphore_destroy", 3419 },\ + { "task_policy_set", 3420 },\ + { "task_policy_get", 3421 },\ + { "task_sample", 3422 },\ + { "task_policy", 3423 },\ + { "task_set_emulation", 3424 },\ + { "task_get_emulation_vector", 3425 },\ + { "task_set_emulation_vector", 3426 },\ + { "task_set_ras_pc", 3427 },\ + { "task_assign", 3429 },\ + { "task_assign_default", 3430 },\ + { "task_get_assignment", 3431 },\ + { "task_set_policy", 3432 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _task_user_ */ diff --git a/tool/headers/mach/arm/thread_act.h b/tool/headers/mach/arm/thread_act.h new file mode 100644 index 000000000..7c9dccd4b --- /dev/null +++ b/tool/headers/mach/arm/thread_act.h @@ -0,0 +1,1155 @@ +#ifndef _thread_act_user_ +#define _thread_act_user_ + +/* Module thread_act */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef thread_act_MSG_COUNT +#define thread_act_MSG_COUNT 25 +#endif /* thread_act_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine thread_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_terminate +( + thread_act_t target_act +); + +/* Routine act_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_get_state +( + thread_act_t target_act, + int flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine act_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_set_state +( + thread_act_t target_act, + int flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine thread_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_suspend +( + thread_act_t target_act +); + +/* Routine thread_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_resume +( + thread_act_t target_act +); + +/* Routine thread_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort +( + thread_act_t target_act +); + +/* Routine thread_abort_safely */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort_safely +( + thread_act_t target_act +); + +/* Routine thread_depress_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_depress_abort +( + thread_act_t thread +); + +/* Routine thread_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t *special_port +); + +/* Routine thread_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t special_port +); + +/* Routine thread_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_info +( + thread_act_t target_act, + thread_flavor_t flavor, + thread_info_t thread_info_out, + mach_msg_type_number_t *thread_info_outCnt +); + +/* Routine thread_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine thread_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_swap_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy +( + thread_act_t thr_act, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit +); + +/* Routine thread_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_set +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine thread_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_get +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine thread_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_sample +( + thread_act_t thread, + mach_port_t reply +); + +/* Routine etap_trace_thread */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t etap_trace_thread +( + thread_act_t target_act, + boolean_t trace_status +); + +/* Routine thread_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign +( + thread_act_t thread, + processor_set_t new_set +); + +/* Routine thread_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign_default +( + thread_act_t thread +); + +/* Routine thread_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_assignment +( + thread_act_t thread, + processor_set_name_t *assigned_set +); + +/* Routine thread_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_policy +( + thread_act_t thr_act, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__thread_act_subsystem__defined +#define __Request__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_flavor_t flavor; + mach_msg_type_number_t thread_info_outCnt; + } __Request__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + } __Request__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t trace_status; + } __Request__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + } __Request__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + } __Request__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__thread_act_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__thread_act_subsystem__defined +#define __RequestUnion__thread_act_subsystem__defined +union __RequestUnion__thread_act_subsystem { + __Request__thread_terminate_t Request_thread_terminate; + __Request__act_get_state_t Request_act_get_state; + __Request__act_set_state_t Request_act_set_state; + __Request__thread_get_state_t Request_thread_get_state; + __Request__thread_set_state_t Request_thread_set_state; + __Request__thread_suspend_t Request_thread_suspend; + __Request__thread_resume_t Request_thread_resume; + __Request__thread_abort_t Request_thread_abort; + __Request__thread_abort_safely_t Request_thread_abort_safely; + __Request__thread_depress_abort_t Request_thread_depress_abort; + __Request__thread_get_special_port_t Request_thread_get_special_port; + __Request__thread_set_special_port_t Request_thread_set_special_port; + __Request__thread_info_t Request_thread_info; + __Request__thread_set_exception_ports_t Request_thread_set_exception_ports; + __Request__thread_get_exception_ports_t Request_thread_get_exception_ports; + __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports; + __Request__thread_policy_t Request_thread_policy; + __Request__thread_policy_set_t Request_thread_policy_set; + __Request__thread_policy_get_t Request_thread_policy_get; + __Request__thread_sample_t Request_thread_sample; + __Request__etap_trace_thread_t Request_etap_trace_thread; + __Request__thread_assign_t Request_thread_assign; + __Request__thread_assign_default_t Request_thread_assign_default; + __Request__thread_get_assignment_t Request_thread_get_assignment; + __Request__thread_set_policy_t Request_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__thread_act_subsystem__defined +#define __Reply__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t thread_info_outCnt; + integer_t thread_info_out[12]; + } __Reply__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__thread_act_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__thread_act_subsystem__defined +#define __ReplyUnion__thread_act_subsystem__defined +union __ReplyUnion__thread_act_subsystem { + __Reply__thread_terminate_t Reply_thread_terminate; + __Reply__act_get_state_t Reply_act_get_state; + __Reply__act_set_state_t Reply_act_set_state; + __Reply__thread_get_state_t Reply_thread_get_state; + __Reply__thread_set_state_t Reply_thread_set_state; + __Reply__thread_suspend_t Reply_thread_suspend; + __Reply__thread_resume_t Reply_thread_resume; + __Reply__thread_abort_t Reply_thread_abort; + __Reply__thread_abort_safely_t Reply_thread_abort_safely; + __Reply__thread_depress_abort_t Reply_thread_depress_abort; + __Reply__thread_get_special_port_t Reply_thread_get_special_port; + __Reply__thread_set_special_port_t Reply_thread_set_special_port; + __Reply__thread_info_t Reply_thread_info; + __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports; + __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports; + __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports; + __Reply__thread_policy_t Reply_thread_policy; + __Reply__thread_policy_set_t Reply_thread_policy_set; + __Reply__thread_policy_get_t Reply_thread_policy_get; + __Reply__thread_sample_t Reply_thread_sample; + __Reply__etap_trace_thread_t Reply_etap_trace_thread; + __Reply__thread_assign_t Reply_thread_assign; + __Reply__thread_assign_default_t Reply_thread_assign_default; + __Reply__thread_get_assignment_t Reply_thread_get_assignment; + __Reply__thread_set_policy_t Reply_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ + +#ifndef subsystem_to_name_map_thread_act +#define subsystem_to_name_map_thread_act \ + { "thread_terminate", 3600 },\ + { "act_get_state", 3601 },\ + { "act_set_state", 3602 },\ + { "thread_get_state", 3603 },\ + { "thread_set_state", 3604 },\ + { "thread_suspend", 3605 },\ + { "thread_resume", 3606 },\ + { "thread_abort", 3607 },\ + { "thread_abort_safely", 3608 },\ + { "thread_depress_abort", 3609 },\ + { "thread_get_special_port", 3610 },\ + { "thread_set_special_port", 3611 },\ + { "thread_info", 3612 },\ + { "thread_set_exception_ports", 3613 },\ + { "thread_get_exception_ports", 3614 },\ + { "thread_swap_exception_ports", 3615 },\ + { "thread_policy", 3616 },\ + { "thread_policy_set", 3617 },\ + { "thread_policy_get", 3618 },\ + { "thread_sample", 3619 },\ + { "etap_trace_thread", 3620 },\ + { "thread_assign", 3621 },\ + { "thread_assign_default", 3622 },\ + { "thread_get_assignment", 3623 },\ + { "thread_set_policy", 3624 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _thread_act_user_ */ diff --git a/tool/headers/mach/arm/thread_state.h b/tool/headers/mach/arm/thread_state.h new file mode 100644 index 000000000..a310b3805 --- /dev/null +++ b/tool/headers/mach/arm/thread_state.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_ARM_THREAD_STATE_H_ +#define _MACH_ARM_THREAD_STATE_H_ + +/* Size of maximum exported thread state in words */ +#define ARM_THREAD_STATE_MAX (17*4) /* Size of biggest state possible */ + +#define THREAD_STATE_MAX ARM_THREAD_STATE_MAX + +#endif /* _MACH_ARM_THREAD_STATE_H_ */ diff --git a/tool/headers/mach/arm/thread_status.h b/tool/headers/mach/arm/thread_status.h new file mode 100644 index 000000000..53d2edcf7 --- /dev/null +++ b/tool/headers/mach/arm/thread_status.h @@ -0,0 +1,41 @@ +/* ---------------------------------------------------------------------------- + * iphone-binutils: development tools for the Apple iPhone 07/12/2007 + * Copyright (c) 2007 Patrick Walton <pcwalton@uchicago.edu> but freely + * redistributable under the terms of the GNU General Public License. + * + * mach/arm/thread_status.h: information needed to save/restore threads + * ------------------------------------------------------------------------- */ + +#ifndef MACH_ARM_THREAD_STATUS_H +#define MACH_ARM_THREAD_STATUS_H + +#define ARM_THREAD_STATE 1 +#define ARM_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ + ( sizeof (arm_thread_state_t) / sizeof (int) )) + +#define THREAD_STATE_NONE 1 + +struct arm_thread_state { + unsigned int r0; + unsigned int r1; + unsigned int r2; + unsigned int r3; + unsigned int r4; + unsigned int r5; + unsigned int r6; + unsigned int r7; + unsigned int r8; + unsigned int r9; + unsigned int r10; + unsigned int r11; + unsigned int r12; + unsigned int r13; + unsigned int r14; + unsigned int r15; + unsigned int r16; /* Apple's thread_state has this 17th reg, bug?? */ +}; + +typedef struct arm_thread_state arm_thread_state_t; + +#endif + diff --git a/tool/headers/mach/arm/vm_param.h b/tool/headers/mach/arm/vm_param.h new file mode 100644 index 000000000..1f0a07a98 --- /dev/null +++ b/tool/headers/mach/arm/vm_param.h @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +/* + * Copyright (c) 1994 The University of Utah and + * the Computer Systems Laboratory at the University of Utah (CSL). + * All rights reserved. + * + * Permission to use, copy, modify and distribute this software is hereby + * granted provided that (1) source code retains these copyright, permission, + * and disclaimer notices, and (2) redistributions including binaries + * reproduce the notices in supporting documentation, and (3) all advertising + * materials mentioning features or use of this software display the following + * acknowledgement: ``This product includes software developed by the + * Computer Systems Laboratory at the University of Utah.'' + * + * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS + * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF + * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * CSL requests users of this software to return to csl-dist@cs.utah.edu any + * improvements that they make and grant CSL redistribution rights. + * + */ + +/* + * File: vm_param.h + * + * ARM machine dependent virtual memory parameters. + * Most of the declarations are preceeded by ARM_ (or arm_) + * which is OK because only ARM specific code will be using + * them. + */ + +#ifndef _MACH_ARM_VM_PARAM_H_ +#define _MACH_ARM_VM_PARAM_H_ + +#define BYTE_SIZE 8 /* byte size in bits */ + +/* FIXME: is this right? */ +#define ARM_PGBYTES 4096 /* bytes per 80386 page */ +#define ARM_PGSHIFT 12 /* number of bits to shift for pages */ + +#define PAGE_SIZE ARM_PGBYTES +#define PAGE_SHIFT ARM_PGSHIFT +#define PAGE_MASK (PAGE_SIZE - 1) + + + +#define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL) +/* + * default top of user stack... it grows down from here + */ +#define VM_USRSTACK64 ((user_addr_t) 0x00007FFF5FC00000ULL) +#define VM_DYLD64 ((user_addr_t) 0x00007FFF5FC00000ULL) +#define VM_LIB64_SHR_DATA ((user_addr_t) 0x00007FFF60000000ULL) +#define VM_LIB64_SHR_TEXT ((user_addr_t) 0x00007FFF80000000ULL) +/* + * the end of the usable user address space , for now about 47 bits. + * the 64 bit commpage is past the end of this + */ +#define VM_MAX_PAGE_ADDRESS ((user_addr_t) 0x00007FFFFFE00000ULL) +/* + * canonical end of user address space for limits checking + */ +#define VM_MAX_USER_PAGE_ADDRESS ((user_addr_t)0x00007FFFFFFFF000ULL) + + + +/* system-wide values */ +#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0) +#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS) + +/* process-relative values (all 32-bit legacy only for now) */ +#define VM_MIN_ADDRESS ((vm_offset_t) 0) +#define VM_USRSTACK32 ((vm_offset_t) 0xC0000000) +#define VM_MAX_ADDRESS ((vm_offset_t) 0xFFE00000) + + +#endif /* _MACH_ARM_VM_PARAM_H_ */ + diff --git a/tool/headers/mach/arm/vm_types.h b/tool/headers/mach/arm/vm_types.h new file mode 100644 index 000000000..7b2eac30b --- /dev/null +++ b/tool/headers/mach/arm/vm_types.h @@ -0,0 +1,20 @@ +#ifndef _MACH_ARM_VM_TYPES_H_ +#define _MACH_ARM_VM_TYPES_H_ + +#include <arm/_types.h> +#include <stdint.h> + +typedef __darwin_natural_t natural_t; +typedef int integer_t; + +typedef natural_t vm_offset_t; +typedef natural_t vm_size_t; + +typedef uint64_t mach_vm_address_t; +typedef uint64_t mach_vm_offset_t; +typedef uint64_t mach_vm_size_t; + +#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 + +#endif + diff --git a/tool/headers/mach/task.h b/tool/headers/mach/task.h new file mode 100644 index 000000000..459a33009 --- /dev/null +++ b/tool/headers/mach/task.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#if defined(__i386__) +#include <mach/i386/task.h> +#elif defined(__x86_64__) +#include <mach/x86_64/task.h> +#elif defined(__ppc__) +#include <mach/ppc/task.h> +#elif defined(__ppc64__) +#include <mach/ppc64/task.h> +#elif defined(__arm__) +#include <mach/arm/task.h> +#else +#error unknown architecture +#endif diff --git a/tool/headers/mach/thread_act.h b/tool/headers/mach/thread_act.h new file mode 100644 index 000000000..ac2309bf6 --- /dev/null +++ b/tool/headers/mach/thread_act.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#if defined(__i386__) +#include <mach/i386/thread_act.h> +#elif defined(__x86_64__) +#include <mach/x86_64/thread_act.h> +#elif defined(__ppc__) +#include <mach/ppc/thread_act.h> +#elif defined(__ppc64__) +#include <mach/ppc64/thread_act.h> +#elif defined(__arm__) +#include <mach/arm/thread_act.h> +#else +#error unknown architecture +#endif diff --git a/tool/headers/machine/limits.h b/tool/headers/machine/limits.h new file mode 100644 index 000000000..d52080f5e --- /dev/null +++ b/tool/headers/machine/limits.h @@ -0,0 +1,13 @@ +/* This is the `system' limits.h, independent of any particular + compiler. GCC provides its own limits.h which can be found in + /usr/lib/gcc, although it is not very informative. + This file is public domain. */ +#if defined (__ppc__) || defined (__ppc64__) +#include <ppc/limits.h> +#elif defined (__i386__) || defined(__x86_64__) +#include <i386/limits.h> +#elif defined (__arm__) +#include <arm/limits.h> +#else +#error architecture not supported +#endif diff --git a/tool/headers/math.h b/tool/headers/math.h new file mode 100644 index 000000000..b2d1a5bfb --- /dev/null +++ b/tool/headers/math.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __MATH_H__ +#define __MATH_H__ + +#if (defined(__ppc__) || defined(__ppc64__)) +#include "architecture/ppc/math.h" +#elif (defined (__i386__) || defined( __x86_64__ )) +#include "architecture/i386/math.h" +#elif defined(__arm__) +#include <architecture/arm/math.h> +#else +#error Unknown architecture +#endif + +#endif /* __MATH_H__ */ |