/* Read 16 or 32 bits depending on the current size of the counter. Counters 4, 5, 6 & 7 are always 16 bit.  */
u32 ps3_read_ctr(u32 cpu, u32 ctr)
/* Read 16 or 32 bits depending on the current size of the counter. Counters 4, 5, 6 & 7 are always 16 bit.  */
u32 ps3_read_ctr(u32 cpu, u32 ctr)
{
	u32 val;
	u32 phys_ctr = ctr & (NR_PHYS_CTRS - 1);
	val = ps3_read_phys_ctr(cpu, phys_ctr);
	if (ps3_get_ctr_size(cpu, phys_ctr) == 16)
		val = (ctr < NR_PHYS_CTRS) ? (val >> 16) : (val & 0xffff);
	return val;
}