Path: blob/master/arch/unicore32/include/mach/bitfield.h
10818 views
/*1* linux/arch/unicore32/include/mach/bitfield.h2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Copyright (C) 2001-2010 GUAN Xue-tao6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*/11#ifndef __MACH_PUV3_BITFIELD_H__12#define __MACH_PUV3_BITFIELD_H__1314#ifndef __ASSEMBLY__15#define UData(Data) ((unsigned long) (Data))16#else17#define UData(Data) (Data)18#endif1920#define FIELD(val, vmask, vshift) (((val) & ((UData(1) << (vmask)) - 1)) << (vshift))21#define FMASK(vmask, vshift) (((UData(1) << (vmask)) - 1) << (vshift))2223#endif /* __MACH_PUV3_BITFIELD_H__ */242526