Module: xenomai-forge
Branch: master
Commit: 86084c6d5afb2eadda31d73769ca85fb349c7cf6
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=86084c6d5afb2eadda31d73769ca85fb349c7cf6

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Jun  1 18:01:48 2012 +0200

mercury: introduce core-specific wrapper header

---

 include/copperplate/wrappers.h |    3 +-
 include/mercury/wrappers.h     |   57 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/include/copperplate/wrappers.h b/include/copperplate/wrappers.h
index 26e434a..a7c68f5 100644
--- a/include/copperplate/wrappers.h
+++ b/include/copperplate/wrappers.h
@@ -24,8 +24,7 @@
 #ifdef CONFIG_XENO_COBALT
 #include <cobalt/wrappers.h>
 #else /* CONFIG_XENO_MERCURY */
-#define __RT(call)     call
-#define __STD(call)    call
+#include <mercury/wrappers.h>
 #endif /* CONFIG_XENO_MERCURY */
 
 #endif /* _COPPERPLATE_WRAPPERS_H */
diff --git a/include/mercury/wrappers.h b/include/mercury/wrappers.h
new file mode 100644
index 0000000..843a9e1
--- /dev/null
+++ b/include/mercury/wrappers.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2012 Philippe Gerum <r...@xenomai.org>.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+ */
+
+#ifndef _MERCURY_WRAPPERS_H
+#define _MERCURY_WRAPPERS_H
+
+#include <xeno_config.h>
+
+#define __RT(call)     call
+#define __STD(call)    call
+
+#ifndef HAVE_PTHREAD_CONDATTR_SETCLOCK
+
+#include <pthread.h>
+
+static inline
+int pthread_condattr_setclock(pthread_condattr_t *attr,
+                             clockid_t clk_id)
+{
+       return ENOSYS;
+}
+
+#endif /* !HAVE_PTHREAD_CONDATTR_SETCLOCK */
+
+#ifndef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
+
+enum
+{
+  PTHREAD_PRIO_NONE,
+  PTHREAD_PRIO_INHERIT,
+  PTHREAD_PRIO_PROTECT
+};
+
+static inline
+int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol)
+{
+       return ENOSYS;
+}
+
+#endif /* !HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL */
+
+#endif /* _MERCURY_WRAPPERS_H */


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to