/* 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