Changeset 4ffa9e0 in mainline
- Timestamp:
- 2005-02-23T11:48:52Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3418c41
- Parents:
- b109ebb
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/Makefile.inc
rb109ebb r4ffa9e0 27 27 arch/smp/mp.c \ 28 28 arch/smp/atomic.S \ 29 arch/smp/ipi.c \ 29 30 arch/ia32.c \ 30 31 arch/interrupt.c \ -
arch/ia32/include/interrupt.h
rb109ebb r4ffa9e0 59 59 #define VECTOR_KBD (IVT_IRQBASE+IRQ_KBD) 60 60 61 #define VECTOR_SYSCALL (IVT_FREEBASE+0) 62 #define VECTOR_TLB_SHOOTDOWN (IVT_FREEBASE+1) 61 #define VECTOR_SYSCALL (IVT_FREEBASE+0) 62 #define VECTOR_TLB_SHOOTDOWN_IPI (IVT_FREEBASE+1) 63 #define VECTOR_WAKEUP_IPI (IVT_FREEBASE+2) 63 64 64 65 typedef void (* iroutine)(__u8 n, __u32 stack[]); … … 79 80 extern void syscall(__u8 n, __u32 stack[]); 80 81 extern void tlb_shootdown_ipi(__u8 n, __u32 stack[]); 82 extern void wakeup_ipi(__u8 n, __u32 stack[]); 81 83 82 84 extern void trap_virtual_enable_irqs(__u16 irqmask); -
arch/ia32/src/ia32.c
rb109ebb r4ffa9e0 59 59 60 60 #ifdef __SMP__ 61 trap_register(VECTOR_TLB_SHOOTDOWN, tlb_shootdown_ipi); 61 trap_register(VECTOR_TLB_SHOOTDOWN_IPI, tlb_shootdown_ipi); 62 trap_register(VECTOR_WAKEUP_IPI, wakeup_ipi); 62 63 #endif /* __SMP__ */ 63 64 } -
arch/ia32/src/interrupt.c
rb109ebb r4ffa9e0 101 101 } 102 102 103 void wakeup_ipi(__u8 n, __u32 stack[]) 104 { 105 trap_virtual_eoi(); 106 } 107 103 108 void trap_virtual_enable_irqs(__u16 irqmask) 104 109 { -
arch/ia32/src/mm/tlb.c
rb109ebb r4ffa9e0 30 30 #include <arch/asm.h> 31 31 32 #ifdef __SMP__33 #include <arch/apic.h>34 #include <arch/interrupt.h>35 #endif /* __SMP__ */36 37 32 void tlb_invalidate(int asid) 38 33 { 39 34 cpu_write_dba(cpu_read_dba()); 40 35 } 41 42 #ifdef __SMP__43 void tlb_shootdown_ipi_send(void)44 {45 (void) l_apic_broadcast_custom_ipi(VECTOR_TLB_SHOOTDOWN);46 }47 #endif /* __SMP__ */ -
src/mm/tlb.c
rb109ebb r4ffa9e0 28 28 29 29 #include <mm/tlb.h> 30 #include <smp/ipi.h> 30 31 #include <synch/spinlock.h> 31 32 #include <typedefs.h> 32 33 #include <arch/atomic.h> 34 #include <arch/interrupt.h> 33 35 #include <config.h> 34 36 … … 60 62 } 61 63 64 void tlb_shootdown_ipi_send(void) 65 { 66 ipi_broadcast(VECTOR_TLB_SHOOTDOWN_IPI); 67 } 68 62 69 void tlb_shootdown_ipi_recv(void) 63 70 { -
src/proc/thread.c
rb109ebb r4ffa9e0 46 46 #include <time/clock.h> 47 47 #include <list.h> 48 #include <config.h> 49 50 #ifdef __SMP__ 51 #include <arch/interrupt.h> 52 #include <arch/apic.h> 53 #endif /* __SMP__ */ 48 54 49 55 char *thread_states[] = {"Invalid", "Running", "Sleeping", "Ready", "Entering", "Exiting"}; … … 89 95 runq_t *r; 90 96 pri_t pri; 91 int i ;97 int i, avg, send_ipi = 0; 92 98 93 99 pri = cpu_priority_high(); … … 113 119 114 120 spinlock_lock(&nrdylock); 115 nrdy++;121 avg = ++nrdy / config.cpu_active; 116 122 spinlock_unlock(&nrdylock); 117 123 118 124 spinlock_lock(&cpu->lock); 119 cpu->nrdy++; 125 if ((++cpu->nrdy) > avg && (config.cpu_active == config.cpu_count)) { 126 /* 127 * If there are idle halted CPU's, this will wake them up. 128 */ 129 #ifdef __SMP__ 130 l_apic_broadcast_custom_ipi(VECTOR_WAKEUP_IPI); 131 #endif /* __SMP__ */ 132 } 120 133 spinlock_unlock(&cpu->lock); 121 134
Note:
See TracChangeset
for help on using the changeset viewer.