mirror of
				https://gitlab.com/qemu-project/qemu.git
				synced 2025-10-30 07:57:14 +08:00 
			
		
		
		
	 749c21cf6d
			
		
	
	749c21cf6d
	
	
	
		
			
			Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250708215320.70426-6-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
		
			
				
	
	
		
			55 lines
		
	
	
		
			1008 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1008 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * QEMU target info helpers
 | |
|  *
 | |
|  *  Copyright (c) Linaro
 | |
|  *
 | |
|  * SPDX-License-Identifier: GPL-2.0-or-later
 | |
|  */
 | |
| 
 | |
| #include "qemu/osdep.h"
 | |
| #include "qemu/target-info.h"
 | |
| #include "qemu/target-info-qapi.h"
 | |
| #include "qemu/target-info-impl.h"
 | |
| #include "qapi/error.h"
 | |
| 
 | |
| const char *target_name(void)
 | |
| {
 | |
|     return target_info()->target_name;
 | |
| }
 | |
| 
 | |
| unsigned target_long_bits(void)
 | |
| {
 | |
|     return target_info()->long_bits;
 | |
| }
 | |
| 
 | |
| SysEmuTarget target_arch(void)
 | |
| {
 | |
|     SysEmuTarget arch = target_info()->target_arch;
 | |
| 
 | |
|     if (arch == SYS_EMU_TARGET__MAX) {
 | |
|         arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
 | |
|                                &error_abort);
 | |
|     }
 | |
|     return arch;
 | |
| }
 | |
| 
 | |
| const char *target_cpu_type(void)
 | |
| {
 | |
|     return target_info()->cpu_type;
 | |
| }
 | |
| 
 | |
| const char *target_machine_typename(void)
 | |
| {
 | |
|     return target_info()->machine_typename;
 | |
| }
 | |
| 
 | |
| EndianMode target_endian_mode(void)
 | |
| {
 | |
|     return target_info()->endianness;
 | |
| }
 | |
| 
 | |
| bool target_big_endian(void)
 | |
| {
 | |
|     return target_endian_mode() == ENDIAN_MODE_BIG;
 | |
| }
 |