4 FIXME : backup stack in CACHE_AS_RAM into mmx and sse and after we get STACK up, we restore that.
5 It is only needed if we want to go back
8 /* We don't need cache as ram for now on */
11 "orl $(0x1<<30),%eax\n\t"
15 "movl $0x269, %ecx\n\t" /* fix4k_c8000*/
19 #if DCACHE_RAM_SIZE > 0x8000
20 "movl $0x268, %ecx\n\t" /* fix4k_c0000*/
24 /* disable fixed mtrr from now on, it will be enabled by linuxbios_ram again*/
25 "movl $0xC0010010, %ecx\n\t"
26 // "movl $SYSCFG_MSR, %ecx\n\t"
28 "andl $(~(3<<18)), %eax\n\t"
29 // "andl $(~(SYSCFG_MSR_MtrrFixDramModEn | SYSCFG_MSR_MtrrFixDramEn)), %eax\n\t"
32 /* Set the default memory type and disable fixed and enable variable MTRRs */
33 "movl $0x2ff, %ecx\n\t"
34 // "movl $MTRRdefType_MSR, %ecx\n\t"
36 /* Enable Variable and Disable Fixed MTRRs */
37 "movl $0x00000800, %eax\n\t"
40 #if defined(CLEAR_FIRST_1M_RAM)
41 /* enable caching for first 1M using variable mtrr */
42 "movl $0x200, %ecx\n\t"
44 "movl $(0 | 1), %eax\n\t"
45 // "movl $(0 | MTRR_TYPE_WRCOMB), %eax\n\t"
48 "movl $0x201, %ecx\n\t"
49 "movl $0x0000000f, %edx\n\t"
50 "movl $((~(( 0 + 0x100000) - 1)) | 0x800), %eax\n\t"
56 "andl $0x9fffffff,%eax\n\t"
58 #if defined(CLEAR_FIRST_1M_RAM)
59 /* clear the first 1M */
62 "movl $(0x100000>>2), %ecx\n\t"
68 "orl $(0x1<<30),%eax\n\t"
71 /* enable caching for first 1M using variable mtrr */
72 "movl $0x200, %ecx\n\t"
74 "movl $(0 | 6), %eax\n\t"
75 // "movl $(0 | MTRR_TYPE_WRBACK), %eax\n\t"
78 "movl $0x201, %ecx\n\t"
79 "movl $0x0000000f, %edx\n\t"
80 "movl $((~(( 0 + 0x100000) - 1)) | 0x800), %eax\n\t"
85 "andl $0x9fffffff,%eax\n\t"
90 FIXME: I hope we don't need to change esp and ebp value here, so we can restore value from mmx sse back
91 But the problem is the range is some io related, So don't go back