📄 callout_timer_8260.s
字号:
# # Copyright 2007, QNX Software Systems. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not reproduce, modify or distribute this software except in # compliance with the License. You may obtain a copy of the License # at: http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTIES OF ANY KIND, either express or implied.# # This file may contain contributions from others, either as # contributors under the License or as licensors under other terms. # Please review this entire file for other proprietary rights or license # notices, as well as the QNX Development Suite License Guide at # http://licensing.qnx.com/license-guide/ for other information.# # An entry point for a hardware kernel callout.# It may be called by an interrupt handler.# This code MUST be position independant.# .include "callout.ah" ## void timer_load(volatile struct syspage_entry *, struct qtime_entry *qtp)#CALLOUT_START timer_load_8260, 0, 0loadi %r3,PPC8260_IMMR_ISB_DEFAULT lwz %r4,QT_TIMER_LOAD(%r4) subi %r4,%r4,1 loadi %r5,PPC8260_IMMR_OFF_PITC sthx %r4,%r3,%r5 blrCALLOUT_END timer_load_8260 ## int timer_reload(volatile struct syspage_entry *, struct qtime_entry *qtp)## check to see if the PS bit is on in PISCR and if so, clear it. Return# the original state of the bit#CALLOUT_START timer_reload_8260, 0, 0loadi %r4,PPC8260_IMMR_ISB_DEFAULT loadi %r7,PPC8260_IMMR_OFF_PISCR loadi %r5,PPC8260_PISCR_PS lhzx %r6,%r4,%r7 and. %r3,%r6,%r5 beqlr- # return 0 if PS wasn't set # don't touch R3 in this section - we need to return it# bug workaround: write 1 to bit 9 to clear psloadi %r5,0x0040or %r6,%r6,%r5 sthx %r6,%r4,%r7 blrCALLOUT_END timer_reload_8260 ## unsigned timer_value(volatile struct syspage_entry *, struct qtime_entry *qtp)## Get the current value of the timer (counting up)#CALLOUT_START timer_value_8260, 0, 0loadi %r4,PPC8260_IMMR_ISB_DEFAULT loadi %r5,PPC8260_IMMR_OFF_PITC loadi %r6,PPC8260_IMMR_OFF_PITR lhzx %r0,%r4,%r5 lhzx %r3,%r4,%r6 sub %r3,%r0,%r3 blrCALLOUT_END timer_value_8260
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -