⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 callout_timer_800.s

📁 qnx powerpc MPC8245的 BSP源文件
💻 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_800, 0, 0		lwz		%r4,QT_TIMER_LOAD(%r4)		mfspr	%r3,PPC800_SPR_IMMR		andis.	%r3,%r3,0xffff		subi	%r4,%r4,1		sth		%r4,PPC800_IMMR_PITC(%r3)		blrCALLOUT_END		timer_load_800		## 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_800, 0, 0		mfspr	%r4,PPC800_SPR_IMMR		andis.	%r4,%r4,0xffff		loadi	%r5,PPC800_PISCR_PS		lhz		%r6,PPC800_IMMR_PISCR(%r4)		and.	%r3,%r6,%r5		beqlr-					# return 0 if PS wasn't set		# don't touch R3 in this section - we need to return it		sth		%r6,PPC800_IMMR_PISCR(%r4) # clear the interrupt 		lwz		%r6,PPC800_IMMR_PLPRCR(%r4)		bitset	%r6,%r6,PPC800_PLPRCR_TMIST		stw		%r6,PPC800_IMMR_PLPRCR(%r4)		blrCALLOUT_END		timer_reload_800		## unsigned timer_value(volatile struct syspage_entry *, struct qtime_entry *qtp)## Get the current value of the timer (counting up)#CALLOUT_START	timer_value_800, 0, 0		mfspr	%r4,PPC800_SPR_IMMR		andis.	%r4,%r4,0xffff		lhz		%r0,PPC800_IMMR_PITC(%r4)		lhz		%r3,PPC800_IMMR_PITR(%r4)		sub		%r3,%r0,%r3		blrCALLOUT_END		timer_value_800

⌨️ 快捷键说明

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