lkml.org 
[lkml]   [2012]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Using IO functions across ARM, PPC and Microblaze architectures
> Because I need to use IO functions which will behave
> on arm as little endian and on powerpc as big endian
> and on microblaze depends on endian setting.
> I haven't found any IO function which I could use by 3 architectures
> without using preprocessor macros or runtime detection

Its a rather weird mix. We can do "always big" and "always little"

> 1. Using helper function + preprocessor macros
> (using static inline function also possible)

Then someone comes along and sticks a daughterboard into the system with
the same device the other way around and there are years

> 2. Using function pointers

Probably smarter. 8250.c works this way and it has to handle some
extremely bizarre mappings.

> b) Runtime initialization - here is the question if there is
> any standard function which I could use.

Set the pointers up and pass them as data with your platform device, that
way the function definitions are buried in your platform code where they
depend.

Alan


\
 
 \ /
  Last update: 2012-12-07 23:21    [W:0.073 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site