2

我在 ARM cortex A9 处理器的一个内核上运行一个裸机应用程序。我的 ISR 很小,我想知道是否可以将 ISR 指令锁定在 L1 缓存中?可能吗?有没有人会解释这样做的一些缺点?

问候,N

4

2 回答 2

3

Cortex-A9 不支持 L1 缓存锁定(既不支持指令也不支持数据)。

缺点是带走大块缓存(锁定通常在整个缓存路径的粒度上完成)会降低系统中其他所有内容的性能。

更不用说如果你的 ISR 确实很小,而且它被频繁调用,它很可能无论如何都在缓存中。

您期望从这样做中获得什么好处?

于 2013-11-28T11:12:53.517 回答
2

Your condition is the perfect fit for fast interrupt. (FIQ)

You only have to assign the last interrupt number for that particular ISR.

While other interrupt numbers are just vectors, the last number branches directly to the code area, thus saving one memory load plus interlock. You save about three cycles or so.

Besides, i-cache lockdown isn't as efficient as d-cache lockdown.

CA9 doesn't support L1 cache lockdown anyway (for some good reasons), so don't bother.

Just make sure the ISR is cache line aligned for maximum efficiency. (typically 32 or 64byte)

于 2013-11-28T13:28:59.843 回答