[parisc-linux] fic problem
Matthew Wilcox
willy@debian.org
Fri, 13 Dec 2002 12:45:18 +0000
On Fri, Dec 13, 2002 at 04:27:13AM -0800, FARINATI,LEANDRO (HP-Brazil,ex1) wrote:
> __asm__ __volatile__("fdc (%0)" :: "r" (spot) );
> __asm__ __volatile__("sync" ::);
> __asm__ __volatile__("fic (%0)" :: "r" (spot) );
> (segmentation fault in this line)
> __asm__ __volatile__("sync" ::);
don't do it like this. do it this way:
__asm__ __volatile__("\n\
fdc (%0)\n\
sync\n\
fic (%0)\n\
sync\n"
: : "r" (spot)
);
that ensures that these 4 insns really are together. you might want to
look at the generated assembly output for this function (objdump -dr
foo.o |less) and/or recompile the kernel with PRINT_USER_TRAPS turned
on so you get a register dump so you can debug this yourself.
--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk