\ ========== Copyright Header Begin ==========================================
\ Hypervisor Software File: reset-dropin.fth
\ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
\ - Do no alter or remove copyright notices
\ - Redistribution and use of this software in source and binary forms, with
\ or without modification, are permitted provided that the following
\ - Redistribution of source code must retain the above copyright notice,
\ this list of conditions and the following disclaimer.
\ - Redistribution in binary form must reproduce the above copyright notice,
\ this list of conditions and the following disclaimer in the
\ documentation and/or other materials provided with the distribution.
\ Neither the name of Sun Microsystems, Inc. or the names of contributors
\ may be used to endorse or promote products derived from this software
\ without specific prior written permission.
\ This software is provided "AS IS," without a warranty of any kind.
\ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
\ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
\ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
\ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
\ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
\ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
\ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
\ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
\ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
\ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
\ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
\ You acknowledge that this software is not designed, licensed or
\ intended for use in the design, construction, operation or maintenance of
\ ========== Copyright Header End ============================================
id: @(#)reset-dropin.fth 1.2 03/08/20
copyright: Copyright 2001-2003 Sun Microsystems, Inc. All Rights Reserved
copyright: Use is subject to license terms.
\ %o1 = base-addr to start search
\ %o3 = 0 = dont copy before decompress, else copy data here first
\ %o4 != 0 verify dropin checksum
\ %o0 = 0 for not found, otherwise it is the #bytes copied (rounded to 8 byte
%o0 %g0 %l7 add \ (delay)
print" Can't start: No image found"
%g0 %g0 %i0 add \ failed.
%i4 %g0 %g0 subcc \ Checksum?
diag-print" "r"nDropin checksum: "
%l7 0 >di-sum %l1 ld \ SUM
%l7 0 >di-size %l2 ld \ size
%l2 /lvl1-hdr %l2 add \ include the header
%l3 %l4 %l5 and \ low bits
%l6 %l5 %l3 add \ (delay) fold sum
%l3 %l4 %g0 subcc \ sum = 0xffff?
%l3 %l4 %l3 xor \ (delay) invert
%l4 %g0 %l3 add \ sum = 0xffff
print" "r"nCan't start: image is corrupted"r"n"
print" "r"nFind dropin: "
diag-print" "r"nFind dropin"
%l7 0 >di-image %l0 add \ addr of first data word
h# 434f4d50 %o1 set \ COMP magic
%i3 %g0 %g0 subcc \ (delay) relocate?
%l0 4 %l1 ld \ (delay) get comp size
%l1 h# 10 %l2 add \ copy size
%l2 3 %l2 andn \ round-up
%i3 %g0 %l0 add \ Use copy as SRC
diag-print" , Decompressing "
%l0 h# 10 %o0 add \ Skip to Data
" output" %o0 $set-external
%l0 0 %o0 add \ Skip to Data
%l7 0 >di-size %l5 ld \ get size
%l3 d# 15 %l3 andn \ Size rounded Up.
%l3 /lvl1-hdr %o2 add \ Add header size.
%l3 0 %i0 add \ data size for printing
[ifdef] verify-dropin-copy?
%l7 /lvl1-hdr %l0 add \ src data
%l7 0 >di-size %l5 ld \ size