Create a branch for network fixes.

svn path=/branches/aicom-network-fixes/; revision=34994
This commit is contained in:
Art Yerkes 2008-08-01 11:32:26 +00:00
parent 0e213bbc00
commit c501d8112c
18148 changed files with 0 additions and 860488 deletions

View file

@ -0,0 +1,28 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/crt/??????
* PURPOSE: Unknown
* PROGRAMER: Unknown
* UPDATE HISTORY:
* 25/11/05: Added license header
*/
#include <precomp.h>
unsigned int _statusfp( void );
/*********************************************************************
* _clearfp (MSVCRT.@)
*/
unsigned int CDECL _clearfp(void)
{
unsigned int retVal = _statusfp();
#if defined(__GNUC__) && defined(__i386__)
__asm__ __volatile__( "fnclex" );
#else
FIXME(":Not Implemented\n");
#endif
return retVal;
}

View file

@ -0,0 +1,108 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <precomp.h>
#include <float.h>
#define X87_CW_IM (1<<0) /* Invalid operation mask */
#define X87_CW_DM (1<<1) /* Denormal operand mask */
#define X87_CW_ZM (1<<2) /* Zero divide mask */
#define X87_CW_OM (1<<3) /* Overflow mask */
#define X87_CW_UM (1<<4) /* Underflow mask */
#define X87_CW_PM (1<<5) /* Precision mask */
#define X87_CW_PC_MASK (3<<8) /* precision control mask */
#define X87_CW_PC24 (0<<8) /* 24 bit precision */
#define X87_CW_PC53 (2<<8) /* 53 bit precision */
#define X87_CW_PC64 (3<<8) /* 64 bit precision */
#define X87_CW_RC_MASK (3<<10) /* rounding control mask */
#define X87_CW_RC_NEAREST (0<<10) /* round to nearest */
#define X87_CW_RC_DOWN (1<<10) /* round down */
#define X87_CW_RC_UP (2<<10) /* round up */
#define X87_CW_RC_ZERO (3<<10) /* round toward zero (chop) */
#define X87_CW_IC (1<<12) /* infinity control flag */
/*
* @implemented
*/
unsigned int CDECL _controlfp(unsigned int newval, unsigned int mask)
{
#ifdef __i386__
return _control87( newval, mask & ~_EM_DENORMAL );
#else
FIXME(":Not Implemented!\n");
return 0;
#endif
}
/*********************************************************************
* _control87 (MSVCRT.@)
*/
unsigned int CDECL _control87(unsigned int newval, unsigned int mask)
{
#if defined(__GNUC__) && defined(__i386__)
unsigned int fpword = 0;
unsigned int flags = 0;
TRACE("(%08x, %08x): Called\n", newval, mask);
/* Get fp control word */
__asm__ __volatile__( "fstcw %0" : "=m" (fpword) : );
TRACE("Control word before : %08x\n", fpword);
/* Convert into mask constants */
if (fpword & 0x1) flags |= _EM_INVALID;
if (fpword & 0x2) flags |= _EM_DENORMAL;
if (fpword & 0x4) flags |= _EM_ZERODIVIDE;
if (fpword & 0x8) flags |= _EM_OVERFLOW;
if (fpword & 0x10) flags |= _EM_UNDERFLOW;
if (fpword & 0x20) flags |= _EM_INEXACT;
switch(fpword & 0xC00) {
case 0xC00: flags |= _RC_UP|_RC_DOWN; break;
case 0x800: flags |= _RC_UP; break;
case 0x400: flags |= _RC_DOWN; break;
}
switch(fpword & 0x300) {
case 0x0: flags |= _PC_24; break;
case 0x200: flags |= _PC_53; break;
case 0x300: flags |= _PC_64; break;
}
if (fpword & 0x1000) flags |= _IC_AFFINE;
/* Mask with parameters */
flags = (flags & ~mask) | (newval & mask);
/* Convert (masked) value back to fp word */
fpword = 0;
if (flags & _EM_INVALID) fpword |= 0x1;
if (flags & _EM_DENORMAL) fpword |= 0x2;
if (flags & _EM_ZERODIVIDE) fpword |= 0x4;
if (flags & _EM_OVERFLOW) fpword |= 0x8;
if (flags & _EM_UNDERFLOW) fpword |= 0x10;
if (flags & _EM_INEXACT) fpword |= 0x20;
switch(flags & (_RC_UP | _RC_DOWN)) {
case _RC_UP|_RC_DOWN: fpword |= 0xC00; break;
case _RC_UP: fpword |= 0x800; break;
case _RC_DOWN: fpword |= 0x400; break;
}
switch (flags & (_PC_24 | _PC_53)) {
case _PC_64: fpword |= 0x300; break;
case _PC_53: fpword |= 0x200; break;
case _PC_24: fpword |= 0x0; break;
}
if (flags & _IC_AFFINE) fpword |= 0x1000;
TRACE("Control word after : %08x\n", fpword);
/* Put fp control word */
__asm__ __volatile__( "fldcw %0" : : "m" (fpword) );
return flags;
#else
FIXME(":Not Implemented!\n");
return 0;
#endif
}

View file

@ -0,0 +1,34 @@
/* Math functions for i387.
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by John C. Bowman <bowman@ipp-garching.mpg.de>, 1995.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <precomp.h>
double _logb (double __x)
{
register double __val;
#ifdef __GNUC__
register double __junk;
__asm __volatile__
("fxtract\n\t"
: "=t" (__junk), "=u" (__val) : "0" (__x));
#else
#endif /*__GNUC__*/
return __val;
}

View file

@ -0,0 +1,42 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/crt/??????
* PURPOSE: Unknown
* PROGRAMER: Unknown
* UPDATE HISTORY:
* 25/11/05: Added license header
*/
#include <precomp.h>
#include "float.h"
//WTF IS HAPPENING WITH float.h !??!?!
#define _SW_INVALID 0x00000010 /* invalid */
#define _SW_ZERODIVIDE 0x00000008 /* zero divide */
#define _SW_UNDERFLOW 0x00000002 /* underflow */
#define _SW_OVERFLOW 0x00000004 /* overflow */
#define _SW_INEXACT 0x00000001 /* inexact (precision) */
#define _SW_DENORMAL 0x00080000 /* denormal status bit */
/**********************************************************************
* _statusfp (MSVCRT.@)
*/
unsigned int CDECL _statusfp(void)
{
unsigned int retVal = 0;
#if defined(__GNUC__) && defined(__i386__)
unsigned int fpword;
__asm__ __volatile__( "fstsw %0" : "=m" (fpword) : );
if (fpword & 0x1) retVal |= _SW_INVALID;
if (fpword & 0x2) retVal |= _SW_DENORMAL;
if (fpword & 0x4) retVal |= _SW_ZERODIVIDE;
if (fpword & 0x8) retVal |= _SW_OVERFLOW;
if (fpword & 0x10) retVal |= _SW_UNDERFLOW;
if (fpword & 0x20) retVal |= _SW_INEXACT;
#else
FIXME(":Not implemented!\n");
#endif
return retVal;
}