Changeset 18e0a6c in mainline for arch/ia32/src
- Timestamp:
- 2005-06-09T23:43:45Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 74df77d
- Parents:
- d896525
- Location:
- arch/ia32/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/asm.s
rd896525 r18e0a6c 31 31 .text 32 32 33 .global cpu_priority_high34 .global cpu_priority_low35 .global cpu_priority_restore36 .global cpu_priority_read37 33 .global cpu_halt 38 34 .global cpu_sleep 39 35 .global paging_on 40 .global cpu_read_dba41 .global cpu_write_dba42 .global cpu_read_cr243 36 .global enable_l_apic_in_msr 44 37 .global interrupt_handlers … … 55 48 56 49 57 ## Set priority level high58 #59 # Disable interrupts and return previous60 # EFLAGS in EAX.61 #62 cpu_priority_high:63 pushf64 pop %eax65 cli66 ret67 68 69 ## Set priority level low70 #71 # Enable interrupts and return previous72 # EFLAGS in EAX.73 #74 cpu_priority_low:75 pushf76 pop %eax77 sti78 ret79 80 81 ## Restore priority level82 #83 # Restore EFLAGS.84 #85 cpu_priority_restore:86 push 4(%esp)87 popf88 ret89 90 ## Return raw priority level91 #92 # Return EFLAFS in EAX.93 #94 cpu_priority_read:95 pushf96 pop %eax97 ret98 99 100 ## Halt the CPU101 #102 # Halt the CPU using HLT.103 #104 cpu_halt:105 cpu_sleep:106 hlt107 ret108 109 110 50 ## Turn paging on 111 51 # … … 124 64 125 65 126 ## Read CR3127 #128 # Store CR3 in EAX.129 #130 cpu_read_dba:131 movl %cr3,%eax132 ret133 134 135 ## Write CR3136 #137 # Set CR3.138 #139 cpu_write_dba:140 pushl %eax141 movl 8(%esp),%eax142 movl %eax,%cr3143 popl %eax144 ret145 146 147 ## Read CR2148 #149 # Store CR2 in EAX.150 #151 cpu_read_cr2:152 movl %cr2,%eax153 ret154 155 156 66 ## Enable local APIC 157 67 # -
arch/ia32/src/atomic.S
rd896525 r18e0a6c 29 29 .text 30 30 31 .global atomic_inc32 atomic_inc:33 pushl %ebx34 movl 8(%esp),%ebx35 #ifdef __SMP__36 lock incl (%ebx)37 #else38 incl (%ebx)39 #endif40 popl %ebx41 ret42 43 .global atomic_dec44 atomic_dec:45 pushl %ebx46 movl 8(%esp),%ebx47 #ifdef __SMP__48 lock decl (%ebx)49 #else50 decl (%ebx)51 #endif52 popl %ebx53 ret54 55 56 31 #ifdef __SMP__ 57 32 58 59 .global test_and_set60 33 .global spinlock_arch 61 62 test_and_set:63 pushl %ebx64 65 movl 8(%esp),%ebx66 movl $1,%eax67 xchgl %eax,(%ebx) # xchg implicitly turns on the LOCK signal68 69 popl %ebx70 ret71 72 34 73 35 # -
arch/ia32/src/interrupt.c
rd896525 r18e0a6c 112 112 void page_fault(__u8 n, __u32 stack[]) 113 113 { 114 printf("page fault address: %X\n", cpu_read_cr2());114 printf("page fault address: %X\n", read_cr2()); 115 115 printf("stack[0]=%X, %%eip=%X, %%cs=%X, flags=%X\n", stack[0], stack[1], stack[2], stack[3]); 116 116 printf("%%eax=%L, %%ebx=%L, %%ecx=%L, %%edx=%L,\n%%edi=%L, %%esi=%L, %%ebp=%L, %%esp=%L\n", stack[-2], stack[-5], stack[-3], stack[-4], stack[-9], stack[-8], stack[-1], stack); -
arch/ia32/src/mm/page.c
rd896525 r18e0a6c 70 70 71 71 trap_register(14, page_fault); 72 cpu_write_dba(KA2PA(dba));72 write_cr3(KA2PA(dba)); 73 73 } 74 74 else { … … 82 82 dba = frame_alloc(FRAME_KA | FRAME_PANIC); 83 83 memcopy(bootstrap_dba, dba, PAGE_SIZE); 84 cpu_write_dba(KA2PA(dba));84 write_cr3(KA2PA(dba)); 85 85 } 86 86 … … 108 108 109 109 if (root) dba = root; 110 else dba = cpu_read_dba();110 else dba = read_cr3(); 111 111 112 112 pde = page >> 22; /* page directory entry */ -
arch/ia32/src/mm/tlb.c
rd896525 r18e0a6c 32 32 void tlb_invalidate(int asid) 33 33 { 34 cpu_write_dba(cpu_read_dba());34 write_cr3(read_cr3()); 35 35 } -
arch/ia32/src/smp/apic.c
rd896525 r18e0a6c 45 45 * Tested on: 46 46 * Bochs 2.0.2 - Bochs 2.2 with 2-8 CPUs 47 * Simics 2.0.28 47 48 * ASUS P/I-P65UP5 + ASUS C-P55T2D REV. 1.41 with 2x 200Mhz Pentium CPUs 48 49 */
Note:
See TracChangeset
for help on using the changeset viewer.