diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-03-07 18:15:48 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-03-07 18:15:48 +0000 |
commit | 4cdd9eda09bb220385335b6b2e615fad84ba0ce4 (patch) | |
tree | d6113f997786b2efe030044cb0c7d45dac6f9254 /libc/debian | |
parent | ca8a9eb9da550e4d6df154014376857c872f79c0 (diff) | |
download | illumos-packaging-4cdd9eda09bb220385335b6b2e615fad84ba0ce4.tar.gz |
Implement rawmemchr()
Diffstat (limited to 'libc/debian')
-rw-r--r-- | libc/debian/changelog | 1 | ||||
-rw-r--r-- | libc/debian/libc1-illumos-i386.symbols | 1 | ||||
-rw-r--r-- | libc/debian/libc1.symbols.illumos-amd64 | 1 | ||||
-rw-r--r-- | libc/debian/patches/add-rawmemchr.patch | 254 | ||||
-rw-r--r-- | libc/debian/patches/series | 2 |
5 files changed, 259 insertions, 0 deletions
diff --git a/libc/debian/changelog b/libc/debian/changelog index 5b6ae47..a89e073 100644 --- a/libc/debian/changelog +++ b/libc/debian/changelog @@ -9,6 +9,7 @@ libc (2.10-11) UNRELEASED; urgency=low * stdlib.h includes alloca.h if _GNU_SOURCE or __EXTENSIONS__ * Add TEMP_FAILURE_RETRY to unistd.h (_GNU_SOURCE) * Implement memrchr() + * Implement rawmemchr() -- Igor Pashev <pashev.igor@gmail.com> Sat, 16 Feb 2013 23:09:40 +0000 diff --git a/libc/debian/libc1-illumos-i386.symbols b/libc/debian/libc1-illumos-i386.symbols index edf5de0..50f2e15 100644 --- a/libc/debian/libc1-illumos-i386.symbols +++ b/libc/debian/libc1-illumos-i386.symbols @@ -1974,6 +1974,7 @@ libc.so.1 libc1-illumos-i386 #MINVER# rand@SYSVABI_1.3 2.10-1 rand_r@SUNW_0.7 2.10-1 random@SUNW_0.9 2.10-1 + rawmemchr@DYSON_1 2.10-11 rctl_walk@SUNW_1.21 2.10-1 rctlblk_get_enforced_value@SUNW_1.21 2.10-1 rctlblk_get_firing_time@SUNW_1.21 2.10-1 diff --git a/libc/debian/libc1.symbols.illumos-amd64 b/libc/debian/libc1.symbols.illumos-amd64 index c4ad636..2568e12 100644 --- a/libc/debian/libc1.symbols.illumos-amd64 +++ b/libc/debian/libc1.symbols.illumos-amd64 @@ -1868,6 +1868,7 @@ libc.so.1 libc1 #MINVER# rand@SUNW_0.7 2.10-1 rand_r@SUNW_0.7 2.10-1 random@SUNW_0.9 2.10-1 + rawmemchr@DYSON_1 2.10-11 rctl_walk@SUNW_1.21 2.10-1 rctlblk_get_enforced_value@SUNW_1.21 2.10-1 rctlblk_get_firing_time@SUNW_1.21 2.10-1 diff --git a/libc/debian/patches/add-rawmemchr.patch b/libc/debian/patches/add-rawmemchr.patch new file mode 100644 index 0000000..96f36fa --- /dev/null +++ b/libc/debian/patches/add-rawmemchr.patch @@ -0,0 +1,254 @@ +Index: libc/usr/src/lib/libc/amd64/gen/rawmemchr.s +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ libc/usr/src/lib/libc/amd64/gen/rawmemchr.s 2013-03-07 18:13:25.149534019 +0000 +@@ -0,0 +1,96 @@ ++/* ++ * CDDL HEADER START ++ * ++ * The contents of this file are subject to the terms of the ++ * Common Development and Distribution License (the "License"). ++ * You may not use this file except in compliance with the License. ++ * ++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE ++ * or http://www.opensolaris.org/os/licensing. ++ * See the License for the specific language governing permissions ++ * and limitations under the License. ++ * ++ * When distributing Covered Code, include this CDDL HEADER in each ++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE. ++ * If applicable, add the following below this CDDL HEADER, with the ++ * fields enclosed by brackets "[]" replaced with your own identifying ++ * information: Portions Copyright [yyyy] [name of copyright owner] ++ * ++ * CDDL HEADER END ++ */ ++/* ++ * Copyright 2004 Sun Microsystems, Inc. All rights reserved. ++ * Use is subject to license terms. ++ */ ++ ++ .file "rawmemchr.s" ++ ++/ ++/ rawmemchr(sptr, c1) ++/ ++/ Returns the pointer in sptr at which the character c1 appears; ++/ doesn't stop at all ++/ ++/ Fast assembly language version of the following C-program memchr ++/ which represents the `standard' for the C-library. ++/ ++/ void * ++/ rawmemchr(const void *sptr, int c1) ++/ { ++/ unsigned char c = (unsigned char)c1; ++/ const unsigned char *sp = sptr; ++/ ++/ do { ++/ if (*sp++ == c) ++/ return ((void *)--sp); ++/ } while (1); ++/ return (NULL); ++/ } ++/ ++ ++#include "SYS.h" ++ ++ .globl rawmemchr ++ .align 4 ++ ++ ENTRY(rawmemchr) /* (void *s, uchar_t c) */ ++ movl %esi, %eax / move "c" to %eax ++ testq $3, %rdi / if %rdi not word aligned ++ jnz .L2 / goto .L2 ++ .align 4 ++.L3: ++ movl (%rdi), %ecx / move 1 word from (%rdi) to %ecx ++ cmpb %cl, %al / if the first byte is %al ++ je .L4 / goto .L4 (found) ++ cmpb %ch, %al / if the second byte is %al ++ je .L5 / goto .L5 (found) ++ shrl $16, %ecx / right shift 16-bit ++ cmpb %cl, %al / if the third byte is %al ++ je .L6 / goto .L6 (found) ++ cmpb %ch, %al / if the fourth is %al ++ je .L7 / goto .L7 (found) ++ addq $4, %rdi / next word ++ jmp .L3 / goto .L3 ++ .align 4 ++.L2: ++ cmpb (%rdi), %al / if a byte in (%rdi) is %al ++ je .L4 / goto .L4 (found) ++ incq %rdi / next byte ++ testq $3, %rdi / if %rdi not word aligned ++ jnz .L2 / goto .L2 ++ jmp .L3 / goto .L3 ++ .align 4 ++.L7: ++ / found at the fourth byte ++ incq %rdi ++.L6: ++ / found at the third byte ++ incq %rdi ++.L5: ++ / found at the second byte ++ incq %rdi ++.L4: ++ / found at the first byte ++ movq %rdi,%rax ++ ret ++ SET_SIZE(rawmemchr) +Index: libc/usr/src/lib/libc/amd64/Makefile +=================================================================== +--- libc.orig/usr/src/lib/libc/amd64/Makefile 2013-03-07 16:49:21.817900285 +0000 ++++ libc/usr/src/lib/libc/amd64/Makefile 2013-03-07 16:49:22.026209778 +0000 +@@ -120,6 +120,7 @@ + new_list.o \ + proc64_id.o \ + proc64_support.o \ ++ rawmemchr.o \ + setjmp.o \ + siginfolst.o \ + siglongjmp.o \ +Index: libc/usr/src/lib/libc/port/mapfile-vers +=================================================================== +--- libc.orig/usr/src/lib/libc/port/mapfile-vers 2013-03-07 16:49:21.824854359 +0000 ++++ libc/usr/src/lib/libc/port/mapfile-vers 2013-03-07 16:49:22.030855670 +0000 +@@ -102,6 +102,7 @@ + memrchr; + program_invocation_name; + program_invocation_short_name; ++ rawmemchr; + } ILLUMOS_0.3; + + SYMBOL_VERSION ILLUMOS_0.3 { # Illumos additions +Index: libc/usr/src/lib/libc/i386/gen/rawmemchr.s +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ libc/usr/src/lib/libc/i386/gen/rawmemchr.s 2013-03-07 16:49:22.033397440 +0000 +@@ -0,0 +1,100 @@ ++/* ++ * CDDL HEADER START ++ * ++ * The contents of this file are subject to the terms of the ++ * Common Development and Distribution License (the "License"). ++ * You may not use this file except in compliance with the License. ++ * ++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE ++ * or http://www.opensolaris.org/os/licensing. ++ * See the License for the specific language governing permissions ++ * and limitations under the License. ++ * ++ * When distributing Covered Code, include this CDDL HEADER in each ++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE. ++ * If applicable, add the following below this CDDL HEADER, with the ++ * fields enclosed by brackets "[]" replaced with your own identifying ++ * information: Portions Copyright [yyyy] [name of copyright owner] ++ * ++ * CDDL HEADER END ++ */ ++/* ++ * Copyright 2004 Sun Microsystems, Inc. All rights reserved. ++ * Use is subject to license terms. ++ */ ++ ++ .file "rawmemchr.s" ++ ++/ ++/ rawmemchr(sptr, c1) ++/ ++/ Returns the pointer in sptr at which the character c1 appears; ++/ doesn't stop at all ++/ ++/ Fast assembly language version of the following C-program memchr ++/ which represents the `standard' for the C-library. ++/ ++/ void * ++/ rawmemchr(const void *sptr, int c1) ++/ { ++/ unsigned char c = (unsigned char)c1; ++/ const unsigned char *sp = sptr; ++/ ++/ do { ++/ if (*sp++ == c) ++/ return ((void *)--sp); ++/ } while (1); ++/ return (NULL); ++/ } ++/ ++ ++#include "SYS.h" ++ ++ .globl rawmemchr ++ .align 4 ++ ++ ENTRY(rawmemchr) ++ pushl %edi / save register variable ++ movl 8(%esp), %eax / %eax = string address ++ movl 12(%esp), %ecx / %cl = byte that is sought ++ testl $3, %eax / if %eax not word aligned ++ jnz .L2 / goto .L2 ++ .align 4 ++.L3: ++ movl (%eax), %edx / move 1 word from (%eax) to %edx ++ cmpb %dl, %cl / if the first byte is %cl ++ je .L4 / goto .L4 (found) ++ cmpb %dh, %cl / if the second byte is %cl ++ je .L5 / goto .L5 (found) ++ shrl $16, %edx / right shift 16-bit ++ cmpb %dl, %cl / if the third byte is %cl ++ je .L6 / goto .L6 (found) ++ cmpb %dh, %cl / if the fourth is %cl ++ je .L7 / goto .L7 (found) ++ subl $4, %edi / decrement number of bytes by 4 ++ addl $4, %eax / next word ++ cmpl $4, %edi / if number of bytes >= 4 ++ jae .L3 / goto .L3 ++ .align 4 ++.L2: ++ cmpb (%eax), %cl / if a byte in (%eax) is %cl ++ je .L4 / goto .L4 (found) ++ incl %eax / next byte ++ testl $3, %eax / if %eax not word aligned ++ jnz .L2 / goto .L2 ++ jmp .L3 / goto .L3 ++ .align 4 ++.L7: ++ / found at the fourth byte ++ incl %eax ++.L6: ++ / found at the third byte ++ incl %eax ++.L5: ++ / found at the second byte ++ incl %eax ++.L4: ++ / found at the first byte ++ popl %edi / restore register variable ++ ret ++ SET_SIZE(rawmemchr) +Index: libc/usr/src/lib/libc/i386/Makefile.com +=================================================================== +--- libc.orig/usr/src/lib/libc/i386/Makefile.com 2013-03-07 16:49:21.820634465 +0000 ++++ libc/usr/src/lib/libc/i386/Makefile.com 2013-03-07 16:49:22.035261818 +0000 +@@ -130,6 +130,7 @@ + memcpy.o \ + memset.o \ + new_list.o \ ++ rawmemchr.o \ + setjmp.o \ + siginfolst.o \ + siglongjmp.o \ +Index: libc/usr/src/head/string.h +=================================================================== +--- libc.orig/usr/src/head/string.h 2013-03-07 16:49:21.812980489 +0000 ++++ libc/usr/src/head/string.h 2013-03-07 16:49:22.037541443 +0000 +@@ -127,6 +127,7 @@ + #define __mempcpy mempcpy + extern void *mempcpy(void *, const void *, size_t); + extern void *memrchr(const void *, int, size_t); ++extern void *rawmemchr(const void *, int); + #endif + + #if defined(__EXTENSIONS__) || \ diff --git a/libc/debian/patches/series b/libc/debian/patches/series index 5aaad01..78079c5 100644 --- a/libc/debian/patches/series +++ b/libc/debian/patches/series @@ -68,3 +68,5 @@ libc-add-flock.patch stdlib-includes-alloca.patch add-TEMP_FAILURE_RETRY.patch add-memrchr.patch +add-rawmemchr.patch +rpcinfo-MAX.patch |