2011-11-26 19:04:49 +00:00
|
|
|
/*
|
|
|
|
* OpenRISC Linux
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2011-11-26 19:04:49 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ASM_OPENRISC_FFS_H
|
|
|
|
#define __ASM_OPENRISC_FFS_H
|
|
|
|
|
|
|
|
static inline int ffs(int x)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
__asm__ ("l.ff1 %0,%1"
|
|
|
|
: "=r" (ret)
|
|
|
|
: "r" (x));
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __ASM_OPENRISC_FFS_H */
|