lkml.org 
[lkml]   [2007]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Disabling x86 System Management Mode
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-17 19:05    [W:0.483 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site