public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: devel@edk2.groups.io
Cc: Jian J Wang <jian.j.wang@intel.com>,
	Jiaxin Wu <jiaxin.wu@intel.com>,
	Sean Brogan <sean.brogan@microsoft.com>,
	Anthony Perard <anthony.perard@citrix.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Zhiguang Liu <zhiguang.liu@intel.com>,
	Xiaoyu Lu <xiaoyu1.lu@intel.com>,
	Pawel Polawski <ppolawsk@redhat.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Maciej Rabeda <maciej.rabeda@linux.intel.com>,
	Bob Feng <bob.c.feng@intel.com>,
	Jiewen Yao <jiewen.yao@intel.com>, Andrew Fish <afish@apple.com>,
	Bret Barkelew <Bret.Barkelew@microsoft.com>,
	Alexei Fedorov <Alexei.Fedorov@arm.com>,
	Guo Dong <guo.dong@intel.com>, Gerd Hoffmann <kraxel@redhat.com>,
	kilian_kegel@hotmail.com, Maurice Ma <maurice.ma@intel.com>,
	Siyuan Fu <siyuan.fu@intel.com>,
	Abner Chang <abner.chang@hpe.com>,
	Zhichao Gao <zhichao.gao@intel.com>, Wei6 Xu <wei6.xu@intel.com>,
	Supreeth Venkatesh <supreeth.venkatesh@arm.com>,
	Julien Grall <julien@xen.org>,
	Daniel Schaefer <daniel.schaefer@hpe.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Guomin Jiang <guomin.jiang@intel.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Oliver Steffen <osteffen@redhat.com>,
	Sebastien Boeuf <sebastien.boeuf@intel.com>,
	Benjamin You <benjamin.you@intel.com>,
	Min Xu <min.m.xu@intel.com>, Ray Ni <ray.ni@intel.com>,
	Rebecca Cran <rebecca@bsdio.com>,
	Nickle Wang <nickle.wang@hpe.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Sami Mujawar <Sami.Mujawar@arm.com>,
	Peter Grehan <grehan@freebsd.org>,
	Erdem Aktas <erdemaktas@google.com>,
	Brijesh Singh <brijesh.singh@amd.com>,
	James Bottomley <jejb@linux.ibm.com>,
	Yuwei Chen <yuwei.chen@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>
Subject: [PATCH v4 3/9] MdePkg/CompilerIntrinsicsLib: move size_t typedef to header file
Date: Fri,  3 Jun 2022 14:26:32 +0200	[thread overview]
Message-ID: <20220603122638.1547060-4-kraxel@redhat.com> (raw)
In-Reply-To: <20220603122638.1547060-1-kraxel@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
---
 .../{memset_ms.c => types_ms.h}               | 29 +------------------
 .../Library/CompilerIntrinsicsLib/memcpy_ms.c |  6 +---
 .../CompilerIntrinsicsLib/memmove_ms.c        |  6 +---
 .../Library/CompilerIntrinsicsLib/memset_ms.c |  6 +---
 4 files changed, 4 insertions(+), 43 deletions(-)
 copy MdePkg/Library/CompilerIntrinsicsLib/{memset_ms.c => types_ms.h} (52%)

diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/types_ms.h
similarity index 52%
copy from MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
copy to MdePkg/Library/CompilerIntrinsicsLib/types_ms.h
index deb902c6ae88..d8b578be1f46 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/types_ms.h
@@ -1,6 +1,6 @@
 // ------------------------------------------------------------------------------
 //
-// Copyright (c) 2017, Pete Batard. All rights reserved.<BR>
+// Copyright (c) 2019, Pete Batard. All rights reserved.
 // Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
 //
 // SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -12,30 +12,3 @@ typedef unsigned __int64 size_t;
 #else
 typedef unsigned __int32 size_t;
 #endif
-
-void *
-memset (
-  void *,
-  int,
-  size_t
-  );
-
-#pragma intrinsic(memset)
-#pragma function(memset)
-void *
-memset (
-  void    *s,
-  int     c,
-  size_t  n
-  )
-{
-  unsigned char  *d;
-
-  d = s;
-
-  while (n-- != 0) {
-    *d++ = (unsigned char)c;
-  }
-
-  return s;
-}
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
index 730aa806d50b..d2c3d7198121 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/memcpy_ms.c
@@ -7,11 +7,7 @@
 //
 // ------------------------------------------------------------------------------
 
-#if defined (_M_ARM64) || defined (_M_X64)
-typedef unsigned __int64 size_t;
-#else
-typedef unsigned __int32 size_t;
-#endif
+#include "types_ms.h"
 
 void *
 memcpy (
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
index 3207b94a8675..837744a2920c 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/memmove_ms.c
@@ -7,11 +7,7 @@
 //
 // ------------------------------------------------------------------------------
 
-#if defined (_M_ARM64) || defined (_M_X64)
-typedef unsigned __int64 size_t;
-#else
-typedef unsigned __int32 size_t;
-#endif
+#include "types_ms.h"
 
 void *
 memmove (
diff --git a/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c b/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
index deb902c6ae88..3569bebdf80b 100644
--- a/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
+++ b/MdePkg/Library/CompilerIntrinsicsLib/memset_ms.c
@@ -7,11 +7,7 @@
 //
 // ------------------------------------------------------------------------------
 
-#if defined (_M_ARM64) || defined (_M_X64)
-typedef unsigned __int64 size_t;
-#else
-typedef unsigned __int32 size_t;
-#endif
+#include "types_ms.h"
 
 void *
 memset (
-- 
2.36.1


  parent reply	other threads:[~2022-06-03 12:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03 12:26 [PATCH v4 0/9] consolidate compiler intrinsics Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 1/9] MdePkg: promote CompilerIntrinsicsLib from ArmPkg to MdePkg Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 2/9] MdePkg/CompilerIntrinsicsLib: fix msft sources for x64 Gerd Hoffmann
2022-06-03 12:26 ` Gerd Hoffmann [this message]
2022-06-03 12:26 ` [PATCH v4 4/9] MdePkg/CompilerIntrinsicsLib: move ia32 intrinsics and strcmp Gerd Hoffmann
2022-06-09  3:57   ` Ni, Ray
2022-06-09  6:33     ` Gerd Hoffmann
2022-06-09  9:34       ` Ni, Ray
2022-06-09 10:41         ` Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 5/9] MdePkg/CompilerIntrinsicsLib: copy over intrinsics from edk2-libc repo Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 6/9] MdePkg/CompilerIntrinsicsLib: drop include from Gcc.c Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 7/9] MdePkg/CompilerIntrinsicsLib: drop debug logging " Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 8/9] MdePkg/CompilerIntrinsicsLib: remove duplicate functions " Gerd Hoffmann
2022-06-03 12:26 ` [PATCH v4 9/9] MdePkg/CompilerIntrinsicsLib: add new sources to CompilerIntrinsicsLib.inf Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220603122638.1547060-4-kraxel@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox