From 95d8f157483164d7f213ca21910a3ed5d38211d5 Mon Sep 17 00:00:00 2001
From: patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>
Date: Thu, 12 May 2011 17:42:01 +0000
Subject: [PATCH] First set of changes to incorporate the RGMP port

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3595 42af7a65-404d-4744-a932-0658087f49c3
---
 ChangeLog.txt          |  2 +
 examples/Makefile      |  2 +-
 examples/README.txt    | 13 ++++++
 examples/rgmp/Makefile | 93 ++++++++++++++++++++++++++++++++++++++++++
 examples/rgmp/main.c   | 66 ++++++++++++++++++++++++++++++
 5 files changed, 175 insertions(+), 1 deletion(-)
 create mode 100644 examples/rgmp/Makefile
 create mode 100644 examples/rgmp/main.c

diff --git a/ChangeLog.txt b/ChangeLog.txt
index e3a87ae25..48c711464 100755
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -40,3 +40,5 @@
 	* apps/netutils/dhcpc, dhcpcd, and tftp.  If these directories are included
 	  in the configuration but CONFIG_NET_UDP is disable (which is not very wise),
 	  then a make error occurs because tools/mkdep.sh is called with no files.
+	* system/free: Move Uros' custom free command from vsn/free
+	* system/install: Add a new install command submitted by Uros Platise.
diff --git a/examples/Makefile b/examples/Makefile
index de1c5ebed..78adb4955 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -38,7 +38,7 @@
 # Sub-directories
 
 SUBDIRS = dhcpd hello helloxx hidkbd igmp mm mount nettest nsh null nx \
-	  nxflat ostest pashello pipe poll romfs sendmail serloop thttpd \
+	  nxflat ostest pashello pipe poll rgmp romfs sendmail serloop thttpd \
 	  udp uip usbserial usbstorage wget wlan
 
 all: nothing
diff --git a/examples/README.txt b/examples/README.txt
index 468d3d86b..b19b6d1d1 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -348,6 +348,19 @@ examples/poll
 
   CONFIGURED_APPS += uiplib
 
+examples/rgmp
+^^^^^^^^^^^^^
+
+  RGMP stands for RTOS and GPOS on Multi-Processor.  RGMP is a project for 
+  running GPOS and RTOS simultaneously on multi-processor platforms. You can
+  port your favorite RTOS to RGMP together with an unmodified Linux to form a
+  hybrid operating system. This makes your application able to use both RTOS
+  and GPOS feathures.
+
+  See http://rgmp.sourceforge.net/wiki/index.php/Main_Page for further
+
+  At present, the RGMP example folder contains only an empty main.c file.
+
 examples/romfs
 ^^^^^^^^^^^^^^
 
diff --git a/examples/rgmp/Makefile b/examples/rgmp/Makefile
new file mode 100644
index 000000000..cefe63d54
--- /dev/null
+++ b/examples/rgmp/Makefile
@@ -0,0 +1,93 @@
+############################################################################
+# examples/rgmp/Makefile
+#
+#   Copyright (C) 2011 Gregory Nutt. All rights reserved.
+#   Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+#    used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+-include $(TOPDIR)/.config
+-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
+
+# The smallest thing you can build -- the NULL example.
+
+ASRCS		=
+CSRCS		= main.c
+
+AOBJS		= $(ASRCS:.S=$(OBJEXT))
+COBJS		= $(CSRCS:.c=$(OBJEXT))
+
+SRCS		= $(ASRCS) $(CSRCS)
+OBJS		= $(AOBJS) $(COBJS)
+
+ifeq ($(WINTOOL),y)
+  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
+else
+  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
+endif
+
+ROOTDEPPATH	= --dep-path .
+
+# Common build
+
+VPATH		= 
+
+all: .built
+.PHONY: clean depend distclean
+
+$(AOBJS): %$(OBJEXT): %.S
+	$(call ASSEMBLE, $<, $@)
+
+$(COBJS): %$(OBJEXT): %.c
+	$(call COMPILE, $<, $@)
+
+.built: $(OBJS)
+	@( for obj in $(OBJS) ; do \
+		$(call ARCHIVE, $(BIN), $${obj}); \
+	done ; )
+	@touch .built
+
+context:
+
+.depend: Makefile $(SRCS)
+	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
+	@touch $@
+
+depend: .depend
+
+clean:
+	@rm -f *.o *~ .*.swp .built
+	$(call CLEAN)
+
+distclean: clean
+	@rm -f Make.dep .depend
+
+-include Make.dep
diff --git a/examples/rgmp/main.c b/examples/rgmp/main.c
new file mode 100644
index 000000000..ec6450c50
--- /dev/null
+++ b/examples/rgmp/main.c
@@ -0,0 +1,66 @@
+/****************************************************************************
+ * examples/rgmp/main.c
+ *
+ *   Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <stdio.h>
+#include <string.h>
+
+/****************************************************************************
+ * Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * user_start
+ ****************************************************************************/
+
+int user_start(int argc, char *argv[])
+{
+    // TODO: add your code here
+    
+    return 0;
+}
+