Home | History | Annotate | Line # | Download | only in libnvmm
h_io_assist_asm.S revision 1.2
      1  1.2  maxv /*	$NetBSD: h_io_assist_asm.S,v 1.2 2019/03/19 19:23:39 maxv Exp $	*/
      2  1.2  maxv 
      3  1.1  maxv /*
      4  1.1  maxv  * Copyright (c) 2019 The NetBSD Foundation, Inc.
      5  1.1  maxv  * All rights reserved.
      6  1.1  maxv  *
      7  1.1  maxv  * This code is derived from software contributed to The NetBSD Foundation
      8  1.1  maxv  * by Maxime Villard.
      9  1.1  maxv  *
     10  1.1  maxv  * Redistribution and use in source and binary forms, with or without
     11  1.1  maxv  * modification, are permitted provided that the following conditions
     12  1.1  maxv  * are met:
     13  1.1  maxv  * 1. Redistributions of source code must retain the above copyright
     14  1.1  maxv  *    notice, this list of conditions and the following disclaimer.
     15  1.1  maxv  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1  maxv  *    notice, this list of conditions and the following disclaimer in the
     17  1.1  maxv  *    documentation and/or other materials provided with the distribution.
     18  1.1  maxv  *
     19  1.1  maxv  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  1.1  maxv  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  1.1  maxv  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  1.1  maxv  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  1.1  maxv  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  1.1  maxv  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  1.1  maxv  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  1.1  maxv  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  1.1  maxv  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  1.1  maxv  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  1.1  maxv  * POSSIBILITY OF SUCH DAMAGE.
     30  1.1  maxv  */
     31  1.1  maxv 
     32  1.1  maxv 	.globl	test1_begin, test1_end
     33  1.1  maxv 	.globl	test2_begin, test2_end
     34  1.1  maxv 	.globl	test3_begin, test3_end
     35  1.1  maxv 	.globl	test4_begin, test4_end
     36  1.1  maxv 	.globl	test5_begin, test5_end
     37  1.1  maxv 	.globl	test6_begin, test6_end
     38  1.1  maxv 	.globl	test7_begin, test7_end
     39  1.1  maxv 	.globl	test8_begin, test8_end
     40  1.1  maxv 	.globl	test9_begin, test9_end
     41  1.1  maxv 	.globl	test10_begin, test10_end
     42  1.1  maxv 	.globl	test11_begin, test11_end
     43  1.1  maxv 	.globl	test12_begin, test12_end
     44  1.1  maxv 	.text
     45  1.1  maxv 	.code64
     46  1.1  maxv 
     47  1.1  maxv #define TEST_END	\
     48  1.1  maxv 	movq	$0xFFFFFFFFFFFFFFFF,%rcx;	\
     49  1.1  maxv 	rdmsr	;
     50  1.1  maxv 
     51  1.1  maxv /*
     52  1.1  maxv  * IN
     53  1.1  maxv  */
     54  1.1  maxv 
     55  1.1  maxv 	.align	64
     56  1.1  maxv test1_begin:
     57  1.1  maxv 	movq	$0x1000,%rbx
     58  1.1  maxv 
     59  1.1  maxv 	inb	$123
     60  1.1  maxv 	movb	%al,(%rbx)
     61  1.1  maxv 	incq	%rbx
     62  1.1  maxv 
     63  1.1  maxv 	movq	$123,%rdx
     64  1.1  maxv 	inb	%dx
     65  1.1  maxv 	movb	%al,(%rbx)
     66  1.1  maxv 
     67  1.1  maxv 	TEST_END
     68  1.1  maxv test1_end:
     69  1.1  maxv 
     70  1.1  maxv 	.align	64
     71  1.1  maxv test2_begin:
     72  1.1  maxv 	movq	$0x1000,%rbx
     73  1.1  maxv 
     74  1.1  maxv 	inw	$123
     75  1.1  maxv 	movw	%ax,(%rbx)
     76  1.1  maxv 	addq	$2,%rbx
     77  1.1  maxv 
     78  1.1  maxv 	movq	$123,%rdx
     79  1.1  maxv 	inw	%dx
     80  1.1  maxv 	movw	%ax,(%rbx)
     81  1.1  maxv 
     82  1.1  maxv 	TEST_END
     83  1.1  maxv test2_end:
     84  1.1  maxv 
     85  1.1  maxv 	.align	64
     86  1.1  maxv test3_begin:
     87  1.1  maxv 	movq	$0x1000,%rbx
     88  1.1  maxv 
     89  1.1  maxv 	inl	$123
     90  1.1  maxv 	movl	%eax,(%rbx)
     91  1.1  maxv 	addq	$4,%rbx
     92  1.1  maxv 
     93  1.1  maxv 	movq	$123,%rdx
     94  1.1  maxv 	inl	%dx
     95  1.1  maxv 	movl	%eax,(%rbx)
     96  1.1  maxv 
     97  1.1  maxv 	TEST_END
     98  1.1  maxv test3_end:
     99  1.1  maxv 
    100  1.1  maxv 	.align	64
    101  1.1  maxv test4_begin:
    102  1.1  maxv 	movq	$0x1000,%rdi
    103  1.1  maxv 	movq	$5,%rcx
    104  1.1  maxv 
    105  1.1  maxv 	movq	$123,%rdx
    106  1.1  maxv 	rep
    107  1.1  maxv 	insb
    108  1.1  maxv 
    109  1.1  maxv 	TEST_END
    110  1.1  maxv test4_end:
    111  1.1  maxv 
    112  1.1  maxv 	.align	64
    113  1.1  maxv test5_begin:
    114  1.1  maxv 	movq	$0x1000,%rdi
    115  1.1  maxv 	movq	$14,%rcx
    116  1.1  maxv 
    117  1.1  maxv 	movq	$123,%rdx
    118  1.1  maxv 	rep
    119  1.1  maxv 	insw
    120  1.1  maxv 
    121  1.1  maxv 	TEST_END
    122  1.1  maxv test5_end:
    123  1.1  maxv 
    124  1.1  maxv 	.align	64
    125  1.1  maxv test6_begin:
    126  1.1  maxv 	movq	$0x1000,%rdi
    127  1.1  maxv 	movq	$7,%rcx
    128  1.1  maxv 
    129  1.1  maxv 	movq	$123,%rdx
    130  1.1  maxv 	rep
    131  1.1  maxv 	insl
    132  1.1  maxv 
    133  1.1  maxv 	TEST_END
    134  1.1  maxv test6_end:
    135  1.1  maxv 
    136  1.1  maxv /*
    137  1.1  maxv  * OUT
    138  1.1  maxv  */
    139  1.1  maxv 
    140  1.1  maxv 	.align	64
    141  1.1  maxv test7_begin:
    142  1.1  maxv 	movq	$0x1000,%rbx
    143  1.1  maxv 
    144  1.1  maxv 	movb	(%rbx),%al
    145  1.1  maxv 	outb	$123
    146  1.1  maxv 	incq	%rbx
    147  1.1  maxv 
    148  1.1  maxv 	movb	(%rbx),%al
    149  1.1  maxv 	movq	$123,%rdx
    150  1.1  maxv 	outb	%dx
    151  1.1  maxv 
    152  1.1  maxv 	TEST_END
    153  1.1  maxv test7_end:
    154  1.1  maxv 
    155  1.1  maxv 	.align	64
    156  1.1  maxv test8_begin:
    157  1.1  maxv 	movq	$0x1000,%rbx
    158  1.1  maxv 
    159  1.1  maxv 	movw	(%rbx),%ax
    160  1.1  maxv 	outw	$123
    161  1.1  maxv 	addq	$2,%rbx
    162  1.1  maxv 
    163  1.1  maxv 	movw	(%rbx),%ax
    164  1.1  maxv 	movq	$123,%rdx
    165  1.1  maxv 	outw	%dx
    166  1.1  maxv 
    167  1.1  maxv 	TEST_END
    168  1.1  maxv test8_end:
    169  1.1  maxv 
    170  1.1  maxv 	.align	64
    171  1.1  maxv test9_begin:
    172  1.1  maxv 	movq	$0x1000,%rbx
    173  1.1  maxv 
    174  1.1  maxv 	movl	(%rbx),%eax
    175  1.1  maxv 	outl	$123
    176  1.1  maxv 	addq	$4,%rbx
    177  1.1  maxv 
    178  1.1  maxv 	movl	(%rbx),%eax
    179  1.1  maxv 	movq	$123,%rdx
    180  1.1  maxv 	outl	%dx
    181  1.1  maxv 
    182  1.1  maxv 	TEST_END
    183  1.1  maxv test9_end:
    184  1.1  maxv 
    185  1.1  maxv 	.align	64
    186  1.1  maxv test10_begin:
    187  1.1  maxv 	movq	$0x1000,%rsi
    188  1.1  maxv 	movq	$5,%rcx
    189  1.1  maxv 
    190  1.1  maxv 	movq	$123,%rdx
    191  1.1  maxv 	rep
    192  1.1  maxv 	outsb
    193  1.1  maxv 
    194  1.1  maxv 	TEST_END
    195  1.1  maxv test10_end:
    196  1.1  maxv 
    197  1.1  maxv 	.align	64
    198  1.1  maxv test11_begin:
    199  1.1  maxv 	movq	$0x1000,%rsi
    200  1.1  maxv 	movq	$8,%rcx
    201  1.1  maxv 
    202  1.1  maxv 	movq	$123,%rdx
    203  1.1  maxv 	rep
    204  1.1  maxv 	outsw
    205  1.1  maxv 
    206  1.1  maxv 	TEST_END
    207  1.1  maxv test11_end:
    208  1.1  maxv 
    209  1.1  maxv 	.align	64
    210  1.1  maxv test12_begin:
    211  1.1  maxv 	movq	$0x1000,%rsi
    212  1.1  maxv 	movq	$7,%rcx
    213  1.1  maxv 
    214  1.1  maxv 	movq	$123,%rdx
    215  1.1  maxv 	rep
    216  1.1  maxv 	outsl
    217  1.1  maxv 
    218  1.1  maxv 	TEST_END
    219  1.1  maxv test12_end:
    220