You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/06/01 14:22:55 UTC

[incubator-nuttx] branch master updated: arch/intel64: Don't include immintrin.h

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new ed0c38c  arch/intel64: Don't include immintrin.h
ed0c38c is described below

commit ed0c38cb7aaaf642ae2aec17997600acc96d6bf0
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Jun 1 22:01:47 2020 +0800

    arch/intel64: Don't include immintrin.h
    
    because it will bring a lot of host header files
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/x86_64/src/intel64/intel64_rng.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/x86_64/src/intel64/intel64_rng.c b/arch/x86_64/src/intel64/intel64_rng.c
index e602f61..a6d0019 100644
--- a/arch/x86_64/src/intel64/intel64_rng.c
+++ b/arch/x86_64/src/intel64/intel64_rng.c
@@ -39,8 +39,6 @@
 
 #include "up_internal.h"
 
-#include <immintrin.h>
-
 #if defined(CONFIG_DEV_RANDOM) || defined(CONFIG_DEV_URANDOM_ARCH)
 
 /****************************************************************************
@@ -110,7 +108,7 @@ static ssize_t x86_rngread(struct file *filep, char *buffer, size_t buflen)
   size_t reqlen = buflen;
   for (; buflen > 8; buflen -= 8)
     {
-      while (_rdrand64_step((unsigned long long *)buffer) == 0)
+      while (__builtin_ia32_rdrand64_step((unsigned long long *)buffer) == 0)
         {
           sched_yield();
         }
@@ -120,7 +118,7 @@ static ssize_t x86_rngread(struct file *filep, char *buffer, size_t buflen)
 
   for (; buflen > 4; buflen -= 4)
     {
-      while (_rdrand32_step((unsigned int *)buffer) == 0)
+      while (__builtin_ia32_rdrand32_step((unsigned int *)buffer) == 0)
         {
           sched_yield();
         }
@@ -130,7 +128,7 @@ static ssize_t x86_rngread(struct file *filep, char *buffer, size_t buflen)
 
   for (; buflen > 2; buflen -= 2)
     {
-      while (_rdrand16_step((unsigned short *)buffer) == 0)
+      while (__builtin_ia32_rdrand16_step((unsigned short *)buffer) == 0)
         {
           sched_yield();
         }
@@ -142,7 +140,7 @@ static ssize_t x86_rngread(struct file *filep, char *buffer, size_t buflen)
     {
       unsigned short temp = 0;
 
-      while (_rdrand16_step(&temp) == 0)
+      while (__builtin_ia32_rdrand16_step(&temp) == 0)
         {
           sched_yield();
         }