]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/dde/fbsd/examples/l4ata/uxbench/patches/rdtsc_rdpmc_FreeBSD54.patch
Inital import
[l4.git] / l4 / pkg / dde / fbsd / examples / l4ata / uxbench / patches / rdtsc_rdpmc_FreeBSD54.patch
1 --- i386/i386/initcpu.c 2003-11-10 16:48:30.000000000 +0100
2 +++ /home/yaron/diplom/bsdpatch/initcpu.c       2005-11-22 13:36:01.000000000 +0100
3 @@ -581,7 +581,26 @@
4                                 init_mendocino();
5                                 break;
6                         }
7 +                       switch (cpu_id & 0xf00) {
8 +                       case 0x600:
9 +                               // allow rdpmc from userland
10 +                               load_cr4(rcr4() | CR4_PCE);
11 +                               // CPU load for P6
12 +                               wrmsr(0x186, 0x430079);
13 +                               break;
14 +                       case 0xF00:
15 +                               // allow rdpmc from userland
16 +                               load_cr4(rcr4() | CR4_PCE);
17 +                               // CPU load for P4
18 +                               wrmsr(0x3a2, 0x2600020c);
19 +                               wrmsr(0x360, 0x3d000);
20 +                               break;
21 +                       }
22                 } else if (strcmp(cpu_vendor, "AuthenticAMD") == 0) {
23 +                       // allow rdpmc from userland
24 +                       load_cr4(rcr4() | CR4_PCE);
25 +                       // CPU load for K7
26 +                       wrmsr(0xC0010000, 0x430076);
27  #if defined(I686_CPU) && defined(CPU_ATHLON_SSE_HACK)
28                         /*
29                          * Sometimes the BIOS doesn't enable SSE instructions.