Separated math and memory functions into their own files to limit the amount of objec...
[reactos.git] / reactos / lib / rtl / i386 / prefetchmemory_asm.s
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: prefetchmemory_asm.S
5 * PURPOSE: Memory functions
6 * PROGRAMMERS: Patrick Baggett (baggett.patrick@gmail.com)
7 * Alex Ionescu (alex@relsoft.net)
8 * Magnus Olsen (magnusolsen@greatlord.com)
9 */
10
11 .intel_syntax noprefix
12
13 /* GLOBALS ****************************************************************/
14
15 .globl @RtlPrefetchMemoryNonTemporal@8
16
17 /* FUNCTIONS ***************************************************************/
18
19 @RtlPrefetchMemoryNonTemporal@8:
20 ret /* Overwritten by ntoskrnl/ke/i386/kernel.c if SSE is supported (see Ki386SetProcessorFeatures() ) */
21
22 mov eax, [_Ke386CacheAlignment] // Get cache line size
23
24 // This is fastcall, so ecx = address, edx = size
25 fetch_next_line:
26 prefetchnta byte ptr [ecx] // prefechnta(address)
27 add ecx, eax // address = address + cache_line_size
28 sub edx, eax // count = count - cache_line_size
29 ja fetch_next_line // goto fetch_next_line
30 ret