Entry | |
---|---|
R2 | Reason code |
- | Other registers dependent on reason code |
Exit | |
---|---|
- | All registers preserved |
This vector is called during serious error reporting and recovery, such as an Abort. It should not be claimed, but called to notify relevant sections of the OS that a serious error has occurred and/or recovery steps have been taken.
Note that handlers of SeriousErrorV have tighter restrictions placed on them than with other vectors. Specifically, reason code 0 will be called from ABT mode, with IRQ disabled. At the time the call is made the stack pointers for the other privileged modes will be in an indeterminate state (e.g. the abort could be due to a SVC stack overflow), so implementations must be careful to avoid using the stacks for any other modes. For example, this prevents the use of SWI calls, and it prevents the direct use of CMHG veneers in C modules. Similarly, if the abort was due to a faulty interrupt handler, re-enabling IRQs may cause the handler to crash again, so SeriousErrorV handlers must take care to not re-enable interrupts.
For C modules which are only interested in the reason codes that are called in SVC mode, it’s recommended to use a pre-veneer infront of the CMHG veneer which will filter out all the codes which you are not interested in. Currently reason code 0 is the only reason code which is not called in SVC mode, but more reason codes might be introduced in future, so having your pre-veneer filter out all unknown codes is the safest approach.
0 | Collect. Entered in ABT mode, IRQ disabled, FIQ undefined |
R0 = Pointer to register dump | |
R1 = Pointer to (untranslated) error block | |
1 | Recover. Entered in SVC mode, IRQ disabled |
R0 = Pointer to translated error block | |
2 | Report. Entered in SVC mode, IRQ enabled |
R0 = Pointer to translated error block | |
3 | Custom Report. Entered in SVC mode, IRQ enabled |
R0 = Pointer to translated error block | |
R1 = Flags | |
R3 = Pointer to callback function to receive the report | |
R4 = Callback R0 |
When a serious error occurs, the kernel undertakes the following procedure:
Note that the exact ordering of items is subject to change in future kernel versions, but the overall flow as seen by SeriousErrorV will remain the same.
Software can request that a custom report is generated by calling SeriousErrorV reason codes 0 and 3. For example, when the ZeroPain module emulates a zero page access, it also invokes SeriousErrorV in order to collect information for inclusion in the log file so that the zero page access can be reported to the author of the relevant software. The process for using these reason codes is as follows:
The requirement for reason code 0 to be called in ABT mode means that there is no legal way for software outside the kernel to invoke that reason code. Therefore, at this time, the use of custom reports is restricted to low-level OS components which have enough knowledge of the host system to be able to invoke the vector directly.
The flags for reason code 3 are as follows:
Bit | Meaning |
---|---|
0 | 1 → Produce annotated text dump |
0 → Produce raw hex dump | |
1+ | Reserved |
The callback function pointer provided in R3 must have the following signature:
Entry | |
---|---|
R0 | Parameter provided to SeriousErrorV |
R1 | Pointer to null-terminated string |
Exit | |
---|---|
R0-R3, R12 | Corrupt |
The callback function will be called multiple times as the different areas of the report are output.