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

Will Dietz wdietz2 at illinois.edu
Sun Oct 23 15:57:39 PDT 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Change-enterUncooperativeCode-prototype-to-fix-build.patch
Type: application/octet-stream
Size: 1403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/vmkit-commits/attachments/20111023/0ff50e55/attachment.obj>


More information about the vmkit-commits mailing list