about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-09-28 11:58:19 -0700
committerKartik Agaram <vc@akkartik.com>2018-09-29 10:18:51 -0700
commitb396b7b4d2892920d81082d9852ddc99d1ee797c (patch)
treeb8e0de9f4bd4c4bfc9ab00f7cd94cf16b06f32dc /subx
parent7e274cf2be2afcd54b187a3184b5aefe79ebf0c9 (diff)
downloadmu-b396b7b4d2892920d81082d9852ddc99d1ee797c.tar.gz
4611
Diffstat (limited to 'subx')
-rw-r--r--subx/010---vm.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/subx/010---vm.cc b/subx/010---vm.cc
index 33ebe51a..92cf7d14 100644
--- a/subx/010---vm.cc
+++ b/subx/010---vm.cc
@@ -120,15 +120,16 @@ inline uint8_t* mem_addr_u8(uint32_t addr) {
 inline int8_t* mem_addr_i8(uint32_t addr) {
   return reinterpret_cast<int8_t*>(&Mem.at(addr-Mem_offset));
 }
-inline char* mem_addr_string(uint32_t addr) {
-  return reinterpret_cast<char*>(&Mem.at(addr-Mem_offset));
-}
 inline uint32_t* mem_addr_u32(uint32_t addr) {
   return reinterpret_cast<uint32_t*>(&Mem.at(addr-Mem_offset));
 }
 inline int32_t* mem_addr_i32(uint32_t addr) {
   return reinterpret_cast<int32_t*>(&Mem.at(addr-Mem_offset));
 }
+// helper for some syscalls. But read-only.
+inline const char* mem_addr_string(uint32_t addr) {
+  return reinterpret_cast<const char*>(&Mem.at(addr-Mem_offset));
+}
 
 inline void write_mem_u8(uint32_t addr, uint8_t val) {
   Mem.at(addr-Mem_offset) = val;