重新定位 ARM 异常向量? [英] Relocate the ARM exception vectors?

查看:21
本文介绍了重新定位 ARM 异常向量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将如何重新定位 ARM 异常向量?

基本上,我需要能够以某种方式重新映射它们,因此当 ARM 内核尝试执行向量时,它应该执行存储在内核 RAM 位中而不是 ROM 中的自定义异常向量 即在 0x0 处.那可能吗?还是我打算将中断从 ROM 路由到内核?

Basically, I need to be able to remap them in a way, so when the ARM core tries to execute the vector, it should execute the custom exception vector that is stored in kernel's RAM bit and not in the ROM that is at 0x0. Is that possible? Or am I meant to route the interrupts to the kernel from the ROM?

所以本质上,有没有办法告诉 ARM 内核,这是你的向量表的新地址"?我知道你可以启动 CPU在高矢量模式下,但这不是我要找的.我需要能够动态地将向量基数设置为自定义地址.

So essentially, is there a way of telling the ARM core, "here is the new address for your vector table"? I know that you can start the CPU in the high vector mode, but that's not what I'm looking for. I need to be able to set the vector base to a custom address dynamically.

推荐答案

这在很大程度上取决于您使用的核心.

This is highly dependent on the core you're working with.

Cortex-M3 芯片可以使用系统控制块中的向量表偏移寄存器 (VTOR) 更改基地址.某些实现可能会限制可能的地址.

Cortex-M3 chips can change the base address using the Vector Table Offset Register (VTOR) in the System Control Block. Some implementations might restrict possible addresses.

在传统"芯片(ARM7/9、Cortex-A/R)中,我认为没有一个允许您指定任意基数,尽管它们中的大多数可以在 00000000 和 FFFF0000 之间切换,还有一些允许使用RAM 起始"地址.

Of the "traditional" chips (ARM7/9, Cortex-A/R), I think none allow you to specify an arbitrary base, although most of them can switch between 00000000 and FFFF0000, and a few allow to use the "start of RAM" address.

但是,如果芯片有 MMU,您通常可以在 FFFF0000 处映射 RAM 页并将您的处理程序复制到那里.我相信这就是 Linux 所做的.

However, if the chip has MMU, you can usually map a RAM page at FFFF0000 and copy your handlers there. I believe that's what Linux does.

这篇关于重新定位 ARM 异常向量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆