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

  • From: Rene Gollent <anevilyak@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 17 Mar 2017 11:18:05 -0400

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
.

Regards,

Rene

Other related posts: