Changeset 0e4dd7b in mainline for arch/sparc64/src/start.S


Ignore:
Timestamp:
2006-02-17T16:49:52Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c1e43e4
Parents:
37c8975
Message:

sparc64 work.
Relocate kernel to 4M.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/src/start.S

    r37c8975 r0e4dd7b  
    2727#
    2828
     29#include <arch/boot/boot.h>
     30
    2931.register %g2, #scratch
    3032.register %g3, #scratch
     
    5153
    52541:
     55        flushw                          ! flush all but the active register window
     56
     57        /*
     58         * Prepare to copy the kernel image to 4M.
     59         */
     60
     61        set LMA, %g1                    ! source address
     62        set VMA, %g2                    ! destination address (VMA)
     63        set hardcoded_ktext_size, %g3   ! link address of hardcoded_ktext_size
     64        set hardcoded_kdata_size, %g4   ! link address of hardcoded_kdata_size
     65
     66        sub %g3, %g2, %g3               ! offset of hardcoded_ktext_size from the beginning of the load address
     67        sub %g4, %g2, %g4               ! offset of hardcoded_kdata_size from the beginning of the load address
     68       
     69        ldx [%g3 + %g1], %g3            ! hardcoded_ktext_size -> %g3
     70        ldx [%g4 + %g1], %g4            ! hardcoded_kdata_size -> %g4
     71
     72        add %g3, %g4, %g3               ! size of kernel text and data
     73
     74        /*
     75         * Start copying the kernel from higher addresses towards lower addresses.
     76         */
     77
     782:      dec %g3
     79        ldub [%g1 + %g3], %g4
     80        stb %g4, [%g2 + %g3]
     81        cmp %g3, 0
     82        bnz 2b
     83        nop
     84
     85        set relocated, %g1
     86        jmp %g1
     87        nop
     88
     89relocated:
    5390        set ofw, %l0
    5491
Note: See TracChangeset for help on using the changeset viewer.