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

📄 callout_sendipi_gt64260.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"	.extern gt64260_base	.extern	gt64260_ipi_out# R3: syspage paddr# R4: syspage vaddr# R5: rtn dst offset# R6: r/w offset# R7: patch data# R8: rtn srcpatcher:    stwu    %r1,-32(%r1)    mflr    %r0    stw     %r31,28(%r1)    stw     %r0,36(%r1)    add     %r31,%r3,%r5    loada   %r4,gt64260_base    loadi   %r3,0x30000    bl      callout_io_map_indirect    lhz     %r4,6(%r31)    lhz     %r5,2(%r31)    slwi    %r5,%r5,16    or      %r4,%r4,%r5    add     %r3,%r3,%r4    sth     %r3,6(%r31)    srwi    %r3,%r3,16    sth     %r3,2(%r31)    lwz     %r0,36(%r1)    mtlr    %r0    lwz     %r31,28(%r1)    addi    %r1,%r1,32    blr.macro DEVBASE reg,dev_reg_off    # the instruction immediate values are patched by the above routine    lis     &reg,(&dev_reg_off) >> 16    ori     &reg,&reg,(&dev_reg_off) & 0xffff.endm.set	GPP_DATA,0xf104		CALLOUT_START	sendipi_gt64260, 0, patcher	DEVBASE %r10,0## Send an IPI (new style).### %r3: syspage ptr# %r4: cpunum# %r5: ipi code # %r6: &ipicmds#	# Disable interrupts	loadi	%r9,PPC_MSR_EE	mfmsr	%r8	andc	%r9,%r8,%r9	mtmsr	%r9	# set IPI command2:	lwarx	%r3,%r0,%r6	or		%r3,%r3,%r5	stwcx.	%r3,%r0,%r6	bne-	2b	# Compute address of registers	loadi	%r7,GPP_DATA	lwbrx	%r6,%r10,%r7	# get current GPP data value	# get IPI output information	lis 	%r5,gt64260_ipi_out@ha	lwz 	%r5,gt64260_ipi_out@l(%r5)	cmpwi	%r4,1	beq		1f	rlwinm	%r5,%r5,16,16,31	# get CPU 1 -> 0 IPI output	b		2f1:	rlwinm	%r5,%r5,0,16,31		# get CPU 0 -> 1 IPI output2:	li		%r4,1	slw		%r4,%r4,%r5	or		%r11,%r6,%r4	not		%r4,%r4	and		%r6,%r6,%r4	stwbrx	%r11,%r7,%r10	eieio	stwbrx	%r6,%r7,%r10	mtmsr	%r8	blrCALLOUT_END		sendipi_gt64260

⌨️ 快捷键说明

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