亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? os_cpu_a.s

?? ucosii在sharp7a400上的移植
?? S
字號:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Workfile:   os_cpu_a.s  $
; $Revision:   1.0  $
; $Author:   WellsK  $
; $Date:   Jun 30 2003 15:18:32  $
; 
; Project: Lh7A400 MicroCos-II assembly code
;
; Description:
;     Assembly language files for the MicroCos-II OS and the LH7A400
;     port.
;
; Revision history:
; $Log:   //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/csps/lh7a400/ports/ucosii/os_cpu_a.s-arc  $
; 
;    Rev 1.0   Jun 30 2003 15:18:32   WellsK
; Initial revision.
; 
;  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
; OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
; AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES, 
; SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
; 
; SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY 
; FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A 
; SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
; FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
; 
; COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
;     CAMAS, WA
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    EXPORT ucos_irq_handler
    EXPORT OSStartHighRdy
    EXPORT OS_TASK_SW
    EXPORT OSCtxSw
    EXPORT OSIntCtxSw

    IMPORT OSRunning
    IMPORT OSTaskSwHook
    IMPORT OSTCBHighRdy
    IMPORT OSTCBCur
    IMPORT OSPrioHighRdy
    IMPORT OSPrioCur
    IMPORT OSIntNesting
    IMPORT OSIntEnter
    IMPORT OSTimeTick
    IMPORT OSIntExit
    IMPORT irq_func_ptrs

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Private defines and data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

MODE_SVC             EQU 0x00000013
MODE_DIS_IRQ         EQU 0x00000080
INTC_BASE_ADDR       EQU 0x80000500
INTC_SOURCE_OFF      EQU 0x00000000
INTC_TIMER1_INT_MASK EQU 0x00000100
TIMER1_INT_CLR       EQU 0x80000C0C
INTC_FIRST_IRQ       EQU 5

    AREA |C$$code|, CODE, READONLY

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Function: OSStartHighRdy
;
; Purpose: Set highest priority uCos-II task ready to run
;
; Description:
;     Call the OSTaskSwHook() function. Set OSRunning to TRUE. Get the
;     address of the highest priority task control block. Get the
;     stack pointer for the highest prior task (from the fetched TCB).
;     Set the current stack pointer to the fetched stack pointer. Set
;     the current task control block pointer to the highest priority
;     task control block pointer. Restore the new task's SPSR and CPSR
;     registers. Restore all ARM registers for the task and continue
;     the task.
;
; Parameters: NA
;
; Outputs; NA
;
; Returns: NA
;
; Notes: This function should never be called from the IRQ level.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
OSStartHighRdy
    BL OSTaskSwHook                   ; Call OSTaskSwHook
    LDR r0, =OSRunning
    MOV r1, #1
    STRB r1, [r0]                     ; OSRunning = TRUE

    LDR r0, =OSTCBHighRdy             ; Get highest priority TCB
    LDR r0, [r0]                      ; Get waiting task TCB address
    LDR sp, [r0]                      ; Switch to the new task stack

    B OSCtxSw_from_start              ; Start first task

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Function: OS_TASK_SW (also known as OSCtxSw)
;
; Purpose: Task level context switch
;
; Description:
;     Save the current task registers and status on the task stack.
;     Save the current task stack pointer in the current TCB. Call
;     the OSTaskSwHook() function. Set OSPrioCur = OSPrioHighRdy.
;     Branch to the switch_tcb() function to restore the context of
;     the new task.
;
; Parameters: NA
;
; Outputs; NA
;
; Returns: NA
;
; Notes: This function should never be called from the IRQ level.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
OS_TASK_SW
OSCtxSw
    STMFD sp!, {lr}                   ; Save resume address
    STMFD sp!, {r0-r12, lr}           ; Save current task registers
    MRS r0, cpsr
    STMFD sp!, {r0}                   ; Save current CPSR

    LDR r0, =OSTCBCur
    LDR r0, [r0]                      ; Get pointer to current TCB
    STR sp, [r0]                      ; Save stack pointer of cur task

    BL OSTaskSwHook                   ; Call OSTaskSwHook

OSCtxSw_from_int
    LDR r0, =OSTCBHighRdy             ; Get highest priority TCB
    LDR r2, [r0]                      ; Get waiting task TCB address
    LDR r0, =OSTCBCur                 ; Get current TCB
    STR r2, [r0]                      ; OSTCBCur = OSTCBHighRdy
    LDR sp, [r2]                      ; Get new task stack pointer

    LDR r0, =OSPrioHighRdy            ; Get highest priority address
    LDRB r1, [r0]                     ; Get highest priority
    LDR r0, =OSPrioCur                ; Get current priority address
    STRB r1, [r0]                     ; OSPrioCur = OSPrioHighRdy

OSCtxSw_from_start
    LDMFD sp!, {r0}                   ; Get CPSR value - this will be
    MSR spsr_cf, r0                   ; restored on function resume
    LDMFD sp!, {r0-r12, lr, pc}^      ; Load task registers and continue
                                      ; task 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Function: OSTickISR
;
; Purpose: OS timer tick
;
; Description:
;     See function comments.
;
; Parameters: NA
;
; Outputs; NA
;
; Returns: NA
;
; Notes:
;     This function will always be called from ucos_irq_handler() on
;     a timer interrupt. All other interrupts are handled directly in
;     the ucos_irq_handler() function.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
OSTickISR
; At this point, the real handling of the interrupt is done and the
; context change for the task and ARM core may need to be done. The ARM
; core is presently in the ARM IRQ mode and may have nested interrupts.
; Call the OSIntEnter(), OSTimeTick(), and OSIntExit() functions.
    BL OSIntEnter                     ; Call OSIntEnter()
    BL OSTimeTick                     ; Call OSTimeTick()
    BL OSIntExit                      ; Call OSIntExit()

; A task context is not needed if the current and highest priority
; tasks are the same. Check the TCB pointers. If they are the same,
; just return from the interrupt and continue the task that was
; already running.
    LDR r8, =OSTCBCur
    LDR r9, =OSTCBHighRdy
    LDR r8, [r8]
    LDR r9, [r9]
    CMP r8, r9                        ; Are current and next TCB's
                                      ; the same?
    BEQ no_switch                     ; If the same, then just exit IRQ

; The ARM core is still in IRQ mode. The task's r0-12 registers and the
; task resume address (lr) are saved on the IRQ mode stack, but need to
; be saved on the task's stack. The task's original link register (lr
; in the task's mode) and the task's ARM core mode (CSPR) also need to
; be saved on the task's stack).

    BL OSTaskSwHook                   ; Call OSTaskSwHook()

    MRS r0, spsr                      ; Get interrupted task's mode
    STMFD sp!, {r0}                   ; Save task's CPSR on IRQ stack
                                      ; so task mode can use it

; Restore the IRQ stack pointer
    ADD sp, sp, #4                    ; Restore stack pointer from CPSR
    LDMFD sp!, {r0-r12, lr}           ; Restore registers to task state

; Go into task mode with interrupts disabled
    MRS r0, spsr                      ; Get interrupted task's mode
    ORR r0, r0, #MODE_DIS_IRQ         ; Disable interrupts in task mode
    MOV r1, sp                        ; Get IRQ stack pointer - this is
                                      ; need for task mode
    MSR cpsr_cf, r0                   ; Switch to task mode with
                                      ; interrupts disabled

; Get task's PC from IRQ stack
    LDR r0, [r1, #-4]                 ; Get task's resume address
    STMFD sp!, {r0}                   ; Save resume address

    STMFD sp!, {r2-r12, lr}           ; Save task's registers
    LDR r0, [r1, #-60]                ; Get task's CPSR
    LDR r2, [r1, #-52]                ; Restore task's r1
    LDR r1, [r1, #-56]                ; Restore task's r0
    STMFD sp!, {r0-r2}                ; Save r0, r1, and CPSR

; The task state is now saved on the task stack. Adjsut the stack size
; by one more word to account for the saved resume address and save
; the task stack pointer
    LDR r0, =OSTCBCur
    LDR r0, [r0]                      ; Get pointer to current TCB
    STR sp, [r0]                      ; Save stack pointer of cur task

    B OSCtxSw_from_int                ; Switch to new task

no_switch
    LDMFD sp!, {r0-r12, pc}^          ; Restore and exit

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Function: OSIntCtxSw
;
; Purpose: OS interrupt level task context switch
;
; Description:
;     This function does nothing. The real interrupt level task context
;     switch is done after the return from the OSIntExit() function in
;     OSTickISR() function. It's a bit easier to do it there, makes
;     register restoration easier, and the IRQ mode stack pointer is
;     already in the correct position. The call to OSTaskSwHook() is
;     still performed here.
;
; Parameters: NA
;
; Outputs; NA
;
; Returns: NA
;
; Notes:
;     This function is called from OSIntExit() to perform a task level
;     context switch.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
OSIntCtxSw
    MOV pc, lr

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Function: ucos_irq_handler
;
; Purpose: Main interrupt (IRQ) handler for uCos-II
;
; Description:
;     See function comments.
;
; Parameters: NA
;
; Outputs; NA
;
; Returns: NA
;
; Notes:
;     This function works with the LH7A400 interrupt driver and uses
;     data initialized and maintained with that driver.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ucos_irq_handler
; Save registers we use for the interrupt
    SUB lr, lr, #4                    ; Adjust lr to real return address
    STMFD sp!, {r0-r12, lr}

; Read the interrupt controller pending register
    LDR r1, =INTC_BASE_ADDR
    LDR r0, [r1, #INTC_SOURCE_OFF]

; Was it a timer 1 interrupt?
    LDR r2, =INTC_TIMER1_INT_MASK
    AND r3, r0, r2                    ; Mask off timer 1 interrupt bit
    CMP r3, r2                        ; Was it a timer 1 interrupt?
    BNE intc_not_timer                ; Not a timer interrupt

; This was a timer interrupt, so clear the timer and perform ThreadX
; context switching
    LDR r3, =TIMER1_INT_CLR           ; Timer 1 interrupt clear address
    STR r0, [r3]                      ; Clear the timer 1 interrupt
    B OSTickISR                       ; Perform OS timer tick

intc_not_timer
; Loop through all the enabled interrupts and jump to the function
; for the first pending interrupt
    LDR r1, =INTC_FIRST_IRQ           ; Get first interrupt to check
    MOV r2, #0x00000001               ; Interrupt bit mask

; Start checking pending interrupt states
int_check
    MOV r3, r2, LSL r1                ; Build interrupt mask
    AND r4, r0, r3                    ; Check just one bit at a time
    CMP r4, r3                        ; Is interrupt pending?
    BEQ int_found                     ; Interrupt was found, handle it
    ADD r1, r1, #1                    ; Check next interrupt bit
    CMP r1, #0x1F                     ; Was this the last interrupt?
    BLE int_check                     ; Check next interrupt

; If the program made it to here, then the interrupt was not found,
; so just return to the caller, as we can do nothing
int_not_found
    B int_exit

; A pending interrupt was found, so jump to it's handler
int_found
    LDR r0, =irq_func_ptrs            ; Get address of jump table
    ADD r0, r0, r1, LSL #2            ; Add by interrupt offset
    LDR r0, [r0]                      ; Get handler address
    CMP r0, #0                        ; Is handler address NULL?
    BEQ int_exit                      ; If null, the exit
    MOV lr, pc                        ; Will return to int_exit
                                      ; handler, it is best to save all
                                      ; registers, so none get corrupted
    MOV pc, r0                        ; Jump to handler

; Exit the interrupt function
int_exit
    LDMFD sp!, {r0-r12, pc}^          ; Restore and exit

    END

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情综合亚洲精品| 99国产精品99久久久久久| 国产精品传媒入口麻豆| 欧美日产在线观看| 不卡av电影在线播放| 日韩综合一区二区| 亚洲欧美激情小说另类| 久久综合资源网| 欧美日韩国产123区| av不卡免费电影| 国产资源精品在线观看| 日一区二区三区| 亚洲久草在线视频| 中文字幕不卡的av| 精品粉嫩超白一线天av| 欧美一区二区在线观看| 91黄色免费观看| 波多野结衣欧美| 国产经典欧美精品| 成人美女视频在线观看| 水蜜桃久久夜色精品一区的特点| 最新国产成人在线观看| 国产欧美一区二区精品仙草咪| 91精品国产91热久久久做人人| 色琪琪一区二区三区亚洲区| 成人免费看视频| 国产69精品久久久久毛片| 精久久久久久久久久久| 久久99精品久久久| 久久精品国产澳门| 蜜桃视频一区二区| 日本美女视频一区二区| 婷婷久久综合九色综合伊人色| 一区二区三区中文字幕在线观看| 亚洲天堂免费看| 亚洲欧美色图小说| 亚洲免费在线观看视频| 亚洲精品国产视频| 亚洲一区av在线| 亚洲成人第一页| 亚洲成在人线免费| 污片在线观看一区二区| 日韩精品免费专区| 人妖欧美一区二区| 久久精品国产99久久6| 国内精品不卡在线| 国产福利一区二区三区视频 | 爽好多水快深点欧美视频| 亚洲一二三四区| 亚洲超碰精品一区二区| 日本美女一区二区| 国产一区二区三区综合| 国产传媒欧美日韩成人| 99久久久久久| 欧美亚洲精品一区| 欧美一区二区视频在线观看2022| 日韩精品一区二区三区在线播放| 精品国产乱码久久久久久夜甘婷婷 | 欧美亚洲尤物久久| 91精品国产综合久久久久| 日韩午夜在线观看视频| 久久精品视频一区二区| 中文字幕一区在线| 亚洲成人www| 国产精品 欧美精品| 91美女福利视频| 欧美一区二区免费| 欧美激情在线观看视频免费| 亚洲成人av一区二区三区| 美国十次综合导航| 99国产精品久久久| 欧美丰满少妇xxxxx高潮对白| 精品国产在天天线2019| 自拍偷拍亚洲欧美日韩| 视频在线观看一区| 成人在线视频一区| 欧美狂野另类xxxxoooo| 久久精品夜夜夜夜久久| 一区二区三区在线视频免费观看 | 成人黄色免费短视频| 在线视频一区二区三| 精品国产青草久久久久福利| 国产精品乱码人人做人人爱| 亚洲大片在线观看| 国产成人精品一区二区三区网站观看| 日本韩国精品在线| 日韩精品最新网址| 亚洲欧美一区二区不卡| 久久se精品一区二区| 91精品福利视频| 久久久.com| 日韩成人av影视| 99riav一区二区三区| 欧美大黄免费观看| 一区二区三区欧美| 国产精品中文字幕一区二区三区| 欧美特级限制片免费在线观看| 久久精品水蜜桃av综合天堂| 午夜国产精品一区| 99免费精品视频| 精品成人一区二区三区| 亚洲电影视频在线| eeuss鲁片一区二区三区| 日韩久久精品一区| 丝袜亚洲另类欧美综合| 色综合天天综合网天天狠天天 | 色美美综合视频| 国产日产亚洲精品系列| 久久激情综合网| 欧美日韩日日夜夜| 一区二区三区四区亚洲| 成人午夜视频在线| www激情久久| 日本va欧美va精品发布| 欧美三级日韩在线| 亚洲色图在线播放| av在线这里只有精品| 久久久久99精品国产片| 美女诱惑一区二区| 欧美一区二区三区四区在线观看| 夜夜精品浪潮av一区二区三区| jlzzjlzz亚洲女人18| 国产欧美精品一区| 国产毛片一区二区| 欧美精品一区二区三区很污很色的| 日韩二区三区四区| 欧美日韩激情一区二区三区| 亚洲三级电影网站| 99久久777色| 亚洲男人电影天堂| 色综合久久88色综合天天免费| 国产精品免费久久| 成人精品一区二区三区四区 | proumb性欧美在线观看| 欧美xxxxxxxxx| 亚洲国产wwwccc36天堂| 色天天综合色天天久久| 欧美一区二区三区在线电影 | 美女视频一区二区三区| 日韩一卡二卡三卡国产欧美| 日韩国产欧美三级| 69精品人人人人| 免费成人美女在线观看.| 日韩写真欧美这视频| 麻豆精品在线视频| 久久综合色一综合色88| 国产一区不卡精品| 中国色在线观看另类| 91日韩精品一区| 亚洲成人中文在线| 日韩欧美一区二区视频| 国产精品影视在线| 国产精品初高中害羞小美女文| 色激情天天射综合网| 午夜精品一区二区三区免费视频 | 在线成人av网站| 久久er精品视频| 欧美韩国日本一区| 91女神在线视频| 五月天激情小说综合| 久久久久久99久久久精品网站| 国产一区二区三区免费在线观看| 亚洲国产精品99久久久久久久久| 色综合久久久久久久久久久| 五月天精品一区二区三区| 久久亚洲精精品中文字幕早川悠里| 懂色av一区二区三区免费观看| 亚洲精品乱码久久久久久久久| 6080yy午夜一二三区久久| 国产麻豆精品久久一二三| 亚洲精品视频一区| 欧美一区二区啪啪| jlzzjlzz欧美大全| 日本美女一区二区| 国产精品久久一级| 在线综合视频播放| 成人精品视频一区二区三区尤物| 午夜国产精品影院在线观看| 国产亚洲综合av| 欧美视频在线一区| 国产一区二区久久| 亚洲综合成人在线| 久久久久久久久伊人| 欧美亚洲高清一区| 国产黄人亚洲片| 婷婷国产在线综合| 国产精品国产自产拍高清av| 宅男在线国产精品| 91啦中文在线观看| 国产黄人亚洲片| 免费在线看成人av| 伊人一区二区三区| 国产亚洲一区二区三区四区| 欧美妇女性影城| 91亚洲精品一区二区乱码| 精品国产成人系列| 69堂亚洲精品首页| 色噜噜狠狠成人网p站| 国产精品18久久久久久久久久久久| 亚洲国产日韩综合久久精品|