2 * Helper functions for ntdll
4 * Copyright 2000 Juergen Schmied
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include "wine/debug.h"
27 #include "ntdll_misc.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
31 #if defined(__GNUC__) && defined(__i386__)
32 #define DO_FPU(x,y) __asm__ __volatile__( x " %0;fwait" : "=m" (y) : )
33 #define POP_FPU(x) DO_FPU("fstpl",x)
36 void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *oa)
39 TRACE("%p:(name=%s, attr=0x%08x, hRoot=%p, sd=%p)\n",
40 oa, debugstr_us(oa->ObjectName),
41 oa->Attributes, oa->RootDirectory, oa->SecurityDescriptor);
44 LPCSTR debugstr_us( const UNICODE_STRING *us )
46 if (!us) return "<null>";
47 return debugstr_wn(us->Buffer, us->Length / sizeof(WCHAR));
50 /*********************************************************************
56 #if defined(__GNUC__) && defined(__i386__)
57 LONGLONG CDECL NTDLL__ftol(void)
59 /* don't just do DO_FPU("fistp",retval), because the rounding
60 * mode must also be set to "round towards zero"... */
65 #endif /* defined(__GNUC__) && defined(__i386__) */
67 /*********************************************************************
71 * Should be register function
75 #if !defined(__GNUC__) && defined(__i386__)
76 LONGLONG CDECL NTDLL__ftol(double fl)
78 FIXME("should be register function\n");
81 #endif /* !defined(__GNUC__) && defined(__i386__) */
83 /*********************************************************************
89 LONG CDECL NTDLL__ftol(double fl)
93 #endif /* !defined(__i386__) */
95 /*********************************************************************
100 #if defined(__GNUC__) && defined(__i386__)
101 double CDECL NTDLL__CIpow(void)
108 #endif /* defined(__GNUC__) && defined(__i386__) */
111 /*********************************************************************
115 * Should be register function
120 #if !defined(__GNUC__) && defined(__i386__)
121 double CDECL NTDLL__CIpow(double x,double y)
123 FIXME("should be register function\n");
126 #endif /* !defined(__GNUC__) && defined(__i386__) */
128 /*********************************************************************
134 double CDECL NTDLL__CIpow(double x,double y)
138 #endif /* !defined(__i386__) */
141 /*********************************************************************
144 int CDECL NTDLL_abs( int i )
149 /*********************************************************************
152 LONG CDECL NTDLL_labs( LONG i )
157 /*********************************************************************
160 double CDECL NTDLL_atan( double d )
165 /*********************************************************************
168 double CDECL NTDLL_ceil( double d )
173 /*********************************************************************
176 double CDECL NTDLL_cos( double d )
181 /*********************************************************************
184 double CDECL NTDLL_fabs( double d )
189 /*********************************************************************
192 double CDECL NTDLL_floor( double d )
197 /*********************************************************************
200 double CDECL NTDLL_log( double d )
205 /*********************************************************************
208 double CDECL NTDLL_pow( double x, double y )
213 /*********************************************************************
216 double CDECL NTDLL_sin( double d )
221 /*********************************************************************
224 double CDECL NTDLL_sqrt( double d )
229 /*********************************************************************
232 double CDECL NTDLL_tan( double d )