Skip to content

Commit

Permalink
[AArch64] Split GIC in version and fraction bits
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Feb 19, 2024
1 parent fc9f470 commit 6bbbb75
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
6 changes: 4 additions & 2 deletions aarch64/corefreq-cli-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,10 @@ void JsonSysInfo(RO(SHM_STRUCT) *RO(Shm))
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.FP);
json_key(&s, "SIMD");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.SIMD);
json_key(&s, "GIC");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.GIC);
json_key(&s, "GIC_vers");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.GIC_vers);
json_key(&s, "GIC_frac");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.GIC_frac);
json_key(&s, "SVE");
json_literal(&s, "%u", (unsigned) RO(Shm)->Proc.Features.SVE);
json_key(&s, "DIT");
Expand Down
10 changes: 7 additions & 3 deletions aarch64/corefreq-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2080,10 +2080,14 @@ REASON_CODE SysInfoFeatures( Window *win,
},
{
NULL,
RO(Shm)->Proc.Features.GIC == 1,
( RO(Shm)->Proc.Features.GIC_vers
+ RO(Shm)->Proc.Features.GIC_frac ) > 0,
attr_Feat,
2, "%s%.*sGIC [%7s]", RSC(FEATURES_GIC).CODE(),
width - 18 - RSZ(FEATURES_GIC),
2, RO(Shm)->Proc.Features.GIC_vers ?
RO(Shm)->Proc.Features.GIC_frac ?
"%s v4.1%.*sGIC [%7s]" : "%s v3.0%.*sGIC [%7s]"
"%s %.*sGIC [%7s]" : "%s %.*sGIC [%7s]",
RSC(FEATURES_GIC).CODE(), width - 23 - RSZ(FEATURES_GIC),
NULL
},
{
Expand Down
9 changes: 6 additions & 3 deletions aarch64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,13 +939,16 @@ static void Query_Features(void *pArg)
break;
}
switch (pfr0.GIC) {
case 0b0001:
case 0b0011:
iArg->Features->GIC = 1;
iArg->Features->GIC_frac = 1;
fallthrough;
case 0b0001:
iArg->Features->GIC_vers = 1;
break;
case 0b0000:
default:
iArg->Features->GIC = 0;
iArg->Features->GIC_frac = \
iArg->Features->GIC_vers = 0;
break;
}
switch (pfr0.SVE) {
Expand Down
5 changes: 3 additions & 2 deletions aarch64/coretypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ typedef struct /* BSP features. */
RAND : 8-7,
FP : 9-8,
SIMD : 10-9,
GIC : 11-10,
GIC_vers : 11-10,
SVE : 12-11,
VHE : 13-12,
SME : 14-13,
Expand Down Expand Up @@ -827,7 +827,8 @@ typedef struct /* BSP features. */
FlagM : 40-39,
FlagM2 : 41-40,
PMULL : 42-41,
_Unused1_ : 64-42;
GIC_frac : 43-42,
_Unused1_ : 64-43;

Bit64 CSV2 : 4-0,
SSBS : 8-4,
Expand Down

0 comments on commit 6bbbb75

Please sign in to comment.