Driver: Use ExternDef in .asm

This commit is contained in:
Nodir Temirkhodjaev 2022-02-16 12:20:04 +03:00
parent b91dfd498e
commit 0534b1d141
12 changed files with 26 additions and 30 deletions

View File

@ -30,6 +30,7 @@
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<Arch Condition="'$(Arch)'==''">x86</Arch>
<DefineConstants Condition="'$(Configuration)'=='Release'">$(DefineConstants);NDEBUG</DefineConstants>
<DefineConstants Condition="'$(Config)'=='win7'">$(DefineConstants);FORT_WIN7_COMPAT</DefineConstants>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
@ -81,7 +82,7 @@
<FilesToPackage Include="$(TargetPath)" />
</ItemGroup>
<ItemGroup>
<MASM Include="proxycb\fortpcb_dst_x86.asm" />
<MASM Include="proxycb\fortpcb_dst_$(Arch).asm" />
<ClCompile Include="fortdrv_amalg.c" />
<ClInclude Include="fortdrv.h" />
<ResourceCompile Include="fortdrv.rc" />

View File

@ -30,6 +30,7 @@
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<Arch Condition="'$(Arch)'==''">x86</Arch>
<DefineConstants Condition="'$(Configuration)'=='Release'">$(DefineConstants);NDEBUG</DefineConstants>
<DefineConstants Condition="'$(Config)'=='win7'">$(DefineConstants);FORT_WIN7_COMPAT</DefineConstants>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
@ -80,7 +81,7 @@
<FilesToPackage Include="$(TargetPath)" />
</ItemGroup>
<ItemGroup>
<MASM Include="..\proxycb\fortpcb_src_x86.asm" />
<MASM Include="..\proxycb\fortpcb_src_$(Arch).asm" />
<ClCompile Include="fortdl_amalg.c" />
<ClInclude Include="fortdl.h" />
<ResourceCompile Include="fortdl.rc" />

View File

@ -1 +1 @@
@%~dp0msvcbuild.bat ARM64 win10
@%~dp0msvcbuild.bat ARM64 win10 arm64

View File

@ -6,16 +6,20 @@
@rem PLAT: x64, Win32
@set PLAT=%1
@if "%PLAT%"=="" PLAT=x64
@if "%PLAT%"=="" @set PLAT=x64
@rem CONFIG: win7, win10
@set CONFIG=%2
@if "%CONFIG%"=="" CONFIG=win10
@if "%CONFIG%"=="" @set CONFIG=win10
@rem ARCH: x86, arm64
@set ARCH=%3
@if "%ARCH%"=="" @set ARCH=x86
@set OutDir=..\..\..\build-driver-loader-%CONFIG%\%PLAT%
@set IntDir=%OutDir%-obj
MSBuild fortdl.vcxproj /p:OutDir=%OutDir%\;IntDir=%IntDir%\;Platform=%PLAT%;Config=%CONFIG%
MSBuild fortdl.vcxproj /p:OutDir=%OutDir%\;IntDir=%IntDir%\;Platform=%PLAT%;Config=%CONFIG%;Arch=%ARCH%
@rem DumpBin /SYMBOLS "%IntDir%\fortdl.obj" > symbols.txt

View File

@ -1 +1 @@
@%~dp0msvcbuild.bat ARM64 win10
@%~dp0msvcbuild.bat ARM64 win10 arm64

View File

@ -6,16 +6,20 @@
@rem PLAT: x64, Win32
@set PLAT=%1
@if "%PLAT%"=="" PLAT=x64
@if "%PLAT%"=="" @set PLAT=x64
@rem CONFIG: win7, win10
@set CONFIG=%2
@if "%CONFIG%"=="" CONFIG=win10
@if "%CONFIG%"=="" @set CONFIG=win10
@rem ARCH: x86, arm64
@set ARCH=%3
@if "%ARCH%"=="" @set ARCH=x86
@set OutDir=..\..\build-driver-%CONFIG%\%PLAT%
@set IntDir=%OutDir%-obj
MSBuild fortdrv.vcxproj /p:OutDir=%OutDir%\;IntDir=%IntDir%\;Platform=%PLAT%;Config=%CONFIG%
MSBuild fortdrv.vcxproj /p:OutDir=%OutDir%\;IntDir=%IntDir%\;Platform=%PLAT%;Config=%CONFIG%;Arch=%ARCH%
@rem DumpBin /SYMBOLS "%IntDir%\fortdrv.obj" > symbols.txt

View File

@ -2,6 +2,8 @@
#include "fortpcb_dst.h"
ProxyCallbackProc g_proxyCallbacksArray[PROXY_CALLBACKS_COUNT];
#ifdef _WIN64
# define ProxyCallbackExtern(i) extern void proxyCallback##i(void)

View File

@ -2,8 +2,6 @@
#include "fortpcb_dst.h"
ProxyCallbackProc g_proxyCallbacksArray[PROXY_CALLBACKS_COUNT];
#define ProxyCallbackFunction(i) \
void proxyCallback##i(void) { g_proxyCallbacksArray[i](); }

View File

@ -3,14 +3,7 @@ ELSE
.model flat, stdcall
ENDIF
.DATA
IFDEF RAX
PUBLIC g_proxyCallbacksArray
g_proxyCallbacksArray QWORD 64 DUP(?)
ELSE
PUBLIC g_proxyCallbacksArray
g_proxyCallbacksArray WORD 64 DUP(?)
ENDIF
EXTERNDEF g_proxyCallbacksArray:BYTE
.CODE

View File

@ -2,6 +2,8 @@
#include "fortpcb_src.h"
ProxyCallbackProc g_proxyDstCallbacksArray[PROXY_CALLBACKS_COUNT];
#define ProxyCallbackExtern(i) extern void WINAPI proxyDstCallback##i(void)
ProxyCallbackExtern(0);

View File

@ -2,8 +2,6 @@
#include "fortpcb_src.h"
ProxyCallbackProc g_proxyDstCallbacksArray[PROXY_CALLBACKS_COUNT];
#define ProxyCallbackFunction(i) \
void proxyDstCallback##i(void) { g_proxyDstCallbacksArray[i](); }

View File

@ -3,14 +3,7 @@ ELSE
.model flat, stdcall
ENDIF
.DATA
IFDEF RAX
PUBLIC g_proxyDstCallbacksArray
g_proxyDstCallbacksArray QWORD 64 DUP(?)
ELSE
PUBLIC g_proxyDstCallbacksArray
g_proxyDstCallbacksArray WORD 64 DUP(?)
ENDIF
EXTERNDEF g_proxyDstCallbacksArray:BYTE
.CODE