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

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

?? os_cpu_a.s79

?? ucosii在sharp7a400上的移植
?? S79
字號:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Workfile:   os_cpu_a.s79  $
; $Revision:   1.0  $
; $Author:   WellsK  $
; $Date:   Apr 27 2004 12:11:04  $
; 
; 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.s79-arc  $
;
;   Rev 1.0   Apr 27 2004 12:11:04   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

    RSEG CODESEG : CODE (2)
    CODE32 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; 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 LH7A404 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一区二区三区免费野_久草精品视频
日韩高清在线观看| 久久久久久久久久久久久女国产乱 | 久久蜜桃av一区二区天堂| 另类中文字幕网| 精品国产91久久久久久久妲己 | 91精品国产综合久久福利| 日韩精品五月天| 日韩一区二区三免费高清| 久久99国产乱子伦精品免费| 久久综合九色综合欧美就去吻| 国产成人自拍网| 亚洲欧美乱综合| 欧美久久久久中文字幕| 玖玖九九国产精品| 日本一区二区不卡视频| 91高清视频免费看| 青青草原综合久久大伊人精品 | 蜜桃在线一区二区三区| 26uuu久久天堂性欧美| 国产大片一区二区| 一区二区三区四区在线| 欧美一区二区三区的| 国产精一品亚洲二区在线视频| 国产精品久99| 欧美电影在哪看比较好| 国产成人精品免费| 亚洲午夜久久久| 久久精品欧美一区二区三区不卡 | 国产精品久久久久影院色老大| 色老综合老女人久久久| 麻豆精品在线播放| 亚洲欧美日韩成人高清在线一区| 欧美日韩国产123区| 国产成人免费视频网站| 综合激情成人伊人| 日韩一区二区在线免费观看| 成人综合激情网| 亚洲不卡av一区二区三区| 久久精品免费在线观看| 欧美日韩久久久久久| 国产91丝袜在线观看| 午夜电影网一区| 最新热久久免费视频| 精品国产99国产精品| 欧美艳星brazzers| 成人免费视频免费观看| 蜜臀va亚洲va欧美va天堂| 亚洲精品国产无天堂网2021| 久久伊99综合婷婷久久伊| 欧美日韩二区三区| 色综合天天综合狠狠| 国产精品一区二区三区网站| 日欧美一区二区| 亚洲另类在线制服丝袜| 国产午夜精品福利| 精品国产91久久久久久久妲己| 欧美日韩综合色| 91蝌蚪国产九色| 大胆欧美人体老妇| 国产精品一级黄| 麻豆精品一区二区综合av| 亚洲aaa精品| 亚洲欧美日本韩国| 亚洲欧美在线观看| 中文字幕在线不卡| 中文在线一区二区| 亚洲国产经典视频| 久久亚洲一级片| 日韩一区二区在线播放| 6080国产精品一区二区| 欧美色图天堂网| 91精彩视频在线| 色婷婷av一区二区| 色欧美乱欧美15图片| 成人午夜电影小说| 不卡视频在线观看| 成人av免费在线观看| 成人性生交大片免费看视频在线 | 国产精品一区久久久久| 国产乱码字幕精品高清av | 日韩视频一区二区| 日韩午夜激情电影| 精品国内二区三区| 国产丝袜在线精品| 中文字幕一区日韩精品欧美| 亚洲天堂中文字幕| 亚洲综合色噜噜狠狠| 亚洲一区二区三区视频在线 | 亚洲国产乱码最新视频 | 欧美精品久久久久久久多人混战| 欧美人体做爰大胆视频| 91精品国产综合久久久久久漫画 | 国产精品乱码妇女bbbb| 国产精品伦理一区二区| 亚洲精品日产精品乱码不卡| 亚洲综合免费观看高清完整版| 亚洲成人黄色小说| 久久99精品国产| 成人三级伦理片| 欧美亚洲国产一区二区三区va| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 国产成人精品亚洲777人妖| 成人一区二区在线观看| 91免费在线看| 91麻豆精品国产91久久久资源速度 | 欧美巨大另类极品videosbest| 欧美一级片免费看| 久久久99精品免费观看| 亚洲欧美电影一区二区| 日韩成人av影视| 97久久精品人人澡人人爽| 欧美性色黄大片| 欧美va在线播放| 亚洲特黄一级片| 免费日韩伦理电影| 99久久精品费精品国产一区二区| 欧美影院午夜播放| 久久蜜桃一区二区| 亚洲小说春色综合另类电影| 老司机免费视频一区二区| 成人av午夜电影| 欧美一级免费观看| 亚洲精品伦理在线| 激情五月婷婷综合网| 91成人免费网站| 久久精品夜色噜噜亚洲aⅴ| 亚洲一卡二卡三卡四卡五卡| 精品亚洲免费视频| 欧美体内she精视频| 国产视频一区在线播放| 日韩精品成人一区二区在线| 成人高清免费观看| 欧美大度的电影原声| 一区二区三区免费在线观看| 国产一区999| 69精品人人人人| 一区二区三区在线观看视频 | 久久综合久久99| 午夜国产精品影院在线观看| 顶级嫩模精品视频在线看| 日韩一区二区麻豆国产| 亚洲午夜免费视频| a美女胸又www黄视频久久| 欧美电影免费观看高清完整版在线 | 91网站视频在线观看| 久久久久久久网| 免费xxxx性欧美18vr| 欧美性色黄大片| 亚洲欧美日韩国产中文在线| 国产成人精品亚洲777人妖| 精品人在线二区三区| 日韩av一区二区三区四区| 欧美专区日韩专区| 亚洲色图在线播放| 成人av免费在线播放| 亚洲国产精品99久久久久久久久| 美国十次综合导航| 91精品国产欧美一区二区18| 亚洲一区视频在线| 欧美视频在线观看一区二区| 亚洲欧美日韩电影| 色94色欧美sute亚洲线路二| 亚洲欧洲日韩av| 波多野结衣91| 亚洲婷婷在线视频| heyzo一本久久综合| 国产精品久久久久久久久快鸭| 国产酒店精品激情| 久久久久久麻豆| 国产激情精品久久久第一区二区| 久久综合久久综合久久综合| 国精产品一区一区三区mba桃花| 日韩一级片在线观看| 精品一区二区在线免费观看| 欧美tickling挠脚心丨vk| 韩国一区二区三区| 久久久久久久精| 成人免费看的视频| 亚洲色图20p| 日本精品裸体写真集在线观看 | 亚洲综合在线免费观看| 在线观看亚洲精品视频| 午夜久久久久久电影| 制服丝袜av成人在线看| 麻豆视频观看网址久久| 久久人人97超碰com| 成人手机在线视频| 一区二区高清视频在线观看| 欧美日韩一本到| 久久国产欧美日韩精品| 国产欧美日韩另类视频免费观看| 东方aⅴ免费观看久久av| 一区二区成人在线视频| 91麻豆精品国产91久久久久久| 精品亚洲成av人在线观看| 中文字幕一区二区三区不卡在线| 91黄色激情网站| 美女视频黄频大全不卡视频在线播放| 久久一区二区三区国产精品| 成人av动漫网站|