Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1620 → Rev 1621

/shark/branches/xen/libc/stdio/vfprintf.c
35,7 → 35,7
*/
 
/* MODIFIED:
* --added include <ll/math.h>
* --added include <arch/math.h>
* --initialization to prevent warnings
*/
 
82,18 → 82,18
# undef _ANSI_SOURCE
# if defined(_POSIX_SOURCE)
# undef _POSIX_SOURCE
# include <ll/math.h>
# include <arch/math.h>
# define _POSIX_SOURCE
# else
# include <ll/math.h>
# include <arch/math.h>
# endif
# define _ANSI_SOURCE
# elif defined(_POSIX_SOURCE)
# undef _POSIX_SOURCE
# include <ll/math.h>
# include <arch/math.h>
# define _POSIX_SOURCE
# else
# include <ll/math.h>
# include <arch/math.h>
# endif
#endif
 
/shark/branches/xen/libc/string/strcasecmp.c
50,8 → 50,8
 
 
 
#include <ll/i386/string.h>
#include <ll/ctype.h>
#include <arch/i386/string.h>
#include <arch/ctype.h>
 
int strcasecmp(const char *s1, const char *s2)
{
/shark/branches/xen/libc/arch/x86/ioformat/ksprintf.c
19,12 → 19,12
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/stdlib.h>
#include <ll/i386/string.h>
#include <ll/i386/limits.h>
#include <ll/i386/float.h>
#include <arch/i386/stdlib.h>
#include <arch/i386/string.h>
#include <arch/i386/limits.h>
#include <arch/i386/float.h>
#include <ll/i386/mem.h>
#include <ll/stdarg.h>
#include <arch/stdarg.h>
#include "sprintf.h"
 
FILE(ksprintf);
/shark/branches/xen/libc/arch/x86/ioformat/ecvt.c
20,14 → 20,14
*/
 
 
#include <ll/i386/stdlib.h>
#include <ll/i386/string.h>
#include <ll/i386/limits.h>
#include <ll/i386/float.h>
#include <arch/i386/stdlib.h>
#include <arch/i386/string.h>
#include <arch/i386/limits.h>
#include <arch/i386/float.h>
#include <ll/i386/mem.h>
#include <ll/stdarg.h>
#include <ll/ctype.h>
#include <ll/math.h>
#include <arch/stdarg.h>
#include <arch/ctype.h>
#include <arch/math.h>
#include "sprintf.h"
 
FILE(ecvt);
/shark/branches/xen/libc/arch/x86/ioformat/ucvt.c
19,13 → 19,13
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/stdlib.h>
#include <ll/i386/string.h>
#include <ll/i386/limits.h>
#include <ll/i386/float.h>
#include <arch/i386/stdlib.h>
#include <arch/i386/string.h>
#include <arch/i386/limits.h>
#include <arch/i386/float.h>
#include <ll/i386/mem.h>
#include <ll/stdarg.h>
#include <ll/ctype.h>
#include <arch/stdarg.h>
#include <arch/ctype.h>
#include "sprintf.h"
 
FILE(ucvt);
/shark/branches/xen/libc/arch/x86/ioformat/fcvt.c
19,14 → 19,14
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/stdlib.h>
#include <ll/i386/string.h>
#include <ll/i386/limits.h>
#include <ll/i386/float.h>
#include <arch/i386/stdlib.h>
#include <arch/i386/string.h>
#include <arch/i386/limits.h>
#include <arch/i386/float.h>
#include <ll/i386/mem.h>
#include <ll/stdarg.h>
#include <ll/ctype.h>
#include <ll/math.h>
#include <arch/stdarg.h>
#include <arch/ctype.h>
#include <arch/math.h>
#include "sprintf.h"
 
FILE(fcvt);
/shark/branches/xen/libc/arch/x86/ioformat/gcvt.c
19,14 → 19,14
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/stdlib.h>
#include <ll/i386/string.h>
#include <ll/i386/limits.h>
#include <ll/i386/float.h>
#include <arch/i386/stdlib.h>
#include <arch/i386/string.h>
#include <arch/i386/limits.h>
#include <arch/i386/float.h>
#include <ll/i386/mem.h>
#include <ll/stdarg.h>
#include <ll/ctype.h>
#include <ll/math.h>
#include <arch/stdarg.h>
#include <arch/ctype.h>
#include <arch/math.h>
#include "sprintf.h"
 
FILE(gcvt);
/shark/branches/xen/libc/arch/x86/ioformat/sprintf.c
19,14 → 19,14
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/stdlib.h>
#include <ll/i386/string.h>
#include <ll/i386/limits.h>
#include <ll/i386/float.h>
#include <arch/i386/stdlib.h>
#include <arch/i386/string.h>
#include <arch/i386/limits.h>
#include <arch/i386/float.h>
#include <ll/i386/mem.h>
#include <ll/stdarg.h>
//#include <ll/ctype.h>
#include <ll/math.h>
#include <arch/stdarg.h>
//#include <arch/ctype.h>
#include <arch/math.h>
#include "sprintf.h"
 
FILE(sprintf);
/shark/branches/xen/libc/arch/x86/ioformat/sscanf.c
19,11 → 19,11
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/stdlib.h>
#include <ll/i386/string.h>
#include <ll/i386/limits.h>
#include <ll/stdarg.h>
#include <ll/ctype.h>
#include <arch/i386/stdlib.h>
#include <arch/i386/string.h>
#include <arch/i386/limits.h>
#include <arch/stdarg.h>
#include <arch/ctype.h>
#include "sprintf.h"
 
FILE(sscanf);
/shark/branches/xen/libc/arch/x86/stdlib/strtod.c
19,12 → 19,12
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/stdlib.h>
#include <ll/i386/string.h>
#include <ll/i386/limits.h>
#include <ll/stdarg.h>
#include <ll/ctype.h>
#include <ll/math.h>
#include <arch/i386/stdlib.h>
#include <arch/i386/string.h>
#include <arch/i386/limits.h>
#include <arch/stdarg.h>
#include <arch/ctype.h>
#include <arch/math.h>
 
FILE(strod);
 
/shark/branches/xen/libc/arch/x86/stdlib/random.c
19,8 → 19,8
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/stdlib.h>
#include <ll/math.h>
#include <arch/i386/stdlib.h>
#include <arch/math.h>
 
FILE(random);
 
/shark/branches/xen/libc/arch/x86/stdlib/strtou.c
19,11 → 19,11
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/stdlib.h>
#include <ll/i386/string.h>
#include <ll/i386/limits.h>
#include <ll/stdarg.h>
#include <ll/ctype.h>
#include <arch/i386/stdlib.h>
#include <arch/i386/string.h>
#include <arch/i386/limits.h>
#include <arch/stdarg.h>
#include <arch/ctype.h>
 
FILE(strtou);
 
/shark/branches/xen/libc/arch/x86/stdlib/stdlib.c
21,8 → 21,8
 
#include <ll/i386/hw-func.h>
 
#include <ll/i386/stdlib.h>
#include <ll/unistd.h>
#include <arch/i386/stdlib.h>
#include <arch/unistd.h>
 
FILE(stdlib);
 
/shark/branches/xen/libc/arch/x86/stdlib/strtoi.c
19,12 → 19,12
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/stdlib.h>
#include <ll/i386/string.h>
#include <ll/i386/limits.h>
#include <ll/stdarg.h>
#include <ll/ctype.h>
#include <ll/math.h>
#include <arch/i386/stdlib.h>
#include <arch/i386/string.h>
#include <arch/i386/limits.h>
#include <arch/stdarg.h>
#include <arch/ctype.h>
#include <arch/math.h>
 
FILE(strtoi);
 
/shark/branches/xen/libc/arch/x86/stdlib/strtol.c
35,10 → 35,10
static char sccsid[] = "@(#)strtol.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
 
#include <ll/limits.h>
#include <ll/ctype.h>
#include <ll/errno.h>
#include <ll/stdlib.h>
#include <arch/limits.h>
#include <arch/ctype.h>
#include <arch/errno.h>
#include <arch/stdlib.h>
 
FILE(strtol);
 
/shark/branches/xen/libc/arch/x86/stdlib/strtoul.c
35,10 → 35,10
static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
 
#include <ll/limits.h>
#include <ll/ctype.h>
#include <ll/errno.h>
#include <ll/stdlib.h>
#include <arch/limits.h>
#include <arch/ctype.h>
#include <arch/errno.h>
#include <arch/stdlib.h>
 
FILE(strtoul);
 
/shark/branches/xen/libc/arch/x86/libm/msun/src/w_cabs.c
5,7 → 5,7
* Placed into the Public Domain, 1994.
*/
 
#include <math.h>
#include "math.h"
 
struct complex {
double x;
/shark/branches/xen/libc/arch/x86/libm/msun/src/math.h
92,7 → 92,7
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
 
 
#include <sys/cdefs.h>
#include <arch/sys/cdefs.h>
__BEGIN_DECLS
/*
* ANSI/POSIX
/shark/branches/xen/libc/arch/x86/libm/msun/src/s_ldexpf.c
19,7 → 19,7
 
#include "math.h"
#include "math_private.h"
#include <errno.h>
#include <arch/errno.h>
 
#ifdef __STDC__
float ldexpf(float value, int exp)
/shark/branches/xen/libc/arch/x86/libm/msun/src/math_pri.h
17,8 → 17,8
#ifndef _MATH_PRIVATE_H_
#define _MATH_PRIVATE_H_
 
#include <machine/endian.h>
#include <sys/types.h>
#include <arch/endian.h>
#include <ll/sys/types.h>
 
/* The original fdlibm code used statements like:
n0 = ((*(int*)&one)>>29)^1; * index of high word *
/shark/branches/xen/libc/arch/x86/libm/msun/src/w_scalbf.c
26,7 → 26,7
#include "math.h"
#include "math_private.h"
 
#include <errno.h>
#include <arch/errno.h>
 
#ifdef __STDC__
#ifdef _SCALB_INT
/shark/branches/xen/libc/arch/x86/libm/msun/src/s_ldexp.c
16,7 → 16,7
 
#include "math.h"
#include "math_private.h"
#include <errno.h>
#include <arch/errno.h>
 
#ifdef __STDC__
double ldexp(double value, int exp)
/shark/branches/xen/libc/arch/x86/libm/msun/src/w_drem.c
5,7 → 5,7
* Placed into the Public Domain, 1994.
*/
 
#include <math.h>
#include "math.h"
 
double
drem(x, y)
/shark/branches/xen/libc/arch/x86/libm/msun/src/math_private.h
17,8 → 17,8
#ifndef _MATH_PRIVATE_H_
#define _MATH_PRIVATE_H_
 
#include <machine/endian.h>
#include <sys/types.h>
#include <arch/endian.h>
#include <ll/sys/types.h>
 
/* The original fdlibm code used statements like:
n0 = ((*(int*)&one)>>29)^1; * index of high word *
/shark/branches/xen/libc/arch/x86/libm/msun/src/w_scalb.c
23,7 → 23,7
#include "math.h"
#include "math_private.h"
 
#include <errno.h>
#include <arch/errno.h>
 
#ifdef __STDC__
#ifdef _SCALB_INT
/shark/branches/xen/libc/arch/x86/libm/msun/src/k_standa.c
16,7 → 16,7
 
#include "math.h"
#include "math_private.h"
#include <errno.h>
#include <arch/errno.h>
 
/* Undefine these if you're actually going to use the FreeBSD libc. */
#define _USE_WRITE
26,7 → 26,7
#include <stdio.h> /* fputs(), stderr */
#define WRITE2(u,v) fputs(u, stderr)
#else /* !defined(_USE_WRITE) */
#include <unistd.h> /* write */
#include <arch/unistd.h> /* write */
#define WRITE2(u,v) write(2, u, v)
#undef fflush
#endif /* !defined(_USE_WRITE) */
/shark/branches/xen/libc/arch/x86/libm/machine/endian.h
File deleted
/shark/branches/xen/libc/arch/x86/libm/machine/infinity.c
20,7 → 20,7
*/
 
 
#include <math.h>
#include <arch/math.h>
 
/* bytes for +Infinity on a 387 */
char __infinity[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
/shark/branches/xen/libc/arch/x86/libm/machine/stub.c
21,7 → 21,7
 
 
#include <ll/i386/cons.h>
#include <ll/stdlib.h>
#include <arch/stdlib.h>
#include <ll/sys/types.h>
 
/* bytes for +Infinity on a 387 */
/shark/branches/xen/libc/arch/x86/libm/makefile
12,7 → 12,7
 
include $(BASE)/config.mk
 
C_OPT += -I$(INCL)/ll -I.
C_OPT += $(INCL)/ll -I.
C_OPT += -Dlint -Wno-uninitialized -Wno-parentheses
ASM_OPT += -Dlint -I.
 
75,7 → 75,7
 
cleanall : clean
echo # Kernel Dependency file > deps
$(RM) (LIB_PATH)libhm.a
$(RM) $(LIB_PATH)libhm.a
 
#deps : $(OBJS:.o=.c)
deps : makefile $(CFILES)
/shark/branches/xen/libc/arch/x86/include/arch/math.h
0,0 → 1,141
/*
* Copyright (c) 1985, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* 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.
*
* @(#)math.h 8.1 (Berkeley) 6/2/93
*/
 
#ifndef __LL_MATH_H__
#define __LL_MATH_H__
 
#if defined(vax) || defined(tahoe) /* DBL_MAX from float.h */
#define HUGE_VAL 1.701411834604692294E+38
#else
#define HUGE_VAL 1e500 /* IEEE: positive infinity */
#endif
 
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
#if defined(vax) || defined(tahoe)
/*
* HUGE for the VAX and Tahoe converts to the largest possible F-float value.
* This implies an understanding of the conversion behavior of atof(3). It
* was defined to be the largest float so that overflow didn't occur when it
* was assigned to a single precision number. HUGE_VAL is strongly preferred.
*/
#define HUGE 1.701411733192644270E+38
#else
#define HUGE HUGE_VAL
#endif
 
#define M_E 2.7182818284590452354 /* e */
#define M_LOG2E 1.4426950408889634074 /* log 2e */
#define M_LOG10E 0.43429448190325182765 /* log 10e */
#define M_LN2 0.69314718055994530942 /* log e2 */
#define M_LN10 2.30258509299404568402 /* log e10 */
#define M_PI 3.14159265358979323846 /* pi */
#define M_PI_2 1.57079632679489661923 /* pi/2 */
#define M_PI_4 0.78539816339744830962 /* pi/4 */
#define M_1_PI 0.31830988618379067154 /* 1/pi */
#define M_2_PI 0.63661977236758134308 /* 2/pi */
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
 
#include <arch/sys/cdefs.h>
 
/*
* Most of these functions have the side effect of setting errno, except
* in the (broken) BSD libm, so they not declared as __pure2.
*/
__BEGIN_DECLS double acos __P((double));
double asin __P((double));
double atan __P((double));
double atan2 __P((double, double));
double ceil __P((double));
double cos __P((double));
double cosh __P((double));
double exp __P((double));
double fabs __P((double));
double floor __P((double));
double fmod __P((double, double));
double frexp __P((double, int *)); /* fundamentally !__pure2 */
double ldexp __P((double, int));
double log __P((double));
double log10 __P((double));
double modf __P((double, double *)); /* fundamentally !__pure2 */
double pow __P((double, double));
double sin __P((double));
double sinh __P((double));
double sqrt __P((double));
double tan __P((double));
double tanh __P((double));
 
/*
* These functions are non-ANSI so they can be "right". The ones that
* don't set errno in [lib]msun are declared as __pure2.
*/
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
double acosh __P((double));
double asinh __P((double));
double atanh __P((double));
double cabs(); /* we can't describe cabs()'s argument properly */
double cbrt __P((double)) __pure2;
double copysign __P((double, double)) __pure2;
double drem __P((double, double));
double erf __P((double));
double erfc __P((double)) __pure2;
double expm1 __P((double)) __pure2;
int finite __P((double)) __pure2;
double hypot __P((double, double));
#if defined(vax) || defined(tahoe)
double infnan __P((int));
#endif
int isinf __P((double)) __pure2;
int isnan __P((double)) __pure2;
double j0 __P((double));
double j1 __P((double));
double jn __P((int, double));
double lgamma __P((double));
double log1p __P((double)) __pure2;
double logb __P((double)) __pure2;
double rint __P((double)) __pure2;
double scalb __P((double, int));
double y0 __P((double));
double y1 __P((double));
double yn __P((int, double));
#endif
 
#define isinf(x) (isspecial(x, NULL) > 1)
#define isnan(x) (isspecial(x, NULL) == 1)
 
__END_DECLS
#endif /* !_MATH_H_ */
/shark/branches/xen/libc/arch/x86/include/arch/endian.h
0,0 → 1,120
/*
* Copyright (c) 1987, 1991 Regents of the University of California.
* All rights reserved.
*
* 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: @(#)endian.h 7.8 (Berkeley) 4/3/91
* endian.h,v 1.5 1994/09/10 20:03:14 csgr Exp
*/
 
#ifndef _MACHINE_ENDIAN_H_
#define _MACHINE_ENDIAN_H_ 1
 
/*
* Define the order of 32-bit words in 64-bit words.
*/
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0
 
/*
* Definitions for byte order, according to byte significance from low
* address to high.
*/
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
 
#define BYTE_ORDER LITTLE_ENDIAN
 
#ifndef KERNEL
#include <arch/sys/cdefs.h>
#endif
 
#define __word_swap_long(x) \
({ register u_long X = (x); \
__asm ("rorl $16, %1" \
: "=r" (X) \
: "0" (X)); \
X; })
#if __GNUC__ >= 2
#define __byte_swap_long(x) \
({ register u_long X = (x); \
__asm ("xchgb %h1, %b1\n\trorl $16, %1\n\txchgb %h1, %b1" \
: "=q" (X) \
: "0" (X)); \
X; })
#define __byte_swap_word(x) \
({ register u_short X = (x); \
__asm ("xchgb %h1, %b1" \
: "=q" (X) \
: "0" (X)); \
X; })
#else /* __GNUC__ >= 2 */
#define __byte_swap_long(x) \
({ register u_long X = (x); \
__asm ("rorw $8, %w1\n\trorl $16, %1\n\trorw $8, %w1" \
: "=r" (X) \
: "0" (X)); \
X; })
#define __byte_swap_word(x) \
({ register u_short X = (x); \
__asm ("rorw $8, %w1" \
: "=r" (X) \
: "0" (X)); \
X; })
#endif /* __GNUC__ >= 2 */
 
/*
* Macros for network/external number representation conversion.
*/
#if BYTE_ORDER == BIG_ENDIAN && !defined(lint)
#define ntohl(x) (x)
#define ntohs(x) (x)
#define htonl(x) (x)
#define htons(x) (x)
 
#define NTOHL(x) (x)
#define NTOHS(x) (x)
#define HTONL(x) (x)
#define HTONS(x) (x)
 
#else
 
#define ntohl __byte_swap_long
#define ntohs __byte_swap_word
#define htonl __byte_swap_long
#define htons __byte_swap_word
 
#define NTOHL(x) (x) = ntohl((u_long)x)
#define NTOHS(x) (x) = ntohs((u_short)x)
#define HTONL(x) (x) = htonl((u_long)x)
#define HTONS(x) (x) = htons((u_short)x)
#endif
#endif /* _MACHINE_ENDIAN_H_ */
/shark/branches/xen/libc/arch/x86/include/arch/time.h
0,0 → 1,35
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* A wrapper to the time handling functions */
 
#ifndef __LL_TIME_H__
#define __LL_TIME_H__
 
#include <ll/sys/types.h>
 
#ifndef NULL
#define NULL 0L
#endif
 
#include <ll/sys/ll/time.h>
 
#endif
/shark/branches/xen/libc/arch/x86/include/arch/assert.h
0,0 → 1,39
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* Assert & demand: diagnostic routines */
 
#ifndef __LL_ASSERT_H__
#define __LL_ASSERT_H__
 
#include "i386/error.h"
 
#define assert(x) { \
if (! (x)) \
message("%s:%d: assertion failed: %s", __FILE__, __LINE__, #x); \
}
#define demand(x,y) { \
if (! (x)) \
message("%s:%d: demand %s failed: %s", __FILE__, __LINE__, #x, #y); \
}
 
#endif
/shark/branches/xen/libc/arch/x86/include/arch/limits.h
0,0 → 1,22
 
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
#ifndef __LL_LIMITS_H__
#define __LL_LIMITS_H__
#include "i386/limits.h"
#endif
/shark/branches/xen/libc/arch/x86/include/arch/stdlib.h
0,0 → 1,27
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* The system independent part of the standard library */
 
#ifndef __LL_STDLIB_H__
#define __LL_STDLIB_H__
#include "i386/stdlib.h"
#endif
/shark/branches/xen/libc/arch/x86/include/arch/stdio.h
0,0 → 1,26
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* The standard input/output */
#ifndef __LL_STDIO_H__
#define __LL_STDIO_H__
#include "i386/stdio.h"
#endif
/shark/branches/xen/libc/arch/x86/include/arch/i386/limits.h
0,0 → 1,48
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* Some POSIX compliance stuff */
 
#ifndef __LL_I386_LIMITS_H__
#define __LL_I386_LIMITS_H__
 
/* Number limits */
 
#define CHAR_BIT 8
#define CHAR_MAX 255
#define CHAR_MIN 0
#define SCHAR_MAX 127
#define SCHAR_MIN -128
#define UCHAR_MAX 255
 
#define INT_MAX 2147483647
#define INT_MIN (-INT_MAX - 1)
#define UINT_MAX 4294967295U
 
#define SHRT_MIN (-32768)
#define SHRT_MAX 32767
#define USHRT_MAX 65535
 
#define LONG_MAX 2147483647L
#define LONG_MIN (-LONG_MAX - 1)
#define ULONG_MAX 4294967295UL
 
#endif
/shark/branches/xen/libc/arch/x86/include/arch/i386/stdlib.h
0,0 → 1,100
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* Standard library for OSLib applications */
 
#ifndef __LL_I386_STDLIB_H__
#define __LL_I386_STDLIB_H__
 
#include <ll/i386/defs.h>
BEGIN_DEF
 
#define EXIT_FAILURE 1 /* Failing exit status. */
#define EXIT_SUCCESS 0 /* Successful exit status. */
 
/* Added by Nino - Begin */
#define EXIT_MODE_HALT 0 /* End the system using the 'hlt' instruction. */
#define EXIT_MODE_COLD 1 /* End the system with a _cold_ reboot. */
#define EXIT_MODE_WARM 2 /* End the system with a _warm_ reboot. */
#define EXIT_MODE_REAL 3 /* End the system returning in real-mode. */
/* Added by Nino - End */
 
#ifndef NULL
#define NULL 0L
#endif
 
#define RAND_MAX 2147483647
 
/* String conversion functions */
/* File: StrConv.C */
 
long strtoi(char *s,int base,char **scan_end);
unsigned long strtou(char *s,int base,char **scan_end);
double strtod(char *s,char **scan_end);
long strtol(const char *nptr, char **endptr, int base);
unsigned long strtoul(const char *nptr, char **endptr, int base);
 
 
unsigned ecvt(double v,char *buffer,int width,int prec,int flag);
unsigned fcvt(double v,char *buffer,int width,int prec,int flag);
unsigned gcvt(double v,char *buffer,int width,int prec,int flag);
unsigned dcvt(long v,char *buffer,int base,int width,int flag);
unsigned ucvt(unsigned long v,char *buffer,int base,int width,int flag);
 
 
/* StdLib Macro */
 
#define atof(s) strtod(s, NULL)
#define atoi(s) strtoi(s, 10, NULL)
#define atou(s) strtou(s, 10, NULL)
#define atol(s) strtol(s, 10, NULL)
 
/* Generic utility functions */
/* File StdLib.C */
 
void srand(long int seed);
long int rand(void);
unsigned abs(int x);
 
/* The stdlib exit functions */
void l1_exit(int code);
int ll_set_reboot(int mode);
 
/* Stdlib Macro */
#ifndef __WC16__
#define labs(x) abs(x)
#endif
 
#if !defined(__max)
#define __max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#if !defined(max) && !defined(__cplusplus)
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#if !defined(__min)
#define __min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#if !defined(min) && !defined(__cplusplus)
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
END_DEF
 
#endif
/shark/branches/xen/libc/arch/x86/include/arch/i386/stdio.h
0,0 → 1,40
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
#ifndef __LL_I386_STDIO_H__
#define __LL_I386_STDIO_H__
 
#include <arch/stdarg.h>
#include <ll/i386/defs.h>
 
BEGIN_DEF
 
int vsprintf(char *buf,char *fmt,va_list parms);
int vksprintf(char *buf,char *fmt,va_list parms);
int sprintf(char *buf,char *fmt,...) __attribute__((__format__(printf,2,3)));
int ksprintf(char *buf,char *fmt,...) __attribute__((__format__(printf,2,3)));
int vsscanf(char *buf,char *fmt,va_list parms);
int sscanf(char *buf,char *fmt,...) __attribute__((__format__(scanf,2,3)));
 
int ll_printf(char *fmt,...);
 
END_DEF
#endif
/shark/branches/xen/libc/arch/x86/include/arch/i386/float.h
0,0 → 1,59
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* The POSIX float.h header */
 
#ifndef __LL_I386_FLOAT_H
#define __LL_I386_FLOAT_H__
 
#define DBL_DIG 15
#define DBL_EPSILON 2.22044604925031300e-016
#define DBL_MANT_DIG 53
#define DBL_MAX 1.79769313486231500e+308
#define DBL_MAX_10_EXP 308
#define DBL_MAX_EXP 1024
#define DBL_MIN 2.22507385850720200e-308
#define DBL_MIN_10_EXP (-307)
#define DBL_MIN_EXP (-1021)
 
#define FLT_DIG 6
#define FLT_EPSILON 1.192092896e-7f
#define FLT_MANT_DIG 24
#define FLT_MAX 3.402823466e+38f
#define FLT_MAX_10_EXP 38
#define FLT_MAX_EXP 128
#define FLT_MIN 1.175494351e-38f
#define FLT_MIN_10_EXP (-37)
#define FLT_MIN_EXP (-125)
#define FLT_RADIX 2
#define FLT_ROUNDS 1
 
#define LDBL_DIG DBL_DIG
#define LDBL_EPSILON DBL_EPSILON
#define LDBL_MANT_DIG DBL_MANT_DIG
#define LDBL_MAX DBL_MAX
#define LDBL_MAX_10_EXP DBL_MAX_10_EXP
#define LDBL_MAX_EXP DBL_MAX_EXP
#define LDBL_MIN DBL_MIN
#define LDBL_MIN_10_EXP DBL_MIN_10_EXP
#define LDBL_MIN_EXP DBL_MIN_EXP
 
#endif
/shark/branches/xen/libc/arch/x86/include/arch/i386/string.h
0,0 → 1,50
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* String manipulation functions */
 
#ifndef __LL_I386_STRING_H__
#define __LL_I386_STRING_H__
 
#include <ll/i386/mem.h>
 
#include <ll/i386/defs.h>
BEGIN_DEF
 
/* Various string manipulation functions */
 
/* File: String.C */
 
char *strcpy(char *dst,const char *src);
char *strncpy(char *dst,const char *src,int n);
int strcmp(const char *s1,const char *s2);
int strncmp(const char *s1,const char *s2,int n);
int strlen(const char *s);
char *strscn(char *s,char *pattern);
char *strchr(char *s,int c);
char *strupr(char *s);
char *strlwr(char *s);
char *strcat(char *dst,char *src);
 
END_DEF
 
#endif
 
/shark/branches/xen/libc/arch/x86/include/arch/ctype.h
0,0 → 1,47
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* Standard character conversions and tests */
 
#ifndef __LL_CTYPE_H__
#define __LL_CTYPE_H__
 
#include <ll/i386/defs.h>
BEGIN_DEF
 
/* String conversion functions */
char toupper(char c);
char tolower(char c);
int tonumber(char c);
char todigit(int c);
int isalnum(char c);
int isalpha(char c);
int iscntrl(char c);
int isdigit(char c);
int islower(char c);
int isspace(char c);
int isupper(char c);
int isxdigit(char c);
int isnumber(char c,int base);
int isspecial(double d,char *bufp);
 
END_DEF
#endif
/shark/branches/xen/libc/arch/x86/include/arch/stdarg.h
0,0 → 1,90
/*
* Project: HARTIK (HA-rd R-eal TI-me K-ernel)
*
* Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
* Gerardo Lamastra <gerardo@sssup.it>
*
* Authors : Paolo Gai <pj@hartik.sssup.it>
* (see authors.txt for full list of hartik's authors)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://hartik.sssup.it
*/
 
/**
------------
CVS : $Id: stdarg.h,v 1.2 2003-03-17 09:27:56 pj Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2003-03-17 09:27:56 $
------------
 
lowlevel's stdarg.h
 
**/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_stdarg_h_
#define __dj_include_stdarg_h_
 
#include <ll/i386/defs.h>
 
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
 
#ifdef __dj_include_varargs_h_
#error stdarg.h and varargs.h are mutually exclusive
#endif
 
#include <ll/sys/types.h>
 
BEGIN_DEF
 
#define __dj_va_rounded_size(T) \
(((sizeof (T) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
 
#define va_arg(ap, T) \
(ap = (va_list) ((char *) (ap) + __dj_va_rounded_size (T)), \
*((T *) (void *) ((char *) (ap) - __dj_va_rounded_size (T))))
 
#define va_end(ap)
 
#define va_start(ap, last_arg) \
(ap = ((va_list) __builtin_next_arg (last_arg)))
#ifndef __STRICT_ANSI__
 
#ifndef _POSIX_SOURCE
 
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
 
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
 
END_DEF
#endif /* !__dj_include_stdarg_h_ */
/shark/branches/xen/libc/arch/x86/include/arch/errno.h
0,0 → 1,38
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* Stuff needed by the Math library... It wants to set errno!!! */
 
#ifndef __LL_ERRNO_H__
#define __LL_ERRNO_H__
 
void seterrnumber(int *(*e)(void));
extern int *__errnumber1();
 
/*+ this macro refers the correct errno... +*/
#define errno (*__errnumber1())
#define __set_errno(val) ((*__errnumber1()) = (val) )
 
 
#define EDOM 33
#define EILSEQ 84
#define ERANGE 34
#endif
/shark/branches/xen/libc/arch/x86/include/arch/float.h
0,0 → 1,22
 
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
#ifndef __LL_FLOAT_H__
#define __LL_FLOAT_H__
#include "i386/float.h"
#endif
/shark/branches/xen/libc/arch/x86/include/arch/string.h
0,0 → 1,29
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
/* String operations... */
 
#ifndef __LL_STRING_H__
#define __LL_STRING_H__
#include "i386/string.h"
#include <ll/sys/types.h>
#endif
 
/shark/branches/xen/libc/arch/x86/include/arch/unistd.h
0,0 → 1,33
/* Project: OSLib
* Description: The OS Construction Kit
* Date: 1.6.2000
* Idea by: Luca Abeni & Gerardo Lamastra
*
* OSLib is an SO project aimed at developing a common, easy-to-use
* low-level infrastructure for developing OS kernels and Embedded
* Applications; it partially derives from the HARTIK project but it
* currently is independently developed.
*
* OSLib is distributed under GPL License, and some of its code has
* been derived from the Linux kernel source; also some important
* ideas come from studying the DJGPP go32 extender.
*
* We acknowledge the Linux Community, Free Software Foundation,
* D.J. Delorie and all the other developers who believe in the
* freedom of software and ideas.
*
* For legalese, check out the included GPL license.
*/
 
#ifndef __LL_UNISTD_H__
#define __LL_UNISTD_H__
 
/* _exit */
#include <ll/i386/hw-func.h>
 
/* cprintf */
#include <ll/i386/cons.h>
 
#include <ll/sys/types.h>
 
#endif /* !_SYS_UNISTD_H_ */
/shark/branches/xen/libc/arch/x86/include/arch/sys/cdefs.h
0,0 → 1,147
/*
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Berkeley Software Design, Inc.
*
* 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.
*
* @(#)cdefs.h 8.7 (Berkeley) 1/21/94
*/
 
#ifndef __LL_SYS_CDEFS_H__
#define __LL_SYS_CDEFS_H__
 
#if defined(__cplusplus)
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS };
#else
#define __BEGIN_DECLS
#define __END_DECLS
#endif
 
/*
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
* with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
* The __CONCAT macro is a bit tricky -- make sure you don't put spaces
* in between its arguments. __CONCAT can also concatenate double-quoted
* strings produced by the __STRING macro, but this only works with ANSI C.
*/
#if defined(__STDC__) || defined(__cplusplus)
#define __P(protos) protos /* full-blown ANSI C */
#define __CONCAT1(x,y) x ## y
#define __CONCAT(x,y) __CONCAT1(x,y)
#define __STRING(x) #x
 
#define __const const /* define reserved names to standard */
#define __signed signed
#define __volatile volatile
#if defined(__cplusplus)
#define __inline inline /* convert to C++ keyword */
#else
#ifndef __GNUC__
#define __inline /* delete GCC keyword */
#endif /* !__GNUC__ */
#endif /* !__cplusplus */
 
#else /* !(__STDC__ || __cplusplus) */
#define __P(protos) () /* traditional C preprocessor */
#define __CONCAT(x,y) x/**/y
#define __STRING(x) "x"
 
#ifndef __GNUC__
#define __const /* delete pseudo-ANSI C keywords */
#define __inline
#define __signed
#define __volatile
/*
* In non-ANSI C environments, new programs will want ANSI-only C keywords
* deleted from the program and old programs will want them left alone.
* When using a compiler other than gcc, programs using the ANSI C keywords
* const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
* When using "gcc -traditional", we assume that this is the intent; if
* __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
*/
#ifndef NO_ANSI_KEYWORDS
#define const /* delete ANSI C keywords */
#define inline
#define signed
#define volatile
#endif
#endif /* !NO_ANSI_KEYWORDS */
#endif /* !(__STDC__ || __cplusplus) */
 
/*
* GCC1 and some versions of GCC2 declare dead (non-returning) and
* pure (no side effects) functions using "volatile" and "const";
* unfortunately, these then cause warnings under "-ansi -pedantic".
* GCC2.5 uses a new, peculiar __attribute__((attrs)) style. All of
* these work for GNU C++ (modulo a slight glitch in the C++ grammar
* in the distribution version of 2.5.5).
*/
#if __GNUC__ < 2
#define __dead
#define __dead2
#define __pure
#define __pure2
#define __attribute__(x)
#endif
#if __GNUC__ == 2 && __GNUC_MINOR__ < 5
#define __dead __volatile
#define __dead2
#define __pure __const
#define __pure2
#endif
#if __GNUC__ == 2 && __GNUC_MINOR__ > 5 || __GNUC__ >= 3
#define __dead
#define __dead2 __attribute__((noreturn))
#define __pure
#define __pure2 __attribute__((const))
#endif
 
#ifdef __GNUC__
#ifdef __STDC__
#define __weak_reference(sym,alias) \
__asm__(".stabs \"_" #alias "\",11,0,0,0"); \
__asm__(".stabs \"_" #sym "\",1,0,0,0")
#define __warn_references(sym,msg) \
__asm__(".stabs \"" msg "\",30,0,0,0"); \
__asm__(".stabs \"_" #sym "\",1,0,0,0")
#else
#define __weak_reference(sym,alias) \
__asm__(".stabs \"_/**/alias\",11,0,0,0"); \
__asm__(".stabs \"_/**/sym\",1,0,0,0")
#define __warn_references(sym,msg) \
__asm__(".stabs msg,30,0,0,0"); \
__asm__(".stabs \"_/**/sym\",1,0,0,0")
#endif
#endif
 
#endif /* !_SYS_CDEFS_H_ */
/shark/branches/xen/libc/arch/x86/string/strncat.c
19,7 → 19,7
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/string.h>
#include <arch/i386/string.h>
 
FILE(strncat);
 
/shark/branches/xen/libc/arch/x86/string/special.c
19,8 → 19,8
* For legalese, check out the included GPL license.
*/
 
#include <ll/ctype.h>
#include <ll/i386/string.h>
#include <arch/ctype.h>
#include <arch/i386/string.h>
 
FILE(IsSpecial);
 
/shark/branches/xen/libc/arch/x86/string/strstr.c
19,7 → 19,7
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/string.h>
#include <arch/i386/string.h>
 
FILE(strstr);
 
/shark/branches/xen/libc/arch/x86/string/strbase.c
19,8 → 19,8
* For legalese, check out the included GPL license.
*/
 
#include <ll/ctype.h>
#include <ll/i386/string.h>
#include <arch/ctype.h>
#include <arch/i386/string.h>
 
FILE(strbase);
 
/shark/branches/xen/libc/arch/x86/string/string.c
19,7 → 19,7
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/string.h>
#include <arch/i386/string.h>
 
FILE(string);
 
/shark/branches/xen/libc/arch/x86/string/strrchr.c
19,7 → 19,7
* For legalese, check out the included GPL license.
*/
 
#include <ll/i386/string.h>
#include <arch/i386/string.h>
 
FILE(strchr);
 
/shark/branches/xen/libc/arch/x86/string/strnum.c
19,8 → 19,8
* For legalese, check out the included GPL license.
*/
 
#include <ll/ctype.h>
#include <ll/i386/string.h>
#include <arch/ctype.h>
#include <arch/i386/string.h>
 
FILE(strnum);