Files
Philippe Mathieu-Daudé 66a188dff8 include: Remove TARGET_LONG_SIZE definition
All the code base uses TARGET_LONG_BITS,
remove TARGET_LONG_SIZE as unnecessary.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-ID: <20261007232326.66240-11-philmd@oss.qualcomm.com>
2026-10-24 11:48:29 +02:00

43 lines
1.0 KiB
C

/*
* Target Long Definitions
*
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2023 Linaro Ltd
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _TARGET_LONG_H_
#define _TARGET_LONG_H_
/*
* Usually this should only be included via cpu-defs.h however for
* certain cases where we want to build only two versions of a binary
* object we can include directly. However the build-system must
* ensure TARGET_LONG_BITS is defined directly.
*/
#ifndef TARGET_LONG_BITS
#error TARGET_LONG_BITS not defined
#endif
/* target_ulong is the type of a virtual address */
#if TARGET_LONG_BITS == 32
typedef int32_t target_long;
typedef uint32_t target_ulong;
#define TARGET_FMT_lx "%08x"
#define TARGET_FMT_ld "%d"
#define TARGET_FMT_lu "%u"
#define MO_TL MO_32
#elif TARGET_LONG_BITS == 64
typedef int64_t target_long;
typedef uint64_t target_ulong;
#define TARGET_FMT_lx "%016" PRIx64
#define TARGET_FMT_ld "%" PRId64
#define TARGET_FMT_lu "%" PRIu64
#define MO_TL MO_64
#else
#error TARGET_LONG_BITS invalid
#endif
#endif /* _TARGET_LONG_H_ */