]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
Added msp430 generic arch.
authorVladimir Burian <buriavl2@fel.cvut.cz>
Mon, 14 Mar 2011 21:23:29 +0000 (22:23 +0100)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Wed, 16 Mar 2011 16:24:03 +0000 (17:24 +0100)
14 files changed:
arch/msp430/Makefile [new file with mode: 0644]
arch/msp430/Makefile.omk [new file with mode: 0644]
arch/msp430/generic/Makefile [new file with mode: 0644]
arch/msp430/generic/Makefile.omk [new file with mode: 0644]
arch/msp430/generic/defines/Makefile [new file with mode: 0644]
arch/msp430/generic/defines/Makefile.omk [new file with mode: 0644]
arch/msp430/generic/defines/system_def.h [new file with mode: 0644]
arch/msp430/generic/defines/types.h [new file with mode: 0644]
arch/msp430/generic/libs/Makefile [new file with mode: 0644]
arch/msp430/generic/libs/Makefile.omk [new file with mode: 0644]
arch/msp430/generic/libs/malloc.h [new file with mode: 0644]
arch/msp430/generic/libs/stdio.h [new file with mode: 0644]
arch/msp430/generic/libs/system_stub.c [new file with mode: 0644]
arch/msp430/generic/libs/unistd.h [new file with mode: 0644]

diff --git a/arch/msp430/Makefile b/arch/msp430/Makefile
new file mode 100644 (file)
index 0000000..76b56fd
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or parent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/arch/msp430/Makefile.omk b/arch/msp430/Makefile.omk
new file mode 100644 (file)
index 0000000..3f99071
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = generic mach-$(MACH)
diff --git a/arch/msp430/generic/Makefile b/arch/msp430/generic/Makefile
new file mode 100644 (file)
index 0000000..76b56fd
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or parent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/arch/msp430/generic/Makefile.omk b/arch/msp430/generic/Makefile.omk
new file mode 100644 (file)
index 0000000..2ebd5c8
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = defines libs
diff --git a/arch/msp430/generic/defines/Makefile b/arch/msp430/generic/defines/Makefile
new file mode 100644 (file)
index 0000000..76b56fd
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or parent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/arch/msp430/generic/defines/Makefile.omk b/arch/msp430/generic/defines/Makefile.omk
new file mode 100644 (file)
index 0000000..9aa9efe
--- /dev/null
@@ -0,0 +1 @@
+include_HEADERS = $(notdir $(wildcard $(SOURCES_DIR)/*.h))
diff --git a/arch/msp430/generic/defines/system_def.h b/arch/msp430/generic/defines/system_def.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/arch/msp430/generic/defines/types.h b/arch/msp430/generic/defines/types.h
new file mode 100644 (file)
index 0000000..1b68e15
--- /dev/null
@@ -0,0 +1,75 @@
+/*-
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ *
+ */
+
+#ifndef _SYS_TYPES_H_
+#define        _SYS_TYPES_H_
+
+#include <sys/cdefs.h>
+#include <sys/inttypes.h>
+
+/* Machine type dependent parameters. */
+
+typedef        unsigned char   u_char;
+typedef        unsigned short  u_short;
+typedef        unsigned int    u_int;
+typedef        unsigned long   u_long;
+typedef        unsigned short  ushort;         /* Sys V compatibility */
+typedef        unsigned int    uint;           /* Sys V compatibility */
+
+typedef uint8_t                u_int8_t;
+typedef uint16_t       u_int16_t;
+typedef uint32_t       u_int32_t;
+typedef uint64_t       u_int64_t;
+
+typedef        u_int64_t       u_quad_t;       /* quads */
+typedef        int64_t         quad_t;
+typedef        quad_t *        qaddr_t;
+
+typedef        char *          caddr_t;        /* core address */
+typedef        __const char *  c_caddr_t;      /* core address, pointer to const */
+typedef        __volatile char *v_caddr_t;     /* core address, pointer to volatile */
+typedef        u_int32_t       fixpt_t;        /* fixed point number */
+typedef        u_int32_t       gid_t;          /* group id */
+typedef        u_int32_t       in_addr_t;      /* base type for internet address */
+typedef        u_int16_t       in_port_t;
+typedef        u_int32_t       ino_t;          /* inode number */
+typedef        long            key_t;          /* IPC key (for Sys V IPC) */
+typedef        u_int16_t       mode_t;         /* permissions */
+typedef        u_int16_t       nlink_t;        /* link count */
+typedef        quad_t          rlim_t;         /* resource limit */
+typedef        int32_t         segsz_t;        /* segment size */
+typedef        int32_t         swblk_t;        /* swap offset */
+typedef        int32_t         ufs_daddr_t;
+typedef        int32_t         ufs_time_t;
+typedef        u_int32_t       uid_t;          /* user id */
+
+#endif /* !_SYS_TYPES_H_ */
diff --git a/arch/msp430/generic/libs/Makefile b/arch/msp430/generic/libs/Makefile
new file mode 100644 (file)
index 0000000..b22a357
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/arch/msp430/generic/libs/Makefile.omk b/arch/msp430/generic/libs/Makefile.omk
new file mode 100644 (file)
index 0000000..f4d525d
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- makefile -*-
+
+include_HEADERS = stdio.h unistd.h malloc.h
+
+lib_obj_SOURCES = system_stub.c
diff --git a/arch/msp430/generic/libs/malloc.h b/arch/msp430/generic/libs/malloc.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/arch/msp430/generic/libs/stdio.h b/arch/msp430/generic/libs/stdio.h
new file mode 100644 (file)
index 0000000..c02d78a
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2001 Dmitry Dicky diwil@eis.ru
+ * All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+ *
+ * $Id: stdio.h,v 1.9 2004/01/28 22:25:29 cliechti Exp $
+ */
+
+#ifndef _STDIO_H_
+#define _STDIO_H_
+
+#include <stddef.h>
+#include <sys/types.h>
+
+#ifdef __STDC__
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
+
+/* This is declaration of empty variables/functions which should enable
+   compiling of libraries using files. Definitions are in system_stub.c */
+typedef struct {
+} FILE;
+
+extern FILE * stdin;
+extern FILE * stdout;
+
+int fflush(FILE *stream);
+
+
+#ifndef EOF
+# define EOF (-1)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif //__cplusplus
+
+int __attribute__((format (printf, 2, 3))) uprintf(int (*func)(int c), const char *fmt, ...);
+int __attribute__((format (printf, 3, 4))) snprintf (char *buf, size_t size, const char *fmt, ...);
+int __attribute__((format (printf, 2, 3))) sprintf (char *buf, const char *fmt, ...);
+int __attribute__((format (printf, 1, 2))) printf(const char *string, ...);
+int vuprintf(int (*func)(int c), const char *fmt0, va_list ap);
+int vsnprintf(char *dest, size_t maxlen, const char *string, va_list ap);
+int vsprintf(char *dest, const char *string, va_list ap);
+int vprintf(const char *string, va_list ap);
+
+int puts(const char *s);
+int putchar(int c);      //has to be supplied by the user, but avoids useless warnings
+int getchar();           //has to be supplied by the user
+
+#ifdef __cplusplus
+}
+#endif //__cplusplus
+
+#endif
diff --git a/arch/msp430/generic/libs/system_stub.c b/arch/msp430/generic/libs/system_stub.c
new file mode 100644 (file)
index 0000000..69b8a34
--- /dev/null
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include <unistd.h>
+
+
+FILE * stdin  = NULL;
+FILE * stdout = NULL;
+
+
+int write(int fd, const void *buf, int count) {
+  int i;
+
+  for (i = 0;  i < count;  i++) {
+    putchar(*((char*)buf++));
+  }
+
+  return count;
+}
+
+int read(int fd, void *buf, int count) {
+  int i;
+
+  for (i = 0;  i < count;  i++) {
+    *((char*)buf + i) = getchar();
+  }
+  
+  return count;
+}
+
+int fflush(FILE *stream) {
+  return 0;
+}
+
+
diff --git a/arch/msp430/generic/libs/unistd.h b/arch/msp430/generic/libs/unistd.h
new file mode 100644 (file)
index 0000000..7aeb042
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef UNISTD_H
+#define UNISTD_H
+
+int write(int fd, const void *buf, int count);
+int read(int fd, void *buf, int count);
+
+#endif
+