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

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

?? os_cpu_a.asm

?? ucosii在sharp7a400上的移植
?? ASM
字號:
/*;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Workfile:   os_cpu_a.asm  $
; $Revision:   1.0  $
; $Author:   WellsK  $
; $Date:   Sep 09 2003 14:55:46  $
; 
; Project: Lh7A400 MicroCos-II assembly code
;
; Description:
;     Assembly language files for the MicroCos-II OS and the LH7A400
;     port. (This file is used with the GNU assembler)
;
; Revision history:
; $Log:   //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/csps/lh7a404/ports/ucosii/os_cpu_a.asm-arc  $
; 
;  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*/

    .global ucos_irq_handler
    .global OSStartHighRdy
    .global OS_TASK_SW
    .global OSCtxSw
    .global OSIntCtxSw

    .global OSRunning
    .global OSTaskSwHook
    .global OSTCBHighRdy
    .global OSTCBCur
    .global OSPrioHighRdy
    .global OSPrioCur
    .global OSIntNesting
    .global OSIntEnter
    .global OSTimeTick
    .global OSIntExit
    .global irq_func_ptrs

/*;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Private defines and data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*/

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

    .text
    .code 32
    .align 2

/*;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; 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 ptr of cur task */

    BL OSTaskSwHook                   /* Call OSTaskSwHook */

OSCtxSw_from_int:
    LDR r0, =OSTCBHighRdy             /* Get highest priority TCB */
    LDR r2, [r0]                      /* Get waiting task TCB addr */
    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 addr */
    LDRB r1, [r0]                     /* Get highest priority */
    LDR r0, =OSPrioCur                /* Get current priority addr */
    STRB r1, [r0]                     /* OSPrioCur = OSPrioHighRdy */

OSCtxSw_from_start:
    LDMFD sp!, {r0}                   /* Get CPSR val - 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 ptr from CPSR */
    LDMFD sp!, {r0-r12, lr}           /* Restore regs 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 ints 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 ptr 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 ret addr */
    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 int 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 addr */
    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                     /* Int 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, best to save all */
                                      /* regs, 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王其| 制服丝袜中文字幕一区| 高清在线成人网| 成年人午夜久久久| 一本大道久久a久久综合| 国产精品99久久久久久久vr| 午夜激情久久久| 亚洲免费大片在线观看| 精品成人一区二区三区| 久久只精品国产| 日韩欧美的一区| 久久久国产精品麻豆| 中文字幕国产精品一区二区| 欧美mv和日韩mv的网站| 欧美一区二区大片| 欧美剧在线免费观看网站| 不卡一二三区首页| 欧美日韩在线三区| 精品久久久久久最新网址| 中文字幕乱码亚洲精品一区| 午夜精品久久久久久久99樱桃| 国模娜娜一区二区三区| 久久激情五月婷婷| 精品一区二区三区免费观看| 麻豆精品新av中文字幕| youjizz国产精品| 色综合网色综合| 在线免费视频一区二区| 欧美性猛片aaaaaaa做受| 久久综合色之久久综合| 一区二区三区精品在线观看| 国产精品系列在线播放| 91久久人澡人人添人人爽欧美| av网站一区二区三区| 91精品一区二区三区在线观看| ...xxx性欧美| 亚洲第一会所有码转帖| 成人丝袜视频网| 日韩一区二区三区av| 亚洲一区二区三区四区五区中文| 午夜久久久久久电影| 99久久亚洲一区二区三区青草 | 亚洲欧美视频一区| 国内精品第一页| 日韩写真欧美这视频| 亚洲午夜久久久久久久久久久| 性欧美大战久久久久久久久| 国产福利不卡视频| 2014亚洲片线观看视频免费| 日本不卡不码高清免费观看| 国产精品亚洲一区二区三区在线| 日韩一级大片在线观看| 亚洲国产乱码最新视频| 日本久久电影网| 成人免费一区二区三区视频 | 日韩国产高清在线| 国产精品一区免费在线观看| 日韩三级视频在线看| 五月婷婷久久综合| 欧美日韩精品系列| 午夜日韩在线观看| 欧美丰满高潮xxxx喷水动漫| 亚洲自拍偷拍欧美| 欧美男男青年gay1069videost| 一区二区国产视频| 欧美日韩免费一区二区三区视频| 亚洲国产日产av| 欧美二区在线观看| 日韩成人一区二区三区在线观看| 欧美精品高清视频| 另类的小说在线视频另类成人小视频在线| 欧美肥妇毛茸茸| 国产自产2019最新不卡| 欧美极品美女视频| 91福利国产精品| 日韩电影在线一区| 久久久蜜桃精品| 9l国产精品久久久久麻豆| 日韩毛片视频在线看| 国产精品一区二区久久不卡| 久久九九99视频| 久久国产尿小便嘘嘘尿| xfplay精品久久| 波多野结衣精品在线| 亚洲国产精品精华液网站| 欧美一区二区福利在线| 国产福利视频一区二区三区| 亚洲视频精选在线| 91麻豆精品国产91久久久资源速度| 看片网站欧美日韩| 中文字幕欧美一| 欧美大片在线观看| 国产精品18久久久久久久久| 亚洲人成精品久久久久久 | 久久精品国产免费| 国产欧美一区在线| 国产精一区二区三区| 亚洲天堂网中文字| 日韩精品一区二区三区老鸭窝| 成人午夜视频福利| 日韩国产在线一| 欧美日韩国产电影| 粉嫩久久99精品久久久久久夜| 亚洲综合丝袜美腿| 国产清纯美女被跳蛋高潮一区二区久久w | av资源站一区| 青青草国产精品亚洲专区无| 亚洲欧美电影一区二区| 91精品国产综合久久久久久久久久 | 亚洲综合自拍偷拍| 久久亚洲精品小早川怜子| 欧美怡红院视频| 成人一区二区三区| 久久国产精品99久久久久久老狼| 亚洲女人的天堂| 国产日韩高清在线| 欧美一区二区三区免费大片| 91丨porny丨中文| 亚洲一区二区偷拍精品| 中文av一区二区| 欧美亚洲免费在线一区| www.久久久久久久久| 国产成人精品在线看| 麻豆极品一区二区三区| 天天综合色天天综合色h| 亚洲视频在线观看三级| 欧美国产禁国产网站cc| 国产欧美一区二区三区在线老狼| 日韩欧美精品在线| 日韩欧美一区二区三区在线| 欧美美女激情18p| 欧美美女黄视频| 7777精品伊人久久久大香线蕉| 欧美视频日韩视频在线观看| 91视频在线观看| 8x福利精品第一导航| 色呦呦国产精品| 一本色道久久加勒比精品 | 成人免费视频在线观看| 国产人久久人人人人爽| 欧美极品美女视频| 国产精品美女一区二区三区| 欧美国产精品专区| 亚洲国产精品99久久久久久久久 | 男女男精品视频网| 热久久国产精品| 韩国精品主播一区二区在线观看| 九九**精品视频免费播放| 国产一区欧美二区| 亚洲高清免费观看高清完整版在线观看| 亚洲天堂久久久久久久| 一区二区三区小说| 日韩国产高清在线| 国产麻豆成人传媒免费观看| 国v精品久久久网| 99精品欧美一区二区蜜桃免费| 99在线精品观看| 欧美剧情片在线观看| 日韩一区二区三区视频在线| 精品1区2区在线观看| 亚洲国产电影在线观看| 夜夜精品视频一区二区 | 久久久国产午夜精品| 国产精品激情偷乱一区二区∴| 一区二区三区中文免费| 蜜桃视频在线观看一区| 国产精品正在播放| 日本丰满少妇一区二区三区| 555www色欧美视频| 国产精品视频看| 日韩电影在线看| 成人97人人超碰人人99| 欧美日韩国产经典色站一区二区三区| 欧美成va人片在线观看| 一区二区三区在线影院| 狠狠色丁香婷婷综合| 色一情一乱一乱一91av| 日韩你懂的在线播放| 中文字幕一区不卡| 日韩精品欧美精品| 色综合色狠狠天天综合色| 欧美v国产在线一区二区三区| 亚洲丝袜美腿综合| 国产在线视频不卡二| 欧美日韩亚洲高清一区二区|