Changeset ed0dd65 in mainline
- Timestamp:
- 2005-04-30T16:47:17Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 30ef8ce
- Parents:
- 10a2e22
- Files:
-
- 2 added
- 11 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/Makefile.inc
r10a2e22 red0dd65 29 29 arch/smp/ap.S \ 30 30 arch/smp/apic.c \ 31 arch/smp/mp.c \ 31 arch/smp/mps.c \ 32 arch/smp/smp.c \ 32 33 arch/smp/atomic.S \ 33 34 arch/smp/ipi.c \ -
arch/ia32/include/acpi/madt.h
r10a2e22 red0dd65 31 31 32 32 #include <arch/acpi/acpi.h> 33 34 /* Multiple APIC Description Table */ 35 struct acpi_madt { 36 struct acpi_sdt_header header; 37 __u32 l_apic_address; 38 __u32 flags; 39 __u8 apic_strucure[]; 40 } __attribute__ ((packed)); 33 #include <arch/smp/apic.h> 41 34 42 35 #define MADT_L_APIC 0 … … 52 45 #define MADT_RESERVED_SKIP_END 127 53 46 #define MADT_RESERVED_OEM_BEGIN 128 54 #define MADT_RESERVED_OEM_END 255 47 48 struct madt_apic_header { 49 __u8 type; 50 __u8 length; 51 } __attribute__ ((packed)); 52 53 54 /* Multiple APIC Description Table */ 55 struct acpi_madt { 56 struct acpi_sdt_header header; 57 __u32 l_apic_address; 58 __u32 flags; 59 struct madt_apic_header apic_header[]; 60 } __attribute__ ((packed)); 55 61 56 62 struct madt_l_apic { 57 __u8 type; 58 __u8 length; 63 struct madt_apic_header header; 59 64 __u8 acpi_id; 60 65 __u8 apic_id; … … 63 68 64 69 struct madt_io_apic { 65 __u8 type; 66 __u8 length; 70 struct madt_apic_header header; 67 71 __u8 io_apic_id; 68 72 __u8 reserved; … … 72 76 73 77 struct madt_intr_src_ovrd { 74 __u8 type; 75 __u8 length; 78 struct madt_apic_header header; 76 79 __u8 bus; 77 80 __u8 source; … … 81 84 82 85 struct madt_nmi_src { 83 __u8 type; 84 __u8 length; 86 struct madt_apic_header header; 85 87 __u16 flags; 86 88 __u32 global_intr; … … 88 90 89 91 struct madt_l_apic_nmi { 90 __u8 type; 91 __u8 length; 92 struct madt_apic_header header; 92 93 __u8 acpi_id; 93 94 __u16 flags; … … 96 97 97 98 struct madt_l_apic_addr_ovrd { 98 __u8 type; 99 __u8 length; 99 struct madt_apic_header header; 100 100 __u16 reserved; 101 101 __u64 l_apic_address; … … 103 103 104 104 struct madt_io_sapic { 105 __u8 type; 106 __u8 length; 105 struct madt_apic_header header; 107 106 __u8 io_apic_id; 108 107 __u8 reserved; … … 112 111 113 112 struct madt_l_sapic { 114 __u8 type; 115 __u8 length; 113 struct madt_apic_header header; 116 114 __u8 acpi_id; 117 115 __u8 sapic_id; … … 124 122 125 123 struct madt_platform_intr_src { 126 __u8 type; 127 __u8 length; 124 struct madt_apic_header header; 128 125 __u16 flags; 129 126 __u8 intr_type; … … 137 134 extern struct acpi_madt *acpi_madt; 138 135 136 extern void acpi_madt_parse(void); 137 139 138 #endif /* __MADT_H__ */ -
arch/ia32/include/smp/mps.h
r10a2e22 red0dd65 27 27 */ 28 28 29 #ifndef __MP _H__30 #define __MP _H__29 #ifndef __MPS_H__ 30 #define __MPS_H__ 31 31 32 32 #include <arch/types.h> … … 38 38 #define CT_EXT_ENTRY_LEN 1 39 39 40 struct __mpfs {40 struct mps_fs { 41 41 __u32 signature; 42 struct __mpct *configuration_table;42 struct mps_ct *configuration_table; 43 43 __u8 length; 44 44 __u8 revision; … … 51 51 } __attribute__ ((packed)); 52 52 53 struct __mpct {53 struct mps_ct { 54 54 __u32 signature; 55 55 __u16 base_table_length; … … 118 118 extern waitq_t kmp_completion_wq; 119 119 120 extern int mp _irq_to_pin(int irq);120 extern int mps_irq_to_pin(int irq); 121 121 122 extern void mp _init(void);122 extern void mps_init(void); 123 123 extern void kmp(void *arg); 124 124 -
arch/ia32/src/acpi/acpi.c
r10a2e22 red0dd65 79 79 void map_sdt(struct acpi_sdt_header *sdt) 80 80 { 81 int i, cnt, length; 82 81 83 map_page_to_frame((__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE, 0); 84 85 length = sdt->length + ((__address) sdt) - ((__address) sdt)&0xfffff000; 86 cnt = length/PAGE_SIZE + (length%PAGE_SIZE>0); 87 88 for (i = 1; i < cnt; i++) 89 map_page_to_frame(((__address) sdt) + i*PAGE_SIZE, ((__address) sdt) + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0); 82 90 } 83 91 -
arch/ia32/src/acpi/madt.c
r10a2e22 red0dd65 27 27 */ 28 28 29 #include <arch/types.h> 29 30 #include <arch/acpi/acpi.h> 30 31 #include <arch/acpi/madt.h> 32 #include <arch/smp/apic.h> 31 33 32 34 struct acpi_madt *acpi_madt = NULL; 35 36 #ifdef __SMP__ 37 38 char *entry[] = { 39 "L_APIC", 40 "IO_APIC", 41 "INTR_SRC_OVRD", 42 "NMI_SRC", 43 "L_APIC_NMI", 44 "L_APIC_ADDR_OVRD", 45 "IO_SAPIC", 46 "L_SAPIC", 47 "PLATFORM_INTR_SRC" 48 }; 49 50 void acpi_madt_parse(void) 51 { 52 struct madt_apic_header *end = (struct madt_apic_header *) (((__u8 *) acpi_madt) + acpi_madt->header.length); 53 struct madt_apic_header *h = &acpi_madt->apic_header[0]; 54 55 l_apic = (__u32 *) acpi_madt->l_apic_address; 56 57 while (h < end) { 58 switch (h->type) { 59 case MADT_L_APIC: 60 case MADT_IO_APIC: 61 case MADT_INTR_SRC_OVRD: 62 case MADT_NMI_SRC: 63 case MADT_L_APIC_NMI: 64 case MADT_L_APIC_ADDR_OVRD: 65 case MADT_IO_SAPIC: 66 case MADT_L_SAPIC: 67 case MADT_PLATFORM_INTR_SRC: 68 printf("MADT: skipping %s entry (type=%d)\n", entry[h->type], h->type); 69 break; 70 71 default: 72 if (h->type >= MADT_RESERVED_SKIP_BEGIN && h->type <= MADT_RESERVED_SKIP_END) { 73 printf("MADT: skipping reserved entry (type=%d)\n", h->type); 74 } 75 if (h->type >= MADT_RESERVED_OEM_BEGIN) { 76 printf("MADT: skipping OEM entry (type=%d)\n", h->type); 77 } 78 break; 79 } 80 h = (struct madt_apic_header *) (((__u8 *) h) + h->length); 81 } 82 83 } 84 85 #endif /* __SMP__ */ -
arch/ia32/src/ia32.c
r10a2e22 red0dd65 94 94 #ifdef __SMP__ 95 95 acpi_init(); 96 mp_init();97 96 #endif /* __SMP__ */ 98 97 } -
arch/ia32/src/mm/page.c
r10a2e22 red0dd65 128 128 pd[pde].frame_address = newpt >> 12; 129 129 } 130 130 131 pt = (struct page_specifier *) (pd[pde].frame_address << 12); 131 132 -
arch/ia32/src/smp/apic.c
r10a2e22 red0dd65 30 30 #include <arch/smp/apic.h> 31 31 #include <arch/smp/ap.h> 32 #include <arch/smp/mp .h>32 #include <arch/smp/mps.h> 33 33 #include <mm/page.h> 34 34 #include <time/delay.h> … … 44 44 * Advanced Programmable Interrupt Controller for MP systems. 45 45 * Tested on: 46 * Bochs 2.0.2 with 2-8 CPUs46 * Bochs 2.0.2 - Bochs 2.2-cvs with 2-8 CPUs 47 47 * ASUS P/I-P65UP5 + ASUS C-P55T2D REV. 1.41 with 2x 200Mhz Pentium CPUs 48 48 */ … … 83 83 int pin; 84 84 85 if ((pin = mp _irq_to_pin(i)) != -1)85 if ((pin = mps_irq_to_pin(i)) != -1) 86 86 io_apic_change_ioredtbl(pin,0xf,IVT_IRQBASE+i,LOPRI); 87 87 } … … 380 380 * mapping for the respective IRQ number. 381 381 */ 382 pin = mp _irq_to_pin(i);382 pin = mps_irq_to_pin(i); 383 383 if (pin != -1) { 384 384 reglo = io_apic_read(IOREDTBL + pin*2); … … 402 402 * mapping for the respective IRQ number. 403 403 */ 404 pin = mp _irq_to_pin(i);404 pin = mps_irq_to_pin(i); 405 405 if (pin != -1) { 406 406 reglo = io_apic_read(IOREDTBL + pin*2); -
arch/ia32/src/smp/mps.c
r10a2e22 red0dd65 1 1 /* 2 * Copyright (C) 2001-200 4Jakub Jermar2 * Copyright (C) 2001-2005 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 33 33 #include <print.h> 34 34 #include <panic.h> 35 #include <arch/smp/mp .h>35 #include <arch/smp/mps.h> 36 36 #include <arch/smp/ap.h> 37 37 #include <arch/smp/apic.h> … … 51 51 52 52 /* 53 * Multi -Processor Specification detection code.53 * MultiProcessor Specification detection code. 54 54 */ 55 55 … … 57 57 #define CT_SIGNATURE 0x504d4350 58 58 59 int mp _fs_check(__u8 *base);60 int mp _ct_check(void);59 int mps_fs_check(__u8 *base); 60 int mps_ct_check(void); 61 61 62 62 int configure_via_ct(void); … … 71 71 void ct_extended_entries(void); 72 72 73 static struct __mpfs *fs;74 static struct __mpct *ct;73 static struct mps_fs *fs; 74 static struct mps_ct *ct; 75 75 76 76 struct __processor_entry *processor_entries = NULL; … … 92 92 * Used to check the integrity of the MP Floating Structure. 93 93 */ 94 int mp _fs_check(__u8 *base)94 int mps_fs_check(__u8 *base) 95 95 { 96 96 int i; … … 106 106 * Used to check the integrity of the MP Configuration Table. 107 107 */ 108 int mp _ct_check(void)108 int mps_ct_check(void) 109 109 { 110 110 __u8 *base = (__u8 *) ct; … … 127 127 } 128 128 129 void mp _init(void)129 void mps_init(void) 130 130 { 131 131 __u8 *addr[2] = { NULL, (__u8 *) 0xf0000 }; … … 143 143 for (i = 0; i < 2; i++) { 144 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];145 if (*((__u32 *) &addr[i][j]) == FS_SIGNATURE && mps_fs_check(&addr[i][j])) { 146 fs = (struct mps_fs *) &addr[i][j]; 147 147 goto fs_found; 148 148 } … … 153 153 154 154 fs_found: 155 printf("%L: MP Floating Pointer Structure\n", fs);155 printf("%L: MPS Floating Pointer Structure\n", fs); 156 156 157 157 frame_not_free((__address) fs); … … 159 159 if (fs->config_type == 0 && fs->configuration_table) { 160 160 if (fs->mpfib2 >> 7) { 161 printf("mp _init: PIC mode not supported\n");161 printf("mps_init: PIC mode not supported\n"); 162 162 return; 163 163 } … … 192 192 return 1; 193 193 } 194 if (!mp _ct_check()) {194 if (!mps_ct_check()) { 195 195 printf("configure_via_ct: bad ct checksum\n"); 196 196 return 1; … … 288 288 void ct_bus_entry(struct __bus_entry *bus) 289 289 { 290 #ifdef MP CT_VERBOSE290 #ifdef MPSCT_VERBOSE 291 291 char buf[7]; 292 292 memcopy((__address) bus->bus_type, (__address) buf,6); … … 316 316 } 317 317 318 //#define MP CT_VERBOSE318 //#define MPSCT_VERBOSE 319 319 void ct_io_intr_entry(struct __io_intr_entry *iointr) 320 320 { 321 #ifdef MP CT_VERBOSE321 #ifdef MPSCT_VERBOSE 322 322 switch (iointr->intr_type) { 323 323 case 0: printf("INT"); break; … … 350 350 void ct_l_intr_entry(struct __l_intr_entry *lintr) 351 351 { 352 #ifdef MP CT_VERBOSE352 #ifdef MPSCT_VERBOSE 353 353 switch (lintr->intr_type) { 354 354 case 0: printf("INT"); break; … … 496 496 } 497 497 498 int mp _irq_to_pin(int irq)498 int mps_irq_to_pin(int irq) 499 499 { 500 500 int i; -
src/Makefile
r10a2e22 red0dd65 30 30 ifdef DEBUG_SPINLOCK 31 31 CFLAGS+=-D$(DEBUG_SPINLOCK) 32 endif 33 34 ifdef USERSPACE 35 CFLAGS+=-D$(USERSPACE) 32 36 endif 33 37 -
src/Makefile.config
r10a2e22 red0dd65 14 14 DEBUG_SPINLOCK=DEBUG_SPINLOCK 15 15 16 # Uncomment if you want to compile in userspace support 17 #USERSPACE=__USERSPACE__ 18 16 19 # Uncomment if you want to run in the test mode 17 TEST=__TEST__20 #TEST=__TEST__ 18 21 19 22 TEST_FILE=test.c -
src/main/kinit.c
r10a2e22 red0dd65 43 43 44 44 #ifdef __SMP__ 45 #include <arch/smp/mp .h>45 #include <arch/smp/mps.h> 46 46 #endif /* __SMP__ */ 47 47 … … 115 115 cpu_priority_low(); 116 116 117 #ifdef __USERSPACE__ 117 118 /* 118 119 * Create the first user task. … … 139 140 140 141 thread_ready(t); 142 #endif /* __USERSPACE__ */ 141 143 142 144 #ifdef __TEST__ -
src/main/main.c
r10a2e22 red0dd65 42 42 #ifdef __SMP__ 43 43 #include <arch/smp/apic.h> 44 #include <arch/smp/mp .h>44 #include <arch/smp/mps.h> 45 45 #endif /* __SMP__ */ 46 47 #include <smp/smp.h> 46 48 47 49 #include <mm/frame.h> … … 118 120 arch_late_init(); 119 121 122 smp_init(); 120 123 printf("config.cpu_count=%d\n", config.cpu_count); 121 124
Note:
See TracChangeset
for help on using the changeset viewer.