[haiku-gsoc] Re: Implementation Queries

  • From: Vivek Roy <vivekroyandroid@xxxxxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Wed, 21 Jun 2017 21:15:55 +0530


We can't change the Linux atomics to do the same thing as Haiku's (then
DRM wouldn't work right). We can't change the Haiku ones to do the same
thing as Linux (it would break all the apps using them). So, we have no
choice but to have two sets of functions. Unless you are sure there are
functions that do exactly the same thing in both worlds, that is, in
which case the implementation can be shared.


A lot of the functions do pretty much the same thing (just small things
like linux uses volatile int and Haiku uses int32, and the order in which
the functions receive the parameters etc). But as Jullian pointed out Haiku
is somewhat more stricter than it is required. So in that case
reimplementing all the functions in linuxkpi/asm/atomic.h using GCC
builtins, without touching Haiku's atomic.h might show some performance
benefits (but also means I have to do some research on how lineant is too
lineant in every single function).

Other related posts: