2020-02-23 21:26:51 +01:00
|
|
|
//
|
|
|
|
// Platform.h.h
|
|
|
|
// cpp_tests
|
|
|
|
//
|
|
|
|
// Created by jief on 23.02.20.
|
|
|
|
// Copyright © 2020 JF Knudsen. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Platform_h_h
|
|
|
|
#define Platform_h_h
|
|
|
|
|
|
|
|
#include <limits.h>
|
|
|
|
#include <stdarg.h>
|
2020-03-11 15:23:58 +01:00
|
|
|
#include <stdint.h>
|
2020-03-13 14:11:58 +01:00
|
|
|
#include <string.h>
|
2020-03-21 14:12:26 +01:00
|
|
|
#include <inttypes.h>
|
|
|
|
#include <wchar.h>
|
|
|
|
#include "posix.h"
|
2020-04-24 08:36:29 +02:00
|
|
|
|
2020-04-24 11:30:09 +02:00
|
|
|
#include "../../../rEFIt_UEFI/Platform/Posix/abort.h"
|
2020-04-24 08:36:29 +02:00
|
|
|
#include "../../../rEFIt_UEFI/cpp_foundation/unicode_conversions.h"
|
|
|
|
#include "../../../rEFIt_UEFI/cpp_foundation/XString.h"
|
|
|
|
|
2020-04-24 11:30:09 +02:00
|
|
|
#include "xcode_utf_fixed.h"
|
2020-02-23 21:26:51 +01:00
|
|
|
|
2020-03-21 14:12:26 +01:00
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
//typedef uint16_t wchar_t;
|
|
|
|
typedef uint32_t char32_t;
|
|
|
|
typedef uint16_t char16_t;
|
|
|
|
#endif
|
2020-03-11 15:23:58 +01:00
|
|
|
|
|
|
|
|
2020-02-23 21:26:51 +01:00
|
|
|
#define IN
|
2020-03-21 14:12:26 +01:00
|
|
|
#define OUT
|
|
|
|
|
|
|
|
#define TRUE true
|
|
|
|
#define FALSE false
|
2020-02-23 21:26:51 +01:00
|
|
|
|
|
|
|
#define VA_LIST va_list
|
|
|
|
#define VA_START va_start
|
|
|
|
#define VA_END va_end
|
|
|
|
#define VA_ARG va_arg
|
2020-03-21 14:12:26 +01:00
|
|
|
#define VA_COPY va_copy
|
|
|
|
|
2020-03-04 14:37:39 +01:00
|
|
|
#define VOID void
|
|
|
|
#define EFIAPI
|
|
|
|
#define CONST const
|
2020-03-21 14:12:26 +01:00
|
|
|
#define EFI_STATUS INT64
|
|
|
|
|
|
|
|
typedef UINTN RETURN_STATUS;
|
|
|
|
#define MAX_BIT 0x8000000000000000ULL
|
|
|
|
#define ENCODE_ERROR(StatusCode) ((RETURN_STATUS)(MAX_BIT | (StatusCode)))
|
|
|
|
|
|
|
|
#define RETURN_OUT_OF_RESOURCES ENCODE_ERROR (9)
|
|
|
|
|
|
|
|
#define EFI_SUCCESS 0
|
|
|
|
#define EFI_OUT_OF_RESOURCES RETURN_OUT_OF_RESOURCES
|
|
|
|
|
|
|
|
#define OPTIONAL
|
|
|
|
#define ASSERT(x)
|
2020-04-24 08:36:29 +02:00
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define __typeof__(x) decltype(x)
|
|
|
|
#endif
|
2020-02-23 21:26:51 +01:00
|
|
|
|
|
|
|
void CpuDeadLoop(void);
|
2020-04-24 11:30:09 +02:00
|
|
|
//void DebugLog(INTN DebugMode, const char *FormatString, ...);
|
2020-03-21 14:12:26 +01:00
|
|
|
|
|
|
|
void PauseForKey(const wchar_t* msg);
|
|
|
|
|
2020-02-23 21:26:51 +01:00
|
|
|
|
|
|
|
void* AllocatePool(UINTN AllocationSize);
|
2020-03-21 14:12:26 +01:00
|
|
|
void* AllocateZeroPool(UINTN AllocationSize);
|
2020-02-23 21:26:51 +01:00
|
|
|
void* ReallocatePool(UINTN OldSize, UINTN NewSize, void* OldBuffer);
|
|
|
|
void FreePool(const void* Buffer);
|
2020-03-21 14:12:26 +01:00
|
|
|
|
|
|
|
void ZeroMem(void *Destination, UINTN Length);
|
|
|
|
void SetMem(void *Destination, UINTN Length, char c);
|
2020-02-23 21:26:51 +01:00
|
|
|
void CopyMem(void *Destination, void *Source, UINTN Length);
|
2020-03-21 14:12:26 +01:00
|
|
|
|
2020-04-05 14:25:39 +02:00
|
|
|
CHAR16* EfiStrDuplicate (IN CONST CHAR16 *Src);
|
|
|
|
CHAR16* StrStr (IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString);
|
|
|
|
|
2020-03-21 14:12:26 +01:00
|
|
|
|
|
|
|
//UINTN StrLen(const char16_t* String);
|
2020-03-11 15:23:58 +01:00
|
|
|
UINTN StrLen(const wchar_t* String);
|
2020-03-21 14:12:26 +01:00
|
|
|
//int StrCmp(const wchar_t* FirstString, const wchar_t* SecondString);
|
|
|
|
//int StrnCmp(const wchar_t* FirstString, const wchar_t* SecondString, UINTN Length);
|
|
|
|
//UINTN StrLen(const wchar_t* String);
|
|
|
|
//UINTN AsciiStrLen(const char* String);
|
|
|
|
//INTN AsciiStrCmp (const char *FirstString,const char *SecondString);
|
2020-02-24 14:07:59 +01:00
|
|
|
|
2020-02-23 21:26:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* Platform_h_h */
|