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