Ignore:
Timestamp:
May 1, 1996, 3:25:33 PM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
bf6661e
Parents:
dce1c1a1
Message:

Updates from Eric Norum.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/gen68360/start/start360.s

    rdce1c1a1 r996a9cb4  
    299299
    300300/*
    301  * Place the low-order 3 octets of the board's
    302  * ethernet address at a `well-known' location.
     301 * Place the low-order 3 octets of the board's ethernet address at
     302 * a `well-known' fixed location relative to the beginning of ROM.
    303303 */
    304304        .align 2
    305 |       .long   ETHERNET_ADDRESS        | 08: Low-order 3 octets
     305        .long   ETHERNET_ADDRESS        | Low-order 3 octets of ethernet address
    306306
    307307/*
     
    348348        jmp     SYM(_Init68360)         | Start C code (which never returns)
    349349
    350 
    351350/*
    352  * Clear BSS, set up real stack, initialize heap, start C program
    353  * Assume that BSS size is a multiple of 4.
    354  * FIXME: The zero-loop should be changed to put the CPU into loop-mode.
    355  * FIXME: PROM-based systems will have to copy data segment to RAM here
     351 * Copy DATA segment, clear BSS segment, set up real stack,
     352 * initialize heap, start C program.
     353 * Assume that DATA and BSS sizes are multiples of 4.
    356354 */
    357         PUBLIC (_ClearBSSAndStart)
    358 SYM(_ClearBSSAndStart):
    359         movel   #clear_start,a0
    360         movel   #clear_end,a1
    361         clrl    d0
    362         bras ZEROLOOPTEST
     355        PUBLIC (_CopyDataClearBSSAndStart)
     356SYM(_CopyDataClearBSSAndStart):
     357        lea     copy_start,a0           | Get start of DATA in RAM
     358        lea     SYM(etext),a2           | Get start of DATA in ROM
     359        cmpl    a0,a2                   | Are they the same?
     360        beq.s   NOCOPY                  | Yes, no copy necessary
     361        lea     copy_end,a1             | Get end of DATA in RAM
     362        bra.s   COPYLOOPTEST            | Branch into copy loop
     363COPYLOOP:
     364        movel   a2@+,a0@+               | Copy word from ROM to RAM
     365COPYLOOPTEST:
     366        cmpl    a1,a0                   | Done?
     367        bcs.s   COPYLOOP                | No, skip
     368NOCOPY:
     369
     370        lea     clear_start,a0          | Get start of BSS
     371        lea     clear_end,a1            | Get end of BSS
     372        clrl    d0                      | Value to set
     373        bra.s   ZEROLOOPTEST            | Branch into clear loop
    363374ZEROLOOP:
    364         movel   d0,a0@+
     375        movel   d0,a0@+                 | Clear a word
    365376ZEROLOOPTEST:
    366         cmpl    a1,a0
    367         bcs     ZEROLOOP
     377        cmpl    a1,a0                   | Done?
     378        bcs.s   ZEROLOOP                | No, skip
     379
    368380        movel   #stack_init,a7          | set master stack pointer
    369381        movel   d0,a7@-                 | environp
Note: See TracChangeset for help on using the changeset viewer.