Dr Jefyll wrote:
Do I understand correctly that the goal is to prevent arrival at the function entry via simple fall-through from preceding inline code?
Well, this all lives in the twilight zone in my head where it is only a 60% refined idea of what I'm trying to achieve.
I do not want someone just jumping into the code at some point of their own desire. (Classically you would just not map that code in at user level, but as I have mentioned I'm an old-fashioned Amiga user trying to find angles to drag it kicking and screaming into the present with all the expected "proper" OS features.)
I want library/OS (function calls) to be cheap
- do not raise privilege levels if the function does not need it (isn't GetPID the classic no-op system call used for OS speed tests&optimizing?)
- do raise, but stay in the caller context if you can
- do raise into kernel context if needed
This thinking bleeds into my other topic about using MMU status to control behaviour. Something like "all instructions in this part of memory are flagged to cause an exception when they try to complete" (because they run in a too low ring?), except ENTER/COMEFROM(or some other entry point thing - ELEVATE?) which elevates your level by 1 and so suddenly you have the rights to run the code in that memory page. A very limited privilege level which is barely more than your average userlevel.