Path: blob/master/arch/arm/mach-netx/include/mach/pfifo.h
10820 views
/*1* arch/arm/mach-netx/include/mach/pfifo.h2*3* Copyright (c) 2005 Sascha Hauer <[email protected]>, Pengutronix4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License version 27* as published by the Free Software Foundation.8*9* This program is distributed in the hope that it will be useful,10* but WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12* GNU General Public License for more details.13*14* You should have received a copy of the GNU General Public License15* along with this program; if not, write to the Free Software16* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA17*/181920#ifndef ASM_ARCH_PFIFO_H21#define ASM_ARCH_PFIFO_H2223static inline int pfifo_push(int no, unsigned int pointer)24{25writel(pointer, NETX_PFIFO_BASE(no));26return 0;27}2829static inline unsigned int pfifo_pop(int no)30{31return readl(NETX_PFIFO_BASE(no));32}3334static inline int pfifo_fill_level(int no)35{3637return readl(NETX_PFIFO_FILL_LEVEL(no));38}3940static inline int pfifo_full(int no)41{42return readl(NETX_PFIFO_FULL) & (1<<no) ? 1 : 0;43}4445static inline int pfifo_empty(int no)46{47return readl(NETX_PFIFO_EMPTY) & (1<<no) ? 1 : 0;48}4950int pfifo_request(unsigned int pfifo_mask);51void pfifo_free(unsigned int pfifo_mask);5253#endif /* ASM_ARCH_PFIFO_H */545556