Changeset 23d22eb in mainline
- Timestamp:
- 2006-03-17T11:55:43Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bd72b475
- Parents:
- 4e49572
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/debugger.c
r4e49572 r23d22eb 192 192 } 193 193 194 #ifdef amd64 195 # define getip(x) ((x)->rip) 196 #else 197 # define getip(x) ((x)->eip) 198 #endif 199 194 200 static void handle_exception(int slot, istate_t *istate) 195 201 { … … 208 214 } 209 215 } 210 printf("Reached breakpoint %d:%P(%s)\n", slot, istate->rip,211 get_symtab_entry( istate->rip));216 printf("Reached breakpoint %d:%P(%s)\n", slot, getip(istate), 217 get_symtab_entry(getip(istate))); 212 218 printf("***Type 'exit' to exit kconsole.\n"); 213 219 atomic_set(&haltstate,1); … … 222 228 223 229 /* Set RF to restart the instruction */ 230 #ifdef amd64 224 231 istate->rflags |= RFLAGS_RF; 232 #else 233 istate->eflags |= EFLAGS_RF; 234 #endif 225 235 226 236 dr6 = read_dr6(); -
arch/amd64/src/proc/scheduler.c
r4e49572 r23d22eb 39 39 CPU->arch.tss->rsp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA]; 40 40 41 /* Syscall support - write thread address to hidden part of gs */41 /* Syscall support - write thread stack address to hidden part of gs */ 42 42 swapgs(); 43 43 write_msr(AMD_MSR_GS, -
arch/ia32/Makefile.inc
r4e49572 r23d22eb 129 129 arch/$(ARCH)/src/drivers/ega.c \ 130 130 arch/$(ARCH)/src/boot/boot.S \ 131 arch/$(ARCH)/src/fpu_context.c 131 arch/$(ARCH)/src/fpu_context.c \ 132 arch/$(ARCH)/src/debugger.c -
arch/ia32/include/asm.h
r4e49572 r23d22eb 54 54 static inline void cpu_sleep(void) { __asm__("hlt\n"); }; 55 55 56 /** Read CR2 57 * 58 * Return value in CR2 59 * 60 * @return Value read. 61 */ 62 static inline __u32 read_cr2(void) { __u32 v; __asm__ volatile ("movl %%cr2,%0\n" : "=r" (v)); return v; } 63 64 /** Write CR3 65 * 66 * Write value to CR3. 67 * 68 * @param v Value to be written. 69 */ 70 static inline void write_cr3(__u32 v) { __asm__ volatile ("movl %0,%%cr3\n" : : "r" (v)); } 71 72 /** Read CR3 73 * 74 * Return value in CR3 75 * 76 * @return Value read. 77 */ 78 static inline __u32 read_cr3(void) { __u32 v; __asm__ volatile ("movl %%cr3,%0\n" : "=r" (v)); return v; } 56 #define GEN_READ_REG(reg) static inline __native read_ ##reg (void) \ 57 { \ 58 __native res; \ 59 __asm__ volatile ("movl %%" #reg ", %0" : "=r" (res) ); \ 60 return res; \ 61 } 62 63 #define GEN_WRITE_REG(reg) static inline void write_ ##reg (__native regn) \ 64 { \ 65 __asm__ volatile ("movl %0, %%" #reg : : "r" (regn)); \ 66 } 67 68 GEN_READ_REG(cr0); 69 GEN_READ_REG(cr2); 70 GEN_READ_REG(cr3); 71 GEN_WRITE_REG(cr3); 72 73 GEN_READ_REG(dr0); 74 GEN_READ_REG(dr1); 75 GEN_READ_REG(dr2); 76 GEN_READ_REG(dr3); 77 GEN_READ_REG(dr6); 78 GEN_READ_REG(dr7); 79 80 GEN_WRITE_REG(dr0); 81 GEN_WRITE_REG(dr1); 82 GEN_WRITE_REG(dr2); 83 GEN_WRITE_REG(dr3); 84 GEN_WRITE_REG(dr6); 85 GEN_WRITE_REG(dr7); 79 86 80 87 /** Byte to port -
arch/ia32/include/cpu.h
r4e49572 r23d22eb 34 34 #include <arch/asm.h> 35 35 36 #define EFLAGS_RF (1 << 16) 37 36 38 struct cpu_arch { 37 39 int vendor; -
arch/ia32/include/interrupt.h
r4e49572 r23d22eb 54 54 #endif 55 55 56 #define VECTOR_DEBUG 1 56 57 #define VECTOR_PIC_SPUR (IVT_IRQBASE+IRQ_PIC_SPUR) 57 58 #define VECTOR_CLK (IVT_IRQBASE+IRQ_CLK) -
arch/ia32/src/ia32.c
r4e49572 r23d22eb 51 51 #include <arch/mm/memory_init.h> 52 52 #include <interrupt.h> 53 #include <arch/debugger.h> 53 54 54 55 void arch_pre_mm_init(void) … … 74 75 if (config.cpu_active == 1) { 75 76 ega_init(); /* video */ 77 /* Enable debugger */ 78 debugger_init(); 76 79 } 77 80 } -
arch/ia32/src/proc/scheduler.c
r4e49572 r23d22eb 32 32 #include <arch.h> 33 33 #include <arch/context.h> /* SP_DELTA */ 34 #include <arch/debugger.h> 34 35 35 36 void before_thread_runs_arch(void) … … 37 38 CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA]; 38 39 CPU->arch.tss->ss0 = selector(KDATA_DES); 40 41 #ifdef CONFIG_DEBUG_AS_WATCHPOINT 42 /* Set watchpoint on AS to ensure that nobody sets it to zero */ 43 static int old_slot = -1; 44 if (old_slot >=0) 45 breakpoint_del(old_slot); 46 old_slot = breakpoint_add(&((the_t *) THREAD->kstack)->as, 47 BKPOINT_WRITE | BKPOINT_CHECK_ZERO); 48 #endif 49 39 50 } 40 51 -
kernel.config
r4e49572 r23d22eb 72 72 73 73 # Watchpoint on rewriting AS with zero 74 ! [CONFIG_DEBUG=y& ARCH=amd64] CONFIG_DEBUG_AS_WATCHPOINT (y/n)74 ! [CONFIG_DEBUG=y&(ARCH=amd64|ARCH=ia32)] CONFIG_DEBUG_AS_WATCHPOINT (y/n) 75 75 76 76 ## Run-time configuration directives
Note:
See TracChangeset
for help on using the changeset viewer.