Initial
This commit is contained in:
186
thread/SAVEAREA.HPP
Normal file
186
thread/SAVEAREA.HPP
Normal file
@@ -0,0 +1,186 @@
|
||||
#ifndef _THREAD_FLOATINGSAVEAREA_HPP_
|
||||
#define _THREAD_FLOATINGSAVEAREA_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_WINNT_HPP_
|
||||
#include <common/winnt.hpp>
|
||||
#endif
|
||||
|
||||
class FloatingSaveArea : private FLOATING_SAVE_AREA
|
||||
{
|
||||
public:
|
||||
FloatingSaveArea(void);
|
||||
FloatingSaveArea(const FloatingSaveArea &someFloatingSaveArea);
|
||||
FloatingSaveArea(const FLOATING_SAVE_AREA &someFLOATINGSAVEAREA);
|
||||
virtual ~FloatingSaveArea();
|
||||
FloatingSaveArea &operator=(const FloatingSaveArea &someFloatingSaveArea);
|
||||
FloatingSaveArea &operator=(const FLOATING_SAVE_AREA &someFLOATINGSAVEAREA);
|
||||
WORD operator==(const FloatingSaveArea &someFloatingSaveArea);
|
||||
WORD operator==(const FLOATING_SAVE_AREA &someFLOATINGSAVEAREA);
|
||||
BYTE &operator[](WORD itemIndex);
|
||||
DWORD statusWord(void)const;
|
||||
void statusWord(DWORD statusWord);
|
||||
DWORD tagWord(void)const;
|
||||
void tagWord(DWORD tagWord);
|
||||
DWORD errorOffset(void)const;
|
||||
void errorOffset(DWORD errorOffset);
|
||||
DWORD errorSelector(void)const;
|
||||
void errorSelector(DWORD errorSelector);
|
||||
DWORD dataOffset(void)const;
|
||||
void dataOffset(DWORD dataOffset);
|
||||
DWORD dataSelector(void)const;
|
||||
void dataSelector(DWORD dataSelector);
|
||||
DWORD cr0NpxState(void)const;
|
||||
void cr0NpxState(DWORD cr0NpxState);
|
||||
private:
|
||||
void setZero(void);
|
||||
};
|
||||
|
||||
inline
|
||||
FloatingSaveArea::FloatingSaveArea(void)
|
||||
{
|
||||
setZero();
|
||||
}
|
||||
|
||||
inline
|
||||
FloatingSaveArea::FloatingSaveArea(const FloatingSaveArea &someFloatingSaveArea)
|
||||
{
|
||||
*this=someFloatingSaveArea;
|
||||
}
|
||||
|
||||
inline
|
||||
FloatingSaveArea::FloatingSaveArea(const FLOATING_SAVE_AREA &someFLOATINGSAVEAREA)
|
||||
{
|
||||
*this=someFLOATINGSAVEAREA;
|
||||
}
|
||||
|
||||
inline
|
||||
FloatingSaveArea::~FloatingSaveArea()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
FloatingSaveArea &FloatingSaveArea::operator=(const FloatingSaveArea &someFloatingSaveArea)
|
||||
{
|
||||
::memcpy((char*)&((FLOATING_SAVE_AREA&)*this),(char*)&((FLOATING_SAVE_AREA&)someFloatingSaveArea),sizeof(FLOATING_SAVE_AREA));
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
FloatingSaveArea &FloatingSaveArea::operator=(const FLOATING_SAVE_AREA &someFLOATINGSAVEAREA)
|
||||
{
|
||||
::memcpy((char*)&((FLOATING_SAVE_AREA&)*this),(char*)&(someFLOATINGSAVEAREA),sizeof(FLOATING_SAVE_AREA));
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
WORD FloatingSaveArea::operator==(const FloatingSaveArea &someFloatingSaveArea)
|
||||
{
|
||||
return (::memcmp((char*)&((FLOATING_SAVE_AREA&)*this),(char*)&((FLOATING_SAVE_AREA&)someFloatingSaveArea),sizeof(FLOATING_SAVE_AREA))?FALSE:TRUE);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD FloatingSaveArea::operator==(const FLOATING_SAVE_AREA &someFLOATINGSAVEAREA)
|
||||
{
|
||||
return (::memcmp((char*)&((FLOATING_SAVE_AREA&)*this),(char*)&((FLOATING_SAVE_AREA&)someFLOATINGSAVEAREA),sizeof(FLOATING_SAVE_AREA))?FALSE:TRUE);
|
||||
}
|
||||
|
||||
inline
|
||||
BYTE &FloatingSaveArea::operator[](WORD itemIndex)
|
||||
{
|
||||
if(itemIndex>=SIZE_OF_80387_REGISTERS)itemIndex=0;
|
||||
return FLOATING_SAVE_AREA::RegisterArea[itemIndex];
|
||||
}
|
||||
|
||||
inline
|
||||
DWORD FloatingSaveArea::statusWord(void)const
|
||||
{
|
||||
return FLOATING_SAVE_AREA::StatusWord;
|
||||
}
|
||||
|
||||
inline
|
||||
void FloatingSaveArea::statusWord(DWORD statusWord)
|
||||
{
|
||||
FLOATING_SAVE_AREA::StatusWord=statusWord;
|
||||
}
|
||||
|
||||
inline
|
||||
DWORD FloatingSaveArea::tagWord(void)const
|
||||
{
|
||||
return FLOATING_SAVE_AREA::TagWord;
|
||||
}
|
||||
|
||||
inline
|
||||
void FloatingSaveArea::tagWord(DWORD tagWord)
|
||||
{
|
||||
FLOATING_SAVE_AREA::TagWord=tagWord;
|
||||
}
|
||||
|
||||
inline
|
||||
DWORD FloatingSaveArea::errorOffset(void)const
|
||||
{
|
||||
return FLOATING_SAVE_AREA::ErrorOffset;
|
||||
}
|
||||
|
||||
inline
|
||||
void FloatingSaveArea::errorOffset(DWORD errorOffset)
|
||||
{
|
||||
FLOATING_SAVE_AREA::ErrorOffset=errorOffset;
|
||||
}
|
||||
|
||||
inline
|
||||
DWORD FloatingSaveArea::errorSelector(void)const
|
||||
{
|
||||
return FLOATING_SAVE_AREA::ErrorSelector;
|
||||
}
|
||||
|
||||
inline
|
||||
void FloatingSaveArea::errorSelector(DWORD errorSelector)
|
||||
{
|
||||
FLOATING_SAVE_AREA::ErrorSelector=errorSelector;
|
||||
}
|
||||
|
||||
inline
|
||||
DWORD FloatingSaveArea::dataOffset(void)const
|
||||
{
|
||||
return FLOATING_SAVE_AREA::DataOffset;
|
||||
}
|
||||
|
||||
inline
|
||||
void FloatingSaveArea::dataOffset(DWORD dataOffset)
|
||||
{
|
||||
FLOATING_SAVE_AREA::DataOffset=dataOffset;
|
||||
}
|
||||
|
||||
inline
|
||||
DWORD FloatingSaveArea::dataSelector(void)const
|
||||
{
|
||||
return FLOATING_SAVE_AREA::DataSelector;
|
||||
}
|
||||
|
||||
inline
|
||||
void FloatingSaveArea::dataSelector(DWORD dataSelector)
|
||||
{
|
||||
FLOATING_SAVE_AREA::DataSelector=dataSelector;
|
||||
}
|
||||
|
||||
inline
|
||||
DWORD FloatingSaveArea::cr0NpxState(void)const
|
||||
{
|
||||
return FLOATING_SAVE_AREA::Cr0NpxState;
|
||||
}
|
||||
|
||||
inline
|
||||
void FloatingSaveArea::cr0NpxState(DWORD cr0NpxState)
|
||||
{
|
||||
FLOATING_SAVE_AREA::Cr0NpxState=cr0NpxState;
|
||||
}
|
||||
|
||||
inline
|
||||
void FloatingSaveArea::setZero(void)
|
||||
{
|
||||
::memset((char*)&((FLOATING_SAVE_AREA&)*this),0,sizeof(FLOATING_SAVE_AREA));
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user