text stringlengths 4 6.14k |
|---|
#ifndef COMPAT56_H_INCLUDED
#define COMPAT56_H_INCLUDED
/*
Copyright (c) 2004, 2012, Oracle and/or its affiliates.
Copyright (c) 2013 MariaDB Foundation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/** MySQL56 routines and macros **/
#define MY_PACKED_TIME_GET_INT_PART(x) ((x) >> 24)
#define MY_PACKED_TIME_GET_FRAC_PART(x) ((x) % (1LL << 24))
#define MY_PACKED_TIME_MAKE(i, f) ((((longlong) (i)) << 24) + (f))
#define MY_PACKED_TIME_MAKE_INT(i) ((((longlong) (i)) << 24))
longlong TIME_to_longlong_datetime_packed(const MYSQL_TIME *);
longlong TIME_to_longlong_time_packed(const MYSQL_TIME *);
void TIME_from_longlong_datetime_packed(MYSQL_TIME *ltime, longlong nr);
void TIME_from_longlong_time_packed(MYSQL_TIME *ltime, longlong nr);
void my_datetime_packed_to_binary(longlong nr, uchar *ptr, uint dec);
longlong my_datetime_packed_from_binary(const uchar *ptr, uint dec);
uint my_datetime_binary_length(uint dec);
void my_time_packed_to_binary(longlong nr, uchar *ptr, uint dec);
longlong my_time_packed_from_binary(const uchar *ptr, uint dec);
uint my_time_binary_length(uint dec);
void my_timestamp_to_binary(const struct timeval *tm, uchar *ptr, uint dec);
void my_timestamp_from_binary(struct timeval *tm, const uchar *ptr, uint dec);
uint my_timestamp_binary_length(uint dec);
/** End of MySQL routines and macros **/
#endif /* COMPAT56_H_INCLUDED */
|
/*
* Implementation of s390 diagnose codes
*
* Copyright IBM Corp. 2007
* Author(s): Michael Holzheu <holzheu@de.ibm.com>
*/
#include <linux/export.h>
#include <linux/init.h>
#include <linux/cpu.h>
#include <linux/seq_file.h>
#include <linux/debugfs.h>
#include <asm/diag.h>
#include <asm/trace/diag.h>
struct diag_stat {
unsigned int counter[NR_DIAG_STAT];
};
static DEFINE_PER_CPU(struct diag_stat, diag_stat);
struct diag_desc {
int code;
char *name;
};
static const struct diag_desc diag_map[NR_DIAG_STAT] = {
[DIAG_STAT_X008] = { .code = 0x008, .name = "Console Function" },
[DIAG_STAT_X00C] = { .code = 0x00c, .name = "Pseudo Timer" },
[DIAG_STAT_X010] = { .code = 0x010, .name = "Release Pages" },
[DIAG_STAT_X014] = { .code = 0x014, .name = "Spool File Services" },
[DIAG_STAT_X044] = { .code = 0x044, .name = "Voluntary Timeslice End" },
[DIAG_STAT_X064] = { .code = 0x064, .name = "NSS Manipulation" },
[DIAG_STAT_X09C] = { .code = 0x09c, .name = "Relinquish Timeslice" },
[DIAG_STAT_X0DC] = { .code = 0x0dc, .name = "Appldata Control" },
[DIAG_STAT_X204] = { .code = 0x204, .name = "Logical-CPU Utilization" },
[DIAG_STAT_X210] = { .code = 0x210, .name = "Device Information" },
[DIAG_STAT_X224] = { .code = 0x224, .name = "EBCDIC-Name Table" },
[DIAG_STAT_X250] = { .code = 0x250, .name = "Block I/O" },
[DIAG_STAT_X258] = { .code = 0x258, .name = "Page-Reference Services" },
[DIAG_STAT_X288] = { .code = 0x288, .name = "Time Bomb" },
[DIAG_STAT_X2C4] = { .code = 0x2c4, .name = "FTP Services" },
[DIAG_STAT_X2FC] = { .code = 0x2fc, .name = "Guest Performance Data" },
[DIAG_STAT_X304] = { .code = 0x304, .name = "Partition-Resource Service" },
[DIAG_STAT_X308] = { .code = 0x308, .name = "List-Directed IPL" },
[DIAG_STAT_X500] = { .code = 0x500, .name = "Virtio Service" },
};
static int show_diag_stat(struct seq_file *m, void *v)
{
struct diag_stat *stat;
unsigned long n = (unsigned long) v - 1;
int cpu, prec, tmp;
get_online_cpus();
if (n == 0) {
seq_puts(m, " ");
for_each_online_cpu(cpu) {
prec = 10;
for (tmp = 10; cpu >= tmp; tmp *= 10)
prec--;
seq_printf(m, "%*s%d", prec, "CPU", cpu);
}
seq_putc(m, '\n');
} else if (n <= NR_DIAG_STAT) {
seq_printf(m, "diag %03x:", diag_map[n-1].code);
for_each_online_cpu(cpu) {
stat = &per_cpu(diag_stat, cpu);
seq_printf(m, " %10u", stat->counter[n-1]);
}
seq_printf(m, " %s\n", diag_map[n-1].name);
}
put_online_cpus();
return 0;
}
static void *show_diag_stat_start(struct seq_file *m, loff_t *pos)
{
return *pos <= nr_cpu_ids ? (void *)((unsigned long) *pos + 1) : NULL;
}
static void *show_diag_stat_next(struct seq_file *m, void *v, loff_t *pos)
{
++*pos;
return show_diag_stat_start(m, pos);
}
static void show_diag_stat_stop(struct seq_file *m, void *v)
{
}
static const struct seq_operations show_diag_stat_sops = {
.start = show_diag_stat_start,
.next = show_diag_stat_next,
.stop = show_diag_stat_stop,
.show = show_diag_stat,
};
static int show_diag_stat_open(struct inode *inode, struct file *file)
{
return seq_open(file, &show_diag_stat_sops);
}
static const struct file_operations show_diag_stat_fops = {
.open = show_diag_stat_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
static int __init show_diag_stat_init(void)
{
debugfs_create_file("diag_stat", 0400, NULL, NULL,
&show_diag_stat_fops);
return 0;
}
device_initcall(show_diag_stat_init);
void diag_stat_inc(enum diag_stat_enum nr)
{
this_cpu_inc(diag_stat.counter[nr]);
trace_s390_diagnose(diag_map[nr].code);
}
EXPORT_SYMBOL(diag_stat_inc);
void diag_stat_inc_norecursion(enum diag_stat_enum nr)
{
this_cpu_inc(diag_stat.counter[nr]);
trace_s390_diagnose_norecursion(diag_map[nr].code);
}
EXPORT_SYMBOL(diag_stat_inc_norecursion);
/*
* Diagnose 14: Input spool file manipulation
*/
static inline int __diag14(unsigned long rx, unsigned long ry1,
unsigned long subcode)
{
register unsigned long _ry1 asm("2") = ry1;
register unsigned long _ry2 asm("3") = subcode;
int rc = 0;
asm volatile(
" sam31\n"
" diag %2,2,0x14\n"
" sam64\n"
" ipm %0\n"
" srl %0,28\n"
: "=d" (rc), "+d" (_ry2)
: "d" (rx), "d" (_ry1)
: "cc");
return rc;
}
int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode)
{
diag_stat_inc(DIAG_STAT_X014);
return __diag14(rx, ry1, subcode);
}
EXPORT_SYMBOL(diag14);
static inline int __diag204(unsigned long *subcode, unsigned long size, void *addr)
{
register unsigned long _subcode asm("0") = *subcode;
register unsigned long _size asm("1") = size;
asm volatile(
" diag %2,%0,0x204\n"
"0: nopr %%r7\n"
EX_TABLE(0b,0b)
: "+d" (_subcode), "+d" (_size) : "d" (addr) : "memory");
*subcode = _subcode;
return _size;
}
int diag204(unsigned long subcode, unsigned long size, void *addr)
{
diag_stat_inc(DIAG_STAT_X204);
size = __diag204(&subcode, size, addr);
if (subcode)
return -1;
return size;
}
EXPORT_SYMBOL(diag204);
/*
* Diagnose 210: Get information about a virtual device
*/
int diag210(struct diag210 *addr)
{
/*
* diag 210 needs its data below the 2GB border, so we
* use a static data area to be sure
*/
static struct diag210 diag210_tmp;
static DEFINE_SPINLOCK(diag210_lock);
unsigned long flags;
int ccode;
spin_lock_irqsave(&diag210_lock, flags);
diag210_tmp = *addr;
diag_stat_inc(DIAG_STAT_X210);
asm volatile(
" lhi %0,-1\n"
" sam31\n"
" diag %1,0,0x210\n"
"0: ipm %0\n"
" srl %0,28\n"
"1: sam64\n"
EX_TABLE(0b, 1b)
: "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory");
*addr = diag210_tmp;
spin_unlock_irqrestore(&diag210_lock, flags);
return ccode;
}
EXPORT_SYMBOL(diag210);
int diag224(void *ptr)
{
int rc = -EOPNOTSUPP;
diag_stat_inc(DIAG_STAT_X224);
asm volatile(
" diag %1,%2,0x224\n"
"0: lhi %0,0x0\n"
"1:\n"
EX_TABLE(0b,1b)
: "+d" (rc) :"d" (0), "d" (ptr) : "memory");
return rc;
}
EXPORT_SYMBOL(diag224);
|
/**
* collectd - src/utils_vl_lookup.h
* Copyright (C) 2012 Florian Forster
*
* 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.
*
* Authors:
* Florian Forster <octo at collectd.org>
**/
#ifndef UTILS_VL_LOOKUP_H
#define UTILS_VL_LOOKUP_H 1
#include "plugin.h"
/*
* Types
*/
struct lookup_s;
typedef struct lookup_s lookup_t;
/* Given a user_class, constructs a new user_obj. */
typedef void *(*lookup_class_callback_t) (data_set_t const *ds,
value_list_t const *vl, void *user_class);
/* Given a user_class and a ds/vl combination, does stuff with the data.
* This is the main working horse of the module. */
typedef int (*lookup_obj_callback_t) (data_set_t const *ds,
value_list_t const *vl,
void *user_class, void *user_obj);
/* Used to free user_class pointers. May be NULL in which case nothing is
* freed. */
typedef void (*lookup_free_class_callback_t) (void *user_class);
/* Used to free user_obj pointers. May be NULL in which case nothing is
* freed. */
typedef void (*lookup_free_obj_callback_t) (void *user_obj);
struct identifier_s
{
char host[DATA_MAX_NAME_LEN];
char plugin[DATA_MAX_NAME_LEN];
char plugin_instance[DATA_MAX_NAME_LEN];
char type[DATA_MAX_NAME_LEN];
char type_instance[DATA_MAX_NAME_LEN];
};
typedef struct identifier_s identifier_t;
#define LU_GROUP_BY_HOST 0x01
#define LU_GROUP_BY_PLUGIN 0x02
#define LU_GROUP_BY_PLUGIN_INSTANCE 0x04
/* #define LU_GROUP_BY_TYPE 0x00 */
#define LU_GROUP_BY_TYPE_INSTANCE 0x10
/*
* Functions
*/
__attribute__((nonnull(1,2)))
lookup_t *lookup_create (lookup_class_callback_t,
lookup_obj_callback_t,
lookup_free_class_callback_t,
lookup_free_obj_callback_t);
void lookup_destroy (lookup_t *obj);
int lookup_add (lookup_t *obj,
identifier_t const *ident, unsigned int group_by, void *user_class);
/* TODO(octo): Pass lookup_obj_callback_t to lookup_search()? */
int lookup_search (lookup_t *obj,
data_set_t const *ds, value_list_t const *vl);
#endif /* UTILS_VL_LOOKUP_H */
|
// @(#)root/smatrix:$Id$
// Authors: L. Moneta 2005
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ nestedclass;
//#pragma link C++ namespace tvmet;
//#pragma link C++ typedef value_type;
//#pragma link C++ class ROOT::Math::SMatrixIdentity+;
//generate from 3x3 up to 6x6
#pragma link C++ class ROOT::Math::SMatrix<Double32_t,3,3>+;
#pragma link C++ class ROOT::Math::SMatrix<Double32_t,4,4>+;
#pragma link C++ class ROOT::Math::SMatrix<Double32_t,5,5>+;
#pragma link C++ class ROOT::Math::SMatrix<Double32_t,6,6>+;
#pragma link C++ class ROOT::Math::MatRepStd<Double32_t,3,3>+;
#pragma link C++ class ROOT::Math::MatRepStd<Double32_t,4,4>+;
#pragma link C++ class ROOT::Math::MatRepStd<Double32_t,5,5>+;
#pragma link C++ class ROOT::Math::MatRepStd<Double32_t,6,6>+;
#pragma link C++ class ROOT::Math::SVector<Double32_t,3>+;
#pragma link C++ class ROOT::Math::SVector<Double32_t,4>+;
#pragma link C++ class ROOT::Math::SVector<Double32_t,5>+;
#pragma link C++ class ROOT::Math::SVector<Double32_t,6>+;
#pragma link C++ class ROOT::Math::MatRepSym<Double32_t,3>+;
#pragma link C++ class ROOT::Math::MatRepSym<Double32_t,4>+;
#pragma link C++ class ROOT::Math::MatRepSym<Double32_t,5>+;
#pragma link C++ class ROOT::Math::MatRepSym<Double32_t,6>+;
#pragma link C++ class ROOT::Math::SMatrix<Double32_t,3,3,ROOT::Math::MatRepSym<Double32_t,3> >+;
#pragma link C++ class ROOT::Math::SMatrix<Double32_t,4,4,ROOT::Math::MatRepSym<Double32_t,4> >+;
#pragma link C++ class ROOT::Math::SMatrix<Double32_t,5,5,ROOT::Math::MatRepSym<Double32_t,5> >+;
#pragma link C++ class ROOT::Math::SMatrix<Double32_t,6,6,ROOT::Math::MatRepSym<Double32_t,6> >+;
#endif
|
/*
* elevator noop
*/
#include <linux/blkdev.h>
#include <linux/elevator.h>
#include <linux/bio.h>
#include <linux/module.h>
#include <linux/init.h>
struct noop_data {
struct list_head queue;
};
static void noop_merged_requests(request_queue_t *q, struct request *rq,
struct request *next)
{
list_del_init(&next->queuelist);
}
static int noop_dispatch(request_queue_t *q, int force)
{
struct noop_data *nd = q->elevator->elevator_data;
if (!list_empty(&nd->queue)) {
struct request *rq;
rq = list_entry(nd->queue.next, struct request, queuelist);
list_del_init(&rq->queuelist);
elv_dispatch_sort(q, rq);
return 1;
}
return 0;
}
static void noop_add_request(request_queue_t *q, struct request *rq)
{
struct noop_data *nd = q->elevator->elevator_data;
list_add_tail(&rq->queuelist, &nd->queue);
}
static int noop_queue_empty(request_queue_t *q)
{
struct noop_data *nd = q->elevator->elevator_data;
return list_empty(&nd->queue);
}
static struct request *
noop_former_request(request_queue_t *q, struct request *rq)
{
struct noop_data *nd = q->elevator->elevator_data;
if (rq->queuelist.prev == &nd->queue)
return NULL;
return list_entry(rq->queuelist.prev, struct request, queuelist);
}
static struct request *
noop_latter_request(request_queue_t *q, struct request *rq)
{
struct noop_data *nd = q->elevator->elevator_data;
if (rq->queuelist.next == &nd->queue)
return NULL;
return list_entry(rq->queuelist.next, struct request, queuelist);
}
static void *noop_init_queue(request_queue_t *q)
{
struct noop_data *nd;
nd = kmalloc_node(sizeof(*nd), GFP_KERNEL, q->node);
if (!nd)
return NULL;
INIT_LIST_HEAD(&nd->queue);
return nd;
}
static void noop_exit_queue(elevator_t *e)
{
struct noop_data *nd = e->elevator_data;
BUG_ON(!list_empty(&nd->queue));
kfree(nd);
}
static struct elevator_type elevator_noop = {
.ops = {
.elevator_merge_req_fn = noop_merged_requests,
.elevator_dispatch_fn = noop_dispatch,
.elevator_add_req_fn = noop_add_request,
.elevator_queue_empty_fn = noop_queue_empty,
.elevator_former_req_fn = noop_former_request,
.elevator_latter_req_fn = noop_latter_request,
.elevator_init_fn = noop_init_queue,
.elevator_exit_fn = noop_exit_queue,
},
.elevator_name = "noop",
.elevator_owner = THIS_MODULE,
};
static int __init noop_init(void)
{
return elv_register(&elevator_noop);
}
static void __exit noop_exit(void)
{
elv_unregister(&elevator_noop);
}
module_init(noop_init);
module_exit(noop_exit);
MODULE_AUTHOR("Jens Axboe");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("No-op IO scheduler");
|
/***************************************************************************
qgsdial.h
-------------------
begin : July 2013
copyright : (C) 2013 by Daniel Vaz
email : danielvaz at gmail dot com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <QDial>
#include <QVariant>
#include "qgis_gui.h"
#include "qgis_sip.h"
class QPaintEvent;
/**
* \ingroup gui
* \class QgsDial
*/
class GUI_EXPORT QgsDial : public QDial
{
Q_OBJECT
public:
/**
* Constructor for QgsDial
* \param parent parent object
*/
QgsDial( QWidget *parent SIP_TRANSFERTHIS = nullptr );
void setMinimum( const QVariant &min );
void setMaximum( const QVariant &max );
void setSingleStep( const QVariant &step );
void setValue( const QVariant &value );
QVariant variantValue() const;
signals:
void valueChanged( const QVariant & );
private slots:
void onValueChanged( int );
protected:
void paintEvent( QPaintEvent *event ) override;
private:
void update();
QVariant mMin, mMax, mStep, mValue;
};
|
/* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */
/*
* Copyright (c) 2010, Oracle America, Inc.
* 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 "Oracle America, 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.
*/
/* Cleaned up for GNU C library roland@gnu.ai.mit.edu:
added multiple inclusion protection and use of <sys/cdefs.h>.
In GNU this file is #include'd by <netdb.h>. */
#ifndef _RPC_NETDB_H
#define _RPC_NETDB_H 1
#include <features.h>
#define __need_size_t
#include <stddef.h>
__BEGIN_DECLS
struct rpcent
{
char *r_name; /* Name of server for this rpc program. */
char **r_aliases; /* Alias list. */
int r_number; /* RPC program number. */
};
extern void setrpcent (int __stayopen) __THROW;
extern void endrpcent (void) __THROW;
extern struct rpcent *getrpcbyname (__const char *__name) __THROW;
extern struct rpcent *getrpcbynumber (int __number) __THROW;
extern struct rpcent *getrpcent (void) __THROW;
#ifdef __USE_MISC
extern int getrpcbyname_r (__const char *__name, struct rpcent *__result_buf,
char *__buffer, size_t __buflen,
struct rpcent **__result) __THROW;
extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf,
char *__buffer, size_t __buflen,
struct rpcent **__result) __THROW;
extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer,
size_t __buflen, struct rpcent **__result) __THROW;
#endif
__END_DECLS
#endif /* rpc/netdb.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_GL_GL_CONTEXT_STUB_H_
#define UI_GL_GL_CONTEXT_STUB_H_
#include "ui/gl/gl_context.h"
namespace gfx {
// A GLContext that does nothing for unit tests.
class GL_EXPORT GLContextStub : public GLContextReal {
public:
GLContextStub();
// Implement GLContext.
virtual bool Initialize(GLSurface* compatible_surface,
GpuPreference gpu_preference) OVERRIDE;
virtual void Destroy() OVERRIDE;
virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE;
virtual bool IsCurrent(GLSurface* surface) OVERRIDE;
virtual void* GetHandle() OVERRIDE;
virtual void SetSwapInterval(int interval) OVERRIDE;
virtual std::string GetExtensions() OVERRIDE;
protected:
virtual ~GLContextStub();
private:
DISALLOW_COPY_AND_ASSIGN(GLContextStub);
};
} // namespace gfx
#endif // UI_GL_GL_CONTEXT_STUB_H_
|
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
*/
#ifndef _ASM_HEXAGON_INTRINSICS_H
#define _ASM_HEXAGON_INTRINSICS_H
#define HEXAGON_P_vrmpyhacc_PP __builtin_HEXAGON_M2_vrmac_s0
#define HEXAGON_P_vrmpyh_PP __builtin_HEXAGON_M2_vrmpy_s0
#define HEXAGON_R_cl0_R __builtin_HEXAGON_S2_cl0
#endif
|
/* Processed by ecpg (regression mode) */
/* These include files are added by the preprocessor */
#include <ecpglib.h>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "quote.pgc"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#line 1 "regression.h"
#line 5 "quote.pgc"
int main() {
/* exec sql begin declare section */
#line 9 "quote.pgc"
char var [ 25 ] ;
#line 10 "quote.pgc"
int i ;
/* exec sql end declare section */
#line 11 "quote.pgc"
ECPGdebug(1, stderr);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
#line 14 "quote.pgc"
{ ECPGsetcommit(__LINE__, "on", NULL);}
#line 16 "quote.pgc"
/* exec sql whenever sql_warning sqlprint ; */
#line 17 "quote.pgc"
/* exec sql whenever sqlerror sqlprint ; */
#line 18 "quote.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table \"My_Table\" ( Item1 int , Item2 text )", ECPGt_EOIT, ECPGt_EORT);
#line 20 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 20 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 20 "quote.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "show standard_conforming_strings", ECPGt_EOIT,
ECPGt_char,(var),(long)25,(long)1,(25)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 22 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 22 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 22 "quote.pgc"
printf("Standard conforming strings: %s\n", var);
/* this is a\\b actually */
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into \"My_Table\" values ( 1 , 'a\\\\\\\\b' )", ECPGt_EOIT, ECPGt_EORT);
#line 26 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 26 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 26 "quote.pgc"
/* this is a\\b */
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into \"My_Table\" values ( 1 , E'a\\\\\\\\b' )", ECPGt_EOIT, ECPGt_EORT);
#line 28 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 28 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 28 "quote.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set standard_conforming_strings to on", ECPGt_EOIT, ECPGt_EORT);
#line 30 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 30 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 30 "quote.pgc"
/* this is a\\\\b actually */
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into \"My_Table\" values ( 2 , 'a\\\\\\\\b' )", ECPGt_EOIT, ECPGt_EORT);
#line 33 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 33 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 33 "quote.pgc"
/* this is a\\b */
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into \"My_Table\" values ( 2 , E'a\\\\\\\\b' )", ECPGt_EOIT, ECPGt_EORT);
#line 35 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 35 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 35 "quote.pgc"
{ ECPGtrans(__LINE__, NULL, "begin");
#line 37 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 37 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 37 "quote.pgc"
/* declare C cursor for select * from \"My_Table\" */
#line 38 "quote.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select * from \"My_Table\"", ECPGt_EOIT, ECPGt_EORT);
#line 40 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 40 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 40 "quote.pgc"
/* exec sql whenever not found break ; */
#line 42 "quote.pgc"
while (true)
{
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch C", ECPGt_EOIT,
ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(var),(long)25,(long)1,(25)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 46 "quote.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
#line 46 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 46 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 46 "quote.pgc"
printf("value: %d %s\n", i, var);
}
{ ECPGtrans(__LINE__, NULL, "rollback");
#line 50 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 50 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 50 "quote.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table \"My_Table\"", ECPGt_EOIT, ECPGt_EORT);
#line 51 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 51 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 51 "quote.pgc"
{ ECPGdisconnect(__LINE__, "ALL");
#line 53 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 53 "quote.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 53 "quote.pgc"
return 0;
}
|
/*
* Copyright (c) 2011-2012 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* EXYNOS4210 - Clock support
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/syscore_ops.h>
#include <plat/cpu-freq.h>
#include <plat/clock.h>
#include <plat/cpu.h>
#include <plat/pll.h>
#include <plat/s5p-clock.h>
#include <plat/clock-clksrc.h>
#include <plat/pm.h>
#include <mach/hardware.h>
#include <mach/map.h>
#include <mach/regs-clock.h>
#include "common.h"
#include "clock-exynos4.h"
#ifdef CONFIG_PM_SLEEP
static struct sleep_save exynos4210_clock_save[] = {
SAVE_ITEM(EXYNOS4_CLKSRC_IMAGE),
SAVE_ITEM(EXYNOS4_CLKDIV_IMAGE),
SAVE_ITEM(EXYNOS4210_CLKSRC_LCD1),
SAVE_ITEM(EXYNOS4210_CLKDIV_LCD1),
SAVE_ITEM(EXYNOS4210_CLKSRC_MASK_LCD1),
SAVE_ITEM(EXYNOS4210_CLKGATE_IP_IMAGE),
SAVE_ITEM(EXYNOS4210_CLKGATE_IP_LCD1),
SAVE_ITEM(EXYNOS4210_CLKGATE_IP_PERIR),
};
#endif
static struct clksrc_clk *sysclks[] = {
/* nothing here yet */
};
static struct clksrc_clk exynos4210_clk_mout_g2d0 = {
.clk = {
.name = "mout_g2d0",
},
.sources = &exynos4_clkset_mout_g2d0,
.reg_src = { .reg = EXYNOS4_CLKSRC_IMAGE, .shift = 0, .size = 1 },
};
static struct clksrc_clk exynos4210_clk_mout_g2d1 = {
.clk = {
.name = "mout_g2d1",
},
.sources = &exynos4_clkset_mout_g2d1,
.reg_src = { .reg = EXYNOS4_CLKSRC_IMAGE, .shift = 4, .size = 1 },
};
static struct clk *exynos4210_clkset_mout_g2d_list[] = {
[0] = &exynos4210_clk_mout_g2d0.clk,
[1] = &exynos4210_clk_mout_g2d1.clk,
};
static struct clksrc_sources exynos4210_clkset_mout_g2d = {
.sources = exynos4210_clkset_mout_g2d_list,
.nr_sources = ARRAY_SIZE(exynos4210_clkset_mout_g2d_list),
};
static int exynos4_clksrc_mask_lcd1_ctrl(struct clk *clk, int enable)
{
return s5p_gatectrl(EXYNOS4210_CLKSRC_MASK_LCD1, clk, enable);
}
static struct clksrc_clk clksrcs[] = {
{
.clk = {
.name = "sclk_sata",
.id = -1,
.enable = exynos4_clksrc_mask_fsys_ctrl,
.ctrlbit = (1 << 24),
},
.sources = &exynos4_clkset_mout_corebus,
.reg_src = { .reg = EXYNOS4_CLKSRC_FSYS, .shift = 24, .size = 1 },
.reg_div = { .reg = EXYNOS4_CLKDIV_FSYS0, .shift = 20, .size = 4 },
}, {
.clk = {
.name = "sclk_fimd",
.devname = "exynos4-fb.1",
.enable = exynos4_clksrc_mask_lcd1_ctrl,
.ctrlbit = (1 << 0),
},
.sources = &exynos4_clkset_group,
.reg_src = { .reg = EXYNOS4210_CLKSRC_LCD1, .shift = 0, .size = 4 },
.reg_div = { .reg = EXYNOS4210_CLKDIV_LCD1, .shift = 0, .size = 4 },
}, {
.clk = {
.name = "sclk_fimg2d",
},
.sources = &exynos4210_clkset_mout_g2d,
.reg_src = { .reg = EXYNOS4_CLKSRC_IMAGE, .shift = 8, .size = 1 },
.reg_div = { .reg = EXYNOS4_CLKDIV_IMAGE, .shift = 0, .size = 4 },
},
};
static struct clk init_clocks_off[] = {
{
.name = "sataphy",
.id = -1,
.parent = &exynos4_clk_aclk_133.clk,
.enable = exynos4_clk_ip_fsys_ctrl,
.ctrlbit = (1 << 3),
}, {
.name = "sata",
.id = -1,
.parent = &exynos4_clk_aclk_133.clk,
.enable = exynos4_clk_ip_fsys_ctrl,
.ctrlbit = (1 << 10),
}, {
.name = "fimd",
.devname = "exynos4-fb.1",
.enable = exynos4_clk_ip_lcd1_ctrl,
.ctrlbit = (1 << 0),
}, {
.name = "sysmmu",
.devname = "exynos-sysmmu.9",
.enable = exynos4_clk_ip_image_ctrl,
.ctrlbit = (1 << 3),
}, {
.name = "sysmmu",
.devname = "exynos-sysmmu.11",
.enable = exynos4_clk_ip_lcd1_ctrl,
.ctrlbit = (1 << 4),
}, {
.name = "fimg2d",
.enable = exynos4_clk_ip_image_ctrl,
.ctrlbit = (1 << 0),
},
};
#ifdef CONFIG_PM_SLEEP
static int exynos4210_clock_suspend(void)
{
s3c_pm_do_save(exynos4210_clock_save, ARRAY_SIZE(exynos4210_clock_save));
return 0;
}
static void exynos4210_clock_resume(void)
{
s3c_pm_do_restore_core(exynos4210_clock_save, ARRAY_SIZE(exynos4210_clock_save));
}
#else
#define exynos4210_clock_suspend NULL
#define exynos4210_clock_resume NULL
#endif
static struct syscore_ops exynos4210_clock_syscore_ops = {
.suspend = exynos4210_clock_suspend,
.resume = exynos4210_clock_resume,
};
void __init exynos4210_register_clocks(void)
{
int ptr;
exynos4_clk_mout_mpll.reg_src.reg = EXYNOS4_CLKSRC_CPU;
exynos4_clk_mout_mpll.reg_src.shift = 8;
exynos4_clk_mout_mpll.reg_src.size = 1;
for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++)
s3c_register_clksrc(sysclks[ptr], 1);
s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
register_syscore_ops(&exynos4210_clock_syscore_ops);
}
|
/*
* CRC32 checksum
*
* Copyright (c) 1998-2003 by Joergen Ibsen / Jibz
* All Rights Reserved
*
* http://www.ibsensoftware.com/
*
* This software is provided 'as-is', without any express
* or implied warranty. In no event will the authors be
* held liable for any damages arising from the use of
* this software.
*
* Permission is granted to anyone to use this software
* for any purpose, including commercial applications,
* and to alter it and redistribute it freely, subject to
* the following restrictions:
*
* 1. The origin of this software must not be
* misrepresented; you must not claim that you
* wrote the original software. If you use this
* software in a product, an acknowledgment in
* the product documentation would be appreciated
* but is not required.
*
* 2. Altered source versions must be plainly marked
* as such, and must not be misrepresented as
* being the original software.
*
* 3. This notice may not be removed or altered from
* any source distribution.
*/
/*
* CRC32 algorithm taken from the zlib source, which is
* Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
*/
#include "tinf.h"
static const unsigned int tinf_crc32tab[16] = {
0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190,
0x6b6b51f4, 0x4db26158, 0x5005713c, 0xedb88320, 0xf00f9344,
0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278,
0xbdbdf21c
};
/* crc is previous value for incremental computation, 0xffffffff initially */
uint32_t uzlib_crc32(const void *data, unsigned int length, uint32_t crc)
{
const unsigned char *buf = (const unsigned char *)data;
unsigned int i;
for (i = 0; i < length; ++i)
{
crc ^= buf[i];
crc = tinf_crc32tab[crc & 0x0f] ^ (crc >> 4);
crc = tinf_crc32tab[crc & 0x0f] ^ (crc >> 4);
}
// return value suitable for passing in next time, for final value invert it
return crc/* ^ 0xffffffff*/;
}
|
// Copyright 2011 Google Inc. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the COPYING file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
// -----------------------------------------------------------------------------
//
// Cost tables for level and modes.
//
// Author: Skal (pascal.massimino@gmail.com)
#ifndef WEBP_ENC_COST_H_
#define WEBP_ENC_COST_H_
#include <assert.h>
#include <stdlib.h>
#include "./vp8i_enc.h"
#ifdef __cplusplus
extern "C" {
#endif
// On-the-fly info about the current set of residuals. Handy to avoid
// passing zillions of params.
typedef struct VP8Residual VP8Residual;
struct VP8Residual {
int first;
int last;
const int16_t* coeffs;
int coeff_type;
ProbaArray* prob;
StatsArray* stats;
CostArrayPtr costs;
};
void VP8InitResidual(int first, int coeff_type,
VP8Encoder* const enc, VP8Residual* const res);
int VP8RecordCoeffs(int ctx, const VP8Residual* const res);
// Record proba context used.
static WEBP_INLINE int VP8RecordStats(int bit, proba_t* const stats) {
proba_t p = *stats;
// An overflow is inbound. Note we handle this at 0xfffe0000u instead of
// 0xffff0000u to make sure p + 1u does not overflow.
if (p >= 0xfffe0000u) {
p = ((p + 1u) >> 1) & 0x7fff7fffu; // -> divide the stats by 2.
}
// record bit count (lower 16 bits) and increment total count (upper 16 bits).
p += 0x00010000u + bit;
*stats = p;
return bit;
}
// Cost of coding one event with probability 'proba'.
static WEBP_INLINE int VP8BitCost(int bit, uint8_t proba) {
return !bit ? VP8EntropyCost[proba] : VP8EntropyCost[255 - proba];
}
// Level cost calculations
extern const uint16_t VP8LevelCodes[MAX_VARIABLE_LEVEL][2];
void VP8CalculateLevelCosts(VP8EncProba* const proba);
static WEBP_INLINE int VP8LevelCost(const uint16_t* const table, int level) {
return VP8LevelFixedCosts[level]
+ table[(level > MAX_VARIABLE_LEVEL) ? MAX_VARIABLE_LEVEL : level];
}
// Mode costs
extern const uint16_t VP8FixedCostsUV[4];
extern const uint16_t VP8FixedCostsI16[4];
extern const uint16_t VP8FixedCostsI4[NUM_BMODES][NUM_BMODES][NUM_BMODES];
//------------------------------------------------------------------------------
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* WEBP_ENC_COST_H_ */
|
/*
* (C) Copyright 2009
* Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __DW_UDC_H
#define __DW_UDC_H
/*
* Defines for USBD
*
* The udc_ahb controller has three AHB slaves:
*
* 1. THe UDC registers
* 2. The plug detect
* 3. The RX/TX FIFO
*/
#define MAX_ENDPOINTS 16
struct udc_endp_regs {
u32 endp_cntl;
u32 endp_status;
u32 endp_bsorfn;
u32 endp_maxpacksize;
u32 reserved_1;
u32 endp_desc_point;
u32 reserved_2;
u32 write_done;
};
/* Endpoint Control Register definitions */
#define ENDP_CNTL_STALL 0x00000001
#define ENDP_CNTL_FLUSH 0x00000002
#define ENDP_CNTL_SNOOP 0x00000004
#define ENDP_CNTL_POLL 0x00000008
#define ENDP_CNTL_CONTROL 0x00000000
#define ENDP_CNTL_ISO 0x00000010
#define ENDP_CNTL_BULK 0x00000020
#define ENDP_CNTL_INT 0x00000030
#define ENDP_CNTL_NAK 0x00000040
#define ENDP_CNTL_SNAK 0x00000080
#define ENDP_CNTL_CNAK 0x00000100
#define ENDP_CNTL_RRDY 0x00000200
/* Endpoint Satus Register definitions */
#define ENDP_STATUS_PIDMSK 0x0000000f
#define ENDP_STATUS_OUTMSK 0x00000030
#define ENDP_STATUS_OUT_NONE 0x00000000
#define ENDP_STATUS_OUT_DATA 0x00000010
#define ENDP_STATUS_OUT_SETUP 0x00000020
#define ENDP_STATUS_IN 0x00000040
#define ENDP_STATUS_BUFFNAV 0x00000080
#define ENDP_STATUS_FATERR 0x00000100
#define ENDP_STATUS_HOSTBUSERR 0x00000200
#define ENDP_STATUS_TDC 0x00000400
#define ENDP_STATUS_RXPKTMSK 0x003ff800
struct udc_regs {
struct udc_endp_regs in_regs[MAX_ENDPOINTS];
struct udc_endp_regs out_regs[MAX_ENDPOINTS];
u32 dev_conf;
u32 dev_cntl;
u32 dev_stat;
u32 dev_int;
u32 dev_int_mask;
u32 endp_int;
u32 endp_int_mask;
u32 reserved_3[0x39];
u32 reserved_4; /* offset 0x500 */
u32 udc_endp_reg[MAX_ENDPOINTS];
};
/* Device Configuration Register definitions */
#define DEV_CONF_HS_SPEED 0x00000000
#define DEV_CONF_LS_SPEED 0x00000002
#define DEV_CONF_FS_SPEED 0x00000003
#define DEV_CONF_REMWAKEUP 0x00000004
#define DEV_CONF_SELFPOW 0x00000008
#define DEV_CONF_SYNCFRAME 0x00000010
#define DEV_CONF_PHYINT_8 0x00000020
#define DEV_CONF_PHYINT_16 0x00000000
#define DEV_CONF_UTMI_BIDIR 0x00000040
#define DEV_CONF_STATUS_STALL 0x00000080
/* Device Control Register definitions */
#define DEV_CNTL_RESUME 0x00000001
#define DEV_CNTL_TFFLUSH 0x00000002
#define DEV_CNTL_RXDMAEN 0x00000004
#define DEV_CNTL_TXDMAEN 0x00000008
#define DEV_CNTL_DESCRUPD 0x00000010
#define DEV_CNTL_BIGEND 0x00000020
#define DEV_CNTL_BUFFILL 0x00000040
#define DEV_CNTL_TSHLDEN 0x00000080
#define DEV_CNTL_BURSTEN 0x00000100
#define DEV_CNTL_DMAMODE 0x00000200
#define DEV_CNTL_SOFTDISCONNECT 0x00000400
#define DEV_CNTL_SCALEDOWN 0x00000800
#define DEV_CNTL_BURSTLENU 0x00010000
#define DEV_CNTL_BURSTLENMSK 0x00ff0000
#define DEV_CNTL_TSHLDLENU 0x01000000
#define DEV_CNTL_TSHLDLENMSK 0xff000000
/* Device Status Register definitions */
#define DEV_STAT_CFG 0x0000000f
#define DEV_STAT_INTF 0x000000f0
#define DEV_STAT_ALT 0x00000f00
#define DEV_STAT_SUSP 0x00001000
#define DEV_STAT_ENUM 0x00006000
#define DEV_STAT_ENUM_SPEED_HS 0x00000000
#define DEV_STAT_ENUM_SPEED_FS 0x00002000
#define DEV_STAT_ENUM_SPEED_LS 0x00004000
#define DEV_STAT_RXFIFO_EMPTY 0x00008000
#define DEV_STAT_PHY_ERR 0x00010000
#define DEV_STAT_TS 0xf0000000
/* Device Interrupt Register definitions */
#define DEV_INT_MSK 0x0000007f
#define DEV_INT_SETCFG 0x00000001
#define DEV_INT_SETINTF 0x00000002
#define DEV_INT_INACTIVE 0x00000004
#define DEV_INT_USBRESET 0x00000008
#define DEV_INT_SUSPUSB 0x00000010
#define DEV_INT_SOF 0x00000020
#define DEV_INT_ENUM 0x00000040
/* Endpoint Interrupt Register definitions */
#define ENDP0_INT_CTRLIN 0x00000001
#define ENDP1_INT_BULKIN 0x00000002
#define ENDP_INT_NONISOIN_MSK 0x0000AAAA
#define ENDP2_INT_BULKIN 0x00000004
#define ENDP0_INT_CTRLOUT 0x00010000
#define ENDP1_INT_BULKOUT 0x00020000
#define ENDP2_INT_BULKOUT 0x00040000
#define ENDP_INT_NONISOOUT_MSK 0x55540000
/* Endpoint Register definitions */
#define ENDP_EPDIR_OUT 0x00000000
#define ENDP_EPDIR_IN 0x00000010
#define ENDP_EPTYPE_CNTL 0x0
#define ENDP_EPTYPE_ISO 0x1
#define ENDP_EPTYPE_BULK 0x2
#define ENDP_EPTYPE_INT 0x3
/*
* Defines for Plug Detect
*/
struct plug_regs {
u32 plug_state;
u32 plug_pending;
};
/* Plug State Register definitions */
#define PLUG_STATUS_EN 0x1
#define PLUG_STATUS_ATTACHED 0x2
#define PLUG_STATUS_PHY_RESET 0x4
#define PLUG_STATUS_PHY_MODE 0x8
/*
* Defines for UDC FIFO (Slave Mode)
*/
struct udcfifo_regs {
u32 *fifo_p;
};
/*
* UDC endpoint definitions
*/
#define UDC_EP0 0
#define UDC_EP1 1
#define UDC_EP2 2
#define UDC_EP3 3
#endif /* __DW_UDC_H */
|
/*****************************************************************************
* Project: RooFit *
* Package: RooFitCore *
* File: $Id: RooTruthModel.h,v 1.18 2007/05/11 10:14:56 verkerke Exp $
* Authors: *
* WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
* DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
* *
* Copyright (c) 2000-2005, Regents of the University of California *
* and Stanford University. All rights reserved. *
* *
* Redistribution and use in source and binary forms, *
* with or without modification, are permitted according to the terms *
* listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
*****************************************************************************/
#ifndef ROO_TRUTH_MODEL
#define ROO_TRUTH_MODEL
#include "RooResolutionModel.h"
class RooTruthModel : public RooResolutionModel {
public:
enum RooTruthBasis { noBasis=0, expBasisMinus= 1, expBasisSum= 2, expBasisPlus= 3,
sinBasisMinus=11, sinBasisSum=12, sinBasisPlus=13,
cosBasisMinus=21, cosBasisSum=22, cosBasisPlus=23,
linBasisPlus=33,
quadBasisPlus=43,
coshBasisMinus=51,coshBasisSum=52,coshBasisPlus=53,
sinhBasisMinus=61,sinhBasisSum=62,sinhBasisPlus=63,
genericBasis=100 } ;
enum BasisType { none=0, expBasis=1, sinBasis=2, cosBasis=3,
linBasis=4, quadBasis=5, coshBasis=6, sinhBasis=7 } ;
enum BasisSign { Both=0, Plus=+1, Minus=-1 } ;
// Constructors, assignment etc
inline RooTruthModel() { }
RooTruthModel(const char *name, const char *title, RooRealVar& x) ;
RooTruthModel(const RooTruthModel& other, const char* name=0);
virtual TObject* clone(const char* newname) const { return new RooTruthModel(*this,newname) ; }
virtual ~RooTruthModel();
virtual Int_t basisCode(const char* name) const ;
virtual RooAbsGenContext* modelGenContext(const RooAbsAnaConvPdf& convPdf, const RooArgSet &vars,
const RooDataSet *prototype=0, const RooArgSet* auxProto=0,
Bool_t verbose= kFALSE) const;
Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const;
void generateEvent(Int_t code);
Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;
Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;
protected:
virtual Double_t evaluate() const ;
virtual void changeBasis(RooFormulaVar* basis) ;
ClassDef(RooTruthModel,1) // Truth resolution model (delta function)
};
#endif
|
#ifndef __BOARD_CPU87__
#define __BOARD_CPU87__
#include <config.h>
#define REG8(x) (*(volatile unsigned char *)(x))
/* CPU86 register definitions */
#define CPU86_VME_EAC REG8(CFG_BCRS_BASE + 0x00)
#define CPU86_VME_SAC REG8(CFG_BCRS_BASE + 0x01)
#define CPU86_VME_MAC REG8(CFG_BCRS_BASE + 0x02)
#define CPU86_BCR REG8(CFG_BCRS_BASE + 0x03)
#define CPU86_BSR REG8(CFG_BCRS_BASE + 0x04)
#define CPU86_WDOG_RPORT REG8(CFG_BCRS_BASE + 0x05)
#define CPU86_MBOX_IRQ REG8(CFG_BCRS_BASE + 0x04)
#define CPU86_REV REG8(CFG_BCRS_BASE + 0x07)
#define CPU86_VME_IRQMASK REG8(CFG_BCRS_BASE + 0x80)
#define CPU86_VME_IRQSTATUS REG8(CFG_BCRS_BASE + 0x81)
#define CPU86_LOCAL_IRQMASK REG8(CFG_BCRS_BASE + 0x82)
#define CPU86_LOCAL_IRQSTATUS REG8(CFG_BCRS_BASE + 0x83)
#define CPU86_PMCL_IRQSTATUS REG8(CFG_BCRS_BASE + 0x84)
/* Board Control Register bits */
#define CPU86_BCR_FWPT 0x01
#define CPU86_BCR_FWRE 0x02
#endif /* __BOARD_CPU87__ */
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "libgccjit.h"
#include "harness.h"
/* Try to create a switch statement with a NULL case, so that
we can verify that we get a sane error message. */
void
create_code (gcc_jit_context *ctxt, void *user_data)
{
gcc_jit_type *t_int =
gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT);
gcc_jit_type *return_type = t_int;
gcc_jit_param *x =
gcc_jit_context_new_param (ctxt, NULL, t_int, "x");
gcc_jit_param *params[1] = {x};
gcc_jit_function *func =
gcc_jit_context_new_function (ctxt, NULL,
GCC_JIT_FUNCTION_EXPORTED,
return_type,
"test_switch",
1, params, 0);
gcc_jit_block *b_initial =
gcc_jit_function_new_block (func, "initial");
gcc_jit_block *b_default =
gcc_jit_function_new_block (func, "default");
/* Erroneous NULL case. */
gcc_jit_case *cases[1] = {
NULL
};
gcc_jit_block_end_with_switch (
b_initial, NULL,
gcc_jit_param_as_rvalue (x),
b_default,
1,
cases);
}
void
verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
{
CHECK_VALUE (result, NULL);
CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt),
"gcc_jit_block_end_with_switch: NULL case 0");
}
|
/*
* Annapurna labs cpu-resume register structure.
*
* Copyright (C) 2015 Annapurna Labs Ltd.
*
* 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.
*/
#ifndef ALPINE_CPU_RESUME_H_
#define ALPINE_CPU_RESUME_H_
/* Per-cpu regs */
struct al_cpu_resume_regs_per_cpu {
uint32_t flags;
uint32_t resume_addr;
};
/* general regs */
struct al_cpu_resume_regs {
/* Watermark for validating the CPU resume struct */
uint32_t watermark;
uint32_t flags;
struct al_cpu_resume_regs_per_cpu per_cpu[];
};
/* The expected magic number for validating the resume addresses */
#define AL_CPU_RESUME_MAGIC_NUM 0xf0e1d200
#define AL_CPU_RESUME_MAGIC_NUM_MASK 0xffffff00
#endif /* ALPINE_CPU_RESUME_H_ */
|
/*
TDA10021/TDA10023 - Single Chip Cable Channel Receiver driver module
used on the the Siemens DVB-C cards
Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>
Copyright (C) 2004 Markus Schulz <msc@antzsystem.de>
Support for TDA10021
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 TDA1002x_H
#define TDA1002x_H
#include <linux/dvb/frontend.h>
struct tda1002x_config
{
/* the demodulator's i2c address */
u8 demod_address;
u8 invert;
};
#if defined(CONFIG_DVB_TDA10021) || (defined(CONFIG_DVB_TDA10021_MODULE) && defined(MODULE))
extern struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config,
struct i2c_adapter* i2c, u8 pwm);
#else
static inline struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config,
struct i2c_adapter* i2c, u8 pwm)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
return NULL;
}
#endif // CONFIG_DVB_TDA10021
#if defined(CONFIG_DVB_TDA10023) || (defined(CONFIG_DVB_TDA10023_MODULE) && defined(MODULE))
extern struct dvb_frontend* tda10023_attach(const struct tda1002x_config* config,
struct i2c_adapter* i2c, u8 pwm);
#else
static inline struct dvb_frontend* tda10023_attach(const struct tda1002x_config* config,
struct i2c_adapter* i2c, u8 pwm)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
return NULL;
}
#endif // CONFIG_DVB_TDA10023
#endif // TDA1002x_H
|
/* Copyright (c) 2010, 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 CODEC_UTILS_H
#define CODEC_UTILS_H
#include <linux/earlysuspend.h>
#define ADRV_STATUS_AIO_INTF 0x00000001
#define ADRV_STATUS_OBUF_GIVEN 0x00000002
#define ADRV_STATUS_IBUF_GIVEN 0x00000004
#define ADRV_STATUS_FSYNC 0x00000008
#define PCM_BUFSZ_MIN 4800 /* Hold one stereo MP3 frame */
#define PCM_BUF_MAX_COUNT 5 /* DSP only accepts 5 buffers at most
but support 2 buffers currently */
#define ROUTING_MODE_FTRT 1
#define ROUTING_MODE_RT 2
/* Decoder status received from AUDPPTASK */
#define AUDPP_DEC_STATUS_SLEEP 0
#define AUDPP_DEC_STATUS_INIT 1
#define AUDPP_DEC_STATUS_CFG 2
#define AUDPP_DEC_STATUS_PLAY 3
#define AUDPP_DEC_STATUS_EOS 5
/* worst case delay of 3secs(3000ms) for AV Sync Query response */
#define AVSYNC_EVENT_TIMEOUT 3000
struct buffer {
void *data;
unsigned size;
unsigned used; /* Input usage actual DSP produced PCM size */
unsigned addr;
};
#ifdef CONFIG_HAS_EARLYSUSPEND
struct audio_suspend_ctl {
struct early_suspend node;
struct audio *audio;
};
#endif
struct codec_operations {
long (*ioctl)(struct file *, unsigned int, unsigned long);
void (*adec_params)(struct audio *);
};
struct audio {
spinlock_t dsp_lock;
uint8_t out_needed; /* number of buffers the dsp is waiting for */
struct list_head out_queue; /* queue to retain output buffers */
atomic_t out_bytes;
struct mutex lock;
struct mutex write_lock;
wait_queue_head_t write_wait;
struct msm_adsp_module *audplay;
/* configuration to use on next enable */
uint32_t out_sample_rate;
uint32_t out_channel_mode;
uint32_t out_bits; /* bits per sample (used by PCM decoder) */
/* data allocated for various buffers */
char *data;
int32_t phys; /* physical address of write buffer */
uint32_t drv_status;
int wflush; /* Write flush */
int opened;
int enabled;
int running;
int stopped; /* set when stopped, cleared on flush */
int buf_refresh;
int teos; /* valid only if tunnel mode & no data left for decoder */
enum msm_aud_decoder_state dec_state; /* Represents decoder state */
int reserved; /* A byte is being reserved */
char rsv_byte; /* Handle odd length user data */
const char *module_name;
unsigned queue_id;
uint16_t dec_id;
uint32_t read_ptr_offset;
int16_t source;
#ifdef CONFIG_HAS_EARLYSUSPEND
struct audio_suspend_ctl suspend_ctl;
#endif
#ifdef CONFIG_DEBUG_FS
struct dentry *dentry;
#endif
wait_queue_head_t wait;
struct list_head free_event_queue;
struct list_head event_queue;
wait_queue_head_t event_wait;
spinlock_t event_queue_lock;
struct mutex get_event_lock;
int event_abort;
/* AV sync Info */
int avsync_flag; /* Flag to indicate feedback from DSP */
wait_queue_head_t avsync_wait;/* Wait queue for AV Sync Message */
/* flags, 48 bits sample/bytes counter per channel */
uint16_t avsync[AUDPP_AVSYNC_CH_COUNT * AUDPP_AVSYNC_NUM_WORDS + 1];
uint32_t device_events;
uint32_t device_switch; /* Flag to indicate device switch */
uint64_t bytecount_consumed;
uint64_t bytecount_head;
uint64_t bytecount_given;
uint64_t bytecount_query;
struct list_head pmem_region_queue; /* protected by lock */
int eq_enable;
int eq_needs_commit;
struct audpp_cmd_cfg_object_params_eqalizer eq;
struct audpp_cmd_cfg_object_params_volume vol_pan;
unsigned int minor_no;
struct codec_operations codec_ops;
};
#endif /* !CODEC_UTILS_H */
|
// Scintilla source code edit control
/** @file Catalogue.h
** Lexer infrastructure.
**/
// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef CATALOGUE_H
#define CATALOGUE_H
#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif
class Catalogue {
public:
static const LexerModule *Find(int language);
static const LexerModule *Find(const char *languageName);
static void AddLexerModule(LexerModule *plm);
};
#ifdef SCI_NAMESPACE
}
#endif
#endif
|
#ifndef _XT_PHYSDEV_H
#define _XT_PHYSDEV_H
#include <linux/if.h>
#include <uapi/linux/netfilter/xt_physdev.h>
#endif /*_XT_PHYSDEV_H*/
|
/* Check for thumb1 far jump. This is the extreme case that far jump
* will be used with minimum number of instructions. By passing this case
* it means the heuristic of saving lr for far jump meets the most extreme
* requirement. */
/* { dg-options "-Os" } */
/* { dg-skip-if "" { ! { arm_thumb1 } } } */
volatile register int r4 asm ("r4");
void f3(int i)
{
#define GO(n) \
extern volatile int g_##n; \
r4=(int)&g_##n;
#define GO8(n) \
GO(n##_0) \
GO(n##_1) \
GO(n##_2) \
GO(n##_3) \
GO(n##_4) \
GO(n##_5) \
GO(n##_6) \
GO(n##_7)
#define GO64(n) \
GO8(n##_0) \
GO8(n##_1) \
GO8(n##_2) \
GO8(n##_3) \
GO8(n##_4) \
GO8(n##_5) \
GO8(n##_6) \
GO8(n##_7) \
#define GO498(n) \
GO64(n##_0) \
GO64(n##_1) \
GO64(n##_2) \
GO64(n##_3) \
GO64(n##_4) \
GO64(n##_5) \
GO64(n##_6) \
GO8(n##_0) \
GO8(n##_1) \
GO8(n##_2) \
GO8(n##_3) \
GO8(n##_4) \
GO8(n##_5) \
GO(n##_0) \
GO(n##_1) \
if (i) {
GO498(0);
}
}
/* { dg-final { scan-assembler "push.*lr" } } */
|
/* Copyright 2019 HnahKB
*
* 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/>.
*/
#pragma once
#include "quantum.h"
#define XXX KC_NO
#define LAYOUT_all( \
k00, k01, k02, k03, k04, k06, k07, k08, k09, k60, k61, k62, k63, k64, k65, k66, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k70, k71, k72, k73, k74, k75, k76, k67, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k80, k81, k82, k83, k78, k77, k68, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k90, k91, k92, k84, \
k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k95, k94, k85, k93, k79, \
k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k69 \
) { \
{ k00, k01, k02, k03, k04, XXX, k06, k07, k08, k09 }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39 }, \
{ k40, k41, k42, k43, k44, k45, k46, k47, k48, k49 }, \
{ k50, k51, k52, k53, k54, k55, k56, k57, k58, k59 }, \
{ k60, k61, k62, k63, k64, k65, k66, k67, k68, k69 }, \
{ k70, k71, k72, k73, k74, k75, k76, k77, k78, k79 }, \
{ k80, k81, k82, k83, k84, k85, XXX, XXX, XXX, XXX }, \
{ k90, k91, k92, k93, k94, k95, XXX, XXX, XXX, XXX } \
}
#define LAYOUT_tkl_ansi( \
k00, k01, k02, k03, k04, k06, k07, k08, k09, k60, k61, k62, k63, k64, k65, k66, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k70, k71, k72, k73, k75, k76, k67, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k80, k81, k82, k83, k78, k77, k68, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k90, k91, k84, \
k40, k42, k43, k44, k45, k46, k47, k48, k49, k95, k94, k93, k79, \
k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k69 \
) { \
{ k00, k01, k02, k03, k04, XXX, k06, k07, k08, k09 }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39 }, \
{ k40, XXX, k42, k43, k44, k45, k46, k47, k48, k49 }, \
{ k50, k51, k52, k53, k54, k55, k56, k57, k58, k59 }, \
{ k60, k61, k62, k63, k64, k65, k66, k67, k68, k69 }, \
{ k70, k71, k72, k73, XXX, k75, k76, k77, k78, k79 }, \
{ k80, k81, k82, k83, k84, XXX, XXX, XXX, XXX, XXX }, \
{ k90, k91, XXX, k93, k94, k95, XXX, XXX, XXX, XXX } \
}
#define LAYOUT_tkl_iso( \
k00, k01, k02, k03, k04, k06, k07, k08, k09, k60, k61, k62, k63, k64, k65, k66, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k70, k71, k72, k73, k75, k76, k67, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k80, k81, k82, k78, k77, k68, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k90, k91, k92, k84, \
k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k95, k94, k93, k79, \
k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k69 \
) { \
{ k00, k01, k02, k03, k04, XXX, k06, k07, k08, k09 }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39 }, \
{ k40, k41, k42, k43, k44, k45, k46, k47, k48, k49 }, \
{ k50, k51, k52, k53, k54, k55, k56, k57, k58, k59 }, \
{ k60, k61, k62, k63, k64, k65, k66, k67, k68, k69 }, \
{ k70, k71, k72, k73, XXX, k75, k76, k77, k78, k79 }, \
{ k80, k81, k82, XXX, k84, XXX, XXX, XXX, XXX, XXX }, \
{ k90, k91, k92, k93, k94, k95, XXX, XXX, XXX, XXX } \
}
|
/*
* Copyright (c) 2009, Christoph Hellwig
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would 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 the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_da_btree.h"
#include "xfs_bmap_btree.h"
#include "xfs_alloc_btree.h"
#include "xfs_ialloc_btree.h"
#include "xfs_dinode.h"
#include "xfs_inode.h"
#include "xfs_btree.h"
#include "xfs_mount.h"
#include "xfs_ialloc.h"
#include "xfs_itable.h"
#include "xfs_alloc.h"
#include "xfs_bmap.h"
#include "xfs_attr.h"
#include "xfs_attr_leaf.h"
#include "xfs_log_priv.h"
#include "xfs_buf_item.h"
#include "xfs_quota.h"
#include "xfs_iomap.h"
#include "xfs_aops.h"
#include "xfs_dquot_item.h"
#include "xfs_dquot.h"
#include "xfs_log_recover.h"
#include "xfs_inode_item.h"
/*
* We include this last to have the helpers above available for the trace
* event implementations.
*/
#define CREATE_TRACE_POINTS
#include "xfs_trace.h"
|
/**********************************************************************
* Author: Cavium, Inc.
*
* Contact: support@cavium.com
* Please include "LiquidIO" in the subject.
*
* Copyright (c) 2003-2016 Cavium, Inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, Version 2, as
* published by the Free Software Foundation.
*
* This file is distributed in the hope that it will be useful, but
* AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
* NONINFRINGEMENT. See the GNU General Public License for more
* details.
**********************************************************************/
/*! \file octeon_mem_ops.h
* \brief Host Driver: Routines used to read/write Octeon memory.
*/
#ifndef __OCTEON_MEM_OPS_H__
#define __OCTEON_MEM_OPS_H__
/** Read a 64-bit value from a BAR1 mapped core memory address.
* @param oct - pointer to the octeon device.
* @param core_addr - the address to read from.
*
* The range_idx gives the BAR1 index register for the range of address
* in which core_addr is mapped.
*
* @return 64-bit value read from Core memory
*/
u64 octeon_read_device_mem64(struct octeon_device *oct, u64 core_addr);
/** Read a 32-bit value from a BAR1 mapped core memory address.
* @param oct - pointer to the octeon device.
* @param core_addr - the address to read from.
*
* @return 32-bit value read from Core memory
*/
u32 octeon_read_device_mem32(struct octeon_device *oct, u64 core_addr);
/** Write a 32-bit value to a BAR1 mapped core memory address.
* @param oct - pointer to the octeon device.
* @param core_addr - the address to write to.
* @param val - 32-bit value to write.
*/
void
octeon_write_device_mem32(struct octeon_device *oct,
u64 core_addr,
u32 val);
/** Read multiple bytes from Octeon memory.
*/
void
octeon_pci_read_core_mem(struct octeon_device *oct,
u64 coreaddr,
u8 *buf,
u32 len);
/** Write multiple bytes into Octeon memory.
*/
void
octeon_pci_write_core_mem(struct octeon_device *oct,
u64 coreaddr,
u8 *buf,
u32 len);
#endif
|
typedef int BaseIE;
|
/*
* Wireless Host Controller (WHC) hardware access helpers.
*
* Copyright (C) 2007 Cambridge Silicon Radio Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version
* 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/kernel.h>
#include <linux/dma-mapping.h>
#include <linux/uwb/umc.h>
#include "../../wusbcore/wusbhc.h"
#include "whcd.h"
void whc_write_wusbcmd(struct whc *whc, u32 mask, u32 val)
{
unsigned long flags;
u32 cmd;
spin_lock_irqsave(&whc->lock, flags);
cmd = le_readl(whc->base + WUSBCMD);
cmd = (cmd & ~mask) | val;
le_writel(cmd, whc->base + WUSBCMD);
spin_unlock_irqrestore(&whc->lock, flags);
}
/**
* whc_do_gencmd - start a generic command via the WUSBGENCMDSTS register
* @whc: the WHCI HC
* @cmd: command to start.
* @params: parameters for the command (the WUSBGENCMDPARAMS register value).
* @addr: pointer to any data for the command (may be NULL).
* @len: length of the data (if any).
*/
int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len)
{
unsigned long flags;
dma_addr_t dma_addr;
int t;
int ret = 0;
mutex_lock(&whc->mutex);
/* Wait for previous command to complete. */
t = wait_event_timeout(whc->cmd_wq,
(le_readl(whc->base + WUSBGENCMDSTS) & WUSBGENCMDSTS_ACTIVE) == 0,
WHC_GENCMD_TIMEOUT_MS);
if (t == 0) {
dev_err(&whc->umc->dev, "generic command timeout (%04x/%04x)\n",
le_readl(whc->base + WUSBGENCMDSTS),
le_readl(whc->base + WUSBGENCMDPARAMS));
ret = -ETIMEDOUT;
goto out;
}
if (addr) {
memcpy(whc->gen_cmd_buf, addr, len);
dma_addr = whc->gen_cmd_buf_dma;
} else
dma_addr = 0;
/* Poke registers to start cmd. */
spin_lock_irqsave(&whc->lock, flags);
le_writel(params, whc->base + WUSBGENCMDPARAMS);
le_writeq(dma_addr, whc->base + WUSBGENADDR);
le_writel(WUSBGENCMDSTS_ACTIVE | WUSBGENCMDSTS_IOC | cmd,
whc->base + WUSBGENCMDSTS);
spin_unlock_irqrestore(&whc->lock, flags);
out:
mutex_unlock(&whc->mutex);
return ret;
}
/**
* whc_hw_error - recover from a hardware error
* @whc: the WHCI HC that broke.
* @reason: a description of the failure.
*
* Recover from broken hardware with a full reset.
*/
void whc_hw_error(struct whc *whc, const char *reason)
{
struct wusbhc *wusbhc = &whc->wusbhc;
dev_err(&whc->umc->dev, "hardware error: %s\n", reason);
wusbhc_reset_all(wusbhc);
}
|
/*
* Copyright 2012 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@class ZXBitMatrix, ZXIntArray, ZXQRCodeECB, ZXQRCodeECBlocks, ZXQRCodeErrorCorrectionLevel;
/**
* See ISO 18004:2006 Annex D
*/
@interface ZXQRCodeVersion : NSObject
@property (nonatomic, assign, readonly) int versionNumber;
@property (nonatomic, strong, readonly) ZXIntArray *alignmentPatternCenters;
@property (nonatomic, strong, readonly) NSArray *ecBlocks;
@property (nonatomic, assign, readonly) int totalCodewords;
@property (nonatomic, assign, readonly) int dimensionForVersion;
- (ZXQRCodeECBlocks *)ecBlocksForLevel:(ZXQRCodeErrorCorrectionLevel *)ecLevel;
+ (ZXQRCodeVersion *)provisionalVersionForDimension:(int)dimension;
+ (ZXQRCodeVersion *)versionForNumber:(int)versionNumber;
+ (ZXQRCodeVersion *)decodeVersionInformation:(int)versionBits;
- (ZXBitMatrix *)buildFunctionPattern;
@end
/**
* Encapsulates a set of error-correction blocks in one symbol version. Most versions will
* use blocks of differing sizes within one version, so, this encapsulates the parameters for
* each set of blocks. It also holds the number of error-correction codewords per block since it
* will be the same across all blocks within one version.
*/
@interface ZXQRCodeECBlocks : NSObject
@property (nonatomic, assign, readonly) int ecCodewordsPerBlock;
@property (nonatomic, assign, readonly) int numBlocks;
@property (nonatomic, assign, readonly) int totalECCodewords;
@property (nonatomic, strong, readonly) NSArray *ecBlocks;
- (id)initWithEcCodewordsPerBlock:(int)ecCodewordsPerBlock ecBlocks:(ZXQRCodeECB *)ecBlocks;
- (id)initWithEcCodewordsPerBlock:(int)ecCodewordsPerBlock ecBlocks1:(ZXQRCodeECB *)ecBlocks1 ecBlocks2:(ZXQRCodeECB *)ecBlocks2;
+ (ZXQRCodeECBlocks *)ecBlocksWithEcCodewordsPerBlock:(int)ecCodewordsPerBlock ecBlocks:(ZXQRCodeECB *)ecBlocks;
+ (ZXQRCodeECBlocks *)ecBlocksWithEcCodewordsPerBlock:(int)ecCodewordsPerBlock ecBlocks1:(ZXQRCodeECB *)ecBlocks1 ecBlocks2:(ZXQRCodeECB *)ecBlocks2;
@end
/**
* Encapsualtes the parameters for one error-correction block in one symbol version.
* This includes the number of data codewords, and the number of times a block with these
* parameters is used consecutively in the QR code version's format.
*/
@interface ZXQRCodeECB : NSObject
@property (nonatomic, assign, readonly) int count;
@property (nonatomic, assign, readonly) int dataCodewords;
- (id)initWithCount:(int)count dataCodewords:(int)dataCodewords;
+ (ZXQRCodeECB *)ecbWithCount:(int)count dataCodewords:(int)dataCodewords;
@end
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_KASAN_H
#define __ASM_KASAN_H
#ifndef __ASSEMBLY__
#include <linux/linkage.h>
#include <asm/memory.h>
#include <asm/mte-kasan.h>
#include <asm/pgtable-types.h>
#define arch_kasan_set_tag(addr, tag) __tag_set(addr, tag)
#define arch_kasan_reset_tag(addr) __tag_reset(addr)
#define arch_kasan_get_tag(addr) __tag_get(addr)
#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
void kasan_init(void);
/*
* KASAN_SHADOW_START: beginning of the kernel virtual addresses.
* KASAN_SHADOW_END: KASAN_SHADOW_START + 1/N of kernel virtual addresses,
* where N = (1 << KASAN_SHADOW_SCALE_SHIFT).
*
* KASAN_SHADOW_OFFSET:
* This value is used to map an address to the corresponding shadow
* address by the following formula:
* shadow_addr = (address >> KASAN_SHADOW_SCALE_SHIFT) + KASAN_SHADOW_OFFSET
*
* (1 << (64 - KASAN_SHADOW_SCALE_SHIFT)) shadow addresses that lie in range
* [KASAN_SHADOW_OFFSET, KASAN_SHADOW_END) cover all 64-bits of virtual
* addresses. So KASAN_SHADOW_OFFSET should satisfy the following equation:
* KASAN_SHADOW_OFFSET = KASAN_SHADOW_END -
* (1ULL << (64 - KASAN_SHADOW_SCALE_SHIFT))
*/
#define _KASAN_SHADOW_START(va) (KASAN_SHADOW_END - (1UL << ((va) - KASAN_SHADOW_SCALE_SHIFT)))
#define KASAN_SHADOW_START _KASAN_SHADOW_START(vabits_actual)
void kasan_copy_shadow(pgd_t *pgdir);
asmlinkage void kasan_early_init(void);
#else
static inline void kasan_init(void) { }
static inline void kasan_copy_shadow(pgd_t *pgdir) { }
#endif
#endif
#endif
|
/*******************************************************************************
Copyright (C) Marvell International Ltd. and its affiliates
This software file (the "File") is owned and distributed by Marvell
International Ltd. and/or its affiliates ("Marvell") under the following
alternative licensing terms. Once you have made an election to distribute the
File under one of the following license alternatives, please (i) delete this
introductory statement regarding license alternatives, (ii) delete the two
license alternatives that you have not elected to use and (iii) preserve the
Marvell copyright notice above.
********************************************************************************
Marvell Commercial License Option
If you received this File from Marvell and you have entered into a commercial
license agreement (a "Commercial License") with Marvell, the File is licensed
to you under the terms of the applicable Commercial License.
********************************************************************************
Marvell GPL License Option
If you received this File from Marvell, you may opt to use, redistribute and/or
modify this File in accordance with the terms and conditions of the General
Public License Version 2, June 1991 (the "GPL License"), a copy of which is
available along with the File in the license.txt file or by writing to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 or
on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY
DISCLAIMED. The GPL License provides additional details about this warranty
disclaimer.
********************************************************************************
Marvell BSD License Option
If you received this File from Marvell, you may opt to use, redistribute and/or
modify this File under the following licensing terms.
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 Marvell nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
#ifndef __INCmvSpiCmndhH
#define __INCmvSpiCmndhH
#include "mvTypes.h"
/* Function Prototypes */
/* Simultanuous Read and write */
MV_STATUS mvSpiReadAndWrite (MV_U8* pRxBuff, MV_U8* pTxBuff, MV_U32 buffSize);
/* write command - write a command and then write data */
MV_STATUS mvSpiWriteThenWrite (MV_U8* pCmndBuff, MV_U32 cmndSize, MV_U8* pTxDataBuff, MV_U32 txDataSize);
/* read command - write a command and then read data by writing dummy data */
MV_STATUS mvSpiWriteThenRead (MV_U8* pCmndBuff, MV_U32 cmndSize, MV_U8* pRxDataBuff,
MV_U32 rxDataSize,MV_U32 dummyBytesToRead);
#endif /* __INCmvSpiCmndhH */
|
/*
ioctl control functions
Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl>
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 IVTV_CONTROLS_H
#define IVTV_CONTROLS_H
extern struct cx2341x_handler_ops ivtv_cxhdl_ops;
extern const struct v4l2_ctrl_ops ivtv_hdl_out_ops;
int ivtv_g_pts_frame(struct ivtv *itv, s64 *pts, s64 *frame);
#endif
|
#undef TRACE_SYSTEM
#define TRACE_SYSTEM hyperv
#if !defined(_TRACE_HYPERV_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HYPERV_H
#include <linux/tracepoint.h>
#if IS_ENABLED(CONFIG_HYPERV)
TRACE_EVENT(hyperv_mmu_flush_tlb_others,
TP_PROTO(const struct cpumask *cpus,
const struct flush_tlb_info *info),
TP_ARGS(cpus, info),
TP_STRUCT__entry(
__field(unsigned int, ncpus)
__field(struct mm_struct *, mm)
__field(unsigned long, addr)
__field(unsigned long, end)
),
TP_fast_assign(__entry->ncpus = cpumask_weight(cpus);
__entry->mm = info->mm;
__entry->addr = info->start;
__entry->end = info->end;
),
TP_printk("ncpus %d mm %p addr %lx, end %lx",
__entry->ncpus, __entry->mm,
__entry->addr, __entry->end)
);
TRACE_EVENT(hyperv_nested_flush_guest_mapping,
TP_PROTO(u64 as, int ret),
TP_ARGS(as, ret),
TP_STRUCT__entry(
__field(u64, as)
__field(int, ret)
),
TP_fast_assign(__entry->as = as;
__entry->ret = ret;
),
TP_printk("address space %llx ret %d", __entry->as, __entry->ret)
);
TRACE_EVENT(hyperv_nested_flush_guest_mapping_range,
TP_PROTO(u64 as, int ret),
TP_ARGS(as, ret),
TP_STRUCT__entry(
__field(u64, as)
__field(int, ret)
),
TP_fast_assign(__entry->as = as;
__entry->ret = ret;
),
TP_printk("address space %llx ret %d", __entry->as, __entry->ret)
);
TRACE_EVENT(hyperv_send_ipi_mask,
TP_PROTO(const struct cpumask *cpus,
int vector),
TP_ARGS(cpus, vector),
TP_STRUCT__entry(
__field(unsigned int, ncpus)
__field(int, vector)
),
TP_fast_assign(__entry->ncpus = cpumask_weight(cpus);
__entry->vector = vector;
),
TP_printk("ncpus %d vector %x",
__entry->ncpus, __entry->vector)
);
#endif /* CONFIG_HYPERV */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH asm/trace/
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE hyperv
#endif /* _TRACE_HYPERV_H */
/* This part must be outside protection */
#include <trace/define_trace.h>
|
/**
@file HashTrait.h
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2008-10-01
@edited 2009-11-01
Copyright 2000-2009, Morgan McGuire.
All rights reserved.
*/
#ifndef G3D_HashTrait_h
#define G3D_HashTrait_h
#include "G3D/platform.h"
#include "G3D/Crypto.h"
#include "G3D/g3dmath.h"
#include "G3D/uint128.h"
/** Must be specialized for custom types.
@see G3D::Table for specialization requirements.
*/
template <typename T> struct HashTrait{};
template <typename T> struct HashTrait<T*> {
static size_t hashCode(const void* k) { return reinterpret_cast<size_t>(k); }
};
#if 0
template <> struct HashTrait <int> {
static size_t hashCode(int k) { return static_cast<size_t>(k); }
};
#endif
template <> struct HashTrait <G3D::int16> {
static size_t hashCode(G3D::int16 k) { return static_cast<size_t>(k); }
};
template <> struct HashTrait <G3D::uint16> {
static size_t hashCode(G3D::uint16 k) { return static_cast<size_t>(k); }
};
//template <> struct HashTrait <int> {
// static size_t hashCode(int k) { return static_cast<size_t>(k); }
//};
template <> struct HashTrait <G3D::int32> {
static size_t hashCode(G3D::int32 k) { return static_cast<size_t>(k); }
};
template <> struct HashTrait <G3D::uint32> {
static size_t hashCode(G3D::uint32 k) { return static_cast<size_t>(k); }
};
#if 0
template <> struct HashTrait <long unsigned int> {
static size_t hashCode(G3D::uint32 k) { return static_cast<size_t>(k); }
};
#endif
template <> struct HashTrait <G3D::int64> {
static size_t hashCode(G3D::int64 k) { return static_cast<size_t>(k); }
};
template <> struct HashTrait <G3D::uint64> {
static size_t hashCode(G3D::uint64 k) { return static_cast<size_t>(k); }
};
template <> struct HashTrait <std::string> {
static size_t hashCode(const std::string& k) { return static_cast<size_t>(G3D::Crypto::crc32(k.c_str(), k.size())); }
};
template <> struct HashTrait<G3D::uint128> {
// Use the FNV-1 hash (http://isthe.com/chongo/tech/comp/fnv/#FNV-1).
static size_t hashCode(G3D::uint128 key) {
static const G3D::uint128 FNV_PRIME_128(1 << 24, 0x159);
static const G3D::uint128 FNV_OFFSET_128(0xCF470AAC6CB293D2ULL, 0xF52F88BF32307F8FULL);
G3D::uint128 hash = FNV_OFFSET_128;
G3D::uint128 mask(0, 0xFF);
for (int i = 0; i < 16; ++i) {
hash *= FNV_PRIME_128;
hash ^= (mask & key);
key >>= 8;
}
G3D::uint64 foldedHash = hash.hi ^ hash.lo;
return static_cast<size_t>((foldedHash >> 32) ^ (foldedHash & 0xFFFFFFFF));
}
};
#endif
|
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef AsyncFileSystemCallbacks_h
#define AsyncFileSystemCallbacks_h
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystem.h"
#include "AsyncFileWriter.h"
#include "BlobData.h"
#include "FileMetadata.h"
#include <wtf/text/WTFString.h>
namespace WebCore {
class AsyncFileSystemCallbacks {
WTF_MAKE_NONCOPYABLE(AsyncFileSystemCallbacks);
public:
AsyncFileSystemCallbacks() { }
// Called when a requested operation is completed successfully.
virtual void didSucceed() { ASSERT_NOT_REACHED(); }
// Called when a requested file system is opened.
virtual void didOpenFileSystem(const String& /* name */, const KURL& /* rootURL */, PassOwnPtr<AsyncFileSystem>) { ASSERT_NOT_REACHED(); }
// Called when a file metadata is read successfully.
virtual void didReadMetadata(const FileMetadata&) { ASSERT_NOT_REACHED(); }
// Called when a snapshot file is created successfully.
virtual void didCreateSnapshotFile(const FileMetadata&, PassRefPtr<BlobDataHandle> /* snapshot */) { ASSERT_NOT_REACHED(); }
// Called when a directory entry is read.
virtual void didReadDirectoryEntry(const String& /* name */, bool /* isDirectory */) { ASSERT_NOT_REACHED(); }
// Called after a chunk of directory entries have been read (i.e. indicates it's good time to call back to the application). If hasMore is true there can be more chunks.
virtual void didReadDirectoryEntries(bool /* hasMore */) { ASSERT_NOT_REACHED(); }
// Called when an AsyncFileWrter has been created successfully.
virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long /* length */) { ASSERT_NOT_REACHED(); }
// Called when there was an error.
virtual void didFail(int code) = 0;
virtual ~AsyncFileSystemCallbacks() { }
};
} // namespace
#endif // ENABLE(FILE_SYSTEM)
#endif // AsyncFileSystemCallbacks_h
|
#include "hw/xen/xen_backend.h"
#include "sysemu/blockdev.h"
/* ------------------------------------------------------------- */
struct xs_dirs {
char *xs_dir;
QTAILQ_ENTRY(xs_dirs) list;
};
static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup = QTAILQ_HEAD_INITIALIZER(xs_cleanup);
static void xen_config_cleanup_dir(char *dir)
{
struct xs_dirs *d;
d = g_malloc(sizeof(*d));
d->xs_dir = dir;
QTAILQ_INSERT_TAIL(&xs_cleanup, d, list);
}
void xen_config_cleanup(void)
{
struct xs_dirs *d;
QTAILQ_FOREACH(d, &xs_cleanup, list) {
xs_rm(xenstore, 0, d->xs_dir);
}
}
/* ------------------------------------------------------------- */
static int xen_config_dev_mkdir(char *dev, int p)
{
struct xs_permissions perms[2] = {{
.id = 0, /* set owner: dom0 */
},{
.id = xen_domid,
.perms = p,
}};
if (!xs_mkdir(xenstore, 0, dev)) {
xen_be_printf(NULL, 0, "xs_mkdir %s: failed\n", dev);
return -1;
}
xen_config_cleanup_dir(g_strdup(dev));
if (!xs_set_permissions(xenstore, 0, dev, perms, 2)) {
xen_be_printf(NULL, 0, "xs_set_permissions %s: failed\n", dev);
return -1;
}
return 0;
}
static int xen_config_dev_dirs(const char *ftype, const char *btype, int vdev,
char *fe, char *be, int len)
{
char *dom;
dom = xs_get_domain_path(xenstore, xen_domid);
snprintf(fe, len, "%s/device/%s/%d", dom, ftype, vdev);
free(dom);
dom = xs_get_domain_path(xenstore, 0);
snprintf(be, len, "%s/backend/%s/%d/%d", dom, btype, xen_domid, vdev);
free(dom);
xen_config_dev_mkdir(fe, XS_PERM_READ | XS_PERM_WRITE);
xen_config_dev_mkdir(be, XS_PERM_READ);
return 0;
}
static int xen_config_dev_all(char *fe, char *be)
{
/* frontend */
if (xen_protocol)
xenstore_write_str(fe, "protocol", xen_protocol);
xenstore_write_int(fe, "state", XenbusStateInitialising);
xenstore_write_int(fe, "backend-id", 0);
xenstore_write_str(fe, "backend", be);
/* backend */
xenstore_write_str(be, "domain", qemu_name ? qemu_name : "no-name");
xenstore_write_int(be, "online", 1);
xenstore_write_int(be, "state", XenbusStateInitialising);
xenstore_write_int(be, "frontend-id", xen_domid);
xenstore_write_str(be, "frontend", fe);
return 0;
}
/* ------------------------------------------------------------- */
int xen_config_dev_blk(DriveInfo *disk)
{
char fe[256], be[256], device_name[32];
int vdev = 202 * 256 + 16 * disk->unit;
int cdrom = disk->media_cd;
const char *devtype = cdrom ? "cdrom" : "disk";
const char *mode = cdrom ? "r" : "w";
const char *filename = qemu_opt_get(disk->opts, "file");
snprintf(device_name, sizeof(device_name), "xvd%c", 'a' + disk->unit);
xen_be_printf(NULL, 1, "config disk %d [%s]: %s\n",
disk->unit, device_name, filename);
xen_config_dev_dirs("vbd", "qdisk", vdev, fe, be, sizeof(fe));
/* frontend */
xenstore_write_int(fe, "virtual-device", vdev);
xenstore_write_str(fe, "device-type", devtype);
/* backend */
xenstore_write_str(be, "dev", device_name);
xenstore_write_str(be, "type", "file");
xenstore_write_str(be, "params", filename);
xenstore_write_str(be, "mode", mode);
/* common stuff */
return xen_config_dev_all(fe, be);
}
int xen_config_dev_nic(NICInfo *nic)
{
char fe[256], be[256];
char mac[20];
int vlan_id = -1;
net_hub_id_for_client(nic->netdev, &vlan_id);
snprintf(mac, sizeof(mac), "%02x:%02x:%02x:%02x:%02x:%02x",
nic->macaddr.a[0], nic->macaddr.a[1], nic->macaddr.a[2],
nic->macaddr.a[3], nic->macaddr.a[4], nic->macaddr.a[5]);
xen_be_printf(NULL, 1, "config nic %d: mac=\"%s\"\n", vlan_id, mac);
xen_config_dev_dirs("vif", "qnic", vlan_id, fe, be, sizeof(fe));
/* frontend */
xenstore_write_int(fe, "handle", vlan_id);
xenstore_write_str(fe, "mac", mac);
/* backend */
xenstore_write_int(be, "handle", vlan_id);
xenstore_write_str(be, "mac", mac);
/* common stuff */
return xen_config_dev_all(fe, be);
}
int xen_config_dev_vfb(int vdev, const char *type)
{
char fe[256], be[256];
xen_config_dev_dirs("vfb", "vfb", vdev, fe, be, sizeof(fe));
/* backend */
xenstore_write_str(be, "type", type);
/* common stuff */
return xen_config_dev_all(fe, be);
}
int xen_config_dev_vkbd(int vdev)
{
char fe[256], be[256];
xen_config_dev_dirs("vkbd", "vkbd", vdev, fe, be, sizeof(fe));
return xen_config_dev_all(fe, be);
}
int xen_config_dev_console(int vdev)
{
char fe[256], be[256];
xen_config_dev_dirs("console", "console", vdev, fe, be, sizeof(fe));
return xen_config_dev_all(fe, be);
}
|
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
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 __CCBOOL_H__
#define __CCBOOL_H__
#include "base/CCRef.h"
#include "base/CCDataVisitor.h"
NS_CC_BEGIN
/**
* @addtogroup data_structures
* @{
*/
class CC_DLL __Bool : public Ref, public Clonable
{
public:
__Bool(bool v)
: _value(v) {}
bool getValue() const {return _value;}
static __Bool* create(bool v)
{
__Bool* pRet = new __Bool(v);
if (pRet)
{
pRet->autorelease();
}
return pRet;
}
/* override functions */
virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); }
__Bool* clone() const
{
return __Bool::create(_value);
}
private:
bool _value;
};
// end of data_structure group
/// @}
NS_CC_END
#endif /* __CCBOOL_H__ */
|
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/types.h>
#include <cpu/irq.h>
#include "pci-sh5.h"
int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
int result = -1;
/* The complication here is that the PCI IRQ lines from the Cayman's 2
5V slots get into the CPU via a different path from the IRQ lines
from the 3 3.3V slots. Thus, we have to detect whether the card's
interrupts go via the 5V or 3.3V path, i.e. the 'bridge swizzling'
at the point where we cross from 5V to 3.3V is not the normal case.
The added complication is that we don't know that the 5V slots are
always bus 2, because a card containing a PCI-PCI bridge may be
plugged into a 3.3V slot, and this changes the bus numbering.
Also, the Cayman has an intermediate PCI bus that goes a custom
expansion board header (and to the secondary bridge). This bus has
never been used in practice.
The 1ary onboard PCI-PCI bridge is device 3 on bus 0
The 2ary onboard PCI-PCI bridge is device 0 on the 2ary bus of
the 1ary bridge.
*/
struct slot_pin {
int slot;
int pin;
} path[4];
int i=0;
while (dev->bus->number > 0) {
slot = path[i].slot = PCI_SLOT(dev->devfn);
pin = path[i].pin = pci_swizzle_interrupt_pin(dev, pin);
dev = dev->bus->self;
i++;
if (i > 3) panic("PCI path to root bus too long!\n");
}
slot = PCI_SLOT(dev->devfn);
/* This is the slot on bus 0 through which the device is eventually
reachable. */
/* Now work back up. */
if ((slot < 3) || (i == 0)) {
/* Bus 0 (incl. PCI-PCI bridge itself) : perform the final
swizzle now. */
result = IRQ_INTA + pci_swizzle_interrupt_pin(dev, pin) - 1;
} else {
i--;
slot = path[i].slot;
pin = path[i].pin;
if (slot > 0) {
panic("PCI expansion bus device found - not handled!\n");
} else {
if (i > 0) {
/* 5V slots */
i--;
slot = path[i].slot;
pin = path[i].pin;
/* 'pin' was swizzled earlier wrt slot, don't do it again. */
result = IRQ_P2INTA + (pin - 1);
} else {
/* IRQ for 2ary PCI-PCI bridge : unused */
result = -1;
}
}
}
return result;
}
|
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
*
* Permission to use, copy, modify, and distribute this software
* is freely granted, provided that this notice is preserved.
*/
#ifndef _NO_WORDEXP
#include <sys/param.h>
#include <sys/stat.h>
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <glob.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/queue.h>
#include <wordexp.h>
#include "wordexp2.h"
void
wordfree(wordexp_t *pwordexp)
{
ext_wordv_t *wordv;
if (pwordexp == NULL)
return;
if (pwordexp->we_wordv == NULL)
return;
wordv = WE_WORDV_TO_EXT_WORDV(pwordexp->we_wordv);
while (!SLIST_EMPTY(&wordv->list)) {
struct ewords_entry *entry = SLIST_FIRST(&wordv->list);
SLIST_REMOVE_HEAD(&wordv->list, next);
free(entry);
}
free(wordv);
pwordexp->we_wordv = NULL;
}
#endif /* !_NO_WORDEXP */
|
#ifndef _LINUX_UNISTD_H_
#define _LINUX_UNISTD_H_
extern int errno;
/*
* Include machine specific syscallX macros
*/
#include <asm/unistd.h>
#endif /* _LINUX_UNISTD_H_ */
|
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_CPP_H__
#define __MSM_CPP_H__
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/list.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <media/v4l2-subdev.h>
#include "msm_sd.h"
/* hw version info:
31:28 Major version
27:16 Minor version
15:0 Revision bits
**/
#define CPP_HW_VERSION_1_1_0 0x10010000
#define CPP_HW_VERSION_1_1_1 0x10010001
#define CPP_HW_VERSION_2_0_0 0x20000000
#define MAX_ACTIVE_CPP_INSTANCE 8
#define MAX_CPP_PROCESSING_FRAME 2
#define MAX_CPP_V4l2_EVENTS 30
#define MSM_CPP_MICRO_BASE 0x4000
#define MSM_CPP_MICRO_HW_VERSION 0x0000
#define MSM_CPP_MICRO_IRQGEN_STAT 0x0004
#define MSM_CPP_MICRO_IRQGEN_CLR 0x0008
#define MSM_CPP_MICRO_IRQGEN_MASK 0x000C
#define MSM_CPP_MICRO_FIFO_TX_DATA 0x0010
#define MSM_CPP_MICRO_FIFO_TX_STAT 0x0014
#define MSM_CPP_MICRO_FIFO_RX_DATA 0x0018
#define MSM_CPP_MICRO_FIFO_RX_STAT 0x001C
#define MSM_CPP_MICRO_BOOT_START 0x0020
#define MSM_CPP_MICRO_BOOT_LDORG 0x0024
#define MSM_CPP_MICRO_CLKEN_CTL 0x0030
#define MSM_CPP_CMD_GET_BOOTLOADER_VER 0x1
#define MSM_CPP_CMD_FW_LOAD 0x2
#define MSM_CPP_CMD_EXEC_JUMP 0x3
#define MSM_CPP_CMD_RESET_HW 0x5
#define MSM_CPP_CMD_PROCESS_FRAME 0x6
#define MSM_CPP_CMD_FLUSH_STREAM 0x7
#define MSM_CPP_CMD_CFG_MEM_PARAM 0x8
#define MSM_CPP_CMD_ERROR_REQUEST 0x9
#define MSM_CPP_CMD_GET_STATUS 0xA
#define MSM_CPP_CMD_GET_FW_VER 0xB
#define MSM_CPP_MSG_ID_CMD 0x3E646D63
#define MSM_CPP_MSG_ID_OK 0x0A0A4B4F
#define MSM_CPP_MSG_ID_TRAILER 0xABCDEFAA
#define MSM_CPP_MSG_ID_JUMP_ACK 0x00000001
#define MSM_CPP_MSG_ID_FRAME_ACK 0x00000002
#define MSM_CPP_MSG_ID_FRAME_NACK 0x00000003
#define MSM_CPP_MSG_ID_FLUSH_ACK 0x00000004
#define MSM_CPP_MSG_ID_FLUSH_NACK 0x00000005
#define MSM_CPP_MSG_ID_CFG_MEM_ACK 0x00000006
#define MSM_CPP_MSG_ID_CFG_MEM_INV 0x00000007
#define MSM_CPP_MSG_ID_ERROR_STATUS 0x00000008
#define MSM_CPP_MSG_ID_INVALID_CMD 0x00000009
#define MSM_CPP_MSG_ID_GEN_STATUS 0x0000000A
#define MSM_CPP_MSG_ID_FLUSHED 0x0000000B
#define MSM_CPP_MSG_ID_FW_VER 0x0000000C
#define MSM_CPP_JUMP_ADDRESS 0x20
#define MSM_CPP_START_ADDRESS 0x0
#define MSM_CPP_END_ADDRESS 0x3F00
#define MSM_CPP_POLL_RETRIES 20
#define MSM_CPP_TASKLETQ_SIZE 16
#define MSM_CPP_TX_FIFO_LEVEL 16
struct cpp_subscribe_info {
struct v4l2_fh *vfh;
uint32_t active;
};
enum cpp_state {
CPP_STATE_BOOT,
CPP_STATE_IDLE,
CPP_STATE_ACTIVE,
CPP_STATE_OFF,
};
enum msm_queue {
MSM_CAM_Q_CTRL, /* control command or control command status */
MSM_CAM_Q_VFE_EVT, /* adsp event */
MSM_CAM_Q_VFE_MSG, /* adsp message */
MSM_CAM_Q_V4L2_REQ, /* v4l2 request */
MSM_CAM_Q_VPE_MSG, /* vpe message */
MSM_CAM_Q_PP_MSG, /* pp message */
};
struct msm_queue_cmd {
struct list_head list_config;
struct list_head list_control;
struct list_head list_frame;
struct list_head list_pict;
struct list_head list_vpe_frame;
struct list_head list_eventdata;
enum msm_queue type;
void *command;
atomic_t on_heap;
struct timespec ts;
uint32_t error_code;
uint32_t trans_code;
};
struct msm_device_queue {
struct list_head list;
spinlock_t lock;
wait_queue_head_t wait;
int max;
int len;
const char *name;
};
struct msm_cpp_tasklet_queue_cmd {
struct list_head list;
uint32_t irq_status;
uint32_t tx_fifo[MSM_CPP_TX_FIFO_LEVEL];
uint32_t tx_level;
uint8_t cmd_used;
};
struct msm_cpp_buffer_map_info_t {
unsigned long len;
unsigned long phy_addr;
struct ion_handle *ion_handle;
struct msm_cpp_buffer_info_t buff_info;
};
struct msm_cpp_buffer_map_list_t {
struct msm_cpp_buffer_map_info_t map_info;
struct list_head entry;
};
struct msm_cpp_buff_queue_info_t {
uint32_t used;
uint16_t session_id;
uint16_t stream_id;
struct list_head vb2_buff_head;
struct list_head native_buff_head;
};
struct msm_cpp_work_t {
struct work_struct my_work;
struct cpp_device *cpp_dev;
};
struct cpp_device {
struct platform_device *pdev;
struct msm_sd_subdev msm_sd;
struct v4l2_subdev subdev;
struct resource *mem;
struct resource *irq;
struct resource *io;
struct resource *vbif_mem;
struct resource *vbif_io;
struct resource *cpp_hw_mem;
void __iomem *vbif_base;
void __iomem *base;
void __iomem *cpp_hw_base;
struct clk **cpp_clk;
struct regulator *fs_cpp;
struct mutex mutex;
enum cpp_state state;
uint8_t is_firmware_loaded;
char *fw_name_bin;
struct workqueue_struct *timer_wq;
struct msm_cpp_work_t *work;
int domain_num;
struct iommu_domain *domain;
struct device *iommu_ctx;
struct ion_client *client;
struct kref refcount;
/* Reusing proven tasklet from msm isp */
atomic_t irq_cnt;
uint8_t taskletq_idx;
spinlock_t tasklet_lock;
struct list_head tasklet_q;
struct tasklet_struct cpp_tasklet;
struct msm_cpp_tasklet_queue_cmd
tasklet_queue_cmd[MSM_CPP_TASKLETQ_SIZE];
struct cpp_subscribe_info cpp_subscribe_list[MAX_ACTIVE_CPP_INSTANCE];
uint32_t cpp_open_cnt;
struct cpp_hw_info hw_info;
struct msm_device_queue eventData_q; /* V4L2 Event Payload Queue */
/* Processing Queue
* store frame info for frames sent to microcontroller
*/
struct msm_device_queue processing_q;
struct msm_cpp_buff_queue_info_t *buff_queue;
uint32_t num_buffq;
struct v4l2_subdev *buf_mgr_subdev;
};
#endif /* __MSM_CPP_H__ */
|
/*
* Copyright (c) 2010 Broadcom Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _h_pcicfg_
#define _h_pcicfg_
#include <linux/pci_regs.h>
/* PCI configuration address space size */
#define PCI_SZPCR 256
/* Everything below is BRCM HND proprietary */
/* Brcm PCI configuration registers */
#define PCI_BAR0_WIN 0x80 /* backplane address space accessed by BAR0 */
#define PCI_SPROM_CONTROL 0x88 /* sprom property control */
#define PCI_INT_MASK 0x94 /* mask of PCI and other cores interrupts */
#define PCI_SBIM_SHIFT 8 /* backplane core interrupt mask bits offset */
#define PCI_BAR0_WIN2 0xac /* backplane address space accessed by second 4KB of BAR0 */
#define PCI_GPIO_IN 0xb0 /* pci config space gpio input (>=rev3) */
#define PCI_GPIO_OUT 0xb4 /* pci config space gpio output (>=rev3) */
#define PCI_GPIO_OUTEN 0xb8 /* pci config space gpio output enable (>=rev3) */
#define PCI_BAR0_SPROM_OFFSET (4 * 1024) /* bar0 + 4K accesses external sprom */
#define PCI_BAR0_PCIREGS_OFFSET (6 * 1024) /* bar0 + 6K accesses pci core registers */
#define PCI_BAR0_PCISBR_OFFSET (4 * 1024) /* pci core SB registers are at the end of the
* 8KB window, so their address is the "regular"
* address plus 4K
*/
#define PCI_BAR0_WINSZ (16 * 1024) /* bar0 window size Match with corerev 13 */
/* On pci corerev >= 13 and all pcie, the bar0 is now 16KB and it maps: */
#define PCI_16KB0_PCIREGS_OFFSET (8 * 1024) /* bar0 + 8K accesses pci/pcie core registers */
#define PCI_16KB0_CCREGS_OFFSET (12 * 1024) /* bar0 + 12K accesses chipc core registers */
#define PCI_SBIM_STATUS_SERR 0x4 /* backplane SBErr interrupt status */
#endif /* _h_pcicfg_ */
|
// -*- C++ -*-
//=============================================================================
/**
* @file XML_Svc_Conf.h
*
* $Id: XML_Svc_Conf.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Nanbor Wang <nanbor@cs.wustl.edu>
*/
//=============================================================================
#ifndef ACE_XML_SVC_CONF_H
#define ACE_XML_SVC_CONF_H
#include /**/ "ace/pre.h"
#include /**/ "ace/ACE_export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#if (ACE_USES_CLASSIC_SVC_CONF==0)
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_XML_Svc_Conf
*
* @brief This abstract class defines the common operations
* ACE_Service_Config expects when using the XML Service Config Parser.
*
* When implementing a concret XML_Svc_Conf class, be sure to overload
* the new/delete function so the dynamically created concret XML_Svc_Conf
* instance can be deleted from the original heap in the DLL/SO. The
* concret XML_Svc_Conf implementation will be put into a DLL/SO that
* ACE applications can link to dynamically using the ACE_DLL class.
* This DLL should include an operation as follow:
*
* extern "C" ACE_XML_Svc_Conf_Parser * _ACEXML_create_XML_Svc_Conf_Object (void);
*
*
*/
class ACE_Export ACE_XML_Svc_Conf
{
public:
typedef ACE_XML_Svc_Conf *(*Factory)(void);
virtual ~ACE_XML_Svc_Conf (void) = 0;
virtual int parse_file (const ACE_TCHAR file[]) = 0;
virtual int parse_string (const ACE_TCHAR str[]) = 0;
};
ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* ACE_USES_CLASSIC_SVC_CONF == 0 */
#include /**/ "ace/post.h"
#endif /* ACE_XML_SVC_CONF_H */
|
//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// 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 _CFHTTPSTREAM_H_
#define _CFHTTPSTREAM_H_
#import <CFNetwork/CFNetworkExport.h>
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPAttemptPersistentConnection;
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPFinalURL;
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPFinalRequest;
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPProxy;
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPProxyHost;
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPProxyPort;
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPRequestBytesWrittenCount;
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPResponseHeader;
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPSProxyHost;
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPSProxyPort;
CFNETWORK_EXPORT const CFStringRef kCFStreamPropertyHTTPShouldAutoredirect;
CFNETWORK_EXPORT const SInt32 kCFStreamErrorDomainHTTP;
CFNETWORK_EXPORT CFReadStreamRef CFReadStreamCreateForStreamedHTTPRequest(CFAllocatorRef alloc, CFHTTPMessageRef rqstHeaders, CFReadStreamRef rqstBody);
CFNETWORK_EXPORT CFReadStreamRef CFReadStreamCreateForHTTPRequest(CFAllocatorRef alloc, CFHTTPMessageRef rqst);
#endif // _CFHTTPSTREAM_H_
|
/***********************license start************************************
* Copyright (c) 2003-2017 Cavium, Inc.
* All rights reserved.
*
* License: one of 'Cavium License' or 'GNU General Public License Version 2'
*
* This file is provided under the terms of the Cavium License (see below)
* or under the terms of GNU General Public License, Version 2, as
* published by the Free Software Foundation. When using or redistributing
* this file, you may do so under either license.
*
* Cavium License: 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 Cavium 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, including technical data, may be subject to U.S. export
* control laws, including the U.S. Export Administration Act and its
* associated regulations, and may be subject to export or import
* regulations in other countries.
*
* TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
* AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS
* OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
* RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY
* REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT
* DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY)
* WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A
* PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET
* ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE
* ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES
* WITH YOU.
***********************license end**************************************/
#ifndef __ZIP_MAIN_H__
#define __ZIP_MAIN_H__
#include "zip_device.h"
#include "zip_regs.h"
/* PCI device IDs */
#define PCI_DEVICE_ID_THUNDERX_ZIP 0xA01A
/* ZIP device BARs */
#define PCI_CFG_ZIP_PF_BAR0 0 /* Base addr for normal regs */
/* Maximum available zip queues */
#define ZIP_MAX_NUM_QUEUES 8
#define ZIP_128B_ALIGN 7
/* Command queue buffer size */
#define ZIP_CMD_QBUF_SIZE (8064 + 8)
struct zip_registers {
char *reg_name;
u64 reg_offset;
};
/* ZIP Compression - Decompression stats */
struct zip_stats {
atomic64_t comp_req_submit;
atomic64_t comp_req_complete;
atomic64_t decomp_req_submit;
atomic64_t decomp_req_complete;
atomic64_t pending_req;
atomic64_t comp_in_bytes;
atomic64_t comp_out_bytes;
atomic64_t decomp_in_bytes;
atomic64_t decomp_out_bytes;
atomic64_t decomp_bad_reqs;
};
/* ZIP Instruction Queue */
struct zip_iq {
u64 *sw_head;
u64 *sw_tail;
u64 *hw_tail;
u64 done_cnt;
u64 pend_cnt;
u64 free_flag;
/* ZIP IQ lock */
spinlock_t lock;
};
/* ZIP Device */
struct zip_device {
u32 index;
void __iomem *reg_base;
struct pci_dev *pdev;
/* Different ZIP Constants */
u64 depth;
u64 onfsize;
u64 ctxsize;
struct zip_iq iq[ZIP_MAX_NUM_QUEUES];
struct zip_stats stats;
};
/* Prototypes */
struct zip_device *zip_get_device(int node_id);
int zip_get_node_id(void);
void zip_reg_write(u64 val, u64 __iomem *addr);
u64 zip_reg_read(u64 __iomem *addr);
void zip_update_cmd_bufs(struct zip_device *zip_dev, u32 queue);
u32 zip_load_instr(union zip_inst_s *instr, struct zip_device *zip_dev);
#endif /* ZIP_MAIN_H */
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __gnu_javax_sound_sampled_gstreamer_lines_GstSourceDataLine__
#define __gnu_javax_sound_sampled_gstreamer_lines_GstSourceDataLine__
#pragma interface
#include <gnu/javax/sound/sampled/gstreamer/lines/GstDataLine.h>
#include <gcj/array.h>
extern "Java"
{
namespace gnu
{
namespace javax
{
namespace sound
{
namespace sampled
{
namespace gstreamer
{
namespace lines
{
class GstPipeline;
class GstSourceDataLine;
}
}
}
}
}
}
namespace javax
{
namespace sound
{
namespace sampled
{
class AudioFormat;
}
}
}
}
class gnu::javax::sound::sampled::gstreamer::lines::GstSourceDataLine : public ::gnu::javax::sound::sampled::gstreamer::lines::GstDataLine
{
public:
GstSourceDataLine(::javax::sound::sampled::AudioFormat *);
virtual void open();
virtual void open(::javax::sound::sampled::AudioFormat *);
virtual void open(::javax::sound::sampled::AudioFormat *, jint);
virtual jint write(JArray< jbyte > *, jint, jint);
virtual jint available();
virtual void drain();
virtual void flush();
virtual jint getFramePosition();
virtual jlong getLongFramePosition();
virtual jlong getMicrosecondPosition();
virtual jboolean isActive();
virtual void start();
virtual void stop();
virtual void close();
virtual jboolean isRunning();
private:
::gnu::javax::sound::sampled::gstreamer::lines::GstPipeline * __attribute__((aligned(__alignof__( ::gnu::javax::sound::sampled::gstreamer::lines::GstDataLine)))) pipeline;
jboolean open__;
public:
static ::java::lang::Class class$;
};
#endif // __gnu_javax_sound_sampled_gstreamer_lines_GstSourceDataLine__
|
/******************************************************************************
*
* Copyright(c) 2009-2010 Realtek Corporation.
*
* Tmis program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* Tmis 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
* tmis program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* Tme full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* wlanfae <wlanfae@realtek.com>
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
* Hsinchu 300, Taiwan.
*
* Larry Finger <Larry.Finger@lwfinger.net>
*
*****************************************************************************/
#ifndef __RTL_CORE_H__
#define __RTL_CORE_H__
#define RTL_SUPPORTED_FILTERS \
(FIF_PROMISC_IN_BSS | \
FIF_ALLMULTI | FIF_CONTROL | \
FIF_OTHER_BSS | \
FIF_FCSFAIL | \
FIF_BCN_PRBRESP_PROMISC)
#define RTL_SUPPORTED_CTRL_FILTER 0xFF
extern const struct ieee80211_ops rtl_ops;
#endif
|
#include <math.h>
#include "headers/rint.h"
double rint(double x)
{
return _rint(x);
}
|
/**
@file units.h
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2009-08-21
@edited 2009-08-21
*/
#ifndef G3D_units_h
#define G3D_units_h
#include "G3D/platform.h"
namespace G3D {
/** Use <code>using namespace G3D::units;</code> to include all units
into your program. The units system is specifically designed not to
be general but to support commonly used units efficiently and
clearly. See http://en.wikipedia.org/wiki/SI_prefix for interesting facts
about SI/metric units and full definitions.*/
namespace units {
/** 1e-9 m */
inline float nanometers() {
return 1e-9f;
}
/** 1e-6 m */
inline float micrometers() {
return 1e-6f;
}
/** 0.001 m */
inline float millimeters() {
return 0.001f;
}
/** 0.01 m */
inline float centimeters() {
return 0.01f;
}
/** SI base unit of distance measure. */
inline float meters() {
return 1.0f;
}
/** 1000 m */
inline float kilometers() {
return 100.0f;
}
/** 0.0254 m */
inline float inches() {
return 0.0254f;
}
/** 0.3048 m */
inline float feet() {
return 0.3048f;
}
/** 0.9144 m */
inline float yards() {
return 0.9144f;
}
/** 1609.344 m */
inline float miles() {
return 1609.344f;
}
/////////////////////////////////////////////////////////////
/** SI base unit of angular measure. */
inline float radians() {
return 1.0f;
}
/** pi/180 */
inline float degrees() {
return 0.0174532925f;
}
//////////////////////////////////////////////////////////////
/** 1e-9 s */
inline float nanoseconds() {
return 1e-9f;
}
/** 1e-3 s */
inline float milliseconds() {
return 1e-3f;
}
/** Base unit of time */
inline float seconds() {
return 1.0;
}
/** 60 s */
inline float minutes() {
return 60.0f;
}
/** 3600 s */
inline float hours() {
return 3600.0f;
}
/** 86400 s */
inline float days() {
return 86400.0f;
}
/** 31556926 s */
inline float years() {
return 31556926.0f;
}
///////////////////////////////////////////
}
}
#endif
|
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "msm_generic_buf_mgr.h"
static struct msm_buf_mngr_device *msm_buf_mngr_dev;
struct v4l2_subdev *msm_buf_mngr_get_subdev(void)
{
return &msm_buf_mngr_dev->subdev.sd;
}
static int msm_buf_mngr_get_buf(struct msm_buf_mngr_device *buf_mngr_dev,
void __user *argp)
{
unsigned long flags;
struct msm_buf_mngr_info *buf_info =
(struct msm_buf_mngr_info *)argp;
struct msm_get_bufs *new_entry =
kzalloc(sizeof(struct msm_get_bufs), GFP_KERNEL);
if (!new_entry) {
pr_err("%s:No mem\n", __func__);
return -ENOMEM;
}
INIT_LIST_HEAD(&new_entry->entry);
new_entry->vb2_buf = buf_mngr_dev->vb2_ops.get_buf(buf_info->session_id,
buf_info->stream_id);
if (!new_entry->vb2_buf) {
pr_debug("%s:Get buf is null\n", __func__);
kfree(new_entry);
return -EINVAL;
}
new_entry->session_id = buf_info->session_id;
new_entry->stream_id = buf_info->stream_id;
spin_lock_irqsave(&buf_mngr_dev->buf_q_spinlock, flags);
list_add_tail(&new_entry->entry, &buf_mngr_dev->buf_qhead);
spin_unlock_irqrestore(&buf_mngr_dev->buf_q_spinlock, flags);
buf_info->index = new_entry->vb2_buf->v4l2_buf.index;
return 0;
}
static int msm_buf_mngr_buf_done(struct msm_buf_mngr_device *buf_mngr_dev,
struct msm_buf_mngr_info *buf_info)
{
unsigned long flags;
struct msm_get_bufs *bufs, *save;
int ret = -EINVAL;
spin_lock_irqsave(&buf_mngr_dev->buf_q_spinlock, flags);
list_for_each_entry_safe(bufs, save, &buf_mngr_dev->buf_qhead, entry) {
if ((bufs->session_id == buf_info->session_id) &&
(bufs->stream_id == buf_info->stream_id) &&
(bufs->vb2_buf->v4l2_buf.index == buf_info->index)) {
bufs->vb2_buf->v4l2_buf.sequence = buf_info->frame_id;
bufs->vb2_buf->v4l2_buf.timestamp = buf_info->timestamp;
ret = buf_mngr_dev->vb2_ops.buf_done
(bufs->vb2_buf,
buf_info->session_id,
buf_info->stream_id);
list_del_init(&bufs->entry);
kfree(bufs);
break;
}
}
spin_unlock_irqrestore(&buf_mngr_dev->buf_q_spinlock, flags);
return ret;
}
static int msm_buf_mngr_put_buf(struct msm_buf_mngr_device *buf_mngr_dev,
struct msm_buf_mngr_info *buf_info)
{
unsigned long flags;
struct msm_get_bufs *bufs, *save;
int ret = -EINVAL;
spin_lock_irqsave(&buf_mngr_dev->buf_q_spinlock, flags);
list_for_each_entry_safe(bufs, save, &buf_mngr_dev->buf_qhead, entry) {
if ((bufs->session_id == buf_info->session_id) &&
(bufs->stream_id == buf_info->stream_id) &&
(bufs->vb2_buf->v4l2_buf.index == buf_info->index)) {
ret = buf_mngr_dev->vb2_ops.put_buf(bufs->vb2_buf,
buf_info->session_id, buf_info->stream_id);
list_del_init(&bufs->entry);
kfree(bufs);
break;
}
}
spin_unlock_irqrestore(&buf_mngr_dev->buf_q_spinlock, flags);
return ret;
}
static long msm_buf_mngr_subdev_ioctl(struct v4l2_subdev *sd,
unsigned int cmd, void *arg)
{
int rc = 0;
struct msm_buf_mngr_device *buf_mngr_dev = v4l2_get_subdevdata(sd);
void __user *argp = (void __user *)arg;
if (!buf_mngr_dev) {
pr_err("%s buf manager device NULL\n", __func__);
rc = -ENOMEM;
return rc;
}
switch (cmd) {
case VIDIOC_MSM_BUF_MNGR_GET_BUF:
rc = msm_buf_mngr_get_buf(buf_mngr_dev, argp);
break;
case VIDIOC_MSM_BUF_MNGR_BUF_DONE:
rc = msm_buf_mngr_buf_done(buf_mngr_dev, argp);
break;
case VIDIOC_MSM_BUF_MNGR_PUT_BUF:
rc = msm_buf_mngr_put_buf(buf_mngr_dev, argp);
break;
default:
return -ENOIOCTLCMD;
}
return rc;
}
static struct v4l2_subdev_core_ops msm_buf_mngr_subdev_core_ops = {
.ioctl = msm_buf_mngr_subdev_ioctl,
};
static const struct v4l2_subdev_ops msm_buf_mngr_subdev_ops = {
.core = &msm_buf_mngr_subdev_core_ops,
};
static const struct of_device_id msm_buf_mngr_dt_match[] = {
{.compatible = "qcom,msm_buf_mngr"},
};
static int __init msm_buf_mngr_init(void)
{
int rc = 0;
msm_buf_mngr_dev = kzalloc(sizeof(*msm_buf_mngr_dev),
GFP_KERNEL);
if (WARN_ON(!msm_buf_mngr_dev)) {
pr_err("%s: not enough memory", __func__);
return -ENOMEM;
}
/* Sub-dev */
v4l2_subdev_init(&msm_buf_mngr_dev->subdev.sd,
&msm_buf_mngr_subdev_ops);
snprintf(msm_buf_mngr_dev->subdev.sd.name,
ARRAY_SIZE(msm_buf_mngr_dev->subdev.sd.name), "msm_buf_mngr");
msm_buf_mngr_dev->subdev.sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
v4l2_set_subdevdata(&msm_buf_mngr_dev->subdev.sd, msm_buf_mngr_dev);
media_entity_init(&msm_buf_mngr_dev->subdev.sd.entity, 0, NULL, 0);
msm_buf_mngr_dev->subdev.sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV;
msm_buf_mngr_dev->subdev.sd.entity.group_id =
MSM_CAMERA_SUBDEV_BUF_MNGR;
msm_buf_mngr_dev->subdev.close_seq = MSM_SD_CLOSE_4TH_CATEGORY;
rc = msm_sd_register(&msm_buf_mngr_dev->subdev);
if (rc != 0) {
pr_err("%s: msm_sd_register error = %d\n", __func__, rc);
goto end;
}
v4l2_subdev_notify(&msm_buf_mngr_dev->subdev.sd, MSM_SD_NOTIFY_REQ_CB,
&msm_buf_mngr_dev->vb2_ops);
INIT_LIST_HEAD(&msm_buf_mngr_dev->buf_qhead);
spin_lock_init(&msm_buf_mngr_dev->buf_q_spinlock);
end:
return rc;
}
static void __exit msm_buf_mngr_exit(void)
{
kfree(msm_buf_mngr_dev);
}
module_init(msm_buf_mngr_init);
module_exit(msm_buf_mngr_exit);
MODULE_DESCRIPTION("MSM Buffer Manager");
MODULE_LICENSE("GPL v2");
|
#ifndef _MIPS_SPARSEMEM_H
#define _MIPS_SPARSEMEM_H
#ifdef CONFIG_SPARSEMEM
/*
* SECTION_SIZE_BITS 2^N: how big each section will be
* MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
*/
#if defined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_PAGE_SIZE_64KB)
# define SECTION_SIZE_BITS 29
#else
# define SECTION_SIZE_BITS 28
#endif
#define MAX_PHYSMEM_BITS 35
#endif /* CONFIG_SPARSEMEM */
#endif /* _MIPS_SPARSEMEM_H */
|
typedef struct {} CvImage;
CvImage* Cv_ImageNew(void) { }
|
#ifndef __DPRAM_RECOVERY_H__
#define __DPRAM_RECOVERY_H__
/* interupt masks */
#define MASK_CMD_FOTA_IMG_RECEIVE_READY_RESP 0x0100
#define MASK_CMD_FOTA_IMG_SEND_RESP 0x0200
#define MASK_CMD_FOTA_SEND_DONE_RESP 0x0300
#define MASK_CMD_FOTA_UPDATE_START_RESP 0x0400
#define MASK_CMD_FOTA_UPDATE_STATUS_IND 0x0500
#define MASK_CMD_FOTA_UPDATE_END_IND 0x0C00
/* FORMAT */
#define CMD_FOTA_IMG_RECEIVE_READY_REQ 0x9100
#define CMD_FOTA_IMG_SEND_REQ 0x9200
#define CMD_FOTA_SEND_DONE_REQ 0x9300
#define CMD_FOTA_UPDATE_START_REQ 0x9400
#define CMD_FOTA_UPDATE_STATUS_IND 0x9500
#define CMD_FOTA_INIT_START_REQ 0x9A00
#define CMD_FOTA_INIT_START_RES 0x9B00
#define CMD_FOTA_UPDATE_END_IND 0x9C00
#define CMD_RETRY 0
#define CMD_TRUE 1
#define CMD_FALSE -1
#define CMD_DL_SEND_DONE_REQ 0x9600
#define CMD_PHONE_BOOT_UPDATE 0x0001
#define MASK_CMD_SEND_DONE_RESPONSE 0x0700
#define MASK_CMD_STATUS_UPDATE_NOTIFICATION 0x0800
#define MASK_CMD_UPDATE_DONE_NOTIFICATION 0x0900
#define MASK_CMD_IMAGE_SEND_RESPONSE 0x0500
/* Result mask */
#define MASK_CMD_RESULT_FAIL 0x0002
#define MASK_CMD_RESULT_SUCCESS 0x0001
#define MASK_CMD_VALID 0x8000
#define MASK_PDA_CMD 0x1000
#define MASK_PHONE_CMD 0x2000
#define MAGIC_FODN 0x4E444F46 /* PDA initiate phone code */
#define MAGIC_FOTA 0x41544C44 /* PDA initiate phone code */
#define MAGIC_DMDL 0x444D444C
#define MAGIC_ALARMBOOT 0x00410042
/* DPRAM */
#define DPRAM_BASE_ADDR S5P_PA_MODEMIF
#define DPRAM_MAGIC_CODE_SIZE 0x4
#define DPRAM_PDA2PHONE_FORMATTED_START_ADDRESS (DPRAM_MAGIC_CODE_SIZE)
#define DPRAM_PHONE2PDA_INTERRUPT_ADDRESS (0x3FFE)
#define DPRAM_PDA2PHONE_INTERRUPT_ADDRESS (0x3FFC)
#define DPRAM_BUFFER_SIZE (DPRAM_PDA2PHONE_INTERRUPT_ADDRESS - \
DPRAM_PDA2PHONE_FORMATTED_START_ADDRESS)
#define BSP_DPRAM_BASE_SIZE 0x4000 /* 16KB DPRAM in Mirage */
#define DPRAM_END_OF_ADDRESS (BSP_DPRAM_BASE_SIZE - 1)
#define DPRAM_INTERRUPT_SIZE 0x2
#define DPRAM_INDEX_SIZE 0x2
#define DELTA_PACKET_SIZE (0x4000 - 0x4 - 0x4)
#define WRITEIMG_HEADER_SIZE 8
#define WRITEIMG_TAIL_SIZE 4
#define WRITEIMG_BODY_SIZE (DPRAM_BUFFER_SIZE - \
WRITEIMG_HEADER_SIZE - WRITEIMG_TAIL_SIZE)
#define FODN_DEFAULT_WRITE_LEN WRITEIMG_BODY_SIZE
#define DPRAM_START_ADDRESS 0
#define DPRAM_END_OF_ADDRESS (BSP_DPRAM_BASE_SIZE - 1)
#define DPRAM_SIZE BSP_DPRAM_BASE_SIZE
/* ioctl commands */
#define IOCTL_ST_FW_UPDATE _IO('D', 0x1)
#define IOCTL_CHK_STAT _IO('D', 0x2)
#define IOCTL_MOD_PWROFF _IO('D', 0x3)
#define IOCTL_WRITE_MAGIC_CODE _IO('D', 0x4)
#define IOCTL_ST_FW_DOWNLOAD _IO('D', 0x5)
/* JB porting */
#define IOCTL_MODEM_BOOT_ON _IO('o', 0x22)
#define IOCTL_MODEM_BOOT_OFF _IO('o', 0x23)
#define IOCTL_MODEM_GOTA_START _IO('o', 0x28)
#define IOCTL_MODEM_FW_UPDATE _IO('o', 0x29)
#define GPIO_QSC_INT GPIO_C210_DPRAM_INT_N
#define IRQ_QSC_INT GPIO_QSC_INT
/* Common */
#define TRUE 1
#define FALSE 0
#define GPIO_IN 0
#define GPIO_OUT 1
#define GPIO_LOW 0
#define GPIO_HIGH 1
#define START_INDEX 0x007F
#define END_INDEX 0x007E
#define DPRAM_MODEM_MSG_SIZE 0x100
struct IDPRAM_SFR {
unsigned int int2ap;
unsigned int int2msm;
unsigned int mifcon;
unsigned int mifpcon;
unsigned int msmintclr;
unsigned int dma_tx_adr;
unsigned int dma_rx_adr;
};
/* It is recommended that S5PC110 write data with
half-word access on the interrupt port because
S5PC100 overwrites tha data in INT2AP if there are
INT2AP and INT2MSM sharing the same word */
#define IDPRAM_INT2MSM_MASK 0xFF
#define IDPRAM_MIFCON_INT2APEN (1<<2)
#define IDPRAM_MIFCON_INT2MSMEN (1<<3)
#define IDPRAM_MIFCON_DMATXREQEN_0 (1<<16)
#define IDPRAM_MIFCON_DMATXREQEN_1 (1<<17)
#define IDPRAM_MIFCON_DMARXREQEN_0 (1<<18)
#define IDPRAM_MIFCON_DMARXREQEN_1 (1<<19)
#define IDPRAM_MIFCON_FIXBIT (1<<20)
#define IDPRAM_MIFPCON_ADM_MODE (1<<6) /* mux / demux mode */
/* end */
struct dpram_firmware {
char *firmware;
int size;
int image_type;
};
struct stat_info {
int pct;
char msg[DPRAM_MODEM_MSG_SIZE];
};
#define DPRAM_MODEM_DELTA_IMAGE 0
#define DPRAM_MODEM_FULL_IMAGE 1
#endif /* __DPRAM_RECOVERY_H__ */
|
/*
** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $
** Garbage Collector
** See Copyright Notice in lua.h
*/
#ifndef lgc_h
#define lgc_h
#include "lobject.h"
/*
** Possible states of the Garbage Collector
*/
#define GCSpause 0
#define GCSpropagate 1
#define GCSsweepstring 2
#define GCSsweep 3
#define GCSfinalize 4
/*
** some userful bit tricks
*/
#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m)))
#define setbits(x,m) ((x) |= (m))
#define testbits(x,m) ((x) & (m))
#define bitmask(b) (1<<(b))
#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2))
#define l_setbit(x,b) setbits(x, bitmask(b))
#define resetbit(x,b) resetbits(x, bitmask(b))
#define testbit(x,b) testbits(x, bitmask(b))
#define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2)))
#define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2)))
#define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2)))
/*
** Possible Garbage Collector flags.
** Layout for bit use in 'gsflags' field in global_State structure.
** bit 0 - Protect GC from recursive calls.
** bit 1 - Don't try to shrink string table if EGC was called during a string table resize.
*/
#define GCFlagsNone 0
#define GCBlockGCBit 0
#define GCResizingStringsBit 1
#define is_block_gc(L) testbit(G(L)->gcflags, GCBlockGCBit)
#define set_block_gc(L) l_setbit(G(L)->gcflags, GCBlockGCBit)
#define unset_block_gc(L) resetbit(G(L)->gcflags, GCBlockGCBit)
#define is_resizing_strings_gc(L) testbit(G(L)->gcflags, GCResizingStringsBit)
#define set_resizing_strings_gc(L) l_setbit(G(L)->gcflags, GCResizingStringsBit)
#define unset_resizing_strings_gc(L) resetbit(G(L)->gcflags, GCResizingStringsBit)
/*
** Layout for bit use in `marked' field:
** bit 0 - object is white (type 0)
** bit 1 - object is white (type 1)
** bit 2 - object is black
** bit 3 - for thread: Don't resize thread's stack
** bit 3 - for userdata: has been finalized
** bit 3 - for tables: has weak keys
** bit 4 - for tables: has weak values
** bit 5 - object is fixed (should not be collected)
** bit 6 - object is "super" fixed (only the main thread)
** bit 7 - object is (partially) stored in read-only memory
*/
#define WHITE0BIT 0
#define WHITE1BIT 1
#define BLACKBIT 2
#define FIXEDSTACKBIT 3
#define FINALIZEDBIT 3
#define KEYWEAKBIT 3
#define VALUEWEAKBIT 4
#define FIXEDBIT 5
#define SFIXEDBIT 6
#define READONLYBIT 7
#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
#define iswhite(x) test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
#define isblack(x) testbit((x)->gch.marked, BLACKBIT)
#define isgray(x) (!isblack(x) && !iswhite(x))
#define otherwhite(g) (g->currentwhite ^ WHITEBITS)
#define isdead(g,v) ((v)->gch.marked & otherwhite(g) & WHITEBITS)
#define changewhite(x) ((x)->gch.marked ^= WHITEBITS)
#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT)
#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x)))
#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS)
#define isfixedstack(x) testbit((x)->marked, FIXEDSTACKBIT)
#define fixedstack(x) l_setbit((x)->marked, FIXEDSTACKBIT)
#define unfixedstack(x) resetbit((x)->marked, FIXEDSTACKBIT)
#define luaC_checkGC(L) { \
condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \
if (G(L)->totalbytes >= G(L)->GCthreshold) \
luaC_step(L); }
#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \
luaC_barrierf(L,obj2gco(p),gcvalue(v)); }
#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \
luaC_barrierback(L,t); }
#define luaC_objbarrier(L,p,o) \
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
luaC_barrierf(L,obj2gco(p),obj2gco(o)); }
#define luaC_objbarriert(L,t,o) \
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); }
LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all);
LUAI_FUNC void luaC_callGCTM (lua_State *L);
LUAI_FUNC void luaC_freeall (lua_State *L);
LUAI_FUNC void luaC_step (lua_State *L);
LUAI_FUNC void luaC_fullgc (lua_State *L);
LUAI_FUNC int luaC_sweepstrgc (lua_State *L);
LUAI_FUNC void luaC_marknew (lua_State *L, GCObject *o);
LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);
LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);
#endif
|
/* time.c: FRV arch-specific time handling
*
* Copyright (C) 2003-5 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
* - Derived from arch/m68k/kernel/time.c
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/string.h>
#include <linux/interrupt.h>
#include <linux/profile.h>
#include <linux/irq.h>
#include <linux/mm.h>
#include <asm/io.h>
#include <asm/timer-regs.h>
#include <asm/mb-regs.h>
#include <asm/mb86943a.h>
#include <linux/timex.h>
#define TICK_SIZE (tick_nsec / 1000)
unsigned long __nongprelbss __clkin_clock_speed_HZ;
unsigned long __nongprelbss __ext_bus_clock_speed_HZ;
unsigned long __nongprelbss __res_bus_clock_speed_HZ;
unsigned long __nongprelbss __sdram_clock_speed_HZ;
unsigned long __nongprelbss __core_bus_clock_speed_HZ;
unsigned long __nongprelbss __core_clock_speed_HZ;
unsigned long __nongprelbss __dsu_clock_speed_HZ;
unsigned long __nongprelbss __serial_clock_speed_HZ;
unsigned long __delay_loops_MHz;
static irqreturn_t timer_interrupt(int irq, void *dummy);
static struct irqaction timer_irq = {
.handler = timer_interrupt,
.flags = IRQF_DISABLED,
.mask = CPU_MASK_NONE,
.name = "timer",
};
static inline int set_rtc_mmss(unsigned long nowtime)
{
return -1;
}
/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
*/
static irqreturn_t timer_interrupt(int irq, void *dummy)
{
/* last time the cmos clock got updated */
static long last_rtc_update = 0;
profile_tick(CPU_PROFILING);
/*
* Here we are in the timer irq handler. We just have irqs locally
* disabled but we don't know if the timer_bh is running on the other
* CPU. We need to avoid to SMP race with it. NOTE: we don't need
* the irq version of write_lock because as just said we have irq
* locally disabled. -arca
*/
write_seqlock(&xtime_lock);
do_timer(1);
/*
* If we have an externally synchronized Linux clock, then update
* CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
* called as close as possible to 500 ms before the new second starts.
*/
if (ntp_synced() &&
xtime.tv_sec > last_rtc_update + 660 &&
(xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
(xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2
) {
if (set_rtc_mmss(xtime.tv_sec) == 0)
last_rtc_update = xtime.tv_sec;
else
last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
}
#ifdef CONFIG_HEARTBEAT
static unsigned short n;
n++;
__set_LEDS(n);
#endif /* CONFIG_HEARTBEAT */
write_sequnlock(&xtime_lock);
update_process_times(user_mode(get_irq_regs()));
return IRQ_HANDLED;
}
void time_divisor_init(void)
{
unsigned short base, pre, prediv;
/* set the scheduling timer going */
pre = 1;
prediv = 4;
base = __res_bus_clock_speed_HZ / pre / HZ / (1 << prediv);
__set_TPRV(pre);
__set_TxCKSL_DATA(0, prediv);
__set_TCTR(TCTR_SC_CTR0 | TCTR_RL_RW_LH8 | TCTR_MODE_2);
__set_TCSR_DATA(0, base & 0xff);
__set_TCSR_DATA(0, base >> 8);
}
void time_init(void)
{
unsigned int year, mon, day, hour, min, sec;
extern void arch_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec);
/* FIX by dqg : Set to zero for platforms that don't have tod */
/* without this time is undefined and can overflow time_t, causing */
/* very strange errors */
year = 1980;
mon = day = 1;
hour = min = sec = 0;
arch_gettod (&year, &mon, &day, &hour, &min, &sec);
if ((year += 1900) < 1970)
year += 100;
xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
xtime.tv_nsec = 0;
/* install scheduling interrupt handler */
setup_irq(IRQ_CPU_TIMER0, &timer_irq);
time_divisor_init();
}
/*
* Scheduler clock - returns current time in nanosec units.
*/
unsigned long long sched_clock(void)
{
return jiffies_64 * (1000000000 / HZ);
}
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* PCI driver for the High Speed UART DMA
*
* Copyright (C) 2015 Intel Corporation
* Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
*
* Partially based on the bits found in drivers/tty/serial/mfd.c.
*/
#include <linux/bitops.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/pci.h>
#include "hsu.h"
#define HSU_PCI_DMASR 0x00
#define HSU_PCI_DMAISR 0x04
#define HSU_PCI_CHAN_OFFSET 0x100
#define PCI_DEVICE_ID_INTEL_MFLD_HSU_DMA 0x081e
#define PCI_DEVICE_ID_INTEL_MRFLD_HSU_DMA 0x1192
static irqreturn_t hsu_pci_irq(int irq, void *dev)
{
struct hsu_dma_chip *chip = dev;
struct pci_dev *pdev = to_pci_dev(chip->dev);
u32 dmaisr;
u32 status;
unsigned short i;
int ret = 0;
int err;
/*
* On Intel Tangier B0 and Anniedale the interrupt line, disregarding
* to have different numbers, is shared between HSU DMA and UART IPs.
* Thus on such SoCs we are expecting that IRQ handler is called in
* UART driver only.
*/
if (pdev->device == PCI_DEVICE_ID_INTEL_MRFLD_HSU_DMA)
return IRQ_HANDLED;
dmaisr = readl(chip->regs + HSU_PCI_DMAISR);
for (i = 0; i < chip->hsu->nr_channels; i++) {
if (dmaisr & 0x1) {
err = hsu_dma_get_status(chip, i, &status);
if (err > 0)
ret |= 1;
else if (err == 0)
ret |= hsu_dma_do_irq(chip, i, status);
}
dmaisr >>= 1;
}
return IRQ_RETVAL(ret);
}
static int hsu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
struct hsu_dma_chip *chip;
int ret;
ret = pcim_enable_device(pdev);
if (ret)
return ret;
ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
if (ret) {
dev_err(&pdev->dev, "I/O memory remapping failed\n");
return ret;
}
pci_set_master(pdev);
pci_try_set_mwi(pdev);
ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (ret)
return ret;
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (ret)
return ret;
chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
if (ret < 0)
return ret;
chip->dev = &pdev->dev;
chip->regs = pcim_iomap_table(pdev)[0];
chip->length = pci_resource_len(pdev, 0);
chip->offset = HSU_PCI_CHAN_OFFSET;
chip->irq = pci_irq_vector(pdev, 0);
ret = hsu_dma_probe(chip);
if (ret)
return ret;
ret = request_irq(chip->irq, hsu_pci_irq, 0, "hsu_dma_pci", chip);
if (ret)
goto err_register_irq;
pci_set_drvdata(pdev, chip);
return 0;
err_register_irq:
hsu_dma_remove(chip);
return ret;
}
static void hsu_pci_remove(struct pci_dev *pdev)
{
struct hsu_dma_chip *chip = pci_get_drvdata(pdev);
free_irq(chip->irq, chip);
hsu_dma_remove(chip);
}
static const struct pci_device_id hsu_pci_id_table[] = {
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MFLD_HSU_DMA), 0 },
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD_HSU_DMA), 0 },
{ }
};
MODULE_DEVICE_TABLE(pci, hsu_pci_id_table);
static struct pci_driver hsu_pci_driver = {
.name = "hsu_dma_pci",
.id_table = hsu_pci_id_table,
.probe = hsu_pci_probe,
.remove = hsu_pci_remove,
};
module_pci_driver(hsu_pci_driver);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("High Speed UART DMA PCI driver");
MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
|
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/crash_core.h>
#include <linux/pgtable.h>
#include <asm/setup.h>
void arch_crash_save_vmcoreinfo(void)
{
u64 sme_mask = sme_me_mask;
VMCOREINFO_NUMBER(phys_base);
VMCOREINFO_SYMBOL(init_top_pgt);
vmcoreinfo_append_str("NUMBER(pgtable_l5_enabled)=%d\n",
pgtable_l5_enabled());
#ifdef CONFIG_NUMA
VMCOREINFO_SYMBOL(node_data);
VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
#endif
vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset());
VMCOREINFO_NUMBER(KERNEL_IMAGE_SIZE);
VMCOREINFO_NUMBER(sme_mask);
}
|
/*
* APIC driver for "bigsmp" xAPIC machines with more than 8 virtual CPUs.
*
* Drives the local APIC in "clustered mode".
*/
#include <linux/threads.h>
#include <linux/cpumask.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/dmi.h>
#include <linux/smp.h>
#include <asm/apicdef.h>
#include <asm/fixmap.h>
#include <asm/mpspec.h>
#include <asm/apic.h>
#include <asm/ipi.h>
static unsigned bigsmp_get_apic_id(unsigned long x)
{
return (x >> 24) & 0xFF;
}
static int bigsmp_apic_id_registered(void)
{
return 1;
}
static unsigned long bigsmp_check_apicid_used(physid_mask_t *map, int apicid)
{
return 0;
}
static unsigned long bigsmp_check_apicid_present(int bit)
{
return 1;
}
static int bigsmp_early_logical_apicid(int cpu)
{
/* on bigsmp, logical apicid is the same as physical */
return early_per_cpu(x86_cpu_to_apicid, cpu);
}
static inline unsigned long calculate_ldr(int cpu)
{
unsigned long val, id;
val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
id = per_cpu(x86_bios_cpu_apicid, cpu);
val |= SET_APIC_LOGICAL_ID(id);
return val;
}
/*
* Set up the logical destination ID.
*
* Intel recommends to set DFR, LDR and TPR before enabling
* an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
* document number 292116). So here it goes...
*/
static void bigsmp_init_apic_ldr(void)
{
unsigned long val;
int cpu = smp_processor_id();
apic_write(APIC_DFR, APIC_DFR_FLAT);
val = calculate_ldr(cpu);
apic_write(APIC_LDR, val);
}
static void bigsmp_setup_apic_routing(void)
{
printk(KERN_INFO
"Enabling APIC mode: Physflat. Using %d I/O APICs\n",
nr_ioapics);
}
static int bigsmp_cpu_present_to_apicid(int mps_cpu)
{
if (mps_cpu < nr_cpu_ids)
return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
return BAD_APICID;
}
static void bigsmp_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
{
/* For clustered we don't have a good way to do this yet - hack */
physids_promote(0xFFL, retmap);
}
static int bigsmp_check_phys_apicid_present(int phys_apicid)
{
return 1;
}
static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
{
return cpuid_apic >> index_msb;
}
static inline void bigsmp_send_IPI_mask(const struct cpumask *mask, int vector)
{
default_send_IPI_mask_sequence_phys(mask, vector);
}
static void bigsmp_send_IPI_allbutself(int vector)
{
default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
}
static void bigsmp_send_IPI_all(int vector)
{
bigsmp_send_IPI_mask(cpu_online_mask, vector);
}
static int dmi_bigsmp; /* can be set by dmi scanners */
static int hp_ht_bigsmp(const struct dmi_system_id *d)
{
printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
dmi_bigsmp = 1;
return 0;
}
static const struct dmi_system_id bigsmp_dmi_table[] = {
{ hp_ht_bigsmp, "HP ProLiant DL760 G2",
{ DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
DMI_MATCH(DMI_BIOS_VERSION, "P44-"),
}
},
{ hp_ht_bigsmp, "HP ProLiant DL740",
{ DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
DMI_MATCH(DMI_BIOS_VERSION, "P47-"),
}
},
{ } /* NULL entry stops DMI scanning */
};
static int probe_bigsmp(void)
{
if (def_to_bigsmp)
dmi_bigsmp = 1;
else
dmi_check_system(bigsmp_dmi_table);
return dmi_bigsmp;
}
static struct apic apic_bigsmp = {
.name = "bigsmp",
.probe = probe_bigsmp,
.acpi_madt_oem_check = NULL,
.apic_id_valid = default_apic_id_valid,
.apic_id_registered = bigsmp_apic_id_registered,
.irq_delivery_mode = dest_Fixed,
/* phys delivery to target CPU: */
.irq_dest_mode = 0,
.target_cpus = default_target_cpus,
.disable_esr = 1,
.dest_logical = 0,
.check_apicid_used = bigsmp_check_apicid_used,
.check_apicid_present = bigsmp_check_apicid_present,
.vector_allocation_domain = default_vector_allocation_domain,
.init_apic_ldr = bigsmp_init_apic_ldr,
.ioapic_phys_id_map = bigsmp_ioapic_phys_id_map,
.setup_apic_routing = bigsmp_setup_apic_routing,
.multi_timer_check = NULL,
.cpu_present_to_apicid = bigsmp_cpu_present_to_apicid,
.apicid_to_cpu_present = physid_set_mask_of_physid,
.setup_portio_remap = NULL,
.check_phys_apicid_present = bigsmp_check_phys_apicid_present,
.enable_apic_mode = NULL,
.phys_pkg_id = bigsmp_phys_pkg_id,
.mps_oem_check = NULL,
.get_apic_id = bigsmp_get_apic_id,
.set_apic_id = NULL,
.apic_id_mask = 0xFF << 24,
.cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
.send_IPI_mask = bigsmp_send_IPI_mask,
.send_IPI_mask_allbutself = NULL,
.send_IPI_allbutself = bigsmp_send_IPI_allbutself,
.send_IPI_all = bigsmp_send_IPI_all,
.send_IPI_self = default_send_IPI_self,
.trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
.trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
.wait_for_init_deassert = default_wait_for_init_deassert,
.smp_callin_clear_local_apic = NULL,
.inquire_remote_apic = default_inquire_remote_apic,
.read = native_apic_mem_read,
.write = native_apic_mem_write,
.eoi_write = native_apic_mem_write,
.icr_read = native_apic_icr_read,
.icr_write = native_apic_icr_write,
.wait_icr_idle = native_apic_wait_icr_idle,
.safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
.x86_32_early_logical_apicid = bigsmp_early_logical_apicid,
};
void __init generic_bigsmp_probe(void)
{
unsigned int cpu;
if (!probe_bigsmp())
return;
apic = &apic_bigsmp;
for_each_possible_cpu(cpu) {
if (early_per_cpu(x86_cpu_to_logical_apicid,
cpu) == BAD_APICID)
continue;
early_per_cpu(x86_cpu_to_logical_apicid, cpu) =
bigsmp_early_logical_apicid(cpu);
}
pr_info("Overriding APIC driver with %s\n", apic_bigsmp.name);
}
apic_driver(apic_bigsmp);
|
/*
* include/asm-sh/cpu-sh3/cache.h
*
* Copyright (C) 1999 Niibe Yutaka
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#ifndef __ASM_CPU_SH3_CACHE_H
#define __ASM_CPU_SH3_CACHE_H
#define L1_CACHE_SHIFT 4
#define SH_CACHE_VALID 1
#define SH_CACHE_UPDATED 2
#define SH_CACHE_COMBINED 4
#define SH_CACHE_ASSOC 8
#define SH_CCR 0xffffffec /* Address of Cache Control Register */
#define CCR_CACHE_CE 0x01 /* Cache Enable */
#define CCR_CACHE_WT 0x02 /* Write-Through (for P0,U0,P3) (else writeback) */
#define CCR_CACHE_CB 0x04 /* Write-Back (for P1) (else writethrough) */
#define CCR_CACHE_CF 0x08 /* Cache Flush */
#define CCR_CACHE_ORA 0x20 /* RAM mode */
#define CACHE_OC_ADDRESS_ARRAY 0xf0000000
#define CACHE_PHYSADDR_MASK 0x1ffffc00
#define CCR_CACHE_ENABLE CCR_CACHE_CE
#define CCR_CACHE_INVALIDATE CCR_CACHE_CF
#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
defined(CONFIG_CPU_SUBTYPE_SH7710) || \
defined(CONFIG_CPU_SUBTYPE_SH7720) || \
defined(CONFIG_CPU_SUBTYPE_SH7721)
#define CCR3_REG 0xa40000b4
#define CCR_CACHE_16KB 0x00010000
#define CCR_CACHE_32KB 0x00020000
#endif
#endif /* __ASM_CPU_SH3_CACHE_H */
|
/* Check for no "noreturn" warning in main. */
/* { dg-do compile } */
/* { dg-options "-O2 -Wmissing-noreturn -fhosted" } */
extern void exit (int) __attribute__ ((__noreturn__));
int
main (void)
{
exit (0);
}
|
/*
* Copyright 2018 Advanced Micro Devices, 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.
*
*/
#ifndef __NBIO_V7_4_H__
#define __NBIO_V7_4_H__
#include "soc15_common.h"
extern const struct nbio_hdp_flush_reg nbio_v7_4_hdp_flush_reg;
extern const struct nbio_hdp_flush_reg nbio_v7_4_hdp_flush_reg_ald;
extern const struct amdgpu_nbio_funcs nbio_v7_4_funcs;
extern const struct amdgpu_nbio_ras_funcs nbio_v7_4_ras_funcs;
#endif
|
#ifndef __PET_HELP__
#define __PET_HELP__
#include "cmdline.h"
void help_print_version (Params *);
void help_print_help (Params *);
#endif
|
#include "common.h"
char *lowerstr(char *s) { for (size_t i = 0; s[i]; i++) s[i] = tolower(s[i]); return s; }
char *upperstr(char *s) { for (size_t i = 0; s[i]; i++) s[i] = toupper(s[i]); return s; }
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Ricardo Correia. All rights reserved.
* Use is subject to license terms.
*/
#ifndef ZFSFUSE_IOCTL_H
#define ZFSFUSE_IOCTL_H
#include <sys/zfs_ioctl.h>
#include <sys/types.h>
extern __thread int cur_fd;
extern int zfsfuse_socket_create();
extern void zfsfuse_socket_close(int fd);
extern int zfsfuse_socket_read_loop(int fd, void *buf, int bytes);
extern int zfsfuse_socket_ioctl_write(int fd, int ret);
#endif
|
/*
* Copyright (C) 2011 Jaagup Repän <jrepan at gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _TOOLKIT_PRIVATE_H
#define _TOOLKIT_PRIVATE_H
#include <stdbool.h>
#include <lua.h>
#include "window.h"
#define EXPORT_FUNC(x) \
lua_pushcfunction(L, x); \
lua_setglobal(L, #x);
struct window {
struct fb *fb;
struct widget *widget;
handler_t handler;
};
struct widget {
lua_State *L;
struct window *window;
bool dirty, child_dirty;
struct font *fonts;
struct image *images;
char *name;
int x, y;
int width, height;
int realx, realy, realwidth, realheight;
struct widget *parent, *children;
struct widget *prev, *next;
};
extern struct window *__rtk_window;
extern char *__rtk_theme_path;
uint32_t __rtk_get_theme_attribute(const char *name);
int __rtk_init_freetype();
int __rtk_set_default_font(const char *path);
void __rtk_free_font(struct font *font);
void __rtk_init_drawing_functions(lua_State *L);
void __rtk_init_library(lua_State *L);
struct widget *__rtk_get_widget(lua_State *L);
void __rtk_free_images(struct image *image, struct widget *widget);
void __rtk_init_image_functions(lua_State *L);
int __rtk_set_attribute(struct widget *widget);
int __rtk_get_attribute(struct widget *widget);
int __rtk_call_lua_function(lua_State *L, int args, int ret);
void __rtk_update_widget();
int __rtk_draw_widget(struct widget *widget, bool force);
struct widget *__rtk_add_widget(const char *widget, struct widget *parent, struct window *window, int x, int y, int width, int height);
void __rtk_free_widget(struct widget *widget);
void __rtk_set_window_size(struct window *window, int width, int height);
#endif
|
#include "help.h"
#include "cmdline.h"
#include <stdio.h>
void help_print_version (Params *p) {
const char *const pet_name = "PET";
const char *const pet_desc = "Personal Expense Tracker";
const char *const pet_version = "0.2";
const char *const pet_www = "https://github.com/fredmorcos/pet.git";
const char *const pet_cc = "Copyright (c) 2013";
const char *const pet_license = "2-clause BSD license";
const char *const pet_author = "Fred Morcos";
const char *const pet_email = "fred.morcos@gmail.com";
fprintf(stderr, "%s (%s): %s -- Version %s\n",
pet_name, p->progname, pet_desc, pet_version);
fprintf(stderr, "WWW: %s\n", pet_www);
fprintf(stderr, "%s under a %s\n", pet_cc, pet_license);
fprintf(stderr, "%s <%s>\n", pet_author, pet_email);
}
void help_print_help (Params *p) {
help_print_version(p);
fprintf(stderr, "\n");
fprintf(stderr, "Usage:\n");
fprintf(stderr, " %s command [parameters]\n", p->progname);
fprintf(stderr, "\n");
fprintf(stderr, "Commands:\n");
fprintf(stderr, " check <file> Check <file> for errors\n");
}
|
//
// AZZJiraCreateIssueViewController.h
// BugReporter
//
// Created by 朱安智 on 2016/11/24.
// Copyright © 2016年 Andrew. All rights reserved.
//
#import "AZZJiraBaseViewController.h"
@class AZZJiraIssueTypeModel, AZZJiraProjectsModel;
@interface AZZJiraCreateIssueViewController : AZZJiraBaseViewController
@property (nonatomic, strong) AZZJiraProjectsModel *projectModel;
@property (nonatomic, strong) AZZJiraIssueTypeModel *issueTypeModel;
@end
|
/* ========================================================================== */
/* === AMGconvert mexFunction =============================================== */
/* ========================================================================== */
/*
Usage:
Return the structure 'options' and solution x of Ax=b based on ILUPACK V2.2
Example:
% for initializing parameters
PREC = DSYMSPDilupackconvert(PREC);
Authors:
Matthias Bollhoefer, TU Braunschweig
Date:
April 22, 2009. ILUPACK V2.3
Notice:
Copyright (c) 2009 by TU Braunschweig. All Rights Reserved.
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
Availability:
This file is located at
http://ilupack.tu-bs.de/
*/
/* ========================================================================== */
/* === Include files and prototypes ========================================= */
/* ========================================================================== */
#include "mex.h"
#include "matrix.h"
#include <string.h>
#include <stdlib.h>
#include <ilupack.h>
/* ========================================================================== */
/* === mexFunction ========================================================== */
/* ========================================================================== */
void mexFunction
(
/* === Parameters ======================================================= */
int nlhs, /* number of left-hand sides */
mxArray *plhs [], /* left-hand side matrices */
int nrhs, /* number of right--hand sides */
const mxArray *prhs [] /* right-hand side matrices */
)
{
Dmat A;
DAMGlevelmat *PRE;
DILUPACKparam *param;
integer n;
const char **fnames;
const char *pnames[]= {"n","nB", "L","D","U", "E","F", "rowscal","colscal", "p","invq",
"param","ptr", "isreal","isdefinite","issymmetric","ishermitian"};
const int *dims;
mxArray *tmp, *fout;
char *pdata, *input_buf, *output_buf;
int mrows, ncols, ifield, jstruct, *classIDflags, buflen, status;
int NStructElems, nfields, ndim,nnz, ierr,i,j,k,l,m, *irs, *jcs;
size_t sizebuf;
double dbuf, *A_valuesR, *convert, *sr, *pr, *sol, *rhs;
mxArray *A_input , *b_input, *x0_input;
mxArray *PRE_input;
int *A_ja ; /* row indices of input matrix A */
int *A_ia ; /* column pointers of input matrix A */
if (nrhs != 1)
mexErrMsgTxt("one input argument required.");
else if (nlhs !=1)
mexErrMsgTxt("Too many output arguments.");
/* import pointer to the preconditioner */
PRE_input = (mxArray*) prhs [0] ;
/* get number of levels of input preconditioner structure `PREC' */
/* nlev=mxGetN(PRE_input); */
nfields = mxGetNumberOfFields(PRE_input);
/* allocate memory for storing pointers */
fnames = mxCalloc(nfields, sizeof(*fnames));
for (ifield = 0; ifield < nfields; ifield++) {
fnames[ifield] = mxGetFieldNameByNumber(PRE_input,ifield);
/* check whether `PREC.ptr' exists */
if (!strcmp("ptr",fnames[ifield])) {
/* field `ptr' */
tmp = mxGetFieldByNumber(PRE_input,0,ifield);
pdata = mxGetData(tmp);
memcpy(&PRE, pdata, sizeof(size_t));
}
else if (!strcmp("param",fnames[ifield])) {
/* field `param' */
tmp = mxGetFieldByNumber(PRE_input,0,ifield);
pdata = mxGetData(tmp);
memcpy(¶m, pdata, sizeof(size_t));
}
}
mxFree(fnames);
DSYMSPDAMGconvert(PRE);
/* Create a struct matrices for output */
nlhs=1;
plhs[0] = PRE_input; /*mxCreateStructMatrix(1, nlev, 17, pnames);*/
return;
}
|
//
// AxcPlayerChangeOrientationOperation.h
// AxcUIKit
//
// Created by Axc_5324 on 17/7/19.
// Copyright © 2017年 Axc_5324. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef void(^AxcPlayerChangeOrientationOperationCompletionHandler)();
@interface AxcPlayerChangeOrientationOperation : NSOperation
+ (instancetype)blockOperationWithBlock:(void (^)(AxcPlayerChangeOrientationOperationCompletionHandler completionHandler))block;
@end
|
//
// LPDViewEmptyProtocol.h
// Pods
//
// Created by foxsofter on 17/2/6.
//
//
#import <Foundation/Foundation.h>
@protocol LPDViewEmptyProtocol <NSObject>
@optional
- (void)hideEmptyView;
- (void)showEmptyViewWithDescription:(NSString *_Nullable)description;
@end
|
#import "MOBProjection.h"
@interface MOBProjectionEPSG2662 : MOBProjection
@end
|
//
// ZJUURLCache.h
// iZJU
//
// Created by ricky on 13-9-27.
// Copyright (c) 2013年 iZJU Studio. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ZJUURLCache : NSURLCache
@end
|
//
// Created by ngrande on 12/4/15.
//
#ifndef CSVCONVERTER_CSVMAIN_H
#define CSVCONVERTER_CSVMAIN_H
#include "CSVReader.h"
#include "CSVWriter.h"
class CSVMain {
private:
CSVReader *csvReader;
IWriter *writerInstance;
public:
int start(std::string sourcePath, std::string xmlConfigPath, std::string outPath);
};
#endif //CSVCONVERTER_CSVMAIN_H
|
/*----------------------------------------------------------------------
File : listops.h
Contents: some special list operations
Author : Christian Borgelt
History : 2000.11.02 file created from file lists.h
----------------------------------------------------------------------*/
#ifndef __LISTOPS__
#define __LISTOPS__
/*----------------------------------------------------------------------
Type Definitions
----------------------------------------------------------------------*/
typedef struct _le { /* --- a list element --- */
struct _le *succ; /* pointer to successor */
struct _le *pred; /* pointer to predecessor */
} LE; /* (list element) */
typedef int LCMPFN (const void *p1, const void *p2, void *data);
/*----------------------------------------------------------------------
Functions
----------------------------------------------------------------------*/
extern void* l_sort (void *list, LCMPFN cmpfn, void *data);
extern void* l_reverse (void *list);
#endif
|
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "config.h"
#define RES 4
//#define FN (PREFIX "id.8x8")
#define FN (PREFIX "id.4x4")
static float pearsonr(uint8_t *x, uint8_t *y, int len)
{
float mx = 0.0f, my = 0.0f;
float xmi, ymi;
float dx = 0.0f, dy = 0.0f;
float r_num = 0.0f, r_den;
int i;
for (i = 0; i < len; i++) {
mx += x[i];
my += y[i];
}
mx /= len;
my /= len;
for (i = 0; i < len; i++) {
xmi = (float)x[i] - mx;
ymi = (float)y[i] - my;
r_num += xmi * ymi;
dx += xmi * xmi;
dy += ymi * ymi;
}
r_num *= len;
r_den = sqrtf(dx * dy) * len;
return fabsf(r_num / r_den);
}
static void deser(uint8_t *a, const char *buf)
{
int i;
for (i = 0; i < RES*RES; i++) {
uint8_t v1, v2;
v1 = buf[i * 2] - '0';
v2 = buf[i * 2 + 1] - '0';
if (v1 > 9) v1 -= 'a' - '0' - 10;
if (v2 > 9) v2 -= 'a' - '0' - 10;
a[i] = v1 << 4 | v2;
}
}
typedef struct imgid {
uint8_t a[RES*RES];
char md5[32];
float p;
} imgid_t;
static imgid_t *ids;
static unsigned long of_ids;
static imgid_t cmp_id;
static const char *cmp_img;
static int cmp_img_ok;
static int comp_id(const void *a, const void *b) {
const imgid_t *x = a;
const imgid_t *y = b;
if (x->p < y->p) return 1;
if (x->p > y->p) return -1;
return 0;
}
#define THRES 0.90f
int main(int argc, char **argv)
{
FILE *fh;
char buf[256];
unsigned long id;
float p;
fh = fopen(FN, "r");
if (!fh) return 1;
if (argc == 3 && !strcmp(argv[1], "-id") && strlen(argv[2]) == 32) {
memcpy(cmp_id.md5, "00000000000000000000000000000000", 32);
deser(cmp_id.a, argv[2]);
} else if (argc == 2 && strlen(argv[1]) == 32) {
cmp_img = argv[1];
while (fgets(buf, sizeof(buf), fh)) {
if (!memcmp(buf, cmp_img, 32)) {
memcpy(cmp_id.md5, buf, 32);
deser(cmp_id.a, buf + 33);
cmp_img_ok = 1;
break;
}
}
if (!cmp_img_ok) return 1;
if (fseek(fh, 0, SEEK_SET)) return 1;
} else {
return 1;
}
id = 0;
of_ids = 100;
ids = malloc(sizeof(imgid_t) * of_ids);
while (fgets(buf, sizeof(buf), fh)) {
if (memcmp(buf, cmp_id.md5, 32)) {
deser(ids[id].a, buf + 33);
p = pearsonr(ids[id].a, cmp_id.a, RES*RES);
if (p > THRES) {
ids[id].p = p;
memcpy(ids[id].md5, buf, 32);
id++;
if (id == of_ids) {
of_ids *= 2;
ids = realloc(ids, sizeof(imgid_t) * of_ids);
if (!ids) return 1;
}
}
}
}
fclose(fh);
if (!id) return 0;
of_ids = id;
qsort(ids, of_ids, sizeof(imgid_t), comp_id);
char md5[33];
md5[32] = 0;
if (of_ids > 10) of_ids = 10;
for (id = 0; id < of_ids; id++) {
memcpy(md5, ids[id].md5, 32);
printf("%s %f\n", md5, ids[id].p);
}
return 0;
}
#if 0
static int read_db(const char *filename)
{
FILE *fh;
char buf[256];
unsigned long id = 0;
fh = fopen(filename, "r");
if (!fh) return 1;
of_ids = 1024;
ids = malloc(sizeof(imgid_t) * of_ids);
if (!ids) goto err;
while (fgets(buf, sizeof(buf), fh)) {
if (memcmp(buf, cmp_img, 32)) {
if (id == of_ids) {
of_ids *= 2;
ids = realloc(ids, sizeof(imgid_t) * of_ids);
if (!ids) goto err;
}
memcpy(ids[id].md5, buf, 32);
deser(ids[id].a, buf + 33);
id++;
} else {
memcpy(cmp_id.md5, buf, 32);
deser(cmp_id.a, buf + 33);
cmp_img_ok = 1;
}
}
if (!feof(fh)) goto err;
fclose(fh);
of_ids = id;
return 0;
err:
fclose(fh);
of_ids = 0;
return 1;
}
int mai__n(int argc, char **argv)
{
unsigned long i;
if (argc != 2 || strlen(argv[1]) != 32) return 1;
cmp_img = argv[1];
if (read_db(FN)) return 1;
if (!cmp_img_ok) return 1;
for (i = 0; i < of_ids; i++) {
ids[i].p = pearsonr(ids[i].a, cmp_id.a, RES*RES);
}
qsort(ids, of_ids, sizeof(imgid_t), comp_id);
char md5[33];
md5[32] = 0;
for (i = 0; i < 10; i++) {
memcpy(md5, ids[i].md5, 32);
printf("%s %f\n", md5, ids[i].p);
}
return 0;
}
int mai_n(void)
{
uint8_t a[RES*RES];
uint8_t b[RES*RES];
char buf[256];
FILE *fh;
float p;
fh = fopen(FN, "r");
if (!fh) return 1;
deser(a, "ffe6e4effea2b4c2ffbcc9dcffc6a2f1"); // bild b86f100afd6f668360fe85728788cf82
printf("%x%x\n",a[0], a[1]);
while (fgets(buf, sizeof(buf), fh)) {
deser(b, buf + 33);
p = pearsonr(a, b, RES*RES);
if (p > 0.93f) {
buf[32] = 0;
printf("%s %f\n", buf, p);
}
}
return 0;
}
#endif
|
/* Catena_Fram2k.h Sun Mar 12 2017 17:47:52 tmm */
/*
Module: Catena_Fram2k.h
Function:
class McciCatena::cFram2k
Version:
V0.5.0 Sun Mar 12 2017 17:47:52 tmm Edit level 1
Copyright notice:
This file copyright (C) 2017 by
MCCI Corporation
3520 Krums Corners Road
Ithaca, NY 14850
An unpublished work. All rights reserved.
This file is proprietary information, and may not be disclosed or
copied without the prior permission of MCCI Corporation.
Author:
Terry Moore, MCCI Corporation March 2017
Revision history:
0.5.0 Sun Mar 12 2017 17:47:52 tmm
Module created.
*/
#ifndef _CATENA_FRAM2K_H_ /* prevent multiple includes */
#define _CATENA_FRAM2K_H_
#pragma once
#ifndef _CATENA_FRAM_H_
# include "Catena_Fram.h"
#endif
#ifndef _MCCI_FRAM_I2C_H_
# include <MCCI_FRAM_I2C.h>
#endif
/****************************************************************************\
|
| The contents
|
\****************************************************************************/
namespace McciCatena {
class cFram2k : public cFram
{
protected:
using Super = cFram;
public:
cFram2k() { this->m_fReady = false; };
virtual ~cFram2k() {};
// begin working with the FRAM
virtual bool begin() override;
// read from the store
virtual size_t read(
cFramStorage::Offset uOffset, uint8_t *pBuffer, size_t nBuffer
) override;
// write to the store
virtual bool write(
cFramStorage::Offset uOffset, const uint8_t *pBuffer, size_t nBuffer
) override;
virtual cFramStorage::Offset getsize() const override
{
return 2 * 1024;
};
protected:
private:
MCCI_FRAM_I2C m_hw;
};
}; // namespace McciCatena
/**** end of Catena_Fram2k.h ****/
#endif /* _CATENA_FRAM2K_H_ */
|
#ifndef HGTEXTURE_H
#define HGTEXTURE_H
#include <stdio.h>
#include <string>
#include "hgsdl2.h"
class hgTexture
{
public:
hgTexture();
bool loadtexture( SDL_Renderer* renderer, const char* filename );
SDL_Texture* gettexture();
~hgTexture();
protected:
private:
SDL_Texture* texture;
};
#endif // HGTEXTURE_H
|
//
// AppDelegate.h
// Pixtory
//
// Created by Andyy Hope on 1/06/13.
// Copyright (c) 2013 Andyy Hope. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Locator.h"
@class ViewController;
@class MainViewController;
@class REMenu;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
}
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UINavigationController *navController;
@property (strong, nonatomic) ViewController *viewController;
@property (strong, nonatomic) MainViewController *mainViewController;
@property (strong, nonatomic) Locator *locationManager;
-(void)shareLinkWithFacebook:(NSString *)postString withImage:(UIImage *)postImage;
-(void)shareLinkWithTwitter:(NSString *)postString withImage:(UIImage *)postImage;
-(void)shareMomentWithFacebook:(NSDictionary *)moment andImage:(UIImage *)postImage;
-(void)shareMomentWithTwitter:(NSDictionary *)moment andImage:(UIImage *)postImage;
@end
|
#include <linux/err.h>
#include <linux/ctype.h>
#include <linux/cdev.h>
#include <asm/uaccess.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/module.h>
#include "dac7612.h"
#include "dac7612-spi.h"
#define DAC7612_MAJOR 60
#define DAC7612_MINOR 0
#define MAXLEN 64
#define COMPLIMENTARY_BIT 11
#define DAC7612_AMOUNT 2
#define MODULE_DEBUG 1
#define USECDEV 0
#define DAC7612_CHANNEL_A 2
#define DAC7612_CHANNEL_B 3
MODULE_AUTHOR("TeamMPS");
MODULE_LICENSE("Dual BSD/GPL");
static struct cdev dac7612Dev;
struct file_operations dac7612_Fops;
static int devno;
#define ERRGOTO(label, ...) \
{ \
printk (__VA_ARGS__); \
goto label; \
} while(0)
static int __init dac7612_cdrv_init(void)
{
int err; // Error variable
printk("dac7612 driver initializing\n");
err=dac7612_spi_init();
if(err)
ERRGOTO(error, "Failed SPI Initialization\n");
/* Allocate chrdev region */
devno = MKDEV(DAC7612_MAJOR, DAC7612_MINOR);
err = register_chrdev_region(devno, DAC7612_AMOUNT, "dac7612");
if(err)
ERRGOTO(err_spi_init, "Failed registering char region (%d,%d) +%d, error %d\n",
DAC7612_MAJOR, DAC7612_MINOR, DAC7612_AMOUNT, err);
/* Register Char Device */
cdev_init(&dac7612Dev, &dac7612_Fops);
err = cdev_add(&dac7612Dev, devno, DAC7612_AMOUNT);
if (err)
ERRGOTO(err_register, "Error %d adding DAC7612 device\n", err);
dac7612_spi_write_reg14(DAC7612_CHANNEL_A, 1000);
return 0;
err_register:
unregister_chrdev_region(devno, DAC7612_AMOUNT);
err_spi_init:
dac7612_spi_exit();
error:
return err;
}
static void __exit dac7612_cdrv_exit(void)
{
printk("dac7612 driver Exit\n");
cdev_del(&dac7612Dev);
dac7612_spi_write_reg14(DAC7612_CHANNEL_A, 300);
unregister_chrdev_region(devno, DAC7612_AMOUNT);
dac7612_spi_exit();
}
int dac7612_cdrv_open(struct inode *inode, struct file *filep)
{
int major = imajor(inode);
int minor = iminor(inode);
printk("Opening DAC7612 Device [major], [minor]: %i, %i\n", major, minor);
if (minor > DAC7612_AMOUNT-1)
{
printk("Minor no out of range (0-%i): %i\n", DAC7612_AMOUNT, minor);
return -ENODEV;
}
return 0;
}
int dac7612_cdrv_release(struct inode *inode, struct file *filep)
{
int major = imajor(inode);
int minor = iminor(inode);
printk("Closing DAC7612 Device [major], [minor]: %i, %i\n", major, minor);
if (minor > DAC7612_AMOUNT-1)
return -ENODEV;
return 0;
}
ssize_t dac7612_cdrv_write(struct file *filep, const char __user *ubuf,
size_t count, loff_t *f_pos)
{
int minor, len, value, addr;
char kbuf[MAXLEN];
minor = MINOR(filep->f_dentry->d_inode->i_rdev);
len = count < MAXLEN ? count : MAXLEN;
if(copy_from_user(kbuf, ubuf, len))
return -EFAULT;
kbuf[len] = '\0'; // Pad null termination to string
if(MODULE_DEBUG)
printk("string from user: %s\n", kbuf);
sscanf(kbuf,"%i", &value);
printk(KERN_ALERT "Writing %i to dac7612 [Minor] %i \n", value, minor);
switch (minor)
{
case 0:
addr = DAC7612_CHANNEL_A;
break;
case 1:
addr = DAC7612_CHANNEL_B;
break;
default:
printk("Unknown minor number - Address unknown %i\n", minor);
return -ENODEV;
}
// Calling the spi write function with address and value:
dac7612_spi_write_reg14(addr, value);
return count;
}
struct file_operations dac7612_Fops =
{
.owner = THIS_MODULE,
.open = dac7612_cdrv_open,
.release = dac7612_cdrv_release,
.write = dac7612_cdrv_write,
};
module_init(dac7612_cdrv_init);
module_exit(dac7612_cdrv_exit);
|
// Copyright 2014-2016 the project authors as listed in the AUTHORS file.
// All rights reserved. Use of this source code is governed by the
// license that can be found in the LICENSE file.
#ifndef _DEVICE1527_DEVICE
#define _DEVICE1527_DEVICE
#include "Device.h"
#include "MqttDevice.h"
#define BITS_IN_MESSAGE_1527 24
class Device1527 : public Device, public MqttDevice {
public:
Device1527(int pulseWidth, int pulseSlack, int minRepeats,
PubSubClient* client, char* topic);
virtual int deviceType(void);
virtual char* deviceName(void);
virtual void processPulse(long duration);
virtual void decodeMessage(Message* message);
virtual void publishTopic(int messageNum, Message* message, char* buffer, int maxLength);
private:
int _pulseWidth;
int _pulseSlack;
int _minRepeats;
bool syncFound;
unsigned int bitCount;
unsigned char receivedCode[BITS_IN_MESSAGE_1527 + 1];
unsigned char lastMessage[BITS_IN_MESSAGE_1527];
unsigned int durations[BITS_IN_MESSAGE_1527];
long pulseCount;
long repeatCount;
};
#endif
|
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */
/*=========================================================================
Copyright (c) 2008 Thomas Yeo and Mert Sabuncu
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 names of the copyright holders nor the names of future
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include "mex.h"
#include "math.h"
#include "matrix.h"
#include "MARS_linearInterp.h"
int index_2D_array(int row, int col, int num_rows)
{
return( col*num_rows + row);
}
void MARS_computeMeshFaceAreas(float *faceAreas, int numFaces, int *faces, float *vertices)
{
int i, v0, v1, v2;
for (i = 0; i < numFaces; i++)
{
v0 = faces[index_2D_array(0, i, 3)] - 1; /*convert to C index*/
v1 = faces[index_2D_array(1, i, 3)] - 1;
v2 = faces[index_2D_array(2, i, 3)] - 1;
faceAreas[i] = computeArea(vertices+3*v0, vertices+3*v1, vertices+3*v2);
}
}
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
int numFaces, *faces;
float *vertices;
mwSize dims;
float *faceAreas;
/* Check for proper number of arguments. */
if(nrhs!=3) {
mexErrMsgTxt("3 inputs required: numFaces (int 32), faces (int 32 *), vertices (float *)");
} else if(nlhs>1) {
mexErrMsgTxt("Too many output arguments");
}
/*Get input data*/
numFaces = * (int *) mxGetData(prhs[0]);
faces = (int *) mxGetData(prhs[1]);
vertices = (float *) mxGetData(prhs[2]);
/*Allocate Output Data*/
dims = numFaces;
plhs[0] = mxCreateNumericArray(1, &dims, mxSINGLE_CLASS, mxREAL);
faceAreas = (float *) mxGetData(plhs[0]);
/*Fill output Data*/
MARS_computeMeshFaceAreas(faceAreas, numFaces, faces, vertices);
}
|
#pragma once
#include "ahabindef.h"
namespace aha
{
class AhaStrings;
class AhaRefer
{
private:
std::vector<aha_u32> m_refers;
public:
void Read(aha_u32 SizeOfRefer, std::istream& strm);
aha_u32 Write(std::ostream& strm);
void Validate(const AhaStrings& strings) const;
std::vector<aha_u32>& Get();
const std::vector<aha_u32>& Get() const;
};
}
|
//
// YMShuttleViewController.h
// YaleMobile
//
// Created by iBlue on 12/27/12.
// Copyright (c) 2012 Danqing Liu. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>
@interface YMShuttleViewController : UIViewController <CLLocationManagerDelegate, MKMapViewDelegate, UIGestureRecognizerDelegate>
@property (nonatomic, strong) IBOutlet MKMapView *mapView1;
@property (nonatomic, strong) UIManagedDocument *db;
@property (nonatomic) double zoomLevel;
@property (nonatomic, strong) UIView *callout;
@property (nonatomic, strong) NSTimer *animationTimer;
@property (nonatomic, strong) NSArray *etaData;
@property (nonatomic) NSInteger locating;
@property (nonatomic, strong) IBOutlet UIButton *locate1;
@property (nonatomic, strong) IBOutlet UIButton *refresh1;
@property (nonatomic, strong) NSString *routesList;
@end
|
#ifndef RPCTABLE_CLASS
#error "Macro RPCTABLE_CLASS needs to be defined"
#endif
#ifndef RPCTABLE_CONTENTS
#error "Macro RPCTABLE_CONTENTS needs to be defined"
#endif
#define RPCTABLE_TOOMANYRPCS_STRINGIFY(arg) #arg
#define RPCTABLE_TOOMANYRPCS(arg) RPCTABLE_TOOMANYRPCS_STRINGIFY(arg)
template<> class cz::rpc::Table<RPCTABLE_CLASS> : cz::rpc::TableImpl<RPCTABLE_CLASS>
{
public:
using Type = RPCTABLE_CLASS;
#define REGISTERRPC(rpc) rpc,
enum class RPCId {
genericRPC,
RPCTABLE_CONTENTS
NUMRPCS
};
Table()
{
registerGenericRPC();
static_assert((unsigned)((int)RPCId::NUMRPCS-1)<(1<<Header::kRPCIdBits),
RPCTABLE_TOOMANYRPCS(Too many RPCs registered for class RPCTABLE_CLASS));
#undef REGISTERRPC
#define REGISTERRPC(func) registerRPC((uint32_t)RPCId::func, #func, &Type::func);
RPCTABLE_CONTENTS
}
static const Info* get(uint32_t rpcid)
{
static Table<RPCTABLE_CLASS> tbl;
assert(tbl.isValid(rpcid));
return static_cast<Info*>(tbl.m_rpcs[rpcid].get());
}
};
#undef REGISTERRPC
#undef RPCTABLE_START
#undef RPCTABLE_END
#undef RPCTABLE_CLASS
#undef RPCTABLE_CONTENTS
#undef RPCTABLE_TOOMANYRPCS_STRINGIFY
#undef RPCTABLE_TOOMANYRPCS
|
/* pngrio.c - functions for data input
*
* Last changed in libpng 1.6.17 [March 26, 2015]
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* This file provides a location for all input. Users who need
* special handling are expected to write a function that has the same
* arguments as this and performs a similar function, but that possibly
* has a different input method. Note that you shouldn't change this
* function, but rather write a replacement function and then make
* libpng use it at run time with png_set_read_fn(...).
*/
#include "pngpriv.h"
#ifdef PNG_READ_SUPPORTED
/* Read the data from whatever input you are using. The default routine
* reads from a file pointer. Note that this routine sometimes gets called
* with very small lengths, so you should implement some kind of simple
* buffering if you are using unbuffered reads. This should never be asked
* to read more than 64K on a 16-bit machine.
*/
void /* PRIVATE */
png_read_data(png_structrp png_ptr, png_bytep data, png_size_t length)
{
png_debug1(4, "reading %d bytes", (int)length);
if (png_ptr->read_data_fn != NULL)
(*(png_ptr->read_data_fn))(png_ptr, data, length);
else
png_error(png_ptr, "Call to NULL read function");
}
#ifdef PNG_STDIO_SUPPORTED
/* This is the function that does the actual reading of data. If you are
* not reading from a standard C stream, you should create a replacement
* read_data function and use it at run time with png_set_read_fn(), rather
* than changing the library.
*/
void PNGCBAPI
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
png_size_t check;
if (png_ptr == NULL)
return;
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
* instead of an int, which is what fread() actually returns.
*/
check = fread(data, 1, length, png_voidcast(png_FILE_p, png_ptr->io_ptr));
if (check != length)
png_error(png_ptr, "Read Error");
}
#endif
/* This function allows the application to supply a new input function
* for libpng if standard C streams aren't being used.
*
* This function takes as its arguments:
*
* png_ptr - pointer to a png input data structure
*
* io_ptr - pointer to user supplied structure containing info about
* the input functions. May be NULL.
*
* read_data_fn - pointer to a new input function that takes as its
* arguments a pointer to a png_struct, a pointer to
* a location where input data can be stored, and a 32-bit
* unsigned int that is the number of bytes to be read.
* To exit and output any fatal error messages the new write
* function should call png_error(png_ptr, "Error msg").
* May be NULL, in which case libpng's default function will
* be used.
*/
void PNGAPI
png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
png_rw_ptr read_data_fn)
{
if (png_ptr == NULL)
return;
png_ptr->io_ptr = io_ptr;
#ifdef PNG_STDIO_SUPPORTED
if (read_data_fn != NULL)
png_ptr->read_data_fn = read_data_fn;
else
png_ptr->read_data_fn = png_default_read_data;
#else
png_ptr->read_data_fn = read_data_fn;
#endif
#ifdef PNG_WRITE_SUPPORTED
/* It is an error to write to a read device */
if (png_ptr->write_data_fn != NULL)
{
png_ptr->write_data_fn = NULL;
png_warning(png_ptr,
"Can't set both read_data_fn and write_data_fn in the"
" same structure");
}
#endif
#ifdef PNG_WRITE_FLUSH_SUPPORTED
png_ptr->output_flush_fn = NULL;
#endif
}
#endif /* READ */
|
#ifndef MUD_BSD_STRING_H
#define MUD_BSD_STRING_H
#include <stddef.h>
size_t strlcpy(char* dst, const char* src, size_t siz);
#endif |
/*
* Z80 - Assembler
* Copyright (C) 1987-2008 by Udo Munk
*
* History:
* 17-SEP-1987 Development under Digital Research CP/M 2.2
* 28-JUN-1988 Switched to Unix System V.3
* 21-OCT-2006 changed to ANSI C for modern POSIX OS's
* 03-FEB-2007 more ANSI C conformance and reduced compiler warnings
* 18-MAR-2007 use default output file extension dependend on format
* 04-OCT-2008 fixed comment bug, ';' string argument now working
*/
/*
* opcode tables
*/
#include <stdio.h>
#include "z80a.h"
extern int op_1b(), op_2b(), op_pupo(), op_ex(), op_ld();
extern int op_call(), op_ret(), op_jp(), op_jr(), op_djnz(), op_rst();
extern int op_add(), op_adc(), op_sub(), op_sbc(), op_cp();
extern int op_inc(), op_dec(), op_or(), op_xor(), op_and();
extern int op_rl(), op_rr(), op_sla(), op_sra(), op_srl(), op_rlc(), op_rrc();
extern int op_out(), op_in(), op_im();
extern int op_set(), op_res(), op_bit();
extern int op_org(), op_dl(), op_equ();
extern int op_ds(), op_db(), op_dw(), op_dm();
extern int op_misc();
extern int op_cond();
extern int op_glob();
/*
* opcode table:
* includes entries for all opcodes and pseudo ops other than END
* must be sorted in ascending order!
*/
struct opc opctab[] = {
{ "ADC", op_adc, 0, 0 },
{ "ADD", op_add, 0, 0 },
{ "AND", op_and, 0, 0 },
{ "BIT", op_bit, 0, 0 },
{ "CALL", op_call, 0, 0 },
{ "CCF", op_1b, 0x3f, 0 },
{ "CP", op_cp, 0, 0 },
{ "CPD", op_2b, 0xed, 0xa9 },
{ "CPDR", op_2b, 0xed, 0xb9 },
{ "CPI", op_2b, 0xed, 0xa1 },
{ "CPIR", op_2b, 0xed, 0xb1 },
{ "CPL", op_1b, 0x2f, 0 },
{ "DAA", op_1b, 0x27, 0 },
{ "DEC", op_dec, 0, 0 },
{ "DEFB", op_db, 0, 0 },
{ "DEFL", op_dl, 0, 0 },
{ "DEFM", op_dm, 0, 0 },
{ "DEFS", op_ds, 0, 0 },
{ "DEFW", op_dw, 0, 0 },
{ "DI", op_1b, 0xf3, 0 },
{ "DJNZ", op_djnz, 0, 0 },
{ "EI", op_1b, 0xfb, 0 },
{ "EJECT", op_misc, 1, 0 },
{ "ELSE", op_cond, 98, 0 },
{ "ENDIF", op_cond, 99, 0 },
{ "EQU", op_equ, 0, 0 },
{ "EX", op_ex, 0, 0 },
{ "EXTRN", op_glob, 1, 0 },
{ "EXX", op_1b, 0xd9, 0 },
{ "HALT", op_1b, 0x76, 0 },
{ "IFDEF", op_cond, 1, 0 },
{ "IFEQ", op_cond, 3, 0 },
{ "IFNDEF", op_cond, 2, 0 },
{ "IFNEQ", op_cond, 4, 0 },
{ "IM", op_im, 0, 0 },
{ "IN", op_in, 0, 0 },
{ "INC", op_inc, 0, 0 },
{ "INCLUDE", op_misc, 6, 0 },
{ "IND", op_2b, 0xed, 0xaa },
{ "INDR", op_2b, 0xed, 0xba },
{ "INI", op_2b, 0xed, 0xa2 },
{ "INIR", op_2b, 0xed, 0xb2 },
{ "JP", op_jp, 0, 0 },
{ "JR", op_jr, 0, 0 },
{ "LD", op_ld, 0, 0 },
{ "LDD", op_2b, 0xed, 0xa8 },
{ "LDDR", op_2b, 0xed, 0xb8 },
{ "LDI", op_2b, 0xed, 0xa0 },
{ "LDIR", op_2b, 0xed, 0xb0 },
{ "LIST", op_misc, 2, 0 },
{ "NEG", op_2b, 0xed, 0x44 },
{ "NOLIST", op_misc, 3, 0 },
{ "NOP", op_1b, 0, 0 },
{ "OR", op_or, 0, 0 },
{ "ORG", op_org, 0, 0 },
{ "OTDR", op_2b, 0xed, 0xbb },
{ "OTIR", op_2b, 0xed, 0xb3 },
{ "OUT", op_out, 0, 0 },
{ "OUTD", op_2b, 0xed, 0xab },
{ "OUTI", op_2b, 0xed, 0xa3 },
{ "PAGE", op_misc, 4, 0 },
{ "POP", op_pupo, 1, 0 },
{ "PRINT", op_misc, 5, 0 },
{ "PUBLIC", op_glob, 2, 0 },
{ "PUSH", op_pupo, 2, 0 },
{ "RES", op_res, 0, 0 },
{ "RET", op_ret, 0, 0 },
{ "RETI", op_2b, 0xed, 0x4d },
{ "RETN", op_2b, 0xed, 0x45 },
{ "RL", op_rl, 0, 0 },
{ "RLA", op_1b, 0x17, 0 },
{ "RLC", op_rlc, 0, 0 },
{ "RLCA", op_1b, 0x07, 0 },
{ "RLD", op_2b, 0xed, 0x6f },
{ "RR", op_rr, 0, 0 },
{ "RRA", op_1b, 0x1f, 0 },
{ "RRC", op_rrc, 0, 0 },
{ "RRCA", op_1b, 0x0f, 0 },
{ "RRD", op_2b, 0xed, 0x67 },
{ "RST", op_rst, 0, 0 },
{ "SBC", op_sbc, 0, 0 },
{ "SCF", op_1b, 0x37, 0 },
{ "SET", op_set, 0, 0 },
{ "SLA", op_sla, 0, 0 },
{ "SRA", op_sra, 0, 0 },
{ "SRL", op_srl, 0, 0 },
{ "SUB", op_sub, 0, 0 },
{ "TITLE", op_misc, 7, 0 },
{ "XOR", op_xor, 0, 0 }
};
/*
* compute no. of table entries for search_op()
*/
int no_opcodes = sizeof(opctab) / sizeof(struct opc);
/*
* table with reserverd operand words: registers and flags
* must be sorted in ascending order!
*/
struct ope opetab[] = {
{ "(BC)", REGIBC },
{ "(DE)", REGIDE },
{ "(HL)", REGIHL },
{ "(IX)", REGIIX },
{ "(IY)", REGIIY },
{ "(SP)", REGISP },
{ "A", REGA },
{ "AF", REGAF },
{ "B", REGB },
{ "BC", REGBC },
{ "C", REGC },
{ "D", REGD },
{ "DE", REGDE },
{ "E", REGE },
{ "H", REGH },
{ "HL", REGHL },
{ "I", REGI },
{ "IX", REGIX },
{ "IY", REGIY },
{ "L", REGL },
{ "M", FLGM },
{ "NC", FLGNC },
{ "NZ", FLGNZ },
{ "P", FLGP },
{ "PE", FLGPE },
{ "PO", FLGPO },
{ "R", REGR },
{ "SP", REGSP },
{ "Z", FLGZ }
};
/*
* compute no. of table entries
*/
int no_operands = sizeof(opetab) / sizeof(struct ope);
|
//
// AppDelegate.h
// GAI Parse Lecture
//
// Created by Huy on 3/1/14.
// Copyright (c) 2014 huy. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#pragma once
#include "FNX_PhysClasses.h"
/// Simple linear spring
class FNX_Spring{
public:
//! Synapses
FNX_Synapse *LinkA, *LinkB;
//! Stiffness
float Stiffness;
//! Damping
float Damping;
//! Rest length
float RestLength;
public:
//! Constructor
FNX_Spring(const FNX_SpringDesc &desc);
//! Set stiffness
virtual void SetStiffness(float stiffness);
//! Get stiffness
virtual float GetStiffness() const;
//! Set damping
virtual void SetDamping(float damping);
//! Get damping
virtual float GetDamping() const;
//! Set rest length
virtual void SetRestLength(float length);
//! Get rest length
virtual float GetRestLength() const;
//! Get current spring length
virtual float GetLength() const;
//! Get first link
virtual FNX_Synapse *GetLinkA() const;
//! Get second link
virtual FNX_Synapse *GetLinkB() const;
//! Update
void Update(float timeDelta);
}; |
//
// printf.c
//
// Formatted print
//
// Copyright (C) 2011 Michael Ringgaard. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE 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 "stdio.h"
#include "stdarg.h"
#include "limits.h"
int _output(FILE *stream, const char *format, va_list args);
int _stbuf(FILE *stream, char *buf, int bufsiz);
void _ftbuf(FILE *stream);
int vfprintf(FILE *stream, const char *fmt, va_list args) {
int rc;
if (stream->flag & _IONBF) {
char buf[BUFSIZ];
_stbuf(stream, buf, BUFSIZ);
rc = _output(stream, fmt, args);
_ftbuf(stream);
} else {
rc = _output(stream, fmt, args);
}
return rc;
}
int fprintf(FILE *stream, const char *fmt, ...)
{
int rc;
va_list args;
va_start(args, fmt);
if (stream->flag & _IONBF) {
char buf[BUFSIZ];
_stbuf(stream, buf, BUFSIZ);
rc = _output(stream, fmt, args);
_ftbuf(stream);
} else {
rc = _output(stream, fmt, args);
}
return rc;
}
int vprintf(const char *fmt, va_list args) {
return vfprintf(stdout, fmt, args);
}
int xxprintf(const char *fmt, ...) {
va_list args;
va_start(args, fmt);
vfprintf(stdout, fmt, args);
return vfprintf(stdout, fmt, args);
}
int printf(const char *fmt, ...) {
va_list args;
va_start(args, fmt);
vfprintf(stdout, fmt, args);
return vfprintf(stdout, fmt, args);
}
int vsnprintf(char *buf, size_t count, const char *fmt, va_list args) {
FILE str;
int rc;
str.cnt = (int) count;
str.flag = _IOWR | _IOSTR;
str.ptr = str.base = buf;
rc = _output(&str, fmt, args);
if (buf != NULL) putc('\0', &str);
return rc;
}
int snprintf(char *buf, size_t count, const char *fmt, ...) {
va_list args;
FILE str;
int rc;
va_start(args, fmt);
str.cnt = (int) count;
str.flag = _IOWR | _IOSTR;
str.ptr = str.base = buf;
rc = _output(&str, fmt, args);
if (buf != NULL) putc('\0', &str);
return rc;
}
|
//
// ViewController.h
// AZSyntaxHighlighter
//
// Created by Andreas on 2/5/14.
// Copyright (c) 2014 Andreas Zimnas. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#pragma once
#include <map>
#include "config.h"
#include "DynamicObjectImplemenationBase.h"
NS_BEGIN(CORE_DYNAMIC_NAMESPACE)
class DynamicObjectExpandoImplementation : public DynamicObjectImplementationBase, public std::enable_shared_from_this < DynamicObjectExpandoImplementation > {
typedef std::map<member_name_type, DynamicObject> member_map_type;
public:
virtual bool tryGetMemberList(member_list & lst)const override{
for (auto member : _members){
lst.push_back(member.first);
}
return true;
};
virtual bool tryMemberGet(const get_member_context & context, result_type & result)override {
if (_members.find(context.name) == std::end(_members)){
// _members.emplace(std::pair<member_name_type, result_type>(context.name, DynamicObject()));
_members[context.name] = DynamicObject();
}
result.assign(_members[context.name]);
return true;
}
virtual bool tryMemberSet(const set_member_context & context, DynamicObject value)override {
_members[context.name] = value;
return true;
}
virtual bool tryInvoke(const invoke_context & context, result_type & result, const argument_list_type && arguments) {
return false;
}
// private:
member_map_type _members;
};
NS_END(CORE_DYNAMIC_NAMESPACE)
|
//
/*
阴天 在不开灯的房间
当所有思绪都一点一点沉淀
爱情究竟是精神鸦片
还是世纪末的无聊消遣
香烟 氲成一滩光圈
和他的照片就摆在手边
傻傻两个人 笑的多甜
*/
// RegisterViewController.h
// 爱服务
//
// Created by 张冬冬 on 16/4/11.
// Copyright © 2016年 张冬冬. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RegisterViewController : UIViewController
@end
|
typedef struct sp_wavin sp_wavin;
int sp_wavin_create(sp_wavin **p);
int sp_wavin_destroy(sp_wavin **p);
int sp_wavin_init(sp_data *sp, sp_wavin *p, const char *filename);
int sp_wavin_compute(sp_data *sp, sp_wavin *p, SPFLOAT *in, SPFLOAT *out);
int sp_wavin_get_sample(sp_data *sp, sp_wavin *p, SPFLOAT *out, SPFLOAT pos);
int sp_wavin_reset_to_start(sp_data *sp, sp_wavin *p);
int sp_wavin_seek(sp_data *sp, sp_wavin *p, unsigned long sample);
|
/*
-----------------------------------------------------------------------------
This source file is part of OSTIS (Open Semantic Technology for Intelligent Systems)
For the latest info, see http://www.ostis.net
Copyright (c) 2010-2014 OSTIS
OSTIS 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 3 of the License, or
(at your option) any later version.
OSTIS 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 OSTIS. If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------------
*/
#ifndef _sc_defines_h_
#define _sc_defines_h_
#ifdef SC_DEBUG
# define SC_DEBUG_MODE 1
#else
# define SC_DEBUG_MODE 0
#endif
#ifdef SC_PROFILE
# define SC_PROFILE_MODE 1
#else
# define SC_PROFILE_MODE 0
#endif
/*! Bound empty slot serach
*
* Can be used just with USE_SEGMENT_EMPTY_SLOT_BUFFER = 0
*/
#define BOUND_EMPTY_SLOT_SEARCH 0
//! Enable network scaling
#define USE_NETWORK_SCALE 0
#define MAX_PATH_LENGTH 1024
#define SC_CONCURRENCY_LEVEL 32 // max number of independent threads that can work in parallel with memory
#define SC_SEGMENT_CACHE_SIZE 32 // size of segments cache
#endif
|
//
// QuotesViewController.h
// VPPCoreDataExample
//
// Created by Víctor on 14/02/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface QuotesViewController : UITableViewController {
BOOL loading;
}
@property (nonatomic, retain) NSArray *quotes;
@property (nonatomic, retain) UISegmentedControl *segmentedControl;
@end
|
//
// UserService.h
// LeanChat
//
// Created by lzw on 14-10-22.
// Copyright (c) 2014年 LeanCloud. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CDCommon.h"
#import "CDAddRequest.h"
#import "CDAbuseReport.h"
@interface CDUserManager : NSObject
+ (instancetype)manager;
- (void)findFriendsWithBlock:(AVArrayResultBlock)block;
- (void)isMyFriend:(AVUser *)user block:(AVBooleanResultBlock)block;
- (void)findUsersByPartname:(NSString *)partName withBlock:(AVArrayResultBlock)block;
- (NSString *)getPeerIdOfUser:(AVUser *)user;
- (void)findUsersByIds:(NSArray *)userIds callback:(AVArrayResultBlock)callback;
- (void)getBigAvatarImageOfUser:(AVUser *)user block:(void (^)(UIImage *image))block;
- (void)displayAvatarOfUser:(AVUser *)user avatarView:(UIImageView *)avatarView;
- (void)getAvatarImageOfUser:(AVUser *)user block:(void (^)(UIImage *image))block;
- (void)saveAvatar:(UIImage *)image callback:(AVBooleanResultBlock)callback;
- (void)updateUsername:(NSString *)username block:(AVBooleanResultBlock)block;
- (void)addFriend:(AVUser *)user callback:(AVBooleanResultBlock)callback;
- (void)removeFriend:(AVUser *)user callback:(AVBooleanResultBlock)callback;
- (void)countAddRequestsWithBlock:(AVIntegerResultBlock)block;
- (void)findAddRequestsWithBlock:(AVArrayResultBlock)block;
- (void)agreeAddRequest:(CDAddRequest *)addRequest callback:(AVBooleanResultBlock)callback;
- (void)tryCreateAddRequestWithToUser:(AVUser *)user callback:(AVBooleanResultBlock)callback;
- (void)reportAbuseWithReason:(NSString *)reason convid:(NSString *)convid block:(AVBooleanResultBlock)block;
@end
|
#include "i2c.h"
/** @brief Waits for the I2C interrupt */
static inline void i2c_wait_int(void);
static inline void i2c_wait_int(void) { while((TWCR & (1<<TWINT)) == 0); }
void i2c_setup(void) {
//DDRC |= (1<<PC5) | (1<<PC4);
TWBR = 5;
TWCR &= ~((1<<TWSTA) | (1<<TWSTO));
TWCR = (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
TWAR = 0; // no slave address, don't respond to general call
}
void i2c_send_start(void) {
TWCR |= (1<<TWINT) | (1<<TWSTA);
i2c_wait_int();
//TWCR &= ~(1<<TWSTA);
}
void i2c_send_stop(void) {
TWCR |= (1<<TWINT) | (1<<TWSTO);
}
uint8_t i2c_master_read_byte(uint8_t send_ack) {
TWCR |= (1<<TWINT) | (send_ack << TWEA);
i2c_wait_int();
return TWDR;
}
uint8_t i2c_master_send_byte(uint8_t v) {
TWDR = v;
TWCR = TWCR & ~((1<<TWSTA) | (1<<TWSTO)) | (1<<TWINT);
i2c_wait_int();
uint8_t status = TWSR & ((1<<TWS7) | (1<<TWS6) | (1<<TWS5) | (1<<TWS4) | (1<<TWS3));
if(status == 0x18 || status == 0x28 || status == 0x40) {
return I2C_OK;
}
if(status == 0x20 || status == 0x30 || status == 0x48) {
return I2C_NAK;
}
if(status == 0x38) {
return I2C_ARB_LOST;
}
return I2C_UNEXPECTED;
}
|
//
// TEStoreStateStack.h
// MasterApp
//
// Created by Alexey Fayzullov on 9/10/15.
// Copyright (c) 2015 Techery. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "TEDomainMiddleware.h"
#import "TEStoreStateObserver.h"
@interface TEStatesTracer : TEStoreStateObserver <TEDomainMiddleware>
- (NSArray *)statesTraceForStoreClass:(Class)storeClass;
- (NSArray *)statesTraceForStore:(TEBaseStore *)store;
@end
|
/******************** (C) COPYRIGHT 2015 STMicroelectronics ********************
* Company : STMicroelectronics
* Author : MCD Application Team
* Description : STMicroelectronics Device Firmware Upgrade Extension Demo
* Version : V3.0.5
* Date : 01-September-2015
********************************************************************************
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
********************************************************************************
* FOR MORE INFORMATION PLEASE CAREFULLY READ THE LICENSE AGREEMENT FILE
* "MCD-ST Liberty SW License Agreement V2.pdf"
*******************************************************************************/
#if !defined(AFX_DFUFILEMGRDLGEXTRACT_H__EE4710CB_FCBF_48D3_8468_8E19F397C3DC__INCLUDED_)
#define AFX_DFUFILEMGRDLGEXTRACT_H__EE4710CB_FCBF_48D3_8468_8E19F397C3DC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DfuFileMgrDlgExtract.h : header file
//
#include "hexedit.h"
/////////////////////////////////////////////////////////////////////////////
// CDfuFileMgrDlgExtract dialog
class CDfuFileMgrDlgExtract : public CDialog
{
// Construction
public:
CDfuFileMgrDlgExtract(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDfuFileMgrDlgExtract)
enum { IDD = IDD_DfuFileMgrExtract_DIALOG };
CListBox m_ListFiles;
CHexEdit m_PidCtrl;
CHexEdit m_VidCtrl;
CHexEdit m_BcdCtrl;
CString m_Pid;
CString m_Vid;
CString m_Bcd;
CString m_DfuFile;
int m_ExtractFormat;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDfuFileMgrDlgExtract)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
HANDLE m_hFile;
CString m_FileBaseName;
// Generated message map functions
//{{AFX_MSG(CDfuFileMgrDlgExtract)
afx_msg void OnButtonopen();
virtual void OnCancel();
afx_msg void OnButtonextract();
afx_msg void OnPaint();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DFUFILEMGRDLGEXTRACT_H__EE4710CB_FCBF_48D3_8468_8E19F397C3DC__INCLUDED_)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.