text
stringlengths
4
6.14k
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // XFAIL: sparc // rdar://7536390 typedef unsigned __INT32_TYPE__ uint32_t; unsigned t(uint32_t *ptr, uint32_t val) { // CHECK: @t // CHECK: atomicrmw xchg i32* {{.*}} seq_cst return __sync_lock_test_and_set(ptr, val); }
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_PLATFORM_GCS_FILE_SYSTEM_H_ #define TENSORFLOW_CORE_PLATFORM_GCS_FILE_SYSTEM_H_ #include <string> #include <vector> #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/platform/cloud/auth_provider.h" #include "tensorflow/core/platform/cloud/http_request.h" #include "tensorflow/core/platform/cloud/retrying_file_system.h" #include "tensorflow/core/platform/file_system.h" namespace tensorflow { /// Google Cloud Storage implementation of a file system. /// /// The clients should use RetryingGcsFileSystem defined below, /// which adds retry logic to GCS operations. class GcsFileSystem : public FileSystem { public: GcsFileSystem(); GcsFileSystem(std::unique_ptr<AuthProvider> auth_provider, std::unique_ptr<HttpRequest::Factory> http_request_factory, size_t read_ahead_bytes, int64 initial_retry_delay_usec); Status NewRandomAccessFile( const string& filename, std::unique_ptr<RandomAccessFile>* result) override; Status NewWritableFile(const string& fname, std::unique_ptr<WritableFile>* result) override; Status NewAppendableFile(const string& fname, std::unique_ptr<WritableFile>* result) override; Status NewReadOnlyMemoryRegionFromFile( const string& filename, std::unique_ptr<ReadOnlyMemoryRegion>* result) override; Status FileExists(const string& fname) override; Status Stat(const string& fname, FileStatistics* stat) override; Status GetChildren(const string& dir, std::vector<string>* result) override; Status GetMatchingPaths(const string& pattern, std::vector<string>* results) override; Status DeleteFile(const string& fname) override; Status CreateDir(const string& dirname) override; Status DeleteDir(const string& dirname) override; Status GetFileSize(const string& fname, uint64* file_size) override; Status RenameFile(const string& src, const string& target) override; Status IsDirectory(const string& fname) override; Status DeleteRecursively(const string& dirname, int64* undeleted_files, int64* undeleted_dirs) override; size_t get_readahead_buffer_size() const { return read_ahead_bytes_; } private: /// \brief Checks if the bucket exists. Returns OK if the check succeeded. /// /// 'result' is set if the function returns OK. 'result' cannot be nullptr. Status BucketExists(const string& bucket, bool* result); /// \brief Checks if the object exists. Returns OK if the check succeeded. /// /// 'result' is set if the function returns OK. 'result' cannot be nullptr. Status ObjectExists(const string& bucket, const string& object, bool* result); /// \brief Checks if the folder exists. Returns OK if the check succeeded. /// /// 'result' is set if the function returns OK. 'result' cannot be nullptr. Status FolderExists(const string& dirname, bool* result); /// \brief Internal version of GetChildren with more knobs. /// /// If 'recursively' is true, returns all objects in all subfolders. /// Otherwise only returns the immediate children in the directory. /// /// If 'include_self_directory_marker' is true and there is a GCS directory /// marker at the path 'dir', GetChildrenBound will return an empty string /// as one of the children that represents this marker. Status GetChildrenBounded(const string& dir, uint64 max_results, std::vector<string>* result, bool recursively, bool include_self_directory_marker); /// Retrieves file statistics assuming fname points to a GCS object. Status StatForObject(const string& bucket, const string& object, FileStatistics* stat); Status RenameObject(const string& src, const string& target); std::unique_ptr<AuthProvider> auth_provider_; std::unique_ptr<HttpRequest::Factory> http_request_factory_; // The number of bytes to read ahead for buffering purposes in the // RandomAccessFile implementation. Defaults to 256Mb. size_t read_ahead_bytes_ = 256 * 1024 * 1024; // The initial delay for exponential backoffs when retrying failed calls. const int64 initial_retry_delay_usec_ = 1000000L; TF_DISALLOW_COPY_AND_ASSIGN(GcsFileSystem); }; /// Google Cloud Storage implementation of a file system with retry on failures. class RetryingGcsFileSystem : public RetryingFileSystem { public: RetryingGcsFileSystem() : RetryingFileSystem(std::unique_ptr<FileSystem>(new GcsFileSystem)) {} }; } // namespace tensorflow #endif // TENSORFLOW_CORE_PLATFORM_GCS_FILE_SYSTEM_H_
// RUN: %clang_cc1 -triple armv7-unknown-nacl-gnueabi \ // RUN: -ffreestanding -mfloat-abi hard -target-cpu cortex-a8 \ // RUN: -emit-llvm -w -o - %s | FileCheck %s // Test that functions with pnaclcall attribute generate portable bitcode // like the le32 arch target typedef struct { int a; int b; } s1; // CHECK-LABEL: define i32 @f48(%struct.s1* byval %s) int __attribute__((pnaclcall)) f48(s1 s) { return s.a; } // CHECK-LABEL: define void @f49(%struct.s1* noalias sret %agg.result) s1 __attribute__((pnaclcall)) f49() { s1 s; s.a = s.b = 1; return s; } union simple_union { int a; char b; }; // Unions should be passed as byval structs // CHECK-LABEL: define void @f50(%union.simple_union* byval %s) void __attribute__((pnaclcall)) f50(union simple_union s) {} typedef struct { int b4 : 4; int b3 : 3; int b8 : 8; } bitfield1; // Bitfields should be passed as byval structs // CHECK-LABEL: define void @f51(%struct.bitfield1* byval %bf1) void __attribute__((pnaclcall)) f51(bitfield1 bf1) {}
/* { dg-do compile } */ /* { dg-skip-if "" { ! { clmcpu } } } */ /* { dg-options "-mcpu=nps400 -mq-class -mbitops -munaligned-access -mcmem -O2 -fno-strict-aliasing" } */ enum npsdp_mem_space_type { NPSDP_EXTERNAL_MS = 1 }; struct npsdp_ext_addr { struct { struct { enum npsdp_mem_space_type mem_type : 1; unsigned msid : 5; }; }; char user_space[]; } a; char b; void fn1() { ((struct npsdp_ext_addr *)a.user_space)->mem_type = NPSDP_EXTERNAL_MS; ((struct npsdp_ext_addr *)a.user_space)->msid = ((struct npsdp_ext_addr *)a.user_space)->mem_type ? 1 : 10; while (b) ; }
#ifndef _ROS_gazebo_msgs_ModelState_h #define _ROS_gazebo_msgs_ModelState_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "geometry_msgs/Pose.h" #include "geometry_msgs/Twist.h" namespace gazebo_msgs { class ModelState : public ros::Msg { public: const char* model_name; geometry_msgs::Pose pose; geometry_msgs::Twist twist; const char* reference_frame; ModelState(): model_name(""), pose(), twist(), reference_frame("") { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; uint32_t length_model_name = strlen(this->model_name); memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); offset += 4; memcpy(outbuffer + offset, this->model_name, length_model_name); offset += length_model_name; offset += this->pose.serialize(outbuffer + offset); offset += this->twist.serialize(outbuffer + offset); uint32_t length_reference_frame = strlen(this->reference_frame); memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); offset += 4; memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); offset += length_reference_frame; return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; uint32_t length_model_name; memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); offset += 4; for(unsigned int k= offset; k< offset+length_model_name; ++k){ inbuffer[k-1]=inbuffer[k]; } inbuffer[offset+length_model_name-1]=0; this->model_name = (char *)(inbuffer + offset-1); offset += length_model_name; offset += this->pose.deserialize(inbuffer + offset); offset += this->twist.deserialize(inbuffer + offset); uint32_t length_reference_frame; memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); offset += 4; for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ inbuffer[k-1]=inbuffer[k]; } inbuffer[offset+length_reference_frame-1]=0; this->reference_frame = (char *)(inbuffer + offset-1); offset += length_reference_frame; return offset; } const char * getType(){ return "gazebo_msgs/ModelState"; }; const char * getMD5(){ return "9330fd35f2fcd82d457e54bd54e10593"; }; }; } #endif
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_LITE_TOCO_EXPORT_TENSORFLOW_H_ #define TENSORFLOW_LITE_TOCO_EXPORT_TENSORFLOW_H_ #include <string> #include "tensorflow/lite/toco/model.h" namespace toco { void ExportTensorFlowGraphDef(const Model& model, std::string* output_file_contents); void EncodeConstantArraysMinMaxByWrappingThemInFakeQuantNodes(Model* model); } // namespace toco #endif // TENSORFLOW_LITE_TOCO_EXPORT_TENSORFLOW_H_
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_GRAPPLER_GRAPPLER_ITEM_H_ #define TENSORFLOW_CORE_GRAPPLER_GRAPPLER_ITEM_H_ #include <memory> #include <string> #include <unordered_set> #include <utility> #include <vector> #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/framework/variable.pb.h" #include "tensorflow/core/protobuf/queue_runner.pb.h" namespace tensorflow { namespace grappler { // A TensorFlow model to optimize. // Models are represented by the combination of a graph, one of more fetch // nodes, and potentially a set of nodes to feed. struct GrapplerItem { GrapplerItem() = default; GrapplerItem(const GrapplerItem& other, GraphDef&& graph_def) : GrapplerItem(other, &graph_def) {} // Swaps *graph_def with an empty GraphDef. GrapplerItem(const GrapplerItem& other, GraphDef* graph_def); virtual ~GrapplerItem() = default; string id; // A unique id for this item // Inputs GraphDef graph; std::vector<std::pair<string, Tensor>> feed; std::vector<string> fetch; // Initialization op(s). std::vector<string> init_ops; // Expected initialization time in seconds, or 0 if unknown int64 expected_init_time = 0; // Save/restore ops (if any) string save_op; string restore_op; string save_restore_loc_tensor; // Queue runner(s) required to run the queue(s) of this model. std::vector<QueueRunnerDef> queue_runners; // List of op names to keep in the graph. This includes nodes that are // referenced in various collections, and therefore must be preserved to // ensure that the optimized metagraph can still be loaded. std::vector<string> keep_ops; // Return the set of node evaluated during a regular train/inference step. std::vector<const NodeDef*> MainOpsFanin() const; // Return the set of node run to populate the queues (if any). std::vector<const NodeDef*> EnqueueOpsFanin() const; // Return the set nodes used by TensorFlow to initialize the graph. std::vector<const NodeDef*> InitOpsFanin() const; // Return the set of variables accessed during a regular train/inference step. std::vector<const NodeDef*> MainVariables() const; // Return a set of node names that must be preserved. This includes feed and // fetch nodes, keep_ops, init_ops. std::unordered_set<string> NodesToPreserve() const; }; // Return the transitive fanin of a set of terminal nodes. std::vector<const NodeDef*> ComputeTransitiveFanin( const GraphDef& graph, const std::vector<string>& terminal_nodes); // Return the transitive fanin of a set of terminal nodes. Sets 'ill_formed' to // true if one of the node is missing in the graph, or some node inputs don't // exist. std::vector<const NodeDef*> ComputeTransitiveFanin( const GraphDef& graph, const std::vector<string>& terminal_nodes, bool* ill_formed); } // end namespace grappler } // end namespace tensorflow #endif // TENSORFLOW_CORE_GRAPPLER_GRAPPLER_ITEM_H_
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_QUERY_PARSER_QUERY_PARSER_H_ #define COMPONENTS_QUERY_PARSER_QUERY_PARSER_H_ #include <stddef.h> #include <vector> #include "base/macros.h" #include "base/strings/string16.h" #include "components/query_parser/snippet.h" namespace query_parser { class QueryNodeList; // Used by HasMatchIn. struct QueryWord { // The work to match against. base::string16 word; // The starting position of the word in the original text. size_t position; }; enum class MatchingAlgorithm { // Only words long enough are considered for prefix search. Shorter words are // considered for exact matches. DEFAULT, // All words are considered for a prefix search. ALWAYS_PREFIX_SEARCH, }; typedef std::vector<query_parser::QueryWord> QueryWordVector; // QueryNode is used by QueryParser to represent the elements that constitute a // query. While QueryNode is exposed by way of ParseQuery, it really isn't meant // for external usage. class QueryNode { public: virtual ~QueryNode() {} // Serialize ourselves out to a string that can be passed to SQLite. Returns // the number of words in this node. virtual int AppendToSQLiteQuery(base::string16* query) const = 0; // Return true if this is a QueryNodeWord, false if it's a QueryNodeList. virtual bool IsWord() const = 0; // Returns true if this node matches |word|. If |exact| is true, the string // must exactly match. Otherwise, this uses a starts with comparison. virtual bool Matches(const base::string16& word, bool exact) const = 0; // Returns true if this node matches at least one of the words in |words|. An // entry is added to |match_positions| for all matching words giving the // matching regions. virtual bool HasMatchIn(const QueryWordVector& words, Snippet::MatchPositions* match_positions) const = 0; // Returns true if this node matches at least one of the words in |words|. virtual bool HasMatchIn(const QueryWordVector& words) const = 0; // Appends the words that make up this node in |words|. virtual void AppendWords(std::vector<base::string16>* words) const = 0; }; typedef std::vector<query_parser::QueryNode*> QueryNodeStarVector; // This class is used to parse queries entered into the history search into more // normalized queries that can be passed to the SQLite backend. class QueryParser { public: QueryParser(); // For CJK ideographs and Korean Hangul, even a single character // can be useful in prefix matching, but that may give us too many // false positives. Moreover, the current ICU word breaker gives us // back every single Chinese character as a word so that there's no // point doing anything for them and we only adjust the minimum length // to 2 for Korean Hangul while using 3 for others. This is a temporary // hack until we have a segmentation support. static bool IsWordLongEnoughForPrefixSearch( const base::string16& word, MatchingAlgorithm matching_algorithm); // Parse a query into a SQLite query. The resulting query is placed in // |sqlite_query| and the number of words is returned. int ParseQuery(const base::string16& query, MatchingAlgorithm matching_algorithm, base::string16* sqlite_query); // Parses |query|, returning the words that make up it. Any words in quotes // are put in |words| without the quotes. For example, the query text // "foo bar" results in two entries being added to words, one for foo and one // for bar. void ParseQueryWords(const base::string16& query, MatchingAlgorithm matching_algorithm, std::vector<base::string16>* words); // Parses |query|, returning the nodes that constitute the valid words in the // query. This is intended for later usage with DoesQueryMatch. Ownership of // the nodes passes to the caller. void ParseQueryNodes(const base::string16& query, MatchingAlgorithm matching_algorithm, QueryNodeStarVector* nodes); // Returns true if the string text matches the query nodes created by a call // to ParseQuery. If the query does match, each of the matching positions in // the text is added to |match_positions|. bool DoesQueryMatch(const base::string16& text, const QueryNodeStarVector& nodes, Snippet::MatchPositions* match_positions); // Returns true if all of the |words| match the query |nodes| created by a // call to ParseQuery. bool DoesQueryMatch(const QueryWordVector& words, const QueryNodeStarVector& nodes); // Extracts the words from |text|, placing each word into |words|. void ExtractQueryWords(const base::string16& text, QueryWordVector* words); // Sorts the match positions in |matches| by their first index, then // coalesces any match positions that intersect each other. static void SortAndCoalesceMatchPositions(Snippet::MatchPositions* matches); private: // Does the work of parsing |query|; creates nodes in |root| as appropriate. // This is invoked from both of the ParseQuery methods. bool ParseQueryImpl(const base::string16& query, MatchingAlgorithm matching_algorithm, QueryNodeList* root); DISALLOW_COPY_AND_ASSIGN(QueryParser); }; } // namespace query_parser #endif // COMPONENTS_QUERY_PARSER_QUERY_PARSER_H_
#include "amj60.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. #define _DEF 0 #define _SPC 1 // dual-role shortcuts #define SPACEDUAL LT(_SPC, KC_SPACE) // increase readability #define _______ KC_TRNS const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _DEF: Default Layer * ,-----------------------------------------------------------. * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | ~ | * |-----------------------------------------------------------| * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| bspc| * |-----------------------------------------------------------| * |Caps | A| S| D| F| G| H| J| K| L| ;| '| Return | * |-----------------------------------------------------------| * |Sft | Fn0| Z| X| C| V| B| N| M| ,| .| /| Sft |Fn2| * |-----------------------------------------------------------| * |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl| * `-----------------------------------------------------------' */ [_DEF] = KEYMAP_MAX( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ KC_LSFT, F(0), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, F(1), \ KC_LCTL, KC_LALT, KC_LGUI, SPACEDUAL, KC_RGUI, KC_RALT, KC_RCTL, F(2)), /* Keymap 1: F-and-vim Layer, modified with Space (by holding space) * ,-----------------------------------------------------------. * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | * |-----------------------------------------------------------| * | |Paus| Up| [ | ] | | | | ( | ) | | | | Del | * |-----------------------------------------------------------| * | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY | * |-----------------------------------------------------------| * | | | | | < | > | |M0 | | | | | Vol+ | | * |-----------------------------------------------------------| * | | | | |Alt |Prev|Vol-|Next| * `-----------------------------------------------------------' */ [_SPC] = KEYMAP_MAX( KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \ _______, KC_PAUS, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, KC_MPLY, \ _______, _______, _______, _______, _______, _______, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \ _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), };
/* * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _GAMEOBJECT_MODEL_H #define _GAMEOBJECT_MODEL_H #include <G3D/Matrix3.h> #include <G3D/Vector3.h> #include <G3D/AABox.h> #include <G3D/Ray.h> #include "Define.h" namespace VMAP { class WorldModel; } class GameObject; struct GameObjectDisplayInfoEntry; class GameObjectModel /*, public Intersectable*/ { uint32 phasemask; G3D::AABox iBound; G3D::Matrix3 iInvRot; G3D::Vector3 iPos; //G3D::Vector3 iRot; float iInvScale; float iScale; VMAP::WorldModel* iModel; GameObject const* owner; GameObjectModel() : phasemask(0), iInvScale(0), iScale(0), iModel(NULL), owner(NULL) { } bool initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info); public: std::string name; const G3D::AABox& getBounds() const { return iBound; } ~GameObjectModel(); const G3D::Vector3& getPosition() const { return iPos;} /** Enables\disables collision. */ void disable() { phasemask = 0;} void enable(uint32 ph_mask) { phasemask = ph_mask;} bool isEnabled() const {return phasemask != 0;} bool intersectRay(const G3D::Ray& Ray, float& MaxDist, bool StopAtFirstHit, uint32 ph_mask) const; static GameObjectModel* Create(const GameObject& go); bool Relocate(GameObject const& go); }; #endif // _GAMEOBJECT_MODEL_H
#include <asm/unwind.h> #if __LINUX_ARM_ARCH__ >= 6 .macro bitop, name, instr ENTRY( \name ) UNWIND( .fnstart ) ands ip, r1, #3 strneb r1, [ip] @ assert word-aligned mov r2, #1 and r3, r0, #31 @ Get bit offset mov r0, r0, lsr #5 add r1, r1, r0, lsl #2 @ Get word offset mov r3, r2, lsl r3 1: ldrex r2, [r1] \instr r2, r2, r3 strex r0, r2, [r1] cmp r0, #0 bne 1b bx lr UNWIND( .fnend ) ENDPROC(\name ) .endm .macro testop, name, instr, store ENTRY( \name ) UNWIND( .fnstart ) ands ip, r1, #3 strneb r1, [ip] @ assert word-aligned mov r2, #1 and r3, r0, #31 @ Get bit offset mov r0, r0, lsr #5 add r1, r1, r0, lsl #2 @ Get word offset mov r3, r2, lsl r3 @ create mask smp_dmb #if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP) .arch_extension mp ALT_SMP(W(pldw) [r1]) ALT_UP(W(nop)) #endif 1: ldrex r2, [r1] ands r0, r2, r3 @ save old value of bit \instr r2, r2, r3 @ toggle bit strex ip, r2, [r1] cmp ip, #0 bne 1b smp_dmb cmp r0, #0 movne r0, #1 2: bx lr UNWIND( .fnend ) ENDPROC(\name ) .endm #else .macro bitop, name, instr ENTRY( \name ) UNWIND( .fnstart ) ands ip, r1, #3 strneb r1, [ip] @ assert word-aligned and r2, r0, #31 mov r0, r0, lsr #5 mov r3, #1 mov r3, r3, lsl r2 save_and_disable_irqs ip ldr r2, [r1, r0, lsl #2] \instr r2, r2, r3 str r2, [r1, r0, lsl #2] restore_irqs ip mov pc, lr UNWIND( .fnend ) ENDPROC(\name ) .endm /** * testop - implement a test_and_xxx_bit operation. * @instr: operational instruction * @store: store instruction * * Note: we can trivially conditionalise the store instruction * to avoid dirtying the data cache. */ .macro testop, name, instr, store ENTRY( \name ) UNWIND( .fnstart ) ands ip, r1, #3 strneb r1, [ip] @ assert word-aligned and r3, r0, #31 mov r0, r0, lsr #5 save_and_disable_irqs ip ldr r2, [r1, r0, lsl #2]! mov r0, #1 tst r2, r0, lsl r3 \instr r2, r2, r0, lsl r3 \store r2, [r1] moveq r0, #0 restore_irqs ip mov pc, lr UNWIND( .fnend ) ENDPROC(\name ) .endm #endif
/* * Allwinner SoCs Reset Controller driver * * Copyright 2013 Maxime Ripard * * Maxime Ripard <maxime.ripard@free-electrons.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/err.h> #include <linux/io.h> #include <linux/init.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/platform_device.h> #include <linux/reset-controller.h> #include <linux/reset/sunxi.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/types.h> #include "reset-simple.h" static int sunxi_reset_init(struct device_node *np) { struct reset_simple_data *data; struct resource res; resource_size_t size; int ret; data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; ret = of_address_to_resource(np, 0, &res); if (ret) goto err_alloc; size = resource_size(&res); if (!request_mem_region(res.start, size, np->name)) { ret = -EBUSY; goto err_alloc; } data->membase = ioremap(res.start, size); if (!data->membase) { ret = -ENOMEM; goto err_alloc; } spin_lock_init(&data->lock); data->rcdev.owner = THIS_MODULE; data->rcdev.nr_resets = size * 8; data->rcdev.ops = &reset_simple_ops; data->rcdev.of_node = np; data->active_low = true; return reset_controller_register(&data->rcdev); err_alloc: kfree(data); return ret; }; /* * These are the reset controller we need to initialize early on in * our system, before we can even think of using a regular device * driver for it. * The controllers that we can register through the regular device * model are handled by the simple reset driver directly. */ static const struct of_device_id sunxi_early_reset_dt_ids[] __initconst = { { .compatible = "allwinner,sun6i-a31-ahb1-reset", }, { /* sentinel */ }, }; void __init sun6i_reset_init(void) { struct device_node *np; for_each_matching_node(np, sunxi_early_reset_dt_ids) sunxi_reset_init(np); }
/* arch/arm/mach-msm/include/mach/board_taoshan.h * * Copyright (C) 2014 CyanogenMod * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef __ASM_ARCH_MSM_BOARD_TAOSHAN_H #define __ASM_ARCH_MSM_BOARD_TAOSHAN_H #ifdef CONFIG_ANDROID_PERSISTENT_RAM #define TAOSHAN_PERSISTENT_RAM_SIZE (SZ_1M) #endif #ifdef CONFIG_ANDROID_RAM_CONSOLE #define TAOSHAN_RAM_CONSOLE_SIZE (124*SZ_1K * 2) #endif void __init taoshan_reserve(void); #ifdef CONFIG_ANDROID_PERSISTENT_RAM void __init taoshan_add_persistent_ram(void); #else static inline void __init taoshan_add_persistent_ram(void) { /* empty */ } #endif #ifdef CONFIG_ANDROID_RAM_CONSOLE void __init taoshan_add_ramconsole_devices(void); #else static inline void __init taoshan_add_ramconsole_devices(void) { /* empty */ } #endif #endif // __ASM_ARCH_MSM_BOARD_TAOSHAN_H
/* * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVUTIL_CRC_H #define AVUTIL_CRC_H #ifdef __GNUC__ #include <stdint.h> #endif #include <stddef.h> #include "common.h" typedef uint32_t AVCRC; typedef enum { AV_CRC_8_ATM, AV_CRC_16_ANSI, AV_CRC_16_CCITT, AV_CRC_32_IEEE, AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */ AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */ }AVCRCId; int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size); const AVCRC *av_crc_get_table(AVCRCId crc_id); uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) av_pure; #endif /* AVUTIL_CRC_H */
/* mbed Microcontroller Library * Copyright (c) 2014, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "mbed_assert.h" #include "analogout_api.h" #if DEVICE_ANALOGOUT #include "cmsis.h" #include "pinmap.h" #include "mbed_error.h" #include "PeripheralPins.h" // These variables are used for the "free" function static int pa4_used = 0; static int pa5_used = 0; void analogout_init(dac_t *obj, PinName pin) { DAC_ChannelConfTypeDef sConfig = {0}; // Get the peripheral name (DAC_1, ...) from the pin and assign it to the object obj->dac = (DACName)pinmap_peripheral(pin, PinMap_DAC); MBED_ASSERT(obj->dac != (DACName)NC); // Get the pin function and assign the used channel to the object uint32_t function = pinmap_function(pin, PinMap_DAC); switch (STM_PIN_CHANNEL(function)) { case 1: obj->channel = DAC_CHANNEL_1; break; #if defined(DAC_CHANNEL_2) case 2: obj->channel = DAC_CHANNEL_2; break; #endif default: error("Unknown DAC channel"); break; } // Configure GPIO pinmap_pinout(pin, PinMap_DAC); // Save the channel for future use obj->pin = pin; obj->handle.Instance = DAC; obj->handle.State = HAL_DAC_STATE_RESET; if (HAL_DAC_Init(&obj->handle) != HAL_OK) { error("HAL_DAC_Init failed"); } // Enable DAC clock __DAC_CLK_ENABLE(); // Configure DAC sConfig.DAC_Trigger = DAC_TRIGGER_NONE; sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE; if (pin == PA_4) { pa4_used = 1; } else { // PA_5 pa5_used = 1; } if (HAL_DAC_ConfigChannel(&obj->handle, &sConfig, obj->channel) != HAL_OK) { error("Cannot configure DAC channel\n"); } analogout_write_u16(obj, 0); } void analogout_free(dac_t *obj) { // Reset DAC and disable clock if (obj->pin == PA_4) { pa4_used = 0; } if (obj->pin == PA_5) { pa5_used = 0; } if ((pa4_used == 0) && (pa5_used == 0)) { __DAC_FORCE_RESET(); __DAC_RELEASE_RESET(); __DAC_CLK_DISABLE(); } // Configure GPIO pin_function(obj->pin, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)); } const PinMap *analogout_pinmap() { return PinMap_DAC; } #endif // DEVICE_ANALOGOUT
/****************************************************************************** Copyright (c) 2007-2011, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ #include "bid_trans.h" BID_TYPE0_FUNCTION_ARGTYPE1(BID_UINT64, bid64_tanh, BID_UINT64, x) // Declare local variables BID_UINT64 res; BID_F80_TYPE xd, yd; // Check for NaN and just return the same NaN, quieted and canonized if ((x & NAN_MASK64) == NAN_MASK64) { #ifdef BID_SET_STATUS_FLAGS if ((x & SNAN_MASK64) == SNAN_MASK64) __set_status_flags (pfpsf, BID_INVALID_EXCEPTION); #endif res = x & 0xfc03ffffffffffffull; if ((res & 0x0003ffffffffffffull) > 999999999999999ull) res &= ~0x0003ffffffffffffull; BID_RETURN(res); } // Otherwise just do the operation "naively". // We inherit the tanh([-]inf) = [-]1 case from the binary function // rather than having a special case for it. BIDECIMAL_CALL1(bid64_to_binary80,xd,x); __bid_f80_tanh( yd, xd ); BIDECIMAL_CALL1(binary80_to_bid64,res,yd); BID_RETURN (res); }
/***************************************************************************** Copyright (c) 2011, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************** * Contents: Native high-level C interface to LAPACK function dlarfb * Author: Intel Corporation * Generated November, 2011 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_dlarfb( int matrix_order, char side, char trans, char direct, char storev, lapack_int m, lapack_int n, lapack_int k, const double* v, lapack_int ldv, const double* t, lapack_int ldt, double* c, lapack_int ldc ) { lapack_int info = 0; lapack_int ldwork = ( side=='l')?n:(( side=='r')?m:1); double* work = NULL; lapack_int ncols_v, nrows_v; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_dlarfb", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ ncols_v = LAPACKE_lsame( storev, 'c' ) ? k : ( ( LAPACKE_lsame( storev, 'r' ) && LAPACKE_lsame( side, 'l' ) ) ? m : ( ( LAPACKE_lsame( storev, 'r' ) && LAPACKE_lsame( side, 'r' ) ) ? n : 1) ); nrows_v = ( LAPACKE_lsame( storev, 'c' ) && LAPACKE_lsame( side, 'l' ) ) ? m : ( ( LAPACKE_lsame( storev, 'c' ) && LAPACKE_lsame( side, 'r' ) ) ? n : ( LAPACKE_lsame( storev, 'r' ) ? k : 1) ); if( LAPACKE_dge_nancheck( matrix_order, m, n, c, ldc ) ) { return -13; } if( LAPACKE_dge_nancheck( matrix_order, k, k, t, ldt ) ) { return -11; } if( LAPACKE_lsame( storev, 'c' ) && LAPACKE_lsame( direct, 'f' ) ) { if( LAPACKE_dtr_nancheck( matrix_order, 'l', 'u', k, v, ldv ) ) return -9; if( LAPACKE_dge_nancheck( matrix_order, nrows_v-k, ncols_v, &v[k*ldv], ldv ) ) return -9; } else if( LAPACKE_lsame( storev, 'c' ) && LAPACKE_lsame( direct, 'b' ) ) { if( k > nrows_v ) { LAPACKE_xerbla( "LAPACKE_dlarfb", -8 ); return -8; } if( LAPACKE_dtr_nancheck( matrix_order, 'u', 'u', k, &v[(nrows_v-k)*ldv], ldv ) ) return -9; if( LAPACKE_dge_nancheck( matrix_order, nrows_v-k, ncols_v, v, ldv ) ) return -9; } else if( LAPACKE_lsame( storev, 'r' ) && LAPACKE_lsame( direct, 'f' ) ) { if( LAPACKE_dtr_nancheck( matrix_order, 'u', 'u', k, v, ldv ) ) return -9; if( LAPACKE_dge_nancheck( matrix_order, nrows_v, ncols_v-k, &v[k], ldv ) ) return -9; } else if( LAPACKE_lsame( storev, 'r' ) && LAPACKE_lsame( direct, 'f' ) ) { if( k > ncols_v ) { LAPACKE_xerbla( "LAPACKE_dlarfb", -8 ); return -8; } if( LAPACKE_dtr_nancheck( matrix_order, 'l', 'u', k, &v[ncols_v-k], ldv ) ) return -9; if( LAPACKE_dge_nancheck( matrix_order, nrows_v, ncols_v-k, v, ldv ) ) return -9; } #endif /* Allocate memory for working array(s) */ work = (double*)LAPACKE_malloc( sizeof(double) * ldwork * MAX(1,k) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_dlarfb_work( matrix_order, side, trans, direct, storev, m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_dlarfb", info ); } return info; }
#include "tpd.h" unsigned long TPD_RES_X = 480; unsigned long TPD_RES_Y = 800; /* #if (defined(TPD_HAVE_CALIBRATION) && !defined(TPD_CUSTOM_CALIBRATION)) */ int tpd_calmat[8] = { 0 }; int tpd_def_calmat[8] = { 0 }; int tpd_calmat_size = 8; int tpd_def_calmat_size = 8; module_param_array(tpd_calmat, int, &tpd_calmat_size, 0664); module_param_array(tpd_def_calmat, int, &tpd_def_calmat_size, 0444); /* #endif */ /* #ifdef TPD_TYPE_CAPACITIVE */ int tpd_type_cap = 0; int tpd_v_magnify_x = 10; int tpd_v_magnify_y = 10; module_param(tpd_v_magnify_x, int, 0664); module_param(tpd_v_magnify_y, int, 0664); module_param(tpd_type_cap, int, 0444); int tpd_firmware_version[2] = { 0, 0 }; int tpd_firmware_version_size = 2; module_param_array(tpd_firmware_version, int, &tpd_firmware_version_size, 0444); int tpd_mode = TPD_MODE_NORMAL; int tpd_mode_axis = 0; int tpd_mode_min = 400; /* TPD_RES_Y/2; */ int tpd_mode_max = 800; /* TPD_RES_Y; */ int tpd_mode_keypad_tolerance = 480 * 480 / 1600; /* TPD_RES_X*TPD_RES_X/1600; */ module_param(tpd_mode, int, 0664); module_param(tpd_mode_axis, int, 0664); module_param(tpd_mode_min, int, 0664); module_param(tpd_mode_max, int, 0664); module_param(tpd_mode_keypad_tolerance, int, 0664); /* ATTENTION! all the default values should sync with tpd_adc_init()@tpd_adc.c */ int tpd_em_debounce_time0 = 1; int tpd_em_debounce_time = 0; int tpd_em_debounce_time1 = 4; module_param(tpd_em_debounce_time0, int, 0664); module_param(tpd_em_debounce_time1, int, 0664); module_param(tpd_em_debounce_time, int, 0664); int tpd_em_spl_num = 1; module_param(tpd_em_spl_num, int, 0664); int tpd_em_pressure_threshold = 0; module_param(tpd_em_pressure_threshold, int, 0664); int tpd_em_auto_time_interval = 10; module_param(tpd_em_auto_time_interval, int, 0664); int tpd_em_sample_cnt = 16; module_param(tpd_em_sample_cnt, int, 0664); int tpd_load_status = 0; module_param(tpd_load_status, int, 0664); int tpd_em_asamp = 1; module_param(tpd_em_asamp, int, 0664);
/* Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <aio.h> #include <errno.h> #include <signal.h> #include <gai_misc.h> int __gai_sigqueue (sig, val, caller_pid) int sig; const union sigval val; pid_t caller_pid; { __set_errno (ENOSYS); return -1; } stub_warning (__gai_sigqueue)
#ifndef _MTK_TS_SETTING_H #define _MTK_TS_SETTING_H /*============================================================= * CONFIG (SW related) *=============================================================*/ /* mtk_ts_pa.c */ /* 1: turn on MD UL throughput update; 0: turn off */ #define Feature_Thro_update (0) #endif /* _MTK_TS_SETTING_H */
/* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2014 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. * * PCSX2 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 PCSX2. * If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <wx/wx.h> #include "DebugTools/DebugInterface.h" #include "DebugTools/Breakpoints.h" class BreakpointWindow : public wxDialog { public: BreakpointWindow( wxWindow* parent, DebugInterface* _cpu ); void loadFromMemcheck(MemCheck& memcheck); void loadFromBreakpoint(BreakPoint& breakpoint); void initBreakpoint(u32 _address); void addBreakpoint(); DECLARE_EVENT_TABLE() protected: void onRadioChange(wxCommandEvent& evt); void onButtonOk(wxCommandEvent& evt); private: void setDefaultValues(); bool fetchDialogData(); DebugInterface* cpu; wxTextCtrl* editAddress; wxTextCtrl* editSize; wxRadioButton* radioMemory; wxRadioButton* radioExecute; wxCheckBox* checkRead; wxCheckBox* checkWrite; wxCheckBox* checkOnChange; wxTextCtrl* editCondition; wxCheckBox* checkEnabled; wxCheckBox* checkLog; wxButton* buttonOk; wxButton* buttonCancel; bool memory; bool read; bool write; bool enabled; bool log; bool onChange; u32 address; u32 size; char condition[128]; PostfixExpression compiledCondition; };
/**************************************************************************** * * Copyright 2017 Samsung Electronics All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * ****************************************************************************/ /* * FIPS 180-2 SHA-224/256/384/512 implementation * Last update: 02/02/2007 * Issue date: 04/30/2005 * * Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project 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 PROJECT 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 PROJECT 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. */ /* * Chul Lee(chuls.lee@samsung.com)'s posting: * Modification for naming confilct. * Attach prefix 'SS_' for all function and constants. * Change name of data context to 'SS_SHAxxxContext' (xxx is bit length of digest) */ #ifndef SHA2_H #define SHA2_H #define SS_SHA224_DIGEST_SIZE (224 / 8) #define SS_SHA256_DIGEST_SIZE (256 / 8) #define SS_SHA384_DIGEST_SIZE (384 / 8) #define SS_SHA512_DIGEST_SIZE (512 / 8) #define SS_SHA256_BLOCK_SIZE (512 / 8) #define SS_SHA512_BLOCK_SIZE (1024 / 8) #define SS_SHA384_BLOCK_SIZE SS_SHA512_BLOCK_SIZE #define SS_SHA224_BLOCK_SIZE SS_SHA256_BLOCK_SIZE #ifndef SHA2_TYPES #define SHA2_TYPES typedef unsigned char uint8; typedef unsigned int uint32; typedef unsigned long long uint64; #endif #ifdef __cplusplus extern "C" { #endif typedef struct { unsigned int tot_len; unsigned int len; unsigned char block[2 * SS_SHA256_BLOCK_SIZE]; uint32 h[8]; } ss_sha256_ctx; typedef struct { unsigned int tot_len; unsigned int len; unsigned char block[2 * SS_SHA512_BLOCK_SIZE]; uint64 h[8]; } ss_sha512_ctx; typedef ss_sha512_ctx ss_sha384_ctx; typedef ss_sha256_ctx ss_sha224_ctx; void ss_sha224_init(ss_sha224_ctx *ctx); void ss_sha224_update(ss_sha224_ctx *ctx, const unsigned char *message, unsigned int len); void ss_sha224_final(ss_sha224_ctx *ctx, unsigned char *digest); void ss_sha224(const unsigned char *message, unsigned int len, unsigned char *digest); void ss_sha256_init(ss_sha256_ctx *ctx); void ss_sha256_update(ss_sha256_ctx *ctx, const unsigned char *message, unsigned int len); void ss_sha256_final(ss_sha256_ctx *ctx, unsigned char *digest); void ss_sha256(const unsigned char *message, unsigned int len, unsigned char *digest); void ss_sha384_init(ss_sha384_ctx *ctx); void ss_sha384_update(ss_sha384_ctx *ctx, const unsigned char *message, unsigned int len); void ss_sha384_final(ss_sha384_ctx *ctx, unsigned char *digest); void ss_sha384(const unsigned char *message, unsigned int len, unsigned char *digest); void ss_sha512_init(ss_sha512_ctx *ctx); void ss_sha512_update(ss_sha512_ctx *ctx, const unsigned char *message, unsigned int len); void ss_sha512_final(ss_sha512_ctx *ctx, unsigned char *digest); void ss_sha512(const unsigned char *message, unsigned int len, unsigned char *digest); #ifdef __cplusplus } #endif #endif /* !SHA2_H */
/* include/linux/wakelock.h * * Copyright (C) 2007-2008 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _LINUX_WAKELOCK_H #define _LINUX_WAKELOCK_H #include <linux/list.h> #include <linux/ktime.h> /* A wake_lock prevents the system from entering suspend or other low power * states when active. If the type is set to WAKE_LOCK_SUSPEND, the wake_lock * prevents a full system suspend. If the type is WAKE_LOCK_IDLE, low power * states that cause large interrupt latencies or that disable a set of * interrupts will not entered from idle until the wake_locks are released. */ enum { WAKE_LOCK_SUSPEND, /* Prevent suspend */ WAKE_LOCK_IDLE, /* Prevent low power idle */ WAKE_LOCK_TYPE_COUNT }; struct wake_lock { struct list_head link; int flags; const char *name; unsigned long expires; #ifdef CONFIG_WAKELOCK_STAT struct { int count; int expire_count; int wakeup_count; ktime_t total_time; ktime_t prevent_suspend_time; ktime_t max_time; ktime_t last_time; ktime_t last_unlock_time; ktime_t background_locked_time; } stat; #endif }; #ifdef CONFIG_HAS_WAKELOCK void wake_lock_init(struct wake_lock *lock, int type, const char *name); void wake_lock_destroy(struct wake_lock *lock); void wake_lock(struct wake_lock *lock); void wake_lock_timeout(struct wake_lock *lock, long timeout); void wake_unlock(struct wake_lock *lock); /* wake_lock_active returns a non-zero value if the wake_lock is currently * locked. If the wake_lock has a timeout, it does not check the timeout * but if the timeout had aready been checked it will return 0. */ int wake_lock_active(struct wake_lock *lock); /* has_wake_lock returns 0 if no wake locks of the specified type are active, * and non-zero if one or more wake locks are held. Specifically it returns * -1 if one or more wake locks with no timeout are active or the * number of jiffies until all active wake locks time out. */ long has_wake_lock(int type); #ifdef CONFIG_PM_DEBUG void print_active_locks(int type); #endif #else static inline void wake_lock_init(struct wake_lock *lock, int type, const char *name) {} static inline void wake_lock_destroy(struct wake_lock *lock) {} static inline void wake_lock(struct wake_lock *lock) {} static inline void wake_lock_timeout(struct wake_lock *lock, long timeout) {} static inline void wake_unlock(struct wake_lock *lock) {} static inline int wake_lock_active(struct wake_lock *lock) { return 0; } static inline long has_wake_lock(int type) { return 0; } #ifdef CONFIG_PM_DEBUG static inline void print_active_locks(int type) {} #endif #endif #endif
/* * Copyright (c) 2013-2018, Arm Limited and affiliates. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TLS_LIB_H_ #define TLS_LIB_H_ #include "Security/Common/sec_lib_definitions.h" extern tls_session_t *amr_tls_session_allocate(void); extern void arm_tls_session_clear(tls_session_t *t_session); extern void tls_finnish_copy(uint8_t *ptr, tls_heap_t *heap_ptr); extern void tls_alert_build(buffer_t *buf, uint8_t alert); extern void tls_prepare_change_chipher_spec(sec_suite_t *tls_suite); extern void tls_build_client_change_chipher_suite_finnish(buffer_t *buf, sec_suite_t *tls_suite); #ifdef PANA_SERVER_API extern void tls_server_hello_build(buffer_t *buf, sec_suite_t *tls_suite); #endif extern void tls_key_expansion_cal(tls_heap_t *heap_ptr, uint8_t *key_save_ptr, uint8_t *master_secret); extern void tls_master_key_cal(tls_heap_t *heap_ptr, sec_suite_t *tls_suite); extern void tls_verify_calc(uint8_t output[12], uint8_t server, tls_heap_t *heap_ptr, uint8_t *master_secret); extern void tls_hanshake_hash_cal(tls_heap_t *heap_ptr); extern void tls_handshake_copy(tls_msg_t *tls_msg_ptr, tls_heap_t *heap_ptr); extern uint8_t tls_txt_analyze(buffer_t *buf); extern tls_header_t *tls_message_get(uint8_t *dptr); extern uint8_t tls_msg_analyzy(uint8_t *ptr, uint16_t data_len); extern tls_msg_t *tls_msg_get(uint8_t *dptr); extern tls_msg_t *tls_msg_ptr_get(void); extern buffer_t *tls_client_up(buffer_t *buf, sec_suite_t *tls_suite); extern buffer_t *tls_server_up(buffer_t *buf, sec_suite_t *tls_suite); extern buffer_t *tls_client_hello_build(buffer_t *buf, sec_suite_t *tls_suite); extern void tls_build_client_verify_payload(tls_heap_t *tls_heap); extern uint8_t *tls_build_change_chipher_suite_finnish_msg(uint8_t *ptr, tls_session_t *tls_session); extern uint8_t *tls_build_server_hello_msg(uint8_t *ptr, tls_session_t *tls_session); extern void tls_session_id_genrate(uint8_t *suite, uint8_t length); #ifdef ECC extern uint8_t *tls_client_key_exchange_msg_set(uint8_t *ptr, tls_heap_t *heap_ptr); extern void tls_ecc_point_reverse_order(uint8_t *dst, uint8_t *src); extern uint8_t *tls_server_key_excahnge_msg_build(uint8_t *ptr, tls_heap_t *heap_ptr); extern uint8_t *tls_certificate_verify_msg_set(uint8_t *ptr, tls_heap_t *heap_ptr); extern uint8_t *tls_certificate_msg_set(uint8_t *ptr, certificate_chain_internal_t *temp); extern void tls_ecc_heap_free(tls_heap_t *heap_ptr); #else #define tls_ecc_heap_free(heap_ptr) ((void) 0) #endif extern void tls_header_set(buffer_t *buf); extern tls_heap_t *tls_heap_allocate(void); extern void tls_heap_free(tls_heap_t *heap_ptr); extern uint8_t tls_get_leading_zeros(void *data); #ifdef ECC extern void tls_read_certi_signature(tls_heap_t *theap, uint8_t certificate); extern void tls_ecc_server_key_signature_hash(tls_heap_t *heap_ptr); extern uint16_t tls_certificate_len(certificate_chain_internal_t *temp); extern void tls_ecc_verfify_start(sec_suite_t *tls_suite); extern void tls_server_finnish_handle_start(sec_suite_t *tls_suite); extern void tls_parse_subject_get_pub_key_from_chain(tls_heap_t *theap, uint8_t rd_ptr); extern void tls_certificate_signature_verify(sec_suite_t *tls_suite); #endif //extern uint16_t tls_server_hello_req_len(tls_heap_t *heap_ptr); extern void tls_nonce_update(uint8_t *ptr); #endif /* TLS_LIB_H_ */
// Copyright 2016-present the Material Components for iOS authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #import "MDCSnackbarAlignment.h" #import "MDCSnackbarManager.h" #import "MDCSnackbarMessage.h" #import "MDCSnackbarMessageView.h"
/* * Copyright (c) 2016-2018, Arm Limited and affiliates. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef BEACON_HANDLER_H #define BEACON_HANDLER_H #include <inttypes.h> #include "net_interface.h" // 1 byte for protocol id, 1 byte for accept join, 16 bytes for network id #define PLAIN_BEACON_PAYLOAD_SIZE (1 + 1 + sizeof((border_router_setup_s *)0)->network_id) #define BEACON_OPTION_END_DELIMITER 0x00 #define BEACON_OPTION_JOIN_PRIORITY_TYPE 0x0c #define BEACON_OPTION_JOIN_PRIORITY_VAL_LEN 0x01 #define BEACON_OPTION_JOIN_PRIORITY_LEN 0x02 #define BEACON_OPTION_JOIN_PRIORITY_TYPE_LEN 0xc1 struct mlme_beacon_ind_s; void beacon_received(int8_t if_id, const struct mlme_beacon_ind_s *data); void beacon_optional_tlv_fields_skip(uint16_t *len, uint8_t **ptr, uint8_t offset); /* Beacon */ int8_t mac_beacon_link_beacon_compare_rx_callback_set(int8_t interface_id, beacon_compare_rx_cb *beacon_compare_rx_cb_ptr); int8_t mac_beacon_link_beacon_join_priority_tx_callback_set(int8_t interface_id, beacon_join_priority_tx_cb *beacon_join_priority_tx_cb_ptr); void beacon_join_priority_update(int8_t interface_id); //TODO: beacon storage here if needed by 6loWPAN? #endif // BEACON_HANDLER_H
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QERRORMESSAGE_H #define QERRORMESSAGE_H #include <QtGui/qdialog.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Gui) #ifndef QT_NO_ERRORMESSAGE class QErrorMessagePrivate; class Q_GUI_EXPORT QErrorMessage: public QDialog { Q_OBJECT Q_DECLARE_PRIVATE(QErrorMessage) public: explicit QErrorMessage(QWidget* parent = 0); ~QErrorMessage(); static QErrorMessage * qtHandler(); public Q_SLOTS: void showMessage(const QString &message); void showMessage(const QString &message, const QString &type); #ifdef QT3_SUPPORT inline QT_MOC_COMPAT void message(const QString &text) { showMessage(text); } #endif protected: void done(int); void changeEvent(QEvent *e); private: Q_DISABLE_COPY(QErrorMessage) }; #endif // QT_NO_ERRORMESSAGE QT_END_NAMESPACE QT_END_HEADER #endif // QERRORMESSAGE_H
/* Copyright (C) 2003-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <dlfcn.h> #include <errno.h> #include <pthread.h> #include <signal.h> #include <semaphore.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthreaddef.h> #define THE_SIG SIGUSR1 #define N 10 static pthread_t th[N]; #define CB(n) \ static void \ cb##n (void) \ { \ if (th[n] != pthread_self ()) \ { \ write (STDOUT_FILENO, "wrong callback\n", 15); \ _exit (1); \ } \ } CB (0) CB (1) CB (2) CB (3) CB (4) CB (5) CB (6) CB (7) CB (8) CB (9) static void (*cbs[]) (void) = { cb0, cb1, cb2, cb3, cb4, cb5, cb6, cb7, cb8, cb9 }; sem_t s; pthread_barrier_t b; #define TOTAL_SIGS 1000 int nsigs; int do_test (void) { if ((uintptr_t) pthread_self () & (TCB_ALIGNMENT - 1)) { puts ("initial thread's struct pthread not aligned enough"); exit (1); } if (pthread_barrier_init (&b, NULL, N + 1) != 0) { puts ("barrier_init failed"); exit (1); } if (sem_init (&s, 0, 0) != 0) { puts ("sem_init failed"); exit (1); } void *h = dlopen ("tst-tls3mod.so", RTLD_LAZY); if (h == NULL) { puts ("dlopen failed"); exit (1); } void *(*tf) (void *) = dlsym (h, "tf"); if (tf == NULL) { puts ("dlsym for tf failed"); exit (1); } struct sigaction sa; sa.sa_handler = dlsym (h, "handler"); if (sa.sa_handler == NULL) { puts ("dlsym for handler failed"); exit (1); } sigemptyset (&sa.sa_mask); sa.sa_flags = 0; if (sigaction (THE_SIG, &sa, NULL) != 0) { puts ("sigaction failed"); exit (1); } pthread_attr_t a; if (pthread_attr_init (&a) != 0) { puts ("attr_init failed"); exit (1); } if (pthread_attr_setstacksize (&a, 1 * 1024 * 1024) != 0) { puts ("attr_setstacksize failed"); return 1; } int r; for (r = 0; r < 10; ++r) { int i; for (i = 0; i < N; ++i) if (pthread_create (&th[i], &a, tf, cbs[i]) != 0) { puts ("pthread_create failed"); exit (1); } nsigs = 0; pthread_barrier_wait (&b); sigset_t ss; sigemptyset (&ss); sigaddset (&ss, THE_SIG); if (pthread_sigmask (SIG_BLOCK, &ss, NULL) != 0) { puts ("pthread_sigmask failed"); exit (1); } /* Start sending signals. */ for (i = 0; i < TOTAL_SIGS; ++i) { if (kill (getpid (), THE_SIG) != 0) { puts ("kill failed"); exit (1); } if (TEMP_FAILURE_RETRY (sem_wait (&s)) != 0) { puts ("sem_wait failed"); exit (1); } ++nsigs; } pthread_barrier_wait (&b); if (pthread_sigmask (SIG_UNBLOCK, &ss, NULL) != 0) { puts ("pthread_sigmask failed"); exit (1); } for (i = 0; i < N; ++i) if (pthread_join (th[i], NULL) != 0) { puts ("join failed"); exit (1); } } if (pthread_attr_destroy (&a) != 0) { puts ("attr_destroy failed"); exit (1); } return 0; } #define TIMEOUT 5 #define TEST_FUNCTION do_test () #include "../test-skeleton.c"
#ifndef _CAMERA_FEATURE_UTILITY_H_ #define _CAMERA_FEATURE_UTILITY_H_ namespace NSFeature { //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Generic Utility (Loki) //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ template <MUINT32 v> struct Int2Type { enum { value = v }; }; template<MBOOL> struct CompileTimeError; template<> struct CompileTimeError<MTRUE> {}; #define STATIC_CHECK(expr, msg) \ { CompileTimeError<((expr) != 0)> ERROR_##msg; (void)ERROR_##msg; } template <MBOOL _isT1, typename T1, typename T2> struct SelectType { typedef T1 Type; }; template <typename T1, typename T2> struct SelectType<MFALSE, T1, T2> { typedef T2 Type; }; //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Enumeration for subitems supported by a given Featrue ID. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ template <MUINT32 _fid> struct Fid2Type{}; #undef FTYPE_ENUM #undef FID_TO_TYPE_ENUM #define FTYPE_ENUM(_enums...) _enums #define FID_TO_TYPE_ENUM(_fid, _enums) \ typedef enum { _enums, OVER_NUM_OF_##_fid } _fid##_T; \ template <> \ struct Fid2Type<_fid> \ { \ typedef _fid##_T Type; \ typedef FidInfo<_fid> Info; \ enum \ { \ Num = (OVER_NUM_OF_##_fid - 1), \ }; \ }; \ typedef _fid##_T }; // namespace NSFeature #endif // _CAMERA_FEATURE_UTILITY_H_
/* Test RE_HAT_LISTS_NOT_NEWLINE and RE_DOT_NEWLINE. Copyright (C) 2007-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2007. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <regex.h> #include <stdio.h> #include <string.h> struct tests { const char *regex; const char *string; reg_syntax_t syntax; int retval; } tests[] = { #define EGREP RE_SYNTAX_EGREP #define EGREP_NL (RE_SYNTAX_EGREP | RE_DOT_NEWLINE) & ~RE_HAT_LISTS_NOT_NEWLINE { "a.b", "a\nb", EGREP, -1 }, { "a.b", "a\nb", EGREP_NL, 0 }, { "a[^x]b", "a\nb", EGREP, -1 }, { "a[^x]b", "a\nb", EGREP_NL, 0 }, /* While \S and \W are internally handled as [^[:space:]] and [^[:alnum:]_], RE_HAT_LISTS_NOT_NEWLINE did not make any difference, so ensure it doesn't change. */ { "a\\Sb", "a\nb", EGREP, -1 }, { "a\\Sb", "a\nb", EGREP_NL, -1 }, { "a\\Wb", "a\nb", EGREP, 0 }, { "a\\Wb", "a\nb", EGREP_NL, 0 } }; int main (void) { struct re_pattern_buffer r; size_t i; int ret = 0; for (i = 0; i < sizeof (tests) / sizeof (tests[i]); ++i) { re_set_syntax (tests[i].syntax); memset (&r, 0, sizeof (r)); if (re_compile_pattern (tests[i].regex, strlen (tests[i].regex), &r)) { printf ("re_compile_pattern %zd failed\n", i); ret = 1; continue; } size_t len = strlen (tests[i].string); int rv = re_search (&r, tests[i].string, len, 0, len, NULL); if (rv != tests[i].retval) { printf ("re_search %zd unexpected value %d != %d\n", i, rv, tests[i].retval); ret = 1; } regfree (&r); } return ret; }
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <errno.h> #include <semaphore.h> #include <stdio.h> #include <time.h> #include <unistd.h> #include <sys/time.h> static int do_test (void) { sem_t s; struct timespec ts; struct timeval tv; if (sem_init (&s, 0, 1) == -1) { puts ("sem_init failed"); return 1; } if (TEMP_FAILURE_RETRY (sem_wait (&s)) == -1) { puts ("sem_wait failed"); return 1; } if (gettimeofday (&tv, NULL) != 0) { puts ("gettimeofday failed"); return 1; } TIMEVAL_TO_TIMESPEC (&tv, &ts); /* We wait for half a second. */ ts.tv_nsec += 500000000; if (ts.tv_nsec >= 1000000000) { ++ts.tv_sec; ts.tv_nsec -= 1000000000; } errno = 0; if (TEMP_FAILURE_RETRY (sem_timedwait (&s, &ts)) != -1) { puts ("sem_timedwait succeeded"); return 1; } if (errno != ETIMEDOUT) { printf ("sem_timedwait return errno = %d instead of ETIMEDOUT\n", errno); return 1; } return 0; } #define TEST_FUNCTION do_test () #include "../test-skeleton.c"
/* * Copyright (C) 2012 Spreadtrum Communications Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef _DCAM_SERVICE_H_ #define _DCAM_SERVICE_H_ #include "sensor_drv.h" #include "jpeg_exif_header_k.h" #include "dc_cfg.h" #include "../sc8810/dcam_service_sc8810.h" #define DCAM_V4L2_PRINT pr_debug #define DCAM_V4L2_ERR printk #endif
/* $NoKeywords:$ */ /** * @file * * AMD Family_10 NB COF VID Initialization * * @xrefitem bom "File Content Label" "Release Content" * @e project: AGESA * @e sub-project: CPU/F10 * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 2010) $ * */ /* ****************************************************************************** * * Copyright (c) 2011, Advanced Micro Devices, 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 Advanced Micro Devices, 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 ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ****************************************************************************** */ #ifndef _CPU_F10_PM_NB_COF_VID_INIT_H_ #define _CPU_F10_PM_NB_COF_VID_INIT_H_ /*--------------------------------------------------------------------------------------- * M I X E D (Definitions And Macros / Typedefs, Structures, Enums) *--------------------------------------------------------------------------------------- */ /*--------------------------------------------------------------------------------------- * D E F I N I T I O N S A N D M A C R O S *--------------------------------------------------------------------------------------- */ /*--------------------------------------------------------------------------------------- * T Y P E D E F S, S T R U C T U R E S, E N U M S *--------------------------------------------------------------------------------------- */ /*--------------------------------------------------------------------------------------- * F U N C T I O N P R O T O T Y P E *--------------------------------------------------------------------------------------- */ VOID F10PmNbCofVidInit ( IN CPU_SPECIFIC_SERVICES *FamilySpecificServices, IN AMD_CPU_EARLY_PARAMS *CpuEarlyParamsPtr, IN AMD_CONFIG_PARAMS *StdHeader ); #endif // _CPU_F10_PM_NB_COF_VID_INIT_H_
// license:BSD-3-Clause // copyright-holders:Nicola Salmoria #ifndef MAME_INCLUDES_M52_H #define MAME_INCLUDES_M52_H #pragma once #include "emupal.h" #include "screen.h" #include "tilemap.h" class m52_state : public driver_device { public: m52_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), m_spriteram(*this, "spriteram"), m_sp_gfxdecode(*this, "sp_gfxdecode"), m_tx_gfxdecode(*this, "tx_gfxdecode"), m_bg_gfxdecode(*this, "bg_gfxdecode"), m_sp_palette(*this, "sp_palette"), m_tx_palette(*this, "tx_palette"), m_bg_palette(*this, "bg_palette") { } void m52(machine_config &config); void m52_videoram_w(offs_t offset, uint8_t data); void m52_colorram_w(offs_t offset, uint8_t data); uint8_t m52_protection_r(); protected: virtual void machine_reset() override; virtual void video_start() override; virtual void m52_scroll_w(uint8_t data); /* board mod changes? */ int m_spritelimit; bool m_do_bg_fills; tilemap_t* m_tx_tilemap; required_device<cpu_device> m_maincpu; required_device<screen_device> m_screen; private: /* memory pointers */ required_shared_ptr<uint8_t> m_videoram; required_shared_ptr<uint8_t> m_colorram; optional_shared_ptr<uint8_t> m_spriteram; /* video-related */ uint8_t m_bg1xpos; uint8_t m_bg1ypos; uint8_t m_bg2xpos; uint8_t m_bg2ypos; uint8_t m_bgcontrol; required_device<gfxdecode_device> m_sp_gfxdecode; required_device<gfxdecode_device> m_tx_gfxdecode; required_device<gfxdecode_device> m_bg_gfxdecode; required_device<palette_device> m_sp_palette; required_device<palette_device> m_tx_palette; required_device<palette_device> m_bg_palette; void m52_bg1ypos_w(uint8_t data); void m52_bg1xpos_w(uint8_t data); void m52_bg2xpos_w(uint8_t data); void m52_bg2ypos_w(uint8_t data); void m52_bgcontrol_w(uint8_t data); void m52_flipscreen_w(uint8_t data); TILE_GET_INFO_MEMBER(get_tile_info); void init_palette(); template <size_t N, size_t O, size_t P> void init_sprite_palette(const int *resistances_3, const int *resistances_2, double (&weights_r)[N], double (&weights_g)[O], double (&weights_b)[P], double scale); uint32_t screen_update_m52(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect, int xpos, int ypos, int image); void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int initoffs); void main_map(address_map &map); void main_portmap(address_map &map); }; class m52_alpha1v_state : public m52_state { public: m52_alpha1v_state(const machine_config &mconfig, device_type type, const char *tag) : m52_state(mconfig, type, tag) { } void alpha1v(machine_config &config); void alpha1v_map(address_map &map); protected: virtual void video_start() override; virtual void m52_scroll_w(uint8_t data) override; void alpha1v_flipscreen_w(uint8_t data); }; #endif // MAME_INCLUDES_M52_H
// SPDX-License-Identifier: GPL-2.0-only #include <errno.h> #include <stdbool.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <linux/err.h> #include <linux/in.h> #include <linux/in6.h> #include "bpf_util.h" #include "network_helpers.h" #define clean_errno() (errno == 0 ? "None" : strerror(errno)) #define log_err(MSG, ...) ({ \ int __save = errno; \ fprintf(stderr, "(%s:%d: errno: %s) " MSG "\n", \ __FILE__, __LINE__, clean_errno(), \ ##__VA_ARGS__); \ errno = __save; \ }) struct ipv4_packet pkt_v4 = { .eth.h_proto = __bpf_constant_htons(ETH_P_IP), .iph.ihl = 5, .iph.protocol = IPPROTO_TCP, .iph.tot_len = __bpf_constant_htons(MAGIC_BYTES), .tcp.urg_ptr = 123, .tcp.doff = 5, }; struct ipv6_packet pkt_v6 = { .eth.h_proto = __bpf_constant_htons(ETH_P_IPV6), .iph.nexthdr = IPPROTO_TCP, .iph.payload_len = __bpf_constant_htons(MAGIC_BYTES), .tcp.urg_ptr = 123, .tcp.doff = 5, }; static int settimeo(int fd, int timeout_ms) { struct timeval timeout = { .tv_sec = 3 }; if (timeout_ms > 0) { timeout.tv_sec = timeout_ms / 1000; timeout.tv_usec = (timeout_ms % 1000) * 1000; } if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout))) { log_err("Failed to set SO_RCVTIMEO"); return -1; } if (setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout))) { log_err("Failed to set SO_SNDTIMEO"); return -1; } return 0; } #define save_errno_close(fd) ({ int __save = errno; close(fd); errno = __save; }) int start_server(int family, int type, const char *addr_str, __u16 port, int timeout_ms) { struct sockaddr_storage addr = {}; socklen_t len; int fd; if (make_sockaddr(family, addr_str, port, &addr, &len)) return -1; fd = socket(family, type, 0); if (fd < 0) { log_err("Failed to create server socket"); return -1; } if (settimeo(fd, timeout_ms)) goto error_close; if (bind(fd, (const struct sockaddr *)&addr, len) < 0) { log_err("Failed to bind socket"); goto error_close; } if (type == SOCK_STREAM) { if (listen(fd, 1) < 0) { log_err("Failed to listed on socket"); goto error_close; } } return fd; error_close: save_errno_close(fd); return -1; } static int connect_fd_to_addr(int fd, const struct sockaddr_storage *addr, socklen_t addrlen) { if (connect(fd, (const struct sockaddr *)addr, addrlen)) { log_err("Failed to connect to server"); return -1; } return 0; } int connect_to_fd(int server_fd, int timeout_ms) { struct sockaddr_storage addr; struct sockaddr_in *addr_in; socklen_t addrlen, optlen; int fd, type; optlen = sizeof(type); if (getsockopt(server_fd, SOL_SOCKET, SO_TYPE, &type, &optlen)) { log_err("getsockopt(SOL_TYPE)"); return -1; } addrlen = sizeof(addr); if (getsockname(server_fd, (struct sockaddr *)&addr, &addrlen)) { log_err("Failed to get server addr"); return -1; } addr_in = (struct sockaddr_in *)&addr; fd = socket(addr_in->sin_family, type, 0); if (fd < 0) { log_err("Failed to create client socket"); return -1; } if (settimeo(fd, timeout_ms)) goto error_close; if (connect_fd_to_addr(fd, &addr, addrlen)) goto error_close; return fd; error_close: save_errno_close(fd); return -1; } int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) { struct sockaddr_storage addr; socklen_t len = sizeof(addr); if (settimeo(client_fd, timeout_ms)) return -1; if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) { log_err("Failed to get server addr"); return -1; } if (connect_fd_to_addr(client_fd, &addr, len)) return -1; return 0; } int make_sockaddr(int family, const char *addr_str, __u16 port, struct sockaddr_storage *addr, socklen_t *len) { if (family == AF_INET) { struct sockaddr_in *sin = (void *)addr; sin->sin_family = AF_INET; sin->sin_port = htons(port); if (addr_str && inet_pton(AF_INET, addr_str, &sin->sin_addr) != 1) { log_err("inet_pton(AF_INET, %s)", addr_str); return -1; } if (len) *len = sizeof(*sin); return 0; } else if (family == AF_INET6) { struct sockaddr_in6 *sin6 = (void *)addr; sin6->sin6_family = AF_INET6; sin6->sin6_port = htons(port); if (addr_str && inet_pton(AF_INET6, addr_str, &sin6->sin6_addr) != 1) { log_err("inet_pton(AF_INET6, %s)", addr_str); return -1; } if (len) *len = sizeof(*sin6); return 0; } return -1; }
// Author: Roel Aaij 21/07/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TGSimpleTableInterface #define ROOT_TGSimpleTableInterface #include "TVirtualTableInterface.h" class TGSimpleTableInterface : public TVirtualTableInterface { private: Double_t **fData; // Pointer to 2 dimensional array of Double_t UInt_t fNRows; UInt_t fNColumns; protected: public: TGSimpleTableInterface(Double_t **data, UInt_t nrows = 2, UInt_t ncolumns = 2); virtual ~TGSimpleTableInterface(); virtual Double_t GetValue(UInt_t row, UInt_t column); virtual const char *GetValueAsString(UInt_t row, UInt_t column); virtual const char *GetRowHeader(UInt_t row); virtual const char *GetColumnHeader(UInt_t column); virtual UInt_t GetNRows() { return fNRows; } virtual UInt_t GetNColumns() { return fNColumns; } ClassDef(TGSimpleTableInterface, 0) // Interface to data in a 2D array of Double_t }; #endif
// --------------------------------------------------------------------- // // Copyright (C) 2009 - 2013 by the deal.II authors // // This file is part of the deal.II library. // // The deal.II library is free software; you can use it, redistribute // it, and/or modify it under the terms of the GNU Lesser General // Public License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // The full text of the license can be found in the file LICENSE at // the top level of the deal.II distribution. // // --------------------------------------------------------------------- /** * @defgroup Parallel Parallel computing * * @brief A module discussing the use of multiple processors. * * This module contains information on %parallel computing. It is * subdivided into parts on @ref threads and on @ref distributed. */ /** * A namespace in which we define classes and algorithms that deal * with running in %parallel on shared memory machines when deal.II is * configured to use multiple threads (see @ref threads), as well as * running things in %parallel on %distributed memory machines (see * @ref distributed). * * @ingroup threads * @author Wolfgang Bangerth, 2008, 2009 */ namespace parallel { }
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: * * Libmemcached library * * Copyright (C) 2011 Data Differential, http://datadifferential.com/ * Copyright (C) 2010 Brian Aker 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. * * * The names of its contributors may not 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. * */ #pragma once #ifdef __cplusplus extern "C" { #endif LIBMEMCACHED_API memcached_return_t memcached_flush(memcached_st *ptr, time_t expiration); #ifdef __cplusplus } #endif
/* ----------------------------------------------------------------------------- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk 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 NV_SQUISH_COLOURFIT_H #define NV_SQUISH_COLOURFIT_H #include "squish.h" #include "maths.h" namespace nvsquish { class ColourSet; class ColourFit { public: ColourFit(); void SetColourSet( ColourSet const* colours, int flags ); void Compress( void* block ); protected: virtual void Compress3( void* block ) = 0; virtual void Compress4( void* block ) = 0; ColourSet const* m_colours; int m_flags; }; } // namespace squish #endif // ndef SQUISH_COLOURFIT_H
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_PLATFORM_CONTEXT_H_ #define TENSORFLOW_CORE_PLATFORM_CONTEXT_H_ namespace tensorflow { enum class ContextKind { // Initial state with default (empty) values. kDefault, // Initial state inherited from the creating or scheduling thread. kThread, }; // Context is a container for request-specific information that should be passed // to threads that perform related work. The default constructor should capture // all relevant context. class Context; // Scoped object that sets the current thread's context until the object is // destroyed. class WithContext; } // namespace tensorflow #if defined(PLATFORM_GOOGLE) #include "tensorflow/core/platform/google/context.h" #else #include "tensorflow/core/platform/default/context.h" #endif #endif // TENSORFLOW_CORE_PLATFORM_CONTEXT_H_
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class FmOpKernel { public: // gain1 and gain2 represent linear step: gain for sample i is // gain1 + (1 + i) / 64 * (gain2 - gain1) // This is the basic FM operator. No feedback. static void compute(int32_t *output, const int32_t *input, int32_t phase0, int32_t freq, int32_t gain1, int32_t gain2, bool add); // This is a sine generator, no feedback. static void compute_pure(int32_t *output, int32_t phase0, int32_t freq, int32_t gain1, int32_t gain2, bool add); // One op with feedback, no add. static void compute_fb(int32_t *output, int32_t phase0, int32_t freq, int32_t gain1, int32_t gain2, int32_t *fb_buf, int fb_gain, bool add); };
/* * Copyright 2011-2016 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE */ #ifndef SCINTILLA_H_HEADER_GUARD #define SCINTILLA_H_HEADER_GUARD #if defined(SCI_NAMESPACE) #include <scintilla/include/Scintilla.h> struct ScintillaEditor { static ScintillaEditor* create(int _width, int _height); static void destroy(ScintillaEditor* _scintilla); intptr_t command(unsigned int _message, uintptr_t _p0 = 0, intptr_t _p1 = 0); void draw(); }; ScintillaEditor* ImGuiScintilla(const char* _name, bool* _opened, const ImVec2& _size); #endif // defined(SCI_NAMESPACE) #endif // SCINTILLA_H_HEADER_GUARD
/* Standard header for all Mach programs. Copyright (C) 1993,94,96,97,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _MACH_H #define _MACH_H 1 /* We must include this before using __need_FILE with <stdio.h> below. */ #include <features.h> /* Get the basic types used by Mach. */ #include <mach/mach_types.h> /* This declares the basic variables and macros everything needs. */ #include <mach_init.h> /* This declares all the real system call functions. */ #include <mach/mach_traps.h> /* These are MiG-generated headers for the kernel interfaces commonly used. */ #include <mach/mach_interface.h> /* From <mach/mach.defs>. */ #include <mach/mach_port.h> #include <mach/mach_host.h> /* For the kernel RPCs which have system call shortcut versions, the MiG-generated header in fact declares `CALL_rpc' rather than `CALL'. This file declares the simple `CALL' functions. */ #include <mach-shortcuts.h> /* Receive RPC request messages on RCV_NAME and pass them to DEMUX, which decodes them and produces reply messages. MAX_SIZE is the maximum size (in bytes) of the request and reply buffers. */ extern mach_msg_return_t __mach_msg_server (boolean_t (*__demux) (mach_msg_header_t *__request, mach_msg_header_t *__reply), mach_msg_size_t __max_size, mach_port_t __rcv_name), mach_msg_server (boolean_t (*__demux) (mach_msg_header_t *__request, mach_msg_header_t *__reply), mach_msg_size_t __max_size, mach_port_t __rcv_name); /* Just like `mach_msg_server', but the OPTION and TIMEOUT parameters are passed on to `mach_msg'. */ extern mach_msg_return_t __mach_msg_server_timeout (boolean_t (*__demux) (mach_msg_header_t *__request, mach_msg_header_t *__reply), mach_msg_size_t __max_size, mach_port_t __rcv_name, mach_msg_option_t __option, mach_msg_timeout_t __timeout), mach_msg_server_timeout (boolean_t (*__demux) (mach_msg_header_t *__request, mach_msg_header_t *__reply), mach_msg_size_t __max_size, mach_port_t __rcv_name, mach_msg_option_t __option, mach_msg_timeout_t __timeout); /* Deallocate all port rights and out-of-line memory in MSG. */ extern void __mach_msg_destroy (mach_msg_header_t *msg), mach_msg_destroy (mach_msg_header_t *msg); #define __need_FILE #include <stdio.h> /* Open a stream on a Mach device. */ extern FILE *mach_open_devstream (mach_port_t device_port, const char *mode); /* Give THREAD a stack and set it to run at PC when resumed. If *STACK_SIZE is nonzero, that size of stack is allocated. If *STACK_BASE is nonzero, that stack location is used. If STACK_BASE is not null it is filled in with the chosen stack base. If STACK_SIZE is not null it is filled in with the chosen stack size. Regardless, an extra page of red zone is allocated off the end; this is not included in *STACK_SIZE. */ kern_return_t __mach_setup_thread (task_t task, thread_t thread, void *pc, vm_address_t *stack_base, vm_size_t *stack_size); kern_return_t mach_setup_thread (task_t task, thread_t thread, void *pc, vm_address_t *stack_base, vm_size_t *stack_size); #endif /* mach.h */
/* Unix SMB/CIFS implementation. printing backend routines for smbd - using files_struct rather than only snum Copyright (C) Andrew Tridgell 1992-2000 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/>. */ #include "includes.h" /*************************************************************************** open a print file and setup a fsp for it. This is a wrapper around print_job_start(). ***************************************************************************/ NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn, const char *fname, uint16_t current_vuid, files_struct *fsp) { int jobid; fstring name; NTSTATUS status; fstrcpy( name, "Remote Downlevel Document"); if (fname) { const char *p = strrchr(fname, '/'); fstrcat(name, " "); if (!p) { p = fname; } fstrcat(name, p); } jobid = print_job_start(conn->server_info, SNUM(conn), name, NULL); if (jobid == -1) { status = map_nt_error_from_unix(errno); return status; } /* Convert to RAP id. */ fsp->rap_print_jobid = pjobid_to_rap(lp_const_servicename(SNUM(conn)), jobid); if (fsp->rap_print_jobid == 0) { /* We need to delete the entry in the tdb. */ pjob_delete(lp_const_servicename(SNUM(conn)), jobid); return NT_STATUS_ACCESS_DENIED; /* No errno around here */ } status = create_synthetic_smb_fname(fsp, print_job_fname(lp_const_servicename(SNUM(conn)), jobid), NULL, NULL, &fsp->fsp_name); if (!NT_STATUS_IS_OK(status)) { pjob_delete(lp_const_servicename(SNUM(conn)), jobid); return status; } /* setup a full fsp */ fsp->fh->fd = print_job_fd(lp_const_servicename(SNUM(conn)),jobid); GetTimeOfDay(&fsp->open_time); fsp->vuid = current_vuid; fsp->fh->pos = -1; fsp->can_lock = True; fsp->can_read = False; fsp->access_mask = FILE_GENERIC_WRITE; fsp->can_write = True; fsp->print_file = True; fsp->modified = False; fsp->oplock_type = NO_OPLOCK; fsp->sent_oplock_break = NO_BREAK_SENT; fsp->is_directory = False; fsp->wcp = NULL; SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st); fsp->mode = fsp->fsp_name->st.st_ex_mode; fsp->file_id = vfs_file_id_from_sbuf(conn, &fsp->fsp_name->st); return NT_STATUS_OK; } /**************************************************************************** Print a file - called on closing the file. ****************************************************************************/ void print_fsp_end(files_struct *fsp, enum file_close_type close_type) { uint32 jobid; if (fsp->fh->private_options & FILE_DELETE_ON_CLOSE) { /* * Truncate the job. print_job_end will take * care of deleting it for us. JRA. */ sys_ftruncate(fsp->fh->fd, 0); } if (fsp->fsp_name) { TALLOC_FREE(fsp->fsp_name); } if (!rap_to_pjobid(fsp->rap_print_jobid, NULL, &jobid)) { DEBUG(3,("print_fsp_end: Unable to convert RAP jobid %u to print jobid.\n", (unsigned int)fsp->rap_print_jobid )); return; } print_job_end(SNUM(fsp->conn),jobid, close_type); }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_CHROMEOS_OFFLINE_OFFLINE_LOAD_PAGE_H_ #define CHROME_BROWSER_CHROMEOS_OFFLINE_OFFLINE_LOAD_PAGE_H_ #include <string> #include "base/callback.h" #include "base/compiler_specific.h" #include "content/public/browser/interstitial_page_delegate.h" #include "net/base/network_change_notifier.h" #include "url/gurl.h" namespace base { class DictionaryValue; } namespace content { class InterstitialPage; class WebContents; } namespace extensions { class Extension; } namespace chromeos { // OfflineLoadPage class shows the interstitial page that is shown // when no network is available and hides when some network (either // one of wifi, 3g or ethernet) becomes available. // It deletes itself when the interstitial page is closed. class OfflineLoadPage : public content::InterstitialPageDelegate, public net::NetworkChangeNotifier::ConnectionTypeObserver { public: // Passed a boolean indicating whether or not it is OK to proceed with the // page load. typedef base::Callback<void(bool /*proceed*/)> CompletionCallback; // Create a offline load page for the |web_contents|. The callback will be // run on the IO thread. OfflineLoadPage(content::WebContents* web_contents, const GURL& url, const CompletionCallback& callback); void Show(); protected: virtual ~OfflineLoadPage(); // Overridden by tests. virtual void NotifyBlockingPageComplete(bool proceed); private: friend class TestOfflineLoadPage; // InterstitialPageDelegate implementation. virtual std::string GetHTMLContents() OVERRIDE; virtual void CommandReceived(const std::string& command) OVERRIDE; virtual void OverrideRendererPrefs( content::RendererPreferences* prefs) OVERRIDE; virtual void OnProceed() OVERRIDE; virtual void OnDontProceed() OVERRIDE; // net::NetworkChangeNotifier::ConnectionTypeObserver overrides. virtual void OnConnectionTypeChanged( net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; // Retrieves template strings of the offline page for app and // normal site. void GetAppOfflineStrings(const extensions::Extension* app, base::DictionaryValue* strings) const; void GetNormalOfflineStrings(base::DictionaryValue* strings) const; CompletionCallback callback_; // True if the proceed is chosen. bool proceeded_; content::WebContents* web_contents_; GURL url_; content::InterstitialPage* interstitial_page_; // Owns us. DISALLOW_COPY_AND_ASSIGN(OfflineLoadPage); }; } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_OFFLINE_OFFLINE_LOAD_PAGE_H_
/** * gadget.h - DesignWare USB3 DRD Gadget Header * * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com * * Authors: Felipe Balbi <balbi@ti.com>, * Sebastian Andrzej Siewior <bigeasy@linutronix.de> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 of * the License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef __DRIVERS_USB_DWC3_GADGET_H #define __DRIVERS_USB_DWC3_GADGET_H #include <linux/list.h> #include <linux/usb/gadget.h> #include "io.h" struct dwc3; #define to_dwc3_ep(ep) (container_of(ep, struct dwc3_ep, endpoint)) #define gadget_to_dwc(g) (container_of(g, struct dwc3, gadget)) /* DEPCFG parameter 1 */ #define DWC3_DEPCFG_INT_NUM(n) (((n) & 0x1f) << 0) #define DWC3_DEPCFG_XFER_COMPLETE_EN BIT(8) #define DWC3_DEPCFG_XFER_IN_PROGRESS_EN BIT(9) #define DWC3_DEPCFG_XFER_NOT_READY_EN BIT(10) #define DWC3_DEPCFG_FIFO_ERROR_EN BIT(11) #define DWC3_DEPCFG_STREAM_EVENT_EN BIT(12) #define DWC3_DEPCFG_BINTERVAL_M1(n) (((n) & 0xff) << 16) #define DWC3_DEPCFG_STREAM_CAPABLE BIT(24) #define DWC3_DEPCFG_EP_NUMBER(n) (((n) & 0x1f) << 25) #define DWC3_DEPCFG_BULK_BASED BIT(30) #define DWC3_DEPCFG_FIFO_BASED BIT(31) /* DEPCFG parameter 0 */ #define DWC3_DEPCFG_EP_TYPE(n) (((n) & 0x3) << 1) #define DWC3_DEPCFG_MAX_PACKET_SIZE(n) (((n) & 0x7ff) << 3) #define DWC3_DEPCFG_FIFO_NUMBER(n) (((n) & 0x1f) << 17) #define DWC3_DEPCFG_BURST_SIZE(n) (((n) & 0xf) << 22) #define DWC3_DEPCFG_DATA_SEQ_NUM(n) ((n) << 26) /* This applies for core versions earlier than 1.94a */ #define DWC3_DEPCFG_IGN_SEQ_NUM BIT(31) /* These apply for core versions 1.94a and later */ #define DWC3_DEPCFG_ACTION_INIT (0 << 30) #define DWC3_DEPCFG_ACTION_RESTORE BIT(30) #define DWC3_DEPCFG_ACTION_MODIFY (2 << 30) /* DEPXFERCFG parameter 0 */ #define DWC3_DEPXFERCFG_NUM_XFER_RES(n) ((n) & 0xffff) /* -------------------------------------------------------------------------- */ #define to_dwc3_request(r) (container_of(r, struct dwc3_request, request)) static inline struct dwc3_request *next_request(struct list_head *list) { return list_first_entry_or_null(list, struct dwc3_request, list); } static inline void dwc3_gadget_move_started_request(struct dwc3_request *req) { struct dwc3_ep *dep = req->dep; req->started = true; list_move_tail(&req->list, &dep->started_list); } void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, int status); void dwc3_ep0_interrupt(struct dwc3 *dwc, const struct dwc3_event_depevt *event); void dwc3_ep0_out_start(struct dwc3 *dwc); int __dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value); int dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value); int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct usb_request *request, gfp_t gfp_flags); int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol); /** * dwc3_gadget_ep_get_transfer_index - Gets transfer index from HW * @dwc: DesignWare USB3 Pointer * @number: DWC endpoint number * * Caller should take care of locking */ static inline u32 dwc3_gadget_ep_get_transfer_index(struct dwc3_ep *dep) { u32 res_id; res_id = dwc3_readl(dep->regs, DWC3_DEPCMD); return DWC3_DEPCMD_GET_RSC_IDX(res_id); } #endif /* __DRIVERS_USB_DWC3_GADGET_H */
/* $NoKeywords:$ */ /** * @file * * Various NB initialization services * * * * @xrefitem bom "File Content Label" "Release Content" * @e project: AGESA * @e sub-project: GNB * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 2010) $ * */ /* ***************************************************************************** * * Copyright (c) 2011, Advanced Micro Devices, 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 Advanced Micro Devices, 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 ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *************************************************************************** * */ #ifndef _NBINIT_H_ #define _NBINIT_H_ AGESA_STATUS NbInitOnPowerOn ( IN GNB_PLATFORM_CONFIG *Gnb ); #endif
/*============================================================================= Library: CTK Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =============================================================================*/ #ifndef CTKPLUGINFRAMEWORKTESTRUNNER_H #define CTKPLUGINFRAMEWORKTESTRUNNER_H #include "ctkPluginFrameworkTestUtilExport.h" #include <ctkPlugin.h> #include <ctkPluginFramework_global.h> class ctkPluginFrameworkTestRunnerPrivate; class CTK_PLUGINFW_TESTUTIL_EXPORT ctkPluginFrameworkTestRunner { public: ctkPluginFrameworkTestRunner(); ~ctkPluginFrameworkTestRunner(); void addPluginPath(const QString& path, bool install = true); void addPlugin(const QString& path, const QString& name); void startPluginOnRun(const QString& name, ctkPlugin::StartOptions opts = ctkPlugin::START_ACTIVATION_POLICY); void init(const ctkProperties& fwProps = ctkProperties()); int run(int argc, char** argv); private: Q_DECLARE_PRIVATE(ctkPluginFrameworkTestRunner) const QScopedPointer<ctkPluginFrameworkTestRunnerPrivate> d_ptr; }; #endif // CTKPLUGINFRAMEWORKTESTRUNNER_H
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_ #define CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_ #include <string> #include "base/android/jni_helper.h" #include "base/memory/scoped_ptr.h" namespace content { class ContentViewCore; class RenderViewHost; // Android implementation for DateTimeChooser dialogs. class DateTimeChooserAndroid { public: DateTimeChooserAndroid(); ~DateTimeChooserAndroid(); // DateTimeChooser implementation: void ShowDialog(ContentViewCore* content, RenderViewHost* sender, int type, int year, int month, int day, int hour, int minute, int second, int week, double min, double max); // Replaces the current value with the one passed the different fields void ReplaceDateTime(JNIEnv* env, jobject, jint dialog_type, jint year, jint month, jint day, jint hour, jint minute, jint second, jint week); // Closes the dialog without propagating any changes. void CancelDialog(JNIEnv* env, jobject); // Propagates the different types of accepted date/time values to the // java side. static void InitializeDateInputTypes( int text_input_type_date, int text_input_type_date_time, int text_input_type_date_time_local, int text_input_type_month, int text_input_type_time, int text_input_type_week); private: class DateTimeIPCSender; // The DateTimeIPCSender class is a render view observer, so it will take care // of its own deletion. DateTimeIPCSender* sender_; base::android::ScopedJavaGlobalRef<jobject> j_date_time_chooser_; DISALLOW_COPY_AND_ASSIGN(DateTimeChooserAndroid); }; // Native JNI methods bool RegisterDateTimeChooserAndroid(JNIEnv* env); } // namespace content #endif // CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_
/* { dg-do run } */ /* { dg-options "-Wno-psabi -fsanitize=signed-integer-overflow -Wno-unused-variable -fno-sanitize-recover=signed-integer-overflow" } */ #define SCHAR_MAX __SCHAR_MAX__ #define SCHAR_MIN (-__SCHAR_MAX__ - 1) #define SHRT_MAX __SHRT_MAX__ #define SHRT_MIN (-__SHRT_MAX__ - 1) #define INT_MAX __INT_MAX__ #define INT_MIN (-__INT_MAX__ - 1) typedef signed char VC __attribute__((vector_size (16))); typedef short VS __attribute__((vector_size (8 * sizeof (short)))); typedef int VI __attribute__((vector_size (4 * sizeof (int)))); typedef int VI2 __attribute__((vector_size (16 * sizeof (int)))); void __attribute__((noinline,noclone)) checkvc (VC i, VC j) { if (__builtin_memcmp (&i, &j, sizeof (VC))) __builtin_abort (); } void __attribute__((noinline,noclone)) checkvs (VS i, VS j) { if (__builtin_memcmp (&i, &j, sizeof (VS))) __builtin_abort (); } void __attribute__((noinline,noclone)) checkvi (VI i, VI j) { if (__builtin_memcmp (&i, &j, sizeof (VI))) __builtin_abort (); } void __attribute__((noinline,noclone)) checkvi2 (VI2 i, VI2 j) { if (__builtin_memcmp (&i, &j, sizeof (VI2))) __builtin_abort (); } VI __attribute__((noinline,noclone)) foo (VI i) { return -i; } VS __attribute__((noinline,noclone)) bar (VS i, VS j) { return i + j; } int main (void) { /* Check that for a vector operation, only the first element with UB is reported. */ volatile VC a = (VC) { 0, SCHAR_MAX - 2, SCHAR_MAX - 2, 3, 2, 3, 4, 5, 0, 7, 1, 2, 3, 4, SCHAR_MAX - 13, SCHAR_MAX }; volatile VC b = (VC) { 5, 2, 1, 5, 0, 1, 2, 7, 8, 9, 10, 11, 6, -2, 13, 0 }; volatile VC k = b + a; checkvc (k, (VC) { 5, SCHAR_MAX, SCHAR_MAX - 1, 8, 2, 4, 6, 12, 8, 16, 11, 13, 9, 2, SCHAR_MAX, SCHAR_MAX }); k = a + b; checkvc (k, (VC) { 5, SCHAR_MAX, SCHAR_MAX - 1, 8, 2, 4, 6, 12, 8, 16, 11, 13, 9, 2, SCHAR_MAX, SCHAR_MAX }); volatile VS c = (VS) { 0, SHRT_MAX - 2, SHRT_MAX - 2, 3, 3, 4, SHRT_MAX - 13, SHRT_MAX }; volatile VS d = (VS) { 5, 2, -3, 5, 6, -2, 13, -1 }; volatile VS l = d + c; checkvs (l, (VS) { 5, SHRT_MAX, SHRT_MAX - 5, 8, 9, 2, SHRT_MAX, SHRT_MAX - 1 }); l = bar (c, d); checkvs (l, (VS) { 5, SHRT_MAX, SHRT_MAX - 5, 8, 9, 2, SHRT_MAX, SHRT_MAX - 1 }); volatile VI e = (VI) { INT_MAX - 4, INT_MAX - 5, INT_MAX - 13, INT_MAX }; volatile VI f = (VI) { 4, -6, 13, 0 }; volatile VI m = f + e; checkvi (m, (VI) { INT_MAX, INT_MAX - 11,INT_MAX, INT_MAX }); m = e + f; checkvi (m, (VI) { INT_MAX, INT_MAX - 11,INT_MAX, INT_MAX }); volatile VI2 g = (VI2) { 0, INT_MAX - 2, INT_MAX - 2, 3, 3, 4, INT_MAX - 13, INT_MAX }; volatile VI2 h = (VI2) { 5, 2, -5, 5, 6, -2, 13, -1 }; volatile VI2 n = h + g; checkvi2 (n, (VI2) { 5, INT_MAX, INT_MAX - 7, 8, 9, 2, INT_MAX, INT_MAX - 1 }); n = g + h; checkvi2 (n, (VI2) { 5, INT_MAX, INT_MAX - 7, 8, 9, 2, INT_MAX, INT_MAX - 1 }); volatile VC a2 = k - b; checkvc (a2, a); volatile VC b2 = k - a; checkvc (b2, b); volatile VS c2 = l - d; checkvs (c2, c); volatile VS d2 = l - c; checkvs (d2, d); volatile VI e2 = m - f; checkvi (e2, e); volatile VI f2 = m - e; checkvi (f2, f); volatile VI2 g2 = n - h; checkvi2 (g2, g); volatile VI2 h2 = n - g; checkvi2 (h2, h); a = (VC) { 0, SCHAR_MAX / 4, SCHAR_MAX / 4, 3, 2, 3, 4, 5, 0, 7, 1, 2, 3, 4, SCHAR_MAX - 13, SCHAR_MAX }; b = (VC) { SCHAR_MAX, 4, 3, 2, 3, 4, 5, 2, 9, 2, 9, 1, 0, 8, 1, 1 }; k = a * b; checkvc (k, (VC) { 0, 124, 93, 6, 6,12,20,10, 0,14, 9, 2, 0,32, SCHAR_MAX - 13, SCHAR_MAX }); c = (VS) { 0, SHRT_MAX / 8, SHRT_MAX / 7, 5, 8, 9, SHRT_MAX - 10, SHRT_MAX }; d = (VS) { SHRT_MAX, 8, 6, 2, 3, 4, 1, 1 }; l = c * d; checkvs (l, (VS) { 0, 32760, 28086, 10,24,36, SHRT_MAX - 10, SHRT_MAX }); e = (VI) { INT_MAX, INT_MAX / 5, INT_MAX / 6, INT_MAX }; f = (VI) { 0, 5, 5, 1 }; m = e * f; checkvi (m, (VI) { 0, 2147483645, 1789569705, INT_MAX }); g = (VI2) { INT_MAX, INT_MAX / 9, INT_MAX / 8, 5, 6, 7, 8, INT_MAX }; h = (VI2) { 0, 8, 8, 2, 3, 4, 5, 1 }; n = g * h; checkvi2 (n,(VI2) { 0, 1908874352, 2147483640, 10,18,28,40, INT_MAX }); a = (VC) { 5, 7, 8, 9, SCHAR_MAX, SCHAR_MIN + 1, 24, 32, 0, 1, 2, 3, 4, 5, SCHAR_MAX, SCHAR_MIN + 2 }; k = -a; checkvc (k, (VC) {-5,-7,-8,-9,-SCHAR_MAX, SCHAR_MAX, -24,-32, 0,-1,-2,-3,-4,-5,-SCHAR_MAX, SCHAR_MAX - 1 }); c = (VS) { 0, 7, 23, SHRT_MIN + 1, SHRT_MIN + 2, SHRT_MAX, 2, 5 }; l = -c; checkvs (l, (VS) { 0,-7,-23, SHRT_MAX, SHRT_MAX - 1,-SHRT_MAX,-2,-5 }); e = (VI) { 5, INT_MAX, INT_MIN + 1, INT_MIN + 2 }; m = foo (e); checkvi (m, (VI) {-5,-INT_MAX, INT_MAX, INT_MAX - 1 }); g = (VI2) { 10, 11, 0, INT_MAX - 2, 1, INT_MIN + 1, 5, INT_MIN / 2 }; n = -g; checkvi2 (n, (VI2) {-10,-11, 0,-INT_MAX + 2,-1, INT_MAX, -5, INT_MAX / 2 + 1 }); return 0; }
// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "test.h" // We want to establish the following sequence of accesses to X: // - main thread writes X // - thread2 reads X, this read happens-before the write in main thread // - thread1 reads X, this read is concurrent with the write in main thread // Write in main thread and read in thread1 should be detected as a race. // Previously tsan replaced write by main thread with read by thread1, // as the result the race was not detected. volatile long X, Y, Z; void *Thread1(void *x) { barrier_wait(&barrier); barrier_wait(&barrier); Y = X; return NULL; } void *Thread2(void *x) { Z = X; barrier_wait(&barrier); return NULL; } int main() { barrier_init(&barrier, 2); pthread_t t[2]; pthread_create(&t[0], 0, Thread1, 0); X = 42; barrier_wait(&barrier); pthread_create(&t[1], 0, Thread2, 0); pthread_join(t[0], 0); pthread_join(t[1], 0); return 0; } // CHECK: WARNING: ThreadSanitizer: data race
/* * Copyright 2010, The Android Open Source Project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ANDROID_CHROMIUM_PREFIX_H #define ANDROID_CHROMIUM_PREFIX_H // C++ specific changes #ifdef __cplusplus #include <unistd.h> #include <sys/prctl.h> // chromium refers to stl functions without std:: #include <algorithm> using std::find; using std::reverse; using std::search; // Called by command_line.cc to shorten the process name. Not needed for // network stack. #define prctl() (0) namespace std { // our new does not trigger oom inline void set_new_handler(void (*p)()) {} } // Chromium expects size_t to be a signed int on linux but Android defines it // as unsigned. inline size_t abs(size_t x) { return x; } #endif // Needed by base_paths.cc for close() function. #include <unistd.h> // Need to define assert before logging.h undefines it. #include <assert.h> // logging.cc needs pthread_mutex_t #include <pthread.h> // needed for isalpha #include <ctype.h> // needed for sockaddr_in #include <netinet/in.h> // Implemented in bionic but not exposed. extern char* mkdtemp(char* path); #define FRIEND_TEST(test_case_name, test_name)\ friend class test_case_name##_##test_name##_Test // This will probably need a real implementation. //#define F_ULOCK 0 //#define F_LOCK 1 //inline int lockf(int fd, int cmd, off_t len) { return -1; } // We have posix monotonic clocks but don't define this... #define _POSIX_MONOTONIC_CLOCK 1 // Disable langinfo in icu #define U_GAVE_NL_LANGINFO_CODESET 0 // We use the C99 style, but this is not defined #define HAVE_UINT16_T 1 #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 CHROME_BROWSER_SYNC_GLUE_THEME_DATA_TYPE_CONTROLLER_H_ #define CHROME_BROWSER_SYNC_GLUE_THEME_DATA_TYPE_CONTROLLER_H_ #include "components/sync_driver/ui_data_type_controller.h" class Profile; namespace browser_sync { class ThemeDataTypeController : public sync_driver::UIDataTypeController { public: ThemeDataTypeController( sync_driver::SyncApiComponentFactory* sync_factory, Profile* profile); private: ~ThemeDataTypeController() override; // UIDataTypeController implementations. bool StartModels() override; Profile* const profile_; DISALLOW_COPY_AND_ASSIGN(ThemeDataTypeController); }; } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_THEME_DATA_TYPE_CONTROLLER_H_
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef THIRD_PARTY_TENSORFLOW_CORE_GRAPPLER_OPTIMIZERS_STATIC_SCHEDULE_H_ #define THIRD_PARTY_TENSORFLOW_CORE_GRAPPLER_OPTIMIZERS_STATIC_SCHEDULE_H_ #include <unordered_map> #include "tensorflow/core/framework/node_def.pb.h" #include "tensorflow/core/grappler/clusters/cluster.h" #include "tensorflow/core/grappler/costs/cost_estimator.h" #include "tensorflow/core/grappler/grappler_item.h" namespace tensorflow { namespace grappler { // Compute the earliest time as which the execution of each node in the graph // can complete. // In our estimation, we ensure that each node takes at least one nanosecond to // execute: therefore the execution times can be used to derive a topological // ordering of the graph (at least as long as there is no loop in the graph). Status EstimateEarliestExecutionTimes( const GrapplerItem& item, const Cluster* cluster, std::unordered_map<const NodeDef*, Costs::NanoSeconds>* execution_times); } // namespace grappler } // end namespace tensorflow #endif // THIRD_PARTY_TENSORFLOW_CORE_GRAPPLER_OPTIMIZERS_STATIC_SCHEDULE_H_
/* * arch/arm/mach-ep93xx/include/mach/uncompress.h * * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.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. */ #include <mach/ep93xx-regs.h> #include <asm/mach-types.h> static unsigned char __raw_readb(unsigned int ptr) { return *((volatile unsigned char *)ptr); } static unsigned int __raw_readl(unsigned int ptr) { return *((volatile unsigned int *)ptr); } static void __raw_writeb(unsigned char value, unsigned int ptr) { *((volatile unsigned char *)ptr) = value; } static void __raw_writel(unsigned int value, unsigned int ptr) { *((volatile unsigned int *)ptr) = value; } #define PHYS_UART_DATA (CONFIG_DEBUG_UART_PHYS + 0x00) #define PHYS_UART_FLAG (CONFIG_DEBUG_UART_PHYS + 0x18) #define UART_FLAG_TXFF 0x20 static inline void putc(int c) { int i; for (i = 0; i < 10000; i++) { /* Transmit fifo not full? */ if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF)) break; } __raw_writeb(c, PHYS_UART_DATA); } static inline void flush(void) { } /* * Some bootloaders don't turn off DMA from the ethernet MAC before * jumping to linux, which means that we might end up with bits of RX * status and packet data scribbled over the uncompressed kernel image. * Work around this by resetting the ethernet MAC before we uncompress. */ #define PHYS_ETH_SELF_CTL 0x80010020 #define ETH_SELF_CTL_RESET 0x00000001 static void ethernet_reset(void) { unsigned int v; /* Reset the ethernet MAC. */ v = __raw_readl(PHYS_ETH_SELF_CTL); __raw_writel(v | ETH_SELF_CTL_RESET, PHYS_ETH_SELF_CTL); /* Wait for reset to finish. */ while (__raw_readl(PHYS_ETH_SELF_CTL) & ETH_SELF_CTL_RESET) ; } #define TS72XX_WDT_CONTROL_PHYS_BASE 0x23800000 #define TS72XX_WDT_FEED_PHYS_BASE 0x23c00000 #define TS72XX_WDT_FEED_VAL 0x05 static void __maybe_unused ts72xx_watchdog_disable(void) { __raw_writeb(TS72XX_WDT_FEED_VAL, TS72XX_WDT_FEED_PHYS_BASE); __raw_writeb(0, TS72XX_WDT_CONTROL_PHYS_BASE); } static void arch_decomp_setup(void) { if (machine_is_ts72xx()) ts72xx_watchdog_disable(); ethernet_reset(); }
/* * Copyright (C) 2004 Steven J. Hill * Copyright (C) 2001,2002,2003 Broadcom Corporation * Copyright (C) 1995-2000 Simon G. Vogl * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/i2c.h> #include <asm/io.h> #include <asm/sibyte/sb1250_regs.h> #include <asm/sibyte/sb1250_smbus.h> struct i2c_algo_sibyte_data { void *data; /* private data */ int bus; /* which bus */ void *reg_base; /* CSR base */ }; /* ----- global defines ----------------------------------------------- */ #define SMB_CSR(a,r) ((long)(a->reg_base + r)) static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data * data) { struct i2c_algo_sibyte_data *adap = i2c_adap->algo_data; int data_bytes = 0; int error; while (csr_in32(SMB_CSR(adap, R_SMB_STATUS)) & M_SMB_BUSY) ; switch (size) { case I2C_SMBUS_QUICK: csr_out32((V_SMB_ADDR(addr) | (read_write == I2C_SMBUS_READ ? M_SMB_QDATA : 0) | V_SMB_TT_QUICKCMD), SMB_CSR(adap, R_SMB_START)); break; case I2C_SMBUS_BYTE: if (read_write == I2C_SMBUS_READ) { csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_RD1BYTE), SMB_CSR(adap, R_SMB_START)); data_bytes = 1; } else { csr_out32(V_SMB_CMD(command), SMB_CSR(adap, R_SMB_CMD)); csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_WR1BYTE), SMB_CSR(adap, R_SMB_START)); } break; case I2C_SMBUS_BYTE_DATA: csr_out32(V_SMB_CMD(command), SMB_CSR(adap, R_SMB_CMD)); if (read_write == I2C_SMBUS_READ) { csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_CMD_RD1BYTE), SMB_CSR(adap, R_SMB_START)); data_bytes = 1; } else { csr_out32(V_SMB_LB(data->byte), SMB_CSR(adap, R_SMB_DATA)); csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_WR2BYTE), SMB_CSR(adap, R_SMB_START)); } break; case I2C_SMBUS_WORD_DATA: csr_out32(V_SMB_CMD(command), SMB_CSR(adap, R_SMB_CMD)); if (read_write == I2C_SMBUS_READ) { csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_CMD_RD2BYTE), SMB_CSR(adap, R_SMB_START)); data_bytes = 2; } else { csr_out32(V_SMB_LB(data->word & 0xff), SMB_CSR(adap, R_SMB_DATA)); csr_out32(V_SMB_MB(data->word >> 8), SMB_CSR(adap, R_SMB_DATA)); csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_WR2BYTE), SMB_CSR(adap, R_SMB_START)); } break; default: return -1; /* XXXKW better error code? */ } while (csr_in32(SMB_CSR(adap, R_SMB_STATUS)) & M_SMB_BUSY) ; error = csr_in32(SMB_CSR(adap, R_SMB_STATUS)); if (error & M_SMB_ERROR) { /* Clear error bit by writing a 1 */ csr_out32(M_SMB_ERROR, SMB_CSR(adap, R_SMB_STATUS)); return -1; /* XXXKW better error code? */ } if (data_bytes == 1) data->byte = csr_in32(SMB_CSR(adap, R_SMB_DATA)) & 0xff; if (data_bytes == 2) data->word = csr_in32(SMB_CSR(adap, R_SMB_DATA)) & 0xffff; return 0; } static u32 bit_func(struct i2c_adapter *adap) { return (I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA); } /* -----exported algorithm data: ------------------------------------- */ static const struct i2c_algorithm i2c_sibyte_algo = { .smbus_xfer = smbus_xfer, .functionality = bit_func, }; /* * registering functions to load algorithms at runtime */ static int __init i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed) { struct i2c_algo_sibyte_data *adap = i2c_adap->algo_data; /* Register new adapter to i2c module... */ i2c_adap->algo = &i2c_sibyte_algo; /* Set the requested frequency. */ csr_out32(speed, SMB_CSR(adap,R_SMB_FREQ)); csr_out32(0, SMB_CSR(adap,R_SMB_CONTROL)); return i2c_add_numbered_adapter(i2c_adap); } static struct i2c_algo_sibyte_data sibyte_board_data[2] = { { NULL, 0, (void *) (CKSEG1+A_SMB_BASE(0)) }, { NULL, 1, (void *) (CKSEG1+A_SMB_BASE(1)) } }; static struct i2c_adapter sibyte_board_adapter[2] = { { .owner = THIS_MODULE, .class = I2C_CLASS_HWMON | I2C_CLASS_SPD, .algo = NULL, .algo_data = &sibyte_board_data[0], .nr = 0, .name = "SiByte SMBus 0", }, { .owner = THIS_MODULE, .class = I2C_CLASS_HWMON | I2C_CLASS_SPD, .algo = NULL, .algo_data = &sibyte_board_data[1], .nr = 1, .name = "SiByte SMBus 1", }, }; static int __init i2c_sibyte_init(void) { pr_info("i2c-sibyte: i2c SMBus adapter module for SiByte board\n"); if (i2c_sibyte_add_bus(&sibyte_board_adapter[0], K_SMB_FREQ_100KHZ) < 0) return -ENODEV; if (i2c_sibyte_add_bus(&sibyte_board_adapter[1], K_SMB_FREQ_400KHZ) < 0) { i2c_del_adapter(&sibyte_board_adapter[0]); return -ENODEV; } return 0; } static void __exit i2c_sibyte_exit(void) { i2c_del_adapter(&sibyte_board_adapter[0]); i2c_del_adapter(&sibyte_board_adapter[1]); } module_init(i2c_sibyte_init); module_exit(i2c_sibyte_exit); MODULE_AUTHOR("Kip Walker (Broadcom Corp.), Steven J. Hill <sjhill@realitydiluted.com>"); MODULE_DESCRIPTION("SMBus adapter routines for SiByte boards"); MODULE_LICENSE("GPL");
/* * Trantor T128/T128F/T228 defines * Note : architecturally, the T100 and T128 are different and won't work * * Copyright 1993, Drew Eckhardt * Visionary Computing * (Unix and Linux consulting and custom programming) * drew@colorado.edu * +1 (303) 440-4894 * * DISTRIBUTION RELEASE 3. * * For more information, please consult * * Trantor Systems, Ltd. * T128/T128F/T228 SCSI Host Adapter * Hardware Specifications * * Trantor Systems, Ltd. * 5415 Randall Place * Fremont, CA 94538 * 1+ (415) 770-1400, FAX 1+ (415) 770-9910 * * and * * NCR 5380 Family * SCSI Protocol Controller * Databook * * NCR Microelectronics * 1635 Aeroplaza Drive * Colorado Springs, CO 80916 * 1+ (719) 578-3400 * 1+ (800) 334-5454 */ /* * $Log: t128.h,v $ */ #ifndef T128_H #define T128_H #define T128_PUBLIC_RELEASE 3 #define TDEBUG_INIT 0x1 #define TDEBUG_TRANSFER 0x2 /* * The trantor boards are memory mapped. They use an NCR5380 or * equivalent (my sample board had part second sourced from ZILOG). * NCR's recommended "Pseudo-DMA" architecture is used, where * a PAL drives the DMA signals on the 5380 allowing fast, blind * transfers with proper handshaking. */ /* * Note : a boot switch is provided for the purpose of informing the * firmware to boot or not boot from attached SCSI devices. So, I imagine * there are fewer people who've yanked the ROM like they do on the Seagate * to make bootup faster, and I'll probably use this for autodetection. */ #define T_ROM_OFFSET 0 /* * Note : my sample board *WAS NOT* populated with the SRAM, so this * can't be used for autodetection without a ROM present. */ #define T_RAM_OFFSET 0x1800 /* * All of the registers are allocated 32 bytes of address space, except * for the data register (read/write to/from the 5380 in pseudo-DMA mode) */ #define T_CONTROL_REG_OFFSET 0x1c00 /* rw */ #define T_CR_INT 0x10 /* Enable interrupts */ #define T_CR_CT 0x02 /* Reset watchdog timer */ #define T_STATUS_REG_OFFSET 0x1c20 /* ro */ #define T_ST_BOOT 0x80 /* Boot switch */ #define T_ST_S3 0x40 /* User settable switches, */ #define T_ST_S2 0x20 /* read 0 when switch is on, 1 off */ #define T_ST_S1 0x10 #define T_ST_PS2 0x08 /* Set for Microchannel 228 */ #define T_ST_RDY 0x04 /* 5380 DRQ */ #define T_ST_TIM 0x02 /* indicates 40us watchdog timer fired */ #define T_ST_ZERO 0x01 /* Always zero */ #define T_5380_OFFSET 0x1d00 /* 8 registers here, see NCR5380.h */ #define T_DATA_REG_OFFSET 0x1e00 /* rw 512 bytes long */ #ifndef ASM int t128_abort(Scsi_Cmnd *); int t128_biosparam(Disk *, kdev_t, int*); int t128_detect(Scsi_Host_Template *); int t128_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); int t128_reset(Scsi_Cmnd *, unsigned int reset_flags); int t128_proc_info (char *buffer, char **start, off_t offset, int length, int hostno, int inout); #ifndef NULL #define NULL 0 #endif #ifndef CMD_PER_LUN #define CMD_PER_LUN 2 #endif #ifndef CAN_QUEUE #define CAN_QUEUE 32 #endif /* * I hadn't thought of this with the earlier drivers - but to prevent * macro definition conflicts, we shouldn't define all of the internal * macros when this is being used solely for the host stub. */ #define TRANTOR_T128 { \ name: "Trantor T128/T128F/T228", \ detect: t128_detect, \ queuecommand: t128_queue_command, \ abort: t128_abort, \ reset: t128_reset, \ bios_param: t128_biosparam, \ can_queue: CAN_QUEUE, \ this_id: 7, \ sg_tablesize: SG_ALL, \ cmd_per_lun: CMD_PER_LUN, \ use_clustering: DISABLE_CLUSTERING} #ifndef HOSTS_C #define NCR5380_implementation_fields \ unsigned long base #define NCR5380_local_declare() \ unsigned long base #define NCR5380_setup(instance) \ base = (instance)->base #define T128_address(reg) (base + T_5380_OFFSET + ((reg) * 0x20)) #if !(TDEBUG & TDEBUG_TRANSFER) #define NCR5380_read(reg) isa_readb(T128_address(reg)) #define NCR5380_write(reg, value) isa_writeb((value),(T128_address(reg))) #else #define NCR5380_read(reg) \ (((unsigned char) printk("scsi%d : read register %d at address %08x\n"\ , instance->hostno, (reg), T128_address(reg))), isa_readb(T128_address(reg))) #define NCR5380_write(reg, value) { \ printk("scsi%d : write %02x to register %d at address %08x\n", \ instance->hostno, (value), (reg), T128_address(reg)); \ isa_writeb((value), (T128_address(reg))); \ } #endif #define NCR5380_intr t128_intr #define do_NCR5380_intr do_t128_intr #define NCR5380_queue_command t128_queue_command #define NCR5380_abort t128_abort #define NCR5380_reset t128_reset #define NCR5380_proc_info t128_proc_info /* 15 14 12 10 7 5 3 1101 0100 1010 1000 */ #define T128_IRQS 0xc4a8 #endif /* else def HOSTS_C */ #endif /* ndef ASM */ #endif /* T128_H */
/***************************************************************************** * vlc_tls.h: Transport Layer Security API ***************************************************************************** * Copyright (C) 2004-2011 Rémi Denis-Courmont * Copyright (C) 2005-2006 VLC authors and VideoLAN * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifndef VLC_TLS_H # define VLC_TLS_H /** * \file * This file defines Transport Layer Security API (TLS) in vlc */ # include <vlc_network.h> typedef struct vlc_tls vlc_tls_t; typedef struct vlc_tls_creds vlc_tls_creds_t; /** TLS session */ struct vlc_tls { VLC_COMMON_MEMBERS void *sys; int fd; struct virtual_socket_t sock; }; VLC_API vlc_tls_t *vlc_tls_ClientSessionCreate (vlc_tls_creds_t *, int fd, const char *host, const char *service, const char *const *alpn, char **alp); vlc_tls_t *vlc_tls_SessionCreate (vlc_tls_creds_t *, int fd, const char *host, const char *const *alpn); int vlc_tls_SessionHandshake (vlc_tls_t *, const char *host, const char *serv, char ** /*restrict*/ alp); VLC_API void vlc_tls_SessionDelete (vlc_tls_t *); VLC_API int vlc_tls_Read(vlc_tls_t *, void *buf, size_t len, bool waitall); VLC_API char *vlc_tls_GetLine(vlc_tls_t *); VLC_API int vlc_tls_Write(vlc_tls_t *, const void *buf, size_t len); # define tls_Recv(a,b,c) vlc_tls_Read(a,b,c,false) # define tls_Send(a,b,c) vlc_tls_Write(a,b,c) /** TLS credentials (certificate, private and trust settings) */ struct vlc_tls_creds { VLC_COMMON_MEMBERS module_t *module; void *sys; int (*open) (vlc_tls_creds_t *, vlc_tls_t *, int fd, const char *host, const char *const *alpn); int (*handshake) (vlc_tls_t *, const char *host, const char *service, char ** /*restrict*/ alp); void (*close) (vlc_tls_t *); }; VLC_API vlc_tls_creds_t *vlc_tls_ClientCreate (vlc_object_t *); vlc_tls_creds_t *vlc_tls_ServerCreate (vlc_object_t *, const char *cert, const char *key); VLC_API void vlc_tls_Delete (vlc_tls_creds_t *); #endif
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Marco Miozzo <marco.miozzo@cttc.es> * Nicola Baldo <nbaldo@cttc.es> * */ #ifndef ITU_R_1411_LOS_PROPAGATION_LOSS_MODEL_H #define ITU_R_1411_LOS_PROPAGATION_LOSS_MODEL_H #include "ns3/propagation-loss-model.h" namespace ns3 { /** * \ingroup propagation * * \brief the ITU-R 1411 LOS propagation model * * This class implements the ITU-R 1411 LOS propagation model for * Line-of-Sight (LoS) short range outdoor communication in the * frequency range 300 MHz to 100 GHz. * For more information about the model, please see * the propagation module documentation in .rst format. */ class ItuR1411LosPropagationLossModel : public PropagationLossModel { public: // inherited from Object static TypeId GetTypeId (void); ItuR1411LosPropagationLossModel (); virtual ~ItuR1411LosPropagationLossModel (); /** * Set the operating frequency * * \param freq the frequency in Hz */ void SetFrequency (double freq); /** * * * \param a the first mobility model * \param b the second mobility model * * \return the loss in dBm for the propagation between * the two given mobility models */ double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const; private: // inherited from PropagationLossModel virtual double DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const; virtual int64_t DoAssignStreams (int64_t stream); double m_lambda; // wavelength }; } // namespace ns3 #endif // ITU_R_1411_LOS_PROPAGATION_LOSS_MODEL_H
// Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef XWALK_APPLICATION_TEST_APPLICATION_TESTAPI_H_ #define XWALK_APPLICATION_TEST_APPLICATION_TESTAPI_H_ #include <string> #include "xwalk/extensions/browser/xwalk_extension_function_handler.h" #include "xwalk/extensions/common/xwalk_extension.h" using xwalk::extensions::XWalkExtension; using xwalk::extensions::XWalkExtensionFunctionHandler; using xwalk::extensions::XWalkExtensionFunctionInfo; using xwalk::extensions::XWalkExtensionInstance; namespace content { class MessageLoopRunner; } class ApiTestExtensionInstance : public XWalkExtensionInstance { public: // Observer will be created in UI thread. class Observer { public: virtual void OnTestNotificationReceived( scoped_ptr<XWalkExtensionFunctionInfo> info, const std::string& result_str) = 0; protected: virtual ~Observer() {} }; explicit ApiTestExtensionInstance(Observer* observer = NULL); void HandleMessage(scoped_ptr<base::Value> msg) override; private: void OnNotifyPass(scoped_ptr<XWalkExtensionFunctionInfo> info); void OnNotifyFail(scoped_ptr<XWalkExtensionFunctionInfo> info); void OnNotifyTimeout(scoped_ptr<XWalkExtensionFunctionInfo> info); Observer* observer_; XWalkExtensionFunctionHandler handler_; }; class ApiTestExtension : public XWalkExtension { public: ApiTestExtension(); XWalkExtensionInstance* CreateInstance() override; void SetObserver(ApiTestExtensionInstance::Observer* observer); private: ApiTestExtensionInstance::Observer* observer_; }; class ApiTestRunner : public ApiTestExtensionInstance::Observer { public: enum Result { NOT_SET = 0, PASS, FAILURE, TIMEOUT, }; ApiTestRunner(); ~ApiTestRunner() override; // Block wait until the test API is called. If the test API is already called, // this will return immediately. Returns true if the waiting happened, returns // false if the waiting does not happen. bool WaitForTestNotification(); // Implement ApiTestExtensionInstance::Observer. void OnTestNotificationReceived( scoped_ptr<XWalkExtensionFunctionInfo> info, const std::string& result_str) override; void PostResultToNotificationCallback(); Result GetTestsResult() const; private: // Reset current test result, then it can wait again. void ResetResult(); scoped_ptr<XWalkExtensionFunctionInfo> notify_func_info_; Result result_; scoped_refptr<content::MessageLoopRunner> message_loop_runner_; }; #endif // XWALK_APPLICATION_TEST_APPLICATION_TESTAPI_H_
/* Test the vqrdmulhs_laneq_s32 AArch64 SIMD intrinsic. */ /* { dg-do run } */ /* { dg-options "-save-temps -O3 -fno-inline" } */ #include "arm_neon.h" extern void abort (void); int main (void) { int32_t arg1; int32x4_t arg2; int32_t actual; int32_t expected; arg1 = 32768; arg2 = vcombine_s32 (vcreate_s32 (0x8000ffffffffcd5bULL), vcreate_s32 (0x7fffffffffffffffULL)); actual = vqrdmulhs_laneq_s32 (arg1, arg2, 3); expected = 32768; if (expected != actual) abort (); return 0; } /* { dg-final { scan-assembler-times "sqrdmulh\[ \t\]+\[sS\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[sS\]\\\[3\\\]\n" 1 } } */ /* { dg-final { cleanup-saved-temps } } */
/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ /* * Copyright(c) 2015 - 2018 Intel Corporation. */ #define packettype_name(etype) { RHF_RCV_TYPE_##etype, #etype } #define show_packettype(etype) \ __print_symbolic(etype, \ packettype_name(EXPECTED), \ packettype_name(EAGER), \ packettype_name(IB), \ packettype_name(ERROR), \ packettype_name(BYPASS)) #include "trace_dbg.h" #include "trace_misc.h" #include "trace_ctxts.h" #include "trace_ibhdrs.h" #include "trace_rc.h" #include "trace_rx.h" #include "trace_tx.h" #include "trace_mmu.h" #include "trace_iowait.h" #include "trace_tid.h"
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef LASTEXPRESS_TABLES_H #define LASTEXPRESS_TABLES_H #include "lastexpress/entities/entity.h" namespace LastExpress { class LastExpressEngine; class Tables : public Entity { public: Tables(LastExpressEngine *engine, EntityIndex id); ~Tables() {} /** * Setup Chapter 1 */ DECLARE_FUNCTION(chapter1) /** * Setup Chapter 2 */ DECLARE_FUNCTION(chapter2) /** * Setup Chapter 3 */ DECLARE_FUNCTION(chapter3) /** * Setup Chapter 4 */ DECLARE_FUNCTION(chapter4) /** * Setup Chapter 5 */ DECLARE_FUNCTION(chapter5) /** * Draws tables */ DECLARE_FUNCTION(draw) private: EntityIndex _id; ///< Table entity id }; } // End of namespace LastExpress #endif // LASTEXPRESS_TABLES_H
/* $Id$ */ /* * This file is part of OpenTTD. * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>. */ /** @file subsidy_type.h basic types related to subsidies */ #ifndef SUBSIDY_TYPE_H #define SUBSIDY_TYPE_H #include "core/enum_type.hpp" /** What part of a subsidy is something? */ enum PartOfSubsidy { POS_NONE = 0, ///< nothing POS_SRC = 1 << 0, ///< bit 0 set -> town/industry is source of subsidised path POS_DST = 1 << 1, ///< bit 1 set -> town/industry is destination of subsidised path }; /** Helper to store the PartOfSubsidy data in a single byte. */ typedef SimpleTinyEnumT<PartOfSubsidy, byte> PartOfSubsidyByte; DECLARE_ENUM_AS_BIT_SET(PartOfSubsidy) typedef uint16 SubsidyID; ///< ID of a subsidy struct Subsidy; #endif /* SUBSIDY_TYPE_H */
/* * execIndexScan.h * * Copyright (c) 2013 - present, EMC/Greenplum */ #ifndef EXECINDEXSCAN_H #define EXECINDEXSCAN_H #include "nodes/execnodes.h" extern void InitCommonIndexScanState(IndexScanState *indexstate, IndexScan *node, EState *estate, int eflags); extern Relation OpenIndexRelation(EState *estate, Oid indexOid, Index tableRtIndex); extern void InitRuntimeKeysContext(IndexScanState *indexstate); extern void FreeRuntimeKeysContext(IndexScanState *indexstate); extern void ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals, List *strategies, List *subtypes, ScanKey *scanKeys, int *numScanKeys, IndexRuntimeKeyInfo **runtimeKeys, int *numRuntimeKeys, IndexArrayKeyInfo **arrayKeys, int *numArrayKeys); #endif
// // IFlyPcmRecorder.h // MSC // description: // Created by ypzhao on 12-11-15. // Copyright (c) 2012年 iflytek. All rights reserved. // #import <Foundation/Foundation.h> #import <AudioToolbox/AudioQueue.h> #import <AudioToolbox/AudioFile.h> #import <AudioToolbox/AudioServices.h> #import <AudioToolbox/AudioConverter.h> #import <AVFoundation/AVAudioSession.h> @class IFlyPcmRecorder; /** * 录音协议 */ @protocol IFlyPcmRecorderDelegate<NSObject> /** * 回调音频数据 * * @param buffer 音频数据 * @param size 表示音频的长度 */ - (void) onIFlyRecorderBuffer: (const void *)buffer bufferSize:(int)size; /** * 回调音频的错误码 * * @param recoder 录音器 * @param error 错误码 */ - (void) onIFlyRecorderError:(IFlyPcmRecorder*)recoder theError:(int) error; @optional /** * 回调录音音量 * * @param power 音量值 */ - (void) onIFlyRecorderVolumeChanged:(int) power; @end /** * 录音封装 */ @interface IFlyPcmRecorder : NSObject<AVAudioSessionDelegate> /** * 录音委托对象 */ @property (assign) id<IFlyPcmRecorderDelegate> delegate; /** * 单例模式 * * @return 返回录音对象单例 */ + (instancetype) sharedInstance; /** * 开始录音 * * @return 开启录音成功返回YES,否则返回NO */ - (BOOL) start; /** * 停止录音 */ - (void) stop; /** * 设置音频采样率 * * @param rate -[in] 采样率,8k/16k */ - (void) setSample:(NSString *) rate; /* * 设置录音时间间隔参数 */ - (void) setPowerCycle:(float) cycle; /** * 保存录音 * * @param savePath 音频保存路径 */ -(void) setSaveAudioPath:(NSString *)savePath; @end
/* linux/drivers/media/video/s5p-jpeg/jpeg-core.h * * Copyright (c) 2011 Samsung Electronics Co., Ltd. * http://www.samsung.com * * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef JPEG_CORE_H_ #define JPEG_CORE_H_ #include <media/v4l2-device.h> #include <media/v4l2-fh.h> #include <media/v4l2-ctrls.h> #define S5P_JPEG_M2M_NAME "s5p-jpeg" #define S5P_JPEG_COMPR_QUAL_BEST 0 #define S5P_JPEG_COMPR_QUAL_WORST 3 #define S5P_JPEG_COEF11 0x4d #define S5P_JPEG_COEF12 0x97 #define S5P_JPEG_COEF13 0x1e #define S5P_JPEG_COEF21 0x2c #define S5P_JPEG_COEF22 0x57 #define S5P_JPEG_COEF23 0x83 #define S5P_JPEG_COEF31 0x83 #define S5P_JPEG_COEF32 0x6e #define S5P_JPEG_COEF33 0x13 #define TEM 0x01 #define SOF0 0xc0 #define RST 0xd0 #define SOI 0xd8 #define EOI 0xd9 #define DHP 0xde #define MEM2MEM_CAPTURE (1 << 0) #define MEM2MEM_OUTPUT (1 << 1) struct s5p_jpeg { struct mutex lock; struct spinlock slock; struct v4l2_device v4l2_dev; struct video_device *vfd_encoder; struct video_device *vfd_decoder; struct v4l2_m2m_dev *m2m_dev; struct resource *ioarea; void __iomem *regs; unsigned int irq; struct clk *clk; struct device *dev; void *alloc_ctx; }; struct s5p_jpeg_fmt { char *name; u32 fourcc; int depth; int colplanes; int h_align; int v_align; u32 types; }; struct s5p_jpeg_q_data { struct s5p_jpeg_fmt *fmt; u32 w; u32 h; u32 size; }; struct s5p_jpeg_ctx { struct s5p_jpeg *jpeg; unsigned int mode; unsigned short compr_quality; unsigned short restart_interval; unsigned short subsampling; struct v4l2_m2m_ctx *m2m_ctx; struct s5p_jpeg_q_data out_q; struct s5p_jpeg_q_data cap_q; struct v4l2_fh fh; bool hdr_parsed; struct v4l2_ctrl_handler ctrl_handler; }; struct s5p_jpeg_buffer { unsigned long size; unsigned long curr; unsigned long data; }; #endif
/* * This file is part of wl1271 * * Copyright (C) 2008-2009 Nokia Corporation * * Contact: Luciano Coelho <luciano.coelho@nokia.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef __PS_H__ #define __PS_H__ #include "wl12xx.h" #include "acx.h" int wl1271_ps_set_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif, enum wl1271_cmd_ps_mode mode); void wl1271_ps_elp_sleep(struct wl1271 *wl); int wl1271_ps_elp_wakeup(struct wl1271 *wl); void wl1271_elp_work(struct work_struct *work); void wl12xx_ps_link_start(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 hlid, bool clean_queues); void wl12xx_ps_link_end(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 hlid); #define WL1271_PS_COMPLETE_TIMEOUT 500 #endif
/* * Copyright (c) 2003 VIA Networking, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * * File: tcrc.c * * Purpose: Implement functions to caculate CRC * * Author: Tevin Chen * * Date: May 21, 1996 * * Functions: * CRCdwCrc32 - * CRCdwGetCrc32 - * CRCdwGetCrc32Ex - * * Revision History: * */ #include "tcrc.h" static const unsigned long s_adwCrc32Table[256] = { 0x00000000L, 0x77073096L, 0xEE0E612CL, 0x990951BAL, 0x076DC419L, 0x706AF48FL, 0xE963A535L, 0x9E6495A3L, 0x0EDB8832L, 0x79DCB8A4L, 0xE0D5E91EL, 0x97D2D988L, 0x09B64C2BL, 0x7EB17CBDL, 0xE7B82D07L, 0x90BF1D91L, 0x1DB71064L, 0x6AB020F2L, 0xF3B97148L, 0x84BE41DEL, 0x1ADAD47DL, 0x6DDDE4EBL, 0xF4D4B551L, 0x83D385C7L, 0x136C9856L, 0x646BA8C0L, 0xFD62F97AL, 0x8A65C9ECL, 0x14015C4FL, 0x63066CD9L, 0xFA0F3D63L, 0x8D080DF5L, 0x3B6E20C8L, 0x4C69105EL, 0xD56041E4L, 0xA2677172L, 0x3C03E4D1L, 0x4B04D447L, 0xD20D85FDL, 0xA50AB56BL, 0x35B5A8FAL, 0x42B2986CL, 0xDBBBC9D6L, 0xACBCF940L, 0x32D86CE3L, 0x45DF5C75L, 0xDCD60DCFL, 0xABD13D59L, 0x26D930ACL, 0x51DE003AL, 0xC8D75180L, 0xBFD06116L, 0x21B4F4B5L, 0x56B3C423L, 0xCFBA9599L, 0xB8BDA50FL, 0x2802B89EL, 0x5F058808L, 0xC60CD9B2L, 0xB10BE924L, 0x2F6F7C87L, 0x58684C11L, 0xC1611DABL, 0xB6662D3DL, 0x76DC4190L, 0x01DB7106L, 0x98D220BCL, 0xEFD5102AL, 0x71B18589L, 0x06B6B51FL, 0x9FBFE4A5L, 0xE8B8D433L, 0x7807C9A2L, 0x0F00F934L, 0x9609A88EL, 0xE10E9818L, 0x7F6A0DBBL, 0x086D3D2DL, 0x91646C97L, 0xE6635C01L, 0x6B6B51F4L, 0x1C6C6162L, 0x856530D8L, 0xF262004EL, 0x6C0695EDL, 0x1B01A57BL, 0x8208F4C1L, 0xF50FC457L, 0x65B0D9C6L, 0x12B7E950L, 0x8BBEB8EAL, 0xFCB9887CL, 0x62DD1DDFL, 0x15DA2D49L, 0x8CD37CF3L, 0xFBD44C65L, 0x4DB26158L, 0x3AB551CEL, 0xA3BC0074L, 0xD4BB30E2L, 0x4ADFA541L, 0x3DD895D7L, 0xA4D1C46DL, 0xD3D6F4FBL, 0x4369E96AL, 0x346ED9FCL, 0xAD678846L, 0xDA60B8D0L, 0x44042D73L, 0x33031DE5L, 0xAA0A4C5FL, 0xDD0D7CC9L, 0x5005713CL, 0x270241AAL, 0xBE0B1010L, 0xC90C2086L, 0x5768B525L, 0x206F85B3L, 0xB966D409L, 0xCE61E49FL, 0x5EDEF90EL, 0x29D9C998L, 0xB0D09822L, 0xC7D7A8B4L, 0x59B33D17L, 0x2EB40D81L, 0xB7BD5C3BL, 0xC0BA6CADL, 0xEDB88320L, 0x9ABFB3B6L, 0x03B6E20CL, 0x74B1D29AL, 0xEAD54739L, 0x9DD277AFL, 0x04DB2615L, 0x73DC1683L, 0xE3630B12L, 0x94643B84L, 0x0D6D6A3EL, 0x7A6A5AA8L, 0xE40ECF0BL, 0x9309FF9DL, 0x0A00AE27L, 0x7D079EB1L, 0xF00F9344L, 0x8708A3D2L, 0x1E01F268L, 0x6906C2FEL, 0xF762575DL, 0x806567CBL, 0x196C3671L, 0x6E6B06E7L, 0xFED41B76L, 0x89D32BE0L, 0x10DA7A5AL, 0x67DD4ACCL, 0xF9B9DF6FL, 0x8EBEEFF9L, 0x17B7BE43L, 0x60B08ED5L, 0xD6D6A3E8L, 0xA1D1937EL, 0x38D8C2C4L, 0x4FDFF252L, 0xD1BB67F1L, 0xA6BC5767L, 0x3FB506DDL, 0x48B2364BL, 0xD80D2BDAL, 0xAF0A1B4CL, 0x36034AF6L, 0x41047A60L, 0xDF60EFC3L, 0xA867DF55L, 0x316E8EEFL, 0x4669BE79L, 0xCB61B38CL, 0xBC66831AL, 0x256FD2A0L, 0x5268E236L, 0xCC0C7795L, 0xBB0B4703L, 0x220216B9L, 0x5505262FL, 0xC5BA3BBEL, 0xB2BD0B28L, 0x2BB45A92L, 0x5CB36A04L, 0xC2D7FFA7L, 0xB5D0CF31L, 0x2CD99E8BL, 0x5BDEAE1DL, 0x9B64C2B0L, 0xEC63F226L, 0x756AA39CL, 0x026D930AL, 0x9C0906A9L, 0xEB0E363FL, 0x72076785L, 0x05005713L, 0x95BF4A82L, 0xE2B87A14L, 0x7BB12BAEL, 0x0CB61B38L, 0x92D28E9BL, 0xE5D5BE0DL, 0x7CDCEFB7L, 0x0BDBDF21L, 0x86D3D2D4L, 0xF1D4E242L, 0x68DDB3F8L, 0x1FDA836EL, 0x81BE16CDL, 0xF6B9265BL, 0x6FB077E1L, 0x18B74777L, 0x88085AE6L, 0xFF0F6A70L, 0x66063BCAL, 0x11010B5CL, 0x8F659EFFL, 0xF862AE69L, 0x616BFFD3L, 0x166CCF45L, 0xA00AE278L, 0xD70DD2EEL, 0x4E048354L, 0x3903B3C2L, 0xA7672661L, 0xD06016F7L, 0x4969474DL, 0x3E6E77DBL, 0xAED16A4AL, 0xD9D65ADCL, 0x40DF0B66L, 0x37D83BF0L, 0xA9BCAE53L, 0xDEBB9EC5L, 0x47B2CF7FL, 0x30B5FFE9L, 0xBDBDF21CL, 0xCABAC28AL, 0x53B39330L, 0x24B4A3A6L, 0xBAD03605L, 0xCDD70693L, 0x54DE5729L, 0x23D967BFL, 0xB3667A2EL, 0xC4614AB8L, 0x5D681B02L, 0x2A6F2B94L, 0xB40BBE37L, 0xC30C8EA1L, 0x5A05DF1BL, 0x2D02EF8DL }; unsigned long CRCdwCrc32 (unsigned char *pbyData, unsigned int cbByte, unsigned long dwCrcSeed) { unsigned long dwCrc; dwCrc = dwCrcSeed; while (cbByte--) { dwCrc = s_adwCrc32Table[(unsigned char)((dwCrc ^ (*pbyData)) & 0xFF)] ^ (dwCrc >> 8); pbyData++; } return dwCrc; } unsigned long CRCdwGetCrc32 (unsigned char *pbyData, unsigned int cbByte) { return ~CRCdwCrc32(pbyData, cbByte, 0xFFFFFFFFL); } unsigned long CRCdwGetCrc32Ex(unsigned char *pbyData, unsigned int cbByte, unsigned long dwPreCRC) { return CRCdwCrc32(pbyData, cbByte, dwPreCRC); }
/* vi: set sw=4 ts=4: */ /* * sigaltstack() for uClibc * * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include <sys/syscall.h> #include <signal.h> #if defined __NR_sigaltstack && (defined __USE_BSD || defined __USE_UNIX98) _syscall2(int, sigaltstack, const struct sigaltstack *, ss, struct sigaltstack *, oss) #endif
#ifndef __ASM_SH_USER_H #define __ASM_SH_USER_H #include <asm/ptrace.h> #include <asm/page.h> /* * Core file format: The core file is written in such a way that gdb * can understand it and provide useful information to the user (under * linux we use the `trad-core' bfd). The file contents are as follows: * * upage: 1 page consisting of a user struct that tells gdb * what is present in the file. Directly after this is a * copy of the task_struct, which is currently not used by gdb, * but it may come in handy at some point. All of the registers * are stored as part of the upage. The upage should always be * only one page long. * data: The data segment follows next. We use current->end_text to * current->brk to pick up all of the user variables, plus any memory * that may have been sbrk'ed. No attempt is made to determine if a * page is demand-zero or if a page is totally unused, we just cover * the entire range. All of the addresses are rounded in such a way * that an integral number of pages is written. * stack: We need the stack information in order to get a meaningful * backtrace. We need to write the data from usp to * current->start_stack, so we round each of these in order to be able * to write an integer number of pages. */ #if defined(__SH5__) || defined(CONFIG_CPU_SH5) struct user_fpu_struct { unsigned long fp_regs[32]; unsigned int fpscr; }; #else struct user_fpu_struct { unsigned long fp_regs[16]; unsigned long xfp_regs[16]; unsigned long fpscr; unsigned long fpul; }; #endif struct user { struct pt_regs regs; struct user_fpu_struct fpu; int u_fpvalid; size_t u_tsize; size_t u_dsize; size_t u_ssize; unsigned long start_code; unsigned long start_data; unsigned long start_stack; long int signal; unsigned long u_ar0; struct user_fpu_struct* u_fpstate; unsigned long magic; char u_comm[32]; }; #define NBPG PAGE_SIZE #define UPAGES 1 #define HOST_TEXT_START_ADDR (u.start_code) #define HOST_DATA_START_ADDR (u.start_data) #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) #endif
#ifndef __INET_PTON_H #define __INET_PTON_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id: inet_pton.h,v 1.8 2008-09-24 19:13:02 yangtse Exp $ ***************************************************************************/ #include "setup.h" int Curl_inet_pton(int, const char *, void *); #ifdef HAVE_INET_PTON #ifdef HAVE_ARPA_INET_H #include <arpa/inet.h> #endif #define Curl_inet_pton(x,y,z) inet_pton(x,y,z) #endif #endif /* __INET_PTON_H */
/* This file is part of Telegram Desktop, the official desktop version of Telegram messaging app, see https://telegram.org Telegram Desktop 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. It 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. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once #include "abstractbox.h" class ConfirmBox; struct SessionData { uint64 hash; int32 activeTime; int32 nameWidth, activeWidth, infoWidth, ipWidth; QString name, active, info, ip; }; typedef QList<SessionData> SessionsList; class SessionsInner : public QWidget, public RPCSender { Q_OBJECT public: SessionsInner(SessionsList *list); void paintEvent(QPaintEvent *e); void resizeEvent(QResizeEvent *e); void listUpdated(); ~SessionsInner(); signals: void oneTerminated(); public slots: void onTerminate(); void onTerminateSure(); void onNoTerminateBox(QObject *obj); private: void terminateDone(uint64 hash, const MTPBool &result); bool terminateFail(uint64 hash, const RPCError &error); SessionsList *_list; typedef QMap<uint64, IconedButton*> TerminateButtons; TerminateButtons _terminateButtons; uint64 _terminating; ConfirmBox *_terminateBox; }; class SessionsBox : public ScrollableBox, public RPCSender { Q_OBJECT public: SessionsBox(); void resizeEvent(QResizeEvent *e); void paintEvent(QPaintEvent *e); public slots: void onTerminateAll(); void onTerminateAllSure(); void onNoTerminateBox(QObject *obj); void onOneTerminated(); void onShortPollAuthorizations(); void onNewAuthorization(); protected: void hideAll(); void showAll(); private: void gotAuthorizations(const MTPaccount_Authorizations &result); void terminateAllDone(const MTPBool &res); bool terminateAllFail(const RPCError &error); bool _loading; SessionData _current; SessionsList _list; SessionsInner _inner; FlatButton _done; LinkButton _terminateAll; ConfirmBox *_terminateBox; SingleTimer _shortPollTimer; mtpRequestId _shortPollRequest; };
/** * Native Board LED implementation * * Only prints function calls at the moment. * * Copyright (C) 2014 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de> * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. * * @ingroup boards_native * @{ * @file * @author Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de> * @} */ #include <stdio.h> #include "board.h" void _native_LED_GREEN_OFF(void) { printf("LED_GREEN_OFF\n"); } void _native_LED_GREEN_ON(void) { printf("LED_GREEN_ON\n"); } void _native_LED_GREEN_TOGGLE(void) { printf("LED_GREEN_TOGGLE\n"); } void _native_LED_RED_OFF(void) { printf("LED_RED_OFF\n"); } void _native_LED_RED_ON(void) { printf("LED_RED_ON\n"); } void _native_LED_RED_TOGGLE(void) { printf("LED_RED_TOGGLE\n"); }
#include "WebCore/platform/graphics/GraphicsLayerClient.h"
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CONTRIB_TENSORBOARD_DB_SUMMARY_DB_WRITER_H_ #define TENSORFLOW_CONTRIB_TENSORBOARD_DB_SUMMARY_DB_WRITER_H_ #include "tensorflow/core/kernels/summary_interface.h" #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/db/sqlite.h" #include "tensorflow/core/platform/env.h" namespace tensorflow { /// \brief Creates SQLite SummaryWriterInterface. /// /// This can be used to write tensors from the execution graph directly /// to a database. The schema must be created beforehand. Entries in /// Users, Experiments, and Runs tables will be created automatically /// if they don't already exist. /// /// Please note that the type signature of this function may change in /// the future if support for other DBs is added to core. /// /// The result holds a new reference to db. Status CreateSummaryDbWriter(Sqlite* db, const string& experiment_name, const string& run_name, const string& user_name, Env* env, SummaryWriterInterface** result); } // namespace tensorflow #endif // TENSORFLOW_CONTRIB_TENSORBOARD_DB_SUMMARY_DB_WRITER_H_
/* Generic simulator halt/resume. Copyright (C) 1997-2015 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GDB, the GNU debugger. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SIM_ENGINE_H #define SIM_ENGINE_H typedef struct _sim_engine sim_engine; struct _sim_engine { void *jmpbuf; sim_cpu *last_cpu; sim_cpu *next_cpu; int nr_cpus; enum sim_stop reason; sim_event *stepper; int sigrc; }; /* jmpval: 0 (initial use) start simulator 1 halt simulator 2 restart simulator This is required by the ISO C standard (the only time 0 is returned is at the initial call to setjmp). */ enum { sim_engine_start_jmpval, sim_engine_halt_jmpval, sim_engine_restart_jmpval, }; /* Get/set the run state of CPU to REASON/SIGRC. REASON/SIGRC are the values returned by sim_stop_reason. */ void sim_engine_get_run_state (SIM_DESC sd, enum sim_stop *reason, int *sigrc); void sim_engine_set_run_state (SIM_DESC sd, enum sim_stop reason, int sigrc); /* Halt the simulator *now* */ extern void sim_engine_halt (SIM_DESC sd, sim_cpu *last_cpu, /* NULL -> in event-mgr */ sim_cpu *next_cpu, /* NULL -> succ (last_cpu) or event-mgr */ sim_cia cia, enum sim_stop reason, int sigrc) __attribute__ ((noreturn)); /* Halt hook - allow target specific operation when halting a simulator */ #if !defined (SIM_ENGINE_HALT_HOOK) #define SIM_ENGINE_HALT_HOOK(SD, LAST_CPU, CIA) \ if ((LAST_CPU) != NULL) CPU_PC_SET (LAST_CPU, CIA) #endif /* NB: If a port uses the SIM_CPU_EXCEPTION_* hooks, the default SIM_ENGINE_HALT_HOOK and SIM_ENGINE_RESUME_HOOK must not be used. They conflict in that the PC set by the HALT_HOOK may overwrite the proper one, as intended to be saved by the EXCEPTION_TRIGGER hook. */ /* restart the simulator *now* */ extern void sim_engine_restart (SIM_DESC sd, sim_cpu *last_cpu, /* NULL -> in event-mgr */ sim_cpu *next_cpu, /* NULL -> succ (last_cpu) or event-mgr */ sim_cia cia); /* Restart hook - allow target specific operation when restarting a simulator */ #if !defined (SIM_ENGINE_RESTART_HOOK) #define SIM_ENGINE_RESTART_HOOK(SD, LAST_CPU, CIA) SIM_ENGINE_HALT_HOOK(SD, LAST_CPU, CIA) #endif /* Abort the simulator *now*. This function is NULL safe. It can be called when either of SD or CIA are NULL. This function is setjmp/longjmp safe. It can be called when of the sim_engine setjmp/longjmp buffer has not been established. Simulators that are using components such as sim-core but are not yet using this sim-engine module should link in file sim-abort.o which implements a non setjmp/longjmp version of sim_engine_abort. */ extern void sim_engine_abort (SIM_DESC sd, sim_cpu *cpu, sim_cia cia, const char *fmt, ...) __attribute__ ((format (printf, 4, 5))) __attribute__ ((noreturn)); extern void sim_engine_vabort (SIM_DESC sd, sim_cpu *cpu, sim_cia cia, const char *fmt, va_list ap) __attribute__ ((noreturn)); /* No abort hook - when possible this function exits using the engine_halt function (and SIM_ENGINE_HALT_HOOK). */ /* Called by the generic sim_resume to run the simulation within the above safty net. An example implementation of sim_engine_run can be found in the file sim-run.c */ extern void sim_engine_run (SIM_DESC sd, int next_cpu_nr, int nr_cpus, int siggnal); /* most simulators ignore siggnal */ /* Determine the state of next/last cpu when the simulator was last halted - a value >= MAX_NR_PROCESSORS indicates that the event-queue was next/last. */ extern int sim_engine_next_cpu_nr (SIM_DESC sd); extern int sim_engine_last_cpu_nr (SIM_DESC sd); extern int sim_engine_nr_cpus (SIM_DESC sd); /* Establish the simulator engine */ MODULE_INSTALL_FN sim_engine_install; #endif
/** * \file thumb.c * Example program to send and associate album art to an entity * on a device. * * Copyright (C) 2006 Robert Reardon <rreardon@monkshatch.vispa.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "config.h" #include "common.h" #include "string.h" #include <fcntl.h> #include <errno.h> #include <stdlib.h> #include <unistd.h> #include <limits.h> #include <sys/types.h> #ifdef HAVE_SYS_UIO_H #include <sys/uio.h> #endif #include <sys/stat.h> static void usage(void) { printf("Usage: thumb -i <fileid/trackid> <imagefile>\n"); exit(0); } int main (int argc, char **argv) { int opt; extern int optind; extern char *optarg; LIBMTP_mtpdevice_t *device = NULL; int fd; uint32_t id = 0; uint64_t filesize; uint8_t *imagedata = NULL; char *path = NULL; char *rest; struct stat statbuff; int ret; fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n"); while ( (opt = getopt(argc, argv, "hi:")) != -1 ) { switch (opt) { case 'h': usage(); case 'i': id = strtoul(optarg, &rest, 0); break; default: usage(); } } argc -= optind; argv += optind; if ( argc != 1 ) { printf("You need to pass a filename.\n"); usage(); } path = argv[0]; if ( stat(path, &statbuff) == -1 ) { fprintf(stderr, "%s: ", path); perror("stat"); exit(1); } filesize = (uint64_t) statbuff.st_size; imagedata = malloc(filesize * sizeof(uint16_t)); #ifdef __WIN32__ if ( (fd = open(path, O_RDONLY|O_BINARY) == -1) ) { #else if ( (fd = open(path, O_RDONLY)) == -1) { #endif printf("Couldn't open image file %s (%s)\n",path,strerror(errno)); return 1; } else { read(fd, imagedata, filesize); close(fd); } LIBMTP_Init(); device = LIBMTP_Get_First_Device(); if (device == NULL) { printf("No devices.\n"); return 0; } LIBMTP_filesampledata_t *thumb = LIBMTP_new_filesampledata_t(); int i; thumb->data = malloc(sizeof(uint16_t) * filesize); for (i = 0; i < filesize; i++) { thumb->data[i] = imagedata[i]; } thumb->size = filesize; thumb->filetype = LIBMTP_FILETYPE_JPEG; ret = LIBMTP_Send_Representative_Sample(device,id,thumb); if (ret != 0) { printf("Couldn't send thumbnail\n"); LIBMTP_Dump_Errorstack(device); LIBMTP_Clear_Errorstack(device); } free(imagedata); LIBMTP_destroy_filesampledata_t(thumb); LIBMTP_Release_Device(device); printf("OK.\n"); return 0; }
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* Defines to make different thread packages compatible */ #ifndef THREAD_TYPE_INCLUDED #define THREAD_TYPE_INCLUDED #ifdef __cplusplus extern "C"{ #endif /* Flags for the THD::system_thread variable */ enum enum_thread_type { NON_SYSTEM_THREAD= 0, SYSTEM_THREAD_SLAVE_IO= 1, SYSTEM_THREAD_SLAVE_SQL= 2, SYSTEM_THREAD_NDBCLUSTER_BINLOG= 4, SYSTEM_THREAD_EVENT_SCHEDULER= 8, SYSTEM_THREAD_EVENT_WORKER= 16, SYSTEM_THREAD_INFO_REPOSITORY= 32, SYSTEM_THREAD_SLAVE_WORKER= 64, SYSTEM_THREAD_COMPRESS_GTID_TABLE= 128, SYSTEM_THREAD_BACKGROUND= 256 }; #ifdef __cplusplus } #endif #endif /* THREAD_TYPE_INCLUDED */
/* * Copyright (C) 2015-2018 Team Kodi * This file is part of Kodi - https://kodi.tv * * SPDX-License-Identifier: GPL-2.0-or-later * See LICENSES/README.md for more information. */ #pragma once #include <androidjni/Activity.h> #include <androidjni/InputManager.h> #include <androidjni/Rect.h> class CJNIMainActivity : public CJNIActivity, public CJNIInputManagerInputDeviceListener { public: explicit CJNIMainActivity(const ANativeActivity *nativeActivity); ~CJNIMainActivity() override; static CJNIMainActivity* GetAppInstance() { return m_appInstance; } static void _onNewIntent(JNIEnv *env, jobject context, jobject intent); static void _onActivityResult(JNIEnv *env, jobject context, jint requestCode, jint resultCode, jobject resultData); static void _onVolumeChanged(JNIEnv *env, jobject context, jint volume); static void _doFrame(JNIEnv *env, jobject context, jlong frameTimeNanos); static void _onInputDeviceAdded(JNIEnv *env, jobject context, jint deviceId); static void _onInputDeviceChanged(JNIEnv *env, jobject context, jint deviceId); static void _onInputDeviceRemoved(JNIEnv *env, jobject context, jint deviceId); static void _onVisibleBehindCanceled(JNIEnv *env, jobject context); static void _callNative(JNIEnv *env, jobject context, jlong funcAddr, jlong variantAddr); static void runNativeOnUiThread(void (*callback)(CVariant *), CVariant *variant); static void registerMediaButtonEventReceiver(); static void unregisterMediaButtonEventReceiver(); CJNIRect getDisplayRect(); private: static CJNIMainActivity *m_appInstance; protected: virtual void onNewIntent(CJNIIntent intent)=0; virtual void onActivityResult(int requestCode, int resultCode, CJNIIntent resultData)=0; virtual void onVolumeChanged(int volume)=0; virtual void doFrame(int64_t frameTimeNanos)=0; void onVisibleBehindCanceled() override = 0; virtual void onDisplayAdded(int displayId)=0; virtual void onDisplayChanged(int displayId)=0; virtual void onDisplayRemoved(int displayId)=0; };
/* FUNCTION <<reent>>---definition of impure data. INDEX reent DESCRIPTION This module defines the impure data area used by the non-reentrant functions, such as strtok. */ #include <stdlib.h> #include <reent.h> #ifdef _REENT_ONLY #ifndef REENTRANT_SYSCALLS_PROVIDED #define REENTRANT_SYSCALLS_PROVIDED #endif #endif #ifndef REENTRANT_SYSCALLS_PROVIDED /* We use the errno variable used by the system dependent layer. */ #undef errno int errno; #endif /* Interim cleanup code */ void _DEFUN (cleanup_glue, (ptr, glue), struct _reent *ptr _AND struct _glue *glue) { /* Have to reclaim these in reverse order: */ if (glue->_next) cleanup_glue (ptr, glue->_next); _free_r (ptr, glue); } void _DEFUN (_reclaim_reent, (ptr), struct _reent *ptr) { if (ptr != _impure_ptr) { /* used by mprec routines. */ #ifdef _REENT_SMALL if (ptr->_mp) /* don't bother allocating it! */ { #endif if (_REENT_MP_FREELIST(ptr)) { int i; for (i = 0; i < _Kmax; i++) { struct _Bigint *thisone, *nextone; nextone = _REENT_MP_FREELIST(ptr)[i]; while (nextone) { thisone = nextone; nextone = nextone->_next; _free_r (ptr, thisone); } } _free_r (ptr, _REENT_MP_FREELIST(ptr)); } if (_REENT_MP_RESULT(ptr)) _free_r (ptr, _REENT_MP_RESULT(ptr)); #ifdef _REENT_SMALL } #endif #ifdef _REENT_SMALL if (ptr->_emergency) _free_r (ptr, ptr->_emergency); if (ptr->_mp) _free_r (ptr, ptr->_mp); if (ptr->_r48) _free_r (ptr, ptr->_r48); if (ptr->_localtime_buf) _free_r (ptr, ptr->_localtime_buf); if (ptr->_asctime_buf) _free_r (ptr, ptr->_asctime_buf); if (ptr->_atexit && ptr->_atexit->_on_exit_args_ptr) _free_r (ptr, ptr->_atexit->_on_exit_args_ptr); #else /* atexit stuff */ if ((ptr->_atexit) && (ptr->_atexit != &ptr->_atexit0)) { struct _atexit *p, *q; for (p = ptr->_atexit; p != &ptr->_atexit0;) { q = p; p = p->_next; _free_r (ptr, q); } } #endif if (ptr->_cvtbuf) _free_r (ptr, ptr->_cvtbuf); if (ptr->__sdidinit) { /* cleanup won't reclaim memory 'coz usually it's run before the program exits, and who wants to wait for that? */ ptr->__cleanup (ptr); if (ptr->__sglue._next) cleanup_glue (ptr, ptr->__sglue._next); } /* Malloc memory not reclaimed; no good way to return memory anyway. */ } } /* * Do atexit() processing and cleanup * * NOTE: This is to be executed at task exit. It does not tear anything * down which is used on a global basis. */ void _DEFUN (_wrapup_reent, (ptr), struct _reent *ptr) { register struct _atexit *p; register int n; if (ptr == NULL) ptr = _REENT; #ifdef _REENT_SMALL for (p = ptr->_atexit, n = p ? p->_ind : 0; --n >= 0;) (*p->_fns[n]) (); #else for (p = ptr->_atexit; p; p = p->_next) for (n = p->_ind; --n >= 0;) (*p->_fns[n]) (); #endif if (ptr->__cleanup) (*ptr->__cleanup) (ptr); }
#pragma once #include "const.h" inline int f() { return N::k; }
#include "fe.h" #include "crypto_int64.h" /* h = f * 121666 Can overlap h with f. Preconditions: |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. Postconditions: |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. */ void fe_mul121666(fe h,fe f) { crypto_int32 f0 = f[0]; crypto_int32 f1 = f[1]; crypto_int32 f2 = f[2]; crypto_int32 f3 = f[3]; crypto_int32 f4 = f[4]; crypto_int32 f5 = f[5]; crypto_int32 f6 = f[6]; crypto_int32 f7 = f[7]; crypto_int32 f8 = f[8]; crypto_int32 f9 = f[9]; crypto_int64 h0 = f0 * (crypto_int64) 121666; crypto_int64 h1 = f1 * (crypto_int64) 121666; crypto_int64 h2 = f2 * (crypto_int64) 121666; crypto_int64 h3 = f3 * (crypto_int64) 121666; crypto_int64 h4 = f4 * (crypto_int64) 121666; crypto_int64 h5 = f5 * (crypto_int64) 121666; crypto_int64 h6 = f6 * (crypto_int64) 121666; crypto_int64 h7 = f7 * (crypto_int64) 121666; crypto_int64 h8 = f8 * (crypto_int64) 121666; crypto_int64 h9 = f9 * (crypto_int64) 121666; crypto_int64 carry0; crypto_int64 carry1; crypto_int64 carry2; crypto_int64 carry3; crypto_int64 carry4; crypto_int64 carry5; crypto_int64 carry6; crypto_int64 carry7; crypto_int64 carry8; crypto_int64 carry9; carry9 = (h9 + (crypto_int64) (1<<24)) >> 25; h0 += carry9 * 19; h9 -= carry9 << 25; carry1 = (h1 + (crypto_int64) (1<<24)) >> 25; h2 += carry1; h1 -= carry1 << 25; carry3 = (h3 + (crypto_int64) (1<<24)) >> 25; h4 += carry3; h3 -= carry3 << 25; carry5 = (h5 + (crypto_int64) (1<<24)) >> 25; h6 += carry5; h5 -= carry5 << 25; carry7 = (h7 + (crypto_int64) (1<<24)) >> 25; h8 += carry7; h7 -= carry7 << 25; carry0 = (h0 + (crypto_int64) (1<<25)) >> 26; h1 += carry0; h0 -= carry0 << 26; carry2 = (h2 + (crypto_int64) (1<<25)) >> 26; h3 += carry2; h2 -= carry2 << 26; carry4 = (h4 + (crypto_int64) (1<<25)) >> 26; h5 += carry4; h4 -= carry4 << 26; carry6 = (h6 + (crypto_int64) (1<<25)) >> 26; h7 += carry6; h6 -= carry6 << 26; carry8 = (h8 + (crypto_int64) (1<<25)) >> 26; h9 += carry8; h8 -= carry8 << 26; h[0] = h0; h[1] = h1; h[2] = h2; h[3] = h3; h[4] = h4; h[5] = h5; h[6] = h6; h[7] = h7; h[8] = h8; h[9] = h9; }
/* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _NETATALK_AT_H #define _NETATALK_AT_H 1 #include <asm/types.h> #include <bits/sockaddr.h> #include <linux/atalk.h> #include <sys/socket.h> #define SOL_ATALK 258 /* sockopt level for atalk */ #endif /* netatalk/at.h */
/* * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu> * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef TIME_INTERNAL_H_INCLUDED_ #define TIME_INTERNAL_H_INCLUDED_ #include "event2/event-config.h" #include "evconfig-private.h" #ifdef EVENT__HAVE_MACH_MACH_TIME_H /* For mach_timebase_info */ #include <mach/mach_time.h> #endif #include <time.h> #include "event2/util.h" #ifdef __cplusplus extern "C" { #endif #if defined(EVENT__HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) #define HAVE_POSIX_MONOTONIC #elif defined(EVENT__HAVE_MACH_ABSOLUTE_TIME) #define HAVE_MACH_MONOTONIC #elif defined(_WIN32) #define HAVE_WIN32_MONOTONIC #else #define HAVE_FALLBACK_MONOTONIC #endif long evutil_tv_to_msec_(const struct timeval *tv); void evutil_usleep_(const struct timeval *tv); #ifdef _WIN32 typedef ULONGLONG (WINAPI *ev_GetTickCount_func)(void); #endif struct evutil_monotonic_timer { #ifdef HAVE_MACH_MONOTONIC struct mach_timebase_info mach_timebase_units; #endif #ifdef HAVE_POSIX_MONOTONIC int monotonic_clock; #endif #ifdef HAVE_WIN32_MONOTONIC ev_GetTickCount_func GetTickCount64_fn; ev_GetTickCount_func GetTickCount_fn; ev_uint64_t last_tick_count; ev_uint64_t adjust_tick_count; ev_uint64_t first_tick; ev_uint64_t first_counter; double usec_per_count; int use_performance_counter; #endif struct timeval adjust_monotonic_clock; struct timeval last_time; }; int evutil_configure_monotonic_time_(struct evutil_monotonic_timer *mt, int flags); int evutil_gettime_monotonic_(struct evutil_monotonic_timer *mt, struct timeval *tv); #ifdef __cplusplus } #endif #endif /* EVENT_INTERNAL_H_INCLUDED_ */
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: utility functions for vorbis codec test suite. last mod: $Id: util.h 19015 2013-11-12 04:13:28Z giles $ ********************************************************************/ #define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0])) /* Create simple test data consisting of a windowed sine wave. */ void gen_windowed_sine (float *data, int len, float maximum) ; /* Set len values of data array to given value. */ void set_data_in (float * data, unsigned len, float value) ;
/* * Copyright (C) 2012-2018 Team Kodi * This file is part of Kodi - https://kodi.tv * * SPDX-License-Identifier: GPL-2.0-or-later * See LICENSES/README.md for more information. */ #pragma once #include "guilib/GUIDialog.h" #include <string> #include <vector> class CGUIDialogProgressBarHandle { public: explicit CGUIDialogProgressBarHandle(const std::string &strTitle) : m_fPercentage(0), m_strTitle(strTitle), m_bFinished(false) {} virtual ~CGUIDialogProgressBarHandle(void) = default; const std::string &Title(void) { return m_strTitle; } void SetTitle(const std::string &strTitle); std::string Text(void) const; void SetText(const std::string &strText); bool IsFinished(void) const { return m_bFinished; } void MarkFinished(void) { m_bFinished = true; } float Percentage(void) const { return m_fPercentage;} void SetPercentage(float fPercentage) { m_fPercentage = fPercentage; } void SetProgress(int currentItem, int itemCount); private: mutable CCriticalSection m_critSection; float m_fPercentage; std::string m_strTitle; std::string m_strText; bool m_bFinished; }; class CGUIDialogExtendedProgressBar : public CGUIDialog { public: CGUIDialogExtendedProgressBar(void); ~CGUIDialogExtendedProgressBar(void) override = default; bool OnMessage(CGUIMessage& message) override; void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override; CGUIDialogProgressBarHandle *GetHandle(const std::string &strTitle); protected: void UpdateState(unsigned int currentTime); CCriticalSection m_critSection; unsigned int m_iCurrentItem; unsigned int m_iLastSwitchTime; std::vector<CGUIDialogProgressBarHandle *> m_handles; };
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef nspr_h___ #define nspr_h___ #include "pratom.h" #include "prbit.h" #include "prclist.h" #include "prcmon.h" #include "prcvar.h" #include "prdtoa.h" #include "prenv.h" #include "prerror.h" #include "prinet.h" #include "prinit.h" #include "prinrval.h" #include "prio.h" #include "pripcsem.h" #include "prlink.h" #include "prlock.h" #include "prlog.h" #include "prlong.h" #include "prmem.h" #include "prmon.h" #include "prmwait.h" #include "prnetdb.h" #include "prprf.h" #include "prproces.h" #include "prrng.h" #include "prrwlock.h" #include "prshm.h" #include "prshma.h" #include "prsystem.h" #include "prthread.h" #include "prtime.h" #include "prtpool.h" #include "prtrace.h" #include "prtypes.h" #endif /* nspr_h___ */
/* SPDX-License-Identifier: GPL-2.0-only */ /* * An access vector table (avtab) is a hash table * of access vectors and transition types indexed * by a type pair and a class. An access vector * table is used to represent the type enforcement * tables. * * Author : Stephen Smalley, <sds@tycho.nsa.gov> */ /* Updated: Frank Mayer <mayerf@tresys.com> and Karl MacMillan <kmacmillan@tresys.com> * * Added conditional policy language extensions * * Copyright (C) 2003 Tresys Technology, LLC * * Updated: Yuichi Nakamura <ynakam@hitachisoft.jp> * Tuned number of hash slots for avtab to reduce memory usage */ #ifndef _SS_AVTAB_H_ #define _SS_AVTAB_H_ #include "security.h" struct avtab_key { u16 source_type; /* source type */ u16 target_type; /* target type */ u16 target_class; /* target object class */ #define AVTAB_ALLOWED 0x0001 #define AVTAB_AUDITALLOW 0x0002 #define AVTAB_AUDITDENY 0x0004 #define AVTAB_AV (AVTAB_ALLOWED | AVTAB_AUDITALLOW | AVTAB_AUDITDENY) #define AVTAB_TRANSITION 0x0010 #define AVTAB_MEMBER 0x0020 #define AVTAB_CHANGE 0x0040 #define AVTAB_TYPE (AVTAB_TRANSITION | AVTAB_MEMBER | AVTAB_CHANGE) /* extended permissions */ #define AVTAB_XPERMS_ALLOWED 0x0100 #define AVTAB_XPERMS_AUDITALLOW 0x0200 #define AVTAB_XPERMS_DONTAUDIT 0x0400 #define AVTAB_XPERMS (AVTAB_XPERMS_ALLOWED | \ AVTAB_XPERMS_AUDITALLOW | \ AVTAB_XPERMS_DONTAUDIT) #define AVTAB_ENABLED_OLD 0x80000000 /* reserved for used in cond_avtab */ #define AVTAB_ENABLED 0x8000 /* reserved for used in cond_avtab */ u16 specified; /* what field is specified */ }; /* * For operations that require more than the 32 permissions provided by the avc * extended permissions may be used to provide 256 bits of permissions. */ struct avtab_extended_perms { /* These are not flags. All 256 values may be used */ #define AVTAB_XPERMS_IOCTLFUNCTION 0x01 #define AVTAB_XPERMS_IOCTLDRIVER 0x02 /* extension of the avtab_key specified */ u8 specified; /* ioctl, netfilter, ... */ /* * if 256 bits is not adequate as is often the case with ioctls, then * multiple extended perms may be used and the driver field * specifies which permissions are included. */ u8 driver; /* 256 bits of permissions */ struct extended_perms_data perms; }; struct avtab_datum { union { u32 data; /* access vector or type value */ struct avtab_extended_perms *xperms; } u; }; struct avtab_node { struct avtab_key key; struct avtab_datum datum; struct avtab_node *next; }; struct avtab { struct avtab_node **htable; u32 nel; /* number of elements */ u32 nslot; /* number of hash slots */ u32 mask; /* mask to compute hash func */ }; void avtab_init(struct avtab *h); int avtab_alloc(struct avtab *, u32); int avtab_alloc_dup(struct avtab *new, const struct avtab *orig); struct avtab_datum *avtab_search(struct avtab *h, struct avtab_key *k); void avtab_destroy(struct avtab *h); void avtab_hash_eval(struct avtab *h, char *tag); struct policydb; int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol, int (*insert)(struct avtab *a, struct avtab_key *k, struct avtab_datum *d, void *p), void *p); int avtab_read(struct avtab *a, void *fp, struct policydb *pol); int avtab_write_item(struct policydb *p, struct avtab_node *cur, void *fp); int avtab_write(struct policydb *p, struct avtab *a, void *fp); struct avtab_node *avtab_insert_nonunique(struct avtab *h, struct avtab_key *key, struct avtab_datum *datum); struct avtab_node *avtab_search_node(struct avtab *h, struct avtab_key *key); struct avtab_node *avtab_search_node_next(struct avtab_node *node, int specified); #define MAX_AVTAB_HASH_BITS 16 #define MAX_AVTAB_HASH_BUCKETS (1 << MAX_AVTAB_HASH_BITS) #endif /* _SS_AVTAB_H_ */
// RUN: %clang -emit-llvm -S -o - %s | FileCheck %s typedef float float4 __attribute__((ext_vector_type(4))); typedef unsigned int uint4 __attribute__((ext_vector_type(4))); // CHECK-LABEL: define {{.*}}void @clang_shufflevector_v_v( void clang_shufflevector_v_v( float4* A, float4 x, uint4 mask ) { // CHECK: [[MASK:%.*]] = and <4 x i32> {{%.*}}, <i32 3, i32 3, i32 3, i32 3> // CHECK: [[I:%.*]] = extractelement <4 x i32> [[MASK]], i{{[0-9]+}} 0 // CHECK: [[E:%.*]] = extractelement <4 x float> [[X:%.*]], i{{[0-9]+}} [[I]] // // Here is where ToT Clang code generation makes a mistake. // It uses [[I]] as the insertion index instead of 0. // Similarly on the remaining insertelement. // CHECK: [[V:%[a-zA-Z0-9._]+]] = insertelement <4 x float> undef, float [[E]], i{{[0-9]+}} 0 // CHECK: [[I:%.*]] = extractelement <4 x i32> [[MASK]], i{{[0-9]+}} 1 // CHECK: [[E:%.*]] = extractelement <4 x float> [[X]], i{{[0-9]+}} [[I]] // CHECK: [[V2:%.*]] = insertelement <4 x float> [[V]], float [[E]], i{{[0-9]+}} 1 // CHECK: [[I:%.*]] = extractelement <4 x i32> [[MASK]], i{{[0-9]+}} 2 // CHECK: [[E:%.*]] = extractelement <4 x float> [[X]], i{{[0-9]+}} [[I]] // CHECK: [[V3:%.*]] = insertelement <4 x float> [[V2]], float [[E]], i{{[0-9]+}} 2 // CHECK: [[I:%.*]] = extractelement <4 x i32> [[MASK]], i{{[0-9]+}} 3 // CHECK: [[E:%.*]] = extractelement <4 x float> [[X]], i{{[0-9]+}} [[I]] // CHECK: [[V4:%.*]] = insertelement <4 x float> [[V3]], float [[E]], i{{[0-9]+}} 3 // CHECK: store <4 x float> [[V4]], <4 x float>* {{%.*}}, *A = __builtin_shufflevector( x, mask ); } // CHECK-LABEL: define {{.*}}void @clang_shufflevector_v_v_c( void clang_shufflevector_v_v_c( float4* A, float4 x, float4 y) { // CHECK: [[V:%.*]] = shufflevector <4 x float> {{%.*}}, <4 x float> {{%.*}}, <4 x i32> <i32 0, i32 4, i32 1, i32 5> // CHECK: store <4 x float> [[V]], <4 x float>* {{%.*}} *A = __builtin_shufflevector( x, y, 0, 4, 1, 5 ); } // CHECK-LABEL: define {{.*}}void @clang_shufflevector_v_v_undef( void clang_shufflevector_v_v_undef( float4* A, float4 x, float4 y) { // CHECK: [[V:%.*]] = shufflevector <4 x float> {{%.*}}, <4 x float> {{%.*}}, <4 x i32> <i32 0, i32 4, i32 undef, i32 5> // CHECK: store <4 x float> [[V]], <4 x float>* {{%.*}} *A = __builtin_shufflevector( x, y, 0, 4, -1, 5 ); }
/* * linux/include/asm-ia64/ide.h * * Copyright (C) 1994-1996 Linus Torvalds & authors */ /* * This file contains the ia64 architecture specific IDE code. */ #ifndef __ASM_IA64_IDE_H #define __ASM_IA64_IDE_H #ifdef __KERNEL__ #include <linux/config.h> #include <linux/irq.h> #ifndef MAX_HWIFS # ifdef CONFIG_PCI #define MAX_HWIFS 10 # else #define MAX_HWIFS 6 # endif #endif #define IDE_ARCH_OBSOLETE_DEFAULTS static inline int ide_default_irq(unsigned long base) { switch (base) { case 0x1f0: return isa_irq_to_vector(14); case 0x170: return isa_irq_to_vector(15); case 0x1e8: return isa_irq_to_vector(11); case 0x168: return isa_irq_to_vector(10); case 0x1e0: return isa_irq_to_vector(8); case 0x160: return isa_irq_to_vector(12); default: return 0; } } static inline unsigned long ide_default_io_base(int index) { switch (index) { case 0: return 0x1f0; case 1: return 0x170; case 2: return 0x1e8; case 3: return 0x168; case 4: return 0x1e0; case 5: return 0x160; default: return 0; } } #define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #ifdef CONFIG_PCI #define ide_init_default_irq(base) (0) #else #define ide_init_default_irq(base) ide_default_irq(base) #endif #include <asm-generic/ide_iops.h> #endif /* __KERNEL__ */ #endif /* __ASM_IA64_IDE_H */
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_PLATFORM_PROFILEUTILS_ANDROID_ARMV7A_CPU_UTILS_HELPER_H__ #define TENSORFLOW_PLATFORM_PROFILEUTILS_ANDROID_ARMV7A_CPU_UTILS_HELPER_H__ #include "tensorflow/core/platform/macros.h" #include "tensorflow/core/platform/profile_utils/i_cpu_utils_helper.h" #include "tensorflow/core/platform/types.h" struct perf_event_attr; namespace tensorflow { namespace profile_utils { // Implementation of CpuUtilsHelper for Android armv7a class AndroidArmV7ACpuUtilsHelper : public ICpuUtilsHelper { public: AndroidArmV7ACpuUtilsHelper() = default; void ResetClockCycle() final; uint64 GetCurrentClockCycle() final; void EnableClockCycleProfiling(bool enable) final; int64 CalculateCpuFrequency() final; private: static constexpr int INVALID_FD = -1; static constexpr int64 INVALID_CPU_FREQUENCY = -1; void InitializeInternal(); // syscall __NR_perf_event_open with arguments int OpenPerfEvent(perf_event_attr *const hw_event, const pid_t pid, const int cpu, const int group_fd, const unsigned long flags); int64 ReadCpuFrequencyFile(const int cpu_id, const char *const type); bool is_initialized_{false}; int fd_{INVALID_FD}; TF_DISALLOW_COPY_AND_ASSIGN(AndroidArmV7ACpuUtilsHelper); }; } // profile_utils } // tensorflow #endif // TENSORFLOW_PLATFORM_PROFILEUTILS_ANDROID_ARMV7A_CPU_UTILS_HELPER_H__
#ifndef _LINUX_UNALIGNED_PACKED_STRUCT_H #define _LINUX_UNALIGNED_PACKED_STRUCT_H #include <linux/kernel.h> struct __una_u16 { u16 x; } __attribute__((packed)); struct __una_u32 { u32 x; } __attribute__((packed)); struct __una_u64 { u64 x; } __attribute__((packed)); static inline u16 __get_unaligned_cpu16(const void *p) { const struct __una_u16 *ptr = (const struct __una_u16 *)p; return ptr->x; } static inline u32 __get_unaligned_cpu32(const void *p) { const struct __una_u32 *ptr = (const struct __una_u32 *)p; return ptr->x; } static inline u64 __get_unaligned_cpu64(const void *p) { const struct __una_u64 *ptr = (const struct __una_u64 *)p; return ptr->x; } static inline void __put_unaligned_cpu16(u16 val, void *p) { struct __una_u16 *ptr = (struct __una_u16 *)p; ptr->x = val; } static inline void __put_unaligned_cpu32(u32 val, void *p) { struct __una_u32 *ptr = (struct __una_u32 *)p; ptr->x = val; } static inline void __put_unaligned_cpu64(u64 val, void *p) { struct __una_u64 *ptr = (struct __una_u64 *)p; ptr->x = val; } #endif /* _LINUX_UNALIGNED_PACKED_STRUCT_H */
/* Copyright (c) 2015, Apple Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. No license is granted to the trademarks of the copyright holders even if such marks are included in this software. 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. */ #import "ORKSurveyAnswerCell.h" @interface ORKSurveyAnswerCellForNumber : ORKSurveyAnswerCell <UITextFieldDelegate> @end
/* * xfrm_device.c - IPsec device offloading code. * * Copyright (c) 2015 secunet Security Networks AG * * Author: * Steffen Klassert <steffen.klassert@secunet.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/errno.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <net/dst.h> #include <net/xfrm.h> #include <linux/notifier.h> #ifdef CONFIG_XFRM_OFFLOAD int validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t features) { int err; struct xfrm_state *x; struct xfrm_offload *xo = xfrm_offload(skb); if (skb_is_gso(skb)) return 0; if (xo) { x = skb->sp->xvec[skb->sp->len - 1]; if (xo->flags & XFRM_GRO || x->xso.flags & XFRM_OFFLOAD_INBOUND) return 0; x->outer_mode->xmit(x, skb); err = x->type_offload->xmit(x, skb, features); if (err) { XFRM_INC_STATS(xs_net(x), LINUX_MIB_XFRMOUTSTATEPROTOERROR); return err; } skb_push(skb, skb->data - skb_mac_header(skb)); } return 0; } EXPORT_SYMBOL_GPL(validate_xmit_xfrm); int xfrm_dev_state_add(struct net *net, struct xfrm_state *x, struct xfrm_user_offload *xuo) { int err; struct dst_entry *dst; struct net_device *dev; struct xfrm_state_offload *xso = &x->xso; xfrm_address_t *saddr; xfrm_address_t *daddr; if (!x->type_offload) return -EINVAL; /* We don't yet support UDP encapsulation, TFC padding and ESN. */ if (x->encap || x->tfcpad || (x->props.flags & XFRM_STATE_ESN)) return 0; dev = dev_get_by_index(net, xuo->ifindex); if (!dev) { if (!(xuo->flags & XFRM_OFFLOAD_INBOUND)) { saddr = &x->props.saddr; daddr = &x->id.daddr; } else { saddr = &x->id.daddr; daddr = &x->props.saddr; } dst = __xfrm_dst_lookup(net, 0, 0, saddr, daddr, x->props.family, x->props.output_mark); if (IS_ERR(dst)) return 0; dev = dst->dev; dev_hold(dev); dst_release(dst); } if (!dev->xfrmdev_ops || !dev->xfrmdev_ops->xdo_dev_state_add) { xso->dev = NULL; dev_put(dev); return 0; } xso->dev = dev; xso->num_exthdrs = 1; xso->flags = xuo->flags; err = dev->xfrmdev_ops->xdo_dev_state_add(x); if (err) { dev_put(dev); return err; } return 0; } EXPORT_SYMBOL_GPL(xfrm_dev_state_add); bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x) { int mtu; struct dst_entry *dst = skb_dst(skb); struct xfrm_dst *xdst = (struct xfrm_dst *)dst; struct net_device *dev = x->xso.dev; if (!x->type_offload || x->encap) return false; if ((x->xso.offload_handle && (dev == dst->path->dev)) && !dst->child->xfrm && x->type->get_mtu) { mtu = x->type->get_mtu(x, xdst->child_mtu_cached); if (skb->len <= mtu) goto ok; if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu)) goto ok; } return false; ok: if (dev && dev->xfrmdev_ops && dev->xfrmdev_ops->xdo_dev_offload_ok) return x->xso.dev->xfrmdev_ops->xdo_dev_offload_ok(skb, x); return true; } EXPORT_SYMBOL_GPL(xfrm_dev_offload_ok); #endif static int xfrm_dev_register(struct net_device *dev) { if ((dev->features & NETIF_F_HW_ESP) && !dev->xfrmdev_ops) return NOTIFY_BAD; if ((dev->features & NETIF_F_HW_ESP_TX_CSUM) && !(dev->features & NETIF_F_HW_ESP)) return NOTIFY_BAD; return NOTIFY_DONE; } static int xfrm_dev_unregister(struct net_device *dev) { xfrm_policy_cache_flush(); return NOTIFY_DONE; } static int xfrm_dev_feat_change(struct net_device *dev) { if ((dev->features & NETIF_F_HW_ESP) && !dev->xfrmdev_ops) return NOTIFY_BAD; else if (!(dev->features & NETIF_F_HW_ESP)) dev->xfrmdev_ops = NULL; if ((dev->features & NETIF_F_HW_ESP_TX_CSUM) && !(dev->features & NETIF_F_HW_ESP)) return NOTIFY_BAD; return NOTIFY_DONE; } static int xfrm_dev_down(struct net_device *dev) { if (dev->features & NETIF_F_HW_ESP) xfrm_dev_state_flush(dev_net(dev), dev, true); xfrm_policy_cache_flush(); return NOTIFY_DONE; } static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr) { struct net_device *dev = netdev_notifier_info_to_dev(ptr); switch (event) { case NETDEV_REGISTER: return xfrm_dev_register(dev); case NETDEV_UNREGISTER: return xfrm_dev_unregister(dev); case NETDEV_FEAT_CHANGE: return xfrm_dev_feat_change(dev); case NETDEV_DOWN: return xfrm_dev_down(dev); } return NOTIFY_DONE; } static struct notifier_block xfrm_dev_notifier = { .notifier_call = xfrm_dev_event, }; void __net_init xfrm_dev_init(void) { register_netdevice_notifier(&xfrm_dev_notifier); }
/* * Copyright 2015 Ludwig Knüpfer * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup drivers_isl29125 * @{ * * @file * @brief Definitions for the ISL29125 RGB light sensor * * @author Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de> */ #ifndef ISL29125_INTERNAL_H #define ISL29125_INTERNAL_H #ifdef __cplusplus extern "C" { #endif /** * @brief The sensors hard coded I2C address */ #define ISL29125_I2C_ADDRESS 0x44 /** * @name ISL29125 constants * @{ */ #define ISL29125_ID 0x7D /** @} */ /** * @name ISL29125 register map * @{ */ /* main register */ #define ISL29125_REG_ID 0x00 #define ISL29125_REG_RESET 0x00 /* configuration registers */ #define ISL29125_REG_CONF1 0x01 #define ISL29125_REG_CONF2 0x02 #define ISL29125_REG_CONF3 0x03 /* interrupt mode threshold registers */ #define ISL29125_REG_LTHLB 0x04 #define ISL29125_REG_LTHHB 0x05 #define ISL29125_REG_HTHLB 0x06 #define ISL29125_REG_HTHHB 0x07 /* status register */ #define ISL29125_REG_STATUS 0x08 /* sensor readout registers (double buffered) */ #define ISL29125_REG_GDLB 0x09 #define ISL29125_REG_GDHB 0x0A #define ISL29125_REG_RDLB 0x0B #define ISL29125_REG_RDHB 0x0C #define ISL29125_REG_BDLB 0x0D #define ISL29125_REG_BDHB 0x0E /** @} */ /** * @name ISL29125 commands * @{ */ #define ISL29125_CMD_RESET 0x46 /** @} */ /** * @name ISL29125 configuration masks and bits * @{ */ /* ISL29125_REG_CONF1 B2:B0 */ #define ISL29125_CON1_MASK_MODE 0x07 /* ISL29125_REG_CONF1 B3 */ #define ISL29125_CON1_MASK_RANGE 0x08 /* ISL29125_REG_CONF1 B4 */ #define ISL29125_CON1_MASK_RES 0x10 /* ISL29125_REG_CONF1 B5 */ #define ISL29125_CON1_MASK_SYNC 0x20 #define ISL29125_CON1_SYNCOFF 0x00 #define ISL29125_CON1_SYNCON 0x20 /** @} */ #ifdef __cplusplus } #endif #endif /* ISL29125_INTERNAL_H */ /** @} */
/* user_fixup.c: Fix up user copy faults. * * Copyright (C) 2004 David S. Miller <davem@redhat.com> */ #include <linux/compiler.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/errno.h> #include <linux/module.h> #include <asm/uaccess.h> /* Calculating the exact fault address when using * block loads and stores can be very complicated. * * Instead of trying to be clever and handling all * of the cases, just fix things up simply here. */ static unsigned long compute_size(unsigned long start, unsigned long size, unsigned long *offset) { unsigned long fault_addr = current_thread_info()->fault_address; unsigned long end = start + size; if (fault_addr < start || fault_addr >= end) { *offset = 0; } else { *offset = fault_addr - start; size = end - fault_addr; } return size; } unsigned long copy_from_user_fixup(void *to, const void __user *from, unsigned long size) { unsigned long offset; size = compute_size((unsigned long) from, size, &offset); if (likely(size)) memset(to + offset, 0, size); return size; } EXPORT_SYMBOL(copy_from_user_fixup); unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned long size) { unsigned long offset; return compute_size((unsigned long) to, size, &offset); } EXPORT_SYMBOL(copy_to_user_fixup); unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned long size) { unsigned long fault_addr = current_thread_info()->fault_address; unsigned long start = (unsigned long) to; unsigned long end = start + size; if (fault_addr >= start && fault_addr < end) return end - fault_addr; start = (unsigned long) from; end = start + size; if (fault_addr >= start && fault_addr < end) return end - fault_addr; return size; } EXPORT_SYMBOL(copy_in_user_fixup);
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) /* * pci.c - DesignWare HS OTG Controller PCI driver * * Copyright (C) 2004-2013 Synopsys, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The names of the above-listed copyright holders may not be used * to endorse or promote products derived from this software without * specific prior written permission. * * ALTERNATIVELY, this software may be distributed under the terms of the * GNU General Public License ("GPL") as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any * later version. * * 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. */ /* * Provides the initialization and cleanup entry points for the DWC_otg PCI * driver */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/spinlock.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/slab.h> #include <linux/pci.h> #include <linux/usb.h> #include <linux/usb/hcd.h> #include <linux/usb/ch11.h> #include <linux/platform_device.h> #include <linux/usb/usb_phy_generic.h> #define PCI_PRODUCT_ID_HAPS_HSOTG 0xabc0 static const char dwc2_driver_name[] = "dwc2-pci"; struct dwc2_pci_glue { struct platform_device *dwc2; struct platform_device *phy; }; /** * dwc2_pci_probe() - Provides the cleanup entry points for the DWC_otg PCI * driver * * @pci: The programming view of DWC_otg PCI */ static void dwc2_pci_remove(struct pci_dev *pci) { struct dwc2_pci_glue *glue = pci_get_drvdata(pci); platform_device_unregister(glue->dwc2); usb_phy_generic_unregister(glue->phy); pci_set_drvdata(pci, NULL); } static int dwc2_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) { struct resource res[2]; struct platform_device *dwc2; struct platform_device *phy; int ret; struct device *dev = &pci->dev; struct dwc2_pci_glue *glue; ret = pcim_enable_device(pci); if (ret) { dev_err(dev, "failed to enable pci device\n"); return -ENODEV; } pci_set_master(pci); phy = usb_phy_generic_register(); if (IS_ERR(phy)) { dev_err(dev, "error registering generic PHY (%ld)\n", PTR_ERR(phy)); return PTR_ERR(phy); } dwc2 = platform_device_alloc("dwc2", PLATFORM_DEVID_AUTO); if (!dwc2) { dev_err(dev, "couldn't allocate dwc2 device\n"); ret = -ENOMEM; goto err; } memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res)); res[0].start = pci_resource_start(pci, 0); res[0].end = pci_resource_end(pci, 0); res[0].name = "dwc2"; res[0].flags = IORESOURCE_MEM; res[1].start = pci->irq; res[1].name = "dwc2"; res[1].flags = IORESOURCE_IRQ; ret = platform_device_add_resources(dwc2, res, ARRAY_SIZE(res)); if (ret) { dev_err(dev, "couldn't add resources to dwc2 device\n"); goto err; } dwc2->dev.parent = dev; glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); if (!glue) { ret = -ENOMEM; goto err; } ret = platform_device_add(dwc2); if (ret) { dev_err(dev, "failed to register dwc2 device\n"); goto err; } glue->phy = phy; glue->dwc2 = dwc2; pci_set_drvdata(pci, glue); return 0; err: usb_phy_generic_unregister(phy); platform_device_put(dwc2); return ret; } static const struct pci_device_id dwc2_pci_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS, PCI_PRODUCT_ID_HAPS_HSOTG), }, { PCI_DEVICE(PCI_VENDOR_ID_STMICRO, PCI_DEVICE_ID_STMICRO_USB_OTG), }, { /* end: all zeroes */ } }; MODULE_DEVICE_TABLE(pci, dwc2_pci_ids); static struct pci_driver dwc2_pci_driver = { .name = dwc2_driver_name, .id_table = dwc2_pci_ids, .probe = dwc2_pci_probe, .remove = dwc2_pci_remove, }; module_pci_driver(dwc2_pci_driver); MODULE_DESCRIPTION("DESIGNWARE HS OTG PCI Bus Glue"); MODULE_AUTHOR("Synopsys, Inc."); MODULE_LICENSE("Dual BSD/GPL");
#pragma once #include "quantum.h" #ifdef KEYBOARD_lets_split_rev1 #include "rev1.h" #elif KEYBOARD_lets_split_rev2 #include "rev2.h" #elif KEYBOARD_lets_split_sockets #include "sockets.h" #endif // Used to create a keymap using only KC_ prefixed keys #define LAYOUT_kc( \ L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ ) \ LAYOUT( \ KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ ) #define LAYOUT_kc_ortho_4x12 LAYOUT_kc
/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef __MSM_SCM_PAS_H #define __MSM_SCM_PAS_H enum pas_id { PAS_MODEM, PAS_Q6, PAS_DSPS, PAS_TZAPPS, PAS_MODEM_SW, PAS_MODEM_FW, PAS_WCNSS, PAS_SECAPP, PAS_GSS, PAS_VIDC, }; #ifdef CONFIG_MSM_PIL extern int pas_init_image(enum pas_id id, const u8 *metadata, size_t size); extern int pas_mem_setup(enum pas_id id, u32 start_addr, u32 len); extern int pas_auth_and_reset(enum pas_id id); extern int pas_shutdown(enum pas_id id); extern int pas_supported(enum pas_id id); #else static inline int pas_init_image(enum pas_id id, const u8 *metadata, size_t size) { return 0; } static inline int pas_mem_setup(enum pas_id id, u32 start_addr, u32 len) { return 0; } static inline int pas_auth_and_reset(enum pas_id id) { return 0; } static inline int pas_shutdown(enum pas_id id) { return 0; } static inline int pas_supported(enum pas_id id) { return 0; } #endif #endif