1314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris/*
2314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris * This file is subject to the terms and conditions of the GNU General Public
3314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris * License.  See the file "COPYING" in the main directory of this archive
4314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris * for more details.
5314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris *
6314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris * Copyright (C) 2014 by Ralf Baechle <ralf@linux-mips.org>
7314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris */
8314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris#ifndef __UAPI_ASM_BITFIELD_H
9314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris#define __UAPI_ASM_BITFIELD_H
10314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris
11314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris/*
12314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris *  * Damn ...  bitfields depend from byteorder :-(
13314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris *   */
14314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris#ifdef __MIPSEB__
15314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris#define __BITFIELD_FIELD(field, more)					\
16314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris	field;								\
17314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris	more
18314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris
19314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris#elif defined(__MIPSEL__)
20314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris
21314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris#define __BITFIELD_FIELD(field, more)					\
22314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris	more								\
23314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris	field;
24314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris
25314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris#else /* !defined (__MIPSEB__) && !defined (__MIPSEL__) */
26314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris#error "MIPS but neither __MIPSEL__ nor __MIPSEB__?"
27314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris#endif
28314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris
29314752488cb92b9f86028836d0b8eabd8acb6a7cChristopher Ferris#endif /* __UAPI_ASM_BITFIELD_H */
30