callout_debug_403.s

来自「qnx powerpc MPC8245的 BSP源文件」· S 代码 · 共 106 行

S
106
字号
#  # 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"		patch_debug:	add		%r3,%r3,%r5	lwz		%r4,DDI_BASE(%r7)	sth		%r4,6(%r3)	srwi	%r4,%r4,16	sth		%r4,2(%r3)	blr## void display_output(struct syspage_entry *sysp, char c)## Display debug messages from kdebug or the kernel.#CALLOUT_START	display_char_403, 0, patch_debug	lis		%r6,0x1234			# get serial port base (patched)	ori		%r6,%r6,0x5678		# .....		#disable interrupt	loadi	%r9,PPC_MSR_EE|PPC_MSR_DR	mfmsr	%r8	andc	%r9,%r8,%r9	mtmsr	%r91:	lbz		%r0,PPC403_SPLS(%r6)	andi.	%r0,%r0,PPC403_SPLS_TBR	beq		1b		stb		%r4,PPC403_SPTB(%r6)		mtmsr	%r8	blrCALLOUT_END		display_char_403		## int poll_key(volatile struct syspage_entry *)## return a key value, or -1 if no key is available (for kdebug use)#CALLOUT_START	poll_key_403, 0, patch_debug	lis		%r6,0x1234			# get serial port base (patched)	ori		%r6,%r6,0x5678		# .....		loadi	%r9,PPC_MSR_EE|PPC_MSR_IR|PPC_MSR_DR	mfmsr	%r8	andc	%r9,%r8,%r9	mtmsr	%r9	lbz		%r0,PPC403_SPLS(%r6)	andi.	%r0,%r0,PPC403_SPLS_RBR	beq		1f		lbz		%r3,PPC403_SPRB(%r6)	mtmsr	%r8	blr1:	li		%r3,-1	mtmsr	%r8	blrCALLOUT_END		poll_key_403		## int break_detect(volatile struct syspage_entry *)## return non-zero if a break condition is detected, 0 otherwise#CALLOUT_START	break_detect_403, 0, patch_debug	lis		%r6,0x1234			# get serial port base (patched)	ori		%r6,%r6,0x5678		# .....		loadi	%r9,PPC_MSR_EE|PPC_MSR_IR|PPC_MSR_DR	mfmsr	%r8	andc	%r9,%r8,%r9	mtmsr	%r9	lbz		%r3,PPC403_SPLS(%r6)	andi.	%r3,%r3,PPC403_SPLS_LB	stb		%r3,PPC403_SPLS(%r6)	# clear the break if it's on	mtmsr	%r8	blrCALLOUT_END		break_detect_403

⌨️ 快捷键说明

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