2 * strlen.c -- strlen function. On at least some MIPS chips, a simple
3 * strlen is faster than the 'optimized' C version.
5 * Copyright (c) 2001, 2002 Red Hat, Inc.
7 * The authors hereby grant permission to use, copy, modify, distribute,
8 * and license this software and its documentation for any purpose, provided
9 * that existing copyright notices are retained in all copies and that this
10 * notice is included verbatim in any distributions. No written agreement,
11 * license, or royalty fee is required for any of the authorized uses.
12 * Modifications to this software may be copyrighted by their authors
13 * and need not follow the licensing terms described here, provided that
14 * the new terms are clearly indicated on the first page of each file where
21 /* MIPS16 needs to come first. */
25 strlen (const char *str
)
27 const char *start
= str
;
29 while (*str
++ != '\0')
32 return str
- start
- 1;
34 #elif defined(__mips64)
35 __asm__("" /* 64-bit MIPS targets */
54 __asm__("" /* 32-bit MIPS targets */