[maemo-developers] Instructions cache flush on ARM

From: Eero Tamminen eero.tamminen at nokia.com
Date: Tue Apr 24 10:56:07 EEST 2007

ext Siarhei Siamashka wrote:
>>> You are right. gcc has function
>>> void __clear_cache (char *BEG, char *END)
>>> which should be more portable.
>> It should, but it still has the problem of emitting an OABI syscall
>> due to our old gcc.
>> You could use syscall(2) and __ARM_NR_cacheflush instead.
> Yes, but __clear_cache(char *BEG, char *END)  works fine with the 
> current combination of gcc and kernel in maemo. So I guess it's the best 
> option if portability is desired.
> If you decide to drop support for old ABI from kernel without upgrading
> gcc, that would be a bug in maemo platform :-)
> By the way, do you have any plans for upgrading toolchain? Either I'm
> extremely unlucky, or current toolchain is really very buggy.

You can see the known issues from the GCC bugzilla.
There are a few bugs in C++ support which have been fixed
in gcc 3.4.6 (Maemo toolchain is 3.4.4) or 4.x.

> It does not support -pg option properly (for profiling with gprof),

Hm.  The toolchain might not be built with -pg support.
As to using gprof, that produces fairly unreliable results.
I'd recommend building Oprofile kernel and latest oprofile
user-space tools.

> also I encountered at least one internal compiler error and a couple of
> invalid code generation bugs already.

C++ code generation?  Or C? (GCC bugzilla mentions only C++
code generation issues)

ICE you can get around by trying another optimization level
(sometimes -Os or -O3 works where -O2 doesn't).

> One more question is about the kernel, ARM11 seems to support unaligned 
> memory access in hardware, but this feature is not enabled on N800.

What the "seems", "to support" and "feature enabled" mean in
the above clause?  Seems how?  And what is result? Enabled what?

ARM CPU is able to trap them?  Kernel could SIGBUS the co. processes?
(as unaligned access has AFAIK undefined results on ARM, is often
coding error and "fixing" those accesses on kernel side has definitive
performance penalty)

> Is it done for consistency with Nokia 770?

	- Eero

More information about the maemo-developers mailing list