Skip to content

Commit

Permalink
[AArch64] Improved CPU topology based on MPIDR.MT
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Feb 3, 2024
1 parent cc2fcfd commit 54d1761
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions aarch64/corefreq-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -4417,12 +4417,12 @@ void Instructions(unsigned int iter)
ASCII* Topology_Std(char *pStr, unsigned int cpu)
{
if (RO(Shm)->Cpu[cpu].Topology.BSP) {
StrFormat(&pStr[ 0], 4+(2*11)+1, "%03u:BSP%5d\x20",
StrFormat(&pStr[ 0], 4+(2*11)+1, "%03u:BSP%5X\x20",
cpu,
RO(Shm)->Cpu[cpu].Topology.MPID);
return RSC(TOPOLOGY_BSP_COMM).CODE();
} else {
StrFormat(&pStr[ 0], 1+(3*11)+1, "%03u:%3d%5d\x20",
StrFormat(&pStr[ 0], 1+(3*11)+1, "%03u:%3d%5X\x20",
cpu,
RO(Shm)->Cpu[cpu].Topology.PackageID,
RO(Shm)->Cpu[cpu].Topology.MPID);
Expand Down
13 changes: 9 additions & 4 deletions aarch64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1505,12 +1505,17 @@ static void Map_Generic_Topology(void *arg)
:
: "memory"
);
Core->T.MPID = mpid.value & 0xfffff;
Core->T.Cluster.CMP = mpid.Aff3;
Core->T.PackageID = mpid.Aff2;
Core->T.CoreID = mpid.Aff1;
if (mpid.MT) {
Core->T.MPID = mpid.value & 0xfffff;
Core->T.Cluster.CMP = mpid.Aff3;
Core->T.PackageID = mpid.Aff2;
Core->T.CoreID = mpid.Aff1;
Core->T.ThreadID = mpid.Aff0;
} else {
Core->T.MPID = mpid.value & 0xfffff;
Core->T.PackageID = mpid.Aff2;
Core->T.Cluster.CMP = mpid.Aff1;
Core->T.CoreID = mpid.Aff0;
}
Cache_Topology(Core);
}
Expand Down

0 comments on commit 54d1761

Please sign in to comment.