/* 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 *strchr(const char *s, int c) */10SYM_FUNC_START(strchr)11/*12* Parameters13* a0 - The string to be searched14* a1 - The character to search for15*16* Returns17* a0 - Address of first occurrence of 'c' or 018*19* Clobbers20* t021*/22andi a1, a1, 0xff231:24lbu t0, 0(a0)25beq t0, a1, 2f26addi a0, a0, 127bnez t0, 1b28li a0, 0292:30ret31SYM_FUNC_END(strchr)3233SYM_FUNC_ALIAS_WEAK(__pi_strchr, strchr)34EXPORT_SYMBOL(strchr)353637