mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 04:20:46 +00:00
[HAL]
- move v86 code out of trap.S into v86.S (APIC uses a different trap entry file), compile it directly in the dll instead of a lib to be able to silence linker warnings - Group files in HAL_PIC_SOURCE and HAL_APIC_SOURCE, you just need to replace PIC with APIC to build the hal with APIC support (we can later use it to build the other hals: halapic, halaacpi, halmacpi, halmps) - use apic on amd64 builds - give halacpi its own resource file - silence MSVC linker warnings svn path=/trunk/; revision=53616
This commit is contained in:
parent
29f16ed6c4
commit
6c556c3422
5 changed files with 84 additions and 43 deletions
|
@ -15,7 +15,6 @@ list(APPEND HAL_GENERIC_SOURCE
|
||||||
generic/drive.c
|
generic/drive.c
|
||||||
generic/memory.c
|
generic/memory.c
|
||||||
generic/misc.c
|
generic/misc.c
|
||||||
generic/profil.c
|
|
||||||
generic/reboot.c
|
generic/reboot.c
|
||||||
generic/sysinfo.c
|
generic/sysinfo.c
|
||||||
generic/usage.c)
|
generic/usage.c)
|
||||||
|
@ -23,10 +22,7 @@ list(APPEND HAL_GENERIC_SOURCE
|
||||||
if(ARCH MATCHES i386)
|
if(ARCH MATCHES i386)
|
||||||
list(APPEND HAL_GENERIC_SOURCE
|
list(APPEND HAL_GENERIC_SOURCE
|
||||||
generic/bios.c
|
generic/bios.c
|
||||||
generic/timer.c
|
generic/portio.c)
|
||||||
generic/portio.c
|
|
||||||
generic/systimer.S
|
|
||||||
generic/trap.S)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(lib_hal_generic ${HAL_GENERIC_SOURCE})
|
add_library(lib_hal_generic ${HAL_GENERIC_SOURCE})
|
||||||
|
@ -58,11 +54,28 @@ add_library(lib_hal_acpi ${HAL_ACPI_SOURCE})
|
||||||
#add_pch(lib_hal_acpi include/hal.h)
|
#add_pch(lib_hal_acpi include/hal.h)
|
||||||
target_link_libraries(lib_hal_acpi lib_hal_generic)
|
target_link_libraries(lib_hal_acpi lib_hal_generic)
|
||||||
|
|
||||||
if(ARCH MATCHES i386)
|
list(APPEND HAL_UP_SOURCE
|
||||||
list(APPEND HAL_UP_SOURCE
|
generic/spinlock.c
|
||||||
up/pic.c
|
generic/halinit.c
|
||||||
|
up/halinit_up.c
|
||||||
up/processor.c)
|
up/processor.c)
|
||||||
|
|
||||||
|
list(APPEND HAL_PIC_SOURCE
|
||||||
|
generic/profil.c
|
||||||
|
generic/timer.c
|
||||||
|
generic/systimer.S
|
||||||
|
generic/trap.S
|
||||||
|
up/pic.c)
|
||||||
|
|
||||||
|
list(APPEND HAL_APIC_SOURCE
|
||||||
|
apic/apic.c
|
||||||
|
apic/apictimer.c
|
||||||
|
apic/apictrap.S
|
||||||
|
apic/rtctimer.c
|
||||||
|
apic/tsc.c
|
||||||
|
apic/tsccal.S)
|
||||||
|
|
||||||
|
if(ARCH MATCHES i386)
|
||||||
list(APPEND MINI_HAL_SOURCE
|
list(APPEND MINI_HAL_SOURCE
|
||||||
generic/portio.c
|
generic/portio.c
|
||||||
generic/systimer.S
|
generic/systimer.S
|
||||||
|
@ -94,10 +107,9 @@ if(ARCH MATCHES i386)
|
||||||
# hal
|
# hal
|
||||||
add_library(hal SHARED
|
add_library(hal SHARED
|
||||||
${HAL_UP_SOURCE}
|
${HAL_UP_SOURCE}
|
||||||
up/halinit_up.c
|
${HAL_PIC_SOURCE}
|
||||||
|
generic/v86.S
|
||||||
up/halup.rc
|
up/halup.rc
|
||||||
generic/spinlock.c
|
|
||||||
generic/halinit.c
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/hal.def)
|
${CMAKE_CURRENT_BINARY_DIR}/hal.def)
|
||||||
target_link_libraries(hal lib_hal_generic lib_hal_legacy libcntpr)
|
target_link_libraries(hal lib_hal_generic lib_hal_legacy libcntpr)
|
||||||
add_importlibs(hal ntoskrnl)
|
add_importlibs(hal ntoskrnl)
|
||||||
|
@ -107,15 +119,17 @@ if(ARCH MATCHES i386)
|
||||||
set_subsystem(hal native)
|
set_subsystem(hal native)
|
||||||
set_image_base(hal 0x00010000)
|
set_image_base(hal 0x00010000)
|
||||||
add_cd_file(TARGET hal DESTINATION reactos/system32 NO_CAB FOR all)
|
add_cd_file(TARGET hal DESTINATION reactos/system32 NO_CAB FOR all)
|
||||||
|
if(MSVC)
|
||||||
|
add_target_link_flags(hal "/ignore:4216 /ignore:4078")
|
||||||
|
endif()
|
||||||
|
|
||||||
# hal acpi
|
# hal acpi
|
||||||
spec2def(halacpi.dll ../hal.spec halacpi)
|
spec2def(halacpi.dll ../hal.spec halacpi)
|
||||||
add_library(halacpi SHARED
|
add_library(halacpi SHARED
|
||||||
${HAL_UP_SOURCE}
|
${HAL_UP_SOURCE}
|
||||||
up/halinit_up.c
|
${HAL_PIC_SOURCE}
|
||||||
up/halup.rc
|
generic/v86.S
|
||||||
generic/spinlock.c
|
acpi/halacpi.rc
|
||||||
generic/halinit.c
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/halacpi.def)
|
${CMAKE_CURRENT_BINARY_DIR}/halacpi.def)
|
||||||
target_link_libraries(halacpi lib_hal_generic lib_hal_acpi libcntpr)
|
target_link_libraries(halacpi lib_hal_generic lib_hal_acpi libcntpr)
|
||||||
add_importlibs(halacpi ntoskrnl)
|
add_importlibs(halacpi ntoskrnl)
|
||||||
|
@ -125,6 +139,9 @@ if(ARCH MATCHES i386)
|
||||||
set_image_base(halacpi 0x00010000)
|
set_image_base(halacpi 0x00010000)
|
||||||
set_property(TARGET halacpi PROPERTY COMPILE_DEFINITIONS CONFIG_ACPI)
|
set_property(TARGET halacpi PROPERTY COMPILE_DEFINITIONS CONFIG_ACPI)
|
||||||
add_cd_file(TARGET halacpi DESTINATION reactos/system32 NO_CAB FOR all)
|
add_cd_file(TARGET halacpi DESTINATION reactos/system32 NO_CAB FOR all)
|
||||||
|
if(MSVC)
|
||||||
|
add_target_link_flags(halacpi "/ignore:4216 /ignore:4078")
|
||||||
|
endif()
|
||||||
|
|
||||||
# mini_hal
|
# mini_hal
|
||||||
add_library(mini_hal ${MINI_HAL_SOURCE})
|
add_library(mini_hal ${MINI_HAL_SOURCE})
|
||||||
|
@ -138,13 +155,11 @@ elseif(ARCH MATCHES amd64)
|
||||||
list(APPEND HAL_SOURCE
|
list(APPEND HAL_SOURCE
|
||||||
${HAL_GENERIC_SOURCE}
|
${HAL_GENERIC_SOURCE}
|
||||||
${HAL_ACPI_SOURCE}
|
${HAL_ACPI_SOURCE}
|
||||||
${HAL_UP_SOURCE}
|
${HAL_APIC_SOURCE}
|
||||||
generic/spinlock.c
|
generic/spinlock.c
|
||||||
generic/halinit.c
|
generic/halinit.c
|
||||||
amd64/x86bios.c
|
amd64/x86bios.c
|
||||||
amd64/halinit.c
|
amd64/halinit.c
|
||||||
amd64/stubs.c
|
|
||||||
amd64/systimer.S
|
|
||||||
amd64/processor.c
|
amd64/processor.c
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/hal.def)
|
${CMAKE_CURRENT_BINARY_DIR}/hal.def)
|
||||||
|
|
||||||
|
@ -158,6 +173,9 @@ elseif(ARCH MATCHES amd64)
|
||||||
set_image_base(hal 0x00010000)
|
set_image_base(hal 0x00010000)
|
||||||
add_importlibs(hal ntoskrnl)
|
add_importlibs(hal ntoskrnl)
|
||||||
target_link_libraries(hal libcntpr)
|
target_link_libraries(hal libcntpr)
|
||||||
|
if(MSVC)
|
||||||
|
add_target_link_flags(hal "/ignore:4216")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_cd_file(TARGET hal DESTINATION reactos/system32 NO_CAB FOR all)
|
add_cd_file(TARGET hal DESTINATION reactos/system32 NO_CAB FOR all)
|
||||||
|
|
||||||
|
|
5
reactos/hal/halx86/acpi/halacpi.rc
Normal file
5
reactos/hal/halx86/acpi/halacpi.rc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#define REACTOS_VERSION_DLL
|
||||||
|
#define REACTOS_STR_FILE_DESCRIPTION "X86 Uniprocessor Hardware Abstraction Layer\0"
|
||||||
|
#define REACTOS_STR_INTERNAL_NAME "halacpi\0"
|
||||||
|
#define REACTOS_STR_ORIGINAL_FILENAME "halacpi.dll\0"
|
||||||
|
#include <reactos/version.rc>
|
|
@ -20,28 +20,4 @@ TRAP_ENTRY HalpApcInterrupt, KI_SOFTWARE_TRAP
|
||||||
TRAP_ENTRY HalpClockInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
TRAP_ENTRY HalpClockInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
||||||
TRAP_ENTRY HalpProfileInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
TRAP_ENTRY HalpProfileInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
||||||
|
|
||||||
PUBLIC @HalpExitToV86@4
|
|
||||||
@HalpExitToV86@4:
|
|
||||||
/* Point esp to the iret frame and return */
|
|
||||||
lea esp, [ecx + KTRAP_FRAME_EIP]
|
|
||||||
iretd
|
|
||||||
|
|
||||||
/* Here starts the real mode code */
|
|
||||||
.code16
|
|
||||||
PUBLIC _HalpRealModeStart
|
|
||||||
_HalpRealModeStart:
|
|
||||||
/* INT 0x10: AH = 0 (Set video Mode), AL = 0x12 (Mode 12) */
|
|
||||||
mov eax, HEX(12)
|
|
||||||
int HEX(10)
|
|
||||||
|
|
||||||
/* BOP */
|
|
||||||
.byte HEX(C4), HEX(C4)
|
|
||||||
|
|
||||||
/* The real mode stack */
|
|
||||||
.align 4
|
|
||||||
.space 2048
|
|
||||||
_HalpRealModeEnd:
|
|
||||||
PUBLIC _HalpRealModeEnd
|
|
||||||
.endcode16
|
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
41
reactos/hal/halx86/generic/v86.S
Normal file
41
reactos/hal/halx86/generic/v86.S
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*
|
||||||
|
* FILE: hal/halx86/generic/v86.S
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PURPOSE: System Traps, Entrypoints and Exitpoints
|
||||||
|
* PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
||||||
|
* NOTE: See asmmacro.S for the shared entry/exit code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
|
#include <asm.inc>
|
||||||
|
|
||||||
|
#include <ks386.inc>
|
||||||
|
|
||||||
|
.code
|
||||||
|
|
||||||
|
PUBLIC @HalpExitToV86@4
|
||||||
|
@HalpExitToV86@4:
|
||||||
|
/* Point esp to the iret frame and return */
|
||||||
|
lea esp, [ecx + KTRAP_FRAME_EIP]
|
||||||
|
iretd
|
||||||
|
|
||||||
|
/* Here starts the real mode code */
|
||||||
|
.code16
|
||||||
|
PUBLIC _HalpRealModeStart
|
||||||
|
_HalpRealModeStart:
|
||||||
|
/* INT 0x10: AH = 0 (Set video Mode), AL = 0x12 (Mode 12) */
|
||||||
|
mov eax, HEX(12)
|
||||||
|
int HEX(10)
|
||||||
|
|
||||||
|
/* BOP */
|
||||||
|
.byte HEX(C4), HEX(C4)
|
||||||
|
|
||||||
|
/* The real mode stack */
|
||||||
|
.align 4
|
||||||
|
.space 2048
|
||||||
|
_HalpRealModeEnd:
|
||||||
|
PUBLIC _HalpRealModeEnd
|
||||||
|
.endcode16
|
||||||
|
|
||||||
|
END
|
|
@ -24,6 +24,7 @@
|
||||||
<file>portio.c</file>
|
<file>portio.c</file>
|
||||||
<file>systimer.S</file>
|
<file>systimer.S</file>
|
||||||
<file>trap.S</file>
|
<file>trap.S</file>
|
||||||
|
<file>v86.S</file>
|
||||||
</if>
|
</if>
|
||||||
</directory>
|
</directory>
|
||||||
<directory name="include">
|
<directory name="include">
|
||||||
|
|
Loading…
Reference in a new issue