1221167Sgnn/*-
2221167Sgnn * Copyright(c) 2002-2011 Exar Corp.
3221167Sgnn * All rights reserved.
4221167Sgnn *
5221167Sgnn * Redistribution and use in source and binary forms, with or without
6221167Sgnn * modification are permitted provided the following conditions are met:
7221167Sgnn *
8221167Sgnn *    1. Redistributions of source code must retain the above copyright notice,
9221167Sgnn *       this list of conditions and the following disclaimer.
10221167Sgnn *
11221167Sgnn *    2. Redistributions in binary form must reproduce the above copyright
12221167Sgnn *       notice, this list of conditions and the following disclaimer in the
13221167Sgnn *       documentation and/or other materials provided with the distribution.
14221167Sgnn *
15221167Sgnn *    3. Neither the name of the Exar Corporation nor the names of its
16221167Sgnn *       contributors may be used to endorse or promote products derived from
17221167Sgnn *       this software without specific prior written permission.
18221167Sgnn *
19221167Sgnn * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20221167Sgnn * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21221167Sgnn * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22221167Sgnn * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23221167Sgnn * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24221167Sgnn * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25221167Sgnn * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26221167Sgnn * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27221167Sgnn * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28221167Sgnn * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29221167Sgnn * POSSIBILITY OF SUCH DAMAGE.
30221167Sgnn */
31221167Sgnn/*$FreeBSD$*/
32221167Sgnn
33221167Sgnn#ifndef	VXGE_OS_PAL_H
34221167Sgnn#define	VXGE_OS_PAL_H
35221167Sgnn
36221167Sgnn__EXTERN_BEGIN_DECLS
37221167Sgnn
38221167Sgnn/* --------------------------- platform switch ------------------------------ */
39221167Sgnn
40221167Sgnn/* platform specific header */
41221167Sgnn#include <dev/vxge/vxge-osdep.h>
42221167Sgnn#define	IN
43221167Sgnn#define	OUT
44221167Sgnn
45221167Sgnn#if !defined(VXGE_OS_PLATFORM_64BIT) && !defined(VXGE_OS_PLATFORM_32BIT)
46221167Sgnn#error "either 32bit or 64bit switch must be defined!"
47221167Sgnn#endif
48221167Sgnn
49221167Sgnn#if !defined(VXGE_OS_HOST_BIG_ENDIAN) && !defined(VXGE_OS_HOST_LITTLE_ENDIAN)
50221167Sgnn#error "either little endian or big endian switch must be defined!"
51221167Sgnn#endif
52221167Sgnn
53221167Sgnn#if defined(VXGE_OS_PLATFORM_64BIT)
54221167Sgnn#define	VXGE_OS_MEMORY_DEADCODE_PAT		0x5a5a5a5a5a5a5a5a
55221167Sgnn#else
56221167Sgnn#define	VXGE_OS_MEMORY_DEADCODE_PAT		0x5a5a5a5a
57221167Sgnn#endif
58221167Sgnn
59221167Sgnn#if defined(VXGE_DEBUG_ASSERT)
60221167Sgnn
61221167Sgnn/*
62221167Sgnn * vxge_assert
63221167Sgnn * @test: C-condition to check
64221167Sgnn * @fmt: printf like format string
65221167Sgnn *
66221167Sgnn * This function implements traditional assert. By default assertions
67221167Sgnn * are enabled. It can be disabled by defining VXGE_DEBUG_ASSERT macro in
68221167Sgnn * compilation
69221167Sgnn * time.
70221167Sgnn */
71221167Sgnn#define	vxge_assert(test) { \
72221167Sgnn	if (!(test)) vxge_os_bug("bad cond: "#test" at %s:%d\n", \
73221167Sgnn	__FILE__, __LINE__); }
74221167Sgnn#else
75221167Sgnn#define	vxge_assert(test)
76221167Sgnn#endif	/* end of VXGE_DEBUG_ASSERT */
77221167Sgnn
78221167Sgnn__EXTERN_END_DECLS
79221167Sgnn
80221167Sgnn#endif	/* VXGE_OS_PAL_H */
81