Skip to content

Commit

Permalink
Fix ASN1 mem leak, some bugs with DTB logic, and other things
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualEhrmanntraut committed Oct 14, 2024
1 parent 5777edf commit 49da493
Show file tree
Hide file tree
Showing 17 changed files with 407 additions and 405 deletions.
14 changes: 7 additions & 7 deletions hw/arm/apple-silicon/a13.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ static uint64_t apple_a13_ipi_read_sr(CPUARMState *env, const ARMCPRegInfo *ri)
{
AppleA13State *tcpu = APPLE_A13(env_archcpu(env));

g_assert(env_archcpu(env)->mp_affinity == tcpu->mpidr);
g_assert_cmphex(env_archcpu(env)->mp_affinity, ==, tcpu->mpidr);
return tcpu->ipi_sr;
}

Expand Down Expand Up @@ -654,15 +654,15 @@ AppleA13State *apple_a13_cpu_create(DTBNode *node, char *name, uint32_t cpu_id,
dev->id = g_strdup((char *)prop->value);

prop = find_dtb_prop(node, "cpu-id");
g_assert(prop->length == 4);
g_assert_cmpuint(prop->length, ==, 4);
tcpu->cpu_id = *(unsigned int *)prop->value;

prop = find_dtb_prop(node, "reg");
g_assert(prop->length == 4);
g_assert_cmpuint(prop->length, ==, 4);
tcpu->phys_id = *(unsigned int *)prop->value;

prop = find_dtb_prop(node, "cluster-id");
g_assert(prop->length == 4);
g_assert_cmpuint(prop->length, ==, 4);
tcpu->cluster_id = *(unsigned int *)prop->value;
} else {
dev->id = g_strdup(name);
Expand Down Expand Up @@ -744,7 +744,7 @@ AppleA13State *apple_a13_cpu_create(DTBNode *node, char *name, uint32_t cpu_id,
if (node) {
prop = find_dtb_prop(node, "cpu-impl-reg");
if (prop) {
g_assert(prop->length == 16);
g_assert_cmpuint(prop->length, ==, 16);

reg = (uint64_t *)prop->value;

Expand All @@ -757,7 +757,7 @@ AppleA13State *apple_a13_cpu_create(DTBNode *node, char *name, uint32_t cpu_id,

prop = find_dtb_prop(node, "coresight-reg");
if (prop) {
g_assert(prop->length == 16);
g_assert_cmpuint(prop->length, ==, 16);

reg = (uint64_t *)prop->value;

Expand All @@ -770,7 +770,7 @@ AppleA13State *apple_a13_cpu_create(DTBNode *node, char *name, uint32_t cpu_id,

prop = find_dtb_prop(node, "cpm-impl-reg");
if (prop) {
g_assert(prop->length == 16);
g_assert_cmpuint(prop->length, ==, 16);
memcpy(tcpu->cluster_reg, prop->value, 16);
}
}
Expand Down
8 changes: 4 additions & 4 deletions hw/arm/apple-silicon/a9.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ AppleA9State *apple_a9_create(DTBNode *node, char *name, uint32_t cpu_id,
dev->id = g_strdup((char *)prop->value);

prop = find_dtb_prop(node, "cpu-id");
g_assert(prop->length == 4);
g_assert_cmpuint(prop->length, ==, 4);
tcpu->cpu_id = *(unsigned int *)prop->value;

prop = find_dtb_prop(node, "reg");
g_assert(prop->length == 4);
g_assert_cmpuint(prop->length, ==, 4);
tcpu->phys_id = *(unsigned int *)prop->value;
} else {
dev->id = g_strdup(name);
Expand Down Expand Up @@ -238,7 +238,7 @@ AppleA9State *apple_a9_create(DTBNode *node, char *name, uint32_t cpu_id,
if (node) {
prop = find_dtb_prop(node, "cpu-impl-reg");
if (prop) {
g_assert(prop->length == 16);
g_assert_cmpuint(prop->length, ==, 16);

reg = (uint64_t *)prop->value;

Expand All @@ -251,7 +251,7 @@ AppleA9State *apple_a9_create(DTBNode *node, char *name, uint32_t cpu_id,

prop = find_dtb_prop(node, "coresight-reg");
if (prop) {
g_assert(prop->length == 16);
g_assert_cmpuint(prop->length, ==, 16);

reg = (uint64_t *)prop->value;

Expand Down
Loading

0 comments on commit 49da493

Please sign in to comment.