Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: hsimd_asm.s | |
5 | * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. | |
7 | * | |
8 | * The above named program is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU General Public | |
10 | * License version 2 as published by the Free Software Foundation. | |
11 | * | |
12 | * The above named program is distributed in the hope that it will be | |
13 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public | |
18 | * License along with this work; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | |
20 | * | |
21 | * ========== Copyright Header End ============================================ | |
22 | */ | |
23 | /* | |
24 | * Copyright 2006 Sun Microsystems, Inc. All rights reserved. | |
25 | * Use is subject to license terms. | |
26 | */ | |
27 | ||
28 | #pragma ident "@(#)hsimd_asm.s 1.2 06/06/27 SMI" | |
29 | ||
30 | /* | |
31 | * Hypervisor simulation disk read/write calls | |
32 | */ | |
33 | ||
34 | #include <sys/asm_linkage.h> | |
35 | #include <sys/machasi.h> | |
36 | #include <sys/machparam.h> | |
37 | #include <sys/hypervisor_api.h> | |
38 | ||
39 | #ifndef DISK_READ | |
40 | #define DISK_READ 0xf0 | |
41 | #endif | |
42 | #ifndef DISK_WRITE | |
43 | #define DISK_WRITE 0xf1 | |
44 | #endif | |
45 | ||
46 | #if defined(lint) || defined(__lint) /* { */ | |
47 | ||
48 | /*ARGSUSED*/ | |
49 | size_t | |
50 | hv_disk_read(uint64_t offset, uint64_t pa, size_t size) | |
51 | { | |
52 | return (0); | |
53 | } | |
54 | ||
55 | /*ARGSUSED*/ | |
56 | size_t | |
57 | hv_disk_write(uint64_t offset, uint64_t pa, size_t size) | |
58 | { | |
59 | return (0); | |
60 | } | |
61 | ||
62 | #else /* } { lint || __lint */ | |
63 | ||
64 | /* | |
65 | * %o0 - disk offset | |
66 | * %o1 - target real address | |
67 | * %o2 - size | |
68 | */ | |
69 | ENTRY(hv_disk_read) | |
70 | mov DISK_READ, %o5 | |
71 | ta FAST_TRAP | |
72 | tst %o0 | |
73 | movz %xcc, %o1, %o0 | |
74 | retl | |
75 | movnz %xcc, -1, %o0 | |
76 | SET_SIZE(hv_disk_read) | |
77 | ||
78 | /* | |
79 | * %o0 - disk offset | |
80 | * %o1 - target real address | |
81 | * %o2 - size | |
82 | */ | |
83 | ENTRY(hv_disk_write) | |
84 | mov DISK_WRITE, %o5 | |
85 | ta FAST_TRAP | |
86 | tst %o0 | |
87 | movz %xcc, %o1, %o0 | |
88 | retl | |
89 | movnz %xcc, -1, %o0 | |
90 | SET_SIZE(hv_disk_write) | |
91 | ||
92 | #endif /* } lint || __lint */ | |
93 |