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