Print this page
3364 dboot should check boot archive integrity
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Garrett D'Amore <garrett@damore.org>
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
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
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 -#pragma ident "%Z%%M% %I% %E% SMI"
28 -
29 27 #include <sys/asm_linkage.h>
30 28 #include <sys/asm_misc.h>
31 29
32 30 #if defined(__lint)
33 31
34 32 #include "dboot_asm.h"
35 33
36 34 /* ARGSUSED */
37 35 uint32_t
38 36 get_cpuid_edx(uint32_t *eax)
39 37 { return (0); }
40 38
41 39 /* ARGSUSED */
42 40 void
43 41 outb(int port, uint8_t value)
44 42 {}
45 43
46 44 /* ARGSUSED */
47 45 uint8_t
48 46 inb(int port)
49 47 { return (0); }
50 48
51 49 #else /* __lint */
52 50
53 51 #if defined(__amd64)
54 52
55 53 /*
56 54 * do a cpuid instruction, returning the eax/edx values
57 55 *
58 56 * uint32_t get_cpuid_edx(uint32_t *eax)
59 57 */
60 58 ENTRY_NP(get_cpuid_edx)
61 59 pushq %rbx
62 60 movl (%rdi), %eax
63 61 cpuid
64 62 movl %eax, (%rdi)
65 63 movl %edx, %eax
66 64 popq %rbx
67 65 ret
68 66 SET_SIZE(get_cpuid_edx)
69 67
70 68 /*
71 69 * void outb(int port, uint8_t value)
72 70 */
73 71 ENTRY(outb)
74 72 movw %di, %dx
75 73 movb %sil, %al
76 74 outb (%dx)
77 75 ret
78 76 SET_SIZE(outb)
79 77
↓ open down ↓ |
41 lines elided |
↑ open up ↑ |
80 78 /*
81 79 * uint8_t inb(int port)
82 80 */
83 81 ENTRY(inb)
84 82 xorl %eax, %eax
85 83 movw %di, %dx
86 84 inb (%dx)
87 85 ret
88 86 SET_SIZE(inb)
89 87
88 + ENTRY(htonl)
89 + movl %edi, %eax
90 + bswap %eax
91 + ret
92 + SET_SIZE(htonl)
93 +
90 94 #elif defined(__i386)
91 95
92 96 .code32
93 97
94 98 /*
95 99 * do a cpuid instruction, returning the eax/edx values
96 100 *
97 101 * uint32_t get_cpuid_edx(uint32_t *eax)
98 102 */
99 103 ENTRY_NP(get_cpuid_edx)
100 104 movl 4(%esp), %ecx
101 105 movl (%ecx), %eax
102 106 pushl %ebx
103 107 cpuid
104 108 popl %ebx
105 109 movl 4(%esp), %ecx
106 110 movl %eax, (%ecx)
107 111 movl %edx, %eax
108 112 ret
109 113 SET_SIZE(get_cpuid_edx)
110 114
111 115 /*
112 116 * void outb(int port, uint8_t value)
113 117 */
114 118 ENTRY_NP(outb)
115 119 movl 4(%esp), %edx
116 120 movl 8(%esp), %eax
117 121 outb (%dx)
118 122 ret
119 123 SET_SIZE(outb)
120 124
↓ open down ↓ |
21 lines elided |
↑ open up ↑ |
121 125 /*
122 126 * uint8_t inb(int port)
123 127 */
124 128 ENTRY_NP(inb)
125 129 movl 4(%esp), %edx
126 130 inb (%dx)
127 131 andl $0xff, %eax
128 132 ret
129 133 SET_SIZE(inb)
130 134
135 + ENTRY(htonl)
136 + movl 4(%esp), %eax
137 + bswap %eax
138 + ret
139 + SET_SIZE(htonl)
140 +
131 141 #endif /* __i386 */
132 142
133 143 #endif /* __lint */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX