Changeset babcb148 in mainline
- 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
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/include/acpi/acpi.h
r434f700 rbabcb148 74 74 extern void acpi_init(void); 75 75 76 static int rsdp_check(__u8 *rsdp); 77 76 78 #endif /* __ACPI_H__ */ -
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) { -
arch/mips/src/mips.c
r434f700 rbabcb148 54 54 { 55 55 } 56 57 void arch_late_init(void) 58 { 59 } -
include/arch.h
r434f700 rbabcb148 42 42 extern void arch_pre_mm_init(void); 43 43 extern void arch_post_mm_init(void); 44 extern void arch_late_init(void); 44 45 extern void calibrate_delay_loop(void); 45 46 -
include/func.h
r434f700 rbabcb148 38 38 extern int strcmp(char *src, char *dst); 39 39 40 extern __address __u32_search(__address src, int cnt, __u32 x);41 42 40 #endif -
src/lib/func.c
r434f700 rbabcb148 60 60 return 1; 61 61 } 62 63 __address __u32_search(__address src, int cnt, __u32 x)64 {65 __u32 *base = (__u32 *) src;66 int i;67 68 for (i=0; i<=cnt-sizeof(__u32); i++)69 if (base[i] == x)70 return (__address) &base[i];71 72 return 0;73 } -
src/main/kinit.c
r434f700 rbabcb148 86 86 * Now that all CPUs are up, we can report what we've found. 87 87 */ 88 for (i = 0; i < config.cpu_count; i++) 88 for (i = 0; i < config.cpu_count; i++) { 89 89 if (cpus[i].active) 90 90 cpu_print_report(&cpus[i]); 91 else 92 printf("cpu%d: not active\n", i); 93 } 91 94 92 95 #ifdef __SMP__ -
src/main/main.c
r434f700 rbabcb148 116 116 config.base, hardcoded_ktext_size/1024, hardcoded_kdata_size/1024); 117 117 118 #ifdef __SMP__ 119 mp_init(); /* Multiprocessor */ 120 #endif /* __SMP__ */ 118 arch_late_init(); 121 119 122 120 printf("config.cpu_count=%d\n", config.cpu_count); -
src/mm/tlb.c
r434f700 rbabcb148 55 55 56 56 busy_wait: 57 for (i = 0; i<config.cpu_ active; i++)57 for (i = 0; i<config.cpu_count; i++) 58 58 if (cpus[i].tlb_active) 59 59 goto busy_wait;
Note:
See TracChangeset
for help on using the changeset viewer.