Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #2038: Thread.d.64bit.patch

File Thread.d.64bit.patch, 3.5 kB (added by Marenz, 13 years ago)

replaced inout with ref

  • tango/core/Thread.d

    old new  
    348348            { 
    349349                __builtin_unwind_init(); 
    350350            } 
     351            else version ( D_InlineAsm_X86_64 ) 
     352            { 
     353                asm 
     354                { 
     355                    // Not sure what goes here, pushad is invalid in 64 bit code 
     356                    push RAX ; 
     357                    push RBX ; 
     358                    push RCX ; 
     359                    push RDX ; 
     360                    push RSI ; 
     361                    push RDI ; 
     362                    push RBP ; 
     363                    push R8  ; 
     364                    push R9  ; 
     365                    push R10 ; 
     366                    push R11 ; 
     367                    push R12 ; 
     368                    push R13 ; 
     369                    push R14 ; 
     370                    push R15 ; 
     371                    push EAX ;   // 16 byte align the stack 
     372                } 
     373            } 
    351374            else 
    352375            { 
    353376                static assert( false, "Architecture not supported." ); 
     
    411434            { 
    412435                // registers will be popped automatically 
    413436            } 
     437            else version ( D_InlineAsm_X86_64 ) 
     438            { 
     439                asm 
     440                { 
     441                    // Not sure what goes here, popad is invalid in 64 bit code 
     442                    pop EAX ;   // 16 byte align the stack 
     443                    pop R15 ; 
     444                    pop R14 ; 
     445                    pop R13 ; 
     446                    pop R12 ; 
     447                    pop R11 ; 
     448                    pop R10 ; 
     449                    pop R9  ; 
     450                    pop R8  ; 
     451                    pop RBP ; 
     452                    pop RDI ; 
     453                    pop RSI ; 
     454                    pop RDX ; 
     455                    pop RCX ; 
     456                    pop RBX ; 
     457                    pop RAX ; 
     458                } 
     459            } 
    414460            else 
    415461            { 
    416462                static assert( false, "Architecture not supported." ); 
     
    26702716        } 
    26712717        else version( AsmX86_64_Posix ) 
    26722718        { 
    2673             asm 
     2719            version( DigitalMars ) asm 
    26742720            { 
    26752721                naked; 
    26762722 
    26772723                // save current stack state 
     2724                push RBP; 
     2725                mov RBP, RSP; 
     2726                push RBX; 
     2727                push R12; 
     2728                push R13; 
     2729                push R14; 
     2730                push R15; 
     2731                sub RSP, 4; 
     2732                stmxcsr [RSP]; 
     2733                sub RSP, 4; 
     2734                //version(SynchroFloatExcept){ 
     2735                    fstcw [RSP]; 
     2736                    fwait; 
     2737                //} else { 
     2738                //    fnstcw [RSP]; 
     2739                //    fnclex; 
     2740                //} 
     2741 
     2742                // store oldp again with more accurate address 
     2743                mov [RDI], RSP; 
     2744                // load newp to begin context switch 
     2745                mov RSP, RSI; 
     2746 
     2747                // load saved state from new stack 
     2748                fldcw [RSP]; 
     2749                add RSP, 4; 
     2750                ldmxcsr [RSP]; 
     2751                add RSP, 4; 
     2752                pop R15; 
     2753                pop R14; 
     2754                pop R13; 
     2755                pop R12; 
     2756 
     2757                pop RBX; 
     2758                pop RBP; 
     2759 
     2760                // 'return' to complete switch 
     2761                ret; 
     2762 
     2763            } 
     2764            else asm 
     2765            { 
     2766                naked; 
     2767 
     2768                // save current stack state 
    26782769                pushq RBP; 
    26792770                mov RBP, RSP; 
    26802771                pushq RBX;