VirtualBox

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

最後變更 在這個檔案從105132是 103316,由 vboxsync 提交於 14 月 前

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

  • 屬性 svn:eol-style 設為 native
檔案大小: 830 位元組
 
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}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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