OS_ClaimProcessorVector Release Order Issues
Graeme (8815) 106 posts |
I have written a module that makes use of the Undefined Instruction vector, claiming it through OS_ClaimProcessorVector. This states that claims need to be released in the same order. It appears to work alongside the FPEmulator. However if my module is loaded in, the FPEmulator fails on *reinit and completely crashed the system. This is because the vector is not being released in the order they were claimed and causes issues. Is there any way around this? I don’t see any service calls for this. This module would be happy to release the vector and then reclaim it after earlier vectors are released. I see work is being done on the OS_ClaimProcessorVector SWI. Is it best to just wait for this to be done? |
David J. Ruck (33) 1635 posts |
Everything I’ve ever done has released vectors in the reverse order they were claimed. |
Stuart Swales (8827) 1357 posts |
Shirely the first thing FPEmulator should do in FPEFinal is to get itself off the vector – if that fails, it cannot finalise as any subsequent claimants of the U.I. vector WILL pass undefined instructions along to the FPE’s handler. |
Martin Avison (27) 1494 posts |
But the PRM goes on to say: The release order being the reverse of claim order (as Druck suggests). Which are you trying? Claim order or Reverse Claim order? |
Graeme (8815) 106 posts |
The reverse order is the correct order. Load my module in and then *rmkill it, then *rmreinit FPEmulator and everything is fine. My module claims the vector on initialisation and releases it on finalisation. You can now find it at: There are three files. ARMChipS is the source file (BASIC). ARMChip is a module. ARMChipT is a BASIC file for testing. What it does is intercept the UDIV and SDIV instructions and performs the calculations. Currently testing it on RPCEmu because this does not have the divide instructions. It is not fully tested yet but does seem to work except for the vector release issue. If you try it, you will be able to load the module in and *rmreinit or *rmkill it. The FPEmulator cannot be *rmreinit while my module is running. It states ‘bad vector’ release. Note: This will crash your system! I would happily release and reclaim my vector but how do I know when to do this? Can I tell? |
Martin Avison (27) 1494 posts |
I would expect that… if your module was started after FPEMulator. So if FPEmulator was started first, then your module, only yours can be safely *rmkilled (or *Rmreinit, which also implies a kill). As the PRM says: claiming and releasing vectors is rather primitive !! |
Jeffrey Lee (213) 6048 posts |
It’s FPEmulator which is at fault here, not your module. FPEmulator doesn’t recover properly if it’s unable to release the processor vector. |
Graeme (8815) 106 posts |
Thanks everyone. It seems like there is nothing I can do about this as it appears to be an OS issue. I may still continue with it and add more instructions to emulate. |