xref: /DragonStub/inc/riscv64/efibind.h (revision b5f98d40fe707ced47ba6bb86614b91deb0690a1)
1b95f138fSHeinrich Schuchardt /* SPDX-License-Identifier: GPL-2.0+ */
2b95f138fSHeinrich Schuchardt 
3b95f138fSHeinrich Schuchardt #include <stdint.h>
4b95f138fSHeinrich Schuchardt 
5b95f138fSHeinrich Schuchardt #define EFIAPI
6b95f138fSHeinrich Schuchardt #define EFI_ERROR_MASK 0x8000000000000000
7b95f138fSHeinrich Schuchardt #define EFIERR(a) (EFI_ERROR_MASK | a)
8b95f138fSHeinrich Schuchardt #define INTERFACE_DECL(x) struct x
9b95f138fSHeinrich Schuchardt #define MIN_ALIGNMENT_SIZE 8
10b95f138fSHeinrich Schuchardt #define RUNTIMEFUNCTION
11b95f138fSHeinrich Schuchardt #define VOID void
12b95f138fSHeinrich Schuchardt 
13b95f138fSHeinrich Schuchardt typedef uint8_t BOOLEAN;
14b95f138fSHeinrich Schuchardt typedef int64_t INTN;
15b95f138fSHeinrich Schuchardt typedef uint64_t UINTN;
16b95f138fSHeinrich Schuchardt typedef int8_t INT8;
17b95f138fSHeinrich Schuchardt typedef uint8_t UINT8;
18b95f138fSHeinrich Schuchardt typedef int16_t INT16;
19b95f138fSHeinrich Schuchardt typedef uint16_t UINT16;
20b95f138fSHeinrich Schuchardt typedef int32_t INT32;
21b95f138fSHeinrich Schuchardt typedef uint32_t UINT32;
22b95f138fSHeinrich Schuchardt typedef int64_t INT64;
23b95f138fSHeinrich Schuchardt typedef uint64_t UINT64;
24b95f138fSHeinrich Schuchardt typedef uint16_t WCHAR;
25b95f138fSHeinrich Schuchardt 
26b95f138fSHeinrich Schuchardt #define BREAKPOINT() while(1);
27b95f138fSHeinrich Schuchardt #define uefi_call_wrapper(func, va_num, ...) func(__VA_ARGS__)
28b95f138fSHeinrich Schuchardt 
29b95f138fSHeinrich Schuchardt #define EFI_SIGNATURE_16(A,B)             ((A) | (B<<8))
30b95f138fSHeinrich Schuchardt #define EFI_SIGNATURE_32(A,B,C,D)         (EFI_SIGNATURE_16(A,B)     | (EFI_SIGNATURE_16(C,D)     << 16))
31b95f138fSHeinrich Schuchardt #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))
32*b5f98d40SHeinrich Schuchardt 
33*b5f98d40SHeinrich Schuchardt #define EFI_FUNCTION
34