summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/i386/gen/divsi3.S50
-rw-r--r--lib/libc/i386/gen/fixdfsi.S24
-rw-r--r--lib/libc/i386/gen/fixunsdfsi.S68
-rw-r--r--lib/libc/i386/gen/udivsi3.S50
-rw-r--r--lib/libc/locale/common_rune.h3
-rw-r--r--lib/libc/locale/common_setlocale.c64
-rw-r--r--lib/libc/locale/common_setlocale.h14
-rw-r--r--lib/libc/locale/read_runemagi.c133
-rw-r--r--lib/libc/locale/startup_setlocale.c198
9 files changed, 0 insertions, 604 deletions
diff --git a/lib/libc/i386/gen/divsi3.S b/lib/libc/i386/gen/divsi3.S
deleted file mode 100644
index 3b09580..0000000
--- a/lib/libc/i386/gen/divsi3.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-#if defined(LIBC_RCS) && !defined(lint)
- .text
- .asciz "$Id$"
-#endif /* LIBC_RCS and not lint */
-
- .globl ___divsi3
- .type ___divsi3,@function
-___divsi3:
- movl 4(%esp),%eax
- cltd
- idivl 8(%esp)
- ret
diff --git a/lib/libc/i386/gen/fixdfsi.S b/lib/libc/i386/gen/fixdfsi.S
deleted file mode 100644
index 398506c..0000000
--- a/lib/libc/i386/gen/fixdfsi.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * $Id$
- */
-
- .file "__fixdfsi.s"
-.text
- .align 2
-.globl ___fixdfsi
-.type ___fixdfsi,@function
-___fixdfsi:
- pushl %ebp
- movl %esp,%ebp
- subl $12,%esp
- fstcw -4(%ebp)
- movw -4(%ebp),%ax
- orw $0x0c00,%ax
- movw %ax,-2(%ebp)
- fldcw -2(%ebp)
- fldl 8(%ebp)
- fistpl -12(%ebp)
- fldcw -4(%ebp)
- movl -12(%ebp),%eax
- leave
- ret
diff --git a/lib/libc/i386/gen/fixunsdfsi.S b/lib/libc/i386/gen/fixunsdfsi.S
deleted file mode 100644
index eb576ba..0000000
--- a/lib/libc/i386/gen/fixunsdfsi.S
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)fixunsdfsi.s 5.1 12/17/90
- * $Id: fixunsdfsi.S,v 1.2 1994/12/27 13:37:38 bde Exp $
- */
-
-#if defined(LIBC_RCS) && !defined(lint)
- .text
- .asciz "$Id: fixunsdfsi.S,v 1.2 1994/12/27 13:37:38 bde Exp $"
-#endif /* LIBC_RCS and not lint */
-
-#include "DEFS.h"
-
-ENTRY(__fixunsdfsi)
- fldl 4(%esp)
- fnstcw 4(%esp)
- movl 4(%esp),%eax
- orb $(3 << 2),%ah # change rounding mode bitfield to 3 (chop)
- movl %eax,8(%esp)
- fldcw 8(%esp)
- subl $8,%esp
- fistpq (%esp) # convert to 64 bit integer
- popl %eax
- popl %edx # discard top 32 bits
- fldcw 4(%esp)
- ret
-
-/*
- * XXX - we are sloppy about overflow, the same as gcc-2. Values too big
- * for a 64-bit (signed) integer cause an overflow trap or are silently
- * converted to 0 if the overflow trap is masked. The remaining values
- * too big for a 32-bit (unsigned) integer are silently truncated to 32
- * bits. Negative values are converted like negative ints (no overflow)
- * if they fit in 32 bits.
- */
diff --git a/lib/libc/i386/gen/udivsi3.S b/lib/libc/i386/gen/udivsi3.S
deleted file mode 100644
index 55a326b..0000000
--- a/lib/libc/i386/gen/udivsi3.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-#if defined(LIBC_RCS) && !defined(lint)
- .text
- .asciz "$Id$"
-#endif /* LIBC_RCS and not lint */
-
- .globl ___udivsi3
- .type ___udivsi3,@function
-___udivsi3:
- movl 4(%esp),%eax
- xorl %edx,%edx
- divl 8(%esp)
- ret
diff --git a/lib/libc/locale/common_rune.h b/lib/libc/locale/common_rune.h
deleted file mode 100644
index 9dcd5f3..0000000
--- a/lib/libc/locale/common_rune.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define PathLocale _PathLocale
-
-extern _RuneLocale *_Read_RuneMagi __P((FILE *));
diff --git a/lib/libc/locale/common_setlocale.c b/lib/libc/locale/common_setlocale.c
deleted file mode 100644
index 2dd549f..0000000
--- a/lib/libc/locale/common_setlocale.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#include <locale.h>
-#include <string.h>
-
-/*
- * Category names for getenv()
- */
-char *_categories[_LC_LAST] = {
- "LC_ALL",
- "LC_COLLATE",
- "LC_CTYPE",
- "LC_MONETARY",
- "LC_NUMERIC",
- "LC_TIME",
-};
-
-/*
- * Current locales for each category
- */
-char _current_categories[_LC_LAST][32] = {
- "C",
- "C",
- "C",
- "C",
- "C",
- "C",
-};
-
-/*
- * The locales we are going to try and load
- */
-char _new_categories[_LC_LAST][32];
-
-char _current_locale_string[_LC_LAST * 33];
-
-char *
-_currentlocale()
-{
- int i, len;
-
- (void)strcpy(_current_locale_string, _current_categories[1]);
-
- for (i = 2; i < _LC_LAST; ++i)
- if (strcmp(_current_categories[1], _current_categories[i])) {
- len = strlen(_current_categories[1]) + 1 +
- strlen(_current_categories[2]) + 1 +
- strlen(_current_categories[3]) + 1 +
- strlen(_current_categories[4]) + 1 +
- strlen(_current_categories[5]) + 1;
- if (len > sizeof(_current_locale_string))
- return NULL;
- (void) strcpy(_current_locale_string, _current_categories[1]);
- (void) strcat(_current_locale_string, "/");
- (void) strcat(_current_locale_string, _current_categories[2]);
- (void) strcat(_current_locale_string, "/");
- (void) strcat(_current_locale_string, _current_categories[3]);
- (void) strcat(_current_locale_string, "/");
- (void) strcat(_current_locale_string, _current_categories[4]);
- (void) strcat(_current_locale_string, "/");
- (void) strcat(_current_locale_string, _current_categories[5]);
- break;
- }
- return (_current_locale_string);
-}
-
diff --git a/lib/libc/locale/common_setlocale.h b/lib/libc/locale/common_setlocale.h
deleted file mode 100644
index 24b4f31..0000000
--- a/lib/libc/locale/common_setlocale.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#define categories _categories
-extern char *_categories[_LC_LAST];
-
-#define current_categories _current_categories
-extern char _current_categories[_LC_LAST][32];
-
-#define new_categories _new_categories
-extern char _new_categories[_LC_LAST][32];
-
-#define current_locale_string _current_locale_string
-extern char _current_locale_string[_LC_LAST * 33];
-
-#define currentlocale _currentlocale
-extern char *_currentlocale __P((void));
diff --git a/lib/libc/locale/read_runemagi.c b/lib/libc/locale/read_runemagi.c
deleted file mode 100644
index 2d63992..0000000
--- a/lib/libc/locale/read_runemagi.c
+++ /dev/null
@@ -1,133 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <rune.h>
-#include <stdlib.h>
-
-_RuneLocale *
-_Read_RuneMagi(fp)
- FILE *fp;
-{
- char *data;
- void *lastp;
- _RuneLocale *rl;
- _RuneEntry *rr;
- struct stat sb;
- int x;
-
- if (fstat(fileno(fp), &sb) < 0)
- return(0);
-
- if (sb.st_size < sizeof(_RuneLocale))
- return(0);
-
- if ((data = malloc(sb.st_size)) == NULL)
- return(0);
-
- rewind(fp); /* Someone might have read the magic number once already */
-
- if (fread(data, sb.st_size, 1, fp) != 1) {
- free(data);
- return(0);
- }
-
- rl = (_RuneLocale *)data;
- lastp = data + sb.st_size;
-
- rl->variable = rl + 1;
-
- if (memcmp(rl->magic, _RUNE_MAGIC_1, sizeof(rl->magic))) {
- free(data);
- return(0);
- }
-
- rl->invalid_rune = ntohl(rl->invalid_rune);
- rl->variable_len = ntohl(rl->variable_len);
- rl->runetype_ext.nranges = ntohl(rl->runetype_ext.nranges);
- rl->maplower_ext.nranges = ntohl(rl->maplower_ext.nranges);
- rl->mapupper_ext.nranges = ntohl(rl->mapupper_ext.nranges);
-
- for (x = 0; x < _CACHED_RUNES; ++x) {
- rl->runetype[x] = ntohl(rl->runetype[x]);
- rl->maplower[x] = ntohl(rl->maplower[x]);
- rl->mapupper[x] = ntohl(rl->mapupper[x]);
- }
-
- rl->runetype_ext.ranges = (_RuneEntry *)rl->variable;
- rl->variable = rl->runetype_ext.ranges + rl->runetype_ext.nranges;
- if (rl->variable > lastp) {
- free(data);
- return(0);
- }
-
- rl->maplower_ext.ranges = (_RuneEntry *)rl->variable;
- rl->variable = rl->maplower_ext.ranges + rl->maplower_ext.nranges;
- if (rl->variable > lastp) {
- free(data);
- return(0);
- }
-
- rl->mapupper_ext.ranges = (_RuneEntry *)rl->variable;
- rl->variable = rl->mapupper_ext.ranges + rl->mapupper_ext.nranges;
- if (rl->variable > lastp) {
- free(data);
- return(0);
- }
-
- for (x = 0; x < rl->runetype_ext.nranges; ++x) {
- rr = rl->runetype_ext.ranges;
-
- rr[x].min = ntohl(rr[x].min);
- rr[x].max = ntohl(rr[x].max);
- if ((rr[x].map = ntohl(rr[x].map)) == 0) {
- int len = rr[x].max - rr[x].min + 1;
- rr[x].types = rl->variable;
- rl->variable = rr[x].types + len;
- if (rl->variable > lastp) {
- free(data);
- return(0);
- }
- while (len-- > 0)
- rr[x].types[len] = ntohl(rr[x].types[len]);
- } else
- rr[x].types = 0;
- }
-
- for (x = 0; x < rl->maplower_ext.nranges; ++x) {
- rr = rl->maplower_ext.ranges;
-
- rr[x].min = ntohl(rr[x].min);
- rr[x].max = ntohl(rr[x].max);
- rr[x].map = ntohl(rr[x].map);
- }
-
- for (x = 0; x < rl->mapupper_ext.nranges; ++x) {
- rr = rl->mapupper_ext.ranges;
-
- rr[x].min = ntohl(rr[x].min);
- rr[x].max = ntohl(rr[x].max);
- rr[x].map = ntohl(rr[x].map);
- }
- if (((char *)rl->variable) + rl->variable_len > (char *)lastp) {
- free(data);
- return(0);
- }
-
- /*
- * Go out and zero pointers that should be zero.
- */
- if (!rl->variable_len)
- rl->variable = 0;
-
- if (!rl->runetype_ext.nranges)
- rl->runetype_ext.ranges = 0;
-
- if (!rl->maplower_ext.nranges)
- rl->maplower_ext.ranges = 0;
-
- if (!rl->mapupper_ext.nranges)
- rl->mapupper_ext.ranges = 0;
-
- return(rl);
-}
-
diff --git a/lib/libc/locale/startup_setlocale.c b/lib/libc/locale/startup_setlocale.c
deleted file mode 100644
index 01a6770..0000000
--- a/lib/libc/locale/startup_setlocale.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* It is reduced version for use in crt0.c (only 8 bit locales) */
-
-#include <limits.h>
-#include <locale.h>
-#include <rune.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include "common_setlocale.h"
-#include "common_rune.h"
-
-char *_PathLocale;
-
-extern int _none_init __P((_RuneLocale *));
-static char *loadlocale __P((int));
-static int startup_setrunelocale __P((char *));
-
-void
-_startup_setlocale(category, locale)
- int category;
- const char *locale;
-{
- int found, i, len;
- char *env, *r;
-
- if (!PathLocale && !(PathLocale = getenv("PATH_LOCALE")))
- PathLocale = _PATH_LOCALE;
-
- if (category < 0 || category >= _LC_LAST)
- return;
-
- if (!locale) {
- if (!category)
- (void) currentlocale();
- return;
- }
-
- /*
- * Default to the current locale for everything.
- */
- for (i = 1; i < _LC_LAST; ++i)
- (void)strcpy(new_categories[i], current_categories[i]);
-
- /*
- * Now go fill up new_categories from the locale argument
- */
- if (!*locale) {
- env = getenv(categories[category]);
-
- if (!env)
- env = getenv(categories[0]);
-
- if (!env)
- env = getenv("LANG");
-
- if (!env)
- env = "C";
-
- (void) strncpy(new_categories[category], env, 31);
- new_categories[category][31] = 0;
- if (!category) {
- for (i = 1; i < _LC_LAST; ++i) {
- if (!(env = getenv(categories[i])))
- env = new_categories[0];
- (void)strncpy(new_categories[i], env, 31);
- new_categories[i][31] = 0;
- }
- }
- } else if (category) {
- (void)strncpy(new_categories[category], locale, 31);
- new_categories[category][31] = 0;
- } else {
- if ((r = strchr(locale, '/')) == 0) {
- for (i = 1; i < _LC_LAST; ++i) {
- (void)strncpy(new_categories[i], locale, 31);
- new_categories[i][31] = 0;
- }
- } else {
- for (i = 1; r[1] == '/'; ++r);
- if (!r[1])
- return; /* Hmm, just slashes... */
- do {
- len = r - locale > 31 ? 31 : r - locale;
- (void)strncpy(new_categories[i++], locale, len);
- new_categories[i++][len] = 0;
- locale = r;
- while (*locale == '/')
- ++locale;
- while (*++r && *r != '/');
- } while (*locale);
- while (i < _LC_LAST)
- (void)strcpy(new_categories[i],
- new_categories[i-1]);
- }
- }
-
- if (category) {
- (void) loadlocale(category);
- return;
- }
-
- found = 0;
- for (i = 1; i < _LC_LAST; ++i)
- if (loadlocale(i) != NULL)
- found = 1;
- if (found)
- (void) currentlocale();
-}
-
-static char *
-loadlocale(category)
- int category;
-{
- if (strcmp(new_categories[category],
- current_categories[category]) == 0)
- return (current_categories[category]);
-
- if (category == LC_CTYPE) {
- if (startup_setrunelocale(new_categories[LC_CTYPE]))
- return (NULL);
- (void)strcpy(current_categories[LC_CTYPE],
- new_categories[LC_CTYPE]);
- return (current_categories[LC_CTYPE]);
- }
-
- if (category == LC_COLLATE) {
- if (__collate_load_tables(new_categories[LC_COLLATE]) < 0)
- return (NULL);
- (void)strcpy(current_categories[LC_COLLATE],
- new_categories[LC_COLLATE]);
- return (current_categories[LC_COLLATE]);
- }
-
- if (category == LC_TIME) {
- if (__time_load_locale(new_categories[LC_TIME]) < 0)
- return (NULL);
- (void)strcpy(current_categories[LC_TIME],
- new_categories[LC_TIME]);
- return (current_categories[LC_TIME]);
- }
-
- if (!strcmp(new_categories[category], "C") ||
- !strcmp(new_categories[category], "POSIX")) {
-
- /*
- * Some day this will need to reset the locale to the default
- * C locale. Since we have no way to change them as of yet,
- * there is no need to reset them.
- */
- (void)strcpy(current_categories[category],
- new_categories[category]);
- return (current_categories[category]);
- }
-
- return NULL;
-}
-
-static int
-startup_setrunelocale(encoding)
- char *encoding;
-{
- FILE *fp;
- char name[PATH_MAX];
- _RuneLocale *rl;
-
- if (!encoding)
- return(EFAULT);
-
- /*
- * The "C" and "POSIX" locale are always here.
- */
- if (!strcmp(encoding, "C") || !strcmp(encoding, "POSIX")) {
- _CurrentRuneLocale = &_DefaultRuneLocale;
- return(0);
- }
-
- (void) strcpy(name, PathLocale);
- (void) strcat(name, "/");
- (void) strcat(name, encoding);
- (void) strcat(name, "/LC_CTYPE");
-
- if ((fp = fopen(name, "r")) == NULL)
- return(ENOENT);
-
- if ((rl = _Read_RuneMagi(fp)) == 0) {
- fclose(fp);
- return(EFTYPE);
- }
- fclose(fp);
-
- if (!rl->encoding[0])
- return(EINVAL);
- else if (!strcmp(rl->encoding, "NONE"))
- return(_none_init(rl));
- else
- return(EINVAL);
-}
-
OpenPOWER on IntegriCloud