/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Based on arch/arm/lib/strchr.S3*4* Copyright (C) 1995-2000 Russell King5* Copyright (C) 2013 ARM Ltd.6*/78#include <linux/linkage.h>9#include <asm/assembler.h>1011/*12* Find the first occurrence of a character in a string.13*14* Parameters:15* x0 - str16* x1 - c17* Returns:18* x0 - address of first occurrence of 'c' or 019*/20SYM_FUNC_START(__pi_strchr)21and w1, w1, #0xff221: ldrb w2, [x0], #123cmp w2, w124ccmp w2, wzr, #4, ne25b.ne 1b26sub x0, x0, #127cmp w2, w128csel x0, x0, xzr, eq29ret30SYM_FUNC_END(__pi_strchr)3132SYM_FUNC_ALIAS_WEAK(strchr, __pi_strchr)33EXPORT_SYMBOL_NOKASAN(strchr)343536