Re: [Gems-users] Ruby magic instructions interference: Warning: in fn void magic_instruction_callback


Date: Wed, 16 May 2007 18:18:06 +0200
From: "Thomas De Schampheleire" <patrickdepinguin@xxxxxxxxx>
Subject: Re: [Gems-users] Ruby magic instructions interference: Warning: in fn void magic_instruction_callback
Hi,

Thanks for the quick reply. See below:

On 5/16/07, Dan Gibson <degibson@xxxxxxxx> wrote:
Ruby handles assumes magic instructions are directives passed to Ruby to
perform various tasks (eg. begin_transaction, etc.). Its actually a
*good* thing that you're seeing warnings -- its because Ruby doesn't
know how to interpret the magic number, and therefore isn't doing anything.

You should have a look at commands.C to see what values Ruby associates
with various actions. So long as you don't use Ruby's magic numbers, you
will not incur any Ruby-strangeness due to magic calls.

Since you're using magic number 0, you can safely ignore these warnings.
You can trivially modify commands.C to recognize "0" as a null command
and not print the warning at all.

Well, actually I'm using magic numbers in the range of 1000 upto 6000
or something. However, I noticed that in the magic ruby code in
commands.C, there is a right shift:
 val = val >> 16;
which effectively makes my magic numbers appear to be zero.

Is there a particular reason why this shift takes place?
Due to the shift, it seems that Ruby only uses magic numbers above
2^16 = 65 536.

Thanks, thomas


Regards,
Dan

Thomas De Schampheleire wrote:
> Hi,
>
> I am using Simics 2.2.19 and Ruby release 1.2.
> I have added some magic instructions to the OpenSolaris kernel
> (UltraSPARC architecture), which are handled by my own callback
> function. This works as I expect.
>
> However, when adding Ruby to the simulation, I get warnings on every
> magic instruction:
>
> cpu0 [ cycle 56876262505L ]: [ magic 1021 ] disp_getwork()
> Warning: in fn void magic_instruction_callback(void*, void*,
> integer_t) in simics/commands.C:158: val is 0
> Warning: in fn void magic_instruction_callback(void*, void*,
> integer_t) in simics/commands.C:158: val is 0
> Warning: in fn void magic_instruction_callback(void*, void*,
> integer_t) in simics/commands.C:159: Unexpected magic call
> Warning: in fn void magic_instruction_callback(void*, void*,
> integer_t) in simics/commands.C:159: Unexpected magic call
>
> The first line is the line that is printed out by my own handler, and
> the subsequent four lines seem to come from Ruby code.
>
> Can I avoid having these warnings by using other numbers for my magic
> instructions? (which range of magic instructions is used by Ruby?)
> Can my magic instructions interfere with Ruby?
> Can I possibly turn off these warnings?
>
> Thank you,
> Thomas
> _______________________________________________
> Gems-users mailing list
> Gems-users@xxxxxxxxxxx
> https://lists.cs.wisc.edu/mailman/listinfo/gems-users
> Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.
>
>

--
http://www.cs.wisc.edu/~gibson [esc]:wq!

_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.


[← Prev in Thread] Current Thread [Next in Thread→]