AsmGrader 0.0.0
Loading...
Searching...
No Matches
os.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <boost/endian.hpp>
4#include <boost/endian/detail/order.hpp>
5
6namespace asmgrader {
7
8// NOLINTNEXTLINE(readability-identifier-naming)
9enum class ProcessorKind { Aarch64, x86_64 };
10
11#if defined(__aarch64__)
12#define ASMGRADER_AARCH64
13constexpr auto SYSTEM_PROCESSOR = ProcessorKind::Aarch64;
14#elif defined(__x86_64__)
15#define ASMGRADER_X86_64
16constexpr auto SYSTEM_PROCESSOR = ProcessorKind::x86_64;
17#else
18#error "Unsupported system architecture!"
19#endif
20
21enum class EndiannessKind { Little, Big };
22
23constexpr auto ENDIANNESS =
24 (boost::endian::order::native == boost::endian::order::little ? EndiannessKind::Little : EndiannessKind::Big);
25
26} // namespace asmgrader
Definition asm_buffer.hpp:19
constexpr auto ENDIANNESS
Definition os.hpp:23
EndiannessKind
Definition os.hpp:21
ProcessorKind
Definition os.hpp:9