Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
apple_a13.c: implements resetfn for cluster registers
Browse files Browse the repository at this point in the history
  • Loading branch information
TrungNguyen1909 committed Apr 10, 2022
1 parent 9e0db8d commit 4b4f2d4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions hw/arm/apple_a13.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
.opc1 = p_op1, .opc2 = p_op2, .access = p_access, .type = ARM_CP_IO, \
.state = ARM_CP_STATE_AA64, .readfn = apple_a13_cluster_cpreg_read, \
.writefn = apple_a13_cluster_cpreg_write, \
.resetfn = apple_a13_cluster_cpreg_reset, \
.fieldoffset = offsetof(AppleA13Cluster, A13_CPREG_VAR_NAME(p_name)) \
}

Expand Down Expand Up @@ -170,6 +171,18 @@ static void apple_a13_cluster_cpreg_write(CPUARMState *env,
*(uint64_t *)((char *)(c) + (ri)->fieldoffset) = value;
}

static void apple_a13_cluster_cpreg_reset(CPUARMState *env,
const ARMCPRegInfo *ri)
{
AppleA13State *tcpu = APPLE_A13(env_archcpu(env));
AppleA13Cluster *c = apple_a13_find_cluster(tcpu->cluster_id);

if (unlikely(!c)) {
return;
}
*(uint64_t *)((char *)(c) + (ri)->fieldoffset) = ri->resetvalue;
}

/* Deliver IPI */
static void apple_a13_cluster_deliver_ipi(AppleA13Cluster *c, uint64_t cpu_id,
uint64_t src_cpu, uint64_t flag)
Expand Down

0 comments on commit 4b4f2d4

Please sign in to comment.