Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
January 2021
- 74 participants
- 1238 messages
[PATCH 15/23] kernelbase: Add support for PPC64
by André Hentschel
Signed-off-by: André Hentschel <nerv(a)dawncrow.de>
---
dlls/kernelbase/memory.c | 3 +++
include/winnt.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c
index 2bfd3893e8e..f1becdaded5 100644
--- a/dlls/kernelbase/memory.c
+++ b/dlls/kernelbase/memory.c
@@ -150,6 +150,9 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si )
case PROCESSOR_ARCHITECTURE_ARM64:
si->dwProcessorType = 0;
break;
+ case PROCESSOR_ARCHITECTURE_PPC64:
+ si->dwProcessorType = PROCESSOR_PPC64_OP;
+ break;
default:
FIXME( "Unknown processor architecture %x\n", cpu_info.Architecture );
si->dwProcessorType = 0;
diff --git a/include/winnt.h b/include/winnt.h
index 359a6a3a5fd..a697331e157 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -707,6 +707,7 @@ typedef DWORD FLONG;
#define PROCESSOR_PPC_603 603
#define PROCESSOR_PPC_604 604
#define PROCESSOR_PPC_620 620
+#define PROCESSOR_PPC64_OP 690
#define PROCESSOR_HITACHI_SH3 10003
#define PROCESSOR_HITACHI_SH3E 10004
#define PROCESSOR_HITACHI_SH4 10005
--
2.25.1
Jan. 31, 2021
[PATCH 14/23] ucrtbase: Enable __intrinsic_setjmpex on PPC64
by André Hentschel
Signed-off-by: André Hentschel <nerv(a)dawncrow.de>
---
.../api-ms-win-core-crt-l2-1-0.spec | 2 +-
.../api-ms-win-crt-private-l1-1-0.spec | 2 +-
dlls/msvcrt20/msvcrt20.spec | 22 +++++++++----------
dlls/msvcrt40/msvcrt40.spec | 22 +++++++++----------
dlls/ucrtbase/ucrtbase.spec | 2 +-
dlls/vcruntime140/vcruntime140.spec | 2 +-
6 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/dlls/api-ms-win-core-crt-l2-1-0/api-ms-win-core-crt-l2-1-0.spec b/dlls/api-ms-win-core-crt-l2-1-0/api-ms-win-core-crt-l2-1-0.spec
index 69f2629c8d5..86651e0a8bc 100644
--- a/dlls/api-ms-win-core-crt-l2-1-0/api-ms-win-core-crt-l2-1-0.spec
+++ b/dlls/api-ms-win-core-crt-l2-1-0/api-ms-win-core-crt-l2-1-0.spec
@@ -14,5 +14,5 @@
@ cdecl exit(long) msvcrt.exit
@ stub hgets
@ stub hwprintf
-@ cdecl time(ptr) msvcrt.time
+@ cdecl -arch=win32 time(ptr) msvcrt.time
@ varargs wprintf(wstr) msvcrt.wprintf
diff --git a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
index 73a33b4157d..3f260a402a6 100644
--- a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
+++ b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
@@ -40,7 +40,7 @@
@ stub __dcrt_initial_narrow_environment
@ cdecl __intrinsic_abnormal_termination() ucrtbase.__intrinsic_abnormal_termination
@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __intrinsic_setjmp(ptr) ucrtbase.__intrinsic_setjmp
-@ cdecl -arch=x86_64,arm64 -norelay __intrinsic_setjmpex(ptr ptr) ucrtbase.__intrinsic_setjmpex
+@ cdecl -arch=x86_64,arm64,powerpc64 -norelay __intrinsic_setjmpex(ptr ptr) ucrtbase.__intrinsic_setjmpex
@ cdecl __processing_throw() ucrtbase.__processing_throw
@ stub __report_gsfailure
@ cdecl __std_exception_copy(ptr ptr) ucrtbase.__std_exception_copy
diff --git a/dlls/msvcrt20/msvcrt20.spec b/dlls/msvcrt20/msvcrt20.spec
index 7e2ec304979..e386ed8511d 100644
--- a/dlls/msvcrt20/msvcrt20.spec
+++ b/dlls/msvcrt20/msvcrt20.spec
@@ -932,10 +932,10 @@
@ cdecl _fputwchar(long) msvcrt._fputwchar
@ cdecl _fsopen(str str long) msvcrt._fsopen
@ cdecl _fstat(long ptr) msvcrt._fstat
-@ cdecl _ftime(ptr) msvcrt._ftime
+@ cdecl -arch=win32 _ftime(ptr) msvcrt._ftime
@ cdecl -arch=i386 -ret64 _ftol() msvcrt._ftol
@ cdecl _fullpath(ptr str long) msvcrt._fullpath
-@ cdecl _futime(long ptr) msvcrt._futime
+@ cdecl -arch=win32 _futime(long ptr) msvcrt._futime
@ cdecl _gcvt(double long str) msvcrt._gcvt
@ cdecl _get_osfhandle(long) msvcrt._get_osfhandle
@ cdecl _getch() msvcrt._getch
@@ -1187,7 +1187,7 @@
@ cdecl _ungetch(long) msvcrt._ungetch
@ cdecl _unlink(str) msvcrt._unlink
@ cdecl _unloaddll(long) msvcrt._unloaddll
-@ cdecl _utime(str ptr) msvcrt._utime
+@ cdecl -arch=win32 _utime(str ptr) msvcrt._utime
@ cdecl -norelay _vsnprintf(ptr long str ptr) msvcrt._vsnprintf
@ cdecl _vsnwprintf(ptr long wstr ptr) msvcrt._vsnwprintf
@ cdecl _waccess(wstr long) msvcrt._waccess
@@ -1207,7 +1207,7 @@
@ cdecl _wcsrev(wstr) msvcrt._wcsrev
@ cdecl _wcsset(wstr long) msvcrt._wcsset
@ cdecl _wcsupr(wstr) msvcrt._wcsupr
-@ cdecl _wctime(ptr) msvcrt._wctime
+@ cdecl -arch=win32 _wctime(ptr) msvcrt._wctime
@ extern _wenviron msvcrt._wenviron
@ varargs _wexecl(wstr wstr) msvcrt._wexecl
@ varargs _wexecle(wstr wstr) msvcrt._wexecle
@@ -1263,7 +1263,7 @@
@ cdecl _wtoi(wstr) msvcrt._wtoi
@ cdecl _wtol(wstr) msvcrt._wtol
@ cdecl _wunlink(wstr) msvcrt._wunlink
-@ cdecl _wutime(wstr ptr) msvcrt._wutime
+@ cdecl -arch=win32 _wutime(wstr ptr) msvcrt._wutime
@ cdecl _y0(double) msvcrt._y0
@ cdecl _y1(double) msvcrt._y1
@ cdecl _yn(long double) msvcrt._yn
@@ -1285,8 +1285,8 @@
@ cdecl clock() msvcrt.clock
@ cdecl cos(double) msvcrt.cos
@ cdecl cosh(double) msvcrt.cosh
-@ cdecl ctime(ptr) msvcrt.ctime
-@ cdecl difftime(long long) msvcrt.difftime
+@ cdecl -arch=win32 ctime(ptr) msvcrt.ctime
+@ cdecl -arch=win32 difftime(long long) msvcrt.difftime
@ cdecl -ret64 div(long long) msvcrt.div
@ cdecl exit(long) msvcrt.exit
@ cdecl exp(double) msvcrt.exp
@@ -1325,7 +1325,7 @@
@ cdecl gets(str) msvcrt.gets
@ cdecl getwc(ptr) msvcrt.getwc
@ cdecl getwchar() msvcrt.getwchar
-@ cdecl gmtime(ptr) msvcrt.gmtime
+@ cdecl -arch=win32 gmtime(ptr) msvcrt.gmtime
@ cdecl is_wctype(long long) msvcrt.is_wctype
@ cdecl isalnum(long) msvcrt.isalnum
@ cdecl isalpha(long) msvcrt.isalpha
@@ -1356,7 +1356,7 @@
@ cdecl ldexp(double long) msvcrt.ldexp
@ cdecl -ret64 ldiv(long long) msvcrt.ldiv
@ cdecl localeconv() msvcrt.localeconv
-@ cdecl localtime(ptr) msvcrt.localtime
+@ cdecl -arch=win32 localtime(ptr) msvcrt.localtime
@ cdecl log(double) msvcrt.log
@ cdecl log10(double) msvcrt.log10
@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) msvcrt.longjmp
@@ -1369,7 +1369,7 @@
@ cdecl memcpy(ptr ptr long) msvcrt.memcpy
@ cdecl memmove(ptr ptr long) msvcrt.memmove
@ cdecl memset(ptr long long) msvcrt.memset
-@ cdecl mktime(ptr) msvcrt.mktime
+@ cdecl -arch=win32 mktime(ptr) msvcrt.mktime
@ cdecl modf(double ptr) msvcrt.modf
@ cdecl perror(str) msvcrt.perror
@ cdecl pow(double double) msvcrt.pow
@@ -1423,7 +1423,7 @@
@ cdecl system(str) msvcrt.system
@ cdecl tan(double) msvcrt.tan
@ cdecl tanh(double) msvcrt.tanh
-@ cdecl time(ptr) msvcrt.time
+@ cdecl -arch=win32 time(ptr) msvcrt.time
@ cdecl tmpfile() msvcrt.tmpfile
@ cdecl tmpnam(ptr) msvcrt.tmpnam
@ cdecl tolower(long) msvcrt.tolower
diff --git a/dlls/msvcrt40/msvcrt40.spec b/dlls/msvcrt40/msvcrt40.spec
index ebcf5df4fc3..1024644b29c 100644
--- a/dlls/msvcrt40/msvcrt40.spec
+++ b/dlls/msvcrt40/msvcrt40.spec
@@ -1019,10 +1019,10 @@
@ cdecl _fsopen(str str long) msvcrt._fsopen
@ cdecl _fstat(long ptr) msvcrt._fstat
@ cdecl _fstati64(long ptr) msvcrt._fstati64
-@ cdecl _ftime(ptr) msvcrt._ftime
+@ cdecl -arch=win32 _ftime(ptr) msvcrt._ftime
@ cdecl -arch=i386 -ret64 _ftol() msvcrt._ftol
@ cdecl _fullpath(ptr str long) msvcrt._fullpath
-@ cdecl _futime(long ptr) msvcrt._futime
+@ cdecl -arch=win32 _futime(long ptr) msvcrt._futime
@ cdecl _gcvt(double long str) msvcrt._gcvt
@ cdecl _get_osfhandle(long) msvcrt._get_osfhandle
@ cdecl _getch() msvcrt._getch
@@ -1252,7 +1252,7 @@
@ cdecl _ungetch(long) msvcrt._ungetch
@ cdecl _unlink(str) msvcrt._unlink
@ cdecl _unloaddll(long) msvcrt._unloaddll
-@ cdecl _utime(str ptr) msvcrt._utime
+@ cdecl -arch=win32 _utime(str ptr) msvcrt._utime
@ cdecl -norelay _vsnprintf(ptr long str ptr) msvcrt._vsnprintf
@ cdecl _vsnwprintf(ptr long wstr ptr) msvcrt._vsnwprintf
@ cdecl _waccess(wstr long) msvcrt._waccess
@@ -1272,7 +1272,7 @@
@ cdecl _wcsrev(wstr) msvcrt._wcsrev
@ cdecl _wcsset(wstr long) msvcrt._wcsset
@ cdecl _wcsupr(wstr) msvcrt._wcsupr
-@ cdecl _wctime(ptr) msvcrt._wctime
+@ cdecl -arch=win32 _wctime(ptr) msvcrt._wctime
@ extern _wenviron msvcrt._wenviron
@ varargs _wexecl(wstr wstr) msvcrt._wexecl
@ varargs _wexecle(wstr wstr) msvcrt._wexecle
@@ -1331,7 +1331,7 @@
@ cdecl _wtoi(wstr) msvcrt._wtoi
@ cdecl _wtol(wstr) msvcrt._wtol
@ cdecl _wunlink(wstr) msvcrt._wunlink
-@ cdecl _wutime(wstr ptr) msvcrt._wutime
+@ cdecl -arch=win32 _wutime(wstr ptr) msvcrt._wutime
@ cdecl _y0(double) msvcrt._y0
@ cdecl _y1(double) msvcrt._y1
@ cdecl _yn(long double) msvcrt._yn
@@ -1353,8 +1353,8 @@
@ cdecl clock() msvcrt.clock
@ cdecl cos(double) msvcrt.cos
@ cdecl cosh(double) msvcrt.cosh
-@ cdecl ctime(ptr) msvcrt.ctime
-@ cdecl difftime(long long) msvcrt.difftime
+@ cdecl -arch=win32 ctime(ptr) msvcrt.ctime
+@ cdecl -arch=win32 difftime(long long) msvcrt.difftime
@ cdecl -ret64 div(long long) msvcrt.div
@ cdecl exit(long) msvcrt.exit
@ cdecl exp(double) msvcrt.exp
@@ -1393,7 +1393,7 @@
@ cdecl gets(str) msvcrt.gets
@ cdecl getwc(ptr) msvcrt.getwc
@ cdecl getwchar() msvcrt.getwchar
-@ cdecl gmtime(ptr) msvcrt.gmtime
+@ cdecl -arch=win32 gmtime(ptr) msvcrt.gmtime
@ cdecl is_wctype(long long) msvcrt.is_wctype
@ cdecl isalnum(long) msvcrt.isalnum
@ cdecl isalpha(long) msvcrt.isalpha
@@ -1424,7 +1424,7 @@
@ cdecl ldexp(double long) msvcrt.ldexp
@ cdecl -ret64 ldiv(long long) msvcrt.ldiv
@ cdecl localeconv() msvcrt.localeconv
-@ cdecl localtime(ptr) msvcrt.localtime
+@ cdecl -arch=win32 localtime(ptr) msvcrt.localtime
@ cdecl log(double) msvcrt.log
@ cdecl log10(double) msvcrt.log10
@ cdecl -arch=i386,x86_64,arm,arm64 longjmp(ptr long) msvcrt.longjmp
@@ -1437,7 +1437,7 @@
@ cdecl memcpy(ptr ptr long) msvcrt.memcpy
@ cdecl memmove(ptr ptr long) msvcrt.memmove
@ cdecl memset(ptr long long) msvcrt.memset
-@ cdecl mktime(ptr) msvcrt.mktime
+@ cdecl -arch=win32 mktime(ptr) msvcrt.mktime
@ cdecl modf(double ptr) msvcrt.modf
@ cdecl perror(str) msvcrt.perror
@ cdecl pow(double double) msvcrt.pow
@@ -1491,7 +1491,7 @@
@ cdecl system(str) msvcrt.system
@ cdecl tan(double) msvcrt.tan
@ cdecl tanh(double) msvcrt.tanh
-@ cdecl time(ptr) msvcrt.time
+@ cdecl -arch=win32 time(ptr) msvcrt.time
@ cdecl tmpfile() msvcrt.tmpfile
@ cdecl tmpnam(ptr) msvcrt.tmpnam
@ cdecl tolower(long) msvcrt.tolower
diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec
index c14cd3d66cb..465df3838d6 100644
--- a/dlls/ucrtbase/ucrtbase.spec
+++ b/dlls/ucrtbase/ucrtbase.spec
@@ -94,7 +94,7 @@
@ cdecl __initialize_lconv_for_unsigned_char() __lconv_init
@ cdecl __intrinsic_abnormal_termination()
@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __intrinsic_setjmp(ptr) MSVCRT__setjmp
-@ cdecl -arch=x86_64,arm64 -norelay __intrinsic_setjmpex(ptr ptr) __wine_setjmpex
+@ cdecl -arch=x86_64,arm64,powerpc64 -norelay __intrinsic_setjmpex(ptr ptr) __wine_setjmpex
@ cdecl __isascii(long)
@ cdecl __iscsym(long)
@ cdecl __iscsymf(long)
diff --git a/dlls/vcruntime140/vcruntime140.spec b/dlls/vcruntime140/vcruntime140.spec
index f799bcd4db5..d7cf8007bef 100644
--- a/dlls/vcruntime140/vcruntime140.spec
+++ b/dlls/vcruntime140/vcruntime140.spec
@@ -33,7 +33,7 @@
@ cdecl __current_exception() ucrtbase.__current_exception
@ cdecl __current_exception_context() ucrtbase.__current_exception_context
@ cdecl -arch=i386,x86_64,arm,arm64 -norelay __intrinsic_setjmp(ptr) ucrtbase.__intrinsic_setjmp
-@ cdecl -arch=x86_64,arm64 -norelay __intrinsic_setjmpex(ptr ptr) ucrtbase.__intrinsic_setjmpex
+@ cdecl -arch=x86_64,arm64,powerpc64 -norelay __intrinsic_setjmpex(ptr ptr) ucrtbase.__intrinsic_setjmpex
@ cdecl __processing_throw() ucrtbase.__processing_throw
@ stub __report_gsfailure
@ cdecl __std_exception_copy(ptr ptr) ucrtbase.__std_exception_copy
--
2.25.1
Jan. 31, 2021
[PATCH 13/23] ucrtbase: __CppXcptFilter is not available on PPC64 yet
by André Hentschel
From: Timothy Pearson <tpearson(a)raptorengineering.com>
Signed-off-by: André Hentschel <nerv(a)dawncrow.de>
---
.../api-ms-win-crt-private-l1-1-0.spec | 2 +-
dlls/ucrtbase/ucrtbase.spec | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
index 136358a174c..73a33b4157d 100644
--- a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
+++ b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
@@ -660,7 +660,7 @@
@ cdecl -arch=x86_64 _o__scalbf(float long) ucrtbase._o__scalbf
@ cdecl _o__searchenv(str str ptr) ucrtbase._o__searchenv
@ cdecl _o__searchenv_s(str str ptr long) ucrtbase._o__searchenv_s
-@ cdecl _o__seh_filter_dll(long ptr) ucrtbase._o__seh_filter_dll
+@ cdecl -arch=i386,x86_64,arm,arm64 _o__seh_filter_dll(long ptr) ucrtbase._o__seh_filter_dll
@ cdecl _o__seh_filter_exe(long ptr) ucrtbase._o__seh_filter_exe
@ cdecl _o__set_abort_behavior(long long) ucrtbase._o__set_abort_behavior
@ cdecl _o__set_app_type(long) ucrtbase._o__set_app_type
diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec
index 0a8d74521f5..c14cd3d66cb 100644
--- a/dlls/ucrtbase/ucrtbase.spec
+++ b/dlls/ucrtbase/ucrtbase.spec
@@ -1324,7 +1324,7 @@
@ cdecl -arch=x86_64 _o__scalbf(float long) _scalbf
@ cdecl _o__searchenv(str str ptr) _searchenv
@ cdecl _o__searchenv_s(str str ptr long) _searchenv_s
-@ cdecl _o__seh_filter_dll(long ptr) __CppXcptFilter
+@ cdecl -arch=i386,x86_64,arm,arm64 _o__seh_filter_dll(long ptr) __CppXcptFilter
@ cdecl _o__seh_filter_exe(long ptr) _XcptFilter
@ cdecl _o__set_abort_behavior(long long) _set_abort_behavior
@ cdecl _o__set_app_type(long) __set_app_type
--
2.25.1
Jan. 31, 2021
[PATCH 12/23] configure: Add support for PPC64
by André Hentschel
Signed-off-by: André Hentschel <nerv(a)dawncrow.de>
---
configure.ac | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index a9003523700..5ecb2af0ec8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -217,6 +217,14 @@ case $host in
enable_win16=${enable_win16:-yes}
with_unwind=${with_unwind:-no}
;;
+ powerpc64*)
+ host_cpu="powerpc64le"
+ notice_platform="64-bit "
+ WINE_TRY_CFLAGS([-mlongcall], [CC="$CC -mlongcall"
+ CXX="$CXX -mlongcall"])
+ WINE_TRY_CFLAGS([-mno-pltseq], [CC="$CC -mno-pltseq"
+ CXX="$CXX -mno-pltseq"])
+ ;;
esac
dnl enable_win16 defaults to yes on x86, to no on other CPUs
@@ -937,7 +945,7 @@ case $host_os in
WINEPRELOADER_LDFLAGS="-static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7d400000"
case $host_cpu in
- *i[[3456789]]86* | x86_64 | *aarch64*)
+ *i[[3456789]]86* | x86_64 | *aarch64* | powerpc64*)
WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000],
[case $host_os in
freebsd* | kfreebsd*-gnu) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-Ttext-segment=0x60000000" ;;
--
2.25.1
Jan. 31, 2021
[PATCH 11/23] server: Add PPC64 support
by André Hentschel
From: Timothy Pearson <tpearson(a)raptorengineering.com>
Signed-off-by: André Hentschel <nerv(a)dawncrow.de>
---
server/mapping.c | 5 +++++
server/process.h | 2 +-
server/protocol.def | 6 +++++-
server/thread.c | 13 ++++++++-----
server/trace.c | 36 ++++++++++++++++++++++++++++++++++++
5 files changed, 55 insertions(+), 7 deletions(-)
diff --git a/server/mapping.c b/server/mapping.c
index 9c51aa3bec7..a0d72b29a01 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -688,6 +688,10 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
mapping->image.cpu = CPU_ARM64;
if (cpu_mask & (CPU_FLAG(CPU_ARM) | CPU_FLAG(CPU_ARM64))) break;
return STATUS_INVALID_IMAGE_FORMAT;
+ case IMAGE_FILE_MACHINE_POWERPC64:
+ mapping->image.cpu = CPU_POWERPC64;
+ if (cpu_mask & CPU_FLAG(CPU_POWERPC64)) break;
+ return STATUS_INVALID_IMAGE_FORMAT;
default:
return STATUS_INVALID_IMAGE_FORMAT;
}
@@ -758,6 +762,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
mapping->image.image_flags |= IMAGE_FLAGS_ComPlusNativeReady;
if (cpu_mask & CPU_FLAG(CPU_x86_64)) mapping->image.cpu = CPU_x86_64;
else if (cpu_mask & CPU_FLAG(CPU_ARM64)) mapping->image.cpu = CPU_ARM64;
+ else if (cpu_mask & CPU_FLAG(CPU_POWERPC64)) mapping->image.cpu = CPU_POWERPC64;
}
if (clr.Flags & COMIMAGE_FLAGS_32BITPREFERRED)
mapping->image.image_flags |= IMAGE_FLAGS_ComPlusPrefer32bit;
diff --git a/server/process.h b/server/process.h
index 5901e8fa3de..f4ba7d94666 100644
--- a/server/process.h
+++ b/server/process.h
@@ -100,7 +100,7 @@ struct process
};
#define CPU_FLAG(cpu) (1 << (cpu))
-#define CPU_64BIT_MASK (CPU_FLAG(CPU_x86_64) | CPU_FLAG(CPU_ARM64))
+#define CPU_64BIT_MASK (CPU_FLAG(CPU_x86_64) | CPU_FLAG(CPU_ARM64) | CPU_FLAG(CPU_POWERPC64))
/* process functions */
diff --git a/server/protocol.def b/server/protocol.def
index 853f9dbae01..2d2b37ee6bb 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -133,7 +133,7 @@ typedef union
/* supported CPU types */
enum cpu_type
{
- CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_ARM64
+ CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_ARM64, CPU_POWERPC64
};
typedef int client_cpu_t;
@@ -148,6 +148,7 @@ typedef struct
struct { unsigned __int64 rip, rbp, rsp;
unsigned int cs, ss, flags, __pad; } x86_64_regs;
struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap, __pad; } powerpc_regs;
+ struct { unsigned __int64 iar, msr, ctr, lr, dar, dsisr, trap, __pad; } powerpc64_regs;
struct { unsigned int sp, lr, pc, cpsr; } arm_regs;
struct { unsigned __int64 sp, pc, pstate; } arm64_regs;
} ctl; /* selected by SERVER_CTX_CONTROL */
@@ -157,6 +158,7 @@ typedef struct
struct { unsigned __int64 rax,rbx, rcx, rdx, rsi, rdi,
r8, r9, r10, r11, r12, r13, r14, r15; } x86_64_regs;
struct { unsigned int gpr[32], cr, xer; } powerpc_regs;
+ struct { unsigned __int64 gpr[32], cr, xer; } powerpc64_regs;
struct { unsigned int r[13]; } arm_regs;
struct { unsigned __int64 x[31]; } arm64_regs;
} integer; /* selected by SERVER_CTX_INTEGER */
@@ -171,6 +173,7 @@ typedef struct
unsigned char regs[80]; } i386_regs;
struct { struct { unsigned __int64 low, high; } fpregs[32]; } x86_64_regs;
struct { double fpr[32], fpscr; } powerpc_regs;
+ struct { double fpr[32]; unsigned __int64 fpscr; } powerpc64_regs;
struct { unsigned __int64 d[32]; unsigned int fpscr; } arm_regs;
struct { struct { unsigned __int64 low, high; } q[32]; unsigned int fpcr, fpsr; } arm64_regs;
} fp; /* selected by SERVER_CTX_FLOATING_POINT */
@@ -179,6 +182,7 @@ typedef struct
struct { unsigned int dr0, dr1, dr2, dr3, dr6, dr7; } i386_regs;
struct { unsigned __int64 dr0, dr1, dr2, dr3, dr6, dr7; } x86_64_regs;
struct { unsigned int dr[8]; } powerpc_regs;
+ struct { unsigned __int64 dr[8]; } powerpc64_regs;
struct { unsigned int bvr[8], bcr[8], wvr[1], wcr[1]; } arm_regs;
struct { unsigned __int64 bvr[8], wvr[2]; unsigned int bcr[8], wcr[2]; } arm64_regs;
} debug; /* selected by SERVER_CTX_DEBUG_REGISTERS */
diff --git a/server/thread.c b/server/thread.c
index 296f0848027..8bef09136f1 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -57,6 +57,8 @@
static const unsigned int supported_cpus = CPU_FLAG(CPU_x86);
#elif defined(__x86_64__)
static const unsigned int supported_cpus = CPU_FLAG(CPU_x86_64) | CPU_FLAG(CPU_x86);
+#elif defined(__powerpc64__)
+static const unsigned int supported_cpus = CPU_FLAG(CPU_POWERPC64);
#elif defined(__powerpc__)
static const unsigned int supported_cpus = CPU_FLAG(CPU_POWERPC);
#elif defined(__arm__)
@@ -1294,11 +1296,12 @@ static unsigned int get_context_system_regs( enum cpu_type cpu )
{
switch (cpu)
{
- case CPU_x86: return SERVER_CTX_DEBUG_REGISTERS;
- case CPU_x86_64: return SERVER_CTX_DEBUG_REGISTERS;
- case CPU_POWERPC: return 0;
- case CPU_ARM: return SERVER_CTX_DEBUG_REGISTERS;
- case CPU_ARM64: return SERVER_CTX_DEBUG_REGISTERS;
+ case CPU_x86: return SERVER_CTX_DEBUG_REGISTERS;
+ case CPU_x86_64: return SERVER_CTX_DEBUG_REGISTERS;
+ case CPU_POWERPC: return 0;
+ case CPU_POWERPC64: return SERVER_CTX_DEBUG_REGISTERS;
+ case CPU_ARM: return SERVER_CTX_DEBUG_REGISTERS;
+ case CPU_ARM64: return SERVER_CTX_DEBUG_REGISTERS;
}
return 0;
}
diff --git a/server/trace.c b/server/trace.c
index 4d59b06d040..305f1a16138 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -155,6 +155,7 @@ static void dump_client_cpu( const char *prefix, const client_cpu_t *code )
CASE(x86);
CASE(x86_64);
CASE(POWERPC);
+ CASE(POWERPC64);
CASE(ARM);
CASE(ARM64);
default: fprintf( stderr, "%s%u", prefix, *code ); break;
@@ -695,6 +696,41 @@ static void dump_varargs_context( const char *prefix, data_size_t size )
fprintf( stderr, ",fpscr=%g", ctx.fp.powerpc_regs.fpscr );
}
break;
+ case CPU_POWERPC64:
+ if (ctx.flags & SERVER_CTX_CONTROL)
+ {
+ dump_uint64( ",iar=", &ctx.ctl.powerpc64_regs.iar );
+ dump_uint64( ",msr=", &ctx.ctl.powerpc64_regs.msr );
+ dump_uint64( ",ctr=", &ctx.ctl.powerpc64_regs.ctr );
+ dump_uint64( ",lr=", &ctx.ctl.powerpc64_regs.lr );
+ dump_uint64( ",dar=", &ctx.ctl.powerpc64_regs.dar );
+ dump_uint64( ",dsisr=", &ctx.ctl.powerpc64_regs.dsisr );
+ dump_uint64( ",trap=", &ctx.ctl.powerpc64_regs.trap );
+ }
+ if (ctx.flags & SERVER_CTX_INTEGER)
+ {
+ for (i = 0; i < 32; i++)
+ {
+ fprintf( stderr, ",gpr%u=", i );
+ dump_uint64( "", &ctx.integer.powerpc64_regs.gpr[i] );
+ }
+ dump_uint64( ",cr=", &ctx.integer.powerpc64_regs.cr );
+ dump_uint64( ",xer=", &ctx.integer.powerpc64_regs.xer );
+ }
+ if (ctx.flags & SERVER_CTX_DEBUG_REGISTERS)
+ {
+ for (i = 0; i < 8; i++)
+ {
+ fprintf( stderr, ",dr%u=", i );
+ dump_uint64( "", &ctx.debug.powerpc64_regs.dr[i] );
+ }
+ }
+ if (ctx.flags & SERVER_CTX_FLOATING_POINT)
+ {
+ for (i = 0; i < 32; i++) fprintf( stderr, ",fpr%u=%g", i, ctx.fp.powerpc64_regs.fpr[i] );
+ dump_uint64( ",fpscr=", &ctx.fp.powerpc64_regs.fpscr );
+ }
+ break;
case CPU_ARM:
if (ctx.flags & SERVER_CTX_CONTROL)
fprintf( stderr, ",sp=%08x,lr=%08x,pc=%08x,cpsr=%08x",
--
2.25.1
Jan. 31, 2021
[PATCH 10/23] winegcc: Add PPC64 support
by André Hentschel
Signed-off-by: André Hentschel <nerv(a)dawncrow.de>
---
tools/winegcc/utils.h | 2 +-
tools/winegcc/winegcc.c | 62 ++++++++++++++++++++++++-----------------
2 files changed, 37 insertions(+), 27 deletions(-)
diff --git a/tools/winegcc/utils.h b/tools/winegcc/utils.h
index 9c70011a90f..ebc71d85e8e 100644
--- a/tools/winegcc/utils.h
+++ b/tools/winegcc/utils.h
@@ -39,7 +39,7 @@
enum target_cpu
{
- CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_ARM64
+ CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_ARM64, CPU_POWERPC64
};
enum target_platform
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index e72f234d94b..79a9eebe891 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -160,21 +160,23 @@ static const struct
enum target_cpu cpu;
} cpu_names[] =
{
- { "i386", CPU_x86 },
- { "i486", CPU_x86 },
- { "i586", CPU_x86 },
- { "i686", CPU_x86 },
- { "i786", CPU_x86 },
- { "amd64", CPU_x86_64 },
- { "x86_64", CPU_x86_64 },
- { "powerpc", CPU_POWERPC },
- { "arm", CPU_ARM },
- { "armv5", CPU_ARM },
- { "armv6", CPU_ARM },
- { "armv7", CPU_ARM },
- { "armv7a", CPU_ARM },
- { "arm64", CPU_ARM64 },
- { "aarch64", CPU_ARM64 },
+ { "i386", CPU_x86 },
+ { "i486", CPU_x86 },
+ { "i586", CPU_x86 },
+ { "i686", CPU_x86 },
+ { "i786", CPU_x86 },
+ { "amd64", CPU_x86_64 },
+ { "x86_64", CPU_x86_64 },
+ { "powerpc", CPU_POWERPC },
+ { "powerpc64", CPU_POWERPC64 },
+ { "powerpc64le", CPU_POWERPC64 },
+ { "arm", CPU_ARM },
+ { "armv5", CPU_ARM },
+ { "armv6", CPU_ARM },
+ { "armv7", CPU_ARM },
+ { "armv7a", CPU_ARM },
+ { "arm64", CPU_ARM64 },
+ { "aarch64", CPU_ARM64 },
};
static const struct
@@ -247,6 +249,8 @@ struct options
static const enum target_cpu build_cpu = CPU_x86;
#elif defined(__x86_64__)
static const enum target_cpu build_cpu = CPU_x86_64;
+#elif defined(__powerpc64__)
+static const enum target_cpu build_cpu = CPU_POWERPC64;
#elif defined(__powerpc__)
static const enum target_cpu build_cpu = CPU_POWERPC;
#elif defined(__arm__)
@@ -610,9 +614,9 @@ static int check_platform( struct options *opts, const char *file )
if (!memcmp( header, "\177ELF", 4 ))
{
if (header[4] == 2) /* 64-bit */
- ret = (opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64);
+ ret = (opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64 || opts->target_cpu == CPU_POWERPC64);
else
- ret = (opts->target_cpu != CPU_x86_64 && opts->target_cpu != CPU_ARM64);
+ ret = (opts->target_cpu != CPU_x86_64 && opts->target_cpu != CPU_ARM64 && opts->target_cpu != CPU_POWERPC64);
}
}
close( fd );
@@ -624,11 +628,12 @@ static const char *get_multiarch_dir( enum target_cpu cpu )
{
switch(cpu)
{
- case CPU_x86: return "/i386-linux-gnu";
- case CPU_x86_64: return "/x86_64-linux-gnu";
- case CPU_ARM: return "/arm-linux-gnueabi";
- case CPU_ARM64: return "/aarch64-linux-gnu";
- case CPU_POWERPC: return "/powerpc-linux-gnu";
+ case CPU_x86: return "/i386-linux-gnu";
+ case CPU_x86_64: return "/x86_64-linux-gnu";
+ case CPU_ARM: return "/arm-linux-gnueabi";
+ case CPU_ARM64: return "/aarch64-linux-gnu";
+ case CPU_POWERPC: return "/powerpc-linux-gnu";
+ case CPU_POWERPC64: return "/powerpc64le-linux-gnu";
default:
assert(0);
return NULL;
@@ -644,8 +649,8 @@ static char *get_lib_dir( struct options *opts )
unsigned int i;
size_t build_len, target_len;
- bit_suffix = opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64 ? "64" : "32";
- other_bit_suffix = opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64 ? "32" : "64";
+ bit_suffix = opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64 || opts->target_cpu == CPU_POWERPC64 ? "64" : "32";
+ other_bit_suffix = opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64 || opts->target_cpu == CPU_POWERPC64 ? "32" : "64";
build_multiarch = get_multiarch_dir( build_cpu );
target_multiarch = get_multiarch_dir( opts->target_cpu );
build_len = strlen( build_multiarch );
@@ -804,7 +809,7 @@ static void compile(struct options* opts, const char* lang)
strarray_add(comp_args, "-fno-PIC");
}
- if (opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64)
+ if (opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64 || opts->target_cpu == CPU_POWERPC64)
{
strarray_add(comp_args, "-DWIN64");
strarray_add(comp_args, "-D_WIN64");
@@ -839,6 +844,11 @@ static void compile(struct options* opts, const char* lang)
strarray_add(comp_args, "-D__cdecl=__stdcall");
strarray_add(comp_args, "-D__fastcall=__stdcall");
break;
+ case CPU_POWERPC64:
+ strarray_add(comp_args, "-D__stdcall=__attribute__((__longcall__))");
+ strarray_add(comp_args, "-D__cdecl=__stdcall");
+ strarray_add(comp_args, "-D__fastcall=__stdcall");
+ break;
case CPU_POWERPC:
strarray_add(comp_args, "-D__stdcall=");
strarray_add(comp_args, "-D__cdecl=");
@@ -866,7 +876,7 @@ static void compile(struct options* opts, const char* lang)
strarray_add(comp_args, "-D__int8=char");
strarray_add(comp_args, "-D__int16=short");
strarray_add(comp_args, "-D__int32=int");
- if (opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64)
+ if (opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64 || opts->target_cpu == CPU_POWERPC64)
strarray_add(comp_args, "-D__int64=long");
else
strarray_add(comp_args, "-D__int64=long long");
--
2.25.1
Jan. 31, 2021
[PATCH 09/23] winebuild: Add PPC64 support
by André Hentschel
Signed-off-by: André Hentschel <nerv(a)dawncrow.de>
---
tools/winebuild/build.h | 4 +-
tools/winebuild/import.c | 271 +++++++++++++++++++++++++++++++++++++++
tools/winebuild/main.c | 2 +
tools/winebuild/parser.c | 4 +-
tools/winebuild/spec32.c | 37 +++---
tools/winebuild/utils.c | 39 +++---
6 files changed, 321 insertions(+), 36 deletions(-)
diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
index 4fb6e23700e..dce415deca1 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -145,7 +145,7 @@ typedef struct
enum target_cpu
{
- CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_ARM64, CPU_LAST = CPU_ARM64
+ CPU_x86, CPU_x86_64, CPU_POWERPC, CPU_ARM, CPU_ARM64, CPU_POWERPC64, CPU_LAST = CPU_POWERPC64
};
enum target_platform
@@ -193,7 +193,7 @@ struct strarray
#define FLAG_CPU(cpu) (0x10000 << (cpu))
#define FLAG_CPU_MASK (FLAG_CPU(CPU_LAST + 1) - FLAG_CPU(0))
-#define FLAG_CPU_WIN64 (FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM64))
+#define FLAG_CPU_WIN64 (FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM64) | FLAG_CPU(CPU_POWERPC64))
#define FLAG_CPU_WIN32 (FLAG_CPU_MASK & ~FLAG_CPU_WIN64)
#define MAX_ORDINALS 65535
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index 827a875e5df..7ee75ad3575 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -3,6 +3,8 @@
*
* Copyright 2000, 2004 Alexandre Julliard
* Copyright 2000 Eric Pouech
+ * Copyright 2009-2013, 2015, 2017, 2020 André Hentschel
+ * Copyright 2019 Timothy Pearson <tpearson(a)raptorengineering.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -793,6 +795,20 @@ static void output_import_thunk( const char *name, const char *table, int pos )
output( "\tmr %s, %s\n", ppc_reg(31), ppc_reg(0) );
output( "\tbctr\n" );
break;
+ case CPU_POWERPC64:
+ /*
+ * The ppc64 ABIv2 expects r12 to be set to ctr before bctr for PLT-like calls.
+ * ABIv2-compatible functions attempt to rebuild the TOC pointer (r2) from r12 under this assumption.
+ */
+ output( "\tlis %s, (%s+%d)@highest\n", ppc_reg(12), table, pos );
+ output( "\tori %s, %s, (%s+%d)@higher\n", ppc_reg(12), ppc_reg(12), table, pos );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(12), ppc_reg(12) );
+ output( "\toris %s, %s, (%s+%d)@high\n", ppc_reg(12), ppc_reg(12), table, pos );
+ output( "\tori %s, %s, (%s+%d)@l\n", ppc_reg(12), ppc_reg(12), table, pos );
+ output( "\tld %s, 0(%s)\n", ppc_reg(12), ppc_reg(12) );
+ output( "\tmtctr %s\n", ppc_reg(12) );
+ output( "\tbctr\n" );
+ break;
}
output_cfi( ".cfi_endproc" );
output_function_size( name );
@@ -1144,6 +1160,54 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output( "\tmtlr %s\n", ppc_reg(0));
output( "\taddi %s, %s, %d\n", ppc_reg(1), ppc_reg(1), 48+extra_stack_storage);
+ /* branch to ctr register. */
+ output( "\tbctr\n");
+ break;
+ case CPU_POWERPC64:
+ /* Save all callee saved registers into a stackframe. */
+ output( "\tstdu %s, -%d(%s)\n",ppc_reg(1), 176, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(2), 24, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(3), 48, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(4), 56, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(5), 64, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(6), 72, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(7), 80, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(8), 88, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(9), 96, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(10),104, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(11),112, ppc_reg(1));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(12),120, ppc_reg(1));
+ /* r0 -> r3 (arg1) */
+ output( "\tmr %s, %s\n", ppc_reg(3), ppc_reg(0));
+ /* Call the __wine_delay_load function, arg1 is arg1. */
+ output( "\tlis %s, %s(a)highest\n", ppc_reg(12), asm_name("__wine_spec_delay_load") );
+ output( "\tori %s, %s, %s(a)higher\n", ppc_reg(12), ppc_reg(12), asm_name("__wine_spec_delay_load") );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(12), ppc_reg(12) );
+ output( "\toris %s, %s, %s(a)high\n", ppc_reg(12), ppc_reg(12), asm_name("__wine_spec_delay_load") );
+ output( "\tori %s, %s, %s(a)l\n", ppc_reg(12), ppc_reg(12), asm_name("__wine_spec_delay_load") );
+ output( "\tmtctr %s\n", ppc_reg(12) );
+ output( "\tbctrl\n" );
+ output( "\tld %s, %d(%s)\n", ppc_reg(2), 24, ppc_reg(1));
+ /* r3 (return value) -> r12 (branch / ctr) */
+ output( "\tmr %s, %s\n", ppc_reg(12), ppc_reg(3));
+ /* Load return value from call into ctr register */
+ output( "\tmtctr %s\n", ppc_reg(12));
+ /* restore all saved registers and drop stackframe. */
+ output( "\tld %s, %d(%s)\n", ppc_reg(2), 24, ppc_reg(1));
+ output( "\tld %s, %d(%s)\n", ppc_reg(3), 48, ppc_reg(1));
+ output( "\tld %s, %d(%s)\n", ppc_reg(4), 56, ppc_reg(1));
+ output( "\tld %s, %d(%s)\n", ppc_reg(5), 64, ppc_reg(1));
+ output( "\tld %s, %d(%s)\n", ppc_reg(6), 72, ppc_reg(1));
+ output( "\tld %s, %d(%s)\n", ppc_reg(7), 80, ppc_reg(1));
+ output( "\tld %s, %d(%s)\n", ppc_reg(8), 88, ppc_reg(1));
+ output( "\tld %s, %d(%s)\n", ppc_reg(9), 96, ppc_reg(1));
+ output( "\tld %s, %d(%s)\n", ppc_reg(10),104, ppc_reg(1));
+ output( "\tld %s, %d(%s)\n", ppc_reg(11),112, ppc_reg(1));
+ /* don't restore r12! restoring r12 here would corrupt the computed TOC post-bctr. */
+ /* Load return value from call into return register */
+ output( "\tld %s, 0(%s)\n", ppc_reg(1), ppc_reg(1));
+ output( "\tld %s, %d(%s)\n", ppc_reg(0), 16, ppc_reg(1));
+ output( "\tmtlr %s\n", ppc_reg(0));
/* branch to ctr register. */
output( "\tbctr\n");
break;
@@ -1219,6 +1283,23 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
break;
}
break;
+ case CPU_POWERPC64:
+ output( "\tmflr %s\n", ppc_reg(0));
+ output( "\tstd %s, %d(%s)\n", ppc_reg(0), 16, ppc_reg(1)); /* save return address */
+ output( "\tlis %s, %d(a)highest\n", ppc_reg(12), (idx << 16) | j );
+ output( "\tori %s, %s, %d(a)higher\n", ppc_reg(12), ppc_reg(12), (idx << 16) | j );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(12), ppc_reg(12) );
+ output( "\toris %s, %s, %d(a)high\n", ppc_reg(12), ppc_reg(12), (idx << 16) | j );
+ output( "\tori %s, %s, %d(a)l\n", ppc_reg(12), ppc_reg(12), (idx << 16) | j );
+ output( "\tmr %s, %s\n", ppc_reg(0), ppc_reg(12) );
+ output( "\tlis %s, %s(a)highest\n", ppc_reg(12), asm_name("__wine_delay_load_asm") );
+ output( "\tori %s, %s, %s(a)higher\n", ppc_reg(12), ppc_reg(12), asm_name("__wine_delay_load_asm") );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(12), ppc_reg(12) );
+ output( "\toris %s, %s, %s(a)high\n", ppc_reg(12), ppc_reg(12), asm_name("__wine_delay_load_asm") );
+ output( "\tori %s, %s, %s(a)l\n", ppc_reg(12), ppc_reg(12), asm_name("__wine_delay_load_asm") );
+ output( "\tmtctr %s\n", ppc_reg(12) );
+ output( "\tbctr\n" );
+ break;
}
output_cfi( ".cfi_endproc" );
}
@@ -1392,6 +1473,37 @@ void output_stubs( DLLSPEC *spec )
output( "\tmov x1, %u\n", odp->ordinal );
output( "\tbl %s\n", asm_name("__wine_spec_unimplemented_stub") );
break;
+ case CPU_POWERPC64:
+ /* Clobbers r3, r4, and r12 */
+ output( "\tlis %s, .L__wine_spec_file_name(a)highest\n", ppc_reg(3) );
+ output( "\tori %s, %s, .L__wine_spec_file_name(a)higher\n", ppc_reg(3), ppc_reg(3) );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(3), ppc_reg(3) );
+ output( "\toris %s, %s, .L__wine_spec_file_name(a)high\n", ppc_reg(3), ppc_reg(3) );
+ output( "\tori %s, %s, .L__wine_spec_file_name(a)l\n", ppc_reg(3), ppc_reg(3) );
+ if (exp_name)
+ {
+ output( "\tlis %s, .L%s_string(a)highest\n", ppc_reg(4), name );
+ output( "\tori %s, %s, .L%s_string(a)higher\n", ppc_reg(4), ppc_reg(4), name );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(4), ppc_reg(4) );
+ output( "\toris %s, %s, .L%s_string(a)high\n", ppc_reg(4), ppc_reg(4), name );
+ output( "\tori %s, %s, .L%s_string(a)l\n", ppc_reg(4), ppc_reg(4), name );
+ }
+ else
+ {
+ output( "\tlis %s, %u(a)highest\n", ppc_reg(4), odp->ordinal );
+ output( "\tori %s, %s, %u(a)higher\n", ppc_reg(4), ppc_reg(4), odp->ordinal );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(4), ppc_reg(4) );
+ output( "\toris %s, %s, %u(a)high\n", ppc_reg(4), ppc_reg(4), odp->ordinal );
+ output( "\tori %s, %s, %u(a)l\n", ppc_reg(4), ppc_reg(4), odp->ordinal );
+ }
+ output( "\tlis %s, __wine_spec_unimplemented_stub(a)highest\n", ppc_reg(12) );
+ output( "\tori %s, %s, __wine_spec_unimplemented_stub(a)higher\n", ppc_reg(12), ppc_reg(12) );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(12), ppc_reg(12) );
+ output( "\toris %s, %s, __wine_spec_unimplemented_stub(a)high\n", ppc_reg(12), ppc_reg(12) );
+ output( "\tori %s, %s, __wine_spec_unimplemented_stub(a)l\n", ppc_reg(12), ppc_reg(12) );
+ output( "\tmtctr %s\n", ppc_reg(12) );
+ output( "\tbctr\n" );
+ break;
default:
assert(0);
}
@@ -1684,6 +1796,136 @@ void output_syscalls( DLLSPEC *spec )
output( "\tmovk x0, #0x%x\n", invalid_param & 0x0000ffff );
output( "\tret\n" );
break;
+ case CPU_POWERPC64:
+ output( "\tlis %s, %u(a)highest\n", ppc_reg(12), count );
+ output( "\tori %s, %s, %u(a)higher\n", ppc_reg(12), ppc_reg(12), count );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(12), ppc_reg(12) );
+ output( "\toris %s, %s, %u(a)high\n", ppc_reg(12), ppc_reg(12), count );
+ output( "\tori %s, %s, %u(a)l\n", ppc_reg(12), ppc_reg(12), count );
+ output( "\tcmpw cr7, %s, %s\n", ppc_reg(11), ppc_reg(12) );
+ output( "\tbgt cr7, 3f\n" );
+ /* save return address (thunk_addr) */
+ output( "\tmflr %s\n", ppc_reg(0) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(0), 16, ppc_reg(1) );
+ /* Save all callee saved registers into the syscall_frame. */
+ output( "\tstdu %s, -%d(%s)\n",ppc_reg(1), 240, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(2), 24, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(3), 32, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(4), 40, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(5), 48, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(6), 56, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(7), 64, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(8), 72, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(9), 80, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(10), 88, ppc_reg(1) );
+ /* Save all nonvolatile registers into the syscall_frame. */
+ output( "\tstd %s, %d(%s)\n", ppc_reg(14), 96, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(15), 104, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(16), 112, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(17), 120, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(18), 128, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(19), 136, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(20), 144, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(21), 152, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(22), 160, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(23), 168, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(24), 176, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(25), 184, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(26), 192, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(27), 200, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(28), 208, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(29), 216, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(30), 224, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(31), 232, ppc_reg(1) );
+ output( "\tmr %s, %s\n", ppc_reg(15), ppc_reg(11) );
+ output( "\tmr %s, %s\n", ppc_reg(18), ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(11), 240 + 40, ppc_reg(1) );
+ output( "\tlis %s, %s(a)highest\n", ppc_reg(12), asm_name("NtCurrentTeb") );
+ output( "\tori %s, %s, %s(a)higher\n", ppc_reg(12), ppc_reg(12), asm_name("NtCurrentTeb") );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(12), ppc_reg(12) );
+ output( "\toris %s, %s, %s(a)high\n", ppc_reg(12), ppc_reg(12), asm_name("NtCurrentTeb") );
+ output( "\tori %s, %s, %s(a)l\n", ppc_reg(12), ppc_reg(12), asm_name("NtCurrentTeb") );
+ output( "\tmtctr %s\n", ppc_reg(12) );
+ output( "\tbctrl\n" );
+ /* ppc64_thread_data()->syscall_frame */
+ output( "\taddi %s, %s, 0x200\n", ppc_reg(3), ppc_reg(3) );
+ output( "\taddi %s, %s, 0x0f0\n", ppc_reg(3), ppc_reg(3) );
+ output( "\taddi %s, %s, 0x008\n", ppc_reg(19), ppc_reg(3) );
+ output( "\tstd %s, 0(%s)\n", ppc_reg(1), ppc_reg(19) ); /* syscall frame */
+ output( "\tld %s, %d(%s)\n", ppc_reg(3), 32, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(4), 40, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(5), 48, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(6), 56, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(7), 64, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(8), 72, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(9), 80, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(10), 88, ppc_reg(1) );
+ output( "\tlis %s, %s(a)highest\n", ppc_reg(12), asm_name(".Lsyscall_args") );
+ output( "\tori %s, %s, %s(a)higher\n", ppc_reg(12), ppc_reg(12), asm_name(".Lsyscall_args") );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(12), ppc_reg(12) );
+ output( "\toris %s, %s, %s(a)high\n", ppc_reg(12), ppc_reg(12), asm_name(".Lsyscall_args") );
+ output( "\tori %s, %s, %s(a)l\n", ppc_reg(12), ppc_reg(12), asm_name(".Lsyscall_args") );
+ output( "\tadd %s, %s, %s\n", ppc_reg(12), ppc_reg(12), ppc_reg(15) );
+ output( "\tlbz %s, 0(%s)\n", ppc_reg(16), ppc_reg(12) );
+ output( "\taddi %s, %s, -64\n", ppc_reg(16), ppc_reg(16) );
+ output( "\tcmpwi cr7, %s, 0\n", ppc_reg(16) );
+ output( "\textsw %s, %s\n", ppc_reg(16), ppc_reg(16) );
+ output( "\tble cr7, 2f\n" );
+ output( "\taddi %s, %s, %d\n", ppc_reg(17), ppc_reg(1), 240 + 64 + 96); /* this function + prev function (thunk) + parameter save area */
+ output( "\tsub %s, %s, %s\n", ppc_reg(1), ppc_reg(1), ppc_reg(16) );
+ output( "\taddi %s, %s, -%d\n", ppc_reg(1), ppc_reg(1), 96 );
+ output( "\trldicr %s, %s, 0, 59\n", ppc_reg(1), ppc_reg(1) ); /* align sp */
+ output( "\tstd %s, %d(%s)\n", ppc_reg(18), 0, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(2), 24, ppc_reg(1) );
+ output( "\taddi %s, %s, %d\n", ppc_reg(20), ppc_reg(1), 96 ); /* new parameter save area */
+ output( "1:\taddi %s, %s, -%d\n", ppc_reg(16), ppc_reg(16), 8 );
+ output( "\tldx %s, %s, %s\n", ppc_reg(0), ppc_reg(17), ppc_reg(16) );
+ output( "\tstdx %s, %s, %s\n", ppc_reg(0), ppc_reg(20), ppc_reg(16) );
+ output( "\tcmpwi cr7, %s, 0\n", ppc_reg(16) );
+ output( "\tbne cr7, 1b\n" );
+ output( "2:\tlis %s, %s(a)highest\n", ppc_reg(12), asm_name(".Lsyscall_table") );
+ output( "\tori %s, %s, %s(a)higher\n", ppc_reg(12), ppc_reg(12), asm_name(".Lsyscall_table") );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(12), ppc_reg(12) );
+ output( "\toris %s, %s, %s(a)high\n", ppc_reg(12), ppc_reg(12), asm_name(".Lsyscall_table") );
+ output( "\tori %s, %s, %s(a)l\n", ppc_reg(12), ppc_reg(12), asm_name(".Lsyscall_table") );
+ output( "\trldicr %s, %s, 3, 60\n", ppc_reg(17), ppc_reg(15) );
+ output( "\tadd %s, %s, %s\n", ppc_reg(17), ppc_reg(17), ppc_reg(12) );
+ output( "\tld %s, 0(%s)\n", ppc_reg(12), ppc_reg(17) );
+ output( "\tmtctr %s\n", ppc_reg(12) );
+ output( "\tbctrl\n" );
+ output( "\tmr %s, %s\n", ppc_reg(1), ppc_reg(18) );
+ output( "\tli %s, 0\n", ppc_reg(0) );
+ output( "\tstd %s, 0(%s)\n", ppc_reg(0), ppc_reg(19) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(2), 24, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(14), 96, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(15), 104, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(16), 112, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(17), 120, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(18), 128, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(19), 136, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(20), 144, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(21), 152, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(22), 160, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(23), 168, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(24), 176, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(25), 184, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(26), 192, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(27), 200, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(28), 208, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(29), 216, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(30), 224, ppc_reg(1) );
+ output( "\tld %s, %d(%s)\n", ppc_reg(31), 232, ppc_reg(1) );
+ output( "\taddi %s, %s, %d\n", ppc_reg(1), ppc_reg(1), 240 ); /* restore sp */
+ output( "\tld %s, %d(%s)\n", ppc_reg(0), 16, ppc_reg(1) );
+ output( "\tmtlr %s\n", ppc_reg(0) );
+ output( "\tblr\n" );
+ output( "3:\tlis %s, %u(a)highest\n", ppc_reg(3), invalid_param );
+ output( "\tori %s, %s, %u(a)higher\n", ppc_reg(3), ppc_reg(3), invalid_param );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(3), ppc_reg(3) );
+ output( "\toris %s, %s, %u(a)high\n", ppc_reg(3), ppc_reg(3), invalid_param );
+ output( "\tori %s, %s, %u(a)l\n", ppc_reg(3), ppc_reg(3), invalid_param );
+ output( "\tblr\n" );
+ break;
default:
assert(0);
}
@@ -1778,6 +2020,35 @@ void output_syscalls( DLLSPEC *spec )
output( "\tldp x29, x30, [sp], #16\n" );
output( "\tret\n" );
break;
+ case CPU_POWERPC64:
+ output( "\tmflr %s\n", ppc_reg(0) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(0), 16, ppc_reg(1) ); /* save lr */
+ output( "\tstdu %s, -%d(%s)\n",ppc_reg(1), 64, ppc_reg(1) );
+ output( "\tstd %s, %d(%s)\n", ppc_reg(2), 24, ppc_reg(1) ); /* save r2 */
+ output( "\tstd %s, %d(%s)\n", ppc_reg(0), 32, ppc_reg(1) ); /* save lr again */
+ output( "\tstd %s, %d(%s)\n", ppc_reg(11), 40, ppc_reg(1) ); /* save r11 */
+ output( "\tstd %s, %d(%s)\n", ppc_reg(12), 48, ppc_reg(1) ); /* save r12 */
+ output( "\tlis %s, %s(a)highest\n", ppc_reg(12), asm_name("__wine_syscall_dispatcher") );
+ output( "\tori %s, %s, %s(a)higher\n", ppc_reg(12), ppc_reg(12), asm_name("__wine_syscall_dispatcher") );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(12), ppc_reg(12) );
+ output( "\toris %s, %s, %s(a)high\n", ppc_reg(12), ppc_reg(12), asm_name("__wine_syscall_dispatcher") );
+ output( "\tori %s, %s, %s(a)l\n", ppc_reg(12), ppc_reg(12), asm_name("__wine_syscall_dispatcher") );
+ output( "\tld %s, 0(%s)\n", ppc_reg(12), ppc_reg(12) );
+ output( "\tlis %s, %u(a)highest\n", ppc_reg(11), i );
+ output( "\tori %s, %s, %u(a)higher\n", ppc_reg(11), ppc_reg(11), i );
+ output( "\trldicr %s, %s, 32, 31\n", ppc_reg(11), ppc_reg(11) );
+ output( "\toris %s, %s, %u(a)high\n", ppc_reg(11), ppc_reg(11), i );
+ output( "\tori %s, %s, %u(a)l\n", ppc_reg(11), ppc_reg(11), i );
+ output( "\tmtctr %s\n", ppc_reg(12) );
+ output( "\tbctrl\n" );
+ output( "\tld %s, %d(%s)\n", ppc_reg(12), 48, ppc_reg(1) ); /* restore r12 */
+ output( "\tld %s, %d(%s)\n", ppc_reg(11), 40, ppc_reg(1) ); /* restore r11 */
+ output( "\tld %s, %d(%s)\n", ppc_reg(2), 24, ppc_reg(1) ); /* restore r2 */
+ output( "\taddi %s, %s, %d\n", ppc_reg(1), ppc_reg(1), 64 ); /* restore sp */
+ output( "\tld %s, %d(%s)\n", ppc_reg(0), 16, ppc_reg(1) ); /* restore lr */
+ output( "\tmtlr %s\n", ppc_reg(0) );
+ output( "\tblr\n" );
+ break;
default:
assert(0);
}
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index 1477df7f259..2420225ffaf 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -54,6 +54,8 @@ int safe_seh = 0;
enum target_cpu target_cpu = CPU_x86;
#elif defined(__x86_64__)
enum target_cpu target_cpu = CPU_x86_64;
+#elif defined(__powerpc64__)
+enum target_cpu target_cpu = CPU_POWERPC64;
#elif defined(__powerpc__)
enum target_cpu target_cpu = CPU_POWERPC;
#elif defined(__arm__)
diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c
index 2e6424fe76a..edcacadf801 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -432,9 +432,9 @@ static int parse_spec_stub( ORDDEF *odp, DLLSPEC *spec )
odp->link_name = xstrdup("");
/* don't bother generating stubs for Winelib */
if (odp->flags & FLAG_CPU_MASK)
- odp->flags &= FLAG_CPU(CPU_x86) | FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM) | FLAG_CPU(CPU_ARM64);
+ odp->flags &= FLAG_CPU(CPU_x86) | FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM) | FLAG_CPU(CPU_ARM64) | FLAG_CPU(CPU_POWERPC64);
else
- odp->flags |= FLAG_CPU(CPU_x86) | FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM) | FLAG_CPU(CPU_ARM64);
+ odp->flags |= FLAG_CPU(CPU_x86) | FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM) | FLAG_CPU(CPU_ARM64) | FLAG_CPU(CPU_POWERPC64);
return parse_spec_arguments( odp, spec, 1 );
}
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index 678f104c555..21df41329cd 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -32,12 +32,13 @@
#include "build.h"
-#define IMAGE_FILE_MACHINE_UNKNOWN 0
-#define IMAGE_FILE_MACHINE_I386 0x014c
-#define IMAGE_FILE_MACHINE_POWERPC 0x01f0
-#define IMAGE_FILE_MACHINE_AMD64 0x8664
-#define IMAGE_FILE_MACHINE_ARMNT 0x01C4
-#define IMAGE_FILE_MACHINE_ARM64 0xaa64
+#define IMAGE_FILE_MACHINE_UNKNOWN 0
+#define IMAGE_FILE_MACHINE_I386 0x014c
+#define IMAGE_FILE_MACHINE_POWERPC 0x01f0
+#define IMAGE_FILE_MACHINE_POWERPC64 0x01f2
+#define IMAGE_FILE_MACHINE_AMD64 0x8664
+#define IMAGE_FILE_MACHINE_ARMNT 0x01C4
+#define IMAGE_FILE_MACHINE_ARM64 0xaa64
#define IMAGE_SIZEOF_NT_OPTIONAL32_HEADER 224
#define IMAGE_SIZEOF_NT_OPTIONAL64_HEADER 240
@@ -610,7 +611,6 @@ void output_exports( DLLSPEC *spec )
}
}
-
/*******************************************************************
* output_module
*
@@ -655,6 +655,7 @@ void output_module( DLLSPEC *spec )
break;
case CPU_ARM64:
case CPU_POWERPC:
+ case CPU_POWERPC64:
output( "\n\t.section \".init\",\"ax\"\n" );
output( "\tb 1f\n" );
break;
@@ -676,11 +677,12 @@ void output_module( DLLSPEC *spec )
output( "\t.long 0x4550\n" ); /* Signature */
switch(target_cpu)
{
- case CPU_x86: machine = IMAGE_FILE_MACHINE_I386; break;
- case CPU_x86_64: machine = IMAGE_FILE_MACHINE_AMD64; break;
- case CPU_POWERPC: machine = IMAGE_FILE_MACHINE_POWERPC; break;
- case CPU_ARM: machine = IMAGE_FILE_MACHINE_ARMNT; break;
- case CPU_ARM64: machine = IMAGE_FILE_MACHINE_ARM64; break;
+ case CPU_x86: machine = IMAGE_FILE_MACHINE_I386; break;
+ case CPU_x86_64: machine = IMAGE_FILE_MACHINE_AMD64; break;
+ case CPU_POWERPC: machine = IMAGE_FILE_MACHINE_POWERPC; break;
+ case CPU_POWERPC64: machine = IMAGE_FILE_MACHINE_POWERPC64; break;
+ case CPU_ARM: machine = IMAGE_FILE_MACHINE_ARMNT; break;
+ case CPU_ARM64: machine = IMAGE_FILE_MACHINE_ARM64; break;
}
output( "\t.short 0x%04x\n", /* Machine */
machine );
@@ -833,11 +835,12 @@ void output_fake_module( DLLSPEC *spec )
put_dword( 0x4550 ); /* Signature */
switch(target_cpu)
{
- case CPU_x86: put_word( IMAGE_FILE_MACHINE_I386 ); break;
- case CPU_x86_64: put_word( IMAGE_FILE_MACHINE_AMD64 ); break;
- case CPU_POWERPC: put_word( IMAGE_FILE_MACHINE_POWERPC ); break;
- case CPU_ARM: put_word( IMAGE_FILE_MACHINE_ARMNT ); break;
- case CPU_ARM64: put_word( IMAGE_FILE_MACHINE_ARM64 ); break;
+ case CPU_x86: put_word( IMAGE_FILE_MACHINE_I386 ); break;
+ case CPU_x86_64: put_word( IMAGE_FILE_MACHINE_AMD64 ); break;
+ case CPU_POWERPC: put_word( IMAGE_FILE_MACHINE_POWERPC ); break;
+ case CPU_POWERPC64: put_word( IMAGE_FILE_MACHINE_POWERPC64 ); break;
+ case CPU_ARM: put_word( IMAGE_FILE_MACHINE_ARMNT ); break;
+ case CPU_ARM64: put_word( IMAGE_FILE_MACHINE_ARM64 ); break;
}
put_word( nb_sections ); /* NumberOfSections */
put_dword( hash_filename(spec->file_name) ); /* TimeDateStamp */
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c
index 928a2460aa1..5389c1ba32c 100644
--- a/tools/winebuild/utils.c
+++ b/tools/winebuild/utils.c
@@ -52,21 +52,23 @@ static const struct
enum target_cpu cpu;
} cpu_names[] =
{
- { "i386", CPU_x86 },
- { "i486", CPU_x86 },
- { "i586", CPU_x86 },
- { "i686", CPU_x86 },
- { "i786", CPU_x86 },
- { "amd64", CPU_x86_64 },
- { "x86_64", CPU_x86_64 },
- { "powerpc", CPU_POWERPC },
- { "arm", CPU_ARM },
- { "armv5", CPU_ARM },
- { "armv6", CPU_ARM },
- { "armv7", CPU_ARM },
- { "armv7a", CPU_ARM },
- { "arm64", CPU_ARM64 },
- { "aarch64", CPU_ARM64 },
+ { "i386", CPU_x86 },
+ { "i486", CPU_x86 },
+ { "i586", CPU_x86 },
+ { "i686", CPU_x86 },
+ { "i786", CPU_x86 },
+ { "amd64", CPU_x86_64 },
+ { "x86_64", CPU_x86_64 },
+ { "powerpc", CPU_POWERPC },
+ { "powerpc64", CPU_POWERPC64 },
+ { "powerpc64le", CPU_POWERPC64 },
+ { "arm", CPU_ARM },
+ { "armv5", CPU_ARM },
+ { "armv6", CPU_ARM },
+ { "armv7", CPU_ARM },
+ { "armv7a", CPU_ARM },
+ { "arm64", CPU_ARM64 },
+ { "aarch64", CPU_ARM64 },
};
/* atexit handler to clean tmp files */
@@ -425,6 +427,7 @@ struct strarray get_as_command(void)
switch(target_cpu)
{
case CPU_POWERPC:
+ case CPU_POWERPC64:
strarray_add_one( &args, (force_pointer_size == 8) ? "-a64" : "-a32" );
break;
default:
@@ -472,6 +475,10 @@ struct strarray get_ld_command(void)
case CPU_POWERPC:
strarray_add( &args, "-m", (force_pointer_size == 8) ? "elf64ppc" : "elf32ppc", NULL );
break;
+ case CPU_POWERPC64:
+ /* We only respect the little endian version for now */
+ strarray_add( &args, "-m", (force_pointer_size == 8) ? "elf64lppc" : "elf32lppc", NULL );
+ break;
default:
strarray_add( &args, "-m", (force_pointer_size == 8) ? "elf_x86_64" : "elf_i386", NULL );
break;
@@ -1029,6 +1036,7 @@ unsigned int get_alignment(unsigned int align)
if (target_platform != PLATFORM_APPLE) return align;
/* fall through */
case CPU_POWERPC:
+ case CPU_POWERPC64:
case CPU_ARM:
case CPU_ARM64:
n = 0;
@@ -1056,6 +1064,7 @@ unsigned int get_ptr_size(void)
case CPU_ARM:
return 4;
case CPU_x86_64:
+ case CPU_POWERPC64:
case CPU_ARM64:
return 8;
}
--
2.25.1
Jan. 31, 2021
[PATCH 08/23] include: Add PPC64 context
by André Hentschel
Signed-off-by: André Hentschel <nerv(a)dawncrow.de>
---
include/winnt.h | 115 +++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 114 insertions(+), 1 deletion(-)
diff --git a/include/winnt.h b/include/winnt.h
index 0c9487bcffc..359a6a3a5fd 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -2262,8 +2262,121 @@ typedef struct _CONTEXT
#endif /* _MIPS_ */
+/* PowerPC 64-bit context definitions */
+#ifdef __powerpc64__
+
+#define CONTEXT_POWERPC64 0x00800000
+#define CONTEXT_CONTROL 0x0001
+#define CONTEXT_FLOATING_POINT 0x0002
+#define CONTEXT_INTEGER 0x0004
+#define CONTEXT_DEBUG_REGISTERS 0x0008
+#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
+#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | \
+ CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS)
+
+#define EXCEPTION_READ_FAULT 0
+#define EXCEPTION_WRITE_FAULT 1
+#define EXCEPTION_EXECUTE_FAULT 8
+
+typedef struct
+{
+ /* These are selected by CONTEXT_FLOATING_POINT */
+ double Fpr0;
+ double Fpr1;
+ double Fpr2;
+ double Fpr3;
+ double Fpr4;
+ double Fpr5;
+ double Fpr6;
+ double Fpr7;
+ double Fpr8;
+ double Fpr9;
+ double Fpr10;
+ double Fpr11;
+ double Fpr12;
+ double Fpr13;
+ double Fpr14;
+ double Fpr15;
+ double Fpr16;
+ double Fpr17;
+ double Fpr18;
+ double Fpr19;
+ double Fpr20;
+ double Fpr21;
+ double Fpr22;
+ double Fpr23;
+ double Fpr24;
+ double Fpr25;
+ double Fpr26;
+ double Fpr27;
+ double Fpr28;
+ double Fpr29;
+ double Fpr30;
+ double Fpr31;
+ double Fpscr;
+
+ /* These are selected by CONTEXT_INTEGER */
+ DWORD64 Gpr0;
+ DWORD64 Gpr1;
+ DWORD64 Gpr2;
+ DWORD64 Gpr3;
+ DWORD64 Gpr4;
+ DWORD64 Gpr5;
+ DWORD64 Gpr6;
+ DWORD64 Gpr7;
+ DWORD64 Gpr8;
+ DWORD64 Gpr9;
+ DWORD64 Gpr10;
+ DWORD64 Gpr11;
+ DWORD64 Gpr12;
+ DWORD64 Gpr13;
+ DWORD64 Gpr14;
+ DWORD64 Gpr15;
+ DWORD64 Gpr16;
+ DWORD64 Gpr17;
+ DWORD64 Gpr18;
+ DWORD64 Gpr19;
+ DWORD64 Gpr20;
+ DWORD64 Gpr21;
+ DWORD64 Gpr22;
+ DWORD64 Gpr23;
+ DWORD64 Gpr24;
+ DWORD64 Gpr25;
+ DWORD64 Gpr26;
+ DWORD64 Gpr27;
+ DWORD64 Gpr28;
+ DWORD64 Gpr29;
+ DWORD64 Gpr30;
+ DWORD64 Gpr31;
+
+ DWORD64 Cr;
+ DWORD64 Xer;
+
+ /* These are selected by CONTEXT_CONTROL */
+ DWORD64 Msr;
+ DWORD64 Iar; /* Instruction Address Register , aka PC ... */
+ DWORD64 Lr;
+ DWORD64 Ctr;
+
+ DWORD64 ContextFlags;
+
+ DWORD64 Dar; /* Fault registers for coredump */
+ DWORD64 Dsisr;
+ DWORD64 Trap; /* number of powerpc exception taken */
+
+ /* These are selected by CONTEXT_DEBUG_REGISTERS */
+ DWORD64 Dr0;
+ DWORD64 Dr1;
+ DWORD64 Dr2;
+ DWORD64 Dr3;
+ DWORD64 Dr4;
+ DWORD64 Dr5;
+ DWORD64 Dr6;
+ DWORD64 Dr7;
+} CONTEXT, *PCONTEXT;
+
/* PowerPC context definitions */
-#ifdef __powerpc__
+#elif defined(__powerpc__)
#define CONTEXT_CONTROL 0x0001
#define CONTEXT_FLOATING_POINT 0x0002
--
2.25.1
Jan. 31, 2021
[PATCH 07/23] setupapi: Add support for PPC64
by André Hentschel
Signed-off-by: André Hentschel <nerv(a)dawncrow.de>
---
dlls/setupapi/devinst.c | 2 ++
dlls/setupapi/fakedll.c | 4 ++++
include/winnt.h | 2 ++
3 files changed, 8 insertions(+)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index de0413e74f5..3c72c82a26b 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -61,6 +61,8 @@ static const WCHAR NtPlatformExtension[] = {'.','N','T','a','m','d','6','4',0};
static const WCHAR NtPlatformExtension[] = {'.','N','T','a','r','m',0};
#elif defined(__aarch64__)
static const WCHAR NtPlatformExtension[] = {'.','N','T','a','r','m','6','4',0};
+#elif defined(__powerpc64__)
+static const WCHAR NtPlatformExtension[] = {'.','N','T','p','p','c','6','4',0};
#endif
static const WCHAR Signature[] = {'S','i','g','n','a','t','u','r','e',0};
static const WCHAR Version[] = {'V','e','r','s','i','o','n',0};
diff --git a/dlls/setupapi/fakedll.c b/dlls/setupapi/fakedll.c
index cf219916400..f020e275248 100644
--- a/dlls/setupapi/fakedll.c
+++ b/dlls/setupapi/fakedll.c
@@ -281,6 +281,8 @@ static BOOL build_fake_dll( HANDLE file, const WCHAR *name )
nt->FileHeader.Machine = IMAGE_FILE_MACHINE_ARM64;
#elif defined __arm__
nt->FileHeader.Machine = IMAGE_FILE_MACHINE_ARMNT;
+#elif defined __powerpc64__
+ nt->FileHeader.Machine = IMAGE_FILE_MACHINE_POWERPC64;
#else
nt->FileHeader.Machine = IMAGE_FILE_MACHINE_I386;
#endif
@@ -711,6 +713,8 @@ static BOOL CALLBACK register_manifest( HMODULE module, const WCHAR *type, WCHAR
static const char current_arch[] = "arm";
#elif defined __aarch64__
static const char current_arch[] = "arm64";
+#elif defined __powerpc64__
+ static const char current_arch[] = "ppc64";
#else
static const char current_arch[] = "none";
#endif
diff --git a/include/winnt.h b/include/winnt.h
index 5b3efe61385..0c9487bcffc 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -689,6 +689,7 @@ typedef DWORD FLONG;
#define PROCESSOR_ARCHITECTURE_ARM64 12
#define PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64 13
#define PROCESSOR_ARCHITECTURE_IA32_ON_ARM64 14
+#define PROCESSOR_ARCHITECTURE_PPC64 200 /* Wine extension */
#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
/* dwProcessorType */
@@ -3046,6 +3047,7 @@ typedef struct _IMAGE_VXD_HEADER {
#define IMAGE_FILE_MACHINE_AM33 0x01d3
#define IMAGE_FILE_MACHINE_POWERPC 0x01f0
#define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1
+#define IMAGE_FILE_MACHINE_POWERPC64 0x01f2
#define IMAGE_FILE_MACHINE_IA64 0x0200
#define IMAGE_FILE_MACHINE_MIPS16 0x0266
#define IMAGE_FILE_MACHINE_ALPHA64 0x0284
--
2.25.1
Jan. 31, 2021
[PATCH 06/23] wrc: Add PPC64 support
by André Hentschel
Signed-off-by: André Hentschel <nerv(a)dawncrow.de>
---
tools/wrc/wrc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/wrc/wrc.c b/tools/wrc/wrc.c
index b260e20af07..1f2486f9ff7 100644
--- a/tools/wrc/wrc.c
+++ b/tools/wrc/wrc.c
@@ -328,7 +328,8 @@ static void set_target( const char *target )
if (!(p = strchr( cpu, '-' ))) error( "Invalid target specification '%s'\n", target );
*p = 0;
if (!strcmp( cpu, "amd64" ) || !strcmp( cpu, "x86_64" ) ||
- !strcmp( cpu, "ia64" ) || !strcmp( cpu, "aarch64" ))
+ !strcmp( cpu, "ia64" ) || !strcmp( cpu, "aarch64" ) ||
+ !strcmp( cpu, "ppc64" ) || !strcmp( cpu, "powerpc64le" ))
pointer_size = 8;
else
pointer_size = 4;
--
2.25.1
Jan. 31, 2021