Skip to content

Commit

Permalink
Update cpp_test, CloverX64 and create CloverMacOsApp.
Browse files Browse the repository at this point in the history
  • Loading branch information
jief committed Nov 20, 2023
1 parent f80e377 commit 9e2bc77
Show file tree
Hide file tree
Showing 234 changed files with 25,868 additions and 510 deletions.
2 changes: 1 addition & 1 deletion OpenCorePkg
1 change: 0 additions & 1 deletion PosixCompilation/DebugLibs/CloverEFI/MtrrLib.lib

This file was deleted.

1 change: 0 additions & 1 deletion PosixCompilation/DebugLibs/OC/OpenCore.lib

This file was deleted.

42 changes: 42 additions & 0 deletions PosixEFICompilation/CloverMock/Include/printf_lite-conf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// printf_lite.hpp
//
// Created by jief the 04 Apr 2019.
// Imported in CLover the 24 Feb 2020
//
#ifndef __PRINTF_LITE_CONF_H__
#define __PRINTF_LITE_CONF_H__

#include <stdarg.h>
#include <stddef.h> // for size_t
#include <stdint.h>
#include <inttypes.h>

#ifndef __cplusplus
#ifdef _MSC_VER
typedef uint16_t wchar_t;
#endif
typedef uint32_t char32_t;
typedef uint16_t char16_t;
#endif

#ifdef _MSC_VER
# define __attribute__(x)
#endif

#ifdef DEBUG
#define DEFINE_SECTIONS 0
#endif

#define PRINTF_LITE_DEFINE_PRINTF_SPRINTF 1

#define PRINTF_LITE_BUF_SIZE 255 // not more than 255
#define PRINTF_LITE_TIMESTAMP_SUPPORT 1
#define PRINTF_LITE_TIMESTAMP_CUSTOM_FUNCTION 1
#define PRINTF_EMIT_CR_SUPPORT 1

#define PRINTF_LITE_REPLACE_STANDARD_FUNCTION 1



#endif // __PRINTF_LITE_CONF_H__
207 changes: 207 additions & 0 deletions PosixEFICompilation/CloverMock/Library/MemLogLibDefault/MemLogLib.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
/** @file
Default instance of MemLogLib library for simple log services to memory buffer.
**/

#include <Efi.h>
#include <Library/printf_lite.h>

CHAR8*
GetTiming(VOID)
{
return "";
}



/**
Inits mem log.
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
**/
EFI_STATUS
EFIAPI
MemLogInit (
VOID
)
{
return EFI_SUCCESS;
}

/**
Prints a log message to memory buffer.
@param Timing TRUE to prepend timing to log.
@param DebugMode DebugMode will be passed to Callback function if it is set.
@param Format The format string for the debug message to print.
@param Marker VA_LIST with variable arguments for Format.
**/
VOID
EFIAPI
MemLogVA (
IN CONST BOOLEAN Timing,
IN CONST INTN DebugMode,
IN CONST CHAR8 *Format,
IN VA_LIST Marker
)
{
panic("not yet");
}

/**
Prints a log to message memory buffer.
If Format is NULL, then does nothing.
@param Timing TRUE to prepend timing to log.
@param DebugMode DebugMode will be passed to Callback function if it is set.
@param Format The format string for the debug message to print.
@param ... The variable argument list whose contents are accessed
based on the format string specified by Format.
**/
VOID
EFIAPI
MemLog (
IN CONST BOOLEAN Timing,
IN CONST INTN DebugMode,
IN CONST CHAR8 *Format,
...
)
{
panic("not yet");
}



/**
Returns pointer to MemLog buffer.
**/
CHAR8*
EFIAPI
GetMemLogBuffer (
VOID
)
{
panic("not yet");
}



/**
Returns the length of log (number of chars written) in mem buffer.
**/
UINTN
EFIAPI
GetMemLogLen (
VOID
)
{
panic("not yet");
}


/**
Sets callback that will be called when message is added to mem log.
**/
VOID
EFIAPI
SetMemLogCallback (
MEM_LOG_CALLBACK Callback
)
{
panic("not yet");
}


/**
Sets callback that will be called when message is added to mem log.
**/
MEM_LOG_CALLBACK
EFIAPI
GetMemLogCallback ()
{
panic("not yet");
}


/**
Returns TSC ticks per second.
**/
UINT64
EFIAPI
GetMemLogTscTicksPerSecond (VOID)
{
panic("not yet");
}



// Microsoft wants _fltused
#ifdef _MSC_VER
#ifdef __cplusplus
extern "C" {
#endif
int _fltused=0; // it should be a single underscore since the double one is the mangled name
#ifdef __cplusplus
}
#endif
#endif

//static int printfNewline = 1;
//static void transmitS8Printf(const char* buf, unsigned int nbchar, void* context)
//{
//}

//const char* printf_lite_get_timestamp()
//{
// return "";
//}

/**
Prints a log message to memory buffer.
@param Timing TRUE to prepend timing to log.
@param DebugMode DebugMode will be passed to Callback function if it is set.
@param Format The format string for the debug message to print.
@param Marker VA_LIST with variable arguments for Format.
**/
VOID
EFIAPI
MemLogfVA (
IN CONST BOOLEAN Timing,
IN CONST INTN DebugMode,
IN CONST CHAR8 *Format,
IN VA_LIST Marker
)
{
panic("not yet");
}


/**
Prints a log to message memory buffer.
If Format is NULL, then does nothing.
@param Timing TRUE to prepend timing to log.
@param DebugMode DebugMode will be passed to Callback function if it is set.
@param Format The format string for the debug message to print.
@param ... The variable argument list whose contents are accessed
based on the format string specified by Format.
**/
VOID
EFIAPI
MemLogf (
IN CONST BOOLEAN Timing,
IN CONST INTN DebugMode,
IN CONST CHAR8 *Format,
...
)
{
panic("not yet");
}

1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/CloverEFI/MtrrLib.lib
1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/Library/MemLogLib
1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/MdeModulePkg/UefiSortLib.lib
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/OC/OcBlitLib.lib
File renamed without changes.
1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/OC/OcDeviceMiscLib.lib
File renamed without changes.
1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/OC/OcFlexArrayLib.lib
1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/OC/OcMainLib.lib
File renamed without changes.
1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/OC/OcPeCoffExtLib.lib
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/OC/OcTypingLib.lib
1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/OC/OcVariableLib.lib
File renamed without changes.
1 change: 1 addition & 0 deletions PosixEFICompilation/DebugLibs/OC/OpenCore.lib
2 changes: 2 additions & 0 deletions PosixEFICompilation/ReadmeJief.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

wcslen=wcslen_fixed wcscmp=__wcscmp_is_disabled__ wcsncmp=wcsncmp_fixed wcsstr=wcsstr_fixed sprintf=__sprintf_is_disabled__
Loading

0 comments on commit 9e2bc77

Please sign in to comment.