+;-------------------------------------------------------------------------------------\r
+; AsmRelocateApLoop (MwaitSupport, ApTargetCState, PmCodeSegment);\r
+;-------------------------------------------------------------------------------------\r
+global ASM_PFX(AsmRelocateApLoop)\r
+ASM_PFX(AsmRelocateApLoop):\r
+AsmRelocateApLoopStart:\r
+ cmp byte [esp + 4], 1\r
+ jnz HltLoop\r
+MwaitLoop:\r
+ mov eax, esp\r
+ xor ecx, ecx\r
+ xor edx, edx\r
+ monitor\r
+ mov eax, [esp + 8] ; Mwait Cx, Target C-State per eax[7:4]\r
+ shl eax, 4\r
+ mwait\r
+ jmp MwaitLoop\r
+HltLoop:\r
+ cli\r
+ hlt\r
+ jmp HltLoop\r
+ ret\r
+AsmRelocateApLoopEnd:\r
+\r