Gleb Popov
4489b5793c
Add stub signal.c implementation for e2k.
2022-06-18 21:07:45 +03:00
Gleb Popov
841a020b7e
Adapt to changed e2k_psp_new() signature.
2022-06-18 21:06:25 +03:00
Gleb Popov
1975482e1a
Merge remote-tracking branch 'elbrus/e2k' into e2k-bsd-user-blitz
2022-06-18 20:56:46 +03:00
Gleb Popov
f0f069782b
Use force_sig_fault() provided by bsd-user instead of gen_signal()
2022-06-18 20:55:25 +03:00
Gleb Popov
9f15a3c854
Remove TARGET_ERESTARTSYS handling from target_cpu_loop()
2022-06-18 20:54:32 +03:00
Denis Drakhnia
f43cc408fb
e2k: move e2k_psp_new to cpu.c
...
Signed-off-by: Denis Drakhnia <numas13@gmail.com>
2022-06-18 15:03:07 +03:00
Gleb Popov
30d478ff6f
Merge branch 'elbrus' into e2k-bsd-user
2022-06-18 13:15:28 +03:00
Gleb Popov
22dbdd7c74
Merge remote-tracking branch 'elbrus/e2k' into e2k-bsd-user
2022-06-18 13:11:44 +03:00
Gleb Popov
a46c9478a4
Merge branch 'auxv' into e2k-bsd-user
2022-06-18 13:11:06 +03:00
Gleb Popov
831b870463
Make target_create_elf_tables() code more in line with linux-user.
...
Fill image_info->arg_start and ->arg_end fields.
2022-06-18 13:09:21 +03:00
Gleb Popov
312e7a6bde
Enable use of handle_query_xfer_auxv in qemu-bsd-user.
2022-06-18 13:08:47 +03:00
Denis Drakhnia
fb9330bd0e
e2k: Add cctop* insns.
...
Signed-off-by: Denis Drakhnia <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
8b2746e8ca
linux-user/e2k: save initial frame for gdb.
2022-06-10 11:48:20 +03:00
Alibek Omarov
08855e4bd3
linux-user/e2k: place generic errno definitions, arch doesn't override them
2022-06-10 11:48:20 +03:00
Alibek Omarov
93dbd4c56c
e2k: add Kconfig
2022-06-10 11:48:20 +03:00
Alibek Omarov
d48d9d62c6
tests/tcg/e2k: remove C tests, add simple assembler add test
2022-06-10 11:48:20 +03:00
Alibek Omarov
71c53a3825
tests/tcg: don't run multiarch tests for assembler-only targets
...
Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
2022-06-10 11:48:20 +03:00
Alibek Omarov
223451dbc0
tests/tcg: allow running tests for targets that don't have C compiler
...
Obviously there is better way to do this.
Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
2022-06-10 11:48:20 +03:00
Alibek Omarov
657cab1e19
e2k: pass env to do_sigaltstack
...
Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
bcc04e0c5b
e2k: Increase the number of NR to 224.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
0a0655109a
e2k: Gen illopc for mirrored ld+st.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
75583b5082
e2k: Reorg cpu dump.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
48290cb80c
e2k: Update get/set state regs.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
21ff5cbef9
e2k: Remove syscall helper.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
c8ed74f626
e2k: Add tags and force_save_alc_dst properties.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
d84636d73a
e2k: Restore basic tags support.
...
Disabled at compile time.
2022-06-10 11:48:20 +03:00
Denis Drakhnia
0c634e952b
e2k: Do not generate loop_end for stores outside of loops.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
0914c72c8b
e2k: Fix segfault.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
52e67df3a1
e2k: Reorg usage of registers.
...
Till then we had separate stage to write results of
an operations to registers. Now operations will write
result immediately to a destination register. Registers
will be saved to a temporary location if following
operations in a bundle must read them.
The change elliminates additional branches for
conditional operations in the write stage and reduces
data movements.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
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
811c08e821
e2k: Port f{min,max} and float2int from x86.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
5301939d1f
e2k: Fix performance regression.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia
c03d91b7c0
e2k: Fix read and write probe access.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia
6cbcdc4d5c
e2k: Implement basic v6 support.
...
Not tested on a real hardware.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia
401ccafc8c
e2k: Fix C++ exceptions for v5+.
...
v5+ has different procedure stack layout. Reading
the stack through the acees_hw_stacks syscall
requires to shuffle registers for a backward
compatibility with previous versions.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +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
bed634d944
e2k: Use %pfpfr for f32 and f64 operations.
...
%fpcr and %fpsr have been used for the operations but
%pfpfr must be used instead.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia
cd6c5f262f
e2k: Fix fxcmp{s,d}b tcg fatal errors.
...
Was used destroyed value of converted src2 after a branch.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia
a8514e0e08
e2k: Update qemu-binfmt-conf.sh script.
...
Add e2k_old, e2k32 and e2k32_old user targets.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia
b0a1af39c6
e2k: Add a fake atomic execution.
...
QEMU has cpu_exec_step_atomic function to run
one instruction in an exclusive mode but we need
to execute multiple instructions in that mode.
I don't want to modify the function.
The solution provides a correct execution of
atomic operations like on real CPU but needs
more testing to prove that it works correctly
in all cases.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia
88fed7c276
e2k: Fix signed integer division.
...
Do not raise an x86 exception when the minimum signed
integer is divisible by minus one.
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
f49a9d8df0
e2k: Fix incorrect initialization of mlock.
...
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Alibek Omarov
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
Denis Drakhnia
d3e84e57e5
e2k: Add e2k32 linux user files.
...
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