prefetchmemory_asm.s

来自「一个类似windows」· S 代码 · 共 31 行

S
31
字号
/* 
 * COPYRIGHT:       See COPYING in the top level directory
 * PROJECT:         ReactOS kernel
 * FILE:            prefetchmemory_asm.S
 * PURPOSE:         Memory functions
 * PROGRAMMERS:     Patrick Baggett (baggett.patrick@gmail.com)
 *                  Alex Ionescu (alex@relsoft.net)
 *                  Magnus Olsen (magnusolsen@greatlord.com)
 */

.intel_syntax noprefix

/* GLOBALS ****************************************************************/

.globl  @RtlPrefetchMemoryNonTemporal@8

/* FUNCTIONS ***************************************************************/

@RtlPrefetchMemoryNonTemporal@8:
	ret         /* Overwritten by ntoskrnl/ke/i386/kernel.c if SSE is supported (see Ki386SetProcessorFeatures() ) */

	mov eax, [_Ke386CacheAlignment]    // Get cache line size

	// This is fastcall, so ecx = address, edx = size
fetch_next_line:
	prefetchnta byte ptr [ecx]  // prefechnta(address)
	add ecx, eax                // address = address + cache_line_size
	sub edx, eax                // count = count - cache_line_size
	ja fetch_next_line          //     goto fetch_next_line
	ret

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?