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
December
November
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
May 2015
----- 2024 -----
December 2024
November 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
15 participants
500 discussions
Start a n
N
ew thread
[pschweitzer] 67744: [FASTFAT] Hey Arch, if you simplify, do it completely! Addendum to r67743: don't double free the context
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Fri May 15 16:33:20 2015 New Revision: 67744 URL:
http://svn.reactos.org/svn/reactos?rev=67744&view=rev
Log: [FASTFAT] Hey Arch, if you simplify, do it completely! Addendum to r67743: don't double free the context Modified: trunk/reactos/drivers/filesystems/fastfat/misc.c Modified: trunk/reactos/drivers/filesystems/fastfat/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/misc.c [iso-8859-1] Fri May 15 16:33:20 2015 @@ -85,8 +85,6 @@ Status = FsRtlProcessFileLock(&Fcb->FileLock, IrpContext->Irp, NULL); - - VfatFreeIrpContext(IrpContext); return Status; }
9 years, 7 months
1
0
0
0
[pschweitzer] 67743: [FASTFAT] Bring in initiated work on IRPs in NTFS (and complete it). This simplifies the way IRPs and their context are handled in the driver. Only VfatDispatchRequest() is res...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Fri May 15 16:03:29 2015 New Revision: 67743 URL:
http://svn.reactos.org/svn/reactos?rev=67743&view=rev
Log: [FASTFAT] Bring in initiated work on IRPs in NTFS (and complete it). This simplifies the way IRPs and their context are handled in the driver. Only VfatDispatchRequest() is responsible of completing IRPs (if required), freeing the IRP context (if required), and queueing the IRP for later completion (if required). This allows removing duplicated code, hacks, and so on. It might help reducing IRP leaks, or memory leaks. By default, VfatDispatchRequest() will complete the IRP and delete the IRP context. In case you don't want it to complete the IRP (because you passed it down, for instance), remove the IRPCONTEXT_COMPLETE flag. See for instance: VfatDeviceControl(). In case you want to queue the IRP (you previously called: VfatQueueRequest()), call the newly introduced VfatMarkIrpContextForQueue() function that will prepare it. Modified: trunk/reactos/drivers/filesystems/fastfat/cleanup.c trunk/reactos/drivers/filesystems/fastfat/close.c trunk/reactos/drivers/filesystems/fastfat/create.c trunk/reactos/drivers/filesystems/fastfat/dir.c trunk/reactos/drivers/filesystems/fastfat/finfo.c trunk/reactos/drivers/filesystems/fastfat/flush.c trunk/reactos/drivers/filesystems/fastfat/fsctl.c trunk/reactos/drivers/filesystems/fastfat/misc.c trunk/reactos/drivers/filesystems/fastfat/pnp.c trunk/reactos/drivers/filesystems/fastfat/rw.c trunk/reactos/drivers/filesystems/fastfat/vfat.h trunk/reactos/drivers/filesystems/fastfat/volume.c Modified: trunk/reactos/drivers/filesystems/fastfat/cleanup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/cleanup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/cleanup.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -152,14 +152,14 @@ if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject) { - Status = STATUS_SUCCESS; - goto ByeBye; + IrpContext->Irp->IoStatus.Information = 0; + return STATUS_SUCCESS; } if (!ExAcquireResourceExclusiveLite(&IrpContext->DeviceExt->DirResource, (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) { - return VfatQueueRequest(IrpContext); + return VfatMarkIrpContextForQueue(IrpContext); } Status = VfatCleanupFile(IrpContext); @@ -168,15 +168,10 @@ if (Status == STATUS_PENDING) { - return VfatQueueRequest(IrpContext); + return VfatMarkIrpContextForQueue(IrpContext); } -ByeBye: - IrpContext->Irp->IoStatus.Status = Status; IrpContext->Irp->IoStatus.Information = 0; - - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); return Status; } Modified: trunk/reactos/drivers/filesystems/fastfat/close.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/close.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/close.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -83,8 +83,8 @@ if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject) { DPRINT("Closing file system\n"); - Status = STATUS_SUCCESS; - goto ByeBye; + IrpContext->Irp->IoStatus.Information = 0; + return STATUS_SUCCESS; } #if 0 /* There occurs a dead look at the call to CcRosDeleteFileCache/ObDereferenceObject/VfatClose @@ -94,17 +94,13 @@ if (!ExAcquireResourceExclusiveLite(&IrpContext->DeviceExt->DirResource, TRUE)) #endif { - return VfatQueueRequest(IrpContext); + return VfatMarkIrpContextForQueue(IrpContext); } Status = VfatCloseFile(IrpContext->DeviceExt, IrpContext->FileObject); ExReleaseResourceLite(&IrpContext->DeviceExt->DirResource); -ByeBye: - IrpContext->Irp->IoStatus.Status = Status; IrpContext->Irp->IoStatus.Information = 0; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); return Status; } Modified: trunk/reactos/drivers/filesystems/fastfat/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -941,15 +941,14 @@ /* DeviceObject represents FileSystem instead of logical volume */ DPRINT ("FsdCreate called with file system\n"); IrpContext->Irp->IoStatus.Information = FILE_OPENED; - IrpContext->Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(IrpContext->Irp, IO_DISK_INCREMENT); - VfatFreeIrpContext(IrpContext); + IrpContext->PriorityBoost = IO_DISK_INCREMENT; + return STATUS_SUCCESS; } if (!(IrpContext->Flags & IRPCONTEXT_CANWAIT)) { - return(VfatQueueRequest(IrpContext)); + return VfatMarkIrpContextForQueue(IrpContext); } IrpContext->Irp->IoStatus.Information = 0; @@ -957,10 +956,9 @@ Status = VfatCreateFile(IrpContext->DeviceObject, IrpContext->Irp); ExReleaseResourceLite(&IrpContext->DeviceExt->DirResource); - IrpContext->Irp->IoStatus.Status = Status; - IoCompleteRequest(IrpContext->Irp, - (CCHAR)(NT_SUCCESS(Status) ? IO_DISK_INCREMENT : IO_NO_INCREMENT)); - VfatFreeIrpContext(IrpContext); + if (NT_SUCCESS(Status)) + IrpContext->PriorityBoost = IO_DISK_INCREMENT; + return Status; } Modified: trunk/reactos/drivers/filesystems/fastfat/dir.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/dir.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/dir.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -508,7 +508,7 @@ (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) { ExReleaseResourceLite(&pFcb->MainResource); - return VfatQueueRequest(IrpContext); + return VfatMarkIrpContextForQueue(IrpContext); } while ((Status == STATUS_SUCCESS) && (BufferLength > 0)) @@ -592,29 +592,28 @@ return Status; } -NTSTATUS VfatNotifyChangeDirectory(PVFAT_IRP_CONTEXT * IrpContext) +NTSTATUS VfatNotifyChangeDirectory(PVFAT_IRP_CONTEXT IrpContext) { PVCB pVcb; PVFATFCB pFcb; PIO_STACK_LOCATION Stack; - Stack = (*IrpContext)->Stack; - pVcb = (*IrpContext)->DeviceExt; - pFcb = (PVFATFCB) (*IrpContext)->FileObject->FsContext; + Stack = IrpContext->Stack; + pVcb = IrpContext->DeviceExt; + pFcb = (PVFATFCB) IrpContext->FileObject->FsContext; FsRtlNotifyFullChangeDirectory(pVcb->NotifySync, &(pVcb->NotifyList), - (*IrpContext)->FileObject->FsContext2, + IrpContext->FileObject->FsContext2, (PSTRING)&(pFcb->PathNameU), BooleanFlagOn(Stack->Flags, SL_WATCH_TREE), FALSE, Stack->Parameters.NotifyDirectory.CompletionFilter, - (*IrpContext)->Irp, + IrpContext->Irp, NULL, NULL); - /* We don't need the IRP context as we won't handle IRP completion */ - VfatFreeIrpContext(*IrpContext); - *IrpContext = NULL; + /* We won't handle IRP completion */ + IrpContext->Flags &= ~IRPCONTEXT_COMPLETE; return STATUS_PENDING; } @@ -637,7 +636,7 @@ break; case IRP_MN_NOTIFY_CHANGE_DIRECTORY: - Status = VfatNotifyChangeDirectory(&IrpContext); + Status = VfatNotifyChangeDirectory(IrpContext); break; default: @@ -648,19 +647,9 @@ break; } - if (Status == STATUS_PENDING) - { - /* Only queue if there's IRP context */ - if (IrpContext) - { - Status = VfatQueueRequest(IrpContext); - } - } - else - { - IrpContext->Irp->IoStatus.Status = Status; - IoCompleteRequest (IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); + if (Status == STATUS_PENDING && IrpContext->Flags & IRPCONTEXT_COMPLETE) + { + return VfatMarkIrpContextForQueue(IrpContext); } return Status; Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -1381,7 +1381,7 @@ if (!ExAcquireResourceSharedLite(&FCB->MainResource, (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) { - return VfatQueueRequest(IrpContext); + return VfatMarkIrpContextForQueue(IrpContext); } } @@ -1459,14 +1459,11 @@ ExReleaseResourceLite(&FCB->MainResource); } - IrpContext->Irp->IoStatus.Status = Status; if (NT_SUCCESS(Status) || Status == STATUS_BUFFER_OVERFLOW) IrpContext->Irp->IoStatus.Information = IrpContext->Stack->Parameters.QueryFile.Length - BufferLength; else IrpContext->Irp->IoStatus.Information = 0; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); return Status; } @@ -1510,10 +1507,7 @@ (PLARGE_INTEGER)SystemBuffer)) { DPRINT("Couldn't set file size!\n"); - IrpContext->Irp->IoStatus.Status = STATUS_USER_MAPPED_FILE; IrpContext->Irp->IoStatus.Information = 0; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); return STATUS_USER_MAPPED_FILE; } DPRINT("Can set file size\n"); @@ -1524,7 +1518,7 @@ if (!ExAcquireResourceExclusiveLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource, (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) { - return VfatQueueRequest(IrpContext); + return VfatMarkIrpContextForQueue(IrpContext); } } @@ -1537,7 +1531,8 @@ { ExReleaseResourceLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource); } - return VfatQueueRequest(IrpContext); + + return VfatMarkIrpContextForQueue(IrpContext); } } @@ -1592,11 +1587,7 @@ ExReleaseResourceLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource); } - IrpContext->Irp->IoStatus.Status = Status; IrpContext->Irp->IoStatus.Information = 0; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); - return Status; } Modified: trunk/reactos/drivers/filesystems/fastfat/flush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/flush.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/flush.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -150,8 +150,8 @@ /* This request is not allowed on the main device object. */ if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject) { - Status = STATUS_INVALID_DEVICE_REQUEST; - goto ByeBye; + IrpContext->Irp->IoStatus.Information = 0; + return STATUS_INVALID_DEVICE_REQUEST; } Fcb = (PVFATFCB)IrpContext->FileObject->FsContext; @@ -170,12 +170,7 @@ ExReleaseResourceLite (&Fcb->MainResource); } -ByeBye: - IrpContext->Irp->IoStatus.Status = Status; IrpContext->Irp->IoStatus.Information = 0; - IoCompleteRequest (IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); - return Status; } Modified: trunk/reactos/drivers/filesystems/fastfat/fsctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -1066,9 +1066,5 @@ break; } - IrpContext->Irp->IoStatus.Status = Status; - - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); return Status; } Modified: trunk/reactos/drivers/filesystems/fastfat/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/misc.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -51,6 +51,10 @@ static LONG QueueCount = 0; +static VOID VfatFreeIrpContext(PVFAT_IRP_CONTEXT); +static PVFAT_IRP_CONTEXT VfatAllocateIrpContext(PDEVICE_OBJECT, PIRP); +static NTSTATUS VfatQueueRequest(PVFAT_IRP_CONTEXT); + /* FUNCTIONS ****************************************************************/ static @@ -69,28 +73,21 @@ if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject) { - Status = STATUS_INVALID_DEVICE_REQUEST; - goto Fail; + return STATUS_INVALID_DEVICE_REQUEST; } if (*Fcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) { - Status = STATUS_INVALID_PARAMETER; - goto Fail; - } - + return STATUS_INVALID_PARAMETER; + } + + IrpContext->Flags &= ~IRPCONTEXT_COMPLETE; Status = FsRtlProcessFileLock(&Fcb->FileLock, IrpContext->Irp, NULL); VfatFreeIrpContext(IrpContext); return Status; - -Fail: - IrpContext->Irp->IoStatus.Status = Status; - IoCompleteRequest(IrpContext->Irp, (CCHAR)(NT_SUCCESS(Status) ? IO_DISK_INCREMENT : IO_NO_INCREMENT)); - VfatFreeIrpContext(IrpContext); - return Status; } static @@ -100,6 +97,8 @@ { IoSkipCurrentIrpStackLocation(IrpContext->Irp); + IrpContext->Flags &= ~IRPCONTEXT_COMPLETE; + return IoCallDriver(IrpContext->DeviceExt->StorageDevice, IrpContext->Irp); } @@ -108,6 +107,8 @@ VfatDispatchRequest( IN PVFAT_IRP_CONTEXT IrpContext) { + NTSTATUS Status; + DPRINT("VfatDispatchRequest (IrpContext %p), is called for %s\n", IrpContext, IrpContext->MajorFunction >= IRP_MJ_MAXIMUM_FUNCTION ? "????" : MajorFunctionNames[IrpContext->MajorFunction]); @@ -116,42 +117,94 @@ switch (IrpContext->MajorFunction) { case IRP_MJ_CLOSE: - return VfatClose(IrpContext); + Status = VfatClose(IrpContext); + break; + case IRP_MJ_CREATE: - return VfatCreate(IrpContext); + Status = VfatCreate(IrpContext); + break; + case IRP_MJ_READ: - return VfatRead (IrpContext); + Status = VfatRead(IrpContext); + break; + case IRP_MJ_WRITE: - return VfatWrite (IrpContext); + Status = VfatWrite (IrpContext); + break; + case IRP_MJ_FILE_SYSTEM_CONTROL: - return VfatFileSystemControl(IrpContext); + Status = VfatFileSystemControl(IrpContext); + break; + case IRP_MJ_QUERY_INFORMATION: - return VfatQueryInformation (IrpContext); + Status = VfatQueryInformation (IrpContext); + break; + case IRP_MJ_SET_INFORMATION: - return VfatSetInformation (IrpContext); + Status = VfatSetInformation (IrpContext); + break; + case IRP_MJ_DIRECTORY_CONTROL: - return VfatDirectoryControl(IrpContext); + Status = VfatDirectoryControl(IrpContext); + break; + case IRP_MJ_QUERY_VOLUME_INFORMATION: - return VfatQueryVolumeInformation(IrpContext); + Status = VfatQueryVolumeInformation(IrpContext); + break; + case IRP_MJ_SET_VOLUME_INFORMATION: - return VfatSetVolumeInformation(IrpContext); + Status = VfatSetVolumeInformation(IrpContext); + break; + case IRP_MJ_LOCK_CONTROL: - return VfatLockControl(IrpContext); + Status = VfatLockControl(IrpContext); + break; + case IRP_MJ_DEVICE_CONTROL: - return VfatDeviceControl(IrpContext); + Status = VfatDeviceControl(IrpContext); + break; + case IRP_MJ_CLEANUP: - return VfatCleanup(IrpContext); + Status = VfatCleanup(IrpContext); + break; + case IRP_MJ_FLUSH_BUFFERS: - return VfatFlush(IrpContext); + Status = VfatFlush(IrpContext); + break; + case IRP_MJ_PNP: - return VfatPnp(IrpContext); + Status = VfatPnp(IrpContext); + break; + default: DPRINT1("Unexpected major function %x\n", IrpContext->MajorFunction); - IrpContext->Irp->IoStatus.Status = STATUS_DRIVER_INTERNAL_ERROR; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); - return STATUS_DRIVER_INTERNAL_ERROR; - } + Status = STATUS_DRIVER_INTERNAL_ERROR; + } + + ASSERT((!(IrpContext->Flags & IRPCONTEXT_COMPLETE) && !(IrpContext->Flags & IRPCONTEXT_QUEUE)) || + ((IrpContext->Flags & IRPCONTEXT_COMPLETE) && !(IrpContext->Flags & IRPCONTEXT_QUEUE)) || + (!(IrpContext->Flags & IRPCONTEXT_COMPLETE) && (IrpContext->Flags & IRPCONTEXT_QUEUE))); + + if (IrpContext->Flags & IRPCONTEXT_COMPLETE) + { + IrpContext->Irp->IoStatus.Status = Status; + IoCompleteRequest(IrpContext->Irp, IrpContext->PriorityBoost); + } + + if (IrpContext->Flags & IRPCONTEXT_QUEUE) + { + /* Reset our status flags before queueing the IRP */ + IrpContext->Flags |= IRPCONTEXT_COMPLETE; + IrpContext->Flags &= ~IRPCONTEXT_QUEUE; + Status = VfatQueueRequest(IrpContext); + } + else + { + /* Unless the IRP was queued, always free the IRP context */ + VfatFreeIrpContext(IrpContext); + } + + return Status; } NTSTATUS @@ -184,6 +237,7 @@ return Status; } +static VOID VfatFreeIrpContext( PVFAT_IRP_CONTEXT IrpContext) @@ -192,6 +246,7 @@ ExFreeToNPagedLookasideList(&VfatGlobalData->IrpContextLookasideList, IrpContext); } +static PVFAT_IRP_CONTEXT VfatAllocateIrpContext( PDEVICE_OBJECT DeviceObject, @@ -218,7 +273,7 @@ MajorFunction = IrpContext->MajorFunction = IrpContext->Stack->MajorFunction; IrpContext->MinorFunction = IrpContext->Stack->MinorFunction; IrpContext->FileObject = IrpContext->Stack->FileObject; - IrpContext->Flags = 0; + IrpContext->Flags = IRPCONTEXT_COMPLETE; if (MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL || MajorFunction == IRP_MJ_DEVICE_CONTROL || MajorFunction == IRP_MJ_SHUTDOWN) @@ -233,6 +288,7 @@ } KeInitializeEvent(&IrpContext->Event, NotificationEvent, FALSE); IrpContext->RefCount = 0; + IrpContext->PriorityBoost = IO_NO_INCREMENT; } return IrpContext; } @@ -253,6 +309,7 @@ FsRtlExitFileSystem(); } +static NTSTATUS VfatQueueRequest( PVFAT_IRP_CONTEXT IrpContext) Modified: trunk/reactos/drivers/filesystems/fastfat/pnp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/pnp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/pnp.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -33,17 +33,14 @@ case IRP_MN_REMOVE_DEVICE: case IRP_MN_CANCEL_REMOVE_DEVICE: Status = STATUS_NOT_IMPLEMENTED; - IrpContext->Irp->IoStatus.Status = Status; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); break; default: IoSkipCurrentIrpStackLocation(IrpContext->Irp); Vcb = (PVCB)IrpContext->Stack->DeviceObject->DeviceExtension; + IrpContext->Flags &= ~IRPCONTEXT_COMPLETE; Status = IoCallDriver(Vcb->StorageDevice, IrpContext->Irp); } - VfatFreeIrpContext(IrpContext); - return Status; } Modified: trunk/reactos/drivers/filesystems/fastfat/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/rw.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -572,9 +572,9 @@ PFATINFO FatInfo = &IrpContext->DeviceExt->FatInfo; IrpContext->Stack->Parameters.Read.ByteOffset.QuadPart += FatInfo->dataStart * FatInfo->BytesPerSector; IoSkipCurrentIrpStackLocation(IrpContext->Irp); + IrpContext->Flags &= ~IRPCONTEXT_COMPLETE; DPRINT("Read from page file, disk offset %I64x\n", IrpContext->Stack->Parameters.Read.ByteOffset.QuadPart); Status = IoCallDriver(IrpContext->DeviceExt->StorageDevice, IrpContext->Irp); - VfatFreeIrpContext(IrpContext); return Status; } @@ -740,13 +740,7 @@ Status = VfatLockUserBuffer(IrpContext->Irp, Length, IoWriteAccess); if (NT_SUCCESS(Status)) { - Status = VfatQueueRequest(IrpContext); - } - else - { - IrpContext->Irp->IoStatus.Status = Status; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); + Status = VfatMarkIrpContextForQueue(IrpContext); } } else @@ -760,9 +754,8 @@ ByteOffset.QuadPart + IrpContext->Irp->IoStatus.Information; } - IoCompleteRequest(IrpContext->Irp, - (CCHAR)(NT_SUCCESS(Status) ? IO_DISK_INCREMENT : IO_NO_INCREMENT)); - VfatFreeIrpContext(IrpContext); + if (NT_SUCCESS(Status)) + IrpContext->PriorityBoost = IO_DISK_INCREMENT; } DPRINT("%x\n", Status); return Status; @@ -805,9 +798,9 @@ PFATINFO FatInfo = &IrpContext->DeviceExt->FatInfo; IrpContext->Stack->Parameters.Write.ByteOffset.QuadPart += FatInfo->dataStart * FatInfo->BytesPerSector; IoSkipCurrentIrpStackLocation(IrpContext->Irp); + IrpContext->Flags &= ~IRPCONTEXT_COMPLETE; DPRINT("Write to page file, disk offset %I64x\n", IrpContext->Stack->Parameters.Write.ByteOffset.QuadPart); Status = IoCallDriver(IrpContext->DeviceExt->StorageDevice, IrpContext->Irp); - VfatFreeIrpContext(IrpContext); return Status; } @@ -1074,13 +1067,7 @@ Status = VfatLockUserBuffer(IrpContext->Irp, Length, IoReadAccess); if (NT_SUCCESS(Status)) { - Status = VfatQueueRequest(IrpContext); - } - else - { - IrpContext->Irp->IoStatus.Status = Status; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); + Status = VfatMarkIrpContextForQueue(IrpContext); } } else @@ -1093,9 +1080,8 @@ ByteOffset.QuadPart + IrpContext->Irp->IoStatus.Information; } - IoCompleteRequest(IrpContext->Irp, - (CCHAR)(NT_SUCCESS(Status) ? IO_DISK_INCREMENT : IO_NO_INCREMENT)); - VfatFreeIrpContext(IrpContext); + if (NT_SUCCESS(Status)) + IrpContext->PriorityBoost = IO_DISK_INCREMENT; } DPRINT("%x\n", Status); return Status; Modified: trunk/reactos/drivers/filesystems/fastfat/vfat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] Fri May 15 16:03:29 2015 @@ -446,8 +446,10 @@ } DOSDATE, *PDOSDATE; -#define IRPCONTEXT_CANWAIT 0x0001 -#define IRPCONTEXT_PENDINGRETURNED 0x0002 +#define IRPCONTEXT_CANWAIT 0x0001 +#define IRPCONTEXT_COMPLETE 0x0002 +#define IRPCONTEXT_QUEUE 0x0004 +#define IRPCONTEXT_PENDINGRETURNED 0x0008 typedef struct { @@ -462,6 +464,7 @@ PFILE_OBJECT FileObject; ULONG RefCount; KEVENT Event; + CCHAR PriorityBoost; } VFAT_IRP_CONTEXT, *PVFAT_IRP_CONTEXT; typedef struct _VFAT_DIRENTRY_CONTEXT @@ -480,6 +483,18 @@ USHORT CreationDate; USHORT CreationTime; } VFAT_MOVE_CONTEXT, *PVFAT_MOVE_CONTEXT; + +FORCEINLINE +NTSTATUS +VfatMarkIrpContextForQueue(PVFAT_IRP_CONTEXT IrpContext) +{ + PULONG Flags = &IrpContext->Flags; + + *Flags &= ~IRPCONTEXT_COMPLETE; + *Flags |= IRPCONTEXT_QUEUE; + + return STATUS_PENDING; +} /* blockdev.c */ @@ -902,19 +917,6 @@ /* misc.c */ -NTSTATUS -VfatQueueRequest( - PVFAT_IRP_CONTEXT IrpContext); - -PVFAT_IRP_CONTEXT -VfatAllocateIrpContext( - PDEVICE_OBJECT DeviceObject, - PIRP Irp); - -VOID -VfatFreeIrpContext( - PVFAT_IRP_CONTEXT IrpContext); - DRIVER_DISPATCH VfatBuildRequest; Modified: trunk/reactos/drivers/filesystems/fastfat/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/volume.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/volume.c [iso-8859-1] Fri May 15 16:03:29 2015 @@ -363,7 +363,8 @@ if (!ExAcquireResourceSharedLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource, (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) { - return VfatQueueRequest(IrpContext); + DPRINT1("DirResource failed!\n"); + return VfatMarkIrpContextForQueue(IrpContext); } /* INITIALIZATION */ @@ -405,14 +406,12 @@ } ExReleaseResourceLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource); - IrpContext->Irp->IoStatus.Status = RC; + if (NT_SUCCESS(RC)) IrpContext->Irp->IoStatus.Information = IrpContext->Stack->Parameters.QueryVolume.Length - BufferLength; else IrpContext->Irp->IoStatus.Information = 0; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); return RC; } @@ -439,7 +438,7 @@ if (!ExAcquireResourceExclusiveLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource, (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) { - return VfatQueueRequest(IrpContext); + return VfatMarkIrpContextForQueue(IrpContext); } FsInformationClass = Stack->Parameters.SetVolume.FsInformationClass; @@ -462,10 +461,7 @@ } ExReleaseResourceLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource); - IrpContext->Irp->IoStatus.Status = Status; IrpContext->Irp->IoStatus.Information = 0; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); return Status; }
9 years, 7 months
1
0
0
0
[aandrejevic] 67742: [NTVDM] - Properly initialize the current directories on startup. - Add a missing colon after the drive letter.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Fri May 15 00:39:34 2015 New Revision: 67742 URL:
http://svn.reactos.org/svn/reactos?rev=67742&view=rev
Log: [NTVDM] - Properly initialize the current directories on startup. - Add a missing colon after the drive letter. Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Fri May 15 00:39:34 2015 @@ -62,7 +62,7 @@ /* Find the path to the new current directory */ snprintf(DirectoryPath, DOS_CMDLINE_LENGTH, - "%c\\%s", + "%c:\\%s", Drive + 'A', &CurrentDirectories[Drive * DOS_DIR_LENGTH]); @@ -1974,7 +1974,7 @@ DOS_DATA_OFFSET(CurrentDirectories)); /* Clear the current directory buffer */ - RtlZeroMemory(CurrentDirectories, sizeof(CurrentDirectories)); + RtlZeroMemory(CurrentDirectories, NUM_DRIVES * DOS_DIR_LENGTH * sizeof(CHAR)); /* Get the current directory */ if (!GetCurrentDirectoryA(sizeof(CurrentDirectory), CurrentDirectory))
9 years, 7 months
1
0
0
0
[aandrejevic] 67741: [NTVDM] - Make the Sda pointer point to the right place. - Fix a buffer overflow.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Fri May 15 00:20:54 2015 New Revision: 67741 URL:
http://svn.reactos.org/svn/reactos?rev=67741&view=rev
Log: [NTVDM] - Make the Sda pointer point to the right place. - Fix a buffer overflow. Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Fri May 15 00:20:54 2015 @@ -52,16 +52,22 @@ static BOOLEAN DosChangeDrive(BYTE Drive) { - WCHAR DirectoryPath[DOS_CMDLINE_LENGTH]; + CHAR DirectoryPath[DOS_CMDLINE_LENGTH + 1]; /* Make sure the drive exists */ if (Drive > (LastDrive - 'A')) return FALSE; + RtlZeroMemory(DirectoryPath, sizeof(DirectoryPath)); + /* Find the path to the new current directory */ - swprintf(DirectoryPath, L"%c\\%S", Drive + 'A', &CurrentDirectories[Drive * DOS_DIR_LENGTH]); + snprintf(DirectoryPath, + DOS_CMDLINE_LENGTH, + "%c\\%s", + Drive + 'A', + &CurrentDirectories[Drive * DOS_DIR_LENGTH]); /* Change the current directory of the process */ - if (!SetCurrentDirectory(DirectoryPath)) return FALSE; + if (!SetCurrentDirectoryA(DirectoryPath)) return FALSE; /* Set the current drive */ CurrentDrive = Drive; @@ -2013,7 +2019,7 @@ } /* Initialize the list of lists */ - SysVars = (PDOS_SYSVARS)SEG_OFF_TO_PTR(DOS_DATA_SEGMENT, 0); + SysVars = (PDOS_SYSVARS)SEG_OFF_TO_PTR(DOS_DATA_SEGMENT, DOS_DATA_OFFSET(SysVars)); RtlZeroMemory(SysVars, sizeof(DOS_SYSVARS)); SysVars->FirstMcb = FIRST_MCB_SEGMENT; SysVars->FirstSft = MAKELONG(DOS_DATA_OFFSET(Sft), DOS_DATA_SEGMENT); @@ -2034,7 +2040,7 @@ sizeof(NullDriverRoutine)); /* Initialize the swappable data area */ - Sda = (PDOS_SDA)SEG_OFF_TO_PTR(DOS_DATA_SEGMENT, sizeof(DOS_SYSVARS)); + Sda = (PDOS_SDA)SEG_OFF_TO_PTR(DOS_DATA_SEGMENT, DOS_DATA_OFFSET(Sda)); RtlZeroMemory(Sda, sizeof(DOS_SDA)); /* Set the current PSP to the system PSP */
9 years, 7 months
1
0
0
0
[tkreuzer] 67740: [MSHTML/OLEAUT32] Make msvc.S compile on ARM, too
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu May 14 22:33:27 2015 New Revision: 67740 URL:
http://svn.reactos.org/svn/reactos?rev=67740&view=rev
Log: [MSHTML/OLEAUT32] Make msvc.S compile on ARM, too Modified: trunk/reactos/dll/win32/mshtml/msvc.S trunk/reactos/dll/win32/oleaut32/msvc.S Modified: trunk/reactos/dll/win32/mshtml/msvc.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/msvc.S?re…
============================================================================== --- trunk/reactos/dll/win32/mshtml/msvc.S [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mshtml/msvc.S [iso-8859-1] Thu May 14 22:33:27 2015 @@ -1,3 +1,18 @@ + +#ifdef _M_ARM + +#include <kxarm.h> + + MACRO + DEFINE_WRAPPER_FUNC $n, $off, $x + LCLS _FuncName +_FuncName SETS "_wrapper_func_":CC:"$n" + NESTED_ENTRY $_FuncName + __assertfail + NESTED_END $_FuncName + MEND + +#else #include <asm.inc> @@ -23,102 +38,104 @@ #endif ENDM -DEFINE_WRAPPER_FUNC 3, 12, 24 -DEFINE_WRAPPER_FUNC 4, 16, 32 -DEFINE_WRAPPER_FUNC 5, 20, 40 -DEFINE_WRAPPER_FUNC 6, 24, 48 -DEFINE_WRAPPER_FUNC 7, 28, 56 -DEFINE_WRAPPER_FUNC 8, 32, 64 -DEFINE_WRAPPER_FUNC 9, 36, 72 -DEFINE_WRAPPER_FUNC 10, 40, 80 -DEFINE_WRAPPER_FUNC 11, 44, 88 -DEFINE_WRAPPER_FUNC 12, 48, 96 -DEFINE_WRAPPER_FUNC 13, 52, 104 -DEFINE_WRAPPER_FUNC 14, 56, 112 -DEFINE_WRAPPER_FUNC 15, 60, 120 -DEFINE_WRAPPER_FUNC 16, 64, 128 -DEFINE_WRAPPER_FUNC 17, 68, 136 -DEFINE_WRAPPER_FUNC 18, 72, 144 -DEFINE_WRAPPER_FUNC 19, 76, 152 -DEFINE_WRAPPER_FUNC 20, 80, 160 -DEFINE_WRAPPER_FUNC 21, 84, 168 -DEFINE_WRAPPER_FUNC 22, 88, 176 -DEFINE_WRAPPER_FUNC 23, 92, 184 -DEFINE_WRAPPER_FUNC 24, 96, 192 -DEFINE_WRAPPER_FUNC 25, 100, 200 -DEFINE_WRAPPER_FUNC 26, 104, 208 -DEFINE_WRAPPER_FUNC 27, 108, 216 -DEFINE_WRAPPER_FUNC 28, 112, 224 -DEFINE_WRAPPER_FUNC 29, 116, 232 -DEFINE_WRAPPER_FUNC 30, 120, 240 -DEFINE_WRAPPER_FUNC 31, 124, 248 -DEFINE_WRAPPER_FUNC 32, 128, 256 -DEFINE_WRAPPER_FUNC 33, 132, 264 -DEFINE_WRAPPER_FUNC 34, 136, 272 -DEFINE_WRAPPER_FUNC 35, 140, 280 -DEFINE_WRAPPER_FUNC 36, 144, 288 -DEFINE_WRAPPER_FUNC 37, 148, 296 -DEFINE_WRAPPER_FUNC 38, 152, 304 -DEFINE_WRAPPER_FUNC 39, 156, 312 -DEFINE_WRAPPER_FUNC 40, 160, 320 -DEFINE_WRAPPER_FUNC 41, 164, 328 -DEFINE_WRAPPER_FUNC 42, 168, 336 -DEFINE_WRAPPER_FUNC 43, 172, 344 -DEFINE_WRAPPER_FUNC 44, 176, 352 -DEFINE_WRAPPER_FUNC 45, 180, 360 -DEFINE_WRAPPER_FUNC 46, 184, 368 -DEFINE_WRAPPER_FUNC 47, 188, 376 -DEFINE_WRAPPER_FUNC 48, 192, 384 -DEFINE_WRAPPER_FUNC 49, 196, 392 -DEFINE_WRAPPER_FUNC 50, 200, 400 -DEFINE_WRAPPER_FUNC 51, 204, 408 -DEFINE_WRAPPER_FUNC 52, 208, 416 -DEFINE_WRAPPER_FUNC 53, 212, 424 -DEFINE_WRAPPER_FUNC 54, 216, 432 -DEFINE_WRAPPER_FUNC 55, 220, 440 -DEFINE_WRAPPER_FUNC 56, 224, 448 -DEFINE_WRAPPER_FUNC 57, 228, 456 -DEFINE_WRAPPER_FUNC 58, 232, 464 -DEFINE_WRAPPER_FUNC 59, 236, 472 -DEFINE_WRAPPER_FUNC 60, 240, 480 -DEFINE_WRAPPER_FUNC 61, 244, 488 -DEFINE_WRAPPER_FUNC 62, 248, 496 -DEFINE_WRAPPER_FUNC 63, 252, 504 -DEFINE_WRAPPER_FUNC 64, 256, 512 -DEFINE_WRAPPER_FUNC 65, 260, 520 -DEFINE_WRAPPER_FUNC 66, 264, 528 -DEFINE_WRAPPER_FUNC 67, 268, 536 -DEFINE_WRAPPER_FUNC 68, 272, 544 -DEFINE_WRAPPER_FUNC 69, 276, 552 -DEFINE_WRAPPER_FUNC 70, 280, 560 -DEFINE_WRAPPER_FUNC 71, 284, 568 -DEFINE_WRAPPER_FUNC 72, 288, 576 -DEFINE_WRAPPER_FUNC 73, 292, 584 -DEFINE_WRAPPER_FUNC 74, 296, 592 -DEFINE_WRAPPER_FUNC 75, 300, 600 -DEFINE_WRAPPER_FUNC 76, 304, 608 -DEFINE_WRAPPER_FUNC 77, 308, 616 -DEFINE_WRAPPER_FUNC 78, 312, 624 -DEFINE_WRAPPER_FUNC 79, 316, 632 -DEFINE_WRAPPER_FUNC 80, 320, 640 -DEFINE_WRAPPER_FUNC 81, 324, 648 -DEFINE_WRAPPER_FUNC 82, 328, 656 -DEFINE_WRAPPER_FUNC 83, 332, 664 -DEFINE_WRAPPER_FUNC 84, 336, 672 -DEFINE_WRAPPER_FUNC 85, 340, 680 -DEFINE_WRAPPER_FUNC 86, 344, 688 -DEFINE_WRAPPER_FUNC 87, 348, 696 -DEFINE_WRAPPER_FUNC 88, 352, 704 -DEFINE_WRAPPER_FUNC 89, 356, 712 -DEFINE_WRAPPER_FUNC 90, 360, 720 -DEFINE_WRAPPER_FUNC 91, 364, 728 -DEFINE_WRAPPER_FUNC 92, 368, 736 -DEFINE_WRAPPER_FUNC 93, 372, 744 -DEFINE_WRAPPER_FUNC 94, 376, 752 -DEFINE_WRAPPER_FUNC 95, 380, 760 -DEFINE_WRAPPER_FUNC 96, 384, 768 -DEFINE_WRAPPER_FUNC 97, 388, 776 -DEFINE_WRAPPER_FUNC 98, 392, 784 -DEFINE_WRAPPER_FUNC 99, 396, 792 +#endif -END + DEFINE_WRAPPER_FUNC 3, 12, 24 + DEFINE_WRAPPER_FUNC 4, 16, 32 + DEFINE_WRAPPER_FUNC 5, 20, 40 + DEFINE_WRAPPER_FUNC 6, 24, 48 + DEFINE_WRAPPER_FUNC 7, 28, 56 + DEFINE_WRAPPER_FUNC 8, 32, 64 + DEFINE_WRAPPER_FUNC 9, 36, 72 + DEFINE_WRAPPER_FUNC 10, 40, 80 + DEFINE_WRAPPER_FUNC 11, 44, 88 + DEFINE_WRAPPER_FUNC 12, 48, 96 + DEFINE_WRAPPER_FUNC 13, 52, 104 + DEFINE_WRAPPER_FUNC 14, 56, 112 + DEFINE_WRAPPER_FUNC 15, 60, 120 + DEFINE_WRAPPER_FUNC 16, 64, 128 + DEFINE_WRAPPER_FUNC 17, 68, 136 + DEFINE_WRAPPER_FUNC 18, 72, 144 + DEFINE_WRAPPER_FUNC 19, 76, 152 + DEFINE_WRAPPER_FUNC 20, 80, 160 + DEFINE_WRAPPER_FUNC 21, 84, 168 + DEFINE_WRAPPER_FUNC 22, 88, 176 + DEFINE_WRAPPER_FUNC 23, 92, 184 + DEFINE_WRAPPER_FUNC 24, 96, 192 + DEFINE_WRAPPER_FUNC 25, 100, 200 + DEFINE_WRAPPER_FUNC 26, 104, 208 + DEFINE_WRAPPER_FUNC 27, 108, 216 + DEFINE_WRAPPER_FUNC 28, 112, 224 + DEFINE_WRAPPER_FUNC 29, 116, 232 + DEFINE_WRAPPER_FUNC 30, 120, 240 + DEFINE_WRAPPER_FUNC 31, 124, 248 + DEFINE_WRAPPER_FUNC 32, 128, 256 + DEFINE_WRAPPER_FUNC 33, 132, 264 + DEFINE_WRAPPER_FUNC 34, 136, 272 + DEFINE_WRAPPER_FUNC 35, 140, 280 + DEFINE_WRAPPER_FUNC 36, 144, 288 + DEFINE_WRAPPER_FUNC 37, 148, 296 + DEFINE_WRAPPER_FUNC 38, 152, 304 + DEFINE_WRAPPER_FUNC 39, 156, 312 + DEFINE_WRAPPER_FUNC 40, 160, 320 + DEFINE_WRAPPER_FUNC 41, 164, 328 + DEFINE_WRAPPER_FUNC 42, 168, 336 + DEFINE_WRAPPER_FUNC 43, 172, 344 + DEFINE_WRAPPER_FUNC 44, 176, 352 + DEFINE_WRAPPER_FUNC 45, 180, 360 + DEFINE_WRAPPER_FUNC 46, 184, 368 + DEFINE_WRAPPER_FUNC 47, 188, 376 + DEFINE_WRAPPER_FUNC 48, 192, 384 + DEFINE_WRAPPER_FUNC 49, 196, 392 + DEFINE_WRAPPER_FUNC 50, 200, 400 + DEFINE_WRAPPER_FUNC 51, 204, 408 + DEFINE_WRAPPER_FUNC 52, 208, 416 + DEFINE_WRAPPER_FUNC 53, 212, 424 + DEFINE_WRAPPER_FUNC 54, 216, 432 + DEFINE_WRAPPER_FUNC 55, 220, 440 + DEFINE_WRAPPER_FUNC 56, 224, 448 + DEFINE_WRAPPER_FUNC 57, 228, 456 + DEFINE_WRAPPER_FUNC 58, 232, 464 + DEFINE_WRAPPER_FUNC 59, 236, 472 + DEFINE_WRAPPER_FUNC 60, 240, 480 + DEFINE_WRAPPER_FUNC 61, 244, 488 + DEFINE_WRAPPER_FUNC 62, 248, 496 + DEFINE_WRAPPER_FUNC 63, 252, 504 + DEFINE_WRAPPER_FUNC 64, 256, 512 + DEFINE_WRAPPER_FUNC 65, 260, 520 + DEFINE_WRAPPER_FUNC 66, 264, 528 + DEFINE_WRAPPER_FUNC 67, 268, 536 + DEFINE_WRAPPER_FUNC 68, 272, 544 + DEFINE_WRAPPER_FUNC 69, 276, 552 + DEFINE_WRAPPER_FUNC 70, 280, 560 + DEFINE_WRAPPER_FUNC 71, 284, 568 + DEFINE_WRAPPER_FUNC 72, 288, 576 + DEFINE_WRAPPER_FUNC 73, 292, 584 + DEFINE_WRAPPER_FUNC 74, 296, 592 + DEFINE_WRAPPER_FUNC 75, 300, 600 + DEFINE_WRAPPER_FUNC 76, 304, 608 + DEFINE_WRAPPER_FUNC 77, 308, 616 + DEFINE_WRAPPER_FUNC 78, 312, 624 + DEFINE_WRAPPER_FUNC 79, 316, 632 + DEFINE_WRAPPER_FUNC 80, 320, 640 + DEFINE_WRAPPER_FUNC 81, 324, 648 + DEFINE_WRAPPER_FUNC 82, 328, 656 + DEFINE_WRAPPER_FUNC 83, 332, 664 + DEFINE_WRAPPER_FUNC 84, 336, 672 + DEFINE_WRAPPER_FUNC 85, 340, 680 + DEFINE_WRAPPER_FUNC 86, 344, 688 + DEFINE_WRAPPER_FUNC 87, 348, 696 + DEFINE_WRAPPER_FUNC 88, 352, 704 + DEFINE_WRAPPER_FUNC 89, 356, 712 + DEFINE_WRAPPER_FUNC 90, 360, 720 + DEFINE_WRAPPER_FUNC 91, 364, 728 + DEFINE_WRAPPER_FUNC 92, 368, 736 + DEFINE_WRAPPER_FUNC 93, 372, 744 + DEFINE_WRAPPER_FUNC 94, 376, 752 + DEFINE_WRAPPER_FUNC 95, 380, 760 + DEFINE_WRAPPER_FUNC 96, 384, 768 + DEFINE_WRAPPER_FUNC 97, 388, 776 + DEFINE_WRAPPER_FUNC 98, 392, 784 + DEFINE_WRAPPER_FUNC 99, 396, 792 + + END Modified: trunk/reactos/dll/win32/oleaut32/msvc.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/msvc.S?…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/msvc.S [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/msvc.S [iso-8859-1] Thu May 14 22:33:27 2015 @@ -1,7 +1,15 @@ + +#ifdef _M_ARM + +#include <kxarm.h> + + LEAF_ENTRY call_method + __assertfail + LEAF_END call_method + +#elif defined(_M_AMD64) #include <asm.inc> - -#ifdef _M_AMD64 .code64 PUBLIC call_method @@ -10,6 +18,8 @@ ret #else + +#include <asm.inc> .code32 PUBLIC _call_method @@ -41,4 +51,4 @@ ret #endif -END + END
9 years, 7 months
1
0
0
0
[tkreuzer] 67739: [KS] "Fix" ARM build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu May 14 22:33:15 2015 New Revision: 67739 URL:
http://svn.reactos.org/svn/reactos?rev=67739&view=rev
Log: [KS] "Fix" ARM build Modified: trunk/reactos/drivers/ksfilter/ks/ks.spec trunk/reactos/drivers/ksfilter/ks/msvc.S Modified: trunk/reactos/drivers/ksfilter/ks/ks.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/ks.spe…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/ks.spec [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/ks.spec [iso-8859-1] Thu May 14 22:33:15 2015 @@ -7,7 +7,7 @@ @ stdcall -i386 ?IndirectedRelease@CBaseUnknown@@UAGKXZ(ptr) IIndirectedUnknown_fnRelease @ stdcall -i386 ?NonDelegatedAddRef@CBaseUnknown@@UAGKXZ(ptr) INonDelegatedUnknown_fnAddRef @ stdcall -i386 ?NonDelegatedQueryInterface@CBaseUnknown@@UAGJABU_GUID@@PAPAX@Z(ptr ptr ptr) INonDelegatedUnknown_fnQueryInterface -@ stdcall ?NonDelegatedRelease@CBaseUnknown@@UAGKXZ(ptr) IIndirectedUnknown_fnRelease +@ stdcall -i386 ?NonDelegatedRelease@CBaseUnknown@@UAGKXZ(ptr) IIndirectedUnknown_fnRelease @ stdcall -private DllInitialize(ptr) @ stdcall KoCreateInstance(ptr ptr long ptr ptr) Modified: trunk/reactos/drivers/ksfilter/ks/msvc.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/msvc.S…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/msvc.S [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/msvc.S [iso-8859-1] Thu May 14 22:33:15 2015 @@ -1,3 +1,7 @@ + +#ifdef _M_ARM + +#else #include <asm.inc> @@ -38,5 +42,6 @@ DEFINE_ALIAS ?NonDelegatedAddRef@CBaseUnknown@@UAGKXZ, INonDelegatedUnknown_fnAddRef DEFINE_ALIAS ?NonDelegatedQueryInterface@CBaseUnknown@@UAGJABU_GUID@@PAPAX@Z, INonDelegatedUnknown_fnQueryInterface #endif +#endif -END + END
9 years, 7 months
1
0
0
0
[tkreuzer] 67738: [VIDEOPRT] Fix ARM build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu May 14 22:33:03 2015 New Revision: 67738 URL:
http://svn.reactos.org/svn/reactos?rev=67738&view=rev
Log: [VIDEOPRT] Fix ARM build Modified: trunk/reactos/win32ss/drivers/videoprt/int10.c Modified: trunk/reactos/win32ss/drivers/videoprt/int10.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/videoprt/i…
============================================================================== --- trunk/reactos/win32ss/drivers/videoprt/int10.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/drivers/videoprt/int10.c [iso-8859-1] Thu May 14 22:33:03 2015 @@ -135,6 +135,15 @@ /* Return success */ return STATUS_SUCCESS; } +#else +NTSTATUS +NTAPI +IntInitializeVideoAddressSpace(VOID) +{ + UNIMPLEMENTED; + NT_ASSERT(FALSE); + return STATUS_NOT_IMPLEMENTED; +} #endif #if defined(_M_IX86)
9 years, 7 months
1
0
0
0
[tkreuzer] 67737: [RPCRT4] Fix ARM build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu May 14 22:32:49 2015 New Revision: 67737 URL:
http://svn.reactos.org/svn/reactos?rev=67737&view=rev
Log: [RPCRT4] Fix ARM build Modified: trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt trunk/reactos/dll/win32/rpcrt4/cproxy.c trunk/reactos/dll/win32/rpcrt4/cstub.c trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c Modified: trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/CMakeList…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt [iso-8859-1] Thu May 14 22:32:49 2015 @@ -35,7 +35,7 @@ -DCOM_NO_WINDOWS_H -DMSWMSG) -if(MSVC) +if(MSVC AND NOT ARCH STREQUAL "arm") add_asm_files(rpcrt4_asm msvc.S) endif() Modified: trunk/reactos/dll/win32/rpcrt4/cproxy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/cproxy.c?…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/cproxy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/cproxy.c [iso-8859-1] Thu May 14 22:32:49 2015 @@ -17,7 +17,7 @@ * 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 - * + * * TODO: Handle non-i386 architectures */ @@ -150,6 +150,30 @@ thunk->call_stubless = call_stubless_func; } +#elif defined(__arm__) + +extern void call_stubless_func(void); +__ASM_GLOBAL_FUNC(call_stubless_func, + "DCD 0xDEFC\n\t" // _assertfail + "" ); + +#include "pshpack1.h" +struct thunk +{ + DWORD assertfail; +}; +#include "poppack.h" + +static const struct thunk thunk_template = +{ + { 0xDEFC } /* _assertfail */ +}; + +static inline void init_thunk( struct thunk *thunk, unsigned int index ) +{ + *thunk = thunk_template; +} + #else /* __i386__ */ #warning You must implement stubless proxies for your CPU Modified: trunk/reactos/dll/win32/rpcrt4/cstub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/cstub.c?r…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/cstub.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/cstub.c [iso-8859-1] Thu May 14 22:32:49 2015 @@ -156,6 +156,13 @@ static const BYTE opcodes[16] = { 0x48, 0x8b, 0x49, 0x20, 0x48, 0x8b, 0x01, 0xff, 0xa0, 0, 0, 0, 0, 0x48, 0x8d, 0x36 }; +#elif defined(__arm__) +typedef struct +{ + DWORD offset; +} vtbl_method_t; +static const BYTE opcodes[1]; + #else #warning You must implement delegated proxies/stubs for your CPU Modified: trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_stubl…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c [iso-8859-1] Thu May 14 22:32:49 2015 @@ -1062,6 +1062,13 @@ __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") __ASM_CFI(".cfi_same_value %rbp\n\t") "ret") +#elif defined(__arm__) +LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, unsigned short stack_size) +{ + FIXME("Not implemented for ARM\n"); + assert(FALSE); + return 0; +} #else #warning call_server_func not implemented for your architecture LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, unsigned short stack_size) @@ -1389,7 +1396,7 @@ pRpcMsg->BufferLength = stubMsg.BufferLength; /* allocate buffer for [out] and [ret] params */ - Status = I_RpcGetBuffer(pRpcMsg); + Status = I_RpcGetBuffer(pRpcMsg); if (Status) RpcRaiseException(Status); stubMsg.Buffer = pRpcMsg->Buffer;
9 years, 7 months
1
0
0
0
[tkreuzer] 67736: [KERNEL32/KSECDD/GDI32/BMFD/DBGHELP/HALARM/SETUPLDR] Fix ARM build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu May 14 22:32:35 2015 New Revision: 67736 URL:
http://svn.reactos.org/svn/reactos?rev=67736&view=rev
Log: [KERNEL32/KSECDD/GDI32/BMFD/DBGHELP/HALARM/SETUPLDR] Fix ARM build Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt trunk/reactos/dll/win32/dbghelp/cpu_arm.c trunk/reactos/dll/win32/kernel32/CMakeLists.txt trunk/reactos/dll/win32/kernel32/client/except.c trunk/reactos/dll/win32/kernel32/client/utils.c trunk/reactos/drivers/crypto/ksecdd/ksecdd.h trunk/reactos/drivers/crypto/ksecdd/random.c trunk/reactos/hal/halarm/CMakeLists.txt trunk/reactos/win32ss/drivers/font/bmfd/bmfd.h trunk/reactos/win32ss/gdi/gdi32/wine/gdi_private.h trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/CMake…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Thu May 14 22:32:35 2015 @@ -243,11 +243,17 @@ add_cd_file(TARGET freeldr FILE ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys DESTINATION loader NO_CAB FOR bootcd regtest) add_cd_file(TARGET freeldr FILE ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys DESTINATION loader NO_CAB NOT_IN_HYBRIDCD FOR livecd hybridcd NAME_ON_CD setupldr.sys) -concatenate_files( - ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys - ${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin - ${_freeldr_pe_output_file}) - -add_custom_target(setupldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys) +if(NOT ARCH STREQUAL "arm") + + concatenate_files( + ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys + ${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin + ${_freeldr_pe_output_file}) + + add_custom_target(setupldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys) +else() + add_custom_target(setupldr ALL DEPENDS ${_freeldr_pe_output_file}) +endif() + add_cd_file(TARGET setupldr FILE ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys DESTINATION loader NO_CAB FOR bootcd regtest) Modified: trunk/reactos/dll/win32/dbghelp/cpu_arm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/cpu_arm.…
============================================================================== --- trunk/reactos/dll/win32/dbghelp/cpu_arm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dbghelp/cpu_arm.c [iso-8859-1] Thu May 14 22:32:35 2015 @@ -33,7 +33,7 @@ #ifdef __arm__ case cpu_addr_pc: addr->Offset = ctx->Pc; return TRUE; case cpu_addr_stack: addr->Offset = ctx->Sp; return TRUE; - case cpu_addr_frame: addr->Offset = ctx->Fp; return TRUE; + case cpu_addr_frame: addr->Offset = ctx->Fpscr; return TRUE; #endif default: addr->Mode = -1; return FALSE; @@ -116,7 +116,7 @@ /* set frame information */ frame->AddrStack.Offset = context->Sp; frame->AddrReturn.Offset = context->Lr; - frame->AddrFrame.Offset = context->Fp; + frame->AddrFrame.Offset = context->Fpscr; frame->AddrPC.Offset = context->Pc; frame->Far = TRUE; @@ -169,8 +169,8 @@ case CV_ARM_R0 + 8: *size = sizeof(ctx->R8); return &ctx->R8; case CV_ARM_R0 + 9: *size = sizeof(ctx->R9); return &ctx->R9; case CV_ARM_R0 + 10: *size = sizeof(ctx->R10); return &ctx->R10; - case CV_ARM_R0 + 11: *size = sizeof(ctx->Fp); return &ctx->Fp; - case CV_ARM_R0 + 12: *size = sizeof(ctx->Ip); return &ctx->Ip; + case CV_ARM_R0 + 11: *size = sizeof(ctx->Fpscr); return &ctx->Fpscr; + //case CV_ARM_R0 + 12: *size = sizeof(ctx->Ip); return &ctx->Ip; case CV_ARM_SP: *size = sizeof(ctx->Sp); return &ctx->Sp; case CV_ARM_LR: *size = sizeof(ctx->Lr); return &ctx->Lr; Modified: trunk/reactos/dll/win32/kernel32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/kernel32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/CMakeLists.txt [iso-8859-1] Thu May 14 22:32:35 2015 @@ -90,6 +90,10 @@ list(APPEND ASM_SOURCE client/amd64/fiber.S client/amd64/thread.S) +elseif(ARCH STREQUAL "arm") + list(APPEND ASM_SOURCE + client/arm/fiber.S + client/arm/thread.S) endif() add_asm_files(kernel32_asm ${ASM_SOURCE}) Modified: trunk/reactos/dll/win32/kernel32/client/except.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/except.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/except.c [iso-8859-1] Thu May 14 22:32:35 2015 @@ -62,8 +62,14 @@ DbgPrint("R8: %I64x R9: %I64x R10: %I64x R11: %I64x\n", pc->R8, pc->R9, pc->R10, pc->R11); DbgPrint("R12: %I64x R13: %I64x R14: %I64x R15: %I64x\n", pc->R12, pc->R13, pc->R14, pc->R15); DbgPrint("EFLAGS: %.8x\n", pc->EFlags); +#elif defined(_M_ARM) + DbgPrint("PC: %08lx LR: %08lx SP: %08lx\n", pc->Pc); + DbgPrint("R0: %08lx R1: %08lx R2: %08lx R3: %08lx\n", pc->R0, pc->R1, pc->R2, pc->R3); + DbgPrint("R4: %08lx R5: %08lx R6: %08lx R7: %08lx\n", pc->R4, pc->R5, pc->R6, pc->R7); + DbgPrint("R8: %08lx R9: %08lx R10: %08lx R11: %08lx\n", pc->R8, pc->R9, pc->R10, pc->R11); + DbgPrint("R12: %08lx CPSR: %08lx FPSCR: %08lx\n", pc->R12, pc->Cpsr, pc->R1, pc->Fpscr, pc->R3); #else -#warning Unknown architecture +#error "Unknown architecture" #endif } Modified: trunk/reactos/dll/win32/kernel32/client/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] Thu May 14 22:32:35 2015 @@ -606,6 +606,33 @@ /* Give it some room for the Parameter */ Context->Rsp -= sizeof(PVOID); +#elif defined(_M_ARM) + DPRINT("BaseInitializeContext: %p\n", Context); + + // FIXME: check if this is correct! + /* Setup the Initial Win32 Thread Context */ + Context->R0 = (ULONG_PTR)StartAddress; + Context->R1 = (ULONG_PTR)Parameter; + Context->Sp = (ULONG_PTR)StackAddress; + + if (ContextType == 1) /* For Threads */ + { + Context->Pc = (ULONG_PTR)BaseThreadStartupThunk; + } + else if (ContextType == 2) /* For Fibers */ + { + Context->Pc = (ULONG_PTR)BaseFiberStartup; + } + else /* For first thread in a Process */ + { + Context->Pc = (ULONG_PTR)BaseProcessStartThunk; + } + + /* Set the Context Flags */ + Context->ContextFlags = CONTEXT_FULL; + + /* Give it some room for the Parameter */ + Context->Sp -= sizeof(PVOID); #else #warning Unknown architecture UNIMPLEMENTED; @@ -907,7 +934,7 @@ OUT PHANDLE JobHandle) { NTSTATUS Status; - + /* Validate that there's a name */ if ((ApplicationName) && *(ApplicationName)) { Modified: trunk/reactos/drivers/crypto/ksecdd/ksecdd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/crypto/ksecdd/ksec…
============================================================================== --- trunk/reactos/drivers/crypto/ksecdd/ksecdd.h [iso-8859-1] (original) +++ trunk/reactos/drivers/crypto/ksecdd/ksecdd.h [iso-8859-1] Thu May 14 22:32:35 2015 @@ -43,8 +43,13 @@ ULONG64 Ctr0; ULONG64 Ctr1; } KSEC_MACHINE_SPECIFIC_COUNTERS, *PKSEC_MACHINE_SPECIFIC_COUNTERS; +#elif defined(_M_ARM) +typedef struct _KSEC_MACHINE_SPECIFIC_COUNTERS +{ + ULONG Ccr; +} KSEC_MACHINE_SPECIFIC_COUNTERS, *PKSEC_MACHINE_SPECIFIC_COUNTERS; #else -typedef ULONG KSEC_MACHINE_SPECIFIC_COUNTERS; +typedef ULONG KSEC_MACHINE_SPECIFIC_COUNTERS, *PKSEC_MACHINE_SPECIFIC_COUNTERS; #endif typedef struct _KSEC_ENTROPY_DATA Modified: trunk/reactos/drivers/crypto/ksecdd/random.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/crypto/ksecdd/rand…
============================================================================== --- trunk/reactos/drivers/crypto/ksecdd/random.c [iso-8859-1] (original) +++ trunk/reactos/drivers/crypto/ksecdd/random.c [iso-8859-1] Thu May 14 22:32:35 2015 @@ -76,6 +76,11 @@ MachineSpecificCounters->Pmc1 = __readpmc(1); } #endif +#elif defined(_M_ARM) +/* FIXME: this should go into a public header (from ksarm.h) */ +#define CP15_PMCCNTR 15, 0, 9, 13, 0 + /* Read the Cycle Counter Register */ + MachineSpecificCounters->Ccr = _MoveFromCoprocessor(CP15_PMCCNTR); #else #error Implement me! #endif Modified: trunk/reactos/hal/halarm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/CMakeLists.txt?…
============================================================================== --- trunk/reactos/hal/halarm/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/hal/halarm/CMakeLists.txt [iso-8859-1] Thu May 14 22:32:35 2015 @@ -15,3 +15,5 @@ add_library(hal SHARED ${SOURCES}) + +set_module_type(hal kerneldll ENTRYPOINT 0) Modified: trunk/reactos/win32ss/drivers/font/bmfd/bmfd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/font/bmfd/…
============================================================================== --- trunk/reactos/win32ss/drivers/font/bmfd/bmfd.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/drivers/font/bmfd/bmfd.h [iso-8859-1] Thu May 14 22:32:35 2015 @@ -19,8 +19,8 @@ #else // FIXME: BE #define GETVAL(x) \ - sizeof(x) == 1 ? (x) : \ - sizeof(x) == 2 ? (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8)) : \ + (sizeof(x) == 1) ? (x) : \ + (sizeof(x) == 2) ? (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8)) : \ (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8) + (((PCHAR)&(x))[2] << 16) + \ (((PCHAR)&(x))[3] << 24)) @@ -121,13 +121,13 @@ } FONTDIRENTRY, *PFONTDIRENTRY; typedef struct _DIRENTRY -{ +{ WORD fontOrdinal; FONTDIRENTRY fde; } DIRENTRY, *PDIRENTRY; typedef struct _FONTGROUPHDR -{ +{ WORD NumberOfFonts; DIRENTRY ade[1]; } FONTGROUPHDR, *PFONTGROUPHDR; Modified: trunk/reactos/win32ss/gdi/gdi32/wine/gdi_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/wine/gdi…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/wine/gdi_private.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/wine/gdi_private.h [iso-8859-1] Thu May 14 22:32:35 2015 @@ -138,8 +138,14 @@ BOOL WINAPI SetWorldTransformForMetafile(HDC hdc, const XFORM *pxform); #define SetWorldTransform SetWorldTransformForMetafile +#ifdef _M_ARM +#define DbgRaiseAssertionFailure() __emit(0xdefc) +#else +#define DbgRaiseAssertionFailure() __int2c() +#endif // _M_ARM + #undef ASSERT -#define ASSERT(x) if (!(x)) __int2c() +#define ASSERT(x) if (!(x)) DbgRaiseAssertionFailure() #endif /* __WINE_GDI_PRIVATE_H */ Modified: trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/wine/ros…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c [iso-8859-1] Thu May 14 22:32:35 2015 @@ -516,7 +516,7 @@ const char *file, unsigned line) { - __int2c(); + DbgRaiseAssertionFailure(); } double
9 years, 7 months
1
0
0
0
[tkreuzer] 67735: [NTOSKRNL] Fix ARM build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu May 14 22:31:58 2015 New Revision: 67735 URL:
http://svn.reactos.org/svn/reactos?rev=67735&view=rev
Log: [NTOSKRNL] Fix ARM build Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c trunk/reactos/ntoskrnl/include/internal/arm/ke.h trunk/reactos/ntoskrnl/include/internal/ke_x.h trunk/reactos/ntoskrnl/kd/arm/kdbg.c trunk/reactos/ntoskrnl/kd64/kddata.c trunk/reactos/ntoskrnl/ke/arm/cpu.c trunk/reactos/ntoskrnl/ke/arm/exp.c trunk/reactos/ntoskrnl/ke/arm/kiinit.c trunk/reactos/ntoskrnl/ke/arm/thrdini.c trunk/reactos/ntoskrnl/ke/arm/trapc.c trunk/reactos/ntoskrnl/ke/arm/usercall.c trunk/reactos/ntoskrnl/ke/ipi.c trunk/reactos/ntoskrnl/ke/thrdobj.c trunk/reactos/ntoskrnl/ke/thrdschd.c trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c trunk/reactos/ntoskrnl/mm/arm/page.c trunk/reactos/ntoskrnl/rtl/libsupp.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -1597,7 +1597,9 @@ { AlignmentFixupCount += Prcb->KeAlignmentFixupCount; ExceptionDispatchCount += Prcb->KeExceptionDispatchCount; +#ifndef _M_ARM FloatingEmulationCount += Prcb->KeFloatingEmulationCount; +#endif // _M_ARM } } @@ -2353,7 +2355,7 @@ DPRINT1("NtFlushInstructionCache() is not implemented\n"); for (;;); #elif defined(_M_ARM) - __asm__ __volatile__("mov r1, #0; mcr p15, 0, r1, c7, c5, 0"); + //__asm__ __volatile__("mov r1, #0; mcr p15, 0, r1, c7, c5, 0"); #else #error Unknown architecture #endif Modified: trunk/reactos/ntoskrnl/include/internal/arm/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/arm/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/arm/ke.h [iso-8859-1] Thu May 14 22:31:58 2015 @@ -18,7 +18,7 @@ // #define KD_BREAKPOINT_TYPE ULONG #define KD_BREAKPOINT_SIZE sizeof(ULONG) -//#define KD_BREAKPOINT_VALUE +#define KD_BREAKPOINT_VALUE 0xDEFE // // Maximum IRQs @@ -59,7 +59,7 @@ // All architectures but x86 have it in the PRCB's KeContextSwitches // #define KeGetContextSwitches(Prcb) \ - CONTAINING_RECORD(Prcb, KIPCR, PrcbData)->ContextSwitches + (Prcb)->KeContextSwitches // // Macro to get the second level cache size field name which differs between @@ -71,7 +71,7 @@ // Returns the Interrupt State from a Trap Frame. // ON = TRUE, OFF = FALSE // -//#define KeGetTrapFrameInterruptState(TrapFrame) +#define KeGetTrapFrameInterruptState(TrapFrame) 0 FORCEINLINE BOOLEAN @@ -162,7 +162,7 @@ #define KiEndInterrupt(x,y) #define KiGetLinkedTrapFrame(x) \ - (PKTRAP_FRAME)((x)->PreviousTrapFrame) + (PKTRAP_FRAME)((x)->TrapFrame) #define KiGetPreviousMode(tf) \ - ((tf->Spsr & CPSR_MODES) == CPSR_USER_MODE) ? UserMode: KernelMode + ((tf->Cpsr & CPSRM_MASK) == CPSRM_USER) ? UserMode: KernelMode Modified: trunk/reactos/ntoskrnl/include/internal/ke_x.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke_x.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ke_x.h [iso-8859-1] Thu May 14 22:31:58 2015 @@ -383,7 +383,7 @@ IN ULONG Cpu) { /* Check if a new thread needs to be scheduled on a different CPU */ - if ((NewThread) && !(KeGetPcr()->Number == Cpu)) + if ((NewThread) && !(KeGetCurrentPrcb()->Number == Cpu)) { /* Send an IPI to request delivery */ KiIpiSend(AFFINITY_MASK(Cpu), IPI_DPC); @@ -534,7 +534,7 @@ if (NeedApc) { /* Check if it's on another CPU */ - if (KeGetPcr()->Number != Processor) + if (KeGetCurrentPrcb()->Number != Processor) { /* Send an IPI to request delivery */ KiIpiSend(AFFINITY_MASK(Processor), IPI_APC); Modified: trunk/reactos/ntoskrnl/kd/arm/kdbg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/arm/kdbg.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/kd/arm/kdbg.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kd/arm/kdbg.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -55,24 +55,24 @@ // // Disable interrupts // - WRITE_REGISTER_ULONG(UART_PL011_CR, 0); + WRITE_REGISTER_ULONG((PULONG)UART_PL011_CR, 0); // // Set the baud rate // - WRITE_REGISTER_ULONG(UART_PL011_IBRD, Divider); - WRITE_REGISTER_ULONG(UART_PL011_FBRD, Fraction); + WRITE_REGISTER_ULONG((PULONG)UART_PL011_IBRD, Divider); + WRITE_REGISTER_ULONG((PULONG)UART_PL011_FBRD, Fraction); // // Set 8 bits for data, 1 stop bit, no parity, FIFO enabled // - WRITE_REGISTER_ULONG(UART_PL011_LCRH, + WRITE_REGISTER_ULONG((PULONG)UART_PL011_LCRH, UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN); // // Clear and enable FIFO // - WRITE_REGISTER_ULONG(UART_PL011_CR, + WRITE_REGISTER_ULONG((PULONG)UART_PL011_CR, UART_PL011_CR_UARTEN | UART_PL011_CR_TXE | UART_PL011_CR_RXE); @@ -101,12 +101,12 @@ // // Wait for ready // - while ((READ_REGISTER_ULONG(UART_PL01x_FR) & UART_PL01x_FR_TXFF) != 0); - + while ((READ_REGISTER_ULONG((PULONG)UART_PL01x_FR) & UART_PL01x_FR_TXFF) != 0); + // // Send the character // - WRITE_REGISTER_ULONG(UART_PL01x_DR, ByteToSend); + WRITE_REGISTER_ULONG((PULONG)UART_PL01x_DR, ByteToSend); } /* EOF */ Modified: trunk/reactos/ntoskrnl/kd64/kddata.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/kddata.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/kd64/kddata.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kd64/kddata.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -46,7 +46,7 @@ #elif defined(_ARM_) #define KPCR_SELF_PCR_OFFSET 0 -#define KPCR_CURRENT_PRCB_OFFSET FIELD_OFFSET(KPCR, Prcb) +#define KPCR_CURRENT_PRCB_OFFSET FIELD_OFFSET(KIPCR, Prcb) #define KPCR_CONTAINED_PRCB_OFFSET 0 #define KPCR_INITIAL_STACK_OFFSET FIELD_OFFSET(KPCR, InitialStack) #define KPCR_STACK_LIMIT_OFFSET FIELD_OFFSET(KPCR, StackLimit) @@ -510,9 +510,16 @@ KPCR_CONTAINED_PRCB_OFFSET, 0, 0, +#if defined(_M_ARM) + _WARN("KPCR_INITIAL_STACK_OFFSET, KPCR_STACK_LIMIT_OFFSET and KPRCB_PCR_PAGE_OFFSET not properly defined on ARM") + 0, + 0, + 0, +#else KPCR_INITIAL_STACK_OFFSET, KPCR_STACK_LIMIT_OFFSET, KPRCB_PCR_PAGE_OFFSET, +#endif FIELD_OFFSET(KPRCB, ProcessorState.SpecialRegisters), #if defined(_X86_) // Modified: trunk/reactos/ntoskrnl/ke/arm/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/cpu.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/cpu.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/cpu.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -67,10 +67,26 @@ // // Save some critical stuff we use // + __debugbreak(); +#if 0 ProcessorState->SpecialRegisters.ControlRegister = KeArmControlRegisterGet(); ProcessorState->SpecialRegisters.LockdownRegister = KeArmLockdownRegisterGet(); ProcessorState->SpecialRegisters.CacheRegister = KeArmCacheRegisterGet(); ProcessorState->SpecialRegisters.StatusRegister = KeArmStatusRegisterGet(); +#endif +} + +VOID +NTAPI +KiRestoreProcessorControlState(PKPROCESSOR_STATE ProcessorState) +{ + __debugbreak(); +#if 0 + KeArmControlRegisterSet(ProcessorState->SpecialRegisters.ControlRegister); + KeArmLockdownRegisterSet(ProcessorState->SpecialRegisters.LockdownRegister); + KeArmCacheRegisterSet(ProcessorState->SpecialRegisters.CacheRegister); + KeArmStatusRegisterSet(ProcessorState->SpecialRegisters.StatusRegister); +#endif } BOOLEAN @@ -170,30 +186,14 @@ KiSaveProcessorControlState(State); } -/* - * @implemented - */ -NTSTATUS -NTAPI -KeSaveFloatingPointState(OUT PKFLOATING_SAVE Save) -{ - // - // Nothing to do on ARM - // - return STATUS_SUCCESS; -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -KeRestoreFloatingPointState(IN PKFLOATING_SAVE Save) -{ - // - // Nothing to do on ARM - // - return STATUS_SUCCESS; +VOID +NTAPI +KeFlushIoBuffers( + _In_ PMDL Mdl, + _In_ BOOLEAN ReadOperation, + _In_ BOOLEAN DmaOperation) +{ + DbgBreakPoint(); } /* SYSTEM CALLS NOT VALID ON THIS CPU *****************************************/ Modified: trunk/reactos/ntoskrnl/ke/arm/exp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/exp.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/exp.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/exp.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -9,7 +9,6 @@ /* INCLUDES *******************************************************************/ #include <ntoskrnl.h> -#include <internal/arm/ksarm.h> #define NDEBUG #include <debug.h> @@ -24,13 +23,13 @@ IN KPROCESSOR_MODE PreviousMode) { KIRQL OldIrql; - + // // Do this at APC_LEVEL // OldIrql = KeGetCurrentIrql(); if (OldIrql < APC_LEVEL) KeRaiseIrql(APC_LEVEL, &OldIrql); - + // // Start with the Control flags // @@ -39,30 +38,20 @@ // // So this basically means all the special stuff // - if (PreviousMode == UserMode) - { - // - // ARM has register banks - // - TrapFrame->UserSp = Context->Sp; - TrapFrame->UserLr = Context->Lr; - } - else - { - // - // ARM has register banks - // - TrapFrame->SvcSp = Context->Sp; - TrapFrame->SvcLr = Context->Lr; - } - + + // + // ARM has register banks + // + TrapFrame->Sp = Context->Sp; + TrapFrame->Lr = Context->Lr; + // // The rest is already in the right mode // TrapFrame->Pc = Context->Pc; - TrapFrame->Spsr = Context->Psr; - } - + TrapFrame->Cpsr = Context->Cpsr; + } + // // Now do the integers // @@ -75,21 +64,21 @@ TrapFrame->R1 = Context->R1; TrapFrame->R2 = Context->R2; TrapFrame->R3 = Context->R3; - TrapFrame->R4 = Context->R4; - TrapFrame->R5 = Context->R5; - TrapFrame->R6 = Context->R6; - TrapFrame->R7 = Context->R7; - TrapFrame->R8 = Context->R8; - TrapFrame->R0 = Context->R9; - TrapFrame->R10 = Context->R10; - TrapFrame->R11 = Context->R11; + ExceptionFrame->R4 = Context->R4; + ExceptionFrame->R5 = Context->R5; + ExceptionFrame->R6 = Context->R6; + ExceptionFrame->R7 = Context->R7; + ExceptionFrame->R8 = Context->R8; + ExceptionFrame->R9 = Context->R9; + ExceptionFrame->R10 = Context->R10; + ExceptionFrame->R11 = Context->R11; TrapFrame->R12 = Context->R12; } - + // // Restore IRQL // - if (OldIrql < APC_LEVEL) KeLowerIrql(OldIrql); + if (OldIrql < APC_LEVEL) KeLowerIrql(OldIrql); } VOID @@ -99,13 +88,13 @@ IN OUT PCONTEXT Context) { KIRQL OldIrql; - + // // Do this at APC_LEVEL // OldIrql = KeGetCurrentIrql(); if (OldIrql < APC_LEVEL) KeRaiseIrql(APC_LEVEL, &OldIrql); - + // // Start with the Control flags // @@ -114,30 +103,20 @@ // // So this basically means all the special stuff // - if (KiGetPreviousMode(TrapFrame) == UserMode) - { - // - // ARM has register banks - // - Context->Sp = TrapFrame->UserSp; - Context->Lr = TrapFrame->UserLr; - } - else - { - // - // ARM has register banks - // - Context->Sp = TrapFrame->SvcSp; - Context->Lr = TrapFrame->SvcLr; - } - + + // + // ARM has register banks + // + Context->Sp = TrapFrame->Sp; + Context->Lr = TrapFrame->Lr; + // // The rest is already in the right mode // Context->Pc = TrapFrame->Pc; - Context->Psr = TrapFrame->Spsr; - } - + Context->Cpsr = TrapFrame->Cpsr; + } + // // Now do the integers // @@ -150,21 +129,21 @@ Context->R1 = TrapFrame->R1; Context->R2 = TrapFrame->R2; Context->R3 = TrapFrame->R3; - Context->R4 = TrapFrame->R4; - Context->R5 = TrapFrame->R5; - Context->R6 = TrapFrame->R6; - Context->R7 = TrapFrame->R7; - Context->R8 = TrapFrame->R8; - Context->R0 = TrapFrame->R9; - Context->R10 = TrapFrame->R10; - Context->R11 = TrapFrame->R11; + Context->R4 = ExceptionFrame->R4; + Context->R5 = ExceptionFrame->R5; + Context->R6 = ExceptionFrame->R6; + Context->R7 = ExceptionFrame->R7; + Context->R8 = ExceptionFrame->R8; + Context->R0 = ExceptionFrame->R9; + Context->R10 = ExceptionFrame->R10; + Context->R11 = ExceptionFrame->R11; Context->R12 = TrapFrame->R12; } - + // // Restore IRQL // - if (OldIrql < APC_LEVEL) KeLowerIrql(OldIrql); + if (OldIrql < APC_LEVEL) KeLowerIrql(OldIrql); } VOID @@ -182,7 +161,7 @@ /* Set the context flags */ Context.ContextFlags = CONTEXT_FULL; - + /* Check if User Mode or if the kernel debugger is enabled */ if ((PreviousMode == UserMode) || (KeGetPcr()->KdVersionBlock)) { @@ -281,3 +260,12 @@ PreviousMode); return; } + +NTSTATUS +NTAPI +KeRaiseUserException( + _In_ NTSTATUS ExceptionCode) +{ + ASSERT(FALSE); + return STATUS_NOT_IMPLEMENTED; +} Modified: trunk/reactos/ntoskrnl/ke/arm/kiinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/kiinit.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/kiinit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/kiinit.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -12,6 +12,13 @@ #define NDEBUG #include <debug.h> +VOID +NTAPI +KdPortPutByteEx( + PCPPORT PortInformation, + UCHAR ByteToSend +); + /* GLOBALS ********************************************************************/ KINTERRUPT KxUnexpectedInterrupt; @@ -44,15 +51,16 @@ PKIPCR Pcr = (PKIPCR)KeGetPcr(); ULONG PageDirectory[2]; ULONG i; - + /* Set the default NX policy (opt-in) */ SharedUserData->NXSupportPolicy = NX_SUPPORT_POLICY_OPTIN; /* Initialize spinlocks and DPC data */ KiInitSpinLocks(Prcb, Number); - + /* Set stack pointers */ - Pcr->InitialStack = IdleStack; + //Pcr->InitialStack = IdleStack; + Pcr->Prcb.SpBase = IdleStack; // ??? /* Check if this is the Boot CPU */ if (!Number) @@ -64,22 +72,23 @@ /* Copy the template code */ KxUnexpectedInterrupt.DispatchCode[i] = ((PULONG)KiInterruptTemplate)[i]; } - + /* Set DMA coherency */ KiDmaIoCoherency = 0; - + /* Sweep D-Cache */ HalSweepDcache(); - + /* Set boot-level flags */ KeProcessorArchitecture = PROCESSOR_ARCHITECTURE_ARM; KeFeatureBits = 0; - KeProcessorLevel = (USHORT)(Pcr->ProcessorId >> 8); - KeProcessorRevision = (USHORT)(Pcr->ProcessorId & 0xFF); - + /// FIXME: just a wild guess + KeProcessorLevel = (USHORT)(Pcr->Prcb.ProcessorState.ArchState.Cp15_Cr0_CpuId >> 8); + KeProcessorRevision = (USHORT)(Pcr->Prcb.ProcessorState.ArchState.Cp15_Cr0_CpuId & 0xFF); +#if 0 /* Set the current MP Master KPRCB to the Boot PRCB */ Prcb->MultiThreadSetMaster = Prcb; - +#endif /* Lower to APC_LEVEL */ KeLowerIrql(APC_LEVEL); @@ -160,9 +169,9 @@ LoaderBlock->Prcb = 0; } -C_ASSERT((PKIPCR)KeGetPcr() == (PKIPCR)0xFFDFF000); -C_ASSERT((FIELD_OFFSET(KIPCR, FirstLevelDcacheSize) & 4) == 0); -C_ASSERT(sizeof(KIPCR) <= PAGE_SIZE); +//C_ASSERT((PKIPCR)KeGetPcr() == (PKIPCR)0xFFDFF000); +//C_ASSERT((FIELD_OFFSET(KIPCR, FirstLevelDcacheSize) & 4) == 0); +//C_ASSERT(sizeof(KIPCR) <= PAGE_SIZE); VOID NTAPI @@ -173,109 +182,127 @@ IN PVOID InterruptStack) { ULONG i; - + /* 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 #if 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->CurrentPrcb; /* Start us out at PASSIVE_LEVEL */ - Pcr->Irql = PASSIVE_LEVEL; + Pcr->CurrentIrql = PASSIVE_LEVEL; /* Set the stacks */ - Pcr->PanicStack = PanicStack; - Pcr->InterruptStack = InterruptStack; - + Pcr->Prcb.PanicStackBase = (ULONG)PanicStack; + Pcr->Prcb.IsrStack = InterruptStack; +#if 0 /* Setup the processor set */ - Pcr->PrcbData.MultiThreadProcessorSet = Pcr->PrcbData.SetMember; - + Pcr->Prcb.MultiThreadProcessorSet = Pcr->Prcb.SetMember; +#endif + /* Copy cache information from the loader block */ - Pcr->FirstLevelDcacheSize = KeLoaderBlock->u.Arm.FirstLevelDcacheSize; - Pcr->SecondLevelDcacheSize = KeLoaderBlock->u.Arm.SecondLevelDcacheSize; - Pcr->FirstLevelIcacheSize = KeLoaderBlock->u.Arm.FirstLevelIcacheSize; - Pcr->SecondLevelIcacheSize = KeLoaderBlock->u.Arm.SecondLevelIcacheSize; - Pcr->FirstLevelDcacheFillSize = KeLoaderBlock->u.Arm.FirstLevelDcacheFillSize; - Pcr->SecondLevelDcacheFillSize = KeLoaderBlock->u.Arm.SecondLevelDcacheFillSize; - Pcr->FirstLevelIcacheFillSize = KeLoaderBlock->u.Arm.FirstLevelIcacheFillSize; - Pcr->SecondLevelIcacheFillSize = KeLoaderBlock->u.Arm.SecondLevelIcacheFillSize; + Pcr->Prcb.Cache[FirstLevelDcache].Type = CacheData; + Pcr->Prcb.Cache[FirstLevelDcache].Level = 1; + Pcr->Prcb.Cache[FirstLevelDcache].Associativity = 0; // FIXME + Pcr->Prcb.Cache[FirstLevelDcache].LineSize = KeLoaderBlock->u.Arm.FirstLevelDcacheFillSize; + Pcr->Prcb.Cache[FirstLevelDcache].Size = KeLoaderBlock->u.Arm.FirstLevelDcacheSize; + + Pcr->Prcb.Cache[SecondLevelDcache].Type = CacheData; + Pcr->Prcb.Cache[SecondLevelDcache].Level = 2; + Pcr->Prcb.Cache[SecondLevelDcache].Associativity = 0; // FIXME + Pcr->Prcb.Cache[SecondLevelDcache].LineSize = KeLoaderBlock->u.Arm.SecondLevelDcacheFillSize; + Pcr->Prcb.Cache[SecondLevelDcache].Size = KeLoaderBlock->u.Arm.SecondLevelDcacheSize; + + Pcr->Prcb.Cache[FirstLevelIcache].Type = CacheInstruction; + Pcr->Prcb.Cache[FirstLevelIcache].Level = 1; + Pcr->Prcb.Cache[FirstLevelIcache].Associativity = 0; // FIXME + Pcr->Prcb.Cache[FirstLevelIcache].LineSize = KeLoaderBlock->u.Arm.FirstLevelIcacheFillSize; + Pcr->Prcb.Cache[FirstLevelIcache].Size = KeLoaderBlock->u.Arm.FirstLevelIcacheSize; + + Pcr->Prcb.Cache[SecondLevelIcache].Type = CacheInstruction; + Pcr->Prcb.Cache[SecondLevelIcache].Level = 2; + Pcr->Prcb.Cache[SecondLevelIcache].Associativity = 0; // FIXME + Pcr->Prcb.Cache[SecondLevelIcache].LineSize = KeLoaderBlock->u.Arm.SecondLevelIcacheFillSize; + Pcr->Prcb.Cache[SecondLevelIcache].Size = KeLoaderBlock->u.Arm.SecondLevelIcacheSize; /* Set global d-cache fill and alignment values */ - if (!Pcr->SecondLevelDcacheSize) + if (Pcr->Prcb.Cache[SecondLevelDcache].Size == 0) { /* Use the first level */ - Pcr->DcacheFillSize = Pcr->FirstLevelDcacheSize; + Pcr->Prcb.Cache[GlobalDcache] = Pcr->Prcb.Cache[FirstLevelDcache]; } else { /* Use the second level */ - Pcr->DcacheFillSize = Pcr->SecondLevelDcacheSize; - } - + Pcr->Prcb.Cache[GlobalDcache] = Pcr->Prcb.Cache[SecondLevelDcache]; + } + /* Set the alignment */ - Pcr->DcacheAlignment = Pcr->DcacheFillSize - 1; - + //Pcr->DcacheAlignment = Pcr->DcacheFillSize - 1; + /* Set global i-cache fill and alignment values */ - if (!Pcr->SecondLevelIcacheSize) + if (Pcr->Prcb.Cache[SecondLevelIcache].Size == 0) { /* Use the first level */ - Pcr->IcacheFillSize = Pcr->FirstLevelIcacheSize; + Pcr->Prcb.Cache[GlobalIcache] = Pcr->Prcb.Cache[FirstLevelIcache]; } else { /* Use the second level */ - Pcr->IcacheFillSize = Pcr->SecondLevelIcacheSize; - } - + Pcr->Prcb.Cache[GlobalIcache] = Pcr->Prcb.Cache[SecondLevelIcache]; + } + /* Set the alignment */ - Pcr->IcacheAlignment = Pcr->IcacheFillSize - 1; - + //Pcr->IcacheAlignment = Pcr->IcacheFillSize - 1; + /* Set processor information */ - Pcr->ProcessorId = KeArmIdCodeRegisterGet().AsUlong; - + //Pcr->ProcessorId = KeArmIdCodeRegisterGet().AsUlong; + /* Set all interrupt routines to unexpected interrupts as well */ for (i = 0; i < MAXIMUM_VECTOR; i++) { /* Point to the same template */ - Pcr->InterruptRoutine[i] = (PVOID)&KxUnexpectedInterrupt.DispatchCode; + Pcr->Idt[i] = (PVOID)&KxUnexpectedInterrupt.DispatchCode; } /* Set default stall factor */ Pcr->StallScaleFactor = 50; - + /* Setup software interrupts */ - Pcr->InterruptRoutine[PASSIVE_LEVEL] = KiPassiveRelease; - Pcr->InterruptRoutine[APC_LEVEL] = KiApcInterrupt; - Pcr->InterruptRoutine[DISPATCH_LEVEL] = KiDispatchInterrupt; + Pcr->Idt[PASSIVE_LEVEL] = KiPassiveRelease; + Pcr->Idt[APC_LEVEL] = KiApcInterrupt; + Pcr->Idt[DISPATCH_LEVEL] = KiDispatchInterrupt; +#if 0 Pcr->ReservedVectors = (1 << PASSIVE_LEVEL) | (1 << APC_LEVEL) | (1 << DISPATCH_LEVEL) | (1 << IPI_LEVEL); +#endif } VOID @@ -283,7 +310,7 @@ { /* Detect ARM version */ KeIsArmV6 = KeArmIdCodeRegisterGet().Architecture >= 7; - + /* Set the number of TLB entries and ASIDs */ KeNumberTbEntries = 64; if (__ARMV6__) @@ -310,7 +337,7 @@ /* Flush the TLB */ KeFlushTb(); - + /* Save the loader block and get the current CPU */ KeLoaderBlock = LoaderBlock; Cpu = KeNumberProcessors; @@ -327,7 +354,7 @@ /* Skip initial setup if this isn't the Boot CPU */ if (Cpu) goto AppCpuInit; - + /* Initialize the PCR */ RtlZeroMemory(Pcr, PAGE_SIZE); KiInitializePcr(Cpu, @@ -339,22 +366,20 @@ /* Now sweep caches */ HalSweepIcache(); HalSweepDcache(); - + /* Set us as the current process */ InitialThread->ApcState.Process = InitialProcess; - + AppCpuInit: /* Setup CPU-related fields */ - Pcr->Number = Cpu; - Pcr->SetMember = 1 << Cpu; - Pcr->SetMemberCopy = 1 << Cpu; - Pcr->PrcbData.SetMember = 1 << Cpu; - + Pcr->Prcb.Number = Cpu; + Pcr->Prcb.SetMember = 1 << Cpu; + /* Initialize the Processor with HAL */ HalInitializeProcessor(Cpu, KeLoaderBlock); /* Set active processors */ - KeActiveProcessors |= Pcr->SetMember; + KeActiveProcessors |= Pcr->Prcb.SetMember; KeNumberProcessors++; /* Check if this is the boot CPU */ @@ -369,12 +394,12 @@ /* Raise to HIGH_LEVEL */ KfRaiseIrql(HIGH_LEVEL); - + /* Set the exception address to high */ ControlRegister = KeArmControlRegisterGet(); ControlRegister.HighVectors = TRUE; KeArmControlRegisterSet(ControlRegister); - + /* Setup the exception vector table */ RtlCopyMemory((PVOID)0xFFFF0000, &KiArmVectorTable, 14 * sizeof(PVOID)); @@ -382,8 +407,8 @@ KiInitializeKernel((PKPROCESS)LoaderBlock->Process, (PKTHREAD)LoaderBlock->Thread, (PVOID)LoaderBlock->KernelStack, - Pcr->Prcb, - Pcr->Prcb->Number, + &Pcr->Prcb, + Pcr->Prcb.Number, KeLoaderBlock); /* Set the priority of this thread to 0 */ @@ -412,7 +437,7 @@ va_start(args, fmt); i = vsprintf(Buffer, fmt, args); va_end(args); - + /* Output the message */ while (*String != 0) { @@ -423,6 +448,6 @@ KdPortPutByteEx(NULL, *String); String++; } - + return STATUS_SUCCESS; } Modified: trunk/reactos/ntoskrnl/ke/arm/thrdini.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/thrdini.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/thrdini.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/thrdini.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -70,19 +70,19 @@ PKUINIT_FRAME InitFrame; InitFrame = (PKUINIT_FRAME)((ULONG_PTR)Thread->InitialStack - sizeof(KUINIT_FRAME)); - + // // Setup the Trap Frame and Exception frame // TrapFrame = &InitFrame->TrapFrame; ExceptionFrame = &InitFrame->ExceptionFrame; - + /// // Zero out the trap frame and exception frame // RtlZeroMemory(TrapFrame, sizeof(KTRAP_FRAME)); RtlZeroMemory(ExceptionFrame, sizeof(KEXCEPTION_FRAME)); - + // // Set up a trap frame from the context // @@ -97,12 +97,12 @@ // //TrapFrame->PreviousMode = UserMode; Thread->PreviousMode = UserMode; - + // // Clear the return address // - ExceptionFrame->Lr = 0; - + ExceptionFrame->Return = 0; + // // Context switch frame to setup below // @@ -116,22 +116,22 @@ PKKINIT_FRAME InitFrame; InitFrame = (PKKINIT_FRAME)((ULONG_PTR)Thread->InitialStack - sizeof(KKINIT_FRAME)); - + // // Set the previous mode as kernel // Thread->PreviousMode = KernelMode; - + // // Context switch frame to setup below // CtxSwitchFrame = &InitFrame->CtxSwitchFrame; } - + // // Now setup the context switch frame // - CtxSwitchFrame->Lr = (ULONG)KiThreadStartup; + CtxSwitchFrame->Return = (ULONG)KiThreadStartup; CtxSwitchFrame->R11 = (ULONG)(ExceptionFrame ? ExceptionFrame : CtxSwitchFrame); // @@ -141,7 +141,7 @@ CtxSwitchFrame->R5 = (ULONG)StartContext; CtxSwitchFrame->R6 = (ULONG)StartRoutine; CtxSwitchFrame->R7 = (ULONG)SystemRoutine; - + // // Save back the new value of the kernel stack // @@ -221,7 +221,7 @@ ARM_TTB_REGISTER TtbRegister; /* We are on the new thread stack now */ - NewThread = Pcr->PrcbData.CurrentThread; + NewThread = Pcr->Prcb.CurrentThread; /* Now we are the new thread. Check if it's in a new process */ OldProcess = OldThread->ApcState.Process; @@ -236,11 +236,8 @@ /* Increase thread context switches */ NewThread->ContextSwitches++; - /* Load data from switch frame */ - Pcr->NtTib.ExceptionList = SwitchFrame->ExceptionList; - /* DPCs shouldn't be active */ - if (Pcr->PrcbData.DpcRoutineActive) + if (Pcr->Prcb.DpcRoutineActive) { /* Crash the machine */ KeBugCheckEx(ATTEMPTED_SWITCH_FROM_DPC, @@ -276,20 +273,21 @@ /* Save APC bypass disable */ SwitchFrame->ApcBypassDisable = OldThreadAndApcFlag & 3; - SwitchFrame->ExceptionList = Pcr->NtTib.ExceptionList; /* Increase context switch count and check if tracing is enabled */ - Pcr->ContextSwitches++; + Pcr->Prcb.KeContextSwitches++; +#if 0 if (Pcr->PerfGlobalGroupMask) { /* We don't support this yet on x86 either */ DPRINT1("WMI Tracing not supported\n"); ASSERT(FALSE); } +#endif // 0 /* Get thread pointers */ OldThread = (PKTHREAD)(OldThreadAndApcFlag & ~3); - NewThread = Pcr->PrcbData.CurrentThread; + NewThread = Pcr->Prcb.CurrentThread; /* Get the old thread and set its kernel stack */ OldThread->KernelStack = SwitchFrame; @@ -303,8 +301,7 @@ KiDispatchInterrupt(VOID) { PKIPCR Pcr = (PKIPCR)KeGetPcr(); - PKPRCB Prcb = &Pcr->PrcbData; - PVOID OldHandler; + PKPRCB Prcb = &Pcr->Prcb; PKTHREAD NewThread, OldThread; /* Disable interrupts */ @@ -315,17 +312,10 @@ (Prcb->TimerRequest) || (Prcb->DeferredReadyListHead.Next)) { - /* Switch to safe execution context */ - OldHandler = Pcr->NtTib.ExceptionList; - Pcr->NtTib.ExceptionList = EXCEPTION_CHAIN_END; - /* Retire DPCs while under the DPC stack */ //KiRetireDpcListInDpcStack(Prcb, Prcb->DpcStack); // FIXME!!! // KiRetireDpcList(Prcb); - - /* Restore context */ - Pcr->NtTib.ExceptionList = OldHandler; } /* Re-enable interrupts */ @@ -339,7 +329,7 @@ KiQuantumEnd(); } else if (Prcb->NextThread) - { + { /* Capture current thread data */ OldThread = Prcb->CurrentThread; NewThread = Prcb->NextThread; Modified: trunk/reactos/ntoskrnl/ke/arm/trapc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/trapc.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/trapc.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/trapc.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -9,7 +9,6 @@ /* INCLUDES *******************************************************************/ #include <ntoskrnl.h> -#include <internal/arm/ksarm.h> #define NDEBUG #include <debug.h> @@ -22,13 +21,13 @@ PKPCR Pcr = (PKPCR)KeGetPcr(); PKPRCB Prcb = Pcr->Prcb; PKTHREAD OldThread, NewThread; - + // // Loop forever... that's why this is an idle loop // DPRINT1("[IDLE LOOP]\n"); while (TRUE); - + while (TRUE) { // @@ -36,7 +35,7 @@ // _disable(); _enable(); - + // // Check if there's DPC work to do // @@ -48,13 +47,13 @@ // Clear the pending interrupt // HalClearSoftwareInterrupt(DISPATCH_LEVEL); - + // // Retire DPCs // KiRetireDpcList(Prcb); } - + // // Check if there's a thread to schedule // @@ -64,15 +63,15 @@ // Out with the old, in with the new... // OldThread = Prcb->CurrentThread; - NewThread = Prcb->NextThread; + NewThread = Prcb->NextThread; Prcb->CurrentThread = NewThread; Prcb->NextThread = NULL; - + // // Update thread state // NewThread->State = Running; - + // // Swap to the new thread // On ARM we call KiSwapContext instead of KiSwapContextInternal, @@ -101,19 +100,19 @@ DPRINT1("Swapping from: %p (%16s) to %p (%16s)\n", OldProcess, ((PEPROCESS)OldProcess)->ImageFileName, NewProcess, ((PEPROCESS)NewProcess)->ImageFileName); - + // // Update the page directory base // TtbRegister.AsUlong = NewProcess->DirectoryTableBase[0]; ASSERT(TtbRegister.Reserved == 0); KeArmTranslationTableRegisterSet(TtbRegister); - + // // FIXME: Flush the TLB // - - + + DPRINT1("Survived!\n"); while (TRUE); } @@ -126,15 +125,15 @@ PKIPCR Pcr = (PKIPCR)KeGetPcr(); PKPRCB Prcb = Pcr->Prcb; PKPROCESS OldProcess, NewProcess; - + DPRINT1("SWAP\n"); while (TRUE); - + // // Increase context switch count // Pcr->ContextSwitches++; - + // // Check if WMI tracing is enabled // @@ -146,7 +145,7 @@ DPRINT1("WMI Tracing not supported\n"); ASSERT(FALSE); } - + // // Check if the processes are also different // @@ -167,7 +166,7 @@ ASSERT(FALSE); } } - + // // Increase thread context switches // @@ -199,7 +198,7 @@ (ULONG_PTR)OldThread->InitialStack, 0); } - + // // Kernel APCs may be pending // @@ -217,7 +216,7 @@ return TRUE; } } - + // // Return // @@ -231,20 +230,20 @@ KPROCESSOR_MODE PreviousMode; KEXCEPTION_FRAME ExceptionFrame; PKTRAP_FRAME TrapFrame = KeGetCurrentThread()->TrapFrame; - + DPRINT1("[APC TRAP]\n"); while (TRUE); - + // // Isolate previous mode // PreviousMode = KiGetPreviousMode(TrapFrame); - + // // FIXME-USER: Handle APC interrupt while in user-mode // if (PreviousMode == UserMode) ASSERT(FALSE); - + // // Disable interrupts // @@ -254,12 +253,12 @@ // Clear APC interrupt // HalClearSoftwareInterrupt(APC_LEVEL); - + // // Re-enable interrupts // _enable(); - + // // Deliver APCs // @@ -273,17 +272,17 @@ PKIPCR Pcr; PKPRCB Prcb; PKTHREAD NewThread, OldThread; - + DPRINT1("[DPC TRAP]\n"); while (TRUE); - + // // Get the PCR and disable interrupts // Pcr = (PKIPCR)KeGetPcr(); Prcb = Pcr->Prcb; _disable(); - + // //Check if we have to deliver DPCs, timers, or deferred threads // @@ -296,12 +295,12 @@ // KiRetireDpcList(Prcb); } - + // // Re-enable interrupts // _enable(); - + // // Check for quantum end // @@ -314,12 +313,12 @@ KiQuantumEnd(); return; } - + // // Check if we have a thread to swap to // if (Prcb->NextThread) - { + { // // Next is now current // @@ -327,18 +326,18 @@ NewThread = Prcb->NextThread; Prcb->CurrentThread = NewThread; Prcb->NextThread = NULL; - + // // Update thread states // NewThread->State = Running; OldThread->WaitReason = WrDispatchInt; - + // // Make the old thread ready // KxQueueReadyThread(OldThread, Prcb); - + // // Swap to the new thread // On ARM we call KiSwapContext instead of KiSwapContextInternal, @@ -355,23 +354,23 @@ IN ULONG Reserved) { KIRQL OldIrql, Irql; - ULONG InterruptCause, InterruptMask; + ULONG InterruptCause;//, InterruptMask; PKIPCR Pcr; PKTRAP_FRAME OldTrapFrame; - ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00); + ASSERT(TrapFrame->Reserved == 0xBADB0D00); // // Increment interrupt count // Pcr = (PKIPCR)KeGetPcr(); - Pcr->Prcb->InterruptCount++; - + Pcr->Prcb.InterruptCount++; + // // Get the old IRQL // OldIrql = KeGetCurrentIrql(); - TrapFrame->OldIrql = OldIrql; - + TrapFrame->PreviousIrql = OldIrql; + // // Get the interrupt source // @@ -381,14 +380,17 @@ // // Get the new IRQL and Interrupt Mask // - Irql = Pcr->IrqlMask[InterruptCause]; - InterruptMask = Pcr->IrqlTable[Irql]; - + /// FIXME: use a global table in ntoskrnl instead of HAL? + //Irql = Pcr->IrqlMask[InterruptCause]; + //InterruptMask = Pcr->IrqlTable[Irql]; + Irql = 0; + __debugbreak(); + // // Raise to the new IRQL // KfRaiseIrql(Irql); - + // // The clock ISR wants the trap frame as a parameter // @@ -399,7 +401,7 @@ // Check if this interrupt is at DISPATCH or higher // if (Irql > DISPATCH_LEVEL) - { + { // // FIXME-TODO: Switch to interrupt stack // @@ -417,11 +419,13 @@ // // Call the registered interrupt routine // - Pcr->InterruptRoutine[Irql](); + /// FIXME: this should probably go into a table in ntoskrnl + //Pcr->InterruptRoutine[Irql](); + __debugbreak(); ASSERT(KeGetCurrentThread()->TrapFrame == TrapFrame); KeGetCurrentThread()->TrapFrame = OldTrapFrame; // DPRINT1("[ISR RETURN]\n"); - + // // Restore IRQL and interrupts // @@ -433,15 +437,15 @@ KiPrefetchAbortHandler(IN PKTRAP_FRAME TrapFrame) { PVOID Address = (PVOID)KeArmFaultAddressRegisterGet(); - ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00); + ASSERT(TrapFrame->Reserved == 0xBADB0D00); ULONG Instruction = *(PULONG)TrapFrame->Pc; ULONG DebugType, Parameter0; EXCEPTION_RECORD ExceptionRecord; - + DPRINT1("[PREFETCH ABORT] (%x) @ %p/%p/%p\n", - KeArmInstructionFaultStatusRegisterGet(), Address, TrapFrame->SvcLr, TrapFrame->Pc); - while (TRUE); - + KeArmInstructionFaultStatusRegisterGet(), Address, TrapFrame->Lr, TrapFrame->Pc); + while (TRUE); + // // What we *SHOULD* do is look at the instruction fault status register // and see if it's equal to 2 (debug trap). Unfortunately QEMU doesn't seem @@ -469,7 +473,7 @@ // Parameter0 = STATUS_SUCCESS; } - + // // Build the exception record // @@ -478,14 +482,14 @@ ExceptionRecord.ExceptionRecord = NULL; ExceptionRecord.ExceptionAddress = (PVOID)TrapFrame->Pc; ExceptionRecord.NumberParameters = 3; - + // // Build the parameters // ExceptionRecord.ExceptionInformation[0] = Parameter0; ExceptionRecord.ExceptionInformation[1] = TrapFrame->R1; ExceptionRecord.ExceptionInformation[2] = TrapFrame->R2; - + // // Dispatch the exception // @@ -500,7 +504,7 @@ // return STATUS_SUCCESS; } - + // // Unhandled // @@ -514,12 +518,12 @@ { NTSTATUS Status; PVOID Address = (PVOID)KeArmFaultAddressRegisterGet(); - ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00); - + ASSERT(TrapFrame->Reserved == 0xBADB0D00); + DPRINT1("[ABORT] (%x) @ %p/%p/%p\n", - KeArmFaultStatusRegisterGet(), Address, TrapFrame->SvcLr, TrapFrame->Pc); - while (TRUE); - + KeArmFaultStatusRegisterGet(), Address, TrapFrame->Lr, TrapFrame->Pc); + while (TRUE); + // // Check if this is a page fault // @@ -546,33 +550,33 @@ PKTHREAD Thread; KPROCESSOR_MODE PreviousMode; ULONG Instruction; - ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00); - - DPRINT1("[SWI] @ %p/%p\n", TrapFrame->SvcLr, TrapFrame->Pc); - while (TRUE); - + ASSERT(TrapFrame->Reserved == 0xBADB0D00); + + DPRINT1("[SWI] @ %p/%p\n", TrapFrame->Lr, TrapFrame->Pc); + while (TRUE); + // // Get the current thread // Thread = KeGetCurrentThread(); - + // // Isolate previous mode // PreviousMode = KiGetPreviousMode(TrapFrame); - + // // Save old previous mode // TrapFrame->PreviousMode = PreviousMode; - TrapFrame->PreviousTrapFrame = (ULONG_PTR)Thread->TrapFrame; - + TrapFrame->TrapFrame = (ULONG_PTR)Thread->TrapFrame; + // // Save previous mode and trap frame // Thread->TrapFrame = TrapFrame; Thread->PreviousMode = PreviousMode; - + // // Read the opcode // @@ -587,12 +591,12 @@ NTSTATUS KiUndefinedExceptionHandler(IN PKTRAP_FRAME TrapFrame) { - ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00); - + ASSERT(TrapFrame->Reserved == 0xBADB0D00); + // // This should never happen // - DPRINT1("[UNDEF] @ %p/%p\n", TrapFrame->SvcLr, TrapFrame->Pc); + DPRINT1("[UNDEF] @ %p/%p\n", TrapFrame->Lr, TrapFrame->Pc); UNIMPLEMENTED; ASSERT(FALSE); return STATUS_SUCCESS; Modified: trunk/reactos/ntoskrnl/ke/arm/usercall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/usercall.c…
============================================================================== --- trunk/reactos/ntoskrnl/ke/arm/usercall.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/arm/usercall.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -9,7 +9,6 @@ /* INCLUDES *******************************************************************/ #include <ntoskrnl.h> -#include <internal/arm/ksarm.h> #define NDEBUG #include <debug.h> @@ -92,20 +91,20 @@ PVOID* Argument; PVOID Arguments[0x11]; // Maximum 17 arguments KIRQL OldIrql; - ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00); - + ASSERT(TrapFrame->Reserved == 0xBADB0D00); + // // Increase count of system calls // - Pcr = (PKPCR)KeGetPcr(); - Pcr->Prcb->KeSystemCalls++; - + Pcr = KeGetPcr(); + Pcr->CurrentPrcb->KeSystemCalls++; + // // Get the system call ID // Id = Instruction & 0xFFFFF; //DPRINT1("[SWI] (%x) %p (%d) \n", Id, Thread, Thread->PreviousMode); - + // // Get the descriptor table // @@ -113,7 +112,7 @@ Offset = ((Id >> SERVICE_TABLE_SHIFT) & SERVICE_TABLE_MASK); ServiceTable += Offset; DescriptorTable = (PVOID)ServiceTable; - + // // Get the service call number and validate it // @@ -126,12 +125,12 @@ UNIMPLEMENTED; ASSERT(FALSE); } - + // // Save the function responsible for handling this system call // SystemCall = (PVOID)DescriptorTable->Base[Number]; - + // // Check if this is a GUI call // @@ -143,13 +142,13 @@ UNIMPLEMENTED; ASSERT(FALSE); } - + // // Check how many arguments this system call takes // ArgumentCount = DescriptorTable->Number[Number] / 4; ASSERT(ArgumentCount <= 17); - + // // Copy the register-arguments first // First four arguments are in a1, a2, a3, a4 @@ -163,7 +162,7 @@ Arguments[i] = *Argument; Argument++; } - + // // If more than four, we'll have some on the user stack // @@ -178,7 +177,7 @@ // FIXME-USER: Validate the user stack // ASSERT(FALSE); - Argument = (PVOID*)TrapFrame->UserSp; + Argument = (PVOID*)TrapFrame->Sp; } else { @@ -200,18 +199,18 @@ Argument++; } } - + // // We can safely enable interrupts here // _enable(); - + // // Do the system call and save result in EAX // TrapFrame->R0 = KiSyscallHandlers[ArgumentCount]((PVOID)SystemCall, (PVOID)Arguments); - + // // Check if this was a user call // @@ -226,9 +225,9 @@ // // Forcibly put us in a sane state // - KeGetPcr()->Irql = 0; + KeGetPcr()->CurrentIrql = 0; _disable(); - + // // Fail // @@ -238,7 +237,7 @@ 0, 0); } - + // // Make sure we're not attached and that APCs are not disabled // @@ -255,11 +254,11 @@ 0); } } - + // // Restore the old trap frame // - Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->PreviousTrapFrame; + Thread->TrapFrame = KiGetLinkedTrapFrame(TrapFrame); } VOID @@ -275,19 +274,19 @@ ULONG_PTR Stack; ULONG ContextLength; DPRINT1("User APC: %p %p %p\n", NormalContext, SystemArgument1, SystemArgument2); - + // // Build the user mode context // Context.ContextFlags = CONTEXT_FULL; KeTrapFrameToContext(TrapFrame, ExceptionFrame, &Context); - + // // Setup the context on the user stack // ContextLength = sizeof(CONTEXT); Stack = (ULONG_PTR)(Context.Sp & ~7) - ContextLength; - + // // Make sure the stack is valid, and copy the context // @@ -301,7 +300,40 @@ TrapFrame->R1 = (ULONG)SystemArgument1; TrapFrame->R2 = (ULONG)SystemArgument2; TrapFrame->R3 = (ULONG)NormalRoutine; - TrapFrame->R8 = Stack; - TrapFrame->UserSp = Stack; - TrapFrame->UserLr = (ULONG)KeUserApcDispatcher; -} + TrapFrame->Sp = Stack; + TrapFrame->Lr = (ULONG)KeUserApcDispatcher; +} + +NTSTATUS +NTAPI +KeUserModeCallback(IN ULONG RoutineIndex, + IN PVOID Argument, + IN ULONG ArgumentLength, + OUT PVOID *Result, + OUT PULONG ResultLength) +{ + NT_ASSERT(FALSE); + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +KiCallUserMode( + IN PVOID *OutputBuffer, + IN PULONG OutputLength) +{ + NT_ASSERT(FALSE); + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +NtCallbackReturn( + _In_ PVOID Result, + _In_ ULONG ResultLength, + _In_ NTSTATUS CallbackStatus) +{ + NT_ASSERT(FALSE); + return STATUS_NOT_IMPLEMENTED; +} + Modified: trunk/reactos/ntoskrnl/ke/ipi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/ipi.c?rev=6773…
============================================================================== --- trunk/reactos/ntoskrnl/ke/ipi.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/ipi.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -167,6 +167,9 @@ if (InterlockedBitTestAndReset((PLONG)&Prcb->IpiFrozen, IPI_SYNCH_REQUEST)) { +#ifdef _M_ARM + DbgBreakPoint(); +#else (void)InterlockedDecrementUL(&Prcb->SignalDone->CurrentPacket[1]); if (InterlockedCompareExchangeUL(&Prcb->SignalDone->CurrentPacket[2], 0, 0)) { @@ -179,6 +182,7 @@ while (0 != InterlockedCompareExchangeUL(&Prcb->SignalDone->TargetSet, 0, 0)); } (void)InterlockedExchangePointer((PVOID*)&Prcb->SignalDone, NULL); +#endif // _M_ARM } #endif return TRUE; Modified: trunk/reactos/ntoskrnl/ke/thrdobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/thrdobj.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ke/thrdobj.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/thrdobj.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -530,7 +530,12 @@ NodePrcb = KiProcessorBlock[Process->ThreadSeed]; /* Calculate affinity mask */ +#ifdef _M_ARM + DbgBreakPoint(); + Set = 0; +#else Set = ~NodePrcb->MultiThreadProcessorSet; +#endif Mask = (ULONG)(Node->ProcessorMask & Process->Affinity); Set &= Mask; if (Set) Mask = Set; Modified: trunk/reactos/ntoskrnl/ke/thrdschd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/thrdschd.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/thrdschd.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/thrdschd.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -725,7 +725,7 @@ #elif _M_AMD64 #define KiGetCurrentReadySummary() __readgsdword(FIELD_OFFSET(KIPCR, Prcb.ReadySummary)) #else -#error Implement me! +#define KiGetCurrentReadySummary() KeGetCurrentPrcb()->ReadySummary #endif /* Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -1555,6 +1555,10 @@ DbgPrint("MM:***RIP %p, EFL %p\n", TrapFrame->Rip, TrapFrame->EFlags); DbgPrint("MM:***RAX %p, RCX %p RDX %p\n", TrapFrame->Rax, TrapFrame->Rcx, TrapFrame->Rdx); DbgPrint("MM:***RBX %p, RSI %p RDI %p\n", TrapFrame->Rbx, TrapFrame->Rsi, TrapFrame->Rdi); +#elif defined(_M_ARM) + DbgPrint("MM:***PC %p\n", TrapFrame->Pc); + DbgPrint("MM:***R0 %p, R1 %p R2 %p, R3 %p\n", TrapFrame->R0, TrapFrame->R1, TrapFrame->R2, TrapFrame->R3); + DbgPrint("MM:***R11 %p, R12 %p SP %p, LR %p\n", TrapFrame->R11, TrapFrame->R12, TrapFrame->Sp, TrapFrame->Lr); #endif } Modified: trunk/reactos/ntoskrnl/mm/arm/page.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/arm/page.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/mm/arm/page.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/arm/page.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -117,6 +117,10 @@ /* Template PTE for prototype page */ MMPTE PrototypePte = {.u.Long = (MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS) | PTE_PROTOTYPE | (MI_PTE_LOOKUP_NEEDED << PAGE_SHIFT)}; +MMPTE ValidKernelPteLocal = {{0}}; +MMPDE ValidKernelPdeLocal = {{0}}; +MMPTE MmDecommittedPte = {{0}}; + /* PRIVATE FUNCTIONS **********************************************************/ VOID @@ -290,3 +294,29 @@ } } +VOID +NTAPI +MmGetPageFileMapping( + PEPROCESS Process, + PVOID Address, + SWAPENTRY* SwapEntry) +{ + NT_ASSERT(FALSE); +} + +BOOLEAN +NTAPI +MmIsDisabledPage(PEPROCESS Process, PVOID Address) +{ + NT_ASSERT(FALSE); + return FALSE; +} + +VOID +NTAPI +INIT_FUNCTION +MiInitializeSessionSpaceLayout(VOID) +{ + NT_ASSERT(FALSE); +} + Modified: trunk/reactos/ntoskrnl/rtl/libsupp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/rtl/libsupp.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] Thu May 14 22:31:58 2015 @@ -506,7 +506,7 @@ #endif -#ifdef _AMD64_ +#if defined(_M_AMD64) || defined(_M_ARM) VOID NTAPI RtlpGetStackLimits(
9 years, 7 months
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
50
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
Results per page:
10
25
50
100
200