[CPU/Kernel] Cleanup and rework of how kernel exports are declared.

This commit is contained in:
gibbed
2018-11-20 11:01:25 -06:00
parent 613be1425e
commit 394105d359
31 changed files with 399 additions and 502 deletions

View File

@@ -531,15 +531,39 @@ xe::cpu::Export* RegisterExport(void (*fn)(Ps&...), const char* name,
using xe::cpu::ExportTag;
#define DECLARE_EXPORT(module_name, name, tags) \
#define DECLARE_EXPORT(module_name, name, category, tags) \
const auto EXPORT_##module_name##_##name = RegisterExport_##module_name( \
xe::kernel::shim::RegisterExport< \
xe::kernel::shim::KernelModuleId::module_name, ordinals::name>( \
&name, #name, tags));
&name, #name, \
tags | (static_cast<xe::cpu::ExportTag::type>( \
xe::cpu::ExportCategory::category) \
<< xe::cpu::ExportTag::CategoryShift)));
#define DECLARE_XAM_EXPORT(name, tags) DECLARE_EXPORT(xam, name, tags)
#define DECLARE_XBDM_EXPORT(name, tags) DECLARE_EXPORT(xbdm, name, tags)
#define DECLARE_XBOXKRNL_EXPORT(name, tags) DECLARE_EXPORT(xboxkrnl, name, tags)
#define DECLARE_XAM_EXPORT_(name, category, tags) \
DECLARE_EXPORT(xam, name, category, tags)
#define DECLARE_XAM_EXPORT1(name, category, tag) \
DECLARE_EXPORT(xam, name, category, xe::cpu::ExportTag::tag)
#define DECLARE_XAM_EXPORT2(name, category, tag1, tag2) \
DECLARE_EXPORT(xam, name, category, \
xe::cpu::ExportTag::tag1 | xe::cpu::ExportTag::tag2)
#define DECLARE_XBDM_EXPORT_(name, category, tags) \
DECLARE_EXPORT(xbdm, name, category, tags)
#define DECLARE_XBDM_EXPORT1(name, category, tag) \
DECLARE_EXPORT(xbdm, name, category, xe::cpu::ExportTag::tag)
#define DECLARE_XBOXKRNL_EXPORT_(name, category, tags) \
DECLARE_EXPORT(xboxkrnl, name, category, tags)
#define DECLARE_XBOXKRNL_EXPORT1(name, category, tag) \
DECLARE_EXPORT(xboxkrnl, name, category, xe::cpu::ExportTag::tag)
#define DECLARE_XBOXKRNL_EXPORT2(name, category, tag1, tag2) \
DECLARE_EXPORT(xboxkrnl, name, category, \
xe::cpu::ExportTag::tag1 | xe::cpu::ExportTag::tag2)
#define DECLARE_XBOXKRNL_EXPORT3(name, category, tag1, tag2, tag3) \
DECLARE_EXPORT(xboxkrnl, name, category, \
xe::cpu::ExportTag::tag1 | xe::cpu::ExportTag::tag2 | \
xe::cpu::ExportTag::tag3)
} // namespace kernel
} // namespace xe