mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
modified dll/win32/srclient/srclient_main.c
What the hell, Arch Blackmann? <windef.h>, <winbase.h> and <winnls.h> are not meant to be included directly. Include <windows.h> instead modified drivers/video/font/ftfd/rosglue.c Move standard C includes before Windows includes, so the required types are defined beforehand modified include/crt/_mingw.h Re-add Visual C++ support va_list is not a built-in type, it does not belong in _mingw.h Do not include intrin.h (screw you, Arch) Removed definition of _USE_32BIT_TIME_T ("ROS HACK!") modified include/crt/conio.h modified include/crt/stdio.h modified include/crt/wchar.h Pull in va_list from stdarg.h modified include/crt/mingw32/intrin.h modified include/crt/mingw32/intrin_arm.h modified include/crt/mingw32/intrin_x86.h intrin.h defines size_t and uintptr_t The _real_, ultimate magic incantation for inline functions is extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) Fix __addfsbyte, __addfsword added include/crt/msc added include/crt/msc/intrin.h Ported our intrin.h to Visual C++ modified ReactOS-arm.rbuild modified ReactOS-i386.rbuild ROS HACK!s belong in the project definition modified ReactOS-generic.rbuild Compiler-specific include directories svn path=/trunk/; revision=41421
This commit is contained in:
parent
541c10e66b
commit
66128d2725
|
@ -23,7 +23,7 @@
|
|||
<define name="KDBG">1</define>
|
||||
<property name="DBG_OR_KDBG" value="true" />
|
||||
</if>
|
||||
|
||||
|
||||
<include>.</include>
|
||||
<include>include</include>
|
||||
<include root="intermediate">include</include>
|
||||
|
@ -71,11 +71,11 @@
|
|||
<compilerflag>-fno-strict-aliasing</compilerflag>
|
||||
<linkerflag>--strip-debug</linkerflag>
|
||||
<linkerflag>-static</linkerflag>
|
||||
|
||||
|
||||
<directory name="media">
|
||||
<directory name="nls">
|
||||
<xi:include href="media/nls/nls.rbuild" />
|
||||
</directory>
|
||||
</directory>
|
||||
</directory>
|
||||
<directory name="lib">
|
||||
<directory name="drivers">
|
||||
|
@ -180,13 +180,15 @@
|
|||
<directory name="dll">
|
||||
<directory name="ntdll">
|
||||
<xi:include href="dll/ntdll/ntdll.rbuild" />
|
||||
</directory>
|
||||
</directory>
|
||||
</directory>
|
||||
<directory name="base">
|
||||
<directory name="system">
|
||||
<directory name="smss">
|
||||
<xi:include href="base/system/smss/smss.rbuild" />
|
||||
</directory>
|
||||
</directory>
|
||||
</directory>
|
||||
</directory>
|
||||
</directory>
|
||||
|
||||
<define name="_USE_32BIT_TIME_T" />
|
||||
</project>
|
||||
|
|
|
@ -67,7 +67,8 @@
|
|||
<include>include/dxsdk</include>
|
||||
<include root="intermediate">include/dxsdk</include>
|
||||
<include>include/crt</include>
|
||||
<include>include/crt/mingw32</include>
|
||||
<include compilerset="gcc">include/crt/mingw32</include>
|
||||
<include compilerset="msc">include/crt/msc</include>
|
||||
<include>include/ddk</include>
|
||||
<include>include/GL</include>
|
||||
<include>include/ndk</include>
|
||||
|
|
|
@ -79,4 +79,5 @@
|
|||
<linkerflag>-disable-stdcall-fixup</linkerflag>
|
||||
</group>
|
||||
|
||||
<define name="_USE_32BIT_TIME_T" />
|
||||
</project>
|
||||
|
|
|
@ -16,9 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winnls.h>
|
||||
#include <windows.h>
|
||||
#include <srrestoreptapi.h>
|
||||
|
||||
#define NDEBUG
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
* NOTES:
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <windef.h>
|
||||
#include <wingdi.h>
|
||||
#include <winddi.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
|
|
@ -9,13 +9,6 @@
|
|||
|
||||
#define _INTEGRAL_MAX_BITS 64
|
||||
|
||||
// ROS HACK!
|
||||
#ifndef _WIN64
|
||||
#ifndef _USE_32BIT_TIME_T
|
||||
#define _USE_32BIT_TIME_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MINGW64
|
||||
#define MINGW64
|
||||
#define MINGW64_VERSION 1.0
|
||||
|
@ -48,15 +41,19 @@
|
|||
#define __MINGW_GNUC_PREREQ(major, minor) 0
|
||||
#endif
|
||||
|
||||
#if !defined (_MSC_VER)
|
||||
#define __MINGW_MSC_PREREQ(major, minor) 0
|
||||
#if defined (_MSC_VER)
|
||||
#define __MINGW_MSC_PREREQ(major, minor) ((major * 100 + minor * 10) >= _MSC_VER)
|
||||
#else
|
||||
#define __MINGW_MSC_PREREQ(major, minor) 0
|
||||
#endif
|
||||
|
||||
#define USE___UUIDOF 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define __CRT_INLINE inline
|
||||
#else
|
||||
#elif defined(_MSC_VER)
|
||||
# define __CRT_INLINE __inline
|
||||
#elif defined(__GNUC__)
|
||||
# if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
|
||||
# define __CRT_INLINE extern inline __attribute__((__always_inline__,__gnu_inline__))
|
||||
# else
|
||||
|
@ -79,8 +76,10 @@
|
|||
#else
|
||||
# ifdef __GNUC__
|
||||
# define __unaligned __attribute((packed))
|
||||
# elif defined(_MSC_VER) && !defined(_M_IA64) && !defined(_M_AMD64)
|
||||
# define __unaligned
|
||||
# else
|
||||
# define __UNUSED_PARAM(x) x
|
||||
# define __unaligned
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@ -98,6 +97,9 @@
|
|||
#if __MINGW_GNUC_PREREQ (3, 0)
|
||||
#define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
|
||||
#define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
|
||||
#elif __MINGW_MSC_PREREQ(14, 0)
|
||||
#define __MINGW_ATTRIB_MALLOC __declspec(noalias) __declspec(restrict)
|
||||
#define __MINGW_ATTRIB_PURE
|
||||
#else
|
||||
#define __MINGW_ATTRIB_MALLOC
|
||||
#define __MINGW_ATTRIB_PURE
|
||||
|
@ -119,7 +121,7 @@
|
|||
#else
|
||||
#define __MINGW_ATTRIB_DEPRECATED
|
||||
#endif
|
||||
|
||||
|
||||
#if __MINGW_GNUC_PREREQ (3, 3)
|
||||
#define __MINGW_NOTHROW __attribute__ ((__nothrow__))
|
||||
#elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
|
||||
|
@ -172,20 +174,6 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */
|
|||
#define USE_MINGW_SETJMP_TWO_ARGS
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef __GNUC_VA_LIST
|
||||
#define __GNUC_VA_LIST
|
||||
typedef __builtin_va_list __gnuc_va_list;
|
||||
#endif
|
||||
|
||||
#ifndef _VA_LIST_DEFINED
|
||||
#define _VA_LIST_DEFINED
|
||||
typedef __gnuc_va_list va_list;
|
||||
#endif
|
||||
|
||||
/* Diable deprecation for now! */
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _CRT_SECURE_NO_DEPRECATE_CORE
|
||||
|
@ -193,40 +181,11 @@ extern "C" {
|
|||
#define _CRT_NONSTDC_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#if (defined(_MSC_VER) && __STDC__)// || !defined(__WINESRC__)
|
||||
#define NO_OLDNAMES
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define __crt_typefix(ctype)
|
||||
|
||||
#ifndef _CRT_UNUSED
|
||||
#define _CRT_UNUSED(x) (void)x
|
||||
#endif
|
||||
|
||||
/* These are here for intrin.h */
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
#define _SIZE_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef unsigned __int64 size_t;
|
||||
#else
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _UINTPTR_T_DEFINED
|
||||
#define _UINTPTR_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <mingw32/intrin.h>
|
||||
|
||||
#endif /* !_INC_MINGW */
|
||||
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
#include <crtdefs.h>
|
||||
|
||||
#define __need___va_list
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -30,8 +30,24 @@
|
|||
|
||||
#ifndef RC_INVOKED
|
||||
|
||||
#ifndef __GNUC__
|
||||
#error Unsupported compiler
|
||||
#define __INTRIN_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
#define _SIZE_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef unsigned __int64 size_t;
|
||||
#else
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _UINTPTR_T_DEFINED
|
||||
#define _UINTPTR_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -34,10 +34,10 @@
|
|||
|
||||
#define _ReadWriteBarrier() __sync_synchronize()
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * const dest, const long exch, const long comp)
|
||||
__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const dest, const long exch, const long comp)
|
||||
{
|
||||
long a, b;
|
||||
|
||||
|
||||
__asm__ __volatile__ ( "0:\n\t"
|
||||
"ldr %1, [%2]\n\t"
|
||||
"cmp %1, %4\n\t"
|
||||
|
@ -50,11 +50,11 @@ static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchang
|
|||
: "=&r" (a), "=&r" (b)
|
||||
: "r" (dest), "r" (exch), "r" (comp)
|
||||
: "cc", "memory");
|
||||
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const dest, const long long exch, const long long comp)
|
||||
__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const dest, const long long exch, const long long comp)
|
||||
{
|
||||
//
|
||||
// FIXME
|
||||
|
@ -65,16 +65,16 @@ static __inline__ __attribute__((always_inline)) long long _InterlockedCompareEx
|
|||
return result;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
|
||||
__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
|
||||
{
|
||||
return (void*)_InterlockedCompareExchange((volatile long* const)Destination, (const long)Exchange, (const long)Comperand);
|
||||
}
|
||||
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const dest, const long add)
|
||||
__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const dest, const long add)
|
||||
{
|
||||
long a, b, c;
|
||||
|
||||
|
||||
__asm__ __volatile__ ( "0:\n\t"
|
||||
"ldr %0, [%3]\n\t"
|
||||
"add %1, %0, %4\n\t"
|
||||
|
@ -85,201 +85,201 @@ static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(vo
|
|||
: "=&r" (a), "=&r" (b), "=&r" (c)
|
||||
: "r" (dest), "r" (add)
|
||||
: "cc", "memory");
|
||||
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const dest, const long exch)
|
||||
__INTRIN_INLINE long _InterlockedExchange(volatile long * const dest, const long exch)
|
||||
{
|
||||
long a;
|
||||
|
||||
|
||||
__asm__ __volatile__ ( "swp %0, %2, [%1]"
|
||||
: "=&r" (a)
|
||||
: "r" (dest), "r" (exch));
|
||||
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
|
||||
__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
|
||||
{
|
||||
return _InterlockedExchange(Target, Value);
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask)
|
||||
__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask)
|
||||
{
|
||||
char x;
|
||||
char y;
|
||||
|
||||
|
||||
y = *value;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
x = y;
|
||||
y = _InterlockedCompareExchange8(value, x & mask, x);
|
||||
}
|
||||
while(y != x);
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask)
|
||||
__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask)
|
||||
{
|
||||
short x;
|
||||
short y;
|
||||
|
||||
|
||||
y = *value;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
x = y;
|
||||
y = _InterlockedCompareExchange16(value, x & mask, x);
|
||||
}
|
||||
while(y != x);
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask)
|
||||
__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask)
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
|
||||
|
||||
y = *value;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
x = y;
|
||||
y = _InterlockedCompareExchange(value, x & mask, x);
|
||||
}
|
||||
while(y != x);
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask)
|
||||
__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask)
|
||||
{
|
||||
char x;
|
||||
char y;
|
||||
|
||||
|
||||
y = *value;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
x = y;
|
||||
y = _InterlockedCompareExchange8(value, x | mask, x);
|
||||
}
|
||||
while(y != x);
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask)
|
||||
__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask)
|
||||
{
|
||||
short x;
|
||||
short y;
|
||||
|
||||
|
||||
y = *value;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
x = y;
|
||||
y = _InterlockedCompareExchange16(value, x | mask, x);
|
||||
}
|
||||
while(y != x);
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask)
|
||||
__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask)
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
|
||||
|
||||
y = *value;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
x = y;
|
||||
y = _InterlockedCompareExchange(value, x | mask, x);
|
||||
}
|
||||
while(y != x);
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask)
|
||||
__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask)
|
||||
{
|
||||
char x;
|
||||
char y;
|
||||
|
||||
|
||||
y = *value;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
x = y;
|
||||
y = _InterlockedCompareExchange8(value, x ^ mask, x);
|
||||
}
|
||||
while(y != x);
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask)
|
||||
__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask)
|
||||
{
|
||||
short x;
|
||||
short y;
|
||||
|
||||
|
||||
y = *value;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
x = y;
|
||||
y = _InterlockedCompareExchange16(value, x ^ mask, x);
|
||||
}
|
||||
while(y != x);
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask)
|
||||
__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask)
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
|
||||
|
||||
y = *value;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
x = y;
|
||||
y = _InterlockedCompareExchange(value, x ^ mask, x);
|
||||
}
|
||||
while(y != x);
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long _InterlockedDecrement(volatile long * const lpAddend)
|
||||
__INTRIN_INLINE long _InterlockedDecrement(volatile long * const lpAddend)
|
||||
{
|
||||
return _InterlockedExchangeAdd(lpAddend, -1) - 1;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long _InterlockedIncrement(volatile long * const lpAddend)
|
||||
__INTRIN_INLINE long _InterlockedIncrement(volatile long * const lpAddend)
|
||||
{
|
||||
return _InterlockedExchangeAdd(lpAddend, 1) + 1;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long _InterlockedDecrement16(volatile short * const lpAddend)
|
||||
__INTRIN_INLINE long _InterlockedDecrement16(volatile short * const lpAddend)
|
||||
{
|
||||
return _InterlockedExchangeAdd16(lpAddend, -1) - 1;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) long _InterlockedIncrement16(volatile short * const lpAddend)
|
||||
__INTRIN_INLINE long _InterlockedIncrement16(volatile short * const lpAddend)
|
||||
{
|
||||
return _InterlockedExchangeAdd16(lpAddend, 1) + 1;
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) void _disable(void)
|
||||
__INTRIN_INLINE void _disable(void)
|
||||
{
|
||||
__asm__ __volatile__
|
||||
(
|
||||
|
@ -289,7 +289,7 @@ static __inline__ __attribute__((always_inline)) void _disable(void)
|
|||
);
|
||||
}
|
||||
|
||||
static __inline__ __attribute__((always_inline)) void _enable(void)
|
||||
__INTRIN_INLINE void _enable(void)
|
||||
{
|
||||
__asm__ __volatile__
|
||||
(
|
||||
|
@ -300,7 +300,7 @@ static __inline__ __attribute__((always_inline)) void _enable(void)
|
|||
}
|
||||
|
||||
#ifndef __MSVCRT__
|
||||
static __inline__ __attribute__((always_inline)) unsigned long _rotl(const unsigned long value, const unsigned char shift)
|
||||
__INTRIN_INLINE unsigned long _rotl(const unsigned long value, const unsigned char shift)
|
||||
{
|
||||
return (((value) << ((int)(shift))) | ((value) >> (32 - (int)(shift))));
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
188
reactos/include/crt/msc/intrin.h
Normal file
188
reactos/include/crt/msc/intrin.h
Normal file
|
@ -0,0 +1,188 @@
|
|||
#ifndef KJK_INTRIN_H_
|
||||
#define KJK_INTRIN_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*** Stack frame juggling ***/
|
||||
void * _ReturnAddress(void);
|
||||
void * _AddressOfReturnAddress(void);
|
||||
unsigned int __getcallerseflags(void);
|
||||
|
||||
/*** Atomic operations ***/
|
||||
void _ReadWriteBarrier(void);
|
||||
void _ReadBarrier(void);
|
||||
void _WriteBarrier(void);
|
||||
|
||||
char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand);
|
||||
short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand);
|
||||
long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand);
|
||||
void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand);
|
||||
long _InterlockedExchange(volatile long * const Target, const long Value);
|
||||
void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value);
|
||||
long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value);
|
||||
long _InterlockedExchangeAdd(volatile long * const Addend, const long Value);
|
||||
char _InterlockedAnd8(volatile char * const value, const char mask);
|
||||
short _InterlockedAnd16(volatile short * const value, const short mask);
|
||||
long _InterlockedAnd(volatile long * const value, const long mask);
|
||||
char _InterlockedOr8(volatile char * const value, const char mask);
|
||||
short _InterlockedOr16(volatile short * const value, const short mask);
|
||||
long _InterlockedOr(volatile long * const value, const long mask);
|
||||
char _InterlockedXor8(volatile char * const value, const char mask);
|
||||
short _InterlockedXor16(volatile short * const value, const short mask);
|
||||
long _InterlockedXor(volatile long * const value, const long mask);
|
||||
long _InterlockedAddLargeStatistic(volatile __int64 * const Addend, const long Value);
|
||||
long _InterlockedDecrement(volatile long * const lpAddend);
|
||||
long _InterlockedIncrement(volatile long * const lpAddend);
|
||||
long _InterlockedDecrement16(volatile short * const lpAddend);
|
||||
long _InterlockedIncrement16(volatile short * const lpAddend);
|
||||
unsigned char _interlockedbittestandreset(volatile long * a, const long b);
|
||||
unsigned char _interlockedbittestandset(volatile long * a, const long b);
|
||||
|
||||
#if defined(_M_AMD64)
|
||||
__int64 _InterlockedExchange64(volatile __int64 * const Target, const __int64 Value);
|
||||
__int64 _InterlockedExchangeAdd64(volatile __int64 * const Addend, const __int64 Value);
|
||||
long _InterlockedAnd64(volatile __int64 * const value, const __int64 mask);
|
||||
long _InterlockedOr64(volatile __int64 * const value, const __int64 mask);
|
||||
__int64 _InterlockedCompareExchange64(volatile __int64 * const Destination, const __int64 Exchange, const __int64 Comperand);
|
||||
__int64 _InterlockedDecrement64(volatile __int64 * const lpAddend);
|
||||
__int64 _InterlockedIncrement64(volatile __int64 * const lpAddend);
|
||||
unsigned char _interlockedbittestandreset64(volatile __int64 * a, const __int64 b);
|
||||
unsigned char _interlockedbittestandset64(volatile __int64 * a, const __int64 b);
|
||||
#endif
|
||||
|
||||
/*** String operations ***/
|
||||
void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count);
|
||||
void __stosw(unsigned short * Dest, const unsigned short Data, size_t Count);
|
||||
void __stosd(unsigned long * Dest, const unsigned long Data, size_t Count);
|
||||
void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count);
|
||||
void __movsw(unsigned short * Destination, const unsigned short * Source, size_t Count);
|
||||
void __movsd(unsigned long * Destination, const unsigned long * Source, size_t Count);
|
||||
|
||||
#if defined(_M_AMD64)
|
||||
/*** GS segment addressing ***/
|
||||
void __writegsbyte(const unsigned long Offset, const unsigned char Data);
|
||||
void __writegsword(const unsigned long Offset, const unsigned short Data);
|
||||
void __writegsdword(const unsigned long Offset, const unsigned long Data);
|
||||
void __writegsqword(const unsigned long Offset, const unsigned __int64 Data);
|
||||
unsigned char __readgsbyte(const unsigned long Offset);
|
||||
unsigned short __readgsword(const unsigned long Offset);
|
||||
unsigned long __readgsdword(const unsigned long Offset);
|
||||
unsigned __int64 __readgsqword(const unsigned long Offset);
|
||||
void __incgsbyte(const unsigned long Offset);
|
||||
void __incgsword(const unsigned long Offset);
|
||||
void __incgsdword(const unsigned long Offset);
|
||||
void __addgsbyte(const unsigned long Offset, const unsigned char Data);
|
||||
void __addgsword(const unsigned long Offset, const unsigned short Data);
|
||||
void __addgsdword(const unsigned long Offset, const unsigned int Data);
|
||||
void __addgsqword(const unsigned long Offset, const unsigned __int64 Data);
|
||||
#endif
|
||||
|
||||
#if defined(_M_IX86)
|
||||
/*** FS segment addressing ***/
|
||||
void __writefsbyte(const unsigned long Offset, const unsigned char Data);
|
||||
void __writefsword(const unsigned long Offset, const unsigned short Data);
|
||||
void __writefsdword(const unsigned long Offset, const unsigned long Data);
|
||||
unsigned char __readfsbyte(const unsigned long Offset);
|
||||
unsigned short __readfsword(const unsigned long Offset);
|
||||
unsigned long __readfsdword(const unsigned long Offset);
|
||||
void __incfsbyte(const unsigned long Offset);
|
||||
void __incfsword(const unsigned long Offset);
|
||||
void __incfsdword(const unsigned long Offset);
|
||||
void __addfsbyte(const unsigned long Offset, const unsigned char Data);
|
||||
void __addfsword(const unsigned long Offset, const unsigned short Data);
|
||||
void __addfsdword(const unsigned long Offset, const unsigned int Data)
|
||||
#endif
|
||||
|
||||
|
||||
/*** Bit manipulation ***/
|
||||
unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask);
|
||||
unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask);
|
||||
unsigned char _bittest(const long * const a, const long b);
|
||||
unsigned char _bittestandcomplement(long * const a, const long b);
|
||||
unsigned char _bittestandreset(long * const a, const long b);
|
||||
unsigned char _bittestandset(long * const a, const long b);
|
||||
unsigned char _rotl8(unsigned char value, unsigned char shift);
|
||||
unsigned short _rotl16(unsigned short value, unsigned char shift);
|
||||
unsigned int _rotl(unsigned int value, int shift);
|
||||
unsigned int _rotr(unsigned int value, int shift);
|
||||
unsigned char _rotr8(unsigned char value, unsigned char shift);
|
||||
unsigned short _rotr16(unsigned short value, unsigned char shift);
|
||||
unsigned __int64 __ll_lshift(const unsigned __int64 Mask, const int Bit);
|
||||
__int64 __ll_rshift(const __int64 Mask, const int Bit);
|
||||
unsigned __int64 __ull_rshift(const unsigned __int64 Mask, int Bit);
|
||||
unsigned short _byteswap_ushort(unsigned short value);
|
||||
unsigned long _byteswap_ulong(unsigned long value);
|
||||
unsigned __int64 _byteswap_uint64(unsigned __int64 value);
|
||||
|
||||
/*** 64-bit math ***/
|
||||
__int64 __emul(const int a, const int b);
|
||||
unsigned __int64 __emulu(const unsigned int a, const unsigned int b);
|
||||
|
||||
/*** Port I/O ***/
|
||||
unsigned char __inbyte(const unsigned short Port);
|
||||
unsigned short __inword(const unsigned short Port);
|
||||
unsigned long __indword(const unsigned short Port);
|
||||
void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count);
|
||||
void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count);
|
||||
void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count);
|
||||
void __outbyte(unsigned short const Port, const unsigned char Data);
|
||||
void __outword(unsigned short const Port, const unsigned short Data);
|
||||
void __outdword(unsigned short const Port, const unsigned long Data);
|
||||
void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count);
|
||||
void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count);
|
||||
void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count);
|
||||
|
||||
/*** System information ***/
|
||||
void __cpuid(int CPUInfo[], const int InfoType);
|
||||
unsigned __int64 __rdtsc(void);
|
||||
void __writeeflags(uintptr_t Value);
|
||||
uintptr_t __readeflags(void);
|
||||
|
||||
/*** Interrupts ***/
|
||||
void __debugbreak(void);
|
||||
void __int2c(void);
|
||||
void _disable(void);
|
||||
void _enable(void);
|
||||
|
||||
/*** Protected memory management ***/
|
||||
void __writecr0(const unsigned __int64 Data);
|
||||
void __writecr3(const unsigned __int64 Data);
|
||||
void __writecr4(const unsigned __int64 Data);
|
||||
|
||||
#ifdef _M_AMD64
|
||||
void __writecr8(const unsigned __int64 Data);
|
||||
#endif
|
||||
|
||||
unsigned __int64 __readcr0(void);
|
||||
unsigned __int64 __readcr2(void);
|
||||
unsigned __int64 __readcr3(void);
|
||||
unsigned __int64 __readcr4(void);
|
||||
|
||||
#ifdef _M_AMD64
|
||||
unsigned __int64 __readcr8(void);
|
||||
#endif
|
||||
|
||||
unsigned __int64 __readdr(unsigned int reg);
|
||||
void __writedr(unsigned reg, unsigned __int64 value);
|
||||
|
||||
void __invlpg(void * const Address);
|
||||
|
||||
/*** System operations ***/
|
||||
unsigned __int64 __readmsr(const int reg);
|
||||
void __writemsr(const unsigned long Register, const unsigned __int64 Value);
|
||||
unsigned __int64 __readpmc(const int counter);
|
||||
unsigned long __segmentlimit(const unsigned long a);
|
||||
void __wbinvd(void);
|
||||
void __lidt(void *Source);
|
||||
void __sidt(void *Destination);
|
||||
void _mm_pause(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* KJK_INTRIN_H_ */
|
||||
|
||||
/* EOF */
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
#include <crtdefs.h>
|
||||
|
||||
#define __need___va_list
|
||||
#include <stdarg.h>
|
||||
|
||||
#pragma pack(push,_CRT_PACKING)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
#include <crtdefs.h>
|
||||
|
||||
#define __need___va_list
|
||||
#include <stdarg.h>
|
||||
|
||||
#pragma pack(push,_CRT_PACKING)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in a new issue