Commit | Line | Data |
---|---|---|
a09e091a JB |
1 | / Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. |
2 | / | |
3 | / Permission is hereby granted, free of charge, to any person obtaining a | |
4 | / copy of this software and associated documentation files (the "Software"), | |
5 | / to deal in the Software without restriction, including without limitation | |
6 | / the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
7 | / and/or sell copies of the Software, and to permit persons to whom the | |
8 | / Software is furnished to do so, subject to the following conditions: | |
9 | / | |
10 | / The above copyright notice and this permission notice (including the next | |
11 | / paragraph) shall be included in all copies or substantial portions of the | |
12 | / Software. | |
13 | / | |
14 | / THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
15 | / IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
16 | / FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
17 | / THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
18 | / LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
19 | / FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
20 | / DEALINGS IN THE SOFTWARE. | |
21 | ||
22 | #ifdef INLINE_ASM | |
23 | #define FUNCTION_START(f,n) .inline f,n | |
24 | #define FUNCTION_END(f) .end | |
25 | #else | |
26 | #define _ASM | |
27 | #include <sys/asm_linkage.h> | |
28 | #define FUNCTION_START(f,n) ENTRY(f) | |
29 | #define FUNCTION_END(f) ret; SET_SIZE(f) | |
30 | #endif | |
31 | ||
32 | FUNCTION_START(inb,4) | |
33 | movq %rdi, %rdx | |
34 | xorq %rax, %rax | |
35 | inb (%dx) | |
36 | FUNCTION_END(inb) | |
37 | ||
38 | FUNCTION_START(inw,4) | |
39 | movq %rdi, %rdx | |
40 | xorq %rax, %rax | |
41 | inw (%dx) | |
42 | FUNCTION_END(inw) | |
43 | ||
44 | FUNCTION_START(inl,4) | |
45 | movq %rdi, %rdx | |
46 | xorq %rax, %rax | |
47 | inl (%dx) | |
48 | FUNCTION_END(inl) | |
49 | ||
50 | FUNCTION_START(outb,8) | |
51 | movq %rdi, %rdx | |
52 | movq %rsi, %rax | |
53 | outb (%dx) | |
54 | FUNCTION_END(outb) | |
55 | ||
56 | FUNCTION_START(outw,8) | |
57 | movq %rdi, %rdx | |
58 | movq %rsi, %rax | |
59 | outw (%dx) | |
60 | FUNCTION_END(outw) | |
61 | ||
62 | FUNCTION_START(outl,8) | |
63 | movq %rdi, %rdx | |
64 | movq %rsi, %rax | |
65 | outl (%dx) | |
66 | FUNCTION_END(outl) | |
67 |