/* $FreeBSD$ */
/*++
Copyright (c) 1999 - 2003 Intel Corporation. All rights reserved
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
Abstract:
EFI to compile bindings
Revision History
--*/
#pragma pack()
#ifdef __FreeBSD__
#else
//
// Basic int types of various widths
//
#if (__STDC_VERSION__ < 199901L )
// No ANSI C 1999/2000 stdint.h integer width declarations
#ifdef _MSC_EXTENSIONS
// Use Microsoft C compiler integer width declarations
typedef unsigned short uint16_t;
typedef short int16_t;
typedef unsigned char uint8_t;
typedef char int8_t;
#else
#ifdef UNIX_LP64
// Use LP64 programming model from C_FLAGS for integer width declarations
typedef unsigned long uint64_t;
typedef long int64_t;
typedef unsigned int uint32_t;
typedef int int32_t;
typedef unsigned short uint16_t;
typedef short int16_t;
typedef unsigned char uint8_t;
typedef char int8_t;
#else
// Assume P64 programming model from C_FLAGS for integer width declarations
typedef unsigned long long uint64_t;
typedef long long int64_t;
typedef unsigned int uint32_t;
typedef int int32_t;
typedef unsigned short uint16_t;
typedef short int16_t;
typedef unsigned char uint8_t;
typedef char int8_t;
#endif
#endif
#endif
#endif /* __FreeBSD__ */
//
// Basic EFI types of various widths
//
#ifndef ACPI_THREAD_ID /* ACPI's definitions are fine, use those */
#ifndef _BASETSD_H_
#endif
#endif
#define VOID void
#ifdef EFI_NT_EMULATOR
#else
#ifdef EFI_DEBUG
#else
#endif
#endif
//
// Pointers must be aligned to these address to function
//
(UINTN)Adjustment = 0; \
//
// Define macros to build data structure signatures from characters.
//
#define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32))
//
// EFIAPI - prototype calling convention for EFI function pointers
// BOOTSERVICE - prototype for implementation of a boot service interface
// RUNTIMESERVICE - prototype for implementation of a runtime service interface
// RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service
// RUNTIME_CODE - pragma macro for declaring runtime code
//
#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
#ifdef _MSC_EXTENSIONS
#else
#endif
#endif
#define BOOTSERVICE
//#define RUNTIMESERVICE(proto,a) alloc_text("rtcode",a); proto a
//#define RUNTIMEFUNCTION(proto,a) alloc_text("rtcode",a); proto a
#define RUNTIMESERVICE
#define RUNTIMEFUNCTION
#define VOLATILE volatile
#define MEMORY_FENCE()
#ifdef EFI_NO_INTERFACE_DECL
#define EFI_FORWARD_DECLARATION(x)
#define EFI_INTERFACE_DECL(x)
#else
#define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
#define EFI_INTERFACE_DECL(x) typedef struct x
#endif
#ifdef EFI_NT_EMULATOR
//
// To help ensure proper coding of integrated drivers, they are
// compiled as DLLs. In NT they require a dll init entry pointer.
// The macro puts a stub entry point into the DLL so it will load.
//
InitFunction ( \
); \
\
UINTN \
) \
{ \
return 1; \
} \
\
int \
__declspec( dllexport ) \
__cdecl \
InitializeDriver ( \
void *ImageHandle, \
void *SystemTable \
) \
{ \
}
#else // EFI_NT_EMULATOR
//
// When build similiar to FW, then link everything together as
// one big module.
//
#endif // EFI_FW_NT
#ifdef __FreeBSD__
#define INTERFACE_DECL(x) struct x
#else
//
// Some compilers don't support the forward reference construct:
// typedef struct XXXXX
//
// The following macro provide a workaround for such cases.
//
#ifdef NO_INTERFACE_DECL
#define INTERFACE_DECL(x)
#else
#define INTERFACE_DECL(x) typedef struct x
#endif
#endif /* __FreeBSD__ */
#ifdef _MSC_EXTENSIONS
#endif