static void cg3_loadcmap (struct fb_info_sbusfb *fb, struct display *p, int index, int count) { struct bt_regs *bt = &fb->s.cg3.regs->cmap; u32 *i; int steps; i = (((u32 *)fb->color_map) + D4M3(index)); steps = D4M3(index+count-1) - D4M3(index)+3; *(volatile u8 *)&bt->addr = (u8)D4M4(index); while (steps--) bt->color_map = *i++; }
static void cg3_loadcmap (struct fb_info_sbusfb *fb, struct display *p, int index, int count) { struct bt_regs *bt = &fb->s.cg3.regs->cmap; unsigned long flags; u32 *i; volatile u8 *regp; int steps; spin_lock_irqsave(&fb->lock, flags); i = (((u32 *)fb->color_map) + D4M3(index)); steps = D4M3(index+count-1) - D4M3(index)+3; regp = (volatile u8 *)&bt->addr; sbus_writeb(D4M4(index), regp); while (steps--) { u32 val = *i++; sbus_writel(val, &bt->color_map); } spin_unlock_irqrestore(&fb->lock, flags); }