[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom [root <agn@city.dk>] (fwd)



>From owner-rtl Wed May 16 05:26:47 2001
Received: from kalman.iau.dtu.dk (kalman.iau.dtu.dk [192.38.66.22])
	by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f4GBQir05851
	for <rtl@rtlinux.org>; Wed, 16 May 2001 05:26:44 -0600
Received: from city.dk (IDENT:root@xterm39 [192.38.66.79])
	by kalman.iau.dtu.dk (8.9.3/8.9.3) with ESMTP id NAA16666
	for <rtl@rtlinux.org>; Wed, 16 May 2001 13:21:38 +0200
Sender: root@kalman.iau.dtu.dk
Message-ID: <3B02630E.D69543A3@city.dk>
Date: Wed, 16 May 2001 13:22:54 +0200
From: root <agn@city.dk>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.1-rtl i686)
X-Accept-Language: en
MIME-Version: 1.0
To: rtlinux <rtl@rtlinux.org>
Subject: nanosleep()
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi all

I have a problem with the funktion nanosleep.
I am making a RT-linux kernel module and use teh funktion nanosleep, to
sleep for about 1e5 to 5e5 nanoSec.

Sometimes it goes wrong. I recive a "segmentation fault" in my userspace
app. There is a rtl fifo between user/kernel space.
with sometimes i meen : I can write a number between 1 to 5000 times
before it goes wrong.
loged message in kernel (a small bit of it):

May 16 13:07:36 xterm39 kernel: TEST :handler_rs0
May 16 13:07:36 xterm39 kernel: TEST :recived 2 4 2 4
May 16 13:07:36 xterm39 kernel: TEST :writing rest
May 16 13:07:36 xterm39 kernel: TEST :reciving
May 16 13:07:36 xterm39 kernel: TEST :have devided
May 16 13:07:36 xterm39 kernel: divide error: 0000
May 16 13:07:36 xterm39 kernel: CPU:    0

this is some of the code :
        /* delay before first char */
       delay = (long) one_char * wait[0];
       time_delay.tv_sec = 0; /* delay/one_sec; */
       time_delay.tv_nsec = delay; /* % one_sec; */
       MSG("have devided\n");
       nanosleep(&time_delay,&time_delay);
       MSG("have devided 2 \n");          <- I newer recive this
************, well mest of the times, but not after the devide error.

I have included this header files
#include <linux/errno.h>
#include <rtl.h>
#include <time.h>
#include <rtl_time.h>
#include <rtl_sched.h>
#include <rtl_fifo.h>
#include <pthread.h>

Could any please tell me what is wrong .