VirtualBox

source: vbox/trunk/src/libs/libpng-1.6.43/contrib/powerpc-vsx/linux_aux.c@ 105468

Last change on this file since 105468 was 103316, checked in by vboxsync, 16 months ago

libpng-1.6.42: Applied and adjusted our libpng changes to 1.6.42. bugref:8515

  • Property svn:eol-style set to native
File size: 830 bytes
Line 
1/* contrib/powerpc-vsx/linux_aux.c
2 *
3 * Copyright (c) 2017 Glenn Randers-Pehrson
4 * Written by Vadim Barkov, 2017.
5 *
6 * This code is released under the libpng license.
7 * For conditions of distribution and use, see the disclaimer
8 * and license in png.h
9 *
10 * STATUS: TESTED
11 * BUG REPORTS: [email protected]
12 *
13 * png_have_vsx implemented for Linux by using the auxiliary vector mechanism.
14 *
15 * This code is strict ANSI-C and is probably moderately portable; it does
16 * however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
17 */
18
19#include "sys/auxv.h"
20#include "png.h"
21
22static int
23png_have_vsx(png_structp png_ptr)
24{
25 unsigned long auxv = getauxval(AT_HWCAP);
26
27 PNG_UNUSED(png_ptr)
28
29 if(auxv & (PPC_FEATURE_HAS_ALTIVEC|PPC_FEATURE_HAS_VSX))
30 return 1;
31 else
32 return 0;
33}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette