/*1* This file is subject to the terms and conditions of the GNU General Public2* License. See the file "COPYING" in the main directory of this archive3* for more details.4*5* Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.6*7* This file contains macros used to access MMR registers via8* uncached physical addresses.9* pio_phys_read_mmr - read an MMR10* pio_phys_write_mmr - write an MMR11* pio_atomic_phys_write_mmrs - atomically write 1 or 2 MMRs with psr.ic=012* Second MMR will be skipped if address is NULL13*14* Addresses passed to these routines should be uncached physical addresses15* ie., 0x80000....16*/17181920#include <asm/asmmacro.h>21#include <asm/page.h>2223GLOBAL_ENTRY(pio_phys_read_mmr)24.prologue25.regstk 1,0,0,026.body27mov r2=psr28rsm psr.i | psr.dt29;;30srlz.d31ld8.acq r8=[r32]32;;33mov psr.l=r2;;34srlz.d35br.ret.sptk.many rp36END(pio_phys_read_mmr)3738GLOBAL_ENTRY(pio_phys_write_mmr)39.prologue40.regstk 2,0,0,041.body42mov r2=psr43rsm psr.i | psr.dt44;;45srlz.d46st8.rel [r32]=r3347;;48mov psr.l=r2;;49srlz.d50br.ret.sptk.many rp51END(pio_phys_write_mmr)5253GLOBAL_ENTRY(pio_atomic_phys_write_mmrs)54.prologue55.regstk 4,0,0,056.body57mov r2=psr58cmp.ne p9,p0=r34,r0;59rsm psr.i | psr.dt | psr.ic60;;61srlz.d62st8.rel [r32]=r3363(p9) st8.rel [r34]=r3564;;65mov psr.l=r2;;66srlz.d67br.ret.sptk.many rp68END(pio_atomic_phys_write_mmrs)6970717273