Showing the changes to src/vm/sys/Sysmod.cpp (1 of 1 file). Show all
Unified · Split
| @@ -305,21 +305,21 @@ void · 304 unmodified lines | ||
| 305 | 305 | Sys_announce(vm_registers_t &r, vm_t &vm) |
| 306 | 306 | { |
| 307 | 307 | auto &fp = r.stack.peek_frame()->base<F_Sys_announce>(); |
| 308 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 308 | + throw vm_system_exception{ "Function not implemented" }; | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | void |
| 312 | 312 | Sys_aprint(vm_registers_t &r, vm_t &vm) |
| 313 | 313 | { |
| 314 | 314 | auto &fp = r.stack.peek_frame()->base<F_Sys_aprint>(); |
| 315 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 315 | + throw vm_system_exception{ "Function not implemented" }; | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | void |
| 319 | 319 | Sys_bind(vm_registers_t &r, vm_t &vm) |
| 320 | 320 | { |
| 321 | 321 | auto &fp = r.stack.peek_frame()->base<F_Sys_bind>(); |
| 322 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 322 | + throw vm_system_exception{ "Function not implemented" }; | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | void |
| @@ -403,7 +403,7 @@ void · 77 unmodified lines | ||
| 403 | 403 | Sys_chdir(vm_registers_t &r, vm_t &vm) |
| 404 | 404 | { |
| 405 | 405 | auto &fp = r.stack.peek_frame()->base<F_Sys_chdir>(); |
| 406 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 406 | + throw vm_system_exception{ "Function not implemented" }; | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | void |
| @@ -445,49 +445,48 @@ Sys_create(vm_registers_t &r, vm_t &vm) · 35 unmodified lines | ||
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | *fp.ret = fd_alloc->get_allocation(); |
| 448 | − fd_alloc->add_ref(); | |
| 449 | 448 | } |
| 450 | 449 | |
| 451 | 450 | void |
| 452 | 451 | Sys_dial(vm_registers_t &r, vm_t &vm) |
| 453 | 452 | { |
| 454 | 453 | auto &fp = r.stack.peek_frame()->base<F_Sys_dial>(); |
| 455 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 454 | + throw vm_system_exception{ "Function not implemented" }; | |
| 456 | 455 | } |
| 457 | 456 | |
| 458 | 457 | void |
| 459 | 458 | Sys_dirread(vm_registers_t &r, vm_t &vm) |
| 460 | 459 | { |
| 461 | 460 | auto &fp = r.stack.peek_frame()->base<F_Sys_dirread>(); |
| 462 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 461 | + throw vm_system_exception{ "Function not implemented" }; | |
| 463 | 462 | } |
| 464 | 463 | |
| 465 | 464 | void |
| 466 | 465 | Sys_dup(vm_registers_t &r, vm_t &vm) |
| 467 | 466 | { |
| 468 | 467 | auto &fp = r.stack.peek_frame()->base<F_Sys_dup>(); |
| 469 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 468 | + throw vm_system_exception{ "Function not implemented" }; | |
| 470 | 469 | } |
| 471 | 470 | |
| 472 | 471 | void |
| 473 | 472 | Sys_export(vm_registers_t &r, vm_t &vm) |
| 474 | 473 | { |
| 475 | 474 | auto &fp = r.stack.peek_frame()->base<F_Sys_export>(); |
| 476 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 475 | + throw vm_system_exception{ "Function not implemented" }; | |
| 477 | 476 | } |
| 478 | 477 | |
| 479 | 478 | void |
| 480 | 479 | Sys_fauth(vm_registers_t &r, vm_t &vm) |
| 481 | 480 | { |
| 482 | 481 | auto &fp = r.stack.peek_frame()->base<F_Sys_fauth>(); |
| 483 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 482 | + throw vm_system_exception{ "Function not implemented" }; | |
| 484 | 483 | } |
| 485 | 484 | |
| 486 | 485 | void |
| 487 | 486 | Sys_fd2path(vm_registers_t &r, vm_t &vm) |
| 488 | 487 | { |
| 489 | 488 | auto &fp = r.stack.peek_frame()->base<F_Sys_fd2path>(); |
| 490 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 489 | + throw vm_system_exception{ "Function not implemented" }; | |
| 491 | 490 | } |
| 492 | 491 | |
| 493 | 492 | void |
| @@ -510,7 +509,7 @@ void · 16 unmodified lines | ||
| 510 | 509 | Sys_file2chan(vm_registers_t &r, vm_t &vm) |
| 511 | 510 | { |
| 512 | 511 | auto &fp = r.stack.peek_frame()->base<F_Sys_file2chan>(); |
| 513 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 512 | + throw vm_system_exception{ "Function not implemented" }; | |
| 514 | 513 | } |
| 515 | 514 | |
| 516 | 515 | void |
| @@ -532,35 +531,35 @@ void · 15 unmodified lines | ||
| 532 | 531 | Sys_fstat(vm_registers_t &r, vm_t &vm) |
| 533 | 532 | { |
| 534 | 533 | auto &fp = r.stack.peek_frame()->base<F_Sys_fstat>(); |
| 535 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 534 | + throw vm_system_exception{ "Function not implemented" }; | |
| 536 | 535 | } |
| 537 | 536 | |
| 538 | 537 | void |
| 539 | 538 | Sys_fversion(vm_registers_t &r, vm_t &vm) |
| 540 | 539 | { |
| 541 | 540 | auto &fp = r.stack.peek_frame()->base<F_Sys_fversion>(); |
| 542 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 541 | + throw vm_system_exception{ "Function not implemented" }; | |
| 543 | 542 | } |
| 544 | 543 | |
| 545 | 544 | void |
| 546 | 545 | Sys_fwstat(vm_registers_t &r, vm_t &vm) |
| 547 | 546 | { |
| 548 | 547 | auto &fp = r.stack.peek_frame()->base<F_Sys_fwstat>(); |
| 549 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 548 | + throw vm_system_exception{ "Function not implemented" }; | |
| 550 | 549 | } |
| 551 | 550 | |
| 552 | 551 | void |
| 553 | 552 | Sys_iounit(vm_registers_t &r, vm_t &vm) |
| 554 | 553 | { |
| 555 | 554 | auto &fp = r.stack.peek_frame()->base<F_Sys_iounit>(); |
| 556 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 555 | + throw vm_system_exception{ "Function not implemented" }; | |
| 557 | 556 | } |
| 558 | 557 | |
| 559 | 558 | void |
| 560 | 559 | Sys_listen(vm_registers_t &r, vm_t &vm) |
| 561 | 560 | { |
| 562 | 561 | auto &fp = r.stack.peek_frame()->base<F_Sys_listen>(); |
| 563 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 562 | + throw vm_system_exception{ "Function not implemented" }; | |
| 564 | 563 | } |
| 565 | 564 | |
| 566 | 565 | void |
| @@ -577,7 +576,7 @@ void · 10 unmodified lines | ||
| 577 | 576 | Sys_mount(vm_registers_t &r, vm_t &vm) |
| 578 | 577 | { |
| 579 | 578 | auto &fp = r.stack.peek_frame()->base<F_Sys_mount>(); |
| 580 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 579 | + throw vm_system_exception{ "Function not implemented" }; | |
| 581 | 580 | } |
| 582 | 581 | |
| 583 | 582 | void |
| @@ -614,28 +613,27 @@ Sys_open(vm_registers_t &r, vm_t &vm) · 30 unmodified lines | ||
| 614 | 613 | } |
| 615 | 614 | |
| 616 | 615 | *fp.ret = fd_alloc->get_allocation(); |
| 617 | − fd_alloc->add_ref(); | |
| 618 | 616 | } |
| 619 | 617 | |
| 620 | 618 | void |
| 621 | 619 | Sys_pctl(vm_registers_t &r, vm_t &vm) |
| 622 | 620 | { |
| 623 | 621 | auto &fp = r.stack.peek_frame()->base<F_Sys_pctl>(); |
| 624 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 622 | + throw vm_system_exception{ "Function not implemented" }; | |
| 625 | 623 | } |
| 626 | 624 | |
| 627 | 625 | void |
| 628 | 626 | Sys_pipe(vm_registers_t &r, vm_t &vm) |
| 629 | 627 | { |
| 630 | 628 | auto &fp = r.stack.peek_frame()->base<F_Sys_pipe>(); |
| 631 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 629 | + throw vm_system_exception{ "Function not implemented" }; | |
| 632 | 630 | } |
| 633 | 631 | |
| 634 | 632 | void |
| 635 | 633 | Sys_pread(vm_registers_t &r, vm_t &vm) |
| 636 | 634 | { |
| 637 | 635 | auto &fp = r.stack.peek_frame()->base<F_Sys_pread>(); |
| 638 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 636 | + throw vm_system_exception{ "Function not implemented" }; | |
| 639 | 637 | } |
| 640 | 638 | |
| 641 | 639 | void |
| @@ -654,7 +652,7 @@ void · 12 unmodified lines | ||
| 654 | 652 | Sys_pwrite(vm_registers_t &r, vm_t &vm) |
| 655 | 653 | { |
| 656 | 654 | auto &fp = r.stack.peek_frame()->base<F_Sys_pwrite>(); |
| 657 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 655 | + throw vm_system_exception{ "Function not implemented" }; | |
| 658 | 656 | } |
| 659 | 657 | |
| 660 | 658 | void |
| @@ -691,7 +689,7 @@ void · 30 unmodified lines | ||
| 691 | 689 | Sys_readn(vm_registers_t &r, vm_t &vm) |
| 692 | 690 | { |
| 693 | 691 | auto &fp = r.stack.peek_frame()->base<F_Sys_readn>(); |
| 694 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 692 | + throw vm_system_exception{ "Function not implemented" }; | |
| 695 | 693 | } |
| 696 | 694 | |
| 697 | 695 | void |
| @@ -760,7 +758,6 @@ Sys_sprint(vm_registers_t &r, vm_t &vm) · 62 unmodified lines | ||
| 760 | 758 | new_string = new vm_string_t{ static_cast<std::size_t>(written), reinterpret_cast<uint8_t *>(dynamic_buffer.data()) }; |
| 761 | 759 | } |
| 762 | 760 | |
| 763 | − assert(new_string != nullptr); | |
| 764 | 761 | *fp.ret = new_string->get_allocation(); |
| 765 | 762 | } |
| 766 | 763 | |
| @@ -768,14 +765,14 @@ void · 1 unmodified line | ||
| 768 | 765 | Sys_stat(vm_registers_t &r, vm_t &vm) |
| 769 | 766 | { |
| 770 | 767 | auto &fp = r.stack.peek_frame()->base<F_Sys_stat>(); |
| 771 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 768 | + throw vm_system_exception{ "Function not implemented" }; | |
| 772 | 769 | } |
| 773 | 770 | |
| 774 | 771 | void |
| 775 | 772 | Sys_stream(vm_registers_t &r, vm_t &vm) |
| 776 | 773 | { |
| 777 | 774 | auto &fp = r.stack.peek_frame()->base<F_Sys_stream>(); |
| 778 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 775 | + throw vm_system_exception{ "Function not implemented" }; | |
| 779 | 776 | } |
| 780 | 777 | |
| 781 | 778 | namespace |
| @@ -907,7 +904,7 @@ void · 125 unmodified lines | ||
| 907 | 904 | Sys_unmount(vm_registers_t &r, vm_t &vm) |
| 908 | 905 | { |
| 909 | 906 | auto &fp = r.stack.peek_frame()->base<F_Sys_unmount>(); |
| 910 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 907 | + throw vm_system_exception{ "Function not implemented" }; | |
| 911 | 908 | } |
| 912 | 909 | |
| 913 | 910 | void |
| @@ -933,7 +930,14 @@ void · 19 unmodified lines | ||
| 933 | 930 | Sys_werrstr(vm_registers_t &r, vm_t &vm) |
| 934 | 931 | { |
| 935 | 932 | auto &fp = r.stack.peek_frame()->base<F_Sys_werrstr>(); |
| 936 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 933 | + | |
| 934 | + auto new_err = ""; | |
| 935 | + auto s = vm_alloc_t::from_allocation<vm_string_t>(fp.s); | |
| 936 | + if (s != nullptr) | |
| 937 | + new_err = s->str(); | |
| 938 | + | |
| 939 | + push_syscall_error_message(vm, new_err); | |
| 940 | + *fp.ret = 0; | |
| 937 | 941 | } |
| 938 | 942 | |
| 939 | 943 | void |
| @@ -972,5 +976,5 @@ void · 32 unmodified lines | ||
| 972 | 976 | Sys_wstat(vm_registers_t &r, vm_t &vm) |
| 973 | 977 | { |
| 974 | 978 | auto &fp = r.stack.peek_frame()->base<F_Sys_wstat>(); |
| 975 | − throw vm_system_exception{ "Instruction not implemented" }; | |
| 979 | + throw vm_system_exception{ "Function not implemented" }; | |
| 976 | 980 | } |