^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * linux/arch/h8300/boot/compressed/head.S
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2006 Yoshinori Sato
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/linkage.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) .section .text..startup,"ax"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) .global startup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) startup:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) mov.l #startup, sp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) mov.l er0, er4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) mov.l #__sbss, er0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) mov.l #__ebss, er1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) sub.l er0, er1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) shlr er1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) shlr er1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) sub.l er2, er2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) mov.l er2, @er0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) adds #4, er0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) dec.l #1, er1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) bne 1b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) jsr @decompress_kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) mov.l er4, er0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) jmp @output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) .align 9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) fake_headers_as_bzImage:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) .word 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) .ascii "HdrS" ; header signature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) .word 0x0202 ; header version number (>= 0x0105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) ; or else old loadlin-1.5 will fail)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) .word 0 ; default_switch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) .word 0 ; SETUPSEG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) .word 0x1000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) .word 0 ; pointing to kernel version string
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) .byte 0 ; = 0, old one (LILO, Loadlin,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) ; 0xTV: T=0 for LILO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) ; V = version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) .byte 1 ; Load flags bzImage=1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) .word 0x8000 ; size to move, when setup is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) .long 0x100000 ; 0x100000 = default for big kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) .long 0 ; address of loaded ramdisk image
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) .long 0 ; its size in bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) .end