I've (sorta) figured it out. The int must first be cast as a long long
or the multiplication will overflow, but when I tried putting a division in a
rt-space function to return miliseconds since boot, I get
./init.o: unresolved symbol __divdi3
when I try to load up my init.o module. Is the access of the longlong division
forbidden within rt-space?
BTW, getlrtime that produced that error is little more than
unsigned long int getlrtime(void){
return((unsigned long)((long long)gethrtime() / 1000000LL)
}
-Cory
On Mon, 26 Jun 2000, Michael Barabanov wrote:
> Cory Papenfuss ([EMAIL PROTECTED]) wrote:
> > Hey all... I've got something that's been bugging me for awhile on this
> > project. I really only need millisecond resolution (since I'm logging data to
> > disk), but the hrtime_t doesn't like to be divided by 10000000 (NS_PER_MS), as
> > it's a funky type. Any way I can get around that and get a millisecond
> > timestamp?
>
> What do you mean it doesn't like to be divided? hrtime_t is just
> an alias for long long.
>
> > On a related note, I've got a user-space app that can send new
> > pthread_make_period_np periods (again in [ms]). Problem is that if I try to
> > send a time greater than 2147 ms, the machine craps out. I suspect it's a
> > rollover on my
> >
> > looptime = <some_int_from_fifo> * 1000000;
> > pthread_make_periodic_np(thread[0], genesis+OFFSET, looptime);
> >
> >
> > What's a good way to do arithmetic on these hrtime_t creatures?
>
> looptime = <some_int_from_fifo> * (long long) 1000000;
>
> Michael.
>
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/