text
stringlengths
4
6.14k
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ /* { dg-options "-O2 -fstack-protector-strong -mlong-double-128" } */ extern long double foo (long double); extern double bar (double); typedef long long int64_t; typedef unsigned long long uint64_t; typedef union { int64_t i[2]; long double x; double d[2]; } mynumber; static const double t512 = 0x1p512, tm256 = 0x1p-256, two54 = 0x1p54, twom54 = 0x1p-54; long double foo (long double x) { static const long double big = 134217728.0, big1 = 134217729.0; long double t, s, i; mynumber a, c; uint64_t k, l; int64_t m, n; double d; a.x = x; k = a.i[0] & 0x7fffffffffffffffL; if (k > 0x000fffff00000000L && k < 0x7ff0000000000000L) { if (x < 0) return (big1 - big1) / (big - big); l = (k & 0x001fffffffffffffL) | 0x3fe0000000000000L; if ((a.i[1] & 0x7fffffffffffffffL) != 0) { n = (int64_t) ((l - k) * 2) >> 53; m = (a.i[1] >> 52) & 0x7ff; if (m == 0) { a.d[1] *= two54; m = ((a.i[1] >> 52) & 0x7ff) - 54; } m += n; if (m > 0) a.i[1] = (a.i[1] & 0x800fffffffffffffL) | (m << 52); else if (m <= -54) { a.i[1] &= 0x8000000000000000L; } else { m += 54; a.i[1] = (a.i[1] & 0x800fffffffffffffL) | (m << 52); a.d[1] *= twom54; } } a.i[0] = l; s = a.x; d = bar (a.d[0]); c.i[0] = 0x2000000000000000L + ((k & 0x7fe0000000000000L) >> 1); c.i[1] = 0; i = d; t = 0.5L * (i + s / i); i = 0.5L * (t + s / t); return c.x * i; } else { if (k >= 0x7ff0000000000000L) return x * x + x; if (x == 0) return x; if (x < 0) return (big1 - big1) / (big - big); return tm256 * foo (x * t512); } }
/*********************************************************************** * syntax.h - inference rule language parser *********************************************************************** * * Copyright (c) 1995 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef SYNTAX_H #define SYNTAX_H /*********************************************************************** * ONLY FOR USE BY: lexicon.c grammar.y ***********************************************************************/ typedef struct { int n; /* number of elements */ char **ss; /* dynamically allocated array */ } StringArray; typedef struct { int t1; /* start of interval */ int t2; /* end of interval */ } Interval; /* parser stack entry */ typedef union { int i; char *s; double d; StringArray sa; Interval t; pmUnits u; Metric *m; Expr *x; Symbol *z; } YYSTYPE; #define YYSTYPE_IS_DECLARED 1 extern YYSTYPE yylval; /* error reporting */ extern int errs; /* error count */ void yyerror(char *); void synerr(void); void synwarn(void); /* parser actions */ Symbol statement(char *, Expr *); Expr *ruleExpr(Expr *, Expr *); Expr *relExpr(int, Expr *, Expr *); Expr *binaryExpr(int, Expr *, Expr *); Expr *unaryExpr(int, Expr *); Expr *domainExpr(int, int, Expr *); Expr *percentExpr(double, int, Expr *); Expr *numMergeExpr(int, Expr *); Expr *boolMergeExpr(int, Expr *); Expr *fetchExpr(char *, StringArray, StringArray, Interval); Expr *numConst(double, pmUnits); Expr *strConst(char *); Expr *boolConst(Boolean); Expr *numVar(Expr *); Expr *boolVar(Expr *); Expr *actExpr(int, Expr *, Expr *); Expr *actArgExpr(Expr *, Expr *); Expr *actArgList(Expr *, char *); /* parse tree */ extern Symbol parse; /*********************************************************************** * public ***********************************************************************/ /* Initialization to be called at the start of new input file. */ int synInit(char *); /* parse single statement */ Symbol syntax(void); #endif /* SYNTAX_H */
/////////////////////////////////////////////////////////////////////////////// // Name: pdffontdataopentype.h // Purpose: Definition of font data for OpenType fonts // Author: Ulrich Telle // Modified by: // Created: 2009-05-15 // Copyright: (c) Ulrich Telle // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// /// \file pdffontdataopentype.h Definition of font data for OpenType fonts #ifndef _PDF_FONT_DATA_OPENTYPE_H_ #define _PDF_FONT_DATA_OPENTYPE_H_ // OpenType fonts are only available in Unicode build #if wxUSE_UNICODE // wxWidgets headers #include <wx/strconv.h> #include <wx/stream.h> #include <wx/string.h> #include <wx/xml/xml.h> // wxPdfDocument headers #include "wx/pdfdocdef.h" #include "wx/pdfarraytypes.h" #include "wx/pdffontdata.h" /// Class representing Unicode OpenType fonts. (For internal use only) class WXDLLIMPEXP_PDFDOC wxPdfFontDataOpenTypeUnicode : public wxPdfFontData { public: ///< Default constructor wxPdfFontDataOpenTypeUnicode(); /// Default destructor virtual ~wxPdfFontDataOpenTypeUnicode(); /// Initialize font data /** * \return TRUE if the font data are initialized, FALSE otherwise */ virtual bool Initialize(); /// Get the width of a string /** * \param s the string for which the width should be calculated * \param encoding the character to glyph mapping * \param withKerning flag indicating whether kerning should be taken into account * \return the width of the string */ virtual double GetStringWidth(const wxString& s, const wxPdfEncoding* encoding = NULL, bool withKerning = false) const; /// Check whether the font oan show all characters of a given string /** * \param s the string to be checked * \param encoding the character to glyph mapping * \return TRUE if the font can show all characters of the string, FALSE otherwise */ virtual bool CanShow(const wxString& s, const wxPdfEncoding* encoding = NULL) const; /// Convert character codes to glyph numbers /** * \param s the string to be converted * \param encoding the character to glyph mapping * \param usedGlyphs the list of used glyphs * \param subsetGlyphs the mapping of glyphs to subset glyphs * \return the converted string */ virtual wxString ConvertCID2GID(const wxString& s, const wxPdfEncoding* encoding = NULL, wxPdfSortedArrayInt* usedGlyphs = NULL, wxPdfChar2GlyphMap* subsetGlyphs = NULL) const; /// Convert glyph number to string /** * \param glyph the glyph to be converted * \param encoding the character to glyph mapping * \param usedGlyphs the list of used glyphs * \param subsetGlyphs the mapping of glyphs to subset glyphs * \return the converted string */ virtual wxString ConvertGlyph(wxUint32 glyph, const wxPdfEncoding* encoding = NULL, wxPdfSortedArrayInt* usedGlyphs = NULL, wxPdfChar2GlyphMap* subsetGlyphs = NULL) const; /// Get the character width array as string /** * \param subset flag whether subsetting is enabled * \param usedGlyphs the list of used glyphs * \param subsetGlyphs the mapping of glyphs to subset glyphs * \return the string representation of the character widths */ virtual wxString GetWidthsAsString(bool subset, wxPdfSortedArrayInt* usedGlyphs = NULL, wxPdfChar2GlyphMap* subsetGlyphs = NULL) const; /// Load the font metrics XML file /** * \param root the root node of the XML font metric file * \return TRUE if the metric file could be processed successfully, FALSE otherwise */ virtual bool LoadFontMetrics(wxXmlNode* root); /// Write font data /** * \param fontData the output stream * \param usedGlyphs the list of used glyphs * \param subsetGlyphs the mapping of glyphs to subset glyphs * \return the size of the written font data */ virtual size_t WriteFontData(wxOutputStream* fontData, wxPdfSortedArrayInt* usedGlyphs = NULL, wxPdfChar2GlyphMap* subsetGlyphs = NULL); /// Write character/glyph to unicode mapping /** * \param mapData the output stream * \param encoding the character to glyph mapping * \param usedGlyphs the list of used glyphs * \param subsetGlyphs the mapping of glyphs to subset glyphs * \return the size of the written data */ virtual size_t WriteUnicodeMap(wxOutputStream* mapData, const wxPdfEncoding* encoding = NULL, wxPdfSortedArrayInt* usedGlyphs = NULL, wxPdfChar2GlyphMap* subsetGlyphs = NULL); /// Get the associated encoding converter /** * \return the encoding converter associated with this font */ virtual wxMBConv* GetEncodingConv() const { return m_conv; } /// Create the associated default encoding converter virtual void CreateDefaultEncodingConv(); /// Set the offset of the CFF section /** * \param cffOffset the offset of the CFF section */ void SetCffOffset(size_t cffOffset) { m_cffOffset = cffOffset; } /// Set the lenght of the CFF section /** * \param cffLength the offset of the CFF section */ void SetCffLength(size_t cffLength) { m_cffLength = cffLength; } /// Set glyph widths array /** * \param glyphWidths array with glyph widths */ virtual void SetGlyphWidths(const wxPdfArrayUint16& glyphWidths); protected: wxPdfArrayUint16* m_gw; ///< Array of glyph widths wxMBConv* m_conv; ///< Associated encoding converter }; #endif // wxUSE_UNICODE #endif
// Copyright 2012 Viewfinder. All rights reserved. // Author: Peter Mattis. #ifndef VIEWFINDER_IMAGE_INDEX_H #define VIEWFINDER_IMAGE_INDEX_H #import <map> #import <set> #import "DB.h" #import "ImageFingerprint.pb.h" #import "StringUtils.h" #import "Utils.h" class ImageIndex { public: ImageIndex(bool histogram = false); ~ImageIndex(); // Adds the specified fingerprint and id to the index. void Add(const ImageFingerprint& fingerprint, const string& id, const DBHandle& updates); // Removes the specified fingerprint and id from the index. void Remove(const ImageFingerprint& fingerprint, const string& id, const DBHandle& updates); // Search the index for the specified fingerprint, returning the ids of any // matching fingerprints. int Search(const DBHandle& db, const ImageFingerprint& fingerprint, StringSet* matched_ids) const; // Returns a "pretty" histogram of the bits that were set in indexed // fingerprints. Note that this histogram is not persistent and is only // mainted if "true" was passed to the histogram parameter of the // constructor. string PrettyHistogram() const; // Return the total/unique indexed tags. These functions are slow. int TotalTags(const DBHandle& db) const; int UniqueTags(const DBHandle& db) const; static ImageFingerprint Intersect( const ImageFingerprint& a, const ImageFingerprint& b); static int HammingDistance( const ImageFingerprint& a, const ImageFingerprint& b); private: ScopedPtr<vector<int> > histogram_; int histogram_count_; }; ostream& operator<<(ostream& os, const ImageFingerprint& f); #endif // VIEWFINDER_IMAGE_INDEX_H
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CONNECTION_BLUEZ_H_ #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CONNECTION_BLUEZ_H_ #include <string> #include "base/callback.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "dbus/object_path.h" #include "device/bluetooth/bluetooth_gatt_connection.h" #include "device/bluetooth/dbus/bluetooth_device_client.h" namespace device { class BluetoothAdapter; } // namespace device namespace bluez { // BluetoothGattConnectionBlueZ implements BluetoothGattConnection for // platforms that use BlueZ. class BluetoothGattConnectionBlueZ : public device::BluetoothGattConnection, public bluez::BluetoothDeviceClient::Observer { public: explicit BluetoothGattConnectionBlueZ( scoped_refptr<device::BluetoothAdapter> adapter, const std::string& device_address, const dbus::ObjectPath& object_path); ~BluetoothGattConnectionBlueZ() override; // BluetoothGattConnection overrides. bool IsConnected() override; void Disconnect() override; private: // bluez::Bluetooth$1Client::Observer overrides. void DeviceRemoved(const dbus::ObjectPath& object_path) override; void DevicePropertyChanged(const dbus::ObjectPath& object_path, const std::string& property_name) override; // True, if the connection is currently active. bool connected_; // D-Bus object path of the underlying device. This is used to filter observer // events. dbus::ObjectPath object_path_; DISALLOW_COPY_AND_ASSIGN(BluetoothGattConnectionBlueZ); }; } // namespace bluez #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CONNECTION_BLUEZ_H_
/* * Copyright (c) 2013, Andreas Sandberg * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _FPBITS_H #define _FPBITS_H #include <stdint.h> #define FP80_FRAC_BITS 63 #define FP80_INT_BIT 0x8000000000000000ULL #define FP80_QNAN_BIT 0x4000000000000000ULL #define FP80_FRAC_MASK 0x7fffffffffffffffULL #define FP80_EXP_MASK 0x7fff #define FP80_SIGN_BIT 0x8000 #define FP80_EXP_BIAS 0x3fff #define FP80_EXP_SPECIAL 0x7fff #define FP80_FRAC_SNAN 0x3fffffffffffffffULL #define FP80_FRAC_QNAN 0x7fffffffffffffffULL #define FP80_FRAC_QNANI 0x4000000000000000ULL #define FP64_EXP_SHIFT 52 #define FP64_FRAC_BITS 52 #define FP64_SIGN_BIT 0x8000000000000000ULL #define FP64_EXP_MASK 0x7ff0000000000000ULL #define FP64_FRAC_MASK 0x000fffffffffffffULL #define FP64_EXP_BIAS 0x3ff #define FP64_EXP_SPECIAL 0x7ff #define FP64_FRAC_SNAN 0x0007ffffffffffffULL #define FP64_FRAC_QNAN 0x000fffffffffffffULL #define FP64_FRAC_QNANI 0x0008000000000000ULL #define BUILD_IFP64(sign, frac, exp) \ ((sign) ? FP64_SIGN_BIT : 0) | \ (((uint64_t)(exp) << FP64_EXP_SHIFT) & FP64_EXP_MASK) | \ ((frac) & FP64_FRAC_MASK) #define BUILD_FP64(sign, frac, exp) \ { .bits = BUILD_IFP64(sign, frac, exp) } static inline fp64_t build_fp64(int sign, uint64_t frac, int exp) { const fp64_t f = BUILD_FP64(sign, frac, exp); return f; } #define BUILD_FP80_SE(sign, exp) \ ((sign) ? FP80_SIGN_BIT : 0) | \ ((exp) & FP80_EXP_MASK) #define BUILD_FP80_FI(frac, exp) \ ((exp) ? FP80_INT_BIT : 0) | \ ((frac) & FP80_FRAC_MASK) #define BUILD_FP80(sign, frac, exp) \ { \ .repr.pad = { 0 }, \ .repr.se = BUILD_FP80_SE(sign, exp), \ .repr.fi = BUILD_FP80_FI(frac, exp) \ } static inline fp80_t build_fp80(int sign, uint64_t frac, int exp) { const fp80_t f = BUILD_FP80(sign, frac, exp); return f; } #define FP80_FRAC(fp80) \ (fp80.repr.fi & FP80_FRAC_MASK) #define FP80_EXP(fp80) \ (fp80.repr.se & FP80_EXP_MASK) #define FP64_FRAC(fp64) \ (fp64.bits & FP64_FRAC_MASK) #define FP64_EXP(fp80) \ ((fp64.bits & FP64_EXP_MASK) >> FP64_EXP_SHIFT) #endif
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_TCP_DEVICE_PROVIDER_H_ #define CHROME_BROWSER_DEVTOOLS_DEVICE_TCP_DEVICE_PROVIDER_H_ #include <set> #include "chrome/browser/devtools/device/android_device_manager.h" #include "net/base/host_port_pair.h" // Instantiate this class only in a test and/or when DEBUG_DEVTOOLS is defined. class TCPDeviceProvider : public AndroidDeviceManager::DeviceProvider { public: static scoped_refptr<TCPDeviceProvider> CreateForLocalhost(uint16_t port); using HostPortSet = std::set<net::HostPortPair>; explicit TCPDeviceProvider(const HostPortSet& targets); void QueryDevices(const SerialsCallback& callback) override; void QueryDeviceInfo(const std::string& serial, const DeviceInfoCallback& callback) override; void OpenSocket(const std::string& serial, const std::string& socket_name, const SocketCallback& callback) override; void ReleaseDevice(const std::string& serial) override; void set_release_callback_for_test(const base::Closure& callback); private: ~TCPDeviceProvider() override; HostPortSet targets_; base::Closure release_callback_; }; #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_TCP_DEVICE_PROVIDER_H_
// Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #import <Cocoa/Cocoa.h> /** * Creates framebuffers and their backing textures. */ @interface FlutterFrameBufferProvider : NSObject - (nullable instancetype)initWithOpenGLContext:(nonnull const NSOpenGLContext*)openGLContext; /** * Returns the id of the framebuffer. */ - (uint32_t)glFrameBufferId; /** * Returns the id of the backing texture.. */ - (uint32_t)glTextureId; @end
/* $NoKeywords:$ */ /** * @file * * Create outline and references for HyperTransport Component mainpage documentation. * * Design guides, maintenance guides, and general documentation, are * collected using this file onto the documentation mainpage. * This file contains doxygen comment blocks, only. * * @xrefitem bom "File Content Label" "Release Content" * @e project: AGESA * @e sub-project: Documentation * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 02:16:51 -0700 (Wed, 22 Dec 2010) $ * */ /* ****************************************************************************** * * Copyright (C) 2012 Advanced Micro Devices, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Advanced Micro Devices, Inc. nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /** * @page htmain HyperTransport Component Documentation * * Additional documentation for the HyperTransport component consists of * * - Member Cross References * - @subpage instanceshtnb "HT Northbridge Method Instances" * - Maintenance Guides: * - @subpage htimplintf "HT Internal Interface Implementation Guide" * - @subpage htimplfeat "HT Feature Implementation Guide" * - @subpage htimplnb "HT Northbridge Implementation Guide" * - add here >>> * - Design Guides: * - @subpage htgraphdesign "Graph Support Design" * - @subpage physicalsockethowto "How to Create a Physical System Socket Map" * - add here >>> * */
/* * vhua.c * * Copyright (C) 2011-15 - ntop.org * * nDPI is free software: you can vhuatribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * nDPI is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with nDPI. If not, see <http://www.gnu.org/licenses/>. * */ #include "ndpi_api.h" /* http://www.vhua.com Skype-like Chinese phone protocol */ #ifdef NDPI_PROTOCOL_VHUA static void ndpi_int_vhua_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_VHUA, NDPI_PROTOCOL_UNKNOWN); NDPI_LOG(NDPI_PROTOCOL_VHUA, ndpi_struct, NDPI_LOG_TRACE, "VHUA Found.\n"); } static void ndpi_check_vhua(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; u_int32_t payload_len = packet->payload_packet_len; u_char p0[] = { 0x05, 0x14, 0x3a, 0x05, 0x08, 0xf8, 0xa1, 0xb1, 0x03 }; if(payload_len == 0) return; /* Shouldn't happen */ /* Break after 3 packets. */ if((flow->packet_counter > 3) || (packet->udp == NULL) || (packet->payload_packet_len < sizeof(p0))) { NDPI_LOG(NDPI_PROTOCOL_VHUA, ndpi_struct, NDPI_LOG_TRACE, "Exclude VHUA.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_VHUA); } else if(memcmp(packet->payload, p0, sizeof(p0)) == 0) { ndpi_int_vhua_add_connection(ndpi_struct, flow); } } void ndpi_search_vhua(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; NDPI_LOG(NDPI_PROTOCOL_VHUA, ndpi_struct, NDPI_LOG_TRACE, "VHUA detection...\n"); /* skip marked packets */ if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_VHUA) { ndpi_check_vhua(ndpi_struct, flow); } } void init_vhua_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) { ndpi_set_bitmask_protocol_detection("VHUA", ndpi_struct, detection_bitmask, *id, NDPI_PROTOCOL_VHUA, ndpi_search_vhua, NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK); *id += 1; } #endif
/* * Generated by class-dump 3.1.1. * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2006 by Steve Nygard. */ #import <BackRow/BRVideo.h> @interface BRVideo (MovieCreation) - (BOOL)_createMovieWithAttributes:(id)fp8 error:(id *)fp12; - (void)_updateContextSizeHint; - (BOOL)_updateTrackInfoWithError:(id *)fp8; @end
#ifndef _CPUID_H_ #define _CPUID_H_ #include "hw.h" bool scan_cpuid(hwNode & n); #endif
#include "apue.h" #include <netdb.h> #include <errno.h> #include <syslog.h> #include <sys/socket.h> #define BUFLEN 128 #define QLEN 10 #ifndef HOST_NAME_MAX #define HOST_NAME_MAX 256 #endif extern int initserver(int, const struct sockaddr *, socklen_t, int); void serve(int sockfd) { int clfd; FILE *fp; char buf[BUFLEN]; set_cloexec(sockfd); for (;;) { if ((clfd = accept(sockfd, NULL, NULL)) < 0) { syslog(LOG_ERR, "ruptimed: accept error: %s", strerror(errno)); exit(1); } set_cloexec(clfd); if ((fp = popen("/usr/bin/uptime", "r")) == NULL) { sprintf(buf, "error: %s\n", strerror(errno)); send(clfd, buf, strlen(buf), 0); } else { while (fgets(buf, BUFLEN, fp) != NULL) send(clfd, buf, strlen(buf), 0); pclose(fp); } close(clfd); } } int main(int argc, char *argv[]) { struct addrinfo *ailist, *aip; struct addrinfo hint; int sockfd, err, n; char *host; if (argc != 1) err_quit("usage: ruptimed"); if ((n = sysconf(_SC_HOST_NAME_MAX)) < 0) n = HOST_NAME_MAX; /* best guess */ if ((host = malloc(n)) == NULL) err_sys("malloc error"); if (gethostname(host, n) < 0) err_sys("gethostname error"); daemonize("ruptimed"); memset(&hint, 0, sizeof(hint)); hint.ai_flags = AI_CANONNAME; hint.ai_socktype = SOCK_STREAM; hint.ai_canonname = NULL; hint.ai_addr = NULL; hint.ai_next = NULL; if ((err = getaddrinfo(host, "ruptime", &hint, &ailist)) != 0) { syslog(LOG_ERR, "ruptimed: getaddrinfo error: %s", gai_strerror(err)); exit(1); } for (aip = ailist; aip != NULL; aip = aip->ai_next) { if ((sockfd = initserver(SOCK_STREAM, aip->ai_addr, aip->ai_addrlen, QLEN)) >= 0) { serve(sockfd); exit(0); } } exit(1); }
/* Copyright (C) 2007-2011 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free * Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * version 2 along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /** * \file * * \author Victor Julien <victor@inliniac.net> */ #ifndef __STREAM_TCP_UTIL_H__ #define __STREAM_TCP_UTIL_H__ #include "stream-tcp-private.h" void StreamTcpUTInit(TcpReassemblyThreadCtx **); void StreamTcpUTDeinit(TcpReassemblyThreadCtx *); void StreamTcpUTInitInline(void); void StreamTcpUTSetupSession(TcpSession *); void StreamTcpUTClearSession(TcpSession *); void StreamTcpUTSetupStream(TcpStream *, uint32_t isn); void StreamTcpUTClearStream(TcpStream *); int StreamTcpUTAddSegmentWithByte(ThreadVars *, TcpReassemblyThreadCtx *, TcpStream *, uint32_t, uint8_t, uint16_t); int StreamTcpUTAddSegmentWithPayload(ThreadVars *, TcpReassemblyThreadCtx *, TcpStream *, uint32_t, uint8_t *, uint16_t); void StreamTcpUtilRegisterTests(void); #endif /* __STREAM_TCP_UTIL_H__ */
/* Copyright (C) 2004-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger <davidm@hpl.hp.com>, 2004. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <link.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #define SET 0 #define ADD 1 #define REMOVE 2 #define leq(l,r) (((r) - (l)) <= ~0ULL / 2) static int callback (struct dl_phdr_info *info, size_t size, void *ptr) { static int last_adds = 0, last_subs = 0; intptr_t cmd = (intptr_t) ptr; printf (" size = %Zu\n", size); if (size < (offsetof (struct dl_phdr_info, dlpi_subs) + sizeof (info->dlpi_subs))) { fprintf (stderr, "dl_iterate_phdr failed to pass dlpi_adds/dlpi_subs\n"); exit (5); } printf (" dlpi_adds = %Lu dlpi_subs = %Lu\n", info->dlpi_adds, info->dlpi_subs); switch (cmd) { case SET: break; case ADD: if (leq (info->dlpi_adds, last_adds)) { fprintf (stderr, "dlpi_adds failed to get incremented!\n"); exit (3); } break; case REMOVE: if (leq (info->dlpi_subs, last_subs)) { fprintf (stderr, "dlpi_subs failed to get incremented!\n"); exit (4); } break; } last_adds = info->dlpi_adds; last_subs = info->dlpi_subs; return -1; } static void * load (const char *path) { void *handle; printf ("loading `%s'\n", path); handle = dlopen (path, RTLD_LAZY); if (!handle) exit (1); dl_iterate_phdr (callback, (void *)(intptr_t) ADD); return handle; } static void unload (const char *path, void *handle) { printf ("unloading `%s'\n", path); if (dlclose (handle) < 0) exit (2); dl_iterate_phdr (callback, (void *)(intptr_t) REMOVE); } int main (int argc, char **argv) { void *handle1, *handle2; dl_iterate_phdr (callback, (void *)(intptr_t) SET); handle1 = load ("firstobj.so"); handle2 = load ("globalmod1.so"); unload ("firstobj.so", handle1); unload ("globalmod1.so", handle2); return 0; }
/* This file is part of Clementine. Copyright 2012, David Sansome <me@davidsansome.com> Clementine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Clementine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Clementine. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SONGKICKCONCERTS_H #define SONGKICKCONCERTS_H #include "songinfoprovider.h" #include "core/network.h" #include "core/override.h" #include "internet/core/geolocator.h" class QNetworkReply; class SongInfoTextView; class SongkickConcerts : public SongInfoProvider { Q_OBJECT public: SongkickConcerts(); void FetchInfo(int id, const Song& metadata) OVERRIDE; private slots: void ArtistSearchFinished(QNetworkReply* reply, int id); void CalendarRequestFinished(QNetworkReply* reply, int id); void GeolocateFinished(Geolocator::LatLng latlng); private: void FetchSongkickCalendar(const QString& artist_id, int id); NetworkAccessManager network_; Geolocator::LatLng latlng_; static const char* kSongkickArtistBucket; static const char* kSongkickArtistCalendarUrl; }; #endif
/* File: CoreGraphics.h Contains: CoreGraphics master header Version: QuickTime 7.1 Copyright: © 2006 © 2000-2001 by Apple Computer, Inc., all rights reserved. Bugs?: For bug reports, consult the following page on the World Wide Web: http://developer.apple.com/bugreporter/ */ #ifndef __COREGRAPHICS__ #define __COREGRAPHICS__ #ifndef __COREFOUNDATION__ #include <CoreFoundation.h> #endif #ifndef __CGBASE__ #include <CGBase.h> #endif #ifndef __CGAFFINETRANSFORM__ #include <CGAffineTransform.h> #endif #ifndef __CGBITMAPCONTEXT__ #include <CGBitmapContext.h> #endif #ifndef __CGCOLORSPACE__ #include <CGColorSpace.h> #endif #ifndef __CGFONT__ #include <CGFont.h> #endif #ifndef __CGCONTEXT__ #include <CGContext.h> #endif #ifndef __CGPATTERN__ #include <CGPattern.h> #endif #ifndef __CGDATACONSUMER__ #include <CGDataConsumer.h> #endif #ifndef __CGDATAPROVIDER__ #include <CGDataProvider.h> #endif #ifndef __CGERROR__ #include <CGError.h> #endif #ifndef __CGDIRECTDISPLAY__ #include <CGDirectDisplay.h> #endif #ifndef __CGDIRECTPALETTE__ #include <CGDirectPalette.h> #endif #ifndef __CGREMOTEOPERATION__ #include <CGRemoteOperation.h> #endif #ifndef __CGWINDOWLEVEL__ #include <CGWindowLevel.h> #endif #ifndef __CGGEOMETRY__ #include <CGGeometry.h> #endif #ifndef __CGIMAGE__ #include <CGImage.h> #endif #ifndef __CGPDFCONTEXT__ #include <CGPDFContext.h> #endif #ifndef __CGPDFDOCUMENT__ #include <CGPDFDocument.h> #endif #endif /* __COREGRAPHICS__ */
/* mpq_set(dest,src) -- Set DEST to SRC. Copyright 1991, 1994, 1995, 2001, 2012, 2015 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. or * the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. or both in parallel, as here. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with the GNU MP Library. If not, see https://www.gnu.org/licenses/. */ #include "gmp-impl.h" void mpq_set (mpq_ptr dest, mpq_srcptr src) { mp_size_t num_size, den_size; mp_size_t abs_num_size; mp_ptr dp; num_size = SIZ(NUM(src)); SIZ(NUM(dest)) = num_size; abs_num_size = ABS (num_size); dp = MPZ_NEWALLOC (NUM(dest), abs_num_size); MPN_COPY (dp, PTR(NUM(src)), abs_num_size); den_size = SIZ(DEN(src)); SIZ(DEN(dest)) = den_size; dp = MPZ_NEWALLOC (DEN(dest), den_size); MPN_COPY (dp, PTR(DEN(src)), den_size); }
/* * Time.h * * Created on: May 7, 2013 * Author: mbenoit */ #ifndef TIMEPIXDEVICE_H_ #define TIMEPIXDEVICE_H_ #include <iostream> #include <fstream> #include <cstring> // Needed for memset #include <sys/socket.h> // Needed for the socket functions #include <netdb.h> // Needed for the socket functions #include <time.h> #include <signal.h> #include <sys/time.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <pthread.h> /* POSIX Threads */ #include "mpxmanagerapi.h" #include "mpxhw.h" using namespace std ; void AcquisitionPreStarted(CBPARAM /*par*/,INTPTR /*aptr*/); void AcquisitionStarted(CBPARAM /*par*/,INTPTR /*aptr*/); void AcquisitionFinished(int /*stuff*/,int /*stuff2*/); void FrameIsReady(int /*stuff*/,int /*stuff2*/); class TimepixDevice { public: TimepixDevice(); void Configure(const std::string & binary_config, const std::string & ascii_config); int ReadFrame(char * Filename, char* buffer); int SetTHL(int THL); int SetIkrum(int IKrum); int ReadDACs(); int PerformAcquisition(char *output); int GetFrameData(byte *buffer); int GetFrameData2(char * Filename, char* buffer); int GetFrameDatadAscii(char * Filename, u32* buffer); u32 GetBufferSize(){return size;}; int Abort (); int SetAcqTime(double time); char* GetChipID(){return chipBoardID;}; private: int control; // Control int for verifying success of operation DEVID devId; // Timepix Device ID int count; // Number of chip connected to FitPix int numberOfChips; int numberOfRows; char chipBoardID[MPX_MAX_CHBID]; char ifaceName[MPX_MAX_IFACENAME]; double acqTime ; bool acqFinished; int hwInfoCount; int mode; DACTYPE dacVals[14]; int chipnumber; u32 size; FRAMEID FrameID; string ascii_config,binary_config; }; #endif /* MIMTLU_H_ */
//===--- DiagnosticsIRGen.h - Diagnostic Definitions ------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// // /// \file /// \brief This file defines diagnostics for IR generation. // //===----------------------------------------------------------------------===// #ifndef SWIFT_DIAGNOSTICSIRGEN_H #define SWIFT_DIAGNOSTICSIRGEN_H #include "swift/AST/DiagnosticsCommon.h" namespace swift { namespace diag { // Declare common diagnostics objects with their appropriate types. #define DIAG(KIND,ID,Options,Text,Signature) \ extern detail::DiagWithArguments<void Signature>::type ID; #include "DiagnosticsIRGen.def" } } #endif
/* * Copyright (c) 2006, Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * This file is part of the Contiki operating system. * * Author : Adam Dunkels */ #include "lcd.h" #include "hal_lcd.h" #define WITH_LCD 0 #define Y_MAX 9 #define X_MAX 15 static int xpos, ypos; #define X_CHAR_SIZE 8 #define Y_CHAR_SIZE 9 #define SCROLL_AREA LCD_MAX_SCROLL_AREA /*---------------------------------------------------------------------------*/ void lcd_init(void) { if(WITH_LCD) { halLcdInit(); halLcdActive(); halLcdBackLightInit(); halLcdSetBackLight(8); lcd_clear(); } } /*---------------------------------------------------------------------------*/ void lcd_clear(void) { if(WITH_LCD) { halLcdClearScreen(); xpos = ypos = 0; } } /*---------------------------------------------------------------------------*/ void lcd_set_pixel(int x, int y, int intensity) { if(WITH_LCD) { halLcdPixel(x, y, intensity); } } /*---------------------------------------------------------------------------*/ static void inc_y(void) { if(WITH_LCD) { ypos++; xpos = 0; } } /*---------------------------------------------------------------------------*/ void lcd_write_char(char c) { char string[2]; if(WITH_LCD) { if(c == '\n') { inc_y(); } else { string[0] = c; string[1] = 0; if(ypos == Y_MAX) { lcd_clear(); ypos = xpos = 0; } halLcdPrintXY(string, xpos * X_CHAR_SIZE, ypos * Y_CHAR_SIZE, 0); if(xpos == X_MAX) { inc_y(); } else { xpos++; } } } } /*---------------------------------------------------------------------------*/ void lcd_draw_line(int x0, int y0, int x1, int y1) { if(WITH_LCD) { halLcdLine(x0, y0, x1, y1, 3); } } /*---------------------------------------------------------------------------*/ void lcd_draw_vertical_line(int pixels) { if(WITH_LCD) { if(pixels > SCROLL_AREA) { pixels = SCROLL_AREA; } lcd_draw_line(LCD_MAX_X, LCD_MAX_Y - pixels, LCD_MAX_X, LCD_MAX_Y); } } /*---------------------------------------------------------------------------*/ void lcd_scroll_x(void) { if(WITH_LCD) { halLcdHScroll(LCD_MAX_Y - SCROLL_AREA, LCD_MAX_Y); halLcdLine(LCD_MAX_X, LCD_MAX_Y - SCROLL_AREA, LCD_MAX_X, LCD_MAX_Y, 0); } } /*---------------------------------------------------------------------------*/
/* Like vsprintf but provides a pointer to malloc'd storage, which must be freed by the caller. Copyright (C) 1994-2017 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Libiberty is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <ansidecl.h> #include <stdarg.h> #if !defined (va_copy) && defined (__va_copy) # define va_copy(d,s) __va_copy((d),(s)) #endif #include <stdio.h> #ifdef HAVE_STRING_H #include <string.h> #endif #ifdef HAVE_STDLIB_H #include <stdlib.h> #else extern PTR malloc (); #endif #include "libiberty.h" #include "vprintf-support.h" #ifdef TEST int global_total_width; #endif /* @deftypefn Extension int vasprintf (char **@var{resptr}, @ const char *@var{format}, va_list @var{args}) Like @code{vsprintf}, but instead of passing a pointer to a buffer, you pass a pointer to a pointer. This function will compute the size of the buffer needed, allocate memory with @code{malloc}, and store a pointer to the allocated memory in @code{*@var{resptr}}. The value returned is the same as @code{vsprintf} would return. If memory could not be allocated, minus one is returned and @code{NULL} is stored in @code{*@var{resptr}}. @end deftypefn */ static int int_vasprintf (char **, const char *, va_list); static int int_vasprintf (char **result, const char *format, va_list args) { int total_width = libiberty_vprintf_buffer_size (format, args); #ifdef TEST global_total_width = total_width; #endif *result = (char *) malloc (total_width); if (*result != NULL) return vsprintf (*result, format, args); else return -1; } int vasprintf (char **result, const char *format, #if defined (_BSD_VA_LIST_) && defined (__FreeBSD__) _BSD_VA_LIST_ args) #else va_list args) #endif { return int_vasprintf (result, format, args); } #ifdef TEST static void ATTRIBUTE_PRINTF_1 checkit (const char *format, ...) { char *result; va_list args; va_start (args, format); vasprintf (&result, format, args); va_end (args); if (strlen (result) < (size_t) global_total_width) printf ("PASS: "); else printf ("FAIL: "); printf ("%d %s\n", global_total_width, result); free (result); } extern int main (void); int main (void) { checkit ("%d", 0x12345678); checkit ("%200d", 5); checkit ("%.300d", 6); checkit ("%100.150d", 7); checkit ("%s", "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\ 777777777777777777333333333333366666666666622222222222777777777777733333"); checkit ("%f%s%d%s", 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx"); return 0; } #endif /* TEST */
/* Copyright (C) 1991, 1995-1998, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <stddef.h> #include <dirent.h> #include <sys/types.h> #include <unistd.h> #include <dirstream.h> /* Rewind DIRP to the beginning of the directory. */ /* XXX should be __rewinddir ? */ void rewinddir (dirp) DIR *dirp; { __libc_lock_lock (dirp->lock); (void) __lseek (dirp->fd, (off_t) 0, SEEK_SET); dirp->filepos = 0; dirp->offset = 0; dirp->size = 0; __libc_lock_unlock (dirp->lock); }
/* Types.h -- Basic types 2010-10-09 : Igor Pavlov : Public domain */ #ifndef __7Z_TYPES_H #define __7Z_TYPES_H #include <stddef.h> #ifdef _WIN32 #include <windows.h> #endif #include <zconf.h> #ifndef EXTERN_C_BEGIN #ifdef __cplusplus #define EXTERN_C_BEGIN extern "C" { #define EXTERN_C_END } #else #define EXTERN_C_BEGIN #define EXTERN_C_END #endif #endif EXTERN_C_BEGIN #include "fmap.h" #define SZ_OK 0 #define SZ_ERROR_DATA 1 #define SZ_ERROR_MEM 2 #define SZ_ERROR_CRC 3 #define SZ_ERROR_UNSUPPORTED 4 #define SZ_ERROR_PARAM 5 #define SZ_ERROR_INPUT_EOF 6 #define SZ_ERROR_OUTPUT_EOF 7 #define SZ_ERROR_READ 8 #define SZ_ERROR_WRITE 9 #define SZ_ERROR_PROGRESS 10 #define SZ_ERROR_FAIL 11 #define SZ_ERROR_THREAD 12 #define SZ_ERROR_ARCHIVE 16 #define SZ_ERROR_NO_ARCHIVE 17 /* ACAB */ #define SZ_ERROR_ENCRYPTED 18 typedef int SRes; #ifdef _WIN32 typedef DWORD WRes; #else typedef int WRes; #endif #ifndef RINOK #define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } #endif /* aCaB -- use Byte defined in zconf.h typedef unsigned char Byte; */ typedef short Int16; typedef unsigned short UInt16; #ifdef _LZMA_UINT32_IS_ULONG typedef long Int32; typedef unsigned long UInt32; #else typedef int Int32; typedef unsigned int UInt32; #endif #ifdef _SZ_NO_INT_64 /* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers. NOTES: Some code will work incorrectly in that case! */ typedef long Int64; typedef unsigned long UInt64; #else #if defined(_MSC_VER) || defined(__BORLANDC__) typedef __int64 Int64; typedef unsigned __int64 UInt64; #define UINT64_CONST(n) n #else typedef long long int Int64; typedef unsigned long long int UInt64; #define UINT64_CONST(n) n ## ULL #endif #endif #ifdef _LZMA_NO_SYSTEM_SIZE_T typedef UInt32 SizeT; #else typedef size_t SizeT; #endif typedef int Bool; #define True 1 #define False 0 #ifdef _WIN32 #define MY_STD_CALL __stdcall #else #define MY_STD_CALL #endif #ifdef _MSC_VER #if _MSC_VER >= 1300 #define MY_NO_INLINE __declspec(noinline) #else #define MY_NO_INLINE #endif #define MY_CDECL __cdecl #define MY_FAST_CALL __fastcall #else #define MY_CDECL #define MY_FAST_CALL #endif /* The following interfaces use first parameter as pointer to structure */ typedef struct { Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */ } IByteIn; typedef struct { void (*Write)(void *p, Byte b); } IByteOut; typedef struct { SRes (*Read)(void *p, void *buf, size_t *size); /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. (output(*size) < input(*size)) is allowed */ } ISeqInStream; /* it can return SZ_ERROR_INPUT_EOF */ SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size); SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType); SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf); typedef struct { size_t (*Write)(void *p, const void *buf, size_t size); /* Returns: result - the number of actually written bytes. (result < size) means error */ } ISeqOutStream; typedef enum { SZ_SEEK_SET = 0, SZ_SEEK_CUR = 1, SZ_SEEK_END = 2 } ESzSeek; typedef struct { SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */ SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); off_t curpos; } ISeekInStream; typedef struct { SRes (*Look)(void *p, const void **buf, size_t *size); /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. (output(*size) > input(*size)) is not allowed (output(*size) < input(*size)) is allowed */ SRes (*Skip)(void *p, size_t offset); /* offset must be <= output(*size) of Look */ SRes (*Read)(void *p, void *buf, size_t *size); /* reads directly (without buffer). It's same as ISeqInStream::Read */ SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); } ILookInStream; SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size); SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset); /* reads via ILookInStream::Read */ SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType); SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size); #define LookToRead_BUF_SIZE (1 << 14) typedef struct { ILookInStream s; ISeekInStream *realStream; size_t pos; size_t size; Byte buf[LookToRead_BUF_SIZE]; } CLookToRead; void LookToRead_CreateVTable(CLookToRead *p, int lookahead); void LookToRead_Init(CLookToRead *p); typedef struct { ISeqInStream s; ILookInStream *realStream; } CSecToLook; void SecToLook_CreateVTable(CSecToLook *p); typedef struct { ISeqInStream s; ILookInStream *realStream; } CSecToRead; void SecToRead_CreateVTable(CSecToRead *p); typedef struct { SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); /* Returns: result. (result != SZ_OK) means break. Value (UInt64)(Int64)-1 for size means unknown value. */ } ICompressProgress; typedef struct { void *(*Alloc)(void *p, size_t size); void (*Free)(void *p, void *address); /* address can be 0 */ } ISzAlloc; #define IAlloc_Alloc(p, size) (p)->Alloc((p), size) #define IAlloc_Free(p, a) (p)->Free((p), a) #ifdef _WIN32 #define CHAR_PATH_SEPARATOR '\\' #define WCHAR_PATH_SEPARATOR L'\\' #define STRING_PATH_SEPARATOR "\\" #define WSTRING_PATH_SEPARATOR L"\\" #else #define CHAR_PATH_SEPARATOR '/' #define WCHAR_PATH_SEPARATOR L'/' #define STRING_PATH_SEPARATOR "/" #define WSTRING_PATH_SEPARATOR L"/" #endif EXTERN_C_END #endif
/* Simple DirectMedia Layer Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef SDL_androidmouse_h_ #define SDL_androidmouse_h_ #include "SDL_androidvideo.h" extern void Android_InitMouse(void); extern void Android_OnMouse(SDL_Window *window, int button, int action, float x, float y, SDL_bool relative); extern void Android_QuitMouse(void); #endif /* SDL_androidmouse_h_ */ /* vi: set ts=4 sw=4 expandtab: */
/* mpz_congruent_p -- test congruence of two mpz's. Copyright 2001, 2002, 2005 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include "gmp.h" #include "gmp-impl.h" #include "longlong.h" /* For big divisors this code is only very slightly better than the user doing a combination of mpz_sub and mpz_tdiv_r, but it's quite convenient, and perhaps in the future can be improved, in similar ways to mpn_divisible_p perhaps. The csize==1 / dsize==1 special case makes mpz_congruent_p as good as mpz_congruent_ui_p on relevant operands, though such a combination probably doesn't occur often. Alternatives: If c<d then it'd work to just form a%d and compare a and c (either as a==c or a+c==d depending on the signs), but the saving from avoiding the abs(a-c) calculation would be small compared to the division. Similarly if both a<d and c<d then it would work to just compare a and c (a==c or a+c==d), but this isn't considered a particularly important case and so isn't done for the moment. Low zero limbs on d could be stripped and the corresponding limbs of a and c tested and skipped, but doing so would introduce a borrow when a and c differ in sign and have non-zero skipped limbs. It doesn't seem worth the complications to do this, since low zero limbs on d should occur only rarely. */ int mpz_congruent_p (mpz_srcptr a, mpz_srcptr c, mpz_srcptr d) { mp_size_t asize, csize, dsize, sign; mp_srcptr ap, cp, dp; mp_ptr xp; mp_limb_t alow, clow, dlow, dmask, r; int result; TMP_DECL; dsize = SIZ(d); if (UNLIKELY (dsize == 0)) return (mpz_cmp (a, c) == 0); dsize = ABS(dsize); dp = PTR(d); if (ABSIZ(a) < ABSIZ(c)) MPZ_SRCPTR_SWAP (a, c); asize = SIZ(a); csize = SIZ(c); sign = (asize ^ csize); asize = ABS(asize); ap = PTR(a); if (csize == 0) return mpn_divisible_p (ap, asize, dp, dsize); csize = ABS(csize); cp = PTR(c); alow = ap[0]; clow = cp[0]; dlow = dp[0]; /* Check a==c mod low zero bits of dlow. This might catch a few cases of a!=c quickly, and it helps the csize==1 special cases below. */ dmask = LOW_ZEROS_MASK (dlow) & GMP_NUMB_MASK; alow = (sign >= 0 ? alow : -alow); if (((alow-clow) & dmask) != 0) return 0; if (csize == 1) { if (dsize == 1) { cong_1: if (sign < 0) NEG_MOD (clow, clow, dlow); if (BELOW_THRESHOLD (asize, MODEXACT_1_ODD_THRESHOLD)) { r = mpn_mod_1 (ap, asize, dlow); if (clow < dlow) return r == clow; else return r == (clow % dlow); } if ((dlow & 1) == 0) { /* Strip low zero bits to get odd d required by modexact. If d==e*2^n then a==c mod d if and only if both a==c mod e and a==c mod 2^n, the latter having been done above. */ unsigned twos; count_trailing_zeros (twos, dlow); dlow >>= twos; } r = mpn_modexact_1c_odd (ap, asize, dlow, clow); return r == 0 || r == dlow; } /* dlow==0 is avoided since we don't want to bother handling extra low zero bits if dsecond is even (would involve borrow if a,c differ in sign and alow,clow!=0). */ if (dsize == 2 && dlow != 0) { mp_limb_t dsecond = dp[1]; if (dsecond <= dmask) { unsigned twos; count_trailing_zeros (twos, dlow); dlow = (dlow >> twos) | (dsecond << (GMP_NUMB_BITS-twos)); ASSERT_LIMB (dlow); /* dlow will be odd here, so the test for it even under cong_1 is unnecessary, but the rest of that code is wanted. */ goto cong_1; } } } TMP_MARK; xp = TMP_ALLOC_LIMBS (asize+1); /* calculate abs(a-c) */ if (sign >= 0) { /* same signs, subtract */ if (asize > csize || mpn_cmp (ap, cp, asize) >= 0) ASSERT_NOCARRY (mpn_sub (xp, ap, asize, cp, csize)); else ASSERT_NOCARRY (mpn_sub_n (xp, cp, ap, asize)); MPN_NORMALIZE (xp, asize); } else { /* different signs, add */ mp_limb_t carry; carry = mpn_add (xp, ap, asize, cp, csize); xp[asize] = carry; asize += (carry != 0); } result = mpn_divisible_p (xp, asize, dp, dsize); TMP_FREE; return result; }
/* * board_init.c - Implementation of functions to init board. * Copyright (C) 2013 Milan Babel <babel@inf.fu-berlin.de> * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ #include "cpu.h" #include "irq.h" #include "board.h" #include "kernel_internal.h" #include "msp430.h" #include "debug.h" #include "msp430_stdio.h" volatile static uint32_t __msp430_cpu_speed = MSP430_INITIAL_CPU_SPEED; void msp430_init_dco(void); typedef enum { MCLK_2MHZ_SCLK_1MHZ = 1000002uL, MCLK_4MHZ_SCLK_1MHZ = 1000004uL, MCLK_8MHZ_SCLK_1MHZ = 1000008uL, MCLK_8MHZ_SCLK_8MHZ = 8000000uL }speed_t; static void msb_ports_init(void) { // Port 1: GDO, Flash, BSL TX P1SEL = 0x02; // Port1 Select: 00000010 = 0x02 P1OUT = 0x00; // Port1 Output: 00000000 = 0x00 P1DIR = 0x87; // Port1 Direction: 10000111 = 0x87 // Port 2: GPIO, BSL RX, 1wire P2SEL = 0x04; // Port2 Select: 00000100 = 0x04 P2OUT = 0x00; // Port2 Output: 00000000 = 0x00 P2DIR = 0xFF; // Port2 Direction: 11111111 = 0xFF // Port 3: UART P3SEL = 0xFE; // Port3 Select: 11111110 = 0xFE P3OUT = 0x00; // Port3 Output: 00000000 = 0x00 P3DIR = 0xFF; // Port3 Direction: 11111111 = 0xFF // Port 4: CS P4SEL = 0x00; // Port4 Select: 00000000 = 0x00 P4OUT = 0x14; // Port4 Output: 00010100 = 0x14 P4DIR = 0xFF; // Port4 Direction: 11111111 = 0xFF // Port 5: SPI, LED P5SEL = 0x0E; // Port5 Select: 00001110 = 0x0E P5OUT = 0x70; // Port5 Output: 01110000 = 0x70 P5DIR = 0x70; // Port5 Direction: 01110000 = 0x70 P6SEL = 0xFF; // Port6 Select: 11111111 = 0xFF P6OUT = 0x00; // Port6 Output: 00000000 = 0x00 P6DIR = 0xFF; // Port6 Direction: 11111000 = 0xF8 } void msp430_set_cpu_speed(uint32_t speed) { disableIRQ(); __msp430_cpu_speed = speed; msp430_init_dco(); enableIRQ(); } /*---------------------------------------------------------------------------*/ void msp430_init_dco(void) { /*----------------------- use external oszillator -------------------------*/ uint16_t i; // Stop watchdog WDTCTL = WDTPW + WDTHOLD; BCSCTL1 = RSEL2; // Wait for xtal to stabilize do { IFG1 &= ~OFIFG; // Clear oscillator fault flag for (i = 0xFF; i > 0; i--); // Time for flag to set } while ((IFG1 & OFIFG) != 0); // Oscillator fault flag still set? switch (__msp430_cpu_speed) { case MCLK_2MHZ_SCLK_1MHZ: BCSCTL2 = (SELM_2 | DIVM_2) | (SELS | DIVS_3); break; case MCLK_4MHZ_SCLK_1MHZ: BCSCTL2 = (SELM_2 | DIVM_1) | (SELS | DIVS_3); break; case MCLK_8MHZ_SCLK_1MHZ: BCSCTL2 = SELM_2 | (SELS | DIVS_3); break; default: BCSCTL2 = SELM_2 + SELS; // MCLK and SMCLK = XT2 (safe) break; } } void board_init(void) { msp430_cpu_init(); msb_ports_init(); LED_RED_ON; msp430_set_cpu_speed(MCLK_8MHZ_SCLK_8MHZ); /* initialize the STDIO */ msp430_stdio_init(); }
/********************************************************************************** * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * * Package: TMVA * * Class : OptimizeConfigParameters * * Web : http://tmva.sourceforge.net * * * * Description: The OptimizeConfigParameters takes care of "scanning/fitting" * * different tuning parameters in order to find the best set of * * tuning paraemters which will be used in the end * * * * Authors (alphabetical): * * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany * * * * Copyright (c) 2005: * * CERN, Switzerland * * MPI-K Heidelberg, Germany * * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted according to the terms listed in LICENSE * * (http://ttmva.sourceforge.net/LICENSE) * **********************************************************************************/ #ifndef ROOT_TMVA_OptimizeConfigParameters #define ROOT_TMVA_OptimizeConfigParameters #include "Rtypes.h" #include "TString.h" #include "TMVA/MethodBase.h" #include "TMVA/Interval.h" #include "TMVA/DataSet.h" #include "IFitterTarget.h" #include "TH1.h" #include <map> #include <vector> class TestOptimizeConfigParameters; namespace TMVA { class MethodBase; class MsgLogger; class OptimizeConfigParameters : public IFitterTarget { public: friend TestOptimizeConfigParameters; //default constructor OptimizeConfigParameters(MethodBase * const method, std::map<TString,TMVA::Interval*> tuneParameters, TString fomType="Separation", TString optimizationType = "GA"); // destructor virtual ~OptimizeConfigParameters(); // could later be changed to be set via option string... // but for now it's simpler like this std::map<TString,Double_t> optimize(); private: std::vector< int > GetScanIndices( int val, std::vector<int> base); void optimizeScan(); void optimizeFit(); Double_t EstimatorFunction( std::vector<Double_t> & ); Double_t GetFOM(); MethodBase* GetMethod(){return fMethod;} void GetMVADists(); Double_t GetSeparation(); Double_t GetROCIntegral(); Double_t GetSigEffAtBkgEff( Double_t bkgEff = 0.1); Double_t GetBkgEffAtSigEff( Double_t sigEff = 0.5); Double_t GetBkgRejAtSigEff( Double_t sigEff = 0.5); MethodBase* const fMethod; // The MVA method to be evaluated std::vector<Float_t> fFOMvsIter; // graph showing the development of the Figure Of Merit values during the fit std::map<TString,TMVA::Interval*> fTuneParameters; // parameters included in the tuning std::map<TString,Double_t> fTunedParameters; // parameters included in the tuning std::map< std::vector<Double_t> , Double_t> fAlreadyTrainedParCombination; // save parameters for which the FOM is already known (GA seems to evaluate the same parameters several times) TString fFOMType; // the FOM type (Separation, ROC integra.. whatever you implemented.. TString fOptimizationFitType; // which type of optimisation procedure to be used TH1D *fMvaSig; // MVA distribution for signal events, used for spline fit TH1D *fMvaBkg; // MVA distribution for bakgr. events, used for spline fit TH1D *fMvaSigFineBin; // MVA distribution for signal events TH1D *fMvaBkgFineBin; // MVA distribution for bakgr. events Bool_t fNotDoneYet; // flat to indicate of Method Transformations have been obtained yet or not (normally done in MethodBase::TrainMethod) mutable MsgLogger* fLogger; // message logger MsgLogger& Log() const { return *fLogger; } ClassDef(OptimizeConfigParameters,0); // Interface to different separation criteria used in training algorithms }; } // namespace TMVA #endif
#ifndef _ROS_std_msgs_UInt64_h #define _ROS_std_msgs_UInt64_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" namespace std_msgs { class UInt64 : public ros::Msg { public: typedef uint64_t _data_type; _data_type data; UInt64(): data(0) { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; union { uint64_t real; uint32_t base; } u_data; u_data.real = this->data; *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; offset += sizeof(this->data); return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; union { uint64_t real; uint32_t base; } u_data; u_data.base = 0; u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); this->data = u_data.real; offset += sizeof(this->data); return offset; } const char * getType(){ return "std_msgs/UInt64"; }; const char * getMD5(){ return "1b2a79973e8bf53d7b53acb71299cb57"; }; }; } #endif
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_COMMON_GPU_MEDIA_ACCELERATED_VIDEO_DECODER_H_ #define CONTENT_COMMON_GPU_MEDIA_ACCELERATED_VIDEO_DECODER_H_ #include "base/macros.h" #include "content/common/content_export.h" #include "ui/gfx/geometry/size.h" namespace content { // An AcceleratedVideoDecoder is a video decoder that requires support from an // external accelerator (typically a hardware accelerator) to partially offload // the decode process after parsing stream headers, and performing reference // frame and state management. class CONTENT_EXPORT AcceleratedVideoDecoder { public: AcceleratedVideoDecoder() {} virtual ~AcceleratedVideoDecoder() {} virtual void SetStream(const uint8_t* ptr, size_t size) = 0; // Have the decoder flush its state and trigger output of all previously // decoded surfaces. Return false on failure. virtual bool Flush() WARN_UNUSED_RESULT = 0; // Stop (pause) decoding, discarding all remaining inputs and outputs, // but do not flush decoder state, so that playback can be resumed later, // possibly from a different location. // To be called during decoding. virtual void Reset() = 0; enum DecodeResult { kDecodeError, // Error while decoding. // TODO(posciak): unsupported streams are currently treated as error // in decoding; in future it could perhaps be possible to fall back // to software decoding instead. // kStreamError, // Error in stream. kAllocateNewSurfaces, // Need a new set of surfaces to be allocated. kRanOutOfStreamData, // Need more stream data to proceed. kRanOutOfSurfaces, // Waiting for the client to free up output surfaces. }; // Try to decode more of the stream, returning decoded frames asynchronously. // Return when more stream is needed, when we run out of free surfaces, when // we need a new set of them, or when an error occurs. virtual DecodeResult Decode() WARN_UNUSED_RESULT = 0; // Return dimensions/required number of output surfaces that client should // be ready to provide for the decoder to function properly. // To be used after Decode() returns kNeedNewSurfaces. virtual gfx::Size GetPicSize() const = 0; virtual size_t GetRequiredNumOfPictures() const = 0; private: DISALLOW_COPY_AND_ASSIGN(AcceleratedVideoDecoder); }; } // namespace content #endif // CONTENT_COMMON_GPU_MEDIA_ACCELERATED_VIDEO_DECODER_H_
#ifndef _ROS_std_msgs_Int16MultiArray_h #define _ROS_std_msgs_Int16MultiArray_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "std_msgs/MultiArrayLayout.h" namespace std_msgs { class Int16MultiArray : public ros::Msg { public: typedef std_msgs::MultiArrayLayout _layout_type; _layout_type layout; uint32_t data_length; typedef int16_t _data_type; _data_type st_data; _data_type * data; Int16MultiArray(): layout(), data_length(0), data(NULL) { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; offset += this->layout.serialize(outbuffer + offset); *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; offset += sizeof(this->data_length); for( uint32_t i = 0; i < data_length; i++){ union { int16_t real; uint16_t base; } u_datai; u_datai.real = this->data[i]; *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; offset += sizeof(this->data[i]); } return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; offset += this->layout.deserialize(inbuffer + offset); uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); offset += sizeof(this->data_length); if(data_lengthT > data_length) this->data = (int16_t*)realloc(this->data, data_lengthT * sizeof(int16_t)); data_length = data_lengthT; for( uint32_t i = 0; i < data_length; i++){ union { int16_t real; uint16_t base; } u_st_data; u_st_data.base = 0; u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); this->st_data = u_st_data.real; offset += sizeof(this->st_data); memcpy( &(this->data[i]), &(this->st_data), sizeof(int16_t)); } return offset; } const char * getType(){ return "std_msgs/Int16MultiArray"; }; const char * getMD5(){ return "d9338d7f523fcb692fae9d0a0e9f067c"; }; }; } #endif
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PERF_UTIL_TRACE_EVENT_H #define _PERF_UTIL_TRACE_EVENT_H #include <traceevent/event-parse.h> #include <traceevent/trace-seq.h> #include "parse-events.h" struct machine; struct perf_sample; union perf_event; struct perf_tool; struct thread; struct tep_plugin_list; struct trace_event { struct tep_handle *pevent; struct tep_plugin_list *plugin_list; }; int trace_event__init(struct trace_event *t); void trace_event__cleanup(struct trace_event *t); int trace_event__register_resolver(struct machine *machine, tep_func_resolver_t *func); struct tep_event_format* trace_event__tp_format(const char *sys, const char *name); struct tep_event_format *trace_event__tp_format_id(int id); int bigendian(void); void event_format__fprintf(struct tep_event_format *event, int cpu, void *data, int size, FILE *fp); void event_format__print(struct tep_event_format *event, int cpu, void *data, int size); int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long size); int parse_event_file(struct tep_handle *pevent, char *buf, unsigned long size, char *sys); unsigned long long raw_field_value(struct tep_event_format *event, const char *name, void *data); void parse_proc_kallsyms(struct tep_handle *pevent, char *file, unsigned int size); void parse_ftrace_printk(struct tep_handle *pevent, char *file, unsigned int size); void parse_saved_cmdline(struct tep_handle *pevent, char *file, unsigned int size); ssize_t trace_report(int fd, struct trace_event *tevent, bool repipe); struct tep_event_format *trace_find_next_event(struct tep_handle *pevent, struct tep_event_format *event); unsigned long long read_size(struct tep_event_format *event, void *ptr, int size); unsigned long long eval_flag(const char *flag); int read_tracing_data(int fd, struct list_head *pattrs); struct tracing_data { /* size is only valid if temp is 'true' */ ssize_t size; bool temp; char temp_file[50]; }; struct tracing_data *tracing_data_get(struct list_head *pattrs, int fd, bool temp); int tracing_data_put(struct tracing_data *tdata); struct addr_location; struct perf_session; struct perf_stat_config; struct scripting_ops { const char *name; int (*start_script) (const char *script, int argc, const char **argv); int (*flush_script) (void); int (*stop_script) (void); void (*process_event) (union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct addr_location *al); void (*process_stat)(struct perf_stat_config *config, struct perf_evsel *evsel, u64 tstamp); void (*process_stat_interval)(u64 tstamp); int (*generate_script) (struct tep_handle *pevent, const char *outfile); }; extern unsigned int scripting_max_stack; int script_spec_register(const char *spec, struct scripting_ops *ops); void setup_perl_scripting(void); void setup_python_scripting(void); struct scripting_context { struct tep_handle *pevent; void *event_data; }; int common_pc(struct scripting_context *context); int common_flags(struct scripting_context *context); int common_lock_depth(struct scripting_context *context); #endif /* _PERF_UTIL_TRACE_EVENT_H */
// @(#)root/minuit2:$Id$ // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005 /********************************************************************** * * * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT * * * **********************************************************************/ #ifndef ROOT_Minuit2_VariableMetricBuilder #define ROOT_Minuit2_VariableMetricBuilder #include "Minuit2/MnConfig.h" #include "Minuit2/MinimumBuilder.h" #include "Minuit2/VariableMetricEDMEstimator.h" #include "Minuit2/DavidonErrorUpdator.h" #include "Minuit2/BFGSErrorUpdator.h" #include <vector> #include <memory> namespace ROOT { namespace Minuit2 { /** Build (find) function minimum using the Variable Metric method (MIGRAD) Two possible error updators can be choosen - Davidon : this is the standard formula used in Migrad - BFGS this is the new formula based on BFGS algorithm (see Broyden–Fletcher–Goldfarb–Shanno algorithm https://en.wikipedia.org/wiki/Broyden–Fletcher–Goldfarb–Shanno_algorithm ) */ class VariableMetricBuilder : public MinimumBuilder { public: enum ErrorUpdatorType { kDavidon, kBFGS }; VariableMetricBuilder(ErrorUpdatorType type = kDavidon) : fEstimator(VariableMetricEDMEstimator()) { if (type == kBFGS) fErrorUpdator = std::unique_ptr<MinimumErrorUpdator>(new BFGSErrorUpdator()); else fErrorUpdator = std::unique_ptr<MinimumErrorUpdator>(new DavidonErrorUpdator()); } ~VariableMetricBuilder() {} virtual FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, const MnStrategy &, unsigned int, double) const; FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, std::vector<MinimumState> &, unsigned int, double) const; const VariableMetricEDMEstimator &Estimator() const { return fEstimator; } const MinimumErrorUpdator &ErrorUpdator() const { return *fErrorUpdator; } void AddResult(std::vector<MinimumState> &result, const MinimumState &state) const; private: VariableMetricEDMEstimator fEstimator; std::shared_ptr<MinimumErrorUpdator> fErrorUpdator; }; } // namespace Minuit2 } // namespace ROOT #endif // ROOT_Minuit2_VariableMetricBuilder
/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * Based on powerpc version */ #ifndef __ASM_MICROBLAZE_PCI_H #define __ASM_MICROBLAZE_PCI_H #ifdef __KERNEL__ #include <linux/types.h> #include <linux/slab.h> #include <linux/string.h> #include <linux/dma-mapping.h> #include <linux/pci.h> #include <asm/scatterlist.h> #include <asm/io.h> #include <asm/prom.h> #include <asm/pci-bridge.h> #include <asm-generic/pci-dma-compat.h> #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x10000000 struct pci_dev; /* Values for the `which' argument to sys_pciconfig_iobase syscall. */ #define IOBASE_BRIDGE_NUMBER 0 #define IOBASE_MEMORY 1 #define IOBASE_IO 2 #define IOBASE_ISA_IO 3 #define IOBASE_ISA_MEM 4 #define pcibios_scan_all_fns(a, b) 0 /* * Set this to 1 if you want the kernel to re-assign all PCI * bus numbers (don't do that on ppc64 yet !) */ #define pcibios_assign_all_busses() 0 static inline void pcibios_penalize_isa_irq(int irq, int active) { /* We don't do dynamic PCI IRQ allocation */ } #ifdef CONFIG_PCI extern void set_pci_dma_ops(struct dma_map_ops *dma_ops); extern struct dma_map_ops *get_pci_dma_ops(void); #else /* CONFIG_PCI */ #define set_pci_dma_ops(d) #define get_pci_dma_ops() NULL #endif #ifdef CONFIG_PCI static inline void pci_dma_burst_advice(struct pci_dev *pdev, enum pci_dma_burst_strategy *strat, unsigned long *strategy_parameter) { *strat = PCI_DMA_BURST_INFINITY; *strategy_parameter = ~0UL; } #endif extern int pci_domain_nr(struct pci_bus *bus); /* Decide whether to display the domain number in /proc */ extern int pci_proc_domain(struct pci_bus *bus); struct vm_area_struct; /* Map a range of PCI memory or I/O space for a device into user space */ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, enum pci_mmap_state mmap_state, int write_combine); /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ #define HAVE_PCI_MMAP 1 extern int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val, size_t count); extern int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val, size_t count); extern int pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma, enum pci_mmap_state mmap_state); #define HAVE_PCI_LEGACY 1 /* The PCI address space does equal the physical memory * address space (no IOMMU). The IDE and SCSI device layers use * this boolean for bounce buffer decisions. */ #define PCI_DMA_BUS_IS_PHYS (1) static inline struct resource *pcibios_select_root(struct pci_dev *pdev, struct resource *res) { struct resource *root = NULL; if (res->flags & IORESOURCE_IO) root = &ioport_resource; if (res->flags & IORESOURCE_MEM) root = &iomem_resource; return root; } extern void pcibios_claim_one_bus(struct pci_bus *b); extern void pcibios_finish_adding_to_bus(struct pci_bus *bus); extern void pcibios_resource_survey(void); extern struct pci_controller *init_phb_dynamic(struct device_node *dn); extern int remove_phb_dynamic(struct pci_controller *phb); extern struct pci_dev *of_create_pci_dev(struct device_node *node, struct pci_bus *bus, int devfn); extern void of_scan_pci_bridge(struct device_node *node, struct pci_dev *dev); extern void of_scan_bus(struct device_node *node, struct pci_bus *bus); extern void of_rescan_bus(struct device_node *node, struct pci_bus *bus); extern int pci_read_irq_line(struct pci_dev *dev); extern int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); struct file; extern pgprot_t pci_phys_mem_access_prot(struct file *file, unsigned long pfn, unsigned long size, pgprot_t prot); #define HAVE_ARCH_PCI_RESOURCE_TO_USER extern void pci_resource_to_user(const struct pci_dev *dev, int bar, const struct resource *rsrc, resource_size_t *start, resource_size_t *end); extern void pcibios_setup_bus_devices(struct pci_bus *bus); extern void pcibios_setup_bus_self(struct pci_bus *bus); /* This part of code was originally in xilinx-pci.h */ #ifdef CONFIG_PCI_XILINX extern void __init xilinx_pci_init(void); #else static inline void __init xilinx_pci_init(void) { return; } #endif #endif /* __KERNEL__ */ #endif /* __ASM_MICROBLAZE_PCI_H */
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SANDBOX_SRC_HANDLE_DISPATCHER_H_ #define SANDBOX_SRC_HANDLE_DISPATCHER_H_ #include "base/basictypes.h" #include "sandbox/win/src/crosscall_server.h" #include "sandbox/win/src/sandbox_policy_base.h" namespace sandbox { // This class handles handle-related IPC calls. class HandleDispatcher : public Dispatcher { public: explicit HandleDispatcher(PolicyBase* policy_base); ~HandleDispatcher() override {} // Dispatcher interface. bool SetupService(InterceptionManager* manager, int service) override; private: // Processes IPC requests coming from calls to // TargetServices::DuplicateHandle() in the target. bool DuplicateHandleProxy(IPCInfo* ipc, HANDLE source_handle, uint32 target_process_id, uint32 desired_access, uint32 options); PolicyBase* policy_base_; DISALLOW_COPY_AND_ASSIGN(HandleDispatcher); }; } // namespace sandbox #endif // SANDBOX_SRC_HANDLE_DISPATCHER_H_
// Copyright (c) Microsoft. All rights reserved. #pragma once #include "Scenario5_ManyProvidersManyAccounts.g.h" #include "MainPage.xaml.h" namespace SDKTemplate { /// <summary> /// The fifth scenario. Covers keeping and managing multiple active accounts and multiple account provider types. /// </summary> [Windows::Foundation::Metadata::WebHostHidden] public ref class Scenario5_ManyProvidersManyAccounts sealed { public: Scenario5_ManyProvidersManyAccounts(); protected: void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs ^ e) override; private: MainPage^ rootPage; void Button_AddNewAccount_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e); void Button_ManageSignedInAccounts_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e); void Button_Reset_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e); void CreateLocalDataContainers(); void InitalizeAccountsControlDialog(); void CleanupAccountsControlDialog(); void OnAccountCommandsRequested(Windows::UI::ApplicationSettings::AccountsSettingsPane^ sender, Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs^ e); void GetProviders(); void GetAccounts(); void LoadAccounts(); void AddWebAccountProviders(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e); void AddWebAccounts(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e); void AddLinksAndDescription(Windows::UI::ApplicationSettings::AccountsSettingsPaneCommandsRequestedEventArgs ^ e); void WebAccountProviderCommandInvoked(Windows::UI::ApplicationSettings::WebAccountProviderCommand^ command); void WebAccountCommandInvoked(Windows::UI::ApplicationSettings::WebAccountCommand ^ command, Windows::UI::ApplicationSettings::WebAccountInvokedArgs^ args); void PrivacyPolicyInvoked(Windows::UI::Popups::IUICommand^ command); void OtherLinkInvoked(Windows::UI::Popups::IUICommand ^ command); void AuthenticateWithRequestToken(Windows::Security::Credentials::WebAccountProvider ^ provider, Platform::String^ scope, Platform::String^ clientID); void OutputTokenResult(Windows::Security::Authentication::Web::Core::WebTokenRequestResult ^ result); void SaveAccount(Windows::Security::Credentials::WebAccount^ account); Windows::Foundation::IAsyncAction^ LogoffAndRemoveAccount(Windows::Security::Credentials::WebAccount ^ account); void LogoffAndRemoveAllAccounts(); const Platform::String^ MICROSOFT_PROVIDER_ID = "https://login.microsoft.com"; const Platform::String^ CONSUMER_AUTHORITY = "consumers"; const Platform::String^ ORGANIZATION_AUTHORITY = "organizations"; const Platform::String^ MSA_SCOPE_REQUESTED = "service::wl.basic::DELEGATION"; const Platform::String^ MSA_CLIENT_ID = "none"; const Platform::String^ AAD_SCOPE_REQUESTED = ""; const Platform::String^ AAD_CLIENT_ID = "c8542080-6873-47b5-bf71-d56378567ceb"; const Platform::String^ ACCOUNTS_CONTAINER = "accountssettingscontainer"; const Platform::String^ PROVIDER_ID_SUBCONTAINER = "providers"; const Platform::String^ AUTHORITY_SUBCONTAINER = "authorities"; const Platform::String^ APP_SPECIFIC_PROVIDER_ID = "myproviderid"; const Platform::String^ APP_SPECIFIC_PROVIDER_NAME = "App specific provider"; Platform::Collections::Map<Platform::String^, Windows::Security::Credentials::WebAccountProvider^>^ m_providers; Platform::Collections::Map<Platform::String^, Windows::Security::Credentials::WebAccount^>^ m_accounts; Windows::Foundation::EventRegistrationToken m_accountCommandsRequestedRegistrationToken; enum AccountAction { AddAccount, ManageAccount }; AccountAction m_selectedAccountAction; }; }
/* PR target/56564 */ /* { dg-do compile { target { *-*-linux* && lp64 } } } */ /* { dg-options "-O3 -fno-pic -fdump-tree-optimized" } */ __thread struct S { long a, b; } s = { 5, 6 }; __thread char t[16] = { 7 }; int foo (void) { return ((__UINTPTR_TYPE__) &s) & 15; } int bar (void) { return ((__UINTPTR_TYPE__) &t[0]) & 15; } /* { dg-final { scan-assembler-not ".align\[ \t]*16\[^:]*\[\n\r]s:" { target *-*-linux* } } } */ /* { dg-final { scan-assembler ".align\[ \t]*16\[^:]*\[\n\r]t:" { target *-*-linux* } } } */
/* Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> #include <errno.h> #include <string.h> #include <unistd.h> #include "pthreadP.h" #include <shlib-compat.h> struct pthread_attr *__attr_list; int __attr_list_lock = LLL_LOCK_INITIALIZER; int __pthread_attr_init_2_1 (attr) pthread_attr_t *attr; { struct pthread_attr *iattr; /* Many elements are initialized to zero so let us do it all at once. This also takes care of clearing the bytes which are not internally used. */ memset (attr, '\0', __SIZEOF_PTHREAD_ATTR_T); assert (sizeof (*attr) >= sizeof (struct pthread_attr)); iattr = (struct pthread_attr *) attr; /* Default guard size specified by the standard. */ iattr->guardsize = __getpagesize (); return 0; } versioned_symbol (libpthread, __pthread_attr_init_2_1, pthread_attr_init, GLIBC_2_1); #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) int __pthread_attr_init_2_0 (attr) pthread_attr_t *attr; { /* This code is specific to the old LinuxThread code which has a too small pthread_attr_t definition. The struct looked like this: */ struct old_attr { int detachstate; int schedpolicy; struct sched_param schedparam; int inheritsched; int scope; }; struct pthread_attr *iattr; /* Many elements are initialized to zero so let us do it all at once. This also takes care of clearing the bytes which are not internally used. */ memset (attr, '\0', sizeof (struct old_attr)); iattr = (struct pthread_attr *) attr; iattr->flags |= ATTR_FLAG_OLDATTR; /* We cannot enqueue the attribute because that member is not in the old attribute structure. */ return 0; } compat_symbol (libpthread, __pthread_attr_init_2_0, pthread_attr_init, GLIBC_2_0); #endif
#ifndef __bot2_vis_h__ #define __bot2_vis_h__ #include "batch_gl.h" #include "console.h" #include "default_view_handler.h" #include "fbgl_drawing_area.h" #include "gl_drawing_area.h" #include "gl_image_area.h" #include "gl_util.h" #include "gtk_util.h" #include "param_widget.h" #include "rwx.h" #include "wavefront.h" #include "scrollplot2d.h" #include "texture.h" #include "viewer.h" #include "view.h" /** * @defgroup BotVis Bot Vis * @brief Visualization with OpenGL and GTK+ */ /** * @defgroup BotVisGtk GTK+ * @brief GTK+ Widgets utility functions * @ingroup BotVis */ /** * @defgroup BotVisGl OpenGL * @brief OpenGL data structures and utility functions * @ingroup BotVis */ /** * @defgroup BotViewerGroup Viewer * @brief Visualization with OpenGL and GTK+ * @ingroup BotVis */ #endif
/* Copyright 2013 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ void stop_frame () { /* The debug information for this frame is modified in the accompanying .S file, to mark a set of registers as being undefined. */ } void first_frame () { stop_frame (); } int main () { first_frame (); return 0; }
#include <arm_neon.h> /* { dg-do compile } */ /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } } */ /* { dg-excess-errors "" { xfail arm*-*-* } } */ /* { dg-skip-if "" { arm*-*-* } } */ void f_vst2q_lane_s64 (int64_t * p, int64x2x2_t v) { /* { dg-error "lane 2 out of range 0 - 1" "" { xfail arm*-*-* } 0 } */ vst2q_lane_s64 (p, v, 2); /* { dg-error "lane -1 out of range 0 - 1" "" { xfail arm*-*-* } 0 } */ vst2q_lane_s64 (p, v, -1); return; }
/* * APEI Boot Error Record Table (BERT) support * * Copyright 2011 Intel Corp. * Author: Huang Ying <ying.huang@intel.com> * * Under normal circumstances, when a hardware error occurs, the error * handler receives control and processes the error. This gives OSPM a * chance to process the error condition, report it, and optionally attempt * recovery. In some cases, the system is unable to process an error. * For example, system firmware or a management controller may choose to * reset the system or the system might experience an uncontrolled crash * or reset.The boot error source is used to report unhandled errors that * occurred in a previous boot. This mechanism is described in the BERT * table. * * For more information about BERT, please refer to ACPI Specification * version 4.0, section 17.3.1 * * This file is licensed under GPLv2. * */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/acpi.h> #include <linux/io.h> #include "apei-internal.h" #undef pr_fmt #define pr_fmt(fmt) "BERT: " fmt static int bert_disable; static void __init bert_print_all(struct acpi_bert_region *region, unsigned int region_len) { struct acpi_hest_generic_status *estatus = (struct acpi_hest_generic_status *)region; int remain = region_len; u32 estatus_len; while (remain >= sizeof(struct acpi_bert_region)) { estatus_len = cper_estatus_len(estatus); if (remain < estatus_len) { pr_err(FW_BUG "Truncated status block (length: %u).\n", estatus_len); return; } /* No more error records. */ if (!estatus->block_status) return; if (cper_estatus_check(estatus)) { pr_err(FW_BUG "Invalid error record.\n"); return; } pr_info_once("Error records from previous boot:\n"); cper_estatus_print(KERN_INFO HW_ERR, estatus); /* * Because the boot error source is "one-time polled" type, * clear Block Status of current Generic Error Status Block, * once it's printed. */ estatus->block_status = 0; estatus = (void *)estatus + estatus_len; remain -= estatus_len; } } static int __init setup_bert_disable(char *str) { bert_disable = 1; return 0; } __setup("bert_disable", setup_bert_disable); static int __init bert_check_table(struct acpi_table_bert *bert_tab) { if (bert_tab->header.length < sizeof(struct acpi_table_bert) || bert_tab->region_length < sizeof(struct acpi_bert_region)) return -EINVAL; return 0; } static int __init bert_init(void) { struct apei_resources bert_resources; struct acpi_bert_region *boot_error_region; struct acpi_table_bert *bert_tab; unsigned int region_len; acpi_status status; int rc = 0; if (acpi_disabled) return 0; if (bert_disable) { pr_info("Boot Error Record Table support is disabled.\n"); return 0; } status = acpi_get_table(ACPI_SIG_BERT, 0, (struct acpi_table_header **)&bert_tab); if (status == AE_NOT_FOUND) return 0; if (ACPI_FAILURE(status)) { pr_err("get table failed, %s.\n", acpi_format_exception(status)); return -EINVAL; } rc = bert_check_table(bert_tab); if (rc) { pr_err(FW_BUG "table invalid.\n"); return rc; } region_len = bert_tab->region_length; apei_resources_init(&bert_resources); rc = apei_resources_add(&bert_resources, bert_tab->address, region_len, true); if (rc) return rc; rc = apei_resources_request(&bert_resources, "APEI BERT"); if (rc) goto out_fini; boot_error_region = ioremap_cache(bert_tab->address, region_len); if (boot_error_region) { bert_print_all(boot_error_region, region_len); iounmap(boot_error_region); } else { rc = -ENOMEM; } apei_resources_release(&bert_resources); out_fini: apei_resources_fini(&bert_resources); return rc; } late_initcall(bert_init);
/* * File: portdrv.h * Purpose: PCI Express Port Bus Driver's Internal Data Structures * * Copyright (C) 2004 Intel * Copyright (C) Tom Long Nguyen (tom.l.nguyen@intel.com) */ #ifndef _PORTDRV_H_ #define _PORTDRV_H_ #if !defined(PCI_CAP_ID_PME) #define PCI_CAP_ID_PME 1 #endif #if !defined(PCI_CAP_ID_EXP) #define PCI_CAP_ID_EXP 0x10 #endif #define PORT_TYPE_MASK 0xf #define PORT_TO_SLOT_MASK 0x100 #define SLOT_HP_CAPABLE_MASK 0x40 #define PCIE_CAPABILITIES_REG 0x2 #define PCIE_SLOT_CAPABILITIES_REG 0x14 #define PCIE_PORT_DEVICE_MAXSERVICES 4 #define PCI_CFG_SPACE_SIZE 256 #define get_descriptor_id(type, service) (((type - 4) << 4) | service) extern struct bus_type pcie_port_bus_type; extern int pcie_port_device_probe(struct pci_dev *dev); extern int pcie_port_device_register(struct pci_dev *dev); #ifdef CONFIG_PM extern int pcie_port_device_suspend(struct pci_dev *dev, u32 state); extern int pcie_port_device_resume(struct pci_dev *dev); #endif extern void pcie_port_device_remove(struct pci_dev *dev); extern void pcie_port_bus_register(void); extern void pcie_port_bus_unregister(void); #endif /* _PORTDRV_H_ */
/* * include/linux/generic_adc_thermal.h * * Generic ADC thermal driver * * Copyright (c) 2013, NVIDIA Corporation. All rights reserved. * * Author: Jinyoung Park <jinyoungp@nvidia.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation version 2. * * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind, * whether express or implied; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307, USA */ #ifndef GENERIC_ADC_THERMAL_H #define GENERIC_ADC_THERMAL_H struct gadc_thermal_platform_data { const char *iio_channel_name; const char *tz_name; int temp_offset; /* mC */ int (*adc_to_temp)(struct gadc_thermal_platform_data *, int *, int *); }; #endif /* GENERIC_ADC_THERMAL_H */
/* { dg-do compile } */ /* { dg-options "-O3 -mno-pc-relative-literal-loads" } */ /* { dg-skip-if "Tiny model won't generate adrp" { *-*-* } { "-mcmodel=tiny" } { "" } } */ double d0(void) { double x = 0.0d; return x; } double dn1(void) { double x = -0.0d; return x; } double d1(void) { double x = 1.5d; return x; } double d2(void) { double x = 123256.0d; return x; } double d3(void) { double x = 123256123456.0d; return x; } double d4(void) { double x = 123456123456123456.0d; return x; } /* { dg-final { scan-assembler-times "movi\td\[0-9\]+, #?0" 1 } } */ /* { dg-final { scan-assembler-times "adrp\tx\[0-9\]+, \.LC\[0-9\]" 2 } } */ /* { dg-final { scan-assembler-times "ldr\td\[0-9\]+, \\\[x\[0-9\], #:lo12:\.LC\[0-9\]\\\]" 2 } } */ /* { dg-final { scan-assembler-times "fmov\td\[0-9\]+, 1\\\.5e\\\+0" 1 } } */ /* { dg-final { scan-assembler-times "mov\tx\[0-9\]+, 25838523252736" 1 } } */ /* { dg-final { scan-assembler-times "movk\tx\[0-9\]+, 0x40fe, lsl 48" 1 } } */ /* { dg-final { scan-assembler-times "mov\tx\[0-9\]+, -9223372036854775808" 1 } } */ /* { dg-final { scan-assembler-times "fmov\td\[0-9\]+, x\[0-9\]+" 2 } } */
/* Testcase for http://sourceware.org/bugzilla/show_bug.cgi?id=14090. Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include "md5.h" /* This test will not work with 32-bit size_t, so let it succeed there. */ #if SIZE_MAX <= UINT32_MAX static int do_test (void) { return 0; } #else # define CONST_2G 0x080000000 # define CONST_10G 0x280000000 /* MD5 sum values of zero-filled blocks of specified sizes. */ static const struct test_data_s { const char ref[16]; size_t len; } test_data[] = { { "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\x09\x98\xec\xf8\x42\x7e", 0x000000000 }, { "\xa9\x81\x13\x0c\xf2\xb7\xe0\x9f\x46\x86\xdc\x27\x3c\xf7\x18\x7e", 0x080000000 }, { "\xc9\xa5\xa6\x87\x8d\x97\xb4\x8c\xc9\x65\xc1\xe4\x18\x59\xf0\x34", 0x100000000 }, { "\x58\xcf\x63\x8a\x73\x3f\x91\x90\x07\xb4\x28\x7c\xf5\x39\x6d\x0c", 0x180000000 }, { "\xb7\x70\x35\x1f\xad\xae\x5a\x96\xbb\xaf\x97\x02\xed\x97\xd2\x8d", 0x200000000 }, { "\x2d\xd2\x6c\x4d\x47\x99\xeb\xd2\x9f\xa3\x1e\x48\xd4\x9e\x8e\x53", 0x280000000 }, }; static int report (const char *id, const char *md5, size_t len, const char *ref) { if (memcmp (md5, ref, 16)) { printf ("test %s with size %zd failed\n", id, len); return 1; } return 0; } /* Test md5 in a single md5_process_bytes call. */ static int test_single (void *buf, size_t len, const char *ref) { char sum[16]; struct md5_ctx ctx; __md5_init_ctx (&ctx); __md5_process_bytes (buf, len, &ctx); __md5_finish_ctx (&ctx, sum); return report ("single", sum, len, ref); } /* Test md5 with two md5_process_bytes calls to trigger a different path in md5_process_block for sizes > 2 GB. */ static int test_double (void *buf, size_t len, const char *ref) { char sum[16]; struct md5_ctx ctx; __md5_init_ctx (&ctx); if (len >= CONST_2G) { __md5_process_bytes (buf, CONST_2G, &ctx); __md5_process_bytes (buf + CONST_2G, len - CONST_2G, &ctx); } else __md5_process_bytes (buf, len, &ctx); __md5_finish_ctx (&ctx, sum); return report ("double", sum, len, ref); } static int do_test (void) { void *buf; unsigned int j; int result = 0; buf = mmap64 (0, CONST_10G, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); if (buf == MAP_FAILED) { puts ("Could not allocate 10 GB via mmap, skipping test."); return 0; } for (j = 0; j < sizeof (test_data) / sizeof (struct test_data_s); j++) { if (test_single (buf, test_data[j].len, test_data[j].ref)) result = 1; if (test_double (buf, test_data[j].len, test_data[j].ref)) result = 1; } return result; } #endif /* This needs on a fast machine 90s. */ #define TIMEOUT 480 #define TEST_FUNCTION do_test () #include "../test-skeleton.c"
/* vi: set sw=4 ts=4: */ /* * ext2fsP.h --- private header file for ext2 library * * Copyright (C) 1997 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU Public * License. * %End-Header% */ #include "ext2fs.h" /* * Badblocks list */ struct ext2_struct_u32_list { int magic; int num; int size; __u32 *list; int badblocks_flags; }; struct ext2_struct_u32_iterate { int magic; ext2_u32_list bb; int ptr; }; /* * Directory block iterator definition */ struct ext2_struct_dblist { int magic; ext2_filsys fs; ext2_ino_t size; ext2_ino_t count; int sorted; struct ext2_db_entry * list; }; /* * For directory iterators */ struct dir_context { ext2_ino_t dir; int flags; char *buf; int (*func)(ext2_ino_t dir, int entry, struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, void *priv_data); void *priv_data; errcode_t errcode; }; /* * Inode cache structure */ struct ext2_inode_cache { void * buffer; blk_t buffer_blk; int cache_last; int cache_size; int refcount; struct ext2_inode_cache_ent *cache; }; struct ext2_inode_cache_ent { ext2_ino_t ino; struct ext2_inode inode; }; /* Function prototypes */ extern int ext2fs_process_dir_block(ext2_filsys fs, blk_t *blocknr, e2_blkcnt_t blockcnt, blk_t ref_block, int ref_offset, void *priv_data);
#include "SocketCommand.h" class Version : public SocketCommand { Q_OBJECT public: Version(WebPageManager *, QStringList &arguments, QObject *parent = 0); virtual void start(); };
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #if !GOOGLE_CUDA #error This file must only be included when building with Cuda support #endif #ifndef TENSORFLOW_CORE_KERNELS_POOLING_OPS_COMMON_GPU_H_ #define TENSORFLOW_CORE_KERNELS_POOLING_OPS_COMMON_GPU_H_ #include <vector> #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/tensor_shape.h" #include "tensorflow/core/kernels/avgpooling_op.h" #include "tensorflow/core/kernels/maxpooling_op.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/platform/stream_executor.h" #include "tensorflow/core/util/padding.h" #include "tensorflow/core/util/tensor_format.h" namespace tensorflow { // A helper class that launch the cudnn pooling forward operations. template <typename T> class DnnPoolingOp { public: typedef GPUDevice Device; static void Compute(OpKernelContext* context, perftools::gputools::dnn::PoolingMode pooling_mode, const std::vector<int32>& size, const std::vector<int32>& stride, Padding padding, TensorFormat data_format, const Tensor& tensor_in, const TensorShape& tensor_out_shape, bool propagate_nans); }; // A helper class that launch the cudnn pooling backward operations. // The original input and output tensors are optional for AvgPoolGrad, but // mandatory for MaxPoolGrad. template <typename T> class DnnPoolingGradOp { public: typedef GPUDevice Device; static void Compute(OpKernelContext* context, perftools::gputools::dnn::PoolingMode pooling_mode, const std::vector<int32>& size, const std::vector<int32>& stride, Padding padding, TensorFormat data_format, const Tensor* tensor_in, const Tensor* tensor_out, const Tensor& out_backprop, const TensorShape& tensor_in_shape, bool propagate_nans); }; } // namespace tensorflow #endif // TENSORFLOW_CORE_KERNELS_POOLING_OPS_COMMON_GPU_H_
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: * * Libmemcached library * * Copyright (C) 2011 Data Differential, http://datadifferential.com/ * Copyright (C) 2006-2009 Brian Aker All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * * The names of its contributors may not be used to endorse or * promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #pragma once /** Strings are always under our control so we make some assumptions about them. 1) is_initialized is always valid. 2) A string once intialized will always be, until free where we unset this flag. 3) A string always has a root. */ struct memcached_string_st { char *end; char *string; size_t current_size; struct memcached_st *root; struct { bool is_allocated:1; bool is_initialized:1; } options; };
#ifndef _MT_GPIO_AFFIX_H_ #define _MT_GPIO_AFFIX_H_ /****************************************************************************** * Enumeration for Clock output ******************************************************************************/ /*CLOCK OUT*/ typedef enum { CLK_OUT_UNSUPPORTED = -1, CLK_OUT0, CLK_OUT1, CLK_OUT2, CLK_OUT3, CLK_OUT4, CLK_OUT5, CLK_OUT6, CLK_MAX }GPIO_CLKOUT; typedef enum { CLKM_UNSUPPORTED = -1, CLKM0, CLKM1, CLKM2, CLKM3, CLKM4, CLKM5, CLKM6, }GPIO_CLKM; /*----------------------------------------------------------------------------*/ typedef enum CLK_SRC { CLK_SRC_UNSUPPORTED = -1, CLK_SRC_GATE = 0x0, CLK_SRC_SYS_26M, CLK_SRC_FRTC, CLK_SRC_WHPLL_250P25M, CLK_SRC_WPLL_245P76M, CLK_SRC_MDPLL2_416, CLK_SRC_MDPLL1_416, CLK_SRC_MCUPLL2_H481M, CLK_SRC_MCUPLL1_H481M, CLK_SRC_MSDC_H208M, CLK_SRC_ISP_208M, CLK_SRC_LVDS_H180M, CLK_SRC_TVHDMI_H, CLK_SRC_UPLL_178P3M, CLK_SRC_MAIN_H230P3M, CLK_SRC_MM_DIV7, CLK_SRC_MAX }GPIO_CLKSRC; /*clock output setting*/ int mt_set_clock_output(unsigned long num, unsigned long src, unsigned long div); int mt_get_clock_output(unsigned long num, unsigned long *src, unsigned long *div); /*For MD GPIO customization only, can be called by CCCI driver*/ int mt_get_md_gpio(char * gpio_name, int len); #endif
/* Copyright (C) 1992-1998 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see <http://www.gnu.org/licenses/>. */ /* Modified to use with samba by Jeremy Allison, 8th July 1995. */ #include "replace.h" #include "system/filesys.h" #include "system/wait.h" #include "system/terminal.h" #include "system/passwd.h" /* * Define additional missing types */ #ifndef HAVE_SIG_ATOMIC_T_TYPE typedef int sig_atomic_t; #endif #ifndef SIGCLD #define SIGCLD SIGCHLD #endif #ifdef SYSV_TERMIO /* SYSTEM V TERMIO HANDLING */ static struct termio t; #define ECHO_IS_ON(t) ((t).c_lflag & ECHO) #define TURN_ECHO_OFF(t) ((t).c_lflag &= ~ECHO) #define TURN_ECHO_ON(t) ((t).c_lflag |= ECHO) #ifndef TCSAFLUSH #define TCSAFLUSH 1 #endif #ifndef TCSANOW #define TCSANOW 0 #endif static int tcgetattr(int fd, struct termio *_t) { return ioctl(fd, TCGETA, _t); } static int tcsetattr(int fd, int flags, struct termio *_t) { if(flags & TCSAFLUSH) ioctl(fd, TCFLSH, TCIOFLUSH); return ioctl(fd, TCSETS, _t); } #elif !defined(TCSAFLUSH) /* BSD TERMIO HANDLING */ static struct sgttyb t; #define ECHO_IS_ON(t) ((t).sg_flags & ECHO) #define TURN_ECHO_OFF(t) ((t).sg_flags &= ~ECHO) #define TURN_ECHO_ON(t) ((t).sg_flags |= ECHO) #define TCSAFLUSH 1 #define TCSANOW 0 static int tcgetattr(int fd, struct sgttyb *_t) { return ioctl(fd, TIOCGETP, (char *)_t); } static int tcsetattr(int fd, int flags, struct sgttyb *_t) { return ioctl(fd, TIOCSETP, (char *)_t); } #else /* POSIX TERMIO HANDLING */ #define ECHO_IS_ON(t) ((t).c_lflag & ECHO) #define TURN_ECHO_OFF(t) ((t).c_lflag &= ~ECHO) #define TURN_ECHO_ON(t) ((t).c_lflag |= ECHO) static struct termios t; #endif /* SYSV_TERMIO */ static void catch_signal(int signum, void (*handler)(int )) { #ifdef HAVE_SIGACTION struct sigaction act; struct sigaction oldact; memset(&act, 0, sizeof(act)); act.sa_handler = handler; #ifdef SA_RESTART /* * We *want* SIGALRM to interrupt a system call. */ if(signum != SIGALRM) act.sa_flags = SA_RESTART; #endif sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask,signum); sigaction(signum,&act,&oldact); #else /* !HAVE_SIGACTION */ /* FIXME: need to handle sigvec and systems with broken signal() */ signal(signum, handler); #endif } static sig_atomic_t gotintr; static int in_fd = -1; /*************************************************************** Signal function to tell us were ^C'ed. ****************************************************************/ static void gotintr_sig(int signum) { gotintr = 1; if (in_fd != -1) close(in_fd); /* Safe way to force a return. */ in_fd = -1; } char *rep_getpass(const char *prompt) { FILE *in, *out; int echo_off; static char buf[256]; static size_t bufsize = sizeof(buf); size_t nread; /* Catch problematic signals */ catch_signal(SIGINT, gotintr_sig); /* Try to write to and read from the terminal if we can. If we can't open the terminal, use stderr and stdin. */ in = fopen ("/dev/tty", "w+"); if (in == NULL) { in = stdin; out = stderr; } else { out = in; } setvbuf(in, NULL, _IONBF, 0); /* Turn echoing off if it is on now. */ if (tcgetattr (fileno (in), &t) == 0) { if (ECHO_IS_ON(t)) { TURN_ECHO_OFF(t); echo_off = tcsetattr (fileno (in), TCSAFLUSH, &t) == 0; TURN_ECHO_ON(t); } else { echo_off = 0; } } else { echo_off = 0; } /* Write the prompt. */ fputs(prompt, out); fflush(out); /* Read the password. */ buf[0] = 0; if (!gotintr) { in_fd = fileno(in); if (fgets(buf, bufsize, in) == NULL) { buf[0] = 0; } } nread = strlen(buf); if (nread) { if (buf[nread - 1] == '\n') buf[nread - 1] = '\0'; } /* Restore echoing. */ if (echo_off) { if (gotintr && in_fd == -1) { in = fopen ("/dev/tty", "w+"); } if (in != NULL) tcsetattr (fileno (in), TCSANOW, &t); } fprintf(out, "\n"); fflush(out); if (in && in != stdin) /* We opened the terminal; now close it. */ fclose(in); /* Catch problematic signals */ catch_signal(SIGINT, SIG_DFL); if (gotintr) { printf("Interrupted by signal.\n"); fflush(stdout); exit(1); } return buf; }
#ifndef WORLDCONTROLLER_H #define WORLDCONTROLLER_H #include "applicationcontroller.h" class T_CONTROLLER_EXPORT WorldController : public ApplicationController { Q_OBJECT public: WorldController() { } WorldController(const WorldController &other); bool sessionEnabled() const { return false; } bool transactionEnabled() const { return false; } public slots: void index(); void plain(); void show(const QString &pk); void queries(); void queries(const QString &num); void random(); void entry(); void create(); void edit(const QString &pk); void save(const QString &pk); void updates(const QString &num); void updates(); void remove(const QString &pk); // MongoDB void mqueries(); void mqueries(const QString &num); void mrandom(); void mupdates(const QString &num); void mupdates(); private: void renderEntry(const QVariantMap &world = QVariantMap()); void renderEdit(const QVariantMap &world = QVariantMap()); }; T_DECLARE_CONTROLLER(WorldController, worldcontroller) #endif // WORLDCONTROLLER_H
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Defines local discovery messages between the browser and utility process. #include "chrome/common/local_discovery/service_discovery_client.h" #include "ipc/ipc_message_macros.h" #define IPC_MESSAGE_START LocalDiscoveryMsgStart IPC_STRUCT_TRAITS_BEGIN(local_discovery::ServiceDescription) IPC_STRUCT_TRAITS_MEMBER(service_name) IPC_STRUCT_TRAITS_MEMBER(address) IPC_STRUCT_TRAITS_MEMBER(metadata) IPC_STRUCT_TRAITS_MEMBER(ip_address) IPC_STRUCT_TRAITS_MEMBER(last_seen) IPC_STRUCT_TRAITS_END() IPC_ENUM_TRAITS(local_discovery::ServiceWatcher::UpdateType) IPC_ENUM_TRAITS(local_discovery::ServiceResolver::RequestStatus) IPC_ENUM_TRAITS(net::AddressFamily) //------------------------------------------------------------------------------ // Utility process messages: // These are messages from the browser to the utility process. // Creates watcher and starts listening in utility process. IPC_MESSAGE_CONTROL2(LocalDiscoveryMsg_StartWatcher, uint64 /* id */, std::string /* service_type */) // Discovers new services. IPC_MESSAGE_CONTROL2(LocalDiscoveryMsg_DiscoverServices, uint64 /* id */, bool /* force_update */) // Destroys watcher in utility process. IPC_MESSAGE_CONTROL1(LocalDiscoveryMsg_DestroyWatcher, uint64 /* id */) // Creates service resolver and starts resolving service in utility process. IPC_MESSAGE_CONTROL2(LocalDiscoveryMsg_ResolveService, uint64 /* id */, std::string /* service_name */) // Destroys service resolver in utility process. IPC_MESSAGE_CONTROL1(LocalDiscoveryMsg_DestroyResolver, uint64 /* id */) // Creates a local domain resolver and starts resolving in utility process. IPC_MESSAGE_CONTROL3(LocalDiscoveryMsg_ResolveLocalDomain, uint64 /* id */, std::string /* domain */, net::AddressFamily /* address_family */) // Destroys local domain resolver in utility process. IPC_MESSAGE_CONTROL1(LocalDiscoveryMsg_DestroyLocalDomainResolver, uint64 /* id */) //------------------------------------------------------------------------------ // Utility process host messages: // These are messages from the utility process to the browser. // Notifies browser process about new services. IPC_MESSAGE_CONTROL3(LocalDiscoveryHostMsg_WatcherCallback, uint64 /* id */, local_discovery::ServiceWatcher::UpdateType /* update */, std::string /* service_name */) // Notifies browser process about service resolution results. IPC_MESSAGE_CONTROL3( LocalDiscoveryHostMsg_ResolverCallback, uint64 /* id */, local_discovery::ServiceResolver::RequestStatus /* status */, local_discovery::ServiceDescription /* description */) // Notifies browser process about local domain resolution results. IPC_MESSAGE_CONTROL3( LocalDiscoveryHostMsg_LocalDomainResolverCallback, uint64 /* id */, bool /* success */, net::IPAddressNumber /* ip_address */)
GLboolean GLEWAPIENTRY glewIsSupported (const char* name) { const GLubyte* pos = (const GLubyte*)name; GLuint len = _glewStrLen(pos); GLboolean ret = GL_TRUE; while (ret && len > 0) { if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) {
/* * Copyright 2014 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkSurface_Gpu_DEFINED #define SkSurface_Gpu_DEFINED #include "SkSurface_Base.h" #if SK_SUPPORT_GPU class SkGpuDevice; class SkSurface_Gpu : public SkSurface_Base { public: SK_DECLARE_INST_COUNT(SkSurface_Gpu) SkSurface_Gpu(SkGpuDevice*); virtual ~SkSurface_Gpu(); SkCanvas* onNewCanvas() override; SkSurface* onNewSurface(const SkImageInfo&) override; SkImage* onNewImageSnapshot(Budgeted) override; void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) override; void onCopyOnWrite(ContentChangeMode) override; void onDiscard() override; SkGpuDevice* getDevice() { return fDevice; } private: SkGpuDevice* fDevice; typedef SkSurface_Base INHERITED; }; #endif // SK_SUPPORT_GPU #endif // SkSurface_Gpu_DEFINED
/* * videobuf2-dma-sg.h - DMA scatter/gather memory allocator for videobuf2 * * Copyright (C) 2010 Samsung Electronics * * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation. */ #ifndef _MEDIA_VIDEOBUF2_DMA_SG_H #define _MEDIA_VIDEOBUF2_DMA_SG_H #include <media/videobuf2-v4l2.h> static inline struct sg_table *vb2_dma_sg_plane_desc( struct vb2_buffer *vb, unsigned int plane_no) { return (struct sg_table *)vb2_plane_cookie(vb, plane_no); } void *vb2_dma_sg_init_ctx(struct device *dev); void vb2_dma_sg_cleanup_ctx(void *alloc_ctx); extern const struct vb2_mem_ops vb2_dma_sg_memops; #endif
/* { dg-do compile { target { ! ia32 } } } */ /* { dg-options "-Ofast -mavx512vl -mavx512dq" } */ void f1 (float x) { register float a __asm ("xmm16"); a = x; asm volatile ("" : "+v" (a)); a = __builtin_fabsf (a); asm volatile ("" : "+v" (a)); } void f2 (float x, float y) { register float a __asm ("xmm16"), b __asm ("xmm17"); a = x; b = y; asm volatile ("" : "+v" (a), "+v" (b)); a = __builtin_copysignf (a, b); asm volatile ("" : "+v" (a)); } void f3 (float x) { register float a __asm ("xmm16"); a = x; asm volatile ("" : "+v" (a)); a = -a; asm volatile ("" : "+v" (a)); } void f4 (double x) { register double a __asm ("xmm18"); a = x; asm volatile ("" : "+v" (a)); a = __builtin_fabs (a); asm volatile ("" : "+v" (a)); } void f5 (double x, double y) { register double a __asm ("xmm18"), b __asm ("xmm19"); a = x; b = y; asm volatile ("" : "+v" (a), "+v" (b)); a = __builtin_copysign (a, b); asm volatile ("" : "+v" (a)); } void f6 (double x) { register double a __asm ("xmm18"); a = x; asm volatile ("" : "+v" (a)); a = -a; asm volatile ("" : "+v" (a)); } /* { dg-final { scan-assembler "vandps\[^\n\r\]*xmm16" } } */ /* { dg-final { scan-assembler "vorps\[^\n\r\]*xmm16" } } */ /* { dg-final { scan-assembler "vxorps\[^\n\r\]*xmm16" } } */ /* { dg-final { scan-assembler "vandpd\[^\n\r\]*xmm18" } } */ /* { dg-final { scan-assembler "vorpd\[^\n\r\]*xmm18" } } */ /* { dg-final { scan-assembler "vxorpd\[^\n\r\]*xmm18" } } */
/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2012 ARM Ltd. */ #ifndef __ASM_SMP_H #define __ASM_SMP_H #include <linux/const.h> /* Values for secondary_data.status */ #define CPU_STUCK_REASON_SHIFT (8) #define CPU_BOOT_STATUS_MASK ((UL(1) << CPU_STUCK_REASON_SHIFT) - 1) #define CPU_MMU_OFF (-1) #define CPU_BOOT_SUCCESS (0) /* The cpu invoked ops->cpu_die, synchronise it with cpu_kill */ #define CPU_KILL_ME (1) /* The cpu couldn't die gracefully and is looping in the kernel */ #define CPU_STUCK_IN_KERNEL (2) /* Fatal system error detected by secondary CPU, crash the system */ #define CPU_PANIC_KERNEL (3) #define CPU_STUCK_REASON_52_BIT_VA (UL(1) << CPU_STUCK_REASON_SHIFT) #define CPU_STUCK_REASON_NO_GRAN (UL(2) << CPU_STUCK_REASON_SHIFT) #ifndef __ASSEMBLY__ #include <asm/percpu.h> #include <linux/threads.h> #include <linux/cpumask.h> #include <linux/thread_info.h> DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number); /* * We don't use this_cpu_read(cpu_number) as that has implicit writes to * preempt_count, and associated (compiler) barriers, that we'd like to avoid * the expense of. If we're preemptible, the value can be stale at use anyway. * And we can't use this_cpu_ptr() either, as that winds up recursing back * here under CONFIG_DEBUG_PREEMPT=y. */ #define raw_smp_processor_id() (*raw_cpu_ptr(&cpu_number)) /* * Logical CPU mapping. */ extern u64 __cpu_logical_map[NR_CPUS]; extern u64 cpu_logical_map(unsigned int cpu); static inline void set_cpu_logical_map(unsigned int cpu, u64 hwid) { __cpu_logical_map[cpu] = hwid; } struct seq_file; /* * Discover the set of possible CPUs and determine their * SMP operations. */ extern void smp_init_cpus(void); /* * Register IPI interrupts with the arch SMP code */ extern void set_smp_ipi_range(int ipi_base, int nr_ipi); /* * Called from the secondary holding pen, this is the secondary CPU entry point. */ asmlinkage void secondary_start_kernel(void); /* * Initial data for bringing up a secondary CPU. * @stack - sp for the secondary CPU * @status - Result passed back from the secondary CPU to * indicate failure. */ struct secondary_data { void *stack; struct task_struct *task; long status; }; extern struct secondary_data secondary_data; extern long __early_cpu_boot_status; extern void secondary_entry(void); extern void arch_send_call_function_single_ipi(int cpu); extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); #ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask); #else static inline void arch_send_wakeup_ipi_mask(const struct cpumask *mask) { BUILD_BUG(); } #endif extern int __cpu_disable(void); extern void __cpu_die(unsigned int cpu); extern void cpu_die(void); extern void cpu_die_early(void); static inline void cpu_park_loop(void) { for (;;) { wfe(); wfi(); } } static inline void update_cpu_boot_status(int val) { WRITE_ONCE(secondary_data.status, val); /* Ensure the visibility of the status update */ dsb(ishst); } /* * The calling secondary CPU has detected serious configuration mismatch, * which calls for a kernel panic. Update the boot status and park the calling * CPU. */ static inline void cpu_panic_kernel(void) { update_cpu_boot_status(CPU_PANIC_KERNEL); cpu_park_loop(); } /* * If a secondary CPU enters the kernel but fails to come online, * (e.g. due to mismatched features), and cannot exit the kernel, * we increment cpus_stuck_in_kernel and leave the CPU in a * quiesecent loop within the kernel text. The memory containing * this loop must not be re-used for anything else as the 'stuck' * core is executing it. * * This function is used to inhibit features like kexec and hibernate. */ bool cpus_are_stuck_in_kernel(void); extern void crash_smp_send_stop(void); extern bool smp_crash_stop_failed(void); extern void panic_smp_self_stop(void); #endif /* ifndef __ASSEMBLY__ */ #endif /* ifndef __ASM_SMP_H */
#include<stdio.h> #include<assert.h> int main() { int rd, rs, rt, dsp; int result, resultdsp; rs = 0x12345678; rt = 0x87654321; result = 0x7FFFFFFF; resultdsp = 0x01; __asm ("subq_s.w %0, %2, %3\n\t" "rddsp %1\n\t" : "=r"(rd), "=r"(dsp) : "r"(rs), "r"(rt) ); dsp = (dsp >> 20) & 0x01; assert(dsp == resultdsp); assert(rd == result); rs = 0x66666; rt = 0x55555; result = 0x11111; resultdsp = 0x01; __asm ("subq_s.w %0, %2, %3\n\t" "rddsp %1\n\t" : "=r"(rd), "=r"(dsp) : "r"(rs), "r"(rt) ); dsp = (dsp >> 20) & 0x01; assert(dsp == resultdsp); assert(rd == result); #if 0 rs = 0x35555555; rt = 0xf5555555; result = 0x80000000; resultdsp = 0x01; __asm ("subq_s.w %0, %2, %3\n\t" "rddsp %1\n\t" : "=r"(rd), "=r"(dsp) : "r"(rs), "r"(rt) ); dsp = (dsp >> 20) & 0x01; assert(dsp == resultdsp); assert(rd == result); #endif return 0; }
/* * Copyright 2011 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SFNTLY_CPP_SRC_SFNTLY_DATA_FONT_INPUT_STREAM_H_ #define SFNTLY_CPP_SRC_SFNTLY_DATA_FONT_INPUT_STREAM_H_ #include "sfntly/port/type.h" #include "sfntly/port/input_stream.h" namespace sfntly { // An input stream for reading font data. // The data types used are as listed: // BYTE 8-bit unsigned integer. // CHAR 8-bit signed integer. // USHORT 16-bit unsigned integer. // SHORT 16-bit signed integer. // UINT24 24-bit unsigned integer. // ULONG 32-bit unsigned integer. // LONG 32-bit signed integer. // Fixed 32-bit signed fixed-point number (16.16) // FUNIT Smallest measurable distance in the em space. // FWORD 16-bit signed integer (SHORT) that describes a quantity in FUnits. // UFWORD 16-bit unsigned integer (USHORT) that describes a quantity in // FUnits. // F2DOT14 16-bit signed fixed number with the low 14 bits of fraction (2.14) // LONGDATETIME Date represented in number of seconds since 12:00 midnight, // January 1, 1904. The value is represented as a signed 64-bit // integer. // Note: Original class inherits from Java's FilterOutputStream, which wraps // an InputStream within. In C++, we directly do the wrapping without // defining another layer of abstraction. The wrapped output stream is // *NOT* reference counted (because it's meaningless to ref-count an I/O // stream). class FontInputStream : public InputStream { public: // Constructor. // @param is input stream to wrap explicit FontInputStream(InputStream* is); // Constructor for a bounded font input stream. // @param is input stream to wrap // @param length the maximum length of bytes to read FontInputStream(InputStream* is, size_t length); virtual ~FontInputStream(); virtual int32_t Available(); virtual void Close(); virtual void Mark(int32_t readlimit); virtual bool MarkSupported(); virtual void Reset(); virtual int32_t Read(); virtual int32_t Read(ByteVector* buffer); virtual int32_t Read(ByteVector* buffer, int32_t offset, int32_t length); // Get the current position in the stream in bytes. // @return the current position in bytes virtual int64_t position() { return position_; } virtual int32_t ReadChar(); virtual int32_t ReadUShort(); virtual int32_t ReadShort(); virtual int32_t ReadUInt24(); virtual int64_t ReadULong(); virtual int32_t ReadULongAsInt(); virtual int32_t ReadLong(); virtual int32_t ReadFixed(); virtual int64_t ReadDateTimeAsLong(); virtual int64_t Skip(int64_t n); // n can be negative. private: InputStream* stream_; int64_t position_; int64_t length_; // Bound on length of data to read. bool bounded_; }; } // namespace sfntly #endif // SFNTLY_CPP_SRC_SFNTLY_DATA_FONT_INPUT_STREAM_H_
#include <sys/stat.h> #include <fcntl.h> #include "syscall.h" int mknod(const char *path, mode_t mode, dev_t dev) { #ifdef SYS_mknod return syscall(SYS_mknod, path, mode, dev); #else return syscall(SYS_mknodat, AT_FDCWD, path, mode, dev); #endif }
// SPDX-License-Identifier: GPL-2.0 /* * Intel BayTrail PMIC I2C bus semaphore implementaion * Copyright (c) 2014, Intel Corporation. */ #include <linux/delay.h> #include <linux/device.h> #include <linux/acpi.h> #include <linux/i2c.h> #include <linux/interrupt.h> #include <linux/pm_qos.h> #include <asm/iosf_mbi.h> #include "i2c-designware-core.h" #define SEMAPHORE_TIMEOUT 500 #define PUNIT_SEMAPHORE 0x7 #define PUNIT_SEMAPHORE_CHT 0x10e #define PUNIT_SEMAPHORE_BIT BIT(0) #define PUNIT_SEMAPHORE_ACQUIRE BIT(1) static unsigned long acquired; static u32 get_sem_addr(struct dw_i2c_dev *dev) { if (dev->flags & MODEL_CHERRYTRAIL) return PUNIT_SEMAPHORE_CHT; else return PUNIT_SEMAPHORE; } static int get_sem(struct dw_i2c_dev *dev, u32 *sem) { u32 addr = get_sem_addr(dev); u32 data; int ret; ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, addr, &data); if (ret) { dev_err(dev->dev, "iosf failed to read punit semaphore\n"); return ret; } *sem = data & PUNIT_SEMAPHORE_BIT; return 0; } static void reset_semaphore(struct dw_i2c_dev *dev) { if (iosf_mbi_modify(BT_MBI_UNIT_PMC, MBI_REG_READ, get_sem_addr(dev), 0, PUNIT_SEMAPHORE_BIT)) dev_err(dev->dev, "iosf failed to reset punit semaphore during write\n"); pm_qos_update_request(&dev->pm_qos, PM_QOS_DEFAULT_VALUE); iosf_mbi_call_pmic_bus_access_notifier_chain(MBI_PMIC_BUS_ACCESS_END, NULL); iosf_mbi_punit_release(); } static int baytrail_i2c_acquire(struct dw_i2c_dev *dev) { u32 addr; u32 sem = PUNIT_SEMAPHORE_ACQUIRE; int ret; unsigned long start, end; might_sleep(); if (!dev || !dev->dev) return -ENODEV; if (!dev->release_lock) return 0; iosf_mbi_punit_acquire(); iosf_mbi_call_pmic_bus_access_notifier_chain(MBI_PMIC_BUS_ACCESS_BEGIN, NULL); /* * Disallow the CPU to enter C6 or C7 state, entering these states * requires the punit to talk to the pmic and if this happens while * we're holding the semaphore, the SoC hangs. */ pm_qos_update_request(&dev->pm_qos, 0); addr = get_sem_addr(dev); /* host driver writes to side band semaphore register */ ret = iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE, addr, sem); if (ret) { dev_err(dev->dev, "iosf punit semaphore request failed\n"); goto out; } /* host driver waits for bit 0 to be set in semaphore register */ start = jiffies; end = start + msecs_to_jiffies(SEMAPHORE_TIMEOUT); do { ret = get_sem(dev, &sem); if (!ret && sem) { acquired = jiffies; dev_dbg(dev->dev, "punit semaphore acquired after %ums\n", jiffies_to_msecs(jiffies - start)); return 0; } usleep_range(1000, 2000); } while (time_before(jiffies, end)); dev_err(dev->dev, "punit semaphore timed out, resetting\n"); out: reset_semaphore(dev); ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, addr, &sem); if (ret) dev_err(dev->dev, "iosf failed to read punit semaphore\n"); else dev_err(dev->dev, "PUNIT SEM: %d\n", sem); WARN_ON(1); return -ETIMEDOUT; } static void baytrail_i2c_release(struct dw_i2c_dev *dev) { if (!dev || !dev->dev) return; if (!dev->acquire_lock) return; reset_semaphore(dev); dev_dbg(dev->dev, "punit semaphore held for %ums\n", jiffies_to_msecs(jiffies - acquired)); } int i2c_dw_probe_lock_support(struct dw_i2c_dev *dev) { acpi_status status; unsigned long long shared_host = 0; acpi_handle handle; if (!dev || !dev->dev) return 0; handle = ACPI_HANDLE(dev->dev); if (!handle) return 0; status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host); if (ACPI_FAILURE(status)) return 0; if (!shared_host) return 0; if (!iosf_mbi_available()) return -EPROBE_DEFER; dev_info(dev->dev, "I2C bus managed by PUNIT\n"); dev->acquire_lock = baytrail_i2c_acquire; dev->release_lock = baytrail_i2c_release; dev->pm_disabled = true; pm_qos_add_request(&dev->pm_qos, PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE); return 0; } void i2c_dw_remove_lock_support(struct dw_i2c_dev *dev) { if (dev->acquire_lock) pm_qos_remove_request(&dev->pm_qos); }
/* include readline */ #include "unp.h" ssize_t readline(int fd, void *vptr, size_t maxlen) { ssize_t n, rc; char c, *ptr; ptr = vptr; for (n = 1; n < maxlen; n++) { if ( (rc = read(fd, &c, 1)) == 1) { *ptr++ = c; if (c == '\n') break; } else if (rc == 0) { if (n == 1) return(0); /* EOF, no data read */ else break; /* EOF, some data was read */ } else return(-1); /* error */ } *ptr = 0; return(n); } /* end readline */ ssize_t Readline(int fd, void *ptr, size_t maxlen) { ssize_t n; if ( (n = readline(fd, ptr, maxlen)) == -1) err_sys("readline error"); return(n); }
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_MANAGED_MODE_SUPERVISED_USER_PREF_STORE_H_ #define CHROME_BROWSER_MANAGED_MODE_SUPERVISED_USER_PREF_STORE_H_ #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/prefs/pref_store.h" #include "chrome/browser/managed_mode/managed_users.h" namespace base { class DictionaryValue; class Value; } class ManagedUserSettingsService; class PrefValueMap; // A PrefStore that gets its values from managed user settings via the // ManagedUserSettingsService passed in at construction. class SupervisedUserPrefStore : public PrefStore { public: SupervisedUserPrefStore( ManagedUserSettingsService* managed_user_settings_service); // PrefStore overrides: virtual bool GetValue(const std::string& key, const base::Value** value) const OVERRIDE; virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE; virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE; virtual bool HasObservers() const OVERRIDE; virtual bool IsInitializationComplete() const OVERRIDE; private: virtual ~SupervisedUserPrefStore(); void OnNewSettingsAvailable(const base::DictionaryValue* settings); scoped_ptr<PrefValueMap> prefs_; ObserverList<PrefStore::Observer, true> observers_; base::WeakPtrFactory<SupervisedUserPrefStore> weak_ptr_factory_; }; #endif // CHROME_BROWSER_MANAGED_MODE_SUPERVISED_USER_PREF_STORE_H_
/* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H #include <grpc/support/port_platform.h> #include <grpc/grpc.h> #include "src/core/lib/channel/channel_stack.h" /* Start polling \a interested_parties periodically in the timer thread */ void grpc_client_channel_start_backup_polling( grpc_pollset_set* interested_parties); /* Stop polling \a interested_parties */ void grpc_client_channel_stop_backup_polling( grpc_pollset_set* interested_parties); #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H */
/**************************************************************************** * * Copyright 2016 Samsung Electronics All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * ****************************************************************************/ /************************************************************************ * libc/math/lib_fmod.c * * This file is a part of NuttX: * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Ported by: Darcy Gong * * It derives from the Rhombs OS math library by Nick Johnson which has * a compatibile, MIT-style license: * * Copyright (C) 2009-2011 Nick Johnson <nickbjohnson4224 at gmail.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ************************************************************************/ /************************************************************************ * Included Files ************************************************************************/ #include <tinyara/compiler.h> #include <math.h> /************************************************************************ * Public Functions ************************************************************************/ #ifdef CONFIG_HAVE_DOUBLE double fmod(double x, double div) { double n0; x /= div; x = modf(x, &n0); x *= div; return x; } #endif
/* * Copyright (C) 2005-2018 Team Kodi * This file is part of Kodi - https://kodi.tv * * SPDX-License-Identifier: GPL-2.0-or-later * See LICENSES/README.md for more information. */ #pragma once #include "addons/kodi-dev-kit/include/kodi/c-api/gui/dialogs/filebrowser.h" #include <string> #include <vector> class CMediaSource; typedef std::vector<CMediaSource> VECSOURCES; extern "C" { struct AddonGlobalInterface; namespace ADDON { /*! * @brief Global gui Add-on to Kodi callback functions * * To hold functions not related to a instance type and usable for * every add-on type. * * Related add-on header is "./xbmc/addons/kodi-dev-kit/include/kodi/gui/dialogs/FileBrowser.h" */ struct Interface_GUIDialogFileBrowser { static void Init(AddonGlobalInterface* addonInterface); static void DeInit(AddonGlobalInterface* addonInterface); /*! * @brief callback functions from add-on to kodi * * @note To add a new function use the "_" style to directly identify an * add-on callback function. Everything with CamelCase is only to be used * in Kodi. * * The parameter `kodiBase` is used to become the pointer for a `CAddonDll` * class. */ //@{ static bool show_and_get_directory(KODI_HANDLE kodiBase, const char* shares, const char* heading, const char* path_in, char** path_out, bool write_only); static bool show_and_get_file(KODI_HANDLE kodiBase, const char* shares, const char* mask, const char* heading, const char* path_in, char** path_out, bool use_thumbs, bool use_file_directories); static bool show_and_get_file_from_dir(KODI_HANDLE kodiBase, const char* directory, const char* mask, const char* heading, const char* path_in, char** path_out, bool use_thumbs, bool use_file_directories, bool singleList); static bool show_and_get_file_list(KODI_HANDLE kodiBase, const char* shares, const char* mask, const char* heading, char*** file_list, unsigned int* entries, bool use_thumbs, bool use_file_directories); static bool show_and_get_source(KODI_HANDLE kodiBase, const char* path_in, char** path_out, bool allow_network_shares, const char* additional_share, const char* type); static bool show_and_get_image(KODI_HANDLE kodiBase, const char* shares, const char* heading, const char* path_in, char** path_out); static bool show_and_get_image_list(KODI_HANDLE kodiBase, const char* shares, const char* heading, char*** file_list, unsigned int* entries); static void clear_file_list(KODI_HANDLE kodiBase, char*** file_list, unsigned int entries); //@} private: static void GetVECShares(VECSOURCES& vecShares, const std::string& strShares, const std::string& strPath); }; } /* namespace ADDON */ } /* extern "C" */
#ifndef __DDP_DPI_H__ #define __DDP_DPI_H__ #ifdef BUILD_UBOOT #include <asm/arch/mt65xx_typedefs.h> #else #include <mach/mt_typedefs.h> #endif #include "lcm_drv.h" #include "ddp_info.h" #include "cmdq_record.h" #ifdef __cplusplus extern "C" { #endif #define DPI_PHY_ADDR 0x14012000 #define DPI_CHECK_RET(expr) \ do { \ DPI_STATUS ret = (expr); \ ASSERT(DPI_STATUS_OK == ret); \ } while (0) // for legacy DPI Driver typedef enum { LCD_IF_PARALLEL_0 = 0, LCD_IF_PARALLEL_1 = 1, LCD_IF_PARALLEL_2 = 2, LCD_IF_SERIAL_0 = 3, LCD_IF_SERIAL_1 = 4, LCD_IF_ALL = 0xFF, } LCD_IF_ID; typedef struct { unsigned rsv_0 :4; unsigned addr :4; unsigned rsv_8 :24; } LCD_REG_CMD_ADDR, *PLCD_REG_CMD_ADDR; typedef struct { unsigned rsv_0 :4; unsigned addr :4; unsigned rsv_8 :24; } LCD_REG_DAT_ADDR, *PLCD_REG_DAT_ADDR; typedef enum { LCD_IF_FMT_COLOR_ORDER_RGB = 0, LCD_IF_FMT_COLOR_ORDER_BGR = 1, } LCD_IF_FMT_COLOR_ORDER; typedef enum { LCD_IF_FMT_TRANS_SEQ_MSB_FIRST = 0, LCD_IF_FMT_TRANS_SEQ_LSB_FIRST = 1, } LCD_IF_FMT_TRANS_SEQ; typedef enum { LCD_IF_FMT_PADDING_ON_LSB = 0, LCD_IF_FMT_PADDING_ON_MSB = 1, } LCD_IF_FMT_PADDING; typedef enum { LCD_IF_FORMAT_RGB332 = 0, LCD_IF_FORMAT_RGB444 = 1, LCD_IF_FORMAT_RGB565 = 2, LCD_IF_FORMAT_RGB666 = 3, LCD_IF_FORMAT_RGB888 = 4, } LCD_IF_FORMAT; typedef enum { LCD_IF_WIDTH_8_BITS = 0, LCD_IF_WIDTH_9_BITS = 2, LCD_IF_WIDTH_16_BITS = 1, LCD_IF_WIDTH_18_BITS = 3, LCD_IF_WIDTH_24_BITS = 4, LCD_IF_WIDTH_32_BITS = 5, } LCD_IF_WIDTH; typedef enum { DPI_STATUS_OK = 0, DPI_STATUS_ERROR, } DPI_STATUS; typedef enum { DPI_POLARITY_RISING = 0, DPI_POLARITY_FALLING = 1 } DPI_POLARITY; typedef enum { DPI_RGB_ORDER_RGB = 0, DPI_RGB_ORDER_BGR = 1, } DPI_RGB_ORDER; typedef enum { DPI_CLK_480p = 27027, DPI_CLK_480p_3D = 27027*2, DPI_CLK_720p = 74250, DPI_CLK_1080p = 148500 } DPI_CLK_FREQ; typedef struct { unsigned RGB_ORDER : 1; unsigned BYTE_ORDER : 1; unsigned PADDING : 1; unsigned DATA_FMT : 3; unsigned IF_FMT : 2; unsigned COMMAND : 5; unsigned rsv_13 : 2; unsigned ENC : 1; unsigned rsv_16 : 8; unsigned SEND_RES_MODE : 1; unsigned IF_24 : 1; unsigned rsv_6 : 6; }LCD_REG_WROI_CON, *PLCD_REG_WROI_CON; int ddp_dpi_stop(DISP_MODULE_ENUM module, void *cmdq_handle); int ddp_dpi_power_on(DISP_MODULE_ENUM module, void *cmdq_handle); int ddp_dpi_power_off(DISP_MODULE_ENUM module, void *cmdq_handle); int ddp_dpi_dump(DISP_MODULE_ENUM module, int level); int ddp_dpi_start(DISP_MODULE_ENUM module, void *cmdq); int ddp_dpi_init(DISP_MODULE_ENUM module, void *cmdq); int ddp_dpi_deinit(DISP_MODULE_ENUM module, void *cmdq_handle); int ddp_dpi_config(DISP_MODULE_ENUM module, disp_ddp_path_config *config, void *cmdq_handle); int ddp_dpi_trigger(DISP_MODULE_ENUM module, void *cmdq); int ddp_dpi_reset(DISP_MODULE_ENUM module, void *cmdq_handle); int ddp_dpi_ioctl(DISP_MODULE_ENUM module, void *cmdq_handle, unsigned int ioctl_cmd, unsigned long *params); int _Enable_Interrupt(void); typedef enum { acsRGB = 0 ,acsYCbCr422 = 1 ,acsYCbCr444 = 2 ,acsFuture = 3 }AviColorSpace_e; #ifdef __cplusplus } #endif #endif // __DPI_DRV_H__
/* * arch/arm/mach-pnx4008/include/mach/dma.h * * PNX4008 DMA header file * * Author: Vitaly Wool * Copyright: MontaVista Software Inc. (c) 2005 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __ASM_ARCH_DMA_H #define __ASM_ARCH_DMA_H #include "platform.h" #define MAX_DMA_CHANNELS 8 #define DMAC_BASE IO_ADDRESS(PNX4008_DMA_CONFIG_BASE) #define DMAC_INT_STAT (DMAC_BASE + 0x0000) #define DMAC_INT_TC_STAT (DMAC_BASE + 0x0004) #define DMAC_INT_TC_CLEAR (DMAC_BASE + 0x0008) #define DMAC_INT_ERR_STAT (DMAC_BASE + 0x000c) #define DMAC_INT_ERR_CLEAR (DMAC_BASE + 0x0010) #define DMAC_SOFT_SREQ (DMAC_BASE + 0x0024) #define DMAC_CONFIG (DMAC_BASE + 0x0030) #define DMAC_Cx_SRC_ADDR(c) (DMAC_BASE + 0x0100 + (c) * 0x20) #define DMAC_Cx_DEST_ADDR(c) (DMAC_BASE + 0x0104 + (c) * 0x20) #define DMAC_Cx_LLI(c) (DMAC_BASE + 0x0108 + (c) * 0x20) #define DMAC_Cx_CONTROL(c) (DMAC_BASE + 0x010c + (c) * 0x20) #define DMAC_Cx_CONFIG(c) (DMAC_BASE + 0x0110 + (c) * 0x20) enum { WIDTH_BYTE = 0, WIDTH_HWORD, WIDTH_WORD }; enum { FC_MEM2MEM_DMA, FC_MEM2PER_DMA, FC_PER2MEM_DMA, FC_PER2PER_DMA, FC_PER2PER_DPER, FC_MEM2PER_PER, FC_PER2MEM_PER, FC_PER2PER_SPER }; enum { DMA_INT_UNKNOWN = 0, DMA_ERR_INT = 1, DMA_TC_INT = 2, }; enum { DMA_BUFFER_ALLOCATED = 1, DMA_HAS_LL = 2, }; enum { PER_CAM_DMA_1 = 0, PER_NDF_FLASH = 1, PER_MBX_SLAVE_FIFO = 2, PER_SPI2_REC_XMIT = 3, PER_MS_SD_RX_XMIT = 4, PER_HS_UART_1_XMIT = 5, PER_HS_UART_1_RX = 6, PER_HS_UART_2_XMIT = 7, PER_HS_UART_2_RX = 8, PER_HS_UART_7_XMIT = 9, PER_HS_UART_7_RX = 10, PER_SPI1_REC_XMIT = 11, PER_MLC_NDF_SREC = 12, PER_CAM_DMA_2 = 13, PER_PRNG_INFIFO = 14, PER_PRNG_OUTFIFO = 15, }; struct pnx4008_dma_ch_ctrl { int tc_mask; int cacheable; int bufferable; int priv_mode; int di; int si; int dest_ahb1; int src_ahb1; int dwidth; int swidth; int dbsize; int sbsize; int tr_size; }; struct pnx4008_dma_ch_config { int halt; int active; int lock; int itc; int ie; int flow_cntrl; int dest_per; int src_per; }; struct pnx4008_dma_ll { unsigned long src_addr; unsigned long dest_addr; u32 next_dma; unsigned long ch_ctrl; struct pnx4008_dma_ll *next; int flags; void *alloc_data; int (*free) (void *); }; struct pnx4008_dma_config { int is_ll; unsigned long src_addr; unsigned long dest_addr; unsigned long ch_ctrl; unsigned long ch_cfg; struct pnx4008_dma_ll *ll; u32 ll_dma; int flags; void *alloc_data; int (*free) (void *); }; extern struct pnx4008_dma_ll *pnx4008_alloc_ll_entry(dma_addr_t *); extern void pnx4008_free_ll_entry(struct pnx4008_dma_ll *, dma_addr_t); extern void pnx4008_free_ll(u32 ll_dma, struct pnx4008_dma_ll *); extern int pnx4008_request_channel(char *, int, void (*)(int, int, void *), void *); extern void pnx4008_free_channel(int); extern int pnx4008_config_dma(int, int, int); extern int pnx4008_dma_pack_control(const struct pnx4008_dma_ch_ctrl *, unsigned long *); extern int pnx4008_dma_parse_control(unsigned long, struct pnx4008_dma_ch_ctrl *); extern int pnx4008_dma_pack_config(const struct pnx4008_dma_ch_config *, unsigned long *); extern int pnx4008_dma_parse_config(unsigned long, struct pnx4008_dma_ch_config *); extern int pnx4008_config_channel(int, struct pnx4008_dma_config *); extern int pnx4008_channel_get_config(int, struct pnx4008_dma_config *); extern int pnx4008_dma_ch_enable(int); extern int pnx4008_dma_ch_disable(int); extern int pnx4008_dma_ch_enabled(int); extern void pnx4008_dma_split_head_entry(struct pnx4008_dma_config *, struct pnx4008_dma_ch_ctrl *); extern void pnx4008_dma_split_ll_entry(struct pnx4008_dma_ll *, struct pnx4008_dma_ch_ctrl *); #endif /* _ASM_ARCH_DMA_H */
/* * Samsung Exynos5 SoC series Sensor driver * * * Copyright (c) 2011 Samsung Electronics Co., Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef FIMC_IS_DEVICE_8B1_H #define FIMC_IS_DEVICE_8B1_H #define SENSOR_S5K8B1_INSTANCE 1 #define SENSOR_S5K8B1_NAME SENSOR_NAME_S5K8B1 #if defined(CONFIG_SOC_EXYNOS5430) #define SENSOR_S5K8B1_DRIVING #endif struct fimc_is_module_8b1 { u16 vis_duration; u16 frame_length_line; u32 line_length_pck; u32 system_clock; }; int sensor_8b1_probe(struct i2c_client *client, const struct i2c_device_id *id); #endif
// // ChooseGradeViewController.h // FindMe // // Created by mac on 14-4-30. // Copyright (c) 2014年 mac. All rights reserved. // #import <UIKit/UIKit.h> #import "User.h" @interface ChooseGradeViewController : UIViewController<UITableViewDataSource,UITableViewDelegate> { } @property (weak, nonatomic) IBOutlet UITableView *tableView; @property(nonatomic)NSInteger lastestYear; @property(strong,nonatomic)User *user; @end
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include <grpc/support/port_platform.h> #ifdef GPR_WINDOWS #include "src/core/lib/iomgr/workqueue.h" // Minimal implementation of grpc_workqueue for Windows // Works by directly enqueuing workqueue items onto the current execution // context, which is at least correct, if not performant or in the spirit of // workqueues. #ifdef GRPC_WORKQUEUE_REFCOUNT_DEBUG grpc_workqueue *grpc_workqueue_ref(grpc_workqueue *workqueue, const char *file, int line, const char *reason) { return workqueue; } void grpc_workqueue_unref(grpc_exec_ctx *exec_ctx, grpc_workqueue *workqueue, const char *file, int line, const char *reason) {} #else grpc_workqueue *grpc_workqueue_ref(grpc_workqueue *workqueue) { return workqueue; } void grpc_workqueue_unref(grpc_exec_ctx *exec_ctx, grpc_workqueue *workqueue) {} #endif grpc_closure_scheduler *grpc_workqueue_scheduler(grpc_workqueue *workqueue) { return grpc_schedule_on_exec_ctx; } #endif /* GPR_WINDOWS */
/* Capstone Disassembly Engine */ /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */ #if defined(CAPSTONE_HAS_OSXKERNEL) #include <libkern/libkern.h> #else #include <stdio.h> #include <stdlib.h> #endif #include <string.h> #include "MCInst.h" #include "utils.h" #define MCINST_CACHE (ARR_SIZE(mcInst->Operands) - 1) void MCInst_Init(MCInst *inst) { inst->OpcodePub = 0; inst->size = 0; inst->has_imm = false; inst->op1_size = 0; inst->writeback = false; } void MCInst_clear(MCInst *inst) { inst->size = 0; } // do not free @Op void MCInst_insert0(MCInst *inst, int index, MCOperand *Op) { int i; for(i = inst->size; i > index; i--) //memcpy(&(inst->Operands[i]), &(inst->Operands[i-1]), sizeof(MCOperand)); inst->Operands[i] = inst->Operands[i-1]; inst->Operands[index] = *Op; inst->size++; } void MCInst_setOpcode(MCInst *inst, unsigned Op) { inst->Opcode = Op; } void MCInst_setOpcodePub(MCInst *inst, unsigned Op) { inst->OpcodePub = Op; } unsigned MCInst_getOpcode(const MCInst *inst) { return inst->Opcode; } unsigned MCInst_getOpcodePub(const MCInst *inst) { return inst->OpcodePub; } MCOperand *MCInst_getOperand(MCInst *inst, unsigned i) { return &inst->Operands[i]; } unsigned MCInst_getNumOperands(const MCInst *inst) { return inst->size; } // This addOperand2 function doesnt free Op void MCInst_addOperand2(MCInst *inst, MCOperand *Op) { inst->Operands[inst->size] = *Op; inst->size++; } void MCOperand_Init(MCOperand *op) { op->Kind = kInvalid; op->FPImmVal = 0.0; } bool MCOperand_isValid(const MCOperand *op) { return op->Kind != kInvalid; } bool MCOperand_isReg(const MCOperand *op) { return op->Kind == kRegister; } bool MCOperand_isImm(const MCOperand *op) { return op->Kind == kImmediate; } bool MCOperand_isFPImm(const MCOperand *op) { return op->Kind == kFPImmediate; } /// getReg - Returns the register number. unsigned MCOperand_getReg(const MCOperand *op) { return op->RegVal; } /// setReg - Set the register number. void MCOperand_setReg(MCOperand *op, unsigned Reg) { op->RegVal = Reg; } int64_t MCOperand_getImm(MCOperand *op) { return op->ImmVal; } void MCOperand_setImm(MCOperand *op, int64_t Val) { op->ImmVal = Val; } double MCOperand_getFPImm(const MCOperand *op) { return op->FPImmVal; } void MCOperand_setFPImm(MCOperand *op, double Val) { op->FPImmVal = Val; } MCOperand *MCOperand_CreateReg1(MCInst *mcInst, unsigned Reg) { MCOperand *op = &(mcInst->Operands[MCINST_CACHE]); op->Kind = kRegister; op->RegVal = Reg; return op; } void MCOperand_CreateReg0(MCInst *mcInst, unsigned Reg) { MCOperand *op = &(mcInst->Operands[mcInst->size]); mcInst->size++; op->Kind = kRegister; op->RegVal = Reg; } MCOperand *MCOperand_CreateImm1(MCInst *mcInst, int64_t Val) { MCOperand *op = &(mcInst->Operands[MCINST_CACHE]); op->Kind = kImmediate; op->ImmVal = Val; return op; } void MCOperand_CreateImm0(MCInst *mcInst, int64_t Val) { MCOperand *op = &(mcInst->Operands[mcInst->size]); mcInst->size++; op->Kind = kImmediate; op->ImmVal = Val; }
// // TRVSXCTestAsync.h // TRVSXCTestAsyncExample // // Created by Travis Jeffery on 10/11/13. // Copyright (c) 2013 Travis Jeffery. All rights reserved. // #import <Foundation/Foundation.h> @class TRVSMonitor; typedef void (^TRVSMonitorHandler)(TRVSMonitor *monitor); /** * `TRVSMonitor` is a synchronization construct to make asynchronous testing simple. A `TRVSMonitor` is initialized with a signal count and can wait until it has been signalled its signal count. */ @interface TRVSMonitor : NSObject /** * Creates and returns a `TRVSMonitor` with signal count of 1. */ + (instancetype)monitor; /** * Initializes and returns a `TRVSMonitor` with signal count of 1. */ - (instancetype)init; /** * Initializes and returns a `TRVSMonitor` with the specified expected signal count. * * This is the designated initializer. * * @param expectedSignalCount The number of times the `TRVSMonitor` needs to be signalled before it will stop waiting. * * @return The newly-initialized monitor. */ - (instancetype)initWithExpectedSignalCount:(NSInteger)expectedSignalCount; /** * Prevents following statements from executing until the `TRVSMonitor` is signalled its expected signal count. * * @return YES */ - (BOOL)wait; /** * Will timeout and continue executing after the specified time interval. * * @param timeout The time interval that the `TRVSMonitor` will timeout after. * * @return NO if the `TRVSMonitor` timed out, YES otherwise. * * @see wait */ - (BOOL)waitWithTimeout:(NSTimeInterval)timeout; /** * Will continually execute the specified block in-between short time intervals. * * @param handler A block object to be executed in-between short time intervals. * * @return YES * * @see wait */ - (BOOL)waitWithSignalHandler:(TRVSMonitorHandler)handler; /** * @see wait * @see waitWithTimeout: * @see waitWIthSignalHandler: */ - (BOOL)waitWithTimeout:(NSTimeInterval)timeout signalHandler:(TRVSMonitorHandler)handler; /** * What you message the `TRVSMonitor` as many times as the number of its expected signal count. Typically is called in an asynchronously executing block. */ - (void)signal; @end
/* LUFA Library Copyright (C) Dean Camera, 2014. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ /** \file * \brief Board specific LED driver header for the Bitwizard Multio. * \copydetails Group_LEDs_MULTIO * * \note This file should not be included directly. It is automatically included as needed by the LEDs driver * dispatch header located in LUFA/Drivers/Board/LEDs.h. */ /** \ingroup Group_LEDs * \defgroup Group_LEDs_MULTIO MULTIO * \brief Board specific LED driver header for the Bitwizard Multio. * * Board specific LED driver header for the Bitwizard Multio (http://www.bitwizard.nl/wiki/index.php/USB-multio). * * <table> * <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr> * <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.0</td></tr> * <tr><td>LEDS_LED2</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTC.2</td></tr> * <tr><td>LEDS_LED3</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.7</td></tr> * </table> * * @{ */ #ifndef __LEDS_MULTIO_H__ #define __LEDS_MULTIO_H__ /* Includes: */ #include "../../../../Common/Common.h" /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { #endif /* Preprocessor Checks: */ #if !defined(__INCLUDE_FROM_LEDS_H) #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #endif /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) /* Macros: */ #define LEDS_PORTD_LEDS (LEDS_LED1 | LEDS_LED3) #define LEDS_PORTC_LEDS LEDS_LED2 #endif /* Public Interface - May be used in end-application: */ /* Macros: */ /** LED mask for the first LED on the board. */ #define LEDS_LED1 (1 << 0) /** LED mask for the second LED on the board. */ #define LEDS_LED2 (1 << 2) /** LED mask for the second LED on the board. */ #define LEDS_LED3 (1 << 7) /** LED mask for all the LEDs on the board. */ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3) /** LED mask for none of the board LEDs. */ #define LEDS_NO_LEDS 0 /* Inline Functions: */ #if !defined(__DOXYGEN__) static inline void LEDs_Init(void) { DDRD |= LEDS_PORTD_LEDS; DDRC |= LEDS_PORTC_LEDS; PORTD &= ~LEDS_PORTD_LEDS; PORTC &= ~LEDS_PORTC_LEDS; } static inline void LEDs_Disable(void) { DDRD &= ~LEDS_PORTD_LEDS; DDRC &= ~LEDS_PORTC_LEDS; PORTD &= ~LEDS_PORTD_LEDS; PORTC &= ~LEDS_PORTC_LEDS; } static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD |= (LEDMask & LEDS_PORTD_LEDS); PORTC |= (LEDMask & LEDS_PORTC_LEDS); } static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) { PORTD &= ~(LEDMask & LEDS_PORTD_LEDS); PORTC &= ~(LEDMask & LEDS_PORTC_LEDS); } static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) { PORTD = (PORTD & ~LEDS_PORTD_LEDS) | (LEDMask & LEDS_PORTD_LEDS); PORTC = (PORTC & ~LEDS_PORTC_LEDS) | (LEDMask & LEDS_PORTC_LEDS); } static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask) { PORTD = (PORTD & ~(LEDMask & LEDS_PORTD_LEDS)) | (ActiveMask & LEDS_PORTD_LEDS); PORTC = (PORTC & ~(LEDMask & LEDS_PORTC_LEDS)) | (ActiveMask & LEDS_PORTC_LEDS); } static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { PIND = (LEDMask & LEDS_PORTD_LEDS); PINC = (LEDMask & LEDS_PORTC_LEDS); } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) { return ((PORTD & LEDS_PORTD_LEDS) | (PORTC & LEDS_PORTC_LEDS)); } #endif /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) } #endif #endif /** @} */
#include <tommath.h> #ifdef BN_MP_DIV_2_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = a/2 */ int mp_div_2 MPA(mp_int * a, mp_int * b) { int x, res, oldused; /* copy */ if (b->alloc < a->used) { if ((res = mp_grow (MPST, b, a->used)) != MP_OKAY) { return res; } } oldused = b->used; b->used = a->used; { register mp_digit r, rr, *tmpa, *tmpb; /* source alias */ tmpa = a->dp + b->used - 1; /* dest alias */ tmpb = b->dp + b->used - 1; /* carry */ r = 0; for (x = b->used - 1; x >= 0; x--) { /* get the carry for the next iteration */ rr = *tmpa & 1; /* shift the current digit, add in carry and store */ *tmpb-- = (*tmpa-- >> 1) | (r << (DIGIT_BIT - 1)); /* forward carry to next iteration */ r = rr; } /* zero excess digits */ tmpb = b->dp + b->used; for (x = b->used; x < oldused; x++) { *tmpb++ = 0; } } b->sign = a->sign; mp_clamp (b); return MP_OKAY; } #endif /* $Source: /cvs/libtom/libtommath/bn_mp_div_2.c,v $ */ /* $Revision: 1.4 $ */ /* $Date: 2006/12/28 01:25:13 $ */
/* SuperCollider real time audio synthesis system Copyright (c) 2002 James McCartney. All rights reserved. http://www.audiosynth.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _SC_WireSpec_ #define _SC_WireSpec_ #include "SC_Types.h" struct InputSpec { // read from file: int32 mFromUnitIndex; // changed from int16, ver 2 int32 mFromOutputIndex; // changed from int16, ver 2 // computed: int32 mWireIndex; // changed from int16, ver 2 }; typedef struct InputSpec InputSpec; struct OutputSpec { // read from file: int16 mCalcRate; // computed: int32 mWireIndex; // changed from uint16, ver 2 int64 mBufferIndex; uint32 mNumConsumers; }; typedef struct OutputSpec OutputSpec; #endif
/**************************************************************************** * * Copyright 2016 Samsung Electronics All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * arch/arm/include/watchdog.h * * Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ #ifndef __ARCH_ARM_INCLUDE_WATCHDOG_H #define __ARCH_ARM_INCLUDE_WATCHDOG_H /**************************************************************************** * Included Files ****************************************************************************/ #include <tinyara/fs/ioctl.h> /**************************************************************************** * Definitions ****************************************************************************/ /**************************************************************************** * Private Data ****************************************************************************/ /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ #endif /* __ARCH_ARM_INCLUDE_WATCHDOG_H */
#ifndef CRYPTOPP_NR_H #define CRYPTOPP_NR_H #include "gfpcrypt.h" #endif
/* Copyright (c) 2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef MSM_HDMI_HDCP_MGR_H #define MSM_HDMI_HDCP_MGR_H enum DS_TYPE { DS_UNKNOWN, DS_RECEIVER, DS_REPEATER, }; enum { MSG_ID_IDX, RET_CODE_IDX, HEADER_LEN, }; enum RET_CODE { HDCP_NOT_AUTHED, HDCP_AUTHED, HDCP_DISABLE, }; enum MSG_ID { DOWN_CHECK_TOPOLOGY, UP_REQUEST_TOPOLOGY, UP_SEND_TOPOLOGY, DOWN_REQUEST_TOPOLOGY, MSG_NUM, }; enum SOURCE_ID { HDCP_V1_TX, HDCP_V1_RX, HDCP_V2_RX, HDCP_V2_TX, SRC_NUM, }; struct HDCP_V2V1_MSG_TOPOLOGY { uint32_t ds_type; uint8_t bksv[5]; uint8_t dev_count; uint8_t depth; uint8_t ksv_list[5 * 127]; uint32_t max_cascade_exceeded; uint32_t max_dev_exceeded; }; #endif
/* * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * File: wpactl.h * * Purpose: * * Author: Lyndon Chen * * Date: March 1, 2005 * */ #ifndef __WPACTL_H__ #define __WPACTL_H__ #include "device.h" #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT #include "iowpa.h" #endif typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg; typedef enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP, CIPHER_WEP104 } wpa_cipher; typedef enum { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE, KEY_MGMT_802_1X_NO_WPA, KEY_MGMT_WPA_NONE, KEY_MGMT_CCKM } wpa_key_mgmt; #define AUTH_ALG_OPEN_SYSTEM 0x01 #define AUTH_ALG_SHARED_KEY 0x02 #define AUTH_ALG_LEAP 0x04 #define GENERIC_INFO_ELEM 0xdd #define RSN_INFO_ELEM 0x30 typedef unsigned long long NDIS_802_11_KEY_RSC; int wpa_set_wpadev(PSDevice pDevice, int val); int wpa_ioctl(PSDevice pDevice, struct iw_point *p); int wpa_set_keys(PSDevice pDevice, void *ctx, BOOL fcpfkernel); #endif
/* * Derived from include/asm-powerpc/iommu.h * * Copyright IBM Corporation, 2006-2007 * * Author: Jon Mason <jdmason@us.ibm.com> * Author: Muli Ben-Yehuda <muli@il.ibm.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _ASM_X86_CALGARY_H #define _ASM_X86_CALGARY_H #include <linux/spinlock.h> #include <linux/device.h> #include <linux/dma-mapping.h> #include <linux/timer.h> #include <asm/types.h> struct iommu_table { struct cal_chipset_ops *chip_ops; unsigned long it_base; unsigned long it_hint; unsigned long *it_map; void __iomem *bbar; u64 tar_val; struct timer_list watchdog_timer; spinlock_t it_lock; unsigned int it_size; unsigned char it_busno; }; struct cal_chipset_ops { void (*handle_quirks)(struct iommu_table *tbl, struct pci_dev *dev); void (*tce_cache_blast)(struct iommu_table *tbl); void (*dump_error_regs)(struct iommu_table *tbl); }; #define TCE_TABLE_SIZE_UNSPECIFIED ~0 #define TCE_TABLE_SIZE_64K 0 #define TCE_TABLE_SIZE_128K 1 #define TCE_TABLE_SIZE_256K 2 #define TCE_TABLE_SIZE_512K 3 #define TCE_TABLE_SIZE_1M 4 #define TCE_TABLE_SIZE_2M 5 #define TCE_TABLE_SIZE_4M 6 #define TCE_TABLE_SIZE_8M 7 extern int use_calgary; #ifdef CONFIG_CALGARY_IOMMU extern int detect_calgary(void); #else static inline int detect_calgary(void) { return -ENODEV; } #endif #endif
/* * getsectsize.c --- get the sector size of a device. * * Copyright (C) 1995, 1995 Theodore Ts'o. * Copyright (C) 2003 VMware, Inc. * * %Begin-Header% * This file may be redistributed under the terms of the GNU Library * General Public License, version 2. * %End-Header% */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #include <stdio.h> #if HAVE_UNISTD_H #include <unistd.h> #endif #if HAVE_ERRNO_H #include <errno.h> #endif #include <fcntl.h> #ifdef HAVE_LINUX_FD_H #include <sys/ioctl.h> #include <linux/fd.h> #endif #if defined(__linux__) && defined(_IO) #if !defined(BLKSSZGET) #define BLKSSZGET _IO(0x12,104)/* get block device sector size */ #endif #if !defined(BLKPBSZGET) #define BLKPBSZGET _IO(0x12,123)/* get block physical sector size */ #endif #endif #include "ext2_fs.h" #include "ext2fs.h" /* * Returns the logical sector size of a device */ errcode_t ext2fs_get_device_sectsize(const char *file, int *sectsize) { int fd; #ifdef HAVE_OPEN64 fd = open64(file, O_RDONLY); #else fd = open(file, O_RDONLY); #endif if (fd < 0) return errno; #ifdef BLKSSZGET if (ioctl(fd, BLKSSZGET, sectsize) >= 0) { close(fd); return 0; } #endif *sectsize = 0; close(fd); return 0; } /* * Returns the physical sector size of a device */ errcode_t ext2fs_get_device_phys_sectsize(const char *file, int *sectsize) { int fd; #ifdef HAVE_OPEN64 fd = open64(file, O_RDONLY); #else fd = open(file, O_RDONLY); #endif if (fd < 0) return errno; #ifdef BLKPBSZGET if (ioctl(fd, BLKPBSZGET, sectsize) >= 0) { close(fd); return 0; } #endif *sectsize = 0; close(fd); return 0; }
#ifndef PERF_LINUX_LINKAGE_H_ #define PERF_LINUX_LINKAGE_H_ #define ENTRY(name) \ .globl name; \ name: #define ENDPROC(name) #endif
/* * Copyright (C) 1999, 2000, 2004 MIPS Technologies, Inc. * All rights reserved. * Authors: Carsten Langgaard <carstenl@mips.com> * Maciej W. Rozycki <macro@mips.com> * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ #include <linux/types.h> #include <linux/pci.h> #include <linux/kernel.h> #include <asm/gt64120.h> #define PCI_ACCESS_READ 0 #define PCI_ACCESS_WRITE 1 /* * PCI configuration cycle AD bus definition */ /* Type 0 */ #define PCI_CFG_TYPE0_REG_SHF 0 #define PCI_CFG_TYPE0_FUNC_SHF 8 /* Type 1 */ #define PCI_CFG_TYPE1_REG_SHF 0 #define PCI_CFG_TYPE1_FUNC_SHF 8 #define PCI_CFG_TYPE1_DEV_SHF 11 #define PCI_CFG_TYPE1_BUS_SHF 16 static int gt64120_pcibios_config_access(unsigned char access_type, struct pci_bus *bus, unsigned int devfn, int where, u32 * data) { unsigned char busnum = bus->number; u32 intr; if ((busnum == 0) && (devfn >= PCI_DEVFN(31, 0))) return -1; /* Because of a bug in the galileo (for slot 31). */ /* Clear cause register bits */ GT_WRITE(GT_INTRCAUSE_OFS, ~(GT_INTRCAUSE_MASABORT0_BIT | GT_INTRCAUSE_TARABORT0_BIT)); /* Setup address */ GT_WRITE(GT_PCI0_CFGADDR_OFS, (busnum << GT_PCI0_CFGADDR_BUSNUM_SHF) | (devfn << GT_PCI0_CFGADDR_FUNCTNUM_SHF) | ((where / 4) << GT_PCI0_CFGADDR_REGNUM_SHF) | GT_PCI0_CFGADDR_CONFIGEN_BIT); if (access_type == PCI_ACCESS_WRITE) { if (busnum == 0 && PCI_SLOT(devfn) == 0) { /* * The Galileo system controller is acting * differently than other devices. */ GT_WRITE(GT_PCI0_CFGDATA_OFS, *data); } else __GT_WRITE(GT_PCI0_CFGDATA_OFS, *data); } else { if (busnum == 0 && PCI_SLOT(devfn) == 0) { /* * The Galileo system controller is acting * differently than other devices. */ *data = GT_READ(GT_PCI0_CFGDATA_OFS); } else *data = __GT_READ(GT_PCI0_CFGDATA_OFS); } /* Check for master or target abort */ intr = GT_READ(GT_INTRCAUSE_OFS); if (intr & (GT_INTRCAUSE_MASABORT0_BIT | GT_INTRCAUSE_TARABORT0_BIT)) { /* Error occurred */ /* Clear bits */ GT_WRITE(GT_INTRCAUSE_OFS, ~(GT_INTRCAUSE_MASABORT0_BIT | GT_INTRCAUSE_TARABORT0_BIT)); return -1; } return 0; } /* * We can't address 8 and 16 bit words directly. Instead we have to * read/write a 32bit word and mask/modify the data we actually want. */ static int gt64120_pcibios_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val) { u32 data = 0; if (gt64120_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, &data)) return PCIBIOS_DEVICE_NOT_FOUND; if (size == 1) *val = (data >> ((where & 3) << 3)) & 0xff; else if (size == 2) *val = (data >> ((where & 3) << 3)) & 0xffff; else *val = data; return PCIBIOS_SUCCESSFUL; } static int gt64120_pcibios_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val) { u32 data = 0; if (size == 4) data = val; else { if (gt64120_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, &data)) return PCIBIOS_DEVICE_NOT_FOUND; if (size == 1) data = (data & ~(0xff << ((where & 3) << 3))) | (val << ((where & 3) << 3)); else if (size == 2) data = (data & ~(0xffff << ((where & 3) << 3))) | (val << ((where & 3) << 3)); } if (gt64120_pcibios_config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data)) return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_SUCCESSFUL; } struct pci_ops gt64120_pci_ops = { .read = gt64120_pcibios_read, .write = gt64120_pcibios_write };
/* Copyright (C) 2007-2014 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "bid_conf.h" #include "bid_functions.h" #include "bid_gcc_intrinsics.h" _Decimal64 __bid_muldd3 (_Decimal64 x, _Decimal64 y) { union decimal64 ux, uy, res; ux.d = x; uy.d = y; res.i = __bid64_mul (ux.i, uy.i); return (res.d); }
/* * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ FILE_LICENCE ( GPL2_OR_LATER ); #include <stdarg.h> #include <string.h> #include <errno.h> #include <gpxe/xfer.h> #include <gpxe/uri.h> #include <gpxe/socket.h> #include <gpxe/open.h> /** @file * * Data transfer interface opening * */ /** * Open URI * * @v xfer Data transfer interface * @v uri URI * @ret rc Return status code * * The URI will be regarded as being relative to the current working * URI (see churi()). */ int xfer_open_uri ( struct xfer_interface *xfer, struct uri *uri ) { struct uri_opener *opener; struct uri *resolved_uri; int rc = -ENOTSUP; /* Resolve URI */ resolved_uri = resolve_uri ( cwuri, uri ); if ( ! resolved_uri ) return -ENOMEM; /* Find opener which supports this URI scheme */ for_each_table_entry ( opener, URI_OPENERS ) { if ( strcmp ( resolved_uri->scheme, opener->scheme ) == 0 ) { DBGC ( xfer, "XFER %p opening %s URI\n", xfer, opener->scheme ); rc = opener->open ( xfer, resolved_uri ); goto done; } } DBGC ( xfer, "XFER %p attempted to open unsupported URI scheme " "\"%s\"\n", xfer, resolved_uri->scheme ); done: uri_put ( resolved_uri ); return rc; } /** * Open URI string * * @v xfer Data transfer interface * @v uri_string URI string (e.g. "http://etherboot.org/kernel") * @ret rc Return status code * * The URI will be regarded as being relative to the current working * URI (see churi()). */ int xfer_open_uri_string ( struct xfer_interface *xfer, const char *uri_string ) { struct uri *uri; int rc; DBGC ( xfer, "XFER %p opening URI %s\n", xfer, uri_string ); uri = parse_uri ( uri_string ); if ( ! uri ) return -ENOMEM; rc = xfer_open_uri ( xfer, uri ); uri_put ( uri ); return rc; } /** * Open socket * * @v xfer Data transfer interface * @v semantics Communication semantics (e.g. SOCK_STREAM) * @v peer Peer socket address * @v local Local socket address, or NULL * @ret rc Return status code */ int xfer_open_socket ( struct xfer_interface *xfer, int semantics, struct sockaddr *peer, struct sockaddr *local ) { struct socket_opener *opener; DBGC ( xfer, "XFER %p opening (%s,%s) socket\n", xfer, socket_semantics_name ( semantics ), socket_family_name ( peer->sa_family ) ); for_each_table_entry ( opener, SOCKET_OPENERS ) { if ( ( opener->semantics == semantics ) && ( opener->family == peer->sa_family ) ) { return opener->open ( xfer, peer, local ); } } DBGC ( xfer, "XFER %p attempted to open unsupported socket type " "(%s,%s)\n", xfer, socket_semantics_name ( semantics ), socket_family_name ( peer->sa_family ) ); return -ENOTSUP; } /** * Open location * * @v xfer Data transfer interface * @v type Location type * @v args Remaining arguments depend upon location type * @ret rc Return status code */ int xfer_vopen ( struct xfer_interface *xfer, int type, va_list args ) { switch ( type ) { case LOCATION_URI_STRING: { const char *uri_string = va_arg ( args, const char * ); return xfer_open_uri_string ( xfer, uri_string ); } case LOCATION_URI: { struct uri *uri = va_arg ( args, struct uri * ); return xfer_open_uri ( xfer, uri ); } case LOCATION_SOCKET: { int semantics = va_arg ( args, int ); struct sockaddr *peer = va_arg ( args, struct sockaddr * ); struct sockaddr *local = va_arg ( args, struct sockaddr * ); return xfer_open_socket ( xfer, semantics, peer, local ); } default: DBGC ( xfer, "XFER %p attempted to open unsupported location " "type %d\n", xfer, type ); return -ENOTSUP; } } /** * Open location * * @v xfer Data transfer interface * @v type Location type * @v ... Remaining arguments depend upon location type * @ret rc Return status code */ int xfer_open ( struct xfer_interface *xfer, int type, ... ) { va_list args; int rc; va_start ( args, type ); rc = xfer_vopen ( xfer, type, args ); va_end ( args ); return rc; } /** * Reopen location * * @v xfer Data transfer interface * @v type Location type * @v args Remaining arguments depend upon location type * @ret rc Return status code * * This will close the existing connection and open a new connection * using xfer_vopen(). It is intended to be used as a .vredirect * method handler. */ int xfer_vreopen ( struct xfer_interface *xfer, int type, va_list args ) { /* Close existing connection */ xfer_close ( xfer, 0 ); /* Open new location */ return xfer_vopen ( xfer, type, args ); }
//===-- Interpreter.h - Abstract Execution Engine Interface -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file forces the interpreter to link in on certain operating systems. // (Windows). // //===----------------------------------------------------------------------===// #ifndef EXECUTION_ENGINE_INTERPRETER_H #define EXECUTION_ENGINE_INTERPRETER_H #include "llvm/ExecutionEngine/ExecutionEngine.h" #include <cstdlib> extern "C" void LLVMLinkInInterpreter(); namespace { struct ForceInterpreterLinking { ForceInterpreterLinking() { // We must reference the passes in such a way that compilers will not // delete it all as dead code, even with whole program optimization, // yet is effectively a NO-OP. As the compiler isn't smart enough // to know that getenv() never returns -1, this will do the job. if (std::getenv("bar") != (char*) -1) return; LLVMLinkInInterpreter(); } } ForceInterpreterLinking; } #endif
/* $NoKeywords:$ */ /** * @file * * AMD Family_15 Orochi thermal initialization related functions and structures * * Performs processor thermal initialization. * * @xrefitem bom "File Content Label" "Release Content" * @e project: AGESA * @e sub-project: CPU/Family/0x15/OR * @e \$Revision: 45341 $ @e \$Date: 2011-01-14 15:49:18 -0700 (Fri, 14 Jan 2011) $ * */ /* ****************************************************************************** * * Copyright (C) 2012 Advanced Micro Devices, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Advanced Micro Devices, Inc. nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ #ifndef _CPU_F15_OR_SOFTWARE_THERMAL_H_ #define _CPU_F15_OR_SOFTWARE_THERMAL_H_ /*--------------------------------------------------------------------------------------- * M I X E D (Definitions And Macros / Typedefs, Structures, Enums) *--------------------------------------------------------------------------------------- */ /*--------------------------------------------------------------------------------------- * D E F I N I T I O N S A N D M A C R O S *--------------------------------------------------------------------------------------- */ /*--------------------------------------------------------------------------------------- * T Y P E D E F S, S T R U C T U R E S, E N U M S *--------------------------------------------------------------------------------------- */ /*--------------------------------------------------------------------------------------- * F U N C T I O N P R O T O T Y P E *--------------------------------------------------------------------------------------- */ VOID F15OrPmThermalInit ( IN CPU_SPECIFIC_SERVICES *FamilySpecificServices, IN AMD_CPU_EARLY_PARAMS *CpuEarlyParamsPtr, IN AMD_CONFIG_PARAMS *StdHeader ); #endif // _CPU_F15_OR_SOFTWARE_THERMAL_H_
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef NDBMEMCACHE_HASH_ITEM_UTIL_H #define NDBMEMCACHE_HASH_ITEM_UTIL_H #include <sys/types.h> #include <stdint.h> #include <memcached/engine.h> #include "ndbmemcache_global.h" #define ITEM_WITH_CAS 1 struct default_engine; // forward reference; needed in items.h DECLARE_FUNCTIONS_WITH_C_LINKAGE #include "items.h" uint32_t hash_item_get_flags(const hash_item *item); rel_time_t hash_item_get_exptime(const hash_item *item); uint16_t hash_item_get_key_len(const hash_item *item); uint32_t hash_item_get_data_len(const hash_item *item); char * hash_item_get_key(const hash_item *item); char * hash_item_get_data(const hash_item *item); uint64_t hash_item_get_cas(const hash_item* item); uint64_t * hash_item_get_cas_ptr(const hash_item* item); void hash_item_set_cas(hash_item* item, uint64_t val); END_FUNCTIONS_WITH_C_LINKAGE #endif
/* { dg-do compile } */ /* { dg-options "-O2 -Wno-attributes -mfpmath=sse -mfma" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ #define TYPE float #include "fma_3.h" /* { dg-final { scan-assembler-times "vfmadd132ss" 4 } } */ /* { dg-final { scan-assembler-times "vfmadd231ss" 4 } } */ /* { dg-final { scan-assembler-times "vfmsub132ss" 4 } } */ /* { dg-final { scan-assembler-times "vfmsub231ss" 4 } } */ /* { dg-final { scan-assembler-times "vfnmadd132ss" 4 } } */ /* { dg-final { scan-assembler-times "vfnmadd231ss" 4 } } */ /* { dg-final { scan-assembler-times "vfnmsub132ss" 4 } } */ /* { dg-final { scan-assembler-times "vfnmsub231ss" 4 } } */
/* Copyright 2012 Jun Wako <wakojun@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include "config_common.h" /* USB Device descriptor parameter */ #define VENDOR_ID 0x4335 #define PRODUCT_ID 0x0002 #define DEVICE_VER 0x0003 #define MANUFACTURER SATAN #define PRODUCT GH60 Satan /* key matrix size */ #define MATRIX_ROWS 5 #define MATRIX_COLS 14 // ROWS: Top to bottom, COLS: Left to right #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3 } #define UNUSED_PINS #define LED_CAPS_LOCK_PIN B2 #define LED_PIN_ON_STATE 0 #define BACKLIGHT_PIN B6 /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE /* Backlight configuration */ #define BACKLIGHT_LEVELS 4 /* Underglow configuration */ #define RGB_DI_PIN E2 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 /* * Feature disable options * These options are also useful to firmware size reduction. */ /* disable debug print */ //#define NO_DEBUG /* disable print */ //#define NO_PRINT /* disable action features */ //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION
/* { dg-require-effective-target vect_int } */ #include <stdarg.h> #include "tree-vect.h" #define N 32 typedef struct { unsigned char a; unsigned char b; } s; typedef struct { unsigned int a; unsigned int b; } ii; __attribute__ ((noinline)) int main1 (s *arr, ii *iarr) { s *ptr = arr; ii *iptr = iarr; s res[N]; ii ires[N]; int i; for (i = 0; i < N; i++) { ires[i].a = iptr->b; ires[i].b = iptr->a; res[i].b = ptr->b - ptr->a; res[i].a = ptr->b + ptr->a; iptr++; ptr++; } /* check results: */ for (i = 0; i < N; i++) { if (res[i].b != arr[i].b - arr[i].a || ires[i].a != iarr[i].b || res[i].a != arr[i].b + arr[i].a || ires[i].b != iarr[i].a ) abort (); } return 0; } int main (void) { int i; s arr[N]; ii iarr[N]; check_vect (); for (i = 0; i < N; i++) { arr[i].a = i; arr[i].b = i * 2; iarr[i].a = i; iarr[i].b = i * 3; if (arr[i].a == 178) abort(); } main1 (arr, iarr); return 0; } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
/* SPDX-License-Identifier: LGPL-2.1 */ #include "util/debug.h" #include "util/rlimit.h" #include <sys/time.h> #include <sys/resource.h> /* * Bump the memlock so that we can get bpf maps of a reasonable size, * like the ones used with 'perf trace' and with 'perf test bpf', * improve this to some specific request if needed. */ void rlimit__bump_memlock(void) { struct rlimit rlim; if (getrlimit(RLIMIT_MEMLOCK, &rlim) == 0) { rlim.rlim_cur *= 4; rlim.rlim_max *= 4; if (setrlimit(RLIMIT_MEMLOCK, &rlim) < 0) { rlim.rlim_cur /= 2; rlim.rlim_max /= 2; if (setrlimit(RLIMIT_MEMLOCK, &rlim) < 0) pr_debug("Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc\n"); } } }
/* * aQuantia Corporation Network Driver * Copyright (C) 2014-2017 aQuantia Corporation. All rights reserved * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. */ /* File aq_common.h: Basic includes for all files in project. */ #ifndef AQ_COMMON_H #define AQ_COMMON_H #include <linux/etherdevice.h> #include <linux/pci.h> #include <linux/if_vlan.h> #include "ver.h" #include "aq_cfg.h" #include "aq_utils.h" #define PCI_VENDOR_ID_AQUANTIA 0x1D6A #define AQ_DEVICE_ID_0001 0x0001 #define AQ_DEVICE_ID_D100 0xD100 #define AQ_DEVICE_ID_D107 0xD107 #define AQ_DEVICE_ID_D108 0xD108 #define AQ_DEVICE_ID_D109 0xD109 #define AQ_DEVICE_ID_AQC100 0x00B1 #define AQ_DEVICE_ID_AQC107 0x07B1 #define AQ_DEVICE_ID_AQC108 0x08B1 #define AQ_DEVICE_ID_AQC109 0x09B1 #define AQ_DEVICE_ID_AQC111 0x11B1 #define AQ_DEVICE_ID_AQC112 0x12B1 #define AQ_DEVICE_ID_AQC100S 0x80B1 #define AQ_DEVICE_ID_AQC107S 0x87B1 #define AQ_DEVICE_ID_AQC108S 0x88B1 #define AQ_DEVICE_ID_AQC109S 0x89B1 #define AQ_DEVICE_ID_AQC111S 0x91B1 #define AQ_DEVICE_ID_AQC112S 0x92B1 #define AQ_DEVICE_ID_AQC111E 0x51B1 #define AQ_DEVICE_ID_AQC112E 0x52B1 #define HW_ATL_NIC_NAME "aQuantia AQtion 10Gbit Network Adapter" #define AQ_HWREV_ANY 0 #define AQ_HWREV_1 1 #define AQ_HWREV_2 2 #define AQ_NIC_RATE_10G BIT(0) #define AQ_NIC_RATE_5G BIT(1) #define AQ_NIC_RATE_5GSR BIT(2) #define AQ_NIC_RATE_2GS BIT(3) #define AQ_NIC_RATE_1G BIT(4) #define AQ_NIC_RATE_100M BIT(5) #define AQ_NIC_RATE_EEE_10G BIT(6) #define AQ_NIC_RATE_EEE_5G BIT(7) #define AQ_NIC_RATE_EEE_2GS BIT(8) #define AQ_NIC_RATE_EEE_1G BIT(9) #endif /* AQ_COMMON_H */
@interface CPTImage : NSObject<NSCoding, NSCopying> { @private CGImageRef image; CGFloat scale; BOOL tiled; BOOL tileAnchoredToContext; } @property (nonatomic, readwrite, assign) CGImageRef image; @property (nonatomic, readwrite, assign) CGFloat scale; @property (nonatomic, readwrite, assign, getter = isTiled) BOOL tiled; @property (nonatomic, readwrite, assign) BOOL tileAnchoredToContext; @property (nonatomic, readonly, getter = isOpaque) BOOL opaque; /// @name Factory Methods /// @{ +(CPTImage *)imageWithCGImage:(CGImageRef)anImage scale:(CGFloat)newScale; +(CPTImage *)imageWithCGImage:(CGImageRef)anImage; +(CPTImage *)imageForPNGFile:(NSString *)path; /// @} /// @name Initialization /// @{ -(id)initWithCGImage:(CGImageRef)anImage scale:(CGFloat)newScale; -(id)initWithCGImage:(CGImageRef)anImage; -(id)initForPNGFile:(NSString *)path; /// @} /// @name Drawing /// @{ -(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context; /// @} @end
/* The common simulator framework for GDB, the GNU Debugger. Copyright 2002-2014 Free Software Foundation, Inc. Contributed by Andrew Cagney and Red Hat. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _SIM_BASICS_H_ #define _SIM_BASICS_H_ /* Basic configuration */ #ifdef HAVE_CONFIG_H #include "cconfig.h" #endif /* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will bring potential conflicts out in the open */ #include <stdarg.h> #include <stdio.h> #include <setjmp.h> #ifdef __CYGWIN32__ extern int vasprintf (char **result, const char *format, va_list args); extern int asprintf (char **result, const char *format, ...); #endif #ifndef NULL #define NULL 0 #endif /* Some versions of GCC include an attribute operator, define it */ #if !defined (__attribute__) #if (!defined(__GNUC__) || (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)) #define __attribute__(arg) #endif #endif /* Global types that code manipulates */ typedef struct _device device; struct hw; struct _sim_fpu; /* Generic address space (maps) and access attributes */ enum { read_map = 0, write_map = 1, exec_map = 2, io_map = 3, nr_maps = 32, /* something small */ }; enum { access_invalid = 0, access_read = 1 << read_map, access_write = 1 << write_map, access_exec = 1 << exec_map, access_io = 1 << io_map, }; enum { access_read_write = (access_read | access_write), access_read_exec = (access_read | access_exec), access_write_exec = (access_write | access_exec), access_read_write_exec = (access_read | access_write | access_exec), access_read_io = (access_read | access_io), access_write_io = (access_write | access_io), access_read_write_io = (access_read | access_write | access_io), access_exec_io = (access_exec | access_io), access_read_exec_io = (access_read | access_exec | access_io), access_write_exec_io = (access_write | access_exec | access_io), access_read_write_exec_io = (access_read | access_write | access_exec | access_io), }; /* disposition of an object when things are reset */ typedef enum { permenant_object, temporary_object, } object_disposition; /* Memory transfer types */ typedef enum _transfer_type { read_transfer, write_transfer, } transfer_type; /* directions */ typedef enum { bidirect_port, input_port, output_port, } port_direction; /* Basic definitions - ordered so that nothing calls what comes after it. */ /* FIXME: conditionalizing tconfig.h on HAVE_CONFIG_H seems wrong. */ #ifdef HAVE_CONFIG_H #include "tconfig.h" #endif #include "ansidecl.h" #include "gdb/callback.h" #include "gdb/remote-sim.h" #include "sim-config.h" #include "sim-inline.h" #include "sim-types.h" #include "sim-bits.h" #include "sim-endian.h" #include "sim-signal.h" #include "sim-arange.h" #include "sim-utils.h" /* Note: Only the simpler interfaces are defined here. More heavy weight objects, such as core and events, are defined in the more serious sim-base.h header. */ #endif /* _SIM_BASICS_H_ */
/* * see notice in l1oip.c */ /* debugging */ #define DEBUG_L1OIP_INIT 0x00010000 #define DEBUG_L1OIP_SOCKET 0x00020000 #define DEBUG_L1OIP_MGR 0x00040000 #define DEBUG_L1OIP_MSG 0x00080000 /* enable to disorder received bchannels by sequence 2143658798... */ /* #define REORDER_DEBUG */ /* frames */ #define L1OIP_MAX_LEN 2048 /* max packet size form l2 */ #define L1OIP_MAX_PERFRAME 1400 /* max data size in one frame */ /* timers */ #define L1OIP_KEEPALIVE 15 #define L1OIP_TIMEOUT 65 /* socket */ #define L1OIP_DEFAULTPORT 931 /* channel structure */ struct l1oip_chan { struct dchannel *dch; struct bchannel *bch; u32 tx_counter; /* counts xmit bytes/packets */ u32 rx_counter; /* counts recv bytes/packets */ u32 codecstate; /* used by codec to save data */ #ifdef REORDER_DEBUG int disorder_flag; struct sk_buff *disorder_skb; u32 disorder_cnt; #endif }; /* card structure */ struct l1oip { struct list_head list; /* card */ int registered; /* if registered with mISDN */ char name[MISDN_MAX_IDLEN]; int idx; /* card index */ int pri; /* 1=pri, 0=bri */ int d_idx; /* current dchannel number */ int b_num; /* number of bchannels */ u32 id; /* id of connection */ int ondemand; /* if transmis. is on demand */ int bundle; /* bundle channels in one frm */ int codec; /* codec to use for transmis. */ int limit; /* limit number of bchannels */ /* timer */ struct timer_list keep_tl; struct timer_list timeout_tl; int timeout_on; struct work_struct workq; /* socket */ struct socket *socket; /* if set, socket is created */ struct completion socket_complete;/* completion of sock thread */ struct task_struct *socket_thread; spinlock_t socket_lock; /* access sock outside thread */ u32 remoteip; /* if all set, ip is assigned */ u16 localport; /* must always be set */ u16 remoteport; /* must always be set */ struct sockaddr_in sin_local; /* local socket name */ struct sockaddr_in sin_remote; /* remote socket name */ struct msghdr sendmsg; /* ip message to send */ struct kvec sendiov; /* iov for message */ /* frame */ struct l1oip_chan chan[128]; /* channel instances */ }; extern int l1oip_law_to_4bit(u8 *data, int len, u8 *result, u32 *state); extern int l1oip_4bit_to_law(u8 *data, int len, u8 *result); extern int l1oip_alaw_to_ulaw(u8 *data, int len, u8 *result); extern int l1oip_ulaw_to_alaw(u8 *data, int len, u8 *result); extern void l1oip_4bit_free(void); extern int l1oip_4bit_alloc(int ulaw);
/****************************************************************************** * Spine Runtimes Software License * Version 2.3 * * Copyright (c) 2013-2015, Esoteric Software * All rights reserved. * * You are granted a perpetual, non-exclusive, non-sublicensable and * non-transferable license to use, install, execute and perform the Spine * Runtimes Software (the "Software") and derivative works solely for personal * or internal use. Without the written permission of Esoteric Software (see * Section 2 of the Spine Software License Agreement), you may not (a) modify, * translate, adapt or otherwise create derivative works, improvements of the * Software or develop new applications using the Software or (b) remove, * delete, alter or obscure any trademarks or any copyright, trademark, patent * or other intellectual property or proprietary rights notices on or in the * Software, including any copy thereof. Redistributions in binary or source * form must include this license and terms. * * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #ifndef SPINE_BOUNDINGBOXATTACHMENT_H_ #define SPINE_BOUNDINGBOXATTACHMENT_H_ #include <spine/Attachment.h> #include <spine/Atlas.h> #include <spine/Slot.h> #ifdef __cplusplus extern "C" { #endif typedef struct spBoundingBoxAttachment { spAttachment super; int verticesCount; float* vertices; } spBoundingBoxAttachment; spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name); void spBoundingBoxAttachment_computeWorldVertices (spBoundingBoxAttachment* self, spBone* bone, float* vertices); #ifdef SPINE_SHORT_NAMES typedef spBoundingBoxAttachment BoundingBoxAttachment; #define BoundingBoxAttachment_create(...) spBoundingBoxAttachment_create(__VA_ARGS__) #define BoundingBoxAttachment_computeWorldVertices(...) spBoundingBoxAttachment_computeWorldVertices(__VA_ARGS__) #endif #ifdef __cplusplus } #endif #endif /* SPINE_BOUNDINGBOXATTACHMENT_H_ */