diff --git a/reactos/ntoskrnl/.cvsignore b/reactos/ntoskrnl/.cvsignore index 3eff8453832..b40c38a3254 100644 --- a/reactos/ntoskrnl/.cvsignore +++ b/reactos/ntoskrnl/.cvsignore @@ -1,11 +1,12 @@ +objects base.tmp junk.tmp -ntoskrnl.coff -objects temp.exp +ntoskrnl.coff +ntoskrnl.map ntoskrnl.dbg bugcodes.rc msg*.bin -ntoskrnl.map *.o *.sym +*.exe diff --git a/reactos/ntoskrnl/Makefile b/reactos/ntoskrnl/Makefile index d134a4e2e78..a98d6e3c9c4 100644 --- a/reactos/ntoskrnl/Makefile +++ b/reactos/ntoskrnl/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.88 2002/12/09 15:18:11 robd Exp $ +# $Id: Makefile,v 1.89 2003/01/07 17:48:11 robd Exp $ # # ReactOS Operating System # @@ -89,6 +89,7 @@ OBJECTS_RTL = \ rtl/error.o \ rtl/handle.o \ rtl/largeint.o \ + rtl/math.o \ rtl/mem.o \ rtl/memchr.o \ rtl/memcpy.o \ @@ -336,7 +337,8 @@ OBJECTS_KD = \ kd/kdebug.o \ kd/service.o \ kd/dlog.o \ - kd/gdbstub.o kd/mda.o + kd/gdbstub.o \ + kd/mda.o DEP_OBJECTS := $(OBJECTS_NT) $(OBJECTS_MM) $(OBJECTS_ARCH) \ $(OBJECTS_IO) $(OBJECTS_KE) $(OBJECTS_OB) \ @@ -652,7 +654,7 @@ implib: $(DDK_PATH_LIB)/$(TARGETNAME).a clean: - $(RM) $(OBJECTS_PATH)/*.o cc/*.o cm/*.o dbg/*.o dbg/i386/*.o ex/*.o \ ex/i386/*.o io/*.o ke/*.o ldr/*.o mm/*.o nt/*.o ob/*.o ps/*.o \ - rtl/*.o se/*.o ke/i386/*.o mm/i386/*.o fs/*.o po/*.o nls/*.o \ + rtl/*.o rtl/i386/*.o se/*.o ke/i386/*.o mm/i386/*.o fs/*.o po/*.o nls/*.o \ lpc/*.o kd/*.o $(TARGETNAME).o junk.tmp base.tmp temp.exp \ $(TARGETNAME).exe $(TARGETNAME).nostrip.exe $(TARGETNAME).sym ntoskrnl.map \ $(TARGETNAME).coff bugcodes.rc msg?????.bin $(DEP_FILES) \ diff --git a/reactos/ntoskrnl/ntoskrnl.def b/reactos/ntoskrnl/ntoskrnl.def index 6cdeec2e760..2293d3f892c 100644 --- a/reactos/ntoskrnl/ntoskrnl.def +++ b/reactos/ntoskrnl/ntoskrnl.def @@ -1,4 +1,4 @@ -; $Id: ntoskrnl.def,v 1.145 2002/10/03 19:39:56 robd Exp $ +; $Id: ntoskrnl.def,v 1.146 2003/01/07 17:48:11 robd Exp $ ; ; reactos/ntoskrnl/ntoskrnl.def ; @@ -978,14 +978,14 @@ ZwWaitForSingleObject@12 ZwWriteFile@36 ZwYieldExecution@0 _abnormal_termination -;_alldiv -;_allmul -;_allrem -;_allshl -;_allshr -;_aulldiv -;_aullrem -;_aullshr +_alldiv +_allmul +_allrem +_allshl +_allshr +_aulldiv +_aullrem +_aullshr _except_handler2 _except_handler3 _global_unwind2 diff --git a/reactos/ntoskrnl/ntoskrnl.edf b/reactos/ntoskrnl/ntoskrnl.edf index 166e37f817f..c51c475e04e 100644 --- a/reactos/ntoskrnl/ntoskrnl.edf +++ b/reactos/ntoskrnl/ntoskrnl.edf @@ -1,4 +1,4 @@ -; $Id: ntoskrnl.edf,v 1.131 2002/10/03 19:39:56 robd Exp $ +; $Id: ntoskrnl.edf,v 1.132 2003/01/07 17:48:11 robd Exp $ ; ; reactos/ntoskrnl/ntoskrnl.def ; @@ -976,14 +976,14 @@ ZwWaitForSingleObject=ZwWaitForSingleObject@12 ZwWriteFile=ZwWriteFile@36 ZwYieldExecution=ZwYieldExecution@0 _abnormal_termination -;_alldiv -;_allmul -;_allrem -;_allshl -;_allshr -;_aulldiv -;_aullrem -;_aullshr +_alldiv +_allmul +_allrem +_allshl +_allshr +_aulldiv +_aullrem +_aullshr _except_handler2 _except_handler3 _global_unwind2 diff --git a/reactos/ntoskrnl/rtl/math.c b/reactos/ntoskrnl/rtl/math.c new file mode 100644 index 00000000000..02d1da6030c --- /dev/null +++ b/reactos/ntoskrnl/rtl/math.c @@ -0,0 +1,332 @@ +/* $Id: math.c,v 1.1 2003/01/07 17:48:12 robd Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: kernel/rtl/math.c + * PURPOSE: + * UPDATE HISTORY: + * Created 20/12/2002 + */ + +/* INCLUDES *****************************************************************/ + +#include + +#define NDEBUG +#include + + +/* FUNCTIONS *****************************************************************/ + +LARGE_INTEGER +STDCALL +_alldiv(ULONG UnsignedInteger) +{ + LARGE_INTEGER RC; + + RC.QuadPart = 0; + return RC; +} + +LARGE_INTEGER +STDCALL +_allmul(ULONG UnsignedInteger) +{ + LARGE_INTEGER RC; + + RC.QuadPart = 0; + return RC; +} + +LARGE_INTEGER +STDCALL +_allrem(ULONG UnsignedInteger) +{ + LARGE_INTEGER RC; + + RC.QuadPart = 0; + return RC; +} + +LARGE_INTEGER +STDCALL +_allshl(ULONG UnsignedInteger) +{ + LARGE_INTEGER RC; + + RC.QuadPart = 0; + return RC; +} + +LARGE_INTEGER +STDCALL +_allshr(ULONG UnsignedInteger) +{ + LARGE_INTEGER RC; + + RC.QuadPart = 0; + return RC; +} + +LARGE_INTEGER +STDCALL +_aulldiv(ULONG UnsignedInteger) +{ + LARGE_INTEGER RC; + + RC.QuadPart = 0; + return RC; +} + +LARGE_INTEGER +STDCALL +_aullrem(ULONG UnsignedInteger) +{ + LARGE_INTEGER RC; + + RC.QuadPart = 0; + return RC; +} + +LARGE_INTEGER +STDCALL +_aullshr(ULONG UnsignedInteger) +{ + LARGE_INTEGER RC; + + RC.QuadPart = 0; + return RC; +} + + +/* +LARGE_INTEGER +STDCALL +RtlConvertLongToLargeInteger ( + LONG SignedInteger + ) +{ + LARGE_INTEGER RC; + + RC.QuadPart = SignedInteger; + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlConvertUlongToLargeInteger ( + ULONG UnsignedInteger + ) +{ + LARGE_INTEGER RC; + + RC.QuadPart = UnsignedInteger; + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlEnlargedIntegerMultiply ( + LONG Multiplicand, + LONG Multiplier + ) +{ + LARGE_INTEGER RC; + + RC.QuadPart = (LONGLONG) Multiplicand * Multiplier; + + return RC; +} + +ULONG +STDCALL +RtlEnlargedUnsignedDivide ( + ULARGE_INTEGER Dividend, + ULONG Divisor, + PULONG Remainder + ) +{ + if (Remainder) + *Remainder = Dividend.QuadPart % Divisor; + + return (ULONG)(Dividend.QuadPart / Divisor); +} + +LARGE_INTEGER +STDCALL +RtlEnlargedUnsignedMultiply ( + ULONG Multiplicand, + ULONG Multiplier + ) +{ + LARGE_INTEGER RC; + + RC.QuadPart = (ULONGLONG) Multiplicand * Multiplier; + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlExtendedIntegerMultiply ( + LARGE_INTEGER Multiplicand, + LONG Multiplier + ) +{ + LARGE_INTEGER RC; + + RC.QuadPart = Multiplicand.QuadPart * Multiplier; + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlExtendedLargeIntegerDivide ( + LARGE_INTEGER Dividend, + ULONG Divisor, + PULONG Remainder + ) +{ + LARGE_INTEGER RC; + + if (Remainder) + *Remainder = Dividend.QuadPart % Divisor; + + RC.QuadPart = Dividend.QuadPart / Divisor; + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlExtendedMagicDivide (LARGE_INTEGER Dividend, + LARGE_INTEGER MagicDivisor, + CCHAR ShiftCount) +{ + LARGE_INTEGER Result; + + Result.QuadPart = (Dividend.QuadPart * MagicDivisor.QuadPart) >> ShiftCount; + return(Result); +} + +LARGE_INTEGER +STDCALL +RtlLargeIntegerAdd ( + LARGE_INTEGER Addend1, + LARGE_INTEGER Addend2 + ) +{ + LARGE_INTEGER RC; + + RC.QuadPart = Addend1.QuadPart + Addend2.QuadPart; + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlLargeIntegerArithmeticShift ( + LARGE_INTEGER LargeInteger, + CCHAR ShiftCount + ) +{ + LARGE_INTEGER RC; + CHAR Shift; + + Shift = ShiftCount % 64; + + if (Shift < 32) + { + RC.QuadPart = LargeInteger.QuadPart >> Shift; + } + else + { + // copy the sign bit + RC.u.HighPart |= (LargeInteger.u.HighPart & 0x80000000); + RC.u.LowPart = LargeInteger.u.HighPart >> Shift; + } + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlLargeIntegerDivide ( + LARGE_INTEGER Dividend, + LARGE_INTEGER Divisor, + PLARGE_INTEGER Remainder + ) +{ + LARGE_INTEGER RC; + + if (Remainder) + Remainder->QuadPart = Dividend.QuadPart % Divisor.QuadPart; + + RC.QuadPart = Dividend.QuadPart / Divisor.QuadPart; + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlLargeIntegerNegate ( + LARGE_INTEGER Subtrahend + ) +{ + LARGE_INTEGER RC; + + RC.QuadPart = - Subtrahend.QuadPart; + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlLargeIntegerShiftLeft ( + LARGE_INTEGER LargeInteger, + CCHAR ShiftCount + ) +{ + LARGE_INTEGER RC; + CHAR Shift; + + Shift = ShiftCount % 64; + RC.QuadPart = LargeInteger.QuadPart << Shift; + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlLargeIntegerShiftRight ( + LARGE_INTEGER LargeInteger, + CCHAR ShiftCount + ) +{ + LARGE_INTEGER RC; + CHAR Shift; + + Shift = ShiftCount % 64; + RC.QuadPart = LargeInteger.QuadPart >> ShiftCount; + + return RC; +} + +LARGE_INTEGER +STDCALL +RtlLargeIntegerSubtract ( + LARGE_INTEGER Minuend, + LARGE_INTEGER Subtrahend + ) +{ + LARGE_INTEGER RC; + + RC.QuadPart = Minuend.QuadPart - Subtrahend.QuadPart; + + return RC; +} + */ +/* EOF */