/*1* Copyright 2005-2009 Analog Devices Inc.2*3* Licensed under the ADI BSD license or the GPL-2 (or later)4*/56#include <linux/linkage.h>78/* void *memchr(const void *s, int c, size_t n);9* R0 = address (s)10* R1 = sought byte (c)11* R2 = count (n)12*13* Returns pointer to located character.14*/1516.text1718.align 21920ENTRY(_memchr)21P0 = R0; /* P0 = address */22P2 = R2; /* P2 = count */23R1 = R1.B(Z);24CC = R2 == 0;25IF CC JUMP .Lfailed;2627.Lbytes:28LSETUP (.Lbyte_loop_s, .Lbyte_loop_e) LC0=P2;2930.Lbyte_loop_s:31R3 = B[P0++](Z);32CC = R3 == R1;33IF CC JUMP .Lfound;34.Lbyte_loop_e:35NOP;3637.Lfailed:38R0=0;39RTS;4041.Lfound:42R0 = P0;43R0 += -1;44RTS;4546ENDPROC(_memchr)474849