Imported Upstream version 1.15.1
[deb_xorg-server.git] / hw / xfree86 / os-support / solaris / sun_inout.s
1 / $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_inout.s,v 1.1 2001/05/28 02:42:31 tsi Exp $
2 /
3 / Copyright 1994-2001 The XFree86 Project, Inc. All Rights Reserved.
4 /
5 / Permission is hereby granted, free of charge, to any person obtaining a copy
6 / of this software and associated documentation files (the "Software"), to deal
7 / in the Software without restriction, including without limitation the rights
8 / to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 / copies of the Software, and to permit persons to whom the Software is
10 / furnished to do so, subject to the following conditions:
11 /
12 / The above copyright notice and this permission notice shall be included in
13 / all copies or substantial portions of the Software.
14 /
15 / THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 / IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 / FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 / XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 / IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 / CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 /
22 / Except as contained in this notice, the name of the XFree86 Project shall not
23 / be used in advertising or otherwise to promote the sale, use or other
24 / dealings in this Software without prior written authorization from the
25 / XFree86 Project.
26 /
27 /
28 / File: sun_inout.s
29 /
30 / Purpose: Provide inb(), inw(), inl(), outb(), outw(), outl() functions
31 / for Solaris x86 using the ProWorks compiler by SunPro
32 /
33 / Author: Installed into XFree86 SuperProbe by Doug Anson (danson@lgc.com)
34 / Portions donated to XFree86 by Steve Dever (Steve.Dever@Eng.Sun.Com)
35 /
36 / Synopsis: (c callable external declarations)
37 / extern unsigned char inb(int port);
38 / extern unsigned short inw(int port);
39 / extern unsigned long inl(int port);
40 / extern void outb(int port, unsigned char value);
41 / extern void outw(int port, unsigned short value);
42 / extern void outl(int port, unsigned long value);
43 /
44
45 .file "sunos_inout.s"
46 .text
47
48 .globl inb
49 .globl inw
50 .globl inl
51 .globl outb
52 .globl outw
53 .globl outl
54
55 /
56 / unsigned char inb(int port);
57 /
58 .align 4
59 inb:
60 movl 4(%esp),%edx
61 subl %eax,%eax
62 inb (%dx)
63 ret
64 .type inb,@function
65 .size inb,.-inb
66
67 /
68 / unsigned short inw(int port);
69 /
70 .align 4
71 inw:
72 movl 4(%esp),%edx
73 subl %eax,%eax
74 inw (%dx)
75 ret
76 .type inw,@function
77 .size inw,.-inw
78
79 /
80 / unsigned long inl(int port);
81 /
82 .align 4
83 inl:
84 movl 4(%esp),%edx
85 inl (%dx)
86 ret
87 .type inl,@function
88 .size inl,.-inl
89
90 /
91 / void outb(int port, unsigned char value);
92 /
93 .align 4
94 outb:
95 movl 4(%esp),%edx
96 movl 8(%esp),%eax
97 outb (%dx)
98 ret
99 .type outb,@function
100 .size outb,.-outb
101
102 /
103 / void outw(int port, unsigned short value);
104 /
105 .align 4
106 outw:
107 movl 4(%esp),%edx
108 movl 8(%esp),%eax
109 outw (%dx)
110 ret
111 .type outw,@function
112 .size outw,.-outw
113
114 /
115 / void outl(int port, unsigned long value);
116 /
117 .align 4
118 outl:
119 movl 4(%esp),%edx
120 movl 8(%esp),%eax
121 outl (%dx)
122 ret
123 .type outl,@function
124 .size outl,.-outl