/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Based on arch/arm/lib/strrchr.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 last occurrence of a character in a string.13*14* Parameters:15* x0 - str16* x1 - c17* Returns:18* x0 - address of last occurrence of 'c' or 019*/20SYM_FUNC_START(__pi_strrchr)21mov x3, #022and w1, w1, #0xff231: ldrb w2, [x0], #124cbz w2, 2f25cmp w2, w126b.ne 1b27sub x3, x0, #128b 1b292: mov x0, x330ret31SYM_FUNC_END(__pi_strrchr)32SYM_FUNC_ALIAS_WEAK(strrchr, __pi_strrchr)33EXPORT_SYMBOL_NOKASAN(strrchr)343536