text
stringlengths
4
6.14k
/* * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __TRINITY_VEHICLEDEFINES_H #define __TRINITY_VEHICLEDEFINES_H #include "Define.h" #include <vector> #include <map> struct VehicleSeatEntry; enum PowerType { POWER_STEAM = 61, POWER_PYRITE = 41, POWER_HEAT = 101, POWER_OOZE = 121, POWER_BLOOD = 141, POWER_WRATH = 142, POWER_ARCANE_ENERGY = 143, POWER_LIFE_ENERGY = 144, POWER_SUN_ENERGY = 145, POWER_SWING_VELOCITY = 146, POWER_SHADOWFLAME_ENERGY = 147, POWER_BLUE_POWER = 148, POWER_PURPLE_POWER = 149, POWER_GREEN_POWER = 150, POWER_ORANGE_POWER = 151, POWER_ENERGY_2 = 153, POWER_ARCANEENERGY = 161, POWER_WIND_POWER_1 = 162, POWER_WIND_POWER_2 = 163, POWER_WIND_POWER_3 = 164, POWER_FUEL = 165, POWER_SUN_POWER = 166, POWER_TWILIGHT_ENERGY = 169, POWER_VENOM = 174, POWER_ORANGE_POWER_2 = 176, POWER_CONSUMING_FLAME = 177, POWER_PYROCLASTIC_FRENZY = 178, POWER_FLASHFIRE = 179, }; enum VehicleFlags { VEHICLE_FLAG_NO_STRAFE = 0x00000001, // Sets MOVEFLAG2_NO_STRAFE VEHICLE_FLAG_NO_JUMPING = 0x00000002, // Sets MOVEFLAG2_NO_JUMPING VEHICLE_FLAG_FULLSPEEDTURNING = 0x00000004, // Sets MOVEFLAG2_FULLSPEEDTURNING VEHICLE_FLAG_ALLOW_PITCHING = 0x00000010, // Sets MOVEFLAG2_ALLOW_PITCHING VEHICLE_FLAG_FULLSPEEDPITCHING = 0x00000020, // Sets MOVEFLAG2_FULLSPEEDPITCHING VEHICLE_FLAG_CUSTOM_PITCH = 0x00000040, // If set use pitchMin and pitchMax from DBC, otherwise pitchMin = -pi/2, pitchMax = pi/2 VEHICLE_FLAG_ADJUST_AIM_ANGLE = 0x00000400, // Lua_IsVehicleAimAngleAdjustable VEHICLE_FLAG_ADJUST_AIM_POWER = 0x00000800 // Lua_IsVehicleAimPowerAdjustable }; enum VehicleSpells { VEHICLE_SPELL_RIDE_HARDCODED = 46598, VEHICLE_SPELL_PARACHUTE = 45472 }; struct VehicleSeat { explicit VehicleSeat(VehicleSeatEntry const* seatInfo) : SeatInfo(seatInfo), Passenger(0) {} VehicleSeatEntry const* SeatInfo; uint64 Passenger; }; struct VehicleAccessory { VehicleAccessory(uint32 entry, int8 seatId, bool isMinion, uint8 summonType, uint32 summonTime) : AccessoryEntry(entry), IsMinion(isMinion), SummonTime(summonTime), SeatId(seatId), SummonedType(summonType) {} uint32 AccessoryEntry; uint32 IsMinion; uint32 SummonTime; int8 SeatId; uint8 SummonedType; }; typedef std::vector<VehicleAccessory> VehicleAccessoryList; typedef std::map<uint32, VehicleAccessoryList> VehicleAccessoryContainer; typedef std::map<int8, VehicleSeat> SeatMap; class TransportBase { public: /// This method transforms supplied transport offsets into global coordinates virtual void CalculatePassengerPosition(float& x, float& y, float& z, float& o) = 0; /// This method transforms supplied global coordinates into local offsets virtual void CalculatePassengerOffset(float& x, float& y, float& z, float& o) = 0; }; #endif
/* sminmpec.h * SMI Network Management Private Enterprise Codes for organizations * * $Id$ * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 2004 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef __SMINMPEC_H__ #define __SMINMPEC_H__ #include "ws_symbol_export.h" /* * These are SMI Network Management Private Enterprise Codes for * organizations; see * * http://www.iana.org/assignments/enterprise-numbers * * for a list. */ #define VENDOR_IETF 0 /* reserved - used by the IETF in L2TP? */ #define VENDOR_ACC 5 #define VENDOR_CISCO 9 #define VENDOR_HEWLETT_PACKARD 11 #define VENDOR_SUN_MICROSYSTEMS 42 #define VENDOR_MERIT 61 #define VENDOR_AT_AND_T 74 #define VENDOR_MOTOROLA 161 #define VENDOR_SHIVA 166 #define VENDOR_ERICSSON 193 #define VENDOR_CISCO_VPN5000 255 #define VENDOR_LIVINGSTON 307 #define VENDOR_MICROSOFT 311 #define VENDOR_3COM 429 #define VENDOR_ASCEND 529 #define VENDOR_BAY 1584 #define VENDOR_FOUNDRY 1991 #define VENDOR_VERSANET 2180 #define VENDOR_REDBACK 2352 #define VENDOR_JUNIPER 2636 #define VENDOR_APTIS 2637 #define VENDOR_DT_AG 2937 #define VENDOR_CISCO_VPN3000 3076 #define VENDOR_COSINE 3085 #define VENDOR_SHASTA 3199 #define VENDOR_NETSCREEN 3224 #define VENDOR_NOMADIX 3309 #define VENDOR_T_MOBILE 3414 /* Former VoiceStream Wireless, Inc. */ #define VENDOR_ZTE 3902 #define VENDOR_SIEMENS 4329 #define VENDOR_CABLELABS 4491 #define VENDOR_UNISPHERE 4874 #define VENDOR_CISCO_BBSM 5263 #define VENDOR_THE3GPP2 5535 #define VENDOR_IP_UNPLUGGED 5925 #define VENDOR_ISSANNI 5948 #define VENDOR_DE_TE_MOBIL 6490 #define VENDOR_QUINTUM 6618 #define VENDOR_INTERLINK 6728 #define VENDOR_CNCTC 7951 #define VENDOR_COLUBRIS 8744 #define VENDOR_ERICSSON_PKT_CORE 10923 #define VENDOR_COLUMBIA_UNIVERSITY 11862 #define VENDOR_THE3GPP 10415 #define VENDOR_GEMTEK_SYSTEMS 10529 #define VENDOR_VERIZON 12951 #define VENDOR_PLIXER 13745 #define VENDOR_WIFI_ALLIANCE 14122 #define VENDOR_T_SYSTEMS_NOVA 16787 #define VENDOR_CHINATELECOM_GUANZHOU 20942 #define VENDOR_CACE 32622 /* Greater than 32,767 need to be tagged unsigned. */ #define VENDOR_NTOP 35632u WS_DLL_PUBLIC value_string_ext sminmpec_values_ext; #endif /* __SMINMPEC_H__ */
/* */ #include <linux/module.h> #include <linux/ceph/types.h> const char *ceph_entity_type_name(int type) { switch (type) { case CEPH_ENTITY_TYPE_MDS: return "mds"; case CEPH_ENTITY_TYPE_OSD: return "osd"; case CEPH_ENTITY_TYPE_MON: return "mon"; case CEPH_ENTITY_TYPE_CLIENT: return "client"; case CEPH_ENTITY_TYPE_AUTH: return "auth"; default: return "unknown"; } } const char *ceph_osd_op_name(int op) { switch (op) { case CEPH_OSD_OP_READ: return "read"; case CEPH_OSD_OP_STAT: return "stat"; case CEPH_OSD_OP_MASKTRUNC: return "masktrunc"; case CEPH_OSD_OP_WRITE: return "write"; case CEPH_OSD_OP_DELETE: return "delete"; case CEPH_OSD_OP_TRUNCATE: return "truncate"; case CEPH_OSD_OP_ZERO: return "zero"; case CEPH_OSD_OP_WRITEFULL: return "writefull"; case CEPH_OSD_OP_ROLLBACK: return "rollback"; case CEPH_OSD_OP_APPEND: return "append"; case CEPH_OSD_OP_STARTSYNC: return "startsync"; case CEPH_OSD_OP_SETTRUNC: return "settrunc"; case CEPH_OSD_OP_TRIMTRUNC: return "trimtrunc"; case CEPH_OSD_OP_TMAPUP: return "tmapup"; case CEPH_OSD_OP_TMAPGET: return "tmapget"; case CEPH_OSD_OP_TMAPPUT: return "tmapput"; case CEPH_OSD_OP_GETXATTR: return "getxattr"; case CEPH_OSD_OP_GETXATTRS: return "getxattrs"; case CEPH_OSD_OP_SETXATTR: return "setxattr"; case CEPH_OSD_OP_SETXATTRS: return "setxattrs"; case CEPH_OSD_OP_RESETXATTRS: return "resetxattrs"; case CEPH_OSD_OP_RMXATTR: return "rmxattr"; case CEPH_OSD_OP_CMPXATTR: return "cmpxattr"; case CEPH_OSD_OP_PULL: return "pull"; case CEPH_OSD_OP_PUSH: return "push"; case CEPH_OSD_OP_BALANCEREADS: return "balance-reads"; case CEPH_OSD_OP_UNBALANCEREADS: return "unbalance-reads"; case CEPH_OSD_OP_SCRUB: return "scrub"; case CEPH_OSD_OP_WRLOCK: return "wrlock"; case CEPH_OSD_OP_WRUNLOCK: return "wrunlock"; case CEPH_OSD_OP_RDLOCK: return "rdlock"; case CEPH_OSD_OP_RDUNLOCK: return "rdunlock"; case CEPH_OSD_OP_UPLOCK: return "uplock"; case CEPH_OSD_OP_DNLOCK: return "dnlock"; case CEPH_OSD_OP_CALL: return "call"; case CEPH_OSD_OP_PGLS: return "pgls"; } return "???"; } const char *ceph_pool_op_name(int op) { switch (op) { case POOL_OP_CREATE: return "create"; case POOL_OP_DELETE: return "delete"; case POOL_OP_AUID_CHANGE: return "auid change"; case POOL_OP_CREATE_SNAP: return "create snap"; case POOL_OP_DELETE_SNAP: return "delete snap"; case POOL_OP_CREATE_UNMANAGED_SNAP: return "create unmanaged snap"; case POOL_OP_DELETE_UNMANAGED_SNAP: return "delete unmanaged snap"; } return "???"; }
/******************** (C) COPYRIGHT 2009 STMicroelectronics ******************** * File Name : usb_istr.h * Author : MCD Application Team * Version : V3.1.0 * Date : 10/30/2009 * Description : This file includes the peripherals header files in the * user application. ******************************************************************************** * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. *******************************************************************************/ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __USB_ISTR_H #define __USB_ISTR_H /* Includes ------------------------------------------------------------------*/ #include "usb_conf.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ #ifndef STM32F10X_CL void USB_Istr(void); #else /* STM32F10X_CL */ u32 STM32_PCD_OTG_ISR_Handler(void); #endif /* STM32F10X_CL */ /* function prototypes Automatically built defining related macros */ void EP1_IN_Callback(void); void EP2_IN_Callback(void); void EP3_IN_Callback(void); void EP4_IN_Callback(void); void EP5_IN_Callback(void); void EP6_IN_Callback(void); void EP7_IN_Callback(void); void EP1_OUT_Callback(void); void EP2_OUT_Callback(void); void EP3_OUT_Callback(void); void EP4_OUT_Callback(void); void EP5_OUT_Callback(void); void EP6_OUT_Callback(void); void EP7_OUT_Callback(void); #ifndef STM32F10X_CL #ifdef CTR_CALLBACK void CTR_Callback(void); #endif #ifdef DOVR_CALLBACK void DOVR_Callback(void); #endif #ifdef ERR_CALLBACK void ERR_Callback(void); #endif #ifdef WKUP_CALLBACK void WKUP_Callback(void); #endif #ifdef SUSP_CALLBACK void SUSP_Callback(void); #endif #ifdef RESET_CALLBACK void RESET_Callback(void); #endif #ifdef SOF_CALLBACK void SOF_Callback(void); #endif #ifdef ESOF_CALLBACK void ESOF_Callback(void); #endif #else /* STM32F10X_CL */ /* Interrupt subroutines user callbacks prototypes. These callbacks are called into the respective interrupt sunroutine functinos and can be tailored for various user application purposes. Note: Make sure that the correspondant interrupt is enabled through the definition in usb_conf.h file */ void INTR_MODEMISMATCH_Callback(void); void INTR_SOFINTR_Callback(void); void INTR_RXSTSQLVL_Callback(void); void INTR_NPTXFEMPTY_Callback(void); void INTR_GINNAKEFF_Callback(void); void INTR_GOUTNAKEFF_Callback(void); void INTR_ERLYSUSPEND_Callback(void); void INTR_USBSUSPEND_Callback(void); void INTR_USBRESET_Callback(void); void INTR_ENUMDONE_Callback(void); void INTR_ISOOUTDROP_Callback(void); void INTR_EOPFRAME_Callback(void); void INTR_EPMISMATCH_Callback(void); void INTR_INEPINTR_Callback(void); void INTR_OUTEPINTR_Callback(void); void INTR_INCOMPLISOIN_Callback(void); void INTR_INCOMPLISOOUT_Callback(void); void INTR_WKUPINTR_Callback(void); /* Isochronous data update */ void INTR_RXSTSQLVL_ISODU_Callback(void); #endif /* STM32F10X_CL */ #endif /*__USB_ISTR_H*/ /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
// Copyright (C) 2016 Davis E. King (davis@dlib.net) // License: Boost Software License See LICENSE.txt for the full license. #ifndef DLIB_DNn_UTILITIES_H_ #define DLIB_DNn_UTILITIES_H_ #include "core.h" #include "utilities_abstract.h" #include "../geometry.h" namespace dlib { // ---------------------------------------------------------------------------------------- inline double log1pexp(double x) { using std::exp; using namespace std; // Do this instead of using std::log1p because some compilers // error out otherwise (E.g. gcc 4.9 in cygwin) if (x <= -37) return exp(x); else if (-37 < x && x <= 18) return log1p(exp(x)); else if (18 < x && x <= 33.3) return x + exp(-x); else return x; } // ---------------------------------------------------------------------------------------- inline void randomize_parameters ( tensor& params, unsigned long num_inputs_and_outputs, dlib::rand& rnd ) { for (auto& val : params) { // Draw a random number to initialize the layer according to formula (16) // from Understanding the difficulty of training deep feedforward neural // networks by Xavier Glorot and Yoshua Bengio. val = 2*rnd.get_random_float()-1; val *= std::sqrt(6.0/(num_inputs_and_outputs)); } } // ---------------------------------------------------------------------------------------- namespace impl { class visitor_net_to_xml { public: visitor_net_to_xml(std::ostream& out_) : out(out_) {} template<typename input_layer_type> void operator()(size_t idx, const input_layer_type& l) { out << "<layer idx='"<<idx<<"' type='input'>\n"; to_xml(l,out); out << "</layer>\n"; } template <typename T, typename U> void operator()(size_t idx, const add_loss_layer<T,U>& l) { out << "<layer idx='"<<idx<<"' type='loss'>\n"; to_xml(l.loss_details(),out); out << "</layer>\n"; } template <typename T, typename U, typename E> void operator()(size_t idx, const add_layer<T,U,E>& l) { out << "<layer idx='"<<idx<<"' type='comp'>\n"; to_xml(l.layer_details(),out); out << "</layer>\n"; } template <unsigned long ID, typename U, typename E> void operator()(size_t idx, const add_tag_layer<ID,U,E>& l) { out << "<layer idx='"<<idx<<"' type='tag' id='"<<ID<<"'/>\n"; } template <template<typename> class T, typename U> void operator()(size_t idx, const add_skip_layer<T,U>& l) { out << "<layer idx='"<<idx<<"' type='skip' id='"<<(tag_id<T>::id)<<"'/>\n"; } private: std::ostream& out; }; } template <typename net_type> void net_to_xml ( const net_type& net, std::ostream& out ) { out << "<net>\n"; visit_layers(net, impl::visitor_net_to_xml(out)); out << "</net>\n"; } // ---------------------------------------------------------------------------------------- namespace impl { class visitor_net_map_input_to_output { public: visitor_net_map_input_to_output(point& p_) : p(p_) {} point& p; template<typename layer_type> void operator()(size_t idx, const layer_type& net) { p = net.layer_details().map_input_to_output(p); } }; class visitor_net_map_output_to_input { public: visitor_net_map_output_to_input(point& p_) : p(p_) {} point& p; template<typename layer_type> void operator()(size_t idx, const layer_type& net) { p = net.layer_details().map_output_to_input(p); } }; } template <typename net_type> inline point input_tensor_to_output_tensor( const net_type& net, point p ) { impl::visitor_net_map_input_to_output temp(p); visit_layers_backwards_range<0,net_type::num_layers-1>(net, temp); return p; } template <typename net_type> inline point output_tensor_to_input_tensor( const net_type& net, point p ) { impl::visitor_net_map_output_to_input temp(p); visit_layers_range<0,net_type::num_layers-1>(net, temp); return p; } // ---------------------------------------------------------------------------------------- } #endif // DLIB_DNn_UTILITIES_H_
/* * Copyright (C) 2009 ZTE, Corporation. * * 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. * */ /* ======================================================================================== when who what, where, why comment tag --------- ------- ------------------------------------------------------- -------------------------- 2010-12-21 zhongfj exchange KEY_VOLUMEUP and KEY_VOLUMEDOWN ZTE_KB_ZFJ_20101221 2010-07-03 liwei Copy from board-mooncake-keypad and modify "mooncake" to "v9" to support v9 keypad ,ZTE_BOOT_LIWEI_20100703 2009-12-11 wly support ftm mode ZTE_FTM_MODE_WLY_001 2009-10-30 qhhuang Copy from board-raise-keypad and modify "raise" to "mooncake" to support mooncake keypad =========================================================================================*/ #include <linux/platform_device.h> #include <linux/gpio_event.h> #include <asm/mach-types.h> // output_gpios static unsigned int keypad_row_gpios[] = {31}; // input_gpios static unsigned int keypad_col_gpios[] = {37, 41}; #define KEYMAP_INDEX(row, col) ((row)*ARRAY_SIZE(keypad_col_gpios) + (col)) static const unsigned short keypad_keymap_v9[ARRAY_SIZE(keypad_col_gpios) * ARRAY_SIZE(keypad_row_gpios)] = { /* row, col */ [KEYMAP_INDEX(0, 0)] = KEY_VOLUMEUP, //Volume up key [31, 37] [KEYMAP_INDEX(0, 1)] = KEY_VOLUMEDOWN, //Volume down key [31, 41] }; static const unsigned short v9_keypad_virtual_keys[] = { KEY_END, KEY_POWER }; /* v9 keypad platform device information */ static struct gpio_event_matrix_info v9_keypad_matrix_info = { .info.func = gpio_event_matrix_func, .keymap = keypad_keymap_v9, .output_gpios = keypad_row_gpios, .input_gpios = keypad_col_gpios, .noutputs = ARRAY_SIZE(keypad_row_gpios), .ninputs = ARRAY_SIZE(keypad_col_gpios), .settle_time.tv.nsec = 0, .poll_time.tv.nsec = 20 * NSEC_PER_MSEC, #if 1 // chenjun .flags = GPIOKPF_LEVEL_TRIGGERED_IRQ | GPIOKPF_DRIVE_INACTIVE | GPIOKPF_PRINT_UNMAPPED_KEYS #else .flags = GPIOKPF_LEVEL_TRIGGERED_IRQ | GPIOKPF_DRIVE_INACTIVE | GPIOKPF_ACTIVE_HIGH | GPIOKPF_PRINT_UNMAPPED_KEYS /*| GPIOKPF_PRINT_MAPPED_KEYS*/ #endif }; static struct gpio_event_info *v9_keypad_info[] = { &v9_keypad_matrix_info.info }; static struct gpio_event_platform_data v9_keypad_data = { .name = "v9_keypad", .info = v9_keypad_info, .info_count = ARRAY_SIZE(v9_keypad_info) }; struct platform_device keypad_device_v9 = { .name = GPIO_EVENT_DEV_NAME, .id = -1, .dev = { .platform_data = &v9_keypad_data, }, }; #ifdef CONFIG_ZTE_FTM_FLAG_SUPPORT extern int zte_get_ftm_flag(void); #endif static int __init v9_init_keypad(void) { #ifdef CONFIG_ZTE_FTM_FLAG_SUPPORT int ftm_flag; ftm_flag = zte_get_ftm_flag(); if (1 ==ftm_flag)return 0; #endif v9_keypad_matrix_info.keymap = keypad_keymap_v9; return platform_device_register(&keypad_device_v9); } device_initcall(v9_init_keypad);
/* * hi6xxx soc misc driver, for soc configuration no included in other 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. * * 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. * * * Copyright (C) 2014 Hisilicon Limited */ #include <linux/jiffies.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/stat.h> #include <linux/reboot.h> #include <linux/suspend.h> #include <linux/cpu.h> #include <linux/io.h> #include <linux/interrupt.h> /*soc interface*/ #include <soc_ao_sctrl_interface.h> #include <soc_baseaddr_interface.h> #include <soc_peri_sctrl_interface.h> #include <soc_mddrc_dmc_interface.h> #include <soc_baseaddr_interface.h> #include <general_sram_map.h> #include <linux/hisi/pm/pwrctrl_multi_memcfg.h> static int hi6xxx_soc_cpu_notify(struct notifier_block *this, unsigned long action, void *hcpu) { switch (action) { case CPU_UP_PREPARE: /*todo here*/ break; case CPU_UP_PREPARE_FROZEN: /*todo here*/ break; #ifdef CONFIG_HOTPLUG_CPU case CPU_DYING: /*todo here*/ break; case CPU_DYING_FROZEN: /*todo here*/ break; case CPU_DEAD: /*todo here*/ break; case CPU_DEAD_FROZEN: /*todo here*/ break; #endif default: break; } return NOTIFY_DONE; } static struct notifier_block hi6xxx_soc_cpu_notifier = { .notifier_call = hi6xxx_soc_cpu_notify, }; static int hi6xxx_soc_pm_notify(struct notifier_block *this, unsigned long event, void *ptr) { switch (event) { case PM_HIBERNATION_PREPARE: /*todo here*/ break; case PM_POST_HIBERNATION: /*todo here*/ break; case PM_SUSPEND_PREPARE: /*todo here*/ break; case PM_POST_SUSPEND: /*todo here*/ break; case PM_RESTORE_PREPARE: /*todo here*/ break; case PM_POST_RESTORE: /*todo here*/ break; default: /*todo here*/ break; } /*todo here*/ return NOTIFY_DONE; } static struct notifier_block hi6xxx_soc_pm_notifier = { .notifier_call = hi6xxx_soc_pm_notify, /*.priority = INT_MAX,*/ /*to change notifier's priority*/ }; static int hi6xxx_soc_reboot_notify(struct notifier_block *this, unsigned long code, void *reason) { switch (code) { case SYS_RESTART: /*todo here*/ break; case SYS_HALT: /*todo here*/ break; case SYS_POWER_OFF: /*todo here*/ break; default: /*todo here*/ break; } return NOTIFY_DONE; } static struct notifier_block hi6xxx_soc_reboot_notifier = { .notifier_call = hi6xxx_soc_reboot_notify, /*.priority = INT_MAX,*/ /*to change notifier's priority*/ }; static void __init hi6xxx_soc_config_watchdog_mode(void) { void __iomem *addr = NULL; addr = ioremap(SOC_AO_SCTRL_BASE_ADDR, SZ_8K); if (!addr){ printk(KERN_ERR "%s : failed to ioremap AO SCTRL \r\n", __FUNCTION__); return; } /*now, not reboot system when acpu watchdog timeout*/ writel( (0x1<<16)|(0x0<<0) , SOC_AO_SCTRL_SC_SYS_CTRL1_ADDR(addr)); iounmap(addr); return; } static void __init hi6xxx_soc_config_pclk_reset(void) { void __iomem *addr = NULL; addr = ioremap(SOC_PERI_SCTRL_BASE_ADDR, SZ_4K); if (!addr){ printk(KERN_ERR "%s : failed to ioremap PERI SCTRL \r\n", __FUNCTION__); return; } /* UART1 disable reset and set pclk */ writel(0x1<<5, SOC_PERI_SCTRL_SC_PERIPH_RSTDIS3_ADDR(addr)); writel(0x1<<5, SOC_PERI_SCTRL_SC_PERIPH_CLKEN3_ADDR(addr)); /* UART2 disable reset and set pclk */ writel(0x1<<6, SOC_PERI_SCTRL_SC_PERIPH_RSTDIS3_ADDR(addr)); writel(0x1<<6, SOC_PERI_SCTRL_SC_PERIPH_CLKEN3_ADDR(addr)); /* UART3 disable reset and set pclk */ writel(0x1<<7, SOC_PERI_SCTRL_SC_PERIPH_RSTDIS3_ADDR(addr)); writel(0x1<<7, SOC_PERI_SCTRL_SC_PERIPH_CLKEN3_ADDR(addr)); /* UART4 disable reset and set pclk */ writel(0x1<<8, SOC_PERI_SCTRL_SC_PERIPH_RSTDIS3_ADDR(addr)); writel(0x1<<8, SOC_PERI_SCTRL_SC_PERIPH_CLKEN3_ADDR(addr)); iounmap(addr); return; } static int __init hi6xxx_soc_config_probe(struct platform_device *pdev) { int err; hi6xxx_soc_config_watchdog_mode(); err = register_reboot_notifier(&hi6xxx_soc_reboot_notifier); if (err){ printk(KERN_ERR "failed to register hi6xxx soc reboot notifier !\r\n"); } err = register_pm_notifier(&hi6xxx_soc_pm_notifier); if (err){ printk(KERN_ERR "failed to register hi6xxx soc pm notifier !\r\n"); } err = register_cpu_notifier(&hi6xxx_soc_cpu_notifier); if (err){ printk(KERN_ERR "failed to register hi6xxx soc cpu notifier !\r\n"); } return 0; } static struct of_device_id hi6xxx_soc_config_of_match[] = { { .compatible = "hisilicon,hi6xxx-soc-config", .data = NULL, }, {} }; static struct platform_driver hi6xxx_soc_config_driver = { .probe = hi6xxx_soc_config_probe, .driver = { .name = "hi6xxx-soc-config", .of_match_table = hi6xxx_soc_config_of_match, }, }; static int __init hi6xxx_soc_pre_config(void) { /*config MUST be done before devices probe*/ hi6xxx_soc_config_pclk_reset(); return 0; } static int __init hi6xxx_soc_config_init(void) { hi6xxx_soc_pre_config(); return platform_driver_register(&hi6xxx_soc_config_driver); } postcore_initcall(hi6xxx_soc_config_init); #ifdef CONFIG_ARM64 #ifdef CONFIG_SPARSE_IRQ #define NR_IRQS_LEGACY_HI6XXXX 16 int __init arch_probe_nr_irqs(void) { return NR_IRQS_LEGACY_HI6XXXX; } #endif #endif
/* * Adium is the legal property of its developers, whose names are listed in the copyright file included * with this source distribution. * * This program is free software; you can redistribute it and/or modify it under the terms of the GNU * General Public License as published by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details. * * You should have received a copy of the GNU General Public License along with this program; if not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import "PurpleAccountViewController.h" @interface ESPurpleGaduGaduAccountViewController : PurpleAccountViewController { } - (IBAction)registerNewAccount:(id)sender; @end
/* { dg-do compile } */ /* { dg-options "-fdump-rtl-cmpelim -dp" } */ /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ typedef float __attribute__ ((mode (DF))) float_t; float_t lt_muldf (float_t x, float_t y) { x *= y; if (x < 0) return x; else return x + 2; } /* Expect assembly like: muld3 4(%ap),12(%ap),%r0 # 29 [c=80] *muldf3_ccn/2 jlss .L1 # 31 [c=26] *branch_ccn addd2 $0d2.0e+0,%r0 # 28 [c=56] *adddf3/0 .L1: */ /* { dg-final { scan-rtl-dump-times "deleting insn with uid" 1 "cmpelim" } } */ /* { dg-final { scan-assembler-not "\t(bit|cmpz?|tst). " } } */ /* { dg-final { scan-assembler "muldf\[^ \]*_ccn(/\[0-9\]+)?\n" } } */ /* { dg-final { scan-assembler "branch_ccn\n" } } */
/* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ #include "arm_mve.h" uint32_t foo (uint32_t a, uint32x4_t b) { return vminvq_u32 (a, b); } uint32_t foo1 (uint32_t a, uint32x4_t b) { return vminvq (a, b); } uint32_t foo2 (uint16_t a, uint32x4_t b) { return vminvq (a, b); } /* { dg-final { scan-assembler-not "__ARM_undef" } } */ /* { dg-final { scan-assembler-times "vminv.u32" 3 } } */
/* origin: FreeBSD /usr/src/lib/msun/src/e_log2f.c */ /* * ==================================================== * 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. * ==================================================== */ /* * See comments in log2.c. */ #include <math.h> #include "libm.h" static const float two25 = 3.3554432000e+07, /* 0x4c000000 */ ivln2hi = 1.4428710938e+00, /* 0x3fb8b000 */ ivln2lo = -1.7605285393e-04; /* 0xb9389ad4 */ float log2f(float x) { float f,hfsq,hi,lo,r,y; int32_t i,k,hx; GET_FLOAT_WORD(hx, x); k = 0; if (hx < 0x00800000) { /* x < 2**-126 */ if ((hx&0x7fffffff) == 0) return -two25/0.0f; /* log(+-0)=-inf */ if (hx < 0) return (x-x)/0.0f; /* log(-#) = NaN */ /* subnormal number, scale up x */ k -= 25; x *= two25; GET_FLOAT_WORD(hx, x); } if (hx >= 0x7f800000) return x+x; if (hx == 0x3f800000) return 0.0f; /* log(1) = +0 */ k += (hx>>23) - 127; hx &= 0x007fffff; i = (hx+(0x4afb0d))&0x800000; SET_FLOAT_WORD(x, hx|(i^0x3f800000)); /* normalize x or x/2 */ k += i>>23; y = (float)k; f = x - 1.0f; hfsq = 0.5f * f * f; r = __log1pf(f); /* * We no longer need to avoid falling into the multi-precision * calculations due to compiler bugs breaking Dekker's theorem. * Keep avoiding this as an optimization. See log2.c for more * details (some details are here only because the optimization * is not yet available in double precision). * * Another compiler bug turned up. With gcc on i386, * (ivln2lo + ivln2hi) would be evaluated in float precision * despite runtime evaluations using double precision. So we * must cast one of its terms to float_t. This makes the whole * expression have type float_t, so return is forced to waste * time clobbering its extra precision. */ // FIXME // if (sizeof(float_t) > sizeof(float)) // return (r - hfsq + f) * ((float_t)ivln2lo + ivln2hi) + y; hi = f - hfsq; GET_FLOAT_WORD(hx,hi); SET_FLOAT_WORD(hi,hx&0xfffff000); lo = (f - hi) - hfsq + r; return (lo+hi)*ivln2lo + lo*ivln2hi + hi*ivln2hi + y; }
/* SPDX-License-Identifier: GPL-2.0+ */ /* * UniPhier SG (SoC Glue) block registers * * Copyright (C) 2011-2015 Copyright (C) 2011-2015 Panasonic Corporation * Copyright (C) 2016-2017 Socionext Inc. * Author: Masahiro Yamada <yamada.masahiro@socionext.com> */ #ifndef UNIPHIER_SG_REGS_H #define UNIPHIER_SG_REGS_H #include <linux/bitops.h> #ifndef __ASSEMBLY__ #include <linux/compiler.h> #ifdef CONFIG_ARCH_UNIPHIER_V8_MULTI extern void __iomem *sg_base; #else #define sg_base ((void __iomem *)SG_BASE) #endif #endif /* __ASSEMBLY__ */ /* Base Address */ #define SG_BASE 0x5f800000 /* Revision */ #define SG_REVISION 0x0000 #define SG_REVISION_TYPE_MASK GENMASK(23, 16) #define SG_REVISION_MODEL_MASK GENMASK(10, 8) #define SG_REVISION_REV_MASK GENMASK(4, 0) /* Memory Configuration */ #define SG_MEMCONF 0x0400 #define SG_MEMCONF_CH0_SZ_MASK ((0x1 << 10) | (0x03 << 0)) #define SG_MEMCONF_CH0_SZ_64M ((0x0 << 10) | (0x01 << 0)) #define SG_MEMCONF_CH0_SZ_128M ((0x0 << 10) | (0x02 << 0)) #define SG_MEMCONF_CH0_SZ_256M ((0x0 << 10) | (0x03 << 0)) #define SG_MEMCONF_CH0_SZ_512M ((0x1 << 10) | (0x00 << 0)) #define SG_MEMCONF_CH0_SZ_1G ((0x1 << 10) | (0x01 << 0)) #define SG_MEMCONF_CH0_NUM_MASK (0x1 << 8) #define SG_MEMCONF_CH0_NUM_1 (0x1 << 8) #define SG_MEMCONF_CH0_NUM_2 (0x0 << 8) #define SG_MEMCONF_CH1_SZ_MASK ((0x1 << 11) | (0x03 << 2)) #define SG_MEMCONF_CH1_SZ_64M ((0x0 << 11) | (0x01 << 2)) #define SG_MEMCONF_CH1_SZ_128M ((0x0 << 11) | (0x02 << 2)) #define SG_MEMCONF_CH1_SZ_256M ((0x0 << 11) | (0x03 << 2)) #define SG_MEMCONF_CH1_SZ_512M ((0x1 << 11) | (0x00 << 2)) #define SG_MEMCONF_CH1_SZ_1G ((0x1 << 11) | (0x01 << 2)) #define SG_MEMCONF_CH1_NUM_MASK (0x1 << 9) #define SG_MEMCONF_CH1_NUM_1 (0x1 << 9) #define SG_MEMCONF_CH1_NUM_2 (0x0 << 9) #define SG_MEMCONF_CH2_SZ_MASK ((0x1 << 26) | (0x03 << 16)) #define SG_MEMCONF_CH2_SZ_64M ((0x0 << 26) | (0x01 << 16)) #define SG_MEMCONF_CH2_SZ_128M ((0x0 << 26) | (0x02 << 16)) #define SG_MEMCONF_CH2_SZ_256M ((0x0 << 26) | (0x03 << 16)) #define SG_MEMCONF_CH2_SZ_512M ((0x1 << 26) | (0x00 << 16)) #define SG_MEMCONF_CH2_SZ_1G ((0x1 << 26) | (0x01 << 16)) #define SG_MEMCONF_CH2_NUM_MASK (0x1 << 24) #define SG_MEMCONF_CH2_NUM_1 (0x1 << 24) #define SG_MEMCONF_CH2_NUM_2 (0x0 << 24) /* PH1-LD6b, ProXstream2, PH1-LD20 only */ #define SG_MEMCONF_CH2_DISABLE (0x1 << 21) #define SG_MEMCONF_SPARSEMEM (0x1 << 4) #define SG_USBPHYCTRL 0x0500 #define SG_ETPHYPSHUT 0x0554 #define SG_ETPHYCNT 0x0550 /* Pin Control */ #define SG_PINCTRL_BASE 0x1000 /* PH1-Pro4, PH1-Pro5 */ #define SG_LOADPINCTRL 0x1700 /* Input Enable */ #define SG_IECTRL 0x1d00 /* Pin Monitor */ #define SG_PINMON0 0x00100100 #define SG_PINMON2 0x00100108 #define SG_PINMON0_CLK_MODE_UPLLSRC_MASK (0x3 << 19) #define SG_PINMON0_CLK_MODE_UPLLSRC_DEFAULT (0x0 << 19) #define SG_PINMON0_CLK_MODE_UPLLSRC_VPLL27A (0x2 << 19) #define SG_PINMON0_CLK_MODE_UPLLSRC_VPLL27B (0x3 << 19) #define SG_PINMON0_CLK_MODE_AXOSEL_MASK (0x3 << 16) #define SG_PINMON0_CLK_MODE_AXOSEL_24576KHZ (0x0 << 16) #define SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ (0x1 << 16) #define SG_PINMON0_CLK_MODE_AXOSEL_6144KHZ (0x2 << 16) #define SG_PINMON0_CLK_MODE_AXOSEL_6250KHZ (0x3 << 16) #define SG_PINMON0_CLK_MODE_AXOSEL_DEFAULT (0x0 << 16) #define SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_U (0x1 << 16) #define SG_PINMON0_CLK_MODE_AXOSEL_20480KHZ (0x2 << 16) #define SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_A (0x3 << 16) #endif /* UNIPHIER_SG_REGS_H */
#ifndef lzma_prefix_h #define lzma_prefix_h #define Bool innobase_lzma_Bool #define Bt3Zip_MatchFinder_GetMatches innobase_lzma_Bt3Zip_MatchFinder_GetMatches #define Bt3Zip_MatchFinder_Skip innobase_lzma_Bt3Zip_MatchFinder_Skip #define Byte innobase_lzma_Byte #define CLenEnc innobase_lzma_CLenEnc #define CLenPriceEnc innobase_lzma_CLenPriceEnc #define CLookToRead innobase_lzma_CLookToRead #define CLzmaDec innobase_lzma_CLzmaDec #define CLzmaEnc innobase_lzma_CLzmaEnc #define CLzmaEncHandle innobase_lzma_CLzmaEncHandle #define CLzmaEncProps innobase_lzma_CLzmaEncProps #define CLzmaProps innobase_lzma_CLzmaProps #define CMatchFinder innobase_lzma_CMatchFinder #define COptimal innobase_lzma_COptimal #define CRangeEnc innobase_lzma_CRangeEnc #define CSaveState innobase_lzma_CSaveState #define CSeqOutStreamBuf innobase_lzma_CSeqOutStreamBuf #define CState innobase_lzma_CState #define ELzmaFinishMode innobase_lzma_ELzmaFinishMode #define ELzmaStatus innobase_lzma_ELzmaStatus #define ESzSeek innobase_lzma_ESzSeek #define GetMatchesSpec1 innobase_lzma_GetMatchesSpec1 #define Hc3Zip_MatchFinder_GetMatches innobase_lzma_Hc3Zip_MatchFinder_GetMatches #define Hc3Zip_MatchFinder_Skip innobase_lzma_Hc3Zip_MatchFinder_Skip #define IByteIn innobase_lzma_IByteIn #define IByteOut innobase_lzma_IByteOut #define ICompressProgress innobase_lzma_ICompressProgress #define ILookInStream innobase_lzma_ILookInStream #define IMatchFinder innobase_lzma_IMatchFinder #define ISeekInStream innobase_lzma_ISeekInStream #define ISeqInStream innobase_lzma_ISeqInStream #define ISeqOutStream innobase_lzma_ISeqOutStream #define ISzAlloc innobase_lzma_ISzAlloc #define Int16 innobase_lzma_Int16 #define Int32 innobase_lzma_Int32 #define Int64 innobase_lzma_Int64 #define LookInStream_LookRead innobase_lzma_LookInStream_LookRead #define LookInStream_Read innobase_lzma_LookInStream_Read #define LookInStream_Read2 innobase_lzma_LookInStream_Read2 #define LookInStream_SeekTo innobase_lzma_LookInStream_SeekTo #define LzmaCompress innobase_lzma_LzmaCompress #define LzmaDec_Allocate innobase_lzma_LzmaDec_Allocate #define LzmaDec_AllocateProbs innobase_lzma_LzmaDec_AllocateProbs #define LzmaDec_DecodeToBuf innobase_lzma_LzmaDec_DecodeToBuf #define LzmaDec_DecodeToDic innobase_lzma_LzmaDec_DecodeToDic #define LzmaDec_Free innobase_lzma_LzmaDec_Free #endif /* lzma_prefix_h */
// Rar29Decoder.h // According to unRAR license, // this code may not be used to develop a // RAR (WinRAR) compatible archiver #ifndef __RAR_DECODER_H #define __RAR_DECODER_H #include "Common/MyCom.h" #include "../../ICoder.h" #include "Original/rar.hpp" namespace NCompress { namespace NRar29 { class CDecoder : public ICompressCoder, public ICompressSetDecoderProperties2, public CMyUnknownImp { Unpack *Unp; bool m_IsSolid; public: ComprDataIO DataIO; CDecoder(); ~CDecoder(); /* class CCoderReleaser { CCoder *m_Coder; public: CCoderReleaser(CCoder *aCoder): m_Coder(aCoder) {} ~CCoderReleaser() { m_Coder->DataIO.ReleaseStreams(); } }; */ MY_UNKNOWN_IMP1(ICompressSetDecoderProperties2) // void ReleaseStreams(); STDMETHOD(CodeReal)(ISequentialInStream *inStream, ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress); STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress); STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size); }; } namespace NRar15{ class CDecoder : public ICompressCoder, public ICompressSetDecoderProperties2, public CMyUnknownImp { Unpack *Unp; bool m_IsSolid; public: ComprDataIO DataIO; CDecoder(); ~CDecoder(); /* class CCoderReleaser { CDecoder *m_Coder; public: CCoderReleaser(CDecoder *coder): m_Coder(coder) {} ~CCoderReleaser() { m_Coder->DataIO.ReleaseStreams(); } }; */ MY_UNKNOWN_IMP1(ICompressSetDecoderProperties2) // void ReleaseStreams(); STDMETHOD(CodeReal)(ISequentialInStream *inStream, ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress); STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress); STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size); }; } } #endif
#define AUBIO_UNSTABLE 1 // this file uses the unstable aubio api, please use aubio_pitch instead // see src/pitch/pitch.h and tests/src/pitch/test-pitch.c #include <aubio.h> int main () { uint_t n = 10; // compute n times uint_t win_s = 1024; // window size uint_t hop_s = win_s/4; // hop size // create some vectors cvec_t * in_cvec = new_cvec (win_s); // input fftgrain fvec_t * out_cands = new_fvec (1); // pitch candidate // create pitch object aubio_pitchmcomb_t * mcomb = new_aubio_pitchmcomb(win_s, hop_s); while ( n-- ) { aubio_pitchmcomb_do (mcomb, in_cvec, out_cands); // fvec_print(out_cands); }; // clean up before exiting del_aubio_pitchmcomb(mcomb); del_cvec(in_cvec); del_fvec(out_cands); aubio_cleanup(); return 0; }
/** * @file usb_task.c * @date 2015-06-20 * NOTE: * This file is generated by DAVE. Any manual modification done to this file will be lost when the code is regenerated. * * @cond *********************************************************************************************************************** * The USB core driver for XMC4000 family of controllers. It does the USB protocol handling. * * Copyright (c) 2015, Infineon Technologies AG * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification,are permitted provided that the * following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following * disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other materials provided with the distribution. * * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * To improve the quality of the software, users are encouraged to share modifications, enhancements or bug fixes * with Infineon Technologies AG (dave@infineon.com). *********************************************************************************************************************** * * Change History * -------------- * * 2015-02-16: * - Initial version. * 2015-06-20: * - Updated the file header. * * @endcond * */ /* Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ #define __INCLUDE_FROM_USBTASK_C #define __INCLUDE_FROM_USB_DRIVER #include "usb_task.h" volatile bool USB_IsInitialized; volatile USB_Request_Header_t USB_ControlRequest; volatile uint8_t USB_DeviceState;
/* vim: set expandtab ts=4 sw=4: */ /* * You may redistribute this program and/or modify it under the terms of * the GNU General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef Gcc_H #define Gcc_H #if !defined(__clang__) && \ defined(__GNUC__) && \ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) #define Gcc_PRINTF( format_idx, arg_idx ) \ __attribute__((__format__ (__printf__, format_idx, arg_idx))) #define Gcc_NORETURN \ __attribute__((__noreturn__)) #define Gcc_NONNULL(...) \ __attribute__((__nonnull__(__VA_ARGS__))) #define Gcc_PURE \ __attribute__ ((__pure__)) #define Gcc_PACKED \ __attribute__ ((packed)) #define Gcc_ALLOC_SIZE(...) \ __attribute__ ((alloc_size(__VA_ARGS__))) #define Gcc_USE_RET \ __attribute__ ((warn_unused_result)) #elif defined(__clang__) #define Gcc_NORETURN \ __attribute__((__noreturn__)) #define Gcc_USE_RET \ __attribute__ ((warn_unused_result)) #endif #ifndef Gcc_PRINTF #define Gcc_PRINTF( format_idx, arg_idx ) #endif #ifndef Gcc_NORETURN #define Gcc_NORETURN #endif #ifndef Gcc_NONNULL #define Gcc_NONNULL(...) #endif #ifndef Gcc_PURE #define Gcc_PURE #endif #ifndef Gcc_PACKED #define Gcc_PACKED #endif #ifndef Gcc_ALLOC_SIZE #define Gcc_ALLOC_SIZE(...) #endif #ifndef Gcc_USE_RET #define Gcc_USE_RET #endif #define Gcc_SHORT_FILE <?js return '"'+__FILE__.substring(__FILE__.lastIndexOf('/')+1)+'"'; ?> #define Gcc_FILE Gcc_SHORT_FILE #define Gcc_LINE __LINE__ Gcc_PRINTF(1,2) static inline void Gcc_checkPrintf(const char* format, ...) { // This does nothing except to trigger warnings if the format is wrong. } #endif
/* * pmconvscale - tests bug in pmConvScale * * Copyright (c) 1995-2001 Silicon Graphics, Inc. All Rights Reserved. */ #include <unistd.h> #include <pcp/pmapi.h> #include <pcp/impl.h> /* default is the "no" dimension case */ pmUnits units = {0, 0, 0, 0, 0, 0}; pmUnits oldunits = {0, 0, 0, 0, 0, 0}; static int sscales[] = { PM_SPACE_GBYTE, PM_SPACE_TBYTE, PM_SPACE_GBYTE, PM_SPACE_MBYTE, PM_SPACE_KBYTE, PM_SPACE_BYTE, PM_SPACE_KBYTE, PM_SPACE_MBYTE }; static int n_sscales = sizeof(sscales) / sizeof(sscales[0]); static int tscales[] = { PM_TIME_MIN, PM_TIME_HOUR, PM_TIME_MIN, PM_TIME_SEC, PM_TIME_MSEC, PM_TIME_USEC, PM_TIME_NSEC, PM_TIME_USEC, PM_TIME_MSEC, PM_TIME_SEC }; static int n_tscales = sizeof(tscales) / sizeof(tscales[0]); static int cscales[] = {1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -7, -6, -5, -4, -3, -2, -1, 0 }; static int n_cscales = sizeof(cscales) / sizeof(cscales[0]); /* just for PBYTE and EBYTE space extensions */ #ifdef HAVE_BITFIELDS_LTOR pmUnits myunits = { 1, -1, 0, PM_SPACE_EBYTE, PM_TIME_SEC, 0 }; #else pmUnits myunits = { 0, 0, PM_TIME_SEC, PM_SPACE_EBYTE, 0, -1, 1 }; #endif int main(int argc, char **argv) { int i, sts; int mode = 1; int limit = 0; pmAtomValue value, newvalue; char olds[64], news[64]; value.f = 12345678; if (argc > 1) { if (argv[1][0] == 'c') { /* crude, but effective ... the "count" dimension case */ units.dimCount = 1; mode = 1; } else if (argv[1][0] == 's') { /* crude, but effective ... the "space" dimension case */ units.dimSpace = 1; units.scaleSpace = PM_SPACE_MBYTE; mode = 2; } else if (argv[1][0] == 'r') { /* crude, but effective ... the "space/time" dimension case */ units.dimSpace = 1; units.dimTime = -1; units.scaleSpace = PM_SPACE_MBYTE; units.scaleTime = PM_TIME_SEC; mode = 2; } else if (argv[1][0] == 't') { /* crude, but effective ... the "time" dimension case */ units.dimTime = 1; units.scaleTime = PM_TIME_SEC; mode = 3; } else if (argv[1][0] == 'x') { /* PBYTE and EBYTE space extensions */ value.f = 1; while (myunits.scaleSpace > 0) { units = myunits; units.scaleSpace--; sts = pmConvScale(PM_TYPE_FLOAT, &value, &myunits, &newvalue, &units); if (sts < 0) { strcpy(olds, pmUnitsStr(&oldunits)); strcpy(news, pmUnitsStr(&units)); fprintf(stderr, "pmConvScale \"%s\" -> \"%s\" failed: %s\n", olds, news, pmErrStr(sts)); exit(1); } printf("%12.1f %s -> ", value.f, pmUnitsStr(&myunits)); printf("%12.1f %s\n", newvalue.f, pmUnitsStr(&units)); myunits.scaleSpace--; value.f = newvalue.f / 512; } value.f *= 512; while (myunits.scaleSpace < PM_SPACE_EBYTE) { units = myunits; units.scaleSpace++; sts = pmConvScale(PM_TYPE_FLOAT, &value, &myunits, &newvalue, &units); if (sts < 0) { strcpy(olds, pmUnitsStr(&oldunits)); strcpy(news, pmUnitsStr(&units)); fprintf(stderr, "pmConvScale \"%s\" -> \"%s\" failed: %s\n", olds, news, pmErrStr(sts)); exit(1); } printf("%12.1f %s -> ", value.f, pmUnitsStr(&myunits)); printf("%12.1f %s\n", newvalue.f, pmUnitsStr(&units)); myunits.scaleSpace++; value.f = newvalue.f * 512; } exit(0); } } oldunits = units; if (mode == 1) limit = n_cscales; else if (mode == 2) limit = n_sscales; else if (mode == 3) limit = n_tscales; for (i=0; i < limit; i++) { if (mode == 1) units.scaleCount = cscales[i]; else if (mode == 2) units.scaleSpace = sscales[i]; else if (mode == 3) units.scaleTime = tscales[i]; strcpy(olds, pmUnitsStr(&oldunits)); strcpy(news, pmUnitsStr(&units)); sts = pmConvScale(PM_TYPE_FLOAT, &value, &oldunits, &newvalue, &units); if (sts < 0) { fprintf(stderr, "pmConvScale \"%s\" -> \"%s\" failed: %s\n", olds, news, pmErrStr(sts)); exit(1); } if (mode == 1) printf("scaleCount=%d old: %12.1f \"%s\" new: %12.1f \"%s\"\n", units.scaleCount, value.f, olds, newvalue.f, news); else if (mode == 2) printf("scaleSpace=%d old: %12.1f \"%s\" new: %12.1f \"%s\"\n", units.scaleSpace, value.f, olds, newvalue.f, news); else if (mode == 3) printf("scaleTime=%d old: %12.1f \"%s\" new: %12.1f \"%s\"\n", units.scaleTime, value.f, olds, newvalue.f, news); value.f = newvalue.f; oldunits = units; } exit(0); }
/* * Copyright (c) 1997-2001 Silicon Graphics, Inc. All Rights Reserved. * * Exercise pmNewContext() for archives close to the NOFILE max fd limit. * For incident: 504616 */ #include <stdio.h> #include <unistd.h> #include <strings.h> #include <errno.h> #include <sys/resource.h> #include <pcp/pmapi.h> #include <pcp/impl.h> #include "localconfig.h" #if PCP_VER < 2200 #define PRINTF_P_PFX "" #endif static char *sfx[] = { "0", "index", "meta" }; int main(int argc, char **argv) { int c; int sts; int errflag = 0; int i; int j; int max_ctx; int max_nofile; int numopen = 0; /* pander to gcc */ int ctx = -1; /* pander to gcc */ int last_ctx; char buf[100]; char lbuf[100]; struct rlimit top; char *start = NULL; char *end; __pmSetProgname(pmProgname); while ((c = getopt(argc, argv, "D:?")) != EOF) { switch (c) { case 'D': /* debug flag */ sts = __pmParseDebug(optarg); if (sts < 0) { fprintf(stderr, "%s: unrecognized debug flag specification (%s)\n", pmProgname, optarg); errflag++; } else pmDebug |= sts; break; case '?': default: errflag++; break; } } sts = getrlimit(RLIMIT_NOFILE, &top); for (max_nofile = 30; max_nofile > 20; max_nofile--) { top.rlim_cur = max_nofile; sts = setrlimit(RLIMIT_NOFILE, &top); if (sts < 0) { fprintf(stderr, "setrlimit(NOFILE=%d) failed: %s\n", max_nofile, strerror(errno)); exit(1); } sts = dup(0); if (sts < 0) { fprintf(stderr, "dup(0) failed: %s\n", strerror(errno)); exit(1); } max_ctx = (max_nofile + 2 - sts) / 3; close(sts); printf("max fd: %d max ctx#: %d\n", max_nofile, max_ctx); last_ctx = -1; for (i = 0; i <= max_ctx; i++) { for (j = 0; j < 3; j++) { sprintf(lbuf, "qa-tmp-%d.%s", i, sfx[j]); sprintf(buf, "%s.%s", argv[optind], sfx[j]); sts = link(buf, lbuf); if (sts < 0) { fprintf(stderr, "link %s -> %s failed: %s\n", lbuf, buf, strerror(errno)); break; } } sprintf(lbuf, "qa-tmp-%d", i); ctx = pmNewContext(PM_CONTEXT_ARCHIVE, lbuf); for (j = 0; j < 3; j++) { sprintf(lbuf, "qa-tmp-%d.%s", i, sfx[j]); sts = unlink(lbuf); if (sts < 0) { fprintf(stderr, "unlink %s failed: %s\n", lbuf, strerror(errno)); break; } } if (ctx < 0) { printf("pmNewContext(): %s\n", pmErrStr(ctx)); if (i != max_ctx && i != max_ctx-1) printf("Error: failure after ctx# %d, expected after %d or %d\n", last_ctx, max_ctx, max_ctx-1); break; } else numopen++; last_ctx = ctx; } if (ctx >= 0) printf("Error: pmNewContext() did not fail?\n"); for (i = 0; i <= last_ctx; i++) pmDestroyContext(i); if (start == NULL) { start = sbrk(0); numopen = 0; } } end = sbrk(0); if (end - start > 16*1024) { printf("Memory leak? after first pass, %ld bytes per archive open-close\n", (long)((end - start) / numopen)); printf("start: " PRINTF_P_PFX "%p end: " PRINTF_P_PFX "%p diff: %ld numopen: %d\n", start, end, (long)(end - start), numopen); } return 0; }
#ifndef CDEC_SENTENCES_H #define CDEC_SENTENCES_H #include <algorithm> #include <vector> #include <iostream> #include "filelib.h" #include "tdict.h" #include "stringlib.h" #include <cstring> typedef std::vector<WordID> Sentence; // these "iterators" are invalidated if s is modified. note: this is allowed by std. inline WordID const* begin(Sentence const& s) { return &*s.begin(); } inline WordID const* end(Sentence const& s) { return &*s.end(); } inline WordID * begin(Sentence & s) { return &*s.begin(); } inline WordID * end(Sentence & s) { return &*s.end(); } inline void wordcpy(WordID *dest,WordID const* src,int n) { std::memcpy(dest,src,n*sizeof(*dest)); } inline void wordcpy(WordID *dest,WordID const* src,WordID const* src_end) { wordcpy(dest,src,src_end-src); } inline WordID *wordcpy_reverse(WordID *dest,WordID const* src,WordID const* src_end) { for(WordID const* i=src_end;i>src;) *dest++=*--i; return dest; } inline Sentence singleton_sentence(WordID t) { return Sentence(1,t); } inline Sentence singleton_sentence(std::string const& s) { return singleton_sentence(TD::Convert(s)); } inline std::ostream & operator<<(std::ostream &out,Sentence const& s) { return out<<TD::GetString(s); } inline void StringToSentence(std::string const& str,Sentence &s) { using namespace std; s.clear(); TD::ConvertSentence(str,&s); /* vector<string> ss=SplitOnWhitespace(str); transform(ss.begin(),ss.end(),back_inserter(s),ToTD()); */ } inline Sentence StringToSentence(std::string const& str) { Sentence s; StringToSentence(str,s); return s; } inline std::istream& operator >> (std::istream &in,Sentence &s) { using namespace std; string str; if (getline(in,str)) { StringToSentence(str,s); } return in; } class Sentences : public std::vector<Sentence> { typedef std::vector<Sentence> VS; public: Sentences() { } Sentences(unsigned n,Sentence const& sentence) : VS(n,sentence) { } Sentences(unsigned n,std::string const& sentence) : VS(n,StringToSentence(sentence)) { } std::string filename; void Load(std::string file) { ReadFile r(file); Load(r.get(),file); } void Load(std::istream &in,std::string filen="-") { filename=filen; do { this->push_back(Sentence()); } while(in>>this->back()); this->pop_back(); } void Print(std::ostream &out,int headn=0) const { out << "[" << size()<< " sentences from "<<filename<<"]"; if (headn!=0) { int i=0,e=this->size(); if (headn>0&&headn<e) { e=headn; out << " (first "<<headn<<")"; } out << " :\n"; for (;i<e;++i) out<<(*this)[i] << "\n"; } } friend inline std::ostream& operator<<(std::ostream &out,Sentences const& s) { s.Print(out); return out; } }; #endif
/* * This file is a part of Pocket Heroes Game project * http://www.pocketheroes.net * https://code.google.com/p/pocketheroes/ * * Copyright 2004-2010 by Robert Tarasov and Anton Stuk (iO UPG) * * 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. */ // MainFrm.h : interface of the CMainFrame class // ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_MAINFRM_H__3E53F425_0403_4DDA_8448_E0720EBEC4D6__INCLUDED_) #define AFX_MAINFRM_H__3E53F425_0403_4DDA_8448_E0720EBEC4D6__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 class CMainFrame : public CFrameWindowImpl<CMainFrame>, public CUpdateUI<CMainFrame>, public CMessageFilter, public CIdleHandler { public: DECLARE_FRAME_WND_CLASS(NULL, IDR_MAINFRAME) CCommandBarCtrl m_CmdBar; CHorSplitterWindow m_hSplit; CItemListCtrl m_itemListCtrl; virtual BOOL PreTranslateMessage(MSG* pMsg); virtual BOOL OnIdle(); BEGIN_UPDATE_UI_MAP(CMainFrame) UPDATE_ELEMENT(ID_VIEW_TOOLBAR, UPDUI_MENUPOPUP) UPDATE_ELEMENT(ID_VIEW_STATUS_BAR, UPDUI_MENUPOPUP) END_UPDATE_UI_MAP() BEGIN_MSG_MAP(CMainFrame) MESSAGE_HANDLER(WM_CREATE, OnCreate) COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit) COMMAND_ID_HANDLER(ID_FILE_NEW, OnFileNew) COMMAND_ID_HANDLER(ID_VIEW_TOOLBAR, OnViewToolBar) COMMAND_ID_HANDLER(ID_VIEW_STATUS_BAR, OnViewStatusBar) CHAIN_MSG_MAP(CUpdateUI<CMainFrame>) CHAIN_MSG_MAP(CFrameWindowImpl<CMainFrame>) END_MSG_MAP() // Handler prototypes (uncomment arguments if needed): // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT OnFileNew(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MAINFRM_H__3E53F425_0403_4DDA_8448_E0720EBEC4D6__INCLUDED_)
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_LOG_ROUTER_FACTORY_H_ #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_LOG_ROUTER_FACTORY_H_ #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" namespace content { class BrowserContext; } namespace autofill { class LogRouter; // BrowserContextKeyedServiceFactory for a LogRouter for autofill internals. It // does not override BrowserContextKeyedServiceFactory::GetBrowserContextToUse, // which means that no service is returned in Incognito. class AutofillLogRouterFactory : public BrowserContextKeyedServiceFactory { public: static LogRouter* GetForBrowserContext(content::BrowserContext* context); static AutofillLogRouterFactory* GetInstance(); AutofillLogRouterFactory(const AutofillLogRouterFactory&) = delete; AutofillLogRouterFactory& operator=(const AutofillLogRouterFactory&) = delete; private: friend struct base::DefaultSingletonTraits<AutofillLogRouterFactory>; AutofillLogRouterFactory(); ~AutofillLogRouterFactory() override; // BrowserContextKeyedServiceFactory: KeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const override; }; } // namespace autofill #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_LOG_ROUTER_FACTORY_H_
/* * Software License Agreement (BSD License) * * Copyright (c) 2011 Willow Garage, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Willow Garage, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #include <pcl/pcl_config.h> #ifdef HAVE_OPENNI #ifndef __OPENNI_IMAGE_YUV422__ #define __OPENNI_IMAGE_YUV422__ #include <pcl/pcl_macros.h> #include "openni_image.h" namespace openni_wrapper { /** * @brief Concrete implementation of the interface Image for a YUV 422 image used by Primesense devices. * @author Suat Gedikli * @date 02.january 2011 * @ingroup io */ class PCL_EXPORTS ImageYUV422 : public Image { public: ImageYUV422 (boost::shared_ptr<xn::ImageMetaData> image_meta_data) throw (); virtual ~ImageYUV422 () throw (); inline virtual Encoding getEncoding () const { return (YUV422); } virtual bool isResizingSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const; virtual void fillRGB (unsigned width, unsigned height, unsigned char* rgb_buffer, unsigned rgb_line_step = 0) const; virtual void fillGrayscale (unsigned width, unsigned height, unsigned char* gray_buffer, unsigned gray_line_step = 0) const; inline static bool resizingSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height); } ; bool ImageYUV422::resizingSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) { return (output_width <= input_width && output_height <= input_height && input_width % output_width == 0 && input_height % output_height == 0); } } // namespace #endif #endif // __OPENNI_IMAGE__
// Copyright 2019 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_REPUTATION_SAFETY_TIP_INFOBAR_H_ #define CHROME_BROWSER_REPUTATION_SAFETY_TIP_INFOBAR_H_ #include "base/android/scoped_java_ref.h" #include "components/infobars/android/confirm_infobar.h" class SafetyTipInfoBarDelegate; // SafetyTipInfoBar is a thin vineer over ConfirmInfoBar that adds a discrete // description (instead of just having a title). class SafetyTipInfoBar : public infobars::ConfirmInfoBar { public: static std::unique_ptr<infobars::InfoBar> CreateInfoBar( std::unique_ptr<SafetyTipInfoBarDelegate> delegate); SafetyTipInfoBar(const SafetyTipInfoBar&) = delete; SafetyTipInfoBar& operator=(const SafetyTipInfoBar&) = delete; ~SafetyTipInfoBar() override; private: explicit SafetyTipInfoBar(std::unique_ptr<SafetyTipInfoBarDelegate> delegate); // ConfirmInfoBar: base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( JNIEnv* env, const ResourceIdMapper& resource_id_mapper) override; SafetyTipInfoBarDelegate* GetDelegate(); }; #endif // CHROME_BROWSER_REPUTATION_SAFETY_TIP_INFOBAR_H_
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_API_PLATFORM_KEYS_VERIFY_TRUST_API_H_ #define CHROME_BROWSER_EXTENSIONS_API_PLATFORM_KEYS_VERIFY_TRUST_API_H_ #include <memory> #include <string> #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/browser_context_keyed_api_factory.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry_observer.h" namespace content { class BrowserContext; } // namespace content namespace extensions { namespace api { namespace platform_keys { namespace VerifyTLSServerCertificate { struct Params; } // namespace VerifyTLSServerCertificate } // namespace platform_keys } // namespace api // This keyed service is used by the platformKeys.verifyTLSServerCertificate for // caching and to reuse objects between multiple API calls (e.g. the // net::CertVerifier). class VerifyTrustAPI : public BrowserContextKeyedAPI, public ExtensionRegistryObserver { public: // Will be called with |return_value| set to the verification result (net::OK // if the certificate is trusted, otherwise a net error code) and // |cert_status| to the bitwise-OR of CertStatus flags. If an error occured // during processing the parameters, |error| is set to an english error // message and |return_value| and |cert_status| must be ignored. using VerifyCallback = base::OnceCallback< void(const std::string& error, int return_value, int cert_status)>; using Params = api::platform_keys::VerifyTLSServerCertificate::Params; // Consumers should use the factory instead of this constructor. explicit VerifyTrustAPI(content::BrowserContext* context); VerifyTrustAPI(const VerifyTrustAPI&) = delete; VerifyTrustAPI& operator=(const VerifyTrustAPI&) = delete; ~VerifyTrustAPI() override; // Verifies the server certificate as described by |params| for the // extension with id |extension_id|. When verification is complete // (successful or not), the result will be passed to |callback|. // // Note: It is safe to delete this object while there are still // outstanding operations. However, if this happens, |callback| // will NOT be called. void Verify(std::unique_ptr<Params> params, const std::string& extension_id, VerifyCallback callback); // ExtensionRegistryObserver: void OnExtensionUnloaded(content::BrowserContext* browser_context, const Extension* extension, UnloadedExtensionReason reason) override; // BrowserContextKeyedAPI: static BrowserContextKeyedAPIFactory<VerifyTrustAPI>* GetFactoryInstance(); protected: static const bool kServiceRedirectedInIncognito = true; static const bool kServiceIsCreatedWithBrowserContext = false; static const bool kServiceIsNULLWhileTesting = true; private: class IOPart; friend class BrowserContextKeyedAPIFactory<VerifyTrustAPI>; // Calls |ui_callback| with the given parameters. void FinishedVerificationOnUI(VerifyCallback ui_callback, const std::string& error, int return_value, int cert_status); // Calls |ui_callback| on the UIThread with the given arguments. static void CallBackOnUI(VerifyCallback ui_callback, const std::string& error, int return_value, int cert_status); // BrowserContextKeyedAPI implementation. static const char* service_name() { return "VerifyTrustAPI"; } // Created on the UIThread but must be used and destroyed only on the // IOThread. std::unique_ptr<IOPart, content::BrowserThread::DeleteOnIOThread> io_part_; base::ScopedObservation<ExtensionRegistry, ExtensionRegistryObserver> registry_observation_{this}; base::WeakPtrFactory<VerifyTrustAPI> weak_factory_{this}; }; template <> void BrowserContextKeyedAPIFactory< VerifyTrustAPI>::DeclareFactoryDependencies(); } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_API_PLATFORM_KEYS_VERIFY_TRUST_API_H_
// // BWHockeySettingsViewController.h // HockeyDemo // // Created by Andreas Linde on 3/8/11. // Copyright 2011 Andreas Linde. All rights reserved. // #import <UIKit/UIKit.h> @class BWHockeyManager; @interface BWHockeySettingsViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> { BWHockeyManager *hockeyManager_; } @property (nonatomic, retain) BWHockeyManager *hockeyManager; - (id)init:(BWHockeyManager *)newHockeyManager; - (id)init; @end
#ifndef _ADDR_MATCH_LIST_H_INCLUDED_ #define _ADDR_MATCH_LIST_H_INCLUDED_ /*++ /* NAME /* addr 3h /* SUMMARY /* address list membership /* SYNOPSIS /* #include <addr_match_list.h> /* DESCRIPTION /* .nf /* * Utility library. */ #include <match_list.h> /* * External interface. */ #define ADDR_MATCH_LIST MATCH_LIST #define addr_match_list_init(f, p) \ match_list_init((f), (p), 1, match_hostaddr) #define addr_match_list_match(l, a) \ match_list_match((l), (a)) #define addr_match_list_free match_list_free /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /*--*/ #endif
#ifndef ANDROID_SPEECH_TYPE_H #define ANDROID_SPEECH_TYPE_H #include "AudioType.h" namespace android { #ifdef SLOGV #undef SLOGV #if 0 // for speech debug usage #define SLOGV(...) ALOGD(__VA_ARGS__) #else #define SLOGV(...) ALOGV(__VA_ARGS__) #endif #endif enum modem_index_t { MODEM_1 = 0, MODEM_2 = 1, MODEM_EXTERNAL = 2, NUM_MODEM }; enum modem_status_mask_t { SPEECH_STATUS_MASK = (1 << 0), RECORD_STATUS_MASK = (1 << 1), BGS_STATUS_MASK = (1 << 2), P2W_STATUS_MASK = (1 << 3), TTY_STATUS_MASK = (1 << 4), VT_STATUS_MASK = (1 << 5), LOOPBACK_STATUS_MASK = (1 << 6), VM_RECORD_STATUS_MASK = (1 << 7), SPEECH_ROUTER_STATUS_MASK = (1 << 8), }; enum speech_mode_t { SPEECH_MODE_NORMAL = 0, SPEECH_MODE_EARPHONE = 1, SPEECH_MODE_LOUD_SPEAKER = 2, SPEECH_MODE_BT_EARPHONE = 3, SPEECH_MODE_BT_CORDLESS = 4, SPEECH_MODE_BT_CARKIT = 5, SPEECH_MODE_MAGIC_CON_CALL = 6, SPEECH_MODE_PRESERVED_2 = 7, SPEECH_MODE_HAC = 8, SPEECH_MODE_NO_CONNECT = 9 }; enum phone_call_mode_t { RAT_2G_MODE = 0, // 2G phone call RAT_3G_MODE = 1, // 3G phone call // for both 2G/3G phone call, set mode as 2G. Modem side can query 2G/3G phone call. RAT_3G324M_MODE = 2, // VT phone call }; enum rf_mode_t { RF_2G_MODE = (0xF << 0), // 2G RF index RF_3G_MODE = (0xF << 4), // 3G RF index RF_4G_MODE = (0xF << 8), // 4G RF index RF_5G_MODE = (0xF << 12), // 5G RF index }; /*enum tty_mode_t { TTY_ERR = -1, TTY_OFF = 0, TTY_FULL = 1, TTY_VCO = 2, TTY_HCO = 4 };*/ enum ctm_interface_t // L1 CTM Interface { DIRECT_MODE = 0, BAUDOT_MODE = 1 }; enum record_format_t { RECORD_FORMAT_PCM = 0, RECORD_FORMAT_VM = 1, RECORD_FORMAT_DUAL_MIC_VM = 2, RECORD_FORMAT_CTM_4WAY = 3, }; enum record_sample_rate_t { RECORD_SAMPLE_RATE_08K = 0, RECORD_SAMPLE_RATE_16K = 1, RECORD_SAMPLE_RATE_32K = 2, RECORD_SAMPLE_RATE_48K = 3 }; enum record_channel_t { RECORD_CHANNEL_MONO = 0, RECORD_CHANNEL_STEREO = 1 }; enum vm_record_format_t { VM_RECORD_VM_MASK = 0x0001, VM_RECORD_CTM4WAY_MASK = 0x0002, }; // define for dual mic pcm2way format enum dualmic_pcm2way_format_t { P2W_FORMAT_NORMAL = 0, P2W_FORMAT_VOIP = 1, P2W_FORMAT_NB_CAL = 2, // NB calibration P2W_FORMAT_WB_CAL = 3, // WB calibration }; enum pcmnway_format_t { SPC_PNW_MSG_BUFFER_SE = (1 << 0), // Bit 0, PCM4WAY_PutToSE SPC_PNW_MSG_BUFFER_SPK = (1 << 1), // Bit 1, PCM4WAY_PutToSpk SPC_PNW_MSG_BUFFER_MIC = (1 << 2), // Bit 2, PCM4WAY_GetFromMic SPC_PNW_MSG_BUFFER_SD = (1 << 3), // Bit 3, PCM4WAY_GetFromSD }; // speech enhancement function mask // This is the power on/off setting of enhancement. Most of the case, it should be totally on. enum sph_enh_main_mask_t { //SPH_ENH_MAIN_MASK_ES = (1 << 0), SPH_ENH_MAIN_MASK_AEC = (1 << 1), //SPH_ENH_MAIN_MASK_EES = (1 << 2), SPH_ENH_MAIN_MASK_ULNR = (1 << 3), // VCE depends on this SPH_ENH_MAIN_MASK_DLNR = (1 << 4), // VCE depends on this SPH_ENH_MAIN_MASK_TDNC = (1 << 5), SPH_ENH_MAIN_MASK_DMNR = (1 << 6), // Enable only when phone with dual mic SPH_ENH_MAIN_MASK_SIDETONE = (1 << 7), #if defined(MTK_DUAL_MIC_SUPPORT) SPH_ENH_MAIN_MASK_ALL = 0xFFFF, #else SPH_ENH_MAIN_MASK_ALL = (0xFFFF & (~SPH_ENH_MAIN_MASK_DMNR)), #endif }; // speech enhancement function dynamic mask // This is the dynamic switch to decided the enhancment output. enum sph_enh_dynamic_mask_t { SPH_ENH_DYNAMIC_MASK_DMNR = (1 << 0), // for receiver SPH_ENH_DYNAMIC_MASK_VCE = (1 << 1), SPH_ENH_DYNAMIC_MASK_BWE = (1 << 2), SPH_ENH_DYNAMIC_MASK_DLNR = (1 << 3), // ==> SAL_ENH_DYNAMIC_DLNR_MUX, bit 4 SPH_ENH_DYNAMIC_MASK_ULNR = (1 << 4), // ==> SAL_ENH_DYNAMIC_DLNR_MUX, bit 5 SPH_ENH_DYNAMIC_MASK_LSPK_DMNR = (1 << 5), // for loud SPEAKER_AMP SPH_ENH_DYNAMIC_MASK_SIDEKEY_DGAIN = (1 << 6), // ==> SAL_ENH_DYNAMIC_SIDEKEYCTRL_DGAIN_MUX, bit 7 SPH_ENH_DYNAMIC_MASK_DLNR_INIT_CTRL = (1 << 7), // ==> SAL_ENH_DYNAMIC_DL_NR_INIT_CTRL_MUX, bit 8 SPH_ENH_DYNAMIC_MASK_AEC = (1 << 8), // ==> SAL_ENH_DYNAMIC_AEC_MUX, bit 9 #if defined(MTK_DUAL_MIC_SUPPORT) SPH_ENH_DYNAMIC_MASK_ALL = 0xFFFFFFFF, #else SPH_ENH_DYNAMIC_MASK_ALL = (0xFFFFFFFF & (~SPH_ENH_DYNAMIC_MASK_DMNR)), #endif }; typedef struct { uint16_t main_func; // ES,AEC,EES,ULNR,DLNR,TDNC,DMNR,SIDETONE, ... uint32_t dynamic_func; // DMNR,VCE,BWE, } sph_enh_mask_struct_t; } // end namespace android #endif
/*************************************************************************** * Copyright (C) 2010~2010 by CSSlayer * * wengxt@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef _FCITX_DBUS_H #define _FCITX_DBUS_H #ifdef __cplusplus extern "C" { #endif #include <fcitx-config/fcitx-config.h> #define FCITX_DBUS_NAME "fcitx-dbus" #define FCITX_DBUS_GETCONNECTION 0 #define FCITX_DBUS_GETCONNECTION_RETURNTYPE DBusConnection* #define FCITX_DBUS_GETPRIVCONNECTION 1 #define FCITX_DBUS_GETPRIVCONNECTION_RETURNTYPE DBusConnection* #define FCITX_DBUS_SERVICE "org.fcitx.Fcitx" typedef void (*FcitxDBusWatchNameCallback)(void* owner, void* arg, const char* serviceName, const char* oldName, const char* newName); #ifdef __cplusplus } #endif #endif // _FCITX_DBUS_H // kate: indent-mode cstyle; space-indent on; indent-width 0;
/* * platform/tegra/fiq_debugger.c * * Serial Debugger Interface for Tegra * * Copyright (C) 2008 Google, Inc. * Copyright (c) 2012-2015, NVIDIA CORPORATION. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <stdarg.h> #include <linux/module.h> #include <linux/io.h> #include <linux/interrupt.h> #include <linux/clk.h> #include <linux/platform_device.h> #include <linux/irq.h> #include <linux/serial_reg.h> #include <linux/slab.h> #include <linux/stacktrace.h> #include <linux/irqchip/tegra.h> #include <linux/tegra_fiq_debugger.h> #include <asm/fiq_debugger.h> #include <linux/uaccess.h> struct tegra_fiq_debugger { struct fiq_debugger_pdata pdata; void __iomem *debug_port_base; bool break_seen; }; static inline void tegra_write(struct tegra_fiq_debugger *t, unsigned int val, unsigned int off) { __raw_writeb(val, t->debug_port_base + off * 4); } static inline unsigned int tegra_read(struct tegra_fiq_debugger *t, unsigned int off) { return __raw_readb(t->debug_port_base + off * 4); } static inline unsigned int tegra_read_lsr(struct tegra_fiq_debugger *t) { unsigned int lsr; lsr = tegra_read(t, UART_LSR); if (lsr & UART_LSR_BI) t->break_seen = true; return lsr; } static int debug_port_init(struct platform_device *pdev) { struct tegra_fiq_debugger *t; t = container_of(dev_get_platdata(&pdev->dev), typeof(*t), pdata); if (tegra_read(t, UART_LSR) & UART_LSR_DR) (void)tegra_read(t, UART_RX); /* enable rx and lsr interrupt */ tegra_write(t, UART_IER_RLSI | UART_IER_RDI, UART_IER); /* interrupt on every character */ tegra_write(t, 0, UART_IIR); return 0; } static int debug_getc(struct platform_device *pdev) { unsigned int lsr; struct tegra_fiq_debugger *t; t = container_of(dev_get_platdata(&pdev->dev), typeof(*t), pdata); lsr = tegra_read_lsr(t); if (lsr & UART_LSR_BI || t->break_seen) { t->break_seen = false; return FIQ_DEBUGGER_BREAK; } if (lsr & UART_LSR_DR) return tegra_read(t, UART_RX); return FIQ_DEBUGGER_NO_CHAR; } static void debug_putc(struct platform_device *pdev, unsigned int c) { struct tegra_fiq_debugger *t; t = container_of(dev_get_platdata(&pdev->dev), typeof(*t), pdata); while (!(tegra_read_lsr(t) & UART_LSR_THRE)) cpu_relax(); tegra_write(t, c, UART_TX); } static void debug_flush(struct platform_device *pdev) { struct tegra_fiq_debugger *t; t = container_of(dev_get_platdata(&pdev->dev), typeof(*t), pdata); while (!(tegra_read_lsr(t) & UART_LSR_TEMT)) cpu_relax(); } static void fiq_enable(struct platform_device *pdev, unsigned int irq, bool on) { if (on) tegra_fiq_enable(irq); else tegra_fiq_disable(irq); } static void fiq_ack(struct platform_device *pdev, unsigned int fiq) { tegra_fiq_ack(fiq); } static int tegra_fiq_debugger_id; static void __tegra_serial_debug_init(unsigned int base, int fiq, int irq, struct clk *clk, int signal_irq, int wakeup_irq) { struct tegra_fiq_debugger *t; struct platform_device *pdev; struct resource *res; int res_count; t = kzalloc(sizeof(struct tegra_fiq_debugger), GFP_KERNEL); if (!t) { pr_err("Failed to allocate for fiq debugger\n"); return; } t->pdata.uart_init = debug_port_init; t->pdata.uart_getc = debug_getc; t->pdata.uart_putc = debug_putc; t->pdata.uart_flush = debug_flush; t->pdata.fiq_enable = fiq_enable; t->pdata.fiq_ack = fiq_ack; t->debug_port_base = ioremap(base, PAGE_SIZE); if (!t->debug_port_base) { pr_err("Failed to ioremap for fiq debugger\n"); goto out1; } res = kzalloc(sizeof(struct resource) * 3, GFP_KERNEL); if (!res) { pr_err("Failed to alloc fiq debugger resources\n"); goto out2; } pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL); if (!pdev) { pr_err("Failed to alloc fiq debugger platform device\n"); goto out3; }; if (fiq >= 0) { res[0].flags = IORESOURCE_IRQ; res[0].start = fiq; res[0].end = fiq; res[0].name = "fiq"; } else { res[0].flags = IORESOURCE_IRQ; res[0].start = irq; res[0].end = irq; res[0].name = "uart_irq"; } res[1].flags = IORESOURCE_IRQ; res[1].start = signal_irq; res[1].end = signal_irq; res[1].name = "signal"; res_count = 2; if (wakeup_irq >= 0) { res[2].flags = IORESOURCE_IRQ; res[2].start = wakeup_irq; res[2].end = wakeup_irq; res[2].name = "wakeup"; res_count++; } pdev->name = "fiq_debugger"; pdev->id = tegra_fiq_debugger_id++; pdev->dev.platform_data = &t->pdata; pdev->resource = res; pdev->num_resources = res_count; if (platform_device_register(pdev)) { pr_err("Failed to register fiq debugger\n"); goto out4; } return; out4: kfree(pdev); out3: kfree(res); out2: iounmap(t->debug_port_base); out1: kfree(t); } void tegra_serial_debug_init(unsigned int base, int fiq, struct clk *clk, int signal_irq, int wakeup_irq) { __tegra_serial_debug_init(base, fiq, -1, clk, signal_irq, wakeup_irq); } void tegra_serial_debug_init_irq_mode(unsigned int base, int irq, struct clk *clk, int signal_irq, int wakeup_irq) { __tegra_serial_debug_init(base, -1, irq, clk, signal_irq, wakeup_irq); }
/** * @copyright Copyright (C) 2015 Cumulus Networks, Inc. * * This file is part of GNU Zebra. * * GNU Zebra 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. * * GNU Zebra 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; see the file COPYING; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _ZEBRA_PTM_REDISTRIBUTE_H #define _ZEBRA_PTM_REDISTRIBUTE_H #ifdef __cplusplus extern "C" { #endif extern void zebra_interface_bfd_update(struct interface *, struct prefix *, struct prefix *, int, vrf_id_t); extern void zebra_bfd_peer_replay_req(void); #ifdef __cplusplus } #endif #endif /* _ZEBRA_PTM_REDISTRIBUTE_H */
/* * This file is part of the coreboot project. * * Copyright 2014 Google 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 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. */ #ifndef __CHROMEOS_SYMBOLS_H #define __CHROMEOS_SYMBOLS_H extern u8 _watchdog_tombstone[]; extern u8 _ewatchdog_tombstone[]; #define _watchdog_tombstone_size (_ewatchdog_tombstone - _watchdog_tombstone) #endif /* __CHROMEOS_SYMBOLS_H */
/* Binary tree data structure. Copyright (C) 2006, 2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _TSEARCH_H #define _TSEARCH_H #if HAVE_TSEARCH /* Get tseach(), tfind(), tdelete(), twalk() declarations. */ #include <search.h> #else #ifdef __cplusplus extern "C" { #endif /* See <http://www.opengroup.org/susv3xbd/search.h.html>, <http://www.opengroup.org/susv3xsh/tsearch.html> for details. */ typedef enum { preorder, postorder, endorder, leaf } VISIT; /* Searches an element in the tree *VROOTP that compares equal to KEY. If one is found, it is returned. Otherwise, a new element equal to KEY is inserted in the tree and is returned. */ extern void * tsearch (const void *key, void **vrootp, int (*compar) (const void *, const void *)); /* Searches an element in the tree *VROOTP that compares equal to KEY. If one is found, it is returned. Otherwise, NULL is returned. */ extern void * tfind (const void *key, void *const *vrootp, int (*compar) (const void *, const void *)); /* Searches an element in the tree *VROOTP that compares equal to KEY. If one is found, it is removed from the tree, and its parent node is returned. Otherwise, NULL is returned. */ extern void * tdelete (const void *key, void **vrootp, int (*compar) (const void *, const void *)); /* Perform a depth-first, left-to-right traversal of the tree VROOT. The ACTION function is called: - for non-leaf nodes: 3 times, before the left subtree traversal, after the left subtree traversal but before the right subtree traversal, and after the right subtree traversal, - for leaf nodes: once. The arguments passed to ACTION are: 1. the node; it can be casted to a 'const void * const *', i.e. into a pointer to the key, 2. an indicator which visit of the node this is, 3. the level of the node in the tree (0 for the root). */ extern void twalk (const void *vroot, void (*action) (const void *, VISIT, int)); #ifdef __cplusplus } #endif #endif #endif /* _TSEARCH_H */
// license:BSD-3-Clause // copyright-holders:Miodrag Milanovic /***************************************************************************** * * includes/galeb.h * ****************************************************************************/ #ifndef GALEB_H_ #define GALEB_H_ class galeb_state : public driver_device { public: galeb_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_video_ram(*this, "video_ram"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } required_shared_ptr<UINT8> m_video_ram; DECLARE_READ8_MEMBER(galeb_keyboard_r); virtual void video_start() override; UINT32 screen_update_galeb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device<cpu_device> m_maincpu; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; }; /*----------- defined in video/galeb.c -----------*/ extern const gfx_layout galeb_charlayout; #endif /* GALEB_H_ */
/* * arch/arm/mach-h720x/include/mach/hardware.h * * Copyright (C) 2000 Jungjun Kim, Hynix Semiconductor Inc. * (C) 2003 Thomas Gleixner <tglx@linutronix.de> * (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de> * * This file contains the hardware definitions of the h720x processors * * 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. * * Do not add implementations specific defines here. This files contains * only defines of the onchip peripherals. Add those defines to boards.h, * which is included by this file. */ #ifndef __ASM_ARCH_HARDWARE_H #define __ASM_ARCH_HARDWARE_H #define IOCLK (3686400L) /* */ #define IO_VIRT 0xf0000000 /* */ #define IO_PHYS 0x80000000 #define IO_SIZE 0x00050000 #ifdef CONFIG_CPU_H7202 #include "h7202-regs.h" #elif defined CONFIG_CPU_H7201 #include "h7201-regs.h" #else #error machine definition mismatch #endif /* */ #define CPU_IO(x) (*(volatile u32*)(x)) /* */ #define CPU_REG(x,y) CPU_IO(x+y) /* */ #define IRQ_REG(x) CPU_REG(IRQC_VIRT,x) /* */ /* */ #define GPIO_VIRT(x) (IO_VIRT + 0x23000 + ((x)<<5)) #define GPIO_A_VIRT (GPIO_VIRT(0)) #define GPIO_B_VIRT (GPIO_VIRT(1)) #define GPIO_C_VIRT (GPIO_VIRT(2)) #define GPIO_D_VIRT (GPIO_VIRT(3)) #define GPIO_E_VIRT (GPIO_VIRT(4)) #define GPIO_AMULSEL (GPIO_VIRT(0) + 0xA4) #define AMULSEL_USIN2 (1<<5) #define AMULSEL_USOUT2 (1<<6) #define AMULSEL_USIN3 (1<<13) #define AMULSEL_USOUT3 (1<<14) #define AMULSEL_IRDIN (1<<15) #define AMULSEL_IRDOUT (1<<7) /* */ #define GPIO_DATA 0x00 #define GPIO_DIR 0x04 #define GPIO_MASK 0x08 #define GPIO_STAT 0x0C #define GPIO_EDGE 0x10 #define GPIO_CLR 0x14 #define GPIO_POL 0x18 #define GPIO_EN 0x1C /* */ #define IRQC_VIRT (IO_VIRT + 0x24000) /* */ #define IRQC_IER 0x00 #define IRQC_ISR 0x04 /* */ #define TIMER_VIRT (IO_VIRT + 0x25000) /* */ #define TM0_PERIOD 0x00 #define TM0_COUNT 0x08 #define TM0_CTRL 0x10 #define TM1_PERIOD 0x20 #define TM1_COUNT 0x28 #define TM1_CTRL 0x30 #define TM2_PERIOD 0x40 #define TM2_COUNT 0x48 #define TM2_CTRL 0x50 #define TIMER_TOPCTRL 0x60 #define TIMER_TOPSTAT 0x64 #define T64_COUNTL 0x80 #define T64_COUNTH 0x84 #define T64_CTRL 0x88 #define T64_BASEL 0x94 #define T64_BASEH 0x98 /* */ #define TSTAT_T0INT 0x1 #define TSTAT_T1INT 0x2 #define TSTAT_T2INT 0x4 #define TSTAT_T3INT 0x8 /* */ #define TM_START 0x1 #define TM_REPEAT 0x2 #define TM_RESET 0x4 /* */ #define ENABLE_TM0_INTR 0x1 #define ENABLE_TM1_INTR 0x2 #define ENABLE_TM2_INTR 0x4 #define TIMER_ENABLE_BIT 0x8 #define ENABLE_TIMER64 0x10 #define ENABLE_TIMER64_INT 0x20 /* */ #define PMU_BASE (IO_VIRT + 0x1000) #define PMU_MODE 0x00 #define PMU_STAT 0x20 #define PMU_PLL_CTRL 0x28 /* */ #define PMU_MODE_SLOW 0x00 #define PMU_MODE_RUN 0x01 #define PMU_MODE_IDLE 0x02 #define PMU_MODE_SLEEP 0x03 #define PMU_MODE_INIT 0x04 #define PMU_MODE_DEEPSLEEP 0x07 #define PMU_MODE_WAKEUP 0x08 /* */ #define PLL_2_EN 0x8000 #define PLL_1_EN 0x4000 #define PLL_3_MUTE 0x0080 /* */ #define PMU_WARMRESET 0x00010000 #define PLL_CTRL_MASK23 0x000080ff /* */ #define LCD_BASE (IO_VIRT + 0x10000) #define LCD_CTRL 0x00 #define LCD_STATUS 0x04 #define LCD_STATUS_M 0x08 #define LCD_INTERRUPT 0x0C #define LCD_DBAR 0x10 #define LCD_DCAR 0x14 #define LCD_TIMING0 0x20 #define LCD_TIMING1 0x24 #define LCD_TIMING2 0x28 #define LCD_TEST 0x40 /* */ #define LCD_CTRL_LCD_ENABLE 0x00000001 /* */ #define LCD_CTRL_LCD_BPP_MASK 0x00000006 #define LCD_CTRL_LCD_4BPP 0x00000000 #define LCD_CTRL_LCD_8BPP 0x00000002 #define LCD_CTRL_LCD_16BPP 0x00000004 #define LCD_CTRL_LCD_BW 0x00000008 #define LCD_CTRL_LCD_TFT 0x00000010 #define LCD_CTRL_BGR 0x00001000 #define LCD_CTRL_LCD_VCOMP 0x00080000 #define LCD_CTRL_LCD_MONO8 0x00200000 #define LCD_CTRL_LCD_PWR 0x00400000 #define LCD_CTRL_LCD_BLE 0x00800000 #define LCD_CTRL_LDBUSEN 0x01000000 /* */ #define LCD_PALETTE_BASE (IO_VIRT + 0x10400) /* */ #define SERIAL0_OFS 0x20000 #define SERIAL0_VIRT (IO_VIRT + SERIAL0_OFS) #define SERIAL0_BASE (IO_PHYS + SERIAL0_OFS) #define SERIAL1_OFS 0x21000 #define SERIAL1_VIRT (IO_VIRT + SERIAL1_OFS) #define SERIAL1_BASE (IO_PHYS + SERIAL1_OFS) #define SERIAL_ENABLE 0x30 #define SERIAL_ENABLE_EN (1<<0) /* */ #define __ASM_ARCH_HARDWARE_INCMACH_H #include "boards.h" #undef __ASM_ARCH_HARDWARE_INCMACH_H #endif /* */
#include <linux/linkage.h> #include <linux/errno.h> #include <asm/unistd.h> /* we can't #include <linux/syscalls.h> here, but tell gcc to not warn with -Wmissing-prototypes */ asmlinkage long sys_ni_syscall(void); /* * Non-implemented system calls get redirected here. */ asmlinkage long sys_ni_syscall(void) { return -ENOSYS; } cond_syscall(sys_nfsservctl); cond_syscall(sys_quotactl); cond_syscall(sys32_quotactl); cond_syscall(sys_acct); cond_syscall(sys_lookup_dcookie); cond_syscall(sys_swapon); cond_syscall(sys_swapoff); cond_syscall(sys_kexec_load); cond_syscall(compat_sys_kexec_load); cond_syscall(sys_init_module); cond_syscall(sys_delete_module); cond_syscall(sys_socketpair); cond_syscall(sys_bind); cond_syscall(sys_listen); cond_syscall(sys_accept); cond_syscall(sys_accept4); cond_syscall(sys_connect); cond_syscall(sys_getsockname); cond_syscall(sys_getpeername); cond_syscall(sys_sendto); cond_syscall(sys_send); cond_syscall(sys_recvfrom); cond_syscall(sys_recv); cond_syscall(sys_socket); cond_syscall(sys_setsockopt); cond_syscall(compat_sys_setsockopt); cond_syscall(sys_getsockopt); cond_syscall(compat_sys_getsockopt); cond_syscall(sys_shutdown); cond_syscall(sys_sendmsg); cond_syscall(compat_sys_sendmsg); cond_syscall(sys_recvmsg); cond_syscall(sys_recvmmsg); cond_syscall(compat_sys_recvmsg); cond_syscall(compat_sys_recvfrom); cond_syscall(compat_sys_recvmmsg); cond_syscall(sys_socketcall); cond_syscall(sys_futex); cond_syscall(compat_sys_futex); cond_syscall(sys_set_robust_list); cond_syscall(compat_sys_set_robust_list); cond_syscall(sys_get_robust_list); cond_syscall(compat_sys_get_robust_list); cond_syscall(sys_epoll_create); cond_syscall(sys_epoll_create1); cond_syscall(sys_epoll_ctl); cond_syscall(sys_epoll_wait); cond_syscall(sys_epoll_pwait); cond_syscall(compat_sys_epoll_pwait); cond_syscall(sys_semget); cond_syscall(sys_semop); cond_syscall(sys_semtimedop); cond_syscall(sys_semctl); cond_syscall(sys_msgget); cond_syscall(sys_msgsnd); cond_syscall(sys_msgrcv); cond_syscall(sys_msgctl); cond_syscall(sys_shmget); cond_syscall(sys_shmat); cond_syscall(sys_shmdt); cond_syscall(sys_shmctl); cond_syscall(sys_mq_open); cond_syscall(sys_mq_unlink); cond_syscall(sys_mq_timedsend); cond_syscall(sys_mq_timedreceive); cond_syscall(sys_mq_notify); cond_syscall(sys_mq_getsetattr); cond_syscall(compat_sys_mq_open); cond_syscall(compat_sys_mq_timedsend); cond_syscall(compat_sys_mq_timedreceive); cond_syscall(compat_sys_mq_notify); cond_syscall(compat_sys_mq_getsetattr); cond_syscall(sys_mbind); cond_syscall(sys_get_mempolicy); cond_syscall(sys_set_mempolicy); cond_syscall(compat_sys_mbind); cond_syscall(compat_sys_get_mempolicy); cond_syscall(compat_sys_set_mempolicy); cond_syscall(sys_add_key); cond_syscall(sys_request_key); cond_syscall(sys_keyctl); cond_syscall(compat_sys_keyctl); cond_syscall(compat_sys_socketcall); cond_syscall(sys_inotify_init); cond_syscall(sys_inotify_init1); cond_syscall(sys_inotify_add_watch); cond_syscall(sys_inotify_rm_watch); cond_syscall(sys_migrate_pages); cond_syscall(sys_move_pages); cond_syscall(sys_chown16); cond_syscall(sys_fchown16); cond_syscall(sys_getegid16); cond_syscall(sys_geteuid16); cond_syscall(sys_getgid16); cond_syscall(sys_getgroups16); cond_syscall(sys_getresgid16); cond_syscall(sys_getresuid16); cond_syscall(sys_getuid16); cond_syscall(sys_lchown16); cond_syscall(sys_setfsgid16); cond_syscall(sys_setfsuid16); cond_syscall(sys_setgid16); cond_syscall(sys_setgroups16); cond_syscall(sys_setregid16); cond_syscall(sys_setresgid16); cond_syscall(sys_setresuid16); cond_syscall(sys_setreuid16); cond_syscall(sys_setuid16); cond_syscall(sys_vm86old); cond_syscall(sys_vm86); cond_syscall(compat_sys_ipc); cond_syscall(compat_sys_sysctl); cond_syscall(sys_flock); cond_syscall(sys_io_setup); cond_syscall(sys_io_destroy); cond_syscall(sys_io_submit); cond_syscall(sys_io_cancel); cond_syscall(sys_io_getevents); cond_syscall(sys_syslog); /* arch-specific weak syscall entries */ cond_syscall(sys_pciconfig_read); cond_syscall(sys_pciconfig_write); cond_syscall(sys_pciconfig_iobase); cond_syscall(sys32_ipc); cond_syscall(sys32_sysctl); cond_syscall(ppc_rtas); cond_syscall(sys_spu_run); cond_syscall(sys_spu_create); cond_syscall(sys_subpage_prot); /* mmu depending weak syscall entries */ cond_syscall(sys_mprotect); cond_syscall(sys_msync); cond_syscall(sys_mlock); cond_syscall(sys_munlock); cond_syscall(sys_mlockall); cond_syscall(sys_munlockall); cond_syscall(sys_mincore); cond_syscall(sys_madvise); cond_syscall(sys_mremap); cond_syscall(sys_remap_file_pages); cond_syscall(compat_sys_move_pages); cond_syscall(compat_sys_migrate_pages); /* block-layer dependent */ cond_syscall(sys_bdflush); cond_syscall(sys_ioprio_set); cond_syscall(sys_ioprio_get); /* New file descriptors */ cond_syscall(sys_signalfd); cond_syscall(sys_signalfd4); cond_syscall(compat_sys_signalfd); cond_syscall(compat_sys_signalfd4); cond_syscall(sys_timerfd_create); cond_syscall(sys_timerfd_settime); cond_syscall(sys_timerfd_gettime); cond_syscall(compat_sys_timerfd_settime); cond_syscall(compat_sys_timerfd_gettime); cond_syscall(sys_eventfd); cond_syscall(sys_eventfd2); /* performance counters: */ cond_syscall(sys_perf_event_open);
/* * This file is part of the coreboot project. * * Copyright (C) 2014 Intel Corporation * * 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. */ #include <soc/ramstage.h> #include "gpio.h" void mainboard_silicon_init_params(FSP_SIL_UPD *params) { /* Configure pads prior to SiliconInit() in case there's any * dependencies during hardware initialization. */ gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table)); }
/* -*- c-basic-offset: 2 -*- */ /* Copyright(C) 2015 Brazil This library 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 library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "../grn_ctx_impl.h" #ifdef GRN_WITH_MRUBY #include <mruby.h> #include <mruby/class.h> #include <mruby/data.h> #include <mruby/hash.h> #include <mruby/array.h> #include <mruby/string.h> #include "mrb_ctx.h" #include "mrb_table_sort_key.h" static void mrb_grn_table_sort_key_free(mrb_state *mrb, void *data) { grn_ctx *ctx = (grn_ctx *)mrb->ud; grn_table_sort_key *sort_key = data; if (!sort_key) { return; } if (sort_key->key) { if (sort_key->key->header.type == GRN_ACCESSOR) { grn_obj_unlink(ctx, sort_key->key); } } mrb_free(mrb, sort_key); } static struct mrb_data_type mrb_grn_table_sort_key_type = { "Groonga::TableSortKey", mrb_grn_table_sort_key_free }; static mrb_value mrb_grn_table_sort_key_initialize(mrb_state *mrb, mrb_value self) { grn_table_sort_key *result; DATA_TYPE(self) = &mrb_grn_table_sort_key_type; result = mrb_calloc(mrb, 1, sizeof(grn_table_sort_key)); DATA_PTR(self) = result; return self; } static mrb_value mrb_grn_table_sort_key_close(mrb_state *mrb, mrb_value self) { grn_table_sort_key *sort_key; sort_key = DATA_PTR(self); if (sort_key) { mrb_grn_table_sort_key_free(mrb, sort_key); DATA_PTR(self) = NULL; } return mrb_nil_value(); } static mrb_value mrb_grn_table_sort_key_set_key(mrb_state *mrb, mrb_value self) { grn_ctx *ctx = (grn_ctx *)mrb->ud; grn_table_sort_key *sort_key; mrb_value mrb_key; sort_key = DATA_PTR(self); mrb_get_args(mrb, "o", &mrb_key); if (sort_key->key) { grn_obj_unlink(ctx, sort_key->key); } if (mrb_nil_p(mrb_key)) { sort_key->key = NULL; } else { sort_key->key = DATA_PTR(mrb_key); } return mrb_nil_value(); } static mrb_value mrb_grn_table_sort_key_set_flags(mrb_state *mrb, mrb_value self) { grn_table_sort_key *sort_key; mrb_int flags; sort_key = DATA_PTR(self); mrb_get_args(mrb, "i", &flags); sort_key->flags = flags; return mrb_nil_value(); } static mrb_value mrb_grn_table_sort_key_set_offset(mrb_state *mrb, mrb_value self) { grn_table_sort_key *sort_key; mrb_int offset; sort_key = DATA_PTR(self); mrb_get_args(mrb, "i", &offset); sort_key->offset = offset; return mrb_nil_value(); } void grn_mrb_table_sort_key_init(grn_ctx *ctx) { grn_mrb_data *data = &(ctx->impl->mrb); mrb_state *mrb = data->state; struct RClass *module = data->module; struct RClass *klass; klass = mrb_define_class_under(mrb, module, "TableSortKey", mrb->object_class); MRB_SET_INSTANCE_TT(klass, MRB_TT_DATA); mrb_define_method(mrb, klass, "initialize", mrb_grn_table_sort_key_initialize, MRB_ARGS_NONE()); mrb_define_method(mrb, klass, "close", mrb_grn_table_sort_key_close, MRB_ARGS_NONE()); mrb_define_method(mrb, klass, "key=", mrb_grn_table_sort_key_set_key, MRB_ARGS_REQ(1)); mrb_define_method(mrb, klass, "flags=", mrb_grn_table_sort_key_set_flags, MRB_ARGS_REQ(1)); mrb_define_method(mrb, klass, "offset=", mrb_grn_table_sort_key_set_offset, MRB_ARGS_REQ(1)); } #endif
/* * Copyright (C) 2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #if ENABLE(JIT) #include "CCallHelpers.h" #include "SnippetOperand.h" namespace JSC { class JITBitBinaryOpGenerator { public: JITBitBinaryOpGenerator(const SnippetOperand& leftOperand, const SnippetOperand& rightOperand, JSValueRegs result, JSValueRegs left, JSValueRegs right, GPRReg scratchGPR) : m_leftOperand(leftOperand) , m_rightOperand(rightOperand) , m_result(result) , m_left(left) , m_right(right) , m_scratchGPR(scratchGPR) { ASSERT(!m_leftOperand.isConstInt32() || !m_rightOperand.isConstInt32()); } bool didEmitFastPath() const { return m_didEmitFastPath; } CCallHelpers::JumpList& endJumpList() { return m_endJumpList; } CCallHelpers::JumpList& slowPathJumpList() { return m_slowPathJumpList; } protected: SnippetOperand m_leftOperand; SnippetOperand m_rightOperand; JSValueRegs m_result; JSValueRegs m_left; JSValueRegs m_right; GPRReg m_scratchGPR; bool m_didEmitFastPath { false }; CCallHelpers::JumpList m_endJumpList; CCallHelpers::JumpList m_slowPathJumpList; }; } // namespace JSC #endif // ENABLE(JIT)
/*************************************************************** * * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, * University of Wisconsin-Madison, WI. * * 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. * ***************************************************************/ //gsoap condor service name: condorSchedd #import "gsoap_schedd_types.h" #import "gsoap_daemon_core.h" int condor__beginTransaction(xsd__int duration, struct condor__beginTransactionResponse { struct condor__TransactionAndStatus response; } & result); int condor__commitTransaction(struct condor__Transaction transaction, struct condor__commitTransactionResponse { struct condor__Status response; } & result); int condor__abortTransaction(struct condor__Transaction transaction, struct condor__abortTransactionResponse { struct condor__Status response; } & result); int condor__extendTransaction(struct condor__Transaction transaction, xsd__int duration, struct condor__extendTransactionResponse { struct condor__TransactionAndStatus response; } & result); int condor__newCluster(struct condor__Transaction transaction, struct condor__newClusterResponse { struct condor__IntAndStatus response; } & result); int condor__removeCluster(struct condor__Transaction *transaction, xsd__int clusterId, xsd__string reason, struct condor__removeClusterResponse { struct condor__Status response; } & result); int condor__newJob(struct condor__Transaction transaction, xsd__int clusterId, struct condor__newJobResponse { struct condor__IntAndStatus response; } & result); int condor__removeJob(struct condor__Transaction *transaction, xsd__int clusterId, xsd__int jobId, xsd__string reason, xsd__boolean force_removal, struct condor__removeJobResponse { struct condor__Status response; } & result); int condor__holdJob(struct condor__Transaction *transaction, xsd__int clusterId, xsd__int jobId, xsd__string reason, xsd__boolean email_user, xsd__boolean email_admin, xsd__boolean system_hold, struct condor__holdJobResponse { struct condor__Status response; } & result); int condor__releaseJob(struct condor__Transaction *transaction, xsd__int clusterId, xsd__int jobId, xsd__string reason, xsd__boolean email_user, xsd__boolean email_admin, struct condor__releaseJobResponse { struct condor__Status response; } & result); int condor__submit(struct condor__Transaction transaction, xsd__int clusterId, xsd__int jobId, struct condor__ClassAdStruct * jobAd, struct condor__submitResponse { struct condor__RequirementsAndStatus response; } & result); int condor__getJobAds(struct condor__Transaction *transaction, xsd__string constraint, struct condor__getJobAdsResponse { struct condor__ClassAdStructArrayAndStatus response; } & result); int condor__getJobAd(struct condor__Transaction *transaction, xsd__int clusterId, xsd__int jobId, struct condor__getJobAdResponse { struct condor__ClassAdStructAndStatus response; } & result); int condor__declareFile(struct condor__Transaction transaction, xsd__int clusterId, xsd__int jobId, xsd__string name, xsd__int size, enum condor__HashType hashType, xsd__string hash, struct condor__declareFileResponse { struct condor__Status response; } & result); int condor__sendFile(struct condor__Transaction transaction, xsd__int clusterId, xsd__int jobId, xsd__string name, xsd__int offset, struct xsd__base64Binary * data, struct condor__sendFileResponse { struct condor__Status response; } & result); int condor__getFile(struct condor__Transaction *transaction, xsd__int clusterId, xsd__int jobId, xsd__string name, xsd__int offset, xsd__int length, struct condor__getFileResponse { struct condor__Base64DataAndStatus response; } & result); int condor__closeSpool(struct condor__Transaction *transaction, xsd__int clusterId, xsd__int jobId, struct condor__closeSpoolResponse { struct condor__Status response; } & result); int condor__listSpool(struct condor__Transaction *transaction, xsd__int clusterId, xsd__int jobId, struct condor__listSpoolResponse { struct condor__FileInfoArrayAndStatus response; } & result); int condor__requestReschedule(void *, struct condor__requestRescheduleResponse { struct condor__Status response; } & result); int condor__discoverJobRequirements(struct condor__ClassAdStruct * jobAd, struct condor__discoverJobRequirementsResponse { struct condor__RequirementsAndStatus response; } & result); int condor__createJobTemplate(xsd__int clusterId, xsd__int jobId, xsd__string owner, enum condor__UniverseType type, xsd__string cmd, xsd__string args, xsd__string requirements, struct condor__createJobTemplateResponse { struct condor__ClassAdStructAndStatus response; } & result);
/*- * Copyright (c) 2006 Verdens Gang AS * Copyright (c) 2006-2010 Varnish Software AS * All rights reserved. * * Author: Poul-Henning Kamp <phk@phk.freebsd.dk> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * Self-sizeing bitmap operations */ #include "config.h" /********************************************************************** * Generic bitmap functions, may be generalized at some point. */ #define VBITMAP_TYPE unsigned /* Our preferred wordsize */ #define VBITMAP_LUMP (1024) /* How many bits we alloc at a time */ #define VBITMAP_WORD (sizeof(VBITMAP_TYPE) * 8) #define VBITMAP_IDX(n) (n / VBITMAP_WORD) #define VBITMAP_BIT(n) (1U << (n % VBITMAP_WORD)) struct vbitmap { VBITMAP_TYPE *bits; unsigned nbits; }; static inline void vbit_expand(struct vbitmap *vb, unsigned bit) { unsigned char *p; bit += VBITMAP_LUMP - 1; bit -= (bit % VBITMAP_LUMP); p = realloc(vb->bits, bit / 8); assert(p != NULL); memset(p + vb->nbits / 8, 0, (bit - vb->nbits) / 8); vb->bits = (void*)p; vb->nbits = bit; } static inline struct vbitmap * vbit_init(unsigned initial) { struct vbitmap *vb; vb = calloc(sizeof *vb, 1); assert(vb != NULL); if (initial == 0) initial = VBITMAP_LUMP; vbit_expand(vb, initial); return (vb); } static inline void vbit_destroy(struct vbitmap *vb) { if (vb == NULL) return; free(vb->bits); free(vb); } static inline void vbit_set(struct vbitmap *vb, unsigned bit) { if (bit >= vb->nbits) vbit_expand(vb, bit); vb->bits[VBITMAP_IDX(bit)] |= VBITMAP_BIT(bit); } static inline void vbit_clr(const struct vbitmap *vb, unsigned bit) { if (bit < vb->nbits) vb->bits[VBITMAP_IDX(bit)] &= ~VBITMAP_BIT(bit); } static inline int vbit_test(const struct vbitmap *vb, unsigned bit) { if (bit >= vb->nbits) return (0); return (vb->bits[VBITMAP_IDX(bit)] & VBITMAP_BIT(bit)); }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_COMMON_WEB_DATABASE_OBSERVER_IMPL_H_ #define CONTENT_COMMON_WEB_DATABASE_OBSERVER_IMPL_H_ #pragma once #include "base/memory/ref_counted.h" #include "ipc/ipc_sync_message_filter.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabaseObserver.h" #include "webkit/database/database_connections.h" class WebDatabaseObserverImpl : public WebKit::WebDatabaseObserver { public: explicit WebDatabaseObserverImpl(IPC::SyncMessageFilter* sender); virtual ~WebDatabaseObserverImpl(); virtual void databaseOpened(const WebKit::WebDatabase& database) OVERRIDE; virtual void databaseModified(const WebKit::WebDatabase& database) OVERRIDE; virtual void databaseClosed(const WebKit::WebDatabase& database) OVERRIDE; virtual void reportOpenDatabaseResult( const WebKit::WebDatabase& database, int callsite, int websql_error, int sqlite_error) OVERRIDE; virtual void reportChangeVersionResult( const WebKit::WebDatabase& database, int callsite, int websql_error, int sqlite_error) OVERRIDE; virtual void reportStartTransactionResult( const WebKit::WebDatabase& database, int callsite, int websql_error, int sqlite_error) OVERRIDE; virtual void reportCommitTransactionResult( const WebKit::WebDatabase& database, int callsite, int websql_error, int sqlite_error) OVERRIDE; virtual void reportExecuteStatementResult( const WebKit::WebDatabase& database, int callsite, int websql_error, int sqlite_error) OVERRIDE; virtual void reportVacuumDatabaseResult( const WebKit::WebDatabase& database, int sqlite_error) OVERRIDE; void WaitForAllDatabasesToClose(); private: void HandleSqliteError(const WebKit::WebDatabase& database, int error); scoped_refptr<IPC::SyncMessageFilter> sender_; scoped_refptr<webkit_database::DatabaseConnectionsWrapper> open_connections_; }; #endif // CONTENT_COMMON_WEB_DATABASE_OBSERVER_IMPL_H_
/**************************************************************************** * fs/fs_statfs.c * * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <sys/statfs.h> #include <string.h> #include <limits.h> #include <sched.h> #include <errno.h> #include "fs_internal.h" /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** * Name: statpseudo ****************************************************************************/ static inline int statpseudofs(FAR struct inode *inode, FAR struct statfs *buf) { memset(buf, 0, sizeof(struct statfs)); buf->f_type = PROC_SUPER_MAGIC; buf->f_namelen = NAME_MAX; return OK; } /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: stat * * Return: Zero on success; -1 on failure with errno set: * * EACCES Search permission is denied for one of the directories in the * path prefix of path. * EFAULT Bad address. * ENOENT A component of the path path does not exist, or the path is an * empty string. * ENOMEM Out of memory * ENOTDIR A component of the path is not a directory. * ENOSYS The file system does not support this call. * ****************************************************************************/ int statfs(FAR const char *path, FAR struct statfs *buf) { FAR struct inode *inode; FAR const char *relpath = NULL; int ret = OK; /* Sanity checks */ if (!path || !buf) { ret = EFAULT; goto errout; } if (!path[0]) { ret = ENOENT; goto errout; } /* Get an inode for this file */ inode = inode_find(path, &relpath); if (!inode) { /* This name does not refer to a psudeo-inode and there is no * mountpoint that includes in this path. */ ret = ENOENT; goto errout; } /* The way we handle the statfs depends on the type of inode that we * are dealing with. */ #ifndef CONFIG_DISABLE_MOUNTPOINT if (INODE_IS_MOUNTPT(inode)) { /* The node is a file system mointpoint. Verify that the mountpoint * supports the statfs() method */ if (inode->u.i_mops && inode->u.i_mops->statfs) { /* Perform the statfs() operation */ ret = inode->u.i_mops->statfs(inode, buf); } } else #endif { /* The node is part of the root pseudo file system */ ret = statpseudofs(inode, buf); } /* Check if the statfs operation was successful */ if (ret < 0) { ret = -ret; goto errout_with_inode; } /* Successfully statfs'ed the file */ inode_release(inode); return OK; /* Failure conditions always set the errno appropriately */ errout_with_inode: inode_release(inode); errout: set_errno(ret); return ERROR; }
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include <ruby/ruby.h> #include "rb_channel_args.h" #include "rb_grpc_imports.generated.h" #include <grpc/grpc.h> #include "rb_grpc.h" static rb_data_type_t grpc_rb_channel_args_data_type = { "grpc_channel_args", {GRPC_RB_GC_NOT_MARKED, GRPC_RB_GC_DONT_FREE, GRPC_RB_MEMSIZE_UNAVAILABLE, {NULL, NULL}}, NULL, NULL, #ifdef RUBY_TYPED_FREE_IMMEDIATELY RUBY_TYPED_FREE_IMMEDIATELY #endif }; /* A callback the processes the hash key values in channel_args hash */ static int grpc_rb_channel_create_in_process_add_args_hash_cb(VALUE key, VALUE val, VALUE args_obj) { const char* the_key; grpc_channel_args* args; switch (TYPE(key)) { case T_STRING: the_key = StringValuePtr(key); break; case T_SYMBOL: the_key = rb_id2name(SYM2ID(key)); break; default: rb_raise(rb_eTypeError, "bad chan arg: got <%s>, want <String|Symbol>", rb_obj_classname(key)); return ST_STOP; } TypedData_Get_Struct(args_obj, grpc_channel_args, &grpc_rb_channel_args_data_type, args); if (args->num_args <= 0) { rb_raise(rb_eRuntimeError, "hash_cb bug: num_args is %lu for key:%s", args->num_args, StringValueCStr(key)); return ST_STOP; } args->args[args->num_args - 1].key = (char*)the_key; switch (TYPE(val)) { case T_SYMBOL: args->args[args->num_args - 1].type = GRPC_ARG_STRING; args->args[args->num_args - 1].value.string = (char*)rb_id2name(SYM2ID(val)); --args->num_args; return ST_CONTINUE; case T_STRING: args->args[args->num_args - 1].type = GRPC_ARG_STRING; args->args[args->num_args - 1].value.string = StringValueCStr(val); --args->num_args; return ST_CONTINUE; case T_FIXNUM: args->args[args->num_args - 1].type = GRPC_ARG_INTEGER; args->args[args->num_args - 1].value.integer = NUM2INT(val); --args->num_args; return ST_CONTINUE; default: rb_raise(rb_eTypeError, "%s: bad value: got <%s>, want <String|Fixnum>", StringValueCStr(key), rb_obj_classname(val)); return ST_STOP; } rb_raise(rb_eRuntimeError, "impl bug: hash_cb reached to far while on key:%s", StringValueCStr(key)); return ST_STOP; } /* channel_convert_params allows the call to grpc_rb_hash_convert_to_channel_args to be made within an rb_protect exception-handler. This allows any allocated memory to be freed before propagating any exception that occurs */ typedef struct channel_convert_params { VALUE src_hash; grpc_channel_args* dst; } channel_convert_params; static VALUE grpc_rb_hash_convert_to_channel_args0(VALUE as_value) { ID id_size = rb_intern("size"); VALUE grpc_rb_cChannelArgs = rb_define_class("TmpChannelArgs", rb_cObject); channel_convert_params* params = (channel_convert_params*)as_value; size_t num_args = 0; if (!NIL_P(params->src_hash) && TYPE(params->src_hash) != T_HASH) { rb_raise(rb_eTypeError, "bad channel args: got:<%s> want: a hash or nil", rb_obj_classname(params->src_hash)); return Qnil; } if (TYPE(params->src_hash) == T_HASH) { num_args = NUM2INT(rb_funcall(params->src_hash, id_size, 0)); params->dst->num_args = num_args; params->dst->args = ALLOC_N(grpc_arg, num_args); MEMZERO(params->dst->args, grpc_arg, num_args); rb_hash_foreach( params->src_hash, grpc_rb_channel_create_in_process_add_args_hash_cb, TypedData_Wrap_Struct(grpc_rb_cChannelArgs, &grpc_rb_channel_args_data_type, params->dst)); /* reset num_args as grpc_rb_channel_create_in_process_add_args_hash_cb * decrements it during has processing */ params->dst->num_args = num_args; } return Qnil; } void grpc_rb_hash_convert_to_channel_args(VALUE src_hash, grpc_channel_args* dst) { channel_convert_params params; int status = 0; /* Make a protected call to grpc_rb_hash_convert_channel_args */ params.src_hash = src_hash; params.dst = dst; rb_protect(grpc_rb_hash_convert_to_channel_args0, (VALUE)&params, &status); if (status != 0) { if (dst->args != NULL) { /* Free any allocated memory before propagating the error */ xfree(dst->args); } rb_jump_tag(status); } }
// Copyright 2020 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_VIDEO_TUTORIALS_VIDEO_TUTORIAL_TAB_HELPER_H_ #define CHROME_BROWSER_VIDEO_TUTORIALS_VIDEO_TUTORIAL_TAB_HELPER_H_ #include "chrome/common/webui_url_constants.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" namespace video_tutorials { class VideoTutorialTabHelper : public content::WebContentsObserver, public content::WebContentsUserData<VideoTutorialTabHelper> { public: ~VideoTutorialTabHelper() override; VideoTutorialTabHelper(const VideoTutorialTabHelper&) = delete; VideoTutorialTabHelper& operator=(const VideoTutorialTabHelper&) = delete; // content::WebContentsObserver overrides. void ReadyToCommitNavigation(content::NavigationHandle* handle) override; private: friend class content::WebContentsUserData<VideoTutorialTabHelper>; explicit VideoTutorialTabHelper(content::WebContents* web_contents); WEB_CONTENTS_USER_DATA_KEY_DECL(); }; } // namespace video_tutorials #endif // CHROME_BROWSER_VIDEO_TUTORIALS_VIDEO_TUTORIAL_TAB_HELPER_H_
/* * Copyright 2008 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdarg.h> #include <stddef.h> #include <setjmp.h> #include <cmockery.h> #include <database.h> extern DatabaseConnection* connect_to_customer_database(); extern unsigned int get_customer_id_by_name( DatabaseConnection * const connection, const char * const customer_name); // Mock query database function. unsigned int mock_query_database( DatabaseConnection* const connection, const char * const query_string, void *** const results) { *results = (void**)((unsigned)mock()); return (unsigned int)mock(); } // Mock of the connect to database function. DatabaseConnection* connect_to_database(const char * const database_url, const unsigned int port) { return (DatabaseConnection*)((unsigned)mock()); } void test_connect_to_customer_database(void **state) { will_return(connect_to_database, 0x0DA7ABA53); assert_int_equal((int)connect_to_customer_database(), 0x0DA7ABA53); } /* This test fails as the mock function connect_to_database() will have no * value to return. */ void fail_connect_to_customer_database(void **state) { assert_true(connect_to_customer_database() == (DatabaseConnection*)0x0DA7ABA53); } void test_get_customer_id_by_name(void **state) { DatabaseConnection connection = { "somedatabase.somewhere.com", 12345678, mock_query_database }; // Return a single customer ID when mock_query_database() is called. int customer_ids = 543; will_return(mock_query_database, &customer_ids); will_return(mock_query_database, 1); assert_int_equal(get_customer_id_by_name(&connection, "john doe"), 543); } int main(int argc, char* argv[]) { const UnitTest tests[] = { unit_test(test_connect_to_customer_database), unit_test(test_get_customer_id_by_name), }; return run_tests(tests); }
// // PusherEventsViewController.h // PusherEvents // // Created by Luke Redpath on 22/03/2010. // Copyright LJR Software Limited 2010. All rights reserved. // #import <UIKit/UIKit.h> @class PTPusher; @class PTPusherChannel; @class PTPusherAPI; @protocol PusherEventsDelegate - (void)sendEventWithMessage:(NSString *)message; @end @interface PusherEventsViewController : UITableViewController <PusherEventsDelegate> { NSMutableArray *eventsReceived; } @property (nonatomic) PTPusher *pusher; @property (nonatomic) PTPusherAPI *pusherAPI; @property (nonatomic) PTPusherChannel *currentChannel; @property (nonatomic, readonly) NSMutableArray *eventsReceived; - (void)subscribeToChannel:(NSString *)channelName; @end
/**************************************************************************** Copyright (c) 2010-2011 cocos2d-x.org Copyright (c) 2009 On-Core 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 __EFFECTS_CCGRID_H__ #define __EFFECTS_CCGRID_H__ #include "CCObject.h" #include "CCNode.h" #include "CCCamera.h" #include "ccTypes.h" #include "CCTexture2D.h" namespace cocos2d { class CCTexture2D; class CCGrabber; /** Base class for other */ class CCGridBase : public CCObject { public: virtual ~CCGridBase(void); /** wheter or not the grid is active */ inline bool isActive(void) { return m_bActive; } void setActive(bool bActive); /** number of times that the grid will be reused */ inline int getReuseGrid(void) { return m_nReuseGrid; } inline void setReuseGrid(int nReuseGrid) { m_nReuseGrid = nReuseGrid; } /** size of the grid */ inline const ccGridSize& getGridSize(void) { return m_sGridSize; } inline void setGridSize(const ccGridSize& gridSize) { m_sGridSize = gridSize; } /** pixels between the grids */ inline const CCPoint& getStep(void) { return m_obStep; } inline void setStep(const CCPoint& step) { m_obStep = step; } /** is texture flipped */ inline bool isTextureFlipped(void) { return m_bIsTextureFlipped; } void setIsTextureFlipped(bool bFlipped); bool initWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); bool initWithSize(const ccGridSize& gridSize); void beforeDraw(void); void afterDraw(CCNode *pTarget); virtual void blit(void); virtual void reuse(void); virtual void calculateVertexPoints(void); public: static CCGridBase* gridWithSize(const ccGridSize& gridSize, CCTexture2D *texture, bool flipped); static CCGridBase* gridWithSize(const ccGridSize& gridSize); void set2DProjection(void); void set3DProjection(void); protected: void applyLandscape(void); protected: bool m_bActive; int m_nReuseGrid; ccGridSize m_sGridSize; CCTexture2D *m_pTexture; CCPoint m_obStep; CCGrabber *m_pGrabber; bool m_bIsTextureFlipped; }; /** CCGrid3D is a 3D grid implementation. Each vertex has 3 dimensions: x,y,z */ class CCGrid3D : public CCGridBase { public: ~CCGrid3D(void); /** returns the vertex at a given position */ ccVertex3F vertex(const ccGridSize& pos); /** returns the original (non-transformed) vertex at a given position */ ccVertex3F originalVertex(const ccGridSize& pos); /** sets a new vertex at a given position */ void setVertex(const ccGridSize& pos, const ccVertex3F& vertex); virtual void blit(void); virtual void reuse(void); virtual void calculateVertexPoints(void); public: static CCGrid3D* gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); static CCGrid3D* gridWithSize(const ccGridSize& gridSize); protected: GLvoid *m_pTexCoordinates; GLvoid *m_pVertices; GLvoid *m_pOriginalVertices; GLushort *m_pIndices; }; /** CCTiledGrid3D is a 3D grid implementation. It differs from Grid3D in that the tiles can be separated from the grid. */ class CCTiledGrid3D : public CCGridBase { public: ~CCTiledGrid3D(void); /** returns the tile at the given position */ ccQuad3 tile(const ccGridSize& pos); /** returns the original tile (untransformed) at the given position */ ccQuad3 originalTile(const ccGridSize& pos); /** sets a new tile */ void setTile(const ccGridSize& pos, const ccQuad3& coords); virtual void blit(void); virtual void reuse(void); virtual void calculateVertexPoints(void); public: static CCTiledGrid3D* gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); static CCTiledGrid3D* gridWithSize(const ccGridSize& gridSize); protected: GLvoid *m_pTexCoordinates; GLvoid *m_pVertices; GLvoid *m_pOriginalVertices; GLushort *m_pIndices; }; } #endif // __EFFECTS_CCGRID_H__
#ifndef __ASM_APIC_H #define __ASM_APIC_H #include <linux/pm.h> #include <asm/fixmap.h> #include <asm/apicdef.h> #include <asm/processor.h> #include <asm/system.h> #define Dprintk(x...) /* * Debugging macros */ #define APIC_QUIET 0 #define APIC_VERBOSE 1 #define APIC_DEBUG 2 extern int enable_local_apic; extern int apic_verbosity; static inline void lapic_disable(void) { enable_local_apic = -1; clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability); } static inline void lapic_enable(void) { enable_local_apic = 1; } /* * Define the default level of output to be very little * This can be turned up by using apic=verbose for more * information and apic=debug for _lots_ of information. * apic_verbosity is defined in apic.c */ #define apic_printk(v, s, a...) do { \ if ((v) <= apic_verbosity) \ printk(s, ##a); \ } while (0) #ifdef CONFIG_X86_LOCAL_APIC /* * Basic functions accessing APICs. */ static __inline void apic_write(unsigned long reg, unsigned long v) { *((volatile unsigned long *)(APIC_BASE+reg)) = v; } static __inline void apic_write_atomic(unsigned long reg, unsigned long v) { xchg((volatile unsigned long *)(APIC_BASE+reg), v); } static __inline unsigned long apic_read(unsigned long reg) { return *((volatile unsigned long *)(APIC_BASE+reg)); } static __inline__ void apic_wait_icr_idle(void) { while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY ) cpu_relax(); } int get_physical_broadcast(void); #ifdef CONFIG_X86_GOOD_APIC # define FORCE_READ_AROUND_WRITE 0 # define apic_read_around(x) # define apic_write_around(x,y) apic_write((x),(y)) #else # define FORCE_READ_AROUND_WRITE 1 # define apic_read_around(x) apic_read(x) # define apic_write_around(x,y) apic_write_atomic((x),(y)) #endif static inline void ack_APIC_irq(void) { /* * ack_APIC_irq() actually gets compiled as a single instruction: * - a single rmw on Pentium/82489DX * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC) * ... yummie. */ /* Docs say use 0 for future compatibility */ apic_write_around(APIC_EOI, 0); } extern void (*wait_timer_tick)(void); extern int get_maxlvt(void); extern void clear_local_APIC(void); extern void connect_bsp_APIC (void); extern void disconnect_bsp_APIC (int virt_wire_setup); extern void disable_local_APIC (void); extern void lapic_shutdown (void); extern int verify_local_APIC (void); extern void cache_APIC_registers (void); extern void sync_Arb_IDs (void); extern void init_bsp_APIC (void); extern void setup_local_APIC (void); extern void init_apic_mappings (void); extern void smp_local_timer_interrupt (struct pt_regs * regs); extern void setup_boot_APIC_clock (void); extern void setup_secondary_APIC_clock (void); extern int APIC_init_uniprocessor (void); extern void disable_APIC_timer(void); extern void enable_APIC_timer(void); extern void enable_NMI_through_LVT0 (void * dummy); extern int disable_timer_pin_1; void smp_send_timer_broadcast_ipi(struct pt_regs *regs); void switch_APIC_timer_to_ipi(void *cpumask); void switch_ipi_to_APIC_timer(void *cpumask); #define ARCH_APICTIMER_STOPS_ON_C3 1 extern int timer_over_8254; #else /* !CONFIG_X86_LOCAL_APIC */ static inline void lapic_shutdown(void) { } #endif /* !CONFIG_X86_LOCAL_APIC */ #endif /* __ASM_APIC_H */
/* * Copyright (C) 2015 MediaTek Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef __GED_PROFILE_DVFS_H__ #define __GED_PROFILE_DVFS_H__ #include "ged_type.h" GED_ERROR ged_profile_dvfs_init(void); void ged_profile_dvfs_exit(void); GED_ERROR ged_profile_dvfs_enable(void); void ged_profile_dvfs_disable(void); void ged_profile_dvfs_start(void); void ged_profile_dvfs_stop(void); void ged_profile_dvfs_ignore_lines(int i32LineCount); void ged_profile_dvfs_record_freq_volt(unsigned int ui32Frequency, unsigned int ui32Voltage); void ged_profile_dvfs_record_temp(int i32Temp); void ged_profile_dvfs_record_thermal_limit(unsigned int ui32FreqLimit); void ged_profile_dvfs_record_gpu_loading(unsigned int ui32GpuLoading); void ged_profile_dvfs_record_clock_on(void); void ged_profile_dvfs_record_clock_off(void); void ged_profile_dvfs_record_SW_vsync(unsigned long ulTimeStamp, long lPhase, unsigned long ul3DFenceDoneTime); void ged_profile_dvfs_record_policy(long lFreq, unsigned int ui32GpuLoading, long lPreT1, unsigned long ulPreFreq, long t0, unsigned long ulCurFreq, long t1, long lPhase); #endif
/* Include file for fax routines Copyright (C) 1990, 1995 Frank D. Cringle. This file is part of viewfax - g3/g4 fax processing software. viewfax is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <limits.h> #if ULONG_MAX == 4294967295UL typedef unsigned long t32bits; #elif UINT_MAX == 4294967295UL typedef unsigned int t32bits; #else #error need a 32-bit unsigned type /* if you see the above error, add an #elif case for your architecture and tell fdc@cliwe.ping.de about it */ #endif #if USHRT_MAX == 65535 typedef unsigned short t16bits; #elif UINT_MAX == 65535 typedef unsigned int t16bits; #else #error need a 16-bit unsigned type /* if you see the above error, add an #elif case for your architecture and tell fdc@cliwe.ping.de about it */ #endif typedef t16bits pixnum; struct pagenode; /* drawfunc() points to a function which processes a line of the expanded image described as a list of run lengths. run is the base of an array of lengths, starting with a (possibly empty) white run for line number linenum. pn points to the page descriptor */ typedef void (*drawfunc)(pixnum *run, int linenum, struct pagenode *pn); struct strip { /* tiff strip descriptor */ off_t offset; /* offset in file */ off_t size; /* size of this strip */ }; struct pagenode { /* compressed page descriptor */ struct pagenode *prev, *next; /* list links */ char *name; /* basename of file */ char *pathname; /* full name of file */ int pageno; /* page number */ int nstrips; /* number of strips */ int rowsperstrip; /* number of rows per strip */ int stripnum; /* current strip while expanding */ struct strip *strips; /* array of strips containing fax data in file */ t16bits *data; /* in-memory copy of strip */ size_t length; /* length of data */ pixnum width; /* width of page in pixels */ pixnum height; /* height of page in lines */ char inverse; /* black <=> white */ char lsbfirst; /* bit order is lsb first */ char orient; /* orientation - upsidedown, landscape, mirrored */ char vres; /* vertical resolution: 1 = fine */ void (*expander)(struct pagenode *, drawfunc); void *extra; /* used for Ximage */ }; extern struct pagenode *firstpage, *lastpage, *thispage; extern struct pagenode defaultpage; /* page orientation flags */ #define TURN_U 1 #define TURN_L 2 #define TURN_M 4 extern char *ProgName; /* fsm state codes */ #define S_Null 0 #define S_Pass 1 #define S_Horiz 2 #define S_V0 3 #define S_VR 4 #define S_VL 5 #define S_Ext 6 #define S_TermW 7 #define S_TermB 8 #define S_MakeUpW 9 #define S_MakeUpB 10 #define S_MakeUp 11 #define S_EOL 12 /* state table entry */ struct tabent { unsigned char State; unsigned char Width; /* width of code in bits */ pixnum Param; /* run length */ }; extern struct tabent MainTable[]; /* 2-D state table */ extern struct tabent WhiteTable[]; /* White run lengths */ extern struct tabent BlackTable[]; /* Black run lengths */ extern int verbose; void MHexpand(struct pagenode *pn, drawfunc df); void g31expand(struct pagenode *pn, drawfunc df); void g32expand(struct pagenode *pn, drawfunc df); void g4expand(struct pagenode *pn, drawfunc df); unsigned char * getstrip(struct pagenode *pn, int strip); struct pagenode *notefile(char *name); int notetiff(char *name); /* initialise code tables */ extern void faxinit(void); /* count lines in image */ extern int G3count(struct pagenode *pn, int twoD); /* get memory or abort if none available */ extern char *xmalloc(unsigned int size); #ifdef linux #define _HAVE_USLEEP #endif #if defined(BSD) || defined(__FreeBSD__) || defined(_BSD_SOURCE) #define _HAVE_USLEEP #ifndef rindex #define rindex strrchr #endif #ifndef bcmp #define memcmp bcmp #endif #define memclr(p,n) bzero(p,n) #else /* not BSD */ #define memclr(p,n) memset(p,0,n) #endif
/* * RateBasedAdaptationLogic.h ***************************************************************************** * Copyright (C) 2010 - 2011 Klagenfurt University * * Created on: Aug 10, 2010 * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at> * Christian Timmerer <christian.timmerer@itec.uni-klu.ac.at> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifndef RATEBASEDADAPTATIONLOGIC_H_ #define RATEBASEDADAPTATIONLOGIC_H_ #include "adaptationlogic/AbstractAdaptationLogic.h" #include "xml/Node.h" #include "mpd/IMPDManager.h" #include "http/Chunk.h" #include "exceptions/EOFException.h" #include "mpd/BasicCMManager.h" namespace dash { namespace logic { class RateBasedAdaptationLogic : public AbstractAdaptationLogic { public: RateBasedAdaptationLogic (dash::mpd::IMPDManager *mpdManager); dash::http::Chunk* getNextChunk() throw(dash::exception::EOFException); private: dash::mpd::IMPDManager *mpdManager; size_t count; dash::mpd::Period *currentPeriod; }; } } #endif /* RATEBASEDADAPTATIONLOGIC_H_ */
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- debug.h for the Openbox window manager Copyright (c) 2003-2007 Dana Jansens 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. See the COPYING file for a copy of the GNU General Public License. */ #ifndef __ob__debug_h #define __ob__debug_h #include <glib.h> void ob_debug_startup(void); void ob_debug_shutdown(void); void ob_debug(const gchar *a, ...); typedef enum { OB_DEBUG_NORMAL, OB_DEBUG_FOCUS, OB_DEBUG_APP_BUGS, OB_DEBUG_SM, OB_DEBUG_TYPE_NUM } ObDebugType; void ob_debug_type(ObDebugType type, const gchar *a, ...); void ob_debug_enable(ObDebugType type, gboolean enable); void ob_debug_show_prompts(void); #endif
// avc2.h - Hand-written code for the Toshiba AVC2 coprocessor. -*- C++ -*- // Copyright (C) 2005 Red Hat. // This file is part of SID and is licensed under the GPL. // See the file COPYING.SID for conditions for redistribution. // This file is included in the middle of the mep_ext<n>_cpu class struct. public: virtual VOID cgen_set_ccr_value (SI regno, SI newval) { SI writemask; switch (regno) { case 0: // csar writemask = 0x0000003f; break; case 1: //cbcr writemask = 0x00000001; break; default: writemask = 0xffffffff; break; } SI result = (this->hardware.h_ccr[regno] & ~writemask) | (newval & writemask); if (UNLIKELY(this->trace_result_p)) { if (result != newval) this->trace_stream << "(0x" << hex << result << dec << ") "; } this->hardware.h_ccr[regno] = result; }
/** @file Terminal Device Path Vendor Guid. Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. @par Revision Reference: GUIDs defined in UEFI 2.0 spec. **/ #ifndef __PC_ANSI_H__ #define __PC_ANSI_H__ #define EFI_PC_ANSI_GUID \ { \ 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define EFI_VT_100_GUID \ { \ 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define EFI_VT_100_PLUS_GUID \ { \ 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } \ } #define EFI_VT_UTF8_GUID \ { \ 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \ } #define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL \ { \ 0x37499a9d, 0x542f, 0x4c89, {0xa0, 0x26, 0x35, 0xda, 0x14, 0x20, 0x94, 0xe4 } \ } #define EFI_SAS_DEVICE_PATH_GUID \ { \ 0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \ } extern EFI_GUID gEfiPcAnsiGuid; extern EFI_GUID gEfiVT100Guid; extern EFI_GUID gEfiVT100PlusGuid; extern EFI_GUID gEfiVTUTF8Guid; extern EFI_GUID gEfiUartDevicePathGuid; extern EFI_GUID gEfiSasDevicePathGuid; #endif
#pragma once #include "common.h" #define HID_STATE (*(volatile u32*)0x10146000) #define BUTTON_A (1 << 0) #define BUTTON_B (1 << 1) #define BUTTON_SELECT (1 << 2) #define BUTTON_START (1 << 3) #define BUTTON_RIGHT (1 << 4) #define BUTTON_LEFT (1 << 5) #define BUTTON_UP (1 << 6) #define BUTTON_DOWN (1 << 7) #define BUTTON_R1 (1 << 8) #define BUTTON_L1 (1 << 9) #define BUTTON_X (1 << 10) #define BUTTON_Y (1 << 11) u32 InputWait();
/* * This file is part of Cleanflight and Betaflight. * * Cleanflight and Betaflight are free software. You can redistribute * this software and/or modify this software under the terms of the * GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) * any later version. * * Cleanflight and Betaflight are distributed in the hope that they * 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 software. * * If not, see <http://www.gnu.org/licenses/>. */ #include <stdbool.h> #include <stdint.h> #include "platform.h" #include "drivers/serial.h" #include "telemetry/telemetry.h" #include "fc/config.h" #include "config_helper.h" #define GPS_UART SERIAL_PORT_USART3 #define TELEMETRY_UART SERIAL_PORT_UART5 #define TELEMETRY_PROVIDER_DEFAULT FUNCTION_TELEMETRY_SMARTPORT static targetSerialPortFunction_t targetSerialPortFunction[] = { { GPS_UART, FUNCTION_GPS }, { TELEMETRY_UART, TELEMETRY_PROVIDER_DEFAULT }, }; #ifdef USE_TARGET_CONFIG void targetConfiguration(void) { targetSerialPortFunctionConfig(targetSerialPortFunction, ARRAYLEN(targetSerialPortFunction)); telemetryConfigMutable()->halfDuplex = false; } #endif
/* LIBGIMP - The GIMP Library * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball * * gimpselection.c * * 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 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. */ #include "config.h" #include "gimp.h" /** * gimp_selection_float: * @image_ID: ignored * @drawable_ID: The drawable from which to float selection. * @offx: x offset for translation. * @offy: y offset for translation. * * Float the selection from the specified drawable with initial offsets * as specified. * * This procedure determines the region of the specified drawable that * lies beneath the current selection. The region is then cut from the * drawable and the resulting data is made into a new layer which is * instantiated as a floating selection. The offsets allow initial * positioning of the new floating selection. * * Returns: The floated layer. */ gint32 gimp_selection_float (gint32 image_ID, gint32 drawable_ID, gint offx, gint offy) { return _gimp_selection_float (drawable_ID, offx, offy); } /** * gimp_selection_clear: * @image_ID: The image. * * This procedure is deprecated! Use gimp_selection_none() instead. * * Returns: TRUE on success. */ gboolean gimp_selection_clear (gint32 image_ID) { return gimp_selection_none (image_ID); }
/* * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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 #include <aws/rds/RDS_EXPORTS.h> #include <aws/rds/model/DBSecurityGroup.h> #include <aws/rds/model/ResponseMetadata.h> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Xml { class XmlDocument; } // namespace Xml } // namespace Utils namespace RDS { namespace Model { /* $shape.documentation */ class AWS_RDS_API AuthorizeDBSecurityGroupIngressResult { public: AuthorizeDBSecurityGroupIngressResult(); AuthorizeDBSecurityGroupIngressResult(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result); AuthorizeDBSecurityGroupIngressResult& operator=(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result); inline const DBSecurityGroup& GetDBSecurityGroup() const{ return m_dBSecurityGroup; } inline void SetDBSecurityGroup(const DBSecurityGroup& value) { m_dBSecurityGroup = value; } inline void SetDBSecurityGroup(DBSecurityGroup&& value) { m_dBSecurityGroup = value; } inline AuthorizeDBSecurityGroupIngressResult& WithDBSecurityGroup(const DBSecurityGroup& value) { SetDBSecurityGroup(value); return *this;} inline AuthorizeDBSecurityGroupIngressResult& WithDBSecurityGroup(DBSecurityGroup&& value) { SetDBSecurityGroup(value); return *this;} inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; } inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadata = value; } inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadata = value; } inline AuthorizeDBSecurityGroupIngressResult& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;} inline AuthorizeDBSecurityGroupIngressResult& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(value); return *this;} private: DBSecurityGroup m_dBSecurityGroup; ResponseMetadata m_responseMetadata; }; } // namespace Model } // namespace RDS } // namespace Aws
/**************************************************************************** * * Copyright 2016 Samsung Electronics All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * ****************************************************************************/ /** * @defgroup IOTBUS IOTBUS * @ingroup IOTBUS * @{ */ /** * @file iotbus/iotbus_error.h * @brief Definition of iotbus_error */ #ifndef IOTBUS_ERROR_H_ #define IOTBUS_ERROR_H_ #include <errno.h> /** * @brief Enumeration for the iotbus error * @details * Enumeration Details:\n * IOTBUS_ERROR_NONE = 0, Successful\n * IOTBUS_ERROR_INVALID_PARAMETER = -EINVAL, Invalid parameter : -22\n * IOTBUS_ERROR_NO_DATA = -ENODATA, No data available : -61\n * IOTBUS_ERROR_TIMED_OUT = -ETIME, Time out : -62\n * IOTBUS_ERROR_NOT_IMPLEMENTED = -ENOSYS, Function not implemented : -38\n * IOTBUS_ERROR_NOT_SUPPORTED = -1101, Not supported\n * IOTBUS_ERROR_UNKNOWN = -1999, Unknown error\n */ typedef enum { IOTBUS_ERROR_NONE = 0, /* Successful */ IOTBUS_ERROR_INVALID_PARAMETER = -EINVAL, /* Invalid parameter : -22 */ IOTBUS_ERROR_NO_DATA = -ENODATA, /* No data available : -61*/ IOTBUS_ERROR_TIMED_OUT = -ETIME, /* Time out : -62 */ IOTBUS_ERROR_NOT_IMPLEMENTED = -ENOSYS, /* Function not implemented : -38 */ IOTBUS_ERROR_NOT_SUPPORTED = -1101, /* Not supported */ IOTBUS_ERROR_UNKNOWN = -1999, /* Unknown error */ } iotbus_error_e; #endif /* IOTBUS_ERROR_H_ */ /** @} */ // end of IOTBUS group
#ifndef ALIMPITERATORPAINTER_H #define ALIMPITERATORPAINTER_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ // $Id$ /// \ingroup mpgraphics /// \class AliMpIteratorPainter /// \brief Painter for a group of pads defined by an iterator /// // Author Laurent Aphecetche #ifndef ALI_MP_V_PAINTER_H # include "AliMpVPainter.h" #endif #ifndef ROOT_TVector2 # include "TVector2.h" #endif class TObjArray; class AliMpVPadIterator; class AliMpIteratorPainter : public AliMpVPainter { public: AliMpIteratorPainter(AliMpVPadIterator* it); virtual ~AliMpIteratorPainter(); void Draw(Option_t* option); void Paint(Option_t* option); TVector2 GetDimensions() const { return fDimensions; } TVector2 GetPosition() const { return fPosition; } private: /// Not implemented AliMpIteratorPainter(); /// Not implemented AliMpIteratorPainter(const AliMpIteratorPainter&); /// Not implemented AliMpIteratorPainter& operator=(const AliMpIteratorPainter&); TObjArray* fPads; //!<! pads of the iterator TVector2 fPosition; //!<! position TVector2 fDimensions; //!<! dimension ClassDef(AliMpIteratorPainter,1) // Painter for a group of pads }; #endif
/** * This file has no copyright assigned and is placed in the Public Domain. * This file is part of the w64 mingw-runtime package. * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ #ifndef _TCERROR_H_ #define _TCERROR_H_ #define TCBASE 7500 #define ERROR_INCOMPATIBLE_TCI_VERSION (TCBASE+1) #define ERROR_INVALID_SERVICE_TYPE (TCBASE+2) #define ERROR_INVALID_TOKEN_RATE (TCBASE+3) #define ERROR_INVALID_PEAK_RATE (TCBASE+4) #define ERROR_INVALID_SD_MODE (TCBASE+5) #define ERROR_INVALID_QOS_PRIORITY (TCBASE+6) #define ERROR_INVALID_TRAFFIC_CLASS (TCBASE+7) #define ERROR_INVALID_ADDRESS_TYPE (TCBASE+8) #define ERROR_DUPLICATE_FILTER (TCBASE+9) #define ERROR_FILTER_CONFLICT (TCBASE+10) #define ERROR_ADDRESS_TYPE_NOT_SUPPORTED (TCBASE+11) #define ERROR_TC_SUPPORTED_OBJECTS_EXIST (TCBASE+12) #define ERROR_INCOMPATABLE_QOS (TCBASE+13) #define ERROR_TC_NOT_SUPPORTED (TCBASE+14) #define ERROR_TC_OBJECT_LENGTH_INVALID (TCBASE+15) #define ERROR_INVALID_FLOW_MODE (TCBASE+16) #define ERROR_INVALID_DIFFSERV_FLOW (TCBASE+17) #define ERROR_DS_MAPPING_EXISTS (TCBASE+18) #define ERROR_INVALID_SHAPE_RATE (TCBASE+19) #define ERROR_INVALID_DS_CLASS (TCBASE+20) #define ERROR_TOO_MANY_CLIENTS (TCBASE+21) #endif
// Copyright (c) 2018 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 GPU_COMMAND_BUFFER_SERVICE_PASSTHROUGH_DISCARDABLE_MANAGER_H_ #define GPU_COMMAND_BUFFER_SERVICE_PASSTHROUGH_DISCARDABLE_MANAGER_H_ #include "base/containers/lru_cache.h" #include "base/memory/memory_pressure_listener.h" #include "gpu/command_buffer/common/discardable_handle.h" #include "gpu/gpu_gles2_export.h" namespace gpu { struct GpuPreferences; namespace gles2 { class TexturePassthrough; class ContextGroup; } // namespace gles2 class GPU_GLES2_EXPORT PassthroughDiscardableManager { public: explicit PassthroughDiscardableManager(const GpuPreferences& preferences); PassthroughDiscardableManager(const PassthroughDiscardableManager&) = delete; PassthroughDiscardableManager& operator=( const PassthroughDiscardableManager&) = delete; ~PassthroughDiscardableManager(); void InitializeTexture(uint32_t client_id, const gles2::ContextGroup* context_group, size_t texture_size, ServiceDiscardableHandle handle); bool UnlockTexture(uint32_t client_id, const gles2::ContextGroup* context_group, gles2::TexturePassthrough** texture_to_unbind); bool LockTexture(uint32_t client_id, const gles2::ContextGroup* context_group); // Called when a context group is deleted, clean up all textures from this // group. void DeleteContextGroup(const gles2::ContextGroup* context_group, bool has_context); // Called when all contexts with cached textures in this manager are lost. void OnContextLost(); // Called when a texture is deleted, to clean up state. void DeleteTexture(uint32_t client_id, const gles2::ContextGroup* context_group); // Called when a texture's size may have changed void UpdateTextureSize(uint32_t client_id, const gles2::ContextGroup* context_group, size_t new_size); void HandleMemoryPressure( base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); // Test only functions size_t NumCacheEntriesForTesting() const { return cache_.size(); } bool IsEntryLockedForTesting(uint32_t client_id, const gles2::ContextGroup* context_group) const; size_t TotalSizeForTesting() const { return total_size_; } bool IsEntryTrackedForTesting(uint32_t client_id, const gles2::ContextGroup* context_group) const; scoped_refptr<gles2::TexturePassthrough> UnlockedTextureForTesting( uint32_t client_id, const gles2::ContextGroup* context_group) const; void SetCacheSizeLimitForTesting(size_t cache_size_limit) { cache_size_limit_ = cache_size_limit; } private: void EnforceCacheSizeLimit(size_t limit); using DiscardableCacheKey = std::pair<uint32_t, const gles2::ContextGroup*>; struct DiscardableCacheValue { DiscardableCacheValue(); DiscardableCacheValue(const DiscardableCacheValue& other); DiscardableCacheValue(DiscardableCacheValue&& other); DiscardableCacheValue& operator=(const DiscardableCacheValue& other); DiscardableCacheValue& operator=(DiscardableCacheValue&& other); ~DiscardableCacheValue(); ServiceDiscardableHandle handle; uint32_t lock_count = 1; scoped_refptr<gles2::TexturePassthrough> unlocked_texture; size_t size = 0; }; // Delete textures belonging to |context_group|. If |context_group| is null // then all textures are deleted. void DeleteTextures(const gles2::ContextGroup* context_group, bool has_context); using DiscardableCache = base::LRUCache<DiscardableCacheKey, DiscardableCacheValue>; DiscardableCache cache_; // Total size of all entries in the cache. The same as summing // DiscardableCacheValue::size for each entry. size_t total_size_ = 0; // The limit above which the cache will start evicting resources. size_t cache_size_limit_ = 0; }; } // namespace gpu #endif // GPU_COMMAND_BUFFER_SERVICE_PASSTHROUGH_DISCARDABLE_MANAGER_H_
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ /* AliAnalysisTaskEx01.h * * Template task producing a P_t spectrum and pseudorapidity distribution. * Includes explanations of physics and primary track selections * * Based on tutorial example from offline pages * Edited by Arvinder Palaha */ #ifndef ALIANALYSISTASKEX01_H #define ALIANALYSISTASKEX01_H class TH1F; class TList; class AliESDtrackCuts; #ifndef ALIANALYSISTASKSE_H #include "AliAnalysisTaskSE.h" #endif class AliAnalysisTaskEx01 : public AliAnalysisTaskSE { public: AliAnalysisTaskEx01(); AliAnalysisTaskEx01(const char *name); virtual ~AliAnalysisTaskEx01(); virtual void UserCreateOutputObjects(); virtual void UserExec(Option_t *option); virtual void Terminate(Option_t *); private: TList *fOutput; // Output list AliESDtrackCuts *fTrackCuts; // Track cuts TH1F *fHistPt; // Pt spectrum TH1F *fHistEta; // pseudorapidity spectrum // NEW HISTO to be declared here AliAnalysisTaskEx01(const AliAnalysisTaskEx01&); // not implemented AliAnalysisTaskEx01& operator=(const AliAnalysisTaskEx01&); // not implemented ClassDef(AliAnalysisTaskEx01, 1); // example of analysis }; #endif
/* * This file is a part of the open source stm32plus library. * Copyright (c) 2011,2012,2013,2014 Andy Brown <www.andybrown.me.uk> * Please see website for licensing terms. */ #pragma once namespace stm32plus { namespace display { /** * Forward declaration for the template specialisations. These drivers are highly optimised * assembly language implementations designed to extract the maximum performance from a GPIO * based design. Each one has been hand-tested and timed with a logic analyser to ensure it * meets its timing requirements. */ template<class TPinPackage,ColourDepth TColourDepth,uint16_t TClockFrequency,uint16_t TLow,uint16_t THigh> class Gpio16BitAccessMode; } }
#ifndef _RTL8370_ASICDRV_EEE_H_ #define _RTL8370_ASICDRV_EEE_H_ #include <rtl8370_asicdrv.h> typedef struct rtl8370_eee_status_s { #ifdef _LITTLE_ENDIAN uint16 eeep_sleep_req:1; uint16 eeep_wake_req:1; uint16 eee_pause_flag:1; uint16 eee_rx:1; uint16 eee_tx:1; uint16 eee_lpi:1; uint16 reserved:10; #else uint16 reserved:10; uint16 eee_lpi:1; uint16 eee_tx:1; uint16 eee_rx:1; uint16 eee_pause_flag:1; uint16 eeep_wake_req:1; uint16 eeep_sleep_req:1; #endif }rtl8370_eee_status_t; extern ret_t rtl8370_setAsicEeeTxEnable(uint32 port, uint32 enable); extern ret_t rtl8370_getAsicEeeTxEnable(uint32 port, uint32 *enable); extern ret_t rtl8370_setAsicEeeRxEnable(uint32 port, uint32 enable); extern ret_t rtl8370_getAsicEeeRxEnable(uint32 port, uint32 *enable); extern ret_t rtl8370_setAsicEeeForceMode(uint32 port, uint32 enable); extern ret_t rtl8370_getAsicEeeForceMode(uint32 port, uint32 *enable); extern ret_t rtl8370_setAsicEee100M(uint32 port, uint32 enable); extern ret_t rtl8370_getAsicEee100M(uint32 port, uint32 *enable); extern ret_t rtl8370_setAsicEeeGiga(uint32 port, uint32 enable); extern ret_t rtl8370_getAsicEeeGiga(uint32 port, uint32 *enable); extern ret_t rtl8370_getAsicEeeTxMeter(uint32 port, uint32 *cnt); extern ret_t rtl8370_getAsicEeeRxMeter(uint32 port, uint32 *cnt); extern ret_t rtl8370_getAsicEeeStatus(uint32 port, rtl8370_eee_status_t *status); #endif /*_RTL8370_ASICDRV_EEE_H_*/
/* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ #include "arm_mve.h" int32x4_t foo (int32x4_t inactive, int32x4_t a, mve_pred16_t p) { return vclsq_m_s32 (inactive, a, p); } /* { dg-final { scan-assembler "vpst" } } */ /* { dg-final { scan-assembler "vclst.s32" } } */ int32x4_t foo1 (int32x4_t inactive, int32x4_t a, mve_pred16_t p) { return vclsq_m (inactive, a, p); } /* { dg-final { scan-assembler "vpst" } } */
/* * This file is part of the coreboot project. * * Copyright (C) 2007 Rudolf Marek <r.marek@assembler.cz> * Copyright (C) 2011 Alexandru Gagniuc <mr.nuke.me@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; 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. */ #include <device/device.h> #include <device/pci.h> #include <device/pci_ops.h> #include <device/pci_ids.h> #include <console/console.h> #include <cbmem.h> #include <arch/io.h> #include "k8x8xx.h" /* this may be later merged */ /* This fine tunes the HT link settings, which were loaded by ROM strap. */ static void host_ctrl_enable_k8t8xx(struct device *dev) { /* * Bit 4 is reserved but set by AW. Set PCI to HT outstanding * requests to 3. */ pci_write_config8(dev, 0xa0, 0x13); /* * NVRAM I/O base at K8T890_NVRAM_IO_BASE * Some bits are set and reserved. */ pci_write_config8(dev, 0xa2, (K8T890_NVRAM_IO_BASE >> 8)); /* enable NB NVRAM and enable non-posted PCI writes. */ pci_write_config8(dev, 0xa1, 0x8f); /* Arbitration control, some bits are reserved. */ pci_write_config8(dev, 0xa5, 0x3c); /* Arbitration control 2 */ pci_write_config8(dev, 0xa6, 0x80); /* this will be possibly removed, when I figure out * if the ROM SIP is good, second reason is that the * unknown bits are AGP related, which are dummy on K8T890 */ writeback(dev, 0xa0, 0x13); /* Bit4 is reserved! */ writeback(dev, 0xa1, 0x8e); /* Some bits are reserved. */ writeback(dev, 0xa2, 0x0e); /* I/O NVRAM base 0xe00-0xeff disabled. */ writeback(dev, 0xa3, 0x31); writeback(dev, 0xa4, 0x30); writeback(dev, 0xa5, 0x3c); /* Some bits reserved. */ writeback(dev, 0xa6, 0x80); /* Some bits reserved. */ writeback(dev, 0xa7, 0x86); /* Some bits reserved. */ writeback(dev, 0xa8, 0x7f); /* Some bits reserved. */ writeback(dev, 0xa9, 0xcf); /* Some bits reserved. */ writeback(dev, 0xaa, 0x44); writeback(dev, 0xab, 0x22); writeback(dev, 0xac, 0x35); /* Maybe bit0 is read-only? */ writeback(dev, 0xae, 0x22); writeback(dev, 0xaf, 0x40); /* b0 is missing. */ writeback(dev, 0xb1, 0x13); writeback(dev, 0xb4, 0x02); /* Some bits are reserved. */ writeback(dev, 0xc0, 0x20); writeback(dev, 0xc1, 0xaa); writeback(dev, 0xc2, 0xaa); writeback(dev, 0xc3, 0x02); writeback(dev, 0xc4, 0x50); writeback(dev, 0xc5, 0x50); printk(BIOS_DEBUG, " VIA_X_2 device dump:\n"); dump_south(dev); } /* This fine tunes the HT link settings, which were loaded by ROM strap. */ static void host_ctrl_enable_k8m8xx(struct device *dev) { /* * Set PCI to HT outstanding requests to 03. * Bit 4 32 AGP ADS Read Outstanding Request Number */ pci_write_config8(dev, 0xa0, 0x13); /* * NVRAM I/O base at K8T890_NVRAM_IO_BASE */ pci_write_config8(dev, 0xa2, (K8T890_NVRAM_IO_BASE >> 8)); /* Enable NVRAM and enable non-posted PCI writes. */ pci_write_config8(dev, 0xa1, 0x8f); /* Arbitration control */ pci_write_config8(dev, 0xa5, 0x3c); /* Arbitration control 2, Enable C2NOW delay to PSTATECTL */ pci_write_config8(dev, 0xa6, 0x83); } #if IS_ENABLED(CONFIG_LATE_CBMEM_INIT) void backup_top_of_ram(uint64_t ramtop) { outl((u32) ramtop, K8T890_NVRAM_IO_BASE+K8T890_NVRAM_TOP_OF_RAM); } #endif static struct pci_operations lops_pci = { .set_subsystem = pci_dev_set_subsystem, }; static const struct device_operations host_ctrl_ops_t = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .enable = host_ctrl_enable_k8t8xx, .ops_pci = &lops_pci, }; static const struct device_operations host_ctrl_ops_m = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .enable = host_ctrl_enable_k8m8xx, .ops_pci = &lops_pci, }; static const struct pci_driver northbridge_driver_t800 __pci_driver = { .ops = &host_ctrl_ops_t, .vendor = PCI_VENDOR_ID_VIA, .device = PCI_DEVICE_ID_VIA_K8T800_HOST_CTR, }; static const struct pci_driver northbridge_driver_m800 __pci_driver = { .ops = &host_ctrl_ops_m, .vendor = PCI_VENDOR_ID_VIA, .device = PCI_DEVICE_ID_VIA_K8M800_HOST_CTR, }; static const struct pci_driver northbridge_driver_t890 __pci_driver = { .ops = &host_ctrl_ops_t, .vendor = PCI_VENDOR_ID_VIA, .device = PCI_DEVICE_ID_VIA_K8T890CE_2, }; static const struct pci_driver northbridge_driver_m890 __pci_driver = { .ops = &host_ctrl_ops_m, .vendor = PCI_VENDOR_ID_VIA, .device = PCI_DEVICE_ID_VIA_K8M890CE_2, };
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" { target { ! ilp32 } } } } */ #include "test_sve_acle.h" /* ** ld1sw_s64_base: ** ld1sw z0\.d, p0/z, \[x0\] ** ret */ TEST_LOAD (ld1sw_s64_base, svint64_t, int32_t, z0 = svld1sw_s64 (p0, x0), z0 = svld1sw_s64 (p0, x0)) /* ** ld1sw_s64_index: ** ld1sw z0\.d, p0/z, \[x0, x1, lsl 2\] ** ret */ TEST_LOAD (ld1sw_s64_index, svint64_t, int32_t, z0 = svld1sw_s64 (p0, x0 + x1), z0 = svld1sw_s64 (p0, x0 + x1)) /* ** ld1sw_s64_1: ** ld1sw z0\.d, p0/z, \[x0, #1, mul vl\] ** ret */ TEST_LOAD (ld1sw_s64_1, svint64_t, int32_t, z0 = svld1sw_s64 (p0, x0 + svcntd ()), z0 = svld1sw_s64 (p0, x0 + svcntd ())) /* ** ld1sw_s64_7: ** ld1sw z0\.d, p0/z, \[x0, #7, mul vl\] ** ret */ TEST_LOAD (ld1sw_s64_7, svint64_t, int32_t, z0 = svld1sw_s64 (p0, x0 + svcntd () * 7), z0 = svld1sw_s64 (p0, x0 + svcntd () * 7)) /* Moving the constant into a register would also be OK. */ /* ** ld1sw_s64_8: ** incb x0, all, mul #4 ** ld1sw z0\.d, p0/z, \[x0\] ** ret */ TEST_LOAD (ld1sw_s64_8, svint64_t, int32_t, z0 = svld1sw_s64 (p0, x0 + svcntd () * 8), z0 = svld1sw_s64 (p0, x0 + svcntd () * 8)) /* ** ld1sw_s64_m1: ** ld1sw z0\.d, p0/z, \[x0, #-1, mul vl\] ** ret */ TEST_LOAD (ld1sw_s64_m1, svint64_t, int32_t, z0 = svld1sw_s64 (p0, x0 - svcntd ()), z0 = svld1sw_s64 (p0, x0 - svcntd ())) /* ** ld1sw_s64_m8: ** ld1sw z0\.d, p0/z, \[x0, #-8, mul vl\] ** ret */ TEST_LOAD (ld1sw_s64_m8, svint64_t, int32_t, z0 = svld1sw_s64 (p0, x0 - svcntd () * 8), z0 = svld1sw_s64 (p0, x0 - svcntd () * 8)) /* Moving the constant into a register would also be OK. */ /* ** ld1sw_s64_m9: ** dech x0, all, mul #9 ** ld1sw z0\.d, p0/z, \[x0\] ** ret */ TEST_LOAD (ld1sw_s64_m9, svint64_t, int32_t, z0 = svld1sw_s64 (p0, x0 - svcntd () * 9), z0 = svld1sw_s64 (p0, x0 - svcntd () * 9)) /* ** ld1sw_vnum_s64_0: ** ld1sw z0\.d, p0/z, \[x0\] ** ret */ TEST_LOAD (ld1sw_vnum_s64_0, svint64_t, int32_t, z0 = svld1sw_vnum_s64 (p0, x0, 0), z0 = svld1sw_vnum_s64 (p0, x0, 0)) /* ** ld1sw_vnum_s64_1: ** ld1sw z0\.d, p0/z, \[x0, #1, mul vl\] ** ret */ TEST_LOAD (ld1sw_vnum_s64_1, svint64_t, int32_t, z0 = svld1sw_vnum_s64 (p0, x0, 1), z0 = svld1sw_vnum_s64 (p0, x0, 1)) /* ** ld1sw_vnum_s64_7: ** ld1sw z0\.d, p0/z, \[x0, #7, mul vl\] ** ret */ TEST_LOAD (ld1sw_vnum_s64_7, svint64_t, int32_t, z0 = svld1sw_vnum_s64 (p0, x0, 7), z0 = svld1sw_vnum_s64 (p0, x0, 7)) /* Moving the constant into a register would also be OK. */ /* ** ld1sw_vnum_s64_8: ** incb x0, all, mul #4 ** ld1sw z0\.d, p0/z, \[x0\] ** ret */ TEST_LOAD (ld1sw_vnum_s64_8, svint64_t, int32_t, z0 = svld1sw_vnum_s64 (p0, x0, 8), z0 = svld1sw_vnum_s64 (p0, x0, 8)) /* ** ld1sw_vnum_s64_m1: ** ld1sw z0\.d, p0/z, \[x0, #-1, mul vl\] ** ret */ TEST_LOAD (ld1sw_vnum_s64_m1, svint64_t, int32_t, z0 = svld1sw_vnum_s64 (p0, x0, -1), z0 = svld1sw_vnum_s64 (p0, x0, -1)) /* ** ld1sw_vnum_s64_m8: ** ld1sw z0\.d, p0/z, \[x0, #-8, mul vl\] ** ret */ TEST_LOAD (ld1sw_vnum_s64_m8, svint64_t, int32_t, z0 = svld1sw_vnum_s64 (p0, x0, -8), z0 = svld1sw_vnum_s64 (p0, x0, -8)) /* Moving the constant into a register would also be OK. */ /* ** ld1sw_vnum_s64_m9: ** dech x0, all, mul #9 ** ld1sw z0\.d, p0/z, \[x0\] ** ret */ TEST_LOAD (ld1sw_vnum_s64_m9, svint64_t, int32_t, z0 = svld1sw_vnum_s64 (p0, x0, -9), z0 = svld1sw_vnum_s64 (p0, x0, -9)) /* Using MUL to calculate an index would also be OK. */ /* ** ld1sw_vnum_s64_x1: ** cnth (x[0-9]+) ** madd (x[0-9]+), (x1, \1|\1, x1), x0 ** ld1sw z0\.d, p0/z, \[\2\] ** ret */ TEST_LOAD (ld1sw_vnum_s64_x1, svint64_t, int32_t, z0 = svld1sw_vnum_s64 (p0, x0, x1), z0 = svld1sw_vnum_s64 (p0, x0, x1))
/* PR 90983/manual documents `-Wno-stack-usage` flag, but it is unrecognized { dg-do compile } { dg-options "-Wall -Wframe-larger-than=123 -Wno-frame-larger-than" } */ void f (void*); void g (void) { char a [1234]; f (a); }
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ #include "test_sve_acle.h" /* ** tbl2_bf16_tied1: ** tbl z0\.h, {z0\.h(?:, | - )z1\.h}, z4\.h ** ret */ TEST_TBL2 (tbl2_bf16_tied1, svbfloat16x2_t, svbfloat16_t, svuint16_t, z0_res = svtbl2_bf16 (z0, z4), z0_res = svtbl2 (z0, z4)) /* ** tbl2_bf16_tied2: ** tbl z0\.h, {z1\.h(?:, | - )z2\.h}, z0\.h ** ret */ TEST_TBL2_REV (tbl2_bf16_tied2, svbfloat16x2_t, svbfloat16_t, svuint16_t, z0_res = svtbl2_bf16 (z1, z0), z0_res = svtbl2 (z1, z0)) /* ** tbl2_bf16_untied: ** tbl z0\.h, {z2\.h(?:, | - )z3\.h}, z4\.h ** ret */ TEST_TBL2 (tbl2_bf16_untied, svbfloat16x2_t, svbfloat16_t, svuint16_t, z0_res = svtbl2_bf16 (z2, z4), z0_res = svtbl2 (z2, z4))
/* File: AUPlugInDispatch.h Abstract: Part of CoreAudio Utility Classes Version: 1.01 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (C) 2012 Apple Inc. All Rights Reserved. */ #ifndef __AUPlugInBase_h__ #define __AUPlugInBase_h__ #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__) #include <AudioUnit/AudioComponent.h> #if !CA_BASIC_AU_FEATURES #include <AudioUnit/MusicDevice.h> #endif #else #include "AudioComponent.h" #include "MusicDevice.h" #endif #include "ComponentBase.h" struct AUBaseLookup { static AudioComponentMethod Lookup (SInt16 selector); }; template <class Implementor> class AUBaseFactory : public APFactory<AUBaseLookup, Implementor> { }; struct AUOutputLookup { static AudioComponentMethod Lookup (SInt16 selector); }; template <class Implementor> class AUOutputBaseFactory : public APFactory<AUOutputLookup, Implementor> { }; struct AUComplexOutputLookup { static AudioComponentMethod Lookup (SInt16 selector); }; template <class Implementor> class AUOutputComplexBaseFactory : public APFactory<AUComplexOutputLookup, Implementor> { }; struct AUBaseProcessLookup { static AudioComponentMethod Lookup (SInt16 selector); }; template <class Implementor> class AUBaseProcessFactory : public APFactory<AUBaseProcessLookup, Implementor> { }; struct AUBaseProcessMultipleLookup { static AudioComponentMethod Lookup (SInt16 selector); }; template <class Implementor> class AUBaseProcessMultipleFactory : public APFactory<AUBaseProcessMultipleLookup, Implementor> { }; #if !CA_BASIC_AU_FEATURES struct AUMIDILookup { static AudioComponentMethod Lookup (SInt16 selector); }; template <class Implementor> class AUMIDIEffectFactory : public APFactory<AUMIDILookup, Implementor> { }; struct AUMIDIProcessLookup { static AudioComponentMethod Lookup (SInt16 selector); }; template <class Implementor> class AUMIDIProcessFactory : public APFactory<AUMIDIProcessLookup, Implementor> { }; struct AUMusicLookup { static AudioComponentMethod Lookup (SInt16 selector); }; template <class Implementor> class AUMusicDeviceFactory : public APFactory<AUMusicLookup, Implementor> { }; #endif // CA_BASIC_AU_FEATURES #endif // __AUPlugInBase_h__
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** 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 The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/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 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QDEVICEDISCOVERY_UDEV_H #define QDEVICEDISCOVERY_UDEV_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include "qdevicediscovery_p.h" #include <libudev.h> QT_BEGIN_NAMESPACE class QDeviceDiscoveryUDev : public QDeviceDiscovery { Q_OBJECT public: QDeviceDiscoveryUDev(QDeviceTypes types, struct udev *udev, QObject *parent = 0); ~QDeviceDiscoveryUDev(); QStringList scanConnectedDevices() Q_DECL_OVERRIDE; private slots: void handleUDevNotification(); private: bool checkDeviceType(struct udev_device *dev); void startWatching(); void stopWatching(); struct udev *m_udev; struct udev_monitor *m_udevMonitor; int m_udevMonitorFileDescriptor; QSocketNotifier *m_udevSocketNotifier; }; QT_END_NAMESPACE #endif // QDEVICEDISCOVERY_UDEV_H
/* -*- c++ -*- */ /* * Copyright 2002 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef _ATSC_DATA_INTERLEAVER_H_ #define _ATSC_DATA_INTERLEAVER_H_ #include <atsc_types.h> #include <convolutional_interleaver.h> /*! * \brief atsc convolutional data interleaver */ class atsci_data_interleaver : public convolutional_interleaver<unsigned char> { public: atsci_data_interleaver () : convolutional_interleaver<unsigned char>(true, 52, 4) {} void interleave (atsc_mpeg_packet_rs_encoded &out, const atsc_mpeg_packet_rs_encoded &in); }; /*! * \brief atsc convolutional data deinterleaver */ class atsci_data_deinterleaver : public convolutional_interleaver<unsigned char> { public: atsci_data_deinterleaver () : convolutional_interleaver<unsigned char>(false, 52, 4), alignment_fifo (156) {} void deinterleave (atsc_mpeg_packet_rs_encoded &out, const atsc_mpeg_packet_rs_encoded &in); private: /*! * Note: The use of the alignment_fifo keeps the encoder and decoder * aligned if both are synced to a field boundary. There may be other * ways to implement this function. This is a best guess as to how * this should behave, as we have no test vectors for either the * interleaver or deinterleaver. */ interleaver_fifo<unsigned char> alignment_fifo; static void remap_pli (plinfo &out, const plinfo &in); }; #endif /* _ATSC_DATA_INTERLEAVER_H_ */
/* * QEMUFile backend for QIOChannel objects * * Copyright (c) 2015-2016 Red Hat, Inc * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE 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 "qemu/osdep.h" #include "migration/qemu-file.h" #include "io/channel-socket.h" #include "qemu/iov.h" static ssize_t channel_writev_buffer(void *opaque, struct iovec *iov, int iovcnt, int64_t pos) { QIOChannel *ioc = QIO_CHANNEL(opaque); ssize_t done = 0; struct iovec *local_iov = g_new(struct iovec, iovcnt); struct iovec *local_iov_head = local_iov; unsigned int nlocal_iov = iovcnt; nlocal_iov = iov_copy(local_iov, nlocal_iov, iov, iovcnt, 0, iov_size(iov, iovcnt)); while (nlocal_iov > 0) { ssize_t len; len = qio_channel_writev(ioc, local_iov, nlocal_iov, NULL); if (len == QIO_CHANNEL_ERR_BLOCK) { qio_channel_wait(ioc, G_IO_OUT); continue; } if (len < 0) { /* XXX handle Error objects */ done = -EIO; goto cleanup; } iov_discard_front(&local_iov, &nlocal_iov, len); done += len; } cleanup: g_free(local_iov_head); return done; } static ssize_t channel_get_buffer(void *opaque, uint8_t *buf, int64_t pos, size_t size) { QIOChannel *ioc = QIO_CHANNEL(opaque); ssize_t ret; do { ret = qio_channel_read(ioc, (char *)buf, size, NULL); if (ret < 0) { if (ret == QIO_CHANNEL_ERR_BLOCK) { qio_channel_yield(ioc, G_IO_IN); } else { /* XXX handle Error * object */ return -EIO; } } } while (ret == QIO_CHANNEL_ERR_BLOCK); return ret; } static int channel_close(void *opaque) { QIOChannel *ioc = QIO_CHANNEL(opaque); qio_channel_close(ioc, NULL); object_unref(OBJECT(ioc)); return 0; } static int channel_shutdown(void *opaque, bool rd, bool wr) { QIOChannel *ioc = QIO_CHANNEL(opaque); if (qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_SHUTDOWN)) { QIOChannelShutdown mode; if (rd && wr) { mode = QIO_CHANNEL_SHUTDOWN_BOTH; } else if (rd) { mode = QIO_CHANNEL_SHUTDOWN_READ; } else { mode = QIO_CHANNEL_SHUTDOWN_WRITE; } if (qio_channel_shutdown(ioc, mode, NULL) < 0) { /* XXX handler Error * object */ return -EIO; } } return 0; } static int channel_set_blocking(void *opaque, bool enabled) { QIOChannel *ioc = QIO_CHANNEL(opaque); if (qio_channel_set_blocking(ioc, enabled, NULL) < 0) { return -1; } return 0; } static QEMUFile *channel_get_input_return_path(void *opaque) { QIOChannel *ioc = QIO_CHANNEL(opaque); return qemu_fopen_channel_output(ioc); } static QEMUFile *channel_get_output_return_path(void *opaque) { QIOChannel *ioc = QIO_CHANNEL(opaque); return qemu_fopen_channel_input(ioc); } static const QEMUFileOps channel_input_ops = { .get_buffer = channel_get_buffer, .close = channel_close, .shut_down = channel_shutdown, .set_blocking = channel_set_blocking, .get_return_path = channel_get_input_return_path, }; static const QEMUFileOps channel_output_ops = { .writev_buffer = channel_writev_buffer, .close = channel_close, .shut_down = channel_shutdown, .set_blocking = channel_set_blocking, .get_return_path = channel_get_output_return_path, }; QEMUFile *qemu_fopen_channel_input(QIOChannel *ioc) { object_ref(OBJECT(ioc)); return qemu_fopen_ops(ioc, &channel_input_ops); } QEMUFile *qemu_fopen_channel_output(QIOChannel *ioc) { object_ref(OBJECT(ioc)); return qemu_fopen_ops(ioc, &channel_output_ops); }
/*========================================================================= Program: Visualization Toolkit Module: vtkMatlabEngineFilter.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. =========================================================================*/ /*------------------------------------------------------------------------- Copyright 2009 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------*/ // .NAME vtkMatlabEngineFilter // // .SECTION Description // // This VTK uses the vtkMatlabEngineInterface class to perform calculations on // VTK array input using the Matlab Engine. // // .SECTION See Also // vtkMatlabMexAdapter vtkMatlabMexInterface // // .SECTION Thanks // Developed by Thomas Otahal at Sandia National Laboratories. // #ifndef vtkMatlabEngineFilter_h #define vtkMatlabEngineFilter_h #include "vtkFiltersMatlabModule.h" #include "vtkDataObjectAlgorithm.h" class vtkMatlabEngineInterface; class vtkMatlabEngineFilterInternals; class vtkDataSet; class vtkDoubleArray; class VTKFILTERSMATLAB_EXPORT vtkMatlabEngineFilter : public vtkDataObjectAlgorithm { public: static vtkMatlabEngineFilter *New(); vtkTypeMacro(vtkMatlabEngineFilter, vtkDataObjectAlgorithm ); void PrintSelf(ostream& os, vtkIndent indent); // Description: // Copies vtkDataArray named NameOfVTKArray to the Matlab engine with Matlab variable // name NameOfMatVar. The array must exist in the input data set. // // Note: for vtkArray use "0","1","2",... for NameOfVTKArray to specify the index of // the vtkArray to pass to the Matlab Engine. void PutArray(const char* NameOfVTKArray, const char* NameOfMatVar); // Description: // Copies Matlab variable NameOfMatVar from the Matlab Engine to the vtkDataArray named // NameOfVTKArray. Will replace existing vtkDataArray with the same name. // // Note: for vtkArray use any string for NameOfVTKArray. The array will be appended // to the list of vtkArrays on the output. void GetArray(const char* NameOfVTKArray, const char* NameOfMatVar); // Description: // Clears the list of variables to be copied to the Matlab engine. void RemoveAllPutVariables(); // Description: // Clears the list of variables to be copied from the Matlab engine. void RemoveAllGetVariables(); // Description: // Matlab script executed by the Matlab Engine. Can also be set from a file. vtkSetStringMacro(MatlabScript); vtkGetStringMacro(MatlabScript); // Description: // Provide Matlab script executed by the Matlab Engine from an input file. vtkSetStringMacro(ScriptFname); vtkGetStringMacro(ScriptFname); // Description: // Make Matlab Engine console visible. Default is off. vtkSetMacro(EngineVisible,int); vtkGetMacro(EngineVisible,int); // Description: // Write Matlab Engine text output to standard output. vtkSetMacro(EngineOutput,int); vtkGetMacro(EngineOutput,int); // Description: // Pass VTK time information to Matlab. // If turned turned on, the filter will create three variables on the // Matlab engine. The variables will be update automatically as time // changes in the VTK pipeline. // VTK_TIME_STEPS - array of all available time values. // VTK_TIME_RANGE- array of minimum and maximum time values. // VTK_CURRENT_TIME - floating point time value at the current time index. vtkSetMacro(TimeOutput,int); vtkGetMacro(TimeOutput,int); // Description: // Create VTK_BLOCK_ID and VTK_NUMBER_OF_BLOCKS variables in Matlab // when processing composite data sets. vtkSetMacro(BlockInfoOutput,int); vtkGetMacro(BlockInfoOutput,int); // Description: // This is required to capture REQUEST_DATA_OBJECT requests. virtual int ProcessRequest(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector); protected: int SetMatlabScriptFromFile(const char* fname); virtual int RequestData(vtkInformation *vtkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector); // Description: // Creates the same output type as the input type. virtual int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector); vtkMatlabEngineFilter(); ~vtkMatlabEngineFilter(); private: vtkMatlabEngineFilter(const vtkMatlabEngineFilter&); // Not implemented. void operator=(const vtkMatlabEngineFilter&); // Not implemented. // Implementation details vtkMatlabEngineFilterInternals* mefi; int ProcessDataSet(vtkDataSet* dsinp, vtkDataSet* dsout); vtkMatlabEngineInterface* mengi; char* MatlabScript; char* MatlabFileScript; char* ScriptFname; int EngineVisible; int EngineOutput; int TimeOutput; int BlockInfoOutput; char* OutputBuffer; vtkDoubleArray* CurrentTime; vtkDoubleArray* TimeRange; vtkDoubleArray* TimeSteps; vtkDoubleArray* BlockId; vtkDoubleArray* NumBlocks; }; #endif
// Copyright (c) 2020 André Perez Maselco // // 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 SOURCE_FUZZ_TRANSFORMATION_PUSH_ID_THROUGH_VARIABLE_H_ #define SOURCE_FUZZ_TRANSFORMATION_PUSH_ID_THROUGH_VARIABLE_H_ #include "source/fuzz/protobufs/spirvfuzz_protobufs.h" #include "source/fuzz/transformation.h" #include "source/fuzz/transformation_context.h" #include "source/opt/ir_context.h" namespace spvtools { namespace fuzz { class TransformationPushIdThroughVariable : public Transformation { public: explicit TransformationPushIdThroughVariable( protobufs::TransformationPushIdThroughVariable message); TransformationPushIdThroughVariable( uint32_t value_id, uint32_t value_synonym_fresh_id, uint32_t variable_fresh_id, uint32_t variable_storage_class, uint32_t initializer_id, const protobufs::InstructionDescriptor& instruction_descriptor); // - |message_.value_id| must be an instruction result id that has the same // type as the pointee type of |message_.pointer_id| // - |message_.value_synonym_id| must be fresh // - |message_.variable_id| must be fresh // - |message_.variable_storage_class| must be either StorageClassPrivate or // StorageClassFunction // - |message_.initializer_id| must be a result id of some constant in the // module. Its type must be equal to the pointee type of the variable that // will be created. // - |message_.instruction_descriptor| must identify an instruction // which it is valid to insert the OpStore and OpLoad instructions before it // and must be belongs to a reachable block. bool IsApplicable( opt::IRContext* ir_context, const TransformationContext& transformation_context) const override; // Stores |value_id| to |variable_id|, loads |variable_id| to // |value_synonym_id|. Adds the fact that |value_synonym_id| and |value_id| // are synonymous if |value_id| and |value_synonym_id| are not irrelevant. void Apply(opt::IRContext* ir_context, TransformationContext* transformation_context) const override; std::unordered_set<uint32_t> GetFreshIds() const override; protobufs::Transformation ToMessage() const override; private: protobufs::TransformationPushIdThroughVariable message_; }; } // namespace fuzz } // namespace spvtools #endif // SOURCE_FUZZ_TRANSFORMATION_PUSH_ID_THROUGH_VARIABLE_H_
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file pointParticle.h * @author charles * @date 2000-06-19 */ #ifndef POINTPARTICLE_H #define POINTPARTICLE_H #include "baseParticle.h" /** * Describes a particle that requires representation by a point (pixel, * sparkle, billboard) */ class EXPCL_PANDA_PARTICLESYSTEM PointParticle : public BaseParticle { public: PointParticle(PN_stdfloat lifespan = 0.0f, bool alive = false); PointParticle(const PointParticle &copy); virtual ~PointParticle(); virtual void init(); virtual void die(); virtual void update(); virtual PhysicsObject *make_copy() const; virtual void output(std::ostream &out) const; virtual void write(std::ostream &out, int indent=0) const; }; #endif // POINTPARTICLE_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. */ #import <UIKit/UIKit.h> #import <IGListKit/IGListMacros.h> @class IGListAdapter; @class IGListSectionController; @protocol IGListSectionType; NS_ASSUME_NONNULL_BEGIN IGLK_SUBCLASSING_RESTRICTED @interface IGListDisplayHandler : NSObject /** Tells the handler that a cell will be displayed in the IGListKit infra. @param cell A cell that will display. @param listAdapter The adapter managing the infra. @param sectionController The section controller the cell is in. @param object The object associated with the section controller. @param indexPath The index path of the cell in the UICollectionView. */ - (void)willDisplayCell:(UICollectionViewCell *)cell forListAdapter:(IGListAdapter *)listAdapter sectionController:(IGListSectionController<IGListSectionType> *)sectionController object:(id)object indexPath:(NSIndexPath *)indexPath; /** Tells the handler that a cell did end display in the IGListKit infra. @param cell A cell that did end display. @param listAdapter The adapter managing the infra. @param sectionController The section controller the cell is in. @param indexPath The index path of the cell in the UICollectionView. */ - (void)didEndDisplayingCell:(UICollectionViewCell *)cell forListAdapter:(IGListAdapter *)listAdapter sectionController:(IGListSectionController<IGListSectionType> *)sectionController indexPath:(NSIndexPath *)indexPath; @end NS_ASSUME_NONNULL_END
#ifndef WARPTIMESERIESIMAGEMULTITRANSFORM_H #define WARPTIMESERIESIMAGEMULTITRANSFORM_H namespace ants { extern int WarpTimeSeriesImageMultiTransform( std::vector<std::string>, // equivalent to argv of command line parameters to // main() std::ostream* out_stream // [optional] output stream to write ); } // namespace ants #endif // WARPTIMESERIESIMAGEMULTITRANSFORM_H
// Copyright 2019 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 MEDIA_GPU_TEST_VIDEO_PLAYER_FRAME_RENDERER_THUMBNAIL_H_ #define MEDIA_GPU_TEST_VIDEO_PLAYER_FRAME_RENDERER_THUMBNAIL_H_ #include <map> #include <memory> #include <string> #include <vector> #include "base/files/file_path.h" #include "base/sequence_checker.h" #include "base/synchronization/waitable_event.h" #include "base/thread_annotations.h" #include "base/threading/thread.h" #include "gpu/command_buffer/common/gl2_types.h" #include "media/gpu/test/video_player/frame_renderer.h" namespace gl { class GLContext; class GLSurface; } // namespace gl namespace media { namespace test { // The thumbnail frame renderer draws a thumbnail of each frame into a large // image containing 10x10 thumbnails. The checksum of this image can then be // compared to a golden value. // Rendering introduces small platform-dependant differences, so multiple golden // values need to be maintained. The thumbnail frame renderer should only be // used on older platforms that are not supported by the FrameValidator, and // will be deprecated soon. class FrameRendererThumbnail : public FrameRenderer { public: FrameRendererThumbnail(const FrameRendererThumbnail&) = delete; FrameRendererThumbnail& operator=(const FrameRendererThumbnail&) = delete; ~FrameRendererThumbnail() override; // Create an instance of the thumbnail frame renderer. static std::unique_ptr<FrameRendererThumbnail> Create( const std::vector<std::string> thumbnail_checksums, const base::FilePath& output_folder); // FrameRenderer implementation // Acquire the GL context on the |renderer_task_runner_|. This needs to be // called before executing any GL-related functions. The context will remain // current on the |renderer_task_runner_| until the renderer is destroyed. bool AcquireGLContext() override; // Get the active GL context on the |renderer_task_runner_|. gl::GLContext* GetGLContext() override; void RenderFrame(scoped_refptr<VideoFrame> video_frame) override; void WaitUntilRenderingDone() override; scoped_refptr<VideoFrame> CreateVideoFrame(VideoPixelFormat pixel_format, const gfx::Size& texture_size, uint32_t texture_target, uint32_t* texture_id) override; // Validate the thumbnail image by comparing it against known golden values. bool ValidateThumbnail(); private: explicit FrameRendererThumbnail( const std::vector<std::string>& thumbnail_checksums, const base::FilePath& output_folder); // Initialize the frame renderer, performs all rendering-related setup. void Initialize(); // Perform cleanup on the |renderer_task_runner_|, releases the GL context. void DestroyTask(base::WaitableEvent* done); // Initialize the thumbnail image the frame thumbnails will be rendered to on // the |renderer_task_runner_|. void InitializeThumbnailImageTask(); // Destroy the thumbnail image on the |renderer_task_runner_|. void DestroyThumbnailImageTask(); // Render the texture with specified |texture_id| to the thumbnail image on // the |renderer_task_runner_|. void RenderThumbnailTask(uint32_t texture_target, uint32_t texture_id); // Convert the thumbnail image to RGBA on the |renderer_task_runner_|. const std::vector<uint8_t> ConvertThumbnailToRGBATask(); // Validate the thumbnail image on the |renderer_task_runner_|. The validated // thumbnail will be saved to disk on failure. void ValidateThumbnailTask(bool* success, base::WaitableEvent* done); // Save the thumbnail image to disk on the |renderer_task_runner_|. void SaveThumbnailTask(); // Destroy the texture associated with the |mailbox| on the // |renderer_task_runner_|. void DeleteTextureTask(const gpu::Mailbox& mailbox, const gpu::SyncToken&); // The number of frames rendered so far. size_t frame_count_ = 0u; // The list of thumbnail checksums for all platforms. const std::vector<std::string> thumbnail_checksums_; // Map between mailboxes and texture id's. std::map<gpu::Mailbox, uint32_t> mailbox_texture_map_; // Id of the frame buffer used to render the thumbnails image. GLuint thumbnails_fbo_id_ = 0u; // Size of the frame buffer used to render the thumbnails image. gfx::Size thumbnails_fbo_size_; // Texture id of the thumbnails image. GLuint thumbnails_texture_id_ = 0u; // Size of the individual thumbnails rendered to the thumbnails image. gfx::Size thumbnail_size_; // Vertex buffer used to render thumbnails to the thumbnails image. GLuint vertex_buffer_ = 0u; // Shader program used to render thumbnails to the thumbnails image. GLuint program_ = 0u; // GL context used for rendering. scoped_refptr<gl::GLContext> gl_context_; // GL surface used for rendering. scoped_refptr<gl::GLSurface> gl_surface_; // Whether GL was initialized, as it should only happen once. static bool gl_initialized_; // Output folder the thumbnails image will be written to by SaveThumbnail(). const base::FilePath output_folder_; // Renderer thread task runner. scoped_refptr<base::SequencedTaskRunner> renderer_task_runner_; SEQUENCE_CHECKER(client_sequence_checker_); SEQUENCE_CHECKER(renderer_sequence_checker_); }; } // namespace test } // namespace media #endif // MEDIA_GPU_TEST_VIDEO_PLAYER_FRAME_RENDERER_THUMBNAIL_H_
// ========================================================================== // SeqAn - The Library for Sequence Analysis // ========================================================================== // Copyright (c) 2006-2012, Knut Reinert, FU Berlin // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of Knut Reinert or the FU Berlin 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 KNUT REINERT OR THE FU BERLIN 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. // // ========================================================================== // Umbrella header for the basic module. // ========================================================================== #ifndef SEQAN_CORE_INCLUDE_SEQAN_BASIC_H_ #define SEQAN_CORE_INCLUDE_SEQAN_BASIC_H_ // TODO(holtgrew): Remove the SEQAN_CHECKPOINT macro later. #define SEQAN_CHECKPOINT // -------------------------------------------------------------------------- // Prerequisites // -------------------------------------------------------------------------- #include <seqan/platform.h> // -------------------------------------------------------------------------- // Include Sub Modules // -------------------------------------------------------------------------- // Code for debugging and testing (assertions, test system) and profiling. #include <seqan/basic/basic_debug.h> // C++ Metaprogramming Support Code, generally independent of SeqAn. #include <seqan/basic/basic_metaprogramming.h> // Fundamental meta and global functions. This is what makes SeqAn SeqAn. #include <seqan/basic/basic_fundamental.h> // SeqAn Concept Checking Library (ported from Boost). #include <seqan/basic/basic_concept.h> // Alphabet concept and biological implementations. #include <seqan/basic/basic_alphabet.h> // Aggregate data types (pairs, triples, tuples). #include <seqan/basic/basic_aggregate.h> // Memory allocation code. #include <seqan/basic/basic_allocator.h> // High level parallelism support. #include <seqan/basic/basic_parallelism.h> // Mathematical functions and utilities. #include <seqan/basic/basic_math.h> // Smart pointers, including Holder<> class hierarchy. #include <seqan/basic/basic_smart_pointer.h> // Iterator concept and implementation. #include <seqan/basic/basic_iterator.h> // Proxy class and supporting code. #include <seqan/basic/basic_proxy.h> // Container concept and supporting code. #include <seqan/basic/basic_container.h> // Remaining code with cyclic dependencies. #include <seqan/basic/basic_tangle.h> #endif // #ifndef SEQAN_CORE_INCLUDE_SEQAN_BASIC_H_
#ifndef VTADJ_H #define VTADJ_H #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include "assimp/types.h" #include "assimp/mesh.h" #include <VertexTriangleAdjacency.h> using namespace std; using namespace Assimp; class VTAdjacency : public CPPUNIT_NS :: TestFixture { CPPUNIT_TEST_SUITE (VTAdjacency); CPPUNIT_TEST (largeRandomDataSet); CPPUNIT_TEST (smallDataSet); CPPUNIT_TEST (unreferencedVerticesSet); CPPUNIT_TEST_SUITE_END (); public: void setUp (void); void tearDown (void); protected: void largeRandomDataSet (void); void smallDataSet (void); void unreferencedVerticesSet (void); void checkMesh(aiMesh* pMesh); private: VertexTriangleAdjacency* pAdj; aiMesh* pMesh, *pMesh2, *pMesh3; }; #endif
/* * Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt) * * This source code is licensed under the MIT-style license found in the * license.txt file in the root directory of this source tree. * * * Header file redirection to keep source compatibility with RakNet 4.082. */ #include "include/slikenet/DS_BytePool.h"
/* Copyright (c) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc. Use is subject to license terms. 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 */ /* Support rutiner with are using with dbug */ #include "myisamdef.h" /* Print a key in user understandable format */ void _mi_print_key(FILE *stream, register HA_KEYSEG *keyseg, const uchar *key, uint length) { int flag; short int s_1; long int l_1; float f_1; double d_1; const uchar *end; const uchar *key_end=key+length; VOID(fputs("Key: \"",stream)); flag=0; for (; keyseg->type && key < key_end ;keyseg++) { if (flag++) VOID(putc('-',stream)); end= key+ keyseg->length; if (keyseg->flag & HA_NULL_PART) { /* A NULL value is encoded by a 1-byte flag. Zero means NULL. */ if (! *(key++)) { fprintf(stream,"NULL"); continue; } } switch (keyseg->type) { case HA_KEYTYPE_BINARY: if (!(keyseg->flag & HA_SPACE_PACK) && keyseg->length == 1) { /* packed binary digit */ VOID(fprintf(stream,"%d",(uint) *key++)); break; } /* fall through */ case HA_KEYTYPE_TEXT: case HA_KEYTYPE_NUM: if (keyseg->flag & HA_SPACE_PACK) { VOID(fprintf(stream,"%.*s",(int) *key,key+1)); key+= (int) *key+1; } else { VOID(fprintf(stream,"%.*s",(int) keyseg->length,key)); key=end; } break; case HA_KEYTYPE_INT8: VOID(fprintf(stream,"%d",(int) *((signed char*) key))); key=end; break; case HA_KEYTYPE_SHORT_INT: s_1= mi_sint2korr(key); VOID(fprintf(stream,"%d",(int) s_1)); key=end; break; case HA_KEYTYPE_USHORT_INT: { ushort u_1; u_1= mi_uint2korr(key); VOID(fprintf(stream,"%u",(uint) u_1)); key=end; break; } case HA_KEYTYPE_LONG_INT: l_1=mi_sint4korr(key); VOID(fprintf(stream,"%ld",l_1)); key=end; break; case HA_KEYTYPE_ULONG_INT: l_1=mi_sint4korr(key); VOID(fprintf(stream,"%lu",(ulong) l_1)); key=end; break; case HA_KEYTYPE_INT24: VOID(fprintf(stream,"%ld",(long) mi_sint3korr(key))); key=end; break; case HA_KEYTYPE_UINT24: VOID(fprintf(stream,"%lu",(ulong) mi_uint3korr(key))); key=end; break; case HA_KEYTYPE_FLOAT: mi_float4get(f_1,key); VOID(fprintf(stream,"%g",(double) f_1)); key=end; break; case HA_KEYTYPE_DOUBLE: mi_float8get(d_1,key); VOID(fprintf(stream,"%g",d_1)); key=end; break; #ifdef HAVE_LONG_LONG case HA_KEYTYPE_LONGLONG: { char buff[21]; longlong2str(mi_sint8korr(key),buff,-10); VOID(fprintf(stream,"%s",buff)); key=end; break; } case HA_KEYTYPE_ULONGLONG: { char buff[21]; longlong2str(mi_sint8korr(key),buff,10); VOID(fprintf(stream,"%s",buff)); key=end; break; } case HA_KEYTYPE_BIT: { uint i; fputs("0x",stream); for (i=0 ; i < keyseg->length ; i++) fprintf(stream, "%02x", (uint) *key++); key= end; break; } #endif case HA_KEYTYPE_VARTEXT1: /* VARCHAR and TEXT */ case HA_KEYTYPE_VARTEXT2: /* VARCHAR and TEXT */ case HA_KEYTYPE_VARBINARY1: /* VARBINARY and BLOB */ case HA_KEYTYPE_VARBINARY2: /* VARBINARY and BLOB */ { uint tmp_length; get_key_length(tmp_length,key); /* The following command sometimes gives a warning from valgrind. Not yet sure if the bug is in valgrind, glibc or mysqld */ VOID(fprintf(stream,"%.*s",(int) tmp_length,key)); key+=tmp_length; break; } default: break; /* This never happens */ } } VOID(fputs("\"\n",stream)); return; } /* print_key */ #ifdef EXTRA_DEBUG my_bool check_table_is_closed(const char *name, const char *where) { char filename[FN_REFLEN]; LIST *pos; DBUG_ENTER("check_table_is_closed"); (void) fn_format(filename,name,"",MI_NAME_IEXT,4+16+32); for (pos=myisam_open_list ; pos ; pos=pos->next) { MI_INFO *info=(MI_INFO*) pos->data; MYISAM_SHARE *share=info->s; if (!strcmp(share->unique_file_name,filename)) { if (share->last_version) { fprintf(stderr,"Warning: Table: %s is open on %s\n", name,where); DBUG_PRINT("warning",("Table: %s is open on %s", name,where)); DBUG_RETURN(1); } } } DBUG_RETURN(0); } #endif /* EXTRA_DEBUG */
/**************************************************************************** * Driver for Solarflare Solarstorm network controllers and boards * Copyright 2005-2006 Fen Systems Ltd. * Copyright 2006-2010 Solarflare Communications Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation, incorporated herein by reference. */ #ifndef EFX_EFX_H #define EFX_EFX_H #include "net_driver.h" #include "filter.h" /* PCI IDs */ #define BETHPAGE_A_P_DEVID 0x0803 #define SIENA_A_P_DEVID 0x0813 /* Solarstorm controllers use BAR 0 for I/O space and BAR 2(&3) for memory */ #define EFX_MEM_BAR 2 /* TX */ extern int efx_probe_tx_queue(struct efx_tx_queue *tx_queue); extern void efx_remove_tx_queue(struct efx_tx_queue *tx_queue); extern void efx_init_tx_queue(struct efx_tx_queue *tx_queue); extern void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue); extern void efx_fini_tx_queue(struct efx_tx_queue *tx_queue); extern void efx_release_tx_buffers(struct efx_tx_queue *tx_queue); extern netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev); extern netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb); extern void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index); extern int efx_setup_tc(struct net_device *net_dev, u8 num_tc); extern unsigned int efx_tx_max_skb_descs(struct efx_nic *efx); /* RX */ extern int efx_probe_rx_queue(struct efx_rx_queue *rx_queue); extern void efx_remove_rx_queue(struct efx_rx_queue *rx_queue); extern void efx_init_rx_queue(struct efx_rx_queue *rx_queue); extern void efx_fini_rx_queue(struct efx_rx_queue *rx_queue); extern void efx_rx_strategy(struct efx_channel *channel); extern void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue); extern void efx_rx_slow_fill(unsigned long context); extern void __efx_rx_packet(struct efx_channel *channel, struct efx_rx_buffer *rx_buf, bool checksummed); extern void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index, unsigned int len, bool checksummed, bool discard); extern void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue); #define EFX_MAX_DMAQ_SIZE 4096UL #define EFX_DEFAULT_DMAQ_SIZE 1024UL #define EFX_MIN_DMAQ_SIZE 512UL #define EFX_MAX_EVQ_SIZE 16384UL #define EFX_MIN_EVQ_SIZE 512UL /* Maximum number of TCP segments we support for soft-TSO */ #define EFX_TSO_MAX_SEGS 100 /* The smallest [rt]xq_entries that the driver supports. RX minimum * is a bit arbitrary. For TX, we must have space for at least 2 * TSO skbs. */ #define EFX_RXQ_MIN_ENT 128U #define EFX_TXQ_MIN_ENT(efx) (2 * efx_tx_max_skb_descs(efx)) /* Filters */ extern int efx_probe_filters(struct efx_nic *efx); extern void efx_restore_filters(struct efx_nic *efx); extern void efx_remove_filters(struct efx_nic *efx); extern int efx_filter_insert_filter(struct efx_nic *efx, struct efx_filter_spec *spec, bool replace); extern int efx_filter_remove_filter(struct efx_nic *efx, struct efx_filter_spec *spec); extern void efx_filter_clear_rx(struct efx_nic *efx, enum efx_filter_priority priority); #ifdef CONFIG_RFS_ACCEL extern int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, u16 rxq_index, u32 flow_id); extern bool __efx_filter_rfs_expire(struct efx_nic *efx, unsigned quota); static inline void efx_filter_rfs_expire(struct efx_channel *channel) { if (channel->rfs_filters_added >= 60 && __efx_filter_rfs_expire(channel->efx, 100)) channel->rfs_filters_added -= 60; } #define efx_filter_rfs_enabled() 1 #else static inline void efx_filter_rfs_expire(struct efx_channel *channel) {} #define efx_filter_rfs_enabled() 0 #endif /* Channels */ extern void efx_process_channel_now(struct efx_channel *channel); extern int efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries); /* Ports */ extern int efx_reconfigure_port(struct efx_nic *efx); extern int __efx_reconfigure_port(struct efx_nic *efx); /* Ethtool support */ extern const struct ethtool_ops efx_ethtool_ops; /* Reset handling */ extern int efx_reset(struct efx_nic *efx, enum reset_type method); extern void efx_reset_down(struct efx_nic *efx, enum reset_type method); extern int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok); /* Global */ extern void efx_schedule_reset(struct efx_nic *efx, enum reset_type type); extern int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs, unsigned int rx_usecs, bool rx_adaptive, bool rx_may_override_tx); extern void efx_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs, unsigned int *rx_usecs, bool *rx_adaptive); /* Dummy PHY ops for PHY drivers */ extern int efx_port_dummy_op_int(struct efx_nic *efx); extern void efx_port_dummy_op_void(struct efx_nic *efx); /* MTD */ #ifdef CONFIG_SFC_MTD extern int efx_mtd_probe(struct efx_nic *efx); extern void efx_mtd_rename(struct efx_nic *efx); extern void efx_mtd_remove(struct efx_nic *efx); #else static inline int efx_mtd_probe(struct efx_nic *efx) { return 0; } static inline void efx_mtd_rename(struct efx_nic *efx) {} static inline void efx_mtd_remove(struct efx_nic *efx) {} #endif static inline void efx_schedule_channel(struct efx_channel *channel) { netif_vdbg(channel->efx, intr, channel->efx->net_dev, "channel %d scheduling NAPI poll on CPU%d\n", channel->channel, raw_smp_processor_id()); channel->work_pending = true; napi_schedule(&channel->napi_str); } extern void efx_link_status_changed(struct efx_nic *efx); extern void efx_link_set_advertising(struct efx_nic *efx, u32); extern void efx_link_set_wanted_fc(struct efx_nic *efx, u8); #endif /* EFX_EFX_H */
/* * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. * Copyright (c) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> * * Under GPLv2. */ #include <common.h> #include <driver.h> #include <linux/clk.h> #include <linux/err.h> #include <linux/amba/bus.h> #include <io.h> #include <init.h> #define to_amba_driver(d) container_of(d, struct amba_driver, drv) static const struct amba_id * amba_lookup(const struct amba_id *table, struct amba_device *dev) { int ret = 0; while (table->mask) { ret = (dev->periphid & table->mask) == table->id; if (ret) break; table++; } return ret ? table : NULL; } static int amba_match(struct device_d *dev, struct driver_d *drv) { struct amba_device *pcdev = to_amba_device(dev); struct amba_driver *pcdrv = to_amba_driver(drv); return amba_lookup(pcdrv->id_table, pcdev) == NULL; } static int amba_get_enable_pclk(struct amba_device *pcdev) { struct clk *pclk = clk_get(&pcdev->dev, "apb_pclk"); int ret; pcdev->pclk = pclk; if (IS_ERR(pclk)) return PTR_ERR(pclk); ret = clk_enable(pclk); if (ret) { clk_put(pclk); } return ret; } static int amba_probe(struct device_d *dev) { struct amba_device *pcdev = to_amba_device(dev); struct amba_driver *pcdrv = to_amba_driver(dev->driver); const struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev); return pcdrv->probe(pcdev, id); } static void amba_remove(struct device_d *dev) { struct amba_device *pcdev = to_amba_device(dev); struct amba_driver *drv = to_amba_driver(dev->driver); drv->remove(pcdev); } struct bus_type amba_bustype = { .name = "amba", .match = amba_match, .probe = amba_probe, .remove = amba_remove, }; int amba_driver_register(struct amba_driver *drv) { drv->drv.bus = &amba_bustype; if (drv->probe) drv->drv.probe = amba_probe; if (drv->remove) drv->drv.remove = amba_remove; return register_driver(&drv->drv); } /** * amba_device_add - add a previously allocated AMBA device structure * @dev: AMBA device allocated by amba_device_alloc * @parent: resource parent for this devices resources * * Claim the resource, and read the device cell ID if not already * initialized. Register the AMBA device with the Linux device * manager. */ int amba_device_add(struct amba_device *dev) { u32 size; void __iomem *tmp; int ret; struct resource *res = NULL; dev->dev.bus = &amba_bustype; /* * Dynamically calculate the size of the resource * and use this for iomap */ size = resource_size(&dev->res); res = request_iomem_region("amba", dev->res.start, dev->res.end); if (IS_ERR(res)) return PTR_ERR(res); dev->base = tmp = (void __force __iomem *)res->start; if (!tmp) { ret = -ENOMEM; goto err_release; } /* Hard-coded primecell ID instead of plug-n-play */ if (dev->periphid != 0) goto skip_probe; ret = amba_get_enable_pclk(dev); if (ret == 0) { u32 pid, cid; /* * Read pid and cid based on size of resource * they are located at end of region */ pid = amba_device_get_pid(tmp, size); cid = amba_device_get_cid(tmp, size); if (cid == AMBA_CID) dev->periphid = pid; if (!dev->periphid) ret = -ENODEV; } if (ret) goto err_release; skip_probe: ret = register_device(&dev->dev); if (ret) goto err_release; dev_add_param_int_ro(&dev->dev, "periphid", dev->periphid, "0x%08x"); return ret; err_release: release_region(res); return ret; } struct amba_device * amba_aphb_device_add(struct device_d *parent, const char *name, int id, resource_size_t base, size_t size, void *pdata, unsigned int periphid) { struct amba_device *dev; int ret; dev = amba_device_alloc(name, id, base, size); dev->periphid = periphid; dev->dev.platform_data = pdata; dev->dev.parent = parent; ret = amba_device_add(dev); if (ret) return ERR_PTR(ret); return dev; } /** * amba_device_alloc - allocate an AMBA device * @name: sysfs name of the AMBA device * @base: base of AMBA device * @size: size of AMBA device * * Allocate and initialize an AMBA device structure. Returns %NULL * on failure. */ struct amba_device *amba_device_alloc(const char *name, int id, resource_size_t base, size_t size) { struct amba_device *dev; dev = xzalloc(sizeof(*dev)); strcpy(dev->dev.name, name); dev->dev.id = id; dev->res.start = base; dev->res.end = base + size - 1; dev->res.flags = IORESOURCE_MEM; dev->dev.resource = &dev->res; return dev; } static int amba_bus_init(void) { return bus_register(&amba_bustype); } pure_initcall(amba_bus_init);
/* * This file is part of cc-oci-runtime. * * Copyright (C) 2016 Intel Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /*! \file */ #include <errno.h> #include "priv.h" /*! * Determine the privilege level required to execute the sub-command. * * This is awkward given: * * - Some sub-commands do not require root. * - Some sub-commands require root to: * - create directories below \ref CC_OCI_RUNTIME_DIR_PREFIX * (or config->root_dir). * - call mount(2). * - read files created by other commands run as root. * - Some sub-commands that would normally require root don't require it * if passed "--help". * * \note warning: This function can not be totally reliable since at the * time it is called, \ref CC_OCI_CONFIG_FILE has not been parsed so it * cannot know if any mounts will actually need to be performed (some * are ignored). * * \param argc Argument count. * \param argv Argument vector. * \param sub Sub-command. * \param config \ref cc_oci_config. * * \return \c 1 if higher privileges are required, * \c 0 if higher privileges not required, * \c -1 if no potentially privileged setup should be performed. */ gint cc_oci_get_priv_level (int argc, char *argv[], struct subcommand *sub, struct cc_oci_config *config) { g_assert (sub); g_assert (config); if (! (g_strcmp0 (sub->name, "help") && g_strcmp0 (sub->name, "version"))) { /* no privs requires to display metadata sub-command */ return -1; } if (argc > 1) { if (! (g_strcmp0 (argv[1], "--help") && g_strcmp0 (argv[1], "-h"))) { /* no privs requires to display metadata for sub-command */ return -1; } } if (config->root_dir) { if (! access (config->root_dir, W_OK)) { /* alternative root exists and is writable */ return 0; } else if (errno == ENOENT) { gboolean ret; gchar *dir = NULL; dir = g_path_get_dirname (config->root_dir); ret = access (dir, W_OK); g_free (dir); if (ret == 0) { /* parent directory exists and is * writable so the user will be able to * create the new root directory. */ return 0; } else { /* likely to need root */ return 1; } } } else { /* the default root is CC_OCI_RUNTIME_DIR_PREFIX, which * requires root. */ return 1; } /* best to be cautious */ return 1; }
/* =========================================================================== Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. This file is part of Spearmint Source Code. Spearmint 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. Spearmint 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 Spearmint Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, Spearmint 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. 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. =========================================================================== */ /***************************************************************************** * name: be_aas_funcs.h * * desc: AAS * * $Archive: /source/code/botlib/be_aas_funcs.h $ * *****************************************************************************/ #ifndef BSPCINCLUDE #include "be_aas_main.h" #include "be_aas_entity.h" #include "be_aas_sample.h" #include "be_aas_cluster.h" #include "be_aas_reach.h" #include "be_aas_route.h" #include "be_aas_routealt.h" #include "be_aas_debug.h" #include "be_aas_file.h" #include "be_aas_optimize.h" #include "be_aas_bsp.h" #include "be_aas_move.h" #endif //BSPCINCLUDE
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // // --------------------------------------------------------------------------- // // This file was generated by the CEF translator tool. If making changes by // hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // #ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ #define CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ #pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") #else // USING_CEF_SHARED #include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefStreamReaderCToCpp : public CefCToCpp<CefStreamReaderCToCpp, CefStreamReader, cef_stream_reader_t> { public: explicit CefStreamReaderCToCpp(cef_stream_reader_t* str) : CefCToCpp<CefStreamReaderCToCpp, CefStreamReader, cef_stream_reader_t>( str) {} // CefStreamReader methods virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE; virtual int Seek(int64 offset, int whence) OVERRIDE; virtual int64 Tell() OVERRIDE; virtual int Eof() OVERRIDE; virtual bool MayBlock() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_
#pragma once /* * This file is part of the libCEC(R) library. * * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. * * This program is dual-licensed; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA * * * Alternatively, you can license this library under a commercial license, * please contact Pulse-Eight Licensing for more information. * * For more information contact: * Pulse-Eight Licensing <license@pulse-eight.com> * http://www.pulse-eight.com/ * http://www.pulse-eight.net/ */ #include "../os.h" #if defined(__APPLE__) #include <mach/mach_time.h> #include <CoreVideo/CVHostTime.h> #elif defined(__WINDOWS__) #include <time.h> #else #include <sys/time.h> #endif namespace PLATFORM { #if defined(__WINDOWS__) struct timezone { int tz_minuteswest; int tz_dsttime; }; #define usleep(t) Sleep((DWORD)(t)/1000) inline int gettimeofday(struct timeval *pcur_time, struct timezone *tz) { if (pcur_time == NULL) { SetLastError(EFAULT); return -1; } struct _timeb current; _ftime(&current); pcur_time->tv_sec = (long) current.time; pcur_time->tv_usec = current.millitm * 1000L; if (tz) { tz->tz_minuteswest = current.timezone; /* minutes west of Greenwich */ tz->tz_dsttime = current.dstflag; /* type of dst correction */ } return 0; } #endif inline int64_t GetTimeMs() { #if defined(__APPLE__) return (int64_t) (CVGetCurrentHostTime() / (int64_t)(CVGetHostClockFrequency() * 0.001)); #elif defined(__WINDOWS__) LARGE_INTEGER tickPerSecond; LARGE_INTEGER tick; if (QueryPerformanceFrequency(&tickPerSecond)) { QueryPerformanceCounter(&tick); return (int64_t) (tick.QuadPart / (tickPerSecond.QuadPart / 1000.)); } return -1; #else timespec time; clock_gettime(CLOCK_MONOTONIC, &time); return (int64_t)time.tv_sec * 1000 + time.tv_nsec / 1000000; #endif } template <class T> inline T GetTimeSec() { return (T)GetTimeMs() / (T)1000.0; } class CTimeout { public: CTimeout(void) : m_iTarget(0) {} CTimeout(uint32_t iTimeout) { Init(iTimeout); } bool IsSet(void) const { return m_iTarget > 0; } void Init(uint32_t iTimeout) { m_iTarget = GetTimeMs() + iTimeout; } uint32_t TimeLeft(void) const { uint64_t iNow = GetTimeMs(); return (iNow > m_iTarget) ? 0 : (uint32_t)(m_iTarget - iNow); } private: uint64_t m_iTarget; }; };
/* * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2009 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ScriptBreakpoint_h #define ScriptBreakpoint_h #include "platform/inspector_protocol/Allocator.h" #include "platform/inspector_protocol/String16.h" namespace blink { struct ScriptBreakpoint { ScriptBreakpoint() : ScriptBreakpoint(0, 0, String16()) { } ScriptBreakpoint(int lineNumber, int columnNumber, const String16& condition) : lineNumber(lineNumber) , columnNumber(columnNumber) , condition(condition) { } int lineNumber; int columnNumber; String16 condition; }; } // namespace blink #endif // !defined(ScriptBreakpoint_h)
/*********************************************************************************************************************** * DISCLAIMER * This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. * No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all * applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIESREGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED * OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY * LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR * ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability * of this software. By using this software, you agree to the additional terms and conditions found by accessing the * following link: * http://www.renesas.com/disclaimer * * Copyright (C) 2015 Renesas Electronics Corporation. All rights reserved. ***********************************************************************************************************************/ /*********************************************************************************************************************** * File Name : r_cg_interrupthandlers.h * Version : Code Generator for RZ/T1 V1.00.00.09 [02 Mar 2015] * Device(s) : R7S910018CBG * Tool-Chain : GCCARM * Description : This file declares interrupt handlers. * Creation Date: 22/04/2015 ***********************************************************************************************************************/ #ifndef INTERRUPT_HANDLERS_H #define INTERRUPT_HANDLERS_H /*********************************************************************************************************************** Macro definitions (Register bit) ***********************************************************************************************************************/ /*********************************************************************************************************************** Macro definitions ***********************************************************************************************************************/ /*********************************************************************************************************************** Typedef definitions ***********************************************************************************************************************/ /*********************************************************************************************************************** Global functions ***********************************************************************************************************************/ /* FIQ exception handler */ #ifdef __ICCARM__ __irq __arm void r_fiq_handler(void); /* ICU IRQ12 */ __irq __arm void r_icu_irq12_interrupt(void); /* RSPI1 SPTI1 */ __irq __arm void r_rspi1_transmit_interrupt(void); /* RSPI1 SPEI1 */ __irq __arm void r_rspi1_error_interrupt(void); /* RSPI1 SPII1 */ __irq __arm void r_rspi1_idle_interrupt(void); /* SCIFA TXIF2 */ __irq __arm void r_scifa2_txif2_interrupt_entry(void); /* SCIFA DRIF2 */ __irq __arm void r_scifa2_drif2_interrupt_entry(void); /* SCIFA RXIF2 */ __irq __arm void r_scifa2_rxif2_interrupt_entry(void); /* SCIFA BRIF2 */ __irq __arm void r_scifa2_brif2_interrupt_entry(void); /* CMT CMI4 */ __irq __arm void r_cmt_cmi4_interrupt(void); /* CMT CMI5 */ __irq __arm void r_cmt_cmi5_interrupt(void); #endif /* __ICCARM__ */ #ifdef __GNUC__ void r_fiq_handler(void) __attribute__((interrupt ("FIQ"))); /* ICU IRQ12 */ void r_icu_irq12_interrupt(void) __attribute__((interrupt ("IRQ"))); /* RSPI1 SPTI1 */ void r_rspi1_transmit_interrupt(void) __attribute__((interrupt ("IRQ"))); /* RSPI1 SPEI1 */ void r_rspi1_error_interrupt(void) __attribute__((interrupt ("IRQ"))); /* RSPI1 SPII1 */ void r_rspi1_idle_interrupt(void) __attribute__((interrupt ("IRQ"))); /* SCIFA TXIF2 */ void r_scifa2_txif2_interrupt_entry(void) __attribute__((interrupt ("IRQ"))); /* SCIFA DRIF2 */ void r_scifa2_drif2_interrupt_entry(void) __attribute__((interrupt ("IRQ"))); /* SCIFA RXIF2 */ void r_scifa2_rxif2_interrupt_entry(void) __attribute__((interrupt ("IRQ"))); /* SCIFA BRIF2 */ void r_scifa2_brif2_interrupt_entry(void) __attribute__((interrupt ("IRQ"))); /* CMT CMI4 */ void r_cmt_cmi4_interrupt(void) __attribute__((interrupt ("IRQ"))); /* CMT CMI5 */ void r_cmt_cmi5_interrupt(void) __attribute__((interrupt ("IRQ"))); #endif /* __GNUC__ */ #endif
/* * 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; /* PXA private DMA setup stuff */ int rx_channel; int tx_channel; u32 *null_dma_buf; /* SSP register addresses */ void __iomem *ioaddr; u32 ssdr_physical; /* SSP masks*/ u32 dma_cr1; u32 int_cr1; u32 clear_sr; u32 mask_sr; /* Maximun clock rate */ unsigned long max_clk_rate; /* Message Transfer pump */ struct tasklet_struct pump_transfers; /* DMA engine support */ struct dma_chan *rx_chan; struct dma_chan *tx_chan; struct sg_table rx_sgt; struct sg_table tx_sgt; int rx_nents; int tx_nents; void *dummy; 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; int dma_mapped; dma_addr_t rx_dma; dma_addr_t tx_dma; size_t rx_map_len; size_t tx_map_len; 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 cr0; u32 cr1; u32 psp; 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; u8 bits_per_word; u32 speed_hz; 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); }; #define DEFINE_SSP_REG(reg, off) \ static inline u32 read_##reg(void const __iomem *p) \ { return __raw_readl(p + (off)); } \ \ static inline void write_##reg(u32 v, void __iomem *p) \ { __raw_writel(v, p + (off)); } DEFINE_SSP_REG(SSCR0, 0x00) DEFINE_SSP_REG(SSCR1, 0x04) DEFINE_SSP_REG(SSSR, 0x08) DEFINE_SSP_REG(SSITR, 0x0c) DEFINE_SSP_REG(SSDR, 0x10) DEFINE_SSP_REG(SSTO, 0x28) DEFINE_SSP_REG(SSPSP, 0x2c) DEFINE_SSP_REG(SSITF, SSITF) DEFINE_SSP_REG(SSIRF, SSIRF) #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) { if (drv_data->ssp_type == PXA25x_SSP) return 1; if (drv_data->ssp_type == CE4100_SSP) return 1; return 0; } static inline void write_SSSR_CS(struct driver_data *drv_data, u32 val) { void __iomem *reg = drv_data->ioaddr; if (drv_data->ssp_type == CE4100_SSP) val |= read_SSSR(reg) & SSSR_ALT_FRM_MASK; write_SSSR(val, reg); } extern int pxa2xx_spi_flush(struct driver_data *drv_data); extern void *pxa2xx_spi_next_transfer(struct driver_data *drv_data); /* * Select the right DMA implementation. */ #if defined(CONFIG_SPI_PXA2XX_PXADMA) #define SPI_PXA2XX_USE_DMA 1 #define MAX_DMA_LEN 8191 #define DEFAULT_DMA_CR1 (SSCR1_TSRE | SSCR1_RSRE | SSCR1_TINTE) #elif defined(CONFIG_SPI_PXA2XX_DMA) #define SPI_PXA2XX_USE_DMA 1 #define MAX_DMA_LEN SZ_64K #define DEFAULT_DMA_CR1 (SSCR1_TSRE | SSCR1_RSRE | SSCR1_TRAIL) #else #undef SPI_PXA2XX_USE_DMA #define MAX_DMA_LEN 0 #define DEFAULT_DMA_CR1 0 #endif #ifdef SPI_PXA2XX_USE_DMA extern bool pxa2xx_spi_dma_is_possible(size_t len); extern int pxa2xx_spi_map_dma_buffers(struct driver_data *drv_data); 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 void pxa2xx_spi_dma_resume(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); #else static inline bool pxa2xx_spi_dma_is_possible(size_t len) { return false; } static inline int pxa2xx_spi_map_dma_buffers(struct driver_data *drv_data) { return 0; } #define pxa2xx_spi_dma_transfer NULL static inline void pxa2xx_spi_dma_prepare(struct driver_data *drv_data, u32 dma_burst) {} static inline void pxa2xx_spi_dma_start(struct driver_data *drv_data) {} static inline int pxa2xx_spi_dma_setup(struct driver_data *drv_data) { return 0; } static inline void pxa2xx_spi_dma_release(struct driver_data *drv_data) {} static inline void pxa2xx_spi_dma_resume(struct driver_data *drv_data) {} static inline 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) { return -ENODEV; } #endif #endif /* SPI_PXA2XX_H */
/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ #ifndef _RTE_MEMBER_VBF_H_ #define _RTE_MEMBER_VBF_H_ #ifdef __cplusplus extern "C" { #endif /* Currently we only support up to 32 sets in vBF */ #define RTE_MEMBER_MAX_BF 32 int rte_member_create_vbf(struct rte_member_setsum *ss, const struct rte_member_parameters *params); int rte_member_lookup_vbf(const struct rte_member_setsum *setsum, const void *key, member_set_t *set_id); uint32_t rte_member_lookup_bulk_vbf(const struct rte_member_setsum *setsum, const void **keys, uint32_t num_keys, member_set_t *set_ids); uint32_t rte_member_lookup_multi_vbf(const struct rte_member_setsum *setsum, const void *key, uint32_t match_per_key, member_set_t *set_id); uint32_t rte_member_lookup_multi_bulk_vbf(const struct rte_member_setsum *setsum, const void **keys, uint32_t num_keys, uint32_t match_per_key, uint32_t *match_count, member_set_t *set_ids); int rte_member_add_vbf(const struct rte_member_setsum *setsum, const void *key, member_set_t set_id); void rte_member_free_vbf(struct rte_member_setsum *ss); void rte_member_reset_vbf(const struct rte_member_setsum *setsum); #ifdef __cplusplus } #endif #endif /* _RTE_MEMBER_VBF_H_ */
/* $Id: testupnppermissions.c,v 1.3 2009/09/14 15:24:46 nanard Exp $ */ /* (c) 2007-2015 Thomas Bernard * MiniUPnP Project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ */ #include <stdio.h> #include <string.h> #include <syslog.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include "upnppermissions.h" void print_upnpperm(const struct upnpperm * p) { switch(p->type) { case UPNPPERM_ALLOW: printf("allow "); break; case UPNPPERM_DENY: printf("deny "); break; default: printf("error ! "); } printf("%hu-%hu ", p->eport_min, p->eport_max); printf("%s/", inet_ntoa(p->address)); printf("%s ", inet_ntoa(p->mask)); printf("%hu-%hu", p->iport_min, p->iport_max); putchar('\n'); } int main(int argc, char * * argv) { int i, r, ret; struct upnpperm p; if(argc < 2) { fprintf(stderr, "Usage: %s \"permission line\" [...]\n", argv[0]); fprintf(stderr, "Example: %s \"allow 1234 10.10.10.10/32 1234\"\n", argv[0]); return 1; } openlog("testupnppermissions", LOG_PERROR, LOG_USER); ret = 0; for(i=1; i<argc; i++) { printf("%2d '%s'\n", i, argv[i]); memset(&p, 0, sizeof(struct upnpperm)); r = read_permission_line(&p, argv[i]); if(r==0) { printf("Permission read successfully\n"); print_upnpperm(&p); } else { printf("Permission read failed, please check its correctness\n"); ret++; } putchar('\n'); } return ret; }
// Copyright 2008 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include "Common/CommonTypes.h" #include "VideoCommon/LightingShaderGen.h" #include "VideoCommon/ShaderGenCommon.h" enum class APIType; enum class AlphaTestOp : u32; enum class AlphaTestResult; enum class CompareMode : u32; enum class DstBlendFactor : u32; enum class FogProjection : u32; enum class FogType : u32; enum class KonstSel : u32; enum class RasColorChan : u32; enum class SrcBlendFactor : u32; enum class ZTexOp : u32; #pragma pack(1) struct pixel_shader_uid_data { // TODO: Optimize field order for easy access! u32 num_values; // TODO: Shouldn't be a u32 u32 NumValues() const { return num_values; } u32 pad0 : 4; u32 useDstAlpha : 1; AlphaTestResult Pretest : 2; u32 nIndirectStagesUsed : 4; u32 genMode_numtexgens : 4; u32 genMode_numtevstages : 4; u32 genMode_numindstages : 3; CompareMode alpha_test_comp0 : 3; CompareMode alpha_test_comp1 : 3; AlphaTestOp alpha_test_logic : 2; u32 alpha_test_use_zcomploc_hack : 1; FogProjection fog_proj : 1; FogType fog_fsel : 3; u32 fog_RangeBaseEnabled : 1; ZTexOp ztex_op : 2; u32 per_pixel_depth : 1; u32 forced_early_z : 1; u32 early_ztest : 1; u32 late_ztest : 1; u32 bounding_box : 1; u32 zfreeze : 1; u32 numColorChans : 2; u32 rgba6_format : 1; u32 dither : 1; u32 uint_output : 1; u32 blend_enable : 1; // Only used with shader_framebuffer_fetch blend SrcBlendFactor blend_src_factor : 3; // Only used with shader_framebuffer_fetch blend SrcBlendFactor blend_src_factor_alpha : 3; // Only used with shader_framebuffer_fetch blend DstBlendFactor blend_dst_factor : 3; // Only used with shader_framebuffer_fetch blend DstBlendFactor blend_dst_factor_alpha : 3; // Only used with shader_framebuffer_fetch blend u32 blend_subtract : 1; // Only used with shader_framebuffer_fetch blend u32 blend_subtract_alpha : 1; // Only used with shader_framebuffer_fetch blend u32 logic_op_enable : 1; // Only used with shader_framebuffer_fetch logic ops u32 logic_op_mode : 4; // Only used with shader_framebuffer_fetch logic ops u32 texMtxInfo_n_projection : 8; // 8x1 bit u32 tevindref_bi0 : 3; u32 tevindref_bc0 : 3; u32 tevindref_bi1 : 3; u32 tevindref_bc1 : 3; u32 tevindref_bi2 : 3; u32 tevindref_bc2 : 3; u32 tevindref_bi3 : 3; u32 tevindref_bc3 : 3; void SetTevindrefValues(int index, u32 texcoord, u32 texmap) { if (index == 0) { tevindref_bc0 = texcoord; tevindref_bi0 = texmap; } else if (index == 1) { tevindref_bc1 = texcoord; tevindref_bi1 = texmap; } else if (index == 2) { tevindref_bc2 = texcoord; tevindref_bi2 = texmap; } else if (index == 3) { tevindref_bc3 = texcoord; tevindref_bi3 = texmap; } } u32 GetTevindirefCoord(int index) const { if (index == 0) return tevindref_bc0; else if (index == 1) return tevindref_bc1; else if (index == 2) return tevindref_bc2; else if (index == 3) return tevindref_bc3; return 0; } u32 GetTevindirefMap(int index) const { if (index == 0) return tevindref_bi0; else if (index == 1) return tevindref_bi1; else if (index == 2) return tevindref_bi2; else if (index == 3) return tevindref_bi3; return 0; } struct { // TODO: Can save a lot space by removing the padding bits u32 cc : 24; u32 ac : 24; // tswap and rswap are left blank (encoded into the tevksel fields below) u32 tevorders_texmap : 3; u32 tevorders_texcoord : 3; u32 tevorders_enable : 1; RasColorChan tevorders_colorchan : 3; u32 pad1 : 7; // TODO: Clean up the swapXY mess u32 tevind : 21; u32 tevksel_swap1a : 2; u32 tevksel_swap2a : 2; u32 tevksel_swap1b : 2; u32 tevksel_swap2b : 2; u32 pad2 : 2; u32 tevksel_swap1c : 2; u32 tevksel_swap2c : 2; u32 tevksel_swap1d : 2; u32 tevksel_swap2d : 2; KonstSel tevksel_kc : 5; KonstSel tevksel_ka : 5; u32 pad3 : 14; } stagehash[16]; LightingUidData lighting; }; #pragma pack() using PixelShaderUid = ShaderUid<pixel_shader_uid_data>; ShaderCode GeneratePixelShaderCode(APIType api_type, const ShaderHostConfig& host_config, const pixel_shader_uid_data* uid_data); void WritePixelShaderCommonHeader(ShaderCode& out, APIType api_type, const ShaderHostConfig& host_config, bool bounding_box); void ClearUnusedPixelShaderUidBits(APIType api_type, const ShaderHostConfig& host_config, PixelShaderUid* uid); PixelShaderUid GetPixelShaderUid();
/** @file Miscelaneous Functions for <wchar.h>. Unless explicitly stated otherwise, if the execution of a function declared in this file causes copying to take place between objects that overlap, the behavior is undefined. Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include <Uefi.h> #include <Library/BaseLib.h> #include <Library/BaseMemoryLib.h> #include <LibConfig.h> #include <wchar.h> /** The wcslen function computes the length of the wide string pointed to by s. @return The wcslen function returns the number of wide characters that precede the terminating null wide character. **/ size_t wcslen(const wchar_t *s) { return (size_t)StrLen( (CONST CHAR16 *)s); } /** The wmemset function copies the value of c into each of the first n wide characters of the object pointed to by s. @return The wmemset function returns the value of s. **/ wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n) { return (wchar_t *)SetMem16( s, (UINTN)(n * sizeof(wchar_t)), (UINT16)c); }
#ifndef __MACH_SECINFO_H__ #define __MACH_SECINFO_H__ #define FUSEPROV_INFO_MAX_SIZE 16 #define FUSEPROV_SEC_STRUCTURE_MAX_NUM 10 /* Known fuses regions */ typedef enum { FUSEPROV_REGION_TYPE_OEM_SEC_BOOT = 0x00000000, FUSEPROV_REGION_TYPE_OEM_PK_HASH = 0x00000001, FUSEPROV_REGION_TYPE_SEC_HW_KEY = 0x00000002, FUSEPROV_REGION_TYPE_OEM_CONFIG = 0x00000003, FUSEPROV_REGION_TYPE_READ_WRITE_PERM = 0x00000004, FUSEPROV_REGION_TYPE_SPARE_REG19 = 0x00000005, FUSEPROV_REGION_TYPE_GENERAL = 0x00000006, FUSEPROV_REGION_TYPE_FEC_EN = 0x00000007, FUSEPROV_REGION_TYPE_MAX = 0x7FFFFFFF } fuseprov_region_etype; typedef enum { FUSEPROV_OPERATION_TYPE_BLOW = 0x00000000, FUSEPROV_OPERATION_TYPE_VERIFYMASK0 = 0x00000001, FUSEPROV_OPERATION_TYPE_MAX = 0x7FFFFFFF } fuseprov_operation_etype; typedef struct { unsigned int magic1; unsigned int magic2; unsigned int revision; unsigned int size; unsigned char info[FUSEPROV_INFO_MAX_SIZE]; unsigned int segment_number; /* the number of segments */ //new unsigned int reserved[3]; } fuseprov_secdat_hdr_type; //add typedef struct { unsigned int offset; unsigned short type; unsigned short attribute; } fuseprov_secdat_hdr_segment_type; typedef struct { unsigned int revision; unsigned int size; unsigned int fuse_count; unsigned int reserved[4]; } fuseprov_qfuse_list_hdr_type; typedef struct { fuseprov_region_etype region_type; unsigned int addr; unsigned int lsb; unsigned int msb; fuseprov_operation_etype operation; } fuseprov_qfuse_entry; typedef struct { unsigned char hash[32]; } fuseprov_secdat_footer_type; /* Hash of sec.dat file starting from the main header till before this footer */ typedef struct { fuseprov_secdat_hdr_type hdr; fuseprov_secdat_hdr_segment_type segment; //add fuseprov_qfuse_list_hdr_type list_hdr; fuseprov_qfuse_entry *pentry; fuseprov_secdat_footer_type footer; } fuseprov_secdat_type; #endif
/* vi: set sw=4 ts=4: */ /*---------------------------------------------------------------------- * Mini who is used to display user name, login time, * idle time and host name. * * Author: Da Chen <dchen@ayrnetworks.com> * * This is a free document; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation: * http://www.gnu.org/copyleft/gpl.html * * Copyright (c) 2002 AYR Networks, Inc. * * Licensed under GPLv2 or later, see file LICENSE in this source tree. * *---------------------------------------------------------------------- */ /* BB_AUDIT SUSv3 _NOT_ compliant -- missing options -b, -d, -l, -m, -p, -q, -r, -s, -t, -T, -u; Missing argument 'file'. */ #include "libbb.h" #include <utmp.h> static void idle_string(char *str6, time_t t) { t = time(NULL) - t; /*if (t < 60) { str6[0] = '.'; str6[1] = '\0'; return; }*/ if (t >= 0 && t < (24 * 60 * 60)) { sprintf(str6, "%02d:%02d", (int) (t / (60 * 60)), (int) ((t % (60 * 60)) / 60)); return; } strcpy(str6, "old"); } int who_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int who_main(int argc UNUSED_PARAM, char **argv) { struct utmp *ut; unsigned opt; opt_complementary = "=0"; opt = getopt32(argv, "aH"); if (opt & 2) // -H printf("USER\t\tTTY\t\tIDLE\tTIME\t\t HOST\n"); setutent(); while ((ut = getutent()) != NULL) { if (ut->ut_user[0] && ((opt & 1) || ut->ut_type == USER_PROCESS) ) { char str6[6]; char name[sizeof("/dev/") + sizeof(ut->ut_line) + 1]; struct stat st; time_t seconds; str6[0] = '?'; str6[1] = '\0'; strcpy(name, "/dev/"); safe_strncpy(ut->ut_line[0] == '/' ? name : name + sizeof("/dev/")-1, ut->ut_line, sizeof(ut->ut_line)+1 ); if (stat(name, &st) == 0) idle_string(str6, st.st_atime); /* manpages say ut_tv.tv_sec *is* time_t, * but some systems have it wrong */ seconds = ut->ut_tv.tv_sec; /* How wide time field can be? * "Nov 10 19:33:20": 15 chars * "2010-11-10 19:33": 16 chars */ printf("%-15.*s %-15.*s %-7s %-16.16s %.*s\n", (int)sizeof(ut->ut_user), ut->ut_user, (int)sizeof(ut->ut_line), ut->ut_line, str6, ctime(&seconds) + 4, (int)sizeof(ut->ut_host), ut->ut_host ); } } if (ENABLE_FEATURE_CLEAN_UP) endutent(); return EXIT_SUCCESS; }