Commit Graph

3056 Commits

Author SHA1 Message Date
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
f49a9d8df0 e2k: Fix incorrect initialization of mlock.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
5220638091 e2k: remove unnecessary e2k32 directory
It can be avoided with TARGET_ABI_DIR=e2k in e2k32-linux-user.mak

Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
2022-06-10 11:48:19 +03:00
d3e84e57e5 e2k: Add e2k32 linux user files.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
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
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
9e87995802 e2k: Panic if it was not possible to copy CR to a new thread.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
3cf004027d e2k: Increase PCS and PS sizes.
Dynamically expanding the stack has not yet been
implemented, but sometimes applications require
larger stacks.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
9146c4c67f e2k: Fix build of other linux-user-targets.
Forgot to wrap constants in if block.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
62637ca653 e2k: Add systrace print for access_hw_stacks.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
e404c06a2d e2k: Fix syscall restart.
We cannot just change the IP address in E2K to restart
the instruction because the same register can be read
and written in the same instruction (and many more
situations), but we can create a fake syscall instruction
and restart it.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
5e66da5f7d e2k: Delete top CRs from cpu state.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
5cb3b40f2d e2k: Set correct NR macro for pread/pwrite. 2022-06-10 11:48:19 +03:00
26b9e9a1e4 e2k: Impl basic unix signals support. 2022-06-10 11:48:19 +03:00
861a2b6fb6 e2k: Init CRs, make gcc happy. 2022-06-10 11:48:18 +03:00
7c4ff94e5f e2k: Impl basic init thread support. 2022-06-10 11:48:18 +03:00
f56cad7923 e2k: implement detecting ISA version by ELF flags, throw an error for protected mode and x86 recompiled binaries for now 2022-06-10 11:48:18 +03:00
0b7f461be7 e2k: Remove pshtp and window base. 2022-06-10 11:48:17 +03:00
d37ee639b1 e2k: Add {u,s}{div,mod}x instrs. 2022-06-10 11:48:17 +03:00
06df1e9168 e2k: Impl e2k_longjmp2 syscall. 2022-06-10 11:48:16 +03:00
999c27999d linux-user: e2k: add forgotten e2k-specific mmap flags, fix some definitions 2022-06-10 11:48:16 +03:00
10f960328a e2k: Update target_stat and target_statfs structs. 2022-06-10 11:48:16 +03:00
21b39b8206 target: e2k: Delete hack for saving USD registers on proc call/ret. 2022-06-10 11:48:15 +03:00
ad6bc687e4 target: e2k: HACK: Tag storage for procedure stack. 2022-06-10 11:48:15 +03:00
381868f71a target: e2k: Return aligned pointer from getsp. 2022-06-10 11:48:15 +03:00
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
4a572f8263 target: e2k: Add xregs. 2022-06-10 11:48:14 +03:00
57b3469cda target: e2k: Impl speculative execution. 2022-06-10 11:48:13 +03:00
281f6af159 target: e2k: Remove unneeded ip change in syscall. 2022-06-10 11:48:13 +03:00
db10b6d8a4 target: e2k: Reorg reg file. 2022-06-10 11:48:13 +03:00
d2646eb82b target: e2k: Update TODO messages. 2022-06-10 11:48:13 +03:00
f37d246c90 target: e2k: Make gdb happier. 2022-06-10 11:48:13 +03:00
5601f6e45a target: e2k: Reorg wd. 2022-06-10 11:48:13 +03:00
9105937fd9 target: e2k: Reord pcsp. 2022-06-10 11:48:13 +03:00
ab13f761a2 target: e2k: Reorg psp. 2022-06-10 11:48:13 +03:00
468277c315 target: e2k: Remove helper unimpl. 2022-06-10 11:48:12 +03:00
938d78d836 target: e2k: Fix load instrs. 2022-06-10 11:48:12 +03:00
d05841bd16 target: e2k: Fix ct in gdb. 2022-06-10 11:48:12 +03:00
c3e5a53689 target: e2k: Read NR in gdb. 2022-06-10 11:48:12 +03:00
c40cc30f26 target: e2k: Reorg + basic gdb debugging. 2022-06-10 11:48:12 +03:00
9cf42881f6 target: e2k: initial gdb support 2022-06-10 11:48:12 +03:00
ff2d059db8 target: e2k: Add procedure stack. 2022-06-10 11:48:11 +03:00
2eba228ecb target: e2k: Rotate window registers in syscall. 2022-06-10 11:48:11 +03:00
0198775b67 target: e2k: Add basic call (without saving regs). 2022-06-10 11:48:11 +03:00
54feb6fbe3 target: e2k: Fix bugs. 2022-06-10 11:48:11 +03:00
37acf287ad target: e2k: Impl rotated pregs. 2022-06-10 11:48:11 +03:00
725d1d5acf target: e2k: Add basic syscall support. 2022-06-10 11:48:11 +03:00
11c80f0227 target: e2k: Try to impl syscall. 2022-06-10 11:48:11 +03:00
ff5127d36a target: e2k: unpack long instructions. 2022-06-10 11:48:10 +03:00
c42af9ff35 disas: import disassmebler from binutils 2022-06-10 11:48:10 +03:00