17c478bd9Sstevel@tonic-gate /******************************************************************************
27c478bd9Sstevel@tonic-gate  *
37c478bd9Sstevel@tonic-gate  * Name: acmsvc.h - VC specific defines, etc.
47c478bd9Sstevel@tonic-gate  *
57c478bd9Sstevel@tonic-gate  *****************************************************************************/
67c478bd9Sstevel@tonic-gate 
7*26f3cdf0SGordon Ross /*
8*26f3cdf0SGordon Ross  * Copyright (C) 2000 - 2011, Intel Corp.
97c478bd9Sstevel@tonic-gate  * All rights reserved.
107c478bd9Sstevel@tonic-gate  *
11*26f3cdf0SGordon Ross  * Redistribution and use in source and binary forms, with or without
12*26f3cdf0SGordon Ross  * modification, are permitted provided that the following conditions
13*26f3cdf0SGordon Ross  * are met:
14*26f3cdf0SGordon Ross  * 1. Redistributions of source code must retain the above copyright
15*26f3cdf0SGordon Ross  *    notice, this list of conditions, and the following disclaimer,
16*26f3cdf0SGordon Ross  *    without modification.
17*26f3cdf0SGordon Ross  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18*26f3cdf0SGordon Ross  *    substantially similar to the "NO WARRANTY" disclaimer below
19*26f3cdf0SGordon Ross  *    ("Disclaimer") and any redistribution must be conditioned upon
20*26f3cdf0SGordon Ross  *    including a substantially similar Disclaimer requirement for further
21*26f3cdf0SGordon Ross  *    binary redistribution.
22*26f3cdf0SGordon Ross  * 3. Neither the names of the above-listed copyright holders nor the names
23*26f3cdf0SGordon Ross  *    of any contributors may be used to endorse or promote products derived
24*26f3cdf0SGordon Ross  *    from this software without specific prior written permission.
25*26f3cdf0SGordon Ross  *
26*26f3cdf0SGordon Ross  * Alternatively, this software may be distributed under the terms of the
27*26f3cdf0SGordon Ross  * GNU General Public License ("GPL") version 2 as published by the Free
28*26f3cdf0SGordon Ross  * Software Foundation.
29*26f3cdf0SGordon Ross  *
30*26f3cdf0SGordon Ross  * NO WARRANTY
31*26f3cdf0SGordon Ross  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32*26f3cdf0SGordon Ross  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33*26f3cdf0SGordon Ross  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34*26f3cdf0SGordon Ross  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35*26f3cdf0SGordon Ross  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36*26f3cdf0SGordon Ross  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37*26f3cdf0SGordon Ross  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38*26f3cdf0SGordon Ross  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39*26f3cdf0SGordon Ross  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40*26f3cdf0SGordon Ross  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41*26f3cdf0SGordon Ross  * POSSIBILITY OF SUCH DAMAGES.
42*26f3cdf0SGordon Ross  */
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate #ifndef __ACMSVC_H__
457c478bd9Sstevel@tonic-gate #define __ACMSVC_H__
467c478bd9Sstevel@tonic-gate 
47*26f3cdf0SGordon Ross /* Eliminate warnings for "old" (non-secure) versions of clib functions */
48*26f3cdf0SGordon Ross 
49*26f3cdf0SGordon Ross #ifndef _CRT_SECURE_NO_WARNINGS
50*26f3cdf0SGordon Ross #define _CRT_SECURE_NO_WARNINGS
51*26f3cdf0SGordon Ross #endif
52*26f3cdf0SGordon Ross 
53*26f3cdf0SGordon Ross /* Eliminate warnings for POSIX clib function names (open, write, etc.) */
54*26f3cdf0SGordon Ross 
55*26f3cdf0SGordon Ross #ifndef _CRT_NONSTDC_NO_DEPRECATE
56*26f3cdf0SGordon Ross #define _CRT_NONSTDC_NO_DEPRECATE
57*26f3cdf0SGordon Ross #endif
58*26f3cdf0SGordon Ross 
59*26f3cdf0SGordon Ross #define COMPILER_DEPENDENT_INT64    __int64
60*26f3cdf0SGordon Ross #define COMPILER_DEPENDENT_UINT64   unsigned __int64
61*26f3cdf0SGordon Ross #define ACPI_INLINE                 __inline
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate /*
647c478bd9Sstevel@tonic-gate  * Calling conventions:
657c478bd9Sstevel@tonic-gate  *
667c478bd9Sstevel@tonic-gate  * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
677c478bd9Sstevel@tonic-gate  * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
687c478bd9Sstevel@tonic-gate  * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
697c478bd9Sstevel@tonic-gate  * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
707c478bd9Sstevel@tonic-gate  */
717c478bd9Sstevel@tonic-gate #define ACPI_SYSTEM_XFACE           __cdecl
727c478bd9Sstevel@tonic-gate #define ACPI_EXTERNAL_XFACE
737c478bd9Sstevel@tonic-gate #define ACPI_INTERNAL_XFACE
747c478bd9Sstevel@tonic-gate #define ACPI_INTERNAL_VAR_XFACE     __cdecl
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate #ifndef _LINT
777c478bd9Sstevel@tonic-gate /*
787c478bd9Sstevel@tonic-gate  * Math helper functions
797c478bd9Sstevel@tonic-gate  */
807c478bd9Sstevel@tonic-gate #define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
817c478bd9Sstevel@tonic-gate {                           \
827c478bd9Sstevel@tonic-gate     __asm mov    edx, n_hi  \
837c478bd9Sstevel@tonic-gate     __asm mov    eax, n_lo  \
847c478bd9Sstevel@tonic-gate     __asm div    d32        \
857c478bd9Sstevel@tonic-gate     __asm mov    q32, eax   \
867c478bd9Sstevel@tonic-gate     __asm mov    r32, edx   \
877c478bd9Sstevel@tonic-gate }
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate #define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
907c478bd9Sstevel@tonic-gate {                           \
917c478bd9Sstevel@tonic-gate     __asm shr    n_hi, 1    \
927c478bd9Sstevel@tonic-gate     __asm rcr    n_lo, 1    \
937c478bd9Sstevel@tonic-gate }
947c478bd9Sstevel@tonic-gate #else
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate /* Fake versions to make lint happy */
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate #define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
997c478bd9Sstevel@tonic-gate {                           \
1007c478bd9Sstevel@tonic-gate     q32 = n_hi / d32;       \
1017c478bd9Sstevel@tonic-gate     r32 = n_lo / d32;       \
1027c478bd9Sstevel@tonic-gate }
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate #define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
1057c478bd9Sstevel@tonic-gate {                           \
1067c478bd9Sstevel@tonic-gate     n_hi >>= 1;    \
1077c478bd9Sstevel@tonic-gate     n_lo >>= 1;    \
1087c478bd9Sstevel@tonic-gate }
1097c478bd9Sstevel@tonic-gate #endif
1107c478bd9Sstevel@tonic-gate 
1117c478bd9Sstevel@tonic-gate /* warn C4100: unreferenced formal parameter */
1127c478bd9Sstevel@tonic-gate #pragma warning(disable:4100)
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate /* warn C4127: conditional expression is constant */
1157c478bd9Sstevel@tonic-gate #pragma warning(disable:4127)
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate /* warn C4706: assignment within conditional expression */
1187c478bd9Sstevel@tonic-gate #pragma warning(disable:4706)
1197c478bd9Sstevel@tonic-gate 
1207c478bd9Sstevel@tonic-gate /* warn C4131: uses old-style declarator (iASL compiler only) */
1217c478bd9Sstevel@tonic-gate #pragma warning(disable:4131)
1227c478bd9Sstevel@tonic-gate 
123*26f3cdf0SGordon Ross #if _MSC_VER > 1200 /* Versions above VC++ 6 */
124*26f3cdf0SGordon Ross #pragma warning( disable : 4295 ) /* needed for acpredef.h array */
125*26f3cdf0SGordon Ross #endif
1267c478bd9Sstevel@tonic-gate 
1277c478bd9Sstevel@tonic-gate #endif /* __ACMSVC_H__ */
128