text
stringlengths
4
6.14k
/*************************************************************************** * Copyright (C) 2012 by Tobias Koening <tokoe@kde.org> * * * * 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. * ***************************************************************************/ #ifndef SNAPSHOTTAKER_H #define SNAPSHOTTAKER_H #include <phonon/videoplayer.h> #include <QtCore/QObject> class QImage; class SnapshotTaker : public QObject { Q_OBJECT public: SnapshotTaker( const QString &url, QObject *parent = 0 ); ~SnapshotTaker(); Q_SIGNALS: void finished( const QImage &image ); private Q_SLOTS: void stateChanged(Phonon::State, Phonon::State); private: Phonon::VideoPlayer *m_player; }; #endif
/* * Copyright (c) 2014 Wind River Systems, Inc. * Copyright (c) 2016 Cadence Design Systems, Inc. * SPDX-License-Identifier: Apache-2.0 */ /** * @file * @brief Xtensa public exception handling * * Xtensa-specific kernel exception handling interface. Included by * arch/xtensa/arch.h. */ #ifndef _ARCH_XTENSA_EXC_H_ #define _ARCH_XTENSA_EXC_H_ #ifdef __cplusplus extern "C" { #endif #ifdef _ASMLANGUAGE #else /** * @brief Exception Stack Frame * * A pointer to an "exception stack frame" (ESF) is passed as an argument * to exception handlers registered via nanoCpuExcConnect(). */ struct __esf { /* XXX - not finished yet */ sys_define_gpr_with_alias(a1, sp); u32_t pc; }; typedef struct __esf NANO_ESF; extern const NANO_ESF _default_esf; #endif #ifdef __cplusplus } #endif #endif /* _ARCH_XTENSA_EXC_H_ */
* project 2002. */ /* ==================================================================== * Copyright (c) 2001 The OpenSSL Project. 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
/* Copyright 2020 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_PYTHON_UTIL_PYTHON_API_PARAMETER_CONVERTER_H_ #define TENSORFLOW_PYTHON_UTIL_PYTHON_API_PARAMETER_CONVERTER_H_ #include <Python.h> #include <map> #include <string> #include <vector> #include "absl/types/span.h" #include "tensorflow/core/framework/op_def.pb.h" #include "tensorflow/core/framework/types.pb.h" #include "tensorflow/core/platform/status.h" #include "tensorflow/python/framework/op_def_util.h" #include "tensorflow/python/framework/python_api_info.h" #include "tensorflow/python/framework/python_tensor_converter.h" #include "tensorflow/python/lib/core/safe_pyobject_ptr.h" namespace tensorflow { // Converts the canoncialized parameters to the expected types (in place). // // * Input parameters (i.e., parameters that expect tensor values) are // converted to tensors (or lists of tensors) using // `tensor_converter.Convert`. // * Attribute parameters are converted to the expected type. // * Inferred attributes are written to `inferred_attrs`. (Can be // nullptr if inferred attributes are not needed.) // * If there's a "name" parameter, then its value is not modified. // // Note: for list-of-tensor parameters, the elements of the list will be // converted in-place. Therefore, any list-of-tensor parameters should have // their values copied to new lists before calling this method. (See // `CopyPythonAPITensorLists`.) // // Any values that are removed from `params` have their reference count // decremented, and any objects added to `params` are new references. // // Returns true on success, or sets an exception and returns false on error. ABSL_MUST_USE_RESULT bool ConvertPythonAPIParameters( const PythonAPIInfo& api_info, const PythonTensorConverter& tensor_converter, absl::Span<PyObject*> params, PythonAPIInfo::InferredAttributes* inferred_attrs); // Copies any parameters that expect a list of tensors to a new list. // This ensures that any iterable value can be used, and also ensures that // `ConvertPythonAPIParameters` can safely convert tensors in-place. // // Any values that are removed from `params` have their reference count // decremented, and any objects added to `params` are new references. // // Returns true on success, or sets an exception and returns false on error. ABSL_MUST_USE_RESULT bool CopyPythonAPITensorLists(const PythonAPIInfo& api_info, absl::Span<PyObject*> params); } // namespace tensorflow #endif // TENSORFLOW_PYTHON_UTIL_PYTHON_API_PARAMETER_CONVERTER_H_
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** * Copyright (c) 2000-2007, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description * 01/11/2000 aliu Creation. ********************************************************************** */ #ifndef NULTRANS_H #define NULTRANS_H #include "unicode/utypes.h" #if !UCONFIG_NO_TRANSLITERATION #include "unicode/translit.h" U_NAMESPACE_BEGIN /** * A transliterator that leaves text unchanged. * @author Alan Liu * @internal Use transliterator factory methods instead since this class will be removed in that release. */ class NullTransliterator : public Transliterator { public: /** * Constructs a transliterator. * @internal Use transliterator factory methods instead since this class will be removed in that release. */ NullTransliterator(); /** * Destructor. * @internal Use transliterator factory methods instead since this class will be removed in that release. */ virtual ~NullTransliterator(); /** * Transliterator API. * @internal Use transliterator factory methods instead since this class will be removed in that release. */ virtual NullTransliterator* clone() const; /** * Implements {@link Transliterator#handleTransliterate}. * @internal Use transliterator factory methods instead since this class will be removed in that release. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, UBool isIncremental) const; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ virtual UClassID getDynamicClassID() const; /** * ICU "poor man's RTTI", returns a UClassID for this class. */ U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); }; U_NAMESPACE_END #endif /* #if !UCONFIG_NO_TRANSLITERATION */ #endif
/* Copyright (C) 1993,95,96,97,98,2000,2001,2002,2003,2008 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. As a special exception, if you link the code in this file with files compiled with a GNU compiler to produce an executable, that does not cause the resulting executable to be covered by the GNU Lesser General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Lesser General Public License. This exception applies to code released by its copyright holders in files containing the exception. */ #include "libioP.h" #include "stdio.h" #include <stdlib.h> #include <shlib-compat.h> #include <fd_to_filename.h> FILE* freopen (filename, mode, fp) const char* filename; const char* mode; FILE* fp; { FILE *result; int fd = -1; CHECK_FILE (fp, NULL); if (!(fp->_flags & _IO_IS_FILEBUF)) return NULL; _IO_acquire_lock (fp); if (filename == NULL && _IO_fileno (fp) >= 0) { fd = __dup (_IO_fileno (fp)); if (fd != -1) filename = fd_to_filename (fd); } #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) if (&_IO_stdin_used == NULL) { /* If the shared C library is used by the application binary which was linked against the older version of libio, we just use the older one even for internal use to avoid trouble since a pointer to the old libio may be passed into shared C library and wind up here. */ _IO_old_file_close_it (fp); _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_old_file_jumps; result = _IO_old_file_fopen (fp, filename, mode); } else #endif { INTUSE(_IO_file_close_it) (fp); _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps; if (_IO_vtable_offset (fp) == 0 && fp->_wide_data != NULL) fp->_wide_data->_wide_vtable = &_IO_wfile_jumps; result = INTUSE(_IO_file_fopen) (fp, filename, mode, 1); if (result != NULL) result = __fopen_maybe_mmap (result); } if (result != NULL) /* unbound stream orientation */ result->_mode = 0; if (fd != -1) { __close (fd); free ((char *) filename); } _IO_release_lock (fp); return result; }
// // CommandUse.h // iTerm // // Created by George Nachman on 1/19/14. // // #import <Cocoa/Cocoa.h> #import "iTermCommandHistoryCommandUseMO.h" @class iTermCommandHistoryCommandUseMO; @class VT100ScreenMark; @interface iTermCommandHistoryCommandUseMO (Additions) // Setting this actually sets the markGuid. @property(nonatomic, retain) VT100ScreenMark *mark; + (instancetype)commandHistoryCommandUseInContext:(NSManagedObjectContext *)context; + (NSString *)entityName; + (instancetype)commandHistoryCommandUseFromDeprecatedSerialization:(id)serializedValue inContext:(NSManagedObjectContext *)context; @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 ELEMENTINTEGRALVARIABLEPOSTPROCESSOR_H #define ELEMENTINTEGRALVARIABLEPOSTPROCESSOR_H #include "ElementIntegralPostprocessor.h" #include "MooseVariableInterface.h" //Forward Declarations class ElementIntegralVariablePostprocessor; template<> InputParameters validParams<ElementIntegralVariablePostprocessor>(); /** * This postprocessor computes a volume integral of the specified variable. * * Note that specializations of this integral are possible by deriving from this * class and overriding computeQpIntegral(). */ class ElementIntegralVariablePostprocessor : public ElementIntegralPostprocessor, public MooseVariableInterface { public: ElementIntegralVariablePostprocessor(const std::string & name, InputParameters parameters); protected: virtual Real computeQpIntegral(); MooseVariable & _var; /// Holds the solution at current quadrature points VariableValue & _u; /// Holds the solution gradient at the current quadrature points VariableGradient & _grad_u; /// Holds the solution derivative at the current quadrature points VariableValue & _u_dot; }; #endif
/* * Copyright (c) 2016 Nordic Semiconductor ASA * 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, except as embedded into a Nordic Semiconductor ASA * integrated circuit in a product or a software update for such product, 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 Nordic Semiconductor ASA nor the names of its contributors may be * used to endorse or promote products derived from this software without specific prior * written permission. * * 4. This software, with or without modification, must only be used with a * Nordic Semiconductor ASA integrated circuit. * * 5. Any software provided in binary or object form under this license must not be reverse * engineered, decompiled, modified and/or disassembled. * * 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 HOLDER 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 "nrf.h" #include "cmsis_nvic.h" #include "stdint.h" #include "PinNames.h" #include "hal/gpio_api.h" #if defined(SOFTDEVICE_PRESENT) #include "nrf_sdm.h" #include "nrf_dfu_mbr.h" #endif #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) __attribute__ ((section(".bss.nvictable"),zero_init)) uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS]; #elif defined(__GNUC__) __attribute__ ((section(".nvictable"))) uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS]; #elif defined(__ICCARM__) uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS] @ ".nvictable"; #endif extern uint32_t __Vectors[]; #define VECTORS_FLASH_START __Vectors #define MBR_VTOR_ADDRESS 0x20000000 #define SOFTDEVICE_VTOR_ADDRESS 0x20000004 /** * @brief Function for relocation of the vector to RAM on nRF5x devices. * This function is intended to be called during startup. */ void nrf_reloc_vector_table(void) { // Copy and switch to dynamic vectors uint32_t *old_vectors = VECTORS_FLASH_START; uint32_t i; for (i = 0; i< NVIC_NUM_VECTORS; i++) { nrf_dispatch_vector[i] = old_vectors[i]; } #if defined(SOFTDEVICE_PRESENT) /** * Before setting the new vector table address in the SoftDevice the MBR must be initialized. * If no bootloader is present the MBR will be initialized automatically. * If a bootloader is present nrf_dfu_mbr_init_sd must be called once and only once. * * By resetting the MBR and SoftDevice VTOR address first, it becomes safe to initialize * the MBR again regardless of how the application was started. */ /* Reset MBR VTOR to original state before calling MBR init. */ uint32_t *mbr_vtor_address = (uint32_t *) MBR_VTOR_ADDRESS; *mbr_vtor_address = (uint32_t) VECTORS_FLASH_START; /* Reset SoftDevive VTOR. */ uint32_t *softdevice_vtor_address = (uint32_t *) SOFTDEVICE_VTOR_ADDRESS; *softdevice_vtor_address = 0xFFFFFFFF; /* Set SCB->VTOR to go through MBR to trap SoftDevice service calls. */ SCB->VTOR = 0x0; /* Initialize MBR so SoftDevice service calls are being trapped correctly. * This call sets MBR_VTOR_ADDRESS to point to the SoftDevice's VTOR at address 0x1000. */ nrf_dfu_mbr_init_sd(); /* Instruct the SoftDevice to forward interrupts to the application's vector table in RAM. */ sd_softdevice_vector_table_base_set((uint32_t) nrf_dispatch_vector); #else /* No SoftDevice is present. Set all interrupts to vector table in RAM. */ SCB->VTOR = (uint32_t) nrf_dispatch_vector; #endif } void mbed_sdk_init(void) { if (STDIO_UART_RTS != NC) { gpio_t rts; gpio_init_out(&rts, STDIO_UART_RTS); /* Set STDIO_UART_RTS as gpio driven low */ gpio_write(&rts, 0); } }
/* * PCI Dynamic LPAR, PCI Hot Plug and PCI EEH recovery code * for RPA-compliant PPC64 platform. * Copyright (C) 2003 Linda Xie <lxie@us.ibm.com> * Copyright (C) 2005 International Business Machines * * Updates, 2005, John Rose <johnrose@austin.ibm.com> * Updates, 2005, Linas Vepstas <linas@austin.ibm.com> * * 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, GOOD TITLE or * NON INFRINGEMENT. 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. */ #include <linux/pci.h> #include <asm/pci-bridge.h> #include <asm/ppc-pci.h> #include <asm/firmware.h> static struct pci_bus * find_bus_among_children(struct pci_bus *bus, struct device_node *dn) { struct pci_bus *child = NULL; struct list_head *tmp; struct device_node *busdn; busdn = pci_bus_to_OF_node(bus); if (busdn == dn) return bus; list_for_each(tmp, &bus->children) { child = find_bus_among_children(pci_bus_b(tmp), dn); if (child) break; }; return child; } struct pci_bus * pcibios_find_pci_bus(struct device_node *dn) { struct pci_dn *pdn = dn->data; if (!pdn || !pdn->phb || !pdn->phb->bus) return NULL; return find_bus_among_children(pdn->phb->bus, dn); } EXPORT_SYMBOL_GPL(pcibios_find_pci_bus); /** * pcibios_remove_pci_devices - remove all devices under this bus * * Remove all of the PCI devices under this bus both from the * linux pci device tree, and from the powerpc EEH address cache. */ void pcibios_remove_pci_devices(struct pci_bus *bus) { struct pci_dev *dev, *tmp; list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) { eeh_remove_bus_device(dev); pci_remove_bus_device(dev); } } /* Must be called before pci_bus_add_devices */ void pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus) { struct pci_dev *dev; list_for_each_entry(dev, &bus->devices, bus_list) { /* * Skip already-present devices (which are on the * global device list.) */ if (list_empty(&dev->global_list)) { int i; /* Fill device archdata and setup iommu table */ pcibios_setup_new_device(dev); if(fix_bus) pcibios_fixup_device_resources(dev, bus); pci_read_irq_line(dev); for (i = 0; i < PCI_NUM_RESOURCES; i++) { struct resource *r = &dev->resource[i]; if (r->parent || !r->start || !r->flags) continue; pci_claim_resource(dev, i); } } } eeh_add_device_tree_late(bus); } EXPORT_SYMBOL_GPL(pcibios_fixup_new_pci_devices); static int pcibios_pci_config_bridge(struct pci_dev *dev) { u8 sec_busno; struct pci_bus *child_bus; /* Get busno of downstream bus */ pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno); /* Add to children of PCI bridge dev->bus */ child_bus = pci_add_new_bus(dev->bus, dev, sec_busno); if (!child_bus) { printk (KERN_ERR "%s: could not add second bus\n", __FUNCTION__); return -EIO; } sprintf(child_bus->name, "PCI Bus #%02x", child_bus->number); pci_scan_child_bus(child_bus); /* Fixup new pci devices without touching bus struct */ pcibios_fixup_new_pci_devices(child_bus, 0); /* Make the discovered devices available */ pci_bus_add_devices(child_bus); return 0; } /** * pcibios_add_pci_devices - adds new pci devices to bus * * This routine will find and fixup new pci devices under * the indicated bus. This routine presumes that there * might already be some devices under this bridge, so * it carefully tries to add only new devices. (And that * is how this routine differs from other, similar pcibios * routines.) */ void pcibios_add_pci_devices(struct pci_bus * bus) { int slotno, num, mode; struct pci_dev *dev; struct device_node *dn = pci_bus_to_OF_node(bus); eeh_add_device_tree_early(dn); mode = PCI_PROBE_NORMAL; if (ppc_md.pci_probe_mode) mode = ppc_md.pci_probe_mode(bus); if (mode == PCI_PROBE_DEVTREE) { /* use ofdt-based probe */ of_scan_bus(dn, bus); if (!list_empty(&bus->devices)) { pcibios_fixup_new_pci_devices(bus, 0); pci_bus_add_devices(bus); } } else if (mode == PCI_PROBE_NORMAL) { /* use legacy probe */ slotno = PCI_SLOT(PCI_DN(dn->child)->devfn); num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); if (num) { pcibios_fixup_new_pci_devices(bus, 1); pci_bus_add_devices(bus); } list_for_each_entry(dev, &bus->devices, bus_list) if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) pcibios_pci_config_bridge(dev); } } EXPORT_SYMBOL_GPL(pcibios_add_pci_devices); struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) { struct pci_controller *phb; int primary; primary = list_empty(&hose_list); phb = pcibios_alloc_controller(dn); if (!phb) return NULL; rtas_setup_phb(phb); pci_process_bridge_OF_ranges(phb, dn, 0); pci_setup_phb_io_dynamic(phb, primary); pci_devs_phb_init_dynamic(phb); if (dn->child) eeh_add_device_tree_early(dn); scan_phb(phb); pcibios_fixup_new_pci_devices(phb->bus, 0); pci_bus_add_devices(phb->bus); return phb; } EXPORT_SYMBOL_GPL(init_phb_dynamic);
#ifndef foopulsecardhfoo #define foopulsecardhfoo /*** This file is part of PulseAudio. Copyright 2009 Lennart Poettering PulseAudio 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. PulseAudio 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 Lesser General Public License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. ***/ #include <pulsecore/typedefs.h> #include <pulse/proplist.h> #include <pulsecore/core.h> #include <pulsecore/module.h> #include <pulsecore/idxset.h> /* This enum replaces pa_port_available_t (defined in pulse/def.h) for * internal use, so make sure both enum types stay in sync. */ typedef enum pa_available { PA_AVAILABLE_UNKNOWN = 0, PA_AVAILABLE_NO = 1, PA_AVAILABLE_YES = 2, } pa_available_t; struct pa_card_profile { pa_card *card; char *name; char *description; /* Identifiers for the profile's input and output parts, i e, if two different profiles have the same input_name string, they have the same source(s). Same for output_name and sink(s). Can be NULL (and in case of an input- or output- only profile, the other direction will be NULL). */ char *input_name; char *output_name; unsigned priority; pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */ /* We probably want to have different properties later on here */ unsigned n_sinks; unsigned n_sources; unsigned max_sink_channels; unsigned max_source_channels; /* .. followed by some implementation specific data */ }; #define PA_CARD_PROFILE_DATA(d) ((void*) ((uint8_t*) d + PA_ALIGN(sizeof(pa_card_profile)))) struct pa_card { uint32_t index; pa_core *core; char *name; pa_proplist *proplist; pa_module *module; char *driver; pa_idxset *sinks; pa_idxset *sources; pa_hashmap *profiles; pa_card_profile *active_profile; pa_hashmap *ports; pa_device_port *preferred_input_port; pa_device_port *preferred_output_port; bool save_profile:1; pa_suspend_cause_t suspend_cause; bool linked; void *userdata; int (*set_profile)(pa_card *c, pa_card_profile *profile); }; typedef struct pa_card_new_data { char *name; pa_proplist *proplist; const char *driver; pa_module *module; pa_hashmap *profiles; pa_hashmap *ports; pa_device_port *preferred_input_port; pa_device_port *preferred_output_port; bool namereg_fail:1; } pa_card_new_data; typedef struct { pa_card *card; pa_direction_t direction; } pa_card_preferred_port_changed_hook_data; const char *pa_available_to_string(pa_available_t available); pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra); void pa_card_profile_free(pa_card_profile *c); /* The profile's available status has changed */ void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available); pa_card_new_data *pa_card_new_data_init(pa_card_new_data *data); void pa_card_new_data_set_name(pa_card_new_data *data, const char *name); void pa_card_new_data_set_preferred_port(pa_card_new_data *data, pa_direction_t direction, pa_device_port *port); void pa_card_new_data_done(pa_card_new_data *data); pa_card *pa_card_new(pa_core *c, pa_card_new_data *data); /* Select the initial card profile according to the configured policies. This * must be called between pa_card_new() and pa_card_put(), after the port and * profile availabilities have been initialized. */ void pa_card_choose_initial_profile(pa_card *card); void pa_card_put(pa_card *c); void pa_card_free(pa_card *c); void pa_card_add_profile(pa_card *c, pa_card_profile *profile); int pa_card_set_profile(pa_card *c, pa_card_profile *profile, bool save); void pa_card_set_preferred_port(pa_card *c, pa_direction_t direction, pa_device_port *port); int pa_card_suspend(pa_card *c, bool suspend, pa_suspend_cause_t cause); #endif
/* * * Copyright (c) International Business Machines Corp., 2001 * * 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 */ /* * NAME * shmget05.c * * DESCRIPTION * shmget05 - test for EACCES error * * ALGORITHM * create a shared memory segment with root only read & write permissions * fork a child process * if child * set the ID of the child process to that of "nobody" * loop if that option was specified * call shmget() using the TEST() macro * check the errno value * issue a PASS message if we get EACCES * otherwise, the tests fails * issue a FAIL message * call cleanup * if parent * wait for child to exit * remove the shared memory segment * * USAGE: <for command-line> * shmget05 [-c n] [-e] [-i n] [-I x] [-P x] [-t] * where, -c n : Run n copies concurrently. * -e : Turn on errno logging. * -i n : Execute test n times. * -I x : Execute test for x seconds. * -P x : Pause for x seconds between iterations. * -t : Turn on syscall timing. * * HISTORY * 03/2001 - Written by Wayne Boyer * * RESTRICTIONS * test must be run at root */ #include "ipcshm.h" #include <sys/types.h> #include <sys/wait.h> char *TCID = "shmget05"; int TST_TOTAL = 1; int shm_id_1 = -1; uid_t ltp_uid; char *ltp_user = "nobody"; int main(int ac, char **av) { int pid; void do_child(void); tst_parse_opts(ac, av, NULL, NULL); setup(); /* global setup */ if ((pid = FORK_OR_VFORK()) == -1) { tst_brkm(TBROK, cleanup, "could not fork"); } if (pid == 0) { /* child */ /* set the user ID of the child to the non root user */ if (setuid(ltp_uid) == -1) { tst_resm(TBROK, "setuid() failed"); exit(1); } do_child(); cleanup(); } else { /* parent */ /* wait for the child to return */ if (waitpid(pid, NULL, 0) == -1) { tst_brkm(TBROK, cleanup, "waitpid failed"); } /* if it exists, remove the shared memory resource */ rm_shm(shm_id_1); tst_rmdir(); } tst_exit(); } /* * do_child - make the TEST call as the child process */ void do_child(void) { int lc; /* The following loop checks looping state if -i option given */ for (lc = 0; TEST_LOOPING(lc); lc++) { /* reset tst_count in case we are looping */ tst_count = 0; /* * Look for a failure ... */ TEST(shmget(shmkey, SHM_SIZE, SHM_RW)); if (TEST_RETURN != -1) { tst_resm(TFAIL, "call succeeded when error expected"); continue; } switch (TEST_ERRNO) { case EACCES: tst_resm(TPASS, "expected failure - errno = " "%d : %s", TEST_ERRNO, strerror(TEST_ERRNO)); break; default: tst_resm(TFAIL, "call failed with an " "unexpected error - %d : %s", TEST_ERRNO, strerror(TEST_ERRNO)); break; } } } /* * setup() - performs all the ONE TIME setup for this test. */ void setup(void) { tst_require_root(); tst_sig(FORK, DEF_HANDLER, cleanup); TEST_PAUSE; /* * Create a temporary directory and cd into it. * This helps to ensure that a unique msgkey is created. * See ../lib/libipc.c for more information. */ tst_tmpdir(); /* get an IPC resource key */ shmkey = getipckey(); /* create a shared memory segment with read and write permissions */ if ((shm_id_1 = shmget(shmkey, SHM_SIZE, SHM_RW | IPC_CREAT | IPC_EXCL)) == -1) { tst_brkm(TBROK, cleanup, "Failed to create shared memory " "segment in setup"); } /* get the userid for a non root user */ ltp_uid = getuserid(ltp_user); } /* * cleanup() - performs all the ONE TIME cleanup for this test at completion * or premature exit. */ void cleanup(void) { }
/* Copyright (C) 2002-2016 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, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_EPOLL_H # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead." #endif /* Flags to be passed to epoll_create1. */ enum { EPOLL_CLOEXEC = 02000000 #define EPOLL_CLOEXEC EPOLL_CLOEXEC };
/*************************************************************************/ /*! @File @Title Common bridge header for rgxpdump @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved @Description Declares common defines and structures that are used by both the client and sever side of the bridge for rgxpdump @License Dual MIT/GPLv2 The contents of this file are subject to the MIT license as set out below. 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, sublicense, 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 shall be included in all copies or substantial portions of the Software. Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 ("GPL") in which case the provisions of GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of GPL, and not to allow others to use your version of this file under the terms of the MIT license, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by GPL as set out in the file called "GPL-COPYING" included in this distribution. If you do not delete the provisions above, a recipient may use your version of this file under the terms of either the MIT license or GPL. This License is also included in this distribution in the file called "MIT-COPYING". EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) 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; AND (B) 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 COMMON_RGXPDUMP_BRIDGE_H #define COMMON_RGXPDUMP_BRIDGE_H #include "img_types.h" #include "pvrsrv_error.h" #include "rgx_bridge.h" #define PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST 0 #define PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+0 #define PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+1 #define PVRSRV_BRIDGE_RGXPDUMP_CMD_LAST (PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+1) /******************************************* PDumpTraceBuffer *******************************************/ /* Bridge in structure for PDumpTraceBuffer */ typedef struct PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER_TAG { IMG_HANDLE hDeviceNode; IMG_UINT32 ui32PDumpFlags; } __attribute__((packed)) PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER; /* Bridge out structure for PDumpTraceBuffer */ typedef struct PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER_TAG { PVRSRV_ERROR eError; } __attribute__((packed)) PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER; /******************************************* PDumpSignatureBuffer *******************************************/ /* Bridge in structure for PDumpSignatureBuffer */ typedef struct PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER_TAG { IMG_HANDLE hDeviceNode; IMG_UINT32 ui32PDumpFlags; } __attribute__((packed)) PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER; /* Bridge out structure for PDumpSignatureBuffer */ typedef struct PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER_TAG { PVRSRV_ERROR eError; } __attribute__((packed)) PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER; #endif /* COMMON_RGXPDUMP_BRIDGE_H */
#include <string.h> #include <sys/stat.h> #include <unistd.h> char * basename (name) char *name; { char *base; base = rindex (name, '/'); return base ? base + 1 : name; } int main (argc,argv) int argc; char **argv; { int i/*, recurse = 0, interact =0*/; struct stat sbuf; int fd,er; /* if (((argv[1][0] == '-') && (argv[1][1] == 'r')) || ((argv[2][0] == '-') && (argv[2][1] == 'r'))) recurse = 1; if (((argv[1][0] == '-') && (argv[1][1] == 'i')) || ((argv[2][0] == '-') && (argv[2][1] == 'i'))) interact = 1; */ for(i=/*recurse+interact+*/1;i<argc;i++) { if (argv[i][0] != '-') { if (!lstat(argv[i],&sbuf)) { if (unlink(argv[i])) { write(STDERR_FILENO,"rm: could not remove ",21); write(STDERR_FILENO,argv[i],strlen(argv[i])); write(STDERR_FILENO,"\n",1); } } } } }
/* -*- c-basic-offset:4; indent-tabs-mode: nil -*- */ /* ==================================================================== * Copyright (c) 1999-2004 Carnegie Mellon University. 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 CARNEGIE MELLON UNIVERSITY ``AS IS'' AND * ANY EXPRESSED 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 CARNEGIE MELLON UNIVERSITY * NOR ITS EMPLOYEES 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. * * ==================================================================== * */ /* * fsg_search_internal.h -- Search structures for FSG decoding. */ #ifndef __S2_FSG_SEARCH_H__ #define __S2_FSG_SEARCH_H__ /* SphinxBase headers. */ #include <sphinxbase/glist.h> #include <sphinxbase/cmd_ln.h> #include <sphinxbase/fsg_model.h> /* Local headers. */ #include "pocketsphinx_internal.h" #include "hmm.h" #include "fsg_history.h" #include "fsg_lextree.h" /** * Segmentation "iterator" for FSG history. */ typedef struct fsg_seg_s { ps_seg_t base; /**< Base structure. */ fsg_hist_entry_t **hist; /**< Sequence of history entries. */ int16 n_hist; /**< Number of history entries. */ int16 cur; /**< Current position in hist. */ } fsg_seg_t; /** * Implementation of FSG search (and "FSG set") structure. */ typedef struct fsg_search_s { ps_search_t base; hmm_context_t *hmmctx; /**< HMM context. */ fsg_model_t *fsg; /**< FSG model */ struct fsg_lextree_s *lextree;/**< Lextree structure for the currently active FSG */ struct fsg_history_s *history;/**< For storing the Viterbi search history */ glist_t pnode_active; /**< Those active in this frame */ glist_t pnode_active_next; /**< Those activated for the next frame */ int32 beam_orig; /**< Global pruning threshold */ int32 pbeam_orig; /**< Pruning threshold for phone transition */ int32 wbeam_orig; /**< Pruning threshold for word exit */ float32 beam_factor; /**< Dynamic/adaptive factor (<=1) applied to above beams to determine actual effective beams. For implementing absolute pruning. */ int32 beam, pbeam, wbeam; /**< Effective beams after applying beam_factor */ int32 lw, pip, wip; /**< Language weights */ frame_idx_t frame; /**< Current frame. */ uint8 final; /**< Decoding is finished for this utterance. */ uint8 bestpath; /**< Whether to run bestpath search and confidence annotation at end. */ float32 ascale; /**< Acoustic score scale for posterior probabilities. */ int32 bestscore; /**< For beam pruning */ int32 bpidx_start; /**< First history entry index this frame */ int32 ascr, lscr; /**< Total acoustic and lm score for utt */ int32 n_hmm_eval; /**< Total HMMs evaluated this utt */ int32 n_sen_eval; /**< Total senones evaluated this utt */ } fsg_search_t; /* Access macros */ #define fsg_search_frame(s) ((s)->frame) /** * Create, initialize and return a search module. */ ps_search_t *fsg_search_init(const char *name, fsg_model_t *fsg, cmd_ln_t *config, acmod_t *acmod, dict_t *dict, dict2pid_t *d2p); /** * Deallocate search structure. */ void fsg_search_free(ps_search_t *search); /** * Update FSG search module for new or updated FSGs. */ int fsg_search_reinit(ps_search_t *fsgs, dict_t *dict, dict2pid_t *d2p); /** * Prepare the FSG search structure for beginning decoding of the next * utterance. */ int fsg_search_start(ps_search_t *search); /** * Step one frame forward through the Viterbi search. */ int fsg_search_step(ps_search_t *search, int frame_idx); /** * Windup and clean the FSG search structure after utterance. */ int fsg_search_finish(ps_search_t *search); /** * Get hypothesis string from the FSG search. */ char const *fsg_search_hyp(ps_search_t *search, int32 *out_score, int32 *out_is_final); #endif
// Copyright 2011 Software Freedom Conservancy // 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 WEBDRIVER_IE_FINDELEMENTSCOMMANDHANDLER_H_ #define WEBDRIVER_IE_FINDELEMENTSCOMMANDHANDLER_H_ #include <ctime> #include "../Browser.h" #include "../IECommandHandler.h" #include "../IECommandExecutor.h" namespace webdriver { class FindElementsCommandHandler : public IECommandHandler { public: FindElementsCommandHandler(void) { } virtual ~FindElementsCommandHandler(void) { } protected: void ExecuteInternal(const IECommandExecutor& executor, const ParametersMap& command_parameters, Response* response) { ParametersMap::const_iterator using_parameter_iterator = command_parameters.find("using"); ParametersMap::const_iterator value_parameter_iterator = command_parameters.find("value"); if (using_parameter_iterator == command_parameters.end()) { response->SetErrorResponse(400, "Missing parameter: using"); return; } else if (value_parameter_iterator == command_parameters.end()) { response->SetErrorResponse(400, "Missing parameter: value"); return; } else { std::string mechanism = using_parameter_iterator->second.asString(); std::string value = value_parameter_iterator->second.asString(); int timeout = executor.implicit_wait_timeout(); clock_t end = clock() + (timeout / 1000 * CLOCKS_PER_SEC); if (timeout > 0 && timeout < 1000) { end += 1 * CLOCKS_PER_SEC; } int status_code = WD_SUCCESS; Json::Value found_elements(Json::arrayValue); do { status_code = executor.LocateElements(ElementHandle(), mechanism, value, &found_elements); if (status_code == WD_SUCCESS && found_elements.size() > 0) { response->SetSuccessResponse(found_elements); return; } if(status_code == EINVALIDSELECTOR) { response->SetErrorResponse(status_code, "The xpath expression '" + value + "' cannot be evaluated or does not" + "result in a WebElement"); return; } if (status_code == EUNHANDLEDERROR) { response->SetErrorResponse(status_code, "Unknown finder mechanism: " + mechanism); return; } if (status_code == ENOSUCHWINDOW) { response->SetErrorResponse(status_code, "Unable to find elements on closed window"); return; } // Release the thread so that the browser doesn't starve. ::Sleep(FIND_ELEMENT_WAIT_TIME_IN_MILLISECONDS); } while (clock() < end); // This code is executed when no elements where found and no errors occurred. if (status_code == WD_SUCCESS) { response->SetSuccessResponse(found_elements); } else { response->SetErrorResponse(status_code, "Finding elements with " + mechanism + " == " + value + "returned an unexpected error"); } } } }; } // namespace webdriver #endif // WEBDRIVER_IE_FINDELEMENTSCOMMANDHANDLER_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROMEOS_DBUS_MOCK_SESSION_MANAGER_CLIENT_H_ #define CHROMEOS_DBUS_MOCK_SESSION_MANAGER_CLIENT_H_ #include <string> #include "chromeos/dbus/session_manager_client.h" #include "testing/gmock/include/gmock/gmock.h" namespace chromeos { class MockSessionManagerClient : public SessionManagerClient { public: MockSessionManagerClient(); virtual ~MockSessionManagerClient(); MOCK_METHOD1(Init, void(dbus::Bus* bus)); MOCK_METHOD1(SetStubDelegate, void(StubDelegate* delegate)); MOCK_METHOD1(AddObserver, void(Observer*)); MOCK_METHOD1(RemoveObserver, void(Observer*)); MOCK_CONST_METHOD1(HasObserver, bool(const Observer*)); MOCK_CONST_METHOD0(IsScreenLocked, bool(void)); MOCK_METHOD0(EmitLoginPromptVisible, void(void)); MOCK_METHOD2(RestartJob, void(int, const std::string&)); MOCK_METHOD1(StartSession, void(const std::string&)); MOCK_METHOD0(StopSession, void(void)); MOCK_METHOD0(NotifySupervisedUserCreationStarted, void(void)); MOCK_METHOD0(NotifySupervisedUserCreationFinished, void(void)); MOCK_METHOD0(StartDeviceWipe, void(void)); MOCK_METHOD0(RequestLockScreen, void(void)); MOCK_METHOD0(NotifyLockScreenShown, void(void)); MOCK_METHOD0(NotifyLockScreenDismissed, void(void)); MOCK_METHOD1(RetrieveActiveSessions, void(const ActiveSessionsCallback&)); MOCK_METHOD1(RetrieveDevicePolicy, void(const RetrievePolicyCallback&)); MOCK_METHOD2(RetrievePolicyForUser, void(const std::string&, const RetrievePolicyCallback&)); MOCK_METHOD1(BlockingRetrievePolicyForUser, std::string(const std::string&)); MOCK_METHOD2(RetrieveDeviceLocalAccountPolicy, void(const std::string&, const RetrievePolicyCallback&)); MOCK_METHOD2(StoreDevicePolicy, void(const std::string&, const StorePolicyCallback&)); MOCK_METHOD3(StorePolicyForUser, void(const std::string&, const std::string&, const StorePolicyCallback&)); MOCK_METHOD3(StoreDeviceLocalAccountPolicy, void(const std::string&, const std::string&, const StorePolicyCallback&)); MOCK_METHOD2(SetFlagsForUser, void(const std::string&, const std::vector<std::string>&)); MOCK_METHOD1(GetServerBackedStateKeys, void(const StateKeysCallback&)); }; } // namespace chromeos #endif // CHROMEOS_DBUS_MOCK_SESSION_MANAGER_CLIENT_H_
#ifndef LANG_H #define LANG_H PONY_EXTERN_C_BEGIN void pony_throw(); PONY_EXTERN_C_END #endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- * * Created: H5B2public.h * Jan 31 2005 * Quincey Koziol <koziol@ncsa.uiuc.edu> * * Purpose: Public declarations for the v2 B-tree package. * *------------------------------------------------------------------------- */ #ifndef _H5B2public_H #define _H5B2public_H /* Public headers needed by this file */ #include "H5public.h" /*****************/ /* Public Macros */ /*****************/ /*******************/ /* Public Typedefs */ /*******************/ /**********************************/ /* Public API Function Prototypes */ /**********************************/ #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif #endif /* _H5B2public_H */
/*++ Copyright (c) 2012 Microsoft Corporation Module Name: reduce_args_tactic.h Abstract: Reduce the number of arguments in function applications. Author: Leonardo (leonardo) 2012-02-19 Notes: --*/ #ifndef _REDUCE_ARGS_TACTIC_H_ #define _REDUCE_ARGS_TACTIC_H_ #include"params.h" class ast_manager; class tactic; tactic * mk_reduce_args_tactic(ast_manager & m, params_ref const & p = params_ref()); /* ADD_TACTIC("reduce-args", "reduce the number of arguments of function applications, when for all occurrences of a function f the i-th is a value.", "mk_reduce_args_tactic(m, p)") */ #endif
/* Variable initialization. AArch64 version. Copyright (C) 2001-2014 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, see <http://www.gnu.org/licenses/>. */ #include <ldsodefs.h> #ifdef SHARED void _dl_var_init (void *array[]) { /* It has to match "variables" below. */ enum { DL_PAGESIZE = 0 }; GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]); } #else static void *variables[] = { &GLRO(dl_pagesize) }; static void _dl_unprotect_relro (struct link_map *l) { ElfW(Addr) start = ((l->l_addr + l->l_relro_addr) & ~(GLRO(dl_pagesize) - 1)); ElfW(Addr) end = ((l->l_addr + l->l_relro_addr + l->l_relro_size) & ~(GLRO(dl_pagesize) - 1)); if (start != end) __mprotect ((void *) start, end - start, PROT_READ | PROT_WRITE); } void _dl_static_init (struct link_map *l) { struct link_map *rtld_map = l; struct r_scope_elem **scope; const ElfW(Sym) *ref = NULL; lookup_t loadbase; void (*f) (void *[]); size_t i; loadbase = _dl_lookup_symbol_x ("_dl_var_init", l, &ref, l->l_local_scope, NULL, 0, 1, NULL); for (scope = l->l_local_scope; *scope != NULL; scope++) for (i = 0; i < (*scope)->r_nlist; i++) if ((*scope)->r_list[i] == loadbase) { rtld_map = (*scope)->r_list[i]; break; } if (ref != NULL) { f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref); _dl_unprotect_relro (rtld_map); f (variables); _dl_protect_relro (rtld_map); } } #endif
sound_type snd_make_clarinet_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr); sound_type snd_clarinet_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr); /* LISP: (snd-clarinet_freq ANYNUM SOUND SOUND ANYNUM) */ #define CLAR_CONTROL_CHANGE_CONST 128
/* MI Option Parser. Copyright (C) 2000-2013 Free Software Foundation, Inc. Contributed by Cygnus Solutions (a Red Hat company). This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MI_GETOPT_H #define MI_GETOPT_H /* The option list. Terminated by NAME==NULL. ARG_P that the option requires an argument. INDEX is returned to identify the option. */ struct mi_opt { const char *name; int index; int arg_p; }; /* Like getopt() but with simpler semantics. An option has the form ``-<name>''. The special option ``--'' denotes the end of the option list. An option can be followed by a separate argument (on a per option basis). On entry OPTIND contains the index of the next element of ARGV that needs parsing. OPTIND is updated to indicate the index of the next argument before mi_getopt() returns. If ARGV[OPTIND] is an option, that options INDEX is returned. OPTARG is set to the options argument or NULL. OPTIND is updated. If ARGV[OPTIND] is not an option, -1 is returned and OPTIND updated to specify the non-option argument. OPTARG is set to NULL. If an unknown option is encountered, mi_getopt() calls ``error("%s: Unknown option %c", prefix, option)'' while mi_getopt_allow_unknown returns -1. */ extern int mi_getopt (const char *prefix, int argc, char **argv, const struct mi_opt *opt, int *optind, char **optarg); extern int mi_getopt_allow_unknown (const char *prefix, int argc, char **argv, const struct mi_opt *opts, int *oind, char **oarg); /* mi_valid_noargs determines if ARGC/ARGV are a valid set of parameters to satisfy an MI function that is not supposed to recieve any arguments. An MI function that should not receive arguments can still be passed parameters after the special option '--' such as below. Example: The MI function -exec-run takes no args. However, the client may pass '-exec-run -- -a ...' See PR-783 PREFIX is passed to mi_getopt for an error message. This function Returns 1 if the parameter pair ARGC/ARGV are valid for an MI function that takes no arguments. Otherwise, it returns 0 and the appropriate error message is displayed by mi_getopt. */ extern int mi_valid_noargs (const char *prefix, int argc, char **argv); #endif
/* * Copyright (C) 2016-2018 Team Kodi * This file is part of Kodi - https://kodi.tv * * SPDX-License-Identifier: GPL-2.0-or-later * See LICENSES/README.md for more information. */ #pragma once #include "ContextMenuItem.h" namespace CONTEXTMENU { struct CEjectDisk : CStaticContextMenuAction { CEjectDisk() : CStaticContextMenuAction(13391) {} // Eject/Load CD/DVD! bool IsVisible(const CFileItem& item) const override; bool Execute(const CFileItemPtr& item) const override; }; struct CEjectDrive : CStaticContextMenuAction { CEjectDrive() : CStaticContextMenuAction(13420) {} // Eject Removable HDD! bool IsVisible(const CFileItem& item) const override; bool Execute(const CFileItemPtr& item) const override; }; }
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once #include <netinet/in.h> #include <linux/if_bridge.h> #include "conf-parser.h" typedef enum BridgeState { NETDEV_BRIDGE_STATE_DISABLED = BR_STATE_DISABLED, NETDEV_BRIDGE_STATE_LISTENING = BR_STATE_LISTENING, NETDEV_BRIDGE_STATE_LEARNING = BR_STATE_LEARNING, NETDEV_BRIDGE_STATE_FORWARDING = BR_STATE_FORWARDING, NETDEV_BRIDGE_STATE_BLOCKING = BR_STATE_BLOCKING, _NETDEV_BRIDGE_STATE_MAX, _NETDEV_BRIDGE_STATE_INVALID = -EINVAL, } BridgeState; const char *bridge_state_to_string(BridgeState d) _const_; BridgeState bridge_state_from_string(const char *d) _pure_;
// Copyright 2014 the V8 project 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 V8_STRING_STREAM_H_ #define V8_STRING_STREAM_H_ #include "src/allocation.h" #include "src/base/smart-pointers.h" #include "src/handles.h" #include "src/vector.h" namespace v8 { namespace internal { // Forward declarations. class ByteArray; class StringAllocator { public: virtual ~StringAllocator() { } // Allocate a number of bytes. virtual char* allocate(unsigned bytes) = 0; // Allocate a larger number of bytes and copy the old buffer to the new one. // bytes is an input and output parameter passing the old size of the buffer // and returning the new size. If allocation fails then we return the old // buffer and do not increase the size. virtual char* grow(unsigned* bytes) = 0; }; // Normal allocator uses new[] and delete[]. class HeapStringAllocator final : public StringAllocator { public: ~HeapStringAllocator() { DeleteArray(space_); } char* allocate(unsigned bytes) override; char* grow(unsigned* bytes) override; private: char* space_; }; class FixedStringAllocator final : public StringAllocator { public: FixedStringAllocator(char* buffer, unsigned length) : buffer_(buffer), length_(length) {} ~FixedStringAllocator() override{}; char* allocate(unsigned bytes) override; char* grow(unsigned* bytes) override; private: char* buffer_; unsigned length_; DISALLOW_COPY_AND_ASSIGN(FixedStringAllocator); }; class FmtElm final { public: FmtElm(int value) : type_(INT) { // NOLINT data_.u_int_ = value; } explicit FmtElm(double value) : type_(DOUBLE) { data_.u_double_ = value; } FmtElm(const char* value) : type_(C_STR) { // NOLINT data_.u_c_str_ = value; } FmtElm(const Vector<const uc16>& value) : type_(LC_STR) { // NOLINT data_.u_lc_str_ = &value; } FmtElm(Object* value) : type_(OBJ) { // NOLINT data_.u_obj_ = value; } FmtElm(Handle<Object> value) : type_(HANDLE) { // NOLINT data_.u_handle_ = value.location(); } FmtElm(void* value) : type_(POINTER) { // NOLINT data_.u_pointer_ = value; } private: friend class StringStream; enum Type { INT, DOUBLE, C_STR, LC_STR, OBJ, HANDLE, POINTER }; Type type_; union { int u_int_; double u_double_; const char* u_c_str_; const Vector<const uc16>* u_lc_str_; Object* u_obj_; Object** u_handle_; void* u_pointer_; } data_; }; class StringStream final { public: enum ObjectPrintMode { kPrintObjectConcise, kPrintObjectVerbose }; StringStream(StringAllocator* allocator, ObjectPrintMode object_print_mode = kPrintObjectVerbose) : allocator_(allocator), object_print_mode_(object_print_mode), capacity_(kInitialCapacity), length_(0), buffer_(allocator_->allocate(kInitialCapacity)) { buffer_[0] = 0; } bool Put(char c); bool Put(String* str); bool Put(String* str, int start, int end); void Add(Vector<const char> format, Vector<FmtElm> elms); void Add(const char* format); void Add(Vector<const char> format); void Add(const char* format, FmtElm arg0); void Add(const char* format, FmtElm arg0, FmtElm arg1); void Add(const char* format, FmtElm arg0, FmtElm arg1, FmtElm arg2); void Add(const char* format, FmtElm arg0, FmtElm arg1, FmtElm arg2, FmtElm arg3); void Add(const char* format, FmtElm arg0, FmtElm arg1, FmtElm arg2, FmtElm arg3, FmtElm arg4); // Getting the message out. void OutputToFile(FILE* out); void OutputToStdOut() { OutputToFile(stdout); } void Log(Isolate* isolate); Handle<String> ToString(Isolate* isolate); base::SmartArrayPointer<const char> ToCString() const; int length() const { return length_; } // Object printing support. void PrintName(Object* o); void PrintFixedArray(FixedArray* array, unsigned int limit); void PrintByteArray(ByteArray* ba); void PrintUsingMap(JSObject* js_object); void PrintPrototype(JSFunction* fun, Object* receiver); void PrintSecurityTokenIfChanged(Object* function); // NOTE: Returns the code in the output parameter. void PrintFunction(Object* function, Object* receiver, Code** code); // Reset the stream. void Reset() { length_ = 0; buffer_[0] = 0; } // Mentioned object cache support. void PrintMentionedObjectCache(Isolate* isolate); static void ClearMentionedObjectCache(Isolate* isolate); #ifdef DEBUG bool IsMentionedObjectCacheClear(Isolate* isolate); #endif static const int kInitialCapacity = 16; private: void PrintObject(Object* obj); StringAllocator* allocator_; ObjectPrintMode object_print_mode_; unsigned capacity_; unsigned length_; // does not include terminating 0-character char* buffer_; bool full() const { return (capacity_ - length_) == 1; } int space() const { return capacity_ - length_; } DISALLOW_IMPLICIT_CONSTRUCTORS(StringStream); }; } // namespace internal } // namespace v8 #endif // V8_STRING_STREAM_H_
/** ****************************************************************************** * @file stm32l1xx_ll_crc.c * @author MCD Application Team * @brief CRC LL module driver. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ #if defined(USE_FULL_LL_DRIVER) /* Includes ------------------------------------------------------------------*/ #include "stm32l1xx_ll_crc.h" #include "stm32l1xx_ll_bus.h" #ifdef USE_FULL_ASSERT #include "stm32_assert.h" #else #define assert_param(expr) ((void)0U) #endif /** @addtogroup STM32L1xx_LL_Driver * @{ */ #if defined (CRC) /** @addtogroup CRC_LL * @{ */ /* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/ /* Private macros ------------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /** @addtogroup CRC_LL_Exported_Functions * @{ */ /** @addtogroup CRC_LL_EF_Init * @{ */ /** * @brief De-initialize CRC registers (Registers restored to their default values). * @param CRCx CRC Instance * @retval An ErrorStatus enumeration value: * - SUCCESS: CRC registers are de-initialized * - ERROR: CRC registers are not de-initialized */ ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx) { ErrorStatus status = SUCCESS; /* Check the parameters */ assert_param(IS_CRC_ALL_INSTANCE(CRCx)); if (CRCx == CRC) { /* Force CRC reset */ LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC); /* Release CRC reset */ LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC); } else { status = ERROR; } return (status); } /** * @} */ /** * @} */ /** * @} */ #endif /* defined (CRC) */ /** * @} */ #endif /* USE_FULL_LL_DRIVER */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* mbed Microcontroller Library ******************************************************************************* * Copyright (c) 2015, STMicroelectronics * 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 STMicroelectronics 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 HOLDER 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 MBED_OBJECTS_H #define MBED_OBJECTS_H #include "cmsis.h" #include "PortNames.h" #include "PeripheralNames.h" #include "PinNames.h" #ifdef __cplusplus extern "C" { #endif struct gpio_irq_s { IRQn_Type irq_n; uint32_t irq_index; uint32_t event; PinName pin; }; struct port_s { PortName port; uint32_t mask; PinDirection direction; __IO uint32_t *reg_in; __IO uint32_t *reg_out; }; struct analogin_s { ADCName adc; PinName pin; uint8_t channel; }; struct trng_s { RNG_HandleTypeDef handle; }; #include "common_objects.h" struct can_s { CANName can; int index; }; #ifdef __cplusplus } #endif #endif
/* ======================================================================== * Copyright 1988-2006 University of Washington * * 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 * * * ======================================================================== */ /* * Program: Winsock TCP/IP routines * * Author: Mike Seibel from Unix version by Mark Crispin * Computing & Communications * University of Washington * Administration Building, AG-44 * Seattle, WA 98195 * Internet: MRC@CAC.Washington.EDU * * Date: 11 April 1989 * Last Edited: 30 August 2006 */ /* TCP input buffer -- must be large enough to prevent overflow */ #define BUFLEN 8192 /* TCP I/O stream (must be before osdep.h is included) */ #define TCPSTREAM struct tcp_stream TCPSTREAM { char *host; /* host name */ char *remotehost; /* remote host name */ unsigned long port; /* port number */ char *localhost; /* local host name */ int tcpsi; /* input tcp socket */ int tcpso; /* output tcp socket */ long ictr; /* input counter */ char *iptr; /* input pointer */ char ibuf[BUFLEN]; /* input buffer */ };
/*====================================================================================================*/ /*====================================================================================================*/ #include "drivers\stm32f4_system.h" #include "algorithm_string.h" /*====================================================================================================*/ /*====================================================================================================* **函數 : num2Char **功能 : Number to string **輸入 : type, lens, *pChar, number **輸出 : None **使用 : num2Str(type, lens, pChar, number); **====================================================================================================*/ /*====================================================================================================*/ void num2Str( StringType type, uint8_t lens, char *pStr, int32_t number ) { uint8_t i = 0; uint32_t tmpStr[48] = {0}; uint32_t tmpNum = 1; switch(type) { case Type_B: case Type_O: case Type_D: case Type_H: for(i = 0; i < lens; i++) { tmpStr[i] = ((uint32_t)number) / tmpNum; tmpNum = tmpNum * type; } for(i = 0; i < lens; i++) { pStr[lens-i-1] = tmpStr[i] - tmpStr[i+1] * type; if(pStr[lens-i-1] > 9) pStr[lens-i-1] += 55; // 65-10 else pStr[lens-i-1] += 48; } pStr[lens] = '\0'; break; case Type_I: if(number < 0) { pStr[0] = '-'; number = (~number) + 1; } else { pStr[0] = '+'; } for(i = 1; i < lens + 1; i++) { tmpStr[i-1] = ((uint32_t)number) / tmpNum; tmpNum = tmpNum * 10; } for(i = 1; i < lens + 1; i++) { pStr[lens-i+1] = tmpStr[i-1] - tmpStr[i] * 10; pStr[lens-i+1] += 48; } pStr[lens+1] = '\0'; break; case Type_F: break; } } /*====================================================================================================*/ /*====================================================================================================* **函數 : lenOfStr **功能 : String Lens **輸入 : *pStr **輸出 : strLens **使用 : strLens = lenOfStr("Hello World!!"); **====================================================================================================*/ /*====================================================================================================*/ uint16_t lenOfStr( char *pStr ) { uint16_t strLens = 0; if(pStr == NULL) return strLens; while(*(pStr++)) strLens++; return strLens; } /*====================================================================================================*/ /*====================================================================================================*/
30 mtime=1388168384.151545268 29 atime=1394128265.85225654 30 ctime=1388168384.151545268
// SPDX-License-Identifier: GPL-2.0-or-later /* * SoC audio for EDB93xx * * Copyright (c) 2010 Alexander Sverdlin <subaparts@yandex.ru> * * This driver support CS4271 codec being master or slave, working * in control port mode, connected either via SPI or I2C. * The data format accepted is I2S or left-justified. * DAPM support not implemented. */ #include <linux/platform_device.h> #include <linux/gpio.h> #include <linux/module.h> #include <linux/soc/cirrus/ep93xx.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/soc.h> #include <asm/mach-types.h> static int edb93xx_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int err; unsigned int mclk_rate; unsigned int rate = params_rate(params); /* * According to CS4271 datasheet we use MCLK/LRCK=256 for * rates below 50kHz and 128 for higher sample rates */ if (rate < 50000) mclk_rate = rate * 64 * 4; else mclk_rate = rate * 64 * 2; err = snd_soc_dai_set_sysclk(codec_dai, 0, mclk_rate, SND_SOC_CLOCK_IN); if (err) return err; return snd_soc_dai_set_sysclk(cpu_dai, 0, mclk_rate, SND_SOC_CLOCK_OUT); } static const struct snd_soc_ops edb93xx_ops = { .hw_params = edb93xx_hw_params, }; static struct snd_soc_dai_link edb93xx_dai = { .name = "CS4271", .stream_name = "CS4271 HiFi", .platform_name = "ep93xx-i2s", .cpu_dai_name = "ep93xx-i2s", .codec_name = "spi0.0", .codec_dai_name = "cs4271-hifi", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, .ops = &edb93xx_ops, }; static struct snd_soc_card snd_soc_edb93xx = { .name = "EDB93XX", .owner = THIS_MODULE, .dai_link = &edb93xx_dai, .num_links = 1, }; static int edb93xx_probe(struct platform_device *pdev) { struct snd_soc_card *card = &snd_soc_edb93xx; int ret; ret = ep93xx_i2s_acquire(); if (ret) return ret; card->dev = &pdev->dev; ret = snd_soc_register_card(card); if (ret) { dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret); ep93xx_i2s_release(); } return ret; } static int edb93xx_remove(struct platform_device *pdev) { struct snd_soc_card *card = platform_get_drvdata(pdev); snd_soc_unregister_card(card); ep93xx_i2s_release(); return 0; } static struct platform_driver edb93xx_driver = { .driver = { .name = "edb93xx-audio", }, .probe = edb93xx_probe, .remove = edb93xx_remove, }; module_platform_driver(edb93xx_driver); MODULE_AUTHOR("Alexander Sverdlin <subaparts@yandex.ru>"); MODULE_DESCRIPTION("ALSA SoC EDB93xx"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:edb93xx-audio");
/*************************************************************************** qgspagesizeregistry.h -------------------- begin : June 2017 copyright : (C) 2017 by Nyall Dawson email : nyall dot dawson at gmail dot 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. * * * ***************************************************************************/ #ifndef QGSPAGESIZEREGISTRY_H #define QGSPAGESIZEREGISTRY_H #include "qgslayoutsize.h" #include <QString> #include <QSizeF> #include <QList> /** * \ingroup core * \class QgsPageSize * \brief A named page size for layouts. * \since QGIS 3.0 */ class CORE_EXPORT QgsPageSize { public: QgsPageSize(); /** * Constructor for QgsPageSize, accepting the \a name of the page size and * page \a size. */ QgsPageSize( const QString &name, const QgsLayoutSize &size, const QString &displayName = QString() ); /** * Constructor for QgsPageSize, accepting a page \a size. */ QgsPageSize( const QgsLayoutSize &size ); //! Name of page size QString name; //! Page size QgsLayoutSize size; //! Translated page name QString displayName; bool operator==( const QgsPageSize &other ) const; bool operator!=( const QgsPageSize &other ) const; }; /** * \ingroup core * \class QgsPageSizeRegistry * \brief A registry for known page sizes. * * QgsPageSizeRegistry is not usually directly created, but rather accessed through * QgsApplication::pageSizeRegistry(). * * \since QGIS 3.0 */ class CORE_EXPORT QgsPageSizeRegistry { public: /** * Creates a registry and populates it with known sizes */ QgsPageSizeRegistry(); /** * Adds a page \a size to the registry. */ void add( const QgsPageSize &size ); /** * Returns a list of page sizes in the registry. */ QList< QgsPageSize > entries() const; /** * Finds matching page sizes from the registry, using a case insensitive match * on the page size \a name. */ QList< QgsPageSize > find( const QString &name ) const; /** * Finds a matching page \a size from the registry. Returns the page size name, * or an empty string if no matching size could be found. * * Orientation is ignored when matching page sizes, so a landscape A4 page will * match to the portrait A4 size in the registry. */ QString find( const QgsLayoutSize &size ) const; /** * Decodes a \a string representing a preset page size. * The decoded page size will be stored in the \a size argument. * \returns true if string was successfully decoded */ bool decodePageSize( const QString &string, QgsPageSize &size ); private: QList< QgsPageSize > mPageSizes; }; #endif //QGSPAGESIZEREGISTRY_H
/* * io-unlink.c -- * * Copyright (c) 2006 CodeSourcery Inc * Copyright (c) 2018 Mentor Graphics * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ #include <stdio.h> #include <string.h> #include <errno.h> #define IO unlink #include "io.h" /* * unlink -- unlink (delete) a file * input parameters: * 0 : filename ptr * 1 : filename length * output parameters: * 0 : result * 1 : errno */ int unlink (const char *path) { #if HOSTED gdb_parambuf_t parameters; parameters[0] = (uint32_t) path; parameters[1] = (uint32_t) strlen (path) + 1; __io_hosted (HOSTED_UNLINK, parameters); errno = __hosted_from_gdb_errno (parameters[1]); return parameters[0]; #else errno = ENOSYS; return -1; #endif }
/****************************************************************/ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* All contents are licensed under LGPL V2.1 */ /* See LICENSE for full restrictions */ /****************************************************************/ #ifndef RICHARDSSEFFRSC_H #define RICHARDSSEFFRSC_H #include "GeneralUserObject.h" /** * Rogers-Stallybrass-Clements version of effective saturation as a function of CAPILLARY pressure. * valid for residual saturations = 0, and viscosityOil = 2*viscosityWater. (the "2" is important here!). * C Rogers, MP Stallybrass and DL Clements "On two phase filtration under gravity and with boundary infiltration: application of a Backlund transformation" Nonlinear Analysis Theory Methods and Applications 7 (1983) 785--799. */ class RichardsSeffRSC { public: RichardsSeffRSC(); /** * effective saturation as a function of capillary pressure * @param pc capillary pressure * @param shift RSC's shift parameter * @param scale RSC's scale parameter */ static Real seff(Real pc, Real shift, Real scale); /** * derivative of effective saturation wrt capillary pressure * @param pc capillary pressure * @param shift RSC's shift parameter * @param scale RSC's scale parameter */ static Real dseff(Real pc, Real shift, Real scale); /** * 2nd derivative of effective saturation wrt capillary pressure * @param pc capillary pressure * @param shift RSC's shift parameter * @param scale RSC's scale parameter */ static Real d2seff(Real pc, Real shift, Real scale); }; #endif // RICHARDSSEFFRSC_H
/* * netlink/route/link/bridge.h Bridge * * 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 version 2.1 * of the License. * * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> */ #ifndef NETLINK_LINK_BRIDGE_H_ #define NETLINK_LINK_BRIDGE_H_ #include <netlink/netlink.h> #include <netlink/route/link.h> #ifdef __cplusplus extern "C" { #endif /** * Bridge flags * @ingroup bridge */ enum rtnl_link_bridge_flags { RTNL_BRIDGE_HAIRPIN_MODE = 0x0001, RTNL_BRIDGE_BPDU_GUARD = 0x0002, RTNL_BRIDGE_ROOT_BLOCK = 0x0004, RTNL_BRIDGE_FAST_LEAVE = 0x0008, }; extern struct rtnl_link *rtnl_link_bridge_alloc(void); extern int rtnl_link_is_bridge(struct rtnl_link *); extern int rtnl_link_bridge_has_ext_info(struct rtnl_link *); extern int rtnl_link_bridge_set_port_state(struct rtnl_link *, uint8_t ); extern int rtnl_link_bridge_get_port_state(struct rtnl_link *); extern int rtnl_link_bridge_set_priority(struct rtnl_link *, uint16_t); extern int rtnl_link_bridge_get_priority(struct rtnl_link *); extern int rtnl_link_bridge_set_cost(struct rtnl_link *, uint32_t); extern int rtnl_link_bridge_get_cost(struct rtnl_link *, uint32_t *); extern int rtnl_link_bridge_unset_flags(struct rtnl_link *, unsigned int); extern int rtnl_link_bridge_set_flags(struct rtnl_link *, unsigned int); extern int rtnl_link_bridge_get_flags(struct rtnl_link *); extern char * rtnl_link_bridge_flags2str(int, char *, size_t); extern int rtnl_link_bridge_str2flags(const char *); extern int rtnl_link_bridge_add(struct nl_sock *sk, const char *name); #ifdef __cplusplus } #endif #endif
//----------------------------------------------------------------------------- // Copyright (c) 2012 GarageGames, LLC // // 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, sublicense, 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 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 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 _RENDERPASSSTATETOKEN_H_ #define _RENDERPASSSTATETOKEN_H_ #ifndef _RENDERBINMANAGER_H_ #include "renderInstance/renderBinManager.h" #endif class RenderPassStateBin; class RenderPassStateToken : public SimObject { typedef SimObject Parent; public: DECLARE_CONOBJECT(RenderPassStateToken); static void initPersistFields(); // These must be re-implemented, and will assert if called on the base class. // They just can't be pure-virtual, due to SimObject. virtual void process(SceneRenderState *state, RenderPassStateBin *callingBin); virtual void reset(); virtual void enable(bool enabled = true); virtual bool isEnabled() const; }; //------------------------------------------------------------------------------ class RenderPassStateBin : public RenderBinManager { typedef RenderBinManager Parent; protected: SimObjectPtr< RenderPassStateToken > mStateToken; static bool _setStateToken( void* object, const char* index, const char* data ) { RenderPassStateToken* stateToken; Sim::findObject( data, stateToken ); reinterpret_cast< RenderPassStateBin* >( object )->mStateToken = stateToken; return false; } static const char* _getStateToken( void* object, const char* data ) { RenderPassStateBin* bin = reinterpret_cast< RenderPassStateBin* >( object ); if( bin->mStateToken.isValid() ) return bin->mStateToken->getIdString(); else return "0"; } public: DECLARE_CONOBJECT(RenderPassStateBin); static void initPersistFields(); RenderPassStateBin(); virtual ~RenderPassStateBin(); void render(SceneRenderState *state); void clear(); void sort(); }; #endif // _RENDERPASSSTATETOKEN_H_
#ifndef __MJC_KERNEL_DRIVER_H__ #define __MJC_KERNEL_DRIVER_H__ extern u32 get_devinfo_with_index(u32 index); extern void mt_irq_set_sens(unsigned int irq, unsigned int sens); extern void mt_irq_set_polarity(unsigned int irq, unsigned int polarity); typedef struct _MJC_EVENT_T { void *pvWaitQueue; /* /< [IN] The waitqueue discription */ unsigned int u4TimeoutMs; /* /< [IN] The timeout ms */ void *pvFlag; /* /< [IN/OUT] flag */ } MJC_EVENT_T; typedef struct { MJC_EVENT_T rEvent; } MJC_CONTEXT_T; /* ************************************ */ /* IO control structure */ /* ************************************ */ typedef struct { unsigned int u4StructSize; } MJC_IOCTL_LOCK_HW_T; typedef struct { unsigned int u4StructSize; unsigned int u4TimeoutMs; } MJC_IOCTL_ISR_T; typedef struct { unsigned long reg; unsigned int val; unsigned int mask; } MJC_WRITE_REG_T; typedef struct { unsigned long reg; unsigned int val; unsigned int mask; } MJC_READ_REG_T; typedef struct { unsigned int u4StructSize; unsigned short u2OutputFramerate; } MJC_IOCTL_SRC_CLK_T; typedef struct { unsigned int u4StructSize; unsigned long ulRegPAddress; unsigned long ulRegPSize; } MJC_IOCTL_REG_INFO_T; typedef struct{ unsigned int u4StructSize; unsigned char u1EFuseIndex; unsigned int u4EFuseBit; } MJC_IOCTL_EFUSE_INFO_T; #define MJC_IOC_MAGIC 'N' #define MJC_LOCKHW _IOW(MJC_IOC_MAGIC, 0x00, MJC_IOCTL_LOCK_HW_T) #define MJC_WAITISR _IOW(MJC_IOC_MAGIC, 0x01, MJC_IOCTL_ISR_T) #define MJC_READ_REG _IOW(MJC_IOC_MAGIC, 0x02, MJC_READ_REG_T) #define MJC_WRITE_REG _IOW(MJC_IOC_MAGIC, 0x03, MJC_WRITE_REG_T) #define MJC_WRITE_REG_TBL _IOW(MJC_IOC_MAGIC, 0x04, int) #define MJC_CLEAR_REG_TBL _IOW(MJC_IOC_MAGIC, 0x05, int) #define MJC_SOURCE_CLK _IOW(MJC_IOC_MAGIC, 0x06, MJC_IOCTL_SRC_CLK_T) #define MJC_REG_INFO _IOW(MJC_IOC_MAGIC, 0x07, MJC_IOCTL_REG_INFO_T) #define MJC_EFUSE_INFO _IOW(MJC_IOC_MAGIC, 0x08, MJC_IOCTL_EFUSE_INFO_T) #endif /* __MJC_KERNEL_DRIVER_H__ */
/* libunwind - a platform-independent unwind library Copyright (c) 2002-2004 Hewlett-Packard Development Company, L.P. Contributed by David Mosberger-Tang <davidm@hpl.hp.com> This file is part of libunwind. 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, sublicense, 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 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 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. */ #include <stdlib.h> #include "unwind_i.h" #include "offsets.h" /* This routine is responsible for copying the register values in cursor C and establishing them as the current machine state. */ static inline int establish_machine_state (struct cursor *c) { int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, int write, void *); int (*access_fpreg) (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *, int write, void *); unw_addr_space_t as = c->dwarf.as; void *arg = c->dwarf.as_arg; unw_fpreg_t fpval; unw_word_t val; int reg; access_reg = as->acc.access_reg; access_fpreg = as->acc.access_fpreg; Debug (8, "copying out cursor state\n"); for (reg = 0; reg <= UNW_REG_LAST; ++reg) { Debug (16, "copying %s %d\n", unw_regname (reg), reg); if (unw_is_fpreg (reg)) { if (tdep_access_fpreg (c, reg, &fpval, 0) >= 0) (*access_fpreg) (as, reg, &fpval, 1, arg); } else { if (tdep_access_reg (c, reg, &val, 0) >= 0) (*access_reg) (as, reg, &val, 1, arg); } } return 0; } PROTECTED int unw_resume (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; int ret; Debug (1, "(cursor=%p)\n", c); if ((ret = establish_machine_state (c)) < 0) return ret; return (*c->dwarf.as->acc.resume) (c->dwarf.as, (unw_cursor_t *) c, c->dwarf.as_arg); }
/* Functional tests for the function hotpatching feature. */ /* { dg-do compile } */ /* { dg-options "-mzarch -mhotpatch=0,0" } */ /* { dg-skip-if "" { *-*-* } { "*" } { "-O*" } } */ #include <stdio.h> void hp1(void) { printf("hello, world!\n"); } /* Check number of occurences of certain instructions. */ /* { dg-final { scan-assembler-not "pre-label NOPs" } } */ /* { dg-final { scan-assembler-not "post-label NOPs" } } */ /* { dg-final { scan-assembler-not "nopr\t%r0" } } */ /* { dg-final { scan-assembler-not "nop\t0" } } */ /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */ /* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
// -*- C++ -*- //============================================================================= /** * @file os_dirent.h * * format of directory entries * * $Id: os_dirent.h 82985 2008-10-08 18:15:30Z johnnyw $ * * @author Don Hinton <dhinton@dresystems.com> * @author This code was originally in various places including ace/OS.h. */ //============================================================================= #ifndef ACE_OS_INCLUDE_OS_DIRENT_H #define ACE_OS_INCLUDE_OS_DIRENT_H #include /**/ "ace/pre.h" #include /**/ "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/os_include/sys/os_types.h" #include "ace/os_include/os_limits.h" #if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) # include "ace/os_include/os_unistd.h" // VxWorks needs this to compile #endif /* ACE_VXWORKS */ #if !defined (ACE_LACKS_DIRENT_H) # include /**/ <dirent.h> #endif /* !ACE_LACKS_DIRENT_H */ // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #if !defined (MAXNAMLEN) # define MAXNAMLEN NAME_MAX #endif /* !MAXNAMLEN */ // At least compile on some of the platforms without <ACE_DIR> info yet. #if !defined (ACE_HAS_DIRENT) typedef int ACE_DIR; struct dirent { }; #endif /* ACE_HAS_DIRENT */ #if defined (ACE_LACKS_STRUCT_DIR) struct dirent { unsigned short d_ino; unsigned short d_off; unsigned short d_reclen; // This must be a ACE_TCHAR * and not a one element // ACE_TCHAR array. It causes problems on wide // character builds with Visual C++ 6.0. ACE_TCHAR *d_name; }; #define ACE_DIRENT dirent #define ACE_HAS_TCHAR_DIRENT struct ACE_DIR { /// The name of the directory we are looking into ACE_TCHAR *directory_name_; /// Remember the handle between calls. HANDLE current_handle_; /// The struct for the results ACE_DIRENT *dirent_; /// The struct for intermediate results. ACE_TEXT_WIN32_FIND_DATA fdata_; /// A flag to remember if we started reading already. int started_reading_; }; #elif defined (ACE_WIN32) && (__BORLANDC__) && defined (ACE_USES_WCHAR) #define ACE_HAS_TCHAR_DIRENT #define ACE_DIRENT wdirent typedef wDIR ACE_DIR; #else #define ACE_DIRENT dirent typedef DIR ACE_DIR; #endif /* ACE_LACKS_STRUCT_DIR */ #if defined (ACE_LACKS_SCANDIR_PROTOTYPE) int scandir (const char *, struct dirent ***, int (*) (const struct dirent *), int (*) (const void *, const void *)); #endif /* ACE_LACKS_SCANDIR_PROTOTYPE */ #if defined (ACE_LACKS_ALPHASORT_PROTOTYPE) int alphasort (const void *, const void *); #endif /* ACE_LACKS_ALPHASORT_PROTOTYPE */ #ifdef __cplusplus } #endif /* __cplusplus */ #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_DIRENT_H */
/* * (C) Copyright 2000 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * SPDX-License-Identifier: GPL-2.0+ */ #if defined(CONFIG_CMD_RARP) #ifndef __RARP_H__ #define __RARP_H__ #include <net.h> /**********************************************************************/ /* * Global functions and variables. */ extern int rarp_try; /* Process the receipt of a RARP packet */ void rarp_receive(struct ip_udp_hdr *ip, unsigned len); void rarp_request(void); /* Send a RARP request */ /**********************************************************************/ #endif /* __RARP_H__ */ #endif
/* i830_dma.c -- DMA support for the I830 -*- linux-c -*- * * Copyright 2002 Tungsten Graphics, Inc. * 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, sublicense, * 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 NONINFRINGEMENT. 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. * * Authors: Keith Whitwell <keith@tungstengraphics.com> * */ #include "drmP.h" #include "drm.h" #include "i830_drm.h" #include "i830_drv.h" #include <linux/interrupt.h> /* For task queue support */ #include <linux/delay.h> irqreturn_t i830_driver_irq_handler(DRM_IRQ_ARGS) { struct drm_device *dev = (struct drm_device *) arg; drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; u16 temp; temp = I830_READ16(I830REG_INT_IDENTITY_R); DRM_DEBUG("%x\n", temp); if (!(temp & 2)) return IRQ_NONE; I830_WRITE16(I830REG_INT_IDENTITY_R, temp); atomic_inc(&dev_priv->irq_received); wake_up_interruptible(&dev_priv->irq_queue); return IRQ_HANDLED; } static int i830_emit_irq(struct drm_device * dev) { drm_i830_private_t *dev_priv = dev->dev_private; RING_LOCALS; DRM_DEBUG("%s\n", __FUNCTION__); atomic_inc(&dev_priv->irq_emitted); BEGIN_LP_RING(2); OUT_RING(0); OUT_RING(GFX_OP_USER_INTERRUPT); ADVANCE_LP_RING(); return atomic_read(&dev_priv->irq_emitted); } static int i830_wait_irq(struct drm_device * dev, int irq_nr) { drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; DECLARE_WAITQUEUE(entry, current); unsigned long end = jiffies + HZ * 3; int ret = 0; DRM_DEBUG("%s\n", __FUNCTION__); if (atomic_read(&dev_priv->irq_received) >= irq_nr) return 0; dev_priv->sarea_priv->perf_boxes |= I830_BOX_WAIT; add_wait_queue(&dev_priv->irq_queue, &entry); for (;;) { __set_current_state(TASK_INTERRUPTIBLE); if (atomic_read(&dev_priv->irq_received) >= irq_nr) break; if ((signed)(end - jiffies) <= 0) { DRM_ERROR("timeout iir %x imr %x ier %x hwstam %x\n", I830_READ16(I830REG_INT_IDENTITY_R), I830_READ16(I830REG_INT_MASK_R), I830_READ16(I830REG_INT_ENABLE_R), I830_READ16(I830REG_HWSTAM)); ret = -EBUSY; /* Lockup? Missed irq? */ break; } schedule_timeout(HZ * 3); if (signal_pending(current)) { ret = -EINTR; break; } } __set_current_state(TASK_RUNNING); remove_wait_queue(&dev_priv->irq_queue, &entry); return ret; } /* Needs the lock as it touches the ring. */ int i830_irq_emit(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_i830_private_t *dev_priv = dev->dev_private; drm_i830_irq_emit_t *emit = data; int result; LOCK_TEST_WITH_RETURN(dev, file_priv); if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return -EINVAL; } result = i830_emit_irq(dev); if (copy_to_user(emit->irq_seq, &result, sizeof(int))) { DRM_ERROR("copy_to_user\n"); return -EFAULT; } return 0; } /* Doesn't need the hardware lock. */ int i830_irq_wait(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_i830_private_t *dev_priv = dev->dev_private; drm_i830_irq_wait_t *irqwait = data; if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return -EINVAL; } return i830_wait_irq(dev, irqwait->irq_seq); } /* drm_dma.h hooks */ void i830_driver_irq_preinstall(struct drm_device * dev) { drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; I830_WRITE16(I830REG_HWSTAM, 0xffff); I830_WRITE16(I830REG_INT_MASK_R, 0x0); I830_WRITE16(I830REG_INT_ENABLE_R, 0x0); atomic_set(&dev_priv->irq_received, 0); atomic_set(&dev_priv->irq_emitted, 0); init_waitqueue_head(&dev_priv->irq_queue); } void i830_driver_irq_postinstall(struct drm_device * dev) { drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; I830_WRITE16(I830REG_INT_ENABLE_R, 0x2); } void i830_driver_irq_uninstall(struct drm_device * dev) { drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; if (!dev_priv) return; I830_WRITE16(I830REG_INT_MASK_R, 0xffff); I830_WRITE16(I830REG_INT_ENABLE_R, 0x0); }
// Copyright 2004-present Facebook. All Rights Reserved. #pragma once #import "JSContextRef.h" extern "C" { void nativeProfilerStart(JSContextRef ctx, const char *title); const char *nativeProfilerEnd(JSContextRef ctx, const char *title); }
/** * FreeRDP: A Remote Desktop Protocol Implementation * Multiparty Virtual Channel * * Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com> * * 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 FREERDP_CHANNEL_ENCOMSP_SERVER_MAIN_H #define FREERDP_CHANNEL_ENCOMSP_SERVER_MAIN_H #include <winpr/crt.h> #include <winpr/synch.h> #include <winpr/thread.h> #include <freerdp/server/encomsp.h> struct _encomsp_server_private { HANDLE Thread; HANDLE StopEvent; void* ChannelHandle; }; #endif /* FREERDP_CHANNEL_ENCOMSP_SERVER_MAIN_H */
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_WEBUI_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_L10N_H_ #define CHROME_BROWSER_UI_WEBUI_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_L10N_H_ #include <string> #include "chrome/browser/performance_monitor/event.h" #include "chrome/browser/performance_monitor/metric.h" #include "chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_constants.h" #include "chrome/browser/ui/webui/performance_monitor/performance_monitor_ui_util.h" namespace performance_monitor { // Aggregation-Related base::string16 GetLocalizedStringFromAggregationMethod( const AggregationMethod method); base::string16 GetLocalizedStringForAggregationMethodDescription( const AggregationMethod method); // Event-Related base::string16 GetLocalizedStringFromEventCategory( const EventCategory category); base::string16 GetLocalizedStringForEventCategoryDescription( const EventCategory category); base::string16 GetLocalizedStringFromEventType(const EventType type); base::string16 GetLocalizedStringForEventTypeDescription(const EventType type); base::string16 GetLocalizedStringForEventTypeMouseover(const EventType type); base::string16 GetLocalizedStringFromEventProperty(const std::string& key); // Metric-Related base::string16 GetLocalizedStringFromMetricCategory( const MetricCategory category); base::string16 GetLocalizedStringForMetricCategoryDescription( const MetricCategory category); base::string16 GetLocalizedStringFromMetricType(const MetricType type); base::string16 GetLocalizedStringForMetricTypeDescription( const MetricType type); // Miscellaneous base::string16 GetLocalizedStringFromUnit(const Unit unit); } // namespace performance_monitor #endif // CHROME_BROWSER_UI_WEBUI_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_L10N_H_
/* * This confidential and proprietary software may be used only as * authorised by a licensing agreement from ARM Limited * (C) COPYRIGHT 2013-2014 ARM Limited * ALL RIGHTS RESERVED * The entire notice above must be reproduced on all authorised * copies and copies may only be made to the extent permitted * by a licensing agreement from ARM Limited. */ #include "mali_kernel_common.h" #include "mali_osk.h" #include "mali_ukk.h" #include "mali_memory.h" #include "mali_kernel_descriptor_mapping.h" #include "mali_mem_validation.h" #include "mali_uk_types.h" void mali_mem_external_release(mali_mem_allocation *descriptor) { MALI_DEBUG_ASSERT(MALI_MEM_EXTERNAL == descriptor->type); mali_mem_mali_map_free(descriptor); } _mali_osk_errcode_t _mali_ukk_map_external_mem(_mali_uk_map_external_mem_s *args) { struct mali_session_data *session; mali_mem_allocation *descriptor; int md; _mali_osk_errcode_t err; MALI_DEBUG_ASSERT_POINTER(args); session = (struct mali_session_data *)(uintptr_t)args->ctx; MALI_CHECK_NON_NULL(session, _MALI_OSK_ERR_INVALID_ARGS); /* check arguments */ /* NULL might be a valid Mali address */ if (! args->size) MALI_ERROR(_MALI_OSK_ERR_INVALID_ARGS); /* size must be a multiple of the system page size */ if (args->size % _MALI_OSK_MALI_PAGE_SIZE) MALI_ERROR(_MALI_OSK_ERR_INVALID_ARGS); MALI_DEBUG_PRINT(3, ("Requested to map physical memory 0x%x-0x%x into virtual memory 0x%x\n", args->phys_addr, (args->phys_addr + args->size - 1), args->mali_address)); /* Validate the mali physical range */ if (_MALI_OSK_ERR_OK != mali_mem_validation_check(args->phys_addr, args->size)) { return _MALI_OSK_ERR_FAULT; } descriptor = mali_mem_descriptor_create(session, MALI_MEM_EXTERNAL); if (NULL == descriptor) MALI_ERROR(_MALI_OSK_ERR_NOMEM); descriptor->mali_mapping.addr = args->mali_address; descriptor->size = args->size; if (args->flags & _MALI_MAP_EXTERNAL_MAP_GUARD_PAGE) { descriptor->flags = MALI_MEM_FLAG_MALI_GUARD_PAGE; } _mali_osk_mutex_wait(session->memory_lock); { u32 virt = descriptor->mali_mapping.addr; u32 phys = args->phys_addr; u32 size = args->size; err = mali_mem_mali_map_prepare(descriptor); if (_MALI_OSK_ERR_OK != err) { _mali_osk_mutex_signal(session->memory_lock); mali_mem_descriptor_destroy(descriptor); return _MALI_OSK_ERR_NOMEM; } mali_mmu_pagedir_update(session->page_directory, virt, phys, size, MALI_MMU_FLAGS_DEFAULT); if (descriptor->flags & MALI_MEM_FLAG_MALI_GUARD_PAGE) { mali_mmu_pagedir_update(session->page_directory, virt + size, phys, _MALI_OSK_MALI_PAGE_SIZE, MALI_MMU_FLAGS_DEFAULT); } } _mali_osk_mutex_signal(session->memory_lock); if (_MALI_OSK_ERR_OK != mali_descriptor_mapping_allocate_mapping(session->descriptor_mapping, descriptor, &md)) { _mali_osk_mutex_wait(session->memory_lock); mali_mem_external_release(descriptor); _mali_osk_mutex_signal(session->memory_lock); mali_mem_descriptor_destroy(descriptor); MALI_ERROR(_MALI_OSK_ERR_FAULT); } args->cookie = md; MALI_SUCCESS; } _mali_osk_errcode_t _mali_ukk_unmap_external_mem(_mali_uk_unmap_external_mem_s *args) { mali_mem_allocation *descriptor; void *old_value; struct mali_session_data *session; MALI_DEBUG_ASSERT_POINTER(args); session = (struct mali_session_data *)(uintptr_t)args->ctx; MALI_CHECK_NON_NULL(session, _MALI_OSK_ERR_INVALID_ARGS); if (_MALI_OSK_ERR_OK != mali_descriptor_mapping_get(session->descriptor_mapping, args->cookie, (void **)&descriptor)) { MALI_DEBUG_PRINT(1, ("Invalid memory descriptor %d used to unmap external memory\n", args->cookie)); MALI_ERROR(_MALI_OSK_ERR_FAULT); } old_value = mali_descriptor_mapping_free(session->descriptor_mapping, args->cookie); if (NULL != old_value) { _mali_osk_mutex_wait(session->memory_lock); mali_mem_external_release(descriptor); _mali_osk_mutex_signal(session->memory_lock); mali_mem_descriptor_destroy(descriptor); } MALI_SUCCESS; }
/**************************************************************************** ** ** Copyright (C) 2013 Jiří Procházka (Hobrasoft) ** Contact: http://www.hobrasoft.cz/ ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** 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. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file is under the terms of the GNU Lesser General Public License ** version 2.1 as published by the Free Software Foundation and appearing ** in the file LICENSE.LGPL included in the packaging of this file. ** Please review the following information to ensure the ** GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QGSRICHTEXTEDITOR_H #define QGSRICHTEXTEDITOR_H #include "qgis_gui.h" #include "qgis_sip.h" #include "ui_qgsrichtexteditorbase.h" #include <QPointer> class QImage; class QComboBox; class QgsColorButton; class QgsCodeEditorHTML; /* * Originally ported from https://github.com/Anchakor/MRichTextEditor, courtesy of Hobrasoft. */ /** * \ingroup gui * \brief A widget for editing rich text documents, with support for user controlled formatting of text * and insertion of hyperlinks and images. * * QgsRichTextEditor provides a reusable widget for allowing users to edit rich text documents, * and retrieving and setting the documents via HTML formatted strings. * * \since QGIS 3.20 */ class GUI_EXPORT QgsRichTextEditor : public QWidget, protected Ui::QgsRichTextEditorBase { Q_OBJECT public: /** * Constructor for QgsRichTextEditor, with the specified \a parent widget. */ QgsRichTextEditor( QWidget *parent = nullptr ); /** * Returns the widget's content as a plain text string. * * \see toHtml() */ QString toPlainText() const; /** * Returns the widget's content as a HTML string. * * \see toPlainText() */ QString toHtml() const; /** * Returns a reference to the QTextDocument shown in the widget. */ QTextDocument *document() { return mTextEdit->document(); } /** * Returns a reference to the text cursor. * * \see setTextCursor() */ QTextCursor textCursor() const { return mTextEdit->textCursor(); } /** * Sets the current text \a cursor. * * \see textCursor() */ void setTextCursor( const QTextCursor &cursor ) { mTextEdit->setTextCursor( cursor ); } public slots: /** * Sets the \a text to show in the widget. * * The \a text can either be a plain text string or a HTML document. */ void setText( const QString &text ); /** * Clears the current text from the widget. */ void clearSource(); protected: void focusInEvent( QFocusEvent *event ) override; private slots: void setPlainText( const QString &text ) { mTextEdit->setPlainText( text ); } void setHtml( const QString &text ) { mTextEdit->setHtml( text ); } void textRemoveFormat(); void textRemoveAllFormat(); void textBold(); void textUnderline(); void textStrikeout(); void textItalic(); void textSize( const QString &p ); void textLink( bool checked ); void textStyle( int index ); void textFgColor(); void textBgColor(); void listBullet( bool checked ); void listOrdered( bool checked ); void slotCurrentCharFormatChanged( const QTextCharFormat &format ); void slotCursorPositionChanged(); void slotClipboardDataChanged(); void increaseIndentation(); void decreaseIndentation(); void insertImage(); void editSource( bool enabled ); private: void mergeFormatOnWordOrSelection( const QTextCharFormat &format ); void fontChanged( const QFont &f ); void fgColorChanged( const QColor &c ); void bgColorChanged( const QColor &c ); void list( bool checked, QTextListFormat::Style style ); void indent( int delta ); int mFontSizeH1 = 18; int mFontSizeH2 = 16; int mFontSizeH3 = 14; int mFontSizeH4 = 12; enum ParagraphItems { ParagraphStandard = 0, ParagraphHeading1, ParagraphHeading2, ParagraphHeading3, ParagraphHeading4, ParagraphMonospace }; QComboBox *mParagraphStyleCombo = nullptr; QComboBox *mFontSizeCombo = nullptr; QgsColorButton *mForeColorButton = nullptr; QgsColorButton *mBackColorButton = nullptr; QgsCodeEditorHTML *mSourceEdit = nullptr; QPointer<QTextList> mLastBlockList; QString mMonospaceFontFamily; }; #endif // QGSRICHTEXTEDITOR_H
/* * This file is part of Cleanflight. * * Cleanflight 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. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #include <stdbool.h> #include <stdint.h> #include <math.h> #include <string.h> #include "common/maths.h" #include "common/axis.h" #include "config/parameter_group.h" #include "config/parameter_group_ids.h" #include "drivers/sensor.h" #include "boardalignment.h" static bool standardBoardAlignment = true; // board orientation correction static float boardRotation[3][3]; // matrix // no template required since defaults are zero PG_REGISTER(boardAlignment_t, boardAlignment, PG_BOARD_ALIGNMENT, 0); static bool isBoardAlignmentStandard(const boardAlignment_t *boardAlignment) { return !boardAlignment->rollDegrees && !boardAlignment->pitchDegrees && !boardAlignment->yawDegrees; } void initBoardAlignment(const boardAlignment_t *boardAlignment) { if (isBoardAlignmentStandard(boardAlignment)) { return; } standardBoardAlignment = false; fp_angles_t rotationAngles; rotationAngles.angles.roll = degreesToRadians(boardAlignment->rollDegrees ); rotationAngles.angles.pitch = degreesToRadians(boardAlignment->pitchDegrees); rotationAngles.angles.yaw = degreesToRadians(boardAlignment->yawDegrees ); buildRotationMatrix(&rotationAngles, boardRotation); } static void alignBoard(int32_t *vec) { int32_t x = vec[X]; int32_t y = vec[Y]; int32_t z = vec[Z]; vec[X] = lrintf(boardRotation[0][X] * x + boardRotation[1][X] * y + boardRotation[2][X] * z); vec[Y] = lrintf(boardRotation[0][Y] * x + boardRotation[1][Y] * y + boardRotation[2][Y] * z); vec[Z] = lrintf(boardRotation[0][Z] * x + boardRotation[1][Z] * y + boardRotation[2][Z] * z); } void alignSensors(int32_t *dest, uint8_t rotation) { const int32_t x = dest[X]; const int32_t y = dest[Y]; const int32_t z = dest[Z]; switch (rotation) { default: case CW0_DEG: dest[X] = x; dest[Y] = y; dest[Z] = z; break; case CW90_DEG: dest[X] = y; dest[Y] = -x; dest[Z] = z; break; case CW180_DEG: dest[X] = -x; dest[Y] = -y; dest[Z] = z; break; case CW270_DEG: dest[X] = -y; dest[Y] = x; dest[Z] = z; break; case CW0_DEG_FLIP: dest[X] = -x; dest[Y] = y; dest[Z] = -z; break; case CW90_DEG_FLIP: dest[X] = y; dest[Y] = x; dest[Z] = -z; break; case CW180_DEG_FLIP: dest[X] = x; dest[Y] = -y; dest[Z] = -z; break; case CW270_DEG_FLIP: dest[X] = -y; dest[Y] = -x; dest[Z] = -z; break; } if (!standardBoardAlignment) alignBoard(dest); }
// 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 COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_COLOR_CHOOSER_ANDROID_H_ #define COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_COLOR_CHOOSER_ANDROID_H_ #include <vector> #include "base/android/jni_android.h" #include "base/compiler_specific.h" #include "base/macros.h" #include "base/strings/string16.h" #include "content/public/browser/color_chooser.h" using base::android::AttachCurrentThread; using base::android::ScopedJavaLocalRef; namespace content { class WebContents; struct ColorSuggestion; } namespace web_contents_delegate_android { // Glues the Java (ColorPickerChooser.java) picker with the native part. class ColorChooserAndroid : public content::ColorChooser { public: ColorChooserAndroid(content::WebContents* tab, SkColor initial_color, const std::vector<content::ColorSuggestion>& suggestions); ~ColorChooserAndroid() override; void OnColorChosen(JNIEnv* env, const base::android::JavaRef<jobject>& obj, jint color); // ColorChooser interface void End() override; void SetSelectedColor(SkColor color) override; private: base::android::ScopedJavaGlobalRef<jobject> j_color_chooser_; // The web contents invoking the color chooser. No ownership. because it will // outlive this class. content::WebContents* web_contents_; DISALLOW_COPY_AND_ASSIGN(ColorChooserAndroid); }; // Native JNI methods bool RegisterColorChooserAndroid(JNIEnv* env); } // namespace web_contents_delegate_android #endif // COMPONENTS_WEB_CONTENTS_DELEGATE_ANDROID_COLOR_CHOOSER_ANDROID_H_
/* * Copyright (C) 2009 The Android Open Source Project * * 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. */ /*------------------------------------------------------------------------------ Table of contents 1. Include headers 2. Module defines 3. Data types 4. Function prototypes ------------------------------------------------------------------------------*/ #ifndef H264SWDEC_CFG_H #define H264SWDEC_CFG_H /*------------------------------------------------------------------------------ 1. Include headers ------------------------------------------------------------------------------*/ #include "basetype.h" /*------------------------------------------------------------------------------ 2. Module defines ------------------------------------------------------------------------------*/ #define MAX_NUM_REF_PICS 16 #define MAX_NUM_SLICE_GROUPS 8 #define MAX_NUM_SEQ_PARAM_SETS 32 #define MAX_NUM_PIC_PARAM_SETS 256 /*------------------------------------------------------------------------------ 3. Data types ------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------ 4. Function prototypes ------------------------------------------------------------------------------*/ #endif /* #ifdef H264SWDEC_CFG_H */
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_TASK_MANAGEMENT_WEB_CONTENTS_TAGS_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_WEB_CONTENTS_TAGS_H_ #include "base/macros.h" #include "extensions/common/view_type.h" class BackgroundContents; class Panel; namespace content { class WebContents; } // namespace content namespace task_management { // Defines a factory class for creating the TaskManager-specific Tags for the // WebContents that are owned by various types of services. // // Any service or feature that creates WebContents instances (via // WebContents::Create) needs to make sure that they are tagged using this // mechanism, otherwise the associated render processes will not show up in the // task manager. class WebContentsTags { public: // Tag a BackgroundContents so that it shows up in the task manager. Calling // this function creates a BackgroundContentsTag, and attaches it to // |web_contents|. If an instance is already attached, this does nothing. The // resulting tag does not have to be cleaned up by the caller, as it is owned // by |web_contents|. static void CreateForBackgroundContents( content::WebContents* web_contents, BackgroundContents* background_contents); // Tag a DevTools WebContents so that it shows up in the task manager. Calling // this function creates a DevToolsTag, and attaches it to |web_contents|. If // an instance is already attached, this does nothing. The resulting tag does // not have to be cleaned up by the caller, as it is owned by |web_contents|. static void CreateForDevToolsContents(content::WebContents* web_contents); // Tag a WebContents owned by the PrerenderManager so that it shows up in the // task manager. Calling this function creates a PrerenderTag, and attaches it // to |web_contents|. If an instance is already attached, this does nothing. // The resulting tag does not have to be cleaned up by the caller, as it is // owned by |web_contents|. static void CreateForPrerenderContents(content::WebContents* web_contents); // Tag a WebContents owned by the TabStripModel so that it shows up in the // task manager. Calling this function creates a TabContentsTag, and attaches // it to |web_contents|. If an instance is already attached, this does // nothing. The resulting tag does not have to be cleaned up by the caller, as // it is owned by |web_contents|. static void CreateForTabContents(content::WebContents* web_contents); // Tag a WebContents owned by a |panel| in the PanelManager so that it shows // up in the task manager. Calling this function creates a PanelTag, and // attaches it to |web_contents|. If an instance is already attached, this // does nothing. The resulting tag does not have to be cleaned up by the // caller, as it is owned by |web_contents|. // Note: |web_contents| must be equal to |panel->GetWebContents()|. static void CreateForPanel(content::WebContents* web_contents, Panel* panel); // Tag a WebContents created for a print preview or background printing so // that it shows up in the task manager. Calling this function creates a // PrintingTag, and attaches it to |web_contents|. If an instance is already // attached, this does nothing. The resulting tag does not have to be cleaned // up by the caller, as it is owned by |web_contents|. static void CreateForPrintingContents(content::WebContents* web_contents); // Tag a WebContents owned by a GuestViewBase so that it shows up in the // task manager. Calling this function creates a GuestTag, and attaches it to // |web_contents|. If an instance is already attached, this does nothing. The // resulting tag does not have to be cleaned up by the caller, as it is owned // by |web_contents|. static void CreateForGuestContents(content::WebContents* web_contents); // Tag a WebContents that belongs to |extension| so that it shows up in the // task manager. Calling this function creates a ExtensionTag, and attaches // it to |web_contents|. If an instance is already attached, this does // nothing. The resulting tag does not have to be cleaned up by the caller, // as it is owned by |web_contents|. // |web_contents| must be of a non-tab, non-guest view, non-panel, or // non-background contents Extension. static void CreateForExtension(content::WebContents* web_contents, extensions::ViewType view_type); // Clears the task-manager tag, created by any of the above functions, from // the given |web_contents| if any. // Clearing the tag is necessary only when you need to re-tag an existing // WebContents, to indicate a change in ownership. static void ClearTag(content::WebContents* web_contents); private: DISALLOW_COPY_AND_ASSIGN(WebContentsTags); }; } // namespace task_management #endif // CHROME_BROWSER_TASK_MANAGEMENT_WEB_CONTENTS_TAGS_H_
/* $OpenBSD: cipher-bf1.c,v 1.6 2010/10/01 23:05:32 djm Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE 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. */ #include "includes.h" #include <sys/types.h> #include <openssl/evp.h> #include <stdarg.h> #include <string.h> #include "xmalloc.h" #include "log.h" #include "openbsd-compat/openssl-compat.h" /* * SSH1 uses a variation on Blowfish, all bytes must be swapped before * and after encryption/decryption. Thus the swap_bytes stuff (yuk). */ const EVP_CIPHER * evp_ssh1_bf(void); static void swap_bytes(const u_char *src, u_char *dst, int n) { u_char c[4]; /* Process 4 bytes every lap. */ for (n = n / 4; n > 0; n--) { c[3] = *src++; c[2] = *src++; c[1] = *src++; c[0] = *src++; *dst++ = c[0]; *dst++ = c[1]; *dst++ = c[2]; *dst++ = c[3]; } } #ifdef SSH_OLD_EVP static void bf_ssh1_init (EVP_CIPHER_CTX * ctx, const unsigned char *key, const unsigned char *iv, int enc) { if (iv != NULL) memcpy (&(ctx->oiv[0]), iv, 8); memcpy (&(ctx->iv[0]), &(ctx->oiv[0]), 8); if (key != NULL) BF_set_key (&(ctx->c.bf_ks), EVP_CIPHER_CTX_key_length (ctx), key); } #endif static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, LIBCRYPTO_EVP_INL_TYPE) = NULL; static int bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, LIBCRYPTO_EVP_INL_TYPE len) { int ret; swap_bytes(in, out, len); ret = (*orig_bf)(ctx, out, out, len); swap_bytes(out, out, len); return (ret); } const EVP_CIPHER * evp_ssh1_bf(void) { static EVP_CIPHER ssh1_bf; memcpy(&ssh1_bf, EVP_bf_cbc(), sizeof(EVP_CIPHER)); orig_bf = ssh1_bf.do_cipher; ssh1_bf.nid = NID_undef; #ifdef SSH_OLD_EVP ssh1_bf.init = bf_ssh1_init; #endif ssh1_bf.do_cipher = bf_ssh1_cipher; ssh1_bf.key_len = 32; return (&ssh1_bf); }
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* #pragma once #include "Scenario1_Render.g.h" #include "MainPage.xaml.h" namespace SDKTemplate { [Windows::Foundation::Metadata::WebHostHidden] public ref class Scenario1_Render sealed { public: Scenario1_Render(); void LoadDocument(); void ViewPage(); private: MainPage^ rootPage = MainPage::Current; Windows::Data::Pdf::PdfDocument^ pdfDocument; }; }
/* * Copyright (C) 2016 Gautier Hattenberger <gautier.hattenberger@enac.fr> * * This file is part of paparazzi. * * paparazzi 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, or (at your option) * any later version. * * paparazzi 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 paparazzi; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ /** \file modules/loggers/pprzlog_tp.c * \brief Initialize pprzlog transport */ #include "modules/loggers/pprzlog_tp.h" #include "mcu_periph/sys_time.h" struct pprzlog_transport pprzlog_tp; void pprzlog_tp_init(void) { pprzlog_transport_init(&pprzlog_tp, get_sys_time_usec); }
/* { dg-do compile } */ /* { dg-options "-O -fdump-tree-optimized" } */ #if __SIZEOF_INT__ < 4 __extension__ typedef __UINT32_TYPE__ uint32_t; #else typedef unsigned uint32_t; #endif int f(uint32_t a){ uint32_t b=5; uint32_t c=a-b; return c>a; } int g(uint32_t a){ uint32_t b=32; uint32_t c=a+b; return c<a; } /* { dg-final { scan-tree-dump "a_\[0-9\]+.D. <= 4;" "optimized" } } */ /* { dg-final { scan-tree-dump "a_\[0-9\]+.D. > 4294967263;" "optimized" } } */
/* * This file is part of the libpayload project. * * Copyright (C) 2013 Google, Inc. * * 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 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 AUTHOR 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 <cbfs.h> #include <cbfs_ram.h> #include <string.h> #include <stdio.h> #include <stdlib.h> // Implementation of a media source based on given memory buffer. struct ram_media { char *start; size_t size; }; static int ram_open(struct cbfs_media *media) { return 0; } static void *ram_map(struct cbfs_media *media, size_t offset, size_t count) { struct ram_media *m = (struct ram_media*)media->context; /* assume addressing from top of image in this case */ if (offset > 0xf0000000) { offset = m->size + offset; } if (offset + count > m->size) { printf("ERROR: ram_map: request out of range (0x%zx+0x%zx)\n", offset, count); return CBFS_MEDIA_INVALID_MAP_ADDRESS; } return (void*)(m->start + offset); } static void *ram_unmap(struct cbfs_media *media, const void *address) { return NULL; } static size_t ram_read(struct cbfs_media *media, void *dest, size_t offset, size_t count) { void *ptr = ram_map(media, offset, count); if (ptr == CBFS_MEDIA_INVALID_MAP_ADDRESS) return 0; memcpy(dest, ptr, count); ram_unmap(media, ptr); return count; } static int ram_close(struct cbfs_media *media) { return 0; } int init_cbfs_ram_media(struct cbfs_media *media, void *start, size_t size) { // TODO Find a way to release unused media. Maybe adding media->destroy. struct ram_media *m = (struct ram_media*)malloc(sizeof(*m)); m->start = start; m->size = size; media->context = (void*)m; media->open = ram_open; media->close = ram_close; media->map = ram_map; media->unmap = ram_unmap; media->read = ram_read; return 0; } // Legacy setup_cbfs_from_*. static int is_default_cbfs_media_initialized; static struct cbfs_media default_cbfs_media; int setup_cbfs_from_ram(void *start, uint32_t size) { int result = init_cbfs_ram_media(&default_cbfs_media, start, size); if (result == 0) is_default_cbfs_media_initialized = 1; return result; } extern int libpayload_init_default_cbfs_media(struct cbfs_media *media); int setup_cbfs_from_flash(void) { int result = libpayload_init_default_cbfs_media(&default_cbfs_media); if (result == 0) is_default_cbfs_media_initialized = 1; return result; } int init_default_cbfs_media(struct cbfs_media *media) { int result = 0; if (is_default_cbfs_media_initialized != 1) { result = setup_cbfs_from_flash(); } if (result == 0) memcpy(media, &default_cbfs_media, sizeof(*media)); return result; }
#ifndef MONITOR_SQLITE_DB_H #define MONITOR_SQLITE_DB_H #include <stdint.h> #include <string> #include "base/macros.h" #include "monitor/database.h" struct sqlite3; namespace monitor { class SQLiteDB : public Database { public: explicit SQLiteDB(const std::string& dbfile); ~SQLiteDB(); typedef Database::WriteResult WriteResult; typedef Database::LookupResult LookupResult; typedef Database::VerificationLevel VerificationLevel; void BeginTransaction(); void EndTransaction(); virtual LookupResult LookupLatestWrittenSTH( ct::SignedTreeHead* result) const; virtual LookupResult LookupHashByIndex(int64_t sequence_number, std::string* result) const; virtual LookupResult LookupSTHByTimestamp(uint64_t timestamp, ct::SignedTreeHead* result) const; virtual LookupResult LookupVerificationLevel( const ct::SignedTreeHead& sth, VerificationLevel* result) const; private: virtual WriteResult CreateEntry_(const std::string& leaf, const std::string& leaf_hash, const std::string& cert, const std::string& cert_chain); virtual WriteResult WriteSTH_(uint64_t timestamp, int64_t tree_size, const std::string& sth); virtual WriteResult SetVerificationLevel_(const ct::SignedTreeHead& sth, VerificationLevel verify_level); sqlite3* db_; DISALLOW_COPY_AND_ASSIGN(SQLiteDB); }; } // namespace monitor #endif // MONITOR_SQLITE_DB_H
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/memory/shared_memory.h" #include "content/common/content_export.h" #include "content/common/media/video_capture.h" #include "content/public/common/common_param_traits.h" #include "ipc/ipc_message_macros.h" #include "media/video/capture/video_capture_types.h" #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT CONTENT_EXPORT #define IPC_MESSAGE_START VideoCaptureMsgStart IPC_ENUM_TRAITS(content::VideoCaptureState) // Notify the renderer process about the state update such as // Start/Pause/Stop. IPC_MESSAGE_CONTROL2(VideoCaptureMsg_StateChanged, int /* device id */, content::VideoCaptureState /* new state */) // Tell the renderer process that a new buffer is allocated for video capture. IPC_MESSAGE_CONTROL4(VideoCaptureMsg_NewBuffer, int /* device id */, base::SharedMemoryHandle /* handle */, int /* length */, int /* buffer_id */) // Tell the renderer process that a buffer is available from video capture. IPC_MESSAGE_CONTROL3(VideoCaptureMsg_BufferReady, int /* device id */, int /* buffer_id */, base::Time /* timestamp */) // Tell the renderer process the width, height and frame rate the camera use. IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceInfo, int /* device_id */, media::VideoCaptureParams) // Tell the renderer process the newly changed width, height and frame rate // the video capture device will use. IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceInfoChanged, int /* device_id */, media::VideoCaptureParams) // Start the video capture specified by |device_id|. IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_Start, int /* device_id */, media::VideoCaptureParams) // Pause the video capture specified by |device_id|. IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Pause, int /* device_id */) // Close the video capture specified by |device_id|. IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Stop, int /* device_id */) // Tell the browser process that the video frame buffer |handle| is ready for // device |device_id| to fill up. IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_BufferReady, int /* device_id */, int /* buffer_id */)
/* * Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <openssl/seed.h> #include <openssl/modes.h> void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, size_t len, const SEED_KEY_SCHEDULE *ks, unsigned char ivec[SEED_BLOCK_SIZE], int *num) { CRYPTO_ofb128_encrypt(in, out, len, ks, ivec, num, (block128_f) SEED_encrypt); }
#ifndef _LINUX_CPUSET_H #define _LINUX_CPUSET_H /* * cpuset interface * * Copyright (C) 2003 BULL SA * Copyright (C) 2004-2006 Silicon Graphics, Inc. * */ #include <linux/sched.h> #include <linux/cpumask.h> #include <linux/nodemask.h> #include <linux/mm.h> #ifdef CONFIG_CPUSETS extern int number_of_cpusets; /* How many cpusets are defined in system? */ extern int cpuset_init(void); extern void cpuset_init_smp(void); extern void cpuset_update_active_cpus(bool cpu_online); extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); extern void cpuset_cpus_allowed_fallback(struct task_struct *p); extern nodemask_t cpuset_mems_allowed(struct task_struct *p); #define cpuset_current_mems_allowed (current->mems_allowed) void cpuset_init_current_mems_allowed(void); int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask); extern int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask); extern int __cpuset_node_allowed_hardwall(int node, gfp_t gfp_mask); static inline int cpuset_node_allowed_softwall(int node, gfp_t gfp_mask) { return number_of_cpusets <= 1 || __cpuset_node_allowed_softwall(node, gfp_mask); } static inline int cpuset_node_allowed_hardwall(int node, gfp_t gfp_mask) { return number_of_cpusets <= 1 || __cpuset_node_allowed_hardwall(node, gfp_mask); } static inline int cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask) { return cpuset_node_allowed_softwall(zone_to_nid(z), gfp_mask); } static inline int cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask) { return cpuset_node_allowed_hardwall(zone_to_nid(z), gfp_mask); } extern int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, const struct task_struct *tsk2); #define cpuset_memory_pressure_bump() \ do { \ if (cpuset_memory_pressure_enabled) \ __cpuset_memory_pressure_bump(); \ } while (0) extern int cpuset_memory_pressure_enabled; extern void __cpuset_memory_pressure_bump(void); extern void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task); extern int proc_cpuset_show(struct seq_file *, void *); extern int cpuset_mem_spread_node(void); extern int cpuset_slab_spread_node(void); static inline int cpuset_do_page_mem_spread(void) { return current->flags & PF_SPREAD_PAGE; } static inline int cpuset_do_slab_mem_spread(void) { return current->flags & PF_SPREAD_SLAB; } extern int current_cpuset_is_being_rebound(void); extern void rebuild_sched_domains(void); extern void cpuset_print_task_mems_allowed(struct task_struct *p); /* * read_mems_allowed_begin is required when making decisions involving * mems_allowed such as during page allocation. mems_allowed can be updated in * parallel and depending on the new value an operation can fail potentially * causing process failure. A retry loop with read_mems_allowed_begin and * read_mems_allowed_retry prevents these artificial failures. */ static inline unsigned int read_mems_allowed_begin(void) { return read_seqcount_begin(&current->mems_allowed_seq); } /* * If this returns true, the operation that took place after * read_mems_allowed_begin may have failed artificially due to a concurrent * update of mems_allowed. It is up to the caller to retry the operation if * appropriate. */ static inline bool read_mems_allowed_retry(unsigned int seq) { return read_seqcount_retry(&current->mems_allowed_seq, seq); } static inline void set_mems_allowed(nodemask_t nodemask) { task_lock(current); write_seqcount_begin(&current->mems_allowed_seq); current->mems_allowed = nodemask; write_seqcount_end(&current->mems_allowed_seq); task_unlock(current); } #else /* !CONFIG_CPUSETS */ static inline int cpuset_init(void) { return 0; } static inline void cpuset_init_smp(void) {} static inline void cpuset_update_active_cpus(bool cpu_online) { partition_sched_domains(1, NULL, NULL); } static inline void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask) { cpumask_copy(mask, cpu_possible_mask); } static inline void cpuset_cpus_allowed_fallback(struct task_struct *p) { } static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) { return node_possible_map; } #define cpuset_current_mems_allowed (node_states[N_MEMORY]) static inline void cpuset_init_current_mems_allowed(void) {} static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask) { return 1; } static inline int cpuset_node_allowed_softwall(int node, gfp_t gfp_mask) { return 1; } static inline int cpuset_node_allowed_hardwall(int node, gfp_t gfp_mask) { return 1; } static inline int cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask) { return 1; } static inline int cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask) { return 1; } static inline int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, const struct task_struct *tsk2) { return 1; } static inline void cpuset_memory_pressure_bump(void) {} static inline void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task) { } static inline int cpuset_mem_spread_node(void) { return 0; } static inline int cpuset_slab_spread_node(void) { return 0; } static inline int cpuset_do_page_mem_spread(void) { return 0; } static inline int cpuset_do_slab_mem_spread(void) { return 0; } static inline int current_cpuset_is_being_rebound(void) { return 0; } static inline void rebuild_sched_domains(void) { partition_sched_domains(1, NULL, NULL); } static inline void cpuset_print_task_mems_allowed(struct task_struct *p) { } static inline void set_mems_allowed(nodemask_t nodemask) { } static inline unsigned int read_mems_allowed_begin(void) { return 0; } static inline bool read_mems_allowed_retry(unsigned int seq) { return false; } #endif /* !CONFIG_CPUSETS */ #endif /* _LINUX_CPUSET_H */
/* * (C) Copyright 2007 Michal Simek * (C) Copyright 2004 Atmark Techno, Inc. * * Michal SIMEK <monstr@monstr.eu> * Yasushi SHOJI <yashi@atmark-techno.com> * * See file CREDITS for list of people who contributed to this * project. * * 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 */ #include <common.h> #include <command.h> #include <malloc.h> #include <timestamp.h> #include <version.h> #include <watchdog.h> #include <stdio_dev.h> #include <net.h> DECLARE_GLOBAL_DATA_PTR; const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")"; #ifdef CONFIG_SYS_GPIO_0 extern int gpio_init (void); #endif #ifdef CONFIG_SYS_INTC_0 extern int interrupts_init (void); #endif #if defined(CONFIG_CMD_NET) extern int eth_init (bd_t * bis); #endif #ifdef CONFIG_SYS_TIMER_0 extern int timer_init (void); #endif #ifdef CONFIG_SYS_FSL_2 extern void fsl_init2 (void); #endif /* * All attempts to come up with a "common" initialization sequence * that works for all boards and architectures failed: some of the * requirements are just _too_ different. To get rid of the resulting * mess of board dependend #ifdef'ed code we now make the whole * initialization sequence configurable to the user. * * The requirements for any new initalization function is simple: it * receives a pointer to the "global data" structure as it's only * argument, and returns an integer return code, where 0 means * "continue" and != 0 means "fatal error, hang the system". */ typedef int (init_fnc_t) (void); init_fnc_t *init_sequence[] = { env_init, serial_init, #ifdef CONFIG_SYS_GPIO_0 gpio_init, #endif #ifdef CONFIG_SYS_INTC_0 interrupts_init, #endif #ifdef CONFIG_SYS_TIMER_0 timer_init, #endif #ifdef CONFIG_SYS_FSL_2 fsl_init2, #endif NULL, }; void board_init (void) { bd_t *bd; init_fnc_t **init_fnc_ptr; gd = (gd_t *) (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_GBL_DATA_OFFSET); bd = (bd_t *) (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_GBL_DATA_OFFSET \ - GENERATED_BD_INFO_SIZE); char *s; #if defined(CONFIG_CMD_FLASH) ulong flash_size = 0; #endif asm ("nop"); /* FIXME gd is not initialize - wait */ memset ((void *)gd, 0, GENERATED_GBL_DATA_SIZE); memset ((void *)bd, 0, GENERATED_BD_INFO_SIZE); gd->bd = bd; gd->baudrate = CONFIG_BAUDRATE; bd->bi_baudrate = CONFIG_BAUDRATE; bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ /* * The Malloc area is immediately below the monitor copy in DRAM * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off * as our monitory code is run from SDRAM */ mem_malloc_init (CONFIG_SYS_MALLOC_BASE, CONFIG_SYS_MALLOC_LEN); for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { WATCHDOG_RESET (); if ((*init_fnc_ptr) () != 0) { hang (); } } puts ("SDRAM :\n"); printf ("\t\tIcache:%s\n", icache_status() ? "ON" : "OFF"); printf ("\t\tDcache:%s\n", dcache_status() ? "ON" : "OFF"); printf ("\tU-Boot Start:0x%08x\n", CONFIG_SYS_TEXT_BASE); #if defined(CONFIG_CMD_FLASH) puts ("Flash: "); bd->bi_flashstart = CONFIG_SYS_FLASH_BASE; if (0 < (flash_size = flash_init ())) { bd->bi_flashsize = flash_size; bd->bi_flashoffset = CONFIG_SYS_FLASH_BASE + flash_size; # ifdef CONFIG_SYS_FLASH_CHECKSUM print_size (flash_size, ""); /* * Compute and print flash CRC if flashchecksum is set to 'y' * * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX */ s = getenv ("flashchecksum"); if (s && (*s == 'y')) { printf (" CRC: %08X", crc32 (0, (const unsigned char *) CONFIG_SYS_FLASH_BASE, flash_size) ); } putc ('\n'); # else /* !CONFIG_SYS_FLASH_CHECKSUM */ print_size (flash_size, "\n"); # endif /* CONFIG_SYS_FLASH_CHECKSUM */ } else { puts ("Flash init FAILED"); bd->bi_flashstart = 0; bd->bi_flashsize = 0; bd->bi_flashoffset = 0; } #endif /* relocate environment function pointers etc. */ env_relocate (); /* Initialize stdio devices */ stdio_init (); if ((s = getenv ("loadaddr")) != NULL) { load_addr = simple_strtoul (s, NULL, 16); } #if defined(CONFIG_CMD_NET) /* IP Address */ bd->bi_ip_addr = getenv_IPaddr("ipaddr"); printf("Net: "); eth_initialize(gd->bd); uchar enetaddr[6]; eth_getenv_enetaddr("ethaddr", enetaddr); printf("MAC: %pM\n", enetaddr); #endif /* main_loop */ for (;;) { WATCHDOG_RESET (); main_loop (); } } void hang (void) { puts ("### ERROR ### Please RESET the board ###\n"); for (;;) ; }
/* { dg-do compile } */ /* { dg-options "-O3 -fno-ipa-icf -fdump-tree-ldist-details" } */ struct Foo { char a; }; struct Foo x[256]; static void __attribute__((noinline,noclone)) foo() { int i; for (i = 0; i < 256; ++i) x[i] = (struct Foo){}; } static void __attribute__((noinline,noclone)) bar() { int i; for (i = 0; i < 256; ++i) x[i].a = 1; } static void __attribute__((noinline,noclone)) foobar(unsigned char c) { int i; for (i = 0; i < 256; ++i) x[i].a = c; } static void __attribute__((noinline,noclone)) foobar2(char c) { int i; for (i = 0; i < 256; ++i) x[i].a = c; } struct Baz { short a; }; struct Baz y[256]; static void __attribute__((noinline,noclone)) baz() { int i; for (i = 0; i < 256; ++i) y[i].a = -1; } int main() { volatile int x; foo(); bar(); foobar(x); foobar2(x); baz(); return 0; } /* { dg-final { scan-tree-dump-times "generated memset zero" 1 "ldist" } } */ /* { dg-final { scan-tree-dump-times "generated memset" 5 "ldist" } } */ /* { dg-final { cleanup-tree-dump "ldist" } } */
/* linux/arch/arm/plat-s5p/setup-csis.c * * Copyright (c) 2009 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * S5P - Base MIPI-CSI2 gpio configuration * * 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/types.h> #include <linux/clk.h> #include <linux/err.h> #include <linux/platform_device.h> #include <linux/io.h> #include <mach/map.h> #include <mach/regs-clock.h> #include <mach/regs-clock.h> #include <plat/csis.h> struct platform_device; /* don't need the contents */ void s3c_csis_cfg_gpio(void) { } void s3c_csis_cfg_phy_global(int on) { u32 cfg; if (on) { /* MIPI D-PHY Power Enable */ cfg = __raw_readl(S5P_MIPI_CONTROL); cfg |= S5P_MIPI_DPHY_EN; __raw_writel(cfg, S5P_MIPI_CONTROL); } else { /* MIPI Power Disable */ cfg = __raw_readl(S5P_MIPI_CONTROL); cfg &= ~S5P_MIPI_DPHY_EN; __raw_writel(cfg, S5P_MIPI_CONTROL); } } int s3c_csis_clk_on(struct platform_device *pdev, struct clk **clk) { struct clk *sclk_csis = NULL; struct clk *parent = NULL; struct clk *mout_csis = NULL; struct s3c_platform_csis *pdata; pdata = to_csis_plat(&pdev->dev); /* mout_mpll */ parent = clk_get(&pdev->dev, pdata->srclk_name); if (IS_ERR(parent)) { dev_err(&pdev->dev, "failed to get parent clock(%s) for csis\n", pdata->srclk_name); goto err_clk1; } /* mout_csis */ mout_csis = clk_get(&pdev->dev, "mout_csis"); if (IS_ERR(mout_csis)) { dev_err(&pdev->dev, "failed to get mout_csis clock source\n"); goto err_clk2; } /* sclk_csis */ sclk_csis = clk_get(&pdev->dev, pdata->clk_name); if (IS_ERR(sclk_csis)) { dev_err(&pdev->dev, "failed to get csis(%s) clock source\n", pdata->clk_name); goto err_clk3; } clk_set_parent(mout_csis, parent); clk_set_parent(sclk_csis, mout_csis); clk_enable(sclk_csis); return 0; err_clk3: clk_put(mout_csis); err_clk2: clk_put(parent); err_clk1: return -EINVAL; } int s3c_csis_clk_off(struct platform_device *pdev, struct clk **clk) { struct clk *sclk_csis = NULL; struct s3c_platform_csis *pdata; pdata = to_csis_plat(&pdev->dev); /* sclk_csis */ sclk_csis = clk_get(&pdev->dev, pdata->clk_name); if (IS_ERR(sclk_csis)) { dev_err(&pdev->dev, "failed to get csis clock(%s) source\n", pdata->srclk_name); return -EINVAL; } /* clock disable for csis */ clk_disable(sclk_csis); return 0; }
//===-- sanitizer_atomic_msvc.h ---------------------------------*- C++ -*-===// // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of ThreadSanitizer/AddressSanitizer runtime. // Not intended for direct inclusion. Include sanitizer_atomic.h. // //===----------------------------------------------------------------------===// #ifndef SANITIZER_ATOMIC_MSVC_H #define SANITIZER_ATOMIC_MSVC_H extern "C" void _ReadWriteBarrier(); #pragma intrinsic(_ReadWriteBarrier) extern "C" void _mm_mfence(); #pragma intrinsic(_mm_mfence) extern "C" void _mm_pause(); #pragma intrinsic(_mm_pause) extern "C" long _InterlockedExchangeAdd( // NOLINT long volatile * Addend, long Value); // NOLINT #pragma intrinsic(_InterlockedExchangeAdd) #ifdef _WIN64 extern "C" void *_InterlockedCompareExchangePointer( void *volatile *Destination, void *Exchange, void *Comparand); #pragma intrinsic(_InterlockedCompareExchangePointer) #else // There's no _InterlockedCompareExchangePointer intrinsic on x86, // so call _InterlockedCompareExchange instead. extern "C" long __cdecl _InterlockedCompareExchange( // NOLINT long volatile *Destination, // NOLINT long Exchange, long Comparand); // NOLINT #pragma intrinsic(_InterlockedCompareExchange) inline static void *_InterlockedCompareExchangePointer( void *volatile *Destination, void *Exchange, void *Comparand) { return reinterpret_cast<void*>( _InterlockedCompareExchange( reinterpret_cast<long volatile*>(Destination), // NOLINT reinterpret_cast<long>(Exchange), // NOLINT reinterpret_cast<long>(Comparand))); // NOLINT } #endif namespace __sanitizer { INLINE void atomic_signal_fence(memory_order) { _ReadWriteBarrier(); } INLINE void atomic_thread_fence(memory_order) { _mm_mfence(); } INLINE void proc_yield(int cnt) { for (int i = 0; i < cnt; i++) _mm_pause(); } template<typename T> INLINE typename T::Type atomic_load( const volatile T *a, memory_order mo) { DCHECK(mo & (memory_order_relaxed | memory_order_consume | memory_order_acquire | memory_order_seq_cst)); DCHECK(!((uptr)a % sizeof(*a))); typename T::Type v; // FIXME(dvyukov): 64-bit load is not atomic on 32-bits. if (mo == memory_order_relaxed) { v = a->val_dont_use; } else { atomic_signal_fence(memory_order_seq_cst); v = a->val_dont_use; atomic_signal_fence(memory_order_seq_cst); } return v; } template<typename T> INLINE void atomic_store(volatile T *a, typename T::Type v, memory_order mo) { DCHECK(mo & (memory_order_relaxed | memory_order_release | memory_order_seq_cst)); DCHECK(!((uptr)a % sizeof(*a))); // FIXME(dvyukov): 64-bit store is not atomic on 32-bits. if (mo == memory_order_relaxed) { a->val_dont_use = v; } else { atomic_signal_fence(memory_order_seq_cst); a->val_dont_use = v; atomic_signal_fence(memory_order_seq_cst); } if (mo == memory_order_seq_cst) atomic_thread_fence(memory_order_seq_cst); } INLINE u32 atomic_fetch_add(volatile atomic_uint32_t *a, u32 v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); return (u32)_InterlockedExchangeAdd( (volatile long*)&a->val_dont_use, (long)v); // NOLINT } INLINE u8 atomic_exchange(volatile atomic_uint8_t *a, u8 v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); __asm { mov eax, a mov cl, v xchg [eax], cl // NOLINT mov v, cl } return v; } INLINE u16 atomic_exchange(volatile atomic_uint16_t *a, u16 v, memory_order mo) { (void)mo; DCHECK(!((uptr)a % sizeof(*a))); __asm { mov eax, a mov cx, v xchg [eax], cx // NOLINT mov v, cx } return v; } INLINE bool atomic_compare_exchange_strong(volatile atomic_uintptr_t *a, uptr *cmp, uptr xchg, memory_order mo) { uptr cmpv = *cmp; uptr prev = (uptr)_InterlockedCompareExchangePointer( (void*volatile*)&a->val_dont_use, (void*)xchg, (void*)cmpv); if (prev == cmpv) return true; *cmp = prev; return false; } template<typename T> INLINE bool atomic_compare_exchange_weak(volatile T *a, typename T::Type *cmp, typename T::Type xchg, memory_order mo) { return atomic_compare_exchange_strong(a, cmp, xchg, mo); } } // namespace __sanitizer #endif // SANITIZER_ATOMIC_CLANG_H
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2008 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 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 - Suite 500, Boston, MA 02110-1335, USA. * */ #ifndef __GVC_MIXER_SINK_INPUT_H #define __GVC_MIXER_SINK_INPUT_H #include <glib-object.h> #include "gvc-mixer-stream.h" G_BEGIN_DECLS #define GVC_TYPE_MIXER_SINK_INPUT (gvc_mixer_sink_input_get_type ()) #define GVC_MIXER_SINK_INPUT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GVC_TYPE_MIXER_SINK_INPUT, GvcMixerSinkInput)) #define GVC_MIXER_SINK_INPUT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GVC_TYPE_MIXER_SINK_INPUT, GvcMixerSinkInputClass)) #define GVC_IS_MIXER_SINK_INPUT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GVC_TYPE_MIXER_SINK_INPUT)) #define GVC_IS_MIXER_SINK_INPUT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GVC_TYPE_MIXER_SINK_INPUT)) #define GVC_MIXER_SINK_INPUT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GVC_TYPE_MIXER_SINK_INPUT, GvcMixerSinkInputClass)) typedef struct GvcMixerSinkInputPrivate GvcMixerSinkInputPrivate; typedef struct { GvcMixerStream parent; GvcMixerSinkInputPrivate *priv; } GvcMixerSinkInput; typedef struct { GvcMixerStreamClass parent_class; } GvcMixerSinkInputClass; GType gvc_mixer_sink_input_get_type (void); GvcMixerStream * gvc_mixer_sink_input_new (pa_context *context, guint index, GvcChannelMap *map); G_END_DECLS #endif /* __GVC_MIXER_SINK_INPUT_H */
// // PNBar.h // PNChartDemo // // Created by kevin on 11/7/13. // Copyright (c) 2013年 kevinzhow. All rights reserved. // #import <UIKit/UIKit.h> #import <QuartzCore/QuartzCore.h> @interface PNBar : UIView - (void)rollBack; @property (nonatomic) float grade; @property (nonatomic) float maxDivisor; @property (nonatomic) CAShapeLayer *chartLine; @property (nonatomic) UIColor *barColor; @property (nonatomic) UIColor *barColorGradientStart; @property (nonatomic) CGFloat barRadius; @property (nonatomic) CAShapeLayer *gradientMask; @property (nonatomic) CAShapeLayer *gradeLayer; @property (nonatomic) CATextLayer* textLayer; /** Text color for all bars in the chart. */ @property (nonatomic) UIColor * labelTextColor; @property (nonatomic, assign) BOOL isNegative; //!< 是否是负数 @property (nonatomic, assign) BOOL isShowNumber; //!< 是否显示numbers /** Display the bar with or without animation. Default is YES. **/ @property (nonatomic) BOOL displayAnimated; @end
// // ScreenNode.h // Sample // // Created by Huy Nguyen on 16/09/15. // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // // 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 // FACEBOOK 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. // #import <AsyncDisplayKit/AsyncDisplayKit.h> @interface ScreenNode : ASDisplayNode @property (nonatomic, strong) ASMultiplexImageNode *imageNode; @property (nonatomic, strong) ASButtonNode *buttonNode; - (void)start; - (void)reload; @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 NET_DISK_CACHE_SIMPLE_SIMPLE_TEST_UTIL_H_ #define NET_DISK_CACHE_SIMPLE_SIMPLE_TEST_UTIL_H_ #include <string> #include "base/basictypes.h" #include "base/callback.h" namespace base { class FilePath; } namespace disk_cache { namespace simple_util { // Immutable array with compile-time bound-checking. template <typename T, size_t Size> class ImmutableArray { public: static const size_t size = Size; ImmutableArray(const base::Callback<T (size_t index)>& initializer) { for (size_t i = 0; i < size; ++i) data_[i] = initializer.Run(i); } template <size_t Index> const T& at() const { static_assert(Index < size, "array out of bounds"); return data_[Index]; } private: T data_[size]; }; // Creates a corrupt file to be used in tests. bool CreateCorruptFileForTests(const std::string& key, const base::FilePath& cache_path); } // namespace simple_backend } // namespace disk_cache #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_TEST_UTIL_H_
extern void highbank_smc1(int fn, int arg);
/*************************************************************************** qgsreclassifyutils.h --------------------- begin : June, 2018 copyright : (C) 2018 by Nyall Dawson email : nyall dot dawson at gmail dot 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. * * * ***************************************************************************/ #ifndef QGSRECLASSIFYUTILS #define QGSRECLASSIFYUTILS #define SIP_NO_FILE #include "qgis_sip.h" #include "qgis_analysis.h" #include "qgsrasterrange.h" #include <QVector> class QgsRasterInterface; class QgsProcessingFeedback; class QgsRasterDataProvider; class QgsRectangle; ///@cond PRIVATE /** * Utility functions for reclassifying raster layers. * \ingroup analysis * \since QGIS 3.2 */ class ANALYSIS_EXPORT QgsReclassifyUtils { public: /** * Represents a single class for a reclassification operation. */ class RasterClass : public QgsRasterRange { public: //! Default constructor for an empty class RasterClass() = default; /** * Constructor for RasterClass, with the specified range of min to max values. * The \a value argument gives the desired output value for this raster class. */ RasterClass( double minValue, double maxValue, QgsRasterRange::BoundsType type, double value ) : QgsRasterRange( minValue, maxValue, type ) , value( value ) {} //! Desired output value for class double value = 0; }; /** * Prints a list of classes contained within \a classes to specified \a feedback object. */ static void reportClasses( const QVector< RasterClass > &classes, QgsProcessingFeedback *feedback ); /** * Checks for overlaps in a set of \a classes, reporting any overlapping * classes the to specified \a feedback object. */ static void checkForOverlaps( const QVector< RasterClass > &classes, QgsProcessingFeedback *feedback ); /** * Performs a reclassification operation on a raster source \a sourceRaster, reclassifying to the given * list of \a classes. * * Parameters of the raster must be given by the \a band, \a extent, \a sourceWidthPixels and * \a sourceHeightPixels values. * * The raster data provider \a destinationRaster will be used to save the result of the * reclassification operation. The caller is responsible for ensuring that this data provider * has been created with the same extent, pixel dimensions and CRS as the input raster. * * The nodata value for the destination should be specified via \a destNoDataValue. This * will be used wherever the source raster has a no data value or a source pixel value * does not have a matching class. * * If \a useNoDataForMissingValues is TRUE, then any raster values which do not match to * a class will be changed to the no data value. Otherwise they are saved unchanged. * * The \a feedback argument gives an optional processing feedback, for progress reports * and cancellation. */ static void reclassify( const QVector< RasterClass > &classes, QgsRasterInterface *sourceRaster, int band, const QgsRectangle &extent, int sourceWidthPixels, int sourceHeightPixels, QgsRasterDataProvider *destinationRaster, double destNoDataValue, bool useNoDataForMissingValues, QgsProcessingFeedback *feedback = nullptr ); /** * Reclassifies a single \a input value, using the specified list of \a classes. * * If a matching class was found, then \a reclassified will be set to TRUE and the * class output value returned. * * If no matching class was found then \a reclassified will be set to FALSE, and the * original \a input value returned unchanged. */ static double reclassifyValue( const QVector< RasterClass > &classes, double input, bool &reclassified ) { reclassified = false; for ( const QgsReclassifyUtils::RasterClass &c : classes ) { if ( c.contains( input ) ) { reclassified = true; return c.value; } } return input; } }; Q_DECLARE_TYPEINFO( QgsReclassifyUtils::RasterClass, Q_MOVABLE_TYPE ); ///@endcond PRIVATE #endif // QGSRECLASSIFYUTILS
/* * Copyright (c) 2010, * Gavriloaie Eugen-Andrei (shiretu@gmail.com) * * This file is part of crtmpserver. * crtmpserver 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. * * crtmpserver 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 crtmpserver. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAS_PROTOCOL_HTTP #ifndef _HTTPAPPPROTOCOLHANDLER_H #define _HTTPAPPPROTOCOLHANDLER_H #include "protocols/http/basehttpprotocolhandler.h" namespace app_appselector { class HTTPAppProtocolHandler : public BaseHTTPAppProtocolHandler { public: HTTPAppProtocolHandler(Variant &configuration); virtual ~HTTPAppProtocolHandler(); }; } #endif /* _HTTPAPPPROTOCOLHANDLER_H */ #endif /* HAS_PROTOCOL_HTTP */
// 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_COMMON_INPUT_SYNTHETIC_PINCH_GESTURE_PARAMS_H_ #define CONTENT_COMMON_INPUT_SYNTHETIC_PINCH_GESTURE_PARAMS_H_ #include "content/common/content_export.h" #include "content/common/input/synthetic_gesture_params.h" #include "ui/gfx/point.h" namespace content { struct CONTENT_EXPORT SyntheticPinchGestureParams : public SyntheticGestureParams { public: SyntheticPinchGestureParams(); SyntheticPinchGestureParams( const SyntheticPinchGestureParams& other); virtual ~SyntheticPinchGestureParams(); virtual GestureType GetGestureType() const OVERRIDE; bool zoom_in; int total_num_pixels_covered; gfx::Point anchor; int relative_pointer_speed_in_pixels_s; static const SyntheticPinchGestureParams* Cast( const SyntheticGestureParams* gesture_params); }; } // namespace content #endif // CONTENT_COMMON_INPUT_SYNTHETIC_PINCH_GESTURE_PARAMS_H_
/* PR tree-optimization/71563 */ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ void link_error (void); void foo (int k) { int t = 1 << ((1 / k) << 8); if (t != 1) link_error (); } void bar (int k, int l) { int t = l << (k << 8); if (t != l) link_error (); } /* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */
/* Copyright (c) 2014 Wirebird Labs LLC. 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, sublicense, 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 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 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 NN_SHA1_INCLUDED #define NN_SHA1_INCLUDED #include "../../utils/int.h" /*****************************************************************************/ /* SHA-1 SECURITY NOTICE: */ /* The algorithm as designed below is not intended for general purpose use. */ /* As-designed, it is a single-purpose function for this WebSocket */ /* Opening Handshake. As per RFC 6455 10.8, SHA-1 usage "doesn't depend on */ /* any security properties of SHA-1, such as collision resistance or */ /* resistance to the second pre-image attack (as described in [RFC4270])". */ /* Caveat emptor for uses of this function elsewhere. */ /* */ /* Based on sha1.c (Public Domain) by Steve Reid, these functions calculate */ /* the SHA1 hash of arbitrary byte locations byte-by-byte. */ /*****************************************************************************/ #define SHA1_HASH_LEN 20 #define SHA1_BLOCK_LEN 64 struct nn_sha1 { uint32_t buffer [SHA1_BLOCK_LEN / sizeof (uint32_t)]; uint32_t state [SHA1_HASH_LEN / sizeof (uint32_t)]; uint32_t bytes_hashed; uint8_t buffer_offset; uint8_t is_little_endian; }; void nn_sha1_init (struct nn_sha1 *self); void nn_sha1_hashbyte (struct nn_sha1 *self, uint8_t data); uint8_t* nn_sha1_result (struct nn_sha1 *self); #endif
// Copyright 2012 Google Inc. All Rights Reserved. // // This code is licensed under the same terms as WebM: // Software License Agreement: http://www.webmproject.org/license/software/ // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ // ----------------------------------------------------------------------------- // // Image transforms and color space conversion methods for lossless decoder. // // Authors: Vikas Arora (vikaas.arora@gmail.com) // Jyrki Alakuijala (jyrki@google.com) #ifndef WEBP_DSP_LOSSLESS_H_ #define WEBP_DSP_LOSSLESS_H_ #include "../webp/types.h" #include "../webp/decode.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif //------------------------------------------------------------------------------ // Image transforms. struct VP8LTransform; // Defined in dec/vp8li.h. // Performs inverse transform of data given transform information, start and end // rows. Transform will be applied to rows [row_start, row_end[. // The *in and *out pointers refer to source and destination data respectively // corresponding to the intermediate row (row_start). void VP8LInverseTransform(const struct VP8LTransform* const transform, int row_start, int row_end, const uint32_t* const in, uint32_t* const out); // Similar to the static method ColorIndexInverseTransform() that is part of // lossless.c, but used only for alpha decoding. It takes uint8_t (rather than // uint32_t) arguments for 'src' and 'dst'. void VP8LColorIndexInverseTransformAlpha( const struct VP8LTransform* const transform, int y_start, int y_end, const uint8_t* src, uint8_t* dst); // Subtracts green from blue and red channels. void VP8LSubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixs); void VP8LResidualImage(int width, int height, int bits, uint32_t* const argb, uint32_t* const argb_scratch, uint32_t* const image); void VP8LColorSpaceTransform(int width, int height, int bits, int step, uint32_t* const argb, uint32_t* image); //------------------------------------------------------------------------------ // Color space conversion. // Converts from BGRA to other color spaces. void VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels, WEBP_CSP_MODE out_colorspace, uint8_t* const rgba); //------------------------------------------------------------------------------ // Misc methods. // Computes sampled size of 'size' when sampling using 'sampling bits'. static WEBP_INLINE uint32_t VP8LSubSampleSize(uint32_t size, uint32_t sampling_bits) { return (size + (1 << sampling_bits) - 1) >> sampling_bits; } // Faster logarithm for integers. Small values use a look-up table. #define LOG_LOOKUP_IDX_MAX 256 extern const float kLog2Table[LOG_LOOKUP_IDX_MAX]; extern const float kSLog2Table[LOG_LOOKUP_IDX_MAX]; extern float VP8LFastLog2Slow(int v); extern float VP8LFastSLog2Slow(int v); static WEBP_INLINE float VP8LFastLog2(int v) { return (v < LOG_LOOKUP_IDX_MAX) ? kLog2Table[v] : VP8LFastLog2Slow(v); } // Fast calculation of v * log2(v) for integer input. static WEBP_INLINE float VP8LFastSLog2(int v) { return (v < LOG_LOOKUP_IDX_MAX) ? kSLog2Table[v] : VP8LFastSLog2Slow(v); } // In-place difference of each component with mod 256. static WEBP_INLINE uint32_t VP8LSubPixels(uint32_t a, uint32_t b) { const uint32_t alpha_and_green = 0x00ff00ffu + (a & 0xff00ff00u) - (b & 0xff00ff00u); const uint32_t red_and_blue = 0xff00ff00u + (a & 0x00ff00ffu) - (b & 0x00ff00ffu); return (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu); } void VP8LBundleColorMap(const uint8_t* const row, int width, int xbits, uint32_t* const dst); //------------------------------------------------------------------------------ #if defined(__cplusplus) || defined(c_plusplus) } // extern "C" #endif #endif // WEBP_DSP_LOSSLESS_H_
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- /// @file AP_L1_Control.h /// @brief L1 Control algorithm. This is a instance of an /// AP_Navigation class /* * Originally written by Brandon Jones 2013 * * Modified by Paul Riseborough 2013 to provide: * - Explicit control over frequency and damping * - Explicit control over track capture angle * - Ability to use loiter radius smaller than L1 length */ #ifndef AP_L1_CONTROL_H #define AP_L1_CONTROL_H #include <AP_Math.h> #include <AP_AHRS.h> #include <AP_Param.h> #include <AP_Navigation.h> class AP_L1_Control : public AP_Navigation { public: AP_L1_Control(AP_AHRS &ahrs) : _ahrs(ahrs) { AP_Param::setup_object_defaults(this, var_info); } /* see AP_Navigation.h for the definitions and units of these * functions */ int32_t nav_roll_cd(void) const; float lateral_acceleration(void) const; // return the desired track heading angle(centi-degrees) int32_t nav_bearing_cd(void) const; // return the heading error angle (centi-degrees) +ve to left of track int32_t bearing_error_cd(void) const; float crosstrack_error(void) const; int32_t target_bearing_cd(void) const; float turn_distance(float wp_radius) const; void update_waypoint(const struct Location &prev_WP, const struct Location &next_WP); void update_loiter(const struct Location &center_WP, float radius, int8_t loiter_direction); void update_heading_hold(int32_t navigation_heading_cd); void update_level_flight(void); bool reached_loiter_target(void); // set the default NAVL1_PERIOD void set_default_period(float period) { if (!_L1_period.load()) { _L1_period.set(period); } } // this supports the NAVl1_* user settable parameters static const struct AP_Param::GroupInfo var_info[]; private: // reference to the AHRS object AP_AHRS &_ahrs; // lateral acceration in m/s required to fly to the // L1 reference point (+ve to right) float _latAccDem; // L1 tracking distance in meters which is dynamically updated float _L1_dist; // Status which is true when the vehicle has started circling the WP bool _WPcircle; // bearing angle (radians) to L1 point float _nav_bearing; // bearing error angle (radians) +ve to left of track float _bearing_error; // crosstrack error in meters float _crosstrack_error; // target bearing in centi-degrees from last update int32_t _target_bearing_cd; // L1 tracking loop period (sec) AP_Float _L1_period; // L1 tracking loop damping ratio AP_Float _L1_damping; // previous value of cross-track velocity float _last_Nu; // direction of last xtrack velocity - true positive bool _xtrackVelPos; // prevent indecision in waypoint tracking void _prevent_indecision(float &Nu); }; #endif //AP_L1_CONTROL_H
/* * jdmrgext.c * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2011, 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * * This file contains code for merged upsampling/color conversion. */ /* This file is included by jdmerge.c */ /* * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical. */ INLINE LOCAL(void) h2v1_merged_upsample_internal (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf) { my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; register int y, cred, cgreen, cblue; int cb, cr; register JSAMPROW outptr; JSAMPROW inptr0, inptr1, inptr2; JDIMENSION col; /* copy these pointers into registers if possible */ register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; JLONG * Crgtab = upsample->Cr_g_tab; JLONG * Cbgtab = upsample->Cb_g_tab; SHIFT_TEMPS inptr0 = input_buf[0][in_row_group_ctr]; inptr1 = input_buf[1][in_row_group_ctr]; inptr2 = input_buf[2][in_row_group_ctr]; outptr = output_buf[0]; /* Loop for each pair of output pixels */ for (col = cinfo->output_width >> 1; col > 0; col--) { /* Do the chroma part of the calculation */ cb = GETJSAMPLE(*inptr1++); cr = GETJSAMPLE(*inptr2++); cred = Crrtab[cr]; cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); cblue = Cbbtab[cb]; /* Fetch 2 Y values and emit 2 pixels */ y = GETJSAMPLE(*inptr0++); outptr[RGB_RED] = range_limit[y + cred]; outptr[RGB_GREEN] = range_limit[y + cgreen]; outptr[RGB_BLUE] = range_limit[y + cblue]; #ifdef RGB_ALPHA outptr[RGB_ALPHA] = 0xFF; #endif outptr += RGB_PIXELSIZE; y = GETJSAMPLE(*inptr0++); outptr[RGB_RED] = range_limit[y + cred]; outptr[RGB_GREEN] = range_limit[y + cgreen]; outptr[RGB_BLUE] = range_limit[y + cblue]; #ifdef RGB_ALPHA outptr[RGB_ALPHA] = 0xFF; #endif outptr += RGB_PIXELSIZE; } /* If image width is odd, do the last output column separately */ if (cinfo->output_width & 1) { cb = GETJSAMPLE(*inptr1); cr = GETJSAMPLE(*inptr2); cred = Crrtab[cr]; cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); cblue = Cbbtab[cb]; y = GETJSAMPLE(*inptr0); outptr[RGB_RED] = range_limit[y + cred]; outptr[RGB_GREEN] = range_limit[y + cgreen]; outptr[RGB_BLUE] = range_limit[y + cblue]; #ifdef RGB_ALPHA outptr[RGB_ALPHA] = 0xFF; #endif } } /* * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. */ INLINE LOCAL(void) h2v2_merged_upsample_internal (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf) { my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; register int y, cred, cgreen, cblue; int cb, cr; register JSAMPROW outptr0, outptr1; JSAMPROW inptr00, inptr01, inptr1, inptr2; JDIMENSION col; /* copy these pointers into registers if possible */ register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; JLONG * Crgtab = upsample->Cr_g_tab; JLONG * Cbgtab = upsample->Cb_g_tab; SHIFT_TEMPS inptr00 = input_buf[0][in_row_group_ctr*2]; inptr01 = input_buf[0][in_row_group_ctr*2 + 1]; inptr1 = input_buf[1][in_row_group_ctr]; inptr2 = input_buf[2][in_row_group_ctr]; outptr0 = output_buf[0]; outptr1 = output_buf[1]; /* Loop for each group of output pixels */ for (col = cinfo->output_width >> 1; col > 0; col--) { /* Do the chroma part of the calculation */ cb = GETJSAMPLE(*inptr1++); cr = GETJSAMPLE(*inptr2++); cred = Crrtab[cr]; cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); cblue = Cbbtab[cb]; /* Fetch 4 Y values and emit 4 pixels */ y = GETJSAMPLE(*inptr00++); outptr0[RGB_RED] = range_limit[y + cred]; outptr0[RGB_GREEN] = range_limit[y + cgreen]; outptr0[RGB_BLUE] = range_limit[y + cblue]; #ifdef RGB_ALPHA outptr0[RGB_ALPHA] = 0xFF; #endif outptr0 += RGB_PIXELSIZE; y = GETJSAMPLE(*inptr00++); outptr0[RGB_RED] = range_limit[y + cred]; outptr0[RGB_GREEN] = range_limit[y + cgreen]; outptr0[RGB_BLUE] = range_limit[y + cblue]; #ifdef RGB_ALPHA outptr0[RGB_ALPHA] = 0xFF; #endif outptr0 += RGB_PIXELSIZE; y = GETJSAMPLE(*inptr01++); outptr1[RGB_RED] = range_limit[y + cred]; outptr1[RGB_GREEN] = range_limit[y + cgreen]; outptr1[RGB_BLUE] = range_limit[y + cblue]; #ifdef RGB_ALPHA outptr1[RGB_ALPHA] = 0xFF; #endif outptr1 += RGB_PIXELSIZE; y = GETJSAMPLE(*inptr01++); outptr1[RGB_RED] = range_limit[y + cred]; outptr1[RGB_GREEN] = range_limit[y + cgreen]; outptr1[RGB_BLUE] = range_limit[y + cblue]; #ifdef RGB_ALPHA outptr1[RGB_ALPHA] = 0xFF; #endif outptr1 += RGB_PIXELSIZE; } /* If image width is odd, do the last output column separately */ if (cinfo->output_width & 1) { cb = GETJSAMPLE(*inptr1); cr = GETJSAMPLE(*inptr2); cred = Crrtab[cr]; cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); cblue = Cbbtab[cb]; y = GETJSAMPLE(*inptr00); outptr0[RGB_RED] = range_limit[y + cred]; outptr0[RGB_GREEN] = range_limit[y + cgreen]; outptr0[RGB_BLUE] = range_limit[y + cblue]; #ifdef RGB_ALPHA outptr0[RGB_ALPHA] = 0xFF; #endif y = GETJSAMPLE(*inptr01); outptr1[RGB_RED] = range_limit[y + cred]; outptr1[RGB_GREEN] = range_limit[y + cgreen]; outptr1[RGB_BLUE] = range_limit[y + cblue]; #ifdef RGB_ALPHA outptr1[RGB_ALPHA] = 0xFF; #endif } }
/* * Copyright (C) 2007-2015 Team Kodi * http://kodi.tv * * 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, 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 Kodi; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #pragma once #include "system.h" #if defined(TARGET_ANDROID) #include "cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.h" class CRendererMediaCodecSurface : public CLinuxRendererGLES { public: CRendererMediaCodecSurface(); virtual ~CRendererMediaCodecSurface(); virtual bool RenderCapture(CRenderCapture* capture); // Player functions virtual void AddVideoPictureHW(DVDVideoPicture &picture, int index); virtual void ReleaseBuffer(int idx); virtual bool IsGuiLayer(); // Feature support virtual bool Supports(EINTERLACEMETHOD method); virtual bool Supports(EDEINTERLACEMODE mode); virtual EINTERLACEMETHOD AutoInterlaceMethod(); virtual CRenderInfo GetRenderInfo(); protected: // textures virtual bool UploadTexture(int index); virtual void DeleteTexture(int index); virtual bool CreateTexture(int index); // hooks for hw dec renderer virtual bool LoadShadersHook(); virtual bool RenderHook(int index); virtual int GetImageHook(YV12Image *image, int source = AUTOSOURCE, bool readonly = false); virtual bool RenderUpdateVideoHook(bool clear, DWORD flags = 0, DWORD alpha = 255); }; #endif
/* * * Copyright 2015 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef GRPCXX_CREATE_CHANNEL_H #define GRPCXX_CREATE_CHANNEL_H #include <memory> #include <grpc++/channel.h> #include <grpc++/security/credentials.h> #include <grpc++/support/channel_arguments.h> #include <grpc++/support/config.h> namespace grpc { /// Create a new \a Channel pointing to \a target. /// /// \param target The URI of the endpoint to connect to. /// \param creds Credentials to use for the created channel. If it does not /// hold an object or is invalid, a lame channel (one on which all operations /// fail) is returned. std::shared_ptr<Channel> CreateChannel( const grpc::string& target, const std::shared_ptr<ChannelCredentials>& creds); /// Create a new \em custom \a Channel pointing to \a target. /// /// \warning For advanced use and testing ONLY. Override default channel /// arguments only if necessary. /// /// \param target The URI of the endpoint to connect to. /// \param creds Credentials to use for the created channel. If it does not /// hold an object or is invalid, a lame channel (one on which all operations /// fail) is returned. /// \param args Options for channel creation. std::shared_ptr<Channel> CreateCustomChannel( const grpc::string& target, const std::shared_ptr<ChannelCredentials>& creds, const ChannelArguments& args); } // namespace grpc #endif // GRPCXX_CREATE_CHANNEL_H
#ifndef MYCLASS_H #define MYCLASS_H #include "Core/OO.h" #include "Structure/Array.h" RClass(MyClass) { RInherit(RObject); int Prop1; int Prop2; Array_Define(int, MyArray); }; RInterface_Define(int, IObject_Method, void*); int MyClass_Method(MyClass* This); #endif
/**************************************************************************** * * Copyright 2016 Samsung Electronics All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * include/sys/ipc.h * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ #ifndef __INCLUDE_SYS_IPC_H #define __INCLUDE_SYS_IPC_H /**************************************************************************** * Included Files ****************************************************************************/ #include <tinyara/config.h> #include <sys/types.h> /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ /* Mode bits: The lower order 9-bit bits are the standard mode bits */ #define IPC_MODE 0x01ff /* Mode bit mask */ #define IPC_CREAT (1 << 10) /* Create entry if key does not exist */ #define IPC_EXCL (1 << 11) /* Fail if key exists */ #define IPC_NOWAIT (1 << 12) /* Error if request must wait */ /* Keys: */ #define IPC_PRIVATE 0 /* Private key */ /* Control commands: */ #define IPC_RMID 0 /* Remove identifier */ #define IPC_SET 1 /* Set options */ #define IPC_STAT 2 /* Get options */ /**************************************************************************** * Public Type Definitions ****************************************************************************/ /**************************************************************************** * Public Data ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" extern "C" { #else #define EXTERN extern #endif /* The ipc_perm structure is used by three mechanisms for XSI interprocess * communication (IPC): messages, semaphores, and shared memory. All use a * common structure type, ipc_perm, to pass information used in determining * permission to perform an IPC operation. */ struct ipc_perm { #if 0 /* User and group IDs not yet supported by NuttX */ uid_t uid; /* Owner's user ID */ gid_t gid; /* Owner's group ID */ uid_t cuid; /* Creator's user ID */ gid_t cgid; /* Creator's group ID */ #endif mode_t mode; /* Read/write permission */ }; /**************************************************************************** * Public Function Prototypes ****************************************************************************/ key_t ftok(FAR const char *path, int id); #undef EXTERN #if defined(__cplusplus) } #endif #endif /* __INCLUDE_SYS_IPC_H */
/* * PXA27x register declarations and HCD data structures * * Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it> * Copyright (C) 2007 Eurotech S.p.A. <info@eurotech.it> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #ifndef __PXA270X_UDC_H__ #define __PXA270X_UDC_H__ #include <asm/byteorder.h> /* Endpoint 0 states */ #define EP0_IDLE 0 #define EP0_IN_DATA 1 #define EP0_OUT_DATA 2 #define EP0_XFER_COMPLETE 3 /* Endpoint parameters */ #define MAX_ENDPOINTS 4 #define EP_MAX_PACKET_SIZE 64 #define EP0_MAX_PACKET_SIZE 16 #define UDC_OUT_ENDPOINT 0x02 #define UDC_OUT_PACKET_SIZE EP_MAX_PACKET_SIZE #define UDC_IN_ENDPOINT 0x01 #define UDC_IN_PACKET_SIZE EP_MAX_PACKET_SIZE #define UDC_INT_ENDPOINT 0x05 #define UDC_INT_PACKET_SIZE EP_MAX_PACKET_SIZE #define UDC_BULK_PACKET_SIZE EP_MAX_PACKET_SIZE void udc_irq(void); /* Flow control */ void udc_set_nak(int epid); void udc_unset_nak(int epid); /* Higher level functions for abstracting away from specific device */ int udc_endpoint_write(struct usb_endpoint_instance *endpoint); int udc_init(void); void udc_enable(struct usb_device_instance *device); void udc_disable(void); void udc_connect(void); void udc_disconnect(void); void udc_startup_events(struct usb_device_instance *device); void udc_setup_ep(struct usb_device_instance *device, unsigned int ep, struct usb_endpoint_instance *endpoint); #endif
// // MCORFC822.h // mailcore2 // // Created by DINH Viêt Hoà on 3/22/13. // Copyright (c) 2013 MailCore. All rights reserved. // #ifndef MAILCORE_MCORFC822_H #define MAILCORE_MCORFC822_H #import <MailCore/MCOAttachment.h> #import <MailCore/MCOMessageBuilder.h> #import <MailCore/MCOMessageParser.h> #import <MailCore/MCOMessagePart.h> #import <MailCore/MCOMultipart.h> #endif
/* Copyright (c) 2013, 2016, 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, 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ #ifndef MYSQL_PLUGIN_GROUP_REPLICATION_INCLUDED #define MYSQL_PLUGIN_GROUP_REPLICATION_INCLUDED /* API for Group Peplication plugin. (MYSQL_GROUP_REPLICATION_PLUGIN) */ #include <mysql/plugin.h> #define MYSQL_GROUP_REPLICATION_INTERFACE_VERSION 0x0101 /* Callbacks for get_connection_status_info function. context field can have NULL value, plugin will always pass it through all callbacks, independent of its value. Its value will not be used by plugin. All callbacks are mandatory. */ typedef struct st_group_replication_connection_status_callbacks { void* const context; void (*set_channel_name)(void* const context, const char& value, size_t length); void (*set_group_name)(void* const context, const char& value, size_t length); void (*set_source_uuid)(void* const context, const char& value, size_t length); void (*set_service_state)(void* const context, bool state); } GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS; /* Callbacks for get_group_members_info function. context field can have NULL value, plugin will always pass it through all callbacks, independent of its value. Its value will not be used by plugin. All callbacks are mandatory. */ typedef struct st_group_replication_group_members_callbacks { void* const context; void (*set_channel_name)(void* const context, const char& value, size_t length); void (*set_member_id)(void* const context, const char& value, size_t length); void (*set_member_host)(void* const context, const char& value, size_t length); void (*set_member_port)(void* const context, unsigned int value); void (*set_member_state)(void* const context, const char& value, size_t length); } GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS; /* Callbacks for get_group_member_stats_info function. context field can have NULL value, plugin will always pass it through all callbacks, independent of its value. Its value will not be used by plugin. All callbacks are mandatory. */ typedef struct st_group_replication_member_stats_callbacks { void* const context; void (*set_channel_name)(void* const context, const char& value, size_t length); void (*set_view_id)(void* const context, const char& value, size_t length); void (*set_member_id)(void* const context, const char& value, size_t length); void (*set_transactions_committed)(void* const context, const char& value, size_t length); void (*set_last_conflict_free_transaction)(void* const context, const char& value, size_t length); void (*set_transactions_in_queue)(void* const context, unsigned long long int value); void (*set_transactions_certified)(void* const context, unsigned long long int value); void (*set_transactions_conflicts_detected)(void* const context, unsigned long long int value); void (*set_transactions_rows_in_validation)(void* const context, unsigned long long int value); } GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS; struct st_mysql_group_replication { int interface_version; /* This function is used to start the group replication. */ int (*start)(); /* This function is used to stop the group replication. */ int (*stop)(); /* This function is used to get the current group replication running status. */ bool (*is_running)(); /* This function initializes conflict checking module with info received from group on this member. @param info View_change_log_event with conflict checking info. */ int (*set_retrieved_certification_info)(void* info); /* This function is used to fetch information for group replication kernel stats. @param callbacks The set of callbacks and its context used to set the information on caller. @note The caller is responsible to free memory from the info structure and from all its fields. */ bool (*get_connection_status_info) (const GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS& callbacks); /* This function is used to fetch information for group replication members. @param callbacks The set of callbacks and its context used to set the information on caller. @note The caller is responsible to free memory from the info structure and from all its fields. */ bool (*get_group_members_info) (unsigned int index, const GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS& callbacks); /* This function is used to fetch information for group replication members statistics. @param callbacks The set of callbacks and its context used to set the information on caller. @note The caller is responsible to free memory from the info structure and from all its fields. */ bool (*get_group_member_stats_info) (const GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS& callbacks); /* Get number of group replication members. */ unsigned int (*get_members_number_info)(); }; #endif
/* * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. * * Test that timers are not allowed to expire before their scheduled * time. * * Test for a variety of timer values on relative timers. * * For this test, signal SIGTOTEST will be used, clock CLOCK_REALTIME * will be used. */ #include <time.h> #include <signal.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include "posixtest.h" #define SIGTOTEST SIGALRM #define TIMERVALUESEC 2 #define TIMERINTERVALSEC 5 #define INCREMENT 1 #define ACCEPTABLEDELTA 1 #define NUMTESTS 6 static int timeroffsets[NUMTESTS][2] = { {0, 30000000}, {1, 0}, {1, 30000000}, {2, 0}, {1, 5000}, {1, 5} }; int main(void) { struct sigevent ev; timer_t tid; struct itimerspec its; struct timespec tsbefore, tsafter; sigset_t set; int sig; int i; int failure = 0; unsigned long totalnsecs, testnsecs; // so long was we are < 2.1 seconds, we should be safe /* * set up signal set containing SIGTOTEST that will be used * in call to sigwait immediately after timer is set */ if (sigemptyset(&set) == -1) { perror("sigemptyset() failed\n"); return PTS_UNRESOLVED; } if (sigaddset(&set, SIGTOTEST) == -1) { perror("sigaddset() failed\n"); return PTS_UNRESOLVED; } if (sigprocmask(SIG_BLOCK, &set, NULL) == -1) { perror("sigprocmask() failed\n"); return PTS_UNRESOLVED; } /* * set up timer to perform action SIGTOTEST on expiration */ ev.sigev_notify = SIGEV_SIGNAL; ev.sigev_signo = SIGTOTEST; if (timer_create(CLOCK_REALTIME, &ev, &tid) != 0) { perror("timer_create() did not return success\n"); return PTS_UNRESOLVED; } for (i = 0; i < NUMTESTS; i++) { its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; its.it_value.tv_sec = timeroffsets[i][0]; its.it_value.tv_nsec = timeroffsets[i][1]; printf("Test for value %d sec %d nsec\n", (int)its.it_value.tv_sec, (int)its.it_value.tv_nsec); if (clock_gettime(CLOCK_REALTIME, &tsbefore) != 0) { perror("clock_gettime() did not return success\n"); return PTS_UNRESOLVED; } if (timer_settime(tid, 0, &its, NULL) != 0) { perror("timer_settime() did not return success\n"); return PTS_UNRESOLVED; } if (sigwait(&set, &sig) == -1) { perror("sigwait() failed\n"); return PTS_UNRESOLVED; } if (clock_gettime(CLOCK_REALTIME, &tsafter) != 0) { perror("clock_gettime() did not return success\n"); return PTS_UNRESOLVED; } totalnsecs = (unsigned long)(tsafter.tv_sec - tsbefore.tv_sec) * 1000000000 + (tsafter.tv_nsec - tsbefore.tv_nsec); testnsecs = (unsigned long)its.it_value.tv_sec * 1000000000 + its.it_value.tv_nsec; printf("total %lu test %lu\n", totalnsecs, testnsecs); if (totalnsecs < testnsecs) { printf("FAIL: Expired %ld < %ld\n", totalnsecs, testnsecs); failure = 1; } } if (timer_delete(tid) != 0) { perror("timer_delete() did not return success\n"); return PTS_UNRESOLVED; } if (failure) { printf("timer_settime() failed on at least one value\n"); return PTS_FAIL; } else { printf("Test PASSED\n"); return PTS_PASS; } }
// Copyright (c) 2011 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 UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_BUTTON_H_ #define UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_BUTTON_H_ #include "ui/views/controls/button/custom_button.h" #include "ui/views/repeat_controller.h" #if defined(OS_LINUX) #include "ui/gfx/screen.h" #endif namespace views { /////////////////////////////////////////////////////////////////////////////// // // ScrollBarButton // // A button that activates on mouse pressed rather than released, and that // continues to fire the clicked action as the mouse button remains pressed // down on the button. // /////////////////////////////////////////////////////////////////////////////// class VIEWS_EXPORT BaseScrollBarButton : public CustomButton { public: explicit BaseScrollBarButton(ButtonListener* listener); ~BaseScrollBarButton() override; protected: bool OnMousePressed(const ui::MouseEvent& event) override; void OnMouseReleased(const ui::MouseEvent& event) override; void OnMouseCaptureLost() override; private: void RepeaterNotifyClick(); // The repeat controller that we use to repeatedly click the button when the // mouse button is down. RepeatController repeater_; DISALLOW_COPY_AND_ASSIGN(BaseScrollBarButton); }; } // namespace views #endif // UI_VIEWS_CONTROLS_SCROLLBAR_BASE_SCROLL_BAR_BUTTON_H_
/* args.c : small frontend to GOption command line argument parser Copyright (C) 1999-2001 Timo Sirainen 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. */ #include "module.h" #include "args.h" static GOptionContext *context = NULL; void args_register(GOptionEntry *options) { if (context == NULL) context = g_option_context_new(""); g_option_context_add_main_entries(context, options, PACKAGE_TARNAME); } void args_execute(int argc, char *argv[]) { GError* error = NULL; if (context == NULL) return; g_option_context_parse(context, &argc, &argv, &error); g_option_context_free(context); context = NULL; if (error != NULL) { printf("%s\n" "Run '%s --help' to see a full list of " "available command line options.\n", error->message, argv[0]); exit(1); } }
/* * linux/arch/h8300/mm/kmap.c * * Based on * linux/arch/m68knommu/mm/kmap.c * * Copyright (C) 2000 Lineo, <davidm@snapgear.com> * Copyright (C) 2000-2002 David McCullough <davidm@snapgear.com> */ #include <linux/mm.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/types.h> #include <linux/vmalloc.h> #include <asm/setup.h> #include <asm/segment.h> #include <asm/page.h> #include <asm/pgalloc.h> #include <asm/io.h> #undef DEBUG #define VIRT_OFFSET (0x01000000) void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) { return (void *)(physaddr + VIRT_OFFSET); } void iounmap(void *addr) { } void __iounmap(void *addr, unsigned long size) { } void kernel_set_cachemode(void *addr, unsigned long size, int cmode) { }
/* * include/asm-mips/mach-tx39xx/ioremap.h * * 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. */ #ifndef __ASM_MACH_TX39XX_IOREMAP_H #define __ASM_MACH_TX39XX_IOREMAP_H #include <linux/types.h> static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) { return phys_addr; } static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, unsigned long flags) { #define TXX9_DIRECTMAP_BASE 0xff000000ul if (offset >= TXX9_DIRECTMAP_BASE && offset < TXX9_DIRECTMAP_BASE + 0xff0000) return (void __iomem *)offset; return NULL; } static inline int plat_iounmap(const volatile void __iomem *addr) { return (unsigned long)addr >= TXX9_DIRECTMAP_BASE; } #endif
//===--- StringSet.h - The LLVM Compiler Driver -----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open // Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // StringSet - A set-like wrapper for the StringMap. // //===----------------------------------------------------------------------===// #ifndef LLVM_ADT_STRINGSET_H #define LLVM_ADT_STRINGSET_H #include "llvm/ADT/StringMap.h" namespace llvm { /// StringSet - A wrapper for StringMap that provides set-like functionality. template <class AllocatorTy = llvm::MallocAllocator> class StringSet : public llvm::StringMap<char, AllocatorTy> { typedef llvm::StringMap<char, AllocatorTy> base; public: std::pair<typename base::iterator, bool> insert(StringRef Key) { assert(!Key.empty()); return base::insert(std::make_pair(Key, '\0')); } }; } #endif // LLVM_ADT_STRINGSET_H
/* { dg-do compile } */ /* { dg-options "-mavx512f -O2" } */ /* { dg-final { scan-assembler-times "vscatterqpd\[ \\t\]+\[^\n\]*zmm\[0-9\]\[^\n\]*zmm\[0-9\]\[^\n\]*{%k\[1-7\]}" 2 } } */ #include <immintrin.h> volatile __m512d src; volatile __m512i idx; volatile __mmask8 m8; double *addr; void extern avx512f_test (void) { _mm512_i64scatter_pd (addr, idx, src, 8); _mm512_mask_i64scatter_pd (addr, m8, idx, src, 8); }
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #ifndef _INT_STORAGE_SQL_H_ #define _INT_STORAGE_SQL_H_ struct storage_data; struct guild_storage; int inter_storage_sql_init(void); void inter_storage_sql_final(void); int inter_storage_delete(uint32 account_id); int inter_guild_storage_delete(int guild_id); int inter_storage_parse_frommap(int fd); int storage_fromsql(uint32 account_id, struct storage_data* p); int storage_tosql(uint32 account_id,struct storage_data *p); int guild_storage_tosql(int guild_id, struct guild_storage *p); #endif /* _INT_STORAGE_SQL_H_ */
/* =========================================================================== Copyright (c) 2010-2015 Darkstar Dev Teams This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ This file is part of DarkStar-server source code. =========================================================================== */ #ifndef _CMENUMERITPACKET_H #define _CMENUMERTIPACKET_H #include "../../common/cbasetypes.h" #include "basic.h" #include "../merit.h" /************************************************************************ * * * * * * ************************************************************************/ class CCharEntity; class CMenuMeritPacket : public CBasicPacket { public: CMenuMeritPacket(CCharEntity* PChar); }; #endif
/* * This file is part of the Micro Python project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George * * 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, sublicense, 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 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 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. */ #include "py/builtin.h" #if MICROPY_PY_IO extern const mp_obj_type_t mp_type_fileio; extern const mp_obj_type_t mp_type_textio; STATIC const mp_map_elem_t mp_module_io_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR__io) }, // Note: mp_builtin_open_obj should be defined by port, it's not // part of the core. { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, #if MICROPY_PY_IO_FILEIO { MP_OBJ_NEW_QSTR(MP_QSTR_FileIO), (mp_obj_t)&mp_type_fileio }, #if MICROPY_CPYTHON_COMPAT { MP_OBJ_NEW_QSTR(MP_QSTR_TextIOWrapper), (mp_obj_t)&mp_type_textio }, #endif #endif { MP_OBJ_NEW_QSTR(MP_QSTR_StringIO), (mp_obj_t)&mp_type_stringio }, #if MICROPY_PY_IO_BYTESIO { MP_OBJ_NEW_QSTR(MP_QSTR_BytesIO), (mp_obj_t)&mp_type_bytesio }, #endif }; STATIC MP_DEFINE_CONST_DICT(mp_module_io_globals, mp_module_io_globals_table); const mp_obj_module_t mp_module_io = { .base = { &mp_type_module }, .name = MP_QSTR__io, .globals = (mp_obj_dict_t*)&mp_module_io_globals, }; #endif
// Copyright 2008 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include "Common/CommonTypes.h" class InputConfig; enum class KeyboardGroup; struct KeyboardStatus; namespace ControllerEmu { class ControlGroup; } namespace Keyboard { void Shutdown(); void Initialize(); void LoadConfig(); InputConfig* GetConfig(); ControllerEmu::ControlGroup* GetGroup(int port, KeyboardGroup group); KeyboardStatus GetStatus(int port); }
/* * nwfilter_gentech_driver.h: generic technology driver include file * * Copyright (C) 2013 Red Hat, Inc. * Copyright (C) 2010 IBM Corp. * Copyright (C) 2010 Stefan Berger * * 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, see * <http://www.gnu.org/licenses/>. * * Author: Stefan Berger <stefanb@us.ibm.com> */ #ifndef __NWFILTER_GENTECH_DRIVER_H # define __NWFILTER_GENTECH_DRIVER_H # include "nwfilter_conf.h" # include "nwfilter_tech_driver.h" virNWFilterTechDriverPtr virNWFilterTechDriverForName(const char *name); int virNWFilterTechDriversInit(bool privileged); void virNWFilterTechDriversShutdown(void); enum instCase { INSTANTIATE_ALWAYS, INSTANTIATE_FOLLOW_NEWFILTER, }; int virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver, const unsigned char *vmuuid, const virDomainNetDef *net); int virNWFilterUpdateInstantiateFilter(virNWFilterDriverStatePtr driver, const unsigned char *vmuuid, const virDomainNetDef *net, bool *skipIface); int virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver, const unsigned char *vmuuid, const char *ifname, int ifindex, const char *linkdev, const virMacAddr *macaddr, const char *filtername, virNWFilterHashTablePtr filterparams); int virNWFilterTeardownFilter(const virDomainNetDef *net); virNWFilterHashTablePtr virNWFilterCreateVarHashmap(char *macaddr, const virNWFilterVarValue *value); int virNWFilterDomainFWUpdateCB(virDomainObjPtr vm, void *data); #endif
/* Linux driver for devices based on the DiBcom DiB0700 USB bridge * * 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. * * Copyright (C) 2005-6 DiBcom, SA */ #ifndef _DIB0700_H_ #define _DIB0700_H_ #define DVB_USB_LOG_PREFIX "dib0700" #include "dvb-usb.h" #include "dib07x0.h" extern int dvb_usb_dib0700_debug; #define deb_info(args...) dprintk(dvb_usb_dib0700_debug,0x01,args) #define deb_fw(args...) dprintk(dvb_usb_dib0700_debug,0x02,args) #define deb_fwdata(args...) dprintk(dvb_usb_dib0700_debug,0x04,args) #define deb_data(args...) dprintk(dvb_usb_dib0700_debug,0x08,args) #define REQUEST_SET_USB_XFER_LEN 0x0 /* valid only for firmware version */ /* higher than 1.21 */ #define REQUEST_I2C_READ 0x2 #define REQUEST_I2C_WRITE 0x3 #define REQUEST_POLL_RC 0x4 /* deprecated in firmware v1.20 */ #define REQUEST_JUMPRAM 0x8 #define REQUEST_SET_CLOCK 0xB #define REQUEST_SET_GPIO 0xC #define REQUEST_ENABLE_VIDEO 0xF // 1 Byte: 4MSB(1 = enable streaming, 0 = disable streaming) 4LSB(Video Mode: 0 = MPEG2 188Bytes, 1 = Analog) // 2 Byte: MPEG2 mode: 4MSB(1 = Master Mode, 0 = Slave Mode) 4LSB(Channel 1 = bit0, Channel 2 = bit1) // 2 Byte: Analog mode: 4MSB(0 = 625 lines, 1 = 525 lines) 4LSB( " " ) #define REQUEST_SET_RC 0x11 #define REQUEST_NEW_I2C_READ 0x12 #define REQUEST_NEW_I2C_WRITE 0x13 #define REQUEST_GET_VERSION 0x15 struct dib0700_state { u8 channel_state; u16 mt2060_if1[2]; u8 rc_toggle; u8 rc_counter; u8 rc_func_version; u8 is_dib7000pc; u8 fw_use_new_i2c_api; u8 disable_streaming_master_mode; u32 fw_version; u32 nb_packet_buffer_size; }; extern int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion, u32 *romversion, u32 *ramversion, u32 *fwtype); extern int dib0700_set_gpio(struct dvb_usb_device *, enum dib07x0_gpios gpio, u8 gpio_dir, u8 gpio_val); extern int dib0700_ctrl_clock(struct dvb_usb_device *d, u32 clk_MHz, u8 clock_out_gp3); extern int dib0700_ctrl_rd(struct dvb_usb_device *d, u8 *tx, u8 txlen, u8 *rx, u8 rxlen); extern int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw); extern int dib0700_rc_setup(struct dvb_usb_device *d); extern int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff); extern struct i2c_algorithm dib0700_i2c_algo; extern int dib0700_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props, struct dvb_usb_device_description **desc, int *cold); extern int dib0700_device_count; extern int dvb_usb_dib0700_ir_proto; extern struct dvb_usb_device_properties dib0700_devices[]; extern struct usb_device_id dib0700_usb_id_table[]; #endif
/* * include/asm-v850/atomic.h -- Atomic operations * * Copyright (C) 2001,02 NEC Corporation * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> * * This file is subject to the terms and conditions of the GNU General * Public License. See the file COPYING in the main directory of this * archive for more details. * * Written by Miles Bader <miles@gnu.org> */ #ifndef __V850_ATOMIC_H__ #define __V850_ATOMIC_H__ #include <linux/config.h> #include <asm/system.h> #ifdef CONFIG_SMP #error SMP not supported #endif typedef struct { int counter; } atomic_t; #define ATOMIC_INIT(i) { (i) } #ifdef __KERNEL__ #define atomic_read(v) ((v)->counter) #define atomic_set(v,i) (((v)->counter) = (i)) extern __inline__ int atomic_add_return (int i, volatile atomic_t *v) { unsigned long flags; int res; local_irq_save (flags); res = v->counter + i; v->counter = res; local_irq_restore (flags); return res; } static __inline__ int atomic_sub_return (int i, volatile atomic_t *v) { unsigned long flags; int res; local_irq_save (flags); res = v->counter - i; v->counter = res; local_irq_restore (flags); return res; } static __inline__ void atomic_clear_mask (unsigned long mask, unsigned long *addr) { unsigned long flags; local_irq_save (flags); *addr &= ~mask; local_irq_restore (flags); } #endif #define atomic_add(i, v) atomic_add_return ((i), (v)) #define atomic_sub(i, v) atomic_sub_return ((i), (v)) #define atomic_dec_return(v) atomic_sub_return (1, (v)) #define atomic_inc_return(v) atomic_add_return (1, (v)) #define atomic_inc(v) atomic_inc_return (v) #define atomic_dec(v) atomic_dec_return (v) /* * atomic_inc_and_test - increment and test * @v: pointer of type atomic_t * * Atomically increments @v by 1 * and returns true if the result is zero, or false for all * other cases. */ #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) #define atomic_sub_and_test(i,v) (atomic_sub_return ((i), (v)) == 0) #define atomic_dec_and_test(v) (atomic_sub_return (1, (v)) == 0) #define atomic_add_negative(i,v) (atomic_add_return ((i), (v)) < 0) /* Atomic operations are already serializing on ARM */ #define smp_mb__before_atomic_dec() barrier() #define smp_mb__after_atomic_dec() barrier() #define smp_mb__before_atomic_inc() barrier() #define smp_mb__after_atomic_inc() barrier() #endif /* __V850_ATOMIC_H__ */