📄 callout.ah
字号:
/* * $QNXLicenseC: * Copyright 2001, 2008, 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. * $ */#include "asmoff.def" .text .align 2#define CALLOUT_START(rtn, rw_size, patcher) \ .globl rtn; \ rtn:; \ .long rw_size; \ .long patcher; \ .long end_##rtn - start_##rtn; \ start_##rtn:#define CALLOUT_END(rtn) end_##rtn:/* * Macro to patch callout code: * * ptr - name of register containing the address of the callout * val - name of register containing the value to patch * t0, t1, t2 - names of registers to use as temporaries * * This code assumes the callout is written as follows: * * callout_routine: * mov rX, #0x000000ff * orr rX, rX, #0x0000ff00 * orr rX, rX, #0x00ff0000 * orr rX, rX, #0xff000000 * : * rest of routine * : */.macro CALLOUT_PATCH ptr, val, t0, t1, t2 mov &t0, #40: and &t1, &val, #0xff ldr &t2, [&ptr] bic &t2, &t2, #0xff orr &t2, &t2, &t1 str &t2, [&ptr], #4 mov &val, &val, lsr #8 subs &t0, &t0, #1 bne 0b.endm
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -