1433d6423SLionel Sambuc /******************************************************************************
2433d6423SLionel Sambuc *
3433d6423SLionel Sambuc * Name: acnetbsd.h - OS specific defines, etc.
4433d6423SLionel Sambuc *
5433d6423SLionel Sambuc *****************************************************************************/
6433d6423SLionel Sambuc
7*29492bb7SDavid van Moolenbroek /*
8*29492bb7SDavid van Moolenbroek * Copyright (C) 2000 - 2014, Intel Corp.
9433d6423SLionel Sambuc * All rights reserved.
10433d6423SLionel Sambuc *
11*29492bb7SDavid van Moolenbroek * Redistribution and use in source and binary forms, with or without
12*29492bb7SDavid van Moolenbroek * modification, are permitted provided that the following conditions
13*29492bb7SDavid van Moolenbroek * are met:
14*29492bb7SDavid van Moolenbroek * 1. Redistributions of source code must retain the above copyright
15*29492bb7SDavid van Moolenbroek * notice, this list of conditions, and the following disclaimer,
16*29492bb7SDavid van Moolenbroek * without modification.
17*29492bb7SDavid van Moolenbroek * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18*29492bb7SDavid van Moolenbroek * substantially similar to the "NO WARRANTY" disclaimer below
19*29492bb7SDavid van Moolenbroek * ("Disclaimer") and any redistribution must be conditioned upon
20*29492bb7SDavid van Moolenbroek * including a substantially similar Disclaimer requirement for further
21*29492bb7SDavid van Moolenbroek * binary redistribution.
22*29492bb7SDavid van Moolenbroek * 3. Neither the names of the above-listed copyright holders nor the names
23*29492bb7SDavid van Moolenbroek * of any contributors may be used to endorse or promote products derived
24*29492bb7SDavid van Moolenbroek * from this software without specific prior written permission.
25433d6423SLionel Sambuc *
26*29492bb7SDavid van Moolenbroek * Alternatively, this software may be distributed under the terms of the
27*29492bb7SDavid van Moolenbroek * GNU General Public License ("GPL") version 2 as published by the Free
28*29492bb7SDavid van Moolenbroek * Software Foundation.
29433d6423SLionel Sambuc *
30*29492bb7SDavid van Moolenbroek * NO WARRANTY
31*29492bb7SDavid van Moolenbroek * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32*29492bb7SDavid van Moolenbroek * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33*29492bb7SDavid van Moolenbroek * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34*29492bb7SDavid van Moolenbroek * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35*29492bb7SDavid van Moolenbroek * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36*29492bb7SDavid van Moolenbroek * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37*29492bb7SDavid van Moolenbroek * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38*29492bb7SDavid van Moolenbroek * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39*29492bb7SDavid van Moolenbroek * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40*29492bb7SDavid van Moolenbroek * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41*29492bb7SDavid van Moolenbroek * POSSIBILITY OF SUCH DAMAGES.
42*29492bb7SDavid van Moolenbroek */
43433d6423SLionel Sambuc
44433d6423SLionel Sambuc #ifndef __ACNETBSD_H__
45433d6423SLionel Sambuc #define __ACNETBSD_H__
46433d6423SLionel Sambuc
47433d6423SLionel Sambuc /* NetBSD uses GCC */
48433d6423SLionel Sambuc
49433d6423SLionel Sambuc #include "acgcc.h"
50433d6423SLionel Sambuc
51433d6423SLionel Sambuc #ifdef _LP64
52433d6423SLionel Sambuc #define ACPI_MACHINE_WIDTH 64
53433d6423SLionel Sambuc #else
54433d6423SLionel Sambuc #define ACPI_MACHINE_WIDTH 32
55433d6423SLionel Sambuc #endif
56433d6423SLionel Sambuc
57433d6423SLionel Sambuc #define COMPILER_DEPENDENT_INT64 int64_t
58433d6423SLionel Sambuc #define COMPILER_DEPENDENT_UINT64 uint64_t
59433d6423SLionel Sambuc
60433d6423SLionel Sambuc #ifdef _KERNEL
61433d6423SLionel Sambuc #include "opt_acpi.h" /* collect build-time options here */
62433d6423SLionel Sambuc
63433d6423SLionel Sambuc #include <sys/param.h>
64433d6423SLionel Sambuc #include <sys/systm.h>
65433d6423SLionel Sambuc #include <machine/stdarg.h>
66433d6423SLionel Sambuc #include <machine/acpi_func.h>
67433d6423SLionel Sambuc
68433d6423SLionel Sambuc #define asm __asm
69433d6423SLionel Sambuc
70433d6423SLionel Sambuc #define ACPI_USE_NATIVE_DIVIDE
71433d6423SLionel Sambuc
72433d6423SLionel Sambuc #define ACPI_SYSTEM_XFACE
73433d6423SLionel Sambuc #define ACPI_EXTERNAL_XFACE
74433d6423SLionel Sambuc #define ACPI_INTERNAL_XFACE
75433d6423SLionel Sambuc #define ACPI_INTERNAL_VAR_XFACE
76433d6423SLionel Sambuc
77433d6423SLionel Sambuc #ifdef ACPI_DEBUG
78433d6423SLionel Sambuc #define ACPI_DEBUG_OUTPUT
79433d6423SLionel Sambuc #define ACPI_DBG_TRACK_ALLOCATIONS
80433d6423SLionel Sambuc #ifdef DEBUGGER_THREADING
81433d6423SLionel Sambuc #undef DEBUGGER_THREADING
82433d6423SLionel Sambuc #endif /* DEBUGGER_THREADING */
83433d6423SLionel Sambuc #define DEBUGGER_THREADING 0 /* integrated with DDB */
84433d6423SLionel Sambuc #include "opt_ddb.h"
85433d6423SLionel Sambuc #ifdef DDB
86433d6423SLionel Sambuc #define ACPI_DISASSEMBLER
87433d6423SLionel Sambuc #define ACPI_DEBUGGER
88433d6423SLionel Sambuc #endif /* DDB */
89433d6423SLionel Sambuc #endif /* ACPI_DEBUG */
90433d6423SLionel Sambuc
91433d6423SLionel Sambuc static __inline int
isprint(int ch)92433d6423SLionel Sambuc isprint(int ch)
93433d6423SLionel Sambuc {
94433d6423SLionel Sambuc return(isspace(ch) || isascii(ch));
95433d6423SLionel Sambuc }
96433d6423SLionel Sambuc
97433d6423SLionel Sambuc #else /* _KERNEL */
98433d6423SLionel Sambuc
99433d6423SLionel Sambuc #include <ctype.h>
100433d6423SLionel Sambuc
101433d6423SLionel Sambuc /* Not building kernel code, so use libc */
102433d6423SLionel Sambuc #define ACPI_USE_STANDARD_HEADERS
103433d6423SLionel Sambuc
104433d6423SLionel Sambuc #define __cli()
105433d6423SLionel Sambuc #define __sti()
106433d6423SLionel Sambuc
107433d6423SLionel Sambuc /* XXX */
108433d6423SLionel Sambuc #define __inline inline
109433d6423SLionel Sambuc
110433d6423SLionel Sambuc #endif /* _KERNEL */
111433d6423SLionel Sambuc
112433d6423SLionel Sambuc /* Always use NetBSD code over our local versions */
113433d6423SLionel Sambuc #define ACPI_USE_SYSTEM_CLIBRARY
114433d6423SLionel Sambuc #define ACPI_USE_NATIVE_DIVIDE
115433d6423SLionel Sambuc
116433d6423SLionel Sambuc #endif /* __ACNETBSD_H__ */
117