Add an AArch64 simulator to GDB.

sim	* configure.tgt: Add aarch64 entry.
	* configure: Regenerate.
	* sim/aarch64/configure.ac: New configure template.
	* sim/aarch64/aclocal.m4: Generate.
	* sim/aarch64/config.in: Generate.
	* sim/aarch64/configure: Generate.
	* sim/aarch64/cpustate.c: New file - functions for accessing
	AArch64 registers.
	* sim/aarch64/cpustate.h: New header.
	* sim/aarch64/decode.h: New header.
	* sim/aarch64/interp.c: New file - interface between GDB and
	simulator.
	* sim/aarch64/Makefile.in: New makefile template.
	* sim/aarch64/memory.c: New file - functions for simulating
	aarch64 memory accesses.
	* sim/aarch64/memory.h: New header.
	* sim/aarch64/sim-main.h: New header.
	* sim/aarch64/simulator.c: New file - aarch64 simulator
	functions.
	* sim/aarch64/simulator.h: New header.

include/gdb * sim-aarch64.h: New file.

sim/test * configure: Regenerate.
	* sim/aarch64: New directory.
This commit is contained in:
Nick Clifton
2015-11-24 08:47:59 +00:00
parent 351e610191
commit 2e8cf49e13
25 changed files with 31452 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
2015-11-24 Nick Clifton <nickc@redhat.com>
* configure: Regenerate.
* sim/aarch64: New directory.
2015-11-14 Mike Frysinger <vapier@gentoo.org>
* lib/sim-defs.exp (slurp_options): Pull in global subdir/srcdir.

View File

@@ -1827,6 +1827,9 @@ sim_common=yes
sim_igen=no
sim_arch=
case "${target}" in
aarch64*-*-*)
sim_arch=aarch64
;;
arm*-*-*)
sim_arch=arm
;;

View File

@@ -0,0 +1,3 @@
2015-11-24 Nick Clifton <nickc@redhat.com>
* pass.s, allinsn.exp, testutils.inc: New files.

View File

@@ -0,0 +1,15 @@
# AArch64 simulator testsuite
if [istarget aarch64*-*] {
# all machines
set all_machs "aarch64"
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
# If we're only testing specific files and this isn't one of them,
# skip it.
if ![runtest_file_p $runtests $src] {
continue
}
run_sim_test $src $all_machs
}
}

View File

@@ -0,0 +1,7 @@
# check that the sim doesn't die immediately.
# mach: aarch64
.include "testutils.inc"
start
pass

View File

@@ -0,0 +1,72 @@
# MACRO: exit
# Terminates execution.
.macro exit nr
stp x29, x30, [sp,#-32]!
mov x4, #0x26
mov x7, #\nr
mov x29, sp
movk x4, #0x2, lsl #16
add x1, x29, #0x10
str x4, [x29,#16]
str x7, [x29,#24]
mov w0, #0x18
hlt #0xf000
.endm
# MACRO: swiwrite
# Writes the string in X1 to stdout
.macro swiwrite len
stp x29, x30, [sp,#-48]!
mov x0, #1
mov x2, #\len
mov x29, sp
str x0, [x29,#24]
str x1, [x29,#32]
str x2, [x29,#40]
mov w0, #0x5
add x1, x29, #0x18
hlt #0xf000
ldp x29, x30, [sp],#48
ret
.endm
# MACRO: pass
# Write 'pass' to stdout and quit
.macro pass
adrp x1, .Lpass
add x1, x1, :lo12:.Lpass
swiwrite 5
exit 0
.data
.Lpass:
.asciz "pass\n"
.endm
# MACRO: fail
# Write 'fail' to stdout and quit
.macro fail
adrp x1, .Lfail
add x1, x1, :lo12:.Lfail
swiwrite 5
exit 0
.data
.Lfail:
.asciz "fail\n"
.endm
# MACRO: start
# All assembler tests should start with a call to "start"
.macro start
.text
.global _start
_start:
.endm