sys_ppc.s

来自「abstract rtos」· S 代码 · 共 54 行

S
54
字号
#define _ASMLANGUAGE#include <vxWorks.h>#include <asm.h>#include <regs.h>        .file "sys_ppc.s"    .text    .align  2    .globl sys_get_cur_spsys_get_cur_sp:    mr         r3,r1    blr        .align 2    .globl ppc_get_timeppc_get_time:loop:    mftbu      r7   #load from TBU    mftb       r5   #load from TBL    mftbu      r6   #load from TBU    cmpw       r7,r6     bne        loop #loop if carry occurred    stw        r5,0(r3)    stw        r7,0(r4)    blr    .type ppc_get_time,@function    .size ppc_get_time,.-ppc_get_time    .align 2    .globl atom_fetch_and_storeatom_fetch_and_store:loop_2:    lwarx  r5,0,r3   #load and reserve    stwcx. r4,0,r3   #store new value    bne-    loop_2    mr     r3,r5    blr    .type atom_fetch_and_store,@function    .size atom_fetch_and_store,.-atom_fetch_and_store    

⌨️ 快捷键说明

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