Implementing SSE2 Extenstions in Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





I'm trying to enable the SSE2 extensions in Mandrake Linux 8.1.  I thought
since the only way to do this is in ring 0 to write a module for it, and
here's my code below... I'm trying to run it on an AMD k7 wihich doesn't
have SSE2 support to test it before I bring it to aproduction pentium
server, but it only crashes my machine when I try to write cr0 back..
any ideas?  is there some code that enables sse2 already?

Here's my code:
#define MODULE
#include <linux/module.h>

int init_module(void){
__asm__ __volatile__ ("movl %%cr0, %%eax" : "=a"(cr0));
__asm__ __volatile__("andl $0xFFFB, %eAX");
__asm__ __volatile__ ("movl %eax, %cr0");

__asm__ __volatile__ ("movl %%cr4, %%eax" : "=a"(cr0));
__asm__ __volatile__("andl $0x0600, %eAX");
__asm__ __volatile__ ("movl %eax, %cr4");
return 0;
}
void cleanup_module(void) {printk("<1>goodbye"); }

Thanks, any help would be appreciated.

David







----
David Yang
UIUC Electrical Engineering 2004
http://www.ews.uiuc.edu/~dgyang
dgyang@uiuc.edu


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux