[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Memprot status on XaAES system window
On Wed, 2011-10-05 at 17:36 +0000, Helmut Karlowski wrote:
> The memprot-test in XaAES is nothing complicated, it never failed for me.
Your test doesn't look correct to me. This is your test:
long has_mprot = Ssystem(S_OSFEATURES,0,0);
int l = sprintf( s, sizeof(s)-1, xa_strings[RS_MEMPROT], has_mprot ?
xa_strings[RS_ON] : xa_strings[RS_OFF] );
Your test will always return RS_ON as long as the kernel is compiled
with crypto support. From ssystem.h:
/* A bitfield specifying the built-in system features.
* Each '1' means that the feature is present:
* ---
* 0 - memory protection support (1 = enabled)
* 1 - virtual memory support (1 = enabled)
* 2 - storage encryption (1 = supported)
* 3-31 reserved bits
* ---
*/
Your test should be:
long has_mprot = (Ssystem(S_OSFEATURES,0,0) & 1);
But I might be wrong. I often am when I try to be clever ;)
Jo Even