kernel: Move serialization code out of headers. (#7312)

This commit is contained in:
Steveice10
2024-01-14 16:18:31 -08:00
committed by GitHub
parent 9c84721d84
commit a2d1c4a94c
52 changed files with 458 additions and 270 deletions

View File

@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <boost/serialization/string.hpp>
#include <boost/serialization/unordered_map.hpp>
#include "common/archives.h"
#include "common/assert.h"
#include "common/logging/log.h"
@ -97,6 +99,19 @@ void Timer::Signal(s64 cycles_late) {
}
}
template <class Archive>
void Timer::serialize(Archive& ar, const unsigned int) {
ar& boost::serialization::base_object<WaitObject>(*this);
ar& reset_type;
ar& initial_delay;
ar& interval_delay;
ar& signaled;
ar& name;
ar& callback_id;
ar& resource_limit;
}
SERIALIZE_IMPL(Timer)
/// The timer callback event, called when a timer is fired
void TimerManager::TimerCallback(u64 callback_id, s64 cycles_late) {
std::shared_ptr<Timer> timer = SharedFrom(timer_callback_table.at(callback_id));
@ -116,4 +131,11 @@ TimerManager::TimerManager(Core::Timing& timing) : timing(timing) {
});
}
template <class Archive>
void TimerManager::serialize(Archive& ar, const unsigned int) {
ar& next_timer_callback_id;
ar& timer_callback_table;
}
SERIALIZE_IMPL(TimerManager)
} // namespace Kernel