[vmkit-commits] [PATCH] Change enterUncooperativeCode prototype to fix build on 32bit

Nicolas Geoffray nicolas.geoffray at gmail.com
Sun Oct 23 22:47:36 PDT 2011


Thanks Will, please apply!

I don't think we should keep the two methods with the same name though, too
much confusion. We should probably rename them to
enterUncooperativeCodeAtLevel and enterUncooperativeCodeWithSP.

Nicolas

On Mon, Oct 24, 2011 at 12:57 AM, Will Dietz <wdietz2 at illinois.edu> wrote:

> Small patch, and since in all cases of the code level is zero, the
> type size reduction seems easiest fix.
>
> (Leaves ability to have non-zero, but small, levels in the future)
>
> Without this patch, 'unsigned' is the same as 'word_t' on 32bit so the two
> prototypes conflict.
>
> Attached, and copied below.
>
> ~Will
>
> >From a6772df268b2a4f23a3a83b6adfee57f38405dba Mon Sep 17 00:00:00 2001
> From: Will Dietz <w at wdtz.org>
> Date: Fri, 14 Oct 2011 03:02:49 -0500
> Subject: [PATCH] Change enterUncooperativeCode prototype to fix build on
>  32bit.
>
> ---
>  include/mvm/Threads/Thread.h      |    2 +-
>  lib/Mvm/CommonThread/ctthread.cpp |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/mvm/Threads/Thread.h b/include/mvm/Threads/Thread.h
> index 73c63f8..03be9cd 100644
> --- a/include/mvm/Threads/Thread.h
> +++ b/include/mvm/Threads/Thread.h
> @@ -208,7 +208,7 @@ public:
>   void joinRVBeforeEnter();
>   void joinRVAfterLeave(word_t savedSP);
>
> -  void enterUncooperativeCode(unsigned level = 0) __attribute__
> ((noinline));
> +  void enterUncooperativeCode(uint16_t level = 0) __attribute__
> ((noinline));
>   void enterUncooperativeCode(word_t SP);
>   void leaveUncooperativeCode();
>   word_t waitOnSP();
> diff --git a/lib/Mvm/CommonThread/ctthread.cpp
> b/lib/Mvm/CommonThread/ctthread.cpp
> index 739ad2f..1c3b1fd 100644
> --- a/lib/Mvm/CommonThread/ctthread.cpp
> +++ b/lib/Mvm/CommonThread/ctthread.cpp
> @@ -179,7 +179,7 @@ void Thread::scanStack(word_t closure) {
>   }
>  }
>
> -void Thread::enterUncooperativeCode(unsigned level) {
> +void Thread::enterUncooperativeCode(uint16_t level) {
>   if (isMvmThread()) {
>     if (!inRV) {
>       assert(!lastSP && "SP already set when entering uncooperative code");
> --
> 1.7.5.1
>
> _______________________________________________
> vmkit-commits mailing list
> vmkit-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/vmkit-commits/attachments/20111024/6745d0e3/attachment.html>


More information about the vmkit-commits mailing list