Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CS 220 / ARM / ARM1176JZ-S Technical Reference Mmanual.pdf
Источник:
Скачиваний:
45
Добавлен:
16.04.2015
Размер:
4.47 Mб
Скачать

Programmer’s Model

Mode bits

M[4:0] are the mode bits. Table 2-7 lists how these bits determine the processor operating mode.

 

 

 

Table 2-7 PSR mode bit values

 

 

 

 

M[4:0]

Mode

Visible state registers

 

Thumb

ARM

 

 

b10000

User

 

 

R0–R7, R8-R12a, SP, LR, PC, CPSR

R0–R14, PC, CPSR

b10001

FIQ

R0–R7, R8_fiq-R12_fiqa, SP_fiq, LR_fiq PC,

R0–R7, R8_fiq–R14_fiq, PC, CPSR,

 

 

CPSR, SPSR_fiq

SPSR_fiq

 

 

 

 

b10010

IRQ

R0–R7, R8-R12a, SP_irq, LR_irq, PC, CPSR,

R0–R12, R13_irq, R14_irq, PC, CPSR,

 

 

SPSR_irq

SPSR_irq

 

 

 

 

b10011

Supervisor

R0–R7, R8-R12a, SP_svc, LR_svc, PC, CPSR,

R0–R12, R13_svc, R14_svc, PC, CPSR,

 

 

SPSR_svc

SPSR_svc

 

 

 

 

b10111

Abort

R0–R7, R8-R12a, SP_abt, LR_abt,

R0–R12, R13_abt, R14_abt, PC, CPSR,

 

 

PC, CPSR, SPSR_abt

SPSR_abt

 

 

 

 

 

 

 

b11011

Undefined

R0–R7, R8-R12a, SP_und,

R0–R12, R13_und, R14_und,

 

 

LR_und, PC, CPSR, SPSR_und

PC, CPSR, SPSR_und

 

 

 

 

b11111

System

R0–R7, R8-R12a, SP, LR, PC, CPSR

R0–R14, PC, CPSR

b10110

Secure

R0-R7, R8-R12a, SP_mon, LR_mon, PC, CPSR,

R0-R12, PC,CPSR, SPSR_mon,

 

Monitor

SPSR_mon

R13_mon,R14_mon

a.Access to these registers is limited in Thumb state.

2.10.8Modification of PSR bits by MSR instructions

In previous architecture versions, MSR instructions can modify the flags byte, bits [31:24], of the CPSR in any mode, but the other three bytes are only modifiable in privileged modes.

After the introduction of ARM architecture v6, however, each CPSR bit falls into one of the following categories:

Bits that are freely modifiable from any mode, either directly by MSR instructions or by other instructions whose side-effects include writing the specific bit or writing the entire CPSR.

Bits in Figure 2-10 on page 2-24 that are in this category are N, Z, C, V, Q, GE[3:0], and E.

Bits that must never be modified by an MSR instruction, and so must only be written as a side-effect of another instruction. If an MSR instruction does try to modify these bits the results are architecturally Unpredictable. In the processor these bits are not affected.

Bits in Figure 2-10 on page 2-24 that are in this category are J and T.

Bits that can only be modified from privileged modes, and that are completely protected from modification by instructions while the processor is in User mode. The only way that these bits can be modified while the processor is in User mode is by entering a processor exception, as Exceptions on page 2-36 describes.

Bits in Figure 2-10 on page 2-24 that are in this category are A, I, F, and M[4:0].

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

2-28

ID012410

Non-Confidential, Unrestricted Access

 

Programmer’s Model

Only Secure privileged modes can write directly to the CPSR mode bits to enter Secure Monitor mode. If the core is in Secure User mode, Non-secure User mode, or Non-secure privileged modes it ignores changes to the CPSR to enter the Secure Monitor. The core does not copy mode bits in the SPSR, changed in the Non-secure world, across to the CPSR.

2.10.9Reserved bits

The remaining bits in the PSRs are unused, but are reserved. When changing a PSR flag or control bits, make sure that these reserved bits are not altered. You must ensure that your program does not rely on reserved bits containing specific values because future processors might use some or all of the reserved bits.

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

2-29

ID012410

Non-Confidential, Unrestricted Access

 

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