Merge trunk head (46467)
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 26 Mar 2010 15:47:53 +0000 (15:47 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 26 Mar 2010 15:47:53 +0000 (15:47 +0000)
svn path=/branches/ros-amd64-bringup/; revision=46468

20 files changed:
1  2  3  4 
reactos/ReactOS-i386.rbuild
reactos/boot/bootdata/bootcd/bootcd.rbuild
reactos/boot/bootdata/livecd/livecd.rbuild
reactos/dll/win32/gdi32/objects/bitmap.c
reactos/dll/win32/kernel32/thread/fiber.c
reactos/drivers/bus/acpi/cmbatt/cmexec.c
reactos/drivers/storage/ide/uniata/bsmaster.h
reactos/drivers/storage/ide/uniata/id_ata.cpp
reactos/hal/hal.rbuild
reactos/hal/halx86/generic/misc.c
reactos/hal/halx86/hal_generic.rbuild
reactos/hal/halx86/hal_generic_up.rbuild
reactos/hal/halx86/include/halp.h
reactos/include/ndk/pstypes.h
reactos/include/psdk/windef.h
reactos/include/psdk/wingdi.h
reactos/include/psdk/winnt.h
reactos/include/psdk/winuser.h
reactos/subsystems/subsystems.rbuild
reactos/tools/rbuild/backend/mingw/compilers/gcc.mak

Simple merge
@@@@@ -1,5 -1,12 -1,12 -1,12 +1,12 @@@@@
    <?xml version="1.0"?>
    <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-   <module name="bootcd" type="iso" output="ReactOS-$(ARCH).iso">
+   <if property="ARCH" value="i386>
+       <module name="bootcd" type="iso" output="ReactOS.iso">
 ---            <bootsector>isoboot</bootsector>
 ---    </module>
 +++    <bootsector>isoboot</bootsector>
 +++</module>
+   </if>
+   <ifnot property="ARCH" value="i386>
+       <module name="bootcd" type="iso" output="ReactOS-$(ARCH).iso">
+               <bootsector>isoboot</bootsector>
+       </module>
+   </ifnot>
@@@@@ -1,5 -1,12 -1,12 -1,12 +1,12 @@@@@
    <?xml version="1.0"?>
    <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-   <module name="livecd" type="liveiso" output="ReactOS-LiveCD-$(ARCH).iso">
+   <if property="ARCH" value="i386>
+       <module name="livecd" type="liveiso" output="ReactOS-LiveCD.iso">
 ---            <bootsector>isoboot</bootsector>
 ---    </module>
 +++    <bootsector>isoboot</bootsector>
 +++</module>
+   </if>
+   <ifnot property="ARCH" value="i386>
+       <module name="livecd" type="liveiso" output="ReactOS-LiveCD-$(ARCH).iso">
+               <bootsector>isoboot</bootsector>
+       </module>
+   </ifnot>
@@@@@ -80,38 -79,210 -79,210 -79,210 +80,210 @@@@@ GetStringElement(IN PACPI_METHOD_ARGUME
    
    NTSTATUS
    NTAPI
-   CmBattGetPsrData(PDEVICE_OBJECT DeviceObject,
-                    PULONG PsrData)
+   CmBattSendDownStreamIrp(IN PDEVICE_OBJECT DeviceObject,
+                           IN ULONG IoControlCode,
+                           IN PVOID InputBuffer,
+                           IN ULONG InputBufferLength,
+                           IN PACPI_EVAL_OUTPUT_BUFFER OutputBuffer,
+                           IN ULONG OutputBufferLength)
    {
-       UNIMPLEMENTED;
-       return STATUS_NOT_IMPLEMENTED; 
+       PIRP Irp;
+       NTSTATUS Status;
+       KEVENT Event;
+       IO_STATUS_BLOCK IoStatusBlock;
+       PAGED_CODE();
+   
+       /* Initialize our wait event */
+       KeInitializeEvent(&Event, SynchronizationEvent, 0);
+       
+       /* Allocate the IRP */
+       Irp = IoBuildDeviceIoControlRequest(IoControlCode,
+                                           DeviceObject,
+                                           InputBuffer,
+                                           InputBufferLength,
+                                           OutputBuffer,
+                                           OutputBufferLength,
+                                           0,
+                                           &Event,
+                                           &IoStatusBlock);
+       if (!Irp)
+       {
+           /* No IRP, fail */
+           if (CmBattDebug & 0x4C)
+               DbgPrint("CmBattSendDownStreamIrp: Failed to allocate Irp\n");
+           return STATUS_INSUFFICIENT_RESOURCES;
 ---    }
 --- 
++++}
++++
+       /* Call ACPI */
+       if (CmBattDebug & 0x40)
+           DbgPrint("CmBattSendDownStreamIrp: Irp %x [Tid] %x\n",
+                    Irp, KeGetCurrentThread());
+       Status = IoCallDriver(DeviceObject, Irp);
+       if (Status == STATUS_PENDING)
+       {
+           /* Wait for completion */
+           KeWaitForSingleObject(&Event,
+                                 Executive,
+                                 KernelMode,
+                                 FALSE,
+                                 NULL);
+           Status = Irp->IoStatus.Status;
+       }
+       
+       /* Check if caller wanted output */
+       if (OutputBuffer)
+       {
+           /* Make sure it's valid ACPI output buffer */
+           if ((OutputBuffer->Signature != ACPI_EVAL_OUTPUT_BUFFER_SIGNATURE) ||
+               !(OutputBuffer->Count))
+           {
+               /* It isn't, so set failure code */
+               Status = STATUS_ACPI_INVALID_DATA;
+           }
+       }
+       
+       /* Return status */
+       if (CmBattDebug & 0x40)
+           DbgPrint("CmBattSendDownStreamIrp: Irp %x completed %x! [Tid] %x\n",
+                    Irp, Status, KeGetCurrentThread());
+       return Status;
    }
    
    NTSTATUS
    NTAPI
-   CmBattGetBifData(PCMBATT_DEVICE_EXTENSION DeviceExtension,
-                    PACPI_BIF_DATA BifData)
+   CmBattGetPsrData(IN PDEVICE_OBJECT DeviceObject,
+                    OUT PULONG PsrData)
    {
-       UNIMPLEMENTED;
-       return STATUS_NOT_IMPLEMENTED;
+       NTSTATUS Status;
+       ACPI_EVAL_OUTPUT_BUFFER OutputBuffer;
+       ACPI_EVAL_INPUT_BUFFER InputBuffer;
+       PAGED_CODE();
+       if (CmBattDebug & 0x40)
+           DbgPrint("CmBattGetPsrData: Entered with Pdo %x Tid %x\n",
+                    DeviceObject, KeGetCurrentThread());
+       
+       /* Initialize to zero */
+       ASSERT(PsrData != NULL);
+       *PsrData = 0;
+         
+       /* Request the _PSR method */
+       *(PULONG)InputBuffer.MethodName = 'RSP_';
+       InputBuffer.Signature = ACPI_EVAL_INPUT_BUFFER_SIGNATURE;
+   
+       /* Send it to ACPI */
+       Status = CmBattSendDownStreamIrp(DeviceObject,
+                                        IOCTL_ACPI_EVAL_METHOD,
+                                        &InputBuffer,
+                                        sizeof(InputBuffer),
+                                        &OutputBuffer,
+                                        sizeof(OutputBuffer));
+       if (NT_SUCCESS(Status))
+       {
+           /* Read the result */
+           Status = GetDwordElement(OutputBuffer.Argument, PsrData);
+           if (CmBattDebug & 0x440)
+               DbgPrint("CmBattGetPsrData: _PSR method returned %x \n", *PsrData);
 ---    }
++++}
+       else if (CmBattDebug & 0x44C)
+       {
+           /* Failure */
+           DbgPrint("CmBattGetPsrData: Failed _PSR method - Status (0x%x)\n", Status);
+       }
 ---    
++++
+       /* Return status */
+       return Status;
    }
    
    NTSTATUS
    NTAPI
-   CmBattGetBstData(PCMBATT_DEVICE_EXTENSION DeviceExtension,
-                    PACPI_BST_DATA BstData)
+   CmBattGetStaData(IN PDEVICE_OBJECT DeviceObject,
+                    OUT PULONG StaData)
    {
-       UNIMPLEMENTED;
-       return STATUS_NOT_IMPLEMENTED;
+       NTSTATUS Status;
+       ACPI_EVAL_OUTPUT_BUFFER OutputBuffer;
+       ACPI_EVAL_INPUT_BUFFER InputBuffer;
+       PAGED_CODE();
+       if (CmBattDebug & 0x40)
+           DbgPrint("CmBattGetStaData: Entered with Pdo %x Tid %x\n",
+                    DeviceObject, KeGetCurrentThread());
+       
+       /* Initialize to zero */
+       ASSERT(StaData != NULL);
+       *StaData = 0;
+         
+       /* Request the _PSR method */
+       *(PULONG)InputBuffer.MethodName = 'ATS_';
+       InputBuffer.Signature = ACPI_EVAL_INPUT_BUFFER_SIGNATURE;
+   
+       /* Send it to ACPI */
+       Status = CmBattSendDownStreamIrp(DeviceObject,
+                                        IOCTL_ACPI_EVAL_METHOD,
+                                        &InputBuffer,
+                                        sizeof(InputBuffer),
+                                        &OutputBuffer,
+                                        sizeof(OutputBuffer));
+       if (NT_SUCCESS(Status))
+       {
+           /* Read the result */
+           Status = GetDwordElement(OutputBuffer.Argument, StaData);
+           if (CmBattDebug & 0x440)
+               DbgPrint("CmBattGetStaData: _STA method returned %x \n", *StaData);
 ---    }
 +++}   
+       else if (CmBattDebug & 0x44C)
+       {
+           /* Failure */
+           DbgPrint("CmBattGetStaData: Failed _STA method - Status (0x%x)\n", Status);
+           Status = STATUS_NO_SUCH_DEVICE;
+       }
 ---    
++++
+       /* Return status */
+       return Status;
+   }
    
    NTSTATUS
    NTAPI
-   CmBattGetStaData(PDEVICE_OBJECT DeviceObject,
-                    PULONG StaData)
+   CmBattGetUniqueId(IN PDEVICE_OBJECT DeviceObject,
+                     OUT PULONG UniqueId)
    {
-       UNIMPLEMENTED;
-       return STATUS_NOT_IMPLEMENTED;
+       NTSTATUS Status;
+       ACPI_EVAL_OUTPUT_BUFFER OutputBuffer;
+       ACPI_EVAL_INPUT_BUFFER InputBuffer;
+       PAGED_CODE();
+       if (CmBattDebug & 0x40)
+           DbgPrint("CmBattGetUniqueId: Entered with Pdo %x Tid %x\n",
+                    DeviceObject, KeGetCurrentThread());
+       
+       /* Initialize to zero */
+       ASSERT(UniqueId != NULL);
+       *UniqueId = 0;
+         
+       /* Request the _PSR method */
+       *(PULONG)InputBuffer.MethodName = 'DIU_';
+       InputBuffer.Signature = ACPI_EVAL_INPUT_BUFFER_SIGNATURE;
+   
+       /* Send it to ACPI */
+       Status = CmBattSendDownStreamIrp(DeviceObject,
+                                        IOCTL_ACPI_EVAL_METHOD,
+                                        &InputBuffer,
+                                        sizeof(InputBuffer),
+                                        &OutputBuffer,
+                                        sizeof(OutputBuffer));
+       if (NT_SUCCESS(Status))
+       {
+           /* Read the result */
+           Status = GetDwordElement(OutputBuffer.Argument, UniqueId);
+           if (CmBattDebug & 0x440)
+               DbgPrint("CmBattGetUniqueId: _UID method returned %x \n", *UniqueId);
 ---    }
++++}
+       else if (CmBattDebug & 0x44C)
+       {
+           /* Failure */
+           DbgPrint("CmBattGetUniqueId: Failed _UID method - Status (0x%x)\n", Status);
+           Status = STATUS_NO_SUCH_DEVICE;
+       }
 ---    
++++
+       /* Return status */
+       return Status;
    }
    
    NTSTATUS
@@@@@ -134,72 -328,11 -328,11 -328,11 +329,68 @@@@@ CmBattGetBifData(PCMBATT_DEVICE_EXTENSI
    
    NTSTATUS
    NTAPI
-   CmBattSendDownStreamIrp(IN PDEVICE_OBJECT DeviceObject,
-                           IN ULONG IoControlCode,
-                           IN PVOID InputBuffer,
-                           IN ULONG InputBufferLength,
-                           IN PACPI_EVAL_OUTPUT_BUFFER OutputBuffer,
-                           IN ULONG OutputBufferLength)
+   CmBattGetBstData(PCMBATT_DEVICE_EXTENSION DeviceExtension,
+                    PACPI_BST_DATA BstData)
    {
 ---    UNIMPLEMENTED;
 ---    return STATUS_NOT_IMPLEMENTED;
 ---}
 +++    PIRP Irp;
 +++    NTSTATUS Status;
 +++    KEVENT Event;
 +++    IO_STATUS_BLOCK IoStatusBlock;
 +++    PAGED_CODE();
 +++
 +++    /* Initialize our wait event */
 +++    KeInitializeEvent(&Event, SynchronizationEvent, 0);
 +++    
 +++    /* Allocate the IRP */
 +++    Irp = IoBuildDeviceIoControlRequest(IoControlCode,
 +++                                        DeviceObject,
 +++                                        InputBuffer,
 +++                                        InputBufferLength,
 +++                                        OutputBuffer,
 +++                                        OutputBufferLength,
 +++                                        0,
 +++                                        &Event,
 +++                                        &IoStatusBlock);
 +++    if (!Irp)
 +++    {
 +++        /* No IRP, fail */
 +++        if (CmBattDebug & 0x4C)
 +++            DbgPrint("CmBattSendDownStreamIrp: Failed to allocate Irp\n");
 +++        return STATUS_INSUFFICIENT_RESOURCES;
 +++    }
-    
+   
 +++    /* Call ACPI */
 +++   if (CmBattDebug & 0x40)
 +++       DbgPrint("CmBattSendDownStreamIrp: Irp %x [Tid] %x\n", Irp, KeGetCurrentThread());
 +++    Status = IoCallDriver(DeviceObject, Irp);
 +++    if (Status == STATUS_PENDING)
 +++    {
 +++        /* Wait for completion */
 +++        KeWaitForSingleObject(&Event,
 +++                              Executive,
 +++                              KernelMode,
 +++                              FALSE,
 +++                              NULL);
 +++        Status = Irp->IoStatus.Status;
 +++    }
 +++    
 +++    /* Check if caller wanted output */
 +++    if (OutputBuffer)
 +++    {
 +++        /* Make sure it's valid ACPI output buffer */
 +++        if ((OutputBuffer->Signature != ACPI_EVAL_OUTPUT_BUFFER_SIGNATURE) ||
 +++            !(OutputBuffer->Count))
 +++        {
 +++            /* It isn't, so set failure code */
 +++            Status = STATUS_ACPI_INVALID_DATA;
 +++        }
 +++    }
 +++    
 +++    /* Return status */
 +++    if (CmBattDebug & 0x40)
 +++      DbgPrint("CmBattSendDownStreamIrp: Irp %x completed %x! [Tid] %x\n",
 +++               Irp, Status, KeGetCurrentThread());
 +++    return Status;
 +++}
 +++     
    /* EOF */
Simple merge
Simple merge
                                <file>sysbus.c</file>
                        </directory>
                        <file>beep.c</file>
 ---                    <file>bios.c</file>
                        <file>cmos.c</file>
+                       <file>display.c</file>
                        <file>dma.c</file>
                        <file>drive.c</file>
-                       <file>display.c</file>
+                       <file>halinit.c</file>
+                       <file>misc.c</file>
                        <file>profil.c</file>
                        <file>reboot.c</file>
                        <file>sysinfo.c</file>
                        <file>timer.c</file>
-                               <file>trap.S</file>
-                               <file>usage.c</file>
+                       <file>usage.c</file>
+                       <if property="ARCH" value="i386">
+                               <directory name="i386">
+                                       <file>portio.c</file>
+                                       <file>systimer.S</file>
 +++                    <if property="ARCH" value="i386">
 +++                            <file>bios.c</file>
 +++                            <file>halinit.c</file>
 +++                            <file>misc.c</file>
 +++                            <file>pic.c</file>
+                                       <file>trap.S</file>
 +++                            <directory name="i386">
 +++                                    <file>portio.c</file>
 +++                                    <file>systimer.S</file>
 +++                                    <file>v86.s</file>
                                </directory>
                        </if>
                        <if property="ARCH" value="amd64">
                                <directory name="i386">
                                        <file>portio.c</file>
                                        <file>systimer.S</file>
-                                       <file>v86.s</file>
                                </directory>
                        </if>
 +++                    <if property="ARCH" value="amd64">
 +++                            <directory name="amd64">
 +++                                    <file>halinit.c</file>
 +++                                    <file>irq.S</file>
 +++                                    <file>misc.c</file>
 +++                                    <file>apic.c</file>
 +++                                    <file>systimer.S</file>
 +++                                    <file>usage.c</file>
 +++                            </directory>
 +++                    </if>
                </directory>
                <directory name="up">
                        <file>halinit_up.c</file>
@@@@@ -9,11 -9,9 -9,9 -9,9 +9,15 @@@@@
                <directory name="generic">
                        <file>spinlock.c</file>
                </directory>
+               <directory name="up">
+                       <file>pic.c</file>
+                       <file>processor.c</file>
+               </directory>
 +++            <directory name="up">
 +++                    <file>processor.c</file>
 +++                    <if property="ARCH" value="i386">
 +++                            <file>irq.S</file>
 +++                    </if>
 +++            </directory>
        </module>
    </group>
@@@@@ -681,10 -681,16 -681,16 -681,16 +681,19 @@@@@ HalpReleaseCmosSpinLock
        VOID
    );
    
 +++VOID
 +++NTAPI
 +++HalpSetInterruptGate(ULONG Index, PVOID Address);
    
+   
+   VOID
+   FASTCALL
+   KeUpdateSystemTime(
+       IN PKTRAP_FRAME TrapFrame,
+       IN ULONG Increment,
+       IN KIRQL OldIrql
+   );
+   
    #ifdef _M_AMD64
    #define KfLowerIrql KeLowerIrql
    #ifndef CONFIG_SMP
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
    <?xml version="1.0"?>
    <!DOCTYPE group SYSTEM "../tools/rbuild/project.dtd">
    <group xmlns:xi="http://www.w3.org/2001/XInclude">
-       <if property="USERMODE" value="1">
-               <if property="ARCH" value="i386">
+       <if property="ARCH" value="i386">
 - -<directory name="ntvdm">
 - -    <xi:include href="ntvdm/ntvdm.rbuild" />
 - -</directory>
  -             <directory name="ntvdm">
 +++                    <directory name="ntvdm">
 + +                    <xi:include href="ntvdm/ntvdm.rbuild" />
  -             </directory>
 +++                    </directory>
-               </if>
        </if>
-   
    <directory name="win32">
        <xi:include href="win32/win32.rbuild" />
    </directory>