- Timestamp:
- 2010-01-06T20:56:04Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fccc236
- Parents:
- 002252a (diff), eca2435 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel
- Files:
-
- 2 added
- 15 edited
-
Makefile (modified) (1 diff)
-
Makefile.build (modified) (5 diffs)
-
Makefile.common (modified) (1 diff)
-
arch/amd64/src/amd64.c (modified) (2 diffs)
-
arch/amd64/src/interrupt.c (modified) (2 diffs)
-
arch/arm32/Makefile.inc (modified) (1 diff)
-
arch/arm32/include/mm/as.h (modified) (1 diff)
-
arch/arm32/include/ras.h (added)
-
arch/arm32/src/arm32.c (modified) (3 diffs)
-
arch/arm32/src/exc_handler.S (modified) (7 diffs)
-
arch/arm32/src/mm/as.c (modified) (2 diffs)
-
arch/arm32/src/ras.c (added)
-
arch/arm32/src/userspace.c (modified) (2 diffs)
-
arch/ia32/src/ia32.c (modified) (2 diffs)
-
arch/ia32/src/interrupt.c (modified) (2 diffs)
-
arch/sparc64/src/context.S (modified) (3 diffs)
-
arch/sparc64/src/trap/trap_table.S (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r002252a r5eb5dcf 33 33 all: ../version ../Makefile.config ../config.h ../config.defs 34 34 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 35 $(MAKE) -f Makefile.build EXTRA_TOOL=$(EXTRA_TOOL)35 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 36 36 37 37 clean: 38 38 rm -f $(DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* $(ARCH_INCLUDE) $(GENARCH_INCLUDE) arch/*/_link.ld 39 39 find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \; 40 find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o.preproc' -follow -exec rm \{\} \; -
kernel/Makefile.build
r002252a r5eb5dcf 375 375 %.o: %.S $(DEPEND) 376 376 $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@ 377 ifeq ($(PRECHECK),y) 378 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(GCC_CFLAGS) -D__ASM__ 379 endif 377 380 378 381 %.o: %.s $(DEPEND) 379 382 $(AS) $(AFLAGS) $< -o $@ 383 ifeq ($(PRECHECK),y) 384 $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) 385 endif 380 386 381 387 # … … 385 391 test/fpu/%.o: test/fpu/%.c $(DEPEND) 386 392 $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) -c $< -o $@ 387 ifeq ($( EXTRA_TOOL),stanse)388 ../tools/jobfile.py $(JOB) $< $@$(DEFS) $(CFLAGS) $(EXTRA_FLAGS)393 ifeq ($(PRECHECK),y) 394 $(JOBFILE) $(JOB) $< $@ cc test $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) 389 395 endif 390 396 … … 394 400 %.o: %.c $(DEPEND) 395 401 $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) -c $< -o $@ 396 ifeq ($( EXTRA_TOOL),stanse)397 ../tools/jobfile.py $(JOB) $< $@$(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS)402 ifeq ($(PRECHECK),y) 403 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) 398 404 endif 399 405 … … 405 411 $(LD) -T $(LINK) $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP) -o $@ -Map $(MAP_PREV) 406 412 $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP) 407 tools/genmap.py$(MAP_PREV) $(DUMP) $@413 $(GENMAP) $(MAP_PREV) $(DUMP) $@ 408 414 409 415 # Do it once again, this time to get correct even the symbols … … 413 419 $(LD) -T $(LINK) $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP) -o $@ -Map $(MAP_PREV) 414 420 $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP) 415 tools/genmap.py$(MAP_PREV) $(DUMP) $@421 $(GENMAP) $(MAP_PREV) $(DUMP) $@ 416 422 417 423 $(DEPEND): $(ARCH_INCLUDE) $(GENARCH_INCLUDE) -
kernel/Makefile.common
r002252a r5eb5dcf 44 44 ARCH_INCLUDE = generic/include/arch 45 45 GENARCH_INCLUDE = generic/include/genarch 46 47 GENMAP = tools/genmap.py 48 JOBFILE = ../tools/jobfile.py -
kernel/arch/amd64/src/amd64.c
r002252a r5eb5dcf 212 212 i8042_wire(i8042_instance, kbrd); 213 213 trap_virtual_enable_irqs(1 << IRQ_KBD); 214 trap_virtual_enable_irqs(1 << IRQ_MOUSE); 214 215 } 215 216 } … … 219 220 * self-sufficient. 220 221 */ 221 sysinfo_set_item_val("kbd", NULL, true); 222 sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD); 223 sysinfo_set_item_val("kbd.address.physical", NULL, 222 sysinfo_set_item_val("i8042", NULL, true); 223 sysinfo_set_item_val("i8042.inr_a", NULL, IRQ_KBD); 224 sysinfo_set_item_val("i8042.inr_b", NULL, IRQ_MOUSE); 225 sysinfo_set_item_val("i8042.address.physical", NULL, 224 226 (uintptr_t) I8042_BASE); 225 sysinfo_set_item_val(" kbd.address.kernel", NULL,227 sysinfo_set_item_val("i8042.address.kernel", NULL, 226 228 (uintptr_t) I8042_BASE); 227 229 #endif -
kernel/arch/amd64/src/interrupt.c
r002252a r5eb5dcf 98 98 } 99 99 100 static void de_fault(int n, istate_t *istate) 101 { 102 fault_if_from_uspace(istate, "Divide error."); 103 decode_istate(n, istate); 104 panic("Divide error."); 105 } 106 100 107 /** General Protection Fault. */ 101 108 static void gp_fault(int n, istate_t *istate) … … 200 207 } 201 208 209 exc_register(0, "de_fault", (iroutine) de_fault); 202 210 exc_register(7, "nm_fault", (iroutine) nm_fault); 203 211 exc_register(12, "ss_fault", (iroutine) ss_fault); -
kernel/arch/arm32/Makefile.inc
r002252a r5eb5dcf 61 61 arch/$(KARCH)/src/mm/page.c \ 62 62 arch/$(KARCH)/src/mm/tlb.c \ 63 arch/$(KARCH)/src/mm/page_fault.c 63 arch/$(KARCH)/src/mm/page_fault.c \ 64 arch/$(KARCH)/src/ras.c 64 65 65 66 ifeq ($(MACHINE),testarm) -
kernel/arch/arm32/include/mm/as.h
r002252a r5eb5dcf 54 54 #define as_destructor_arch(as) (as != as) 55 55 #define as_create_arch(as, flags) (as != as) 56 #define as_install_arch(as)57 56 #define as_deinstall_arch(as) 58 57 #define as_invalidate_translation_cache(as, page, cnt) -
kernel/arch/arm32/src/arm32.c
r002252a r5eb5dcf 48 48 #include <macros.h> 49 49 #include <string.h> 50 #include <arch/ras.h> 50 51 51 52 #ifdef MACHINE_testarm … … 88 89 exception_init(); 89 90 interrupt_init(); 91 92 /* Initialize Restartable Atomic Sequences support. */ 93 ras_init(); 90 94 91 95 machine_output_init(); … … 136 140 uint8_t *stck; 137 141 138 tlb_invalidate_all();139 142 stck = &THREAD->kstack[THREAD_STACK_SIZE - SP_DELTA]; 140 143 supervisor_sp = (uintptr_t) stck; -
kernel/arch/arm32/src/exc_handler.S
r002252a r5eb5dcf 148 148 mov r0, #0 149 149 mov r1, r13 150 bl exc_dispatch150 bl ras_check 151 151 LOAD_REGS_FROM_STACK 152 152 … … 156 156 mov r0, #5 157 157 mov r1, r13 158 bl exc_dispatch158 bl ras_check 159 159 LOAD_REGS_FROM_STACK 160 160 … … 164 164 mov r0, #6 165 165 mov r1, r13 166 bl exc_dispatch166 bl ras_check 167 167 LOAD_REGS_FROM_STACK 168 168 … … 171 171 mov r0, #1 172 172 mov r1, r13 173 bl exc_dispatch173 bl ras_check 174 174 LOAD_REGS_FROM_STACK 175 175 … … 179 179 mov r0, #3 180 180 mov r1, r13 181 bl exc_dispatch181 bl ras_check 182 182 LOAD_REGS_FROM_STACK 183 183 … … 187 187 mov r0, #4 188 188 mov r1, r13 189 bl exc_dispatch189 bl ras_check 190 190 LOAD_REGS_FROM_STACK 191 191 … … 195 195 mov r0, #2 196 196 mov r1, r13 197 bl exc_dispatch197 bl ras_check 198 198 LOAD_REGS_FROM_STACK 199 199 -
kernel/arch/arm32/src/mm/as.c
r002252a r5eb5dcf 39 39 #include <genarch/mm/asid_fifo.h> 40 40 #include <mm/as.h> 41 #include <mm/tlb.h> 41 42 #include <arch.h> 42 43 … … 50 51 } 51 52 53 void as_install_arch(as_t *as) 54 { 55 tlb_invalidate_all(); 56 } 57 52 58 /** @} 53 59 */ -
kernel/arch/arm32/src/userspace.c
r002252a r5eb5dcf 35 35 36 36 #include <userspace.h> 37 #include <arch/ras.h> 37 38 38 39 /** Struct for holding all general purpose registers. … … 74 75 ustate.r1 = 0; 75 76 77 /* pass the RAS page address in %r2 */ 78 ustate.r2 = (uintptr_t) ras_page; 79 76 80 /* clear other registers */ 77 ustate.r 2 = ustate.r3 = ustate.r4 = ustate.r5=78 ustate.r 6 = ustate.r7 = ustate.r8 = ustate.r9 = ustate.r10 =79 ustate. r11 = ustate.r12 = ustate.lr = 0;81 ustate.r3 = ustate.r4 = ustate.r5 = ustate.r6 = ustate.r7 = 82 ustate.r8 = ustate.r9 = ustate.r10 = ustate.r11 = ustate.r12 = 83 ustate.lr = 0; 80 84 81 85 /* set user stack */ -
kernel/arch/ia32/src/ia32.c
r002252a r5eb5dcf 170 170 i8042_wire(i8042_instance, kbrd); 171 171 trap_virtual_enable_irqs(1 << IRQ_KBD); 172 trap_virtual_enable_irqs(1 << IRQ_MOUSE); 172 173 } 173 174 } … … 177 178 * self-sufficient. 178 179 */ 179 sysinfo_set_item_val("kbd", NULL, true); 180 sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD); 181 sysinfo_set_item_val("kbd.address.physical", NULL, 180 sysinfo_set_item_val("i8042", NULL, true); 181 sysinfo_set_item_val("i8042.inr_a", NULL, IRQ_KBD); 182 sysinfo_set_item_val("i8042.inr_b", NULL, IRQ_MOUSE); 183 sysinfo_set_item_val("i8042.address.physical", NULL, 182 184 (uintptr_t) I8042_BASE); 183 sysinfo_set_item_val(" kbd.address.kernel", NULL,185 sysinfo_set_item_val("i8042.address.kernel", NULL, 184 186 (uintptr_t) I8042_BASE); 185 187 #endif -
kernel/arch/ia32/src/interrupt.c
r002252a r5eb5dcf 98 98 } 99 99 100 static void de_fault(int n, istate_t *istate) 101 { 102 fault_if_from_uspace(istate, "Divide error."); 103 104 decode_istate(istate); 105 panic("Divide error."); 106 } 107 100 108 /** General Protection Fault. */ 101 109 static void gp_fault(int n __attribute__((unused)), istate_t *istate) … … 215 223 } 216 224 225 exc_register(0, "de_fault", (iroutine) de_fault); 217 226 exc_register(7, "nm_fault", (iroutine) nm_fault); 218 227 exc_register(12, "ss_fault", (iroutine) ss_fault); -
kernel/arch/sparc64/src/context.S
r002252a r5eb5dcf 28 28 29 29 #include <arch/context_offset.h> 30 31 /** 32 * Both context_save_arch() and context_restore_arch() are 33 * leaf-optimized procedures. This kind of optimization 34 * is very important and prevents any implicit window 35 * spill/fill/clean traps in these very core kernel 36 * functions. 37 */ 38 39 #include <arch/context_offset.h> 30 #include <arch/arch.h> 31 #include <arch/regdef.h> 40 32 41 33 .text … … 44 36 .global context_restore_arch 45 37 38 /* 39 * context_save_arch() is required not to create its own stack frame. See the 40 * generic context.h for explanation. 41 */ 46 42 context_save_arch: 43 # 44 # Force all our active register windows to memory so that we can find 45 # them there even if e.g. the thread is migrated to another processor. 46 # 47 flushw 48 47 49 CONTEXT_SAVE_ARCH_CORE %o0 48 50 retl … … 51 53 context_restore_arch: 52 54 # 53 # Flush all active windows. 54 # This is essential, because CONTEXT_LOAD overwrites 55 # %sp of CWP - 1 with the value written to %fp of CWP. 56 # Flushing all active windows mitigates this problem 57 # as CWP - 1 becomes the overlap window. 55 # Forget all previous windows, they are not going to be needed again. 56 # Enforce a window fill on the next RESTORE instruction by setting 57 # CANRESTORE to zero and other window configuration registers 58 # accordingly. Note that the same can be achieved by executing the 59 # FLUSHW instruction, but since we don't need to remember the previous 60 # windows, we do the former and save thus some unnecessary window 61 # spills. 58 62 # 59 flushw 60 63 rdpr %pstate, %l0 64 andn %l0, PSTATE_IE_BIT, %l1 65 wrpr %l1, %pstate 66 wrpr %g0, 0, %canrestore 67 wrpr %g0, 0, %otherwin 68 wrpr %g0, NWINDOWS - 2, %cansave 69 wrpr %l0, %pstate 70 61 71 CONTEXT_RESTORE_ARCH_CORE %o0 62 72 retl -
kernel/arch/sparc64/src/trap/trap_table.S
r002252a r5eb5dcf 652 652 * spilled to kernel memory (i.e. register window buffer). Moreover, 653 653 * if the scheduler was called in the meantime, all valid windows 654 * belonging to other threads were spilled by context_ restore().654 * belonging to other threads were spilled by context_save(). 655 655 * If OTHERWIN is non-zero, then some userspace windows are still 656 656 * valid. Others might have been spilled. However, the CWP pointer
Note:
See TracChangeset
for help on using the changeset viewer.
