summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Bukin <br@FreeBSD.org>2016-10-13 15:23:53 +0000
committerRuslan Bukin <br@FreeBSD.org>2016-10-13 15:23:53 +0000
commit2302bd3539de9c01e7af51428cea2578c31dd68c (patch)
tree8b714c99a7c0b66ebe50373b8d87b6b6fafc2ed8
parent5975e53d403d4ab0cae71f401ef9698aaaeb0c2a (diff)
Notes
-rw-r--r--lib/libc/mips/string/strchr.S5
-rw-r--r--lib/libc/mips/string/strrchr.S5
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/libc/mips/string/strchr.S b/lib/libc/mips/string/strchr.S
index 198366f87a69..19dae58415e2 100644
--- a/lib/libc/mips/string/strchr.S
+++ b/lib/libc/mips/string/strchr.S
@@ -44,7 +44,12 @@ __FBSDID("$FreeBSD$");
.abicalls
#endif
+/*
+ * char *
+ * strchr(const char *s, int c);
+ */
LEAF(strchr)
+ and a1, a1, 0xff
1:
lbu a2, 0(a0) # get a byte
PTR_ADDU a0, a0, 1
diff --git a/lib/libc/mips/string/strrchr.S b/lib/libc/mips/string/strrchr.S
index 5a88a42c8e17..c0dcef049d6e 100644
--- a/lib/libc/mips/string/strrchr.S
+++ b/lib/libc/mips/string/strrchr.S
@@ -44,8 +44,13 @@ __FBSDID("$FreeBSD$");
.abicalls
#endif
+/*
+ * char *
+ * strrchr(const char *s, int c);
+ */
LEAF(strrchr)
move v0, zero # default if not found
+ and a1, a1, 0xff
1:
lbu a3, 0(a0) # get a byte
PTR_ADDU a0, a0, 1