1f08c3bdfSopenharmony_ci#include "symbol.h" 2f08c3bdfSopenharmony_ci#include "target.h" 3f08c3bdfSopenharmony_ci#include "machine.h" 4f08c3bdfSopenharmony_ci 5f08c3bdfSopenharmony_ci 6f08c3bdfSopenharmony_cistatic int sparc_version; 7f08c3bdfSopenharmony_ci 8f08c3bdfSopenharmony_cistatic void predefine_sparc(const struct target *self) 9f08c3bdfSopenharmony_ci{ 10f08c3bdfSopenharmony_ci predefine("__sparc__", 1, "1"); 11f08c3bdfSopenharmony_ci predefine("__sparc", 1, "1"); 12f08c3bdfSopenharmony_ci predefine_nostd("sparc"); 13f08c3bdfSopenharmony_ci 14f08c3bdfSopenharmony_ci predefine_weak("__sparc_v%d__", sparc_version); 15f08c3bdfSopenharmony_ci predefine_weak("__sparcv%d__", sparc_version); 16f08c3bdfSopenharmony_ci predefine_weak("__sparcv%d", sparc_version); 17f08c3bdfSopenharmony_ci} 18f08c3bdfSopenharmony_ci 19f08c3bdfSopenharmony_ci 20f08c3bdfSopenharmony_cistatic void init_sparc32(const struct target *target) 21f08c3bdfSopenharmony_ci{ 22f08c3bdfSopenharmony_ci fast16_ctype = &int_ctype; 23f08c3bdfSopenharmony_ci ufast16_ctype = &uint_ctype; 24f08c3bdfSopenharmony_ci fast32_ctype = &int_ctype; 25f08c3bdfSopenharmony_ci ufast32_ctype = &uint_ctype; 26f08c3bdfSopenharmony_ci 27f08c3bdfSopenharmony_ci if (!sparc_version) 28f08c3bdfSopenharmony_ci sparc_version = 8; 29f08c3bdfSopenharmony_ci 30f08c3bdfSopenharmony_ci if (arch_os == OS_SUNOS) { 31f08c3bdfSopenharmony_ci wint_ctype = &long_ctype; 32f08c3bdfSopenharmony_ci wchar_ctype = &long_ctype; 33f08c3bdfSopenharmony_ci 34f08c3bdfSopenharmony_ci bits_in_longdouble = 128; 35f08c3bdfSopenharmony_ci max_fp_alignment = 16; 36f08c3bdfSopenharmony_ci 37f08c3bdfSopenharmony_ci funsigned_char = 0; 38f08c3bdfSopenharmony_ci } 39f08c3bdfSopenharmony_ci} 40f08c3bdfSopenharmony_ci 41f08c3bdfSopenharmony_cistatic void predefine_sparc32(const struct target *self) 42f08c3bdfSopenharmony_ci{ 43f08c3bdfSopenharmony_ci predefine_sparc(self); 44f08c3bdfSopenharmony_ci} 45f08c3bdfSopenharmony_ci 46f08c3bdfSopenharmony_ciconst struct target target_sparc32 = { 47f08c3bdfSopenharmony_ci .mach = MACH_SPARC32, 48f08c3bdfSopenharmony_ci .bitness = ARCH_LP32, 49f08c3bdfSopenharmony_ci .big_endian = 1, 50f08c3bdfSopenharmony_ci .unsigned_char = 0, 51f08c3bdfSopenharmony_ci 52f08c3bdfSopenharmony_ci .bits_in_longdouble = 64, 53f08c3bdfSopenharmony_ci .max_fp_alignment = 8, 54f08c3bdfSopenharmony_ci 55f08c3bdfSopenharmony_ci .init = init_sparc32, 56f08c3bdfSopenharmony_ci .target_64bit = &target_sparc64, 57f08c3bdfSopenharmony_ci 58f08c3bdfSopenharmony_ci .predefine = predefine_sparc32, 59f08c3bdfSopenharmony_ci}; 60f08c3bdfSopenharmony_ci 61f08c3bdfSopenharmony_ci 62f08c3bdfSopenharmony_cistatic void init_sparc64(const struct target *target) 63f08c3bdfSopenharmony_ci{ 64f08c3bdfSopenharmony_ci if (!sparc_version) 65f08c3bdfSopenharmony_ci sparc_version = 9; 66f08c3bdfSopenharmony_ci} 67f08c3bdfSopenharmony_ci 68f08c3bdfSopenharmony_cistatic void predefine_sparc64(const struct target *self) 69f08c3bdfSopenharmony_ci{ 70f08c3bdfSopenharmony_ci predefine("__sparc64__", 1, "1"); 71f08c3bdfSopenharmony_ci predefine("__arch64__", 1, "1"); 72f08c3bdfSopenharmony_ci 73f08c3bdfSopenharmony_ci predefine_sparc(self); 74f08c3bdfSopenharmony_ci} 75f08c3bdfSopenharmony_ci 76f08c3bdfSopenharmony_ciconst struct target target_sparc64 = { 77f08c3bdfSopenharmony_ci .mach = MACH_SPARC64, 78f08c3bdfSopenharmony_ci .bitness = ARCH_LP64, 79f08c3bdfSopenharmony_ci .big_endian = 1, 80f08c3bdfSopenharmony_ci .unsigned_char = 0, 81f08c3bdfSopenharmony_ci .has_int128 = 1, 82f08c3bdfSopenharmony_ci 83f08c3bdfSopenharmony_ci .target_32bit = &target_sparc32, 84f08c3bdfSopenharmony_ci 85f08c3bdfSopenharmony_ci .init = init_sparc64, 86f08c3bdfSopenharmony_ci .predefine = predefine_sparc64, 87f08c3bdfSopenharmony_ci}; 88