fix bug of smp startup from Wa_Weigen and Huang_Yuqing

it is OK
This commit is contained in:
xuedongliang
2021-05-18 18:39:13 +08:00
5 changed files with 35 additions and 22 deletions
+2 -2
View File
@@ -70,13 +70,13 @@ _begin:
j Kd233Start j Kd233Start
#ifdef ARCH_SMP
.data .data
.globl cpu2_boot_flag .globl cpu2_boot_flag
.align 3 .align 3
cpu2_boot_flag: cpu2_boot_flag:
.8byte 0 .8byte 0
#endif
.section .text.entry .section .text.entry
.align 2 .align 2
+8 -5
View File
@@ -84,14 +84,17 @@ void Kd233Start(uint32_t mhartid)
/*kernel start entry*/ /*kernel start entry*/
entry(); entry();
break; break;
#ifdef ARCH_SMP
case CPU1: case CPU1:
while(0x2018050420191010 != cpu2_boot_flag) { ///< waiting for boot flag ,then start cpu1 core while(0x2018050420191010 != cpu2_boot_flag) { ///< waiting for boot flag ,then start cpu1 core
#ifndef ARCH_SMP
} asm volatile("wfi");
SecondaryCpuCStart();
break;
#endif #endif
}
#ifdef ARCH_SMP
SecondaryCpuCStart();
#endif
break;
default: default:
break; break;
} }
+9 -5
View File
@@ -82,14 +82,18 @@ void Kd233Start(uint32_t mhartid)
/*kernel start entry*/ /*kernel start entry*/
entry(); entry();
break; break;
#ifdef ARCH_SMP
case CPU1: case CPU1:
while(0x2018050420191010 != cpu2_boot_flag) { ///< waiting for boot flag ,then start cpu1 core while(0x2018050420191010 != cpu2_boot_flag) { ///< waiting for boot flag ,then start cpu1 core
#ifndef ARCH_SMP
} asm volatile("wfi");
SecondaryCpuCStart();
break;
#endif #endif
}
#ifdef ARCH_SMP
SecondaryCpuCStart();
#endif
break;
default: default:
break; break;
} }
+8 -5
View File
@@ -81,14 +81,17 @@ void Kd233Start(uint32_t mhartid)
/*kernel start entry*/ /*kernel start entry*/
entry(); entry();
break; break;
#ifdef ARCH_SMP
case CPU1: case CPU1:
while(0x2018050420191010 != cpu2_boot_flag) { ///< waiting for boot flag ,then start cpu1 core while(0x2018050420191010 != cpu2_boot_flag) { ///< waiting for boot flag ,then start cpu1 core
#ifndef ARCH_SMP
} asm volatile("wfi");
SecondaryCpuCStart();
break;
#endif #endif
}
#ifdef ARCH_SMP
SecondaryCpuCStart();
#endif
break;
default: default:
break; break;
} }
+8 -5
View File
@@ -77,14 +77,17 @@ void Kd233Start(uint32_t mhartid)
/*kernel start entry*/ /*kernel start entry*/
entry(); entry();
break; break;
#ifdef ARCH_SMP
case CPU1: case CPU1:
while(0x2018050420191010 != cpu2_boot_flag) { ///< waiting for boot flag ,then start cpu1 core while(0x2018050420191010 != cpu2_boot_flag) { ///< waiting for boot flag ,then start cpu1 core
#ifndef ARCH_SMP
} asm volatile("wfi");
SecondaryCpuCStart();
break;
#endif #endif
}
#ifdef ARCH_SMP
SecondaryCpuCStart();
#endif
break;
default: default:
break; break;
} }