[haiku-development] Re: cpu_clock_speed -- why gone?

  • From: Pete Goodeve <pete.goodeve@xxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 17 Mar 2017 17:19:54 -0700

On Fri, Mar 17, 2017 at 11:18:05AM -0400, Rene Gollent wrote:

On Thu, Mar 16, 2017 at 8:27 PM,  <pete.goodeve@xxxxxxxxxxxx> wrote:
Thinking about it, I'll bet that the older ArtPaint is just getting a 
random value (using
the original system_info) that just happens to suit!  I looked at the 
original BeOS and
current Haiku structs, and they're totally different afte the first two 
entries.  Not
sure how they got away with that -- thought to intent was to keep BeOS 
compatibility!

If you look at get_system_info()'s definition, it's a macro which in
turn calls the actual function with both the struct pointer and the
struct size. This is the case on both BeOS and Haiku. That size is
then used to decide how to fill in the structure, since it allows for
the ability to detect what OS version the call came from. As such, the
original R5 Artpaint binary would have been passing in the R5
system_info size, and consequently been filled in appropriately. After
being recompiled for Haiku natively though, this would no longer be
the case, and the code would corresponding have to be adjusted (as
happens with pretty much every other OS in some form). If morbidly
curious, see 
http://cgit.haiku-os.org/haiku/tree/src/system/libroot/os/system_info.cpp#n25
.
Hah!  So that's how it was done.  Interesting!

So can one expect that to be the case as long as BeOS compatibility
is maintained?  I dummied up a 'SysInfoBeOS.h' using the old BeOS
struct and a "get_BeOS_system_info(...)" call that invokes the
legacy "_get_system_info(...)" from the OS.  Gets me back the original
behaviour.  Is this  a horrible thing to do? (:-/)

Thanks,

        -- Pete --

Other related posts: