[x264-devel] [Git][videolan/x264][master] 2 commits: arm: Enable HAVE_SECTION_DATA_REL_RO for OpenBSD

Anton Mitrofanov gitlab at videolan.org
Tue Apr 13 20:45:27 UTC 2021



Anton Mitrofanov pushed to branch master at VideoLAN / x264


Commits:
989f618e by Brad Smith at 2021-04-13T20:40:49+00:00
arm: Enable HAVE_SECTION_DATA_REL_RO for OpenBSD

- - - - -
10e1b406 by Brad Smith at 2021-04-13T20:40:49+00:00
Use sysconf(_SC_NPROCESSORS_ONLN) on OpenBSD

On modern versions of OpenBSD, the number of processors online may differ from
the number of processors configured.

- - - - -


2 changed files:

- common/arm/asm.S
- common/cpu.c


Changes:

=====================================
common/arm/asm.S
=====================================
@@ -74,7 +74,7 @@
 #   define FUNC @
 #endif
 
-#if SYS_LINUX
+#if SYS_LINUX || SYS_OPENBSD
 #define HAVE_SECTION_DATA_REL_RO 1
 #else
 #define HAVE_SECTION_DATA_REL_RO 0


=====================================
common/cpu.c
=====================================
@@ -433,7 +433,7 @@ int x264_cpu_num_processors( void )
 #elif SYS_WINDOWS
     return x264_pthread_num_processors_np();
 
-#elif SYS_CYGWIN || SYS_SunOS
+#elif SYS_CYGWIN || SYS_SunOS || SYS_OPENBSD
     return sysconf( _SC_NPROCESSORS_ONLN );
 
 #elif SYS_LINUX
@@ -460,15 +460,10 @@ int x264_cpu_num_processors( void )
     get_system_info( &info );
     return info.cpu_count;
 
-#elif SYS_MACOSX || SYS_FREEBSD || SYS_OPENBSD
+#elif SYS_MACOSX || SYS_FREEBSD
     int ncpu;
     size_t length = sizeof( ncpu );
-#if SYS_OPENBSD
-    int mib[2] = { CTL_HW, HW_NCPU };
-    if( sysctl(mib, 2, &ncpu, &length, NULL, 0) )
-#else
     if( sysctlbyname("hw.ncpu", &ncpu, &length, NULL, 0) )
-#endif
     {
         ncpu = 1;
     }



View it on GitLab: https://code.videolan.org/videolan/x264/-/compare/979044a6595c7d01d14bca0360f0e94bb815af70...10e1b406b1a938b483b42bde326264baeca490dd

-- 
View it on GitLab: https://code.videolan.org/videolan/x264/-/compare/979044a6595c7d01d14bca0360f0e94bb815af70...10e1b406b1a938b483b42bde326264baeca490dd
You're receiving this email because of your account on code.videolan.org.




More information about the x264-devel mailing list