ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2008
----- 2024 -----
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
27 participants
853 discussions
Start a n
N
ew thread
[tkreuzer] 35504: Implement __readcr8, __writecr8, __lidt and __sidt intrinsics.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Aug 21 08:30:00 2008 New Revision: 35504 URL:
http://svn.reactos.org/svn/reactos?rev=35504&view=rev
Log: Implement __readcr8, __writecr8, __lidt and __sidt intrinsics. Modified: branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h Modified: branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h [iso-8859-1] Thu Aug 21 08:30:00 2008 @@ -1105,6 +1105,11 @@ __asm__("movq %q[Data], %%cr4" : : [Data] "q" (Data) : "memory"); } +static __inline__ __attribute__((always_inline)) void __writecr8(const unsigned long long Data) +{ + __asm__("movq %q[Data], %%cr8" : : [Data] "q" (Data) : "memory"); +} + static __inline__ __attribute__((always_inline)) unsigned long long __readcr0(void) { unsigned long long value; @@ -1133,6 +1138,13 @@ return value; } +static __inline__ __attribute__((always_inline)) unsigned long long __readcr8(void) +{ + unsigned long long value; + __asm__ __volatile__("movq %%cr8, %q[value]" : [value] "=q" (value)); + return value; +} + #else static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long Data) { @@ -1218,6 +1230,16 @@ __asm__ __volatile__("wbinvd"); } +static __inline__ __attribute__((always_inline)) void __lidt(void *Source) +{ + __asm__ __volatile__("lidt %0" : : "m"(*(short*)Source)); +} + +static __inline__ __attribute__((always_inline)) void __sidt(void *Destination) +{ + __asm__ __volatile__("sidt %0" : : "m"(*(short*)Destination)); +} + #endif /* KJK_INTRIN_X86_H_ */ /* EOF */
16 years, 2 months
1
0
0
0
[fireball] 35503: - Add missing MmCallDllInitialize prototype. - Make IopOpenRegistryKeyEx NTAPI. - Patch by Alex Ionescu.
by fireball@svn.reactos.org
Author: fireball Date: Thu Aug 21 06:04:50 2008 New Revision: 35503 URL:
http://svn.reactos.org/svn/reactos?rev=35503&view=rev
Log: - Add missing MmCallDllInitialize prototype. - Make IopOpenRegistryKeyEx NTAPI. - Patch by Alex Ionescu. Modified: trunk/reactos/ntoskrnl/include/internal/io.h trunk/reactos/ntoskrnl/include/internal/mm.h trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Modified: trunk/reactos/ntoskrnl/include/internal/io.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] Thu Aug 21 06:04:50 2008 @@ -583,6 +583,7 @@ IN BOOLEAN BootDrivers); NTSTATUS +NTAPI IopOpenRegistryKeyEx( PHANDLE KeyHandle, HANDLE ParentKey, Modified: trunk/reactos/ntoskrnl/include/internal/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Thu Aug 21 06:04:50 2008 @@ -1547,6 +1547,13 @@ IN BOOLEAN PurgeSection ); +NTSTATUS +NTAPI +MmCallDllInitialize( + IN PLDR_DATA_TABLE_ENTRY LdrEntry, + IN PLIST_ENTRY ListHead +); + /* ReactOS Mm Hack */ VOID FASTCALL Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Thu Aug 21 06:04:50 2008 @@ -2669,6 +2669,7 @@ } NTSTATUS +NTAPI IopOpenRegistryKeyEx(PHANDLE KeyHandle, HANDLE ParentKey, PUNICODE_STRING Name,
16 years, 2 months
1
0
0
0
[fireball] 35502: - Fix definition of BOOT_DRIVER_LIST_ENTRY (Information provided by Alex Ionescu).
by fireball@svn.reactos.org
Author: fireball Date: Thu Aug 21 05:58:53 2008 New Revision: 35502 URL:
http://svn.reactos.org/svn/reactos?rev=35502&view=rev
Log: - Fix definition of BOOT_DRIVER_LIST_ENTRY (Information provided by Alex Ionescu). Modified: trunk/reactos/boot/freeldr/freeldr/windows/winldr.c trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c trunk/reactos/include/reactos/arc/arc.h Modified: trunk/reactos/boot/freeldr/freeldr/windows/winldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] Thu Aug 21 05:58:53 2008 @@ -332,16 +332,16 @@ while (NextBd != &LoaderBlock->BootDriverListHead) { - BootDriver = CONTAINING_RECORD(NextBd, BOOT_DRIVER_LIST_ENTRY, ListEntry); + BootDriver = CONTAINING_RECORD(NextBd, BOOT_DRIVER_LIST_ENTRY, Link); DbgPrint((DPRINT_WINDOWS, "BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver->FilePath, - BootDriver->DataTableEntry, &BootDriver->RegistryPath)); + BootDriver->LdrEntry, &BootDriver->RegistryPath)); // Paths are relative (FIXME: Are they always relative?) // Load it Status = WinLdrLoadDeviceDriver(LoaderBlock, BootPath, &BootDriver->FilePath, - 0, &BootDriver->DataTableEntry); + 0, &BootDriver->LdrEntry); // If loading failed - cry loudly //FIXME: Maybe remove it from the list and try to continue? @@ -353,9 +353,9 @@ // Convert the RegistryPath and DTE addresses to VA since we are not going to use it anymore BootDriver->RegistryPath.Buffer = PaToVa(BootDriver->RegistryPath.Buffer); - BootDriver->DataTableEntry = PaToVa(BootDriver->DataTableEntry); - - NextBd = BootDriver->ListEntry.Flink; + BootDriver->LdrEntry = PaToVa(BootDriver->LdrEntry); + + NextBd = BootDriver->Link.Flink; } return TRUE; @@ -620,12 +620,12 @@ while (NextBd != &LoaderBlock->BootDriverListHead) { - BootDriver = CONTAINING_RECORD(NextBd, BOOT_DRIVER_LIST_ENTRY, ListEntry); + BootDriver = CONTAINING_RECORD(NextBd, BOOT_DRIVER_LIST_ENTRY, Link); DbgPrint((DPRINT_WINDOWS, "BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver->FilePath, - BootDriver->DataTableEntry, &BootDriver->RegistryPath)); - - NextBd = BootDriver->ListEntry.Flink; + BootDriver->LdrEntry, &BootDriver->RegistryPath)); + + NextBd = BootDriver->Link.Flink; } } Modified: trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c [iso-8859-1] Thu Aug 21 05:58:53 2008 @@ -685,7 +685,7 @@ return FALSE; // DTE will be filled during actual load of the driver - BootDriverEntry->DataTableEntry = NULL; + BootDriverEntry->LdrEntry = NULL; // Check - if we have a valid ImagePath, if not - we need to build it // like "System32\\Drivers\\blah.sys" @@ -768,7 +768,7 @@ return FALSE; // Insert entry at top of the list - InsertTailList(BootDriverListHead, &BootDriverEntry->ListEntry); + InsertTailList(BootDriverListHead, &BootDriverEntry->Link); return TRUE; } Modified: trunk/reactos/include/reactos/arc/arc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/arc/arc.h?…
============================================================================== --- trunk/reactos/include/reactos/arc/arc.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/arc/arc.h [iso-8859-1] Thu Aug 21 05:58:53 2008 @@ -118,10 +118,10 @@ typedef struct _BOOT_DRIVER_LIST_ENTRY { - LIST_ENTRY ListEntry; + LIST_ENTRY Link; UNICODE_STRING FilePath; UNICODE_STRING RegistryPath; - struct _LDR_DATA_TABLE_ENTRY *DataTableEntry; + struct _LDR_DATA_TABLE_ENTRY *LdrEntry; } BOOT_DRIVER_LIST_ENTRY, *PBOOT_DRIVER_LIST_ENTRY; typedef struct _ARC_DISK_SIGNATURE
16 years, 2 months
1
0
0
0
[pschweitzer] 35501: Implemented CdfsIsNameLegalDOS8Dot3 and use it to check filenames. It avoids calling Rtl* functions that need NLS. It uses FsRtl* functions instead. This fixes bug #2404. But, we also have to get rid of RtlGenerate8dot3Name to completely fix it.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Aug 21 03:53:59 2008 New Revision: 35501 URL:
http://svn.reactos.org/svn/reactos?rev=35501&view=rev
Log: Implemented CdfsIsNameLegalDOS8Dot3 and use it to check filenames. It avoids calling Rtl* functions that need NLS. It uses FsRtl* functions instead. This fixes bug #2404. But, we also have to get rid of RtlGenerate8dot3Name to completely fix it. Modified: branches/pierre-fsd/drivers/filesystems/cdfs/cdfs.h branches/pierre-fsd/drivers/filesystems/cdfs/dirctl.c branches/pierre-fsd/drivers/filesystems/cdfs/fcb.c branches/pierre-fsd/drivers/filesystems/cdfs/misc.c Modified: branches/pierre-fsd/drivers/filesystems/cdfs/cdfs.h URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
============================================================================== --- branches/pierre-fsd/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] (original) +++ branches/pierre-fsd/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] Thu Aug 21 03:53:59 2008 @@ -390,6 +390,9 @@ CdfsFileFlagsToAttributes(PFCB Fcb, PULONG FileAttributes); +BOOLEAN +CdfsIsNameLegalDOS8Dot3(IN UNICODE_STRING FileName); + /* rw.c */ Modified: branches/pierre-fsd/drivers/filesystems/cdfs/dirctl.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
============================================================================== --- branches/pierre-fsd/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] (original) +++ branches/pierre-fsd/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] Thu Aug 21 03:53:59 2008 @@ -176,7 +176,6 @@ ULONG DirSize; PDIR_RECORD Record; LARGE_INTEGER StreamOffset; - BOOLEAN HasSpaces; GENERATE_NAME_CONTEXT NameContext; DPRINT("FindFile(Parent %x, FileToFind '%wZ', DirIndex: %d)\n", @@ -289,8 +288,7 @@ ShortName.MaximumLength = 26; ShortName.Buffer = ShortNameBuffer; - if ((RtlIsNameLegalDOS8Dot3(&LongName, NULL, &HasSpaces) == FALSE) || - (HasSpaces == TRUE)) + if (!CdfsIsNameLegalDOS8Dot3(LongName)) { /* Build short name */ RtlGenerate8dot3Name(&LongName, Modified: branches/pierre-fsd/drivers/filesystems/cdfs/fcb.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
============================================================================== --- branches/pierre-fsd/drivers/filesystems/cdfs/fcb.c [iso-8859-1] (original) +++ branches/pierre-fsd/drivers/filesystems/cdfs/fcb.c [iso-8859-1] Thu Aug 21 03:53:59 2008 @@ -462,7 +462,6 @@ WCHAR ShortNameBuffer[13]; UNICODE_STRING ShortName; UNICODE_STRING LongName; - BOOLEAN HasSpaces; GENERATE_NAME_CONTEXT NameContext; @@ -522,8 +521,7 @@ ShortName.Buffer = ShortNameBuffer; memset(ShortNameBuffer, 0, 26); - if ((RtlIsNameLegalDOS8Dot3(&LongName, NULL, &HasSpaces) == FALSE) || - (HasSpaces == TRUE)) + if (!CdfsIsNameLegalDOS8Dot3(LongName)) { /* Build short name */ RtlGenerate8dot3Name(&LongName, Modified: branches/pierre-fsd/drivers/filesystems/cdfs/misc.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/drivers/filesystems/…
============================================================================== --- branches/pierre-fsd/drivers/filesystems/cdfs/misc.c [iso-8859-1] (original) +++ branches/pierre-fsd/drivers/filesystems/cdfs/misc.c [iso-8859-1] Thu Aug 21 03:53:59 2008 @@ -95,4 +95,38 @@ ((Fcb->Entry.FileFlags & FILE_FLAG_READONLY) ? FILE_ATTRIBUTE_READONLY : 0); } +BOOLEAN +CdfsIsNameLegalDOS8Dot3(IN UNICODE_STRING FileName + ) +{ + ULONG i; + STRING DbcsName; + CHAR DbcsNameBuffer[12]; + + for (i = 0; i < FileName.Length / sizeof(WCHAR) ; i++) + { + /* Don't allow spaces in FileName */ + if (FileName.Buffer[i] == L' ') + return FALSE; + } + + /* If FileName is finishing with a dot, remove it */ + if (FileName.Buffer[FileName.Length / sizeof(WCHAR) - 1] == '.') + { + FileName.Length -= sizeof(WCHAR); + } + + /* Finally, convert the string to call the FsRtl function */ + DbcsName.MaximumLength = 12; + DbcsName.Buffer = DbcsNameBuffer; + if (!NT_SUCCESS(RtlUnicodeStringToCountedOemString(&DbcsName, + &FileName, + FALSE ))) + { + + return FALSE; + } + return FsRtlIsFatDbcsLegal(DbcsName, FALSE, FALSE, FALSE); +} + /* EOF */
16 years, 2 months
1
0
0
0
[pschweitzer] 35500: Added missing definition
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Aug 21 03:43:54 2008 New Revision: 35500 URL:
http://svn.reactos.org/svn/reactos?rev=35500&view=rev
Log: Added missing definition Modified: branches/pierre-fsd/include/ddk/ntifs.h Modified: branches/pierre-fsd/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/include/ddk/ntifs.h?…
============================================================================== --- branches/pierre-fsd/include/ddk/ntifs.h [iso-8859-1] (original) +++ branches/pierre-fsd/include/ddk/ntifs.h [iso-8859-1] Thu Aug 21 03:43:54 2008 @@ -4609,6 +4609,15 @@ NTSYSAPI NTSTATUS NTAPI +RtlUnicodeStringToCountedOemString ( + IN OUT POEM_STRING DestinationString, + IN PCUNICODE_STRING SourceString, + IN BOOLEAN AllocateDestinationString +); + +NTSYSAPI +NTSTATUS +NTAPI RtlUnicodeToMultiByteN( OUT PCHAR MultiByteString, IN ULONG MaxBytesInMultiByteString,
16 years, 2 months
1
0
0
0
[arty] 35499: Merge aicom-network-fixes up to 35486
by arty@svn.reactos.org
Author: arty Date: Wed Aug 20 22:38:49 2008 New Revision: 35499 URL:
http://svn.reactos.org/svn/reactos?rev=35499&view=rev
Log: Merge aicom-network-fixes up to 35486 Modified: trunk/reactos/drivers/network/afd/afd/info.c trunk/reactos/drivers/network/afd/afd/listen.c trunk/reactos/drivers/network/afd/afd/lock.c trunk/reactos/drivers/network/afd/afd/main.c trunk/reactos/drivers/network/afd/afd/read.c trunk/reactos/drivers/network/afd/afd/write.c trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c trunk/reactos/drivers/network/tcpip/tcpip/main.c Modified: trunk/reactos/drivers/network/afd/afd/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/in…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] Wed Aug 20 22:38:49 2008 @@ -135,22 +135,21 @@ if( NT_SUCCESS(Status) ) { Status = TdiQueryInformation - ( FCB->AddressFile.Object, + ( FCB->Connection.Object, TDI_QUERY_CONNECTION_INFO, SysMdl ); } if( NT_SUCCESS(Status) ) { TransAddr = - (PTRANSPORT_ADDRESS)MmMapLockedPages - ( Mdl, IoModifyAccess ); - } + (PTRANSPORT_ADDRESS)MmGetSystemAddressForMdlSafe( Mdl, NormalPagePriority ); - if( TransAddr ) - RtlCopyMemory( TransAddr, ConnInfo->RemoteAddress, - TaLengthOfTransportAddress - ( ConnInfo->RemoteAddress ) ); - else Status = STATUS_INSUFFICIENT_RESOURCES; + if( TransAddr ) + RtlCopyMemory( TransAddr, ConnInfo->RemoteAddress, + TaLengthOfTransportAddress + ( ConnInfo->RemoteAddress ) ); + else Status = STATUS_INSUFFICIENT_RESOURCES; + } if( ConnInfo ) ExFreePool( ConnInfo ); if( SysMdl ) IoFreeMdl( SysMdl ); Modified: trunk/reactos/drivers/network/afd/afd/listen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/li…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] Wed Aug 20 22:38:49 2008 @@ -87,14 +87,14 @@ PAFD_FCB FCB = (PAFD_FCB)Context; PAFD_TDI_OBJECT_QELT Qelt; + if( Irp->Cancel ) { + if( FCB ) FCB->ListenIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->ListenIrp.InFlightRequest = NULL; - - if( Irp->Cancel ) { - SocketStateUnlock( FCB ); - return STATUS_SUCCESS; - } if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); Modified: trunk/reactos/drivers/network/afd/afd/lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lo…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] Wed Aug 20 22:38:49 2008 @@ -15,6 +15,8 @@ /* Lock a method_neither request so it'll be available from DISPATCH_LEVEL */ PVOID LockRequest( PIRP Irp, PIO_STACK_LOCATION IrpSp ) { + BOOLEAN LockFailed = FALSE; + Irp->MdlAddress = IoAllocateMdl( IrpSp->Parameters.DeviceIoControl.Type3InputBuffer, IrpSp->Parameters.DeviceIoControl.InputBufferLength, @@ -22,14 +24,34 @@ FALSE, NULL ); if( Irp->MdlAddress ) { - MmProbeAndLockPages( Irp->MdlAddress, KernelMode, IoModifyAccess ); + _SEH_TRY { + MmProbeAndLockPages( Irp->MdlAddress, KernelMode, IoModifyAccess ); + } _SEH_HANDLE { + LockFailed = TRUE; + } _SEH_END; + + if( LockFailed ) { + IoFreeMdl( Irp->MdlAddress ); + Irp->MdlAddress = NULL; + return NULL; + } + IrpSp->Parameters.DeviceIoControl.Type3InputBuffer = MmMapLockedPages( Irp->MdlAddress, KernelMode ); + + if( !IrpSp->Parameters.DeviceIoControl.Type3InputBuffer ) { + IoFreeMdl( Irp->MdlAddress ); + Irp->MdlAddress = NULL; + return NULL; + } + return IrpSp->Parameters.DeviceIoControl.Type3InputBuffer; } else return NULL; } VOID UnlockRequest( PIRP Irp, PIO_STACK_LOCATION IrpSp ) { + if( !IrpSp->Parameters.DeviceIoControl.Type3InputBuffer || !Irp->MdlAddress ) return; + MmUnmapLockedPages( IrpSp->Parameters.DeviceIoControl.Type3InputBuffer, Irp->MdlAddress ); MmUnlockPages( Irp->MdlAddress ); Modified: trunk/reactos/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/ma…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] Wed Aug 20 22:38:49 2008 @@ -190,9 +190,7 @@ if( InFlightRequest[i]->InFlightRequest ) { AFD_DbgPrint(MID_TRACE,("Cancelling in flight irp %d (%x)\n", i, InFlightRequest[i]->InFlightRequest)); - InFlightRequest[i]->InFlightRequest->IoStatus.Status = STATUS_CANCELLED; - InFlightRequest[i]->InFlightRequest->IoStatus.Information = 0; - IoCancelIrp( InFlightRequest[i]->InFlightRequest ); + InFlightRequest[i]->InFlightRequest = NULL; } } Modified: trunk/reactos/drivers/network/afd/afd/read.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Wed Aug 20 22:38:49 2008 @@ -233,6 +233,11 @@ ASSERT_IRQL(APC_LEVEL); + if( Irp->Cancel ) { + if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->ReceiveIrp.InFlightRequest = NULL; @@ -448,6 +453,11 @@ UINT DGSize = Irp->IoStatus.Information + sizeof( AFD_STORED_DATAGRAM ); AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); + + if( Irp->Cancel ) { + if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; Modified: trunk/reactos/drivers/network/afd/afd/write.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/wr…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] Wed Aug 20 22:38:49 2008 @@ -40,6 +40,11 @@ ASSERT_IRQL(APC_LEVEL); + if( Irp->Cancel ) { + if( FCB ) FCB->SendIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->SendIrp.InFlightRequest = NULL; @@ -170,6 +175,11 @@ Irp->IoStatus.Status, Irp->IoStatus.Information)); + if( Irp->Cancel ) { + if( FCB ) FCB->SendIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + /* It's ok if the FCB already died */ if( !SocketAcquireStateLock( FCB ) ) return STATUS_SUCCESS; @@ -264,30 +274,28 @@ return UnlockAndMaybeComplete ( FCB, STATUS_NO_MEMORY, Irp, TotalBytesCopied, NULL ); + SendReq->BufferArray = LockBuffers( SendReq->BufferArray, + SendReq->BufferCount, + NULL, NULL, + FALSE, FALSE ); + + if( !SendReq->BufferArray ) { + return UnlockAndMaybeComplete( FCB, STATUS_ACCESS_VIOLATION, + Irp, 0, NULL ); + } + AFD_DbgPrint(MID_TRACE,("Socket state %d\n", FCB->State)); if( FCB->State != SOCKET_STATE_CONNECTED ) { if( SendReq->AfdFlags & AFD_IMMEDIATE ) { AFD_DbgPrint(MID_TRACE,("Nonblocking\n")); + UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE ); return UnlockAndMaybeComplete ( FCB, STATUS_CANT_WAIT, Irp, 0, NULL ); } else { AFD_DbgPrint(MID_TRACE,("Queuing request\n")); return LeaveIrpUntilLater( FCB, Irp, FUNCTION_SEND ); } - } - - AFD_DbgPrint(MID_TRACE,("We already have %d bytes waiting.\n", - FCB->Send.BytesUsed)); - - SendReq->BufferArray = LockBuffers( SendReq->BufferArray, - SendReq->BufferCount, - NULL, NULL, - FALSE, FALSE ); - - if( !SendReq->BufferArray ) { - return UnlockAndMaybeComplete( FCB, STATUS_ACCESS_VIOLATION, - Irp, 0, NULL ); } AFD_DbgPrint(MID_TRACE,("FCB->Send.BytesUsed = %d\n", @@ -362,6 +370,7 @@ if( SendReq->AfdFlags & AFD_IMMEDIATE ) { AFD_DbgPrint(MID_TRACE,("Nonblocking\n")); + UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE ); return UnlockAndMaybeComplete ( FCB, STATUS_CANT_WAIT, Irp, 0, NULL ); } else { Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Wed Aug 20 22:38:49 2008 @@ -52,34 +52,6 @@ return IRPFinish(Irp, STATUS_CANCELLED); } - - -VOID DispCancelComplete( - PVOID Context) -/* - * FUNCTION: Completes a cancel request - * ARGUMENTS: - * Context = Pointer to context information (FILE_OBJECT) - */ -{ - /*KIRQL OldIrql;*/ - PFILE_OBJECT FileObject; - PTRANSPORT_CONTEXT TranContext; - - TI_DbgPrint(DEBUG_IRP, ("Called.\n")); - - FileObject = (PFILE_OBJECT)Context; - TranContext = (PTRANSPORT_CONTEXT)FileObject->FsContext; - - /* Set the cleanup event */ - KeSetEvent(&TranContext->CleanupEvent, 0, FALSE); - - /* We are expected to release the cancel spin lock */ - /*IoReleaseCancelSpinLock(OldIrql);*/ - - TI_DbgPrint(DEBUG_IRP, ("Leaving.\n")); -} - VOID DispDataRequestComplete( PVOID Context, @@ -155,8 +127,6 @@ TI_DbgPrint(DEBUG_IRP, ("PostCancel: DoDisconnect done\n")); DispDataRequestComplete(DisType->Irp, STATUS_CANCELLED, 0); - - DispCancelComplete(DisType->FileObject); } VOID NTAPI DispCancelRequest( @@ -209,24 +179,20 @@ if( !ChewCreate( &WorkItem, sizeof(DISCONNECT_TYPE), DispDoDisconnect, &DisType ) ) ASSERT(0); - break; + return; case TDI_SEND_DATAGRAM: if (FileObject->FsContext2 != (PVOID)TDI_TRANSPORT_ADDRESS_FILE) { TI_DbgPrint(MIN_TRACE, ("TDI_SEND_DATAGRAM, but no address file.\n")); - break; } - - /*DGCancelSendRequest(TranContext->Handle.AddressHandle, Irp);*/ break; case TDI_RECEIVE_DATAGRAM: if (FileObject->FsContext2 != (PVOID)TDI_TRANSPORT_ADDRESS_FILE) { TI_DbgPrint(MIN_TRACE, ("TDI_RECEIVE_DATAGRAM, but no address file.\n")); - break; } - /*DGCancelReceiveRequest(TranContext->Handle.AddressHandle, Irp);*/ + DGRemoveIRP(TranContext->Handle.AddressHandle, Irp); break; default: @@ -235,6 +201,7 @@ } IoReleaseCancelSpinLock(Irp->CancelIrql); + IoCompleteRequest(Irp, IO_NO_INCREMENT); TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } @@ -279,8 +246,6 @@ IoReleaseCancelSpinLock(Irp->CancelIrql); DispDataRequestComplete(Irp, STATUS_CANCELLED, 0); - - DispCancelComplete(FileObject); TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } Modified: trunk/reactos/drivers/network/tcpip/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Wed Aug 20 22:38:49 2008 @@ -138,7 +138,6 @@ } CP Context->CancelIrps = FALSE; - KeInitializeEvent(&Context->CleanupEvent, NotificationEvent, FALSE); CP IrpSp = IoGetCurrentIrpStackLocation(Irp); IrpSp->FileObject->FsContext = Context; @@ -253,36 +252,6 @@ return Status; } - -VOID TiCleanupFileObjectComplete( - PVOID Context, - NTSTATUS Status) -/* - * FUNCTION: Completes an object cleanup IRP I/O request - * ARGUMENTS: - * Context = Pointer to the IRP for this request - * Status = Final status of the operation - */ -{ - PIRP Irp; - PIO_STACK_LOCATION IrpSp; - PTRANSPORT_CONTEXT TranContext; - KIRQL OldIrql; - - Irp = (PIRP)Context; - IrpSp = IoGetCurrentIrpStackLocation(Irp); - TranContext = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext; - - Irp->IoStatus.Status = Status; - - IoAcquireCancelSpinLock(&OldIrql); - - KeSetEvent(&TranContext->CleanupEvent, 0, FALSE); - - IoReleaseCancelSpinLock(OldIrql); -} - - /* * FUNCTION: Releases resources used by a file object * ARGUMENTS: @@ -313,12 +282,8 @@ IoAcquireCancelSpinLock(&OldIrql); Context->CancelIrps = TRUE; - KeResetEvent(&Context->CleanupEvent); IoReleaseCancelSpinLock(OldIrql); - - Request.RequestNotifyObject = TiCleanupFileObjectComplete; - Request.RequestContext = Irp; switch ((ULONG_PTR)IrpSp->FileObject->FsContext2) { case TDI_TRANSPORT_ADDRESS_FILE: @@ -345,19 +310,8 @@ Context->CancelIrps = FALSE; IoReleaseCancelSpinLock(OldIrql); - Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; - - return Irp->IoStatus.Status; - } - - if (Status != STATUS_PENDING) - { - IoAcquireCancelSpinLock(&OldIrql); - KeSetEvent(&Context->CleanupEvent, 0, FALSE); - IoReleaseCancelSpinLock(OldIrql); - - KeWaitForSingleObject(&Context->CleanupEvent, - UserRequest, KernelMode, FALSE, NULL); + Status = STATUS_INVALID_PARAMETER; + } Irp->IoStatus.Status = Status;
16 years, 2 months
1
0
0
0
[gbrunmar] 35498: Added some more parameter error checking to D3D9::CreateDevice()
by gbrunmar@svn.reactos.org
Author: gbrunmar Date: Wed Aug 20 22:19:02 2008 New Revision: 35498 URL:
http://svn.reactos.org/svn/reactos?rev=35498&view=rev
Log: Added some more parameter error checking to D3D9::CreateDevice() Modified: trunk/reactos/dll/directx/d3d9/d3d9_impl.c Modified: trunk/reactos/dll/directx/d3d9/d3d9_impl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_impl…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_impl.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_impl.c [iso-8859-1] Wed Aug 20 22:19:02 2008 @@ -923,7 +923,42 @@ if (hFocusWindow != NULL && FALSE == IsWindow(hFocusWindow)) { - DPRINT1("Invalid hFocusWindow parameter specified"); + DPRINT1("Invalid hFocusWindow parameter specified, expected NULL or a valid HWND"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (NULL == pPresentationParameters) + { + DPRINT1("Invalid pPresentationParameters parameter specified"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (pPresentationParameters->hDeviceWindow != NULL && FALSE == IsWindow(pPresentationParameters->hDeviceWindow)) + { + DPRINT1("Invalid pPresentationParameters->hDeviceWindow parameter specified, expected NULL or a valid HWND"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (FALSE == pPresentationParameters->Windowed && hFocusWindow == NULL) + { + DPRINT1("When pPresentationParameters->Windowed is not set, hFocusWindow must be a valid HWND"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (NULL == hFocusWindow && NULL == pPresentationParameters->hDeviceWindow) + { + DPRINT1("Any of pPresentationParameters->Windowed and hFocusWindow must be set to a valid HWND"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (Adapter > 0 && NULL == pPresentationParameters->hDeviceWindow) + { + DPRINT1("Invalid pPresentationParameters->hDeviceWindow, must be set to a valid unique HWND when Adapter is greater than 0"); UNLOCK_D3D9(); return D3DERR_INVALIDCALL; }
16 years, 2 months
1
0
0
0
[gbrunmar] 35497: * Removed unused header file * Fixed signed/unsigned comparison warning
by gbrunmar@svn.reactos.org
Author: gbrunmar Date: Wed Aug 20 21:34:28 2008 New Revision: 35497 URL:
http://svn.reactos.org/svn/reactos?rev=35497&view=rev
Log: * Removed unused header file * Fixed signed/unsigned comparison warning Removed: trunk/reactos/dll/directx/d3d9/d3d9.h Modified: trunk/reactos/dll/directx/d3d9/d3d9_helpers.c trunk/reactos/dll/directx/d3d9/d3d9_helpers.h Removed: trunk/reactos/dll/directx/d3d9/d3d9.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9.h?re…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/d3d9/d3d9.h (removed) @@ -1,3 +1,0 @@ -#include <windows.h> - -#define DLLAPI __declspec(dllexport) Modified: trunk/reactos/dll/directx/d3d9/d3d9_helpers.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_help…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_helpers.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_helpers.c [iso-8859-1] Wed Aug 20 21:34:28 2008 @@ -38,7 +38,7 @@ return TRUE; } -HRESULT SafeFormatString(OUT LPSTR Buffer, IN LONG BufferSize, IN LPCSTR FormatString, ... ) +HRESULT SafeFormatString(OUT LPSTR Buffer, IN DWORD BufferSize, IN LPCSTR FormatString, ... ) { DWORD BytesWritten; va_list vargs; Modified: trunk/reactos/dll/directx/d3d9/d3d9_helpers.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_help…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_helpers.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_helpers.h [iso-8859-1] Wed Aug 20 21:34:28 2008 @@ -16,7 +16,7 @@ BOOL ReadRegistryValue(IN DWORD ValueType, IN LPCSTR ValueName, OUT LPBYTE DataBuffer, IN OUT LPDWORD DataBufferSize); /* Safe string formatting */ -HRESULT SafeFormatString(IN OUT LPSTR Buffer, IN LONG BufferSize, IN LPCSTR FormatString, ... ); +HRESULT SafeFormatString(IN OUT LPSTR Buffer, IN DWORD BufferSize, IN LPCSTR FormatString, ... ); HRESULT SafeCopyString(OUT LPSTR Dst, IN DWORD DstSize, IN LPCSTR Src); HRESULT SafeAppendString(IN OUT LPSTR Dst, IN DWORD DstSize, IN LPCSTR Src);
16 years, 2 months
1
0
0
0
[tkreuzer] 35496: Fix KiSystemStartupReal, KiGetMachineBootPointers and KiInitializePcr. Add trap.S for ISRs (unimplemented). Add except.c with KiInterruptInitTable and KeInitExceptions, initializing the IDT. Add irql.c for IRQL functions (unimplemented). Update stubs file. Based on info from http://www.msuiche.net/papers/Windows_Vista_64bits_and_unexported_kernel_symbols.pdf. We now reach KiSetupStackAndInitializeKernel, but there's a few things still missing.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Aug 20 18:54:52 2008 New Revision: 35496 URL:
http://svn.reactos.org/svn/reactos?rev=35496&view=rev
Log: Fix KiSystemStartupReal, KiGetMachineBootPointers and KiInitializePcr. Add trap.S for ISRs (unimplemented). Add except.c with KiInterruptInitTable and KeInitExceptions, initializing the IDT. Add irql.c for IRQL functions (unimplemented). Update stubs file. Based on info from
http://www.msuiche.net/papers/Windows_Vista_64bits_and_unexported_kernel_sy…
. We now reach KiSetupStackAndInitializeKernel, but there's a few things still missing. Added: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c (with props) branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c (with props) branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/irql.c (with props) branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S (with props) Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl_amd64.def Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/amd64stubs.c [iso-8859-1] Wed Aug 20 18:54:52 2008 @@ -1,17 +1,13 @@ - -#define STUB(x) void x() {} +unsigned long (*FrLdrDbgPrint)(const char *Format, ...); + + + +#define STUB(x) void x() {FrLdrDbgPrint("Sorry, %s is only a stub!\n", __FUNCTION__);} STUB(KdpEnableSafeMem) -STUB(KfLowerIrql) -STUB(KeRaiseIrql) -STUB(KeLowerIrql) -STUB(KeRaiseIrqlToSynchLevel) -STUB(KeRaiseIrqlToDpcLevel) STUB(KiIdleLoop) -STUB(KeGetCurrentIrql) STUB(KeAcquireInStackQueuedSpinLockRaiseToSynch) -STUB(KeNumberProcessors) STUB(KeBugcheckCallbackListHead) STUB(ExpInterlockedPushEntrySList) STUB(NtContinue) @@ -173,7 +169,6 @@ STUB(KeUpdateSystemTime) STUB(KeUserModeCallback) STUB(KeWaitForMutexObject) -STUB(KfRaiseIrql) STUB(KiBugCheckData) STUB(KiCpuId) STUB(MmCommitSessionMappedView) Added: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c (added) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] Wed Aug 20 18:54:52 2008 @@ -1,0 +1,59 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ke/amd64/cpu.c + * PURPOSE: Routines for CPU-level support + * PROGRAMMERS: Timo Kreuzer (timo.kreuzer(a)reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +/* GLOBALS *******************************************************************/ + +/* The Boot TSS */ +KTSS64 KiBootTss; + +/* The TSS to use for Double Fault Traps (INT 0x9) */ +UCHAR KiDoubleFaultTSS[KTSS_IO_MAPS]; + +/* The TSS to use for NMI Fault Traps (INT 0x2) */ +UCHAR KiNMITSS[KTSS_IO_MAPS]; + +/* CPU Features and Flags */ +ULONG KeI386MachineType; + +CHAR KeNumberProcessors = 0; + +/* FUNCTIONS *****************************************************************/ + + +VOID +FASTCALL +Ki386InitializeTss(IN PKTSS Tss, + IN PKIDTENTRY Idt, + IN PKGDTENTRY Gdt) +{ + // UNIMPLEMENTED; +} + +VOID +NTAPI +KeFlushCurrentTb(VOID) +{ + /* Flush the TLB by resetting CR3 */ + __writecr3(__readcr3()); +} + +VOID +NTAPI +KiInitializeMachineType(VOID) +{ + /* Set the Machine Type we got from NTLDR */ + KeI386MachineType = KeLoaderBlock->u.I386.MachineType & 0x000FF; +} + + Propchange: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c (added) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c [iso-8859-1] Wed Aug 20 18:54:52 2008 @@ -1,0 +1,90 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ke/i386/exp.c + * PURPOSE: Exception Dispatching and Context<->Trap Frame Conversion + * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) + * Gregor Anich + * Skywing (skywing(a)valhallalegends.com) + */ + +/* INCLUDES ******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +/* GLOBALS *******************************************************************/ + +KIDT_INIT KiInterruptInitTable[] = +{ + {0x00, 0x00, 0x00, KiDivideErrorFault}, + {0x01, 0x00, 0x00, KiDebugTrapOrFault}, + {0x02, 0x00, 0x03, KiNmiInterrupt}, + {0x03, 0x03, 0x00, KiBreakpointTrap}, + {0x04, 0x03, 0x00, KiOverflowTrap}, + {0x05, 0x00, 0x00, KiBoundFault}, + {0x06, 0x00, 0x00, KiInvalidOpcodeFault}, + {0x07, 0x00, 0x00, KiNpxNotAvailableFault}, + {0x08, 0x00, 0x01, KiDoubleFaultAbort}, + {0x09, 0x00, 0x00, KiNpxSegmentOverrunAbort}, + {0x0A, 0x00, 0x00, KiInvalidTssFault}, + {0x0B, 0x00, 0x00, KiSegmentNotPresentFault}, + {0x0C, 0x00, 0x00, KiStackFault}, + {0x0D, 0x00, 0x00, KiGeneralProtectionFault}, + {0x0E, 0x00, 0x00, KiPageFault}, + {0x10, 0x00, 0x00, KiFloatingErrorFault}, + {0x11, 0x00, 0x00, KiAlignmentFault}, + {0x12, 0x00, 0x02, KiMcheckAbort}, + {0x13, 0x00, 0x00, KiXmmException}, + {0x1F, 0x00, 0x00, KiApcInterrupt}, + {0x2C, 0x03, 0x00, KiRaiseAssertion}, + {0x2D, 0x03, 0x00, KiDebugServiceTrap}, + {0x2F, 0x00, 0x00, KiDpcInterrupt}, + {0xE1, 0x00, 0x00, KiIpiInterrupt}, + {0, 0} +}; + +KIDTENTRY64 KiIdt[256]; +KDESCRIPTOR KiIdtDescriptor = {{0}, sizeof(KiIdt) - 1, KiIdt}; + +/* FUNCTIONS *****************************************************************/ + + + +VOID +INIT_FUNCTION +NTAPI +KeInitExceptions(VOID) +{ + int i, j; + + /* Initialize the Idt */ + for (j = i = 0; i < 256; i++) + { + ULONG64 Offset; + + if (KiInterruptInitTable[j].InterruptId == i) + { + Offset = (ULONG64)KiInterruptInitTable[j].ServiceRoutine; + KiIdt[i].Dpl = KiInterruptInitTable[j].Dpl; + j++; + } + else + { + Offset = (ULONG64)KiUnexpectedInterrupt; + KiIdt[i].Dpl = 0; + } + KiIdt[i].OffsetLow = Offset & 0xffff; + KiIdt[i].Selector = KGDT_64_R0_CODE; + KiIdt[i].Type = 0x0e; + KiIdt[i].IstIndex = 0; + KiIdt[i].Reserved0 = 0; + KiIdt[i].Present = 1; + KiIdt[i].OffsetMiddle = (Offset >> 16) & 0xffff; + KiIdt[i].OffsetHigh = (Offset >> 32); + KiIdt[i].Reserved1 = 0; + } + +} + Propchange: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/irql.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/irql.c (added) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/irql.c [iso-8859-1] Wed Aug 20 18:54:52 2008 @@ -1,0 +1,70 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Routines for IRQL-level support + * PROGRAMMERS: Timo Kreuzer + */ + +/* INCLUDES *****************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +#undef UNIMPLEMENTED + +#define UNIMPLEMENTED \ + FrLdrDbgPrint("Sorry, %s is unimplemented!\n", __FUNCTION__) + +/* FUNCTIONS ****************************************************************/ + +#undef KeGetCurrentIrql +NTKERNELAPI +KIRQL +KeGetCurrentIrql(VOID) +{ + UNIMPLEMENTED; + return 0; +} + + +NTKERNELAPI +VOID +KfLowerIrql(IN KIRQL NewIrql) +{ + UNIMPLEMENTED; +} + +NTKERNELAPI +KIRQL +KfRaiseIrql(IN KIRQL NewIrql) +{ + UNIMPLEMENTED; + return 0; +} + +NTKERNELAPI +KIRQL +KeRaiseIrqlToDpcLevel(VOID) +{ + UNIMPLEMENTED; + return 0; +} + +NTKERNELAPI +KIRQL +KeRaiseIrqlToSynchLevel(VOID) +{ + UNIMPLEMENTED; + return 0; +} + +NTKERNELAPI +VOID +KeLowerIrql(IN KIRQL NewIrql) +{ + UNIMPLEMENTED; + return 0; +} + +/* EOF */ Propchange: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/irql.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] Wed Aug 20 18:54:52 2008 @@ -21,6 +21,8 @@ /* BIOS Memory Map. Not NTLDR-compliant yet */ extern ULONG KeMemoryMapRangeCount; extern ADDRESS_RANGE KeMemoryMap[64]; + +KIPCR KiInitialPcr; /* FUNCTIONS *****************************************************************/ @@ -331,57 +333,48 @@ IN PKTHREAD IdleThread, IN PVOID DpcStack) { -#if 0 - /* Setup the TIB */ - Pcr->NtTib.ExceptionList = EXCEPTION_CHAIN_END; - Pcr->NtTib.StackBase = 0; - Pcr->NtTib.StackLimit = 0; - Pcr->NtTib.Self = NULL; - /* Set the Current Thread */ - Pcr->PrcbData.CurrentThread = IdleThread; + Pcr->Prcb.CurrentThread = IdleThread; /* Set pointers to ourselves */ Pcr->Self = (PKPCR)Pcr; - Pcr->Prcb = &Pcr->PrcbData; + Pcr->CurrentPrcb = &Pcr->Prcb; /* Set the PCR Version */ Pcr->MajorVersion = PCR_MAJOR_VERSION; Pcr->MinorVersion = PCR_MINOR_VERSION; /* Set the PCRB Version */ - Pcr->PrcbData.MajorVersion = 1; - Pcr->PrcbData.MinorVersion = 1; + Pcr->Prcb.MajorVersion = 1; + Pcr->Prcb.MinorVersion = 1; /* Set the Build Type */ - Pcr->PrcbData.BuildType = 0; + Pcr->Prcb.BuildType = 0; #ifndef CONFIG_SMP - Pcr->PrcbData.BuildType |= PRCB_BUILD_UNIPROCESSOR; + Pcr->Prcb.BuildType |= PRCB_BUILD_UNIPROCESSOR; #endif #ifdef DBG - Pcr->PrcbData.BuildType |= PRCB_BUILD_DEBUG; + Pcr->Prcb.BuildType |= PRCB_BUILD_DEBUG; #endif /* Set the Processor Number and current Processor Mask */ - Pcr->PrcbData.Number = (UCHAR)ProcessorNumber; - Pcr->PrcbData.SetMember = 1 << ProcessorNumber; + Pcr->Prcb.Number = (UCHAR)ProcessorNumber; + Pcr->Prcb.SetMember = 1 << ProcessorNumber; /* Set the PRCB for this Processor */ - KiProcessorBlock[ProcessorNumber] = Pcr->Prcb; + KiProcessorBlock[ProcessorNumber] = &Pcr->Prcb; /* Start us out at PASSIVE_LEVEL */ - Pcr->Irql = PASSIVE_LEVEL; +// Pcr->Irql = PASSIVE_LEVEL; /* Set the GDI, IDT, TSS and DPC Stack */ - Pcr->GDT = (PVOID)Gdt; - Pcr->IDT = Idt; - Pcr->TSS = Tss; - Pcr->TssCopy = Tss; - Pcr->PrcbData.DpcStack = DpcStack; + Pcr->GdtBase = (PVOID)Gdt; + Pcr->IdtBase = Idt; + Pcr->TssBase = Tss; + Pcr->Prcb.DpcStack = DpcStack; /* Setup the processor set */ - Pcr->PrcbData.MultiThreadProcessorSet = Pcr->PrcbData.SetMember; -#endif + Pcr->Prcb.MultiThreadProcessorSet = Pcr->Prcb.SetMember; } VOID @@ -616,14 +609,20 @@ IN PKIPCR *Pcr, IN PKTSS *Tss) { -#if 0 - KDESCRIPTOR GdtDescriptor = {0}, IdtDescriptor = {0}; - KGDTENTRY TssSelector, PcrSelector; - USHORT Tr = 0, Fs; + KDESCRIPTOR GdtDescriptor = {{0},0,0}, IdtDescriptor = {{0},0,0}; + KGDTENTRY64 TssSelector; + USHORT Tr = 0; /* Get GDT and IDT descriptors */ - Ke386GetGlobalDescriptorTable(*(PKDESCRIPTOR)&GdtDescriptor.Limit); - Ke386GetInterruptDescriptorTable(*(PKDESCRIPTOR)&IdtDescriptor.Limit); + Ke386GetGlobalDescriptorTable(GdtDescriptor.Limit); + Ke386GetInterruptDescriptorTable(IdtDescriptor.Limit); + + // FIXME: for some strange reason the gdt needs some time before it's finished... + if (!GdtDescriptor.Base) + { + FrLdrDbgPrint("1. Base = %p, Limit = 0x%x\n", GdtDescriptor.Base, GdtDescriptor.Limit); + } + FrLdrDbgPrint("2. Base = %p, Limit = 0x%x\n", GdtDescriptor.Base, GdtDescriptor.Limit); /* Save IDT and GDT */ *Gdt = (PKGDTENTRY)GdtDescriptor.Base; @@ -632,24 +631,15 @@ /* Get TSS and FS Selectors */ Ke386GetTr(Tr); if (Tr != KGDT_TSS) Tr = KGDT_TSS; // FIXME: HACKHACK - Fs = Ke386GetFs(); - - /* Get PCR Selector, mask it and get its GDT Entry */ - PcrSelector = *(PKGDTENTRY)((ULONG_PTR)*Gdt + (Fs & ~RPL_MASK)); - - /* Get the KPCR itself */ - *Pcr = (PKIPCR)(ULONG_PTR)(PcrSelector.BaseLow | - PcrSelector.HighWord.Bytes.BaseMid << 16 | - PcrSelector.HighWord.Bytes.BaseHi << 24); /* Get TSS Selector, mask it and get its GDT Entry */ TssSelector = *(PKGDTENTRY)((ULONG_PTR)*Gdt + (Tr & ~RPL_MASK)); /* Get the KTSS itself */ *Tss = (PKTSS)(ULONG_PTR)(TssSelector.BaseLow | - TssSelector.HighWord.Bytes.BaseMid << 16 | - TssSelector.HighWord.Bytes.BaseHi << 24); -#endif + TssSelector.Bytes.BaseMiddle << 16 | + TssSelector.Bytes.BaseHigh << 24 | + (ULONG64)TssSelector.BaseUpper << 32); } VOID @@ -657,26 +647,30 @@ KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { FrLdrDbgPrint("Enter KiSystemStartupReal()\n"); - for(;;); - -#if 0 + ULONG Cpu; PKTHREAD InitialThread; - ULONG InitialStack; + ULONG64 InitialStack; PKGDTENTRY Gdt; PKIDTENTRY Idt; - KIDTENTRY NmiEntry, DoubleFaultEntry; +// KIDTENTRY NmiEntry, DoubleFaultEntry; PKTSS Tss; PKIPCR Pcr; /* Save the loader block and get the current CPU */ KeLoaderBlock = LoaderBlock; + + /* Get Pcr from loader block */ +// Pcr = CONTAINING_RECORD(LoaderBlock->Prcb, KIPCR, Prcb); + Pcr = &KiInitialPcr; + Cpu = KeNumberProcessors; - if (!Cpu) - { - /* If this is the boot CPU, set FS and the CPU Number*/ - Ke386SetFs(KGDT_R0_PCR); - __writefsdword(KPCR_PROCESSOR_NUMBER, Cpu); + if (Cpu == 0) + { + /* If this is the boot CPU, set GS base and the CPU Number*/ + __writemsr(X86_MSR_GSBASE, (ULONG64)Pcr); + __writemsr(X86_MSR_KERNEL_GSBASE, (ULONG64)Pcr); + Pcr->Prcb.Number = Cpu; /* Set the initial stack and idle thread as well */ LoaderBlock->KernelStack = (ULONG_PTR)P0BootStack; @@ -684,7 +678,7 @@ } /* Save the initial thread and stack */ - InitialStack = LoaderBlock->KernelStack; + InitialStack = LoaderBlock->KernelStack; // Chekme InitialThread = (PKTHREAD)LoaderBlock->Thread; /* Clean the APC List Head */ @@ -694,53 +688,59 @@ KiInitializeMachineType(); /* Skip initial setup if this isn't the Boot CPU */ - if (Cpu) goto AppCpuInit; - - /* Get GDT, IDT, PCR and TSS pointers */ - KiGetMachineBootPointers(&Gdt, &Idt, &Pcr, &Tss); - - /* Setup the TSS descriptors and entries */ - Ki386InitializeTss(Tss, Idt, Gdt); - - /* Initialize the PCR */ - RtlZeroMemory(Pcr, PAGE_SIZE); - KiInitializePcr(Cpu, - Pcr, - Idt, - Gdt, - Tss, - InitialThread, - KiDoubleFaultStack); - - /* Set us as the current process */ - InitialThread->ApcState.Process = &KiInitialProcess.Pcb; - - /* Clear DR6/7 to cleanup bootloader debugging */ - __writefsdword(KPCR_TEB, 0); - __writefsdword(KPCR_DR6, 0); - __writefsdword(KPCR_DR7, 0); - - /* Setup the IDT */ - KeInitExceptions(); - - /* Load Ring 3 selectors for DS/ES */ - Ke386SetDs(KGDT_R3_DATA | RPL_MASK); - Ke386SetEs(KGDT_R3_DATA | RPL_MASK); - - /* Save NMI and double fault traps */ - RtlCopyMemory(&NmiEntry, &Idt[2], sizeof(KIDTENTRY)); - RtlCopyMemory(&DoubleFaultEntry, &Idt[8], sizeof(KIDTENTRY)); - - /* Copy kernel's trap handlers */ - RtlCopyMemory(Idt, - (PVOID)KiIdtDescriptor.Base, - KiIdtDescriptor.Limit + 1); - - /* Restore NMI and double fault */ - RtlCopyMemory(&Idt[2], &NmiEntry, sizeof(KIDTENTRY)); - RtlCopyMemory(&Idt[8], &DoubleFaultEntry, sizeof(KIDTENTRY)); - -AppCpuInit: + if (Cpu == 0) + { + /* Get GDT, IDT, PCR and TSS pointers */ + KiGetMachineBootPointers(&Gdt, &Idt, &Pcr, &Tss); + +FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); + + /* Setup the TSS descriptors and entries */ + Ki386InitializeTss(Tss, Idt, Gdt); + + /* Initialize the PCR */ + RtlZeroMemory(Pcr, PAGE_SIZE); + KiInitializePcr(Cpu, + Pcr, + Idt, + Gdt, + Tss, + InitialThread, + KiDoubleFaultStack); + + /* Set us as the current process */ + InitialThread->ApcState.Process = &KiInitialProcess.Pcb; + + /* Clear DR6/7 to cleanup bootloader debugging */ + Pcr->Prcb.ProcessorState.SpecialRegisters.KernelDr6 = 0; + Pcr->Prcb.ProcessorState.SpecialRegisters.KernelDr7 = 0; + + /* Setup the IDT */ + KeInitExceptions(); + + /* Load Ring 3 selectors for DS/ES/FS */ + Ke386SetDs(KGDT_64_DATA | RPL_MASK); + Ke386SetEs(KGDT_64_DATA | RPL_MASK); +// Ke386SetFs(KGDT_32_R3_TEB | RPL_MASK); + + /* LDT is unused */ + Ke386SetLocalDescriptorTable(0); + + /* Save NMI and double fault traps */ +// RtlCopyMemory(&NmiEntry, &Idt[2], sizeof(KIDTENTRY)); +// RtlCopyMemory(&DoubleFaultEntry, &Idt[8], sizeof(KIDTENTRY)); + + /* Copy kernel's trap handlers */ +// RtlCopyMemory(Idt, +// (PVOID)KiIdtDescriptor.Base, +// KiIdtDescriptor.Limit + 1); + + /* Restore NMI and double fault */ +// RtlCopyMemory(&Idt[2], &NmiEntry, sizeof(KIDTENTRY)); +// RtlCopyMemory(&Idt[8], &DoubleFaultEntry, sizeof(KIDTENTRY)); + } + + /* Loop until we can release the freeze lock */ do { @@ -749,26 +749,24 @@ } while(InterlockedBitTestAndSet((PLONG)&KiFreezeExecutionLock, 0)); /* Setup CPU-related fields */ - __writefsdword(KPCR_NUMBER, Cpu); - __writefsdword(KPCR_SET_MEMBER, 1 << Cpu); - __writefsdword(KPCR_SET_MEMBER_COPY, 1 << Cpu); - __writefsdword(KPCR_PRCB_SET_MEMBER, 1 << Cpu); + Pcr->Prcb.Number = Cpu; + Pcr->Prcb.SetMember = 1 << Cpu; /* Initialize the Processor with HAL */ - HalInitializeProcessor(Cpu, KeLoaderBlock); +// HalInitializeProcessor(Cpu, KeLoaderBlock); /* Set active processors */ - KeActiveProcessors |= __readfsdword(KPCR_SET_MEMBER); + KeActiveProcessors |= 1 << Cpu; KeNumberProcessors++; /* Check if this is the boot CPU */ - if (!Cpu) + if (Cpu == 0) { /* Initialize debugging system */ - KdInitSystem(0, KeLoaderBlock); +// KdInitSystem(0, KeLoaderBlock); /* Check for break-in */ - if (KdPollBreakIn()) DbgBreakPointWithStatus(1); +// if (KdPollBreakIn()) DbgBreakPointWithStatus(1); } /* Raise to HIGH_LEVEL */ @@ -776,13 +774,15 @@ /* Align stack and make space for the trap frame and NPX frame */ InitialStack &= ~(KTRAP_FRAME_ALIGN - 1); + +FrLdrDbgPrint("Before KiSetupStackAndInitializeKernel\n"); +for(;;); /* Switch to new kernel stack and start kernel bootstrapping */ KiSetupStackAndInitializeKernel(&KiInitialProcess.Pcb, InitialThread, (PVOID)InitialStack, - (PKPRCB)__readfsdword(KPCR_PRCB), + &Pcr->Prcb, (CCHAR)Cpu, KeLoaderBlock); -#endif } Added: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S (added) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] Wed Aug 20 18:54:52 2008 @@ -1,0 +1,131 @@ +/* + * FILE: ntoskrnl/ke/amd64/trap.S + * COPYRIGHT: See COPYING in the top level directory + * PURPOSE: System Traps, Entrypoints and Exitpoints + * PROGRAMMER: Timo Kreuzer (timo.kreuzer(a)reactos.org) + * NOTE: See asmmacro.S for the shared entry/exit code. + */ + +/* INCLUDES ******************************************************************/ + +//#include <asm.h> +//#include <internal/amd64/asmmacro.S> +.intel_syntax noprefix +.code64 + +/* GLOBALS *******************************************************************/ + +.data + +_MsgGeneralProtFault: +.ascii "General protection fault at %p!\n\0" + +_MsgBreakpointTrap: +.ascii "BreakpointTrap at %p\n\0" + +_MsgUnexpectedInterrupt: +.ascii "UnexpectedInterrupt\n\0" + + +/* SOFTWARE INTERRUPT SERVICES ***********************************************/ +.text +.code64 + +.global _KiDivideErrorFault +_KiDivideErrorFault: + +.global _KiDebugTrapOrFault +_KiDebugTrapOrFault: + +.global _KiNmiInterrupt +_KiNmiInterrupt: + +.global _KiBreakpointTrap +_KiBreakpointTrap: +// mov rdx, [rsp] + sub rsp, 0x10 +// movabs rcx, offset _MsgBreakpointTrap +// movabs rax, offset _FrLdrDbgPrint +// call [rax] + add rsp, 0x10 + iret + +.global _KiOverflowTrap +_KiOverflowTrap: + +.global _KiBoundFault +_KiBoundFault: + +.global _KiInvalidOpcodeFault +_KiInvalidOpcodeFault: + +.global _KiNpxNotAvailableFault +_KiNpxNotAvailableFault: + +.global _KiDoubleFaultAbort +_KiDoubleFaultAbort: + +.global _KiNpxSegmentOverrunAbort +_KiNpxSegmentOverrunAbort: + +.global _KiInvalidTssFault +_KiInvalidTssFault: + +.global _KiSegmentNotPresentFault +_KiSegmentNotPresentFault: + +.global _KiStackFault +_KiStackFault: + +jmp $ + + +.global _KiGeneralProtectionFault +_KiGeneralProtectionFault: + mov rdx, 0 + mov dx, ss + movabs rcx, offset _MsgGeneralProtFault + movabs rax, offset _FrLdrDbgPrint + call [rax] + jmp $ + + +.global _KiPageFault +_KiPageFault: + +.global _KiFloatingErrorFault +_KiFloatingErrorFault: + +.global _KiAlignmentFault +_KiAlignmentFault: + +.global _KiMcheckAbort +_KiMcheckAbort: + +.global _KiXmmException +_KiXmmException: + +.global _KiApcInterrupt +_KiApcInterrupt: + + +.global _KiRaiseAssertion +_KiRaiseAssertion: + +.global _KiDebugServiceTrap +_KiDebugServiceTrap: + +.global _KiDpcInterrupt +_KiDpcInterrupt: + + +.global _KiIpiInterrupt +_KiIpiInterrupt: + iret + +.global _KiUnexpectedInterrupt +_KiUnexpectedInterrupt: + movabs rcx, offset _MsgUnexpectedInterrupt + movabs rax, offset _FrLdrDbgPrint + call [rax] + jmp $ Propchange: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild [iso-8859-1] Wed Aug 20 18:54:52 2008 @@ -91,7 +91,11 @@ <if property="ARCH" value="amd64"> <directory name="amd64"> <file first="true">boot.S</file> + <file>cpu.c</file> + <file>except.c</file> + <file>irql.c</file> <file>kiinit.c</file> + <file>trap.S</file> </directory> </if> <file>apc.c</file> Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl_amd64.def URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl_amd64.def [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ntoskrnl_amd64.def [iso-8859-1] Wed Aug 20 18:54:52 2008 @@ -6,7 +6,6 @@ ; KfAcquireSpinLock KfReleaseSpinLock -KeRaiseIrql KefAcquireSpinLockAtDpcLevel KefReleaseSpinLockFromDpcLevel KeInitializeSpinLock
16 years, 2 months
1
0
0
0
[tkreuzer] 35495: Also initialize data segment descriptor in the gdt.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Aug 20 18:48:28 2008 New Revision: 35495 URL:
http://svn.reactos.org/svn/reactos?rev=35495&view=rev
Log: Also initialize data segment descriptor in the gdt. Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c [iso-8859-1] Wed Aug 20 18:48:28 2008 @@ -256,6 +256,10 @@ Entry = KiGetGdtEntry(pGdt, KGDT_64_R0_CODE); *(PULONG64)Entry = 0x0020980000000000ULL; + /* Setup KGDT_64_DATA */ + Entry = KiGetGdtEntry(pGdt, KGDT_64_DATA); + *(PULONG64)Entry = 0x0000F00000000000ULL; + /* Setup TSS entry */ Entry = KiGetGdtEntry(pGdt, KGDT_TSS); KiInitGdtEntry(Entry, TssBase, I386_TSS, 0);
16 years, 2 months
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
...
86
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Results per page:
10
25
50
100
200