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

📄 callout_smp_spin.s

📁 qnx powerpc MPC8245的 BSP源文件
💻 S
字号:
/* * $QNXLicenseC:  * 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.### %r3 should have the syspage pointer### NOTE: The code dealing with the PPC specific smpinfo section (r5,r6 stuff)# can be deleted at a later date, once all the kernel's have been updated.#	.include "callout.ah"CALLOUT_START	smp_spin, 0, 0		li		%r0,0		lhz		%r5,SYSPAGE_SMPINFO+2(%r3)	cmpwi	%r5,0	beq		1f	lhz		%r5,SYSPAGE_SMPINFO(%r3)	add		%r5,%r5,%r3	li		%r6,MPU_START_ADDR1:	lhz		%r7,SYSPAGE_SMP(%r3)	add		%r7,%r7,%r3	li		%r8,SMP_START_ADDR	stw		%r0,SMP_PENDING(%r7) # Tell startup next AP can go	# Small delay loop so the CPU does not jam the bus1:	li		%r9,0xff	mtctr	%r93:	eieio	sync	bdnz+	3b	cmpwi	%r5,0	beq		4f	lwarx	%r1,%r6,%r5	stwcx.	%r0,%r6,%r5	bne-	1b	cmpwi	%r1,0	bne		5f4:	lwarx	%r1,%r8,%r7	stwcx.	%r0,%r8,%r7	bne-	1b	cmpwi	%r1,0	beq		1b5:	# %r1 now has addr of our start function!	cmpwi	%r1,-1	beq		shutdown	mtlr	%r1	blrshutdown:	stwx	%r1,%r8,%r7	cmpwi	%r5,0	beq		1f	stwx	%r1,%r6,%r51:	nop	b		1bCALLOUT_END		smp_spin

⌨️ 快捷键说明

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