Changeset e257ae3 in mainline
- Timestamp:
- 2010-03-31T13:42:17Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0655d64
- Parents:
- 944f2cab
- Location:
- kernel/generic
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/cpu.h
r944f2cab re257ae3 68 68 are disabled. */ 69 69 70 bool idle; 71 uint64_t idle_ticks; 72 uint64_t busy_ticks; 73 70 74 /** 71 75 * Processor ID assigned by kernel. -
kernel/generic/src/cpu/cpu.c
r944f2cab re257ae3 74 74 75 75 cpus[i].id = i; 76 cpus[i].idle_ticks = 0; 77 cpus[i].busy_ticks = 0; 76 78 77 79 spinlock_initialize(&cpus[i].lock, "cpu_t.lock"); -
kernel/generic/src/proc/scheduler.c
r944f2cab re257ae3 202 202 */ 203 203 204 CPU->idle = true; 204 205 cpu_sleep(); 205 206 goto loop; -
kernel/generic/src/ps/load.c
r944f2cab re257ae3 37 37 38 38 #include <proc/thread.h> 39 #include <print.h>40 39 #include <ps/load.h> 41 40 #include <arch.h> … … 117 116 while (true) { 118 117 calc_load_global(); 119 printf("Computed loads: 0x%x 0x%x 0x%x\n", avenrun[0], avenrun[1], avenrun[2]);120 118 thread_sleep(LOAD_FREQ); 121 119 } -
kernel/generic/src/time/clock.c
r944f2cab re257ae3 137 137 size_t missed_clock_ticks = CPU->missed_clock_ticks; 138 138 unsigned int i; 139 140 /* Account lost ticks to CPU usage */ 141 if (CPU->idle) { 142 ASSERT(missed_clock_ticks == 0); 143 CPU->idle_ticks++; 144 } else { 145 CPU->busy_ticks += missed_clock_ticks + 1; 146 } 147 CPU->idle = false; 139 148 140 149 /*
Note:
See TracChangeset
for help on using the changeset viewer.