Re: Disabling x86 System Management Mode

From: John Sigler
Date: Tue Apr 17 2007 - 13:01:59 EST


John Sigler wrote:

static int hello_init(void)
{
int i;
int *lat;
printk(KERN_ALERT "INIT\n");
lat = kmalloc(MAX * sizeof *lat, GFP_KERNEL);
if (lat == NULL) return -1;
for (i=0; i < MAX; ++i) lat[i] = 0;
for (i=0; i < 5; ++i) foo();
for (i=0; i < N; ++i)
{
unsigned count, res;
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(1);
foo();
local_irq_disable();
count = foo();
local_irq_enable();
res = count >> 8;
if (res < MAX) ++lat[res]; else printk(KERN_ALERT "OUT OF RANGE\n");
}

for (i=0; i < MAX; ++i)
if (lat[i] != 0) printk(KERN_ALERT "%d %d\n", i<<8, lat[i]);

kfree(lat);

return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/