Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

kDefs.h File Reference


Detailed Description

kTypes - Defines and Macros.

Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>

This file is part of k*.

k* is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

k* is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with k*; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Definition in file kDefs.h.

Go to the source code of this file.

Defines

#define K_ARCH_BITS   K_ARCH_BITS_EX(K_ARCH)
#define K_ARCH_BITS_EX(arch)   ( ((arch) & K_ARCH_BIT_MASK) >> K_ARCH_BIT_SHIFT )
#define K_ARCH_BYTES   K_ARCH_BYTES_EX(K_ARCH)
#define K_ARCH_BYTES_EX(arch)   ( ((arch) & K_ARCH_BIT_MASK) >> K_ARCH_BYTE_SHIFT )
#define K_ARCH_ENDIAN   K_ARCH_ENDIAN_EX(K_ARCH)
#define K_ARCH_ENDIAN_EX(arch)   ( ((arch) & K_ARCH_END_MASK) >> K_ARCH_END_SHIFT )
#define K_ARCH_IS_VALID(arch)
#define K_ENDIAN   K_ARCH_ENDIAN
#define NULL   ((void *)0)
Endian Conversion
#define K_ALIGN_P(pv, align)   ( (void *)( ((KUPTR)(pv) + ((align) - 1)) & ~(KUPTR)((align) - 1) ) )
#define K_ALIGN_Z(val, align)   ( ((val) + ((align) - 1)) & ~(KSIZE)((align) - 1) )
#define K_BE2H_U16(u16)   ((KU16)(u16))
#define K_BE2H_U32(u32)   ((KU32)(u32))
#define K_BE2H_U64(u64)   ((KU64)(u32))
#define K_BIT32(bit)   ( KU32_C(1) << (bit))
#define K_BIT64(bit)   ( KU64_C(1) << (bit))
#define K_DECL_EXPORT(type)   K_EXPORT type
#define K_DECL_IMPORT(type)   K_IMPORT type
#define K_DECL_INLINE(type)   K_INLINE type
#define K_E2E_U16(u16)   ( (KU16) (((u16) >> 8) | ((u16) << 8)) )
#define K_E2E_U32(u32)
#define K_E2E_U64(u64)
#define K_ELEMENTS(a)   ( sizeof(a) / sizeof((a)[0]) )
#define K_EXPORT
#define K_IMPORT   extern
#define K_LE2H_U16(u16)   K_E2E_U16(u16)
#define K_LE2H_U32(u64)   K_E2E_U64(u64)
#define K_LE2H_U32(u32)   K_E2E_U32(u32)
#define K_MAX(a, b)   ( (a) >= (b) ? (a) : (b) )
#define K_MIN(a, b)   ( (a) <= (b) ? (a) : (b) )
#define K_NOREF(var)   ( (void)(var) )
#define K_OFFSETOF(strct, memb)   ( (KSIZE)( &((strct *)0)->memb ) )
#define K_VALID_PTR(ptr)   ( (KUPTR)(ptr) + 0x1000U >= 0x2000U )
Architecture Identifiers.
These are the value that the K_ARCH #define can take.

#define K_ARCH_ALPHA   ( 5 | K_ARCH_BIT_64 | K_ARCH_END_BI)
#define K_ARCH_ALPHA_32   ( 6 | K_ARCH_BIT_32 | K_ARCH_END_BI)
#define K_ARCH_AMD64   ( 3 | K_ARCH_BIT_64 | K_ARCH_END_LITTLE)
#define K_ARCH_ARM_32   ( 7 | K_ARCH_BIT_32 | K_ARCH_END_BI)
#define K_ARCH_ARM_64   ( 8 | K_ARCH_BIT_64 | K_ARCH_END_BI)
#define K_ARCH_IA64   ( 4 | K_ARCH_BIT_64 | K_ARCH_END_BI)
#define K_ARCH_MAX   (15)
#define K_ARCH_MIPS_32   ( 9 | K_ARCH_BIT_32 | K_ARCH_END_BI)
#define K_ARCH_MIPS_64   (10 | K_ARCH_BIT_64 | K_ARCH_END_BI)
#define K_ARCH_POWERPC_32   (11 | K_ARCH_BIT_32 | K_ARCH_END_BI)
#define K_ARCH_POWERPC_64   (12 | K_ARCH_BIT_64 | K_ARCH_END_BI)
#define K_ARCH_SPARC_32   (13 | K_ARCH_BIT_32 | K_ARCH_END_BIG)
#define K_ARCH_SPARC_64   (14 | K_ARCH_BIT_64 | K_ARCH_END_BI)
#define K_ARCH_UNKNOWN   ( 0 )
#define K_ARCH_X86_16   ( 1 | K_ARCH_BIT_16 | K_ARCH_END_LITTLE)
#define K_ARCH_X86_32   ( 2 | K_ARCH_BIT_32 | K_ARCH_END_LITTLE)
Architecture bit width.
#define K_ARCH_BIT_128   0x1000
#define K_ARCH_BIT_16   0x0200
#define K_ARCH_BIT_32   0x0400
#define K_ARCH_BIT_64   0x0800
#define K_ARCH_BIT_8   0x0100
#define K_ARCH_BIT_MASK   0x1f00
#define K_ARCH_BIT_SHIFT   5
#define K_ARCH_BYTE_SHIFT   8
Architecture Endianness.
#define K_ARCH_END_BI   0x6000
#define K_ARCH_END_BIG   0x4000
#define K_ARCH_END_LITTLE   0x2000
#define K_ARCH_END_MASK   0x6000
#define K_ARCH_END_SHIFT   13
Endianness Identifiers.
These are the value that the K_ENDIAN #define can take.

#define K_ENDIAN_BI   3
#define K_ENDIAN_BIG   2
#define K_ENDIAN_LITTLE   1
Operative System Identifiers.
These are the value that the K_OS #define can take.

#define K_OS_DARWIN   1
#define K_OS_FREEBSD   2
#define K_OS_LINUX   3
#define K_OS_MAX   10
#define K_OS_NETBSD   4
#define K_OS_NT   5
#define K_OS_OPENBSD   6
#define K_OS_OS2   7
#define K_OS_SOLARIS   8
#define K_OS_UNKNOWN   0
#define K_OS_WINDOWS   9
Parameter validation macros
#define K_VALIDATE_BUFFER(buf, cb)
#define K_VALIDATE_ENUM(arg, enumname)
#define K_VALIDATE_FLAGS(arg, AllowedMask)
#define K_VALIDATE_OPTIONAL_BUFFER(buf, cb)
#define K_VALIDATE_OPTIONAL_STRING(str)
#define K_VALIDATE_STRING(str)


Generated by  Doxygen 1.6.0   Back to index