From 0534b1d1411aa4a8e8798421063b59f3f6edcc8a Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Wed, 16 Feb 2022 12:20:04 +0300 Subject: [PATCH] Driver: Use ExternDef in .asm --- src/driver/fortdrv.vcxproj | 3 ++- src/driver/loader/fortdl.vcxproj | 3 ++- src/driver/loader/msvcbuild-win10-arm64.bat | 2 +- src/driver/loader/msvcbuild.bat | 10 +++++++--- src/driver/msvcbuild-win10-arm64.bat | 2 +- src/driver/msvcbuild.bat | 10 +++++++--- src/driver/proxycb/fortpcb_dst.c | 2 ++ src/driver/proxycb/fortpcb_dst_dummy.c | 2 -- src/driver/proxycb/fortpcb_dst_x86.asm | 9 +-------- src/driver/proxycb/fortpcb_src.c | 2 ++ src/driver/proxycb/fortpcb_src_dummy.c | 2 -- src/driver/proxycb/fortpcb_src_x86.asm | 9 +-------- 12 files changed, 26 insertions(+), 30 deletions(-) diff --git a/src/driver/fortdrv.vcxproj b/src/driver/fortdrv.vcxproj index 93de347c..a827c3c0 100644 --- a/src/driver/fortdrv.vcxproj +++ b/src/driver/fortdrv.vcxproj @@ -30,6 +30,7 @@ 11.0 Release Win32 + x86 $(DefineConstants);NDEBUG $(DefineConstants);FORT_WIN7_COMPAT true @@ -81,7 +82,7 @@ - + diff --git a/src/driver/loader/fortdl.vcxproj b/src/driver/loader/fortdl.vcxproj index 7cdacb80..8bcdc6a6 100644 --- a/src/driver/loader/fortdl.vcxproj +++ b/src/driver/loader/fortdl.vcxproj @@ -30,6 +30,7 @@ 11.0 Release Win32 + x86 $(DefineConstants);NDEBUG $(DefineConstants);FORT_WIN7_COMPAT true @@ -80,7 +81,7 @@ - + diff --git a/src/driver/loader/msvcbuild-win10-arm64.bat b/src/driver/loader/msvcbuild-win10-arm64.bat index 475abb3d..0e23bcc9 100644 --- a/src/driver/loader/msvcbuild-win10-arm64.bat +++ b/src/driver/loader/msvcbuild-win10-arm64.bat @@ -1 +1 @@ -@%~dp0msvcbuild.bat ARM64 win10 +@%~dp0msvcbuild.bat ARM64 win10 arm64 diff --git a/src/driver/loader/msvcbuild.bat b/src/driver/loader/msvcbuild.bat index 96df1417..53f80342 100644 --- a/src/driver/loader/msvcbuild.bat +++ b/src/driver/loader/msvcbuild.bat @@ -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 diff --git a/src/driver/msvcbuild-win10-arm64.bat b/src/driver/msvcbuild-win10-arm64.bat index 475abb3d..0e23bcc9 100644 --- a/src/driver/msvcbuild-win10-arm64.bat +++ b/src/driver/msvcbuild-win10-arm64.bat @@ -1 +1 @@ -@%~dp0msvcbuild.bat ARM64 win10 +@%~dp0msvcbuild.bat ARM64 win10 arm64 diff --git a/src/driver/msvcbuild.bat b/src/driver/msvcbuild.bat index 348aa333..c40e05d2 100644 --- a/src/driver/msvcbuild.bat +++ b/src/driver/msvcbuild.bat @@ -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 diff --git a/src/driver/proxycb/fortpcb_dst.c b/src/driver/proxycb/fortpcb_dst.c index 5bd97659..8f2c43d4 100644 --- a/src/driver/proxycb/fortpcb_dst.c +++ b/src/driver/proxycb/fortpcb_dst.c @@ -2,6 +2,8 @@ #include "fortpcb_dst.h" +ProxyCallbackProc g_proxyCallbacksArray[PROXY_CALLBACKS_COUNT]; + #ifdef _WIN64 # define ProxyCallbackExtern(i) extern void proxyCallback##i(void) diff --git a/src/driver/proxycb/fortpcb_dst_dummy.c b/src/driver/proxycb/fortpcb_dst_dummy.c index 19bfea93..995d291a 100644 --- a/src/driver/proxycb/fortpcb_dst_dummy.c +++ b/src/driver/proxycb/fortpcb_dst_dummy.c @@ -2,8 +2,6 @@ #include "fortpcb_dst.h" -ProxyCallbackProc g_proxyCallbacksArray[PROXY_CALLBACKS_COUNT]; - #define ProxyCallbackFunction(i) \ void proxyCallback##i(void) { g_proxyCallbacksArray[i](); } diff --git a/src/driver/proxycb/fortpcb_dst_x86.asm b/src/driver/proxycb/fortpcb_dst_x86.asm index 414f252e..93a8d862 100644 --- a/src/driver/proxycb/fortpcb_dst_x86.asm +++ b/src/driver/proxycb/fortpcb_dst_x86.asm @@ -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 diff --git a/src/driver/proxycb/fortpcb_src.c b/src/driver/proxycb/fortpcb_src.c index e5877da8..149439bf 100644 --- a/src/driver/proxycb/fortpcb_src.c +++ b/src/driver/proxycb/fortpcb_src.c @@ -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); diff --git a/src/driver/proxycb/fortpcb_src_dummy.c b/src/driver/proxycb/fortpcb_src_dummy.c index 875df6fd..9efda7b7 100644 --- a/src/driver/proxycb/fortpcb_src_dummy.c +++ b/src/driver/proxycb/fortpcb_src_dummy.c @@ -2,8 +2,6 @@ #include "fortpcb_src.h" -ProxyCallbackProc g_proxyDstCallbacksArray[PROXY_CALLBACKS_COUNT]; - #define ProxyCallbackFunction(i) \ void proxyDstCallback##i(void) { g_proxyDstCallbacksArray[i](); } diff --git a/src/driver/proxycb/fortpcb_src_x86.asm b/src/driver/proxycb/fortpcb_src_x86.asm index d7c7ddb6..42159b6b 100644 --- a/src/driver/proxycb/fortpcb_src_x86.asm +++ b/src/driver/proxycb/fortpcb_src_x86.asm @@ -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