Changeset f6b5593 in mainline for kernel/arch/ia64/src/start.S


Ignore:
Timestamp:
2009-09-21T11:53:03Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4098e38
Parents:
2f636b6 (diff), c1618ed (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/src/start.S

    r2f636b6 rf6b5593  
    3232#include <mm/asid.h>
    3333
    34 #define RR_MASK (0xFFFFFFFF00000002)
    35 #define RID_SHIFT       8
    36 #define PS_SHIFT        2
    37 
    38 #define KERNEL_TRANSLATION_I    0x0010000000000661
    39 #define KERNEL_TRANSLATION_D    0x0010000000000661
    40 #define KERNEL_TRANSLATION_VIO  0x0010000000000671
    41 #define KERNEL_TRANSLATION_IO   0x00100FFFFC000671
    42 #define KERNEL_TRANSLATION_FW   0x00100000F0000671
     34#define RR_MASK    (0xFFFFFFFF00000002)
     35#define RID_SHIFT  8
     36#define PS_SHIFT   2
     37
     38#define KERNEL_TRANSLATION_I    0x0010000000000661
     39#define KERNEL_TRANSLATION_D    0x0010000000000661
     40#define KERNEL_TRANSLATION_VIO  0x0010000000000671
     41#define KERNEL_TRANSLATION_IO   0x00100FFFFC000671
     42#define KERNEL_TRANSLATION_FW   0x00100000F0000671
    4343
    4444.section K_TEXT_START, "ax"
     
    4949kernel_image_start:
    5050        .auto
    51 
     51       
    5252#ifdef CONFIG_SMP
    5353        # Identify self(CPU) in OS structures by ID / EID
    54 
     54       
    5555        mov r9 = cr64
    5656        mov r10 = 1
     
    6262        st1 [r8] = r10
    6363#endif
    64 
     64       
    6565        mov psr.l = r0
    6666        srlz.i
    6767        srlz.d
    68 
     68       
    6969        # Fill TR.i and TR.d using Region Register #VRN_KERNEL
    70 
     70       
    7171        movl r8 = (VRN_KERNEL << VRN_SHIFT)
    7272        mov r9 = rr[r8]
    73 
     73       
    7474        movl r10 = (RR_MASK)
    7575        and r9 = r10, r9
    7676        movl r10 = ((RID_KERNEL << RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT))
    77         or  r9 = r10, r9
    78 
     77        or r9 = r10, r9
     78       
    7979        mov rr[r8] = r9
    80 
     80       
    8181        movl r8 = (VRN_KERNEL << VRN_SHIFT)
    8282        mov cr.ifa = r8
    83 
     83       
    8484        mov r11 = cr.itir
    8585        movl r10 = (KERNEL_PAGE_WIDTH << PS_SHIFT)
    8686        or r10 = r10, r11
    8787        mov cr.itir = r10
    88 
     88       
    8989        movl r10 = (KERNEL_TRANSLATION_I)
    9090        itr.i itr[r0] = r10
    9191        movl r10 = (KERNEL_TRANSLATION_D)
    9292        itr.d dtr[r0] = r10
    93 
     93       
    9494        movl r7 = 1
    9595        movl r8 = (VRN_KERNEL << VRN_SHIFT) | VIO_OFFSET
     
    9797        movl r10 = (KERNEL_TRANSLATION_VIO)
    9898        itr.d dtr[r7] = r10
    99 
     99       
    100100        mov r11 = cr.itir
    101101        movl r10 = ~0xfc
     
    104104        or r10 = r10, r11
    105105        mov cr.itir = r10
    106 
     106       
    107107        movl r7 = 2
    108108        movl r8 = (VRN_KERNEL << VRN_SHIFT) | IO_OFFSET
     
    110110        movl r10 = (KERNEL_TRANSLATION_IO)
    111111        itr.d dtr[r7] = r10
    112 
    113         # Setup mapping for fimware arrea (also SAPIC)
    114 
     112       
     113        # Setup mapping for firmware area (also SAPIC)
     114       
    115115        mov r11 = cr.itir
    116116        movl r10 = ~0xfc
     
    119119        or r10 = r10, r11
    120120        mov cr.itir = r10
    121 
     121       
    122122        movl r7 = 3
    123123        movl r8 = (VRN_KERNEL << VRN_SHIFT) | FW_OFFSET
     
    125125        movl r10 = (KERNEL_TRANSLATION_FW)
    126126        itr.d dtr[r7] = r10
    127 
     127       
     128        # Initialize DSR
     129       
     130        movl r10 = (DCR_DP_MASK | DCR_DK_MASK | DCR_DX_MASK | DCR_DR_MASK | DCR_DA_MASK | DCR_DD_MASK | DCR_LC_MASK)
     131        mov r9 = cr.dcr
     132        or r10 = r10, r9
     133        mov cr.dcr = r10
     134       
    128135        # Initialize PSR
    129 
     136       
    130137        movl r10 = (PSR_DT_MASK | PSR_RT_MASK | PSR_IT_MASK | PSR_IC_MASK)  /* Enable paging */
    131138        mov r9 = psr
    132 
     139       
    133140        or r10 = r10, r9
    134141        mov cr.ipsr = r10
     
    138145        srlz.d
    139146        srlz.i
    140 
     147       
    141148        .explicit
    142 
     149       
    143150        /*
    144151         * Return From Interrupt is the only way to
     
    147154        rfi ;;
    148155
    149 
    150156.global paging_start
    151157paging_start:
    152 
     158       
    153159        /*
    154160         * Now we are paging.
    155161         */
    156 
     162       
    157163        # Switch to register bank 1
    158164        bsw.1
    159 
     165       
    160166#ifdef CONFIG_SMP
    161167        # Am I BSP or AP?
     
    164170        cmp.eq p3, p2 = r20, r0 ;;
    165171#else
    166         cmp.eq p3, p2 = r0, r0 ;;       /* you are BSP */
    167 #endif  /* CONFIG_SMP */
     172        cmp.eq p3, p2 = r0, r0 ;;  /* you are BSP */
     173#endif  /* CONFIG_SMP */
    168174       
    169175        # Initialize register stack
     
    172178        mov ar.bspstore = r8
    173179        loadrs
    174 
     180       
    175181        # Initialize memory stack to some sane value
    176182        movl r12 = stack0 ;;
    177         add r12 = -16, r12      /* allocate a scratch area on the stack */
    178 
     183        add r12 = -16, r12  /* allocate a scratch area on the stack */
     184       
    179185        # Initialize gp (Global Pointer) register
    180         movl r20 = (VRN_KERNEL << VRN_SHIFT);;
    181         or r20 = r20,r1;;
    182         movl r1 = _hardcoded_load_address
     186        movl r20 = (VRN_KERNEL << VRN_SHIFT) ;;
     187        or r20 = r20, r1 ;;
     188        movl r1 = kernel_image_start
    183189       
    184190        /*
    185          * Initialize hardcoded_* variables. Do only BSP
     191         * Initialize bootinfo on BSP.
    186192         */
    187 (p3)    movl r14 = _hardcoded_ktext_size
    188 (p3)    movl r15 = _hardcoded_kdata_size
    189 (p3)    movl r16 = _hardcoded_load_address ;;
    190 (p3)    addl r17 = @gprel(hardcoded_ktext_size), gp
    191 (p3)    addl r18 = @gprel(hardcoded_kdata_size), gp
    192 (p3)    addl r19 = @gprel(hardcoded_load_address), gp
    193 (p3)    addl r21 = @gprel(bootinfo), gp
    194         ;;
    195 (p3)    st8 [r17] = r14
    196 (p3)    st8 [r18] = r15
    197 (p3)    st8 [r19] = r16
     193(p3)    addl r21 = @gprel(bootinfo), gp ;;
    198194(p3)    st8 [r21] = r20
    199 
     195       
    200196        ssm (1 << 19) ;; /* Disable f32 - f127 */
    201197        srlz.i
    202198        srlz.d ;;
    203 
     199       
    204200#ifdef CONFIG_SMP
    205201(p2)    movl r18 = main_ap ;;
    206 (p2)    mov b1 = r18 ;;
     202(p2)    mov b1 = r18 ;;
    207203(p2)    br.call.sptk.many b0 = b1
    208 
     204       
    209205        # Mark that BSP is on
     206       
    210207        mov r20 = 1 ;;
    211208        movl r21 = bsp_started ;;
    212209        st8 [r21] = r20 ;;
    213210#endif
    214 
     211       
    215212        br.call.sptk.many b0 = arch_pre_main
    216 
     213       
    217214        movl r18 = main_bsp ;;
    218215        mov b1 = r18 ;;
     
    227224kernel_image_ap_start:
    228225        .auto
    229 
     226       
    230227        # Identify self(CPU) in OS structures by ID / EID
    231 
     228       
    232229        mov r9 = cr64
    233230        mov r10 = 1
     
    240237       
    241238        # Wait for wakeup synchro signal (#3 in cpu_by_id_eid_list)
    242        
     239
    243240kernel_image_ap_start_loop:
    244241        movl r11 = kernel_image_ap_start_loop
    245242        and r11 = r11, r12
    246         mov b1 = r11
    247 
    248         ld1 r20 = [r8] ;;
    249         movl r21 = 3 ;;
    250         cmp.eq p2, p3 = r20, r21 ;;
     243        mov b1 = r11
     244       
     245        ld1 r20 = [r8]
     246        movl r21 = 3
     247        cmp.eq p2, p3 = r20, r21
    251248(p3)    br.call.sptk.many b0 = b1
    252 
     249       
    253250        movl r11 = kernel_image_start
    254251        and r11 = r11, r12
    255         mov b1 = r11 
     252        mov b1 = r11
    256253        br.call.sptk.many b0 = b1
    257254
     
    259256.global bsp_started
    260257bsp_started:
    261 .space 8
     258        .space 8
    262259
    263260.align 4096
    264261.global cpu_by_id_eid_list
    265262cpu_by_id_eid_list:
    266 .space 65536
    267 
    268 #endif  /* CONFIG_SMP */
     263        .space 65536
     264
     265#endif  /* CONFIG_SMP */
Note: See TracChangeset for help on using the changeset viewer.