text
stringlengths
4
6.14k
/* * 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. * * Written (W) 2008-2009 Soeren Sonnenburg * Copyright (C) 2008-2009 Fraunhofer Institute FIRST and Max Planck Society */ #ifndef __SG_CLASS_LIST_H__ #define __SG_CLASS_LIST_H__ #include <shogun/lib/config.h> #include <shogun/lib/DataType.h> namespace shogun { class CSGObject; /** new shogun serializable * @param sgserializable_name * @param generic */ CSGObject* new_sgserializable(const char* sgserializable_name, EPrimitiveType generic); } #endif /* __SG_CLASS_LIST_H__ */
/* ===-- int_util.h - internal utility functions ----------------------------=== * * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. * * ===-----------------------------------------------------------------------=== * * This file is not part of the interface of this library. * * This file defines non-inline utilities which are available for use in the * library. The function definitions themselves are all contained in int_util.c * which will always be compiled into any compiler-rt library. * * ===-----------------------------------------------------------------------=== */ #ifndef INT_UTIL_H #define INT_UTIL_H /** \brief Trigger a program abort (or panic for kernel code). */ #define compilerrt_abort() compilerrt_abort_impl(__FILE__, __LINE__, \ __FUNCTION__) void compilerrt_abort_impl(const char *file, int line, const char *function) __attribute__((noreturn)); #endif /* INT_UTIL_H */
/* * Freescale i.MX28 APBH DMA * * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com> * on behalf of DENX Software Engineering GmbH * * Based on code from LTIB: * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef __DMA_H__ #define __DMA_H__ #include <linux/list.h> #include <linux/compiler.h> #ifndef CONFIG_ARCH_DMA_PIO_WORDS #define DMA_PIO_WORDS 15 #else #define DMA_PIO_WORDS CONFIG_ARCH_DMA_PIO_WORDS #endif #define MXS_DMA_ALIGNMENT 32 /* * MXS DMA channels */ #if defined(CONFIG_MX23) enum { MXS_DMA_CHANNEL_AHB_APBH_LCDIF = 0, MXS_DMA_CHANNEL_AHB_APBH_SSP0, MXS_DMA_CHANNEL_AHB_APBH_SSP1, MXS_DMA_CHANNEL_AHB_APBH_RESERVED0, MXS_DMA_CHANNEL_AHB_APBH_GPMI0, MXS_DMA_CHANNEL_AHB_APBH_GPMI1, MXS_DMA_CHANNEL_AHB_APBH_GPMI2, MXS_DMA_CHANNEL_AHB_APBH_GPMI3, MXS_MAX_DMA_CHANNELS, }; #elif defined(CONFIG_MX28) enum { MXS_DMA_CHANNEL_AHB_APBH_SSP0 = 0, MXS_DMA_CHANNEL_AHB_APBH_SSP1, MXS_DMA_CHANNEL_AHB_APBH_SSP2, MXS_DMA_CHANNEL_AHB_APBH_SSP3, MXS_DMA_CHANNEL_AHB_APBH_GPMI0, MXS_DMA_CHANNEL_AHB_APBH_GPMI1, MXS_DMA_CHANNEL_AHB_APBH_GPMI2, MXS_DMA_CHANNEL_AHB_APBH_GPMI3, MXS_DMA_CHANNEL_AHB_APBH_GPMI4, MXS_DMA_CHANNEL_AHB_APBH_GPMI5, MXS_DMA_CHANNEL_AHB_APBH_GPMI6, MXS_DMA_CHANNEL_AHB_APBH_GPMI7, MXS_DMA_CHANNEL_AHB_APBH_HSADC, MXS_DMA_CHANNEL_AHB_APBH_LCDIF, MXS_DMA_CHANNEL_AHB_APBH_RESERVED0, MXS_DMA_CHANNEL_AHB_APBH_RESERVED1, MXS_MAX_DMA_CHANNELS, }; #elif defined(CONFIG_MX6) enum { MXS_DMA_CHANNEL_AHB_APBH_GPMI0 = 0, MXS_DMA_CHANNEL_AHB_APBH_GPMI1, MXS_DMA_CHANNEL_AHB_APBH_GPMI2, MXS_DMA_CHANNEL_AHB_APBH_GPMI3, MXS_DMA_CHANNEL_AHB_APBH_GPMI4, MXS_DMA_CHANNEL_AHB_APBH_GPMI5, MXS_DMA_CHANNEL_AHB_APBH_GPMI6, MXS_DMA_CHANNEL_AHB_APBH_GPMI7, MXS_MAX_DMA_CHANNELS, }; #endif /* * MXS DMA hardware command. * * This structure describes the in-memory layout of an entire DMA command, * including space for the maximum number of PIO accesses. See the appropriate * reference manual for a detailed description of what these fields mean to the * DMA hardware. */ #define MXS_DMA_DESC_COMMAND_MASK 0x3 #define MXS_DMA_DESC_COMMAND_OFFSET 0 #define MXS_DMA_DESC_COMMAND_NO_DMAXFER 0x0 #define MXS_DMA_DESC_COMMAND_DMA_WRITE 0x1 #define MXS_DMA_DESC_COMMAND_DMA_READ 0x2 #define MXS_DMA_DESC_COMMAND_DMA_SENSE 0x3 #define MXS_DMA_DESC_CHAIN (1 << 2) #define MXS_DMA_DESC_IRQ (1 << 3) #define MXS_DMA_DESC_NAND_LOCK (1 << 4) #define MXS_DMA_DESC_NAND_WAIT_4_READY (1 << 5) #define MXS_DMA_DESC_DEC_SEM (1 << 6) #define MXS_DMA_DESC_WAIT4END (1 << 7) #define MXS_DMA_DESC_HALT_ON_TERMINATE (1 << 8) #define MXS_DMA_DESC_TERMINATE_FLUSH (1 << 9) #define MXS_DMA_DESC_PIO_WORDS_MASK (0xf << 12) #define MXS_DMA_DESC_PIO_WORDS_OFFSET 12 #define MXS_DMA_DESC_BYTES_MASK (0xffff << 16) #define MXS_DMA_DESC_BYTES_OFFSET 16 struct mxs_dma_cmd { unsigned long next; unsigned long data; union { dma_addr_t address; unsigned long alternate; }; unsigned long pio_words[DMA_PIO_WORDS]; }; /* * MXS DMA command descriptor. * * This structure incorporates an MXS DMA hardware command structure, along * with metadata. */ #define MXS_DMA_DESC_FIRST (1 << 0) #define MXS_DMA_DESC_LAST (1 << 1) #define MXS_DMA_DESC_READY (1 << 31) struct mxs_dma_desc { struct mxs_dma_cmd cmd; unsigned int flags; dma_addr_t address; void *buffer; struct list_head node; } __aligned(MXS_DMA_ALIGNMENT); /** * MXS DMA channel * * This structure represents a single DMA channel. The MXS platform code * maintains an array of these structures to represent every DMA channel in the * system (see mxs_dma_channels). */ #define MXS_DMA_FLAGS_IDLE 0 #define MXS_DMA_FLAGS_BUSY (1 << 0) #define MXS_DMA_FLAGS_FREE 0 #define MXS_DMA_FLAGS_ALLOCATED (1 << 16) #define MXS_DMA_FLAGS_VALID (1 << 31) struct mxs_dma_chan { const char *name; unsigned long dev; struct mxs_dma_device *dma; unsigned int flags; unsigned int active_num; unsigned int pending_num; struct list_head active; struct list_head done; }; struct mxs_dma_desc *mxs_dma_desc_alloc(void); void mxs_dma_desc_free(struct mxs_dma_desc *); int mxs_dma_desc_append(int channel, struct mxs_dma_desc *pdesc); int mxs_dma_go(int chan); void mxs_dma_init(void); int mxs_dma_init_channel(int chan); int mxs_dma_release(int chan); #endif /* __DMA_H__ */
/* * Copyright (c) 2011 Peter Korsgaard <jacmet@sunsite.dk> * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/mod_devicetable.h> #include <linux/slab.h> #include <linux/err.h> #include <linux/clk.h> #include <linux/io.h> #include <linux/hw_random.h> #include <linux/platform_device.h> #define TRNG_CR 0x00 #define TRNG_ISR 0x1c #define TRNG_ODATA 0x50 #define TRNG_KEY 0x524e4700 /* RNG */ struct atmel_trng { struct clk *clk; void __iomem *base; struct hwrng rng; }; static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max, bool wait) { struct atmel_trng *trng = container_of(rng, struct atmel_trng, rng); u32 *data = buf; /* data ready? */ if (readl(trng->base + TRNG_ISR) & 1) { *data = readl(trng->base + TRNG_ODATA); /* ensure data ready is only set again AFTER the next data word is ready in case it got set between checking ISR and reading ODATA, so we don't risk re-reading the same word */ readl(trng->base + TRNG_ISR); return 4; } else return 0; } static void atmel_trng_enable(struct atmel_trng *trng) { writel(TRNG_KEY | 1, trng->base + TRNG_CR); } static void atmel_trng_disable(struct atmel_trng *trng) { writel(TRNG_KEY, trng->base + TRNG_CR); } static int atmel_trng_probe(struct platform_device *pdev) { struct atmel_trng *trng; struct resource *res; int ret; trng = devm_kzalloc(&pdev->dev, sizeof(*trng), GFP_KERNEL); if (!trng) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); trng->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(trng->base)) return PTR_ERR(trng->base); trng->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(trng->clk)) return PTR_ERR(trng->clk); ret = clk_prepare_enable(trng->clk); if (ret) return ret; atmel_trng_enable(trng); trng->rng.name = pdev->name; trng->rng.read = atmel_trng_read; ret = devm_hwrng_register(&pdev->dev, &trng->rng); if (ret) goto err_register; platform_set_drvdata(pdev, trng); return 0; err_register: clk_disable_unprepare(trng->clk); return ret; } static int atmel_trng_remove(struct platform_device *pdev) { struct atmel_trng *trng = platform_get_drvdata(pdev); atmel_trng_disable(trng); clk_disable_unprepare(trng->clk); return 0; } #ifdef CONFIG_PM static int atmel_trng_suspend(struct device *dev) { struct atmel_trng *trng = dev_get_drvdata(dev); atmel_trng_disable(trng); clk_disable_unprepare(trng->clk); return 0; } static int atmel_trng_resume(struct device *dev) { struct atmel_trng *trng = dev_get_drvdata(dev); int ret; ret = clk_prepare_enable(trng->clk); if (ret) return ret; atmel_trng_enable(trng); return 0; } static const struct dev_pm_ops atmel_trng_pm_ops = { .suspend = atmel_trng_suspend, .resume = atmel_trng_resume, }; #endif /* CONFIG_PM */ static const struct of_device_id atmel_trng_dt_ids[] = { { .compatible = "atmel,at91sam9g45-trng" }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, atmel_trng_dt_ids); static struct platform_driver atmel_trng_driver = { .probe = atmel_trng_probe, .remove = atmel_trng_remove, .driver = { .name = "atmel-trng", #ifdef CONFIG_PM .pm = &atmel_trng_pm_ops, #endif /* CONFIG_PM */ .of_match_table = atmel_trng_dt_ids, }, }; module_platform_driver(atmel_trng_driver); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>"); MODULE_DESCRIPTION("Atmel true random number generator driver");
// license:BSD-3-Clause // copyright-holders:AJR /*************************************************************************** Atari 810 Disk Drive ***************************************************************************/ #ifndef MAME_BUS_A800_ATARI810 #define MAME_BUS_A800_ATARI810 1 #pragma once #include "a8sio.h" #include "machine/mos6530n.h" #include "machine/wd_fdc.h" class atari810_device : public device_t, public device_a8sio_card_interface { public: atari810_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); static constexpr feature_type unemulated_features() { return feature::DISK; } protected: virtual void device_start() override; virtual ioport_constructor device_input_ports() const override; virtual void device_add_mconfig(machine_config &config) override; virtual const tiny_rom_entry *device_rom_region() const override; virtual DECLARE_WRITE_LINE_MEMBER(data_out_w) override; virtual DECLARE_WRITE_LINE_MEMBER(command_w) override; virtual DECLARE_WRITE_LINE_MEMBER(ready_w) override; private: void step_w(u8 data); void mem_map(address_map &map); required_device<mos6532_new_device> m_pia; required_device<fd1771_device> m_fdc; }; // device type declaration DECLARE_DEVICE_TYPE(ATARI810, atari810_device) #endif // MAME_BUS_A800_ATARI810
// 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 BASE_DEBUG_LEAK_ANNOTATIONS_H_ #define BASE_DEBUG_LEAK_ANNOTATIONS_H_ #include "build/build_config.h" // This file defines macros which can be used to annotate intentional memory // leaks. Support for annotations is implemented in HeapChecker and // LeakSanitizer. Annotated objects will be treated as a source of live // pointers, i.e. any heap objects reachable by following pointers from an // annotated object will not be reported as leaks. // // ANNOTATE_SCOPED_MEMORY_LEAK: all allocations made in the current scope // will be annotated as leaks. // ANNOTATE_LEAKING_OBJECT_PTR(X): the heap object referenced by pointer X will // be annotated as a leak. // // Note that HeapChecker will report a fatal error if an object which has been // annotated with ANNOTATE_LEAKING_OBJECT_PTR is later deleted (but // LeakSanitizer won't). #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_NACL) && \ defined(USE_HEAPCHECKER) #include "third_party/tcmalloc/chromium/src/gperftools/heap-checker.h" #define ANNOTATE_SCOPED_MEMORY_LEAK \ HeapLeakChecker::Disabler heap_leak_checker_disabler; static_cast<void>(0) #define ANNOTATE_LEAKING_OBJECT_PTR(X) \ HeapLeakChecker::IgnoreObject(X) #elif defined(LEAK_SANITIZER) && !defined(OS_NACL) extern "C" { void __lsan_disable(); void __lsan_enable(); void __lsan_ignore_object(const void *p); } // extern "C" class ScopedLeakSanitizerDisabler { public: ScopedLeakSanitizerDisabler() { __lsan_disable(); } ~ScopedLeakSanitizerDisabler() { __lsan_enable(); } private: DISALLOW_COPY_AND_ASSIGN(ScopedLeakSanitizerDisabler); }; #define ANNOTATE_SCOPED_MEMORY_LEAK \ ScopedLeakSanitizerDisabler leak_sanitizer_disabler; static_cast<void>(0) #define ANNOTATE_LEAKING_OBJECT_PTR(X) __lsan_ignore_object(X); #else // If neither HeapChecker nor LSan are used, the annotations should be no-ops. #define ANNOTATE_SCOPED_MEMORY_LEAK ((void)0) #define ANNOTATE_LEAKING_OBJECT_PTR(X) ((void)0) #endif #endif // BASE_DEBUG_LEAK_ANNOTATIONS_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_SPEECH_SPEECH_RECOGNITION_BUBBLE_CONTROLLER_H_ #define CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_BUBBLE_CONTROLLER_H_ #include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h" #include "chrome/browser/speech/speech_recognition_bubble.h" #include "ui/gfx/rect.h" namespace speech { // This class handles the speech recognition popup UI on behalf of // SpeechRecognitionManager, which invokes methods on the IO thread, processing // those requests on the UI thread. At most one bubble can be active. class SpeechRecognitionBubbleController : public base::RefCountedThreadSafe<SpeechRecognitionBubbleController>, public SpeechRecognitionBubbleDelegate { public: // All methods of this delegate are called on the IO thread. class Delegate { public: // Invoked when the user clicks on a button in the speech recognition UI. virtual void InfoBubbleButtonClicked( int session_id, SpeechRecognitionBubble::Button button) = 0; // Invoked when the user clicks outside the speech recognition info bubble // causing it to close and input focus to change. virtual void InfoBubbleFocusChanged(int session_id) = 0; protected: virtual ~Delegate() {} }; explicit SpeechRecognitionBubbleController(Delegate* delegate); // Creates and shows a new speech recognition UI bubble in warmup mode. void CreateBubble(int session_id, int render_process_id, int render_view_id, const gfx::Rect& element_rect); // Indicates to the user that audio recording is in progress. void SetBubbleRecordingMode(); // Indicates to the user that recognition is in progress. void SetBubbleRecognizingMode(); // Displays the given string with the 'Try again' and 'Cancel' buttons. void SetBubbleMessage(const base::string16& text); // Checks whether the bubble is active and is showing a message. bool IsShowingMessage() const; // Updates the current captured audio volume displayed on screen. void SetBubbleInputVolume(float volume, float noise_volume); // Closes the bubble. void CloseBubble(); // This is the only method that can be called from the UI thread. void CloseBubbleForRenderViewOnUIThread(int render_process_id, int render_view_id); // Retrieves the session ID associated to the active bubble (if any). // Returns 0 if no bubble is currently shown. int GetActiveSessionID(); // SpeechRecognitionBubble::Delegate methods. virtual void InfoBubbleButtonClicked( SpeechRecognitionBubble::Button button) OVERRIDE; virtual void InfoBubbleFocusChanged() OVERRIDE; private: friend class base::RefCountedThreadSafe<SpeechRecognitionBubbleController>; // The various calls received by this object and handled on the UI thread. enum RequestType { REQUEST_CREATE, REQUEST_SET_RECORDING_MODE, REQUEST_SET_RECOGNIZING_MODE, REQUEST_SET_MESSAGE, REQUEST_SET_INPUT_VOLUME, REQUEST_CLOSE, }; struct UIRequest { RequestType type; base::string16 message; gfx::Rect element_rect; float volume; float noise_volume; int render_process_id; int render_view_id; explicit UIRequest(RequestType type_value); ~UIRequest(); }; virtual ~SpeechRecognitionBubbleController(); void InvokeDelegateButtonClicked(SpeechRecognitionBubble::Button button); void InvokeDelegateFocusChanged(); void ProcessRequestInUiThread(const UIRequest& request); // The following are accessed only on the IO thread. Delegate* delegate_; RequestType last_request_issued_; // The following are accessed only on the UI thread. scoped_ptr<SpeechRecognitionBubble> bubble_; // The following are accessed on both IO and UI threads. base::Lock lock_; // The session id for currently visible bubble. int current_bubble_session_id_; // The render process and view ids for the currently visible bubble. int current_bubble_render_process_id_; int current_bubble_render_view_id_; }; // This typedef is to workaround the issue with certain versions of // Visual Studio where it gets confused between multiple Delegate // classes and gives a C2500 error. (I saw this error on the try bots - // the workaround was not needed for my machine). typedef SpeechRecognitionBubbleController::Delegate SpeechRecognitionBubbleControllerDelegate; } // namespace speech #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_BUBBLE_CONTROLLER_H_
/***************************************************************************** Copyright (c) 2010, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation 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. ****************************************************************************** * Contents: Native middle-level C interface to LAPACK function clacn2 * Author: Intel Corporation * Generated October, 2012 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_clacn2_work( lapack_int n, lapack_complex_float* v, lapack_complex_float* x, float* est, lapack_int* kase, lapack_int* isave ) { lapack_int info = 0; /* Call LAPACK function and adjust info */ LAPACK_clacn2( &n, v, x, est, kase, isave ); return info; }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #pragma mark - // // File: /Applications/Xcode-7GM.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/PrivateFrameworks/AuthKit.framework/AuthKit // UUID: 758B0DE6-2D49-33C9-BF4A-EAFCF63700FD // // Arch: i386 // Current version: 1.0.0 // Compatibility version: 1.0.0 // Source version: 52.0.0.0.0 // // // This file does not contain any Objective-C runtime information. //
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #pragma mark - // // File: /Applications/Xcode-7GM.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/Frameworks/AddressBook.framework/AddressBook // UUID: CF08B9D3-EB45-3851-9A99-D25A3D4692AA // // Arch: i386 // Current version: 30.0.0 // Compatibility version: 1.0.0 // Source version: 11112.2.0.0.0 // // // This file does not contain any Objective-C runtime information. //
/** * @file SFMT.h * * @brief SIMD oriented Fast Mersenne Twister(SFMT) pseudorandom * number generator * * @author Mutsuo Saito (Hiroshima University) * @author Makoto Matsumoto (Hiroshima University) * * Copyright (C) 2006, 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima * University. All rights reserved. * * The new BSD License is applied to this software. * see LICENSE.txt * * @note We assume that your system has inttypes.h. If your system * doesn't have inttypes.h, you have to typedef uint32_t and uint64_t, * and you have to define PRIu64 and PRIx64 in this file as follows: * @verbatim typedef unsigned int uint32_t typedef unsigned long long uint64_t #define PRIu64 "llu" #define PRIx64 "llx" @endverbatim * uint32_t must be exactly 32-bit unsigned integer type (no more, no * less), and uint64_t must be exactly 64-bit unsigned integer type. * PRIu64 and PRIx64 are used for printf function to print 64-bit * unsigned int and 64-bit unsigned int in hexadecimal format. */ #ifndef SFMT_H #define SFMT_H #include <stdio.h> #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) #include <inttypes.h> #elif defined(_MSC_VER) || defined(__BORLANDC__) typedef unsigned int uint32_t; typedef unsigned __int64 uint64_t; #define inline __inline #else #include <inttypes.h> #if defined(__GNUC__) #define inline __inline__ #endif #endif #ifndef PRIu64 #if defined(_MSC_VER) || defined(__BORLANDC__) #define PRIu64 "I64u" #define PRIx64 "I64x" #else #define PRIu64 "llu" #define PRIx64 "llx" #endif #endif #if defined(__GNUC__) #define ALWAYSINLINE __attribute__((always_inline)) #else #define ALWAYSINLINE #endif #if defined(_MSC_VER) #if _MSC_VER >= 1200 #define PRE_ALWAYS __forceinline #else #define PRE_ALWAYS inline #endif #else #define PRE_ALWAYS inline #endif #if defined(__cplusplus) || defined(c_plusplus) //extern "C" { #endif uint32_t gen_rand32(void); uint64_t gen_rand64(void); void fill_array32(uint32_t *array, int size); void fill_array64(uint64_t *array, int size); void init_gen_rand(uint32_t seed); void init_by_array(uint32_t *init_key, int key_length); const char *get_idstring(void); int get_min_array_size32(void); int get_min_array_size64(void); #if defined(__cplusplus) || defined(c_plusplus) //} // end extern #endif /* These real versions are due to Isaku Wada */ /** generates a random number on [0,1]-real-interval */ inline static double to_real1(uint32_t v) { return v * (1.0/4294967295.0); /* divided by 2^32-1 */ } /** generates a random number on [0,1]-real-interval */ inline static double genrand_real1(void) { return to_real1(gen_rand32()); } /** generates a random number on [0,1)-real-interval */ inline static double to_real2(uint32_t v) { return v * (1.0/4294967296.0); /* divided by 2^32 */ } /** generates a random number on [0,1)-real-interval */ inline static double genrand_real2(void) { return to_real2(gen_rand32()); } /** generates a random number on (0,1)-real-interval */ inline static double to_real3(uint32_t v) { return (((double)v) + 0.5)*(1.0/4294967296.0); /* divided by 2^32 */ } /** generates a random number on (0,1)-real-interval */ inline static double genrand_real3(void) { return to_real3(gen_rand32()); } /** These real versions are due to Isaku Wada */ /** generates a random number on [0,1) with 53-bit resolution*/ inline static double to_res53(uint64_t v) { return v * (1.0/18446744073709551616.0L); } /** generates a random number on [0,1) with 53-bit resolution from two * 32 bit integers */ inline static double to_res53_mix(uint32_t x, uint32_t y) { return to_res53(x | ((uint64_t)y << 32)); } /** generates a random number on [0,1) with 53-bit resolution */ inline static double genrand_res53(void) { return to_res53(gen_rand64()); } /** generates a random number on [0,1) with 53-bit resolution using 32bit integer. */ inline static double genrand_res53_mix(void) { uint32_t x, y; x = gen_rand32(); y = gen_rand32(); return to_res53_mix(x, y); } #endif
#ifndef _ibuf_cntrl_2600_encoded_command_h_ #define _ibuf_cntrl_2600_encoded_command_h_ #include "ibuf_cntrl_2600_general_command.h" #include <hrt/api.h> void ibc2600_send_encoded_cmd(ibc2600_cmd_encoded_s *cmd); #endif
/* * Copyright (C) 2009 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ContextMenuClientImpl_h #define ContextMenuClientImpl_h #include "core/page/ContextMenuClient.h" namespace blink { class WebViewImpl; struct WebContextMenuData; class ContextMenuClientImpl final : public ContextMenuClient { public: explicit ContextMenuClientImpl(WebViewImpl* webView) : m_webView(webView) { } ~ContextMenuClientImpl() override {} void showContextMenu(const ContextMenu*) override; void clearContextMenu() override; private: void populateCustomMenuItems(const ContextMenu*, WebContextMenuData*); WebViewImpl* m_webView; }; } // namespace blink #endif // ContextMenuClientImpl_h
#define SWIFT_NAME(X) __attribute__((swift_name(#X))) #ifndef SWIFT_ENUM_EXTRA # define SWIFT_ENUM_EXTRA #endif #ifndef SWIFT_ENUM # define SWIFT_ENUM(_name) \ enum _name _name; \ enum __attribute__((enum_extensibility(open))) \ __attribute__((external_source_symbol(language="Swift", \ defined_in="swift_name", generated_declaration))) \ SWIFT_ENUM_EXTRA _name #endif // Renaming global variables. int SNFoo SWIFT_NAME(Bar); // Renaming tags and fields. struct SWIFT_NAME(SomeStruct) SNSomeStruct { double X SWIFT_NAME(x); }; // Renaming C functions struct SNSomeStruct SNMakeSomeStruct(double X, double Y) SWIFT_NAME(makeSomeStruct(x:y:)); struct SNSomeStruct SNMakeSomeStructForX(double X) SWIFT_NAME(makeSomeStruct(x:)); // Renaming typedefs. typedef int SNIntegerType SWIFT_NAME(MyInt); // Renaming enumerations. SWIFT_ENUM(SNColorChoice) { SNColorRed SWIFT_NAME(Rouge), SNColorGreen, SNColorBlue }; // swift_private attribute void SNTransposeInPlace(struct SNSomeStruct *value) __attribute__((swift_private)); typedef struct { double x, y, z; } SNPoint SWIFT_NAME(Point); // Importing a value into a member. extern double DefaultXValue __attribute__((swift_name("SomeStruct.defaultX"))); // Importing a function as a method. struct SNSomeStruct SNAdding(struct SNSomeStruct *value, double x) SWIFT_NAME(SomeStruct.adding(self:x:)); // Importing a function as an initializer. struct SNSomeStruct SNCreate(double x) SWIFT_NAME(SomeStruct.init(theX:)); // Importing a function as a static property getter. struct SNSomeStruct SNSomeStructGetDefault(void) SWIFT_NAME(getter:SomeStruct.defaultValue()); // Importing a function as a static property setter. void SNSomeStructSetDefault(struct SNSomeStruct value) SWIFT_NAME(setter:SomeStruct.defaultValue(_:)); // Importing a function as an instance property getter. double SNSomeStructGetFoo(struct SNSomeStruct s) SWIFT_NAME(getter:SomeStruct.foo(self:)); // Importing a function as an instance property setter. void SNSomeStructSetFoo(struct SNSomeStruct s, double value) SWIFT_NAME(setter:SomeStruct.foo(self:_:));
/* * Platform data for MAX98095 * * Copyright 2011 Maxim Integrated Products * * 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 __SOUND_MAX98095_PDATA_H__ #define __SOUND_MAX98095_PDATA_H__ /* Equalizer filter response configuration */ struct max98095_eq_cfg { const char *name; unsigned int rate; u16 band1[5]; u16 band2[5]; u16 band3[5]; u16 band4[5]; u16 band5[5]; }; /* Biquad filter response configuration */ struct max98095_biquad_cfg { const char *name; unsigned int rate; u16 band1[5]; u16 band2[5]; }; /* codec platform data */ struct max98095_pdata { /* Equalizers for DAI1 and DAI2 */ struct max98095_eq_cfg *eq_cfg; unsigned int eq_cfgcnt; /* Biquad filter for DAI1 and DAI2 */ struct max98095_biquad_cfg *bq_cfg; unsigned int bq_cfgcnt; /* Analog/digital microphone configuration: * 0 = analog microphone input (normal setting) * 1 = digital microphone input */ unsigned int digmic_left_mode:1; unsigned int digmic_right_mode:1; }; #endif
/* * Copyright (c) 2007-2012 SlimDX Group * * 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. */ #pragma once #include "EffectVariable.h" namespace SlimDX { namespace Direct3D10 { public ref class EffectScalarVariable : public EffectVariable { private: ID3D10EffectScalarVariable* m_Pointer; internal: EffectScalarVariable( ID3D10EffectScalarVariable* pointer ); public: EffectScalarVariable( System::IntPtr pointer ); Result Set( bool value ); Result Set( array<bool>^ values ); Result Set( float value ); Result Set( array<float>^ values ); Result Set( int value ); Result Set( array<int>^ values ); bool GetBool(); array<bool>^ GetBoolArray( int count ); int GetInt(); array<int>^ GetIntArray( int count ); float GetFloat(); array<float>^ GetFloatArray( int count ); }; } };
// Copyright (C) 2002-2012 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #ifndef __I_OS_OPERATOR_H_INCLUDED__ #define __I_OS_OPERATOR_H_INCLUDED__ #include "IReferenceCounted.h" #include "irrString.h" namespace irr { //! The Operating system operator provides operation system specific methods and informations. class IOSOperator : public virtual IReferenceCounted { public: //! Get the current operation system version as string. virtual const core::stringc& getOperatingSystemVersion() const = 0; //! Get the current operation system version as string. /** \deprecated Use getOperatingSystemVersion instead. This method will be removed in Irrlicht 1.9. */ _IRR_DEPRECATED_ const wchar_t* getOperationSystemVersion() const { return core::stringw(getOperatingSystemVersion()).c_str(); } //! Copies text to the clipboard virtual void copyToClipboard(const c8* text) const = 0; //! Get text from the clipboard /** \return Returns 0 if no string is in there. */ virtual const c8* getTextFromClipboard() const = 0; //! Get the processor speed in megahertz /** \param MHz The integer variable to store the speed in. \return True if successful, false if not */ virtual bool getProcessorSpeedMHz(u32* MHz) const = 0; //! Get the total and available system RAM /** \param Total: will contain the total system memory \param Avail: will contain the available memory \return True if successful, false if not */ virtual bool getSystemMemory(u32* Total, u32* Avail) const = 0; }; } // end namespace #endif
/* @(#)w_fmod.c 5.1 93/09/24 */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== */ /* FUNCTION <<fmod>>, <<fmodf>>---floating-point remainder (modulo) INDEX fmod INDEX fmodf ANSI_SYNOPSIS #include <math.h> double fmod(double <[x]>, double <[y]>); float fmodf(float <[x]>, float <[y]>); TRAD_SYNOPSIS #include <math.h> double fmod(<[x]>, <[y]>); double (<[x]>, <[y]>); float fmodf(<[x]>, <[y]>); float (<[x]>, <[y]>); DESCRIPTION The <<fmod>> and <<fmodf>> functions compute the floating-point remainder of <[x]>/<[y]> (<[x]> modulo <[y]>). RETURNS The <<fmod>> function returns the value @ifnottex <[x]>-<[i]>*<[y]>, @end ifnottex @tex $x-i\times y$, @end tex for the largest integer <[i]> such that, if <[y]> is nonzero, the result has the same sign as <[x]> and magnitude less than the magnitude of <[y]>. <<fmod(<[x]>,0)>> returns NaN, and sets <<errno>> to <<EDOM>>. You can modify error treatment for these functions using <<matherr>>. PORTABILITY <<fmod>> is ANSI C. <<fmodf>> is an extension. */ /* * wrapper fmod(x,y) */ #include "fdlibm.h" #include <errno.h> #ifndef _DOUBLE_IS_32BITS #ifdef __STDC__ double fmod(double x, double y) /* wrapper fmod */ #else double fmod(x,y) /* wrapper fmod */ double x,y; #endif { #ifdef _IEEE_LIBM return __ieee754_fmod(x,y); #else double z; struct exception exc; z = __ieee754_fmod(x,y); if(_LIB_VERSION == _IEEE_ ||isnan(y)||isnan(x)) return z; if(y==0.0) { /* fmod(x,0) */ exc.type = DOMAIN; exc.name = "fmod"; exc.arg1 = x; exc.arg2 = y; exc.err = 0; if (_LIB_VERSION == _SVID_) exc.retval = x; else exc.retval = 0.0/0.0; if (_LIB_VERSION == _POSIX_) errno = EDOM; else if (!matherr(&exc)) { errno = EDOM; } if (exc.err != 0) errno = exc.err; return exc.retval; } else return z; #endif } #endif /* defined(_DOUBLE_IS_32BITS) */
/***************************************************************************** * predict.h: arm intra prediction ***************************************************************************** * Copyright (C) 2009-2012 x264 project * * Authors: David Conrad <lessen42@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. * * This program is also available under a commercial proprietary license. * For more information, contact us at licensing@x264.com. *****************************************************************************/ #ifndef X264_ARM_PREDICT_H #define X264_ARM_PREDICT_H void x264_predict_4x4_init_arm( int cpu, x264_predict_t pf[12] ); void x264_predict_8x8_init_arm( int cpu, x264_predict8x8_t pf[12], x264_predict_8x8_filter_t *predict_filter ); void x264_predict_8x8c_init_arm( int cpu, x264_predict_t pf[7] ); void x264_predict_16x16_init_arm( int cpu, x264_predict_t pf[7] ); #endif
#define foo a bar #define bar b baz #define baz c foo foo bar baz
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * 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. * */ /* Detection tables for Croustibat. */ #ifndef GOB_DETECTION_TABLES_CROUSTI_H #define GOB_DETECTION_TABLES_CROUSTI_H // -- DOS VGA Floppy -- { { "crousti", "", AD_ENTRY1s("intro.stk", "63fd795818fa72c32b903bbd99e18ea1", 851926), PT_BRA, kPlatformDOS, ADGF_NO_FLAGS, GUIO2(GUIO_NOSUBTITLES, GUIO_NOSPEECH) }, kGameTypeCrousti, kFeaturesAdLib, 0, 0, 0 }, #endif // GOB_DETECTION_TABLES_CROUSTI_H
#ifndef TESTSETUPTEST_H #define TESTSETUPTEST_H #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestSetUp.h> class TestSetUpTest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE( TestSetUpTest ); CPPUNIT_TEST( testRun ); CPPUNIT_TEST_SUITE_END(); public: TestSetUpTest(); virtual ~TestSetUpTest(); void setUp(); void tearDown(); void testRun(); private: class MockSetUp : public CPPUNIT_NS::TestSetUp { public: MockSetUp( CPPUNIT_NS::Test *test ) : CPPUNIT_NS::TestSetUp( test ) , m_setUpCalled( false ) , m_tearDownCalled( false ) { } void setUp() { m_setUpCalled = true; } void tearDown() { m_tearDownCalled = true; } void verify() { CPPUNIT_ASSERT( m_setUpCalled ); CPPUNIT_ASSERT( m_tearDownCalled ); } private: bool m_setUpCalled; bool m_tearDownCalled; }; TestSetUpTest( const TestSetUpTest &copy ); void operator =( const TestSetUpTest &copy ); private: }; #endif // TESTSETUPTEST_H
/* proto-back-relay.h - relay backend header file */ /* $OpenLDAP: pkg/ldap/servers/slapd/back-relay/proto-back-relay.h,v 1.6.2.8 2011/01/04 23:50:42 kurt Exp $ */ /* This work is part of OpenLDAP Software <http://www.openldap.org/>. * * Copyright 2004-2011 The OpenLDAP Foundation. * Portions Copyright 2004 Pierangelo Masarati. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted only as authorized by the OpenLDAP * Public License. * * A copy of this license is available in file LICENSE in the * top-level directory of the distribution or, alternatively, at * <http://www.OpenLDAP.org/license.html>. */ /* ACKNOWLEDGEMENTS: * This work was initially developed by Pierangelo Masarati for inclusion * in OpenLDAP Software. */ #ifndef PROTO_BACK_RELAY #define PROTO_BACK_RELAY #include <ldap_cdefs.h> LDAP_BEGIN_DECL extern BI_init relay_back_initialize; extern BI_db_init relay_back_db_init; extern BI_db_open relay_back_db_open; extern BI_db_close relay_back_db_close; extern BI_db_destroy relay_back_db_destroy; extern BI_op_bind relay_back_op_bind; extern BI_op_search relay_back_op_search; extern BI_op_compare relay_back_op_compare; extern BI_op_modify relay_back_op_modify; extern BI_op_modrdn relay_back_op_modrdn; extern BI_op_add relay_back_op_add; extern BI_op_delete relay_back_op_delete; extern BI_op_extended relay_back_op_extended; extern BI_entry_release_rw relay_back_entry_release_rw; extern BI_entry_get_rw relay_back_entry_get_rw; extern BI_operational relay_back_operational; extern BI_has_subordinates relay_back_has_subordinates; LDAP_END_DECL #endif /* PROTO_BACK_RELAY */
/**************************************************************************** * * Copyright 2017 Samsung Electronics All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * * Copyright © 2005-2014 Rich Felker, et al. * * 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. * ***************************************************************************/ /************************************************************************ * Included Files ************************************************************************/ #include <math.h> /************************************************************************ * Public Functions ************************************************************************/ float fdimf(float x, float y) { if (isnan(x)) { return x; } if (isnan(y)) { return y; } return x > y ? x - y : 0; }
/* arch/arm/mach-msm/proc_comm.h * * Copyright (c) 2007-2009,2011 Code Aurora Forum. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _ARCH_ARM_MACH_MSM_MSM_PROC_COMM_H_ #define _ARCH_ARM_MACH_MSM_MSM_PROC_COMM_H_ enum { PCOM_CMD_IDLE = 0x0, PCOM_CMD_DONE, PCOM_RESET_APPS, PCOM_RESET_CHIP, PCOM_CONFIG_NAND_MPU, PCOM_CONFIG_USB_CLKS, PCOM_GET_POWER_ON_STATUS, PCOM_GET_WAKE_UP_STATUS, PCOM_GET_BATT_LEVEL, PCOM_CHG_IS_CHARGING, PCOM_POWER_DOWN, PCOM_USB_PIN_CONFIG, PCOM_USB_PIN_SEL, PCOM_SET_RTC_ALARM, PCOM_NV_READ, PCOM_NV_WRITE, PCOM_GET_UUID_HIGH, PCOM_GET_UUID_LOW, PCOM_GET_HW_ENTROPY, PCOM_RPC_GPIO_TLMM_CONFIG_REMOTE, PCOM_CLKCTL_RPC_ENABLE, PCOM_CLKCTL_RPC_DISABLE, PCOM_CLKCTL_RPC_RESET, PCOM_CLKCTL_RPC_SET_FLAGS, PCOM_CLKCTL_RPC_SET_RATE, PCOM_CLKCTL_RPC_MIN_RATE, PCOM_CLKCTL_RPC_MAX_RATE, PCOM_CLKCTL_RPC_RATE, PCOM_CLKCTL_RPC_PLL_REQUEST, PCOM_CLKCTL_RPC_ENABLED, PCOM_VREG_SWITCH, PCOM_VREG_SET_LEVEL, PCOM_GPIO_TLMM_CONFIG_GROUP, PCOM_GPIO_TLMM_UNCONFIG_GROUP, PCOM_NV_WRITE_BYTES_4_7, PCOM_CONFIG_DISP, PCOM_GET_FTM_BOOT_COUNT, PCOM_RPC_GPIO_TLMM_CONFIG_EX, PCOM_PM_MPP_CONFIG, PCOM_GPIO_IN, PCOM_GPIO_OUT, PCOM_RESET_MODEM, PCOM_RESET_CHIP_IMM, PCOM_PM_VID_EN, PCOM_VREG_PULLDOWN, PCOM_GET_MODEM_VERSION, PCOM_CLK_REGIME_SEC_RESET, PCOM_CLK_REGIME_SEC_RESET_ASSERT, PCOM_CLK_REGIME_SEC_RESET_DEASSERT, PCOM_CLK_REGIME_SEC_PLL_REQUEST_WRP, PCOM_CLK_REGIME_SEC_ENABLE, PCOM_CLK_REGIME_SEC_DISABLE, PCOM_CLK_REGIME_SEC_IS_ON, PCOM_CLK_REGIME_SEC_SEL_CLK_INV, PCOM_CLK_REGIME_SEC_SEL_CLK_SRC, PCOM_CLK_REGIME_SEC_SEL_CLK_DIV, PCOM_CLK_REGIME_SEC_ICODEC_CLK_ENABLE, PCOM_CLK_REGIME_SEC_ICODEC_CLK_DISABLE, PCOM_CLK_REGIME_SEC_SEL_SPEED, PCOM_CLK_REGIME_SEC_CONFIG_GP_CLK_WRP, PCOM_CLK_REGIME_SEC_CONFIG_MDH_CLK_WRP, PCOM_CLK_REGIME_SEC_USB_XTAL_ON, PCOM_CLK_REGIME_SEC_USB_XTAL_OFF, PCOM_CLK_REGIME_SEC_SET_QDSP_DME_MODE, PCOM_CLK_REGIME_SEC_SWITCH_ADSP_CLK, PCOM_CLK_REGIME_SEC_GET_MAX_ADSP_CLK_KHZ, PCOM_CLK_REGIME_SEC_GET_I2C_CLK_KHZ, PCOM_CLK_REGIME_SEC_MSM_GET_CLK_FREQ_KHZ, PCOM_CLK_REGIME_SEC_SEL_VFE_SRC, PCOM_CLK_REGIME_SEC_MSM_SEL_CAMCLK, PCOM_CLK_REGIME_SEC_MSM_SEL_LCDCLK, PCOM_CLK_REGIME_SEC_VFE_RAIL_OFF, PCOM_CLK_REGIME_SEC_VFE_RAIL_ON, PCOM_CLK_REGIME_SEC_GRP_RAIL_OFF, PCOM_CLK_REGIME_SEC_GRP_RAIL_ON, PCOM_CLK_REGIME_SEC_VDC_RAIL_OFF, PCOM_CLK_REGIME_SEC_VDC_RAIL_ON, PCOM_CLK_REGIME_SEC_LCD_CTRL, PCOM_CLK_REGIME_SEC_REGISTER_FOR_CPU_RESOURCE, PCOM_CLK_REGIME_SEC_DEREGISTER_FOR_CPU_RESOURCE, PCOM_CLK_REGIME_SEC_RESOURCE_REQUEST_WRP, PCOM_CLK_REGIME_MSM_SEC_SEL_CLK_OWNER, PCOM_CLK_REGIME_SEC_DEVMAN_REQUEST_WRP, PCOM_GPIO_CONFIG, PCOM_GPIO_CONFIGURE_GROUP, PCOM_GPIO_TLMM_SET_PORT, PCOM_GPIO_TLMM_CONFIG_EX, PCOM_SET_FTM_BOOT_COUNT, PCOM_RESERVED0, PCOM_RESERVED1, PCOM_CUSTOMER_CMD1, PCOM_CUSTOMER_CMD2, PCOM_CUSTOMER_CMD3, PCOM_CLK_REGIME_ENTER_APPSBL_CHG_MODE, PCOM_CLK_REGIME_EXIT_APPSBL_CHG_MODE, PCOM_CLK_REGIME_SEC_RAIL_DISABLE, PCOM_CLK_REGIME_SEC_RAIL_ENABLE, PCOM_CLK_REGIME_SEC_RAIL_CONTROL, PCOM_SET_SW_WATCHDOG_STATE, PCOM_PM_MPP_CONFIG_DIGITAL_INPUT, PCOM_PM_MPP_CONFIG_I_SINK, PCOM_RESERVED_101, PCOM_MSM_HSUSB_PHY_RESET, PCOM_GET_BATT_MV_LEVEL, PCOM_CHG_USB_IS_PC_CONNECTED, PCOM_CHG_USB_IS_CHARGER_CONNECTED, PCOM_CHG_USB_IS_DISCONNECTED, PCOM_CHG_USB_IS_AVAILABLE, PCOM_CLK_REGIME_SEC_MSM_SEL_FREQ, PCOM_CLK_REGIME_SEC_SET_PCLK_AXI_POLICY, PCOM_CLKCTL_RPC_RESET_ASSERT, PCOM_CLKCTL_RPC_RESET_DEASSERT, PCOM_CLKCTL_RPC_RAIL_ON, PCOM_CLKCTL_RPC_RAIL_OFF, PCOM_CLKCTL_RPC_RAIL_ENABLE, PCOM_CLKCTL_RPC_RAIL_DISABLE, PCOM_CLKCTL_RPC_RAIL_CONTROL, PCOM_CLKCTL_RPC_MIN_MSMC1, PCOM_CLKCTL_RPC_SRC_REQUEST, PCOM_NPA_INIT, PCOM_NPA_ISSUE_REQUIRED_REQUEST, PCOM_CLKCTL_RPC_SET_EXT_CONFIG, }; #if defined(CONFIG_MACH_AMAZING_CDMA) || defined(CONFIG_MACH_KYLE) enum { PCOM_OEM_FIRST_CMD = 0x10000000, PCOM_OEM_TEST_CMD = PCOM_OEM_FIRST_CMD, PCOM_OEM_CHARGING_CURRENT, PCOM_OEM_CHARGING_INFO, PCOM_OEM_VF_GET, PCOM_OEM_TEMP_ADC_GET, PCOM_OEM_TEMP_DEGREE_GET, PCOM_OEM_BATT_AVER_GET, PCOM_OEM_CHARGE_STATE_GET, PCOM_OEM_FUEL_ALERT_CHECK, PCOM_OEM_POWER_KEY_GET, #ifdef CONFIG_RTC_AUTO_PWRON PCOM_OEM_SYS_CMD, #endif PCOM_OEM_MICBIAS_ONOFF, PCOM_OEM_CHARGING_INFO_SET, PCOM_OEM_CALL_STATE_GET, PCOM_OEM_TRICKEL_CHARGING_CURRENT_SET, PCOM_OEM_CUT_OFF_CURRENT_SET, PCOM_OEM_USB_ATTACHED_GET, PCOM_OEM_USB_TYPE_SET, PCOM_OEM_KEYLED_SET, PCOM_OEM_SAMSUNG_LAST, PCOM_OEM_LAST = PCOM_OEM_SAMSUNG_LAST, }; #else enum { PCOM_OEM_FIRST_CMD = 0x10000000, PCOM_OEM_TEST_CMD = PCOM_OEM_FIRST_CMD, PCOM_OEM_CHARGING_INFO, PCOM_OEM_POWER_KEY_GET, PCOM_OEM_SYS_CMD, PCOM_OEM_SAMSUNG_LAST, PCOM_OEM_LAST = PCOM_OEM_SAMSUNG_LAST, }; #endif enum { PCOM_INVALID_STATUS = 0x0, PCOM_READY, PCOM_CMD_RUNNING, PCOM_CMD_SUCCESS, PCOM_CMD_FAIL, PCOM_CMD_FAIL_FALSE_RETURNED, PCOM_CMD_FAIL_CMD_OUT_OF_BOUNDS_SERVER, PCOM_CMD_FAIL_CMD_OUT_OF_BOUNDS_CLIENT, PCOM_CMD_FAIL_CMD_UNREGISTERED, PCOM_CMD_FAIL_CMD_LOCKED, PCOM_CMD_FAIL_SERVER_NOT_YET_READY, PCOM_CMD_FAIL_BAD_DESTINATION, PCOM_CMD_FAIL_SERVER_RESET, PCOM_CMD_FAIL_SMSM_NOT_INIT, PCOM_CMD_FAIL_PROC_COMM_BUSY, PCOM_CMD_FAIL_PROC_COMM_NOT_INIT, }; #ifdef CONFIG_MSM_PROC_COMM void msm_proc_comm_reset_modem_now(void); int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2); #else static inline void msm_proc_comm_reset_modem_now(void) { } static inline int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2) { return 0; } #endif #endif
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // /*===================================================================== ** ** Source: GetDiskFreeSpaceW.c (test 2) ** ** Purpose: Tests the PAL implementation of the GetDiskFreeSpaceW ** function on valid non-root paths. ** ** **===================================================================*/ #include <palsuite.h> int __cdecl main(int argc, char *argv[]) { DWORD dwSectorsPerCluster; /* sectors per cluster */ DWORD dwBytesPerSector; /* bytes per sector */ DWORD dwNumberOfFreeClusters; /* free clusters */ DWORD dwTotalNumberOfClusters; /* total clusters */ BOOL bRc = FALSE; WCHAR szwCurrentPath[MAX_PATH]; if (0 != PAL_Initialize(argc,argv)) { return FAIL; } /* get the current directory so we are sure to have a valid path */ if (!GetCurrentDirectoryW(MAX_PATH, szwCurrentPath)) { Fail("GetDiskFreeSpaceW: ERROR -> GetCurrentDirectoryW failed with " "error code: %u.\n", GetLastError()); } /* test the current path*/ bRc = GetDiskFreeSpaceW(szwCurrentPath, &dwSectorsPerCluster, &dwBytesPerSector, &dwNumberOfFreeClusters, &dwTotalNumberOfClusters); if (bRc != TRUE) { Fail("GetDiskFreeSpaceW: ERROR -> Failed with error code: %u for " "the path \"%S\".\n", GetLastError(), szwCurrentPath); } else if (dwSectorsPerCluster == 0) { Fail("GetDiskFreeSpaceW: ERROR -> dwSectorsPerCluster returned 0\n"); } else if (dwBytesPerSector == 0) { Fail("GetDiskFreeSpaceW: ERROR -> dwBytesPerSector returned 0\n"); } PAL_Terminate(); return PASS; }
/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef __SR200PC20_H__ #define __SR200PC20_H__ #include "msm_sensor.h" #define SENSOR_NAME "sr200pc20" #define PLATFORM_DRIVER_NAME "msm_camera_sr200pc20" #define sr200pc20_obj sr200pc20_##obj #include <linux/types.h> #include <mach/board.h> #undef DEBUG_LEVEL_HIGH #undef DEBUG_LEVEL_MID #define DEBUG_LEVEL_HIGH /*#define DEBUG_LEVEL_MID */ #if defined(DEBUG_LEVEL_HIGH) #define CAM_DEBUG(fmt, arg...) \ do { \ printk(KERN_DEBUG "[%s:%d] " fmt, \ __func__, __LINE__, ##arg); \ } \ while (0) #define cam_info(fmt, arg...) \ do { \ printk(KERN_INFO "[%s:%d] " fmt, \ __func__, __LINE__, ##arg); \ } \ while (0) #elif defined(DEBUG_LEVEL_MID) #define CAM_DEBUG(fmt, arg...) #define cam_info(fmt, arg...) \ do { \ printk(KERN_INFO "[%s:%d] " fmt, \ __func__, __LINE__, ##arg); \ } \ while (0) #else #define CAM_DEBUG(fmt, arg...) #define cam_info(fmt, arg...) #endif #undef DEBUG_CAM_I2C #define DEBUG_CAM_I2C #if defined(DEBUG_CAM_I2C) #define cam_i2c_dbg(fmt, arg...) \ do { \ printk(KERN_DEBUG "[%s:%d] " fmt, \ __func__, __LINE__, ##arg); \ } \ while (0) #else #define cam_i2c_dbg(fmt, arg...) #endif #define cam_err(fmt, arg...) \ do { \ printk(KERN_ERR "[%s:%d] " fmt, \ __func__, __LINE__, ##arg); \ } \ while (0) #define SR200PC20_DELAY 0xFF00 struct sr200pc20_userset { unsigned int focus_mode; unsigned int focus_status; unsigned int continuous_af; unsigned int metering; unsigned int exposure; unsigned int wb; unsigned int iso; int contrast; int saturation; int sharpness; int brightness; int ev; int scene; unsigned int zoom; unsigned int effect; /* Color FX (AKA Color tone) */ unsigned int scenemode; unsigned int detectmode; unsigned int antishake; unsigned int fps; unsigned int flash_mode; unsigned int flash_state; unsigned int stabilize; /* IS */ unsigned int strobe; unsigned int jpeg_quality; /*unsigned int preview_size;*/ unsigned int preview_size_idx; unsigned int capture_size; unsigned int thumbnail_size; }; struct sr200pc20_work { struct work_struct work; }; struct sr200pc20_exif_data { unsigned short iso; unsigned short shutterspeed; }; struct sr200pc20_ctrl { const struct msm_camera_sensor_info *sensordata; struct sr200pc20_userset settings; struct msm_camera_i2c_client *sensor_i2c_client; struct msm_sensor_ctrl_t *s_ctrl; struct v4l2_subdev *sensor_dev; struct v4l2_subdev sensor_v4l2_subdev; struct v4l2_subdev_info *sensor_v4l2_subdev_info; uint8_t sensor_v4l2_subdev_info_size; struct v4l2_subdev_ops *sensor_v4l2_subdev_ops; int op_mode; int dtp_mode; int cam_mode; int vtcall_mode; int started; int flash_mode; int lowLight; int dtpTest; int af_mode; int af_status; unsigned int lux; int awb_mode; int samsungapp; }; enum sr200pc20_camera_mode_t { PREVIEW_MODE = 0, MOVIE_MODE }; enum sr200pc20_setting { RES_PREVIEW, RES_CAPTURE }; enum sr200pc20_reg_update { /* Sensor egisters that need to be updated during initialization */ REG_INIT, /* Sensor egisters that needs periodic I2C writes */ UPDATE_PERIODIC, /* All the sensor Registers will be updated */ UPDATE_ALL, /* Not valid update */ UPDATE_INVALID }; static struct sr200pc20_ctrl sr200pc20_control; static struct i2c_client *sr200pc20_client; static struct sr200pc20_exif_data sr200pc20_exif; static struct msm_sensor_ctrl_t sr200pc20_s_ctrl; static struct device sr200pc20_dev; static DECLARE_WAIT_QUEUE_HEAD(sr200pc20_wait_queue); DEFINE_MUTEX(sr200pc20_mut); #endif /* __sr200pc20_H__ */
/***************************************************************************** * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: mods/deathmatch/logic/packets/CPlayerSpawnPacket.h * PURPOSE: Player spawn packet class * DEVELOPERS: Christian Myhre Lundheim <> * Jax <> * * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ #ifndef __PACKETS_CPLAYERSPAWNPACKET_H #define __PACKETS_CPLAYERSPAWNPACKET_H #include "../CCommon.h" #include "CPacket.h" class CPlayerSpawnPacket : public CPacket { public: CPlayerSpawnPacket ( void ); CPlayerSpawnPacket ( ElementID PlayerID, const CVector& vecSpawnPosition, float fSpawnRotation, unsigned short usPlayerSkin, unsigned char ucInterior, unsigned short usDimension, ElementID Team, unsigned char ucTimeContext ); inline ePacketID GetPacketID ( void ) const { return PACKET_ID_PLAYER_SPAWN; }; inline unsigned long GetFlags ( void ) const { return PACKET_HIGH_PRIORITY | PACKET_RELIABLE | PACKET_SEQUENCED; }; bool Write ( NetBitStreamInterface& BitStream ) const; inline ElementID GetPlayer ( void ) { return m_PlayerID; }; inline CVector& GetSpawnPosition ( void ) { return m_vecSpawnPosition; }; inline float GetSpawnRotation ( void ) { return m_fSpawnRotation; }; inline unsigned short GetPlayerSkin ( void ) { return m_usPlayerSkin; }; inline ElementID GetTeam ( void ) { return m_Team; } inline unsigned char GetInterior ( void ) { return m_ucInterior; } inline unsigned short GetDimension ( void ) { return m_usDimension; } inline void SetPlayer ( ElementID PlayerID ) { m_PlayerID = PlayerID; }; inline void SetSpawnPosition ( CVector& vecPosition ) { m_vecSpawnPosition = vecPosition; }; inline void SetSpawnRotation ( float fRotation ) { m_fSpawnRotation = fRotation; }; inline void SetPlayerSkin ( unsigned short usPlayerSkin ) { m_usPlayerSkin = usPlayerSkin; }; inline void SetTeam ( ElementID TeamID ) { m_Team = TeamID; } inline void SetInterior ( unsigned char ucInterior ) { m_ucInterior = ucInterior; } inline void SetDimension ( unsigned short usDimension ) { m_usDimension = usDimension; } private: ElementID m_PlayerID; CVector m_vecSpawnPosition; float m_fSpawnRotation; unsigned short m_usPlayerSkin; ElementID m_Team; unsigned char m_ucInterior; unsigned short m_usDimension; unsigned char m_ucTimeContext; }; #endif
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * pkix_validate.h * * Header file for validateChain function * */ #ifndef _PKIX_VALIDATE_H #define _PKIX_VALIDATE_H #include "pkix_tools.h" #ifdef __cplusplus extern "C" { #endif PKIX_Error * pkix_CheckChain( PKIX_List *certs, PKIX_UInt32 numCerts, PKIX_TrustAnchor *anchor, PKIX_List *checkers, PKIX_RevocationChecker *revChecker, PKIX_List *buildCheckedExtOIDs, PKIX_ProcessingParams *procParams, PKIX_UInt32 *pCertCheckedIndex, PKIX_UInt32 *pCheckerIndex, PKIX_Boolean *pRevChecking, PKIX_UInt32 *pReasonCode, void **pNBIOContext, PKIX_PL_PublicKey **pFinalSubjPubKey, PKIX_PolicyNode **pPolicyTree, PKIX_VerifyNode **pVerifyTree, void *plContext); #ifdef __cplusplus } #endif #endif /* _PKIX_VALIDATE_H */
/* Copyright (C) 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. In addition to the permissions in the GNU Lesser General Public License, the Free Software Foundation gives you unlimited permission to link the compiled version of this file with other programs, and to distribute those programs without any restriction coming from the use of this file. (The GNU Lesser General Public License restrictions do apply in other respects; for example, they cover modification of the file, and distribution when not linked into another program.) Note that people who make modified versions of this file are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include "internals.h" #include <fork.h> /* This is defined by newer gcc version unique for each module. */ extern void *__dso_handle __attribute__ ((__weak__)); /* Hide the symbol so that no definition but the one locally in the executable or DSO is used. */ int #ifndef __pthread_atfork /* Don't mark the compatibility function as hidden. */ attribute_hidden #endif __pthread_atfork (prepare, parent, child) void (*prepare) (void); void (*parent) (void); void (*child) (void); { return __register_atfork (prepare, parent, child, &__dso_handle == NULL ? NULL : __dso_handle); } #ifndef __pthread_atfork extern int pthread_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void)) attribute_hidden; strong_alias (__pthread_atfork, pthread_atfork) #endif
//===- ScopedNoAliasAA.h - Scoped No-Alias Alias Analysis -------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // /// \file /// This is the interface for a metadata-based scoped no-alias analysis. // //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_SCOPEDNOALIASAA_H #define LLVM_ANALYSIS_SCOPEDNOALIASAA_H #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/IR/InstrTypes.h" #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" #include <memory> namespace llvm { class Function; class MDNode; class MemoryLocation; /// A simple AA result which uses scoped-noalias metadata to answer queries. class ScopedNoAliasAAResult : public AAResultBase<ScopedNoAliasAAResult> { friend AAResultBase<ScopedNoAliasAAResult>; public: /// Handle invalidation events from the new pass manager. /// /// By definition, this result is stateless and so remains valid. bool invalidate(Function &, const PreservedAnalyses &, FunctionAnalysisManager::Invalidator &) { return false; } AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI); ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI); ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2, AAQueryInfo &AAQI); private: bool mayAliasInScopes(const MDNode *Scopes, const MDNode *NoAlias) const; }; /// Analysis pass providing a never-invalidated alias analysis result. class ScopedNoAliasAA : public AnalysisInfoMixin<ScopedNoAliasAA> { friend AnalysisInfoMixin<ScopedNoAliasAA>; static AnalysisKey Key; public: using Result = ScopedNoAliasAAResult; ScopedNoAliasAAResult run(Function &F, FunctionAnalysisManager &AM); }; /// Legacy wrapper pass to provide the ScopedNoAliasAAResult object. class ScopedNoAliasAAWrapperPass : public ImmutablePass { std::unique_ptr<ScopedNoAliasAAResult> Result; public: static char ID; ScopedNoAliasAAWrapperPass(); ScopedNoAliasAAResult &getResult() { return *Result; } const ScopedNoAliasAAResult &getResult() const { return *Result; } bool doInitialization(Module &M) override; bool doFinalization(Module &M) override; void getAnalysisUsage(AnalysisUsage &AU) const override; }; //===--------------------------------------------------------------------===// // // createScopedNoAliasAAWrapperPass - This pass implements metadata-based // scoped noalias analysis. // ImmutablePass *createScopedNoAliasAAWrapperPass(); } // end namespace llvm #endif // LLVM_ANALYSIS_SCOPEDNOALIASAA_H
/*============================================================================ This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic Package, Release 3e, by John R. Hauser. Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =============================================================================*/ #include <stdint.h> #include "platform.h" #include "internals.h" struct exp32_sig128 softfloat_normSubnormalF128Sig( uint_fast64_t sig64, uint_fast64_t sig0 ) { int_fast8_t shiftDist; struct exp32_sig128 z; if ( ! sig64 ) { shiftDist = softfloat_countLeadingZeros64( sig0 ) - 15; z.exp = -63 - shiftDist; if ( shiftDist < 0 ) { z.sig.v64 = sig0>>-shiftDist; z.sig.v0 = sig0<<(shiftDist & 63); } else { z.sig.v64 = sig0<<shiftDist; z.sig.v0 = 0; } } else { shiftDist = softfloat_countLeadingZeros64( sig64 ) - 15; z.exp = 1 - shiftDist; z.sig = softfloat_shortShiftLeft128( sig64, sig0, shiftDist ); } return z; }
/* * Copyright 2010-present Facebook. * * 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. */ /* * This file is generated during the SDK build process. * Please do not hand edit this file. * It can be rebuilt by running * * ./image_to_code.py -i src/ImageResources/FBLikeButton/FBLikeButtonIcon.png -c FBLikeButtonIcon -o src/ImageResources * */ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface FBLikeButtonIconPNG : NSObject + (UIImage *)image; @end
/* * Copyright (c) 2015, Igalia S.L * Author: Philippe Normand <philn@igalia.com> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or other * materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT 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. */ /*/ \*\ OwrGstAudioRenderer /*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "owr_gst_audio_renderer.h" #include "owr_media_renderer_private.h" #include "owr_private.h" #define DEFAULT_AUDIO_SINK "pulsesink" #define OWR_GST_AUDIO_RENDERER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), OWR_GST_TYPE_AUDIO_RENDERER, OwrGstAudioRendererPrivate)) G_DEFINE_TYPE(OwrGstAudioRenderer, owr_gst_audio_renderer, OWR_TYPE_AUDIO_RENDERER) enum { PROP_0, PROP_SINK, N_PROPERTIES }; static GParamSpec *obj_properties[N_PROPERTIES] = {NULL, }; static void owr_gst_audio_renderer_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); static void owr_gst_audio_renderer_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static GstElement *owr_gst_audio_renderer_get_sink(OwrMediaRenderer *renderer); struct _OwrGstAudioRendererPrivate { GstElement *sink; }; static void owr_gst_audio_renderer_dispose(GObject *object) { OwrGstAudioRenderer *renderer = OWR_GST_AUDIO_RENDERER(object); OwrGstAudioRendererPrivate *priv = renderer->priv; if (priv->sink) { gst_object_unref(priv->sink); priv->sink = NULL; } G_OBJECT_CLASS(owr_gst_audio_renderer_parent_class)->dispose(object); } static void owr_gst_audio_renderer_class_init(OwrGstAudioRendererClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); OwrMediaRendererClass *media_renderer_class = OWR_MEDIA_RENDERER_CLASS(klass); g_type_class_add_private(klass, sizeof(OwrGstAudioRendererPrivate)); obj_properties[PROP_SINK] = g_param_spec_object("sink", "sink", "Audio sink to use for rendering (default: pulsesink)", G_TYPE_OBJECT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); gobject_class->set_property = owr_gst_audio_renderer_set_property; gobject_class->get_property = owr_gst_audio_renderer_get_property; gobject_class->dispose = owr_gst_audio_renderer_dispose; media_renderer_class->get_sink = (void *(*)(OwrMediaRenderer *))owr_gst_audio_renderer_get_sink; g_object_class_install_properties(gobject_class, N_PROPERTIES, obj_properties); } static void owr_gst_audio_renderer_init(OwrGstAudioRenderer *renderer) { OwrGstAudioRendererPrivate *priv; renderer->priv = priv = OWR_GST_AUDIO_RENDERER_GET_PRIVATE(renderer); priv->sink = NULL; } static void owr_gst_audio_renderer_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { OwrGstAudioRendererPrivate *priv; GstElement *sink; g_return_if_fail(object); priv = OWR_GST_AUDIO_RENDERER_GET_PRIVATE(object); switch (property_id) { case PROP_SINK: sink = g_value_get_object(value); if (!GST_IS_ELEMENT(sink)) break; if (priv->sink) gst_object_unref(priv->sink); priv->sink = sink; gst_object_ref_sink(sink); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } static void owr_gst_audio_renderer_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { OwrGstAudioRendererPrivate *priv; g_return_if_fail(object); priv = OWR_GST_AUDIO_RENDERER_GET_PRIVATE(object); switch (property_id) { case PROP_SINK: g_value_set_object(value, priv->sink); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break; } } /** * owr_gst_audio_renderer_new: (constructor) * @sink: * * Returns: The new #OwrGstAudioRenderer */ OwrGstAudioRenderer *owr_gst_audio_renderer_new(GstElement *sink) { return g_object_new(OWR_GST_TYPE_AUDIO_RENDERER, "media-type", OWR_MEDIA_TYPE_AUDIO, "sink", sink, NULL); } static GstElement *owr_gst_audio_renderer_get_sink(OwrMediaRenderer *renderer) { OwrGstAudioRenderer *audio_renderer; OwrGstAudioRendererPrivate *priv; GstElement *sink; g_assert(renderer); audio_renderer = OWR_GST_AUDIO_RENDERER(renderer); priv = audio_renderer->priv; sink = priv->sink ? priv->sink : gst_element_factory_make(DEFAULT_AUDIO_SINK, "audio-renderer-sink"); return sink; }
// 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 CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_H_ #define CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_H_ #include "base/files/file.h" #include "base/process/launch.h" namespace content { // FileDescriptorInfo is a collection of file descriptors which is // needed to launch a process. You should tell FileDescriptorInfo // which FD should be closed and which shouldn't so that it can take care // of the lifetime of FDs. // // See base/process/launcher.h for more details about launching a // process. class FileDescriptorInfo { public: virtual ~FileDescriptorInfo() {} // Add an FD associated with an ID, without delegating the ownerhip // of ID. virtual void Share(int id, base::PlatformFile fd) = 0; // Add an FD associated with an ID, passing the FD ownership to // FileDescriptorInfo. virtual void Transfer(int id, base::ScopedFD fd) = 0; // A vecotr backed map of registered ID-FD pairs. virtual const base::FileHandleMappingVector& GetMapping() const = 0; // A GetMapping() variant what adjusts the ID value by |delta|. // Some environments need this trick. virtual base::FileHandleMappingVector GetMappingWithIDAdjustment( int delta) const = 0; // API for iterating registered ID-FD pairs. virtual base::PlatformFile GetFDAt(size_t i) const = 0; virtual int GetIDAt(size_t i) const = 0; virtual size_t GetMappingSize() const = 0; // True if |this| has an ownership of |file|. virtual bool OwnsFD(base::PlatformFile file) const = 0; // Assuming |OwnsFD(file)|, release the ownership. virtual base::ScopedFD ReleaseFD(base::PlatformFile file) = 0; }; } #endif // CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_H_
/* SPDX-License-Identifier: GPL-2.0 */ /****************************************************************************** * * Copyright(c) 2013 Realtek Corporation. All rights reserved. * ******************************************************************************/ #ifndef __HAL_BTCOEX_H__ #define __HAL_BTCOEX_H__ #include <drv_types.h> #define LPS_RPWM_WAIT_MS 300 /* Some variables can't get from outsrc BT-Coex, */ /* so we need to save here */ struct bt_coexist { u8 bBtExist; u8 btTotalAntNum; u8 btChipType; u8 bInitlized; }; void hal_btcoex_SetBTCoexist(struct adapter *padapter, u8 bBtExist); bool hal_btcoex_IsBtExist(struct adapter *padapter); bool hal_btcoex_IsBtDisabled(struct adapter *); void hal_btcoex_SetChipType(struct adapter *padapter, u8 chipType); void hal_btcoex_SetPgAntNum(struct adapter *padapter, u8 antNum); void hal_btcoex_SetSingleAntPath(struct adapter *padapter, u8 singleAntPath); void hal_btcoex_Initialize(void *padapter); void hal_btcoex_PowerOnSetting(struct adapter *padapter); void hal_btcoex_InitHwConfig(struct adapter *padapter, u8 bWifiOnly); void hal_btcoex_IpsNotify(struct adapter *padapter, u8 type); void hal_btcoex_LpsNotify(struct adapter *padapter, u8 type); void hal_btcoex_ScanNotify(struct adapter *padapter, u8 type); void hal_btcoex_ConnectNotify(struct adapter *padapter, u8 action); void hal_btcoex_MediaStatusNotify(struct adapter *padapter, u8 mediaStatus); void hal_btcoex_SpecialPacketNotify(struct adapter *padapter, u8 pktType); void hal_btcoex_IQKNotify(struct adapter *padapter, u8 state); void hal_btcoex_BtInfoNotify(struct adapter *padapter, u8 length, u8 *tmpBuf); void hal_btcoex_SuspendNotify(struct adapter *padapter, u8 state); void hal_btcoex_HaltNotify(struct adapter *padapter); void hal_btcoex_Handler(struct adapter *padapter); s32 hal_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter *padapter); void hal_btcoex_SetManualControl(struct adapter *padapter, u8 bmanual); bool hal_btcoex_IsBtControlLps(struct adapter *padapter); bool hal_btcoex_IsLpsOn(struct adapter *padapter); u8 hal_btcoex_RpwmVal(struct adapter *); u8 hal_btcoex_LpsVal(struct adapter *); u32 hal_btcoex_GetRaMask(struct adapter *); void hal_btcoex_RecordPwrMode(struct adapter *padapter, u8 *pCmdBuf, u8 cmdLen); #endif /* !__HAL_BTCOEX_H__ */
/* * D-Cinema audio demuxer * Copyright (c) 2005 Reimar Döffinger. * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avformat.h" static int daud_header(AVFormatContext *s, AVFormatParameters *ap) { AVStream *st = av_new_stream(s, 0); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_PCM_S24DAUD; st->codec->codec_tag = MKTAG('d', 'a', 'u', 'd'); st->codec->channels = 6; st->codec->sample_rate = 96000; st->codec->bit_rate = 3 * 6 * 96000 * 8; st->codec->block_align = 3 * 6; st->codec->bits_per_sample = 24; return 0; } static int daud_packet(AVFormatContext *s, AVPacket *pkt) { ByteIOContext *pb = &s->pb; int ret, size; if (url_feof(pb)) return AVERROR_IO; size = get_be16(pb); get_be16(pb); // unknown ret = av_get_packet(pb, pkt, size); pkt->stream_index = 0; return ret; } AVInputFormat daud_demuxer = { "daud", "D-Cinema audio format", 0, NULL, daud_header, daud_packet, NULL, NULL, .extensions = "302", };
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2005-2006 Refractions Research Inc. * Copyright (C) 2001-2002 Vivid Solutions Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * ********************************************************************** * * Last port: geomgraph/NodeMap.java rev. 1.3 (JTS-1.10) * **********************************************************************/ #ifndef GEOS_GEOMGRAPH_NODEMAP_H #define GEOS_GEOMGRAPH_NODEMAP_H #include <geos/export.h> #include <map> #include <vector> #include <string> #include <geos/geom/Coordinate.h> // for CoordinateLessThen #include <geos/geomgraph/Node.h> // for testInvariant #include <geos/inline.h> #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class #endif // Forward declarations namespace geos { namespace geomgraph { class Node; class EdgeEnd; class NodeFactory; } } namespace geos { namespace geomgraph { // geos.geomgraph class GEOS_DLL NodeMap{ public: typedef std::map<geom::Coordinate*,Node*,geom::CoordinateLessThen> container; typedef container::iterator iterator; typedef container::const_iterator const_iterator; typedef std::pair<geom::Coordinate*,Node*> pair; container nodeMap; const NodeFactory &nodeFact; /// \brief /// NodeMap will keep a reference to the NodeFactory, /// keep it alive for the whole NodeMap lifetime NodeMap(const NodeFactory &newNodeFact); virtual ~NodeMap(); Node* addNode(const geom::Coordinate& coord); Node* addNode(Node *n); void add(EdgeEnd *e); Node *find(const geom::Coordinate& coord) const; const_iterator begin() const { return nodeMap.begin(); } const_iterator end() const { return nodeMap.end(); } iterator begin() { return nodeMap.begin(); } iterator end() { return nodeMap.end(); } void getBoundaryNodes(int geomIndex, std::vector<Node*>&bdyNodes) const; std::string print() const; void testInvariant() { #ifndef NDEBUG // Each Coordinate key is a pointer inside the Node value for (iterator it=begin(), itEnd=end(); it != itEnd; ++it) { pair p = *it; geomgraph::Node* n = p.second; geom::Coordinate* c = const_cast<geom::Coordinate*>( &(n->getCoordinate()) ); assert(p.first == c); } #endif } private: // Declare type as noncopyable NodeMap(const NodeMap& other); NodeMap& operator=(const NodeMap& rhs); }; } // namespace geos.geomgraph } // namespace geos #ifdef _MSC_VER #pragma warning(pop) #endif #endif // ifndef GEOS_GEOMGRAPH_NODEMAP_H
/* Copyright (c) 2012, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef SENSORS_ADSP_H #define SENSORS_ADSP_H #include <linux/types.h> #define SNS_OCMEM_MAX_NUM_SEG_V01 16 #define SNS_OCMEM_MAX_VECTORS_SIZE_V01 512 #define SNS_OCMEM_CANCEL_REQ_V01 0x0000 #define SNS_OCMEM_CANCEL_RESP_V01 0x0000 #define SNS_OCMEM_VERSION_REQ_V01 0x0001 #define SNS_OCMEM_VERSION_RESP_V01 0x0001 #define SNS_OCMEM_PHYS_ADDR_REQ_V01 0x0002 #define SNS_OCMEM_PHYS_ADDR_RESP_V01 0x0002 #define SNS_OCMEM_HAS_CLIENT_IND_V01 0x0002 #define SNS_OCMEM_BW_VOTE_REQ_V01 0x0003 #define SNS_OCMEM_BW_VOTE_RESP_V01 0x0003 #define SNS_OCMEM_BW_VOTE_IND_V01 0x0003 enum { SNS_OCMEM_MODULE_KERNEL = 0, SNS_OCMEM_MODULE_ADSP }; enum { SNS_OCMEM_MSG_TYPE_REQ = 0, SNS_OCMEM_MSG_TYPE_RESP, SNS_OCMEM_MSG_TYPE_IND }; struct sns_ocmem_hdr_s { int32_t msg_id ; uint16_t msg_size; uint8_t dst_module; uint8_t src_module; uint8_t msg_type; } __packed; struct sns_ocmem_common_resp_s_v01 { uint8_t sns_result_t; uint8_t sns_err_t; }; struct sns_mem_segment_s_v01 { uint64_t start_address; uint32_t size; uint16_t type; } __packed; struct sns_ocmem_phys_addr_resp_msg_v01 { struct sns_ocmem_common_resp_s_v01 resp; uint32_t segments_len; struct sns_mem_segment_s_v01 segments[SNS_OCMEM_MAX_NUM_SEG_V01]; uint8_t segments_valid; } __packed ; struct sns_ocmem_has_client_ind_msg_v01 { uint16_t num_clients; } __packed; struct sns_ocmem_bw_vote_req_msg_v01 { uint8_t is_map; uint8_t vectors_valid; uint32_t vectors_len; uint8_t vectors[SNS_OCMEM_MAX_VECTORS_SIZE_V01]; } __packed; struct sns_ocmem_bw_vote_resp_msg_v01 { struct sns_ocmem_common_resp_s_v01 resp; }; struct sns_ocmem_bw_vote_ind_msg_v01 { uint8_t is_vote_on; } __packed; #endif
/* * arch/arm/mach-ebsa110/include/mach/io.h * * Copyright (C) 1997,1998 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Modifications: * 06-Dec-1997 RMK Created. */ #ifndef __ASM_ARM_ARCH_IO_H #define __ASM_ARM_ARCH_IO_H u8 __inb8(unsigned int port); void __outb8(u8 val, unsigned int port); u8 __inb16(unsigned int port); void __outb16(u8 val, unsigned int port); u16 __inw(unsigned int port); void __outw(u16 val, unsigned int port); u32 __inl(unsigned int port); void __outl(u32 val, unsigned int port); u8 __readb(const volatile void __iomem *addr); u16 __readw(const volatile void __iomem *addr); u32 __readl(const volatile void __iomem *addr); void __writeb(u8 val, void __iomem *addr); void __writew(u16 val, void __iomem *addr); void __writel(u32 val, void __iomem *addr); #ifdef ISA_SIXTEEN_BIT_PERIPHERAL #define inb(p) __inb16(p) #define outb(v,p) __outb16(v,p) #else #define inb(p) __inb8(p) #define outb(v,p) __outb8(v,p) #endif #define inw(p) __inw(p) #define outw(v,p) __outw(v,p) #define inl(p) __inl(p) #define outl(v,p) __outl(v,p) #define readb(b) __readb(b) #define readw(b) __readw(b) #define readl(b) __readl(b) #define readb_relaxed(addr) readb(addr) #define readw_relaxed(addr) readw(addr) #define readl_relaxed(addr) readl(addr) #define writeb(v,b) __writeb(v,b) #define writew(v,b) __writew(v,b) #define writel(v,b) __writel(v,b) extern void insb(unsigned int port, void *buf, int sz); extern void insw(unsigned int port, void *buf, int sz); extern void insl(unsigned int port, void *buf, int sz); extern void outsb(unsigned int port, const void *buf, int sz); extern void outsw(unsigned int port, const void *buf, int sz); extern void outsl(unsigned int port, const void *buf, int sz); extern void writesw(void __iomem *addr, const void *data, int wordlen); extern void writesl(void __iomem *addr, const void *data, int longlen); extern void readsw(const void __iomem *addr, void *data, int wordlen); extern void readsl(const void __iomem *addr, void *data, int longlen); #endif
/* * Copyright (C) 1999 - 2010 Intel Corporation. * Copyright (C) 2010 OKI SEMICONDUCTOR Co., LTD. * * This code was derived from the Intel e1000e Linux driver. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _PCH_GBE_PHY_H_ #define _PCH_GBE_PHY_H_ #define PCH_GBE_PHY_REGS_LEN 32 #define PCH_GBE_PHY_RESET_DELAY_US 10 #define PCH_GBE_MAC_IFOP_RGMII s32 pch_gbe_phy_get_id(struct pch_gbe_hw *hw); s32 pch_gbe_phy_read_reg_miic(struct pch_gbe_hw *hw, u32 offset, u16 *data); s32 pch_gbe_phy_write_reg_miic(struct pch_gbe_hw *hw, u32 offset, u16 data); void pch_gbe_phy_sw_reset(struct pch_gbe_hw *hw); void pch_gbe_phy_hw_reset(struct pch_gbe_hw *hw); void pch_gbe_phy_power_up(struct pch_gbe_hw *hw); void pch_gbe_phy_power_down(struct pch_gbe_hw *hw); void pch_gbe_phy_set_rgmii(struct pch_gbe_hw *hw); void pch_gbe_phy_init_setting(struct pch_gbe_hw *hw); #endif
#include <linux/module.h> #include <linux/smp.h> #include <linux/user.h> #include <linux/elfcore.h> #include <linux/sched.h> #include <linux/in6.h> #include <linux/interrupt.h> #include <linux/string.h> #include <asm/processor.h> #include <asm/uaccess.h> #include <asm/checksum.h> #include <asm/io.h> #include <asm/delay.h> #include <asm/irq.h> #include <asm/tlbflush.h> #include <asm/pgtable.h> EXPORT_SYMBOL(boot_cpu_data); EXPORT_SYMBOL(dump_fpu); EXPORT_SYMBOL(__ioremap); EXPORT_SYMBOL(iounmap); EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(strncpy_from_user); EXPORT_SYMBOL(__strncpy_from_user); EXPORT_SYMBOL(clear_user); EXPORT_SYMBOL(__clear_user); EXPORT_SYMBOL(__generic_copy_from_user); EXPORT_SYMBOL(__generic_copy_to_user); EXPORT_SYMBOL(strnlen_user); #ifdef CONFIG_SMP #ifdef CONFIG_CHIP_M32700_TS1 extern void *dcache_dummy; EXPORT_SYMBOL(dcache_dummy); #endif EXPORT_SYMBOL(cpu_data); EXPORT_SYMBOL(smp_flush_tlb_page); #endif extern void __ashldi3(void); extern void __ashrdi3(void); extern void __lshldi3(void); extern void __lshrdi3(void); extern void __muldi3(void); EXPORT_SYMBOL(__ashldi3); EXPORT_SYMBOL(__ashrdi3); EXPORT_SYMBOL(__lshldi3); EXPORT_SYMBOL(__lshrdi3); EXPORT_SYMBOL(__muldi3); EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memset); EXPORT_SYMBOL(copy_page); EXPORT_SYMBOL(clear_page); EXPORT_SYMBOL(strlen); EXPORT_SYMBOL(empty_zero_page); EXPORT_SYMBOL(_inb); EXPORT_SYMBOL(_inw); EXPORT_SYMBOL(_inl); EXPORT_SYMBOL(_outb); EXPORT_SYMBOL(_outw); EXPORT_SYMBOL(_outl); EXPORT_SYMBOL(_inb_p); EXPORT_SYMBOL(_inw_p); EXPORT_SYMBOL(_inl_p); EXPORT_SYMBOL(_outb_p); EXPORT_SYMBOL(_outw_p); EXPORT_SYMBOL(_outl_p); EXPORT_SYMBOL(_insb); EXPORT_SYMBOL(_insw); EXPORT_SYMBOL(_insl); EXPORT_SYMBOL(_outsb); EXPORT_SYMBOL(_outsw); EXPORT_SYMBOL(_outsl); EXPORT_SYMBOL(_readb); EXPORT_SYMBOL(_readw); EXPORT_SYMBOL(_readl); EXPORT_SYMBOL(_writeb); EXPORT_SYMBOL(_writew); EXPORT_SYMBOL(_writel);
/* Implement the snprintf function. Copyright (C) 2003 Free Software Foundation, Inc. Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>. This file is part of the libiberty library. This library 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 library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* @deftypefn Supplemental int snprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, ...) This function is similar to @code{sprintf}, but it will write to @var{buf} at most @code{@var{n}-1} bytes of text, followed by a terminating null byte, for a total of @var{n} bytes. On error the return value is -1, otherwise it returns the number of bytes, not including the terminating null byte, that would have been written had @var{n} been sufficiently large, regardless of the actual value of @var{n}. Note some pre-C99 system libraries do not implement this correctly so users cannot generally rely on the return value if the system version of this function is used. @end deftypefn */ #include "ansidecl.h" #include <stdarg.h> #include <stddef.h> int vsnprintf (char *, size_t, const char *, va_list); int snprintf (char *s, size_t n, const char *format, ...) { int result; VA_OPEN (ap, format); VA_FIXEDARG (ap, char *, s); VA_FIXEDARG (ap, size_t, n); VA_FIXEDARG (ap, const char *, format); result = vsnprintf (s, n, format, ap); VA_CLOSE (ap); return result; }
#ifndef __ASM_SN_HUB_H #define __ASM_SN_HUB_H #include <linux/types.h> #include <linux/cpumask.h> #include <asm/sn/types.h> #include <asm/sn/io.h> #include <asm/sn/klkernvars.h> #include <asm/xtalk/xtalk.h> extern unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget, unsigned long xtalk_addr, size_t size); extern void hub_pio_init(cnodeid_t cnode); #endif
/* * Mesa 3-D graphics library * Version: 6.3 * * Copyright (C) 1999-2005 Brian Paul 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 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file math/m_matrix.h * Defines basic structures for matrix-handling. */ #ifndef _M_MATRIX_H #define _M_MATRIX_H #include "main/glheader.h" /** * \name Symbolic names to some of the entries in the matrix * * These are handy for the viewport mapping, which is expressed as a matrix. */ /*@{*/ #define MAT_SX 0 #define MAT_SY 5 #define MAT_SZ 10 #define MAT_TX 12 #define MAT_TY 13 #define MAT_TZ 14 /*@}*/ /** * Different kinds of 4x4 transformation matrices. * We use these to select specific optimized vertex transformation routines. */ enum GLmatrixtype { MATRIX_GENERAL, /**< general 4x4 matrix */ MATRIX_IDENTITY, /**< identity matrix */ MATRIX_3D_NO_ROT, /**< orthogonal projection and others... */ MATRIX_PERSPECTIVE, /**< perspective projection matrix */ MATRIX_2D, /**< 2-D transformation */ MATRIX_2D_NO_ROT, /**< 2-D scale & translate only */ MATRIX_3D /**< 3-D transformation */ } ; /** * Matrix type to represent 4x4 transformation matrices. */ typedef struct { GLfloat *m; /**< 16 matrix elements (16-byte aligned) */ GLfloat *inv; /**< optional 16-element inverse (16-byte aligned) */ GLuint flags; /**< possible values determined by (of \link * MatFlags MAT_FLAG_* flags\endlink) */ enum GLmatrixtype type; } GLmatrix; extern void _math_matrix_ctr( GLmatrix *m ); extern void _math_matrix_dtr( GLmatrix *m ); extern void _math_matrix_alloc_inv( GLmatrix *m ); extern void _math_matrix_mul_matrix( GLmatrix *dest, const GLmatrix *a, const GLmatrix *b ); extern void _math_matrix_mul_floats( GLmatrix *dest, const GLfloat *b ); extern void _math_matrix_loadf( GLmatrix *mat, const GLfloat *m ); extern void _math_matrix_translate( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ); extern void _math_matrix_rotate( GLmatrix *m, GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); extern void _math_matrix_scale( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ); extern void _math_matrix_ortho( GLmatrix *mat, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearval, GLfloat farval ); extern void _math_matrix_frustum( GLmatrix *mat, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearval, GLfloat farval ); extern void _math_matrix_viewport(GLmatrix *m, GLint x, GLint y, GLint width, GLint height, GLfloat zNear, GLfloat zFar, GLfloat depthMax); extern void _math_matrix_set_identity( GLmatrix *dest ); extern void _math_matrix_copy( GLmatrix *to, const GLmatrix *from ); extern void _math_matrix_analyse( GLmatrix *mat ); extern void _math_matrix_print( const GLmatrix *m ); extern GLboolean _math_matrix_is_length_preserving( const GLmatrix *m ); extern GLboolean _math_matrix_has_rotation( const GLmatrix *m ); extern GLboolean _math_matrix_is_general_scale( const GLmatrix *m ); extern GLboolean _math_matrix_is_dirty( const GLmatrix *m ); /** * \name Related functions that don't actually operate on GLmatrix structs */ /*@{*/ extern void _math_transposef( GLfloat to[16], const GLfloat from[16] ); extern void _math_transposed( GLdouble to[16], const GLdouble from[16] ); extern void _math_transposefd( GLfloat to[16], const GLdouble from[16] ); /* * Transform a point (column vector) by a matrix: Q = M * P */ #define TRANSFORM_POINT( Q, M, P ) \ Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12] * P[3]; \ Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13] * P[3]; \ Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14] * P[3]; \ Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15] * P[3]; #define TRANSFORM_POINT3( Q, M, P ) \ Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12]; \ Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13]; \ Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14]; \ Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15]; /* * Transform a normal (row vector) by a matrix: [NX NY NZ] = N * MAT */ #define TRANSFORM_NORMAL( TO, N, MAT ) \ do { \ TO[0] = N[0] * MAT[0] + N[1] * MAT[1] + N[2] * MAT[2]; \ TO[1] = N[0] * MAT[4] + N[1] * MAT[5] + N[2] * MAT[6]; \ TO[2] = N[0] * MAT[8] + N[1] * MAT[9] + N[2] * MAT[10]; \ } while (0) /** * Transform a direction by a matrix. */ #define TRANSFORM_DIRECTION( TO, DIR, MAT ) \ do { \ TO[0] = DIR[0] * MAT[0] + DIR[1] * MAT[4] + DIR[2] * MAT[8]; \ TO[1] = DIR[0] * MAT[1] + DIR[1] * MAT[5] + DIR[2] * MAT[9]; \ TO[2] = DIR[0] * MAT[2] + DIR[1] * MAT[6] + DIR[2] * MAT[10];\ } while (0) extern void _mesa_transform_vector(GLfloat u[4], const GLfloat v[4], const GLfloat m[16]); /*@}*/ #endif
#include <spawn.h> int posix_spawnattr_getsigdefault(const posix_spawnattr_t *restrict attr, sigset_t *restrict def) { *def = attr->__def; return 0; }
/* Copyright 2005-2015 Intel Corporation. All Rights Reserved. This file is part of Threading Building Blocks. Threading Building Blocks 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. Threading Building Blocks 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 Threading Building Blocks; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA As a special exception, you may use this file as part of a free software library without restriction. Specifically, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other files to produce an executable, this file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ #ifndef __TBB_aligned_space_H #define __TBB_aligned_space_H #include "tbb_stddef.h" #include "tbb_machine.h" namespace tbb { //! Block of space aligned sufficiently to construct an array T with N elements. /** The elements are not constructed or destroyed by this class. @ingroup memory_allocation */ template<typename T,size_t N=1> class aligned_space { private: typedef __TBB_TypeWithAlignmentAtLeastAsStrict(T) element_type; element_type array[(sizeof(T)*N+sizeof(element_type)-1)/sizeof(element_type)]; public: //! Pointer to beginning of array T* begin() {return internal::punned_cast<T*>(this);} //! Pointer to one past last element in array. T* end() {return begin()+N;} }; } // namespace tbb #endif /* __TBB_aligned_space_H */
/* * DNS support driver * * Copyright (c) 2008 Pieter Voorthuijsen <pieter.voorthuijsen@prodrive.nl> * Copyright (c) 2009 Robin Getz <rgetz@blackfin.uclinux.org> * * This is a simple DNS implementation for U-Boot. It will use the first IP * in the DNS response as NetServerIP. This can then be used for any other * network related activities. * * The packet handling is partly based on TADNS, original copyrights * follow below. * */ /* * Copyright (c) 2004-2005 Sergey Lyubka <valenok@gmail.com> * * "THE BEER-WARE LICENSE" (Revision 42): * Sergey Lyubka wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. */ #include <common.h> #include <command.h> #include <net.h> #include <asm/unaligned.h> #include "dns.h" char *NetDNSResolve; /* The host to resolve */ char *NetDNSenvvar; /* The envvar to store the answer in */ static int DnsOurPort; static void DnsSend(void) { struct header *header; int n, name_len; uchar *p, *pkt; const char *s; const char *name; enum dns_query_type qtype = DNS_A_RECORD; name = NetDNSResolve; pkt = p = (uchar *)(NetTxPacket + NetEthHdrSize() + IP_HDR_SIZE); /* Prepare DNS packet header */ header = (struct header *) pkt; header->tid = 1; header->flags = htons(0x100); /* standard query */ header->nqueries = htons(1); /* Just one query */ header->nanswers = 0; header->nauth = 0; header->nother = 0; /* Encode DNS name */ name_len = strlen(name); p = (uchar *) &header->data; /* For encoding host name into packet */ do { s = strchr(name, '.'); if (!s) s = name + name_len; n = s - name; /* Chunk length */ *p++ = n; /* Copy length */ memcpy(p, name, n); /* Copy chunk */ p += n; if (*s == '.') n++; name += n; name_len -= n; } while (*s != '\0'); *p++ = 0; /* Mark end of host name */ *p++ = 0; /* Some servers require double null */ *p++ = (unsigned char) qtype; /* Query Type */ *p++ = 0; *p++ = 1; /* Class: inet, 0x0001 */ n = p - pkt; /* Total packet length */ debug("Packet size %d\n", n); DnsOurPort = random_port(); NetSendUDPPacket(NetServerEther, NetOurDNSIP, DNS_SERVICE_PORT, DnsOurPort, n); debug("DNS packet sent\n"); } static void DnsTimeout(void) { puts("Timeout\n"); NetState = NETLOOP_FAIL; } static void DnsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len) { struct header *header; const unsigned char *p, *e, *s; u16 type, i; int found, stop, dlen; char IPStr[22]; IPaddr_t IPAddress; debug("%s\n", __func__); if (dest != DnsOurPort) return; for (i = 0; i < len; i += 4) debug("0x%p - 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n", pkt+i, pkt[i], pkt[i+1], pkt[i+2], pkt[i+3]); /* We sent one query. We want to have a single answer: */ header = (struct header *) pkt; if (ntohs(header->nqueries) != 1) return; /* Received 0 answers */ if (header->nanswers == 0) { puts("DNS: host not found\n"); NetState = NETLOOP_SUCCESS; return; } /* Skip host name */ s = &header->data[0]; e = pkt + len; for (p = s; p < e && *p != '\0'; p++) continue; /* We sent query class 1, query type 1 */ if (&p[5] > e || get_unaligned_be16(p+1) != DNS_A_RECORD) { puts("DNS: response was not an A record\n"); NetState = NETLOOP_SUCCESS; return; } /* Go to the first answer section */ p += 5; /* Loop through the answers, we want A type answer */ for (found = stop = 0; !stop && &p[12] < e; ) { /* Skip possible name in CNAME answer */ if (*p != 0xc0) { while (*p && &p[12] < e) p++; p--; } debug("Name (Offset in header): %d\n", p[1]); type = get_unaligned_be16(p+2); debug("type = %d\n", type); if (type == DNS_CNAME_RECORD) { /* CNAME answer. shift to the next section */ debug("Found canonical name\n"); dlen = get_unaligned_be16(p+10); debug("dlen = %d\n", dlen); p += 12 + dlen; } else if (type == DNS_A_RECORD) { debug("Found A-record\n"); found = stop = 1; } else { debug("Unknown type\n"); stop = 1; } } if (found && &p[12] < e) { dlen = get_unaligned_be16(p+10); p += 12; memcpy(&IPAddress, p, 4); if (p + dlen <= e) { ip_to_string(IPAddress, IPStr); printf("%s\n", IPStr); if (NetDNSenvvar) setenv(NetDNSenvvar, IPStr); } else puts("server responded with invalid IP number\n"); } NetState = NETLOOP_SUCCESS; } void DnsStart(void) { debug("%s\n", __func__); NetSetTimeout(DNS_TIMEOUT, DnsTimeout); NetSetHandler(DnsHandler); DnsSend(); }
#ifndef ISL_MAYBE_BASIC_SET_H #define ISL_MAYBE_BASIC_SET_H #define ISL_TYPE isl_basic_set #include <isl/maybe_templ.h> #undef ISL_TYPE #endif
/* -*- c++ -*- */ /* * Copyright © 2010 Intel Corporation * * 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 * 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. */ #pragma once #ifndef IR_VISITOR_H #define IR_VISITOR_H /** * Abstract base class of visitors of IR instruction trees */ class ir_visitor { public: virtual ~ir_visitor() { /* empty */ } /** * \name Visit methods * * As typical for the visitor pattern, there must be one \c visit method for * each concrete subclass of \c ir_instruction. Virtual base classes within * the hierarchy should not have \c visit methods. */ /*@{*/ virtual void visit(class ir_variable *) = 0; virtual void visit(class ir_function_signature *) = 0; virtual void visit(class ir_function *) = 0; virtual void visit(class ir_expression *) = 0; virtual void visit(class ir_texture *) = 0; virtual void visit(class ir_swizzle *) = 0; virtual void visit(class ir_dereference_variable *) = 0; virtual void visit(class ir_dereference_array *) = 0; virtual void visit(class ir_dereference_record *) = 0; virtual void visit(class ir_assignment *) = 0; virtual void visit(class ir_constant *) = 0; virtual void visit(class ir_call *) = 0; virtual void visit(class ir_return *) = 0; virtual void visit(class ir_discard *) = 0; virtual void visit(class ir_if *) = 0; virtual void visit(class ir_loop *) = 0; virtual void visit(class ir_loop_jump *) = 0; /*@}*/ }; /* NOTE: function calls may never return due to discards inside them * This is usually not an issue, but if it is, keep it in mind */ class ir_control_flow_visitor : public ir_visitor { public: virtual void visit(class ir_variable *) {} virtual void visit(class ir_expression *) {} virtual void visit(class ir_texture *) {} virtual void visit(class ir_swizzle *) {} virtual void visit(class ir_dereference_variable *) {} virtual void visit(class ir_dereference_array *) {} virtual void visit(class ir_dereference_record *) {} virtual void visit(class ir_assignment *) {} virtual void visit(class ir_constant *) {} virtual void visit(class ir_call *) {} }; #endif /* IR_VISITOR_H */
/* rx-defs.h Renesas RX internal definitions Copyright (C) 2008-2014 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. GAS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GAS 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 GAS; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef RX_DEFS_H #define RX_DEFS_H /* Third operand to rx_op. */ #define RXREL_SIGNED 0 #define RXREL_UNSIGNED 1 #define RXREL_NEGATIVE 2 #define RXREL_PCREL 3 #define RXREL_NEGATIVE_BORROW 4 #define RX_RELAX_NONE 0 #define RX_RELAX_BRANCH 1 #define RX_RELAX_IMM 2 #define RX_RELAX_DISP 3 enum rx_cpu_types { RX600, RX610, RX200, RX100 }; extern int rx_pid_register; extern int rx_gp_register; extern enum rx_cpu_types rx_cpu; extern int rx_error (const char *); extern void rx_lex_init (char *, char *); extern void rx_base1 (int); extern void rx_base2 (int, int); extern void rx_base3 (int, int, int); extern void rx_base4 (int, int, int, int); extern void rx_field (int, int, int); extern void rx_op (expressionS, int, int); extern void rx_disp3 (expressionS, int); extern void rx_field5s (expressionS); extern void rx_field5s2 (expressionS); extern void rx_relax (int, int); extern void rx_linkrelax_dsp (int); extern void rx_linkrelax_imm (int); extern void rx_linkrelax_branch (void); extern int rx_parse (void); extern int rx_wrap (void); extern char * rx_lex_start; extern char * rx_lex_end; #endif /* RX_DEFS_H */
// // RxCocoa.h // RxCocoa // // Created by Krunoslav Zaher on 2/21/15. // Copyright © 2015 Krunoslav Zaher. All rights reserved. // #import <Foundation/Foundation.h> #import "_RX.h" #import "_RXDelegateProxy.h" #import "_RXKVOObserver.h" #import "_RXObjCRuntime.h" //! Project version number for RxCocoa. FOUNDATION_EXPORT double RxCocoaVersionNumber; //! Project version string for RxCocoa. FOUNDATION_EXPORT const unsigned char RxCocoaVersionString[];
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_OLPC_EC_H #define _LINUX_OLPC_EC_H #include <linux/bits.h> /* XO-1 EC commands */ #define EC_FIRMWARE_REV 0x08 #define EC_WRITE_SCI_MASK 0x1b #define EC_WAKE_UP_WLAN 0x24 #define EC_WLAN_LEAVE_RESET 0x25 #define EC_DCON_POWER_MODE 0x26 #define EC_READ_EB_MODE 0x2a #define EC_SET_SCI_INHIBIT 0x32 #define EC_SET_SCI_INHIBIT_RELEASE 0x34 #define EC_WLAN_ENTER_RESET 0x35 #define EC_WRITE_EXT_SCI_MASK 0x38 #define EC_SCI_QUERY 0x84 #define EC_EXT_SCI_QUERY 0x85 /* SCI source values */ #define EC_SCI_SRC_GAME BIT(0) #define EC_SCI_SRC_BATTERY BIT(1) #define EC_SCI_SRC_BATSOC BIT(2) #define EC_SCI_SRC_BATERR BIT(3) #define EC_SCI_SRC_EBOOK BIT(4) /* XO-1 only */ #define EC_SCI_SRC_WLAN BIT(5) /* XO-1 only */ #define EC_SCI_SRC_ACPWR BIT(6) #define EC_SCI_SRC_BATCRIT BIT(7) #define EC_SCI_SRC_GPWAKE BIT(8) /* XO-1.5 only */ #define EC_SCI_SRC_ALL GENMASK(8, 0) struct platform_device; struct olpc_ec_driver { int (*suspend)(struct platform_device *); int (*resume)(struct platform_device *); int (*ec_cmd)(u8, u8 *, size_t, u8 *, size_t, void *); bool wakeup_available; }; #ifdef CONFIG_OLPC_EC extern void olpc_ec_driver_register(struct olpc_ec_driver *drv, void *arg); extern int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf, size_t outlen); extern void olpc_ec_wakeup_set(u16 value); extern void olpc_ec_wakeup_clear(u16 value); extern int olpc_ec_mask_write(u16 bits); extern int olpc_ec_sci_query(u16 *sci_value); extern bool olpc_ec_wakeup_available(void); #else static inline int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf, size_t outlen) { return -ENODEV; } static inline void olpc_ec_wakeup_set(u16 value) { } static inline void olpc_ec_wakeup_clear(u16 value) { } static inline bool olpc_ec_wakeup_available(void) { return false; } #endif /* CONFIG_OLPC_EC */ #endif /* _LINUX_OLPC_EC_H */
/* * AMLOGIC Audio/Video streaming port driver. * * 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 named License, * or any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA * * Author: Brian Zhu <brian.zhu@amlogic.com> * */ #include <linux/types.h> #define MicroCode mix_dump_mc #include "h264_enc_mix_dump.h" #undef MicroCode #define MicroCode half_encoder_mc #include "half_encoder_linux.h" #undef MicroCode #define MicroCode mix_sw_mc #include "h264_enc_mix_sw.h" #undef MicroCode #define MicroCode mix_sw_mc_vdec2_dblk #include "h264_enc_mix_sw_vdec2_dblk.h" #undef MicroCode #define MicroCode mix_sw_mc_hdec_dblk #include "h264_enc_mix_sw_hdec_dblk.h" #undef MicroCode #define MicroCode mix_dump_mc_dblk #include "h264_enc_mix_dump_dblk.h" #undef MicroCode #define MicroCode vdec2_encoder_mc #include "vdec2_encoder.h" #undef MicroCode #define MicroCode mix_sw_mc_hdec_m2_dblk #include "h264_enc_mix_sw_hdec_m2_dblk.h" #undef MicroCode #define MicroCode mix_dump_mc_m2_dblk #include "h264_enc_mix_dump_m2_dblk.h"
#include "v3p_f2c.h" #ifdef KR_headers double tan(); double d_tan(x) doublereal *x; #else #undef abs #include "math.h" #ifdef __cplusplus extern "C" { #endif double d_tan(doublereal *x) #endif { return( tan(*x) ); } #ifdef __cplusplus } #endif
/* * (C) Copyright 2004, Psyent Corporation <www.psyent.com> * Scott McNutt <smcnutt@psyent.com> * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __ASM_NIOS2_IO_H_ #define __ASM_NIOS2_IO_H_ static inline void sync(void) { __asm__ __volatile__ ("sync" : : : "memory"); } /* * Given a physical address and a length, return a virtual address * that can be used to access the memory range with the caching * properties specified by "flags". */ #define MAP_NOCACHE (0) #define MAP_WRCOMBINE (0) #define MAP_WRBACK (0) #define MAP_WRTHROUGH (0) static inline void * map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags) { return (void *)paddr; } /* * Take down a mapping set up by map_physmem(). */ static inline void unmap_physmem(void *vaddr, unsigned long flags) { } static inline phys_addr_t virt_to_phys(void * vaddr) { return (phys_addr_t)(vaddr); } extern unsigned char inb (unsigned char *port); extern unsigned short inw (unsigned short *port); extern unsigned inl (unsigned port); #define __raw_writeb(v,a) (*(volatile unsigned char *)(a) = (v)) #define __raw_writew(v,a) (*(volatile unsigned short *)(a) = (v)) #define __raw_writel(v,a) (*(volatile unsigned int *)(a) = (v)) #define __raw_readb(a) (*(volatile unsigned char *)(a)) #define __raw_readw(a) (*(volatile unsigned short *)(a)) #define __raw_readl(a) (*(volatile unsigned int *)(a)) #define readb(addr)\ ({unsigned char val;\ asm volatile( "ldbio %0, 0(%1)" :"=r"(val) : "r" (addr)); val;}) #define readw(addr)\ ({unsigned short val;\ asm volatile( "ldhio %0, 0(%1)" :"=r"(val) : "r" (addr)); val;}) #define readl(addr)\ ({unsigned long val;\ asm volatile( "ldwio %0, 0(%1)" :"=r"(val) : "r" (addr)); val;}) #define writeb(val,addr)\ asm volatile ("stbio %0, 0(%1)" : : "r" (val), "r" (addr)) #define writew(val,addr)\ asm volatile ("sthio %0, 0(%1)" : : "r" (val), "r" (addr)) #define writel(val,addr)\ asm volatile ("stwio %0, 0(%1)" : : "r" (val), "r" (addr)) #define inb(addr) readb(addr) #define inw(addr) readw(addr) #define inl(addr) readl(addr) #define outb(val, addr) writeb(val,addr) #define outw(val, addr) writew(val,addr) #define outl(val, addr) writel(val,addr) static inline void insb (unsigned long port, void *dst, unsigned long count) { unsigned char *p = dst; while (count--) *p++ = inb (port); } static inline void insw (unsigned long port, void *dst, unsigned long count) { unsigned short *p = dst; while (count--) *p++ = inw (port); } static inline void insl (unsigned long port, void *dst, unsigned long count) { unsigned long *p = dst; while (count--) *p++ = inl (port); } static inline void outsb (unsigned long port, const void *src, unsigned long count) { const unsigned char *p = src; while (count--) outb (*p++, port); } static inline void outsw (unsigned long port, const void *src, unsigned long count) { const unsigned short *p = src; while (count--) outw (*p++, port); } static inline void outsl (unsigned long port, const void *src, unsigned long count) { const unsigned long *p = src; while (count--) outl (*p++, port); } #endif /* __ASM_NIOS2_IO_H_ */
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_PLATFORM_CUPTI_WRAPPER_H_ #define TENSORFLOW_CORE_PLATFORM_CUPTI_WRAPPER_H_ #include "tensorflow/core/platform/platform.h" #if defined(PLATFORM_GOOGLE) #include "tensorflow/core/platform/google/cupti_wrapper.h" #else #include "tensorflow/core/platform/default/gpu/cupti_wrapper.h" #endif #endif // TENSORFLOW_CORE_PLATFORM_CUPTI_WRAPPER_H_
/* * Copyright (C) 2000 Lars Knoll (knoll@kde.org) * (C) 2000 Antti Koivisto (koivisto@kde.org) * (C) 2000 Dirk Mueller (mueller@kde.org) * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef ShadowData_h #define ShadowData_h #include "Color.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> namespace WebCore { class FloatRect; class IntRect; enum ShadowStyle { Normal, Inset }; // This class holds information about shadows for the text-shadow and box-shadow properties. class ShadowData { WTF_MAKE_FAST_ALLOCATED; public: ShadowData() : m_x(0) , m_y(0) , m_blur(0) , m_spread(0) , m_style(Normal) , m_isWebkitBoxShadow(false) { } ShadowData(int x, int y, int blur, int spread, ShadowStyle style, bool isWebkitBoxShadow, const Color& color) : m_x(x) , m_y(y) , m_blur(blur) , m_spread(spread) , m_color(color) , m_style(style) , m_isWebkitBoxShadow(isWebkitBoxShadow) { } ShadowData(const ShadowData& o); bool operator==(const ShadowData& o) const; bool operator!=(const ShadowData& o) const { return !(*this == o); } int x() const { return m_x; } int y() const { return m_y; } int blur() const { return m_blur; } int spread() const { return m_spread; } ShadowStyle style() const { return m_style; } const Color& color() const { return m_color; } bool isWebkitBoxShadow() const { return m_isWebkitBoxShadow; } const ShadowData* next() const { return m_next.get(); } void setNext(PassOwnPtr<ShadowData> shadow) { m_next = shadow; } void adjustRectForShadow(IntRect&, int additionalOutlineSize = 0) const; void adjustRectForShadow(FloatRect&, int additionalOutlineSize = 0) const; private: int m_x; int m_y; int m_blur; int m_spread; Color m_color; ShadowStyle m_style; bool m_isWebkitBoxShadow; OwnPtr<ShadowData> m_next; }; } // namespace WebCore #endif // ShadowData_h
/* SPDX-License-Identifier: GPL-2.0-only */ /* * Atheros AR933X UART defines * * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org> */ #ifndef __AR933X_UART_H #define __AR933X_UART_H #define AR933X_UART_REGS_SIZE 20 #define AR933X_UART_FIFO_SIZE 16 #define AR933X_UART_DATA_REG 0x00 #define AR933X_UART_CS_REG 0x04 #define AR933X_UART_CLOCK_REG 0x08 #define AR933X_UART_INT_REG 0x0c #define AR933X_UART_INT_EN_REG 0x10 #define AR933X_UART_DATA_TX_RX_MASK 0xff #define AR933X_UART_DATA_RX_CSR BIT(8) #define AR933X_UART_DATA_TX_CSR BIT(9) #define AR933X_UART_CS_PARITY_S 0 #define AR933X_UART_CS_PARITY_M 0x3 #define AR933X_UART_CS_PARITY_NONE 0 #define AR933X_UART_CS_PARITY_ODD 2 #define AR933X_UART_CS_PARITY_EVEN 3 #define AR933X_UART_CS_IF_MODE_S 2 #define AR933X_UART_CS_IF_MODE_M 0x3 #define AR933X_UART_CS_IF_MODE_NONE 0 #define AR933X_UART_CS_IF_MODE_DTE 1 #define AR933X_UART_CS_IF_MODE_DCE 2 #define AR933X_UART_CS_FLOW_CTRL_S 4 #define AR933X_UART_CS_FLOW_CTRL_M 0x3 #define AR933X_UART_CS_DMA_EN BIT(6) #define AR933X_UART_CS_TX_READY_ORIDE BIT(7) #define AR933X_UART_CS_RX_READY_ORIDE BIT(8) #define AR933X_UART_CS_TX_READY BIT(9) #define AR933X_UART_CS_RX_BREAK BIT(10) #define AR933X_UART_CS_TX_BREAK BIT(11) #define AR933X_UART_CS_HOST_INT BIT(12) #define AR933X_UART_CS_HOST_INT_EN BIT(13) #define AR933X_UART_CS_TX_BUSY BIT(14) #define AR933X_UART_CS_RX_BUSY BIT(15) #define AR933X_UART_CLOCK_STEP_M 0xffff #define AR933X_UART_CLOCK_SCALE_M 0xfff #define AR933X_UART_CLOCK_SCALE_S 16 #define AR933X_UART_CLOCK_STEP_M 0xffff #define AR933X_UART_INT_RX_VALID BIT(0) #define AR933X_UART_INT_TX_READY BIT(1) #define AR933X_UART_INT_RX_FRAMING_ERR BIT(2) #define AR933X_UART_INT_RX_OFLOW_ERR BIT(3) #define AR933X_UART_INT_TX_OFLOW_ERR BIT(4) #define AR933X_UART_INT_RX_PARITY_ERR BIT(5) #define AR933X_UART_INT_RX_BREAK_ON BIT(6) #define AR933X_UART_INT_RX_BREAK_OFF BIT(7) #define AR933X_UART_INT_RX_FULL BIT(8) #define AR933X_UART_INT_TX_EMPTY BIT(9) #define AR933X_UART_INT_ALLINTS 0x3ff #endif /* __AR933X_UART_H */
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2020 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_FLATFILE_H #define BITCOIN_FLATFILE_H #include <string> #include <fs.h> #include <serialize.h> struct FlatFilePos { int nFile; unsigned int nPos; SERIALIZE_METHODS(FlatFilePos, obj) { READWRITE(VARINT_MODE(obj.nFile, VarIntMode::NONNEGATIVE_SIGNED), VARINT(obj.nPos)); } FlatFilePos() : nFile(-1), nPos(0) {} FlatFilePos(int nFileIn, unsigned int nPosIn) : nFile(nFileIn), nPos(nPosIn) {} friend bool operator==(const FlatFilePos &a, const FlatFilePos &b) { return (a.nFile == b.nFile && a.nPos == b.nPos); } friend bool operator!=(const FlatFilePos &a, const FlatFilePos &b) { return !(a == b); } void SetNull() { nFile = -1; nPos = 0; } bool IsNull() const { return (nFile == -1); } std::string ToString() const; }; /** * FlatFileSeq represents a sequence of numbered files storing raw data. This class facilitates * access to and efficient management of these files. */ class FlatFileSeq { private: const fs::path m_dir; const char* const m_prefix; const size_t m_chunk_size; public: /** * Constructor * * @param dir The base directory that all files live in. * @param prefix A short prefix given to all file names. * @param chunk_size Disk space is pre-allocated in multiples of this amount. */ FlatFileSeq(fs::path dir, const char* prefix, size_t chunk_size); /** Get the name of the file at the given position. */ fs::path FileName(const FlatFilePos& pos) const; /** Open a handle to the file at the given position. */ FILE* Open(const FlatFilePos& pos, bool read_only = false); /** * Allocate additional space in a file after the given starting position. The amount allocated * will be the minimum multiple of the sequence chunk size greater than add_size. * * @param[in] pos The starting position that bytes will be allocated after. * @param[in] add_size The minimum number of bytes to be allocated. * @param[out] out_of_space Whether the allocation failed due to insufficient disk space. * @return The number of bytes successfully allocated. */ size_t Allocate(const FlatFilePos& pos, size_t add_size, bool& out_of_space); /** * Commit a file to disk, and optionally truncate off extra pre-allocated bytes if final. * * @param[in] pos The first unwritten position in the file to be flushed. * @param[in] finalize True if no more data will be written to this file. * @return true on success, false on failure. */ bool Flush(const FlatFilePos& pos, bool finalize = false); }; #endif // BITCOIN_FLATFILE_H
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2016 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_MERKLEBLOCK_H #define BITCOIN_MERKLEBLOCK_H #include "serialize.h" #include "uint256.h" #include "primitives/block.h" #include "bloom.h" #include <vector> /** Data structure that represents a partial merkle tree. * * It represents a subset of the txid's of a known block, in a way that * allows recovery of the list of txid's and the merkle root, in an * authenticated way. * * The encoding works as follows: we traverse the tree in depth-first order, * storing a bit for each traversed node, signifying whether the node is the * parent of at least one matched leaf txid (or a matched txid itself). In * case we are at the leaf level, or this bit is 0, its merkle node hash is * stored, and its children are not explorer further. Otherwise, no hash is * stored, but we recurse into both (or the only) child branch. During * decoding, the same depth-first traversal is performed, consuming bits and * hashes as they written during encoding. * * The serialization is fixed and provides a hard guarantee about the * encoded size: * * SIZE <= 10 + ceil(32.25*N) * * Where N represents the number of leaf nodes of the partial tree. N itself * is bounded by: * * N <= total_transactions * N <= 1 + matched_transactions*tree_height * * The serialization format: * - uint32 total_transactions (4 bytes) * - varint number of hashes (1-3 bytes) * - uint256[] hashes in depth-first order (<= 32*N bytes) * - varint number of bytes of flag bits (1-3 bytes) * - byte[] flag bits, packed per 8 in a byte, least significant bit first (<= 2*N-1 bits) * The size constraints follow from this. */ class CPartialMerkleTree { protected: /** the total number of transactions in the block */ unsigned int nTransactions; /** node-is-parent-of-matched-txid bits */ std::vector<bool> vBits; /** txids and internal hashes */ std::vector<uint256> vHash; /** flag set when encountering invalid data */ bool fBad; /** helper function to efficiently calculate the number of nodes at given height in the merkle tree */ unsigned int CalcTreeWidth(int height) { return (nTransactions+(1 << height)-1) >> height; } /** calculate the hash of a node in the merkle tree (at leaf level: the txid's themselves) */ uint256 CalcHash(int height, unsigned int pos, const std::vector<uint256> &vTxid); /** recursive function that traverses tree nodes, storing the data as bits and hashes */ void TraverseAndBuild(int height, unsigned int pos, const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch); /** * recursive function that traverses tree nodes, consuming the bits and hashes produced by TraverseAndBuild. * it returns the hash of the respective node and its respective index. */ uint256 TraverseAndExtract(int height, unsigned int pos, unsigned int &nBitsUsed, unsigned int &nHashUsed, std::vector<uint256> &vMatch, std::vector<unsigned int> &vnIndex); public: /** serialization implementation */ ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action) { READWRITE(nTransactions); READWRITE(vHash); std::vector<unsigned char> vBytes; if (ser_action.ForRead()) { READWRITE(vBytes); CPartialMerkleTree &us = *(const_cast<CPartialMerkleTree*>(this)); us.vBits.resize(vBytes.size() * 8); for (unsigned int p = 0; p < us.vBits.size(); p++) us.vBits[p] = (vBytes[p / 8] & (1 << (p % 8))) != 0; us.fBad = false; } else { vBytes.resize((vBits.size()+7)/8); for (unsigned int p = 0; p < vBits.size(); p++) vBytes[p / 8] |= vBits[p] << (p % 8); READWRITE(vBytes); } } /** Construct a partial merkle tree from a list of transaction ids, and a mask that selects a subset of them */ CPartialMerkleTree(const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch); CPartialMerkleTree(); /** * extract the matching txid's represented by this partial merkle tree * and their respective indices within the partial tree. * returns the merkle root, or 0 in case of failure */ uint256 ExtractMatches(std::vector<uint256> &vMatch, std::vector<unsigned int> &vnIndex); }; /** * Used to relay blocks as header + vector<merkle branch> * to filtered nodes. */ class CMerkleBlock { public: /** Public only for unit testing */ CBlockHeader header; CPartialMerkleTree txn; public: /** Public only for unit testing and relay testing (not relayed) */ std::vector<std::pair<unsigned int, uint256> > vMatchedTxn; /** * Create from a CBlock, filtering transactions according to filter * Note that this will call IsRelevantAndUpdate on the filter for each transaction, * thus the filter will likely be modified. */ CMerkleBlock(const CBlock& block, CBloomFilter& filter); // Create from a CBlock, matching the txids in the set CMerkleBlock(const CBlock& block, const std::set<uint256>& txids); CMerkleBlock() {} ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action) { READWRITE(header); READWRITE(txn); } }; #endif // BITCOIN_MERKLEBLOCK_H
int test1() { int i, j, k, b[10]; int a[30]; double d; float r; i = 0; #pragma acc loop while(1) /* { dg-error "for statement expected" } */ { if (i > 0) break; i = i + 1; } i = 0; #pragma acc loop for(;;) /* { dg-error "expected iteration declaration or initialization" } */ { if (i > 0) break; /* { dg-error "break statement used" } */ i = i + 1; } i = 0; #pragma acc loop do /* { dg-error "for statement expected" } */ { i = i + 1; } while (i < 4); #pragma acc loop while (i < 8) /* { dg-error "for statement expected" } */ { i = i + 1; } #pragma acc loop for (d = 1; d < 30; d+= 6) /* { dg-error "invalid type for iteration variable" } */ { i = d; a[i] = 1; } #pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ for (i = 1; i < 30; i++ ) if (i == 16) break; /* { dg-error "break statement used" } */ /* different types of for loop are allowed */ #pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ for (i = 1; i < 10; i++) { } #pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ for (i = 1; i < 10; i+=2) { a[i] = i; } /* after loop directive must be loop */ #pragma acc loop a[1] = 1; /* { dg-error "for statement expected" } */ for (i = 1; i < 10; i++) ; /* combined directives may be used*/ #pragma acc parallel loop for(i = 1; i < 10; i++) { } #pragma acc kernels loop for(i = 1; i < 10; i++) { } return 0; } // PR64765 void PR64765(float *f, double *r) { int i; #pragma acc kernels loop create(f) copy(r) for(i = 64; i < 76; i += 5) {} }
/* Manages interpreters for GDB, the GNU debugger. Copyright (C) 2000-2015 Free Software Foundation, Inc. Written by Jim Ingham <jingham@apple.com> of Apple Computer, Inc. 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 INTERPS_H #define INTERPS_H struct ui_out; struct interp; extern int interp_resume (struct interp *interp); extern int interp_suspend (struct interp *interp); extern struct gdb_exception interp_exec (struct interp *interp, const char *command); extern int interp_quiet_p (struct interp *interp); typedef void *(interp_init_ftype) (struct interp *self, int top_level); typedef int (interp_resume_ftype) (void *data); typedef int (interp_suspend_ftype) (void *data); typedef struct gdb_exception (interp_exec_ftype) (void *data, const char *command); typedef void (interp_command_loop_ftype) (void *data); typedef struct ui_out *(interp_ui_out_ftype) (struct interp *self); typedef int (interp_set_logging_ftype) (struct interp *self, int start_log, struct ui_file *out, struct ui_file *logfile); struct interp_procs { interp_init_ftype *init_proc; interp_resume_ftype *resume_proc; interp_suspend_ftype *suspend_proc; interp_exec_ftype *exec_proc; /* Returns the ui_out currently used to collect results for this interpreter. It can be a formatter for stdout, as is the case for the console & mi outputs, or it might be a result formatter. */ interp_ui_out_ftype *ui_out_proc; /* Provides a hook for interpreters to do any additional setup/cleanup that they might need when logging is enabled or disabled. */ interp_set_logging_ftype *set_logging_proc; interp_command_loop_ftype *command_loop_proc; }; extern struct interp *interp_new (const char *name, const struct interp_procs *procs); extern void interp_add (struct interp *interp); extern int interp_set (struct interp *interp, int top_level); extern struct interp *interp_lookup (const char *name); extern struct ui_out *interp_ui_out (struct interp *interp); extern void *interp_data (struct interp *interp); extern const char *interp_name (struct interp *interp); extern struct interp *interp_set_temp (const char *name); extern int current_interp_named_p (const char *name); extern void current_interp_command_loop (void); /* Call this function to give the current interpreter an opportunity to do any special handling of streams when logging is enabled or disabled. START_LOG is 1 when logging is starting, 0 when it ends, and OUT is the stream for the log file; it will be NULL when logging is ending. LOGFILE is non-NULL if the output streams are to be tees, with the log file as one of the outputs. */ extern int current_interp_set_logging (int start_log, struct ui_file *out, struct ui_file *logfile); /* Returns opaque data associated with the top-level interpreter. */ extern void *top_level_interpreter_data (void); extern struct interp *top_level_interpreter (void); extern struct interp *command_interp (void); /* True if the current interpreter is in async mode, false if in sync mode. If in sync mode, running a synchronous execution command (with execute_command, e.g, "next") will not return until the command is finished. If in async mode, then running a synchronous command returns right after resuming the target. Waiting for the command's completion is later done on the top event loop (using continuations). */ extern int interpreter_async; extern void clear_interpreter_hooks (void); /* well-known interpreters */ #define INTERP_CONSOLE "console" #define INTERP_MI1 "mi1" #define INTERP_MI2 "mi2" #define INTERP_MI3 "mi3" #define INTERP_MI "mi" #define INTERP_TUI "tui" #define INTERP_INSIGHT "insight" #endif
/* MI Command Set - MI output generating routines for GDB. Copyright (C) 2000-2015 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_OUT_H #define MI_OUT_H 1 struct ui_out; struct ui_file; extern struct ui_out *mi_out_new (int mi_version); extern void mi_out_put (struct ui_out *uiout, struct ui_file *stream); extern void mi_out_rewind (struct ui_out *uiout); extern void mi_out_buffered (struct ui_out *uiout, char *string); /* Return the version number of the current MI. */ extern int mi_version (struct ui_out *uiout); #endif /* MI_OUT_H */
/********************************** Copyright (C) Rick Wong (Lick) http://licklick.wordpress.com/ ***********************************/ #include <cartreset_nolibfat.h> #ifdef ARM9 bool cartSetMenuMode(u32 _deviceType) { *(vu16*)(0x04000204) &= ~0x0880; //sysSetBusOwners(true, true); u32 deviceType = _deviceType; *((vu32*)0x027FFFF8) = 0x080000C0; // ARM7 reset address if(deviceType == DEVICE_TYPE_EFA2) { *(u16 *)0x9FE0000 = 0xD200; *(u16 *)0x8000000 = 0x1500; *(u16 *)0x8020000 = 0xD200; *(u16 *)0x8040000 = 0x1500; *(u16 *)0x9880000 = 1 << 15; *(u16 *)0x9FC0000 = 0x1500; return true; } else if(deviceType == DEVICE_TYPE_MPCF) { return true; } else if(deviceType == DEVICE_TYPE_EZSD) { return true; } else if(deviceType == DEVICE_TYPE_M3CF || deviceType == DEVICE_TYPE_M3SD) { u32 mode = 0x00400004; vu16 tmp; tmp = *(vu16*)(0x08E00002); tmp = *(vu16*)(0x0800000E); tmp = *(vu16*)(0x08801FFC); tmp = *(vu16*)(0x0800104A); tmp = *(vu16*)(0x08800612); tmp = *(vu16*)(0x08000000); tmp = *(vu16*)(0x08801B66); tmp = *(vu16*)(0x08000000 + (mode << 1)); tmp = *(vu16*)(0x0800080E); tmp = *(vu16*)(0x08000000); tmp = *(vu16*)(0x080001E4); tmp = *(vu16*)(0x080001E4); tmp = *(vu16*)(0x08000188); tmp = *(vu16*)(0x08000188); return true; } else if(deviceType == DEVICE_TYPE_SCCF || deviceType == DEVICE_TYPE_SCSD) { *(vu16*)0x09FFFFFE = 0xA55A; *(vu16*)0x09FFFFFE = 0xA55A; *(vu16*)0x09FFFFFE = 0; *(vu16*)0x09FFFFFE = 0; *((vu32*)0x027FFFF8) = 0x08000000; // Special ARM7 reset address return true; } return false; } void passmeloopEnter() { *(vu16*)(0x04000208) = 0; //REG_IME = IME_DISABLE; *(vu16*)(0x04000204) |= 0x0880; //sysSetBusOwners(false, false); *((vu32*)0x027FFFFC) = 0; *((vu32*)0x027FFE04) = (u32)0xE59FF018; *((vu32*)0x027FFE24) = (u32)0x027FFE04; asm("swi 0x00"); //swiSoftReset(); asm("bx lr"); } #endif #ifdef ARM7 //#include <nds.h> bool passmeloopQuery() { if(*((vu32*)0x027FFE24) == (u32)0x027FFE04) return true; return false; } void cartExecute() { *(vu16*)(0x04000208) = 0; //REG_IME = IME_DISABLE; *((vu32*)0x027FFE34) = *((vu32*)0x027FFFF8); asm("swi 0x00"); //swiSoftReset(); asm("bx lr"); } #endif
/* * Copyright (C) 2001-2015 Free Software Foundation, Inc. * Contributed by Richard Henderson (rth@redhat.com) * * This file is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3, or (at your option) any * later version. * * This file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Under Section 7 of GPL version 3, you are granted additional * permissions described in the GCC Runtime Library Exception, version * 3.1, as published by the Free Software Foundation. * * You should have received a copy of the GNU General Public License and * a copy of the GCC Runtime Library Exception along with this program; * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see * <http://www.gnu.org/licenses/>. */ /* Assume OSF/1 compatible interfaces. */ extern void __ieee_set_fp_control (unsigned long int); #define IEEE_MAP_DMZ (1UL<<12) /* Map denorm inputs to zero */ #define IEEE_MAP_UMZ (1UL<<13) /* Map underflowed outputs to zero */ static void __attribute__((constructor)) set_fast_math (void) { __ieee_set_fp_control (IEEE_MAP_DMZ | IEEE_MAP_UMZ); }
/* Definitions for rtems targeting a H8 Copyright (C) 1996-2015 Free Software Foundation, Inc. Contributed by Joel Sherrill (joel@OARcorp.com). This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ /* Target OS preprocessor built-ins. */ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ builtin_define_std ("h8300"); \ builtin_define ("__rtems__"); \ builtin_assert ("system=rtems"); \ } \ while (0)
/* Linux DNS client library implementation Copyright (C) 2006 Krishna Ganugapati <krishnag@centeris.com> Copyright (C) 2006 Gerald Carter <jerry@samba.org> ** NOTE! The following LGPL license applies to the libaddns ** library. This does NOT imply that all of Samba is released ** under the LGPL This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "dns.h" #include <ctype.h> static DNS_ERROR LabelList( TALLOC_CTX *mem_ctx, const char *name, struct dns_domain_label **presult ) { struct dns_domain_label *result; const char *dot; for (dot = name; *dot != '\0'; dot += 1) { char c = *dot; if (c == '.') break; if (c == '-') continue; if ((c >= 'a') && (c <= 'z')) continue; if ((c >= 'A') && (c <= 'Z')) continue; if ((c >= '0') && (c <= '9')) continue; return ERROR_DNS_INVALID_NAME; } if ((dot - name) > 63) { /* * DNS labels can only be 63 chars long */ return ERROR_DNS_INVALID_NAME; } if (!(result = TALLOC_ZERO_P(mem_ctx, struct dns_domain_label))) { return ERROR_DNS_NO_MEMORY; } if (*dot == '\0') { /* * No dot around, so this is the last component */ if (!(result->label = talloc_strdup(result, name))) { TALLOC_FREE(result); return ERROR_DNS_NO_MEMORY; } result->len = strlen(result->label); *presult = result; return ERROR_DNS_SUCCESS; } if (dot[1] == '.') { /* * Two dots in a row, reject */ TALLOC_FREE(result); return ERROR_DNS_INVALID_NAME; } if (dot[1] != '\0') { /* * Something follows, get the rest */ DNS_ERROR err = LabelList(result, dot+1, &result->next); if (!ERR_DNS_IS_OK(err)) { TALLOC_FREE(result); return err; } } result->len = (dot - name); if (!(result->label = talloc_strndup(result, name, result->len))) { TALLOC_FREE(result); return ERROR_DNS_NO_MEMORY; } *presult = result; return ERROR_DNS_SUCCESS; } DNS_ERROR dns_domain_name_from_string( TALLOC_CTX *mem_ctx, const char *pszDomainName, struct dns_domain_name **presult ) { struct dns_domain_name *result; DNS_ERROR err; if (!(result = talloc(mem_ctx, struct dns_domain_name))) { return ERROR_DNS_NO_MEMORY; } err = LabelList( result, pszDomainName, &result->pLabelList ); if (!ERR_DNS_IS_OK(err)) { TALLOC_FREE(result); return err; } *presult = result; return ERROR_DNS_SUCCESS; } /********************************************************************* *********************************************************************/ char *dns_generate_keyname( TALLOC_CTX *mem_ctx ) { char *result = NULL; #if defined(WITH_DNS_UPDATES) uuid_t uuid; /* * uuid_unparse gives 36 bytes plus '\0' */ if (!(result = TALLOC_ARRAY(mem_ctx, char, 37))) { return NULL; } uuid_generate( uuid ); uuid_unparse( uuid, result ); #endif return result; }
/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, * as published by the Free Software Foundation. * * 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 version 2 for more details (a copy is included * in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see * http://www.gnu.org/licenses/gpl-2.0.html * * GPL HEADER END */ /* * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. */ #ifndef _LINUX_LL_H #define _LINUX_LL_H #ifndef _LL_H #error Do not #include this file directly. #include <lustre_lite.h> instead #endif #include <linux/statfs.h> #include <linux/fs.h> #include <linux/dcache.h> #include "../obd_class.h" #include "../lustre_net.h" #include "../lustre_ha.h" #include <linux/rbtree.h> #include "../../include/linux/lustre_compat25.h" #include <linux/pagemap.h> /* lprocfs.c */ enum { LPROC_LL_DIRTY_HITS = 0, LPROC_LL_DIRTY_MISSES, LPROC_LL_READ_BYTES, LPROC_LL_WRITE_BYTES, LPROC_LL_BRW_READ, LPROC_LL_BRW_WRITE, LPROC_LL_OSC_READ, LPROC_LL_OSC_WRITE, LPROC_LL_IOCTL, LPROC_LL_OPEN, LPROC_LL_RELEASE, LPROC_LL_MAP, LPROC_LL_LLSEEK, LPROC_LL_FSYNC, LPROC_LL_READDIR, LPROC_LL_SETATTR, LPROC_LL_TRUNC, LPROC_LL_FLOCK, LPROC_LL_GETATTR, LPROC_LL_CREATE, LPROC_LL_LINK, LPROC_LL_UNLINK, LPROC_LL_SYMLINK, LPROC_LL_MKDIR, LPROC_LL_RMDIR, LPROC_LL_MKNOD, LPROC_LL_RENAME, LPROC_LL_STAFS, LPROC_LL_ALLOC_INODE, LPROC_LL_SETXATTR, LPROC_LL_GETXATTR, LPROC_LL_GETXATTR_HITS, LPROC_LL_LISTXATTR, LPROC_LL_REMOVEXATTR, LPROC_LL_INODE_PERM, LPROC_LL_FILE_OPCODES }; #endif
#ifndef _PROBE_FINDER_H #define _PROBE_FINDER_H #include <stdbool.h> #include "util.h" #include "probe-event.h" #define MAX_PATH_LEN 256 #define MAX_PROBE_BUFFER 1024 #define MAX_PROBES 128 static inline int is_c_varname(const char *name) { /* TODO */ return isalpha(name[0]) || name[0] == '_'; } #ifdef DWARF_SUPPORT /* Find probe_trace_events specified by perf_probe_event from debuginfo */ extern int find_probe_trace_events(int fd, struct perf_probe_event *pev, struct probe_trace_event **tevs, int max_tevs); /* Find a perf_probe_point from debuginfo */ extern int find_perf_probe_point(unsigned long addr, struct perf_probe_point *ppt); /* Find a line range */ extern int find_line_range(int fd, struct line_range *lr); /* Find available variables */ extern int find_available_vars_at(int fd, struct perf_probe_event *pev, struct variable_list **vls, int max_points, bool externs); #include <dwarf.h> #include <libdw.h> #include <libdwfl.h> #include <version.h> struct probe_finder { struct perf_probe_event *pev; /* Target probe event */ /* Callback when a probe point is found */ int (*callback)(Dwarf_Die *sp_die, struct probe_finder *pf); /* For function searching */ int lno; /* Line number */ Dwarf_Addr addr; /* Address */ const char *fname; /* Real file name */ Dwarf_Die cu_die; /* Current CU */ struct list_head lcache; /* Line cache for lazy match */ /* For variable searching */ #if _ELFUTILS_PREREQ(0, 142) Dwarf_CFI *cfi; /* Call Frame Information */ #endif Dwarf_Op *fb_ops; /* Frame base attribute */ struct perf_probe_arg *pvar; /* Current target variable */ struct probe_trace_arg *tvar; /* Current result variable */ }; struct trace_event_finder { struct probe_finder pf; struct probe_trace_event *tevs; /* Found trace events */ int ntevs; /* Number of trace events */ int max_tevs; /* Max number of trace events */ }; struct available_var_finder { struct probe_finder pf; struct variable_list *vls; /* Found variable lists */ int nvls; /* Number of variable lists */ int max_vls; /* Max no. of variable lists */ bool externs; /* Find external vars too */ bool child; /* Search child scopes */ }; struct line_finder { struct line_range *lr; /* Target line range */ const char *fname; /* File name */ int lno_s; /* Start line number */ int lno_e; /* End line number */ Dwarf_Die cu_die; /* Current CU */ int found; }; #endif /* DWARF_SUPPORT */ #endif /*_PROBE_FINDER_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_ACCESSIBILITY_ANIMATION_POLICY_PREFS_H_ #define CHROME_BROWSER_ACCESSIBILITY_ANIMATION_POLICY_PREFS_H_ namespace user_prefs { class PrefRegistrySyncable; } extern const char kAnimationPolicyAllowed[]; extern const char kAnimationPolicyOnce[]; extern const char kAnimationPolicyNone[]; void RegisterAnimationPolicyPrefs(user_prefs::PrefRegistrySyncable* registry); #endif // CHROME_BROWSER_ACCESSIBILITY_ANIMATION_POLICY_PREFS_H_
/* linux/drivers/media/video/samsung/tvout/s5p_tvout_common_lib.h * * Copyright (c) 2009 Samsung Electronics * http://www.samsung.com/ * * Header file of common library for SAMSUNG TVOUT driver * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef _S5P_TVOUT_COMMON_LIB_H_ #define _S5P_TVOUT_COMMON_LIB_H_ #include <linux/stddef.h> #include <linux/platform_device.h> #include <linux/videodev2.h> #include <linux/interrupt.h> /***************************************************************************** * This file includes declarations for TVOUT driver's common library. * All files in TVOUT driver can access function or definition in this file. ****************************************************************************/ #define DRV_NAME "TVOUT" #define tvout_err(fmt, ...) \ printk(KERN_ERR "[%s] %s(): " fmt, \ DRV_NAME, __func__, ##__VA_ARGS__) #define CONFIG_TVOUT_DEBUG #ifndef tvout_dbg #ifdef CONFIG_TVOUT_DEBUG #define tvout_dbg(fmt, ...) \ do { \ if (unlikely(tvout_dbg_flag & (1 << DBG_FLAG_TVOUT))) { \ printk(KERN_INFO "[%s] %s(): " fmt, \ DRV_NAME, __func__, ##__VA_ARGS__); \ } \ } while (0) #else #define tvout_dbg(fmt, ...) #endif #endif /* #if defined(CONFIG_MACH_T0) || defined(CONFIG_MACH_M3) #define __CONFIG_HDMI_SUPPORT_FULL_RANGE__ #endif */ #define S5PTV_FB_CNT 2 #define S5PTV_VP_BUFF_CNT 4 #define S5PTV_VP_BUFF_SIZE (4*1024*1024) #define to_tvout_plat(d) (to_platform_device(d)->dev.platform_data) #define HDMI_START_NUM 0x1000 #ifdef CONFIG_CPU_EXYNOS4210 #define CLOCK_GATING_ON_EARLY_SUSPEND #endif enum s5p_tvout_disp_mode { TVOUT_NTSC_M = 0, TVOUT_PAL_BDGHI, TVOUT_PAL_M, TVOUT_PAL_N, TVOUT_PAL_NC, TVOUT_PAL_60, TVOUT_NTSC_443, TVOUT_480P_60_16_9 = HDMI_START_NUM, TVOUT_480P_60_4_3, TVOUT_480P_59, TVOUT_576P_50_16_9, TVOUT_576P_50_4_3, TVOUT_720P_60, TVOUT_720P_50, TVOUT_720P_59, TVOUT_1080P_60, TVOUT_1080P_50, TVOUT_1080P_59, TVOUT_1080P_30, TVOUT_1080I_60, TVOUT_1080I_50, TVOUT_1080I_59, #ifdef CONFIG_HDMI_14A_3D TVOUT_720P_60_SBS_HALF, TVOUT_720P_59_SBS_HALF, TVOUT_720P_50_TB, TVOUT_1080P_24_TB, TVOUT_1080P_23_TB, #endif TVOUT_INIT_DISP_VALUE }; #ifdef CONFIG_HDMI_14A_3D enum s5p_tvout_3d_type { HDMI_3D_FP_FORMAT, HDMI_3D_SSH_FORMAT, HDMI_3D_TB_FORMAT, HDMI_2D_FORMAT, }; #endif enum s5p_tvout_o_mode { TVOUT_COMPOSITE, TVOUT_HDMI, TVOUT_HDMI_RGB, TVOUT_DVI, TVOUT_INIT_O_VALUE }; enum s5p_mixer_burst_mode { MIXER_BURST_8 = 0, MIXER_BURST_16 = 1 }; enum s5ptv_audio_channel { TVOUT_AUDIO_2CH = 0, TVOUT_AUDIO_5_1CH = 1, TVOUT_AUDIO_2CH_VAL = 2, TVOUT_AUDIO_5_1CH_VAL = 6, }; enum s5ptvfb_data_path_t { DATA_PATH_FIFO = 0, DATA_PATH_DMA = 1, }; enum s5ptvfb_alpha_t { LAYER_BLENDING, PIXEL_BLENDING, NONE_BLENDING, }; enum s5ptvfb_ver_scaling_t { VERTICAL_X1, VERTICAL_X2, }; enum s5ptvfb_hor_scaling_t { HORIZONTAL_X1, HORIZONTAL_X2, }; struct s5ptvfb_alpha { enum s5ptvfb_alpha_t mode; int channel; unsigned int value; }; struct s5ptvfb_chroma { int enabled; unsigned int key; }; struct s5ptvfb_user_window { int x; int y; }; struct s5ptvfb_user_plane_alpha { int channel; unsigned char alpha; }; struct s5ptvfb_user_chroma { int enabled; unsigned char red; unsigned char green; unsigned char blue; }; struct s5ptvfb_user_scaling { enum s5ptvfb_ver_scaling_t ver; enum s5ptvfb_hor_scaling_t hor; }; struct s5p_tvout_status { struct clk *i2c_phy_clk; struct clk *sclk_hdmiphy; struct clk *sclk_pixel; struct clk *sclk_dac; struct clk *sclk_hdmi; spinlock_t tvout_lock; }; struct s5p_tvout_vp_buff { unsigned int phy_base; unsigned int vir_base; unsigned int size; }; struct s5p_tvout_vp_bufferinfo { struct s5p_tvout_vp_buff vp_buffs[S5PTV_VP_BUFF_CNT]; unsigned int copy_buff_idxs[S5PTV_VP_BUFF_CNT - 1]; unsigned int curr_copy_idx; unsigned int vp_access_buff_idx; unsigned int size; }; struct s5ptv_vp_buf_info { unsigned int buff_cnt; struct s5p_tvout_vp_buff *buffs; }; struct reg_mem_info { char *name; struct resource *res; void __iomem *base; }; struct irq_info { char *name; irq_handler_t handler; int no; }; struct s5p_tvout_clk_info { char *name; struct clk *ptr; }; #ifdef CONFIG_TVOUT_DEBUG enum tvout_dbg_flag_bit_num { DBG_FLAG_HDCP = 0, DBG_FLAG_TVOUT, DBG_FLAG_HPD, DBG_FLAG_HDMI }; extern int tvout_dbg_flag; #endif extern struct s5p_tvout_status s5ptv_status; extern int s5p_tvout_vcm_create_unified(void); extern int s5p_tvout_vcm_init(void); extern void s5p_tvout_vcm_activate(void); extern void s5p_tvout_vcm_deactivate(void); extern int s5p_tvout_map_resource_mem( struct platform_device *pdev, char *name, void __iomem **base, struct resource **res); extern void s5p_tvout_unmap_resource_mem( void __iomem *base, struct resource *res); extern void s5p_tvout_pm_runtime_enable(struct device *dev); extern void s5p_tvout_pm_runtime_disable(struct device *dev); extern void s5p_tvout_pm_runtime_get(void); extern void s5p_tvout_pm_runtime_put(void); extern void s5p_hdmi_ctrl_clock(bool on); extern bool on_stop_process; extern bool on_start_process; extern struct s5p_tvout_vp_bufferinfo s5ptv_vp_buff; #ifdef CONFIG_HAS_EARLYSUSPEND extern unsigned int suspend_status; extern int s5p_hpd_get_status(void); extern void s5p_tvout_mutex_lock(void); extern void s5p_tvout_mutex_unlock(void); #endif #ifdef CONFIG_PM extern void s5p_hdmi_ctrl_phy_power_resume(void); #endif #if defined(CONFIG_SAMSUNG_WORKAROUND_HPD_GLANCE) &&\ !defined(CONFIG_SAMSUNG_MHL_9290) extern void call_sched_mhl_hpd_handler(void); extern int (*hpd_intr_state)(void); #endif #endif /* _S5P_TVOUT_COMMON_LIB_H_ */
/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) ST-Ericsson SA 2010 * * Author: Bengt Jonsson <bengt.jonsson@stericsson.com> for ST-Ericsson, * Jonas Aaberg <jonas.aberg@stericsson.com> for ST-Ericsson */ #ifndef DBX500_REGULATOR_H #define DBX500_REGULATOR_H #include <linux/platform_device.h> /** * struct dbx500_regulator_info - dbx500 regulator information * @desc: regulator description * @is_enabled: status of the regulator * @epod_id: id for EPOD (power domain) * @is_ramret: RAM retention switch for EPOD (power domain) * */ struct dbx500_regulator_info { struct regulator_desc desc; bool is_enabled; u16 epod_id; bool is_ramret; bool exclude_from_power_state; }; void power_state_active_enable(void); int power_state_active_disable(void); #ifdef CONFIG_REGULATOR_DEBUG int ux500_regulator_debug_init(struct platform_device *pdev, struct dbx500_regulator_info *regulator_info, int num_regulators); int ux500_regulator_debug_exit(void); #else static inline int ux500_regulator_debug_init(struct platform_device *pdev, struct dbx500_regulator_info *regulator_info, int num_regulators) { return 0; } static inline int ux500_regulator_debug_exit(void) { return 0; } #endif #endif
/* * linux/drivers/pcmcia/pxa2xx_lubbock.c * * Author: George Davis * Created: Jan 10, 2002 * Copyright: MontaVista Software Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Originally based upon linux/drivers/pcmcia/sa1100_neponset.c * * Lubbock PCMCIA specific routines. * */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/device.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/delay.h> #include <asm/hardware.h> #include <asm/hardware/sa1111.h> #include <asm/mach-types.h> #include <asm/arch/pxa-regs.h> #include <asm/arch/lubbock.h> #include "sa1111_generic.h" static int lubbock_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { /* * Setup default state of GPIO outputs * before we enable them as outputs. */ GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) | GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) | GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) | GPIO_bit(GPIO53_nPCE_2); pxa_gpio_mode(GPIO48_nPOE_MD); pxa_gpio_mode(GPIO49_nPWE_MD); pxa_gpio_mode(GPIO50_nPIOR_MD); pxa_gpio_mode(GPIO51_nPIOW_MD); pxa_gpio_mode(GPIO52_nPCE_1_MD); pxa_gpio_mode(GPIO53_nPCE_2_MD); pxa_gpio_mode(GPIO54_pSKTSEL_MD); pxa_gpio_mode(GPIO55_nPREG_MD); pxa_gpio_mode(GPIO56_nPWAIT_MD); pxa_gpio_mode(GPIO57_nIOIS16_MD); return sa1111_pcmcia_hw_init(skt); } static int lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) { unsigned int pa_dwr_mask, pa_dwr_set, misc_mask, misc_set; int ret = 0; pa_dwr_mask = pa_dwr_set = misc_mask = misc_set = 0; /* Lubbock uses the Maxim MAX1602, with the following connections: * * Socket 0 (PCMCIA): * MAX1602 Lubbock Register * Pin Signal * ----- ------- ---------------------- * A0VPP S0_PWR0 SA-1111 GPIO A<0> * A1VPP S0_PWR1 SA-1111 GPIO A<1> * A0VCC S0_PWR2 SA-1111 GPIO A<2> * A1VCC S0_PWR3 SA-1111 GPIO A<3> * VX VCC * VY +3.3V * 12IN +12V * CODE +3.3V Cirrus Code, CODE = High (VY) * * Socket 1 (CF): * MAX1602 Lubbock Register * Pin Signal * ----- ------- ---------------------- * A0VPP GND VPP is not connected * A1VPP GND VPP is not connected * A0VCC S1_PWR0 MISC_WR<14> * A1VCC S1_PWR1 MISC_WR<15> * VX VCC * VY +3.3V * 12IN GND VPP is not connected * CODE +3.3V Cirrus Code, CODE = High (VY) * */ again: switch (skt->nr) { case 0: pa_dwr_mask = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3; switch (state->Vcc) { case 0: /* Hi-Z */ break; case 33: /* VY */ pa_dwr_set |= GPIO_A3; break; case 50: /* VX */ pa_dwr_set |= GPIO_A2; break; default: printk(KERN_ERR "%s(): unrecognized Vcc %u\n", __FUNCTION__, state->Vcc); ret = -1; } switch (state->Vpp) { case 0: /* Hi-Z */ break; case 120: /* 12IN */ pa_dwr_set |= GPIO_A1; break; default: /* VCC */ if (state->Vpp == state->Vcc) pa_dwr_set |= GPIO_A0; else { printk(KERN_ERR "%s(): unrecognized Vpp %u\n", __FUNCTION__, state->Vpp); ret = -1; break; } } break; case 1: misc_mask = (1 << 15) | (1 << 14); switch (state->Vcc) { case 0: /* Hi-Z */ break; case 33: /* VY */ misc_set |= 1 << 15; break; case 50: /* VX */ misc_set |= 1 << 14; break; default: printk(KERN_ERR "%s(): unrecognized Vcc %u\n", __FUNCTION__, state->Vcc); ret = -1; break; } if (state->Vpp != state->Vcc && state->Vpp != 0) { printk(KERN_ERR "%s(): CF slot cannot support Vpp %u\n", __FUNCTION__, state->Vpp); ret = -1; break; } break; default: ret = -1; } if (ret == 0) ret = sa1111_pcmcia_configure_socket(skt, state); if (ret == 0) { lubbock_set_misc_wr(misc_mask, misc_set); sa1111_set_io(SA1111_DEV(skt->dev), pa_dwr_mask, pa_dwr_set); } #if 1 if (ret == 0 && state->Vcc == 33) { struct pcmcia_state new_state; /* * HACK ALERT: * We can't sense the voltage properly on Lubbock before * actually applying some power to the socket (catch 22). * Resense the socket Voltage Sense pins after applying * socket power. * * Note: It takes about 2.5ms for the MAX1602 VCC output * to rise. */ mdelay(3); sa1111_pcmcia_socket_state(skt, &new_state); if (!new_state.vs_3v && !new_state.vs_Xv) { /* * Switch to 5V, Configure socket with 5V voltage */ lubbock_set_misc_wr(misc_mask, 0); sa1111_set_io(SA1111_DEV(skt->dev), pa_dwr_mask, 0); /* * It takes about 100ms to turn off Vcc. */ mdelay(100); /* * We need to hack around the const qualifier as * well to keep this ugly workaround localized and * not force it to the rest of the code. Barf bags * avaliable in the seat pocket in front of you! */ ((socket_state_t *)state)->Vcc = 50; ((socket_state_t *)state)->Vpp = 50; goto again; } } #endif return ret; } static struct pcmcia_low_level lubbock_pcmcia_ops = { .owner = THIS_MODULE, .hw_init = lubbock_pcmcia_hw_init, .hw_shutdown = sa1111_pcmcia_hw_shutdown, .socket_state = sa1111_pcmcia_socket_state, .configure_socket = lubbock_pcmcia_configure_socket, .socket_init = sa1111_pcmcia_socket_init, .socket_suspend = sa1111_pcmcia_socket_suspend, .first = 0, .nr = 2, }; #include "pxa2xx_base.h" int __init pcmcia_lubbock_init(struct sa1111_dev *sadev) { int ret = -ENODEV; if (machine_is_lubbock()) { /* * Set GPIO_A<3:0> to be outputs for the MAX1600, * and switch to standby mode. */ sa1111_set_io_dir(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0); sa1111_set_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); sa1111_set_sleep_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); /* Set CF Socket 1 power to standby mode. */ lubbock_set_misc_wr((1 << 15) | (1 << 14), 0); sadev->dev.platform_data = &lubbock_pcmcia_ops; ret = __pxa2xx_drv_pcmcia_probe(&sadev->dev); } return ret; } MODULE_LICENSE("GPL");
#ifndef _MainDialog_H_ #define _MainDialog_H_ //------------------------------- //----------------- class MainDialog : public CWindowWnd, public INotifyUI,public IDialogBuilderCallback { public: MainDialog():m_dwSkinNo(0) { }; LPCTSTR GetWindowClassName() const { return _T("MainDialog"); }; UINT GetClassStyle() const { return CS_DBLCLKS; }; void OnFinalMessage(HWND /*hWnd*/) { delete this; }; CControlUI* CreateControl(LPCTSTR pstrClass) { return NULL; }; CDuiString GetNowTimeString() { SYSTEMTIME time = {0}; TCHAR szTime[MAX_PATH] = {0}; ::GetLocalTime(&time); //_stprintf_s( szTime, MAX_PATH, _T("%04d/%02d/%02d %02d:%02d:%02d"), time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond); _stprintf_s( szTime, MAX_PATH, _T("%02d:%02d:%02d"), time.wHour, time.wMinute, time.wSecond); return szTime; }; void Init(); void OnPrepare(TNotifyUI& msg) { }; void Notify(TNotifyUI& msg); LRESULT OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam); public: CPaintManagerUI m_pm; private: CButtonUI* m_pCloseBtn; CButtonUI* m_pMaxBtn; CButtonUI* m_pRestoreBtn; CButtonUI* m_pMinBtn; CButtonUI* m_pConnect; CButtonUI* m_pClose; DWORD m_dwSkinNo; //... }; #endif
/* * Copyright 2013 Red Hat Inc. * * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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: Ben Skeggs */ #include <subdev/bios.h> #include <subdev/bios/bit.h> #include <subdev/bios/cstep.h> u32 nvbios_cstepTe(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz) { struct bit_entry bit_P; u32 cstep = 0; if (!bit_entry(bios, 'P', &bit_P)) { if (bit_P.version == 2 && bit_P.length >= 0x38) cstep = nvbios_rd32(bios, bit_P.offset + 0x34); if (cstep) { *ver = nvbios_rd08(bios, cstep + 0); switch (*ver) { case 0x10: *hdr = nvbios_rd08(bios, cstep + 1); *cnt = nvbios_rd08(bios, cstep + 3); *len = nvbios_rd08(bios, cstep + 2); *xnr = nvbios_rd08(bios, cstep + 5); *xsz = nvbios_rd08(bios, cstep + 4); return cstep; default: break; } } } return 0; } u32 nvbios_cstepEe(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr) { u8 cnt, len, xnr, xsz; u32 data = nvbios_cstepTe(bios, ver, hdr, &cnt, &len, &xnr, &xsz); if (data && idx < cnt) { data = data + *hdr + (idx * len); *hdr = len; return data; } return 0; } u32 nvbios_cstepEp(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr, struct nvbios_cstepE *info) { u32 data = nvbios_cstepEe(bios, idx, ver, hdr); memset(info, 0x00, sizeof(*info)); if (data) { info->pstate = (nvbios_rd16(bios, data + 0x00) & 0x01e0) >> 5; info->index = nvbios_rd08(bios, data + 0x03); } return data; } u32 nvbios_cstepEm(struct nvkm_bios *bios, u8 pstate, u8 *ver, u8 *hdr, struct nvbios_cstepE *info) { u32 data, idx = 0; while ((data = nvbios_cstepEp(bios, idx++, ver, hdr, info))) { if (info->pstate == pstate) break; } return data; } u32 nvbios_cstepXe(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr) { u8 cnt, len, xnr, xsz; u32 data = nvbios_cstepTe(bios, ver, hdr, &cnt, &len, &xnr, &xsz); if (data && idx < xnr) { data = data + *hdr + (cnt * len) + (idx * xsz); *hdr = xsz; return data; } return 0; } u32 nvbios_cstepXp(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr, struct nvbios_cstepX *info) { u32 data = nvbios_cstepXe(bios, idx, ver, hdr); memset(info, 0x00, sizeof(*info)); if (data) { info->freq = nvbios_rd16(bios, data + 0x00) * 1000; info->unkn[0] = nvbios_rd08(bios, data + 0x02); info->unkn[1] = nvbios_rd08(bios, data + 0x03); info->voltage = nvbios_rd08(bios, data + 0x04); } return data; }
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * based on the mips/cachectl.h * * Copyright 2010 Analog Devices Inc. * Copyright (C) 1994, 1995, 1996 by Ralf Baechle * * Licensed under the GPL-2 or later. */ #ifndef _UAPI_ASM_CACHECTL #define _UAPI_ASM_CACHECTL /* * Options for cacheflush system call */ #define ICACHE (1<<0) /* flush instruction cache */ #define DCACHE (1<<1) /* writeback and flush data cache */ #define BCACHE (ICACHE|DCACHE) /* flush both caches */ #endif /* _UAPI_ASM_CACHECTL */
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_METAG_TLB_H #define __ASM_METAG_TLB_H #include <asm/cacheflush.h> #include <asm/page.h> /* Note, read http://lkml.org/lkml/2004/1/15/6 */ #ifdef CONFIG_METAG_META12 #define tlb_start_vma(tlb, vma) \ do { \ if (!tlb->fullmm) \ flush_cache_range(vma, vma->vm_start, vma->vm_end); \ } while (0) #define tlb_end_vma(tlb, vma) \ do { \ if (!tlb->fullmm) \ flush_tlb_range(vma, vma->vm_start, vma->vm_end); \ } while (0) #else #define tlb_start_vma(tlb, vma) do { } while (0) #define tlb_end_vma(tlb, vma) do { } while (0) #endif #define __tlb_remove_tlb_entry(tlb, pte, addr) do { } while (0) #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) #include <asm-generic/tlb.h> #endif
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s struct X { int V[10000]; }; struct X Global1, Global2; void test() { // CHECK: llvm.memcpy Global2 = Global1; }
// Copyright 2007-2009 Google Inc. // // 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. // ======================================================================== // // Optimized for minimal code size. #include "hmac.h" #include <memory.h> #include "sha.h" #include "md5.h" static void HMAC_init(HMAC_CTX* ctx, const void* key, int len) { int i; memset(&ctx->opad[0], 0, sizeof(ctx->opad)); if (len > sizeof(ctx->opad)) { HASH_init(&ctx->hash); HASH_update(&ctx->hash, key, len); memcpy(&ctx->opad[0], HASH_final(&ctx->hash), HASH_size(&ctx->hash)); } else { memcpy(&ctx->opad[0], key, len); } for (i = 0; i < sizeof(ctx->opad); ++i) { ctx->opad[i] ^= 0x36; } HASH_init(&ctx->hash); HASH_update(&ctx->hash, ctx->opad, sizeof(ctx->opad)); // hash ipad for (i = 0; i < sizeof(ctx->opad); ++i) { ctx->opad[i] ^= (0x36 ^ 0x5c); } } void HMAC_MD5_init(HMAC_CTX* ctx, const void* key, int len) { MD5_init(&ctx->hash); HMAC_init(ctx, key, len); } void HMAC_SHA_init(HMAC_CTX* ctx, const void* key, int len) { SHA_init(&ctx->hash); HMAC_init(ctx, key, len); } const uint8_t* HMAC_final(HMAC_CTX* ctx) { uint8_t digest[32]; // upto SHA2 memcpy(digest, HASH_final(&ctx->hash), (HASH_size(&ctx->hash) <= sizeof(digest) ? HASH_size(&ctx->hash) : sizeof(digest))); HASH_init(&ctx->hash); HASH_update(&ctx->hash, ctx->opad, sizeof(ctx->opad)); HASH_update(&ctx->hash, digest, HASH_size(&ctx->hash)); memset(&ctx->opad[0], 0, sizeof(ctx->opad)); // wipe key return HASH_final(&ctx->hash); }
/* * Copyright (C) 2002 - 2004 Jeff Dike (jdike@addtoit.com) * Licensed under the GPL */ #include <signal.h> #include "sysdep/ptrace.h" #include "sysdep/sigcontext.h" /* These two are from asm-um/uaccess.h and linux/module.h, check them. */ struct exception_table_entry { unsigned long insn; unsigned long fixup; }; const struct exception_table_entry *search_exception_tables(unsigned long add); /* Compare this to arch/i386/mm/extable.c:fixup_exception() */ int arch_fixup(unsigned long address, void *sc_ptr) { struct sigcontext *sc = sc_ptr; const struct exception_table_entry *fixup; fixup = search_exception_tables(address); if(fixup != 0){ sc->eip = fixup->fixup; return(1); } return(0); } /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically * adjust the settings for this buffer only. This must remain at the end * of the file. * --------------------------------------------------------------------------- * Local variables: * c-file-style: "linux" * End: */
int no_umbrella_B;
/** * @file IxOsCacheMMU.h * * @brief this file contains the API of the @ref IxCacheMMU component * * <hr> * * @par * IXP400 SW Release version 2.0 * * -- Copyright Notice -- * * @par * Copyright 2001-2005, Intel Corporation. * All rights reserved. * * @par * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Intel Corporation nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * @par * 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. * * @par * -- End of Copyright Notice -- */ #ifndef IxOsCacheMMU_H #ifndef __doxygen_hide #define IxOsCacheMMU_H #endif /* __doxygen_hide */ #ifdef __doxygen_HIDE #define IX_OS_CACHE_DOXYGEN #endif /* __doxygen_HIDE */ #include "IxOsalBackward.h" #endif /* IxOsCacheMMU_H */
/* * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Amit Bhor, Sameer Dhavale: Codito Technologies 2004 */ #ifndef _ASM_ARC_MODULE_H #define _ASM_ARC_MODULE_H #include <asm-generic/module.h> struct mod_arch_specific { #ifdef CONFIG_ARC_DW2_UNWIND void *unw_info; int unw_sec_idx; #endif const char *secstr; }; #define MODULE_PROC_FAMILY "ARC700" #define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY #endif /* _ASM_ARC_MODULE_H */
/* Copyright (c) 2017 Facebook * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * BPF program to set initial receive window to 40 packets and send * and receive buffers to 1.5MB. This would usually be done after * doing appropriate checks that indicate the hosts are far enough * away (i.e. large RTT). * * Use load_sock_ops to load this BPF program. */ #include <uapi/linux/bpf.h> #include <uapi/linux/if_ether.h> #include <uapi/linux/if_packet.h> #include <uapi/linux/ip.h> #include <linux/socket.h> #include "bpf_helpers.h" #include "bpf_endian.h" #define DEBUG 1 #define bpf_printk(fmt, ...) \ ({ \ char ____fmt[] = fmt; \ bpf_trace_printk(____fmt, sizeof(____fmt), \ ##__VA_ARGS__); \ }) SEC("sockops") int bpf_bufs(struct bpf_sock_ops *skops) { int bufsize = 1500000; int rwnd_init = 40; int rv = 0; int op; /* For testing purposes, only execute rest of BPF program * if neither port numberis 55601 */ if (bpf_ntohl(skops->remote_port) != 55601 && skops->local_port != 55601) return -1; op = (int) skops->op; #ifdef DEBUG bpf_printk("Returning %d\n", rv); #endif /* Usually there would be a check to insure the hosts are far * from each other so it makes sense to increase buffer sizes */ switch (op) { case BPF_SOCK_OPS_RWND_INIT: rv = rwnd_init; break; case BPF_SOCK_OPS_TCP_CONNECT_CB: /* Set sndbuf and rcvbuf of active connections */ rv = bpf_setsockopt(skops, SOL_SOCKET, SO_SNDBUF, &bufsize, sizeof(bufsize)); rv = rv*100 + bpf_setsockopt(skops, SOL_SOCKET, SO_RCVBUF, &bufsize, sizeof(bufsize)); break; case BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB: /* Nothing to do */ break; case BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB: /* Set sndbuf and rcvbuf of passive connections */ rv = bpf_setsockopt(skops, SOL_SOCKET, SO_SNDBUF, &bufsize, sizeof(bufsize)); rv = rv*100 + bpf_setsockopt(skops, SOL_SOCKET, SO_RCVBUF, &bufsize, sizeof(bufsize)); break; default: rv = -1; } #ifdef DEBUG bpf_printk("Returning %d\n", rv); #endif skops->reply = rv; return 1; } char _license[] SEC("license") = "GPL";
/* * platform_imx175.h: imx175 platform data header file * * (C) Copyright 2008 Intel Corporation * Author: * * 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. */ #ifndef _PLATFORM_IMX175_H_ #define _PLATFORM_IMX175_H_ extern void *imx175_platform_data(void *info) __attribute__((weak)); #endif
#ifndef MB_TWI_CONTROLLER_H #define MB_TWI_CONTROLLER_H #include "std.h" extern void mb_twi_controller_init(void); extern void mb_twi_controller_set(float throttle); #define MB_TWI_CONTROLLER_MAX_CMD 65535 /* Slave address front = 0x52 back = 0x54 right = 0x56 left = 0x58 */ #define MB_TWI_CONTROLLER_ADDR 0x52 #endif /* MB_TWI_CONTROLLER_H */
/* * Copyright (C) 2011 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. */ #ifndef II420_COLOR_CONVERTER_H #define II420_COLOR_CONVERTER_H #include <stdint.h> #include <android/rect.h> #ifdef __cplusplus extern "C" { #endif typedef struct II420ColorConverter { /* * getDecoderOutputFormat * Returns the color format (OMX_COLOR_FORMATTYPE) of the decoder output. * If it is I420 (OMX_COLOR_FormatYUV420Planar), no conversion is needed, * and convertDecoderOutputToI420() can be a no-op. */ int (*getDecoderOutputFormat)(); /* * convertDecoderOutputToI420 * @Desc Converts from the decoder output format to I420 format. * @note Caller (e.g. VideoEditor) owns the buffers * @param decoderBits (IN) Pointer to the buffer contains decoder output * @param decoderWidth (IN) Buffer width, as reported by the decoder * metadata (kKeyWidth) * @param decoderHeight (IN) Buffer height, as reported by the decoder * metadata (kKeyHeight) * @param decoderRect (IN) The rectangle of the actual frame, as * reported by decoder metadata (kKeyCropRect) * @param dstBits (OUT) Pointer to the output I420 buffer * @return -1 Any error * @return 0 No Error */ int (*convertDecoderOutputToI420)( void* decoderBits, int decoderWidth, int decoderHeight, ARect decoderRect, void* dstBits); /* * getEncoderIntputFormat * Returns the color format (OMX_COLOR_FORMATTYPE) of the encoder input. * If it is I420 (OMX_COLOR_FormatYUV420Planar), no conversion is needed, * and convertI420ToEncoderInput() and getEncoderInputBufferInfo() can * be no-ops. */ int (*getEncoderInputFormat)(); /* convertI420ToEncoderInput * @Desc This function converts from I420 to the encoder input format * @note Caller (e.g. VideoEditor) owns the buffers * @param srcBits (IN) Pointer to the input I420 buffer * @param srcWidth (IN) Width of the I420 frame * @param srcHeight (IN) Height of the I420 frame * @param encoderWidth (IN) Encoder buffer width, as calculated by * getEncoderBufferInfo() * @param encoderHeight (IN) Encoder buffer height, as calculated by * getEncoderBufferInfo() * @param encoderRect (IN) Rect coordinates of the actual frame inside * the encoder buffer, as calculated by * getEncoderBufferInfo(). * @param encoderBits (OUT) Pointer to the output buffer. The size of * this buffer is calculated by * getEncoderBufferInfo() * @return -1 Any error * @return 0 No Error */ int (*convertI420ToEncoderInput)( void* srcBits, int srcWidth, int srcHeight, int encoderWidth, int encoderHeight, ARect encoderRect, void* encoderBits); /* getEncoderInputBufferInfo * @Desc This function returns metadata for the encoder input buffer * based on the actual I420 frame width and height. * @note This API should be be used to obtain the necessary information * before calling convertI420ToEncoderInput(). * VideoEditor knows only the width and height of the I420 buffer, * but it also needs know the width, height, and size of the * encoder input buffer. The encoder input buffer width and height * are used to set the metadata for the encoder. * @param srcWidth (IN) Width of the I420 frame * @param srcHeight (IN) Height of the I420 frame * @param encoderWidth (OUT) Encoder buffer width needed * @param encoderHeight (OUT) Encoder buffer height needed * @param encoderRect (OUT) Rect coordinates of the actual frame inside * the encoder buffer * @param encoderBufferSize (OUT) The size of the buffer that need to be * allocated by the caller before invoking * convertI420ToEncoderInput(). * @return -1 Any error * @return 0 No Error */ int (*getEncoderInputBufferInfo)( int srcWidth, int srcHeight, int* encoderWidth, int* encoderHeight, ARect* encoderRect, int* encoderBufferSize); } II420ColorConverter; /* The only function that the shared library needs to expose: It fills the function pointers in II420ColorConverter */ void getI420ColorConverter(II420ColorConverter *converter); #if defined(__cplusplus) } #endif #endif // II420_COLOR_CONVERTER_H
#ifndef _IEEE1394_TRANSACTIONS_H #define _IEEE1394_TRANSACTIONS_H #include <linux/types.h> #include "ieee1394_types.h" struct hpsb_packet; struct hpsb_host; int hpsb_get_tlabel(struct hpsb_packet *packet); void hpsb_free_tlabel(struct hpsb_packet *packet); struct hpsb_packet *hpsb_make_readpacket(struct hpsb_host *host, nodeid_t node, u64 addr, size_t length); struct hpsb_packet *hpsb_make_lockpacket(struct hpsb_host *host, nodeid_t node, u64 addr, int extcode, quadlet_t *data, quadlet_t arg); struct hpsb_packet *hpsb_make_lock64packet(struct hpsb_host *host, nodeid_t node, u64 addr, int extcode, octlet_t *data, octlet_t arg); struct hpsb_packet *hpsb_make_phypacket(struct hpsb_host *host, quadlet_t data); struct hpsb_packet *hpsb_make_writepacket(struct hpsb_host *host, nodeid_t node, u64 addr, quadlet_t *buffer, size_t length); struct hpsb_packet *hpsb_make_streampacket(struct hpsb_host *host, u8 *buffer, int length, int channel, int tag, int sync); int hpsb_packet_success(struct hpsb_packet *packet); int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation, u64 addr, quadlet_t *buffer, size_t length); int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation, u64 addr, quadlet_t *buffer, size_t length); #ifdef HPSB_DEBUG_TLABELS extern spinlock_t hpsb_tlabel_lock; #endif #endif /* _IEEE1394_TRANSACTIONS_H */
/* * igep0020.c -- SoC audio for IGEP v2 * * Based on sound/soc/omap/overo.c by Steve Sakoman * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include <linux/clk.h> #include <linux/platform_device.h> #include <linux/module.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/soc.h> #include <asm/mach-types.h> #include <mach/hardware.h> #include <mach/gpio.h> #include <plat/mcbsp.h> #include "omap-mcbsp.h" #include "omap-pcm.h" static int igep2_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; int ret; /* Set the codec system clock for DAC and ADC */ ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000, SND_SOC_CLOCK_IN); if (ret < 0) { printk(KERN_ERR "can't set codec system clock\n"); return ret; } return 0; } static struct snd_soc_ops igep2_ops = { .hw_params = igep2_hw_params, }; /* Digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link igep2_dai = { .name = "TWL4030", .stream_name = "TWL4030", .cpu_dai_name = "omap-mcbsp.2", .codec_dai_name = "twl4030-hifi", .platform_name = "omap-pcm-audio", .codec_name = "twl4030-codec", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, .ops = &igep2_ops, }; /* Audio machine driver */ static struct snd_soc_card snd_soc_card_igep2 = { .name = "igep2", .owner = THIS_MODULE, .dai_link = &igep2_dai, .num_links = 1, }; static struct platform_device *igep2_snd_device; static int __init igep2_soc_init(void) { int ret; if (!machine_is_igep0020()) return -ENODEV; printk(KERN_INFO "IGEP v2 SoC init\n"); igep2_snd_device = platform_device_alloc("soc-audio", -1); if (!igep2_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } platform_set_drvdata(igep2_snd_device, &snd_soc_card_igep2); ret = platform_device_add(igep2_snd_device); if (ret) goto err1; return 0; err1: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(igep2_snd_device); return ret; } module_init(igep2_soc_init); static void __exit igep2_soc_exit(void) { platform_device_unregister(igep2_snd_device); } module_exit(igep2_soc_exit); MODULE_AUTHOR("Enric Balletbo i Serra <eballetbo@iseebcn.com>"); MODULE_DESCRIPTION("ALSA SoC IGEP v2"); MODULE_LICENSE("GPL");
/* This is the c configuration file for the keymap Copyright 2012 Jun Wako <wakojun@gmail.com> Copyright 2015 Jack Humbert This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CONFIG_USER_H #define CONFIG_USER_H #include "../../config.h" /* Use I2C or Serial, not both */ #define USE_I2C //#define USE_SERIAL /* Select hand configuration */ #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS #define FLIP_HALF #define SSD1306OLED //#define OLED_ROTATE180 #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 #ifdef SUBPROJECT_rev1 #include "../../rev1/config.h" #endif #ifdef SUBPROJECT_rev2 #include "../../rev2/config.h" #endif #undef RGBLED_NUM #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 6 #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 #endif
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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 _LOG4CXX_HELPERS_CONDITION_H #define _LOG4CXX_HELPERS_CONDITION_H #include <log4cxx/log4cxx.h> #include <log4cxx/helpers/mutex.h> extern "C" { struct apr_thread_cond_t; } namespace log4cxx { namespace helpers { class Pool; /** * This class provides a means for one thread to suspend exception until * notified by another thread to resume. This class should have * similar semantics to java.util.concurrent.locks.Condition. */ class LOG4CXX_EXPORT Condition { public: /** * Create new instance. * @param p pool on which condition will be created. Needs to be * longer-lived than created instance. */ Condition(log4cxx::helpers::Pool& p); /** * Destructor. */ ~Condition(); /** * Signal all waiting threads. */ log4cxx_status_t signalAll(); /** * Await signaling of condition. * @param lock lock associated with condition, calling thread must * own lock. Lock will be released while waiting and reacquired * before returning from wait. * @throws InterruptedException if thread is interrupted. */ void await(Mutex& lock); private: apr_thread_cond_t* condition; Condition(const Condition&); Condition& operator=(const Condition&); }; } // namespace helpers } // namespace log4cxx #endif //_LOG4CXX_HELPERS_CONDITION_H
/* ************************************************************************* * Ralink Tech Inc. * 5F., No.36, Taiyuan St., Jhubei City, * Hsinchu County 302, * Taiwan, R.O.C. * * (c) Copyright 2002-2010, Ralink Technology, 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., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * * *************************************************************************/ #ifdef RT_CFG80211_SUPPORT #include <linux/ieee80211.h> typedef struct __CFG80211_CB { /* we can change channel/rate information on the fly so we backup them */ struct ieee80211_supported_band Cfg80211_bands[IEEE80211_NUM_BANDS]; struct ieee80211_channel *pCfg80211_Channels; struct ieee80211_rate *pCfg80211_Rates; /* used in wiphy_unregister */ struct wireless_dev *pCfg80211_Wdev; /* used in scan end */ struct cfg80211_scan_request *pCfg80211_ScanReq; /* monitor filter */ UINT32 MonFilterFlag; } CFG80211_CB; /* ======================================================================== Routine Description: Register MAC80211 Module. Arguments: pAd - WLAN control block pointer pDev - Generic device interface pNetDev - Network device Return Value: NONE Note: pDev != pNetDev #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) Can not use pNetDev to replace pDev; Or kernel panic. ======================================================================== */ BOOLEAN CFG80211_Register( VOID *pAd, struct device *pDev, struct net_device *pNetDev); #endif /* RT_CFG80211_SUPPORT */ /* End of cfg80211.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_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_UTIL_H_ #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_UTIL_H_ #include "sync/api/sync_change.h" #include "sync/api/sync_data.h" namespace base { class Value; } namespace content { class BrowserContext; } namespace syncer { class SyncableService; } namespace extensions { namespace settings_sync_util { // Creates a syncer::SyncData object for an extension or app setting. syncer::SyncData CreateData( const std::string& extension_id, const std::string& key, const base::Value& value, syncer::ModelType type); // Creates an "add" sync change for an extension or app setting. syncer::SyncChange CreateAdd( const std::string& extension_id, const std::string& key, const base::Value& value, syncer::ModelType type); // Creates an "update" sync change for an extension or app setting. syncer::SyncChange CreateUpdate( const std::string& extension_id, const std::string& key, const base::Value& value, syncer::ModelType type); // Creates a "delete" sync change for an extension or app setting. syncer::SyncChange CreateDelete( const std::string& extension_id, const std::string& key, syncer::ModelType type); // Returns the sync service for settings. Must be called on the FILE thread. // |type| must be either APP_SETTINGS or EXTENSION_SETTINGS. syncer::SyncableService* GetSyncableService(content::BrowserContext* context, syncer::ModelType type); } // namespace settings_sync_util } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_UTIL_H_
/****************************************************************************** * * Copyright(c) 2016 Realtek Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * The full GNU General Public License is included in this distribution in the * file called LICENSE. * * Contact Information: * wlanfae <wlanfae@realtek.com> * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, * Hsinchu 300, Taiwan. * * Larry Finger <Larry.Finger@lwfinger.net> * *****************************************************************************/ #ifndef _HALMAC_2_PLATFORM_H_ #define _HALMAC_2_PLATFORM_H_ #include "../wifi.h" #include <asm/byteorder.h> #define HALMAC_PLATFORM_LITTLE_ENDIAN 1 #define HALMAC_PLATFORM_BIG_ENDIAN 0 /* Note : Named HALMAC_PLATFORM_LITTLE_ENDIAN / HALMAC_PLATFORM_BIG_ENDIAN * is not mandatory. But Little endian must be '1'. Big endian must be '0' */ #if defined(__LITTLE_ENDIAN) #define HALMAC_SYSTEM_ENDIAN HALMAC_PLATFORM_LITTLE_ENDIAN #elif defined(__BIG_ENDIAN) #define HALMAC_SYSTEM_ENDIAN HALMAC_PLATFORM_BIG_ENDIAN #else #error #endif /* define the Platform SDIO Bus CLK */ #define PLATFORM_SD_CLK 50000000 /*50MHz*/ /* define the Rx FIFO expanding mode packet size unit for 8821C and 8822B */ /* Should be 8 Byte alignment */ #define HALMAC_RX_FIFO_EXPANDING_MODE_PKT_SIZE 16 /*Bytes*/ #endif /* _HALMAC_2_PLATFORM_H_ */
; real ; GAS defines r0..r7 as aliases for real registers; we want the saddr ; forms here. r_0 = 0xffef8 r_1 = 0xffef9 r_2 = 0xffefa r_3 = 0xffefb r_4 = 0xffefc r_5 = 0xffefd r_6 = 0xffefe r_7 = 0xffeff #ifdef __RL78_G10__ ; clobberable r8 = 0xffec8 r9 = 0xffec9 r10 = 0xffeca r11 = 0xffecb r12 = 0xffecc r13 = 0xffecd r14 = 0xffece r15 = 0xffecf ; preserved r16 = 0xffed0 r17 = 0xffed1 r18 = 0xffed2 r19 = 0xffed3 r20 = 0xffed4 r21 = 0xffed5 r22 = 0xffed6 r23 = 0xffed7 #else ; clobberable r8 = 0xffef0 r9 = 0xffef1 r10 = 0xffef2 r11 = 0xffef3 r12 = 0xffef4 r13 = 0xffef5 r14 = 0xffef6 r15 = 0xffef7 ; preserved r16 = 0xffee8 r17 = 0xffee9 r18 = 0xffeea r19 = 0xffeeb r20 = 0xffeec r21 = 0xffeed r22 = 0xffeee r23 = 0xffeef #endif
/* SPDX-License-Identifier: GPL-2.0-only */ /* Header file for all dibusb-based-receivers. * * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@posteo.de) * * see Documentation/media/dvb-drivers/dvb-usb.rst for more information */ #ifndef _DVB_USB_DIBUSB_H_ #define _DVB_USB_DIBUSB_H_ #ifndef DVB_USB_LOG_PREFIX #define DVB_USB_LOG_PREFIX "dibusb" #endif #include "dvb-usb.h" #include "dib3000.h" #include "dib3000mc.h" #include "mt2060.h" /* * protocol of all dibusb related devices */ /* * bulk msg to/from endpoint 0x01 * * general structure: * request_byte parameter_bytes */ #define DIBUSB_REQ_START_READ 0x00 #define DIBUSB_REQ_START_DEMOD 0x01 /* * i2c read * bulk write: 0x02 ((7bit i2c_addr << 1) | 0x01) register_bytes length_word * bulk read: byte_buffer (length_word bytes) */ #define DIBUSB_REQ_I2C_READ 0x02 /* * i2c write * bulk write: 0x03 (7bit i2c_addr << 1) register_bytes value_bytes */ #define DIBUSB_REQ_I2C_WRITE 0x03 /* * polling the value of the remote control * bulk write: 0x04 * bulk read: byte_buffer (5 bytes) */ #define DIBUSB_REQ_POLL_REMOTE 0x04 /* additional status values for Hauppauge Remote Control Protocol */ #define DIBUSB_RC_HAUPPAUGE_KEY_PRESSED 0x01 #define DIBUSB_RC_HAUPPAUGE_KEY_EMPTY 0x03 /* streaming mode: * bulk write: 0x05 mode_byte * * mode_byte is mostly 0x00 */ #define DIBUSB_REQ_SET_STREAMING_MODE 0x05 /* interrupt the internal read loop, when blocking */ #define DIBUSB_REQ_INTR_READ 0x06 /* io control * 0x07 cmd_byte param_bytes * * param_bytes can be up to 32 bytes * * cmd_byte function parameter name * 0x00 power mode * 0x00 sleep * 0x01 wakeup * * 0x01 enable streaming * 0x02 disable streaming * * */ #define DIBUSB_REQ_SET_IOCTL 0x07 /* IOCTL commands */ /* change the power mode in firmware */ #define DIBUSB_IOCTL_CMD_POWER_MODE 0x00 #define DIBUSB_IOCTL_POWER_SLEEP 0x00 #define DIBUSB_IOCTL_POWER_WAKEUP 0x01 /* modify streaming of the FX2 */ #define DIBUSB_IOCTL_CMD_ENABLE_STREAM 0x01 #define DIBUSB_IOCTL_CMD_DISABLE_STREAM 0x02 /* Max transfer size done by I2C transfer functions */ #define MAX_XFER_SIZE 64 struct dibusb_state { struct dib_fe_xfer_ops ops; int mt2060_present; u8 tuner_addr; }; struct dibusb_device_state { /* for RC5 remote control */ int old_toggle; int last_repeat_count; }; extern struct i2c_algorithm dibusb_i2c_algo; extern int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *); extern int dibusb_dib3000mc_tuner_attach (struct dvb_usb_adapter *); extern int dibusb_streaming_ctrl(struct dvb_usb_adapter *, int); extern int dibusb_pid_filter(struct dvb_usb_adapter *, int, u16, int); extern int dibusb_pid_filter_ctrl(struct dvb_usb_adapter *, int); extern int dibusb2_0_streaming_ctrl(struct dvb_usb_adapter *, int); extern int dibusb_power_ctrl(struct dvb_usb_device *, int); extern int dibusb2_0_power_ctrl(struct dvb_usb_device *, int); #define DEFAULT_RC_INTERVAL 150 //#define DEFAULT_RC_INTERVAL 100000 extern struct rc_map_table rc_map_dibusb_table[]; extern int dibusb_rc_query(struct dvb_usb_device *, u32 *, int *); extern int dibusb_read_eeprom_byte(struct dvb_usb_device *, u8, u8 *); #endif
#ifndef __ARCH_MACH_COMMON_H #define __ARCH_MACH_COMMON_H extern struct sys_timer shmobile_timer; extern void shmobile_setup_console(void); extern void shmobile_secondary_vector(void); struct clk; extern int clk_init(void); extern void shmobile_handle_irq_intc(struct pt_regs *); extern void shmobile_handle_irq_gic(struct pt_regs *); extern struct platform_suspend_ops shmobile_suspend_ops; struct cpuidle_driver; extern void (*shmobile_cpuidle_modes[])(void); extern void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv); extern void sh7367_init_irq(void); extern void sh7367_add_early_devices(void); extern void sh7367_add_standard_devices(void); extern void sh7367_clock_init(void); extern void sh7367_pinmux_init(void); extern struct clk sh7367_extalb1_clk; extern struct clk sh7367_extal2_clk; extern void sh7377_init_irq(void); extern void sh7377_add_early_devices(void); extern void sh7377_add_standard_devices(void); extern void sh7377_clock_init(void); extern void sh7377_pinmux_init(void); extern struct clk sh7377_extalc1_clk; extern struct clk sh7377_extal2_clk; extern void sh7372_init_irq(void); extern void sh7372_add_early_devices(void); extern void sh7372_add_standard_devices(void); extern void sh7372_clock_init(void); extern void sh7372_pinmux_init(void); extern void sh7372_pm_init(void); extern void sh7372_resume_core_standby_a3sm(void); extern int sh7372_do_idle_a3sm(unsigned long unused); extern struct clk sh7372_extal1_clk; extern struct clk sh7372_extal2_clk; extern void sh73a0_init_irq(void); extern void sh73a0_add_early_devices(void); extern void sh73a0_add_standard_devices(void); extern void sh73a0_clock_init(void); extern void sh73a0_pinmux_init(void); extern struct clk sh73a0_extal1_clk; extern struct clk sh73a0_extal2_clk; extern unsigned int sh73a0_get_core_count(void); extern void sh73a0_secondary_init(unsigned int cpu); extern int sh73a0_boot_secondary(unsigned int cpu); extern void sh73a0_smp_prepare_cpus(void); #endif /* __ARCH_MACH_COMMON_H */
#pragma once /* * Copyright (C) 2005-2013 Team XBMC * http://xbmc.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, 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 XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "storage/IStorageProvider.h" #ifdef HAS_DBUS #include "DBusUtil.h" class CDeviceKitDiskDevice { public: CDeviceKitDiskDevice(const char *DeviceKitUDI); virtual ~CDeviceKitDiskDevice() { } virtual void Update() = 0; bool Mount(); bool UnMount(); bool IsApproved(); std::string toString(); CMediaSource ToMediaShare(); std::string m_UDI, m_DeviceKitUDI, m_MountPath, m_FileSystem, m_Label; bool m_isMounted, m_isMountedByUs, m_isRemovable, m_isPartition, m_isFileSystem, m_isSystemInternal, m_isOptical; float m_PartitionSizeGiB; }; class CDeviceKitDiskDeviceNewAPI : public CDeviceKitDiskDevice { public: CDeviceKitDiskDeviceNewAPI(const char *DeviceKitUDI) : CDeviceKitDiskDevice(DeviceKitUDI) { Update(); } virtual ~CDeviceKitDiskDeviceNewAPI() { } virtual void Update(); }; class CDeviceKitDiskDeviceOldAPI : public CDeviceKitDiskDevice { public: CDeviceKitDiskDeviceOldAPI(const char *DeviceKitUDI) : CDeviceKitDiskDevice(DeviceKitUDI) { Update(); } virtual ~CDeviceKitDiskDeviceOldAPI() { } virtual void Update(); }; class CDeviceKitDisksProvider : public IStorageProvider { public: CDeviceKitDisksProvider(); virtual ~CDeviceKitDisksProvider(); virtual void Initialize(); virtual void Stop() { } virtual void GetLocalDrives(VECSOURCES &localDrives) { GetDisks(localDrives, false); } virtual void GetRemovableDrives(VECSOURCES &removableDrives) { GetDisks(removableDrives, true); } virtual bool Eject(const std::string& mountpath); virtual std::vector<std::string> GetDiskUsage(); virtual bool PumpDriveChangeEvents(IStorageEventsCallback *callback); static bool HasDeviceKitDisks(); private: typedef std::map<std::string, CDeviceKitDiskDevice *> DeviceMap; typedef std::pair<std::string, CDeviceKitDiskDevice *> DevicePair; void DeviceAdded(const char *object, IStorageEventsCallback *callback); void DeviceRemoved(const char *object, IStorageEventsCallback *callback); void DeviceChanged(const char *object, IStorageEventsCallback *callback); std::vector<std::string> EnumerateDisks(); void GetDisks(VECSOURCES& devices, bool EnumerateRemovable); int m_DaemonVersion; DeviceMap m_AvailableDevices; DBusConnection *m_connection; DBusError m_error; }; #endif
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _ASM_ALPHA_IOCTLS_H #define _ASM_ALPHA_IOCTLS_H #include <asm/ioctl.h> #define FIOCLEX _IO('f', 1) #define FIONCLEX _IO('f', 2) #define FIOASYNC _IOW('f', 125, int) #define FIONBIO _IOW('f', 126, int) #define FIONREAD _IOR('f', 127, int) #define TIOCINQ FIONREAD #define FIOQSIZE _IOR('f', 128, loff_t) #define TIOCGETP _IOR('t', 8, struct sgttyb) #define TIOCSETP _IOW('t', 9, struct sgttyb) #define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */ #define TIOCSETC _IOW('t', 17, struct tchars) #define TIOCGETC _IOR('t', 18, struct tchars) #define TCGETS _IOR('t', 19, struct termios) #define TCSETS _IOW('t', 20, struct termios) #define TCSETSW _IOW('t', 21, struct termios) #define TCSETSF _IOW('t', 22, struct termios) #define TCGETA _IOR('t', 23, struct termio) #define TCSETA _IOW('t', 24, struct termio) #define TCSETAW _IOW('t', 25, struct termio) #define TCSETAF _IOW('t', 28, struct termio) #define TCSBRK _IO('t', 29) #define TCXONC _IO('t', 30) #define TCFLSH _IO('t', 31) #define TCGETS2 _IOR('T', 42, struct termios2) #define TCSETS2 _IOW('T', 43, struct termios2) #define TCSETSW2 _IOW('T', 44, struct termios2) #define TCSETSF2 _IOW('T', 45, struct termios2) #define TIOCSWINSZ _IOW('t', 103, struct winsize) #define TIOCGWINSZ _IOR('t', 104, struct winsize) #define TIOCSTART _IO('t', 110) /* start output, like ^Q */ #define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ #define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ #define TIOCGLTC _IOR('t', 116, struct ltchars) #define TIOCSLTC _IOW('t', 117, struct ltchars) #define TIOCSPGRP _IOW('t', 118, int) #define TIOCGPGRP _IOR('t', 119, int) #define TIOCEXCL 0x540C #define TIOCNXCL 0x540D #define TIOCSCTTY 0x540E #define TIOCSTI 0x5412 #define TIOCMGET 0x5415 #define TIOCMBIS 0x5416 #define TIOCMBIC 0x5417 #define TIOCMSET 0x5418 # define TIOCM_LE 0x001 # define TIOCM_DTR 0x002 # define TIOCM_RTS 0x004 # define TIOCM_ST 0x008 # define TIOCM_SR 0x010 # define TIOCM_CTS 0x020 # define TIOCM_CAR 0x040 # define TIOCM_RNG 0x080 # define TIOCM_DSR 0x100 # define TIOCM_CD TIOCM_CAR # define TIOCM_RI TIOCM_RNG # define TIOCM_OUT1 0x2000 # define TIOCM_OUT2 0x4000 # define TIOCM_LOOP 0x8000 #define TIOCGSOFTCAR 0x5419 #define TIOCSSOFTCAR 0x541A #define TIOCLINUX 0x541C #define TIOCCONS 0x541D #define TIOCGSERIAL 0x541E #define TIOCSSERIAL 0x541F #define TIOCPKT 0x5420 # define TIOCPKT_DATA 0 # define TIOCPKT_FLUSHREAD 1 # define TIOCPKT_FLUSHWRITE 2 # define TIOCPKT_STOP 4 # define TIOCPKT_START 8 # define TIOCPKT_NOSTOP 16 # define TIOCPKT_DOSTOP 32 # define TIOCPKT_IOCTL 64 #define TIOCNOTTY 0x5422 #define TIOCSETD 0x5423 #define TIOCGETD 0x5424 #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ #define TIOCSBRK 0x5427 /* BSD compatibility */ #define TIOCCBRK 0x5428 /* BSD compatibility */ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGRS485 _IOR('T', 0x2E, struct serial_rs485) #define TIOCSRS485 _IOWR('T', 0x2F, struct serial_rs485) #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ #define TIOCVHANGUP 0x5437 #define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */ #define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */ #define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */ #define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */ #define TIOCGISO7816 _IOR('T', 0x42, struct serial_iso7816) #define TIOCSISO7816 _IOWR('T', 0x43, struct serial_iso7816) #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 #define TIOCSERSWILD 0x5455 #define TIOCGLCKTRMIOS 0x5456 #define TIOCSLCKTRMIOS 0x5457 #define TIOCSERGSTRUCT 0x5458 /* For debugging only */ #define TIOCSERGETLSR 0x5459 /* Get line status register */ /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ #define TIOCSERGETMULTI 0x545A /* Get multiport config */ #define TIOCSERSETMULTI 0x545B /* Set multiport config */ #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ #endif /* _ASM_ALPHA_IOCTLS_H */