- disabled rombios32 call until the critical bugs are fixed
[gplbios.git] / rombios32start.S
bloba2f2a6c48a25f224e1497cf2b696ab7aa7274f43
1 .globl _start
2 .globl smp_ap_boot_code_start
3 .globl smp_ap_boot_code_end
4 .global smm_relocation_start
5 .global smm_relocation_end
6 .global smm_code_start
7 .global smm_code_end
9 #define PM_IO_BASE        0xb000
11 _start:
12   /* clear bss section */
13   xor %eax, %eax
14   mov $__bss_start, %edi
15   mov $_end, %ecx
16   sub %edi, %ecx
17   rep stosb
19   jmp rombios32_init
21 #define CPU_COUNT 0xf000
23   .code16                        
24 smp_ap_boot_code_start:
25   xor %ax, %ax
26   mov %ax, %ds
27   incw CPU_COUNT
29   hlt
30   jmp 1b
31 smp_ap_boot_code_end:
33 /* code to relocate SMBASE to 0xa0000 */
34 smm_relocation_start:
35   mov $0x38000 + 0x7efc, %ebx
36   mov (%ebx), %al  /* revision ID to see if x86_64 or x86 */
37   cmp $0x64, %al
38   je 1f
39   mov $0x38000 + 0x7ef8, %ebx
40   jmp 2f
42   mov $0x38000 + 0x7f00, %ebx
44   movl $0xa0000, %eax
45   movl %eax, (%ebx)
46   rsm                
47 smm_relocation_end:
48         
49 /* minimal SMM code to enable or disable ACPI */
50 smm_code_start:
51   movw $0xb2, %dx
52   inb %dx, %al
53   cmp $0xf0, %al
54   jne 1f
56   /* ACPI disable */
57   mov $PM_IO_BASE + 0x04, %dx /* PMCNTRL */
58   inw %dx, %ax
59   andw $~1, %ax
60   outw %ax, %dx
62   jmp 2f
65   cmp $0xf1, %al
66   jne 2f
68   /* ACPI enable */
69   mov $PM_IO_BASE + 0x04, %dx /* PMCNTRL */
70   inw %dx, %ax
71   orw $1, %ax
72   outw %ax, %dx
73   
75   rsm
76 smm_code_end: