/* SPDX-License-Identifier: GPL-2.0-only */12/*3* Copyright (C) 2025 Feng Jiang <[email protected]>4*/56#include <linux/linkage.h>7#include <asm/asm.h>89/* char *strrchr(const char *s, int c) */10SYM_FUNC_START(strrchr)11/*12* Parameters13* a0 - The string to be searched14* a1 - The character to seaerch for15*16* Returns17* a0 - Address of last occurrence of 'c' or 018*19* Clobbers20* t0, t121*/22andi a1, a1, 0xff23mv t1, a024li a0, 0251:26lbu t0, 0(t1)27bne t0, a1, 2f28mv a0, t1292:30addi t1, t1, 131bnez t0, 1b32ret33SYM_FUNC_END(strrchr)3435SYM_FUNC_ALIAS_WEAK(__pi_strrchr, strrchr)36EXPORT_SYMBOL(strrchr)373839