From 5fa3aa4e15b6bd3a4f3fb23beea247fd19858c90 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 16 Dec 2008 20:46:34 +0000 Subject: [PATCH] Implement asm stubs for alldiv, atan, ceil, cos, fabs, floor, log, pow, sin, sqrt, tan, _chkstk, _alloca_probe to libcntpr. Now we can build ntdll. svn path=/branches/ros-amd64-bringup/; revision=38127 --- reactos/lib/sdk/crt/except/amd64/chkstk_asm.s | 39 ++++++++++++------- reactos/lib/sdk/crt/libcntpr.rbuild | 21 ++++++++++ reactos/lib/sdk/crt/math/amd64/alldiv.S | 28 +++++++++++++ reactos/lib/sdk/crt/math/amd64/atan.S | 21 ++++++++++ reactos/lib/sdk/crt/math/amd64/ceil.S | 21 ++++++++++ reactos/lib/sdk/crt/math/amd64/cos.S | 21 ++++++++++ reactos/lib/sdk/crt/math/amd64/fabs.S | 21 ++++++++++ reactos/lib/sdk/crt/math/amd64/floor.S | 21 ++++++++++ reactos/lib/sdk/crt/math/amd64/log.S | 21 ++++++++++ reactos/lib/sdk/crt/math/amd64/pow.S | 21 ++++++++++ reactos/lib/sdk/crt/math/amd64/sin.S | 21 ++++++++++ reactos/lib/sdk/crt/math/amd64/sqrt.S | 21 ++++++++++ reactos/lib/sdk/crt/math/amd64/tan.S | 21 ++++++++++ 13 files changed, 283 insertions(+), 15 deletions(-) create mode 100644 reactos/lib/sdk/crt/math/amd64/alldiv.S create mode 100644 reactos/lib/sdk/crt/math/amd64/atan.S create mode 100644 reactos/lib/sdk/crt/math/amd64/ceil.S create mode 100644 reactos/lib/sdk/crt/math/amd64/cos.S create mode 100644 reactos/lib/sdk/crt/math/amd64/fabs.S create mode 100644 reactos/lib/sdk/crt/math/amd64/floor.S create mode 100644 reactos/lib/sdk/crt/math/amd64/log.S create mode 100644 reactos/lib/sdk/crt/math/amd64/pow.S create mode 100644 reactos/lib/sdk/crt/math/amd64/sin.S create mode 100644 reactos/lib/sdk/crt/math/amd64/sqrt.S create mode 100644 reactos/lib/sdk/crt/math/amd64/tan.S diff --git a/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s b/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s index be54983f1cb..9501c3555ef 100644 --- a/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s +++ b/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s @@ -1,22 +1,31 @@ /* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Stack checker - * FILE: lib/ntdll/rtl/i386/chkstk.s - * PROGRAMER: + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of _chkstk and _alloca_probe + * FILE: lib/sdk/crt/math/amd64/chkstk_asm.s + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ -.globl _chkstk -.globl _alloca_probe +/* INCLUDES ******************************************************************/ -/* - _chkstk() is called by all stack allocations of more than 4 KB. It grows the - stack in areas of 4 KB each, trying to access each area. This ensures that the - guard page for the stack is hit, and the stack growing triggered - */ -_chkstk: -_alloca_probe: - /* return */ - ret +#include +#include + +.intel_syntax noprefix + +.global _MsgUnimplemented +_MsgUnimplemented: +.asciz "WARNING: %s at %s:%d is UNIMPLEMENTED!\n" + + +.proc _chkstk + UNIMPLEMENTED chkstk + ret +.endproc + +.proc _alloca_probe + UNIMPLEMENTED alloca_probe + ret +.endproc /* EOF */ diff --git a/reactos/lib/sdk/crt/libcntpr.rbuild b/reactos/lib/sdk/crt/libcntpr.rbuild index 67fa76a7794..a2609198016 100644 --- a/reactos/lib/sdk/crt/libcntpr.rbuild +++ b/reactos/lib/sdk/crt/libcntpr.rbuild @@ -20,6 +20,12 @@ seh.s + + + chkstk_asm.s + seh.s + + chkstk_asm.s @@ -54,6 +60,21 @@ tan_asm.s + + + alldiv.S + atan.S + ceil.S + cos.S + fabs.S + floor.S + log.S + pow.S + sin.S + sqrt.S + tan.S + + abs.c div.c labs.c diff --git a/reactos/lib/sdk/crt/math/amd64/alldiv.S b/reactos/lib/sdk/crt/math/amd64/alldiv.S new file mode 100644 index 00000000000..7221f5cc6b0 --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/alldiv.S @@ -0,0 +1,28 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of alldiv + * FILE: lib/sdk/crt/math/amd64/alldiv.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + +/* DATA *********************************************************************/ + + .globl __fltused +__fltused: + .long 0x9875 + +/* FUNCTIONS ****************************************************************/ + +.proc alldiv + UNIMPLEMENTED alldiv + ret + +.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/atan.S b/reactos/lib/sdk/crt/math/amd64/atan.S new file mode 100644 index 00000000000..ef871c356fb --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/atan.S @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of atan + * FILE: lib/sdk/crt/math/amd64/atan.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + + +.proc atan + UNIMPLEMENTED atan + ret + +.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/ceil.S b/reactos/lib/sdk/crt/math/amd64/ceil.S new file mode 100644 index 00000000000..1948364686e --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/ceil.S @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of ceil + * FILE: lib/sdk/crt/math/amd64/ceil.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + + +.proc ceil + UNIMPLEMENTED ceil + ret + +.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/cos.S b/reactos/lib/sdk/crt/math/amd64/cos.S new file mode 100644 index 00000000000..5d2e0fe787b --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/cos.S @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of cos + * FILE: lib/sdk/crt/math/amd64/cos.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + + +.proc cos + UNIMPLEMENTED cos + ret + +.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/fabs.S b/reactos/lib/sdk/crt/math/amd64/fabs.S new file mode 100644 index 00000000000..2282de1488d --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/fabs.S @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of fabs + * FILE: lib/sdk/crt/math/amd64/fabs.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + + +.proc fabs + UNIMPLEMENTED fabs + ret + +.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/floor.S b/reactos/lib/sdk/crt/math/amd64/floor.S new file mode 100644 index 00000000000..a08e4fc84ed --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/floor.S @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of floor + * FILE: lib/sdk/crt/math/amd64/floor.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + + +.proc floor + UNIMPLEMENTED floor + ret + +.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/log.S b/reactos/lib/sdk/crt/math/amd64/log.S new file mode 100644 index 00000000000..f4190d3e286 --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/log.S @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of log + * FILE: lib/sdk/crt/math/amd64/log.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + + +.proc log + UNIMPLEMENTED log + ret + +.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/pow.S b/reactos/lib/sdk/crt/math/amd64/pow.S new file mode 100644 index 00000000000..05ef3f9c693 --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/pow.S @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of pow + * FILE: lib/sdk/crt/math/amd64/pow.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + + +.proc pow + UNIMPLEMENTED pow + ret + +.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/sin.S b/reactos/lib/sdk/crt/math/amd64/sin.S new file mode 100644 index 00000000000..683eedcd647 --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/sin.S @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of sin + * FILE: lib/sdk/crt/math/amd64/sin.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + + +.proc sin + UNIMPLEMENTED sin + ret + +.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/sqrt.S b/reactos/lib/sdk/crt/math/amd64/sqrt.S new file mode 100644 index 00000000000..48db2fde91e --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/sqrt.S @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of sqrt + * FILE: lib/sdk/crt/math/amd64/sqrt.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + + +.proc sqrt + UNIMPLEMENTED sqrt + ret + +.endproc diff --git a/reactos/lib/sdk/crt/math/amd64/tan.S b/reactos/lib/sdk/crt/math/amd64/tan.S new file mode 100644 index 00000000000..225c3acc66a --- /dev/null +++ b/reactos/lib/sdk/crt/math/amd64/tan.S @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Implementation of tan + * FILE: lib/sdk/crt/math/amd64/tan.S + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include + +.intel_syntax noprefix + + +.proc tan + UNIMPLEMENTED tan + ret + +.endproc