text
stringlengths
4
6.14k
// Copyright 2014 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include <functional> #include "Common/CommonTypes.h" #include "VideoCommon/RenderState.h" #include "VideoCommon/ShaderGenCommon.h" enum class APIType; #pragma pack(1) struct geometry_shader_uid_data { u32 NumValues() const { return sizeof(geometry_shader_uid_data); } bool IsPassthrough() const; u32 numTexGens : 4; u32 primitive_type : 2; }; #pragma pack() using GeometryShaderUid = ShaderUid<geometry_shader_uid_data>; ShaderCode GenerateGeometryShaderCode(APIType ApiType, const ShaderHostConfig& host_config, const geometry_shader_uid_data* uid_data); GeometryShaderUid GetGeometryShaderUid(PrimitiveType primitive_type); void EnumerateGeometryShaderUids(const std::function<void(const GeometryShaderUid&)>& callback);
/*---------------------------------------------------------------------------*\ FILE........: lpc.h AUTHOR......: David Rowe DATE CREATED: 24/8/09 Linear Prediction functions written in C. \*---------------------------------------------------------------------------*/ /* Copyright (C) 2009 David Rowe All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __LPC__ #define __LPC__ #define LPC_MAX_ORDER 20 void hanning_window(float Sn[], float Wn[], int Nsam); void autocorrelate(float Sn[], float Rn[], int Nsam, int order); void autocorrelate_freq(float Pw[], float w[], float R[], int Nsam, int order); void levinson_durbin(float R[], float lpcs[], int order); void inverse_filter(float Sn[], float a[], int Nsam, float res[], int order); void synthesis_filter(float res[], float a[], int Nsam, int order, float Sn_[]); void find_aks(float Sn[], float a[], int Nsam, int order, float *E); void weight(float ak[], float gamma, int order, float akw[]); #endif
/* * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef MIMETypeRegistry_h #define MIMETypeRegistry_h #include "platform/PlatformExport.h" #include "wtf/HashSet.h" #include "wtf/text/StringHash.h" #include "wtf/text/WTFString.h" namespace blink { class PLATFORM_EXPORT MIMETypeRegistry { public: static String getMIMETypeForExtension(const String& extension); static String getWellKnownMIMETypeForExtension(const String& extension); static String getMIMETypeForPath(const String& path); // Check to see if a mime type is suitable for being loaded inline as an // image (e.g., <img> tags). static bool isSupportedImageMIMEType(const String& mimeType); // Check to see if a mime type is suitable for being loaded as an image // document in a frame. static bool isSupportedImageResourceMIMEType(const String& mimeType); // Check to see if a mime type is suitable for being displayed as an image. static bool isSupportedImagePrefixedMIMEType(const String& mimeType); // Check to see if a mime type is suitable for being encoded. static bool isSupportedImageMIMETypeForEncoding(const String& mimeType); // Check to see if a mime type is suitable for being loaded as a JavaScript // resource. static bool isSupportedJavaScriptMIMEType(const String& mimeType); // Check to see if a non-image mime type is suitable for being loaded as a // document in a frame. Includes supported JavaScript MIME types. static bool isSupportedNonImageMIMEType(const String& mimeType); // Check to see if the mime type and codecs are supported by the MediaSource implementation. static bool isSupportedMediaSourceMIMEType(const String& mimeType, const String& codecs); // Check to see if a mime type is a valid Java applet mime type static bool isJavaAppletMIMEType(const String& mimeType); }; } // namespace blink #endif // MIMETypeRegistry_h
/****************************************************************************** * @file system_RZ_A1LU.c * @brief CMSIS Device System Source File for ARM Cortex-A9 Device Series * @version V1.00 * @date 10 Mar 2017 * * @note * ******************************************************************************/ /* * Copyright (c) 2013-2014 Renesas Electronics Corporation. All rights reserved. * Copyright (c) 2009-2017 ARM Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * * 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 * * www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "RZ_A1LU.h" #include "RZ_A1_Init.h" #include "irq_ctrl.h" #include "mbed_drv_cfg.h" /* Port 0 (P0) MD pin assignment P0_0: MD_BOOT0 P0_1: MD_BOOT1 P0_2: MD_CLK P0_3: MD_CLKS */ /*---------------------------------------------------------------------------- System Core Clock Variable *----------------------------------------------------------------------------*/ uint32_t SystemCoreClock = RENESAS_RZ_A1_SYS_CLK; /*---------------------------------------------------------------------------- System Core Clock update function *----------------------------------------------------------------------------*/ void SystemCoreClockUpdate (void) { uint32_t freq; uint16_t ifc; freq = RENESAS_RZ_A1_SYS_CLK; /* Get CPG.FRQCR[IFC] bits */ ifc = (CPG.FRQCR >> 8U) & 0x03U; /* Determine Divider 2 output clock */ if (ifc == 0x03U) { /* Division ratio is 1/3 */ freq = (freq / 3U); } else if (ifc == 0x01U) { /* Division ratio is 2/3 */ freq = (freq * 2U) / 3U; } else { /* do nothing */ } SystemCoreClock = freq; } /*---------------------------------------------------------------------------- IRQ Handler Register/Unregister *----------------------------------------------------------------------------*/ uint32_t InterruptHandlerRegister (IRQn_Type irq, IRQHandler handler) { return IRQ_SetHandler(irq, handler); } uint32_t InterruptHandlerUnregister (IRQn_Type irq) { return IRQ_SetHandler(irq, (IRQHandler_t)NULL); } /*---------------------------------------------------------------------------- System Initialization *----------------------------------------------------------------------------*/ void SystemInit (void) { /* do not use global variables because this function is called before reaching pre-main. RW section may be overwritten afterwards. */ #if ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) // Enable FPU __FPU_Enable(); #endif // Enable SRAM write access CPG.SYSCR3 = 0x0F; RZ_A1_InitClock(); RZ_A1_InitBus(); // Invalidate entire Unified TLB __set_TLBIALL(0); // Invalidate entire branch predictor array __set_BPIALL(0); __DSB(); __ISB(); // Invalidate instruction cache and flush branch target cache __set_ICIALLU(0); __DSB(); __ISB(); // Invalidate data cache L1C_InvalidateDCacheAll(); // Create Translation Table MMU_CreateTranslationTable(); // Enable MMU MMU_Enable(); // Enable Caches L1C_EnableCaches(); L1C_EnableBTAC(); #if (__L2C_PRESENT == 1) L2C_InvAllByWay(); // Enable L2C L2C_Enable(); #endif // IRQ Initialize IRQ_Initialize(); } void mbed_sdk_init(void) { L1C_CleanDCacheAll(); L1C_InvalidateICacheAll(); }
/**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #ifndef __CC_FILEUTILS_ANDROID_H__ #define __CC_FILEUTILS_ANDROID_H__ #include "platform/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID #include "platform/CCFileUtils.h" #include "platform/CCPlatformMacros.h" #include "base/ccTypes.h" #include <string> #include <vector> #include "jni.h" #include "android/asset_manager.h" NS_CC_BEGIN /** * @addtogroup platform * @{ */ //! @brief Helper class to handle file operations class CC_DLL FileUtilsAndroid : public FileUtils { friend class FileUtils; public: FileUtilsAndroid(); /** * @js NA * @lua NA */ virtual ~FileUtilsAndroid(); static void setassetmanager(AAssetManager* a); static AAssetManager* getAssetManager() { return assetmanager; } /* override functions */ bool init(); virtual std::string getNewFilename(const std::string &filename) const override; /** @deprecated Please use FileUtils::getDataFromFile or FileUtils::getStringFromFile instead. */ CC_DEPRECATED_ATTRIBUTE virtual unsigned char* getFileData(const std::string& filename, const char* mode, ssize_t * size) override; /** * Gets string from a file. */ virtual std::string getStringFromFile(const std::string& filename) override; /** * Creates binary data from a file. * @return A data object. */ virtual Data getDataFromFile(const std::string& filename) override; virtual std::string getWritablePath() const; virtual bool isAbsolutePath(const std::string& strPath) const; private: virtual bool isFileExistInternal(const std::string& strFilePath) const override; virtual bool isDirectoryExistInternal(const std::string& dirPath) const override; Data getData(const std::string& filename, bool forString); static AAssetManager* assetmanager; }; // end of platform group /// @} NS_CC_END #endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID #endif // __CC_FILEUTILS_ANDROID_H__
#include "hw.h" #include "sh.h" #include "loader.h" #define CE1 0x0100 #define CE2 0x0200 #define RE 0x0400 #define WE 0x0800 #define ALE 0x1000 #define CLE 0x2000 #define RDY1 0x4000 #define RDY2 0x8000 #define RDY(n) ((n) == 0 ? RDY1 : RDY2) typedef enum { WAIT, READ1, READ2, READ3 } state_t; typedef struct { uint8_t *flash_contents; state_t state; uint32_t address; uint8_t address_cycle; } tc58128_dev; static tc58128_dev tc58128_devs[2]; #define FLASH_SIZE (16*1024*1024) static void init_dev(tc58128_dev * dev, const char *filename) { int ret, blocks; dev->state = WAIT; dev->flash_contents = qemu_mallocz(FLASH_SIZE); memset(dev->flash_contents, 0xff, FLASH_SIZE); if (!dev->flash_contents) { fprintf(stderr, "could not alloc memory for flash\n"); exit(1); } if (filename) { /* Load flash image skipping the first block */ ret = load_image(filename, dev->flash_contents + 528 * 32); if (ret < 0) { fprintf(stderr, "ret=%d\n", ret); fprintf(stderr, "qemu: could not load flash image %s\n", filename); exit(1); } else { /* Build first block with number of blocks */ blocks = (ret + 528 * 32 - 1) / (528 * 32); dev->flash_contents[0] = blocks & 0xff; dev->flash_contents[1] = (blocks >> 8) & 0xff; dev->flash_contents[2] = (blocks >> 16) & 0xff; dev->flash_contents[3] = (blocks >> 24) & 0xff; fprintf(stderr, "loaded %d bytes for %s into flash\n", ret, filename); } } } static void handle_command(tc58128_dev * dev, uint8_t command) { switch (command) { case 0xff: fprintf(stderr, "reset flash device\n"); dev->state = WAIT; break; case 0x00: fprintf(stderr, "read mode 1\n"); dev->state = READ1; dev->address_cycle = 0; break; case 0x01: fprintf(stderr, "read mode 2\n"); dev->state = READ2; dev->address_cycle = 0; break; case 0x50: fprintf(stderr, "read mode 3\n"); dev->state = READ3; dev->address_cycle = 0; break; default: fprintf(stderr, "unknown flash command 0x%02x\n", command); abort(); } } static void handle_address(tc58128_dev * dev, uint8_t data) { switch (dev->state) { case READ1: case READ2: case READ3: switch (dev->address_cycle) { case 0: dev->address = data; if (dev->state == READ2) dev->address |= 0x100; else if (dev->state == READ3) dev->address |= 0x200; break; case 1: dev->address += data * 528 * 0x100; break; case 2: dev->address += data * 528; fprintf(stderr, "address pointer in flash: 0x%08x\n", dev->address); break; default: /* Invalid data */ abort(); } dev->address_cycle++; break; default: abort(); } } static uint8_t handle_read(tc58128_dev * dev) { #if 0 if (dev->address % 0x100000 == 0) fprintf(stderr, "reading flash at address 0x%08x\n", dev->address); #endif return dev->flash_contents[dev->address++]; } /* We never mark the device as busy, so interrupts cannot be triggered XXXXX */ static int tc58128_cb(uint16_t porta, uint16_t portb, uint16_t * periph_pdtra, uint16_t * periph_portadir, uint16_t * periph_pdtrb, uint16_t * periph_portbdir) { int dev; if ((porta & CE1) == 0) dev = 0; else if ((porta & CE2) == 0) dev = 1; else return 0; /* No device selected */ if ((porta & RE) && (porta & WE)) { /* Nothing to do, assert ready and return to input state */ *periph_portadir &= 0xff00; *periph_portadir |= RDY(dev); *periph_pdtra |= RDY(dev); return 1; } if (porta & CLE) { /* Command */ assert((porta & WE) == 0); handle_command(&tc58128_devs[dev], porta & 0x00ff); } else if (porta & ALE) { assert((porta & WE) == 0); handle_address(&tc58128_devs[dev], porta & 0x00ff); } else if ((porta & RE) == 0) { *periph_portadir |= 0x00ff; *periph_pdtra &= 0xff00; *periph_pdtra |= handle_read(&tc58128_devs[dev]); } else { abort(); } return 1; } static sh7750_io_device tc58128 = { RE | WE, /* Port A triggers */ 0, /* Port B triggers */ tc58128_cb /* Callback */ }; int tc58128_init(struct SH7750State *s, const char *zone1, const char *zone2) { init_dev(&tc58128_devs[0], zone1); init_dev(&tc58128_devs[1], zone2); return sh7750_register_io_device(s, &tc58128); }
/*************************************************************************** * Copyright (C) 2009 by Zachary T Welch <zw@superlucidity.net> * * * * 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/>. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "common.h" #include <helper/log.h> unsigned get_flash_name_index(const char *name) { const char *name_index = strrchr(name, '.'); if (NULL == name_index) return 0; if (name_index[1] < '0' || name_index[1] > '9') return ~0U; unsigned requested; int retval = parse_uint(name_index + 1, &requested); /* detect parsing error by forcing past end of bank list */ return (ERROR_OK == retval) ? requested : ~0U; } bool flash_driver_name_matches(const char *name, const char *expected) { unsigned blen = strlen(name); /* only match up to the length of the driver name... */ if (strncmp(name, expected, blen) != 0) return false; /* ...then check that name terminates at this spot. */ return expected[blen] == '.' || expected[blen] == '\0'; }
/* * Copyright (c) 2015-2016, 2018, Arm Limited and affiliates. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cfg_nanostack_full.h" #define FEA_TRACE_SUPPORT #define EXTRA_CONSISTENCY_CHECKS
/* ---------------------------------------------------------------------- * Copyright (C) 2010-2014 ARM Limited. All rights reserved. * * $Date: 19. March 2015 * $Revision: V.1.4.5 * * Project: CMSIS DSP Library * Title: arm_max_f32.c * * Description: Maximum value of a floating-point vector. * * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 * * 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 ARM LIMITED nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ---------------------------------------------------------------------------- */ #include "arm_math.h" /** * @ingroup groupStats */ /** * @defgroup Max Maximum * * Computes the maximum value of an array of data. * The function returns both the maximum value and its position within the array. * There are separate functions for floating-point, Q31, Q15, and Q7 data types. */ /** * @addtogroup Max * @{ */ /** * @brief Maximum value of a floating-point vector. * @param[in] *pSrc points to the input vector * @param[in] blockSize length of the input vector * @param[out] *pResult maximum value returned here * @param[out] *pIndex index of maximum value returned here * @return none. */ void arm_max_f32( float32_t * pSrc, uint32_t blockSize, float32_t * pResult, uint32_t * pIndex) { #ifndef ARM_MATH_CM0_FAMILY /* Run the below code for Cortex-M4 and Cortex-M3 */ float32_t maxVal1, maxVal2, out; /* Temporary variables to store the output value. */ uint32_t blkCnt, outIndex, count; /* loop counter */ /* Initialise the count value. */ count = 0u; /* Initialise the index value to zero. */ outIndex = 0u; /* Load first input value that act as reference value for comparision */ out = *pSrc++; /* Loop unrolling */ blkCnt = (blockSize - 1u) >> 2u; /* Run the below code for Cortex-M4 and Cortex-M3 */ while(blkCnt > 0u) { /* Initialize maxVal to the next consecutive values one by one */ maxVal1 = *pSrc++; maxVal2 = *pSrc++; /* compare for the maximum value */ if(out < maxVal1) { /* Update the maximum value and its index */ out = maxVal1; outIndex = count + 1u; } maxVal1 = *pSrc++; /* compare for the maximum value */ if(out < maxVal2) { /* Update the maximum value and its index */ out = maxVal2; outIndex = count + 2u; } maxVal2 = *pSrc++; /* compare for the maximum value */ if(out < maxVal1) { /* Update the maximum value and its index */ out = maxVal1; outIndex = count + 3u; } /* compare for the maximum value */ if(out < maxVal2) { /* Update the maximum value and its index */ out = maxVal2; outIndex = count + 4u; } count += 4u; /* Decrement the loop counter */ blkCnt--; } /* if (blockSize - 1u) is not multiple of 4 */ blkCnt = (blockSize - 1u) % 4u; #else /* Run the below code for Cortex-M0 */ float32_t maxVal1, out; /* Temporary variables to store the output value. */ uint32_t blkCnt, outIndex; /* loop counter */ /* Initialise the index value to zero. */ outIndex = 0u; /* Load first input value that act as reference value for comparision */ out = *pSrc++; blkCnt = (blockSize - 1u); #endif /* #ifndef ARM_MATH_CM0_FAMILY */ while(blkCnt > 0u) { /* Initialize maxVal to the next consecutive values one by one */ maxVal1 = *pSrc++; /* compare for the maximum value */ if(out < maxVal1) { /* Update the maximum value and it's index */ out = maxVal1; outIndex = blockSize - blkCnt; } /* Decrement the loop counter */ blkCnt--; } /* Store the maximum value and it's index into destination pointers */ *pResult = out; *pIndex = outIndex; } /** * @} end of Max group */
/* * Renesas USB driver * * Copyright (C) 2011 Renesas Solutions Corp. * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef RENESAS_USB_FIFO_H #define RENESAS_USB_FIFO_H #include <linux/interrupt.h> #include <linux/sh_dma.h> #include <linux/workqueue.h> #include <asm/dma.h> #include "pipe.h" struct usbhs_fifo { char *name; u32 port; /* xFIFO */ u32 sel; /* xFIFOSEL */ u32 ctr; /* xFIFOCTR */ struct usbhs_pipe *pipe; struct dma_chan *tx_chan; struct dma_chan *rx_chan; struct sh_dmae_slave tx_slave; struct sh_dmae_slave rx_slave; }; struct usbhs_fifo_info { struct usbhs_fifo cfifo; struct usbhs_fifo d0fifo; struct usbhs_fifo d1fifo; }; struct usbhs_pkt_handle; struct usbhs_pkt { struct list_head node; struct usbhs_pipe *pipe; struct usbhs_pkt_handle *handler; void (*done)(struct usbhs_priv *priv, struct usbhs_pkt *pkt); struct work_struct work; dma_addr_t dma; void *buf; int length; int trans; int actual; int zero; int sequence; }; struct usbhs_pkt_handle { int (*prepare)(struct usbhs_pkt *pkt, int *is_done); int (*try_run)(struct usbhs_pkt *pkt, int *is_done); int (*dma_done)(struct usbhs_pkt *pkt, int *is_done); }; /* * fifo */ int usbhs_fifo_probe(struct usbhs_priv *priv); void usbhs_fifo_remove(struct usbhs_priv *priv); void usbhs_fifo_init(struct usbhs_priv *priv); void usbhs_fifo_quit(struct usbhs_priv *priv); /* * packet info */ extern struct usbhs_pkt_handle usbhs_fifo_pio_push_handler; extern struct usbhs_pkt_handle usbhs_fifo_pio_pop_handler; extern struct usbhs_pkt_handle usbhs_ctrl_stage_end_handler; extern struct usbhs_pkt_handle usbhs_fifo_dma_push_handler; extern struct usbhs_pkt_handle usbhs_fifo_dma_pop_handler; extern struct usbhs_pkt_handle usbhs_dcp_status_stage_in_handler; extern struct usbhs_pkt_handle usbhs_dcp_status_stage_out_handler; extern struct usbhs_pkt_handle usbhs_dcp_data_stage_in_handler; extern struct usbhs_pkt_handle usbhs_dcp_data_stage_out_handler; void usbhs_pkt_init(struct usbhs_pkt *pkt); void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, void (*done)(struct usbhs_priv *priv, struct usbhs_pkt *pkt), void *buf, int len, int zero, int sequence); struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt); void usbhs_pkt_start(struct usbhs_pipe *pipe); #endif /* RENESAS_USB_FIFO_H */
/* * TI AM33XX EMIF PM Assembly Offsets * * Copyright (C) 2016-2017 Texas Instruments 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 version 2. * * This program is distributed "as is" WITHOUT ANY WARRANTY of any * kind, whether express or implied; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/ti-emif-sram.h> int main(void) { DEFINE(EMIF_SDCFG_VAL_OFFSET, offsetof(struct emif_regs_amx3, emif_sdcfg_val)); DEFINE(EMIF_TIMING1_VAL_OFFSET, offsetof(struct emif_regs_amx3, emif_timing1_val)); DEFINE(EMIF_TIMING2_VAL_OFFSET, offsetof(struct emif_regs_amx3, emif_timing2_val)); DEFINE(EMIF_TIMING3_VAL_OFFSET, offsetof(struct emif_regs_amx3, emif_timing3_val)); DEFINE(EMIF_REF_CTRL_VAL_OFFSET, offsetof(struct emif_regs_amx3, emif_ref_ctrl_val)); DEFINE(EMIF_ZQCFG_VAL_OFFSET, offsetof(struct emif_regs_amx3, emif_zqcfg_val)); DEFINE(EMIF_PMCR_VAL_OFFSET, offsetof(struct emif_regs_amx3, emif_pmcr_val)); DEFINE(EMIF_PMCR_SHDW_VAL_OFFSET, offsetof(struct emif_regs_amx3, emif_pmcr_shdw_val)); DEFINE(EMIF_RD_WR_LEVEL_RAMP_CTRL_OFFSET, offsetof(struct emif_regs_amx3, emif_rd_wr_level_ramp_ctrl)); DEFINE(EMIF_RD_WR_EXEC_THRESH_OFFSET, offsetof(struct emif_regs_amx3, emif_rd_wr_exec_thresh)); DEFINE(EMIF_COS_CONFIG_OFFSET, offsetof(struct emif_regs_amx3, emif_cos_config)); DEFINE(EMIF_PRIORITY_TO_COS_MAPPING_OFFSET, offsetof(struct emif_regs_amx3, emif_priority_to_cos_mapping)); DEFINE(EMIF_CONNECT_ID_SERV_1_MAP_OFFSET, offsetof(struct emif_regs_amx3, emif_connect_id_serv_1_map)); DEFINE(EMIF_CONNECT_ID_SERV_2_MAP_OFFSET, offsetof(struct emif_regs_amx3, emif_connect_id_serv_2_map)); DEFINE(EMIF_OCP_CONFIG_VAL_OFFSET, offsetof(struct emif_regs_amx3, emif_ocp_config_val)); DEFINE(EMIF_LPDDR2_NVM_TIM_OFFSET, offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim)); DEFINE(EMIF_LPDDR2_NVM_TIM_SHDW_OFFSET, offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim_shdw)); DEFINE(EMIF_DLL_CALIB_CTRL_VAL_OFFSET, offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val)); DEFINE(EMIF_DLL_CALIB_CTRL_VAL_SHDW_OFFSET, offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val_shdw)); DEFINE(EMIF_DDR_PHY_CTLR_1_OFFSET, offsetof(struct emif_regs_amx3, emif_ddr_phy_ctlr_1)); DEFINE(EMIF_EXT_PHY_CTRL_VALS_OFFSET, offsetof(struct emif_regs_amx3, emif_ext_phy_ctrl_vals)); DEFINE(EMIF_REGS_AMX3_SIZE, sizeof(struct emif_regs_amx3)); BLANK(); DEFINE(EMIF_PM_BASE_ADDR_VIRT_OFFSET, offsetof(struct ti_emif_pm_data, ti_emif_base_addr_virt)); DEFINE(EMIF_PM_BASE_ADDR_PHYS_OFFSET, offsetof(struct ti_emif_pm_data, ti_emif_base_addr_phys)); DEFINE(EMIF_PM_CONFIG_OFFSET, offsetof(struct ti_emif_pm_data, ti_emif_sram_config)); DEFINE(EMIF_PM_REGS_VIRT_OFFSET, offsetof(struct ti_emif_pm_data, regs_virt)); DEFINE(EMIF_PM_REGS_PHYS_OFFSET, offsetof(struct ti_emif_pm_data, regs_phys)); DEFINE(EMIF_PM_DATA_SIZE, sizeof(struct ti_emif_pm_data)); BLANK(); DEFINE(EMIF_PM_SAVE_CONTEXT_OFFSET, offsetof(struct ti_emif_pm_functions, save_context)); DEFINE(EMIF_PM_RESTORE_CONTEXT_OFFSET, offsetof(struct ti_emif_pm_functions, restore_context)); DEFINE(EMIF_PM_ENTER_SR_OFFSET, offsetof(struct ti_emif_pm_functions, enter_sr)); DEFINE(EMIF_PM_EXIT_SR_OFFSET, offsetof(struct ti_emif_pm_functions, exit_sr)); DEFINE(EMIF_PM_ABORT_SR_OFFSET, offsetof(struct ti_emif_pm_functions, abort_sr)); DEFINE(EMIF_PM_FUNCTIONS_SIZE, sizeof(struct ti_emif_pm_functions)); return 0; }
/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_VOICE_ENGINE_OUTPUT_MIXER_H_ #define WEBRTC_VOICE_ENGINE_OUTPUT_MIXER_H_ #include "audio_conference_mixer.h" #include "audio_conference_mixer_defines.h" #include "common_types.h" #include "dtmf_inband.h" #include "file_recorder.h" #include "level_indicator.h" #include "resampler.h" #include "voice_engine_defines.h" namespace webrtc { class AudioProcessing; class CriticalSectionWrapper; class FileWrapper; class VoEMediaProcess; namespace voe { class Statistics; class OutputMixer : public AudioMixerOutputReceiver, public AudioMixerStatusReceiver, public FileCallback { public: static WebRtc_Word32 Create(OutputMixer*& mixer, const WebRtc_UWord32 instanceId); static void Destroy(OutputMixer*& mixer); WebRtc_Word32 SetEngineInformation(Statistics& engineStatistics); WebRtc_Word32 SetAudioProcessingModule( AudioProcessing* audioProcessingModule); // VoEExternalMedia int RegisterExternalMediaProcessing( VoEMediaProcess& proccess_object); int DeRegisterExternalMediaProcessing(); // VoEDtmf int PlayDtmfTone(WebRtc_UWord8 eventCode, int lengthMs, int attenuationDb); int StartPlayingDtmfTone(WebRtc_UWord8 eventCode, int attenuationDb); int StopPlayingDtmfTone(); WebRtc_Word32 MixActiveChannels(); WebRtc_Word32 DoOperationsOnCombinedSignal(); WebRtc_Word32 SetMixabilityStatus(MixerParticipant& participant, const bool mixable); WebRtc_Word32 SetAnonymousMixabilityStatus(MixerParticipant& participant, const bool mixable); int GetMixedAudio(int sample_rate_hz, int num_channels, AudioFrame* audioFrame); // VoEVolumeControl int GetSpeechOutputLevel(WebRtc_UWord32& level); int GetSpeechOutputLevelFullRange(WebRtc_UWord32& level); int SetOutputVolumePan(float left, float right); int GetOutputVolumePan(float& left, float& right); // VoEFile int StartRecordingPlayout(const char* fileName, const CodecInst* codecInst); int StartRecordingPlayout(OutStream* stream, const CodecInst* codecInst); int StopRecordingPlayout(); virtual ~OutputMixer(); // from AudioMixerOutputReceiver virtual void NewMixedAudio( const WebRtc_Word32 id, const AudioFrame& generalAudioFrame, const AudioFrame** uniqueAudioFrames, const WebRtc_UWord32 size); // from AudioMixerStatusReceiver virtual void MixedParticipants( const WebRtc_Word32 id, const ParticipantStatistics* participantStatistics, const WebRtc_UWord32 size); virtual void VADPositiveParticipants( const WebRtc_Word32 id, const ParticipantStatistics* participantStatistics, const WebRtc_UWord32 size); virtual void MixedAudioLevel(const WebRtc_Word32 id, const WebRtc_UWord32 level); // For file recording void PlayNotification(const WebRtc_Word32 id, const WebRtc_UWord32 durationMs); void RecordNotification(const WebRtc_Word32 id, const WebRtc_UWord32 durationMs); void PlayFileEnded(const WebRtc_Word32 id); void RecordFileEnded(const WebRtc_Word32 id); private: OutputMixer(const WebRtc_UWord32 instanceId); void APMAnalyzeReverseStream(); int InsertInbandDtmfTone(); // uses Statistics* _engineStatisticsPtr; AudioProcessing* _audioProcessingModulePtr; // owns CriticalSectionWrapper& _callbackCritSect; // protect the _outputFileRecorderPtr and _outputFileRecording CriticalSectionWrapper& _fileCritSect; AudioConferenceMixer& _mixerModule; AudioFrame _audioFrame; Resampler _resampler; // converts mixed audio to fit ADM format Resampler _apmResampler; // converts mixed audio to fit APM rate AudioLevel _audioLevel; // measures audio level for the combined signal DtmfInband _dtmfGenerator; int _instanceId; VoEMediaProcess* _externalMediaCallbackPtr; bool _externalMedia; float _panLeft; float _panRight; int _mixingFrequencyHz; FileRecorder* _outputFileRecorderPtr; bool _outputFileRecording; }; } // namespace voe } // namespace werbtc #endif // VOICE_ENGINE_OUTPUT_MIXER_H_
//===-- CFGPrinter.h - CFG printer external interface -----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines external functions that can be called to explicitly // instantiate the CFG printer. // //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_CFGPRINTER_H #define LLVM_ANALYSIS_CFGPRINTER_H #include "llvm/IR/CFG.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/Instructions.h" #include "llvm/Support/GraphWriter.h" namespace llvm { template<> struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits { DOTGraphTraits (bool isSimple=false) : DefaultDOTGraphTraits(isSimple) {} static std::string getGraphName(const Function *F) { return "CFG for '" + F->getName().str() + "' function"; } static std::string getSimpleNodeLabel(const BasicBlock *Node, const Function *) { if (!Node->getName().empty()) return Node->getName().str(); std::string Str; raw_string_ostream OS(Str); Node->printAsOperand(OS, false); return OS.str(); } static std::string getCompleteNodeLabel(const BasicBlock *Node, const Function *) { enum { MaxColumns = 80 }; std::string Str; raw_string_ostream OS(Str); if (Node->getName().empty()) { Node->printAsOperand(OS, false); OS << ":"; } OS << *Node; std::string OutStr = OS.str(); if (OutStr[0] == '\n') OutStr.erase(OutStr.begin()); // Process string output to make it nicer... unsigned ColNum = 0; unsigned LastSpace = 0; for (unsigned i = 0; i != OutStr.length(); ++i) { if (OutStr[i] == '\n') { // Left justify OutStr[i] = '\\'; OutStr.insert(OutStr.begin()+i+1, 'l'); ColNum = 0; LastSpace = 0; } else if (OutStr[i] == ';') { // Delete comments! unsigned Idx = OutStr.find('\n', i+1); // Find end of line OutStr.erase(OutStr.begin()+i, OutStr.begin()+Idx); --i; } else if (ColNum == MaxColumns) { // Wrap lines. if (LastSpace) { OutStr.insert(LastSpace, "\\l..."); ColNum = i - LastSpace; LastSpace = 0; i += 3; // The loop will advance 'i' again. } // Else keep trying to find a space. } else ++ColNum; if (OutStr[i] == ' ') LastSpace = i; } return OutStr; } std::string getNodeLabel(const BasicBlock *Node, const Function *Graph) { if (isSimple()) return getSimpleNodeLabel(Node, Graph); else return getCompleteNodeLabel(Node, Graph); } static std::string getEdgeSourceLabel(const BasicBlock *Node, succ_const_iterator I) { // Label source of conditional branches with "T" or "F" if (const BranchInst *BI = dyn_cast<BranchInst>(Node->getTerminator())) if (BI->isConditional()) return (I == succ_begin(Node)) ? "T" : "F"; // Label source of switch edges with the associated value. if (const SwitchInst *SI = dyn_cast<SwitchInst>(Node->getTerminator())) { unsigned SuccNo = I.getSuccessorIndex(); if (SuccNo == 0) return "def"; std::string Str; raw_string_ostream OS(Str); SwitchInst::ConstCaseIt Case = SwitchInst::ConstCaseIt::fromSuccessorIndex(SI, SuccNo); OS << Case.getCaseValue()->getValue(); return OS.str(); } return ""; } }; } // End llvm namespace namespace llvm { class FunctionPass; FunctionPass *createCFGPrinterPass (); FunctionPass *createCFGOnlyPrinterPass (); } // End llvm namespace #endif
/* ---------------------------------------------------------------------- * Copyright (C) 2010-2014 ARM Limited. All rights reserved. * * $Date: 19. March 2015 * $Revision: V.1.4.5 * * Project: CMSIS DSP Library * Title: arm_cmplx_mag_squared_q15.c * * Description: Q15 complex magnitude squared. * * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 * * 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 ARM LIMITED nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ---------------------------------------------------------------------------- */ #include "arm_math.h" /** * @ingroup groupCmplxMath */ /** * @addtogroup cmplx_mag_squared * @{ */ /** * @brief Q15 complex magnitude squared * @param *pSrc points to the complex input vector * @param *pDst points to the real output vector * @param numSamples number of complex samples in the input vector * @return none. * * <b>Scaling and Overflow Behavior:</b> * \par * The function implements 1.15 by 1.15 multiplications and finally output is converted into 3.13 format. */ void arm_cmplx_mag_squared_q15( q15_t * pSrc, q15_t * pDst, uint32_t numSamples) { q31_t acc0, acc1; /* Accumulators */ #ifndef ARM_MATH_CM0_FAMILY /* Run the below code for Cortex-M4 and Cortex-M3 */ uint32_t blkCnt; /* loop counter */ q31_t in1, in2, in3, in4; q31_t acc2, acc3; /*loop Unrolling */ blkCnt = numSamples >> 2u; /* First part of the processing with loop unrolling. Compute 4 outputs at a time. ** a second loop below computes the remaining 1 to 3 samples. */ while(blkCnt > 0u) { /* C[0] = (A[0] * A[0] + A[1] * A[1]) */ in1 = *__SIMD32(pSrc)++; in2 = *__SIMD32(pSrc)++; in3 = *__SIMD32(pSrc)++; in4 = *__SIMD32(pSrc)++; acc0 = __SMUAD(in1, in1); acc1 = __SMUAD(in2, in2); acc2 = __SMUAD(in3, in3); acc3 = __SMUAD(in4, in4); /* store the result in 3.13 format in the destination buffer. */ *pDst++ = (q15_t) (acc0 >> 17); *pDst++ = (q15_t) (acc1 >> 17); *pDst++ = (q15_t) (acc2 >> 17); *pDst++ = (q15_t) (acc3 >> 17); /* Decrement the loop counter */ blkCnt--; } /* If the numSamples is not a multiple of 4, compute any remaining output samples here. ** No loop unrolling is used. */ blkCnt = numSamples % 0x4u; while(blkCnt > 0u) { /* C[0] = (A[0] * A[0] + A[1] * A[1]) */ in1 = *__SIMD32(pSrc)++; acc0 = __SMUAD(in1, in1); /* store the result in 3.13 format in the destination buffer. */ *pDst++ = (q15_t) (acc0 >> 17); /* Decrement the loop counter */ blkCnt--; } #else /* Run the below code for Cortex-M0 */ q15_t real, imag; /* Temporary variables to store real and imaginary values */ while(numSamples > 0u) { /* out = ((real * real) + (imag * imag)) */ real = *pSrc++; imag = *pSrc++; acc0 = (real * real); acc1 = (imag * imag); /* store the result in 3.13 format in the destination buffer. */ *pDst++ = (q15_t) (((q63_t) acc0 + acc1) >> 17); /* Decrement the loop counter */ numSamples--; } #endif /* #ifndef ARM_MATH_CM0_FAMILY */ } /** * @} end of cmplx_mag_squared group */
/* s_nextafterl.c -- long double version of s_nextafter.c. * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. */ /* * ==================================================== * 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. * ==================================================== */ #if defined(LIBM_SCCS) && !defined(lint) static char rcsid[] = "$NetBSD: $"; #endif /* IEEE functions * nextafterl(x,y) * return the next machine floating-point number of x in the * direction toward y. * Special cases: */ #include "math.h" #include <math_private.h> #ifdef __STDC__ long double __nextafterl(long double x, long double y) #else long double __nextafterl(x,y) long double x,y; #endif { int64_t hx,hy,ix,iy; u_int64_t lx,ly; GET_LDOUBLE_WORDS64(hx,lx,x); GET_LDOUBLE_WORDS64(hy,ly,y); ix = hx&0x7fffffffffffffffLL; /* |x| */ iy = hy&0x7fffffffffffffffLL; /* |y| */ if(((ix>=0x7fff000000000000LL)&&((ix-0x7fff000000000000LL)|lx)!=0) || /* x is nan */ ((iy>=0x7fff000000000000LL)&&((iy-0x7fff000000000000LL)|ly)!=0)) /* y is nan */ return x+y; if(x==y) return y; /* x=y, return y */ if((ix|lx)==0) { /* x == 0 */ long double u; SET_LDOUBLE_WORDS64(x,hy&0x8000000000000000ULL,1);/* return +-minsubnormal */ u = math_opt_barrier (x); u = u * u; math_force_eval (u); /* raise underflow flag */ return x; } if(hx>=0) { /* x > 0 */ if(hx>hy||((hx==hy)&&(lx>ly))) { /* x > y, x -= ulp */ if(lx==0) hx--; lx--; } else { /* x < y, x += ulp */ lx++; if(lx==0) hx++; } } else { /* x < 0 */ if(hy>=0||hx>hy||((hx==hy)&&(lx>ly))){/* x < y, x -= ulp */ if(lx==0) hx--; lx--; } else { /* x > y, x += ulp */ lx++; if(lx==0) hx++; } } hy = hx&0x7fff000000000000LL; if(hy==0x7fff000000000000LL) return x+x;/* overflow */ if(hy==0) { long double u = x*x; /* underflow */ math_force_eval (u); /* raise underflow flag */ } SET_LDOUBLE_WORDS64(x,hx,lx); return x; } weak_alias (__nextafterl, nextafterl) strong_alias (__nextafterl, __nexttowardl) weak_alias (__nextafterl, nexttowardl)
/* Get priority ceiling setting from pthread_mutexattr_t. Copyright (C) 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <pthreadP.h> int pthread_mutexattr_getprioceiling (attr, prioceiling) const pthread_mutexattr_t *attr; int *prioceiling; { const struct pthread_mutexattr *iattr; int ceiling; iattr = (const struct pthread_mutexattr *) attr; ceiling = ((iattr->mutexkind & PTHREAD_MUTEXATTR_PRIO_CEILING_MASK) >> PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT); if (! ceiling) { if (__sched_fifo_min_prio == -1) __init_sched_fifo_prio (); if (ceiling < __sched_fifo_min_prio) ceiling = __sched_fifo_min_prio; } *prioceiling = ceiling; return 0; }
/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ralf Baechle <ralf@gnu.org>, 1998. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <errno.h> #include <unistd.h> #include <endian.h> #include <sysdep-cancel.h> #include <sys/syscall.h> #include <bp-checks.h> #include <kernel-features.h> #ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ # ifdef __NR_pwrite # error "__NR_pwrite and __NR_pwrite64 both defined???" # endif # define __NR_pwrite __NR_pwrite64 #endif #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 # if __ASSUME_PWRITE_SYSCALL == 0 static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) internal_function; # endif ssize_t __libc_pwrite64 (fd, buf, count, offset) int fd; const void *buf; size_t count; off64_t offset; { ssize_t result; if (SINGLE_THREAD_P) { /* First try the syscall. */ result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff))); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ result = __emulate_pwrite64 (fd, buf, count, offset); # endif return result; } int oldtype = LIBC_CANCEL_ASYNC (); /* First try the syscall. */ result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff))); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ result = __emulate_pwrite64 (fd, buf, count, offset); # endif LIBC_CANCEL_RESET (oldtype); return result; } weak_alias (__libc_pwrite64, __pwrite64) libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64) # define __libc_pwrite64(fd, buf, count, offset) \ static internal_function __emulate_pwrite64 (fd, buf, count, offset) #endif #if __ASSUME_PWRITE_SYSCALL == 0 # include <sysdeps/posix/pwrite64.c> #endif
/* Locations for Bison Copyright (C) 2002, 2005 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. Bison 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. Bison 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 Bison; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <config.h> #include "system.h" #include <quotearg.h> #include "location.h" location const empty_location; /* Output to OUT the location LOC. Warning: it uses quotearg's slot 3. */ void location_print (FILE *out, location loc) { fprintf (out, "%s:%d.%d", quotearg_n_style (3, escape_quoting_style, loc.start.file), loc.start.line, loc.start.column); if (loc.start.file != loc.end.file) fprintf (out, "-%s:%d.%d", quotearg_n_style (3, escape_quoting_style, loc.end.file), loc.end.line, loc.end.column - 1); else if (loc.start.line < loc.end.line) fprintf (out, "-%d.%d", loc.end.line, loc.end.column - 1); else if (loc.start.column < loc.end.column - 1) fprintf (out, "-%d", loc.end.column - 1); }
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the qmake spec of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H #include "../common/aix/qplatformdefs.h" #endif // QPLATFORMDEFS_H
/****************************************************** The database buffer pool global types for the directory (c) 1995 Innobase Oy Created 11/17/1995 Heikki Tuuri *******************************************************/ #ifndef buf0types_h #define buf0types_h typedef struct buf_block_struct buf_block_t; typedef struct buf_pool_struct buf_pool_t; /* The 'type' used of a buffer frame */ typedef byte buf_frame_t; #endif
/* =========================================================================== Doom 3 BFG Edition GPL Source Code Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). Doom 3 BFG Edition Source Code 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. Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ #ifndef __SLIDERWINDOW_H__ #define __SLIDERWINDOW_H__ class idUserInterfaceLocal; class idSliderWindow : public idWindow { public: idSliderWindow(idUserInterfaceLocal *gui); virtual ~idSliderWindow(); void InitWithDefaults(const char *_name, const idRectangle &rect, const idVec4 &foreColor, const idVec4 &matColor, const char *_background, const char *thumbShader, bool _vertical, bool _scrollbar); void SetRange(float _low, float _high, float _step); float GetLow() { return low; } float GetHigh() { return high; } void SetValue(float _value); float GetValue() { return value; }; virtual size_t Allocated(){return idWindow::Allocated();}; virtual idWinVar * GetWinVarByName(const char *_name, bool winLookup = false, drawWin_t** owner = NULL); virtual const char *HandleEvent(const sysEvent_t *event, bool *updateVisuals); virtual void PostParse(); virtual void Draw(int time, float x, float y); virtual void DrawBackground(const idRectangle &drawRect); virtual const char *RouteMouseCoords(float xd, float yd); virtual void Activate(bool activate, idStr &act); virtual void SetBuddy(idWindow *buddy); void RunNamedEvent( const char* eventName ); private: virtual bool ParseInternalVar(const char *name, idTokenParser *src); void CommonInit(); void InitCvar(); // true: read the updated cvar from cvar system // false: write to the cvar system // force == true overrides liveUpdate 0 void UpdateCvar( bool read, bool force = false ); idWinFloat value; float low; float high; float thumbWidth; float thumbHeight; float stepSize; float lastValue; idRectangle thumbRect; const idMaterial * thumbMat; bool vertical; bool verticalFlip; bool scrollbar; idWindow * buddyWin; idStr thumbShader; idWinStr cvarStr; idCVar * cvar; bool cvar_init; idWinBool liveUpdate; idWinStr cvarGroup; }; #endif /* !__SLIDERWINDOW_H__ */
/* Copyright 2019 The TensorFlow Authors. Al 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_COMMON_RUNTIME_INPUT_COLOCATION_EXEMPTION_REGISTRY_H_ #define TENSORFLOW_CORE_COMMON_RUNTIME_INPUT_COLOCATION_EXEMPTION_REGISTRY_H_ #include <string> #include "tensorflow/core/lib/gtl/flatset.h" #include "tensorflow/core/platform/types.h" namespace tensorflow { // TensorFlow runtime (both eager and graph) will aim to colocate ops with // their resource inputs so that the ops can access the resource state. In some // cases, such as tf.data ops, this is not desirable as the ops themselves might // not have a kernel registered for the device on which the resource is placed // and instead use a mechanism, such as a multi-device function, to access the // resource state. // // This registry can be used to register and list ops that should be exempt from // the input colocation described above. // // Example usage: // REGISTER_INPUT_COLOCATION_EXEMPTION("MapDataset"); class InputColocationExemptionRegistry { public: // Returns a pointer to a global InputColocationExemptionRegistry object. static InputColocationExemptionRegistry* Global(); // Returns the set of ops exempt from the input colocation constraints. const gtl::FlatSet<string>& Get() { return ops_; } // Registers an op to be excluded from the input colocation constraints. void Register(const string& op); private: gtl::FlatSet<string> ops_; }; namespace input_colocation_exemption_registration { class InputColocationExemptionRegistration { public: explicit InputColocationExemptionRegistration(const string& op) { InputColocationExemptionRegistry::Global()->Register(op); } }; } // namespace input_colocation_exemption_registration #define REGISTER_INPUT_COLOCATION_EXEMPTION(op) \ REGISTER_INPUT_COLOCATION_EXEMPTION_UNIQ_HELPER(__COUNTER__, op) #define REGISTER_INPUT_COLOCATION_EXEMPTION_UNIQ_HELPER(ctr, op) \ REGISTER_INPUT_COLOCATION_EXEMPTION_UNIQ(ctr, op) #define REGISTER_INPUT_COLOCATION_EXEMPTION_UNIQ(ctr, op) \ static input_colocation_exemption_registration:: \ InputColocationExemptionRegistration \ input_colocation_exemption_registration_fn_##ctr(op) } // namespace tensorflow #endif // TENSORFLOW_CORE_COMMON_RUNTIME_INPUT_COLOCATION_EXEMPTION_REGISTRY_H_
/* * geotiffio.h * * Standard include file for geotiff, including all * key and code definitions. * * copyright (c) 1995 Niles D. Ritter * * Permission granted to use this software, so long as this copyright * notice accompanies any products derived therefrom. */ #ifndef __geotiffio_h #define __geotiffio_h #include "geotiff.h" /* public key interface */ #include "geovalues.h" /* key code definitions */ #endif /* __geotiffio_h */
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef BT_SOFT_RIGID_DYNAMICS_WORLD_H #define BT_SOFT_RIGID_DYNAMICS_WORLD_H #include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h" #include "btSoftBody.h" typedef btAlignedObjectArray<btSoftBody*> btSoftBodyArray; class btSoftBodySolver; class btSoftRigidDynamicsWorld : public btDiscreteDynamicsWorld { btSoftBodyArray m_softBodies; int m_drawFlags; bool m_drawNodeTree; bool m_drawFaceTree; bool m_drawClusterTree; btSoftBodyWorldInfo m_sbi; ///Solver classes that encapsulate multiple soft bodies for solving btSoftBodySolver *m_softBodySolver; bool m_ownsSolver; protected: virtual void predictUnconstraintMotion(btScalar timeStep); virtual void internalSingleStepSimulation( btScalar timeStep); void solveSoftBodiesConstraints( btScalar timeStep ); void serializeSoftBodies(btSerializer* serializer); public: btSoftRigidDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration, btSoftBodySolver *softBodySolver = 0 ); virtual ~btSoftRigidDynamicsWorld(); virtual void debugDrawWorld(); void addSoftBody(btSoftBody* body,short int collisionFilterGroup=btBroadphaseProxy::DefaultFilter,short int collisionFilterMask=btBroadphaseProxy::AllFilter); void removeSoftBody(btSoftBody* body); ///removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btDiscreteDynamicsWorld::removeCollisionObject virtual void removeCollisionObject(btCollisionObject* collisionObject); int getDrawFlags() const { return(m_drawFlags); } void setDrawFlags(int f) { m_drawFlags=f; } btSoftBodyWorldInfo& getWorldInfo() { return m_sbi; } const btSoftBodyWorldInfo& getWorldInfo() const { return m_sbi; } virtual btDynamicsWorldType getWorldType() const { return BT_SOFT_RIGID_DYNAMICS_WORLD; } btSoftBodyArray& getSoftBodyArray() { return m_softBodies; } const btSoftBodyArray& getSoftBodyArray() const { return m_softBodies; } virtual void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const; /// rayTestSingle performs a raycast call and calls the resultCallback. It is used internally by rayTest. /// In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape. /// This allows more customization. static void rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans, btCollisionObject* collisionObject, const btCollisionShape* collisionShape, const btTransform& colObjWorldTransform, RayResultCallback& resultCallback); virtual void serialize(btSerializer* serializer); }; #endif //BT_SOFT_RIGID_DYNAMICS_WORLD_H
/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 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 */ /* Static variables for MARIA library. All definied here for easy making of a shared library */ #ifndef MY_GLOBAL_INCLUDED #include "maria_def.h" #include "trnman.h" #endif LIST *maria_open_list=0; uchar maria_file_magic[]= { (uchar) 254, (uchar) 254, (uchar) 9, '\003', }; uchar maria_pack_file_magic[]= { (uchar) 254, (uchar) 254, (uchar) 10, '\001', }; /* Unique number for this maria instance */ uchar maria_uuid[MY_UUID_SIZE]; uint maria_quick_table_bits=9; ulong maria_block_size= MARIA_KEY_BLOCK_LENGTH; my_bool maria_flush= 0, maria_single_user= 0; my_bool maria_delay_key_write= 0, maria_page_checksums= 1; my_bool maria_inited= FALSE; my_bool maria_in_ha_maria= FALSE; /* If used from ha_maria or not */ my_bool maria_recovery_changed_data= 0, maria_recovery_verbose= 0; my_bool maria_assert_if_crashed_table= 0; my_bool maria_checkpoint_disabled= 0; my_bool maria_encrypt_tables= 0; mysql_mutex_t THR_LOCK_maria; #ifdef DONT_USE_RW_LOCKS ulong maria_concurrent_insert= 0; #else /* Do concurrent inserts at file end or in old holes */ ulong maria_concurrent_insert= 2; #endif my_off_t maria_max_temp_length= MAX_FILE_SIZE; ulong maria_bulk_insert_tree_size=8192*1024; ulong maria_data_pointer_size= 6; PAGECACHE maria_pagecache_var; PAGECACHE *maria_pagecache= &maria_pagecache_var; PAGECACHE maria_log_pagecache_var; PAGECACHE *maria_log_pagecache= &maria_log_pagecache_var; MY_TMPDIR *maria_tmpdir; /* Tempdir for redo */ char *maria_data_root; HASH maria_stored_state; int (*maria_create_trn_hook)(MARIA_HA *); /** @brief when transactionality does not matter we can use this transaction Used in external programs like ma_test*, and also internally inside libmaria when there is no transaction around and the operation isn't transactional (CREATE/DROP/RENAME/OPTIMIZE/REPAIR). */ TRN dummy_transaction_object; /* a WT_RESOURCE_TYPE for transactions waiting on a unique key conflict */ WT_RESOURCE_TYPE ma_rc_dup_unique={ wt_resource_id_memcmp, 0}; /* Enough for comparing if number is zero */ uchar maria_zero_string[]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* read_vec[] is used for converting between P_READ_KEY.. and SEARCH_ Position is , == , >= , <= , > , < */ uint32 maria_read_vec[]= { SEARCH_FIND, /* HA_READ_KEY_EXACT */ SEARCH_FIND | SEARCH_BIGGER, /* HA_READ_KEY_OR_NEXT */ SEARCH_FIND | SEARCH_SMALLER, /* HA_READ_KEY_OR_PREV */ SEARCH_NO_FIND | SEARCH_BIGGER, /* HA_READ_AFTER_KEY */ SEARCH_NO_FIND | SEARCH_SMALLER, /* HA_READ_BEFORE_KEY */ SEARCH_FIND | SEARCH_PART_KEY, /* HA_READ_PREFIX */ SEARCH_LAST, /* HA_READ_PREFIX_LAST */ SEARCH_LAST | SEARCH_SMALLER, /* HA_READ_PREFIX_LAST_OR_PREV */ MBR_CONTAIN, /* HA_READ_MBR_CONTAIN */ MBR_INTERSECT, /* HA_READ_MBR_INTERSECT */ MBR_WITHIN, /* HA_READ_MBR_WITHIN */ MBR_DISJOINT, /* HA_READ_MBR_DISJOINT */ MBR_EQUAL /* HA_READ_MBR_EQUAL */ }; uint32 maria_readnext_vec[]= { SEARCH_BIGGER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_SMALLER }; static int always_valid(const char *filename __attribute__((unused))) { return 0; } int (*maria_test_invalid_symlink)(const char *filename)= always_valid; my_bool (*ma_killed)(MARIA_HA *)= ma_killed_standalone; #ifdef HAVE_PSI_INTERFACE PSI_mutex_key key_SHARE_BITMAP_lock, key_SORT_INFO_mutex, key_THR_LOCK_maria, key_TRANSLOG_BUFFER_mutex, key_LOCK_soft_sync, key_TRANSLOG_DESCRIPTOR_dirty_buffer_mask_lock, key_TRANSLOG_DESCRIPTOR_sent_to_disk_lock, key_TRANSLOG_DESCRIPTOR_log_flush_lock, key_TRANSLOG_DESCRIPTOR_file_header_lock, key_TRANSLOG_DESCRIPTOR_unfinished_files_lock, key_TRANSLOG_DESCRIPTOR_purger_lock, key_SHARE_intern_lock, key_SHARE_key_del_lock, key_SHARE_close_lock, key_PAGECACHE_cache_lock, key_SERVICE_THREAD_CONTROL_lock, key_LOCK_trn_list, key_TRN_state_lock; PSI_cond_key key_SHARE_key_del_cond, key_SERVICE_THREAD_CONTROL_cond, key_SORT_INFO_cond, key_SHARE_BITMAP_cond, key_COND_soft_sync, key_TRANSLOG_BUFFER_waiting_filling_buffer, key_TRANSLOG_BUFFER_prev_sent_to_disk_cond, key_TRANSLOG_DESCRIPTOR_log_flush_cond, key_TRANSLOG_DESCRIPTOR_new_goal_cond; PSI_rwlock_key key_KEYINFO_root_lock, key_SHARE_mmap_lock, key_TRANSLOG_DESCRIPTOR_open_files_lock; PSI_thread_key key_thread_checkpoint, key_thread_find_all_keys, key_thread_soft_sync; PSI_file_key key_file_translog, key_file_kfile, key_file_dfile, key_file_control, key_file_tmp; #endif /* HAVE_PSI_INTERFACE */ /* Note that PSI_stage_info globals must always be declared. */ PSI_stage_info stage_waiting_for_a_resource= { 0, "Waiting for a resource", 0};
/* Disable floating-point exceptions. Copyright (C) 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 1999. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <fenv.h> int fedisableexcept (int excepts) { /* Signal failure. */ return -1; } stub_warning (fedisableexcept) #include <stub-tag.h>
/*************************************************************************** * Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2009 * * * * This file is part of the FreeCAD CAx development system. * * * * 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., 59 Temple Place, * * Suite 330, Boston, MA 02111-1307, USA * * * ***************************************************************************/ #ifndef _ProjectionAlgos_h_ #define _ProjectionAlgos_h_ #include <TopoDS_Shape.hxx> #include <Base/Vector3D.h> #include <string> class BRepAdaptor_Curve; namespace Drawing { /** Algo class for projecting shapes and creating SVG output of it */ class DrawingExport ProjectionAlgos { public: /// Constructor ProjectionAlgos(const TopoDS_Shape &Input,const Base::Vector3d &Dir); virtual ~ProjectionAlgos(); void execute(void); enum ExtractionType { Plain = 0, WithHidden = 1, WithSmooth = 2 }; typedef std::map<std::string,std::string> XmlAttributes; std::string getSVG(ExtractionType type, double tolerance=0.05, XmlAttributes V_style=XmlAttributes(), XmlAttributes V0_style=XmlAttributes(), XmlAttributes V1_style=XmlAttributes(), XmlAttributes H_style=XmlAttributes(), XmlAttributes H0_style=XmlAttributes(), XmlAttributes H1_style=XmlAttributes()); std::string getDXF(ExtractionType type, double scale, double tolerance);//added by Dan Falck 2011/09/25 const TopoDS_Shape &Input; const Base::Vector3d &Direction; TopoDS_Shape V ;// hard edge visibly TopoDS_Shape V1;// Smoth edges visibly TopoDS_Shape VN;// contour edges visibly TopoDS_Shape VO;// contours apparents visibly TopoDS_Shape VI;// isoparamtriques visibly TopoDS_Shape H ;// hard edge invisibly TopoDS_Shape H1;// Smoth edges invisibly TopoDS_Shape HN;// contour edges invisibly TopoDS_Shape HO;// contours apparents invisibly TopoDS_Shape HI;// isoparamtriques invisibly }; } //namespace Drawing #endif
//===--- Ownership.h - Swift ASTs for Ownership ---------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// // // This file defines common structures for working with the different kinds of // reference ownership supported by Swift, such as 'weak' and 'unowned', as well // as the different kinds of value ownership, such as 'inout' and '__shared'. // //===----------------------------------------------------------------------===// #ifndef SWIFT_OWNERSHIP_H #define SWIFT_OWNERSHIP_H #include "swift/Basic/InlineBitfield.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" #include <stdint.h> #include <assert.h> namespace swift { /// Different kinds of reference ownership supported by Swift. // This enum is used in diagnostics. If you add a case here, the diagnostics // must be updated as well. enum class ReferenceOwnership : uint8_t { /// a strong reference (the default semantics) Strong, #define REF_STORAGE(Name, ...) Name, #define REF_STORAGE_RANGE(First, Last) Last_Kind = Last #include "swift/AST/ReferenceStorage.def" }; enum : unsigned { NumReferenceOwnershipBits = countBitsUsed(static_cast<unsigned>(ReferenceOwnership::Last_Kind)) }; static inline llvm::StringRef keywordOf(ReferenceOwnership ownership) { switch (ownership) { case ReferenceOwnership::Strong: break; case ReferenceOwnership::Weak: return "weak"; case ReferenceOwnership::Unowned: return "unowned"; case ReferenceOwnership::Unmanaged: return "unowned(unsafe)"; } // We cannot use llvm_unreachable() because this is used by the stdlib. assert(false && "impossible"); LLVM_BUILTIN_UNREACHABLE; } static inline llvm::StringRef manglingOf(ReferenceOwnership ownership) { switch (ownership) { case ReferenceOwnership::Strong: break; case ReferenceOwnership::Weak: return "Xw"; case ReferenceOwnership::Unowned: return "Xo"; case ReferenceOwnership::Unmanaged: return "Xu"; } // We cannot use llvm_unreachable() because this is used by the stdlib. assert(false && "impossible"); LLVM_BUILTIN_UNREACHABLE; } static inline bool isLessStrongThan(ReferenceOwnership left, ReferenceOwnership right) { auto strengthOf = [] (ReferenceOwnership ownership) -> int { // A reference can be optimized away if outlived by a stronger reference. // NOTES: // 1) Different reference kinds of the same strength are NOT interchangable. // 2) Stronger than "strong" might include locking, for example. // 3) Unchecked references must be last to preserve identity comparisons // until the last checked reference is dead. // 4) Please keep the switch statement ordered to ease code review. switch (ownership) { case ReferenceOwnership::Strong: return 0; case ReferenceOwnership::Unowned: return -1; case ReferenceOwnership::Weak: return -1; #define UNCHECKED_REF_STORAGE(Name, ...) \ case ReferenceOwnership::Name: return INT_MIN; #include "swift/AST/ReferenceStorage.def" } llvm_unreachable("impossible"); }; return strengthOf(left) < strengthOf(right); } enum class ReferenceOwnershipOptionality : uint8_t { Disallowed, Allowed, Required, Last_Kind = Required }; enum : unsigned { NumOptionalityBits = countBitsUsed(static_cast<unsigned>( ReferenceOwnershipOptionality::Last_Kind)) }; static inline ReferenceOwnershipOptionality optionalityOf(ReferenceOwnership ownership) { switch (ownership) { case ReferenceOwnership::Strong: case ReferenceOwnership::Unowned: case ReferenceOwnership::Unmanaged: return ReferenceOwnershipOptionality::Allowed; case ReferenceOwnership::Weak: return ReferenceOwnershipOptionality::Required; } llvm_unreachable("impossible"); } /// Diagnostic printing of \c StaticSpellingKind. llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, ReferenceOwnership RO); /// Different kinds of value ownership supported by Swift. enum class ValueOwnership : uint8_t { /// the context-dependent default ownership (sometimes shared, /// sometimes owned) Default, /// an 'inout' mutating pointer-like value InOut, /// a '__shared' non-mutating pointer-like value Shared, /// an '__owned' value Owned, Last_Kind = Owned }; enum : unsigned { NumValueOwnershipBits = countBitsUsed(static_cast<unsigned>(ValueOwnership::Last_Kind)) }; } // end namespace swift #endif
/* * Edimax BR-6104KP board support * * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation. * */ #include "br-61xx.h" static struct gpio_led br6104kp_gpio_leds[] __initdata = { GPIO_LED_STD(ADM5120_GPIO_PIN0, "power", NULL), GPIO_LED_INV(ADM5120_GPIO_PIN3, "usb1", NULL), GPIO_LED_INV(ADM5120_GPIO_PIN1, "usb2", NULL), GPIO_LED_INV(ADM5120_GPIO_P0L1, "wan_speed", NULL), GPIO_LED_INV(ADM5120_GPIO_P0L0, "wan_lnkact", NULL), GPIO_LED_INV(ADM5120_GPIO_P1L1, "lan1_speed", NULL), GPIO_LED_INV(ADM5120_GPIO_P1L0, "lan1_lnkact", NULL), GPIO_LED_INV(ADM5120_GPIO_P2L1, "lan2_speed", NULL), GPIO_LED_INV(ADM5120_GPIO_P2L0, "lan2_lnkact", NULL), GPIO_LED_INV(ADM5120_GPIO_P3L1, "lan3_speed", NULL), GPIO_LED_INV(ADM5120_GPIO_P3L0, "lan3_lnkact", NULL), GPIO_LED_INV(ADM5120_GPIO_P4L1, "lan4_speed", NULL), GPIO_LED_INV(ADM5120_GPIO_P4L0, "lan4_lnkact", NULL), }; static void __init br6104kp_setup(void) { br61xx_generic_setup(); adm5120_add_device_gpio_leds(ARRAY_SIZE(br6104kp_gpio_leds), br6104kp_gpio_leds); adm5120_add_device_usb(); } MIPS_MACHINE(MACH_ADM5120_BR6104KP, "Edimax BR-6104KP", br6104kp_setup);
#ifndef OPTIONSDIALOG_H #define OPTIONSDIALOG_H #include <QWidget> namespace Ui { class OptionsDialog; } class OptionsModel; class MonitoredDataMapper; class QValidatedLineEdit; /** Preferences dialog. */ class OptionsDialog : public QWidget { Q_OBJECT public: explicit OptionsDialog(QWidget *parent = 0); ~OptionsDialog(); void setModel(OptionsModel *model); void setMapper(); protected: bool eventFilter(QObject *object, QEvent *event); void keyPressEvent(QKeyEvent *); private slots: /* enable only apply button */ void enableApplyButton(); /* disable only apply button */ void disableApplyButton(); /* enable apply button and OK button */ void enableSaveButtons(); /* disable apply button and OK button */ void disableSaveButtons(); /* set apply button and OK button state (enabled / disabled) */ void setSaveButtonState(bool fState); void on_okButton_clicked(); void on_cancelButton_clicked(); void on_applyButton_clicked(); void showRestartWarning_Proxy(); void showRestartWarning_Tor(); void showRestartWarning_Lang(); void showRestartWarning_URL(); void updateDisplayUnit(); void handleProxyIpValid(QValidatedLineEdit *object, bool fState); void handleTorIpValid(QValidatedLineEdit *object, bool fState); signals: void proxyIpValid(QValidatedLineEdit *object, bool fValid); void torIpValid(QValidatedLineEdit *object, bool fValid); private: Ui::OptionsDialog *ui; OptionsModel *model; MonitoredDataMapper *mapper; bool fRestartWarningDisplayed_Proxy; bool fRestartWarningDisplayed_Tor; bool fRestartWarningDisplayed_Lang; bool fRestartWarningDisplayed_URL; bool fProxyIpValid; bool fTorIpValid; }; #endif // OPTIONSDIALOG_H
/* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef I_OPTION_CHANGED_LISTENER_INCLUDED #define I_OPTION_CHANGED_LISTENER_INCLUDED #include "i_option.h" #include <string> namespace Mysql{ namespace Tools{ namespace Base{ namespace Options{ /** Interface for listeners on some of option changes. */ class I_option_changed_listener { public: /** Called after specified option has name changed. It is also called when new option is added, old_name is empty string in that case. */ virtual void notify_option_name_changed( I_option* source, std::string old_name)= 0; /** Called after specified option has option ID changed. It is also called when new option is added, old_optid is 0 in that case. */ virtual void notify_option_optid_changed( I_option* source, uint32 old_optid)= 0; }; } } } } #endif
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // // Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. #pragma once // Xpress on Windows is implemeted using Win API #if defined(ROCKSDB_PLATFORM_POSIX) #error "Xpress compression not implemented" #elif defined(OS_WIN) #include "port/win/xpress_win.h" #endif
/* * Intel Merrifield legacy RTC initialization file * * (C) Copyright 2017 Intel Corporation * * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. */ #include <linux/init.h> #include <asm/hw_irq.h> #include <asm/intel-mid.h> #include <asm/io_apic.h> #include <asm/time.h> #include <asm/x86_init.h> static int __init mrfld_legacy_rtc_alloc_irq(void) { struct irq_alloc_info info; int ret; if (!x86_platform.legacy.rtc) return -ENODEV; ioapic_set_alloc_attr(&info, NUMA_NO_NODE, 1, 0); ret = mp_map_gsi_to_irq(RTC_IRQ, IOAPIC_MAP_ALLOC, &info); if (ret < 0) { pr_info("Failed to allocate RTC interrupt. Disabling RTC\n"); x86_platform.legacy.rtc = 0; return ret; } return 0; } static int __init mrfld_legacy_rtc_init(void) { if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER) return -ENODEV; return mrfld_legacy_rtc_alloc_irq(); } arch_initcall(mrfld_legacy_rtc_init);
/* * Copyright (C) 2008 Michael Brown <mbrown@fensystems.co.uk>. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ FILE_LICENCE ( GPL2_OR_LATER ); #include <assert.h> #include <gpxe/umalloc.h> #include <gpxe/efi/efi.h> /** @file * * gPXE user memory allocation API for EFI * */ /** Equivalent of NOWHERE for user pointers */ #define UNOWHERE ( ~UNULL ) /** * Reallocate external memory * * @v old_ptr Memory previously allocated by umalloc(), or UNULL * @v new_size Requested size * @ret new_ptr Allocated memory, or UNULL * * Calling realloc() with a new size of zero is a valid way to free a * memory block. */ static userptr_t efi_urealloc ( userptr_t old_ptr, size_t new_size ) { EFI_BOOT_SERVICES *bs = efi_systab->BootServices; EFI_PHYSICAL_ADDRESS phys_addr; unsigned int new_pages, old_pages; userptr_t new_ptr = UNOWHERE; size_t old_size; EFI_STATUS efirc; /* Allocate new memory if necessary. If allocation fails, * return without touching the old block. */ if ( new_size ) { new_pages = ( EFI_SIZE_TO_PAGES ( new_size ) + 1 ); if ( ( efirc = bs->AllocatePages ( AllocateAnyPages, EfiBootServicesData, new_pages, &phys_addr ) ) != 0 ) { DBG ( "EFI could not allocate %d pages: %s\n", new_pages, efi_strerror ( efirc ) ); return UNULL; } assert ( phys_addr != 0 ); new_ptr = phys_to_user ( phys_addr + EFI_PAGE_SIZE ); copy_to_user ( new_ptr, -EFI_PAGE_SIZE, &new_size, sizeof ( new_size ) ); DBG ( "EFI allocated %d pages at %llx\n", new_pages, phys_addr ); } /* Copy across relevant part of the old data region (if any), * then free it. Note that at this point either (a) new_ptr * is valid, or (b) new_size is 0; either way, the memcpy() is * valid. */ if ( old_ptr && ( old_ptr != UNOWHERE ) ) { copy_from_user ( &old_size, old_ptr, -EFI_PAGE_SIZE, sizeof ( old_size ) ); memcpy_user ( new_ptr, 0, old_ptr, 0, ( (old_size < new_size) ? old_size : new_size )); old_pages = ( EFI_SIZE_TO_PAGES ( old_size ) + 1 ); phys_addr = user_to_phys ( old_ptr, -EFI_PAGE_SIZE ); if ( ( efirc = bs->FreePages ( phys_addr, old_pages ) ) != 0 ){ DBG ( "EFI could not free %d pages at %llx: %s\n", old_pages, phys_addr, efi_strerror ( efirc ) ); /* Not fatal; we have leaked memory but successfully * allocated (if asked to do so). */ } DBG ( "EFI freed %d pages at %llx\n", old_pages, phys_addr ); } return new_ptr; } PROVIDE_UMALLOC ( efi, urealloc, efi_urealloc );
/** * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #import <Foundation/Foundation.h> /** Defines an outgoing reference from Objective-C object. */ @protocol FBObjectReference <NSObject> /** What is the index of that reference in ivar layout? index * sizeof(void *) gives you offset from the beginning of the object. */ - (NSUInteger)indexInIvarLayout; /** For given object we need to be able to grab that object reference. */ - (nullable id)objectReferenceFromObject:(nullable id)object; /** For given reference in an object, there can be a path of names that leads to it. For example it can be an ivar, thus the path will consist of ivar name only: @[@"_myIvar"] But it also can be a reference in some nested struct like: struct SomeStruct { NSObject *myObject; }; If that struct will be used in class, then name path would look like this: @[@"_myIvar", @"SomeStruct", @"myObject"] */ - (nullable NSArray<NSString *> *)namePath; @end
/*------------------------------------------------------------------------- * * parse_coerce.h * Routines for type coercion. * * * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_coerce.h * *------------------------------------------------------------------------- */ #ifndef PARSE_COERCE_H #define PARSE_COERCE_H #include "parser/parse_node.h" /* Type categories (see TYPCATEGORY_xxx symbols in catalog/pg_type.h) */ typedef char TYPCATEGORY; /* Result codes for find_coercion_pathway */ typedef enum CoercionPathType { COERCION_PATH_NONE, /* failed to find any coercion pathway */ COERCION_PATH_FUNC, /* apply the specified coercion function */ COERCION_PATH_RELABELTYPE, /* binary-compatible cast, no function */ COERCION_PATH_ARRAYCOERCE, /* need an ArrayCoerceExpr node */ COERCION_PATH_COERCEVIAIO /* need a CoerceViaIO node */ } CoercionPathType; extern bool IsBinaryCoercible(Oid srctype, Oid targettype); extern bool IsPreferredType(TYPCATEGORY category, Oid type); extern TYPCATEGORY TypeCategory(Oid type); extern Node *coerce_to_target_type(ParseState *pstate, Node *expr, Oid exprtype, Oid targettype, int32 targettypmod, CoercionContext ccontext, CoercionForm cformat, int location); extern bool can_coerce_type(int nargs, Oid *input_typeids, Oid *target_typeids, CoercionContext ccontext); extern Node *coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId, int32 targetTypeMod, CoercionContext ccontext, CoercionForm cformat, int location); extern Node *coerce_to_domain(Node *arg, Oid baseTypeId, int32 baseTypeMod, Oid typeId, CoercionForm cformat, int location, bool hideInputCoercion, bool lengthCoercionDone); extern Node *coerce_to_boolean(ParseState *pstate, Node *node, const char *constructName); extern Node *coerce_to_specific_type(ParseState *pstate, Node *node, Oid targetTypeId, const char *constructName); extern int parser_coercion_errposition(ParseState *pstate, int coerce_location, Node *input_expr); extern Oid select_common_type(ParseState *pstate, List *exprs, const char *context, Node **which_expr); extern Node *coerce_to_common_type(ParseState *pstate, Node *node, Oid targetTypeId, const char *context); extern bool check_generic_type_consistency(Oid *actual_arg_types, Oid *declared_arg_types, int nargs); extern Oid enforce_generic_type_consistency(Oid *actual_arg_types, Oid *declared_arg_types, int nargs, Oid rettype, bool allow_poly); extern Oid resolve_generic_type(Oid declared_type, Oid context_actual_type, Oid context_declared_type); extern CoercionPathType find_coercion_pathway(Oid targetTypeId, Oid sourceTypeId, CoercionContext ccontext, Oid *funcid); extern CoercionPathType find_typmod_coercion_function(Oid typeId, Oid *funcid); #endif /* PARSE_COERCE_H */
/* * Common header for the legacy SH DMA driver and the new dmaengine driver * * extracted from arch/sh/include/asm/dma-sh.h: * * Copyright (C) 2000 Takashi YOSHII * Copyright (C) 2003 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #ifndef DMA_REGISTER_H #define DMA_REGISTER_H #define SAR 0x00 #define DAR 0x04 #define TCR 0x08 #define CHCR 0x0C #define DMAOR 0x40 #define DMAOR_AE 0x00000004 #define DMAOR_NMIF 0x00000002 #define DMAOR_DME 0x00000001 #define REQ_L 0x00000000 #define REQ_E 0x00080000 #define RACK_H 0x00000000 #define RACK_L 0x00040000 #define ACK_R 0x00000000 #define ACK_W 0x00020000 #define ACK_H 0x00000000 #define ACK_L 0x00010000 #define DM_INC 0x00004000 #define DM_DEC 0x00008000 #define DM_FIX 0x0000c000 #define SM_INC 0x00001000 #define SM_DEC 0x00002000 #define SM_FIX 0x00003000 #define RS_IN 0x00000200 #define RS_OUT 0x00000300 #define TS_BLK 0x00000040 #define TM_BUR 0x00000020 #define CHCR_DE 0x00000001 #define CHCR_TE 0x00000002 #define CHCR_IE 0x00000004 #endif
/* apc - Driver implementation for power management functions * of Aurora Personality Chip (APC) on SPARCstation-4/5 and * derivatives. * * Copyright (c) 2002 Eric Brower (ebrower@usa.net) */ #include <linux/kernel.h> #include <linux/fs.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/miscdevice.h> #include <linux/pm.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/module.h> #include <asm/io.h> #include <asm/oplib.h> #include <asm/uaccess.h> #include <asm/auxio.h> #include <asm/apc.h> #define APC_MINOR MISC_DYNAMIC_MINOR #define APC_OBPNAME "power-management" #define APC_DEVNAME "apc" static u8 __iomem *regs; static int apc_no_idle __devinitdata = 0; #define apc_readb(offs) (sbus_readb(regs+offs)) #define apc_writeb(val, offs) (sbus_writeb(val, regs+offs)) static int __init apc_setup(char *str) { if(!strncmp(str, "noidle", strlen("noidle"))) { apc_no_idle = 1; return 1; } return 0; } __setup("apc=", apc_setup); static void apc_swift_idle(void) { #ifdef APC_DEBUG_LED set_auxio(0x00, AUXIO_LED); #endif apc_writeb(apc_readb(APC_IDLE_REG) | APC_IDLE_ON, APC_IDLE_REG); #ifdef APC_DEBUG_LED set_auxio(AUXIO_LED, 0x00); #endif } static inline void apc_free(struct platform_device *op) { of_iounmap(&op->resource[0], regs, resource_size(&op->resource[0])); } static int apc_open(struct inode *inode, struct file *f) { return 0; } static int apc_release(struct inode *inode, struct file *f) { return 0; } static long apc_ioctl(struct file *f, unsigned int cmd, unsigned long __arg) { __u8 inarg, __user *arg = (__u8 __user *) __arg; switch (cmd) { case APCIOCGFANCTL: if (put_user(apc_readb(APC_FANCTL_REG) & APC_REGMASK, arg)) return -EFAULT; break; case APCIOCGCPWR: if (put_user(apc_readb(APC_CPOWER_REG) & APC_REGMASK, arg)) return -EFAULT; break; case APCIOCGBPORT: if (put_user(apc_readb(APC_BPORT_REG) & APC_BPMASK, arg)) return -EFAULT; break; case APCIOCSFANCTL: if (get_user(inarg, arg)) return -EFAULT; apc_writeb(inarg & APC_REGMASK, APC_FANCTL_REG); break; case APCIOCSCPWR: if (get_user(inarg, arg)) return -EFAULT; apc_writeb(inarg & APC_REGMASK, APC_CPOWER_REG); break; case APCIOCSBPORT: if (get_user(inarg, arg)) return -EFAULT; apc_writeb(inarg & APC_BPMASK, APC_BPORT_REG); break; default: return -EINVAL; } return 0; } static const struct file_operations apc_fops = { .unlocked_ioctl = apc_ioctl, .open = apc_open, .release = apc_release, .llseek = noop_llseek, }; static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops }; static int __devinit apc_probe(struct platform_device *op) { int err; regs = of_ioremap(&op->resource[0], 0, resource_size(&op->resource[0]), APC_OBPNAME); if (!regs) { printk(KERN_ERR "%s: unable to map registers\n", APC_DEVNAME); return -ENODEV; } err = misc_register(&apc_miscdev); if (err) { printk(KERN_ERR "%s: unable to register device\n", APC_DEVNAME); apc_free(op); return -ENODEV; } if (!apc_no_idle) pm_idle = apc_swift_idle; printk(KERN_INFO "%s: power management initialized%s\n", APC_DEVNAME, apc_no_idle ? " (CPU idle disabled)" : ""); return 0; } static struct of_device_id apc_match[] = { { .name = APC_OBPNAME, }, {}, }; MODULE_DEVICE_TABLE(of, apc_match); static struct platform_driver apc_driver = { .driver = { .name = "apc", .owner = THIS_MODULE, .of_match_table = apc_match, }, .probe = apc_probe, }; static int __init apc_init(void) { return platform_driver_register(&apc_driver); } __initcall(apc_init);
#define COMPILE_OFFSETS #include <linux/crypto.h> #include <linux/sched.h> #include <linux/stddef.h> #include <linux/hardirq.h> #include <linux/suspend.h> #include <linux/kbuild.h> #include <asm/processor.h> #include <asm/thread_info.h> #include <asm/sigframe.h> #include <asm/bootparam.h> #include <asm/suspend.h> #ifdef CONFIG_XEN #include <xen/interface/xen.h> #endif #ifdef CONFIG_X86_32 # include "asm-offsets_32.c" #else # include "asm-offsets_64.c" #endif void common(void) { BLANK(); OFFSET(TI_flags, thread_info, flags); OFFSET(TI_status, thread_info, status); OFFSET(TI_addr_limit, thread_info, addr_limit); OFFSET(TI_preempt_count, thread_info, preempt_count); BLANK(); OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); BLANK(); OFFSET(pbe_address, pbe, address); OFFSET(pbe_orig_address, pbe, orig_address); OFFSET(pbe_next, pbe, next); #ifdef CONFIG_PARAVIRT BLANK(); OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled); OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops); OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops); OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable); OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable); OFFSET(PV_CPU_iret, pv_cpu_ops, iret); OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit); OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0); OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2); #endif #ifdef CONFIG_XEN BLANK(); OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask); OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending); #endif BLANK(); OFFSET(BP_scratch, boot_params, scratch); OFFSET(BP_loadflags, boot_params, hdr.loadflags); OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch); OFFSET(BP_version, boot_params, hdr.version); OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment); OFFSET(BP_pref_address, boot_params, hdr.pref_address); OFFSET(BP_code32_start, boot_params, hdr.code32_start); }
#include "../wlags49_h2/wl_priv.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. */ #include <linux/types.h> #include <linux/uaccess.h> #include <linux/spinlock.h> #include <linux/kernel.h> #include <mach/qdsp6v2/apr.h> #include <mach/qdsp6v2/apr_tal.h> #include <mach/qdsp6v2/dsp_debug.h> static const char *lpass_subsys_name = "adsp"; struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn, uint32_t src_port, void *priv) { struct apr_client *client; int client_id = 0; int svc_idx = 0; int svc_id = 0; int dest_id = 0; int temp_port = 0; struct apr_svc *svc = NULL; int rc = 0; if (!dest || !svc_name || !svc_fn) return NULL; if (!strncmp(dest, "ADSP", 4)) dest_id = APR_DEST_QDSP6; else if (!strncmp(dest, "MODEM", 5)) { dest_id = APR_DEST_MODEM; } else { pr_err("APR: wrong destination\n"); goto done; } if ((dest_id == APR_DEST_QDSP6)) { if (apr_get_q6_state() != APR_SUBSYS_LOADED) { pr_err("%s: adsp not up\n", __func__); return NULL; } pr_debug("%s: adsp Up\n", __func__); } else if ((dest_id == APR_DEST_MODEM) && (apr_get_modem_state() == APR_SUBSYS_DOWN)) { pr_debug("%s: Wait for modem to bootup\n", __func__); rc = apr_wait_for_device_up(dest_id); if (rc == 0) { pr_err("%s: Modem is not Up\n", __func__); return NULL; } pr_debug("%s: modem Up\n", __func__); } if (apr_get_svc(svc_name, dest_id, &client_id, &svc_idx, &svc_id)) { pr_err("%s: apr_get_svc failed\n", __func__); goto done; } client = apr_get_client(dest_id, client_id); mutex_lock(&client->m_lock); if (!client->handle) { client->handle = apr_tal_open(client_id, dest_id, APR_DL_SMD, apr_cb_func, NULL); if (!client->handle) { svc = NULL; pr_err("APR: Unable to open handle\n"); mutex_unlock(&client->m_lock); goto done; } } mutex_unlock(&client->m_lock); svc = &client->svc[svc_idx]; mutex_lock(&svc->m_lock); client->id = client_id; if (svc->need_reset) { mutex_unlock(&svc->m_lock); pr_err("APR: Service needs reset\n"); goto done; } svc->priv = priv; svc->id = svc_id; svc->dest_id = dest_id; svc->client_id = client_id; if (src_port != 0xFFFFFFFF) { temp_port = ((src_port >> 8) * 8) + (src_port & 0xFF); pr_debug("port = %d t_port = %d\n", src_port, temp_port); if (temp_port >= APR_MAX_PORTS || temp_port < 0) { pr_err("APR: temp_port out of bounds\n"); mutex_unlock(&svc->m_lock); return NULL; } if (!svc->port_cnt && !svc->svc_cnt) client->svc_cnt++; svc->port_cnt++; svc->port_fn[temp_port] = svc_fn; svc->port_priv[temp_port] = priv; } else { if (!svc->fn) { if (!svc->port_cnt && !svc->svc_cnt) client->svc_cnt++; svc->fn = svc_fn; if (svc->port_cnt) svc->svc_cnt++; } } mutex_unlock(&svc->m_lock); done: return svc; } void apr_set_subsys_state(void) { apr_set_q6_state(APR_SUBSYS_DOWN); apr_set_modem_state(APR_SUBSYS_UP); } const char *apr_get_lpass_subsys_name(void) { return lpass_subsys_name; }
// // UIControl+YYAdd.h // YYCategories <https://github.com/ibireme/YYCategories> // // Created by ibireme on 13/4/5. // Copyright (c) 2015 ibireme. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN /** Provides extensions for `UIControl`. */ @interface UIControl (YYAdd) /** Removes all targets and actions for a particular event (or events) from an internal dispatch table. */ - (void)removeAllTargets; /** Adds or replaces a target and action for a particular event (or events) to an internal dispatch table. @param target The target object—that is, the object to which the action message is sent. If this is nil, the responder chain is searched for an object willing to respond to the action message. @param action A selector identifying an action message. It cannot be NULL. @param controlEvents A bitmask specifying the control events for which the action message is sent. */ - (void)setTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents; /** Adds a block for a particular event (or events) to an internal dispatch table. It will cause a strong reference to @a block. @param block The block which is invoked then the action message is sent (cannot be nil). The block is retained. @param controlEvents A bitmask specifying the control events for which the action message is sent. */ - (void)addBlockForControlEvents:(UIControlEvents)controlEvents block:(void (^)(id sender))block; /** Adds or replaces a block for a particular event (or events) to an internal dispatch table. It will cause a strong reference to @a block. @param block The block which is invoked then the action message is sent (cannot be nil). The block is retained. @param controlEvents A bitmask specifying the control events for which the action message is sent. */ - (void)setBlockForControlEvents:(UIControlEvents)controlEvents block:(void (^)(id sender))block; /** Removes all blocks for a particular event (or events) from an internal dispatch table. @param controlEvents A bitmask specifying the control events for which the action message is sent. */ - (void)removeAllBlocksForControlEvents:(UIControlEvents)controlEvents; @end NS_ASSUME_NONNULL_END
/* * Copyright (C) 2015 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/types.h> #include <linux/printk.h> #include <linux/trusty/trusty.h> #include <linux/trusty/smcall.h> static int get_mem_attr(struct page *page, pgprot_t pgprot) { #if defined(CONFIG_ARM64) uint64_t mair; uint attr_index = (pgprot_val(pgprot) & PTE_ATTRINDX_MASK) >> 2; asm ("mrs %0, mair_el1\n" : "=&r" (mair)); return (mair >> (attr_index * 8)) & 0xff; #elif defined(CONFIG_ARM_LPAE) uint32_t mair; uint attr_index = ((pgprot_val(pgprot) & L_PTE_MT_MASK) >> 2); if (attr_index >= 4) { attr_index -= 4; asm volatile("mrc p15, 0, %0, c10, c2, 1\n" : "=&r" (mair)); } else { asm volatile("mrc p15, 0, %0, c10, c2, 0\n" : "=&r" (mair)); } return (mair >> (attr_index * 8)) & 0xff; #elif defined(CONFIG_ARM) /* check memory type */ switch (pgprot_val(pgprot) & L_PTE_MT_MASK) { case L_PTE_MT_WRITEALLOC: /* Normal: write back write allocate */ return 0xFF; case L_PTE_MT_BUFFERABLE: /* Normal: non-cacheble */ return 0x44; case L_PTE_MT_WRITEBACK: /* Normal: writeback, read allocate */ return 0xEE; case L_PTE_MT_WRITETHROUGH: /* Normal: write through */ return 0xAA; case L_PTE_MT_UNCACHED: /* strongly ordered */ return 0x00; case L_PTE_MT_DEV_SHARED: case L_PTE_MT_DEV_NONSHARED: /* device */ return 0x04; default: return -EINVAL; } #else return 0; #endif } int trusty_encode_page_info(struct ns_mem_page_info *inf, struct page *page, pgprot_t pgprot) { int mem_attr; uint64_t pte; if (!inf || !page) return -EINVAL; /* get physical address */ pte = (uint64_t) page_to_phys(page); /* get memory attributes */ mem_attr = get_mem_attr(page, pgprot); if (mem_attr < 0) return mem_attr; /* add other attributes */ #if defined(CONFIG_ARM64) || defined(CONFIG_ARM_LPAE) pte |= pgprot_val(pgprot); #elif defined(CONFIG_ARM) if (pgprot_val(pgprot) & L_PTE_USER) pte |= (1 << 6); if (pgprot_val(pgprot) & L_PTE_RDONLY) pte |= (1 << 7); if (pgprot_val(pgprot) & L_PTE_SHARED) pte |= (3 << 8); /* inner sharable */ #endif inf->attr = (pte & 0x0000FFFFFFFFFFFFull) | ((uint64_t)mem_attr << 48); return 0; } int trusty_call32_mem_buf(struct device *dev, u32 smcnr, struct page *page, u32 size, pgprot_t pgprot) { int ret; struct ns_mem_page_info pg_inf; if (!dev || !page) return -EINVAL; ret = trusty_encode_page_info(&pg_inf, page, pgprot); if (ret) return ret; if (SMC_IS_FASTCALL(smcnr)) { return trusty_fast_call32(dev, smcnr, (u32)pg_inf.attr, (u32)(pg_inf.attr >> 32), size); } else { return trusty_std_call32(dev, smcnr, (u32)pg_inf.attr, (u32)(pg_inf.attr >> 32), size); } }
/* * SPDX-License-Identifier: MIT * * Copyright © 2019 Intel Corporation */ #include "i915_request.h" #include "intel_context.h" #include "intel_engine_heartbeat.h" #include "intel_engine_pm.h" #include "intel_engine.h" #include "intel_gt.h" #include "intel_reset.h" /* * While the engine is active, we send a periodic pulse along the engine * to check on its health and to flush any idle-barriers. If that request * is stuck, and we fail to preempt it, we declare the engine hung and * issue a reset -- in the hope that restores progress. */ static bool next_heartbeat(struct intel_engine_cs *engine) { long delay; delay = READ_ONCE(engine->props.heartbeat_interval_ms); if (!delay) return false; delay = msecs_to_jiffies_timeout(delay); if (delay >= HZ) delay = round_jiffies_up_relative(delay); mod_delayed_work(system_wq, &engine->heartbeat.work, delay); return true; } static void idle_pulse(struct intel_engine_cs *engine, struct i915_request *rq) { engine->wakeref_serial = READ_ONCE(engine->serial) + 1; i915_request_add_active_barriers(rq); } static void show_heartbeat(const struct i915_request *rq, struct intel_engine_cs *engine) { struct drm_printer p = drm_debug_printer("heartbeat"); intel_engine_dump(engine, &p, "%s heartbeat {prio:%d} not ticking\n", engine->name, rq->sched.attr.priority); } static void heartbeat(struct work_struct *wrk) { struct i915_sched_attr attr = { .priority = I915_USER_PRIORITY(I915_PRIORITY_MIN), }; struct intel_engine_cs *engine = container_of(wrk, typeof(*engine), heartbeat.work.work); struct intel_context *ce = engine->kernel_context; struct i915_request *rq; rq = engine->heartbeat.systole; if (rq && i915_request_completed(rq)) { i915_request_put(rq); engine->heartbeat.systole = NULL; } if (!intel_engine_pm_get_if_awake(engine)) return; if (intel_gt_is_wedged(engine->gt)) goto out; if (engine->heartbeat.systole) { if (engine->schedule && rq->sched.attr.priority < I915_PRIORITY_BARRIER) { /* * Gradually raise the priority of the heartbeat to * give high priority work [which presumably desires * low latency and no jitter] the chance to naturally * complete before being preempted. */ attr.priority = I915_PRIORITY_MASK; if (rq->sched.attr.priority >= attr.priority) attr.priority |= I915_USER_PRIORITY(I915_PRIORITY_HEARTBEAT); if (rq->sched.attr.priority >= attr.priority) attr.priority = I915_PRIORITY_BARRIER; local_bh_disable(); engine->schedule(rq, &attr); local_bh_enable(); } else { if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)) show_heartbeat(rq, engine); intel_gt_handle_error(engine->gt, engine->mask, I915_ERROR_CAPTURE, "stopped heartbeat on %s", engine->name); } goto out; } if (engine->wakeref_serial == engine->serial) goto out; mutex_lock(&ce->timeline->mutex); intel_context_enter(ce); rq = __i915_request_create(ce, GFP_NOWAIT | __GFP_NOWARN); intel_context_exit(ce); if (IS_ERR(rq)) goto unlock; idle_pulse(engine, rq); if (i915_modparams.enable_hangcheck) engine->heartbeat.systole = i915_request_get(rq); __i915_request_commit(rq); __i915_request_queue(rq, &attr); unlock: mutex_unlock(&ce->timeline->mutex); out: if (!next_heartbeat(engine)) i915_request_put(fetch_and_zero(&engine->heartbeat.systole)); intel_engine_pm_put(engine); } void intel_engine_unpark_heartbeat(struct intel_engine_cs *engine) { if (!IS_ACTIVE(CONFIG_DRM_I915_HEARTBEAT_INTERVAL)) return; next_heartbeat(engine); } void intel_engine_park_heartbeat(struct intel_engine_cs *engine) { if (cancel_delayed_work(&engine->heartbeat.work)) i915_request_put(fetch_and_zero(&engine->heartbeat.systole)); } void intel_engine_init_heartbeat(struct intel_engine_cs *engine) { INIT_DELAYED_WORK(&engine->heartbeat.work, heartbeat); } int intel_engine_set_heartbeat(struct intel_engine_cs *engine, unsigned long delay) { int err; /* Send one last pulse before to cleanup persistent hogs */ if (!delay && IS_ACTIVE(CONFIG_DRM_I915_PREEMPT_TIMEOUT)) { err = intel_engine_pulse(engine); if (err) return err; } WRITE_ONCE(engine->props.heartbeat_interval_ms, delay); if (intel_engine_pm_get_if_awake(engine)) { if (delay) intel_engine_unpark_heartbeat(engine); else intel_engine_park_heartbeat(engine); intel_engine_pm_put(engine); } return 0; } int intel_engine_pulse(struct intel_engine_cs *engine) { struct i915_sched_attr attr = { .priority = I915_PRIORITY_BARRIER }; struct intel_context *ce = engine->kernel_context; struct i915_request *rq; int err; if (!intel_engine_has_preemption(engine)) return -ENODEV; if (!intel_engine_pm_get_if_awake(engine)) return 0; if (mutex_lock_interruptible(&ce->timeline->mutex)) { err = -EINTR; goto out_rpm; } intel_context_enter(ce); rq = __i915_request_create(ce, GFP_NOWAIT | __GFP_NOWARN); intel_context_exit(ce); if (IS_ERR(rq)) { err = PTR_ERR(rq); goto out_unlock; } __set_bit(I915_FENCE_FLAG_SENTINEL, &rq->fence.flags); idle_pulse(engine, rq); __i915_request_commit(rq); __i915_request_queue(rq, &attr); GEM_BUG_ON(rq->sched.attr.priority < I915_PRIORITY_BARRIER); err = 0; out_unlock: mutex_unlock(&ce->timeline->mutex); out_rpm: intel_engine_pm_put(engine); return err; } int intel_engine_flush_barriers(struct intel_engine_cs *engine) { struct i915_request *rq; int err = 0; if (llist_empty(&engine->barrier_tasks)) return 0; if (!intel_engine_pm_get_if_awake(engine)) return 0; rq = i915_request_create(engine->kernel_context); if (IS_ERR(rq)) { err = PTR_ERR(rq); goto out_rpm; } idle_pulse(engine, rq); i915_request_add(rq); out_rpm: intel_engine_pm_put(engine); return err; } #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST) #include "selftest_engine_heartbeat.c" #endif
#ifdef __cplusplus extern "C" { #endif extern DL_EXPORT(int) spam(void); extern DL_EXPORT(void) grail(void); extern DL_EXPORT(char *)tomato(void); #ifdef __cplusplus } #endif int spam(void) {return 0;} void grail(void) {return;} char *tomato(void) {return 0;}
/* * wm8994.h -- WM8994 Soc Audio 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 _WM8994_H #define _WM8994_H #include <sound/soc.h> extern struct snd_soc_codec_device soc_codec_dev_wm8994; extern struct snd_soc_dai wm8994_dai[]; /* Sources for AIF1/2 SYSCLK - use with set_dai_sysclk() */ #define WM8994_SYSCLK_MCLK1 1 #define WM8994_SYSCLK_MCLK2 2 #define WM8994_SYSCLK_FLL1 3 #define WM8994_SYSCLK_FLL2 4 #define WM8994_FLL1 1 #define WM8994_FLL2 2 #define WM8994_FLL_SRC_MCLK1 1 #define WM8994_FLL_SRC_MCLK2 2 #define WM8994_FLL_SRC_LRCLK 3 #define WM8994_FLL_SRC_BCLK 4 int wm8994_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, int micbias, int det, int shrt); #endif
/* * linux/drivers/video/omap2/dss/dss_features.h * * Copyright (C) 2010 Texas Instruments * Author: Archit Taneja <archit@ti.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __OMAP2_DSS_FEATURES_H #define __OMAP2_DSS_FEATURES_H #ifdef CONFIG_ARCH_OMAP4 #define MAX_DSS_MANAGERS 3 #define MAX_DSS_OVERLAYS 4 #endif #ifdef CONFIG_ARCH_OMAP3 #define MAX_DSS_MANAGERS 2 #define MAX_DSS_OVERLAYS 3 #endif #define MAX_DSS_LCD_MANAGERS 2 #define MAX_NUM_DSI 2 /* DSS has feature id */ enum dss_feat_id { FEAT_GLOBAL_ALPHA = 1 << 0, FEAT_GLOBAL_ALPHA_VID1 = 1 << 1, FEAT_PRE_MULT_ALPHA = 1 << 2, FEAT_LCDENABLEPOL = 1 << 3, FEAT_LCDENABLESIGNAL = 1 << 4, FEAT_PCKFREEENABLE = 1 << 5, FEAT_FUNCGATED = 1 << 6, FEAT_MGR_LCD2 = 1 << 7, FEAT_LINEBUFFERSPLIT = 1 << 8, FEAT_ROWREPEATENABLE = 1 << 9, FEAT_RESIZECONF = 1 << 10, /* Independent core clk divider */ FEAT_CORE_CLK_DIV = 1 << 11, FEAT_LCD_CLK_SRC = 1 << 12, /* DSI-PLL power command 0x3 is not working */ FEAT_DSI_PLL_PWR_BUG = 1 << 13, FEAT_DSI_PLL_FREQSEL = 1 << 14, FEAT_DSI_DCS_CMD_CONFIG_VC = 1 << 15, FEAT_DSI_VC_OCP_WIDTH = 1 << 16, FEAT_DSI_REVERSE_TXCLKESC = 1 << 17, FEAT_DSI_GNQ = 1 << 18, FEAT_HDMI_CTS_SWMODE = 1 << 19, FEAT_HANDLE_UV_SEPARATE = 1 << 20, FEAT_ATTR2 = 1 << 21, FEAT_VENC_REQUIRES_TV_DAC_CLK = 1 << 22, FEAT_CPR = 1 << 23, FEAT_PRELOAD = 1 << 24, FEAT_FIR_COEF_V = 1 << 25, FEAT_ALPHA_OMAP3_COMPAT = 1 << 26, FEAT_OVL_VID3 = 1 << 27, FEAT_OVL_ZORDER = 1 << 28, }; /* DSS register field id */ enum dss_feat_reg_field { FEAT_REG_FIRHINC, FEAT_REG_FIRVINC, FEAT_REG_FIFOHIGHTHRESHOLD, FEAT_REG_FIFOLOWTHRESHOLD, FEAT_REG_FIFOSIZE, FEAT_REG_HORIZONTALACCU, FEAT_REG_VERTICALACCU, FEAT_REG_DISPC_CLK_SWITCH, FEAT_REG_DSIPLL_REGN, FEAT_REG_DSIPLL_REGM, FEAT_REG_DSIPLL_REGM_DISPC, FEAT_REG_DSIPLL_REGM_DSI, }; enum dss_range_param { FEAT_PARAM_DSS_FCK, FEAT_PARAM_DSIPLL_REGN, FEAT_PARAM_DSIPLL_REGM, FEAT_PARAM_DSIPLL_REGM_DISPC, FEAT_PARAM_DSIPLL_REGM_DSI, FEAT_PARAM_DSIPLL_FINT, FEAT_PARAM_DSIPLL_LPDIV, }; /* DSS Feature Functions */ int dss_feat_get_num_mgrs(void); int dss_feat_get_num_ovls(void); unsigned long dss_feat_get_param_min(enum dss_range_param param); unsigned long dss_feat_get_param_max(enum dss_range_param param); enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel); enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane); bool dss_feat_color_mode_supported(enum omap_plane plane, enum omap_color_mode color_mode); const char *dss_feat_get_clk_source_name(enum omap_dss_clk_source id); bool dss_has_feature(enum dss_feat_id id); void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end); void dss_features_init(void); #endif
/* Copyright 2020 jrfhoutx * * 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/>. */ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap BASE: (Base Layer) Default Layer * .---------.,---------------------------------------------------------------------. * | F1 | F2 ||Esc | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| ~ | BkSpc | Ins | * |----|----||---------------------------------------------------------------------| * | F3 | F4 ||Tab | Q| W| E| R| T| Y| U| I| O| P| [ | ] | \ | Del | * |----|----||---------------------------------------------------------------------| * | F5 | F6 ||CAPS | A| S| D| F| G| H| J| K| L| ;| '| Return | PgUp| * |----|----||---------------------------------------------------------------------| * | F7 | F8 ||Shift | Z| X| C| V| B| N| M| ,| .| /| Shift | Up | PgDn| * |----|----||---------------------------------------------------------------------| * | F9 | F10||LCtrl| Alt | Space | Fn | Space | Alt | | L | Dn | R | * `---------'`---------------------------------------------------------------------' */ [0] = LAYOUT_all( /* Styrka Base */ KC_F1, KC_F2, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSLS, KC_INS, KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_TRNS, KC_ENT, KC_PGUP, KC_F7, KC_F8, KC_LSFT, KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT ), [1] = LAYOUT_all( /* Styrka Base */ RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), [2] = LAYOUT_all( /* Styrka Base */ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), [3] = LAYOUT_all( /* Styrka Base */ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), };
/* * (C) Copyright 2001 * John Clemens <clemens@mclx.com>, Mission Critical Linux, Inc. * * SPDX-License-Identifier: GPL-2.0+ */ /* * mpsc.h - header file for MPSC in uart mode (console driver) */ #ifndef __MPSC_H__ #define __MPSC_H__ /* include actual Galileo defines */ #include <galileo/gt64260R.h> /* driver related defines */ int mpsc_init(int baud); void mpsc_init2(void); char mpsc_getchar(void); int mpsc_test_char(void); int galbrg_set_baudrate(int channel, int rate); int mpsc_putchar_early(char ch); extern int (*mpsc_putchar)(char ch); #define CHANNEL CONFIG_MPSC_PORT #define TX_DESC 5 #define RX_DESC 20 #define DESC_FIRST 0x00010000 #define DESC_LAST 0x00020000 #define DESC_OWNER 0x80000000 #define TX_DEMAND 0x00800000 #define TX_STOP 0x00010000 #define RX_ENABLE 0x00000080 #define SDMA_RX_ABORT (1 << 15) #define SDMA_TX_ABORT (1 << 31) #define MPSC_TX_ABORT (1 << 7) #define MPSC_RX_ABORT (1 << 23) #define MPSC_ENTER_HUNT (1 << 31) /* MPSC defines */ #define GALMPSC_CONNECT 0x1 #define GALMPSC_DISCONNECT 0x0 #define GALMPSC_UART 0x1 #define GALMPSC_STOP_BITS_1 0x0 #define GALMPSC_STOP_BITS_2 0x1 #define GALMPSC_CHAR_LENGTH_8 0x3 #define GALMPSC_CHAR_LENGTH_7 0x2 #define GALMPSC_PARITY_ODD 0x0 #define GALMPSC_PARITY_EVEN 0x2 #define GALMPSC_PARITY_MARK 0x3 #define GALMPSC_PARITY_SPACE 0x1 #define GALMPSC_PARITY_NONE -1 #define GALMPSC_SERIAL_MULTIPLEX SERIAL_PORT_MULTIPLEX /* 0xf010 */ #define GALMPSC_ROUTING_REGISTER MAIN_ROUTING_REGISTER /* 0xb400 */ #define GALMPSC_RxC_ROUTE RECEIVE_CLOCK_ROUTING_REGISTER /* 0xb404 */ #define GALMPSC_TxC_ROUTE TRANSMIT_CLOCK_ROUTING_REGISTER /* 0xb408 */ #define GALMPSC_MCONF_LOW MPSC0_MAIN_CONFIGURATION_LOW /* 0x8000 */ #define GALMPSC_MCONF_HIGH MPSC0_MAIN_CONFIGURATION_HIGH /* 0x8004 */ #define GALMPSC_PROTOCONF_REG MPSC0_PROTOCOL_CONFIGURATION /* 0x8008 */ #define GALMPSC_REG_GAP 0x1000 #define GALMPSC_MCONF_CHREG_BASE CHANNEL0_REGISTER1 /* 0x800c */ #define GALMPSC_CHANNELREG_1 CHANNEL0_REGISTER1 /* 0x800c */ #define GALMPSC_CHANNELREG_2 CHANNEL0_REGISTER2 /* 0x8010 */ #define GALMPSC_CHANNELREG_3 CHANNEL0_REGISTER3 /* 0x8014 */ #define GALMPSC_CHANNELREG_4 CHANNEL0_REGISTER4 /* 0x8018 */ #define GALMPSC_CHANNELREG_5 CHANNEL0_REGISTER5 /* 0x801c */ #define GALMPSC_CHANNELREG_6 CHANNEL0_REGISTER6 /* 0x8020 */ #define GALMPSC_CHANNELREG_7 CHANNEL0_REGISTER7 /* 0x8024 */ #define GALMPSC_CHANNELREG_8 CHANNEL0_REGISTER8 /* 0x8028 */ #define GALMPSC_CHANNELREG_9 CHANNEL0_REGISTER9 /* 0x802c */ #define GALMPSC_CHANNELREG_10 CHANNEL0_REGISTER10 /* 0x8030 */ #define GALMPSC_CHANNELREG_11 CHANNEL0_REGISTER11 /* 0x8034 */ #define GALSDMA_COMMAND_FIRST (1 << 16) #define GALSDMA_COMMAND_LAST (1 << 17) #define GALSDMA_COMMAND_ENABLEINT (1 << 23) #define GALSDMA_COMMAND_AUTO (1 << 30) #define GALSDMA_COMMAND_OWNER (1 << 31) #define GALSDMA_RX 0 #define GALSDMA_TX 1 /* CHANNEL2 should be CHANNEL1, according to documentation, * but to work with the current GTREGS file... */ #define GALSDMA_0_CONF_REG CHANNEL0_CONFIGURATION_REGISTER /* 0x4000 */ #define GALSDMA_1_CONF_REG CHANNEL2_CONFIGURATION_REGISTER /* 0x6000 */ #define GALSDMA_0_COM_REG CHANNEL0_COMMAND_REGISTER /* 0x4008 */ #define GALSDMA_1_COM_REG CHANNEL2_COMMAND_REGISTER /* 0x6008 */ #define GALSDMA_0_CUR_RX_PTR CHANNEL0_CURRENT_RX_DESCRIPTOR_POINTER /* 0x4810 */ #define GALSDMA_0_CUR_TX_PTR CHANNEL0_CURRENT_TX_DESCRIPTOR_POINTER /* 0x4c10 */ #define GALSDMA_0_FIR_TX_PTR CHANNEL0_FIRST_TX_DESCRIPTOR_POINTER /* 0x4c14 */ #define GALSDMA_1_CUR_RX_PTR CHANNEL2_CURRENT_RX_DESCRIPTOR_POINTER /* 0x6810 */ #define GALSDMA_1_CUR_TX_PTR CHANNEL2_CURRENT_TX_DESCRIPTOR_POINTER /* 0x6c10 */ #define GALSDMA_1_FIR_TX_PTR CHANNEL2_FIRST_TX_DESCRIPTOR_POINTER /* 0x6c14 */ #define GALSDMA_REG_DIFF 0x2000 /* WRONG in gt64260R.h */ #define GALSDMA_INT_CAUSE 0xb800 /* SDMA_CAUSE */ #define GALSDMA_INT_MASK 0xb880 /* SDMA_MASK */ #define GALSDMA_MODE_UART 0 #define GALSDMA_MODE_BISYNC 1 #define GALSDMA_MODE_HDLC 2 #define GALSDMA_MODE_TRANSPARENT 3 #define GALBRG_0_CONFREG BRG0_CONFIGURATION_REGISTER /* 0xb200 */ #define GALBRG_REG_GAP 0x0008 #define GALBRG_0_BTREG BRG0_BAUDE_TUNING_REGISTER /* 0xb204 */ #endif /* __MPSC_H__ */
#include <posix/cpio.h>
/* * netlink/route/class.h Classes * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation version 2.1 * of the License. * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ #ifndef NETLINK_CLASS_H_ #define NETLINK_CLASS_H_ #include <netlink/netlink.h> #include <netlink/route/tc.h> #include <netlink/route/qdisc.h> #ifdef __cplusplus extern "C" { #endif struct rtnl_class; extern struct nl_object_ops class_obj_ops; extern struct rtnl_class * rtnl_class_alloc(void); extern void rtnl_class_put(struct rtnl_class *); extern int rtnl_class_alloc_cache(struct nl_sock *, int, struct nl_cache **); extern struct rtnl_class *rtnl_class_get(struct nl_cache *, int, uint32_t); /* leaf qdisc access */ extern struct rtnl_qdisc * rtnl_class_leaf_qdisc(struct rtnl_class *, struct nl_cache *); extern int rtnl_class_build_add_request(struct rtnl_class *, int, struct nl_msg **); extern int rtnl_class_add(struct nl_sock *, struct rtnl_class *, int); extern int rtnl_class_build_delete_request(struct rtnl_class *, struct nl_msg **); extern int rtnl_class_delete(struct nl_sock *, struct rtnl_class *); extern void rtnl_class_set_ifindex(struct rtnl_class *, int); extern int rtnl_class_get_ifindex(struct rtnl_class *); extern void rtnl_class_set_handle(struct rtnl_class *, uint32_t); extern uint32_t rtnl_class_get_handle(struct rtnl_class *); extern void rtnl_class_set_parent(struct rtnl_class *, uint32_t); extern uint32_t rtnl_class_get_parent(struct rtnl_class *); extern void rtnl_class_set_kind(struct rtnl_class *, const char *); extern char * rtnl_class_get_kind(struct rtnl_class *); extern uint64_t rtnl_class_get_stat(struct rtnl_class *, enum rtnl_tc_stats_id); /* iterators */ extern void rtnl_class_foreach_child(struct rtnl_class *, struct nl_cache *, void (*cb)(struct nl_object *, void *), void *); extern void rtnl_class_foreach_cls(struct rtnl_class *, struct nl_cache *, void (*cb)(struct nl_object *, void *), void *); #ifdef __cplusplus } #endif #endif
// // TPCircularBuffer.c // Circular/Ring buffer implementation // // https://github.com/michaeltyson/TPCircularBuffer // // Created by Michael Tyson on 10/12/2011. // // Copyright (C) 2012-2013 A Tasty Pixel // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // #include "TPCircularBuffer.h" #include <mach/mach.h> #include <stdio.h> #define reportResult(result,operation) (_reportResult((result),(operation),strrchr(__FILE__, '/')+1,__LINE__)) static inline bool _reportResult(kern_return_t result, const char *operation, const char* file, int line) { if (result != ERR_SUCCESS) { printf("%s:%d: %s: %s\n", file, line, operation, mach_error_string(result)); return false; } return true; } bool TPCircularBufferInit(TPCircularBuffer *buffer, int length) { // Keep trying until we get our buffer, needed to handle race conditions int retries = 3; while ( true) { buffer->length = (int32_t)round_page(length); // We need whole page sizes // Temporarily allocate twice the length, so we have the contiguous address space to // support a second instance of the buffer directly after vm_address_t bufferAddress; kern_return_t result = vm_allocate(mach_task_self(), &bufferAddress, buffer->length * 2, VM_FLAGS_ANYWHERE); // allocate anywhere it'll fit if (result != ERR_SUCCESS) { if (retries-- == 0) { reportResult(result, "Buffer allocation"); return false; } // Try again if we fail continue; } // Now replace the second half of the allocation with a virtual copy of the first half. Deallocate the second half... result = vm_deallocate(mach_task_self(), bufferAddress + buffer->length, buffer->length); if (result != ERR_SUCCESS) { if (retries-- == 0) { reportResult(result, "Buffer deallocation"); return false; } // If this fails somehow, deallocate the whole region and try again vm_deallocate(mach_task_self(), bufferAddress, buffer->length); continue; } // Re-map the buffer to the address space immediately after the buffer vm_address_t virtualAddress = bufferAddress + buffer->length; vm_prot_t cur_prot, max_prot; result = vm_remap(mach_task_self(), &virtualAddress, // mirror target buffer->length, // size of mirror 0, // auto alignment 0, // force remapping to virtualAddress mach_task_self(), // same task bufferAddress, // mirror source 0, // MAP READ-WRITE, NOT COPY &cur_prot, // unused protection struct &max_prot, // unused protection struct VM_INHERIT_DEFAULT); if (result != ERR_SUCCESS) { if (retries-- == 0) { reportResult(result, "Remap buffer memory"); return false; } // If this remap failed, we hit a race condition, so deallocate and try again vm_deallocate(mach_task_self(), bufferAddress, buffer->length); continue; } if (virtualAddress != bufferAddress+buffer->length) { // If the memory is not contiguous, clean up both allocated buffers and try again if (retries-- == 0) { printf("Couldn't map buffer memory to end of buffer\n"); return false; } vm_deallocate(mach_task_self(), virtualAddress, buffer->length); vm_deallocate(mach_task_self(), bufferAddress, buffer->length); continue; } buffer->buffer = (void*)bufferAddress; buffer->fillCount = 0; buffer->head = buffer->tail = 0; return true; } return false; } void TPCircularBufferCleanup(TPCircularBuffer *buffer) { vm_deallocate(mach_task_self(), (vm_address_t)buffer->buffer, buffer->length * 2); memset(buffer, 0, sizeof(TPCircularBuffer)); } void TPCircularBufferClear(TPCircularBuffer *buffer) { int32_t fillCount; if (TPCircularBufferTail(buffer, &fillCount)) { TPCircularBufferConsume(buffer, fillCount); } }
/* * Copyright (c) 2012 Nordic Semiconductor ASA * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA * integrated circuit in a product or a software update for such product, must reproduce * the above copyright notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the distribution. * * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be * used to endorse or promote products derived from this software without specific prior * written permission. * * 4. This software, with or without modification, must only be used with a * Nordic Semiconductor ASA integrated circuit. * * 5. Any software provided in binary or object form under this license must not be reverse * engineered, decompiled, modified and/or disassembled. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** * @file * @brief ECB driver API. */ #ifndef NRF_ECB_H__ #define NRF_ECB_H__ /** * @defgroup nrf_ecb AES ECB encryption * @{ * @ingroup nrf_drivers * @brief Driver for the AES Electronic Code Book (ECB) peripheral. * * To encrypt data, the peripheral must first be powered on * using @ref nrf_ecb_init. Next, the key must be set using @ref nrf_ecb_set_key. */ #include <stdint.h> #ifdef __cplusplus extern "C" { #endif /** * @brief Function for initializing and powering on the ECB peripheral. * * This function allocates memory for the ECBDATAPTR. * @retval true If initialization was successful. * @retval false If powering on failed. */ bool nrf_ecb_init(void); /** * @brief Function for encrypting 16-byte data using current key. * * This function avoids unnecessary copying of data if the parameters point to the * correct locations in the ECB data structure. * * @param dst Result of encryption, 16 bytes will be written. * @param src Source with 16-byte data to be encrypted. * * @retval true If the encryption operation completed. * @retval false If the encryption operation did not complete. */ bool nrf_ecb_crypt(uint8_t * dst, const uint8_t * src); /** * @brief Function for setting the key to be used for encryption. * * @param key Pointer to the key. 16 bytes will be read. */ void nrf_ecb_set_key(const uint8_t * key); #ifdef __cplusplus } #endif #endif // NRF_ECB_H__ /** @} */
/* linux/arch/arm/plat-samsung/include/plat/jpeg.h * * Copyright 201i Samsung Electronics Co., Ltd. * http://www.samsung.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. */ #ifndef __ASM_PLAT_JPEG_H #define __ASM_PLAT_JPEG_H __FILE__ int __init exynos4_jpeg_setup_clock(struct device *dev, unsigned long clk_rate); int __init exynos5_jpeg_setup_clock(struct device *dev, unsigned long clk_rate); #endif /*__ASM_PLAT_JPEG_H */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */ /* * Miscellaneous uncategorized functionality. Please add new functionality to * new headers, or to other appropriate existing headers, not here. */ #ifndef mozilla_Util_h #define mozilla_Util_h #include "mozilla/Assertions.h" #include "mozilla/Attributes.h" #include "mozilla/Types.h" #ifdef __cplusplus #include "mozilla/Alignment.h" namespace mozilla { /* * Safely subtract two pointers when it is known that end >= begin. This avoids * the common compiler bug that if (size_t(end) - size_t(begin)) has the MSB * set, the unsigned subtraction followed by right shift will produce -1, or * size_t(-1), instead of the real difference. */ template<class T> MOZ_ALWAYS_INLINE size_t PointerRangeSize(T* begin, T* end) { MOZ_ASSERT(end >= begin); return (size_t(end) - size_t(begin)) / sizeof(T); } /* * Compute the length of an array with constant length. (Use of this method * with a non-array pointer will not compile.) * * Beware of the implicit trailing '\0' when using this with string constants. */ template<typename T, size_t N> MOZ_CONSTEXPR size_t ArrayLength(T (&arr)[N]) { return N; } /* * Compute the address one past the last element of a constant-length array. * * Beware of the implicit trailing '\0' when using this with string constants. */ template<typename T, size_t N> MOZ_CONSTEXPR T* ArrayEnd(T (&arr)[N]) { return arr + ArrayLength(arr); } } /* namespace mozilla */ #endif /* __cplusplus */ /* * MOZ_ARRAY_LENGTH() is an alternative to mozilla::ArrayLength() for C files * that can't use C++ template functions and for static_assert() calls that * can't call ArrayLength() when it is not a C++11 constexpr function. */ #ifdef MOZ_HAVE_CXX11_CONSTEXPR # define MOZ_ARRAY_LENGTH(array) mozilla::ArrayLength(array) #else # define MOZ_ARRAY_LENGTH(array) (sizeof(array)/sizeof((array)[0])) #endif #endif /* mozilla_Util_h */
/* bn.h for openssl */ #include <wolfssl/openssl/bn.h>
// // TwitterCore.h // // Copyright (c) 2015 Twitter. All rights reserved. // #import <Foundation/Foundation.h> #if !TARGET_OS_TV #import <Accounts/Accounts.h> #endif #import <CoreData/CoreData.h> #if !TARGET_OS_TV #import <Social/Social.h> #endif #import "TWTRDefines.h" #if IS_UIKIT_AVAILABLE #import <UIKit/UIKit.h> #else #import <Cocoa/Cocoa.h> #endif #if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000 #error "TwitterCore doesn't support iOS 7.x and lower. Please, change your minimum deployment target to iOS 8.0" #endif #import "TWTRAPIErrorCode.h" #import "TWTRAuthConfig.h" #import "TWTRAuthSession.h" #import "TWTRConstants.h" #import "TWTRCoreOAuthSigning.h" #import "TWTRGuestSession.h" #import "TWTRSession.h" #import "TWTRSessionStore.h"
/* * aml_pio_i2c.h */ #ifndef AML_PIO_I2C_H #define AML_PIO_I2C_H #include <linux/i2c-aml.h> #define AML_PIO_OUTPUT 1 #define AML_GPIO_INPUT 0 struct aml_sw_i2c { struct aml_sw_i2c_pins *sw_pins; struct i2c_adapter adapter; struct i2c_algo_bit_data algo_data; struct class class; }; #endif
/* * Copyright (c) 2006, 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2005 Mellanox Technologies. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include <linux/init.h> #include <linux/errno.h> #include <asm/page.h> #include "mlx4.h" #include "icm.h" int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn) { struct mlx4_priv *priv = mlx4_priv(dev); *pdn = mlx4_bitmap_alloc(&priv->pd_bitmap); if (*pdn == -1) return -ENOMEM; return 0; } EXPORT_SYMBOL_GPL(mlx4_pd_alloc); void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn) { mlx4_bitmap_free(&mlx4_priv(dev)->pd_bitmap, pdn); } EXPORT_SYMBOL_GPL(mlx4_pd_free); int __devinit mlx4_init_pd_table(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); return mlx4_bitmap_init(&priv->pd_bitmap, dev->caps.num_pds, (1 << 24) - 1, dev->caps.reserved_pds); } void mlx4_cleanup_pd_table(struct mlx4_dev *dev) { mlx4_bitmap_cleanup(&mlx4_priv(dev)->pd_bitmap); } int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar) { uar->index = mlx4_bitmap_alloc(&mlx4_priv(dev)->uar_table.bitmap); if (uar->index == -1) return -ENOMEM; uar->pfn = (pci_resource_start(dev->pdev, 2) >> PAGE_SHIFT) + uar->index; return 0; } EXPORT_SYMBOL_GPL(mlx4_uar_alloc); void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar) { mlx4_bitmap_free(&mlx4_priv(dev)->uar_table.bitmap, uar->index); } EXPORT_SYMBOL_GPL(mlx4_uar_free); int mlx4_init_uar_table(struct mlx4_dev *dev) { return mlx4_bitmap_init(&mlx4_priv(dev)->uar_table.bitmap, dev->caps.num_uars, dev->caps.num_uars - 1, max(128, dev->caps.reserved_uars)); } void mlx4_cleanup_uar_table(struct mlx4_dev *dev) { mlx4_bitmap_cleanup(&mlx4_priv(dev)->uar_table.bitmap); }
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_SYSTEM_CHROMEOS_SYSTEM_CLOCK_OBSERVER_H_ #define ASH_SYSTEM_CHROMEOS_SYSTEM_CLOCK_OBSERVER_H_ #include "chromeos/dbus/system_clock_client.h" #include "chromeos/settings/timezone_settings.h" namespace ash { class SystemClockObserver : public chromeos::SystemClockClient::Observer, public chromeos::system::TimezoneSettings::Observer { public: SystemClockObserver(); virtual ~SystemClockObserver(); // chromeos::SystemClockClient::Observer virtual void SystemClockUpdated() OVERRIDE; virtual void SystemClockCanSetTimeChanged(bool can_set_time) OVERRIDE; // chromeos::system::TimezoneSettings::Observer virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE; bool can_set_time() { return can_set_time_; } private: bool can_set_time_; DISALLOW_COPY_AND_ASSIGN(SystemClockObserver); }; } // namespace ash #endif // ASH_SYSTEM_CHROMEOS_SYSTEM_CLOCK_OBSERVER_H_
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CC_RESOURCES_TEXTURE_MAILBOX_H_ #define CC_RESOURCES_TEXTURE_MAILBOX_H_ #include <string> #include "base/callback.h" #include "base/memory/shared_memory.h" #include "cc/base/cc_export.h" #include "gpu/command_buffer/common/mailbox_holder.h" #include "ui/gfx/size.h" namespace cc { // TODO(skaslev, danakj) Rename this class more apropriately since now it // can hold a shared memory resource as well as a texture mailbox. class CC_EXPORT TextureMailbox { public: TextureMailbox(); explicit TextureMailbox(const gpu::MailboxHolder& mailbox_holder); TextureMailbox(const gpu::Mailbox& mailbox, uint32 target, uint32 sync_point); TextureMailbox(base::SharedMemory* shared_memory, const gfx::Size& size); ~TextureMailbox(); bool IsValid() const { return IsTexture() || IsSharedMemory(); } bool IsTexture() const { return !mailbox_holder_.mailbox.IsZero(); } bool IsSharedMemory() const { return shared_memory_ != NULL; } bool Equals(const TextureMailbox&) const; const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; } const int8* name() const { return mailbox().name; } uint32 target() const { return mailbox_holder_.texture_target; } uint32 sync_point() const { return mailbox_holder_.sync_point; } void set_sync_point(int32 sync_point) { mailbox_holder_.sync_point = sync_point; } bool allow_overlay() const { return allow_overlay_; } void set_allow_overlay(bool allow_overlay) { allow_overlay_ = allow_overlay; } base::SharedMemory* shared_memory() const { return shared_memory_; } gfx::Size shared_memory_size() const { return shared_memory_size_; } size_t SharedMemorySizeInBytes() const; private: gpu::MailboxHolder mailbox_holder_; base::SharedMemory* shared_memory_; gfx::Size shared_memory_size_; bool allow_overlay_; }; } // namespace cc #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_
/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #pragma once #include "CoreClasses.h" #include "File.h" namespace facebook { namespace jni { class AContext : public JavaClass<AContext> { public: static constexpr const char* kJavaDescriptor = "Landroid/content/Context;"; // Define a method that calls into the represented Java class local_ref<JFile::javaobject> getCacheDir() { static auto method = getClass()->getMethod<JFile::javaobject()>("getCacheDir"); return method(self()); } }; } }
/* Readline interface for tokenizer.c and [raw_]input() in bltinmodule.c. By default, or when stdin is not a tty device, we have a super simple my_readline function using fgets. Optionally, we can use the GNU readline library. my_readline() has a different return value from GNU readline(): - NULL if an interrupt occurred or if an error occurred - a malloc'ed empty string if EOF was read - a malloc'ed string ending in \n normally */ #include "Python.h" #ifdef MS_WINDOWS #define WIN32_LEAN_AND_MEAN #include "windows.h" #endif /* MS_WINDOWS */ #ifdef __VMS extern char* vms__StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt); #endif PyThreadState* _PyOS_ReadlineTState; #ifdef WITH_THREAD #include "pythread.h" static PyThread_type_lock _PyOS_ReadlineLock = NULL; #endif int (*PyOS_InputHook)(void) = NULL; /* This function restarts a fgets() after an EINTR error occurred except if PyOS_InterruptOccurred() returns true. */ static int my_fgets(char *buf, int len, FILE *fp) { char *p; while (1) { if (PyOS_InputHook != NULL) (void)(PyOS_InputHook)(); errno = 0; clearerr(fp); p = fgets(buf, len, fp); if (p != NULL) return 0; /* No error */ #ifdef MS_WINDOWS /* In the case of a Ctrl+C or some other external event interrupting the operation: Win2k/NT: ERROR_OPERATION_ABORTED is the most recent Win32 error code (and feof() returns TRUE). Win9x: Ctrl+C seems to have no effect on fgets() returning early - the signal handler is called, but the fgets() only returns "normally" (ie, when Enter hit or feof()) */ if (GetLastError()==ERROR_OPERATION_ABORTED) { /* Signals come asynchronously, so we sleep a brief moment before checking if the handler has been triggered (we cant just return 1 before the signal handler has been called, as the later signal may be treated as a separate interrupt). */ Sleep(1); if (PyOS_InterruptOccurred()) { return 1; /* Interrupt */ } /* Either the sleep wasn't long enough (need a short loop retrying?) or not interrupted at all (in which case we should revisit the whole thing!) Logging some warning would be nice. assert is not viable as under the debugger, the various dialogs mean the condition is not true. */ } #endif /* MS_WINDOWS */ if (feof(fp)) { clearerr(fp); return -1; /* EOF */ } #ifdef EINTR if (errno == EINTR) { int s; #ifdef WITH_THREAD PyEval_RestoreThread(_PyOS_ReadlineTState); #endif s = PyErr_CheckSignals(); #ifdef WITH_THREAD PyEval_SaveThread(); #endif if (s < 0) return 1; /* try again */ continue; } #endif if (PyOS_InterruptOccurred()) { return 1; /* Interrupt */ } return -2; /* Error */ } /* NOTREACHED */ } /* Readline implementation using fgets() */ char * PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt) { size_t n; char *p; n = 100; if ((p = (char *)PyMem_MALLOC(n)) == NULL) return NULL; fflush(sys_stdout); if (prompt) fprintf(stderr, "%s", prompt); fflush(stderr); switch (my_fgets(p, (int)n, sys_stdin)) { case 0: /* Normal case */ break; case 1: /* Interrupt */ PyMem_FREE(p); return NULL; case -1: /* EOF */ case -2: /* Error */ default: /* Shouldn't happen */ *p = '\0'; break; } n = strlen(p); while (n > 0 && p[n-1] != '\n') { size_t incr = n+2; p = (char *)PyMem_REALLOC(p, n + incr); if (p == NULL) return NULL; if (incr > INT_MAX) { PyErr_SetString(PyExc_OverflowError, "input line too long"); } if (my_fgets(p+n, (int)incr, sys_stdin) != 0) break; n += strlen(p+n); } return (char *)PyMem_REALLOC(p, n+1); } /* By initializing this function pointer, systems embedding Python can override the readline function. Note: Python expects in return a buffer allocated with PyMem_Malloc. */ char *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *); /* Interface used by tokenizer.c and bltinmodule.c */ char * PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt) { char *rv; if (_PyOS_ReadlineTState == PyThreadState_GET()) { PyErr_SetString(PyExc_RuntimeError, "can't re-enter readline"); return NULL; } if (PyOS_ReadlineFunctionPointer == NULL) { #ifdef __VMS PyOS_ReadlineFunctionPointer = vms__StdioReadline; #else PyOS_ReadlineFunctionPointer = PyOS_StdioReadline; #endif } #ifdef WITH_THREAD if (_PyOS_ReadlineLock == NULL) { _PyOS_ReadlineLock = PyThread_allocate_lock(); } #endif _PyOS_ReadlineTState = PyThreadState_GET(); Py_BEGIN_ALLOW_THREADS #ifdef WITH_THREAD PyThread_acquire_lock(_PyOS_ReadlineLock, 1); #endif /* This is needed to handle the unlikely case that the * interpreter is in interactive mode *and* stdin/out are not * a tty. This can happen, for example if python is run like * this: python -i < test1.py */ if (!isatty (fileno (sys_stdin)) || !isatty (fileno (sys_stdout))) rv = PyOS_StdioReadline (sys_stdin, sys_stdout, prompt); else rv = (*PyOS_ReadlineFunctionPointer)(sys_stdin, sys_stdout, prompt); Py_END_ALLOW_THREADS #ifdef WITH_THREAD PyThread_release_lock(_PyOS_ReadlineLock); #endif _PyOS_ReadlineTState = NULL; return rv; }
//===--- FixIt.h - FixIt Hint utilities -------------------------*- 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 // //===----------------------------------------------------------------------===// // // This file implements functions to ease source rewriting from AST-nodes. // // Example swapping A and B expressions: // // Expr *A, *B; // tooling::fixit::createReplacement(*A, *B); // tooling::fixit::createReplacement(*B, *A); // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLING_FIXIT_H #define LLVM_CLANG_TOOLING_FIXIT_H #include "clang/AST/ASTContext.h" namespace clang { namespace tooling { namespace fixit { namespace internal { StringRef getText(CharSourceRange Range, const ASTContext &Context); /// Returns the token CharSourceRange corresponding to \p Range. inline CharSourceRange getSourceRange(const SourceRange &Range) { return CharSourceRange::getTokenRange(Range); } /// Returns the CharSourceRange of the token at Location \p Loc. inline CharSourceRange getSourceRange(const SourceLocation &Loc) { return CharSourceRange::getTokenRange(Loc, Loc); } /// Returns the CharSourceRange of an given Node. \p Node is typically a /// 'Stmt', 'Expr' or a 'Decl'. template <typename T> CharSourceRange getSourceRange(const T &Node) { return CharSourceRange::getTokenRange(Node.getSourceRange()); } } // end namespace internal /// Returns a textual representation of \p Node. template <typename T> StringRef getText(const T &Node, const ASTContext &Context) { return internal::getText(internal::getSourceRange(Node), Context); } // Returns a FixItHint to remove \p Node. // TODO: Add support for related syntactical elements (i.e. comments, ...). template <typename T> FixItHint createRemoval(const T &Node) { return FixItHint::CreateRemoval(internal::getSourceRange(Node)); } // Returns a FixItHint to replace \p Destination by \p Source. template <typename D, typename S> FixItHint createReplacement(const D &Destination, const S &Source, const ASTContext &Context) { return FixItHint::CreateReplacement(internal::getSourceRange(Destination), getText(Source, Context)); } // Returns a FixItHint to replace \p Destination by \p Source. template <typename D> FixItHint createReplacement(const D &Destination, StringRef Source) { return FixItHint::CreateReplacement(internal::getSourceRange(Destination), Source); } } // end namespace fixit } // end namespace tooling } // end namespace clang #endif // LLVM_CLANG_TOOLING_FIXINT_H
/* * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs * Copyright (C) 2013, Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef SPI_PXA2XX_H #define SPI_PXA2XX_H #include <linux/atomic.h> #include <linux/dmaengine.h> #include <linux/errno.h> #include <linux/io.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/pxa2xx_ssp.h> #include <linux/scatterlist.h> #include <linux/sizes.h> #include <linux/spi/spi.h> #include <linux/spi/pxa2xx_spi.h> struct driver_data { /* Driver model hookup */ struct platform_device *pdev; /* SSP Info */ struct ssp_device *ssp; /* SPI framework hookup */ enum pxa_ssp_type ssp_type; struct spi_master *master; /* PXA hookup */ struct pxa2xx_spi_master *master_info; /* SSP register addresses */ void __iomem *ioaddr; u32 ssdr_physical; /* SSP masks*/ u32 dma_cr1; u32 int_cr1; u32 clear_sr; u32 mask_sr; /* Message Transfer pump */ struct tasklet_struct pump_transfers; /* DMA engine support */ atomic_t dma_running; /* Current message transfer state info */ struct spi_message *cur_msg; struct spi_transfer *cur_transfer; struct chip_data *cur_chip; size_t len; void *tx; void *tx_end; void *rx; void *rx_end; u8 n_bytes; int (*write)(struct driver_data *drv_data); int (*read)(struct driver_data *drv_data); irqreturn_t (*transfer_handler)(struct driver_data *drv_data); void (*cs_control)(u32 command); void __iomem *lpss_base; }; struct chip_data { u32 cr1; u32 dds_rate; u32 timeout; u8 n_bytes; u32 dma_burst_size; u32 threshold; u32 dma_threshold; u16 lpss_rx_threshold; u16 lpss_tx_threshold; u8 enable_dma; union { int gpio_cs; unsigned int frm; }; int gpio_cs_inverted; int (*write)(struct driver_data *drv_data); int (*read)(struct driver_data *drv_data); void (*cs_control)(u32 command); }; static inline u32 pxa2xx_spi_read(const struct driver_data *drv_data, unsigned reg) { return __raw_readl(drv_data->ioaddr + reg); } static inline void pxa2xx_spi_write(const struct driver_data *drv_data, unsigned reg, u32 val) { __raw_writel(val, drv_data->ioaddr + reg); } #define START_STATE ((void *)0) #define RUNNING_STATE ((void *)1) #define DONE_STATE ((void *)2) #define ERROR_STATE ((void *)-1) #define IS_DMA_ALIGNED(x) IS_ALIGNED((unsigned long)(x), DMA_ALIGNMENT) #define DMA_ALIGNMENT 8 static inline int pxa25x_ssp_comp(struct driver_data *drv_data) { switch (drv_data->ssp_type) { case PXA25x_SSP: case CE4100_SSP: case QUARK_X1000_SSP: return 1; default: return 0; } } static inline void write_SSSR_CS(struct driver_data *drv_data, u32 val) { if (drv_data->ssp_type == CE4100_SSP || drv_data->ssp_type == QUARK_X1000_SSP) val |= pxa2xx_spi_read(drv_data, SSSR) & SSSR_ALT_FRM_MASK; pxa2xx_spi_write(drv_data, SSSR, val); } extern int pxa2xx_spi_flush(struct driver_data *drv_data); extern void *pxa2xx_spi_next_transfer(struct driver_data *drv_data); #define MAX_DMA_LEN SZ_64K #define DEFAULT_DMA_CR1 (SSCR1_TSRE | SSCR1_RSRE | SSCR1_TRAIL) extern irqreturn_t pxa2xx_spi_dma_transfer(struct driver_data *drv_data); extern int pxa2xx_spi_dma_prepare(struct driver_data *drv_data, u32 dma_burst); extern void pxa2xx_spi_dma_start(struct driver_data *drv_data); extern int pxa2xx_spi_dma_setup(struct driver_data *drv_data); extern void pxa2xx_spi_dma_release(struct driver_data *drv_data); extern int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip, struct spi_device *spi, u8 bits_per_word, u32 *burst_code, u32 *threshold); #endif /* SPI_PXA2XX_H */
/* Parse a printf-style format string. Copyright (C) 1986-2015 Free Software Foundation, 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/>. */ #if defined(__MINGW32__) && !defined(PRINTF_HAS_LONG_LONG) # define USE_PRINTF_I64 1 # define PRINTF_HAS_LONG_LONG #else # define USE_PRINTF_I64 0 #endif /* The argclass represents the general type of data that goes with a format directive; int_arg for %d, long_arg for %l, and so forth. Note that these primarily distinguish types by size and need for special handling, so for instance %u and %x are (at present) also classed as int_arg. */ enum argclass { literal_piece, int_arg, long_arg, long_long_arg, ptr_arg, string_arg, wide_string_arg, wide_char_arg, double_arg, long_double_arg, decfloat_arg }; /* A format piece is a section of the format string that may include a single print directive somewhere in it, and the associated class for the argument. */ struct format_piece { char *string; enum argclass argclass; }; /* Return an array of printf fragments found at the given string, and rewrite ARG with a pointer to the end of the format string. */ extern struct format_piece *parse_format_string (const char **arg); /* Given a pointer to an array of format pieces, free any memory that would have been allocated by parse_format_string. */ extern void free_format_pieces (struct format_piece *frags); /* Freeing, cast as a cleanup. */ extern void free_format_pieces_cleanup (void *);
/* * %CopyrightBegin% * * Copyright Ericsson AB 1998-2009. 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. * * %CopyrightEnd% * */ #include <stdlib.h> #include "rmod_random__s.h" rmod_random_produce__rs* rmod_random_produce__cb(rmod_random oe_obj, double *rs, CORBA_Environment *oe_env) { *rs = (double) rand(); return (rmod_random_produce__rs*) NULL; } rmod_random_init__rs* rmod_random_init__cb(rmod_random oe_obj, long* seed1, long* seed2, long* seed3, CORBA_Environment *oe_env) { srand(*seed1 * *seed2 * *seed3); return (rmod_random_init__rs*) NULL; }
#include "qemu-common.h" #include "qemu/timer.h" void qemu_clock_warp(QEMUClock *clock) { }
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_ARM_IRQ_H #define __ASM_ARM_IRQ_H #define NR_IRQS_LEGACY 16 #ifndef CONFIG_SPARSE_IRQ #include <mach/irqs.h> #else #define NR_IRQS NR_IRQS_LEGACY #endif #ifndef irq_canonicalize #define irq_canonicalize(i) (i) #endif /* * Use this value to indicate lack of interrupt * capability */ #ifndef NO_IRQ #define NO_IRQ ((unsigned int)(-1)) #endif #ifndef __ASSEMBLY__ struct irqaction; struct pt_regs; extern void migrate_irqs(void); extern void asm_do_IRQ(unsigned int, struct pt_regs *); void handle_IRQ(unsigned int, struct pt_regs *); void init_IRQ(void); #ifdef CONFIG_SMP extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self); #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace #endif static inline int nr_legacy_irqs(void) { return NR_IRQS_LEGACY; } #endif #endif
#include <projects.h> /* meridinal distance for ellipsoid and inverse ** 8th degree - accurate to < 1e-5 meters when used in conjuction ** with typical major axis values. ** Inverse determines phi to EPS (1e-11) radians, about 1e-6 seconds. */ #define C00 1. #define C02 .25 #define C04 .046875 #define C06 .01953125 #define C08 .01068115234375 #define C22 .75 #define C44 .46875 #define C46 .01302083333333333333 #define C48 .00712076822916666666 #define C66 .36458333333333333333 #define C68 .00569661458333333333 #define C88 .3076171875 #define EPS 1e-11 #define MAX_ITER 10 #define EN_SIZE 5 double * pj_enfn(double es) { double t, *en; if ((en = (double *)pj_malloc(EN_SIZE * sizeof(double))) != NULL) { en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08))); en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08))); en[2] = (t = es * es) * (C44 - es * (C46 + es * C48)); en[3] = (t *= es) * (C66 - es * C68); en[4] = t * es * C88; } /* else return NULL if unable to allocate memory */ return en; } double pj_mlfn(double phi, double sphi, double cphi, double *en) { cphi *= sphi; sphi *= sphi; return(en[0] * phi - cphi * (en[1] + sphi*(en[2] + sphi*(en[3] + sphi*en[4])))); } double pj_inv_mlfn(projCtx ctx, double arg, double es, double *en) { double s, t, phi, k = 1./(1.-es); int i; phi = arg; for (i = MAX_ITER; i ; --i) { /* rarely goes over 2 iterations */ s = sin(phi); t = 1. - es * s * s; phi -= t = (pj_mlfn(phi, s, cos(phi), en) - arg) * (t * sqrt(t)) * k; if (fabs(t) < EPS) return phi; } pj_ctx_set_errno( ctx, -17 ); return phi; }
/* 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_GRAPH_COLORS_H_ #define TENSORFLOW_CORE_GRAPH_COLORS_H_ namespace tensorflow { // Return a color drawn from a palette to represent an entity // identified by "i". The return value has the form "#RRGGBB" Note // that the palette has a limited set of colors and therefore colors // will be reused eventually. const char* ColorFor(int dindex); } // namespace tensorflow #endif // TENSORFLOW_CORE_GRAPH_COLORS_H_
/* * arch/arm/mach-tegra/e1853/board-e1853.h * * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _MACH_TEGRA_BOARD_E1853_H #define _MACH_TEGRA_BOARD_E1853_H int e1853_sdhci_init(void); int e1853_pinmux_init(void); int e1853_panel_init(void); int e1853_gpio_init(void); int e1853_pins_state_init(void); int e1853_suspend_init(void); int e1853_regulator_init(void); /* External peripheral act as gpio */ /* TPS6591x GPIOs */ #define TPS6591X_GPIO_BASE TEGRA_NR_GPIOS #define TPS6591X_GPIO_0 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP0) #define TPS6591X_GPIO_1 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP1) #define TPS6591X_GPIO_2 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP2) #define TPS6591X_GPIO_3 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP3) #define TPS6591X_GPIO_4 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP4) #define TPS6591X_GPIO_5 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP5) #define TPS6591X_GPIO_6 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP6) #define TPS6591X_GPIO_7 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP7) #define TPS6591X_GPIO_8 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP8) #define TPS6591X_GPIO_END (TPS6591X_GPIO_BASE + TPS6591X_GPIO_NR) #define TPS6591X_IRQ_BASE TEGRA_NR_IRQS #define TPS6591X_IRQ_END (TPS6591X_IRQ_BASE + 18) #ifdef CONFIG_TOUCHSCREEN_ATMEL_MXT #define TOUCH_GPIO_IRQ_ATMEL_T9 TEGRA_GPIO_PEE1 #define TOUCH_GPIO_RST_ATMEL_T9 TEGRA_GPIO_PR2 #define TOUCH_BUS_ATMEL_T9 0 #endif #endif
/* * xfrm6_state.c: based on xfrm4_state.c * * Authors: * Mitsuru KANDA @USAGI * Kazunori MIYAZAWA @USAGI * Kunihiro Ishiguro <kunihiro@ipinfusion.com> * IPv6 support * YOSHIFUJI Hideaki @USAGI * Split up af-specific portion * */ #include <net/xfrm.h> #include <linux/pfkeyv2.h> #include <linux/ipsec.h> #include <net/ipv6.h> #include <net/addrconf.h> static struct xfrm_state_afinfo xfrm6_state_afinfo; static void __xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl, struct xfrm_tmpl *tmpl, xfrm_address_t *daddr, xfrm_address_t *saddr) { /* Initialize temporary selector matching only * to current session. */ ipv6_addr_copy((struct in6_addr *)&x->sel.daddr, &fl->fl6_dst); ipv6_addr_copy((struct in6_addr *)&x->sel.saddr, &fl->fl6_src); x->sel.dport = xfrm_flowi_dport(fl); x->sel.dport_mask = htons(0xffff); x->sel.sport = xfrm_flowi_sport(fl); x->sel.sport_mask = htons(0xffff); x->sel.prefixlen_d = 128; x->sel.prefixlen_s = 128; x->sel.proto = fl->proto; x->sel.ifindex = fl->oif; x->id = tmpl->id; if (ipv6_addr_any((struct in6_addr*)&x->id.daddr)) memcpy(&x->id.daddr, daddr, sizeof(x->sel.daddr)); memcpy(&x->props.saddr, &tmpl->saddr, sizeof(x->props.saddr)); if (ipv6_addr_any((struct in6_addr*)&x->props.saddr)) memcpy(&x->props.saddr, saddr, sizeof(x->props.saddr)); x->props.mode = tmpl->mode; x->props.reqid = tmpl->reqid; x->props.family = AF_INET6; } static int __xfrm6_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n) { int i; int j = 0; /* Rule 1: select IPsec transport except AH */ for (i = 0; i < n; i++) { if (src[i]->props.mode == XFRM_MODE_TRANSPORT && src[i]->id.proto != IPPROTO_AH) { dst[j++] = src[i]; src[i] = NULL; } } if (j == n) goto end; /* Rule 2: select MIPv6 RO or inbound trigger */ #ifdef CONFIG_IPV6_MIP6 for (i = 0; i < n; i++) { if (src[i] && (src[i]->props.mode == XFRM_MODE_ROUTEOPTIMIZATION || src[i]->props.mode == XFRM_MODE_IN_TRIGGER)) { dst[j++] = src[i]; src[i] = NULL; } } if (j == n) goto end; #endif /* Rule 3: select IPsec transport AH */ for (i = 0; i < n; i++) { if (src[i] && src[i]->props.mode == XFRM_MODE_TRANSPORT && src[i]->id.proto == IPPROTO_AH) { dst[j++] = src[i]; src[i] = NULL; } } if (j == n) goto end; /* Rule 4: select IPsec tunnel */ for (i = 0; i < n; i++) { if (src[i] && src[i]->props.mode == XFRM_MODE_TUNNEL) { dst[j++] = src[i]; src[i] = NULL; } } if (likely(j == n)) goto end; /* Final rule */ for (i = 0; i < n; i++) { if (src[i]) { dst[j++] = src[i]; src[i] = NULL; } } end: return 0; } static int __xfrm6_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n) { int i; int j = 0; /* Rule 1: select IPsec transport */ for (i = 0; i < n; i++) { if (src[i]->mode == XFRM_MODE_TRANSPORT) { dst[j++] = src[i]; src[i] = NULL; } } if (j == n) goto end; /* Rule 2: select MIPv6 RO or inbound trigger */ #ifdef CONFIG_IPV6_MIP6 for (i = 0; i < n; i++) { if (src[i] && (src[i]->mode == XFRM_MODE_ROUTEOPTIMIZATION || src[i]->mode == XFRM_MODE_IN_TRIGGER)) { dst[j++] = src[i]; src[i] = NULL; } } if (j == n) goto end; #endif /* Rule 3: select IPsec tunnel */ for (i = 0; i < n; i++) { if (src[i] && src[i]->mode == XFRM_MODE_TUNNEL) { dst[j++] = src[i]; src[i] = NULL; } } if (likely(j == n)) goto end; /* Final rule */ for (i = 0; i < n; i++) { if (src[i]) { dst[j++] = src[i]; src[i] = NULL; } } end: return 0; } static struct xfrm_state_afinfo xfrm6_state_afinfo = { .family = AF_INET6, .init_tempsel = __xfrm6_init_tempsel, .tmpl_sort = __xfrm6_tmpl_sort, .state_sort = __xfrm6_state_sort, .output = xfrm6_output, }; void __init xfrm6_state_init(void) { xfrm_state_register_afinfo(&xfrm6_state_afinfo); } void xfrm6_state_fini(void) { xfrm_state_unregister_afinfo(&xfrm6_state_afinfo); }
/* { dg-require-effective-target vect_int } */ #include <stdarg.h> #include "tree-vect.h" #define N 32 unsigned int out[N*8]; unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; __attribute__ ((noinline)) int main1 (int dummy) { int i; unsigned int *pin = &in[0]; unsigned int *pout = &out[0]; for (i = 0; i < N; i++) { *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; /* Avoid loop vectorization. */ if (dummy == 32) abort (); } /* check results: */ for (i = 0; i < N; i++) { if (out[i*8] != in[i*8] || out[i*8 + 1] != in[i*8 + 1] || out[i*8 + 2] != in[i*8 + 2] || out[i*8 + 3] != in[i*8 + 3] || out[i*8 + 4] != in[i*8 + 4] || out[i*8 + 5] != in[i*8 + 5] || out[i*8 + 6] != in[i*8 + 6] || out[i*8 + 7] != in[i*8 + 7]) abort (); } return 0; } int main (void) { check_vect (); main1 (33); return 0; } /* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */ /* { dg-final { cleanup-tree-dump "slp" } } */
//****************************************************************************** // // Copyright (c) 2015 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // 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. // //****************************************************************************** // WindowsApplicationModelAppointmentsAppointmentsProvider.h // Generated from winmd2objc #pragma once #include "interopBase.h" @class WAAAAppointmentsProviderLaunchActionVerbs, WAAAAddAppointmentOperation, WAAAReplaceAppointmentOperation, WAAARemoveAppointmentOperation; @protocol WAAAIAppointmentsProviderLaunchActionVerbsStatics, WAAAIAddAppointmentOperation, WAAAIReplaceAppointmentOperation, WAAAIRemoveAppointmentOperation; #include "WindowsApplicationModelAppointments.h" #include "WindowsFoundation.h" // Windows.ApplicationModel.Appointments.AppointmentsProvider.AppointmentsProviderLaunchActionVerbs #ifndef __WAAAAppointmentsProviderLaunchActionVerbs_DEFINED__ #define __WAAAAppointmentsProviderLaunchActionVerbs_DEFINED__ WINRT_EXPORT @interface WAAAAppointmentsProviderLaunchActionVerbs : RTObject + (NSString *)addAppointment; + (NSString *)removeAppointment; + (NSString *)replaceAppointment; + (NSString *)showTimeFrame; @end #endif // __WAAAAppointmentsProviderLaunchActionVerbs_DEFINED__ // Windows.ApplicationModel.Appointments.AppointmentsProvider.AddAppointmentOperation #ifndef __WAAAAddAppointmentOperation_DEFINED__ #define __WAAAAddAppointmentOperation_DEFINED__ WINRT_EXPORT @interface WAAAAddAppointmentOperation : RTObject @property (readonly) WAAAppointment * appointmentInformation; @property (readonly) NSString * sourcePackageFamilyName; - (void)reportCompleted:(NSString *)itemId; - (void)reportCanceled; - (void)reportError:(NSString *)value; - (void)dismissUI; @end #endif // __WAAAAddAppointmentOperation_DEFINED__ // Windows.ApplicationModel.Appointments.AppointmentsProvider.ReplaceAppointmentOperation #ifndef __WAAAReplaceAppointmentOperation_DEFINED__ #define __WAAAReplaceAppointmentOperation_DEFINED__ WINRT_EXPORT @interface WAAAReplaceAppointmentOperation : RTObject @property (readonly) NSString * appointmentId; @property (readonly) WAAAppointment * appointmentInformation; @property (readonly) WFDateTime * instanceStartDate; @property (readonly) NSString * sourcePackageFamilyName; - (void)reportCompleted:(NSString *)itemId; - (void)reportCanceled; - (void)reportError:(NSString *)value; - (void)dismissUI; @end #endif // __WAAAReplaceAppointmentOperation_DEFINED__ // Windows.ApplicationModel.Appointments.AppointmentsProvider.RemoveAppointmentOperation #ifndef __WAAARemoveAppointmentOperation_DEFINED__ #define __WAAARemoveAppointmentOperation_DEFINED__ WINRT_EXPORT @interface WAAARemoveAppointmentOperation : RTObject @property (readonly) NSString * appointmentId; @property (readonly) WFDateTime * instanceStartDate; @property (readonly) NSString * sourcePackageFamilyName; - (void)reportCompleted; - (void)reportCanceled; - (void)reportError:(NSString *)value; - (void)dismissUI; @end #endif // __WAAARemoveAppointmentOperation_DEFINED__
// Copyright 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 SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ #define SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ #include <string> #include "base/values.h" #include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" namespace syncer{ enum SyncProtocolErrorType { // Success case. SYNC_SUCCESS, // Birthday does not match that of the server. NOT_MY_BIRTHDAY, // Server is busy. Try later. THROTTLED, // Clear user data is being currently executed by the server. CLEAR_PENDING, // Server cannot service the request now. TRANSIENT_ERROR, // Server does not wish the client to retry any more until the action has // been taken. NON_RETRIABLE_ERROR, // Indicates the datatypes have been migrated and the client should resync // them to get the latest progress markers. MIGRATION_DONE, // Invalid Credential. INVALID_CREDENTIAL, // An administrator disabled sync for this domain. DISABLED_BY_ADMIN, // Client told to stop syncing this device and roll back local data. USER_ROLLBACK, // The default value. UNKNOWN_ERROR }; enum ClientAction { // Upgrade the client to latest version. UPGRADE_CLIENT, // Clear user data and setup sync again. CLEAR_USER_DATA_AND_RESYNC, // Set the bit on the account to enable sync. ENABLE_SYNC_ON_ACCOUNT, // Stop sync and restart sync. STOP_AND_RESTART_SYNC, // Wipe this client of any sync data. DISABLE_SYNC_ON_CLIENT, // Account is disabled by admin. Stop sync, clear prefs and show message on // settings page that account is disabled. STOP_SYNC_FOR_DISABLED_ACCOUNT, // Disable sync and roll back local model to pre-sync state. DISABLE_SYNC_AND_ROLLBACK, // Generated by SyncRollbackManager to notify ProfileSyncService that // rollback is finished. ROLLBACK_DONE, // The default. No action. UNKNOWN_ACTION }; struct SYNC_EXPORT SyncProtocolError { SyncProtocolErrorType error_type; std::string error_description; std::string url; ClientAction action; ModelTypeSet error_data_types; SyncProtocolError(); ~SyncProtocolError(); base::DictionaryValue* ToValue() const; }; SYNC_EXPORT const char* GetSyncErrorTypeString(SyncProtocolErrorType type); SYNC_EXPORT const char* GetClientActionString(ClientAction action); } // namespace syncer #endif // SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_
/* * Copyright (C) 2012 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 ANDROID_AUDIO_PIPE_H #define ANDROID_AUDIO_PIPE_H #include "NBAIO.h" namespace android { // Pipe is multi-thread safe for readers (see PipeReader), but safe for only a single writer thread. // It cannot UNDERRUN on write, unless we allow designation of a master reader that provides the // time-base. Readers can be added and removed dynamically, and it's OK to have no readers. class Pipe : public NBAIO_Sink { friend class PipeReader; public: // maxFrames will be rounded up to a power of 2, and all slots are available. Must be >= 2. Pipe(size_t maxFrames, NBAIO_Format format); virtual ~Pipe(); // NBAIO_Port interface //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, // NBAIO_Format counterOffers[], size_t& numCounterOffers); //virtual NBAIO_Format format() const; // NBAIO_Sink interface //virtual size_t framesWritten() const; //virtual size_t framesUnderrun() const; //virtual size_t underruns() const; // The write side of a pipe permits overruns; flow control is the caller's responsibility. // It doesn't return +infinity because that would guarantee an overrun. virtual ssize_t availableToWrite() const { return mMaxFrames; } virtual ssize_t write(const void *buffer, size_t count); //virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block); private: const size_t mMaxFrames; // always a power of 2 void * const mBuffer; volatile int32_t mRear; // written by android_atomic_release_store volatile int32_t mReaders; // number of PipeReader clients currently attached to this Pipe }; } // namespace android #endif // ANDROID_AUDIO_PIPE_H
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MOJO_PUBLIC_C_GLES2_GLES2_TYPES_H_ #define MOJO_PUBLIC_C_GLES2_GLES2_TYPES_H_ // Note: This header should be compilable as C. #include <stdint.h> #include "mojo/public/c/gles2/gles2_export.h" #ifdef __cplusplus extern "C" { #endif typedef struct MojoGLES2ContextPrivate* MojoGLES2Context; typedef void (*MojoGLES2ContextLost)(void* closure); #ifdef __cplusplus } // extern "C" #endif #endif // MOJO_PUBLIC_C_GLES2_GLES2_TYPES_H_
/* * Copyright (c) 2010 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef SWAPYV12_BUFFER_H #define SWAPYV12_BUFFER_H #include "vpx_scale/yv12config.h" void vp8_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame, YV12_BUFFER_CONFIG *last_frame); #endif
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * SLIM core rproc driver header * * Copyright (C) 2016 STMicroelectronics * * Author: Peter Griffin <peter.griffin@linaro.org> */ #ifndef _ST_REMOTEPROC_SLIM_H #define _ST_REMOTEPROC_SLIM_H #define ST_SLIM_MEM_MAX 2 #define ST_SLIM_MAX_CLK 4 enum { ST_SLIM_DMEM, ST_SLIM_IMEM, }; /** * struct st_slim_mem - slim internal memory structure * @cpu_addr: MPU virtual address of the memory region * @bus_addr: Bus address used to access the memory region * @size: Size of the memory region */ struct st_slim_mem { void __iomem *cpu_addr; phys_addr_t bus_addr; size_t size; }; /** * struct st_slim_rproc - SLIM slim core * @rproc: rproc handle * @mem: slim memory information * @slimcore: slim slimcore regs * @peri: slim peripheral regs * @clks: slim clocks */ struct st_slim_rproc { struct rproc *rproc; struct st_slim_mem mem[ST_SLIM_MEM_MAX]; void __iomem *slimcore; void __iomem *peri; /* st_slim_rproc private */ struct clk *clks[ST_SLIM_MAX_CLK]; }; struct st_slim_rproc *st_slim_rproc_alloc(struct platform_device *pdev, char *fw_name); void st_slim_rproc_put(struct st_slim_rproc *slim_rproc); #endif
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Linux driver for M2Tech hiFace compatible devices * * Copyright 2012-2013 (C) M2TECH S.r.l and Amarula Solutions B.V. * * Authors: Michael Trimarchi <michael@amarulasolutions.com> * Antonio Ospite <ao2@amarulasolutions.com> * * The driver is based on the work done in TerraTec DMX 6Fire USB */ #ifndef HIFACE_CHIP_H #define HIFACE_CHIP_H #include <linux/usb.h> #include <sound/core.h> struct pcm_runtime; struct hiface_chip { struct usb_device *dev; struct snd_card *card; struct pcm_runtime *pcm; }; #endif /* HIFACE_CHIP_H */
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* NXP TDA10048HN DVB OFDM demodulator driver Copyright (C) 2009 Steven Toth <stoth@kernellabs.com> */ #ifndef TDA10048_H #define TDA10048_H #include <linux/dvb/frontend.h> #include <linux/firmware.h> struct tda10048_config { /* the demodulator's i2c address */ u8 demod_address; /* serial/parallel output */ #define TDA10048_PARALLEL_OUTPUT 0 #define TDA10048_SERIAL_OUTPUT 1 u8 output_mode; #define TDA10048_BULKWRITE_200 200 #define TDA10048_BULKWRITE_50 50 u8 fwbulkwritelen; /* Spectral Inversion */ #define TDA10048_INVERSION_OFF 0 #define TDA10048_INVERSION_ON 1 u8 inversion; #define TDA10048_IF_3300 3300 #define TDA10048_IF_3500 3500 #define TDA10048_IF_3800 3800 #define TDA10048_IF_4000 4000 #define TDA10048_IF_4300 4300 #define TDA10048_IF_4500 4500 #define TDA10048_IF_4750 4750 #define TDA10048_IF_5000 5000 #define TDA10048_IF_36130 36130 u16 dtv6_if_freq_khz; u16 dtv7_if_freq_khz; u16 dtv8_if_freq_khz; #define TDA10048_CLK_4000 4000 #define TDA10048_CLK_16000 16000 u16 clk_freq_khz; /* Disable I2C gate access */ u8 disable_gate_access; bool no_firmware; bool set_pll; u8 pll_m; u8 pll_p; u8 pll_n; }; #if IS_REACHABLE(CONFIG_DVB_TDA10048) extern struct dvb_frontend *tda10048_attach( const struct tda10048_config *config, struct i2c_adapter *i2c); #else static inline struct dvb_frontend *tda10048_attach( const struct tda10048_config *config, struct i2c_adapter *i2c) { printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); return NULL; } #endif /* CONFIG_DVB_TDA10048 */ #endif /* TDA10048_H */
/* * (C) Copyright 2006 * Markus Klotzbuecher, DENX Software Engineering <mk@denx.de> * * SPDX-License-Identifier: GPL-2.0+ */ #include <common.h> #if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) # if defined(CONFIG_CPU_MONAHANS) || defined(CONFIG_CPU_PXA27X) #include <asm/arch/pxa-regs.h> #include <asm/io.h> #include <usb.h> int usb_cpu_init(void) { #if defined(CONFIG_CPU_MONAHANS) /* Enable USB host clock. */ writel(readl(CKENA) | CKENA_2_USBHOST | CKENA_20_UDC, CKENA); udelay(100); #endif #if defined(CONFIG_CPU_PXA27X) /* Enable USB host clock. */ writel(readl(CKEN) | CKEN10_USBHOST, CKEN); #endif #if defined(CONFIG_CPU_MONAHANS) /* Configure Port 2 for Host (USB Client Registers) */ writel(0x3000c, UP2OCR); #endif writel(readl(UHCHR) | UHCHR_FHR, UHCHR); mdelay(11); writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR); writel(readl(UHCHR) | UHCHR_FSBIR, UHCHR); while (readl(UHCHR) & UHCHR_FSBIR) udelay(1); #if defined(CONFIG_CPU_MONAHANS) || defined(CONFIG_PXA27X) writel(readl(UHCHR) & ~UHCHR_SSEP0, UHCHR); #endif #if defined(CONFIG_CPU_PXA27X) writel(readl(UHCHR) & ~UHCHR_SSEP2, UHCHR); #endif writel(readl(UHCHR) & ~(UHCHR_SSEP1 | UHCHR_SSE), UHCHR); return 0; } int usb_cpu_stop(void) { writel(readl(UHCHR) | UHCHR_FHR, UHCHR); udelay(11); writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR); writel(readl(UHCCOMS) | UHCCOMS_HCR, UHCCOMS); udelay(10); #if defined(CONFIG_CPU_MONAHANS) || defined(CONFIG_PXA27X) writel(readl(UHCHR) | UHCHR_SSEP0, UHCHR); #endif #if defined(CONFIG_CPU_PXA27X) writel(readl(UHCHR) | UHCHR_SSEP2, UHCHR); #endif writel(readl(UHCHR) | UHCHR_SSEP1 | UHCHR_SSE, UHCHR); #if defined(CONFIG_CPU_MONAHANS) /* Disable USB host clock. */ writel(readl(CKENA) & ~(CKENA_2_USBHOST | CKENA_20_UDC), CKENA); udelay(100); #endif #if defined(CONFIG_CPU_PXA27X) /* Disable USB host clock. */ writel(readl(CKEN) & ~CKEN10_USBHOST, CKEN); #endif return 0; } int usb_cpu_init_fail(void) { return usb_cpu_stop(); } # endif /* defined(CONFIG_CPU_MONAHANS) || defined(CONFIG_CPU_PXA27X) */ #endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */
// Copyright 2016 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. // ----------------------------------------------------------------------------- // // MSA variant of Image transform methods for lossless encoder. // // Authors: Prashant Patil (Prashant.Patil@imgtec.com) #include "./dsp.h" #if defined(WEBP_USE_MSA) #include "./lossless.h" #include "./msa_macro.h" #define TRANSFORM_COLOR_8(src0, src1, dst0, dst1, c0, c1, mask0, mask1) do { \ v8i16 g0, g1, t0, t1, t2, t3; \ v4i32 t4, t5; \ VSHF_B2_SH(src0, src0, src1, src1, mask0, mask0, g0, g1); \ DOTP_SB2_SH(g0, g1, c0, c0, t0, t1); \ SRAI_H2_SH(t0, t1, 5); \ t0 = __msa_subv_h((v8i16)src0, t0); \ t1 = __msa_subv_h((v8i16)src1, t1); \ t4 = __msa_srli_w((v4i32)src0, 16); \ t5 = __msa_srli_w((v4i32)src1, 16); \ DOTP_SB2_SH(t4, t5, c1, c1, t2, t3); \ SRAI_H2_SH(t2, t3, 5); \ SUB2(t0, t2, t1, t3, t0, t1); \ VSHF_B2_UB(src0, t0, src1, t1, mask1, mask1, dst0, dst1); \ } while (0) #define TRANSFORM_COLOR_4(src, dst, c0, c1, mask0, mask1) do { \ const v16i8 g0 = VSHF_SB(src, src, mask0); \ v8i16 t0 = __msa_dotp_s_h(c0, g0); \ v8i16 t1; \ v4i32 t2; \ t0 = SRAI_H(t0, 5); \ t0 = __msa_subv_h((v8i16)src, t0); \ t2 = __msa_srli_w((v4i32)src, 16); \ t1 = __msa_dotp_s_h(c1, (v16i8)t2); \ t1 = SRAI_H(t1, 5); \ t0 = t0 - t1; \ dst = VSHF_UB(src, t0, mask1); \ } while (0) static void TransformColor(const VP8LMultipliers* const m, uint32_t* data, int num_pixels) { v16u8 src0, dst0; const v16i8 g2br = (v16i8)__msa_fill_w(m->green_to_blue_ | (m->green_to_red_ << 16)); const v16i8 r2b = (v16i8)__msa_fill_w(m->red_to_blue_); const v16u8 mask0 = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, 13, 255, 13, 255 }; const v16u8 mask1 = { 16, 1, 18, 3, 20, 5, 22, 7, 24, 9, 26, 11, 28, 13, 30, 15 }; while (num_pixels >= 8) { v16u8 src1, dst1; LD_UB2(data, 4, src0, src1); TRANSFORM_COLOR_8(src0, src1, dst0, dst1, g2br, r2b, mask0, mask1); ST_UB2(dst0, dst1, data, 4); data += 8; num_pixels -= 8; } if (num_pixels > 0) { if (num_pixels >= 4) { src0 = LD_UB(data); TRANSFORM_COLOR_4(src0, dst0, g2br, r2b, mask0, mask1); ST_UB(dst0, data); data += 4; num_pixels -= 4; } if (num_pixels > 0) { src0 = LD_UB(data); TRANSFORM_COLOR_4(src0, dst0, g2br, r2b, mask0, mask1); if (num_pixels == 3) { const uint64_t pix_d = __msa_copy_s_d((v2i64)dst0, 0); const uint32_t pix_w = __msa_copy_s_w((v4i32)dst0, 2); SD(pix_d, data + 0); SW(pix_w, data + 2); } else if (num_pixels == 2) { const uint64_t pix_d = __msa_copy_s_d((v2i64)dst0, 0); SD(pix_d, data); } else { const uint32_t pix_w = __msa_copy_s_w((v4i32)dst0, 0); SW(pix_w, data); } } } } static void SubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixels) { int i; uint8_t* ptemp_data = (uint8_t*)argb_data; v16u8 src0, dst0, tmp0; const v16u8 mask = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, 13, 255, 13, 255 }; while (num_pixels >= 8) { v16u8 src1, dst1, tmp1; LD_UB2(ptemp_data, 16, src0, src1); VSHF_B2_UB(src0, src1, src1, src0, mask, mask, tmp0, tmp1); SUB2(src0, tmp0, src1, tmp1, dst0, dst1); ST_UB2(dst0, dst1, ptemp_data, 16); ptemp_data += 8 * 4; num_pixels -= 8; } if (num_pixels > 0) { if (num_pixels >= 4) { src0 = LD_UB(ptemp_data); tmp0 = VSHF_UB(src0, src0, mask); dst0 = src0 - tmp0; ST_UB(dst0, ptemp_data); ptemp_data += 4 * 4; num_pixels -= 4; } for (i = 0; i < num_pixels; i++) { const uint8_t b = ptemp_data[0]; const uint8_t g = ptemp_data[1]; const uint8_t r = ptemp_data[2]; ptemp_data[0] = (b - g) & 0xff; ptemp_data[2] = (r - g) & 0xff; ptemp_data += 4; } } } //------------------------------------------------------------------------------ // Entry point extern void VP8LEncDspInitMSA(void); WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitMSA(void) { VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed; VP8LTransformColor = TransformColor; } #else // !WEBP_USE_MSA WEBP_DSP_INIT_STUB(VP8LEncDspInitMSA) #endif // WEBP_USE_MSA
/* SPDX-License-Identifier: GPL-2.0-only */ /* * AppArmor security module * * This file contains AppArmor basic path manipulation function definitions. * * Copyright (C) 1998-2008 Novell/SUSE * Copyright 2009-2010 Canonical Ltd. */ #ifndef __AA_PATH_H #define __AA_PATH_H enum path_flags { PATH_IS_DIR = 0x1, /* path is a directory */ PATH_CONNECT_PATH = 0x4, /* connect disconnected paths to / */ PATH_CHROOT_REL = 0x8, /* do path lookup relative to chroot */ PATH_CHROOT_NSCONNECT = 0x10, /* connect paths that are at ns root */ PATH_DELEGATE_DELETED = 0x08000, /* delegate deleted files */ PATH_MEDIATE_DELETED = 0x10000, /* mediate deleted paths */ }; int aa_path_name(const struct path *path, int flags, char *buffer, const char **name, const char **info, const char *disconnected); #define MAX_PATH_BUFFERS 2 /* Per cpu buffers used during mediation */ /* preallocated buffers to use during path lookups */ struct aa_buffers { char *buf[MAX_PATH_BUFFERS]; }; #include <linux/percpu.h> #include <linux/preempt.h> DECLARE_PER_CPU(struct aa_buffers, aa_buffers); #define ASSIGN(FN, A, X, N) ((X) = FN(A, N)) #define EVAL1(FN, A, X) ASSIGN(FN, A, X, 0) /*X = FN(0)*/ #define EVAL2(FN, A, X, Y...) \ do { ASSIGN(FN, A, X, 1); EVAL1(FN, A, Y); } while (0) #define EVAL(FN, A, X...) CONCATENATE(EVAL, COUNT_ARGS(X))(FN, A, X) #define for_each_cpu_buffer(I) for ((I) = 0; (I) < MAX_PATH_BUFFERS; (I)++) #ifdef CONFIG_DEBUG_PREEMPT #define AA_BUG_PREEMPT_ENABLED(X) AA_BUG(preempt_count() <= 0, X) #else #define AA_BUG_PREEMPT_ENABLED(X) /* nop */ #endif #define __get_buffer(C, N) ({ \ AA_BUG_PREEMPT_ENABLED("__get_buffer without preempt disabled"); \ (C)->buf[(N)]; }) #define __get_buffers(C, X...) EVAL(__get_buffer, C, X) #define __put_buffers(X, Y...) ((void)&(X)) #define get_buffers(X...) \ do { \ struct aa_buffers *__cpu_var = get_cpu_ptr(&aa_buffers); \ __get_buffers(__cpu_var, X); \ } while (0) #define put_buffers(X, Y...) \ do { \ __put_buffers(X, Y); \ put_cpu_ptr(&aa_buffers); \ } while (0) #endif /* __AA_PATH_H */
// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2014-2016 Pratyush Anand <panand@redhat.com> */ #include <linux/highmem.h> #include <linux/ptrace.h> #include <linux/uprobes.h> #include <asm/cacheflush.h> #include "decode-insn.h" #define UPROBE_INV_FAULT_CODE UINT_MAX void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, void *src, unsigned long len) { void *xol_page_kaddr = kmap_atomic(page); void *dst = xol_page_kaddr + (vaddr & ~PAGE_MASK); /* Initialize the slot */ memcpy(dst, src, len); /* flush caches (dcache/icache) */ sync_icache_aliases(dst, len); kunmap_atomic(xol_page_kaddr); } unsigned long uprobe_get_swbp_addr(struct pt_regs *regs) { return instruction_pointer(regs); } int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long addr) { probe_opcode_t insn; /* TODO: Currently we do not support AARCH32 instruction probing */ if (mm->context.flags & MMCF_AARCH32) return -EOPNOTSUPP; else if (!IS_ALIGNED(addr, AARCH64_INSN_SIZE)) return -EINVAL; insn = *(probe_opcode_t *)(&auprobe->insn[0]); switch (arm_probe_decode_insn(insn, &auprobe->api)) { case INSN_REJECTED: return -EINVAL; case INSN_GOOD_NO_SLOT: auprobe->simulate = true; break; default: break; } return 0; } int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) { struct uprobe_task *utask = current->utask; /* Initialize with an invalid fault code to detect if ol insn trapped */ current->thread.fault_code = UPROBE_INV_FAULT_CODE; /* Instruction points to execute ol */ instruction_pointer_set(regs, utask->xol_vaddr); user_enable_single_step(current); return 0; } int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) { struct uprobe_task *utask = current->utask; WARN_ON_ONCE(current->thread.fault_code != UPROBE_INV_FAULT_CODE); /* Instruction points to execute next to breakpoint address */ instruction_pointer_set(regs, utask->vaddr + 4); user_disable_single_step(current); return 0; } bool arch_uprobe_xol_was_trapped(struct task_struct *t) { /* * Between arch_uprobe_pre_xol and arch_uprobe_post_xol, if an xol * insn itself is trapped, then detect the case with the help of * invalid fault code which is being set in arch_uprobe_pre_xol */ if (t->thread.fault_code != UPROBE_INV_FAULT_CODE) return true; return false; } bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) { probe_opcode_t insn; unsigned long addr; if (!auprobe->simulate) return false; insn = *(probe_opcode_t *)(&auprobe->insn[0]); addr = instruction_pointer(regs); if (auprobe->api.handler) auprobe->api.handler(insn, addr, regs); return true; } void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) { struct uprobe_task *utask = current->utask; /* * Task has received a fatal signal, so reset back to probbed * address. */ instruction_pointer_set(regs, utask->vaddr); user_disable_single_step(current); } bool arch_uretprobe_is_alive(struct return_instance *ret, enum rp_check ctx, struct pt_regs *regs) { /* * If a simple branch instruction (B) was called for retprobed * assembly label then return true even when regs->sp and ret->stack * are same. It will ensure that cleanup and reporting of return * instances corresponding to callee label is done when * handle_trampoline for called function is executed. */ if (ctx == RP_CHECK_CHAIN_CALL) return regs->sp <= ret->stack; else return regs->sp < ret->stack; } unsigned long arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs *regs) { unsigned long orig_ret_vaddr; orig_ret_vaddr = procedure_link_pointer(regs); /* Replace the return addr with trampoline addr */ procedure_link_pointer_set(regs, trampoline_vaddr); return orig_ret_vaddr; } int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, void *data) { return NOTIFY_DONE; } static int uprobe_breakpoint_handler(struct pt_regs *regs, unsigned int esr) { if (uprobe_pre_sstep_notifier(regs)) return DBG_HOOK_HANDLED; return DBG_HOOK_ERROR; } static int uprobe_single_step_handler(struct pt_regs *regs, unsigned int esr) { struct uprobe_task *utask = current->utask; WARN_ON(utask && (instruction_pointer(regs) != utask->xol_vaddr + 4)); if (uprobe_post_sstep_notifier(regs)) return DBG_HOOK_HANDLED; return DBG_HOOK_ERROR; } /* uprobe breakpoint handler hook */ static struct break_hook uprobes_break_hook = { .imm = UPROBES_BRK_IMM, .fn = uprobe_breakpoint_handler, }; /* uprobe single step handler hook */ static struct step_hook uprobes_step_hook = { .fn = uprobe_single_step_handler, }; static int __init arch_init_uprobes(void) { register_user_break_hook(&uprobes_break_hook); register_user_step_hook(&uprobes_step_hook); return 0; } device_initcall(arch_init_uprobes);
/*! * \copy * Copyright (c) 2013, Cisco Systems * 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. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #ifndef WELS_DECODE_MB_AUX_H__ #define WELS_DECODE_MB_AUX_H__ #include "typedefs.h" #include "macros.h" namespace WelsDec { void IdctResAddPred_c (uint8_t* pPred, const int32_t kiStride, int16_t* pRs); void IdctResAddPred8x8_c (uint8_t* pPred, const int32_t kiStride, int16_t* pRs); #if defined(__cplusplus) extern "C" { #endif//__cplusplus #if defined(X86_ASM) void IdctResAddPred_mmx (uint8_t* pPred, const int32_t kiStride, int16_t* pRs); #endif//X86_ASM #if defined(HAVE_NEON) void IdctResAddPred_neon (uint8_t* pred, const int32_t stride, int16_t* rs); #endif #if defined(HAVE_NEON_AARCH64) void IdctResAddPred_AArch64_neon (uint8_t* pred, const int32_t stride, int16_t* rs); #endif #if defined(__cplusplus) } #endif//__cplusplus void GetI4LumaIChromaAddrTable (int32_t* pBlockOffset, const int32_t kiYStride, const int32_t kiUVStride); } // namespace WelsDec #endif//WELS_DECODE_MB_AUX_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 Apple Inc. All rights reserved. * * 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 NinePieceImage_h #define NinePieceImage_h #include "LengthBox.h" #include "StyleImage.h" namespace WebCore { enum ENinePieceImageRule { StretchImageRule, RoundImageRule, RepeatImageRule }; class NinePieceImage { public: NinePieceImage() : m_image(0) , m_horizontalRule(StretchImageRule) , m_verticalRule(StretchImageRule) { } NinePieceImage(StyleImage* image, LengthBox slices, ENinePieceImageRule h, ENinePieceImageRule v) : m_image(image) , m_slices(slices) , m_horizontalRule(h) , m_verticalRule(v) { } bool operator==(const NinePieceImage& o) const; bool operator!=(const NinePieceImage& o) const { return !(*this == o); } bool hasImage() const { return m_image != 0; } StyleImage* image() const { return m_image.get(); } void setImage(StyleImage* image) { m_image = image; } const LengthBox& slices() const { return m_slices; } void setSlices(const LengthBox& l) { m_slices = l; } ENinePieceImageRule horizontalRule() const { return static_cast<ENinePieceImageRule>(m_horizontalRule); } void setHorizontalRule(ENinePieceImageRule rule) { m_horizontalRule = rule; } ENinePieceImageRule verticalRule() const { return static_cast<ENinePieceImageRule>(m_verticalRule); } void setVerticalRule(ENinePieceImageRule rule) { m_verticalRule = rule; } private: RefPtr<StyleImage> m_image; LengthBox m_slices; unsigned m_horizontalRule : 2; // ENinePieceImageRule unsigned m_verticalRule : 2; // ENinePieceImageRule }; } // namespace WebCore #endif // NinePieceImage_h
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // /*===================================================================== ** ** Source: test2.c (FreeLibrary) ** ** Purpose: Tests the PAL implementation of the FreeLibrary function. ** This is a negative test that will pass an invalid and a ** null handle to FreeLibrary. ** ** **===================================================================*/ #include <palsuite.h> int __cdecl main(int argc, char* argv[]) { HANDLE hLib; /* Initialize the PAL. */ if ((PAL_Initialize(argc, argv)) != 0) { return (FAIL); } /* Attempt to pass FreeLibrary an invalid handle. */ hLib = INVALID_HANDLE_VALUE; if (FreeLibrary(hLib)) { Fail("ERROR: Able to free library handle = \"0x%lx\".\n", hLib); } /* Attempt to pass FreeLibrary a NULL handle. */ hLib = NULL; if (FreeLibrary(hLib)) { Fail("ERROR: Able to free library handle = \"NULL\".\n"); } /* Terminate the PAL. */ PAL_Terminate(); return PASS; }
/*========================================================================= Program: Visualization Toolkit Module: vtkPixelBufferObject.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkVertexBufferObject - abstracts an OpenGL vertex buffer object. // .SECTION Description // Provides low-level access to GPU memory. Used to pass raw data to GPU. // The data is uploaded into a vertex buffer. // .SECTION See Also // OpenGL Vertex Buffer Object Extension Spec (ARB_vertex_buffer_object): // http://www.opengl.org/registry/specs/ARB/vertex_buffer_object.txt // .SECTION Caveats // Since most GPUs don't support double format all double data is converted to // float and then uploaded. // DON'T PLAY WITH IT YET. #ifndef __vtkVertexBufferObject_h #define __vtkVertexBufferObject_h #include <vector> #include "vtkObject.h" #include "vtkWeakPointer.h" #include "vtkgl.h" // Needed for gl data types exposed in API #include <pcl/pcl_macros.h> class vtkCellArray; class vtkDataArray; class vtkObject; class vtkPoints; class vtkUnsignedCharArray; class vtkOpenGLExtensionManager; class vtkRenderWindow; class PCL_EXPORTS vtkVertexBufferObject : public vtkObject { public: static vtkVertexBufferObject* New(); vtkTypeMacro(vtkVertexBufferObject, vtkObject); void PrintSelf(ostream& os, vtkIndent indent); // Description: // Get/Set the context. Context must be a vtkOpenGLRenderWindow. // This does not increase the reference count of the // context to avoid reference loops. // SetContext() may raise an error is the OpenGL context does not support the // required OpenGL extensions. void SetContext(vtkRenderWindow* context); vtkRenderWindow* GetContext(); //BTX // Usage values. enum { StreamDraw=0, StreamRead, StreamCopy, StaticDraw, StaticRead, StaticCopy, DynamicDraw, DynamicRead, DynamicCopy, NumberOfUsages }; //ETX // Description: // Usage is a performance hint. // Valid values are: // - StreamDraw specified once by A, used few times S // - StreamRead specified once by R, queried a few times by A // - StreamCopy specified once by R, used a few times S // - StaticDraw specified once by A, used many times S // - StaticRead specificed once by R, queried many times by A // - StaticCopy specified once by R, used many times S // - DynamicDraw respecified repeatedly by A, used many times S // - DynamicRead respecified repeatedly by R, queried many times by A // - DynamicCopy respecified repeatedly by R, used many times S // A: the application // S: as the source for GL drawing and image specification commands. // R: reading data from the GL // Initial value is StaticDraw, as in OpenGL spec. vtkGetMacro(Usage, int); vtkSetMacro(Usage, int); int GetAttributeIndex(); void SetUserDefinedAttribute(int index, bool normalized=false, int stride=0); void ResetUserDefinedAttribute(); void SetAttributeNormalized(bool normalized); // Description: // Set point data bool Upload(vtkPoints *points); // Description: // Set indice data bool Upload(vtkCellArray *verts); // Description: // Set indice data bool Upload(unsigned int *indices, unsigned int count); // Description: // Set color data bool Upload(vtkUnsignedCharArray *colors); // Description: // Set color data bool Upload(vtkDataArray *array); bool Upload(vtkDataArray *array, int attributeType, int arrayType); bool UploadNormals(vtkDataArray *normals); bool UploadColors(vtkDataArray *colors); // Description: // Get the size of the data loaded into the GPU. Size is in the number of // elements of the uploaded Type. vtkGetMacro(Size, unsigned int); // Description: // Get the size of the data loaded into the GPU. Size is in the number of // elements of the uploaded Type. vtkGetMacro(Count, unsigned int); // Description: // Get the openGL buffer handle. vtkGetMacro(Handle, unsigned int); // Description: // Inactivate the buffer. void UnBind(); // Description: // Make the buffer active. void Bind(); // Description: // Allocate the memory. size is in number of bytes. type is a VTK type. // void Allocate(unsigned int size, int type); //BTX // Description: // Release the memory allocated without destroying the PBO handle. void ReleaseMemory(); // Description: // Returns if the context supports the required extensions. static bool IsSupported(vtkRenderWindow* renWin); //ETX //BTX protected: vtkVertexBufferObject(); ~vtkVertexBufferObject(); // Description: // Loads all required OpenGL extensions. Must be called every time a new // context is set. bool LoadRequiredExtensions(vtkOpenGLExtensionManager* mgr); // Description: // Create the pixel buffer object. void CreateBuffer(); // Description: // Destroys the pixel buffer object. void DestroyBuffer(); // Description: // Uploads data to buffer object bool Upload(GLvoid* data); // Description: // Get the openGL buffer handle. vtkGetMacro(ArrayType, unsigned int); int Usage; unsigned int Size; unsigned int Count; unsigned int Handle; unsigned int ArrayType; unsigned int BufferTarget; int AttributeIndex; int AttributeSize; int AttributeType; int AttributeNormalized; int AttributeStride; vtkWeakPointer<vtkRenderWindow> Context; private: vtkVertexBufferObject(const vtkVertexBufferObject&); // Not implemented. void operator=(const vtkVertexBufferObject&); // Not implemented. // Helper to get data type sizes when passing to opengl int GetDataTypeSize(int type); //ETX }; #endif
/* * Copyright 2015 The Etc2Comp Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #ifdef _WIN32 #define ETC_WINDOWS (1) #else #define ETC_WINDOWS (0) #endif #if __APPLE__ #define ETC_OSX (1) #else #define ETC_OSX (0) #endif #if __unix__ #define ETC_UNIX (1) #else #define ETC_UNIX (0) #endif // short names for common types #include <stdint.h> typedef int8_t i8; typedef int16_t i16; typedef int32_t i32; typedef int64_t i64; typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; typedef float f32; typedef double f64; // Keep asserts enabled in release builds during development #undef NDEBUG // 0=disable. stb_image can be used if you need to compress //other image formats like jpg #define USE_STB_IMAGE_LOAD 0 #if ETC_WINDOWS #include <sdkddkver.h> #define _CRT_SECURE_NO_WARNINGS (1) #include <tchar.h> #endif #include <stdio.h>
/* * BMKMapComponent.h * BMKMapComponent * * Copyright 2011 Baidu Inc. All rights reserved. * */ #import "BMKAnnotation.h" #import "BMKAnnotationView.h" #import "BMKMapView.h" #import "BMKOfflineMap.h" #import "BMKOfflineMapType.h" #import "BMKOverlay.h" #import "BMKShape.h" #import "BMKPointAnnotation.h" #import "BMKPinAnnotationView.h" #import "BMKMultiPoint.h" #import "BMKArcline.h" #import "BMKPolyline.h" #import "BMKPolygon.h" #import "BMKCircle.h" #import "BMKOverlayView.h" #import "BMKOverlayPathView.h" #import "BMKOverlayGLBasicView.h" #import "BMKPolygonView.h" #import "BMKPolylineView.h" #import "BMKCircleView.h" #import "BMKArclineView.h" #import "BMKGroundOverlay.h" #import "BMKGroundOverlayView.h" #import "BMKGradient.h"
/* A test for # of iterations estimation. We know that I does not overflow, thus we can perform strength reduction (even though the 32-bit variable i is first extended to 64-bit type). */ /* { dg-options "-O2 -fdump-tree-optimized" } */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ unsigned bar(void); void foo(unsigned *p, unsigned n) { unsigned i; for (i = 0; i < n; i++) p[i] = bar (); } /* Check that the memory reference was replaced with MEM, and that there is no multiplication. */ /* { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } } */ /* { dg-final { scan-tree-dump-times "\[^\\n\\r\]*= \\* " 0 "optimized" } } */
#ifndef _glxcmds_h_ #define _glxcmds_h_ /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to * http://oss.sgi.com/projects/FreeB/ * 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 * SILICON GRAPHICS, INC. 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. * * Except as contained in this notice, the name of Silicon Graphics, Inc. * shall not be used in advertising or otherwise to promote the sale, use or * other dealings in this Software without prior written authorization from * Silicon Graphics, Inc. */ extern void __glXNop(void); /* context helper routines */ extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag); extern DrawablePtr __glXLookupDrawableByTag(__GLXclientState *cl, GLXContextTag tag); #endif /* _glxcmds_h_ */
// Copyright (c) 2011-2015 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_QT_RECEIVECOINSDIALOG_H #define BITCOIN_QT_RECEIVECOINSDIALOG_H #include "guiutil.h" #include <QDialog> #include <QHeaderView> #include <QItemSelection> #include <QKeyEvent> #include <QMenu> #include <QPoint> #include <QVariant> class OptionsModel; class PlatformStyle; class WalletModel; namespace Ui { class ReceiveCoinsDialog; } QT_BEGIN_NAMESPACE class QModelIndex; QT_END_NAMESPACE /** Dialog for requesting payment of bitcoins */ class ReceiveCoinsDialog : public QDialog { Q_OBJECT public: enum ColumnWidths { DATE_COLUMN_WIDTH = 130, LABEL_COLUMN_WIDTH = 120, AMOUNT_MINIMUM_COLUMN_WIDTH = 180, MINIMUM_COLUMN_WIDTH = 130 }; explicit ReceiveCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = 0); ~ReceiveCoinsDialog(); void setModel(WalletModel *model); public Q_SLOTS: void clear(); void reject(); void accept(); protected: virtual void keyPressEvent(QKeyEvent *event); private: Ui::ReceiveCoinsDialog *ui; GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer; WalletModel *model; QMenu *contextMenu; const PlatformStyle *platformStyle; void copyColumnToClipboard(int column); virtual void resizeEvent(QResizeEvent *event); private Q_SLOTS: void on_receiveButton_clicked(); void on_showRequestButton_clicked(); void on_removeRequestButton_clicked(); void on_recentRequestsView_doubleClicked(const QModelIndex &index); void recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); void updateDisplayUnit(); void showMenu(const QPoint &point); void copyLabel(); void copyMessage(); void copyAmount(); }; #endif // BITCOIN_QT_RECEIVECOINSDIALOG_H
#ifdef HAVE_XORG_CONFIG_H #include <xorg-config.h> #endif #include "BT.h" typedef struct { const char *DeviceName; } xf86BTramdacInfo; extern xf86BTramdacInfo BTramdacDeviceInfo[]; #ifdef INIT_BT_RAMDAC_INFO xf86BTramdacInfo BTramdacDeviceInfo[] = { {"AT&T 20C504"}, {"AT&T 20C505"}, {"BT485/484"} }; #endif
/* SDL - Simple DirectMedia Layer Copyright (C) 1997-2006 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Sam Lantinga slouken@libsdl.org */ #include "SDL_config.h" /* This is the definition of the YUV video surface function structure */ #include "SDL_video.h" #include "SDL_sysvideo.h" #ifndef _THIS #define _THIS SDL_VideoDevice *_this #endif struct private_yuvhwfuncs { int (*Lock)(_THIS, SDL_Overlay *overlay); void (*Unlock)(_THIS, SDL_Overlay *overlay); int (*Display)(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst); void (*FreeHW)(_THIS, SDL_Overlay *overlay); };
// Copyright (c) 2006-2008 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_AUTOMATION_AUTOMATION_BROWSER_TRACKER_H__ #define CHROME_BROWSER_AUTOMATION_AUTOMATION_BROWSER_TRACKER_H__ #include "chrome/browser/automation/automation_resource_tracker.h" class Browser; // Tracks Browser objects. class AutomationBrowserTracker : public AutomationResourceTracker<Browser*> { public: explicit AutomationBrowserTracker(IPC::Sender* automation); virtual ~AutomationBrowserTracker(); virtual void AddObserver(Browser* resource); virtual void RemoveObserver(Browser* resource); }; #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_BROWSER_TRACKER_H__
/* { dg-require-effective-target vect_int } */ #include <stdarg.h> #include "tree-vect.h" __attribute__ ((noinline)) void with_restrict(int * __restrict p) { int i; int *q = p - 1; for (i = 0; i < 1000; ++i) { p[i] = q[i]; } } __attribute__ ((noinline)) void without_restrict(int * p) { int i; int *q = p - 1; for (i = 0; i < 1000; ++i) { p[i] = q[i]; } } int main(void) { int i; int a[1002]; int b[1002]; check_vect (); for (i = 0; i < 1002; ++i) { a[i] = b[i] = i; } with_restrict(a + 1); without_restrict(b + 1); for (i = 0; i < 1002; ++i) { if (a[i] != b[i]) abort(); } return 0; } /* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
/* * EAP server/peer: EAP-TTLS (RFC 5281) * Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi> * * This software may be distributed under the terms of the BSD license. * See README for more details. */ #ifndef EAP_TTLS_H #define EAP_TTLS_H struct ttls_avp { be32 avp_code; be32 avp_length; /* 8-bit flags, 24-bit length; * length includes AVP header */ /* optional 32-bit Vendor-ID */ /* Data */ }; struct ttls_avp_vendor { be32 avp_code; be32 avp_length; /* 8-bit flags, 24-bit length; * length includes AVP header */ be32 vendor_id; /* Data */ }; #define AVP_FLAGS_VENDOR 0x80 #define AVP_FLAGS_MANDATORY 0x40 #define AVP_PAD(start, pos) \ do { \ int __pad; \ __pad = (4 - (((pos) - (start)) & 3)) & 3; \ os_memset((pos), 0, __pad); \ pos += __pad; \ } while (0) /* RFC 2865 */ #define RADIUS_ATTR_USER_NAME 1 #define RADIUS_ATTR_USER_PASSWORD 2 #define RADIUS_ATTR_CHAP_PASSWORD 3 #define RADIUS_ATTR_REPLY_MESSAGE 18 #define RADIUS_ATTR_CHAP_CHALLENGE 60 #define RADIUS_ATTR_EAP_MESSAGE 79 /* RFC 2548 */ #define RADIUS_VENDOR_ID_MICROSOFT 311 #define RADIUS_ATTR_MS_CHAP_RESPONSE 1 #define RADIUS_ATTR_MS_CHAP_ERROR 2 #define RADIUS_ATTR_MS_CHAP_NT_ENC_PW 6 #define RADIUS_ATTR_MS_CHAP_CHALLENGE 11 #define RADIUS_ATTR_MS_CHAP2_RESPONSE 25 #define RADIUS_ATTR_MS_CHAP2_SUCCESS 26 #define RADIUS_ATTR_MS_CHAP2_CPW 27 #define EAP_TTLS_MSCHAPV2_CHALLENGE_LEN 16 #define EAP_TTLS_MSCHAPV2_RESPONSE_LEN 50 #define EAP_TTLS_MSCHAP_CHALLENGE_LEN 8 #define EAP_TTLS_MSCHAP_RESPONSE_LEN 50 #define EAP_TTLS_CHAP_CHALLENGE_LEN 16 #define EAP_TTLS_CHAP_PASSWORD_LEN 16 #endif /* EAP_TTLS_H */