引用 17 楼 gooogleman 的回复:
#define pISR (*(unsigned *)(0x30000000+0x18))
// Virtual Address 0x0 is mapped to 0x30000000, ISR Address is VA 0x18
我的内存起始物理地址是0x30000000的
// make value to assemble code "b IsrHandler"
pISR =(unsigned)(0xEA000000)+(((unsigned)IsrHandler - (0x80000000 + 0x18 + 0x8) )>>2);
经过paul chao牛人提示,再去看看一个支持USB的eboot
发现三星这个写法真的很怪异哦。
pISR =(unsigned)(0xEA000000)+(((unsigned)IsrHandler - (0x80000000 + 0x18 + 0x8) )>>2);
不理解是如何算出来的。
TEXTAREA
IMPORT IsrUsbd
; ---------------------------------------------------------------------
; ---------------------------------------------------------------------
LEAF_ENTRY IsrHandler
; sub sp,sp,#4 ;decrement sp(to store jump address)
sub lr, lr, #4
stmfd sp!, {r0-r12,lr}
mov r0, lr
bl IsrUsbd
ldmfd sp!, {r0-r12,lr}
movs pc, lr
ENDP ; |IsrHandler|复制代码