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

📄 callout_cache_ppc400.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.# # This is a kernel hardware callout.# This code MUST be position independant.#	.include "callout.ah"	# NOTE: This differs from the regular PPC cache callouts only in handling# of a PPC405 bug (errata #37). Once all the old PPC405's are gone, we# can remove this code and just use the original versions in# callout_cache_ppc.s## unsigned control(	paddr32_t base,#					unsigned num_lines,#					int flags,#					struct cacheattr_entry *cache,#					volatile struct syspage_entry * )## Perform the cache controller operations indicated by 'flags' # (MS_* bits passed to the msync() function).#CALLOUT_START	cache_ippc_400, 0, 0		# Don't try to do all lines (preemption)		lwz		%r9,CA_LINE_SIZE(%r6)		cmpwi	%r4,64		ble		1f		li		%r4,641:		mtctr	%r41:		icbi	0,%r3			# invalidate one line from ins cache		add		%r3,%r3,%r9		bdnz+	1b		ori		%r3,%r4,0		# we did all the lines requested mod 64		isync		blrCALLOUT_END		cache_ippc_400CALLOUT_START	cache_dppc_400, 0, 0		# Don't try to do all lines (preemption)		lwz		%r9,CA_LINE_SIZE(%r6)		cmpwi	%r4,64		ble		1f		li		%r4,641:		ori		%r8,%r3,0		bittst	%r0,%r5,(MS_SYNC | MS_ASYNC)		beq		1f		mtctr	%r4		mfmsr	%r6		bitclr	%r7,%r6,PPC_MSR_EE2:# Workaround for PPC405 bug #37 (fixed in rev D)		mtmsr	%r7		lbz		%r0,0(%r8)		dcbst	0,%r8			# Flush from data cache			mtmsr	%r6# end workaround		add		%r8,%r8,%r9		bdnz+	2b1:		bittst	%r0,%r5,MS_INVALIDATE		beq		1f		mtctr	%r42:		dcbi	0,%r3			# invalidate from data cache		add		%r3,%r3,%r9		bdnz+	2b1:		ori		%r3,%r4,0		# we did all requested lines		sync		blrCALLOUT_END		cache_dppc_400

⌨️ 快捷键说明

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