fls.h 441 B

1234567891011121314151617181920212223242526272829
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * OpenRISC Linux
  4. *
  5. * Copyright (C) 2010-2011 Jonas Bonn <[email protected]>
  6. */
  7. #ifndef __ASM_OPENRISC_FLS_H
  8. #define __ASM_OPENRISC_FLS_H
  9. #ifdef CONFIG_OPENRISC_HAVE_INST_FL1
  10. static inline int fls(unsigned int x)
  11. {
  12. int ret;
  13. __asm__ ("l.fl1 %0,%1"
  14. : "=r" (ret)
  15. : "r" (x));
  16. return ret;
  17. }
  18. #else
  19. #include <asm-generic/bitops/fls.h>
  20. #endif
  21. #endif /* __ASM_OPENRISC_FLS_H */