Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/stand/prekern Add rdrand.



details:   https://anonhg.NetBSD.org/src/rev/1073ed89df15
branches:  trunk
changeset: 828064:1073ed89df15
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sun Nov 26 10:21:20 2017 +0000

description:
Add rdrand.

diffstat:

 sys/arch/amd64/stand/prekern/locore.S  |  17 ++++++++++++++---
 sys/arch/amd64/stand/prekern/prekern.h |   3 ++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diffs (55 lines):

diff -r f35aba42009b -r 1073ed89df15 sys/arch/amd64/stand/prekern/locore.S
--- a/sys/arch/amd64/stand/prekern/locore.S     Sun Nov 26 03:51:45 2017 +0000
+++ b/sys/arch/amd64/stand/prekern/locore.S     Sun Nov 26 10:21:20 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.5 2017/11/14 13:58:07 maxv Exp $  */
+/*     $NetBSD: locore.S,v 1.6 2017/11/26 10:21:20 maxv Exp $  */
 
 /*
  * Copyright (c) 1998, 2000, 2007, 2008, 2016, 2017 The NetBSD Foundation, Inc.
@@ -612,15 +612,26 @@
 
 ENTRY(rdseed)
        rdseed  %rax
-       jc      .Lsuccess
+       jc      .Lrdseed_success
        movq    $(-1),%rax
        ret
-.Lsuccess:
+.Lrdseed_success:
        movq    %rax,(%rdi)
        xorq    %rax,%rax
        ret
 END(rdseed)
 
+ENTRY(rdrand)
+       rdrand  %rax
+       jc      .Lrdrand_success
+       movq    $(-1),%rax
+       ret
+.Lrdrand_success:
+       movq    %rax,(%rdi)
+       xorq    %rax,%rax
+       ret
+END(rdrand)
+
 ENTRY(jump_kernel)
        movq    _C_LABEL(stkva),%rsp
        xorq    %rbp,%rbp
diff -r f35aba42009b -r 1073ed89df15 sys/arch/amd64/stand/prekern/prekern.h
--- a/sys/arch/amd64/stand/prekern/prekern.h    Sun Nov 26 03:51:45 2017 +0000
+++ b/sys/arch/amd64/stand/prekern/prekern.h    Sun Nov 26 10:21:20 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: prekern.h,v 1.16 2017/11/21 07:56:05 maxv Exp $        */
+/*     $NetBSD: prekern.h,v 1.17 2017/11/26 10:21:20 maxv Exp $        */
 
 /*
  * Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -100,6 +100,7 @@
 void lidt(void *);
 uint64_t rdtsc(void);
 int rdseed(uint64_t *);
+int rdrand(uint64_t *);
 void jump_kernel(vaddr_t);
 
 /* mm.c */



Home | Main Index | Thread Index | Old Index