WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] domain.c idle_loop declaration (take 2)

To: "Mike D. Day" <ncmike@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] domain.c idle_loop declaration (take 2)
From: Adam Sulmicki <adam@xxxxxxxxxxxx>
Date: Wed, 22 Dec 2004 14:13:59 -0500 (EST)
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 22 Dec 2004 18:54:12 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
In-reply-to: <1103726749.9168.56.camel@xxxxxxxxxxxxxxxxxxxxx>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
References: <1103726749.9168.56.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
Some further analysis, with much help from Jimmy Xenidis of IBM
research, shows that the problem was not the declaration of the function
as static void, but that the compiler is optimizing the function out of
the assembled code.

The compiler is probably correct in optimizing out the function. It is only called through inline assembly, and it is static void. Further experiments with -02 -01 and -0s also cause idle_loop to be optimized out.

interesting analysis

It is a good idea to keep idle_loop declared static void. The patch
simply includes a declaration using __attribute__ ((used)) that prevents
the compiler from optimizing out the function.

ah, using "__attribute__ used" was able to find it on google. if anyone cares the url is

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function-Attributes

Still I wonder how it will interact with plan9 since I think plan9 uses own compile some part of the code.. not totally sure though.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>