Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH v3] api: sysinfo: add new ARMv8 and v9 enumerations #1929

Merged
merged 4 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions example/sysinfo/odp_sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,18 @@ static const char *arm_isa(odp_cpu_arch_arm_t isa)
return "ARMv8.6-A";
case ODP_CPU_ARCH_ARMV8_7:
return "ARMv8.7-A";
case ODP_CPU_ARCH_ARMV8_8:
return "ARMv8.8-A";
case ODP_CPU_ARCH_ARMV8_9:
return "ARMv8.9-A";
case ODP_CPU_ARCH_ARMV9_0:
return "ARMv9.0-A";
case ODP_CPU_ARCH_ARMV9_1:
return "ARMv9.1-A";
case ODP_CPU_ARCH_ARMV9_2:
return "ARMv9.2-A";
case ODP_CPU_ARCH_ARMV9_3:
return "ARMv9.3-A";
default:
return "Unknown";
}
Expand Down
9 changes: 9 additions & 0 deletions include/odp/api/spec/system_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ typedef enum odp_cpu_arch_arm_t {
/** ARMv8.7-A ISA */
ODP_CPU_ARCH_ARMV8_7,

/** ARMv8.8-A ISA */
ODP_CPU_ARCH_ARMV8_8,

/** ARMv8.9-A ISA */
ODP_CPU_ARCH_ARMV8_9,

/** ARMv9.0-A ISA */
ODP_CPU_ARCH_ARMV9_0,

Expand All @@ -97,6 +103,9 @@ typedef enum odp_cpu_arch_arm_t {
/** ARMv9.2-A ISA */
ODP_CPU_ARCH_ARMV9_2,

/** ARMv9.3-A ISA */
ODP_CPU_ARCH_ARMV9_3,

} odp_cpu_arch_arm_t;

/**
Expand Down
6 changes: 6 additions & 0 deletions platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ static odp_cpu_arch_arm_t arm_isa_version(void)
return ODP_CPU_ARCH_ARMV8_6;
case 7:
return ODP_CPU_ARCH_ARMV8_7;
case 8:
return ODP_CPU_ARCH_ARMV8_8;
case 9:
return ODP_CPU_ARCH_ARMV8_9;
default:
return ODP_CPU_ARCH_ARM_UNKNOWN;
}
Expand All @@ -274,6 +278,8 @@ static odp_cpu_arch_arm_t arm_isa_version(void)
return ODP_CPU_ARCH_ARMV9_1;
case 2:
return ODP_CPU_ARCH_ARMV9_2;
case 3:
return ODP_CPU_ARCH_ARMV9_3;
default:
return ODP_CPU_ARCH_ARM_UNKNOWN;
}
Expand Down
12 changes: 12 additions & 0 deletions test/validation/api/system/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,12 +534,18 @@ static void system_test_info(void)
printf(" ODP_CPU_ARCH_ARMV8_6\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV8_7)
printf(" ODP_CPU_ARCH_ARMV8_7\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV8_8)
printf(" ODP_CPU_ARCH_ARMV8_8\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV8_9)
printf(" ODP_CPU_ARCH_ARMV8_9\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_0)
printf(" ODP_CPU_ARCH_ARMV9_0\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_1)
printf(" ODP_CPU_ARCH_ARMV9_1\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_2)
printf(" ODP_CPU_ARCH_ARMV9_2\n");
else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_3)
printf(" ODP_CPU_ARCH_ARMV9_3\n");
else
CU_FAIL("Unknown CPU ISA SW ARCH found!");

Expand All @@ -566,12 +572,18 @@ static void system_test_info(void)
printf(" ODP_CPU_ARCH_ARMV8_6\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV8_7)
printf(" ODP_CPU_ARCH_ARMV8_7\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV8_8)
printf(" ODP_CPU_ARCH_ARMV8_8\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV8_9)
printf(" ODP_CPU_ARCH_ARMV8_9\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_0)
printf(" ODP_CPU_ARCH_ARMV9_0\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_1)
printf(" ODP_CPU_ARCH_ARMV9_1\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_2)
printf(" ODP_CPU_ARCH_ARMV9_2\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_3)
printf(" ODP_CPU_ARCH_ARMV9_3\n");
else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARM_UNKNOWN)
printf(" ODP_CPU_ARCH_ARM_UNKNOWN\n");
else
Expand Down