callout_reboot_mx1.s

来自「QNX ADS BSP code for i.MX27 chips」· S 代码 · 共 73 行

S
73
字号
#  # 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.# /* * Motorola MC9328MX1 system reboot */#include "callout.ah"#include <arm/mx1.h>/* * ----------------------------------------------------------------------- * Routine to patch callout code * * On entry: *	r0 - physical address of syspage *	r1 - virtual  address of syspage *	r2 - offset from start of syspage to start of the callout routine *	r3 - offset from start of syspage to read/write data used by callout * ----------------------------------------------------------------------- */patch_reboot:	stmdb	sp!,{r4,lr}	add		r4, r0, r2					// address of callout routine	/*	 * Map reset control registers	 */	mov		r0, #MX1_WDT_SIZE			// size of reset control registers	ldr		r1, Lpaddr	bl		callout_io_map	/*	 * Patch the callout routine	 */	CALLOUT_PATCH	r4, r0, r1, r2, ip	ldmia	sp!,{r4,pc}Lpaddr:	.word	MX1_WDT_BASECALLOUT_START(reboot_mx1, 0, patch_reboot)    /*     * Get the Watchdog Timer base address (patched)     */    mov     ip,     #0x000000ff    orr     ip, ip, #0x0000ff00    orr     ip, ip, #0x00ff0000    orr     ip, ip, #0xff000000	mov		r1, #0x01	str		r1, [ip, #MX1_WDT_WCR]0:	b		0bCALLOUT_END(reboot_mx1)

⌨️ 快捷键说明

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