Author: hbelusca
Date: Sun Oct 12 00:10:44 2014
New Revision: 64687
URL:
http://svn.reactos.org/svn/reactos?rev=64687&view=rev
Log:
[FAST486]
- fastcall'ize some functions,
- code formatting.
Modified:
trunk/reactos/lib/fast486/common.c
trunk/reactos/lib/fast486/common.h
trunk/reactos/lib/fast486/common.inl
trunk/reactos/lib/fast486/extraops.c
trunk/reactos/lib/fast486/extraops.h
trunk/reactos/lib/fast486/fast486.c
trunk/reactos/lib/fast486/fpu.c
trunk/reactos/lib/fast486/opcodes.c
trunk/reactos/lib/fast486/opcodes.h
trunk/reactos/lib/fast486/opgroups.c
trunk/reactos/lib/fast486/opgroups.h
Modified: trunk/reactos/lib/fast486/common.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.c?rev=6…
==============================================================================
--- trunk/reactos/lib/fast486/common.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/common.c [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -160,9 +160,8 @@
return Fast486WriteLinearMemory(State, LinearAddress, Buffer, Size);
}
-static
-inline
-BOOLEAN
+static inline BOOLEAN
+FASTCALL
Fast486GetIntVector(PFAST486_STATE State,
UCHAR Number,
PFAST486_IDT_ENTRY IdtEntry)
@@ -208,14 +207,15 @@
return TRUE;
}
-static
-inline
-BOOLEAN
+static inline BOOLEAN
+FASTCALL
Fast486InterruptInternal(PFAST486_STATE State,
- USHORT SegmentSelector,
- ULONG Offset,
- ULONG GateType)
-{
+ PFAST486_IDT_ENTRY IdtEntry)
+{
+ USHORT SegmentSelector = IdtEntry->Selector;
+ ULONG Offset = MAKELONG(IdtEntry->Offset, IdtEntry->OffsetHigh);
+ ULONG GateType = IdtEntry->Type;
+
BOOLEAN GateSize = (GateType == FAST486_IDT_INT_GATE_32)
|| (GateType == FAST486_IDT_TRAP_GATE_32);
BOOLEAN Success = FALSE;
@@ -355,6 +355,7 @@
}
BOOLEAN
+FASTCALL
Fast486PerformInterrupt(PFAST486_STATE State,
UCHAR Number)
{
@@ -368,10 +369,7 @@
}
/* Perform the interrupt */
- if (!Fast486InterruptInternal(State,
- IdtEntry.Selector,
- MAKELONG(IdtEntry.Offset, IdtEntry.OffsetHigh),
- IdtEntry.Type))
+ if (!Fast486InterruptInternal(State, &IdtEntry))
{
/* Exception occurred */
return FALSE;
Modified: trunk/reactos/lib/fast486/common.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.h?rev=6…
==============================================================================
--- trunk/reactos/lib/fast486/common.h [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/common.h [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -154,6 +154,7 @@
);
BOOLEAN
+FASTCALL
Fast486PerformInterrupt
(
PFAST486_STATE State,
Modified: trunk/reactos/lib/fast486/common.inl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.inl?rev…
==============================================================================
--- trunk/reactos/lib/fast486/common.inl [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/common.inl [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -53,6 +53,7 @@
FORCEINLINE
INT
+FASTCALL
Fast486GetCurrentPrivLevel(PFAST486_STATE State)
{
/* Return the CPL, or 3 if we're in virtual 8086 mode */
@@ -61,6 +62,7 @@
FORCEINLINE
ULONG
+FASTCALL
Fast486GetPageTableEntry(PFAST486_STATE State,
ULONG VirtualAddress,
BOOLEAN MarkAsDirty)
@@ -145,6 +147,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486ReadLinearMemory(PFAST486_STATE State,
ULONG LinearAddress,
PVOID Buffer,
@@ -211,6 +214,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486WriteLinearMemory(PFAST486_STATE State,
ULONG LinearAddress,
PVOID Buffer,
@@ -279,6 +283,7 @@
FORCEINLINE
VOID
+FASTCALL
Fast486Exception(PFAST486_STATE State,
FAST486_EXCEPTIONS ExceptionCode)
{
@@ -288,6 +293,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486StackPush(PFAST486_STATE State,
ULONG Value)
{
@@ -344,6 +350,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486StackPop(PFAST486_STATE State,
PULONG Value)
{
@@ -418,6 +425,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486LoadSegment(PFAST486_STATE State,
FAST486_SEG_REGS Segment,
USHORT Selector)
@@ -628,6 +636,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486FetchByte(PFAST486_STATE State,
PUCHAR Data)
{
@@ -658,6 +667,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486FetchWord(PFAST486_STATE State,
PUSHORT Data)
{
@@ -689,6 +699,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486FetchDword(PFAST486_STATE State,
PULONG Data)
{
@@ -720,6 +731,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486CalculateParity(UCHAR Number)
{
// See
http://graphics.stanford.edu/~seander/bithacks.html#ParityLookupTable too...
@@ -728,6 +740,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486ParseModRegRm(PFAST486_STATE State,
BOOLEAN AddressSize,
PFAST486_MOD_REG_RM ModRegRm)
@@ -995,6 +1008,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486ReadModrmByteOperands(PFAST486_STATE State,
PFAST486_MOD_REG_RM ModRegRm,
PUCHAR RegValue,
@@ -1061,6 +1075,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486ReadModrmWordOperands(PFAST486_STATE State,
PFAST486_MOD_REG_RM ModRegRm,
PUSHORT RegValue,
@@ -1109,6 +1124,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486ReadModrmDwordOperands(PFAST486_STATE State,
PFAST486_MOD_REG_RM ModRegRm,
PULONG RegValue,
@@ -1157,6 +1173,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486WriteModrmByteOperands(PFAST486_STATE State,
PFAST486_MOD_REG_RM ModRegRm,
BOOLEAN WriteRegister,
@@ -1221,6 +1238,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486WriteModrmWordOperands(PFAST486_STATE State,
PFAST486_MOD_REG_RM ModRegRm,
BOOLEAN WriteRegister,
@@ -1267,6 +1285,7 @@
FORCEINLINE
BOOLEAN
+FASTCALL
Fast486WriteModrmDwordOperands(PFAST486_STATE State,
PFAST486_MOD_REG_RM ModRegRm,
BOOLEAN WriteRegister,
@@ -1315,7 +1334,9 @@
FORCEINLINE
VOID
-Fast486FpuNormalize(PFAST486_STATE State, PFAST486_FPU_DATA_REG Data)
+FASTCALL
+Fast486FpuNormalize(PFAST486_STATE State,
+ PFAST486_FPU_DATA_REG Data)
{
UINT LeadingZeros;
@@ -1346,6 +1367,7 @@
FORCEINLINE
USHORT
+FASTCALL
Fast486GetValueTag(PFAST486_FPU_DATA_REG Data)
{
if (FPU_IS_ZERO(Data)) return FPU_TAG_ZERO;
@@ -1355,6 +1377,7 @@
FORCEINLINE
VOID
+FASTCALL
Fast486FpuPush(PFAST486_STATE State,
PFAST486_FPU_DATA_REG Data)
{
@@ -1370,6 +1393,7 @@
FORCEINLINE
VOID
+FASTCALL
Fast486FpuPop(PFAST486_STATE State)
{
if (FPU_GET_TAG(0) != FPU_TAG_EMPTY)
Modified: trunk/reactos/lib/fast486/extraops.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/extraops.c?rev…
==============================================================================
--- trunk/reactos/lib/fast486/extraops.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/extraops.c [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -2385,3 +2385,4 @@
}
}
+/* EOF */
Modified: trunk/reactos/lib/fast486/extraops.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/extraops.h?rev…
==============================================================================
--- trunk/reactos/lib/fast486/extraops.h [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/extraops.h [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -64,4 +64,3 @@
#endif // _EXTRAOPS_H_
/* EOF */
-
Modified: trunk/reactos/lib/fast486/fast486.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fast486.c?rev=…
==============================================================================
--- trunk/reactos/lib/fast486/fast486.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/fast486.c [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -43,9 +43,7 @@
/* PRIVATE FUNCTIONS **********************************************************/
-static
-inline
-VOID
+static inline VOID
NTAPI
Fast486ExecutionControl(PFAST486_STATE State, FAST486_EXEC_CMD Command)
{
Modified: trunk/reactos/lib/fast486/fpu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fpu.c?rev=6468…
==============================================================================
--- trunk/reactos/lib/fast486/fpu.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/fpu.c [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -32,9 +32,10 @@
/* PRIVATE FUNCTIONS **********************************************************/
-static ULONGLONG UnsignedMult128(ULONGLONG Multiplicand,
- ULONGLONG Multiplier,
- ULONGLONG *HighProduct)
+static ULONGLONG
+UnsignedMult128(ULONGLONG Multiplicand,
+ ULONGLONG Multiplier,
+ ULONGLONG *HighProduct)
{
ULONG MultiplicandLow, MultiplicandHigh, MultiplierLow, MultiplierHigh;
ULONG IntermediateLow, IntermediateHigh;
@@ -63,9 +64,10 @@
return LowProduct;
}
-static VOID Fast486FpuGetSingleReal(PFAST486_STATE State,
- ULONG Value,
- PFAST486_FPU_DATA_REG Result)
+static VOID
+Fast486FpuGetSingleReal(PFAST486_STATE State,
+ ULONG Value,
+ PFAST486_FPU_DATA_REG Result)
{
/* Extract the sign, exponent and mantissa */
Result->Sign = (UCHAR)(Value >> 31);
@@ -83,9 +85,10 @@
}
}
-static VOID Fast486FpuGetDoubleReal(PFAST486_STATE State,
- ULONGLONG Value,
- PFAST486_FPU_DATA_REG Result)
+static VOID
+Fast486FpuGetDoubleReal(PFAST486_STATE State,
+ ULONGLONG Value,
+ PFAST486_FPU_DATA_REG Result)
{
/* Extract the sign, exponent and mantissa */
Result->Sign = (UCHAR)(Value >> 63);
@@ -103,10 +106,11 @@
}
}
-static VOID Fast486FpuAdd(PFAST486_STATE State,
- PFAST486_FPU_DATA_REG FirstOperand,
- PFAST486_FPU_DATA_REG SecondOperand,
- PFAST486_FPU_DATA_REG Result)
+static VOID
+Fast486FpuAdd(PFAST486_STATE State,
+ PFAST486_FPU_DATA_REG FirstOperand,
+ PFAST486_FPU_DATA_REG SecondOperand,
+ PFAST486_FPU_DATA_REG Result)
{
FAST486_FPU_DATA_REG FirstAdjusted = *FirstOperand;
FAST486_FPU_DATA_REG SecondAdjusted = *SecondOperand;
@@ -182,10 +186,11 @@
*Result = TempResult;
}
-static VOID Fast486FpuSubtract(PFAST486_STATE State,
- PFAST486_FPU_DATA_REG FirstOperand,
- PFAST486_FPU_DATA_REG SecondOperand,
- PFAST486_FPU_DATA_REG Result)
+static VOID
+Fast486FpuSubtract(PFAST486_STATE State,
+ PFAST486_FPU_DATA_REG FirstOperand,
+ PFAST486_FPU_DATA_REG SecondOperand,
+ PFAST486_FPU_DATA_REG Result)
{
FAST486_FPU_DATA_REG NegativeSecondOperand = *SecondOperand;
@@ -196,9 +201,10 @@
Fast486FpuAdd(State, Result, FirstOperand, &NegativeSecondOperand);
}
-static VOID Fast486FpuCompare(PFAST486_STATE State,
- PFAST486_FPU_DATA_REG FirstOperand,
- PFAST486_FPU_DATA_REG SecondOperand)
+static VOID
+Fast486FpuCompare(PFAST486_STATE State,
+ PFAST486_FPU_DATA_REG FirstOperand,
+ PFAST486_FPU_DATA_REG SecondOperand)
{
if (FPU_IS_NAN(FirstOperand) || FPU_IS_NAN(SecondOperand))
{
@@ -248,10 +254,11 @@
}
}
-static VOID Fast486FpuMultiply(PFAST486_STATE State,
- PFAST486_FPU_DATA_REG FirstOperand,
- PFAST486_FPU_DATA_REG SecondOperand,
- PFAST486_FPU_DATA_REG Result)
+static VOID
+Fast486FpuMultiply(PFAST486_STATE State,
+ PFAST486_FPU_DATA_REG FirstOperand,
+ PFAST486_FPU_DATA_REG SecondOperand,
+ PFAST486_FPU_DATA_REG Result)
{
FAST486_FPU_DATA_REG TempResult;
@@ -273,10 +280,11 @@
*Result = TempResult;
}
-static VOID Fast486FpuDivide(PFAST486_STATE State,
- PFAST486_FPU_DATA_REG FirstOperand,
- PFAST486_FPU_DATA_REG SecondOperand,
- PFAST486_FPU_DATA_REG Result)
+static VOID
+Fast486FpuDivide(PFAST486_STATE State,
+ PFAST486_FPU_DATA_REG FirstOperand,
+ PFAST486_FPU_DATA_REG SecondOperand,
+ PFAST486_FPU_DATA_REG Result)
{
FAST486_FPU_DATA_REG TempResult;
Modified: trunk/reactos/lib/fast486/opcodes.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opcodes.c?rev=…
==============================================================================
--- trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -6314,3 +6314,5 @@
/* Return success */
return TRUE;
}
+
+/* EOF */
Modified: trunk/reactos/lib/fast486/opcodes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opcodes.h?rev=…
==============================================================================
--- trunk/reactos/lib/fast486/opcodes.h [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/opcodes.h [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -157,3 +157,5 @@
FAST486_OPCODE_HANDLER(Fast486OpcodeOuts);
#endif // _OPCODES_H_
+
+/* EOF */
Modified: trunk/reactos/lib/fast486/opgroups.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opgroups.c?rev…
==============================================================================
--- trunk/reactos/lib/fast486/opgroups.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/opgroups.c [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -32,8 +32,8 @@
/* PRIVATE FUNCTIONS **********************************************************/
+static
inline
-static
ULONG
Fast486ArithmeticOperation(PFAST486_STATE State,
INT Operation,
Modified: trunk/reactos/lib/fast486/opgroups.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opgroups.h?rev…
==============================================================================
--- trunk/reactos/lib/fast486/opgroups.h [iso-8859-1] (original)
+++ trunk/reactos/lib/fast486/opgroups.h [iso-8859-1] Sun Oct 12 00:10:44 2014
@@ -50,4 +50,3 @@
#endif // _OPGROUPS_H_
/* EOF */
-