]>
Commit | Line | Data |
---|---|---|
97f98500 HT |
1 | /** @file\r |
2 | Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based\r | |
3 | Cryptographic Library.\r | |
4 | \r | |
420e5083 | 5 | Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r |
97f98500 HT |
6 | This program and the accompanying materials\r |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #include <Base.h>\r | |
17 | #include <Library/BaseMemoryLib.h>\r | |
420e5083 | 18 | #include <Library/BaseLib.h>\r |
97f98500 HT |
19 | \r |
20 | /* OpenSSL will use floating point support, and C compiler produces the _fltused\r | |
21 | symbol by default. Simply define this symbol here to satisfy the linker. */\r | |
22 | int _fltused = 1;\r | |
23 | \r | |
24 | /* Sets buffers to a specified character */\r | |
25 | void * memset (void *dest, char ch, unsigned int count)\r | |
26 | {\r | |
1b98d6ce LQ |
27 | //\r |
28 | // NOTE: Here we use one base implementation for memset, instead of the direct\r | |
29 | // optimized SetMem() wrapper. Because the IntrinsicLib has to be built \r | |
30 | // without whole program optimization option, and there will be some \r | |
31 | // potential register usage errors when calling other optimized codes.\r | |
32 | //\r | |
33 | \r | |
4a567c96 | 34 | //\r |
35 | // Declare the local variables that actually move the data elements as\r | |
36 | // volatile to prevent the optimizer from replacing this function with\r | |
37 | // the intrinsic memset()\r | |
38 | //\r | |
39 | volatile UINT8 *Pointer;\r | |
40 | \r | |
41 | Pointer = (UINT8 *)dest;\r | |
42 | while (count-- != 0) {\r | |
43 | *(Pointer++) = ch;\r | |
44 | }\r | |
45 | \r | |
46 | return dest;\r | |
97f98500 | 47 | }\r |
420e5083 QL |
48 | \r |
49 | int strcmp (const char *s1, const char *s2)\r | |
50 | {\r | |
51 | return (int)AsciiStrCmp(s1, s2);\r | |
52 | }\r |