[Xenomai-git] Philippe Gerum : cobalt/posix: rename shadow descriptors unambiguously

2014-02-20 Thread git repository hosting
Module: xenomai-forge
Branch: next
Commit: 97ad7b18156f436d6ad5353009cdd46aaf23955e
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=97ad7b18156f436d6ad5353009cdd46aaf23955e

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Feb 19 16:40:06 2014 +0100

cobalt/posix: rename shadow descriptors unambiguously

---

 include/cobalt/uapi/cond.h  |2 +-
 include/cobalt/uapi/mutex.h |2 +-
 include/cobalt/uapi/sem.h   |2 +-
 kernel/cobalt/posix/cond.c  |   22 +++---
 kernel/cobalt/posix/cond.h  |   12 ++--
 kernel/cobalt/posix/mutex.c |   20 ++--
 kernel/cobalt/posix/mutex.h |   14 +++---
 kernel/cobalt/posix/nsem.c  |   14 +++---
 kernel/cobalt/posix/sem.c   |   30 +++---
 kernel/cobalt/posix/sem.h   |   26 +-
 lib/cobalt/cond.c   |   24 
 lib/cobalt/init.c   |   12 ++--
 lib/cobalt/internal.c   |2 +-
 lib/cobalt/internal.h   |4 ++--
 lib/cobalt/mutex.c  |   12 ++--
 lib/cobalt/semaphore.c  |   22 +++---
 16 files changed, 110 insertions(+), 110 deletions(-)

diff --git a/include/cobalt/uapi/cond.h b/include/cobalt/uapi/cond.h
index 0c6157a..60e1ab4 100644
--- a/include/cobalt/uapi/cond.h
+++ b/include/cobalt/uapi/cond.h
@@ -24,7 +24,7 @@
 
 union cobalt_cond_union {
pthread_cond_t native_cond;
-   struct __shadow_cond {
+   struct cobalt_cond_shadow {
unsigned int magic;
struct cobalt_condattr attr;
xnhandle_t handle;
diff --git a/include/cobalt/uapi/mutex.h b/include/cobalt/uapi/mutex.h
index 88c95e7..1294ed0 100644
--- a/include/cobalt/uapi/mutex.h
+++ b/include/cobalt/uapi/mutex.h
@@ -29,7 +29,7 @@ struct mutex_dat {
 
 union cobalt_mutex_union {
pthread_mutex_t native_mutex;
-   struct __shadow_mutex {
+   struct cobalt_mutex_shadow {
unsigned int magic;
unsigned int lockcnt;
xnhandle_t handle;
diff --git a/include/cobalt/uapi/sem.h b/include/cobalt/uapi/sem.h
index 69fc989..dcd6388 100644
--- a/include/cobalt/uapi/sem.h
+++ b/include/cobalt/uapi/sem.h
@@ -32,7 +32,7 @@ struct sem_dat {
 
 union cobalt_sem_union {
sem_t native_sem;
-   struct __shadow_sem {
+   struct cobalt_sem_shadow {
unsigned int magic;
int datp_offset;
xnhandle_t handle;
diff --git a/kernel/cobalt/posix/cond.c b/kernel/cobalt/posix/cond.c
index 957a3ae..9051f2a 100644
--- a/kernel/cobalt/posix/cond.c
+++ b/kernel/cobalt/posix/cond.c
@@ -104,7 +104,7 @@ cond_destroy_internal(xnhandle_t handle, struct 
cobalt_kqueues *q)
  *
  */
 static inline int
-pthread_cond_init(struct __shadow_cond *cnd, const pthread_condattr_t *attr)
+pthread_cond_init(struct cobalt_cond_shadow *cnd, const pthread_condattr_t 
*attr)
 {
int synch_flags = XNSYNCH_PRIO | XNSYNCH_NOPIP, err;
struct cobalt_cond *cond, *old_cond;
@@ -214,7 +214,7 @@ do_init:
  * Specification./a
  *
  */
-static inline int pthread_cond_destroy(struct __shadow_cond *cnd)
+static inline int pthread_cond_destroy(struct cobalt_cond_shadow *cnd)
 {
struct cobalt_cond *cond;
int pshared;
@@ -227,7 +227,7 @@ static inline int pthread_cond_destroy(struct __shadow_cond 
*cnd)
return -EINVAL;
}

-   if (!cobalt_obj_active(cnd, COBALT_COND_MAGIC, struct __shadow_cond)
+   if (!cobalt_obj_active(cnd, COBALT_COND_MAGIC, struct 
cobalt_cond_shadow)
|| !cobalt_obj_active(cond, COBALT_COND_MAGIC, struct cobalt_cond)) 
{
xnlock_put_irqrestore(nklock, s);
return -EINVAL;
@@ -357,11 +357,11 @@ unlock_and_return:
return err;
 }
 
-int cobalt_cond_init(struct __shadow_cond __user *u_cnd,
+int cobalt_cond_init(struct cobalt_cond_shadow __user *u_cnd,
 const pthread_condattr_t __user *u_attr)
 {
pthread_condattr_t locattr, *attr;
-   struct __shadow_cond cnd;
+   struct cobalt_cond_shadow cnd;
int err;
 
if (__xn_safe_copy_from_user(cnd, u_cnd, sizeof(cnd)))
@@ -384,9 +384,9 @@ int cobalt_cond_init(struct __shadow_cond __user *u_cnd,
return __xn_safe_copy_to_user(u_cnd, cnd, sizeof(*u_cnd));
 }
 
-int cobalt_cond_destroy(struct __shadow_cond __user *u_cnd)
+int cobalt_cond_destroy(struct cobalt_cond_shadow __user *u_cnd)
 {
-   struct __shadow_cond cnd;
+   struct cobalt_cond_shadow cnd;
int err;
 
if (__xn_safe_copy_from_user(cnd, u_cnd, sizeof(cnd)))
@@ -404,8 +404,8 @@ struct us_cond_data {
 };
 
 /* pthread_cond_wait_prologue(cond, mutex, count_ptr, timed, timeout) */
-int cobalt_cond_wait_prologue(struct __shadow_cond __user *u_cnd,
- struct __shadow_mutex __user *u_mx,
+int cobalt_cond_wait_prologue(struct cobalt_cond_shadow __user *u_cnd,
+

[Xenomai-git] Philippe Gerum : cobalt/posix: rename shadow descriptors unambiguously

2014-02-19 Thread git repository hosting
Module: xenomai-forge
Branch: next
Commit: 4fd9cd21e58ddf566a1b2facc6e3d2d1e8d5b983
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=4fd9cd21e58ddf566a1b2facc6e3d2d1e8d5b983

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Feb 19 16:40:06 2014 +0100

cobalt/posix: rename shadow descriptors unambiguously

---

 include/cobalt/uapi/cond.h  |2 +-
 include/cobalt/uapi/mutex.h |2 +-
 include/cobalt/uapi/sem.h   |2 +-
 kernel/cobalt/posix/cond.c  |   22 +++---
 kernel/cobalt/posix/cond.h  |   12 ++--
 kernel/cobalt/posix/mutex.c |   20 ++--
 kernel/cobalt/posix/mutex.h |   14 +++---
 kernel/cobalt/posix/nsem.c  |   14 +++---
 kernel/cobalt/posix/sem.c   |   30 +++---
 kernel/cobalt/posix/sem.h   |   26 +-
 lib/cobalt/cond.c   |   24 
 lib/cobalt/init.c   |   12 ++--
 lib/cobalt/internal.c   |2 +-
 lib/cobalt/internal.h   |4 ++--
 lib/cobalt/mutex.c  |   12 ++--
 lib/cobalt/semaphore.c  |   22 +++---
 16 files changed, 110 insertions(+), 110 deletions(-)

diff --git a/include/cobalt/uapi/cond.h b/include/cobalt/uapi/cond.h
index 0c6157a..60e1ab4 100644
--- a/include/cobalt/uapi/cond.h
+++ b/include/cobalt/uapi/cond.h
@@ -24,7 +24,7 @@
 
 union cobalt_cond_union {
pthread_cond_t native_cond;
-   struct __shadow_cond {
+   struct cobalt_cond_shadow {
unsigned int magic;
struct cobalt_condattr attr;
xnhandle_t handle;
diff --git a/include/cobalt/uapi/mutex.h b/include/cobalt/uapi/mutex.h
index 88c95e7..1294ed0 100644
--- a/include/cobalt/uapi/mutex.h
+++ b/include/cobalt/uapi/mutex.h
@@ -29,7 +29,7 @@ struct mutex_dat {
 
 union cobalt_mutex_union {
pthread_mutex_t native_mutex;
-   struct __shadow_mutex {
+   struct cobalt_mutex_shadow {
unsigned int magic;
unsigned int lockcnt;
xnhandle_t handle;
diff --git a/include/cobalt/uapi/sem.h b/include/cobalt/uapi/sem.h
index 69fc989..dcd6388 100644
--- a/include/cobalt/uapi/sem.h
+++ b/include/cobalt/uapi/sem.h
@@ -32,7 +32,7 @@ struct sem_dat {
 
 union cobalt_sem_union {
sem_t native_sem;
-   struct __shadow_sem {
+   struct cobalt_sem_shadow {
unsigned int magic;
int datp_offset;
xnhandle_t handle;
diff --git a/kernel/cobalt/posix/cond.c b/kernel/cobalt/posix/cond.c
index 957a3ae..9051f2a 100644
--- a/kernel/cobalt/posix/cond.c
+++ b/kernel/cobalt/posix/cond.c
@@ -104,7 +104,7 @@ cond_destroy_internal(xnhandle_t handle, struct 
cobalt_kqueues *q)
  *
  */
 static inline int
-pthread_cond_init(struct __shadow_cond *cnd, const pthread_condattr_t *attr)
+pthread_cond_init(struct cobalt_cond_shadow *cnd, const pthread_condattr_t 
*attr)
 {
int synch_flags = XNSYNCH_PRIO | XNSYNCH_NOPIP, err;
struct cobalt_cond *cond, *old_cond;
@@ -214,7 +214,7 @@ do_init:
  * Specification./a
  *
  */
-static inline int pthread_cond_destroy(struct __shadow_cond *cnd)
+static inline int pthread_cond_destroy(struct cobalt_cond_shadow *cnd)
 {
struct cobalt_cond *cond;
int pshared;
@@ -227,7 +227,7 @@ static inline int pthread_cond_destroy(struct __shadow_cond 
*cnd)
return -EINVAL;
}

-   if (!cobalt_obj_active(cnd, COBALT_COND_MAGIC, struct __shadow_cond)
+   if (!cobalt_obj_active(cnd, COBALT_COND_MAGIC, struct 
cobalt_cond_shadow)
|| !cobalt_obj_active(cond, COBALT_COND_MAGIC, struct cobalt_cond)) 
{
xnlock_put_irqrestore(nklock, s);
return -EINVAL;
@@ -357,11 +357,11 @@ unlock_and_return:
return err;
 }
 
-int cobalt_cond_init(struct __shadow_cond __user *u_cnd,
+int cobalt_cond_init(struct cobalt_cond_shadow __user *u_cnd,
 const pthread_condattr_t __user *u_attr)
 {
pthread_condattr_t locattr, *attr;
-   struct __shadow_cond cnd;
+   struct cobalt_cond_shadow cnd;
int err;
 
if (__xn_safe_copy_from_user(cnd, u_cnd, sizeof(cnd)))
@@ -384,9 +384,9 @@ int cobalt_cond_init(struct __shadow_cond __user *u_cnd,
return __xn_safe_copy_to_user(u_cnd, cnd, sizeof(*u_cnd));
 }
 
-int cobalt_cond_destroy(struct __shadow_cond __user *u_cnd)
+int cobalt_cond_destroy(struct cobalt_cond_shadow __user *u_cnd)
 {
-   struct __shadow_cond cnd;
+   struct cobalt_cond_shadow cnd;
int err;
 
if (__xn_safe_copy_from_user(cnd, u_cnd, sizeof(cnd)))
@@ -404,8 +404,8 @@ struct us_cond_data {
 };
 
 /* pthread_cond_wait_prologue(cond, mutex, count_ptr, timed, timeout) */
-int cobalt_cond_wait_prologue(struct __shadow_cond __user *u_cnd,
- struct __shadow_mutex __user *u_mx,
+int cobalt_cond_wait_prologue(struct cobalt_cond_shadow __user *u_cnd,
+