Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* n2-asm.S: Niagara2 RNG hypervisor call assembler.
0003  *
0004  * Copyright (C) 2008 David S. Miller <davem@davemloft.net>
0005  */
0006 #include <linux/linkage.h>
0007 #include <asm/hypervisor.h>
0008 #include "n2rng.h"
0009 
0010     .text
0011 
0012 ENTRY(sun4v_rng_get_diag_ctl)
0013     mov HV_FAST_RNG_GET_DIAG_CTL, %o5
0014     ta  HV_FAST_TRAP
0015     retl
0016      nop
0017 ENDPROC(sun4v_rng_get_diag_ctl)
0018 
0019 ENTRY(sun4v_rng_ctl_read_v1)
0020     mov %o1, %o3
0021     mov %o2, %o4
0022     mov HV_FAST_RNG_CTL_READ, %o5
0023     ta  HV_FAST_TRAP
0024     stx %o1, [%o3]
0025     retl
0026      stx    %o2, [%o4]
0027 ENDPROC(sun4v_rng_ctl_read_v1)
0028 
0029 ENTRY(sun4v_rng_ctl_read_v2)
0030     save    %sp, -192, %sp
0031     mov %i0, %o0
0032     mov %i1, %o1
0033     mov HV_FAST_RNG_CTL_READ, %o5
0034     ta  HV_FAST_TRAP
0035     stx %o1, [%i2]
0036     stx %o2, [%i3]
0037     stx %o3, [%i4]
0038     stx %o4, [%i5]
0039     ret
0040     restore %g0, %o0, %o0
0041 ENDPROC(sun4v_rng_ctl_read_v2)
0042 
0043 ENTRY(sun4v_rng_ctl_write_v1)
0044     mov %o3, %o4
0045     mov HV_FAST_RNG_CTL_WRITE, %o5
0046     ta  HV_FAST_TRAP
0047     retl
0048      stx    %o1, [%o4]
0049 ENDPROC(sun4v_rng_ctl_write_v1)
0050 
0051 ENTRY(sun4v_rng_ctl_write_v2)
0052     mov HV_FAST_RNG_CTL_WRITE, %o5
0053     ta  HV_FAST_TRAP
0054     retl
0055      nop
0056 ENDPROC(sun4v_rng_ctl_write_v2)
0057 
0058 ENTRY(sun4v_rng_data_read_diag_v1)
0059     mov %o2, %o4
0060     mov HV_FAST_RNG_DATA_READ_DIAG, %o5
0061     ta  HV_FAST_TRAP
0062     retl
0063      stx    %o1, [%o4]
0064 ENDPROC(sun4v_rng_data_read_diag_v1)
0065 
0066 ENTRY(sun4v_rng_data_read_diag_v2)
0067     mov %o3, %o4
0068     mov HV_FAST_RNG_DATA_READ_DIAG, %o5
0069     ta  HV_FAST_TRAP
0070     retl
0071      stx    %o1, [%o4]
0072 ENDPROC(sun4v_rng_data_read_diag_v2)
0073 
0074 ENTRY(sun4v_rng_data_read)
0075     mov %o1, %o4
0076     mov HV_FAST_RNG_DATA_READ, %o5
0077     ta  HV_FAST_TRAP
0078     retl
0079      stx    %o1, [%o4]
0080 ENDPROC(sun4v_rng_data_read)