aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit via Bug reports for the GNU Hurd <bug-hurd@gnu.org>2024-12-07 10:12:34 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-07 12:02:12 +0100
commit7da2d8a6182bf258a2a6b415858419073b94d76a (patch)
tree00c5d60c967631fbe516a7b55cf5bf7a66c425f3
parentaf37e94a41d9da3d63d03818be70c1df62441f2a (diff)
downloadgnumach-7da2d8a6182bf258a2a6b415858419073b94d76a.tar.gz
gnumach-7da2d8a6182bf258a2a6b415858419073b94d76a.tar.bz2
gnumach-7da2d8a6182bf258a2a6b415858419073b94d76a.zip
mp_desc: Add assert for AP having non-zero cpu number
Non-master processors cannot have cpu_number() == 0. The synchronisation fails hard if the cpu number is wrong. Alert the condition if this is the case. (On AMD fam15h, this assert currently fails, but I haven't been able to boot it with smp yet either). Message-ID: <20241207101222.800350-1-damien@zamaudio.com>
-rw-r--r--i386/i386/mp_desc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c
index 61a7607b..5fff2a68 100644
--- a/i386/i386/mp_desc.c
+++ b/i386/i386/mp_desc.c
@@ -24,6 +24,7 @@
* the rights to redistribute these changes.
*/
+#include <kern/assert.h>
#include <kern/cpu_number.h>
#include <kern/debug.h>
#include <kern/printf.h>
@@ -280,6 +281,8 @@ cpu_ap_main()
{
int cpu = cpu_number();
+ assert(cpu > 0);
+
do {
cpu_pause();
} while (bspdone != cpu);