Source-Changes-D archive

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

Re: CVS commit: src/lib/librumpuser



On 17/06/14 11:52, Alexander Nasonov wrote:
That's one more indication that "sync icache" is the wrong level of problem
to represent at the interface level.

Existence of __clear_cache is an indication of the opposite.

Let's be thankful we're not discussing implementing a compiler.

If it were a high-level, holistic
interface, both the caller and callee would what needs to be done, and the
caller could perhaps implement the same with a alternative method.  A
low-level interface like "sync icache for this memory range" leaves no room
for interpretation, even if it will ever be used for only one purpose.

Not quite sure what you're saying because no room for interpretation
is a good thing in general and using something for one purpose is even
better ;-)

Ok, one more try, this time with an example:

* fact: interface will be used to say "I have loaded code here, please arrange things so that it can be executed" * fact: you want to call the interface "sync icache" and possess those semantics

the example:
Let's assume some fictional platform where you need to sign newly loaded code before it can execute. Should the implementation of "sync icache" on that platform sign code? If not, you can't execute the code, which was the original purpose. If yes, you've failed to implement the interface correctly, because that might not be what the caller wants at all. Will such a platform be supported? Who knows. Is it cause to leave known problems into the interface? Definitely not!

If you don't want to solve anything except your immediate problem, that's more than fair enough (we've all been there), but it needs to be done without breaking things for everyone else or knowingly introducing suboptimal interfaces that everyone else will suffer from.

Home | Main Index | Thread Index | Old Index