text stringlengths 4 6.14k |
|---|
/**
* \file arc4.h
*
* \brief The ARCFOUR stream cipher
*
* Copyright (C) 2006-2014, ARM Limited, All Rights Reserved
*
* This file is part of mbed TLS (https://polarssl.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef POLARSSL_ARC4_H
#define POLARSSL_ARC4_H
#if !defined(POLARSSL_CONFIG_FILE)
#include "config.h"
#else
#include POLARSSL_CONFIG_FILE
#endif
#include <string.h>
#if !defined(POLARSSL_ARC4_ALT)
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief ARC4 context structure
*/
typedef struct
{
int x; /*!< permutation index */
int y; /*!< permutation index */
unsigned char m[256]; /*!< permutation table */
}
arc4_context;
/**
* \brief Initialize ARC4 context
*
* \param ctx ARC4 context to be initialized
*/
void arc4_init( arc4_context *ctx );
/**
* \brief Clear ARC4 context
*
* \param ctx ARC4 context to be cleared
*/
void arc4_free( arc4_context *ctx );
/**
* \brief ARC4 key schedule
*
* \param ctx ARC4 context to be setup
* \param key the secret key
* \param keylen length of the key, in bytes
*/
void arc4_setup( arc4_context *ctx, const unsigned char *key,
unsigned int keylen );
/**
* \brief ARC4 cipher function
*
* \param ctx ARC4 context
* \param length length of the input data
* \param input buffer holding the input data
* \param output buffer for the output data
*
* \return 0 if successful
*/
int arc4_crypt( arc4_context *ctx, size_t length, const unsigned char *input,
unsigned char *output );
#ifdef __cplusplus
}
#endif
#else /* POLARSSL_ARC4_ALT */
#include "arc4_alt.h"
#endif /* POLARSSL_ARC4_ALT */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Checkup routine
*
* \return 0 if successful, or 1 if the test failed
*/
int arc4_self_test( int verbose );
#ifdef __cplusplus
}
#endif
#endif /* arc4.h */
|
/*
* Copyright (C) 2006 Justin Karneges
*
* 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 JDNS_PACKET_H
#define JDNS_PACKET_H
#include "jdns.h"
// -- howto --
//
// writing packets:
// 1) call jdns_packet_new()
// 2) populate the jdns_packet_t structure, using the functions
// as necessary
// 3) call jdns_packet_export() to populate the raw data of the packet
//
// reading packets:
// 1) call jdns_packet_new()
// 2) call jdns_packet_import() with the raw data
// 3) the jdns_packet_t structure is now populated
//
// IMPORTANT: all names must be valid. that is, ending in a dot character
int jdns_packet_name_isvalid(const unsigned char *name, int size); // 0 if not valid
typedef struct jdns_packet_question
{
JDNS_OBJECT
jdns_string_t *qname;
unsigned short int qtype, qclass;
} jdns_packet_question_t;
jdns_packet_question_t *jdns_packet_question_new();
jdns_packet_question_t *jdns_packet_question_copy(const jdns_packet_question_t *a);
void jdns_packet_question_delete(jdns_packet_question_t *a);
typedef struct jdns_packet_write jdns_packet_write_t;
typedef struct jdns_packet jdns_packet_t;
typedef struct jdns_packet_resource
{
JDNS_OBJECT
jdns_string_t *qname;
unsigned short int qtype, qclass;
unsigned long int ttl; // 31-bit number, top bit always 0
unsigned short int rdlength;
unsigned char *rdata;
// private
jdns_list_t *writelog; // jdns_packet_write_t
} jdns_packet_resource_t;
jdns_packet_resource_t *jdns_packet_resource_new();
jdns_packet_resource_t *jdns_packet_resource_copy(const jdns_packet_resource_t *a);
void jdns_packet_resource_delete(jdns_packet_resource_t *a);
void jdns_packet_resource_add_bytes(jdns_packet_resource_t *a, const unsigned char *data, int size);
void jdns_packet_resource_add_name(jdns_packet_resource_t *a, const jdns_string_t *name);
int jdns_packet_resource_read_name(const jdns_packet_resource_t *a, const jdns_packet_t *p, int *at, jdns_string_t **name);
struct jdns_packet
{
JDNS_OBJECT
unsigned short int id;
struct
{
unsigned short qr, opcode, aa, tc, rd, ra, z, rcode;
} opts;
// item counts as specified by the packet. do not use these
// for iteration over the item lists, since they can be wrong
// if the packet is truncated.
int qdcount, ancount, nscount, arcount;
// value lists
jdns_list_t *questions; // jdns_packet_question_t
jdns_list_t *answerRecords; // jdns_packet_resource_t
jdns_list_t *authorityRecords; // jdns_packet_resource_t
jdns_list_t *additionalRecords; // jdns_packet_resource_t
// since dns packets are allowed to be truncated, it is possible
// for a packet to not get fully parsed yet still be considered
// successfully parsed. this flag means the packet was fully
// parsed also.
int fully_parsed;
int raw_size;
unsigned char *raw_data;
};
jdns_packet_t *jdns_packet_new();
jdns_packet_t *jdns_packet_copy(const jdns_packet_t *a);
void jdns_packet_delete(jdns_packet_t *a);
int jdns_packet_import(jdns_packet_t **a, const unsigned char *data, int size); // 0 on fail
int jdns_packet_export(jdns_packet_t *a, int maxsize); // 0 on fail
#endif
|
/******************************************************************************
*
* Copyright (C) 2010 - 2015 Xilinx, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* Use of the Software is limited solely to applications:
* (a) running on a Xilinx device, or
* (b) that interact with a Xilinx device through a bus or interconnect.
*
* 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
* XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the Xilinx shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
/*****************************************************************************/
/**
* @file xbram_sinit.c
* @addtogroup bram_v4_0
* @{
*
* The implementation of the XBram driver's static initialzation
* functionality.
*
* @note
*
* None
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver Who Date Changes
* ----- ---- -------- -----------------------------------------------
* 2.01a jvb 10/13/05 First release
* 2.11a mta 03/21/07 Updated to new coding style
* </pre>
*
*****************************************************************************/
/***************************** Include Files ********************************/
#include "xstatus.h"
#include "xparameters.h"
#include "xbram.h"
/************************** Constant Definitions ****************************/
/**************************** Type Definitions ******************************/
/***************** Macros (Inline Functions) Definitions ********************/
/************************** Variable Definitions ****************************/
extern XBram_Config XBram_ConfigTable[];
/************************** Function Prototypes *****************************/
/*****************************************************************************/
/**
* Lookup the device configuration based on the unique device ID. The table
* ConfigTable contains the configuration info for each device in the system.
*
* @param DeviceId is the device identifier to lookup.
*
* @return
* - A pointer of data type XBram_Config which
* points to the device configuration if DeviceID is found.
* - NULL if DeviceID is not found.
*
* @note None.
*
******************************************************************************/
XBram_Config *XBram_LookupConfig(u16 DeviceId)
{
XBram_Config *CfgPtr = NULL;
int Index;
for (Index = 0; Index < XPAR_XBRAM_NUM_INSTANCES; Index++) {
if (XBram_ConfigTable[Index].DeviceId == DeviceId) {
CfgPtr = &XBram_ConfigTable[Index];
break;
}
}
return CfgPtr;
}
/** @} */
|
/*
* Australian Public Licence B (OZPLB)
*
* Version 1-0
*
* Copyright (c) 2004 University of New South Wales
*
* All rights reserved.
*
* Developed by: Operating Systems and Distributed Systems Group (DiSy)
* University of New South Wales
* http://www.disy.cse.unsw.edu.au
*
* Permission is granted by University of New South Wales, free of charge, to
* any person obtaining a copy of this software and any associated
* documentation files (the "Software") to deal with the Software without
* restriction, including (without limitation) the rights to use, copy,
* modify, adapt, merge, publish, distribute, communicate to the public,
* sublicense, and/or sell, lend or rent out copies of the Software, and
* to permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimers.
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimers in the documentation and/or other materials provided
* with the distribution.
*
* * Neither the name of University of New South Wales, nor the names of its
* contributors, may be used to endorse or promote products derived
* from this Software without specific prior written permission.
*
* EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT
* PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND
* NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS,
* WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS
* REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE,
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT,
* THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF
* ERRORS, WHETHER OR NOT DISCOVERABLE.
*
* TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL
* NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL
* THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER
* LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR
* OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS
* OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR
* OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT,
* CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN
* CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER
* DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS
* CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS,
* DAMAGES OR OTHER LIABILITY.
*
* If applicable legislation implies representations, warranties, or
* conditions, or imposes obligations or liability on University of New South
* Wales or one of its contributors in respect of the Software that
* cannot be wholly or partly excluded, restricted or modified, the
* liability of University of New South Wales or the contributor is limited, to
* the full extent permitted by the applicable legislation, at its
* option, to:
* a. in the case of goods, any one or more of the following:
* i. the replacement of the goods or the supply of equivalent goods;
* ii. the repair of the goods;
* iii. the payment of the cost of replacing the goods or of acquiring
* equivalent goods;
* iv. the payment of the cost of having the goods repaired; or
* b. in the case of services:
* i. the supplying of the services again; or
* ii. the payment of the cost of having the services supplied again.
*
* The construction, validity and performance of this licence is governed
* by the laws in force in New South Wales, Australia.
*/
/*
Author: Cristan Szmadja
*/
#include <string.h>
char *
strcpy(char *d, const char *s)
{
size_t i;
for (i = 0; (d[i] = s[i]) != '\0'; i++);
return d;
}
|
// ==========================================================================
// SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2016, Knut Reinert, FU Berlin
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of Knut Reinert or the FU Berlin nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ==========================================================================
// Author: Tobias Raussch <rausch@embl.de>
// ==========================================================================
// Implementation of Path-Growing algorithm.
//
// WARNING: Functionality not carefully tested!
// ==========================================================================
#ifndef INCLUDE_SEQAN_GRAPH_ALGORITHMS_PATH_GROWING_H_
#define INCLUDE_SEQAN_GRAPH_ALGORITHMS_PATH_GROWING_H_
namespace seqan {
// ============================================================================
// Forwards
// ============================================================================
// ============================================================================
// Tags, Classes, Enums
// ============================================================================
// ============================================================================
// Metafunctions
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
// ----------------------------------------------------------------------------
// Functions
// ----------------------------------------------------------------------------
template <typename TSpec, typename TWeightMap, typename TEdgeMap>
typename Value<TWeightMap>::Type
pathGrowingAlgorithm(TEdgeMap & edgeMap1,
Graph<TSpec> const & g,
TWeightMap const & weightMap)
{
typedef Graph<TSpec> TGraph;
typedef typename Value<TWeightMap>::Type TValue;
typedef typename Size<Graph<TSpec> >::Type TSize;
typedef typename EdgeDescriptor<TGraph>::Type TEdgeDescriptor;
typedef typename VertexDescriptor<TGraph>::Type TVertexDescriptor;
typedef typename Iterator<TGraph, VertexIterator>::Type TVertexIterator;
typedef typename Iterator<TGraph, OutEdgeIterator>::Type TOutEdgeIterator;
// Make a copy of the graph
TGraph mutant(g);
// Initialy not a single edge is selected
resize(edgeMap1, getIdUpperBound(_getEdgeIdManager(g)), false);
TEdgeMap edgeMap2 = edgeMap1;
TValue edgeMap1Sum = 0;
TValue edgeMap2Sum = 0;
// Run the algorithm
TSize i = 1;
while (numEdges(mutant) > 0) {
TVertexIterator itVert(mutant);
while (outDegree(mutant, *itVert) < 1) goNext(itVert);
TVertexDescriptor x = *itVert;
TVertexDescriptor y;
while (outDegree(mutant, x) >= 1) {
TOutEdgeIterator itOut(mutant, x);
TEdgeDescriptor e = *itOut;
TValue max = getProperty(weightMap, e);
y = targetVertex(itOut);
goNext(itOut);
for(;!atEnd(itOut);++itOut) {
if (getProperty(weightMap, *itOut) > max) {
e = *itOut;
max = getProperty(weightMap, e);
y = targetVertex(itOut);
}
}
if (i == 1) {
// Mark the edge for m1
assignProperty(edgeMap1, e, true);
edgeMap1Sum += max;
} else {
// Mark the edge for m2
assignProperty(edgeMap2, e, true);
edgeMap2Sum += max;
}
i = 3 - i;
removeVertex(mutant, x);
x = y;
}
}
// Check whether we have to swap bool arrays
if (edgeMap2Sum > edgeMap1Sum) {
edgeMap1Sum = edgeMap2Sum;
edgeMap1 = edgeMap2;
}
return edgeMap1Sum;
}
} // namespace seqan
#endif // #ifndef INCLUDE_SEQAN_GRAPH_ALGORITHMS_PATH_GROWING_H_
|
/////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/collpaneg.h
// Purpose: wxGenericCollapsiblePane
// Author: Francesco Montorsi
// Modified by:
// Created: 8/10/2006
// RCS-ID: $Id$
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLLAPSABLE_PANE_H_GENERIC_
#define _WX_COLLAPSABLE_PANE_H_GENERIC_
// forward declared
class WXDLLIMPEXP_FWD_CORE wxButton;
class WXDLLIMPEXP_FWD_CORE wxStaticLine;
#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__)
class WXDLLIMPEXP_FWD_CORE wxDisclosureTriangle;
#endif
#include "wx/containr.h"
// ----------------------------------------------------------------------------
// wxGenericCollapsiblePane
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGenericCollapsiblePane : public wxCollapsiblePaneBase
{
public:
wxGenericCollapsiblePane() { Init(); }
wxGenericCollapsiblePane(wxWindow *parent,
wxWindowID winid,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCP_DEFAULT_STYLE,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxCollapsiblePaneNameStr)
{
Init();
Create(parent, winid, label, pos, size, style, val, name);
}
virtual ~wxGenericCollapsiblePane();
bool Create(wxWindow *parent,
wxWindowID winid,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCP_DEFAULT_STYLE,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxCollapsiblePaneNameStr);
// public wxCollapsiblePane API
virtual void Collapse(bool collapse = true);
virtual void SetLabel(const wxString &label);
virtual bool IsCollapsed() const
{ return m_pPane==NULL || !m_pPane->IsShown(); }
virtual wxWindow *GetPane() const
{ return m_pPane; }
virtual wxString GetLabel() const
{ return m_strLabel; }
virtual bool Layout();
// for the generic collapsible pane only:
wxControl* GetControlWidget() const
{ return (wxControl*)m_pButton; }
// implementation only, don't use
void OnStateChange(const wxSize& sizeNew);
protected:
// overridden methods
virtual wxSize DoGetBestSize() const;
wxString GetBtnLabel() const;
int GetBorder() const;
// child controls
#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__)
wxDisclosureTriangle *m_pButton;
#else
wxButton *m_pButton;
#endif
wxStaticLine *m_pStaticLine;
wxWindow *m_pPane;
wxSizer *m_sz;
// the button label without ">>" or "<<"
wxString m_strLabel;
private:
void Init();
// event handlers
void OnButton(wxCommandEvent &ev);
void OnSize(wxSizeEvent &ev);
WX_DECLARE_CONTROL_CONTAINER();
DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane)
DECLARE_EVENT_TABLE()
};
#endif // _WX_COLLAPSABLE_PANE_H_GENERIC_
|
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009 CTTC
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Nicola Baldo <nbaldo@cttc.es>
*/
#ifndef WIFI_SPECTRUM_VALUE_HELPER_H
#define WIFI_SPECTRUM_VALUE_HELPER_H
#include <ns3/spectrum-value.h>
namespace ns3 {
/**
* this abstract class defines the interface for interacting with all WifiSpectrumValue implementations.
*
*/
class WifiSpectrumValueHelper
{
public:
virtual ~WifiSpectrumValueHelper ();
/*
*
* @param value the constant value
*
* @return a Ptr to a newly created SpectrumValue instance which
* has a constant value for all frequencies
*/
virtual Ptr<SpectrumValue> CreateConstant (double psd) = 0;
/*
*
* @param txPower the total TX power in W
* @param channel the number of the channel
*
* @return a Ptr to a newly created SpectrumValue instance which
* represents the TX Power Spectral Density of a wifi device
* corresponding to the provided parameters
*/
virtual Ptr<SpectrumValue> CreateTxPowerSpectralDensity (double txPower, uint32_t channel) = 0;
/*
*
* @param channel the number of the channel
*
* @return a Ptr to a newly created SpectrumValue instance which
* represents the frequency response of the RF filter which is used
* by a wifi device to receive signals when tuned to a particular channel
*/
virtual Ptr<SpectrumValue> CreateRfFilter (uint32_t channel) = 0;
};
/**
* Implements WifiSpectrumValue for the 2.4 GHz ISM band only, with a
* 5 MHz spectrum resolution.
*
*/
class WifiSpectrumValue5MhzFactory
{
public:
virtual ~WifiSpectrumValue5MhzFactory ();
// inherited from WifiSpectrumValue
virtual Ptr<SpectrumValue> CreateConstant (double psd);
virtual Ptr<SpectrumValue> CreateTxPowerSpectralDensity (double txPower, uint32_t channel);
virtual Ptr<SpectrumValue> CreateRfFilter (uint32_t channel);
};
} //namespace ns3
#endif /* WIFI_SPECTRUM_VALUE_HELPER_H */
|
/* Conversion from and to CP772.
Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
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 <stdint.h>
/* Specify the conversion table. */
#define TABLES <cp772.h>
#define CHARSET_NAME "CP772//"
#define HAS_HOLES 0 /* All 256 character are defined. */
#include <8bit-gap.c>
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2020 Google LLC
* Author: Quentin Perret <qperret@google.com>
*/
#include <linux/kvm_host.h>
#include <asm/kvm_hyp.h>
#include <asm/kvm_mmu.h>
#include <asm/kvm_pgtable.h>
#include <nvhe/early_alloc.h>
#include <nvhe/gfp.h>
#include <nvhe/memory.h>
#include <nvhe/mem_protect.h>
#include <nvhe/mm.h>
#include <nvhe/trap_handler.h>
struct hyp_pool hpool;
unsigned long hyp_nr_cpus;
#define hyp_percpu_size ((unsigned long)__per_cpu_end - \
(unsigned long)__per_cpu_start)
static void *vmemmap_base;
static void *hyp_pgt_base;
static void *host_s2_mem_pgt_base;
static void *host_s2_dev_pgt_base;
static struct kvm_pgtable_mm_ops pkvm_pgtable_mm_ops;
static int divide_memory_pool(void *virt, unsigned long size)
{
unsigned long vstart, vend, nr_pages;
hyp_early_alloc_init(virt, size);
hyp_vmemmap_range(__hyp_pa(virt), size, &vstart, &vend);
nr_pages = (vend - vstart) >> PAGE_SHIFT;
vmemmap_base = hyp_early_alloc_contig(nr_pages);
if (!vmemmap_base)
return -ENOMEM;
nr_pages = hyp_s1_pgtable_pages();
hyp_pgt_base = hyp_early_alloc_contig(nr_pages);
if (!hyp_pgt_base)
return -ENOMEM;
nr_pages = host_s2_mem_pgtable_pages();
host_s2_mem_pgt_base = hyp_early_alloc_contig(nr_pages);
if (!host_s2_mem_pgt_base)
return -ENOMEM;
nr_pages = host_s2_dev_pgtable_pages();
host_s2_dev_pgt_base = hyp_early_alloc_contig(nr_pages);
if (!host_s2_dev_pgt_base)
return -ENOMEM;
return 0;
}
static int recreate_hyp_mappings(phys_addr_t phys, unsigned long size,
unsigned long *per_cpu_base,
u32 hyp_va_bits)
{
void *start, *end, *virt = hyp_phys_to_virt(phys);
unsigned long pgt_size = hyp_s1_pgtable_pages() << PAGE_SHIFT;
int ret, i;
/* Recreate the hyp page-table using the early page allocator */
hyp_early_alloc_init(hyp_pgt_base, pgt_size);
ret = kvm_pgtable_hyp_init(&pkvm_pgtable, hyp_va_bits,
&hyp_early_alloc_mm_ops);
if (ret)
return ret;
ret = hyp_create_idmap(hyp_va_bits);
if (ret)
return ret;
ret = hyp_map_vectors();
if (ret)
return ret;
ret = hyp_back_vmemmap(phys, size, hyp_virt_to_phys(vmemmap_base));
if (ret)
return ret;
ret = pkvm_create_mappings(__hyp_text_start, __hyp_text_end, PAGE_HYP_EXEC);
if (ret)
return ret;
ret = pkvm_create_mappings(__start_rodata, __end_rodata, PAGE_HYP_RO);
if (ret)
return ret;
ret = pkvm_create_mappings(__hyp_rodata_start, __hyp_rodata_end, PAGE_HYP_RO);
if (ret)
return ret;
ret = pkvm_create_mappings(__hyp_bss_start, __hyp_bss_end, PAGE_HYP);
if (ret)
return ret;
ret = pkvm_create_mappings(__hyp_bss_end, __bss_stop, PAGE_HYP_RO);
if (ret)
return ret;
ret = pkvm_create_mappings(virt, virt + size, PAGE_HYP);
if (ret)
return ret;
for (i = 0; i < hyp_nr_cpus; i++) {
start = (void *)kern_hyp_va(per_cpu_base[i]);
end = start + PAGE_ALIGN(hyp_percpu_size);
ret = pkvm_create_mappings(start, end, PAGE_HYP);
if (ret)
return ret;
end = (void *)per_cpu_ptr(&kvm_init_params, i)->stack_hyp_va;
start = end - PAGE_SIZE;
ret = pkvm_create_mappings(start, end, PAGE_HYP);
if (ret)
return ret;
}
return 0;
}
static void update_nvhe_init_params(void)
{
struct kvm_nvhe_init_params *params;
unsigned long i;
for (i = 0; i < hyp_nr_cpus; i++) {
params = per_cpu_ptr(&kvm_init_params, i);
params->pgd_pa = __hyp_pa(pkvm_pgtable.pgd);
__flush_dcache_area(params, sizeof(*params));
}
}
static void *hyp_zalloc_hyp_page(void *arg)
{
return hyp_alloc_pages(&hpool, 0);
}
void __noreturn __pkvm_init_finalise(void)
{
struct kvm_host_data *host_data = this_cpu_ptr(&kvm_host_data);
struct kvm_cpu_context *host_ctxt = &host_data->host_ctxt;
unsigned long nr_pages, reserved_pages, pfn;
int ret;
/* Now that the vmemmap is backed, install the full-fledged allocator */
pfn = hyp_virt_to_pfn(hyp_pgt_base);
nr_pages = hyp_s1_pgtable_pages();
reserved_pages = hyp_early_alloc_nr_used_pages();
ret = hyp_pool_init(&hpool, pfn, nr_pages, reserved_pages);
if (ret)
goto out;
ret = kvm_host_prepare_stage2(host_s2_mem_pgt_base, host_s2_dev_pgt_base);
if (ret)
goto out;
pkvm_pgtable_mm_ops = (struct kvm_pgtable_mm_ops) {
.zalloc_page = hyp_zalloc_hyp_page,
.phys_to_virt = hyp_phys_to_virt,
.virt_to_phys = hyp_virt_to_phys,
.get_page = hyp_get_page,
.put_page = hyp_put_page,
};
pkvm_pgtable.mm_ops = &pkvm_pgtable_mm_ops;
out:
/*
* We tail-called to here from handle___pkvm_init() and will not return,
* so make sure to propagate the return value to the host.
*/
cpu_reg(host_ctxt, 1) = ret;
__host_enter(host_ctxt);
}
int __pkvm_init(phys_addr_t phys, unsigned long size, unsigned long nr_cpus,
unsigned long *per_cpu_base, u32 hyp_va_bits)
{
struct kvm_nvhe_init_params *params;
void *virt = hyp_phys_to_virt(phys);
void (*fn)(phys_addr_t params_pa, void *finalize_fn_va);
int ret;
if (!PAGE_ALIGNED(phys) || !PAGE_ALIGNED(size))
return -EINVAL;
hyp_spin_lock_init(&pkvm_pgd_lock);
hyp_nr_cpus = nr_cpus;
ret = divide_memory_pool(virt, size);
if (ret)
return ret;
ret = recreate_hyp_mappings(phys, size, per_cpu_base, hyp_va_bits);
if (ret)
return ret;
update_nvhe_init_params();
/* Jump in the idmap page to switch to the new page-tables */
params = this_cpu_ptr(&kvm_init_params);
fn = (typeof(fn))__hyp_pa(__pkvm_init_switch_pgd);
fn(__hyp_pa(params), __pkvm_init_finalise);
unreachable();
}
|
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/syscalls.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/smp.h>
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/shm.h>
#include <linux/stat.h>
#include <linux/mman.h>
#include <linux/file.h>
#include <linux/utsname.h>
#include <linux/personality.h>
#include <linux/random.h>
#include <linux/uaccess.h>
#include <linux/elf.h>
#include <asm/ia32.h>
#include <asm/syscalls.h>
/*
* Align a virtual address to avoid aliasing in the I$ on AMD F15h.
*/
static unsigned long get_align_mask(void)
{
/* handle 32- and 64-bit case with a single conditional */
if (va_align.flags < 0 || !(va_align.flags & (2 - mmap_is_ia32())))
return 0;
if (!(current->flags & PF_RANDOMIZE))
return 0;
return va_align.mask;
}
unsigned long align_vdso_addr(unsigned long addr)
{
unsigned long align_mask = get_align_mask();
return (addr + align_mask) & ~align_mask;
}
static int __init control_va_addr_alignment(char *str)
{
/* guard against enabling this on other CPU families */
if (va_align.flags < 0)
return 1;
if (*str == 0)
return 1;
if (*str == '=')
str++;
if (!strcmp(str, "32"))
va_align.flags = ALIGN_VA_32;
else if (!strcmp(str, "64"))
va_align.flags = ALIGN_VA_64;
else if (!strcmp(str, "off"))
va_align.flags = 0;
else if (!strcmp(str, "on"))
va_align.flags = ALIGN_VA_32 | ALIGN_VA_64;
else
return 0;
return 1;
}
__setup("align_va_addr", control_va_addr_alignment);
SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
unsigned long, prot, unsigned long, flags,
unsigned long, fd, unsigned long, off)
{
long error;
error = -EINVAL;
if (off & ~PAGE_MASK)
goto out;
error = sys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
out:
return error;
}
static void find_start_end(unsigned long flags, unsigned long *begin,
unsigned long *end)
{
if (!test_thread_flag(TIF_ADDR32) && (flags & MAP_32BIT)) {
unsigned long new_begin;
/* This is usually used needed to map code in small
model, so it needs to be in the first 31bit. Limit
it to that. This means we need to move the
unmapped base down for this case. This can give
conflicts with the heap, but we assume that glibc
malloc knows how to fall back to mmap. Give it 1GB
of playground for now. -AK */
*begin = 0x40000000;
*end = 0x80000000;
if (current->flags & PF_RANDOMIZE) {
new_begin = randomize_range(*begin, *begin + 0x02000000, 0);
if (new_begin)
*begin = new_begin;
}
} else {
*begin = mmap_legacy_base();
*end = TASK_SIZE;
}
}
unsigned long
arch_get_unmapped_area(struct file *filp, unsigned long addr,
unsigned long len, unsigned long pgoff, unsigned long flags)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
struct vm_unmapped_area_info info;
unsigned long begin, end;
if (flags & MAP_FIXED)
return addr;
find_start_end(flags, &begin, &end);
if (len > end)
return -ENOMEM;
if (addr) {
addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
if (end - len >= addr &&
(!vma || addr + len <= vma->vm_start))
return addr;
}
info.flags = 0;
info.length = len;
info.low_limit = begin;
info.high_limit = end;
info.align_mask = filp ? get_align_mask() : 0;
info.align_offset = pgoff << PAGE_SHIFT;
return vm_unmapped_area(&info);
}
unsigned long
arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
const unsigned long len, const unsigned long pgoff,
const unsigned long flags)
{
struct vm_area_struct *vma;
struct mm_struct *mm = current->mm;
unsigned long addr = addr0;
struct vm_unmapped_area_info info;
/* requested length too big for entire address space */
if (len > TASK_SIZE)
return -ENOMEM;
if (flags & MAP_FIXED)
return addr;
/* for MAP_32BIT mappings we force the legacy mmap base */
if (!test_thread_flag(TIF_ADDR32) && (flags & MAP_32BIT))
goto bottomup;
/* requesting a specific address */
if (addr) {
addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
if (TASK_SIZE - len >= addr &&
(!vma || addr + len <= vma->vm_start))
return addr;
}
info.flags = VM_UNMAPPED_AREA_TOPDOWN;
info.length = len;
info.low_limit = PAGE_SIZE;
info.high_limit = mm->mmap_base;
info.align_mask = filp ? get_align_mask() : 0;
info.align_offset = pgoff << PAGE_SHIFT;
addr = vm_unmapped_area(&info);
if (!(addr & ~PAGE_MASK))
return addr;
VM_BUG_ON(addr != -ENOMEM);
bottomup:
/*
* A failed mmap() very likely causes application failure,
* so fall back to the bottom-up function here. This scenario
* can happen with large stack limits and large mmap()
* allocations.
*/
return arch_get_unmapped_area(filp, addr0, len, pgoff, flags);
}
|
#include <dlfcn.h>
static int
do_test (void)
{
void *h = dlopen("$ORIGIN/tst-auditmod9b.so", RTLD_LAZY);
int (*fp)(void) = dlsym(h, "f");
return fp() - 1;
}
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
|
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "Action.h"
class DynamicObjectRegistrationAction;
template <>
InputParameters validParams<DynamicObjectRegistrationAction>();
class DynamicObjectRegistrationAction : public Action
{
public:
static InputParameters validParams();
DynamicObjectRegistrationAction(InputParameters parameters);
virtual void act() override;
};
|
/* ========================================================================
* Copyright 1988-2006 University of Washington
*
* 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
*
*
* ========================================================================
*/
/*
* Program: Operating-system dependent routines -- 4.3BSD version
*
* Author: Mark Crispin
* Networks and Distributed Computing
* Computing & Communications
* University of Washington
* Administration Building, AG-44
* Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU
*
* Date: 11 May 1989
* Last Edited: 30 August 2006
*/
#include <string.h>
#include <sys/types.h>
#include <sys/dir.h>
#include <fcntl.h>
#include <syslog.h>
#include <sys/file.h>
#include <machine/endian.h> /* needed for htons() prototypes */
char *getenv (char *name);
char *strstr (char *cs,char *ct);
char *strerror (int n);
void *memmove (void *s,void *ct,size_t n);
unsigned long strtoul (char *s,char **endp,int base);
void *malloc (size_t byteSize);
void free (void *ptr);
void *realloc (void *oldptr,size_t newsize);
#include "env_unix.h"
#include "fs.h"
#include "ftl.h"
#include "nl.h"
#include "tcp.h"
|
/****************************************************************************
*
* Copyright 2016 Samsung Electronics All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
****************************************************************************/
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
*/
#ifndef __LWIP_INIT_H__
#define __LWIP_INIT_H__
#include <net/lwip/opt.h>
#ifdef __cplusplus
extern "C" {
#endif
/** X.x.x: Major version of the stack */
#define LWIP_VERSION_MAJOR 1U
/** x.X.x: Minor version of the stack */
#define LWIP_VERSION_MINOR 4U
/** x.x.X: Revision of the stack */
#define LWIP_VERSION_REVISION 1U
/** For release candidates, this is set to 1..254
* For official releases, this is set to 255 (LWIP_RC_RELEASE)
* For development versions (CVS), this is set to 0 (LWIP_RC_DEVELOPMENT) */
#define LWIP_VERSION_RC 0U
/** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */
#define LWIP_RC_RELEASE 255U
/** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for CVS versions */
#define LWIP_RC_DEVELOPMENT 0U
#define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE)
#define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT)
#define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT))
/** Provides the version of the stack */
#define LWIP_VERSION (LWIP_VERSION_MAJOR << 24 | LWIP_VERSION_MINOR << 16 | \
LWIP_VERSION_REVISION << 8 | LWIP_VERSION_RC)
/* Modules initialization */
void lwip_init(void);
#ifdef __cplusplus
}
#endif
#endif /* __LWIP_INIT_H__ */
|
/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
simplify_cmd.h
Abstract:
SMT2 front-end 'simplify' command.
Author:
Leonardo (leonardo) 2011-04-20
Notes:
--*/
#ifndef _SIMPLIFY_CMD_H_
#define _SIMPLIFY_CMD_H_
class cmd_context;
void install_simplify_cmd(cmd_context & ctx, char const * cmd_name = "simplify");
#endif
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Common library for ADIS16XXX devices
*
* Copyright 2012 Analog Devices Inc.
* Author: Lars-Peter Clausen <lars@metafoo.de>
*/
#include <linux/export.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/slab.h>
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/iio/imu/adis.h>
static int adis_update_scan_mode_burst(struct iio_dev *indio_dev,
const unsigned long *scan_mask)
{
struct adis *adis = iio_device_get_drvdata(indio_dev);
unsigned int burst_length;
u8 *tx;
/* All but the timestamp channel */
burst_length = (indio_dev->num_channels - 1) * sizeof(u16);
burst_length += adis->burst->extra_len;
adis->xfer = kcalloc(2, sizeof(*adis->xfer), GFP_KERNEL);
if (!adis->xfer)
return -ENOMEM;
adis->buffer = kzalloc(burst_length + sizeof(u16), GFP_KERNEL);
if (!adis->buffer) {
kfree(adis->xfer);
adis->xfer = NULL;
return -ENOMEM;
}
tx = adis->buffer + burst_length;
tx[0] = ADIS_READ_REG(adis->burst->reg_cmd);
tx[1] = 0;
adis->xfer[0].tx_buf = tx;
adis->xfer[0].bits_per_word = 8;
adis->xfer[0].len = 2;
adis->xfer[1].rx_buf = adis->buffer;
adis->xfer[1].bits_per_word = 8;
adis->xfer[1].len = burst_length;
spi_message_init(&adis->msg);
spi_message_add_tail(&adis->xfer[0], &adis->msg);
spi_message_add_tail(&adis->xfer[1], &adis->msg);
return 0;
}
int adis_update_scan_mode(struct iio_dev *indio_dev,
const unsigned long *scan_mask)
{
struct adis *adis = iio_device_get_drvdata(indio_dev);
const struct iio_chan_spec *chan;
unsigned int scan_count;
unsigned int i, j;
__be16 *tx, *rx;
kfree(adis->xfer);
kfree(adis->buffer);
if (adis->burst && adis->burst->en)
return adis_update_scan_mode_burst(indio_dev, scan_mask);
scan_count = indio_dev->scan_bytes / 2;
adis->xfer = kcalloc(scan_count + 1, sizeof(*adis->xfer), GFP_KERNEL);
if (!adis->xfer)
return -ENOMEM;
adis->buffer = kcalloc(indio_dev->scan_bytes, 2, GFP_KERNEL);
if (!adis->buffer) {
kfree(adis->xfer);
adis->xfer = NULL;
return -ENOMEM;
}
rx = adis->buffer;
tx = rx + scan_count;
spi_message_init(&adis->msg);
for (j = 0; j <= scan_count; j++) {
adis->xfer[j].bits_per_word = 8;
if (j != scan_count)
adis->xfer[j].cs_change = 1;
adis->xfer[j].len = 2;
adis->xfer[j].delay_usecs = adis->data->read_delay;
if (j < scan_count)
adis->xfer[j].tx_buf = &tx[j];
if (j >= 1)
adis->xfer[j].rx_buf = &rx[j - 1];
spi_message_add_tail(&adis->xfer[j], &adis->msg);
}
chan = indio_dev->channels;
for (i = 0; i < indio_dev->num_channels; i++, chan++) {
if (!test_bit(chan->scan_index, scan_mask))
continue;
if (chan->scan_type.storagebits == 32)
*tx++ = cpu_to_be16((chan->address + 2) << 8);
*tx++ = cpu_to_be16(chan->address << 8);
}
return 0;
}
EXPORT_SYMBOL_GPL(adis_update_scan_mode);
static irqreturn_t adis_trigger_handler(int irq, void *p)
{
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct adis *adis = iio_device_get_drvdata(indio_dev);
int ret;
if (!adis->buffer)
return -ENOMEM;
if (adis->data->has_paging) {
mutex_lock(&adis->txrx_lock);
if (adis->current_page != 0) {
adis->tx[0] = ADIS_WRITE_REG(ADIS_REG_PAGE_ID);
adis->tx[1] = 0;
spi_write(adis->spi, adis->tx, 2);
}
}
ret = spi_sync(adis->spi, &adis->msg);
if (ret)
dev_err(&adis->spi->dev, "Failed to read data: %d", ret);
if (adis->data->has_paging) {
adis->current_page = 0;
mutex_unlock(&adis->txrx_lock);
}
iio_push_to_buffers_with_timestamp(indio_dev, adis->buffer,
pf->timestamp);
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED;
}
/**
* adis_setup_buffer_and_trigger() - Sets up buffer and trigger for the adis device
* @adis: The adis device.
* @indio_dev: The IIO device.
* @trigger_handler: Optional trigger handler, may be NULL.
*
* Returns 0 on success, a negative error code otherwise.
*
* This function sets up the buffer and trigger for a adis devices. If
* 'trigger_handler' is NULL the default trigger handler will be used. The
* default trigger handler will simply read the registers assigned to the
* currently active channels.
*
* adis_cleanup_buffer_and_trigger() should be called to free the resources
* allocated by this function.
*/
int adis_setup_buffer_and_trigger(struct adis *adis, struct iio_dev *indio_dev,
irqreturn_t (*trigger_handler)(int, void *))
{
int ret;
if (!trigger_handler)
trigger_handler = adis_trigger_handler;
ret = iio_triggered_buffer_setup(indio_dev, &iio_pollfunc_store_time,
trigger_handler, NULL);
if (ret)
return ret;
if (adis->spi->irq) {
ret = adis_probe_trigger(adis, indio_dev);
if (ret)
goto error_buffer_cleanup;
}
return 0;
error_buffer_cleanup:
iio_triggered_buffer_cleanup(indio_dev);
return ret;
}
EXPORT_SYMBOL_GPL(adis_setup_buffer_and_trigger);
/**
* adis_cleanup_buffer_and_trigger() - Free buffer and trigger resources
* @adis: The adis device.
* @indio_dev: The IIO device.
*
* Frees resources allocated by adis_setup_buffer_and_trigger()
*/
void adis_cleanup_buffer_and_trigger(struct adis *adis,
struct iio_dev *indio_dev)
{
if (adis->spi->irq)
adis_remove_trigger(adis);
kfree(adis->buffer);
kfree(adis->xfer);
iio_triggered_buffer_cleanup(indio_dev);
}
EXPORT_SYMBOL_GPL(adis_cleanup_buffer_and_trigger);
|
/* Implementation of gettext(3) function.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef _LIBC
# define __need_NULL
# include <stddef.h>
#else
# include <stdlib.h> /* Just for NULL. */
#endif
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
# include "libgnuintl.h"
#endif
/* @@ end of prolog @@ */
/* Names for the libintl functions are a problem. They must not clash
with existing names and they should follow ANSI C. But this source
code is also used in GNU C Library where the names have a __
prefix. So we have to make a difference here. */
#ifdef _LIBC
# define GETTEXT __gettext
# define DCGETTEXT __dcgettext
#else
# define GETTEXT libintl_gettext
# define DCGETTEXT libintl_dcgettext
#endif
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
text). */
char *
GETTEXT (const char *msgid)
{
return DCGETTEXT (NULL, msgid, LC_MESSAGES);
}
#ifdef _LIBC
/* Alias for function name in GNU C Library. */
weak_alias (__gettext, gettext);
#endif
|
#include "mupdf/fitz.h"
/* This code needs to be kept out of stm_buffer.c to avoid it being
* pulled into cmapdump.c */
void
fz_free_compressed_buffer(fz_context *ctx, fz_compressed_buffer *buf)
{
if (!buf)
return;
fz_drop_buffer(ctx, buf->buffer);
fz_free(ctx, buf);
}
fz_stream *
fz_open_image_decomp_stream_from_buffer(fz_context *ctx, fz_compressed_buffer *buffer, int *l2factor)
{
fz_stream *chain = fz_open_buffer(ctx, buffer->buffer);
return fz_open_image_decomp_stream(ctx, chain, &buffer->params, l2factor);
}
fz_stream *
fz_open_image_decomp_stream(fz_context *ctx, fz_stream *chain, fz_compression_params *params, int *l2factor)
{
switch (params->type)
{
case FZ_IMAGE_FAX:
*l2factor = 0;
return fz_open_faxd(chain,
params->u.fax.k,
params->u.fax.end_of_line,
params->u.fax.encoded_byte_align,
params->u.fax.columns,
params->u.fax.rows,
params->u.fax.end_of_block,
params->u.fax.black_is_1);
case FZ_IMAGE_JPEG:
if (*l2factor > 3)
*l2factor = 3;
return fz_open_dctd(chain, params->u.jpeg.color_transform, *l2factor, NULL);
case FZ_IMAGE_RLD:
*l2factor = 0;
return fz_open_rld(chain);
case FZ_IMAGE_FLATE:
*l2factor = 0;
chain = fz_open_flated(chain, 15);
if (params->u.flate.predictor > 1)
chain = fz_open_predict(chain, params->u.flate.predictor, params->u.flate.columns, params->u.flate.colors, params->u.flate.bpc);
return chain;
case FZ_IMAGE_LZW:
*l2factor = 0;
chain = fz_open_lzwd(chain, params->u.lzw.early_change);
if (params->u.lzw.predictor > 1)
chain = fz_open_predict(chain, params->u.lzw.predictor, params->u.lzw.columns, params->u.lzw.colors, params->u.lzw.bpc);
return chain;
default:
*l2factor = 0;
break;
}
return chain;
}
fz_stream *
fz_open_compressed_buffer(fz_context *ctx, fz_compressed_buffer *buffer)
{
int l2factor = 0;
return fz_open_image_decomp_stream_from_buffer(ctx, buffer, &l2factor);
}
unsigned int
fz_compressed_buffer_size(fz_compressed_buffer *buffer)
{
if (!buffer || !buffer->buffer)
return 0;
return (unsigned int)buffer->buffer->cap;
}
|
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_TPU_TPU_EMBEDDING_OUTPUT_LAYOUT_UTILS_H_
#define TENSORFLOW_CORE_TPU_TPU_EMBEDDING_OUTPUT_LAYOUT_UTILS_H_
#include "tensorflow/core/framework/tensor_shape.pb.h"
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/protobuf/tpu/tpu_embedding_configuration.pb.h"
namespace tensorflow {
namespace tpu {
// Creates a default output layout for compatibility if none was provided by the
// model.
void AddDefaultEmbeddingOutputLayoutIfNeeded(TPUEmbeddingConfiguration* config);
// Computes the shape of the output tensors from an output layout.
Status ComputeOutputTensorShapes(
const TPUEmbeddingConfiguration& config,
std::vector<tensorflow::TensorShapeProto>* shapes);
} // namespace tpu
} // namespace tensorflow
#endif // TENSORFLOW_CORE_TPU_TPU_EMBEDDING_OUTPUT_LAYOUT_UTILS_H_
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef TransformPrinters_h
#define TransformPrinters_h
#include <iosfwd>
namespace blink {
class AffineTransform;
class TransformationMatrix;
// GTest print support for platform transform classes.
//
// To avoid ODR violations, these should also be declared in the respective
// headers defining these types. This is required because otherwise a template
// instantiation may be instantiated differently, depending on whether this
// declaration is found.
//
// As a result, it is not necessary to include this file in tests in order to
// use these printers. If, however, you get a link error about these symbols,
// you need to make sure the blink_platform_test_support target is linked in
// your unit test binary.
void PrintTo(const AffineTransform&, std::ostream*);
void PrintTo(const TransformationMatrix&, std::ostream*);
} // namespace blink
#endif // TransformPrinters_h
|
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QFONTINFO_H
#define QFONTINFO_H
#include <QtGui/qfont.h>
#include <QtCore/qsharedpointer.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
class Q_GUI_EXPORT QFontInfo
{
public:
QFontInfo(const QFont &);
QFontInfo(const QFontInfo &);
~QFontInfo();
QFontInfo &operator=(const QFontInfo &);
QString family() const;
QString styleName() const;
int pixelSize() const;
int pointSize() const;
qreal pointSizeF() const;
bool italic() const;
QFont::Style style() const;
int weight() const;
inline bool bold() const { return weight() > QFont::Normal; }
bool underline() const;
bool overline() const;
bool strikeOut() const;
bool fixedPitch() const;
QFont::StyleHint styleHint() const;
bool rawMode() const;
bool exactMatch() const;
private:
QExplicitlySharedDataPointer<QFontPrivate> d;
};
QT_END_NAMESPACE
QT_END_HEADER
#endif // QFONTINFO_H
|
__asm__(
".text \n"
".global " START " \n"
".type " START ", %function \n"
START ": \n"
" bl 1f \n"
".weak _DYNAMIC \n"
".hidden _DYNAMIC \n"
" .long _DYNAMIC-. \n"
"1: mflr 4 \n"
" lwz 3, 0(4) \n"
" add 4, 3, 4 \n"
" mr 3, 1 \n"
" clrrwi 1, 1, 4 \n"
" li 0, 0 \n"
" stwu 1, -16(1) \n"
" mtlr 0 \n"
" stw 0, 0(1) \n"
" bl " START "_c \n"
);
|
/* pthread_getcpuclockid -- Get POSIX clockid_t for a pthread_t. Linux version
Copyright (C) 2000, 2001, 2004, 2005 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; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <pthread.h>
#include <sys/time.h>
#include <time.h>
#include <internals.h>
#include <spinlock.h>
#include <bits/kernel-features.h>
#include <kernel-posix-cpu-timers.h>
#if !(__ASSUME_POSIX_CPU_TIMERS > 0)
int __libc_missing_posix_cpu_timers attribute_hidden;
#endif
#if !(__ASSUME_POSIX_TIMERS > 0)
int __libc_missing_posix_timers attribute_hidden;
#endif
int
pthread_getcpuclockid (pthread_t thread_id, clockid_t *clock_id)
{
#ifdef __NR_clock_getres
pthread_handle handle = thread_handle(thread_id);
int pid;
__pthread_lock (&handle->h_lock, NULL);
if (nonexisting_handle (handle, thread_id))
{
__pthread_unlock (&handle->h_lock);
return ESRCH;
}
pid = handle->h_descr->p_pid;
__pthread_unlock (&handle->h_lock);
/* The clockid_t value is a simple computation from the PID.
But we do a clock_getres call to validate it if we aren't
yet sure we have the kernel support. */
const clockid_t pidclock = MAKE_PROCESS_CPUCLOCK (pid, CPUCLOCK_SCHED);
# if !(__ASSUME_POSIX_CPU_TIMERS > 0)
# if !(__ASSUME_POSIX_TIMERS > 0)
if (__libc_missing_posix_timers && !__libc_missing_posix_cpu_timers)
__libc_missing_posix_cpu_timers = 1;
# endif
if (!__libc_missing_posix_cpu_timers)
{
INTERNAL_SYSCALL_DECL (err);
int r = INTERNAL_SYSCALL (clock_getres, err, 2, pidclock, NULL);
if (!INTERNAL_SYSCALL_ERROR_P (r, err))
# endif
{
*clock_id = pidclock;
return 0;
}
# if !(__ASSUME_POSIX_CPU_TIMERS > 0)
# if !(__ASSUME_POSIX_TIMERS > 0)
if (INTERNAL_SYSCALL_ERRNO (r, err) == ENOSYS)
{
/* The kernel doesn't support these calls at all. */
__libc_missing_posix_timers = 1;
__libc_missing_posix_cpu_timers = 1;
}
else
# endif
if (INTERNAL_SYSCALL_ERRNO (r, err) == EINVAL)
{
/* The kernel doesn't support these clocks at all. */
__libc_missing_posix_cpu_timers = 1;
}
else
return INTERNAL_SYSCALL_ERRNO (r, err);
}
# endif
#endif
#ifdef CLOCK_THREAD_CPUTIME_ID
/* We need to store the thread ID in the CLOCKID variable together
with a number identifying the clock. We reserve the low 3 bits
for the clock ID and the rest for the thread ID. This is
problematic if the thread ID is too large. But 29 bits should be
fine.
If some day more clock IDs are needed the ID part can be
enlarged. The IDs are entirely internal. */
if (2 * PTHREAD_THREADS_MAX
>= 1 << (8 * sizeof (*clock_id) - CLOCK_IDFIELD_SIZE))
return ERANGE;
/* Store the number. */
*clock_id = CLOCK_THREAD_CPUTIME_ID | (thread_id << CLOCK_IDFIELD_SIZE);
return 0;
#else
/* We don't have a timer for that. */
return ENOENT;
#endif
}
|
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// 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.
//
// DESCRIPTION:
// WAD I/O functions.
//
#include <stdio.h>
#include "m_misc.h"
#include "w_file.h"
#include "z_zone.h"
typedef struct
{
wad_file_t wad;
FILE *fstream;
} stdc_wad_file_t;
extern wad_file_class_t stdc_wad_file;
static wad_file_t *W_StdC_OpenFile(char *path)
{
stdc_wad_file_t *result;
FILE *fstream;
fstream = fopen(path, "rb");
if (fstream == NULL)
{
return NULL;
}
// Create a new stdc_wad_file_t to hold the file handle.
result = Z_Malloc(sizeof(stdc_wad_file_t), PU_STATIC, 0);
result->wad.file_class = &stdc_wad_file;
result->wad.mapped = NULL;
result->wad.length = M_FileLength(fstream);
result->fstream = fstream;
return &result->wad;
}
static void W_StdC_CloseFile(wad_file_t *wad)
{
stdc_wad_file_t *stdc_wad;
stdc_wad = (stdc_wad_file_t *) wad;
fclose(stdc_wad->fstream);
Z_Free(stdc_wad);
}
// Read data from the specified position in the file into the
// provided buffer. Returns the number of bytes read.
size_t W_StdC_Read(wad_file_t *wad, unsigned int offset,
void *buffer, size_t buffer_len)
{
stdc_wad_file_t *stdc_wad;
size_t result;
stdc_wad = (stdc_wad_file_t *) wad;
// Jump to the specified position in the file.
fseek(stdc_wad->fstream, offset, SEEK_SET);
// Read into the buffer.
result = fread(buffer, 1, buffer_len, stdc_wad->fstream);
return result;
}
wad_file_class_t stdc_wad_file =
{
W_StdC_OpenFile,
W_StdC_CloseFile,
W_StdC_Read,
};
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
int qcow2_detect(int fd);
int qcow2_convert(int qcow2_fd, int raw_fd);
|
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#ifdef IN_LIBASPRINTF
# include "vasprintf.h"
#else
# include <stdio.h>
#endif
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include "vasnprintf.h"
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
#ifndef EOVERFLOW
# define EOVERFLOW E2BIG
#endif
int
vasprintf (char **resultp, const char *format, va_list args)
{
size_t length;
char *result = vasnprintf (NULL, &length, format, args);
if (result == NULL)
return -1;
if (length > INT_MAX)
{
free (result);
errno = EOVERFLOW;
return -1;
}
*resultp = result;
/* Return the number of resulting bytes, excluding the trailing NUL. */
return length;
}
|
/*****************************************************************************
Copyright (c) 2010, 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 ctpqrt
* Author: Intel Corporation
* Generated November, 2011
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int LAPACKE_ctpqrt_work( int matrix_order, lapack_int m, lapack_int n,
lapack_int l, lapack_int nb,
lapack_complex_float* a, lapack_int lda,
lapack_complex_float* b, lapack_int ldb,
lapack_complex_float* t, lapack_int ldt,
lapack_complex_float* work )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_ctpqrt( &m, &n, &l, &nb, a, &lda, b, &ldb, t, &ldt, work,
&info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,n);
lapack_int ldb_t = MAX(1,m);
lapack_int ldt_t = MAX(1,nb);
lapack_complex_float* a_t = NULL;
lapack_complex_float* t_t = NULL;
lapack_complex_float* b_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_ctpqrt_work", info );
return info;
}
if( ldb < n ) {
info = -10;
LAPACKE_xerbla( "LAPACKE_ctpqrt_work", info );
return info;
}
if( ldt < n ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_ctpqrt_work", info );
return 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;
}
t_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) * ldt_t * MAX(1,n) );
if( t_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
b_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) * ldb_t * MAX(1,n) );
if( b_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_2;
}
/* Transpose input matrices */
LAPACKE_cge_trans( matrix_order, n, n, a, lda, a_t, lda_t );
LAPACKE_cge_trans( matrix_order, m, n, b, ldb, b_t, ldb_t );
/* Call LAPACK function and adjust info */
LAPACK_ctpqrt( &m, &n, &l, &nb, a_t, &lda_t, b_t, &ldb_t, t_t, &ldt_t,
work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nb, n, t_t, ldt_t, t, ldt );
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, b_t, ldb_t, b, ldb );
/* Release memory and exit */
LAPACKE_free( b_t );
exit_level_2:
LAPACKE_free( t_t );
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_ctpqrt_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_ctpqrt_work", info );
}
return info;
}
|
/* Copyright Statement:
*
* This software/firmware and related documentation ("MediaTek Software") are
* protected under relevant copyright laws. The information contained herein
* is confidential and proprietary to MediaTek Inc. and/or its licensors.
* Without the prior written permission of MediaTek inc. and/or its licensors,
* any reproduction, modification, use or disclosure of MediaTek Software,
* and information contained herein, in whole or in part, shall be strictly prohibited.
*
* MediaTek Inc. (C) 2011. All rights reserved.
*
* BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
* THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
* CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
* SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
* STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
* CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* The following software/firmware and/or related documentation ("MediaTek Software")
* have been modified by MediaTek Inc. All revisions are subject to any receiver's
* applicable license agreements with MediaTek Inc.
*/
#ifndef SEC_SIGN_FORMAT_UTIL_H
#define SEC_SIGN_FORMAT_UTIL_H
#include "sec_sign_header.h"
#include "sec_sign_extension.h"
#include "sec_log.h"
#include "sec_osal_light.h"
/******************************************************************************
* EXPORT FUNCTION
******************************************************************************/
unsigned int get_hash_size(SEC_CRYPTO_HASH_TYPE hash);
unsigned int get_signature_size(SEC_CRYPTO_SIGNATURE_TYPE sig);
unsigned char is_signfmt_v1(SEC_IMG_HEADER *hdr);
unsigned char is_signfmt_v2(SEC_IMG_HEADER *hdr);
unsigned char is_signfmt_v3(SEC_IMG_HEADER *hdr);
#endif
|
/*
* Header file for:
* Cypress TrueTouch(TM) Standard Product (TTSP) touchscreen drivers.
* For use with Cypress Txx3xx parts.
* Supported parts include:
* CY8CTST341
* CY8CTMA340
*
* Copyright (C) 2009, 2010, 2011 Cypress Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2, 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.
*
* 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.
*
* Contact Cypress Semiconductor at www.cypress.com (kev@cypress.com)
*
*/
#ifndef _CYTTSP_H_
#define _CYTTSP_H_
#define CY_SPI_NAME "cyttsp-spi"
#define CY_I2C_NAME "cyttsp-i2c"
/* Active Power state scanning/processing refresh interval */
#define CY_ACT_INTRVL_DFLT 0x00 /* ms */
/* touch timeout for the Active power */
#define CY_TCH_TMOUT_DFLT 0xFF /* ms */
/* Low Power state scanning/processing refresh interval */
#define CY_LP_INTRVL_DFLT 0x0A /* ms */
/* Active distance in pixels for a gesture to be reported */
#define CY_ACT_DIST_DFLT 0xF8 /* pixels */
enum cyttsp_powerstate {
CY_IDLE_STATE,
CY_ACTIVE_STATE,
CY_LOW_PWR_STATE,
CY_SLEEP_STATE,
CY_BL_STATE,
CY_INVALID_STATE /* always last in the list */
};
struct cyttsp_platform_data {
u32 maxx;
u32 maxy;
bool use_hndshk;
bool use_sleep;
u8 act_dist; /* Active distance */
u8 act_intrvl; /* Active refresh interval; ms */
u8 tch_tmout; /* Active touch timeout; ms */
u8 lp_intrvl; /* Low power refresh interval; ms */
int (*wakeup)(void);
int (*init)(void);
void (*exit)(void);
char *name;
s16 irq_gpio;
u8 *bl_keys;
};
#endif /* _CYTTSP_H_ */
|
/*
* This is the source code of Telegram for iOS v. 1.1
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Peter Iakovlev, 2013.
*/
#import <Foundation/Foundation.h>
#import "TLObject.h"
@interface NSArray_ContactLocated : NSObject <TLVector>
@end
|
/* { dg-do preprocess }*/
/* { dg-options "-std=c11 -pedantic-errors" { target c } } */
/* { dg-options "-std=c++17 -pedantic-errors" { target c++ } } */
#define CALL(F, ...) F (7 __VA_OPT__(,) __VA_ARGS__) /* { dg-error "__VA_OPT__ is not available" } */
|
/*
* Multi2Sim
* Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <assert.h>
#include <lib/mhandle/mhandle.h>
#include "prefetch-history.h"
#include "module.h"
#include "cache.h"
int prefetch_history_size;
int prefetch_history_is_redundant(struct prefetch_history_t *ph, struct mod_t *mod,
unsigned int phy_addr)
{
int i, tag1, tag2, set1, set2;
if(mod->kind != mod_kind_cache)
{
/* Doesn't make much sense to prefetch if the memory being
* accessed is not a cache memory. */
return 1;
}
/* A 0 sized table means do not track history. Always issue the prefetch. */
if (ph->size == 0)
return 0;
for (i = 0; i < ph->size; i++)
{
cache_decode_address(mod->cache, ph->table[i], &set1, &tag1, NULL);
cache_decode_address(mod->cache, phy_addr, &set2, &tag2, NULL);
/* If both accesses refer to the same block, return true */
if (set1 == set2 && tag1 == tag2)
return 1;
}
return 0;
}
void prefetch_history_record(struct prefetch_history_t *ph, unsigned int phy_addr)
{
/* A 0 sized table means do not track history. */
if (ph->size == 0)
return;
int index = (++(ph->hindex)) % ph->size;
ph->table[index] = phy_addr;
ph->hindex = index;
}
struct prefetch_history_t *prefetch_history_create(void)
{
struct prefetch_history_t *ph;
/* Initialize */
ph = xcalloc(1, sizeof(struct prefetch_history_t));
ph->hindex = -1;
assert(prefetch_history_size >= 0);
ph->size = prefetch_history_size;
if (prefetch_history_size > 0)
ph->table = xcalloc(prefetch_history_size, sizeof(unsigned));
/* Return */
return ph;
}
void prefetch_history_free(struct prefetch_history_t *pf)
{
free(pf->table);
free(pf);
}
|
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
* *
* 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 _AppPlacement_h_
#define _AppPlacement_h_
#include <Base/Placement.h>
#include "GeoFeature.h"
#include "PropertyGeo.h"
namespace Base
{
// class Vector3D;
//class Matrix4D;
}
//using Base::Vector3D;
//using Base::Matrix4D;
namespace App
{
/** Placement Object
* Handles the repositioning of data. Also can do grouping
*/
class AppExport Placement: public App::GeoFeature
{
PROPERTY_HEADER(App::Placement);
public:
/// Constructor
Placement(void);
virtual ~Placement();
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
return "Gui::ViewProviderPlacement";
}
};
} //namespace App
#endif
|
/*
* Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
*
* Licensed under the GNU GPLv2 or later.
* 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
*/
/*
* Block on a futex and wait for wakeup.
*
* This tests uses shared memory page to store the mutex variable.
*/
#include <sys/mman.h>
#include <sys/wait.h>
#include <errno.h>
#include "test.h"
#include "safe_macros.h"
#include "futextest.h"
#include "futex_common.h"
const char *TCID="futex_wait02";
const int TST_TOTAL=1;
static void do_child(void)
{
int ret;
tst_process_state_wait2(getppid(), 'S');
ret = futex_wake(futex, 1, 0);
if (ret != 1)
tst_brkm(TFAIL, NULL, "futex_wake() returned %i", ret);
exit(TPASS);
}
static void verify_futex_wait(void)
{
int res;
int pid;
pid = tst_fork();
switch (pid) {
case 0:
do_child();
break;
case -1:
tst_brkm(TBROK | TERRNO, NULL, "fork() failed");
break;
default:
break;
}
res = futex_wait(futex, *futex, NULL, 0);
if (res) {
tst_resm(TFAIL, "futex_wait() returned %i, errno %s",
res, tst_strerrno(errno));
}
SAFE_WAIT(NULL, &res);
if (WIFEXITED(res) && WEXITSTATUS(res) == TPASS)
tst_resm(TPASS, "futex_wait() woken up");
else
tst_resm(TFAIL, "child failed");
}
int main(int argc, char *argv[])
{
int lc;
tst_parse_opts(argc, argv, NULL, NULL);
setup();
for (lc = 0; TEST_LOOPING(lc); lc++)
verify_futex_wait();
tst_exit();
}
|
/* Copyright (c) 2010-2011, Code Aurora Forum. 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 __ARCH_ARM_MACH_MSM_GPIOMUX_H
#define __ARCH_ARM_MACH_MSM_GPIOMUX_H
#include <linux/bitops.h>
#include <linux/errno.h>
enum msm_gpiomux_setting {
GPIOMUX_ACTIVE = 0,
GPIOMUX_SUSPENDED,
GPIOMUX_NSETTINGS
};
enum gpiomux_drv {
GPIOMUX_DRV_2MA = 0,
GPIOMUX_DRV_4MA,
GPIOMUX_DRV_6MA,
GPIOMUX_DRV_8MA,
GPIOMUX_DRV_10MA,
GPIOMUX_DRV_12MA,
GPIOMUX_DRV_14MA,
GPIOMUX_DRV_16MA,
};
enum gpiomux_func {
GPIOMUX_FUNC_GPIO = 0,
GPIOMUX_FUNC_1,
GPIOMUX_FUNC_2,
GPIOMUX_FUNC_3,
GPIOMUX_FUNC_4,
GPIOMUX_FUNC_5,
GPIOMUX_FUNC_6,
GPIOMUX_FUNC_7,
GPIOMUX_FUNC_8,
GPIOMUX_FUNC_9,
GPIOMUX_FUNC_A,
GPIOMUX_FUNC_B,
GPIOMUX_FUNC_C,
GPIOMUX_FUNC_D,
GPIOMUX_FUNC_E,
GPIOMUX_FUNC_F,
};
enum gpiomux_pull {
GPIOMUX_PULL_NONE = 0,
GPIOMUX_PULL_DOWN,
GPIOMUX_PULL_KEEPER,
GPIOMUX_PULL_UP,
};
/* Direction settings are only meaningful when GPIOMUX_FUNC_GPIO is selected.
* This element is ignored for all other FUNC selections, as the output-
* enable pin is not under software control in those cases. See the SWI
* for your target for more details.
*/
enum gpiomux_dir {
GPIOMUX_IN = 0,
GPIOMUX_OUT_HIGH,
GPIOMUX_OUT_LOW,
};
struct gpiomux_setting {
enum gpiomux_func func;
enum gpiomux_drv drv;
enum gpiomux_pull pull;
enum gpiomux_dir dir;
};
/**
* struct msm_gpiomux_config: gpiomux settings for one gpio line.
*
* A complete gpiomux config is the combination of a drive-strength,
* function, pull, and (sometimes) direction. For functions other than GPIO,
* the input/output setting is hard-wired according to the function.
*
* @gpio: The index number of the gpio being described.
* @settings: The settings to be installed, specifically:
* GPIOMUX_ACTIVE: The setting to be installed when the
* line is active, or its reference count is > 0.
* GPIOMUX_SUSPENDED: The setting to be installed when
* the line is suspended, or its reference count is 0.
*/
struct msm_gpiomux_config {
unsigned gpio;
struct gpiomux_setting *settings[GPIOMUX_NSETTINGS];
};
/**
* struct msm_gpiomux_configs: a collection of gpiomux configs.
*
* It is so common to manage blocks of gpiomux configs that the data structure
* for doing so has been standardized here as a convenience.
*
* @cfg: A pointer to the first config in an array of configs.
* @ncfg: The number of configs in the array.
*/
struct msm_gpiomux_configs {
struct msm_gpiomux_config *cfg;
size_t ncfg;
};
#ifdef CONFIG_MSM_GPIOMUX
/* Before using gpiomux, initialize the subsystem by telling it how many
* gpios are going to be managed. Calling any other gpiomux functions before
* msm_gpiomux_init is unsupported.
*/
int msm_gpiomux_init(size_t ngpio);
/* Install a block of gpiomux configurations in gpiomux. This is functionally
* identical to calling msm_gpiomux_write many times.
*/
void msm_gpiomux_install(struct msm_gpiomux_config *configs, unsigned nconfigs);
/* Increment a gpio's reference count, possibly activating the line. */
int __must_check msm_gpiomux_get(unsigned gpio);
/* Decrement a gpio's reference count, possibly suspending the line. */
int msm_gpiomux_put(unsigned gpio);
int msm_gpiomux_read(unsigned gpio);
/* Install a new setting in a gpio. To erase a slot, use NULL.
* The old setting that was overwritten can be passed back to the caller
* old_setting can be NULL if the caller is not interested in the previous
* setting
* If a previous setting was not available to return (NULL configuration)
* - the function returns 1
* else function returns 0
*/
int msm_gpiomux_write(unsigned gpio, enum msm_gpiomux_setting which,
struct gpiomux_setting *setting, struct gpiomux_setting *old_setting);
/* Architecture-internal function for use by the framework only.
* This function can assume the following:
* - the gpio value has passed a bounds-check
* - the gpiomux spinlock has been obtained
*
* This function is not for public consumption. External users
* should use msm_gpiomux_write.
*/
void __msm_gpiomux_write(unsigned gpio, struct gpiomux_setting val);
unsigned __msm_gpiomux_read(unsigned gpio);
#else
static inline int msm_gpiomux_init(size_t ngpio)
{
return -ENOSYS;
}
static inline void
msm_gpiomux_install(struct msm_gpiomux_config *configs, unsigned nconfigs) {}
static inline int __must_check msm_gpiomux_get(unsigned gpio)
{
return -ENOSYS;
}
static inline int msm_gpiomux_put(unsigned gpio)
{
return -ENOSYS;
}
static inline int msm_gpiomux_write(unsigned gpio,
enum msm_gpiomux_setting which, struct gpiomux_setting *setting,
struct gpiomux_setting *old_setting)
{
return -ENOSYS;
}
#endif
#endif
|
/* Optimizations bu Ulrich Drepper <drepper@gmail.com>, 2011 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/*
* wrapper cosh(x)
*/
#include <math.h>
#include <math_private.h>
double
__cosh (double x)
{
double z = __ieee754_cosh (x);
if (__builtin_expect (!isfinite (z), 0) && isfinite (x)
&& _LIB_VERSION != _IEEE_)
return __kernel_standard (x, x, 5); /* cosh overflow */
return z;
}
weak_alias (__cosh, cosh)
#ifdef NO_LONG_DOUBLE
strong_alias (__cosh, __coshl)
weak_alias (__cosh, coshl)
#endif
|
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkJpegUtility_codec_DEFINED
#define SkJpegUtility_codec_DEFINED
#include "SkStream.h"
#include <setjmp.h>
// stdio is needed for jpeglib
#include <stdio.h>
extern "C" {
#include "jpeglib.h"
#include "jerror.h"
}
/*
* Error handling struct
*/
struct skjpeg_error_mgr : jpeg_error_mgr {
jmp_buf fJmpBuf;
};
/*
* Error handling function
*/
void skjpeg_err_exit(j_common_ptr cinfo);
/*
* Source handling struct for that allows libjpeg to use our stream object
*/
struct skjpeg_source_mgr : jpeg_source_mgr {
skjpeg_source_mgr(SkStream* stream);
SkStream* fStream; // unowned
enum {
// TODO (msarett): Experiment with different buffer sizes.
// This size was chosen because it matches SkImageDecoder.
kBufferSize = 1024
};
uint8_t fBuffer[kBufferSize];
};
#endif
|
/* Builtin transformations.
Copyright (C) 1997-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
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/>. */
/* All encoding named must be in upper case. There must be no extra
spaces. */
BUILTIN_ALIAS ("UCS4//", "ISO-10646/UCS4/")
BUILTIN_ALIAS ("UCS-4//", "ISO-10646/UCS4/")
BUILTIN_ALIAS ("UCS-4BE//", "ISO-10646/UCS4/")
BUILTIN_ALIAS ("CSUCS4//", "ISO-10646/UCS4/")
BUILTIN_ALIAS ("ISO-10646//", "ISO-10646/UCS4/")
BUILTIN_ALIAS ("10646-1:1993//", "ISO-10646/UCS4/")
BUILTIN_ALIAS ("10646-1:1993/UCS4/", "ISO-10646/UCS4/")
BUILTIN_ALIAS ("OSF00010104//", "ISO-10646/UCS4/") /* level 1 */
BUILTIN_ALIAS ("OSF00010105//", "ISO-10646/UCS4/") /* level 2 */
BUILTIN_ALIAS ("OSF00010106//", "ISO-10646/UCS4/") /* level 3 */
BUILTIN_TRANSFORMATION ("INTERNAL", "ISO-10646/UCS4/", 1, "=INTERNAL->ucs4",
__gconv_transform_internal_ucs4, NULL, 4, 4, 4, 4)
BUILTIN_TRANSFORMATION ("ISO-10646/UCS4/", "INTERNAL", 1, "=ucs4->INTERNAL",
__gconv_transform_ucs4_internal, NULL, 4, 4, 4, 4)
BUILTIN_TRANSFORMATION ("INTERNAL", "UCS-4LE//", 1, "=INTERNAL->ucs4le",
__gconv_transform_internal_ucs4le, NULL, 4, 4, 4, 4)
BUILTIN_TRANSFORMATION ("UCS-4LE//", "INTERNAL", 1, "=ucs4le->INTERNAL",
__gconv_transform_ucs4le_internal, NULL, 4, 4, 4, 4)
BUILTIN_ALIAS ("WCHAR_T//", "INTERNAL")
BUILTIN_ALIAS ("UTF8//", "ISO-10646/UTF8/")
BUILTIN_ALIAS ("UTF-8//", "ISO-10646/UTF8/")
BUILTIN_ALIAS ("ISO-IR-193//", "ISO-10646/UTF8/")
BUILTIN_ALIAS ("OSF05010001//", "ISO-10646/UTF8/")
BUILTIN_ALIAS ("ISO-10646/UTF-8/", "ISO-10646/UTF8/")
BUILTIN_TRANSFORMATION ("INTERNAL", "ISO-10646/UTF8/", 1, "=INTERNAL->utf8",
__gconv_transform_internal_utf8, NULL, 4, 4, 1, 6)
BUILTIN_TRANSFORMATION ("ISO-10646/UTF8/", "INTERNAL", 1, "=utf8->INTERNAL",
__gconv_transform_utf8_internal, __gconv_btwoc_ascii,
1, 6, 4, 4)
BUILTIN_ALIAS ("UCS2//", "ISO-10646/UCS2/")
BUILTIN_ALIAS ("UCS-2//", "ISO-10646/UCS2/")
BUILTIN_ALIAS ("OSF00010100//", "ISO-10646/UCS2/") /* level 1 */
BUILTIN_ALIAS ("OSF00010101//", "ISO-10646/UCS2/") /* level 2 */
BUILTIN_ALIAS ("OSF00010102//", "ISO-10646/UCS2/") /* level 3 */
BUILTIN_TRANSFORMATION ("ISO-10646/UCS2/", "INTERNAL", 1, "=ucs2->INTERNAL",
__gconv_transform_ucs2_internal, NULL, 2, 2, 4, 4)
BUILTIN_TRANSFORMATION ("INTERNAL", "ISO-10646/UCS2/", 1, "=INTERNAL->ucs2",
__gconv_transform_internal_ucs2, NULL, 4, 4, 2, 2)
BUILTIN_ALIAS ("ANSI_X3.4//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("ISO-IR-6//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("ANSI_X3.4-1986//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("ISO_646.IRV:1991//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("ASCII//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("ISO646-US//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("US-ASCII//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("US//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("IBM367//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("CP367//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("CSASCII//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("OSF00010020//", "ANSI_X3.4-1968//")
BUILTIN_TRANSFORMATION ("ANSI_X3.4-1968//", "INTERNAL", 1, "=ascii->INTERNAL",
__gconv_transform_ascii_internal, __gconv_btwoc_ascii,
4, 4, 1, 1)
BUILTIN_TRANSFORMATION ("INTERNAL", "ANSI_X3.4-1968//", 1, "=INTERNAL->ascii",
__gconv_transform_internal_ascii, NULL, 4, 4, 1, 1)
#if BYTE_ORDER == BIG_ENDIAN
BUILTIN_ALIAS ("UNICODEBIG//", "ISO-10646/UCS2/")
BUILTIN_ALIAS ("UCS-2BE//", "ISO-10646/UCS2/")
BUILTIN_ALIAS ("UCS-2LE//", "UNICODELITTLE//")
BUILTIN_TRANSFORMATION ("UNICODELITTLE//", "INTERNAL", 1,
"=ucs2reverse->INTERNAL",
__gconv_transform_ucs2reverse_internal, NULL,
2, 2, 4, 4)
BUILTIN_TRANSFORMATION ("INTERNAL", "UNICODELITTLE//", 1,
"=INTERNAL->ucs2reverse",
__gconv_transform_internal_ucs2reverse, NULL,
4, 4, 2, 2)
#else
BUILTIN_ALIAS ("UNICODELITTLE//", "ISO-10646/UCS2/")
BUILTIN_ALIAS ("UCS-2LE//", "ISO-10646/UCS2/")
BUILTIN_ALIAS ("UCS-2BE//", "UNICODEBIG//")
BUILTIN_TRANSFORMATION ("UNICODEBIG//", "INTERNAL", 1,
"=ucs2reverse->INTERNAL",
__gconv_transform_ucs2reverse_internal, NULL,
2, 2, 4, 4)
BUILTIN_TRANSFORMATION ("INTERNAL", "UNICODEBIG//", 1,
"=INTERNAL->ucs2reverse",
__gconv_transform_internal_ucs2reverse, NULL,
4, 4, 2, 2)
#endif
|
void foo(void)
{
p[0].x = x + (rx * cos(rs));
p[0].y = y - (ry * sin(rs));
}
|
#ifndef _ROS_actionlib_tutorials_AveragingFeedback_h
#define _ROS_actionlib_tutorials_AveragingFeedback_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
namespace actionlib_tutorials
{
class AveragingFeedback : public ros::Msg
{
public:
int32_t sample;
float data;
float mean;
float std_dev;
AveragingFeedback():
sample(0),
data(0),
mean(0),
std_dev(0)
{
}
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
union {
int32_t real;
uint32_t base;
} u_sample;
u_sample.real = this->sample;
*(outbuffer + offset + 0) = (u_sample.base >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (u_sample.base >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (u_sample.base >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (u_sample.base >> (8 * 3)) & 0xFF;
offset += sizeof(this->sample);
union {
float real;
uint32_t base;
} u_data;
u_data.real = this->data;
*(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF;
offset += sizeof(this->data);
union {
float real;
uint32_t base;
} u_mean;
u_mean.real = this->mean;
*(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF;
offset += sizeof(this->mean);
union {
float real;
uint32_t base;
} u_std_dev;
u_std_dev.real = this->std_dev;
*(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF;
offset += sizeof(this->std_dev);
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
union {
int32_t real;
uint32_t base;
} u_sample;
u_sample.base = 0;
u_sample.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
u_sample.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
u_sample.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
u_sample.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
this->sample = u_sample.real;
offset += sizeof(this->sample);
union {
float real;
uint32_t base;
} u_data;
u_data.base = 0;
u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
this->data = u_data.real;
offset += sizeof(this->data);
union {
float real;
uint32_t base;
} u_mean;
u_mean.base = 0;
u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
this->mean = u_mean.real;
offset += sizeof(this->mean);
union {
float real;
uint32_t base;
} u_std_dev;
u_std_dev.base = 0;
u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
this->std_dev = u_std_dev.real;
offset += sizeof(this->std_dev);
return offset;
}
const char * getType(){ return "actionlib_tutorials/AveragingFeedback"; };
const char * getMD5(){ return "9e8dfc53c2f2a032ca33fa80ec46fd4f"; };
};
}
#endif |
/* Work around a bug of lstat on some systems
Copyright (C) 1997-2006, 2008-2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* written by Jim Meyering */
#include <config.h>
#if !HAVE_LSTAT
/* On systems that lack symlinks, our replacement <sys/stat.h> already
defined lstat as stat, so there is nothing further to do other than
avoid an empty file. */
typedef int dummy;
#else /* HAVE_LSTAT */
/* Get the original definition of lstat. It might be defined as a macro. */
# define __need_system_sys_stat_h
# include <sys/types.h>
# include <sys/stat.h>
# undef __need_system_sys_stat_h
static inline int
orig_lstat (const char *filename, struct stat *buf)
{
return lstat (filename, buf);
}
/* Specification. */
# include <sys/stat.h>
# include <string.h>
# include <errno.h>
/* lstat works differently on Linux and Solaris systems. POSIX (see
`pathname resolution' in the glossary) requires that programs like
`ls' take into consideration the fact that FILE has a trailing slash
when FILE is a symbolic link. On Linux and Solaris 10 systems, the
lstat function already has the desired semantics (in treating
`lstat ("symlink/", sbuf)' just like `lstat ("symlink/.", sbuf)',
but on Solaris 9 and earlier it does not.
If FILE has a trailing slash and specifies a symbolic link,
then use stat() to get more info on the referent of FILE.
If the referent is a non-directory, then set errno to ENOTDIR
and return -1. Otherwise, return stat's result. */
int
rpl_lstat (const char *file, struct stat *sbuf)
{
size_t len;
int lstat_result = orig_lstat (file, sbuf);
if (lstat_result != 0)
return lstat_result;
/* This replacement file can blindly check against '/' rather than
using the ISSLASH macro, because all platforms with '\\' either
lack symlinks (mingw) or have working lstat (cygwin) and thus do
not compile this file. 0 len should have already been filtered
out above, with a failure return of ENOENT. */
len = strlen (file);
if (file[len - 1] != '/' || S_ISDIR (sbuf->st_mode))
return 0;
/* At this point, a trailing slash is only permitted on
symlink-to-dir; but it should have found information on the
directory, not the symlink. Call stat() to get info about the
link's referent. Our replacement stat guarantees valid results,
even if the symlink is not pointing to a directory. */
if (!S_ISLNK (sbuf->st_mode))
{
errno = ENOTDIR;
return -1;
}
return stat (file, sbuf);
}
#endif /* HAVE_LSTAT */
|
/*
* (C) 2003-2006 Gabest
* (C) 2006-2014 see Authors.txt
*
* This file is part of MPC-HC.
*
* MPC-HC 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.
*
* MPC-HC 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/>.
*
*/
#pragma once
#include "resource.h"
#include <afxwin.h>
#include <afxcmn.h>
#include "../../../mpc-hc/ColorButton.h"
#include "../../../Subtitles/STS.h"
// CStyleEditorDialog dialog
class CStyleEditorDialog : public CDialog
{
DECLARE_DYNAMIC(CStyleEditorDialog)
private:
CString m_title;
STSStyle m_stss;
CButton m_font;
int m_iCharset;
CComboBox m_cbCharset;
int m_spacing;
CSpinButtonCtrl m_spacingSpin;
int m_angle;
CSpinButtonCtrl m_angleSpin;
int m_scalex;
CSpinButtonCtrl m_scalexSpin;
int m_scaley;
CSpinButtonCtrl m_scaleySpin;
int m_borderStyle;
int m_borderWidth;
CSpinButtonCtrl m_borderWidthSpin;
int m_shadowDepth;
CSpinButtonCtrl m_shadowDepthSpin;
int m_screenAlignment;
CRect m_margin;
CSpinButtonCtrl m_marginLeftSpin;
CSpinButtonCtrl m_marginRightSpin;
CSpinButtonCtrl m_marginTopSpin;
CSpinButtonCtrl m_marginBottomSpin;
std::array<CColorButton, 4> m_color;
std::array<int, 4> m_alpha;
std::array<CSliderCtrl, 4> m_alphaSliders;
BOOL m_bLinkAlphaSliders;
void AskColor(int i);
public:
CStyleEditorDialog(CString title, STSStyle* pstss, CWnd* pParent = nullptr);
virtual ~CStyleEditorDialog();
void GetStyle(STSStyle& stss) const { stss = m_stss; }
// Dialog Data
enum { IDD = IDD_STYLEDIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnInitDialog();
virtual void OnOK();
DECLARE_MESSAGE_MAP()
afx_msg void OnChooseFont();
afx_msg void OnChoosePrimaryColor();
afx_msg void OnChooseSecondaryColor();
afx_msg void OnChooseOutlineColor();
afx_msg void OnChooseShadowColor();
afx_msg void OnLinkAlphaSlidersChanged();
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
};
|
/*
* Copyright (C) 2017 OTA keys S.A.
* 2018 Acutam Automation, LLC
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup drivers_ads101x
* @{
*
* @file
* @brief Register definition for ADS101x/111x devices
*
* @author Vincent Dupont <vincent@otakeys.com>
* @author Matthew Blue <matthew.blue.neuro@gmail.com>
*/
#ifndef ADS101X_REGS_H
#define ADS101X_REGS_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name ADS101x/111x register addresses
* @{
*/
#define ADS101X_CONV_RES_ADDR (0)
#define ADS101X_CONF_ADDR (1)
#define ADS101X_LOW_LIMIT_ADDR (2)
#define ADS101X_HIGH_LIMIT_ADDR (3)
/** @} */
/**
* @name ADS101x/111x Config flags
*
* Comparator flags have no effect on ADS1013 and ADS1113.
*
* @{
*/
#define ADS101X_CONF_OS_CONV (1 << 7)
#define ADS101X_CONF_COMP_MODE_WIND (1 << 4)
#define ADS101X_CONF_COMP_DIS ((1 << 1) | (1 << 0))
/** @} */
/**
* @name ADS101x/111x mux settings
*
* Supports both single mode and differential.
* This has no effect on ADS1013-4 and ADS1113-4.
*
* @{
*/
#define ADS101X_MUX_MASK ((1 << 6) | (1 << 5) | (1 << 4))
#define ADS101X_AIN0_DIFFM_AIN1 ((0 << 6) | (0 << 5) | (0 << 4))
#define ADS101X_AIN0_DIFFM_AIN3 ((0 << 6) | (0 << 5) | (1 << 4))
#define ADS101X_AIN1_DIFFM_AIN3 ((0 << 6) | (1 << 5) | (0 << 4))
#define ADS101X_AIN2_DIFFM_AIN3 ((0 << 6) | (1 << 5) | (1 << 4))
#define ADS101X_AIN0_SINGM ((1 << 6) | (0 << 5) | (0 << 4))
#define ADS101X_AIN1_SINGM ((1 << 6) | (0 << 5) | (1 << 4))
#define ADS101X_AIN2_SINGM ((1 << 6) | (1 << 5) | (0 << 4))
#define ADS101X_AIN3_SINGM ((1 << 6) | (1 << 5) | (1 << 4))
/** @} */
/**
* @name ADS101x/111x programmable gain
*
* Sets the full-scale range (max voltage value).
* This has no effect on ADS1013 and ADS1113 (both use 2.048V FSR).
*
* @{
*/
#define ADS101X_PGA_MASK ((1 << 3) | (1 << 2) | (1 << 1))
#define ADS101X_PGA_FSR_6V144 ((0 << 3) | (0 << 2) | (0 << 1))
#define ADS101X_PGA_FSR_4V096 ((0 << 3) | (0 << 2) | (1 << 1))
#define ADS101X_PGA_FSR_2V048 ((0 << 3) | (1 << 2) | (0 << 1))
#define ADS101X_PGA_FSR_1V024 ((0 << 3) | (1 << 2) | (1 << 1))
#define ADS101X_PGA_FSR_0V512 ((1 << 3) | (0 << 2) | (0 << 1))
#define ADS101X_PGA_FSR_0V256 ((1 << 3) | (0 << 2) | (1 << 1))
/** @} */
/**
* @name ADS101x/111x data rate settings
*
* Determines how quickly samples are taken (even on one-shot mode)
*
* @{
*/
#define ADS101X_DATAR_MASK ((1 << 7) | (1 << 6) | (1 << 5))
#define ADS101X_DATAR_128 ((0 << 7) | (0 << 6) | (0 << 5))
#define ADS101X_DATAR_250 ((0 << 7) | (0 << 6) | (1 << 5))
#define ADS101X_DATAR_490 ((0 << 7) | (1 << 6) | (0 << 5))
#define ADS101X_DATAR_920 ((0 << 7) | (1 << 6) | (1 << 5))
#define ADS101X_DATAR_1600 ((1 << 7) | (0 << 6) | (0 << 5))
#define ADS101X_DATAR_2400 ((1 << 7) | (0 << 6) | (1 << 5))
#define ADS101X_DATAR_3300 ((1 << 7) | (1 << 6) | (0 << 5))
#ifdef __cplusplus
}
#endif
#endif /* ADS101X_REGS_H */
/** @} */
|
/*
* Copyright (C) 2019 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_atmega256rfr2-xpro
* @{
*
* @file
* @brief Peripheral MCU configuration for the Atmega256RFR2 Xplained Pro
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef PERIPH_CONF_H
#define PERIPH_CONF_H
#include "periph_conf_atmega_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* PERIPH_CONF_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_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_
#define CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_
#include "base/files/file.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "content/browser/download/drag_download_file.h"
#include "ui/base/dragdrop/download_file_interface.h"
class GURL;
namespace base {
class FilePath;
}
namespace content {
// Parse the download metadata set in DataTransfer.setData. The metadata
// consists of a set of the following values separated by ":"
// * MIME type
// * File name
// * URL
// If the file name contains special characters, they need to be escaped
// appropriately.
// For example, we can have
// text/plain:example.txt:http://example.com/example.txt
bool ParseDownloadMetadata(const base::string16& metadata,
base::string16* mime_type,
base::FilePath* file_name,
GURL* url);
// Create a new file at the specified path. If the file already exists, try to
// insert the sequential unifier to produce a new file, like foo-01.txt.
// Return a File if successful.
CONTENT_EXPORT base::File CreateFileForDrop(base::FilePath* file_path);
// Implementation of DownloadFileObserver to finalize the download process.
class PromiseFileFinalizer : public ui::DownloadFileObserver {
public:
explicit PromiseFileFinalizer(DragDownloadFile* drag_file_downloader);
// DownloadFileObserver methods.
void OnDownloadCompleted(const base::FilePath& file_path) override;
void OnDownloadAborted() override;
protected:
~PromiseFileFinalizer() override;
private:
void Cleanup();
scoped_refptr<DragDownloadFile> drag_file_downloader_;
DISALLOW_COPY_AND_ASSIGN(PromiseFileFinalizer);
};
} // namespace content
#endif // CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_
|
/*
* felicagpio.c
*
*/
/*
* INCLUDE FILES FOR MODULE
*/
#include <linux/gpio.h>
#include "felica_gpio.h"
/* Debug message feature */
/* #define FELICA_DEBUG_MSG */
/*
* Description :
* Input :
* Output :
*/
int felica_gpio_open(int gpionum, int direction, int value)
{
int rc = 0;
char int_name[30];
if(direction == GPIO_DIRECTION_IN)
{
#ifndef FUNCTION_P2_ONLY
rc = gpio_tlmm_config(GPIO_CFG(gpionum, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CONFIG_ENABLE);
if(rc)
{
FELICA_DEBUG_MSG("[FELICA] ERROR - gpio_tlmm_config \n");
return rc;
}
#endif
if(GPIO_FELICA_INT == gpionum)
{
sprintf(int_name, "felica_int_%02d", gpionum);
gpio_request(gpionum, int_name);
}
#ifdef FELICA_LED_SUPPORT
if(GPIO_FELICA_RFS == gpionum)
{
sprintf(int_name, "felica_rfs_%02d", gpionum);
gpio_request(gpionum, int_name);
}
#endif
rc = gpio_direction_input((unsigned)gpionum);
if(rc)
{
FELICA_DEBUG_MSG("[FELICA] ERROR - gpio_direction_input \n");
return rc;
}
}
else
{
#ifndef FUNCTION_P2_ONLY
rc = gpio_tlmm_config(GPIO_CFG(gpionum, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CONFIG_ENABLE);
if(rc)
{
FELICA_DEBUG_MSG("[FELICA] ERROR - gpio_tlmm_config \n");
return rc;
}
#endif
rc = gpio_direction_output((unsigned)gpionum, value);
if(rc)
{
FELICA_DEBUG_MSG("[FELICA] ERROR - gpio_direction_output \n");
return rc;
}
}
return rc;
}
/*
* Description :
* Input :
* Output :
*/
void felica_gpio_write(int gpionum, int value)
{
gpio_set_value(gpionum, value);
}
/*
* Description :
* Input :
* Output :
*/
int felica_gpio_read(int gpionum)
{
return gpio_get_value(gpionum);
}
|
#include <linux/init.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/regulator/machine.h>
#include <linux/i2c.h>
#include <mach/irqs.h>
#include <linux/power_supply.h>
#include <linux/mfd/axp-mfd.h>
#include "axp-cfg.h"
static struct platform_device virt[]={
{
.name = "reg-18-cs-ldo2",
.id = -1,
.dev = {
.platform_data = "axp18_analog/fm",
}
},{
.name = "reg-18-cs-ldo3",
.id = -1,
.dev = {
.platform_data = "axp18_flash",
}
},{
.name = "reg-18-cs-ldo4",
.id = -1,
.dev = {
.platform_data = "axp18_spdif",
}
},{
.name = "reg-18-cs-ldo5",
.id = -1,
.dev = {
.platform_data = "axp18_others",
}
},{
.name = "reg-18-cs-buck1",
.id = -1,
.dev = {
.platform_data = "axp18_io",
}
},{
.name = "reg-18-cs-buck2",
.id = -1,
.dev = {
.platform_data = "axp18_core",
}
},{
.name = "reg-18-cs-buck3",
.id = -1,
.dev = {
.platform_data = "axp18_memory",
}
},{
.name = "reg-18-cs-sw1",
.id = -1,
.dev = {
.platform_data = "axp18_sdram",
}
},{
.name = "reg-18-cs-sw2",
.id = -1,
.dev = {
.platform_data = "axp18_sdcard",
}
},
};
static int __init virtual_init(void)
{
int j,ret;
for (j = 0; j < ARRAY_SIZE(virt); j++){
ret = platform_device_register(&virt[j]);
if (ret)
goto creat_devices_failed;
}
return ret;
creat_devices_failed:
while (j--)
platform_device_register(&virt[j]);
return ret;
}
module_init(virtual_init);
static void __exit virtual_exit(void)
{
int j;
for (j = ARRAY_SIZE(virt) - 1; j >= 0; j--){
platform_device_unregister(&virt[j]);
}
}
module_exit(virtual_exit);
MODULE_DESCRIPTION("Krosspower axp regulator test");
MODULE_AUTHOR("Donglu Zhang Krosspower");
MODULE_LICENSE("GPL"); |
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_KERNELS_SCAN_OPS_H_
#define TENSORFLOW_CORE_KERNELS_SCAN_OPS_H_
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/tensor_types.h"
namespace tensorflow {
namespace functor {
typedef Eigen::Index Index;
template <typename Device, typename Reducer, typename T>
struct Scan {
void operator()(const Device& d, typename TTypes<T, 3>::ConstTensor in,
typename TTypes<T, 3>::Tensor out, const Reducer& reducer,
const bool reverse, const bool exclusive) {
// Perform the reverse ops directly with Eigen, which avoids copying the
// tensor twice compared to using individual ops.
Eigen::array<bool, 3> dims;
dims[0] = false;
dims[1] = reverse;
dims[2] = false;
To32Bit(out).device(d) =
To32Bit(in).reverse(dims).scan(1, reducer, exclusive).reverse(dims);
}
};
} // namespace functor
} // namespace tensorflow
#endif // TENSORFLOW_CORE_KERNELS_SCAN_OPS_H_
|
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Remote Assistance
*
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* 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 FREERDP_REMOTE_ASSISTANCE_H
#define FREERDP_REMOTE_ASSISTANCE_H
#include <freerdp/api.h>
#include <freerdp/freerdp.h>
struct rdp_assistance_file
{
UINT32 Type;
char* Username;
char* LHTicket;
char* RCTicket;
char* PassStub;
UINT32 DtStart;
UINT32 DtLength;
BOOL LowSpeed;
BOOL RCTicketEncrypted;
char* ConnectionString1;
char* ConnectionString2;
BYTE* EncryptedPassStub;
int EncryptedPassStubLength;
BYTE* EncryptedLHTicket;
int EncryptedLHTicketLength;
char* MachineAddress;
UINT32 MachinePort;
UINT32 MachineCount;
char** MachineAddresses;
UINT32* MachinePorts;
char* RASessionId;
char* RASpecificParams;
};
typedef struct rdp_assistance_file rdpAssistanceFile;
#ifdef __cplusplus
extern "C" {
#endif
FREERDP_API BYTE* freerdp_assistance_hex_string_to_bin(const char* str, int* size);
FREERDP_API char* freerdp_assistance_bin_to_hex_string(const BYTE* data, int size);
FREERDP_API int freerdp_assistance_parse_connection_string1(rdpAssistanceFile* file);
FREERDP_API int freerdp_assistance_parse_connection_string2(rdpAssistanceFile* file);
FREERDP_API char* freerdp_assistance_generate_pass_stub(DWORD flags);
FREERDP_API char* freerdp_assistance_construct_expert_blob(const char* name, const char* pass);
FREERDP_API BYTE* freerdp_assistance_encrypt_pass_stub(const char* password, const char* passStub, int* pEncryptedSize);
FREERDP_API int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* buffer, size_t size);
FREERDP_API int freerdp_assistance_parse_file(rdpAssistanceFile* file, const char* name);
FREERDP_API int freerdp_assistance_decrypt(rdpAssistanceFile* file, const char* password);
FREERDP_API int freerdp_client_populate_settings_from_assistance_file(rdpAssistanceFile* file, rdpSettings* settings);
FREERDP_API rdpAssistanceFile* freerdp_assistance_file_new();
FREERDP_API void freerdp_assistance_file_free(rdpAssistanceFile* file);
#ifdef __cplusplus
}
#endif
#endif /* FREERDP_REMOTE_ASSISTANCE_H */
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Users/ex3ndr/Develop/actor-proprietary/actor-apps/core/src/main/java/im/actor/model/api/AppCounters.java
//
#ifndef _APAppCounters_H_
#define _APAppCounters_H_
#include "J2ObjC_header.h"
#include "im/actor/model/droidkit/bser/BserObject.h"
@class BSBserValues;
@class BSBserWriter;
@class JavaLangInteger;
@interface APAppCounters : BSBserObject
#pragma mark Public
- (instancetype)init;
- (instancetype)initWithJavaLangInteger:(JavaLangInteger *)globalCounter;
- (JavaLangInteger *)getGlobalCounter;
- (void)parseWithBSBserValues:(BSBserValues *)values;
- (void)serializeWithBSBserWriter:(BSBserWriter *)writer;
- (NSString *)description;
@end
J2OBJC_EMPTY_STATIC_INIT(APAppCounters)
FOUNDATION_EXPORT void APAppCounters_initWithJavaLangInteger_(APAppCounters *self, JavaLangInteger *globalCounter);
FOUNDATION_EXPORT APAppCounters *new_APAppCounters_initWithJavaLangInteger_(JavaLangInteger *globalCounter) NS_RETURNS_RETAINED;
FOUNDATION_EXPORT void APAppCounters_init(APAppCounters *self);
FOUNDATION_EXPORT APAppCounters *new_APAppCounters_init() NS_RETURNS_RETAINED;
J2OBJC_TYPE_LITERAL_HEADER(APAppCounters)
typedef APAppCounters ImActorModelApiAppCounters;
#endif // _APAppCounters_H_
|
/***************************************************************************
qgspointcloudlayer3drendererwidget.h
------------------------------
Date : November 2020
Copyright : (C) 2020 by Nedjima Belgacem
Email : belgacem dot nedjima at gmail dot 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 QGSPOINTCLOUDLAYER3DRENDERERWIDGET_H
#define QGSPOINTCLOUDLAYER3DRENDERERWIDGET_H
#include <memory>
#include "qgsmaplayerconfigwidget.h"
#include "qgspointcloudlayer3drenderer.h"
#include "qgsmaplayerconfigwidgetfactory.h"
#include "qgspointcloud3dsymbol.h"
class QCheckBox;
class QgsPointCloudLayer;
class QgsMapCanvas;
class QgsPointCloud3DSymbolWidget;
//! Widget for configuration of 3D renderer of a point cloud layer
class QgsPointCloudLayer3DRendererWidget : public QgsMapLayerConfigWidget
{
Q_OBJECT
public:
explicit QgsPointCloudLayer3DRendererWidget( QgsPointCloudLayer *layer, QgsMapCanvas *canvas, QWidget *parent = nullptr );
void syncToLayer( QgsMapLayer *layer ) override;
void setDockMode( bool dockMode ) override;
//! no transfer of ownership
void setRenderer( const QgsPointCloudLayer3DRenderer *renderer, QgsPointCloudLayer *layer );
//! no transfer of ownership
QgsPointCloudLayer3DRenderer *renderer();
public slots:
void apply() override;
private:
QgsPointCloud3DSymbolWidget *mWidgetPointCloudSymbol = nullptr;
};
class QgsPointCloudLayer3DRendererWidgetFactory : public QObject, public QgsMapLayerConfigWidgetFactory
{
Q_OBJECT
public:
explicit QgsPointCloudLayer3DRendererWidgetFactory( QObject *parent = nullptr );
QgsMapLayerConfigWidget *createWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, bool dockWidget, QWidget *parent ) const override;
bool supportLayerPropertiesDialog() const override;
bool supportsLayer( QgsMapLayer *layer ) const override;
QString layerPropertiesPagePositionHint() const override;
bool supportsStyleDock() const override;
};
#endif // QGSPOINTCLOUDLAYER3DRENDERERWIDGET_H
|
/* Common Backend requirements.
Copyright (C) 2015 Free Software Foundation, Inc.
Contributed by Andrew MacLeod <amacleod@redhat.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 GCC_BACKEND_H
#define GCC_BACKEND_H
/* This is an aggregation header file. This means it should contain only
other include files. */
#include "tm.h"
#include "function.h"
#include "bitmap.h"
#include "sbitmap.h"
#include "basic-block.h"
#include "cfg.h"
#endif /*GCC_BACKEND_H */
|
//===-- tsan_report.h -------------------------------------------*- C++ -*-===//
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a part of ThreadSanitizer (TSan), a race detector.
//
//===----------------------------------------------------------------------===//
#ifndef TSAN_REPORT_H
#define TSAN_REPORT_H
#include "tsan_defs.h"
#include "tsan_vector.h"
namespace __tsan {
enum ReportType {
ReportTypeRace,
ReportTypeUseAfterFree,
ReportTypeThreadLeak,
ReportTypeMutexDestroyLocked,
ReportTypeSignalUnsafe,
ReportTypeErrnoInSignal
};
struct ReportStack {
ReportStack *next;
char *module;
uptr offset;
uptr pc;
char *func;
char *file;
int line;
int col;
};
struct ReportMopMutex {
u64 id;
bool write;
};
struct ReportMop {
int tid;
uptr addr;
int size;
bool write;
bool atomic;
Vector<ReportMopMutex> mset;
ReportStack *stack;
ReportMop();
};
enum ReportLocationType {
ReportLocationGlobal,
ReportLocationHeap,
ReportLocationStack,
ReportLocationTLS,
ReportLocationFD
};
struct ReportLocation {
ReportLocationType type;
uptr addr;
uptr size;
char *module;
uptr offset;
int tid;
int fd;
char *name;
char *file;
int line;
ReportStack *stack;
};
struct ReportThread {
int id;
uptr pid;
bool running;
char *name;
int parent_tid;
ReportStack *stack;
};
struct ReportMutex {
u64 id;
bool destroyed;
ReportStack *stack;
};
class ReportDesc {
public:
ReportType typ;
Vector<ReportStack*> stacks;
Vector<ReportMop*> mops;
Vector<ReportLocation*> locs;
Vector<ReportMutex*> mutexes;
Vector<ReportThread*> threads;
ReportStack *sleep;
ReportDesc();
~ReportDesc();
private:
ReportDesc(const ReportDesc&);
void operator = (const ReportDesc&);
};
// Format and output the report to the console/log. No additional logic.
void PrintReport(const ReportDesc *rep);
void PrintStack(const ReportStack *stack);
} // namespace __tsan
#endif // TSAN_REPORT_H
|
/********************************************************************\
* gnc-account-merge.h *
* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope 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 GNC_ACCOUNT_MERGE_H
#define GNC_ACCOUNT_MERGE_H
#include "Account.h"
typedef enum
{
GNC_ACCOUNT_MERGE_DISPOSITION_USE_EXISTING,
GNC_ACCOUNT_MERGE_DISPOSITION_CREATE_NEW
} GncAccountMergeDisposition;
typedef struct _merge_error
{
Account *existing_acct;
Account *new_acct;
GncAccountMergeDisposition disposition;
} GncAccountMergeError;
GncAccountMergeDisposition determine_account_merge_disposition(Account *existing_acct, Account *new_acct);
GncAccountMergeDisposition determine_merge_disposition(Account *existing_root, Account *new_acct);
void account_trees_merge(Account *existing_root, Account *new_accts_root);
#endif /* GNC_ACCOUNT_MERGE_H */
|
/***************************************************************************
qgsmaprenderersequentialjob.h
--------------------------------------
Date : December 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot 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 QGSMAPRENDERERSEQUENTIALJOB_H
#define QGSMAPRENDERERSEQUENTIALJOB_H
#include "qgsmaprendererjob.h"
class QgsMapRendererCustomPainterJob;
/** Job implementation that renders everything sequentially in one thread.
*
* The resulting map image can be retrieved with renderedImage() function.
* It is safe to call that function while rendering is active to see preview of the map.
*
* @note added in 2.4
*/
class CORE_EXPORT QgsMapRendererSequentialJob : public QgsMapRendererQImageJob
{
Q_OBJECT
public:
QgsMapRendererSequentialJob( const QgsMapSettings& settings );
~QgsMapRendererSequentialJob();
virtual void start() override;
virtual void cancel() override;
virtual void waitForFinished() override;
virtual bool isActive() const override;
virtual QgsLabelingResults* takeLabelingResults() override;
// from QgsMapRendererJobWithPreview
virtual QImage renderedImage() override;
public slots:
void internalFinished();
protected:
QgsMapRendererCustomPainterJob* mInternalJob;
QImage mImage;
QPainter* mPainter;
QgsLabelingResults* mLabelingResults;
};
#endif // QGSMAPRENDERERSEQUENTIALJOB_H
|
/*
* (C) Copyright 2005
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* (C) Copyright 2004
* Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.com.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <mpc5xxx.h>
#include <pci.h>
#if defined(CONFIG_MPC5200_DDR)
#include "mt46v16m16-75.h"
#else
#include "mt48lc16m32s2-75.h"
#endif
#ifndef CONFIG_SYS_RAMBOOT
static void sdram_start (int hi_addr)
{
long hi_addr_bit = hi_addr ? 0x01000000 : 0;
/* unlock mode register */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 | hi_addr_bit;
__asm__ volatile ("sync");
/* precharge all banks */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
__asm__ volatile ("sync");
#if SDRAM_DDR
/* set mode register: extended mode */
*(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_EMODE;
__asm__ volatile ("sync");
/* set mode register: reset DLL */
*(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE | 0x04000000;
__asm__ volatile ("sync");
#endif
/* precharge all banks */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
__asm__ volatile ("sync");
/* auto refresh */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 | hi_addr_bit;
__asm__ volatile ("sync");
/* set mode register */
*(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE;
__asm__ volatile ("sync");
/* normal operation */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit;
__asm__ volatile ("sync");
}
#endif
/*
* ATTENTION: Although partially referenced initdram does NOT make real use
* use of CONFIG_SYS_SDRAM_BASE. The code does not work if CONFIG_SYS_SDRAM_BASE
* is something else than 0x00000000.
*/
phys_size_t initdram (int board_type)
{
ulong dramsize = 0;
ulong dramsize2 = 0;
#ifndef CONFIG_SYS_RAMBOOT
ulong test1, test2;
/* setup SDRAM chip selects */
*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;/* 2G at 0x0 */
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x80000000;/* disabled */
__asm__ volatile ("sync");
/* setup config registers */
*(vu_long *)MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
*(vu_long *)MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
__asm__ volatile ("sync");
#if SDRAM_DDR
/* set tap delay */
*(vu_long *)MPC5XXX_CDM_PORCFG = SDRAM_TAPDELAY;
__asm__ volatile ("sync");
#endif
/* find RAM size using SDRAM CS0 only */
sdram_start(0);
test1 = get_ram_size((ulong *)CONFIG_SYS_SDRAM_BASE, 0x80000000);
sdram_start(1);
test2 = get_ram_size((ulong *)CONFIG_SYS_SDRAM_BASE, 0x80000000);
if (test1 > test2) {
sdram_start(0);
dramsize = test1;
} else {
dramsize = test2;
}
/* memory smaller than 1MB is impossible */
if (dramsize < (1 << 20)) {
dramsize = 0;
}
/* set SDRAM CS0 size according to the amount of RAM found */
if (dramsize > 0) {
*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 + __builtin_ffs(dramsize >> 20) - 1;
} else {
*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0; /* disabled */
}
/* let SDRAM CS1 start right after CS0 */
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001e;/* 2G */
/* find RAM size using SDRAM CS1 only */
if (!dramsize)
sdram_start(0);
test2 = test1 = get_ram_size((ulong *)(CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
if (!dramsize) {
sdram_start(1);
test2 = get_ram_size((ulong *)(CONFIG_SYS_SDRAM_BASE + dramsize), 0x80000000);
}
if (test1 > test2) {
sdram_start(0);
dramsize2 = test1;
} else {
dramsize2 = test2;
}
/* memory smaller than 1MB is impossible */
if (dramsize2 < (1 << 20)) {
dramsize2 = 0;
}
/* set SDRAM CS1 size according to the amount of RAM found */
if (dramsize2 > 0) {
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize
| (0x13 + __builtin_ffs(dramsize2 >> 20) - 1);
} else {
*(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize; /* disabled */
}
#else /* CONFIG_SYS_RAMBOOT */
/* retrieve size of memory connected to SDRAM CS0 */
dramsize = *(vu_long *)MPC5XXX_SDRAM_CS0CFG & 0xFF;
if (dramsize >= 0x13) {
dramsize = (1 << (dramsize - 0x13)) << 20;
} else {
dramsize = 0;
}
/* retrieve size of memory connected to SDRAM CS1 */
dramsize2 = *(vu_long *)MPC5XXX_SDRAM_CS1CFG & 0xFF;
if (dramsize2 >= 0x13) {
dramsize2 = (1 << (dramsize2 - 0x13)) << 20;
} else {
dramsize2 = 0;
}
#endif /* CONFIG_SYS_RAMBOOT */
return dramsize + dramsize2;
}
int checkboard (void)
{
puts ("Board: CANMB\n");
return 0;
}
int board_early_init_r (void)
{
*(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
*(vu_long *)MPC5XXX_BOOTCS_START =
*(vu_long *)MPC5XXX_CS0_START = START_REG(CONFIG_SYS_FLASH_BASE);
*(vu_long *)MPC5XXX_BOOTCS_STOP =
*(vu_long *)MPC5XXX_CS0_STOP = STOP_REG(CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_SIZE);
return 0;
}
|
/*++
Copyright 1996 - 1997 Microsoft Corporation
Module Name:
privs.c
Abstract:
This module illustrates how to use the Windows NT LSA security API
to manage account privileges on the local or a remote machine.
When targetting a domain controller for privilege update operations,
be sure to target the primary domain controller for the domain.
The privilege settings are replicated by the primary domain controller
to each backup domain controller as appropriate. The NetGetDCName()
Lan Manager API call can be used to get the primary domain controller
computer name from a domain name.
For a list of privilges, consult winnt.h, and search for
SE_ASSIGNPRIMARYTOKEN_NAME.
For a list of logon rights, which can also be assigned using this
sample code, consult ntsecapi.h, and search for SE_BATCH_LOGON_NAME
You can use domain\account as argv[1]. For instance, mydomain\scott will
grant the privilege to the mydomain domain account scott.
The optional target machine is specified as argv[2], otherwise, the
account database is updated on the local machine.
The LSA APIs used by this sample are Unicode only.
Use LsaRemoveAccountRights() to remove account rights.
Author:
Scott Field (sfield) 17-Apr-96
Minor cleanup
Scott Field (sfield) 12-Jul-95
--*/
#pragma once
NTSTATUS
OpenPolicy(
LPWSTR ServerName, // machine to open policy on (Unicode)
DWORD DesiredAccess, // desired access to policy
PLSA_HANDLE PolicyHandle // resultant policy handle
);
BOOL
GetAccountSid(
LPCTSTR SystemName, // where to lookup account
LPCTSTR AccountName, // account of interest
PSID *Sid // resultant buffer containing SID
);
NTSTATUS
SetPrivilegeOnAccount(
LSA_HANDLE PolicyHandle, // open policy handle
PSID AccountSid, // SID to grant privilege to
LPWSTR PrivilegeName, // privilege to grant (Unicode)
BOOL bEnable // enable or disable
);
void
InitLsaString(
PLSA_UNICODE_STRING LsaString, // destination
LPWSTR String // source (Unicode)
);
BOOL
GrantUserRight(
PSID psidAccountSid,
LPWSTR pszUserRight,
BOOL bEnable
); |
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012,2013 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT 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.
ChibiOS/RT 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/>.
---
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes ChibiOS/RT, without being obliged to provide
the source code for any proprietary components. See the file exception.txt
for full details of how and when the exception can be applied.
*/
/**
* @file GCC/ARMCMx/STM32F3xx/cmparams.h
* @brief ARM Cortex-M4 parameters for the STM32F3xx.
*
* @defgroup ARMCMx_STM32F3xx STM32F3xx Specific Parameters
* @ingroup ARMCMx_SPECIFIC
* @details This file contains the Cortex-M4 specific parameters for the
* STM32F3xx platform.
* @{
*/
#ifndef _CMPARAMS_H_
#define _CMPARAMS_H_
/**
* @brief Cortex core model.
*/
#define CORTEX_MODEL CORTEX_M4
/**
* @brief Systick unit presence.
*/
#define CORTEX_HAS_ST TRUE
/**
* @brief Memory Protection unit presence.
*/
#define CORTEX_HAS_MPU TRUE
/**
* @brief Floating Point unit presence.
*/
#define CORTEX_HAS_FPU TRUE
/**
* @brief Number of bits in priority masks.
*/
#define CORTEX_PRIORITY_BITS 4
#endif /* _CMPARAMS_H_ */
/** @} */
|
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_INSTANT_TYPES_H_
#define CHROME_COMMON_INSTANT_TYPES_H_
#include <string>
#include <utility>
#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "url/gurl.h"
// ID used by Instant code to refer to objects (e.g. Autocomplete results, Most
// Visited items) that the Instant page needs access to.
typedef int InstantRestrictedID;
// A wrapper to hold Instant suggested text and its metadata. Used to tell the
// server what suggestion to prefetch.
struct InstantSuggestion {
InstantSuggestion();
InstantSuggestion(const base::string16& in_text,
const std::string& in_metadata);
~InstantSuggestion();
// Full suggested text.
base::string16 text;
// JSON metadata from the server response which produced this suggestion.
std::string metadata;
};
// The alignment of the theme background image.
enum ThemeBackgroundImageAlignment {
THEME_BKGRND_IMAGE_ALIGN_CENTER,
THEME_BKGRND_IMAGE_ALIGN_LEFT,
THEME_BKGRND_IMAGE_ALIGN_TOP,
THEME_BKGRND_IMAGE_ALIGN_RIGHT,
THEME_BKGRND_IMAGE_ALIGN_BOTTOM,
};
// The tiling of the theme background image.
enum ThemeBackgroundImageTiling {
THEME_BKGRND_IMAGE_NO_REPEAT,
THEME_BKGRND_IMAGE_REPEAT_X,
THEME_BKGRND_IMAGE_REPEAT_Y,
THEME_BKGRND_IMAGE_REPEAT,
};
// The RGBA color components for the text and links of the theme.
struct RGBAColor {
RGBAColor();
~RGBAColor();
bool operator==(const RGBAColor& rhs) const;
// The color in RGBA format where the R, G, B and A values
// are between 0 and 255 inclusive and always valid.
uint8 r;
uint8 g;
uint8 b;
uint8 a;
};
// Theme background settings for the NTP.
struct ThemeBackgroundInfo {
ThemeBackgroundInfo();
~ThemeBackgroundInfo();
bool operator==(const ThemeBackgroundInfo& rhs) const;
// True if the default theme is selected.
bool using_default_theme;
// The theme background color in RGBA format always valid.
RGBAColor background_color;
// The theme text color in RGBA format.
RGBAColor text_color;
// The theme link color in RGBA format.
RGBAColor link_color;
// The theme text color light in RGBA format.
RGBAColor text_color_light;
// The theme color for the header in RGBA format.
RGBAColor header_color;
// The theme color for the section border in RGBA format.
RGBAColor section_border_color;
// The theme id for the theme background image.
// Value is only valid if there's a custom theme background image.
std::string theme_id;
// The theme background image horizontal alignment is only valid if |theme_id|
// is valid.
ThemeBackgroundImageAlignment image_horizontal_alignment;
// The theme background image vertical alignment is only valid if |theme_id|
// is valid.
ThemeBackgroundImageAlignment image_vertical_alignment;
// The theme background image tiling is only valid if |theme_id| is valid.
ThemeBackgroundImageTiling image_tiling;
// The theme background image height.
// Value is only valid if |theme_id| is valid.
uint16 image_height;
// True if theme has attribution logo.
// Value is only valid if |theme_id| is valid.
bool has_attribution;
// True if theme has an alternate logo.
bool logo_alternate;
};
struct InstantMostVisitedItem {
// The URL of the Most Visited item.
GURL url;
// The title of the Most Visited page. May be empty, in which case the |url|
// is used as the title.
base::string16 title;
};
// An InstantMostVisitedItem along with its assigned restricted ID.
typedef std::pair<InstantRestrictedID, InstantMostVisitedItem>
InstantMostVisitedItemIDPair;
#endif // CHROME_COMMON_INSTANT_TYPES_H_
|
//
// ErrorHandler.h
//
// $Id: //poco/1.4/XML/include/Poco/SAX/ErrorHandler.h#1 $
//
// Library: XML
// Package: SAX
// Module: SAX
//
// SAX ErrorHandler Interface.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef SAX_ErrorHandler_INCLUDED
#define SAX_ErrorHandler_INCLUDED
#include "Poco/XML/XML.h"
namespace Poco {
namespace XML {
class SAXException;
class XML_API ErrorHandler
/// If a SAX application needs to implement customized error handling, it must
/// implement this interface and then register an instance with the XML reader
/// using the setErrorHandler method. The parser will then report all errors and
/// warnings through this interface.
///
/// WARNING: If an application does not register an ErrorHandler, XML parsing errors
/// will go unreported, except that SAXParseExceptions will be thrown for fatal errors.
/// In order to detect validity errors, an ErrorHandler that does something with error()
/// calls must be registered.
///
/// For XML processing errors, a SAX driver must use this interface in preference to
/// throwing an exception: it is up to the application to decide whether to throw an
/// exception for different types of errors and warnings. Note, however, that there is no
/// requirement that the parser continue to report additional errors after a call to
/// fatalError. In other words, a SAX driver class may throw an exception after reporting
/// any fatalError. Also parsers may throw appropriate exceptions for non-XML errors. For
/// example, XMLReader::parse() would throw an IOException for errors accessing entities or
/// the document.
{
public:
virtual void warning(const SAXException& exc) = 0;
/// Receive notification of a warning.
///
/// SAX parsers will use this method to report conditions that are not errors or fatal
/// errors as defined by the XML recommendation. The default behaviour is to take no action.
///
/// The SAX parser must continue to provide normal parsing events after invoking this method:
/// it should still be possible for the application to process the document through to the end.
///
/// Filters may use this method to report other, non-XML warnings as well.
virtual void error(const SAXException& exc) = 0;
/// Receive notification of a recoverable error.
///
/// This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0
/// Recommendation. For example, a validating parser would use this callback to report
/// the violation of a validity constraint. The default behaviour is to take no action.
///
/// The SAX parser must continue to provide normal parsing events after invoking this
/// method: it should still be possible for the application to process the document through
/// to the end. If the application cannot do so, then the parser should report a fatal error
/// even if the XML recommendation does not require it to do so.
///
/// Filters may use this method to report other, non-XML errors as well.
virtual void fatalError(const SAXException& exc) = 0;
/// Receive notification of a non-recoverable error.
/// The application must assume that the document is unusable after the parser has
/// invoked this method, and should continue (if at all) only for the sake of collecting
/// additional error messages: in fact, SAX parsers are free to stop reporting any other
/// events once this method has been invoked.
protected:
virtual ~ErrorHandler();
};
} } // namespace Poco::XML
#endif // SAX_ErrorHandler_INCLUDED
|
#ifndef LIGHT_TEMT_H
#define LIGHT_TEMT_H
#include <std.h>
extern uint16_t adc_light_temt;
void light_temt_init( void );
void light_temt_periodic( void );
#endif
|
/***************************************************************************
qgsvaluerelationconfigdlg.h
--------------------------------------
Date : 5.1.2014
Copyright : (C) 2014 Matthias Kuhn
Email : matthias at opengis dot ch
***************************************************************************
* *
* 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 QGSVALUERELATIONCONFIGDLG_H
#define QGSVALUERELATIONCONFIGDLG_H
#include "ui_qgsvaluerelationconfigdlgbase.h"
#include "qgseditorconfigwidget.h"
#include "qgis_gui.h"
SIP_NO_FILE
/**
* \ingroup gui
* \class QgsValueRelationConfigDlg
* \note not available in Python bindings
*/
class GUI_EXPORT QgsValueRelationConfigDlg : public QgsEditorConfigWidget, private Ui::QgsValueRelationConfigDlgBase
{
Q_OBJECT
public:
explicit QgsValueRelationConfigDlg( QgsVectorLayer *vl, int fieldIdx, QWidget *parent = nullptr );
public slots:
void editExpression();
// QgsEditorConfigWidget interface
public:
QVariantMap config() override;
void setConfig( const QVariantMap &config ) override;
};
#endif // QGSVALUERELATIONCONFIGDLG_H
|
/*
* (C) Copyright 2000
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
/*
* Boot support
*/
#include <common.h>
#include <command.h>
#include <devices.h>
extern void _do_coninfo (void);
int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
{
int i, l;
/* Scan for valid output and input devices */
puts ("List of available devices:\n");
for (i = 1; i <= ListNumItems (devlist); i++) {
device_t *dev = ListGetPtrToItem (devlist, i);
printf ("%-8s %08x %c%c%c ",
dev->name,
dev->flags,
(dev->flags & DEV_FLAGS_SYSTEM) ? 'S' : '.',
(dev->flags & DEV_FLAGS_INPUT) ? 'I' : '.',
(dev->flags & DEV_FLAGS_OUTPUT) ? 'O' : '.');
for (l = 0; l < MAX_FILES; l++) {
if (stdio_devices[l] == dev) {
printf ("%s ", stdio_names[l]);
}
}
putc ('\n');
}
return 0;
}
/***************************************************/
U_BOOT_CMD(
coninfo, 3, 1, do_coninfo,
"coninfo - print console devices and information\n",
""
);
|
/* { dg-do compile } */
/* { dg-options "-O2 isa_rev>=1 -mgp32" } */
/* { dg-final { scan-assembler-not "\tmul\t" } } */
/* { dg-final { scan-assembler "\tmadd\t" } } */
NOMIPS16 long long
f1 (int *a, int *b, int n)
{
long long int x;
int i;
x = 0;
for (i = 0; i < n; i++)
x += (long long) a[i] * b[i];
return x;
}
|
/* Copyright (c) 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// GTLServiceCompute.h
//
// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
// Compute Engine API (compute/v1beta14)
// Description:
// API for the Google Compute Engine service.
// Documentation:
// https://developers.google.com/compute/docs/reference/v1beta14
// Classes:
// GTLServiceCompute (0 custom class methods, 0 custom properties)
#if GTL_BUILT_AS_FRAMEWORK
#import "GTL/GTLService.h"
#else
#import "GTLService.h"
#endif
@interface GTLServiceCompute : GTLService
// No new methods
// Clients should create a standard query with any of the class methods in
// GTLQueryCompute.h. The query can the be sent with GTLService's execute
// methods,
//
// - (GTLServiceTicket *)executeQuery:(GTLQuery *)query
// completionHandler:(void (^)(GTLServiceTicket *ticket,
// id object, NSError *error))handler;
// or
// - (GTLServiceTicket *)executeQuery:(GTLQuery *)query
// delegate:(id)delegate
// didFinishSelector:(SEL)finishedSelector;
//
// where finishedSelector has a signature of:
//
// - (void)serviceTicket:(GTLServiceTicket *)ticket
// finishedWithObject:(id)object
// error:(NSError *)error;
//
// The object passed to the completion handler or delegate method
// is a subclass of GTLObject, determined by the query method executed.
@end
|
// RUN: %clang_cc1 %s -triple x86_64-apple-darwin -emit-llvm -o - | FileCheck %s
// PR 5995
struct s {
int word;
struct {
int filler __attribute__ ((aligned (8)));
};
};
void func (struct s *s)
{
// CHECK: load %struct.s**{{.*}}align 8
s->word = 0;
}
|
#ifndef __ASM_SH64_SIGNAL_H
#define __ASM_SH64_SIGNAL_H
/*
* 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.
*
* include/asm-sh64/signal.h
*
* Copyright (C) 2000, 2001 Paolo Alberelli
*
*/
#include <linux/types.h>
#include <asm/processor.h>
/* Avoid too many header ordering problems. */
struct siginfo;
#define _NSIG 64
#define _NSIG_BPW 32
#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
typedef unsigned long old_sigset_t; /* at least 32 bits */
typedef struct {
unsigned long sig[_NSIG_WORDS];
} sigset_t;
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
#define SIGILL 4
#define SIGTRAP 5
#define SIGABRT 6
#define SIGIOT 6
#define SIGBUS 7
#define SIGFPE 8
#define SIGKILL 9
#define SIGUSR1 10
#define SIGSEGV 11
#define SIGUSR2 12
#define SIGPIPE 13
#define SIGALRM 14
#define SIGTERM 15
#define SIGSTKFLT 16
#define SIGCHLD 17
#define SIGCONT 18
#define SIGSTOP 19
#define SIGTSTP 20
#define SIGTTIN 21
#define SIGTTOU 22
#define SIGURG 23
#define SIGXCPU 24
#define SIGXFSZ 25
#define SIGVTALRM 26
#define SIGPROF 27
#define SIGWINCH 28
#define SIGIO 29
#define SIGPOLL SIGIO
/*
#define SIGLOST 29
*/
#define SIGPWR 30
#define SIGSYS 31
#define SIGUNUSED 31
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
/*
* SA_FLAGS values:
*
* SA_ONSTACK indicates that a registered stack_t will be used.
* SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
* SA_RESTART flag to get restarting signals (which were the default long ago)
* SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
* SA_RESETHAND clears the handler when the signal is delivered.
* SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
* SA_NODEFER prevents the current signal from being masked in the handler.
*
* SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
* Unix names RESETHAND and NODEFER respectively.
*/
#define SA_NOCLDSTOP 0x00000001
#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
#define SA_SIGINFO 0x00000004
#define SA_ONSTACK 0x08000000
#define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000
#define SA_NOMASK SA_NODEFER
#define SA_ONESHOT SA_RESETHAND
#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
#define SA_RESTORER 0x04000000
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048
#define SIGSTKSZ THREAD_SIZE
#ifdef __KERNEL__
/*
* These values of sa_flags are used only by the kernel as part of the
* irq handling routines.
*
* SA_INTERRUPT is also used by the irq handling routines.
* SA_SHIRQ is for shared interrupt support on PCI and EISA.
*/
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
#endif
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
#define SIG_SETMASK 2 /* for setting the signal mask */
/* Type of a signal handler. */
typedef void (*__sighandler_t)(int);
#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
#ifdef __KERNEL__
struct old_sigaction {
__sighandler_t sa_handler;
old_sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void);
};
struct sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
void (*sa_restorer)(void);
sigset_t sa_mask; /* mask last for extensibility */
};
struct k_sigaction {
struct sigaction sa;
};
#else
/* Here we must cater to libcs that poke about in kernel headers. */
struct sigaction {
union {
__sighandler_t _sa_handler;
void (*_sa_sigaction)(int, struct siginfo *, void *);
} _u;
sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void);
};
#define sa_handler _u._sa_handler
#define sa_sigaction _u._sa_sigaction
#endif /* __KERNEL__ */
typedef struct sigaltstack {
void *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
#ifdef __KERNEL__
#include <asm/sigcontext.h>
#define sigmask(sig) (1UL << ((sig) - 1))
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */
#endif /* __ASM_SH64_SIGNAL_H */
|
/****************************************************************************
* Perceptive Solutions, Inc. PCI-2000 device driver for Linux.
*
* pci2000.h - Linux Host Driver for PCI-2000 IntelliCache SCSI Adapters
*
* Copyright (c) 1997-1999 Perceptive Solutions, Inc.
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that redistributions of source
* code retain the above copyright notice and this comment without
* modification.
*
* Technical updates and product information at:
* http://www.psidisk.com
*
* Please send questions, comments, bug reports to:
* tech@psidisk.com Technical Support
*
****************************************************************************/
#ifndef _PCI2000_H
#define _PCI2000_H
#include <linux/types.h>
#ifndef PSI_EIDE_SCSIOP
#define PSI_EIDE_SCSIOP 1
#define LINUXVERSION(v,p,s) (((v)<<16) + ((p)<<8) + (s))
/************************************************/
/* definition of standard data types */
/************************************************/
#define CHAR char
#define UCHAR unsigned char
#define SHORT short
#define USHORT unsigned short
#define BOOL long
#define LONG long
#define ULONG unsigned long
#define VOID void
typedef CHAR *PCHAR;
typedef UCHAR *PUCHAR;
typedef SHORT *PSHORT;
typedef USHORT *PUSHORT;
typedef BOOL *PBOOL;
typedef LONG *PLONG;
typedef ULONG *PULONG;
typedef VOID *PVOID;
/************************************************/
/* Misc. macros */
/************************************************/
#define ANY2SCSI(up, p) \
((UCHAR *)up)[0] = (((ULONG)(p)) >> 8); \
((UCHAR *)up)[1] = ((ULONG)(p));
#define SCSI2LONG(up) \
( (((long)*(((UCHAR *)up))) << 16) \
+ (((long)(((UCHAR *)up)[1])) << 8) \
+ ((long)(((UCHAR *)up)[2])) )
#define XANY2SCSI(up, p) \
((UCHAR *)up)[0] = ((long)(p)) >> 24; \
((UCHAR *)up)[1] = ((long)(p)) >> 16; \
((UCHAR *)up)[2] = ((long)(p)) >> 8; \
((UCHAR *)up)[3] = ((long)(p));
#define XSCSI2LONG(up) \
( (((long)(((UCHAR *)up)[0])) << 24) \
+ (((long)(((UCHAR *)up)[1])) << 16) \
+ (((long)(((UCHAR *)up)[2])) << 8) \
+ ((long)(((UCHAR *)up)[3])) )
/************************************************/
/* SCSI CDB operation codes */
/************************************************/
#define SCSIOP_TEST_UNIT_READY 0x00
#define SCSIOP_REZERO_UNIT 0x01
#define SCSIOP_REWIND 0x01
#define SCSIOP_REQUEST_BLOCK_ADDR 0x02
#define SCSIOP_REQUEST_SENSE 0x03
#define SCSIOP_FORMAT_UNIT 0x04
#define SCSIOP_READ_BLOCK_LIMITS 0x05
#define SCSIOP_REASSIGN_BLOCKS 0x07
#define SCSIOP_READ6 0x08
#define SCSIOP_RECEIVE 0x08
#define SCSIOP_WRITE6 0x0A
#define SCSIOP_PRINT 0x0A
#define SCSIOP_SEND 0x0A
#define SCSIOP_SEEK6 0x0B
#define SCSIOP_TRACK_SELECT 0x0B
#define SCSIOP_SLEW_PRINT 0x0B
#define SCSIOP_SEEK_BLOCK 0x0C
#define SCSIOP_PARTITION 0x0D
#define SCSIOP_READ_REVERSE 0x0F
#define SCSIOP_WRITE_FILEMARKS 0x10
#define SCSIOP_FLUSH_BUFFER 0x10
#define SCSIOP_SPACE 0x11
#define SCSIOP_INQUIRY 0x12
#define SCSIOP_VERIFY6 0x13
#define SCSIOP_RECOVER_BUF_DATA 0x14
#define SCSIOP_MODE_SELECT 0x15
#define SCSIOP_RESERVE_UNIT 0x16
#define SCSIOP_RELEASE_UNIT 0x17
#define SCSIOP_COPY 0x18
#define SCSIOP_ERASE 0x19
#define SCSIOP_MODE_SENSE 0x1A
#define SCSIOP_START_STOP_UNIT 0x1B
#define SCSIOP_STOP_PRINT 0x1B
#define SCSIOP_LOAD_UNLOAD 0x1B
#define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C
#define SCSIOP_SEND_DIAGNOSTIC 0x1D
#define SCSIOP_MEDIUM_REMOVAL 0x1E
#define SCSIOP_READ_CAPACITY 0x25
#define SCSIOP_READ 0x28
#define SCSIOP_WRITE 0x2A
#define SCSIOP_SEEK 0x2B
#define SCSIOP_LOCATE 0x2B
#define SCSIOP_WRITE_VERIFY 0x2E
#define SCSIOP_VERIFY 0x2F
#define SCSIOP_SEARCH_DATA_HIGH 0x30
#define SCSIOP_SEARCH_DATA_EQUAL 0x31
#define SCSIOP_SEARCH_DATA_LOW 0x32
#define SCSIOP_SET_LIMITS 0x33
#define SCSIOP_READ_POSITION 0x34
#define SCSIOP_SYNCHRONIZE_CACHE 0x35
#define SCSIOP_COMPARE 0x39
#define SCSIOP_COPY_COMPARE 0x3A
#define SCSIOP_WRITE_DATA_BUFF 0x3B
#define SCSIOP_READ_DATA_BUFF 0x3C
#define SCSIOP_CHANGE_DEFINITION 0x40
#define SCSIOP_READ_SUB_CHANNEL 0x42
#define SCSIOP_READ_TOC 0x43
#define SCSIOP_READ_HEADER 0x44
#define SCSIOP_PLAY_AUDIO 0x45
#define SCSIOP_PLAY_AUDIO_MSF 0x47
#define SCSIOP_PLAY_TRACK_INDEX 0x48
#define SCSIOP_PLAY_TRACK_RELATIVE 0x49
#define SCSIOP_PAUSE_RESUME 0x4B
#define SCSIOP_LOG_SELECT 0x4C
#define SCSIOP_LOG_SENSE 0x4D
#define SCSIOP_MODE_SELECT10 0x55
#define SCSIOP_MODE_SENSE10 0x5A
#define SCSIOP_LOAD_UNLOAD_SLOT 0xA6
#define SCSIOP_MECHANISM_STATUS 0xBD
#define SCSIOP_READ_CD 0xBE
// SCSI read capacity structure
typedef struct _READ_CAPACITY_DATA
{
ULONG blks; /* total blocks (converted to little endian) */
ULONG blksiz; /* size of each (converted to little endian) */
} READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA;
// SCSI inquiry data
typedef struct _INQUIRYDATA
{
UCHAR DeviceType :5;
UCHAR DeviceTypeQualifier :3;
UCHAR DeviceTypeModifier :7;
UCHAR RemovableMedia :1;
UCHAR Versions;
UCHAR ResponseDataFormat;
UCHAR AdditionalLength;
UCHAR Reserved[2];
UCHAR SoftReset :1;
UCHAR CommandQueue :1;
UCHAR Reserved2 :1;
UCHAR LinkedCommands :1;
UCHAR Synchronous :1;
UCHAR Wide16Bit :1;
UCHAR Wide32Bit :1;
UCHAR RelativeAddressing :1;
UCHAR VendorId[8];
UCHAR ProductId[16];
UCHAR ProductRevisionLevel[4];
UCHAR VendorSpecific[20];
UCHAR Reserved3[40];
} INQUIRYDATA, *PINQUIRYDATA;
#endif
// function prototypes
int Pci2000_Detect (struct scsi_host_template *tpnt);
int Pci2000_Command (Scsi_Cmnd *SCpnt);
int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *));
int Pci2000_Abort (Scsi_Cmnd *SCpnt);
int Pci2000_Reset (Scsi_Cmnd *SCpnt, unsigned int flags);
int Pci2000_Release (struct Scsi_Host *pshost);
int Pci2000_BiosParam (struct scsi_device *sdev,
struct block_device *bdev,
sector_t capacity, int geom[]);
#endif
|
// RUN: %clang -fplugin=%llvmshlibdir/AnnotateFunctions%pluginext -emit-llvm -DPRAGMA_ON -S %s -o - | FileCheck %s --check-prefix=PRAGMA
// RUN: %clang -fplugin=%llvmshlibdir/AnnotateFunctions%pluginext -emit-llvm -S %s -o - | FileCheck %s --check-prefix=NOPRAGMA
// RUN: not %clang -fplugin=%llvmshlibdir/AnnotateFunctions%pluginext -emit-llvm -DBAD_PRAGMA -S %s -o - 2>&1 | FileCheck %s --check-prefix=BADPRAGMA
// REQUIRES: plugins, examples
#ifdef PRAGMA_ON
#pragma enable_annotate
#endif
// BADPRAGMA: warning: extra tokens at end of #pragma directive
#ifdef BAD_PRAGMA
#pragma enable_annotate something
#endif
// PRAGMA: [[STR_VAR:@.+]] = private unnamed_addr constant [19 x i8] c"example_annotation\00"
// PRAGMA: @llvm.global.annotations = {{.*}}@fn1{{.*}}[[STR_VAR]]{{.*}}@fn2{{.*}}[[STR_VAR]]
// NOPRAGMA-NOT: [[STR_VAR:@.+]] = private unnamed_addr constant [19 x i8] c"example_annotation\00"
// NOPRAGMA-NOT: @llvm.global.annotations = {{.*}}@fn1{{.*}}[[STR_VAR]]{{.*}}@fn2{{.*}}[[STR_VAR]]
void fn1() { }
void fn2() { }
// BADPRAGMA: error: #pragma enable_annotate not allowed after declarations
#ifdef BAD_PRAGMA
#pragma enable_annotate
#endif
|
////////////////////////////////////////////////////////////////////////////////
//
// TYPHOON FRAMEWORK
// Copyright 2013, Typhoon Framework Contributors
// All Rights Reserved.
//
// NOTICE: The authors permit you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@class TyphoonTypeDescriptor;
NSString *TyphoonTypeStringFor(id classOrProtocol);
Class TyphoonClassFromString(NSString *className);
BOOL IsClass(id classOrProtocol);
BOOL IsProtocol(id classOrProtocol);
@interface TyphoonIntrospectionUtils : NSObject
+ (TyphoonTypeDescriptor *)typeForPropertyNamed:(NSString *)propertyName inClass:(Class)clazz;
+ (SEL)setterForPropertyWithName:(NSString *)property inClass:(Class)clazz;
+ (SEL)getterForPropertyWithName:(NSString *)property inClass:(Class)clazz;
+ (NSMethodSignature *)methodSignatureWithArgumentsAndReturnValueAsObjectsFromSelector:(SEL)selector;
+ (NSUInteger)numberOfArgumentsInSelector:(SEL)selector;
+ (NSSet *)propertiesForClass:(Class)clazz upToParentClass:(Class)parent;
+ (NSSet *)methodsForClass:(Class)clazz upToParentClass:(Class)parent;
@end
|
//
// MagicalImportFunctions.h
// Magical Record
//
// Created by Saul Mora on 3/7/12.
// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
NSDate * adjustDateForDST(NSDate *date);
NSDate * dateFromString(NSString *value, NSString *format);
NSString * attributeNameFromString(NSString *value);
NSString * primaryKeyNameFromString(NSString *value);
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
UIColor * UIColorFromString(NSString *serializedColor);
#else
#import <AppKit/AppKit.h>
NSColor * NSColorFromString(NSString *serializedColor);
#endif
extern id (*colorFromString)(NSString *);
|
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2016-2019 Intel Corporation
*/
#ifndef _INTEL_GUC_CT_H_
#define _INTEL_GUC_CT_H_
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/ktime.h>
#include <linux/wait.h>
#include "intel_guc_fwif.h"
struct i915_vma;
struct intel_guc;
struct drm_printer;
/**
* DOC: Command Transport (CT).
*
* Buffer based command transport is a replacement for MMIO based mechanism.
* It can be used to perform both host-2-guc and guc-to-host communication.
*/
/** Represents single command transport buffer.
*
* A single command transport buffer consists of two parts, the header
* record (command transport buffer descriptor) and the actual buffer which
* holds the commands.
*
* @lock: protects access to the commands buffer and buffer descriptor
* @desc: pointer to the buffer descriptor
* @cmds: pointer to the commands buffer
* @size: size of the commands buffer in dwords
* @resv_space: reserved space in buffer in dwords
* @head: local shadow copy of head in dwords
* @tail: local shadow copy of tail in dwords
* @space: local shadow copy of space in dwords
* @broken: flag to indicate if descriptor data is broken
*/
struct intel_guc_ct_buffer {
spinlock_t lock;
struct guc_ct_buffer_desc *desc;
u32 *cmds;
u32 size;
u32 resv_space;
u32 tail;
u32 head;
atomic_t space;
bool broken;
};
/** Top-level structure for Command Transport related data
*
* Includes a pair of CT buffers for bi-directional communication and tracking
* for the H2G and G2H requests sent and received through the buffers.
*/
struct intel_guc_ct {
struct i915_vma *vma;
bool enabled;
/* buffers for sending and receiving commands */
struct {
struct intel_guc_ct_buffer send;
struct intel_guc_ct_buffer recv;
} ctbs;
struct tasklet_struct receive_tasklet;
/** @wq: wait queue for g2h chanenl */
wait_queue_head_t wq;
struct {
u16 last_fence; /* last fence used to send request */
spinlock_t lock; /* protects pending requests list */
struct list_head pending; /* requests waiting for response */
struct list_head incoming; /* incoming requests */
struct work_struct worker; /* handler for incoming requests */
} requests;
/** @stall_time: time of first time a CTB submission is stalled */
ktime_t stall_time;
};
void intel_guc_ct_init_early(struct intel_guc_ct *ct);
int intel_guc_ct_init(struct intel_guc_ct *ct);
void intel_guc_ct_fini(struct intel_guc_ct *ct);
int intel_guc_ct_enable(struct intel_guc_ct *ct);
void intel_guc_ct_disable(struct intel_guc_ct *ct);
static inline void intel_guc_ct_sanitize(struct intel_guc_ct *ct)
{
ct->enabled = false;
}
static inline bool intel_guc_ct_enabled(struct intel_guc_ct *ct)
{
return ct->enabled;
}
#define INTEL_GUC_CT_SEND_NB BIT(31)
#define INTEL_GUC_CT_SEND_G2H_DW_SHIFT 0
#define INTEL_GUC_CT_SEND_G2H_DW_MASK (0xff << INTEL_GUC_CT_SEND_G2H_DW_SHIFT)
#define MAKE_SEND_FLAGS(len) ({ \
typeof(len) len_ = (len); \
GEM_BUG_ON(!FIELD_FIT(INTEL_GUC_CT_SEND_G2H_DW_MASK, len_)); \
(FIELD_PREP(INTEL_GUC_CT_SEND_G2H_DW_MASK, len_) | INTEL_GUC_CT_SEND_NB); \
})
int intel_guc_ct_send(struct intel_guc_ct *ct, const u32 *action, u32 len,
u32 *response_buf, u32 response_buf_size, u32 flags);
void intel_guc_ct_event_handler(struct intel_guc_ct *ct);
void intel_guc_ct_print_info(struct intel_guc_ct *ct, struct drm_printer *p);
#endif /* _INTEL_GUC_CT_H_ */
|
/*
* Copyright (c) 2002, Intel Corporation. All rights reserved.
* Created by: bing.wei.liu REMOVE-THIS AT intel DOT com
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
* Test that pthread_mutex_destroy()
* Upon succesful completion, it shall return a 0
*
*/
#include <pthread.h>
#include <stdio.h>
#include <errno.h>
#include "posixtest.h"
int main(void)
{
pthread_mutex_t mutex;
int rc;
/* Initialize a mutex object */
if ((rc = pthread_mutex_init(&mutex, NULL)) != 0) {
fprintf(stderr, "Fail to initialize mutex, rc=%d\n", rc);
return PTS_UNRESOLVED;
}
if ((rc = pthread_mutex_destroy(&mutex)) == 0) {
printf("Test PASSED\n");
return PTS_PASS;
}
/* The following error codes are possible, but against assertion 5 */
else if (rc == EBUSY) {
fprintf(stderr,
"Detected an attempt to destroy a mutex in use\n");
} else if (rc == EINVAL) {
fprintf(stderr, "The value specified by 'mutex' is invalid\n");
}
/* Any other returned value means the test failed */
else {
printf("Test FAILED (error: %i)\n", rc);
}
return PTS_FAIL;
}
|
/*
* (C) Copyright 2009
* Net Insight <www.netinsight.net>
* Written-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
*
* Based on sheevaplug.c:
* (C) Copyright 2009
* Marvell Semiconductor <www.marvell.com>
* Written-by: Prafulla Wadaskar <prafulla@marvell.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <miiphy.h>
#include <asm/arch/cpu.h>
#include <asm/arch/kirkwood.h>
#include <asm/arch/mpp.h>
#include "openrd.h"
DECLARE_GLOBAL_DATA_PTR;
int board_early_init_f(void)
{
/*
* default gpio configuration
* There are maximum 64 gpios controlled through 2 sets of registers
* the below configuration configures mainly initial LED status
*/
kw_config_gpio(OPENRD_OE_VAL_LOW,
OPENRD_OE_VAL_HIGH,
OPENRD_OE_LOW, OPENRD_OE_HIGH);
/* Multi-Purpose Pins Functionality configuration */
static const u32 kwmpp_config[] = {
MPP0_NF_IO2,
MPP1_NF_IO3,
MPP2_NF_IO4,
MPP3_NF_IO5,
MPP4_NF_IO6,
MPP5_NF_IO7,
MPP6_SYSRST_OUTn,
MPP7_GPO,
MPP8_TW_SDA,
MPP9_TW_SCK,
MPP10_UART0_TXD,
MPP11_UART0_RXD,
MPP12_SD_CLK,
MPP13_SD_CMD, /* Alt UART1_TXD */
MPP14_SD_D0, /* Alt UART1_RXD */
MPP15_SD_D1,
MPP16_SD_D2,
MPP17_SD_D3,
MPP18_NF_IO0,
MPP19_NF_IO1,
MPP20_GE1_0,
MPP21_GE1_1,
MPP22_GE1_2,
MPP23_GE1_3,
MPP24_GE1_4,
MPP25_GE1_5,
MPP26_GE1_6,
MPP27_GE1_7,
MPP28_GPIO,
MPP29_TSMP9,
MPP30_GE1_10,
MPP31_GE1_11,
MPP32_GE1_12,
MPP33_GE1_13,
MPP34_GPIO, /* UART1 / SD sel */
MPP35_TDM_CH0_TX_QL,
MPP36_TDM_SPI_CS1,
MPP37_TDM_CH2_TX_QL,
MPP38_TDM_CH2_RX_QL,
MPP39_AUDIO_I2SBCLK,
MPP40_AUDIO_I2SDO,
MPP41_AUDIO_I2SLRC,
MPP42_AUDIO_I2SMCLK,
MPP43_AUDIO_I2SDI,
MPP44_AUDIO_EXTCLK,
MPP45_TDM_PCLK,
MPP46_TDM_FS,
MPP47_TDM_DRX,
MPP48_TDM_DTX,
MPP49_TDM_CH0_RX_QL,
0
};
kirkwood_mpp_conf(kwmpp_config, NULL);
return 0;
}
int board_init(void)
{
/*
* arch number of board
*/
#if defined(CONFIG_BOARD_IS_OPENRD_BASE)
gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE;
#elif defined(CONFIG_BOARD_IS_OPENRD_CLIENT)
gd->bd->bi_arch_number = MACH_TYPE_OPENRD_CLIENT;
#elif defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE)
gd->bd->bi_arch_number = MACH_TYPE_OPENRD_ULTIMATE;
#endif
/* adress of boot parameters */
gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
return 0;
}
#ifdef CONFIG_RESET_PHY_R
/* Configure and enable MV88E1116/88E1121 PHY */
void mv_phy_init(char *name)
{
u16 reg;
u16 devadr;
if (miiphy_set_current_dev(name))
return;
/* command to read PHY dev address */
if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
printf("Err..%s could not read PHY dev address\n",
__FUNCTION__);
return;
}
/*
* Enable RGMII delay on Tx and Rx for CPU port
* Ref: sec 4.7.2 of chip datasheet
*/
miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2);
miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, ®);
reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL);
miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg);
miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0);
/* reset the phy */
miiphy_reset(name, devadr);
printf(PHY_NO" Initialized on %s\n", name);
}
void reset_phy(void)
{
mv_phy_init("egiga0");
#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT
/* Kirkwood ethernet driver is written with the assumption that in case
* of multiple PHYs, their addresses are consecutive. But unfortunately
* in case of OpenRD-Client, PHY addresses are not consecutive.*/
miiphy_write("egiga1", 0xEE, 0xEE, 24);
#endif
#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || \
defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE)
/* configure and initialize both PHY's */
mv_phy_init("egiga1");
#endif
}
#endif /* CONFIG_RESET_PHY_R */
|
/*
* Copyright (C) 2011-2013 The Paparazzi Team
*
* This file is part of paparazzi.
*
* paparazzi 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.
*
* paparazzi 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 paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
/**
* @file boards/baro_board_ms5611_spi.c
*
* Driver for onboard MS5611 baro via SPI.
*
*/
#include "subsystems/sensors/baro.h"
#include "peripherals/ms5611_spi.h"
#include "mcu_periph/sys_time.h"
#include "led.h"
#include "std.h"
#include "subsystems/abi.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "subsystems/datalink/downlink.h"
#ifdef BARO_PERIODIC_FREQUENCY
#if BARO_PERIODIC_FREQUENCY > 100
#error "For MS5611 BARO_PERIODIC_FREQUENCY has to be < 100"
#endif
#endif
/// set to TRUE if baro is actually a MS5607
#ifndef BB_MS5611_TYPE_MS5607
#define BB_MS5611_TYPE_MS5607 FALSE
#endif
struct Ms5611_Spi bb_ms5611;
void baro_init(void)
{
ms5611_spi_init(&bb_ms5611, &BB_MS5611_SPI_DEV, BB_MS5611_SLAVE_IDX, BB_MS5611_TYPE_MS5607);
#ifdef BARO_LED
LED_OFF(BARO_LED);
#endif
}
void baro_periodic(void)
{
if (sys_time.nb_sec > 1) {
/* call the convenience periodic that initializes the sensor and starts reading*/
ms5611_spi_periodic(&bb_ms5611);
#if DEBUG
if (bb_ms5611.initialized)
RunOnceEvery((50 * 30), DOWNLINK_SEND_MS5611_COEFF(DefaultChannel, DefaultDevice,
&bb_ms5611.data.c[0],
&bb_ms5611.data.c[1],
&bb_ms5611.data.c[2],
&bb_ms5611.data.c[3],
&bb_ms5611.data.c[4],
&bb_ms5611.data.c[5],
&bb_ms5611.data.c[6],
&bb_ms5611.data.c[7]));
#endif
}
}
void baro_event(void)
{
if (sys_time.nb_sec > 1) {
ms5611_spi_event(&bb_ms5611);
if (bb_ms5611.data_available) {
float pressure = (float)bb_ms5611.data.pressure;
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, pressure);
float temp = bb_ms5611.data.temperature / 100.0f;
AbiSendMsgTEMPERATURE(BARO_BOARD_SENDER_ID, temp);
bb_ms5611.data_available = FALSE;
#ifdef BARO_LED
RunOnceEvery(10, LED_TOGGLE(BARO_LED));
#endif
#if DEBUG
float fbaroms = bb_ms5611.data.pressure / 100.;
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
&bb_ms5611.data.d1, &bb_ms5611.data.d2,
&fbaroms, &temp);
#endif
}
}
}
|
#ifndef __ASM_SH_CPU_SH5_ADDRSPACE_H
#define __ASM_SH_CPU_SH5_ADDRSPACE_H
#define PHYS_PERIPHERAL_BLOCK 0x09000000
#define PHYS_DMAC_BLOCK 0x0e000000
#define PHYS_PCI_BLOCK 0x60000000
#define PHYS_EMI_BLOCK 0xff000000
#endif
|
/*
Copyright (C) Intel Corp. 2006. All Rights Reserved.
Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
develop this 3D driver.
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 (including the
next paragraph) shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**********************************************************************/
/*
* Authors:
* Keith Whitwell <keith@tungstengraphics.com>
*/
#include "brw_batchbuffer.h"
#include "brw_defines.h"
#include "brw_context.h"
#include "brw_eu.h"
#include "brw_gs.h"
static void brw_gs_alloc_regs( struct brw_gs_compile *c,
GLuint nr_verts )
{
GLuint i = 0,j;
/* Register usage is static, precompute here:
*/
c->reg.R0 = retype(brw_vec8_grf(i, 0), BRW_REGISTER_TYPE_UD); i++;
/* Payload vertices plus space for more generated vertices:
*/
for (j = 0; j < nr_verts; j++) {
c->reg.vertex[j] = brw_vec4_grf(i, 0);
i += c->nr_regs;
}
c->prog_data.urb_read_length = c->nr_regs;
c->prog_data.total_grf = i;
}
static void brw_gs_emit_vue(struct brw_gs_compile *c,
struct brw_reg vert,
GLboolean last,
GLuint header)
{
struct brw_compile *p = &c->func;
GLboolean allocate = !last;
/* Overwrite PrimType and PrimStart in the message header, for
* each vertex in turn:
*/
brw_MOV(p, get_element_ud(c->reg.R0, 2), brw_imm_ud(header));
/* Copy the vertex from vertn into m1..mN+1:
*/
brw_copy8(p, brw_message_reg(1), vert, c->nr_regs);
/* Send each vertex as a seperate write to the urb. This is
* different to the concept in brw_sf_emit.c, where subsequent
* writes are used to build up a single urb entry. Each of these
* writes instantiates a seperate urb entry, and a new one must be
* allocated each time.
*/
brw_urb_WRITE(p,
allocate ? c->reg.R0 : retype(brw_null_reg(), BRW_REGISTER_TYPE_UD),
0,
c->reg.R0,
allocate,
1, /* used */
c->nr_regs + 1, /* msg length */
allocate ? 1 : 0, /* response length */
allocate ? 0 : 1, /* eot */
1, /* writes_complete */
0, /* urb offset */
BRW_URB_SWIZZLE_NONE);
}
static void brw_gs_ff_sync(struct brw_gs_compile *c, int num_prim)
{
struct brw_compile *p = &c->func;
brw_MOV(p, get_element_ud(c->reg.R0, 1), brw_imm_ud(num_prim));
brw_ff_sync(p,
c->reg.R0,
0,
c->reg.R0,
1,
1, /* used */
1, /* msg length */
1, /* response length */
0, /* eot */
1, /* write compelete */
0, /* urb offset */
BRW_URB_SWIZZLE_NONE);
}
void brw_gs_quads( struct brw_gs_compile *c )
{
brw_gs_alloc_regs(c, 4);
/* Use polygons for correct edgeflag behaviour. Note that vertex 3
* is the PV for quads, but vertex 0 for polygons:
*/
if (c->need_ff_sync)
brw_gs_ff_sync(c, 1);
brw_gs_emit_vue(c, c->reg.vertex[3], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[2], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END));
}
void brw_gs_quad_strip( struct brw_gs_compile *c )
{
brw_gs_alloc_regs(c, 4);
if (c->need_ff_sync)
brw_gs_ff_sync(c, 1);
brw_gs_emit_vue(c, c->reg.vertex[2], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[3], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2));
brw_gs_emit_vue(c, c->reg.vertex[1], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END));
}
void brw_gs_tris( struct brw_gs_compile *c )
{
brw_gs_alloc_regs(c, 3);
if (c->need_ff_sync)
brw_gs_ff_sync(c, 1);
brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_TRILIST << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_TRILIST << 2));
brw_gs_emit_vue(c, c->reg.vertex[2], 1, ((_3DPRIM_TRILIST << 2) | R02_PRIM_END));
}
void brw_gs_lines( struct brw_gs_compile *c )
{
brw_gs_alloc_regs(c, 2);
if (c->need_ff_sync)
brw_gs_ff_sync(c, 1);
brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_LINESTRIP << 2) | R02_PRIM_START));
brw_gs_emit_vue(c, c->reg.vertex[1], 1, ((_3DPRIM_LINESTRIP << 2) | R02_PRIM_END));
}
void brw_gs_points( struct brw_gs_compile *c )
{
brw_gs_alloc_regs(c, 1);
if (c->need_ff_sync)
brw_gs_ff_sync(c, 1);
brw_gs_emit_vue(c, c->reg.vertex[0], 1, ((_3DPRIM_POINTLIST << 2) | R02_PRIM_START | R02_PRIM_END));
}
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MOJO_VIEWS_MOJO_VIEWS_EXPORT_H_
#define MOJO_VIEWS_MOJO_VIEWS_EXPORT_H_
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(MOJO_VIEWS_IMPLEMENTATION)
#define MOJO_VIEWS_EXPORT __declspec(dllexport)
#else
#define MOJO_VIEWS_EXPORT __declspec(dllimport)
#endif // defined(MOJO_VIEWS_IMPLEMENTATION)
#else // defined(WIN32)
#if defined(MOJO_VIEWS_IMPLEMENTATION)
#define MOJO_VIEWS_EXPORT __attribute__((visibility("default")))
#else
#define MOJO_VIEWS_EXPORT
#endif
#endif
#else // defined(COMPONENT_BUILD)
#define MOJO_VIEWS_EXPORT
#endif
#endif // MOJO_VIEWS_MOJO_VIEWS_EXPORT_H_
|
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 6.00.0338 */
/* Compiler settings for dmodshow.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __dmodshow_h__
#define __dmodshow_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IDMOWrapperFilter_FWD_DEFINED__
#define __IDMOWrapperFilter_FWD_DEFINED__
typedef interface IDMOWrapperFilter IDMOWrapperFilter;
#endif /* __IDMOWrapperFilter_FWD_DEFINED__ */
/* header files for imported files */
#include "unknwn.h"
#include "objidl.h"
#include "mediaobj.h"
#ifdef __cplusplus
extern "C"{
#endif
void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * );
/* interface __MIDL_itf_dmodshow_0000 */
/* [local] */
DEFINE_GUID(CLSID_DMOWrapperFilter, 0x94297043,0xbd82,0x4dfd,0xb0,0xde,0x81,0x77,0x73,0x9c,0x6d,0x20);
DEFINE_GUID(CLSID_DMOFilterCategory,0xbcd5796c,0xbd52,0x4d30,0xab,0x76,0x70,0xf9,0x75,0xb8,0x91,0x99);
extern RPC_IF_HANDLE __MIDL_itf_dmodshow_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dmodshow_0000_v0_0_s_ifspec;
#ifndef __IDMOWrapperFilter_INTERFACE_DEFINED__
#define __IDMOWrapperFilter_INTERFACE_DEFINED__
/* interface IDMOWrapperFilter */
/* [uuid][object] */
EXTERN_C const IID IID_IDMOWrapperFilter;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("52d6f586-9f0f-4824-8fc8-e32ca04930c2")
IDMOWrapperFilter : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Init(
REFCLSID clsidDMO,
REFCLSID catDMO) = 0;
};
#else /* C style interface */
typedef struct IDMOWrapperFilterVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDMOWrapperFilter * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDMOWrapperFilter * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDMOWrapperFilter * This);
HRESULT ( STDMETHODCALLTYPE *Init )(
IDMOWrapperFilter * This,
REFCLSID clsidDMO,
REFCLSID catDMO);
END_INTERFACE
} IDMOWrapperFilterVtbl;
interface IDMOWrapperFilter
{
CONST_VTBL struct IDMOWrapperFilterVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDMOWrapperFilter_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IDMOWrapperFilter_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IDMOWrapperFilter_Release(This) \
(This)->lpVtbl -> Release(This)
#define IDMOWrapperFilter_Init(This,clsidDMO,catDMO) \
(This)->lpVtbl -> Init(This,clsidDMO,catDMO)
#endif /* COBJMACROS */
#endif /* C style interface */
HRESULT STDMETHODCALLTYPE IDMOWrapperFilter_Init_Proxy(
IDMOWrapperFilter * This,
REFCLSID clsidDMO,
REFCLSID catDMO);
void __RPC_STUB IDMOWrapperFilter_Init_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IDMOWrapperFilter_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
|
#include "trace.h"
int DYN_FTRACE_TEST_NAME(void)
{
return 0;
}
int DYN_FTRACE_TEST_NAME2(void)
{
return 0;
}
|
/* Copyright (C) 2012-2014 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
GAS 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.
GAS 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 GAS; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
/* The C source file generated by flex includes stdio.h before any of
the C code in itbl-lex.l. Make sure we include sysdep.h first, so
that config.h can set the correct values for various things. */
#include "sysdep.h"
#include "itbl-lex.c"
|
#ifndef __EXPANDOS_H
#define __EXPANDOS_H
#include "signals.h"
/* first argument of signal must match to active .. */
typedef enum {
EXPANDO_ARG_NONE = 1,
EXPANDO_ARG_SERVER,
EXPANDO_ARG_WINDOW,
EXPANDO_ARG_WINDOW_ITEM,
EXPANDO_NEVER /* special: expando never changes */
} ExpandoArg;
typedef char* (*EXPANDO_FUNC)
(SERVER_REC *server, void *item, int *free_ret);
extern const char *current_expando;
/* Create expando - overrides any existing ones.
... = signal, type, ..., NULL - list of signals that might change the
value of this expando */
void expando_create(const char *key, EXPANDO_FUNC func, ...);
/* Add new signal to expando */
void expando_add_signal(const char *key, const char *signal, ExpandoArg arg);
/* Destroy expando */
void expando_destroy(const char *key, EXPANDO_FUNC func);
void expando_bind(const char *key, int funccount, SIGNAL_FUNC *funcs);
void expando_unbind(const char *key, int funccount, SIGNAL_FUNC *funcs);
/* Returns [<signal id>, EXPANDO_ARG_xxx, <signal id>, ..., -1] */
int *expando_get_signals(const char *key);
/* internal: */
EXPANDO_FUNC expando_find_char(char chr);
EXPANDO_FUNC expando_find_long(const char *key);
void expandos_init(void);
void expandos_deinit(void);
#endif
|
#include <wchar.h>
wchar_t *wmemset(wchar_t *d, wchar_t c, size_t n)
{
wchar_t *ret = d;
while (n--) *d++ = c;
return ret;
}
|
// -*- C++ -*-
// $Id: AliAnalysisTaskLongRangeCorrelations.h 405 2014-03-21 11:49:16Z cmayer $
#ifndef _AliAnalysisTaskLongRangeCorrelations_H_
#define _AliAnalysisTaskLongRangeCorrelations_H_
/* Copyright(c) 2012, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
////////////////////////////////////////////////////////////////////////
//
// Analysis class for Long-range Correlations
//
// Look for correlations in eta (and in phi)
//
// This class needs input AODs.
// The output is a list of analysis-specific containers.
//
// Author:
// Christoph Mayer
//
////////////////////////////////////////////////////////////////////////
class TAxis;
class TClonesArray;
class TList;
class TObjArray;
class AliAODEvent;
class AliAODHeader;
class AliEventPoolManager;
#include <TObject.h>
#include "AliAnalysisTaskSE.h"
#include "AliTHn.h" // cannot forward declare
class AliAnalysisTaskLongRangeCorrelations : public AliAnalysisTaskSE {
public:
AliAnalysisTaskLongRangeCorrelations(const char *name="AliAnalysisTaskLongRangeCorrelations");
virtual ~AliAnalysisTaskLongRangeCorrelations();
/* virtual void NotifyRun(); */
virtual void UserCreateOutputObjects();
virtual void UserExec(Option_t *);
virtual void Terminate(Option_t *);
void SetRunMixing(Bool_t runMixing) { fRunMixing = runMixing; }
void SetMixingTracks(Int_t mixingTracks) { fMixingTracks = mixingTracks; }
void SetTrackFilter(Int_t trackFilter) { fTrackFilter = trackFilter; }
void SetCentralityRange(Double_t centMin, Double_t centMax) {
fCentMin = centMin; fCentMax = centMax;
}
void SetPtRange(Double_t ptMin, Double_t ptMax) {
fPtMin = ptMin; fPtMax = ptMax;
}
void SetPhiRange(Double_t phiMin, Double_t phiMax) {
fPhiMin = phiMin; fPhiMax = phiMax;
}
void SetMaxAbsVertexZ(Double_t maxAbsVertexZ) { fMaxAbsVertexZ = maxAbsVertexZ; }
void SetSelectPrimaryMCParticles(Int_t flagMC, Int_t flagMCData) {
fSelectPrimaryMCParticles = flagMC;
fSelectPrimaryMCDataParticles = flagMCData;
}
void SetRangeN(Int_t nMin, Int_t nMax, Double_t deltaEta) {
fNMin = nMin;
fNMax = nMax;
fDeltaEta = deltaEta;
}
Double_t GetDeltaEta() const { return fDeltaEta; }
Int_t GetNMin() const { return fNMin; }
Int_t GetNMax() const { return fNMax; }
TString GetOutputListName() const;
protected:
// for now up to second moments:
// <n_1>(phi_1,eta_1)
// <n_2>(phi_2,eta_2)
// <n_1, n_2>(phi_1,eta_1;phi_2,eta_2)
void CalculateMoments(TString, TObjArray*, TObjArray*, Double_t, Double_t);
void ComputeNXForThisEvent(TObjArray*, const char*, Double_t, Double_t);
THnSparse* ComputeNForThisEvent(TObjArray*, const char*, Double_t) const;
void FillNEtaHist(TString, THnSparse*, Double_t);
TObjArray* GetAcceptedTracks(AliAODEvent*, TClonesArray*, Double_t);
TObjArray* GetAcceptedTracks(TClonesArray*, Double_t);
// filling histograms by name
void Fill(const char*, Double_t); // TH1 weight=1
void Fill(const char*, Double_t, Double_t ); // TH2 weight=1
void Fill(const char*, Double_t, Double_t, Double_t); // TH3 weight=1
void Fill(const char*, const Double_t*, Double_t weight=1); // THnSparse
void SetupForMixing();
THnSparse* MakeHistSparsePhiEta(const char* name) const;
AliTHn* MakeHistPhiEta(const char* name) const;
AliTHn* MakeHistPhiEtaPhiEta(const char* name) const;
private:
TList* fOutputList; //! Output list
TAxis* fVertexZ; //! vertex z bins
Bool_t fRunMixing; //
AliEventPoolManager* fPoolMgr; //! event pool manager
Int_t fMixingTracks; //
Int_t fTrackFilter; //
Double_t fCentMin, fCentMax; // centrality range
Double_t fPtMin, fPtMax; // P_{T} range
Double_t fPhiMin, fPhiMax; // #phi range
Double_t fMaxAbsVertexZ; // max abs(zvertex)
Int_t fSelectPrimaryMCParticles; // 0: no, 1: yes, -1: only non-primary particles
Int_t fSelectPrimaryMCDataParticles; // 0: no, 1: yes, -1: only non-primary particles
Int_t fNMin;
Int_t fNMax;
Double_t fDeltaEta;
// histogram data
Int_t fnBinsCent, fnBinsPt, fnBinsPhi, fnBinsEta;
Double_t fxMinCent, fxMinPt, fxMinPhi, fxMinEta;
Double_t fxMaxCent, fxMaxPt, fxMaxPhi, fxMaxEta;
AliAnalysisTaskLongRangeCorrelations(const AliAnalysisTaskLongRangeCorrelations&); // not implemented
AliAnalysisTaskLongRangeCorrelations& operator=(const AliAnalysisTaskLongRangeCorrelations&); // not implemented
ClassDef(AliAnalysisTaskLongRangeCorrelations, 1);
} ;
class LRCParticle : public TObject {
public:
LRCParticle(Double_t eta=0, Double_t phi=0)
: fEta(eta), fPhi(phi) {}
virtual ~LRCParticle() {}
Double_t Eta() const { return fEta; }
Double_t Phi() const { return fPhi; }
protected:
private:
LRCParticle(const LRCParticle&);
LRCParticle& operator=(const LRCParticle&);
Double_t fEta;
Double_t fPhi;
ClassDef(LRCParticle, 1);
} ;
#endif // _AliAnalysisTaskLongRangeCorrelations_H_
|
/* Copyright 2018 Jack Hildebrandt
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tennie.h"
void matrix_init_kb(void) {
matrix_init_user();
}
void matrix_post_init(void) {
rgblight_enable_noeeprom();
keyboard_post_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
//void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
// led_set_user(usb_led);
//}
|
#include "msgpack.h"
const char* msgpack_version(void)
{
return MSGPACK_VERSION;
}
int msgpack_version_major(void)
{
return MSGPACK_VERSION_MAJOR;
}
int msgpack_version_minor(void)
{
return MSGPACK_VERSION_MINOR;
}
int msgpack_version_revision(void)
{
return MSGPACK_VERSION_REVISION;
}
|
// 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 EXTENSIONS_BROWSER_API_MESSAGING_NATIVE_MESSAGE_HOST_H_
#define EXTENSIONS_BROWSER_API_MESSAGING_NATIVE_MESSAGE_HOST_H_
#include <string>
#include "base/memory/scoped_ptr.h"
#include "base/single_thread_task_runner.h"
#include "ui/gfx/native_widget_types.h"
namespace extensions {
// An interface for receiving messages from MessageService (Chrome) using the
// Native Messaging API. A NativeMessageHost object hosts a native component,
// which can run in the browser-process or in a separate process (See
// NativeMessageProcessHost).
class NativeMessageHost {
public:
static const char kFailedToStartError[];
static const char kInvalidNameError[];
static const char kNativeHostExited[];
static const char kNotFoundError[];
static const char kForbiddenError[];
static const char kHostInputOuputError[];
// Callback interface for receiving messages from the native host.
class Client {
public:
virtual ~Client() {}
// Called on the UI thread.
virtual void PostMessageFromNativeHost(const std::string& message) = 0;
virtual void CloseChannel(const std::string& error_message) = 0;
};
// Creates the NativeMessageHost based on the |native_host_name|.
static scoped_ptr<NativeMessageHost> Create(
gfx::NativeView native_view,
const std::string& source_extension_id,
const std::string& native_host_name,
bool allow_user_level,
std::string* error);
virtual ~NativeMessageHost() {}
// Called when a message is received from MessageService (Chrome).
virtual void OnMessage(const std::string& message) = 0;
// Sets the client to start receiving messages from the native host.
virtual void Start(Client* client) = 0;
// Returns the task runner that the host runs on. The Client should only
// invoke OnMessage() on this task runner.
virtual scoped_refptr<base::SingleThreadTaskRunner> task_runner() const = 0;
};
} // namespace extensions
#endif // EXTENSIONS_BROWSER_API_MESSAGING_NATIVE_MESSAGE_HOST_H_
|
/*
* LANTEC board specific definitions
*
* Copyright (c) 2001 Wolfgang Denk (wd@denx.de)
*/
#ifndef __MACH_LANTEC_H
#define __MACH_LANTEC_H
#include <linux/config.h>
#include <asm/ppcboot.h>
#define IMAP_ADDR 0xFFF00000 /* physical base address of IMMR area */
#define IMAP_SIZE (64 * 1024) /* mapped size of IMMR area */
/* We don't use the 8259.
*/
#define NR_8259_INTS 0
#endif /* __MACH_LANTEC_H */
|
/* Support routines for the intrinsic power (**) operator.
Copyright (C) 2004-2015 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_REAL_8) && defined (HAVE_GFC_INTEGER_8)
GFC_REAL_8 pow_r8_i8 (GFC_REAL_8 a, GFC_INTEGER_8 b);
export_proto(pow_r8_i8);
GFC_REAL_8
pow_r8_i8 (GFC_REAL_8 a, GFC_INTEGER_8 b)
{
GFC_REAL_8 pow, x;
GFC_INTEGER_8 n;
GFC_UINTEGER_8 u;
n = b;
x = a;
pow = 1;
if (n != 0)
{
if (n < 0)
{
u = -n;
x = pow / x;
}
else
{
u = n;
}
for (;;)
{
if (u & 1)
pow *= x;
u >>= 1;
if (u)
x *= x;
else
break;
}
}
return pow;
}
#endif
|
// -*- C++ -*- compatibility header.
// Copyright (C) 2002-2015 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/>.
/** @file signal.h
* This is a Standard C++ Library header.
*/
#include <csignal>
#ifndef _GLIBCXX_SIGNAL_H
#define _GLIBCXX_SIGNAL_H 1
#ifdef _GLIBCXX_NAMESPACE_C
using std::sig_atomic_t;
using std::raise;
using std::signal;
#endif
#endif
|
/*
* dir.c
*
* PURPOSE
* Directory handling routines for the OSTA-UDF(tm) filesystem.
*
* COPYRIGHT
* This file is distributed under the terms of the GNU General Public
* License (GPL). Copies of the GPL can be obtained from:
* ftp://prep.ai.mit.edu/pub/gnu/GPL
* Each contributing author retains all rights to their own work.
*
* (C) 1998-2004 Ben Fennema
*
* HISTORY
*
* 10/05/98 dgb Split directory operations into its own file
* Implemented directory reads via do_udf_readdir
* 10/06/98 Made directory operations work!
* 11/17/98 Rewrote directory to support ICBTAG_FLAG_AD_LONG
* 11/25/98 blf Rewrote directory handling (readdir+lookup) to support reading
* across blocks.
* 12/12/98 Split out the lookup code to namei.c. bulk of directory
* code now in directory.c:udf_fileident_read.
*/
#include "udfdecl.h"
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/bio.h>
#include "udf_i.h"
#include "udf_sb.h"
static int udf_readdir(struct file *file, struct dir_context *ctx)
{
struct inode *dir = file_inode(file);
struct udf_inode_info *iinfo = UDF_I(dir);
struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL};
struct fileIdentDesc *fi = NULL;
struct fileIdentDesc cfi;
udf_pblk_t block, iblock;
loff_t nf_pos;
int flen;
unsigned char *fname = NULL, *copy_name = NULL;
unsigned char *nameptr;
uint16_t liu;
uint8_t lfi;
loff_t size = udf_ext0_offset(dir) + dir->i_size;
struct buffer_head *tmp, *bha[16];
struct kernel_lb_addr eloc;
uint32_t elen;
sector_t offset;
int i, num, ret = 0;
struct extent_position epos = { NULL, 0, {0, 0} };
struct super_block *sb = dir->i_sb;
if (ctx->pos == 0) {
if (!dir_emit_dot(file, ctx))
return 0;
ctx->pos = 1;
}
nf_pos = (ctx->pos - 1) << 2;
if (nf_pos >= size)
goto out;
fname = kmalloc(UDF_NAME_LEN, GFP_NOFS);
if (!fname) {
ret = -ENOMEM;
goto out;
}
if (nf_pos == 0)
nf_pos = udf_ext0_offset(dir);
fibh.soffset = fibh.eoffset = nf_pos & (sb->s_blocksize - 1);
if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
if (inode_bmap(dir, nf_pos >> sb->s_blocksize_bits,
&epos, &eloc, &elen, &offset)
!= (EXT_RECORDED_ALLOCATED >> 30)) {
ret = -ENOENT;
goto out;
}
block = udf_get_lb_pblock(sb, &eloc, offset);
if ((++offset << sb->s_blocksize_bits) < elen) {
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
epos.offset -= sizeof(struct short_ad);
else if (iinfo->i_alloc_type ==
ICBTAG_FLAG_AD_LONG)
epos.offset -= sizeof(struct long_ad);
} else {
offset = 0;
}
if (!(fibh.sbh = fibh.ebh = udf_tread(sb, block))) {
ret = -EIO;
goto out;
}
if (!(offset & ((16 >> (sb->s_blocksize_bits - 9)) - 1))) {
i = 16 >> (sb->s_blocksize_bits - 9);
if (i + offset > (elen >> sb->s_blocksize_bits))
i = (elen >> sb->s_blocksize_bits) - offset;
for (num = 0; i > 0; i--) {
block = udf_get_lb_pblock(sb, &eloc, offset + i);
tmp = udf_tgetblk(sb, block);
if (tmp && !buffer_uptodate(tmp) && !buffer_locked(tmp))
bha[num++] = tmp;
else
brelse(tmp);
}
if (num) {
ll_rw_block(REQ_OP_READ, REQ_RAHEAD, num, bha);
for (i = 0; i < num; i++)
brelse(bha[i]);
}
}
}
while (nf_pos < size) {
struct kernel_lb_addr tloc;
ctx->pos = (nf_pos >> 2) + 1;
fi = udf_fileident_read(dir, &nf_pos, &fibh, &cfi, &epos, &eloc,
&elen, &offset);
if (!fi)
goto out;
liu = le16_to_cpu(cfi.lengthOfImpUse);
lfi = cfi.lengthFileIdent;
if (fibh.sbh == fibh.ebh) {
nameptr = udf_get_fi_ident(fi);
} else {
int poffset; /* Unpaded ending offset */
poffset = fibh.soffset + sizeof(struct fileIdentDesc) + liu + lfi;
if (poffset >= lfi) {
nameptr = (char *)(fibh.ebh->b_data + poffset - lfi);
} else {
if (!copy_name) {
copy_name = kmalloc(UDF_NAME_LEN,
GFP_NOFS);
if (!copy_name) {
ret = -ENOMEM;
goto out;
}
}
nameptr = copy_name;
memcpy(nameptr, udf_get_fi_ident(fi),
lfi - poffset);
memcpy(nameptr + lfi - poffset,
fibh.ebh->b_data, poffset);
}
}
if ((cfi.fileCharacteristics & FID_FILE_CHAR_DELETED) != 0) {
if (!UDF_QUERY_FLAG(sb, UDF_FLAG_UNDELETE))
continue;
}
if ((cfi.fileCharacteristics & FID_FILE_CHAR_HIDDEN) != 0) {
if (!UDF_QUERY_FLAG(sb, UDF_FLAG_UNHIDE))
continue;
}
if (cfi.fileCharacteristics & FID_FILE_CHAR_PARENT) {
if (!dir_emit_dotdot(file, ctx))
goto out;
continue;
}
flen = udf_get_filename(sb, nameptr, lfi, fname, UDF_NAME_LEN);
if (flen < 0)
continue;
tloc = lelb_to_cpu(cfi.icb.extLocation);
iblock = udf_get_lb_pblock(sb, &tloc, 0);
if (!dir_emit(ctx, fname, flen, iblock, DT_UNKNOWN))
goto out;
} /* end while */
ctx->pos = (nf_pos >> 2) + 1;
out:
if (fibh.sbh != fibh.ebh)
brelse(fibh.ebh);
brelse(fibh.sbh);
brelse(epos.bh);
kfree(fname);
kfree(copy_name);
return ret;
}
/* readdir and lookup functions */
const struct file_operations udf_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
.iterate_shared = udf_readdir,
.unlocked_ioctl = udf_ioctl,
.fsync = generic_file_fsync,
};
|
/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU OpenMP Library (libgomp).
Libgomp 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.
Libgomp 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/>. */
/* This is the default POSIX 1003.1b implementation of a semaphore
synchronization mechanism for libgomp. This type is private to
the library.
This is a bit heavy weight for what we need, in that we're not
interested in sem_wait as a cancelation point, but it's not too
bad for a default. */
#ifndef GOMP_SEM_H
#define GOMP_SEM_H 1
#ifdef HAVE_ATTRIBUTE_VISIBILITY
# pragma GCC visibility push(default)
#endif
#include <semaphore.h>
#ifdef HAVE_ATTRIBUTE_VISIBILITY
# pragma GCC visibility pop
#endif
#ifdef HAVE_BROKEN_POSIX_SEMAPHORES
#include <pthread.h>
struct gomp_sem
{
pthread_mutex_t mutex;
pthread_cond_t cond;
int value;
};
typedef struct gomp_sem gomp_sem_t;
extern void gomp_sem_init (gomp_sem_t *sem, int value);
extern void gomp_sem_wait (gomp_sem_t *sem);
extern void gomp_sem_post (gomp_sem_t *sem);
extern void gomp_sem_destroy (gomp_sem_t *sem);
#else /* HAVE_BROKEN_POSIX_SEMAPHORES */
typedef sem_t gomp_sem_t;
static inline void gomp_sem_init (gomp_sem_t *sem, int value)
{
sem_init (sem, 0, value);
}
extern void gomp_sem_wait (gomp_sem_t *sem);
static inline void gomp_sem_post (gomp_sem_t *sem)
{
sem_post (sem);
}
static inline void gomp_sem_destroy (gomp_sem_t *sem)
{
sem_destroy (sem);
}
#endif /* doesn't HAVE_BROKEN_POSIX_SEMAPHORES */
#endif /* GOMP_SEM_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 GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H_
#define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H_
#include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
#include "base/memory/ref_counted.h"
namespace gfx {
class GLContext;
}
namespace gpu {
class AsyncPixelTransferDelegateShareGroup;
class AsyncPixelTransferUploadStats;
class AsyncPixelTransferManagerShareGroup : public AsyncPixelTransferManager {
public:
explicit AsyncPixelTransferManagerShareGroup(gfx::GLContext* context);
virtual ~AsyncPixelTransferManagerShareGroup();
// AsyncPixelTransferManager implementation:
virtual void BindCompletedAsyncTransfers() OVERRIDE;
virtual void AsyncNotifyCompletion(
const AsyncMemoryParams& mem_params,
AsyncPixelTransferCompletionObserver* observer) OVERRIDE;
virtual uint32 GetTextureUploadCount() OVERRIDE;
virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
virtual void ProcessMorePendingTransfers() OVERRIDE;
virtual bool NeedsProcessMorePendingTransfers() OVERRIDE;
// State shared between Managers and Delegates.
struct SharedState {
SharedState();
~SharedState();
scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats;
typedef std::list<base::WeakPtr<AsyncPixelTransferDelegateShareGroup> >
TransferQueue;
TransferQueue pending_allocations;
};
private:
// AsyncPixelTransferManager implementation:
virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
gles2::TextureRef* ref,
const AsyncTexImage2DParams& define_params) OVERRIDE;
SharedState shared_state_;
DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerShareGroup);
};
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H_
|
// Below layout is based upon /u/That-Canadian's planck layout
#include QMK_KEYBOARD_H
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
enum layer_names {
_QWERTY,
_FUNC,
_RGB,
_LAYER3
};
// Defines for task manager and such
#define CALTDEL LCTL(LALT(KC_DEL))
#define TSKMGR LCTL(LSFT(KC_ESC))
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-------------.
* | 1 | 2 |
* |------+------|
* | 3 | 4 |
* |------+------|
* | 5 | 6 |
* |------+------|
* | FUNC | 8 |
* `-------------'
*/
[_QWERTY] = LAYOUT(
KC_1, KC_2,
KC_3, KC_4,
KC_5, KC_6,
MO(_FUNC), TG(_RGB)
),
/* Function
* ,-------------.
* | Q |CALDEL|
* |------+------|
* | A |TSKMGR|
* |------+------|
* | Z | X |
* |------+------|
* | | C |
* `-------------'
*/
[_FUNC] = LAYOUT(
KC_Q, CALTDEL,
KC_A, TSKMGR,
KC_Z, KC_X,
KC_TRNS, KC_C
),
/* RGB
* ,-------------.
* | MODE-| MODE+|
* |------+------|
* | HUE- | HUE+ |
* |------+------|
* | SAT- | SAT+ |
* |------+------|
* |TOGGLE| |
* `-------------'
*/
[_RGB] = LAYOUT(
RGB_RMOD, RGB_MOD,
RGB_HUD, RGB_HUI,
RGB_SAD, RGB_SAI,
RGB_TOG, KC_TRNS
),
/* Layer 3
* ,-------------.
* | | |
* |------+------|
* | | |
* |------+------|
* | | |
* |------+------|
* | | |
* `-------------'
*/
[_LAYER3] = LAYOUT(
KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS
)
};
|
/*
* MobiCore KernelApi module
*
* <-- Copyright Giesecke & Devrient GmbH 2009-2012 -->
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/netlink.h>
#include <linux/kthread.h>
#include <linux/device.h>
#include <net/sock.h>
#include <linux/list.h>
#include "connection.h"
#include "common.h"
#define MC_DAEMON_NETLINK 17
struct mc_kernelapi_ctx {
struct sock *sk;
struct list_head peers;
atomic_t counter;
};
struct mc_kernelapi_ctx *mod_ctx;
/* Define a MobiCore Kernel API device structure for use with dev_debug() etc */
struct device_driver mc_kernel_api_name = {
.name = "mckernelapi"
};
struct device mc_kernel_api_subname = {
.init_name = "", /* Set to 'mcapi' at mcapi_init() time */
.driver = &mc_kernel_api_name
};
struct device *mc_kapi = &mc_kernel_api_subname;
/* get a unique ID */
unsigned int mcapi_unique_id(void)
{
return (unsigned int)atomic_inc_return(&(mod_ctx->counter));
}
static struct connection *mcapi_find_connection(uint32_t seq)
{
struct connection *tmp;
struct list_head *pos;
/* Get session for session_id */
list_for_each(pos, &mod_ctx->peers) {
tmp = list_entry(pos, struct connection, list);
if (tmp->sequence_magic == seq)
return tmp;
}
return NULL;
}
void mcapi_insert_connection(struct connection *connection)
{
list_add_tail(&(connection->list), &(mod_ctx->peers));
connection->socket_descriptor = mod_ctx->sk;
}
void mcapi_remove_connection(uint32_t seq)
{
struct connection *tmp;
struct list_head *pos, *q;
/*
* Delete all session objects. Usually this should not be needed as
* closeDevice() requires that all sessions have been closed before.
*/
list_for_each_safe(pos, q, &mod_ctx->peers) {
tmp = list_entry(pos, struct connection, list);
if (tmp->sequence_magic == seq) {
list_del(pos);
break;
}
}
}
static int mcapi_process(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct connection *c;
int length;
int seq;
pid_t pid;
int ret;
pid = nlh->nlmsg_pid;
length = nlh->nlmsg_len;
seq = nlh->nlmsg_seq;
MCDRV_DBG_VERBOSE(mc_kapi, "nlmsg len %d type %d pid 0x%X seq %d\n",
length, nlh->nlmsg_type, pid, seq);
do {
c = mcapi_find_connection(seq);
if (!c) {
MCDRV_ERROR(mc_kapi,
"Invalid incoming connection - seq=%u!",
seq);
ret = -1;
break;
}
/* Pass the buffer to the appropriate connection */
connection_process(c, skb);
ret = 0;
} while (false);
return ret;
}
static void mcapi_callback(struct sk_buff *skb)
{
struct nlmsghdr *nlh = nlmsg_hdr(skb);
int len = skb->len;
int err = 0;
while (NLMSG_OK(nlh, len)) {
err = mcapi_process(skb, nlh);
/* if err or if this message says it wants a response */
if (err || (nlh->nlmsg_flags & NLM_F_ACK))
netlink_ack(skb, nlh, err);
nlh = NLMSG_NEXT(nlh, len);
}
}
static int __init mcapi_init(void)
{
#if defined MC_NETLINK_COMPAT || defined MC_NETLINK_COMPAT_V37
struct netlink_kernel_cfg cfg = {
.input = mcapi_callback,
};
#endif
dev_set_name(mc_kapi, "mcapi");
dev_info(mc_kapi, "Mobicore API module initialized!\n");
mod_ctx = kzalloc(sizeof(struct mc_kernelapi_ctx), GFP_KERNEL);
#ifdef MC_NETLINK_COMPAT_V37
mod_ctx->sk = netlink_kernel_create(&init_net, MC_DAEMON_NETLINK,
&cfg);
#elif defined MC_NETLINK_COMPAT
mod_ctx->sk = netlink_kernel_create(&init_net, MC_DAEMON_NETLINK,
THIS_MODULE, &cfg);
#else
/* start kernel thread */
mod_ctx->sk = netlink_kernel_create(&init_net, MC_DAEMON_NETLINK, 0,
mcapi_callback, NULL, THIS_MODULE);
#endif
if (!mod_ctx->sk) {
MCDRV_ERROR(mc_kapi, "register of receive handler failed");
return -EFAULT;
}
INIT_LIST_HEAD(&mod_ctx->peers);
return 0;
}
static void __exit mcapi_exit(void)
{
dev_info(mc_kapi, "Unloading Mobicore API module.\n");
if (mod_ctx->sk != NULL) {
netlink_kernel_release(mod_ctx->sk);
mod_ctx->sk = NULL;
}
kfree(mod_ctx);
mod_ctx = NULL;
}
module_init(mcapi_init);
module_exit(mcapi_exit);
MODULE_AUTHOR("Giesecke & Devrient GmbH");
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("MobiCore API driver");
|
/*
* Copyright (c) 2012 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Obere Lagerstr. 30
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <rtems/score/cpu.h>
void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
{
/* TODO */
}
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_config.h"
#include "SDL_video.h"
#include "SDL_blit.h"
#include "SDL_blit_copy.h"
#ifdef __SSE__
/* This assumes 16-byte aligned src and dst */
static __inline__ void
SDL_memcpySSE(Uint8 * dst, const Uint8 * src, int len)
{
int i;
__m128 values[4];
for (i = len / 64; i--;) {
_mm_prefetch(src, _MM_HINT_NTA);
values[0] = *(__m128 *) (src + 0);
values[1] = *(__m128 *) (src + 16);
values[2] = *(__m128 *) (src + 32);
values[3] = *(__m128 *) (src + 48);
_mm_stream_ps((float *) (dst + 0), values[0]);
_mm_stream_ps((float *) (dst + 16), values[1]);
_mm_stream_ps((float *) (dst + 32), values[2]);
_mm_stream_ps((float *) (dst + 48), values[3]);
src += 64;
dst += 64;
}
if (len & 63)
SDL_memcpy(dst, src, len & 63);
}
#endif /* __SSE__ */
#ifdef __MMX__
#ifdef _MSC_VER
#pragma warning(disable:4799)
#endif
static __inline__ void
SDL_memcpyMMX(Uint8 * dst, const Uint8 * src, int len)
{
const int remain = (len & 63);
int i;
__m64* d64 = (__m64*)dst;
__m64* s64 = (__m64*)src;
for(i= len / 64; i--;) {
d64[0] = s64[0];
d64[1] = s64[1];
d64[2] = s64[2];
d64[3] = s64[3];
d64[4] = s64[4];
d64[5] = s64[5];
d64[6] = s64[6];
d64[7] = s64[7];
d64 += 8;
s64 += 8;
}
if (remain)
{
const int skip = len - remain;
SDL_memcpy(dst + skip, src + skip, remain);
}
}
#endif /* __MMX__ */
void
SDL_BlitCopy(SDL_BlitInfo * info)
{
SDL_bool overlap;
Uint8 *src, *dst;
int w, h;
int srcskip, dstskip;
w = info->dst_w * info->dst_fmt->BytesPerPixel;
h = info->dst_h;
src = info->src;
dst = info->dst;
srcskip = info->src_pitch;
dstskip = info->dst_pitch;
/* Properly handle overlapping blits */
if (src < dst) {
overlap = (dst < (src + h*srcskip));
} else {
overlap = (src < (dst + h*dstskip));
}
if (overlap) {
while (h--) {
SDL_memmove(dst, src, w);
src += srcskip;
dst += dstskip;
}
return;
}
#ifdef __SSE__
if (SDL_HasSSE() &&
!((uintptr_t) src & 15) && !(srcskip & 15) &&
!((uintptr_t) dst & 15) && !(dstskip & 15)) {
while (h--) {
SDL_memcpySSE(dst, src, w);
src += srcskip;
dst += dstskip;
}
return;
}
#endif
#ifdef __MMX__
if (SDL_HasMMX() && !(srcskip & 7) && !(dstskip & 7)) {
while (h--) {
SDL_memcpyMMX(dst, src, w);
src += srcskip;
dst += dstskip;
}
_mm_empty();
return;
}
#endif
while (h--) {
SDL_memcpy(dst, src, w);
src += srcskip;
dst += dstskip;
}
}
/* vi: set ts=4 sw=4 expandtab: */
|
/*
* Defines for zoom boards
*/
#define ZOOM_NAND_CS 0
extern int __init zoom_debugboard_init(void);
extern void __init zoom_peripherals_init(void);
#define ZOOM2_HEADSET_EXTMUTE_GPIO 153
|
#ifndef VULKAN_MACOS_H_
#define VULKAN_MACOS_H_ 1
/*
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
#define VK_MVK_macos_surface 1
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 3
#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface"
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
typedef struct VkMacOSSurfaceCreateInfoMVK {
VkStructureType sType;
const void* pNext;
VkMacOSSurfaceCreateFlagsMVK flags;
const void* pView;
} VkMacOSSurfaceCreateInfoMVK;
typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK(
VkInstance instance,
const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif
|
/*
* File: plainconsole.h
* --------------------
* This file declares functions to add utility to the
* C++ plain text console streams, cin/cout/cerr.
* See plainconsole.cpp for implementation of each function.
*
* @author Marty Stepp
* @version 2015/10/21
* @since 2015/10/21
*/
#ifndef _plainconsole_h
#define _plainconsole_h
namespace plainconsole {
void setOutputLimit(int limit);
void setEcho(bool value);
} // namespace plainconsole
#endif // _plainconsole_h
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.