]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/CompilerStub/memset.c
Update memcpy.c and memset.c to support both /Ox and /Os of MSFT IPF toolchain. Witho...
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / CompilerStub / memset.c
CommitLineData
3eb9473e 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13 memset.c\r
14\r
15Abstract:\r
16\r
17 The Microsoft compiler inlines memset and we can not stop it.\r
18 These routines allow the code to link!\r
19\r
20 There is no *.h definition of these modules as they are well known by the \r
21 compiler. See Microsoft documentation for more details!\r
22\r
23 volatile is used to prevent the compiler from trying to implement these\r
24 C functions as inline functions. \r
25\r
26--*/\r
27\r
28#include "Tiano.h"\r
808bfde2 29VOID *\r
30memset (\r
31 OUT VOID *Dest,\r
32 IN UINTN Char,\r
33 IN UINTN Count\r
34 )\r
35;\r
3eb9473e 36\r
808bfde2 37#ifdef _MSC_EXTENSIONS\r
38#pragma intrinsic(memset)\r
39#else\r
3eb9473e 40VOID *\r
41memset (\r
42 OUT VOID *Dest,\r
43 IN UINTN Char,\r
44 IN UINTN Count\r
45 )\r
46{\r
47 volatile UINT8 *Ptr;\r
48 \r
49 for (Ptr = Dest; Count > 0; Count--, Ptr++) {\r
50 *Ptr = (UINT8) Char;\r
51 }\r
52\r
53 return Dest;\r
54}\r
808bfde2 55#endif\r
3eb9473e 56\r