Skip to content

Commit

Permalink
V0.2.0
Browse files Browse the repository at this point in the history
Added support for gcc toolchain (EDK2 GCC5)
  • Loading branch information
psyq321 committed Jan 13, 2022
1 parent 63be6d5 commit 06301cb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
7 changes: 7 additions & 0 deletions PowerMonkeyApp/DelayX86.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@
#include "SaferAsmHdr.h"
#include <immintrin.h>

#if defined(__GNUC__) && !defined(__clang__)
#include <x86intrin.h>
#else

#pragma intrinsic(__rdtsc) // At this point, code will look so
#pragma intrinsic(_mm_pause) // fugly that writing it in pure SMM
// ASM would count as an improvement
#endif


/*******************************************************************************
* Globals that must be initialized
Expand Down
3 changes: 2 additions & 1 deletion PowerMonkeyApp/LowLevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
#include "LowLevel.h"
#include "MiniLog.h"


/*******************************************************************************
* Compiler Overrides
******************************************************************************/

#if defined(_MSC_VER)
#pragma warning( disable : 4090 )
#endif

/*******************************************************************************
* Globals
Expand Down
17 changes: 13 additions & 4 deletions PowerMonkeyApp/MiniLog.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
*
*******************************************************************************/

#pragma intrinsic(__rdtsc)
#pragma intrinsic(__cpuid)

/*******************************************************************************
* Includes
******************************************************************************/
Expand All @@ -39,6 +36,7 @@
#include <Library/DebugLib.h>
#include <Protocol/MpService.h>
#include <Library/SynchronizationLib.h>
#include <immintrin.h>

#include "CONFIGURATION.h"
#include "MiniLog.h"
Expand All @@ -47,7 +45,18 @@
#include "DelayX86.h"

extern PLATFORM* gPlatform;


/*******************************************************************************
*
******************************************************************************/

#if defined(__GNUC__) && !defined(__clang__)
#include <x86intrin.h>
#else
#pragma intrinsic(__rdtsc)
#endif


/*******************************************************************************
* Globals
******************************************************************************/
Expand Down
3 changes: 1 addition & 2 deletions PowerMonkeyApp/MpDispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,4 @@ EFI_STATUS EFIAPI RunOnAllProcessors(
}

return status;
}

}
2 changes: 1 addition & 1 deletion PowerMonkeyApp/PowerMonkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ VOID PrintBanner(VOID)
" | ____// _ \\ | | | | / _ ) / __)| || || | / _ \\ | _ \\ | | / )/ _ )| | | |\n"
" | | | |_| || | | |( (/ / | | | || || || |_| || | | || |< (( (/ / | |_| |\n"
" |_| \\___/ \\____| \\____)|_| |_||_||_| \\___/ |_| |_||_| \\_)\\____) \\__ |\n"
" Version 0.1.9 (____/\n"
" Version 0.2.0 (____/\n"
);

AsciiPrint(
Expand Down
4 changes: 3 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ This route is based on Alex Ionescu's excellent [VisualUEFI project](https://git

#### **Building - EDK2 route:**

NOTE: Only MSVC (VS2019) and CLANG (CLANGDWARF) toolchains are validated. For CLANGDWARF toolchain, you will need to add:
NOTE: Only MSVC (VS2019), gcc (GCC5) and Clang (CLANGDWARF) toolchains are validated.

For CLANGDWARF toolchain, you will need to add:

`DEBUG_CLANGDWARF_X64_DLINK_FLAGS =`**` -z notext ... `**<p>`RELEASE_CLANGDWARF_X64_DLINK_FLAGS =`**` -z notext ... `**<p>`NOOPT_CLANGDWARF_X64_DLINK_FLAGS =`**` -z notext ... `**

Expand Down

0 comments on commit 06301cb

Please sign in to comment.