diff options
author | vetch <vetch97@gmail.com> | 2020-01-21 13:50:37 +0100 |
---|---|---|
committer | vetch <vetch97@gmail.com> | 2020-01-21 13:50:37 +0100 |
commit | d747a54860307dc2c1f0312d1a3349d02388f276 (patch) | |
tree | 20be97e1ce0413c07ddf908fa9c53686199f191d /docs/PSRs-explained.txt | |
parent | 7a420a161658106be75746b408db851b30b1e6d2 (diff) | |
download | rpi-MMU-example-d747a54860307dc2c1f0312d1a3349d02388f276.tar.gz rpi-MMU-example-d747a54860307dc2c1f0312d1a3349d02388f276.zip |
Nice mdfication
Diffstat (limited to 'docs/PSRs-explained.txt')
-rw-r--r-- | docs/PSRs-explained.txt | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/docs/PSRs-explained.txt b/docs/PSRs-explained.txt deleted file mode 100644 index a125add..0000000 --- a/docs/PSRs-explained.txt +++ /dev/null @@ -1,13 +0,0 @@ -## Program Status Register -CPSR (Current Program Status Register) is a register, bits of which contain and/or determine various aspects of execution, i.e. condition flags, execution state (arm, thumb or jazelle), endianness state, [execution mode](./link_to_doc_explaining_modes) and interrupt mask. This register is readable and writeable with the use of mrs and msr instructions from any PL1 mode, thus it is possible to change things like mode or interrupt mask by writing to this register. - -Additionally, there are other registers with the same or simillar bit fields as CPSR. Those PSRs (Program Status Registers) are: - -1. APSR (Application Program Status Register) -2. SPSRs (Saved Program Status Registers) - -APSR is can be considered the same as CPSR or a view of CPSR, with some limitations - some bit fields from CPSR are missing (reserved) in APSR. APSR can be accessed from PL0, while CPSR should only be accessed from PL1. This was an application program executing in user mode can learn some of the settings in CPSR without accessing CPSR directly. - -SPSR is used for exception handling. Each exception-taking mode has it's own SPSR (they can be called SPSR_sup, SPSR_irq, etc.). On exception entry, old contents of CPSR are backed up in entered mode's SPSR. Instructions used for exception return (subs and ldm ^), when writing to the pc, have the important additional effect of copying the SPSR to CPSR. This way, on return from an exception, processor returns to the state from before the exception. That includes endianess settings, execution state, etc. - -In our project, the structure of PSRs is defined in terms of C bitfield structs in src/arm/PL1/kernel/psr.h. |