text
stringlengths
4
6.14k
/************************************************************************************************** Filename: nwk_frame.h Revised: $Date: 2008-12-23 13:49:41 -0800 (Tue, 23 Dec 2008) $ Revision: $Revision: 18651 $ Author: $Author: lfriedman $ Description: This header file supports the SimpliciTI frame handling functions. Copyright 2004-2007 Texas Instruments Incorporated. All rights reserved. IMPORTANT: Your use of this Software is limited to those specific rights granted under the terms of a software license agreement between the user who downloaded the software, his/her employer (which must be your employer) and Texas Instruments Incorporated (the "License"). You may not use this Software unless you agree to abide by the terms of the License. The License limits your use, and you acknowledge, that the Software may not be modified, copied or distributed unless embedded on a Texas Instruments microcontroller or used solely and exclusively in conjunction with a Texas Instruments radio frequency transceiver, which is integrated into your product. Other than for the foregoing purpose, you may not use, reproduce, copy, prepare derivative works of, modify, distribute, perform, display or sell this Software and/or its documentation for any purpose. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. Should you have any questions regarding your right to use this Software, contact Texas Instruments Incorporated at www.TI.com. **************************************************************************************************/ #ifndef NWK_FRAME_H #define NWK_FRAME_H /* Frame field defines and masks. Mask name must be field name with '_MSK' appended * so the GET and PUT macros work correctly -- they use token pasting. Offset values * are with respect to the MRFI payload and not the entire frame. */ #define F_PORT_OS 0 #define F_PORT_OS_MSK (0x3F) #define F_ENCRYPT_OS 0 #define F_ENCRYPT_OS_MSK (0x40) #define F_FWD_FRAME 0 #define F_FWD_FRAME_MSK (0x80) #define F_RX_TYPE 1 #define F_RX_TYPE_MSK (0x40) #define F_ACK_REQ 1 #define F_ACK_REQ_MSK (0x80) #define F_ACK_RPLY 1 #define F_ACK_RPLY_MSK (0x08) #define F_TX_DEVICE 1 #define F_TX_DEVICE_MSK (0x30) #define F_HOP_COUNT 1 #define F_HOP_COUNT_MSK (0x07) #define F_TRACTID_OS 2 #define F_TRACTID_OS_MSK (0xFF) #define SMPL_NWK_HDR_SIZE 3 #ifdef SMPL_SECURE #define F_SECURE_OS 3 #define F_SEC_CTR_OS 3 /* counter hint */ #define F_SEC_CTR_OS_MSK (0xFF) #define F_SEC_ICHK_OS 4 /* Message integrity check */ #define F_SEC_ICHK_OS_MSK (0xFF) #define F_SEC_MAC_OS 5 /* Message authentication code */ #define F_SEC_MAC_OS_MSK (0xFF) #else #define F_SECURE_OS 0 #endif /* SMPL_SECURE */ #define F_APP_PAYLOAD_OS (SMPL_NWK_HDR_SIZE+F_SECURE_OS) /* sub field details. they are in the correct bit locations (already shifted) */ #define F_RX_TYPE_USER_CTL 0x00 /* does not poll... */ #define F_RX_TYPE_POLLS 0x40 /* polls for held messages */ #define F_ACK_REQ_TYPE 0x80 #define F_ACK_RPLY_TYPE 0x08 #define F_FRAME_FWD_TYPE 0x80 #define F_FRAME_ENCRYPT_TYPE 0x40 /* device type fields */ #define F_TX_DEVICE_ED 0x00 /* End Device */ #define F_TX_DEVICE_RE 0x10 /* Range Extender */ #define F_TX_DEVICE_AP 0x20 /* Access Point */ /* macro to get a field from a frame buffer */ #define GET_FROM_FRAME(b,f) ((b)[f] & (f##_MSK)) /* Macro to put a value 'v' into a frame buffer 'b'. 'v' value must already be shifted * if necessary. 'b' is a byte array */ #define PUT_INTO_FRAME(b,f,v) do {(b)[f] = ((b)[f] & ~(f##_MSK)) | (v); } while(0) /* **** frame information objects * info kept on each frame object */ #define FI_AVAILABLE 0 /* entry available for use */ #define FI_INUSE_UNTIL_DEL 1 /* in use. will be explicitly reclaimed */ #define FI_INUSE_UNTIL_TX 2 /* in use. will be reclaimed after Tx */ #define FI_INUSE_UNTIL_FWD 3 /* in use until forwarded by AP */ #define FI_INUSE_TRANSITION 4 /* being retrieved. do not delete in Rx ISR thread. */ typedef struct { uint8_t rssi; uint8_t lqi; } sigInfo_t; typedef struct { volatile uint8_t fi_usage; uint8_t orderStamp; mrfiPacket_t mrfiPkt; } frameInfo_t; /* prototypes */ frameInfo_t *nwk_buildFrame(uint8_t, uint8_t *msg, uint8_t len, uint8_t hops); #ifdef APP_AUTO_ACK frameInfo_t *nwk_buildAckReqFrame(uint8_t, uint8_t *, uint8_t, uint8_t, volatile uint8_t *); #endif void nwk_receiveFrame(void); void nwk_frameInit(uint8_t (*)(linkID_t)); smplStatus_t nwk_retrieveFrame(rcvContext_t *, uint8_t *, uint8_t *, addr_t *, uint8_t *); smplStatus_t nwk_sendFrame(frameInfo_t *, uint8_t txOption); frameInfo_t *nwk_getSandFFrame(mrfiPacket_t *, uint8_t); uint8_t nwk_getMyRxType(void); void nwk_SendEmptyPollRspFrame(mrfiPacket_t *); #ifdef APP_AUTO_ACK void nwk_sendAckReply(mrfiPacket_t *, uint8_t); #endif #ifndef END_DEVICE /* only APs and REs repeat frames */ void nwk_replayFrame(frameInfo_t *); #endif #endif
///////////////////////////////////////////////////////////////////////////// // Name: wx/module.h // Purpose: Modules handling // Author: Wolfram Gloger/adapted by Guilhem Lavaux // Modified by: // Created: 04/11/98 // RCS-ID: $Id: module.h 61872 2009-09-09 22:37:05Z VZ $ // Copyright: (c) Wolfram Gloger and Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_MODULE_H_ #define _WX_MODULE_H_ #include "wx/object.h" #include "wx/list.h" #include "wx/dynarray.h" // declare a linked list of modules class WXDLLIMPEXP_FWD_BASE wxModule; WX_DECLARE_USER_EXPORTED_LIST(wxModule, wxModuleList, WXDLLIMPEXP_BASE); // and an array of class info objects WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxClassInfo *, wxArrayClassInfo, class WXDLLIMPEXP_BASE); // declaring a class derived from wxModule will automatically create an // instance of this class on program startup, call its OnInit() method and call // OnExit() on program termination (but only if OnInit() succeeded) class WXDLLIMPEXP_BASE wxModule : public wxObject { public: wxModule() {} virtual ~wxModule() {} // if module init routine returns false the application // will fail to startup bool Init() { return OnInit(); } void Exit() { OnExit(); } // Override both of these // called on program startup virtual bool OnInit() = 0; // called just before program termination, but only if OnInit() // succeeded virtual void OnExit() = 0; static void RegisterModule(wxModule *module); static void RegisterModules(); static bool InitializeModules(); static void CleanUpModules() { DoCleanUpModules(m_modules); } // used by wxObjectLoader when unloading shared libs's static void UnregisterModule(wxModule *module); protected: static wxModuleList m_modules; // the function to call from constructor of a deriving class add module // dependency which will be initialized before the module and unloaded // after that void AddDependency(wxClassInfo *dep) { wxCHECK_RET( dep, wxT("NULL module dependency") ); m_dependencies.Add(dep); } private: // initialize module and Append it to initializedModules list recursively // calling itself to satisfy module dependencies if needed static bool DoInitializeModule(wxModule *module, wxModuleList &initializedModules); // cleanup the modules in the specified list (which may not contain all // modules if we're called during initialization because not all modules // could be initialized) and also empty m_modules itself static void DoCleanUpModules(const wxModuleList& modules); // module dependencies: contains wxArrayClassInfo m_dependencies; // used internally while initiliazing/cleaning up modules enum { State_Registered, // module registered but not initialized yet State_Initializing, // we're initializing this module but not done yet State_Initialized // module initialized successfully } m_state; DECLARE_CLASS(wxModule) }; #endif // _WX_MODULE_H_
/* ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "ch.h" #include "hal.h" #include "test.h" /* * LEDs blinker thread, times are in milliseconds. */ static WORKING_AREA(waThread1, 64); static msg_t Thread1(void *arg) { (void)arg; chRegSetThreadName("blinker"); while (TRUE) { palClearPad(IOPORT2, PB_LED(7)); chThdSleepMilliseconds(500); palSetPad(IOPORT2, PB_LED(7)); chThdSleepMilliseconds(500); } return 0; } /* * Application entry point. */ void main(void) { /* * System initializations. * - HAL initialization, this also initializes the configured device drivers * and performs the board-specific initializations. * - Kernel initialization, the main() function becomes a thread and the * RTOS is active. */ halInit(); chSysInit(); /* * Activates the serial driver 1 using the driver default configuration. */ sdStart(&SD1, NULL); /* * Creates the blinker thread. */ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); /* * Normal main() thread activity. */ while (TRUE) { if (palReadPad(IOPORT7, PG_BT5) == PAL_LOW) TestThread(&SD1); if (palReadPad(IOPORT7, PG_BT6) == PAL_LOW) sdWriteTimeout(&SD1, "Hello World!\r\n", 14, TIME_INFINITE); chThdSleepMilliseconds(1000); } }
/* ------------------------------------------------------------------------- CxxTest: A lightweight C++ unit testing library. Copyright (c) 2008 Sandia Corporation. This software is distributed under the LGPL License v2.1 For more information, see the COPYING file in the top CxxTest directory. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. ------------------------------------------------------------------------- */ #ifndef __cxxtest__LinkedList_h__ #define __cxxtest__LinkedList_h__ #include <cxxtest/Flags.h> namespace CxxTest { struct List; class Link; struct List { Link *_head; Link *_tail; void initialize(); Link *head(); const Link *head() const; Link *tail(); const Link *tail() const; bool empty() const; unsigned size() const; Link *nth( unsigned n ); void activateAll(); void leaveOnly( const Link &link ); }; class Link { public: Link(); virtual ~Link(); bool active() const; void setActive( bool value = true ); Link *justNext(); Link *justPrev(); Link *next(); Link *prev(); const Link *next() const; const Link *prev() const; void attach( List &l ); void detach( List &l ); private: Link *_next; Link *_prev; bool _active; Link( const Link & ); Link &operator=( const Link & ); }; } #endif // __cxxtest__LinkedList_h__
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_RENDERER_MEDIA_CHROME_WEBRTC_LOG_MESSAGE_DELEGATE_H_ #define CHROME_RENDERER_MEDIA_CHROME_WEBRTC_LOG_MESSAGE_DELEGATE_H_ #include <string> #include "base/memory/shared_memory.h" #include "chrome/common/media/webrtc_logging_message_data.h" #include "content/public/renderer/webrtc_log_message_delegate.h" #include "ipc/ipc_channel_proxy.h" namespace base { class MessageLoopProxy; } class PartialCircularBuffer; class WebRtcLoggingMessageFilter; // ChromeWebRtcLogMessageDelegate handles WebRTC logging. There is one object // per render process, owned by WebRtcLoggingMessageFilter. It communicates with // WebRtcLoggingHandlerHost and receives logging messages from libjingle and // writes them to a shared memory buffer. class ChromeWebRtcLogMessageDelegate : public content::WebRtcLogMessageDelegate, public base::NonThreadSafe { public: ChromeWebRtcLogMessageDelegate( const scoped_refptr<base::MessageLoopProxy>& io_message_loop, WebRtcLoggingMessageFilter* message_filter); ~ChromeWebRtcLogMessageDelegate() override; // content::WebRtcLogMessageDelegate implementation. void LogMessage(const std::string& message) override; void OnFilterRemoved(); void OnStartLogging(); void OnStopLogging(); private: void LogMessageOnIOThread(const WebRtcLoggingMessageData& message); void SendLogBuffer(); scoped_refptr<base::MessageLoopProxy> io_message_loop_; bool logging_started_; std::vector<WebRtcLoggingMessageData> log_buffer_; base::TimeTicks last_log_buffer_send_; WebRtcLoggingMessageFilter* message_filter_; DISALLOW_COPY_AND_ASSIGN(ChromeWebRtcLogMessageDelegate); }; #endif // CHROME_RENDERER_MEDIA_CHROME_WEBRTC_LOG_MESSAGE_DELEGATE_H_
/* Declarations for res.c. Copyright (C) 2001, 2007, 2008, 2009, 2010, 2011, 2015 Free Software Foundation, Inc. This file is part of Wget. 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 Wget. If not, see <http://www.gnu.org/licenses/>. Additional permission under GNU GPL version 3 section 7 If you modify this program, or any covered work, by linking or combining it with the OpenSSL project's OpenSSL library (or a modified version of that library), containing parts covered by the terms of the OpenSSL or SSLeay licenses, the Free Software Foundation grants you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of OpenSSL used as well as that of the covered work. */ #ifndef RES_H #define RES_H struct robot_specs; struct robot_specs *res_parse (const char *, int); struct robot_specs *res_parse_from_file (const char *); bool res_match_path (const struct robot_specs *, const char *); void res_register_specs (const char *, int, struct robot_specs *); struct robot_specs *res_get_specs (const char *, int); bool res_retrieve_file (const char *, char **, struct iri *); bool is_robots_txt_url (const char *); void res_cleanup (void); #endif /* RES_H */
#ifndef _sprngf_h_ #define SPRNG_LFG 0 #define SPRNG_LCG 1 #define SPRNG_LCG64 2 #define SPRNG_CMRG 3 #define SPRNG_MLFG 4 #define SPRNG_PMLCG 5 #define DEFAULT_RNG_TYPE SPRNG_LFG #define SPRNG_DEFAULT 0 #define CRAYLCG 0 #define DRAND48 1 #define FISH1 2 #define FISH2 3 #define FISH3 4 #define FISH4 5 #define FISH5 6 #define LECU1 0 #define LECU2 1 #define LECU3 2 #define LAG1279 0 #define LAG17 1 #define LAG31 2 #define LAG55 3 #define LAG63 4 #define LAG127 5 #define LAG521 6 #define LAG521B 7 #define LAG607 8 #define LAG607B 9 #define LAG1279B 10 #ifdef CHECK_POINTERS #define CHECK 1 #else #define CHECK 0 #endif /* ifdef CHECK_POINTERS */ #define MAX_PACKED_LENGTH 24000 #ifdef POINTER_SIZE #if POINTER_SIZE == 8 #define SPRNG_POINTER integer*8 #else #define SPRNG_POINTER integer*4 #endif #else #define SPRNG_POINTER integer*4 #endif /* ifdef POINTER_SIZE */ #ifdef USE_MPI #define make_sprng_seed fseed_mpi #else #define make_sprng_seed fmake_new_seed #endif #endif /* ifdef _sprng_h */ #ifdef USE_MPI external fseed_mpi integer fseed_mpi #else external fmake_new_seed integer fmake_new_seed #endif #ifndef DEFAULTINT #define DEFAULTINT #endif #ifndef FLOAT_GEN #define DBLGEN #endif #if defined(SIMPLE_SPRNG) #undef DEFAULTINT #ifndef _sprngf_h_ #define pack_sprng fpack_rng_simple #define unpack_sprng funpack_rng_simple #ifdef USE_MPI #define isprng fget_rn_int_simmpi #define init_sprng finit_rng_simmpi #else #define isprng fget_rn_int_sim #define init_sprng finit_rng_sim #endif /* ifdef USE_MPI */ #define print_sprng fprint_rng_simple #if defined(FLOAT_GEN) && defined(USE_MPI) #define sprng fget_rn_flt_simmpi #endif #if defined(FLOAT_GEN) && !defined(USE_MPI) #define sprng fget_rn_flt_sim #endif #if defined(DBLGEN) && defined(USE_MPI) #define sprng fget_rn_dbl_simmpi #endif #if defined(DBLGEN) && !defined(USE_MPI) #define sprng fget_rn_dbl_sim #endif #endif /* ifdef _sprng_h */ external isprng external fget_rn_dbl_sim, fget_rn_flt_sim external init_sprng, fpack_rng_simple external funpack_rng_simple, fprint_rng_simple #ifdef USE_MPI external fget_rn_flt_simmpi, fget_rn_dbl_simmpi real*4 fget_rn_flt_simmpi real*8 fget_rn_dbl_simmpi #endif integer isprng,fpack_rng_simple,fprint_rng_simple SPRNG_POINTER init_sprng, funpack_rng_simple real*4 fget_rn_flt_sim real*8 fget_rn_dbl_sim #endif #if defined(CHECK_POINTERS) #undef DEFAULTINT external fget_rn_int_ptr, fget_rn_flt_ptr, fget_rn_dbl_ptr external fspawn_rng_ptr, ffree_rng_ptr, finit_rng_ptr external fpack_rng_ptr, funpack_rng_ptr, fprint_rng_ptr integer fget_rn_int_ptr, ffree_rng_ptr, fpack_rng_ptr SPRNG_POINTER finit_rng_ptr, funpack_rng_ptr integer fspawn_rng_ptr, fprint_rng_ptr real*4 fget_rn_flt_ptr real*8 fget_rn_dbl_ptr #ifndef _sprngf_h_ #define isprng fget_rn_int_ptr #define free_sprng ffree_rng_ptr #define spawn_sprng(A,B,C) fspawn_rng_ptr(A,B,C,CHECK) #define pack_sprng fpack_rng_ptr #define unpack_sprng funpack_rng_ptr #define init_sprng finit_rng_ptr #define print_sprng fprint_rng_ptr #ifdef FLOAT_GEN #define sprng fget_rn_flt_ptr #else #define sprng fget_rn_dbl_ptr #endif #endif #endif #if defined(DEFAULTINT) external fget_rn_int, fget_rn_flt, fget_rn_dbl external fspawn_rng, ffree_rng, finit_rng external fpack_rng, funpack_rng, fprint_rng integer fget_rn_int, ffree_rng, fpack_rng SPRNG_POINTER finit_rng, funpack_rng integer fspawn_rng, fprint_rng real*4 fget_rn_flt real*8 fget_rn_dbl #ifndef _sprngf_h_ #define isprng fget_rn_int #define free_sprng ffree_rng #define spawn_sprng(A,B,C) fspawn_rng(A,B,C,CHECK) #define pack_sprng fpack_rng #define unpack_sprng funpack_rng #define init_sprng finit_rng #define print_sprng fprint_rng #ifdef FLOAT_GEN #define sprng fget_rn_flt #else #define sprng fget_rn_dbl #endif #endif #endif #ifndef _sprngf_h_ #define _sprngf_h_ #endif
/** * Copyright (c) 2014 - 2017, Nordic Semiconductor ASA * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form, except as embedded into a Nordic * Semiconductor ASA integrated circuit in a product or a software update for * such product, must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. Neither the name of Nordic Semiconductor ASA nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * 4. This software, with or without modification, must only be used with a * Nordic Semiconductor ASA integrated circuit. * * 5. Any software provided in binary form under this license must not be reverse * engineered, decompiled, modified and/or disassembled. * * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA 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 SER_PHY_CONFIG_APP_H__ #define SER_PHY_CONFIG_APP_H__ #include "boards.h" #include "ser_config.h" #ifdef __cplusplus extern "C" { #endif #if defined(SPI_MASTER_0_ENABLE) #define SER_PHY_SPI_MASTER SPI_MASTER_0 #endif #if defined(SPI_MASTER_1_ENABLE) #define SER_PHY_SPI_MASTER SPI_MASTER_1 #endif #if defined(SPI_MASTER_2_ENABLE) #define SER_PHY_SPI_MASTER SPI_MASTER_2 #endif #if (defined(SPI0_ENABLED) && (SPI0_ENABLED == 1)) || defined(SPI_MASTER_0_ENABLE) #define SER_PHY_SPI_MASTER_INSTANCE NRF_DRV_SPI_INSTANCE(0) #define SER_PHY_SPI_MASTER_PIN_SCK SER_APP_SPIM0_SCK_PIN #define SER_PHY_SPI_MASTER_PIN_MISO SER_APP_SPIM0_MISO_PIN #define SER_PHY_SPI_MASTER_PIN_MOSI SER_APP_SPIM0_MOSI_PIN #define SER_PHY_SPI_MASTER_PIN_SLAVE_SELECT SER_APP_SPIM0_SS_PIN #define SER_PHY_SPI_MASTER_PIN_SLAVE_REQUEST SER_APP_SPIM0_REQ_PIN #define SER_PHY_SPI_MASTER_PIN_SLAVE_READY SER_APP_SPIM0_RDY_PIN #elif (defined(SPI1_ENABLED) && (SPI1_ENABLED == 1)) || defined(SPI_MASTER_1_ENABLE) #define SER_PHY_SPI_MASTER_INSTANCE NRF_DRV_SPI_INSTANCE(1) #define SER_PHY_SPI_MASTER_PIN_SCK SER_APP_SPIM1_SCK_PIN #define SER_PHY_SPI_MASTER_PIN_MISO SER_APP_SPIM1_MISO_PIN #define SER_PHY_SPI_MASTER_PIN_MOSI SER_APP_SPIM1_MOSI_PIN #define SER_PHY_SPI_MASTER_PIN_SLAVE_SELECT SER_APP_SPIM1_SS_PIN #define SER_PHY_SPI_MASTER_PIN_SLAVE_REQUEST SER_APP_SPIM1_REQ_PIN #define SER_PHY_SPI_MASTER_PIN_SLAVE_READY SER_APP_SPIM1_RDY_PIN #elif (defined(SPI2_ENABLED) && (SPI2_ENABLED == 1)) || defined(SPI_MASTER_2_ENABLE) #define SER_PHY_SPI_MASTER_INSTANCE NRF_DRV_SPI_INSTANCE(2) #define SER_PHY_SPI_MASTER_PIN_SCK SER_APP_SPIM2_SCK_PIN #define SER_PHY_SPI_MASTER_PIN_MISO SER_APP_SPIM2_MISO_PIN #define SER_PHY_SPI_MASTER_PIN_MOSI SER_APP_SPIM2_MOSI_PIN #define SER_PHY_SPI_MASTER_PIN_SLAVE_SELECT SER_APP_SPIM2_SS_PIN #define SER_PHY_SPI_MASTER_PIN_SLAVE_REQUEST SER_APP_SPIM2_REQ_PIN #define SER_PHY_SPI_MASTER_PIN_SLAVE_READY SER_APP_SPIM2_RDY_PIN #endif #define CONN_CHIP_RESET_PIN_NO SER_CONN_CHIP_RESET_PIN /**< Pin used for reseting the connectivity. */ /* UART configuration */ #define UART_IRQ_PRIORITY APP_IRQ_PRIORITY_MID #define SER_PHY_UART_RX SER_APP_RX_PIN #define SER_PHY_UART_TX SER_APP_TX_PIN #define SER_PHY_UART_CTS SER_APP_CTS_PIN #define SER_PHY_UART_RTS SER_APP_RTS_PIN #ifdef __cplusplus } #endif #endif // SER_PHY_CONFIG_APP_H__
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_ #define ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_ #include "base/macros.h" namespace aura { class Window; } namespace ui { class GestureEvent; class ScrollEvent; } namespace ash { // This handles 3-finger touchpad scroll events to enter/exit overview mode. class OverviewGestureHandler { public: OverviewGestureHandler(); virtual ~OverviewGestureHandler(); // Processes a scroll event and may start overview. Returns true if the event // has been handled and should not be processed further, false otherwise. bool ProcessScrollEvent(const ui::ScrollEvent& event); private: // The total distance scrolled with three fingers. float scroll_x_; float scroll_y_; DISALLOW_COPY_AND_ASSIGN(OverviewGestureHandler); }; } // namespace ash #endif // ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_
// // GrowlMailMeAction.h // MailMe // // Created by Daniel Siemer on 4/12/12. // #import <GrowlPlugins/GrowlActionPlugin.h> @interface GrowlMailMeAction : GrowlActionPlugin <GrowlDispatchNotificationProtocol> @end
//----------------------------------------------------------------------------- // Copyright (c) 2012 GarageGames, LLC // // 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 _PLATFORMFONT_H_ #include "platform/platformFont.h" #include "platform/platform.h" #endif #ifndef _X86UNIXFONT_H_ #define _X86UNIXFONT_H_ // Needed by createFont #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> #include <X11/Xatom.h> class x86UNIXFont : public PlatformFont { private: int baseline; int height; StringTableEntry mFontName; public: x86UNIXFont(); virtual ~x86UNIXFont(); // PlatformFont virtual methods virtual bool isValidChar(const UTF16 ch) const; virtual bool isValidChar(const UTF8 *str) const; inline U32 getFontHeight() const { return height; } inline U32 getFontBaseLine() const { return baseline; } virtual PlatformFont::CharInfo &getCharInfo(const UTF16 ch) const; virtual PlatformFont::CharInfo &getCharInfo(const UTF8 *str) const; virtual bool create(const char *name, dsize_t size, U32 charset = TGE_ANSI_CHARSET); }; #endif
/* GWEN Copyright (c) 2010 Facepunch Studios See license in Gwen.h */ #pragma once #ifndef GWEN_UTILITY_H #define GWEN_UTILITY_H #include <sstream> #include <vector> #include "Gwen/Structures.h" namespace Gwen { namespace Utility { template <typename T> const T& Max( const T& x, const T& y ) { if ( y < x ) return x; return y; } template <typename T> const T& Min( const T& x, const T& y ) { if ( y > x ) return x; return y; } #ifdef _MSC_VER #pragma warning( push ) #pragma warning( disable : 4996 ) #endif inline String UnicodeToString( const UnicodeString& strIn ) { if ( !strIn.length() ) return ""; String temp(strIn.length(), (char)0); std::use_facet< std::ctype<wchar_t> >(std::locale()). \ narrow(&strIn[0], &strIn[0]+strIn.length(), ' ', &temp[0]); return temp; } inline UnicodeString StringToUnicode( const String& strIn ) { if ( !strIn.length() ) return L""; UnicodeString temp(strIn.length(), (wchar_t)0); std::use_facet< std::ctype<wchar_t> >(std::locale()). \ widen(&strIn[0], &strIn[0]+strIn.length(), &temp[0]); return temp; } #ifdef _MSC_VER #pragma warning( pop ) #endif template <class T> String ToString( const T& object ) { std::ostringstream os; os << object; return os.str(); } inline Gwen::Rect ClampRectToRect( Gwen::Rect inside, Gwen::Rect outside, bool clampSize = false ) { if ( inside.x < outside.x ) inside.x = outside.x; if ( inside.y < outside.y ) inside.y = outside.y; if ( inside.x + inside.w > outside.x + outside.w ) { if ( clampSize ) inside.w = outside.w; else inside.x = outside.x + outside.w - inside.w; } if ( inside.y + inside.h > outside.y + outside.h ) { if ( clampSize ) inside.h = outside.h; else inside.y = outside.w + outside.h - inside.h; } return inside; } GWEN_EXPORT UnicodeString Format( const wchar_t* fmt, ... ); namespace Strings { typedef std::vector<Gwen::String> List; typedef std::vector<Gwen::UnicodeString> UnicodeList; GWEN_EXPORT void Split( const Gwen::String& str, const Gwen::String& seperator, Strings::List& outbits, bool bLeaveSeperators = false ); GWEN_EXPORT void Split( const Gwen::UnicodeString& str, const Gwen::UnicodeString& seperator, Strings::UnicodeList& outbits, bool bLeaveSeperators = false ); template <typename T> T TrimLeft( const T& str, const T& strChars ) { T outstr = str; outstr.erase( 0, outstr.find_first_not_of( strChars ) ); return outstr; } namespace To { GWEN_EXPORT bool Bool( const Gwen::String& str ); GWEN_EXPORT int Int( const Gwen::String& str ); GWEN_EXPORT float Float( const Gwen::String& str ); GWEN_EXPORT bool Floats( const Gwen::String& str, float* f, size_t iCount ); } } } } #endif
/* * init.c: PROM library initialisation code. * * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov */ #include <linux/mm.h> #include <asm/bootinfo.h> #include <asm/addrspace.h> #include <asm/hp-lj/asic.h> #include <linux/bootmem.h> #include "utils.h" #define Delimiter "CMDLINE=" const char CommandLine[] = Delimiter "root=/dev/hda3 "; char arcs_cmdline[CL_SIZE]; int __init prom_init(int argc, char ** argv, char **envp) { ulong mem_size = get_mem_avail(); int reserve_size = 0; printk("Total Memory: %ld bytes\n", mem_size); reserve_buffer(CommandLine, mem_size); reserve_size = get_reserved_buffer_size(); mem_size -= reserve_size; add_memory_region(0x0,mem_size, BOOT_MEM_RAM); add_memory_region(mem_size,reserve_size, BOOT_MEM_RESERVED); printk("Main Memory: %ld bytes\n", mem_size); printk("Reserved Memory: %ld bytes at 0x%08x\n", get_reserved_buffer_size(), (ulong)get_reserved_buffer()); printk("Detected %s ASIC\n", GetAsicName()); mips_machgroup = MACH_GROUP_HP_LJ; mips_machtype = MACH_UNKNOWN; strcpy(arcs_cmdline, CommandLine+strlen(Delimiter)); return 0; } void prom_free_prom_memory (void) { }
#ifndef __edp_type__h #define __edp_type__h #define EDP_RUINT8(addr) (*((volatile unsigned char *)(addr))) #define EDP_WUINT8(addr,v) (*((volatile unsigned char *)(addr)) = (unsigned char)(v)) #define EDP_RUINT16(addr) (*((volatile unsigned short *)(addr))) #define EDP_WUINT16(addr,v) (*((volatile unsigned short *)(addr)) = (unsigned short)(v)) #define EDP_RUINT32(addr) (*((volatile unsigned long *)(addr))) #define EDP_WUINT32(addr,v) (*((volatile unsigned long *)(addr)) = (unsigned long)(v)) #define EDP_SBIT8(addr, v) (*((volatile unsigned char *)(addr)) |= (unsigned char)(v)) #define EDP_CBIT8(addr, v) (*((volatile unsigned char *)(addr)) &= ~(unsigned char)(v)) #define EDP_SBIT16(addr, v) (*((volatile unsigned short *)(addr)) |= (unsigned short)(v)) #define EDP_CBIT16(addr, v) (*((volatile unsigned short *)(addr)) &= ~(unsigned short)(v)) #define EDP_SBIT32(addr, v) (*((volatile unsigned long *)(addr)) |= (unsigned long)(v)) #define EDP_CBIT32(addr, v) (*((volatile unsigned long *)(addr)) &= (~(unsigned long)(v))) /*****************************************************/ /* Bit Position Definition */ /*****************************************************/ #define BIT0 0x00000001 #define BIT1 0x00000002 #define BIT2 0x00000004 #define BIT3 0x00000008 #define BIT4 0x00000010 #define BIT5 0x00000020 #define BIT6 0x00000040 #define BIT7 0x00000080 #define BIT8 0x00000100 #define BIT9 0x00000200 #define BIT10 0x00000400 #define BIT11 0x00000800 #define BIT12 0x00001000 #define BIT13 0x00002000 #define BIT14 0x00004000 #define BIT15 0x00008000 #define BIT16 0x00010000 #define BIT17 0x00020000 #define BIT18 0x00040000 #define BIT19 0x00080000 #define BIT20 0x00100000 #define BIT21 0x00200000 #define BIT22 0x00400000 #define BIT23 0x00800000 #define BIT24 0x01000000 #define BIT25 0x02000000 #define BIT26 0x04000000 #define BIT27 0x08000000 #define BIT28 0x10000000 #define BIT29 0x20000000 #define BIT30 0x40000000 #define BIT31 0x80000000 struct video_timming { unsigned int pclk; unsigned int x; unsigned int y; unsigned int ht; unsigned int hbp; unsigned int hpsw; unsigned int vt; unsigned int vbp; unsigned int vpsw; unsigned int fps; }; struct sink_info { unsigned int dp_rev; unsigned int dp_enhanced_frame_cap; unsigned int dp_max_link_rate; unsigned int dp_max_lane_count; unsigned int eDP_capable; }; struct training_info { unsigned int swing_lv; unsigned int preemp_lv; unsigned int postcur2_lv; }; enum edp_int { LINE0 = BIT31, LINE1 = BIT30, FIFO_EMPTY = BIT29, }; struct edp_para { unsigned int lane_count; unsigned int start_delay; unsigned int bit_rate; unsigned int swing_level; }; typedef void (*edp_print_string)(const char *c); typedef void (*edp_print_value)(unsigned int val); extern int edp_set_base_address(unsigned int address); extern int edp_set_print_str_func(edp_print_string print); extern int edp_set_print_val_func(edp_print_value print); extern int edp_enable(struct edp_para *para, struct video_timming *tmg); extern void edp_disable(void); extern void edp_set_start_delay(unsigned int delay); extern unsigned int edp_get_start_delay(void); extern void edp_int_enable(enum edp_int intterupt); extern void edp_int_disable(enum edp_int intterupt); extern unsigned int edp_get_int_status(enum edp_int intterupt); extern void edp_clr_int_status(enum edp_int intterupt); #endif // ifndef __edp_type__h
/*************************************************************************** * Copyright (c) 2003 Werner Mayer <wmayer[at]users.sourceforge.net> * * * * This file is part of the FreeCAD CAx development system. * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Library General Public * * License as published by the Free Software Foundation; either * * version 2 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Library General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this library; see the file COPYING.LIB. If not, * * write to the Free Software Foundation, Inc., 59 Temple Place, * * Suite 330, Boston, MA 02111-1307, USA * * * ***************************************************************************/ #ifndef MESHGUI_PRECOMPILED_H #define MESHGUI_PRECOMPILED_H #include <FCConfig.h> // Importing of App classes #ifdef FC_OS_WIN32 # define MeshExport __declspec(dllimport) # define MeshGuiExport __declspec(dllexport) #else // for Linux # define MeshExport # define MeshGuiExport #endif // here get the warnings of too long specifiers disabled (needed for VC6) #ifdef _MSC_VER # pragma warning( disable : 4251 ) # pragma warning( disable : 4503 ) # pragma warning( disable : 4275 ) # pragma warning( disable : 4786 ) // specifier longer then 255 chars #endif #ifdef _PreComp_ // Gts #ifdef FC_USE_GTS # include <gts.h> #endif // standard #include <stdio.h> #include <assert.h> // STL #include <algorithm> #include <bitset> #include <iostream> #include <fstream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <Python.h> #ifdef FC_OS_WIN32 # include <windows.h> #endif // Qt Toolkit #ifndef __Qt4All__ # include <Gui/Qt4All.h> #endif // Inventor #ifndef __InventorAll__ # include <Gui/InventorAll.h> #endif #elif defined(FC_OS_WIN32) #define NOMINMAX #include <windows.h> #endif //_PreComp_ #endif // MESHGUI_PRECOMPILED_H
/***************************************************************************** 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 middle-level C interface to LAPACK function chetrf * Author: Intel Corporation * Generated November, 2011 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_chetrf_work( int matrix_order, char uplo, lapack_int n, lapack_complex_float* a, lapack_int lda, lapack_int* ipiv, lapack_complex_float* work, lapack_int lwork ) { lapack_int info = 0; if( matrix_order == LAPACK_COL_MAJOR ) { /* Call LAPACK function and adjust info */ LAPACK_chetrf( &uplo, &n, a, &lda, ipiv, work, &lwork, &info ); if( info < 0 ) { info = info - 1; } } else if( matrix_order == LAPACK_ROW_MAJOR ) { lapack_int lda_t = MAX(1,n); lapack_complex_float* a_t = NULL; /* Check leading dimension(s) */ if( lda < n ) { info = -5; LAPACKE_xerbla( "LAPACKE_chetrf_work", info ); return info; } /* Query optimal working array(s) size if requested */ if( lwork == -1 ) { LAPACK_chetrf( &uplo, &n, a, &lda_t, ipiv, work, &lwork, &info ); return (info < 0) ? (info - 1) : info; } /* Allocate memory for temporary array(s) */ a_t = (lapack_complex_float*) LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) ); if( a_t == NULL ) { info = LAPACK_TRANSPOSE_MEMORY_ERROR; goto exit_level_0; } /* Transpose input matrices */ LAPACKE_che_trans( matrix_order, uplo, n, a, lda, a_t, lda_t ); /* Call LAPACK function and adjust info */ LAPACK_chetrf( &uplo, &n, a_t, &lda_t, ipiv, work, &lwork, &info ); if( info < 0 ) { info = info - 1; } /* Transpose output matrices */ LAPACKE_che_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda ); /* Release memory and exit */ LAPACKE_free( a_t ); exit_level_0: if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_chetrf_work", info ); } } else { info = -1; LAPACKE_xerbla( "LAPACKE_chetrf_work", info ); } return info; }
/* * Copyright (c) 2012 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "./vpx_config.h" #define FDCT32x32_2D_AVX2 vpx_fdct32x32_rd_avx2 #define FDCT32x32_HIGH_PRECISION 0 #include "vpx_dsp/x86/fwd_dct32x32_impl_avx2.h" #undef FDCT32x32_2D_AVX2 #undef FDCT32x32_HIGH_PRECISION #define FDCT32x32_2D_AVX2 vpx_fdct32x32_avx2 #define FDCT32x32_HIGH_PRECISION 1 #include "vpx_dsp/x86/fwd_dct32x32_impl_avx2.h" // NOLINT #undef FDCT32x32_2D_AVX2 #undef FDCT32x32_HIGH_PRECISION
/* * Copyright (C) 2011 Google, Inc. * * This is part of HarfBuzz, a text shaping library. * * Permission is hereby granted, without written agreement and without * license or royalty fees, to use, copy, modify, and distribute this * software and its documentation for any purpose, provided that the * above copyright notice and the following two paragraphs appear in * all copies of this software. * * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * Google Author(s): Behdad Esfahbod */ #if !defined(HB_GOBJECT_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR) #error "Include <hb-gobject.h> instead." #endif #ifndef HB_GOBJECT_STRUCTS_H #define HB_GOBJECT_STRUCTS_H #include "hb.h" #include <glib-object.h> HB_BEGIN_DECLS /* Object types */ HB_EXTERN GType hb_gobject_blob_get_type (void); #define HB_GOBJECT_TYPE_BLOB (hb_gobject_blob_get_type ()) HB_EXTERN GType hb_gobject_buffer_get_type (void); #define HB_GOBJECT_TYPE_BUFFER (hb_gobject_buffer_get_type ()) HB_EXTERN GType hb_gobject_face_get_type (void); #define HB_GOBJECT_TYPE_FACE (hb_gobject_face_get_type ()) HB_EXTERN GType hb_gobject_font_get_type (void); #define HB_GOBJECT_TYPE_FONT (hb_gobject_font_get_type ()) HB_EXTERN GType hb_gobject_font_funcs_get_type (void); #define HB_GOBJECT_TYPE_FONT_FUNCS (hb_gobject_font_funcs_get_type ()) HB_EXTERN GType hb_gobject_set_get_type (void); #define HB_GOBJECT_TYPE_SET (hb_gobject_set_get_type ()) HB_EXTERN GType hb_gobject_map_get_type (void); #define HB_GOBJECT_TYPE_MAP (hb_gobject_map_get_type ()) HB_EXTERN GType hb_gobject_shape_plan_get_type (void); #define HB_GOBJECT_TYPE_SHAPE_PLAN (hb_gobject_shape_plan_get_type ()) HB_EXTERN GType hb_gobject_unicode_funcs_get_type (void); #define HB_GOBJECT_TYPE_UNICODE_FUNCS (hb_gobject_unicode_funcs_get_type ()) /* Value types */ HB_EXTERN GType hb_gobject_feature_get_type (void); #define HB_GOBJECT_TYPE_FEATURE (hb_gobject_feature_get_type ()) HB_EXTERN GType hb_gobject_glyph_info_get_type (void); #define HB_GOBJECT_TYPE_GLYPH_INFO (hb_gobject_glyph_info_get_type ()) HB_EXTERN GType hb_gobject_glyph_position_get_type (void); #define HB_GOBJECT_TYPE_GLYPH_POSITION (hb_gobject_glyph_position_get_type ()) HB_EXTERN GType hb_gobject_segment_properties_get_type (void); #define HB_GOBJECT_TYPE_SEGMENT_PROPERTIES (hb_gobject_segment_properties_get_type ()) HB_EXTERN GType hb_gobject_user_data_key_get_type (void); #define HB_GOBJECT_TYPE_USER_DATA_KEY (hb_gobject_user_data_key_get_type ()) HB_EXTERN GType hb_gobject_ot_math_glyph_variant_get_type (void); #define HB_GOBJECT_TYPE_OT_MATH_GLYPH_VARIANT (hb_gobject_ot_math_glyph_variant_get_type ()) HB_EXTERN GType hb_gobject_ot_math_glyph_part_get_type (void); #define HB_GOBJECT_TYPE_OT_MATH_GLYPH_PART (hb_gobject_ot_math_glyph_part_get_type ()) HB_END_DECLS #endif /* HB_GOBJECT_H */
#ifndef AC_BRELEM2D_H #define AC_BRELEM2D_H 1 // (C) Copyright 1997-1999 by Autodesk, Inc. // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warranty and // restricted rights notice below appear in all supporting // documentation. // // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // // Use, duplication, or disclosure by the U.S. Government is subject to // restrictions set forth in FAR 52.227-19 (Commercial Computer // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) // (Rights in Technical Data and Computer Software), as applicable. // // DESCRIPTION: // // The AcBrElement2d class is the interface class for linear, first- // order two-dimensional elements in a mesh. All the functionality // supported by this class is implemented by the class AcBrImpElement2d. // // This class defines the functions that are pertinent to the 2d // element level of a mesh, and cannot be directly set by the user // as the initialisation requirements are only available internally // at the time of a call to AcBrMesh2d::generate(). // // A 2d element is a planar approximation of a subset of a bounded // surface and thus has no directly associated geometry. It represents // a polygonal (i.e., closed) set of at least three co-planar nodes in // a mesh (Note that the associated node coordinates can be used to // instantiate an AcGePlane). A mapping back to the original brep // topology is provided in the form of a backpointer to the face which // generated this element (cf. AcBrMeshEntity::getEntityAssociated()). // // This class generally is accessed by the user via a mesh element // traverser. The only way to delete the element referenced by this class // from the mesh data cache is to delete the mesh object that owns it, // or to regenerate the mesh. // // The set() element data initialiser is for internal use only. It is used // to set this mesh element's internal data using an unexported type. // // The get() element data query is for internal use only. It retrieves // this mesh element's internal data using an unexported type. // // The getNormal() element normal query returns the normalised model // space normal vector computed on the plane defined by the element // nodes traversed in a clockwise direction. The normal vector is // returned as an AcGeVector3d, with the entire chain of transforms // from the original face applied. The vector is instantiated by the // caller and passed by reference for getNormal() to set. If this mesh // element object is uninitialised, eUninitialisedObject is returned. // If there are fewer than three nodes in the element, or if the nodes // are colinear (as measured to within a tolerance of 1.0e-10 on the // dot products of the vectors from one node to the next), Acad:: // eDegenerateGeometry is returned. In the event of an error, the // normal vector reference argument's value is unchanged. #include "adesk.h" #include "rxobject.h" #include "rxboiler.h" #include "brgbl.h" #include "brelem.h" // forward class declarations class AcGeVector3d; class AcBrElement; class AcBrElement2dData; class AcBrElement2d : public AcBrElement { public: ACRX_DECLARE_MEMBERS(AcBrElement2d); AcBrElement2d(); AcBrElement2d(const AcBrElement2d& src); ~AcBrElement2d(); // Assignment operator AcBrElement2d& operator = (const AcBrElement2d& src); // Queries & Initialisers AcBr::ErrorStatus set (AcBrElement2dData* data); AcBr::ErrorStatus get (AcBrElement2dData*& data) const; // Geometry (for stereolithography support) AcBr::ErrorStatus getNormal (AcGeVector3d& normal) const; }; #endif
/* * Copyright (c) 2003, 2007-11 Matteo Frigo * Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology * * 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 * */ #include "dft.h" typedef struct { solver super; } S; typedef struct { plan_dft super; twid *td; INT n, is, os; } P; static void cdot(INT n, const E *x, const R *w, R *or0, R *oi0, R *or1, R *oi1) { INT i; E rr = x[0], ri = 0, ir = x[1], ii = 0; x += 2; for (i = 1; i + i < n; ++i) { rr += x[0] * w[0]; ir += x[1] * w[0]; ri += x[2] * w[1]; ii += x[3] * w[1]; x += 4; w += 2; } *or0 = rr + ii; *oi0 = ir - ri; *or1 = rr - ii; *oi1 = ir + ri; } static void hartley(INT n, const R *xr, const R *xi, INT xs, E *o, R *pr, R *pi) { INT i; E sr, si; o[0] = sr = xr[0]; o[1] = si = xi[0]; o += 2; for (i = 1; i + i < n; ++i) { sr += (o[0] = xr[i * xs] + xr[(n - i) * xs]); si += (o[1] = xi[i * xs] + xi[(n - i) * xs]); o[2] = xr[i * xs] - xr[(n - i) * xs]; o[3] = xi[i * xs] - xi[(n - i) * xs]; o += 4; } *pr = sr; *pi = si; } static void apply(const plan *ego_, R *ri, R *ii, R *ro, R *io) { const P *ego = (const P *) ego_; INT i; INT n = ego->n, is = ego->is, os = ego->os; const R *W = ego->td->W; E *buf; size_t bufsz = n * 2 * sizeof(E); BUF_ALLOC(E *, buf, bufsz); hartley(n, ri, ii, is, buf, ro, io); for (i = 1; i + i < n; ++i) { cdot(n, buf, W, ro + i * os, io + i * os, ro + (n - i) * os, io + (n - i) * os); W += n - 1; } BUF_FREE(buf, bufsz); } static void awake(plan *ego_, enum wakefulness wakefulness) { P *ego = (P *) ego_; static const tw_instr half_tw[] = { { TW_HALF, 1, 0 }, { TW_NEXT, 1, 0 } }; X(twiddle_awake)(wakefulness, &ego->td, half_tw, ego->n, ego->n, (ego->n - 1) / 2); } static void print(const plan *ego_, printer *p) { const P *ego = (const P *) ego_; p->print(p, "(dft-generic-%D)", ego->n); } static int applicable(const solver *ego, const problem *p_, const planner *plnr) { const problem_dft *p = (const problem_dft *) p_; UNUSED(ego); return (1 && p->sz->rnk == 1 && p->vecsz->rnk == 0 && (p->sz->dims[0].n % 2) == 1 && CIMPLIES(NO_LARGE_GENERICP(plnr), p->sz->dims[0].n < GENERIC_MIN_BAD) && CIMPLIES(NO_SLOWP(plnr), p->sz->dims[0].n > GENERIC_MAX_SLOW) && X(is_prime)(p->sz->dims[0].n) ); } static plan *mkplan(const solver *ego, const problem *p_, planner *plnr) { const problem_dft *p; P *pln; INT n; static const plan_adt padt = { X(dft_solve), awake, print, X(plan_null_destroy) }; if (!applicable(ego, p_, plnr)) return (plan *)0; pln = MKPLAN_DFT(P, &padt, apply); p = (const problem_dft *) p_; pln->n = n = p->sz->dims[0].n; pln->is = p->sz->dims[0].is; pln->os = p->sz->dims[0].os; pln->td = 0; pln->super.super.ops.add = (n-1) * 5; pln->super.super.ops.mul = 0; pln->super.super.ops.fma = (n-1) * (n-1) ; #if 0 /* these are nice pipelined sequential loads and should cost nothing */ pln->super.super.ops.other = (n-1)*(4 + 1 + 2 * (n-1)); /* approximate */ #endif return &(pln->super.super); } static solver *mksolver(void) { static const solver_adt sadt = { PROBLEM_DFT, mkplan, 0 }; S *slv = MKSOLVER(S, &sadt); return &(slv->super); } void X(dft_generic_register)(planner *p) { REGISTER_SOLVER(p, mksolver()); }
// license:BSD-3-Clause // copyright-holders:Dirk Best /*************************************************************************** Intel 82730 Text Coprocessor ***************************************************************************/ #ifndef MAME_VIDEO_I82730_H #define MAME_VIDEO_I82730_H #pragma once //************************************************************************** // TYPE DEFINITIONS //************************************************************************** #define I82730_UPDATE_ROW(name) \ void name(bitmap_rgb32 &bitmap, uint16_t *data, uint8_t lc, uint16_t y, int x_count) // ======================> i82730_device class i82730_device : public device_t, public device_video_interface { public: typedef device_delegate<void (bitmap_rgb32 &bitmap, uint16_t *data, uint8_t lc, uint16_t y, int x_count)> update_row_delegate; // construction/destruction template <typename T> i82730_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag) : i82730_device(mconfig, tag, owner, clock) { m_cpu.set_tag(std::forward<T>(cpu_tag)); } i82730_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // callbacks auto sint() { return m_sint_handler.bind(); } // inline configuration template <typename... T> void set_update_row_callback(T &&... args) { m_update_row_cb.set(std::forward<T>(args)...); } uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(ca_w); DECLARE_WRITE_LINE_MEMBER(irst_w); protected: virtual void device_start() override; virtual void device_reset() override; private: // status enum { DUR = 0x001, // data underrun LPU = 0x002, // light pen update DBOR = 0x004, // data buffer overrun EONF = 0x008, // end of n frames FDE = 0x010, // frame data error RCC = 0x020, // reserved channel command executed RDC = 0x040, // reserved data stream command executed DIP = 0x080, // display in progress VDIP = 0x100 // virtual display in progress }; bool sysbus_16bit() { return BIT(m_sysbus, 0); } uint8_t read_byte(offs_t address); uint16_t read_word(offs_t address); void write_byte(offs_t address, uint8_t data); void write_word(offs_t address, uint16_t data); void update_interrupts(); void mode_set(); void execute_command(); bool dscmd_endrow(); bool dscmd_eof(); bool dscmd_eol(); bool dscmd_fulrowdescrpt(uint8_t param); bool dscmd_sl_scroll_strt(uint8_t param); bool dscmd_sl_scroll_end(uint8_t param); bool dscmd_tab_to(uint8_t param); bool dscmd_max_dma_count(uint8_t param); bool dscmd_endstrg(); bool dscmd_skip(uint8_t param); bool dscmd_repeat(uint8_t param); bool dscmd_sub_sup(uint8_t param); bool dscmd_rpt_sub_sup(uint8_t param); bool dscmd_set_gen_pur_attrib(uint8_t param); bool dscmd_set_field_attrib(); bool dscmd_init_next_process(); bool execute_datastream_command(uint8_t command, uint8_t param); void load_row(); void attention(); TIMER_CALLBACK_MEMBER(row_update); devcb_write_line m_sint_handler; update_row_delegate m_update_row_cb; required_device<cpu_device> m_cpu; address_space *m_program; emu_timer *m_row_timer; bitmap_rgb32 m_bitmap; // internal registers bool m_initialized; bool m_mode_set; int m_ca; bool m_ca_latch; uint8_t m_sysbus; uint32_t m_ibp; // intermediate block pointer uint32_t m_cbp; // command block pointer bool m_list_switch; bool m_auto_line_feed; uint8_t m_max_dma_count; uint32_t m_lptr; uint16_t m_status; uint16_t m_intmask; uint32_t m_sptr; struct modeset { // horizontal modes uint8_t burst_length; uint8_t burst_space; uint8_t line_length; uint8_t hsyncstp; uint8_t hfldstrt; uint8_t hfldstp; uint8_t hbrdstrt; uint8_t hbrdstp; uint8_t scroll_margin; // char row characteristics bool rvv_row; bool blk_row; bool dbl_hgt; bool wdef; uint8_t lpr; uint8_t nrmstrt; uint8_t nrmstp; uint8_t supstrt; uint8_t supstp; uint8_t substrt; uint8_t substp; uint8_t cur1strt; uint8_t cur1stp; uint8_t cur2strt; uint8_t cur2stp; uint8_t u2_line_sel; uint8_t u1_line_sel; uint16_t field_attribute_mask; // vertical modes uint16_t frame_length; uint16_t vsyncstp; uint16_t vfldstrt; uint16_t vfldstp; // blink control uint8_t duty_cyc_cursor; uint8_t cursor_blink; uint8_t frame_int_count; uint8_t duty_cyc_char; uint8_t char_blink; bool ile; bool rfe; bool bpol; bool bue; bool cr2_cd; bool cr1_cd; bool cr2_be; bool cr1_be; // atrribute bit selects uint8_t reverse_video; uint8_t blinking_char; bool cr2_rvv; bool cr1_rvv; bool cr2_oe; bool cr1_oe; uint8_t abs_line_count; uint8_t invisible_char; uint8_t underline2; uint8_t underline1; } m_mb; uint16_t m_row_buffer[2][200]; uint16_t *m_row; // pointer to currently active row buffer uint8_t m_dma_count; uint8_t m_row_count; // maximum 200 int m_row_index; // 0 or 1 struct cursor { uint8_t x; uint8_t y; } m_cursor[2]; }; // device type definition DECLARE_DEVICE_TYPE(I82730, i82730_device) #endif // MAME_VIDEO_I82730_H
/* * test-treap.c: code to exercise the svn importer's treap structure */ #include "cache.h" #include "vcs-svn/obj_pool.h" #include "vcs-svn/trp.h" struct int_node { uintmax_t n; struct trp_node children; }; obj_pool_gen(node, struct int_node, 3) static int node_cmp(struct int_node *a, struct int_node *b) { return (a->n > b->n) - (a->n < b->n); } trp_gen(static, treap_, struct int_node, children, node, node_cmp) static void strtonode(struct int_node *item, const char *s) { char *end; item->n = strtoumax(s, &end, 10); if (*s == '\0' || (*end != '\n' && *end != '\0')) die("invalid integer: %s", s); } int main(int argc, char *argv[]) { struct strbuf sb = STRBUF_INIT; struct trp_root root = { ~0 }; uint32_t item; if (argc != 1) usage("test-treap < ints"); while (strbuf_getline(&sb, stdin, '\n') != EOF) { struct int_node *node = node_pointer(node_alloc(1)); item = node_offset(node); strtonode(node, sb.buf); node = treap_insert(&root, node_pointer(item)); if (node_offset(node) != item) die("inserted %"PRIu32" in place of %"PRIu32"", node_offset(node), item); } item = node_offset(treap_first(&root)); while (~item) { uint32_t next; struct int_node *tmp = node_pointer(node_alloc(1)); tmp->n = node_pointer(item)->n; next = node_offset(treap_next(&root, node_pointer(item))); treap_remove(&root, node_pointer(item)); item = node_offset(treap_nsearch(&root, tmp)); if (item != next && (!~item || node_pointer(item)->n != tmp->n)) die("found %"PRIuMAX" in place of %"PRIuMAX"", ~item ? node_pointer(item)->n : ~(uintmax_t) 0, ~next ? node_pointer(next)->n : ~(uintmax_t) 0); printf("%"PRIuMAX"\n", tmp->n); } node_reset(); return 0; }
/* * linux/arch/ppc64/mm/extable.c * * from linux/arch/i386/mm/extable.c * * 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/config.h> #include <linux/module.h> #include <linux/spinlock.h> #include <asm/uaccess.h> extern struct exception_table_entry __start___ex_table[]; extern struct exception_table_entry __stop___ex_table[]; /* * The exception table needs to be sorted because we use the macros * which put things into the exception table in a variety of segments * as well as the init segment and the main kernel text segment. */ static inline void sort_ex_table(struct exception_table_entry *start, struct exception_table_entry *finish) { struct exception_table_entry el, *p, *q; /* insertion sort */ for (p = start + 1; p < finish; ++p) { /* start .. p-1 is sorted */ if (p[0].insn < p[-1].insn) { /* move element p down to its right place */ el = *p; q = p; do { /* el comes before q[-1], move q[-1] up one */ q[0] = q[-1]; --q; } while (q > start && el.insn < q[-1].insn); *q = el; } } } void sort_exception_table(void) { sort_ex_table(__start___ex_table, __stop___ex_table); } static inline unsigned long search_one_table(const struct exception_table_entry *first, const struct exception_table_entry *last, unsigned long value) { while (first <= last) { const struct exception_table_entry *mid; long diff; mid = (last - first) / 2 + first; diff = mid->insn - value; if (diff == 0) return mid->fixup; else if (diff < 0) first = mid+1; else last = mid-1; } return 0; } extern spinlock_t modlist_lock; unsigned long search_exception_table(unsigned long addr) { unsigned long ret = 0; #ifndef CONFIG_MODULES /* There is only the kernel to search. */ ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr); return ret; #else unsigned long flags; /* The kernel is the last "module" -- no need to treat it special. */ struct module *mp; spin_lock_irqsave(&modlist_lock, flags); for (mp = module_list; mp != NULL; mp = mp->next) { if (mp->ex_table_start == NULL || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING))) continue; ret = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, addr); if (ret) break; } spin_unlock_irqrestore(&modlist_lock, flags); return ret; #endif }
// --------------------------------------------------------------------- // // Copyright (C) 2012 - 2015 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. // // --------------------------------------------------------------------- #ifndef dealii__std_cxx11_iterator_h #define dealii__std_cxx11_iterator_h #include <deal.II/base/config.h> #ifdef DEAL_II_WITH_CXX11 # include <iterator> DEAL_II_NAMESPACE_OPEN namespace std_cxx11 { using std::begin; using std::end; } DEAL_II_NAMESPACE_CLOSE #else #include <boost/range.hpp> DEAL_II_NAMESPACE_OPEN namespace std_cxx11 { using boost::begin; using boost::end; } DEAL_II_NAMESPACE_CLOSE #endif #endif
/********************************************************************** * File: imgtiff.h (Formerly tiff.h) * Description: Header file for tiff format image reader/writer. * Author: Ray Smith * Created: Mon Jun 11 15:19:41 BST 1990 * * (C) Copyright 1990, Hewlett-Packard Ltd. ** 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 IMGTIFF_H #define IMGTIFF_H #include "host.h" // CountTiffPages // Returns the number of pages in the file if it is a tiff file, otherwise 0. int CountTiffPages(FILE* fp); #endif
/* DirectMusic Buffer Format * * Copyright (C) 2003-2004 Rok Mandeljc * * 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 St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WINE_DMUSIC_BUFFER_H #define __WINE_DMUSIC_BUFFER_H #include <dmdls.h> /***************************************************************************** * Misc. definitions */ #define QWORD_ALIGN(x) (((x) + 7) & ~7) #define DMUS_EVENT_SIZE(cb) QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb) /***************************************************************************** * Flags */ #define DMUS_EVENT_STRUCTURED 0x1 /***************************************************************************** * Structures */ /* typedef definitions */ typedef struct _DMUS_EVENTHEADER DMUS_EVENTHEADER, *LPDMUS_EVENTHEADER; /* actual structure*/ #include <pshpack4.h> struct _DMUS_EVENTHEADER { DWORD cbEvent; DWORD dwChannelGroup; REFERENCE_TIME rtDelta; DWORD dwFlags; }; #include <poppack.h> #endif /* __WINE_DMUSIC_BUFFER_H */
/* 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 __KGSL_PWRCTRL_H #define __KGSL_PWRCTRL_H /***************************************************************************** ** power flags *****************************************************************************/ #define KGSL_PWRFLAGS_ON 1 #define KGSL_PWRFLAGS_OFF 0 #define KGSL_PWRLEVEL_TURBO 0 #define KGSL_PWRLEVEL_NOMINAL 1 #define KGSL_PWRLEVEL_LAST_OFFSET 2 #define KGSL_MAX_CLKS 5 struct platform_device; struct kgsl_clk_stats { unsigned int old_clock_time[KGSL_MAX_PWRLEVELS]; unsigned int clock_time[KGSL_MAX_PWRLEVELS]; unsigned int on_time_old; ktime_t start; ktime_t stop; unsigned int no_nap_cnt; unsigned int elapsed; unsigned int elapsed_old; }; /** * struct kgsl_pwrctrl - Power control settings for a KGSL device * @interrupt_num - The interrupt number for the device * @ebi1_clk - Pointer to the EBI clock structure * @grp_clks - Array of clocks structures that we control * @power_flags - Control flags for power * @pwrlevels - List of supported power levels * @active_pwrlevel - The currently active power level * @thermal_pwrlevel - maximum powerlevel constraint from thermal * @max_pwrlevel - maximum allowable powerlevel per the user * @min_pwrlevel - minimum allowable powerlevel per the user * @num_pwrlevels - number of available power levels * @interval_timeout - timeout in jiffies to be idle before a power event * @strtstp_sleepwake - true if the device supports low latency GPU start/stop * @gpu_reg - pointer to the regulator structure for gpu_reg * @gpu_cx - pointer to the regulator structure for gpu_cx * @pcl - bus scale identifier * @nap_allowed - true if the device supports naps * @idle_needed - true if the device needs a idle before clock change * @irq_name - resource name for the IRQ * @restore_slumber - Flag to indicate that we are in a suspend/restore sequence * @clk_stats - structure of clock statistics */ struct kgsl_pwrctrl { int interrupt_num; struct clk *ebi1_clk; struct clk *grp_clks[KGSL_MAX_CLKS]; unsigned long power_flags; struct kgsl_pwrlevel pwrlevels[KGSL_MAX_PWRLEVELS]; unsigned int active_pwrlevel; int thermal_pwrlevel; unsigned int default_pwrlevel; unsigned int max_pwrlevel; unsigned int min_pwrlevel; unsigned int num_pwrlevels; unsigned int interval_timeout; bool strtstp_sleepwake; struct regulator *gpu_reg; struct regulator *gpu_cx; uint32_t pcl; unsigned int nap_allowed; unsigned int idle_needed; const char *regulator_name; const char *irq_name; s64 time; unsigned int restore_slumber; struct kgsl_clk_stats clk_stats; }; void kgsl_pwrctrl_irq(struct kgsl_device *device, int state); int kgsl_pwrctrl_init(struct kgsl_device *device); void kgsl_pwrctrl_close(struct kgsl_device *device); void kgsl_timer(unsigned long data); void kgsl_idle_check(struct work_struct *work); void kgsl_pre_hwaccess(struct kgsl_device *device); void kgsl_check_suspended(struct kgsl_device *device); int kgsl_pwrctrl_sleep(struct kgsl_device *device); void kgsl_pwrctrl_wake(struct kgsl_device *device); void kgsl_pwrctrl_pwrlevel_change(struct kgsl_device *device, unsigned int level); int kgsl_pwrctrl_init_sysfs(struct kgsl_device *device); void kgsl_pwrctrl_uninit_sysfs(struct kgsl_device *device); void kgsl_pwrctrl_enable(struct kgsl_device *device); void kgsl_pwrctrl_disable(struct kgsl_device *device); static inline unsigned long kgsl_get_clkrate(struct clk *clk) { return (clk != NULL) ? clk_get_rate(clk) : 0; } void kgsl_pwrctrl_set_state(struct kgsl_device *device, unsigned int state); void kgsl_pwrctrl_request_state(struct kgsl_device *device, unsigned int state); #endif /* __KGSL_PWRCTRL_H */
/* * firmware_memmap.c: Read /sys/firmware/memmap * * Created by: Bernhard Walle (bernhard.walle@gmx.de) * Copyright (C) SUSE LINUX Products GmbH, 2008. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef FIRMWARE_MEMMAP_H #define FIRMWARE_MEMMAP_H #include "kexec.h" /** * Reads the /sys/firmware/memmap interface, documented in * Documentation/ABI/testing/sysfs-firmware-memmap (kernel tree). * * The difference between /proc/iomem and /sys/firmware/memmap is that * /sys/firmware/memmap provides the raw memory map, provided by the * firmware of the system. That memory map should be passed to a kexec'd * kernel because the behaviour should be the same as a normal booted kernel, * so any limitation (e.g. by the user providing the mem command line option) * should not be passed to the kexec'd kernel. * * The parsing of the code is independent of the architecture. However, the * actual architecture-specific code might postprocess the code a bit, like * x86 does. */ /** * Compares two memory ranges according to their start address. This function * can be used with qsort() as @c compar function. * * @param[in] first a pointer to the first memory range * @param[in] second a pointer to the second memory range * @return 0 if @p first and @p second have the same start address, * a value less then 0 if the start address of @p first is less than * the start address of @p second, and a value greater than 0 if * the opposite is in case. */ int compare_ranges(const void *first, const void *second); /** * Checks if the kernel provides the /sys/firmware/memmap interface. * It makes sense to use that function in advance before calling * get_firmware_memmap_ranges() because the latter function prints an error * if it cannot open the directory. If have_sys_firmware_memmap() returns * false, then one can use the old /proc/iomem interface (for older kernels). */ int have_sys_firmware_memmap(void); /** * Parses the /sys/firmware/memmap memory map. * * @param[out] range a pointer to an array of type struct memory_range with * at least *range entries * @param[in,out] ranges a pointer to an integer that holds the number of * entries which range contains (at least). After successful * return, the number of actual entries will be written. * @return 0 on success, -1 on failure. */ int get_firmware_memmap_ranges(struct memory_range *range, size_t *ranges); #endif /* FIRMWARE_MEMMAP_H */
/*************************************************************************** * Copyright (c) 2006 Werner Mayer <wmayer[at]users.sourceforge.net> * * * * This file is part of the FreeCAD CAx development system. * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Library General Public * * License as published by the Free Software Foundation; either * * version 2 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Library General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this library; see the file COPYING.LIB. If not, * * write to the Free Software Foundation, Inc., 59 Temple Place, * * Suite 330, Boston, MA 02111-1307, USA * * * ***************************************************************************/ #ifndef MESHGUI_PROPERTYEDITOR_MESH_H #define MESHGUI_PROPERTYEDITOR_MESH_H #include <Gui/propertyeditor/PropertyItem.h> namespace MeshGui { /** * Display data of a mesh kernel. * \author Werner Mayer */ class MeshGuiExport PropertyMeshKernelItem : public Gui::PropertyEditor::PropertyItem { Q_OBJECT Q_PROPERTY(int Points READ countPoints) Q_PROPERTY(int Edges READ countEdges) Q_PROPERTY(int Faces READ countFaces) PROPERTYITEM_HEADER virtual QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const; virtual void setEditorData(QWidget *editor, const QVariant& data) const; virtual QVariant editorData(QWidget *editor) const; int countPoints() const; int countEdges() const; int countFaces() const; protected: virtual QVariant toolTip(const App::Property*) const; virtual QVariant value(const App::Property*) const; virtual void setValue(const QVariant&); protected: PropertyMeshKernelItem(); void initialize(); private: Gui::PropertyEditor::PropertyIntegerItem* m_p; Gui::PropertyEditor::PropertyIntegerItem* m_e; Gui::PropertyEditor::PropertyIntegerItem* m_f; }; } // namespace MeshGui #endif // MESHGUI_PROPERTYEDITOR_MESH_H
#ifndef _LWLAYER_H_ #define _LWLAYER_H_ #include "lwo.h" #include "lwPolygon.h" class lwLayer { public: lwLayer() { name = 0; pointsoffset = 0; polygonsoffset = 0; } ~lwLayer() { if (name) free(name); unsigned int i; for (i=0; i < points.size(); delete points[i++]); for (i=0; i < polygons.size(); delete polygons[i++]); for (i=0; i < vmaps.size(); delete vmaps[i++]); } void lwResolveVertexPoints(void); void lwGetPointPolygons(void); void calculatePolygonNormals(void); void triangulatePolygons(void); void lwGetPointVMaps(void); void lwGetPolyVMaps(void); void lwGetBoundingBox(void); void calculateVertexNormals(void); int lwResolvePolySurfaces( vsurfaces &surfaces, vtags &tags ); char *name; int index; int parent; int flags; Point3 pivot; Point3 bboxmin; Point3 bboxmax; int pointsoffset; /* only used during reading */ vpoints points; /* array of points */ int polygonsoffset; /* only used during reading */ vpolygons polygons; /* array of polygons */ vvmaps vmaps; /* linked list of vmaps */ }; typedef vector<lwLayer*> vlayers; #endif // _LWLAYER_H_
/* Copyright (C) 2007-2010 Open Information Security Foundation * * You can copy, redistribute or modify this Program 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 * version 2 along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /** * \file * * \author Brian Rectanus <brectanu@gmail.com> */ #ifndef __DETECT_SEQ_H__ #define __DETECT_SEQ_H__ /** * \brief seq data */ typedef struct DetectSeqData_ { uint32_t seq; /**< seq to match */ } DetectSeqData; /** * \brief Registration function for ack: keyword */ void DetectSeqRegister(void); #endif /* __DETECT_SEQ_H__ */
/* Test program for POSIX shm_* functions. Copyright (C) 2000-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 2000. 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 <errno.h> #include <error.h> #include <fcntl.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <sys/mman.h> #include <sys/stat.h> #include <sys/wait.h> /* We want to see output immediately. */ #define STDOUT_UNBUFFERED static void worker (int write_now) { struct timespec ts; struct stat64 st; int i; int fd = shm_open ("/glibc-shm-test", O_RDWR, 0600); if (fd == -1) error (EXIT_FAILURE, 0, "failed to open shared memory object: shm_open"); char *mem; if (fd == -1) exit (fd); if (fstat64 (fd, &st) == -1) error (EXIT_FAILURE, 0, "stat failed"); if (st.st_size != 4000) error (EXIT_FAILURE, 0, "size incorrect"); mem = mmap (NULL, 4000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (mem == MAP_FAILED) error (EXIT_FAILURE, 0, "mmap failed"); ts.tv_sec = 0; ts.tv_nsec = 500000000; if (write_now) for (i = 0; i <= 4; ++i) mem[i] = i; else /* Wait until the first bytes of the memory region are 0, 1, 2, 3, 4. */ while (1) { for (i = 0; i <= 4; ++i) if (mem[i] != i) break; if (i > 4) /* OK, that's done. */ break; nanosleep (&ts, NULL); } if (!write_now) for (i = 0; i <= 4; ++i) mem[i] = 4 + i; else /* Wait until the first bytes of the memory region are 4, 5, 6, 7, 8. */ while (1) { for (i = 0; i <= 4; ++i) if (mem[i] != 4 + i) break; if (i > 4) /* OK, that's done. */ break; nanosleep (&ts, NULL); } if (munmap (mem, 4000) == -1) error (EXIT_FAILURE, errno, "munmap"); close (fd); exit (0); } static int do_test (void) { int fd; pid_t pid1; pid_t pid2; int status1; int status2; struct stat64 st; fd = shm_open ("/../escaped", O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600); if (fd != -1) { perror ("read file outside of SHMDIR directory"); return 1; } /* Create the shared memory object. */ fd = shm_open ("/glibc-shm-test", O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600); if (fd == -1) { /* If shm_open is unimplemented we skip the test. */ if (errno == ENOSYS) { perror ("shm_open unimplemented. Test skipped."); return 0; } else error (EXIT_FAILURE, 0, "failed to create shared memory object: shm_open"); } /* Size the object. We make it 4000 bytes long. */ if (ftruncate (fd, 4000) == -1) { /* This failed. Must be a bug in the implementation of the shared memory itself. */ perror ("failed to size of shared memory object: ftruncate"); close (fd); shm_unlink ("/glibc-shm-test"); return 0; } if (fstat64 (fd, &st) == -1) { shm_unlink ("/glibc-shm-test"); error (EXIT_FAILURE, 0, "initial stat failed"); } if (st.st_size != 4000) { shm_unlink ("/glibc-shm-test"); error (EXIT_FAILURE, 0, "initial size not correct"); } /* Spawn to processes which will do the work. */ pid1 = fork (); if (pid1 == 0) worker (0); else if (pid1 == -1) { /* Couldn't create a second process. */ perror ("fork"); close (fd); shm_unlink ("/glibc-shm-test"); return 0; } pid2 = fork (); if (pid2 == 0) worker (1); else if (pid2 == -1) { /* Couldn't create a second process. */ int ignore; perror ("fork"); kill (pid1, SIGTERM); waitpid (pid1, &ignore, 0); close (fd); shm_unlink ("/glibc-shm-test"); return 0; } /* Wait until the two processes are finished. */ waitpid (pid1, &status1, 0); waitpid (pid2, &status2, 0); /* Now we can unlink the shared object. */ shm_unlink ("/glibc-shm-test"); return (!WIFEXITED (status1) || WEXITSTATUS (status1) != 0 || !WIFEXITED (status2) || WEXITSTATUS (status2) != 0); } #define TEST_FUNCTION do_test () #define CLEANUP_HANDLER shm_unlink ("/glibc-shm-test"); #include "../test-skeleton.c"
/* 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/>. */ #include <stddef.h> #include <errno.h> #include <unistd.h> /* Return the login name of the user, or NULL if it can't be determined. The returned pointer, if not NULL, is good only until the next call. */ char * getlogin (void) { __set_errno (ENOSYS); return NULL; } stub_warning (getlogin)
/* Copyright (C) 2010-2014 Intel Corporation. All Rights Reserved. This file is part of SEP Development Kit SEP Development Kit 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. SEP Development Kit 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 SEP Development Kit; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA As a special exception, you may use this file as part of a free software library without restriction. Specifically, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other files to produce an executable, this file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ #include <linux/smp.h> void func(void* info) { } int autoconf_test(void) { return smp_call_function(func, NULL, 0, 1); }
/* $NoKeywords:$ */ /** * @file * * AMD CPU Cache Flush On Halt Function. * * Contains code to Level the Feature in a multi-socket system * * @xrefitem bom "File Content Label" "Release Content" * @e project: AGESA * @e sub-project: CPU/Family/0x10/BL * @e \$Revision: 35136 $ @e \$Date: 2010-07-16 11:29:48 +0800 (Fri, 16 Jul 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. * * *************************************************************************** * */ /* *---------------------------------------------------------------------------- * MODULES USED * *---------------------------------------------------------------------------- */ #include "AGESA.h" #include "cpuRegisters.h" #include "cpuServices.h" #include "cpuFamilyTranslation.h" #include "GeneralServices.h" #include "cpuPostInit.h" #include "cpuFeatures.h" #include "Filecode.h" CODE_GROUP (G1_PEICC) RDATA_GROUP (G1_PEICC) #define FILECODE PROC_CPU_FAMILY_0X10_REVC_BL_F10BLCACHEFLUSHONHALT_FILECODE /*---------------------------------------------------------------------------- * DEFINITIONS AND MACROS * *---------------------------------------------------------------------------- */ /*---------------------------------------------------------------------------- * TYPEDEFS AND STRUCTURES * *---------------------------------------------------------------------------- */ /*---------------------------------------------------------------------------------------- * E X P O R T E D F U N C T I O N S *---------------------------------------------------------------------------------------- */ /*---------------------------------------------------------------------------- * PROTOTYPES OF LOCAL FUNCTIONS * *---------------------------------------------------------------------------- */ /*---------------------------------------------------------------------------------------- * P U B L I C F U N C T I O N S *---------------------------------------------------------------------------------------- */ /* -----------------------------------------------------------------------------*/ /** * Enable BL-C Cpu Cache Flush On Halt Function * * @param[in] FamilySpecificServices The current Family Specific Services. * @param[in] EntryPoint Timepoint designator. * @param[in] PlatformConfig Contains the runtime modifiable feature input data. * @param[in] StdHeader Config Handle for library, services. */ VOID SetF10BlCacheFlushOnHaltRegister ( IN CPU_CFOH_FAMILY_SERVICES *FamilySpecificServices, IN UINT64 EntryPoint, IN PLATFORM_CONFIGURATION *PlatformConfig, IN AMD_CONFIG_PARAMS *StdHeader ) { UINT32 AndMask; UINT32 OrMask; UINT32 CoreCount; PCI_ADDR PciAddress; CPU_LOGICAL_ID CpuFamilyRevision; if ((EntryPoint & CPU_FEAT_AFTER_POST_MTRR_SYNC) != 0) { GetLogicalIdOfCurrentCore (&CpuFamilyRevision, StdHeader); PciAddress.Address.Function = FUNC_3; PciAddress.Address.Register = CLOCK_POWER_TIMING_CTRL2_REG; if (CpuFamilyRevision.Revision == AMD_F10_BL_C3) { // F3xDC[25:19] = 04h // F3xDC[18:16] = 111b AndMask = 0xFC00FFFF; OrMask = 0x00270000; } else { // F3xDC[25:19] = 28h // F3xDC[18:16] = 111b AndMask = 0xFC00FFFF; OrMask = 0x01470000; //For BL_C2 single Core, F3xDC[18:16] = 0 GetActiveCoresInCurrentSocket (&CoreCount, StdHeader); if (CoreCount == 1) { if (CpuFamilyRevision.Revision == AMD_F10_BL_C2) { OrMask = 0x01400000; } } } // Get the Or Mask value from IDS IDS_OPTION_HOOK (IDS_CACHE_FLUSH_HLT, &OrMask, StdHeader); ModifyCurrentSocketPci (&PciAddress, AndMask, OrMask, StdHeader); // F3xDC } } CONST CPU_CFOH_FAMILY_SERVICES ROMDATA F10BlCacheFlushOnHalt = { 0, SetF10BlCacheFlushOnHaltRegister };
#import <JavaScriptCore/AlwaysInline.h>
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __INCLUDE_LINUX_OOM_H #define __INCLUDE_LINUX_OOM_H #include <linux/sched/signal.h> #include <linux/types.h> #include <linux/nodemask.h> #include <uapi/linux/oom.h> #include <linux/sched/coredump.h> /* MMF_* */ #include <linux/mm.h> /* VM_FAULT* */ struct zonelist; struct notifier_block; struct mem_cgroup; struct task_struct; /* * Details of the page allocation that triggered the oom killer that are used to * determine what should be killed. */ struct oom_control { /* Used to determine cpuset */ struct zonelist *zonelist; /* Used to determine mempolicy */ nodemask_t *nodemask; /* Memory cgroup in which oom is invoked, or NULL for global oom */ struct mem_cgroup *memcg; /* Used to determine cpuset and node locality requirement */ const gfp_t gfp_mask; /* * order == -1 means the oom kill is required by sysrq, otherwise only * for display purposes. */ const int order; /* Used by oom implementation, do not set */ unsigned long totalpages; struct task_struct *chosen; unsigned long chosen_points; }; extern struct mutex oom_lock; static inline void set_current_oom_origin(void) { current->signal->oom_flag_origin = true; } static inline void clear_current_oom_origin(void) { current->signal->oom_flag_origin = false; } static inline bool oom_task_origin(const struct task_struct *p) { return p->signal->oom_flag_origin; } static inline bool tsk_is_oom_victim(struct task_struct * tsk) { return tsk->signal->oom_mm; } /* * Checks whether a page fault on the given mm is still reliable. * This is no longer true if the oom reaper started to reap the * address space which is reflected by MMF_UNSTABLE flag set in * the mm. At that moment any !shared mapping would lose the content * and could cause a memory corruption (zero pages instead of the * original content). * * User should call this before establishing a page table entry for * a !shared mapping and under the proper page table lock. * * Return 0 when the PF is safe VM_FAULT_SIGBUS otherwise. */ static inline int check_stable_address_space(struct mm_struct *mm) { if (unlikely(test_bit(MMF_UNSTABLE, &mm->flags))) return VM_FAULT_SIGBUS; return 0; } extern unsigned long oom_badness(struct task_struct *p, struct mem_cgroup *memcg, const nodemask_t *nodemask, unsigned long totalpages); extern bool out_of_memory(struct oom_control *oc); extern void exit_oom_victim(void); extern int register_oom_notifier(struct notifier_block *nb); extern int unregister_oom_notifier(struct notifier_block *nb); extern bool oom_killer_disable(signed long timeout); extern void oom_killer_enable(void); extern struct task_struct *find_lock_task_mm(struct task_struct *p); /* sysctls */ extern int sysctl_oom_dump_tasks; extern int sysctl_oom_kill_allocating_task; extern int sysctl_panic_on_oom; #endif /* _INCLUDE_LINUX_OOM_H */
// Copyright 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CC_INPUT_INPUT_HANDLER_H_ #define CC_INPUT_INPUT_HANDLER_H_ #include "base/basictypes.h" #include "base/time/time.h" #include "cc/base/cc_export.h" #include "cc/base/swap_promise_monitor.h" #include "cc/input/scrollbar.h" namespace gfx { class Point; class PointF; class Vector2d; class Vector2dF; } namespace ui { struct LatencyInfo; } namespace cc { class LayerScrollOffsetDelegate; class CC_EXPORT InputHandlerClient { public: virtual ~InputHandlerClient() {} virtual void WillShutdown() = 0; virtual void Animate(base::TimeTicks time) = 0; virtual void MainThreadHasStoppedFlinging() = 0; // Called when scroll deltas reaching the root scrolling layer go unused. // The accumulated overscroll is scoped by the most recent call to // InputHandler::ScrollBegin. virtual void DidOverscroll(const gfx::PointF& causal_event_viewport_point, const gfx::Vector2dF& accumulated_overscroll, const gfx::Vector2dF& latest_overscroll_delta) = 0; protected: InputHandlerClient() {} private: DISALLOW_COPY_AND_ASSIGN(InputHandlerClient); }; // The InputHandler is a way for the embedders to interact with the impl thread // side of the compositor implementation. There is one InputHandler per // LayerTreeHost. To use the input handler, implement the InputHanderClient // interface and bind it to the handler on the compositor thread. class CC_EXPORT InputHandler { public: // Note these are used in a histogram. Do not reorder or delete existing // entries. enum ScrollStatus { ScrollOnMainThread = 0, ScrollStarted, ScrollIgnored, ScrollUnknown, // This must be the last entry. ScrollStatusCount }; enum ScrollInputType { Gesture, Wheel, NonBubblingGesture }; // Binds a client to this handler to receive notifications. Only one client // can be bound to an InputHandler. The client must live at least until the // handler calls WillShutdown() on the client. virtual void BindToClient(InputHandlerClient* client) = 0; // Selects a layer to be scrolled at a given point in viewport (logical // pixel) coordinates. Returns ScrollStarted if the layer at the coordinates // can be scrolled, ScrollOnMainThread if the scroll event should instead be // delegated to the main thread, or ScrollIgnored if there is nothing to be // scrolled at the given coordinates. virtual ScrollStatus ScrollBegin(const gfx::Point& viewport_point, ScrollInputType type) = 0; virtual ScrollStatus ScrollAnimated(const gfx::Point& viewport_point, const gfx::Vector2dF& scroll_delta) = 0; // Scroll the selected layer starting at the given position. If the scroll // type given to ScrollBegin was a gesture, then the scroll point and delta // should be in viewport (logical pixel) coordinates. Otherwise they are in // scrolling layer's (logical pixel) space. If there is no room to move the // layer in the requested direction, its first ancestor layer that can be // scrolled will be moved instead. If no layer can be moved in the requested // direction at all, then false is returned. If any layer is moved, then // true is returned. // If the scroll delta hits the root layer, and the layer can no longer move, // the root overscroll accumulated within this ScrollBegin() scope is reported // to the client. // Should only be called if ScrollBegin() returned ScrollStarted. virtual bool ScrollBy(const gfx::Point& viewport_point, const gfx::Vector2dF& scroll_delta) = 0; virtual bool ScrollVerticallyByPage(const gfx::Point& viewport_point, ScrollDirection direction) = 0; // Returns ScrollStarted if a layer was being actively being scrolled, // ScrollIgnored if not. virtual ScrollStatus FlingScrollBegin() = 0; virtual void MouseMoveAt(const gfx::Point& mouse_position) = 0; // Stop scrolling the selected layer. Should only be called if ScrollBegin() // returned ScrollStarted. virtual void ScrollEnd() = 0; virtual void SetRootLayerScrollOffsetDelegate( LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) = 0; // Called when the value returned by // LayerScrollOffsetDelegate.GetTotalScrollOffset has changed for reasons // other than a SetTotalScrollOffset call. // NOTE: This should only called after a valid delegate was set via a call to // SetRootLayerScrollOffsetDelegate. virtual void OnRootLayerDelegatedScrollOffsetChanged() = 0; virtual void PinchGestureBegin() = 0; virtual void PinchGestureUpdate(float magnify_delta, const gfx::Point& anchor) = 0; virtual void PinchGestureEnd() = 0; // Request another callback to InputHandlerClient::Animate(). virtual void SetNeedsAnimate() = 0; // Whether the layer under |viewport_point| is the currently scrolling layer. virtual bool IsCurrentlyScrollingLayerAt(const gfx::Point& viewport_point, ScrollInputType type) = 0; virtual bool HaveTouchEventHandlersAt(const gfx::Point& viewport_point) = 0; // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped // LatencyInfoSwapPromiseMonitor. During the life time of the // LatencyInfoSwapPromiseMonitor, if SetNeedsRedraw() or SetNeedsRedrawRect() // is called on LayerTreeHostImpl, the original latency info will be turned // into a LatencyInfoSwapPromise. virtual scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( ui::LatencyInfo* latency) = 0; protected: InputHandler() {} virtual ~InputHandler() {} private: DISALLOW_COPY_AND_ASSIGN(InputHandler); }; } // namespace cc #endif // CC_INPUT_INPUT_HANDLER_H_
//===- llvm/CodeGen/StableHashing.h - Utilities for stable hashing * C++ *-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file provides types and functions for computing and combining stable // hashes. Stable hashes can be useful for hashing across different modules, // processes, or compiler runs. // //===----------------------------------------------------------------------===// #ifndef LLVM_CODEGEN_STABLEHASHING_H #define LLVM_CODEGEN_STABLEHASHING_H #include "llvm/ADT/StringRef.h" namespace llvm { /// An opaque object representing a stable hash code. It can be serialized, /// deserialized, and is stable across processes and executions. using stable_hash = uint64_t; // Implementation details namespace hashing { namespace detail { // Stable hashes are based on the 64-bit FNV-1 hash: // https://en.wikipedia.org/wiki/Fowler-Noll-Vo_hash_function const uint64_t FNV_PRIME_64 = 1099511628211u; const uint64_t FNV_OFFSET_64 = 14695981039346656037u; inline void stable_hash_append(stable_hash &Hash, const char Value) { Hash = Hash ^ (Value & 0xFF); Hash = Hash * FNV_PRIME_64; } inline void stable_hash_append(stable_hash &Hash, stable_hash Value) { for (unsigned I = 0; I < 8; ++I) { stable_hash_append(Hash, static_cast<char>(Value)); Value >>= 8; } } } // namespace detail } // namespace hashing inline stable_hash stable_hash_combine(stable_hash A, stable_hash B) { stable_hash Hash = hashing::detail::FNV_OFFSET_64; hashing::detail::stable_hash_append(Hash, A); hashing::detail::stable_hash_append(Hash, B); return Hash; } inline stable_hash stable_hash_combine(stable_hash A, stable_hash B, stable_hash C) { stable_hash Hash = hashing::detail::FNV_OFFSET_64; hashing::detail::stable_hash_append(Hash, A); hashing::detail::stable_hash_append(Hash, B); hashing::detail::stable_hash_append(Hash, C); return Hash; } inline stable_hash stable_hash_combine(stable_hash A, stable_hash B, stable_hash C, stable_hash D) { stable_hash Hash = hashing::detail::FNV_OFFSET_64; hashing::detail::stable_hash_append(Hash, A); hashing::detail::stable_hash_append(Hash, B); hashing::detail::stable_hash_append(Hash, C); hashing::detail::stable_hash_append(Hash, D); return Hash; } /// Compute a stable_hash for a sequence of values. /// /// This hashes a sequence of values. It produces the same stable_hash as /// 'stable_hash_combine(a, b, c, ...)', but can run over arbitrary sized /// sequences and is significantly faster given pointers and types which /// can be hashed as a sequence of bytes. template <typename InputIteratorT> stable_hash stable_hash_combine_range(InputIteratorT First, InputIteratorT Last) { stable_hash Hash = hashing::detail::FNV_OFFSET_64; for (auto I = First; I != Last; ++I) hashing::detail::stable_hash_append(Hash, *I); return Hash; } inline stable_hash stable_hash_combine_array(const stable_hash *P, size_t C) { stable_hash Hash = hashing::detail::FNV_OFFSET_64; for (size_t I = 0; I < C; ++I) hashing::detail::stable_hash_append(Hash, P[I]); return Hash; } inline stable_hash stable_hash_combine_string(const StringRef &S) { return stable_hash_combine_range(S.begin(), S.end()); } inline stable_hash stable_hash_combine_string(const char *C) { stable_hash Hash = hashing::detail::FNV_OFFSET_64; while (*C) hashing::detail::stable_hash_append(Hash, *(C++)); return Hash; } } // namespace llvm #endif
/* Copyright (C) 1996, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. 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 <aliases.h> #define LOOKUP_TYPE struct aliasent #define FUNCTION_NAME getaliasbyname #define DATABASE_NAME aliases #define ADD_PARAMS const char *name #define ADD_VARIABLES name #include "../nss/getXXbyYY_r.c"
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2008,2009 IITP RAS * * 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 * * Authors: Kirill Andreev <andreev@iitp.ru> */ #ifndef DOT11S_STACK_INSTALLER_H #define DOT11S_STACK_INSTALLER_H #include "ns3/mesh-stack-installer.h" namespace ns3 { /** * \ingroup dot11s * \brief Helper class to allow easy installation of 802.11s stack. */ class Dot11sStack : public MeshStack { public: /** * \brief Get the type ID. * \return the object TypeId */ static TypeId GetTypeId (); /** * Create a Dot11sStack() installer helper. */ Dot11sStack (); /** * Destroy a Dot11sStack() installer helper. */ ~Dot11sStack (); /** * Break any reference cycles in the installer helper. Required for ns-3 * Object support. */ void DoDispose (); /** * \brief Install an 802.11s stack. * \param mp The Ptr<MeshPointDevice> to use when setting up the PMP. * \return true if successful */ bool InstallStack (Ptr<MeshPointDevice> mp); /** * \brief Iterate through the referenced devices and protocols and print * their statistics * \param mp The Ptr<MeshPointDevice> to use when setting up the PMP. * \param os The output stream */ void Report (const Ptr<MeshPointDevice> mp, std::ostream&); /** * \brief Reset the statistics on the referenced devices and protocols. * \param mp The Ptr<MeshPointDevice> to use when setting up the PMP. */ void ResetStats (const Ptr<MeshPointDevice> mp); private: Mac48Address m_root; ///< root }; } // namespace ns3 #endif
/*****************************************************************************/ /* "NetPIPE" -- Network Protocol Independent Performance Evaluator. */ /* Copyright 1997, 1998 Iowa State University Research Foundation, Inc. */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation. 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. */ /* */ /* * netpipe.h ---- General include file */ /*****************************************************************************/ #include <ctype.h> #include <errno.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> /* malloc(3) */ #include <string.h> #include <sys/types.h> #include <sys/time.h> /* struct timeval */ #ifdef HAVE_GETRUSAGE #include <sys/resource.h> #endif #include <unistd.h> #define DEFPORT 5002 #define TRIALS 7 #define NSAMP 8000 #define PERT 3 #define LATENCYREPS 100 #define LONGTIME 1e99 #define CHARSIZE 8 #define RUNTM 0.25 #define STOPTM 1.0 #define MAXINT 2147483647 #define ABS(x) (((x) < 0)?(-(x)):(x)) #define MIN(x,y) (((x) < (y))?(x):(y)) #define MAX(x,y) (((x) > (y))?(x):(y)) /* Need to include the protocol structure header file. */ /* Change this to reflect the protocol */ #if defined(TCP) #include "TCP.h" #elif defined(MPI) #include "MPI.h" #elif defined(PVM) #include "PVM.h" #else #error "One of TCP, MPI, or PVM must be defined during compilation" #endif typedef struct argstruct ArgStruct; struct argstruct { /* This is the common information that is needed for all tests */ char *host; /* Name of receiving host */ int servicefd, /* File descriptor of the network socket */ commfd; /* Communication file descriptor */ short port; /* Port used for connection */ char *buff; /* Transmitted buffer */ char *buff1; /* Transmitted buffer */ int bufflen, /* Length of transmitted buffer */ tr, /* Transmit flag */ nbuff; /* Number of buffers to transmit */ /* Now we work with a union of information for protocol dependent stuff */ ProtocolStruct prot; /* Structure holding necessary info for TCP */ }; typedef struct data Data; struct data { double t; double bps; double variance; int bits; int repeat; }; double When(); void PrintUsage(void); int Setup(ArgStruct *p); void Sync(ArgStruct *p); void PrepareToReceive(ArgStruct *p); void SendData(ArgStruct *p); void RecvData(ArgStruct *p); void SendTime(ArgStruct *p, double *t); void RecvTime(ArgStruct *p, double *t); void SendRepeat(ArgStruct *p, int rpt); void RecvRepeat(ArgStruct *p, int *rpt); int Establish(ArgStruct *p); int CleanUp(ArgStruct *p);
/* * wrppm.h * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994, Thomas G. Lane. * For conditions of distribution and use, see the accompanying README.ijg * file. */ #ifdef PPM_SUPPORTED /* Private version of data destination object */ typedef struct { struct djpeg_dest_struct pub; /* public fields */ /* Usually these two pointers point to the same place: */ char *iobuffer; /* fwrite's I/O buffer */ JSAMPROW pixrow; /* decompressor output buffer */ size_t buffer_width; /* width of I/O buffer */ JDIMENSION samples_per_row; /* JSAMPLEs per output row */ } ppm_dest_struct; typedef ppm_dest_struct *ppm_dest_ptr; #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_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ #include <string> #include "base/memory/ref_counted.h" #include "chrome/browser/extensions/external_loader.h" #include "extensions/browser/external_provider_interface.h" #include "extensions/common/manifest.h" class Profile; namespace base { class DictionaryValue; class Version; } namespace extensions { // A specialization of the ExternalProvider that uses an instance of // ExternalLoader to provide external extensions. This class can be seen as a // bridge between the extension system and an ExternalLoader. Instances live // their entire life on the UI thread. class ExternalProviderImpl : public ExternalProviderInterface { public: // The constructed provider will provide the extensions loaded from |loader| // to |service|, that will deal with the installation. The location // attributes of the provided extensions are also specified here: // |crx_location|: extensions originating from crx files // |download_location|: extensions originating from update URLs // If either of the origins is not supported by this provider, then it should // be initialized as Manifest::INVALID_LOCATION. ExternalProviderImpl(VisitorInterface* service, const scoped_refptr<ExternalLoader>& loader, Profile* profile, Manifest::Location crx_location, Manifest::Location download_location, int creation_flags); virtual ~ExternalProviderImpl(); // Populates a list with providers for all known sources. static void CreateExternalProviders( VisitorInterface* service, Profile* profile, ProviderCollection* provider_list); // Sets underlying prefs and notifies provider. Only to be called by the // owned ExternalLoader instance. virtual void SetPrefs(base::DictionaryValue* prefs); // ExternalProvider implementation: virtual void ServiceShutdown() OVERRIDE; virtual void VisitRegisteredExtension() OVERRIDE; virtual bool HasExtension(const std::string& id) const OVERRIDE; virtual bool GetExtensionDetails( const std::string& id, Manifest::Location* location, scoped_ptr<base::Version>* version) const OVERRIDE; virtual bool IsReady() const OVERRIDE; static const char kExternalCrx[]; static const char kExternalVersion[]; static const char kExternalUpdateUrl[]; static const char kSupportedLocales[]; static const char kIsBookmarkApp[]; static const char kIsFromWebstore[]; static const char kKeepIfPresent[]; void set_auto_acknowledge(bool auto_acknowledge) { auto_acknowledge_ = auto_acknowledge; } private: // Location for external extensions that are provided by this provider from // local crx files. const Manifest::Location crx_location_; // Location for external extensions that are provided by this provider from // update URLs. const Manifest::Location download_location_; // Weak pointer to the object that consumes the external extensions. // This is zeroed out by: ServiceShutdown() VisitorInterface* service_; // weak // Dictionary of the external extensions that are provided by this provider. scoped_ptr<base::DictionaryValue> prefs_; // Indicates that the extensions provided by this provider are loaded // entirely. bool ready_; // The loader that loads the list of external extensions and reports them // via |SetPrefs|. scoped_refptr<ExternalLoader> loader_; // The profile that will be used to install external extensions. Profile* profile_; // Creation flags to use for the extension. These flags will be used // when calling Extension::Create() by the crx installer. int creation_flags_; // Whether loaded extensions should be automatically acknowledged, so that // the user doesn't see an alert about them. bool auto_acknowledge_; DISALLOW_COPY_AND_ASSIGN(ExternalProviderImpl); }; } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_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 MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ #include <jni.h> #include <string> #include "base/callback.h" #include "base/time/time.h" #include "media/base/media_export.h" #include "ui/gl/android/scoped_java_surface.h" #include "url/gurl.h" namespace media { class MediaDrmBridge; class MediaPlayerManager; // This class serves as the base class for different media player // implementations on Android. Subclasses need to provide their own // MediaPlayerAndroid::Create() implementation. class MEDIA_EXPORT MediaPlayerAndroid { public: virtual ~MediaPlayerAndroid(); // Error types for MediaErrorCB. enum MediaErrorType { MEDIA_ERROR_FORMAT, MEDIA_ERROR_DECODE, MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK, MEDIA_ERROR_INVALID_CODE, }; // Passing an external java surface object to the player. virtual void SetVideoSurface(gfx::ScopedJavaSurface surface) = 0; // Start playing the media. virtual void Start() = 0; // Pause the media. virtual void Pause(bool is_media_related_action) = 0; // Seek to a particular position, based on renderer signaling actual seek // with MediaPlayerHostMsg_Seek. If eventual success, OnSeekComplete() will be // called. virtual void SeekTo(const base::TimeDelta& timestamp) = 0; // Release the player resources. virtual void Release() = 0; // Set the player volume. virtual void SetVolume(double volume) = 0; // Get the media information from the player. virtual bool IsRemote() const; virtual int GetVideoWidth() = 0; virtual int GetVideoHeight() = 0; virtual base::TimeDelta GetDuration() = 0; virtual base::TimeDelta GetCurrentTime() = 0; virtual bool IsPlaying() = 0; virtual bool IsPlayerReady() = 0; virtual bool CanPause() = 0; virtual bool CanSeekForward() = 0; virtual bool CanSeekBackward() = 0; virtual GURL GetUrl(); virtual GURL GetFirstPartyForCookies(); // Pass a drm bridge to a player. virtual void SetDrmBridge(MediaDrmBridge* drm_bridge); // Notifies the player that a decryption key has been added. The player // may want to start/resume playback if it is waiting for a key. virtual void OnKeyAdded(); int player_id() { return player_id_; } protected: MediaPlayerAndroid(int player_id, MediaPlayerManager* manager); MediaPlayerManager* manager() { return manager_; } private: // Player ID assigned to this player. int player_id_; // Resource manager for all the media players. MediaPlayerManager* manager_; DISALLOW_COPY_AND_ASSIGN(MediaPlayerAndroid); }; } // namespace media #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_
/* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * Pseudo-driver for the loopback interface. * * Version: @(#)loopback.c 1.0.4b 08/16/93 * * Authors: Ross Biro * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> * Donald Becker, <becker@scyld.com> * * Alan Cox : Fixed oddments for NET3.014 * Alan Cox : Rejig for NET3.029 snap #3 * Alan Cox : Fixed NET3.029 bugs and sped up * Larry McVoy : Tiny tweak to double performance * Alan Cox : Backed out LMV's tweak - the linux mm * can't take it... * Michael Griffith: Don't bother computing the checksums * on packets received on the loopback * interface. * Alexey Kuznetsov: Potential hang under some extreme * cases removed. * * 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/kernel.h> #include <linux/jiffies.h> #include <linux/module.h> #include <linux/interrupt.h> #include <linux/fs.h> #include <linux/types.h> #include <linux/string.h> #include <linux/socket.h> #include <linux/errno.h> #include <linux/fcntl.h> #include <linux/in.h> #include <linux/uaccess.h> #include <asm/io.h> #include <linux/inet.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/skbuff.h> #include <linux/ethtool.h> #include <net/sock.h> #include <net/checksum.h> #include <linux/if_ether.h> /* For the statistics structure. */ #include <linux/if_arp.h> /* For ARPHRD_ETHER */ #include <linux/ip.h> #include <linux/tcp.h> #include <linux/percpu.h> #include <net/net_namespace.h> #include <linux/u64_stats_sync.h> struct pcpu_lstats { u64 packets; u64 bytes; struct u64_stats_sync syncp; }; /* * The higher levels take care of making this non-reentrant (it's * called with bh's disabled). */ static netdev_tx_t loopback_xmit(struct sk_buff *skb, struct net_device *dev) { struct pcpu_lstats *lb_stats; int len; skb_orphan(skb); /* Before queueing this packet to netif_rx(), * make sure dst is refcounted. */ skb_dst_force(skb); skb->protocol = eth_type_trans(skb, dev); /* it's OK to use per_cpu_ptr() because BHs are off */ lb_stats = this_cpu_ptr(dev->lstats); len = skb->len; if (likely(netif_rx(skb) == NET_RX_SUCCESS)) { u64_stats_update_begin(&lb_stats->syncp); lb_stats->bytes += len; lb_stats->packets++; u64_stats_update_end(&lb_stats->syncp); } return NETDEV_TX_OK; } static void loopback_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) { u64 bytes = 0; u64 packets = 0; int i; for_each_possible_cpu(i) { const struct pcpu_lstats *lb_stats; u64 tbytes, tpackets; unsigned int start; lb_stats = per_cpu_ptr(dev->lstats, i); do { start = u64_stats_fetch_begin_irq(&lb_stats->syncp); tbytes = lb_stats->bytes; tpackets = lb_stats->packets; } while (u64_stats_fetch_retry_irq(&lb_stats->syncp, start)); bytes += tbytes; packets += tpackets; } stats->rx_packets = packets; stats->tx_packets = packets; stats->rx_bytes = bytes; stats->tx_bytes = bytes; } static u32 always_on(struct net_device *dev) { return 1; } static const struct ethtool_ops loopback_ethtool_ops = { .get_link = always_on, }; static int loopback_dev_init(struct net_device *dev) { dev->lstats = netdev_alloc_pcpu_stats(struct pcpu_lstats); if (!dev->lstats) return -ENOMEM; return 0; } static void loopback_dev_free(struct net_device *dev) { dev_net(dev)->loopback_dev = NULL; free_percpu(dev->lstats); free_netdev(dev); } static const struct net_device_ops loopback_ops = { .ndo_init = loopback_dev_init, .ndo_start_xmit= loopback_xmit, .ndo_get_stats64 = loopback_get_stats64, .ndo_set_mac_address = eth_mac_addr, }; /* * The loopback device is special. There is only one instance * per network namespace. */ static void loopback_setup(struct net_device *dev) { dev->mtu = 64 * 1024; dev->hard_header_len = ETH_HLEN; /* 14 */ dev->min_header_len = ETH_HLEN; /* 14 */ dev->addr_len = ETH_ALEN; /* 6 */ dev->type = ARPHRD_LOOPBACK; /* 0x0001*/ dev->flags = IFF_LOOPBACK; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE; netif_keep_dst(dev); dev->hw_features = NETIF_F_GSO_SOFTWARE; dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | NETIF_F_HW_CSUM | NETIF_F_RXCSUM | NETIF_F_SCTP_CRC | NETIF_F_HIGHDMA | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL | NETIF_F_VLAN_CHALLENGED | NETIF_F_LOOPBACK; dev->ethtool_ops = &loopback_ethtool_ops; dev->header_ops = &eth_header_ops; dev->netdev_ops = &loopback_ops; dev->destructor = loopback_dev_free; } /* Setup and register the loopback device. */ static __net_init int loopback_net_init(struct net *net) { struct net_device *dev; int err; err = -ENOMEM; dev = alloc_netdev(0, "lo", NET_NAME_UNKNOWN, loopback_setup); if (!dev) goto out; dev_net_set(dev, net); err = register_netdev(dev); if (err) goto out_free_netdev; BUG_ON(dev->ifindex != LOOPBACK_IFINDEX); net->loopback_dev = dev; return 0; out_free_netdev: free_netdev(dev); out: if (net_eq(net, &init_net)) panic("loopback: Failed to register netdevice: %d\n", err); return err; } /* Registered in net/core/dev.c */ struct pernet_operations __net_initdata loopback_net_ops = { .init = loopback_net_init, };
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2003, 07 Ralf Baechle */ #ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H #define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H /* * IP27 only comes with R10000 family processors all using the same config */ #define cpu_has_watch 1 #define cpu_has_mips16 0 #define cpu_has_divec 0 #define cpu_has_vce 0 #define cpu_has_cache_cdex_p 0 #define cpu_has_cache_cdex_s 0 #define cpu_has_prefetch 1 #define cpu_has_mcheck 0 #define cpu_has_ejtag 0 #define cpu_has_llsc 1 #define cpu_has_vtag_icache 0 #define cpu_has_dc_aliases 0 #define cpu_has_ic_fills_f_dc 0 #define cpu_has_dsp 0 #define cpu_icache_snoops_remote_store 1 #define cpu_has_mipsmt 0 #define cpu_has_userlocal 0 #define cpu_has_nofpuex 0 #define cpu_has_64bits 1 #define cpu_has_4kex 1 #define cpu_has_4k_cache 1 #define cpu_has_inclusive_pcaches 1 #define cpu_dcache_line_size() 32 #define cpu_icache_line_size() 64 #define cpu_scache_line_size() 128 #define cpu_has_mips32r1 0 #define cpu_has_mips32r2 0 #define cpu_has_mips64r1 0 #define cpu_has_mips64r2 0 #endif /* __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H */
/* * motion_comp.c * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org> * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca> * * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. * See http://libmpeg2.sourceforge.net/ for updates. * * mpeg2dec 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. * * mpeg2dec 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 * * Modified for use with MPlayer, see libmpeg2_changes.diff for the exact changes. * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ * $Id: motion_comp.c 28370 2009-01-26 09:29:53Z diego $ */ #include "config.h" #include <inttypes.h> #include "mpeg2.h" #include "attributes.h" #include "mpeg2_internal.h" mpeg2_mc_t mpeg2_mc; void mpeg2_mc_init (uint32_t accel) { #if HAVE_MMX2 if (accel & MPEG2_ACCEL_X86_MMXEXT) mpeg2_mc = mpeg2_mc_mmxext; else #endif #if HAVE_AMD3DNOW if (accel & MPEG2_ACCEL_X86_3DNOW) mpeg2_mc = mpeg2_mc_3dnow; else #endif #if HAVE_MMX if (accel & MPEG2_ACCEL_X86_MMX) mpeg2_mc = mpeg2_mc_mmx; else #endif #if HAVE_ALTIVEC if (accel & MPEG2_ACCEL_PPC_ALTIVEC) mpeg2_mc = mpeg2_mc_altivec; else #endif #if ARCH_ALPHA if (accel & MPEG2_ACCEL_ALPHA) mpeg2_mc = mpeg2_mc_alpha; else #endif #if HAVE_VIS if (accel & MPEG2_ACCEL_SPARC_VIS) mpeg2_mc = mpeg2_mc_vis; else #endif #if ARCH_ARM if (accel & MPEG2_ACCEL_ARM) mpeg2_mc = mpeg2_mc_arm; else #endif mpeg2_mc = mpeg2_mc_c; } #define avg2(a,b) ((a+b+1)>>1) #define avg4(a,b,c,d) ((a+b+c+d+2)>>2) #define predict_o(i) (ref[i]) #define predict_x(i) (avg2 (ref[i], ref[i+1])) #define predict_y(i) (avg2 (ref[i], (ref+stride)[i])) #define predict_xy(i) (avg4 (ref[i], ref[i+1], \ (ref+stride)[i], (ref+stride)[i+1])) #define put(predictor,i) dest[i] = predictor (i) #define avg(predictor,i) dest[i] = avg2 (predictor (i), dest[i]) /* mc function template */ #define MC_FUNC(op,xy) \ static void MC_##op##_##xy##_16_c (uint8_t * dest, const uint8_t * ref, \ const int stride, int height) \ { \ do { \ op (predict_##xy, 0); \ op (predict_##xy, 1); \ op (predict_##xy, 2); \ op (predict_##xy, 3); \ op (predict_##xy, 4); \ op (predict_##xy, 5); \ op (predict_##xy, 6); \ op (predict_##xy, 7); \ op (predict_##xy, 8); \ op (predict_##xy, 9); \ op (predict_##xy, 10); \ op (predict_##xy, 11); \ op (predict_##xy, 12); \ op (predict_##xy, 13); \ op (predict_##xy, 14); \ op (predict_##xy, 15); \ ref += stride; \ dest += stride; \ } while (--height); \ } \ static void MC_##op##_##xy##_8_c (uint8_t * dest, const uint8_t * ref, \ const int stride, int height) \ { \ do { \ op (predict_##xy, 0); \ op (predict_##xy, 1); \ op (predict_##xy, 2); \ op (predict_##xy, 3); \ op (predict_##xy, 4); \ op (predict_##xy, 5); \ op (predict_##xy, 6); \ op (predict_##xy, 7); \ ref += stride; \ dest += stride; \ } while (--height); \ } /* definitions of the actual mc functions */ MC_FUNC (put,o) MC_FUNC (avg,o) MC_FUNC (put,x) MC_FUNC (avg,x) MC_FUNC (put,y) MC_FUNC (avg,y) MC_FUNC (put,xy) MC_FUNC (avg,xy) MPEG2_MC_EXTERN (c)
// 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 REMOTING_HOST_BRANDING_H_ #define REMOTING_HOST_BRANDING_H_ #include "base/files/file_path.h" #include "build/build_config.h" namespace remoting { #if defined(OS_WIN) // Windows chromoting service name. extern const wchar_t kWindowsServiceName[]; #endif // Returns the location of the host configuration directory. base::FilePath GetConfigDir(); } // namespace remoting #endif // REMOTING_HOST_BRANDING_H_
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H #define BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H #include "btConvexPenetrationDepthSolver.h" ///MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation. ///Implementation is based on sampling the depth using support mapping, and using GJK step to get the witness points. class btMinkowskiPenetrationDepthSolver : public btConvexPenetrationDepthSolver { protected: static btVector3* getPenetrationDirections(); public: virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver, const btConvexShape* convexA,const btConvexShape* convexB, const btTransform& transA,const btTransform& transB, btVector3& v, btVector3& pa, btVector3& pb, class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc ); }; #endif //BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_SCOPED_TARGET_ROOT_WINDOW_H_ #define ASH_SCOPED_TARGET_ROOT_WINDOW_H_ #include "ash/ash_export.h" #include "base/basictypes.h" namespace aura { class Window; } namespace ash { namespace internal { // Constructing a ScopedTargetRootWindow allows temporarily // switching a target root window so that a new window gets created // in the same window where a user interaction happened. // An example usage is to specify the target root window when creating // a new window using launcher's icon. class ASH_EXPORT ScopedTargetRootWindow { public: explicit ScopedTargetRootWindow(aura::Window* root_window); ~ScopedTargetRootWindow(); private: DISALLOW_COPY_AND_ASSIGN(ScopedTargetRootWindow); }; } // namespace internal } // namespace ash #endif // ASH_SCOPED_TARGET_ROOT_WINDOW_H_
/* * Copyright (c) 2010, * Gavriloaie Eugen-Andrei (shiretu@gmail.com) * * This file is part of crtmpserver. * crtmpserver 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. * * crtmpserver 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 crtmpserver. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _CLIENTCONTEXT_H #define _CLIENTCONTEXT_H #include "protocols/m3u8/basem3u8protocol.h" #include "playlist.h" class BaseProtocol; class BaseStream; class StreamsManager; namespace app_applestreamingclient { class BaseEventSink; class Playlist; class SpeedComputer; class AppleStreamingClientApplication; typedef struct _ConnectingString { string masterM3U8Url; string keyPassword; string sessionId; operator string() { return format("masterM3U8Url: %s\nkeyPassword: %s\nsessionId: %s", STR(masterM3U8Url), STR(keyPassword), STR(sessionId)); } } ConnectingString; class ClientContext { private: static uint32_t _idGenerator; static map<uint32_t, ClientContext *> _contexts; uint32_t _id; BaseEventSink *_pEventSink; string _rawConnectingString; ConnectingString _connectingString; uint32_t _applicationId; Playlist *_pMasterPlaylist; map<uint32_t, Playlist *> _childPlaylists; uint32_t _tsId; uint32_t _parsedChildPlaylistsCount; uint32_t _currentSequence; uint32_t _optimalBw; uint32_t _lastUsedBw; SpeedComputer *_pSpeedComputer; uint32_t _scheduleTimerId; IOBuffer _avData; uint32_t _maxAVBufferSize; string _streamName; uint32_t _streamId; StreamsManager *_pStreamsManager; double _lastWallClock; double _firstFeedTime; map<uint32_t, uint32_t> _allowedBitrates; private: ClientContext(); public: virtual ~ClientContext(); //Context spawn/tear down static vector<uint32_t> GetContextIds(); static ClientContext *GetContext(uint32_t &contextId, uint32_t applicationId, uint64_t masterProtocolType); static void ReleaseContext(uint32_t contextId); //getters/setters uint32_t Id(); BaseEventSink * EventSink(); string RawConnectingString(); void RawConnectingString(string connectingString); ConnectingString &GetConnectingString(); Playlist *MasterPlaylist(); Playlist *ChildPlaylist(uint32_t bw); vector<double> GetAvailableBandwidths(); double GetDetectedBandwidth(); double GetSelectedBandwidth(); uint32_t GetBufferLevel(); uint32_t GetMaxBufferLevel(); double GetBufferLevelPercent(); double GetMinTimestamp(); double GetMaxTimestamp(); uint32_t GetChunksCount(); double GetCurrentTimestamp(); uint32_t GetCurrentChunkIndex(); AppleStreamingClientApplication *GetApplication(); void SetAllowedBitrates(map<uint32_t, uint32_t> allowedBitrates); //processing bool StartProcessing(); //signaling static bool SignalProtocolCreated(BaseProtocol *pProtocol, Variant &parameters); bool SignalMasterPlaylistAvailable(); bool SignalChildPlaylistAvailable(uint32_t bw); bool SignalChildPlaylistNotAvailable(uint32_t bw); bool SignalAESKeyAvailable(Variant &parameters); bool SignalTSProtocolAvailable(uint32_t protocolId, uint32_t bw); bool SignalTSChunkComplete(uint32_t bw); bool SignalSpeedDetected(double instantAmount, double instantTime); bool SignalAVDataAvailable(IOBuffer &buffer); bool SignalStreamRegistered(BaseStream *pStream); bool SignalStreamUnRegistered(BaseStream *pStream); bool StartFeeding(); bool FetchChildPlaylist(string uri, uint32_t bw); bool ConsumeAVBuffer(); private: uint32_t GetOptimalBw(); bool ParseConnectingString(); bool FetchMasterPlaylist(); bool FetchKey(string keyUri, string itemUri, uint32_t bw); bool FetchTS(string uri, uint32_t bw, string key, uint64_t iv); bool FetchURI(string uriString, string requestType, Variant &customParameters); bool EnqueueStartFeeding(); bool EnqueueFetchChildPlaylist(string uri, uint32_t bw); }; }; #endif /* _CLIENTCONTEXT_H */
/* =========================================================================== Doom 3 BFG Edition GPL Source Code Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ #ifndef __PHYSICS_STATICMULTI_H__ #define __PHYSICS_STATICMULTI_H__ /* =============================================================================== Physics for a non moving object using no or multiple collision models. =============================================================================== */ class idPhysics_StaticMulti : public idPhysics { public: CLASS_PROTOTYPE( idPhysics_StaticMulti ); idPhysics_StaticMulti(); ~idPhysics_StaticMulti(); void Save( idSaveGame *savefile ) const; void Restore( idRestoreGame *savefile ); void RemoveIndex( int id = 0, bool freeClipModel = true ); public: // common physics interface void SetSelf( idEntity *e ); void SetClipModel( idClipModel *model, float density, int id = 0, bool freeOld = true ); idClipModel * GetClipModel( int id = 0 ) const; int GetNumClipModels() const; void SetMass( float mass, int id = -1 ); float GetMass( int id = -1 ) const; void SetContents( int contents, int id = -1 ); int GetContents( int id = -1 ) const; void SetClipMask( int mask, int id = -1 ); int GetClipMask( int id = -1 ) const; const idBounds & GetBounds( int id = -1 ) const; const idBounds & GetAbsBounds( int id = -1 ) const; bool Evaluate( int timeStepMSec, int endTimeMSec ); bool Interpolate( const float fraction ); void ResetInterpolationState( const idVec3 & origin, const idMat3 & axis ) {} void UpdateTime( int endTimeMSec ); int GetTime() const; void GetImpactInfo( const int id, const idVec3 &point, impactInfo_t *info ) const; void ApplyImpulse( const int id, const idVec3 &point, const idVec3 &impulse ); void AddForce( const int id, const idVec3 &point, const idVec3 &force ); void Activate(); void PutToRest(); bool IsAtRest() const; int GetRestStartTime() const; bool IsPushable() const; void SaveState(); void RestoreState(); void SetOrigin( const idVec3 &newOrigin, int id = -1 ); void SetAxis( const idMat3 &newAxis, int id = -1 ); void Translate( const idVec3 &translation, int id = -1 ); void Rotate( const idRotation &rotation, int id = -1 ); const idVec3 & GetOrigin( int id = 0 ) const; const idMat3 & GetAxis( int id = 0 ) const; void SetLinearVelocity( const idVec3 &newLinearVelocity, int id = 0 ); void SetAngularVelocity( const idVec3 &newAngularVelocity, int id = 0 ); const idVec3 & GetLinearVelocity( int id = 0 ) const; const idVec3 & GetAngularVelocity( int id = 0 ) const; void SetGravity( const idVec3 &newGravity ); const idVec3 & GetGravity() const; const idVec3 & GetGravityNormal() const; void ClipTranslation( trace_t &results, const idVec3 &translation, const idClipModel *model ) const; void ClipRotation( trace_t &results, const idRotation &rotation, const idClipModel *model ) const; int ClipContents( const idClipModel *model ) const; void DisableClip(); void EnableClip(); void UnlinkClip(); void LinkClip(); bool EvaluateContacts(); int GetNumContacts() const; const contactInfo_t & GetContact( int num ) const; void ClearContacts(); void AddContactEntity( idEntity *e ); void RemoveContactEntity( idEntity *e ); bool HasGroundContacts() const; bool IsGroundEntity( int entityNum ) const; bool IsGroundClipModel( int entityNum, int id ) const; void SetPushed( int deltaTime ); const idVec3 & GetPushedLinearVelocity( const int id = 0 ) const; const idVec3 & GetPushedAngularVelocity( const int id = 0 ) const; void SetMaster( idEntity *master, const bool orientated = true ); const trace_t * GetBlockingInfo() const; idEntity * GetBlockingEntity() const; int GetLinearEndTime() const; int GetAngularEndTime() const; void WriteToSnapshot( idBitMsg &msg ) const; void ReadFromSnapshot( const idBitMsg &msg ); protected: idEntity * self; // entity using this physics object idList<staticPState_t, TAG_IDLIB_LIST_PHYSICS> current; // physics state idList<idClipModel *, TAG_IDLIB_LIST_PHYSICS> clipModels; // collision model // States used in client-side interpolation idList<staticInterpolatePState_t, TAG_IDLIB_LIST_PHYSICS> previous; idList<staticInterpolatePState_t, TAG_IDLIB_LIST_PHYSICS> next; // master bool hasMaster; bool isOrientated; }; #endif /* !__PHYSICS_STATICMULTI_H__ */
/* * wpa_gui - EventHistory class * Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi> * * This software may be distributed under the terms of the BSD license. * See README for more details. */ #ifndef EVENTHISTORY_H #define EVENTHISTORY_H #include <QObject> #include "ui_eventhistory.h" class EventListModel : public QAbstractTableModel { Q_OBJECT public: EventListModel(QObject *parent = 0) : QAbstractTableModel(parent) {} int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; void addEvent(QString time, QString msg); private: QStringList timeList; QStringList msgList; }; class EventHistory : public QDialog, public Ui::EventHistory { Q_OBJECT public: EventHistory(QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); ~EventHistory(); public slots: virtual void addEvents(WpaMsgList msgs); virtual void addEvent(WpaMsg msg); protected slots: virtual void languageChange(); private: EventListModel *elm; }; #endif /* EVENTHISTORY_H */
/* Verify: * -fomit-frame-pointer. * without outgoing. * total frame size > 512. * number of callee-saved reg == 1. * use a single stack adjustment, no writeback. */ /* { dg-do run } */ /* { dg-options "-O2 -fomit-frame-pointer --save-temps" } */ #include "test_frame_common.h" t_frame_pattern (test6, 700, ) t_frame_run (test6) /* { dg-final { scan-assembler-times "str\tx30, \\\[sp\\\]" 1 } } */ /* { dg-final { scan-assembler "ldr\tx30, \\\[sp\\\]" } } */ /* { dg-final { scan-assembler "ldr\tx30, \\\[sp\\\]," } } */
#pragma once /* * Copyright (C) 2015 Team XBMC * http://xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "platform/android/jni/Activity.h" #include "platform/android/jni/InputManager.h" #include "platform/android/jni/Surface.h" #include "platform/android/jni/Rect.h" class CJNIMainActivity : public CJNIActivity, public CJNIInputManagerInputDeviceListener { public: CJNIMainActivity(const ANativeActivity *nativeActivity); ~CJNIMainActivity(); static CJNIMainActivity* GetAppInstance() { return m_appInstance; } static void _onNewIntent(JNIEnv *env, jobject context, jobject intent); static void _onVolumeChanged(JNIEnv *env, jobject context, jint volume); static void _onAudioFocusChange(JNIEnv *env, jobject context, jint focusChange); 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 _callNative(JNIEnv *env, jobject context, jlong funcAddr, jlong variantAddr); static void runNativeOnUiThread(void (*callback)(CVariant *), CVariant *variant); static void registerMediaButtonEventReceiver(); static void unregisterMediaButtonEventReceiver(); CJNISurface getVideoViewSurface(); void clearVideoView(); CJNIRect getVideoViewSurfaceRect(); void setVideoViewSurfaceRect(int l, int t, int r, int b); private: static CJNIMainActivity *m_appInstance; protected: virtual void onNewIntent(CJNIIntent intent)=0; virtual void onVolumeChanged(int volume)=0; virtual void onAudioFocusChange(int focusChange)=0; virtual void doFrame(int64_t frameTimeNanos)=0; };
/* PR c/80097 */ /* { dg-do compile } */ /* { dg-options "-std=c89 -fsanitize=float-divide-by-zero" } */ int foo (double a) { int b = (1 / a >= 1); return b; }
// Copyright 2015 The Crashpad 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 CRASHPAD_MINIDUMP_MINIDUMP_HANDLE_WRITER_H_ #define CRASHPAD_MINIDUMP_MINIDUMP_HANDLE_WRITER_H_ #include <windows.h> #include <dbghelp.h> #include <sys/types.h> #include <map> #include <string> #include <vector> #include "minidump/minidump_stream_writer.h" #include "minidump/minidump_string_writer.h" #include "minidump/minidump_writable.h" #include "snapshot/handle_snapshot.h" namespace crashpad { //! \brief The writer for a MINIDUMP_HANDLE_DATA_STREAM stream in a minidump //! and its contained MINIDUMP_HANDLE_DESCRIPTOR s. //! //! As we currently do not track any data beyond what MINIDUMP_HANDLE_DESCRIPTOR //! supports, we only write that type of record rather than the newer //! MINIDUMP_HANDLE_DESCRIPTOR_2. //! //! Note that this writer writes both the header (MINIDUMP_HANDLE_DATA_STREAM) //! and the list of objects (MINIDUMP_HANDLE_DESCRIPTOR), which is different //! from some of the other list writers. class MinidumpHandleDataWriter final : public internal::MinidumpStreamWriter { public: MinidumpHandleDataWriter(); ~MinidumpHandleDataWriter() override; //! \brief Adds a MINIDUMP_HANDLE_DESCRIPTOR for each handle in \a //! handle_snapshot to the MINIDUMP_HANDLE_DATA_STREAM. //! //! \param[in] handle_snapshots The handle snapshots to use as source data. //! //! \note Valid in #kStateMutable. void InitializeFromSnapshot( const std::vector<HandleSnapshot>& handle_snapshots); protected: // MinidumpWritable: bool Freeze() override; size_t SizeOfObject() override; std::vector<MinidumpWritable*> Children() override; bool WriteObject(FileWriterInterface* file_writer) override; // MinidumpStreamWriter: MinidumpStreamType StreamType() const override; private: MINIDUMP_HANDLE_DATA_STREAM handle_data_stream_base_; std::vector<MINIDUMP_HANDLE_DESCRIPTOR> handle_descriptors_; std::map<std::string, internal::MinidumpUTF16StringWriter*> strings_; DISALLOW_COPY_AND_ASSIGN(MinidumpHandleDataWriter); }; } // namespace crashpad #endif // CRASHPAD_MINIDUMP_MINIDUMP_HANDLE_WRITER_H_
/* -*- linux-c -*- * include/asm-blackfin/ipipe.h * * Copyright (C) 2002-2007 Philippe Gerum. * * 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, Inc., 675 Mass Ave, Cambridge MA 02139, * USA; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __ASM_BLACKFIN_IPIPE_H #define __ASM_BLACKFIN_IPIPE_H #ifdef CONFIG_IPIPE #include <linux/cpumask.h> #include <linux/list.h> #include <linux/threads.h> #include <linux/irq.h> #include <linux/ipipe_percpu.h> #include <asm/ptrace.h> #include <asm/irq.h> #include <asm/bitops.h> #include <asm/atomic.h> #include <asm/traps.h> #include <asm/bitsperlong.h> #define IPIPE_ARCH_STRING "1.16-01" #define IPIPE_MAJOR_NUMBER 1 #define IPIPE_MINOR_NUMBER 16 #define IPIPE_PATCH_NUMBER 1 #ifdef CONFIG_SMP #error "I-pipe/blackfin: SMP not implemented" #else /* !CONFIG_SMP */ #define ipipe_processor_id() 0 #endif /* CONFIG_SMP */ #define prepare_arch_switch(next) \ do { \ ipipe_schedule_notify(current, next); \ hard_local_irq_disable(); \ } while (0) #define task_hijacked(p) \ ({ \ int __x__ = __ipipe_root_domain_p; \ if (__x__) \ hard_local_irq_enable(); \ !__x__; \ }) struct ipipe_domain; struct ipipe_sysinfo { int sys_nr_cpus; /* Number of CPUs on board */ int sys_hrtimer_irq; /* hrtimer device IRQ */ u64 sys_hrtimer_freq; /* hrtimer device frequency */ u64 sys_hrclock_freq; /* hrclock device frequency */ u64 sys_cpu_freq; /* CPU frequency (Hz) */ }; #define ipipe_read_tsc(t) \ ({ \ unsigned long __cy2; \ __asm__ __volatile__ ("1: %0 = CYCLES2\n" \ "%1 = CYCLES\n" \ "%2 = CYCLES2\n" \ "CC = %2 == %0\n" \ "if ! CC jump 1b\n" \ : "=d,a" (((unsigned long *)&t)[1]), \ "=d,a" (((unsigned long *)&t)[0]), \ "=d,a" (__cy2) \ : /*no input*/ : "CC"); \ t; \ }) #define ipipe_cpu_freq() __ipipe_core_clock #define ipipe_tsc2ns(_t) (((unsigned long)(_t)) * __ipipe_freq_scale) #define ipipe_tsc2us(_t) (ipipe_tsc2ns(_t) / 1000 + 1) /* Private interface -- Internal use only */ #define __ipipe_check_platform() do { } while (0) #define __ipipe_init_platform() do { } while (0) extern atomic_t __ipipe_irq_lvdepth[IVG15 + 1]; extern unsigned long __ipipe_irq_lvmask; extern struct ipipe_domain ipipe_root; /* enable/disable_irqdesc _must_ be used in pairs. */ void __ipipe_enable_irqdesc(struct ipipe_domain *ipd, unsigned irq); void __ipipe_disable_irqdesc(struct ipipe_domain *ipd, unsigned irq); #define __ipipe_enable_irq(irq) \ do { \ struct irq_desc *desc = irq_to_desc(irq); \ struct irq_chip *chip = get_irq_desc_chip(desc); \ chip->irq_unmask(&desc->irq_data); \ } while (0) #define __ipipe_disable_irq(irq) \ do { \ struct irq_desc *desc = irq_to_desc(irq); \ struct irq_chip *chip = get_irq_desc_chip(desc); \ chip->irq_mask(&desc->irq_data); \ } while (0) static inline int __ipipe_check_tickdev(const char *devname) { return 1; } void __ipipe_enable_pipeline(void); #define __ipipe_hook_critical_ipi(ipd) do { } while (0) void ___ipipe_sync_pipeline(void); void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs); int __ipipe_get_irq_priority(unsigned int irq); void __ipipe_serial_debug(const char *fmt, ...); asmlinkage void __ipipe_call_irqtail(unsigned long addr); DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs); extern unsigned long __ipipe_core_clock; extern unsigned long __ipipe_freq_scale; extern unsigned long __ipipe_irq_tail_hook; static inline unsigned long __ipipe_ffnz(unsigned long ul) { return ffs(ul) - 1; } #define __ipipe_do_root_xirq(ipd, irq) \ ((ipd)->irqs[irq].handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs))) #define __ipipe_run_irqtail(irq) /* Must be a macro */ \ do { \ unsigned long __pending; \ CSYNC(); \ __pending = bfin_read_IPEND(); \ if (__pending & 0x8000) { \ __pending &= ~0x8010; \ if (__pending && (__pending & (__pending - 1)) == 0) \ __ipipe_call_irqtail(__ipipe_irq_tail_hook); \ } \ } while (0) #define __ipipe_syscall_watched_p(p, sc) \ (ipipe_notifier_enabled_p(p) || (unsigned long)sc >= NR_syscalls) #ifdef CONFIG_BF561 #define bfin_write_TIMER_DISABLE(val) bfin_write_TMRS8_DISABLE(val) #define bfin_write_TIMER_ENABLE(val) bfin_write_TMRS8_ENABLE(val) #define bfin_write_TIMER_STATUS(val) bfin_write_TMRS8_STATUS(val) #define bfin_read_TIMER_STATUS() bfin_read_TMRS8_STATUS() #elif defined(CONFIG_BF54x) #define bfin_write_TIMER_DISABLE(val) bfin_write_TIMER_DISABLE0(val) #define bfin_write_TIMER_ENABLE(val) bfin_write_TIMER_ENABLE0(val) #define bfin_write_TIMER_STATUS(val) bfin_write_TIMER_STATUS0(val) #define bfin_read_TIMER_STATUS(val) bfin_read_TIMER_STATUS0(val) #endif #define __ipipe_root_tick_p(regs) ((regs->ipend & 0x10) != 0) #else /* !CONFIG_IPIPE */ #define task_hijacked(p) 0 #define ipipe_trap_notify(t, r) 0 #define __ipipe_root_tick_p(regs) 1 #endif /* !CONFIG_IPIPE */ #ifdef CONFIG_TICKSOURCE_CORETMR #define IRQ_SYSTMR IRQ_CORETMR #define IRQ_PRIOTMR IRQ_CORETMR #else #define IRQ_SYSTMR IRQ_TIMER0 #define IRQ_PRIOTMR CONFIG_IRQ_TIMER0 #endif #define ipipe_update_tick_evtdev(evtdev) do { } while (0) #endif /* !__ASM_BLACKFIN_IPIPE_H */
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ #define CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ #include <set> #include <vector> #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "content/browser/appcache/appcache_response.h" #include "content/common/content_export.h" #include "net/disk_cache/disk_cache.h" namespace base { class SingleThreadTaskRunner; } // namespace base namespace content { // An implementation of AppCacheDiskCacheInterface that // uses net::DiskCache as the backing store. class CONTENT_EXPORT AppCacheDiskCache : public AppCacheDiskCacheInterface { public: AppCacheDiskCache(); virtual ~AppCacheDiskCache(); // Initializes the object to use disk backed storage. int InitWithDiskBackend( const base::FilePath& disk_cache_directory, int disk_cache_size, bool force, const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread, const net::CompletionCallback& callback); // Initializes the object to use memory only storage. // This is used for Chrome's incognito browsing. int InitWithMemBackend(int disk_cache_size, const net::CompletionCallback& callback); void Disable(); bool is_disabled() const { return is_disabled_; } virtual int CreateEntry(int64 key, Entry** entry, const net::CompletionCallback& callback) OVERRIDE; virtual int OpenEntry(int64 key, Entry** entry, const net::CompletionCallback& callback) OVERRIDE; virtual int DoomEntry(int64 key, const net::CompletionCallback& callback) OVERRIDE; private: class CreateBackendCallbackShim; class EntryImpl; // PendingCalls allow CreateEntry, OpenEntry, and DoomEntry to be called // immediately after construction, without waiting for the // underlying disk_cache::Backend to be fully constructed. Early // calls are queued up and serviced once the disk_cache::Backend is // really ready to go. enum PendingCallType { CREATE, OPEN, DOOM }; struct PendingCall { PendingCallType call_type; int64 key; Entry** entry; net::CompletionCallback callback; PendingCall(); PendingCall(PendingCallType call_type, int64 key, Entry** entry, const net::CompletionCallback& callback); ~PendingCall(); }; typedef std::vector<PendingCall> PendingCalls; class ActiveCall; typedef std::set<ActiveCall*> ActiveCalls; typedef std::set<EntryImpl*> OpenEntries; bool is_initializing() const { return create_backend_callback_.get() != NULL; } disk_cache::Backend* disk_cache() { return disk_cache_.get(); } int Init(net::CacheType cache_type, const base::FilePath& directory, int cache_size, bool force, const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread, const net::CompletionCallback& callback); void OnCreateBackendComplete(int rv); void AddActiveCall(ActiveCall* call) { active_calls_.insert(call); } void RemoveActiveCall(ActiveCall* call) { active_calls_.erase(call); } void AddOpenEntry(EntryImpl* entry) { open_entries_.insert(entry); } void RemoveOpenEntry(EntryImpl* entry) { open_entries_.erase(entry); } bool is_disabled_; net::CompletionCallback init_callback_; scoped_refptr<CreateBackendCallbackShim> create_backend_callback_; PendingCalls pending_calls_; ActiveCalls active_calls_; OpenEntries open_entries_; scoped_ptr<disk_cache::Backend> disk_cache_; }; } // namespace content #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_
#include "builtin.h" #include "cache.h" #include "dir.h" #include "parse-options.h" #include "string-list.h" #include "rerere.h" #include "xdiff/xdiff.h" #include "xdiff-interface.h" static const char * const rerere_usage[] = { "git rerere [clear | forget path... | status | remaining | diff | gc]", NULL, }; static int outf(void *dummy, mmbuffer_t *ptr, int nbuf) { int i; for (i = 0; i < nbuf; i++) if (write_in_full(1, ptr[i].ptr, ptr[i].size) != ptr[i].size) return -1; return 0; } static int diff_two(const char *file1, const char *label1, const char *file2, const char *label2) { xpparam_t xpp; xdemitconf_t xecfg; xdemitcb_t ecb; mmfile_t minus, plus; if (read_mmfile(&minus, file1) || read_mmfile(&plus, file2)) return 1; printf("--- a/%s\n+++ b/%s\n", label1, label2); fflush(stdout); memset(&xpp, 0, sizeof(xpp)); xpp.flags = 0; memset(&xecfg, 0, sizeof(xecfg)); xecfg.ctxlen = 3; ecb.outf = outf; xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb); free(minus.ptr); free(plus.ptr); return 0; } int cmd_rerere(int argc, const char **argv, const char *prefix) { struct string_list merge_rr = STRING_LIST_INIT_DUP; int i, fd, autoupdate = -1, flags = 0; struct option options[] = { OPT_SET_INT(0, "rerere-autoupdate", &autoupdate, "register clean resolutions in index", 1), OPT_END(), }; argc = parse_options(argc, argv, prefix, options, rerere_usage, 0); if (autoupdate == 1) flags = RERERE_AUTOUPDATE; if (autoupdate == 0) flags = RERERE_NOAUTOUPDATE; if (argc < 1) return rerere(flags); if (!strcmp(argv[0], "forget")) { const char **pathspec; if (argc < 2) warning("'git rerere forget' without paths is deprecated"); pathspec = get_pathspec(prefix, argv + 1); return rerere_forget(pathspec); } fd = setup_rerere(&merge_rr, flags); if (fd < 0) return 0; if (!strcmp(argv[0], "clear")) { rerere_clear(&merge_rr); } else if (!strcmp(argv[0], "gc")) rerere_gc(&merge_rr); else if (!strcmp(argv[0], "status")) for (i = 0; i < merge_rr.nr; i++) printf("%s\n", merge_rr.items[i].string); else if (!strcmp(argv[0], "remaining")) { rerere_remaining(&merge_rr); for (i = 0; i < merge_rr.nr; i++) { if (merge_rr.items[i].util != RERERE_RESOLVED) printf("%s\n", merge_rr.items[i].string); else /* prepare for later call to * string_list_clear() */ merge_rr.items[i].util = NULL; } } else if (!strcmp(argv[0], "diff")) for (i = 0; i < merge_rr.nr; i++) { const char *path = merge_rr.items[i].string; const char *name = (const char *)merge_rr.items[i].util; diff_two(rerere_path(name, "preimage"), path, path, path); } else usage_with_options(rerere_usage, options); string_list_clear(&merge_rr, 1); return 0; }
/* Return attribute code of given attribute. Copyright (C) 2003 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2003. Red Hat elfutils 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. Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. In addition, as a special exception, Red Hat, Inc. gives You the additional right to link the code of Red Hat elfutils with code licensed under any Open Source Initiative certified open source license (http://www.opensource.org/licenses/index.php) which requires the distribution of source code with any binary distribution and to distribute linked combinations of the two. Non-GPL Code permitted under this exception must only link to the code of Red Hat elfutils through those well defined interfaces identified in the file named EXCEPTION found in the source code files (the "Approved Interfaces"). The files of Non-GPL Code may instantiate templates or use macros or inline functions from the Approved Interfaces without causing the resulting work to be covered by the GNU General Public License. Only Red Hat, Inc. may make changes or additions to the list of Approved Interfaces. Red Hat's grant of this exception is conditioned upon your not adding any new exceptions. If you wish to add a new Approved Interface or exception, please contact Red Hat. You must obey the GNU General Public License in all respects for all of the Red Hat elfutils code and other code used in conjunction with Red Hat elfutils except the Non-GPL Code covered by this exception. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to provide this exception without modification, you must delete this exception statement from your version and license this file solely under the GPL without exception. Red Hat elfutils is an included package of the Open Invention Network. An included package of the Open Invention Network is a package for which Open Invention Network licensees cross-license their patents. No patent license is granted, either expressly or impliedly, by designation as an included package. Should you wish to participate in the Open Invention Network licensing program, please visit www.openinventionnetwork.com <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <dwarf.h> #include "libdwP.h" unsigned int dwarf_whatattr (attr) Dwarf_Attribute *attr; { return attr == NULL ? 0 : attr->code; }
int should_return_one() { return 1; }
/* * seek utility functions for use within format handlers * * Copyright (c) 2009 Ivan Schreter * * 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 AVFORMAT_SEEK_H #define AVFORMAT_SEEK_H #include "avformat.h" /** * structure to store parser state of one AVStream */ typedef struct AVParserStreamState { // saved members of AVStream AVCodecParserContext *parser; int64_t last_IP_pts; int64_t cur_dts; int probe_packets; } AVParserStreamState; /** * structure to store parser state of AVFormat */ typedef struct AVParserState { int64_t fpos; ///< file position at the time of call // saved members of AVFormatContext AVPacketList *packet_buffer; ///< packet buffer of original state AVPacketList *parse_queue; ///< parse queue of original state AVPacketList *raw_packet_buffer; ///< raw packet buffer of original state int raw_packet_buffer_remaining_size; ///< remaining space in raw_packet_buffer // saved info for streams int nb_streams; ///< number of streams with stored state AVParserStreamState *stream_states; ///< states of individual streams (array) } AVParserState; /** * Search for the sync point of all active streams. * * This routine is not supposed to be called directly by a user application, * but by demuxers. * * A sync point is defined as a point in stream, such that, when decoding start * from this point, the decoded output of all streams synchronizes closest * to the given timestamp ts. This routine also takes timestamp limits into account. * Thus, the output will synchronize no sooner than ts_min and no later than ts_max. * * @param stream_index stream index for time base reference of timestamps * @param pos approximate position where to start searching for key frames * @param min_ts minimum allowed timestamp (position, if AVSEEK_FLAG_BYTE set) * @param ts target timestamp (or position, if AVSEEK_FLAG_BYTE set in flags) * @param max_ts maximum allowed timestamp (position, if AVSEEK_FLAG_BYTE set) * @param flags if AVSEEK_FLAG_ANY is set, seek to any frame, otherwise only * to a keyframe. If AVSEEK_FLAG_BYTE is set, search by * position, not by timestamp. * @return -1 if no such sync point could be found, otherwise stream position * (stream is repositioned to this position) */ int64_t ff_gen_syncpoint_search(AVFormatContext *s, int stream_index, int64_t pos, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); /** * Store current parser state and file position. * * This function can be used by demuxers before a destructive seeking algorithm * to store the parser state. Depending on the outcome of the seek, either the original * state can be restored or the new state kept and the original state freed. * * @note As a side effect, the original parser state is reset, since structures * are relinked to the stored state instead of being deeply-copied (for * performance reasons and to keep the code simple). * * @param s context from which to save state * @return parser state object or NULL if memory could not be allocated */ AVParserState *ff_store_parser_state(AVFormatContext *s); /** * Restore previously saved parser state and file position. * * Saved state will be invalidated and freed by this call, since internal * structures will be relinked back to the stored state instead of being * deeply-copied. * * @param s context to which to restore state (same as used for storing state) * @param state state to restore */ void ff_restore_parser_state(AVFormatContext *s, AVParserState *state); /** * Free previously saved parser state. * * @param s context to which the state belongs (same as used for storing state) * @param state state to free */ void ff_free_parser_state(AVFormatContext *s, AVParserState *state); #endif /* AVFORMAT_SEEK_H */
#define BAZ_PRIVATE 1
#import <Foundation/Foundation.h> #import <libkern/OSAtomic.h> #import "DDLog.h" /** * Welcome to Cocoa Lumberjack! * * The project page has a wealth of documentation if you have any questions. * https://github.com/robbiehanson/CocoaLumberjack * * If you're new to the project you may wish to read the "Getting Started" page. * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted * * * This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id. * * A log formatter can be added to any logger to format and/or filter its output. * You can learn more about log formatters here: * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomFormatters * * A typical NSLog (or DDTTYLogger) prints detailed info as [<process_id>:<thread_id>]. * For example: * * 2011-10-17 20:21:45.435 AppName[19928:5207] Your log message here * * Where: * - 19928 = process id * - 5207 = thread id (mach_thread_id printed in hex) * * When using grand central dispatch (GCD), this information is less useful. * This is because a single serial dispatch queue may be run on any thread from an internally managed thread pool. * For example: * * 2011-10-17 20:32:31.111 AppName[19954:4d07] Message from my_serial_dispatch_queue * 2011-10-17 20:32:31.112 AppName[19954:5207] Message from my_serial_dispatch_queue * 2011-10-17 20:32:31.113 AppName[19954:2c55] Message from my_serial_dispatch_queue * * This formatter allows you to replace the standard [box:info] with the dispatch_queue name. * For example: * * 2011-10-17 20:32:31.111 AppName[img-scaling] Message from my_serial_dispatch_queue * 2011-10-17 20:32:31.112 AppName[img-scaling] Message from my_serial_dispatch_queue * 2011-10-17 20:32:31.113 AppName[img-scaling] Message from my_serial_dispatch_queue * * If the dispatch_queue doesn't have a set name, then it falls back to the thread name. * If the current thread doesn't have a set name, then it falls back to the mach_thread_id in hex (like normal). * * Note: If manually creating your own background threads (via NSThread/alloc/init or NSThread/detachNeThread), * you can use [[NSThread currentThread] setName:(NSString *)]. **/ @interface DispatchQueueLogFormatter : NSObject <DDLogFormatter> { @protected NSDateFormatter *dateFormatter; @private OSSpinLock lock; NSUInteger _minQueueLength; // _prefix == Only access via atomic property NSUInteger _maxQueueLength; // _prefix == Only access via atomic property NSMutableDictionary *_replacements; // _prefix == Only access from within spinlock } /** * Standard init method. * Configure using properties as desired. **/ - (id)init; /** * The minQueueLength restricts the minimum size of the [detail box]. * If the minQueueLength is set to 0, there is no restriction. * * For example, say a dispatch_queue has a label of "diskIO": * * If the minQueueLength is 0: [diskIO] * If the minQueueLength is 4: [diskIO] * If the minQueueLength is 5: [diskIO] * If the minQueueLength is 6: [diskIO] * If the minQueueLength is 7: [diskIO ] * If the minQueueLength is 8: [diskIO ] * * The default minQueueLength is 0 (no minimum, so [detail box] won't be padded). **/ @property (assign) NSUInteger minQueueLength; /** * The maxQueueLength restricts the number of characters that will be inside the [detail box]. * If the maxQueueLength is 0, there is no restriction. * For example: * * Say a dispatch_queue has a label of "diskIO". (standardizedQueueLength==NO) * If the maxQueueLength is 0: [diskIO] * If the maxQueueLength is 4: [disk] * If the maxQueueLength is 5: [diskI] * If the maxQueueLength is 6: [diskIO] * If the maxQueueLength is 7: [diskIO] * If the maxQueueLength is 8: [diskIO] * * The default maxQueueLength is 0 (no maximum, so [thread box] queue names won't be truncated). **/ @property (assign) NSUInteger maxQueueLength; /** * Sometimes queue labels have long names like "com.apple.main-queue", * but you'd prefer something shorter like simply "main". * * This method allows you to set such preferred replacements. * The above example is set by default. * * To remove/undo a previous replacement, invoke this method with nil for the 'shortLabel' parameter. **/ - (NSString *)replacementStringForQueueLabel:(NSString *)longLabel; - (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel; @end
// // MLeakedObjectProxy.h // MLeaksFinder // // Created by 佘泽坡 on 7/15/16. // Copyright © 2016 zeposhe. All rights reserved. // #import <Foundation/Foundation.h> @interface MLeakedObjectProxy : NSObject + (BOOL)isAnyObjectLeakedAtPtrs:(NSSet *)ptrs; + (void)addLeakedObject:(id)object; @end
/* linalg/givens.c * * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough * * 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Generate a Givens rotation (cos,sin) which takes v=(x,y) to (|v|,0) From Golub and Van Loan, "Matrix Computations", Section 5.1.8 */ inline static void create_givens (const double a, const double b, double *c, double *s) { if (b == 0) { *c = 1; *s = 0; } else if (fabs (b) > fabs (a)) { double t = -a / b; double s1 = 1.0 / sqrt (1 + t * t); *s = s1; *c = s1 * t; } else { double t = -b / a; double c1 = 1.0 / sqrt (1 + t * t); *c = c1; *s = c1 * t; } }
/** @todo: Add Microsoft license information */ #ifndef PTHREAD_CREATE_H__ #define PTHREAD_CREATE_H__ #ifndef WIN_PTHREADS_H #ifdef __cplusplus extern "C" { #endif typedef void* pthread_t; typedef void pthread_attr_t; int pthread_create( pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg); #ifdef __cplusplus } #endif #endif //WIN_PTHREADS_H #endif //__PTHREAD_CREATE_H__
/* Support functions for general registry objects. Copyright (C) 2011-2013 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "defs.h" #include "registry.h" #include "gdb_assert.h" #include "gdb_string.h" const struct registry_data * register_data_with_cleanup (struct registry_data_registry *registry, registry_data_callback save, registry_data_callback free) { struct registry_data_registration **curr; /* Append new registration. */ for (curr = &registry->registrations; *curr != NULL; curr = &(*curr)->next) ; *curr = XMALLOC (struct registry_data_registration); (*curr)->next = NULL; (*curr)->data = XMALLOC (struct registry_data); (*curr)->data->index = registry->num_registrations++; (*curr)->data->save = save; (*curr)->data->free = free; return (*curr)->data; } void registry_alloc_data (struct registry_data_registry *registry, struct registry_fields *fields) { gdb_assert (fields->data == NULL); fields->num_data = registry->num_registrations; fields->data = XCALLOC (fields->num_data, void *); } void registry_clear_data (struct registry_data_registry *data_registry, registry_callback_adaptor adaptor, struct registry_container *container, struct registry_fields *fields) { struct registry_data_registration *registration; int i; gdb_assert (fields->data != NULL); /* Process all the save handlers. */ for (registration = data_registry->registrations, i = 0; i < fields->num_data; registration = registration->next, i++) if (fields->data[i] != NULL && registration->data->save != NULL) adaptor (registration->data->save, container, fields->data[i]); /* Now process all the free handlers. */ for (registration = data_registry->registrations, i = 0; i < fields->num_data; registration = registration->next, i++) if (fields->data[i] != NULL && registration->data->free != NULL) adaptor (registration->data->free, container, fields->data[i]); memset (fields->data, 0, fields->num_data * sizeof (void *)); } void registry_container_free_data (struct registry_data_registry *data_registry, registry_callback_adaptor adaptor, struct registry_container *container, struct registry_fields *fields) { void ***rdata = &fields->data; gdb_assert (*rdata != NULL); registry_clear_data (data_registry, adaptor, container, fields); xfree (*rdata); *rdata = NULL; } void registry_set_data (struct registry_fields *fields, const struct registry_data *data, void *value) { gdb_assert (data->index < fields->num_data); fields->data[data->index] = value; } void * registry_data (struct registry_fields *fields, const struct registry_data *data) { gdb_assert (data->index < fields->num_data); return fields->data[data->index]; }
/* * v4l2-fh.c * * V4L2 file handles. * * Copyright (C) 2009--2010 Nokia Corporation. * * Contact: Sakari Ailus <sakari.ailus@maxwell.research.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 */ #include <linux/bitops.h> #include <linux/slab.h> #include <media/v4l2-dev.h> #include <media/v4l2-fh.h> #include <media/v4l2-event.h> #include <media/v4l2-ioctl.h> int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev) { fh->vdev = vdev; /* Inherit from video_device. May be overridden by the driver. */ fh->ctrl_handler = vdev->ctrl_handler; INIT_LIST_HEAD(&fh->list); set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags); fh->prio = V4L2_PRIORITY_UNSET; /* * fh->events only needs to be initialized if the driver * supports the VIDIOC_SUBSCRIBE_EVENT ioctl. */ if (vdev->ioctl_ops && vdev->ioctl_ops->vidioc_subscribe_event) return v4l2_event_init(fh); fh->events = NULL; return 0; } EXPORT_SYMBOL_GPL(v4l2_fh_init); void v4l2_fh_add(struct v4l2_fh *fh) { unsigned long flags; if (test_bit(V4L2_FL_USE_FH_PRIO, &fh->vdev->flags)) v4l2_prio_open(fh->vdev->prio, &fh->prio); spin_lock_irqsave(&fh->vdev->fh_lock, flags); list_add(&fh->list, &fh->vdev->fh_list); spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); } EXPORT_SYMBOL_GPL(v4l2_fh_add); int v4l2_fh_open(struct file *filp) { struct video_device *vdev = video_devdata(filp); struct v4l2_fh *fh = kzalloc(sizeof(*fh), GFP_KERNEL); filp->private_data = fh; if (fh == NULL) return -ENOMEM; v4l2_fh_init(fh, vdev); v4l2_fh_add(fh); return 0; } EXPORT_SYMBOL_GPL(v4l2_fh_open); void v4l2_fh_del(struct v4l2_fh *fh) { unsigned long flags; spin_lock_irqsave(&fh->vdev->fh_lock, flags); list_del_init(&fh->list); spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); if (test_bit(V4L2_FL_USE_FH_PRIO, &fh->vdev->flags)) v4l2_prio_close(fh->vdev->prio, fh->prio); } EXPORT_SYMBOL_GPL(v4l2_fh_del); void v4l2_fh_exit(struct v4l2_fh *fh) { if (fh->vdev == NULL) return; fh->vdev = NULL; v4l2_event_free(fh); } EXPORT_SYMBOL_GPL(v4l2_fh_exit); int v4l2_fh_release(struct file *filp) { struct v4l2_fh *fh = filp->private_data; if (fh) { v4l2_fh_del(fh); v4l2_fh_exit(fh); kfree(fh); } return 0; } EXPORT_SYMBOL_GPL(v4l2_fh_release); int v4l2_fh_is_singular(struct v4l2_fh *fh) { unsigned long flags; int is_singular; if (fh == NULL || fh->vdev == NULL) return 0; spin_lock_irqsave(&fh->vdev->fh_lock, flags); is_singular = list_is_singular(&fh->list); spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); return is_singular; } EXPORT_SYMBOL_GPL(v4l2_fh_is_singular);
#ifndef SQL_RELOAD_INCLUDED #define SQL_RELOAD_INCLUDED /* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class THD; struct TABLE_LIST; bool reload_acl_and_cache(THD *thd, unsigned long options, TABLE_LIST *tables, int *write_to_binlog); bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables); bool flush_tables_for_export(THD *thd, TABLE_LIST *all_tables); #endif
#include <stdlib.h> #include "cpuid.h" #include "m512-check.h" #include "avx512f-os-support.h" static void avx512vbmi_test (void); static void __attribute__ ((noinline)) do_test (void) { avx512vbmi_test (); } int main () { unsigned int eax, ebx, ecx, edx; if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) return 0; if ((ecx & bit_OSXSAVE) == (bit_OSXSAVE)) { if (__get_cpuid_max (0, NULL) < 7) return 0; __cpuid_count (7, 0, eax, ebx, ecx, edx); if ((avx512f_os_support ()) && ((ecx & bit_AVX512VBMI) == bit_AVX512VBMI)) { do_test (); #ifdef DEBUG printf ("PASSED\n"); #endif return 0; } #ifdef DEBUG printf ("SKIPPED\n"); #endif } #ifdef DEBUG else printf ("SKIPPED\n"); #endif return 0; }
//***************************************************************************** // // crc.h - Defines and Macros for CRC module. // // Copyright (c) 2012-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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 Texas Instruments Incorporated 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. // // This is part of revision 2.1.4.178 of the Tiva Peripheral Driver Library. // //***************************************************************************** #ifndef __DRIVERLIB_CRC_H__ #define __DRIVERLIB_CRC_H__ //***************************************************************************** // // If building with a C++ compiler, make all of the definitions in this header // have a C binding. // //***************************************************************************** #ifdef __cplusplus extern "C" { #endif //***************************************************************************** // // The following defines are used in the ui32Config argument of the // ECConfig function. // //***************************************************************************** #define CRC_CFG_INIT_SEED 0x00000000 // Initialize with seed #define CRC_CFG_INIT_0 0x00004000 // Initialize to all '0s' #define CRC_CFG_INIT_1 0x00006000 // Initialize to all '1s' #define CRC_CFG_SIZE_8BIT 0x00001000 // Input Data Size #define CRC_CFG_SIZE_32BIT 0x00000000 // Input Data Size #define CRC_CFG_RESINV 0x00000200 // Result Inverse Enable #define CRC_CFG_OBR 0x00000100 // Output Reverse Enable #define CRC_CFG_IBR 0x00000080 // Bit reverse enable #define CRC_CFG_ENDIAN_SBHW 0x00000020 // Swap byte in half-word #define CRC_CFG_ENDIAN_SHW 0x00000010 // Swap half-word #define CRC_CFG_TYPE_P8005 0x00000000 // Polynomial 0x8005 #define CRC_CFG_TYPE_P1021 0x00000001 // Polynomial 0x1021 #define CRC_CFG_TYPE_P4C11DB7 0x00000002 // Polynomial 0x4C11DB7 #define CRC_CFG_TYPE_P1EDC6F41 0x00000003 // Polynomial 0x1EDC6F41 #define CRC_CFG_TYPE_TCPCHKSUM 0x00000008 // TCP checksum //***************************************************************************** // // Function prototypes. // //***************************************************************************** #if 0 extern void ECClockGatingReqest(uint32_t ui32Base, uint32_t ui32ECIP, bool bGate); #endif extern void CRCConfigSet(uint32_t ui32Base, uint32_t ui32CRCConfig); extern uint32_t CRCDataProcess(uint32_t ui32Base, uint32_t *pui32DataIn, uint32_t ui32DataLength, bool bPPResult); extern void CRCDataWrite(uint32_t ui32Base, uint32_t ui32Data); extern uint32_t CRCResultRead(uint32_t ui32Base, bool bPPResult); extern void CRCSeedSet(uint32_t ui32Base, uint32_t ui32Seed); //***************************************************************************** // // Mark the end of the C bindings section for C++ compilers. // //***************************************************************************** #ifdef __cplusplus } #endif #endif // __DRIVERLIB_CRC_H__
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef REMOTING_HOST_SIGNALING_CONNECTOR_H_ #define REMOTING_HOST_SIGNALING_CONNECTOR_H_ #include "base/basictypes.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" #include "base/timer/timer.h" #include "net/base/network_change_notifier.h" #include "remoting/host/oauth_token_getter.h" #include "remoting/signaling/xmpp_signal_strategy.h" namespace remoting { class DnsBlackholeChecker; // SignalingConnector listens for SignalStrategy status notifications // and attempts to keep it connected when possible. When signalling is // not connected it keeps trying to reconnect it until it is // connected. It limits connection attempt rate using exponential // backoff. It also monitors network state and reconnects signalling // whenever connection type changes or IP address changes. class SignalingConnector : public base::SupportsWeakPtr<SignalingConnector>, public base::NonThreadSafe, public SignalStrategy::Listener, public net::NetworkChangeNotifier::ConnectionTypeObserver, public net::NetworkChangeNotifier::IPAddressObserver { public: // The |auth_failed_callback| is called when authentication fails. SignalingConnector( XmppSignalStrategy* signal_strategy, scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker, const base::Closure& auth_failed_callback); virtual ~SignalingConnector(); // May be called immediately after the constructor to enable OAuth // access token updating. // |oauth_token_getter| must outlive SignalingConnector. void EnableOAuth(OAuthTokenGetter* oauth_token_getter); // OAuthTokenGetter callback. void OnAccessToken(OAuthTokenGetter::Status status, const std::string& user_email, const std::string& access_token); // SignalStrategy::Listener interface. virtual void OnSignalStrategyStateChange( SignalStrategy::State state) OVERRIDE; virtual bool OnSignalStrategyIncomingStanza( const buzz::XmlElement* stanza) OVERRIDE; // NetworkChangeNotifier::ConnectionTypeObserver interface. virtual void OnConnectionTypeChanged( net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; // NetworkChangeNotifier::IPAddressObserver interface. virtual void OnIPAddressChanged() OVERRIDE; private: void OnNetworkError(); void ScheduleTryReconnect(); void ResetAndTryReconnect(); void TryReconnect(); void OnDnsBlackholeCheckerDone(bool allow); XmppSignalStrategy* signal_strategy_; base::Closure auth_failed_callback_; scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker_; OAuthTokenGetter* oauth_token_getter_; // Number of times we tried to connect without success. int reconnect_attempts_; base::OneShotTimer<SignalingConnector> timer_; DISALLOW_COPY_AND_ASSIGN(SignalingConnector); }; } // namespace remoting #endif // REMOTING_HOST_SIGNALING_CONNECTOR_H_
/* msvc: libmpg123 add-ons for MSVC++ copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 see COPYING and AUTHORS files in distribution or http://mpg123.org originally written by Patrick Dehne (inspired by libmpg123/readers.c) */ #include "mpg123lib_intern.h" #include <tchar.h> #include <fcntl.h> #include <io.h> #include "debug.h" int mpg123_topen(mpg123_handle *fr, const _TCHAR *path) { int ret; int filept; /* descriptor of opened file/stream */ ret = mpg123_replace_reader(fr, _read, _lseek); if(ret != MPG123_OK) { return ret; } if((filept = _topen(path, O_RDONLY|O_BINARY)) < 0) { /* Will not work with unicode path name if(NOQUIET) error2("Cannot open file %s: %s", path, strerror(errno)); */ if(NOQUIET) error1("Cannot open file: %s", strerror(errno)); fr->err = MPG123_BAD_FILE; return filept; /* error... */ } if(mpg123_open_fd(fr, filept) == MPG123_OK) { return MPG123_OK; } else { _close(filept); return MPG123_ERR; } } int mpg123_tclose(mpg123_handle *fr) { int ret, filept; filept = fr->rdat.filept; ret = mpg123_close(fr); _close(filept); return ret; }
// 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 DEVICE_SERIAL_SERIAL_DEVICE_ENUMERATOR_MAC_H_ #define DEVICE_SERIAL_SERIAL_DEVICE_ENUMERATOR_MAC_H_ #include "device/serial/serial_device_enumerator.h" namespace device { // Discovers and enumerates serial devices available to the host. class SerialDeviceEnumeratorMac : public SerialDeviceEnumerator { public: SerialDeviceEnumeratorMac(); ~SerialDeviceEnumeratorMac() override; // Implementation for SerialDeviceEnumerator. mojo::Array<serial::DeviceInfoPtr> GetDevices() override; private: DISALLOW_COPY_AND_ASSIGN(SerialDeviceEnumeratorMac); }; } // namespace device #endif // DEVICE_SERIAL_SERIAL_DEVICE_ENUMERATOR_MAC_H_
/* * Copyright (C) 2004 Michael Niedermayer <michaelni@gmx.at> * * This file is part of MPlayer. * * MPlayer 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. * * MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <inttypes.h> #include "mp_msg.h" #include "cpudetect.h" #include "img_format.h" #include "mp_image.h" #include "vf.h" #include "libvo/fastmemcpy.h" #include "libavcodec/avcodec.h" #include "libavutil/eval.h" #include "libavutil/mem.h" struct vf_priv_s { char eq[200]; int8_t *qp; int8_t lut[257]; int qp_stride; }; static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ int h= (height+15)>>4; int i; vf->priv->qp_stride= (width+15)>>4; vf->priv->qp= av_malloc(vf->priv->qp_stride*h*sizeof(int8_t)); for(i=-129; i<128; i++){ double const_values[]={ M_PI, M_E, i != -129, i, 0 }; static const char *const_names[]={ "PI", "E", "known", "qp", NULL }; double temp_val; int res; res= av_expr_parse_and_eval(&temp_val, vf->priv->eq, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, NULL); if (res < 0){ mp_msg(MSGT_VFILTER, MSGL_ERR, "qp: Error evaluating \"%s\" \n", vf->priv->eq); return 0; } vf->priv->lut[i+129]= lrintf(temp_val); } return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); } static void get_image(struct vf_instance *vf, mp_image_t *mpi){ if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change // ok, we can do pp in-place (or pp disabled): vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, mpi->type, mpi->flags, mpi->w, mpi->h); mpi->planes[0]=vf->dmpi->planes[0]; mpi->stride[0]=vf->dmpi->stride[0]; mpi->width=vf->dmpi->width; if(mpi->flags&MP_IMGFLAG_PLANAR){ mpi->planes[1]=vf->dmpi->planes[1]; mpi->planes[2]=vf->dmpi->planes[2]; mpi->stride[1]=vf->dmpi->stride[1]; mpi->stride[2]=vf->dmpi->stride[2]; } mpi->flags|=MP_IMGFLAG_DIRECT; } static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ mp_image_t *dmpi; int x,y; if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ // no DR, so get a new image! hope we'll get DR buffer: vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE, mpi->w,mpi->h); } dmpi= vf->dmpi; if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]); if(mpi->flags&MP_IMGFLAG_PLANAR){ memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]); memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]); } } vf_clone_mpi_attributes(dmpi, mpi); dmpi->qscale = vf->priv->qp; dmpi->qstride= vf->priv->qp_stride; if(mpi->qscale){ for(y=0; y<((dmpi->h+15)>>4); y++){ for(x=0; x<vf->priv->qp_stride; x++){ dmpi->qscale[x + dmpi->qstride*y]= vf->priv->lut[ 129 + ((int8_t)mpi->qscale[x + mpi->qstride*y]) ]; } } }else{ int qp= vf->priv->lut[0]; for(y=0; y<((dmpi->h+15)>>4); y++){ for(x=0; x<vf->priv->qp_stride; x++){ dmpi->qscale[x + dmpi->qstride*y]= qp; } } } return vf_next_put_image(vf,dmpi, pts); } static void uninit(struct vf_instance *vf){ if(!vf->priv) return; av_free(vf->priv->qp); vf->priv->qp= NULL; av_free(vf->priv); vf->priv=NULL; } //===========================================================================// static int vf_open(vf_instance_t *vf, char *args){ vf->config=config; vf->put_image=put_image; vf->get_image=get_image; vf->uninit=uninit; vf->priv=av_malloc(sizeof(struct vf_priv_s)); memset(vf->priv, 0, sizeof(struct vf_priv_s)); // avcodec_init(); if (args) strncpy(vf->priv->eq, args, 199); return 1; } const vf_info_t vf_info_qp = { "QP changer", "qp", "Michael Niedermayer", "", vf_open, NULL };
#ifndef __ASM_ARCH_PXA3XX_NAND_H #define __ASM_ARCH_PXA3XX_NAND_H #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> struct pxa3xx_nand_timing { unsigned int tCH; unsigned int tCS; unsigned int tWH; unsigned int tWP; unsigned int tRH; unsigned int tRP; unsigned int tR; unsigned int tWHR; unsigned int tAR; }; struct pxa3xx_nand_cmdset { uint16_t read1; uint16_t read2; uint16_t program; uint16_t read_status; uint16_t read_id; uint16_t erase; uint16_t reset; uint16_t lock; uint16_t unlock; uint16_t lock_status; }; struct pxa3xx_nand_flash { char *name; uint32_t chip_id; unsigned int page_per_block; unsigned int page_size; unsigned int flash_width; unsigned int dfc_width; unsigned int num_blocks; struct pxa3xx_nand_timing *timing; }; #define NUM_CHIP_SELECT (2) struct pxa3xx_nand_platform_data { int enable_arbiter; int keep_config; int num_cs; const struct mtd_partition *parts[NUM_CHIP_SELECT]; unsigned int nr_parts[NUM_CHIP_SELECT]; const struct pxa3xx_nand_flash * flash; size_t num_flash; }; extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info); #endif
/* * _chnl_sm.h * * DSP-BIOS Bridge driver support functions for TI OMAP processors. * * Private header file defining channel manager and channel objects for * a shared memory channel driver. * * Shared between the modules implementing the shared memory channel class * library. * * Copyright (C) 2005-2006 Texas Instruments, Inc. * * This package 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 PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef _CHNL_SM_ #define _CHNL_SM_ #include <dspbridge/dspapi.h> #include <dspbridge/dspdefs.h> #include <linux/list.h> #include <dspbridge/ntfy.h> #define CHNL_SHARED_BUFFER_BASE_SYM "_SHM_BEG" #define CHNL_SHARED_BUFFER_LIMIT_SYM "_SHM_END" #define BRIDGEINIT_BIOSGPTIMER "_BRIDGEINIT_BIOSGPTIMER" #define BRIDGEINIT_LOADMON_GPTIMER "_BRIDGEINIT_LOADMON_GPTIMER" #ifndef _CHNL_WORDSIZE #define _CHNL_WORDSIZE 4 #endif #define MAXOPPS 16 #define SHM_CURROPP 0 #define SHM_OPPINFO 1 #define SHM_GETOPP 2 struct opp_table_entry { u32 voltage; u32 frequency; u32 min_freq; u32 max_freq; }; struct opp_struct { u32 curr_opp_pt; u32 num_opp_pts; struct opp_table_entry opp_point[MAXOPPS]; }; struct opp_rqst_struct { u32 rqst_dsp_freq; u32 rqst_opp_pt; }; struct load_mon_struct { u32 curr_dsp_load; u32 curr_dsp_freq; u32 pred_dsp_load; u32 pred_dsp_freq; }; struct shm { u32 dsp_free_mask; /* Written by DSP, read by PC. */ u32 host_free_mask; /* Written by PC, read by DSP */ u32 input_full; u32 input_id; u32 input_size; u32 output_full; u32 output_id; u32 output_size; u32 arg; u32 resvd; struct opp_struct opp_table_struct; struct opp_rqst_struct opp_request; struct load_mon_struct load_mon_info; u32 wdt_setclocks; u32 wdt_overflow; char dummy[176]; u32 shm_dbg_var[64]; }; struct chnl_mgr { struct bridge_drv_interface *intf_fxns; struct io_mgr *iomgr; struct dev_object *dev_obj; u32 output_mask; u32 last_output; spinlock_t chnl_mgr_lock; u32 word_size; u8 max_channels; u8 open_channels; struct chnl_object **channels; u8 type; int chnl_open_status; }; struct chnl_object { struct chnl_mgr *chnl_mgr_obj; u32 chnl_id; u8 state; s8 chnl_mode; void *user_event; struct sync_object *sync_event; u32 process; u32 cb_arg; struct list_head io_requests; s32 cio_cs; s32 cio_reqs; s32 chnl_packets; struct list_head io_completions; struct list_head free_packets_list; struct ntfy_object *ntfy_obj; u32 bytes_moved; u32 chnl_type; }; struct chnl_irp { struct list_head link; u8 *host_user_buf; u8 *host_sys_buf; u32 arg; u32 dsp_tx_addr; u32 byte_size; u32 buf_size; u32 status; }; #endif
/* * EHCI HCD glue for Cavium Octeon II SOCs. * * Loosely based on ehci-au1xxx.c * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2010 Cavium Networks * */ #include <linux/platform_device.h> #include <asm/octeon/octeon.h> #include <asm/octeon/cvmx-uctlx-defs.h> #define OCTEON_OHCI_HCD_NAME "octeon-ohci" void octeon2_usb_clocks_start(void); void octeon2_usb_clocks_stop(void); static void ohci_octeon_hw_start(void) { union cvmx_uctlx_ohci_ctl ohci_ctl; octeon2_usb_clocks_start(); ohci_ctl.u64 = cvmx_read_csr(CVMX_UCTLX_OHCI_CTL(0)); ohci_ctl.s.l2c_addr_msb = 0; ohci_ctl.s.l2c_buff_emod = 1; ohci_ctl.s.l2c_desc_emod = 1; cvmx_write_csr(CVMX_UCTLX_OHCI_CTL(0), ohci_ctl.u64); } static void ohci_octeon_hw_stop(void) { octeon2_usb_clocks_stop(); } static int __devinit ohci_octeon_start(struct usb_hcd *hcd) { struct ohci_hcd *ohci = hcd_to_ohci(hcd); int ret; ret = ohci_init(ohci); if (ret < 0) return ret; ret = ohci_run(ohci); if (ret < 0) { ohci_err(ohci, "can't start %s", hcd->self.bus_name); ohci_stop(hcd); return ret; } return 0; } static const struct hc_driver ohci_octeon_hc_driver = { .description = hcd_name, .product_desc = "Octeon OHCI", .hcd_priv_size = sizeof(struct ohci_hcd), .irq = ohci_irq, .flags = HCD_USB11 | HCD_MEMORY, .start = ohci_octeon_start, .stop = ohci_stop, .shutdown = ohci_shutdown, .urb_enqueue = ohci_urb_enqueue, .urb_dequeue = ohci_urb_dequeue, .endpoint_disable = ohci_endpoint_disable, .get_frame_number = ohci_get_frame, .hub_status_data = ohci_hub_status_data, .hub_control = ohci_hub_control, .start_port_reset = ohci_start_port_reset, }; static int ohci_octeon_drv_probe(struct platform_device *pdev) { struct usb_hcd *hcd; struct ohci_hcd *ohci; void *reg_base; struct resource *res_mem; int irq; int ret; if (usb_disabled()) return -ENODEV; irq = platform_get_irq(pdev, 0); if (irq < 0) { dev_err(&pdev->dev, "No irq assigned\n"); return -ENODEV; } res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (res_mem == NULL) { dev_err(&pdev->dev, "No register space assigned\n"); return -ENODEV; } pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; hcd = usb_create_hcd(&ohci_octeon_hc_driver, &pdev->dev, "octeon"); if (!hcd) return -ENOMEM; hcd->rsrc_start = res_mem->start; hcd->rsrc_len = resource_size(res_mem); if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, OCTEON_OHCI_HCD_NAME)) { dev_err(&pdev->dev, "request_mem_region failed\n"); ret = -EBUSY; goto err1; } reg_base = ioremap(hcd->rsrc_start, hcd->rsrc_len); if (!reg_base) { dev_err(&pdev->dev, "ioremap failed\n"); ret = -ENOMEM; goto err2; } ohci_octeon_hw_start(); hcd->regs = reg_base; ohci = hcd_to_ohci(hcd); #ifdef __BIG_ENDIAN ohci->flags |= OHCI_QUIRK_BE_MMIO; #endif ohci_hcd_init(ohci); ret = usb_add_hcd(hcd, irq, IRQF_SHARED); if (ret) { dev_dbg(&pdev->dev, "failed to add hcd with err %d\n", ret); goto err3; } platform_set_drvdata(pdev, hcd); return 0; err3: ohci_octeon_hw_stop(); iounmap(hcd->regs); err2: release_mem_region(hcd->rsrc_start, hcd->rsrc_len); err1: usb_put_hcd(hcd); return ret; } static int ohci_octeon_drv_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); usb_remove_hcd(hcd); ohci_octeon_hw_stop(); iounmap(hcd->regs); release_mem_region(hcd->rsrc_start, hcd->rsrc_len); usb_put_hcd(hcd); platform_set_drvdata(pdev, NULL); return 0; } static struct platform_driver ohci_octeon_driver = { .probe = ohci_octeon_drv_probe, .remove = ohci_octeon_drv_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = OCTEON_OHCI_HCD_NAME, .owner = THIS_MODULE, } }; MODULE_ALIAS("platform:" OCTEON_OHCI_HCD_NAME);
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (c) 2005 Stanislaw Skowronek <skylark@linux-mips.org> */ #ifndef _LINUX_IOC3_H #define _LINUX_IOC3_H #include <asm/sn/ioc3.h> #define IOC3_MAX_SUBMODULES 32 #define IOC3_CLASS_NONE 0 #define IOC3_CLASS_BASE_IP27 1 #define IOC3_CLASS_BASE_IP30 2 #define IOC3_CLASS_MENET_123 3 #define IOC3_CLASS_MENET_4 4 #define IOC3_CLASS_CADDUO 5 #define IOC3_CLASS_SERIAL 6 struct ioc3_driver_data { struct list_head list; int id; unsigned long pma; struct ioc3 __iomem *vma; struct pci_dev *pdev; int dual_irq; int irq_io, irq_eth; spinlock_t gpio_lock; unsigned int gpdr_shadow; char nic_part[32]; char nic_serial[16]; char nic_mac[6]; int class; void *data[IOC3_MAX_SUBMODULES]; int active[IOC3_MAX_SUBMODULES]; spinlock_t ir_lock; }; struct ioc3_submodule { char *name; struct module *owner; int ethernet; int (*probe) (struct ioc3_submodule *, struct ioc3_driver_data *); int (*remove) (struct ioc3_submodule *, struct ioc3_driver_data *); int id; unsigned int irq_mask; int reset_mask; int (*intr) (struct ioc3_submodule *, struct ioc3_driver_data *, unsigned int); void *data; }; #define IOC3_W_IES 0 #define IOC3_W_IEC 1 extern int ioc3_register_submodule(struct ioc3_submodule *); extern void ioc3_unregister_submodule(struct ioc3_submodule *); extern void ioc3_enable(struct ioc3_submodule *, struct ioc3_driver_data *, unsigned int); extern void ioc3_ack(struct ioc3_submodule *, struct ioc3_driver_data *, unsigned int); extern void ioc3_disable(struct ioc3_submodule *, struct ioc3_driver_data *, unsigned int); extern void ioc3_gpcr_set(struct ioc3_driver_data *, unsigned int); extern void ioc3_write_ireg(struct ioc3_driver_data *idd, uint32_t value, int reg); #endif
/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */ #include <stdio.h> #include <openacc.h> int main (int argc, char *argv[]) { int i; #pragma acc enter data create (i) fprintf (stderr, "CheCKpOInT\n"); acc_copyin (&i, sizeof i); return 0; } /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */ /* { dg-output "already mapped to" } */ /* { dg-shouldfail "" } */
/* ThreadSanitizer, a data race detector. Copyright (C) 2011-2014 Free Software Foundation, Inc. Contributed by Dmitry Vyukov <dvyukov@google.com> This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #ifndef TREE_TSAN #define TREE_TSAN extern void tsan_finish_file (void); #endif /* TREE_TSAN */
/* This file is part of the GSM3 communications library for Arduino -- Multi-transport communications platform -- Fully asynchronous -- Includes code for the Arduino-Telefonica GSM/GPRS Shield V1 -- Voice calls -- SMS -- TCP/IP connections -- HTTP basic clients This library has been developed by Telefónica Digital - PDI - - Physical Internet Lab, as part as its collaboration with Arduino and the Open Hardware Community. September-December 2012 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA The latest version of this library can always be found at https://github.com/BlueVia/Official-Arduino */ #ifndef _GSM3MOBILENETWORKPROVIDER_ #define _GSM3MOBILENETWORKPROVIDER_ #include <GSM3MobileAccessProvider.h> #include <inttypes.h> #include <stddef.h> #include <IPAddress.h> class GSM3MobileNetworkProvider { private: /** Restart hardware @return 1 if successful */ int HWrestart(); uint16_t socketsAsServer; // Server socket /** Get modem status @param s Socket @return modem status (true if connected) */ virtual inline bool getSocketAsServerModemStatus(int s){return false;}; public: /** minSocketAsServer @return 0 */ virtual inline int minSocketAsServer(){return 0;}; /** maxSocketAsServer @return 0 */ virtual inline int maxSocketAsServer(){return 0;}; /** Get last command status @return returns 0 if last command is still executing, 1 success, >1 error */ virtual int ready()=0; /** Constructor */ GSM3MobileNetworkProvider(); /** Get network status @return network status */ virtual inline GSM3_NetworkStatus_t getStatus(){return ERROR;}; /** Get socket client status @param socket Socket @return 1 if connected, 0 otherwise */ bool getStatusSocketClient(uint8_t socket); /** Close a AT command @param code Close code */ virtual inline void closeCommand(int code){}; /** Establish a TCP connection @param port Port @param localIP IP address @param localIPlength IP address size in characters @return command error if exists */ virtual inline int connectTCPServer(int port, char* localIP, int localIPlength){return 0;}; /** Get local IP address @param LocalIP Buffer for save IP address @param LocalIPlength Buffer size */ virtual inline int getIP(char* LocalIP, int LocalIPlength){return 0;}; /** Get new occupied socket @return -1 if no new socket has been occupied */ int getNewOccupiedSocketAsServer(); /** Get socket status as server @param socket Socket to get status @return socket status */ bool getStatusSocketAsServer(uint8_t socket); /** Close a socket @param client1Server0 1 if modem acts as client, 0 if acts as server @param id_socket Local socket number @return 0 if command running, 1 if success, otherwise error */ int disconnectTCP(bool client1Server0, int idsocket){return 1;}; /** Release socket @param socket Socket */ void releaseSocket(int socket){}; }; extern GSM3MobileNetworkProvider* theProvider; #endif
/* vi: set sw=4 ts=4: */ /* * prioritynames[] and facilitynames[] * * Copyright (C) 2008 by Denys Vlasenko <vda.linux@gmail.com> * * Licensed under GPLv2, see file LICENSE in this tarball for details. */ #include "libbb.h" #define SYSLOG_NAMES #define SYSLOG_NAMES_CONST #include <syslog.h> #if 0 /* For the record: with SYSLOG_NAMES <syslog.h> defines * (not declares) the following: */ typedef struct _code { /*const*/ char *c_name; int c_val; } CODE; /*const*/ CODE prioritynames[] = { { "alert", LOG_ALERT }, ... { NULL, -1 } }; /* same for facilitynames[] */ /* This MUST occur only once per entire executable, * therefore we can't just do it in syslogd.c and logger.c - * there will be two copies of it. * * We cannot even do it in separate file and then just reference * prioritynames[] from syslogd.c and logger.c - bare <syslog.h> * will not emit extern decls for prioritynames[]! Attempts to * emit "matching" struct _code declaration defeat the whole purpose * of <syslog.h>. * * For now, syslogd.c and logger.c are simply compiled into * one object file. */ #endif #if ENABLE_SYSLOGD #include "syslogd.c" #endif #if ENABLE_LOGGER #include "logger.c" #endif
// Low-level type for atomic operations -*- C++ -*- // Copyright (C) 2004-2014 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. #ifndef _GLIBCXX_ATOMIC_WORD_H #define _GLIBCXX_ATOMIC_WORD_H 1 #include <bits/cxxabi_tweaks.h> typedef int _Atomic_word; namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { // Test the first byte of __g and ensure that no loads are hoisted across // the test. inline bool __test_and_acquire (__cxxabiv1::__guard *__g) { unsigned char __c; unsigned char *__p = reinterpret_cast<unsigned char *>(__g); // ldN.acq is a load with an implied hoist barrier. // would ld8+mask be faster than just doing an ld1? __asm __volatile ("ld1.acq %0 = %1" : "=r"(__c) : "m"(*__p) : "memory"); return __c != 0; } // Set the first byte of __g to 1 and ensure that no stores are sunk // across the store. inline void __set_and_release (__cxxabiv1::__guard *__g) { unsigned char *__p = reinterpret_cast<unsigned char *>(__g); // stN.rel is a store with an implied sink barrier. // could load word, set flag, and CAS it back __asm __volatile ("st1.rel %0 = %1" : "=m"(*__p) : "r"(1) : "memory"); } // We don't define the _BARRIER macros on ia64 because the barriers are // included in the test and set, above. #define _GLIBCXX_GUARD_TEST_AND_ACQUIRE(G) __gnu_cxx::__test_and_acquire (G) #define _GLIBCXX_GUARD_SET_AND_RELEASE(G) __gnu_cxx::__set_and_release (G) } #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 UI_BASE_RANGE_RANGE_H_ #define UI_BASE_RANGE_RANGE_H_ #include <string> #include "base/basictypes.h" #include "ui/base/ui_export.h" #if defined(OS_MACOSX) #if __OBJC__ #import <Foundation/Foundation.h> #else typedef struct _NSRange NSRange; #endif #endif // defined(OS_MACOSX) #if defined(OS_WIN) #include <windows.h> #include <richedit.h> #endif namespace ui { // A Range contains two integer values that represent a numeric range, like the // range of characters in a text selection. A range is made of a start and end // position; when they are the same, the Range is akin to a caret. Note that // |start_| can be greater than |end_| to respect the directionality of the // range. class UI_EXPORT Range { public: // Creates an empty range {0,0}. Range(); // Initializes the range with a start and end. Range(size_t start, size_t end); // Initializes the range with the same start and end positions. explicit Range(size_t position); // Platform constructors. #if defined(OS_MACOSX) explicit Range(const NSRange& range); #elif defined(OS_WIN) // The |total_length| paramater should be used if the CHARRANGE is set to // {0,-1} to indicate the whole range. Range(const CHARRANGE& range, LONG total_length = -1); #endif // Returns a range that is invalid, which is {size_t_max,size_t_max}. static const Range InvalidRange(); // Checks if the range is valid through comparision to InvalidRange(). bool IsValid() const; // Getters and setters. size_t start() const { return start_; } void set_start(size_t start) { start_ = start; } size_t end() const { return end_; } void set_end(size_t end) { end_ = end; } // Returns the absolute value of the length. size_t length() const { ptrdiff_t length = end() - start(); return length >= 0 ? length : -length; } bool is_reversed() const { return start() > end(); } bool is_empty() const { return start() == end(); } // Returns the minimum and maximum values. size_t GetMin() const; size_t GetMax() const; bool operator==(const Range& other) const; bool operator!=(const Range& other) const; bool EqualsIgnoringDirection(const Range& other) const; // Returns true if this range intersects the specified |range|. bool Intersects(const Range& range) const; // Returns true if this range contains the specified |range|. bool Contains(const Range& range) const; // Computes the intersection of this range with the given |range|. // If they don't intersect, it returns an InvalidRange(). // The returned range is always empty or forward (never reversed). Range Intersect(const Range& range) const; #if defined(OS_MACOSX) Range& operator=(const NSRange& range); // NSRange does not store the directionality of a range, so if this // is_reversed(), the range will get flipped when converted to an NSRange. NSRange ToNSRange() const; #elif defined(OS_WIN) CHARRANGE ToCHARRANGE() const; #endif // GTK+ has no concept of a range. std::string ToString() const; private: size_t start_; size_t end_; }; } // namespace ui #endif // UI_BASE_RANGE_RANGE_H_
/***************************************************************************** Copyright(c) 2012 FCI Inc. All Rights Reserved File name : fci_tun.c Description : tuner control driver *******************************************************************************/ #include "fci_types.h" #include "fci_oal.h" #include "fci_hal.h" #include "fci_tun.h" #include "fci_i2c.h" #include "fci_bypass.h" #include "fc8150_regs.h" #include "fc8150_bb.h" #include "fc8150_tun.h" #define FC8150_TUNER_ADDR 0x5b static u8 tuner_addr = FC8150_TUNER_ADDR; static enum band_type tuner_band = ISDBT_1_SEG_TYPE; static enum i2c_type tuner_i2c = FCI_I2C_TYPE; struct I2C_DRV{ int (*init)(HANDLE hDevice, int speed, int slaveaddr); int (*read)(HANDLE hDevice, u8 chip, u8 addr , u8 alen, u8 *data, u8 len); int (*write)(HANDLE hDevice, u8 chip, u8 addr , u8 alen, u8 *data, u8 len); int (*deinit)(HANDLE hDevice); }; static struct I2C_DRV fcii2c = { &fci_i2c_init, &fci_i2c_read, &fci_i2c_write, &fci_i2c_deinit }; static struct I2C_DRV fcibypass = { &fci_bypass_init, &fci_bypass_read, &fci_bypass_write, &fci_bypass_deinit }; struct TUNER_DRV{ int (*init)(HANDLE hDevice, enum band_type band); int (*set_freq)(HANDLE hDevice , enum band_type band, u32 rf_Khz); int (*get_rssi)(HANDLE hDevice, int *rssi); int (*deinit)(HANDLE hDevice); }; static struct TUNER_DRV fc8150_tuner = { &fc8150_tuner_init, &fc8150_set_freq, &fc8150_get_rssi, &fc8150_tuner_deinit }; #if 0 static TUNER_DRV fc8151_tuner = { &fc8151_tuner_init, &fc8151_set_freq, &fc8151_get_rssi, &fc8151_tuner_deinit }; #endif static struct I2C_DRV *tuner_ctrl = &fcii2c; static struct TUNER_DRV *tuner = &fc8150_tuner; int tuner_ctrl_select(HANDLE hDevice, enum i2c_type type) { PRINTF(NULL, "[%s] ctrl select (type)%d\n", type); switch (type) { case FCI_I2C_TYPE: tuner_ctrl = &fcii2c; break; case FCI_BYPASS_TYPE: tuner_ctrl = &fcibypass; break; default: return BBM_E_TN_CTRL_SELECT; } if (tuner_ctrl->init(hDevice, 600, 0)) return BBM_E_TN_CTRL_INIT; tuner_i2c = type; return BBM_OK; } int tuner_ctrl_deselect(HANDLE hDevice) { if (tuner_ctrl == NULL) return BBM_E_TN_CTRL_SELECT; tuner_ctrl->deinit(hDevice); tuner_i2c = FCI_I2C_TYPE; tuner_ctrl = &fcii2c; return BBM_OK; } int tuner_i2c_read(HANDLE hDevice, u8 addr, u8 alen, u8 *data, u8 len) { if (tuner_ctrl == NULL) return BBM_E_TN_CTRL_SELECT; if (tuner_ctrl->read(hDevice, tuner_addr, addr, alen, data, len)) return BBM_E_TN_READ; return BBM_OK; } int tuner_i2c_write(HANDLE hDevice, u8 addr, u8 alen, u8 *data, u8 len) { if (tuner_ctrl == NULL) return BBM_E_TN_CTRL_SELECT; if (tuner_ctrl->write(hDevice, tuner_addr, addr, alen, data, len)) return BBM_E_TN_WRITE; return BBM_OK; } int tuner_set_freq(HANDLE hDevice, u32 freq) { if (tuner == NULL) { PRINTF(NULL, "[%s] BBM_E_TN_SELECT\n", __func__); return BBM_E_TN_SELECT; } #if (BBM_BAND_WIDTH == 8) freq -= 460; #else freq -= 380; #endif PRINTF(NULL, "[%s] tuner->set_freq (tuner_band)%d\n", __func__, tuner_band); if (tuner->set_freq(hDevice, tuner_band, freq)) { PRINTF(NULL, "[%s] BBM_E_TN_SET_FREQ\n", __func__); return BBM_E_TN_SET_FREQ; } fc8150_reset(hDevice); return BBM_OK; } int tuner_select(HANDLE hDevice, u32 product, u32 band) { switch (product) { case FC8150_TUNER: tuner = &fc8150_tuner; tuner_addr = FC8150_TUNER_ADDR; tuner_band = band; break; #if 0 case FC8151_TUNER: tuner = &fc8151_tuner; tuner_addr = FC8150_TUNER_ADDR; tuner_band = band; break; #endif default: return BBM_E_TN_SELECT; } if (tuner == NULL) return BBM_E_TN_SELECT; if (tuner_i2c == FCI_BYPASS_TYPE) bbm_write(hDevice, BBM_RF_DEVID, tuner_addr); if (tuner->init(hDevice, tuner_band)) return BBM_E_TN_INIT; return BBM_OK; } int tuner_deselect(HANDLE hDevice) { if (tuner == NULL) return BBM_E_TN_SELECT; if (tuner->deinit(hDevice)) return BBM_NOK; tuner = NULL; return BBM_OK; } int tuner_get_rssi(HANDLE hDevice, s32 *rssi) { if (tuner == NULL) return BBM_E_TN_SELECT; if (tuner->get_rssi(hDevice, rssi)) return BBM_E_TN_RSSI; return BBM_OK; }
#ifndef QT_NO_QT_INCLUDE_WARN #if defined(__GNUC__) #warning "Inclusion of header files from include/Qt is deprecated." #elif defined(_MSC_VER) #pragma message("WARNING: Inclusion of header files from include/Qt is deprecated.") #endif #endif #include "../QtGui/qstyle.h"
#include "../sysfs.h" /* Magnetometer types of attribute */ #define IIO_DEV_ATTR_MAGN_X_OFFSET(_mode, _show, _store, _addr) \ IIO_DEVICE_ATTR(magn_x_offset, _mode, _show, _store, _addr) #define IIO_DEV_ATTR_MAGN_Y_OFFSET(_mode, _show, _store, _addr) \ IIO_DEVICE_ATTR(magn_y_offset, _mode, _show, _store, _addr) #define IIO_DEV_ATTR_MAGN_Z_OFFSET(_mode, _show, _store, _addr) \ IIO_DEVICE_ATTR(magn_z_offset, _mode, _show, _store, _addr) #define IIO_DEV_ATTR_MAGN_X_GAIN(_mode, _show, _store, _addr) \ IIO_DEVICE_ATTR(magn_x_gain, _mode, _show, _store, _addr) #define IIO_DEV_ATTR_MAGN_Y_GAIN(_mode, _show, _store, _addr) \ IIO_DEVICE_ATTR(magn_y_gain, _mode, _show, _store, _addr) #define IIO_DEV_ATTR_MAGN_Z_GAIN(_mode, _show, _store, _addr) \ IIO_DEVICE_ATTR(magn_z_gain, _mode, _show, _store, _addr) #define IIO_DEV_ATTR_MAGN_X(_show, _addr) \ IIO_DEVICE_ATTR(magn_x_raw, S_IRUGO, _show, NULL, _addr) #define IIO_DEV_ATTR_MAGN_Y(_show, _addr) \ IIO_DEVICE_ATTR(magn_y_raw, S_IRUGO, _show, NULL, _addr) #define IIO_DEV_ATTR_MAGN_Z(_show, _addr) \ IIO_DEVICE_ATTR(magn_z_raw, S_IRUGO, _show, NULL, _addr)
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently. #pragma once #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers. #endif #include <windows.h> #include <d3d12.h> #include <dxgi1_4.h> #include <D3Dcompiler.h> #include <DirectXMath.h> #include "d3dx12.h" #include <string> #include <vector> #include <wrl.h>
/* Support routines for the intrinsic power (**) operator. Copyright 2004, 2007, 2009 Free Software Foundation, Inc. Contributed by Paul Brook This file is part of the GNU Fortran 95 runtime library (libgfortran). Libgfortran 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. Libgfortran is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "libgfortran.h" /* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_16) GFC_INTEGER_4 pow_i4_i16 (GFC_INTEGER_4 a, GFC_INTEGER_16 b); export_proto(pow_i4_i16); GFC_INTEGER_4 pow_i4_i16 (GFC_INTEGER_4 a, GFC_INTEGER_16 b) { GFC_INTEGER_4 pow, x; GFC_INTEGER_16 n; GFC_UINTEGER_16 u; n = b; x = a; pow = 1; if (n != 0) { if (n < 0) { if (x == 1) return 1; if (x == -1) return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; } else { u = n; } for (;;) { if (u & 1) pow *= x; u >>= 1; if (u) x *= x; else break; } } return pow; } #endif
/* * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #include "java_awt_Insets.h" #include "jni_util.h" #include "awt_Insets.h" struct InsetsIDs insetsIDs; JNIEXPORT void JNICALL Java_java_awt_Insets_initIDs(JNIEnv *env, jclass cls) { insetsIDs.top = (*env)->GetFieldID(env, cls, "top", "I"); insetsIDs.bottom = (*env)->GetFieldID(env, cls, "bottom", "I"); insetsIDs.left = (*env)->GetFieldID(env, cls, "left", "I"); insetsIDs.right = (*env)->GetFieldID(env, cls, "right", "I"); }
/* * Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module. * * ADDI-DATA GmbH * Dieselstrasse 3 * D-77833 Ottersweier * Tel: +19(0)7223/9493-0 * Fax: +49(0)7223/9493-92 * http://www.addi-data-com * info@addi-data.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. */ #ifndef COMEDI_SUBD_TTLIO #define COMEDI_SUBD_TTLIO 11 /* Digital Input Output But TTL */ #endif #ifndef ADDIDATA_ENABLE #define ADDIDATA_ENABLE 1 #define ADDIDATA_DISABLE 0 #endif #define APCI16XX_TTL_INIT 0 #define APCI16XX_TTL_INITDIRECTION 1 #define APCI16XX_TTL_OUTPUTMEMORY 2 #define APCI16XX_TTL_READCHANNEL 0 #define APCI16XX_TTL_READPORT 1 #define APCI16XX_TTL_WRITECHANNEL_ON 0 #define APCI16XX_TTL_WRITECHANNEL_OFF 1 #define APCI16XX_TTL_WRITEPORT_ON 2 #define APCI16XX_TTL_WRITEPORT_OFF 3 #define APCI16XX_TTL_READ_ALL_INPUTS 0 #define APCI16XX_TTL_READ_ALL_OUTPUTS 1 #ifdef __KERNEL__ static const struct comedi_lrange range_apci16xx_ttl = { 12, {BIP_RANGE(1), BIP_RANGE(1), BIP_RANGE(1), BIP_RANGE(1), BIP_RANGE(1), BIP_RANGE(1), BIP_RANGE(1), BIP_RANGE(1), BIP_RANGE(1), BIP_RANGE(1), BIP_RANGE(1), BIP_RANGE(1)} }; /* +----------------------------------------------------------------------------+ | TTL INISIALISATION FUNCTION | +----------------------------------------------------------------------------+ */ int i_APCI16XX_InsnConfigInitTTLIO(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data); /* +----------------------------------------------------------------------------+ | TTL INPUT FUNCTION | +----------------------------------------------------------------------------+ */ int i_APCI16XX_InsnBitsReadTTLIO(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data); int i_APCI16XX_InsnReadTTLIOAllPortValue(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data); /* +----------------------------------------------------------------------------+ | TTL OUTPUT FUNCTIONS | +----------------------------------------------------------------------------+ */ int i_APCI16XX_InsnBitsWriteTTLIO(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data); int i_APCI16XX_Reset(struct comedi_device *dev); #endif
// SPDX-License-Identifier: GPL-2.0-only /* * pata_ninja32.c - Ninja32 PATA for new ATA layer * (C) 2007 Red Hat Inc * * Note: The controller like many controllers has shared timings for * PIO and DMA. We thus flip to the DMA timings in dma_start and flip back * in the dma_stop function. Thus we actually don't need a set_dmamode * method as the PIO method is always called and will set the right PIO * timing parameters. * * The Ninja32 Cardbus is not a generic SFF controller. Instead it is * laid out as follows off BAR 0. This is based upon Mark Lord's delkin * driver and the extensive analysis done by the BSD developers, notably * ITOH Yasufumi. * * Base + 0x00 IRQ Status * Base + 0x01 IRQ control * Base + 0x02 Chipset control * Base + 0x03 Unknown * Base + 0x04 VDMA and reset control + wait bits * Base + 0x08 BMIMBA * Base + 0x0C DMA Length * Base + 0x10 Taskfile * Base + 0x18 BMDMA Status ? * Base + 0x1C * Base + 0x1D Bus master control * bit 0 = enable * bit 1 = 0 write/1 read * bit 2 = 1 sgtable * bit 3 = go * bit 4-6 wait bits * bit 7 = done * Base + 0x1E AltStatus * Base + 0x1F timing register */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/blkdev.h> #include <linux/delay.h> #include <scsi/scsi_host.h> #include <linux/libata.h> #define DRV_NAME "pata_ninja32" #define DRV_VERSION "0.1.5" /** * ninja32_set_piomode - set initial PIO mode data * @ap: ATA interface * @adev: ATA device * * Called to do the PIO mode setup. Our timing registers are shared * but we want to set the PIO timing by default. */ static void ninja32_set_piomode(struct ata_port *ap, struct ata_device *adev) { static u16 pio_timing[5] = { 0xd6, 0x85, 0x44, 0x33, 0x13 }; iowrite8(pio_timing[adev->pio_mode - XFER_PIO_0], ap->ioaddr.bmdma_addr + 0x1f); ap->private_data = adev; } static void ninja32_dev_select(struct ata_port *ap, unsigned int device) { struct ata_device *adev = &ap->link.device[device]; if (ap->private_data != adev) { iowrite8(0xd6, ap->ioaddr.bmdma_addr + 0x1f); ata_sff_dev_select(ap, device); ninja32_set_piomode(ap, adev); } } static struct scsi_host_template ninja32_sht = { ATA_BMDMA_SHT(DRV_NAME), }; static struct ata_port_operations ninja32_port_ops = { .inherits = &ata_bmdma_port_ops, .sff_dev_select = ninja32_dev_select, .cable_detect = ata_cable_40wire, .set_piomode = ninja32_set_piomode, .sff_data_xfer = ata_sff_data_xfer32 }; static void ninja32_program(void __iomem *base) { iowrite8(0x05, base + 0x01); /* Enable interrupt lines */ iowrite8(0xBE, base + 0x02); /* Burst, ?? setup */ iowrite8(0x01, base + 0x03); /* Unknown */ iowrite8(0x20, base + 0x04); /* WAIT0 */ iowrite8(0x8f, base + 0x05); /* Unknown */ iowrite8(0xa4, base + 0x1c); /* Unknown */ iowrite8(0x83, base + 0x1d); /* BMDMA control: WAIT0 */ } static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) { struct ata_host *host; struct ata_port *ap; void __iomem *base; int rc; host = ata_host_alloc(&dev->dev, 1); if (!host) return -ENOMEM; ap = host->ports[0]; /* Set up the PCI device */ rc = pcim_enable_device(dev); if (rc) return rc; rc = pcim_iomap_regions(dev, 1 << 0, DRV_NAME); if (rc == -EBUSY) pcim_pin_device(dev); if (rc) return rc; host->iomap = pcim_iomap_table(dev); rc = dma_set_mask(&dev->dev, ATA_DMA_MASK); if (rc) return rc; rc = dma_set_coherent_mask(&dev->dev, ATA_DMA_MASK); if (rc) return rc; pci_set_master(dev); /* Set up the register mappings. We use the I/O mapping as only the older chips also have MMIO on BAR 1 */ base = host->iomap[0]; if (!base) return -ENOMEM; ap->ops = &ninja32_port_ops; ap->pio_mask = ATA_PIO4; ap->flags |= ATA_FLAG_SLAVE_POSS; ap->ioaddr.cmd_addr = base + 0x10; ap->ioaddr.ctl_addr = base + 0x1E; ap->ioaddr.altstatus_addr = base + 0x1E; ap->ioaddr.bmdma_addr = base; ata_sff_std_ports(&ap->ioaddr); ap->pflags |= ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE; ninja32_program(base); /* FIXME: Should we disable them at remove ? */ return ata_host_activate(host, dev->irq, ata_bmdma_interrupt, IRQF_SHARED, &ninja32_sht); } #ifdef CONFIG_PM_SLEEP static int ninja32_reinit_one(struct pci_dev *pdev) { struct ata_host *host = pci_get_drvdata(pdev); int rc; rc = ata_pci_device_do_resume(pdev); if (rc) return rc; ninja32_program(host->iomap[0]); ata_host_resume(host); return 0; } #endif static const struct pci_device_id ninja32[] = { { 0x10FC, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { 0x1145, 0x8008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { 0x1145, 0xf008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { 0x1145, 0xf021, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { 0x1145, 0xf024, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { 0x1145, 0xf02C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { }, }; static struct pci_driver ninja32_pci_driver = { .name = DRV_NAME, .id_table = ninja32, .probe = ninja32_init_one, .remove = ata_pci_remove_one, #ifdef CONFIG_PM_SLEEP .suspend = ata_pci_device_suspend, .resume = ninja32_reinit_one, #endif }; module_pci_driver(ninja32_pci_driver); MODULE_AUTHOR("Alan Cox"); MODULE_DESCRIPTION("low-level driver for Ninja32 ATA"); MODULE_LICENSE("GPL"); MODULE_DEVICE_TABLE(pci, ninja32); MODULE_VERSION(DRV_VERSION);
#include <stdlib.h> #include <string.h> #include <errno.h> #include <stdio.h> #include <sys/signal.h> #include <sys/wait.h> #include <unistd.h> #ifdef __ARCH_USE_MMU__ static void test_handler(int signo) { write(1, "caught SIGCHLD\n", 15); return; } int main(void) { pid_t mypid; struct sigaction siga; static sigset_t set; /* Set up sighandling */ sigfillset(&set); siga.sa_handler = test_handler; siga.sa_mask = set; siga.sa_flags = 0; if (sigaction(SIGCHLD, &siga, (struct sigaction *)NULL) != 0) { fprintf(stderr, "sigaction choked: %s!", strerror(errno)); exit(EXIT_FAILURE); } /* Setup a child process to exercise the sig handling for us */ mypid = getpid(); if (fork() == 0) { int i; for (i=0; i < 3; i++) { sleep(2); kill(mypid, SIGCHLD); } _exit(EXIT_SUCCESS); } /* Wait for signals */ write(1, "waiting for a SIGCHLD\n",22); for(;;) { sleep(10); if (waitpid(-1, NULL, WNOHANG | WUNTRACED) > 0) break; write(1, "after sleep\n", 12); } printf("Bye-bye! All done!\n"); return 0; } #else int main(void) { printf("Skipping test on non-mmu host!\n"); return 0; } #endif
#include <stdio.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/sem.h> int main(void) { int k, r; union semun { int val; struct semid_ds *buf; unsigned short int *array; struct seminfo *__buf; } sd; struct semid_ds sd_buf; k = semget(IPC_PRIVATE, 10, IPC_CREAT | 0666 ); printf("semget(IPC_CREAT) = %d\n", k); if (k < 0) { fprintf(stderr, "semget failed: %s\n", strerror(errno)); return 1; } sd.buf = &sd_buf; r = semctl(k, 0, IPC_STAT, sd); printf("semctl(k) = %d\n", r); if (r < 0) { perror("semctl IPC_STAT failed"); return 1; } printf("sem_nsems = %lu\n", sd_buf.sem_nsems); if (sd_buf.sem_nsems != 10) { fprintf(stderr, "failed: incorrect sem_nsems!\n"); return 1; } printf("succeeded\n"); return 0; }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_RENDERER_H_ #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_RENDERER_H_ #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "content/common/content_export.h" #include "content/common/media/video_capture.h" #include "content/public/renderer/media_stream_video_sink.h" #include "content/renderer/media/video_frame_provider.h" #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" #include "ui/gfx/size.h" namespace base { class MessageLoopProxy; } namespace content { // RTCVideoRenderer is a VideoFrameProvider designed for rendering // Video MediaStreamTracks, // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastreamtrack // RTCVideoRenderer implements VideoTrackSink in order to render // video frames provided from a VideoTrack. // RTCVideoRenderer register itself as a sink to the VideoTrack when the // VideoFrameProvider is started and deregisters itself when it is stopped. // TODO(wuchengli): Add unit test. See the link below for reference. // http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/rtc_vi // deo_decoder_unittest.cc?revision=180591&view=markup class CONTENT_EXPORT RTCVideoRenderer : NON_EXPORTED_BASE(public VideoFrameProvider), NON_EXPORTED_BASE(public MediaStreamVideoSink) { public: RTCVideoRenderer(const blink::WebMediaStreamTrack& video_track, const base::Closure& error_cb, const RepaintCB& repaint_cb); // VideoFrameProvider implementation. Called on the main thread. virtual void Start() OVERRIDE; virtual void Stop() OVERRIDE; virtual void Play() OVERRIDE; virtual void Pause() OVERRIDE; protected: virtual ~RTCVideoRenderer(); private: enum State { STARTED, PAUSED, STOPPED, }; void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame, const media::VideoCaptureFormat& format, const base::TimeTicks& estimated_capture_time); // VideoTrackSink implementation. Called on the main thread. virtual void OnReadyStateChanged( blink::WebMediaStreamSource::ReadyState state) OVERRIDE; void RenderSignalingFrame(); base::Closure error_cb_; RepaintCB repaint_cb_; scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; State state_; gfx::Size frame_size_; blink::WebMediaStreamTrack video_track_; base::WeakPtrFactory<RTCVideoRenderer> weak_factory_; DISALLOW_COPY_AND_ASSIGN(RTCVideoRenderer); }; } // namespace content #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_RENDERER_H_
/* Copyright (C) 2013-2014 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* This file is not actually compiled, the .S file is committed alongside this file. The reason is that changes to the compiler might result in different debug information being created, this could break the test. */ struct str { int a; int b; int c : 3; int d : 3; }; int __attribute__ ((noinline)) foo (int arg) { return arg; } int main ( void ) { struct str s = {5, 7, 1, 2}; int v; v = (s.a << 1); v += foo (v); return v + 5 + s.a; }