text
stringlengths
4
6.14k
// // UINavigationBar+Animation.h // DKNightVersion // // Created by Draveness on 15/5/4. // Copyright (c) 2015年 DeltaX. All rights reserved. // #import <UIKit/UIKit.h> @interface UINavigationBar (Animation) - (void)animateNavigationBarToColor:(UIColor *)toColor duration:(NSTimeInterval)duration; @end
/* Test for ICEs on invalid transparent unions (empty or no named members). Bug 21213. */ /* Origin: Joseph Myers <joseph@codesourcery.com> */ /* { dg-do compile } */ /* { dg-options "" } */ enum e { A }; union __attribute__((__transparent_union__)) ue1 { enum e; }; /* { dg-warning "declaration does not declare anything" "not anything" } */ /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } .-1 } */ union ue2 { enum e; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "not anything" } */ /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } .-1 } */ union __attribute__((__transparent_union__)) ui1 { int; }; /* { dg-warning "declaration does not declare anything" "not anything" } */ /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } .-1 } */ union ui2 { int; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "no anything" } */ /* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } .-1 } */ union __attribute__((__transparent_union__)) u1 { }; /* { dg-warning "union cannot be made transparent" "" { target *-*-* } .-1 } */ union u2 { } __attribute__((__transparent_union__)); /* { dg-warning "union cannot be made transparent" "" { target *-*-* } .-1 } */
/* * GStreamer * Copyright (C) 2008 Filippo Argiolas <filippo.argiolas@gmail.com> * * This library 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. * * This 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 Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef _GST_GL_FILTERSOBEL_H_ #define _GST_GL_FILTERSOBEL_H_ #include <gst/gl/gstglfilter.h> #define GST_TYPE_GL_FILTERSOBEL (gst_gl_filtersobel_get_type()) #define GST_GL_FILTERSOBEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_FILTERSOBEL,GstGLFilterSobel)) #define GST_IS_GL_FILTERSOBEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_FILTERSOBEL)) #define GST_GL_FILTERSOBEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_GL_FILTERSOBEL,GstGLFilterSobelClass)) #define GST_IS_GL_FILTERSOBEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_FILTERSOBEL)) #define GST_GL_FILTERSOBEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_FILTERSOBEL,GstGLFilterSobelClass)) typedef struct _GstGLFilterSobel GstGLFilterSobel; typedef struct _GstGLFilterSobelClass GstGLFilterSobelClass; struct _GstGLFilterSobel { GstGLFilter filter; GstGLShader *hconv; GstGLShader *vconv; GstGLShader *len; GstGLShader *desat; GLuint midtexture[5]; gboolean invert; }; struct _GstGLFilterSobelClass { GstGLFilterClass filter_class; }; GType gst_gl_filtersobel_get_type (void); #endif /* _GST_GL_FILTERSOBEL_H_ */
/* SPDX-License-Identifier: MIT */ /* * Copyright © 2019 Intel Corporation */ #ifndef __INTEL_GT_TYPES__ #define __INTEL_GT_TYPES__ #include <linux/ktime.h> #include <linux/list.h> #include <linux/mutex.h> #include <linux/notifier.h> #include <linux/spinlock.h> #include <linux/types.h> #include "uc/intel_uc.h" #include "i915_vma.h" #include "intel_engine_types.h" #include "intel_reset_types.h" #include "intel_wakeref.h" struct drm_i915_private; struct i915_ggtt; struct intel_engine_cs; struct intel_uncore; struct intel_hangcheck { /* For hangcheck timer */ #define DRM_I915_HANGCHECK_PERIOD 1500 /* in ms */ #define DRM_I915_HANGCHECK_JIFFIES msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD) struct delayed_work work; }; struct intel_gt { struct drm_i915_private *i915; struct intel_uncore *uncore; struct i915_ggtt *ggtt; struct intel_uc uc; struct intel_gt_timelines { spinlock_t lock; /* protects active_list */ struct list_head active_list; /* Pack multiple timelines' seqnos into the same page */ spinlock_t hwsp_lock; struct list_head hwsp_free_list; } timelines; struct intel_wakeref wakeref; struct list_head closed_vma; spinlock_t closed_lock; /* guards the list of closed_vma */ struct intel_hangcheck hangcheck; struct intel_reset reset; /** * Is the GPU currently considered idle, or busy executing * userspace requests? Whilst idle, we allow runtime power * management to power down the hardware and display clocks. * In order to reduce the effect on performance, there * is a slight delay before we do so. */ intel_wakeref_t awake; struct blocking_notifier_head pm_notifications; ktime_t last_init_time; struct i915_vma *scratch; spinlock_t irq_lock; u32 gt_imr; u32 pm_ier; u32 pm_imr; u32 pm_guc_events; struct intel_engine_cs *engine[I915_NUM_ENGINES]; struct intel_engine_cs *engine_class[MAX_ENGINE_CLASS + 1] [MAX_ENGINE_INSTANCE + 1]; }; enum intel_gt_scratch_field { /* 8 bytes */ INTEL_GT_SCRATCH_FIELD_DEFAULT = 0, /* 8 bytes */ INTEL_GT_SCRATCH_FIELD_CLEAR_SLM_WA = 128, /* 8 bytes */ INTEL_GT_SCRATCH_FIELD_RENDER_FLUSH = 128, /* 8 bytes */ INTEL_GT_SCRATCH_FIELD_COHERENTL3_WA = 256, }; #endif /* __INTEL_GT_TYPES_H__ */
/* * GStreamer * Copyright (C) 2005,2008, 2009 Sun Microsystems, Inc., * Brian Cameron <brian.cameron@sun.com> * Copyright (C) 2009 Sun Microsystems, Inc., * Garrett D'Amore <garrett.damore@sun.com> * * gstsunaudiomixer.c: mixer interface implementation for OSS * * This library 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. * * This 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 Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <sys/ioctl.h> #include <sys/audioio.h> #include <gst/gst-i18n-plugin.h> #include "gstsunaudiomixertrack.h" GST_DEBUG_CATEGORY_EXTERN (sunaudio_debug); #define GST_CAT_DEFAULT sunaudio_debug #define MASK_BIT_IS_SET(mask, bit) \ (mask & (1 << bit)) G_DEFINE_TYPE (GstSunAudioMixerTrack, gst_sunaudiomixer_track, GST_TYPE_MIXER_TRACK); static void gst_sunaudiomixer_track_class_init (GstSunAudioMixerTrackClass * klass) { /* nop */ } static void gst_sunaudiomixer_track_init (GstSunAudioMixerTrack * track) { track->gain = 0; track->balance = AUDIO_MID_BALANCE; track->track_num = 0; } GstMixerTrack * gst_sunaudiomixer_track_new (GstSunAudioTrackType track_num) { const gchar *labels[] = { N_("Volume"), N_("Gain"), N_("Monitor"), N_("Built-in Speaker"), N_("Headphone"), N_("Line Out"), N_("SPDIF Out"), N_("AUX 1 Out"), N_("AUX 2 Out"), }; GstSunAudioMixerTrack *sunaudiotrack; GstMixerTrack *track; const gchar *untranslated_label; if ((guint) track_num < G_N_ELEMENTS (labels)) untranslated_label = labels[track_num]; else untranslated_label = NULL; sunaudiotrack = g_object_new (GST_TYPE_SUNAUDIO_MIXER_TRACK, "untranslated-label", untranslated_label, NULL); GST_DEBUG_OBJECT (sunaudiotrack, "Creating new mixer track of type %d: %s", track_num, GST_STR_NULL (untranslated_label)); switch (track_num) { case GST_SUNAUDIO_TRACK_OUTPUT: /* these are sliders */ track = GST_MIXER_TRACK (sunaudiotrack); track->label = g_strdup (_(untranslated_label)); track->num_channels = 2; track->flags = GST_MIXER_TRACK_OUTPUT | GST_MIXER_TRACK_WHITELIST | GST_MIXER_TRACK_MASTER; track->min_volume = 0; track->max_volume = 255; sunaudiotrack->track_num = track_num; sunaudiotrack->gain = (0 & 0xff); sunaudiotrack->balance = AUDIO_MID_BALANCE; break; case GST_SUNAUDIO_TRACK_RECORD: /* these are sliders */ track = GST_MIXER_TRACK (sunaudiotrack); track->label = g_strdup (_(untranslated_label)); track->num_channels = 2; track->flags = GST_MIXER_TRACK_INPUT | GST_MIXER_TRACK_NO_RECORD | GST_MIXER_TRACK_WHITELIST; track->min_volume = 0; track->max_volume = 255; sunaudiotrack->track_num = track_num; sunaudiotrack->gain = (0 & 0xff); sunaudiotrack->balance = AUDIO_MID_BALANCE; break; case GST_SUNAUDIO_TRACK_MONITOR: /* these are sliders */ track = GST_MIXER_TRACK (sunaudiotrack); track->label = g_strdup (_(untranslated_label)); track->num_channels = 2; track->flags = GST_MIXER_TRACK_INPUT | GST_MIXER_TRACK_NO_RECORD; track->min_volume = 0; track->max_volume = 255; sunaudiotrack->track_num = track_num; sunaudiotrack->gain = (0 & 0xff); sunaudiotrack->balance = AUDIO_MID_BALANCE; break; case GST_SUNAUDIO_TRACK_SPEAKER: case GST_SUNAUDIO_TRACK_HP: case GST_SUNAUDIO_TRACK_LINEOUT: case GST_SUNAUDIO_TRACK_SPDIFOUT: case GST_SUNAUDIO_TRACK_AUX1OUT: case GST_SUNAUDIO_TRACK_AUX2OUT: /* these are switches */ track = GST_MIXER_TRACK (sunaudiotrack); track->label = g_strdup (_(untranslated_label)); track->num_channels = 0; track->flags = GST_MIXER_TRACK_OUTPUT | GST_MIXER_TRACK_WHITELIST; track->min_volume = 0; track->max_volume = 255; sunaudiotrack->track_num = track_num; sunaudiotrack->gain = (0 & 0xff); sunaudiotrack->balance = AUDIO_MID_BALANCE; break; default: g_warning ("Unknown sun audio track num %d", track_num); track = NULL; } return track; }
//===- ArchiveWriter.h - ar archive file format writer ----------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Declares the writeArchive function for writing an archive file. // //===----------------------------------------------------------------------===// #ifndef LLVM_OBJECT_ARCHIVEWRITER_H #define LLVM_OBJECT_ARCHIVEWRITER_H #include "llvm/Object/Archive.h" namespace llvm { struct NewArchiveMember { std::unique_ptr<MemoryBuffer> Buf; StringRef MemberName; sys::TimePoint<std::chrono::seconds> ModTime; unsigned UID = 0, GID = 0, Perms = 0644; NewArchiveMember() = default; NewArchiveMember(MemoryBufferRef BufRef); static Expected<NewArchiveMember> getOldMember(const object::Archive::Child &OldMember, bool Deterministic); static Expected<NewArchiveMember> getFile(StringRef FileName, bool Deterministic); }; Expected<std::string> computeArchiveRelativePath(StringRef From, StringRef To); Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers, bool WriteSymtab, object::Archive::Kind Kind, bool Deterministic, bool Thin, std::unique_ptr<MemoryBuffer> OldArchiveBuf = nullptr); // writeArchiveToBuffer is similar to writeArchive but returns the Archive in a // buffer instead of writing it out to a file. Expected<std::unique_ptr<MemoryBuffer>> writeArchiveToBuffer(ArrayRef<NewArchiveMember> NewMembers, bool WriteSymtab, object::Archive::Kind Kind, bool Deterministic, bool Thin); } #endif
// 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. // // A toy server, which listens on a specified address for QUIC traffic and // handles incoming responses. #ifndef NET_TOOLS_QUIC_QUIC_SERVER_H_ #define NET_TOOLS_QUIC_QUIC_SERVER_H_ #include "base/memory/scoped_ptr.h" #include "net/base/ip_endpoint.h" #include "net/quic/crypto/crypto_server_config.h" #include "net/quic/quic_config.h" #include "net/quic/quic_framer.h" #include "net/tools/flip_server/epoll_server.h" #include "net/tools/quic/quic_dispatcher.h" namespace net { class QuicCryptoServerConfig; namespace tools { class QuicDispatcher; class QuicServer : public EpollCallbackInterface { public: QuicServer(); explicit QuicServer(const QuicConfig& config); virtual ~QuicServer(); // Start listening on the specified address. bool Listen(const IPEndPoint& address); // Wait up to 50ms, and handle any events which occur. void WaitForEvents(); // Server deletion is imminent. Start cleaning up the epoll server. void Shutdown(); // From EpollCallbackInterface virtual void OnRegistration( EpollServer* eps, int fd, int event_mask) OVERRIDE {} virtual void OnModification(int fd, int event_mask) OVERRIDE {} virtual void OnEvent(int fd, EpollEvent* event) OVERRIDE; virtual void OnUnregistration(int fd, bool replaced) OVERRIDE {} // Reads a packet from the given fd, and then passes it off to // the QuicDispatcher. Returns true if a packet is read, false // otherwise. // If packets_dropped is non-null, the socket is configured to track // dropped packets, and some packets are read, it will be set to the number of // dropped packets. static bool ReadAndDispatchSinglePacket(int fd, int port, QuicDispatcher* dispatcher, int* packets_dropped); virtual void OnShutdown(EpollServer* eps, int fd) OVERRIDE {} // Dispatches the given packet only if it looks like a valid QUIC packet. // TODO(rjshade): Return a status describing why a packet was dropped, and log // somehow. Maybe expose as a varz. static void MaybeDispatchPacket(QuicDispatcher* dispatcher, const QuicEncryptedPacket& packet, const IPEndPoint& server_address, const IPEndPoint& client_address); bool overflow_supported() { return overflow_supported_; } int packets_dropped() { return packets_dropped_; } int port() { return port_; } private: // Initialize the internal state of the server. void Initialize(); // Accepts data from the framer and demuxes clients to sessions. scoped_ptr<QuicDispatcher> dispatcher_; // Frames incoming packets and hands them to the dispatcher. EpollServer epoll_server_; // The port the server is listening on. int port_; // Listening connection. Also used for outbound client communication. int fd_; // If overflow_supported_ is true this will be the number of packets dropped // during the lifetime of the server. This may overflow if enough packets // are dropped. int packets_dropped_; // True if the kernel supports SO_RXQ_OVFL, the number of packets dropped // because the socket would otherwise overflow. bool overflow_supported_; // If true, use recvmmsg for reading. bool use_recvmmsg_; // config_ contains non-crypto parameters that are negotiated in the crypto // handshake. QuicConfig config_; // crypto_config_ contains crypto parameters for the handshake. QuicCryptoServerConfig crypto_config_; DISALLOW_COPY_AND_ASSIGN(QuicServer); }; } // namespace tools } // namespace net #endif // NET_TOOLS_QUIC_QUIC_SERVER_H_
/* * libpal - Automated Placement of Labels Library * * Copyright (C) 2008 Maxence Laurent, MIS-TIC, HEIG-VD * University of Applied Sciences, Western Switzerland * http://www.hes-so.ch * * Contact: * maxence.laurent <at> heig-vd <dot> ch * or * eric.taillard <at> heig-vd <dot> ch * * This file is part of libpal. * * libpal 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. * * libpal 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 libpal. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef PAL_PRIORITYQUEUE_H #define PAL_PRIORITYQUEUE_H #define SIP_NO_FILE #include <iostream> #define LEFT(x) (2*x+1) #define RIGHT(x) (2*x+2) #define PARENT(x) ((x-1)/2) namespace pal { /** * \ingroup core * \brief Custom priority queue for use in pal labeling engine. * \class pal::PriorityQueue * \note not available in Python bindings */ class PriorityQueue { public: /** * \brief Create a priority queue of max size n * \\param n max size of the queuet * \\param p external vector representing the priority * \\param min best element has the smallest p when min is TRUE and has the biggest when min is FALSE */ PriorityQueue( int n, int maxId, bool min ); ~PriorityQueue(); //! PriorityQueue cannot be copied. PriorityQueue( const PriorityQueue & ) = delete; //! PriorityQueue cannot be copied. PriorityQueue &operator=( const PriorityQueue & ) = delete; void print(); int getSize(); int getSizeByPos(); bool isIn( int key ); int getBest(); // O(log n) void remove( int key ); void insert( int key, double p ); void sort(); // O(n log n) void downheap( int id ); void upheap( int key ); void decreaseKey( int key ); void setPriority( int key, double new_p ); int getId( int key ); private: int size; int maxsize; int maxId; int *heap = nullptr; double *p = nullptr; int *pos = nullptr; bool ( *greater )( double l, double r ); }; } // namespace #endif
/* Determine realtime clock frequency. Copyright (C) 2003, 2004, 2006 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 <sys/time.h> #include <libc-internal.h> #include <kernel-features.h> #include <ldsodefs.h> int __profile_frequency (void) { #ifdef __ASSUME_AT_CLKTCK return GLRO(dl_clktck); #else if (GLRO(dl_clktck) != 0) return GLRO(dl_clktck); struct itimerval tim; tim.it_interval.tv_sec = 0; tim.it_interval.tv_usec = 1; tim.it_value.tv_sec = 0; tim.it_value.tv_usec = 0; __setitimer (ITIMER_REAL, &tim, 0); __setitimer (ITIMER_REAL, 0, &tim); if (tim.it_interval.tv_usec < 2) return 0; return 1000000 / tim.it_interval.tv_usec; #endif } libc_hidden_def (__profile_frequency)
/** * \file delfile.c * Example program to delete a file off the device. * * Copyright (C) 2005-2008 Linus Walleij <triad@df.lth.se> * Copyright (C) 2006 Chris A. Debenham <chris@adebenham.com> * * This 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 of the License, or (at your option) any later version. * * This 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 this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "common.h" #include "string.h" #include "pathutils.h" #include <stdlib.h> #include <limits.h> void delfile_usage(void); void delfile_function(char *); void delfile_command(int, char **); extern LIBMTP_mtpdevice_t *device; extern LIBMTP_folder_t *folders; extern LIBMTP_file_t *files; void delfile_usage(void) { printf("Usage: delfile [-n] <fileid/trackid> | -f <filename>\n"); } void delfile_function(char * path) { uint32_t id = parse_path (path,files,folders); if (id > 0) { printf("Deleting %s which has item_id:%d\n",path,id); int ret = 1; ret = LIBMTP_Delete_Object(device, id); if (ret != 0) { LIBMTP_Dump_Errorstack(device); LIBMTP_Clear_Errorstack(device); printf("Failed to remove file\n"); } } } void delfile_command(int argc, char **argv) { int FILENAME = 1; int ITEMID = 2; int field_type = 0; int i; if ( argc > 2 ) { if (strncmp(argv[1],"-f",2) == 0) { field_type = FILENAME; strcpy(argv[1],""); } else if (strncmp(argv[1],"-n",2) == 0) { field_type = ITEMID; strcpy(argv[1],"0"); } else { delfile_usage(); return; } } else { delfile_usage(); return; } for (i=1;i<argc;i++) { uint32_t id; char *endptr; int ret = 0; if (field_type == ITEMID) { // Sanity check song ID id = strtoul(argv[i], &endptr, 10); if ( *endptr != 0 ) { fprintf(stderr, "illegal value %s .. skipping\n", argv[i]); id = 0; } } else { if (strlen(argv[i]) > 0) { id = parse_path (argv[i],files,folders); } else { id = 0; } } if (id > 0 ) { printf("Deleting %s\n",argv[i]); ret = LIBMTP_Delete_Object(device, id); } if ( ret != 0 ) { printf("Failed to delete file:%s\n",argv[i]); LIBMTP_Dump_Errorstack(device); LIBMTP_Clear_Errorstack(device); ret = 1; } } }
/* * Copyright (C) 2003, 2005, 2006 Apple Computer, 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: * * 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 Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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. */ #import <AppKit/AppKit.h> @class DOMElement; @class DOMHTMLInputElement; @class DOMHTMLTextAreaElement; @class WebFrame; /*! @protocol WebFormSubmissionListener */ @protocol WebFormSubmissionListener <NSObject> - (void)continue; @end /*! @protocol WebFormDelegate */ @protocol WebFormDelegate <NSObject> // Various methods send by controls that edit text to their delegates, which are all // analogous to similar methods in AppKit/NSControl.h. // These methods are forwarded from widgets used in forms to the WebFormDelegate. - (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame; - (void)textFieldDidEndEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame; - (void)textDidChangeInTextField:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame; - (void)textDidChangeInTextArea:(DOMHTMLTextAreaElement *)element inFrame:(WebFrame *)frame; - (BOOL)textField:(DOMHTMLInputElement *)element doCommandBySelector:(SEL)commandSelector inFrame:(WebFrame *)frame; - (BOOL)textField:(DOMHTMLInputElement *)element shouldHandleEvent:(NSEvent *)event inFrame:(WebFrame *)frame; // Sent when a form is just about to be submitted (before the load is started) // listener must be sent continue when the delegate is done. - (void)frame:(WebFrame *)frame sourceFrame:(WebFrame *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionListener:(id <WebFormSubmissionListener>)listener; @end /*! @class WebFormDelegate @discussion The WebFormDelegate class responds to all WebFormDelegate protocol methods by doing nothing. It's provided for the convenience of clients who only want to implement some of the above methods and ignore others. */ @interface WebFormDelegate : NSObject <WebFormDelegate> @end
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef MOOSEARRAYTEST_H #define MOOSEARRAYTEST_H //CPPUnit includes #include "cppunit/extensions/HelperMacros.h" class MooseArrayTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( MooseArrayTest ); CPPUNIT_TEST( defaultConstructor ); CPPUNIT_TEST( sizeConstructor ); CPPUNIT_TEST( valueConstructor ); CPPUNIT_TEST( setAllValues ); CPPUNIT_TEST( release ); CPPUNIT_TEST( resize ); CPPUNIT_TEST( resizeDefault ); CPPUNIT_TEST( size ); CPPUNIT_TEST( access ); CPPUNIT_TEST( shallowCopy ); CPPUNIT_TEST( shallowCopyStdVector ); CPPUNIT_TEST( operatorEqualsStdVector ); CPPUNIT_TEST( stdVector ); CPPUNIT_TEST_SUITE_END(); public: void setUp(); void tearDown(); void defaultConstructor(); void sizeConstructor(); void valueConstructor(); void setAllValues(); void release(); void resize(); void resizeDefault(); void size(); void access(); void shallowCopy(); void shallowCopyStdVector(); void operatorEqualsStdVector(); void stdVector(); private: }; #endif // MOOSEARRAYTEST_H
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla IPC. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 2002 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Darin Fisher <darin@netscape.com> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #ifndef ipcService_h__ #define ipcService_h__ #include "ipcIService.h" #include "ipcdclient.h" class ipcService : public ipcIService { public: NS_DECL_ISUPPORTS NS_DECL_IPCISERVICE }; #endif // !defined( ipcService_h__ )
/* * This is a reimplementation of a subset of the pthread_getspecific/setspecific * interface. This appears to outperform the standard linuxthreads one * by a significant margin. * The major restriction is that each thread may only make a single * pthread_setspecific call on a single key. (The current data structure * doesn't really require that. The restriction should be easily removable.) * We don't currently support the destruction functions, though that * could be done. * We also currently assume that only one pthread_setspecific call * can be executed at a time, though that assumption would be easy to remove * by adding a lock. */ #include <errno.h> #include "atomic_ops.h" /* Called during key creation or setspecific. */ /* For the GC we already hold lock. */ /* Currently allocated objects leak on thread exit. */ /* That's hard to fix, but OK if we allocate garbage */ /* collected memory. */ #define MALLOC_CLEAR(n) GC_INTERNAL_MALLOC(n, NORMAL) #define TS_CACHE_SIZE 1024 #define CACHE_HASH(n) ((((n) >> 8) ^ (n)) & (TS_CACHE_SIZE - 1)) #define TS_HASH_SIZE 1024 #define HASH(p) \ ((unsigned)((((word)(p)) >> 8) ^ (word)(p)) & (TS_HASH_SIZE - 1)) /* An entry describing a thread-specific value for a given thread. */ /* All such accessible structures preserve the invariant that if either */ /* thread is a valid pthread id or qtid is a valid "quick tread id" */ /* for a thread, then value holds the corresponding thread specific */ /* value. This invariant must be preserved at ALL times, since */ /* asynchronous reads are allowed. */ typedef struct thread_specific_entry { volatile AO_t qtid; /* quick thread id, only for cache */ void * value; struct thread_specific_entry *next; pthread_t thread; } tse; /* We represent each thread-specific datum as two tables. The first is */ /* a cache, indexed by a "quick thread identifier". The "quick" thread */ /* identifier is an easy to compute value, which is guaranteed to */ /* determine the thread, though a thread may correspond to more than */ /* one value. We typically use the address of a page in the stack. */ /* The second is a hash table, indexed by pthread_self(). It is used */ /* only as a backup. */ /* Return the "quick thread id". Default version. Assumes page size, */ /* or at least thread stack separation, is at least 4K. */ /* Must be defined so that it never returns 0. (Page 0 can't really be */ /* part of any stack, since that would make 0 a valid stack pointer.) */ #define quick_thread_id() (((word)GC_approx_sp()) >> 12) #define INVALID_QTID ((word)0) #define INVALID_THREADID ((pthread_t)0) union ptse_ao_u { tse *p; volatile AO_t ao; }; typedef struct thread_specific_data { tse * volatile cache[TS_CACHE_SIZE]; /* A faster index to the hash table */ union ptse_ao_u hash[TS_HASH_SIZE]; pthread_mutex_t lock; } tsd; typedef tsd * GC_key_t; #define GC_key_create(key, d) GC_key_create_inner(key) GC_INNER int GC_key_create_inner(tsd ** key_ptr); GC_INNER int GC_setspecific(tsd * key, void * value); GC_INNER void GC_remove_specific(tsd * key); /* An internal version of getspecific that assumes a cache miss. */ GC_INNER void * GC_slow_getspecific(tsd * key, word qtid, tse * volatile * cache_entry); /* GC_INLINE is defined in gc_priv.h. */ GC_INLINE void * GC_getspecific(tsd * key) { word qtid = quick_thread_id(); tse * volatile * entry_ptr = &key->cache[CACHE_HASH(qtid)]; tse * entry = *entry_ptr; /* Must be loaded only once. */ GC_ASSERT(qtid != INVALID_QTID); if (EXPECT(entry -> qtid == qtid, TRUE)) { GC_ASSERT(entry -> thread == pthread_self()); return entry -> value; } return GC_slow_getspecific(key, qtid, entry_ptr); }
// // ANTLRUnbufferedTokenStream.h // ANTLR // // Created by Alan Condit on 7/12/10. // [The "BSD licence"] // Copyright (c) 2010 Alan Condit // 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. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. #import <Cocoa/Cocoa.h> #import "ANTLRRuntimeException.h" #import "ANTLRTokenSource.h" #import "ANTLRLookaheadStream.h" #import "ANTLRToken.h" @interface ANTLRUnbufferedTokenStream : ANTLRLookaheadStream { id<ANTLRTokenSource> tokenSource; NSInteger tokenIndex; // simple counter to set token index in tokens NSInteger channel; } @property (retain, getter=getTokenSource, setter=setTokenSource:) id<ANTLRTokenSource> tokenSource; @property (getter=getTokenIndex, setter=setTokenIndex) NSInteger tokenIndex; @property (getter=getChannel, setter=setChannel:) NSInteger channel; + (ANTLRUnbufferedTokenStream *)newANTLRUnbufferedTokenStream:(id<ANTLRTokenSource>)aTokenSource; - (id) init; - (id) initWithTokenSource:(id<ANTLRTokenSource>)aTokenSource; - (id<ANTLRToken>)nextElement; - (BOOL)isEOF:(id<ANTLRToken>) aToken; - (id<ANTLRTokenSource>)getTokenSource; - (NSString *)toStringFromStart:(NSInteger)aStart ToEnd:(NSInteger)aStop; - (NSString *)toStringFromToken:(id<ANTLRToken>)aStart ToEnd:(id<ANTLRToken>)aStop; - (NSInteger)LA:(NSInteger)anIdx; - (id<ANTLRToken>)objectAtIndex:(NSInteger)anIdx; - (NSString *)getSourceName; @end
// license:BSD-3-Clause // copyright-holders:Nicola Salmoria, David Haywood // Video System Sprites #ifndef MAME_VIDEO_VSYSTEM_SPR_H #define MAME_VIDEO_VSYSTEM_SPR_H #pragma once typedef device_delegate<uint32_t (uint32_t)> vsystem_tile_indirection_delegate; /*** CG10103 **********************************************/ class vsystem_spr_device : public device_t { public: // configuration template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); } void set_offsets(int xoffs, int yoffs) { m_xoffs = xoffs; m_yoffs = yoffs; } void set_pdraw(bool pdraw) { m_pdraw = pdraw; } template <typename... T> void set_tile_indirect_cb(T &&... args) { m_newtilecb.set(std::forward<T>(args)...); } void set_gfx_region(int gfx_region) { m_gfx_region = gfx_region; } void set_pal_base(int pal_base) { m_pal_base = pal_base; } void set_pal_mask(int pal_mask) { m_pal_mask = pal_mask; } void set_transpen(int transpen) { m_transpen = transpen; } vsystem_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void draw_sprites(uint16_t const *spriteram, int spriteram_bytes, screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int prihack_mask = -1, int prihack_val = -1 ); protected: virtual void device_start() override; virtual void device_reset() override; private: struct sprite_attributes { sprite_attributes() { } void get(uint16_t const *ram); int ox = 0; int xsize = 0; int zoomx = 0; int oy = 0; int ysize = 0; int zoomy = 0; int flipx = 0; int flipy = 0; int color = 0; int pri = 0; uint32_t map = 0; }; uint32_t tile_callback_noindirect(uint32_t tile); void common_sprite_drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); vsystem_tile_indirection_delegate m_newtilecb; // inline config int m_xoffs, m_yoffs; bool m_pdraw; uint16_t m_pal_mask; uint8_t m_gfx_region; uint8_t m_transpen; uint16_t m_pal_base; sprite_attributes m_curr_sprite; required_device<gfxdecode_device> m_gfxdecode; }; DECLARE_DEVICE_TYPE(VSYSTEM_SPR, vsystem_spr_device) #endif // MAME_VIDEO_VSYSTEM_SPR_H
/* Test module for GIOModule tests * Copyright (C) 2013 Red Hat, Inc * Author: Matthias Clasen * * This work is provided "as is"; redistribution and modification * in whole or in part, in any medium, physical or electronic is * permitted without restriction. * * This work 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. * * In no event shall the authors 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 <gio/gio.h> typedef struct _TestB { GObject parent; } TestB; typedef struct _TestBClass { GObjectClass parent_class; } TestBClass; G_DEFINE_TYPE (TestB, test_b, G_TYPE_OBJECT) static void test_b_class_init (TestBClass *class) { } static void test_b_init (TestB *self) { } void g_io_module_load (GIOModule *module) { g_io_extension_point_implement ("test-extension-point", test_b_get_type (), "test-b", 40); } void g_io_module_unload (GIOModule *module) { }
/** * \file * * \brief SAM D20 External Interrupt Driver Configuration Header * * Copyright (C) 2013-2014 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * 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. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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. * * \asf_license_stop * */ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef CONF_EXTINT_H_INCLUDED #define CONF_EXTINT_H_INCLUDED # define EXTINT_CLOCK_SOURCE GCLK_GENERATOR_0 #endif
/**************************************************************************** * * ftwinfnt.c * * FreeType API for accessing Windows FNT specific info (body). * * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, * modified, and distributed under the terms of the FreeType project * license, LICENSE.TXT. By continuing to use, modify, or distribute * this file you indicate that you have read the license and * understand and accept it fully. * */ #include <freetype/internal/ftdebug.h> #include <freetype/ftwinfnt.h> #include <freetype/internal/ftobjs.h> #include <freetype/internal/services/svwinfnt.h> /* documentation is in ftwinfnt.h */ FT_EXPORT_DEF( FT_Error ) FT_Get_WinFNT_Header( FT_Face face, FT_WinFNT_HeaderRec *header ) { FT_Service_WinFnt service; FT_Error error; if ( !face ) return FT_THROW( Invalid_Face_Handle ); if ( !header ) return FT_THROW( Invalid_Argument ); FT_FACE_LOOKUP_SERVICE( face, service, WINFNT ); if ( service ) error = service->get_header( face, header ); else error = FT_THROW( Invalid_Argument ); return error; } /* END */
/* clapll.f -- translated by f2c (version 20061008). You must link the resulting object file with libf2c: on Microsoft Windows system, link with libf2c.lib; on Linux or Unix systems, link with .../path/to/libf2c.a -lm or, if you install libf2c.a in a standard place, with -lf2c -lm -- in that order, at the end of the command line, as in cc *.o -lf2c -lm Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., http://www.netlib.org/f2c/libf2c.zip */ #include "f2c.h" #include "blaswrap.h" /* Subroutine */ int clapll_(integer *n, complex *x, integer *incx, complex * y, integer *incy, real *ssmin) { /* System generated locals */ integer i__1; real r__1, r__2, r__3; complex q__1, q__2, q__3, q__4; /* Builtin functions */ void r_cnjg(complex *, complex *); double c_abs(complex *); /* Local variables */ complex c__, a11, a12, a22, tau; extern /* Subroutine */ int slas2_(real *, real *, real *, real *, real *) ; extern /* Complex */ VOID cdotc_(complex *, integer *, complex *, integer *, complex *, integer *); extern /* Subroutine */ int caxpy_(integer *, complex *, complex *, integer *, complex *, integer *); real ssmax; extern /* Subroutine */ int clarfg_(integer *, complex *, complex *, integer *, complex *); /* -- LAPACK auxiliary routine (version 3.2) -- */ /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ /* November 2006 */ /* .. Scalar Arguments .. */ /* .. */ /* .. Array Arguments .. */ /* .. */ /* Purpose */ /* ======= */ /* Given two column vectors X and Y, let */ /* A = ( X Y ). */ /* The subroutine first computes the QR factorization of A = Q*R, */ /* and then computes the SVD of the 2-by-2 upper triangular matrix R. */ /* The smaller singular value of R is returned in SSMIN, which is used */ /* as the measurement of the linear dependency of the vectors X and Y. */ /* Arguments */ /* ========= */ /* N (input) INTEGER */ /* The length of the vectors X and Y. */ /* X (input/output) COMPLEX array, dimension (1+(N-1)*INCX) */ /* On entry, X contains the N-vector X. */ /* On exit, X is overwritten. */ /* INCX (input) INTEGER */ /* The increment between successive elements of X. INCX > 0. */ /* Y (input/output) COMPLEX array, dimension (1+(N-1)*INCY) */ /* On entry, Y contains the N-vector Y. */ /* On exit, Y is overwritten. */ /* INCY (input) INTEGER */ /* The increment between successive elements of Y. INCY > 0. */ /* SSMIN (output) REAL */ /* The smallest singular value of the N-by-2 matrix A = ( X Y ). */ /* ===================================================================== */ /* .. Parameters .. */ /* .. */ /* .. Local Scalars .. */ /* .. */ /* .. Intrinsic Functions .. */ /* .. */ /* .. External Functions .. */ /* .. */ /* .. External Subroutines .. */ /* .. */ /* .. Executable Statements .. */ /* Quick return if possible */ /* Parameter adjustments */ --y; --x; /* Function Body */ if (*n <= 1) { *ssmin = 0.f; return 0; } /* Compute the QR factorization of the N-by-2 matrix ( X Y ) */ clarfg_(n, &x[1], &x[*incx + 1], incx, &tau); a11.r = x[1].r, a11.i = x[1].i; x[1].r = 1.f, x[1].i = 0.f; r_cnjg(&q__3, &tau); q__2.r = -q__3.r, q__2.i = -q__3.i; cdotc_(&q__4, n, &x[1], incx, &y[1], incy); q__1.r = q__2.r * q__4.r - q__2.i * q__4.i, q__1.i = q__2.r * q__4.i + q__2.i * q__4.r; c__.r = q__1.r, c__.i = q__1.i; caxpy_(n, &c__, &x[1], incx, &y[1], incy); i__1 = *n - 1; clarfg_(&i__1, &y[*incy + 1], &y[(*incy << 1) + 1], incy, &tau); a12.r = y[1].r, a12.i = y[1].i; i__1 = *incy + 1; a22.r = y[i__1].r, a22.i = y[i__1].i; /* Compute the SVD of 2-by-2 Upper triangular matrix. */ r__1 = c_abs(&a11); r__2 = c_abs(&a12); r__3 = c_abs(&a22); slas2_(&r__1, &r__2, &r__3, ssmin, &ssmax); return 0; /* End of CLAPLL */ } /* clapll_ */
/**************************************************************************** * * gxvalid.c * * FreeType validator for TrueTypeGX/AAT tables (body only). * * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, * modified, and distributed under the terms of the FreeType project * license, LICENSE.TXT. By continuing to use, modify, or distribute * this file you indicate that you have read the license and * understand and accept it fully. * */ #define FT_MAKE_OPTION_SINGLE_OBJECT #include "gxvbsln.c" #include "gxvcommn.c" #include "gxvfeat.c" #include "gxvjust.c" #include "gxvkern.c" #include "gxvlcar.c" #include "gxvmod.c" #include "gxvmort.c" #include "gxvmort0.c" #include "gxvmort1.c" #include "gxvmort2.c" #include "gxvmort4.c" #include "gxvmort5.c" #include "gxvmorx.c" #include "gxvmorx0.c" #include "gxvmorx1.c" #include "gxvmorx2.c" #include "gxvmorx4.c" #include "gxvmorx5.c" #include "gxvopbd.c" #include "gxvprop.c" #include "gxvtrak.c" /* END */
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2015 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ #import "TiLayoutView.h" @interface TiSlider : TiLayoutView @property(nonatomic, copy) void (^onValueChanged)(TiSlider* sender, NSInteger value); -(NSInteger)sliderValue; -(void)setMin:(NSInteger)min andMax:(NSInteger)max; -(void)setSliderValue:(NSInteger)value; @end
/*************************************************************************//** ***************************************************************************** * @file exit.c * @brief * @author Forrest Y. Yu * @date Tue May 6 14:25:33 2008 ***************************************************************************** *****************************************************************************/ #include "type.h" #include "stdio.h" #include "const.h" #include "protect.h" #include "string.h" #include "fs.h" #include "proc.h" #include "tty.h" #include "console.h" #include "global.h" #include "proto.h" /***************************************************************************** * exit *************************************************************************//** * Terminate the current process. * * @param status The value returned to the parent. *****************************************************************************/ PUBLIC void exit(int status) { MESSAGE msg; msg.type = EXIT; msg.STATUS = status; send_recv(BOTH, TASK_MM, &msg); assert(msg.type == SYSCALL_RET); }
/* $OpenBSD: gmon.h,v 1.3 1996/04/21 22:31:46 deraadt Exp $ */ /* $NetBSD: gmon.h,v 1.5 1996/04/09 20:55:30 cgd Exp $ */ /*- * Copyright (c) 1982, 1986, 1992, 1993 * The Regents of the University of California. 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. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. * * @(#)gmon.h 8.2 (Berkeley) 1/4/94 */ /* * This file is taken from Cygwin distribution. Please keep it in sync. * The differences should be within __MINGW32__ guard. */ #ifndef _SYS_GMON_H_ #define _SYS_GMON_H_ #ifndef __P #define __P(x) x #endif /* On POSIX systems, profile.h is a KRB5 header. To avoid collisions, just pull in profile.h's content here. The profile.h header won't be provided by Mingw-w64 anymore at one point. */ #if 0 #include <profile.h> #else #ifndef _WIN64 #define _MCOUNT_CALL __attribute__ ((regparm (2))) extern void _mcount(void); #else #define _MCOUNT_CALL extern void mcount(void); #endif #define _MCOUNT_DECL __attribute__((gnu_inline)) __inline__ \ void _MCOUNT_CALL _mcount_private #define MCOUNT #endif #ifdef __MINGW32__ #include <_bsd_types.h> #endif /* __MINGW32__*/ #ifdef __CYGWIN__ #include <winsup.h> #endif /* * Structure prepended to gmon.out profiling data file. */ struct gmonhdr { size_t lpc; /* base pc address of sample buffer */ size_t hpc; /* max pc address of sampled buffer */ int ncnt; /* size of sample buffer (plus this header) */ int version; /* version number */ int profrate; /* profiling clock rate */ int spare[3]; /* reserved */ }; #define GMONVERSION 0x00051879 /* * histogram counters are unsigned shorts (according to the kernel). */ #define HISTCOUNTER unsigned short /* * fraction of text space to allocate for histogram counters here, 1/2 */ #define HISTFRACTION 2 /* * Fraction of text space to allocate for from hash buckets. * The value of HASHFRACTION is based on the minimum number of bytes * of separation between two subroutine call points in the object code. * Given MIN_SUBR_SEPARATION bytes of separation the value of * HASHFRACTION is calculated as: * * HASHFRACTION = MIN_SUBR_SEPARATION / (2 * sizeof(short) - 1); * * For example, on the VAX, the shortest two call sequence is: * * calls $0,(r0) * calls $0,(r0) * * which is separated by only three bytes, thus HASHFRACTION is * calculated as: * * HASHFRACTION = 3 / (2 * 2 - 1) = 1 * * Note that the division above rounds down, thus if MIN_SUBR_FRACTION * is less than three, this algorithm will not work! * * In practice, however, call instructions are rarely at a minimal * distance. Hence, we will define HASHFRACTION to be 2 across all * architectures. This saves a reasonable amount of space for * profiling data structures without (in practice) sacrificing * any granularity. */ #define HASHFRACTION 2 /* * percent of text space to allocate for tostructs with a minimum. */ #define ARCDENSITY 2 #define MINARCS 50 #define MAXARCS ((1 << (8 * sizeof(HISTCOUNTER))) - 2) struct tostruct { size_t selfpc; long count; u_int16_t link; u_int16_t pad; }; /* * a raw arc, with pointers to the calling site and * the called site and a count. */ struct rawarc { size_t raw_frompc; size_t raw_selfpc; long raw_count; }; /* * general rounding functions. */ #define ROUNDDOWN(x,y) (((x)/(y))*(y)) #define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y)) /* * The profiling data structures are housed in this structure. */ struct gmonparam { volatile LONG state; u_int16_t *kcount; size_t kcountsize; u_int16_t *froms; size_t fromssize; struct tostruct *tos; size_t tossize; long tolimit; size_t lowpc; size_t highpc; size_t textsize; size_t hashfraction; }; extern struct gmonparam _gmonparam; /* * Possible states of profiling. */ #define GMON_PROF_ON 0 #define GMON_PROF_BUSY 1 #define GMON_PROF_ERROR 2 #define GMON_PROF_OFF 3 /* * Sysctl definitions for extracting profiling information from the kernel. */ #define GPROF_STATE 0 /* int: profiling enabling variable */ #define GPROF_COUNT 1 /* struct: profile tick count buffer */ #define GPROF_FROMS 2 /* struct: from location hash bucket */ #define GPROF_TOS 3 /* struct: destination/count structure */ #define GPROF_GMONPARAM 4 /* struct: profiling parameters (see above) */ #endif /* !_SYS_GMONH_ */
/* Copyright 2003 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 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <link.h> extern int weak_function __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data); /* Define it as a pointer, such that we get a pointer to the global function descriptor, that won't be optimized away by the linker. */ static int (*ptr) (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data) = __dl_iterate_phdr; int dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data) { if (ptr) return ptr (callback, data); return 0; }
/* * Copyright (C) 2005-2020 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. */ #ifndef C_API_GUI_CONTROLS_FADE_LABEL_H #define C_API_GUI_CONTROLS_FADE_LABEL_H #include "../definitions.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct AddonToKodiFuncTable_kodi_gui_control_fade_label { void (*set_visible)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool visible); void (*add_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, const char* text); char* (*get_label)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); void (*set_scrolling)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle, bool scroll); void (*reset)(KODI_HANDLE kodiBase, KODI_GUI_CONTROL_HANDLE handle); } AddonToKodiFuncTable_kodi_gui_control_fade_label; #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ #endif /* !C_API_GUI_CONTROLS_FADE_LABEL_H */
/* Dump registers. Copyright (C) 1999, 2000 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 <sys/uio.h> #include <stdio-common/_itoa.h> /* We will print the register dump in this format: R0: XXXXXXXX R1: XXXXXXXX R2: XXXXXXXX R3: XXXXXXXX R4: XXXXXXXX R5: XXXXXXXX R6: XXXXXXXX R7: XXXXXXXX R8: XXXXXXXX R9: XXXXXXXX R10: XXXXXXXX R11: XXXXXXXX R12: XXXXXXXX R13: XXXXXXXX R14: XXXXXXXX R15: XXXXXXXX MACL: XXXXXXXX MACH: XXXXXXXX PC: XXXXXXXX PR: XXXXXXXX GBR: XXXXXXXX SR: XXXXXXXX FR0: XXXXXXXX FR1: XXXXXXXX FR2: XXXXXXXX FR3: XXXXXXXX FR4: XXXXXXXX FR5: XXXXXXXX FR6: XXXXXXXX FR7: XXXXXXXX FR8: XXXXXXXX FR9: XXXXXXXX FR10: XXXXXXXX FR11: XXXXXXXX FR12: XXXXXXXX FR13: XXXXXXXX FR14: XXXXXXXX FR15: XXXXXXXX XR0: XXXXXXXX XR1: XXXXXXXX XR2: XXXXXXXX XR3: XXXXXXXX XR4: XXXXXXXX XR5: XXXXXXXX XR6: XXXXXXXX XR7: XXXXXXXX XR8: XXXXXXXX XR9: XXXXXXXX XR10: XXXXXXXX XR11: XXXXXXXX XR12: XXXXXXXX XR13: XXXXXXXX XR14: XXXXXXXX XR15: XXXXXXXX FPSCR: XXXXXXXX FPUL: XXXXXXXX */ static void hexvalue (unsigned long int value, char *buf, size_t len) { char *cp = _itoa_word (value, buf + len, 16, 0); while (cp > buf) *--cp = '0'; } static void register_dump (int fd, struct sigcontext *ctx) { char regs[22][8]; struct iovec iov[112]; size_t nr = 0; #define ADD_STRING(str) \ iov[nr].iov_base = (char *) str; \ iov[nr].iov_len = strlen (str); \ ++nr #define ADD_MEM(str, len) \ iov[nr].iov_base = str; \ iov[nr].iov_len = len; \ ++nr /* Generate strings of register contents. */ hexvalue (ctx->sc_regs[0], regs[0], 8); hexvalue (ctx->sc_regs[1], regs[1], 8); hexvalue (ctx->sc_regs[2], regs[2], 8); hexvalue (ctx->sc_regs[3], regs[3], 8); hexvalue (ctx->sc_regs[4], regs[4], 8); hexvalue (ctx->sc_regs[5], regs[5], 8); hexvalue (ctx->sc_regs[6], regs[6], 8); hexvalue (ctx->sc_regs[7], regs[7], 8); hexvalue (ctx->sc_regs[8], regs[8], 8); hexvalue (ctx->sc_regs[9], regs[9], 8); hexvalue (ctx->sc_regs[10], regs[10], 8); hexvalue (ctx->sc_regs[11], regs[11], 8); hexvalue (ctx->sc_regs[12], regs[12], 8); hexvalue (ctx->sc_regs[13], regs[13], 8); hexvalue (ctx->sc_regs[14], regs[14], 8); hexvalue (ctx->sc_regs[15], regs[15], 8); hexvalue (ctx->sc_macl, regs[16], 8); hexvalue (ctx->sc_mach, regs[17], 8); hexvalue (ctx->sc_pc, regs[18], 8); hexvalue (ctx->sc_pr, regs[19], 8); hexvalue (ctx->sc_gbr, regs[20], 8); hexvalue (ctx->sc_sr, regs[21], 8); /* Generate the output. */ ADD_STRING ("Register dump:\n\n R0: "); ADD_MEM (regs[0], 8); ADD_STRING (" R1: "); ADD_MEM (regs[1], 8); ADD_STRING (" R2: "); ADD_MEM (regs[2], 8); ADD_STRING (" R3: "); ADD_MEM (regs[3], 8); ADD_STRING ("\n R4: "); ADD_MEM (regs[4], 8); ADD_STRING (" R5: "); ADD_MEM (regs[5], 8); ADD_STRING (" R6: "); ADD_MEM (regs[6], 8); ADD_STRING (" R7: "); ADD_MEM (regs[7], 8); ADD_STRING ("\n R8: "); ADD_MEM (regs[8], 8); ADD_STRING (" R9: "); ADD_MEM (regs[9], 8); ADD_STRING (" R10: "); ADD_MEM (regs[10], 8); ADD_STRING (" R11: "); ADD_MEM (regs[11], 8); ADD_STRING ("\n R12: "); ADD_MEM (regs[12], 8); ADD_STRING (" R13: "); ADD_MEM (regs[13], 8); ADD_STRING (" R14: "); ADD_MEM (regs[14], 8); ADD_STRING (" R15: "); ADD_MEM (regs[15], 8); ADD_STRING ("\n\nMACL: "); ADD_MEM (regs[16], 8); ADD_STRING (" MACH: "); ADD_MEM (regs[17], 8); ADD_STRING ("\n\n PC: "); ADD_MEM (regs[18], 8); ADD_STRING (" PR: "); ADD_MEM (regs[19], 8); ADD_STRING (" GBR: "); ADD_MEM (regs[20], 8); ADD_STRING (" SR: "); ADD_MEM (regs[21], 8); ADD_STRING ("\n"); /* Write the stuff out. */ writev (fd, iov, nr); } #define REGISTER_DUMP register_dump (fd, &ctx)
/* Copyright (C) 1991, 1995, 1996, 1997, 1999 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 <sys/types.h> #include <errno.h> #include <stddef.h> #include <dirent.h> /* Seek to position POS in DIRP. */ void seekdir (dirp, pos) DIR *dirp; long int pos; { if (dirp == NULL) { __set_errno (EINVAL); return; } __set_errno (ENOSYS); } stub_warning (seekdir) #include <stub-tag.h>
/* * Firmware Assisted dump header file. * * 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. * * Copyright 2011 IBM Corporation * Author: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> */ #ifndef __PPC64_FA_DUMP_H__ #define __PPC64_FA_DUMP_H__ #ifdef CONFIG_FA_DUMP /* * The RMA region will be saved for later dumping when kernel crashes. * RMA is Real Mode Area, the first block of logical memory address owned * by logical partition, containing the storage that may be accessed with * translate off. */ #define RMA_START 0x0 #define RMA_END (ppc64_rma_size) /* * On some Power systems where RMO is 128MB, it still requires minimum of * 256MB for kernel to boot successfully. When kdump infrastructure is * configured to save vmcore over network, we run into OOM issue while * loading modules related to network setup. Hence we need aditional 64M * of memory to avoid OOM issue. */ #define MIN_BOOT_MEM (((RMA_END < (0x1UL << 28)) ? (0x1UL << 28) : RMA_END) \ + (0x1UL << 26)) #define memblock_num_regions(memblock_type) (memblock.memblock_type.cnt) /* Firmware provided dump sections */ #define FADUMP_CPU_STATE_DATA 0x0001 #define FADUMP_HPTE_REGION 0x0002 #define FADUMP_REAL_MODE_REGION 0x0011 /* Dump request flag */ #define FADUMP_REQUEST_FLAG 0x00000001 /* FAD commands */ #define FADUMP_REGISTER 1 #define FADUMP_UNREGISTER 2 #define FADUMP_INVALIDATE 3 /* Dump status flag */ #define FADUMP_ERROR_FLAG 0x2000 #define FADUMP_CPU_ID_MASK ((1UL << 32) - 1) #define CPU_UNKNOWN (~((u32)0)) /* Utility macros */ #define SKIP_TO_NEXT_CPU(reg_entry) \ ({ \ while (be64_to_cpu(reg_entry->reg_id) != REG_ID("CPUEND")) \ reg_entry++; \ reg_entry++; \ }) extern int crashing_cpu; /* Kernel Dump section info */ struct fadump_section { __be32 request_flag; __be16 source_data_type; __be16 error_flags; __be64 source_address; __be64 source_len; __be64 bytes_dumped; __be64 destination_address; }; /* ibm,configure-kernel-dump header. */ struct fadump_section_header { __be32 dump_format_version; __be16 dump_num_sections; __be16 dump_status_flag; __be32 offset_first_dump_section; /* Fields for disk dump option. */ __be32 dd_block_size; __be64 dd_block_offset; __be64 dd_num_blocks; __be32 dd_offset_disk_path; /* Maximum time allowed to prevent an automatic dump-reboot. */ __be32 max_time_auto; }; /* * Firmware Assisted dump memory structure. This structure is required for * registering future kernel dump with power firmware through rtas call. * * No disk dump option. Hence disk dump path string section is not included. */ struct fadump_mem_struct { struct fadump_section_header header; /* Kernel dump sections */ struct fadump_section cpu_state_data; struct fadump_section hpte_region; struct fadump_section rmr_region; }; /* Firmware-assisted dump configuration details. */ struct fw_dump { unsigned long cpu_state_data_size; unsigned long hpte_region_size; unsigned long boot_memory_size; unsigned long reserve_dump_area_start; unsigned long reserve_dump_area_size; /* cmd line option during boot */ unsigned long reserve_bootvar; unsigned long fadumphdr_addr; unsigned long cpu_notes_buf; unsigned long cpu_notes_buf_size; int ibm_configure_kernel_dump; unsigned long fadump_enabled:1; unsigned long fadump_supported:1; unsigned long dump_active:1; unsigned long dump_registered:1; }; /* * Copy the ascii values for first 8 characters from a string into u64 * variable at their respective indexes. * e.g. * The string "FADMPINF" will be converted into 0x4641444d50494e46 */ static inline u64 str_to_u64(const char *str) { u64 val = 0; int i; for (i = 0; i < sizeof(val); i++) val = (*str) ? (val << 8) | *str++ : val << 8; return val; } #define STR_TO_HEX(x) str_to_u64(x) #define REG_ID(x) str_to_u64(x) #define FADUMP_CRASH_INFO_MAGIC STR_TO_HEX("FADMPINF") #define REGSAVE_AREA_MAGIC STR_TO_HEX("REGSAVE") /* The firmware-assisted dump format. * * The register save area is an area in the partition's memory used to preserve * the register contents (CPU state data) for the active CPUs during a firmware * assisted dump. The dump format contains register save area header followed * by register entries. Each list of registers for a CPU starts with * "CPUSTRT" and ends with "CPUEND". */ /* Register save area header. */ struct fadump_reg_save_area_header { __be64 magic_number; __be32 version; __be32 num_cpu_offset; }; /* Register entry. */ struct fadump_reg_entry { __be64 reg_id; __be64 reg_value; }; /* fadump crash info structure */ struct fadump_crash_info_header { u64 magic_number; u64 elfcorehdr_addr; u32 crashing_cpu; struct pt_regs regs; struct cpumask online_mask; }; /* Crash memory ranges */ #define INIT_CRASHMEM_RANGES (INIT_MEMBLOCK_REGIONS + 2) struct fad_crash_memory_ranges { unsigned long long base; unsigned long long size; }; extern int early_init_dt_scan_fw_dump(unsigned long node, const char *uname, int depth, void *data); extern int fadump_reserve_mem(void); extern int setup_fadump(void); extern int is_fadump_active(void); extern void crash_fadump(struct pt_regs *, const char *); extern void fadump_cleanup(void); #else /* CONFIG_FA_DUMP */ static inline int is_fadump_active(void) { return 0; } static inline void crash_fadump(struct pt_regs *regs, const char *str) { } #endif #endif
/* * Copyright (c) 2003 Fabrice Bellard * Copyright (c) 2015 Zhang Rui <bbcallen@gmail.com> * * This file is part of ijkPlayer. * Based on libavformat/allformats.c * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavformat/avformat.h" #include "libavformat/url.h" #include "libavformat/version.h" #define FF_REGISTER_PROTOCOL(x) \ { \ extern URLProtocol ff_##x##_protocol; \ ffurl_register_protocol(&ff_##x##_protocol); \ } #define IJK_REGISTER_PROTOCOL(x) \ { \ extern URLProtocol ijkff_##x##_protocol; \ ffurl_register_protocol(&ijkff_##x##_protocol); \ } #define IJK_REGISTER_DEMUXER(x) \ { \ extern AVInputFormat ijkff_##x##_demuxer; \ av_register_input_format(&ijkff_##x##_demuxer); \ } void ijkav_register_all(void) { static int initialized; if (initialized) return; initialized = 1; /* protocols */ FF_REGISTER_PROTOCOL(async); IJK_REGISTER_PROTOCOL(ijkhttphook); IJK_REGISTER_PROTOCOL(ijkinject); IJK_REGISTER_PROTOCOL(ijklongurl); IJK_REGISTER_PROTOCOL(ijksegment); IJK_REGISTER_PROTOCOL(ijktcphook); /* demuxers */ IJK_REGISTER_DEMUXER(ijklivehook); }
/****************************************************************************** * Copyright (c) 2004, 2008 IBM Corporation * All rights reserved. * This program and the accompanying materials * are made available under the terms of the BSD License * which accompanies this distribution, and is available at * http://www.opensource.org/licenses/bsd-license.php * * Contributors: * IBM Corporation - initial implementation *****************************************************************************/ #ifndef IOLIB_H #define IOLIB_H #include <stdint.h> #define addr_t volatile unsigned int #define addr8_t volatile unsigned char extern void halt_sys (unsigned int); extern uint32_t get_sb_version (void); extern void uart_send_byte(unsigned char b); extern void io_putchar(unsigned char); extern uint64_t tb_frequency(void); extern uint64_t be_frequency(void); extern uint32_t get_dec(void); extern void set_dec(uint32_t); extern void delay_ms( unsigned int ms ); #endif
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * pkix_pl_crlentry.h * * CRL Entry Type Object Definitions * */ #ifndef _PKIX_PL_CRLENTRY_H #define _PKIX_PL_CRLENTRY_H #include "pkix_pl_common.h" #ifdef __cplusplus extern "C" { #endif #define PKIX_PL_CRL_REASONCODE_NOTSET (-1) struct PKIX_PL_CRLEntryStruct { CERTCrlEntry *nssCrlEntry; PKIX_PL_BigInt *serialNumber; PKIX_List *critExtOids; PKIX_Int32 userReasonCode; PKIX_Boolean userReasonCodeAbsent; }; /* see source file for function documentation */ PKIX_Error *pkix_pl_CRLEntry_RegisterSelf(void *plContext); /* following functions are called by CRL only hence not public */ PKIX_Error * pkix_pl_CRLEntry_Create( CERTCrlEntry **nssCrlEntry, /* head of entry list */ PKIX_List **pCrlEntryList, void *plContext); #ifdef __cplusplus } #endif #endif /* _PKIX_PL_CRLENTRY_H */
/* Written 2000 by Werner Almesberger */ #include <errno.h> #include <stdlib.h> #include <string.h> #include <sys/dirent.h> #include <sys/stat.h> #include <unistd.h> static int resolve_path(char *path, char *result, char *pos) { if (*path == '/') { *result = '/'; pos = result+1; ++path; } *pos = 0; if (!*path) return 0; while (1) { struct stat st; char *slash = *path ? strchr(path,'/') : NULL; if (slash) *slash = 0; if (!path[0] || (path[0] == '.' && (!path[1] || (path[1] == '.' && !path[2])))) { --pos; if (pos != result && path[0] && path[1]) while (*--pos != '/'); } else { strcpy(pos,path); if (lstat(result,&st) < 0) return -1; if (S_ISLNK(st.st_mode)) { char buf[PATH_MAX_SIZE]; if (readlink(result,buf,sizeof(buf)) < 0) return -1; *pos = 0; if (slash) { *slash = '/'; strcat(buf, slash); } strcpy(path,buf); if (*path == '/') result[1] = 0; pos = strchr(result,0); continue; } pos = strchr(result,0); } if (slash) { *pos++ = '/'; path = slash + 1; } *pos = 0; if (!slash) break; } return 0; } char *realpath(const char *path, char *resolved_path) { char cwd[PATH_MAX_SIZE]; char *path_copy; int res; if (!*path) { errno = ENOENT; return NULL; } if (!getcwd(cwd, sizeof(cwd))) return NULL; strcpy(resolved_path, "/"); if (resolve_path(cwd, resolved_path, resolved_path)) return NULL; strcat(resolved_path, "/"); path_copy = strdup(path); if (!path_copy) return NULL; res = resolve_path(path_copy, resolved_path, strchr(resolved_path, 0)); free(path_copy); if (res) return NULL; return resolved_path; }
/**************************************************************************** * * 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. * ****************************************************************************/ /* * Copyright (c) 2001-2003 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 lwIP TCP/IP stack. * * Author: Adam Dunkels <adam@sics.se> * */ #ifndef __PERF_H__ #define __PERF_H__ #define PERF_START /* null definition */ #define PERF_STOP(x) /* null definition */ #endif /* __PERF_H__ */
/* * drivers/base/dma-mapping.c - arch-independent dma-mapping routines * * Copyright (c) 2006 SUSE Linux Products GmbH * Copyright (c) 2006 Tejun Heo <teheo@suse.de> * * This file is released under the GPLv2. */ #include <linux/dma-mapping.h> #include <linux/export.h> #include <linux/gfp.h> /* * Managed DMA API */ struct dma_devres { size_t size; void *vaddr; dma_addr_t dma_handle; }; static void dmam_coherent_release(struct device *dev, void *res) { struct dma_devres *this = res; dma_free_coherent(dev, this->size, this->vaddr, this->dma_handle); } static void dmam_noncoherent_release(struct device *dev, void *res) { struct dma_devres *this = res; dma_free_noncoherent(dev, this->size, this->vaddr, this->dma_handle); } static int dmam_match(struct device *dev, void *res, void *match_data) { struct dma_devres *this = res, *match = match_data; if (this->vaddr == match->vaddr) { WARN_ON(this->size != match->size || this->dma_handle != match->dma_handle); return 1; } return 0; } /** * dmam_alloc_coherent - Managed dma_alloc_coherent() * @dev: Device to allocate coherent memory for * @size: Size of allocation * @dma_handle: Out argument for allocated DMA handle * @gfp: Allocation flags * * Managed dma_alloc_coherent(). Memory allocated using this function * will be automatically released on driver detach. * * RETURNS: * Pointer to allocated memory on success, NULL on failure. */ void * dmam_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp) { struct dma_devres *dr; void *vaddr; dr = devres_alloc(dmam_coherent_release, sizeof(*dr), gfp); if (!dr) return NULL; vaddr = dma_alloc_coherent(dev, size, dma_handle, gfp); if (!vaddr) { devres_free(dr); return NULL; } dr->vaddr = vaddr; dr->dma_handle = *dma_handle; dr->size = size; devres_add(dev, dr); return vaddr; } EXPORT_SYMBOL(dmam_alloc_coherent); /** * dmam_free_coherent - Managed dma_free_coherent() * @dev: Device to free coherent memory for * @size: Size of allocation * @vaddr: Virtual address of the memory to free * @dma_handle: DMA handle of the memory to free * * Managed dma_free_coherent(). */ void dmam_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle) { struct dma_devres match_data = { size, vaddr, dma_handle }; dma_free_coherent(dev, size, vaddr, dma_handle); WARN_ON(devres_destroy(dev, dmam_coherent_release, dmam_match, &match_data)); } EXPORT_SYMBOL(dmam_free_coherent); /** * dmam_alloc_non_coherent - Managed dma_alloc_non_coherent() * @dev: Device to allocate non_coherent memory for * @size: Size of allocation * @dma_handle: Out argument for allocated DMA handle * @gfp: Allocation flags * * Managed dma_alloc_non_coherent(). Memory allocated using this * function will be automatically released on driver detach. * * RETURNS: * Pointer to allocated memory on success, NULL on failure. */ void *dmam_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp) { struct dma_devres *dr; void *vaddr; dr = devres_alloc(dmam_noncoherent_release, sizeof(*dr), gfp); if (!dr) return NULL; vaddr = dma_alloc_noncoherent(dev, size, dma_handle, gfp); if (!vaddr) { devres_free(dr); return NULL; } dr->vaddr = vaddr; dr->dma_handle = *dma_handle; dr->size = size; devres_add(dev, dr); return vaddr; } EXPORT_SYMBOL(dmam_alloc_noncoherent); /** * dmam_free_coherent - Managed dma_free_noncoherent() * @dev: Device to free noncoherent memory for * @size: Size of allocation * @vaddr: Virtual address of the memory to free * @dma_handle: DMA handle of the memory to free * * Managed dma_free_noncoherent(). */ void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle) { struct dma_devres match_data = { size, vaddr, dma_handle }; dma_free_noncoherent(dev, size, vaddr, dma_handle); WARN_ON(!devres_destroy(dev, dmam_noncoherent_release, dmam_match, &match_data)); } EXPORT_SYMBOL(dmam_free_noncoherent); #ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY static void dmam_coherent_decl_release(struct device *dev, void *res) { dma_release_declared_memory(dev); } /** * dmam_declare_coherent_memory - Managed dma_declare_coherent_memory() * @dev: Device to declare coherent memory for * @bus_addr: Bus address of coherent memory to be declared * @device_addr: Device address of coherent memory to be declared * @size: Size of coherent memory to be declared * @flags: Flags * * Managed dma_declare_coherent_memory(). * * RETURNS: * 0 on success, -errno on failure. */ int dmam_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, dma_addr_t device_addr, size_t size, int flags) { void *res; int rc; res = devres_alloc(dmam_coherent_decl_release, 0, GFP_KERNEL); if (!res) return -ENOMEM; rc = dma_declare_coherent_memory(dev, bus_addr, device_addr, size, flags); if (rc == 0) devres_add(dev, res); else devres_free(res); return rc; } EXPORT_SYMBOL(dmam_declare_coherent_memory); /** * dmam_release_declared_memory - Managed dma_release_declared_memory(). * @dev: Device to release declared coherent memory for * * Managed dmam_release_declared_memory(). */ void dmam_release_declared_memory(struct device *dev) { WARN_ON(devres_destroy(dev, dmam_coherent_decl_release, NULL, NULL)); } EXPORT_SYMBOL(dmam_release_declared_memory); #endif
#ifndef __MACH_ATMEL_MCI_H #define __MACH_ATMEL_MCI_H #include <linux/dw_dmac.h> struct mci_dma_data { struct dw_dma_slave sdata; }; #define slave_data_ptr(s) (&(s)->sdata) #define find_slave_dev(s) ((s)->sdata.dma_dev) #endif
/* Function below main (_start) is part of this object. * So we use main() in this object as a marker for * functions in inlinfo_nested.so. */ extern int main_nested(void); int main() { return main_nested(); }
/* * Input Power Event -> APM Bridge * * Copyright (c) 2007 Richard Purdie * * 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. * */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/input.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/tty.h> #include <linux/delay.h> #include <linux/pm.h> #include <linux/apm-emulation.h> static void system_power_event(unsigned int keycode) { switch (keycode) { case KEY_SUSPEND: apm_queue_event(APM_USER_SUSPEND); pr_info("Requesting system suspend...\n"); break; default: break; } } static void apmpower_event(struct input_handle *handle, unsigned int type, unsigned int code, int value) { if (value != 1) return; switch (type) { case EV_PWR: system_power_event(code); break; default: break; } } static int apmpower_connect(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id) { struct input_handle *handle; int error; handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL); if (!handle) return -ENOMEM; handle->dev = dev; handle->handler = handler; handle->name = "apm-power"; error = input_register_handle(handle); if (error) { pr_err("Failed to register input power handler, error %d\n", error); kfree(handle); return error; } error = input_open_device(handle); if (error) { pr_err("Failed to open input power device, error %d\n", error); input_unregister_handle(handle); kfree(handle); return error; } return 0; } static void apmpower_disconnect(struct input_handle *handle) { input_close_device(handle); input_unregister_handle(handle); kfree(handle); } static const struct input_device_id apmpower_ids[] = { { .flags = INPUT_DEVICE_ID_MATCH_EVBIT, .evbit = { BIT_MASK(EV_PWR) }, }, { }, }; MODULE_DEVICE_TABLE(input, apmpower_ids); static struct input_handler apmpower_handler = { .event = apmpower_event, .connect = apmpower_connect, .disconnect = apmpower_disconnect, .name = "apm-power", .id_table = apmpower_ids, }; static int __init apmpower_init(void) { return input_register_handler(&apmpower_handler); } static void __exit apmpower_exit(void) { input_unregister_handler(&apmpower_handler); } module_init(apmpower_init); module_exit(apmpower_exit); MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>"); MODULE_DESCRIPTION("Input Power Event -> APM Bridge"); MODULE_LICENSE("GPL");
/* * v4l2-fh.h * * V4L2 file handle. Store per file handle data for the V4L2 * framework. Using file handles is optional for the drivers. * * Copyright (C) 2009--2010 Nokia Corporation. * * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> * * 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. * * 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 V4L2_FH_H #define V4L2_FH_H #include <linux/list.h> struct video_device; struct v4l2_ctrl_handler; struct v4l2_fh { struct list_head list; struct video_device *vdev; struct v4l2_ctrl_handler *ctrl_handler; enum v4l2_priority prio; wait_queue_head_t wait; struct list_head subscribed; struct list_head available; unsigned int navailable; u32 sequence; }; void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); void v4l2_fh_add(struct v4l2_fh *fh); int v4l2_fh_open(struct file *filp); void v4l2_fh_del(struct v4l2_fh *fh); void v4l2_fh_exit(struct v4l2_fh *fh); int v4l2_fh_release(struct file *filp); int v4l2_fh_is_singular(struct v4l2_fh *fh); static inline int v4l2_fh_is_singular_file(struct file *filp) { return v4l2_fh_is_singular(filp->private_data); } #endif
// license:BSD-3-Clause // copyright-holders:Vas Crabb //============================================================ // // consoleview.h - MacOS X Cocoa debug window handling // //============================================================ #import "debugosx.h" #import "debugview.h" #import <Cocoa/Cocoa.h> @interface MAMEConsoleView : MAMEDebugView { } - (id)initWithFrame:(NSRect)f machine:(running_machine &)m; @end
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ #pragma once /*** This file is part of systemd. Copyright 2010 Lennart Poettering systemd 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. systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>. ***/ #include "util.h" #ifdef HAVE_UTMP int utmp_get_runlevel(int *runlevel, int *previous); int utmp_put_shutdown(void); int utmp_put_reboot(usec_t timestamp); int utmp_put_runlevel(int runlevel, int previous); int utmp_put_dead_process(const char *id, pid_t pid, int code, int status); int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line); int utmp_wall( const char *message, const char *username, const char *origin_tty, bool (*match_tty)(const char *tty, void *userdata), void *userdata); #else /* HAVE_UTMP */ static inline int utmp_get_runlevel(int *runlevel, int *previous) { return -ESRCH; } static inline int utmp_put_shutdown(void) { return 0; } static inline int utmp_put_reboot(usec_t timestamp) { return 0; } static inline int utmp_put_runlevel(int runlevel, int previous) { return 0; } static inline int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) { return 0; } static inline int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line) { return 0; } static inline int utmp_wall( const char *message, const char *username, const char *origin_tty, bool (*match_tty)(const char *tty, void *userdata), void *userdata) { return 0; } #endif /* HAVE_UTMP */
/* Copyright © 2007 Apple Inc. All Rights Reserved. Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= AUOutputElement.h =============================================================================*/ #ifndef __AUOutput_h__ #define __AUOutput_h__ #include "AUScopeElement.h" #include "AUBuffer.h" /*! @class AUOutputElement */ class AUOutputElement : public AUIOElement { public: /*! @ctor AUOutputElement */ AUOutputElement(AUBase *audioUnit); // AUElement override /*! @method SetStreamFormat */ virtual OSStatus SetStreamFormat(const CAStreamBasicDescription &desc); /*! @method NeedsBufferSpace */ virtual bool NeedsBufferSpace() const { return true; } }; #endif // __AUOutput_h__
/* * Copyright (C) 2014 Zheng Li <dev@zheng.li> * * This program 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; version 2.1 only. with the special * exception on linking described in file 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 Lesser General Public License for more details. */ #include <poll.h> #include <errno.h> #include <sys/resource.h> #include <unistd.h> #include <caml/mlvalues.h> #include <caml/memory.h> #include <caml/fail.h> #include <caml/alloc.h> #include <caml/signals.h> #include <caml/unixsupport.h> CAMLprim value stub_select_on_poll(value fd_events, value timeo) { CAMLparam2(fd_events, timeo); CAMLlocal1(events); int i, rc, c_len = Wosize_val(fd_events), c_timeo = Int_val(timeo); struct pollfd c_fds[c_len]; for (i = 0; i < c_len; i++) { events = Field(Field(fd_events, i), 1); c_fds[i].fd = Int_val(Field(Field(fd_events, i), 0)); c_fds[i].events = c_fds[i].revents = 0; c_fds[i].events |= Bool_val(Field(events, 0)) ? POLLIN : 0; c_fds[i].events |= Bool_val(Field(events, 1)) ? POLLOUT: 0; c_fds[i].events |= Bool_val(Field(events, 2)) ? POLLPRI: 0; }; caml_enter_blocking_section(); rc = poll(c_fds, c_len, c_timeo); caml_leave_blocking_section(); if (rc < 0) uerror("poll", Nothing); if (rc > 0) { for (i = 0; i < c_len; i++) { events = Field(Field(fd_events, i), 1); if (c_fds[i].revents & POLLNVAL) unix_error(EBADF, "select", Nothing); Field(events, 0) = Val_bool(c_fds[i].events & POLLIN && c_fds[i].revents & (POLLIN |POLLHUP|POLLERR)); Field(events, 1) = Val_bool(c_fds[i].events & POLLOUT && c_fds[i].revents & (POLLOUT|POLLHUP|POLLERR)); Field(events, 2) = Val_bool(c_fds[i].revents & POLLPRI); } } CAMLreturn(Val_int(rc)); } CAMLprim value stub_set_fd_limit(value limit) { CAMLparam1(limit); struct rlimit rl; rl.rlim_cur = rl.rlim_max = Int_val(limit); if (setrlimit(RLIMIT_NOFILE, &rl) != 0) uerror("setrlimit", Nothing); CAMLreturn(Val_unit); }
/* strsource.c - Describing an error source. Copyright (C) 2003 g10 Code GmbH This file is part of libgpg-error. libgpg-error 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. libgpg-error 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 libgpg-error; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if HAVE_CONFIG_H #include <config.h> #endif #include <gpg-error.h> #include "gettext.h" #include "err-sources.h" /* Return a pointer to a string containing a description of the error source in the error value ERR. */ const char * gpg_strsource (gpg_error_t err) { gpg_err_source_t source = gpg_err_source (err); return dgettext (PACKAGE, msgstr + msgidx[msgidxof (source)]); }
/****************************************************************** * * Copyright 2015 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. * ******************************************************************/ /** * @file simulator_utils.h * * @brief This file provides utility methods used by both client and servers. */ #ifndef SIMULATOR_UTILS_H_ #define SIMULATOR_UTILS_H_ #include "simulator_exceptions.h" #include "octypes.h" #include "OCException.h" #include <map> /** * Utilities for Invocation of OC platfrom level APIs. */ template <typename FnT, typename... ArgsT> typename std::enable_if<std::is_same<OCStackResult, decltype(std::declval<FnT>()(std::declval<ArgsT>()...))>::value>::type invokeocplatform(FnT fn, ArgsT &&...args) { try { OCStackResult ocResult = fn(std::forward<ArgsT>(args)...); if (OC_STACK_OK != ocResult) { // Throw SimulatorException converting error codes throw SimulatorException(static_cast<SimulatorResult>(ocResult), OC::OCException::reason(ocResult)); } } catch (OC::OCException &e) { // Throw SimulatorException converting error codes throw SimulatorException(static_cast<SimulatorResult>(e.code()), e.reason()); } } namespace OC { class OCRepresentation; } std::string getPayloadString(const OC::OCRepresentation &); std::string getPayloadTypeString(OCPayloadType type); std::string getRequestString(const std::map<std::string, std::string> &queryParams, const OC::OCRepresentation &rep); std::string getRequestString(const std::map<std::string, std::string> &queryParams); #define VALIDATE_INPUT(CONDITION, MSG) if (CONDITION) {throw InvalidArgsException(SIMULATOR_INVALID_PARAM, MSG);} #define VALIDATE_CALLBACK(CALLBACK) if (!CALLBACK){throw InvalidArgsException(SIMULATOR_INVALID_CALLBACK, "Invalid callback!");} #endif
/* * MessagePack for C * * Copyright (C) 2008-2009 FURUHASHI Sadayuki * * 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. */ /** * @defgroup msgpack MessagePack C * @{ * @} */ #include "msgpack/object.h" #include "msgpack/zone.h" #include "msgpack/pack.h" #include "msgpack/unpack.h" #include "msgpack/sbuffer.h" #include "msgpack/vrefbuffer.h" #include "msgpack/version.h"
#ifndef __EXTENDED_KEYS_H__ #define __EXTENDED_KEYS_H__ enum { PSX_FREEZE_KEY = 0xFFBE/*XK_F1*/, PSX_NEXT_FREEZE_SLOT_KEY = 0xFFBF/*XK_F2*/, PSX_DEFROST_KEY = 0xFFC0/*XK_F3*/, PSX_SHOW_FREEZE_PIC_KEY = 0xFFC1/*XK_F4*/, PSX_SIO_ALWAYS_ON_KEY = 0xFFC2/*XK_F5*/, PSX_BW_MDEC_KEY = 0xFFC3/*XK_F6*/, PSX_XA_AUDIO_ON_KEY = 0xFFC4/*XK_F7*/, PSX_SNAPSHOT_KEY = 0xFFC5/*XK_F8*/, PSX_OPEN_SHELL_KEY = 0xFFC6/*XK_F9*/, PSX_CLOSE_SHELL_KEY = 0xFFC7/*XK_F10*/, PSX_STOP_KEY = 0xFF1B/*XK_Escape*/, GPU_FULLSCREEN_KEY = 0x0100, GPU_FPS_DISPLAY_KEY = 0xFFFF,/*XK_Delete*/ // Fake HotKeys GPU_HOTKEYS = 0x020, GPU_FAST_FORWARD, GPU_FRAME_LIMIT }; #endif //__EXTENDED_KEYS_H__
// gold-threads.h -- thread support for gold -*- C++ -*- // Copyright (C) 2006-2014 Free Software Foundation, Inc. // Written by Ian Lance Taylor <iant@google.com>. // This file is part of gold. // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, // MA 02110-1301, USA. // gold can be configured to support threads. If threads are // supported, the user can specify at runtime whether or not to // support them. This provides an interface to manage locking // accordingly. // Lock // A simple lock class. #ifndef GOLD_THREADS_H #define GOLD_THREADS_H namespace gold { class Condvar; class Once_initialize; class Initialize_lock_once; // The interface for the implementation of a Lock. class Lock_impl { public: Lock_impl() { } virtual ~Lock_impl() { } virtual void acquire() = 0; virtual void release() = 0; }; // A simple lock class. class Lock { public: Lock(); ~Lock(); // Acquire the lock. void acquire() { this->lock_->acquire(); } // Release the lock. void release() { this->lock_->release(); } private: // This class can not be copied. Lock(const Lock&); Lock& operator=(const Lock&); friend class Condvar; Lock_impl* get_impl() const { return this->lock_; } Lock_impl* lock_; }; // RAII for Lock. class Hold_lock { public: Hold_lock(Lock& lock) : lock_(lock) { this->lock_.acquire(); } ~Hold_lock() { this->lock_.release(); } private: // This class can not be copied. Hold_lock(const Hold_lock&); Hold_lock& operator=(const Hold_lock&); Lock& lock_; }; class Hold_optional_lock { public: Hold_optional_lock(Lock* lock) : lock_(lock) { if (this->lock_ != NULL) this->lock_->acquire(); } ~Hold_optional_lock() { if (this->lock_ != NULL) this->lock_->release(); } private: Hold_optional_lock(const Hold_optional_lock&); Hold_optional_lock& operator=(const Hold_optional_lock&); Lock* lock_; }; // The interface for the implementation of a condition variable. class Condvar_impl { public: Condvar_impl() { } virtual ~Condvar_impl() { } virtual void wait(Lock_impl*) = 0; virtual void signal() = 0; virtual void broadcast() = 0; }; // A simple condition variable class. It is always associated with a // specific lock. class Condvar { public: Condvar(Lock& lock); ~Condvar(); // Wait for the condition variable to be signalled. This should // only be called when the lock is held. void wait() { this->condvar_->wait(this->lock_.get_impl()); } // Signal the condition variable--wake up at least one thread // waiting on the condition variable. This should only be called // when the lock is held. void signal() { this->condvar_->signal(); } // Broadcast the condition variable--wake up all threads waiting on // the condition variable. This should only be called when the lock // is held. void broadcast() { this->condvar_->broadcast(); } private: // This class can not be copied. Condvar(const Condvar&); Condvar& operator=(const Condvar&); Lock& lock_; Condvar_impl* condvar_; }; // A class used to do something once. This is an abstract parent // class; any actual use will involve a child of this. class Once { public: Once(); virtual ~Once() { } // Call this function to do whatever it is. We pass an argument // even though you have to use a child class because in some uses // setting the argument would itself require a Once class. void run_once(void* arg); // This is an internal function, which must be public because it is // run by an extern "C" function called via pthread_once. void internal_run(void* arg); protected: // This must be implemented by the child class. virtual void do_run_once(void* arg) = 0; private: // True if we have already run the function. bool was_run_; #if defined(ENABLE_THREADS) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) // Internal compare-and-swap lock on was_run_; uint32_t was_run_lock_; #endif // The lock to run the function only once. Once_initialize* once_; }; // A class used to initialize a lock exactly once, after the options // have been read. This is needed because the implementation of locks // depends on whether we've seen the --threads option. Before the // options have been read, we know we are single-threaded, so we can // get by without using a lock. This class should be an instance // variable of the class which has a lock which needs to be // initialized. class Initialize_lock : public Once { public: // The class which uses this will have a pointer to a lock. This // must be constructed with a pointer to that pointer. Initialize_lock(Lock** pplock) : pplock_(pplock) { } // Initialize the lock. Return true if the lock is now initialized, // false if it is not (because the options have not yet been read). bool initialize(); protected: void do_run_once(void*); private: // A pointer to the lock pointer which must be initialized. Lock** const pplock_; }; } // End namespace gold. #endif // !defined(GOLD_THREADS_H)
/* * Copyright (C) 2012 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., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ FILE_LICENCE ( GPL2_OR_LATER ); #include <time.h> /** @file * * Date and time * * POSIX:2008 section 4.15 defines "seconds since the Epoch" as an * abstract measure approximating the number of seconds that have * elapsed since the Epoch, excluding leap seconds. The formula given * is * * tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 + * (tm_year-70)*31536000 + ((tm_year-69)/4)*86400 - * ((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400 * * This calculation assumes that leap years occur in each year that is * either divisible by 4 but not divisible by 100, or is divisible by * 400. */ /** Days of week (for debugging) */ static const char *weekdays[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; /** * Determine whether or not year is a leap year * * @v tm_year Years since 1900 * @v is_leap_year Year is a leap year */ static int is_leap_year ( int tm_year ) { int leap_year = 0; if ( ( tm_year % 4 ) == 0 ) leap_year = 1; if ( ( tm_year % 100 ) == 0 ) leap_year = 0; if ( ( tm_year % 400 ) == 100 ) leap_year = 1; return leap_year; } /** * Calculate number of leap years since 1900 * * @v tm_year Years since 1900 * @v num_leap_years Number of leap years */ static int leap_years_to_end ( int tm_year ) { int leap_years = 0; leap_years += ( tm_year / 4 ); leap_years -= ( tm_year / 100 ); leap_years += ( ( tm_year + 300 ) / 400 ); return leap_years; } /** * Calculate day of week * * @v tm_year Years since 1900 * @v tm_mon Month of year [0,11] * @v tm_day Day of month [1,31] */ static int day_of_week ( int tm_year, int tm_mon, int tm_mday ) { static const uint8_t offset[12] = { 1, 4, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; int pseudo_year = tm_year; if ( tm_mon < 2 ) pseudo_year--; return ( ( pseudo_year + leap_years_to_end ( pseudo_year ) + offset[tm_mon] + tm_mday ) % 7 ); } /** Days from start of year until start of months (in non-leap years) */ static const uint16_t days_to_month_start[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; /** * Calculate seconds since the Epoch * * @v tm Broken-down time * @ret time Seconds since the Epoch */ time_t mktime ( struct tm *tm ) { int days_since_epoch; int seconds_since_day; time_t seconds; /* Calculate day of year */ tm->tm_yday = ( ( tm->tm_mday - 1 ) + days_to_month_start[ tm->tm_mon ] ); if ( ( tm->tm_mon >= 2 ) && is_leap_year ( tm->tm_year ) ) tm->tm_yday++; /* Calculate day of week */ tm->tm_wday = day_of_week ( tm->tm_year, tm->tm_mon, tm->tm_mday ); /* Calculate seconds since the Epoch */ days_since_epoch = ( tm->tm_yday + ( 365 * tm->tm_year ) - 25567 + leap_years_to_end ( tm->tm_year - 1 ) ); seconds_since_day = ( ( ( ( tm->tm_hour * 60 ) + tm->tm_min ) * 60 ) + tm->tm_sec ); seconds = ( ( ( ( time_t ) days_since_epoch ) * ( ( time_t ) 86400 ) ) + seconds_since_day ); DBGC ( &weekdays, "TIME %04d-%02d-%02d %02d:%02d:%02d => %lld (%s, " "day %d)\n", ( tm->tm_year + 1900 ), ( tm->tm_mon + 1 ), tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, seconds, weekdays[ tm->tm_wday ], tm->tm_yday ); return seconds; }
// Copyright 2004-present Facebook. All Rights Reserved. #pragma once #if defined(WITH_JSC_EXTRA_TRACING) || DEBUG #include <inttypes.h> #include <JavaScriptCore/JSContextRef.h> namespace facebook { namespace react { uint64_t tracingTagFromJSValue(JSContextRef ctx, JSValueRef value, JSValueRef* exception); void addNativeTracingHooks(JSGlobalContextRef ctx); } } #endif
// This class contains common elements for the analysis in the First Physics Group. // based on the code by Arvinder Palaha // written by Andras Agocs and Anton Alkin #ifndef ALIANALYSISTASKFIRSTPHYSICS_H #define ALIANALYSISTASKFIRSTPHYSICS_H class TH1D; class TH2D; class TList; class AliESDtrackCuts; class AliESDEvent; #include "AliAnalysisTaskSE.h" #include "AliTriggerAnalysis.h" #include <string> class AliAnalysisTaskFirstPhysics : public AliAnalysisTaskSE { public: // indexing various track cuts enum { kTrackCutQGlo, kTrackCutQITS, kTrackCutDCAwSPD, kTrackCutDCAwoSPD, kTrackCutNoSPD, kTrackCutTPConly, knTrackCuts}; // this must always the last // recognised MC process types enum ProcessType { kProcSD1, // single diffractive AB->XB kProcSD2, // single diffractive AB->AX kProcDD, // double diffractive kProcEL, // elastic kProcCD, // central diffractive kProcND, // non-diffractive kProcIndef}; AliAnalysisTaskFirstPhysics(const char *name = "You should have given a name to this analysis"); virtual ~AliAnalysisTaskFirstPhysics(); virtual void UserCreateOutputObjects(); virtual void UserExec(Option_t *option); virtual void Terminate(Option_t *); void SetCutTrackPt(Double_t min, Double_t max) {fCutTrackPtMin = min; fCutTrackPtMax = max;} Double_t GetCutTrackPtMin() const {return fCutTrackPtMin;} Double_t GetCutTrackPtMax() const {return fCutTrackPtMax;} void SetCutEta(Double_t x) {fCutEta = x;} Double_t GetCutEta() const {return fCutEta;} void SetCutVertexZ(Double_t x) {fCutVertexZ = x;} Double_t GetCutVertexZ() const {return fCutVertexZ;} protected: void PrepareOutputList(); // create fOutput void PrepareDefaultTrackCuts(); // create cut objects bool PrepareMCInfo(); // check whether MC info is available and read process type bool GetESDEvent(); // sets fESD to the current ESD bool CheckVertex(); // checks for an appropriate vertex bool CheckVertexMC(); // checks for an appropriate vertex in the MC truth TH1D* UserHisto1d(const char *name, const char *title, const char *xlabel, Int_t nbinsx, Double_t xlow, Double_t xup); TH2D* UserHisto2d(const char *name, const char *title, const char *xlabel, Int_t nbinsx, Double_t xlow, Double_t xup, const char *ylabel, Int_t nbinsy, Double_t ylow, Double_t yup); bool GetHisto1FromOutput(const char *name, TH1D *&h) const; // read a histogram from fOutput; use this in Terminate() bool GetHisto2FromOutput(const char *name, TH2D *&h) const; // read a 2d histogram from fOutput AliESDEvent *fESD; //! the ESD information of the event AliMCEvent *fMCEvent; //! the MC information is available TList *fOutput; // Output list bool fbReadMC; //! indicates if MC information could be read; see PrepareMCInfo() ProcessType fMCProcessType; //! indicates the process type used in MC AliESDtrackCuts *fTrackCuts[knTrackCuts]; // Track cuts AliTriggerAnalysis* fTrigger; //! private: // simplest cut parameters Double_t fCutTrackPtMin; Double_t fCutTrackPtMax; Double_t fCutEta; Double_t fCutVertexZ; AliAnalysisTaskFirstPhysics(const AliAnalysisTaskFirstPhysics&); // not implemented AliAnalysisTaskFirstPhysics& operator=(const AliAnalysisTaskFirstPhysics&); // not implemented ClassDef(AliAnalysisTaskFirstPhysics, 1); }; #endif
#ifndef ALIDIELECTRONBTOJPSITOELECDFFITHANDLER_H #define ALIDIELECTRONBTOJPSITOELECDFFITHANDLER_H /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ //___________________________________________________________________________ // Class AliDielectronBtoJPSItoEleCDFfitHandler // Class to perform unbinned log-likelihood fit // // Origin: C. Di Giglio // Contact: Carmelo.Digiglio@ba.infn.it; Giuseppe.Bruno@ba.infn.it //____________________________________________________________________________ #include <TNamed.h> #include <TBits.h> #include <TGraph.h> #include <TFitter.h> class AliDielectronBtoJPSItoEleCDFfitFCN ; class AliDielectronBtoJPSItoEleCDFfitHandler : public TNamed { public: // AliDielectronBtoJPSItoEleCDFfitHandler(); AliDielectronBtoJPSItoEleCDFfitHandler& operator= (const AliDielectronBtoJPSItoEleCDFfitHandler& c); AliDielectronBtoJPSItoEleCDFfitHandler(const AliDielectronBtoJPSItoEleCDFfitHandler& c); AliDielectronBtoJPSItoEleCDFfitHandler(Double_t* decaytime, Double_t* invariantmass, Double_t *pt, Int_t *type, Int_t ncand); ~AliDielectronBtoJPSItoEleCDFfitHandler(); Double_t Up() const { return fUp; } void SetErrorDef(Double_t up) {fUp = up;} void SetPrintStatus(Bool_t okPrintStatus) { fPrintStatus = okPrintStatus; } Bool_t GetPrintStatus() const { return fPrintStatus ; } void SetParamStartValues (Double_t*); Double_t* GetStartParamValues() { return fParamStartValues; } TBits GetFixedParamList() const { return fIsParamFixed; } TFitter *GetFitter() const {return fitter;} Double_t GetParameter(Int_t numPar) const {return fitter->GetParameter(numPar);} Double_t GetParameterError(Int_t numPar) const {return fitter->GetParError(numPar);} void FixParam(UInt_t param, Bool_t value) { fIsParamFixed.SetBitNumber(param,value); } void FixAllParam(Bool_t value) { for(UInt_t par=0;par<49;par++) fIsParamFixed.SetBitNumber(par,value); } Bool_t IsParamFixed(UInt_t param) { return fIsParamFixed.TestBitNumber(param); } void SetResolutionConstants(Double_t* resolutionConst, Int_t type); void SetCrystalBallFunction(Bool_t okCB); void SetExponentialFunction(Bool_t okEpx); void SetMassWndHigh(Double_t limit); void SetMassWndLow(Double_t limit); Double_t operator()(const Double_t* par) const ; void CdfFCN(Int_t & /* npar */, Double_t * /* gin */, Double_t &f, Double_t *par, Int_t /* iflag */); Double_t* Decaytime() const { return fX; } Double_t* InvariantMass() const { return fM; } Double_t* TransverseMom() const { return fPt; } Int_t* TypeCand() const { return fType;} AliDielectronBtoJPSItoEleCDFfitFCN* LikelihoodPointer() const { return fLikely; } Int_t DoMinimization(Int_t step = 0); private: // TBits fIsParamFixed; //array of bits: 0 = param free; 1 = param fixed; Bool_t fPrintStatus; //flag to enable the prit out of the algorithm at each step Double_t fParamStartValues[49]; //array of parameters input value Double_t fUp; //error definition Double_t* fX; //pseudo-proper decay time X Double_t* fM; //invariant mass M Double_t* fPt; //invariant mass M Int_t* fType; //candidate type AliDielectronBtoJPSItoEleCDFfitFCN* fLikely; //Log likelihood function Int_t fNcand; //number of candidates TGraph* fContPlot1; //contour plot TGraph* fContPlot2; //contour plot TGraph* fContPlot3; //contour plot TFitter *fitter; //pointer to TFitter object // ClassDef(AliDielectronBtoJPSItoEleCDFfitHandler,1); }; #endif
/* multiroots/fdfsolver.c * * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough * * 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <config.h> #include <stdlib.h> #include <string.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_multiroots.h> gsl_multiroot_fdfsolver * gsl_multiroot_fdfsolver_alloc (const gsl_multiroot_fdfsolver_type * T, size_t n) { int status; gsl_multiroot_fdfsolver * s; s = (gsl_multiroot_fdfsolver *) malloc (sizeof (gsl_multiroot_fdfsolver)); if (s == 0) { GSL_ERROR_VAL ("failed to allocate space for multiroot solver struct", GSL_ENOMEM, 0); } s->x = gsl_vector_calloc (n); if (s->x == 0) { free (s); GSL_ERROR_VAL ("failed to allocate space for x", GSL_ENOMEM, 0); } s->f = gsl_vector_calloc (n); if (s->f == 0) { gsl_vector_free (s->x); free (s); GSL_ERROR_VAL ("failed to allocate space for f", GSL_ENOMEM, 0); } s->J = gsl_matrix_calloc (n,n); if (s->J == 0) { gsl_vector_free (s->x); gsl_vector_free (s->f); free (s); GSL_ERROR_VAL ("failed to allocate space for g", GSL_ENOMEM, 0); } s->dx = gsl_vector_calloc (n); if (s->dx == 0) { gsl_matrix_free (s->J); gsl_vector_free (s->x); gsl_vector_free (s->f); free (s); GSL_ERROR_VAL ("failed to allocate space for dx", GSL_ENOMEM, 0); } s->state = malloc (T->size); if (s->state == 0) { gsl_vector_free (s->dx); gsl_vector_free (s->x); gsl_vector_free (s->f); gsl_matrix_free (s->J); free (s); /* exception in constructor, avoid memory leak */ GSL_ERROR_VAL ("failed to allocate space for multiroot solver state", GSL_ENOMEM, 0); } s->type = T ; status = (s->type->alloc)(s->state, n); if (status != GSL_SUCCESS) { free (s->state); gsl_vector_free (s->dx); gsl_vector_free (s->x); gsl_vector_free (s->f); gsl_matrix_free (s->J); free (s); /* exception in constructor, avoid memory leak */ GSL_ERROR_VAL ("failed to set solver", status, 0); } s->fdf = NULL; return s; } int gsl_multiroot_fdfsolver_set (gsl_multiroot_fdfsolver * s, gsl_multiroot_function_fdf * f, const gsl_vector * x) { if (s->x->size != f->n) { GSL_ERROR ("function incompatible with solver size", GSL_EBADLEN); } if (x->size != f->n) { GSL_ERROR ("vector length not compatible with function", GSL_EBADLEN); } s->fdf = f; gsl_vector_memcpy(s->x,x); return (s->type->set) (s->state, s->fdf, s->x, s->f, s->J, s->dx); } int gsl_multiroot_fdfsolver_iterate (gsl_multiroot_fdfsolver * s) { return (s->type->iterate) (s->state, s->fdf, s->x, s->f, s->J, s->dx); } void gsl_multiroot_fdfsolver_free (gsl_multiroot_fdfsolver * s) { RETURN_IF_NULL (s); (s->type->free) (s->state); free (s->state); gsl_vector_free (s->dx); gsl_vector_free (s->x); gsl_vector_free (s->f); gsl_matrix_free (s->J); free (s); } const char * gsl_multiroot_fdfsolver_name (const gsl_multiroot_fdfsolver * s) { return s->type->name; } gsl_vector * gsl_multiroot_fdfsolver_root (const gsl_multiroot_fdfsolver * s) { return s->x; } gsl_vector * gsl_multiroot_fdfsolver_dx (const gsl_multiroot_fdfsolver * s) { return s->dx; } gsl_vector * gsl_multiroot_fdfsolver_f (const gsl_multiroot_fdfsolver * s) { return s->f; }
// // APOpenAPIObject.h // API对象,包含所有接口和对象数据定义 // // Created by Alipay on 15-4-15. // Copyright (c) 2015年 Alipay. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> // 错误码 typedef enum { APSuccess = 0, // 成功 APErrCodeCommon = -1, // 通用错误 APErrCodeUserCancel = -2, // 用户取消 APErrCodeSentFail = -3, // 发送失败 APErrCodeAuthDeny = -4, // 授权失败 APErrCodeUnsupport = -5, // 不支持 }APErrorCode; // 分享场景 typedef enum { APSceneSession = 0, // 会话 }APScene; #pragma mark - APBaseReq /*! @brief 该类为支付宝SDK所有请求类的基类 * */ @interface APBaseReq : NSObject /** 请求类型 */ @property (nonatomic, assign) int type; /** AppID,发送请求时第三方程序必须填写 */ @property (nonatomic, retain) NSString* openID; @end #pragma mark - APBaseResp /*! @brief 该类为SDK所有响应类的基类 * */ @interface APBaseResp : NSObject /** 错误码 */ @property (nonatomic, assign) int errCode; /** 错误提示字符串 */ @property (nonatomic, strong) NSString *errStr; /** 响应类型 */ @property (nonatomic, assign) int type; @property (nonatomic, strong) NSString *openID; @end #pragma mark - 发送消息到支付宝 /*! @brief 第三方程序发送消息至支付宝终端程序的消息结构体 * * 第三方程序向支付宝发送信息需要传入SendMessageToAPReq结构体,调用该方法后,支付宝处理完信息会向第三方程序发送一个处理结果。 * @see SendMessageToAPReq */ @class APMediaMessage; @interface APSendMessageToAPReq : APBaseReq // 发送消息的多媒体内容 @property (nonatomic, strong) APMediaMessage* message; @property (nonatomic, assign) APScene scene; @end /*! @brief 支付宝终端向第三方程序返回的SendMessageToAPReq处理结果。 * * 第三方程序向支付宝终端发送SendMessageToAPReq后,支付宝发送回来的处理结果,该结果用SendMessageToAPResp表示。 */ @interface APSendMessageToAPResp : APBaseResp @end #pragma mark - APMediaMessage /*! @brief 多媒体消息结构体 * * 用于支付宝终端和第三方程序之间传递消息的多媒体消息内容 */ @interface APMediaMessage : NSObject // 标题 @property (nonatomic, strong) NSString *title; // 描述内容 @property (nonatomic, strong) NSString *desc; // 缩略图数据 @property (nonatomic, strong) NSData *thumbData; @property (nonatomic, strong) NSString *thumbUrl; // 多媒体对象 @property (nonatomic, strong) id mediaObject; @end // 文本 @interface APShareTextObject : NSObject @property (nonatomic, strong) NSString *text; @end; // 图片 @interface APShareImageObject : NSObject @property (nonatomic, strong) NSData *imageData; @property (nonatomic, strong) NSString *imageUrl; @end; // 网页 @interface APShareWebObject : NSObject @property (nonatomic, strong) NSString *wepageUrl; @end;
// 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 CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_TRACK_SINK_H_ #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_TRACK_SINK_H_ #include <vector> #include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/time/time.h" #include "media/audio/audio_parameters.h" #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" namespace media { class AudioBus; } namespace content { class MediaStreamAudioSink; // Interface for reference counted holder of audio stream audio track sink. class MediaStreamAudioTrackSink : public base::RefCountedThreadSafe<MediaStreamAudioTrackSink> { public: // Note: OnData() and OnSetFormat() have the same meaning and semantics as in // content::MediaStreamAudioSink. See comments there for usage info. virtual void OnData(const media::AudioBus& audio_bus, base::TimeTicks estimated_capture_time) = 0; virtual void OnSetFormat(const media::AudioParameters& params) = 0; virtual void OnReadyStateChanged( blink::WebMediaStreamSource::ReadyState state) = 0; virtual void Reset() = 0; virtual bool IsEqual(const MediaStreamAudioSink* other) const = 0; // Wrapper which allows to use std::find_if() when adding and removing // sinks to/from the list. struct WrapsMediaStreamSink { WrapsMediaStreamSink(MediaStreamAudioSink* sink) : sink_(sink) {} bool operator()( const scoped_refptr<MediaStreamAudioTrackSink>& owner) const { return owner->IsEqual(sink_); } MediaStreamAudioSink* sink_; }; protected: virtual ~MediaStreamAudioTrackSink() {} private: friend class base::RefCountedThreadSafe<MediaStreamAudioTrackSink>; }; } // namespace content #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_TRACK_SINK_H_
/* * $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * * This source code is released for free distribution under the terms of the * GNU General Public License. * * External interface to entry.c */ #ifndef _ENTRY_H #define _ENTRY_H /* * INCLUDE FILES */ #include "general.h" /* must always come first */ #include <stdio.h> #include "vstring.h" /* * MACROS */ #define WHOLE_FILE -1L /* * DATA DECLARATIONS */ /* Maintains the state of the tag file. */ typedef struct eTagFile { char *name; char *directory; FILE *fp; struct sNumTags { unsigned long added, prev; } numTags; struct sMax { size_t line, tag, file; } max; struct sEtags { char *name; FILE *fp; size_t byteCount; } etags; vString *vLine; } tagFile; typedef struct sTagFields { unsigned int count; /* number of additional extension flags */ const char *const *label; /* list of labels for extension flags */ const char *const *value; /* list of values for extension flags */ } tagFields; /* Information about the current tag candidate. */ typedef struct sTagEntryInfo { boolean lineNumberEntry; /* pattern or line number entry */ unsigned long lineNumber; /* line number of tag */ fpos_t filePosition; /* file position of line containing tag */ const char* language; /* language of source file */ boolean isFileScope; /* is tag visibile only within source file? */ boolean isFileEntry; /* is this just an entry for a file name? */ boolean truncateLine; /* truncate tag line at end of tag name? */ const char *sourceFileName; /* name of source file */ const char *name; /* name of the tag */ const char *kindName; /* kind of tag */ char kind; /* single character representation of kind */ struct { const char* access; const char* fileScope; const char* implementation; const char* inheritance; const char* scope [2]; /* value and key */ const char* signature; /* type (union/struct/etc.) and name for a variable or typedef. */ const char* typeRef [2]; /* e.g., "struct" and struct name */ } extensionFields; /* list of extension fields*/ } tagEntryInfo; /* * GLOBAL VARIABLES */ extern tagFile TagFile; /* * FUNCTION PROTOTYPES */ extern void freeTagFileResources (void); extern const char *tagFileName (void); extern void copyBytes (FILE* const fromFp, FILE* const toFp, const long size); extern void copyFile (const char *const from, const char *const to, const long size); extern void openTagFile (void); extern void closeTagFile (const boolean resize); extern void beginEtagsFile (void); extern void endEtagsFile (const char *const name); extern void makeTagEntry (const tagEntryInfo *const tag); extern void initTagEntry (tagEntryInfo *const e, const char *const name); #endif /* _ENTRY_H */ /* vi:set tabstop=4 shiftwidth=4: */
/* JEDEC Flash Interface. * This is an older type of interface for self programming flash. It is * commonly use in older AMD chips and is obsolete compared with CFI. * It is called JEDEC because the JEDEC association distributes the ID codes * for the chips. * * See the AMD flash databook for information on how to operate the interface. * * $Id: jedec.h,v 1.3 2003/05/21 11:51:01 dwmw2 Exp $ */ #ifndef __LINUX_MTD_JEDEC_H__ #define __LINUX_MTD_JEDEC_H__ #include <linux/types.h> #define MAX_JEDEC_CHIPS 16 // Listing of all supported chips and their information struct JEDECTable { __u16 jedec; char *name; unsigned long size; unsigned long sectorsize; __u32 capabilities; }; // JEDEC being 0 is the end of the chip array struct jedec_flash_chip { __u16 jedec; unsigned long size; unsigned long sectorsize; // *(__u8*)(base + (adder << addrshift)) = data << datashift // Address size = size << addrshift unsigned long base; // Byte 0 of the flash, will be unaligned unsigned int datashift; // Useful for 32bit/16bit accesses unsigned int addrshift; unsigned long offset; // linerized start. base==offset for unbanked, uninterleaved flash __u32 capabilities; // These markers are filled in by the flash_chip_scan function unsigned long start; unsigned long length; }; struct jedec_private { unsigned long size; // Total size of all the devices /* Bank handling. If sum(bank_fill) == size then this is linear flash. Otherwise the mapping has holes in it. bank_fill may be used to find the holes, but in the common symetric case bank_fill[0] == bank_fill[*], thus addresses may be computed mathmatically. bank_fill must be powers of two */ unsigned is_banked; unsigned long bank_fill[MAX_JEDEC_CHIPS]; struct jedec_flash_chip chips[MAX_JEDEC_CHIPS]; }; #endif
#ifndef __ST_MMIO_H__ #define __ST_MMIO_H__ extern struct class *sec_class; extern struct class *camera_class; /* Flash IC Lux Value Setting */ void mmio_cam_flash_rt8515(int lux_val); void mmio_cam_flash_ktd262(int lux_val); /* NCP6914 Camera Sub-PMIC */ int NCP6914_subPMIC_module_init(void); void NCP6914_subPMIC_module_exit(void); int NCP6914_subPMIC_PowerOn(int opt); int NCP6914_subPMIC_PowerOff(int opt); int NCP6914_subPMIC_PinOnOff(int pin, int on_off); /* SM5103 Camera Sub-PMIC */ int SM5103_subPMIC_module_init(void); void SM5103_subPMIC_module_exit(void); int SM5103_subPMIC_PowerOn(int opt); int SM5103_subPMIC_PowerOff(int opt); int SM5103_subPMIC_PinOnOff(int pin, int on_off); void check_VT_CAM_ID(int pin); #endif
/* Copyright 2017 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. ==============================================================================*/ #ifndef TENSORFLOW_CORE_PLATFORM_CPU_FEATURE_GUARD_H_ #define TENSORFLOW_CORE_PLATFORM_CPU_FEATURE_GUARD_H_ namespace tensorflow { namespace port { // Called by the framework when we expect heavy CPU computation and we want to // be sure that the code has been compiled to run optimally on the current // hardware. The first time it's called it will run lightweight checks of // available SIMD acceleration features and log warnings about any that aren't // used. void InfoAboutUnusedCPUFeatures(); } // namespace port } // namespace tensorflow #endif // TENSORFLOW_CORE_PLATFORM_CPU_FEATURE_GUARD_H_
/************************************************************************** * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ /** * @file * Buffer validation. * * @author Jose Fonseca <jrfonseca@tungstengraphics.com> */ #include "pipe/p_compiler.h" #include "pipe/p_defines.h" #include "util/u_memory.h" #include "util/u_debug.h" #include "pb_buffer.h" #include "pb_validate.h" #define PB_VALIDATE_INITIAL_SIZE 1 /* 512 */ struct pb_validate_entry { struct pb_buffer *buf; unsigned flags; }; struct pb_validate { struct pb_validate_entry *entries; unsigned used; unsigned size; }; enum pipe_error pb_validate_add_buffer(struct pb_validate *vl, struct pb_buffer *buf, unsigned flags) { assert(buf); if(!buf) return PIPE_ERROR; assert(flags & PB_USAGE_GPU_READ_WRITE); assert(!(flags & ~PB_USAGE_GPU_READ_WRITE)); flags &= PB_USAGE_GPU_READ_WRITE; /* We only need to store one reference for each buffer, so avoid storing * consecutive references for the same buffer. It might not be the most * common pattern, but it is easy to implement. */ if(vl->used && vl->entries[vl->used - 1].buf == buf) { vl->entries[vl->used - 1].flags |= flags; return PIPE_OK; } /* Grow the table */ if(vl->used == vl->size) { unsigned new_size; struct pb_validate_entry *new_entries; new_size = vl->size * 2; if(!new_size) return PIPE_ERROR_OUT_OF_MEMORY; new_entries = (struct pb_validate_entry *)REALLOC(vl->entries, vl->size*sizeof(struct pb_validate_entry), new_size*sizeof(struct pb_validate_entry)); if(!new_entries) return PIPE_ERROR_OUT_OF_MEMORY; memset(new_entries + vl->size, 0, (new_size - vl->size)*sizeof(struct pb_validate_entry)); vl->size = new_size; vl->entries = new_entries; } assert(!vl->entries[vl->used].buf); pb_reference(&vl->entries[vl->used].buf, buf); vl->entries[vl->used].flags = flags; ++vl->used; return PIPE_OK; } enum pipe_error pb_validate_foreach(struct pb_validate *vl, enum pipe_error (*callback)(struct pb_buffer *buf, void *data), void *data) { unsigned i; for(i = 0; i < vl->used; ++i) { enum pipe_error ret; ret = callback(vl->entries[i].buf, data); if(ret != PIPE_OK) return ret; } return PIPE_OK; } enum pipe_error pb_validate_validate(struct pb_validate *vl) { unsigned i; for(i = 0; i < vl->used; ++i) { enum pipe_error ret; ret = pb_validate(vl->entries[i].buf, vl, vl->entries[i].flags); if(ret != PIPE_OK) { while(i--) pb_validate(vl->entries[i].buf, NULL, 0); return ret; } } return PIPE_OK; } void pb_validate_fence(struct pb_validate *vl, struct pipe_fence_handle *fence) { unsigned i; for(i = 0; i < vl->used; ++i) { pb_fence(vl->entries[i].buf, fence); pb_reference(&vl->entries[i].buf, NULL); } vl->used = 0; } void pb_validate_destroy(struct pb_validate *vl) { unsigned i; for(i = 0; i < vl->used; ++i) pb_reference(&vl->entries[i].buf, NULL); FREE(vl->entries); FREE(vl); } struct pb_validate * pb_validate_create() { struct pb_validate *vl; vl = CALLOC_STRUCT(pb_validate); if(!vl) return NULL; vl->size = PB_VALIDATE_INITIAL_SIZE; vl->entries = (struct pb_validate_entry *)CALLOC(vl->size, sizeof(struct pb_validate_entry)); if(!vl->entries) { FREE(vl); return NULL; } return vl; }
// SPDX-License-Identifier: GPL-2.0-or-later /* * Common library for ADIS16XXX devices * * Copyright 2012 Analog Devices Inc. * Author: Lars-Peter Clausen <lars@metafoo.de> */ #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/spi/spi.h> #include <linux/export.h> #include <linux/iio/iio.h> #include <linux/iio/trigger.h> #include <linux/iio/imu/adis.h> static int adis_data_rdy_trigger_set_state(struct iio_trigger *trig, bool state) { struct adis *adis = iio_trigger_get_drvdata(trig); return adis_enable_irq(adis, state); } static const struct iio_trigger_ops adis_trigger_ops = { .set_trigger_state = &adis_data_rdy_trigger_set_state, }; static int adis_validate_irq_flag(struct adis *adis) { unsigned long direction = adis->irq_flag & IRQF_TRIGGER_MASK; /* * Typically this devices have data ready either on the rising edge or * on the falling edge of the data ready pin. This checks enforces that * one of those is set in the drivers... It defaults to * IRQF_TRIGGER_RISING for backward compatibility with devices that * don't support changing the pin polarity. */ if (direction == IRQF_TRIGGER_NONE) { adis->irq_flag |= IRQF_TRIGGER_RISING; return 0; } else if (direction != IRQF_TRIGGER_RISING && direction != IRQF_TRIGGER_FALLING) { dev_err(&adis->spi->dev, "Invalid IRQ mask: %08lx\n", adis->irq_flag); return -EINVAL; } return 0; } /** * devm_adis_probe_trigger() - Sets up trigger for a managed adis device * @adis: The adis device * @indio_dev: The IIO device * * Returns 0 on success or a negative error code */ int devm_adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev) { int ret; adis->trig = devm_iio_trigger_alloc(&adis->spi->dev, "%s-dev%d", indio_dev->name, iio_device_id(indio_dev)); if (!adis->trig) return -ENOMEM; adis->trig->ops = &adis_trigger_ops; iio_trigger_set_drvdata(adis->trig, adis); ret = adis_validate_irq_flag(adis); if (ret) return ret; ret = devm_request_irq(&adis->spi->dev, adis->spi->irq, &iio_trigger_generic_data_rdy_poll, adis->irq_flag, indio_dev->name, adis->trig); if (ret) return ret; return devm_iio_trigger_register(&adis->spi->dev, adis->trig); } EXPORT_SYMBOL_GPL(devm_adis_probe_trigger);
/* * Copyright (C) 2011-2012 Freescale Semiconductor, 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 __LINUX_MFD_PFUZE_H #define __LINUX_MFD_PFUZE_H #include <linux/interrupt.h> struct mc_pfuze; void pfuze_lock(struct mc_pfuze *mc_pfuze); void pfuze_unlock(struct mc_pfuze *mc_pfuze); int pfuze_reg_read(struct mc_pfuze *mc_pfuze, unsigned int offset, unsigned char *val); int pfuze_reg_write(struct mc_pfuze *mc_pfuze, unsigned int offset, unsigned char val); int pfuze_reg_rmw(struct mc_pfuze *mc_pfuze, unsigned int offset, unsigned char mask, unsigned char val); int pfuze_irq_mask(struct mc_pfuze *mc_pfuze, int irq); int pfuze_irq_unmask(struct mc_pfuze *mc_pfuze, int irq); int pfuze_irq_status(struct mc_pfuze *mc_pfuze, int irq, int *enabled, int *pending); int pfuze_irq_status(struct mc_pfuze *mc_pfuze, int irq, int *enabled, int *pending); int pfuze_irq_ack(struct mc_pfuze *mc_pfuze, int irq); int pfuze_irq_request_nounmask(struct mc_pfuze *mc_pfuze, int irq, irq_handler_t handler, const char *name, void *dev); int pfuze_irq_request(struct mc_pfuze *mc_pfuze, int irq, irq_handler_t handler, const char *name, void *dev); int pfuze_irq_free(struct mc_pfuze *mc_pfuze, int irq, void *dev); unsigned int pfuze_get_flags(struct mc_pfuze *mc_pfuze); #define PFUZE_I2C_RETRY_TIMES 10 #define PFUZE_NUM_IRQ 56 #define PFUZE_NUMREGS 128 #define PFUZE_IRQ_PWRONI 0 #define PFUZE_IRQ_LOWBATT 1 #define PFUZE_IRQ_THERM110 2 #define PFUZE_IRQ_THERM120 3 #define PFUZE_IRQ_THERM125 4 #define PFUZE_IRQ_THERM130 5 #define PFUZE_IRQ_SW1AFAULT 8 #define PFUZE_IRQ_SW1BFAULT 9 #define PFUZE_IRQ_SW1CFAULT 10 #define PFUZE_IRQ_SW2FAULT 11 #define PFUZE_IRQ_SW3AFAULT 12 #define PFUZE_IRQ_SW3BFAULT 13 #define PFUZE_IRQ_SW4FAULT 14 #define PFUZE_IRQ_SWBSTFAULT 24 #define PFUZE_IRQ_OTPECC 31 #define PFUZE_IRQ_VGEN1FAULT 32 #define PFUZE_IRQ_VGEN2FAULT 33 #define PFUZE_IRQ_VGEN3FAULT 34 #define PFUZE_IRQ_VGEN4FAULT 35 #define PFUZE_IRQ_VGEN5FAULT 36 #define PFUZE_IRQ_VGEN6FAULT 37 #define PFUZE100_SW1A 0 #define PFUZE100_SW1B 1 #define PFUZE100_SW1C 2 #define PFUZE100_SW2 3 #define PFUZE100_SW3A 4 #define PFUZE100_SW3B 5 #define PFUZE100_SW4 6 #define PFUZE100_SWBST 7 #define PFUZE100_VSNVS 8 #define PFUZE100_VREFDDR 9 #define PFUZE100_VGEN1 10 #define PFUZE100_VGEN2 11 #define PFUZE100_VGEN3 12 #define PFUZE100_VGEN4 13 #define PFUZE100_VGEN5 14 #define PFUZE100_VGEN6 15 #define PFUZE100_SW2_VOL6 1 #define PFUZE100_SW3_VOL6 0 #define PFUZE100_SW4_VOL6 1 /*#define PFUZE100_FIRST_VERSION*/ struct regulator_init_data; struct pfuze_regulator_init_data { int id; struct regulator_init_data *init_data; }; struct pfuze_regulator_platform_data { int num_regulators; struct pfuze_regulator_init_data *regulators; int (*pfuze_init)(struct mc_pfuze *pfuze); }; struct pfuze_platform_data { #define PFUZE_USE_REGULATOR (1 << 0) unsigned int flags; int num_regulators; struct pfuze_regulator_init_data *regulators; int (*pfuze_init)(struct mc_pfuze *pfuze); }; #endif
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "RACCommand.h" #import "RACDisposable.h" #import "RACEvent.h" #import "RACScheduler.h" #import "RACTargetQueueScheduler.h" #import "RACSignal.h" #import "RACSignal+Operations.h" #import "RACStream.h" #import "RACSubscriber.h"
/* * linux/arch/arm/mach-footbridge/isa.c * * Copyright (C) 2004 Russell King. * * 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. */ #include <linux/init.h> #include <linux/serial_8250.h> #include <asm/irq.h> #include <asm/hardware/dec21285.h> #include "common.h" static struct resource rtc_resources[] = { [0] = { .start = 0x70, .end = 0x73, .flags = IORESOURCE_IO, }, [1] = { .start = IRQ_ISA_RTC_ALARM, .end = IRQ_ISA_RTC_ALARM, .flags = IORESOURCE_IRQ, } }; static struct platform_device rtc_device = { .name = "rtc_cmos", .id = -1, .resource = rtc_resources, .num_resources = ARRAY_SIZE(rtc_resources), }; static struct resource serial_resources[] = { [0] = { .start = 0x3f8, .end = 0x3ff, .flags = IORESOURCE_IO, }, [1] = { .start = 0x2f8, .end = 0x2ff, .flags = IORESOURCE_IO, }, }; static struct plat_serial8250_port serial_platform_data[] = { { .iobase = 0x3f8, .irq = IRQ_ISA_UART, .uartclk = 1843200, .regshift = 0, .iotype = UPIO_PORT, .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, }, { .iobase = 0x2f8, .irq = IRQ_ISA_UART2, .uartclk = 1843200, .regshift = 0, .iotype = UPIO_PORT, .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, }, { }, }; static struct platform_device serial_device = { .name = "serial8250", .id = PLAT8250_DEV_PLATFORM, .dev = { .platform_data = serial_platform_data, }, .resource = serial_resources, .num_resources = ARRAY_SIZE(serial_resources), }; static int __init footbridge_isa_init(void) { int err = 0; if (!footbridge_cfn_mode()) return 0; /* Personal server doesn't have RTC */ if (!machine_is_personal_server()) { isa_rtc_init(); err = platform_device_register(&rtc_device); if (err) printk(KERN_ERR "Unable to register RTC device: %d\n", err); } err = platform_device_register(&serial_device); if (err) printk(KERN_ERR "Unable to register serial device: %d\n", err); return 0; } arch_initcall(footbridge_isa_init);
#pragma once #include <stdlib.h> #include <stdbool.h> typedef struct List1Node List1Node; struct List1Node { List1Node *next; }; typedef bool (*List1FilterCallback)(List1Node *node, void *data); static inline size_t list1_size(List1Node *node) { size_t size = 0; for (; node; node = node->next) { size++; } return size; } static inline List1Node *list1_last(List1Node *node) { for (; node; node = node->next) { if (!node->next) { return node; } } return NULL; } static inline List1Node *list1_prev(List1Node *head, List1Node *node) { for (List1Node *walk = head, *prev = NULL; walk; walk = walk->next) { if (walk == node) { return prev; } prev = walk; } return NULL; } static inline List1Node *list1_prepend(List1Node **head, List1Node *node) { node->next = *head; *head = node; return node; } static inline List1Node *list1_append(List1Node **head, List1Node *node) { if (*head) { list1_last(*head)->next = node; } else { *head = node; } return node; } static inline int list1_index(List1Node *head, List1Node *node) { List1Node *walk = head; for (int i = 0; walk; ++i) { if (walk == node) { return i; } walk = walk->next; } return -1; } static inline List1Node *list1_insert(List1Node **head, int index, List1Node *node) { List1Node **next_ref = head; List1Node *walk = *head; for (int i = 0; walk && i < index; ++i) { next_ref = &walk->next; walk = walk->next; } node->next = *next_ref; *next_ref = node; return node; } static inline List1Node *list1_find_prev(List1Node *node, List1FilterCallback callback, void *data, List1Node **prev_out) { for (List1Node *prev = NULL; node; node = node->next) { if (callback(node, data)) { if (prev_out) { *prev_out = prev; } return node; } prev = node; } return NULL; } static inline List1Node *list1_find_last(List1Node *node, List1FilterCallback callback, void *data) { List1Node *match = NULL; for (; node; node = node->next) { if (callback(node, data)) { match = node; } } return match; } static inline List1Node *list1_find(List1Node *node, List1FilterCallback callback, void *data) { return list1_find_prev(node, callback, data, NULL); } static inline List1Node *list1_remove_prev(List1Node **head, List1Node *node, List1Node *prev) { if (!node) { return NULL; } if (*head == node) { *head = node->next; } if (prev) { prev->next = node->next; } node->next = NULL; return node; } static inline List1Node *list1_remove(List1Node **head, List1Node *node) { return list1_remove_prev(head, node, list1_prev(*head, node)); } static inline List1Node *list1_remove_one(List1Node **head, List1FilterCallback callback, void *data) { List1Node *prev = NULL; List1Node *node = list1_find_prev(*head, callback, data, &prev); return list1_remove_prev(head, node, prev); }
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright 2016 Chen-Yu Tsai * * Chen-Yu Tsai <wens@csie.org> */ #ifndef _CCU_SUN9I_A80_H_ #define _CCU_SUN9I_A80_H_ #include <dt-bindings/clock/sun9i-a80-ccu.h> #include <dt-bindings/reset/sun9i-a80-ccu.h> #define CLK_PLL_C0CPUX 0 #define CLK_PLL_C1CPUX 1 /* pll-audio and pll-periph0 are exported to the PRCM block */ #define CLK_PLL_VE 4 #define CLK_PLL_DDR 5 #define CLK_PLL_VIDEO0 6 #define CLK_PLL_VIDEO1 7 #define CLK_PLL_GPU 8 #define CLK_PLL_DE 9 #define CLK_PLL_ISP 10 #define CLK_PLL_PERIPH1 11 /* The CPUX clocks are exported */ #define CLK_ATB0 14 #define CLK_AXI0 15 #define CLK_ATB1 16 #define CLK_AXI1 17 #define CLK_GTBUS 18 #define CLK_AHB0 19 #define CLK_AHB1 20 #define CLK_AHB2 21 #define CLK_APB0 22 #define CLK_APB1 23 #define CLK_CCI400 24 #define CLK_ATS 25 #define CLK_TRACE 26 /* module clocks and bus gates exported */ #define CLK_NUMBER (CLK_BUS_UART5 + 1) #endif /* _CCU_SUN9I_A80_H_ */
/* * Copyright (c) International Business Machines Corp., 2006 * * 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 * * Author: Artem Bityutskiy (Битюцкий Артём) */ /* Here we keep miscellaneous functions which are used all over the UBI code */ #include "ubi.h" /** * calc_data_len - calculate how much real data is stored in a buffer. * @ubi: UBI device description object * @buf: a buffer with the contents of the physical eraseblock * @length: the buffer length * * This function calculates how much "real data" is stored in @buf and returnes * the length. Continuous 0xFF bytes at the end of the buffer are not * considered as "real data". */ int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf, int length) { int i; ubi_assert(!(length & (ubi->min_io_size - 1))); for (i = length - 1; i >= 0; i--) if (((const uint8_t *)buf)[i] != 0xFF) break; /* The resulting length must be aligned to the minimum flash I/O size */ length = ALIGN(i + 1, ubi->min_io_size); return length; } /** * ubi_check_volume - check the contents of a static volume. * @ubi: UBI device description object * @vol_id: ID of the volume to check * * This function checks if static volume @vol_id is corrupted by fully reading * it and checking data CRC. This function returns %0 if the volume is not * corrupted, %1 if it is corrupted and a negative error code in case of * failure. Dynamic volumes are not checked and zero is returned immediately. */ int ubi_check_volume(struct ubi_device *ubi, int vol_id) { void *buf; int err = 0, i; struct ubi_volume *vol = ubi->volumes[vol_id]; if (vol->vol_type != UBI_STATIC_VOLUME) return 0; buf = vmalloc(vol->usable_leb_size); if (!buf) return -ENOMEM; for (i = 0; i < vol->used_ebs; i++) { int size; cond_resched(); if (i == vol->used_ebs - 1) size = vol->last_eb_bytes; else size = vol->usable_leb_size; err = ubi_eba_read_leb(ubi, vol, i, buf, 0, size, 1); if (err) { if (mtd_is_eccerr(err)) err = 1; break; } } vfree(buf); return err; } /** * ubi_update_reserved - update bad eraseblock handling accounting data. * @ubi: UBI device description object * * This function calculates the gap between current number of PEBs reserved for * bad eraseblock handling and the required level of PEBs that must be * reserved, and if necessary, reserves more PEBs to fill that gap, according * to availability. Should be called with ubi->volumes_lock held. */ void ubi_update_reserved(struct ubi_device *ubi) { int need = ubi->beb_rsvd_level - ubi->beb_rsvd_pebs; if (need <= 0 || ubi->avail_pebs == 0) return; need = min_t(int, need, ubi->avail_pebs); ubi->avail_pebs -= need; ubi->rsvd_pebs += need; ubi->beb_rsvd_pebs += need; ubi_msg(ubi, "reserved more %d PEBs for bad PEB handling", need); } /** * ubi_calculate_reserved - calculate how many PEBs must be reserved for bad * eraseblock handling. * @ubi: UBI device description object */ void ubi_calculate_reserved(struct ubi_device *ubi) { /* * Calculate the actual number of PEBs currently needed to be reserved * for future bad eraseblock handling. */ ubi->beb_rsvd_level = ubi->bad_peb_limit - ubi->bad_peb_count; if (ubi->beb_rsvd_level < 0) { ubi->beb_rsvd_level = 0; ubi_warn(ubi, "number of bad PEBs (%d) is above the expected limit (%d), not reserving any PEBs for bad PEB handling, will use available PEBs (if any)", ubi->bad_peb_count, ubi->bad_peb_limit); } } /** * ubi_check_pattern - check if buffer contains only a certain byte pattern. * @buf: buffer to check * @patt: the pattern to check * @size: buffer size in bytes * * This function returns %1 in there are only @patt bytes in @buf, and %0 if * something else was also found. */ int ubi_check_pattern(const void *buf, uint8_t patt, int size) { int i; for (i = 0; i < size; i++) if (((const uint8_t *)buf)[i] != patt) return 0; return 1; }
// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2014, The Linux Foundation. All rights reserved. */ #include <linux/kernel.h> #include <linux/mm.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/vmalloc.h> #include <asm/set_memory.h> #include <asm/tlbflush.h> struct page_change_data { pgprot_t set_mask; pgprot_t clear_mask; }; bool rodata_full __ro_after_init = IS_ENABLED(CONFIG_RODATA_FULL_DEFAULT_ENABLED); static int change_page_range(pte_t *ptep, unsigned long addr, void *data) { struct page_change_data *cdata = data; pte_t pte = READ_ONCE(*ptep); pte = clear_pte_bit(pte, cdata->clear_mask); pte = set_pte_bit(pte, cdata->set_mask); set_pte(ptep, pte); return 0; } /* * This function assumes that the range is mapped with PAGE_SIZE pages. */ static int __change_memory_common(unsigned long start, unsigned long size, pgprot_t set_mask, pgprot_t clear_mask) { struct page_change_data data; int ret; data.set_mask = set_mask; data.clear_mask = clear_mask; ret = apply_to_page_range(&init_mm, start, size, change_page_range, &data); flush_tlb_kernel_range(start, start + size); return ret; } static int change_memory_common(unsigned long addr, int numpages, pgprot_t set_mask, pgprot_t clear_mask) { unsigned long start = addr; unsigned long size = PAGE_SIZE * numpages; unsigned long end = start + size; struct vm_struct *area; int i; if (!PAGE_ALIGNED(addr)) { start &= PAGE_MASK; end = start + size; WARN_ON_ONCE(1); } /* * Kernel VA mappings are always live, and splitting live section * mappings into page mappings may cause TLB conflicts. This means * we have to ensure that changing the permission bits of the range * we are operating on does not result in such splitting. * * Let's restrict ourselves to mappings created by vmalloc (or vmap). * Those are guaranteed to consist entirely of page mappings, and * splitting is never needed. * * So check whether the [addr, addr + size) interval is entirely * covered by precisely one VM area that has the VM_ALLOC flag set. */ area = find_vm_area((void *)addr); if (!area || end > (unsigned long)area->addr + area->size || !(area->flags & VM_ALLOC)) return -EINVAL; if (!numpages) return 0; /* * If we are manipulating read-only permissions, apply the same * change to the linear mapping of the pages that back this VM area. */ if (rodata_full && (pgprot_val(set_mask) == PTE_RDONLY || pgprot_val(clear_mask) == PTE_RDONLY)) { for (i = 0; i < area->nr_pages; i++) { __change_memory_common((u64)page_address(area->pages[i]), PAGE_SIZE, set_mask, clear_mask); } } /* * Get rid of potentially aliasing lazily unmapped vm areas that may * have permissions set that deviate from the ones we are setting here. */ vm_unmap_aliases(); return __change_memory_common(start, size, set_mask, clear_mask); } int set_memory_ro(unsigned long addr, int numpages) { return change_memory_common(addr, numpages, __pgprot(PTE_RDONLY), __pgprot(PTE_WRITE)); } int set_memory_rw(unsigned long addr, int numpages) { return change_memory_common(addr, numpages, __pgprot(PTE_WRITE), __pgprot(PTE_RDONLY)); } int set_memory_nx(unsigned long addr, int numpages) { return change_memory_common(addr, numpages, __pgprot(PTE_PXN), __pgprot(PTE_MAYBE_GP)); } int set_memory_x(unsigned long addr, int numpages) { return change_memory_common(addr, numpages, __pgprot(PTE_MAYBE_GP), __pgprot(PTE_PXN)); } int set_memory_valid(unsigned long addr, int numpages, int enable) { if (enable) return __change_memory_common(addr, PAGE_SIZE * numpages, __pgprot(PTE_VALID), __pgprot(0)); else return __change_memory_common(addr, PAGE_SIZE * numpages, __pgprot(0), __pgprot(PTE_VALID)); } int set_direct_map_invalid_noflush(struct page *page) { struct page_change_data data = { .set_mask = __pgprot(0), .clear_mask = __pgprot(PTE_VALID), }; if (!rodata_full) return 0; return apply_to_page_range(&init_mm, (unsigned long)page_address(page), PAGE_SIZE, change_page_range, &data); } int set_direct_map_default_noflush(struct page *page) { struct page_change_data data = { .set_mask = __pgprot(PTE_VALID | PTE_WRITE), .clear_mask = __pgprot(PTE_RDONLY), }; if (!rodata_full) return 0; return apply_to_page_range(&init_mm, (unsigned long)page_address(page), PAGE_SIZE, change_page_range, &data); } void __kernel_map_pages(struct page *page, int numpages, int enable) { if (!debug_pagealloc_enabled() && !rodata_full) return; set_memory_valid((unsigned long)page_address(page), numpages, enable); } /* * This function is used to determine if a linear map page has been marked as * not-valid. Walk the page table and check the PTE_VALID bit. This is based * on kern_addr_valid(), which almost does what we need. * * Because this is only called on the kernel linear map, p?d_sect() implies * p?d_present(). When debug_pagealloc is enabled, sections mappings are * disabled. */ bool kernel_page_present(struct page *page) { pgd_t *pgdp; p4d_t *p4dp; pud_t *pudp, pud; pmd_t *pmdp, pmd; pte_t *ptep; unsigned long addr = (unsigned long)page_address(page); if (!debug_pagealloc_enabled() && !rodata_full) return true; pgdp = pgd_offset_k(addr); if (pgd_none(READ_ONCE(*pgdp))) return false; p4dp = p4d_offset(pgdp, addr); if (p4d_none(READ_ONCE(*p4dp))) return false; pudp = pud_offset(p4dp, addr); pud = READ_ONCE(*pudp); if (pud_none(pud)) return false; if (pud_sect(pud)) return true; pmdp = pmd_offset(pudp, addr); pmd = READ_ONCE(*pmdp); if (pmd_none(pmd)) return false; if (pmd_sect(pmd)) return true; ptep = pte_offset_kernel(pmdp, addr); return pte_valid(READ_ONCE(*ptep)); }
/**************************************************************************//** * @file efm32wg_lesense_buf.h * @brief EFM32WG_LESENSE_BUF register and bit field definitions * @version 5.1.2 ****************************************************************************** * @section License * <b>Copyright 2017 Silicon Laboratories, Inc. http://www.silabs.com</b> ****************************************************************************** * * 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.@n * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software.@n * 3. This notice may not be removed or altered from any source distribution. * * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Laboratories, Inc. * has no obligation to support this Software. Silicon Laboratories, Inc. is * providing the Software "AS IS", with no express or implied warranties of any * kind, including, but not limited to, any implied warranties of * merchantability or fitness for any particular purpose or warranties against * infringement of any proprietary rights of a third party. * * Silicon Laboratories, Inc. will not be liable for any consequential, * incidental, or special damages, or any other relief, or for any claim by * any third party, arising from your use of this Software. * *****************************************************************************/ /**************************************************************************//** * @addtogroup Parts * @{ ******************************************************************************/ /**************************************************************************//** * @brief LESENSE_BUF EFM32WG LESENSE BUF *****************************************************************************/ typedef struct { __IOM uint32_t DATA; /**< Scan results */ } LESENSE_BUF_TypeDef; /** @} End of group Parts */
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_ARCH_PXA3XX_NAND_H #define __ASM_ARCH_PXA3XX_NAND_H #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> /* * Current pxa3xx_nand controller has two chip select which * both be workable. * * Notice should be taken that: * When you want to use this feature, you should not enable the * keep configuration feature, for two chip select could be * attached with different nand chip. The different page size * and timing requirement make the keep configuration impossible. */ /* The max num of chip select current support */ #define NUM_CHIP_SELECT (2) struct pxa3xx_nand_platform_data { /* the data flash bus is shared between the Static Memory * Controller and the Data Flash Controller, the arbiter * controls the ownership of the bus */ int enable_arbiter; /* allow platform code to keep OBM/bootloader defined NFC config */ int keep_config; /* indicate how many chip selects will be used */ int num_cs; /* use an flash-based bad block table */ bool flash_bbt; /* requested ECC strength and ECC step size */ int ecc_strength, ecc_step_size; const struct mtd_partition *parts[NUM_CHIP_SELECT]; unsigned int nr_parts[NUM_CHIP_SELECT]; }; extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info); #endif /* __ASM_ARCH_PXA3XX_NAND_H */
// -*- C++ -*- //============================================================================= /** * @file os_tcp.h * * definitions for the Internet Transmission Control Protocol (TCP) * * $Id: os_tcp.h 80826 2008-03-04 14:51:23Z wotte $ * * @author Don Hinton <dhinton@dresystems.com> * @author This code was originally in various places including ace/OS.h. */ //============================================================================= #ifndef ACE_OS_INCLUDE_NETINET_OS_TCP_H #define ACE_OS_INCLUDE_NETINET_OS_TCP_H #include /**/ "ace/pre.h" #include /**/ "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #if !defined (ACE_LACKS_NETINET_TCP_H) # include /**/ <netinet/tcp.h> #endif /* !ACE_LACKS_NETIINET_TCP_H */ // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ # if !defined (TCP_NODELAY) # define TCP_NODELAY 0x01 # endif /* TCP_NODELAY */ #ifdef __cplusplus } #endif /* __cplusplus */ #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_NETINET_OS_TCP_H */
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s union U { int x; char* p; }; void foo() { union U bar; // CHECK: call void asm __asm__ volatile("foo %0\n" :: "r"(bar)); }
/* SDL - Simple DirectMedia Layer Copyright (C) 1997-2009 Sam Lantinga This 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. This 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 this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Sam Lantinga slouken@libsdl.org */ #include "SDL_config.h" #include "SDL_aavideo.h" /* Functions to be exported */
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: basic shared codebook operations ********************************************************************/ #ifndef _V_CODEBOOK_H_ #define _V_CODEBOOK_H_ #include <ogg/ogg.h> /* This structure encapsulates huffman and VQ style encoding books; it doesn't do anything specific to either. valuelist/quantlist are nonNULL (and q_* significant) only if there's entry->value mapping to be done. If encode-side mapping must be done (and thus the entry needs to be hunted), the auxiliary encode pointer will point to a decision tree. This is true of both VQ and huffman, but is mostly useful with VQ. */ typedef struct static_codebook{ long dim; /* codebook dimensions (elements per vector) */ long entries; /* codebook entries */ char *lengthlist; /* codeword lengths in bits */ /* mapping ***************************************************************/ int maptype; /* 0=none 1=implicitly populated values from map column 2=listed arbitrary values */ /* The below does a linear, single monotonic sequence mapping. */ long q_min; /* packed 32 bit float; quant value 0 maps to minval */ long q_delta; /* packed 32 bit float; val 1 - val 0 == delta */ int q_quant; /* bits: 0 < quant <= 16 */ int q_sequencep; /* bitflag */ long *quantlist; /* map == 1: (int)(entries^(1/dim)) element column map map == 2: list of dim*entries quantized entry vals */ int allocedp; } static_codebook; typedef struct codebook{ long dim; /* codebook dimensions (elements per vector) */ long entries; /* codebook entries */ long used_entries; /* populated codebook entries */ const static_codebook *c; /* for encode, the below are entry-ordered, fully populated */ /* for decode, the below are ordered by bitreversed codeword and only used entries are populated */ float *valuelist; /* list of dim*entries actual entry values */ ogg_uint32_t *codelist; /* list of bitstream codewords for each entry */ int *dec_index; /* only used if sparseness collapsed */ char *dec_codelengths; ogg_uint32_t *dec_firsttable; int dec_firsttablen; int dec_maxlength; /* The current encoder uses only centered, integer-only lattice books. */ int quantvals; int minval; int delta; } codebook; extern void vorbis_staticbook_destroy(static_codebook *b); extern int vorbis_book_init_encode(codebook *dest,const static_codebook *source); extern int vorbis_book_init_decode(codebook *dest,const static_codebook *source); extern void vorbis_book_clear(codebook *b); extern float *_book_unquantize(const static_codebook *b,int n,int *map); extern float *_book_logdist(const static_codebook *b,float *vals); extern float _float32_unpack(long val); extern long _float32_pack(float val); extern int _best(codebook *book, float *a, int step); extern long _book_maptype1_quantvals(const static_codebook *b); extern int vorbis_book_besterror(codebook *book,float *a,int step,int addmul); extern long vorbis_book_codeword(codebook *book,int entry); extern long vorbis_book_codelen(codebook *book,int entry); extern int vorbis_staticbook_pack(const static_codebook *c,oggpack_buffer *b); extern static_codebook *vorbis_staticbook_unpack(oggpack_buffer *b); extern int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b); extern long vorbis_book_decode(codebook *book, oggpack_buffer *b); extern long vorbis_book_decodevs_add(codebook *book, float *a, oggpack_buffer *b,int n); extern long vorbis_book_decodev_set(codebook *book, float *a, oggpack_buffer *b,int n); extern long vorbis_book_decodev_add(codebook *book, float *a, oggpack_buffer *b,int n); extern long vorbis_book_decodevv_add(codebook *book, float **a, long off,int ch, oggpack_buffer *b,int n); #endif
/* Verify that we get the low part of the long long as an int. We used to get it wrong on big-endian machines, if register allocation succeeded at all. We use volatile to make sure the long long is actually truncated to int, in case a single register is wide enough for a long long. */ /* { dg-skip-if "asm would require extra shift-left-4-byte" { spu-*-* } "*" "" } */ #include <limits.h> void ll_to_int (long long x, volatile int *p) { int i; asm ("" : "=r" (i) : "0" (x)); *p = i; } int val = INT_MIN + 1; int main() { volatile int i; ll_to_int ((long long)val, &i); if (i != val) abort (); exit (0); }
/* add cypress new driver ttda-02.03.01.476713 */ /* * cyttsp4_devtree.h * Cypress TrueTouch(TM) Standard Product V4 Device Tree Support Driver * For use with Cypress Txx4xx parts. * Supported parts include: * TMA4XX * TMA1036 * * Copyright (C) 2013 Cypress Semiconductor * * 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. * * 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. * * Contact Cypress Semiconductor at www.cypress.com <ttdrivers@cypress.com> * */ #ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEVICETREE_SUPPORT extern int cyttsp4_devtree_register_devices(struct device *adap_dev); #else static inline int cyttsp4_devtree_register_devices(struct device *adap_dev) { return 0; } #endif
/* (C) Copyright IBM Corp. 2006 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 IBM 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. Author: Joel Schopp <jschopp@austin.ibm.com> */ #include <_ansi.h> #include <stdio.h> #include "c99ppe.h" typedef struct { char* buf; unsigned int pad0[ 3 ]; size_t size; unsigned int pad1[ 3 ]; size_t count; unsigned int pad2[ 3 ]; int fp; } c99_fread_t; #ifndef _REENT_ONLY size_t _DEFUN (fread, (buf, size, count, fp), _PTR __restrict buf _AND size_t size _AND size_t count _AND FILE *__restrict fp) { c99_fread_t args; CHECK_INIT(_REENT); args.buf = buf; args.size = size; args.count = count; args.fp = fp->_fp; return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FREAD, &args); } #endif /* ! _REENT_ONLY */
/* Copyright (C) 2010 The Android Open Source Project ** ** This software is licensed under the terms of the GNU General Public ** License version 2, as published by the Free Software Foundation, and ** may be copied, distributed, and modified under those terms. ** ** 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. */ #include <stdio.h> #include "android/utils/debug.h" #include "android/keycode-array.h" #include "user-events.h" void android_keycodes_add_key_event( AKeycodeBuffer* keycodes, unsigned code, unsigned down ) { if (code != 0 && keycodes->keycode_count < MAX_KEYCODES) { keycodes->keycodes[(int)keycodes->keycode_count++] = ( (code & 0x1ff) | (down ? 0x200 : 0) ); } } void android_keycodes_flush(AKeycodeBuffer* keycodes) { if (keycodes->keycode_count > 0) { if (VERBOSE_CHECK(keys)) { int nn; printf(">> KEY" ); for (nn = 0; nn < keycodes->keycode_count; nn++) { int code = keycodes->keycodes[nn]; printf(" [0x%03x,%s]", (code & 0x1ff), (code & 0x200) ? "down" : " up " ); } printf( "\n" ); } user_event_keycodes(keycodes->keycodes, keycodes->keycode_count); keycodes->keycode_count = 0; } }
/* Copyright 2017 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. ==============================================================================*/ #ifndef TENSORFLOW_UTIL_TRANSFORM_OUTPUT_ITERATOR_H_ #define TENSORFLOW_UTIL_TRANSFORM_OUTPUT_ITERATOR_H_ #include <iostream> #include <iterator> namespace tensorflow { template <typename StoreType, typename InputType, typename ConversionOp, typename OffsetT = ptrdiff_t> class TransformOutputIterator { protected: // Proxy object struct Reference { StoreType* ptr; ConversionOp conversion_op; /// Constructor __host__ __device__ __forceinline__ Reference(StoreType* ptr, ConversionOp conversion_op) : ptr(ptr), conversion_op(conversion_op) {} /// Assignment __host__ __device__ __forceinline__ InputType operator=(InputType val) { *ptr = conversion_op(val); return val; } }; public: // Required iterator traits typedef TransformOutputIterator self_type; ///< My own type typedef OffsetT difference_type; ///< Type to express the result of ///< subtracting one iterator from another typedef void value_type; ///< The type of the element the iterator can point to typedef void pointer; ///< The type of a pointer to an element the iterator ///< can point to typedef Reference reference; ///< The type of a reference to an element the ///< iterator can point to typedef std::random_access_iterator_tag iterator_category; ///< The iterator category /*private:*/ StoreType* ptr; ConversionOp conversion_op; public: /// Constructor template <typename QualifiedStoreType> __host__ __device__ __forceinline__ TransformOutputIterator( QualifiedStoreType* ptr, ConversionOp conversionOp) ///< Native pointer to wrap : ptr(ptr), conversion_op(conversionOp) {} /// Postfix increment __host__ __device__ __forceinline__ self_type operator++(int) { self_type retval = *this; ptr++; return retval; } /// Prefix increment __host__ __device__ __forceinline__ self_type operator++() { ptr++; return *this; } /// Indirection __host__ __device__ __forceinline__ reference operator*() const { return Reference(ptr, conversion_op); } /// Addition template <typename Distance> __host__ __device__ __forceinline__ self_type operator+(Distance n) const { self_type retval(ptr + n, conversion_op); return retval; } /// Addition assignment template <typename Distance> __host__ __device__ __forceinline__ self_type& operator+=(Distance n) { ptr += n; return *this; } /// Subtraction template <typename Distance> __host__ __device__ __forceinline__ self_type operator-(Distance n) const { self_type retval(ptr - n, conversion_op); return retval; } /// Subtraction assignment template <typename Distance> __host__ __device__ __forceinline__ self_type& operator-=(Distance n) { ptr -= n; return *this; } /// Distance __host__ __device__ __forceinline__ difference_type operator-(self_type other) const { return ptr - other.ptr; } /// Array subscript template <typename Distance> __host__ __device__ __forceinline__ reference operator[](Distance n) const { return Reference(ptr + n, conversion_op); } /// Equal to __host__ __device__ __forceinline__ bool operator==(const self_type& rhs) { return (ptr == rhs.ptr); } /// Not equal to __host__ __device__ __forceinline__ bool operator!=(const self_type& rhs) { return (ptr != rhs.ptr); } /// ostream operator friend std::ostream& operator<<(std::ostream& os, const self_type& itr) { return os; } }; } // end namespace tensorflow #endif // TENSORFLOW_UTIL_TRANSFORM_OUTPUT_ITERATOR_H_
/* * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #ifndef __MLIB_IMAGECOPY_H #define __MLIB_IMAGECOPY_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ void mlib_ImageCopy_bit_al(const mlib_u8 *sa, mlib_u8 *da, mlib_s32 size, mlib_s32 offset); void mlib_ImageCopy_na(const mlib_u8 *sp, mlib_u8 *dp, mlib_s32 n); void mlib_ImageCopy_bit_na_r(const mlib_u8 *sa, mlib_u8 *da, mlib_s32 size, mlib_s32 s_offset, mlib_s32 d_offset); void mlib_ImageCopy_bit_na(const mlib_u8 *sa, mlib_u8 *da, mlib_s32 size, mlib_s32 s_offset, mlib_s32 d_offset); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __MLIB_IMAGECOPY_H */
/* * timb_gpio.h timberdale FPGA GPIO driver, platform data definition * Copyright (c) 2009 Intel Corporation * * 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. * * 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. */ #ifndef _LINUX_TIMB_GPIO_H #define _LINUX_TIMB_GPIO_H /** * struct timbgpio_platform_data - Platform data of the Timberdale GPIO driver * @gpio_base The number of the first GPIO pin, set to -1 for * dynamic number allocation. * @nr_pins Number of pins that is supported by the hardware (1-32) * @irq_base If IRQ is supported by the hardware, this is the base * number of IRQ:s. One IRQ per pin will be used. Set to * -1 if IRQ:s is not supported. */ struct timbgpio_platform_data { int gpio_base; int nr_pins; int irq_base; }; #endif
// -*- C++ -*- //========================================================================== /** * @file Null_Condition.h * * $Id: Null_Condition.h 80826 2008-03-04 14:51:23Z wotte $ * * Moved from Synch.h. * * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> */ //========================================================================== #ifndef ACE_NULL_CONDITION_H #define ACE_NULL_CONDITION_H #include /**/ "ace/pre.h" // All methods in this class are inline, so there is no // need to import or export on Windows. -- CAE 12/18/2003 #include "ace/Null_Mutex.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/os_include/os_errno.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Time_Value; /** * @class ACE_Null_Condition * * @brief Implement a do nothing ACE_Condition variable wrapper, * i.e., all methods are no ops. This class is necessary since * some C++ compilers are *very* lame... */ class ACE_Null_Condition { public: ACE_Null_Condition (const ACE_Null_Mutex &m, const ACE_TCHAR * = 0, void * = 0) : mutex_ ((ACE_Null_Mutex &) m) {} ~ACE_Null_Condition (void) {} /// Returns 0. int remove (void) {return 0;} /// Returns -1 with @c errno == @c ETIME. int wait (const ACE_Time_Value * = 0) {errno = ETIME; return -1;} /// Returns -1 with @c errno == @c ETIME. int wait (ACE_Null_Mutex &, const ACE_Time_Value * = 0) {errno = ETIME; return -1;} /// Returns 0. int signal (void) {return 0;} /// Returns 0. int broadcast (void) {return 0;} ACE_Null_Mutex &mutex (void) {return this->mutex_;}; /// Dump the state of an object. void dump (void) const {} // ACE_ALLOC_HOOK_DECLARE; // Declare the dynamic allocation hooks. protected: ACE_Null_Mutex &mutex_; // Reference to mutex lock. private: // = Prevent assignment and initialization. void operator= (const ACE_Null_Condition &); ACE_Null_Condition (const ACE_Null_Condition &); }; ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NULL_CONDITION_H */
/* * Copyright (C) 2009-2011 Red Hat, Inc. * * Author: Mikulas Patocka <mpatocka@redhat.com> * * This file is released under the GPL. */ #ifndef _LINUX_DM_BUFIO_H #define _LINUX_DM_BUFIO_H #include <linux/blkdev.h> #include <linux/types.h> /*----------------------------------------------------------------*/ struct dm_bufio_client; struct dm_buffer; /* * Create a buffered IO cache on a given device */ struct dm_bufio_client * dm_bufio_client_create(struct block_device *bdev, unsigned block_size, unsigned reserved_buffers, unsigned aux_size, void (*alloc_callback)(struct dm_buffer *), void (*write_callback)(struct dm_buffer *)); /* * Release a buffered IO cache. */ void dm_bufio_client_destroy(struct dm_bufio_client *c); /* * Set the sector range. * When this function is called, there must be no I/O in progress on the bufio * client. */ void dm_bufio_set_sector_offset(struct dm_bufio_client *c, sector_t start); /* * WARNING: to avoid deadlocks, these conditions are observed: * * - At most one thread can hold at most "reserved_buffers" simultaneously. * - Each other threads can hold at most one buffer. * - Threads which call only dm_bufio_get can hold unlimited number of * buffers. */ /* * Read a given block from disk. Returns pointer to data. Returns a * pointer to dm_buffer that can be used to release the buffer or to make * it dirty. */ void *dm_bufio_read(struct dm_bufio_client *c, sector_t block, struct dm_buffer **bp); /* * Like dm_bufio_read, but return buffer from cache, don't read * it. If the buffer is not in the cache, return NULL. */ void *dm_bufio_get(struct dm_bufio_client *c, sector_t block, struct dm_buffer **bp); /* * Like dm_bufio_read, but don't read anything from the disk. It is * expected that the caller initializes the buffer and marks it dirty. */ void *dm_bufio_new(struct dm_bufio_client *c, sector_t block, struct dm_buffer **bp); /* * Prefetch the specified blocks to the cache. * The function starts to read the blocks and returns without waiting for * I/O to finish. */ void dm_bufio_prefetch(struct dm_bufio_client *c, sector_t block, unsigned n_blocks); /* * Release a reference obtained with dm_bufio_{read,get,new}. The data * pointer and dm_buffer pointer is no longer valid after this call. */ void dm_bufio_release(struct dm_buffer *b); /* * Mark a buffer dirty. It should be called after the buffer is modified. * * In case of memory pressure, the buffer may be written after * dm_bufio_mark_buffer_dirty, but before dm_bufio_write_dirty_buffers. So * dm_bufio_write_dirty_buffers guarantees that the buffer is on-disk but * the actual writing may occur earlier. */ void dm_bufio_mark_buffer_dirty(struct dm_buffer *b); /* * Mark a part of the buffer dirty. * * The specified part of the buffer is scheduled to be written. dm-bufio may * write the specified part of the buffer or it may write a larger superset. */ void dm_bufio_mark_partial_buffer_dirty(struct dm_buffer *b, unsigned start, unsigned end); /* * Initiate writing of dirty buffers, without waiting for completion. */ void dm_bufio_write_dirty_buffers_async(struct dm_bufio_client *c); /* * Write all dirty buffers. Guarantees that all dirty buffers created prior * to this call are on disk when this call exits. */ int dm_bufio_write_dirty_buffers(struct dm_bufio_client *c); /* * Send an empty write barrier to the device to flush hardware disk cache. */ int dm_bufio_issue_flush(struct dm_bufio_client *c); /* * Send a discard request to the underlying device. */ int dm_bufio_issue_discard(struct dm_bufio_client *c, sector_t block, sector_t count); /* * Like dm_bufio_release but also move the buffer to the new * block. dm_bufio_write_dirty_buffers is needed to commit the new block. */ void dm_bufio_release_move(struct dm_buffer *b, sector_t new_block); /* * Free the given buffer. * This is just a hint, if the buffer is in use or dirty, this function * does nothing. */ void dm_bufio_forget(struct dm_bufio_client *c, sector_t block); /* * Free the given range of buffers. * This is just a hint, if the buffer is in use or dirty, this function * does nothing. */ void dm_bufio_forget_buffers(struct dm_bufio_client *c, sector_t block, sector_t n_blocks); /* * Set the minimum number of buffers before cleanup happens. */ void dm_bufio_set_minimum_buffers(struct dm_bufio_client *c, unsigned n); unsigned dm_bufio_get_block_size(struct dm_bufio_client *c); sector_t dm_bufio_get_device_size(struct dm_bufio_client *c); sector_t dm_bufio_get_block_number(struct dm_buffer *b); void *dm_bufio_get_block_data(struct dm_buffer *b); void *dm_bufio_get_aux_data(struct dm_buffer *b); struct dm_bufio_client *dm_bufio_get_client(struct dm_buffer *b); /*----------------------------------------------------------------*/ #endif
/* * linux/net/sunrpc/auth_unix.c * * UNIX-style authentication; no AUTH_SHORT support * * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> */ #include <linux/slab.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/module.h> #include <linux/sunrpc/clnt.h> #include <linux/sunrpc/auth.h> #include <linux/user_namespace.h> struct unx_cred { struct rpc_cred uc_base; kgid_t uc_gid; kgid_t uc_gids[UNX_NGROUPS]; }; #define uc_uid uc_base.cr_uid #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) # define RPCDBG_FACILITY RPCDBG_AUTH #endif static struct rpc_auth unix_auth; static const struct rpc_credops unix_credops; static struct rpc_auth * unx_create(struct rpc_auth_create_args *args, struct rpc_clnt *clnt) { dprintk("RPC: creating UNIX authenticator for client %p\n", clnt); atomic_inc(&unix_auth.au_count); return &unix_auth; } static void unx_destroy(struct rpc_auth *auth) { dprintk("RPC: destroying UNIX authenticator %p\n", auth); rpcauth_clear_credcache(auth->au_credcache); } static int unx_hash_cred(struct auth_cred *acred, unsigned int hashbits) { return hash_64(from_kgid(&init_user_ns, acred->gid) | ((u64)from_kuid(&init_user_ns, acred->uid) << (sizeof(gid_t) * 8)), hashbits); } /* * Lookup AUTH_UNIX creds for current process */ static struct rpc_cred * unx_lookup_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags) { return rpcauth_lookup_credcache(auth, acred, flags, GFP_NOFS); } static struct rpc_cred * unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags, gfp_t gfp) { struct unx_cred *cred; unsigned int groups = 0; unsigned int i; dprintk("RPC: allocating UNIX cred for uid %d gid %d\n", from_kuid(&init_user_ns, acred->uid), from_kgid(&init_user_ns, acred->gid)); if (!(cred = kmalloc(sizeof(*cred), gfp))) return ERR_PTR(-ENOMEM); rpcauth_init_cred(&cred->uc_base, acred, auth, &unix_credops); cred->uc_base.cr_flags = 1UL << RPCAUTH_CRED_UPTODATE; if (acred->group_info != NULL) groups = acred->group_info->ngroups; if (groups > UNX_NGROUPS) groups = UNX_NGROUPS; cred->uc_gid = acred->gid; for (i = 0; i < groups; i++) cred->uc_gids[i] = acred->group_info->gid[i]; if (i < UNX_NGROUPS) cred->uc_gids[i] = INVALID_GID; return &cred->uc_base; } static void unx_free_cred(struct unx_cred *unx_cred) { dprintk("RPC: unx_free_cred %p\n", unx_cred); kfree(unx_cred); } static void unx_free_cred_callback(struct rcu_head *head) { struct unx_cred *unx_cred = container_of(head, struct unx_cred, uc_base.cr_rcu); unx_free_cred(unx_cred); } static void unx_destroy_cred(struct rpc_cred *cred) { call_rcu(&cred->cr_rcu, unx_free_cred_callback); } /* * Match credentials against current process creds. * The root_override argument takes care of cases where the caller may * request root creds (e.g. for NFS swapping). */ static int unx_match(struct auth_cred *acred, struct rpc_cred *rcred, int flags) { struct unx_cred *cred = container_of(rcred, struct unx_cred, uc_base); unsigned int groups = 0; unsigned int i; if (!uid_eq(cred->uc_uid, acred->uid) || !gid_eq(cred->uc_gid, acred->gid)) return 0; if (acred->group_info != NULL) groups = acred->group_info->ngroups; if (groups > UNX_NGROUPS) groups = UNX_NGROUPS; for (i = 0; i < groups ; i++) if (!gid_eq(cred->uc_gids[i], acred->group_info->gid[i])) return 0; if (groups < UNX_NGROUPS && gid_valid(cred->uc_gids[groups])) return 0; return 1; } /* * Marshal credentials. * Maybe we should keep a cached credential for performance reasons. */ static __be32 * unx_marshal(struct rpc_task *task, __be32 *p) { struct rpc_clnt *clnt = task->tk_client; struct unx_cred *cred = container_of(task->tk_rqstp->rq_cred, struct unx_cred, uc_base); __be32 *base, *hold; int i; *p++ = htonl(RPC_AUTH_UNIX); base = p++; *p++ = htonl(jiffies/HZ); /* * Copy the UTS nodename captured when the client was created. */ p = xdr_encode_array(p, clnt->cl_nodename, clnt->cl_nodelen); *p++ = htonl((u32) from_kuid(&init_user_ns, cred->uc_uid)); *p++ = htonl((u32) from_kgid(&init_user_ns, cred->uc_gid)); hold = p++; for (i = 0; i < UNX_NGROUPS && gid_valid(cred->uc_gids[i]); i++) *p++ = htonl((u32) from_kgid(&init_user_ns, cred->uc_gids[i])); *hold = htonl(p - hold - 1); /* gid array length */ *base = htonl((p - base - 1) << 2); /* cred length */ *p++ = htonl(RPC_AUTH_NULL); *p++ = htonl(0); return p; } /* * Refresh credentials. This is a no-op for AUTH_UNIX */ static int unx_refresh(struct rpc_task *task) { set_bit(RPCAUTH_CRED_UPTODATE, &task->tk_rqstp->rq_cred->cr_flags); return 0; } static __be32 * unx_validate(struct rpc_task *task, __be32 *p) { rpc_authflavor_t flavor; u32 size; flavor = ntohl(*p++); if (flavor != RPC_AUTH_NULL && flavor != RPC_AUTH_UNIX && flavor != RPC_AUTH_SHORT) { printk("RPC: bad verf flavor: %u\n", flavor); return ERR_PTR(-EIO); } size = ntohl(*p++); if (size > RPC_MAX_AUTH_SIZE) { printk("RPC: giant verf size: %u\n", size); return ERR_PTR(-EIO); } task->tk_rqstp->rq_cred->cr_auth->au_rslack = (size >> 2) + 2; p += (size >> 2); return p; } int __init rpc_init_authunix(void) { return rpcauth_init_credcache(&unix_auth); } void rpc_destroy_authunix(void) { rpcauth_destroy_credcache(&unix_auth); } const struct rpc_authops authunix_ops = { .owner = THIS_MODULE, .au_flavor = RPC_AUTH_UNIX, .au_name = "UNIX", .create = unx_create, .destroy = unx_destroy, .hash_cred = unx_hash_cred, .lookup_cred = unx_lookup_cred, .crcreate = unx_create_cred, }; static struct rpc_auth unix_auth = { .au_cslack = UNX_CALLSLACK, .au_rslack = NUL_REPLYSLACK, .au_flags = RPCAUTH_AUTH_NO_CRKEY_TIMEOUT, .au_ops = &authunix_ops, .au_flavor = RPC_AUTH_UNIX, .au_count = ATOMIC_INIT(0), }; static const struct rpc_credops unix_credops = { .cr_name = "AUTH_UNIX", .crdestroy = unx_destroy_cred, .crbind = rpcauth_generic_bind_cred, .crmatch = unx_match, .crmarshal = unx_marshal, .crrefresh = unx_refresh, .crvalidate = unx_validate, };
/* * Driver for the Conexant CX25821 PCIe bridge * * Copyright (C) 2009 Conexant Systems Inc. * Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _MEDUSA_VIDEO_H #define _MEDUSA_VIDEO_H #include "cx25821-medusa-defines.h" // Color control constants #define VIDEO_PROCAMP_MIN 0 #define VIDEO_PROCAMP_MAX 10000 #define UNSIGNED_BYTE_MIN 0 #define UNSIGNED_BYTE_MAX 0xFF #define SIGNED_BYTE_MIN -128 #define SIGNED_BYTE_MAX 127 // Default video color settings #define SHARPNESS_DEFAULT 50 #define SATURATION_DEFAULT 5000 #define BRIGHTNESS_DEFAULT 6200 #define CONTRAST_DEFAULT 5000 #define HUE_DEFAULT 5000 unsigned short _num_decoders; unsigned short _num_cameras; unsigned int _video_standard; int _display_field_cnt[MAX_DECODERS]; #endif
/* Copyright (c) 2010, 2012, 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 Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef TABLE_ESGS_BY_ACCOUNT_BY_EVENT_NAME_H #define TABLE_ESGS_BY_ACCOUNT_BY_EVENT_NAME_H /** @file storage/perfschema/table_esgs_by_account_by_event_name.h Table EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME (declarations). */ #include "pfs_column_types.h" #include "pfs_engine_table.h" #include "pfs_instr_class.h" #include "pfs_instr.h" #include "pfs_account.h" #include "table_helper.h" /** @addtogroup Performance_schema_tables @{ */ /** A row of table PERFORMANCE_SCHEMA.EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME. */ struct row_esgs_by_account_by_event_name { /** Column USER, HOST. */ PFS_account_row m_account; /** Column EVENT_NAME. */ PFS_event_name_row m_event_name; /** Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT. */ PFS_stage_stat_row m_stat; }; /** Position of a cursor on PERFORMANCE_SCHEMA.EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME. Index 1 on user@host (0 based) Index 2 on stage class (1 based) */ struct pos_esgs_by_account_by_event_name : public PFS_double_index { pos_esgs_by_account_by_event_name() : PFS_double_index(0, 1) {} inline void reset(void) { m_index_1= 0; m_index_2= 1; } inline bool has_more_account(void) { return (m_index_1 < account_max); } inline void next_account(void) { m_index_1++; m_index_2= 1; } }; /** Table PERFORMANCE_SCHEMA.EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME. */ class table_esgs_by_account_by_event_name : public PFS_engine_table { public: /** Table share */ static PFS_engine_table_share m_share; static PFS_engine_table* create(); static int delete_all_rows(); virtual int rnd_init(bool scan); virtual int rnd_next(); virtual int rnd_pos(const void *pos); virtual void reset_position(void); protected: virtual int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all); table_esgs_by_account_by_event_name(); public: ~table_esgs_by_account_by_event_name() {} protected: void make_row(PFS_account *account, PFS_stage_class *klass); private: /** Table share lock. */ static THR_LOCK m_table_lock; /** Fields definition. */ static TABLE_FIELD_DEF m_field_def; /** Current row. */ row_esgs_by_account_by_event_name m_row; /** True is the current row exists. */ bool m_row_exists; /** Current position. */ pos_esgs_by_account_by_event_name m_pos; /** Next position. */ pos_esgs_by_account_by_event_name m_next_pos; }; /** @} */ #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 REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_MAIN_H_ #define REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_MAIN_H_ #include "remoting/host/host_export.h" namespace remoting { // The me2me native messaging host entry point exported from remoting_core.dll. HOST_EXPORT int It2MeNativeMessagingHostMain(int argc, char** argv); } // namespace remoting #endif // REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_MAIN_H_
/****************************************************************************** * * Copyright(c) 2009-2010 Realtek Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License 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 along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * The full GNU General Public License is included in this distribution in the * file called LICENSE. * * Contact Information: * wlanfae <wlanfae@realtek.com> * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, * Hsinchu 300, Taiwan. * * Larry Finger <Larry.Finger@lwfinger.net> * *****************************************************************************/ #ifndef __REALTEK_PCI92SE_LED_H__ #define __REALTEK_PCI92SE_LED_H__ void rtl92se_init_sw_leds(struct ieee80211_hw *hw); void rtl92se_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); void rtl92se_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); #endif
/***************************************************************************** * volume.c : helper for software audio amplification ***************************************************************************** * Copyright (C) 2012 Rémi Denis-Courmont * * This program 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. * * 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser 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. *****************************************************************************/ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <stdio.h> #include <math.h> #include <vlc_common.h> #include <vlc_aout.h> #define add_sw_gain() \ add_float(MODULE_STRING"-gain", 1., N_("Software gain"), \ N_("This linear gain will be applied in software."), true) \ change_float_range(0., 8.) static int aout_SoftVolumeSet(audio_output_t *aout, float volume) { aout_sys_t *sys = aout->sys; /* * Cubic mapping from software volume to amplification factor. * This provides a good tradeoff between low and high volume ranges. * * This code is only used for the VLC software mixer. If you change this * formula, be sure to update the volume-capable plugins also. */ float gain = volume * volume * volume; if (!sys->soft_mute && aout_GainRequest(aout, gain)) return -1; sys->soft_gain = gain; if (var_InheritBool(aout, "volume-save")) config_PutFloat(aout, MODULE_STRING"-gain", gain); aout_VolumeReport(aout, volume); return 0; } static int aout_SoftMuteSet (audio_output_t *aout, bool mute) { aout_sys_t *sys = aout->sys; if (aout_GainRequest(aout, mute ? 0.f : sys->soft_gain)) return -1; sys->soft_mute = mute; aout_MuteReport(aout, mute); return 0; } static void aout_SoftVolumeInit(audio_output_t *aout) { aout_sys_t *sys = aout->sys; float gain = var_InheritFloat(aout, MODULE_STRING"-gain"); bool mute = var_InheritBool(aout, "mute"); aout->volume_set = aout_SoftVolumeSet; aout->mute_set = aout_SoftMuteSet; sys->soft_gain = gain; sys->soft_mute = mute; aout_MuteReport(aout, mute); aout_VolumeReport(aout, cbrtf(gain)); } static void aout_SoftVolumeStart (audio_output_t *aout) { aout_sys_t *sys = aout->sys; if (aout_GainRequest(aout, sys->soft_mute ? 0.f : sys->soft_gain)) { aout_MuteReport(aout, false); aout_VolumeReport(aout, 1.f); } }
// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /****************************************************************************** * * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface * * Copyright (C) 2000 - 2018, Intel Corp. * *****************************************************************************/ #include <acpi/acpi.h> #include "accommon.h" #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME("hwacpi") #if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /****************************************************************************** * * FUNCTION: acpi_hw_set_mode * * PARAMETERS: mode - SYS_MODE_ACPI or SYS_MODE_LEGACY * * RETURN: Status * * DESCRIPTION: Transitions the system into the requested mode. * ******************************************************************************/ acpi_status acpi_hw_set_mode(u32 mode) { acpi_status status; ACPI_FUNCTION_TRACE(hw_set_mode); /* If the Hardware Reduced flag is set, machine is always in acpi mode */ if (acpi_gbl_reduced_hardware) { return_ACPI_STATUS(AE_OK); } /* * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, * system does not support mode transition. */ if (!acpi_gbl_FADT.smi_command) { ACPI_ERROR((AE_INFO, "No SMI_CMD in FADT, mode transition failed")); return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); } /* * ACPI 2.0 clarified the meaning of ACPI_ENABLE and ACPI_DISABLE * in FADT: If it is zero, enabling or disabling is not supported. * As old systems may have used zero for mode transition, * we make sure both the numbers are zero to determine these * transitions are not supported. */ if (!acpi_gbl_FADT.acpi_enable && !acpi_gbl_FADT.acpi_disable) { ACPI_ERROR((AE_INFO, "No ACPI mode transition supported in this system " "(enable/disable both zero)")); return_ACPI_STATUS(AE_OK); } switch (mode) { case ACPI_SYS_MODE_ACPI: /* BIOS should have disabled ALL fixed and GP events */ status = acpi_hw_write_port(acpi_gbl_FADT.smi_command, (u32) acpi_gbl_FADT.acpi_enable, 8); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Attempting to enable ACPI mode\n")); break; case ACPI_SYS_MODE_LEGACY: /* * BIOS should clear all fixed status bits and restore fixed event * enable bits to default */ status = acpi_hw_write_port(acpi_gbl_FADT.smi_command, (u32)acpi_gbl_FADT.acpi_disable, 8); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Attempting to enable Legacy (non-ACPI) mode\n")); break; default: return_ACPI_STATUS(AE_BAD_PARAMETER); } if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Could not write ACPI mode change")); return_ACPI_STATUS(status); } return_ACPI_STATUS(AE_OK); } /******************************************************************************* * * FUNCTION: acpi_hw_get_mode * * PARAMETERS: none * * RETURN: SYS_MODE_ACPI or SYS_MODE_LEGACY * * DESCRIPTION: Return current operating state of system. Determined by * querying the SCI_EN bit. * ******************************************************************************/ u32 acpi_hw_get_mode(void) { acpi_status status; u32 value; ACPI_FUNCTION_TRACE(hw_get_mode); /* If the Hardware Reduced flag is set, machine is always in acpi mode */ if (acpi_gbl_reduced_hardware) { return_UINT32(ACPI_SYS_MODE_ACPI); } /* * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, * system does not support mode transition. */ if (!acpi_gbl_FADT.smi_command) { return_UINT32(ACPI_SYS_MODE_ACPI); } status = acpi_read_bit_register(ACPI_BITREG_SCI_ENABLE, &value); if (ACPI_FAILURE(status)) { return_UINT32(ACPI_SYS_MODE_LEGACY); } if (value) { return_UINT32(ACPI_SYS_MODE_ACPI); } else { return_UINT32(ACPI_SYS_MODE_LEGACY); } } #endif /* !ACPI_REDUCED_HARDWARE */
/* * SpanDSP - a series of DSP components for telephony * * noise.h - A low complexity audio noise generator, suitable for * real time generation (current just approx AWGN) * * Written by Steve Underwood <steveu@coppice.org> * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: noise.h,v 1.17 2009/02/10 13:06:47 steveu Exp $ */ /*! \file */ #if !defined(_SPANDSP_NOISE_H_) #define _SPANDSP_NOISE_H_ /*! \page noise_page Noise generation \section noise_page_sec_1 What does it do? It generates audio noise. Currently it only generates reasonable quality AWGN. It is designed to be of sufficiently low complexity to generate large volumes of reasonable quality noise, in real time. Hoth noise is used to model indoor ambient noise when evaluating communications systems such as telephones. It is named after D.F. Hoth, who made the first systematic study of this. The official definition of Hoth noise is IEEE standard 269-2001 (revised from 269-1992), "Draft Standard Methods for Measuring Transmission Performance of Analog and Digital Telephone Sets, Handsets and Headsets." The table below gives the spectral density of Hoth noise, adjusted in level to produce a reading of 50 dBA. Freq (Hz) Spectral Bandwidth Total power in density 10 log_f each 1/3 octave band (dB SPL/Hz) (dB) (dB SPL) 100 32.4 13.5 45.9 125 30.9 14.7 45.5 160 29.1 15.7 44.9 200 27.6 16.5 44.1 250 26.0 17.6 43.6 315 24.4 18.7 43.1 400 22.7 19.7 42.3 500 21.1 20.6 41.7 630 19.5 21.7 41.2 800 17.8 22.7 40.4 1000 16.2 23.5 39.7 1250 14.6 24.7 39.3 1600 12.9 25.7 38.7 2000 11.3 26.5 37.8 2500 9.6 27.6 37.2 3150 7.8 28.7 36.5 4000 5.4 29.7 34.8 5000 2.6 30.6 33.2 6300 -1.3 31.7 30.4 8000 -6.6 32.7 26.0 The tolerance for each 1/3rd octave band is ¡Ó3dB. \section awgn_page_sec_2 How does it work? The central limit theorem says if you add a few random numbers together, the result starts to look Gaussian. In this case we sum 8 random numbers. The result is fast, and perfectly good as a noise source for many purposes. It should not be trusted as a high quality AWGN generator, for elaborate modelling purposes. */ enum { NOISE_CLASS_AWGN = 1, NOISE_CLASS_HOTH }; /*! Noise generator descriptor. This contains all the state information for an instance of the noise generator. */ typedef struct noise_state_s noise_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise an audio noise generator. \brief Initialise an audio noise generator. \param s The noise generator context. \param seed A seed for the underlying random number generator. \param level The noise power level in dBmO. \param class_of_noise The class of noise (e.g. AWGN). \param quality A parameter which permits speed and accuracy of the noise generation to be adjusted. \return A pointer to the noise generator context. */ SPAN_DECLARE(noise_state_t *) noise_init_dbm0(noise_state_t *s, int seed, float level, int class_of_noise, int quality); SPAN_DECLARE(noise_state_t *) noise_init_dbov(noise_state_t *s, int seed, float level, int class_of_noise, int quality); SPAN_DECLARE(int) noise_release(noise_state_t *s); SPAN_DECLARE(int) noise_free(noise_state_t *s); /*! Generate a sample of audio noise. \brief Generate a sample of audio noise. \param s The noise generator context. \return The generated sample. */ SPAN_DECLARE(int16_t) noise(noise_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/
/* Copyright 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. 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, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* Linked with objcopy.o to flag that this program is 'objcopy' (not 'strip'). */ int is_strip = 0;
/* * Symbol USB barcode to serial driver * * Copyright (C) 2013 Johan Hovold <jhovold@gmail.com> * Copyright (C) 2009 Greg Kroah-Hartman <gregkh@suse.de> * Copyright (C) 2009 Novell Inc. * * 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. */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/tty.h> #include <linux/slab.h> #include <linux/tty_driver.h> #include <linux/tty_flip.h> #include <linux/module.h> #include <linux/usb.h> #include <linux/usb/serial.h> #include <linux/uaccess.h> static const struct usb_device_id id_table[] = { { USB_DEVICE(0x05e0, 0x0600) }, { }, }; MODULE_DEVICE_TABLE(usb, id_table); struct symbol_private { spinlock_t lock; /* protects the following flags */ bool throttled; bool actually_throttled; }; static void symbol_int_callback(struct urb *urb) { struct usb_serial_port *port = urb->context; struct symbol_private *priv = usb_get_serial_port_data(port); unsigned char *data = urb->transfer_buffer; int status = urb->status; int result; int data_length; switch (status) { case 0: /* success */ break; case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: /* this urb is terminated, clean up */ dev_dbg(&port->dev, "%s - urb shutting down with status: %d\n", __func__, status); return; default: dev_dbg(&port->dev, "%s - nonzero urb status received: %d\n", __func__, status); goto exit; } usb_serial_debug_data(&port->dev, __func__, urb->actual_length, data); if (urb->actual_length > 1) { data_length = urb->actual_length - 1; /* * Data from the device comes with a 1 byte header: * * <size of data>data... * This is real data to be sent to the tty layer * we pretty much just ignore the size and send everything * else to the tty layer. */ tty_insert_flip_string(&port->port, &data[1], data_length); tty_flip_buffer_push(&port->port); } else { dev_dbg(&port->dev, "Improper amount of data received from the device, " "%d bytes", urb->actual_length); } exit: spin_lock(&priv->lock); /* Continue trying to always read if we should */ if (!priv->throttled) { result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); if (result) dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __func__, result); } else priv->actually_throttled = true; spin_unlock(&priv->lock); } static int symbol_open(struct tty_struct *tty, struct usb_serial_port *port) { struct symbol_private *priv = usb_get_serial_port_data(port); unsigned long flags; int result = 0; spin_lock_irqsave(&priv->lock, flags); priv->throttled = false; priv->actually_throttled = false; spin_unlock_irqrestore(&priv->lock, flags); /* Start reading from the device */ result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); if (result) dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __func__, result); return result; } static void symbol_close(struct usb_serial_port *port) { usb_kill_urb(port->interrupt_in_urb); } static void symbol_throttle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct symbol_private *priv = usb_get_serial_port_data(port); spin_lock_irq(&priv->lock); priv->throttled = true; spin_unlock_irq(&priv->lock); } static void symbol_unthrottle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct symbol_private *priv = usb_get_serial_port_data(port); int result; bool was_throttled; spin_lock_irq(&priv->lock); priv->throttled = false; was_throttled = priv->actually_throttled; priv->actually_throttled = false; spin_unlock_irq(&priv->lock); if (was_throttled) { result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); if (result) dev_err(&port->dev, "%s - failed submitting read urb, error %d\n", __func__, result); } } static int symbol_startup(struct usb_serial *serial) { if (!serial->num_interrupt_in) { dev_err(&serial->dev->dev, "no interrupt-in endpoint\n"); return -ENODEV; } return 0; } static int symbol_port_probe(struct usb_serial_port *port) { struct symbol_private *priv; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; spin_lock_init(&priv->lock); usb_set_serial_port_data(port, priv); return 0; } static int symbol_port_remove(struct usb_serial_port *port) { struct symbol_private *priv = usb_get_serial_port_data(port); kfree(priv); return 0; } static struct usb_serial_driver symbol_device = { .driver = { .owner = THIS_MODULE, .name = "symbol", }, .id_table = id_table, .num_ports = 1, .attach = symbol_startup, .port_probe = symbol_port_probe, .port_remove = symbol_port_remove, .open = symbol_open, .close = symbol_close, .throttle = symbol_throttle, .unthrottle = symbol_unthrottle, .read_int_callback = symbol_int_callback, }; static struct usb_serial_driver * const serial_drivers[] = { &symbol_device, NULL }; module_usb_serial_driver(serial_drivers, id_table); MODULE_LICENSE("GPL");
/* * Copyright (C) 2010 Apple 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: * 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 WebURLResponse_h #define WebURLResponse_h #include "APIObject.h" #include <WebCore/ResourceResponse.h> #include <wtf/Forward.h> #if PLATFORM(MAC) typedef NSURLResponse* PlatformResponse; #else typedef void* PlatformResponse; #endif namespace WebKit { class WebURLResponse : public TypedAPIObject<APIObject::TypeURLResponse> { public: static PassRefPtr<WebURLResponse> create(const WebCore::ResourceResponse& response) { return adoptRef(new WebURLResponse(response)); } static PassRefPtr<WebURLResponse> create(PlatformResponse platformResponse) { return adoptRef(new WebURLResponse(platformResponse)); } PlatformResponse platformResponse() const; const WebCore::ResourceResponse& resourceResponse() const { return m_response; } private: explicit WebURLResponse(const WebCore::ResourceResponse&); explicit WebURLResponse(PlatformResponse); WebCore::ResourceResponse m_response; }; } // namespace WebKit #endif // WebURLResponse_h
/* * Copyright (c) 2004, 2005, Voltaire, Inc. All rights reserved. * Copyright (c) 2005 Intel Corporation. All rights reserved. * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 HNR Consulting. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * 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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef __IB_MAD_PRIV_H__ #define __IB_MAD_PRIV_H__ #include <linux/completion.h> #include <linux/err.h> #include <linux/workqueue.h> #include <rdma/ib_mad.h> #include <rdma/ib_smi.h> #include <rdma/opa_smi.h> #define IB_MAD_QPS_CORE 2 /* Always QP0 and QP1 as a minimum */ /* QP and CQ parameters */ #define IB_MAD_QP_SEND_SIZE 128 #define IB_MAD_QP_RECV_SIZE 512 #define IB_MAD_QP_MIN_SIZE 64 #define IB_MAD_QP_MAX_SIZE 8192 #define IB_MAD_SEND_REQ_MAX_SG 2 #define IB_MAD_RECV_REQ_MAX_SG 1 #define IB_MAD_SEND_Q_PSN 0 /* Registration table sizes */ #define MAX_MGMT_CLASS 80 #define MAX_MGMT_VERSION 0x83 #define MAX_MGMT_OUI 8 #define MAX_MGMT_VENDOR_RANGE2 (IB_MGMT_CLASS_VENDOR_RANGE2_END - \ IB_MGMT_CLASS_VENDOR_RANGE2_START + 1) struct ib_mad_list_head { struct list_head list; struct ib_cqe cqe; struct ib_mad_queue *mad_queue; }; struct ib_mad_private_header { struct ib_mad_list_head mad_list; struct ib_mad_recv_wc recv_wc; struct ib_wc wc; u64 mapping; } __packed; struct ib_mad_private { struct ib_mad_private_header header; size_t mad_size; struct ib_grh grh; u8 mad[]; } __packed; struct ib_rmpp_segment { struct list_head list; u32 num; u8 data[]; }; struct ib_mad_agent_private { struct ib_mad_agent agent; struct ib_mad_reg_req *reg_req; struct ib_mad_qp_info *qp_info; spinlock_t lock; struct list_head send_list; struct list_head wait_list; struct list_head done_list; struct delayed_work timed_work; unsigned long timeout; struct list_head local_list; struct work_struct local_work; struct list_head rmpp_list; refcount_t refcount; union { struct completion comp; struct rcu_head rcu; }; }; struct ib_mad_snoop_private { struct ib_mad_agent agent; struct ib_mad_qp_info *qp_info; int snoop_index; int mad_snoop_flags; atomic_t refcount; struct completion comp; }; struct ib_mad_send_wr_private { struct ib_mad_list_head mad_list; struct list_head agent_list; struct ib_mad_agent_private *mad_agent_priv; struct ib_mad_send_buf send_buf; u64 header_mapping; u64 payload_mapping; struct ib_ud_wr send_wr; struct ib_sge sg_list[IB_MAD_SEND_REQ_MAX_SG]; __be64 tid; unsigned long timeout; int max_retries; int retries_left; int retry; int refcount; enum ib_wc_status status; /* RMPP control */ struct list_head rmpp_list; struct ib_rmpp_segment *last_ack_seg; struct ib_rmpp_segment *cur_seg; int last_ack; int seg_num; int newwin; int pad; }; struct ib_mad_local_private { struct list_head completion_list; struct ib_mad_private *mad_priv; struct ib_mad_agent_private *recv_mad_agent; struct ib_mad_send_wr_private *mad_send_wr; size_t return_wc_byte_len; }; struct ib_mad_mgmt_method_table { struct ib_mad_agent_private *agent[IB_MGMT_MAX_METHODS]; }; struct ib_mad_mgmt_class_table { struct ib_mad_mgmt_method_table *method_table[MAX_MGMT_CLASS]; }; struct ib_mad_mgmt_vendor_class { u8 oui[MAX_MGMT_OUI][3]; struct ib_mad_mgmt_method_table *method_table[MAX_MGMT_OUI]; }; struct ib_mad_mgmt_vendor_class_table { struct ib_mad_mgmt_vendor_class *vendor_class[MAX_MGMT_VENDOR_RANGE2]; }; struct ib_mad_mgmt_version_table { struct ib_mad_mgmt_class_table *class; struct ib_mad_mgmt_vendor_class_table *vendor; }; struct ib_mad_queue { spinlock_t lock; struct list_head list; int count; int max_active; struct ib_mad_qp_info *qp_info; }; struct ib_mad_qp_info { struct ib_mad_port_private *port_priv; struct ib_qp *qp; struct ib_mad_queue send_queue; struct ib_mad_queue recv_queue; struct list_head overflow_list; spinlock_t snoop_lock; struct ib_mad_snoop_private **snoop_table; int snoop_table_size; atomic_t snoop_count; }; struct ib_mad_port_private { struct list_head port_list; struct ib_device *device; int port_num; struct ib_cq *cq; struct ib_pd *pd; spinlock_t reg_lock; struct ib_mad_mgmt_version_table version[MAX_MGMT_VERSION]; struct workqueue_struct *wq; struct ib_mad_qp_info qp_info[IB_MAD_QPS_CORE]; }; int ib_send_mad(struct ib_mad_send_wr_private *mad_send_wr); struct ib_mad_send_wr_private * ib_find_send_mad(const struct ib_mad_agent_private *mad_agent_priv, const struct ib_mad_recv_wc *mad_recv_wc); void ib_mad_complete_send_wr(struct ib_mad_send_wr_private *mad_send_wr, struct ib_mad_send_wc *mad_send_wc); void ib_mark_mad_done(struct ib_mad_send_wr_private *mad_send_wr); void ib_reset_mad_timeout(struct ib_mad_send_wr_private *mad_send_wr, unsigned long timeout_ms); #endif /* __IB_MAD_PRIV_H__ */
// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2000-2005 Silicon Graphics, Inc. * All Rights Reserved. */ #ifndef __XFS_SUPPORT_KMEM_H__ #define __XFS_SUPPORT_KMEM_H__ #include <linux/slab.h> #include <linux/sched.h> #include <linux/mm.h> #include <linux/vmalloc.h> /* * General memory allocation interfaces */ typedef unsigned __bitwise xfs_km_flags_t; #define KM_SLEEP ((__force xfs_km_flags_t)0x0001u) #define KM_NOSLEEP ((__force xfs_km_flags_t)0x0002u) #define KM_NOFS ((__force xfs_km_flags_t)0x0004u) #define KM_MAYFAIL ((__force xfs_km_flags_t)0x0008u) #define KM_ZERO ((__force xfs_km_flags_t)0x0010u) /* * We use a special process flag to avoid recursive callbacks into * the filesystem during transactions. We will also issue our own * warnings, so we explicitly skip any generic ones (silly of us). */ static inline gfp_t kmem_flags_convert(xfs_km_flags_t flags) { gfp_t lflags; BUG_ON(flags & ~(KM_SLEEP|KM_NOSLEEP|KM_NOFS|KM_MAYFAIL|KM_ZERO)); if (flags & KM_NOSLEEP) { lflags = GFP_ATOMIC | __GFP_NOWARN; } else { lflags = GFP_KERNEL | __GFP_NOWARN; if (flags & KM_NOFS) lflags &= ~__GFP_FS; } /* * Default page/slab allocator behavior is to retry for ever * for small allocations. We can override this behavior by using * __GFP_RETRY_MAYFAIL which will tell the allocator to retry as long * as it is feasible but rather fail than retry forever for all * request sizes. */ if (flags & KM_MAYFAIL) lflags |= __GFP_RETRY_MAYFAIL; if (flags & KM_ZERO) lflags |= __GFP_ZERO; return lflags; } extern void *kmem_alloc(size_t, xfs_km_flags_t); extern void *kmem_alloc_large(size_t size, xfs_km_flags_t); extern void *kmem_realloc(const void *, size_t, xfs_km_flags_t); static inline void kmem_free(const void *ptr) { kvfree(ptr); } static inline void * kmem_zalloc(size_t size, xfs_km_flags_t flags) { return kmem_alloc(size, flags | KM_ZERO); } static inline void * kmem_zalloc_large(size_t size, xfs_km_flags_t flags) { return kmem_alloc_large(size, flags | KM_ZERO); } /* * Zone interfaces */ #define KM_ZONE_HWALIGN SLAB_HWCACHE_ALIGN #define KM_ZONE_RECLAIM SLAB_RECLAIM_ACCOUNT #define KM_ZONE_SPREAD SLAB_MEM_SPREAD #define KM_ZONE_ACCOUNT SLAB_ACCOUNT #define kmem_zone kmem_cache #define kmem_zone_t struct kmem_cache static inline kmem_zone_t * kmem_zone_init(int size, char *zone_name) { return kmem_cache_create(zone_name, size, 0, 0, NULL); } static inline kmem_zone_t * kmem_zone_init_flags(int size, char *zone_name, slab_flags_t flags, void (*construct)(void *)) { return kmem_cache_create(zone_name, size, 0, flags, construct); } static inline void kmem_zone_free(kmem_zone_t *zone, void *ptr) { kmem_cache_free(zone, ptr); } static inline void kmem_zone_destroy(kmem_zone_t *zone) { kmem_cache_destroy(zone); } extern void *kmem_zone_alloc(kmem_zone_t *, xfs_km_flags_t); static inline void * kmem_zone_zalloc(kmem_zone_t *zone, xfs_km_flags_t flags) { return kmem_zone_alloc(zone, flags | KM_ZERO); } #endif /* __XFS_SUPPORT_KMEM_H__ */
/* * Copyright (C) 2007 Apple 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: * 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 APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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 WebScrollBar_h #define WebScrollBar_h #include "WebKit.h" #include <wtf/RefPtr.h> #include <wtf/OwnPtr.h> #include <WebCore/COMPtr.h> #include <WebCore/Scrollbar.h> #include <WebCore/ScrollableArea.h> namespace WebCore { class Scrollbar; } class WebScrollBar : public IWebScrollBarPrivate, WebCore::ScrollableArea { public: static WebScrollBar* createInstance(); protected: WebScrollBar(); ~WebScrollBar(); public: // IUnknown virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); virtual ULONG STDMETHODCALLTYPE AddRef(void); virtual ULONG STDMETHODCALLTYPE Release(void); // IWebScrollBarPrivate virtual HRESULT STDMETHODCALLTYPE init( /* [in] */ IWebScrollBarDelegatePrivate* delegate, /* [in] */ OLE_HANDLE containingWindow, /* [in] */ WebScrollBarOrientation orientation, /* [in] */ WebScrollBarControlSize controlSize); virtual HRESULT STDMETHODCALLTYPE setEnabled( /* [in] */ BOOL enabled); virtual HRESULT STDMETHODCALLTYPE setSteps( /* [in] */ int lineStep, /* [in] */ int pageStep); virtual HRESULT STDMETHODCALLTYPE setProportion( /* [in] */ int visibleSize, /* [in] */ int totalSize); virtual HRESULT STDMETHODCALLTYPE setRect( /* [in] */ RECT bounds); virtual HRESULT STDMETHODCALLTYPE setValue( /* [in] */ int value); virtual HRESULT STDMETHODCALLTYPE value( /* [retval][out] */ int* value); virtual HRESULT STDMETHODCALLTYPE paint( /* [in] */ HDC dc, /* [in] */ RECT damageRect); virtual HRESULT STDMETHODCALLTYPE frameRect( /* [retval][out] */ RECT* bounds); virtual HRESULT STDMETHODCALLTYPE width( /* [retval][out] */ int* w); virtual HRESULT STDMETHODCALLTYPE height( /* [retval][out] */ int* h); virtual HRESULT STDMETHODCALLTYPE requestedWidth( /* [retval][out] */ int* w); virtual HRESULT STDMETHODCALLTYPE requestedHeight( /* [retval][out] */ int* h); virtual HRESULT STDMETHODCALLTYPE handleMouseEvent( /* [in] */ OLE_HANDLE window, /* [in] */ UINT msg, /* [in] */ WPARAM wParam, /* [in] */ LPARAM lParam); virtual HRESULT STDMETHODCALLTYPE scroll( /* [in] */ WebScrollDirection direction, /* [in] */ WebScrollGranularity granularity, /* [in] */ float multiplier); protected: // ScrollableArea virtual int scrollSize(WebCore::ScrollbarOrientation) const; virtual int scrollPosition(WebCore::Scrollbar*) const; virtual void setScrollOffset(const WebCore::IntPoint&); virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&); virtual void invalidateScrollCornerRect(const WebCore::IntRect&) { } virtual WebCore::ScrollableArea* enclosingScrollableArea() const { return 0; } virtual int visibleHeight() const OVERRIDE; virtual int visibleWidth() const OVERRIDE; virtual WebCore::IntSize contentsSize() const OVERRIDE; virtual bool scrollbarsCanBeActive() const OVERRIDE; virtual WebCore::IntRect scrollableAreaBoundingBox() const OVERRIDE; // FIXME: We should provide a way to set this value. virtual bool isActive() const { return true; } virtual bool isScrollCornerVisible() const { return false; } virtual WebCore::IntRect scrollCornerRect() const { return WebCore::IntRect(); } virtual WebCore::Scrollbar* horizontalScrollbar() const; virtual WebCore::Scrollbar* verticalScrollbar() const; ULONG m_refCount; HWND m_containingWindow; int m_currentPosition; RefPtr<WebCore::Scrollbar> m_scrollBar; COMPtr<IWebScrollBarDelegatePrivate> m_delegate; }; #endif
#include <linux/io.h> #include <asm/trampoline.h> #include <asm/pgtable.h> #include <asm/e820.h> #if defined(CONFIG_X86_64) && defined(CONFIG_ACPI_SLEEP) #define __trampinit #define __trampinitdata #else #define __trampinit __cpuinit #define __trampinitdata __cpuinitdata #endif /* ready for x86_64 and x86 */ unsigned char *__trampinitdata trampoline_base; void __init reserve_trampoline_memory(void) { unsigned long mem; /* Has to be in very low memory so we can execute real-mode AP code. */ mem = find_e820_area(0, 1<<20, TRAMPOLINE_SIZE, PAGE_SIZE); if (mem == -1L) panic("Cannot allocate trampoline\n"); trampoline_base = __va(mem); reserve_early(mem, mem + TRAMPOLINE_SIZE, "TRAMPOLINE"); } /* * Currently trivial. Write the real->protected mode * bootstrap into the page concerned. The caller * has made sure it's suitably aligned. */ unsigned long __trampinit setup_trampoline(void) { memcpy(trampoline_base, trampoline_data, TRAMPOLINE_SIZE); return virt_to_phys(trampoline_base); } void __init setup_trampoline_page_table(void) { #ifdef CONFIG_X86_32 /* Copy kernel address range */ clone_pgd_range(trampoline_pg_dir + KERNEL_PGD_BOUNDARY, swapper_pg_dir + KERNEL_PGD_BOUNDARY, KERNEL_PGD_PTRS); /* Initialize low mappings */ clone_pgd_range(trampoline_pg_dir, swapper_pg_dir + KERNEL_PGD_BOUNDARY, min_t(unsigned long, KERNEL_PGD_PTRS, KERNEL_PGD_BOUNDARY)); #endif }
/* * Copyright (c) 2012, The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * * * Permission to use, copy, modify, and/or 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. */ /** ------------------------------------------------------------------------- * ------------------------------------------------------------------------- * \file csrLinkList.h Exports and types for the Common link list interfaces. Copyright (C) 2006 Airgo Networks, Incorporated ========================================================================== */ #ifndef CSR_LINK_LIST_H__ #define CSR_LINK_LIST_H__ #include "vos_lock.h" #define LL_ACCESS_LOCK eANI_BOOLEAN_TRUE #define LL_ACCESS_NOLOCK eANI_BOOLEAN_FALSE typedef struct tagListElem { struct tagListElem *last; struct tagListElem *next; }tListElem; typedef enum { LIST_FLAG_CLOSE = 0, LIST_FLAG_OPEN = 0xa1b2c4d7, }tListFlag; //This is a circular double link list typedef struct tagDblLinkList { tListElem ListHead; vos_lock_t Lock; tANI_U32 Count; tHddHandle hHdd; tListFlag Flag; }tDblLinkList; //To get the address of an object of (type) base on the (address) of one of its (field) #define GET_BASE_ADDR(address, type, field) ((type *)( \ (tANI_U8 *)(address) - \ (tANI_U8 *)(&((type *)0)->field))) //To get the offset of (field) inside structure (type) #define GET_FIELD_OFFSET(type, field) ((tANI_U32_OR_PTR)(&(((type *)0)->field))) #define GET_ROUND_UP( _Field, _Boundary ) (((_Field) + ((_Boundary) - 1)) & ~((_Boundary) - 1)) #define BITS_ON( _Field, _Bitmask ) ( (_Field) |= (_Bitmask) ) #define BITS_OFF( _Field, _Bitmask ) ( (_Field) &= ~(_Bitmask) ) #define CSR_MAX(a, b) ((a) > (b) ? (a) : (b)) #define CSR_MIN(a, b) ((a) < (b) ? (a) : (b)) #define csrIsListEmpty(pHead) ((pHead)->next == (pHead)) tANI_U32 csrLLCount( tDblLinkList *pList ); eHalStatus csrLLOpen( tHddHandle hHdd, tDblLinkList *pList ); void csrLLClose( tDblLinkList *pList ); void csrLLLock( tDblLinkList *pList ); void csrLLUnlock( tDblLinkList *pList ); tANI_BOOLEAN csrLLIsListEmpty( tDblLinkList *pList, tANI_BOOLEAN fInterlocked ); void csrLLInsertHead( tDblLinkList *pList, tListElem *pEntry, tANI_BOOLEAN fInterlocked ); void csrLLInsertTail( tDblLinkList *pList, tListElem *pEntry, tANI_BOOLEAN fInterlocked ); //This function put pNewEntry before pEntry. Caller should have found pEntry void csrLLInsertEntry( tDblLinkList *pList, tListElem *pEntry, tListElem *pNewEntry, tANI_BOOLEAN fInterlocked ); tListElem *csrLLPeekHead( tDblLinkList *pList, tANI_BOOLEAN fInterlocked ); tListElem *csrLLPeekTail( tDblLinkList *pList, tANI_BOOLEAN fInterlocked ); tListElem *csrLLRemoveHead( tDblLinkList *pList, tANI_BOOLEAN fInterlocked ); tListElem *csrLLRemoveTail( tDblLinkList *pList, tANI_BOOLEAN fInterlocked ); tANI_BOOLEAN csrLLRemoveEntry( tDblLinkList *pList, tListElem *pEntryToRemove, tANI_BOOLEAN fInterlocked ); void csrLLPurge( tDblLinkList *pList, tANI_BOOLEAN fInterlocked ); //csrLLNext return NULL if reaching the end or list is empty tListElem *csrLLNext( tDblLinkList *pList, tListElem *pEntry, tANI_BOOLEAN fInterlocked ); tListElem *csrLLPrevious( tDblLinkList *pList, tListElem *pEntry, tANI_BOOLEAN fInterlocked ); tANI_BOOLEAN csrLLFindEntry( tDblLinkList *pList, tListElem *pEntryToFind ); #endif
// 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 CHROME_TEST_CHROMEDRIVER_COMMAND_H_ #define CHROME_TEST_CHROMEDRIVER_COMMAND_H_ #include <string> #include "base/callback_forward.h" #include "base/memory/scoped_ptr.h" namespace base { class DictionaryValue; class Value; } class Status; typedef base::Callback<void( const Status&, scoped_ptr<base::Value>, const std::string&)> CommandCallback; typedef base::Callback<void( const base::DictionaryValue&, const std::string&, const CommandCallback&)> Command; #endif // CHROME_TEST_CHROMEDRIVER_COMMAND_H_