pok icon indicating copy to clipboard operation
pok copied to clipboard

Some questions in the sparc trap handle

Open GFWisshit opened this issue 7 years ago • 2 comments

First, thank you for offer this RTOS, appreciate it. In entry.S file, we use _20180830171714 _20180830171714 Macro to set up trap handler. If a interrupt occur, code run to trap_prehandler, we can assume that, if our function call have use all reg window except one indicated by WIM, and interrupt will use this preserved reg window.I figure out this call instrution will ruin next used reg window %i7, did i miss something? Sorry for my bad english. _20180830171714

GFWisshit avatar Aug 30 '18 09:08 GFWisshit

Hi,

From what I remember from SPARC, the call instruction will not change windows. To change the CWP you need to use the Save instruction.

cdcs avatar Sep 03 '18 13:09 cdcs

But call instruction is a synthetic instruction,it store return address in current win register %o7 which one are next win register %i7. In situation i pointed out,it will break return chains,cause program to fail.

GFWisshit avatar Sep 03 '18 14:09 GFWisshit