Added DSP service serialization

This commit is contained in:
Hamish Milne 2019-12-26 18:10:38 +00:00 committed by zhupengfei
parent 30fe2bfe38
commit 452ae2e371
3 changed files with 34 additions and 1 deletions

2
TODO
View file

@ -75,7 +75,7 @@
Also needs archive backend..
✔ CSND @started(19-12-26 17:51) @done(19-12-26 17:56) @lasted(5m30s)
✔ DLP @done(19-12-26 18:02)
☐ DSP
✔ DSP @done(19-12-26 18:10)
☐ ERR
☐ FRD
☐ FS

View file

@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include "audio_core/audio_types.h"
#include "common/archives.h"
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/core.h"
@ -13,6 +14,19 @@
using DspPipe = AudioCore::DspPipe;
using InterruptType = Service::DSP::DSP_DSP::InterruptType;
SERIALIZE_EXPORT_IMPL(Service::DSP::DSP_DSP)
namespace boost::serialization {
template <class Archive>
void load_construct_data(Archive& ar, Service::DSP::DSP_DSP* t, const unsigned int)
{
::new(t)Service::DSP::DSP_DSP(Core::Global<Core::System>());
}
template
void load_construct_data<iarchive>(iarchive& ar, Service::DSP::DSP_DSP* t, const unsigned int);
}
namespace AudioCore {
enum class DspPipe;
}

View file

@ -264,8 +264,27 @@ private:
/// Each DSP pipe has an associated interrupt
std::array<std::shared_ptr<Kernel::Event>, AudioCore::num_dsp_pipe> pipes = {{}};
template <class Archive>
void serialize(Archive& ar, const unsigned int)
{
ar & boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
ar & semaphore_event;
ar & preset_semaphore;
ar & interrupt_zero;
ar & interrupt_one;
ar & pipes;
}
friend class boost::serialization::access;
};
void InstallInterfaces(Core::System& system);
} // namespace Service::DSP
BOOST_CLASS_EXPORT_KEY(Service::DSP::DSP_DSP)
namespace boost::serialization {
template <class Archive>
void load_construct_data(Archive& ar, Service::DSP::DSP_DSP* t, const unsigned int);
}