aboutsummaryrefslogtreecommitdiffstats
path: root/meta-xilinx-bsp/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch
blob: 15124c1b7eeabd483c8aeda521b20b5140430f9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

BINPATH=$(dirname $0)
MACHINE_PATH=$(mktemp -d)

APU_ARGS=
PMU_ARGS=

while [ ! -z "$1" ]; do
	if [ "$1" = "-pmu-args" ]; then
		PMU_ARGS+=" $2"
		shift
	else
		APU_ARGS+=" $1"
	fi
	shift
done

PMU_ROM=$(last=; for i in $PMU_ARGS; do if [ "$last" = "-kernel" ]; then echo "$i"; break; fi; last=$i; done)
if [ ! -e $PMU_ROM ]; then
	echo "------"
	echo "Error: Missing PMU ROM - $PMU_ROM"
	echo "    See 'meta-xilinx/README.qemu.md' for more information on accquiring the PMU ROM."
	echo "------"
	exit 255
fi

# start the PMU instance
$BINPATH/qemu-system-microblazeel $PMU_ARGS -machine-path $MACHINE_PATH &
# start the APU instance
$BINPATH/qemu-system-aarch64 $APU_ARGS -machine-path $MACHINE_PATH