]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
1. Add new API supports for PEM & X509 key retrieving & verification;
[mirror_edk2.git] / CryptoPkg / Library / IntrinsicLib / MemoryIntrinsics.c
index 48e0c52c369ace4413b5af06da14feaa4038b1cf..afaa0b74ee26b904e556564f59b45bd706b552cd 100644 (file)
@@ -23,5 +23,17 @@ int _fltused = 1;
 /* Sets buffers to a specified character */\r
 void * memset (void *dest, char ch, unsigned int count)\r
 {\r
-  return SetMem (dest, (UINTN)count, (UINT8)ch);\r
+  //\r
+  // Declare the local variables that actually move the data elements as\r
+  // volatile to prevent the optimizer from replacing this function with\r
+  // the intrinsic memset()\r
+  //\r
+  volatile UINT8  *Pointer;\r
+\r
+  Pointer = (UINT8 *)dest;\r
+  while (count-- != 0) {\r
+    *(Pointer++) = ch;\r
+  }\r
+  \r
+  return dest;\r
 }\r