forked from xt-sys/exectos
		
	Implement MmZeroPages() routine
This commit is contained in:
		
							
								
								
									
										38
									
								
								xtoskrnl/mm/i686/pages.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								xtoskrnl/mm/i686/pages.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| /** | ||||
|  * PROJECT:         ExectOS | ||||
|  * COPYRIGHT:       See COPYING.md in the top level directory | ||||
|  * FILE:            xtoskrnl/mm/i686/pages.c | ||||
|  * DESCRIPTION:     Architecture dependent paging support | ||||
|  * DEVELOPERS:      Rafal Kupiec <belliash@codingworkshop.eu.org> | ||||
|  */ | ||||
|  | ||||
| #include <xtos.h> | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Fills a section of memory with zeroes like RtlZeroMemory(), but in more efficient way. | ||||
|  * | ||||
|  * @param Address | ||||
|  *        Supplies an address of the page to be filled with zeroes. | ||||
|  * | ||||
|  * @param Size | ||||
|  *        Number of bytes to be filled with zeros. This always should be a multiply of page size. | ||||
|  * | ||||
|  * @return This routine does not return any value. | ||||
|  * | ||||
|  * @since XT 1.0 | ||||
|  */ | ||||
| XTFASTCALL | ||||
| VOID | ||||
| MmZeroPages(IN PVOID Address, | ||||
|             IN ULONG Size) | ||||
| { | ||||
|     asm volatile("xor %%eax, %%eax\n" | ||||
|                  "rep stosb" | ||||
|                  : "=D"(Address), | ||||
|                    "=c"(Size) | ||||
|                  : "0"(Address), | ||||
|                    "1"(Size), | ||||
|                    "a"(0) | ||||
|                  : "memory"); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user