Refactor FourCC magic uses
- Use new fourcc_t type - Improves compiler compatibility by removing multi chars
This commit is contained in:
@@ -432,12 +432,12 @@ void Processor::LowerIrql(Irql old_value) {
|
||||
}
|
||||
|
||||
bool Processor::Save(ByteStream* stream) {
|
||||
stream->Write('PROC');
|
||||
stream->Write(kProcessorSaveSignature);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Processor::Restore(ByteStream* stream) {
|
||||
if (stream->Read<uint32_t>() != 'PROC') {
|
||||
if (stream->Read<uint32_t>() != kProcessorSaveSignature) {
|
||||
XELOGE("Processor::Restore - Invalid magic value!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ DECLARE_bool(debug);
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
|
||||
constexpr fourcc_t kProcessorSaveSignature = make_fourcc("PROC");
|
||||
|
||||
class Breakpoint;
|
||||
class StackWalker;
|
||||
class XexModule;
|
||||
|
||||
@@ -899,9 +899,9 @@ bool XexModule::Load(const std::string_view name, const std::string_view path,
|
||||
const void* xex_addr, size_t xex_length) {
|
||||
auto src_header = reinterpret_cast<const xex2_header*>(xex_addr);
|
||||
|
||||
if (src_header->magic == 'XEX1') {
|
||||
if (src_header->magic == kXEX1Signature) {
|
||||
xex_format_ = kFormatXex1;
|
||||
} else if (src_header->magic == 'XEX2') {
|
||||
} else if (src_header->magic == kXEX2Signature) {
|
||||
xex_format_ = kFormatXex2;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@@ -25,6 +25,10 @@ class KernelState;
|
||||
namespace xe {
|
||||
namespace cpu {
|
||||
|
||||
constexpr fourcc_t kXEX1Signature = make_fourcc("XEX1");
|
||||
constexpr fourcc_t kXEX2Signature = make_fourcc("XEX2");
|
||||
constexpr fourcc_t kElfSignature = make_fourcc(0x7F, 'E', 'L', 'F');
|
||||
|
||||
class Runtime;
|
||||
|
||||
class XexModule : public xe::cpu::Module {
|
||||
|
||||
Reference in New Issue
Block a user