summaryrefslogtreecommitdiffstats
path: root/qemu/roms/SLOF/lib/libc/string
diff options
context:
space:
mode:
authorRajithaY <rajithax.yerrumsetty@intel.com>2017-04-25 03:31:15 -0700
committerRajitha Yerrumchetty <rajithax.yerrumsetty@intel.com>2017-05-22 06:48:08 +0000
commitbb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch)
treeca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/SLOF/lib/libc/string
parenta14b48d18a9ed03ec191cf16b162206998a895ce (diff)
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to kvmfornfv repo and make use of the updated latest qemu for the execution of all testcase Change-Id: I1280af507a857675c7f81d30c95255635667bdd7 Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/SLOF/lib/libc/string')
-rw-r--r--qemu/roms/SLOF/lib/libc/string/Makefile.inc22
-rw-r--r--qemu/roms/SLOF/lib/libc/string/memchr.c29
-rw-r--r--qemu/roms/SLOF/lib/libc/string/memcmp.c30
-rw-r--r--qemu/roms/SLOF/lib/libc/string/memcpy.c27
-rw-r--r--qemu/roms/SLOF/lib/libc/string/memmove.c42
-rw-r--r--qemu/roms/SLOF/lib/libc/string/memset.c25
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strcasecmp.c28
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strcat.c24
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strchr.c28
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strcmp.c28
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strcpy.c25
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strlen.c27
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strncasecmp.c32
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strncmp.c31
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strncpy.c33
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strstr.c37
-rw-r--r--qemu/roms/SLOF/lib/libc/string/strtok.c45
17 files changed, 0 insertions, 513 deletions
diff --git a/qemu/roms/SLOF/lib/libc/string/Makefile.inc b/qemu/roms/SLOF/lib/libc/string/Makefile.inc
deleted file mode 100644
index 7ccf3c405..000000000
--- a/qemu/roms/SLOF/lib/libc/string/Makefile.inc
+++ /dev/null
@@ -1,22 +0,0 @@
-# *****************************************************************************
-# * Copyright (c) 2004, 2008 IBM Corporation
-# * All rights reserved.
-# * This program and the accompanying materials
-# * are made available under the terms of the BSD License
-# * which accompanies this distribution, and is available at
-# * http://www.opensource.org/licenses/bsd-license.php
-# *
-# * Contributors:
-# * IBM Corporation - initial implementation
-# ****************************************************************************/
-
-
-STRING_SRC_C = strcat.c strchr.c strcmp.c strcpy.c strlen.c strncmp.c \
- strncpy.c strstr.c memset.c memcpy.c memmove.c memchr.c \
- memcmp.c strcasecmp.c strncasecmp.c strtok.c
-STRING_SRC_ASM =
-STRING_SRCS = $(STRING_SRC_C:%=$(STRINGCMNDIR)/%) $(STRING_SRC_ASM:%=$(STRINGCMNDIR)/%)
-STRING_OBJS = $(STRING_SRC_C:%.c=%.o) $(STRING_SRC_ASM:%.S=%.o)
-
-%.o : $(STRINGCMNDIR)/%.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
diff --git a/qemu/roms/SLOF/lib/libc/string/memchr.c b/qemu/roms/SLOF/lib/libc/string/memchr.c
deleted file mode 100644
index c3fe751c6..000000000
--- a/qemu/roms/SLOF/lib/libc/string/memchr.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include "string.h"
-
-
-void *
-memchr(const void *ptr, int c, size_t n)
-{
- unsigned char ch = (unsigned char)c;
- const unsigned char *p = ptr;
-
- while (n-- > 0) {
- if (*p == ch)
- return (void *)p;
- p += 1;
- }
-
- return NULL;
-}
diff --git a/qemu/roms/SLOF/lib/libc/string/memcmp.c b/qemu/roms/SLOF/lib/libc/string/memcmp.c
deleted file mode 100644
index 3b69cefb9..000000000
--- a/qemu/roms/SLOF/lib/libc/string/memcmp.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include "string.h"
-
-
-int
-memcmp(const void *ptr1, const void *ptr2, size_t n)
-{
- const unsigned char *p1 = ptr1;
- const unsigned char *p2 = ptr2;
-
- while (n-- > 0) {
- if (*p1 != *p2)
- return (*p1 - *p2);
- p1 += 1;
- p2 += 1;
- }
-
- return 0;
-}
diff --git a/qemu/roms/SLOF/lib/libc/string/memcpy.c b/qemu/roms/SLOF/lib/libc/string/memcpy.c
deleted file mode 100644
index 00f419b80..000000000
--- a/qemu/roms/SLOF/lib/libc/string/memcpy.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include "string.h"
-
-void *
-memcpy(void *dest, const void *src, size_t n)
-{
- char *cdest;
- const char *csrc = src;
-
- cdest = dest;
- while (n-- > 0) {
- *cdest++ = *csrc++;
- }
-
- return dest;
-}
diff --git a/qemu/roms/SLOF/lib/libc/string/memmove.c b/qemu/roms/SLOF/lib/libc/string/memmove.c
deleted file mode 100644
index 3acf1a973..000000000
--- a/qemu/roms/SLOF/lib/libc/string/memmove.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include "string.h"
-
-
-void *
-memmove(void *dest, const void *src, size_t n)
-{
- char *cdest;
- const char *csrc;
- int i;
-
- /* Do the buffers overlap in a bad way? */
- if (src < dest && src + n >= dest) {
- /* Copy from end to start */
- cdest = dest + n - 1;
- csrc = src + n - 1;
- for (i = 0; i < n; i++) {
- *cdest-- = *csrc--;
- }
- }
- else {
- /* Normal copy is possible */
- cdest = dest;
- csrc = src;
- for (i = 0; i < n; i++) {
- *cdest++ = *csrc++;
- }
- }
-
- return dest;
-}
diff --git a/qemu/roms/SLOF/lib/libc/string/memset.c b/qemu/roms/SLOF/lib/libc/string/memset.c
deleted file mode 100644
index f8dfbf524..000000000
--- a/qemu/roms/SLOF/lib/libc/string/memset.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include "string.h"
-
-void *
-memset(void *dest, int c, size_t size)
-{
- unsigned char *d = (unsigned char *)dest;
-
- while (size-- > 0) {
- *d++ = (unsigned char)c;
- }
-
- return dest;
-}
diff --git a/qemu/roms/SLOF/lib/libc/string/strcasecmp.c b/qemu/roms/SLOF/lib/libc/string/strcasecmp.c
deleted file mode 100644
index f75294fb9..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strcasecmp.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-#include <ctype.h>
-
-int
-strcasecmp(const char *s1, const char *s2)
-{
- while (*s1 != 0 && *s2 != 0) {
- if (toupper(*s1) != toupper(*s2))
- break;
- ++s1;
- ++s2;
- }
-
- return *s1 - *s2;
-}
-
diff --git a/qemu/roms/SLOF/lib/libc/string/strcat.c b/qemu/roms/SLOF/lib/libc/string/strcat.c
deleted file mode 100644
index eb597a025..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strcat.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-
-char *
-strcat(char *dst, const char *src)
-{
- int p;
-
- p = strlen(dst);
- strcpy(&dst[p], src);
-
- return dst;
-}
diff --git a/qemu/roms/SLOF/lib/libc/string/strchr.c b/qemu/roms/SLOF/lib/libc/string/strchr.c
deleted file mode 100644
index 528a319c9..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strchr.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-
-char *
-strchr(const char *s, int c)
-{
- char cb = c;
-
- while (*s != 0) {
- if (*s == cb) {
- return (char *)s;
- }
- s += 1;
- }
-
- return NULL;
-}
diff --git a/qemu/roms/SLOF/lib/libc/string/strcmp.c b/qemu/roms/SLOF/lib/libc/string/strcmp.c
deleted file mode 100644
index 48eaed246..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strcmp.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-
-
-int
-strcmp(const char *s1, const char *s2)
-{
- while (*s1 != 0 && *s2 != 0) {
- if (*s1 != *s2)
- break;
- s1 += 1;
- s2 += 1;
- }
-
- return *s1 - *s2;
-}
-
diff --git a/qemu/roms/SLOF/lib/libc/string/strcpy.c b/qemu/roms/SLOF/lib/libc/string/strcpy.c
deleted file mode 100644
index 48eb62cb5..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strcpy.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-
-char *
-strcpy(char *dst, const char *src)
-{
- char *ptr = dst;
-
- do {
- *ptr++ = *src;
- } while (*src++ != 0);
-
- return dst;
-}
diff --git a/qemu/roms/SLOF/lib/libc/string/strlen.c b/qemu/roms/SLOF/lib/libc/string/strlen.c
deleted file mode 100644
index 37a1b7812..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strlen.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-
-size_t
-strlen(const char *s)
-{
- int len = 0;
-
- while (*s != 0) {
- len += 1;
- s += 1;
- }
-
- return len;
-}
-
diff --git a/qemu/roms/SLOF/lib/libc/string/strncasecmp.c b/qemu/roms/SLOF/lib/libc/string/strncasecmp.c
deleted file mode 100644
index 4140931e3..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strncasecmp.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-#include <ctype.h>
-
-
-int
-strncasecmp(const char *s1, const char *s2, size_t n)
-{
- if (n < 1)
- return 0;
-
- while (*s1 != 0 && *s2 != 0 && --n > 0) {
- if (toupper(*s1) != toupper(*s2))
- break;
- ++s1;
- ++s2;
- }
-
- return toupper(*s1) - toupper(*s2);
-}
-
diff --git a/qemu/roms/SLOF/lib/libc/string/strncmp.c b/qemu/roms/SLOF/lib/libc/string/strncmp.c
deleted file mode 100644
index a886736a9..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strncmp.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-
-
-int
-strncmp(const char *s1, const char *s2, size_t n)
-{
- if (n < 1)
- return 0;
-
- while (*s1 != 0 && *s2 != 0 && --n > 0) {
- if (*s1 != *s2)
- break;
- s1 += 1;
- s2 += 1;
- }
-
- return *s1 - *s2;
-}
-
diff --git a/qemu/roms/SLOF/lib/libc/string/strncpy.c b/qemu/roms/SLOF/lib/libc/string/strncpy.c
deleted file mode 100644
index 0f41f93c9..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strncpy.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-
-char *
-strncpy(char *dst, const char *src, size_t n)
-{
- char *ret = dst;
-
- /* Copy string */
- while (*src != 0 && n > 0) {
- *dst++ = *src++;
- n -= 1;
- }
-
- /* strncpy always clears the rest of destination string... */
- while (n > 0) {
- *dst++ = 0;
- n -= 1;
- }
-
- return ret;
-}
diff --git a/qemu/roms/SLOF/lib/libc/string/strstr.c b/qemu/roms/SLOF/lib/libc/string/strstr.c
deleted file mode 100644
index 3e090d2c5..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strstr.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-
-char *
-strstr(const char *hay, const char *needle)
-{
- char *pos;
- int hlen, nlen;
-
- if (hay == NULL || needle == NULL)
- return NULL;
-
- hlen = strlen(hay);
- nlen = strlen(needle);
- if (nlen < 1)
- return (char *)hay;
-
- for (pos = (char *)hay; pos < hay + hlen; pos++) {
- if (strncmp(pos, needle, nlen) == 0) {
- return pos;
- }
- }
-
- return NULL;
-}
-
diff --git a/qemu/roms/SLOF/lib/libc/string/strtok.c b/qemu/roms/SLOF/lib/libc/string/strtok.c
deleted file mode 100644
index 665c08db6..000000000
--- a/qemu/roms/SLOF/lib/libc/string/strtok.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation
- * All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the BSD License
- * which accompanies this distribution, and is available at
- * http://www.opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *****************************************************************************/
-
-#include <string.h>
-
-char *
-strtok(char *src, const char *pattern)
-{
- static char *nxtTok;
- char *retVal = NULL;
-
- if (!src)
- src = nxtTok;
-
- while (*src) {
- const char *pp = pattern;
- while (*pp) {
- if (*pp == *src) {
- break;
- }
- pp++;
- }
- if (!*pp) {
- if (!retVal)
- retVal = src;
- else if (!src[-1])
- break;
- } else
- *src = '\0';
- src++;
- }
-
- nxtTok = src;
-
- return retVal;
-}