Back to home page

LXR

 
 

    


0001     ! Copyright 2005,2006,2007,2009 Imagination Technologies
0002 
0003 #include <linux/init.h>
0004 #include <asm/metag_mem.h>
0005 #include <generated/asm-offsets.h>
0006 #undef __exit
0007 
0008     __HEAD
0009     ! Setup the stack and get going into _metag_start_kernel
0010     .global __start
0011     .type   __start,function
0012 __start:
0013     ! D1Ar1 contains pTBI (ISTAT)
0014     ! D0Ar2 contains pTBI
0015     ! D1Ar3 contains __pTBISegs
0016     ! D0Ar4 contains kernel arglist pointer
0017 
0018     MOVT    D0Re0,#HI(___pTBIs)
0019     ADD     D0Re0,D0Re0,#LO(___pTBIs)
0020     SETL    [D0Re0],D0Ar2,D1Ar1
0021     MOVT    D0Re0,#HI(___pTBISegs)
0022     ADD     D0Re0,D0Re0,#LO(___pTBISegs)
0023     SETD    [D0Re0],D1Ar3
0024     MOV A0FrP,#0
0025     MOV D0Re0,#0
0026     MOV D1Re0,#0
0027     MOV D1Ar3,#0
0028     MOV D1Ar1,D0Ar4         !Store kernel boot params
0029     MOV D1Ar5,#0
0030     MOV D0Ar6,#0
0031 #ifdef CONFIG_METAG_DSP
0032     MOV D0.8,#0
0033 #endif
0034     MOVT    A0StP,#HI(_init_thread_union)
0035     ADD A0StP,A0StP,#LO(_init_thread_union)
0036     ADD     A0StP,A0StP,#THREAD_INFO_SIZE
0037     MOVT    D1RtP,#HI(_metag_start_kernel)
0038     CALL    D1RtP,#LO(_metag_start_kernel)
0039     .size   __start,.-__start
0040 
0041     !! Needed by TBX
0042     .global __exit
0043     .type   __exit,function
0044 __exit:
0045     XOR     TXENABLE,D0Re0,D0Re0
0046     .size   __exit,.-__exit
0047 
0048 #ifdef CONFIG_SMP
0049     .global _secondary_startup
0050     .type _secondary_startup,function
0051 _secondary_startup:
0052 #if CONFIG_PAGE_OFFSET < LINGLOBAL_BASE
0053     ! In case GCOn has just been turned on we need to fence any writes that
0054     ! the boot thread might have performed prior to coherency taking effect.
0055     MOVT    D0Re0,#HI(LINSYSEVENT_WR_ATOMIC_UNLOCK)
0056     MOV D1Re0,#0
0057     SETD    [D0Re0], D1Re0
0058 #endif
0059     MOVT    A0StP,#HI(_secondary_data_stack)
0060     ADD A0StP,A0StP,#LO(_secondary_data_stack)
0061     GETD    A0StP,[A0StP]
0062     ADD A0StP,A0StP,#THREAD_INFO_SIZE
0063     B   _secondary_start_kernel
0064     .size   _secondary_startup,.-_secondary_startup
0065 #endif