arch/openrisc/include/asm/bitops/ffs.h

Source file repositories/reference/linux-study-clean/arch/openrisc/include/asm/bitops/ffs.h

File Facts

System
Linux kernel
Corpus path
arch/openrisc/include/asm/bitops/ffs.h
Extension
.h
Size
451 bytes
Lines
29
Domain
Architecture Layer
Bucket
arch/openrisc
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __ASM_OPENRISC_FFS_H
#define __ASM_OPENRISC_FFS_H

#ifdef CONFIG_OPENRISC_HAVE_INST_FF1

static inline __attribute_const__ int ffs(int x)
{
	int ret;

	__asm__ ("l.ff1 %0,%1"
		 : "=r" (ret)
		 : "r" (x));

	return ret;
}

#else
#include <asm-generic/bitops/ffs.h>
#endif

#endif /* __ASM_OPENRISC_FFS_H */

Annotation

Implementation Notes