The iseries has a bar graph on the front panel that shows how busy it is. The operating system sets and clears a bit in the CTRL register to control it. Instead of going to the complexity of using a thread info bit, just set and clear it in the idle loop. Also create two helper functions, ppc64_runlatch_on and ppc64_runlatch_off. Finally don't use the short form of the SPR defines.
Showing the changes to include (2 of 7 files). Show all
Unified · Split
| @@ -164,6 +164,9 @@ · 163 unmodified lines | ||
| 164 | 164 | #define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */ |
| 165 | 165 | #define SPRN_XER 0x001 /* Fixed Point Exception Register */ |
| 166 | 166 | #define SPRN_VRSAVE 0x100 /* Vector save */ |
| 167 | +#define SPRN_CTRLF 0x088 | |
| 168 | +#define SPRN_CTRLT 0x098 | |
| 169 | +#define CTRL_RUNLATCH 0x1 | |
| 167 | 170 | |
| 168 | 171 | /* Performance monitor SPRs */ |
| 169 | 172 | #define SPRN_SIAR 780 |
| @@ -279,12 +282,6 @@ · 109 unmodified lines | ||
| 279 | 282 | #define XGLUE(a,b) a##b |
| 280 | 283 | #define GLUE(a,b) XGLUE(a,b) |
| 281 | 284 | |
| 282 | −/* iSeries CTRL register (for runlatch) */ | |
| 283 | − | |
| 284 | −#define CTRLT 0x098 | |
| 285 | −#define CTRLF 0x088 | |
| 286 | −#define RUNLATCH 0x0001 | |
| 287 | − | |
| 288 | 285 | #ifdef __ASSEMBLY__ |
| 289 | 286 | |
| 290 | 287 | #define _GLOBAL(name) \ |
| @@ -499,6 +496,24 @@ static inline void prefetchw(const void *x) · 208 unmodified lines | ||
| 499 | 496 | |
| 500 | 497 | #define HAVE_ARCH_PICK_MMAP_LAYOUT |
| 501 | 498 | |
| 499 | +static inline void ppc64_runlatch_on(void) | |
| 500 | +{ | |
| 501 | + unsigned long ctrl; | |
| 502 | + | |
| 503 | + ctrl = mfspr(SPRN_CTRLF); | |
| 504 | + ctrl |= CTRL_RUNLATCH; | |
| 505 | + mtspr(SPRN_CTRLT, ctrl); | |
| 506 | +} | |
| 507 | + | |
| 508 | +static inline void ppc64_runlatch_off(void) | |
| 509 | +{ | |
| 510 | + unsigned long ctrl; | |
| 511 | + | |
| 512 | + ctrl = mfspr(SPRN_CTRLF); | |
| 513 | + ctrl &= ~CTRL_RUNLATCH; | |
| 514 | + mtspr(SPRN_CTRLT, ctrl); | |
| 515 | +} | |
| 516 | + | |
| 502 | 517 | #endif /* __KERNEL__ */ |
| 503 | 518 | |
| 504 | 519 | #endif /* __ASSEMBLY__ */ |
| @@ -96,7 +96,7 @@ static inline struct thread_info *current_thread_info(void) · 95 unmodified lines | ||
| 96 | 96 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling |
| 97 | 97 | TIF_NEED_RESCHED */ |
| 98 | 98 | #define TIF_32BIT 5 /* 32 bit binary */ |
| 99 | −#define TIF_RUN_LIGHT 6 /* iSeries run light */ | |
| 99 | +/* #define SPARE 6 */ | |
| 100 | 100 | #define TIF_ABI_PENDING 7 /* 32/64 bit switch needed */ |
| 101 | 101 | #define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */ |
| 102 | 102 | #define TIF_SINGLESTEP 9 /* singlestepping active */ |
| @@ -110,7 +110,7 @@ static inline struct thread_info *current_thread_info(void) · 7 unmodified lines | ||
| 110 | 110 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
| 111 | 111 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
| 112 | 112 | #define _TIF_32BIT (1<<TIF_32BIT) |
| 113 | −#define _TIF_RUN_LIGHT (1<<TIF_RUN_LIGHT) | |
| 113 | +/* #define _SPARE (1<<SPARE) */ | |
| 114 | 114 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) |
| 115 | 115 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
| 116 | 116 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) |