Changeset 8262010 in mainline
- Timestamp:
- 2005-04-10T16:36:45Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 23c0c08
- Parents:
- 43114c5
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/Makefile.inc
r43114c5 r8262010 14 14 15 15 CPPFLAGS=$(DEFS) -nostdinc -I../include 16 CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fomit-frame-pointer -Wmissing-prototypes -Werror -O 316 CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fomit-frame-pointer -Wmissing-prototypes -Werror -O1 17 17 LFLAGS=-M -no-check-sections -T ../arch/ia32/_link.ld 18 18 -
arch/ia32/_link.ld
r43114c5 r8262010 14 14 ktext_start = .; 15 15 *(K_TEXT_START); 16 delta_start = .; 17 *(K_DATA_START); 18 delta_end = .; 16 19 *(.text); 17 20 ktext_end = .; 18 21 19 22 kdata_start = .; 20 *(K_DATA_START);21 23 *(.data); /* initialized data */ 22 24 *(.rodata*); /* string literals */ … … 29 31 . = ABSOLUTE(hardcoded_ktext_size); 30 32 .patch_1 : { 31 LONG(ktext_end - ktext_start );33 LONG(ktext_end - ktext_start - (delta_end - delta_start)); 32 34 } 33 35 34 36 . = ABSOLUTE(hardcoded_kdata_size); 35 37 .patch_2 : { 36 LONG(kdata_end - kdata_start );38 LONG(kdata_end - kdata_start + (delta_end - delta_start)); 37 39 } 38 40 -
arch/ia32/boot/boot.ld
r43114c5 r8262010 1 OUTPUT_FORMAT(binary) 2 ENTRY(main) 1 3 SECTIONS { 2 4 .text 0x7c00 : AT (0x0) { *(.text) } -
arch/ia32/include/cpu.h
r43114c5 r8262010 30 30 #define __ia32_CPU_H__ 31 31 32 #include <config.h> 32 33 #include <typedefs.h> 33 34 #include <arch/pm.h> 35 36 #ifdef __SMP__ 37 #define CPU_ID_ARCH (config.cpu_count>1?l_apic_id():0) 38 #else 39 #define CPU_ID_ARCH (0) 40 #endif 34 41 35 42 struct cpu_arch { -
arch/ia32/include/smp/apic.h
r43114c5 r8262010 96 96 #define L_APIC_ID (0x020/sizeof(__u32)) 97 97 #define L_APIC_IDClear (~(0xf<<24)) 98 #define L_APIC_IDShift 24 99 #define L_APIC_IDMask 0xf 98 100 99 101 /* IO APIC */ … … 121 123 extern void l_apic_debug(void); 122 124 extern void l_apic_timer_interrupt(__u8 n, __u32 stack[]); 125 extern __u8 l_apic_id(void); 123 126 124 127 extern __u32 io_apic_read(__u8 address); -
arch/ia32/src/cpu/cpu.c
r43114c5 r8262010 35 35 #include <print.h> 36 36 #include <typedefs.h> 37 38 #include <arch/smp/apic.h> 37 39 38 40 /* -
arch/ia32/src/pm.c
r43114c5 r8262010 67 67 68 68 /* gdtr changes everytime new CPU is initialized */ 69 struct ptr_16_32 gdtr = { .limit = sizeof(gdt), .base = (__address) gdt };69 struct ptr_16_32 gdtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(gdt), .base = (__address) gdt }; 70 70 struct ptr_16_32 idtr = { .limit = sizeof(idt), .base = (__address) idt }; 71 71 -
arch/ia32/src/smp/apic.c
r43114c5 r8262010 27 27 */ 28 28 29 #ifdef __SMP__30 31 29 #include <arch/types.h> 32 30 #include <arch/smp/apic.h> … … 39 37 #include <arch/asm.h> 40 38 #include <arch.h> 39 40 #ifdef __SMP__ 41 41 42 42 /* … … 222 222 { 223 223 __u32 tmp, t1, t2; 224 224 int cpu_id = config.cpu_active - 1; 225 226 227 /* 228 * Here we set local APIC ID's so that they match operating system's CPU ID's 229 * This operation is dangerous as it is model specific. 230 * TODO: some care should be taken. 231 * NOTE: CPU may not be used to define APIC ID 232 */ 233 if (l_apic_id() != cpu_id) { 234 l_apic[L_APIC_ID] &= L_APIC_IDClear; 235 l_apic[L_APIC_ID] |= (l_apic[L_APIC_ID]&L_APIC_IDClear)|((cpu_id)<<L_APIC_IDShift); 236 } 225 237 226 238 l_apic[LVT_Err] |= (1<<16); … … 271 283 int i, lint; 272 284 273 printf("LVT on cpu%d, LAPIC ID: %d\n", CPU->id, (l_apic[L_APIC_ID] >> 24)&0xf);285 printf("LVT on cpu%d, LAPIC ID: %d\n", CPU->id, l_apic_id()); 274 286 275 287 printf("LVT_Tm: "); … … 305 317 * This register is supported only on P6 and higher. 306 318 */ 307 if (CPU-> family > 5) {319 if (CPU->arch.family > 5) { 308 320 printf("LVT_PCINT: "); 309 321 if (l_apic[LVT_PCINT] & (1<<16)) printf("masked"); else printf("not masked"); putchar(','); … … 324 336 l_apic_eoi(); 325 337 clock(); 338 } 339 340 __u8 l_apic_id(void) 341 { 342 return (l_apic[L_APIC_ID] >> L_APIC_IDShift)&L_APIC_IDMask; 326 343 } 327 344 -
arch/mips/include/cpu.h
r43114c5 r8262010 32 32 #include <typedefs.h> 33 33 34 #define CPU_ID_ARCH 0 35 34 36 struct cpu_arch { 35 37 int imp_num; -
include/arch.h
r43114c5 r8262010 34 34 35 35 #include <cpu.h> 36 #include <arch/cpu.h> 36 37 37 #define CPU (the->cpu) 38 #define THREAD (the->thread) 39 #define TASK (the->task) 40 41 extern cpu_private_page_t *the; 38 #define CPU (cpu_private_data[CPU_ID_ARCH].cpu) 39 #define THREAD (cpu_private_data[CPU_ID_ARCH].thread) 40 #define TASK (cpu_private_data[CPU_ID_ARCH].task) 42 41 43 42 extern void arch_init(void); -
include/cpu.h
r43114c5 r8262010 69 69 }; 70 70 71 struct cpu_private_page { 71 /* 72 * read/write by associated CPU 73 * read only by other CPUs 74 */ 75 struct cpu_private_data { 72 76 cpu_t *cpu; 73 77 thread_t *thread; … … 75 79 }; 76 80 81 extern cpu_private_data_t *cpu_private_data; 77 82 extern cpu_t *cpus; 78 83 -
include/typedefs.h
r43114c5 r8262010 31 31 32 32 typedef struct config config_t; 33 typedef struct cpu_private_ page cpu_private_page_t;33 typedef struct cpu_private_data cpu_private_data_t; 34 34 typedef struct cpu_info cpu_info_t; 35 35 -
src/Makefile.config
r43114c5 r8262010 12 12 13 13 # Deadlock detection support for spinlocks. 14 DEBUG_SPINLOCK=DEBUG_SPINLOCK14 #DEBUG_SPINLOCK=DEBUG_SPINLOCK 15 15 16 16 # Uncomment if you want to run in the test mode -
src/cpu/cpu.c
r43114c5 r8262010 40 40 #include <list.h> 41 41 42 cpu_private_page_t *the = NULL; 43 42 cpu_private_data_t *cpu_private_data; 44 43 cpu_t *cpus; 45 44 … … 50 49 if (config.cpu_active == 1) { 51 50 #endif /* __SMP__ */ 51 cpu_private_data = (cpu_private_data_t *) malloc(sizeof(cpu_private_data_t) * config.cpu_count); 52 if (!cpu_private_data) 53 panic("malloc/cpu_private_data"); 54 52 55 cpus = (cpu_t *) malloc(sizeof(cpu_t) * config.cpu_count); 53 56 if (!cpus) … … 55 58 56 59 /* initialize everything */ 60 memsetb((__address) cpu_private_data, sizeof(cpu_private_data_t) * config.cpu_count, 0); 57 61 memsetb((__address) cpus, sizeof(cpu_t) * config.cpu_count, 0); 58 62 … … 71 75 list_initialize(&cpus[i].rq[j].rq_head); 72 76 } 77 78 cpu_private_data[i].cpu = &cpus[i]; 73 79 } 74 80 75 the = (cpu_private_page_t *) frame_alloc(FRAME_KA | FRAME_PANIC);76 memsetb((__address) the, PAGE_SIZE, 0);77 81 #ifdef __SMP__ 78 }79 else {80 __address frame;81 82 frame = frame_alloc(FRAME_KA | FRAME_PANIC);83 memsetb(frame, PAGE_SIZE, 0);84 map_page_to_frame((__address) the, frame, PAGE_CACHEABLE, 1);85 82 } 86 83 #endif /* __SMP__ */ 87 84 88 CPU = &cpus[config.cpu_active-1];89 85 cpu_identify(); 90 86 cpu_arch_init(); -
src/main/main.c
r43114c5 r8262010 104 104 arch_init(); 105 105 106 106 107 printf("%s, %s\n", project, copyright); 107 108 -
src/proc/thread.c
r43114c5 r8262010 100 100 i = (t->pri < RQ_COUNT -1) ? ++t->pri : t->pri; 101 101 102 cpu = the->cpu;102 cpu = CPU; 103 103 if (t->flags & X_WIRED) { 104 104 cpu = t->cpu;
Note:
See TracChangeset
for help on using the changeset viewer.