qemu

FORK: QEMU emulator
git clone https://git.neptards.moe/neptards/qemu.git
Log | Files | Refs | Submodules | LICENSE

test-shadow-1.S (736B)


      1 /*
      2  * Regression test for TCG indirect global lowering.
      3  *
      4  * Copyright Linaro Ltd 2022
      5  * SPDX-License-Identifier: GPL-2.0-or-later
      6  */
      7 
      8 #include "semicall.h"
      9 
     10 	.text
     11 	.set noat
     12 	.align	2
     13 	.globl	main
     14 	.type	main, @function
     15 
     16 main:
     17 	/* Initialize r0 in shadow register set 1. */
     18 	movhi	at, 1			/* PRS=1, CRS=0, RSIE=0, PIE=0 */
     19 	wrctl	status, at
     20 	wrprs	zero, zero
     21 
     22 	/* Change current register set to 1. */
     23 	movi	at, 1 << 10		/* PRS=0, CRS=1, RSIE=0, PIE=0 */
     24 	wrctl	estatus, at
     25 	movia	ea, 1f
     26 	eret
     27 
     28 	/* Load address for callr, then end TB. */
     29 1:	movia	at, 3f
     30 	br	2f
     31 
     32 	/* Test case! TCG abort on indirect lowering across brcond. */
     33 2:	callr	at
     34 
     35 	/* exit(0) */
     36 3:	movi	r4, HOSTED_EXIT
     37 	movi	r5, 0
     38 	semihosting_call
     39 
     40 	.size	main, . - main