[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[altq 1106] Floating point operations
Hi everybody,
I have a question for the list. I encountered the following when I
was developing under ALTQ, managed to work around it, but would like to
understand the cause of the problem. Consider an enqueue() (or dequeue())
function. Consider the following snippet of code:
double x;
u_int64_t a;
u_int64_t b;
a=2;
b=3;
x=a/(double) b;
What happens on FreeBSD 4.3/Intel Pentium III/gcc-2.95.3 (-O2) is a kernel
panic. After some investigation, it *looks* like the panic was caused by a
floating-point exception. This is what I *think* happens: the processor
tries to execute a floating-point division, and calls on the floating
point unit which triggers an interrupt, and for some reason, interrupts
shouldn't occur in that particular segment of code. Can someone tell me if
my assumption is correct (i.e., floating point ops are not allowed in
enqueue() or dequeue()), and if not, what the reason for this is?
Thanks,
--Nick
------------------------------------------------------------------------
Nicolas Christin nicolas@cs.virginia.edu
Multimedia Networks Group http://www.cs.virginia.edu/~nc2y
------------------------------------------------------------------------