Added missing fastcall list functions

svn path=/trunk/; revision=3305
This commit is contained in:
Eric Kohl 2002-07-27 13:02:37 +00:00
parent d35d4191c1
commit 8e93e09163
4 changed files with 309 additions and 177 deletions

View file

@ -700,6 +700,7 @@ ExInitializeNPagedLookasideList (
ULONG Tag,
USHORT Depth
);
VOID
STDCALL
ExInitializePagedLookasideList (
@ -712,52 +713,53 @@ ExInitializePagedLookasideList (
USHORT Depth
);
ULONG
FASTCALL
ExfInterlockedAddUlong (
IN PULONG Addend,
ULONG FASTCALL
ExfInterlockedAddUlong(IN PULONG Addend,
IN ULONG Increment,
IN PKSPIN_LOCK Lock
);
IN PKSPIN_LOCK Lock);
INTERLOCKED_RESULT
FASTCALL
Exfi386InterlockedIncrementLong (
IN PLONG Addend
);
PLIST_ENTRY FASTCALL
ExfInterlockedInsertHeadList(IN PLIST_ENTRY ListHead,
IN PLIST_ENTRY ListEntry,
IN PKSPIN_LOCK Lock);
INTERLOCKED_RESULT
FASTCALL
Exfi386InterlockedDecrementLong (
IN PLONG Addend
);
PLIST_ENTRY FASTCALL
ExfInterlockedInsertTailList(IN PLIST_ENTRY ListHead,
IN PLIST_ENTRY ListEntry,
IN PKSPIN_LOCK Lock);
ULONG
FASTCALL
Exfi386InterlockedExchangeUlong (
IN PULONG Target,
IN ULONG Value
);
PSINGLE_LIST_ENTRY FASTCALL
ExfInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead,
IN PKSPIN_LOCK Lock);
INTERLOCKED_RESULT
STDCALL
Exi386InterlockedIncrementLong (
IN PLONG Addend
);
PSINGLE_LIST_ENTRY FASTCALL
ExfInterlockedPushEntryList(IN PSINGLE_LIST_ENTRY ListHead,
IN PSINGLE_LIST_ENTRY ListEntry,
IN PKSPIN_LOCK Lock);
INTERLOCKED_RESULT
STDCALL
Exi386InterlockedDecrementLong (
IN PLONG Addend
);
PLIST_ENTRY FASTCALL
ExfInterlockedRemoveHeadList(IN PLIST_ENTRY Head,
IN PKSPIN_LOCK Lock);
ULONG
STDCALL
Exi386InterlockedExchangeUlong (
IN PULONG Target,
IN ULONG Value
);
INTERLOCKED_RESULT FASTCALL
Exfi386InterlockedIncrementLong(IN PLONG Addend);
INTERLOCKED_RESULT FASTCALL
Exfi386InterlockedDecrementLong(IN PLONG Addend);
ULONG FASTCALL
Exfi386InterlockedExchangeUlong(IN PULONG Target,
IN ULONG Value);
INTERLOCKED_RESULT STDCALL
Exi386InterlockedIncrementLong(IN PLONG Addend);
INTERLOCKED_RESULT STDCALL
Exi386InterlockedDecrementLong(IN PLONG Addend);
ULONG STDCALL
Exi386InterlockedExchangeUlong(IN PULONG Target,
IN ULONG Value);
/*
LONG

View file

@ -1,4 +1,4 @@
/* $Id: list.c,v 1.4 2001/07/04 20:40:20 chorns Exp $
/* $Id: list.c,v 1.5 2002/07/27 13:02:13 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -22,11 +22,9 @@
PLIST_ENTRY STDCALL
ExInterlockedInsertHeadList (
PLIST_ENTRY ListHead,
ExInterlockedInsertHeadList(PLIST_ENTRY ListHead,
PLIST_ENTRY ListEntry,
PKSPIN_LOCK Lock
)
PKSPIN_LOCK Lock)
/*
* FUNCTION: Inserts an entry at the head of a doubly linked list
* ARGUMENTS:
@ -56,11 +54,17 @@ ExInterlockedInsertHeadList (
PLIST_ENTRY STDCALL
ExInterlockedInsertTailList (
PLIST_ENTRY ListHead,
ExInterlockedInsertTailList(PLIST_ENTRY ListHead,
PLIST_ENTRY ListEntry,
PKSPIN_LOCK Lock
)
PKSPIN_LOCK Lock)
/*
* FUNCTION: Inserts an entry at the tail of a doubly linked list
* ARGUMENTS:
* ListHead = Points to the head of the list
* ListEntry = Points to the entry to be inserted
* Lock = Caller supplied spinlock used to synchronize access
* RETURNS: The previous head of the list
*/
{
PLIST_ENTRY Old;
KIRQL oldlvl;
@ -82,10 +86,8 @@ ExInterlockedInsertTailList (
PLIST_ENTRY STDCALL
ExInterlockedRemoveHeadList (
PLIST_ENTRY Head,
PKSPIN_LOCK Lock
)
ExInterlockedRemoveHeadList(PLIST_ENTRY Head,
PKSPIN_LOCK Lock)
/*
* FUNCTION: Removes the head of a double linked list
* ARGUMENTS:
@ -110,11 +112,10 @@ ExInterlockedRemoveHeadList (
return(ret);
}
PLIST_ENTRY
ExInterlockedRemoveTailList (
PLIST_ENTRY Head,
PKSPIN_LOCK Lock
)
ExInterlockedRemoveTailList(PLIST_ENTRY Head,
PKSPIN_LOCK Lock)
/*
* FUNCTION: Removes the tail of a double linked list
* ARGUMENTS:
@ -141,9 +142,8 @@ ExInterlockedRemoveTailList (
PSINGLE_LIST_ENTRY FASTCALL
ExInterlockedPopEntrySList(
PSLIST_HEADER ListHead,
PKSPIN_LOCK Lock)
ExInterlockedPopEntrySList(IN PSLIST_HEADER ListHead,
IN PKSPIN_LOCK Lock)
/*
* FUNCTION: Removes (pops) an entry from a sequenced list
* ARGUMENTS:
@ -168,10 +168,9 @@ ExInterlockedPopEntrySList(
PSINGLE_LIST_ENTRY FASTCALL
ExInterlockedPushEntrySList(
PSLIST_HEADER ListHead,
PSINGLE_LIST_ENTRY ListEntry,
PKSPIN_LOCK Lock)
ExInterlockedPushEntrySList(IN PSLIST_HEADER ListHead,
IN PSINGLE_LIST_ENTRY ListEntry,
IN PKSPIN_LOCK Lock)
/*
* FUNCTION: Inserts (pushes) an entry into a sequenced list
* ARGUMENTS:
@ -194,12 +193,9 @@ ExInterlockedPushEntrySList(
}
PSINGLE_LIST_ENTRY
STDCALL
ExInterlockedPopEntryList (
PSINGLE_LIST_ENTRY ListHead,
PKSPIN_LOCK Lock
)
PSINGLE_LIST_ENTRY STDCALL
ExInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead,
IN PKSPIN_LOCK Lock)
/*
* FUNCTION: Removes (pops) an entry from a singly list
* ARGUMENTS:
@ -218,13 +214,10 @@ ExInterlockedPopEntryList (
}
PSINGLE_LIST_ENTRY
STDCALL
ExInterlockedPushEntryList (
PSINGLE_LIST_ENTRY ListHead,
PSINGLE_LIST_ENTRY ListEntry,
PKSPIN_LOCK Lock
)
PSINGLE_LIST_ENTRY STDCALL
ExInterlockedPushEntryList(IN PSINGLE_LIST_ENTRY ListHead,
IN PSINGLE_LIST_ENTRY ListEntry,
IN PKSPIN_LOCK Lock)
/*
* FUNCTION: Inserts (pushes) an entry into a singly linked list
* ARGUMENTS:
@ -244,4 +237,141 @@ ExInterlockedPushEntryList (
return(ret);
}
PLIST_ENTRY FASTCALL
ExfInterlockedInsertHeadList(IN PLIST_ENTRY ListHead,
IN PLIST_ENTRY ListEntry,
IN PKSPIN_LOCK Lock)
/*
* FUNCTION: Inserts an entry at the head of a doubly linked list
* ARGUMENTS:
* ListHead = Points to the head of the list
* ListEntry = Points to the entry to be inserted
* Lock = Caller supplied spinlock used to synchronize access
* RETURNS: The previous head of the list
*/
{
PLIST_ENTRY Old;
KIRQL oldlvl;
KeAcquireSpinLock(Lock,&oldlvl);
if (IsListEmpty(ListHead))
{
Old = NULL;
}
else
{
Old = ListHead->Flink;
}
InsertHeadList(ListHead,ListEntry);
KeReleaseSpinLock(Lock,oldlvl);
return(Old);
}
PLIST_ENTRY FASTCALL
ExfInterlockedInsertTailList(IN PLIST_ENTRY ListHead,
IN PLIST_ENTRY ListEntry,
IN PKSPIN_LOCK Lock)
/*
* FUNCTION: Inserts an entry at the tail of a doubly linked list
* ARGUMENTS:
* ListHead = Points to the head of the list
* ListEntry = Points to the entry to be inserted
* Lock = Caller supplied spinlock used to synchronize access
* RETURNS: The previous head of the list
*/
{
PLIST_ENTRY Old;
KIRQL oldlvl;
KeAcquireSpinLock(Lock,&oldlvl);
if (IsListEmpty(ListHead))
{
Old = NULL;
}
else
{
Old = ListHead->Blink;
}
InsertTailList(ListHead,ListEntry);
KeReleaseSpinLock(Lock,oldlvl);
return(Old);
}
PSINGLE_LIST_ENTRY FASTCALL
ExfInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead,
IN PKSPIN_LOCK Lock)
/*
* FUNCTION: Removes (pops) an entry from a singly list
* ARGUMENTS:
* ListHead = Points to the head of the list
* Lock = Lock for synchronizing access to the list
* RETURNS: The removed entry
*/
{
PSINGLE_LIST_ENTRY ret;
KIRQL oldlvl;
KeAcquireSpinLock(Lock,&oldlvl);
ret = PopEntryList(ListHead);
KeReleaseSpinLock(Lock,oldlvl);
return(ret);
}
PSINGLE_LIST_ENTRY FASTCALL
ExfInterlockedPushEntryList(IN PSINGLE_LIST_ENTRY ListHead,
IN PSINGLE_LIST_ENTRY ListEntry,
IN PKSPIN_LOCK Lock)
/*
* FUNCTION: Inserts (pushes) an entry into a singly linked list
* ARGUMENTS:
* ListHead = Points to the head of the list
* ListEntry = Points to the entry to be inserted
* Lock = Caller supplied spinlock used to synchronize access
* RETURNS: The previous head of the list
*/
{
KIRQL oldlvl;
PSINGLE_LIST_ENTRY ret;
KeAcquireSpinLock(Lock,&oldlvl);
ret=ListHead->Next;
PushEntryList(ListHead,ListEntry);
KeReleaseSpinLock(Lock,oldlvl);
return(ret);
}
PLIST_ENTRY FASTCALL
ExfInterlockedRemoveHeadList(IN PLIST_ENTRY Head,
IN PKSPIN_LOCK Lock)
/*
* FUNCTION: Removes the head of a double linked list
* ARGUMENTS:
* Head = Points to the head of the list
* Lock = Lock for synchronizing access to the list
* RETURNS: The removed entry
*/
{
PLIST_ENTRY ret;
KIRQL oldlvl;
KeAcquireSpinLock(Lock,&oldlvl);
if (IsListEmpty(Head))
{
ret = NULL;
}
else
{
ret = RemoveHeadList(Head);
}
KeReleaseSpinLock(Lock,oldlvl);
return(ret);
}
/* EOF */

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.def,v 1.138 2002/07/25 13:18:31 ekohl Exp $
; $Id: ntoskrnl.def,v 1.139 2002/07/27 13:02:37 ekohl Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -113,11 +113,11 @@ ExInsertHashTable@16
ExSearchHashTable@16
ExRemoveHashTable@16
@ExfInterlockedAddUlong@12
;@ExfInterlockedInsertHeadList
;@ExfInterlockedInsertTailList
;@ExfInterlockedPopEntryList
;@ExfInterlockedPushEntryList
;@ExfInterlockedRemoveHeadList
@ExfInterlockedInsertHeadList@12
@ExfInterlockedInsertTailList@12
@ExfInterlockedPopEntryList@8
@ExfInterlockedPushEntryList@12
@ExfInterlockedRemoveHeadList@8
@Exfi386InterlockedDecrementLong@4
@Exfi386InterlockedExchangeUlong@8
@Exfi386InterlockedIncrementLong@4

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.edf,v 1.124 2002/07/25 13:18:31 ekohl Exp $
; $Id: ntoskrnl.edf,v 1.125 2002/07/27 13:02:37 ekohl Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -113,11 +113,11 @@ ExInsertHashTable=ExInsertHashTable@16
ExSearchHashTable=ExSearchHashTable@16
ExRemoveHashTable=ExRemoveHashTable@16
ExfInterlockedAddUlong=@ExfInterlockedAddUlong@12
;ExfInterlockedInsertHeadList
;ExfInterlockedInsertTailList
;ExfInterlockedPopEntryList
;ExfInterlockedPushEntryList
;ExfInterlockedRemoveHeadList
ExfInterlockedInsertHeadList=@ExfInterlockedInsertHeadList@12
ExfInterlockedInsertTailList=@ExfInterlockedInsertTailList@12
ExfInterlockedPopEntryList=@ExfInterlockedPopEntryList@8
ExfInterlockedPushEntryList=@ExfInterlockedPushEntryList@12
ExfInterlockedRemoveHeadList=@ExfInterlockedRemoveHeadList@8
Exfi386InterlockedDecrementLong=@Exfi386InterlockedDecrementLong@4
Exfi386InterlockedExchangeUlong=@Exfi386InterlockedExchangeUlong@8
Exfi386InterlockedIncrementLong=@Exfi386InterlockedIncrementLong@4