1
0
forked from 0ad/0ad

Enable support for powerpc64 systems. New problems with NVTT will be addressed in another diff.

Patch by: @tpearson-raptor
Comments by: @q66
Refs:
https://github.com/void-linux/void-packages/blob/master/srcpkgs/0ad/patches/ppc64.patch

Differential Revision: https://code.wildfiregames.com/D1619
This was SVN commit r24995.
This commit is contained in:
Stan 2021-03-03 15:13:47 +00:00
parent a4223c87f6
commit c16d961cd2
6 changed files with 28 additions and 5 deletions

View File

@ -258,6 +258,7 @@
{ "nick": "TrinityDeath", "name": "Jethro Lu" },
{ "nick": "triumvir", "name": "Corin Schedler" },
{ "nick": "trompetin17", "name": "Juan Guillermo" },
{ "nick": "tpearson", "name": "Timothy Pearson" },
{ "nick": "user1", "name": "A. C." },
{ "nick": "usey11" },
{ "nick": "vincent_c", "name": "Vincent Cheng" },

View File

@ -87,6 +87,8 @@ else
arch = "aarch64"
elseif string.find(machine, "e2k") == 1 then
arch = "e2k"
elseif string.find(machine, "ppc64") == 1 or string.find(machine, "powerpc64") == 1 then
arch = "ppc64"
else
print("WARNING: Cannot determine architecture from GCC, assuming x86")
end
@ -865,6 +867,8 @@ function setup_all_libs ()
table.insert(source_dirs, "lib/sysdep/arch/aarch64");
elseif arch == "e2k" then
table.insert(source_dirs, "lib/sysdep/arch/e2k");
elseif arch == "ppc64" then
table.insert(source_dirs, "lib/sysdep/arch/ppc64");
end
-- OS-specific

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2018 Wildfire Games.
/* Copyright (C) 2021 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -80,7 +80,18 @@ static const size_t cacheLineSize = 64; // (L2)
// MMU pages
//
#ifdef ARCH_PPC64
// NOTE: ppc64 can operate in either 4k or 64k page size mode
// If the define page size is larger than the active page size,
// the allocator functions normally. If the defined page size
// is less than the active page size, the allocator fails tests.
//
// Define the page size to the maximum known architectural page
// size on ppc64 systems.
static const size_t g_PageSize = 64 * 1024; // 64 KB
#else
static const size_t g_PageSize = 4 * 1024; // 4 KB
#endif
static const size_t g_LargePageSize = 2 * 1024 * 1024; // 2 MB

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2021 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -33,7 +33,7 @@
#ifndef BYTE_ORDER
# define LITTLE_ENDIAN 0x4321
# define BIG_ENDIAN 0x1234
# if ARCH_IA32 || ARCH_IA64 || ARCH_AMD64 || ARCH_ALPHA || ARCH_ARM || ARCH_AARCH64 || ARCH_MIPS || ARCH_E2K || defined(__LITTLE_ENDIAN__)
# if ARCH_IA32 || ARCH_IA64 || ARCH_AMD64 || ARCH_ALPHA || ARCH_ARM || ARCH_AARCH64 || ARCH_MIPS || ARCH_E2K || ARCH_PPC64 || defined(__LITTLE_ENDIAN__)
# define BYTE_ORDER LITTLE_ENDIAN
# else
# define BYTE_ORDER BIG_ENDIAN

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2021 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -64,6 +64,12 @@
#else
# define ARCH_AARCH64 0
#endif
// .. PowerPC64 (PPC64)
#if defined(__powerpc64__)
# define ARCH_PPC64 1
#else
# define ARCH_PPC64 0
#endif
// .. MIPS
#if defined(__MIPS__) || defined(__mips__) || defined(__mips)
# define ARCH_MIPS 1
@ -78,7 +84,7 @@
#endif
// ensure exactly one architecture has been detected
#if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_AARCH64+ARCH_MIPS+ARCH_E2K) != 1
#if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_AARCH64+ARCH_MIPS+ARCH_E2K+ARCH_PPC64) != 1
# error "architecture not correctly detected (either none or multiple ARCH_* defined)"
#endif

View File

@ -124,6 +124,7 @@ void RunHardwareDetection()
scriptInterface.SetProperty(settings, "arch_arm", ARCH_ARM);
scriptInterface.SetProperty(settings, "arch_aarch64", ARCH_AARCH64);
scriptInterface.SetProperty(settings, "arch_e2k", ARCH_E2K);
scriptInterface.SetProperty(settings, "arch_ppc64", ARCH_PPC64);
#ifdef NDEBUG
scriptInterface.SetProperty(settings, "build_debug", 0);