mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:55:42 +00:00
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
This commit is contained in:
parent
b94e2d8ca0
commit
c2c66aff7d
24198 changed files with 0 additions and 37285 deletions
166
drivers/filesystems/udfs/Include/tools.cpp
Normal file
166
drivers/filesystems/udfs/Include/tools.cpp
Normal file
|
@ -0,0 +1,166 @@
|
|||
////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
|
||||
// All rights reserved
|
||||
// This file was released under the GPLv2 on June 2015.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
Module Name:
|
||||
|
||||
tools.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
This module contains some useful functions for data manipulation.
|
||||
|
||||
Environment:
|
||||
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//----------------
|
||||
|
||||
#include "tools.h"
|
||||
|
||||
//----------------
|
||||
|
||||
#ifdef _X86_
|
||||
|
||||
__declspec (naked)
|
||||
void
|
||||
__fastcall
|
||||
_MOV_DD_SWP(
|
||||
void* a, // ECX
|
||||
void* b // EDX
|
||||
)
|
||||
{
|
||||
_asm {
|
||||
mov eax,[edx]
|
||||
bswap eax
|
||||
mov [ecx],eax
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
__declspec (naked)
|
||||
void
|
||||
__fastcall
|
||||
_MOV_DW_SWP(
|
||||
void* a, // ECX
|
||||
void* b // EDX
|
||||
)
|
||||
{
|
||||
_asm {
|
||||
mov ax,[edx]
|
||||
rol ax,8
|
||||
mov [ecx],ax
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
__declspec (naked)
|
||||
void
|
||||
__fastcall
|
||||
_REVERSE_DD(
|
||||
void* a // ECX
|
||||
)
|
||||
{
|
||||
_asm {
|
||||
mov eax,[ecx]
|
||||
bswap eax
|
||||
mov [ecx],eax
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
__declspec (naked)
|
||||
void
|
||||
__fastcall
|
||||
_REVERSE_DW(
|
||||
void* a // ECX
|
||||
)
|
||||
{
|
||||
_asm {
|
||||
mov ax,[ecx]
|
||||
rol ax,8
|
||||
mov [ecx],ax
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
__declspec (naked)
|
||||
void
|
||||
__fastcall
|
||||
_MOV_DW2DD_SWP(
|
||||
void* a, // ECX
|
||||
void* b // EDX
|
||||
)
|
||||
{
|
||||
_asm {
|
||||
mov ax,[edx]
|
||||
rol ax,8
|
||||
mov [ecx+2],ax
|
||||
mov [ecx],0
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
__declspec (naked)
|
||||
void
|
||||
__fastcall
|
||||
_MOV_MSF(
|
||||
void* a, // ECX
|
||||
void* b // EDX
|
||||
)
|
||||
{
|
||||
_asm {
|
||||
mov eax,[edx]
|
||||
mov [ecx],ax
|
||||
shr eax,16
|
||||
mov [ecx+2],al
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
__declspec (naked)
|
||||
void
|
||||
__fastcall
|
||||
_MOV_MSF_SWP(
|
||||
void* a, // ECX
|
||||
void* b // EDX
|
||||
)
|
||||
{
|
||||
_asm {
|
||||
mov eax,[edx]
|
||||
mov [ecx+2],al
|
||||
bswap eax
|
||||
shr eax,8
|
||||
mov [ecx],ax
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
__declspec (naked)
|
||||
void
|
||||
__fastcall
|
||||
_XCHG_DD(
|
||||
void* a, // ECX
|
||||
void* b // EDX
|
||||
)
|
||||
{
|
||||
_asm {
|
||||
mov eax,[edx]
|
||||
xchg eax,[ecx]
|
||||
mov [edx],eax
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
#endif _X86_
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue