Skip to contentSkip to conversation

move RTDM headers

PATCH Applied Jan Kiszka 2 participants 8 messages Jan 7, 2006

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 move RTDM headers

Hi Philippe,

this patches cleans up the include/rtdm folder by moving internal headers to ksrc/skins/rtdm, leaving only rtdm.h, rtdm_driver.h, the two profile headers, and syscall.h there. The latter is still only needed for building Xenomai itself, thus it will not be installed. Successfully built for 2.4 and 2.6. Additionally, I compiled latest RTnet SVN against it without problems (x86, PPC is currently being fixed by Wolfgang).

Please apply/move the involved headers and run bootstrap.

Jan

rtdm/device.h +0 -60
Index: include/rtdm/device.h
===================================================================
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2005 Jan Kiszka <[email protected]>.
- * Copyright (C) 2005 Joerg Langenberg <[email protected]>.
- *
- * Xenomai is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Xenomai 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Xenomai; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _RTDM_DEVICE_H
-#define _RTDM_DEVICE_H
-
-#include <xenomai/nucleus/pod.h>
-#include <xenomai/rtdm/rtdm_driver.h>
-#include <linux/sem.h>
-
-
-#define DEF_DEVNAME_HASHTAB_SIZE    256 /* entries in name hash table */
-#define DEF_PROTO_HASHTAB_SIZE      256 /* entries in protocol hash table */
-
-
-extern struct semaphore nrt_dev_lock;
-extern xnlock_t         rt_dev_lock;
-
-extern unsigned int     devname_hashtab_size;
-extern unsigned int     protocol_hashtab_size;
-
-extern struct list_head *rtdm_named_devices;
-extern struct list_head *rtdm_protocol_devices;
-
-
-int rtdm_no_support(void);
-
-struct rtdm_device *get_named_device(const char *name);
-struct rtdm_device *get_protocol_device(int protocol_family, int socket_type);
-
-static inline void rtdm_dereference_device(struct rtdm_device *device)
-{
-    atomic_dec(&device->reserved.refcount);
-}
-
-int __init rtdm_dev_init(void);
-
-static inline void rtdm_dev_cleanup(void)
-{
-    kfree(rtdm_named_devices);
-    kfree(rtdm_protocol_devices);
-}
-
-#endif /* _RTDM_DEVICE_H */
rtdm/Makefile.am +3 -4
Index: include/rtdm/Makefile.am
===================================================================
@@ -1,11 +1,10 @@
 includedir = $(prefix)/include/rtdm
 
+noinst_HEADERS = \
+	syscall.h
+
 include_HEADERS = \
-	core.h \
-	device.h \
-	proc.h \
 	rtdm.h \
 	rtdm_driver.h \
 	rtserial.h \
-	syscall.h \
 	rtbenchmark.h
rtdm/proc.h +0 -32
Index: include/rtdm/proc.h
===================================================================
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2005 Jan Kiszka <[email protected]>.
- * Copyright (C) 2005 Joerg Langenberg <[email protected]>.
- *
- * Xenomai is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Xenomai 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Xenomai; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _RTDM_PROC_H
-#define _RTDM_PROC_H
-
-extern struct proc_dir_entry *rtdm_proc_root;
-
-
-int rtdm_proc_register_device(struct rtdm_device* device);
-
-int __init rtdm_proc_init(void);
-
-void rtdm_proc_cleanup(void);
-
-#endif /* _RTDM_PROC_H */
rtdm/core.h +0 -52

52 lines not on this page · raw message

skins/rtdm/device.c +2 -2
Index: ksrc/skins/rtdm/device.c
===================================================================
@@ -28,8 +28,8 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 
-#include <xenomai/rtdm/device.h>
-#include <xenomai/rtdm/proc.h>
+#include "device.h"
+#include "proc.h"
 
 
 #define SET_DEFAULT_OP(device, operation)                               \
skins/rtdm/proc.c +3 -2
Index: ksrc/skins/rtdm/proc.c
===================================================================
@@ -22,10 +22,11 @@
 #ifdef CONFIG_PROC_FS
 
 #include <linux/proc_fs.h>
-#include <xenomai/rtdm/core.h>
-#include <xenomai/rtdm/device.h>
 
+#include "core.h"
+#include "device.h"
 
+
 /* Derived from Erwin Rol's rtai_proc_fs.h.
    Assumes that output fits into the provided buffer. */
 
skins/rtdm/module.c +5 -3
Index: ksrc/skins/rtdm/module.c
===================================================================
@@ -45,10 +45,12 @@
 #include <xenomai/nucleus/core.h>
 #include <xenomai/rtdm/syscall.h>
 #endif /* __KERNEL__ */
-#include <xenomai/rtdm/core.h>
-#include <xenomai/rtdm/device.h>
-#include <xenomai/rtdm/proc.h>
 
+#include "core.h"
+#include "device.h"
+#include "proc.h"
+
+
 MODULE_DESCRIPTION("Real-Time Driver Model");
 MODULE_AUTHOR("[email protected]");
 MODULE_LICENSE("GPL");
skins/rtdm/core.c +4 -3
Index: ksrc/skins/rtdm/core.c
===================================================================
@@ -30,12 +30,13 @@
 
 #include <xenomai/nucleus/pod.h>
 #include <xenomai/nucleus/heap.h>
+#include <xenomai/rtdm/syscall.h>
 #include <xenomai/rtdm/rtdm_driver.h>
-#include <xenomai/rtdm/core.h>
-#include <xenomai/rtdm/device.h>
-#include <xenomai/rtdm/syscall.h>
 
+#include "core.h"
+#include "device.h"
 
+
 unsigned int                fd_count = DEF_FILDES_COUNT;
 module_param(fd_count, uint, 0400);
 MODULE_PARM_DESC(fd_count, "Maximum number of file descriptors");
skins/rtdm/syscall.c +2 -1
Index: ksrc/skins/rtdm/syscall.c
===================================================================
@@ -19,10 +19,11 @@
 
 #include <xenomai/nucleus/shadow.h>
 #include <xenomai/rtdm/rtdm_driver.h>
-#include <xenomai/rtdm/core.h>
 #include <xenomai/rtdm/syscall.h>
 
+#include "core.h"
 
+
 int __rtdm_muxid;
 
 
#1 lore raw
Quoted 11 lines · Jan Kiszka

Hi Philippe,

this patches cleans up the include/rtdm folder by moving internal headers to ksrc/skins/rtdm, leaving only rtdm.h, rtdm_driver.h, the two profile headers, and syscall.h there. The latter is still only needed for building Xenomai itself, thus it will not be installed. Successfully built for 2.4 and 2.6. Additionally, I compiled latest RTnet SVN against it without problems (x86, PPC is currently being fixed by Wolfgang).

Please apply/move the involved headers and run bootstrap.

Applied, thanks.

Quoted 276 lines

Jan

------------------------------------------------------------------------

Index: include/rtdm/device.h
===================================================================

rtdm/device.h +0 -60
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2005 Jan Kiszka <[email protected]>.
- * Copyright (C) 2005 Joerg Langenberg <[email protected]>.
- *
- * Xenomai is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Xenomai 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Xenomai; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _RTDM_DEVICE_H
-#define _RTDM_DEVICE_H
-
-#include <xenomai/nucleus/pod.h>
-#include <xenomai/rtdm/rtdm_driver.h>
-#include <linux/sem.h>
-
-
-#define DEF_DEVNAME_HASHTAB_SIZE    256 /* entries in name hash table */
-#define DEF_PROTO_HASHTAB_SIZE      256 /* entries in protocol hash table */
-
-
-extern struct semaphore nrt_dev_lock;
-extern xnlock_t         rt_dev_lock;
-
-extern unsigned int     devname_hashtab_size;
-extern unsigned int     protocol_hashtab_size;
-
-extern struct list_head *rtdm_named_devices;
-extern struct list_head *rtdm_protocol_devices;
-
-
-int rtdm_no_support(void);
-
-struct rtdm_device *get_named_device(const char *name);
-struct rtdm_device *get_protocol_device(int protocol_family, int socket_type);
-
-static inline void rtdm_dereference_device(struct rtdm_device *device)
-{
-    atomic_dec(&device->reserved.refcount);
-}
-
-int __init rtdm_dev_init(void);
-
-static inline void rtdm_dev_cleanup(void)
-{
-    kfree(rtdm_named_devices);
-    kfree(rtdm_protocol_devices);
-}
-
-#endif /* _RTDM_DEVICE_H */

Index: include/rtdm/Makefile.am
===================================================================

rtdm/Makefile.am +3 -4
@@ -1,11 +1,10 @@
 includedir = $(prefix)/include/rtdm
 
+noinst_HEADERS = \
+	syscall.h
+
 include_HEADERS = \
-	core.h \
-	device.h \
-	proc.h \
 	rtdm.h \
 	rtdm_driver.h \
 	rtserial.h \
-	syscall.h \
 	rtbenchmark.h

Index: include/rtdm/proc.h
===================================================================

rtdm/proc.h +0 -32
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2005 Jan Kiszka <[email protected]>.
- * Copyright (C) 2005 Joerg Langenberg <[email protected]>.
- *
- * Xenomai is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Xenomai 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Xenomai; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _RTDM_PROC_H
-#define _RTDM_PROC_H
-
-extern struct proc_dir_entry *rtdm_proc_root;
-
-
-int rtdm_proc_register_device(struct rtdm_device* device);
-
-int __init rtdm_proc_init(void);
-
-void rtdm_proc_cleanup(void);
-
-#endif /* _RTDM_PROC_H */

Index: include/rtdm/core.h
===================================================================

rtdm/core.h +0 -52
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2005 Jan Kiszka <[email protected]>.
- * Copyright (C) 2005 Joerg Langenberg <[email protected]>.
- *
- * Xenomai is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Xenomai 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Xenomai; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _RTDM_CORE_H
-#define _RTDM_CORE_H
-
-#include <xenomai/nucleus/pod.h>
-#include <xenomai/rtdm/rtdm_driver.h>
-
-
-#define DEF_FILDES_COUNT    64  /* default number of file descriptors */
-
-
-struct rtdm_fildes {
-    struct rtdm_fildes                  *next;
-    volatile struct rtdm_dev_context    *context;
-};
-
-
-#ifdef CONFIG_SMP
-extern xnlock_t             rt_fildes_lock;
-#endif /* CONFIG_SMP */
-
-extern unsigned int         fd_count;
-extern struct rtdm_fildes   *fildes_table;
-extern int                  open_fildes;
-
-
-int __init rtdm_core_init(void);
-
-static inline void rtdm_core_cleanup(void)
-{
-    kfree(fildes_table);
-}
-
-#endif /* _RTDM_CORE_H */

Index: ksrc/skins/rtdm/device.c
===================================================================

skins/rtdm/device.c +2 -2
@@ -28,8 +28,8 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 
-#include <xenomai/rtdm/device.h>
-#include <xenomai/rtdm/proc.h>
+#include "device.h"
+#include "proc.h"
 
 
 #define SET_DEFAULT_OP(device, operation)                               \

Index: ksrc/skins/rtdm/proc.c
===================================================================

skins/rtdm/proc.c +3 -2
@@ -22,10 +22,11 @@
 #ifdef CONFIG_PROC_FS
 
 #include <linux/proc_fs.h>
-#include <xenomai/rtdm/core.h>
-#include <xenomai/rtdm/device.h>
 
+#include "core.h"
+#include "device.h"
 
+
 /* Derived from Erwin Rol's rtai_proc_fs.h.
    Assumes that output fits into the provided buffer. */
 

Index: ksrc/skins/rtdm/module.c
===================================================================

skins/rtdm/module.c +5 -3
@@ -45,10 +45,12 @@
 #include <xenomai/nucleus/core.h>
 #include <xenomai/rtdm/syscall.h>
 #endif /* __KERNEL__ */
-#include <xenomai/rtdm/core.h>
-#include <xenomai/rtdm/device.h>
-#include <xenomai/rtdm/proc.h>
 
+#include "core.h"
+#include "device.h"
+#include "proc.h"
+
+
 MODULE_DESCRIPTION("Real-Time Driver Model");
 MODULE_AUTHOR("[email protected]");
 MODULE_LICENSE("GPL");

Index: ksrc/skins/rtdm/core.c
===================================================================

skins/rtdm/core.c +4 -3
@@ -30,12 +30,13 @@
 
 #include <xenomai/nucleus/pod.h>
 #include <xenomai/nucleus/heap.h>
+#include <xenomai/rtdm/syscall.h>
 #include <xenomai/rtdm/rtdm_driver.h>
-#include <xenomai/rtdm/core.h>
-#include <xenomai/rtdm/device.h>
-#include <xenomai/rtdm/syscall.h>
 
+#include "core.h"
+#include "device.h"
 
+
 unsigned int                fd_count = DEF_FILDES_COUNT;
 module_param(fd_count, uint, 0400);
 MODULE_PARM_DESC(fd_count, "Maximum number of file descriptors");

Index: ksrc/skins/rtdm/syscall.c
===================================================================

skins/rtdm/syscall.c +2 -1
@@ -19,10 +19,11 @@
 
 #include <xenomai/nucleus/shadow.h>
 #include <xenomai/rtdm/rtdm_driver.h>
-#include <xenomai/rtdm/core.h>
 #include <xenomai/rtdm/syscall.h>
 
+#include "core.h"
 
+
 int __rtdm_muxid;
 
 
Signature · 1 line
Philippe.
#2 lore raw
In reply to Jan Kiszka

Jan Kiszka wrote:

Additionally, I compiled latest RTnet SVN against

Quoted 2 lines

it without problems (x86, PPC is currently being fixed by Wolfgang).

Btw, the moduleparams/ulong/uint issue in the 2.4 wrappers that showed up with RTNet has been fixed in Xenomai's trunk too. Normally.

Signature · 1 line
Philippe.
#3 lore raw
In reply to Jan Kiszka
Quoted 11 lines · Jan Kiszka

Hi Philippe,

this patches cleans up the include/rtdm folder by moving internal headers to ksrc/skins/rtdm, leaving only rtdm.h, rtdm_driver.h, the two profile headers, and syscall.h there. The latter is still only needed for building Xenomai itself, thus it will not be installed. Successfully built for 2.4 and 2.6. Additionally, I compiled latest RTnet SVN against it without problems (x86, PPC is currently being fixed by Wolfgang).

Please apply/move the involved headers and run bootstrap.

This one broke the build here:

--
CC kernel/xenomai/skins/rtdm/core.o
kernel/xenomai/skins/rtdm/core.c:36:18: core.h: No such file or directory kernel/xenomai/skins/rtdm/core.c:37:20: device.h: No such file or directory --

Additionally, it's a really very bad idea to start including things like "core.h" removing the rtdm/ prefix, while other include files like nucleus/core.h exist. For the sake of readability, I'm going to revert this particular change at least.

Quoted 276 lines

Jan

------------------------------------------------------------------------

Index: include/rtdm/device.h
===================================================================

rtdm/device.h +0 -60
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2005 Jan Kiszka <[email protected]>.
- * Copyright (C) 2005 Joerg Langenberg <[email protected]>.
- *
- * Xenomai is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Xenomai 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Xenomai; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _RTDM_DEVICE_H
-#define _RTDM_DEVICE_H
-
-#include <xenomai/nucleus/pod.h>
-#include <xenomai/rtdm/rtdm_driver.h>
-#include <linux/sem.h>
-
-
-#define DEF_DEVNAME_HASHTAB_SIZE    256 /* entries in name hash table */
-#define DEF_PROTO_HASHTAB_SIZE      256 /* entries in protocol hash table */
-
-
-extern struct semaphore nrt_dev_lock;
-extern xnlock_t         rt_dev_lock;
-
-extern unsigned int     devname_hashtab_size;
-extern unsigned int     protocol_hashtab_size;
-
-extern struct list_head *rtdm_named_devices;
-extern struct list_head *rtdm_protocol_devices;
-
-
-int rtdm_no_support(void);
-
-struct rtdm_device *get_named_device(const char *name);
-struct rtdm_device *get_protocol_device(int protocol_family, int socket_type);
-
-static inline void rtdm_dereference_device(struct rtdm_device *device)
-{
-    atomic_dec(&device->reserved.refcount);
-}
-
-int __init rtdm_dev_init(void);
-
-static inline void rtdm_dev_cleanup(void)
-{
-    kfree(rtdm_named_devices);
-    kfree(rtdm_protocol_devices);
-}
-
-#endif /* _RTDM_DEVICE_H */

Index: include/rtdm/Makefile.am
===================================================================

rtdm/Makefile.am +3 -4
@@ -1,11 +1,10 @@
 includedir = $(prefix)/include/rtdm
 
+noinst_HEADERS = \
+	syscall.h
+
 include_HEADERS = \
-	core.h \
-	device.h \
-	proc.h \
 	rtdm.h \
 	rtdm_driver.h \
 	rtserial.h \
-	syscall.h \
 	rtbenchmark.h

Index: include/rtdm/proc.h
===================================================================

rtdm/proc.h +0 -32
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2005 Jan Kiszka <[email protected]>.
- * Copyright (C) 2005 Joerg Langenberg <[email protected]>.
- *
- * Xenomai is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Xenomai 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Xenomai; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _RTDM_PROC_H
-#define _RTDM_PROC_H
-
-extern struct proc_dir_entry *rtdm_proc_root;
-
-
-int rtdm_proc_register_device(struct rtdm_device* device);
-
-int __init rtdm_proc_init(void);
-
-void rtdm_proc_cleanup(void);
-
-#endif /* _RTDM_PROC_H */

Index: include/rtdm/core.h
===================================================================

rtdm/core.h +0 -52
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2005 Jan Kiszka <[email protected]>.
- * Copyright (C) 2005 Joerg Langenberg <[email protected]>.
- *
- * Xenomai is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Xenomai 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Xenomai; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _RTDM_CORE_H
-#define _RTDM_CORE_H
-
-#include <xenomai/nucleus/pod.h>
-#include <xenomai/rtdm/rtdm_driver.h>
-
-
-#define DEF_FILDES_COUNT    64  /* default number of file descriptors */
-
-
-struct rtdm_fildes {
-    struct rtdm_fildes                  *next;
-    volatile struct rtdm_dev_context    *context;
-};
-
-
-#ifdef CONFIG_SMP
-extern xnlock_t             rt_fildes_lock;
-#endif /* CONFIG_SMP */
-
-extern unsigned int         fd_count;
-extern struct rtdm_fildes   *fildes_table;
-extern int                  open_fildes;
-
-
-int __init rtdm_core_init(void);
-
-static inline void rtdm_core_cleanup(void)
-{
-    kfree(fildes_table);
-}
-
-#endif /* _RTDM_CORE_H */

Index: ksrc/skins/rtdm/device.c
===================================================================

skins/rtdm/device.c +2 -2
@@ -28,8 +28,8 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 
-#include <xenomai/rtdm/device.h>
-#include <xenomai/rtdm/proc.h>
+#include "device.h"
+#include "proc.h"
 
 
 #define SET_DEFAULT_OP(device, operation)                               \

Index: ksrc/skins/rtdm/proc.c
===================================================================

skins/rtdm/proc.c +3 -2
@@ -22,10 +22,11 @@
 #ifdef CONFIG_PROC_FS
 
 #include <linux/proc_fs.h>
-#include <xenomai/rtdm/core.h>
-#include <xenomai/rtdm/device.h>
 
+#include "core.h"
+#include "device.h"
 
+
 /* Derived from Erwin Rol's rtai_proc_fs.h.
    Assumes that output fits into the provided buffer. */
 

Index: ksrc/skins/rtdm/module.c
===================================================================

skins/rtdm/module.c +5 -3
@@ -45,10 +45,12 @@
 #include <xenomai/nucleus/core.h>
 #include <xenomai/rtdm/syscall.h>
 #endif /* __KERNEL__ */
-#include <xenomai/rtdm/core.h>
-#include <xenomai/rtdm/device.h>
-#include <xenomai/rtdm/proc.h>
 
+#include "core.h"
+#include "device.h"
+#include "proc.h"
+
+
 MODULE_DESCRIPTION("Real-Time Driver Model");
 MODULE_AUTHOR("[email protected]");
 MODULE_LICENSE("GPL");

Index: ksrc/skins/rtdm/core.c
===================================================================

skins/rtdm/core.c +4 -3
@@ -30,12 +30,13 @@
 
 #include <xenomai/nucleus/pod.h>
 #include <xenomai/nucleus/heap.h>
+#include <xenomai/rtdm/syscall.h>
 #include <xenomai/rtdm/rtdm_driver.h>
-#include <xenomai/rtdm/core.h>
-#include <xenomai/rtdm/device.h>
-#include <xenomai/rtdm/syscall.h>
 
+#include "core.h"
+#include "device.h"
 
+
 unsigned int                fd_count = DEF_FILDES_COUNT;
 module_param(fd_count, uint, 0400);
 MODULE_PARM_DESC(fd_count, "Maximum number of file descriptors");

Index: ksrc/skins/rtdm/syscall.c
===================================================================

skins/rtdm/syscall.c +2 -1
@@ -19,10 +19,11 @@
 
 #include <xenomai/nucleus/shadow.h>
 #include <xenomai/rtdm/rtdm_driver.h>
-#include <xenomai/rtdm/core.h>
 #include <xenomai/rtdm/syscall.h>
 
+#include "core.h"
 
+
 int __rtdm_muxid;
 
 
Signature · 1 line
Philippe.
author
#4 lore raw
Quoted 11 lines · Philippe Gerum
Quoted 9 lines · Jan Kiszka

Hi Philippe,

this patches cleans up the include/rtdm folder by moving internal headers to ksrc/skins/rtdm, leaving only rtdm.h, rtdm_driver.h, the two profile headers, and syscall.h there. The latter is still only needed for building Xenomai itself, thus it will not be installed. Successfully built for 2.4 and 2.6. Additionally, I compiled latest RTnet SVN against it without problems (x86, PPC is currently being fixed by Wolfgang).

Quoted 10 lines
Quoted 2 lines

Please apply/move the involved headers and run bootstrap.

This one broke the build here:

Signature · 4 lines
  CC      kernel/xenomai/skins/rtdm/core.o
kernel/xenomai/skins/rtdm/core.c:36:18: core.h: No such file or directory
kernel/xenomai/skins/rtdm/core.c:37:20: device.h: No such file or directory
-- 

Updated your repos? As you forgot to apply the moving, I also got problems and applied my local versions of core.h, device.h, and proc.h, also removing the three from their previous location.

Quoted 6 lines

Additionally, it's a really very bad idea to start including things like "core.h" removing the rtdm/ prefix, while other include files like nucleus/core.h exist. For the sake of readability, I'm going to revert this particular change at least.

That's why I use #include "core.h", which -for me- clearly states: "Pick the local one!" You will now have to tweak the Makefiles again...

Jan

#5 lore raw
Quoted 26 lines · Jan Kiszka
Quoted 12 lines · Philippe Gerum
Quoted 9 lines · Jan Kiszka

Hi Philippe,

this patches cleans up the include/rtdm folder by moving internal headers to ksrc/skins/rtdm, leaving only rtdm.h, rtdm_driver.h, the two profile headers, and syscall.h there. The latter is still only needed for building Xenomai itself, thus it will not be installed. Successfully built for 2.4 and 2.6. Additionally, I compiled latest RTnet SVN against it without problems (x86, PPC is currently being fixed by Wolfgang).

Quoted 10 lines
Quoted 2 lines

Please apply/move the involved headers and run bootstrap.

This one broke the build here:

Signature · 4 lines
 CC      kernel/xenomai/skins/rtdm/core.o
kernel/xenomai/skins/rtdm/core.c:36:18: core.h: No such file or directory
kernel/xenomai/skins/rtdm/core.c:37:20: device.h: No such file or directory
-- 
Quoted 4 lines

Updated your repos? As you forgot to apply the moving, I also got problems and applied my local versions of core.h, device.h, and proc.h, also removing the three from their previous location.

The problem is that the patch does not recreate those files in ksrc/skin/rtdm, but only deletes them from include/rtdm.

Quoted 10 lines
Quoted 6 lines

Additionally, it's a really very bad idea to start including things like "core.h" removing the rtdm/ prefix, while other include files like nucleus/core.h exist. For the sake of readability, I'm going to revert this particular change at least.

That's why I use #include "core.h", which -for me- clearly states: "Pick the local one!"

Nope, it "states pick the first one you find outside of the system dirs depending on the order of the directories listed by -I in your Makefile", which is quite different, and leads to all sort of braindamage issues if you happen to screw up your CFLAGS in your Makefile.

You will now have to tweak the Makefiles again...

Quoted 1 line

That's ok, I will do that. The prefix rule is enforced everywhere for internal headers so that nobody gets mad trying to find why the wrong one is included, and the best way not to depend on "-I" pecularities is to avoid playing with them in the first place. Additionally, this leaves no doubt about which header you wanted to include, regardless of the sanity of your Makefile.

Quoted 1 line

Jan

Signature · 1 line
Philippe.
author
#6 lore raw
Quoted 33 lines · Philippe Gerum
Quoted 31 lines · Jan Kiszka
Quoted 26 lines · Philippe Gerum
Quoted 11 lines · Jan Kiszka

Hi Philippe,

this patches cleans up the include/rtdm folder by moving internal headers to ksrc/skins/rtdm, leaving only rtdm.h, rtdm_driver.h, the two profile headers, and syscall.h there. The latter is still only needed for building Xenomai itself, thus it will not be installed. Successfully
built for 2.4 and 2.6. Additionally, I compiled latest RTnet SVN against
it without problems (x86, PPC is currently being fixed by Wolfgang).

Quoted 2 lines

Please apply/move the involved headers and run bootstrap.

This one broke the build here:

Signature · 6 lines
 CC      kernel/xenomai/skins/rtdm/core.o
kernel/xenomai/skins/rtdm/core.c:36:18: core.h: No such file or
directory
kernel/xenomai/skins/rtdm/core.c:37:20: device.h: No such file or
directory
-- 
Quoted 8 lines
Quoted 4 lines

Updated your repos? As you forgot to apply the moving, I also got problems and applied my local versions of core.h, device.h, and proc.h, also removing the three from their previous location.

The problem is that the patch does not recreate those files in ksrc/skin/rtdm, but only deletes them from include/rtdm.

Oops, indeed. I was sure "svn diff" will include locally added files in the output, but it didn't -- ah, my svn version is too old! :)

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

Additionally, it's a really very bad idea to start including things like "core.h" removing the rtdm/ prefix, while other include files like nucleus/core.h exist. For the sake of readability, I'm going to revert this particular change at least.

Quoted 8 lines
Quoted 2 lines

That's why I use #include "core.h", which -for me- clearly states: "Pick the local one!"

Nope, it "states pick the first one you find outside of the system dirs depending on the order of the directories listed by -I in your Makefile", which is quite different, and leads to all sort of braindamage issues if you happen to screw up your CFLAGS in your Makefile.

#include "file.h" -> start searching for file.h in that place you found the file containing this statement. Likely one can overwrite this behaviour with some strange gcc flags.

Quoted 11 lines

You will now have to tweak the Makefiles again...

Quoted 1 line

That's ok, I will do that. The prefix rule is enforced everywhere for internal headers so that nobody gets mad trying to find why the wrong one is included, and the best way not to depend on "-I" pecularities is to avoid playing with them in the first place. Additionally, this leaves no doubt about which header you wanted to include, regardless of the sanity of your Makefile.

Ok, it's a matter of taste, and if you like to keep it this way for all skins, I'm fine with it.

Jan

#7 lore raw
Quoted 69 lines · Jan Kiszka
Quoted 36 lines · Philippe Gerum
Quoted 33 lines · Jan Kiszka
Quoted 27 lines · Philippe Gerum
Quoted 11 lines · Jan Kiszka

Hi Philippe,

this patches cleans up the include/rtdm folder by moving internal headers to ksrc/skins/rtdm, leaving only rtdm.h, rtdm_driver.h, the two profile headers, and syscall.h there. The latter is still only needed for building Xenomai itself, thus it will not be installed. Successfully
built for 2.4 and 2.6. Additionally, I compiled latest RTnet SVN against
it without problems (x86, PPC is currently being fixed by Wolfgang).

Quoted 2 lines

Please apply/move the involved headers and run bootstrap.

This one broke the build here:

Signature · 6 lines
CC      kernel/xenomai/skins/rtdm/core.o
kernel/xenomai/skins/rtdm/core.c:36:18: core.h: No such file or
directory
kernel/xenomai/skins/rtdm/core.c:37:20: device.h: No such file or
directory
-- 
Quoted 8 lines
Quoted 4 lines

Updated your repos? As you forgot to apply the moving, I also got problems and applied my local versions of core.h, device.h, and proc.h, also removing the three from their previous location.

The problem is that the patch does not recreate those files in ksrc/skin/rtdm, but only deletes them from include/rtdm.

Oops, indeed. I was sure "svn diff" will include locally added files in the output, but it didn't -- ah, my svn version is too old! :)

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

Additionally, it's a really very bad idea to start including things like "core.h" removing the rtdm/ prefix, while other include files like nucleus/core.h exist. For the sake of readability, I'm going to revert this particular change at least.

Quoted 8 lines
Quoted 2 lines

That's why I use #include "core.h", which -for me- clearly states: "Pick the local one!"

Nope, it "states pick the first one you find outside of the system dirs depending on the order of the directories listed by -I in your Makefile", which is quite different, and leads to all sort of braindamage issues if you happen to screw up your CFLAGS in your Makefile.

Quoted 4 lines

#include "file.h" -> start searching for file.h in that place you found the file containing this statement. Likely one can overwrite this behaviour with some strange gcc flags.

-I- for instance, which bluntly cancels the above behaviour. One sometimes may have to make extensive use of it to work around funky include directory layouts some applications have; early versions of the simulator had even needed this to somewhat control which portion of the "include space" was picked.

Quoted 16 lines
Quoted 10 lines

You will now have to tweak the Makefiles again...

That's ok, I will do that. The prefix rule is enforced everywhere for internal headers so that nobody gets mad trying to find why the wrong one is included, and the best way not to depend on "-I" pecularities is to avoid playing with them in the first place. Additionally, this leaves no doubt about which header you wanted to include, regardless of the sanity of your Makefile.

Ok, it's a matter of taste, and if you like to keep it this way for all skins, I'm fine with it.

Jan

Signature · 1 line
Philippe.