Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/powerpc/machdep.c
Show First 20 Lines • Show All 510 Lines • ▼ Show 20 Lines | spinlock_exit(void) | ||||
msr = td->td_md.md_saved_msr; | msr = td->td_md.md_saved_msr; | ||||
td->td_md.md_spinlock_count--; | td->td_md.md_spinlock_count--; | ||||
if (td->td_md.md_spinlock_count == 0) { | if (td->td_md.md_spinlock_count == 0) { | ||||
intr_restore(msr); | intr_restore(msr); | ||||
__asm __volatile("or 6,6,6"); /* Set normal thread priority */ | __asm __volatile("or 6,6,6"); /* Set normal thread priority */ | ||||
} | } | ||||
} | } | ||||
/* | |||||
* Simple ddb(4) command/hack to view any SPR on the running CPU. | |||||
* Uses a trivial asm function to perform the mfspr, and rewrites the mfspr | |||||
* instruction each time. | |||||
* XXX: Since it uses code modification, it won't work if the kernel code pages | |||||
* are marked RO. | |||||
*/ | |||||
extern register_t get_spr(int); | |||||
DB_SHOW_COMMAND(spr, db_show_spr) | |||||
{ | |||||
register_t spr; | |||||
volatile uint32_t *p; | |||||
int sprno, saved_sprno; | |||||
if (!have_addr) | |||||
return; | |||||
saved_sprno = sprno = (intptr_t) addr; | |||||
sprno = ((sprno & 0x3e0) >> 5) | ((sprno & 0x1f) << 5); | |||||
p = (uint32_t *)(void *)&get_spr; | |||||
*p = (*p & ~0x001ff800) | (sprno << 11); | |||||
__syncicache(get_spr, cacheline_size); | |||||
spr = get_spr(sprno); | |||||
db_printf("SPR %d(%x): %lx\n", saved_sprno, saved_sprno, | |||||
(unsigned long)spr); | |||||
} |