Author: tkreuzer
Date: Fri Nov 27 18:37:07 2009
New Revision: 44296
URL:
http://svn.reactos.org/svn/reactos?rev=44296&view=rev
Log:
Implement "portable" SList code for 64 bit
Modified:
branches/ros-amd64-bringup/reactos/lib/rtl/slist.c
Modified: branches/ros-amd64-bringup/reactos/lib/rtl/slist.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/r…
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/rtl/slist.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/rtl/slist.c [iso-8859-1] Fri Nov 27 18:37:07
2009
@@ -20,7 +20,10 @@
RtlInitializeSListHead(IN PSLIST_HEADER ListHead)
{
#ifdef _WIN64
- UNIMPLEMENTED;
+ ListHead->Alignment = 0;
+ ListHead->Region = 0;
+ ListHead->Header8.Init = 1;
+ // ListHead->Header8.HeaderType = 1; // FIXME: depending on cmpxchg16b support?
#else
ListHead->Alignment = 0;
#endif
@@ -31,8 +34,25 @@
RtlFirstEntrySList(IN const SLIST_HEADER *ListHead)
{
#ifdef _WIN64
- UNIMPLEMENTED;
- return NULL;
+ if (ListHead->Header8.HeaderType)
+ {
+ return (PVOID)(ListHead->Region & ~0xF);
+ }
+ else
+ {
+ union {
+ PVOID P;
+ struct {
+ ULONG64 Reserved:4;
+ ULONG64 NextEntry:39;
+ ULONG64 Reserved2:21;
+ } Bits;
+ } Pointer;
+
+ Pointer.P = (PVOID)ListHead;
+ Pointer.Bits.NextEntry = ListHead->Header8.NextEntry;
+ return Pointer.P;
+ }
#else
return ListHead->Next.Next;
#endif
@@ -43,8 +63,8 @@
RtlQueryDepthSList(IN PSLIST_HEADER ListHead)
{
#ifdef _WIN64
- UNIMPLEMENTED;
- return 0;
+ return ListHead->Header8.HeaderType ?
+ ListHead->Header16.Sequence : ListHead->Header8.Sequence;
#else
return ListHead->Depth;
#endif