alcyone/SDK/INC/EFI/X64/efibind.h
Quinn Stephens 5f0a5d0588 [SDK] Fix preprocessor usage
Signed-off-by: Quinn Stephens <quinn@osmora.org>
2025-06-12 14:03:21 -04:00

79 lines
1.8 KiB
C

/*++
Copyright (c) 2024-2025, Quinn Stephens.
Provided under the BSD 3-Clause license.
Module Name:
efibind.h
Abstract:
Provides processor/compiler-specific EFI definitions for x64 systems.
--*/
#pragma once
#ifndef _EFIBIND_H
#define _EFIBIND_H
//
// Calling conventions.
//
#ifndef EFIAPI
#if defined_(MSC_EXTENSIONS)
#define EFIAPI __cdecl
#elif defined(__clang__) || defined(__GNUC__)
#define EFIAPI __attribute__((ms_abi))
#else
#define EFIAPI
#endif
#endif
//
// Error masks.
//
#define EFI_ERROR_MASK 0x8000000000000000
#define EFI_ERROR_MASK_OEM 0xC000000000000000
//
// Integer types.
//
#if defined(_MSC_EXTENSIONS)
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
#elif defined(UNIX_LP64)
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long uint64_t;
typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long int64_t;
#else
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;
#endif
//
// Word-sized integers.
//
typedef uint64_t UINTN;
typedef int64_t INTN;
#endif /* !_EFIBIND_H */