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
December 2009
----- 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
22 participants
501 discussions
Start a n
N
ew thread
[tkreuzer] 44832: [HAL] some improvements
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 31 20:26:37 2009 New Revision: 44832 URL:
http://svn.reactos.org/svn/reactos?rev=44832&view=rev
Log: [HAL] some improvements Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/halinit.c branches/ros-amd64-bringup/reactos/hal/halamd64/include/halp.h branches/ros-amd64-bringup/reactos/hal/halamd64/up/processor.c Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/halinit.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/generic/halinit.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/generic/halinit.c [iso-8859-1] Thu Dec 31 20:26:37 2009 @@ -62,7 +62,7 @@ PKPRCB Prcb = KeGetCurrentPrcb(); /* Check the boot phase */ - if (!BootPhase) + if (BootPhase == 0) { /* Phase 0... save bus type */ HalpBusType = LoaderBlock->u.I386.MachineType & 0xFF; @@ -70,8 +70,8 @@ /* Get command-line parameters */ HalpGetParameters(LoaderBlock); +#if DBG /* Checked HAL requires checked kernel */ -#if DBG if (!(Prcb->BuildType & PRCB_BUILD_DEBUG)) { /* No match, bugcheck */ @@ -101,18 +101,21 @@ /* Validation failed, bugcheck */ KeBugCheckEx(MISMATCHED_HAL, 1, Prcb->MajorVersion, 1, 0); } -DPRINT1("HalInitSystem 2\n"); + + DPRINT1("HalInitSystem 1\n"); + /* Initialize the PICs */ HalpInitPICs(); -DPRINT1("HalInitSystem 3\n"); - /* Force initial PIC state */ - KfRaiseIrql(KeGetCurrentIrql()); -DPRINT1("HalInitSystem 4\n"); + + DPRINT1("HalInitSystem 2\n"); + /* Initialize the clock */ HalpInitializeClock(); -DPRINT1("HalInitSystem 5\n"); - /* Setup busy waiting */ - //HalpCalibrateStallExecution(); + + DPRINT1("HalInitSystem 3\n"); + + /* Calibrate counters */ +// HalpCalibrateCounters(); /* Fill out the dispatch tables */ HalQuerySystemInformation = HaliQuerySystemInformation; @@ -121,7 +124,9 @@ // HalGetDmaAdapter = HalpGetDmaAdapter; HalGetInterruptTranslator = NULL; // FIXME: TODO // HalResetDisplay = HalpBiosDisplayReset; -DPRINT1("HalInitSystem 6\n"); + + DPRINT1("HalInitSystem 4\n"); + /* Initialize the hardware lock (CMOS) */ KeInitializeSpinLock(&HalpSystemHardwareLock); @@ -134,11 +139,8 @@ //HalpInitBusHandler(); /* Enable the clock interrupt */ - PKIDTENTRY64 IdtEntry = &((PKIPCR)KeGetPcr())->IdtBase[0x30]; - IdtEntry->OffsetLow = (((ULONG_PTR)HalpClockInterrupt) & 0xFFFF); - IdtEntry->OffsetMiddle = (((ULONG_PTR)HalpClockInterrupt >> 16) & 0xFFFF); - IdtEntry->OffsetHigh = ((ULONG_PTR)HalpClockInterrupt >> 32); -// HalEnableSystemInterrupt(0x30, CLOCK_LEVEL, Latched); + HalpSetInterruptGate(0x30, HalpClockInterrupt); + HalEnableSystemInterrupt(0x30, CLOCK_LEVEL, Latched); /* Initialize DMA. NT does this in Phase 0 */ HalpInitDma(); Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/include/halp.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/include/halp.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/include/halp.h [iso-8859-1] Thu Dec 31 20:26:37 2009 @@ -164,6 +164,10 @@ VOID HaliInitBSP(VOID); VOID HaliStartApplicationProcessor(ULONG Cpu, ULONG Stack); +VOID NTAPI HalpInitIdtEntry(PKIDTENTRY64 Idt, PVOID Address); +VOID NTAPI HalpSetInterruptGate(ULONG Index, PVOID Address); +VOID NTAPI HalpInitCpuInterruptHandling(ULONG Cpu); + extern PVOID HalpRealModeStart; extern PVOID HalpRealModeEnd; Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/up/processor.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/up/processor.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/up/processor.c [iso-8859-1] Thu Dec 31 20:26:37 2009 @@ -25,8 +25,7 @@ HalInitializeProcessor(IN ULONG ProcessorNumber, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { - /* Set default IDR and stall count */ -// KeGetPcr()->IDR = 0xFFFFFFFB; + /* Set default stall count */ KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT; /* Update the interrupt affinity and processor mask */ @@ -36,6 +35,9 @@ /* Register routines for KDCOM */ HalpRegisterKdSupportFunctions(); + + /* Do per CPU interrupt handling initialization */ +// HalpInitCpuInterruptHandling(ProcessorNumber); } /*
14 years, 11 months
1
0
0
0
[tkreuzer] 44831: [HAL] - begin integrating halamd64 into halx86 - Move some amd64 specific stuff into halx86 - use hal_generic for amd64, too
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 31 17:51:05 2009 New Revision: 44831 URL:
http://svn.reactos.org/svn/reactos?rev=44831&view=rev
Log: [HAL] - begin integrating halamd64 into halx86 - Move some amd64 specific stuff into halx86 - use hal_generic for amd64, too Added: branches/ros-amd64-bringup/reactos/hal/halx86/generic/amd64/ (with props) branches/ros-amd64-bringup/reactos/hal/halx86/generic/amd64/irq.S - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/halamd64/generic/irq.S branches/ros-amd64-bringup/reactos/hal/halx86/generic/amd64/systimer.S - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/halamd64/generic/systimer.S branches/ros-amd64-bringup/reactos/hal/halx86/generic/x86bios.c - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/halamd64/generic/x86bios.c Removed: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/irq.S branches/ros-amd64-bringup/reactos/hal/halamd64/generic/systimer.S branches/ros-amd64-bringup/reactos/hal/halamd64/generic/x86bios.c branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_amd64.rbuild Modified: branches/ros-amd64-bringup/reactos/hal/hal.rbuild branches/ros-amd64-bringup/reactos/hal/halamd64/generic/generic.rbuild branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic.rbuild Modified: branches/ros-amd64-bringup/reactos/hal/hal.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/hal.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/hal.rbuild [iso-8859-1] Thu Dec 31 17:51:05 2009 @@ -25,7 +25,7 @@ </if> <if property="ARCH" value="amd64"> <directory name="halx86"> - <xi:include href="halx86/hal_generic_amd64.rbuild" /> + <xi:include href="halx86/hal_generic.rbuild" /> </directory> <directory name="halamd64"> <xi:include href="halamd64/directory.rbuild" /> Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/generic.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/generic/generic.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/generic/generic.rbuild [iso-8859-1] Thu Dec 31 17:51:05 2009 @@ -1,20 +1,16 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <group> - <module name="hal_generic" type="objectlibrary"> - <include base="hal_generic">../include</include> + <module name="hal_generic_amd64" type="objectlibrary"> + <include base="hal_generic_amd64">../include</include> <include base="ntoskrnl">include</include> <define name="_DISABLE_TIDENTS" /> <define name="_NTHAL_" /> - <define name="_X86BIOS_" /> <file>halinit.c</file> - <file>irq.S</file> <file>misc.c</file> <file>mps.S</file> - <file>systimer.S</file> <file>usage.c</file> <file>pic.c</file> - <file>x86bios.c</file> <pch>../include/hal.h</pch> </module> </group> Removed: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/irq.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/generic/irq.S [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/generic/irq.S (removed) @@ -1,85 +1,0 @@ -/* - * FILE: hal/halx86/generic/irq.S - * COPYRIGHT: See COPYING in the top level directory - * PURPOSE: Software, System and Hardware IRQ Management - * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net) - */ - -/* INCLUDES ******************************************************************/ - -#include <asm.h> -#include <internal/i386/asmmacro.S> -.intel_syntax noprefix - -.macro UNIMPLEMENTED func - jmp 2f -1: - .ascii "Sorry, asm function " - .ascii func - .ascii " is unimplemented!\n\0" -2: - movabs rcx, offset 1b - call _DbgPrint - ret -.endm - - - -/* GLOBALS *******************************************************************/ - - - -/* FUNCTIONS *****************************************************************/ - -.global _HalEnableInterrupt -.func _HalEnableInterrupt -_HalEnableInterrupt: - UNIMPLEMENTED "HalEnableInterrupt" -.endfunc - -.global _HalDisableInterrupt -.func _HalDisableInterrupt -_HalDisableInterrupt: - UNIMPLEMENTED "HalDisableInterrupt" -.endfunc - -.global _HalRequestSoftwareInterrupt -.func _HalRequestSoftwareInterrupt -_HalRequestSoftwareInterrupt: - UNIMPLEMENTED "HalRequestSoftwareInterrupt" -.endfunc - -.global _HalSendSoftwareInterrupt -.func _HalSendSoftwareInterrupt -_HalSendSoftwareInterrupt: - UNIMPLEMENTED "HalSendSoftwareInterrupt" -.endfunc - -.global _HalEndSystemInterrupt -.func _HalEndSystemInterrupt -_HalEndSystemInterrupt: - UNIMPLEMENTED "HalEndSystemInterrupt" -.endfunc - - -.globl _HalClearSoftwareInterrupt -.func _HalClearSoftwareInterrupt -_HalClearSoftwareInterrupt: - UNIMPLEMENTED "HalClearSoftwareInterrupt" - - /* Get IRR mask */ - mov eax, 1 - shl eax, cl - not eax - - /* Set IRR */ -// and gs:[KPCR_IRR], eax - ret -.endfunc - -.globl _HalBeginSystemInterrupt -.func _HalBeginSystemInterrupt -_HalBeginSystemInterrupt: - UNIMPLEMENTED "HalBeginSystemInterrupt" -.endfunc - Removed: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/systimer.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/generic/systimer.S [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/generic/systimer.S (removed) @@ -1,118 +1,0 @@ -/* - * FILE: hal/halx86/generic/timer.S - * COPYRIGHT: See COPYING in the top level directory - * PURPOSE: System Timer Interrupt and Management - * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net) - */ - -/* INCLUDES ******************************************************************/ - -#include <asm.h> -#include <ndk/amd64/asmmacro.S> - -/* GLOBALS *******************************************************************/ - -.data - -_UnhandledMsg: - .asciz "\n\x7\x7!!! Unhandled or Unexpected Code at line: %lx!!!\n" - -.global _MsgUnimplemented -_MsgUnimplemented: -.asciz "WARNING: %s at %s:%d is UNIMPLEMENTED!\n" - - -/* FUNCTIONS *****************************************************************/ - -.text -.code64 - -.global _HalpReleaseCmosSpinLock -.func HalpReleaseCmosSpinLock -_HalpReleaseCmosSpinLock: - -.endfunc - -.global _HalpAcquireSystemHardwareSpinLock -.func HalpAcquireSystemHardwareSpinLock -_HalpAcquireSystemHardwareSpinLock: - -.endfunc - -.global _HalpCalibrateStallExecution@0 -.func HalpCalibrateStallExecution@0 -_HalpCalibrateStallExecution@0: - -.endfunc - -.globl _HalpProfileInterrupt -.func HalpProfileInterrupt -_HalpProfileInterrupt: - -.endfunc - - -.globl _KeStallExecutionProcessor -.func KeStallExecutionProcessor -_KeStallExecutionProcessor: - - /* Get the number of microseconds required */ - jecxz Done - - /* Multiply by the stall factor */ - mov eax, gs:[KPCR_STALL_SCALE_FACTOR] - mul ecx - - /* Align to 16 bytes */ - .align 16 - - /* Jump to subtraction loop */ - jmp SubtractLoop - - /* Align to 16 bytes */ - .align 16 - - /* Subtract one count */ -SubtractLoop: - sub eax, 1 - jnz SubtractLoop - -Done: - /* Return */ - ret 4 -.endfunc - - -.globl _HalpQuery8254Counter -.func HalpQuery8254Counter -_HalpQuery8254Counter: - - /* Save EFLAGS and disable interrupts */ - pushfq - cli - - /* Set timer data */ - mov al, 0 - out 0x43, al - jmp $+2 - - /* Read current timer */ - in al, 0x40 - jmp $+2 - movzx ecx, al - in al, 0x40 - mov ch, al - - /* Return it and restore interrupt state */ - mov eax, ecx - popfq - ret -.endfunc - -.globl _HalpClockInterrupt -.func HalpClockInterrupt -_HalpClockInterrupt: - UNIMPLEMENTED _HalpClockInterrupt - iret -.endfunc - Removed: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/x86bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/generic/x86bios.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/generic/x86bios.c (removed) @@ -1,69 +1,0 @@ -/* - * PROJECT: ReactOS HAL - * LICENSE: See COPYING in the top level directory - * FILE: hal/halamd64/generic/x86bios.c - * PURPOSE: - * PROGRAMMERS: - */ - -/* INCLUDES ******************************************************************/ - -#include <hal.h> -//#define NDEBUG -#include <debug.h> - -NTSTATUS -NTAPI -x86BiosAllocateBuffer ( - ULONG *Size, - USHORT *Segment, - USHORT *Offset) -{ - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL;; - -} - -BOOLEAN -NTAPI -x86BiosCall ( - ULONG InterruptNumber, - X86_BIOS_REGISTERS *Registers) -{ - UNIMPLEMENTED; - return FALSE; -} - -NTSTATUS -NTAPI -x86BiosFreeBuffer ( - USHORT Segment, - USHORT Offset) -{ - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL;; -} - -NTSTATUS -x86BiosReadMemory ( - USHORT Segment, - USHORT Offset, - PVOID Buffer, - ULONG Size) -{ - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL;; -} - -NTSTATUS -NTAPI -x86BiosWriteMemory ( - USHORT Segment, - USHORT Offset, - PVOID Buffer, - ULONG Size) -{ - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL;; -} - Propchange: branches/ros-amd64-bringup/reactos/hal/halx86/generic/amd64/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Thu Dec 31 17:51:05 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: branches/ros-amd64-bringup/reactos/hal/halx86/generic/amd64/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: branches/ros-amd64-bringup/reactos/hal/halx86/generic/amd64/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: branches/ros-amd64-bringup/reactos/hal/halx86/generic/amd64/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Modified: branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic.rbuild [iso-8859-1] Thu Dec 31 17:51:05 2009 @@ -5,35 +5,49 @@ <include>include</include> <include base="ntoskrnl">include</include> <define name="_NTHAL_" /> + <define name="_X86BIOS_" /> <directory name="generic"> <directory name="bus"> <file>bushndlr.c</file> <file>isabus.c</file> <file>halbus.c</file> + <file>pcibus.c</file> <file>pcidata.c</file> <file>sysbus.c</file> </directory> <file>beep.c</file> - <file>bios.c</file> <file>cmos.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>usage.c</file> + <file>x86bios.c</file> <if property="ARCH" value="i386"> + <file>bios.c</file> + <file>halinit.c</file> + <file>misc.c</file> + <file>usage.c</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="amd64"> + <file>irq.s</file> + <file>systimer.S</file> + </directory> + </if> </directory> + <if property="ARCH" value="amd64"> + <directory name="mp"> + <file>apic.c</file> + </directory> + </if> <directory name="include"> <pch>hal.h</pch> </directory> Removed: branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_amd64.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_amd64.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_amd64.rbuild (removed) @@ -1,35 +1,0 @@ -<?xml version="1.0"?> -<!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd"> -<group> - <module name="hal_generic_amd64" type="objectlibrary"> - <include>include</include> - <include base="ntoskrnl">include</include> - <define name="_DISABLE_TIDENTS" /> - <define name="_NTHAL_" /> - <directory name="generic"> - <directory name="bus"> - <file>bushndlr.c</file> - <file>isabus.c</file> - <file>halbus.c</file> - <file>pcibus.c</file> - <file>pcidata.c</file> - <file>sysbus.c</file> - </directory> - <file>beep.c</file> - <file>cmos.c</file> - <file>dma.c</file> - <file>drive.c</file> - <file>display.c</file> - <file>profil.c</file> - <file>reboot.c</file> - <file>sysinfo.c</file> - <file>timer.c</file> - </directory> - <directory name="mp"> - <file>apic.c</file> - </directory> - <directory name="include"> - <pch>hal.h</pch> - </directory> - </module> -</group>
14 years, 11 months
1
0
0
0
[tkreuzer] 44830: [HAL] - fix indentation - add HalDisableSystemInterrupt and HalEnableSystemInterrupt stubs
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 31 17:47:09 2009 New Revision: 44830 URL:
http://svn.reactos.org/svn/reactos?rev=44830&view=rev
Log: [HAL] - fix indentation - add HalDisableSystemInterrupt and HalEnableSystemInterrupt stubs Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/pic.c Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/pic.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/generic/pic.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/generic/pic.c [iso-8859-1] Thu Dec 31 17:47:09 2009 @@ -41,71 +41,101 @@ NTAPI HalpInitPICs(VOID) { - ULONG OldEflags; - INT x; + ULONG OldEflags; + INT x; - OldEflags = __readeflags(); - _disable(); - /* - * Set up the first 8259 interrupt processor. - * Make 8259 interrupts start at CPU vector VectorPIC. - * Set the 8259 as master with edge triggered - * input with fully nested interrupts. - */ - __outbyte(Int0ctl, 0x20); /* ICW1 - master, edge triggered */ - __outbyte(Int0aux, 0x11); /* Edge, cascade, CAI 8, ICW4 */ - __outbyte(Int0aux, PRIMARY_VECTOR_BASE); /* ICW2 - interrupt vector offset */ - __outbyte(Int0aux, 0x04); /* ICW3 - have slave on level 2 */ - __outbyte(Int0aux, 0x01); /* ICW4 - 8086 mode, not buffered */ - __outbyte(Int0aux, 0xFF); /* Mask Interrupts */ + OldEflags = __readeflags(); + _disable(); + + /* + * Set up the first 8259 interrupt processor. + * Make 8259 interrupts start at CPU vector VectorPIC. + * Set the 8259 as master with edge triggered + * input with fully nested interrupts. + */ + __outbyte(Int0ctl, 0x20); /* ICW1 - master, edge triggered */ + __outbyte(Int0aux, 0x11); /* Edge, cascade, CAI 8, ICW4 */ + __outbyte(Int0aux, PRIMARY_VECTOR_BASE); /* ICW2 - interrupt vector offset */ + __outbyte(Int0aux, 0x04); /* ICW3 - have slave on level 2 */ + __outbyte(Int0aux, 0x01); /* ICW4 - 8086 mode, not buffered */ + __outbyte(Int0aux, 0xFF); /* Mask Interrupts */ /* * Set up the second 8259 interrupt processor. * Make 8259 interrupts start at CPU vector VectorPIC+8. * Set the 8259 as slave with edge triggered * input with fully nested interrupts. */ - __outbyte(Int1ctl, 0xA0); /* ICW1 - master, edge triggered, */ - __outbyte(Int1aux, 0x11); /* Edge, cascade, CAI 8, ICW4 */ - __outbyte(Int1aux, PRIMARY_VECTOR_BASE+8); /* ICW2 - interrupt vector offset */ - __outbyte(Int1aux, 0x02); /* ICW3 - I am a slave on level 2 */ - __outbyte(Int1aux, 0x01); /* ICW4 - 8086 mode, not buffered */ - __outbyte(Int1aux, 0xFF); /* Mask Interrupts */ + __outbyte(Int1ctl, 0xA0); /* ICW1 - master, edge triggered, */ + __outbyte(Int1aux, 0x11); /* Edge, cascade, CAI 8, ICW4 */ + __outbyte(Int1aux, PRIMARY_VECTOR_BASE+8); /* ICW2 - interrupt vector offset */ + __outbyte(Int1aux, 0x02); /* ICW3 - I am a slave on level 2 */ + __outbyte(Int1aux, 0x01); /* ICW4 - 8086 mode, not buffered */ + __outbyte(Int1aux, 0xFF); /* Mask Interrupts */ - /* - * pass #2 8259 interrupts to #1 - */ - i8259mask &= ~0x04; - __outbyte(Int0aux, i8259mask & 0xFF); + /* + * pass #2 8259 interrupts to #1 + */ + i8259mask &= ~0x04; + __outbyte(Int0aux, i8259mask & 0xFF); - /* - * Set Ocw3 to return the ISR when ctl read. - * After initialisation status read is set to IRR. - * Read IRR first to possibly deassert an outstanding - * interrupt. - */ - __inbyte (Int0ctl); - __outbyte(Int0ctl, Ocw3|0x03); - __inbyte (Int1ctl); - __outbyte(Int1ctl, Ocw3|0x03); + /* + * Set Ocw3 to return the ISR when ctl read. + * After initialisation status read is set to IRR. + * Read IRR first to possibly deassert an outstanding + * interrupt. + */ + __inbyte (Int0ctl); + __outbyte(Int0ctl, Ocw3|0x03); + __inbyte (Int1ctl); + __outbyte(Int1ctl, Ocw3|0x03); - /* - * Check for Edge/Level register. - * This check may not work for all chipsets. - * First try a non-intrusive test - the bits for - * IRQs 13, 8, 2, 1 and 0 must be edge (0). If - * that's OK try a R/W test. - */ - x = (__inbyte (Elcr2)<<8)|__inbyte(Elcr1); - if(!(x & 0x2107)){ - __outbyte(Elcr1, 0); - if(__inbyte (Elcr1) == 0){ - __outbyte(Elcr1, 0x20); - if(__inbyte (Elcr1) == 0x20) - i8259elcr = x; - __outbyte(Elcr1, x & 0xFF); - DPRINT("ELCR: %4.4uX\n", i8259elcr); - } - } - __writeeflags(OldEflags); - } + /* + * Check for Edge/Level register. + * This check may not work for all chipsets. + * First try a non-intrusive test - the bits for + * IRQs 13, 8, 2, 1 and 0 must be edge (0). If + * that's OK try a R/W test. + */ + x = (__inbyte(Elcr2) << 8) | __inbyte(Elcr1); + + if (!(x & 0x2107)) + { + __outbyte(Elcr1, 0); + + if (__inbyte (Elcr1) == 0) + { + __outbyte(Elcr1, 0x20); + + if (__inbyte (Elcr1) == 0x20) + { + i8259elcr = x; + } + __outbyte(Elcr1, x & 0xFF); + DPRINT("ELCR: %4.4uX\n", i8259elcr); + } + } + + __writeeflags(OldEflags); +} + +VOID +NTAPI +HalDisableSystemInterrupt( + ULONG Vector, + KIRQL Irql) +{ + UNIMPLEMENTED; +} + +BOOLEAN +NTAPI +HalEnableSystemInterrupt( + ULONG Vector, + KIRQL Irql, + KINTERRUPT_MODE InterruptMode) +{ + UNIMPLEMENTED; + return FALSE; +} +
14 years, 11 months
1
0
0
0
[tkreuzer] 44829: [HAL] - fix pspec - entrypoint should be HalInitSystem
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 31 16:38:34 2009 New Revision: 44829 URL:
http://svn.reactos.org/svn/reactos?rev=44829&view=rev
Log: [HAL] - fix pspec - entrypoint should be HalInitSystem Modified: branches/ros-amd64-bringup/reactos/hal/hal.pspec branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild branches/ros-amd64-bringup/reactos/hal/halarm/up/halup.rbuild branches/ros-amd64-bringup/reactos/hal/halppc/up/halup.rbuild branches/ros-amd64-bringup/reactos/hal/halx86/halmp.rbuild branches/ros-amd64-bringup/reactos/hal/halx86/halup.rbuild branches/ros-amd64-bringup/reactos/hal/halx86/halxbox.rbuild Modified: branches/ros-amd64-bringup/reactos/hal/hal.pspec URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/hal.pspec [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/hal.pspec [iso-8859-1] Thu Dec 31 16:38:34 2009 @@ -4,27 +4,26 @@ @ fastcall ExAcquireFastMutex(ptr) @ fastcall ExReleaseFastMutex(ptr) #else -@ fastcall ExAcquireFastMutex(ptr) ExiAcquireFastMutex -@ fastcall ExReleaseFastMutex(ptr) ExiReleaseFastMutex +@ fastcall -arch=i386 ExAcquireFastMutex(ptr) ExiAcquireFastMutex +@ fastcall -arch=i386 ExReleaseFastMutex(ptr) ExiReleaseFastMutex #endif -@ fastcall ExTryToAcquireFastMutex(ptr) ExiTryToAcquireFastMutex +@ fastcall -arch=i386,arm ExTryToAcquireFastMutex(ptr) ExiTryToAcquireFastMutex @ fastcall HalClearSoftwareInterrupt(long) @ fastcall HalRequestSoftwareInterrupt(long) @ fastcall HalSystemVectorDispatchEntry(long long long) -@ fastcall KeAcquireInStackQueuedSpinLock(ptr ptr) -@ fastcall KeAcquireInStackQueuedSpinLockRaiseToSynch(ptr ptr) -@ fastcall KeAcquireSpinLockRaiseToSynch(ptr) -@ fastcall KeAcquireQueuedSpinLock(ptr) -@ fastcall KeAcquireQueuedSpinLockRaiseToSynch(ptr) -@ fastcall KeReleaseInStackQueuedSpinLock(ptr) -@ fastcall KeReleaseQueuedSpinLock(ptr long) -@ fastcall KeTryToAcquireQueuedSpinLock(long ptr) -@ fastcall KeTryToAcquireQueuedSpinLockRaiseToSynch(long ptr) -@ fastcall KfAcquireSpinLock(ptr) -@ fastcall KfLowerIrql(long) -@ fastcall KfRaiseIrql(long) -@ fastcall KfReleaseSpinLock(ptr long) - +@ fastcall -arch=i386,arm KeAcquireInStackQueuedSpinLock(ptr ptr) +@ fastcall -arch=i386,arm KeAcquireInStackQueuedSpinLockRaiseToSynch(ptr ptr) +@ fastcall -arch=i386,arm KeAcquireSpinLockRaiseToSynch(ptr) +@ fastcall -arch=i386,arm KeAcquireQueuedSpinLock(ptr) +@ fastcall -arch=i386,arm KeAcquireQueuedSpinLockRaiseToSynch(ptr) +@ fastcall -arch=i386,arm KeReleaseInStackQueuedSpinLock(ptr) +@ fastcall -arch=i386,arm KeReleaseQueuedSpinLock(ptr long) +@ fastcall -arch=i386,arm KeTryToAcquireQueuedSpinLock(long ptr) +@ fastcall -arch=i386,arm KeTryToAcquireQueuedSpinLockRaiseToSynch(long ptr) +@ fastcall -arch=i386,arm KfAcquireSpinLock(ptr) +@ fastcall -arch=i386,arm KfLowerIrql(long) +@ fastcall -arch=i386,arm KfRaiseIrql(long) +@ fastcall -arch=i386,arm KfReleaseSpinLock(ptr long) @ stdcall HalAcquireDisplayOwnership(ptr) @ stdcall HalAdjustResourceList(ptr) @ stdcall HalAllProcessorsStarted() @@ -44,9 +43,7 @@ @ stdcall HalGetBusData(long long long ptr long) @ stdcall HalGetBusDataByOffset(long long long ptr long long) @ stdcall HalGetEnvironmentVariable(str long str) -#ifdef _M_ARM -@ fastcall HalGetInterruptSource() -#endif +@ fastcall -arch=arm HalGetInterruptSource() @ stdcall HalGetInterruptVector(long long long long ptr ptr) @ stdcall HalHandleNMI(ptr) @ stdcall HalInitSystem(long ptr) @@ -69,41 +66,37 @@ @ stdcall HalStartNextProcessor(ptr ptr) @ stdcall HalStartProfileInterrupt(long) @ stdcall HalStopProfileInterrupt(long) -#ifdef _M_ARM -@ fastcall HalSweepIcache() -@ fastcall HalSweepDcache() -#endif +@ fastcall -arch=arm HalSweepIcache() +@ fastcall -arch=arm HalSweepDcache() @ stdcall HalTranslateBusAddress(long long long long ptr ptr) @ stdcall IoFlushAdapterBuffers(ptr ptr ptr ptr long long) @ stdcall IoFreeAdapterChannel(ptr) @ stdcall IoFreeMapRegisters(ptr ptr long) @ stdcall IoMapTransfer(ptr ptr ptr ptr ptr long) -#ifndef _M_ARM -@ stdcall IoAssignDriveLetters(ptr str ptr ptr) HalpAssignDriveLetters -@ stdcall IoReadPartitionTable(ptr long long ptr) HalpReadPartitionTable -@ stdcall IoSetPartitionInformation(ptr long long long) HalpSetPartitionInformation -@ stdcall IoWritePartitionTable(ptr long long long ptr) HalpWritePartitionTable -#endif -@ stdcall KeAcquireSpinLock(ptr ptr) +@ stdcall -arch=i386,x86_64 IoAssignDriveLetters(ptr str ptr ptr) HalpAssignDriveLetters +@ stdcall -arch=i386,x86_64 IoReadPartitionTable(ptr long long ptr) HalpReadPartitionTable +@ stdcall -arch=i386,x86_64 IoSetPartitionInformation(ptr long long long) HalpSetPartitionInformation +@ stdcall -arch=i386,x86_64 IoWritePartitionTable(ptr long long long ptr) HalpWritePartitionTable +@ stdcall -arch=i386,arm KeAcquireSpinLock(ptr ptr) @ extern KdComPortInUse @ stdcall KeFlushWriteBuffer() -@ stdcall KeGetCurrentIrql() -@ stdcall KeLowerIrql(long) +@ stdcall -arch=i386,arm KeGetCurrentIrql() +@ stdcall -arch=i386,arm KeLowerIrql(long) @ stdcall KeQueryPerformanceCounter(ptr) -@ stdcall KeRaiseIrql(long ptr) -@ stdcall KeRaiseIrqlToDpcLevel() -@ stdcall KeRaiseIrqlToSynchLevel() -@ stdcall KeReleaseSpinLock(ptr long) +@ stdcall -arch=i386,arm KeRaiseIrql(long ptr) +@ stdcall -arch=i386,arm KeRaiseIrqlToDpcLevel() +@ stdcall -arch=i386,arm KeRaiseIrqlToSynchLevel() +@ stdcall -arch=i386,arm KeReleaseSpinLock(ptr long) @ stdcall KeStallExecutionProcessor(long) -@ stdcall READ_PORT_BUFFER_UCHAR(ptr ptr long) -@ stdcall READ_PORT_BUFFER_ULONG(ptr ptr long) -@ stdcall READ_PORT_BUFFER_USHORT(ptr ptr long) -@ stdcall READ_PORT_UCHAR(ptr) -@ stdcall READ_PORT_ULONG(ptr) -@ stdcall READ_PORT_USHORT(ptr) -@ stdcall WRITE_PORT_BUFFER_UCHAR(ptr ptr long) -@ stdcall WRITE_PORT_BUFFER_ULONG(ptr ptr long) -@ stdcall WRITE_PORT_BUFFER_USHORT(ptr ptr long) -@ stdcall WRITE_PORT_UCHAR(ptr long) -@ stdcall WRITE_PORT_ULONG(ptr long) -@ stdcall WRITE_PORT_USHORT(ptr long) +@ stdcall -arch=i386,arm READ_PORT_BUFFER_UCHAR(ptr ptr long) +@ stdcall -arch=i386,arm READ_PORT_BUFFER_ULONG(ptr ptr long) +@ stdcall -arch=i386,arm READ_PORT_BUFFER_USHORT(ptr ptr long) +@ stdcall -arch=i386,arm READ_PORT_UCHAR(ptr) +@ stdcall -arch=i386,arm READ_PORT_ULONG(ptr) +@ stdcall -arch=i386,arm READ_PORT_USHORT(ptr) +@ stdcall -arch=i386,arm WRITE_PORT_BUFFER_UCHAR(ptr ptr long) +@ stdcall -arch=i386,arm WRITE_PORT_BUFFER_ULONG(ptr ptr long) +@ stdcall -arch=i386,arm WRITE_PORT_BUFFER_USHORT(ptr ptr long) +@ stdcall -arch=i386,arm WRITE_PORT_UCHAR(ptr long) +@ stdcall -arch=i386,arm WRITE_PORT_ULONG(ptr long) +@ stdcall -arch=i386,arm WRITE_PORT_USHORT(ptr long) Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild [iso-8859-1] Thu Dec 31 16:38:34 2009 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="hal" type="kernelmodedll" installbase="system32" installname="hal.dll"> +<module name="hal" type="kernelmodedll" entrypoint="HalInitSystem" installbase="system32" installname="hal.dll"> <importlibrary base="hal" definition="../../hal.pspec" /> <bootstrap installbase="$(CDOUTPUT)" nameoncd="hal.dll" /> <include base="hal">../include</include> Modified: branches/ros-amd64-bringup/reactos/hal/halarm/up/halup.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halarm/up/halup.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halarm/up/halup.rbuild [iso-8859-1] Thu Dec 31 16:38:34 2009 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="hal" type="kernelmodedll" installbase="system32" installname="hal.dll"> +<module name="hal" type="kernelmodedll" entrypoint="HalInitSystem" installbase="system32" installname="hal.dll"> <importlibrary base="hal" definition="../../hal.pspec" /> <bootstrap installbase="$(CDOUTPUT)" nameoncd="hal.dll" /> <include base="halarm_generic">../include</include> Modified: branches/ros-amd64-bringup/reactos/hal/halppc/up/halup.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halppc/up/halup.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halppc/up/halup.rbuild [iso-8859-1] Thu Dec 31 16:38:34 2009 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="hal" type="kernelmodedll"> +<module name="hal" type="kernelmodedll" entrypoint="HalInitSystem"> <importlibrary definition="../../hal/hal.pspec" /> <bootstrap installbase="$(CDOUTPUT)" nameoncd="hal.dll" /> <include base="halppc_generic">../include</include> Modified: branches/ros-amd64-bringup/reactos/hal/halx86/halmp.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/halmp.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/halmp.rbuild [iso-8859-1] Thu Dec 31 16:38:34 2009 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd"> <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> - <module name="halmp" type="kernelmodedll" entrypoint="0"> + <module name="halmp" type="kernelmodedll" entrypoint="HalInitSystem@8"> <importlibrary base="hal" definition="../hal.pspec" /> <bootstrap installbase="$(CDOUTPUT)" /> <include>include</include> Modified: branches/ros-amd64-bringup/reactos/hal/halx86/halup.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/halup.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/halup.rbuild [iso-8859-1] Thu Dec 31 16:38:34 2009 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd"> <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> - <module name="hal" type="kernelmodedll" entrypoint="0" installbase="system32" installname="hal.dll"> + <module name="hal" type="kernelmodedll" entrypoint="HalInitSystem@8" installbase="system32" installname="hal.dll"> <importlibrary base="hal" definition="../hal.pspec" /> <bootstrap installbase="$(CDOUTPUT)" /> <include>include</include> Modified: branches/ros-amd64-bringup/reactos/hal/halx86/halxbox.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/halxbox.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/halxbox.rbuild [iso-8859-1] Thu Dec 31 16:38:34 2009 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd"> <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> - <module name="halxbox" type="kernelmodedll" entrypoint="0"> + <module name="halxbox" type="kernelmodedll" entrypoint="HalInitSystem@8"> <importlibrary base="hal" definition="../hal.pspec" /> <include>include</include> <include base="ntoskrnl">include</include>
14 years, 11 months
1
0
0
0
[tkreuzer] 44828: [HAL] use the pspec for amd64, too
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 31 16:31:20 2009 New Revision: 44828 URL:
http://svn.reactos.org/svn/reactos?rev=44828&view=rev
Log: [HAL] use the pspec for amd64, too Removed: branches/ros-amd64-bringup/reactos/hal/halamd64/hal_amd64.def Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild Removed: branches/ros-amd64-bringup/reactos/hal/halamd64/hal_amd64.def URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/hal_amd64.def [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/hal_amd64.def (removed) @@ -1,93 +1,0 @@ -; Hardware Abstraction Layer - ReactOS Operating System - -LIBRARY hal.dll - -EXPORTS -HalAcquireDisplayOwnership -HalAdjustResourceList -HalAllProcessorsStarted -HalAllocateAdapterChannel -HalAllocateCommonBuffer -HalAllocateCrashDumpRegisters -;HalAllocateHardwareCounters -HalAssignSlotResources -HalBugCheckSystem -HalCalibratePerformanceCounter -HalClearSoftwareInterrupt -;HalConvertDeviceIdtToIrql -;HalDisableInterrupt -HalDisplayString -;HalEnableInterrupt -;HalEnumerateEnvironmentVariablesEx -;HalEnumerateProcessors -HalFlushCommonBuffer -HalFreeCommonBuffer -;HalFreeHardwareCounters -HalGetAdapter -HalGetBusData -HalGetBusDataByOffset -HalGetEnvironmentVariable -;HalGetEnvironmentVariableEx -;HalGetInterruptTargetInformation -HalGetInterruptVector -;HalGetMemoryCachingRequirements -;HalGetMessageRoutingInfo -;HalGetProcessorIdByNtNumber -;HalGetVectorInput -;HalHandleMcheck -HalHandleNMI -HalInitSystem -;HalInitializeBios -;HalInitializeOnResume -HalInitializeProcessor -;HalIsHyperThreadingEnabled -HalMakeBeep -;HalMcUpdateReadPCIConfig -;HalPerformEndOfInterrupt -HalProcessorIdle -HalQueryDisplayParameters -;HalQueryEnvironmentVariableInfoEx -;HalQueryMaximumProcessorCount -HalQueryRealTimeClock -HalReadDmaCounter -;HalRegisterDynamicProcessor -;HalRegisterErrataCallbacks -HalReportResourceUsage -;HalRequestClockInterrupt -;HalRequestDeferredRecoveryServiceInterrupt -HalRequestIpi -HalRequestSoftwareInterrupt -HalReturnToFirmware -;HalSendNMI -;HalSendSoftwareInterrupt -HalSetBusData -HalSetBusDataByOffset -HalSetDisplayParameters -HalSetEnvironmentVariable -;HalSetEnvironmentVariableEx -HalSetProfileInterval -HalSetRealTimeClock -HalSetTimeIncrement -;HalStartDynamicProcessor -HalStartNextProcessor -HalStartProfileInterrupt -HalStopProfileInterrupt -HalSystemVectorDispatchEntry -HalTranslateBusAddress -IoAssignDriveLetters ;not present in win7 -IoFlushAdapterBuffers -IoFreeAdapterChannel -IoFreeMapRegisters -IoMapTransfer -IoReadPartitionTable -IoSetPartitionInformation -IoWritePartitionTable -KdComPortInUse DATA -KeFlushWriteBuffer -KeQueryPerformanceCounter -KeStallExecutionProcessor -x86BiosAllocateBuffer -x86BiosCall -x86BiosFreeBuffer -x86BiosReadMemory -x86BiosWriteMemory Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild [iso-8859-1] Thu Dec 31 16:31:20 2009 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <module name="hal" type="kernelmodedll" installbase="system32" installname="hal.dll"> - <importlibrary base="hal" definition="../hal_amd64.def" /> + <importlibrary base="hal" definition="../../hal.pspec" /> <bootstrap installbase="$(CDOUTPUT)" nameoncd="hal.dll" /> <include base="hal">../include</include> <include base="ntoskrnl">include</include>
14 years, 11 months
1
0
0
0
[tkreuzer] 44827: [HAL] - Raname each architecture's default hal (halup) to "hal" (Windows does that, too) and get rid of the duplicated stub hal.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 31 16:19:17 2009 New Revision: 44827 URL:
http://svn.reactos.org/svn/reactos?rev=44827&view=rev
Log: [HAL] - Raname each architecture's default hal (halup) to "hal" (Windows does that, too) and get rid of the duplicated stub hal. Added: branches/ros-amd64-bringup/reactos/hal/hal.pspec - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/hal/hal.pspec branches/ros-amd64-bringup/reactos/hal/halamd64/hal_amd64.def - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/hal/hal_amd64.def Removed: branches/ros-amd64-bringup/reactos/hal/hal/ Modified: branches/ros-amd64-bringup/reactos/hal/hal.rbuild branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild branches/ros-amd64-bringup/reactos/hal/halarm/up/halup.rbuild branches/ros-amd64-bringup/reactos/hal/halppc/up/halup.rbuild branches/ros-amd64-bringup/reactos/hal/halx86/halmp.rbuild branches/ros-amd64-bringup/reactos/hal/halx86/halup.rbuild branches/ros-amd64-bringup/reactos/hal/halx86/halxbox.rbuild Modified: branches/ros-amd64-bringup/reactos/hal/hal.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/hal.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/hal.rbuild [iso-8859-1] Thu Dec 31 16:19:17 2009 @@ -1,9 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE group SYSTEM "../tools/rbuild/project.dtd"> <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> - <directory name="hal"> - <xi:include href="hal/hal.rbuild" /> - </directory> <if property="ARCH" value="i386"> <directory name="halx86"> <xi:include href="halx86/hal_generic.rbuild" /> Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/up/halup.rbuild [iso-8859-1] Thu Dec 31 16:19:17 2009 @@ -1,9 +1,9 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="halup" type="kernelmodedll" installbase="system32" installname="hal.dll"> - <importlibrary base="hal" definition="hal_amd64.def" /> +<module name="hal" type="kernelmodedll" installbase="system32" installname="hal.dll"> + <importlibrary base="hal" definition="../hal_amd64.def" /> <bootstrap installbase="$(CDOUTPUT)" nameoncd="hal.dll" /> - <include base="halup">../include</include> + <include base="hal">../include</include> <include base="ntoskrnl">include</include> <define name="_DISABLE_TIDENTS" /> <define name="_NTHAL_" /> Modified: branches/ros-amd64-bringup/reactos/hal/halarm/up/halup.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halarm/up/halup.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halarm/up/halup.rbuild [iso-8859-1] Thu Dec 31 16:19:17 2009 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="halarm_up" type="kernelmodedll" installbase="system32" installname="hal.dll"> - <importlibrary base="hal" definition="hal.pspec" /> +<module name="hal" type="kernelmodedll" installbase="system32" installname="hal.dll"> + <importlibrary base="hal" definition="../../hal.pspec" /> <bootstrap installbase="$(CDOUTPUT)" nameoncd="hal.dll" /> <include base="halarm_generic">../include</include> <include base="ntoskrnl">include</include> Modified: branches/ros-amd64-bringup/reactos/hal/halppc/up/halup.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halppc/up/halup.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halppc/up/halup.rbuild [iso-8859-1] Thu Dec 31 16:19:17 2009 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="halppc_up" type="kernelmodedll"> - <importlibrary definition="../../hal/hal.def" /> +<module name="hal" type="kernelmodedll"> + <importlibrary definition="../../hal/hal.pspec" /> <bootstrap installbase="$(CDOUTPUT)" nameoncd="hal.dll" /> <include base="halppc_generic">../include</include> <include base="ntoskrnl">include</include> Modified: branches/ros-amd64-bringup/reactos/hal/halx86/halmp.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/halmp.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/halmp.rbuild [iso-8859-1] Thu Dec 31 16:19:17 2009 @@ -2,7 +2,7 @@ <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd"> <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> <module name="halmp" type="kernelmodedll" entrypoint="0"> - <importlibrary base="hal" definition="hal.pspec" /> + <importlibrary base="hal" definition="../hal.pspec" /> <bootstrap installbase="$(CDOUTPUT)" /> <include>include</include> <include base="ntoskrnl">include</include> Modified: branches/ros-amd64-bringup/reactos/hal/halx86/halup.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/halup.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/halup.rbuild [iso-8859-1] Thu Dec 31 16:19:17 2009 @@ -1,8 +1,8 @@ <?xml version="1.0"?> <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd"> <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> - <module name="halup" type="kernelmodedll" entrypoint="0" installbase="system32" installname="hal.dll"> - <importlibrary base="hal" definition="hal.pspec" /> + <module name="hal" type="kernelmodedll" entrypoint="0" installbase="system32" installname="hal.dll"> + <importlibrary base="hal" definition="../hal.pspec" /> <bootstrap installbase="$(CDOUTPUT)" /> <include>include</include> <include base="ntoskrnl">include</include> Modified: branches/ros-amd64-bringup/reactos/hal/halx86/halxbox.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/halxbox.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/halxbox.rbuild [iso-8859-1] Thu Dec 31 16:19:17 2009 @@ -2,7 +2,7 @@ <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd"> <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> <module name="halxbox" type="kernelmodedll" entrypoint="0"> - <importlibrary base="hal" definition="hal.pspec" /> + <importlibrary base="hal" definition="../hal.pspec" /> <include>include</include> <include base="ntoskrnl">include</include> <define name="_NTHAL_" />
14 years, 11 months
1
0
0
0
[tkreuzer] 44826: fix a typo
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 31 16:12:16 2009 New Revision: 44826 URL:
http://svn.reactos.org/svn/reactos?rev=44826&view=rev
Log: fix a typo Modified: branches/ros-amd64-bringup/reactos/hal/halx86/generic/misc.c Modified: branches/ros-amd64-bringup/reactos/hal/halx86/generic/misc.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/misc.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/misc.c [iso-8859-1] Thu Dec 31 16:12:16 2009 @@ -45,7 +45,7 @@ VOID NTAPI -HalpSetInterruptGate(ULONG Index, PVOID address) +HalpSetInterruptGate(ULONG index, PVOID address) { KIDTENTRY *idt; KIDT_ACCESS Access;
14 years, 11 months
1
0
0
0
[tkreuzer] 44825: [HAL] - Move i386 specific code into i386 folder - Move up specific code into up folder
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 31 15:57:24 2009 New Revision: 44825 URL:
http://svn.reactos.org/svn/reactos?rev=44825&view=rev
Log: [HAL] - Move i386 specific code into i386 folder - Move up specific code into up folder Added: branches/ros-amd64-bringup/reactos/hal/halx86/generic/i386/ (with props) branches/ros-amd64-bringup/reactos/hal/halx86/generic/i386/portio.c - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/halx86/generic/portio.c branches/ros-amd64-bringup/reactos/hal/halx86/generic/i386/systimer.S - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/halx86/generic/systimer.S branches/ros-amd64-bringup/reactos/hal/halx86/generic/i386/v86.s - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/halx86/generic/v86.s branches/ros-amd64-bringup/reactos/hal/halx86/up/irq.S - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/halx86/generic/irq.S branches/ros-amd64-bringup/reactos/hal/halx86/up/processor.c - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/halx86/generic/processor.c branches/ros-amd64-bringup/reactos/hal/halx86/up/spinlock.c - copied unchanged from r44816, branches/ros-amd64-bringup/reactos/hal/halx86/generic/spinlock.c Removed: branches/ros-amd64-bringup/reactos/hal/halx86/generic/irq.S branches/ros-amd64-bringup/reactos/hal/halx86/generic/portio.c branches/ros-amd64-bringup/reactos/hal/halx86/generic/processor.c branches/ros-amd64-bringup/reactos/hal/halx86/generic/spinlock.c branches/ros-amd64-bringup/reactos/hal/halx86/generic/systimer.S branches/ros-amd64-bringup/reactos/hal/halx86/generic/v86.s Modified: branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic.rbuild branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_up.rbuild Propchange: branches/ros-amd64-bringup/reactos/hal/halx86/generic/i386/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Thu Dec 31 15:57:24 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: branches/ros-amd64-bringup/reactos/hal/halx86/generic/i386/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: branches/ros-amd64-bringup/reactos/hal/halx86/generic/i386/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: branches/ros-amd64-bringup/reactos/hal/halx86/generic/i386/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Removed: branches/ros-amd64-bringup/reactos/hal/halx86/generic/irq.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/irq.S [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/irq.S (removed) @@ -1,959 +1,0 @@ -/* - * FILE: hal/halx86/generic/irq.S - * COPYRIGHT: See COPYING in the top level directory - * PURPOSE: Software, System and Hardware IRQ Management - * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net) - */ - -/* INCLUDES ******************************************************************/ - -/* Enable this (and the define in spinlock.c) to make UP HAL work for MP Kernel */ -/* #define CONFIG_SMP */ - -#include <asm.h> -#include <internal/i386/asmmacro.S> -.intel_syntax noprefix - -/* GLOBALS *******************************************************************/ - -PICInitTable: - - /* Master PIC */ - .short 0x20 /* Port */ - .byte 0x11 /* Edge, cascade, CAI 8, ICW4 */ - .byte PRIMARY_VECTOR_BASE /* Base */ - .byte 4 /* IRQ 4 connected to slave */ - .byte 1 /* Non buffered, not nested, 8086 */ - - /* Slave PIC */ - .short 0xA0 /* Port */ - .byte 0x11 /* Edge, cascade, CAI 8, ICW4 */ - .byte PRIMARY_VECTOR_BASE + 8 /* Base */ - .byte 2 /* Slave ID: Slave 2 */ - .byte 1 /* Non buffered, not nested, 8086 */ - - /* End of initialization table */ - .short 0 - -KiI8259MaskTable: - .long 0 /* IRQL 0 */ - .long 0 /* IRQL 1 */ - .long 0 /* IRQL 2 */ - .long 0 /* IRQL 3 */ - .long 0xFF800000 /* IRQL 4 */ - .long 0xFFC00000 /* IRQL 5 */ - .long 0xFFE00000 /* IRQL 6 */ - .long 0xFFF00000 /* IRQL 7 */ - .long 0xFFF80000 /* IRQL 8 */ - .long 0xFFFC0000 /* IRQL 9 */ - .long 0xFFFE0000 /* IRQL 10 */ - .long 0xFFFF0000 /* IRQL 11 */ - .long 0xFFFF8000 /* IRQL 12 */ - .long 0xFFFFC000 /* IRQL 13 */ - .long 0xFFFFE000 /* IRQL 14 */ - .long 0xFFFFF000 /* IRQL 15 */ - .long 0xFFFFF800 /* IRQL 16 */ - .long 0xFFFFFC00 /* IRQL 17 */ - .long 0xFFFFFE00 /* IRQL 18 */ - .long 0xFFFFFE00 /* IRQL 19 */ - .long 0xFFFFFE80 /* IRQL 20 */ - .long 0xFFFFFEC0 /* IRQL 21 */ - .long 0xFFFFFEE0 /* IRQL 22 */ - .long 0xFFFFFEF0 /* IRQL 23 */ - .long 0xFFFFFEF8 /* IRQL 24 */ - .long 0xFFFFFEF8 /* IRQL 25 */ - .long 0xFFFFFEFA /* IRQL 26 */ - .long 0xFFFFFFFA /* IRQL 27 */ - .long 0xFFFFFFFB /* IRQL 28 */ - .long 0xFFFFFFFB /* IRQL 29 */ - .long 0xFFFFFFFB /* IRQL 30 */ - .long 0xFFFFFFFB /* IRQL 31 */ - -FindHigherIrqlMask: - .long 0xFFFFFFFE /* IRQL 0 */ - .long 0xFFFFFFFC /* IRQL 1 */ - .long 0xFFFFFFF8 /* IRQL 2 */ - .long 0xFFFFFFF0 /* IRQL 3 */ - .long 0x7FFFFF0 /* IRQL 4 */ - .long 0x3FFFFF0 /* IRQL 5 */ - .long 0x1FFFFF0 /* IRQL 6 */ - .long 0x0FFFFF0 /* IRQL 7 */ - .long 0x7FFFF0 /* IRQL 8 */ - .long 0x3FFFF0 /* IRQL 9 */ - .long 0x1FFFF0 /* IRQL 10 */ - .long 0x0FFFF0 /* IRQL 11 */ - .long 0x7FFF0 /* IRQL 12 */ - .long 0x3FFF0 /* IRQL 13 */ - .long 0x1FFF0 /* IRQL 14 */ - .long 0x0FFF0 /* IRQL 15 */ - .long 0x7FF0 /* IRQL 16 */ - .long 0x3FF0 /* IRQL 17 */ - .long 0x1FF0 /* IRQL 18 */ - .long 0x1FF0 /* IRQL 19 */ - .long 0x17F0 /* IRQL 20 */ - .long 0x13F0 /* IRQL 21 */ - .long 0x11F0 /* IRQL 22 */ - .long 0x10F0 /* IRQL 23 */ - .long 0x1070 /* IRQL 24 */ - .long 0x1030 /* IRQL 25 */ - .long 0x1010 /* IRQL 26 */ - .long 0x10 /* IRQL 27 */ - .long 0 /* IRQL 28 */ - .long 0 /* IRQL 29 */ - .long 0 /* IRQL 30 */ - .long 0 /* IRQL 31 */ - -HalpSpecialDismissTable: -.rept 7 - .long GenericIRQ /* IRQ 0-7 */ -.endr - .long IRQ7 /* IRQ 7 */ - .rept 5 - .long GenericIRQ /* IRQ 8-12 */ -.endr - .long IRQ13 /* IRQ 13 */ - .long GenericIRQ /* IRQ 14 */ - .long IRQ15 /* IRQ 15 */ -.rept 20 - .long GenericIRQ /* IRQ 16-35 */ -.endr -#if DBG -.rept 172 - .long InvalidIRQ /* IRQ 36-207 */ -.endr -#endif - -HalpSpecialDismissLevelTable: - .rept 7 - .long GenericIRQLevel /* IRQ 0-7 */ - .endr - .long IRQ7Level /* IRQ 7 */ - .rept 5 - .long GenericIRQLevel /* IRQ 8-12 */ - .endr - .long IRQ13Level /* IRQ 13 */ - .long GenericIRQLevel /* IRQ 14 */ - .long IRQ15Level /* IRQ 15 */ - -SWInterruptLookUpTable: - .byte PASSIVE_LEVEL /* IRR 0 */ - .byte PASSIVE_LEVEL /* IRR 1 */ - .byte APC_LEVEL /* IRR 2 */ - .byte APC_LEVEL /* IRR 3 */ - .byte DISPATCH_LEVEL /* IRR 4 */ - .byte DISPATCH_LEVEL /* IRR 5 */ - .byte DISPATCH_LEVEL /* IRR 6 */ - .byte DISPATCH_LEVEL /* IRR 7 */ - -SWInterruptHandlerTable: - .long _KiUnexpectedInterrupt /* PASSIVE_LEVEL */ - .long _HalpApcInterrupt /* APC_LEVEL */ - .long _HalpDispatchInterrupt /* DISPATCH_LEVEL */ - -SWInterruptHandlerTable2: - .long _KiUnexpectedInterrupt /* PASSIVE_LEVEL */ - .long _HalpApcInterrupt2ndEntry /* APC_LEVEL */ - .long _HalpDispatchInterrupt2ndEntry /* DISPATCH_LEVEL */ - -_UnhandledMsg: - .asciz "\n\x7\x7!!! Unhandled or Unexpected Code at line: %lx!!!\n" - -/* FUNCTIONS *****************************************************************/ - -/* HAL interrupt handlers */ -GENERATE_HAL_INT_HANDLERS - -.globl _HalpHardwareInterruptLevel -.func HalpHardwareInterruptLevel -_HalpHardwareInterruptLevel: - - /* Get IRQL and check for pending interrupts */ - mov eax, PCR[KPCR_IRQL] - mov ecx, PCR[KPCR_IRR] - and ecx, FindHigherIrqlMask[eax*4] - jz NothingHardware - - /* Check the active IRR */ - test dword ptr PCR[KPCR_IRR_ACTIVE], 0xFFFFFFF0 - jnz NothingHardware - - /* Check for pending software interrupts */ - mov eax, ecx - bsr ecx, eax - mov eax, 1 - shl eax, cl - - /* Clear IRR */ - xor PCR[KPCR_IRR], eax - - /* Now dispatch the interrupt */ - call SWInterruptHandlerTable[ecx*4] - -NothingHardware: - ret -.endfunc - -.globl _HalpInitPICs@0 -.func HalpInitPICs@0 -_HalpInitPICs@0: - - /* Save ESI and disable interrupts */ - push esi - pushf - cli - - /* Read the init table */ - lea esi, PICInitTable - lodsw - -InitLoop: - - /* Put the port in EDX */ - movzx edx, ax - - /* Initialize the PIC, using a delay for each command */ - outsb - jmp $+2 - inc edx - outsb - jmp $+2 - outsb - jmp $+2 - outsb - jmp $+2 - - /* Mask all interrupts */ - mov al, 0xFF - out dx, al - - /* Check if we're done, otherwise initialize next PIC */ - lodsw - cmp ax, 0 - jnz InitLoop - - /* Read EISA Edge/Level Register */ - mov edx, 0x4D1 - in al, dx - mov ah, al - dec edx - in al, dx - - /* Clear reserved bits and see if there's anything there */ - and eax, 0xDEF8 - cmp eax, 0xDEF8 - jz NoEisa - - /* FIXME */ - //UNHANDLED_PATH - - /* Restore interrupts and return */ -NoEisa: - popf - pop esi - ret -.endfunc - -.globl @HalClearSoftwareInterrupt@4 -.func @HalClearSoftwareInterrupt@4, @HalClearSoftwareInterrupt@4 -@HalClearSoftwareInterrupt@4: - - /* Get IRR mask */ - mov eax, 1 - shl eax, cl - not eax - - /* Set IRR */ - and PCR[KPCR_IRR], eax - ret -.endfunc - -.globl @HalRequestSoftwareInterrupt@4 -.func @HalRequestSoftwareInterrupt@4, @HalRequestSoftwareInterrupt@4 -@HalRequestSoftwareInterrupt@4: - - /* Get IRR mask */ - mov eax, 1 - shl eax, cl - - /* Disable interrupts */ - pushf - cli - - /* Set IRR and get IRQL */ - or PCR[KPCR_IRR], eax - mov ecx, PCR[KPCR_IRQL] - - /* Get software IRR mask */ - mov eax, PCR[KPCR_IRR] - and eax, 3 - - /* Get highest pending software interrupt and check if it's higher */ - xor edx, edx - mov dl, SWInterruptLookUpTable[eax] - cmp dl, cl - jbe AfterCall - - /* Call the pending interrupt */ - call SWInterruptHandlerTable[edx*4] - -AfterCall: - - /* Retore interrupts and return */ - popf - ret -.endfunc - -.globl _HalDisableSystemInterrupt@8 -.func HalDisableSystemInterrupt@8 -_HalDisableSystemInterrupt@8: - - /* Convert to vector */ - movzx ecx, byte ptr [esp+4] - sub ecx, PRIMARY_VECTOR_BASE - - /* Disable interrupts and set the new IDR */ - mov edx, 1 - shl edx, cl - cli - or PCR[KPCR_IDR], edx - - /* Get the current mask */ - xor eax, eax - in al, 0xA1 - shl eax, 8 - in al, 0x21 - - /* Mask off the interrupt and write the new mask */ - or eax, edx - out 0x21, al - shr eax, 8 - out 0xA1, al - - /* Return with interrupts enabled */ - in al, 0xA1 - sti - ret 8 -.endfunc - -.globl _HalEnableSystemInterrupt@12 -.func HalEnableSystemInterrupt@12 -_HalEnableSystemInterrupt@12: - - /* Get the vector and validate it */ - movzx ecx, byte ptr [esp+4] - sub ecx, PRIMARY_VECTOR_BASE - jb Invalid - cmp ecx, CLOCK2_LEVEL - jnb Invalid - -#if 0 - /* Is PCI IRQ Routing enabled? */ - cmp byte ptr _HalpIrqMiniportInitialized, 0 - jz NoMiniport - - /* UNHANDLED */ - UNHANDLED_PATH - -NoMiniport: - /* Check if this is an EISA IRQ */ - bt _HalpEisaIrqIgnore, ecx - jb IgnoredIrq - - /* Clear the EISA Edge/Level Control Register */ - btr _HalpEisaELCR, ecx - - /* Get the interrupt type */ - mov al, [esp+12] - cmp al, 0 - jnz Latched - - /* Check the register again */ - bt _HalpEisaELCR, ecx - jb Dismiss - - /* Check if the miniport is active */ - cmp byte ptr _HalpIrqMiniportInitialized, 0 - jz Dismiss - - /* Update the EISA Edge/Level Control Register */ - bts _HalpEisaELCR, ecx - -Dismiss: - /* Use the level hardware interrupt handler */ - mov dword ptr SWInterruptHandlerTableHardware[ecx*4], offset _HalpHardwareInterruptLevel - mov edx, HalpSpecialDismissLevelTable[ecx*4] - mov HalpSpecialDismissTable[ecx*4], edx - -Latched: - /* Is PCI IRQ Routing enabled? */ - cmp byte ptr _HalpIrqMiniportInitialized, 0 - jz IgnoredIrq - - /* UNHANDLED */ - UNHANDLED_PATH -#endif -IgnoredIrq: - /* Calculate the new IDR */ - mov eax, 1 - shl eax, cl - not eax - cli - and PCR[KPCR_IDR], eax - - /* Get the current IRQL and mask the IRQs in the PIC */ - mov eax, PCR[KPCR_IRQL] - mov eax, KiI8259MaskTable[eax*4] - or eax, PCR[KPCR_IDR] - out 0x21, al - shr eax, 8 - out 0xA1, al - - /* Enable interrupts and return TRUE */ - sti - mov eax, 1 - ret 12 - -Invalid: - - /* Fail, invalid IRQ */ -#if DBG - int 3 -#endif - xor eax, eax - ret 12 -.endfunc - -.globl _HalBeginSystemInterrupt@12 -.func HalBeginSystemInterrupt@12 -_HalBeginSystemInterrupt@12: - - /* Convert to IRQ and call the handler */ - xor ecx, ecx - mov cl, byte ptr [esp+8] - sub ecx, PRIMARY_VECTOR_BASE - jmp HalpSpecialDismissTable[ecx*4] - -IRQ15: - /* This is IRQ 15, check if it's spurious */ - mov al, 0xB - out 0xA0, al - jmp $+2 - in al, 0xA0 - test al, 0x80 - jnz GenericIRQ - - /* Cascaded interrupt... dismiss it and return FALSE */ -CascadedInterrupt: - mov al, 0x62 - out 0x20, al - mov eax, 0 - ret 12 - -IRQ7: - /* This is IRQ 7, check if it's spurious */ - mov al, 0xB - out 0x20, al - jmp $+2 - in al, 0x20 - test al, 0x80 - jnz GenericIRQ - - /* It is, return FALSE */ - mov eax, 0 - ret 12 - -IRQ13: - /* AT 80287 latch clear */ - xor al, al - out 0xF0, al - -GenericIRQ: - /* Get current and new IRQL */ - xor eax, eax - mov al, byte ptr [esp+4] - mov ebx, PCR[KPCR_IRQL] - - /* Set and save old */ - mov PCR[KPCR_IRQL], eax - mov edx, [esp+12] - mov [edx], bl - - /* Set IRQ mask in the PIC */ - mov eax, KiI8259MaskTable[eax*4] - or eax, PCR[KPCR_IDR] - out 0x21, al - shr eax, 8 - out 0xA1, al - - /* Check to which PIC the EOI was sent */ - mov eax, ecx - cmp eax, 8 - jnb Pic1 - - /* Write mask to master PIC */ - or al, 0x60 - out 0x20, al - - /* Enable interrupts and return TRUE */ - sti - mov eax, 1 - ret 12 - -Pic1: - /* Write mask to slave PIC */ - mov al, 0x20 - out 0xA0, al - mov al, 0x62 - out 0x20, al - - /* Enable interrupts and return TRUE */ - sti - mov eax, 1 - ret 12 - -#if DBG -InvalidIRQ: - /* Dismiss it */ - mov eax, 0 - ret 12 -#endif -.endfunc - -IRQ15Level: - /* This is IRQ 15, check if it's spurious */ - mov al, 0xB - out 0xA0, al - jmp $+2 - in al, 0xA0 - test al, 0x80 - jnz GenericIRQLevel - jmp CascadedInterrupt - -IRQ7Level: - /* This is IRQ 7, check if it's spurious */ - mov al, 0xB - out 0x20, al - jmp $+2 - in al, 0x20 - test al, 0x80 - jnz GenericIRQLevel - - /* It is, return FALSE */ -SpuriousInterrupt: - mov eax, 0 - ret 12 - -IRQ13Level: - /* AT 80287 latch clear */ - xor al, al - out 0xF0, al - -GenericIRQLevel: - /* Save IRQL */ - xor eax, eax - mov al, [esp+4] - - /* Set IRQ mask in the PIC */ - mov eax, KiI8259MaskTable[eax*4] - or eax, PCR[KPCR_IDR] - out 0x21, al - shr eax, 8 - out 0xA1, al - - /* Compute new IRR */ - mov eax, ecx - mov ebx, 1 - add ecx, 4 - shl ebx, cl - or PCR[KPCR_IRR], ebx - - /* Get IRQLs */ - mov cl, [esp+4] - mov bl, PCR[KPCR_IRQL] - mov edx, [esp+12] - - /* Check to which PIC the EOI was sent */ - cmp eax, 8 - jnb Pic1Level - - /* Write mask to master PIC */ - or al, 0x60 - out 0x20, al - - /* Check for spurious */ - cmp cl, bl - jbe SpuriousInterrupt - - /* Write IRQL values */ - movzx ecx, cl - mov PCR[KPCR_IRQL], ecx - mov [edx], bl - - /* Enable interrupts and return TRUE */ - sti - mov eax, 1 - ret 12 - -Pic1Level: - /* Write mask to slave and master PIC */ - add al, 0x58 - out 0xA0, al - mov al, 0x62 - out 0x20, al - - /* Was this a lower interrupt? */ - cmp cl, bl - jbe SpuriousInterrupt - - /* Write IRQL values */ - movzx ecx, cl - mov PCR[KPCR_IRQL], ecx - mov [edx], bl - - /* Enable interrupts and return TRUE */ - sti - mov eax, 1 - ret 12 - -.globl _HalEndSystemInterrupt@8 -.func HalEndSystemInterrupt@8 -_HalEndSystemInterrupt@8: - - /* Read IRQL */ - xor ecx, ecx - mov cl, [esp+4] - - /* Check if it's a software interrupt */ - cmp dword ptr PCR[KPCR_IRQL], DISPATCH_LEVEL - jbe SkipMask2 - - /* Hardware interrupt, mask the appropriate IRQs in the PIC */ - mov eax, KiI8259MaskTable[ecx*4] - or eax, PCR[KPCR_IDR] - out 0x21, al - shr eax, 8 - out 0xA1, al - -SkipMask2: - - /* Set IRQL and check if there are pending software interrupts */ - mov PCR[KPCR_IRQL], ecx - mov eax, PCR[KPCR_IRR] - mov al, SWInterruptLookUpTable[eax] - cmp al, cl - ja DoCall - ret 8 - -DoCall: - - /* There are pending software interrupts, call their handlers */ - add esp, 12 - jmp SWInterruptHandlerTable2[eax*4] -.endfunc - -.globl @KfLowerIrql@4 -.func @KfLowerIrql@4 -_@KfLowerIrql@4: -@KfLowerIrql@4: - - /* Cleanup IRQL */ - and ecx, 0xFF - - /* Validate IRQL */ -#if DBG - cmp cl, PCR[KPCR_IRQL] - ja InvalidIrql -#endif - - /* Save flags since we'll disable interrupts */ - pushf - cli - - /* Disable interrupts and check if IRQL is below DISPATCH_LEVEL */ - cmp dword ptr PCR[KPCR_IRQL], DISPATCH_LEVEL - jbe SkipMask - - /* Clear interrupt masks since there's a pending hardware interrupt */ - mov eax, KiI8259MaskTable[ecx*4] - or eax, PCR[KPCR_IDR] - out 0x21, al - shr eax, 8 - out 0xA1, al - -SkipMask: - - /* Set the new IRQL and check if there's a pending software interrupt */ - mov PCR[KPCR_IRQL], ecx - mov eax, PCR[KPCR_IRR] - mov al, SWInterruptLookUpTable[eax] - cmp al, cl - ja DoCall3 - - /* Restore interrupts and return */ - popf - ret - -#if DBG -InvalidIrql: - /* Set HIGH_LEVEL */ - mov eax, PCR[KPCR_IRQL] - mov dword ptr PCR[KPCR_IRQL], HIGH_LEVEL - - /* Bugcheck the system */ - push 3 - push 0 - push ecx - push eax - push IRQL_NOT_LESS_OR_EQUAL - call _KeBugCheckEx@20 -#endif - -DoCall3: - /* There is, call it */ - call SWInterruptHandlerTable[eax*4] - - /* Restore interrupts and return */ - popf - ret -.endfunc - -.globl @KfRaiseIrql@4 -.func @KfRaiseIrql@4 -_@KfRaiseIrql@4: -@KfRaiseIrql@4: - - /* Get the IRQL */ - movzx ecx, cl - mov eax, PCR[KPCR_IRQL] - -#if DBG - /* Validate it */ - cmp eax, ecx - ja InvalidKfRaise -#endif - - /* Check if it's in the software level */ - cmp cl, DISPATCH_LEVEL - jbe SetIrql - - /* Save the current IRQL */ - mov edx, eax - - /* It's a hardware IRQL, so disable interrupts */ - pushf - cli - - /* Set the new IRQL */ - mov PCR[KPCR_IRQL], ecx - - /* Mask the interrupts in the PIC */ - mov eax, KiI8259MaskTable[ecx*4] - or eax, PCR[KPCR_IDR] - out 0x21, al - shr eax, 8 - out 0xA1, al - - /* Restore interrupts and return old IRQL */ - popf - mov eax, edx - ret - -SetIrql: - /* Set the IRQL and return */ - mov PCR[KPCR_IRQL], ecx - ret - -#if DBG -InvalidKfRaise: - /* Set to passive */ - mov dword ptr PCR[KPCR_IRQL], PASSIVE_LEVEL - - /* Bugcheck the system */ - push 9 - push 0 - push ecx - push eax - push IRQL_NOT_GREATER_OR_EQUAL - call _KeBugCheckEx@20 -#endif -.endfunc - -.globl _KeGetCurrentIrql@0 -.func KeGetCurrentIrql@0 -_KeGetCurrentIrql@0: - - /* Return the IRQL */ - mov eax, PCR[KPCR_IRQL] - ret -.endfunc - -.globl _KeRaiseIrqlToDpcLevel@0 -.func KeRaiseIrqlToDpcLevel@0 -_KeRaiseIrqlToDpcLevel@0: - - /* Get the current IRQL */ - mov eax, PCR[KPCR_IRQL] - - /* Set DISPATCH_LEVEL */ - mov dword ptr PCR[KPCR_IRQL], DISPATCH_LEVEL - -#if DBG - /* Make sure we were not higher then synch */ - cmp eax, DISPATCH_LEVEL - ja InvalidRaise -#endif - ret - -#if DBG -InvalidRaise: - /* Bugcheck the system */ - push 1 - push 0 - push DISPATCH_LEVEL - push eax - push IRQL_NOT_GREATER_OR_EQUAL - call _KeBugCheckEx@20 -#endif -.endfunc - -.globl _KeRaiseIrqlToSynchLevel@0 -.func KeRaiseIrqlToSynchLevel@0 -_KeRaiseIrqlToSynchLevel@0: - - /* Get the current IRQL */ - mov eax, PCR[KPCR_IRQL] - - /* Set SYNCH_LEVEL */ - mov dword ptr PCR[KPCR_IRQL], SYNCH_LEVEL - -#if DBG - /* Make sure we were not higher then dispatch */ - cmp eax, SYNCH_LEVEL - ja InvalidSyRaise -#endif - ret - -#if DBG -InvalidSyRaise: - /* Bugcheck the system */ - push 2 - push 0 - push SYNCH_LEVEL - push eax - push IRQL_NOT_GREATER_OR_EQUAL - call _KeBugCheckEx@20 -#endif -.endfunc - -.globl _HalpApcInterrupt -.func HalpApcInterrupt -TRAP_FIXUPS hapc_a, hapc_t, DoFixupV86, DoFixupAbios -_HalpApcInterrupt: - - /* Create fake interrupt stack */ - pop eax - pushf - push cs - push eax - - /* Enter interrupt */ - INT_PROLOG hapc_a, hapc_t, DoPushFakeErrorCode -.endfunc - -.globl _HalpApcInterrupt2ndEntry -.func HalpApcInterrupt2ndEntry -_HalpApcInterrupt2ndEntry: - - /* Save current IRQL and set to APC level */ - push PCR[KPCR_IRQL] - mov dword ptr PCR[KPCR_IRQL], APC_LEVEL - and dword ptr PCR[KPCR_IRR], ~(1 << APC_LEVEL) - - /* Enable interrupts and check if we came from User/V86 mode */ - sti - mov eax, [ebp+KTRAP_FRAME_CS] - and eax, MODE_MASK - test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK - jz DeliverApc - - /* Set user mode delivery */ - or eax, UserMode - -DeliverApc: - - /* Deliver the APCs */ - push ebp - push 0 - push eax - call _KiDeliverApc@12 - - /* Disable interrupts and end it */ - cli - call _HalpEndSoftwareInterrupt@4 - jmp _Kei386EoiHelper@0 -.endfunc - -.globl _HalpDispatchInterrupt -.func HalpDispatchInterrupt -TRAP_FIXUPS hdpc_a, hdpc_t, DoFixupV86, DoFixupAbios -_HalpDispatchInterrupt: - - /* Create fake interrupt stack */ - pop eax - pushf - push cs - push eax - - /* Enter interrupt */ - INT_PROLOG hdpc_a, hdpc_t, DoPushFakeErrorCode -.endfunc - -.globl _HalpDispatchInterrupt2ndEntry -.func HalpDispatchInterrupt2ndEntry -_HalpDispatchInterrupt2ndEntry: - - /* Save current IRQL and set to DPC level */ - push PCR[KPCR_IRQL] - mov dword ptr PCR[KPCR_IRQL], DISPATCH_LEVEL - and dword ptr PCR[KPCR_IRR], ~(1 << DISPATCH_LEVEL) - - /* Enable interrupts and let the kernel handle this */ - sti - call _KiDispatchInterrupt@0 - - /* Disable interrupts and end it */ - cli - call _HalpEndSoftwareInterrupt@4 - jmp _Kei386EoiHelper@0 -.endfunc - -.globl _HalpEndSoftwareInterrupt@4 -.func HalpEndSoftwareInterrupt@4 -_HalpEndSoftwareInterrupt@4: - - /* Get the IRQL and check if we're in the software region */ - movzx ecx, byte ptr [esp+4] - cmp dword ptr PCR[KPCR_IRQL], DISPATCH_LEVEL - jbe SoftwareInt - - /* Set the right mask in the PIC for the hardware IRQ */ - mov eax, KiI8259MaskTable[ecx*4] - or eax, PCR[KPCR_IDR] - out 0x21, al - shr eax, 8 - out 0xA1, al - -SoftwareInt: - /* Check if there are pending software interrupts */ - mov PCR[KPCR_IRQL], ecx - mov eax, PCR[KPCR_IRR] - mov al, SWInterruptLookUpTable[eax] - cmp al, cl - ja DoCall2 - ret 4 - -DoCall2: - /* There are pending softwate interrupts, call their handlers */ - add esp, 8 - jmp SWInterruptHandlerTable2[eax*4] -.endfunc Removed: branches/ros-amd64-bringup/reactos/hal/halx86/generic/portio.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/portio.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/portio.c (removed) @@ -1,121 +1,0 @@ -/* - * PROJECT: ReactOS HAL - * LICENSE: GPL - See COPYING in the top level directory - * FILE: hal/halx86/generic/portio.c - * PURPOSE: I/O Functions for access to ports - * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) - */ - -/* INCLUDES ******************************************************************/ - -#include <hal.h> -#define NDEBUG -#include <debug.h> - -// -// HAL Port to Inlined Port -// -#define H2I(Port) PtrToUshort(Port) - -/* FUNCTIONS *****************************************************************/ - -VOID -NTAPI -READ_PORT_BUFFER_UCHAR(IN PUCHAR Port, - OUT PUCHAR Buffer, - IN ULONG Count) -{ - __inbytestring(H2I(Port), Buffer, Count); -} - -VOID -NTAPI -READ_PORT_BUFFER_USHORT(IN PUSHORT Port, - OUT PUSHORT Buffer, - IN ULONG Count) -{ - __inwordstring(H2I(Port), Buffer, Count); -} - -VOID -NTAPI -READ_PORT_BUFFER_ULONG(IN PULONG Port, - OUT PULONG Buffer, - IN ULONG Count) -{ - __indwordstring(H2I(Port), Buffer, Count); -} - -UCHAR -NTAPI -READ_PORT_UCHAR(IN PUCHAR Port) -{ - return __inbyte(H2I(Port)); -} - -USHORT -NTAPI -READ_PORT_USHORT(IN PUSHORT Port) -{ - return __inword(H2I(Port)); -} - -ULONG -NTAPI -READ_PORT_ULONG(IN PULONG Port) -{ - return __indword(H2I(Port)); -} - -VOID -NTAPI -WRITE_PORT_BUFFER_UCHAR(IN PUCHAR Port, - IN PUCHAR Buffer, - IN ULONG Count) -{ - __outbytestring(H2I(Port), Buffer, Count); -} - -VOID -NTAPI -WRITE_PORT_BUFFER_USHORT(IN PUSHORT Port, - IN PUSHORT Buffer, - IN ULONG Count) -{ - __outwordstring(H2I(Port), Buffer, Count); -} - -VOID -NTAPI -WRITE_PORT_BUFFER_ULONG(IN PULONG Port, - IN PULONG Buffer, - IN ULONG Count) -{ - __outdwordstring(H2I(Port), Buffer, Count); -} - -VOID -NTAPI -WRITE_PORT_UCHAR(IN PUCHAR Port, - IN UCHAR Value) -{ - __outbyte(H2I(Port), Value); -} - -VOID -NTAPI -WRITE_PORT_USHORT(IN PUSHORT Port, - IN USHORT Value) -{ - __outword(H2I(Port), Value); -} - -VOID -NTAPI -WRITE_PORT_ULONG(IN PULONG Port, - IN ULONG Value) -{ - __outdword(H2I(Port), Value); -} - -/* EOF */ Removed: branches/ros-amd64-bringup/reactos/hal/halx86/generic/processor.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/processor.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/processor.c (removed) @@ -1,98 +1,0 @@ -/* - * PROJECT: ReactOS HAL - * LICENSE: GPL - See COPYING in the top level directory - * FILE: hal/halx86/up/processor.c - * PURPOSE: HAL Processor Routines - * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) - */ - -/* INCLUDES ******************************************************************/ - -#include <hal.h> -#define NDEBUG -#include <debug.h> - -LONG HalpActiveProcessors; -KAFFINITY HalpDefaultInterruptAffinity; - -/* PRIVATE FUNCTIONS *********************************************************/ - -VOID -NTAPI -HaliHaltSystem(VOID) -{ - /* Disable interrupts and halt the CPU */ - _disable(); - __halt(); -} - -/* FUNCTIONS *****************************************************************/ - -/* - * @implemented - */ -VOID -NTAPI -HalInitializeProcessor(IN ULONG ProcessorNumber, - IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - /* Set default IDR and stall count */ - KeGetPcr()->IDR = 0xFFFFFFFB; - KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT; - - /* Update the interrupt affinity and processor mask */ - InterlockedBitTestAndSet(&HalpActiveProcessors, ProcessorNumber); - InterlockedBitTestAndSet((PLONG)&HalpDefaultInterruptAffinity, - ProcessorNumber); - - /* Register routines for KDCOM */ - HalpRegisterKdSupportFunctions(); -} - -/* - * @implemented - */ -BOOLEAN -NTAPI -HalAllProcessorsStarted(VOID) -{ - /* Do nothing */ - return TRUE; -} - -/* - * @implemented - */ -BOOLEAN -NTAPI -HalStartNextProcessor(IN PLOADER_PARAMETER_BLOCK LoaderBlock, - IN PKPROCESSOR_STATE ProcessorState) -{ - /* Ready to start */ - return FALSE; -} - -/* - * @implemented - */ -VOID -NTAPI -HalProcessorIdle(VOID) -{ - /* Enable interrupts and halt the processor */ - _enable(); - __halt(); -} - -/* - * @implemented - */ -VOID -NTAPI -HalRequestIpi(KAFFINITY TargetProcessors) -{ - /* Not implemented on UP */ - __debugbreak(); -} - -/* EOF */ Removed: branches/ros-amd64-bringup/reactos/hal/halx86/generic/spinlock.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/spinlock.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/spinlock.c (removed) @@ -1,349 +1,0 @@ -/* - * PROJECT: ReactOS HAL - * LICENSE: GPL - See COPYING in the top level directory - * FILE: hal/halx86/up/spinlock.c - * PURPOSE: Spinlock and Queued Spinlock Support - * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) - */ - -/* INCLUDES ******************************************************************/ - -/* Enable this (and the define in irq.S) to make UP HAL work for MP Kernel */ -/* #define CONFIG_SMP */ - -#include <hal.h> -#define NDEBUG -#include <debug.h> - -#undef KeAcquireSpinLock -#undef KeReleaseSpinLock - -// -// This is duplicated from ke_x.h -// -#ifdef CONFIG_SMP -// -// Spinlock Acquisition at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* Make sure that we don't own the lock already */ - if (((KSPIN_LOCK)KeGetCurrentThread() | 1) == *SpinLock) - { - /* We do, bugcheck! */ - KeBugCheckEx(SPIN_LOCK_ALREADY_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); - } - - for (;;) - { - /* Try to acquire it */ - if (InterlockedBitTestAndSet((PLONG)SpinLock, 0)) - { - /* Value changed... wait until it's locked */ - while (*(volatile KSPIN_LOCK *)SpinLock == 1) - { -#ifdef DBG - /* On debug builds, we use a much slower but useful routine */ - //Kii386SpinOnSpinLock(SpinLock, 5); - - /* FIXME: Do normal yield for now */ - YieldProcessor(); -#else - /* Otherwise, just yield and keep looping */ - YieldProcessor(); -#endif - } - } - else - { -#ifdef DBG - /* On debug builds, we OR in the KTHREAD */ - *SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1; -#endif - /* All is well, break out */ - break; - } - } -} - -// -// Spinlock Release at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock) -{ -#ifdef DBG - /* Make sure that the threads match */ - if (((KSPIN_LOCK)KeGetCurrentThread() | 1) != *SpinLock) - { - /* They don't, bugcheck */ - KeBugCheckEx(SPIN_LOCK_NOT_OWNED, (ULONG_PTR)SpinLock, 0, 0, 0); - } -#endif - /* Clear the lock */ - InterlockedAnd((PLONG)SpinLock, 0); -} - -#else - -// -// Spinlock Acquire at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxAcquireSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ - UNREFERENCED_PARAMETER(SpinLock); -} - -// -// Spinlock Release at IRQL >= DISPATCH_LEVEL -// -FORCEINLINE -VOID -KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock) -{ - /* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ - UNREFERENCED_PARAMETER(SpinLock); -} - -#endif - -/* FUNCTIONS *****************************************************************/ - -/* - * @implemented - */ -VOID -NTAPI -KeAcquireSpinLock(PKSPIN_LOCK SpinLock, - PKIRQL OldIrql) -{ - /* Call the fastcall function */ - *OldIrql = KfAcquireSpinLock(SpinLock); -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KeAcquireSpinLockRaiseToSynch(PKSPIN_LOCK SpinLock) -{ - KIRQL OldIrql; - - /* Raise to sync */ - KeRaiseIrql(SYNCH_LEVEL, &OldIrql); - - /* Acquire the lock and return */ - KxAcquireSpinLock(SpinLock); - return OldIrql; -} - -/* - * @implemented - */ -VOID -NTAPI -KeReleaseSpinLock(PKSPIN_LOCK SpinLock, - KIRQL NewIrql) -{ - /* Call the fastcall function */ - KfReleaseSpinLock(SpinLock, NewIrql); -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KfAcquireSpinLock(PKSPIN_LOCK SpinLock) -{ - KIRQL OldIrql; - - /* Raise to dispatch and acquire the lock */ - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - KxAcquireSpinLock(SpinLock); - return OldIrql; -} - -/* - * @implemented - */ -VOID -FASTCALL -KfReleaseSpinLock(PKSPIN_LOCK SpinLock, - KIRQL OldIrql) -{ - /* Release the lock and lower IRQL back */ - KxReleaseSpinLock(SpinLock); - KeLowerIrql(OldIrql); -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) -{ - KIRQL OldIrql; - - /* Raise to dispatch */ - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - - /* Acquire the lock */ - KxAcquireSpinLock(KeGetCurrentPrcb()->LockQueue[LockNumber].Lock); // HACK - return OldIrql; -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) -{ - KIRQL OldIrql; - - /* Raise to synch */ - KeRaiseIrql(SYNCH_LEVEL, &OldIrql); - - /* Acquire the lock */ - KxAcquireSpinLock(KeGetCurrentPrcb()->LockQueue[LockNumber].Lock); // HACK - return OldIrql; -} - -/* - * @implemented - */ -VOID -FASTCALL -KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock, - IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - /* Set up the lock */ - LockHandle->LockQueue.Next = NULL; - LockHandle->LockQueue.Lock = SpinLock; - - /* Raise to dispatch */ - KeRaiseIrql(DISPATCH_LEVEL, &LockHandle->OldIrql); - - /* Acquire the lock */ - KxAcquireSpinLock(LockHandle->LockQueue.Lock); // HACK -} - -/* - * @implemented - */ -VOID -FASTCALL -KeAcquireInStackQueuedSpinLockRaiseToSynch(IN PKSPIN_LOCK SpinLock, - IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - /* Set up the lock */ - LockHandle->LockQueue.Next = NULL; - LockHandle->LockQueue.Lock = SpinLock; - - /* Raise to synch */ - KeRaiseIrql(SYNCH_LEVEL, &LockHandle->OldIrql); - - /* Acquire the lock */ - KxAcquireSpinLock(LockHandle->LockQueue.Lock); // HACK -} - -/* - * @implemented - */ -VOID -FASTCALL -KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, - IN KIRQL OldIrql) -{ - /* Release the lock */ - KxReleaseSpinLock(KeGetCurrentPrcb()->LockQueue[LockNumber].Lock); // HACK - - /* Lower IRQL back */ - KeLowerIrql(OldIrql); -} - -/* - * @implemented - */ -VOID -FASTCALL -KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - /* Simply lower IRQL back */ - KxReleaseSpinLock(LockHandle->LockQueue.Lock); // HACK - KeLowerIrql(LockHandle->OldIrql); -} - -/* - * @implemented - */ -BOOLEAN -FASTCALL -KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, - IN PKIRQL OldIrql) -{ -#ifdef CONFIG_SMP - ASSERT(FALSE); // FIXME: Unused - while (TRUE); -#endif - - /* Simply raise to synch */ - KeRaiseIrql(SYNCH_LEVEL, OldIrql); - - /* Always return true on UP Machines */ - return TRUE; -} - -/* - * @implemented - */ -LOGICAL -FASTCALL -KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, - OUT PKIRQL OldIrql) -{ -#ifdef CONFIG_SMP - ASSERT(FALSE); // FIXME: Unused - while (TRUE); -#endif - - /* Simply raise to dispatch */ - KeRaiseIrql(DISPATCH_LEVEL, OldIrql); - - /* Always return true on UP Machines */ - return TRUE; -} - -#undef KeRaiseIrql -/* - * @implemented - */ -VOID -NTAPI -KeRaiseIrql(KIRQL NewIrql, - PKIRQL OldIrql) -{ - /* Call the fastcall function */ - *OldIrql = KfRaiseIrql(NewIrql); -} - -#undef KeLowerIrql -/* - * @implemented - */ -VOID -NTAPI -KeLowerIrql(KIRQL NewIrql) -{ - /* Call the fastcall function */ - KfLowerIrql(NewIrql); -} Removed: branches/ros-amd64-bringup/reactos/hal/halx86/generic/systimer.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/systimer.S [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/systimer.S (removed) @@ -1,659 +1,0 @@ -/* - * FILE: hal/halx86/generic/timer.S - * COPYRIGHT: See COPYING in the top level directory - * PURPOSE: System Timer Interrupt and Management - * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net) - */ - -/* INCLUDES ******************************************************************/ - -#include <asm.h> -#include <internal/i386/asmmacro.S> -.intel_syntax noprefix - -/* GLOBALS *******************************************************************/ - -_HalpLastPerfCounterLow: .long 0 -_HalpLastPerfCounterHigh: .long 0 -_HalpPerfCounterLow: .long 0 -_HalpPerfCounterHigh: .long 0 -_HalpSystemHardwareFlags: .long 0 - -_UnhandledMsg: - .asciz "\n\x7\x7!!! Unhandled or Unexpected Code at line: %lx!!!\n" - -/* FUNCTIONS *****************************************************************/ - -.global _HalpReleaseCmosSpinLock@0 -.func HalpReleaseCmosSpinLock@0 -_HalpReleaseCmosSpinLock@0: - -#ifdef CONFIG_SMP - /* Save clobbered register */ - push eax - - /* Push saved EFLAGS */ - push _HalpSystemHardwareFlags - - /* Release the lock */ - lea eax, _HalpSystemHardwareLock - RELEASE_SPINLOCK(eax) - - /* Restore EFLAGS */ - popf - - /* Return */ - pop eax - ret -#else - /* Restore EFLAGS and return */ - push _HalpSystemHardwareFlags - popf - ret -#endif - -.endfunc - -.global _HalpAcquireSystemHardwareSpinLock@0 -.func HalpAcquireSystemHardwareSpinLock@0 -_HalpAcquireSystemHardwareSpinLock@0: - -#ifdef CONFIG_SMP - /* Save clobbered register */ - push eax - -HardwareLock: - /* Save EFLAGS and disable interrupts */ - pushf - cli - - /* This is the CMOS lock, acquire it */ - lea eax, _HalpSystemHardwareLock - ACQUIRE_SPINLOCK(eax, CmosSpin) - - /* We have it, return the flags */ - pop _HalpSystemHardwareFlags - pop eax - ret - -CmosSpin: - - /* Restore EFLAGS */ - pushf _HalpSystemHardwareLock - popf - - /* Spin */ - SPIN_ON_LOCK(eax, HardwareLock) -#else - /* Save EFLAGS, disable interrupts and return */ - pushf - cli - pop _HalpSystemHardwareFlags - ret -#endif - -.endfunc - -.global _HalpCalibrateStallExecution@0 -.func HalpCalibrateStallExecution@0 -_HalpCalibrateStallExecution@0: - - /* Setup the stack frame */ - push ebp - mov ebp, esp - sub esp, 12 - - /* Save EFLAGS and kill interrupts */ - pushf - cli - - /* Get the current interrupt mask on the PICs */ - xor eax, eax - in al, 0xA1 - shl eax, 8 - in al, 0x21 - - /* Save it */ - push eax - - /* Now mask everything except the RTC and PIC 2 chain-interrupt */ - mov eax, ~((1 << 2) | (1 << 8)) - - /* Program the PICs */ - out 0x21, al - shr eax, 8 - out 0xA1, al - - /* Now get the IDT */ - sidt [ebp-8] - mov ecx, [ebp-6] - - /* Get the IDT entry for the RTC */ - mov eax, 0x38 - shl eax, 3 - add ecx, eax - - /* Save the original RTC ISR */ - push [ecx] - push [ecx+4] - push ecx - - /* Now load our new handler */ - mov eax, offset OnlyOnePersonCanWriteHalCode - mov [ecx], ax - mov word ptr [ecx+2], KGDT_R0_CODE - mov word ptr [ecx+4], 0x8E00 - shr eax, 16 - mov [ecx+6], ax - - /* Reset our counter */ - mov dword ptr [ebp-12], 0 - - /* Acquire CMOS lock */ - call _HalpAcquireSystemHardwareSpinLock@0 - - /* Now initialize register A on the CMOS */ - mov ax, (0x2D << 8) | 0xA - out 0x70, al - jmp $+2 - mov al, ah - out 0x71, al - jmp $+2 - - /* Read register B */ - mov ax, 0xB - out 0x70, al - jmp $+2 - in al, 0x71 - jmp $+2 - - /* Don't touch the LastKnownGoodConfig hack */ - and al, 1 - mov ah, al - - /* Enable the interrupt */ - or ah, 0x42 - - /* Now write the register B */ - mov al, 0xB - out 0x70, al - jmp $+2 - mov al, ah - out 0x71, al - jmp $+2 - - /* Read register C */ - mov al, 0xC - out 0x70, al - jmp $+2 - in al, 0x71 - jmp $+2 - - /* Read register D */ - mov al, 0xD - out 0x70, al - jmp $+2 - in al, 0x71 - jmp $+2 - - /* Release CMOS lock */ - mov dword ptr [ebp-12], 0 - call _HalpReleaseCmosSpinLock@0 - - /* Initialize looper */ - xor eax, eax - - /* Align to 16 bytes */ - .align 16 - - /* Enable interrupts! */ - sti - jmp Looper - - /* Align to 16 bytes */ - .align 16 - - /* Subtract one count */ -Looper: - sub eax, 1 - jnz Looper - - /* ASSERT: If we got here, then the RTC never fired */ - call _DbgBreakPoint@0 - jmp Looper - -OnlyOnePersonCanWriteHalCode: - /*********************** THIS IS THE RTC HANDLER **************************/ - - /* Increment the interrupt count and check if this is the first one */ - inc dword ptr [ebp-12] - cmp dword ptr [ebp-12], 1 - jnz ComputeStall - - /* - * It is the first one -- we'll ignore it, since it fires randomly! - * Get rid of the old return address and push the new one in (our looper) - */ - pop eax - push offset Looper - - /* Acquire CMOS lock */ - call _HalpAcquireSystemHardwareSpinLock@0 - - /* Now initialize register A on the CMOS */ - mov ax, (0x2D << 8) | 0xA - out 0x70, al - jmp $+2 - mov al, ah - out 0x71, al - jmp $+2 - - /* Read register B */ - mov ax, 0xB - out 0x70, al - jmp $+2 - in al, 0x71 - jmp $+2 - - /* Don't touch the LastKnownGoodConfig hack */ - and al, 1 - mov ah, al - - /* Enable the interrupt */ - or ah, 0x42 - - /* Now write the register B */ - mov al, 0xB - out 0x70, al - jmp $+2 - mov al, ah - out 0x71, al - jmp $+2 - - /* Read register C */ - mov al, 0xC - out 0x70, al - jmp $+2 - in al, 0x71 - jmp $+2 - - /* Read register D */ - mov al, 0xD - out 0x70, al - jmp $+2 - in al, 0x71 - jmp $+2 - - /* Release CMOS lock */ - call _HalpReleaseCmosSpinLock@0 - - /* Dismiss the interrupt */ - mov al, 0x20 - out 0xA0, al - mov al, 0x62 - out 0x20, al - - /* Reset the counter and return back to the looper */ - xor eax, eax - iretd - - /******************* THIS IS THE 2ND RTC HANDLER **************************/ -ComputeStall: - - /* Do the calculation */ - neg eax - xor edx, edx - mov ecx, 125000 /* RTC fires every 125 ms */ - div ecx - - /* Is the remainder 0? */ - cmp edx, 0 - jz FoundFactor - - /* Otherwise fix-up the loop count */ - inc eax - -FoundFactor: - /* Save the stall scale factor */ - mov fs:[KPCR_STALL_SCALE_FACTOR], eax - - /* Prepare for interrupt return */ - pop eax - push offset AndItsNotYou - mov eax, 0x13 - - /* Acquire CMOS lock */ - call _HalpAcquireSystemHardwareSpinLock@0 - - /* Now initialize register A on the CMOS */ - mov ax, (0x2D << 8) | 0xA - out 0x70, al - jmp $+2 - mov al, ah - out 0x71, al - jmp $+2 - - /* Read register B */ - mov ax, 0xB - out 0x70, al - jmp $+2 - in al, 0x71 - jmp $+2 - - /* Don't touch the LastKnownGoodConfig hack */ - and al, 1 - mov ah, al - - /* Disable the interrupt */ - or ah, 0x2 - - /* Now write the register B */ - mov al, 0xB - out 0x70, al - jmp $+2 - mov al, ah - out 0x71, al - jmp $+2 - - /* Read register C */ - mov al, 0xC - out 0x70, al - jmp $+2 - in al, 0x71 - jmp $+2 - - /* Release CMOS lock */ - call _HalpReleaseCmosSpinLock@0 - - /* Dismiss the interrupt */ - mov al, 0x20 - out 0xA0, al - mov al, 0x62 - out 0x20, al - - /* Disable interrupts on return */ - and word ptr [esp+8], ~EFLAGS_INTERRUPT_MASK - iretd - - /************************* WE ARE BACK FROM RTC ***************************/ -AndItsNotYou: - - /* Restore the IDT */ - pop ecx - pop [ecx+4] - pop [ecx] - - /* Restore the mask */ - pop eax - out 0x21, al - shr eax, 8 - out 0xA1, al - - /* Restore EFLAGS */ - popf - - /* Restore stack and return */ - mov esp, ebp - pop ebp - ret -.endfunc - -.globl _KeStallExecutionProcessor@4 -.func KeStallExecutionProcessor@4 -_KeStallExecutionProcessor@4: - - /* Get the number of microseconds required */ - mov ecx, [esp+4] - jecxz Done - - /* Multiply by the stall factor */ - mov eax, fs:[KPCR_STALL_SCALE_FACTOR] - mul ecx - - /* Align to 16 bytes */ - .align 16 - - /* Jump to subtraction loop */ - jmp SubtractLoop - - /* Align to 16 bytes */ - .align 16 - - /* Subtract one count */ -SubtractLoop: - sub eax, 1 - jnz SubtractLoop - -Done: - /* Return */ - ret 4 -.endfunc - -.global _KeQueryPerformanceCounter@4 -.func KeQueryPerformanceCounter@4 -_KeQueryPerformanceCounter@4: - - /* Check if we were called too early */ - cmp dword ptr _HalpCurrentRollOver, 0 - je NoCount - - /* Save volatiles */ - push ebx - push esi - -LoopPreInt: - - /* Disable interrupts */ - pushf - cli - -LoopPostInt: - - /* Get the current value */ - mov ebx, _HalpPerfCounterLow - mov esi, _HalpPerfCounterHigh - - /* Read 8254 timer */ - mov al, 0 - out 0x43, al - jmp $+2 - in al, 0x40 - jmp $+2 - movzx ecx, al - in al, 0x40 - mov ch, al - - /* Enable interrupts and do a short wait */ - popf - nop - jmp $+2 - - /* Disable them again */ - pushf - cli - - /* Get the counter value again */ - mov eax, _HalpPerfCounterLow - mov edx, _HalpPerfCounterHigh - - /* Check if someone updated the counter */ - cmp eax, ebx - jnz LoopPostInt - cmp edx, esi - jnz LoopPostInt - - /* Check if the current 8254 value causes rollover */ - neg ecx - add ecx, _HalpCurrentRollOver - jnb DoRollOver - -SetSum: - - /* Calculate the sum */ - add eax, ecx - adc edx, 0 - - /* Check if we're above or below the last high value */ - cmp edx, _HalpLastPerfCounterHigh - jb short BelowHigh - jnz short BelowLow - - /* Check if we're above or below the last low value */ - cmp eax, _HalpLastPerfCounterLow - jb BelowHigh - -BelowLow: - - /* Update the last value and bring back interrupts */ - mov _HalpLastPerfCounterLow, eax - mov _HalpLastPerfCounterHigh, edx - popf - - /* Check if caller wants frequency */ - cmp dword ptr [esp+12], 0 - jz ReturnNoFreq - - /* Save hard-coded frequency */ - mov ecx, dword ptr [esp+12] - mov dword ptr [ecx], 1193182 - mov dword ptr [ecx+4], 0 - -ReturnNoFreq: - - /* Restore volatiles */ - pop esi - pop ebx - ret 4 - -NoCount: - - /* Return empty, called too soon */ - mov eax, 0 - mov edx, 0 - ret 4 - -DoRollOver: - - /* We might have an incoming interrupt, save EFLAGS and reset rollover */ - mov esi, [esp] - mov ecx, _HalpCurrentRollOver - popf - - /* Check if interrupts were enabled and try again */ - test esi, EFLAGS_INTERRUPT_MASK - jnz LoopPreInt - - /* They're not, continue where we left */ - pushf - jmp SetSum - -BelowHigh: - - /* Get the last counter values */ - mov ebx, _HalpLastPerfCounterLow - mov esi, _HalpLastPerfCounterHigh - - /* Check if the previous value was 0 and go back if yes */ - mov ecx, ebx - or ecx, esi - jz BelowLow - - /* Make sure that the count is still valid */ - sub ebx, eax - sbb esi, edx - jnz InvalidCount - cmp ebx, _HalpCurrentRollOver - jg InvalidCount - - /* Fixup the count with the last known value */ - sub eax, ebx - sbb edx, esi - - /* We might have an incoming interrupt, save EFLAGS */ - mov ecx, [esp] - popf - - /* Check if interrupts were enabled and try again */ - test ecx, EFLAGS_INTERRUPT_MASK - jnz LoopPreInt - - /* They're not, continue where we left */ - pushf - jmp BelowLow - -InvalidCount: - popf - xor eax, eax - mov _HalpLastPerfCounterLow, eax - mov _HalpLastPerfCounterHigh, eax - jmp LoopPreInt -.endfunc - -.globl _HalpClockInterrupt@0 -.func HalpClockInterrupt@0 -TRAP_FIXUPS hci_a, hci_t, DoFixupV86, DoFixupAbios -_HalpClockInterrupt@0: - - /* Enter trap */ - INT_PROLOG hci_a, hci_t, DoPushFakeErrorCode - - /* Push vector and make stack for IRQL */ - push 0x30 - sub esp, 4 - - /* Begin the interrupt */ - push esp - push 0x30 - push CLOCK2_LEVEL - call _HalBeginSystemInterrupt@12 - - /* Check if it's spurious */ - or al, al - jz Spurious - - /* Update the performance counter */ - xor ebx, ebx - mov eax, _HalpCurrentRollOver - add _HalpPerfCounterLow, eax - adc _HalpPerfCounterHigh, ebx - - /* Get the time increment and check if someone changed the clock rate */ - mov eax, _HalpCurrentTimeIncrement - cmp _HalpClockSetMSRate, ebx - jz _KeUpdateSystemTime@0 - - /* FIXME: Someone did! */ - int 3 - -Spurious: - - /* Exit the interrupt */ - add esp, 8 - jmp _Kei386EoiHelper@0 -.endfunc - -.globl _HalpProfileInterrupt@0 -.func HalpProfileInterrupt@0 -TRAP_FIXUPS hpi_a, hpi_t, DoFixupV86, DoFixupAbios -_HalpProfileInterrupt@0: - - /* Enter trap */ - INT_PROLOG hpi_a, hpi_t, DoPushFakeErrorCode - - /* Push vector and make stack for IRQL */ - push 0x38 - sub esp, 4 - - /* Begin the interrupt */ - push esp - push 0x38 - push PROFILE_LEVEL - call _HalBeginSystemInterrupt@12 - - /* Check if it's spurious */ - or al, al - jz Spurious - - /* FIXME: We should not be getting profile interrupts yet! */ - int 3 -.endfunc Removed: branches/ros-amd64-bringup/reactos/hal/halx86/generic/v86.s URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/v86.s [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/v86.s (removed) @@ -1,417 +1,0 @@ -/* - * FILE: hal/halx86/generic/bios.S - * COPYRIGHT: See COPYING in the top level directory - * PURPOSE: V8086 Real-Mode BIOS Thunking - * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net) - */ - -/* INCLUDES ******************************************************************/ - -#include <asm.h> -#include <internal/i386/asmmacro.S> -.intel_syntax noprefix - -// -// HAL BIOS Frame -// -#define HALP_BIOS_FRAME_SS 0x00 -#define HALP_BIOS_FRAME_ESP 0x04 -#define HALP_BIOS_FRAME_EFLAGS 0x08 -#define HALP_BIOS_FRAME_CS 0x0C -#define HALP_BIOS_FRAME_EIP 0x10 -#define HALP_BIOS_FRAME_TRAP_FRAME 0x14 -#define HALP_BIOS_FRAME_CS_LIMIT 0x18 -#define HALP_BIOS_FRAME_CS_BASE 0x1C -#define HALP_BIOS_FRAME_CS_FLAGS 0x20 -#define HALP_BIOS_FRAME_SS_LIMIT 0x24 -#define HALP_BIOS_FRAME_SS_BASE 0x28 -#define HALP_BIOS_FRAME_SS_FLAGS 0x2C -#define HALP_BIOS_FRAME_PREFIX 0x30 -#define HALP_BIOS_FRAME_LENGTH 0x34 - -/* GLOBALS *******************************************************************/ - -_HalpSavedEsp: - .long 0 - -_UnhandledMsg: - .asciz "\n\x7\x7!!! Unhandled or Unexpected Code at line: %lx!!!\n" - -/* FUNCTIONS *****************************************************************/ - -.globl _HalpBiosCall@0 -.func HalpBiosCall@0 -_HalpBiosCall@0: - - /* Set up stack pointer */ - push ebp - mov ebp, esp - - /* Build a trap frame */ - pushfd - push edi - push esi - push ebx - push ds - push es - push fs - push gs - push offset _HalpRealModeEnd - - /* Save the stack */ - mov _HalpSavedEsp, esp - - /* Turn off alignment faults */ - mov eax, cr0 - and eax, ~CR0_AM - mov cr0, eax - - /* Setup a new stack */ - mov esi, fs:KPCR_TSS - mov eax, esp - sub eax, NPX_FRAME_LENGTH - mov [esi+KTSS_ESP0], eax - - /* Save V86 registers */ - push 0 - push 0 - push 0 - push 0 - push 0x2000 - - /* Get linear delta between stack and code */ - mov eax, offset _HalpRealModeEnd-4 - sub eax, offset _HalpRealModeStart - - /* Get offset of code */ - mov edx, offset _HalpRealModeStart - and edx, 0xFFF - - /* Add offset to linear address and save the new V86 SP */ - add eax, edx - push eax - - /* Start building interrupt frame. Setup V86 EFLAGS and IOPL 3 */ - pushfd - or dword ptr [esp], EFLAGS_V86_MASK - or dword ptr [esp], 0x3000 - - /* Push the CS and IP */ - push 0x2000 - push edx - - /* Do the interrupt return (jump to V86 mode) */ - iretd - -.globl _HalpRealModeStart -_HalpRealModeStart: - - /* Set mode 13 */ - mov ax, 0x12 - .byte 0 - .byte 0 - - /* Do the interrupt */ - int 0x10 - - /* BOP to exit V86 mode */ - .byte 0xC4 - .byte 0xC4 - - /* The stack lives here */ -.align 4 - .space 2048 -.globl _HalpRealModeEnd -_HalpRealModeEnd: - - /* We're back, clean up the trap frame */ - pop gs - pop fs - pop es - pop ds - pop ebx - pop esi - pop edi - popfd - - /* Return to caller */ - pop ebp - ret 0 -.endfunc - -.globl _HalpOpcodeInvalid@0 -.func HalpOpcodeInvalid@0 -_HalpOpcodeInvalid@0: - - /* Unhandled */ - UNHANDLED_PATH - - /* Nothing to return */ - xor eax, eax - ret 0 -.endfunc - -.globl _HalpPushInt@0 -.func HalpPushInt@0 -_HalpPushInt@0: - - /* Save EBX */ - push ebx - - /* Get SS offset and base */ - mov edx, [esi+HALP_BIOS_FRAME_ESP] - mov ebx, [esi+HALP_BIOS_FRAME_SS_BASE] - - /* Convert to 16-bits */ - and edx, 0xFFFF - sub dx, 2 - - /* Get EFLAGS and write them into the linear address of SP */ - mov ax, word ptr [esi+HALP_BIOS_FRAME_EFLAGS] - mov [ebx+edx], ax - sub dx, 2 - - /* Get CS segment and write it into SP */ - mov ax, word ptr [esi+HALP_BIOS_FRAME_CS] - mov [ebx+edx], ax - sub dx, 2 - - /* Get IP and write it into SP */ - mov ax, word ptr [esi+HALP_BIOS_FRAME_EIP] - mov [ebx+edx], ax - - /* Get new IP value (the interrupt ID is in ECX, so this is in the IVT) */ - mov eax, [ecx*4] - push eax - - /* Now save the new IP */ - movzx eax, ax - mov [esi+HALP_BIOS_FRAME_EIP], eax - - /* Save the new CS of this IP */ - pop eax - shr eax, 16 - mov [esi+HALP_BIOS_FRAME_CS], eax - - /* Update the stack pointer after our manual interrupt frame construction */ - mov word ptr [esi+HALP_BIOS_FRAME_ESP], dx - - /* Get CS and convert it to linear format */ - mov eax, [esi+HALP_BIOS_FRAME_CS] - shl eax, 4 - mov [esi+HALP_BIOS_FRAME_CS_BASE], eax - mov dword ptr [esi+HALP_BIOS_FRAME_CS_LIMIT], 0xFFFF - mov dword ptr [esi+HALP_BIOS_FRAME_CS_FLAGS], 0 - - /* Return success and restore EBX */ - mov eax, 1 - pop ebx - ret 0 -.endfunc - -.globl _HalpOpcodeINTnn@0 -.func HalpOpcodeINTnn@0 -_HalpOpcodeINTnn@0: - - /* Save non-volatiles and stack */ - push ebp - push esi - push ebx - - /* Get SS and convert it to linear format */ - mov eax, [esi+HALP_BIOS_FRAME_SS] - shl eax, 4 - mov [esi+HALP_BIOS_FRAME_SS_BASE], eax - mov dword ptr [esi+HALP_BIOS_FRAME_SS_LIMIT], 0xFFFF - mov dword ptr [esi+HALP_BIOS_FRAME_SS_FLAGS], 0 - - /* Increase IP and check if we're past the CS limit */ - inc dword ptr [esi+HALP_BIOS_FRAME_EIP] - mov edi, [esi+HALP_BIOS_FRAME_EIP] - cmp edi, [esi+HALP_BIOS_FRAME_CS_LIMIT] - ja EipLimitReached - - /* Convert IP to linear address and read the interrupt number */ - add edi, [esi+HALP_BIOS_FRAME_CS_BASE] - movzx ecx, byte ptr [edi] - - /* Increase EIP and do the interrupt, check for status */ - inc dword ptr [esi+HALP_BIOS_FRAME_EIP] - call _HalpPushInt@0 - test eax, 0xFFFF - jz Done - - /* Update the trap frame */ - mov ebp, [esi+HALP_BIOS_FRAME_TRAP_FRAME] - mov eax, [esi+HALP_BIOS_FRAME_SS] - mov [ebp+KTRAP_FRAME_SS], eax - mov eax, [esi+HALP_BIOS_FRAME_ESP] - mov [ebp+KTRAP_FRAME_ESP], eax - mov eax, [esi+HALP_BIOS_FRAME_CS] - mov [ebp+KTRAP_FRAME_CS], eax - mov eax, [esi+HALP_BIOS_FRAME_EFLAGS] - mov [ebp+KTRAP_FRAME_EFLAGS], eax - - /* Set success code */ - mov eax, 1 - -Done: - /* Restore volatiles */ - pop ebx - pop edi - pop ebp - ret 0 - -EipLimitReached: - /* Set failure code */ - xor eax, eax - jmp Done -.endfunc - -.globl _HalpDispatchV86Opcode@0 -.func HalpDispatchV86Opcode@0 -_HalpDispatchV86Opcode@0: - - /* Make space for the HAL BIOS Frame on the stack */ - push ebp - mov ebp, esp - sub esp, HALP_BIOS_FRAME_LENGTH - - /* Save non-volatiles */ - push esi - push edi - - /* Save pointer to the trap frame */ - mov esi, [ebp] - mov [ebp-HALP_BIOS_FRAME_LENGTH+HALP_BIOS_FRAME_TRAP_FRAME], esi - - /* Save SS */ - movzx eax, word ptr [esi+KTRAP_FRAME_SS] - mov [ebp-HALP_BIOS_FRAME_LENGTH+HALP_BIOS_FRAME_SS], eax - - /* Save ESP */ - mov eax, [esi+KTRAP_FRAME_ESP] - mov [ebp-HALP_BIOS_FRAME_LENGTH+HALP_BIOS_FRAME_ESP], eax - - /* Save EFLAGS */ - mov eax, [esi+KTRAP_FRAME_EFLAGS] - mov [ebp-HALP_BIOS_FRAME_LENGTH+HALP_BIOS_FRAME_EFLAGS], eax - - /* Save CS */ - movzx eax, word ptr [esi+KTRAP_FRAME_CS] - mov [ebp-HALP_BIOS_FRAME_LENGTH+HALP_BIOS_FRAME_CS], eax - - /* Save EIP */ - mov eax, [esi+KTRAP_FRAME_EIP] - mov [ebp-HALP_BIOS_FRAME_LENGTH+HALP_BIOS_FRAME_EIP], eax - - /* No prefix */ - xor eax, eax - mov [ebp-HALP_BIOS_FRAME_LENGTH+HALP_BIOS_FRAME_PREFIX], eax - - /* Set pointer to HAL BIOS Frame */ - lea esi, [ebp-HALP_BIOS_FRAME_LENGTH] - - /* Convert CS to linear format */ - mov eax, [esi+HALP_BIOS_FRAME_CS] - shl eax, 4 - mov [esi+HALP_BIOS_FRAME_CS_BASE], eax - mov dword ptr [esi+HALP_BIOS_FRAME_CS_LIMIT], 0xFFFF - mov dword ptr [esi+HALP_BIOS_FRAME_CS_FLAGS], 0 - - /* Make sure IP is within the CS Limit */ - mov edi, [esi+HALP_BIOS_FRAME_EIP] - cmp edi, [esi+HALP_BIOS_FRAME_CS_LIMIT] - ja DispatchError - - /* Convert IP to linear address and read the opcode */ - add edi, [esi+HALP_BIOS_FRAME_CS_BASE] - mov dl, [edi] - - /* We only deal with interrupts */ - cmp dl, 0xCD - je DispatchInt - - /* Anything else is invalid */ - call _HalpOpcodeInvalid@0 - jmp DispatchError - -DispatchInt: - /* Handle dispatching the interrupt */ - call _HalpOpcodeINTnn@0 - test eax, 0xFFFF - jz DispatchReturn - - /* Update the trap frame EIP */ - mov edi, [ebp-0x20] - mov eax, [ebp-0x24] - mov [edi+KTRAP_FRAME_EIP], eax - - /* Set success code */ - mov eax, 1 - -DispatchReturn: - /* Restore registers and return */ - pop edi - pop esi - mov esp, ebp - pop ebp - ret 0 - -DispatchError: - /* Set failure code and return */ - xor eax, eax - jmp DispatchReturn -.endfunc - -.func Ki16BitStackException -_Ki16BitStackException: - - /* Save stack */ - push ss - push esp - - /* Go to kernel mode thread stack */ - mov eax, PCR[KPCR_CURRENT_THREAD] - add esp, [eax+KTHREAD_INITIAL_STACK] - - /* Switch to good stack segment */ - UNHANDLED_PATH -.endfunc - -.globl _HalpTrap0D@0 -.func HalpTrap0D@0 -TRAP_FIXUPS htd_a, htd_t, DoFixupV86, DoFixupAbios -_HalpTrap0D@0: - - /* Enter trap */ - TRAP_PROLOG htd_a, htd_t - - /* Check if this is a V86 trap */ - test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK - jnz DoDispatch - - /* Unhandled */ - UNHANDLED_PATH - -DoDispatch: - /* Handle the opcode */ - call _HalpDispatchV86Opcode@0 - - /* Exit the interrupt */ - jmp _Kei386EoiHelper@0 -.endfunc - -.globl _HalpTrap06@0 -.func HalpTrap06@0 -_HalpTrap06@0: - - /* Restore DS/ES segments */ - mov eax, KGDT_R3_DATA | RPL_MASK - mov ds, ax - mov es, ax - - /* Restore ESP and return */ - mov esp, _HalpSavedEsp - ret 0 -.endfunc Modified: branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic.rbuild [iso-8859-1] Thu Dec 31 15:57:24 2009 @@ -21,14 +21,18 @@ <file>display.c</file> <file>halinit.c</file> <file>misc.c</file> - <file>portio.c</file> <file>profil.c</file> <file>reboot.c</file> <file>sysinfo.c</file> - <file>systimer.S</file> <file>timer.c</file> <file>usage.c</file> - <file>v86.s</file> + <if property="ARCH" value="i386"> + <directory name="i386"> + <file>portio.c</file> + <file>systimer.S</file> + <file>v86.s</file> + </directory> + </if> </directory> <directory name="include"> <pch>hal.h</pch> Modified: branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_up.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_up.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/hal_generic_up.rbuild [iso-8859-1] Thu Dec 31 15:57:24 2009 @@ -5,7 +5,7 @@ <include>include</include> <include base="ntoskrnl">include</include> <define name="_NTHAL_" /> - <directory name="generic"> + <directory name="up"> <file>irq.S</file> <file>processor.c</file> <file>spinlock.c</file>
14 years, 11 months
1
0
0
0
[tkreuzer] 44824: Patch by Amine Khaldi: Fix buffer length check
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 31 15:44:33 2009 New Revision: 44824 URL:
http://svn.reactos.org/svn/reactos?rev=44824&view=rev
Log: Patch by Amine Khaldi: Fix buffer length check Modified: trunk/reactos/base/applications/cacls/cacls.c Modified: trunk/reactos/base/applications/cacls/cacls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cacls/ca…
============================================================================== --- trunk/reactos/base/applications/cacls/cacls.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cacls/cacls.c [iso-8859-1] Thu Dec 31 15:44:33 2009 @@ -180,14 +180,14 @@ PrintFileDacl(IN LPTSTR FilePath, IN LPTSTR FileName) { - SIZE_T Indent; + SIZE_T Length; PSECURITY_DESCRIPTOR SecurityDescriptor; DWORD SDSize = 0; TCHAR FullFileName[MAX_PATH + 1]; BOOL Error = FALSE, Ret = FALSE; - Indent = _tcslen(FilePath) + _tcslen(FileName); - if (Indent++ > MAX_PATH - 1) + Length = _tcslen(FilePath) + _tcslen(FileName); + if (Length > MAX_PATH) { /* file name too long */ SetLastError(ERROR_FILE_NOT_FOUND);
14 years, 11 months
1
0
0
0
[tkreuzer] 44823: [HAL] - Implement architecture specific HalpSetInterruptGate, replacing SetInterruptGate
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 31 15:29:50 2009 New Revision: 44823 URL:
http://svn.reactos.org/svn/reactos?rev=44823&view=rev
Log: [HAL] - Implement architecture specific HalpSetInterruptGate, replacing SetInterruptGate Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/misc.c branches/ros-amd64-bringup/reactos/hal/halx86/generic/misc.c branches/ros-amd64-bringup/reactos/hal/halx86/include/halp.h branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/misc.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halamd64/generic/misc.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halamd64/generic/misc.c [iso-8859-1] Thu Dec 31 15:29:50 2009 @@ -45,6 +45,40 @@ /* Use kernel memory manager I/O map facilities */ MmUnmapIoSpace(VirtualAddress, NumberPages << PAGE_SHIFT); } + +VOID +NTAPI +HalpInitIdtEntry(PKIDTENTRY64 Idt, PVOID Address) +{ + Idt->OffsetLow = (ULONG_PTR)Address & 0xffff; + Idt->OffsetMiddle = ((ULONG_PTR)Address >> 16) & 0xffff; + Idt->OffsetHigh = (ULONG_PTR)Address >> 32; + Idt->Selector = KGDT_64_R0_CODE; + Idt->IstIndex = 0; + Idt->Type = 0x0e; + Idt->Dpl = 0; + Idt->Present = 1; + Idt->Reserved0 = 0; + Idt->Reserved1 = 0; +} + +VOID +NTAPI +HalpSetInterruptGate(ULONG Index, PVOID Address) +{ + ULONG_PTR Flags; + + /* Disable interupts */ + Flags = __readeflags(); + _disable(); + + /* Initialize the entry */ + HalpInitIdtEntry(&KeGetPcr()->IdtBase[Index], Address); + + /* Enable interrupts if they were enabled previously */ + __writeeflags(Flags); +} + /* FUNCTIONS *****************************************************************/ Modified: branches/ros-amd64-bringup/reactos/hal/halx86/generic/misc.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/misc.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/misc.c [iso-8859-1] Thu Dec 31 15:29:50 2009 @@ -41,6 +41,27 @@ { /* Use kernel memory manager I/O map facilities */ MmUnmapIoSpace(VirtualAddress, NumberPages << PAGE_SHIFT); +} + +VOID +NTAPI +HalpSetInterruptGate(ULONG Index, PVOID address) +{ + KIDTENTRY *idt; + KIDT_ACCESS Access; + + /* Set the IDT Access Bits */ + Access.Reserved = 0; + Access.Present = 1; + Access.Dpl = 0; /* Kernel-Mode */ + Access.SystemSegmentFlag = 0; + Access.SegmentType = I386_INTERRUPT_GATE; + + idt = (KIDTENTRY*)((ULONG)KeGetPcr()->IDT + index * sizeof(KIDTENTRY)); + idt->Offset = (USHORT)((ULONG_PTR)address & 0xffff); + idt->Selector = KGDT_R0_CODE; + idt->Access = Access.Value; + idt->ExtendedOffset = (USHORT)((ULONG_PTR)address >> 16); } /* FUNCTIONS *****************************************************************/ @@ -103,3 +124,4 @@ /* Not implemented on x86 */ return; } + Modified: branches/ros-amd64-bringup/reactos/hal/halx86/include/halp.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/include/halp.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/include/halp.h [iso-8859-1] Thu Dec 31 15:29:50 2009 @@ -235,6 +235,10 @@ VOID ); +VOID +NTAPI +HalpSetInterruptGate(ULONG Index, PVOID Address); + #ifdef _M_AMD64 #define KfLowerIrql KeLowerIrql #ifndef CONFIG_SMP Modified: branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c [iso-8859-1] Thu Dec 31 15:29:50 2009 @@ -848,44 +848,6 @@ CPUMap[CPU].BusSpeed%1000000); } -VOID -SetInterruptGate(ULONG index, ULONG_PTR address) -{ -#ifdef _M_AMD64 - KIDTENTRY64 *idt; - - idt = &KeGetPcr()->IdtBase[index]; - - idt->OffsetLow = address & 0xffff; - idt->Selector = KGDT_64_R0_CODE; - idt->IstIndex = 0; - idt->Reserved0 = 0; - idt->Type = 0x0e; - idt->Dpl = 0; - idt->Present = 1; - idt->OffsetMiddle = (address >> 16) & 0xffff; - idt->OffsetHigh = address >> 32; - idt->Reserved1 = 0; - idt->Alignment = 0; -#else - KIDTENTRY *idt; - KIDT_ACCESS Access; - - /* Set the IDT Access Bits */ - Access.Reserved = 0; - Access.Present = 1; - Access.Dpl = 0; /* Kernel-Mode */ - Access.SystemSegmentFlag = 0; - Access.SegmentType = I386_INTERRUPT_GATE; - - idt = (KIDTENTRY*)((ULONG)KeGetPcr()->IDT + index * sizeof(KIDTENTRY)); - idt->Offset = (USHORT)(address & 0xffff); - idt->Selector = KGDT_R0_CODE; - idt->Access = Access.Value; - idt->ExtendedOffset = (USHORT)(address >> 16); -#endif -} - VOID HaliInitBSP(VOID) { #ifdef CONFIG_SMP @@ -904,11 +866,11 @@ BSPInitialized = TRUE; /* Setup interrupt handlers */ - SetInterruptGate(LOCAL_TIMER_VECTOR, (ULONG_PTR)MpsTimerInterrupt); - SetInterruptGate(ERROR_VECTOR, (ULONG_PTR)MpsErrorInterrupt); - SetInterruptGate(SPURIOUS_VECTOR, (ULONG_PTR)MpsSpuriousInterrupt); + HalpSetInterruptGate(LOCAL_TIMER_VECTOR, MpsTimerInterrupt); + HalpSetInterruptGate(ERROR_VECTOR, MpsErrorInterrupt); + HalpSetInterruptGate(SPURIOUS_VECTOR, MpsSpuriousInterrupt); #ifdef CONFIG_SMP - SetInterruptGate(IPI_VECTOR, (ULONG_PTR)MpsIpiInterrupt); + HalpSetInterruptGate(IPI_VECTOR, MpsIpiInterrupt); #endif DPRINT1("APIC is mapped at 0x%p\n", (PVOID)APICBase);
14 years, 11 months
1
0
0
0
← Newer
1
2
3
4
5
...
51
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Results per page:
10
25
50
100
200