Showing the changes to src/vm/sys/Sysmod.cpp (1 of 40 files). Show all
Unified · Split
| @@ -0,0 +1,478 @@ | |||
| 1 | // | ||
| 2 | // Dis VM | ||
| 3 | // File: Sysmod.cpp | ||
| 4 | // Author: arr | ||
| 5 | // | ||
| 6 | |||
| 7 | #include <array> | ||
| 8 | #include <chrono> | ||
| 9 | #include <thread> | ||
| 10 | #include <exceptions.h> | ||
| 11 | #include <utf8.h> | ||
| 12 | #include "Sysmod.h" | ||
| 13 | #include "sys_utils.h" | ||
| 14 | |||
| 15 | using namespace disvm; | ||
| 16 | using namespace disvm::runtime; | ||
| 17 | |||
| 18 | namespace | ||
| 19 | { | ||
| 20 | disvm::runtime::builtin::vm_runtab_t Sysmodtab[] = { | ||
| 21 | "announce",0xb7c4ac0,Sys_announce,40,2,{ 0x0,0x80, }, | ||
| 22 | "aprint",0x77442d46,Sys_aprint,0,0,{ 0 }, | ||
| 23 | "bind",0x66326d91,Sys_bind,48,2,{ 0x0,0xc0, }, | ||
| 24 | "byte2char",0x3d6094f9,Sys_byte2char,40,2,{ 0x0,0x80, }, | ||
| 25 | "char2byte",0x2ba5ab41,Sys_char2byte,48,2,{ 0x0,0x40, }, | ||
| 26 | "chdir",0xc6935858,Sys_chdir,40,2,{ 0x0,0x80, }, | ||
| 27 | "create",0x54db77d9,Sys_create,48,2,{ 0x0,0x80, }, | ||
| 28 | "dial",0x29e90174,Sys_dial,40,2,{ 0x0,0xc0, }, | ||
| 29 | "dirread",0x72210d71,Sys_dirread,40,2,{ 0x0,0x80, }, | ||
| 30 | "dup",0x6584767b,Sys_dup,40,0,{ 0 }, | ||
| 31 | "export",0x6fc6dc03,Sys_export,48,2,{ 0x0,0xc0, }, | ||
| 32 | "fauth",0x20ccc34b,Sys_fauth,40,2,{ 0x0,0xc0, }, | ||
| 33 | "fd2path",0x749c6042,Sys_fd2path,40,2,{ 0x0,0x80, }, | ||
| 34 | "fildes",0x1478f993,Sys_fildes,40,0,{ 0 }, | ||
| 35 | "file2chan",0x9f34d686,Sys_file2chan,40,2,{ 0x0,0xc0, }, | ||
| 36 | "fprint",0xf46486c8,Sys_fprint,0,0,{ 0 }, | ||
| 37 | "fstat",0xda4499c2,Sys_fstat,40,2,{ 0x0,0x80, }, | ||
| 38 | "fversion",0xfe9c0a06,Sys_fversion,48,2,{ 0x0,0xa0, }, | ||
| 39 | "fwstat",0x50a6c7e0,Sys_fwstat,104,2,{ 0x0,0xbc, }, | ||
| 40 | "iounit",0x5583b730,Sys_iounit,40,2,{ 0x0,0x80, }, | ||
| 41 | "listen",0xb97416e0,Sys_listen,48,2,{ 0x0,0xe0, }, | ||
| 42 | "millisec",0x616977e8,Sys_millisec,32,0,{ 0 }, | ||
| 43 | "mount",0x74c17b3a,Sys_mount,56,2,{ 0x0,0xe8, }, | ||
| 44 | "open",0x8f477f99,Sys_open,40,2,{ 0x0,0x80, }, | ||
| 45 | "pctl",0x5df27fb,Sys_pctl,40,2,{ 0x0,0x40, }, | ||
| 46 | "pipe",0x1f2c52ea,Sys_pipe,40,2,{ 0x0,0x80, }, | ||
| 47 | "pread",0x9d8aac6,Sys_pread,56,2,{ 0x0,0xc0, }, | ||
| 48 | "print",0xac849033,Sys_print,0,0,{ 0 }, | ||
| 49 | "pwrite",0x9d8aac6,Sys_pwrite,56,2,{ 0x0,0xc0, }, | ||
| 50 | "read",0x7cfef557,Sys_read,48,2,{ 0x0,0xc0, }, | ||
| 51 | "readn",0x7cfef557,Sys_readn,48,2,{ 0x0,0xc0, }, | ||
| 52 | "remove",0xc6935858,Sys_remove,40,2,{ 0x0,0x80, }, | ||
| 53 | "seek",0xaeccaddb,Sys_seek,56,2,{ 0x0,0x80, }, | ||
| 54 | "sleep",0xe67bf126,Sys_sleep,40,0,{ 0 }, | ||
| 55 | "sprint",0x4c0624b6,Sys_sprint,0,0,{ 0 }, | ||
| 56 | "stat",0x319328dd,Sys_stat,40,2,{ 0x0,0x80, }, | ||
| 57 | "stream",0xb9e8f9ea,Sys_stream,48,2,{ 0x0,0xc0, }, | ||
| 58 | "tokenize",0x57338f20,Sys_tokenize,40,2,{ 0x0,0xc0, }, | ||
| 59 | "unmount",0x21e337e3,Sys_unmount,40,2,{ 0x0,0xc0, }, | ||
| 60 | "utfbytes",0x1d4a1f4,Sys_utfbytes,40,2,{ 0x0,0x80, }, | ||
| 61 | "werrstr",0xc6935858,Sys_werrstr,40,2,{ 0x0,0x80, }, | ||
| 62 | "write",0x7cfef557,Sys_write,48,2,{ 0x0,0xc0, }, | ||
| 63 | "wstat",0x56b02096,Sys_wstat,104,2,{ 0x0,0xbc, }, | ||
| 64 | 0 | ||
| 65 | }; | ||
| 66 | |||
| 67 | const word_t Sysmodlen = 43; | ||
| 68 | } | ||
| 69 | |||
| 70 | std::shared_ptr<const type_descriptor_t> T_Qid; | ||
| 71 | std::shared_ptr<const type_descriptor_t> T_Dir; | ||
| 72 | std::shared_ptr<const type_descriptor_t> T_FD; | ||
| 73 | std::shared_ptr<const type_descriptor_t> T_Connection; | ||
| 74 | std::shared_ptr<const type_descriptor_t> T_FileIO; | ||
| 75 | |||
| 76 | void | ||
| 77 | Sysmodinit(void) | ||
| 78 | { | ||
| 79 | builtin::register_module_exports(Sys_PATH, Sysmodlen, Sysmodtab); | ||
| 80 | T_Qid = type_descriptor_t::create(sizeof(Sys_Qid), sizeof(Sys_Qid_map), Sys_Qid_map); | ||
| 81 | T_Dir = type_descriptor_t::create(sizeof(Sys_Dir), sizeof(Sys_Dir_map), Sys_Dir_map); | ||
| 82 | T_FD = type_descriptor_t::create(sizeof(Sys_FD), sizeof(Sys_FD_map), Sys_FD_map); | ||
| 83 | T_Connection = type_descriptor_t::create(sizeof(Sys_Connection), sizeof(Sys_Connection_map), Sys_Connection_map); | ||
| 84 | T_FileIO = type_descriptor_t::create(sizeof(Sys_FileIO), sizeof(Sys_FileIO_map), Sys_FileIO_map); | ||
| 85 | } | ||
| 86 | |||
| 87 | void | ||
| 88 | Sys_announce(vm_registers_t &r, vm_t &vm) | ||
| 89 | { | ||
| 90 | auto &fp = r.stack.peek_frame()->base<F_Sys_announce>(); | ||
| 91 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 92 | } | ||
| 93 | |||
| 94 | void | ||
| 95 | Sys_aprint(vm_registers_t &r, vm_t &vm) | ||
| 96 | { | ||
| 97 | auto &fp = r.stack.peek_frame()->base<F_Sys_aprint>(); | ||
| 98 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 99 | } | ||
| 100 | |||
| 101 | void | ||
| 102 | Sys_bind(vm_registers_t &r, vm_t &vm) | ||
| 103 | { | ||
| 104 | auto &fp = r.stack.peek_frame()->base<F_Sys_bind>(); | ||
| 105 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 106 | } | ||
| 107 | |||
| 108 | void | ||
| 109 | Sys_byte2char(vm_registers_t &r, vm_t &vm) | ||
| 110 | { | ||
| 111 | auto &fp = r.stack.peek_frame()->base<F_Sys_byte2char>(); | ||
| 112 | |||
| 113 | auto buffer = vm_alloc_t::from_allocation<vm_array_t>(fp.buf); | ||
| 114 | assert(buffer->get_element_type()->size_in_bytes == intrinsic_type_desc::type<byte_t>()->size_in_bytes); | ||
| 115 | |||
| 116 | const auto n = fp.n; | ||
| 117 | if (buffer == nullptr || n >= buffer->get_length()) | ||
| 118 | throw out_of_range_memory{}; | ||
| 119 | |||
| 120 | // Initialize for failure. | ||
| 121 | fp.ret->t0 = Sys_UTFerror; | ||
| 122 | fp.ret->t1 = 0; | ||
| 123 | fp.ret->t2 = 0; | ||
| 124 | |||
| 125 | auto state = utf8::decode_state::accept; | ||
| 126 | auto result = rune_t{}; | ||
| 127 | const auto buffer_len = buffer->get_length(); | ||
| 128 | for (auto i = n; i < buffer_len; ++i) | ||
| 129 | { | ||
| 130 | auto b = buffer->at<byte_t>(i); | ||
| 131 | state = utf8::decode_step(state, result, b); | ||
| 132 | if (state == utf8::decode_state::accept) | ||
| 133 | { | ||
| 134 | fp.ret->t0 = result; | ||
| 135 | fp.ret->t1 = (i - n) + 1; // Number of bytes consumed | ||
| 136 | fp.ret->t2 = 1; | ||
| 137 | return; | ||
| 138 | } | ||
| 139 | else if (state == utf8::decode_state::reject) | ||
| 140 | { | ||
| 141 | fp.ret->t1 = 1; | ||
| 142 | return; | ||
| 143 | } | ||
| 144 | } | ||
| 145 | } | ||
| 146 | |||
| 147 | void | ||
| 148 | Sys_char2byte(vm_registers_t &r, vm_t &vm) | ||
| 149 | { | ||
| 150 | auto &fp = r.stack.peek_frame()->base<F_Sys_char2byte>(); | ||
| 151 | |||
| 152 | auto buffer = vm_alloc_t::from_allocation<vm_array_t>(fp.buf); | ||
| 153 | assert(buffer->get_element_type()->size_in_bytes == intrinsic_type_desc::type<byte_t>()->size_in_bytes); | ||
| 154 | |||
| 155 | const auto n = fp.n; | ||
| 156 | if (buffer == nullptr || n >= buffer->get_length()) | ||
| 157 | throw out_of_range_memory{}; | ||
| 158 | |||
| 159 | const auto rune = static_cast<rune_t>(fp.c); | ||
| 160 | |||
| 161 | static_assert(Sys_UTFmax == sizeof(rune_t), "UTF max should be same size as rune"); | ||
| 162 | uint8_t buffer_local[sizeof(Sys_UTFmax)]; | ||
| 163 | auto begin = buffer_local; | ||
| 164 | |||
| 165 | auto end = utf8::encode(rune, begin); | ||
| 166 | const auto count = static_cast<word_t>(end - begin); | ||
| 167 | |||
| 168 | // Initialize for failure. | ||
| 169 | *fp.ret = 0; | ||
| 170 | |||
| 171 | const auto final_index = n + count; | ||
| 172 | if (final_index > buffer->get_length()) | ||
| 173 | return; | ||
| 174 | |||
| 175 | // Insert the bytes into the buffer | ||
| 176 | for (auto i = word_t{ n }; i < final_index; ++i) | ||
| 177 | { | ||
| 178 | buffer->at<uint8_t>(i) = *begin; | ||
| 179 | begin++; | ||
| 180 | } | ||
| 181 | |||
| 182 | *fp.ret = count; | ||
| 183 | } | ||
| 184 | |||
| 185 | void | ||
| 186 | Sys_chdir(vm_registers_t &r, vm_t &vm) | ||
| 187 | { | ||
| 188 | auto &fp = r.stack.peek_frame()->base<F_Sys_chdir>(); | ||
| 189 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 190 | } | ||
| 191 | |||
| 192 | void | ||
| 193 | Sys_create(vm_registers_t &r, vm_t &vm) | ||
| 194 | { | ||
| 195 | auto &fp = r.stack.peek_frame()->base<F_Sys_create>(); | ||
| 196 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 197 | } | ||
| 198 | |||
| 199 | void | ||
| 200 | Sys_dial(vm_registers_t &r, vm_t &vm) | ||
| 201 | { | ||
| 202 | auto &fp = r.stack.peek_frame()->base<F_Sys_dial>(); | ||
| 203 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 204 | } | ||
| 205 | |||
| 206 | void | ||
| 207 | Sys_dirread(vm_registers_t &r, vm_t &vm) | ||
| 208 | { | ||
| 209 | auto &fp = r.stack.peek_frame()->base<F_Sys_dirread>(); | ||
| 210 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 211 | } | ||
| 212 | |||
| 213 | void | ||
| 214 | Sys_dup(vm_registers_t &r, vm_t &vm) | ||
| 215 | { | ||
| 216 | auto &fp = r.stack.peek_frame()->base<F_Sys_dup>(); | ||
| 217 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 218 | } | ||
| 219 | |||
| 220 | void | ||
| 221 | Sys_export(vm_registers_t &r, vm_t &vm) | ||
| 222 | { | ||
| 223 | auto &fp = r.stack.peek_frame()->base<F_Sys_export>(); | ||
| 224 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 225 | } | ||
| 226 | |||
| 227 | void | ||
| 228 | Sys_fauth(vm_registers_t &r, vm_t &vm) | ||
| 229 | { | ||
| 230 | auto &fp = r.stack.peek_frame()->base<F_Sys_fauth>(); | ||
| 231 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 232 | } | ||
| 233 | |||
| 234 | void | ||
| 235 | Sys_fd2path(vm_registers_t &r, vm_t &vm) | ||
| 236 | { | ||
| 237 | auto &fp = r.stack.peek_frame()->base<F_Sys_fd2path>(); | ||
| 238 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 239 | } | ||
| 240 | |||
| 241 | void | ||
| 242 | Sys_fildes(vm_registers_t &r, vm_t &vm) | ||
| 243 | { | ||
| 244 | auto &fp = r.stack.peek_frame()->base<F_Sys_fildes>(); | ||
| 245 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 246 | } | ||
| 247 | |||
| 248 | void | ||
| 249 | Sys_file2chan(vm_registers_t &r, vm_t &vm) | ||
| 250 | { | ||
| 251 | auto &fp = r.stack.peek_frame()->base<F_Sys_file2chan>(); | ||
| 252 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 253 | } | ||
| 254 | |||
| 255 | void | ||
| 256 | Sys_fprint(vm_registers_t &r, vm_t &vm) | ||
| 257 | { | ||
| 258 | auto &fp = r.stack.peek_frame()->base<F_Sys_fprint>(); | ||
| 259 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 260 | } | ||
| 261 | |||
| 262 | void | ||
| 263 | Sys_fstat(vm_registers_t &r, vm_t &vm) | ||
| 264 | { | ||
| 265 | auto &fp = r.stack.peek_frame()->base<F_Sys_fstat>(); | ||
| 266 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 267 | } | ||
| 268 | |||
| 269 | void | ||
| 270 | Sys_fversion(vm_registers_t &r, vm_t &vm) | ||
| 271 | { | ||
| 272 | auto &fp = r.stack.peek_frame()->base<F_Sys_fversion>(); | ||
| 273 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 274 | } | ||
| 275 | |||
| 276 | void | ||
| 277 | Sys_fwstat(vm_registers_t &r, vm_t &vm) | ||
| 278 | { | ||
| 279 | auto &fp = r.stack.peek_frame()->base<F_Sys_fwstat>(); | ||
| 280 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 281 | } | ||
| 282 | |||
| 283 | void | ||
| 284 | Sys_iounit(vm_registers_t &r, vm_t &vm) | ||
| 285 | { | ||
| 286 | auto &fp = r.stack.peek_frame()->base<F_Sys_iounit>(); | ||
| 287 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 288 | } | ||
| 289 | |||
| 290 | void | ||
| 291 | Sys_listen(vm_registers_t &r, vm_t &vm) | ||
| 292 | { | ||
| 293 | auto &fp = r.stack.peek_frame()->base<F_Sys_listen>(); | ||
| 294 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 295 | } | ||
| 296 | |||
| 297 | void | ||
| 298 | Sys_millisec(vm_registers_t &r, vm_t &vm) | ||
| 299 | { | ||
| 300 | const auto current_time = std::chrono::steady_clock::now(); | ||
| 301 | const auto current_time_in_ms = std::chrono::duration_cast<std::chrono::milliseconds>(current_time.time_since_epoch()); | ||
| 302 | |||
| 303 | auto &fp = r.stack.peek_frame()->base<F_Sys_millisec>(); | ||
| 304 | *fp.ret = static_cast<word_t>(current_time_in_ms.count()); | ||
| 305 | } | ||
| 306 | |||
| 307 | void | ||
| 308 | Sys_mount(vm_registers_t &r, vm_t &vm) | ||
| 309 | { | ||
| 310 | auto &fp = r.stack.peek_frame()->base<F_Sys_mount>(); | ||
| 311 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 312 | } | ||
| 313 | |||
| 314 | void | ||
| 315 | Sys_open(vm_registers_t &r, vm_t &vm) | ||
| 316 | { | ||
| 317 | auto &fp = r.stack.peek_frame()->base<F_Sys_open>(); | ||
| 318 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 319 | } | ||
| 320 | |||
| 321 | void | ||
| 322 | Sys_pctl(vm_registers_t &r, vm_t &vm) | ||
| 323 | { | ||
| 324 | auto &fp = r.stack.peek_frame()->base<F_Sys_pctl>(); | ||
| 325 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 326 | } | ||
| 327 | |||
| 328 | void | ||
| 329 | Sys_pipe(vm_registers_t &r, vm_t &vm) | ||
| 330 | { | ||
| 331 | auto &fp = r.stack.peek_frame()->base<F_Sys_pipe>(); | ||
| 332 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 333 | } | ||
| 334 | |||
| 335 | void | ||
| 336 | Sys_pread(vm_registers_t &r, vm_t &vm) | ||
| 337 | { | ||
| 338 | auto &fp = r.stack.peek_frame()->base<F_Sys_pread>(); | ||
| 339 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 340 | } | ||
| 341 | |||
| 342 | void | ||
| 343 | Sys_print(vm_registers_t &r, vm_t &vm) | ||
| 344 | { | ||
| 345 | auto &fp = r.stack.peek_frame()->base<F_Sys_print>(); | ||
| 346 | auto str = vm_alloc_t::from_allocation<vm_string_t>(fp.s); | ||
| 347 | |||
| 348 | if (str == nullptr) | ||
| 349 | throw dereference_nil{ "Print string" }; | ||
| 350 | |||
| 351 | auto static_buffer = std::array<char, 1024>{}; | ||
| 352 | auto written = printf_to_buffer(*str, &fp.vargs, static_buffer.size(), static_buffer.data()); | ||
| 353 | if (written >= 0) | ||
| 354 | { | ||
| 355 | std::printf(static_buffer.data()); | ||
| 356 | } | ||
| 357 | else | ||
| 358 | { | ||
| 359 | auto dynamic_buffer = std::vector<char>(static_buffer.size() * 2); | ||
| 360 | written = printf_to_dynamic_buffer(*str, &fp.vargs, dynamic_buffer); | ||
| 361 | std::printf(dynamic_buffer.data()); | ||
| 362 | } | ||
| 363 | |||
| 364 | *fp.ret = written; | ||
| 365 | } | ||
| 366 | |||
| 367 | void | ||
| 368 | Sys_pwrite(vm_registers_t &r, vm_t &vm) | ||
| 369 | { | ||
| 370 | auto &fp = r.stack.peek_frame()->base<F_Sys_pwrite>(); | ||
| 371 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 372 | } | ||
| 373 | |||
| 374 | void | ||
| 375 | Sys_read(vm_registers_t &r, vm_t &vm) | ||
| 376 | { | ||
| 377 | auto &fp = r.stack.peek_frame()->base<F_Sys_read>(); | ||
| 378 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 379 | } | ||
| 380 | |||
| 381 | void | ||
| 382 | Sys_readn(vm_registers_t &r, vm_t &vm) | ||
| 383 | { | ||
| 384 | auto &fp = r.stack.peek_frame()->base<F_Sys_readn>(); | ||
| 385 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 386 | } | ||
| 387 | |||
| 388 | void | ||
| 389 | Sys_remove(vm_registers_t &r, vm_t &vm) | ||
| 390 | { | ||
| 391 | auto &fp = r.stack.peek_frame()->base<F_Sys_remove>(); | ||
| 392 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 393 | } | ||
| 394 | |||
| 395 | void | ||
| 396 | Sys_seek(vm_registers_t &r, vm_t &vm) | ||
| 397 | { | ||
| 398 | auto &fp = r.stack.peek_frame()->base<F_Sys_seek>(); | ||
| 399 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 400 | } | ||
| 401 | |||
| 402 | void | ||
| 403 | Sys_sleep(vm_registers_t &r, vm_t &vm) | ||
| 404 | { | ||
| 405 | auto &fp = r.stack.peek_frame()->base<F_Sys_sleep>(); | ||
| 406 | |||
| 407 | const auto period_ms = fp.period; | ||
| 408 | |||
| 409 | // [TODO] Thread should yield to another according to the sleep() specification. | ||
| 410 | r.current_thread_state = vm_thread_state_t::release; | ||
| 411 | std::this_thread::sleep_for(std::chrono::milliseconds(period_ms)); | ||
| 412 | r.current_thread_state = vm_thread_state_t::ready; | ||
| 413 | |||
| 414 | *fp.ret = 0; | ||
| 415 | } | ||
| 416 | |||
| 417 | void | ||
| 418 | Sys_sprint(vm_registers_t &r, vm_t &vm) | ||
| 419 | { | ||
| 420 | auto &fp = r.stack.peek_frame()->base<F_Sys_sprint>(); | ||
| 421 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 422 | } | ||
| 423 | |||
| 424 | void | ||
| 425 | Sys_stat(vm_registers_t &r, vm_t &vm) | ||
| 426 | { | ||
| 427 | auto &fp = r.stack.peek_frame()->base<F_Sys_stat>(); | ||
| 428 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 429 | } | ||
| 430 | |||
| 431 | void | ||
| 432 | Sys_stream(vm_registers_t &r, vm_t &vm) | ||
| 433 | { | ||
| 434 | auto &fp = r.stack.peek_frame()->base<F_Sys_stream>(); | ||
| 435 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 436 | } | ||
| 437 | |||
| 438 | void | ||
| 439 | Sys_tokenize(vm_registers_t &r, vm_t &vm) | ||
| 440 | { | ||
| 441 | auto &fp = r.stack.peek_frame()->base<F_Sys_tokenize>(); | ||
| 442 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 443 | } | ||
| 444 | |||
| 445 | void | ||
| 446 | Sys_unmount(vm_registers_t &r, vm_t &vm) | ||
| 447 | { | ||
| 448 | auto &fp = r.stack.peek_frame()->base<F_Sys_unmount>(); | ||
| 449 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 450 | } | ||
| 451 | |||
| 452 | void | ||
| 453 | Sys_utfbytes(vm_registers_t &r, vm_t &vm) | ||
| 454 | { | ||
| 455 | auto &fp = r.stack.peek_frame()->base<F_Sys_utfbytes>(); | ||
| 456 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 457 | } | ||
| 458 | |||
| 459 | void | ||
| 460 | Sys_werrstr(vm_registers_t &r, vm_t &vm) | ||
| 461 | { | ||
| 462 | auto &fp = r.stack.peek_frame()->base<F_Sys_werrstr>(); | ||
| 463 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 464 | } | ||
| 465 | |||
| 466 | void | ||
| 467 | Sys_write(vm_registers_t &r, vm_t &vm) | ||
| 468 | { | ||
| 469 | auto &fp = r.stack.peek_frame()->base<F_Sys_write>(); | ||
| 470 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 471 | } | ||
| 472 | |||
| 473 | void | ||
| 474 | Sys_wstat(vm_registers_t &r, vm_t &vm) | ||
| 475 | { | ||
| 476 | auto &fp = r.stack.peek_frame()->base<F_Sys_wstat>(); | ||
| 477 | throw vm_system_exception{ "Instruction not implemented" }; | ||
| 478 | } | ||