Print this page
de-linting of .s files
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/i86pc/dboot/dboot_asm.s
+++ new/usr/src/uts/i86pc/dboot/dboot_asm.s
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
20 20 */
21 21
22 22 /*
23 23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 #include <sys/asm_linkage.h>
28 28 #include <sys/asm_misc.h>
29 29
30 -#if defined(__lint)
31 -
32 -#include "dboot_asm.h"
33 -
34 -/* ARGSUSED */
35 -uint32_t
36 -get_cpuid_edx(uint32_t *eax)
37 -{ return (0); }
38 -
39 -/* ARGSUSED */
40 -void
41 -outb(int port, uint8_t value)
42 -{}
43 -
44 -/* ARGSUSED */
45 -uint8_t
46 -inb(int port)
47 -{ return (0); }
48 -
49 -#else /* __lint */
50 -
51 30 #if defined(__amd64)
52 31
53 32 /*
54 33 * do a cpuid instruction, returning the eax/edx values
55 34 *
56 35 * uint32_t get_cpuid_edx(uint32_t *eax)
57 36 */
58 37 ENTRY_NP(get_cpuid_edx)
59 38 pushq %rbx
60 39 movl (%rdi), %eax
61 40 cpuid
62 41 movl %eax, (%rdi)
63 42 movl %edx, %eax
64 43 popq %rbx
65 44 ret
66 45 SET_SIZE(get_cpuid_edx)
67 46
68 47 /*
69 48 * void outb(int port, uint8_t value)
70 49 */
71 50 ENTRY(outb)
72 51 movw %di, %dx
73 52 movb %sil, %al
74 53 outb (%dx)
75 54 ret
76 55 SET_SIZE(outb)
77 56
78 57 /*
79 58 * uint8_t inb(int port)
80 59 */
81 60 ENTRY(inb)
82 61 xorl %eax, %eax
83 62 movw %di, %dx
84 63 inb (%dx)
85 64 ret
86 65 SET_SIZE(inb)
87 66
88 67 ENTRY(htonl)
89 68 movl %edi, %eax
90 69 bswap %eax
91 70 ret
92 71 SET_SIZE(htonl)
93 72
94 73 #elif defined(__i386)
95 74
96 75 .code32
97 76
98 77 /*
99 78 * do a cpuid instruction, returning the eax/edx values
100 79 *
101 80 * uint32_t get_cpuid_edx(uint32_t *eax)
102 81 */
103 82 ENTRY_NP(get_cpuid_edx)
104 83 movl 4(%esp), %ecx
105 84 movl (%ecx), %eax
106 85 pushl %ebx
107 86 cpuid
108 87 popl %ebx
109 88 movl 4(%esp), %ecx
110 89 movl %eax, (%ecx)
111 90 movl %edx, %eax
112 91 ret
113 92 SET_SIZE(get_cpuid_edx)
114 93
115 94 /*
116 95 * void outb(int port, uint8_t value)
117 96 */
118 97 ENTRY_NP(outb)
119 98 movl 4(%esp), %edx
120 99 movl 8(%esp), %eax
121 100 outb (%dx)
122 101 ret
123 102 SET_SIZE(outb)
124 103
125 104 /*
126 105 * uint8_t inb(int port)
127 106 */
128 107 ENTRY_NP(inb)
129 108 movl 4(%esp), %edx
130 109 inb (%dx)
131 110 andl $0xff, %eax
132 111 ret
↓ open down ↓ |
72 lines elided |
↑ open up ↑ |
133 112 SET_SIZE(inb)
134 113
135 114 ENTRY(htonl)
136 115 movl 4(%esp), %eax
137 116 bswap %eax
138 117 ret
139 118 SET_SIZE(htonl)
140 119
141 120 #endif /* __i386 */
142 121
143 -#endif /* __lint */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX