Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163239960
D41471.id126041.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41471.id126041.diff
View Options
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -138,7 +138,7 @@
/* Stacks for AP initialization, discarded once idle threads are started. */
void *bootstack;
-static void *bootstacks[MAXCPU - 1];
+static void **bootstacks;
/* Count of started APs, used to synchronize access to bootstack. */
static volatile int aps_started;
@@ -319,6 +319,7 @@
if (bootstacks[cpu - 1] != NULL)
kmem_free(bootstacks[cpu - 1], MP_BOOTSTACK_SIZE);
}
+ kmem_free(bootstacks, mp_maxid * sizeof(*bootstacks));
}
SYSINIT(smp_after_idle_runnable, SI_SUB_SMP, SI_ORDER_ANY,
smp_after_idle_runnable, NULL);
@@ -774,6 +775,13 @@
mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN);
+ /*
+ * Allocate pointers for the noot stacks. We have already allocated
+ * the stack for CPU0. As we need a pointer for stacks 1 to mp_maxid
+ * we need an array suze of mp_maxid.
+ */
+ bootstacks = kmem_malloc(mp_maxid * sizeof(*bootstacks), M_WAITOK);
+
/* CPU 0 is always boot CPU. */
CPU_SET(0, &all_cpus);
mpidr = READ_SPECIALREG(mpidr_el1) & CPU_AFF_MASK;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 22, 8:22 AM (4 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35356207
Default Alt Text
D41471.id126041.diff (1 KB)
Attached To
Mode
D41471: arm64: Dynamically allocate the boot stack pointers
Attached
Detach File
Event Timeline
Log In to Comment