Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 48 ++-------------------------- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- dlls/ntoskrnl.exe/ntoskrnl_private.h | 47 +++++++++++++++++++++++++++ dlls/ntoskrnl.exe/sync.c | 28 ++++++++++++++++ include/ddk/wdm.h | 1 + 5 files changed, 79 insertions(+), 47 deletions(-) create mode 100644 dlls/ntoskrnl.exe/ntoskrnl_private.h
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 994cd90b7e..4986ca1f67 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -52,6 +52,8 @@ #include "wine/rbtree.h" #include "wine/svcctl.h"
+#include "ntoskrnl_private.h" + WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl); WINE_DECLARE_DEBUG_CHANNEL(relay); WINE_DECLARE_DEBUG_CHANNEL(plugplay); @@ -143,29 +145,6 @@ static CRITICAL_SECTION_DEBUG critsect_debug = }; static CRITICAL_SECTION drivers_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
-#ifdef __i386__ -#define DEFINE_FASTCALL1_ENTRYPOINT( name ) \ - __ASM_STDCALL_FUNC( name, 4, \ - "popl %eax\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(4)) -#define DEFINE_FASTCALL2_ENTRYPOINT( name ) \ - __ASM_STDCALL_FUNC( name, 8, \ - "popl %eax\n\t" \ - "pushl %edx\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(8)) -#define DEFINE_FASTCALL3_ENTRYPOINT( name ) \ - __ASM_STDCALL_FUNC( name, 12, \ - "popl %eax\n\t" \ - "pushl %edx\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(12)) -#endif - static inline LPCSTR debugstr_us( const UNICODE_STRING *us ) { if (!us) return "<null>"; @@ -3089,29 +3068,6 @@ NTSTATUS WINAPI ExDeleteResourceLite(PERESOURCE resource) return STATUS_NOT_IMPLEMENTED; }
-/***************************************************** - * ExInterlockedRemoveHeadList (NTOSKRNL.EXE.@) - */ -PLIST_ENTRY WINAPI ExInterlockedRemoveHeadList(PLIST_ENTRY head, PKSPIN_LOCK lock) -{ - FIXME("(%p %p) stub\n", head, lock); - return NULL; -} - -/*********************************************************************** - * ExfInterlockedRemoveHeadList (NTOSKRNL.EXE.@) - */ -#ifdef DEFINE_FASTCALL2_ENTRYPOINT -DEFINE_FASTCALL2_ENTRYPOINT( ExfInterlockedRemoveHeadList ) -PLIST_ENTRY WINAPI DECLSPEC_HIDDEN __regs_ExfInterlockedRemoveHeadList(PLIST_ENTRY head, PKSPIN_LOCK lock) -#else -PLIST_ENTRY WINAPI ExfInterlockedRemoveHeadList(PLIST_ENTRY head, PKSPIN_LOCK lock) -#endif -{ - FIXME("(%p %p) stub\n", head, lock); - return ExInterlockedRemoveHeadList( head, lock ); -} - /*********************************************************************** * ExReleaseResourceForThreadLite (NTOSKRNL.EXE.@) */ diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 8483b36a63..bf87504f44 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -22,7 +22,7 @@ @ stub ExfInterlockedInsertTailList @ stub ExfInterlockedPopEntryList @ stub ExfInterlockedPushEntryList -@ stdcall -norelay ExfInterlockedRemoveHeadList(ptr ptr) +@ stdcall -norelay -arch=i386 ExfInterlockedRemoveHeadList(ptr ptr) @ stub ExfReleasePushLock @ stub Exfi386InterlockedDecrementLong @ stub Exfi386InterlockedExchangeUlong diff --git a/dlls/ntoskrnl.exe/ntoskrnl_private.h b/dlls/ntoskrnl.exe/ntoskrnl_private.h new file mode 100644 index 0000000000..241e15f827 --- /dev/null +++ b/dlls/ntoskrnl.exe/ntoskrnl_private.h @@ -0,0 +1,47 @@ +/* + * ntoskrnl.exe implementation + * + * Copyright (C) 2007 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_NTOSKRNL_PRIVATE_H +#define __WINE_NTOSKRNL_PRIVATE_H + +#ifdef __i386__ +#define DEFINE_FASTCALL1_ENTRYPOINT( name ) \ + __ASM_STDCALL_FUNC( name, 4, \ + "popl %eax\n\t" \ + "pushl %ecx\n\t" \ + "pushl %eax\n\t" \ + "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(4)) +#define DEFINE_FASTCALL2_ENTRYPOINT( name ) \ + __ASM_STDCALL_FUNC( name, 8, \ + "popl %eax\n\t" \ + "pushl %edx\n\t" \ + "pushl %ecx\n\t" \ + "pushl %eax\n\t" \ + "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(8)) +#define DEFINE_FASTCALL3_ENTRYPOINT( name ) \ + __ASM_STDCALL_FUNC( name, 12, \ + "popl %eax\n\t" \ + "pushl %edx\n\t" \ + "pushl %ecx\n\t" \ + "pushl %eax\n\t" \ + "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(12)) +#endif + +#endif diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index c46d7f583f..852f2b50d4 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#include "config.h" #include <stdarg.h>
#include "ntstatus.h" @@ -30,6 +31,8 @@
#include "wine/debug.h"
+#include "ntoskrnl_private.h" + WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl);
enum object_type @@ -433,3 +436,28 @@ void WINAPI IoReleaseCancelSpinLock( KIRQL irql ) TRACE("irql %u.\n", irql); KeReleaseSpinLock( &cancel_lock, irql ); } + +#ifdef __i386__ +DEFINE_FASTCALL1_ENTRYPOINT( ExfInterlockedRemoveHeadList ) +LIST_ENTRY * WINAPI DECLSPEC_HIDDEN __regs_ExfInterlockedRemoveHeadList( LIST_ENTRY *list, KSPIN_LOCK *lock ) +{ + return ExInterlockedRemoveHeadList( list, lock ); +} +#endif + +/*********************************************************************** + * ExInterlockedRemoveHeadList (NTOSKRNL.EXE.@) + */ +LIST_ENTRY * WINAPI ExInterlockedRemoveHeadList( LIST_ENTRY *list, KSPIN_LOCK *lock ) +{ + LIST_ENTRY *ret; + KIRQL irql; + + TRACE("list %p, lock %p.\n", list, lock); + + KeAcquireSpinLock( lock, &irql ); + ret = RemoveHeadList( list ); + KeReleaseSpinLock( lock, irql ); + + return ret; +} diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index a9bdd3de85..a53c7a26ca 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1386,6 +1386,7 @@ void WINAPI ExFreePool(PVOID); void WINAPI ExFreePoolWithTag(PVOID,ULONG); PSLIST_ENTRY WINAPI ExInterlockedPopEntrySList(PSLIST_HEADER,PKSPIN_LOCK); PSLIST_ENTRY WINAPI ExInterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY,PKSPIN_LOCK); +LIST_ENTRY * WINAPI ExInterlockedRemoveHeadList(LIST_ENTRY*,KSPIN_LOCK*); void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX);
void WINAPI IoAcquireCancelSpinLock(KIRQL*);