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>


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 #pragma ident   "%Z%%M% %I%     %E% SMI"
  28 
  29 #include <sys/asm_linkage.h>
  30 #include <sys/asm_misc.h>
  31 
  32 #if defined(__lint)
  33 
  34 #include "dboot_asm.h"
  35 
  36 /* ARGSUSED */
  37 uint32_t
  38 get_cpuid_edx(uint32_t *eax)
  39 { return (0); }
  40 
  41 /* ARGSUSED */
  42 void
  43 outb(int port, uint8_t value)
  44 {}
  45 
  46 /* ARGSUSED */
  47 uint8_t
  48 inb(int port)


  70         /*
  71          * void outb(int port, uint8_t value)
  72          */
  73         ENTRY(outb)
  74         movw    %di, %dx
  75         movb    %sil, %al
  76         outb    (%dx)
  77         ret
  78         SET_SIZE(outb)
  79 
  80         /*
  81          * uint8_t inb(int port)
  82          */
  83         ENTRY(inb)
  84         xorl    %eax, %eax
  85         movw    %di, %dx
  86         inb     (%dx)
  87         ret
  88         SET_SIZE(inb)
  89 






  90 #elif defined(__i386)
  91 
  92         .code32
  93 
  94         /*
  95          * do a cpuid instruction, returning the eax/edx values
  96          *
  97          * uint32_t get_cpuid_edx(uint32_t *eax)
  98          */
  99         ENTRY_NP(get_cpuid_edx)
 100         movl    4(%esp), %ecx
 101         movl    (%ecx), %eax
 102         pushl   %ebx
 103         cpuid
 104         popl    %ebx
 105         movl    4(%esp), %ecx
 106         movl    %eax, (%ecx)
 107         movl    %edx, %eax
 108         ret
 109         SET_SIZE(get_cpuid_edx)


 111         /*
 112          * void outb(int port, uint8_t value)
 113          */
 114         ENTRY_NP(outb)
 115         movl    4(%esp), %edx
 116         movl    8(%esp), %eax
 117         outb    (%dx)
 118         ret
 119         SET_SIZE(outb)
 120 
 121         /*
 122          * uint8_t inb(int port)
 123          */
 124         ENTRY_NP(inb)
 125         movl    4(%esp), %edx
 126         inb     (%dx)
 127         andl    $0xff, %eax
 128         ret
 129         SET_SIZE(inb)
 130 






 131 #endif  /* __i386 */
 132 
 133 #endif /* __lint */


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 


  27 #include <sys/asm_linkage.h>
  28 #include <sys/asm_misc.h>
  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)


  68         /*
  69          * void outb(int port, uint8_t value)
  70          */
  71         ENTRY(outb)
  72         movw    %di, %dx
  73         movb    %sil, %al
  74         outb    (%dx)
  75         ret
  76         SET_SIZE(outb)
  77 
  78         /*
  79          * uint8_t inb(int port)
  80          */
  81         ENTRY(inb)
  82         xorl    %eax, %eax
  83         movw    %di, %dx
  84         inb     (%dx)
  85         ret
  86         SET_SIZE(inb)
  87 
  88         ENTRY(htonl)
  89         movl    %edi, %eax
  90         bswap   %eax
  91         ret
  92         SET_SIZE(htonl)
  93 
  94 #elif defined(__i386)
  95 
  96         .code32
  97 
  98         /*
  99          * do a cpuid instruction, returning the eax/edx values
 100          *
 101          * uint32_t get_cpuid_edx(uint32_t *eax)
 102          */
 103         ENTRY_NP(get_cpuid_edx)
 104         movl    4(%esp), %ecx
 105         movl    (%ecx), %eax
 106         pushl   %ebx
 107         cpuid
 108         popl    %ebx
 109         movl    4(%esp), %ecx
 110         movl    %eax, (%ecx)
 111         movl    %edx, %eax
 112         ret
 113         SET_SIZE(get_cpuid_edx)


 115         /*
 116          * void outb(int port, uint8_t value)
 117          */
 118         ENTRY_NP(outb)
 119         movl    4(%esp), %edx
 120         movl    8(%esp), %eax
 121         outb    (%dx)
 122         ret
 123         SET_SIZE(outb)
 124 
 125         /*
 126          * uint8_t inb(int port)
 127          */
 128         ENTRY_NP(inb)
 129         movl    4(%esp), %edx
 130         inb     (%dx)
 131         andl    $0xff, %eax
 132         ret
 133         SET_SIZE(inb)
 134 
 135         ENTRY(htonl)
 136         movl    4(%esp), %eax
 137         bswap   %eax
 138         ret
 139         SET_SIZE(htonl)
 140 
 141 #endif  /* __i386 */
 142 
 143 #endif /* __lint */