Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CS 220 / ARM / ARM7TDMI_TechnicalReferenceManual.pdf
Скачиваний:
102
Добавлен:
16.04.2015
Размер:
1.63 Mб
Скачать

Programmer’s Model

2.8.7Software interrupt instruction

The Software Interrupt instruction (SWI) is used to enter Supervisor mode, usually to request a particular supervisor function. The SWI handler reads the opcode to extract the SWI function number.

A SWI handler returns by executing the following irrespective of the processor operating state:

MOVS PC, R14_svc

This action restores the PC and CPSR, and returns to the instruction following the SWI.

2.8.8Undefined instruction

When the ARM7TDMI processor encounters an instruction that neither it, nor any coprocessor in the system can handle, the ARM7TDMI core takes the undefined instruction trap. Software can use this mechanism to extend the ARM instruction set by emulating undefined coprocessor instructions.

After emulating the failed instruction, the trap handler executes the following irrespective of the processor operating state:

MOVS PC,R14_und

This action restores the CPSR and returns to the next instruction after the undefined instruction.

For more information about undefined instructions, see the ARM Architecture Reference Manual.

2.8.9Exception vectors

Table 2-4 lists the exception vector addresses. In this table, I and F represent the previous value of the IRQ and FIQ interrupt disable bits respectively in the CPSR.

Table 2-4 Exception vectors

Address

Exception

Mode on entry

I state on entry

F state on entry

 

 

 

 

 

0x00000000

Reset

Supervisor

Set

Set

 

 

 

 

 

0x00000004

Undefined instruction

Undefined

Set

Unchanged

 

 

 

 

 

0x00000008

Software interrupt

Supervisor

Set

Unchanged

 

 

 

 

 

0x0000000C

Prefetch Abort

Abort

Set

Unchanged

ARM DDI 0029G

Copyright © 1994-2001. All rights reserved.

2-21

Programmer’s Model

Table 2-4 Exception vectors (continued)

Address

Exception

Mode on entry

I state on entry

F state on entry

 

 

 

 

 

0x00000010

Data Abort

Abort

Set

Unchanged

 

 

 

 

 

0x00000014

Reserved

Reserved

-

-

 

 

 

 

 

0x00000018

IRQ

IRQ

Set

Unchanged

 

 

 

 

 

0x0000001C

FIQ

FIQ

Set

Set

 

 

 

 

 

2.8.10Exception priorities

When multiple exceptions arise at the same time, a fixed priority system determines the order in which they are handled. The priority order is listed in Table 2-5.

Table 2-5 Exception priority order

Priority

Exception

 

 

Highest

Reset

 

 

 

Data Abort

 

 

 

FIQ

 

 

 

IRQ

 

 

 

Prefetch Abort

 

 

Lowest

Undefined instruction and SWI

 

 

Some exceptions cannot occur together:

The undefined instruction and SWI exceptions are mutually exclusive. Each corresponds to a particular, non-overlapping, decoding of the current instruction.

When FIQs are enabled, and a Data Abort occurs at the same time as an FIQ, the ARM7TDMI processor enters the Data Abort handler, and proceeds immediately to the FIQ vector.

A normal return from the FIQ causes the Data Abort handler to resume execution.

Data Aborts must have higher priority than FIQs to ensure that the transfer error does not escape detection. You must add the time for this exception entry to the worst-case FIQ latency calculations in a system that uses aborts to support virtual memory.

2-22

Copyright © 1994-2001. All rights reserved.

ARM DDI 0029G

Соседние файлы в папке ARM