Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Nov 2020 18:30:59 +0000 (UTC)
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r556448 - head/games/ezquake/files
Message-ID:  <202011271830.0ARIUxeM045140@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pkubaj
Date: Fri Nov 27 18:30:58 2020
New Revision: 556448
URL: https://svnweb.freebsd.org/changeset/ports/556448

Log:
  games/ezquake: fix build on powerpc64
  
  rdtsc is not available on powerpc64.

Modified:
  head/games/ezquake/files/patch-host.c

Modified: head/games/ezquake/files/patch-host.c
==============================================================================
--- head/games/ezquake/files/patch-host.c	Fri Nov 27 17:42:04 2020	(r556447)
+++ head/games/ezquake/files/patch-host.c	Fri Nov 27 18:30:58 2020	(r556448)
@@ -1,6 +1,26 @@
---- host.c.orig
+--- host.c.orig	2020-09-16 22:08:02 UTC
 +++ host.c
-@@ -351,7 +351,7 @@
+@@ -333,11 +333,19 @@ void SYSINFO_Init(void)
+ 	SYSINFO_processor_description = cpu_model;
+ 
+ 	gettimeofday(&old_tp, NULL);
++#ifdef __powerpc64__
++	__asm__ __volatile__("mfspr %%r3, 268": "=r" (old_tsc));
++#else
+ 	old_tsc = rdtsc();
++#endif
+ 	do {
+ 		gettimeofday(&tp, NULL);
+ 	} while ((tp.tv_sec - old_tp.tv_sec) * 1000000. + tp.tv_usec - old_tp.tv_usec < 1000000.);
++#ifdef __powerpc64__
++	__asm__ __volatile__("mfspr %%r3, 268": "=r" (tsc_freq));
++#else
+ 	tsc_freq = rdtsc();
++#endif
+ 	SYSINFO_MHz = (int)((tsc_freq - old_tsc) /
+ 						(tp.tv_sec - old_tp.tv_sec + (tp.tv_usec - old_tp.tv_usec) / 1000000.) /
+ 						1000000. + .5);
+@@ -351,7 +359,7 @@ void SYSINFO_Init(void)
  		SYSINFO_3D_description = Q_strdup(gl_renderer);
  	}
  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011271830.0ARIUxeM045140>