2 /* be warned, this file will be used other cores and core0/node0 */
5 FIXME : backup stack in CACHE_AS_RAM into mmx and sse and after we get STACK up, we restore that.
6 It is only needed if we want to go back
9 /* We don't need cache as ram for now on */
12 "orl $(0x1<<30),%eax\n\t"
16 "movl $0x269, %ecx\n\t" /* fix4k_c8000*/
20 #if DCACHE_RAM_SIZE > 0x8000
21 "movl $0x268, %ecx\n\t" /* fix4k_c0000*/
25 /* disable fixed mtrr from now on, it will be enabled by linuxbios_ram again*/
26 "movl $0xC0010010, %ecx\n\t"
27 // "movl $SYSCFG_MSR, %ecx\n\t"
29 "andl $(~(3<<18)), %eax\n\t"
30 // "andl $(~(SYSCFG_MSR_MtrrFixDramModEn | SYSCFG_MSR_MtrrFixDramEn)), %eax\n\t"
33 /* Set the default memory type and disable fixed and enable variable MTRRs */
34 "movl $0x2ff, %ecx\n\t"
35 // "movl $MTRRdefType_MSR, %ecx\n\t"
37 /* Enable Variable and Disable Fixed MTRRs */
38 "movl $0x00000800, %eax\n\t"
41 #if defined(CLEAR_FIRST_1M_RAM)
42 /* enable caching for first 1M using variable mtrr */
43 "movl $0x200, %ecx\n\t"
45 "movl $(0 | 1), %eax\n\t"
46 // "movl $(0 | MTRR_TYPE_WRCOMB), %eax\n\t"
49 "movl $0x201, %ecx\n\t"
50 "movl $0x0000000f, %edx\n\t"
51 "movl $((~(( 0 + 0x100000) - 1)) | 0x800), %eax\n\t"
57 "andl $0x9fffffff,%eax\n\t"
59 #if defined(CLEAR_FIRST_1M_RAM)
60 /* clear the first 1M */
63 "movl $(0x100000>>2), %ecx\n\t"
69 "orl $(0x1<<30),%eax\n\t"
72 /* enable caching for first 1M using variable mtrr */
73 "movl $0x200, %ecx\n\t"
75 "movl $(0 | 6), %eax\n\t"
76 // "movl $(0 | MTRR_TYPE_WRBACK), %eax\n\t"
79 "movl $0x201, %ecx\n\t"
80 "movl $0x0000000f, %edx\n\t"
81 "movl $((~(( 0 + 0x100000) - 1)) | 0x800), %eax\n\t"
86 "andl $0x9fffffff,%eax\n\t"
91 FIXME: I hope we don't need to change esp and ebp value here, so we can restore value from mmx sse back
92 But the problem is the range is some io related, So don't go back