startup.s

来自「Windows CE 6.0 BSP for VOIP sample phone」· S 代码 · 共 100 行

S
100
字号
;
; Copyright (c) Microsoft Corporation.  All rights reserved.
;
;
; Use of this sample source code is subject to the terms of the Microsoft
; license agreement under which you licensed this sample source code. If
; you did not accept the terms of the license agreement, you are not
; authorized to use this sample source code. For the terms of the license,
; please see the license agreement between you and Microsoft or, if applicable,
; see the LICENSE.RTF on your install media or the root of your tools installation.
; THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
;
;------------------------------------------------------------------------------
;
;   File:  startup.s
;
;   Kernel startup routine for the Plato board.
;
;------------------------------------------------------------------------------

    INCLUDE kxarm.h
    
    IMPORT  KernelStart

    TEXTAREA
       
;------------------------------------------------------------------------
    
     
    ; Include memory configuration file with g_oalAddressTable
    ;
    INCLUDE oemaddrtab_cfg.inc
 
;-------------------------------------------------------------------------------
;
; OALStartUp: OEM OAL startup code.
;
; Inputs: None.
; 
; On return: N/A.
;
; Register used: r0
;
;-------------------------------------------------------------------------------
;
    ALIGN
    LEAF_ENTRY OALStartUp
    
    ; Compute the OEMAddressTable's physical address and 
    ; load it into r0. KernelStart expects r0 to contain
    ; the physical address of this table. The MMU isn't 
    ; turned on until well into KernelStart.  
    ;
    add     r0, pc, #g_oalAddressTable - (. + 8)
    mov     r11, r0
    b       KernelStart
    nop
    nop
    nop
    nop
    nop
    nop
    
STALL
    b       STALL               ; Spin forever.

;   ENTRY_END



;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------

    LTORG                           ; insert a literal pool here.

;
; TURN_ON_BTB - Enables the Branch Target Buffer
;
; Turn on the BTB via cp15.1[11] - Uses r0
;
;
    LEAF_ENTRY TURN_ON_BTB

    mcr p15, 0, r0, c7, c5, 0   ; flush the icache & BTB
    mrc p15, 0, r0, c1, c0, 0
    orr r0, r0, #0x800
    mcr p15, 0, r0, c1, c0, 0

  IF Interworking :LOR: Thumbing
    bx  lr
  ELSE
    mov  pc, lr          ; return
  ENDIF
   
        
    END 

;------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?