Module Name: src
Committed By: maxv
Date: Sun Nov 26 10:21:20 UTC 2017
Modified Files:
src/sys/arch/amd64/stand/prekern: locore.S prekern.h
Log Message:
Add rdrand.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amd64/stand/prekern/locore.S
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/amd64/stand/prekern/prekern.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/amd64/stand/prekern/locore.S
diff -u src/sys/arch/amd64/stand/prekern/locore.S:1.5 src/sys/arch/amd64/stand/prekern/locore.S:1.6
--- src/sys/arch/amd64/stand/prekern/locore.S:1.5 Tue Nov 14 13:58:07 2017
+++ src/sys/arch/amd64/stand/prekern/locore.S Sun Nov 26 10:21:20 2017
@@ -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 @@ END(rdtsc)
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
Index: src/sys/arch/amd64/stand/prekern/prekern.h
diff -u src/sys/arch/amd64/stand/prekern/prekern.h:1.16 src/sys/arch/amd64/stand/prekern/prekern.h:1.17
--- src/sys/arch/amd64/stand/prekern/prekern.h:1.16 Tue Nov 21 07:56:05 2017
+++ src/sys/arch/amd64/stand/prekern/prekern.h Sun Nov 26 10:21:20 2017
@@ -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 cpuid(uint32_t, uint32_t, uint32_t
void lidt(void *);
uint64_t rdtsc(void);
int rdseed(uint64_t *);
+int rdrand(uint64_t *);
void jump_kernel(vaddr_t);
/* mm.c */