VirtualBox

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

最後變更 在這個檔案從91582是 76030,由 vboxsync 提交於 6 年 前

libpng-1.6.36: properly export to OSE, and while at it fix EOL style for shell scripts

  • 屬性 svn:eol-style 設為 native
檔案大小: 880 位元組
 
1/* contrib/powerpc-vsx/linux_aux.c
2 *
3 * Copyright (c) 2017 Glenn Randers-Pehrson
4 * Written by Vadim Barkov, 2017.
5 * Last changed in libpng 1.6.29 [March 16, 2017]
6 *
7 * This code is released under the libpng license.
8 * For conditions of distribution and use, see the disclaimer
9 * and license in png.h
10 *
11 * STATUS: TESTED
12 * BUG REPORTS: [email protected]
13 *
14 * png_have_vsx implemented for Linux by using the auxiliary vector mechanism.
15 *
16 * This code is strict ANSI-C and is probably moderately portable; it does
17 * however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
18 */
19
20#include "sys/auxv.h"
21#include "png.h"
22
23static int
24png_have_vsx(png_structp png_ptr)
25{
26 unsigned long auxv = getauxval(AT_HWCAP);
27
28 PNG_UNUSED(png_ptr)
29
30 if(auxv & (PPC_FEATURE_HAS_ALTIVEC|PPC_FEATURE_HAS_VSX))
31 return 1;
32 else
33 return 0;
34}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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