Service/SOC: convert to ServiceFramework

This commit is contained in:
wwylele 2018-07-16 20:39:48 +03:00
parent 3799b16207
commit aa02c50a2e
4 changed files with 300 additions and 307 deletions

View file

@ -113,6 +113,11 @@ inline void RequestBuilder::Push(u32 value) {
cmdbuf[index++] = value;
}
template <>
inline void RequestBuilder::Push(s32 value) {
cmdbuf[index++] = static_cast<u32>(value);
}
template <typename T>
void RequestBuilder::PushRaw(const T& value) {
static_assert(std::is_trivially_copyable<T>(), "Raw types should be trivially copyable");
@ -330,6 +335,12 @@ inline u64 RequestParser::Pop() {
return msw << 32 | lsw;
}
template <>
inline s32 RequestParser::Pop() {
s32_le data = PopRaw<s32_le>();
return data;
}
template <>
inline bool RequestParser::Pop() {
return Pop<u8>() != 0;