mirror of
				https://github.com/qemu/qemu.git
				synced 2025-10-31 20:44:16 +00:00 
			
		
		
		
	 486e58b188
			
		
	
	
		486e58b188
		
	
	
	
	
		
			
			There are linux-user users of semihosting so we'd better check things work for them as well. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
		
			
				
	
	
		
			28 lines
		
	
	
		
			454 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			454 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * linux-user semihosting console
 | |
|  *
 | |
|  * Copyright (c) 2019
 | |
|  * Written by Alex Bennée <alex.bennee@linaro.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: GPL-3.0-or-later
 | |
|  */
 | |
| 
 | |
| #include <stdio.h>
 | |
| #include <stdint.h>
 | |
| #include "semicall.h"
 | |
| 
 | |
| int main(void)
 | |
| {
 | |
|     char c;
 | |
| 
 | |
|     printf("Semihosting Console Test\n");
 | |
|     printf("hit X to exit:");
 | |
| 
 | |
|     do {
 | |
|         c = __semi_call(SYS_READC, 0);
 | |
|         printf("got '%c'\n", c);
 | |
|     } while (c != 'X');
 | |
| 
 | |
|     return 0;
 | |
| }
 |