Changeset babcb148 in mainline for arch/ia32/src
- Timestamp:
- 2005-04-27T21:19:42Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 10a2e22
- Parents:
- 434f700
- Location:
- arch/ia32/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/acpi/acpi.c
r434f700 rbabcb148 28 28 29 29 #include <arch/acpi/acpi.h> 30 #include <arch/bios/bios.h> 31 32 #define RSDP_SIGNATURE "RSD PTR " 33 #define RSDP_REVISION_OFFS 15 30 34 31 35 struct acpi_rsdp *acpi_rsdp = NULL; 32 36 37 int rsdp_check(__u8 *rsdp) { 38 struct acpi_rsdp *r = (struct acpi_rsdp *) rsdp; 39 __u8 sum = 0; 40 int i; 41 42 for (i=0; i<20; i++) 43 sum += rsdp[i]; 44 45 if (sum) 46 return 0; /* bad checksum */ 47 48 if (r->revision == 0) 49 return 1; /* ACPI 1.0 */ 50 51 for (; i<r->length; i++) 52 sum += rsdp[i]; 53 54 return !sum; 55 56 } 57 33 58 void acpi_init(void) 34 59 { 60 __u8 *addr[2] = { NULL, (__u8 *) 0xe0000 }; 61 int i, j, length[2] = { 1024, 128*1024 }; 62 __u64 *sig = (__u64 *) RSDP_SIGNATURE; 63 64 /* 65 * Find Root System Description Pointer 66 * 1. search first 1K of EBDA 67 * 2. search 128K starting at 0xe0000 68 */ 69 70 addr[0] = (__u8 *) ebda; 71 for (i = (ebda ? 0 : 1); i < 2; i++) { 72 for (j = 0; j < length[i]; j += 16) { 73 if (*((__u64 *) &addr[i][j]) == *sig && rsdp_check(&addr[i][j])) { 74 acpi_rsdp = (struct acpi_rsdp *) &addr[i][j]; 75 goto rsdp_found; 76 } 77 } 78 } 79 80 return; 81 82 rsdp_found: 83 printf("%L: ACPI Root System Description Pointer\n", acpi_rsdp); 35 84 } -
arch/ia32/src/ia32.c
r434f700 rbabcb148 86 86 if (config.cpu_active == 1) { 87 87 ega_init(); /* video */ 88 } 89 } 90 91 void arch_late_init() 92 { 93 if (config.cpu_active == 1) { 94 #ifdef __SMP__ 88 95 acpi_init(); 96 mp_init(); 97 #endif /* __SMP__ */ 89 98 } 90 99 } -
arch/ia32/src/smp/mp.c
r434f700 rbabcb148 129 129 void mp_init(void) 130 130 { 131 __address addr, frame; 132 int cnt, n; 133 134 135 /* 136 * EBDA can be undefined. In that case addr would be 0. 137 */ 138 addr = ebda; 139 if (addr) { 140 cnt = 1024; 141 while (addr = __u32_search(addr,cnt,FS_SIGNATURE)) { 142 if (mp_fs_check((__u8 *) addr)) 131 __u8 *addr[2] = { NULL, (__u8 *) 0xf0000 }; 132 int i, j, length[2] = { 1024, 64*1024 }; 133 134 135 /* 136 * Find MP Floating Pointer Structure 137 * 1a. search first 1K of EBDA 138 * 1b. if EBDA is undefined, search last 1K of base memory 139 * 2. search 64K starting at 0xf0000 140 */ 141 142 addr[0] = (__u8 *) (ebda ? ebda : 639 * 1024); 143 for (i = 0; i < 2; i++) { 144 for (j = 0; j < length[i]; j += 16) { 145 if (*((__u32 *) &addr[i][j]) == FS_SIGNATURE && mp_fs_check(&addr[i][j])) { 146 fs = (struct __mpfs *) &addr[i][j]; 143 147 goto fs_found; 144 addr++; 145 cnt--; 146 } 147 } 148 else { 149 /* 150 * Second place where the MP Floating Pointer Structure may live is the last 151 * kilobyte of base memory. 152 */ 153 addr = 639*1024; 154 cnt = 1024; 155 while (addr = __u32_search(addr,cnt,FS_SIGNATURE)) { 156 if (mp_fs_check((__u8 *) addr)) 157 goto fs_found; 158 addr++; 159 cnt--; 160 } 161 } 162 163 /* 164 * As the last resort, MP Floating Pointer Structure is searched in the BIOS 165 * ROM. 166 */ 167 addr = 0xf0000; 168 cnt = 64*1024; 169 while (addr = __u32_search(addr,cnt,FS_SIGNATURE)) { 170 if (mp_fs_check((__u8 *) addr)) 171 goto fs_found; 172 addr++; 173 cnt--; 148 } 149 } 174 150 } 175 151 … … 177 153 178 154 fs_found: 179 printf("%L: MP Floating Pointer Structure\n", addr); 180 181 fs = (struct __mpfs *) addr; 155 printf("%L: MP Floating Pointer Structure\n", fs); 156 182 157 frame_not_free((__address) fs); 183 158 184 159 if (fs->config_type == 0 && fs->configuration_table) { 185 160 if (fs->mpfib2 >> 7) {
Note:
See TracChangeset
for help on using the changeset viewer.