text stringlengths 4 6.14k |
|---|
/*
* Copyright (c) 2011-2012, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if !defined(__MAX7310_REGISTERS_H__)
#define __MAX7310_REGISTERS_H__
////////////////////////////////////////////////////////////////////////////////
// Definitions
////////////////////////////////////////////////////////////////////////////////
#define input_port_reg 0x00
#define output_port_reg 0x01
#define polarity_reg 0x02
#define config_reg 0x03
#define timeout_reg 0x04
#endif // __MAX7310_REGISTERS_H__
////////////////////////////////////////////////////////////////////////////////
// EOF
////////////////////////////////////////////////////////////////////////////////
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef SCUMM_PLAYERS_PLAYER_V2BASE_H
#define SCUMM_PLAYERS_PLAYER_V2BASE_H
#include "common/scummsys.h"
#include "common/mutex.h"
#include "scumm/music.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
namespace Scumm {
class ScummEngine;
#include "common/pack-start.h" // START STRUCT PACKING
struct channel_data {
uint16 time_left; // 00
uint16 next_cmd; // 02
uint16 base_freq; // 04
uint16 freq_delta; // 06
uint16 freq; // 08
uint16 volume; // 10
uint16 volume_delta; // 12
uint16 tempo; // 14
uint16 inter_note_pause; // 16
uint16 transpose; // 18
uint16 note_length; // 20
uint16 hull_curve; // 22
uint16 hull_offset; // 24
uint16 hull_counter; // 26
uint16 freqmod_table; // 28
uint16 freqmod_offset; // 30
uint16 freqmod_incr; // 32
uint16 freqmod_multiplier; // 34
uint16 freqmod_modulo; // 36
uint16 unknown[4]; // 38 - 44
uint16 music_timer; // 46
uint16 music_script_nr; // 48
} PACKED_STRUCT;
#include "common/pack-end.h" // END STRUCT PACKING
/**
* Common base class for Player_V2 and Player_V2CMS.
*/
class Player_V2Base : public Audio::AudioStream, public MusicEngine {
public:
Player_V2Base(ScummEngine *scumm, Audio::Mixer *mixer, bool pcjr);
virtual ~Player_V2Base();
// MusicEngine API
// virtual void setMusicVolume(int vol);
// virtual void startSound(int sound);
// virtual void stopSound(int sound);
// virtual void stopAllSounds();
virtual int getMusicTimer();
// virtual int getSoundStatus(int sound) const;
// AudioStream API
/*
int readBuffer(int16 *buffer, const int numSamples) {
do_mix(buffer, numSamples / 2);
return numSamples;
}
*/
virtual bool isStereo() const { return true; }
virtual bool endOfData() const { return false; }
virtual int getRate() const { return _sampleRate; }
protected:
enum {
FIXP_SHIFT = 16
};
bool _isV3Game;
Audio::Mixer *_mixer;
Audio::SoundHandle _soundHandle;
ScummEngine *_vm;
bool _pcjr;
int _header_len;
const uint32 _sampleRate;
uint32 _next_tick;
uint32 _tick_len;
int _current_nr;
byte *_current_data;
int _next_nr;
byte *_next_data;
byte *_retaddr;
Common::Mutex _mutex;
union ChannelInfo {
channel_data d;
uint16 array[sizeof(channel_data)/2];
};
ChannelInfo _channels[5];
private:
int _music_timer;
int _music_timer_ctr;
int _ticks_per_music_timer;
const uint16 *_freqs_table;
protected:
virtual void nextTick();
virtual void clear_channel(int i);
virtual void chainSound(int nr, byte *data);
virtual void chainNextSound();
void execute_cmd(ChannelInfo *channel);
void next_freqs(ChannelInfo *channel);
};
} // End of namespace Scumm
#endif
|
/*
* netlink/msg.c Netlink Messages Interface
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
*/
#ifndef NETLINK_MSG_H_
#define NETLINK_MSG_H_
#include <netlink/netlink.h>
#include <netlink/object.h>
#include <netlink/attr.h>
#ifdef __cplusplus
extern "C" {
#endif
#define NL_DONTPAD 0
/**
* @ingroup msg
* @brief
* Will cause the netlink pid to be set to the pid assigned to
* the netlink handle (socket) just before sending the message off.
* @note Requires the use of nl_send_auto_complete()!
*/
#define NL_AUTO_PID 0
/**
* @ingroup msg
* @brief
* May be used to refer to a sequence number which should be
* automatically set just before sending the message off.
* @note Requires the use of nl_send_auto_complete()!
*/
#define NL_AUTO_SEQ 0
struct nl_msg;
struct nl_tree;
struct ucred;
/* size calculations */
extern int nlmsg_msg_size(int);
extern int nlmsg_total_size(int);
extern int nlmsg_padlen(int);
/* payload access */
extern void * nlmsg_data(const struct nlmsghdr *);
extern int nlmsg_len(const struct nlmsghdr *);
extern void * nlmsg_tail(const struct nlmsghdr *);
/* attribute access */
extern struct nlattr * nlmsg_attrdata(const struct nlmsghdr *, int);
extern int nlmsg_attrlen(const struct nlmsghdr *, int);
/* message parsing */
extern int nlmsg_valid_hdr(const struct nlmsghdr *, int);
extern int nlmsg_ok(const struct nlmsghdr *, int);
extern struct nlmsghdr * nlmsg_next(struct nlmsghdr *, int *);
extern int nlmsg_parse(struct nlmsghdr *, int, struct nlattr **,
int, struct nla_policy *);
extern struct nlattr * nlmsg_find_attr(struct nlmsghdr *, int, int);
extern int nlmsg_validate(struct nlmsghdr *, int, int,
struct nla_policy *);
extern struct nl_msg * nlmsg_alloc(void);
extern struct nl_msg * nlmsg_alloc_size(size_t);
extern struct nl_msg * nlmsg_alloc_simple(int, int);
extern void nlmsg_set_default_size(size_t);
extern struct nl_msg * nlmsg_inherit(struct nlmsghdr *);
extern struct nl_msg * nlmsg_convert(struct nlmsghdr *);
extern void * nlmsg_reserve(struct nl_msg *, size_t, int);
extern int nlmsg_append(struct nl_msg *, void *, size_t, int);
extern int nlmsg_expand(struct nl_msg *, size_t);
extern struct nlmsghdr * nlmsg_put(struct nl_msg *, uint32_t, uint32_t,
int, int, int);
extern struct nlmsghdr * nlmsg_hdr(struct nl_msg *);
extern void nlmsg_get(struct nl_msg *);
extern void nlmsg_free(struct nl_msg *);
/* attribute modification */
extern void nlmsg_set_proto(struct nl_msg *, int);
extern int nlmsg_get_proto(struct nl_msg *);
extern size_t nlmsg_get_max_size(struct nl_msg *);
extern void nlmsg_set_src(struct nl_msg *, struct sockaddr_nl *);
extern struct sockaddr_nl *nlmsg_get_src(struct nl_msg *);
extern void nlmsg_set_dst(struct nl_msg *, struct sockaddr_nl *);
extern struct sockaddr_nl *nlmsg_get_dst(struct nl_msg *);
extern void nlmsg_set_creds(struct nl_msg *, struct ucred *);
extern struct ucred * nlmsg_get_creds(struct nl_msg *);
extern char * nl_nlmsgtype2str(int, char *, size_t);
extern int nl_str2nlmsgtype(const char *);
extern char * nl_nlmsg_flags2str(int, char *, size_t);
extern int nl_msg_parse(struct nl_msg *,
void (*cb)(struct nl_object *, void *),
void *);
extern void nl_msg_dump(struct nl_msg *, FILE *);
/**
* @name Iterators
* @{
*/
/**
* @ingroup msg
* Iterate over a stream of attributes in a message
* @arg pos loop counter, set to current attribute
* @arg nlh netlink message header
* @arg hdrlen length of family header
* @arg rem initialized to len, holds bytes currently remaining in stream
*/
#define nlmsg_for_each_attr(pos, nlh, hdrlen, rem) \
nla_for_each_attr(pos, nlmsg_attrdata(nlh, hdrlen), \
nlmsg_attrlen(nlh, hdrlen), rem)
/**
* Iterate over a stream of messages
* @arg pos loop counter, set to current message
* @arg head head of message stream
* @arg len length of message stream
* @arg rem initialized to len, holds bytes currently remaining in stream
*/
#define nlmsg_for_each_msg(pos, head, len, rem) \
for (pos = head, rem = len; \
nlmsg_ok(pos, rem); \
pos = nlmsg_next(pos, &(rem)))
/** @} */
#ifdef __cplusplus
}
#endif
#endif
|
/*
Driver for Philips tda10086 DVBS Frontend
(c) 2006 Andrew de Quincey
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 TDA10086_H
#define TDA10086_H
#include <linux/dvb/frontend.h>
#include <linux/firmware.h>
enum tda10086_xtal {
TDA10086_XTAL_16M,
TDA10086_XTAL_4M
};
struct tda10086_config
{
/* the demodulator's i2c address */
u8 demod_address;
/* does the "inversion" need inverted? */
u8 invert;
/* do we need the diseqc signal with carrier? */
u8 diseqc_tone;
/* frequency of the reference xtal */
enum tda10086_xtal xtal_freq;
};
#if IS_ENABLED(CPTCFG_DVB_TDA10086)
extern struct dvb_frontend* tda10086_attach(const struct tda10086_config* config,
struct i2c_adapter* i2c);
#else
static inline struct dvb_frontend* tda10086_attach(const struct tda10086_config* config,
struct i2c_adapter* i2c)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif /* CPTCFG_DVB_TDA10086 */
#endif /* TDA10086_H */
|
// SPDX-License-Identifier: GPL-2.0
/*
* fs/sysfs/symlink.c - operations for initializing and mounting sysfs
*
* Copyright (c) 2001-3 Patrick Mochel
* Copyright (c) 2007 SUSE Linux Products GmbH
* Copyright (c) 2007 Tejun Heo <teheo@suse.de>
*
* Please see Documentation/filesystems/sysfs.txt for more information.
*/
#include <linux/fs.h>
#include <linux/magic.h>
#include <linux/mount.h>
#include <linux/init.h>
#include <linux/user_namespace.h>
#include "sysfs.h"
static struct kernfs_root *sysfs_root;
struct kernfs_node *sysfs_root_kn;
static struct dentry *sysfs_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
struct dentry *root;
void *ns;
bool new_sb;
if (!(flags & SB_KERNMOUNT)) {
if (!kobj_ns_current_may_mount(KOBJ_NS_TYPE_NET))
return ERR_PTR(-EPERM);
}
ns = kobj_ns_grab_current(KOBJ_NS_TYPE_NET);
root = kernfs_mount_ns(fs_type, flags, sysfs_root,
SYSFS_MAGIC, &new_sb, ns);
if (IS_ERR(root) || !new_sb)
kobj_ns_drop(KOBJ_NS_TYPE_NET, ns);
else if (new_sb)
root->d_sb->s_iflags |= SB_I_USERNS_VISIBLE;
return root;
}
static void sysfs_kill_sb(struct super_block *sb)
{
void *ns = (void *)kernfs_super_ns(sb);
kernfs_kill_sb(sb);
kobj_ns_drop(KOBJ_NS_TYPE_NET, ns);
}
static struct file_system_type sysfs_fs_type = {
.name = "sysfs",
.mount = sysfs_mount,
.kill_sb = sysfs_kill_sb,
.fs_flags = FS_USERNS_MOUNT,
};
int __init sysfs_init(void)
{
int err;
sysfs_root = kernfs_create_root(NULL, KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK,
NULL);
if (IS_ERR(sysfs_root))
return PTR_ERR(sysfs_root);
sysfs_root_kn = sysfs_root->kn;
err = register_filesystem(&sysfs_fs_type);
if (err) {
kernfs_destroy_root(sysfs_root);
return err;
}
return 0;
}
|
/*-
* Copyright (c) 2002-2004 Tim J. Robbins.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
FUNCTION
<<ungetwc>>---push wide character data back into a stream
INDEX
ungetwc
INDEX
_ungetwc_r
ANSI_SYNOPSIS
#include <stdio.h>
#include <wchar.h>
wint_t ungetwc(wint_t <[wc]>, FILE *<[stream]>);
wint_t _ungetwc_r(struct _reent *<[reent]>, wint_t <[wc]>, FILE *<[stream]>);
DESCRIPTION
<<ungetwc>> is used to return wide characters back to <[stream]> to be
read again. If <[wc]> is WEOF, the stream is unchanged. Otherwise, the
wide character <[wc]> is put back on the stream, and subsequent reads will see
the wide chars pushed back in reverse order. Pushed wide chars are lost if the
stream is repositioned, such as by <<fseek>>, <<fsetpos>>, or
<<rewind>>.
The underlying file is not changed, but it is possible to push back
something different than what was originally read. Ungetting a
character will clear the end-of-stream marker, and decrement the file
position indicator. Pushing back beyond the beginning of a file gives
unspecified behavior.
The alternate function <<_ungetwc_r>> is a reentrant version. The
extra argument <[reent]> is a pointer to a reentrancy structure.
RETURNS
The wide character pushed back, or <<WEOF>> on error.
PORTABILITY
C99
*/
#include <_ansi.h>
#include <reent.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
#include "local.h"
wint_t
_DEFUN(_ungetwc_r, (ptr, wc, fp),
struct _reent *ptr _AND
wint_t wc _AND
register FILE *fp)
{
char buf[MB_LEN_MAX];
size_t len;
_flockfile (fp);
ORIENT (fp, 1);
if (wc == WEOF)
wc = WEOF;
else if ((len = _wcrtomb_r(ptr, buf, wc, &fp->_mbstate)) == (size_t)-1)
{
fp->_flags |= __SERR;
wc = WEOF;
}
else
while (len-- != 0)
if (_ungetc_r(ptr, (unsigned char)buf[len], fp) == EOF)
{
wc = WEOF;
break;
}
_funlockfile (fp);
return wc;
}
/*
* MT-safe version.
*/
wint_t
_DEFUN(ungetwc, (wint_t wc, FILE *fp),
wint_t wc _AND
FILE *fp)
{
CHECK_INIT (_REENT, fp);
return _ungetwc_r (_REENT, wc, fp);
}
|
// @(#):$Id$
// Author: M.Gheata
/*************************************************************************
* Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TGeoTorusEditor
#define ROOT_TGeoTorusEditor
//////////////////////////////////////////////////////////////////////////
// //
// TGeoTorusEditor //
// //
// Editor for a TGeoTorus. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TGButton
#include "TGWidget.h"
#endif
#ifndef ROOT_TGeoGedFrame
#include "TGeoGedFrame.h"
#endif
class TGeoTorus;
class TGeoTabManager;
class TGTextEntry;
class TGNumberEntry;
class TGTab;
class TGComboBox;
class TGTextButton;
class TGCheckButton;
class TString;
class TGeoTorusEditor : public TGeoGedFrame {
protected:
Double_t fRi; // Initial axial radius
Double_t fRmini; // Initial inner radius
Double_t fRmaxi; // Initial outer radius
Double_t fPhi1i; // Initial starting phi1
Double_t fDphii; // Initial phi extent
TString fNamei; // Initial name
TGeoTorus *fShape; // Shape object
Bool_t fIsModified; // Flag that volume was modified
Bool_t fIsShapeEditable; // Flag that the shape can be changed
TGTextEntry *fShapeName; // Shape name text entry
TGNumberEntry *fER; // Number entry for R
TGNumberEntry *fERmin; // Number entry for Rmin
TGNumberEntry *fERmax; // Number entry for Rmax
TGNumberEntry *fEPhi1; // Number entry for phi1
TGNumberEntry *fEDphi; // Number entry for Dphi
TGTextButton *fApply; // Apply-Button to accept changes
TGTextButton *fUndo; // Undo-Button
TGCheckButton *fDelayed; // Check button for delayed draw
virtual void ConnectSignals2Slots(); // Connect the signals to the slots
Bool_t IsDelayed() const;
public:
TGeoTorusEditor(const TGWindow *p = 0,
Int_t width = 140, Int_t height = 30,
UInt_t options = kChildFrame,
Pixel_t back = GetDefaultFrameBackground());
virtual ~TGeoTorusEditor();
virtual void SetModel(TObject *obj);
void DoR();
void DoRmin();
void DoRmax();
void DoPhi1();
void DoDphi();
void DoModified();
void DoName();
void DoApply();
void DoUndo();
ClassDef(TGeoTorusEditor,0) // TGeoTorus editor
};
#endif
|
#import "CPTTestCase.h"
@interface CPTLineStyleTests : CPTTestCase
@end
|
/*-------------------------------------------------------------------------
*
* cdbdef.h
* Definitions for use anywhere
*
* Copyright (c) 2005-2008, Greenplum inc
*
*-------------------------------------------------------------------------
*/
#ifndef CDBDEF_H
#define CDBDEF_H
/*
* CdbSwap
* Exchange the contents of two variables.
*/
#define CdbSwap(_type, _x, _y) \
do \
{ \
_type _t = (_x); \
_x = (_y); \
_y = (_t); \
} while (0)
/*
* CdbVisitOpt
* Some tree walkers use these codes to direct the traversal.
*/
typedef enum
{
CdbVisit_Walk = 1, /* proceed in normal sequence */
CdbVisit_Skip, /* no more calls for current node or its kids */
CdbVisit_Stop, /* break out of traversal, no more callbacks */
CdbVisit_Failure, /* break out of traversal, no more callbacks */
CdbVisit_Success /* break out of traversal, no more callbacks */
} CdbVisitOpt;
#endif /* CDBDEF_H */
|
//
// ______ ______ ______
// /\ __ \ /\ ___\ /\ ___\
// \ \ __< \ \ __\_ \ \ __\_
// \ \_____\ \ \_____\ \ \_____\
// \/_____/ \/_____/ \/_____/
//
//
// Copyright (c) 2013-2014, {Bee} open source community
// http://www.bee-framework.com
//
//
// 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.
//
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
#import "Bee.h"
#if (__ON__ == __BEE_DEVELOPMENT__)
#pragma mark -
@interface ServiceDebugger_StatusBar : BeeUIWindow
AS_SINGLETON( ServiceDebugger_StatusBar )
@end
#endif // #if (__ON__ == __BEE_DEVELOPMENT__)
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
/* pmc - Driver implementation for power management functions
* of Power Management Controller (PMC) on SPARCstation-Voyager.
*
* Copyright (c) 2002 Eric Brower (ebrower@usa.net)
*/
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/pm.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/module.h>
#include <asm/io.h>
#include <asm/oplib.h>
#include <asm/uaccess.h>
#include <asm/auxio.h>
#define PMC_OBPNAME "SUNW,pmc"
#define PMC_DEVNAME "pmc"
#define PMC_IDLE_REG 0x00
#define PMC_IDLE_ON 0x01
static u8 __iomem *regs;
#define pmc_readb(offs) (sbus_readb(regs+offs))
#define pmc_writeb(val, offs) (sbus_writeb(val, regs+offs))
static void pmc_swift_idle(void)
{
#ifdef PMC_DEBUG_LED
set_auxio(0x00, AUXIO_LED);
#endif
pmc_writeb(pmc_readb(PMC_IDLE_REG) | PMC_IDLE_ON, PMC_IDLE_REG);
#ifdef PMC_DEBUG_LED
set_auxio(AUXIO_LED, 0x00);
#endif
}
static int __devinit pmc_probe(struct platform_device *op)
{
regs = of_ioremap(&op->resource[0], 0,
resource_size(&op->resource[0]), PMC_OBPNAME);
if (!regs) {
printk(KERN_ERR "%s: unable to map registers\n", PMC_DEVNAME);
return -ENODEV;
}
#ifndef PMC_NO_IDLE
pm_idle = pmc_swift_idle;
#endif
printk(KERN_INFO "%s: power management initialized\n", PMC_DEVNAME);
return 0;
}
static struct of_device_id pmc_match[] = {
{
.name = PMC_OBPNAME,
},
{},
};
MODULE_DEVICE_TABLE(of, pmc_match);
static struct platform_driver pmc_driver = {
.driver = {
.name = "pmc",
.owner = THIS_MODULE,
.of_match_table = pmc_match,
},
.probe = pmc_probe,
};
static int __init pmc_init(void)
{
return platform_driver_register(&pmc_driver);
}
__initcall(pmc_init);
|
#ifndef __ARCH_M68K_CACHE_H
#define __ARCH_M68K_CACHE_H
#define L1_CACHE_SHIFT 4
#define L1_CACHE_BYTES (1<< L1_CACHE_SHIFT)
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
#endif
|
/**
* Copyright 2009 Jeff Verkoeyen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <UIKit/UIKit.h>
#include <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>
#include "Decoder.h"
#include "parsedResults/ParsedResult.h"
#include "OverlayView.h"
@protocol ZXingDelegate;
#if !TARGET_IPHONE_SIMULATOR
#define HAS_AVFF 1
#endif
@interface ZXingWidgetController : UIViewController<DecoderDelegate,
CancelDelegate,
UINavigationControllerDelegate
#if HAS_AVFF
, AVCaptureVideoDataOutputSampleBufferDelegate
#endif
> {
NSSet *readers;
ParsedResult *result;
OverlayView *overlayView;
SystemSoundID beepSound;
BOOL showCancel;
NSURL *soundToPlay;
id<ZXingDelegate> delegate;
BOOL wasCancelled;
BOOL oneDMode;
#if HAS_AVFF
AVCaptureSession *captureSession;
AVCaptureVideoPreviewLayer *prevLayer;
#endif
BOOL decoding;
BOOL isStatusBarHidden;
}
#if HAS_AVFF
@property (nonatomic, retain) AVCaptureSession *captureSession;
@property (nonatomic, retain) AVCaptureVideoPreviewLayer *prevLayer;
#endif
@property (nonatomic, retain ) NSSet *readers;
@property (nonatomic, assign) id<ZXingDelegate> delegate;
@property (nonatomic, retain) NSURL *soundToPlay;
@property (nonatomic, retain) ParsedResult *result;
@property (nonatomic, retain) OverlayView *overlayView;
- (id)initWithDelegate:(id<ZXingDelegate>)delegate showCancel:(BOOL)shouldShowCancel OneDMode:(BOOL)shouldUseoOneDMode;
- (id)initWithDelegate:(id<ZXingDelegate>)scanDelegate showCancel:(BOOL)shouldShowCancel OneDMode:(BOOL)shouldUseoOneDMode showLicense:(BOOL)shouldShowLicense;
- (BOOL)fixedFocus;
- (void)setTorch:(BOOL)status;
- (BOOL)torchIsOn;
@end
@protocol ZXingDelegate
- (void)zxingController:(ZXingWidgetController*)controller didScanResult:(NSString *)result;
- (void)zxingControllerDidCancel:(ZXingWidgetController*)controller;
@end
|
#ifndef __CAMERA_FDVT_H__
#define __CAMERA_FDVT_H__
#include <linux/ioctl.h>
#define FDVT_IOC_MAGIC 'N'
#ifdef CONFIG_COMPAT
//64 bit
#include <linux/fs.h>
#include <linux/compat.h>
#endif
typedef struct
{
unsigned int *pAddr;
unsigned int *pData;
unsigned int u4Count;
} MT6573FDVTRegIO;
#ifdef CONFIG_COMPAT
typedef struct
{
compat_uptr_t pAddr;
compat_uptr_t pData;
unsigned int u4Count;
} compat_MT6573FDVTRegIO;
#endif
//below is control message
#define MT6573FDVT_INIT_SETPARA_CMD _IO(FDVT_IOC_MAGIC, 0x00)
#define MT6573FDVTIOC_STARTFD_CMD _IO(FDVT_IOC_MAGIC, 0x01)
#define MT6573FDVTIOC_G_WAITIRQ _IOR(FDVT_IOC_MAGIC, 0x02, unsigned int )
#define MT6573FDVTIOC_T_SET_FDCONF_CMD _IOW(FDVT_IOC_MAGIC, 0x03, MT6573FDVTRegIO)
#define MT6573FDVTIOC_G_READ_FDREG_CMD _IOWR(FDVT_IOC_MAGIC, 0x04, MT6573FDVTRegIO)
#define MT6573FDVTIOC_T_SET_SDCONF_CMD _IOW(FDVT_IOC_MAGIC, 0x05, MT6573FDVTRegIO)
//#define FDVT_DESTROY_CMD _IO(FDVT_IOC_MAGIC, 0x10)
#define MT6573FDVTIOC_T_DUMPREG _IO(FDVT_IOC_MAGIC, 0x80)
//#define FDVT_SET_CMD_CMD _IOW(FDVT_IOC_MAGIC, 0x03, unsigned int)
//#define FDVT_SET_PWR_CMD _IOW(FDVT_IOC_MAGIC, 0x04, unsigned int)
//#define FDVT_SET_ISR_CMD _IOW(FDVT_IOC_MAGIC, 0x05, unsigned int)
//#define FDVT_GET_CACHECTRLADDR_CMD _IOR(FDVT_IOC_MAGIC, 0x06, int)
#ifdef CONFIG_COMPAT
#define COMPAT_MT6573FDVT_INIT_SETPARA_CMD _IO(FDVT_IOC_MAGIC, 0x00)
#define COMPAT_MT6573FDVTIOC_STARTFD_CMD _IO(FDVT_IOC_MAGIC, 0x01)
#define COMPAT_MT6573FDVTIOC_G_WAITIRQ _IOR(FDVT_IOC_MAGIC, 0x02, unsigned int )
#define COMPAT_MT6573FDVTIOC_T_SET_FDCONF_CMD _IOW(FDVT_IOC_MAGIC, 0x03, compat_MT6573FDVTRegIO)
#define COMPAT_MT6573FDVTIOC_G_READ_FDREG_CMD _IOWR(FDVT_IOC_MAGIC, 0x04, compat_MT6573FDVTRegIO)
#define COMPAT_MT6573FDVTIOC_T_SET_SDCONF_CMD _IOW(FDVT_IOC_MAGIC, 0x05, compat_MT6573FDVTRegIO)
#define COMPAT_MT6573FDVTIOC_T_DUMPREG _IO(FDVT_IOC_MAGIC, 0x80)
#endif
#endif //__CAMERA_FDVT_H__
|
// Copyright 2005-2008, various authors
//
// 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
void RefreshAllBoolsVars( );
void DisplayFreeVarSpy( );
void OpenSpyVarsWindow( );
void VarsWindowInitGtk( );
|
/**
* WinPR: Windows Portable Runtime
* Windows Native System Services
*
* Copyright 2013 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 WINPR_NT_PRIVATE_H
#define WINPR_NT_PRIVATE_H
#ifndef _WIN32
#include <winpr/nt.h>
#include "../handle/handle.h"
struct winpr_file
{
WINPR_HANDLE_DEF();
ACCESS_MASK DesiredAccess;
OBJECT_ATTRIBUTES ObjectAttributes;
ULONG FileAttributes;
ULONG ShareAccess;
ULONG CreateDisposition;
ULONG CreateOptions;
};
typedef struct winpr_file WINPR_FILE;
#endif
#endif /* WINPR_NT_PRIVATE_H */
|
/*
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, 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, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VIA, S3 GRAPHICS, 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.
*/
#ifndef _VIA_DRV_H_
#define _VIA_DRV_H_
#include "drm_sman.h"
#define DRIVER_AUTHOR "Various"
#define DRIVER_NAME "via"
#define DRIVER_DESC "VIA Unichrome / Pro"
#define DRIVER_DATE "20070202"
#define DRIVER_MAJOR 2
#define DRIVER_MINOR 11
#define DRIVER_PATCHLEVEL 1
#include "via_verifier.h"
#include "via_dmablit.h"
#define VIA_PCI_BUF_SIZE 60000
#define VIA_FIRE_BUF_SIZE 1024
#define VIA_NUM_IRQS 4
typedef struct drm_via_ring_buffer {
drm_local_map_t map;
char *virtual_start;
} drm_via_ring_buffer_t;
typedef uint32_t maskarray_t[5];
typedef struct drm_via_irq {
atomic_t irq_received;
uint32_t pending_mask;
uint32_t enable_mask;
wait_queue_head_t irq_queue;
} drm_via_irq_t;
typedef struct drm_via_private {
drm_via_sarea_t *sarea_priv;
drm_local_map_t *sarea;
drm_local_map_t *fb;
drm_local_map_t *mmio;
unsigned long agpAddr;
wait_queue_head_t decoder_queue[VIA_NR_XVMC_LOCKS];
char *dma_ptr;
unsigned int dma_low;
unsigned int dma_high;
unsigned int dma_offset;
uint32_t dma_wrap;
volatile uint32_t *last_pause_ptr;
volatile uint32_t *hw_addr_ptr;
drm_via_ring_buffer_t ring;
struct timeval last_vblank;
int last_vblank_valid;
unsigned usec_per_vblank;
drm_via_state_t hc_state;
char pci_buf[VIA_PCI_BUF_SIZE];
const uint32_t *fire_offsets[VIA_FIRE_BUF_SIZE];
uint32_t num_fire_offsets;
int chipset;
drm_via_irq_t via_irqs[VIA_NUM_IRQS];
unsigned num_irqs;
maskarray_t *irq_masks;
uint32_t irq_enable_mask;
uint32_t irq_pending_mask;
int *irq_map;
unsigned int idle_fault;
drm_sman_t sman;
int vram_initialized;
int agp_initialized;
unsigned long vram_offset;
unsigned long agp_offset;
drm_via_blitq_t blit_queues[VIA_NUM_BLIT_ENGINES];
uint32_t dma_diff;
} drm_via_private_t;
enum via_family {
VIA_OTHER = 0, /* Baseline */
VIA_PRO_GROUP_A, /* Another video engine and DMA commands */
VIA_DX9_0 /* Same video as pro_group_a, but 3D is unsupported */
};
/* VIA MMIO register access */
#define VIA_BASE ((dev_priv->mmio))
#define VIA_READ(reg) DRM_READ32(VIA_BASE, reg)
#define VIA_WRITE(reg,val) DRM_WRITE32(VIA_BASE, reg, val)
#define VIA_READ8(reg) DRM_READ8(VIA_BASE, reg)
#define VIA_WRITE8(reg,val) DRM_WRITE8(VIA_BASE, reg, val)
extern drm_ioctl_desc_t via_ioctls[];
extern int via_max_ioctl;
extern int via_fb_init(DRM_IOCTL_ARGS);
extern int via_mem_alloc(DRM_IOCTL_ARGS);
extern int via_mem_free(DRM_IOCTL_ARGS);
extern int via_agp_init(DRM_IOCTL_ARGS);
extern int via_map_init(DRM_IOCTL_ARGS);
extern int via_decoder_futex(DRM_IOCTL_ARGS);
extern int via_wait_irq(DRM_IOCTL_ARGS);
extern int via_dma_blit_sync( DRM_IOCTL_ARGS );
extern int via_dma_blit( DRM_IOCTL_ARGS );
extern int via_driver_load(drm_device_t *dev, unsigned long chipset);
extern int via_driver_unload(drm_device_t *dev);
extern int via_init_context(drm_device_t * dev, int context);
extern int via_final_context(drm_device_t * dev, int context);
extern int via_do_cleanup_map(drm_device_t * dev);
extern int via_driver_vblank_wait(drm_device_t * dev, unsigned int *sequence);
extern irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS);
extern void via_driver_irq_preinstall(drm_device_t * dev);
extern void via_driver_irq_postinstall(drm_device_t * dev);
extern void via_driver_irq_uninstall(drm_device_t * dev);
extern int via_dma_cleanup(drm_device_t * dev);
extern void via_init_command_verifier(void);
extern int via_driver_dma_quiescent(drm_device_t * dev);
extern void via_init_futex(drm_via_private_t * dev_priv);
extern void via_cleanup_futex(drm_via_private_t * dev_priv);
extern void via_release_futex(drm_via_private_t * dev_priv, int context);
extern void via_reclaim_buffers_locked(drm_device_t *dev, struct file *filp);
extern void via_lastclose(drm_device_t *dev);
extern void via_dmablit_handler(drm_device_t *dev, int engine, int from_irq);
extern void via_init_dmablit(drm_device_t *dev);
#endif
|
/* ----------------------------------------------------------------------
* Project: CMSIS DSP Library
* Title: arm_cmplx_mag_squared_q15.c
* Description: Q15 complex magnitude squared
*
* $Date: 27. January 2017
* $Revision: V.1.5.1
*
* Target Processor: Cortex-M cores
* -------------------------------------------------------------------- */
/*
* Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "arm_math.h"
/**
* @ingroup groupCmplxMath
*/
/**
* @addtogroup cmplx_mag_squared
* @{
*/
/**
* @brief Q15 complex magnitude squared
* @param *pSrc points to the complex input vector
* @param *pDst points to the real output vector
* @param numSamples number of complex samples in the input vector
* @return none.
*
* <b>Scaling and Overflow Behavior:</b>
* \par
* The function implements 1.15 by 1.15 multiplications and finally output is converted into 3.13 format.
*/
void arm_cmplx_mag_squared_q15(
q15_t * pSrc,
q15_t * pDst,
uint32_t numSamples)
{
q31_t acc0, acc1; /* Accumulators */
#if defined (ARM_MATH_DSP)
/* Run the below code for Cortex-M4 and Cortex-M3 */
uint32_t blkCnt; /* loop counter */
q31_t in1, in2, in3, in4;
q31_t acc2, acc3;
/*loop Unrolling */
blkCnt = numSamples >> 2U;
/* First part of the processing with loop unrolling. Compute 4 outputs at a time.
** a second loop below computes the remaining 1 to 3 samples. */
while (blkCnt > 0U)
{
/* C[0] = (A[0] * A[0] + A[1] * A[1]) */
in1 = *__SIMD32(pSrc)++;
in2 = *__SIMD32(pSrc)++;
in3 = *__SIMD32(pSrc)++;
in4 = *__SIMD32(pSrc)++;
acc0 = __SMUAD(in1, in1);
acc1 = __SMUAD(in2, in2);
acc2 = __SMUAD(in3, in3);
acc3 = __SMUAD(in4, in4);
/* store the result in 3.13 format in the destination buffer. */
*pDst++ = (q15_t) (acc0 >> 17);
*pDst++ = (q15_t) (acc1 >> 17);
*pDst++ = (q15_t) (acc2 >> 17);
*pDst++ = (q15_t) (acc3 >> 17);
/* Decrement the loop counter */
blkCnt--;
}
/* If the numSamples is not a multiple of 4, compute any remaining output samples here.
** No loop unrolling is used. */
blkCnt = numSamples % 0x4U;
while (blkCnt > 0U)
{
/* C[0] = (A[0] * A[0] + A[1] * A[1]) */
in1 = *__SIMD32(pSrc)++;
acc0 = __SMUAD(in1, in1);
/* store the result in 3.13 format in the destination buffer. */
*pDst++ = (q15_t) (acc0 >> 17);
/* Decrement the loop counter */
blkCnt--;
}
#else
/* Run the below code for Cortex-M0 */
q15_t real, imag; /* Temporary variables to store real and imaginary values */
while (numSamples > 0U)
{
/* out = ((real * real) + (imag * imag)) */
real = *pSrc++;
imag = *pSrc++;
acc0 = (real * real);
acc1 = (imag * imag);
/* store the result in 3.13 format in the destination buffer. */
*pDst++ = (q15_t) (((q63_t) acc0 + acc1) >> 17);
/* Decrement the loop counter */
numSamples--;
}
#endif /* #if defined (ARM_MATH_DSP) */
}
/**
* @} end of cmplx_mag_squared group
*/
|
/*
* Sysctl operations for Coda filesystem
* Original version: (C) 1996 P. Braam and M. Callahan
* Rewritten for Linux 2.1. (C) 1997 Carnegie Mellon University
*
* Carnegie Mellon encourages users to contribute improvements to
* the Coda project. Contact Peter Braam (coda@cs.cmu.edu).
*
* CODA operation statistics
* (c) March, 1998 Zhanyong Wan <zhanyong.wan@yale.edu>
*
*/
#include <linux/config.h>
#include <linux/time.h>
#include <linux/mm.h>
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/ctype.h>
#include <linux/bitops.h>
#include <asm/uaccess.h>
#include <linux/utsname.h>
#include <linux/module.h>
#include <linux/coda.h>
#include <linux/coda_linux.h>
#include <linux/coda_fs_i.h>
#include <linux/coda_psdev.h>
#include <linux/coda_cache.h>
#include <linux/coda_proc.h>
static struct ctl_table_header *fs_table_header;
#define FS_CODA 1 /* Coda file system */
#define CODA_TIMEOUT 3 /* timeout on upcalls to become intrble */
#define CODA_HARD 5 /* mount type "hard" or "soft" */
#define CODA_VFS 6 /* vfs statistics */
#define CODA_CACHE_INV 9 /* cache invalidation statistics */
#define CODA_FAKE_STATFS 10 /* don't query venus for actual cache usage */
struct coda_vfs_stats coda_vfs_stat;
static struct coda_cache_inv_stats coda_cache_inv_stat;
static void reset_coda_vfs_stats( void )
{
memset( &coda_vfs_stat, 0, sizeof( coda_vfs_stat ) );
}
static void reset_coda_cache_inv_stats( void )
{
memset( &coda_cache_inv_stat, 0, sizeof( coda_cache_inv_stat ) );
}
static int do_reset_coda_vfs_stats( ctl_table * table, int write,
struct file * filp, void __user * buffer,
size_t * lenp, loff_t * ppos )
{
if ( write ) {
reset_coda_vfs_stats();
*ppos += *lenp;
} else {
*lenp = 0;
}
return 0;
}
static int do_reset_coda_cache_inv_stats( ctl_table * table, int write,
struct file * filp,
void __user * buffer,
size_t * lenp, loff_t * ppos )
{
if ( write ) {
reset_coda_cache_inv_stats();
*ppos += *lenp;
} else {
*lenp = 0;
}
return 0;
}
static int coda_vfs_stats_get_info( char * buffer, char ** start,
off_t offset, int length)
{
int len=0;
off_t begin;
struct coda_vfs_stats * ps = & coda_vfs_stat;
/* this works as long as we are below 1024 characters! */
len += sprintf( buffer,
"Coda VFS statistics\n"
"===================\n\n"
"File Operations:\n"
"\topen\t\t%9d\n"
"\tflush\t\t%9d\n"
"\trelease\t\t%9d\n"
"\tfsync\t\t%9d\n\n"
"Dir Operations:\n"
"\treaddir\t\t%9d\n\n"
"Inode Operations\n"
"\tcreate\t\t%9d\n"
"\tlookup\t\t%9d\n"
"\tlink\t\t%9d\n"
"\tunlink\t\t%9d\n"
"\tsymlink\t\t%9d\n"
"\tmkdir\t\t%9d\n"
"\trmdir\t\t%9d\n"
"\trename\t\t%9d\n"
"\tpermission\t%9d\n",
/* file operations */
ps->open,
ps->flush,
ps->release,
ps->fsync,
/* dir operations */
ps->readdir,
/* inode operations */
ps->create,
ps->lookup,
ps->link,
ps->unlink,
ps->symlink,
ps->mkdir,
ps->rmdir,
ps->rename,
ps->permission);
begin = offset;
*start = buffer + begin;
len -= begin;
if ( len > length )
len = length;
if ( len < 0 )
len = 0;
return len;
}
static int coda_cache_inv_stats_get_info( char * buffer, char ** start,
off_t offset, int length)
{
int len=0;
off_t begin;
struct coda_cache_inv_stats * ps = & coda_cache_inv_stat;
/* this works as long as we are below 1024 characters! */
len += sprintf( buffer,
"Coda cache invalidation statistics\n"
"==================================\n\n"
"flush\t\t%9d\n"
"purge user\t%9d\n"
"zap_dir\t\t%9d\n"
"zap_file\t%9d\n"
"zap_vnode\t%9d\n"
"purge_fid\t%9d\n"
"replace\t\t%9d\n",
ps->flush,
ps->purge_user,
ps->zap_dir,
ps->zap_file,
ps->zap_vnode,
ps->purge_fid,
ps->replace );
begin = offset;
*start = buffer + begin;
len -= begin;
if ( len > length )
len = length;
if ( len < 0 )
len = 0;
return len;
}
static ctl_table coda_table[] = {
{CODA_TIMEOUT, "timeout", &coda_timeout, sizeof(int), 0644, NULL, &proc_dointvec},
{CODA_HARD, "hard", &coda_hard, sizeof(int), 0644, NULL, &proc_dointvec},
{CODA_VFS, "vfs_stats", NULL, 0, 0644, NULL, &do_reset_coda_vfs_stats},
{CODA_CACHE_INV, "cache_inv_stats", NULL, 0, 0644, NULL, &do_reset_coda_cache_inv_stats},
{CODA_FAKE_STATFS, "fake_statfs", &coda_fake_statfs, sizeof(int), 0600, NULL, &proc_dointvec},
{ 0 }
};
static ctl_table fs_table[] = {
{FS_CODA, "coda", NULL, 0, 0555, coda_table},
{0}
};
#ifdef CONFIG_PROC_FS
/*
target directory structure:
/proc/fs (see linux/fs/proc/root.c)
/proc/fs/coda
/proc/fs/coda/{vfs_stats,
*/
static struct proc_dir_entry* proc_fs_coda;
#endif
#define coda_proc_create(name,get_info) \
create_proc_info_entry(name, 0, proc_fs_coda, get_info)
void coda_sysctl_init(void)
{
reset_coda_vfs_stats();
reset_coda_cache_inv_stats();
#ifdef CONFIG_PROC_FS
proc_fs_coda = proc_mkdir("coda", proc_root_fs);
if (proc_fs_coda) {
proc_fs_coda->owner = THIS_MODULE;
coda_proc_create("vfs_stats", coda_vfs_stats_get_info);
coda_proc_create("cache_inv_stats", coda_cache_inv_stats_get_info);
}
#endif
#ifdef CONFIG_SYSCTL
if ( !fs_table_header )
fs_table_header = register_sysctl_table(fs_table, 0);
#endif
}
void coda_sysctl_clean(void)
{
#ifdef CONFIG_SYSCTL
if ( fs_table_header ) {
unregister_sysctl_table(fs_table_header);
fs_table_header = NULL;
}
#endif
#ifdef CONFIG_PROC_FS
remove_proc_entry("cache_inv_stats", proc_fs_coda);
remove_proc_entry("vfs_stats", proc_fs_coda);
remove_proc_entry("coda", proc_root_fs);
#endif
}
|
#ifndef __MAC80211_DEBUGFS_H
#define __MAC80211_DEBUGFS_H
#ifdef CONFIG_MAC80211_DEBUGFS
extern void debugfs_hw_add(struct ieee80211_local *local);
//HTC_WIFI_START
//HTC_WIFI_OFFLOAD+
extern void debugfs_hw_remove();
//HTC_WIFI_OFFLOAD-
//HTC_WIFI_END
extern int mac80211_open_file_generic(struct inode *inode, struct file *file);
extern int mac80211_format_buffer(char __user *userbuf, size_t count,
loff_t *ppos, char *fmt, ...);
#else
static inline void debugfs_hw_add(struct ieee80211_local *local)
{
}
#endif
#endif /* __MAC80211_DEBUGFS_H */
|
/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _ALIASES_H
#define _ALIASES_H 1
#include <features.h>
#include <sys/types.h>
__BEGIN_DECLS
/* Structure to represent one entry of the alias data base. */
struct aliasent
{
char *alias_name;
size_t alias_members_len;
char **alias_members;
int alias_local;
};
/* Open alias data base files. */
extern void setaliasent (void) __THROW;
/* Close alias data base files. */
extern void endaliasent (void) __THROW;
/* Get the next entry from the alias data base. */
extern struct aliasent *getaliasent (void) __THROW;
/* Get the next entry from the alias data base and put it in RESULT_BUF. */
extern int getaliasent_r (struct aliasent *__restrict __result_buf,
char *__restrict __buffer, size_t __buflen,
struct aliasent **__restrict __result) __THROW;
/* Get alias entry corresponding to NAME. */
extern struct aliasent *getaliasbyname (const char *__name) __THROW;
/* Get alias entry corresponding to NAME and put it in RESULT_BUF. */
extern int getaliasbyname_r (const char *__restrict __name,
struct aliasent *__restrict __result_buf,
char *__restrict __buffer, size_t __buflen,
struct aliasent **__restrict __result) __THROW;
__END_DECLS
#endif /* aliases.h */
|
/*
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
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.
----------------------------------------------------------------------
*/
/** @file Defines a post processing step to calculate tangents and
bitangents on all imported meshes.*/
#ifndef AI_CALCTANGENTSPROCESS_H_INC
#define AI_CALCTANGENTSPROCESS_H_INC
#include "BaseProcess.h"
struct aiMesh;
namespace Assimp
{
// ---------------------------------------------------------------------------
/** The CalcTangentsProcess calculates the tangent and bitangent for any vertex
* of all meshes. It is expected to be run before the JoinVerticesProcess runs
* because the joining of vertices also considers tangents and bitangents for
* uniqueness.
*/
class ASSIMP_API_WINONLY CalcTangentsProcess : public BaseProcess
{
public:
CalcTangentsProcess();
~CalcTangentsProcess();
public:
// -------------------------------------------------------------------
/** Returns whether the processing step is present in the given flag.
* @param pFlags The processing flags the importer was called with.
* A bitwise combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields,
* false if not.
*/
bool IsActive( unsigned int pFlags) const;
// -------------------------------------------------------------------
/** Called prior to ExecuteOnScene().
* The function is a request to the process to update its configuration
* basing on the Importer's configuration property list.
*/
void SetupProperties(const Importer* pImp);
// setter for configMaxAngle
inline void SetMaxSmoothAngle(float f)
{
configMaxAngle =f;
}
protected:
// -------------------------------------------------------------------
/** Calculates tangents and bitangents for a specific mesh.
* @param pMesh The mesh to process.
* @param meshIndex Index of the mesh
*/
bool ProcessMesh( aiMesh* pMesh, unsigned int meshIndex);
// -------------------------------------------------------------------
/** Executes the post processing step on the given imported data.
* @param pScene The imported data to work at.
*/
void Execute( aiScene* pScene);
private:
/** Configuration option: maximum smoothing angle, in radians*/
float configMaxAngle;
unsigned int configSourceUV;
};
} // end of namespace Assimp
#endif // AI_CALCTANGENTSPROCESS_H_INC
|
/* Copyright (c) 2012 Josh Triplett <josh@joshtriplett.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#pragma once
#include <byteswap.h>
#include <endian.h>
#include <stdint.h>
#ifdef __CHECKER__
#define __bitwise __attribute__((bitwise))
#define __force __attribute__((force))
#else
#define __bitwise
#define __force
#endif
typedef uint16_t __bitwise le16_t;
typedef uint16_t __bitwise be16_t;
typedef uint32_t __bitwise le32_t;
typedef uint32_t __bitwise be32_t;
typedef uint64_t __bitwise le64_t;
typedef uint64_t __bitwise be64_t;
#undef htobe16
#undef htole16
#undef be16toh
#undef le16toh
#undef htobe32
#undef htole32
#undef be32toh
#undef le32toh
#undef htobe64
#undef htole64
#undef be64toh
#undef le64toh
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define bswap_16_on_le(x) __bswap_16(x)
#define bswap_32_on_le(x) __bswap_32(x)
#define bswap_64_on_le(x) __bswap_64(x)
#define bswap_16_on_be(x) (x)
#define bswap_32_on_be(x) (x)
#define bswap_64_on_be(x) (x)
#elif __BYTE_ORDER == __BIG_ENDIAN
#define bswap_16_on_le(x) (x)
#define bswap_32_on_le(x) (x)
#define bswap_64_on_le(x) (x)
#define bswap_16_on_be(x) __bswap_16(x)
#define bswap_32_on_be(x) __bswap_32(x)
#define bswap_64_on_be(x) __bswap_64(x)
#endif
static inline le16_t htole16(uint16_t value) { return (le16_t __force) bswap_16_on_be(value); }
static inline le32_t htole32(uint32_t value) { return (le32_t __force) bswap_32_on_be(value); }
static inline le64_t htole64(uint64_t value) { return (le64_t __force) bswap_64_on_be(value); }
static inline be16_t htobe16(uint16_t value) { return (be16_t __force) bswap_16_on_le(value); }
static inline be32_t htobe32(uint32_t value) { return (be32_t __force) bswap_32_on_le(value); }
static inline be64_t htobe64(uint64_t value) { return (be64_t __force) bswap_64_on_le(value); }
static inline uint16_t le16toh(le16_t value) { return bswap_16_on_be((uint16_t __force)value); }
static inline uint32_t le32toh(le32_t value) { return bswap_32_on_be((uint32_t __force)value); }
static inline uint64_t le64toh(le64_t value) { return bswap_64_on_be((uint64_t __force)value); }
static inline uint16_t be16toh(be16_t value) { return bswap_16_on_le((uint16_t __force)value); }
static inline uint32_t be32toh(be32_t value) { return bswap_32_on_le((uint32_t __force)value); }
static inline uint64_t be64toh(be64_t value) { return bswap_64_on_le((uint64_t __force)value); }
|
/*
From SVG-DOM, via Core DOM:
http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1728279322
interface Comment : CharacterData {
};
*/
#import <Foundation/Foundation.h>
#import "CharacterData.h"
@interface Comment : CharacterData
- (id)initWithValue:(NSString*) v;
@end
|
/****************************************************************************
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CC_FRAMEWORK_COMCONTAINER_H__
#define __CC_FRAMEWORK_COMCONTAINER_H__
#include "CCMap.h"
#include <string>
NS_CC_BEGIN
class Component;
class Node;
class CC_DLL ComponentContainer
{
protected:
/**
* @js ctor
*/
ComponentContainer(Node *pNode);
public:
/**
* @js NA
* @lua NA
*/
virtual ~ComponentContainer(void);
virtual Component* get(const std::string& name) const;
virtual bool add(Component *com);
virtual bool remove(const std::string& name);
virtual void removeAll();
virtual void visit(float delta);
public:
bool isEmpty() const;
private:
void alloc(void);
private:
Map<std::string, Component*>* _components;
Node *_owner;
friend class Node;
};
NS_CC_END
#endif // __FUNDATION__CCCOMPONENT_H__
|
/*
* libjingle
* Copyright 2011, Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef TALK_APP_WEBRTC_MEDIASTREAMTRACK_H_
#define TALK_APP_WEBRTC_MEDIASTREAMTRACK_H_
#include <string>
#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/app/webrtc/notifier.h"
namespace webrtc {
// MediaTrack implements the interface common to AudioTrackInterface and
// VideoTrackInterface.
template <typename T>
class MediaStreamTrack : public Notifier<T> {
public:
typedef typename T::TrackState TypedTrackState;
virtual std::string id() const { return id_; }
virtual MediaStreamTrackInterface::TrackState state() const {
return state_;
}
virtual bool enabled() const { return enabled_; }
virtual bool set_enabled(bool enable) {
bool fire_on_change = (enable != enabled_);
enabled_ = enable;
if (fire_on_change) {
Notifier<T>::FireOnChanged();
}
return fire_on_change;
}
virtual bool set_state(MediaStreamTrackInterface::TrackState new_state) {
bool fire_on_change = (state_ != new_state);
state_ = new_state;
if (fire_on_change)
Notifier<T>::FireOnChanged();
return true;
}
protected:
explicit MediaStreamTrack(const std::string& id)
: enabled_(true),
id_(id),
state_(MediaStreamTrackInterface::kInitializing) {
}
private:
bool enabled_;
std::string id_;
MediaStreamTrackInterface::TrackState state_;
};
} // namespace webrtc
#endif // TALK_APP_WEBRTC_MEDIASTREAMTRACK_H_
|
/***************************************************************************/
/* */
/* tttags.h */
/* */
/* Tags for TrueType and OpenType tables (specification only). */
/* */
/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef TTAGS_H_
#define TTAGS_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
#define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' )
#define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' )
#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' )
#define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' )
#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
#define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
#define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
#define TTAG_CFF2 FT_MAKE_TAG( 'C', 'F', 'F', '2' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' )
#define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' )
#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' )
#define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' )
#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' )
#define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' )
#define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' )
#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
#define TTAG_HVAR FT_MAKE_TAG( 'H', 'V', 'A', 'R' )
#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' )
#define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' )
#define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' )
#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' )
#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' )
#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
#define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' )
#define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' )
#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
#define TTAG_MVAR FT_MAKE_TAG( 'M', 'V', 'A', 'R' )
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' )
#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' )
#define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' )
#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' )
#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' )
#define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' )
#define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' )
#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
#define TTAG_VVAR FT_MAKE_TAG( 'V', 'V', 'A', 'R' )
#define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
/* used by "Keyboard.dfont" on legacy Mac OS X */
#define TTAG_0xA5kbd FT_MAKE_TAG( 0xA5, 'k', 'b', 'd' )
/* used by "LastResort.dfont" on legacy Mac OS X */
#define TTAG_0xA5lst FT_MAKE_TAG( 0xA5, 'l', 's', 't' )
FT_END_HEADER
#endif /* TTAGS_H_ */
/* END */
|
/*
* asid.h: handling ASIDs in SVM.
* Copyright (c) 2007, Advanced Micro Devices, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place - Suite 330, Boston, MA 02111-1307 USA.
*/
#ifndef __ASM_X86_HVM_SVM_ASID_H__
#define __ASM_X86_HVM_SVM_ASID_H__
#include <xen/config.h>
#include <xen/types.h>
#include <asm/hvm/asid.h>
#include <asm/processor.h>
void svm_asid_init(struct cpuinfo_x86 *c);
static inline void svm_asid_g_invlpg(struct vcpu *v, unsigned long g_vaddr)
{
#if 0
/* Optimization? */
svm_invlpga(g_vaddr, v->arch.hvm_svm.vmcb->guest_asid);
#endif
/* Safe fallback. Take a new ASID. */
hvm_asid_flush_vcpu(v);
}
#endif /* __ASM_X86_HVM_SVM_ASID_H__ */
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/
|
/*
* Off-channel operation helpers
*
* Copyright 2003, Jouni Malinen <jkmaline@cc.hut.fi>
* Copyright 2004, Instant802 Networks, Inc.
* Copyright 2005, Devicescape Software, Inc.
* Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
* Copyright 2007, Michael Wu <flamingice@sourmilk.net>
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
*
* 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 <net/mac80211.h>
#include "ieee80211_i.h"
/*
* inform AP that we will go to sleep so that it will buffer the frames
* while we scan
*/
static void ieee80211_offchannel_ps_enable(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_local *local = sdata->local;
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
local->offchannel_ps_enabled = false;
del_timer_sync(&local->dynamic_ps_timer);
del_timer_sync(&ifmgd->bcn_mon_timer);
del_timer_sync(&ifmgd->conn_mon_timer);
cancel_work_sync(&local->dynamic_ps_enable_work);
if (local->hw.conf.flags & IEEE80211_CONF_PS) {
local->offchannel_ps_enabled = true;
local->hw.conf.flags &= ~IEEE80211_CONF_PS;
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
}
if (!(local->offchannel_ps_enabled) ||
!(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK))
/*
* If power save was enabled, no need to send a nullfunc
* frame because AP knows that we are sleeping. But if the
* hardware is creating the nullfunc frame for power save
* status (ie. IEEE80211_HW_PS_NULLFUNC_STACK is not
* enabled) and power save was enabled, the firmware just
* sent a null frame with power save disabled. So we need
* to send a new nullfunc frame to inform the AP that we
* are again sleeping.
*/
ieee80211_send_nullfunc(local, sdata, 1);
}
/* inform AP that we are awake again, unless power save is enabled */
static void ieee80211_offchannel_ps_disable(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_local *local = sdata->local;
if (!local->ps_sdata)
ieee80211_send_nullfunc(local, sdata, 0);
else if (local->offchannel_ps_enabled) {
/*
* In !IEEE80211_HW_PS_NULLFUNC_STACK case the hardware
* will send a nullfunc frame with the powersave bit set
* even though the AP already knows that we are sleeping.
* This could be avoided by sending a null frame with power
* save bit disabled before enabling the power save, but
* this doesn't gain anything.
*
* When IEEE80211_HW_PS_NULLFUNC_STACK is enabled, no need
* to send a nullfunc frame because AP already knows that
* we are sleeping, let's just enable power save mode in
* hardware.
*/
local->hw.conf.flags |= IEEE80211_CONF_PS;
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
} else if (local->hw.conf.dynamic_ps_timeout > 0) {
/*
* If IEEE80211_CONF_PS was not set and the dynamic_ps_timer
* had been running before leaving the operating channel,
* restart the timer now and send a nullfunc frame to inform
* the AP that we are awake.
*/
ieee80211_send_nullfunc(local, sdata, 0);
mod_timer(&local->dynamic_ps_timer, jiffies +
msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
}
ieee80211_sta_reset_beacon_monitor(sdata);
ieee80211_sta_reset_conn_monitor(sdata);
}
void ieee80211_offchannel_stop_beaconing(struct ieee80211_local *local)
{
struct ieee80211_sub_if_data *sdata;
mutex_lock(&local->iflist_mtx);
list_for_each_entry(sdata, &local->interfaces, list) {
if (!ieee80211_sdata_running(sdata))
continue;
/* disable beaconing */
if (sdata->vif.type == NL80211_IFTYPE_AP ||
sdata->vif.type == NL80211_IFTYPE_ADHOC ||
sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
ieee80211_bss_info_change_notify(
sdata, BSS_CHANGED_BEACON_ENABLED);
/*
* only handle non-STA interfaces here, STA interfaces
* are handled in ieee80211_offchannel_stop_station(),
* e.g., from the background scan state machine.
*
* In addition, do not stop monitor interface to allow it to be
* used from user space controlled off-channel operations.
*/
if (sdata->vif.type != NL80211_IFTYPE_STATION &&
sdata->vif.type != NL80211_IFTYPE_MONITOR)
netif_tx_stop_all_queues(sdata->dev);
}
mutex_unlock(&local->iflist_mtx);
}
void ieee80211_offchannel_stop_station(struct ieee80211_local *local)
{
struct ieee80211_sub_if_data *sdata;
/*
* notify the AP about us leaving the channel and stop all STA interfaces
*/
mutex_lock(&local->iflist_mtx);
list_for_each_entry(sdata, &local->interfaces, list) {
if (!ieee80211_sdata_running(sdata))
continue;
if (sdata->vif.type == NL80211_IFTYPE_STATION) {
netif_tx_stop_all_queues(sdata->dev);
if (sdata->u.mgd.associated)
ieee80211_offchannel_ps_enable(sdata);
}
}
mutex_unlock(&local->iflist_mtx);
}
void ieee80211_offchannel_return(struct ieee80211_local *local,
bool enable_beaconing)
{
struct ieee80211_sub_if_data *sdata;
mutex_lock(&local->iflist_mtx);
list_for_each_entry(sdata, &local->interfaces, list) {
if (!ieee80211_sdata_running(sdata))
continue;
/* Tell AP we're back */
if (sdata->vif.type == NL80211_IFTYPE_STATION) {
if (sdata->u.mgd.associated)
ieee80211_offchannel_ps_disable(sdata);
}
if (sdata->vif.type != NL80211_IFTYPE_MONITOR)
netif_tx_wake_all_queues(sdata->dev);
/* re-enable beaconing */
if (enable_beaconing &&
(sdata->vif.type == NL80211_IFTYPE_AP ||
sdata->vif.type == NL80211_IFTYPE_ADHOC ||
sdata->vif.type == NL80211_IFTYPE_MESH_POINT))
ieee80211_bss_info_change_notify(
sdata, BSS_CHANGED_BEACON_ENABLED);
}
mutex_unlock(&local->iflist_mtx);
}
|
#include <gsl/gsl_math.h>
#include <gsl/gsl_cblas.h>
#include "cblas.h"
#include "error_cblas_l2.h"
void
cblas_zhemv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
const int N, const void *alpha, const void *A, const int lda,
const void *X, const int incX, const void *beta, void *Y,
const int incY)
{
#define BASE double
#include "source_hemv.h"
#undef BASE
}
|
/* $Id$ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __PJMEDIA_AUDIODEV_AUDIOTEST_H__
#define __PJMEDIA_AUDIODEV_AUDIOTEST_H__
/**
* @file audiotest.h
* @brief Audio test utility.
*/
#include <pjmedia-audiodev/audiodev.h>
PJ_BEGIN_DECL
/**
* @defgroup s30_audio_test_utility Audio tests utility.
* @ingroup audio_device_api
* @brief Audio test utility.
* @{
*/
/**
* Statistic for each direction.
*/
typedef struct pjmedia_aud_test_stat
{
/**
* Number of frames processed during the test.
*/
unsigned frame_cnt;
/**
* Minimum inter-frame arrival time, in milliseconds
*/
unsigned min_interval;
/**
* Maximum inter-frame arrival time, in milliseconds
*/
unsigned max_interval;
/**
* Average inter-frame arrival time, in milliseconds
*/
unsigned avg_interval;
/**
* Standard deviation of inter-frame arrival time, in milliseconds
*/
unsigned dev_interval;
/**
* Maximum number of frame burst
*/
unsigned max_burst;
} pjmedia_aud_test_stat;
/**
* Test results.
*/
typedef struct pjmedia_aud_test_results
{
/**
* Recording statistic.
*/
pjmedia_aud_test_stat rec;
/**
* Playback statistic.
*/
pjmedia_aud_test_stat play;
/**
* Clock drifts per second, in samples. Positive number indicates rec
* device is running faster than playback device.
*/
pj_int32_t rec_drift_per_sec;
} pjmedia_aud_test_results;
/**
* Perform audio device testing.
*/
PJ_DECL(pj_status_t) pjmedia_aud_test(const pjmedia_aud_param *param,
pjmedia_aud_test_results *result);
/**
* @}
*/
PJ_END_DECL
#endif /* __PJMEDIA_AUDIODEV_AUDIOTEST_H__ */
|
/* 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 __SDIO_CMUX__
#define __SDIO_CMUX__
#ifdef CONFIG_MSM_SDIO_CMUX
enum {
SDIO_CMUX_DATA_CTL_0,
SDIO_CMUX_DATA_CTL_1,
SDIO_CMUX_DATA_CTL_2,
SDIO_CMUX_DATA_CTL_3,
SDIO_CMUX_DATA_CTL_4,
SDIO_CMUX_DATA_CTL_5,
SDIO_CMUX_DATA_CTL_6,
SDIO_CMUX_DATA_CTL_7,
SDIO_CMUX_USB_CTL_0,
SDIO_CMUX_USB_DUN_CTL_0,
SDIO_CMUX_CSVT_CTL_0,
SDIO_CMUX_NUM_CHANNELS
};
/*
* sdio_cmux_open - Open the mux channel
*
* @id: Mux Channel id to be opened
* @receive_cb: Notification when data arrives. Parameters are data received,
* size of data, private context pointer.
* @write_done: Notification when data is written. Parameters are data written,
* size of data, private context pointer. Please note that the data
* written pointer will always be NULL as the cmux makes an internal copy
* of the data.
* @priv: caller's private context pointer
*/
int sdio_cmux_open(const int id,
void (*receive_cb)(void *, int, void *),
void (*write_done)(void *, int, void *),
void (*status_callback)(int, void *),
void *priv);
int sdio_cmux_close(int id);
int sdio_cmux_write_avail(int id);
/*
* sdio_cmux_write - Write the data onto the CMUX channel
*
* @id: Channel id onto which the data has to be written
* @data: Starting address of the data buffer to be written
* @len: Length of the data to be written
*/
int sdio_cmux_write(int id, void *data, int len);
int sdio_cmux_tiocmget(int id);
int sdio_cmux_tiocmset(int id, unsigned int set, unsigned int clear);
int is_remote_open(int id);
int sdio_cmux_is_channel_reset(int id);
#else
static int __maybe_unused sdio_cmux_open(const int id,
void (*receive_cb)(void *, int, void *),
void (*write_done)(void *, int, void *),
void (*status_callback)(int, void *),
void *priv)
{
return -ENODEV;
}
static int __maybe_unused sdio_cmux_close(int id)
{
return -ENODEV;
}
static int __maybe_unused sdio_cmux_write_avail(int id)
{
return -ENODEV;
}
static int __maybe_unused sdio_cmux_write(int id, void *data, int len)
{
return -ENODEV;
}
static int __maybe_unused sdio_cmux_tiocmget(int id)
{
return -ENODEV;
}
static int __maybe_unused sdio_cmux_tiocmset(int id, unsigned int set,
unsigned int clear)
{
return -ENODEV;
}
static int __maybe_unused is_remote_open(int id)
{
return -ENODEV;
}
static int __maybe_unused sdio_cmux_is_channel_reset(int id)
{
return -ENODEV;
}
#endif
#endif
|
/*
* Copyright 2012 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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: Ben Skeggs
*/
#include <core/gpuobj.h>
#include <subdev/timer.h>
#include <subdev/fb.h>
#include <subdev/vm.h>
#include "priv.h"
struct nvc0_bar_priv {
struct nouveau_bar base;
spinlock_t lock;
struct {
struct nouveau_gpuobj *mem;
struct nouveau_gpuobj *pgd;
struct nouveau_vm *vm;
} bar[2];
};
static int
nvc0_bar_kmap(struct nouveau_bar *bar, struct nouveau_mem *mem,
u32 flags, struct nouveau_vma *vma)
{
struct nvc0_bar_priv *priv = (void *)bar;
int ret;
ret = nouveau_vm_get(priv->bar[0].vm, mem->size << 12, 12, flags, vma);
if (ret)
return ret;
nouveau_vm_map(vma, mem);
return 0;
}
static int
nvc0_bar_umap(struct nouveau_bar *bar, struct nouveau_mem *mem,
u32 flags, struct nouveau_vma *vma)
{
struct nvc0_bar_priv *priv = (void *)bar;
int ret;
ret = nouveau_vm_get(priv->bar[1].vm, mem->size << 12,
mem->page_shift, flags, vma);
if (ret)
return ret;
nouveau_vm_map(vma, mem);
return 0;
}
static void
nvc0_bar_unmap(struct nouveau_bar *bar, struct nouveau_vma *vma)
{
nouveau_vm_unmap(vma);
nouveau_vm_put(vma);
}
static int
nvc0_bar_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject)
{
struct nouveau_device *device = nv_device(parent);
struct nvc0_bar_priv *priv;
struct nouveau_gpuobj *mem;
struct nouveau_vm *vm;
int ret;
ret = nouveau_bar_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
/* BAR3 */
ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x1000, 0, 0,
&priv->bar[0].mem);
mem = priv->bar[0].mem;
if (ret)
return ret;
ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x8000, 0, 0,
&priv->bar[0].pgd);
if (ret)
return ret;
ret = nouveau_vm_new(device, 0, nv_device_resource_len(device, 3), 0, &vm);
if (ret)
return ret;
atomic_inc(&vm->engref[NVDEV_SUBDEV_BAR]);
ret = nouveau_gpuobj_new(nv_object(priv), NULL,
(nv_device_resource_len(device, 3) >> 12) * 8,
0x1000, NVOBJ_FLAG_ZERO_ALLOC,
&vm->pgt[0].obj[0]);
vm->pgt[0].refcount[0] = 1;
if (ret)
return ret;
ret = nouveau_vm_ref(vm, &priv->bar[0].vm, priv->bar[0].pgd);
nouveau_vm_ref(NULL, &vm, NULL);
if (ret)
return ret;
nv_wo32(mem, 0x0200, lower_32_bits(priv->bar[0].pgd->addr));
nv_wo32(mem, 0x0204, upper_32_bits(priv->bar[0].pgd->addr));
nv_wo32(mem, 0x0208, lower_32_bits(nv_device_resource_len(device, 3) - 1));
nv_wo32(mem, 0x020c, upper_32_bits(nv_device_resource_len(device, 3) - 1));
/* BAR1 */
ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x1000, 0, 0,
&priv->bar[1].mem);
mem = priv->bar[1].mem;
if (ret)
return ret;
ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x8000, 0, 0,
&priv->bar[1].pgd);
if (ret)
return ret;
ret = nouveau_vm_new(device, 0, nv_device_resource_len(device, 1), 0, &vm);
if (ret)
return ret;
atomic_inc(&vm->engref[NVDEV_SUBDEV_BAR]);
ret = nouveau_vm_ref(vm, &priv->bar[1].vm, priv->bar[1].pgd);
nouveau_vm_ref(NULL, &vm, NULL);
if (ret)
return ret;
nv_wo32(mem, 0x0200, lower_32_bits(priv->bar[1].pgd->addr));
nv_wo32(mem, 0x0204, upper_32_bits(priv->bar[1].pgd->addr));
nv_wo32(mem, 0x0208, lower_32_bits(nv_device_resource_len(device, 1) - 1));
nv_wo32(mem, 0x020c, upper_32_bits(nv_device_resource_len(device, 1) - 1));
priv->base.alloc = nouveau_bar_alloc;
priv->base.kmap = nvc0_bar_kmap;
priv->base.umap = nvc0_bar_umap;
priv->base.unmap = nvc0_bar_unmap;
priv->base.flush = nv84_bar_flush;
spin_lock_init(&priv->lock);
return 0;
}
static void
nvc0_bar_dtor(struct nouveau_object *object)
{
struct nvc0_bar_priv *priv = (void *)object;
nouveau_vm_ref(NULL, &priv->bar[1].vm, priv->bar[1].pgd);
nouveau_gpuobj_ref(NULL, &priv->bar[1].pgd);
nouveau_gpuobj_ref(NULL, &priv->bar[1].mem);
if (priv->bar[0].vm) {
nouveau_gpuobj_ref(NULL, &priv->bar[0].vm->pgt[0].obj[0]);
nouveau_vm_ref(NULL, &priv->bar[0].vm, priv->bar[0].pgd);
}
nouveau_gpuobj_ref(NULL, &priv->bar[0].pgd);
nouveau_gpuobj_ref(NULL, &priv->bar[0].mem);
nouveau_bar_destroy(&priv->base);
}
static int
nvc0_bar_init(struct nouveau_object *object)
{
struct nvc0_bar_priv *priv = (void *)object;
int ret;
ret = nouveau_bar_init(&priv->base);
if (ret)
return ret;
nv_mask(priv, 0x000200, 0x00000100, 0x00000000);
nv_mask(priv, 0x000200, 0x00000100, 0x00000100);
nv_mask(priv, 0x100c80, 0x00000001, 0x00000000);
nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12);
nv_wr32(priv, 0x001714, 0xc0000000 | priv->bar[0].mem->addr >> 12);
return 0;
}
struct nouveau_oclass
nvc0_bar_oclass = {
.handle = NV_SUBDEV(BAR, 0xc0),
.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nvc0_bar_ctor,
.dtor = nvc0_bar_dtor,
.init = nvc0_bar_init,
.fini = _nouveau_bar_fini,
},
};
|
#ifndef __CMDQ_DRIVER_H__
#define __CMDQ_DRIVER_H__
#include <linux/kernel.h>
#include "cmdq_def.h"
typedef struct cmdqUsageInfoStruct {
uint32_t count[CMDQ_MAX_ENGINE_COUNT]; /* [OUT] current engine ref count */
} cmdqUsageInfoStruct;
typedef struct cmdqJobStruct {
struct cmdqCommandStruct command; /* [IN] the job to perform */
cmdqJobHandle_t hJob; /* [OUT] handle to resulting job */
} cmdqJobStruct;
typedef struct cmdqJobResultStruct {
cmdqJobHandle_t hJob; /* [IN] Job handle from CMDQ_IOCTL_ASYNC_JOB_EXEC */
uint64_t engineFlag; /* [OUT] engine flag passed down originally */
/* [IN/OUT] read register values, if any. */
/* as input, the "count" field must represent */
/* buffer space pointed by "regValues". */
/* Upon return, CMDQ driver fills "count" with */
/* actual requested register count. */
/* However, if the input "count" is too small, */
/* -ENOMEM is returned, and "count" is filled */
/* with requested register count. */
cmdqRegValueStruct regValue;
cmdqReadAddressStruct readAddress; /* [IN/OUT] physical address to read */
} cmdqJobResultStruct;
typedef struct cmdqWriteAddressStruct {
/* [IN] count of the writable buffer (unit is # of uint32_t, NOT in byte) */
uint32_t count;
/* [OUT] When Alloc, this is the resulting PA. It is guaranteed to be continuous. */
/* [IN] When Free, please pass returned address down to ioctl. */
/* */
/* indeed param startPA should be UNSIGNED LONG type for 64 bit kernel.*/
/* Considering our plartform supports max 4GB RAM(upper-32bit don't care for SW)*/
/* and consistent common code interface, remain uint32_t type.*/
uint32_t startPA;
} cmdqWriteAddressStruct;
#define CMDQ_IOCTL_MAGIC_NUMBER 'x'
#define CMDQ_IOCTL_LOCK_MUTEX _IOW(CMDQ_IOCTL_MAGIC_NUMBER, 1, int)
#define CMDQ_IOCTL_UNLOCK_MUTEX _IOR(CMDQ_IOCTL_MAGIC_NUMBER, 2, int)
#define CMDQ_IOCTL_EXEC_COMMAND _IOW(CMDQ_IOCTL_MAGIC_NUMBER, 3, cmdqCommandStruct)
#define CMDQ_IOCTL_QUERY_USAGE _IOW(CMDQ_IOCTL_MAGIC_NUMBER, 4, cmdqUsageInfoStruct)
/* */
/* Async operations */
/* */
#define CMDQ_IOCTL_ASYNC_JOB_EXEC _IOW(CMDQ_IOCTL_MAGIC_NUMBER, 5, cmdqJobStruct)
#define CMDQ_IOCTL_ASYNC_JOB_WAIT_AND_CLOSE _IOR(CMDQ_IOCTL_MAGIC_NUMBER, 6, cmdqJobResultStruct)
#define CMDQ_IOCTL_ALLOC_WRITE_ADDRESS _IOW(CMDQ_IOCTL_MAGIC_NUMBER, 7, cmdqWriteAddressStruct)
#define CMDQ_IOCTL_FREE_WRITE_ADDRESS _IOW(CMDQ_IOCTL_MAGIC_NUMBER, 8, cmdqWriteAddressStruct)
#define CMDQ_IOCTL_READ_ADDRESS_VALUE _IOW(CMDQ_IOCTL_MAGIC_NUMBER, 9, cmdqReadAddressStruct)
/* */
/* Chip capability query. output parameter is a bit field. */
/* Bit definition is CMDQ_CAP_BITS. */
/* */
#define CMDQ_IOCTL_QUERY_CAP_BITS _IOW(CMDQ_IOCTL_MAGIC_NUMBER, 10, int)
#endif /* __CMDQ_DRIVER_H__ */
|
/*
** Copyright (C) 2007-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
** the Free Software Foundation; either version 2.1 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "sfconfig.h"
#include <stdio.h>
#include <stdlib.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include <errno.h>
#include "common.h"
#include "sfendian.h"
#include "test_main.h"
static unsigned char float_le_mono [] =
{ 0x36, 0x86, 0x21, 0x44, 0xB5, 0xB4, 0x49, 0x44, 0xA2, 0xC0, 0x71, 0x44, 0x7B, 0xD1, 0x8C, 0x44,
0x54, 0xAA, 0xA0, 0x44, 0x60, 0x67, 0xB4, 0x44, 0x22, 0x05, 0xC8, 0x44, 0x29, 0x80, 0xDB, 0x44,
0x04, 0xD5, 0xEE, 0x44, 0x27, 0x00, 0x01, 0x45, 0x50, 0x7F, 0x0A, 0x45, 0x53, 0xE6, 0x13, 0x45,
0x85, 0x33, 0x1D, 0x45, 0x43, 0x65, 0x26, 0x45, 0xEC, 0x79, 0x2F, 0x45, 0xE3, 0x6F, 0x38, 0x45,
0x98, 0x45, 0x41, 0x45, 0x77, 0xF9, 0x49, 0x45, 0xF6, 0x89, 0x52, 0x45, 0x8F, 0xF5, 0x5A, 0x45,
0xC9, 0x3A, 0x63, 0x45, 0x28, 0x58, 0x6B, 0x45, 0x3C, 0x4C, 0x73, 0x45, 0x9F, 0x15, 0x7B, 0x45,
0x75, 0x59, 0x81, 0x45, 0x64, 0x11, 0x85, 0x45, 0xF1, 0xB1, 0x88, 0x45, 0x78, 0x3A, 0x8C, 0x45,
0x58, 0xAA, 0x8F, 0x45, 0xF2, 0x00, 0x93, 0x45, 0xB2, 0x3D, 0x96, 0x45, 0x01, 0x60, 0x99, 0x45,
0x50, 0x67, 0x9C, 0x45, 0x15, 0x53, 0x9F, 0x45, 0xCC, 0x22, 0xA2, 0x45, 0xF0, 0xD5, 0xA4, 0x45,
0x07, 0x6C, 0xA7, 0x45, 0x9C, 0xE4, 0xA9, 0x45, 0x3D, 0x3F, 0xAC, 0x45, 0x7A, 0x7B, 0xAE, 0x45,
0xF2, 0x98, 0xB0, 0x45, 0x3C, 0x97, 0xB2, 0x45, 0x02, 0x76, 0xB4, 0x45, 0xEC, 0x34, 0xB6, 0x45,
0xA8, 0xD3, 0xB7, 0x45, 0xEB, 0x51, 0xB9, 0x45, 0x6F, 0xAF, 0xBA, 0x45, 0xF5, 0xEB, 0xBB, 0x45,
0x41, 0x07, 0xBD, 0x45, 0x21, 0x01, 0xBE, 0x45, 0x64, 0xD9, 0xBE, 0x45, 0xE3, 0x8F, 0xBF, 0x45,
0x7E, 0x24, 0xC0, 0x45, 0x15, 0x97, 0xC0, 0x45, 0x92, 0xE7, 0xC0, 0x45, 0xE8, 0x15, 0xC1, 0x45,
0x7E, 0x24, 0xC0, 0x45, 0x15, 0x97, 0xC0, 0x45, 0x92, 0xE7, 0xC0, 0x45, 0xE8, 0x15, 0xC1, 0x45,
0x7E, 0x24, 0xC0, 0x45, 0x15, 0x97, 0xC0, 0x45, 0x92, 0xE7, 0xC0, 0x45, 0xE8, 0x15, 0xC1, 0x45,
} ;
static unsigned char int24_32_le_stereo [] =
{
0x00, 0xE7, 0xFB, 0xFF, 0x00, 0x7C, 0xFD, 0xFF, 0x00, 0xA2, 0xFC, 0xFF, 0x00, 0x2B, 0xFC, 0xFF,
0x00, 0xF3, 0xFD, 0xFF, 0x00, 0x19, 0xFB, 0xFF, 0x00, 0xA5, 0xFE, 0xFF, 0x00, 0x8D, 0xFA, 0xFF,
0x00, 0x91, 0xFF, 0xFF, 0x00, 0xB5, 0xFA, 0xFF, 0x00, 0x91, 0x00, 0x00, 0x00, 0x5E, 0xFB, 0xFF,
0x00, 0xD9, 0x01, 0x00, 0x00, 0x82, 0xFB, 0xFF, 0x00, 0xDF, 0x03, 0x00, 0x00, 0x44, 0xFC, 0xFF,
0x00, 0x1C, 0x05, 0x00, 0x00, 0x77, 0xFC, 0xFF, 0x00, 0x8D, 0x06, 0x00, 0x00, 0x4F, 0xFC, 0xFF,
0x00, 0x84, 0x07, 0x00, 0x00, 0x74, 0xFC, 0xFF, 0x00, 0x98, 0x08, 0x00, 0x00, 0x33, 0xFD, 0xFF,
0x00, 0xB9, 0x09, 0x00, 0x00, 0x48, 0xFF, 0xFF, 0x00, 0xD1, 0x0A, 0x00, 0x00, 0x10, 0x02, 0x00,
0x00, 0x28, 0x0C, 0x00, 0x00, 0xA2, 0x05, 0x00, 0x00, 0xA7, 0x0C, 0x00, 0x00, 0x45, 0x08, 0x00,
0x00, 0x44, 0x0D, 0x00, 0x00, 0x1A, 0x0A, 0x00, 0x00, 0x65, 0x0D, 0x00, 0x00, 0x51, 0x0B, 0x00,
0x00, 0x8B, 0x0D, 0x00, 0x00, 0x18, 0x0B, 0x00, 0x00, 0x37, 0x0E, 0x00, 0x00, 0x24, 0x0B, 0x00,
0x00, 0x00, 0x0F, 0x00, 0x00, 0xDD, 0x0A, 0x00, 0x00, 0x83, 0x10, 0x00, 0x00, 0x31, 0x0A, 0x00,
0x00, 0x07, 0x12, 0x00, 0x00, 0xC0, 0x08, 0x00, 0x00, 0xF7, 0x12, 0x00, 0x00, 0x47, 0x06, 0x00,
0x00, 0xDD, 0x12, 0x00, 0x00, 0x6A, 0x03, 0x00, 0x00, 0xD5, 0x11, 0x00, 0x00, 0x99, 0x00, 0x00,
0x00, 0x01, 0x10, 0x00, 0x00, 0xC5, 0xFE, 0xFF, 0x00, 0xF4, 0x0D, 0x00, 0x00, 0x97, 0xFD, 0xFF,
0x00, 0x62, 0x0B, 0x00, 0x00, 0x75, 0xFC, 0xFF, 0x00, 0xE9, 0x08, 0x00, 0x00, 0xC0, 0xFB, 0xFF,
0x00, 0x80, 0x06, 0x00, 0x00, 0x3C, 0xFB, 0xFF, 0x00, 0xDA, 0x03, 0x00, 0x00, 0xE4, 0xFA, 0xFF,
0x00, 0xEB, 0x01, 0x00, 0x00, 0x21, 0xFB, 0xFF, 0x00, 0x20, 0x00, 0x00, 0x00, 0xE7, 0xFB, 0xFF,
} ;
void
test_audio_detect (void)
{
SF_PRIVATE psf ;
AUDIO_DETECT ad ;
int errors = 0 ;
print_test_name ("Testing audio detect") ;
memset (&psf, 0, sizeof (psf)) ;
ad.endianness = SF_ENDIAN_LITTLE ;
ad.channels = 1 ;
if (audio_detect (&psf, &ad, float_le_mono, sizeof (float_le_mono)) != SF_FORMAT_FLOAT)
{ puts (" float_le_mono") ;
errors ++ ;
} ;
ad.endianness = SF_ENDIAN_LITTLE ;
ad.channels = 2 ;
if (audio_detect (&psf, &ad, int24_32_le_stereo, sizeof (int24_32_le_stereo)) != SF_FORMAT_PCM_32)
{ if (errors == 0) puts ("\nFailed tests :\n") ;
puts (" int24_32_le_stereo") ;
errors ++ ;
} ;
if (errors != 0)
{ printf ("\n Errors : %d\n\n", errors) ;
exit (1) ;
} ;
puts ("ok") ;
return ;
} /* test_audio_detect */
|
/* mbed Microcontroller Library
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
#ifndef MBED_PERIPHERALNAMES_H
#define MBED_PERIPHERALNAMES_H
#include "cmsis.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
ADC_1 = (int)ADC1_BASE
} ADCName;
typedef enum {
DAC_1 = (int)DAC_BASE
} DACName;
typedef enum {
UART_1 = (int)USART1_BASE,
UART_2 = (int)USART2_BASE,
UART_3 = (int)USART3_BASE,
UART_4 = (int)USART4_BASE
} UARTName;
#define STDIO_UART_TX PA_2
#define STDIO_UART_RX PA_3
#define STDIO_UART UART_2
typedef enum {
SPI_1 = (int)SPI1_BASE,
SPI_2 = (int)SPI2_BASE
} SPIName;
typedef enum {
I2C_1 = (int)I2C1_BASE,
I2C_2 = (int)I2C2_BASE
} I2CName;
typedef enum {
PWM_1 = (int)TIM1_BASE,
PWM_2 = (int)TIM2_BASE,
PWM_3 = (int)TIM3_BASE,
PWM_14 = (int)TIM14_BASE,
PWM_15 = (int)TIM15_BASE,
PWM_16 = (int)TIM16_BASE,
PWM_17 = (int)TIM17_BASE
} PWMName;
typedef enum {
CAN_1 = (int)CAN_BASE
} CANName;
#ifdef __cplusplus
}
#endif
#endif
|
#include <winresrc.h>
|
/*
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include <dlfcn.h>
#include <stdlib.h>
#include <jvm.h>
#include "jvm_symbols.h"
JvmSymbols* lookupJvmSymbols() {
JvmSymbols* syms = (JvmSymbols*)malloc(sizeof(JvmSymbols));
if (syms != NULL) {
syms->GetVersion = (GetVersion_t)
dlsym(RTLD_DEFAULT, "JVM_DTraceGetVersion");
syms->IsSupported = (IsSupported_t)
dlsym(RTLD_DEFAULT, "JVM_DTraceIsSupported");
syms->Activate = (Activate_t)
dlsym(RTLD_DEFAULT, "JVM_DTraceActivate");
syms->Dispose = (Dispose_t)
dlsym(RTLD_DEFAULT, "JVM_DTraceDispose");
syms->IsProbeEnabled = (IsProbeEnabled_t)
dlsym(RTLD_DEFAULT, "JVM_DTraceIsProbeEnabled");
if ( syms->GetVersion == NULL || syms->Activate == NULL ||
syms->IsProbeEnabled == NULL || syms->Dispose == NULL ||
syms->IsSupported == NULL) {
free(syms);
syms = NULL;
}
}
return syms;
}
|
/* $XFree86$ */
#ifndef _XtShellInternal_h
#define _XtShellInternal_h
#include <X11/Xfuncproto.h>
_XFUNCPROTOBEGIN
extern void _XtShellGetCoordinates(Widget widget, Position *x, Position *y);
#endif /* _XtShellInternal_h */
|
/* Copyright 2019 coseyfannitutti
*
* 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 "discipad.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 UI_WM_PUBLIC_DRAG_DROP_CLIENT_H_
#define UI_WM_PUBLIC_DRAG_DROP_CLIENT_H_
#include "ui/aura/aura_export.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/gfx/native_widget_types.h"
namespace gfx {
class Point;
}
namespace ui {
class LocatedEvent;
class OSExchangeData;
}
namespace aura {
class Window;
namespace client {
// An interface implemented by an object that controls a drag and drop session.
class AURA_EXPORT DragDropClient {
public:
virtual ~DragDropClient() {}
// Initiates a drag and drop session. Returns the drag operation that was
// applied at the end of the drag drop session. |root_location| is in the
// root Window's coordinate system.
virtual int StartDragAndDrop(const ui::OSExchangeData& data,
aura::Window* root_window,
aura::Window* source_window,
const gfx::Point& root_location,
int operation,
ui::DragDropTypes::DragEventSource source) = 0;
// Called when mouse is dragged during a drag and drop.
virtual void DragUpdate(aura::Window* target,
const ui::LocatedEvent& event) = 0;
// Called when mouse is released during a drag and drop.
virtual void Drop(aura::Window* target,
const ui::LocatedEvent& event) = 0;
// Called when a drag and drop session is cancelled.
virtual void DragCancel() = 0;
// Returns true if a drag and drop session is in progress.
virtual bool IsDragDropInProgress() = 0;
};
AURA_EXPORT void SetDragDropClient(Window* root_window,
DragDropClient* client);
AURA_EXPORT DragDropClient* GetDragDropClient(Window* root_window);
} // namespace client
} // namespace aura
#endif // UI_WM_PUBLIC_DRAG_DROP_CLIENT_H_
|
/*
* Copyright (c) 2004, Richard Levitte <richard@levitte.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY 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.
*/
#define LP_SYS_WIN32
#define LP_MULTIBYTE_AVAILABLE
#include "LPdir_win.c"
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_MANAGER_H_
#define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_MANAGER_H_
#include <map>
#include <string>
#include <vector>
#include "base/callback_list.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "components/translate/core/browser/language_state.h"
#include "components/translate/core/common/translate_errors.h"
class GURL;
class PrefService;
namespace translate {
class TranslateClient;
class TranslateDriver;
class TranslatePrefs;
struct TranslateErrorDetails;
// The TranslateManager class is responsible for showing an info-bar when a page
// in a language different than the user language is loaded. It triggers the
// page translation the user requests.
class TranslateManager {
public:
// |translate_client| is expected to outlive the TranslateManager.
// |accept_language_pref_name| is the path for the preference for the
// accept-languages.
TranslateManager(TranslateClient* translate_client,
const std::string& accept_language_pref_name);
virtual ~TranslateManager();
// Returns a weak pointer to this instance.
base::WeakPtr<TranslateManager> GetWeakPtr();
// Cannot return NULL.
TranslateClient* translate_client() { return translate_client_; }
// Sets the sequence number of the current page, for use while sending
// messages to the renderer.
void set_current_seq_no(int page_seq_no) { page_seq_no_ = page_seq_no; }
// Returns the language to translate to. The language returned is the
// first language found in the following list that is supported by the
// translation service:
// the UI language
// the accept-language list
// If no language is found then an empty string is returned.
static std::string GetTargetLanguage(
const std::vector<std::string>& accept_languages_list);
// Returns the language to automatically translate to. |original_language| is
// the webpage's original language.
static std::string GetAutoTargetLanguage(const std::string& original_language,
TranslatePrefs* translate_prefs);
// Translates the page contents from |source_lang| to |target_lang|.
// The actual translation might be performed asynchronously if the translate
// script is not yet available.
void TranslatePage(const std::string& source_lang,
const std::string& target_lang,
bool triggered_from_menu);
// Starts the translation process for the page in the |page_lang| language.
void InitiateTranslation(const std::string& page_lang);
// Shows the after translate or error infobar depending on the details.
void PageTranslated(const std::string& source_lang,
const std::string& target_lang,
TranslateErrors::Type error_type);
// Reverts the contents of the page to its original language.
void RevertTranslation();
// Reports to the Google translate server that a page language was incorrectly
// detected. This call is initiated by the user selecting the "report" menu
// under options in the translate infobar.
void ReportLanguageDetectionError();
// Callback types for translate errors.
typedef base::Callback<void(const TranslateErrorDetails&)>
TranslateErrorCallback;
typedef base::CallbackList<void(const TranslateErrorDetails&)>
TranslateErrorCallbackList;
// Registers a callback for translate errors.
static scoped_ptr<TranslateErrorCallbackList::Subscription>
RegisterTranslateErrorCallback(const TranslateErrorCallback& callback);
// Gets the LanguageState associated with the TranslateManager
LanguageState& GetLanguageState();
private:
// Sends a translation request to the TranslateDriver.
void DoTranslatePage(const std::string& translate_script,
const std::string& source_lang,
const std::string& target_lang);
// Called when the Translate script has been fetched.
// Initiates the translation.
void OnTranslateScriptFetchComplete(const std::string& source_lang,
const std::string& target_lang,
bool success,
const std::string& data);
// Sequence number of the current page.
int page_seq_no_;
// Preference name for the Accept-Languages HTTP header.
std::string accept_languages_pref_name_;
TranslateClient* translate_client_; // Weak.
TranslateDriver* translate_driver_; // Weak.
LanguageState language_state_;
base::WeakPtrFactory<TranslateManager> weak_method_factory_;
DISALLOW_COPY_AND_ASSIGN(TranslateManager);
};
} // namespace translate
#endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_MANAGER_H_
|
/******************************************************************************
* Spine Runtimes Software License
* Version 2.3
*
* Copyright (c) 2013-2015, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable and
* non-transferable license to use, install, execute and perform the Spine
* Runtimes Software (the "Software") and derivative works solely for personal
* or internal use. Without the written permission of Esoteric Software (see
* Section 2 of the Spine Software License Agreement), you may not (a) modify,
* translate, adapt or otherwise create derivative works, improvements of the
* Software or develop new applications using the Software or (b) remove,
* delete, alter or obscure any trademarks or any copyright, trademark, patent
* or other intellectual property or proprietary rights notices on or in the
* Software, including any copy thereof. Redistributions in binary or source
* form must include this license and terms.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "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 ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include <spine/AnimationStateData.h>
#include <spine/extension.h>
typedef struct _ToEntry _ToEntry;
struct _ToEntry {
spAnimation* animation;
float duration;
_ToEntry* next;
};
_ToEntry* _ToEntry_create (spAnimation* to, float duration) {
_ToEntry* self = NEW(_ToEntry);
self->animation = to;
self->duration = duration;
return self;
}
void _ToEntry_dispose (_ToEntry* self) {
FREE(self);
}
/**/
typedef struct _FromEntry _FromEntry;
struct _FromEntry {
spAnimation* animation;
_ToEntry* toEntries;
_FromEntry* next;
};
_FromEntry* _FromEntry_create (spAnimation* from) {
_FromEntry* self = NEW(_FromEntry);
self->animation = from;
return self;
}
void _FromEntry_dispose (_FromEntry* self) {
FREE(self);
}
/**/
spAnimationStateData* spAnimationStateData_create (spSkeletonData* skeletonData) {
spAnimationStateData* self = NEW(spAnimationStateData);
CONST_CAST(spSkeletonData*, self->skeletonData) = skeletonData;
return self;
}
void spAnimationStateData_dispose (spAnimationStateData* self) {
_ToEntry* toEntry;
_ToEntry* nextToEntry;
_FromEntry* nextFromEntry;
_FromEntry* fromEntry = (_FromEntry*)self->entries;
while (fromEntry) {
toEntry = fromEntry->toEntries;
while (toEntry) {
nextToEntry = toEntry->next;
_ToEntry_dispose(toEntry);
toEntry = nextToEntry;
}
nextFromEntry = fromEntry->next;
_FromEntry_dispose(fromEntry);
fromEntry = nextFromEntry;
}
FREE(self);
}
void spAnimationStateData_setMixByName (spAnimationStateData* self, const char* fromName, const char* toName, float duration) {
spAnimation* to;
spAnimation* from = spSkeletonData_findAnimation(self->skeletonData, fromName);
if (!from) return;
to = spSkeletonData_findAnimation(self->skeletonData, toName);
if (!to) return;
spAnimationStateData_setMix(self, from, to, duration);
}
void spAnimationStateData_setMix (spAnimationStateData* self, spAnimation* from, spAnimation* to, float duration) {
/* Find existing FromEntry. */
_ToEntry* toEntry;
_FromEntry* fromEntry = (_FromEntry*)self->entries;
while (fromEntry) {
if (fromEntry->animation == from) {
/* Find existing ToEntry. */
toEntry = fromEntry->toEntries;
while (toEntry) {
if (toEntry->animation == to) {
toEntry->duration = duration;
return;
}
toEntry = toEntry->next;
}
break; /* Add new ToEntry to the existing FromEntry. */
}
fromEntry = fromEntry->next;
}
if (!fromEntry) {
fromEntry = _FromEntry_create(from);
fromEntry->next = (_FromEntry*)self->entries;
CONST_CAST(_FromEntry*, self->entries) = fromEntry;
}
toEntry = _ToEntry_create(to, duration);
toEntry->next = fromEntry->toEntries;
fromEntry->toEntries = toEntry;
}
float spAnimationStateData_getMix (spAnimationStateData* self, spAnimation* from, spAnimation* to) {
_FromEntry* fromEntry = (_FromEntry*)self->entries;
while (fromEntry) {
if (fromEntry->animation == from) {
_ToEntry* toEntry = fromEntry->toEntries;
while (toEntry) {
if (toEntry->animation == to) return toEntry->duration;
toEntry = toEntry->next;
}
}
fromEntry = fromEntry->next;
}
return self->defaultMix;
}
|
/**
* \file *********************************************************************
*
* \brief Spi Master configuration for spi example
*
* Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* 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 Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_SPI_MASTER_H_INCLUDED
#define CONF_SPI_MASTER_H_INCLUDED
//! Default Config Spi Master Dummy Field
// #define CONFIG_SPI_MASTER_DUMMY 0xFF
#endif /* CONF_SPI_MASTER_H_INCLUDED */
|
/* compress.c -- compress a memory buffer
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#define ZLIB_INTERNAL
#include "zlib.h"
/* ===========================================================================
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least 0.1% larger than sourceLen plus
12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
int ZEXPORT compress2 (
Bytef *dest,
uLongf *destLen,
const Bytef *source,
uLong sourceLen,
int level)
{
z_stream stream;
int err;
stream.next_in = (z_const Bytef *)source;
stream.avail_in = (uInt)sourceLen;
#ifdef MAXSEG_64K
/* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
#endif
stream.next_out = dest;
stream.avail_out = (uInt)*destLen;
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
stream.opaque = (voidpf)0;
err = deflateInit(&stream, level);
if (err != Z_OK) return err;
err = deflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
deflateEnd(&stream);
return err == Z_OK ? Z_BUF_ERROR : err;
}
*destLen = stream.total_out;
err = deflateEnd(&stream);
return err;
}
/* ===========================================================================
*/
int ZEXPORT compress (
Bytef *dest,
uLongf *destLen,
const Bytef *source,
uLong sourceLen)
{
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
}
/* ===========================================================================
If the default memLevel or windowBits for deflateInit() is changed, then
this function needs to be updated.
*/
uLong ZEXPORT compressBound (
uLong sourceLen)
{
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
}
|
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2010 Google, Inc.
* Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
*
* Author:
* Colin Cross <ccross@android.com>
*/
#ifndef __DRIVERS_MISC_TEGRA_FUSE_H
#define __DRIVERS_MISC_TEGRA_FUSE_H
#include <linux/dmaengine.h>
#include <linux/types.h>
struct nvmem_cell_lookup;
struct nvmem_device;
struct tegra_fuse;
struct tegra_fuse_info {
u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
unsigned int size;
unsigned int spare;
};
struct tegra_fuse_soc {
void (*init)(struct tegra_fuse *fuse);
void (*speedo_init)(struct tegra_sku_info *info);
int (*probe)(struct tegra_fuse *fuse);
const struct tegra_fuse_info *info;
const struct nvmem_cell_lookup *lookups;
unsigned int num_lookups;
const struct attribute_group *soc_attr_group;
bool clk_suspend_on;
};
struct tegra_fuse {
struct device *dev;
void __iomem *base;
phys_addr_t phys;
struct clk *clk;
u32 (*read_early)(struct tegra_fuse *fuse, unsigned int offset);
u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
const struct tegra_fuse_soc *soc;
/* APBDMA on Tegra20 */
struct {
struct mutex lock;
struct completion wait;
struct dma_chan *chan;
struct dma_slave_config config;
dma_addr_t phys;
u32 *virt;
} apbdma;
struct nvmem_device *nvmem;
struct nvmem_cell_lookup *lookups;
};
void tegra_init_revision(void);
void tegra_init_apbmisc(void);
bool __init tegra_fuse_read_spare(unsigned int spare);
u32 __init tegra_fuse_read_early(unsigned int offset);
u8 tegra_get_major_rev(void);
u8 tegra_get_minor_rev(void);
extern const struct attribute_group tegra_soc_attr_group;
#ifdef CONFIG_ARCH_TEGRA_2x_SOC
void tegra20_init_speedo_data(struct tegra_sku_info *sku_info);
#endif
#ifdef CONFIG_ARCH_TEGRA_3x_SOC
void tegra30_init_speedo_data(struct tegra_sku_info *sku_info);
#endif
#ifdef CONFIG_ARCH_TEGRA_114_SOC
void tegra114_init_speedo_data(struct tegra_sku_info *sku_info);
#endif
#if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
void tegra124_init_speedo_data(struct tegra_sku_info *sku_info);
#endif
#ifdef CONFIG_ARCH_TEGRA_210_SOC
void tegra210_init_speedo_data(struct tegra_sku_info *sku_info);
#endif
#ifdef CONFIG_ARCH_TEGRA_2x_SOC
extern const struct tegra_fuse_soc tegra20_fuse_soc;
#endif
#ifdef CONFIG_ARCH_TEGRA_3x_SOC
extern const struct tegra_fuse_soc tegra30_fuse_soc;
#endif
#ifdef CONFIG_ARCH_TEGRA_114_SOC
extern const struct tegra_fuse_soc tegra114_fuse_soc;
#endif
#if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
extern const struct tegra_fuse_soc tegra124_fuse_soc;
#endif
#ifdef CONFIG_ARCH_TEGRA_210_SOC
extern const struct tegra_fuse_soc tegra210_fuse_soc;
#endif
#ifdef CONFIG_ARCH_TEGRA_186_SOC
extern const struct tegra_fuse_soc tegra186_fuse_soc;
#endif
#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \
IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC)
extern const struct attribute_group tegra194_soc_attr_group;
#endif
#ifdef CONFIG_ARCH_TEGRA_194_SOC
extern const struct tegra_fuse_soc tegra194_fuse_soc;
#endif
#ifdef CONFIG_ARCH_TEGRA_234_SOC
extern const struct tegra_fuse_soc tegra234_fuse_soc;
#endif
#endif
|
/*
* Ratelimiting calculations
*
* Copyright IBM, Corp. 2011
*
* Authors:
* Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2 or later.
* See the COPYING.LIB file in the top-level directory.
*
*/
#ifndef QEMU_RATELIMIT_H
#define QEMU_RATELIMIT_H 1
typedef struct {
int64_t next_slice_time;
uint64_t slice_quota;
uint64_t slice_ns;
uint64_t dispatched;
} RateLimit;
static inline int64_t ratelimit_calculate_delay(RateLimit *limit, uint64_t n)
{
int64_t now = qemu_get_clock_ns(rt_clock);
if (limit->next_slice_time < now) {
limit->next_slice_time = now + limit->slice_ns;
limit->dispatched = 0;
}
if (limit->dispatched == 0 || limit->dispatched + n <= limit->slice_quota) {
limit->dispatched += n;
return 0;
} else {
limit->dispatched = n;
return limit->next_slice_time - now;
}
}
static inline void ratelimit_set_speed(RateLimit *limit, uint64_t speed,
uint64_t slice_ns)
{
limit->slice_ns = slice_ns;
limit->slice_quota = ((double)speed * slice_ns)/1000000000ULL;
}
#endif
|
// Copyright (c) 2010 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 WEBKIT_GLUE_FORM_FIELD_H_
#define WEBKIT_GLUE_FORM_FIELD_H_
#include <vector>
#ifdef ANDROID
#include "base/base_api.h"
#endif
#include "base/string16.h"
#ifndef ANDROID
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement.h"
#endif
namespace webkit_glue {
// Stores information about a field in a form.
struct
#ifdef ANDROID
BASE_API
#endif
FormField {
FormField();
#ifndef ANDROID
explicit FormField(WebKit::WebFormControlElement element);
#endif
FormField(const string16& label,
const string16& name,
const string16& value,
const string16& form_control_type,
int max_length,
bool is_autofilled);
virtual ~FormField();
// Equality tests for identity which does not include |value_| or |size_|.
// Use |StrictlyEqualsHack| method to test all members.
// TODO(dhollowa): These operators need to be revised when we implement field
// ids.
bool operator==(const FormField& field) const;
bool operator!=(const FormField& field) const;
// Test equality of all data members.
// TODO(dhollowa): This will be removed when we implement field ids.
bool StrictlyEqualsHack(const FormField& field) const;
string16 label;
string16 name;
string16 value;
string16 form_control_type;
int max_length;
bool is_autofilled;
std::vector<string16> option_strings;
};
// So we can compare FormFields with EXPECT_EQ().
std::ostream& operator<<(std::ostream& os, const FormField& field);
} // namespace webkit_glue
#endif // WEBKIT_GLUE_FORM_FIELD_H_
|
/***************************************************************************/
/* */
/* cffcmap.h */
/* */
/* CFF character mapping table (cmap) support (specification). */
/* */
/* Copyright 2002-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef CFFCMAP_H_
#define CFFCMAP_H_
#include "cffobjs.h"
FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/* standard (and expert) encoding cmaps */
typedef struct CFF_CMapStdRec_* CFF_CMapStd;
typedef struct CFF_CMapStdRec_
{
FT_CMapRec cmap;
FT_UShort* gids; /* up to 256 elements */
} CFF_CMapStdRec;
FT_DECLARE_CMAP_CLASS(cff_cmap_encoding_class_rec)
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** CFF SYNTHETIC UNICODE ENCODING CMAP *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/* unicode (synthetic) cmaps */
FT_DECLARE_CMAP_CLASS(cff_cmap_unicode_class_rec)
FT_END_HEADER
#endif /* CFFCMAP_H_ */
/* END */
|
/**************************************************************************
* Copyright (c) 2009, Intel Corporation.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
* Authors:
* Benjamin Defnet <benjamin.r.defnet@intel.com>
* Rajesh Poornachandran <rajesh.poornachandran@intel.com>
*
**************************************************************************/
#ifndef _SYSIRQ_H_
#define _SYSIRQ_H_
#include <drm/drmP.h>
bool sysirq_init(struct drm_device *dev);
void sysirq_uninit(struct drm_device *dev);
void psb_irq_preinstall(struct drm_device *dev);
int psb_irq_postinstall(struct drm_device *dev);
void psb_irq_uninstall(struct drm_device *dev);
irqreturn_t psb_irq_handler(DRM_IRQ_ARGS);
void psb_irq_preinstall_islands(struct drm_device *dev, int hw_islands);
int psb_irq_postinstall_islands(struct drm_device *dev, int hw_islands);
void psb_irq_uninstall_islands(struct drm_device *dev, int hw_islands);
void psb_irq_preinstall_graphics_islands(struct drm_device *dev,
int hw_islands);
int psb_irq_postinstall_graphics_islands(struct drm_device *dev,
int hw_islands);
void psb_irq_uninstall_graphics_islands(struct drm_device *dev,
int hw_islands);
int psb_irq_enable_dpst(struct drm_device *dev);
int psb_irq_disable_dpst(struct drm_device *dev);
void psb_irq_turn_on_dpst(struct drm_device *dev);
void psb_irq_turn_off_dpst(struct drm_device *dev);
int psb_enable_vblank(struct drm_device *dev, int pipe);
void psb_disable_vblank(struct drm_device *dev, int pipe);
u32 psb_get_vblank_counter(struct drm_device *dev, int pipe);
#endif /* _SYSIRQ_H_ */
|
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ARCH_ARM_MACH_KGSL_H
#define _ARCH_ARM_MACH_KGSL_H
/* Clock flags to show which clocks should be controled by a given platform */
#define KGSL_CLK_SRC 0x00000001
#define KGSL_CLK_CORE 0x00000002
#define KGSL_CLK_IFACE 0x00000004
#define KGSL_CLK_MEM 0x00000008
#define KGSL_CLK_MEM_IFACE 0x00000010
#define KGSL_CLK_AXI 0x00000020
#define KGSL_CLK_ALT_MEM_IFACE 0x00000040
#define KGSL_MAX_PWRLEVELS 5
#define KGSL_CONVERT_TO_MBPS(val) \
(val*1000*1000U)
#define KGSL_3D0_REG_MEMORY "kgsl_3d0_reg_memory"
#define KGSL_3D0_SHADER_MEMORY "kgsl_3d0_shader_memory"
#define KGSL_3D0_IRQ "kgsl_3d0_irq"
#define KGSL_2D0_REG_MEMORY "kgsl_2d0_reg_memory"
#define KGSL_2D0_IRQ "kgsl_2d0_irq"
#define KGSL_2D1_REG_MEMORY "kgsl_2d1_reg_memory"
#define KGSL_2D1_IRQ "kgsl_2d1_irq"
#define ADRENO_CHIPID(_co, _ma, _mi, _pa) \
((((_co) & 0xFF) << 24) | \
(((_ma) & 0xFF) << 16) | \
(((_mi) & 0xFF) << 8) | \
((_pa) & 0xFF))
enum kgsl_iommu_context_id {
KGSL_IOMMU_CONTEXT_USER = 0,
KGSL_IOMMU_CONTEXT_PRIV = 1,
};
struct kgsl_iommu_ctx {
const char *iommu_ctx_name;
enum kgsl_iommu_context_id ctx_id;
};
/*
* struct kgsl_device_iommu_data - Struct holding iommu context data obtained
* from dtsi file
* @iommu_ctxs: Pointer to array of struct hoding context name and id
* @iommu_ctx_count: Number of contexts defined in the dtsi file
* @iommu_halt_enable: Indicated if smmu halt h/w feature is supported
* @physstart: Start of iommu registers physical address
* @physend: End of iommu registers physical address
*/
struct kgsl_device_iommu_data {
const struct kgsl_iommu_ctx *iommu_ctxs;
int iommu_ctx_count;
int iommu_halt_enable;
unsigned int physstart;
unsigned int physend;
};
struct kgsl_pwrlevel {
unsigned int gpu_freq;
unsigned int bus_freq;
unsigned int io_fraction;
};
struct kgsl_device_platform_data {
struct kgsl_pwrlevel pwrlevel[KGSL_MAX_PWRLEVELS];
int init_level;
int num_levels;
int (*set_grp_async)(void);
unsigned int idle_timeout;
bool strtstp_sleepwake;
unsigned int nap_allowed;
unsigned int clk_map;
unsigned int idle_needed;
unsigned int step_mul;
struct msm_bus_scale_pdata *bus_scale_table;
struct kgsl_device_iommu_data *iommu_data;
int iommu_count;
struct msm_dcvs_core_info *core_info;
struct coresight_device *csdev;
struct coresight_platform_data *coresight_pdata;
unsigned int chipid;
};
#endif
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/browser/chromeos/login/screens/terms_of_service_screen_actor.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
namespace chromeos {
// The sole implementation of the TermsOfServiceScreenActor, using WebUI.
class TermsOfServiceScreenHandler : public BaseScreenHandler,
public TermsOfServiceScreenActor {
public:
TermsOfServiceScreenHandler();
virtual ~TermsOfServiceScreenHandler();
// content::WebUIMessageHandler:
virtual void RegisterMessages() OVERRIDE;
// BaseScreenHandler:
virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE;
// TermsOfServiceScreenActor:
virtual void SetDelegate(Delegate* screen) OVERRIDE;
virtual void Show() OVERRIDE;
virtual void Hide() OVERRIDE;
virtual void SetDomain(const std::string& domain) OVERRIDE;
virtual void OnLoadError() OVERRIDE;
virtual void OnLoadSuccess(const std::string& terms_of_service) OVERRIDE;
private:
// BaseScreenHandler:
virtual void Initialize() OVERRIDE;
// Update the domain name shown in the UI.
void UpdateDomainInUI();
// Update the UI to show an error message or the Terms of Service, depending
// on whether the download of the Terms of Service was successful. Does
// nothing if the download is still in progress.
void UpdateTermsOfServiceInUI();
// Called when the user declines the Terms of Service by clicking the "back"
// button.
void HandleBack();
// Called when the user accepts the Terms of Service by clicking the "accept
// and continue" button.
void HandleAccept();
TermsOfServiceScreenHandler::Delegate* screen_;
// Whether the screen should be shown right after initialization.
bool show_on_init_;
// The domain name whose Terms of Service are being shown.
std::string domain_;
// Set to |true| when the download of the Terms of Service fails.
bool load_error_;
// Set to the Terms of Service when the download is successful.
std::string terms_of_service_;
DISALLOW_COPY_AND_ASSIGN(TermsOfServiceScreenHandler);
};
} // namespace chromeos
#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_
|
/* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __KGSL_PWRSCALE_H
#define __KGSL_PWRSCALE_H
#include <linux/devfreq.h>
#include <linux/msm_adreno_devfreq.h>
/* devfreq governor call window in usec */
#define KGSL_GOVERNOR_CALL_INTERVAL 10000
/* Power events to be tracked with history */
#define KGSL_PWREVENT_STATE 0
#define KGSL_PWREVENT_GPU_FREQ 1
#define KGSL_PWREVENT_BUS_FREQ 2
#define KGSL_PWREVENT_POPP 3
#define KGSL_PWREVENT_MAX 4
/**
* Amount of time running at a level to be considered
* "stable" in msec
*/
#define STABLE_TIME 150
/* Amount of idle time needed to re-set stability in usec */
#define POPP_RESET_TIME 1000000
/* Number of POPP levels */
#define POPP_MAX 4
/* POPP state bits */
#define POPP_ON BIT(0)
#define POPP_PUSH BIT(1)
struct kgsl_popp {
int gpu_x;
int ddr_y;
};
struct kgsl_power_stats {
u64 busy_time;
u64 ram_time;
u64 ram_wait;
};
struct kgsl_pwr_event {
unsigned int data;
ktime_t start;
s64 duration;
};
struct kgsl_pwr_history {
struct kgsl_pwr_event *events;
unsigned int type;
unsigned int index;
unsigned int size;
};
/**
* struct kgsl_pwrscale - Power scaling settings for a KGSL device
* @devfreqptr - Pointer to the devfreq device
* @gpu_profile - GPU profile data for the devfreq device
* @bus_profile - Bus specific data for the bus devfreq device
* @freq_table - GPU frequencies for the DCVS algorithm
* @last_governor - Prior devfreq governor
* @accum_stats - Accumulated statistics for various frequency calculations
* @enabled - Whether or not power scaling is enabled
* @time - Last submitted sample timestamp
* @on_time - Timestamp when gpu busy begins
* @freq_change_time - Timestamp of last freq change or popp update
* @nh - Notifier for the partner devfreq bus device
* @devfreq_wq - Main devfreq workqueue
* @devfreq_suspend_ws - Pass device suspension to devfreq
* @devfreq_resume_ws - Pass device resume to devfreq
* @devfreq_notify_ws - Notify devfreq to update sampling
* @next_governor_call - Timestamp after which the governor may be notified of
* a new sample
* @history - History of power events with timestamps and durations
* @popp_level - Current level of POPP mitigation
* @popp_state - Control state for POPP, on/off, recently pushed, etc
*/
struct kgsl_pwrscale {
struct devfreq *devfreqptr;
struct msm_adreno_extended_profile gpu_profile;
struct msm_busmon_extended_profile bus_profile;
unsigned int freq_table[KGSL_MAX_PWRLEVELS];
char last_governor[DEVFREQ_NAME_LEN];
struct kgsl_power_stats accum_stats;
bool enabled;
ktime_t time;
s64 on_time;
s64 freq_change_time;
struct srcu_notifier_head nh;
struct workqueue_struct *devfreq_wq;
struct work_struct devfreq_suspend_ws;
struct work_struct devfreq_resume_ws;
struct work_struct devfreq_notify_ws;
ktime_t next_governor_call;
struct kgsl_pwr_history history[KGSL_PWREVENT_MAX];
int popp_level;
unsigned long popp_state;
};
int kgsl_pwrscale_init(struct device *dev, const char *governor);
void kgsl_pwrscale_close(struct kgsl_device *device);
void kgsl_pwrscale_update(struct kgsl_device *device);
void kgsl_pwrscale_update_stats(struct kgsl_device *device);
void kgsl_pwrscale_busy(struct kgsl_device *device);
void kgsl_pwrscale_sleep(struct kgsl_device *device);
void kgsl_pwrscale_wake(struct kgsl_device *device);
void kgsl_pwrscale_enable(struct kgsl_device *device);
void kgsl_pwrscale_disable(struct kgsl_device *device);
int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags);
int kgsl_devfreq_get_dev_status(struct device *, struct devfreq_dev_status *);
int kgsl_devfreq_get_cur_freq(struct device *dev, unsigned long *freq);
int kgsl_busmon_target(struct device *dev, unsigned long *freq, u32 flags);
int kgsl_busmon_get_dev_status(struct device *, struct devfreq_dev_status *);
int kgsl_busmon_get_cur_freq(struct device *dev, unsigned long *freq);
bool kgsl_popp_check(struct kgsl_device *device);
#define KGSL_PWRSCALE_INIT(_priv_data) { \
.enabled = true, \
.gpu_profile = { \
.private_data = _priv_data, \
.profile = { \
.target = kgsl_devfreq_target, \
.get_dev_status = kgsl_devfreq_get_dev_status, \
.get_cur_freq = kgsl_devfreq_get_cur_freq, \
} }, \
.bus_profile = { \
.private_data = _priv_data, \
.profile = { \
.target = kgsl_busmon_target, \
.get_dev_status = kgsl_busmon_get_dev_status, \
.get_cur_freq = kgsl_busmon_get_cur_freq, \
} }, \
.history[KGSL_PWREVENT_STATE].size = 20, \
.history[KGSL_PWREVENT_GPU_FREQ].size = 3, \
.history[KGSL_PWREVENT_BUS_FREQ].size = 5, \
.history[KGSL_PWREVENT_POPP].size = 5, \
}
#endif
|
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the above listed
copyright holder(s) not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef GETSELEV_H
#define GETSELEV_H 1
int SProcXGetSelectedExtensionEvents(ClientPtr /* client */
);
int ProcXGetSelectedExtensionEvents(ClientPtr /* client */
);
void SRepXGetSelectedExtensionEvents(ClientPtr /* client */ ,
int /* size */ ,
xGetSelectedExtensionEventsReply * /* rep */
);
#endif /* GETSELEV_H */
|
/*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gl/GrGLInterface.h"
typedef void(*GrGLFuncPtr)();
typedef GrGLFuncPtr (*GrGLGetProc)(void* ctx, const char name[]);
/**
* Generic function for creating a GrGLInterface for an OpenGL (but not GLES) context. It calls
* get() to get each function address. ctx is a generic ptr passed to and interpreted by get().
*/
const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get);
|
//
// UILabel+AutoSize.h
// iOS-Categories (https://github.com/shaojiankui/iOS-Categories)
//
// Created by Jakey on 15/5/22.
// Copyright (c) 2015年 www.skyfox.org. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UILabel (AutoSize)
/**
* 垂直方向固定获取动态宽度的UILabel的方法
*
* @return 原始UILabel修改过的Rect的UILabel(起始位置相同)
*/
- (UILabel *)resizeLabelHorizontal;
/**
* 水平方向固定获取动态宽度的UILabel的方法
*
* @return 原始UILabel修改过的Rect的UILabel(起始位置相同)
*/
- (UILabel *)resizeLabelVertical;
/**
* 垂直方向固定获取动态宽度的UILabel的方法
*
* @param minimumWidth minimum width
*
* @return 原始UILabel修改过的Rect的UILabel(起始位置相同)
*/
- (UILabel *)resizeLabelHorizontal:(CGFloat)minimumWidth;
/**
* 水平方向固定获取动态宽度的UILabel的方法
*
* @param minimumHeigh minimum height
*
* @return 原始UILabel修改过的Rect的UILabel(起始位置相同)
*/
- (UILabel *)resizeLabelVertical:(CGFloat)minimumHeigh;
@end
|
/*
* Freescale DCP driver for bootstream update. Only handles the OTP KEY
* case and can only encrypt/decrypt.
*
* Author: Pantelis Antoniou <pantelis@embeddedalley.com>
*
* Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All Rights Reserved.
* Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
#ifndef DCP_BOOTSTREAM_IOCTL_H
#define DCP_BOOTSTREAM_IOCTL_H
/* remember to have included the proper _IO definition
* file before hand.
* For user space it's <sys/ioctl.h>
*/
#define DBS_IOCTL_BASE 'd'
#define DBS_ENC _IOW(DBS_IOCTL_BASE, 0x00, uint8_t[16])
#define DBS_DEC _IOW(DBS_IOCTL_BASE, 0x01, uint8_t[16])
#endif
|
extern struct platform_device pxa_device_pmu;
extern struct platform_device pxa_device_mci;
extern struct platform_device pxa3xx_device_mci2;
extern struct platform_device pxa3xx_device_mci3;
extern struct platform_device pxa25x_device_udc;
extern struct platform_device pxa27x_device_udc;
extern struct platform_device pxa3xx_device_u2d;
extern struct platform_device pxa_device_fb;
extern struct platform_device pxa_device_ffuart;
extern struct platform_device pxa_device_btuart;
extern struct platform_device pxa_device_stuart;
extern struct platform_device pxa_device_hwuart;
extern struct platform_device pxa_device_i2c;
extern struct platform_device pxa_device_i2s;
extern struct platform_device pxa_device_ficp;
extern struct platform_device sa1100_device_rtc;
extern struct platform_device pxa_device_rtc;
extern struct platform_device pxa_device_ac97;
extern struct platform_device pxa_device_gpio;
extern struct platform_device pxa27x_device_i2c_power;
extern struct platform_device pxa27x_device_ohci;
extern struct platform_device pxa27x_device_keypad;
extern struct platform_device pxa25x_device_ssp;
extern struct platform_device pxa25x_device_nssp;
extern struct platform_device pxa25x_device_assp;
extern struct platform_device pxa27x_device_ssp1;
extern struct platform_device pxa27x_device_ssp2;
extern struct platform_device pxa27x_device_ssp3;
extern struct platform_device pxa3xx_device_ssp4;
extern struct platform_device pxa25x_device_pwm0;
extern struct platform_device pxa25x_device_pwm1;
extern struct platform_device pxa27x_device_pwm0;
extern struct platform_device pxa27x_device_pwm1;
extern struct platform_device pxa3xx_device_nand;
extern struct platform_device pxa3xx_device_i2c_power;
extern struct platform_device pxa3xx_device_gcu;
extern struct platform_device pxa_device_asoc_platform;
extern struct platform_device pxa_device_asoc_ssp1;
extern struct platform_device pxa_device_asoc_ssp2;
extern struct platform_device pxa_device_asoc_ssp3;
extern struct platform_device pxa_device_asoc_ssp4;
void __init pxa_register_device(struct platform_device *dev, void *data);
|
//===-- GCs.h - Garbage collector linkage hacks ---------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains hack functions to force linking in the GC components.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_GCS_H
#define LLVM_CODEGEN_GCS_H
namespace llvm {
class GCStrategy;
class GCMetadataPrinter;
/// FIXME: Collector instances are not useful on their own. These no longer
/// serve any purpose except to link in the plugins.
/// Creates a CoreCLR-compatible garbage collector.
void linkCoreCLRGC();
/// Creates an ocaml-compatible garbage collector.
void linkOcamlGC();
/// Creates an ocaml-compatible metadata printer.
void linkOcamlGCPrinter();
/// Creates an erlang-compatible garbage collector.
void linkErlangGC();
/// Creates an erlang-compatible metadata printer.
void linkErlangGCPrinter();
/// Creates a shadow stack garbage collector. This collector requires no code
/// generator support.
void linkShadowStackGC();
void linkStatepointExampleGC();
}
#endif
|
#ifndef CAIAQ_DEVICE_H
#define CAIAQ_DEVICE_H
#include "../usbaudio.h"
#define USB_VID_NATIVEINSTRUMENTS 0x17cc
#define USB_PID_RIGKONTROL2 0x1969
#define USB_PID_RIGKONTROL3 0x1940
#define USB_PID_KORECONTROLLER 0x4711
#define USB_PID_KORECONTROLLER2 0x4712
#define USB_PID_AK1 0x0815
#define USB_PID_AUDIO2DJ 0x041c
#define USB_PID_AUDIO4DJ 0x0839
#define USB_PID_AUDIO8DJ 0x1978
#define USB_PID_SESSIONIO 0x1915
#define USB_PID_GUITARRIGMOBILE 0x0d8d
#define USB_PID_TRAKTORKONTROLX1 0x2305
#define USB_PID_TRAKTORKONTROLS4 0xbaff
#define USB_PID_TRAKTORAUDIO2 0x041d
#define USB_PID_MASCHINECONTROLLER 0x0808
#define EP1_BUFSIZE 64
#define EP4_BUFSIZE 512
#define CAIAQ_USB_STR_LEN 0xff
#define MAX_STREAMS 32
//#define SND_USB_CAIAQ_DEBUG
#define MODNAME "snd-usb-caiaq"
#define log(x...) snd_printk(KERN_WARNING MODNAME" log: " x)
#ifdef SND_USB_CAIAQ_DEBUG
#define debug(x...) snd_printk(KERN_WARNING MODNAME " debug: " x)
#else
#define debug(x...) do { } while(0)
#endif
#define EP1_CMD_GET_DEVICE_INFO 0x1
#define EP1_CMD_READ_ERP 0x2
#define EP1_CMD_READ_ANALOG 0x3
#define EP1_CMD_READ_IO 0x4
#define EP1_CMD_WRITE_IO 0x5
#define EP1_CMD_MIDI_READ 0x6
#define EP1_CMD_MIDI_WRITE 0x7
#define EP1_CMD_AUDIO_PARAMS 0x9
#define EP1_CMD_AUTO_MSG 0xb
#define EP1_CMD_DIMM_LEDS 0xc
struct caiaq_device_spec {
unsigned short fw_version;
unsigned char hw_subtype;
unsigned char num_erp;
unsigned char num_analog_in;
unsigned char num_digital_in;
unsigned char num_digital_out;
unsigned char num_analog_audio_out;
unsigned char num_analog_audio_in;
unsigned char num_digital_audio_out;
unsigned char num_digital_audio_in;
unsigned char num_midi_out;
unsigned char num_midi_in;
unsigned char data_alignment;
} __attribute__ ((packed));
struct snd_usb_caiaq_cb_info;
struct snd_usb_caiaqdev {
struct snd_usb_audio chip;
struct urb ep1_in_urb;
struct urb midi_out_urb;
struct urb **data_urbs_in;
struct urb **data_urbs_out;
struct snd_usb_caiaq_cb_info *data_cb_info;
unsigned char ep1_in_buf[EP1_BUFSIZE];
unsigned char ep1_out_buf[EP1_BUFSIZE];
unsigned char midi_out_buf[EP1_BUFSIZE];
struct caiaq_device_spec spec;
spinlock_t spinlock;
wait_queue_head_t ep1_wait_queue;
wait_queue_head_t prepare_wait_queue;
int spec_received, audio_parm_answer;
int midi_out_active;
char vendor_name[CAIAQ_USB_STR_LEN];
char product_name[CAIAQ_USB_STR_LEN];
int n_streams, n_audio_in, n_audio_out;
int streaming, first_packet, output_running;
int audio_in_buf_pos[MAX_STREAMS];
int audio_out_buf_pos[MAX_STREAMS];
int period_in_count[MAX_STREAMS];
int period_out_count[MAX_STREAMS];
int input_panic, output_panic, warned;
char *audio_in_buf, *audio_out_buf;
unsigned int samplerates, bpp;
unsigned long outurb_active_mask;
struct snd_pcm_substream *sub_playback[MAX_STREAMS];
struct snd_pcm_substream *sub_capture[MAX_STREAMS];
/* Controls */
unsigned char control_state[256];
unsigned char ep8_out_buf[2];
/* Linux input */
#ifdef CONFIG_SND_USB_CAIAQ_INPUT
struct input_dev *input_dev;
char phys[64]; /* physical device path */
unsigned short keycode[128];
struct urb *ep4_in_urb;
unsigned char ep4_in_buf[EP4_BUFSIZE];
#endif
/* ALSA */
struct snd_pcm *pcm;
struct snd_pcm_hardware pcm_info;
struct snd_rawmidi *rmidi;
struct snd_rawmidi_substream *midi_receive_substream;
struct snd_rawmidi_substream *midi_out_substream;
};
struct snd_usb_caiaq_cb_info {
struct snd_usb_caiaqdev *dev;
int index;
};
#define caiaqdev(c) ((struct snd_usb_caiaqdev*)(c)->private_data)
int snd_usb_caiaq_set_audio_params (struct snd_usb_caiaqdev *dev, int rate, int depth, int bbp);
int snd_usb_caiaq_set_auto_msg (struct snd_usb_caiaqdev *dev, int digital, int analog, int erp);
int snd_usb_caiaq_send_command(struct snd_usb_caiaqdev *dev,
unsigned char command,
const unsigned char *buffer,
int len);
#endif /* CAIAQ_DEVICE_H */
|
/*
*
* drivers/media/tdmb/tdmb_port_fc8050.c
*
* tdmb driver
*
* Copyright (C) (2011, Samsung Electronics)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/device.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/workqueue.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/time.h>
#include <linux/timer.h>
#include <linux/vmalloc.h>
#include "tdmb.h"
#include "dmbdrv_wrap_fc8050.h"
static bool fc8050_on_air;
static bool fc8050_pwr_on;
static bool __get_ensemble_info(struct ensemble_info_type *e_info
, unsigned long freq)
{
int i;
int j;
int sub_i = 0;
int cnt;
const char *ensembleName = NULL;
struct sub_channel_info_type *fci_sub_info;
DPRINTK("%s : freq(%ld)\n", __func__, freq);
e_info->tot_sub_ch
= dmb_drv_get_dmb_sub_ch_cnt() + dmb_drv_get_dab_sub_ch_cnt();
DPRINTK("total subchannel number : %d\n", e_info->tot_sub_ch);
if (e_info->tot_sub_ch > 0) {
ensembleName = (char *)dmb_drv_get_ensemble_label();
if (ensembleName)
strncpy((char *)e_info->ensem_label,
(char *)ensembleName,
ENSEMBLE_LABEL_MAX);
e_info->ensem_freq = freq;
for (i = 0; i < 2; i++) {
cnt = (i == 0)
? dmb_drv_get_dmb_sub_ch_cnt()
: dmb_drv_get_dab_sub_ch_cnt();
for (j = 0; j < cnt; j++, sub_i++) {
fci_sub_info = (i == 0)
? dmb_drv_get_fic_dmb(j)
: dmb_drv_get_fic_dab(j);
e_info->ensem_id
= fci_sub_info->uiEnsembleID;
e_info->sub_ch[sub_i].sub_ch_id
= fci_sub_info->ucSubchID;
e_info->sub_ch[sub_i].start_addr
= fci_sub_info->uiStartAddress;
e_info->sub_ch[sub_i].tmid
= fci_sub_info->ucTMId;
e_info->sub_ch[sub_i].svc_type
= fci_sub_info->ucServiceType;
e_info->sub_ch[sub_i].svc_id
= fci_sub_info->ulServiceID;
e_info->sub_ch[sub_i].scids
= fci_sub_info->scids;
e_info->sub_ch[sub_i].ecc
= fci_sub_info->ecc;
if (i == 0)
memcpy(
e_info->sub_ch[sub_i].svc_label,
dmb_drv_get_sub_ch_dmb_label(j),
SVC_LABEL_MAX);
else
memcpy(e_info->sub_ch[sub_i].svc_label,
dmb_drv_get_sub_ch_dab_label(j),
SVC_LABEL_MAX);
}
}
return true;
} else {
return false;
}
}
static void fc8050_power_off(void)
{
DPRINTK("call TDMB_PowerOff !\n");
if (fc8050_pwr_on) {
fc8050_on_air = false;
dmb_drv_deinit();
tdmb_control_irq(false);
tdmb_control_gpio(false);
fc8050_pwr_on = false;
}
}
static bool fc8050_power_on(void)
{
DPRINTK("fc8050_power_on\n");
if (fc8050_pwr_on) {
return true;
} else {
tdmb_control_gpio(true);
if (dmb_drv_init(tdmb_get_if_handle()) == TDMB_FAIL) {
tdmb_control_gpio(false);
return false;
} else {
tdmb_control_irq(true);
fc8050_pwr_on = true;
return true;
}
}
}
static void fc8050_get_dm(struct tdmb_dm *info)
{
if (fc8050_pwr_on == true && fc8050_on_air == true) {
info->rssi = dmb_drv_get_rssi();
info->ber = dmb_drv_get_ber();
info->antenna = dmb_drv_get_ant();
info->per = 0;
} else {
info->rssi = 100;
info->ber = 2000;
info->per = 0;
info->antenna = 0;
}
}
static bool fc8050_set_ch(unsigned long freq,
unsigned char sub_ch_id,
bool factory_test)
{
unsigned long freq_temp = freq / 1000;
unsigned char sub_ch_id_temp = sub_ch_id % 1000;
unsigned char svc_type_temp = 0x0;
if (sub_ch_id_temp >= 64) {
sub_ch_id_temp -= 64;
svc_type_temp = 0x18;
}
DPRINTK("fc8050_set_ch freq:%ld, sub_ch_id:%d, svc_type:%d\n",
freq_temp, sub_ch_id_temp, svc_type_temp);
fc8050_on_air = false;
if (factory_test) {
if (dmb_drv_set_ch_factory(freq_temp, sub_ch_id_temp, \
svc_type_temp) == 1) {
DPRINTK("dmb_drv_set_ch_factory Success\n");
fc8050_on_air = true;
return true;
} else {
DPRINTK("dmb_drv_set_ch_factory Fail\n");
return false;
}
} else {
if (dmb_drv_set_ch(freq_temp, sub_ch_id_temp, \
svc_type_temp) == 1) {
DPRINTK("dmb_drv_set_ch Success\n");
fc8050_on_air = true;
return true;
} else {
DPRINTK("dmb_drv_set_ch Fail\n");
return false;
}
}
}
static bool fc8050_scan_ch(struct ensemble_info_type *e_info
, unsigned long freq)
{
if (fc8050_pwr_on == false || e_info == NULL)
return false;
else if (dmb_drv_scan_ch((freq / 1000)) == TDMB_SUCCESS)
return __get_ensemble_info(e_info, freq);
else
return false;
}
static unsigned long fc8050_int_size(void)
{
return 188*20;
}
static struct tdmb_drv_func fci_fc8050_drv_func = {
.power_on = fc8050_power_on,
.power_off = fc8050_power_off,
.scan_ch = fc8050_scan_ch,
.get_dm = fc8050_get_dm,
.set_ch = fc8050_set_ch,
.pull_data = dmb_drv_isr,
.get_int_size = fc8050_int_size,
};
struct tdmb_drv_func *fc8050_drv_func(void)
{
DPRINTK("tdmb_get_drv_func : fc8050\n");
return &fci_fc8050_drv_func;
}
|
#ifndef CONFIG_LISA_M_2_1_H
#define CONFIG_LISA_M_2_1_H
#include "boards/lisa_m_common.h"
#define BOARD_LISA_M
/* Lisa/M has a 12MHz external clock and 72MHz internal. */
#define EXT_CLK 12000000
#define AHB_CLK 72000000
/*
* Onboard LEDs
*/
/* red, on PA8 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOA
#define LED_1_GPIO_PIN GPIO8
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)
/* green, shared with JTAG_TRST */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP { \
rcc_periph_clock_enable(RCC_AFIO); \
AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_FULL_SWJ_NO_JNTRST; \
}
/* green, shared with ADC12 (ADC_6 on connector ANALOG2) */
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_GPIO GPIOC
#define LED_3_GPIO_PIN GPIO2
#define LED_3_GPIO_ON gpio_clear
#define LED_3_GPIO_OFF gpio_set
#define LED_3_AFIO_REMAP ((void)0)
/* red, shared with ADC15 (ADC_4 on connector ANALOG2) */
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_GPIO GPIOC
#define LED_4_GPIO_PIN GPIO5
#define LED_4_GPIO_ON gpio_clear
#define LED_4_GPIO_OFF gpio_set
#define LED_4_AFIO_REMAP ((void)0)
/* green, on PC15 */
#ifndef USE_LED_5
#define USE_LED_5 1
#endif
#define LED_5_GPIO GPIOC
#define LED_5_GPIO_PIN GPIO15
#define LED_5_GPIO_ON gpio_clear
#define LED_5_GPIO_OFF gpio_set
#define LED_5_AFIO_REMAP ((void)0)
/*
* LEDs not populated by default
*/
/* PC3, ADC13 on ADC_1 */
#define LED_6_GPIO GPIOC
#define LED_6_GPIO_PIN GPIO3
#define LED_6_GPIO_ON gpio_clear
#define LED_6_GPIO_OFF gpio_set
#define LED_6_AFIO_REMAP ((void)0)
/* PC0, ADC10 on ADC_2 */
#define LED_7_GPIO GPIOC
#define LED_7_GPIO_PIN GPIO0
#define LED_7_GPIO_ON gpio_clear
#define LED_7_GPIO_OFF gpio_set
#define LED_7_AFIO_REMAP ((void)0)
/* PC1, ADC11 on ADC_3 */
#define LED_8_GPIO GPIOC
#define LED_8_GPIO_PIN GPIO1
#define LED_8_GPIO_ON gpio_clear
#define LED_8_GPIO_OFF gpio_set
#define LED_8_AFIO_REMAP ((void)0)
/*
* not actual LEDS, used as GPIOs
*/
/* PB1, DRDY on EXT SPI connector*/
#define LED_BODY_GPIO GPIOB
#define LED_BODY_GPIO_PIN GPIO1
#define LED_BODY_GPIO_ON gpio_set
#define LED_BODY_GPIO_OFF gpio_clear
#define LED_BODY_AFIO_REMAP ((void)0)
/* PC12, on GPIO connector*/
#define LED_12_GPIO GPIOC
#define LED_12_GPIO_PIN GPIO12
#define LED_12_GPIO_ON gpio_clear
#define LED_12_GPIO_OFF gpio_set
#define LED_12_AFIO_REMAP ((void)0)
/*
* Spektrum
*/
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO2
#define SPEKTRUM_BIND_PIN_PORT GPIOB
/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()
#define DefaultVoltageOfAdc(adc) (0.0045*adc)
/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
#define USE_BARO_BOARD 1
#endif
#endif /* CONFIG_LISA_M_2_1_H */
|
/*
* Supports for the button array on SoC tablets originally running
* Windows 8.
*
* (C) Copyright 2014 Intel Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* of the License.
*/
#include <linux/module.h>
#include <linux/input.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/acpi.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio_keys.h>
#include <linux/platform_device.h>
#include <linux/pnp.h>
/*
* Definition of buttons on the tablet. The ACPI index of each button
* is defined in section 2.8.7.2 of "Windows ACPI Design Guide for SoC
* Platforms"
*/
#define MAX_NBUTTONS 5
struct soc_button_info {
const char *name;
int acpi_index;
unsigned int event_type;
unsigned int event_code;
bool autorepeat;
bool wakeup;
};
/*
* Some of the buttons like volume up/down are auto repeat, while others
* are not. To support both, we register two platform devices, and put
* buttons into them based on whether the key should be auto repeat.
*/
#define BUTTON_TYPES 2
struct soc_button_data {
struct platform_device *children[BUTTON_TYPES];
};
/*
* Get the Nth GPIO number from the ACPI object.
*/
static int soc_button_lookup_gpio(struct device *dev, int acpi_index)
{
struct gpio_desc *desc;
int gpio;
desc = gpiod_get_index(dev, KBUILD_MODNAME, acpi_index);
if (IS_ERR(desc))
return PTR_ERR(desc);
gpio = desc_to_gpio(desc);
gpiod_put(desc);
return gpio;
}
static struct platform_device *
soc_button_device_create(struct pnp_dev *pdev,
const struct soc_button_info *button_info,
bool autorepeat)
{
const struct soc_button_info *info;
struct platform_device *pd;
struct gpio_keys_button *gpio_keys;
struct gpio_keys_platform_data *gpio_keys_pdata;
int n_buttons = 0;
int gpio;
int error;
gpio_keys_pdata = devm_kzalloc(&pdev->dev,
sizeof(*gpio_keys_pdata) +
sizeof(*gpio_keys) * MAX_NBUTTONS,
GFP_KERNEL);
if (!gpio_keys_pdata)
return ERR_PTR(-ENOMEM);
gpio_keys = (void *)(gpio_keys_pdata + 1);
for (info = button_info; info->name; info++) {
if (info->autorepeat != autorepeat)
continue;
gpio = soc_button_lookup_gpio(&pdev->dev, info->acpi_index);
if (gpio < 0)
continue;
gpio_keys[n_buttons].type = info->event_type;
gpio_keys[n_buttons].code = info->event_code;
gpio_keys[n_buttons].gpio = gpio;
gpio_keys[n_buttons].active_low = 1;
gpio_keys[n_buttons].desc = info->name;
gpio_keys[n_buttons].wakeup = info->wakeup;
n_buttons++;
}
if (n_buttons == 0) {
error = -ENODEV;
goto err_free_mem;
}
gpio_keys_pdata->buttons = gpio_keys;
gpio_keys_pdata->nbuttons = n_buttons;
gpio_keys_pdata->rep = autorepeat;
pd = platform_device_alloc("gpio-keys", PLATFORM_DEVID_AUTO);
if (!pd) {
error = -ENOMEM;
goto err_free_mem;
}
error = platform_device_add_data(pd, gpio_keys_pdata,
sizeof(*gpio_keys_pdata));
if (error)
goto err_free_pdev;
error = platform_device_add(pd);
if (error)
goto err_free_pdev;
return pd;
err_free_pdev:
platform_device_put(pd);
err_free_mem:
devm_kfree(&pdev->dev, gpio_keys_pdata);
return ERR_PTR(error);
}
static void soc_button_remove(struct pnp_dev *pdev)
{
struct soc_button_data *priv = pnp_get_drvdata(pdev);
int i;
for (i = 0; i < BUTTON_TYPES; i++)
if (priv->children[i])
platform_device_unregister(priv->children[i]);
}
static int soc_button_pnp_probe(struct pnp_dev *pdev,
const struct pnp_device_id *id)
{
const struct soc_button_info *button_info = (void *)id->driver_data;
struct soc_button_data *priv;
struct platform_device *pd;
int i;
int error;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
pnp_set_drvdata(pdev, priv);
for (i = 0; i < BUTTON_TYPES; i++) {
pd = soc_button_device_create(pdev, button_info, i == 0);
if (IS_ERR(pd)) {
error = PTR_ERR(pd);
if (error != -ENODEV) {
soc_button_remove(pdev);
return error;
}
continue;
}
priv->children[i] = pd;
}
if (!priv->children[0] && !priv->children[1])
return -ENODEV;
return 0;
}
static struct soc_button_info soc_button_PNP0C40[] = {
{ "power", 0, EV_KEY, KEY_POWER, false, true },
{ "home", 1, EV_KEY, KEY_HOME, false, true },
{ "volume_up", 2, EV_KEY, KEY_VOLUMEUP, true, false },
{ "volume_down", 3, EV_KEY, KEY_VOLUMEDOWN, true, false },
{ "rotation_lock", 4, EV_SW, SW_ROTATE_LOCK, false, false },
{ }
};
static const struct pnp_device_id soc_button_pnp_match[] = {
{ .id = "PNP0C40", .driver_data = (long)soc_button_PNP0C40 },
{ .id = "" }
};
MODULE_DEVICE_TABLE(pnp, soc_button_pnp_match);
static struct pnp_driver soc_button_pnp_driver = {
.name = KBUILD_MODNAME,
.id_table = soc_button_pnp_match,
.probe = soc_button_pnp_probe,
.remove = soc_button_remove,
};
static int __init soc_button_init(void)
{
return pnp_register_driver(&soc_button_pnp_driver);
}
static void __exit soc_button_exit(void)
{
pnp_unregister_driver(&soc_button_pnp_driver);
}
module_init(soc_button_init);
module_exit(soc_button_exit);
MODULE_LICENSE("GPL");
|
/*
* Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights
* reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the NetLogic
* license below:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY NETLOGIC ``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 NETLOGIC OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _NLM_HAL_XLP_H
#define _NLM_HAL_XLP_H
#define PIC_UART_0_IRQ 17
#define PIC_UART_1_IRQ 18
#define PIC_PCIE_LINK_0_IRQ 19
#define PIC_PCIE_LINK_1_IRQ 20
#define PIC_PCIE_LINK_2_IRQ 21
#define PIC_PCIE_LINK_3_IRQ 22
#define PIC_EHCI_0_IRQ 23
#define PIC_EHCI_1_IRQ 24
#define PIC_OHCI_0_IRQ 25
#define PIC_OHCI_1_IRQ 26
#define PIC_OHCI_2_IRQ 27
#define PIC_OHCI_3_IRQ 28
#define PIC_2XX_XHCI_0_IRQ 23
#define PIC_2XX_XHCI_1_IRQ 24
#define PIC_2XX_XHCI_2_IRQ 25
#define PIC_MMC_IRQ 29
#define PIC_I2C_0_IRQ 30
#define PIC_I2C_1_IRQ 31
#define PIC_I2C_2_IRQ 32
#define PIC_I2C_3_IRQ 33
#ifndef __ASSEMBLY__
/* SMP support functions */
void xlp_boot_core0_siblings(void);
void xlp_wakeup_secondary_cpus(void);
void xlp_mmu_init(void);
void nlm_hal_init(void);
int xlp_get_dram_map(int n, uint64_t *dram_map);
/* Device tree related */
void *xlp_dt_init(void *fdtp);
static inline int cpu_is_xlpii(void)
{
int chip = read_c0_prid() & 0xff00;
return chip == PRID_IMP_NETLOGIC_XLP2XX;
}
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_NLM_XLP_H */
|
/* XzCrc64.h -- CRC64 calculation
2010-04-16 : Igor Pavlov : Public domain */
#ifndef __XZ_CRC64_H
#define __XZ_CRC64_H
#include <stddef.h>
#include "Types.h"
EXTERN_C_BEGIN
extern UInt64 g_Crc64Table[];
void MY_FAST_CALL Crc64GenerateTable(void);
#define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF)
#define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL)
#define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
UInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size);
UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size);
EXTERN_C_END
#endif
|
/* { dg-do compile } */
/* { dg-options "-mavx512f -O2" } */
/* { dg-final { scan-assembler-times "vpternlogd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vpternlogd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vpternlogd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
#include <immintrin.h>
volatile __m512i x, y, z;
volatile __mmask16 m;
void extern
avx512f_test (void)
{
x = _mm512_ternarylogic_epi32 (x, y, z, 0xF0);
x = _mm512_mask_ternarylogic_epi32 (x, m, y, z, 0xF0);
x = _mm512_maskz_ternarylogic_epi32 (m, x, y, z, 0xF0);
}
|
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef NodeInfo_h
#define NodeInfo_h
#include "Nodes.h"
#include "Parser.h"
namespace JSC {
template <typename T> struct NodeInfo {
T m_node;
CodeFeatures m_features;
int m_numConstants;
};
typedef NodeInfo<FuncDeclNode*> FuncDeclNodeInfo;
typedef NodeInfo<FuncExprNode*> FuncExprNodeInfo;
typedef NodeInfo<ExpressionNode*> ExpressionNodeInfo;
typedef NodeInfo<ArgumentsNode*> ArgumentsNodeInfo;
typedef NodeInfo<ConstDeclNode*> ConstDeclNodeInfo;
typedef NodeInfo<PropertyNode*> PropertyNodeInfo;
typedef NodeInfo<PropertyList> PropertyListInfo;
typedef NodeInfo<ElementList> ElementListInfo;
typedef NodeInfo<ArgumentList> ArgumentListInfo;
template <typename T> struct NodeDeclarationInfo {
T m_node;
ParserArenaData<DeclarationStacks::VarStack>* m_varDeclarations;
ParserArenaData<DeclarationStacks::FunctionStack>* m_funcDeclarations;
CodeFeatures m_features;
int m_numConstants;
};
typedef NodeDeclarationInfo<StatementNode*> StatementNodeInfo;
typedef NodeDeclarationInfo<CaseBlockNode*> CaseBlockNodeInfo;
typedef NodeDeclarationInfo<CaseClauseNode*> CaseClauseNodeInfo;
typedef NodeDeclarationInfo<SourceElements*> SourceElementsInfo;
typedef NodeDeclarationInfo<ClauseList> ClauseListInfo;
typedef NodeDeclarationInfo<ExpressionNode*> VarDeclListInfo;
typedef NodeDeclarationInfo<ConstDeclList> ConstDeclListInfo;
typedef NodeDeclarationInfo<ParameterList> ParameterListInfo;
} // namespace JSC
#endif // NodeInfo_h
|
/* crypto/cpt_err.c */
/* ====================================================================
* Copyright (c) 1999-2011 The OpenSSL Project. 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. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED 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 OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include <openssl/crypto.h>
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_CRYPTO,func,0)
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_CRYPTO,0,reason)
static ERR_STRING_DATA CRYPTO_str_functs[]=
{
{ERR_FUNC(CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX), "CRYPTO_get_ex_new_index"},
{ERR_FUNC(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID), "CRYPTO_get_new_dynlockid"},
{ERR_FUNC(CRYPTO_F_CRYPTO_GET_NEW_LOCKID), "CRYPTO_get_new_lockid"},
{ERR_FUNC(CRYPTO_F_CRYPTO_SET_EX_DATA), "CRYPTO_set_ex_data"},
{ERR_FUNC(CRYPTO_F_DEF_ADD_INDEX), "DEF_ADD_INDEX"},
{ERR_FUNC(CRYPTO_F_DEF_GET_CLASS), "DEF_GET_CLASS"},
{ERR_FUNC(CRYPTO_F_FIPS_MODE_SET), "FIPS_mode_set"},
{ERR_FUNC(CRYPTO_F_INT_DUP_EX_DATA), "INT_DUP_EX_DATA"},
{ERR_FUNC(CRYPTO_F_INT_FREE_EX_DATA), "INT_FREE_EX_DATA"},
{ERR_FUNC(CRYPTO_F_INT_NEW_EX_DATA), "INT_NEW_EX_DATA"},
{0,NULL}
};
static ERR_STRING_DATA CRYPTO_str_reasons[]=
{
{ERR_REASON(CRYPTO_R_FIPS_MODE_NOT_SUPPORTED),"fips mode not supported"},
{ERR_REASON(CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK),"no dynlock create callback"},
{0,NULL}
};
#endif
void ERR_load_CRYPTO_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(CRYPTO_str_functs[0].error) == NULL)
{
ERR_load_strings(0,CRYPTO_str_functs);
ERR_load_strings(0,CRYPTO_str_reasons);
}
#endif
}
|
// Copyright (c) 2011 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <Cocoa/Cocoa.h>
@interface TestAppAppDelegate : NSObject <NSApplicationDelegate> {
NSWindow *window;
}
@property (assign) IBOutlet NSWindow *window;
@end
|
#ifndef BT_DEFAULT_MOTION_STATE_H
#define BT_DEFAULT_MOTION_STATE_H
#include "btMotionState.h"
///The btDefaultMotionState provides a common implementation to synchronize world transforms with offsets.
ATTRIBUTE_ALIGNED16(struct) btDefaultMotionState : public btMotionState
{
btTransform m_graphicsWorldTrans;
btTransform m_centerOfMassOffset;
btTransform m_startWorldTrans;
void* m_userPointer;
BT_DECLARE_ALIGNED_ALLOCATOR();
btDefaultMotionState(const btTransform& startTrans = btTransform::getIdentity(),const btTransform& centerOfMassOffset = btTransform::getIdentity())
: m_graphicsWorldTrans(startTrans),
m_centerOfMassOffset(centerOfMassOffset),
m_startWorldTrans(startTrans),
m_userPointer(0)
{
}
///synchronizes world transform from user to physics
virtual void getWorldTransform(btTransform& centerOfMassWorldTrans ) const
{
centerOfMassWorldTrans = m_graphicsWorldTrans * m_centerOfMassOffset.inverse() ;
}
///synchronizes world transform from physics to user
///Bullet only calls the update of worldtransform for active objects
virtual void setWorldTransform(const btTransform& centerOfMassWorldTrans)
{
m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset;
}
};
#endif //BT_DEFAULT_MOTION_STATE_H
|
/*
* struct flchip definition
*
* Contains information about the location and state of a given flash device
*
* (C) 2000 Red Hat. GPLd.
*
* $Id: flashchip.h,v 1.18 2005/11/07 11:14:54 gleixner Exp $
*
*/
#ifndef __MTD_FLASHCHIP_H__
#define __MTD_FLASHCHIP_H__
/* For spinlocks. sched.h includes spinlock.h from whichever directory it
* happens to be in - so we don't have to care whether we're on 2.2, which
* has asm/spinlock.h, or 2.4, which has linux/spinlock.h
*/
#include <linux/sched.h>
typedef enum {
FL_READY,
FL_STATUS,
FL_CFI_QUERY,
FL_JEDEC_QUERY,
FL_ERASING,
FL_ERASE_SUSPENDING,
FL_ERASE_SUSPENDED,
FL_WRITING,
FL_WRITING_TO_BUFFER,
FL_OTP_WRITE,
FL_WRITE_SUSPENDING,
FL_WRITE_SUSPENDED,
FL_PM_SUSPENDED,
FL_SYNCING,
FL_UNLOADING,
FL_LOCKING,
FL_UNLOCKING,
FL_POINT,
FL_XIP_WHILE_ERASING,
FL_XIP_WHILE_WRITING,
FL_UNKNOWN
} flstate_t;
/* NOTE: confusingly, this can be used to refer to more than one chip at a time,
if they're interleaved. This can even refer to individual partitions on
the same physical chip when present. */
struct flchip {
unsigned long start; /* Offset within the map */
// unsigned long len;
/* We omit len for now, because when we group them together
we insist that they're all of the same size, and the chip size
is held in the next level up. If we get more versatile later,
it'll make it a damn sight harder to find which chip we want from
a given offset, and we'll want to add the per-chip length field
back in.
*/
int ref_point_counter;
flstate_t state;
flstate_t oldstate;
unsigned int write_suspended:1;
unsigned int erase_suspended:1;
unsigned long in_progress_block_addr;
spinlock_t *mutex;
spinlock_t _spinlock; /* We do it like this because sometimes they'll be shared. */
wait_queue_head_t wq; /* Wait on here when we're waiting for the chip
to be ready */
int word_write_time;
int buffer_write_time;
int erase_time;
void *priv;
};
/* This is used to handle contention on write/erase operations
between partitions of the same physical chip. */
struct flchip_shared {
spinlock_t lock;
struct flchip *writing;
struct flchip *erasing;
};
#endif /* __MTD_FLASHCHIP_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 NET_CERT_SCT_STATUS_FLAGS_H_
#define NET_CERT_SCT_STATUS_FLAGS_H_
namespace net {
namespace ct {
// The possible verification statuses for a SignedCertificateTimestamp.
// Note: The numeric values are used within histograms and should not change
// or be re-assigned.
enum SCTVerifyStatus {
// Not a real status, this just prevents a default int value from being
// mis-interpreseted as a valid status.
// Also used to count SCTs that cannot be decoded in the histogram.
SCT_STATUS_NONE = 0,
// The SCT is from an unknown log, so we cannot verify its signature.
SCT_STATUS_LOG_UNKNOWN = 1,
// The SCT is from a known log, but the signature is invalid.
SCT_STATUS_INVALID = 2,
// The SCT is from a known log, and the signature is valid.
SCT_STATUS_OK = 3,
// Used to bound the enum values.
SCT_STATUS_MAX,
};
} // namespace ct
} // namespace net
#endif // NET_CERT_SCT_STATUS_FLAGS_H_
|
/* SPDX-License-Identifier: MIT */
#ifndef __NVKM_FB_RAM_PRIV_H__
#define __NVKM_FB_RAM_PRIV_H__
#include "priv.h"
int nvkm_ram_ctor(const struct nvkm_ram_func *, struct nvkm_fb *,
enum nvkm_ram_type, u64 size, struct nvkm_ram *);
int nvkm_ram_new_(const struct nvkm_ram_func *, struct nvkm_fb *,
enum nvkm_ram_type, u64 size, struct nvkm_ram **);
void nvkm_ram_del(struct nvkm_ram **);
int nvkm_ram_init(struct nvkm_ram *);
extern const struct nvkm_ram_func nv04_ram_func;
int nv50_ram_ctor(const struct nvkm_ram_func *, struct nvkm_fb *,
struct nvkm_ram *);
int gf100_ram_new_(const struct nvkm_ram_func *, struct nvkm_fb *,
struct nvkm_ram **);
int gf100_ram_ctor(const struct nvkm_ram_func *, struct nvkm_fb *,
struct nvkm_ram *);
u32 gf100_ram_probe_fbp(const struct nvkm_ram_func *,
struct nvkm_device *, int, int *);
u32 gf100_ram_probe_fbp_amount(const struct nvkm_ram_func *, u32,
struct nvkm_device *, int, int *);
u32 gf100_ram_probe_fbpa_amount(struct nvkm_device *, int);
int gf100_ram_init(struct nvkm_ram *);
int gf100_ram_calc(struct nvkm_ram *, u32);
int gf100_ram_prog(struct nvkm_ram *);
void gf100_ram_tidy(struct nvkm_ram *);
u32 gf108_ram_probe_fbp_amount(const struct nvkm_ram_func *, u32,
struct nvkm_device *, int, int *);
int gk104_ram_new_(const struct nvkm_ram_func *, struct nvkm_fb *,
struct nvkm_ram **);
void *gk104_ram_dtor(struct nvkm_ram *);
int gk104_ram_init(struct nvkm_ram *);
int gk104_ram_calc(struct nvkm_ram *, u32);
int gk104_ram_prog(struct nvkm_ram *);
void gk104_ram_tidy(struct nvkm_ram *);
u32 gm107_ram_probe_fbp(const struct nvkm_ram_func *,
struct nvkm_device *, int, int *);
u32 gm200_ram_probe_fbp_amount(const struct nvkm_ram_func *, u32,
struct nvkm_device *, int, int *);
/* RAM type-specific MR calculation routines */
int nvkm_sddr2_calc(struct nvkm_ram *);
int nvkm_sddr3_calc(struct nvkm_ram *);
int nvkm_gddr3_calc(struct nvkm_ram *);
int nvkm_gddr5_calc(struct nvkm_ram *, bool nuts);
int nv04_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int nv10_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int nv1a_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int nv20_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int nv40_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int nv41_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int nv44_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int nv49_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int nv4e_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int nv50_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int gt215_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int mcp77_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int gf100_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int gf108_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int gk104_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int gm107_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int gm200_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int gp100_ram_new(struct nvkm_fb *, struct nvkm_ram **);
int ga102_ram_new(struct nvkm_fb *, struct nvkm_ram **);
#endif
|
/*
* arch/arm/include/asm/processor.h
*
* Copyright (C) 1995-1999 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __ASM_ARM_PROCESSOR_H
#define __ASM_ARM_PROCESSOR_H
/*
* Default implementation of macro that returns current
* instruction pointer ("program counter").
*/
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
#ifdef __KERNEL__
#include <asm/hw_breakpoint.h>
#include <asm/ptrace.h>
#include <asm/types.h>
#ifdef __KERNEL__
#define STACK_TOP ((current->personality & ADDR_LIMIT_32BIT) ? \
TASK_SIZE : TASK_SIZE_26)
#define STACK_TOP_MAX TASK_SIZE
#endif
struct debug_info {
#ifdef CONFIG_HAVE_HW_BREAKPOINT
struct perf_event *hbp[ARM_MAX_HBP_SLOTS];
#endif
};
struct thread_struct {
/* fault info */
unsigned long address;
unsigned long trap_no;
unsigned long error_code;
/* debugging */
struct debug_info debug;
};
#define INIT_THREAD { }
#ifdef CONFIG_MMU
#define nommu_start_thread(regs) do { } while (0)
#else
#define nommu_start_thread(regs) regs->ARM_r10 = current->mm->start_data
#endif
#define start_thread(regs,pc,sp) \
({ \
unsigned long *stack = (unsigned long *)sp; \
set_fs(USER_DS); \
memset(regs->uregs, 0, sizeof(regs->uregs)); \
if (current->personality & ADDR_LIMIT_32BIT) \
regs->ARM_cpsr = USR_MODE; \
else \
regs->ARM_cpsr = USR26_MODE; \
if (elf_hwcap & HWCAP_THUMB && pc & 1) \
regs->ARM_cpsr |= PSR_T_BIT; \
regs->ARM_cpsr |= PSR_ENDSTATE; \
regs->ARM_pc = pc & ~1; /* pc */ \
regs->ARM_sp = sp; /* sp */ \
regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
nommu_start_thread(regs); \
})
/* Forward declaration, a strange C thing */
struct task_struct;
/* Free all resources held by a thread. */
extern void release_thread(struct task_struct *);
/* Prepare to copy thread state - unlazy all lazy status */
#define prepare_to_copy(tsk) do { } while (0)
unsigned long get_wchan(struct task_struct *p);
#if __LINUX_ARM_ARCH__ == 6 || defined(CONFIG_ARM_ERRATA_754327)
#define cpu_relax() smp_mb()
#else
#define cpu_relax() barrier()
#endif
/*
* Create a new kernel thread
*/
extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
#define task_pt_regs(p) \
((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
#define KSTK_EIP(tsk) task_pt_regs(tsk)->ARM_pc
#define KSTK_ESP(tsk) task_pt_regs(tsk)->ARM_sp
/*
* Prefetching support - only ARMv5.
*/
#if __LINUX_ARM_ARCH__ >= 5
#define ARCH_HAS_PREFETCH
static inline void prefetch(const void *ptr)
{
__asm__ __volatile__(
"pld\t%a0"
:
: "p" (ptr)
: "cc");
}
#define ARCH_HAS_PREFETCHW
#define prefetchw(ptr) prefetch(ptr)
#define ARCH_HAS_SPINLOCK_PREFETCH
#define spin_lock_prefetch(x) do { } while (0)
#endif
#endif
#endif /* __ASM_ARM_PROCESSOR_H */
|
struct semid_ds {
struct ipc_perm sem_perm;
time_t sem_otime;
time_t __unused1;
time_t sem_ctime;
time_t __unused2;
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned short sem_nsems;
char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
#else
char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
unsigned short sem_nsems;
#endif
time_t __unused3;
time_t __unused4;
};
|
// SPDX-License-Identifier: GPL-2.0
/*
* Device Tree support for MStar/Sigmastar Armv7 SoCs
*
* Copyright (c) 2020 thingy.jp
* Author: Daniel Palmer <daniel@thingy.jp>
*/
#include <linux/init.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/io.h>
/*
* In the u-boot code the area these registers are in is
* called "L3 bridge" and there are register descriptions
* for something in the same area called "AXI".
*
* It's not exactly known what this is but the vendor code
* for both u-boot and linux share calls to "flush the miu pipe".
* This seems to be to force pending CPU writes to memory so that
* the state is right before DMA capable devices try to read
* descriptors and data the CPU has prepared. Without doing this
* ethernet doesn't work reliably for example.
*/
#define MSTARV7_L3BRIDGE_FLUSH 0x14
#define MSTARV7_L3BRIDGE_STATUS 0x40
#define MSTARV7_L3BRIDGE_FLUSH_TRIGGER BIT(0)
#define MSTARV7_L3BRIDGE_STATUS_DONE BIT(12)
#ifdef CONFIG_SMP
#define MSTARV7_CPU1_BOOT_ADDR_HIGH 0x4c
#define MSTARV7_CPU1_BOOT_ADDR_LOW 0x50
#define MSTARV7_CPU1_UNLOCK 0x58
#define MSTARV7_CPU1_UNLOCK_MAGIC 0xbabe
#endif
static void __iomem *l3bridge;
static const char * const mstarv7_board_dt_compat[] __initconst = {
"mstar,infinity",
"mstar,infinity2m",
"mstar,infinity3",
"mstar,mercury5",
NULL,
};
/*
* This may need locking to deal with situations where an interrupt
* happens while we are in here and mb() gets called by the interrupt handler.
*
* The vendor code did have a spin lock but it doesn't seem to be needed and
* removing it hasn't caused any side effects so far.
*
* [writel|readl]_relaxed have to be used here because otherwise
* we'd end up right back in here.
*/
static void mstarv7_mb(void)
{
/* toggle the flush miu pipe fire bit */
writel_relaxed(0, l3bridge + MSTARV7_L3BRIDGE_FLUSH);
writel_relaxed(MSTARV7_L3BRIDGE_FLUSH_TRIGGER, l3bridge
+ MSTARV7_L3BRIDGE_FLUSH);
while (!(readl_relaxed(l3bridge + MSTARV7_L3BRIDGE_STATUS)
& MSTARV7_L3BRIDGE_STATUS_DONE)) {
/* wait for flush to complete */
}
}
#ifdef CONFIG_SMP
static int mstarv7_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
struct device_node *np;
u32 bootaddr = (u32) __pa_symbol(secondary_startup_arm);
void __iomem *smpctrl;
/*
* right now we don't know how to boot anything except
* cpu 1.
*/
if (cpu != 1)
return -EINVAL;
np = of_find_compatible_node(NULL, NULL, "mstar,smpctrl");
smpctrl = of_iomap(np, 0);
if (!smpctrl)
return -ENODEV;
/* set the boot address for the second cpu */
writew(bootaddr & 0xffff, smpctrl + MSTARV7_CPU1_BOOT_ADDR_LOW);
writew((bootaddr >> 16) & 0xffff, smpctrl + MSTARV7_CPU1_BOOT_ADDR_HIGH);
/* unlock the second cpu */
writew(MSTARV7_CPU1_UNLOCK_MAGIC, smpctrl + MSTARV7_CPU1_UNLOCK);
/* and away we go...*/
arch_send_wakeup_ipi_mask(cpumask_of(cpu));
iounmap(smpctrl);
return 0;
}
static const struct smp_operations __initdata mstarv7_smp_ops = {
.smp_boot_secondary = mstarv7_boot_secondary,
};
#endif
static void __init mstarv7_init(void)
{
struct device_node *np;
np = of_find_compatible_node(NULL, NULL, "mstar,l3bridge");
l3bridge = of_iomap(np, 0);
if (l3bridge)
soc_mb = mstarv7_mb;
else
pr_warn("Failed to install memory barrier, DMA will be broken!\n");
}
DT_MACHINE_START(MSTARV7_DT, "MStar/Sigmastar Armv7 (Device Tree)")
.dt_compat = mstarv7_board_dt_compat,
.init_machine = mstarv7_init,
.smp = smp_ops(mstarv7_smp_ops),
MACHINE_END
|
// SPDX-License-Identifier: LGPL-2.1
size_t syscall_arg__scnprintf_pid(char *bf, size_t size, struct syscall_arg *arg)
{
int pid = arg->val;
struct trace *trace = arg->trace;
size_t printed = scnprintf(bf, size, "%d", pid);
struct thread *thread = machine__findnew_thread(trace->host, pid, pid);
if (thread != NULL) {
if (!thread->comm_set)
thread__set_comm_from_proc(thread);
if (thread->comm_set)
printed += scnprintf(bf + printed, size - printed,
" (%s)", thread__comm_str(thread));
thread__put(thread);
}
return printed;
}
|
/* SPDX-License-Identifier: GPL-2.0 */
/******************************************************************************
*
* Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
*
* Modifications for inclusion into the Linux staging tree are
* Copyright(c) 2010 Larry Finger. All rights reserved.
*
* Contact information:
* WLAN FAE <wlanfae@realtek.com>
* Larry Finger <Larry.Finger@lwfinger.net>
*
******************************************************************************/
#ifndef __INC_ETHERNET_H
#define __INC_ETHERNET_H
#define ETHERNET_HEADER_SIZE 14 /*!< Ethernet Header Length*/
#define LLC_HEADER_SIZE 6 /*!< LLC Header Length*/
#endif /* #ifndef __INC_ETHERNET_H */
|
/*
* Copyright (C) 2000, 2001, 2004 MIPS Technologies, Inc.
* Copyright (C) 2001 Ralf Baechle
* Copyright (C) 2010 PMC-Sierra, Inc.
*
* VSMP support for MSP platforms . Derived from malta vsmp support.
*
* This program is free software; you can distribute 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 it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
*/
#include <linux/smp.h>
#include <linux/interrupt.h>
#ifdef CONFIG_MIPS_MT_SMP
#define MIPS_CPU_IPI_RESCHED_IRQ 0 /* SW int 0 for resched */
#define MIPS_CPU_IPI_CALL_IRQ 1 /* SW int 1 for call */
static void ipi_resched_dispatch(void)
{
do_IRQ(MIPS_CPU_IPI_RESCHED_IRQ);
}
static void ipi_call_dispatch(void)
{
do_IRQ(MIPS_CPU_IPI_CALL_IRQ);
}
static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
{
return IRQ_HANDLED;
}
static irqreturn_t ipi_call_interrupt(int irq, void *dev_id)
{
smp_call_function_interrupt();
return IRQ_HANDLED;
}
static struct irqaction irq_resched = {
.handler = ipi_resched_interrupt,
.flags = IRQF_PERCPU,
.name = "IPI_resched"
};
static struct irqaction irq_call = {
.handler = ipi_call_interrupt,
.flags = IRQF_PERCPU,
.name = "IPI_call"
};
void __init arch_init_ipiirq(int irq, struct irqaction *action)
{
setup_irq(irq, action);
irq_set_handler(irq, handle_percpu_irq);
}
void __init msp_vsmp_int_init(void)
{
set_vi_handler(MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch);
set_vi_handler(MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch);
arch_init_ipiirq(MIPS_CPU_IPI_RESCHED_IRQ, &irq_resched);
arch_init_ipiirq(MIPS_CPU_IPI_CALL_IRQ, &irq_call);
}
#endif /* CONFIG_MIPS_MT_SMP */
|
/* { dg-require-effective-target size32plus } */
/* Formerly known as ltrans-2.c */
#define DEBUG 0
#if DEBUG
#include <stdio.h>
#endif
double u[1782225];
static void __attribute__((noinline))
foo (int N, int *res)
{
unsigned int i, j;
double sum = 0;
/* This loop should be converted to a perfect nest and
interchanged. */
for (i = 0; i < N; i++)
{
for (j = 0; j < N; j++)
{
sum = sum + u[i + 1335 * j];
if (j == N - 1)
u[1336 * i] *= 2;
}
}
*res = sum + N + u[1336 * 2] + u[1336];
}
extern void abort ();
int
main (void)
{
int i, j, res;
for (i = 0; i < 1782225; i++)
u[i] = 2;
foo (1335, &res);
#if DEBUG
fprintf (stderr, "res = %d \n", res);
#endif
if (res != 3565793)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
|
/******************************************************************************
*
* Name: acgccex.h - Extra GCC specific defines, etc.
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2016, 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* 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 MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
*/
#ifndef __ACGCCEX_H__
#define __ACGCCEX_H__
/*
* Some versions of gcc implement strchr() with a buggy macro. So,
* undef it here. Prevents error messages of this form (usually from the
* file getopt.c):
*
* error: logical '&&' with non-zero constant will always evaluate as true
*/
#ifdef strchr
#undef strchr
#endif
#endif /* __ACGCCEX_H__ */
|
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
* 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 ARGUMENTS_H
#define ARGUMENTS_H
#include "platform.h"
#include "parse_pins.h"
namespace mbed {
#define RPC_MAX_STRING 128
#define RPC_MAX_ARGS 16
class Arguments {
public:
Arguments(const char* rqs);
template<typename Arg>
Arg getArg(void);
char *obj_name;
char *method_name;
int argc;
char* argv[RPC_MAX_ARGS];
private:
// This copy can be removed if we can assume the request string is
// persistent and writable for the duration of the call
char request[RPC_MAX_STRING];
int index;
char* search_arg(char **arg, char *p, char next_sep);
};
class Reply {
public:
Reply(char* r);
template<typename Data>
void putData(Data d);
private:
void separator(void);
bool first;
char* reply;
};
} // Namespace mbed
#endif
|
/*
* Functions for incremental construction of fcx enabled I/O control blocks.
*
* Copyright IBM Corp. 2008
* Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
*/
#ifndef _ASM_S390_ITCW_H
#define _ASM_S390_ITCW_H _ASM_S390_ITCW_H
#include <linux/types.h>
#include <asm/fcx.h>
#define ITCW_OP_READ 0
#define ITCW_OP_WRITE 1
struct itcw;
struct tcw *itcw_get_tcw(struct itcw *itcw);
size_t itcw_calc_size(int intrg, int max_tidaws, int intrg_max_tidaws);
struct itcw *itcw_init(void *buffer, size_t size, int op, int intrg,
int max_tidaws, int intrg_max_tidaws);
struct dcw *itcw_add_dcw(struct itcw *itcw, u8 cmd, u8 flags, void *cd,
u8 cd_count, u32 count);
struct tidaw *itcw_add_tidaw(struct itcw *itcw, u8 flags, void *addr,
u32 count);
void itcw_set_data(struct itcw *itcw, void *addr, int use_tidal);
void itcw_finalize(struct itcw *itcw);
#endif /* _ASM_S390_ITCW_H */
|
/* Copyright (c) 2011-2012, 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.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/err.h>
#include "qdss.h"
#define tpiu_writel(tpiu, val, off) __raw_writel((val), tpiu.base + off)
#define tpiu_readl(tpiu, off) __raw_readl(tpiu.base + off)
#define TPIU_SUPP_PORTSZ (0x000)
#define TPIU_CURR_PORTSZ (0x004)
#define TPIU_SUPP_TRIGMODES (0x100)
#define TPIU_TRIG_CNTRVAL (0x104)
#define TPIU_TRIG_MULT (0x108)
#define TPIU_SUPP_TESTPATM (0x200)
#define TPIU_CURR_TESTPATM (0x204)
#define TPIU_TEST_PATREPCNTR (0x208)
#define TPIU_FFSR (0x300)
#define TPIU_FFCR (0x304)
#define TPIU_FSYNC_CNTR (0x308)
#define TPIU_EXTCTL_INPORT (0x400)
#define TPIU_EXTCTL_OUTPORT (0x404)
#define TPIU_ITTRFLINACK (0xEE4)
#define TPIU_ITTRFLIN (0xEE8)
#define TPIU_ITATBDATA0 (0xEEC)
#define TPIU_ITATBCTR2 (0xEF0)
#define TPIU_ITATBCTR1 (0xEF4)
#define TPIU_ITATBCTR0 (0xEF8)
#define TPIU_LOCK() \
do { \
mb(); \
tpiu_writel(tpiu, 0x0, CS_LAR); \
} while (0)
#define TPIU_UNLOCK() \
do { \
tpiu_writel(tpiu, CS_UNLOCK_MAGIC, CS_LAR); \
mb(); \
} while (0)
struct tpiu_ctx {
void __iomem *base;
bool enabled;
struct device *dev;
};
static struct tpiu_ctx tpiu;
static void __tpiu_disable(void)
{
TPIU_UNLOCK();
tpiu_writel(tpiu, 0x3000, TPIU_FFCR);
tpiu_writel(tpiu, 0x3040, TPIU_FFCR);
TPIU_LOCK();
}
void tpiu_disable(void)
{
__tpiu_disable();
tpiu.enabled = false;
dev_info(tpiu.dev, "TPIU disabled\n");
}
static int __devinit tpiu_probe(struct platform_device *pdev)
{
int ret;
struct resource *res;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
ret = -EINVAL;
goto err_res;
}
tpiu.base = ioremap_nocache(res->start, resource_size(res));
if (!tpiu.base) {
ret = -EINVAL;
goto err_ioremap;
}
tpiu.dev = &pdev->dev;
dev_info(tpiu.dev, "TPIU initialized\n");
return 0;
err_ioremap:
err_res:
dev_err(tpiu.dev, "TPIU init failed\n");
return ret;
}
static int tpiu_remove(struct platform_device *pdev)
{
if (tpiu.enabled)
tpiu_disable();
iounmap(tpiu.base);
return 0;
}
static struct platform_driver tpiu_driver = {
.probe = tpiu_probe,
.remove = tpiu_remove,
.driver = {
.name = "msm_tpiu",
},
};
int __init tpiu_init(void)
{
return platform_driver_register(&tpiu_driver);
}
void tpiu_exit(void)
{
platform_driver_unregister(&tpiu_driver);
}
|
#ifndef _M68K_SIGNAL_H
#define _M68K_SIGNAL_H
#include <linux/types.h>
/* Avoid too many header ordering problems. */
struct siginfo;
#ifdef __KERNEL__
/* Most things should be clean enough to redefine this at will, if care
is taken to make libc match. */
#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;
#else
/* Here we must cater to libcs that poke about in kernel headers. */
#define NSIG 32
typedef unsigned long sigset_t;
#endif /* __KERNEL__ */
#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
/*
* SA_FLAGS values:
*
* SA_ONSTACK indicates that a registered stack_t will be used.
* 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
#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
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192
#include <asm-generic/signal.h>
#ifdef __KERNEL__
struct old_sigaction {
__sighandler_t sa_handler;
old_sigset_t sa_mask;
unsigned long sa_flags;
__sigrestore_t sa_restorer;
};
struct sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
__sigrestore_t sa_restorer;
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 __user *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
#ifdef __KERNEL__
#include <asm/sigcontext.h>
#define __HAVE_ARCH_SIG_BITOPS
static inline void sigaddset(sigset_t *set, int _sig)
{
asm ("bfset %0{%1,#1}"
: "+od" (*set)
: "id" ((_sig - 1) ^ 31)
: "cc");
}
static inline void sigdelset(sigset_t *set, int _sig)
{
asm ("bfclr %0{%1,#1}"
: "+od" (*set)
: "id" ((_sig - 1) ^ 31)
: "cc");
}
static inline int __const_sigismember(sigset_t *set, int _sig)
{
unsigned long sig = _sig - 1;
return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
}
static inline int __gen_sigismember(sigset_t *set, int _sig)
{
int ret;
asm ("bfextu %1{%2,#1},%0"
: "=d" (ret)
: "od" (*set), "id" ((_sig-1) ^ 31)
: "cc");
return ret;
}
#define sigismember(set,sig) \
(__builtin_constant_p(sig) ? \
__const_sigismember(set,sig) : \
__gen_sigismember(set,sig))
static inline int sigfindinword(unsigned long word)
{
asm ("bfffo %1{#0,#0},%0"
: "=d" (word)
: "d" (word & -word)
: "cc");
return word ^ 31;
}
struct pt_regs;
extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
#endif /* __KERNEL__ */
#endif /* _M68K_SIGNAL_H */
|
/* Copyright (c) 2010, Code Aurora Forum. 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 Code Aurora Forum, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __ASM_ARCH_MSM_TLMM_H
#define __ASM_ARCH_MSM_TLMM_H
#include <linux/types.h>
#include <mach/gpio-tlmm-v1.h>
enum msm_tlmm_hdrive_tgt {
TLMM_HDRV_SDC4_CLK = 0,
TLMM_HDRV_SDC4_CMD,
TLMM_HDRV_SDC4_DATA,
TLMM_HDRV_SDC3_CLK,
TLMM_HDRV_SDC3_CMD,
TLMM_HDRV_SDC3_DATA,
};
enum msm_tlmm_pull_tgt {
TLMM_PULL_SDC4_CMD = 0,
TLMM_PULL_SDC4_DATA,
TLMM_PULL_SDC3_CMD,
TLMM_PULL_SDC3_DATA,
};
void msm_tlmm_set_hdrive(enum msm_tlmm_hdrive_tgt tgt, int drv_str);
void msm_tlmm_set_pull(enum msm_tlmm_pull_tgt tgt, int pull);
#endif
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_GENERIC_ERROR_INJECTION_H
#define _ASM_GENERIC_ERROR_INJECTION_H
#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
enum {
EI_ETYPE_NONE, /* Dummy value for undefined case */
EI_ETYPE_NULL, /* Return NULL if failure */
EI_ETYPE_ERRNO, /* Return -ERRNO if failure */
EI_ETYPE_ERRNO_NULL, /* Return -ERRNO or NULL if failure */
EI_ETYPE_TRUE, /* Return true if failure */
};
struct error_injection_entry {
unsigned long addr;
int etype;
};
struct pt_regs;
#ifdef CONFIG_FUNCTION_ERROR_INJECTION
/*
* Whitelist ganerating macro. Specify functions which can be
* error-injectable using this macro.
*/
#define ALLOW_ERROR_INJECTION(fname, _etype) \
static struct error_injection_entry __used \
__attribute__((__section__("_error_injection_whitelist"))) \
_eil_addr_##fname = { \
.addr = (unsigned long)fname, \
.etype = EI_ETYPE_##_etype, \
};
void override_function_with_return(struct pt_regs *regs);
#else
#define ALLOW_ERROR_INJECTION(fname, _etype)
static inline void override_function_with_return(struct pt_regs *regs) { }
#endif
#endif
#endif /* _ASM_GENERIC_ERROR_INJECTION_H */
|
/*
* Please do not edit this file.
* It was generated using rpcgen.
*/
#ifndef _RUSERS_H_RPCGEN
#define _RUSERS_H_RPCGEN
#include <rpc/rpc.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Find out about remote users
*/
#define RUSERS_MAXUSERLEN 32
#define RUSERS_MAXLINELEN 32
#define RUSERS_MAXHOSTLEN 257
struct rusers_utmp {
char *ut_user;
char *ut_line;
char *ut_host;
int ut_type;
int ut_time;
u_int ut_idle;
};
typedef struct rusers_utmp rusers_utmp;
typedef struct {
u_int utmp_array_len;
rusers_utmp *utmp_array_val;
} utmp_array;
/*
* Values for ut_type field above.
*/
#define RUSERS_EMPTY 0
#define RUSERS_RUN_LVL 1
#define RUSERS_BOOT_TIME 2
#define RUSERS_OLD_TIME 3
#define RUSERS_NEW_TIME 4
#define RUSERS_INIT_PROCESS 5
#define RUSERS_LOGIN_PROCESS 6
#define RUSERS_USER_PROCESS 7
#define RUSERS_DEAD_PROCESS 8
#define RUSERS_ACCOUNTING 9
#ifdef __cplusplus
extern "C" {
#endif
#include <rpc/xdr.h>
/*
* The following structures are used by version 2 of the rusersd protocol.
* They were not developed with rpcgen, so they do not appear as RPCL.
*/
#define RUSERSVERS_IDLE 2
#define RUSERSVERS 3 /* current version */
#define MAXUSERS 100
/*
* This is the structure used in version 2 of the rusersd RPC service.
* It corresponds to the utmp structure for BSD systems.
*/
struct ru_utmp {
char ut_line[8]; /* tty name */
char ut_name[8]; /* user id */
char ut_host[16]; /* host name, if remote */
long int ut_time; /* time on */
};
struct utmparr {
struct ru_utmp **uta_arr;
int uta_cnt;
};
typedef struct utmparr utmparr;
extern bool_t xdr_utmparr (XDR *xdrs, struct utmparr *objp) __THROW;
struct utmpidle {
struct ru_utmp ui_utmp;
unsigned int ui_idle;
};
struct utmpidlearr {
struct utmpidle **uia_arr;
int uia_cnt;
};
extern bool_t xdr_utmpidlearr (XDR *xdrs, struct utmpidlearr *objp) __THROW;
#ifdef __cplusplus
}
#endif
#define RUSERSPROG 100002
#define RUSERSVERS_3 3
#if defined(__STDC__) || defined(__cplusplus)
#define RUSERSPROC_NUM 1
extern int * rusersproc_num_3(void *, CLIENT *);
extern int * rusersproc_num_3_svc(void *, struct svc_req *);
#define RUSERSPROC_NAMES 2
extern utmp_array * rusersproc_names_3(void *, CLIENT *);
extern utmp_array * rusersproc_names_3_svc(void *, struct svc_req *);
#define RUSERSPROC_ALLNAMES 3
extern utmp_array * rusersproc_allnames_3(void *, CLIENT *);
extern utmp_array * rusersproc_allnames_3_svc(void *, struct svc_req *);
extern int rusersprog_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
#else /* K&R C */
#define RUSERSPROC_NUM 1
extern int * rusersproc_num_3();
extern int * rusersproc_num_3_svc();
#define RUSERSPROC_NAMES 2
extern utmp_array * rusersproc_names_3();
extern utmp_array * rusersproc_names_3_svc();
#define RUSERSPROC_ALLNAMES 3
extern utmp_array * rusersproc_allnames_3();
extern utmp_array * rusersproc_allnames_3_svc();
extern int rusersprog_3_freeresult ();
#endif /* K&R C */
/* the xdr functions */
#if defined(__STDC__) || defined(__cplusplus)
extern bool_t xdr_rusers_utmp (XDR *, rusers_utmp*);
extern bool_t xdr_utmp_array (XDR *, utmp_array*);
#else /* K&R C */
extern bool_t xdr_rusers_utmp ();
extern bool_t xdr_utmp_array ();
#endif /* K&R C */
#ifdef __cplusplus
}
#endif
#endif /* !_RUSERS_H_RPCGEN */
|
/* ssl/t1_srvr.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* 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 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 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.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include <stdio.h>
#include "ssl_locl.h"
#include <openssl/buffer.h>
#include <openssl/rand.h>
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
static SSL_METHOD *tls1_get_server_method(int ver);
static SSL_METHOD *tls1_get_server_method(int ver)
{
if (ver == TLS1_VERSION)
return(TLSv1_server_method());
else
return(NULL);
}
IMPLEMENT_tls1_meth_func(TLSv1_server_method,
ssl3_accept,
ssl_undefined_function,
tls1_get_server_method)
|
/*
* Copyright (c) 2008-2009 Patrick McHardy <kaber@trash.net>
*
* 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.
*
* Development of this code funded by Astaro AG (http://www.astaro.com/)
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/netlink.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nf_tables.h>
#include <net/netfilter/nf_tables_core.h>
#include <net/netfilter/nf_tables.h>
static void nft_payload_eval(const struct nft_expr *expr,
struct nft_regs *regs,
const struct nft_pktinfo *pkt)
{
const struct nft_payload *priv = nft_expr_priv(expr);
const struct sk_buff *skb = pkt->skb;
u32 *dest = ®s->data[priv->dreg];
int offset;
switch (priv->base) {
case NFT_PAYLOAD_LL_HEADER:
if (!skb_mac_header_was_set(skb))
goto err;
offset = skb_mac_header(skb) - skb->data;
break;
case NFT_PAYLOAD_NETWORK_HEADER:
offset = skb_network_offset(skb);
break;
case NFT_PAYLOAD_TRANSPORT_HEADER:
offset = pkt->xt.thoff;
break;
default:
BUG();
}
offset += priv->offset;
dest[priv->len / NFT_REG32_SIZE] = 0;
if (skb_copy_bits(skb, offset, dest, priv->len) < 0)
goto err;
return;
err:
regs->verdict.code = NFT_BREAK;
}
static const struct nla_policy nft_payload_policy[NFTA_PAYLOAD_MAX + 1] = {
[NFTA_PAYLOAD_DREG] = { .type = NLA_U32 },
[NFTA_PAYLOAD_BASE] = { .type = NLA_U32 },
[NFTA_PAYLOAD_OFFSET] = { .type = NLA_U32 },
[NFTA_PAYLOAD_LEN] = { .type = NLA_U32 },
};
static int nft_payload_init(const struct nft_ctx *ctx,
const struct nft_expr *expr,
const struct nlattr * const tb[])
{
struct nft_payload *priv = nft_expr_priv(expr);
priv->base = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_BASE]));
priv->offset = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_OFFSET]));
priv->len = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_LEN]));
priv->dreg = nft_parse_register(tb[NFTA_PAYLOAD_DREG]);
return nft_validate_register_store(ctx, priv->dreg, NULL,
NFT_DATA_VALUE, priv->len);
}
static int nft_payload_dump(struct sk_buff *skb, const struct nft_expr *expr)
{
const struct nft_payload *priv = nft_expr_priv(expr);
if (nft_dump_register(skb, NFTA_PAYLOAD_DREG, priv->dreg) ||
nla_put_be32(skb, NFTA_PAYLOAD_BASE, htonl(priv->base)) ||
nla_put_be32(skb, NFTA_PAYLOAD_OFFSET, htonl(priv->offset)) ||
nla_put_be32(skb, NFTA_PAYLOAD_LEN, htonl(priv->len)))
goto nla_put_failure;
return 0;
nla_put_failure:
return -1;
}
static struct nft_expr_type nft_payload_type;
static const struct nft_expr_ops nft_payload_ops = {
.type = &nft_payload_type,
.size = NFT_EXPR_SIZE(sizeof(struct nft_payload)),
.eval = nft_payload_eval,
.init = nft_payload_init,
.dump = nft_payload_dump,
};
const struct nft_expr_ops nft_payload_fast_ops = {
.type = &nft_payload_type,
.size = NFT_EXPR_SIZE(sizeof(struct nft_payload)),
.eval = nft_payload_eval,
.init = nft_payload_init,
.dump = nft_payload_dump,
};
static const struct nft_expr_ops *
nft_payload_select_ops(const struct nft_ctx *ctx,
const struct nlattr * const tb[])
{
enum nft_payload_bases base;
unsigned int offset, len;
if (tb[NFTA_PAYLOAD_DREG] == NULL ||
tb[NFTA_PAYLOAD_BASE] == NULL ||
tb[NFTA_PAYLOAD_OFFSET] == NULL ||
tb[NFTA_PAYLOAD_LEN] == NULL)
return ERR_PTR(-EINVAL);
base = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_BASE]));
switch (base) {
case NFT_PAYLOAD_LL_HEADER:
case NFT_PAYLOAD_NETWORK_HEADER:
case NFT_PAYLOAD_TRANSPORT_HEADER:
break;
default:
return ERR_PTR(-EOPNOTSUPP);
}
offset = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_OFFSET]));
len = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_LEN]));
if (len <= 4 && is_power_of_2(len) && IS_ALIGNED(offset, len) &&
base != NFT_PAYLOAD_LL_HEADER)
return &nft_payload_fast_ops;
else
return &nft_payload_ops;
}
static struct nft_expr_type nft_payload_type __read_mostly = {
.name = "payload",
.select_ops = nft_payload_select_ops,
.policy = nft_payload_policy,
.maxattr = NFTA_PAYLOAD_MAX,
.owner = THIS_MODULE,
};
int __init nft_payload_module_init(void)
{
return nft_register_expr(&nft_payload_type);
}
void nft_payload_module_exit(void)
{
nft_unregister_expr(&nft_payload_type);
}
|
/* Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora Forum nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* Alternatively, provided that this notice is retained in full, this software
* may be relicensed by the recipient under the terms of the GNU General Public
* License version 2 ("GPL") and only version 2, in which case the provisions of
* the GPL apply INSTEAD OF those given above. If the recipient relicenses the
* software under the GPL, then the identification text in the MODULE_LICENSE
* macro must be changed to reflect "GPLv2" instead of "Dual BSD/GPL". Once a
* recipient changes the license terms to the GPL, subsequent recipients shall
* not relicense under alternate licensing terms, including the BSD or dual
* BSD/GPL terms. In addition, the following license statement immediately
* below and between the words START and END shall also then apply when this
* software is relicensed under the GPL:
*
* START
*
* 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.
*
* END
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <mach/internal_power_rail.h>
#include "proc_comm.h"
static DEFINE_SPINLOCK(power_rail_lock);
static struct internal_rail {
uint32_t id;
uint32_t mode;
} rails[] = {
{ PWR_RAIL_GRP_CLK, PWR_RAIL_CTL_AUTO },
{ PWR_RAIL_GRP_2D_CLK, PWR_RAIL_CTL_AUTO },
{ PWR_RAIL_MFC_CLK, PWR_RAIL_CTL_AUTO },
{ PWR_RAIL_ROTATOR_CLK, PWR_RAIL_CTL_AUTO },
{ PWR_RAIL_VDC_CLK, PWR_RAIL_CTL_AUTO },
{ PWR_RAIL_VFE_CLK, PWR_RAIL_CTL_AUTO },
{ PWR_RAIL_VPE_CLK, PWR_RAIL_CTL_AUTO },
};
static struct internal_rail *find_rail(unsigned rail_id)
{
int i;
for (i = 0; i < ARRAY_SIZE(rails); i++)
if (rails[i].id == rail_id)
return rails + i;
return NULL;
}
/* Enable or disable an internal power rail */
int internal_pwr_rail_ctl(unsigned rail_id, bool enable)
{
int cmd, rc;
cmd = enable ? PCOM_CLKCTL_RPC_RAIL_ENABLE :
PCOM_CLKCTL_RPC_RAIL_DISABLE;
rc = msm_proc_comm(cmd, &rail_id, NULL);
return rc;
}
EXPORT_SYMBOL(internal_pwr_rail_ctl);
/* Enable or disable a rail if the rail is in auto mode. */
int internal_pwr_rail_ctl_auto(unsigned rail_id, bool enable)
{
int rc = 0;
unsigned long flags;
struct internal_rail *rail = find_rail(rail_id);
BUG_ON(!rail);
spin_lock_irqsave(&power_rail_lock, flags);
if (rail->mode == PWR_RAIL_CTL_AUTO)
rc = internal_pwr_rail_ctl(rail_id, enable);
spin_unlock_irqrestore(&power_rail_lock, flags);
return rc;
}
/* Specify an internal power rail control mode (ex. auto, manual) */
int internal_pwr_rail_mode(unsigned rail_id, enum rail_ctl_mode mode)
{
int rc;
unsigned long flags;
struct internal_rail *rail = find_rail(rail_id);
spin_lock_irqsave(&power_rail_lock, flags);
rc = msm_proc_comm(PCOM_CLKCTL_RPC_RAIL_CONTROL, &rail_id, &mode);
if (rc)
goto out;
if (rail_id) {
rc = -EINVAL;
goto out;
}
if (rail)
rail->mode = mode;
out:
spin_unlock_irqrestore(&power_rail_lock, flags);
return rc;
}
EXPORT_SYMBOL(internal_pwr_rail_mode);
|
/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_PERIPHERAL_LOADER_H
#define __MSM_PERIPHERAL_LOADER_H
#include <linux/dma-attrs.h>
struct device;
struct module;
struct pil_priv;
/**
* struct pil_desc - PIL descriptor
* @name: string used for pil_get()
* @dev: parent device
* @ops: callback functions
* @owner: module the descriptor belongs to
* @proxy_timeout: delay in ms until proxy vote is removed
* @flags: bitfield for image flags
* @priv: DON'T USE - internal only
* @attrs: DMA attributes to be used during dma allocation.
* @proxy_unvote_irq: IRQ to trigger a proxy unvote. proxy_timeout
* is ignored if this is set.
* @map_fw_mem: Custom function used to map physical address space to virtual.
* This defaults to ioremap if not specified.
* @unmap_fw_mem: Custom function used to undo mapping by map_fw_mem.
* This defaults to iounmap if not specified.
*/
struct pil_desc {
const char *name;
struct device *dev;
const struct pil_reset_ops *ops;
struct module *owner;
unsigned long proxy_timeout;
unsigned long flags;
#define PIL_SKIP_ENTRY_CHECK BIT(0)
struct pil_priv *priv;
struct dma_attrs attrs;
unsigned int proxy_unvote_irq;
void * (*map_fw_mem)(phys_addr_t phys, size_t size, void *data);
void (*unmap_fw_mem)(void *virt, size_t size, void *data);
void *map_data;
};
/**
* struct pil_image_info - info in IMEM about image and where it is loaded
* @name: name of image (may or may not be NULL terminated)
* @start: indicates physical address where image starts (little endian)
* @size: size of image (little endian)
*/
struct pil_image_info {
char name[8];
__le64 start;
__le32 size;
} __attribute__((__packed__));
/**
* struct pil_reset_ops - PIL operations
* @init_image: prepare an image for authentication
* @mem_setup: prepare the image memory region
* @verify_blob: authenticate a program segment, called once for each loadable
* program segment (optional)
* @proxy_vote: make proxy votes before auth_and_reset (optional)
* @auth_and_reset: boot the processor
* @proxy_unvote: remove any proxy votes (optional)
* @deinit_image: restore actions performed in init_image if necessary
* @shutdown: shutdown the processor
*/
struct pil_reset_ops {
int (*init_image)(struct pil_desc *pil, const u8 *metadata,
size_t size);
int (*mem_setup)(struct pil_desc *pil, phys_addr_t addr, size_t size);
int (*verify_blob)(struct pil_desc *pil, phys_addr_t phy_addr,
size_t size);
int (*proxy_vote)(struct pil_desc *pil);
int (*auth_and_reset)(struct pil_desc *pil);
void (*proxy_unvote)(struct pil_desc *pil);
int (*deinit_image)(struct pil_desc *pil);
int (*shutdown)(struct pil_desc *pil);
};
#ifdef CONFIG_MSM_PIL
extern int pil_desc_init(struct pil_desc *desc);
extern int pil_boot(struct pil_desc *desc);
extern void pil_shutdown(struct pil_desc *desc);
extern void pil_free_memory(struct pil_desc *desc);
extern void pil_desc_release(struct pil_desc *desc);
extern phys_addr_t pil_get_entry_addr(struct pil_desc *desc);
extern int pil_do_ramdump(struct pil_desc *desc, void *ramdump_dev);
#else
static inline int pil_desc_init(struct pil_desc *desc) { return 0; }
static inline int pil_boot(struct pil_desc *desc) { return 0; }
static inline void pil_shutdown(struct pil_desc *desc) { }
static inline void pil_free_memory(struct pil_desc *desc) { }
static inline void pil_desc_release(struct pil_desc *desc) { }
static inline phys_addr_t pil_get_entry_addr(struct pil_desc *desc)
{
return 0;
}
static inline int pil_do_ramdump(struct pil_desc *desc, void *ramdump_dev)
{
return 0;
}
#endif
#endif
|
/*
* key.c
*
* key usage limits enforcement
*
* David A. Mcgrew
* Cisco Systems, Inc.
*/
/*
*
* Copyright (c) 2001-2006 Cisco Systems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "key.h"
#define soft_limit 0x10000
err_status_t
key_limit_set(key_limit_t key, const xtd_seq_num_t s) {
#ifdef NO_64BIT_MATH
if (high32(s) == 0 && low32(s) < soft_limit)
return err_status_bad_param;
#else
if (s < soft_limit)
return err_status_bad_param;
#endif
key->num_left = s;
key->state = key_state_normal;
return err_status_ok;
}
err_status_t
key_limit_clone(key_limit_t original, key_limit_t *new_key) {
if (original == NULL)
return err_status_bad_param;
*new_key = original;
return err_status_ok;
}
err_status_t
key_limit_check(const key_limit_t key) {
if (key->state == key_state_expired)
return err_status_key_expired;
return err_status_ok;
}
key_event_t
key_limit_update(key_limit_t key) {
#ifdef NO_64BIT_MATH
if (low32(key->num_left) == 0)
{
// carry
key->num_left = make64(high32(key->num_left)-1,low32(key->num_left) - 1);
}
else
{
// no carry
key->num_left = make64(high32(key->num_left),low32(key->num_left) - 1);
}
if (high32(key->num_left) != 0 || low32(key->num_left) >= soft_limit) {
return key_event_normal; /* we're above the soft limit */
}
#else
key->num_left--;
if (key->num_left >= soft_limit) {
return key_event_normal; /* we're above the soft limit */
}
#endif
if (key->state == key_state_normal) {
/* we just passed the soft limit, so change the state */
key->state = key_state_past_soft_limit;
}
#ifdef NO_64BIT_MATH
if (low32(key->num_left) == 0 && high32(key->num_left == 0))
#else
if (key->num_left < 1)
#endif
{ /* we just hit the hard limit */
key->state = key_state_expired;
return key_event_hard_limit;
}
return key_event_soft_limit;
}
|
/* crypto/des/str2key.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* 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 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 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.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include "des_locl.h"
#include <openssl/crypto.h>
void DES_string_to_key(const char *str, DES_cblock *key)
{
DES_key_schedule ks;
int i,length;
register unsigned char j;
memset(key,0,8);
length=strlen(str);
#ifdef OLD_STR_TO_KEY
for (i=0; i<length; i++)
(*key)[i%8]^=(str[i]<<1);
#else /* MIT COMPATIBLE */
for (i=0; i<length; i++)
{
j=str[i];
if ((i%16) < 8)
(*key)[i%8]^=(j<<1);
else
{
/* Reverse the bit order 05/05/92 eay */
j=((j<<4)&0xf0)|((j>>4)&0x0f);
j=((j<<2)&0xcc)|((j>>2)&0x33);
j=((j<<1)&0xaa)|((j>>1)&0x55);
(*key)[7-(i%8)]^=j;
}
}
#endif
DES_set_odd_parity(key);
#ifdef EXPERIMENTAL_STR_TO_STRONG_KEY
if(DES_is_weak_key(key))
(*key)[7] ^= 0xF0;
DES_set_key(key,&ks);
#else
DES_set_key_unchecked(key,&ks);
#endif
DES_cbc_cksum((const unsigned char*)str,key,length,&ks,key);
OPENSSL_cleanse(&ks,sizeof(ks));
DES_set_odd_parity(key);
}
void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2)
{
DES_key_schedule ks;
int i,length;
register unsigned char j;
memset(key1,0,8);
memset(key2,0,8);
length=strlen(str);
#ifdef OLD_STR_TO_KEY
if (length <= 8)
{
for (i=0; i<length; i++)
{
(*key2)[i]=(*key1)[i]=(str[i]<<1);
}
}
else
{
for (i=0; i<length; i++)
{
if ((i/8)&1)
(*key2)[i%8]^=(str[i]<<1);
else
(*key1)[i%8]^=(str[i]<<1);
}
}
#else /* MIT COMPATIBLE */
for (i=0; i<length; i++)
{
j=str[i];
if ((i%32) < 16)
{
if ((i%16) < 8)
(*key1)[i%8]^=(j<<1);
else
(*key2)[i%8]^=(j<<1);
}
else
{
j=((j<<4)&0xf0)|((j>>4)&0x0f);
j=((j<<2)&0xcc)|((j>>2)&0x33);
j=((j<<1)&0xaa)|((j>>1)&0x55);
if ((i%16) < 8)
(*key1)[7-(i%8)]^=j;
else
(*key2)[7-(i%8)]^=j;
}
}
if (length <= 8) memcpy(key2,key1,8);
#endif
DES_set_odd_parity(key1);
DES_set_odd_parity(key2);
#ifdef EXPERIMENTAL_STR_TO_STRONG_KEY
if(DES_is_weak_key(key1))
(*key1)[7] ^= 0xF0;
DES_set_key(key1,&ks);
#else
DES_set_key_unchecked(key1,&ks);
#endif
DES_cbc_cksum((const unsigned char*)str,key1,length,&ks,key1);
#ifdef EXPERIMENTAL_STR_TO_STRONG_KEY
if(DES_is_weak_key(key2))
(*key2)[7] ^= 0xF0;
DES_set_key(key2,&ks);
#else
DES_set_key_unchecked(key2,&ks);
#endif
DES_cbc_cksum((const unsigned char*)str,key2,length,&ks,key2);
OPENSSL_cleanse(&ks,sizeof(ks));
DES_set_odd_parity(key1);
DES_set_odd_parity(key2);
}
|
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef MDSS_DEBUG_H
#define MDSS_DEBUG_H
#include <stdarg.h>
#include "mdss.h"
#define MISR_POLL_SLEEP 2000
#define MISR_POLL_TIMEOUT 32000
#define MISR_CRC_BATCH_CFG 0x101
#define DATA_LIMITER (-1)
#define XLOG_TOUT_DATA_LIMITER (NULL)
#define XLOG_FUNC_ENTRY 0x1111
#define XLOG_FUNC_EXIT 0x2222
#define MDSS_REG_BLOCK_NAME_LEN (5)
#define MDSS_XLOG(...) mdss_xlog(__func__, ##__VA_ARGS__, DATA_LIMITER)
#define MDSS_XLOG_TOUT_HANDLER(...) \
mdss_xlog_tout_handler(__func__, ##__VA_ARGS__, XLOG_TOUT_DATA_LIMITER)
#ifdef CONFIG_DEBUG_FS
struct mdss_debug_base {
struct mdss_debug_data *mdd;
char name[80];
void __iomem *base;
size_t off;
size_t cnt;
size_t max_offset;
char *buf;
size_t buf_len;
struct list_head head;
};
struct debug_log {
struct dentry *xlog;
u32 xlog_enable;
u32 panic_on_err;
u32 enable_reg_dump;
};
struct mdss_debug_data {
struct dentry *root;
struct list_head base_list;
struct debug_log logd;
};
int mdss_debugfs_init(struct mdss_data_type *mdata);
int mdss_debugfs_remove(struct mdss_data_type *mdata);
int mdss_debug_register_base(const char *name, void __iomem *base,
size_t max_offset);
int mdss_misr_set(struct mdss_data_type *mdata, struct mdp_misr *req,
struct mdss_mdp_ctl *ctl);
int mdss_misr_get(struct mdss_data_type *mdata, struct mdp_misr *resp,
struct mdss_mdp_ctl *ctl);
void mdss_misr_crc_collect(struct mdss_data_type *mdata, int block_id);
int mdss_create_xlog_debug(struct mdss_debug_data *mdd);
void mdss_xlog(const char *name, ...);
void mdss_xlog_dump(void);
void mdss_dump_reg(char __iomem *base, int len);
void mdss_dsi_debug_check_te(struct mdss_panel_data *pdata);
void mdss_xlog_tout_handler(const char *name, ...);
#else
static inline int mdss_debugfs_init(struct mdss_data_type *mdata) { return 0; }
static inline int mdss_debugfs_remove(struct mdss_data_type *mdata)
{ return 0; }
static inline int mdss_debug_register_base(const char *name, void __iomem *base,
size_t max_offset) { return 0; }
static inline int mdss_misr_set(struct mdss_data_type *mdata,
struct mdp_misr *req,
struct mdss_mdp_ctl *ctl)
{ return 0; }
static inline int mdss_misr_get(struct mdss_data_type *mdata,
struct mdp_misr *resp,
struct mdss_mdp_ctl *ctl)
{ return 0; }
static inline void mdss_misr_crc_collect(struct mdss_data_type *mdata,
int block_id) { }
static inline int create_xlog_debug(struct mdss_data_type *mdata) { }
static inline void mdss_xlog(const char *name, ...) { }
static inline void mdss_xlog_dump(void) { }
static inline void mdss_dump_reg(char __iomem *base, int len) { }
static inline void mdss_dsi_debug_check_te(struct mdss_panel_data *pdata) { }
static inline void mdss_xlog_tout_handler(const char *name, ...) { }
#endif
#endif /* MDSS_DEBUG_H */
|
/*
* NAND Flash Controller Device Driver for DT
*
* Copyright © 2011, Picochip.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/slab.h>
#include "denali.h"
struct denali_dt {
struct denali_nand_info denali;
struct clk *clk;
};
static void __iomem *request_and_map(struct device *dev,
const struct resource *res)
{
void __iomem *ptr;
if (!devm_request_mem_region(dev, res->start, resource_size(res),
"denali-dt")) {
dev_err(dev, "unable to request %s\n", res->name);
return NULL;
}
ptr = devm_ioremap_nocache(dev, res->start, resource_size(res));
if (!res)
dev_err(dev, "ioremap_nocache of %s failed!", res->name);
return ptr;
}
static const struct of_device_id denali_nand_dt_ids[] = {
{ .compatible = "denali,denali-nand-dt" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, denali_nand_dt_ids);
static u64 denali_dma_mask;
static int denali_dt_probe(struct platform_device *ofdev)
{
struct resource *denali_reg, *nand_data;
struct denali_dt *dt;
struct denali_nand_info *denali;
int ret;
const struct of_device_id *of_id;
of_id = of_match_device(denali_nand_dt_ids, &ofdev->dev);
if (of_id) {
ofdev->id_entry = of_id->data;
} else {
pr_err("Failed to find the right device id.\n");
return -ENOMEM;
}
dt = devm_kzalloc(&ofdev->dev, sizeof(*dt), GFP_KERNEL);
if (!dt)
return -ENOMEM;
denali = &dt->denali;
denali_reg = platform_get_resource_byname(ofdev, IORESOURCE_MEM, "denali_reg");
nand_data = platform_get_resource_byname(ofdev, IORESOURCE_MEM, "nand_data");
if (!denali_reg || !nand_data) {
dev_err(&ofdev->dev, "resources not completely defined\n");
return -EINVAL;
}
denali->platform = DT;
denali->dev = &ofdev->dev;
denali->irq = platform_get_irq(ofdev, 0);
if (denali->irq < 0) {
dev_err(&ofdev->dev, "no irq defined\n");
return -ENXIO;
}
denali->flash_reg = request_and_map(&ofdev->dev, denali_reg);
if (!denali->flash_reg)
return -ENOMEM;
denali->flash_mem = request_and_map(&ofdev->dev, nand_data);
if (!denali->flash_mem)
return -ENOMEM;
if (!of_property_read_u32(ofdev->dev.of_node,
"dma-mask", (u32 *)&denali_dma_mask)) {
denali->dev->dma_mask = &denali_dma_mask;
} else {
denali->dev->dma_mask = NULL;
}
dt->clk = clk_get(&ofdev->dev, NULL);
if (IS_ERR(dt->clk)) {
dev_err(&ofdev->dev, "no clk available\n");
return PTR_ERR(dt->clk);
}
clk_prepare_enable(dt->clk);
ret = denali_init(denali);
if (ret)
goto out_disable_clk;
platform_set_drvdata(ofdev, dt);
return 0;
out_disable_clk:
clk_disable_unprepare(dt->clk);
clk_put(dt->clk);
return ret;
}
static int denali_dt_remove(struct platform_device *ofdev)
{
struct denali_dt *dt = platform_get_drvdata(ofdev);
denali_remove(&dt->denali);
clk_disable(dt->clk);
clk_put(dt->clk);
return 0;
}
static struct platform_driver denali_dt_driver = {
.probe = denali_dt_probe,
.remove = denali_dt_remove,
.driver = {
.name = "denali-nand-dt",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(denali_nand_dt_ids),
},
};
static int __init denali_init_dt(void)
{
return platform_driver_register(&denali_dt_driver);
}
module_init(denali_init_dt);
static void __exit denali_exit_dt(void)
{
platform_driver_unregister(&denali_dt_driver);
}
module_exit(denali_exit_dt);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Jamie Iles");
MODULE_DESCRIPTION("DT driver for Denali NAND controller");
|
/******************************************************************************
*
* Name: acgcc.h - GCC specific defines, etc.
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2016, 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* 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 MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
*/
#ifndef __ACGCC_H__
#define __ACGCC_H__
#define ACPI_INLINE __inline__
/* Function name is used for debug output. Non-ANSI, compiler-dependent */
#define ACPI_GET_FUNCTION_NAME __func__
/*
* This macro is used to tag functions as "printf-like" because
* some compilers (like GCC) can catch printf format string problems.
*/
#define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1)))
/*
* Some compilers complain about unused variables. Sometimes we don't want to
* use all the variables (for example, _acpi_module_name). This allows us
* to tell the compiler warning in a per-variable manner that a variable
* is unused.
*/
#define ACPI_UNUSED_VAR __attribute__ ((unused))
/*
* Some versions of gcc implement strchr() with a buggy macro. So,
* undef it here. Prevents error messages of this form (usually from the
* file getopt.c):
*
* error: logical '&&' with non-zero constant will always evaluate as true
*/
#ifdef strchr
#undef strchr
#endif
/* GCC supports __VA_ARGS__ in macros */
#define COMPILER_VA_MACRO 1
#endif /* __ACGCC_H__ */
|
/*
* QEMU System Emulator
*
* Copyright (c) 2003-2008 Fabrice Bellard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config-host.h"
#include <libvdeplug.h>
#include "net/net.h"
#include "clients.h"
#include "qemu-common.h"
#include "qemu/option.h"
#include "qemu/main-loop.h"
typedef struct VDEState {
NetClientState nc;
VDECONN *vde;
} VDEState;
static void vde_to_qemu(void *opaque)
{
VDEState *s = opaque;
uint8_t buf[NET_BUFSIZE];
int size;
size = vde_recv(s->vde, (char *)buf, sizeof(buf), 0);
if (size > 0) {
qemu_send_packet(&s->nc, buf, size);
}
}
static ssize_t vde_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
VDEState *s = DO_UPCAST(VDEState, nc, nc);
ssize_t ret;
do {
ret = vde_send(s->vde, (const char *)buf, size, 0);
} while (ret < 0 && errno == EINTR);
return ret;
}
static void vde_cleanup(NetClientState *nc)
{
VDEState *s = DO_UPCAST(VDEState, nc, nc);
qemu_set_fd_handler(vde_datafd(s->vde), NULL, NULL, NULL);
vde_close(s->vde);
}
static NetClientInfo net_vde_info = {
.type = NET_CLIENT_OPTIONS_KIND_VDE,
.size = sizeof(VDEState),
.receive = vde_receive,
.cleanup = vde_cleanup,
};
static int net_vde_init(NetClientState *peer, const char *model,
const char *name, const char *sock,
int port, const char *group, int mode)
{
NetClientState *nc;
VDEState *s;
VDECONN *vde;
char *init_group = (char *)group;
char *init_sock = (char *)sock;
struct vde_open_args args = {
.port = port,
.group = init_group,
.mode = mode,
};
vde = vde_open(init_sock, (char *)"QEMU", &args);
if (!vde){
return -1;
}
nc = qemu_new_net_client(&net_vde_info, peer, model, name);
snprintf(nc->info_str, sizeof(nc->info_str), "sock=%s,fd=%d",
sock, vde_datafd(vde));
s = DO_UPCAST(VDEState, nc, nc);
s->vde = vde;
qemu_set_fd_handler(vde_datafd(s->vde), vde_to_qemu, NULL, s);
return 0;
}
int net_init_vde(const NetClientOptions *opts, const char *name,
NetClientState *peer)
{
const NetdevVdeOptions *vde;
assert(opts->kind == NET_CLIENT_OPTIONS_KIND_VDE);
vde = opts->vde;
/* missing optional values have been initialized to "all bits zero" */
if (net_vde_init(peer, "vde", name, vde->sock, vde->port, vde->group,
vde->has_mode ? vde->mode : 0700) == -1) {
return -1;
}
return 0;
}
|
/*
* Copyright © 2006 Red Hat, Inc.
*
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Author: Carl D. Worth <cworth@cworth.org>
*/
#include "cairo-perf.h"
/* This test case is designed to illustrate a performance bug that
* exists in cairo in which using cairo_stroke is much slower than
* cairo_fill to draw an identical figure, (and in particular a figure
* that is much more natural to draw with cairo_stroke). The figure is
* a 100x100 square outline 1-pixel wide, nicely pixel aligned.
*
* The performance bug should affect any path whose resulting contour
* consists only of pixel-aligned horizontal and vertical elements.
*
* Initial testing on on machine shows stroke as 5x slower than fill
* for the xlib backend and 16x slower for the image backend.
*/
static cairo_perf_ticks_t
box_outline_stroke (cairo_t *cr, int width, int height, int loops)
{
cairo_set_source_rgb (cr, 0, 0, 1); /* blue */
cairo_paint (cr);
cairo_rectangle (cr,
1.5, 1.5,
width - 3, height - 3);
cairo_set_line_width (cr, 1.0);
cairo_set_source_rgb (cr, 1, 0, 0); /* red */
cairo_perf_timer_start ();
while (loops--)
cairo_stroke_preserve (cr);
cairo_perf_timer_stop ();
cairo_new_path (cr);
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
box_outline_fill (cairo_t *cr, int width, int height, int loops)
{
cairo_set_source_rgb (cr, 0, 0, 1); /* blue */
cairo_paint (cr);
cairo_rectangle (cr,
1.0, 1.0,
width - 2, height - 2);
cairo_rectangle (cr,
2.0, 2.0,
width - 4, height - 4);
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_source_rgb (cr, 0, 1, 0); /* green */
cairo_perf_timer_start ();
while (loops--)
cairo_fill_preserve (cr);
cairo_perf_timer_stop ();
cairo_new_path (cr);
return cairo_perf_timer_elapsed ();
}
void
box_outline (cairo_perf_t *perf, cairo_t *cr, int width, int height)
{
if (! cairo_perf_can_run (perf, "box-outline", NULL))
return;
cairo_perf_run (perf, "box-outline-stroke", box_outline_stroke, NULL);
cairo_perf_run (perf, "box-outline-fill", box_outline_fill, NULL);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.