void ps3_set_ctr_size(u32 cpu, u32 phys_ctr, u32 ctr_size) { u32 pm_ctrl; if (phys_ctr >= NR_PHYS_CTRS) { dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__, __LINE__, phys_ctr); return; } pm_ctrl = ps3_read_pm(cpu, pm_control); switch (ctr_size) { case 16: pm_ctrl |= CBE_PM_16BIT_CTR(phys_ctr); ps3_write_pm(cpu, pm_control, pm_ctrl); break; case 32: pm_ctrl &= ~CBE_PM_16BIT_CTR(phys_ctr); ps3_write_pm(cpu, pm_control, pm_ctrl); break; default: BUG(); } }
u32 cbe_get_ctr_size(u32 cpu, u32 phys_ctr) { u32 pm_ctrl, size = 0; if (phys_ctr < NR_PHYS_CTRS) { pm_ctrl = cbe_read_pm(cpu, pm_control); size = (pm_ctrl & CBE_PM_16BIT_CTR(phys_ctr)) ? 16 : 32; } return size; }
u32 ps3_get_ctr_size(u32 cpu, u32 phys_ctr) { u32 pm_ctrl; if (phys_ctr >= NR_PHYS_CTRS) { dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__, __LINE__, phys_ctr); return 0; } pm_ctrl = ps3_read_pm(cpu, pm_control); return (pm_ctrl & CBE_PM_16BIT_CTR(phys_ctr)) ? 16 : 32; }
void cbe_set_ctr_size(u32 cpu, u32 phys_ctr, u32 ctr_size) { u32 pm_ctrl; if (phys_ctr < NR_PHYS_CTRS) { pm_ctrl = cbe_read_pm(cpu, pm_control); switch (ctr_size) { case 16: pm_ctrl |= CBE_PM_16BIT_CTR(phys_ctr); break; case 32: pm_ctrl &= ~CBE_PM_16BIT_CTR(phys_ctr); break; } cbe_write_pm(cpu, pm_control, pm_ctrl); } }