xen: fix build by adding missing rdrandbuf() function
This commit is contained in:
parent
6cbc226351
commit
052abe1cc8
2 changed files with 33 additions and 0 deletions
|
@ -102,6 +102,7 @@ int wrmsr(int, vlong);
|
||||||
uint xchgl(uint*, uint);
|
uint xchgl(uint*, uint);
|
||||||
uint xchgw(ushort*, uint);
|
uint xchgw(ushort*, uint);
|
||||||
uint xchgb(uchar*, uint);
|
uint xchgb(uchar*, uint);
|
||||||
|
void rdrandbuf(void*, ulong);
|
||||||
|
|
||||||
#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
|
#define waserror() (up->nerrlab++, setlabel(&up->errlab[up->nerrlab-1]))
|
||||||
#define KADDR(a) ((void*)((ulong)(a)|KZERO))
|
#define KADDR(a) ((void*)((ulong)(a)|KZERO))
|
||||||
|
|
|
@ -296,6 +296,38 @@ TEXT mul64fract(SB), $0
|
||||||
ADCL BX, 4(CX) /* r2 += carry */
|
ADCL BX, 4(CX) /* r2 += carry */
|
||||||
RET
|
RET
|
||||||
|
|
||||||
|
#define RDRANDAX BYTE $0x0f; BYTE $0xc7; BYTE $0xf0
|
||||||
|
|
||||||
|
TEXT rdrand32(SB), $-4
|
||||||
|
_rloop32:
|
||||||
|
RDRANDAX
|
||||||
|
JCC _rloop32
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT rdrandbuf(SB), $0
|
||||||
|
MOVL buf+0(FP), DI
|
||||||
|
MOVL cnt+4(FP), CX
|
||||||
|
CLD
|
||||||
|
MOVL CX, DX
|
||||||
|
SHRL $2, CX
|
||||||
|
CMPL CX, $0
|
||||||
|
JE _rndleft
|
||||||
|
_rnddwords:
|
||||||
|
CALL rdrand32(SB)
|
||||||
|
STOSL
|
||||||
|
LOOP _rnddwords
|
||||||
|
_rndleft:
|
||||||
|
MOVL DX, CX
|
||||||
|
ANDL $3, CX
|
||||||
|
CMPL CX, $0
|
||||||
|
JE _rnddone
|
||||||
|
_rndbytes:
|
||||||
|
CALL rdrand32(SB)
|
||||||
|
STOSB
|
||||||
|
LOOP _rndbytes
|
||||||
|
_rnddone:
|
||||||
|
RET
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* label consists of a stack pointer and a PC
|
* label consists of a stack pointer and a PC
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue