Skip to content

Commit

Permalink
[mldr] Avoid Building/Using x86 Specific Logic On Non-x86 Devices
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousTommy committed Jan 11, 2024
1 parent 116973d commit 1aa5cdd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/startup/mldr/commpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

// Include commpage definitions
#define PRIVATE
#include <i386/cpu_capabilities.h>
#define KERNEL_PRIVATE 1
#include <machine/cpu_capabilities.h>

static const char* SIGNATURE32 = "commpage 32-bit";
static const char* SIGNATURE64 = "commpage 64-bit";
Expand Down Expand Up @@ -88,6 +89,7 @@ uint64_t get_cpu_caps(void)
{
uint64_t caps = 0;

#if defined(__i386__) || defined(__x86_64__)
{
union cpu_flags1 eax;
union cpu_flags2 ecx;
Expand Down Expand Up @@ -152,6 +154,9 @@ uint64_t get_cpu_caps(void)
if (ebx.sgx)
caps |= kHasSGX;
}
#else
#warning "Missing get_cpu_caps implementation"
#endif

return caps;
}
Expand Down

0 comments on commit 1aa5cdd

Please sign in to comment.