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