mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 23:48:12 +00:00
Merging r37048, r37051, r37052, r37055 from the-real-msvc branch
svn path=/trunk/; revision=37074
This commit is contained in:
commit
b4787f49df
13 changed files with 117 additions and 79 deletions
|
@ -2,6 +2,7 @@
|
|||
#define _SMSS_H_INCLUDED_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windows.h>
|
||||
#define NTOS_MODE_USER
|
||||
|
|
67
reactos/drivers/bus/acpi/include/platform/acmsc.h
Normal file
67
reactos/drivers/bus/acpi/include/platform/acmsc.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
#ifndef __ACMSC_H__
|
||||
#define __ACMSC_H__
|
||||
|
||||
#define COMPILER_DEPENDENT_UINT64 unsigned __int64
|
||||
|
||||
#if defined(_M_IX86)
|
||||
|
||||
#define ACPI_ASM_MACROS
|
||||
#define causeinterrupt(level)
|
||||
#define BREAKPOINT3
|
||||
#define halt() { __asm { sti } __asm { hlt } }
|
||||
#define wbinvd()
|
||||
|
||||
__forceinline void _ACPI_ACQUIRE_GLOBAL_LOCK(void * GLptr, unsigned char * Acq_)
|
||||
{
|
||||
unsigned char Acq;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, [GLptr]
|
||||
|
||||
L1: mov eax, [ecx]
|
||||
mov edx, eax
|
||||
and edx, ecx
|
||||
bts edx, 1
|
||||
adc edx, 0
|
||||
lock cmpxchg [ecx], edx
|
||||
jne L1
|
||||
cmp dl, 3
|
||||
sbb eax, eax
|
||||
|
||||
mov [Acq], al
|
||||
};
|
||||
|
||||
*Acq_ = Acq;
|
||||
}
|
||||
|
||||
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
|
||||
_ACPI_ACQUIRE_GLOBAL_LOCK((GLptr), (unsigned char *)&(Acq))
|
||||
|
||||
__forceinline void _ACPI_RELEASE_GLOBAL_LOCK(void * GLptr, unsigned char * Acq_)
|
||||
{
|
||||
unsigned char Acq;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, [GLptr]
|
||||
|
||||
L1: mov eax, [ecx]
|
||||
mov edx, eax
|
||||
and edx, ecx
|
||||
lock cmpxchg [ecx], edx
|
||||
jnz L1
|
||||
and eax, 1
|
||||
|
||||
mov [Acq], al
|
||||
};
|
||||
|
||||
*Acq_ = Acq;
|
||||
}
|
||||
|
||||
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
|
||||
_ACPI_RELEASE_GLOBAL_LOCK((GLptr), (unsigned char *)&(Acq))
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __ACMSC_H__ */
|
|
@ -47,14 +47,25 @@
|
|||
|
||||
#endif
|
||||
|
||||
/* ReactOS uses GCC */
|
||||
#if defined(__GNUC__)
|
||||
|
||||
#include "acgcc.h"
|
||||
|
||||
#undef disable
|
||||
#define disable() __asm__("cli\n\t");
|
||||
#define disable() __asm__("cli\n\t")
|
||||
#undef enable
|
||||
#define enable() __asm__("sti\n\t");
|
||||
#define enable() __asm__("sti\n\t")
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
#include "acmsc.h"
|
||||
|
||||
#undef disable
|
||||
#define disable() __asm { cli }
|
||||
#undef enable
|
||||
#define enable() __asm { sti }
|
||||
|
||||
#endif
|
||||
|
||||
#undef DEBUGGER_THREADING
|
||||
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
|
||||
|
|
12
reactos/lib/3rdparty/mingw/crt1.c
vendored
12
reactos/lib/3rdparty/mingw/crt1.c
vendored
|
@ -220,6 +220,7 @@ __mingw_CRTStartup (void)
|
|||
_pei386_runtime_relocator ();
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#if defined(__i386__)
|
||||
/* Align the stack to 16 bytes for the sake of SSE ops in main
|
||||
or in functions inlined into main. */
|
||||
|
@ -232,6 +233,17 @@ __mingw_CRTStartup (void)
|
|||
asm __volatile__ ("li 0,15\n\tandc 1,1,0" : : : "r1");
|
||||
#else
|
||||
#error Unsupported architecture
|
||||
#endif
|
||||
#elif defined(_MSC_VER)
|
||||
#if defined(_M_IX86)
|
||||
/* Align the stack to 16 bytes for the sake of SSE ops in main
|
||||
or in functions inlined into main. */
|
||||
__asm and esp, 0FFFFFFF0h
|
||||
#else
|
||||
#error TODO
|
||||
#endif
|
||||
#else
|
||||
#error TODO
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
3
reactos/lib/3rdparty/mingw/mingw.rbuild
vendored
3
reactos/lib/3rdparty/mingw/mingw.rbuild
vendored
|
@ -13,10 +13,7 @@
|
|||
<file>isascii.c</file>
|
||||
<file>iscsym.c</file>
|
||||
<file>iscsymf.c</file>
|
||||
<file>strcasecmp.c</file>
|
||||
<file>strncasecmp.c</file>
|
||||
<file>toascii.c</file>
|
||||
<file>wcscmpi.c</file>
|
||||
<file>_wgetopt.c</file>
|
||||
<if property="ARCH" value="i386">
|
||||
<file>pseudo-reloc.c</file>
|
||||
|
|
21
reactos/lib/3rdparty/mingw/strcasecmp.c
vendored
21
reactos/lib/3rdparty/mingw/strcasecmp.c
vendored
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* strcasecmp.c
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is a part of the mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within the package.
|
||||
*
|
||||
* Oldnames from ANSI header string.h
|
||||
*
|
||||
* Some wrapper functions for those old name functions whose appropriate
|
||||
* equivalents are not simply underscore prefixed.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
strcasecmp (const char *sz1, const char *sz2)
|
||||
{
|
||||
return _stricmp (sz1, sz2);
|
||||
}
|
||||
|
21
reactos/lib/3rdparty/mingw/strncasecmp.c
vendored
21
reactos/lib/3rdparty/mingw/strncasecmp.c
vendored
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* strncasecmp.c
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is a part of the mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within the package.
|
||||
*
|
||||
* Oldnames from ANSI header string.h
|
||||
*
|
||||
* Some wrapper functions for those old name functions whose appropriate
|
||||
* equivalents are not simply underscore prefixed.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
strncasecmp (const char *sz1, const char *sz2, size_t sizeMaxCompare)
|
||||
{
|
||||
return _strnicmp (sz1, sz2, sizeMaxCompare);
|
||||
}
|
||||
|
21
reactos/lib/3rdparty/mingw/wcscmpi.c
vendored
21
reactos/lib/3rdparty/mingw/wcscmpi.c
vendored
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* wcscmpi.c
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is a part of the mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within the package.
|
||||
*
|
||||
* Oldnames from ANSI header string.h
|
||||
*
|
||||
* Some wrapper functions for those old name functions whose appropriate
|
||||
* equivalents are not simply underscore prefixed.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
wcscmpi (const wchar_t * ws1, const wchar_t * ws2)
|
||||
{
|
||||
return _wcsicmp (ws1, ws2);
|
||||
}
|
||||
|
|
@ -79,7 +79,7 @@ vDbgPrintExWithPrefixInternal(IN LPCSTR Prefix,
|
|||
|
||||
/* Copy it */
|
||||
strncpy(Buffer, Prefix, PrefixLength);
|
||||
|
||||
|
||||
/* Do the printf */
|
||||
Length = _vsnprintf(Buffer + PrefixLength,
|
||||
sizeof(Buffer) - PrefixLength,
|
||||
|
@ -109,7 +109,7 @@ vDbgPrintExWithPrefixInternal(IN LPCSTR Prefix,
|
|||
/* Add the prefix */
|
||||
Length += PrefixLength;
|
||||
}
|
||||
|
||||
|
||||
/* Build the string */
|
||||
DebugString.Length = Length;
|
||||
DebugString.Buffer = Buffer;
|
||||
|
@ -202,17 +202,19 @@ __cdecl
|
|||
DbgPrint(PCCH Format,
|
||||
...)
|
||||
{
|
||||
ULONG n;
|
||||
va_list ap;
|
||||
|
||||
/* Call the internal routine that also handles ControlC */
|
||||
va_start(ap, Format);
|
||||
return vDbgPrintExWithPrefixInternal("",
|
||||
n = vDbgPrintExWithPrefixInternal("",
|
||||
-1,
|
||||
DPFLTR_ERROR_LEVEL,
|
||||
Format,
|
||||
ap,
|
||||
TRUE);
|
||||
va_end(ap);
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -225,17 +227,19 @@ DbgPrintEx(IN ULONG ComponentId,
|
|||
IN PCCH Format,
|
||||
...)
|
||||
{
|
||||
ULONG n;
|
||||
va_list ap;
|
||||
|
||||
/* Call the internal routine that also handles ControlC */
|
||||
va_start(ap, Format);
|
||||
return vDbgPrintExWithPrefixInternal("",
|
||||
n = vDbgPrintExWithPrefixInternal("",
|
||||
ComponentId,
|
||||
Level,
|
||||
Format,
|
||||
ap,
|
||||
TRUE);
|
||||
va_end(ap);
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -246,16 +250,19 @@ __cdecl
|
|||
DbgPrintReturnControlC(PCH Format,
|
||||
...)
|
||||
{
|
||||
ULONG n;
|
||||
va_list ap;
|
||||
|
||||
/* Call the internal routine that also handles ControlC */
|
||||
va_start(ap, Format);
|
||||
return vDbgPrintExWithPrefixInternal("",
|
||||
n = vDbgPrintExWithPrefixInternal("",
|
||||
-1,
|
||||
DPFLTR_ERROR_LEVEL,
|
||||
Format,
|
||||
ap,
|
||||
FALSE);
|
||||
va_end(ap);
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -60,7 +60,7 @@ static int is_data_file_module( PVOID BaseAddress )
|
|||
*/
|
||||
int push_language( USHORT *list, ULONG pos, WORD lang )
|
||||
{
|
||||
int i;
|
||||
ULONG i;
|
||||
for (i = 0; i < pos; i++) if (list[i] == lang) return pos;
|
||||
list[pos++] = lang;
|
||||
return pos;
|
||||
|
|
|
@ -31,9 +31,7 @@
|
|||
#include <reactos/helper.h>
|
||||
#include <pseh/pseh.h>
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
#endif /* RTL_H */
|
||||
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
#include <precomp.h>
|
||||
#include <math.h>
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define FPU_DOUBLE(var) double var; \
|
||||
__asm__ __volatile__( "fstpl %0;fwait" : "=m" (var) : )
|
||||
#define FPU_DOUBLES(var1,var2) double var1,var2; \
|
||||
__asm__ __volatile__( "fstpl %0;fwait" : "=m" (var2) : ); \
|
||||
__asm__ __volatile__( "fstpl %0;fwait" : "=m" (var1) : )
|
||||
#elif defined(_MSC_VER)
|
||||
#define FPU_DOUBLE(var) double var; \
|
||||
__asm { fstp [var] }; __asm { fwait };
|
||||
#define FPU_DOUBLES(var1,var2) double var1,var2; \
|
||||
__asm { fstp [var1] }; __asm { fwait }; \
|
||||
__asm { fstp [var2] }; __asm { fwait };
|
||||
#endif
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
|
|
|
@ -591,7 +591,7 @@ int toupper(int c)
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
wchar_t towlower(wchar_t c)
|
||||
wint_t towlower(wint_t c)
|
||||
{
|
||||
if (iswctype (c, _UPPER))
|
||||
return (c - upalpha);
|
||||
|
@ -601,7 +601,7 @@ wchar_t towlower(wchar_t c)
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
wchar_t towupper(wchar_t c)
|
||||
wint_t towupper(wint_t c)
|
||||
{
|
||||
if (iswctype (c, _LOWER))
|
||||
return (c + upalpha);
|
||||
|
|
Loading…
Reference in a new issue