Commit Graph

76 Commits

Author SHA1 Message Date
Denis Drakhnia ba89b350dc e2k: signals: Save and restore more state.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia 1d0e52b6a0 e2k: Bug fixes.
Fix time fields in stat64.

Restore and save a breakpoint frame in a signal
handler. This will fix a segfault if a signal will
be raised while a cpu is in a breakpoint.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia 8f4de9d485 e2k: Implement basic v5 support.
Add gdb xml files for e2k.
Tags are partially disabled for better performance.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 6fb98e718e e2k: Move TCG translation parts into single file.
The TCG translation was splitted into multiple files and
it was painful because it has a lot of cross references.

Reorg FX helpers.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 17be44b21b e2k: Use one large array for registers.
Previously was used two separate arrays for low and
high halves of a register. Now we can pass direct
pointer to a register into helpers instead of copying
the halves into a temporary buffer and pass pointer to
that buffer.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 374e658eb1 e2k: Add access_hw_stacks and backtrace syscalls.
Special system calls for managing hardware stacks.
Required for C++ exceptions.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia e440ebc3db e2k: Basic impl of e2k32-linux-user.
Fix target_stat64 field types in 32-bit mode.
Basic impl of getpl.
Basic impl of ldgd{b,h,w,d}.
Basic impl of stgd{b,h,w,d}.
Add e2k exceptions.
Add Dynamic hw stacks expansion.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 7198f44549 e2k: Always SPILL/FILL in FX window mode.
It will fix 'finish' command in gdb.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 5e66da5f7d e2k: Delete top CRs from cpu state.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 05304bd1f3 e2k: Fix compiler warnings.
Remove unused static functions.
Replace a misused not operator by bitwise not.
2022-06-10 11:48:19 +03:00
Denis Drakhnia 26b9e9a1e4 e2k: Impl basic unix signals support. 2022-06-10 11:48:19 +03:00
Denis Drakhnia 23a0139ee6 e2k: Remove control.c 2022-06-10 11:48:17 +03:00
Denis Drakhnia 0b7f461be7 e2k: Remove pshtp and window base. 2022-06-10 11:48:17 +03:00
Denis Drakhnia 28aafb053c e2k: Restore usage of env CRs.
Fixes syscall e2k_longjmp2.
2022-06-10 11:48:17 +03:00
Denis Drakhnia e4e22e089c e2k: Prepare to remove CRs from env. 2022-06-10 11:48:16 +03:00
Denis Drakhnia 06df1e9168 e2k: Impl e2k_longjmp2 syscall. 2022-06-10 11:48:16 +03:00
Denis Drakhnia 1c16338c6d target: e2k: Correctly save/restore wdbl. 2022-06-10 11:48:16 +03:00
Denis Drakhnia 21b39b8206 target: e2k: Delete hack for saving USD registers on proc call/ret. 2022-06-10 11:48:15 +03:00
Denis Drakhnia bcc311b773 target: e2k: Fix udivs exception hack. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 1dd030c321 target: e2k: Add e2k_todo{,_illop} macros. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 4646e43803 target: e2k: Add tlb_fill handler. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 8143c8c7e8 target: e2k: Clear registers in new allocated range of window. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 4a13be8f68 target: e2k: Fix incorrect registers view in gdb after exception. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 8cac70df0e target: e2k: Fix gdb run till exit from func. 2022-06-10 11:48:15 +03:00
Denis Drakhnia d402c52f4a target: e2k: %cr0 must hold pregs and ip of previous procedure. 2022-06-10 11:48:15 +03:00
Denis Drakhnia ad6bc687e4 target: e2k: HACK: Tag storage for procedure stack. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 5b444c9356 target: e2k: Add dbl window modifier. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 381868f71a target: e2k: Return aligned pointer from getsp. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 83e2503867 target: e2k: HACK: Add stack for USD registers.
CPU must restore `USD` after calls but I don't know how it should be implemented.
2022-06-10 11:48:15 +03:00
Denis Drakhnia bd027ff219 target: e2k: Force ps pop in FX mode. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 4a572f8263 target: e2k: Add xregs. 2022-06-10 11:48:14 +03:00
Denis Drakhnia a19227acd9 target: e2k: Log msg if wd.fx is setted. 2022-06-10 11:48:14 +03:00
Denis Drakhnia bd6208c09f target: e2k: Fix ctpr size. 2022-06-10 11:48:14 +03:00
Denis Drakhnia a357666e69 target: e2k: Log msg if dbl is setted. 2022-06-10 11:48:14 +03:00
Denis Drakhnia db10b6d8a4 target: e2k: Reorg reg file. 2022-06-10 11:48:13 +03:00
Denis Drakhnia a008c8d102 target: e2k: Add registers tags. 2022-06-10 11:48:13 +03:00
Denis Drakhnia 06e789a573 target: e2k: Jump to ctpr_addr if ctpr is return. 2022-06-10 11:48:13 +03:00
Denis Drakhnia c81e20732d target: e2k: Fix instr return. 2022-06-10 11:48:13 +03:00
Denis Drakhnia 2ba3ae22f6 target: e2k: Fix gen_goto_tb usage. 2022-06-10 11:48:13 +03:00
Denis Drakhnia 0b4a9728dc target: e2k: Move int helpers to separate file. 2022-06-10 11:48:13 +03:00
Denis Drakhnia f37d246c90 target: e2k: Make gdb happier. 2022-06-10 11:48:13 +03:00
Denis Drakhnia 229797cfbd target: e2k: Ps push/pop with pshtp. 2022-06-10 11:48:13 +03:00
Denis Drakhnia 028d27ae4c target: e2k: Add setwd helper. 2022-06-10 11:48:13 +03:00
Denis Drakhnia 2ec66c49c5 target: e2k: Reorg cr1. 2022-06-10 11:48:13 +03:00
Denis Drakhnia 5601f6e45a target: e2k: Reorg wd. 2022-06-10 11:48:13 +03:00
Denis Drakhnia dd3aa7283a target: e2k: Reorg br. 2022-06-10 11:48:13 +03:00
Denis Drakhnia 9105937fd9 target: e2k: Reord pcsp. 2022-06-10 11:48:13 +03:00
Denis Drakhnia ab13f761a2 target: e2k: Reorg psp. 2022-06-10 11:48:13 +03:00
Denis Drakhnia 8aa929e289 target: e2k: Move helper_cur_dec to TCG. 2022-06-10 11:48:13 +03:00
Denis Drakhnia 468277c315 target: e2k: Remove helper unimpl. 2022-06-10 11:48:12 +03:00