types.h revision e133b25a69c257839e69b4c5f025a6e0c1edc68f
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** @file
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * IPRT - Types.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/*
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * available from http://www.virtualbox.org. This file is free software;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * you can redistribute it and/or modify it under the terms of the GNU
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * General Public License (GPL) as published by the Free Software
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * The contents of this file may alternatively be used under the terms
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * of the Common Development and Distribution License Version 1.0
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * VirtualBox OSE distribution, in which case the provisions of the
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * CDDL are applicable instead of those of the GPL.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * You may elect to license modified versions of this file under the
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * terms and conditions of either the GPL or the CDDL or both.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsync * additional information or have any questions.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#ifndef ___iprt_types_h
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define ___iprt_types_h
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsync#include <iprt/cdefs.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#include <iprt/stdint.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/*
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Include standard C types.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#ifndef IPRT_NO_CRT
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# if defined(RT_OS_DARWIN) && defined(KERNEL)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /*
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Kludge for the darwin kernel:
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * stddef.h is missing IIRC.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsync# ifndef _PTRDIFF_T
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define _PTRDIFF_T
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync typedef __darwin_ptrdiff_t ptrdiff_t;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync# include <sys/types.h>
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# elif defined(RT_OS_FREEBSD) && defined(_KERNEL)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /*
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Kludge for the FreeBSD kernel:
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * stddef.h and sys/types.h have slightly different offsetof definitions
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * when compiling in kernel mode. This is just to make GCC shut up.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# ifndef _STDDEF_H_
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# undef offsetof
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# include <stddef.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# ifndef _SYS_TYPES_H_
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# undef offsetof
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# include <sys/types.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# ifndef offsetof
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# error "offsetof is not defined..."
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync# elif defined(RT_OS_FREEBSD) && HC_ARCH_BITS == 64 && defined(RT_ARCH_X86)
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync /*
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * Kludge for compiling 32-bit code on a 64-bit FreeBSD:
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * FreeBSD declares uint64_t and int64_t wrong (long unsigned and long int
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * though they need to be long long unsigned and long long int). These
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * defines conflict with our decleration in stdint.h. Adding the defines
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * below omits the definitions in the system header.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync# include <stddef.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define _UINT64_T_DECLARED
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define _INT64_T_DECLARED
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# include <sys/types.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# elif defined(RT_OS_LINUX) && defined(__KERNEL__)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /*
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Kludge for the linux kernel:
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * 1. sys/types.h doesn't mix with the kernel.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * 2. Starting with 2.6.19, linux/types.h typedefs bool and linux/stddef.h
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * declares false and true as enum values.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * 3. Starting with 2.6.24, linux/types.h typedefs uintptr_t.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * We work around these issues here and nowhere else.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# include <stddef.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# if defined(__cplusplus)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync typedef bool _Bool;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define bool linux_bool
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define true linux_true
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define false linux_false
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define uintptr_t linux_uintptr_t
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# include <linux/autoconf.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# include <linux/types.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# include <linux/stddef.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# undef uintptr_t
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# undef false
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# undef true
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# undef bool
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# include <stddef.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# include <sys/types.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/* Define any types missing from sys/types.h on windows. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# ifdef _MSC_VER
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# undef ssize_t
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync typedef intptr_t ssize_t;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else /* no crt */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# include <iprt/nocrt/compiler/compiler.h>
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif /* no crt */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** @defgroup grp_rt_types IPRT Base Types
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/* define wchar_t, we don't wanna include all the wcsstuff to get this. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#ifdef _MSC_VER
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# ifndef _WCHAR_T_DEFINED
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync typedef unsigned short wchar_t;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define _WCHAR_T_DEFINED
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#ifdef __GNUC__
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** @todo wchar_t on GNUC */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/*
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * C doesn't have bool.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#ifndef __cplusplus
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# if defined(__GNUC__)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# if defined(RT_OS_LINUX) && __GNUC__ < 3
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint8_t bool;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# if defined(RT_OS_DARWIN) && defined(_STDBOOL_H)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# undef bool
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef _Bool bool;
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# else
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsynctypedef unsigned char bool;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# ifndef true
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define true (1)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# ifndef false
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define false (0)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/**
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * 128-bit unsigned integer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync#if defined(__GNUC__) && defined(RT_ARCH_AMD64)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef __uint128_t uint128_t;
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef struct uint128_s
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t Lo;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t Hi;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync} uint128_t;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/**
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * 128-bit signed integer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if defined(__GNUC__) && defined(RT_ARCH_AMD64)
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsynctypedef __int128_t int128_t;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsynctypedef struct int128_s
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t lo;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync int64_t hi;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync} int128_t;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/**
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * 16-bit unsigned integer union.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef union RTUINT16U
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** natural view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t u;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 16-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t au16[1];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 8-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint8_t au8[4];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 16-bit hi/lo view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t Lo;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t Hi;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync } s;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync} RTUINT16U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a 16-bit unsigned integer union. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTUINT16U *PRTUINT16U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a const 32-bit unsigned integer union. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTUINT16U *PCRTUINT16U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/**
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * 32-bit unsigned integer union.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef union RTUINT32U
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** natural view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t u;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** Hi/Low view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t Lo;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t Hi;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync } s;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** Word view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w0;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w1;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync } Words;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 32-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t au32[1];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 16-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t au16[2];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 8-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint8_t au8[4];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync} RTUINT32U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a 32-bit unsigned integer union. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTUINT32U *PRTUINT32U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a const 32-bit unsigned integer union. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTUINT32U *PCRTUINT32U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/**
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * 64-bit unsigned integer union.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef union RTUINT64U
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** Natural view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t u;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** Hi/Low view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t Lo;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t Hi;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync } s;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** Double-Word view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t dw0;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t dw1;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync } DWords;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** Word view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w0;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w1;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w2;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w3;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync } Words;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 64-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t au64[1];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 32-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t au32[2];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 16-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t au16[4];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 8-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint8_t au8[8];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync} RTUINT64U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a 64-bit unsigned integer union. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTUINT64U *PRTUINT64U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a const 64-bit unsigned integer union. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTUINT64U *PCRTUINT64U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/**
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * 128-bit unsigned integer union.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef union RTUINT128U
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** Natural view.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * WARNING! This member depends on the compiler supporting 128-bit stuff. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint128_t u;
7b067f3f07310bff46d1d6a4ac94d8b9bb7ccccdvboxsync /** Hi/Low view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t Lo;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t Hi;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync } s;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** Quad-Word view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t qw0;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t qw1;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync } QWords;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** Double-Word view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t dw0;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t dw1;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t dw2;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t dw3;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync } DWords;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** Word view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w0;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w1;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w2;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w3;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w4;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w5;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w6;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t w7;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync } Words;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 64-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t au64[2];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 32-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t au32[4];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 16-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t au16[8];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /** 8-bit view. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint8_t au8[16];
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync} RTUINT128U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a 64-bit unsigned integer union. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTUINT128U *PRTUINT128U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a const 64-bit unsigned integer union. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTUINT128U *PCRTUINT128U;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Generic function type.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @see PFNRT
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef DECLCALLBACK(void) FNRT(void);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Generic function pointer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * With -pedantic, gcc-4 complains when casting a function to a data object, for example
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @code
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * void foo(void)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * {
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * }
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * void *bar = (void *)foo;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @endcode
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * The compiler would warn with "ISO C++ forbids casting between pointer-to-function and
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * pointer-to-object". The purpose of this warning is not to bother the programmer but to
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * point out that he is probably doing something dangerous, assigning a pointer to executable
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * code to a data object.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef FNRT *PFNRT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** @defgroup grp_rt_types_both Common Guest and Host Context Basic Types
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @ingroup grp_rt_types
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Signed integer which can contain both GC and HC pointers. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int32_t RTINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int64_t RTINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to signed integer which can contain both GC and HC pointers. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTINTPTR *PRTINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer const to signed integer which can contain both GC and HC pointers. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTINTPTR *PCRTINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Unsigned integer which can contain both GC and HC pointers. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsynctypedef uint32_t RTUINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint64_t RTUINTPTR;
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync#endif
a39ea3668b7019c23a68936259545f9b71bce1aavboxsync/** Pointer to unsigned integer which can contain both GC and HC pointers. */
fd492d285ed33c86dd76bc05d9d4f3e55bc0fb49vboxsynctypedef RTUINTPTR *PRTUINTPTR;
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync/** Pointer const to unsigned integer which can contain both GC and HC pointers. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTUINTPTR *PCRTUINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** The maximum value the RTUINTPTR type can hold. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTUINTPTR_MAX UINT32_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTUINTPTR_MAX UINT64_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Signed integer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int32_t RTINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to signed integer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTINT *PRTINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const signed integer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTINT *PCRTINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Unsigned integer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint32_t RTUINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to unsigned integer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTUINT *PRTUINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const unsigned integer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTUINT *PCRTUINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** A file offset / size (off_t). */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int64_t RTFOFF;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a file offset / size. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTFOFF *PRTFOFF;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** The max value for RTFOFF. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define RTFOFF_MAX INT64_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** The min value for RTFOFF. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define RTFOFF_MIN INT64_MIN
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** File mode (see iprt/fs.h). */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint32_t RTFMODE;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to file mode. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTFMODE *PRTFMODE;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Device unix number. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint32_t RTDEV;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a device unix number. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTDEV *PRTDEV;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** i-node number. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint64_t RTINODE;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a i-node number. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTINODE *PRTINODE;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** User id. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint32_t RTUID;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a user id. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTUID *PRTUID;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** NIL user id.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @todo check this for portability! */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define NIL_RTUID (~(RTUID)0);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Group id. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint32_t RTGID;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to a group id. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTGID *PRTGID;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** NIL group id.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @todo check this for portability! */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define NIL_RTGID (~(RTGID)0);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** I/O Port. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint16_t RTIOPORT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to I/O Port. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTIOPORT *PRTIOPORT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const I/O Port. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTIOPORT *PCRTIOPORT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Selector. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint16_t RTSEL;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to selector. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTSEL *PRTSEL;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const selector. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTSEL *PCRTSEL;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Max selector value. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define RTSEL_MAX UINT16_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Far 16-bit pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#pragma pack(1)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef struct RTFAR16
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint16_t off;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync RTSEL sel;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync} RTFAR16;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#pragma pack()
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to Far 16-bit pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTFAR16 *PRTFAR16;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const Far 16-bit pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTFAR16 *PCRTFAR16;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Far 32-bit pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#pragma pack(1)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef struct RTFAR32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint32_t off;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync RTSEL sel;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync} RTFAR32;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#pragma pack()
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to Far 32-bit pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTFAR32 *PRTFAR32;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const Far 32-bit pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTFAR32 *PCRTFAR32;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Far 64-bit pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#pragma pack(1)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef struct RTFAR64
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync uint64_t off;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync RTSEL sel;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync} RTFAR64;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#pragma pack()
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to Far 64-bit pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTFAR64 *PRTFAR64;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const Far 64-bit pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTFAR64 *PCRTFAR64;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** @} */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** @defgroup grp_rt_types_hc Host Context Basic Types
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @ingroup grp_rt_types
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @{
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** HC Natural signed integer.
fd492d285ed33c86dd76bc05d9d4f3e55bc0fb49vboxsync * @deprecated silly type. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int32_t RTHCINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to HC Natural signed integer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @deprecated silly type. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTHCINT *PRTHCINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const HC Natural signed integer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @deprecated silly type. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTHCINT *PCRTHCINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** HC Natural unsigned integer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @deprecated silly type. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint32_t RTHCUINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to HC Natural unsigned integer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @deprecated silly type. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTHCUINT *PRTHCUINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const HC Natural unsigned integer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @deprecated silly type. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTHCUINT *PCRTHCUINT;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Signed integer which can contain a HC pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if HC_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int32_t RTHCINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#elif HC_ARCH_BITS == 64
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int64_t RTHCINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# error Unsupported HC_ARCH_BITS value.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to signed integer which can contain a HC pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTHCINTPTR *PRTHCINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const signed integer which can contain a HC pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTHCINTPTR *PCRTHCINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Max RTHCINTPTR value. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if HC_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTHCINTPTR_MAX INT32_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTHCINTPTR_MAX INT64_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Min RTHCINTPTR value. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if HC_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTHCINTPTR_MIN INT32_MIN
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTHCINTPTR_MIN INT64_MIN
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Signed integer which can contain a HC ring-3 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if R3_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int32_t RTR3INTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#elif R3_ARCH_BITS == 64
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int64_t RTR3INTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# error Unsupported R3_ARCH_BITS value.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to signed integer which can contain a HC ring-3 pointer. */
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsynctypedef RTR3INTPTR *PRTR3INTPTR;
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync/** Pointer to const signed integer which can contain a HC ring-3 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTR3INTPTR *PCRTR3INTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Max RTR3INTPTR value. */
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync#if R3_ARCH_BITS == 32
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync# define RTR3INTPTR_MAX INT32_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR3INTPTR_MAX INT64_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync/** Min RTR3INTPTR value. */
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync#if R3_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR3INTPTR_MIN INT32_MIN
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR3INTPTR_MIN INT64_MIN
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Signed integer which can contain a HC ring-0 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if R0_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int32_t RTR0INTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#elif R0_ARCH_BITS == 64
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef int64_t RTR0INTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# error Unsupported R0_ARCH_BITS value.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to signed integer which can contain a HC ring-0 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTR0INTPTR *PRTR0INTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const signed integer which can contain a HC ring-0 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTR0INTPTR *PCRTR0INTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Max RTR0INTPTR value. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if R0_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR0INTPTR_MAX INT32_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR0INTPTR_MAX INT64_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Min RTHCINTPTR value. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if R0_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR0INTPTR_MIN INT32_MIN
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR0INTPTR_MIN INT64_MIN
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Unsigned integer which can contain a HC pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if HC_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint32_t RTHCUINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#elif HC_ARCH_BITS == 64
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint64_t RTHCUINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# error Unsupported HC_ARCH_BITS value.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to unsigned integer which can contain a HC pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTHCUINTPTR *PRTHCUINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to unsigned integer which can contain a HC pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTHCUINTPTR *PCRTHCUINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Max RTHCUINTTPR value. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if HC_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTHCUINTPTR_MAX UINT32_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTHCUINTPTR_MAX UINT64_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Unsigned integer which can contain a HC ring-3 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if R3_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint32_t RTR3UINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#elif R3_ARCH_BITS == 64
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint64_t RTR3UINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# error Unsupported R3_ARCH_BITS value.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to unsigned integer which can contain a HC ring-3 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTR3UINTPTR *PRTR3UINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to unsigned integer which can contain a HC ring-3 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTR3UINTPTR *PCRTR3UINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Max RTHCUINTTPR value. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if R3_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR3UINTPTR_MAX UINT32_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR3UINTPTR_MAX UINT64_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Unsigned integer which can contain a HC ring-0 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if R0_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint32_t RTR0UINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#elif R0_ARCH_BITS == 64
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint64_t RTR0UINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# error Unsupported R0_ARCH_BITS value.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to unsigned integer which can contain a HC ring-0 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTR0UINTPTR *PRTR0UINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to unsigned integer which can contain a HC ring-0 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTR0UINTPTR *PCRTR0UINTPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Max RTR0UINTTPR value. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#if HC_ARCH_BITS == 32
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR0UINTPTR_MAX UINT32_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define RTR0UINTPTR_MAX UINT64_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Host Physical Memory Address. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef uint64_t RTHCPHYS;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to Host Physical Memory Address. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTHCPHYS *PRTHCPHYS;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const Host Physical Memory Address. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTHCPHYS *PCRTHCPHYS;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** @def NIL_RTHCPHYS
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * NIL HC Physical Address.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * NIL_RTHCPHYS is used to signal an invalid physical address, similar
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * to the NULL pointer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define NIL_RTHCPHYS (~(RTHCPHYS)0)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Max RTHCPHYS value. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define RTHCPHYS_MAX UINT64_MAX
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** HC pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#ifndef IN_RC
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef void * RTHCPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTHCUINTPTR RTHCPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to HC pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTHCPTR *PRTHCPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const HC pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTHCPTR *PCRTHCPTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** @def NIL_RTHCPTR
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * NIL HC pointer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define NIL_RTHCPTR ((RTHCPTR)0)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Max RTHCPTR value. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define RTHCPTR_MAX ((RTHCPTR)RTHCUINTPTR_MAX)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** HC ring-3 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#ifdef IN_RING3
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef void * RTR3PTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#else
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTR3UINTPTR RTR3PTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#endif
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to HC ring-3 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef RTR3PTR *PRTR3PTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Pointer to const HC ring-3 pointer. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef const RTR3PTR *PCRTR3PTR;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** @def NIL_RTR3PTR
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * NIL HC ring-3 pointer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define NIL_RTR3PTR ((RTR3PTR)0)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Max RTR3PTR value. */
#define RTR3PTR_MAX ((RTR3PTR)RTR3UINTPTR_MAX)
/** HC ring-0 pointer. */
#ifdef IN_RING0
typedef void * RTR0PTR;
#else
typedef RTR0UINTPTR RTR0PTR;
#endif
/** Pointer to HC ring-0 pointer. */
typedef RTR0PTR *PRTR0PTR;
/** Pointer to const HC ring-0 pointer. */
typedef const RTR0PTR *PCRTR0PTR;
/** @def NIL_RTR0PTR
* NIL HC ring-0 pointer.
*/
#define NIL_RTR0PTR ((RTR0PTR)0)
/** Max RTR3PTR value. */
#define RTR0PTR_MAX ((RTR0PTR)RTR0UINTPTR_MAX)
/** Unsigned integer register in the host context. */
#if HC_ARCH_BITS == 32
typedef uint32_t RTHCUINTREG;
#elif HC_ARCH_BITS == 64
typedef uint64_t RTHCUINTREG;
#else
# error "Unsupported HC_ARCH_BITS!"
#endif
/** Pointer to an unsigned integer register in the host context. */
typedef RTHCUINTREG *PRTHCUINTREG;
/** Pointer to a const unsigned integer register in the host context. */
typedef const RTHCUINTREG *PCRTHCUINTREG;
/** Unsigned integer register in the host ring-3 context. */
#if R3_ARCH_BITS == 32
typedef uint32_t RTR3UINTREG;
#elif R3_ARCH_BITS == 64
typedef uint64_t RTR3UINTREG;
#else
# error "Unsupported R3_ARCH_BITS!"
#endif
/** Pointer to an unsigned integer register in the host ring-3 context. */
typedef RTR3UINTREG *PRTR3UINTREG;
/** Pointer to a const unsigned integer register in the host ring-3 context. */
typedef const RTR3UINTREG *PCRTR3UINTREG;
/** Unsigned integer register in the host ring-3 context. */
#if R0_ARCH_BITS == 32
typedef uint32_t RTR0UINTREG;
#elif R0_ARCH_BITS == 64
typedef uint64_t RTR0UINTREG;
#else
# error "Unsupported R3_ARCH_BITS!"
#endif
/** Pointer to an unsigned integer register in the host ring-3 context. */
typedef RTR0UINTREG *PRTR0UINTREG;
/** Pointer to a const unsigned integer register in the host ring-3 context. */
typedef const RTR0UINTREG *PCRTR0UINTREG;
/** @} */
/** @defgroup grp_rt_types_gc Guest Context Basic Types
* @ingroup grp_rt_types
* @{
*/
/** Natural signed integer in the GC.
* @deprecated silly type. */
#if GC_ARCH_BITS == 32
typedef int32_t RTGCINT;
#elif GC_ARCH_BITS == 64 /** @todo this isn't right, natural int is 32-bit, see RTHCINT. */
typedef int64_t RTGCINT;
#endif
/** Pointer to natural signed integer in GC.
* @deprecated silly type. */
typedef RTGCINT *PRTGCINT;
/** Pointer to const natural signed integer in GC.
* @deprecated silly type. */
typedef const RTGCINT *PCRTGCINT;
/** Natural unsigned integer in the GC.
* @deprecated silly type. */
#if GC_ARCH_BITS == 32
typedef uint32_t RTGCUINT;
#elif GC_ARCH_BITS == 64 /** @todo this isn't right, natural int is 32-bit, see RTHCUINT. */
typedef uint64_t RTGCUINT;
#endif
/** Pointer to natural unsigned integer in GC.
* @deprecated silly type. */
typedef RTGCUINT *PRTGCUINT;
/** Pointer to const natural unsigned integer in GC.
* @deprecated silly type. */
typedef const RTGCUINT *PCRTGCUINT;
/** Signed integer which can contain a GC pointer. */
#if GC_ARCH_BITS == 32
typedef int32_t RTGCINTPTR;
#elif GC_ARCH_BITS == 64
typedef int64_t RTGCINTPTR;
#endif
/** Pointer to signed integer which can contain a GC pointer. */
typedef RTGCINTPTR *PRTGCINTPTR;
/** Pointer to const signed integer which can contain a GC pointer. */
typedef const RTGCINTPTR *PCRTGCINTPTR;
/** Unsigned integer which can contain a GC pointer. */
#if GC_ARCH_BITS == 32
typedef uint32_t RTGCUINTPTR;
#elif GC_ARCH_BITS == 64
typedef uint64_t RTGCUINTPTR;
#else
# error Unsupported GC_ARCH_BITS value.
#endif
/** Pointer to unsigned integer which can contain a GC pointer. */
typedef RTGCUINTPTR *PRTGCUINTPTR;
/** Pointer to unsigned integer which can contain a GC pointer. */
typedef const RTGCUINTPTR *PCRTGCUINTPTR;
/** Unsigned integer which can contain a 32 bits GC pointer. */
typedef uint32_t RTGCUINTPTR32;
/** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
typedef RTGCUINTPTR32 *PRTGCUINTPTR32;
/** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
typedef const RTGCUINTPTR32 *PCRTGCUINTPTR32;
/** Unsigned integer which can contain a 64 bits GC pointer. */
typedef uint64_t RTGCUINTPTR64;
/** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
typedef RTGCUINTPTR64 *PRTGCUINTPTR64;
/** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
typedef const RTGCUINTPTR64 *PCRTGCUINTPTR64;
/** Guest Physical Memory Address.*/
typedef uint64_t RTGCPHYS;
/** Pointer to Guest Physical Memory Address. */
typedef RTGCPHYS *PRTGCPHYS;
/** Pointer to const Guest Physical Memory Address. */
typedef const RTGCPHYS *PCRTGCPHYS;
/** @def NIL_RTGCPHYS
* NIL GC Physical Address.
* NIL_RTGCPHYS is used to signal an invalid physical address, similar
* to the NULL pointer. Note that this value may actually be valid in
* some contexts.
*/
#define NIL_RTGCPHYS (~(RTGCPHYS)0U)
/** Max guest physical memory address value. */
#define RTGCPHYS_MAX UINT64_MAX
/** Guest Physical Memory Address; limited to 32 bits.*/
typedef uint32_t RTGCPHYS32;
/** Pointer to Guest Physical Memory Address. */
typedef RTGCPHYS32 *PRTGCPHYS32;
/** Pointer to const Guest Physical Memory Address. */
typedef const RTGCPHYS32 *PCRTGCPHYS32;
/** @def NIL_RTGCPHYS32
* NIL GC Physical Address.
* NIL_RTGCPHYS32 is used to signal an invalid physical address, similar
* to the NULL pointer. Note that this value may actually be valid in
* some contexts.
*/
#define NIL_RTGCPHYS32 (~(RTGCPHYS32)0)
/** Guest Physical Memory Address; limited to 64 bits.*/
typedef uint64_t RTGCPHYS64;
/** Pointer to Guest Physical Memory Address. */
typedef RTGCPHYS64 *PRTGCPHYS64;
/** Pointer to const Guest Physical Memory Address. */
typedef const RTGCPHYS64 *PCRTGCPHYS64;
/** @def NIL_RTGCPHYS64
* NIL GC Physical Address.
* NIL_RTGCPHYS64 is used to signal an invalid physical address, similar
* to the NULL pointer. Note that this value may actually be valid in
* some contexts.
*/
#define NIL_RTGCPHYS64 (~(RTGCPHYS64)0)
/** Guest context pointer, 32 bits.
* Keep in mind that this type is an unsigned integer in
* HC and void pointer in GC.
*/
typedef RTGCUINTPTR32 RTGCPTR32;
/** Pointer to a guest context pointer. */
typedef RTGCPTR32 *PRTGCPTR32;
/** Pointer to a const guest context pointer. */
typedef const RTGCPTR32 *PCRTGCPTR32;
/** @def NIL_RTGCPTR32
* NIL GC pointer.
*/
#define NIL_RTGCPTR32 ((RTGCPTR32)0)
/** Guest context pointer, 64 bits.
*/
typedef RTGCUINTPTR64 RTGCPTR64;
/** Pointer to a guest context pointer. */
typedef RTGCPTR64 *PRTGCPTR64;
/** Pointer to a const guest context pointer. */
typedef const RTGCPTR64 *PCRTGCPTR64;
/** @def NIL_RTGCPTR64
* NIL GC pointer.
*/
#define NIL_RTGCPTR64 ((RTGCPTR64)0)
/** Guest context pointer.
* Keep in mind that this type is an unsigned integer in
* HC and void pointer in GC.
*/
#if GC_ARCH_BITS == 64
typedef RTGCPTR64 RTGCPTR;
/** Pointer to a guest context pointer. */
typedef PRTGCPTR64 PRTGCPTR;
/** Pointer to a const guest context pointer. */
typedef PCRTGCPTR64 PCRTGCPTR;
/** @def NIL_RTGCPTR
* NIL GC pointer.
*/
# define NIL_RTGCPTR NIL_RTGCPTR64
/** Max RTGCPTR value. */
# define RTGCPTR_MAX UINT64_MAX
#elif GC_ARCH_BITS == 32
typedef RTGCPTR32 RTGCPTR;
/** Pointer to a guest context pointer. */
typedef PRTGCPTR32 PRTGCPTR;
/** Pointer to a const guest context pointer. */
typedef PCRTGCPTR32 PCRTGCPTR;
/** @def NIL_RTGCPTR
* NIL GC pointer.
*/
# define NIL_RTGCPTR NIL_RTGCPTR32
/** Max RTGCPTR value. */
# define RTGCPTR_MAX UINT32_MAX
#else
# error "Unsupported GC_ARCH_BITS!"
#endif
/** Unsigned integer register in the guest context. */
typedef uint32_t RTGCUINTREG32;
/** Pointer to an unsigned integer register in the guest context. */
typedef RTGCUINTREG32 *PRTGCUINTREG32;
/** Pointer to a const unsigned integer register in the guest context. */
typedef const RTGCUINTREG32 *PCRTGCUINTREG32;
typedef uint64_t RTGCUINTREG64;
/** Pointer to an unsigned integer register in the guest context. */
typedef RTGCUINTREG64 *PRTGCUINTREG64;
/** Pointer to a const unsigned integer register in the guest context. */
typedef const RTGCUINTREG64 *PCRTGCUINTREG64;
#if GC_ARCH_BITS == 64
typedef RTGCUINTREG64 RTGCUINTREG;
#elif GC_ARCH_BITS == 32
typedef RTGCUINTREG32 RTGCUINTREG;
#else
# error "Unsupported GC_ARCH_BITS!"
#endif
/** Pointer to an unsigned integer register in the guest context. */
typedef RTGCUINTREG *PRTGCUINTREG;
/** Pointer to a const unsigned integer register in the guest context. */
typedef const RTGCUINTREG *PCRTGCUINTREG;
/** @} */
/** @defgroup grp_rt_types_rc Raw mode Context Basic Types
* @ingroup grp_rt_types
* @{
*/
/** Raw mode context pointer; a 32 bits guest context pointer.
* Keep in mind that this type is an unsigned integer in
* HC and void pointer in RC.
*/
#ifdef IN_RC
typedef void * RTRCPTR;
#else
typedef uint32_t RTRCPTR;
#endif
/** Pointer to a raw mode context pointer. */
typedef RTRCPTR *PRTRCPTR;
/** Pointer to a const raw mode context pointer. */
typedef const RTRCPTR *PCRTRCPTR;
/** @def NIL_RTGCPTR
* NIL RC pointer.
*/
#define NIL_RTRCPTR ((RTRCPTR)0)
/** @def RTRCPTR_MAX
* The maximum value a RTRCPTR can have. Mostly used as INVALID value.
*/
#define RTRCPTR_MAX ((RTRCPTR)UINT32_MAX)
/** Raw mode context pointer, unsigned integer variant. */
typedef int32_t RTRCINTPTR;
/** @def RTRCUINPTR_MAX
* The maximum value a RTRCUINPTR can have.
*/
#define RTRCUINTPTR_MAX ((RTRCUINTPTR)UINT32_MAX)
/** Raw mode context pointer, signed integer variant. */
typedef uint32_t RTRCUINTPTR;
/** @def RTRCINPTR_MIN
* The minimum value a RTRCINPTR can have.
*/
#define RTRCINTPTR_MIN ((RTRCINTPTR)INT32_MIN)
/** @def RTRCINPTR_MAX
* The maximum value a RTRCINPTR can have.
*/
#define RTRCINTPTR_MAX ((RTRCINTPTR)INT32_MAX)
/** @} */
/** @defgroup grp_rt_types_cc Current Context Basic Types
* @ingroup grp_rt_types
* @{
*/
/** Current Context Physical Memory Address.*/
#ifdef IN_RC
typedef RTGCPHYS RTCCPHYS;
#else
typedef RTHCPHYS RTCCPHYS;
#endif
/** Pointer to Current Context Physical Memory Address. */
typedef RTCCPHYS *PRTCCPHYS;
/** Pointer to const Current Context Physical Memory Address. */
typedef const RTCCPHYS *PCRTCCPHYS;
/** @def NIL_RTCCPHYS
* NIL CC Physical Address.
* NIL_RTCCPHYS is used to signal an invalid physical address, similar
* to the NULL pointer.
*/
#ifdef IN_RC
# define NIL_RTCCPHYS NIL_RTGCPHYS
#else
# define NIL_RTCCPHYS NIL_RTHCPHYS
#endif
/** Unsigned integer register in the current context. */
#if ARCH_BITS == 32
typedef uint32_t RTCCUINTREG;
#elif ARCH_BITS == 64
typedef uint64_t RTCCUINTREG;
#else
# error "Unsupported ARCH_BITS!"
#endif
/** Pointer to an unsigned integer register in the current context. */
typedef RTCCUINTREG *PRTCCUINTREG;
/** Pointer to a const unsigned integer register in the current context. */
typedef RTCCUINTREG const *PCRTCCUINTREG;
/** Signed integer register in the current context. */
#if ARCH_BITS == 32
typedef int32_t RTCCINTREG;
#elif ARCH_BITS == 64
typedef int64_t RTCCINTREG;
#endif
/** Pointer to a signed integer register in the current context. */
typedef RTCCINTREG *PRTCCINTREG;
/** Pointer to a const signed integer register in the current context. */
typedef RTCCINTREG const *PCRTCCINTREG;
/** @} */
/** File handle. */
typedef RTUINT RTFILE;
/** Pointer to file handle. */
typedef RTFILE *PRTFILE;
/** Nil file handle. */
#define NIL_RTFILE (~(RTFILE)0)
/** Async I/O request handle. */
typedef R3PTRTYPE(struct RTFILEAIOREQINTERNAL *) RTFILEAIOREQ;
/** Pointer to a async I/O request handle. */
typedef RTFILEAIOREQ *PRTFILEAIOREQ;
/** Nil request handle. */
#define NIL_RTFILEAIOREQ 0
/** Async I/O completion context handle. */
typedef R3PTRTYPE(struct RTFILEAIOCTXINTERNAL *) RTFILEAIOCTX;
/** Pointer to a async I/O completion context handle. */
typedef RTFILEAIOCTX *PRTFILEAIOCTX;
/** Nil context handle. */
#define NIL_RTFILEAIOCTX 0
/** Loader module handle. */
typedef R3PTRTYPE(struct RTLDRMODINTERNAL *) RTLDRMOD;
/** Pointer to a loader module handle. */
typedef RTLDRMOD *PRTLDRMOD;
/** Nil loader module handle. */
#define NIL_RTLDRMOD 0
/** Ring-0 memory object handle. */
typedef R0PTRTYPE(struct RTR0MEMOBJINTERNAL *) RTR0MEMOBJ;
/** Pointer to a Ring-0 memory object handle. */
typedef RTR0MEMOBJ *PRTR0MEMOBJ;
/** Nil ring-0 memory object handle. */
#define NIL_RTR0MEMOBJ 0
/** Native thread handle. */
typedef RTHCUINTPTR RTNATIVETHREAD;
/** Pointer to an native thread handle. */
typedef RTNATIVETHREAD *PRTNATIVETHREAD;
/** Nil native thread handle. */
#define NIL_RTNATIVETHREAD (~(RTNATIVETHREAD)0)
/** Process identifier. */
typedef uint32_t RTPROCESS;
/** Pointer to a process identifier. */
typedef RTPROCESS *PRTPROCESS;
/** Nil process identifier. */
#define NIL_RTPROCESS (~(RTPROCESS)0)
/** Process ring-0 handle. */
typedef RTR0UINTPTR RTR0PROCESS;
/** Pointer to a ring-0 process handle. */
typedef RTR0PROCESS *PRTR0PROCESS;
/** Nil ring-0 process handle. */
#define NIL_RTR0PROCESS (~(RTR0PROCESS)0)
/** @typedef RTSEMEVENT
* Event Semaphore handle. */
typedef R3R0PTRTYPE(struct RTSEMEVENTINTERNAL *) RTSEMEVENT;
/** Pointer to an event semaphore handle. */
typedef RTSEMEVENT *PRTSEMEVENT;
/** Nil event semaphore handle. */
#define NIL_RTSEMEVENT 0
/** @typedef RTSEMEVENTMULTI
* Event Multiple Release Semaphore handle. */
typedef R3R0PTRTYPE(struct RTSEMEVENTMULTIINTERNAL *) RTSEMEVENTMULTI;
/** Pointer to an event multiple release semaphore handle. */
typedef RTSEMEVENTMULTI *PRTSEMEVENTMULTI;
/** Nil multiple release event semaphore handle. */
#define NIL_RTSEMEVENTMULTI 0
/** @typedef RTSEMFASTMUTEX
* Fast mutex Semaphore handle. */
typedef R3R0PTRTYPE(struct RTSEMFASTMUTEXINTERNAL *) RTSEMFASTMUTEX;
/** Pointer to a fast mutex semaphore handle. */
typedef RTSEMFASTMUTEX *PRTSEMFASTMUTEX;
/** Nil fast mutex semaphore handle. */
#define NIL_RTSEMFASTMUTEX 0
/** @typedef RTSEMMUTEX
* Mutex Semaphore handle. */
typedef R3R0PTRTYPE(struct RTSEMMUTEXINTERNAL *) RTSEMMUTEX;
/** Pointer to a mutex semaphore handle. */
typedef RTSEMMUTEX *PRTSEMMUTEX;
/** Nil mutex semaphore handle. */
#define NIL_RTSEMMUTEX 0
/** @typedef RTSEMSPINMUTEX
* Spinning mutex Semaphore handle. */
typedef R3R0PTRTYPE(struct RTSEMSPINMUTEXINTERNAL *) RTSEMSPINMUTEX;
/** Pointer to a spinning mutex semaphore handle. */
typedef RTSEMSPINMUTEX *PRTSEMSPINMUTEX;
/** Nil spinning mutex semaphore handle. */
#define NIL_RTSEMSPINMUTEX 0
/** @typedef RTSEMRW
* Read/Write Semaphore handle. */
typedef R3R0PTRTYPE(struct RTSEMRWINTERNAL *) RTSEMRW;
/** Pointer to a read/write semaphore handle. */
typedef RTSEMRW *PRTSEMRW;
/** Nil read/write semaphore handle. */
#define NIL_RTSEMRW 0
/** Spinlock handle. */
typedef R3R0PTRTYPE(struct RTSPINLOCKINTERNAL *) RTSPINLOCK;
/** Pointer to a spinlock handle. */
typedef RTSPINLOCK *PRTSPINLOCK;
/** Nil spinlock handle. */
#define NIL_RTSPINLOCK 0
/** Socket handle. */
typedef int RTSOCKET;
/** Pointer to socket handle. */
typedef RTSOCKET *PRTSOCKET;
/** Nil socket handle. */
#define NIL_RTSOCKET (~(RTSOCKET)0)
/** Thread handle.*/
typedef R3R0PTRTYPE(struct RTTHREADINT *) RTTHREAD;
/** Pointer to thread handle. */
typedef RTTHREAD *PRTTHREAD;
/** Nil thread handle. */
#define NIL_RTTHREAD 0
/** A TLS index. */
typedef RTHCINTPTR RTTLS;
/** Pointer to a TLS index. */
typedef RTTLS *PRTTLS;
/** Pointer to a const TLS index. */
typedef RTTLS const *PCRTTLS;
/** NIL TLS index value. */
#define NIL_RTTLS (-1)
/** Handle to a simple heap. */
typedef R3R0PTRTYPE(struct RTHEAPSIMPLEINTERNAL *) RTHEAPSIMPLE;
/** Pointer to a handle to a simple heap. */
typedef RTHEAPSIMPLE *PRTHEAPSIMPLE;
/** NIL simple heap handle. */
#define NIL_RTHEAPSIMPLE ((RTHEAPSIMPLE)0)
/** Handle to an environment block. */
typedef R3PTRTYPE(struct RTENVINTERNAL *) RTENV;
/** Pointer to a handle to an environment block. */
typedef RTENV *PRTENV;
/** NIL simple heap handle. */
#define NIL_RTENV ((RTENV)0)
/** A CPU identifier.
* @remarks This doesn't have to correspond to the APIC ID (intel/amd). Nor
* does it have to correspond to the bits in the affinity mask, at
* least not until we've sorted out Windows NT. */
typedef uint32_t RTCPUID;
/** Pointer to a CPU identifier. */
typedef RTCPUID *PRTCPUID;
/** Pointer to a const CPU identifier. */
typedef RTCPUID const *PCRTCPUID;
/** Nil CPU Id. */
#define NIL_RTCPUID ((RTCPUID)~0)
/** A CPU set.
* Treat this as an opaque type and always use RTCpuSet* for manupulating it.
* @remarks Subject to change. */
typedef uint64_t RTCPUSET;
/** Pointer to a CPU set. */
typedef RTCPUSET *PRTCPUSET;
/** Pointer to a const CPU set. */
typedef RTCPUSET const *PCRTCPUSET;
/** A handle table handle. */
typedef R3R0PTRTYPE(struct RTHANDLETABLEINT *) RTHANDLETABLE;
/** A pointer to a handle table handle. */
typedef RTHANDLETABLE *PRTHANDLETABLE;
/** @def NIL_RTHANDLETABLE
* NIL handle table handle. */
#define NIL_RTHANDLETABLE ((RTHANDLETABLE)0)
/** A handle to a low resolution timer. */
typedef R3R0PTRTYPE(struct RTTIMERLRINT *) RTTIMERLR;
/** A pointer to a low resolution timer handle. */
typedef RTTIMERLR *PRTTIMERLR;
/** @def NIL_RTTIMERLR
* NIL low resolution timer handle value. */
#define NIL_RTTIMERLR ((RTTIMERLR)0)
/** Handle to a random number generator. */
typedef R3R0PTRTYPE(struct RTRANDINT *) RTRAND;
/** Pointer to a random number generator handle. */
typedef RTRAND *PRTRAND;
/** NIL random number genrator handle value. */
#define NIL_RTRAND ((RTRAND)0)
/** Debug address space handle. */
typedef R3R0PTRTYPE(struct RTDBGASINT *) RTDBGAS;
/** Pointer to a debug address space handle. */
typedef RTDBGAS *PRTDBGAS;
/** NIL debug address space handle. */
#define NIL_RTDBGAS ((RTDBGAS)0)
/** Debug module handle. */
typedef R3R0PTRTYPE(struct RTDBGMODINT *) RTDBGMOD;
/** Pointer to a debug module handle. */
typedef RTDBGMOD *PRTDBGMOD;
/** NIL debug module handle. */
#define NIL_RTDBGMOD ((RTDBGMOD)0)
/** Memory pool handle. */
typedef R3R0PTRTYPE(struct RTMEMPOOLINT *) RTMEMPOOL;
/** Pointer to a memory pool handle. */
typedef RTMEMPOOL *PRTMEMPOOL;
/** NIL memory pool handle. */
#define NIL_RTMEMPOOL ((RTMEMPOOL)0)
/** The default memory pool handle. */
#define RTMEMPOOL_DEFAULT ((RTMEMPOOL)-2)
/** String cache handle. */
typedef R3R0PTRTYPE(struct RTSTRCACHEINT *) RTSTRCACHE;
/** Pointer to a string cache handle. */
typedef RTSTRCACHE *PRTSTRCACHE;
/** NIL string cache handle. */
#define NIL_RTSTRCACHE ((RTSTRCACHE)0)
/** The default string cache handle. */
#define RTSTRCACHE_DEFAULT ((RTSTRCACHE)-2)
/**
* UUID data type.
*
* @note IPRT defines that the first three integers in the @c Gen struct
* interpretation are in little endian representation. This is different to
* many other UUID implementation, and requires conversion if you need to
* achieve consistent results.
*/
typedef union RTUUID
{
/** 8-bit view. */
uint8_t au8[16];
/** 16-bit view. */
uint16_t au16[8];
/** 32-bit view. */
uint32_t au32[4];
/** 64-bit view. */
uint64_t au64[2];
/** The way the UUID is declared by the DCE specification. */
struct
{
uint32_t u32TimeLow;
uint16_t u16TimeMid;
uint16_t u16TimeHiAndVersion;
uint8_t u8ClockSeqHiAndReserved;
uint8_t u8ClockSeqLow;
uint8_t au8Node[6];
} Gen;
} RTUUID;
/** Pointer to UUID data. */
typedef RTUUID *PRTUUID;
/** Pointer to readonly UUID data. */
typedef const RTUUID *PCRTUUID;
/**
* UUID string maximum length.
*/
#define RTUUID_STR_LENGTH 37
/** Compression handle. */
typedef struct RTZIPCOMP *PRTZIPCOMP;
/** Decompressor handle. */
typedef struct RTZIPDECOMP *PRTZIPDECOMP;
/**
* Unicode Code Point.
*/
typedef uint32_t RTUNICP;
/** Pointer to an Unicode Code Point. */
typedef RTUNICP *PRTUNICP;
/** Pointer to an Unicode Code Point. */
typedef const RTUNICP *PCRTUNICP;
/**
* UTF-16 character.
* @remark wchar_t is not usable since it's compiler defined.
* @remark When we use the term character we're not talking about unicode code point, but
* the basic unit of the string encoding. Thus cwc - count of wide chars - means
* count of RTUTF16; cuc - count of unicode chars - means count of RTUNICP;
* and cch means count of the typedef 'char', which is assumed to be an octet.
*/
typedef uint16_t RTUTF16;
/** Pointer to a UTF-16 character. */
typedef RTUTF16 *PRTUTF16;
/** Pointer to a const UTF-16 character. */
typedef const RTUTF16 *PCRTUTF16;
/**
* Wait for ever if we have to.
*/
#define RT_INDEFINITE_WAIT (~0U)
/**
* Generic process callback.
*
* @returns VBox status code. Failure will cancel the operation.
* @param uPercentage The percentage of the operation which has been completed.
* @param pvUser The user specified argument.
*/
typedef DECLCALLBACK(int) FNRTPROGRESS(unsigned uPrecentage, void *pvUser);
/** Pointer to a generic progress callback function, FNRTPROCESS(). */
typedef FNRTPROGRESS *PFNRTPROGRESS;
/**
* Rectangle data type.
*/
typedef struct RTRECT
{
/** left X coordinate. */
int32_t xLeft;
/** top Y coordinate. */
int32_t yTop;
/** right X coordinate. (exclusive) */
int32_t xRight;
/** bottom Y coordinate. (exclusive) */
int32_t yBottom;
} RTRECT;
/** Pointer to a rectangle. */
typedef RTRECT *PRTRECT;
/** Pointer to a const rectangle. */
typedef const RTRECT *PCRTRECT;
/**
* Ethernet MAC address.
*
* The first 24 bits make up the Organisationally Unique Identifier (OUI),
* where the first bit (little endian) indicates multicast (set) / unicast,
* and the second bit indicates locally (set) / global administered. If all
* bits are set, it's a broadcast.
*/
typedef union RTMAC
{
/** @todo add a bitfield view of this stuff. */
/** 8-bit view. */
uint8_t au8[6];
/** 16-bit view. */
uint16_t au16[3];
} RTMAC;
/** Pointer to a MAC address. */
typedef RTMAC *PRTMAC;
/** Pointer to a readonly MAC address. */
typedef const RTMAC *PCRTMAC;
#ifdef __cplusplus
/**
* Strict type validation helper class.
*
* See RTErrStrictType and RT_SUCCESS_NP.
*/
class RTErrStrictType2
{
protected:
/** The status code. */
int32_t m_rc;
public:
/**
* Constructor.
* @param rc IPRT style status code.
*/
RTErrStrictType2(int32_t rc) : m_rc(rc)
{
}
/**
* Get the status code.
* @returns IPRT style status code.
*/
int32_t getValue() const
{
return m_rc;
}
};
#endif /* __cplusplus */
/** @} */
#endif