summaryrefslogtreecommitdiffstats
path: root/CryptoPkg/Library/IntrinsicLib
diff options
context:
space:
mode:
Diffstat (limited to 'CryptoPkg/Library/IntrinsicLib')
-rw-r--r--CryptoPkg/Library/IntrinsicLib/CopyMem.c29
-rw-r--r--CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c5
-rw-r--r--CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c7
-rw-r--r--CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c9
-rw-r--r--CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c34
5 files changed, 62 insertions, 22 deletions
diff --git a/CryptoPkg/Library/IntrinsicLib/CopyMem.c b/CryptoPkg/Library/IntrinsicLib/CopyMem.c
index 7faf5a34d8..14a213d1da 100644
--- a/CryptoPkg/Library/IntrinsicLib/CopyMem.c
+++ b/CryptoPkg/Library/IntrinsicLib/CopyMem.c
@@ -10,21 +10,38 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Base.h>
#include <Library/BaseMemoryLib.h>
-#if defined(__clang__) && !defined(__APPLE__)
+#if defined (__clang__) && !defined (__APPLE__)
/* Copies bytes between buffers */
-static __attribute__((__used__))
-void * __memcpy (void *dest, const void *src, unsigned int count)
+static __attribute__ ((__used__))
+void *
+__memcpy (
+ void *dest,
+ const void *src,
+ unsigned int count
+ )
{
return CopyMem (dest, src, (UINTN)count);
}
-__attribute__((__alias__("__memcpy")))
-void * memcpy (void *dest, const void *src, unsigned int count);
+
+__attribute__ ((__alias__ ("__memcpy")))
+void *
+memcpy (
+ void *dest,
+ const void *src,
+ unsigned int count
+ );
#else
/* Copies bytes between buffers */
-void * memcpy (void *dest, const void *src, unsigned int count)
+void *
+memcpy (
+ void *dest,
+ const void *src,
+ unsigned int count
+ )
{
return CopyMem (dest, src, (UINTN)count);
}
+
#endif
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c b/CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
index 147a19a4ad..09000c6bec 100644
--- a/CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
+++ b/CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
@@ -11,7 +11,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
/*
* Floating point to integer conversion.
*/
-__declspec(naked) void _ftol2 (void)
+__declspec(naked) void
+_ftol2 (
+ void
+ )
{
_asm {
fistp qword ptr [esp-8]
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c b/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c
index fa35d9b72d..1c14b5d21c 100644
--- a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c
+++ b/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c
@@ -8,16 +8,19 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-
/*
* Shifts a 64-bit signed value left by a particular number of bits.
*/
-__declspec(naked) void __cdecl _allshl (void)
+__declspec(naked) void __cdecl
+_allshl (
+ void
+ )
{
_asm {
;
; Handle shifting of 64 or more bits (return 0)
;
+
cmp cl, 64
jae short ReturnZero
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c b/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c
index efa38983a5..4f5f9112d3 100644
--- a/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c
+++ b/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c
@@ -8,11 +8,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-
/*
* Shifts a 64-bit unsigned value right by a certain number of bits.
*/
-__declspec(naked) void __cdecl _aullshr (void)
+__declspec(naked) void __cdecl
+_aullshr (
+ void
+ )
{
_asm {
;
@@ -41,8 +43,9 @@ More32:
ret
;
- ; Invalid number (less then 32bits), return 0
+ ; Invalid number (less then 32bits), return 0
;
+
_Exit:
xor eax, eax
xor edx, edx
diff --git a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
index 94fe341bec..611e9fd773 100644
--- a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
+++ b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
@@ -11,20 +11,25 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/BaseMemoryLib.h>
#include <Library/BaseLib.h>
-typedef UINTN size_t;
+typedef UINTN size_t;
-#if defined(__GNUC__) || defined(__clang__)
- #define GLOBAL_USED __attribute__((used))
+#if defined (__GNUC__) || defined (__clang__)
+#define GLOBAL_USED __attribute__((used))
#else
- #define GLOBAL_USED
+#define GLOBAL_USED
#endif
/* OpenSSL will use floating point support, and C compiler produces the _fltused
symbol by default. Simply define this symbol here to satisfy the linker. */
-int GLOBAL_USED _fltused = 1;
+int GLOBAL_USED _fltused = 1;
/* Sets buffers to a specified character */
-void * memset (void *dest, int ch, size_t count)
+void *
+memset (
+ void *dest,
+ int ch,
+ size_t count
+ )
{
//
// NOTE: Here we use one base implementation for memset, instead of the direct
@@ -49,12 +54,21 @@ void * memset (void *dest, int ch, size_t count)
}
/* Compare bytes in two buffers. */
-int memcmp (const void *buf1, const void *buf2, size_t count)
+int
+memcmp (
+ const void *buf1,
+ const void *buf2,
+ size_t count
+ )
{
- return (int)CompareMem(buf1, buf2, count);
+ return (int)CompareMem (buf1, buf2, count);
}
-int strcmp (const char *s1, const char *s2)
+int
+strcmp (
+ const char *s1,
+ const char *s2
+ )
{
- return (int)AsciiStrCmp(s1, s2);
+ return (int)AsciiStrCmp (s1, s2);
}