[etherlab-dev] ARM port
fp at igh-essen.com
Wed Jan 30 15:18:22 CET 2008
On Tue, Jan 29, 2008 at 02:16:33PM +0100, Thomas Elste wrote:
> as promised, my next thread: Apart from the network driver I've
> had to make some changes to the masters code in order to get it
> running on ARM (see the attached patch).
> It's just a quick and dirty workaround, as I couldn't come up with
> an easy generic solution that would work on most archs. There are
> 2 problems. The first is, that the ARM arch apparently doesn't
> know the cpu_khz symbol, which is used to calculate some timeouts.
> The second problem: get_cycles() doesn't work on ARM, too. At
> least it returns always 0 and so isn't usable for the timeout
> generation in master/master.c.
I think, these two problems are having the same background. Obviously,
the ARM does not support the Time Stamp Counter (TSC), which is a
feature of the Intel IA-32 architecture. I used get_cycles() and cpu_khz
to measure short times, for which jiffies are too coarse. I'm currently
having doubts, if this was a good idea, because this is not quite
portable, as you are experiencing. Moreover, problems could come up in
SMP systems, or even worse, when people have SpeedStep enabled.
> Is there a clean more generic approach then get_cycles()?. Or would it
> be best to have an arch subdir (like other projects, f.e. RTAI) for
> architecture dependend code?
This was a question, I was asking myself a lot of times. I still found
no answer. I think the best solution would be, to ban the TSC
calculations from the code, I'll have a look, if this is possible
without breaking the functionality.
More information about the etherlab-dev