X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Kernel%2Farch%2Fx86%2Fstart.asm;h=b98a0165a935a5638ef58526916990d6dd944e95;hb=5beb98670f040b2d4e697e4d8690cd46d2d30cf3;hp=b1884aeff516ee77c5d897a2a955ac35d8d35c4a;hpb=88ad2daf974ce4c4c770307546a9b4968c6183c2;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/start.asm b/Kernel/arch/x86/start.asm index b1884aef..b98a0165 100644 --- a/Kernel/arch/x86/start.asm +++ b/Kernel/arch/x86/start.asm @@ -148,29 +148,24 @@ GetEIP: mov eax, [esp] ret -[extern Proc_Clone] -[extern Threads_Exit] -[global SpawnTask] -SpawnTask: - ; Call Proc_Clone with Flags=0 - xor eax, eax - push eax +; int CallWithArgArray(void *Ptr, int NArgs, Uint *Args) +; Call a function passing the array as arguments +[global CallWithArgArray] +CallWithArgArray: + push ebp + mov ebp, esp + mov ecx, [ebp+12] ; Get NArgs + mov edx, [ebp+16] + +.top: + mov eax, [edx+ecx*4-4] push eax - call Proc_Clone - add esp, 8 ; Remove arguments from stack - - test eax, eax - jnz .parent - - ; In child, so now set up stack frame - mov ebx, [esp+4] ; Child Function - mov edx, [esp+8] ; Argument - ; Child - push edx ; Argument - call ebx ; Function - call Threads_Exit ; Kill Thread + loop .top -.parent: + mov eax, [ebp+8] + call eax + lea esp, [ebp] + pop ebp ret [section .initpd]