44#include " BuildVersion.h"
55#include " Common.h"
66#include " Host.h"
7- #include " Memory.h"
87#include " Elfheader.h"
98#include " SaveState.h"
109#include " PINE.h"
1110#include " VMManager.h"
11+ #include " vtlb.h"
1212#include " common/Error.h"
1313#include " common/Threading.h"
1414
@@ -538,7 +538,7 @@ PINEServer::IPCBuffer PINEServer::ParseCommand(std::span<u8> buf, std::vector<u8
538538 if (!SafetyChecks (buf_cnt, 4 , ret_cnt, 1 , buf_size)) [[unlikely]]
539539 goto error;
540540 const u32 a = FromSpan<u32 >(buf, buf_cnt);
541- const u8 res = memRead8 (a);
541+ const u8 res = vtlb_ramRead< mem8_t > (a);
542542 ToResultVector (ret_buffer, res, ret_cnt);
543543 ret_cnt += 1 ;
544544 buf_cnt += 4 ;
@@ -551,7 +551,7 @@ PINEServer::IPCBuffer PINEServer::ParseCommand(std::span<u8> buf, std::vector<u8
551551 if (!SafetyChecks (buf_cnt, 4 , ret_cnt, 2 , buf_size)) [[unlikely]]
552552 goto error;
553553 const u32 a = FromSpan<u32 >(buf, buf_cnt);
554- const u16 res = memRead16 (a);
554+ const u16 res = vtlb_ramRead< mem16_t > (a);
555555 ToResultVector (ret_buffer, res, ret_cnt);
556556 ret_cnt += 2 ;
557557 buf_cnt += 4 ;
@@ -564,7 +564,7 @@ PINEServer::IPCBuffer PINEServer::ParseCommand(std::span<u8> buf, std::vector<u8
564564 if (!SafetyChecks (buf_cnt, 4 , ret_cnt, 4 , buf_size)) [[unlikely]]
565565 goto error;
566566 const u32 a = FromSpan<u32 >(buf, buf_cnt);
567- const u32 res = memRead32 (a);
567+ const u32 res = vtlb_ramRead< mem32_t > (a);
568568 ToResultVector (ret_buffer, res, ret_cnt);
569569 ret_cnt += 4 ;
570570 buf_cnt += 4 ;
@@ -577,7 +577,7 @@ PINEServer::IPCBuffer PINEServer::ParseCommand(std::span<u8> buf, std::vector<u8
577577 if (!SafetyChecks (buf_cnt, 4 , ret_cnt, 8 , buf_size)) [[unlikely]]
578578 goto error;
579579 const u32 a = FromSpan<u32 >(buf, buf_cnt);
580- const u64 res = memRead64 (a);
580+ const u64 res = vtlb_ramRead< mem64_t > (a);
581581 ToResultVector (ret_buffer, res, ret_cnt);
582582 ret_cnt += 8 ;
583583 buf_cnt += 4 ;
@@ -590,7 +590,7 @@ PINEServer::IPCBuffer PINEServer::ParseCommand(std::span<u8> buf, std::vector<u8
590590 if (!SafetyChecks (buf_cnt, 1 + 4 , ret_cnt, 0 , buf_size)) [[unlikely]]
591591 goto error;
592592 const u32 a = FromSpan<u32 >(buf, buf_cnt);
593- memWrite8 (a, FromSpan<u8 >(buf, buf_cnt + 4 ));
593+ vtlb_ramWrite< mem8_t > (a, FromSpan<u8 >(buf, buf_cnt + 4 ));
594594 buf_cnt += 5 ;
595595 break ;
596596 }
@@ -601,7 +601,7 @@ PINEServer::IPCBuffer PINEServer::ParseCommand(std::span<u8> buf, std::vector<u8
601601 if (!SafetyChecks (buf_cnt, 2 + 4 , ret_cnt, 0 , buf_size)) [[unlikely]]
602602 goto error;
603603 const u32 a = FromSpan<u32 >(buf, buf_cnt);
604- memWrite16 (a, FromSpan<u16 >(buf, buf_cnt + 4 ));
604+ vtlb_ramWrite< mem16_t > (a, FromSpan<u16 >(buf, buf_cnt + 4 ));
605605 buf_cnt += 6 ;
606606 break ;
607607 }
@@ -612,7 +612,7 @@ PINEServer::IPCBuffer PINEServer::ParseCommand(std::span<u8> buf, std::vector<u8
612612 if (!SafetyChecks (buf_cnt, 4 + 4 , ret_cnt, 0 , buf_size)) [[unlikely]]
613613 goto error;
614614 const u32 a = FromSpan<u32 >(buf, buf_cnt);
615- memWrite32 (a, FromSpan<u32 >(buf, buf_cnt + 4 ));
615+ vtlb_ramWrite< mem32_t > (a, FromSpan<u32 >(buf, buf_cnt + 4 ));
616616 buf_cnt += 8 ;
617617 break ;
618618 }
@@ -623,7 +623,7 @@ PINEServer::IPCBuffer PINEServer::ParseCommand(std::span<u8> buf, std::vector<u8
623623 if (!SafetyChecks (buf_cnt, 8 + 4 , ret_cnt, 0 , buf_size)) [[unlikely]]
624624 goto error;
625625 const u32 a = FromSpan<u32 >(buf, buf_cnt);
626- memWrite64 (a, FromSpan<u64 >(buf, buf_cnt + 4 ));
626+ vtlb_ramWrite< mem64_t > (a, FromSpan<u64 >(buf, buf_cnt + 4 ));
627627 buf_cnt += 12 ;
628628 break ;
629629 }
0 commit comments