Initial commit to the PapyrusRT repository.

This is the initial commit as submitted to CQ 9646.

The repository contains two top-level folders:

- codegen: the code-generator
- rts: the run-time system

Also-by: Andrew Eidsness, Zeligsoft contractor, andrewe@jfront.com,
Barry Maher, Zeligsoft contractor, bmaher@gpinc.ca, Ernesto Posse,
Zeligsoft, eposse@zeligsoft.com, Tim McGuire, Zeligsoft,
tmcguire@zeligsoft.com, Young-Soo Roh, Zeligsoft, ysroh@zeligsoft.com,
Toby McClean, Zeligsoft, toby@zeligsoft.com, Charles Rivet, Zeligsoft,
charles@zeligsoft.com, Andreas Henriksson, Ericsson,
andreas.henriksson@ericsson.com, Akos Horvath, IncQuery Labs,
akos.horvath@incquerylabs.com, Gabor Batori, Ericsson,
Gabor.Batori@ericsson.com, Abel Hegedus, IncQuery Labs,
abel.hegedus@incquerylabs.com, Denes Harmath, IncQuery Labs,
harmathdenes@gmail.com
Signed-off-by: Ernesto Posse <eposse@gmail.com>
diff --git a/rts/umlrt/umlrtmessage.cc b/rts/umlrt/umlrtmessage.cc
new file mode 100644
index 0000000..3590940
--- /dev/null
+++ b/rts/umlrt/umlrtmessage.cc
@@ -0,0 +1,42 @@
+// umlrtmessage.cc
+
+/*******************************************************************************
+* Copyright (c) 2015 Zeligsoft (2009) Limited  and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*******************************************************************************/
+
+#include "umlrtapi.hh"
+#include "umlrtcontroller.hh"
+#include "umlrtmessage.hh"
+#include "umlrtqueue.hh"
+
+// See umlrtmessagequeue.hh for documentation.
+
+bool UMLRTMessage::defer() const
+{
+    bool ok = false;
+
+    UMLRTMessage * msg = umlrt::MessageGetFromPool();
+    if (msg == NULL)
+    {
+        destPort->slot->controller->setError(UMLRTController::E_DEFER_ALLOC);
+    }
+    else
+    {
+        msg->srcPortIndex = srcPortIndex;
+        msg->sapIndex0 = sapIndex0;
+        msg->destPort = destPort;
+        msg->destSlot = destSlot;
+        msg->signal = signal; // This copy causes the reference count on signal to increment.
+        msg->isCommand = isCommand;
+
+        // Append to defer queue.
+        destPort->deferQueue->enqueue(msg);
+        ok = true;
+    }
+    return ok;
+}
+