All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: matthieu.connaulte_xenomai@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] xenomai scheduler's ticks period
Date: Mon, 07 Jul 2008 09:49:29 +0200	[thread overview]
Message-ID: <4871CA89.8060703@domain.hid> (raw)
In-Reply-To: <09aa4c21b4e9135f30c4805934e59099@domain.hid>

Matthieu wrote:
> Hi
> 
> As I have no answer to my questions, I would like to know if you have any
> solution ?
> 

Nobody answered likely because nobody actually understands what you are trying
to achieve, at least it is still vastly unclear to me. You will find a somewhat
fixed version below; this said, using a periodic RTDM task to do that does not
bring much value, except perhaps to demonstrate the use of decoupled timebases.

What has been suggested earlier was to use RTDM to relay tick forwarding
requests from a userland process to pace the VxWorks skin in kernel space (e.g.
using ioctl calls).

Again: read the timebase programming documentation to have a clearer view of the
timer core internals.

--- orig.c	2008-07-07 09:36:01.000000000 +0200
+++ frags/tickoverride/module.c	2008-07-07 09:33:52.000000000 +0200
@@ -5,7 +5,7 @@
 struct drv_context {
 };

-long tick_period=1;
+long tick_period=100000000;

 // RT_TASK vxworks_tick_task;
 rtdm_task_t vxworks_tick_task;
@@ -29,31 +29,31 @@
 /**********************************************************/
 /*            DRIVER OPEN                                 */
 /**********************************************************/
-void open_rt(struct rtdm_dev_context    *context,
+int open_rt(struct rtdm_dev_context    *context,
                  rtdm_user_info_t           *user_info,
                  int                        oflags)
 {
-
+  return 0;
 }

 /**********************************************************/
 /*            DRIVER CLOSE                                */
 /**********************************************************/
-void close_rt(struct rtdm_dev_context   *context,
+int close_rt(struct rtdm_dev_context   *context,
                   rtdm_user_info_t          *user_info)
 {
-
+  return 0;
 }

 /**********************************************************/
 /*            DRIVER IOCTL                                */
 /**********************************************************/
-void ioctl_rt(struct rtdm_dev_context   *context,
+int ioctl_rt(struct rtdm_dev_context   *context,
                   rtdm_user_info_t          *user_info,
-                  int                       request,
+                  unsigned                  request,
                   void                      *arg)
 {
-
+  return 0;
 }


@@ -103,11 +103,19 @@
     proc_name:          tick_driver.device_name,
 };

+extern xntbase_t *wind_tbase;
+
 /**********************************************************/
 /*            INIT DRIVER                                 */
 /**********************************************************/
 int init_module(void)
 {
+    int ret;
+
+    ret = xntbase_switch("vxworks", tick_period, &wind_tbase);
+    if (ret)
+        return ret;
+
     rtdm_dev_register(&tick_driver);
     rtdm_task_init(&vxworks_tick_task, "vxworks_tick_task", &vxworks_tick,
 NULL, 99, 0);
{rpm@xenomai.org} diff -u orig.c frags/tickoverride/module.c
--- orig.c	2008-07-07 09:36:01.000000000 +0200
+++ frags/tickoverride/module.c	2008-07-07 09:33:52.000000000 +0200
@@ -5,7 +5,7 @@
 struct drv_context {
 };

-long tick_period=1;
+long tick_period=100000000;

 // RT_TASK vxworks_tick_task;
 rtdm_task_t vxworks_tick_task;
@@ -29,31 +29,31 @@
 /**********************************************************/
 /*            DRIVER OPEN                                 */
 /**********************************************************/
-void open_rt(struct rtdm_dev_context    *context,
+int open_rt(struct rtdm_dev_context    *context,
                  rtdm_user_info_t           *user_info,
                  int                        oflags)
 {
-
+  return 0;
 }

 /**********************************************************/
 /*            DRIVER CLOSE                                */
 /**********************************************************/
-void close_rt(struct rtdm_dev_context   *context,
+int close_rt(struct rtdm_dev_context   *context,
                   rtdm_user_info_t          *user_info)
 {
-
+  return 0;
 }

 /**********************************************************/
 /*            DRIVER IOCTL                                */
 /**********************************************************/
-void ioctl_rt(struct rtdm_dev_context   *context,
+int ioctl_rt(struct rtdm_dev_context   *context,
                   rtdm_user_info_t          *user_info,
-                  int                       request,
+                  unsigned                  request,
                   void                      *arg)
 {
-
+  return 0;
 }


@@ -103,11 +103,19 @@
     proc_name:          tick_driver.device_name,
 };

+extern xntbase_t *wind_tbase;
+
 /**********************************************************/
 /*            INIT DRIVER                                 */
 /**********************************************************/
 int init_module(void)
 {
+    int ret;
+
+    ret = xntbase_switch("vxworks", tick_period, &wind_tbase);
+    if (ret)
+        return ret;
+
     rtdm_dev_register(&tick_driver);
     rtdm_task_init(&vxworks_tick_task, "vxworks_tick_task", &vxworks_tick,
 NULL, 99, 0);

-- 
Philippe.


  reply	other threads:[~2008-07-07  7:49 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4861045E.4010106@domain.hid>
     [not found] ` <14a573dd7f3ed8e10e00a083480c4622@domain.hid>
2008-06-24 16:40   ` [Xenomai-help] xenomai scheduler's ticks period Gilles Chanteperdrix
2008-06-24 17:10     ` Matthieu
2008-06-25  8:06       ` Matthieu
2008-06-26  8:07       ` Matthieu
2008-06-30  7:40         ` Matthieu
2008-07-01  8:28           ` Matthieu
2008-07-07  5:49             ` Matthieu
2008-07-07  7:49               ` Philippe Gerum [this message]
2008-07-07  9:49                 ` Matthieu
2008-07-07 11:45                   ` Philippe Gerum
2008-07-07 13:19                     ` Matthieu
2008-07-07 13:33                       ` Philippe Gerum
2008-07-07 13:44                         ` Matthieu
2008-07-07 13:55                           ` Philippe Gerum
     [not found]                             ` <5c3287e115e89c7cbb7c53402762cb2c@domain.hid>
2008-07-07 14:16                               ` Philippe Gerum
     [not found]                                 ` <a01245292d763fa02c3e6b9a79b67348@domain.hid>
2008-07-07 14:41                                   ` Philippe Gerum
2008-07-15  7:27                                     ` Matthieu
2008-07-15 19:07                                       ` Philippe Gerum
2008-07-16  6:41                                         ` Matthieu
2008-07-16  6:28                                           ` Philippe Gerum
     [not found] <488DC8B8.4080403@domain.hid>
2008-08-07  8:12 ` Matthieu
2008-07-17  7:49 Matthieu
2008-07-21 14:41 ` Matthieu
2008-07-28 10:27   ` Matthieu
2008-07-28 13:02     ` Gilles Chanteperdrix
     [not found] <485F7A69.7080004@domain.hid>
     [not found] ` <5b5edafe752e2ab744303b0262edc05c@domain.hid>
2008-06-23 15:57   ` Philippe Gerum
2008-06-23 16:33     ` Gilles Chanteperdrix
2008-06-23 16:40       ` Philippe Gerum
2008-06-23 16:46         ` Gilles Chanteperdrix
     [not found]         ` <485FD32C.3040902@domain.hid>
2008-06-23 17:18           ` Philippe Gerum
2008-06-23 17:52             ` Matthieu
2008-06-24 14:22               ` Matthieu
  -- strict thread matches above, loose matches on Subject: below --
2008-06-23  8:14 Matthieu
2008-06-23  9:58 ` Philippe Gerum
2008-06-11  9:18 Matthieu
2008-06-11 12:28 ` Gilles Chanteperdrix
2008-06-10  8:43 Matthieu
2008-06-10  9:22 ` Matthieu
2008-06-10  9:43 ` Gilles Chanteperdrix
2008-06-11  5:47   ` Matthieu
2008-06-15 12:50     ` Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4871CA89.8060703@domain.hid \
    --to=rpm@xenomai.org \
    --cc=matthieu.connaulte_xenomai@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.