Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Restructuring trapframe

Currently struct trapframe as the saved PC as the last member
and the SPSR as the first member.

I want to move SPSR from the first to the last member.

This is we can use the

        srsdb   sp!, #PSR_SCV32_MODE

to save LR & SPRS onto the SVC32 stack and the

        rfeia   sp!

to pull them off the stack and return from the exception.

These are ARMv6 instructions and simplify exception handling.
(6 for pushing and 5 for popping a trapframe compared to 11 and 9
for the non SRS/RFE using instructions).

The disadvantage is that for pre-ARMv6 it makes pull the frame more
difficult since have SPSR last isn't easy to deal with.  But pushing
the initial frame is easier.

Home | Main Index | Thread Index | Old Index