Changeset - r15904:c3bbddd12acd
[Not reviewed]
master
2 9 0
michi_cc - 14 years ago 2010-08-23 18:19:15
michi_cc@openttd.org
(svn r20598) -Codechange: [Win32] Replace the external x64 asm with a built-in Windows function.
11 files changed with 14 insertions and 571 deletions:
0 comments (0 inline, 0 general)
projects/openttd_vs100.vcxproj
Show inline comments
 
@@ -47,9 +47,6 @@
 
    <WholeProgramOptimization>true</WholeProgramOptimization>
 
  </PropertyGroup>
 
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 
  <ImportGroup Label="ExtensionSettings">
 
    <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
 
  </ImportGroup>
 
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 
  </ImportGroup>
 
@@ -1090,17 +1087,6 @@
 
    <ClCompile Include="..\src\thread\thread_win32.cpp" />
 
  </ItemGroup>
 
  <ItemGroup>
 
    <MASM Include="..\src\os\windows\win64.asm">
 
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 
      <PreserveIdentifierCase Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">1</PreserveIdentifierCase>
 
      <PreservePublicAndExternSymbolCase Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</PreservePublicAndExternSymbolCase>
 
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 
      <PreserveIdentifierCase Condition="'$(Configuration)|$(Platform)'=='Release|x64'">1</PreserveIdentifierCase>
 
      <PreservePublicAndExternSymbolCase Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</PreservePublicAndExternSymbolCase>
 
      <FileType>Document</FileType>
 
    </MASM>
 
  </ItemGroup>
 
  <ItemGroup>
 
    <None Include="..\media\openttd.ico" />
 
    <None Include="..\readme.txt" />
 
  </ItemGroup>
 
@@ -1119,7 +1105,4 @@
 
    </ProjectReference>
 
  </ItemGroup>
 
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
 
  <ImportGroup Label="ExtensionTargets">
 
    <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
 
  </ImportGroup>
 
</Project>
projects/openttd_vs100.vcxproj.filters
Show inline comments
 
@@ -91,10 +91,6 @@
 
    <Filter Include="Threading">
 
      <UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000029}</UniqueIdentifier>
 
    </Filter>
 
    <Filter Include="64-bit Specific Files">
 
      <UniqueIdentifier>{d55d5f1f-aa07-4839-80d7-5ae158609e61}</UniqueIdentifier>
 
      <Extensions>asm</Extensions>
 
    </Filter>
 
  </ItemGroup>
 
  <ItemGroup>
 
    <ClCompile Include="..\src\airport.cpp">
 
@@ -2472,9 +2468,4 @@
 
    <None Include="..\media\openttd.ico" />
 
    <None Include="..\readme.txt" />
 
  </ItemGroup>
 
  <ItemGroup>
 
    <MASM Include="..\src\os\windows\win64.asm">
 
      <Filter>64-bit Specific Files</Filter>
 
    </MASM>
 
  </ItemGroup>
 
</Project>
projects/openttd_vs100.vcxproj.filters.in
Show inline comments
 
@@ -2,10 +2,6 @@
 
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
  <ItemGroup>
 
!!FILTERS!!
 
    <Filter Include="64-bit Specific Files">
 
      <UniqueIdentifier>{d55d5f1f-aa07-4839-80d7-5ae158609e61}</UniqueIdentifier>
 
      <Extensions>asm</Extensions>
 
    </Filter>
 
  </ItemGroup>
 
  <ItemGroup>
 
!!FILES!!
 
@@ -14,9 +10,4 @@
 
    <None Include="..\media\openttd.ico" />
 
    <None Include="..\readme.txt" />
 
  </ItemGroup>
 
  <ItemGroup>
 
    <MASM Include="..\src\os\windows\win64.asm">
 
      <Filter>64-bit Specific Files</Filter>
 
    </MASM>
 
  </ItemGroup>
 
</Project>
projects/openttd_vs100.vcxproj.in
Show inline comments
 
@@ -47,9 +47,6 @@
 
    <WholeProgramOptimization>true</WholeProgramOptimization>
 
  </PropertyGroup>
 
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 
  <ImportGroup Label="ExtensionSettings">
 
    <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
 
  </ImportGroup>
 
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 
  </ImportGroup>
 
@@ -301,17 +298,6 @@
 
!!FILES!!
 
  </ItemGroup>
 
  <ItemGroup>
 
    <MASM Include="..\src\os\windows\win64.asm">
 
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 
      <PreserveIdentifierCase Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">1</PreserveIdentifierCase>
 
      <PreservePublicAndExternSymbolCase Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</PreservePublicAndExternSymbolCase>
 
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 
      <PreserveIdentifierCase Condition="'$(Configuration)|$(Platform)'=='Release|x64'">1</PreserveIdentifierCase>
 
      <PreservePublicAndExternSymbolCase Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</PreservePublicAndExternSymbolCase>
 
      <FileType>Document</FileType>
 
    </MASM>
 
  </ItemGroup>
 
  <ItemGroup>
 
    <None Include="..\media\openttd.ico" />
 
    <None Include="..\readme.txt" />
 
  </ItemGroup>
 
@@ -330,7 +316,4 @@
 
    </ProjectReference>
 
  </ItemGroup>
 
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
 
  <ImportGroup Label="ExtensionTargets">
 
    <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
 
  </ImportGroup>
 
</Project>
projects/openttd_vs80.vcproj
Show inline comments
 
@@ -14,11 +14,6 @@
 
			Name="x64"
 
		/>
 
	</Platforms>
 
	<ToolFiles>
 
		<ToolFile
 
			RelativePath="..\src\os\windows\masm64.rules"
 
		/>
 
	</ToolFiles>
 
	<Configurations>
 
		<Configuration
 
			Name="Release|Win32"
 
@@ -38,9 +33,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -151,9 +143,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -250,9 +239,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -364,9 +350,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -3732,49 +3715,6 @@
 
				>
 
			</File>
 
		</Filter>
 
		<Filter
 
			Name="64-bit Specific Files"
 
			Filter="asm"
 
			>
 
			<File
 
				RelativePath=".\..\src\os\windows\win64.asm"
 
				>
 
				<FileConfiguration
 
					Name="Release|Win32"
 
					ExcludedFromBuild="true"
 
					>
 
					<Tool
 
						Name="VCCustomBuildTool"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Debug|Win32"
 
					ExcludedFromBuild="true"
 
					>
 
					<Tool
 
						Name="VCCustomBuildTool"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Release|x64"
 
					>
 
					<Tool
 
						Name="MASM AMD64"
 
						PreserveIdentifierCase="true"
 
						PreservePublicAndExternSymbolCase="true"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Debug|x64"
 
					>
 
					<Tool
 
						Name="MASM AMD64"
 
						PreserveIdentifierCase="true"
 
						PreservePublicAndExternSymbolCase="true"
 
					/>
 
				</FileConfiguration>
 
			</File>
 
		</Filter>
 
		<File
 
			RelativePath=".\..\media\openttd.ico"
 
			>
projects/openttd_vs80.vcproj.in
Show inline comments
 
@@ -14,11 +14,6 @@
 
			Name="x64"
 
		/>
 
	</Platforms>
 
	<ToolFiles>
 
		<ToolFile
 
			RelativePath="..\src\os\windows\masm64.rules"
 
		/>
 
	</ToolFiles>
 
	<Configurations>
 
		<Configuration
 
			Name="Release|Win32"
 
@@ -38,9 +33,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -151,9 +143,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -250,9 +239,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -364,9 +350,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -453,49 +436,6 @@
 
	</References>
 
	<Files>
 
!!FILES!!
 
		<Filter
 
			Name="64-bit Specific Files"
 
			Filter="asm"
 
			>
 
			<File
 
				RelativePath=".\..\src\os\windows\win64.asm"
 
				>
 
				<FileConfiguration
 
					Name="Release|Win32"
 
					ExcludedFromBuild="true"
 
					>
 
					<Tool
 
						Name="VCCustomBuildTool"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Debug|Win32"
 
					ExcludedFromBuild="true"
 
					>
 
					<Tool
 
						Name="VCCustomBuildTool"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Release|x64"
 
					>
 
					<Tool
 
						Name="MASM AMD64"
 
						PreserveIdentifierCase="true"
 
						PreservePublicAndExternSymbolCase="true"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Debug|x64"
 
					>
 
					<Tool
 
						Name="MASM AMD64"
 
						PreserveIdentifierCase="true"
 
						PreservePublicAndExternSymbolCase="true"
 
					/>
 
				</FileConfiguration>
 
			</File>
 
		</Filter>
 
		<File
 
			RelativePath=".\..\media\openttd.ico"
 
			>
projects/openttd_vs90.vcproj
Show inline comments
 
@@ -15,11 +15,6 @@
 
			Name="x64"
 
		/>
 
	</Platforms>
 
	<ToolFiles>
 
		<ToolFile
 
			RelativePath="..\src\os\windows\masm64.rules"
 
		/>
 
	</ToolFiles>
 
	<Configurations>
 
		<Configuration
 
			Name="Release|Win32"
 
@@ -39,9 +34,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -150,9 +142,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -248,9 +237,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -361,9 +347,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -3729,49 +3712,6 @@
 
				>
 
			</File>
 
		</Filter>
 
		<Filter
 
			Name="64-bit Specific Files"
 
			Filter="asm"
 
			>
 
			<File
 
				RelativePath=".\..\src\os\windows\win64.asm"
 
				>
 
				<FileConfiguration
 
					Name="Release|Win32"
 
					ExcludedFromBuild="true"
 
					>
 
					<Tool
 
						Name="VCCustomBuildTool"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Debug|Win32"
 
					ExcludedFromBuild="true"
 
					>
 
					<Tool
 
						Name="VCCustomBuildTool"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Release|x64"
 
					>
 
					<Tool
 
						Name="MASM AMD64"
 
						PreserveIdentifierCase="true"
 
						PreservePublicAndExternSymbolCase="true"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Debug|x64"
 
					>
 
					<Tool
 
						Name="MASM AMD64"
 
						PreserveIdentifierCase="true"
 
						PreservePublicAndExternSymbolCase="true"
 
					/>
 
				</FileConfiguration>
 
			</File>
 
		</Filter>
 
		<File
 
			RelativePath=".\..\media\openttd.ico"
 
			>
projects/openttd_vs90.vcproj.in
Show inline comments
 
@@ -15,11 +15,6 @@
 
			Name="x64"
 
		/>
 
	</Platforms>
 
	<ToolFiles>
 
		<ToolFile
 
			RelativePath="..\src\os\windows\masm64.rules"
 
		/>
 
	</ToolFiles>
 
	<Configurations>
 
		<Configuration
 
			Name="Release|Win32"
 
@@ -39,9 +34,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -150,9 +142,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -248,9 +237,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -361,9 +347,6 @@
 
				Name="VCCustomBuildTool"
 
			/>
 
			<Tool
 
				Name="MASM AMD64"
 
			/>
 
			<Tool
 
				Name="VCXMLDataGeneratorTool"
 
			/>
 
			<Tool
 
@@ -450,49 +433,6 @@
 
	</References>
 
	<Files>
 
!!FILES!!
 
		<Filter
 
			Name="64-bit Specific Files"
 
			Filter="asm"
 
			>
 
			<File
 
				RelativePath=".\..\src\os\windows\win64.asm"
 
				>
 
				<FileConfiguration
 
					Name="Release|Win32"
 
					ExcludedFromBuild="true"
 
					>
 
					<Tool
 
						Name="VCCustomBuildTool"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Debug|Win32"
 
					ExcludedFromBuild="true"
 
					>
 
					<Tool
 
						Name="VCCustomBuildTool"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Release|x64"
 
					>
 
					<Tool
 
						Name="MASM AMD64"
 
						PreserveIdentifierCase="true"
 
						PreservePublicAndExternSymbolCase="true"
 
					/>
 
				</FileConfiguration>
 
				<FileConfiguration
 
					Name="Debug|x64"
 
					>
 
					<Tool
 
						Name="MASM AMD64"
 
						PreserveIdentifierCase="true"
 
						PreservePublicAndExternSymbolCase="true"
 
					/>
 
				</FileConfiguration>
 
			</File>
 
		</Filter>
 
		<File
 
			RelativePath=".\..\media\openttd.ico"
 
			>
src/os/windows/crashlog_win.cpp
Show inline comments
 
@@ -10,6 +10,12 @@
 
/** @file crashlog_win.cpp Implementation of a crashlogger for Windows */
 

	
 
#include "../../stdafx.h"
 
#if defined(_MSC_VER) && defined(_M_AMD64)
 
/* Redefine WinNT version to get RtlCaptureContext prototype. */
 
#undef _WIN32_WINNT
 
#undef NTDDI_VERSION
 
#define _WIN32_WINNT _WIN32_WINNT_WINXP
 
#endif /* defined(_MSC_VER) && defined(_M_AMD64) */
 
#include "../../crashlog.h"
 
#include "win32.h"
 
#include "../../core/alloc_func.hpp"
 
@@ -408,10 +414,6 @@ static LONG WINAPI ExceptionHandler(EXCE
 
	return EXCEPTION_EXECUTE_HANDLER;
 
}
 

	
 
#ifdef _M_AMD64
 
extern "C" void *_get_safe_esp();
 
#endif
 

	
 
static void CDECL CustomAbort(int signal)
 
{
 
	RaiseException(0xE1212012, 0, 0, NULL);
 
@@ -421,7 +423,14 @@ static void CDECL CustomAbort(int signal
 
{
 
#if defined(_MSC_VER)
 
#ifdef _M_AMD64
 
	_safe_esp = _get_safe_esp();
 
	CONTEXT ctx;
 
	RtlCaptureContext(&ctx);
 

	
 
	/* The stack pointer for AMD64 must always be 16-byte aligned inside a
 
	 * function. As we are simulating a function call with the safe ESP value,
 
	 * we need to subtract 8 for the imaginary return address otherwise stack
 
	 * alignment would be wrong in the called function. */
 
	_safe_esp = (void *)(ctx.Rsp - 8);
 
#else
 
	_asm {
 
		mov _safe_esp, esp
src/os/windows/masm64.rules
Show inline comments
 
deleted file
src/os/windows/win64.asm
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)