ffs.h 335 B

1234567891011121314151617181920212223
  1. /*
  2. * OpenRISC Linux
  3. *
  4. * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #ifndef __ASM_OPENRISC_FFS_H
  9. #define __ASM_OPENRISC_FFS_H
  10. static inline int ffs(int x)
  11. {
  12. int ret;
  13. __asm__ ("l.ff1 %0,%1"
  14. : "=r" (ret)
  15. : "r" (x));
  16. return ret;
  17. }
  18. #endif /* __ASM_OPENRISC_FFS_H */