Hope there's a kind soul out there willing to point out my mistakes,
or why this has anomalous output.
[cut here]
#include <linux/config.h>
#include <linux/module.h>
#include <asm/system.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/timer.h>
#include <linux/malloc.h>
#ifdef MODULE
int init_module(void)
{
unsigned int cnt3, cnt2, cnt1;
int i;
printk("cc: started... ");
cli();
__asm__(".byte 0x0f,0x31" : "=a" (cnt1), "=d" (cnt3));
/* put code to time here */
for(i=0;i<10;i++);
/* end code to time here */
__asm__(".byte 0x0f,0x31" : "=a" (cnt2), "=d" (cnt3));
sti();
printk(" operation took %d cycles\n", cnt2-cnt1);
return 0;
}
void cleanup_module(void)
{
}
#endif
[cut here]
-- _ ____ Joe Fouche (jf@ugcs.caltech.edu) ___| |--- Deranged College Student