Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Renesas RH850 architecture support #1918

Open
wants to merge 267 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
267 commits
Select commit Hold shift + click to select a range
f163edc
Fix RH850 test for 32bits host arch
Jan 10, 2024
31b8d83
Fix register size for read/write access through unicorn.
Jan 10, 2024
53b86eb
Remove unicorn deinit in RH850 test code for debugging purpose.
Jan 10, 2024
ef18fe6
Fix a bug in RH850 release function
Jan 10, 2024
3e8125c
Ported Qemu RH850 architecture to Unicorn (untested code, compilation…
Apr 11, 2023
f8f1a93
Improved RH850 integration
Apr 12, 2023
4abc05b
Removed hook-related code (causes some issues for now).
Jan 19, 2024
12d2edb
Added RH850 UC_HOOK_CODE support.
Apr 13, 2023
98f851d
Added memory read/write hook.
Apr 13, 2023
a101296
Added memory read/write hooks in RH850 sample code.
Apr 13, 2023
4b5e9bf
Backported some bugfixes into Unicorn RH850 implementation.
Apr 14, 2023
b7430dd
Fixed som bugs in RH850 sample and changed SP register to be an alias…
May 11, 2023
b3d7f0c
Updated python bindings RH850 registers constants
May 11, 2023
2ad2ab1
Updated all RH850 regs constants files.
May 11, 2023
9650388
Removed temporary virtual env.
Nov 28, 2023
f3b6e41
Code cleaning.
Dec 4, 2023
ac82b7f
Update configure script to fix the RH850 architecture defines.
Jan 10, 2024
ca88dbf
Add msvc target configuration files for RH850 architecture.
Jan 10, 2024
5aa40ba
Fix default float_status struct initialization.
Jan 10, 2024
b21e745
Removed RH850 from aligned only targets.
Jan 10, 2024
8ec6709
Fix RH850 test for 32bits host arch
Jan 10, 2024
f2b9de5
Fix register size for read/write access through unicorn.
Jan 10, 2024
ee2b4da
Remove unicorn deinit in RH850 test code for debugging purpose.
Jan 10, 2024
675ab4c
Fix a bug in RH850 release function
Jan 10, 2024
d6383d1
Fix the inconsistencies following the rebase on branch dev.
Jan 19, 2024
4b5387a
Add Rust and Zig bindings for RH850.
Jan 22, 2024
ac0cbcc
remove unused code in PPC & dis-asm.h
aquynh Dec 6, 2022
b9ad941
add riscv constants to python binding module
ks0777 Nov 14, 2022
70d1889
Fix warning for ./setup.py (#1756)
domenukk Jan 5, 2023
709e604
Fix Rust binding memory leak
lucagladiator Jan 17, 2023
9528ff8
Fix insn_in_hook_proxy return type
Jan 21, 2023
ae7aed3
Do not search for the RAMBlock in split_region
PhilippTakacs Jan 18, 2023
62f0f34
rust only add mmio callback funktion, if callback is requested
PhilippTakacs Jan 23, 2023
6fb89a4
Add arch list feature control in Rust
edsky Dec 29, 2022
1d581dc
Demand paging on Windows
wtdcode Jan 28, 2023
9be43f1
Update comments of the page count
wtdcode Jan 28, 2023
56ce7d6
Rename flags to avoid confusion
wtdcode Jan 28, 2023
be89be4
bump version to 2.0.2
aquynh Feb 4, 2023
6dfc6aa
bindings: update version to 2.0.2
aquynh Feb 4, 2023
7f91786
rename memory_mapping() to find_memory_region() and simplify mem_map()
aquynh Feb 6, 2023
e166e7e
Detect AVX2 correctly for MSVC
wtdcode Feb 7, 2023
1799c6f
bindings: Rename dotnet project to UnicornEngine
TSRBerry Oct 31, 2022
fcfe98e
gh: Publish Nuget for dotnet bindings
TSRBerry Oct 31, 2022
57e285d
gh: Publish new packages if bindings get modified
TSRBerry Oct 31, 2022
d6e4efc
dotnet: Add native unicorn libraries to nuget package
TSRBerry Nov 5, 2022
5b404b2
gha: List all native libs before packing .Net distribution
TSRBerry Nov 5, 2022
4a1be88
gha: Fix 7zip extraction arguments
TSRBerry Nov 5, 2022
9416548
gha: Try to fix 7zip extraction errors
TSRBerry Nov 5, 2022
23040e8
gha: Fix unzip extracting to the wrong directory
TSRBerry Nov 5, 2022
0ec8340
gha: Get correct file name before renaming
TSRBerry Nov 5, 2022
4cb46ca
nuget: Build native libraries in jobs
TSRBerry Nov 22, 2022
44b2035
gha: Fix master branch check
TSRBerry Dec 15, 2022
2a9d2b5
gha: Add steps to upload nupkg as artifact & publish to Nuget
TSRBerry Jan 28, 2023
ec98980
Bump to 2.0.2-rc1 for csharp
wtdcode Feb 7, 2023
64c4d80
Fix wrong IP in x86_16 because of cs_base not substracted
wtdcode Feb 20, 2023
0dce4ca
Install pkg-config on macos runners
wtdcode Feb 20, 2023
1bf4f28
Install deps for macos
wtdcode Feb 20, 2023
be19b11
Install pkg-config for other workflows
wtdcode Feb 20, 2023
0584227
Remove obsolete Brewfile
wtdcode Feb 20, 2023
f0ee174
[x86] don't hardcode cpuid results
PhilippTakacs Feb 27, 2023
68fc3a4
[dotnet] Set begin > end address for hooks
tunz Feb 26, 2023
eb01d1f
[dotnet] Fix garbage collected hooks and wrong signature
tunz Mar 1, 2023
52a4a65
Use libunicorn.so.2 as fallback path
rhelmot Feb 28, 2023
bcac854
[dotnet] Add /MT flag for nuget package build
tunz Mar 1, 2023
dfe83da
[dotnet] Support HookDel with native bindings call
tunz Mar 11, 2023
1c2c69f
difference between stop_request and quit_request
PhilippTakacs Mar 6, 2023
b33ffcb
Remove redundant printf
wtdcode Mar 12, 2023
2860d9b
Cache index for find_memory_region
tunz Mar 21, 2023
258518d
Fix test failure
tunz Mar 21, 2023
015b526
build: Fixes for Haiku
kallisti5 Mar 22, 2023
e1a875c
zig consts
kassane Mar 23, 2023
9ef079e
new binding
kassane Mar 23, 2023
54e7c7a
Update Cargo.toml
kassane Mar 23, 2023
0f01462
Add missing import const in python binding (#1807)
Xeonacid Mar 26, 2023
d1576e8
make unicorn use the physical addresses
PhilippTakacs Sep 28, 2022
07a20a1
i386 mmu hack: Allow emulate usermode without mmu
PhilippTakacs Sep 29, 2022
0d26992
add basic mmu tests
PhilippTakacs Oct 6, 2022
2d24b1a
i386 call internal helper on special porpese register write
PhilippTakacs Oct 17, 2022
2c0adbc
sample to use the softmmu
PhilippTakacs Nov 29, 2022
1a269ee
add virtuall tlb
PhilippTakacs Oct 5, 2022
f63af4b
Remove MMU hacks
PhilippTakacs Feb 13, 2023
dbd671c
clear the TLB cache in uc_ctl_flush_tlb
PhilippTakacs Feb 17, 2023
1aca0bf
update faq
PhilippTakacs Feb 21, 2023
399fd54
Update bindings const
wtdcode Mar 28, 2023
5f20f93
Add tlb_mode for python
wtdcode Mar 28, 2023
4e5e4a9
Update FAQ
wtdcode Mar 28, 2023
4ba9cc6
Update comments
wtdcode Mar 28, 2023
96636a6
Fix clang/mingw - missing getpagesize
kassane Apr 3, 2023
89da863
Invalidate tb cache once mapping is removed
wtdcode Apr 12, 2023
4f7cc47
use int128_get64 in memory_unmap
PhilippTakacs Apr 17, 2023
9c8151a
add rust bindings for uc_ctl
ks0777 Mar 30, 2023
9f57654
rust update uc_ctl_flush_tlb and add uc_ctl_tlb_mode
PhilippTakacs Apr 5, 2023
4ab7701
rust add tlb callback
PhilippTakacs Apr 5, 2023
12a241f
remove unused function cmp_vaddr
PhilippTakacs May 8, 2023
1934678
move typedef definition of enum uc_mem_type
PhilippTakacs May 8, 2023
f0f392c
Fix sample_ctl.py.
nneonneo May 6, 2023
70e8550
Minor Python fixes.
nneonneo May 6, 2023
ac66c00
Add __repr__ to all ctypes.Structure subclasses
nneonneo May 10, 2023
277f854
Rebuild flags after writing to cp registers
wtdcode May 14, 2023
b48f068
load_helper only call cpu_loop_exit() when emulation is running
PhilippTakacs May 9, 2023
beb0c22
fixup! load_helper only call cpu_loop_exit() when emulation is running
PhilippTakacs May 12, 2023
ad85fb0
Also check cpu->stopped
wtdcode May 19, 2023
09f657a
Add apt update
tunz May 23, 2023
ef95824
fix UC_MEM_WRITE_PROT callback
PhilippTakacs May 22, 2023
e2c0dd2
Support demand paging via closures and seh
wtdcode Jun 10, 2023
6d51bb5
Correct calling convention
wtdcode Jun 10, 2023
29467bb
Fix typo
wtdcode Jun 10, 2023
e8ea390
Add uc_ctl_get/set_tcg_buffer_size
wtdcode Jun 10, 2023
95b988c
Revert "Add uc_ctl_get/set_tcg_buffer_size"
wtdcode Jun 10, 2023
cbd5c0b
Add uc_ctl_get/set_tcg_buffer_size
wtdcode Jun 10, 2023
a8cddf5
Leave out essential files
wtdcode Jun 10, 2023
234c8c5
Fix missing stdint
wtdcode Jun 10, 2023
c0c7bbc
Reformat code with format.sh
nneonneo May 11, 2023
60a995c
Implement uc_reg_{read,write}{,_batch}2 APIs.
nneonneo May 11, 2023
24e47b5
Slight refactoring to reduce code duplication.
nneonneo May 12, 2023
79b5e58
Simplify reg_read/reg_write, obtaining a perf boost.
nneonneo May 12, 2023
62f2d12
Fix RISCV test_riscv32_fp_move test
nneonneo May 12, 2023
7807984
Return new UC_ERR_OVERFLOW instead of UC_ERR_NOMEM when reg buffer is…
nneonneo Jun 16, 2023
5417f0b
remove all legacy DYNLOAD code
aquynh Jun 22, 2023
0dbbed8
Also rebuild flags for aarch32
wtdcode Jun 28, 2023
4a31aa3
Backport https://github.com/qemu/qemu/commit/10b8eb94c0902b58d83df84a…
wtdcode Jun 30, 2023
a65ba01
Add a unit test for a7a5d187e77f7853755eff4768658daf8095c3b7
wtdcode Jun 30, 2023
dea00f3
Fix test_x86_0xff_lcall test
wtdcode Jul 7, 2023
95a8c19
add memory_region_add_subregion_overlap
PhilippTakacs Dec 16, 2022
40e398b
use address_space_translate to find memory mapping
PhilippTakacs Dec 22, 2022
5b6f81f
implement simple memory snapshot mechanismus
PhilippTakacs Dec 22, 2022
8bb625c
snapshot benchmark
PhilippTakacs Jan 27, 2023
8bbc353
find_ram_offset optimization
PhilippTakacs Feb 28, 2023
45ac208
handle snapshots over context_save context_restore
PhilippTakacs Apr 11, 2023
07a4ea7
implement uc_mem_unmap with snapshots
PhilippTakacs May 30, 2023
c40ea5a
Update CREDITS.TXT
PhilippTakacs Jun 13, 2023
20e72fb
vtlb only cache access permisions required for the operation
PhilippTakacs Jul 13, 2023
7286e8f
expose ffi in rust bindings
lockbox Jun 15, 2023
3962a47
add cpu model to architectures for rust bindings
lockbox Jul 13, 2023
08a2f04
fix: Remove unnecessary use statement that causes warnings
mlgiraud Jul 18, 2023
3951ded
fix: update bitflags dependency and fix flippy warnings
mlgiraud Jul 18, 2023
e5be0e7
fix: Add missing Copy derive
mlgiraud Jul 26, 2023
9ac4287
Fix building on Apple Sillicon
wtdcode Aug 3, 2023
c6a3517
Backport qemu/qemu@75b208c
basavesh Jul 27, 2023
c8f8729
Avoid overwriting tmp0
wtdcode Aug 6, 2023
6c5174d
Add a unit test for #1717
wtdcode Aug 6, 2023
5a461ad
Format code
wtdcode Aug 6, 2023
6774807
Zig binding
kassane Mar 31, 2023
152ca52
fix: Make functions that deref ptr unsafe
mlgiraud Aug 11, 2023
0955f54
fix: Wrap uc_hook to not expose ffi types in public api
mlgiraud Aug 14, 2023
3ddfdbc
fix: Make from handle function unsafe
mlgiraud Aug 14, 2023
56706c1
formating: Use rustfmt style for rust bindings
mlgiraud Aug 14, 2023
315ffc7
refactor: Make rust bindings more rusty
mlgiraud Aug 15, 2023
b31ad2c
feat: Add ctl_context_mode to rust bindings
mlgiraud Aug 16, 2023
06b1cf7
fix: Use correct addresses during memory cow
mlgiraud Aug 23, 2023
2fb53be
test: Add test to reproduce cow+vtlb error
mlgiraud Aug 24, 2023
018a770
refactor: Make clippy happy
mlgiraud Aug 25, 2023
30ee541
use full prototypes for functions without parameters
hamarituc Oct 8, 2023
ac056c4
fix deprecated storage-class declarations
hamarituc Oct 8, 2023
3d4976f
fix fxsave fpip value, provide tests
Oct 26, 2023
0eaafb8
qemu: fix UBSAN errors in tcg and arm translation
StalkR Nov 14, 2023
3e61809
Fix PPC32 fault when timer-spr access
dotCirill Dec 5, 2023
496672b
Reformat Java bindings.
nneonneo May 5, 2023
56a58b8
Remove redundant Makefile
nneonneo May 5, 2023
11bad18
Set up testing infrastructure ("make test")
nneonneo May 5, 2023
321f48c
Make close() idempotent and fix Unicorn memory leak.
nneonneo May 6, 2023
6af51b1
Rewrite the Java bindings.
nneonneo May 7, 2023
cb67fb8
Switch samples to use long instead of Long for registers
nneonneo May 7, 2023
dd3db38
Javadoc updates
nneonneo May 9, 2023
cd702c4
Restore some of the less problematic old APIs for backwards compatibi…
nneonneo May 13, 2023
157b8e0
Javadoc updates
nneonneo May 13, 2023
06c4687
Use an incrementing handle instead of returning a raw pointer to the …
nneonneo May 13, 2023
f5fe61c
Reintroduce hook_del(Hook), since it seems useful.
nneonneo May 13, 2023
39f3ee0
Add more deprecated APIs for backwards compat
nneonneo May 13, 2023
3c0abb8
Fix definition of uc_version
nneonneo May 13, 2023
da4cdc9
Refactor tests and add a few more
nneonneo May 13, 2023
c200fc0
Accept unsigned BigIntegers, and produce unsigned BigIntegers by defa…
nneonneo May 14, 2023
c61767e
Write some code to test out ARM64 CP register handling.
nneonneo May 14, 2023
2af68d8
Update Java samples to match C samples.
nneonneo May 14, 2023
7e9a171
Port sample_x86_32_gdt_and_seg_regs over to Sample_x86_mmr
nneonneo May 15, 2023
5631771
Port sample_batch_reg.c to Java, incidentally finding a bug in the ge…
nneonneo May 15, 2023
8fe5a48
Properly check return value of makeHookWrapper
nneonneo May 15, 2023
bbdd55c
Add a link to the relevant issue for ARM PAC handling
nneonneo Jun 17, 2023
03b02b8
Add comment about unicorn_Unicorn.h to the .c file
nneonneo Jun 17, 2023
5439bb6
Switch to Maven to build the Java bits.
nneonneo Jun 29, 2023
2b28eda
Switch Java bindings to reg2 API.
nneonneo Jun 29, 2023
832fd3c
Replace javah by javac -h, only write new constant files if something…
nneonneo Jul 7, 2023
e1bbed4
attach-release
marameref Oct 15, 2023
79fc048
workflow dispatch
marameref Oct 15, 2023
2ca59ab
refactor
marameref Oct 15, 2023
a1d44f9
create artifacts folder
marameref Oct 15, 2023
b08f6a0
code refactor
marameref Oct 17, 2023
1750aba
Attach Release
marameref Oct 17, 2023
0db54b0
My-Artifacts Directory
marameref Oct 17, 2023
daab053
MyArtifacts
marameref Oct 17, 2023
4ecaa5c
My Artifacts
marameref Oct 17, 2023
32bc61e
refactor yaml
marameref Oct 17, 2023
0d23559
refactoring
marameref Oct 17, 2023
d6f56b9
Refactor
marameref Oct 17, 2023
4ce34fa
Artifacts redo
marameref Oct 17, 2023
6c16930
build
marameref Oct 17, 2023
06a8a70
refactor yaml
marameref Oct 17, 2023
5a397ce
workflw
marameref Oct 17, 2023
e0cc863
run-success
marameref Oct 17, 2023
af25c7b
release
marameref Oct 18, 2023
009ebac
release
marameref Oct 18, 2023
683825f
release
marameref Oct 18, 2023
de8508e
prelease
marameref Oct 19, 2023
fa58132
release
marameref Oct 19, 2023
11cafca
prerelease
marameref Oct 20, 2023
a9f718f
release
marameref Oct 20, 2023
7efa2b8
github token
marameref Oct 20, 2023
0049abc
token
marameref Oct 20, 2023
652ce5e
pre-release
marameref Oct 20, 2023
be69f89
Update
marameref Oct 20, 2023
c7c020c
prelease set
marameref Oct 20, 2023
2b785cf
Always create drafts
wtdcode Dec 25, 2023
8040429
Add -latomic for arm and riscv64
wtdcode Dec 28, 2023
abe614d
Fix typo
wtdcode Dec 28, 2023
1194c58
Add -latomic to samples and tests
wtdcode Dec 28, 2023
af5c156
Refine -latomic fix
wtdcode Dec 28, 2023
e9f731f
Reflect in pkg-config
wtdcode Dec 28, 2023
8d5baec
Also add atomic to samples lib linkage
wtdcode Dec 28, 2023
52a842f
Told QEMU configure to use atomic
wtdcode Dec 28, 2023
77c84ad
Don't rely on dead code elimination
wtdcode Jan 3, 2024
8daa5af
HAVE_ATOMIC128 is defined as a number
wtdcode Jan 3, 2024
a216191
Revert previous wrong fixes
wtdcode Jan 3, 2024
44be21d
Add arm for bad assert implementation
wtdcode Jan 3, 2024
cdf91d7
fix cow when using uc_mem_write
PhilippTakacs Jan 9, 2024
e93519f
fix uc_mem write with cow when using upper half of the address
PhilippTakacs Jan 15, 2024
5271fde
Removed hook-related code (causes some issues for now).
Jan 19, 2024
ec35d35
Updated all RH850 regs constants files.
May 11, 2023
e7e4abb
Fix the inconsistencies following the rebase on branch dev.
Jan 19, 2024
8eddd0f
Add Rust and Zig bindings for RH850.
Jan 22, 2024
77a09c0
Merge branch 'rh850-arch-fix-ci-new' into rh850-arch
Jan 22, 2024
087b430
Add RH850 constants (mode and arch ID)
Feb 5, 2024
5510fc0
Add Rust arch and mode constants.
Feb 12, 2024
e287d81
Add missing comma.
Feb 12, 2024
ea4b1a5
Add missing match case in lib.rs for RH850 architecture (get/set PC r…
Feb 12, 2024
098a8e5
Add import of rh850 crate.
Feb 12, 2024
2006821
Add missing arch into Cargo.toml and build files.
Feb 12, 2024
1d150b3
Fix wrong CPU model.
Feb 12, 2024
4706798
Fix RH850 mode.
Feb 12, 2024
ab77a27
Add Rust arch and mode constants.
Feb 12, 2024
cfd2f06
Add missing comma.
Feb 12, 2024
63be245
Add missing match case in lib.rs for RH850 architecture (get/set PC r…
Feb 12, 2024
09f0a7b
Add import of rh850 crate.
Feb 12, 2024
3127013
Add missing arch into Cargo.toml and build files.
Feb 12, 2024
69340e6
Fix wrong CPU model.
Feb 12, 2024
cbad50f
Fix RH850 mode.
Feb 12, 2024
f785b3d
Merge branch 'rh850-arch-ci' into rh850-arch
Feb 12, 2024
4e4181d
Remove test bindings.
Feb 12, 2024
76b44f4
Remove python test bindings.
Feb 12, 2024
fedf2fc
Merge branch 'rh850-arch-ci' into rh850-arch
Feb 12, 2024
b115744
Fix the TCG code of V850 SETF instruction.
Mar 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ option(BUILD_SHARED_LIBS "Build shared instead of static library" ${PROJECT_IS_T
option(UNICORN_FUZZ "Enable fuzzing" OFF)
option(UNICORN_BUILD_TESTS "Build unicorn tests" ${PROJECT_IS_TOP_LEVEL})
option(UNICORN_INSTALL "Enable unicorn installation" ${PROJECT_IS_TOP_LEVEL})
set(UNICORN_ARCH "x86;arm;aarch64;riscv;mips;sparc;m68k;ppc;s390x;tricore" CACHE STRING "Enabled unicorn architectures")
set(UNICORN_ARCH "x86;arm;aarch64;riscv;mips;sparc;m68k;ppc;rh850;s390x;tricore" CACHE STRING "Enabled unicorn architectures")
option(UNICORN_TRACER "Trace unicorn execution" OFF)

foreach(ARCH_LOOP ${UNICORN_ARCH})
Expand Down Expand Up @@ -268,6 +268,9 @@ else()
if(UNICORN_HAS_PPC)
set(EXTRA_CFLAGS "${EXTRA_CFLAGS}-DUNICORN_HAS_PPC ")
endif()
if(UNICORN_HAS_RH850)
set(EXTRA_CFLAGS "${EXTRA_CFLAGS}-DUNICORN_HAS_RH850 ")
endif()
if(UNICORN_HAS_RISCV)
set(EXTRA_CFLAGS "${EXTRA_CFLAGS}-DUNICORN_HAS_RISCV ")
endif()
Expand Down Expand Up @@ -315,6 +318,9 @@ else()
if(UNICORN_HAS_PPC)
set(TARGET_LIST "${TARGET_LIST}ppc-softmmu, ppc64-softmmu, ")
endif()
if(UNICORN_HAS_RH850)
set(TARGET_LIST "${TARGET_LIST}rh850-softmmu, ")
endif()
if(UNICORN_HAS_RISCV)
set(TARGET_LIST "${TARGET_LIST}riscv32-softmmu, riscv64-softmmu, ")
endif()
Expand Down Expand Up @@ -399,6 +405,12 @@ else()
OUTPUT_FILE ${CMAKE_BINARY_DIR}/ppc64-softmmu/config-target.h
)
endif()
if(UNICORN_HAS_RH850)
execute_process(COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/qemu/scripts/create_config
INPUT_FILE ${CMAKE_BINARY_DIR}/rh850-softmmu/config-target.mak
OUTPUT_FILE ${CMAKE_BINARY_DIR}/rh850-softmmu/config-target.h
)
endif()
if(UNICORN_HAS_RISCV)
execute_process(COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/qemu/scripts/create_config
INPUT_FILE ${CMAKE_BINARY_DIR}/riscv32-softmmu/config-target.mak
Expand Down Expand Up @@ -1119,6 +1131,36 @@ endif()
endif()


if (UNICORN_HAS_RH850)
add_library(rh850-softmmu STATIC
${UNICORN_ARCH_COMMON}

qemu/target/rh850/cpu.c
qemu/target/rh850/fpu_helper.c
qemu/target/rh850/helper.c
qemu/target/rh850/op_helper.c
qemu/target/rh850/translate.c
qemu/target/rh850/fpu_translate.c
qemu/target/rh850/unicorn.c
)

if(MSVC)
target_compile_options(rh850-softmmu PRIVATE
-DNEED_CPU_H
/FIrh850.h
/I${CMAKE_CURRENT_SOURCE_DIR}/msvc/rh850-softmmu
/I${CMAKE_CURRENT_SOURCE_DIR}/qemu/target/rh850
)
else()
target_compile_options(rh850-softmmu PRIVATE
-DNEED_CPU_H
-include rh850.h
-I${CMAKE_BINARY_DIR}/rh850-softmmu
-I${CMAKE_CURRENT_SOURCE_DIR}/qemu/target/rh850
)
endif()
endif()

set(UNICORN_SRCS
uc.c

Expand Down Expand Up @@ -1266,6 +1308,13 @@ if(UNICORN_HAS_PPC)
target_link_libraries(ppc64-softmmu PRIVATE unicorn-common)
set(UNICORN_TEST_FILE ${UNICORN_TEST_FILE} test_ppc)
endif()
if(UNICORN_HAS_RH850)
set(UNICORN_COMPILE_OPTIONS ${UNICORN_COMPILE_OPTIONS} -DUNICORN_HAS_RH850)
set(UNICORN_LINK_LIBRARIES ${UNICORN_LINK_LIBRARIES} rh850-softmmu rh850-softmmu)
set(UNICORN_SAMPLE_FILE ${UNICORN_SAMPLE_FILE} sample_rh850)
target_link_libraries(rh850-softmmu PRIVATE unicorn-common)
set(UNICORN_TEST_FILE ${UNICORN_TEST_FILE} test_rh850)
endif()
if(UNICORN_HAS_RISCV)
set(UNICORN_COMPILE_OPTIONS ${UNICORN_COMPILE_OPTIONS} -DUNICORN_HAS_RISCV)
set(UNICORN_LINK_LIBRARIES ${UNICORN_LINK_LIBRARIES} riscv32-softmmu riscv64-softmmu)
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pkg-config = { version = "0.3" }
[features]
default = ["arch_all"]
dynamic_linkage = []
arch_all = ["arch_x86", "arch_arm", "arch_aarch64", "arch_riscv", "arch_mips", "arch_sparc", "arch_m68k", "arch_ppc", "arch_s390x", "arch_tricore"]
arch_all = ["arch_x86", "arch_arm", "arch_aarch64", "arch_riscv", "arch_mips", "arch_sparc", "arch_m68k", "arch_ppc", "arch_s390x", "arch_tricore", "arch_rh850"]
arch_x86 = []
arch_arm = []
arch_aarch64 = []
Expand All @@ -53,3 +53,4 @@ arch_m68k = []
arch_ppc = []
arch_s390x = []
arch_tricore = []
arch_rh850 = []
9 changes: 8 additions & 1 deletion bindings/const_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

INCL_DIR = os.path.join('..', 'include', 'unicorn')

include = [ 'arm.h', 'arm64.h', 'mips.h', 'x86.h', 'sparc.h', 'm68k.h', 'ppc.h', 'riscv.h', 's390x.h', 'tricore.h', 'unicorn.h' ]
include = [ 'arm.h', 'arm64.h', 'mips.h', 'x86.h', 'sparc.h', 'm68k.h', 'ppc.h', 'rh850.h', 'riscv.h', 's390x.h', 'tricore.h', 'unicorn.h' ]

template = {
'python': {
Expand All @@ -22,6 +22,7 @@
'sparc.h': 'sparc',
'm68k.h': 'm68k',
'ppc.h': 'ppc',
'rh850.h': 'rh850',
'riscv.h': 'riscv',
's390x.h' : 's390x',
'tricore.h' : 'tricore',
Expand All @@ -43,6 +44,7 @@
'm68k.h': 'm68k',
'ppc.h': 'ppc',
'riscv.h': 'riscv',
'rh850.h': 'rh850',
's390x.h' : 's390x',
'tricore.h' : 'tricore',
'unicorn.h': 'unicorn',
Expand All @@ -62,6 +64,7 @@
'sparc.h': 'sparc',
'm68k.h': 'm68k',
'ppc.h': 'ppc',
'rh850.h': 'rh850',
'riscv.h': 'riscv',
's390x.h' : 's390x',
'tricore.h' : 'tricore',
Expand All @@ -82,6 +85,7 @@
'sparc.h': 'Sparc',
'm68k.h': 'M68k',
'ppc.h': 'Ppc',
'rh850.h': 'Rh850',
'riscv.h': 'Riscv',
's390x.h' : 'S390x',
'tricore.h' : 'TriCore',
Expand All @@ -102,6 +106,7 @@
'sparc.h': 'Sparc',
'm68k.h': 'M68k',
'ppc.h': 'Ppc',
'rh850.h': 'Rh850',
'riscv.h': 'Riscv',
's390x.h' : 'S390x',
'tricore.h' : 'TriCore',
Expand All @@ -122,6 +127,7 @@
'sparc.h': 'Sparc',
'm68k.h': 'M68k',
'ppc.h': 'Ppc',
'rh850.h': 'Rh850',
'riscv.h': 'Riscv',
's390x.h' : 'S390x',
'tricore.h' : 'TriCore',
Expand All @@ -143,6 +149,7 @@
'm68k.h': 'm68k',
'ppc.h': 'ppc',
'riscv.h': 'riscv',
'rh850.h': 'rh850',
's390x.h' : 's390x',
'tricore.h' : 'tricore',
'unicorn.h': 'unicorn',
Expand Down
4 changes: 3 additions & 1 deletion bindings/dotnet/UnicornEngine/Const/Common.fs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module Common =
let UC_ARCH_RISCV = 8
let UC_ARCH_S390X = 9
let UC_ARCH_TRICORE = 10
let UC_ARCH_MAX = 11
let UC_ARCH_RH850 = 11
let UC_ARCH_MAX = 12

let UC_MODE_LITTLE_ENDIAN = 0
let UC_MODE_BIG_ENDIAN = 1073741824
Expand All @@ -55,6 +56,7 @@ module Common =
let UC_MODE_SPARC32 = 4
let UC_MODE_SPARC64 = 8
let UC_MODE_V9 = 16
let UC_MODE_RH850 = 4
let UC_MODE_RISCV32 = 4
let UC_MODE_RISCV64 = 8

Expand Down
99 changes: 99 additions & 0 deletions bindings/dotnet/UnicornEngine/Const/Rh850.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT

namespace UnicornManaged.Const

open System

[<AutoOpen>]
module Rh850 =
let UC_RH850_SYSREG_SELID0 = 32
let UC_RH850_SYSREG_SELID1 = 64
let UC_RH850_SYSREG_SELID2 = 96
let UC_RH850_SYSREG_SELID3 = 128
let UC_RH850_SYSREG_SELID4 = 160
let UC_RH850_SYSREG_SELID5 = 192
let UC_RH850_SYSREG_SELID6 = 224
let UC_RH850_SYSREG_SELID7 = 256

// RH850 global purpose registers

let UC_RH850_REG_R0 = 0
let UC_RH850_REG_R1 = 1
let UC_RH850_REG_R2 = 2
let UC_RH850_REG_R3 = 3
let UC_RH850_REG_R4 = 4
let UC_RH850_REG_R5 = 5
let UC_RH850_REG_R6 = 6
let UC_RH850_REG_R7 = 7
let UC_RH850_REG_R8 = 8
let UC_RH850_REG_R9 = 9
let UC_RH850_REG_R10 = 10
let UC_RH850_REG_R11 = 11
let UC_RH850_REG_R12 = 12
let UC_RH850_REG_R13 = 13
let UC_RH850_REG_R14 = 14
let UC_RH850_REG_R15 = 15
let UC_RH850_REG_R16 = 16
let UC_RH850_REG_R17 = 17
let UC_RH850_REG_R18 = 18
let UC_RH850_REG_R19 = 19
let UC_RH850_REG_R20 = 20
let UC_RH850_REG_R21 = 21
let UC_RH850_REG_R22 = 22
let UC_RH850_REG_R23 = 23
let UC_RH850_REG_R24 = 24
let UC_RH850_REG_R25 = 25
let UC_RH850_REG_R26 = 26
let UC_RH850_REG_R27 = 27
let UC_RH850_REG_R28 = 28
let UC_RH850_REG_R29 = 29
let UC_RH850_REG_R30 = 30
let UC_RH850_REG_R31 = 31

// RH850 system registers, selection ID 0
let UC_RH850_REG_EIPC = 32
let UC_RH850_REG_EIPSW = 33
let UC_RH850_REG_FEPC = 34
let UC_RH850_REG_FEPSW = 35
let UC_RH850_REG_ECR = 36
let UC_RH850_REG_PSW = 37
let UC_RH850_REG_FPSR = 38
let UC_RH850_REG_FPEPC = 39
let UC_RH850_REG_FPST = 40
let UC_RH850_REG_FPCC = 41
let UC_RH850_REG_FPCFG = 42
let UC_RH850_REG_FPEC = 43
let UC_RH850_REG_EIIC = 45
let UC_RH850_REG_FEIC = 46
let UC_RH850_REG_CTPC = 48
let UC_RH850_REG_CTPSW = 49
let UC_RH850_REG_CTBP = 52
let UC_RH850_REG_EIWR = 60
let UC_RH850_REG_FEWR = 61
let UC_RH850_REG_BSEL = 63

// RH850 system regusters, selection ID 1
let UC_RH850_REG_MCFG0 = 64
let UC_RH850_REG_RBASE = 65
let UC_RH850_REG_EBASE = 66
let UC_RH850_REG_INTBP = 67
let UC_RH850_REG_MCTL = 68
let UC_RH850_REG_PID = 69
let UC_RH850_REG_SCCFG = 75
let UC_RH850_REG_SCBP = 76

// RH850 system registers, selection ID 2
let UC_RH850_REG_HTCFG0 = 96
let UC_RH850_REG_MEA = 102
let UC_RH850_REG_ASID = 103
let UC_RH850_REG_MEI = 104
let UC_RH850_REG_PC = 288
let UC_RH850_REG_ENDING = 289

// RH8509 Registers aliases.

let UC_RH850_REG_ZERO = 0
let UC_RH850_REG_SP = 3
let UC_RH850_REG_EP = 30
let UC_RH850_REG_LP = 31

94 changes: 94 additions & 0 deletions bindings/go/unicorn/rh850_const.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package unicorn
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT [rh850_const.go]
const (
RH850_SYSREG_SELID0 = 32
RH850_SYSREG_SELID1 = 64
RH850_SYSREG_SELID2 = 96
RH850_SYSREG_SELID3 = 128
RH850_SYSREG_SELID4 = 160
RH850_SYSREG_SELID5 = 192
RH850_SYSREG_SELID6 = 224
RH850_SYSREG_SELID7 = 256

// RH850 global purpose registers

RH850_REG_R0 = 0
RH850_REG_R1 = 1
RH850_REG_R2 = 2
RH850_REG_R3 = 3
RH850_REG_R4 = 4
RH850_REG_R5 = 5
RH850_REG_R6 = 6
RH850_REG_R7 = 7
RH850_REG_R8 = 8
RH850_REG_R9 = 9
RH850_REG_R10 = 10
RH850_REG_R11 = 11
RH850_REG_R12 = 12
RH850_REG_R13 = 13
RH850_REG_R14 = 14
RH850_REG_R15 = 15
RH850_REG_R16 = 16
RH850_REG_R17 = 17
RH850_REG_R18 = 18
RH850_REG_R19 = 19
RH850_REG_R20 = 20
RH850_REG_R21 = 21
RH850_REG_R22 = 22
RH850_REG_R23 = 23
RH850_REG_R24 = 24
RH850_REG_R25 = 25
RH850_REG_R26 = 26
RH850_REG_R27 = 27
RH850_REG_R28 = 28
RH850_REG_R29 = 29
RH850_REG_R30 = 30
RH850_REG_R31 = 31

// RH850 system registers, selection ID 0
RH850_REG_EIPC = 32
RH850_REG_EIPSW = 33
RH850_REG_FEPC = 34
RH850_REG_FEPSW = 35
RH850_REG_ECR = 36
RH850_REG_PSW = 37
RH850_REG_FPSR = 38
RH850_REG_FPEPC = 39
RH850_REG_FPST = 40
RH850_REG_FPCC = 41
RH850_REG_FPCFG = 42
RH850_REG_FPEC = 43
RH850_REG_EIIC = 45
RH850_REG_FEIC = 46
RH850_REG_CTPC = 48
RH850_REG_CTPSW = 49
RH850_REG_CTBP = 52
RH850_REG_EIWR = 60
RH850_REG_FEWR = 61
RH850_REG_BSEL = 63

// RH850 system regusters, selection ID 1
RH850_REG_MCFG0 = 64
RH850_REG_RBASE = 65
RH850_REG_EBASE = 66
RH850_REG_INTBP = 67
RH850_REG_MCTL = 68
RH850_REG_PID = 69
RH850_REG_SCCFG = 75
RH850_REG_SCBP = 76

// RH850 system registers, selection ID 2
RH850_REG_HTCFG0 = 96
RH850_REG_MEA = 102
RH850_REG_ASID = 103
RH850_REG_MEI = 104
RH850_REG_PC = 288
RH850_REG_ENDING = 289

// RH8509 Registers aliases.

RH850_REG_ZERO = 0
RH850_REG_SP = 3
RH850_REG_EP = 30
RH850_REG_LP = 31
)
Loading
Loading