kernel/eka/nkernsmp/x86/ncutilf.cia
branchRCL_3
changeset 43 c1f20ce4abcf
parent 0 a41df078684a
child 44 3e88ff8f41d5
equal deleted inserted replaced
42:a179b74831c9 43:c1f20ce4abcf
    72 	asm("cmp ecx, 0 ");
    72 	asm("cmp ecx, 0 ");
    73 	asm("jz short use_tsc_only ");
    73 	asm("jz short use_tsc_only ");
    74 	asm("test cl, 3 ");
    74 	asm("test cl, 3 ");
    75 	asm("jnz short use_tsc_only ");
    75 	asm("jnz short use_tsc_only ");
    76 	asm("rdtsc ");
    76 	asm("rdtsc ");
    77 	asm("add eax, [ecx+80+%0]" : : "i" _FOFF(TSubScheduler, iExtras));
    77 	asm("lea ecx, [ecx+%0]" : : "i" _FOFF(TSubScheduler, iSSX.iTimestampOffset));
    78 	asm("adc edx, [ecx+84+%0]" : : "i" _FOFF(TSubScheduler, iExtras));
    78 	asm("add eax, [ecx] ");
       
    79 	asm("adc edx, [ecx+4] ");
    79 	asm("popfd ");
    80 	asm("popfd ");
    80 	asm("ret ");
    81 	asm("ret ");
    81 
    82 
    82 	asm("use_tsc_only: ");
    83 	asm("use_tsc_only: ");
    83 	asm("rdtsc ");
    84 	asm("rdtsc ");
   131 	asm("int 0xff ");						/* Yes - die */
   132 	asm("int 0xff ");						/* Yes - die */
   132 
   133 
   133 	asm("slec_preemption: ");
   134 	asm("slec_preemption: ");
   134 	asm("cmp cl, 0xff ");
   135 	asm("cmp cl, 0xff ");
   135 	asm("je short slec_1 ");			/* EOrderNone - don't check interrupts or preemption */
   136 	asm("je short slec_1 ");			/* EOrderNone - don't check interrupts or preemption */
   136 	asm("cmp dword ptr [edx+52+%0], 0" : : "i"_FOFF(TSubScheduler, iExtras));
   137 	asm("cmp dword ptr [edx+%0], 0" : : "i"_FOFF(TSubScheduler, iSSX.iIrqNestCount));
   137 	asm("jge short slec_preemption_die ");	/* If called from ISR, die */
   138 	asm("jge short slec_preemption_die ");	/* If called from ISR, die */
   138 	asm("cmp dword ptr [edx+%0], 0" : : "i" _FOFF(TSubScheduler, iKernLockCount));
   139 	asm("cmp dword ptr [edx+%0], 0" : : "i" _FOFF(TSubScheduler, iKernLockCount));
   139 	asm("jnz short slec_1 ");			/* Preemption disabled - OK */
   140 	asm("jnz short slec_1 ");			/* Preemption disabled - OK */
   140 	asm("slec_preemption_die: ");
   141 	asm("slec_preemption_die: ");
   141 	asm("int 0xff ");					/* Preemption enabled - die */
   142 	asm("int 0xff ");					/* Preemption enabled - die */
   482 	asm("int 0xff ");						/* Yes - die */
   483 	asm("int 0xff ");						/* Yes - die */
   483 
   484 
   484 	asm("rwrlec_preemption: ");
   485 	asm("rwrlec_preemption: ");
   485 	asm("cmp cl, 0xff ");
   486 	asm("cmp cl, 0xff ");
   486 	asm("je short rwrlec_1 ");			/* EOrderNone - don't check interrupts or preemption */
   487 	asm("je short rwrlec_1 ");			/* EOrderNone - don't check interrupts or preemption */
   487 	asm("cmp dword ptr [edx+52+%0], 0" : : "i"_FOFF(TSubScheduler, iExtras));
   488 	asm("cmp dword ptr [edx+%0], 0" : : "i"_FOFF(TSubScheduler, iSSX.iIrqNestCount));
   488 	asm("jge short rwrlec_preemption_die ");	/* If called from ISR, die */
   489 	asm("jge short rwrlec_preemption_die ");	/* If called from ISR, die */
   489 	asm("cmp dword ptr [edx+%0], 0" : : "i" _FOFF(TSubScheduler, iKernLockCount));
   490 	asm("cmp dword ptr [edx+%0], 0" : : "i" _FOFF(TSubScheduler, iKernLockCount));
   490 	asm("jnz short rwrlec_1 ");			/* Preemption disabled - OK */
   491 	asm("jnz short rwrlec_1 ");			/* Preemption disabled - OK */
   491 	asm("rwrlec_preemption_die: ");
   492 	asm("rwrlec_preemption_die: ");
   492 	asm("int 0xff ");					/* Preemption enabled - die */
   493 	asm("int 0xff ");					/* Preemption enabled - die */
   639 	asm("int 0xff ");						/* Yes - die */
   640 	asm("int 0xff ");						/* Yes - die */
   640 
   641 
   641 	asm("rwwlec_preemption: ");
   642 	asm("rwwlec_preemption: ");
   642 	asm("cmp cl, 0xff ");
   643 	asm("cmp cl, 0xff ");
   643 	asm("je short rwwlec_1 ");			/* EOrderNone - don't check interrupts or preemption */
   644 	asm("je short rwwlec_1 ");			/* EOrderNone - don't check interrupts or preemption */
   644 	asm("cmp dword ptr [edx+52+%0], 0" : : "i"_FOFF(TSubScheduler, iExtras));
   645 	asm("cmp dword ptr [edx+%0], 0" : : "i"_FOFF(TSubScheduler, iSSX.iIrqNestCount));
   645 	asm("jge short rwwlec_preemption_die ");	/* If called from ISR, die */
   646 	asm("jge short rwwlec_preemption_die ");	/* If called from ISR, die */
   646 	asm("cmp dword ptr [edx+%0], 0" : : "i" _FOFF(TSubScheduler, iKernLockCount));
   647 	asm("cmp dword ptr [edx+%0], 0" : : "i" _FOFF(TSubScheduler, iKernLockCount));
   647 	asm("jnz short rwwlec_1 ");			/* Preemption disabled - OK */
   648 	asm("jnz short rwwlec_1 ");			/* Preemption disabled - OK */
   648 	asm("rwwlec_preemption_die: ");
   649 	asm("rwwlec_preemption_die: ");
   649 	asm("int 0xff ");					/* Preemption enabled - die */
   650 	asm("int 0xff ");					/* Preemption enabled - die */