text
stringlengths
4
6.14k
/* * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ FILE_LICENCE ( GPL2_OR_LATER ); #include <stdint.h> #include <byteswap.h> #include <ipxe/netdevice.h> #include <ipxe/iobuf.h> #include <ipxe/if_ether.h> #include <ipxe/rarp.h> /** @file * * Reverse Address Resolution Protocol * */ /** * Process incoming ARP packets * * @v iobuf I/O buffer * @v netdev Network device * @v ll_dest Link-layer destination address * @v ll_source Link-layer source address * @ret rc Return status code * * This is a dummy method which simply discards RARP packets. */ static int rarp_rx ( struct io_buffer *iobuf, struct net_device *netdev __unused, const void *ll_dest __unused, const void *ll_source __unused ) { free_iob ( iobuf ); return 0; } /** * Transcribe RARP address * * @v net_addr RARP address * @ret string "<RARP>" * * This operation is meaningless for the RARP protocol. */ static const char * rarp_ntoa ( const void *net_addr __unused ) { return "<RARP>"; } /** RARP protocol */ struct net_protocol rarp_protocol __net_protocol = { .name = "RARP", .net_proto = htons ( ETH_P_RARP ), .rx = rarp_rx, .ntoa = rarp_ntoa, };
#ifndef _NETNS_NFTABLES_H_ #define _NETNS_NFTABLES_H_ #include <linux/list.h> struct nft_af_info; struct netns_nftables { struct list_head af_info; struct list_head commit_list; struct nft_af_info *ipv4; struct nft_af_info *ipv6; struct nft_af_info *arp; struct nft_af_info *bridge; u8 gencursor; u8 genctr; }; #endif
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_STRINGS_STRING_SPLIT_H_ #define BASE_STRINGS_STRING_SPLIT_H_ #include <string> #include <utility> #include <vector> #include "base/base_export.h" #include "base/strings/string16.h" namespace base { // Splits |str| into a vector of strings delimited by |c|, placing the results // in |r|. If several instances of |c| are contiguous, or if |str| begins with // or ends with |c|, then an empty string is inserted. // // Every substring is trimmed of any leading or trailing white space. // NOTE: |c| must be in BMP (Basic Multilingual Plane) BASE_EXPORT void SplitString(const string16& str, char16 c, std::vector<string16>* r); // |str| should not be in a multi-byte encoding like Shift-JIS or GBK in which // the trailing byte of a multi-byte character can be in the ASCII range. // UTF-8, and other single/multi-byte ASCII-compatible encodings are OK. // Note: |c| must be in the ASCII range. BASE_EXPORT void SplitString(const std::string& str, char c, std::vector<std::string>* r); typedef std::vector<std::pair<std::string, std::string> > StringPairs; // Splits |line| into key value pairs according to the given delimiters and // removes whitespace leading each key and trailing each value. Returns true // only if each pair has a non-empty key and value. |key_value_pairs| will // include ("","") pairs for entries without |key_value_delimiter|. BASE_EXPORT bool SplitStringIntoKeyValuePairs(const std::string& line, char key_value_delimiter, char key_value_pair_delimiter, StringPairs* key_value_pairs); // The same as SplitString, but use a substring delimiter instead of a char. BASE_EXPORT void SplitStringUsingSubstr(const string16& str, const string16& s, std::vector<string16>* r); BASE_EXPORT void SplitStringUsingSubstr(const std::string& str, const std::string& s, std::vector<std::string>* r); // The same as SplitString, but don't trim white space. // NOTE: |c| must be in BMP (Basic Multilingual Plane) BASE_EXPORT void SplitStringDontTrim(const string16& str, char16 c, std::vector<string16>* r); // |str| should not be in a multi-byte encoding like Shift-JIS or GBK in which // the trailing byte of a multi-byte character can be in the ASCII range. // UTF-8, and other single/multi-byte ASCII-compatible encodings are OK. // Note: |c| must be in the ASCII range. BASE_EXPORT void SplitStringDontTrim(const std::string& str, char c, std::vector<std::string>* r); // WARNING: this uses whitespace as defined by the HTML5 spec. If you need // a function similar to this but want to trim all types of whitespace, then // factor this out into a function that takes a string containing the characters // that are treated as whitespace. // // Splits the string along whitespace (where whitespace is the five space // characters defined by HTML 5). Each contiguous block of non-whitespace // characters is added to result. BASE_EXPORT void SplitStringAlongWhitespace(const string16& str, std::vector<string16>* result); BASE_EXPORT void SplitStringAlongWhitespace(const std::string& str, std::vector<std::string>* result); } // namespace base #endif // BASE_STRINGS_STRING_SPLIT_H_
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module 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 Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 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. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QFSFILEENGINE_ITERATOR_P_H #define QFSFILEENGINE_ITERATOR_P_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 "private/qabstractfileengine_p.h" #include "qfilesystemiterator_p.h" #include "qdir.h" #ifndef QT_NO_FILESYSTEMITERATOR QT_BEGIN_NAMESPACE class QFSFileEngineIteratorPrivate; class QFSFileEngineIteratorPlatformSpecificData; class QFSFileEngineIterator : public QAbstractFileEngineIterator { public: QFSFileEngineIterator(QDir::Filters filters, const QStringList &filterNames); ~QFSFileEngineIterator(); QString next(); bool hasNext() const; QString currentFileName() const; QFileInfo currentFileInfo() const; private: void advance() const; mutable QScopedPointer<QFileSystemIterator> nativeIterator; mutable QFileInfo currentInfo; mutable QFileInfo nextInfo; mutable bool done; }; QT_END_NAMESPACE #endif // QT_NO_FILESYSTEMITERATOR #endif // QFSFILEENGINE_ITERATOR_P_H
/* SPDX-License-Identifier: MIT */ #ifndef __NVKM_CLK_H__ #define __NVKM_CLK_H__ #include <core/subdev.h> #include <core/notify.h> #include <subdev/pci.h> struct nvbios_pll; struct nvkm_pll_vals; #define NVKM_CLK_CSTATE_DEFAULT -1 /* POSTed default */ #define NVKM_CLK_CSTATE_BASE -2 /* pstate base */ #define NVKM_CLK_CSTATE_HIGHEST -3 /* highest possible */ enum nv_clk_src { nv_clk_src_crystal, nv_clk_src_href, nv_clk_src_hclk, nv_clk_src_hclkm3, nv_clk_src_hclkm3d2, nv_clk_src_hclkm2d3, /* NVAA */ nv_clk_src_hclkm4, /* NVAA */ nv_clk_src_cclk, /* NVAA */ nv_clk_src_host, nv_clk_src_sppll0, nv_clk_src_sppll1, nv_clk_src_mpllsrcref, nv_clk_src_mpllsrc, nv_clk_src_mpll, nv_clk_src_mdiv, nv_clk_src_core, nv_clk_src_core_intm, nv_clk_src_shader, nv_clk_src_mem, nv_clk_src_gpc, nv_clk_src_rop, nv_clk_src_hubk01, nv_clk_src_hubk06, nv_clk_src_hubk07, nv_clk_src_copy, nv_clk_src_pmu, nv_clk_src_disp, nv_clk_src_vdec, nv_clk_src_dom6, nv_clk_src_max, }; struct nvkm_cstate { struct list_head head; u8 voltage; u32 domain[nv_clk_src_max]; u8 id; }; struct nvkm_pstate { struct list_head head; struct list_head list; /* c-states */ struct nvkm_cstate base; u8 pstate; u8 fanspeed; enum nvkm_pcie_speed pcie_speed; u8 pcie_width; }; struct nvkm_domain { enum nv_clk_src name; u8 bios; /* 0xff for none */ #define NVKM_CLK_DOM_FLAG_CORE 0x01 #define NVKM_CLK_DOM_FLAG_VPSTATE 0x02 u8 flags; const char *mname; int mdiv; }; struct nvkm_clk { const struct nvkm_clk_func *func; struct nvkm_subdev subdev; const struct nvkm_domain *domains; struct nvkm_pstate bstate; struct list_head states; int state_nr; struct work_struct work; wait_queue_head_t wait; atomic_t waiting; struct nvkm_notify pwrsrc_ntfy; int pwrsrc; int pstate; /* current */ int ustate_ac; /* user-requested (-1 disabled, -2 perfmon) */ int ustate_dc; /* user-requested (-1 disabled, -2 perfmon) */ int astate; /* perfmon adjustment (base) */ int dstate; /* display adjustment (min+) */ u8 temp; bool allow_reclock; #define NVKM_CLK_BOOST_NONE 0x0 #define NVKM_CLK_BOOST_BIOS 0x1 #define NVKM_CLK_BOOST_FULL 0x2 u8 boost_mode; u32 base_khz; u32 boost_khz; /*XXX: die, these are here *only* to support the completely * bat-shit insane what-was-nouveau_hw.c code */ int (*pll_calc)(struct nvkm_clk *, struct nvbios_pll *, int clk, struct nvkm_pll_vals *pv); int (*pll_prog)(struct nvkm_clk *, u32 reg1, struct nvkm_pll_vals *pv); }; int nvkm_clk_read(struct nvkm_clk *, enum nv_clk_src); int nvkm_clk_ustate(struct nvkm_clk *, int req, int pwr); int nvkm_clk_astate(struct nvkm_clk *, int req, int rel, bool wait); int nvkm_clk_dstate(struct nvkm_clk *, int req, int rel); int nvkm_clk_tstate(struct nvkm_clk *, u8 temperature); int nv04_clk_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_clk **); int nv40_clk_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_clk **); int nv50_clk_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_clk **); int g84_clk_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_clk **); int mcp77_clk_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_clk **); int gt215_clk_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_clk **); int gf100_clk_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_clk **); int gk104_clk_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_clk **); int gk20a_clk_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_clk **); int gm20b_clk_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_clk **); #endif
/** \page doc_gc Garbage collection Though AngelScript uses reference counting for memory management, there is still need for a garbage collector to take care of the few cases where circular referencing between objects prevents the reference counter from reaching zero. As the application wants to guarantee responsiveness of the application, AngelScript doesn't invoke the garbage collector automatically. For that reason it is important that the application do this manually at convenient times. The garbage collector implemented in AngelScript is incremental, so it can be executed for short periods of time without requiring the entire application to halt. For this reason, it is recommended that a call to \ref asIScriptEngine::GarbageCollect "GarbageCollect"(\ref asGC_ONE_STEP) is made at least once during the normal event processing. This will execute one step in the incremental process, eventually detecting and destroying objects being kept alive due to circular references. This may not be enough for all applications though, as some script may produce more garbage than others. Performing the garbage collection only one step at a time may not be fast enough to free the old garbage before the new garbage is generated. For this reason it is recommended that the application monitor the statistics for the garbage collector and adjust the frequency of the calls as necessary. The statistics is obtained through a call to \ref asIScriptEngine::GetGCStatistics "GetGCStatistics", which returns the number of objects currently known to the garbage collector as well as the number of objects that have been destroyed and the number of object that have been detected as garbage with circular references. If the scripts produce a lot of garbage but only a low number of garbage in circular references, the application can make a call to \ref asIScriptEngine::GarbageCollect "GarbageCollect"(\ref asGC_FULL_CYCLE | \ref asGC_DESTROY_GARBAGE), which will only destroy the known garbage without trying to detect circular references. This call is relatively fast as the garbage collector only has to make a trivial local check to determine if an object is garbage without circular references. Finally, if the application goes into a state where responsiveness is not so critical, it might be a good idea to do a full cycle on the garbage collector, thus cleaning up all garbage at once. To do this, call \ref asIScriptEngine::GarbageCollect "GarbageCollect"(\ref asGC_FULL_CYCLE). \see \ref doc_memory */
// SPDX-License-Identifier: GPL-2.0+ // // Synopsys CREG (Control REGisters) GPIO driver // // Copyright (C) 2018 Synopsys // Author: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> #include <linux/gpio/driver.h> #include <linux/io.h> #include <linux/of.h> #include <linux/of_platform.h> #define MAX_GPIO 32 struct creg_layout { u8 ngpio; u8 shift[MAX_GPIO]; u8 on[MAX_GPIO]; u8 off[MAX_GPIO]; u8 bit_per_gpio[MAX_GPIO]; }; struct creg_gpio { struct gpio_chip gc; void __iomem *regs; spinlock_t lock; const struct creg_layout *layout; }; static void creg_gpio_set(struct gpio_chip *gc, unsigned int offset, int val) { struct creg_gpio *hcg = gpiochip_get_data(gc); const struct creg_layout *layout = hcg->layout; u32 reg, reg_shift, value; unsigned long flags; int i; value = val ? hcg->layout->on[offset] : hcg->layout->off[offset]; reg_shift = layout->shift[offset]; for (i = 0; i < offset; i++) reg_shift += layout->bit_per_gpio[i] + layout->shift[i]; spin_lock_irqsave(&hcg->lock, flags); reg = readl(hcg->regs); reg &= ~(GENMASK(layout->bit_per_gpio[i] - 1, 0) << reg_shift); reg |= (value << reg_shift); writel(reg, hcg->regs); spin_unlock_irqrestore(&hcg->lock, flags); } static int creg_gpio_dir_out(struct gpio_chip *gc, unsigned int offset, int val) { creg_gpio_set(gc, offset, val); return 0; } static int creg_gpio_validate_pg(struct device *dev, struct creg_gpio *hcg, int i) { const struct creg_layout *layout = hcg->layout; if (layout->bit_per_gpio[i] < 1 || layout->bit_per_gpio[i] > 8) return -EINVAL; /* Check that on valiue fits it's placeholder */ if (GENMASK(31, layout->bit_per_gpio[i]) & layout->on[i]) return -EINVAL; /* Check that off valiue fits it's placeholder */ if (GENMASK(31, layout->bit_per_gpio[i]) & layout->off[i]) return -EINVAL; if (layout->on[i] == layout->off[i]) return -EINVAL; return 0; } static int creg_gpio_validate(struct device *dev, struct creg_gpio *hcg, u32 ngpios) { u32 reg_len = 0; int i; if (hcg->layout->ngpio < 1 || hcg->layout->ngpio > MAX_GPIO) return -EINVAL; if (ngpios < 1 || ngpios > hcg->layout->ngpio) { dev_err(dev, "ngpios must be in [1:%u]\n", hcg->layout->ngpio); return -EINVAL; } for (i = 0; i < hcg->layout->ngpio; i++) { if (creg_gpio_validate_pg(dev, hcg, i)) return -EINVAL; reg_len += hcg->layout->shift[i] + hcg->layout->bit_per_gpio[i]; } /* Check that we fit in 32 bit register */ if (reg_len > 32) return -EINVAL; return 0; } static const struct creg_layout hsdk_cs_ctl = { .ngpio = 10, .shift = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .off = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, .on = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, .bit_per_gpio = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 } }; static const struct creg_layout axs10x_flsh_cs_ctl = { .ngpio = 1, .shift = { 0 }, .off = { 1 }, .on = { 3 }, .bit_per_gpio = { 2 } }; static const struct of_device_id creg_gpio_ids[] = { { .compatible = "snps,creg-gpio-axs10x", .data = &axs10x_flsh_cs_ctl }, { .compatible = "snps,creg-gpio-hsdk", .data = &hsdk_cs_ctl }, { /* sentinel */ } }; static int creg_gpio_probe(struct platform_device *pdev) { const struct of_device_id *match; struct device *dev = &pdev->dev; struct creg_gpio *hcg; struct resource *mem; u32 ngpios; int ret; hcg = devm_kzalloc(dev, sizeof(struct creg_gpio), GFP_KERNEL); if (!hcg) return -ENOMEM; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcg->regs = devm_ioremap_resource(dev, mem); if (IS_ERR(hcg->regs)) return PTR_ERR(hcg->regs); match = of_match_node(creg_gpio_ids, pdev->dev.of_node); hcg->layout = match->data; if (!hcg->layout) return -EINVAL; ret = of_property_read_u32(dev->of_node, "ngpios", &ngpios); if (ret) return ret; ret = creg_gpio_validate(dev, hcg, ngpios); if (ret) return ret; spin_lock_init(&hcg->lock); hcg->gc.label = dev_name(dev); hcg->gc.base = -1; hcg->gc.ngpio = ngpios; hcg->gc.set = creg_gpio_set; hcg->gc.direction_output = creg_gpio_dir_out; hcg->gc.of_node = dev->of_node; ret = devm_gpiochip_add_data(dev, &hcg->gc, hcg); if (ret) return ret; dev_info(dev, "GPIO controller with %d gpios probed\n", ngpios); return 0; } static struct platform_driver creg_gpio_snps_driver = { .driver = { .name = "snps-creg-gpio", .of_match_table = creg_gpio_ids, }, .probe = creg_gpio_probe, }; builtin_platform_driver(creg_gpio_snps_driver);
/* Copyright (c) 2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef MSM_CAMERA_DT_UTIL_H__ #define MSM_CAMERA_DT_UTIL_H__ #include <mach/camera2.h> #include <linux/gpio.h> #include <linux/of.h> #include "msm_camera_i2c.h" #define SYSFS_COMP_FW_PATH "/sys/class/camera/rear/rear_companionfw_full" #define SYSFS_FW_CHECK_PATH "/sys/class/camera/rear/rear_fwcheck" #define SYSFS_ISP_CORE_PATH "/sys/class/camera/rear/isp_core" int msm_sensor_get_sub_module_index(struct device_node *of_node, struct msm_sensor_info_t **s_info); int msm_sensor_get_dt_actuator_data(struct device_node *of_node, struct msm_actuator_info **act_info); int msm_sensor_get_dt_csi_data(struct device_node *of_node, struct msm_camera_csi_lane_params **csi_lane_params); int32_t msm_camera_get_dt_power_setting_data(struct device_node *of_node, struct camera_vreg_t *cam_vreg, int num_vreg, struct msm_sensor_power_setting **power_setting, uint16_t *power_setting_size); int msm_camera_get_dt_power_off_setting_data(struct device_node *of_node, struct camera_vreg_t *cam_vreg, int num_vreg, struct msm_sensor_power_setting **power_setting, uint16_t *power_setting_size); int msm_camera_get_dt_gpio_req_tbl(struct device_node *of_node, struct msm_camera_gpio_conf *gconf, uint16_t *gpio_array, uint16_t gpio_array_size); int msm_camera_get_dt_gpio_set_tbl(struct device_node *of_node, struct msm_camera_gpio_conf *gconf, uint16_t *gpio_array, uint16_t gpio_array_size); int msm_camera_init_gpio_pin_tbl(struct device_node *of_node, struct msm_camera_gpio_conf *gconf, uint16_t *gpio_array, uint16_t gpio_array_size); int msm_camera_get_dt_vreg_data(struct device_node *of_node, struct camera_vreg_t **cam_vreg, int *num_vreg); int msm_camera_power_up(struct msm_camera_power_ctrl_t *ctrl, enum msm_camera_device_type_t device_type, struct msm_camera_i2c_client *sensor_i2c_client, uint16_t camera_id); int msm_camera_power_down(struct msm_camera_power_ctrl_t *ctrl, enum msm_camera_device_type_t device_type, struct msm_camera_i2c_client *sensor_i2c_client, uint16_t camera_id); int msm_camera_fill_vreg_params(struct camera_vreg_t *cam_vreg, int num_vreg, struct msm_sensor_power_setting *power_setting, uint16_t power_setting_size); int msm_camera_write_sysfs(char* path, const char* data, uint32_t data_size); int msm_camera_fw_check(const char read_fw_crc, uint8_t index); #endif
/* An instruction which should crash any program is an unimp. */ #define ABORT_INSTRUCTION asm ("unimp 0xf00")
/* SPDX-License-Identifier: GPL-2.0 */ /****************************************************************************** * * Copyright(c) 2007 - 2016 Realtek Corporation. * * Contact Information: * wlanfae <wlanfae@realtek.com> * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, * Hsinchu 300, Taiwan. * * Larry Finger <Larry.Finger@lwfinger.net> * *****************************************************************************/ #ifndef __HAL_TXBF_JAGUAR_H__ #define __HAL_TXBF_JAGUAR_H__ #define hal_txbf_8812a_set_ndpa_rate(dm_void, BW, rate) #define hal_txbf_jaguar_enter(dm_void, idx) #define hal_txbf_jaguar_leave(dm_void, idx) #define hal_txbf_jaguar_status(dm_void, idx) #define hal_txbf_jaguar_fw_txbf(dm_void, idx) #define hal_txbf_jaguar_patch(dm_void, operation) #define hal_txbf_jaguar_clk_8812a(dm_void) #endif /* #ifndef __HAL_TXBF_JAGUAR_H__ */
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #ifdef USE_TI_UITAB #import "TiViewProxy.h" #import "TiTab.h" #import "TiWindowProxy.h" @class TiUITabGroupProxy; @class TiUITabController; @class TiWindowProxy; @interface TiUITabProxy : TiViewProxy<TiTab,UINavigationControllerDelegate,TiOrientationController> { @private UINavigationController *controller; TiUITabController *rootController; TiUITabGroupProxy *tabGroup; TiUITabController *current; NSArray* controllerStack; NSMutableArray* closingWindows; BOOL opening; BOOL systemTab; BOOL transitionIsAnimating; id<TiOrientationController> parentOrientationController; } @property(nonatomic,readwrite,assign) id<TiOrientationController> parentOrientationController; -(void)childOrientationControllerChangedFlags:(id<TiOrientationController>) orientationController; -(UINavigationController*)controller; -(void)setTabGroup:(TiUITabGroupProxy*)proxy; -(void)removeFromTabGroup; - (void)closeTab; -(void)closeWindow:(TiWindowProxy *)window animated:(BOOL)animated removeTab:(BOOL)removeTab; -(void)windowClosing:(TiWindowProxy*)window animated:(BOOL)animated; #pragma mark Public APIs -(TiProxy*)tabGroup; -(void)open:(id)args; -(void)close:(id)args; -(void)setTitle:(id)title; -(void)setIcon:(id)title; -(void)setBadge:(id)title; -(void)setActive:(id)value; - (void)handleWillBlur; - (void)handleDidBlur:(NSDictionary *)event; - (void)handleWillFocus; - (void)handleDidFocus:(NSDictionary *)event; - (void)handleWillShowViewController:(UIViewController *)viewController; - (void)handleDidShowViewController:(UIViewController *)viewController; @end #endif
/****************************************************************************** * FREXXWARE * ---------------------------------------------------------------------------- * * Project: Frexx C Preprocessor * $Source: /home/user/start/cpp/RCS/FPP_protos.h,v $ * $Revision: 1.3 $ * $Date: 1993/12/06 13:51:20 $ * $Author: start $ * $State: Exp $ * $Locker: start $ * * ---------------------------------------------------------------------------- * $Log: FPP_protos.h,v $ * Revision 1.3 1993/12/06 13:51:20 start * A lot of new stuff (too much to mention) * * Revision 1.2 1993/11/11 07:16:39 start * New stuff * * Revision 1.2 1993/11/11 07:16:39 start * New stuff * * Revision 1.1 1993/11/03 09:15:59 start * Initial revision * * *****************************************************************************/ /****************************************************** * * FPP_protos.h * *******/ int fppPreProcess(struct fppTag *);
/* * mach/sram.h - DaVinci simple SRAM allocator * * Copyright (C) 2009 David Brownell * * 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 __MACH_SRAM_H #define __MACH_SRAM_H /* ARBITRARY: SRAM allocations are multiples of this 2^N size */ #define SRAM_GRANULARITY 512 /* * SRAM allocations return a CPU virtual address, or NULL on error. * If a DMA address is requested and the SRAM supports DMA, its * mapped address is also returned. * * Errors include SRAM memory not being available, and requesting * DMA mapped SRAM on systems which don't allow that. */ extern void *sram_alloc(size_t len, dma_addr_t *dma); extern void sram_free(void *addr, size_t len); #endif /* __MACH_SRAM_H */
/* arch/arm/mach-msm/htc_bluetooth.c * * Code to extract Bluetooth bd_address information * from ATAG set up by the bootloader. * * Copyright (C) 2010 HTC Corporation * Author:Yomin Lin <yomin_lin@htc.com> * Author:Allen Ou <allen_ou@htc.com> * */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <asm/setup.h> #include <mach/htc_bdaddress.h> #define ATAG_BT_DEBUG /* configuration tags specific to Bluetooth*/ #define ATAG_BLUETOOTH 0x43294329 #define MAX_BT_SIZE 0x8U static unsigned char bt_bd_ram[MAX_BT_SIZE]; static char bdaddress[20]; static unsigned char *get_bt_bd_ram(void) { return (bt_bd_ram); } static int __init parse_tag_bt(const struct tag *tag) { unsigned char *dptr = (unsigned char *)(&tag->u); unsigned size; #ifdef ATAG_BT_DEBUG unsigned i; #endif size = min((tag->hdr.size-2)*sizeof(__u32), MAX_BT_SIZE); memcpy((void *)bt_bd_ram, (void *)dptr, size); #ifdef ATAG_BT_DEBUG printk(KERN_INFO "BT Data size= %d, 0x%x,", tag->hdr.size, tag->hdr.tag); for (i = 0; i < size; i++) printk(KERN_INFO "%02x,", bt_bd_ram[i]); #endif return 0; } __tagtable(ATAG_BLUETOOTH, parse_tag_bt); void bt_export_bd_address(void) { unsigned char cTemp[6]; memcpy(cTemp, get_bt_bd_ram(), 6); sprintf(bdaddress, "%02x:%02x:%02x:%02x:%02x:%02x", cTemp[0], cTemp[1], cTemp[2], cTemp[3], cTemp[4], cTemp[5]); printk(KERN_INFO "YoYo--BD_ADDRESS=%s\n", bdaddress); } module_param_string(bdaddress, bdaddress, sizeof(bdaddress), S_IWUSR | S_IRUGO); MODULE_PARM_DESC(bdaddress, "BT MAC ADDRESS");
// Copyright (c) 2013 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. // stackwalker_address_list.h: a pseudo stackwalker. // // Doesn't actually walk a stack, rather initializes a CallStack given an // explicit list of already walked return addresses. // // Author: Chris Hamilton <chrisha@chromium.org> #ifndef PROCESSOR_STACKWALKER_ADDRESS_LIST_H_ #define PROCESSOR_STACKWALKER_ADDRESS_LIST_H_ #include "common/basictypes.h" #include "google_breakpad/common/breakpad_types.h" #include "google_breakpad/processor/stackwalker.h" namespace google_breakpad { class CodeModules; class StackwalkerAddressList : public Stackwalker { public: // Initializes this stack walker with an explicit set of frame addresses. // |modules| and |frame_symbolizer| are passed directly through to the base // Stackwalker constructor. StackwalkerAddressList(const uint64_t* frames, size_t frame_count, const CodeModules* modules, StackFrameSymbolizer* frame_symbolizer); private: // Implementation of Stackwalker. virtual StackFrame* GetContextFrame(); virtual StackFrame* GetCallerFrame(const CallStack* stack, bool stack_scan_allowed); const uint64_t* frames_; size_t frame_count_; DISALLOW_COPY_AND_ASSIGN(StackwalkerAddressList); }; } // namespace google_breakpad #endif // PROCESSOR_STACKWALKER_ADDRESS_LIST_H_
#include <linux/string.h> #include <asm/io.h> #include <linux/module.h> void __memcpy_toio(unsigned long dst,const void*src,unsigned len) { __inline_memcpy((void *) dst,src,len); } EXPORT_SYMBOL(__memcpy_toio); void __memcpy_fromio(void *dst,unsigned long src,unsigned len) { __inline_memcpy(dst,(const void *) src,len); } EXPORT_SYMBOL(__memcpy_fromio); void memset_io(volatile void __iomem *a, int b, size_t c) { /* XXX: memset can mangle the IO patterns quite a bit. perhaps it would be better to use a dumb one */ memset((void *)a,b,c); } EXPORT_SYMBOL(memset_io);
/* { dg-do compile { target { ! { ia32 } } } } */ /* { dg-options "-O -fno-math-errno" } */ typedef double __m128d __attribute__((vector_size(16))); __m128d vsqrt1 (__m128d const x) { double const* __restrict__ const y = (double const*)&x; double const a = __builtin_sqrt(y[0]); double const b = __builtin_sqrt(y[1]); return (__m128d) { a, b }; } /* Verify we do not spill x to the stack. */ /* { dg-final { scan-assembler-not "%rsp" } } */
/* Copyright (c) 2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/delay.h> #include <linux/spinlock.h> #include <linux/ktime.h> #include <linux/debugfs.h> #include "mdss.h" #include "mdss_mdp.h" #include "mdss_debug.h" #define MDSS_XLOG_ENTRY 256 #define MDSS_XLOG_MAX_DATA 6 #define MDSS_XLOG_BUF_MAX 512 struct tlog { u64 tick; const char *name; u32 data[MDSS_XLOG_MAX_DATA]; u32 data_cnt; }; struct mdss_dbg_xlog { struct tlog logs[MDSS_XLOG_ENTRY]; int first; int last; spinlock_t xlock; } mdss_dbg_xlog; static int mdss_xlog_dump_open(struct inode *inode, struct file *file) { /* non-seekable */ file->f_mode &= ~(FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE); file->private_data = inode->i_private; return 0; } static ssize_t mdss_xlog_dump_read(struct file *file, char __user *buff, size_t count, loff_t *ppos) { MDSS_XLOG_TOUT_HANDLER("mdp", "dsi0", "dsi1", "edp", "hdmi", "panic"); return 0; } static const struct file_operations mdss_xlog_fops = { .open = mdss_xlog_dump_open, .read = mdss_xlog_dump_read, }; int mdss_create_xlog_debug(struct mdss_debug_data *mdd) { spin_lock_init(&mdss_dbg_xlog.xlock); mdd->logd.xlog = debugfs_create_dir("xlog", mdd->root); if (IS_ERR_OR_NULL(mdd->logd.xlog)) { pr_err("debugfs_create_dir fail, error %ld\n", PTR_ERR(mdd->logd.xlog)); mdd->logd.xlog = NULL; return -ENODEV; } debugfs_create_file("dump", 0644, mdd->logd.xlog, NULL, &mdss_xlog_fops); debugfs_create_bool("enable", 0644, mdd->logd.xlog, &mdd->logd.xlog_enable); debugfs_create_bool("panic", 0644, mdd->logd.xlog, &mdd->logd.panic_on_err); debugfs_create_bool("reg_dump", 0644, mdd->logd.xlog, &mdd->logd.enable_reg_dump); return 0; } void mdss_xlog(const char *name, ...) { struct mdss_data_type *mdata = mdss_mdp_get_mdata(); struct mdss_debug_data *mdd = mdata->debug_inf.debug_data; unsigned long flags; int i, val = 0; va_list args; struct tlog *log; ktime_t time; if (!mdd->logd.xlog_enable) return; spin_lock_irqsave(&mdss_dbg_xlog.xlock, flags); time = ktime_get(); log = &mdss_dbg_xlog.logs[mdss_dbg_xlog.first]; log->tick = local_clock(); log->name = name; log->data_cnt = 0; va_start(args, name); for (i = 0; i < MDSS_XLOG_MAX_DATA; i++) { val = va_arg(args, int); if (val == DATA_LIMITER) break; log->data[i] = val; } va_end(args); log->data_cnt = i; mdss_dbg_xlog.last = mdss_dbg_xlog.first; mdss_dbg_xlog.first++; mdss_dbg_xlog.first %= MDSS_XLOG_ENTRY; spin_unlock_irqrestore(&mdss_dbg_xlog.xlock, flags); } void mdss_xlog_dump(void) { struct mdss_data_type *mdata = mdss_mdp_get_mdata(); struct mdss_debug_data *mdd = mdata->debug_inf.debug_data; int i, n, d_cnt, off; unsigned long flags; unsigned long rem_nsec; struct tlog *log; char xlog_buf[MDSS_XLOG_BUF_MAX]; if (!mdd->logd.xlog_enable) return; spin_lock_irqsave(&mdss_dbg_xlog.xlock, flags); i = mdss_dbg_xlog.first; for (n = 0; n < MDSS_XLOG_ENTRY; n++) { log = &mdss_dbg_xlog.logs[i]; rem_nsec = do_div(log->tick, 1000000000); off = snprintf(xlog_buf, MDSS_XLOG_BUF_MAX, "%-32s => [%5llu.%06lu]: ", log->name, log->tick, rem_nsec / 1000); for (d_cnt = 0; d_cnt < log->data_cnt;) { off += snprintf((xlog_buf + off), (MDSS_XLOG_BUF_MAX - off), "%x ", log->data[d_cnt]); d_cnt++; } pr_err("%s\n", xlog_buf); i = (i + 1) % MDSS_XLOG_ENTRY; } spin_unlock_irqrestore(&mdss_dbg_xlog.xlock, flags); } void mdss_xlog_tout_handler(const char *name, ...) { struct mdss_data_type *mdata = mdss_mdp_get_mdata(); struct mdss_debug_data *mdd = mdata->debug_inf.debug_data; struct mdss_debug_base *blk_base, *tmp; int i, dead = 0; va_list args; char *blk_name = NULL; if (!mdd->logd.xlog_enable) return; va_start(args, name); for (i = 0; i < MDSS_XLOG_MAX_DATA; i++) { blk_name = va_arg(args, char*); if (IS_ERR_OR_NULL(blk_name)) break; list_for_each_entry_safe(blk_base, tmp, &mdd->base_list, head) { if (blk_base->name && !strcmp(blk_base->name, blk_name) && mdd->logd.enable_reg_dump) { pr_info("\n%s : =========%s DUMP=========\n", __func__, blk_base->name); mdss_dump_reg(blk_base->base, blk_base->max_offset); } } if (!strcmp(blk_name, "panic")) dead = 1; } va_end(args); MDSS_XLOG(0xffff, 0xffff, 0xffff, 0xffff, 0xffff); mdss_xlog_dump(); if (dead && mdd->logd.panic_on_err) panic(name); }
/* * 802.1Q VLAN protocol definitions * * $Copyright Open Broadcom Corporation$ * * $Id: vlan.h 382883 2013-02-04 23:26:09Z $ */ #ifndef _vlan_h_ #define _vlan_h_ #ifndef _TYPEDEFS_H_ #include <typedefs.h> #endif #include <packed_section_start.h> #ifndef VLAN_VID_MASK #define VLAN_VID_MASK 0xfff #endif #define VLAN_CFI_SHIFT 12 #define VLAN_PRI_SHIFT 13 #define VLAN_PRI_MASK 7 #define VLAN_TPID_OFFSET 12 #define VLAN_TCI_OFFSET 14 #define VLAN_TAG_LEN 4 #define VLAN_TAG_OFFSET (2 * ETHER_ADDR_LEN) #define VLAN_TPID 0x8100 struct vlan_header { uint16 vlan_type; uint16 vlan_tag; }; struct ethervlan_header { uint8 ether_dhost[ETHER_ADDR_LEN]; uint8 ether_shost[ETHER_ADDR_LEN]; uint16 vlan_type; uint16 vlan_tag; uint16 ether_type; }; struct dot3_mac_llc_snapvlan_header { uint8 ether_dhost[ETHER_ADDR_LEN]; uint8 ether_shost[ETHER_ADDR_LEN]; uint16 length; uint8 dsap; uint8 ssap; uint8 ctl; uint8 oui[3]; uint16 vlan_type; uint16 vlan_tag; uint16 ether_type; }; #define ETHERVLAN_HDR_LEN (ETHER_HDR_LEN + VLAN_TAG_LEN) #include <packed_section_end.h> #define ETHERVLAN_MOVE_HDR(d, s) \ do { \ struct ethervlan_header t; \ t = *(struct ethervlan_header *)(s); \ *(struct ethervlan_header *)(d) = t; \ } while (0) #endif
/* * Device driver for Hi6421 IC * * Copyright (c) <2011-2014> HiSilicon Technologies Co., Ltd. * http://www.hisilicon.com * Copyright (c) <2013-2014> Linaro Ltd. * http://www.linaro.org * * Author: Guodong Xu <guodong.xu@linaro.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <linux/device.h> #include <linux/err.h> #include <linux/mfd/core.h> #include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/mfd/hi6421-pmic.h> static const struct mfd_cell hi6421_devs[] = { { .name = "hi6421-regulator", }, }; static const struct regmap_config hi6421_regmap_config = { .reg_bits = 32, .reg_stride = 4, .val_bits = 8, .max_register = HI6421_REG_TO_BUS_ADDR(HI6421_REG_MAX), }; static int hi6421_pmic_probe(struct platform_device *pdev) { struct hi6421_pmic *pmic; struct resource *res; void __iomem *base; int ret; pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); if (!pmic) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(base)) return PTR_ERR(base); pmic->regmap = devm_regmap_init_mmio_clk(&pdev->dev, NULL, base, &hi6421_regmap_config); if (IS_ERR(pmic->regmap)) { dev_err(&pdev->dev, "regmap init failed: %ld\n", PTR_ERR(pmic->regmap)); return PTR_ERR(pmic->regmap); } /* set over-current protection debounce 8ms */ regmap_update_bits(pmic->regmap, HI6421_OCP_DEB_CTRL_REG, (HI6421_OCP_DEB_SEL_MASK | HI6421_OCP_EN_DEBOUNCE_MASK | HI6421_OCP_AUTO_STOP_MASK), (HI6421_OCP_DEB_SEL_8MS | HI6421_OCP_EN_DEBOUNCE_ENABLE)); platform_set_drvdata(pdev, pmic); ret = mfd_add_devices(&pdev->dev, 0, hi6421_devs, ARRAY_SIZE(hi6421_devs), NULL, 0, NULL); if (ret) { dev_err(&pdev->dev, "add mfd devices failed: %d\n", ret); return ret; } return 0; } static int hi6421_pmic_remove(struct platform_device *pdev) { mfd_remove_devices(&pdev->dev); return 0; } static struct of_device_id of_hi6421_pmic_match_tbl[] = { { .compatible = "hisilicon,hi6421-pmic", }, { }, }; static struct platform_driver hi6421_pmic_driver = { .driver = { .name = "hi6421_pmic", .of_match_table = of_hi6421_pmic_match_tbl, }, .probe = hi6421_pmic_probe, .remove = hi6421_pmic_remove, }; module_platform_driver(hi6421_pmic_driver); MODULE_AUTHOR("Guodong Xu <guodong.xu@linaro.org>"); MODULE_DESCRIPTION("Hi6421 PMIC driver"); MODULE_LICENSE("GPL v2");
/* * Hisilicon Hi6220 ION Driver * * Copyright (c) 2015 Hisilicon Limited. * * Author: Chen Feng <puck.chen@hisilicon.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #define pr_fmt(fmt) "Ion: " fmt #include <linux/err.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/of.h> #include <linux/mm.h> #include "../ion_priv.h" #include "../ion.h" struct hi6220_ion_type_table { const char *name; enum ion_heap_type type; }; static struct hi6220_ion_type_table ion_type_table[] = { {"ion_system", ION_HEAP_TYPE_SYSTEM}, {"ion_system_contig", ION_HEAP_TYPE_SYSTEM_CONTIG}, {"ion_carveout", ION_HEAP_TYPE_CARVEOUT}, {"ion_chunk", ION_HEAP_TYPE_CHUNK}, {"ion_dma", ION_HEAP_TYPE_DMA}, {"ion_custom", ION_HEAP_TYPE_CUSTOM}, }; static struct ion_device *idev; static int num_heaps; static struct ion_heap **heaps; static struct ion_platform_heap **heaps_data; static int get_type_by_name(const char *name, enum ion_heap_type *type) { int i; for (i = 0; i < ARRAY_SIZE(ion_type_table); i++) { if (strncmp(name, ion_type_table[i].name, strlen(name))) continue; *type = ion_type_table[i].type; return 0; } return -EINVAL; } static int hi6220_set_platform_data(struct platform_device *pdev) { unsigned int base; unsigned int size; unsigned int id; const char *heap_name; const char *type_name; enum ion_heap_type type; int ret; struct device_node *np; struct ion_platform_heap *p_data; const struct device_node *dt_node = pdev->dev.of_node; int index = 0; for_each_child_of_node(dt_node, np) num_heaps++; heaps_data = devm_kzalloc(&pdev->dev, sizeof(struct ion_platform_heap *) * num_heaps, GFP_KERNEL); if (!heaps_data) return -ENOMEM; for_each_child_of_node(dt_node, np) { ret = of_property_read_string(np, "heap-name", &heap_name); if (ret < 0) { pr_err("check the name of node %s\n", np->name); continue; } ret = of_property_read_u32(np, "heap-id", &id); if (ret < 0) { pr_err("check the id %s\n", np->name); continue; } ret = of_property_read_u32(np, "heap-base", &base); if (ret < 0) { pr_err("check the base of node %s\n", np->name); continue; } ret = of_property_read_u32(np, "heap-size", &size); if (ret < 0) { pr_err("check the size of node %s\n", np->name); continue; } ret = of_property_read_string(np, "heap-type", &type_name); if (ret < 0) { pr_err("check the type of node %s\n", np->name); continue; } ret = get_type_by_name(type_name, &type); if (ret < 0) { pr_err("type name error %s!\n", type_name); continue; } pr_info("heap index %d : name %s base 0x%x size 0x%x id %d type %d\n", index, heap_name, base, size, id, type); p_data = devm_kzalloc(&pdev->dev, sizeof(struct ion_platform_heap), GFP_KERNEL); if (!p_data) return -ENOMEM; p_data->name = heap_name; p_data->base = base; p_data->size = size; p_data->id = id; p_data->type = type; heaps_data[index] = p_data; index++; } return 0; } static int hi6220_ion_probe(struct platform_device *pdev) { int i; int err; static struct ion_platform_heap *p_heap; idev = ion_device_create(NULL); err = hi6220_set_platform_data(pdev); if (err) { pr_err("ion set platform data error!\n"); goto err_free_idev; } heaps = devm_kzalloc(&pdev->dev, sizeof(struct ion_heap *) * num_heaps, GFP_KERNEL); if (!heaps) { err = -ENOMEM; goto err_free_idev; } /* * create the heaps as specified in the dts file */ for (i = 0; i < num_heaps; i++) { p_heap = heaps_data[i]; heaps[i] = ion_heap_create(p_heap); if (IS_ERR_OR_NULL(heaps[i])) { err = PTR_ERR(heaps[i]); goto err_free_heaps; } ion_device_add_heap(idev, heaps[i]); pr_info("%s: adding heap %s of type %d with %lx@%lx\n", __func__, p_heap->name, p_heap->type, p_heap->base, (unsigned long)p_heap->size); } return err; err_free_heaps: for (i = 0; i < num_heaps; ++i) { ion_heap_destroy(heaps[i]); heaps[i] = NULL; } err_free_idev: ion_device_destroy(idev); return err; } static int hi6220_ion_remove(struct platform_device *pdev) { int i; for (i = 0; i < num_heaps; i++) { ion_heap_destroy(heaps[i]); heaps[i] = NULL; } ion_device_destroy(idev); return 0; } static const struct of_device_id hi6220_ion_match_table[] = { {.compatible = "hisilicon,hi6220-ion"}, {}, }; static struct platform_driver hi6220_ion_driver = { .probe = hi6220_ion_probe, .remove = hi6220_ion_remove, .driver = { .name = "ion-hi6220", .of_match_table = hi6220_ion_match_table, }, }; static int __init hi6220_ion_init(void) { return platform_driver_register(&hi6220_ion_driver); } subsys_initcall(hi6220_ion_init);
/* * linux/arch/arm/mach-s3c64xx/mach-smartq5.c * * Copyright (C) 2010 Maurus Cuelenaere * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ #include <linux/fb.h> #include <linux/gpio.h> #include <linux/gpio_keys.h> #include <linux/init.h> #include <linux/input.h> #include <linux/leds.h> #include <linux/platform_device.h> #include <asm/hardware/vic.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <mach/map.h> #include <mach/regs-gpio.h> #include <plat/cpu.h> #include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> #include <plat/regs-fb-v4.h> #include "common.h" #include "mach-smartq.h" static struct gpio_led smartq5_leds[] = { { .name = "smartq5:green", .active_low = 1, .gpio = S3C64XX_GPN(8), }, { .name = "smartq5:red", .active_low = 1, .gpio = S3C64XX_GPN(9), }, }; static struct gpio_led_platform_data smartq5_led_data = { .num_leds = ARRAY_SIZE(smartq5_leds), .leds = smartq5_leds, }; static struct platform_device smartq5_leds_device = { .name = "leds-gpio", .id = -1, .dev.platform_data = &smartq5_led_data, }; /* Labels according to the SmartQ manual */ static struct gpio_keys_button smartq5_buttons[] = { { .gpio = S3C64XX_GPL(14), .code = KEY_POWER, .desc = "Power", .active_low = 1, .debounce_interval = 5, .type = EV_KEY, }, { .gpio = S3C64XX_GPN(2), .code = KEY_KPMINUS, .desc = "Minus", .active_low = 1, .debounce_interval = 5, .type = EV_KEY, }, { .gpio = S3C64XX_GPN(12), .code = KEY_KPPLUS, .desc = "Plus", .active_low = 1, .debounce_interval = 5, .type = EV_KEY, }, { .gpio = S3C64XX_GPN(15), .code = KEY_ENTER, .desc = "Move", .active_low = 1, .debounce_interval = 5, .type = EV_KEY, }, }; static struct gpio_keys_platform_data smartq5_buttons_data = { .buttons = smartq5_buttons, .nbuttons = ARRAY_SIZE(smartq5_buttons), }; static struct platform_device smartq5_buttons_device = { .name = "gpio-keys", .id = 0, .num_resources = 0, .dev = { .platform_data = &smartq5_buttons_data, } }; static struct s3c_fb_pd_win smartq5_fb_win0 = { .max_bpp = 32, .default_bpp = 16, .xres = 800, .yres = 480, }; static struct fb_videomode smartq5_lcd_timing = { .left_margin = 216, .right_margin = 40, .upper_margin = 35, .lower_margin = 10, .hsync_len = 1, .vsync_len = 1, .xres = 800, .yres = 480, .refresh = 80, }; static struct s3c_fb_platdata smartq5_lcd_pdata __initdata = { .setup_gpio = s3c64xx_fb_gpio_setup_24bpp, .vtiming = &smartq5_lcd_timing, .win[0] = &smartq5_fb_win0, .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC | VIDCON1_INV_VDEN, }; static struct platform_device *smartq5_devices[] __initdata = { &smartq5_leds_device, &smartq5_buttons_device, }; static void __init smartq5_machine_init(void) { s3c_fb_set_platdata(&smartq5_lcd_pdata); smartq_machine_init(); platform_add_devices(smartq5_devices, ARRAY_SIZE(smartq5_devices)); } MACHINE_START(SMARTQ5, "SmartQ 5") /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */ .atag_offset = 0x100, .init_irq = s3c6410_init_irq, .handle_irq = vic_handle_irq, .map_io = smartq_map_io, .init_machine = smartq5_machine_init, .init_late = s3c64xx_init_late, .timer = &s3c24xx_timer, .restart = s3c64xx_restart, MACHINE_END
#ifndef _LINUX_MAJOR_H #define _LINUX_MAJOR_H /* * This file has definitions for major device numbers. * For the device number assignments, see Documentation/admin-guide/devices.rst. */ #define UNNAMED_MAJOR 0 #define MEM_MAJOR 1 #define RAMDISK_MAJOR 1 #define FLOPPY_MAJOR 2 #define PTY_MASTER_MAJOR 2 #define IDE0_MAJOR 3 #define HD_MAJOR IDE0_MAJOR #define PTY_SLAVE_MAJOR 3 #define TTY_MAJOR 4 #define TTYAUX_MAJOR 5 #define LP_MAJOR 6 #define VCS_MAJOR 7 #define LOOP_MAJOR 7 #define SCSI_DISK0_MAJOR 8 #define SCSI_TAPE_MAJOR 9 #define MD_MAJOR 9 #define MISC_MAJOR 10 #define SCSI_CDROM_MAJOR 11 #define MUX_MAJOR 11 /* PA-RISC only */ #define XT_DISK_MAJOR 13 #define INPUT_MAJOR 13 #define SOUND_MAJOR 14 #define CDU31A_CDROM_MAJOR 15 #define JOYSTICK_MAJOR 15 #define GOLDSTAR_CDROM_MAJOR 16 #define OPTICS_CDROM_MAJOR 17 #define SANYO_CDROM_MAJOR 18 #define CYCLADES_MAJOR 19 #define CYCLADESAUX_MAJOR 20 #define MITSUMI_X_CDROM_MAJOR 20 #define MFM_ACORN_MAJOR 21 /* ARM Linux /dev/mfm */ #define SCSI_GENERIC_MAJOR 21 #define IDE1_MAJOR 22 #define DIGICU_MAJOR 22 #define DIGI_MAJOR 23 #define MITSUMI_CDROM_MAJOR 23 #define CDU535_CDROM_MAJOR 24 #define STL_SERIALMAJOR 24 #define MATSUSHITA_CDROM_MAJOR 25 #define STL_CALLOUTMAJOR 25 #define MATSUSHITA_CDROM2_MAJOR 26 #define QIC117_TAPE_MAJOR 27 #define MATSUSHITA_CDROM3_MAJOR 27 #define MATSUSHITA_CDROM4_MAJOR 28 #define STL_SIOMEMMAJOR 28 #define ACSI_MAJOR 28 #define AZTECH_CDROM_MAJOR 29 #define FB_MAJOR 29 /* /dev/fb* framebuffers */ #define MTD_BLOCK_MAJOR 31 #define CM206_CDROM_MAJOR 32 #define IDE2_MAJOR 33 #define IDE3_MAJOR 34 #define Z8530_MAJOR 34 #define XPRAM_MAJOR 35 /* Expanded storage on S/390: "slow ram"*/ #define NETLINK_MAJOR 36 #define PS2ESDI_MAJOR 36 #define IDETAPE_MAJOR 37 #define Z2RAM_MAJOR 37 #define APBLOCK_MAJOR 38 /* AP1000 Block device */ #define DDV_MAJOR 39 /* AP1000 DDV block device */ #define NBD_MAJOR 43 /* Network block device */ #define RISCOM8_NORMAL_MAJOR 48 #define DAC960_MAJOR 48 /* 48..55 */ #define RISCOM8_CALLOUT_MAJOR 49 #define MKISS_MAJOR 55 #define DSP56K_MAJOR 55 /* DSP56001 processor device */ #define IDE4_MAJOR 56 #define IDE5_MAJOR 57 #define SCSI_DISK1_MAJOR 65 #define SCSI_DISK2_MAJOR 66 #define SCSI_DISK3_MAJOR 67 #define SCSI_DISK4_MAJOR 68 #define SCSI_DISK5_MAJOR 69 #define SCSI_DISK6_MAJOR 70 #define SCSI_DISK7_MAJOR 71 #define COMPAQ_SMART2_MAJOR 72 #define COMPAQ_SMART2_MAJOR1 73 #define COMPAQ_SMART2_MAJOR2 74 #define COMPAQ_SMART2_MAJOR3 75 #define COMPAQ_SMART2_MAJOR4 76 #define COMPAQ_SMART2_MAJOR5 77 #define COMPAQ_SMART2_MAJOR6 78 #define COMPAQ_SMART2_MAJOR7 79 #define SPECIALIX_NORMAL_MAJOR 75 #define SPECIALIX_CALLOUT_MAJOR 76 #define AURORA_MAJOR 79 #define I2O_MAJOR 80 /* 80->87 */ #define SHMIQ_MAJOR 85 /* Linux/mips, SGI /dev/shmiq */ #define SCSI_CHANGER_MAJOR 86 #define IDE6_MAJOR 88 #define IDE7_MAJOR 89 #define IDE8_MAJOR 90 #define MTD_CHAR_MAJOR 90 #define IDE9_MAJOR 91 #define DASD_MAJOR 94 #define MDISK_MAJOR 95 #define UBD_MAJOR 98 #define PP_MAJOR 99 #define JSFD_MAJOR 99 #define PHONE_MAJOR 100 #define COMPAQ_CISS_MAJOR 104 #define COMPAQ_CISS_MAJOR1 105 #define COMPAQ_CISS_MAJOR2 106 #define COMPAQ_CISS_MAJOR3 107 #define COMPAQ_CISS_MAJOR4 108 #define COMPAQ_CISS_MAJOR5 109 #define COMPAQ_CISS_MAJOR6 110 #define COMPAQ_CISS_MAJOR7 111 #define VIODASD_MAJOR 112 #define VIOCD_MAJOR 113 #define ATARAID_MAJOR 114 #define SCSI_DISK8_MAJOR 128 #define SCSI_DISK9_MAJOR 129 #define SCSI_DISK10_MAJOR 130 #define SCSI_DISK11_MAJOR 131 #define SCSI_DISK12_MAJOR 132 #define SCSI_DISK13_MAJOR 133 #define SCSI_DISK14_MAJOR 134 #define SCSI_DISK15_MAJOR 135 #define UNIX98_PTY_MASTER_MAJOR 128 #define UNIX98_PTY_MAJOR_COUNT 8 #define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT) #define DRBD_MAJOR 147 #define RTF_MAJOR 150 #define RAW_MAJOR 162 #define USB_ACM_MAJOR 166 #define USB_ACM_AUX_MAJOR 167 #define USB_CHAR_MAJOR 180 #define MMC_BLOCK_MAJOR 179 #define VXVM_MAJOR 199 /* VERITAS volume i/o driver */ #define VXSPEC_MAJOR 200 /* VERITAS volume config driver */ #define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */ #define XENVBD_MAJOR 202 /* Xen virtual block device */ #define MSR_MAJOR 202 #define CPUID_MAJOR 203 #define OSST_MAJOR 206 /* OnStream-SCx0 SCSI tape */ #define IBM_TTY3270_MAJOR 227 #define IBM_FS3270_MAJOR 228 #define VIOTAPE_MAJOR 230 #define BLOCK_EXT_MAJOR 259 #define SCSI_OSD_MAJOR 260 /* open-osd's OSD scsi device */ #endif
// Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // 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. // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // 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. // Author: kenton@google.com (Kenton Varda) #include <vector> #include <google/protobuf/stubs/common.h> #include <google/protobuf/io/zero_copy_stream.h> namespace google { namespace protobuf { namespace compiler { class ZipWriter { public: ZipWriter(io::ZeroCopyOutputStream* raw_output); ~ZipWriter(); bool Write(const string& filename, const string& contents); bool WriteDirectory(); private: struct FileInfo { string name; uint32 offset; uint32 size; uint32 crc32; }; io::ZeroCopyOutputStream* raw_output_; vector<FileInfo> files_; }; } // namespace compiler } // namespace protobuf } // namespace google
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- #ifndef __java_util_zip_DeflaterOutputStream__ #define __java_util_zip_DeflaterOutputStream__ #pragma interface #include <java/io/FilterOutputStream.h> #include <gcj/array.h> class java::util::zip::DeflaterOutputStream : public ::java::io::FilterOutputStream { public: // actually protected virtual void deflate(); public: DeflaterOutputStream(::java::io::OutputStream *); DeflaterOutputStream(::java::io::OutputStream *, ::java::util::zip::Deflater *); DeflaterOutputStream(::java::io::OutputStream *, ::java::util::zip::Deflater *, jint); virtual void flush(); virtual void finish(); virtual void close(); virtual void write(jint); virtual void write(JArray< jbyte > *, jint, jint); public: // actually protected JArray< jbyte > * __attribute__((aligned(__alignof__( ::java::io::FilterOutputStream)))) buf; ::java::util::zip::Deflater * def; public: static ::java::lang::Class class$; }; #endif // __java_util_zip_DeflaterOutputStream__
/****************************************************************************** * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * The full GNU General Public License is included in this distribution in the * file called LICENSE. * * Contact Information: * wlanfae <wlanfae@realtek.com> ******************************************************************************/ #ifndef _RTL819XU_HTTYPE_H_ #define _RTL819XU_HTTYPE_H_ #define MIMO_PS_STATIC 0 #define MIMO_PS_DYNAMIC 1 #define MIMO_PS_NOLIMIT 3 #define sHTCLng 4 enum ht_channel_width { HT_CHANNEL_WIDTH_20 = 0, HT_CHANNEL_WIDTH_20_40 = 1, }; enum ht_extchnl_offset { HT_EXTCHNL_OFFSET_NO_EXT = 0, HT_EXTCHNL_OFFSET_UPPER = 1, HT_EXTCHNL_OFFSET_NO_DEF = 2, HT_EXTCHNL_OFFSET_LOWER = 3, }; struct ht_capab_ele { u8 AdvCoding:1; u8 ChlWidth:1; u8 MimoPwrSave:2; u8 GreenField:1; u8 ShortGI20Mhz:1; u8 ShortGI40Mhz:1; u8 TxSTBC:1; u8 RxSTBC:2; u8 DelayBA:1; u8 MaxAMSDUSize:1; u8 DssCCk:1; u8 PSMP:1; u8 Rsvd1:1; u8 LSigTxopProtect:1; u8 MaxRxAMPDUFactor:2; u8 MPDUDensity:3; u8 Rsvd2:3; u8 MCS[16]; u16 ExtHTCapInfo; u8 TxBFCap[4]; u8 ASCap; } __packed; struct ht_info_ele { u8 ControlChl; u8 ExtChlOffset:2; u8 RecommemdedTxWidth:1; u8 RIFS:1; u8 PSMPAccessOnly:1; u8 SrvIntGranularity:3; u8 OptMode:2; u8 NonGFDevPresent:1; u8 Revd1:5; u8 Revd2:8; u8 Rsvd3:6; u8 DualBeacon:1; u8 DualCTSProtect:1; u8 SecondaryBeacon:1; u8 LSigTxopProtectFull:1; u8 PcoActive:1; u8 PcoPhase:1; u8 Rsvd4:4; u8 BasicMSC[16]; } __packed; enum ht_spec_ver { HT_SPEC_VER_IEEE = 0, HT_SPEC_VER_EWC = 1, }; enum ht_aggre_mode { HT_AGG_AUTO = 0, HT_AGG_FORCE_ENABLE = 1, HT_AGG_FORCE_DISABLE = 2, }; struct rt_hi_throughput { u8 bEnableHT; u8 bCurrentHTSupport; u8 bRegBW40MHz; u8 bCurBW40MHz; u8 bRegShortGI40MHz; u8 bCurShortGI40MHz; u8 bRegShortGI20MHz; u8 bCurShortGI20MHz; u8 bRegSuppCCK; u8 bCurSuppCCK; enum ht_spec_ver ePeerHTSpecVer; struct ht_capab_ele SelfHTCap; struct ht_info_ele SelfHTInfo; u8 PeerHTCapBuf[32]; u8 PeerHTInfoBuf[32]; u8 bAMSDU_Support; u16 nAMSDU_MaxSize; u8 bCurrent_AMSDU_Support; u16 nCurrent_AMSDU_MaxSize; u8 bAMPDUEnable; u8 bCurrentAMPDUEnable; u8 AMPDU_Factor; u8 CurrentAMPDUFactor; u8 MPDU_Density; u8 CurrentMPDUDensity; enum ht_aggre_mode ForcedAMPDUMode; u8 ForcedAMPDUFactor; u8 ForcedMPDUDensity; enum ht_aggre_mode ForcedAMSDUMode; u16 ForcedAMSDUMaxSize; u8 bForcedShortGI; u8 CurrentOpMode; u8 SelfMimoPs; u8 PeerMimoPs; enum ht_extchnl_offset CurSTAExtChnlOffset; u8 bCurTxBW40MHz; u8 PeerBandwidth; u8 bSwBwInProgress; u8 SwBwStep; u8 bRegRT2RTAggregation; u8 RT2RT_HT_Mode; u8 bCurrentRT2RTAggregation; u8 bCurrentRT2RTLongSlotTime; u8 szRT2RTAggBuffer[10]; u8 bRegRxReorderEnable; u8 bCurRxReorderEnable; u8 RxReorderWinSize; u8 RxReorderPendingTime; u16 RxReorderDropCounter; u8 bIsPeerBcm; u8 IOTPeer; u32 IOTAction; u8 IOTRaFunc; u8 bWAIotBroadcom; u8 WAIotTH; u8 bAcceptAddbaReq; } __packed; struct bss_ht { u8 bdSupportHT; u8 bdHTCapBuf[32]; u16 bdHTCapLen; u8 bdHTInfoBuf[32]; u16 bdHTInfoLen; enum ht_spec_ver bdHTSpecVer; enum ht_channel_width bdBandWidth; u8 bdRT2RTAggregation; u8 bdRT2RTLongSlotTime; u8 RT2RT_HT_Mode; u8 bdHT1R; }; extern u8 MCS_FILTER_ALL[16]; extern u8 MCS_FILTER_1SS[16]; #define RATE_ADPT_1SS_MASK 0xFF #define RATE_ADPT_2SS_MASK 0xF0 #define RATE_ADPT_MCS32_MASK 0x01 enum ht_aggre_size { HT_AGG_SIZE_8K = 0, HT_AGG_SIZE_16K = 1, HT_AGG_SIZE_32K = 2, HT_AGG_SIZE_64K = 3, }; enum ht_iot_peer { HT_IOT_PEER_UNKNOWN = 0, HT_IOT_PEER_REALTEK = 1, HT_IOT_PEER_REALTEK_92SE = 2, HT_IOT_PEER_BROADCOM = 3, HT_IOT_PEER_RALINK = 4, HT_IOT_PEER_ATHEROS = 5, HT_IOT_PEER_CISCO = 6, HT_IOT_PEER_MARVELL = 7, HT_IOT_PEER_92U_SOFTAP = 8, HT_IOT_PEER_SELF_SOFTAP = 9, HT_IOT_PEER_AIRGO = 10, HT_IOT_PEER_MAX = 11, }; enum ht_iot_action { HT_IOT_ACT_TX_USE_AMSDU_4K = 0x00000001, HT_IOT_ACT_TX_USE_AMSDU_8K = 0x00000002, HT_IOT_ACT_DISABLE_MCS14 = 0x00000004, HT_IOT_ACT_DISABLE_MCS15 = 0x00000008, HT_IOT_ACT_DISABLE_ALL_2SS = 0x00000010, HT_IOT_ACT_DISABLE_EDCA_TURBO = 0x00000020, HT_IOT_ACT_MGNT_USE_CCK_6M = 0x00000040, HT_IOT_ACT_CDD_FSYNC = 0x00000080, HT_IOT_ACT_PURE_N_MODE = 0x00000100, HT_IOT_ACT_FORCED_CTS2SELF = 0x00000200, HT_IOT_ACT_FORCED_RTS = 0x00000400, HT_IOT_ACT_AMSDU_ENABLE = 0x00000800, HT_IOT_ACT_REJECT_ADDBA_REQ = 0x00001000, HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT = 0x00002000, HT_IOT_ACT_EDCA_BIAS_ON_RX = 0x00004000, HT_IOT_ACT_HYBRID_AGGREGATION = 0x00010000, HT_IOT_ACT_DISABLE_SHORT_GI = 0x00020000, HT_IOT_ACT_DISABLE_HIGH_POWER = 0x00040000, HT_IOT_ACT_DISABLE_TX_40_MHZ = 0x00080000, HT_IOT_ACT_TX_NO_AGGREGATION = 0x00100000, HT_IOT_ACT_DISABLE_TX_2SS = 0x00200000, HT_IOT_ACT_MID_HIGHPOWER = 0x00400000, HT_IOT_ACT_NULL_DATA_POWER_SAVING = 0x00800000, HT_IOT_ACT_DISABLE_CCK_RATE = 0x01000000, HT_IOT_ACT_FORCED_ENABLE_BE_TXOP = 0x02000000, HT_IOT_ACT_WA_IOT_Broadcom = 0x04000000, HT_IOT_ACT_DISABLE_RX_40MHZ_SHORT_GI = 0x08000000, }; enum ht_iot_rafunc { HT_IOT_RAFUNC_DISABLE_ALL = 0x00, HT_IOT_RAFUNC_PEER_1R = 0x01, HT_IOT_RAFUNC_TX_AMSDU = 0x02, }; enum rt_ht_capability { RT_HT_CAP_USE_TURBO_AGGR = 0x01, RT_HT_CAP_USE_LONG_PREAMBLE = 0x02, RT_HT_CAP_USE_AMPDU = 0x04, RT_HT_CAP_USE_WOW = 0x8, RT_HT_CAP_USE_SOFTAP = 0x10, RT_HT_CAP_USE_92SE = 0x20, }; #endif
/* * Copyright (C) 1999-2011, Broadcom Corporation * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under the terms of the GNU General Public License version 2 (the "GPL"), * available at http://www.broadcom.com/licenses/GPLv2.php, with the * following added to such license: * * As a special exception, the copyright holders of this software give you * permission to link this software with independent modules, and to copy and * distribute the resulting executable under terms of your choice, provided that * you also meet, for each linked independent module, the terms and conditions of * the license of that module. An independent module is a module which is not * derived from this software. The special exception does not apply to any * modifications of the software. * * Notwithstanding the above, under no circumstances may you combine this * software in any way with any other Broadcom software provided under a license * other than the GPL, without Broadcom's express prior written consent. * * $Id: epivers.h.in 277737 2011-08-16 17:54:59Z $ * */ #ifndef _epivers_h_ #define _epivers_h_ #define EPI_MAJOR_VERSION 5 #define EPI_MINOR_VERSION 90 #define EPI_RC_NUMBER 195 #define EPI_INCREMENTAL_NUMBER 104 #define EPI_BUILD_NUMBER 0 #define EPI_VERSION 5, 90, 195, 104 #define EPI_VERSION_NUM 0x055ac368 #define EPI_VERSION_DEV 5.90.195 #define EPI_VERSION_STR "5.90.195.104" #endif
/* * include/media/smiapp/smiapp-regs.h * * Generic driver for SMIA/SMIA++ compliant camera modules * * Copyright (C) 2011--2012 Nokia Corporation * Contact: Sakari Ailus <sakari.ailus@iki.fi> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef SMIAPP_REGS_H #define SMIAPP_REGS_H #include <linux/i2c.h> #include <linux/types.h> /* Use upper 8 bits of the type field for flags */ #define SMIA_REG_FLAG_FLOAT (1 << 24) #define SMIA_REG_8BIT 1 #define SMIA_REG_16BIT 2 #define SMIA_REG_32BIT 4 struct smia_reg { u16 type; u16 reg; /* 16-bit offset */ u32 val; /* 8/16/32-bit value */ }; struct smiapp_sensor; int smiapp_read(struct smiapp_sensor *sensor, u32 reg, u32 *val); int smiapp_read_8only(struct smiapp_sensor *sensor, u32 reg, u32 *val); int smiapp_write(struct smiapp_sensor *sensor, u32 reg, u32 val); #endif
/* * Copyright (c) 2015, Christoph Hellwig. * Copyright (c) 2015, Intel Corporation. */ #include <linux/platform_device.h> #include <linux/memory_hotplug.h> #include <linux/libnvdimm.h> #include <linux/module.h> static const struct attribute_group *e820_pmem_attribute_groups[] = { &nvdimm_bus_attribute_group, NULL, }; static const struct attribute_group *e820_pmem_region_attribute_groups[] = { &nd_region_attribute_group, &nd_device_attribute_group, NULL, }; static int e820_pmem_remove(struct platform_device *pdev) { struct nvdimm_bus *nvdimm_bus = platform_get_drvdata(pdev); nvdimm_bus_unregister(nvdimm_bus); return 0; } #ifdef CONFIG_MEMORY_HOTPLUG static int e820_range_to_nid(resource_size_t addr) { return memory_add_physaddr_to_nid(addr); } #else static int e820_range_to_nid(resource_size_t addr) { return NUMA_NO_NODE; } #endif static int e820_pmem_probe(struct platform_device *pdev) { static struct nvdimm_bus_descriptor nd_desc; struct device *dev = &pdev->dev; struct nvdimm_bus *nvdimm_bus; struct resource *p; nd_desc.attr_groups = e820_pmem_attribute_groups; nd_desc.provider_name = "e820"; nvdimm_bus = nvdimm_bus_register(dev, &nd_desc); if (!nvdimm_bus) goto err; platform_set_drvdata(pdev, nvdimm_bus); for (p = iomem_resource.child; p ; p = p->sibling) { struct nd_region_desc ndr_desc; if (strncmp(p->name, "Persistent Memory (legacy)", 26) != 0) continue; memset(&ndr_desc, 0, sizeof(ndr_desc)); ndr_desc.res = p; ndr_desc.attr_groups = e820_pmem_region_attribute_groups; ndr_desc.numa_node = e820_range_to_nid(p->start); set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags); if (!nvdimm_pmem_region_create(nvdimm_bus, &ndr_desc)) goto err; } return 0; err: nvdimm_bus_unregister(nvdimm_bus); dev_err(dev, "failed to register legacy persistent memory ranges\n"); return -ENXIO; } static struct platform_driver e820_pmem_driver = { .probe = e820_pmem_probe, .remove = e820_pmem_remove, .driver = { .name = "e820_pmem", }, }; static __init int e820_pmem_init(void) { return platform_driver_register(&e820_pmem_driver); } static __exit void e820_pmem_exit(void) { platform_driver_unregister(&e820_pmem_driver); } MODULE_ALIAS("platform:e820_pmem*"); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Intel Corporation"); module_init(e820_pmem_init); module_exit(e820_pmem_exit);
/* * arch/arm/mach-w90x900/include/mach/regs-serial.h * * Copyright (c) 2008 Nuvoton technology corporation * All rights reserved. * * Wan ZongShun <mcuos.com@gmail.com> * * Based on arch/arm/mach-s3c2410/include/mach/regs-serial.h * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * */ #ifndef __ASM_ARM_REGS_SERIAL_H #define __ASM_ARM_REGS_SERIAL_H #define UART0_BA W90X900_VA_UART #define UART1_BA (W90X900_VA_UART+0x100) #define UART2_BA (W90X900_VA_UART+0x200) #define UART3_BA (W90X900_VA_UART+0x300) #define UART4_BA (W90X900_VA_UART+0x400) #define UART0_PA W90X900_PA_UART #define UART1_PA (W90X900_PA_UART+0x100) #define UART2_PA (W90X900_PA_UART+0x200) #define UART3_PA (W90X900_PA_UART+0x300) #define UART4_PA (W90X900_PA_UART+0x400) #ifndef __ASSEMBLY__ struct w90x900_uart_clksrc { const char *name; unsigned int divisor; unsigned int min_baud; unsigned int max_baud; }; struct w90x900_uartcfg { unsigned char hwport; unsigned char unused; unsigned short flags; unsigned long uart_flags; unsigned long ucon; unsigned long ulcon; unsigned long ufcon; struct w90x900_uart_clksrc *clocks; unsigned int clocks_size; }; #endif /* __ASSEMBLY__ */ #endif /* __ASM_ARM_REGS_SERIAL_H */
/* Test further cases of warnings for comma expressions, with and without casts to void. */ /* Origin: Joseph Myers <joseph@codesourcery.com> */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ int a, b, c, d; int e(void) { return (char)a, b; } /* { dg-warning "left-hand operand of comma expression has no effect" } */ int f(void) { return (a ? (void)b : (void)c), d; } /* { dg-warning "left-hand operand of comma expression has no effect" } */
/* SPDX-License-Identifier: GPL-2.0 OR MIT */ /* Copyright 2018-2019 Qiang Yu <yuq825@gmail.com> */ #ifndef __LIMA_DLBU_H__ #define __LIMA_DLBU_H__ struct lima_ip; struct lima_device; void lima_dlbu_enable(struct lima_device *dev, int num_pp); void lima_dlbu_disable(struct lima_device *dev); void lima_dlbu_set_reg(struct lima_ip *ip, u32 *reg); int lima_dlbu_resume(struct lima_ip *ip); void lima_dlbu_suspend(struct lima_ip *ip); int lima_dlbu_init(struct lima_ip *ip); void lima_dlbu_fini(struct lima_ip *ip); #endif
// // GADInAppPurchase.h // Google Mobile Ads SDK // // Copyright 2013 Google Inc. All rights reserved. // #import <Foundation/Foundation.h> #import "GADModules.h" /// Enum of the different statuses resulting from processing a purchase. typedef NS_ENUM(NSInteger, GADInAppPurchaseStatus) { kGADInAppPurchaseStatusError = 0, ///< Error occured while processing the purchase. kGADInAppPurchaseStatusSuccessful = 1, ///< Purchase was completed successfully. kGADInAppPurchaseStatusCancel = 2, ///< Purchase was cancelled by the user. kGADInAppPurchaseStatusInvalidProduct = 3 ///< Error occured while looking up the product. }; /// The in-app purchase item to be purchased with the purchase flow handled by you, the /// application developer. /// Instances of this class are created and passed to your in-app purchase delegate when users click /// a buy button. It is important to report the result of the purchase back to the SDK in order to /// track metrics about the transaction. @interface GADInAppPurchase : NSObject /// The in-app purchase product ID. @property(nonatomic, readonly, copy) NSString *productID; /// The product quantity. @property(nonatomic, readonly, assign) NSUInteger quantity; /// The in-app purchase delegate object must call this method after handling the in-app purchase for /// both successful and unsuccessful purchase attempts. This method reports ad conversion and /// purchase status information to Google. - (void)reportPurchaseStatus:(GADInAppPurchaseStatus)purchaseStatus; @end
/* * lwtunnel Infrastructure for light weight tunnels like mpls * * Authors: Roopa Prabhu, <roopa@cumulusnetworks.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. * */ #include <linux/capability.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/uaccess.h> #include <linux/skbuff.h> #include <linux/netdevice.h> #include <linux/lwtunnel.h> #include <linux/in.h> #include <linux/init.h> #include <linux/err.h> #include <net/lwtunnel.h> #include <net/rtnetlink.h> #include <net/ip6_fib.h> struct lwtunnel_state *lwtunnel_state_alloc(int encap_len) { struct lwtunnel_state *lws; lws = kzalloc(sizeof(*lws) + encap_len, GFP_ATOMIC); return lws; } EXPORT_SYMBOL(lwtunnel_state_alloc); static const struct lwtunnel_encap_ops __rcu * lwtun_encaps[LWTUNNEL_ENCAP_MAX + 1] __read_mostly; int lwtunnel_encap_add_ops(const struct lwtunnel_encap_ops *ops, unsigned int num) { if (num > LWTUNNEL_ENCAP_MAX) return -ERANGE; return !cmpxchg((const struct lwtunnel_encap_ops **) &lwtun_encaps[num], NULL, ops) ? 0 : -1; } EXPORT_SYMBOL(lwtunnel_encap_add_ops); int lwtunnel_encap_del_ops(const struct lwtunnel_encap_ops *ops, unsigned int encap_type) { int ret; if (encap_type == LWTUNNEL_ENCAP_NONE || encap_type > LWTUNNEL_ENCAP_MAX) return -ERANGE; ret = (cmpxchg((const struct lwtunnel_encap_ops **) &lwtun_encaps[encap_type], ops, NULL) == ops) ? 0 : -1; synchronize_net(); return ret; } EXPORT_SYMBOL(lwtunnel_encap_del_ops); int lwtunnel_build_state(struct net_device *dev, u16 encap_type, struct nlattr *encap, unsigned int family, const void *cfg, struct lwtunnel_state **lws) { const struct lwtunnel_encap_ops *ops; int ret = -EINVAL; if (encap_type == LWTUNNEL_ENCAP_NONE || encap_type > LWTUNNEL_ENCAP_MAX) return ret; ret = -EOPNOTSUPP; rcu_read_lock(); ops = rcu_dereference(lwtun_encaps[encap_type]); if (likely(ops && ops->build_state)) ret = ops->build_state(dev, encap, family, cfg, lws); rcu_read_unlock(); return ret; } EXPORT_SYMBOL(lwtunnel_build_state); int lwtunnel_fill_encap(struct sk_buff *skb, struct lwtunnel_state *lwtstate) { const struct lwtunnel_encap_ops *ops; struct nlattr *nest; int ret = -EINVAL; if (!lwtstate) return 0; if (lwtstate->type == LWTUNNEL_ENCAP_NONE || lwtstate->type > LWTUNNEL_ENCAP_MAX) return 0; ret = -EOPNOTSUPP; nest = nla_nest_start(skb, RTA_ENCAP); rcu_read_lock(); ops = rcu_dereference(lwtun_encaps[lwtstate->type]); if (likely(ops && ops->fill_encap)) ret = ops->fill_encap(skb, lwtstate); rcu_read_unlock(); if (ret) goto nla_put_failure; nla_nest_end(skb, nest); ret = nla_put_u16(skb, RTA_ENCAP_TYPE, lwtstate->type); if (ret) goto nla_put_failure; return 0; nla_put_failure: nla_nest_cancel(skb, nest); return (ret == -EOPNOTSUPP ? 0 : ret); } EXPORT_SYMBOL(lwtunnel_fill_encap); int lwtunnel_get_encap_size(struct lwtunnel_state *lwtstate) { const struct lwtunnel_encap_ops *ops; int ret = 0; if (!lwtstate) return 0; if (lwtstate->type == LWTUNNEL_ENCAP_NONE || lwtstate->type > LWTUNNEL_ENCAP_MAX) return 0; rcu_read_lock(); ops = rcu_dereference(lwtun_encaps[lwtstate->type]); if (likely(ops && ops->get_encap_size)) ret = nla_total_size(ops->get_encap_size(lwtstate)); rcu_read_unlock(); return ret; } EXPORT_SYMBOL(lwtunnel_get_encap_size); int lwtunnel_cmp_encap(struct lwtunnel_state *a, struct lwtunnel_state *b) { const struct lwtunnel_encap_ops *ops; int ret = 0; if (!a && !b) return 0; if (!a || !b) return 1; if (a->type != b->type) return 1; if (a->type == LWTUNNEL_ENCAP_NONE || a->type > LWTUNNEL_ENCAP_MAX) return 0; rcu_read_lock(); ops = rcu_dereference(lwtun_encaps[a->type]); if (likely(ops && ops->cmp_encap)) ret = ops->cmp_encap(a, b); rcu_read_unlock(); return ret; } EXPORT_SYMBOL(lwtunnel_cmp_encap); int lwtunnel_output(struct sock *sk, struct sk_buff *skb) { struct dst_entry *dst = skb_dst(skb); const struct lwtunnel_encap_ops *ops; struct lwtunnel_state *lwtstate; int ret = -EINVAL; if (!dst) goto drop; lwtstate = dst->lwtstate; if (lwtstate->type == LWTUNNEL_ENCAP_NONE || lwtstate->type > LWTUNNEL_ENCAP_MAX) return 0; ret = -EOPNOTSUPP; rcu_read_lock(); ops = rcu_dereference(lwtun_encaps[lwtstate->type]); if (likely(ops && ops->output)) ret = ops->output(sk, skb); rcu_read_unlock(); if (ret == -EOPNOTSUPP) goto drop; return ret; drop: kfree_skb(skb); return ret; } EXPORT_SYMBOL(lwtunnel_output); int lwtunnel_input(struct sk_buff *skb) { struct dst_entry *dst = skb_dst(skb); const struct lwtunnel_encap_ops *ops; struct lwtunnel_state *lwtstate; int ret = -EINVAL; if (!dst) goto drop; lwtstate = dst->lwtstate; if (lwtstate->type == LWTUNNEL_ENCAP_NONE || lwtstate->type > LWTUNNEL_ENCAP_MAX) return 0; ret = -EOPNOTSUPP; rcu_read_lock(); ops = rcu_dereference(lwtun_encaps[lwtstate->type]); if (likely(ops && ops->input)) ret = ops->input(skb); rcu_read_unlock(); if (ret == -EOPNOTSUPP) goto drop; return ret; drop: kfree_skb(skb); return ret; } EXPORT_SYMBOL(lwtunnel_input);
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __NVBIOS_NPDE_H__ #define __NVBIOS_NPDE_H__ struct nvbios_npdeT { u32 image_size; bool last; }; u32 nvbios_npdeTe(struct nvkm_bios *, u32); u32 nvbios_npdeTp(struct nvkm_bios *, u32, struct nvbios_npdeT *); #endif
#ifndef _POWERNV_H #define _POWERNV_H #ifdef CONFIG_SMP extern void pnv_smp_init(void); #else static inline void pnv_smp_init(void) { } #endif struct pci_dev; #ifdef CONFIG_PCI extern void pnv_pci_init(void); extern void pnv_pci_shutdown(void); extern int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask); extern u64 pnv_pci_dma_get_required_mask(struct pci_dev *pdev); #else static inline void pnv_pci_init(void) { } static inline void pnv_pci_shutdown(void) { } static inline int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask) { return -ENODEV; } static inline u64 pnv_pci_dma_get_required_mask(struct pci_dev *pdev) { return 0; } #endif extern u32 pnv_get_supported_cpuidle_states(void); extern void pnv_lpc_init(void); bool cpu_core_split_required(void); #endif /* _POWERNV_H */
/* arch/arm/plat-s3c64xx/irq.c * * Copyright 2008 Openmoko, Inc. * Copyright 2008 Simtec Electronics * Ben Dooks <ben@simtec.co.uk> * http://armlinux.simtec.co.uk/ * * S3C64XX - Interrupt handling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/kernel.h> #include <linux/interrupt.h> #include <linux/serial_core.h> #include <linux/irq.h> #include <linux/io.h> #include <asm/hardware/vic.h> #include <mach/map.h> #include <plat/irq-vic-timer.h> #include <plat/irq-uart.h> #include <plat/cpu.h> static struct s3c_uart_irq uart_irqs[] = { [0] = { .regs = S3C_VA_UART0, .base_irq = IRQ_S3CUART_BASE0, .parent_irq = IRQ_UART0, }, [1] = { .regs = S3C_VA_UART1, .base_irq = IRQ_S3CUART_BASE1, .parent_irq = IRQ_UART1, }, [2] = { .regs = S3C_VA_UART2, .base_irq = IRQ_S3CUART_BASE2, .parent_irq = IRQ_UART2, }, [3] = { .regs = S3C_VA_UART3, .base_irq = IRQ_S3CUART_BASE3, .parent_irq = IRQ_UART3, }, }; void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid) { printk(KERN_DEBUG "%s: initialising interrupts\n", __func__); /* initialise the pair of VICs */ vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, 0); vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, 0); /* add the timer sub-irqs */ s3c_init_vic_timer_irq(5, IRQ_TIMER0); s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs)); }
/* MN10300 Virtual kernel memory mappings for high memory * * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * - Derived from include/asm-i386/highmem.h * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public Licence * as published by the Free Software Foundation; either version * 2 of the Licence, or (at your option) any later version. */ #ifndef _ASM_HIGHMEM_H #define _ASM_HIGHMEM_H #ifdef __KERNEL__ #include <linux/init.h> #include <linux/interrupt.h> #include <linux/highmem.h> #include <asm/kmap_types.h> #include <asm/pgtable.h> /* undef for production */ #undef HIGHMEM_DEBUG /* declarations for highmem.c */ extern unsigned long highstart_pfn, highend_pfn; extern pte_t *kmap_pte; extern pgprot_t kmap_prot; extern pte_t *pkmap_page_table; extern void __init kmap_init(void); /* * Right now we initialize only a single pte table. It can be extended * easily, subsequent pte tables have to be allocated in one physical * chunk of RAM. */ #define PKMAP_BASE 0xfe000000UL #define LAST_PKMAP 1024 #define LAST_PKMAP_MASK (LAST_PKMAP - 1) #define PKMAP_NR(virt) ((virt - PKMAP_BASE) >> PAGE_SHIFT) #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) extern unsigned long kmap_high(struct page *page); extern void kunmap_high(struct page *page); static inline unsigned long kmap(struct page *page) { if (in_interrupt()) BUG(); if (page < highmem_start_page) return page_address(page); return kmap_high(page); } static inline void kunmap(struct page *page) { if (in_interrupt()) BUG(); if (page < highmem_start_page) return; kunmap_high(page); } /* * The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap * gives a more generic (and caching) interface. But kmap_atomic can * be used in IRQ contexts, so in some (very limited) cases we need * it. */ static inline void *kmap_atomic(struct page *page) { unsigned long vaddr; int idx, type; preempt_disable(); pagefault_disable(); if (page < highmem_start_page) return page_address(page); type = kmap_atomic_idx_push(); idx = type + KM_TYPE_NR * smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); #if HIGHMEM_DEBUG if (!pte_none(*(kmap_pte - idx))) BUG(); #endif set_pte(kmap_pte - idx, mk_pte(page, kmap_prot)); local_flush_tlb_one(vaddr); return (void *)vaddr; } static inline void __kunmap_atomic(unsigned long vaddr) { int type; if (vaddr < FIXADDR_START) { /* FIXME */ pagefault_enable(); preempt_enable(); return; } type = kmap_atomic_idx(); #if HIGHMEM_DEBUG { unsigned int idx; idx = type + KM_TYPE_NR * smp_processor_id(); if (vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx)) BUG(); /* * force other mappings to Oops if they'll try to access * this pte without first remap it */ pte_clear(kmap_pte - idx); local_flush_tlb_one(vaddr); } #endif kmap_atomic_idx_pop(); pagefault_enable(); preempt_enable(); } #endif /* __KERNEL__ */ #endif /* _ASM_HIGHMEM_H */
// SPDX-License-Identifier: GPL-2.0 /* * Memory preserving reboot related code. * * Created by: Hariprasad Nellitheertha (hari@in.ibm.com) * Copyright (C) IBM Corporation, 2004. All rights reserved */ #include <linux/errno.h> #include <linux/crash_dump.h> #include <linux/uaccess.h> #include <linux/io.h> #include <linux/cc_platform.h> static ssize_t __copy_oldmem_page(unsigned long pfn, char *buf, size_t csize, unsigned long offset, int userbuf, bool encrypted) { void *vaddr; if (!csize) return 0; if (encrypted) vaddr = (__force void *)ioremap_encrypted(pfn << PAGE_SHIFT, PAGE_SIZE); else vaddr = (__force void *)ioremap_cache(pfn << PAGE_SHIFT, PAGE_SIZE); if (!vaddr) return -ENOMEM; if (userbuf) { if (copy_to_user((void __user *)buf, vaddr + offset, csize)) { iounmap((void __iomem *)vaddr); return -EFAULT; } } else memcpy(buf, vaddr + offset, csize); set_iounmap_nonlazy(); iounmap((void __iomem *)vaddr); return csize; } /** * copy_oldmem_page - copy one page of memory * @pfn: page frame number to be copied * @buf: target memory address for the copy; this can be in kernel address * space or user address space (see @userbuf) * @csize: number of bytes to copy * @offset: offset in bytes into the page (based on pfn) to begin the copy * @userbuf: if set, @buf is in user address space, use copy_to_user(), * otherwise @buf is in kernel address space, use memcpy(). * * Copy a page from the old kernel's memory. For this page, there is no pte * mapped in the current kernel. We stitch up a pte, similar to kmap_atomic. */ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, size_t csize, unsigned long offset, int userbuf) { return __copy_oldmem_page(pfn, buf, csize, offset, userbuf, false); } /** * copy_oldmem_page_encrypted - same as copy_oldmem_page() above but ioremap the * memory with the encryption mask set to accommodate kdump on SME-enabled * machines. */ ssize_t copy_oldmem_page_encrypted(unsigned long pfn, char *buf, size_t csize, unsigned long offset, int userbuf) { return __copy_oldmem_page(pfn, buf, csize, offset, userbuf, true); } ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos) { return read_from_oldmem(buf, count, ppos, 0, cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)); }
/************************************************************************** * * Copyright 2006 Tungsten Graphics, Inc., Bismack, ND. USA. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. * * **************************************************************************/ /* * Simple open hash tab implementation. * * Authors: * Thomas Hellström <thomas-at-tungstengraphics-dot-com> */ #ifndef DRM_HASHTAB_H #define DRM_HASHTAB_H #include <linux/list.h> #define drm_hash_entry(_ptr, _type, _member) container_of(_ptr, _type, _member) struct drm_hash_item { struct hlist_node head; unsigned long key; }; struct drm_open_hash { struct hlist_head *table; u8 order; }; extern int drm_ht_create(struct drm_open_hash *ht, unsigned int order); extern int drm_ht_insert_item(struct drm_open_hash *ht, struct drm_hash_item *item); extern int drm_ht_just_insert_please(struct drm_open_hash *ht, struct drm_hash_item *item, unsigned long seed, int bits, int shift, unsigned long add); extern int drm_ht_find_item(struct drm_open_hash *ht, unsigned long key, struct drm_hash_item **item); extern void drm_ht_verbose_list(struct drm_open_hash *ht, unsigned long key); extern int drm_ht_remove_key(struct drm_open_hash *ht, unsigned long key); extern int drm_ht_remove_item(struct drm_open_hash *ht, struct drm_hash_item *item); extern void drm_ht_remove(struct drm_open_hash *ht); #endif
/* $OpenBSD: gscpm.c,v 1.9 2012/08/16 18:42:04 tedu Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * National Semiconductor Geode SC1100 SMI/ACPI module. */ #include <sys/param.h> #include <sys/systm.h> #include <sys/device.h> #include <sys/kernel.h> #include <sys/timetc.h> #include <machine/bus.h> #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> #include <dev/pci/pcidevs.h> #include <i386/pci/gscpmreg.h> struct gscpm_softc { struct device sc_dev; pci_chipset_tag_t sc_pc; pcitag_t sc_tag; bus_space_tag_t sc_iot; bus_space_handle_t sc_acpi_ioh; }; int gscpm_match(struct device *, void *, void *); void gscpm_attach(struct device *, struct device *, void *); void gscpm_setperf(int); u_int gscpm_get_timecount(struct timecounter *tc); struct timecounter gscpm_timecounter = { gscpm_get_timecount, /* get_timecount */ 0, /* no poll_pps */ 0xffffff, /* counter_mask */ 3579545, /* frequency */ "GSCPM", /* name */ 1000 /* quality */ }; struct cfattach gscpm_ca = { sizeof (struct gscpm_softc), gscpm_match, gscpm_attach }; struct cfdriver gscpm_cd = { NULL, "gscpm", DV_DULL }; #if 0 static void *gscpm_cookie; /* XXX */ #endif int gscpm_match(struct device *parent, void *match, void *aux) { struct pci_attach_args *pa = aux; if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_NS && PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_NS_SC1100_SMI) return (1); return (0); } void gscpm_attach(struct device *parent, struct device *self, void *aux) { struct gscpm_softc *sc = (struct gscpm_softc *)self; struct pci_attach_args *pa = aux; pcireg_t csr, acpibase; sc->sc_pc = pa->pa_pc; sc->sc_tag = pa->pa_tag; sc->sc_iot = pa->pa_iot; /* Enable I/O space */ csr = pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_COMMAND_STATUS_REG); pci_conf_write(sc->sc_pc, sc->sc_tag, PCI_COMMAND_STATUS_REG, csr | PCI_COMMAND_IO_ENABLE); /* Map ACPI registers */ acpibase = pci_conf_read(sc->sc_pc, sc->sc_tag, GSCPM_ACPIBASE); if (PCI_MAPREG_IO_ADDR(acpibase) == 0 || bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(acpibase), GSCPM_ACPISIZE, 0, &sc->sc_acpi_ioh)) { printf(": failed to map ACPI registers\n"); return; } printf("\n"); /* Hook into the kern_tc */ gscpm_timecounter.tc_priv = sc; tc_init(&gscpm_timecounter); /* XXX: disabled due to unresolved yet hardware errata */ #if 0 /* Hook into the hw.setperf sysctl */ gscpm_cookie = sc; cpu_setperf = gscpm_setperf; #endif } u_int gscpm_get_timecount(struct timecounter *tc) { struct gscpm_softc *sc = tc->tc_priv; return (bus_space_read_4(sc->sc_iot, sc->sc_acpi_ioh, GSCPM_PM_TMR)); } #if 0 void gscpm_setperf(int level) { struct gscpm_softc *sc = gscpm_cookie; int i; u_int32_t pctl; pctl = bus_space_read_4(sc->sc_iot, sc->sc_acpi_ioh, GSCPM_P_CNT); if (level == 100) { /* 100 is a maximum perfomance, disable throttling */ pctl &= ~GSCPM_P_CNT_THTEN; } else { for (i = 0; i < GSCPM_THT_LEVELS; i++) if (level >= gscpm_tht[i].level) break; pctl = (0xf0 | GSCPM_P_CNT_THTEN | GSCPM_P_CNT_CLK(gscpm_tht[i].value)); } /* Update processor control register */ bus_space_write_4(sc->sc_iot, sc->sc_acpi_ioh, GSCPM_P_CNT, pctl); } #endif
/* * Copyright (c) 2015, Rémi Bazin <bazin.remi@gmail.com> * All rights reserved. * See LICENSE for licensing details. * * Source inspired by the qt-fuse example by qknight (https://github.com/qknight/qt-fuse-example) */ #ifndef __QDAEMON_H__ #define __QDAEMON_H__ #include <QSocketNotifier> class QDaemon : public QObject { Q_OBJECT public: QDaemon(QObject *parent = 0); ~QDaemon(); signals: /* Qt signaling */ void sigINT(); void sigHUP(); void sigTERM(); private: /* Unix signal handlers */ static void intSignalHandler(int); static void hupSignalHandler(int); static void termSignalHandler(int); private slots: /* Qt signal handlers */ void handleSigInt(); void handleSigHup(); void handleSigTerm(); private: static int sigintFd[2]; static int sighupFd[2]; static int sigtermFd[2]; static volatile QDaemon *_instance; static struct sigaction oldSigInt, oldSigHup, oldSigTerm; static bool pairsDone; private: QSocketNotifier *snInt; QSocketNotifier *snHup; QSocketNotifier *snTerm; }; #endif /* Not __QDAEMON_H__ */
/* $OpenBSD: cache_sh4.h,v 1.3 2010/01/01 13:18:37 miod Exp $ */ /* $NetBSD: cache_sh4.h,v 1.11 2006/03/04 01:55:03 uwe Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by UCHIYAMA Yasushi. * * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. */ /* * SH4: SH7750 SH7750S SH7750R SH7751 SH7751R */ #ifndef _SH_CACHE_SH4_H_ #define _SH_CACHE_SH4_H_ #include <sh/devreg.h> #ifdef _KERNEL #define SH4_ICACHE_SIZE 8192 #define SH4_DCACHE_SIZE 16384 #define SH4_EMODE_ICACHE_SIZE 16384 #define SH4_EMODE_DCACHE_SIZE 32768 #define SH4_CACHE_LINESZ 32 #define SH4_CCR 0xff00001c #define SH4_CCR_EMODE 0x80000000 #define SH4_CCR_IIX 0x00008000 #define SH4_CCR_ICI 0x00000800 #define SH4_CCR_ICE 0x00000100 #define SH4_CCR_OIX 0x00000080 #define SH4_CCR_ORA 0x00000020 #define SH4_CCR_OCI 0x00000008 #define SH4_CCR_CB 0x00000004 #define SH4_CCR_WT 0x00000002 #define SH4_CCR_OCE 0x00000001 #define SH4_QACR0 0xff000038 #define SH4_QACR1 0xff00003c #define SH4_QACR_AREA_SHIFT 2 #define SH4_QACR_AREA_MASK 0x0000001c /* I-cache address/data array */ #define SH4_CCIA 0xf0000000 /* address specification */ #define CCIA_A 0x00000008 /* associate bit */ #define CCIA_ENTRY_SHIFT 5 /* line size 32B */ #define CCIA_ENTRY_MASK 0x00001fe0 /* [12:5] 256-entries */ /* data specification */ #define CCIA_V 0x00000001 #define CCIA_TAGADDR_MASK 0xfffffc00 /* [31:10] */ #define SH4_CCID 0xf1000000 /* address specification */ #define CCID_L_SHIFT 2 #define CCID_L_MASK 0x1c /* line-size is 32B */ #define CCID_ENTRY_MASK 0x00001fe0 /* [12:5] 256-entries */ /* D-cache address/data array */ #define SH4_CCDA 0xf4000000 /* address specification */ #define CCDA_A 0x00000008 /* associate bit */ #define CCDA_ENTRY_SHIFT 5 /* line size 32B */ #define CCDA_ENTRY_MASK 0x00003fe0 /* [13:5] 512-entries */ /* data specification */ #define CCDA_V 0x00000001 #define CCDA_U 0x00000002 #define CCDA_TAGADDR_MASK 0xfffffc00 /* [31:10] */ #define SH4_CCDD 0xf5000000 /* Store Queue */ #define SH4_SQ 0xe0000000 #ifndef _LOCORE extern void sh4_cache_config(void); #endif #endif /* _KERNEL */ #endif /* !_SH_CACHE_SH4_H_ */
//////////////////////////////////////////////////////////////////////////////// // SgCamera.h #pragma once #include "BtTypes.h" #include "MtVector3.h" // Class Declaration class SgCamera { public: // Accessors virtual BtFloat FarPlane() const = 0; virtual BtFloat NearPlane() const = 0; virtual BtFloat FieldOfView() const = 0; };
/******************************************************************************* * File Name: servo_control.c * * Description: generate required PWM signals to control the turning servo * * History: * Author Date Description * -------------------------------------------------------------------------- * Shizhang Yin 01/13/2017 Created * * Copyright (c) UTMDA, 2017 * Licensed under the MIT License. See LICENSE file in the project root for full * license information. *******************************************************************************/ /* Includes ------------------------------------------------------------------*/ #include "servo_control.h" /** * @brief Start the turning servo * @param htim: pointer to a TIM_HandleTypeDef structure that contains * the configuration information for TIM module. * @retval None **/ void Servo_Start(TIM_HandleTypeDef * htim) { HAL_TIM_PWM_Start(htim, TIM_CHANNEL_1); __HAL_TIM_SET_COMPARE(htim, TIM_CHANNEL_1, SERVO_PWM_NEUTRAL_DUTY_CYCLE); } /** * @brief Stop the turning servo * @param htim: pointer to a TIM_HandleTypeDef structure that contains * the configuration information for TIM module. * @retval None **/ void Servo_Stop(TIM_HandleTypeDef * htim) { HAL_TIM_PWM_Stop(htim, TIM_CHANNEL_1); }
// // Uuid.h // // Copyright (c) 2013-2017 Tomas Palazuelos // // Distributed under the MIT Software License. (See accompanying file LICENSE.md) // #ifndef UUID_H #define UUID_H #include <orion/Config.h> #include <memory> #include <string> namespace orion { /// Universally Unique Identifier (uuid). /// An uuid provides a unique designation for objects such as interfaces /// and client objects. /// /// Implementation note: /// On win32 platform the RPC API is used to create uuids. /// On linux the libuuid is used. /// class API_EXPORT Uuid { public: Uuid(); Uuid(const Uuid& rhs); Uuid(Uuid&& rhs) noexcept; explicit Uuid(const std::string& value); ~Uuid(); bool is_null() const; Uuid& operator=(const Uuid& rhs); Uuid& operator=(Uuid&& rhs) noexcept; bool operator==(const Uuid& rhs) const; bool operator!=(const Uuid& rhs) const; friend API_EXPORT std::string to_string(const Uuid& id); private: struct Private; std::unique_ptr<Private> _impl; }; API_EXPORT std::string to_string(const Uuid& id); } #endif /* UUID_H */
/* ** Copyright 2014-2015 Robert Fratto. See the LICENSE.txt file at the top-level ** directory of this distribution. ** ** Licensed under the MIT license <http://opensource.org/licenses/MIT>. This file ** may not be copied, modified, or distributed except according to those terms. */ #ifndef __ORANGE_TEST_H__ #define __ORANGE_TEST_H__ #include <orange/run.h> #include <helper/args.h> #include <helper/link.h> #include "file.h" #include "error.h" /** * Run tests on a certain path. This will run the test for each file in the directory, * and recurse to children directories. If the directory contains an ORANGE_SETTINGS * file, it will run it as a project. */ std::vector<RunResult> runTest(path p); /** * Gets the total test time in seconds. * * @return The total test time, in seconds. */ float totalTestTime(std::vector<RunResult> results); /** * Gets the average test time in seconds. * * @return The average time between tests, in seconds. */ float avgTestTime(std::vector<RunResult> results); /** * Gets the number of passed tests. * * @return The number of passed tests. */ int numPassedTests(std::vector<RunResult> results); /** * Gets the number of failed tests. * * @return The number of failed tests. */ int numFailedTests(std::vector<RunResult> results); /** * Gets a string containing information about the longest * test. * * @return A string with information about the longest test. */ std::string getLongestTest(std::vector<RunResult> results); /** * Prints out stats from the test run, including which * tests have failed. */ void showTestResults(std::vector<RunResult> results); /** * Invoked from the command line parser, this will test a file or project as * invoked. * * @param test The test state from the command line parser. */ void doTestCommand(cOptionsState test); #endif
// ====================================================================== /*! * \brief Selection utilities */ // ---------------------------------------------------------------------- #include "AttributeSelection.h" #include <boost/optional.hpp> #include <vector> namespace SmartMet { namespace Plugin { namespace Dali { namespace Select { boost::optional<AttributeSelection> attribute(const std::vector<AttributeSelection> theSelection, double theValue); } // namespace Select } // namespace Dali } // namespace Plugin } // namespace SmartMet
#include "dynamicArray.h" #include <stdio.h> #include <time.h> #include <stdlib.h> /* VISUAL STUDIO (VS) USERS: COMMENT OUT THE LINE BELOW TO EXCLUDE THE MEMORY TEST CODE. */ #define MEMORY_TEST_INCLUDED #ifdef MEMORY_TEST_INCLUDED /* This header is needed for memory usage calculation. */ #include <sys/resource.h> /* Function to get current memory usage in KB (Max Resident Set Size) */ long getMemoryUsage() { int who = RUSAGE_SELF; struct rusage usage; int ret; ret = getrusage(who, &usage); return usage.ru_maxrss; } #endif /*Function to get number of milliseconds elapsed since program started execution*/ double getMilliseconds() { return 1000.0 * clock() / CLOCKS_PER_SEC; } int main(int argc, char* argv[]) { DynArr* b; int n, i; double t1, t2; #ifdef MEMORY_TEST_INCLUDED /* variables to hold memory used before and after creating DynArr */ long m1, m2; /* memory used BEFORE creating DynArr */ m1 = getMemoryUsage(); #endif if( argc != 2 ) return 0; b = createDynArr(1000); n = atoi(argv[1]); /*number of elements to add*/ for( i = 0 ; i < n; i++) { addDynArr(b, (TYPE)i); /*Add elements*/ } #ifdef MEMORY_TEST_INCLUDED /* memory used AFTER creating DynArr */ m2 = getMemoryUsage(); printf("Memory used by DynArr: %ld KB \n", m2-m1); #endif t1 = getMilliseconds();/*Time before contains()*/ for(i=0; i<n; i++) { containsDynArr(b, i); } t2 = getMilliseconds();/*Time after contains()*/ printf("Time for running contains() on %d elements: %g ms\n", n, t2-t1); /* delete DynArr */ deleteDynArr(b); return 0; }
// // ZSUtils.h // ZSPhotoBrowser // // Created by zuoshen on 2017/8/14. // Copyright © 2017年 zuoshen. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface ZSUtils : NSObject +(UIViewController *)getCurrentVC; @end
#pragma once #include "common.h" SQInteger gla_mod_util_date_augment( HSQUIRRELVM vm);
// // HeroDefaultAnimator.h // Hero-ObjectiveC // // Created by luca.li on 2017/1/24. // Copyright © 2017年 luca. All rights reserved. // #import <UIKit/UIKit.h> #import "HeroContext.h" #import "Hero.h" @interface HeroDefaultAnimator : NSObject <HeroAnimator> @property (nonatomic, strong, readonly) HeroContext *context; @end
#import <UIKit/UIKit.h> /// iupCocoaTouch version of iOS indeterminate progressView. @interface ICT_IndeterminateProgressView : UIView @property(nonatomic, strong, nullable) UIColor* progressTintColor; @property(nonatomic, strong, nullable) UIColor* trackTintColor; @property(nonatomic, getter=isAnimating) BOOL animating; @property(nonatomic) BOOL hidesWhenStopped; - (void)startAnimating; - (void)stopAnimating; @end
#ifndef __My__TextBox__ #define __My__TextBox__ #include "ui/UIWidget.h" #include "cocos2d.h" #include <string> class TextBox : public cocos2d::Sprite { public: TextBox(); static TextBox *create(const std::string &bg); bool addText(const std::string &txt); bool setText(const std::string &txt); void setSize(const float width,const float height); protected: bool initWithBackgroundImg(const std::string bg); protected: cocos2d::Label *txt_; }; #endif /* defined(__My__TextBox__) */
// This file is part of HOGclassifier. // HOGclassifier 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. // HOGclassifier 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 HOGclassifier. If not, see <http://www.gnu.org/licenses/>. #include <iostream> #include <vector> #include <string> #include <algorithm> #include "logger.h" class Utils { public: Utils(); ~Utils(); static double getMedian(std::vector<double> vals) { std::sort(vals.begin(), vals.end()); double median = -1; int size = vals.size(); if (size <= 0) return -1; int mult = 1; int denom = 2; if (mult * size % denom == 0) { median = (vals[mult * size / denom - 1] + vals[mult * size / denom]) / denom; } else { median = vals[mult * size / denom]; } return median; } static std::string parseImageName(const std::string &line) { int first_pos, end_pos; end_pos = line.length(); first_pos = line.find_last_of('/') + 1; return line.substr(first_pos, end_pos - first_pos); } static std::vector<std::string> splitString(std::string line, const std::string &delimiter) { size_t pos = 0; size_t curr = 0; std::vector<std::string> result; std::string token; while ((pos = line.find(delimiter)) != std::string::npos) { token = line.substr(0, pos); line.erase(0, pos + delimiter.length()); result.push_back(token); } result.push_back(line); return result; } static void analyzeCmdParams( const int argc, char const *argv[], std::string &folder, std::string &dateOfData) { if (argc < 2) { Logger::instance()->logError("CmdLineParser", Logger::NO_PARAMETER); // std::cerr<<"ERROR: There should be one parameter - folder with data"<<std::endl; exit(1); } folder = argv[1]; if (folder[folder.length() - 1] == '/') { folder = folder.substr(0, folder.length() - 1); } dateOfData = folder.substr(folder.find_last_of('/') + 1); dateOfData = dateOfData.substr(0, dateOfData.find("_____")); Logger::instance()->logInfo("The folder is", folder); Logger::instance()->logInfo("The date of data is", dateOfData); } };
#ifndef CVSTEREOGCSTATE_NAME #include "opencv2/opencv.hpp" #include "opencv2/legacy/legacy.hpp" #include "luacvaux.h" #include "CvMat.h" #define CVSTEREOGCSTATE_NAME "CvStereoGCState" #define checkCvStereoGCState(L,i) luacv_checkObject<CvStereoGCState>(L,i,CVSTEREOGCSTATE_NAME) #define pushCvStereoGCState(L,data) luacv_pushObject<CvStereoGCState>(L,data,CVSTEREOGCSTATE_NAME,false) extern const struct luaL_Reg CvStereoGCState_m[]; #endif
#ifndef TESTTESTSPARSEPCA_H #define TESTTESTSPARSEPCA_H #include "ForDebug.h" #include <iostream> #include "randgen.h" #include "Manifold.h" #include "Problem.h" #include "SolversLS.h" #include <ctime> #include "EucVariable.h" #include "EucVector.h" #include "EucFrechetMean.h" #include "EucQuadratic.h" #include "StieBrockett.h" #include "StieVector.h" #include "StieVariable.h" #include "Stiefel.h" #include <ObliqueTestSparsePCA.h> #include <Oblique.h> #include <ObliqueVariable.h> #include <ObliqueVector.h> #include "RSD.h" #include "RNewton.h" #include "RCG.h" #include "RBroydenFamily.h" #include "RWRBFGS.h" #include "RBFGS.h" #include "LRBFGS.h" #include "SolversTR.h" #include "RTRSD.h" #include "RTRNewton.h" #include "RTRSR1.h" #include "LRTRSR1.h" #include "def.h" integer GetNumBetweenC1andC2(const Element *x, double c1, double c2); void testTestSparsePCA(double *B, double *Dsq, integer p, integer n, integer r, double epsilon, double mu, double *X = nullptr, double *Xopt = nullptr); #endif // end of TESTTESTSPARSEPCA_H
/* ** Copyright (c) 2014-2016 uboss.org All rights Reserved. ** uBoss - A lightweight micro service framework ** ** uBoss Lua Profile Library ** ** Dali Wang<dali@uboss.org> ** See Copyright Notice in uboss.h */ #include <stdio.h> #include <lua.h> #include <lauxlib.h> #include <time.h> #if defined(__APPLE__) #include <mach/task.h> #include <mach/mach.h> #endif #define NANOSEC 1000000000 #define MICROSEC 1000000 // #define DEBUG_LOG // 获得时间 static double get_time() { #if !defined(__APPLE__) struct timespec ti; clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ti); int sec = ti.tv_sec & 0xffff; int nsec = ti.tv_nsec; return (double)sec + (double)nsec / NANOSEC; #else struct task_thread_times_info aTaskInfo; mach_msg_type_number_t aTaskInfoCount = TASK_THREAD_TIMES_INFO_COUNT; if (KERN_SUCCESS != task_info(mach_task_self(), TASK_THREAD_TIMES_INFO, (task_info_t )&aTaskInfo, &aTaskInfoCount)) { return 0; } int sec = aTaskInfo.user_time.seconds & 0xffff; int msec = aTaskInfo.user_time.microseconds; return (double)sec + (double)msec / MICROSEC; #endif } // 比较时间 static inline double diff_time(double start) { double now = get_time(); if (now < start) { return now + 0x10000 - start; } else { return now - start; } } // 开始 static int lstart(lua_State *L) { if (lua_type(L,1) == LUA_TTHREAD) { lua_settop(L,1); } else { lua_pushthread(L); } lua_rawget(L, lua_upvalueindex(2)); if (!lua_isnil(L, -1)) { return luaL_error(L, "Thread %p start profile more than once", lua_topointer(L, 1)); } lua_pushthread(L); lua_pushnumber(L, 0); lua_rawset(L, lua_upvalueindex(2)); lua_pushthread(L); double ti = get_time(); #ifdef DEBUG_LOG fprintf(stderr, "PROFILE [%p] start\n", L); #endif lua_pushnumber(L, ti); lua_rawset(L, lua_upvalueindex(1)); return 0; } // 停止 static int lstop(lua_State *L) { if (lua_type(L,1) == LUA_TTHREAD) { lua_settop(L,1); } else { lua_pushthread(L); } lua_rawget(L, lua_upvalueindex(1)); if (lua_type(L, -1) != LUA_TNUMBER) { return luaL_error(L, "Call profile.start() before profile.stop()"); } double ti = diff_time(lua_tonumber(L, -1)); lua_pushthread(L); lua_rawget(L, lua_upvalueindex(2)); double total_time = lua_tonumber(L, -1); lua_pushthread(L); lua_pushnil(L); lua_rawset(L, lua_upvalueindex(1)); lua_pushthread(L); lua_pushnil(L); lua_rawset(L, lua_upvalueindex(2)); total_time += ti; lua_pushnumber(L, total_time); #ifdef DEBUG_LOG fprintf(stderr, "PROFILE [%p] stop (%lf / %lf)\n", L, ti, total_time); #endif return 1; } // 恢复定时 static int timing_resume(lua_State *L) { #ifdef DEBUG_LOG lua_State *from = lua_tothread(L, -1); #endif lua_rawget(L, lua_upvalueindex(2)); if (lua_isnil(L, -1)) { // check total time lua_pop(L,1); } else { lua_pop(L,1); lua_pushvalue(L,1); double ti = get_time(); #ifdef DEBUG_LOG fprintf(stderr, "PROFILE [%p] resume\n", from); #endif lua_pushnumber(L, ti); lua_rawset(L, lua_upvalueindex(1)); // set start time } lua_CFunction co_resume = lua_tocfunction(L, lua_upvalueindex(3)); return co_resume(L); } // 恢复 static int lresume(lua_State *L) { lua_pushvalue(L,1); return timing_resume(L); } // 恢复协程 static int lresume_co(lua_State *L) { luaL_checktype(L, 2, LUA_TTHREAD); lua_rotate(L, 2, -1); return timing_resume(L); } static int timing_yield(lua_State *L) { #ifdef DEBUG_LOG lua_State *from = lua_tothread(L, -1); #endif lua_rawget(L, lua_upvalueindex(2)); // check total time if (lua_isnil(L, -1)) { lua_pop(L,1); } else { double ti = lua_tonumber(L, -1); lua_pop(L,1); lua_pushthread(L); lua_rawget(L, lua_upvalueindex(1)); double starttime = lua_tonumber(L, -1); lua_pop(L,1); double diff = diff_time(starttime); ti += diff; #ifdef DEBUG_LOG fprintf(stderr, "PROFILE [%p] yield (%lf/%lf)\n", from, diff, ti); #endif lua_pushthread(L); lua_pushnumber(L, ti); lua_rawset(L, lua_upvalueindex(2)); } lua_CFunction co_yield = lua_tocfunction(L, lua_upvalueindex(3)); return co_yield(L); } static int lyield(lua_State *L) { lua_pushthread(L); return timing_yield(L); } static int lyield_co(lua_State *L) { luaL_checktype(L, 1, LUA_TTHREAD); lua_rotate(L, 1, -1); return timing_yield(L); } int luaopen_profile(lua_State *L) { luaL_checkversion(L); luaL_Reg l[] = { { "start", lstart }, // 开始 { "stop", lstop }, // 停止 { "resume", lresume }, // 恢复 { "yield", lyield }, // { "resume_co", lresume_co }, { "yield_co", lyield_co }, { NULL, NULL }, }; luaL_newlibtable(L,l); lua_newtable(L); // table thread->start time lua_newtable(L); // table thread->total time lua_newtable(L); // weak table lua_pushliteral(L, "kv"); lua_setfield(L, -2, "__mode"); lua_pushvalue(L, -1); lua_setmetatable(L, -3); lua_setmetatable(L, -3); lua_pushnil(L); // cfunction (coroutine.resume or coroutine.yield) luaL_setfuncs(L,l,3); int libtable = lua_gettop(L); lua_getglobal(L, "coroutine"); lua_getfield(L, -1, "resume"); lua_CFunction co_resume = lua_tocfunction(L, -1); if (co_resume == NULL) return luaL_error(L, "Can't get coroutine.resume"); lua_pop(L,1); lua_getfield(L, libtable, "resume"); lua_pushcfunction(L, co_resume); lua_setupvalue(L, -2, 3); lua_pop(L,1); lua_getfield(L, libtable, "resume_co"); lua_pushcfunction(L, co_resume); lua_setupvalue(L, -2, 3); lua_pop(L,1); lua_getfield(L, -1, "yield"); lua_CFunction co_yield = lua_tocfunction(L, -1); if (co_yield == NULL) return luaL_error(L, "Can't get coroutine.yield"); lua_pop(L,1); lua_getfield(L, libtable, "yield"); lua_pushcfunction(L, co_yield); lua_setupvalue(L, -2, 3); lua_pop(L,1); lua_getfield(L, libtable, "yield_co"); lua_pushcfunction(L, co_yield); lua_setupvalue(L, -2, 3); lua_pop(L,1); lua_settop(L, libtable); return 1; }
#pragma once #include "CoreMinimal.h" #include "Kismet/BlueprintFunctionLibrary.h" #include "GameFramework/Actor.h" #include "Templates/SubclassOf.h" #include "RTSCollisionLibrary.generated.h" class UObject; class UShapeComponent; /** * Utility functions for calculating actor collisions. */ UCLASS() class REALTIMESTRATEGY_API URTSCollisionLibrary : public UBlueprintFunctionLibrary { GENERATED_BODY() public: /** Gets the distance between the two specified actors, optionally subtracting their collision sizes. */ UFUNCTION(BlueprintPure, Category = "RTS") static float GetActorDistance(AActor* First, AActor* Second, bool bConsiderCollisionSize); /** Gets the approximated collision size of actors of the specified class. */ UFUNCTION(BlueprintPure, Category = "RTS") static float GetCollisionSize(TSubclassOf<AActor> ActorClass); /** Gets the approximated collision height of actors of the specified class. */ UFUNCTION(BlueprintPure, Category = "RTS") static float GetCollisionHeight(TSubclassOf<AActor> ActorClass); /** Gets the approximated collision size of the specified actor. */ UFUNCTION(BlueprintPure, Category = "RTS") static float GetActorCollisionSize(AActor* Actor); /** Gets the approximated collision height of the specified actor. */ UFUNCTION(BlueprintPure, Category = "RTS") static float GetActorCollisionHeight(AActor* Actor); /** Gets the approximated collision size of the specified shape. */ UFUNCTION(BlueprintPure, Category = "RTS") static float GetShapeCollisionSize(UShapeComponent* ShapeComponent); /** Gets the approximated collision height of the specified shape. */ UFUNCTION(BlueprintPure, Category = "RTS") static float GetShapeCollisionHeight(UShapeComponent* ShapeComponent); /** Casts a ray to determine the z coordinate of the specified location on ground level. */ UFUNCTION(BlueprintPure, Category = "RTS", meta = (WorldContext = "WorldContextObject")) static FVector GetGroundLocation(UObject* WorldContextObject, FVector Location); /** * Checks whether the specified actor can be placed at the passed location. */ UFUNCTION(BlueprintPure, Category = "RTS") static bool IsSuitableLocationForActor(UWorld* World, TSubclassOf<AActor> ActorClass, const FVector& Location); };
static Scalar powu_(Scalar x, unsigned i) { Scalar y = 1; for (; i; i >>= 1) { if (i & 1) y *= x; x *= x; } return y; } static Scalar powi_(Scalar x, int i) { if (i < 0) return powu_(1 / x, -i); return powu_(x, i); }
// // CommonCrypto-Bridging-Header.h // two-half-password // // Created by Xinhong LIU on 13/6/15. // Copyright © 2015 ParseCool. All rights reserved. // #ifndef Bridging_Header_h #define Bridging_Header_h #import <CommonCrypto/CommonCrypto.h> #import "MBProgressHUD.h" #endif /* Bridging_Header_h */
// // ViewController.h // XTAlertDemo // // Created by Mac on 16/9/3. // Copyright © 2016年 夏天然后. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
#if !defined(__util_h__) #define __util_h__ #include <stdint.h> #if defined(_MEMPROF_DEBUG) #include <stdio.h> #define dbg_printf(...) do {\ fprintf(stderr, "%s:%d ", __FILE__, __LINE__);\ fprintf(stderr, __VA_ARGS__);\ } while (0) #else #define dbg_printf(...) #endif #define ASSERT_ON_COMPILE(pred) \ switch(0){case 0:case pred:;} struct memprof_config { void *gc_sweep; size_t gc_sweep_size; void *finalize_list; size_t finalize_list_size; void *rb_gc_force_recycle; size_t rb_gc_force_recycle_size; void *freelist; void *classname; void *add_freelist; void *rb_mark_table_add_filename; void *bm_mark; void *blk_free; void *thread_mark; void *heaps; void *heaps_used; void *finalizer_table; size_t sizeof_RVALUE; size_t sizeof_heaps_slot; size_t offset_heaps_slot_limit; size_t offset_heaps_slot_slot; size_t offset_BLOCK_body; size_t offset_BLOCK_var; size_t offset_BLOCK_cref; size_t offset_BLOCK_prev; size_t offset_BLOCK_self; size_t offset_BLOCK_klass; size_t offset_BLOCK_wrapper; size_t offset_BLOCK_orig_thread; size_t offset_BLOCK_block_obj; size_t offset_BLOCK_scope; size_t offset_BLOCK_dyna_vars; size_t offset_METHOD_klass; size_t offset_METHOD_rklass; size_t offset_METHOD_recv; size_t offset_METHOD_id; size_t offset_METHOD_oid; size_t offset_METHOD_body; size_t pagesize; }; /* This is the CRC function used by GNU. Stripped executables may contain a * section .gnu_debuglink which holds the name of an elf object with debug * information and a checksum. */ unsigned long gnu_debuglink_crc32 (unsigned long crc, unsigned char *buf, size_t len); /* Copy of timeofday() implementation inside ruby 1.8, used w/ thread state */ double timeofday(); /* Use this function for time tracking. It will (interally) try to use an * appropriately granual timing function. */ uint64_t timeofday_ms(); #define TVAL_TO_INT64(tv) ((int64_t)tv.tv_sec*1e3 + (int64_t)tv.tv_usec*1e-3) #endif
#ifndef LANGUAGETEXTS_H #define LANGUAGETEXTS_H #include "webframework-qt_global.h" #include <Document.h> namespace web { namespace internationalisation { class LanguageTextsPrivate; class WEBFRAMEWORKQTSHARED_EXPORT LanguageTexts { public: LanguageTexts(arangodb::Document *doc); ~LanguageTexts(); QString text(const QString &key) const; arangodb::Document* document() const; protected: LanguageTextsPrivate *d_ptr; LanguageTexts(LanguageTextsPrivate *d, arangodb::Document *doc); private: Q_DECLARE_PRIVATE(LanguageTexts) }; } } #endif // LANGUAGETEXTS_H
/* * Copyright (c) 2015 Kaprica Security, 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 <stdio.h> #include <libcgc.h> #include "hi_lo_game.h" #define UPPER_RAND_MAX 0xFFFF static const int *secret = (const int *)0x4347C000; static int idx = 0; static int set_bits_high(unsigned int num) { int bits = 0; while (num != 0) { bits++; num >>= 1; } while(bits) { num <<= 1; num |= 1; bits--; } return num; } static int get_random(unsigned int *upper_limit) { idx %= 1024; int max_input = 256; int upper = UPPER_RAND_MAX + 1; unsigned int winner = secret[idx++]; char *input = malloc(max_input); #ifdef PATCHED_1 while (upper < 0 || upper > UPPER_RAND_MAX) { #else while (upper > UPPER_RAND_MAX) { #endif printf("Enter max value (Default=%d): ", UPPER_RAND_MAX); if (freaduntil(input, max_input, '\n', stdin) == -1) continue; upper = strtol(input, NULL, 10); upper = set_bits_high(upper); } if (upper == 0) { upper = UPPER_RAND_MAX; } else { printf("We've changed the max value to %d.\n", upper); printf("Keep in mind only the games using the default max value are scored.\n"); } if (winner > upper) winner &= upper; free(input); *upper_limit = upper; return winner; } int play_hi_lo() { int max_input = 256; int guess = 0; unsigned int upper_limit; int winning_number = get_random(&upper_limit); unsigned int guesses_left = log2f(upper_limit) + 1; char *input = malloc(max_input); while (guesses_left) { printf("Guess the number [%d guesses left]: ", guesses_left); if (freaduntil(input, max_input, '\n', stdin) == -1) continue; guess = strtol(input, NULL, 10); if (guess < winning_number) { printf("Too Low\n"); } else if (guess > winning_number) { printf("Too High\n"); } else { printf("You won!\n"); free(input); if (upper_limit == UPPER_RAND_MAX) return 1000; else return 0; } guesses_left--; } printf("Sorry, you lost. Try practicing with a lower max value.\n"); //printf("The number was: %d\n", winning_number); free(input); return 0; }
/* * NPPGeoserver.h * Copyright (c) 2011-2015 db-in. More information at: http://db-in.com/nippur * * 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. */ #import "NippurCore.h" #import "NPPModelGeolocationVO.h" #import "NPPModelGeoregionVO.h" #import "NPPModelAddressVO.h" #import <CoreLocation/CoreLocation.h> typedef void (^nppBlockGeoserver)(NPP_ARC_UNSAFE NSArray *items, NSError *error); @protocol NPPGeoserver <NSObject> @required // Places routine. Returns NPPModelAddressVO as array items. + (void) placeWithRegion:(NPPModelGeoregionVO *)region completion:(nppBlockGeoserver)block; // Forward Geocode routine. Returns NPPModelAddressVO as array items. + (void) addressWithRegion:(NPPModelGeoregionVO *)region completion:(nppBlockGeoserver)block; // Reverse Geocode routine. Returns NPPModelAddressVO as array items. + (void) addressWithGeolocation:(NPPModelGeolocationVO *)geolocation completion:(nppBlockGeoserver)block; // Routes routine. Returns NPPModelAddressVO as array items. + (void) routeFrom:(NPPModelGeolocationVO *)from to:(NPPModelGeolocationVO *)to completion:(nppBlockGeoserver)block; // Cancel all the on going geolocation routines. + (void) cancelScheduledAddresses; @end
// Copyright 2017 ibelie, Chen Jie, Joungtao. All rights reserved. // Use of this source code is governed by The MIT License // that can be found in the LICENSE file. #include "Python.h" #include "typy.h" extern void init_typyd(void); int main() { Py_SetProgramName("testTypy"); Py_Initialize(); init_typyd(); PyRun_SimpleString( "import sys\n" "import os\n" "os.chdir('../..')\n" "sys.path.append('E:/test/typy')\n" "sys.path.append('E:/test/typy/test')\n" "sys.path.append('C:/Users/joung/Documents/project/typy')\n" "sys.path.append('C:/Users/joung/Documents/project/typy/test')\n" "sys.path.append('/home/joungtao/program/typy')\n" "sys.path.append('/home/joungtao/program/typy/test')\n" "sys.path.append('/home/joungtao/typy')\n" "sys.path.append('/home/joungtao/typy/test')\n" "import dict_debug\n" "dict_debug.test_dict()\n" ); Py_Finalize(); getchar(); return 0; }
// // ViewController.h // ZQLoopScrollView // // Created by 庄琦 on 16/2/18. // Copyright © 2016年 Seven. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
#ifdef __OBJC__ #import <UIKit/UIKit.h> #endif FOUNDATION_EXPORT double Pods_ZLSwipeableViewSwiftDemoTestsVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_ZLSwipeableViewSwiftDemoTestsVersionString[];
// // Copyright (c) 2015 Datasnapio. All rights reserved. // #import <Foundation/Foundation.h> // Apple #import <CoreLocation/CoreLocation.h> @interface DSIOLocationMgr : NSObject <CLLocationManagerDelegate> /** * Set the accuracy of the location manager. */ - (void)setLocationAccuracyBestDistanceFilterNone; - (NSArray *)getLocation; - (NSMutableDictionary *)getGeoPosition; @end
// // VCRCassetteTests.h // // Copyright (c) 2012 Dustin Barker // // 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. #import <SenTestingKit/SenTestingKit.h> @interface VCRCassetteTests : SenTestCase @end
//////////////////////////////////////////////////////////////////////////////// // GUIButton.h // Furiosity // // Created by Bojan Endrovski on 9/27/13. // Copyright (c) 2013 Bojan Endrovski. All rights reserved. //////////////////////////////////////////////////////////////////////////////// #pragma once #include <functional> // Local #include "GUIElement.h" #include "SoundResource.h" namespace Furiosity { /// /// Button - the single most clicked UI element in a game /// class GUIButton : public GUIElement { protected: // Store event function std::function<void(void)> event; // Store event function that provides the toggle data too std::function<void(bool)> toggleEvent; // A texutre for the button Texture* texture; // The button connects Touch* touch; // SoundResource* sound; Sound* sound; bool pressed; Vector2 texOffset; bool isToggle; bool toggled; /// Protect from dumb people float cooldownTime; /// Protect from dumb people float cooldown; /// Protect from clumsy people float tolerance; public: /// Creates a new button with size and path to the texutre /// /// @param origin The position of the button in the paren container /// @param size The size of the button in GUI units /// @param texutrename The texture to be used. For normal buttons this /// is the a two grid, for toggle buttons a four grid. /// Empty name will not render the buttons at all. /// @param isToggle Wheter this a statefull (toggle) button. Default is false. /// @param mipmap Should the texture be mipmap-ed. Default is false. GUIButton(Vector2 origin, Vector2 size, const string& texutrename, bool isToggle = false, bool mipmap = false); /// Dtor virtual ~GUIButton(); /// Update button state virtual void Update(float dt) override; /// Handle a touch virtual void HandleTouch(Touch* touch) override; /// Needs to drop few things when set do dissabled virtual void Hide() override; /// The texture for the button can be changed usig this method virtual void SetTexture(const string& texutrename, bool mipmap = false); /// Set event for callback void SetEvent(std::function<void(void)> e) { event = e; } /// Set event for callback void SetEvent(std::function<void(bool)> e) { toggleEvent = e; } /// Set the sound to be played when clicked void SetSound(const string& soundname); /// Set toggled void SetToggled(bool tg) { toggled = tg; } /// Is toggled, only valid when bool IsToggled() const { return toggled; } const float& Toleance() const { return tolerance; } void SetTolerance(float t) { tolerance = t; } const float& Cooldown() const { return cooldown; } void SetCooldown(float cd) { cooldownTime = cd; } const bool IsHeld() const { return touch != 0; } // Draw simple button virtual void Render(SpriteRender& rend) override; #ifdef DEBUG virtual void DebugDraw(DebugDraw2D& debugDraw) override; #endif }; /// /// Shrink Button - a lazy version of a button /// class GUIShrinkButton : public GUIButton { float minSize; float sizeFix; public: /// Creates a new button with size and a path to the texutre GUIShrinkButton(Furiosity::Vector2 origin, Furiosity::Vector2 size, const string& texutrename, float minSize = 0.9f, bool isToggle = false, bool mipmap = false); virtual ~GUIShrinkButton() {}; /// Draw shrink button virtual void Render(Furiosity::SpriteRender& rend); float SizeFix() const { return sizeFix; } void SetSizeFix(float f) { sizeFix = f; } }; }
// -*- C++ -*- //---------------------------------------------------------------------- // // William S. Klug // University of California Los Angeles // (C) 2009 All Rights Reserved // //---------------------------------------------------------------------- #if !defined(__PeriodicBox_h__) #define __PeriodicBox_h__ #include "VoomMath.h" #include "Node.h" using namespace std; using namespace voom; namespace voom { class PeriodicBox { public: PeriodicBox(double hx, double hy) { _h = hx, hy;} virtual void setSize(Vector2D & sz) { _h = sz; } virtual void setSize(double hx, double hy) { _h = hx, hy; } virtual void mapPoint(Vector2D & x) const { for(int i=0; i<2; i++) { x(i) = fmod( x(i) , _h(i) ); if( x(i) < 0.0 ) x(i) += _h(i); } return; } virtual void mapPointX(Vector2D & x) const { x(0) = fmod( x(0) , _h(0) ); if( x(0) < 0.0 ) x(0) += _h(0); return; } virtual void mapPointY(Vector2D & x) const { x(1) = fmod( x(1) , _h(1) ); if( x(1) < 0.0 ) x(1) += _h(1); return; } virtual void mapDistance(Vector2D & dx) const { for(int i=0; i<2; i++) { dx(i) = dx(i) - ( dx(i)>0.0 ? std::floor(dx(i)/_h(i)+0.5) : std::ceil(dx(i)/_h(i)-0.5))*_h(i); } return; } virtual bool inside(Vector2D & x) const { for(int i=0; i<2; i++) { if( x(i) < 0.0 || x(i) > _h(i) ) return(false); } return(true); } virtual void stretchX(double strtchFact) { _h[0] = strtchFact*_h[0]; } virtual void stretchY(double strtchFact) { _h[1] = strtchFact*_h[1]; } virtual void stretchXY(double strtchFact) { _h[0] = strtchFact*_h[0]; _h[1] = strtchFact*_h[1]; } virtual const Vector2D & size() const {return _h;} virtual void setShear(double shear) {;} virtual void setShearX(double shear) {;} virtual void setShearY(double shear) {;} protected: Vector2D _h; }; }; #endif //__PeriodicBox_h__
#ifndef ossimKwlNodeFormatter_HEADER #define ossimKwlNodeFormatter_HEADER #include <ossim/base/KwlNode.h> namespace ossim { class KwlNodeFormatter { public: class FormatHints { public: enum FormatFlags { FORMAT_HINTS_NO_OPTION_FLAGS = 0, FORMAT_HINTS_PRETTY_PRINT_FLAG = 1, FORMAT_HINTS_OUTPUT_DOCUMENT_HEADER_FLAG = 2, FORMAT_HINTS_UPCASE_PARENT_TAGS_FLAG = 4, FORMAT_HINTS_ALL = (FORMAT_HINTS_PRETTY_PRINT_FLAG | FORMAT_HINTS_OUTPUT_DOCUMENT_HEADER_FLAG | FORMAT_HINTS_UPCASE_PARENT_TAGS_FLAG) }; FormatHints(ossim_uint32 indent = 3, FormatFlags formatFlags = FORMAT_HINTS_NO_OPTION_FLAGS) : m_indent(indent), m_formatFlags(formatFlags) { } ossim_uint32 indent()const { return m_indent; } void setIndent(ossim_uint32 indent) { m_indent = indent; } bool prettyPrint() const { return m_formatFlags & FORMAT_HINTS_PRETTY_PRINT_FLAG; } bool outputDocumentHeader() const { return m_formatFlags & FORMAT_HINTS_OUTPUT_DOCUMENT_HEADER_FLAG; } bool upcaseParentTag() const { return m_formatFlags & FORMAT_HINTS_UPCASE_PARENT_TAGS_FLAG; } void setFormatFlags(FormatFlags flags) { m_formatFlags = flags;} FormatFlags getFormatFlags()const { return m_formatFlags;} protected: ossim_uint32 m_indent; FormatFlags m_formatFlags; }; KwlNodeFormatter(std::shared_ptr<KwlNode> kwlNode) : m_kwlNode(kwlNode) { } KwlNodeFormatter(const ossimKeywordlist &kwl) { m_kwlNode = KwlNode::createTree(kwl); } virtual void write(ossimString &result, const FormatHints &hints = FormatHints()) const; virtual void write(std::ostream &out, const FormatHints &hints = FormatHints()) const = 0; protected: std::shared_ptr<KwlNode> m_kwlNode; }; } #endif
#pragma once #include "util/url.h" #include <atomic> #include <functional> #include <mutex> #include <string> #include <unordered_map> #include <vector> namespace Tangram { // Handle for URL requests. // This is the handle which Platform uses to identify an UrlRequest. using UrlRequestHandle = uint64_t; // Result of a URL request. If the request could not be completed or if the // host returned an HTTP status code >= 400, a non-null error string will be // present. This error string is only valid in the scope of the UrlCallback // that provides the response. The content of the error string may be different // for each platform type. struct UrlResponse { std::vector<char> content; const char* error = nullptr; }; // Function type for receiving data from a URL request. using UrlCallback = std::function<void(UrlResponse&&)>; using FontSourceLoader = std::function<std::vector<char>()>; struct FontSourceHandle { FontSourceHandle() {} ~FontSourceHandle() {} explicit FontSourceHandle(Url path) : fontPath(path) { tag = FontPath; } explicit FontSourceHandle(std::string name) : fontName(name) { tag = FontName; } explicit FontSourceHandle(FontSourceLoader loader) : fontLoader(loader) { tag = FontLoader; } enum { FontPath, FontName, FontLoader, None } tag = None; Url fontPath; std::string fontName; FontSourceLoader fontLoader; bool isValid() const { return tag != None; } }; // Print a formatted message to the console // Uses printf syntax to write a string to stderr (or logcat, on Android) void logMsg(const char* fmt, ...); void initGLExtensions(); // Set the priority of the current thread. Priority is equivalent to pthread niceness void setCurrentThreadPriority(int priority); class Platform { public: Platform(); virtual ~Platform(); // Subclasses must call Platform::shutdown() when overriding shutdown virtual void shutdown(); // Request that a new frame be rendered by the windowing system virtual void requestRender() const = 0; // If called with 'true', the windowing system will re-draw frames continuously; // otherwise new frames will only be drawn when 'requestRender' is called. virtual void setContinuousRendering(bool _isContinuous); virtual bool isContinuousRendering() const; // Start retrieving data from a URL asynchronously. When the request is // finished, the callback _callback will be run with the data or error that // was retrieved from the URL _url. The callback may run on a different // thread than the original call to startUrlRequest. UrlRequestHandle startUrlRequest(Url _url, UrlCallback&& _callback); // Stop retrieving data from a URL that was previously requested. When a // request is canceled its callback will still be run, but the response // will have an error string and the data may not be complete. void cancelUrlRequest(UrlRequestHandle _request); virtual FontSourceHandle systemFont(const std::string& _name, const std::string& _weight, const std::string& _face) const; virtual std::vector<FontSourceHandle> systemFontFallbacksHandle() const; protected: // Platform implementation specific id for URL requests. This id is // interpreted differently for each platform type, so do not perform any // application logic with its value. // It's purpose is to be able to cancel UrlRequests using UrlRequestId = uint64_t; // To be called by implementations to pass UrlResponse void onUrlResponse(UrlRequestHandle _request, UrlResponse&& _response); virtual void cancelUrlRequestImpl(UrlRequestId _id) = 0; // Return true when UrlRequestId has been set (i.e. when request is async and can be canceled) virtual bool startUrlRequestImpl(const Url& _url, UrlRequestHandle _request, UrlRequestId& _id) = 0; static bool bytesFromFileSystem(const char* _path, std::function<char*(size_t)> _allocator); std::atomic<bool> m_shutdown{false}; bool m_continuousRendering; std::mutex m_callbackMutex; struct UrlRequestEntry { UrlCallback callback; UrlRequestId id; bool cancelable; }; std::unordered_map<UrlRequestHandle, UrlRequestEntry> m_urlCallbacks; std::atomic_uint_fast64_t m_urlRequestCount = {0}; }; } // namespace Tangram
/////////////////////////////////////////////////////////////////////////////// // // This file is a part of the PadallelFDTD Finite-Difference Time-Domain // simulation library. It is released under the MIT License. You should have // received a copy of the MIT License along with ParallelFDTD. If not, see // http://www.opensource.org/licenses/mit-license.php // // 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. // // For details, see the LICENSE file // // (C) 2013-2014 Jukka Saarelma // Aalto University School of Science // /////////////////////////////////////////////////////////////////////////////// #ifndef GL_HELPERS_H #define GL_HELPERS_H // OpenGL Graphics includes #include <GL/glew.h> #include <GL/freeglut.h> // Helper for GLEW error codes void glewsafe(GLenum err, const char* message); void glsafe(GLenum error, const char* message); #endif
// // C1SCMainViewController.h // ChallengeRSS_SoniaCasas // // Created by Sonia Casas on 18/4/15. // Copyright (c) 2015 Sonia Casas. All rights reserved. // #import <UIKit/UIKit.h> @interface C1SCMainViewController : UITableViewController <NSXMLParserDelegate> @end
/* * Copyright (c) 2015 Kaprica Security, 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. * */ #ifndef CLIENT_BACKEND_H_ #define CLIENT_BACKEND_H_ #include "user.h" namespace Backend { void InitDataStores(int secret_page_i); bool CheckIfUserExists(const char *name, unsigned short length); bool AddUser(User *user); bool DeleteUser(User **puser, const char *pass, unsigned short pass_length); bool CheckIfChannelExists(const char *name, unsigned short length); bool JoinChannel(const char *user_name, unsigned short user_length, const char *pass, unsigned short pass_length, const char *chan_name, unsigned short chan_length); bool DeleteChannel(const char *chan_name, unsigned short chan_length, const char *user_name, unsigned short user_length, const char *pass, unsigned short pass_length); bool AddChannelAdmin(const char *user_name, unsigned short user_length, const char *pass, unsigned short pass_length, const char *admin_name, unsigned short admin_name_length); bool VerifyPassword(const char *name, unsigned short name_length, const char *pass, unsigned short pass_length); void DebugPrintUsers(); void DebugPrintChannels(); } #endif /* CLIENT_BACKEND_H_ */
/****************************************************************************** * tick/tick_atmega328p.c * * ====================== * * * * Author : Peter Weissig * * * * For help or bug report please visit: * * https://github.com/RoboAG/avr_robolib * ******************************************************************************/ //**************************<File version>************************************* #define ROBOLIB_TICK_SUB_VERSION \ "robolib/tick/tick_atmega328p.c 20.03.2018 V1.0.0" //**************************[tick_init]**************************************** 20.03.2018 void robolib_tick_init() { #if TICK_SYSTICK == TIMER0 // switch TIMER #if F_CPU / 100 / 1024 > 256 #error "can't setup systick with TIMER0 - prescaler maximum is 1024" #elif F_CPU / 100 / 256 > 256 #define ROBOLIB_TICK_CS 0b101 #define ROBOLIB_TICK_MAX ((uint8_t) (F_CPU / 100 / 1024)) #elif F_CPU / 100 / 128 > 256 #define ROBOLIB_TICK_CS 0b100 #define ROBOLIB_TICK_MAX ((uint8_t) (F_CPU / 100 / 256)) #elif F_CPU / 100 / 64 > 256 #define ROBOLIB_TICK_CS 0b100 #define ROBOLIB_TICK_MAX ((uint8_t) (F_CPU / 100 / 256)) #elif F_CPU / 100 / 32 > 256 #define ROBOLIB_TICK_CS 0b100 #define ROBOLIB_TICK_MAX ((uint8_t) (F_CPU / 100 / 256)) #elif F_CPU / 100 / 8 > 256 #define ROBOLIB_TICK_CS 0b011 #define ROBOLIB_TICK_MAX ((uint8_t) (F_CPU / 100 / 64)) #elif F_CPU / 100 / 1 > 256 #define ROBOLIB_TICK_CS 0b010 #define ROBOLIB_TICK_MAX ((uint8_t) (F_CPU / 100 / 8)) #else #define ROBOLIB_TICK_CS 0b001 #define ROBOLIB_TICK_MAX ((uint8_t) (F_CPU / 100 / 1)) #endif // 8-bit Timer // Mode 2 (CTC until OCRA) TCCR0A = _BV(WGM01); // Bit 6-7 (COM0Ax) = 00 output mode (none) // Bit 4-5 (COM0Bx) = 00 output mode (none) // Bit 2-3 ( - ) = reserved // Bit 0-1 (WGM0x ) = 10 select timer mode [WGM02 in TCCR0B] TCCR0B = (ROBOLIB_TICK_CS & 0x07); // Bit 6-7 (FOC0n) = 0 force output compare (none) // Bit 4-5 ( - ) = reserved // Bit 3 (WGM02 ) = 0 select timer mode [WGM0x in TCCR0A] // Bit 0-2 (CS0x ) = ??? [calculated] TCNT0 = 0; // Timer/Counter Register - current value of timer OCR0A = ROBOLIB_TICK_MAX; // Output Compare Register - top for timer TIMSK0 = _BV(OCIE0A); // Bit 3-7 ( - ) = reserved // Bit 2 (OCIE0B) = 0 interrupt for compare match B // Bit 1 (OCIE0A) = 1 interrupt for compare match A (tick) // Bit 0 (TOIE0 ) = 0 interrupt for overflow TIFR0 = _BV(OCF0A); // Bit 3-7 ( - ) = reserved // Bit 2 (OCF0B ) = 0 interrupt for compare match B // Bit 1 (OCF0A ) = 1 interrupt for compare match A (tick) // Bit 0 (TOV0 ) = 0 interrupt for overflow #define ROBOLIB_TICK_ISR ISR(TIMER0_COMPA_vect) #define ROBOLIB_TICK_ISR_SEI() ( \ { TIMSK0&= ~ _BV(OCIE0A); sei();}) #define ROBOLIB_TICK_ISR_CLI() ( \ { cli(); TIMSK0|= _BV(OCIE0A);}) #else // switch TICK_SYSTICK #error "timer is not supported (yet) for this device" #endif // switch TICK_SYSTICK } //**************************[ISR(tick)]**************************************** 20.03.2018 ROBOLIB_TICK_ISR { robolib_tick_time++; ROBOLIB_TICK_ISR_SEI(); #ifdef ROBOLIB_TICK_FUNCTION ROBOLIB_TICK_FUNCTION(); #endif; tick_userfunction(); ROBOLIB_TICK_ISR_CLI(); }
/* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 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/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TK_NUM = 258, TK_MAIN = 259, TK_ID = 260, TK_TIPO_INT = 261, TK_FIM = 262, TK_ERROR = 263 }; #endif /* Tokens. */ #define TK_NUM 258 #define TK_MAIN 259 #define TK_ID 260 #define TK_TIPO_INT 261 #define TK_FIM 262 #define TK_ERROR 263 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval;
// // The MIT License (MIT) // // Copyright (c) 2015 Joe Lagomarsino // // 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. // #import <UIKit/UIKit.h> @interface MHLocationsListViewController : UITableViewController @end
#pragma once #include "ofMain.h" #include "Particle.h" class ofApp: public ofBaseApp { public: void setup() override; void update() override; void draw() override; Particle p; };
#pragma once #include "OperatorViewBuilder.h" namespace operator_view { namespace opengl { class Builder : public operator_view::Builder { public: Builder(std::shared_ptr<IMediator> mediator); }; } }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" #import "WCDBCoding.h" @class NSString; @interface DBEmoticonUpload : NSObject <WCDBCoding> { unsigned int type; unsigned int createTime; unsigned int sendTime; unsigned int offset; unsigned int length; unsigned int status; unsigned int catalogId; unsigned int ConIntRes1; unsigned int ConIntRes2; unsigned int ConIntRes3; NSString *userName; NSString *msgLocalId; NSString *md5; NSString *message; NSString *catalog; NSString *draft; NSString *ConStrRes1; NSString *ConStrRes2; NSString *ConStrRes3; long long m___rowID; } + (const basic_string_a490aa4c *)getWCDBPrimaryColumnName; + (const struct WCDBIndexHelper *)getWCDBIndexArray; + (unsigned long long)getWCDBIndexArrayCount; + (const map_0e718273 *)getFileValueTagIndexMap; + (id)getFileValueTypeTable; + (const map_0e718273 *)getPackedValueTagIndexMap; + (id)getPackedValueTypeTable; + (const map_7a576766 *)getValueNameIndexMap; + (id)getValueTable; + (id)dummyObject; @property(nonatomic) long long __rowID; // @synthesize __rowID=m___rowID; @property(retain, nonatomic) NSString *ConStrRes3; // @synthesize ConStrRes3; @property(retain, nonatomic) NSString *ConStrRes2; // @synthesize ConStrRes2; @property(retain, nonatomic) NSString *ConStrRes1; // @synthesize ConStrRes1; @property(nonatomic) unsigned int ConIntRes3; // @synthesize ConIntRes3; @property(nonatomic) unsigned int ConIntRes2; // @synthesize ConIntRes2; @property(nonatomic) unsigned int ConIntRes1; // @synthesize ConIntRes1; @property(retain, nonatomic) NSString *draft; // @synthesize draft; @property(nonatomic) unsigned int catalogId; // @synthesize catalogId; @property(retain, nonatomic) NSString *catalog; // @synthesize catalog; @property(nonatomic) unsigned int status; // @synthesize status; @property(nonatomic) unsigned int length; // @synthesize length; @property(nonatomic) unsigned int offset; // @synthesize offset; @property(nonatomic) unsigned int sendTime; // @synthesize sendTime; @property(nonatomic) unsigned int createTime; // @synthesize createTime; @property(retain, nonatomic) NSString *message; // @synthesize message; @property(nonatomic) unsigned int type; // @synthesize type; @property(retain, nonatomic) NSString *md5; // @synthesize md5; @property(retain, nonatomic) NSString *msgLocalId; // @synthesize msgLocalId; @property(retain, nonatomic) NSString *userName; // @synthesize userName; - (void).cxx_destruct; - (const map_0e718273 *)getValueTagIndexMap; - (id)getValueTypeTable; - (const WCDBCondition_22fabacd *)db_ConStrRes3; - (const WCDBCondition_22fabacd *)db_ConStrRes2; - (const WCDBCondition_22fabacd *)db_ConStrRes1; - (const WCDBCondition_c6db074e *)db_ConIntRes3; - (const WCDBCondition_c6db074e *)db_ConIntRes2; - (const WCDBCondition_c6db074e *)db_ConIntRes1; - (const WCDBCondition_22fabacd *)db_draft; - (const WCDBCondition_c6db074e *)db_catalogId; - (const WCDBCondition_22fabacd *)db_catalog; - (const WCDBCondition_c6db074e *)db_status; - (const WCDBCondition_c6db074e *)db_length; - (const WCDBCondition_c6db074e *)db_offset; - (const WCDBCondition_c6db074e *)db_sendTime; - (const WCDBCondition_c6db074e *)db_createTime; - (const WCDBCondition_22fabacd *)db_message; - (const WCDBCondition_c6db074e *)db_type; - (const WCDBCondition_22fabacd *)db_md5; - (const WCDBCondition_22fabacd *)db_msgLocalId; - (const WCDBCondition_22fabacd *)db_userName; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
// // GDDownloaderManager.h // 01-下载管理器 // // Created by apple on 15/1/20. // Copyright (c) 2015年 zhouguodong. All rights reserved. // // 负责管理所有的下载任务 - 单例 // #import <Foundation/Foundation.h> @interface GDDownloaderManager : NSObject + (instancetype)sharedDownloaderManager; /** * 下载指定的 URL * * block - 可以当作参数传递 */ - (void)downloadWithURL:(NSURL *)url progress:(void (^)(float progress))progress completion:(void (^)(NSString *filePath))completion failed:(void (^)(NSString *errorMessage))failed; /** * 暂停下载 */ - (void)pauseWithURL:(NSURL *)url; @end
#include <string.h> #ifndef CONFIGURATION_H #define CONFIGURATION_H #include "configuration.h" #endif /* sick makro shit ;-) */ #define bootLogger(loglevel, format, args...) \ bootLoggerLog(loglevel,"%s::%s(%d)>" format, __FILE__, \ __func__, __LINE__, ##args ) void openBootLog(Settings * settings); void bootLoggerLog(int loglevel, const char *format, ...); void closeBootLog(void);
#pragma once #include <ostream> #include <utility> namespace simply { namespace clr { namespace metadata { using namespace std::rel_ops; class version { public: inline version(unsigned short major, unsigned short minor, unsigned short build, unsigned short revision) : _major { major }, _minor { minor }, _build { build }, _revision { revision } { } inline unsigned short major() const { return _major; } inline unsigned short minor() const { return _minor; } inline unsigned short build() const { return _build; } inline unsigned short revision() const { return _revision; } private: const unsigned short _major; const unsigned short _minor; const unsigned short _build; const unsigned short _revision; }; bool operator==(const version& left, const version& right); bool operator<(const version& left, const version& right); template <class char_t, class traits> std::basic_ostream<char_t, traits>& operator<<(std::basic_ostream<char_t, traits>& stream, const version& version) { return stream << version.major() << '.' << version.minor() << '.' << version.build() << '.' << version.revision(); } }}}
// #include "i2c.h" #include "bitlit.h" #include "typedefs.h" #define PCF8583_ADDRESS 0x51 // PCF8563 device address (8 bit) #define I2C_BUSS "/dev/i2c-1" // i2c buss that the WaveShare Cape uses for the PCF8563 #define PCF8563_REGS 0x0f // numer of registers on the PCF8563 // control registers write values #define CNT_REG_1 B8(00000000) // control/status1, no test modes or POR override #define CNT_REG_2 B8(00000000) // control/status2, no alarm/timer flags and interrupts // time and date register addresses #define SEC_REG 0x02 #define MIN_REG 0x03 #define HOUR_REG 0x04 #define DAY_REG 0x05 #define WDAY_REG 0x06 #define MON_REG 0x07 #define YEAR_REG 0x08 // alarm registers write values #define ALM_REG_MIN B8(10000000) // minute alarm values reset to 00 #define ALM_REG_HOUR B8(10000000) // hour alarm values reset to 00 #define ALM_REG_DAY B8(10000000) // day alarm values reset to 00 #define ALM_REG_WDAY B8(10000000) // week day alarm values reset to 00 // CLKOUT control register #define CLKOUT_REG B8(00000000) // CLKOUT outputs inhibited // timer registers #define TIMER_REG_1 B8(00000000) // timer swwiteched off #define TIMER_REG_2 B8(00000000) // no timer value // register masks #define SEC_MASK B8(01111111) #define MIN_MASK B8(01111111) #define HOUR_MASK B8(00111111) #define DAY_MASK B8(00111111) #define WDAY_MASK B8(00000111) #define WDAY_MASK B8(00000111) #define MON_MASK B8(00001111) #define YEAR_MASK B8(11111111) #define CENTRY_MASK B8(10000000) /* real time api */ int open_tm(char *filename, uint8_t addr); void close_tm(int); void get_tm(_tm *); void set_tm(int, _tm *);
#include "peons/sensors.h" #include "driver/dht.h" #include "board/cfg.h" #include "peons/log.h" #include "kernel/peons.h" #include "platform/clock.h" #include "platform/timer.h" #define SENSOR_MAX_FAILURES 10 #define DEFAULT_SENSOR_PERIOD 2 #define SENSOR_NAME_DHT "dht" /** * DHT sensor configuration */ static const dht_config dht_sensor_config = { .port = DHT_GPIO_PORT, .pin = DHT_GPIO_PIN, .timer = DHT_TIMER }; /** * timer TIM1 configuration (used by DHT sensor) */ static const timer_config tim1_config = { .counter_mode = TIMER_COUNTER_MODE_UP, .prescaler = 0x3f, .period = 0xff }; static uint32_t sensor_period = DEFAULT_SENSOR_PERIOD; static bool dht_enabled = true; void sensors_loop(void) { timer_init(TIM1, &tim1_config); dht_init(&dht_sensor_config); dht_iface *iface_dht = dht_iface_get(); uint32_t dht_failure_counter = 0; while (true) { peon_lock(); if (iface_dht && dht_enabled) { if (!iface_dht->read(iface_dht)) { dht_failure_counter++; } else { dht_failure_counter = 0; } } peon_unlock(); if (dht_failure_counter > SENSOR_MAX_FAILURES) { log_add("[DHT] too many consequent failures, disabling sensor"); dht_failure_counter = 0; dht_enabled = false; } clock_dly_secs(sensor_period); } } void sensors_set_period(uint32_t seconds) { sensor_period = seconds; } void sensors_set_enabled(char *sensor_name, bool enabled) { if (strcmp(sensor_name, SENSOR_NAME_DHT) == 0) { dht_enabled = enabled; } } uint32_t sensors_get_period(void) { return sensor_period; } void sensors_print_stat(char *sensor_name) { if (strcmp(sensor_name, SENSOR_NAME_DHT) == 0) { printf("[DHT]\n"); printf("Enabled: "); if (dht_enabled) { printf("yes\n"); } else { printf("no\n"); } } else { error_message("Unknown sensor"); } }
#import <UIKit/UIKit.h> #import <QuartzCore/QuartzCore.h> #import "DCTransitionView.h" @interface DCPushTransitionView : DCTransitionView @end
#pragma once class RegistryUtilities { public: RegistryUtilities(); ~RegistryUtilities(); bool changeAllFeatures(DWORD value); bool lockStatus(); bool keepAppsStatus(); private: bool changeSingleFeature(HKEY regKey, LPCWSTR subKey, DWORD value, LPCWSTR valueName); };
// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // $Id:$ // // Copyright (C) 1993-1996 by id Software, Inc. // // This source is available for distribution and/or modification // only under the terms of the DOOM Source Code License as // published by id Software. All rights reserved. // // The source is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License // for more details. // // DESCRIPTION: // Nil. // //----------------------------------------------------------------------------- #ifndef __M_BBOX_H__ #define __M_BBOX_H__ #include "doomtype.h" struct line_t; struct node_t; class FBoundingBox { public: FBoundingBox() { ClearBox(); } FBoundingBox(fixed_t left, fixed_t bottom, fixed_t right, fixed_t top) { m_Box[BOXTOP] = top; m_Box[BOXLEFT] = left; m_Box[BOXRIGHT] = right; m_Box[BOXBOTTOM] = bottom; } FBoundingBox(fixed_t x, fixed_t y, fixed_t radius) { m_Box[BOXTOP] = y + radius; m_Box[BOXLEFT] = x - radius; m_Box[BOXRIGHT] = x + radius; m_Box[BOXBOTTOM] = y - radius; } void ClearBox () { m_Box[BOXTOP] = m_Box[BOXRIGHT] = FIXED_MIN; m_Box[BOXBOTTOM] = m_Box[BOXLEFT] = FIXED_MAX; } // Returns a bounding box that encloses both bounding boxes FBoundingBox operator | (const FBoundingBox &box2) const { return FBoundingBox(m_Box[BOXLEFT] < box2.m_Box[BOXLEFT] ? m_Box[BOXLEFT] : box2.m_Box[BOXLEFT], m_Box[BOXBOTTOM] < box2.m_Box[BOXBOTTOM] ? m_Box[BOXBOTTOM] : box2.m_Box[BOXBOTTOM], m_Box[BOXRIGHT] > box2.m_Box[BOXRIGHT] ? m_Box[BOXRIGHT] : box2.m_Box[BOXRIGHT], m_Box[BOXTOP] > box2.m_Box[BOXTOP] ? m_Box[BOXTOP] : box2.m_Box[BOXTOP]); } void AddToBox (fixed_t x, fixed_t y); inline fixed_t Top () const { return m_Box[BOXTOP]; } inline fixed_t Bottom () const { return m_Box[BOXBOTTOM]; } inline fixed_t Left () const { return m_Box[BOXLEFT]; } inline fixed_t Right () const { return m_Box[BOXRIGHT]; } int BoxOnLineSide (const line_t *ld) const; void Set(int index, fixed_t value) {m_Box[index] = value;} protected: fixed_t m_Box[4]; }; #endif //__M_BBOX_H__
// // TESTFFFFFF.h // TESTFFFFFF // // Created by Alex Padalko on 4/17/17. // Copyright © 2017 Alex Padalko. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for TESTFFFFFF. FOUNDATION_EXPORT double TESTFFFFFFVersionNumber; //! Project version string for TESTFFFFFF. FOUNDATION_EXPORT const unsigned char TESTFFFFFFVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <TESTFFFFFF/PublicHeader.h>
#pragma once #include "CoreMinimal.h" #include "UI/RTSActorWidgetComponent.h" #include "RTSProductionProgressBarWidgetComponent.generated.h" /** * Adds a production progress bar widget to the actor. */ UCLASS(Blueprintable) class REALTIMESTRATEGY_API URTSProductionProgressBarWidgetComponent : public URTSActorWidgetComponent { GENERATED_BODY() public: virtual void BeginPlay() override; /** Event when the current production progress of the actor has changed. */ UFUNCTION(BlueprintImplementableEvent, Category = "RTS") void UpdateProductionProgressBar(int32 QueueIndex, float ProgressPercentage); private: UFUNCTION() void OnProductionProgressChanged(AActor* Actor, int32 QueueIndex, float ProgressPercentage); };
/* -*- Mode: C++; indent-tabs-mode: nil -*- */ #ifndef SCHWA_DR_EXCEPTION_H_ #define SCHWA_DR_EXCEPTION_H_ #include <string> #include <schwa/_base.h> #include <schwa/exception.h> namespace schwa { namespace dr { class ReaderException : public Exception { public: ReaderException(const std::string &msg) : Exception(msg) { } ReaderException(const Exception &e) : Exception(e) { } virtual ~ReaderException(void) throw() { } }; } } #endif // SCHWA_DR_EXCEPTION_H_
#pragma once #include "nethandlers.h" namespace NetMsg { struct SVC_SetView { uint16_t entIndex; }; } DECLARE_NET_HANDLERS(SVC_SetView);
// // CRNotificationView.h // 和路通 // // Created by roger wu on 01/08/2018. // Copyright © 2018 asiainfo. All rights reserved. // #import <UIKit/UIKit.h> typedef void(^LTNotificationViewComplete)(void); @interface CRNotificationView : UIWindow + (instancetype)sharedInstance; /** 显示弹窗 @param title 标题 @param content 内容 @param complete 回调 */ - (void)showWithTitle:(NSString *)title content:(NSString *)content complete:(LTNotificationViewComplete)complete; // 隐藏 - (void)dismiss; @end
#include "supergud.h" #include <stdio.h> int main(int argc, char * argv[]) { if (argc == 2) { printf("%s -> %s\n", argv[1], supergud_hash(argv[1], "I_BET_THE_JEWS_DID_THIS")); } }
/* * Listener.h * * Created on: Jan 17, 2014 * Author: lukas */ #ifndef LISTENER_H_ #define LISTENER_H_ /** * On value changed listener */ #include "ControlPort.h" template<typename V = float, typename P = ControlPortPtr> class OnValueChange: public ICallbackFunctor { private: V& m_pValueRef; const P& m_pPort; public: OnValueChange(V& ref, const P& port) : m_pValueRef(ref), m_pPort(port) { } void operator()() { m_pValueRef = m_pPort->pop(); } }; #endif /* LISTENER_H_ */
/* FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd. FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. *************************************************************************** * * * FreeRTOS tutorial books are available in pdf and paperback. * * Complete, revised, and edited pdf reference manuals are also * * available. * * * * Purchasing FreeRTOS documentation will not only help you, by * * ensuring you get running as quickly as possible and with an * * in-depth knowledge of how to use FreeRTOS, it will also help * * the FreeRTOS project to continue with its mission of providing * * professional grade, cross platform, de facto standard solutions * * for microcontrollers - completely free of charge! * * * * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * * * * Thank you for using FreeRTOS, and thank you for your support! * * * *************************************************************************** This file is part of the FreeRTOS distribution. FreeRTOS 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 AND MODIFIED BY the FreeRTOS exception. >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to distribute a combined work that includes FreeRTOS without being obliged to provide the source code for proprietary components outside of the FreeRTOS kernel. FreeRTOS 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 and the FreeRTOS license exception along with FreeRTOS; if not itcan be viewed here: http://www.freertos.org/a00114.html and also obtained by writing to Real Time Engineers Ltd., contact details for whom are available on the FreeRTOS WEB site. 1 tab == 4 spaces! *************************************************************************** * * * Having a problem? Start by reading the FAQ "My application does * * not run, what could be wrong?" * * * * http://www.FreeRTOS.org/FAQHelp.html * * * *************************************************************************** http://www.FreeRTOS.org - Documentation, books, training, latest versions, license and Real Time Engineers Ltd. contact details. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, and our new fully thread aware and reentrant UDP/IP stack. http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell the code with commercial support, indemnification and middleware, under the OpenRTOS brand. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. */ /* Changes from V3.0.0 + TickRate reduced to 250Hz. + configIDLE_SHOULD_YIELD added. Changes from V3.0.1 */ #ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H /*----------------------------------------------------------- * Application specific definitions. * * These definitions should be adjusted for your particular hardware and * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html. *----------------------------------------------------------*/ #define configUSE_PREEMPTION ( 1 ) #define configUSE_IDLE_HOOK ( 0 ) #define configUSE_TICK_HOOK ( 0 ) #define configTICK_RATE_HZ ( 250 ) #define configMAX_PRIORITIES ( 4 ) #define configMINIMAL_STACK_SIZE portMINIMAL_STACK_SIZE #define configMAX_TASK_NAME_LEN ( 3 ) #define configUSE_TRACE_FACILITY ( 0 ) #define configUSE_16_BIT_TICKS ( 1 ) #define configIDLE_SHOULD_YIELD ( 1 ) /* Co-routine definitions. */ #define configUSE_CO_ROUTINES 0 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the component, or zero to exclude the component. */ /* Include/exclude the stated API function. */ #define INCLUDE_vTaskPrioritySet ( 0 ) #define INCLUDE_uxTaskPriorityGet ( 0 ) #define INCLUDE_vTaskDelete ( 0 ) #define INCLUDE_vTaskCleanUpResources ( 0 ) #define INCLUDE_vTaskSuspend ( 0 ) #define INCLUDE_vTaskDelayUntil ( 1 ) #define INCLUDE_vTaskDelay ( 0 ) #endif /* FREERTOS_CONFIG_H */