nios2: Miscellaneous header files

This patch introduces a few nios2-specific header files.

Signed-off-by: Ley Foon Tan <lftan@altera.com>
This commit is contained in:
Ley Foon Tan
2014-11-06 15:20:09 +08:00
parent 2612b87959
commit 97da0d62d4
5 changed files with 146 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2009 Thomas Chou <thomas@wytron.com.tw>
* Copyright (C) 2004 Microtronix Datacom Ltd
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _ASM_NIOS2_BYTEORDER_H
#define _ASM_NIOS2_BYTEORDER_H
#include <linux/byteorder/little_endian.h>
#endif

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2012 Tobias Klauser <tklauser@distanz.ch>
* Copyright (C) 2011 Pyramid Technical Consultants, Inc.
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
* archive for more details.
*/
#ifndef _ASM_NIOS2_SWAB_H
#define _ASM_NIOS2_SWAB_H
#include <linux/types.h>
#include <asm-generic/swab.h>
#ifdef CONFIG_NIOS2_CI_SWAB_SUPPORT
#ifdef __GNUC__
#define __nios2_swab(x) \
__builtin_custom_ini(CONFIG_NIOS2_CI_SWAB_NO, (x))
static inline __attribute__((const)) __u16 __arch_swab16(__u16 x)
{
return (__u16) __nios2_swab(((__u32) x) << 16);
}
#define __arch_swab16 __arch_swab16
static inline __attribute__((const)) __u32 __arch_swab32(__u32 x)
{
return (__u32) __nios2_swab(x);
}
#define __arch_swab32 __arch_swab32
#endif /* __GNUC__ */
#endif /* CONFIG_NIOS2_CI_SWAB_SUPPORT */
#endif /* _ASM_NIOS2_SWAB_H */