text stringlengths 4 6.14k |
|---|
/*
* Copyright (C) 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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 JSStringBuilder_h
#define JSStringBuilder_h
#include "ExceptionHelpers.h"
#include "JSString.h"
#include "UStringConcatenate.h"
#include "Vector.h"
namespace JSC {
class JSStringBuilder {
public:
JSStringBuilder()
: m_okay(true)
{
}
void append(const UChar u)
{
m_okay &= buffer.tryAppend(&u, 1);
}
void append(const char* str)
{
append(str, strlen(str));
}
void append(const char* str, size_t len)
{
m_okay &= buffer.tryReserveCapacity(buffer.size() + len);
for (size_t i = 0; i < len; i++) {
UChar u = static_cast<unsigned char>(str[i]);
m_okay &= buffer.tryAppend(&u, 1);
}
}
void append(const UChar* str, size_t len)
{
m_okay &= buffer.tryAppend(str, len);
}
void append(const UString& str)
{
m_okay &= buffer.tryAppend(str.characters(), str.length());
}
JSValue build(ExecState* exec)
{
if (!m_okay)
return throwOutOfMemoryError(exec);
buffer.shrinkToFit();
if (!buffer.data())
return throwOutOfMemoryError(exec);
return jsString(exec, UString::adopt(buffer));
}
protected:
Vector<UChar, 64> buffer;
bool m_okay;
};
template<typename StringType1, typename StringType2>
inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, StringType2 string2)
{
PassRefPtr<StringImpl> result = WTF::tryMakeString(string1, string2);
if (!result)
return throwOutOfMemoryError(exec);
return jsNontrivialString(exec, result);
}
template<typename StringType1, typename StringType2, typename StringType3>
inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, StringType2 string2, StringType3 string3)
{
PassRefPtr<StringImpl> result = WTF::tryMakeString(string1, string2, string3);
if (!result)
return throwOutOfMemoryError(exec);
return jsNontrivialString(exec, result);
}
template<typename StringType1, typename StringType2, typename StringType3, typename StringType4>
inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4)
{
PassRefPtr<StringImpl> result = WTF::tryMakeString(string1, string2, string3, string4);
if (!result)
return throwOutOfMemoryError(exec);
return jsNontrivialString(exec, result);
}
template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5>
inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5)
{
PassRefPtr<StringImpl> result = WTF::tryMakeString(string1, string2, string3, string4, string5);
if (!result)
return throwOutOfMemoryError(exec);
return jsNontrivialString(exec, result);
}
template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6>
inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6)
{
PassRefPtr<StringImpl> result = WTF::tryMakeString(string1, string2, string3, string4, string5, string6);
if (!result)
return throwOutOfMemoryError(exec);
return jsNontrivialString(exec, result);
}
}
#endif
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#pragma mark -
//
// File: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks/CoreDuet.framework/CoreDuet
// UUID: 391F4142-B60A-3A81-9CDF-C13C78DD911C
//
// Arch: arm64
// Source version: 155.1.13.0.0
// Minimum iOS version: 8.0.0
// SDK version: 8.0.0
//
// Objective-C Garbage Collection: Unknown
//
|
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/*
* Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
* Copyright (c) 2015 System Fabric Works, Inc. All rights reserved.
*/
#ifndef RXE_POOL_H
#define RXE_POOL_H
#define RXE_POOL_ALIGN (16)
#define RXE_POOL_CACHE_FLAGS (0)
enum rxe_pool_flags {
RXE_POOL_INDEX = BIT(1),
RXE_POOL_KEY = BIT(2),
RXE_POOL_NO_ALLOC = BIT(4),
};
enum rxe_elem_type {
RXE_TYPE_UC,
RXE_TYPE_PD,
RXE_TYPE_AH,
RXE_TYPE_SRQ,
RXE_TYPE_QP,
RXE_TYPE_CQ,
RXE_TYPE_MR,
RXE_TYPE_MW,
RXE_TYPE_MC_GRP,
RXE_TYPE_MC_ELEM,
RXE_NUM_TYPES, /* keep me last */
};
struct rxe_pool_entry;
struct rxe_pool_entry {
struct rxe_pool *pool;
struct kref ref_cnt;
struct list_head list;
/* only used if keyed */
struct rb_node key_node;
/* only used if indexed */
struct rb_node index_node;
u32 index;
};
struct rxe_pool {
struct rxe_dev *rxe;
rwlock_t pool_lock; /* protects pool add/del/search */
size_t elem_size;
void (*cleanup)(struct rxe_pool_entry *obj);
enum rxe_pool_flags flags;
enum rxe_elem_type type;
unsigned int max_elem;
atomic_t num_elem;
/* only used if indexed */
struct {
struct rb_root tree;
unsigned long *table;
u32 last;
u32 max_index;
u32 min_index;
} index;
/* only used if keyed */
struct {
struct rb_root tree;
size_t key_offset;
size_t key_size;
} key;
};
/* initialize a pool of objects with given limit on
* number of elements. gets parameters from rxe_type_info
* pool elements will be allocated out of a slab cache
*/
int rxe_pool_init(struct rxe_dev *rxe, struct rxe_pool *pool,
enum rxe_elem_type type, u32 max_elem);
/* free resources from object pool */
void rxe_pool_cleanup(struct rxe_pool *pool);
/* allocate an object from pool holding and not holding the pool lock */
void *rxe_alloc_locked(struct rxe_pool *pool);
void *rxe_alloc(struct rxe_pool *pool);
/* connect already allocated object to pool */
int __rxe_add_to_pool(struct rxe_pool *pool, struct rxe_pool_entry *elem);
#define rxe_add_to_pool(pool, obj) __rxe_add_to_pool(pool, &(obj)->pelem)
/* assign an index to an indexed object and insert object into
* pool's rb tree holding and not holding the pool_lock
*/
int __rxe_add_index_locked(struct rxe_pool_entry *elem);
#define rxe_add_index_locked(obj) __rxe_add_index_locked(&(obj)->pelem)
int __rxe_add_index(struct rxe_pool_entry *elem);
#define rxe_add_index(obj) __rxe_add_index(&(obj)->pelem)
/* drop an index and remove object from rb tree
* holding and not holding the pool_lock
*/
void __rxe_drop_index_locked(struct rxe_pool_entry *elem);
#define rxe_drop_index_locked(obj) __rxe_drop_index_locked(&(obj)->pelem)
void __rxe_drop_index(struct rxe_pool_entry *elem);
#define rxe_drop_index(obj) __rxe_drop_index(&(obj)->pelem)
/* assign a key to a keyed object and insert object into
* pool's rb tree holding and not holding pool_lock
*/
int __rxe_add_key_locked(struct rxe_pool_entry *elem, void *key);
#define rxe_add_key_locked(obj, key) __rxe_add_key_locked(&(obj)->pelem, key)
int __rxe_add_key(struct rxe_pool_entry *elem, void *key);
#define rxe_add_key(obj, key) __rxe_add_key(&(obj)->pelem, key)
/* remove elem from rb tree holding and not holding the pool_lock */
void __rxe_drop_key_locked(struct rxe_pool_entry *elem);
#define rxe_drop_key_locked(obj) __rxe_drop_key_locked(&(obj)->pelem)
void __rxe_drop_key(struct rxe_pool_entry *elem);
#define rxe_drop_key(obj) __rxe_drop_key(&(obj)->pelem)
/* lookup an indexed object from index holding and not holding the pool_lock.
* takes a reference on object
*/
void *rxe_pool_get_index_locked(struct rxe_pool *pool, u32 index);
void *rxe_pool_get_index(struct rxe_pool *pool, u32 index);
/* lookup keyed object from key holding and not holding the pool_lock.
* takes a reference on the objecti
*/
void *rxe_pool_get_key_locked(struct rxe_pool *pool, void *key);
void *rxe_pool_get_key(struct rxe_pool *pool, void *key);
/* cleanup an object when all references are dropped */
void rxe_elem_release(struct kref *kref);
/* take a reference on an object */
#define rxe_add_ref(elem) kref_get(&(elem)->pelem.ref_cnt)
/* drop a reference on an object */
#define rxe_drop_ref(elem) kref_put(&(elem)->pelem.ref_cnt, rxe_elem_release)
#endif /* RXE_POOL_H */
|
//===- MCWinEH.h - Windows Unwinding Support --------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_MC_MCWINEH_H
#define LLVM_MC_MCWINEH_H
#include <vector>
namespace llvm {
class MCSection;
class MCStreamer;
class MCSymbol;
namespace WinEH {
struct Instruction {
const MCSymbol *Label;
const unsigned Offset;
const unsigned Register;
const unsigned Operation;
Instruction(unsigned Op, MCSymbol *L, unsigned Reg, unsigned Off)
: Label(L), Offset(Off), Register(Reg), Operation(Op) {}
};
struct FrameInfo {
const MCSymbol *Begin = nullptr;
const MCSymbol *End = nullptr;
const MCSymbol *ExceptionHandler = nullptr;
const MCSymbol *Function = nullptr;
const MCSymbol *PrologEnd = nullptr;
const MCSymbol *Symbol = nullptr;
const MCSection *TextSection = nullptr;
bool HandlesUnwind = false;
bool HandlesExceptions = false;
int LastFrameInst = -1;
const FrameInfo *ChainedParent = nullptr;
std::vector<Instruction> Instructions;
FrameInfo() = default;
FrameInfo(const MCSymbol *Function, const MCSymbol *BeginFuncEHLabel)
: Begin(BeginFuncEHLabel), Function(Function) {}
FrameInfo(const MCSymbol *Function, const MCSymbol *BeginFuncEHLabel,
const FrameInfo *ChainedParent)
: Begin(BeginFuncEHLabel), Function(Function),
ChainedParent(ChainedParent) {}
};
class UnwindEmitter {
public:
virtual ~UnwindEmitter();
/// This emits the unwind info sections (.pdata and .xdata in PE/COFF).
virtual void Emit(MCStreamer &Streamer) const = 0;
virtual void EmitUnwindInfo(MCStreamer &Streamer, FrameInfo *FI) const = 0;
};
}
}
#endif
|
// SPDX-License-Identifier: GPL-2.0
/*
* USB Serial Converter Bus specific functions
*
* Copyright (C) 2002 Greg Kroah-Hartman (greg@kroah.com)
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/tty.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
static int usb_serial_device_match(struct device *dev,
struct device_driver *drv)
{
const struct usb_serial_port *port = to_usb_serial_port(dev);
struct usb_serial_driver *driver = to_usb_serial_driver(drv);
/*
* drivers are already assigned to ports in serial_probe so it's
* a simple check here.
*/
if (driver == port->serial->type)
return 1;
return 0;
}
static int usb_serial_device_probe(struct device *dev)
{
struct usb_serial_port *port = to_usb_serial_port(dev);
struct usb_serial_driver *driver;
struct device *tty_dev;
int retval = 0;
int minor;
/* make sure suspend/resume doesn't race against port_probe */
retval = usb_autopm_get_interface(port->serial->interface);
if (retval)
return retval;
driver = port->serial->type;
if (driver->port_probe) {
retval = driver->port_probe(port);
if (retval)
goto err_autopm_put;
}
minor = port->minor;
tty_dev = tty_port_register_device(&port->port, usb_serial_tty_driver,
minor, dev);
if (IS_ERR(tty_dev)) {
retval = PTR_ERR(tty_dev);
goto err_port_remove;
}
usb_autopm_put_interface(port->serial->interface);
dev_info(&port->serial->dev->dev,
"%s converter now attached to ttyUSB%d\n",
driver->description, minor);
return 0;
err_port_remove:
if (driver->port_remove)
driver->port_remove(port);
err_autopm_put:
usb_autopm_put_interface(port->serial->interface);
return retval;
}
static int usb_serial_device_remove(struct device *dev)
{
struct usb_serial_port *port = to_usb_serial_port(dev);
struct usb_serial_driver *driver;
int minor;
int autopm_err;
/*
* Make sure suspend/resume doesn't race against port_remove.
*
* Note that no further runtime PM callbacks will be made if
* autopm_get fails.
*/
autopm_err = usb_autopm_get_interface(port->serial->interface);
minor = port->minor;
tty_unregister_device(usb_serial_tty_driver, minor);
driver = port->serial->type;
if (driver->port_remove)
driver->port_remove(port);
dev_info(dev, "%s converter now disconnected from ttyUSB%d\n",
driver->description, minor);
if (!autopm_err)
usb_autopm_put_interface(port->serial->interface);
return 0;
}
static ssize_t new_id_store(struct device_driver *driver,
const char *buf, size_t count)
{
struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver);
ssize_t retval = usb_store_new_id(&usb_drv->dynids, usb_drv->id_table,
driver, buf, count);
if (retval >= 0 && usb_drv->usb_driver != NULL)
retval = usb_store_new_id(&usb_drv->usb_driver->dynids,
usb_drv->usb_driver->id_table,
&usb_drv->usb_driver->drvwrap.driver,
buf, count);
return retval;
}
static ssize_t new_id_show(struct device_driver *driver, char *buf)
{
struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver);
return usb_show_dynids(&usb_drv->dynids, buf);
}
static DRIVER_ATTR_RW(new_id);
static struct attribute *usb_serial_drv_attrs[] = {
&driver_attr_new_id.attr,
NULL,
};
ATTRIBUTE_GROUPS(usb_serial_drv);
static void free_dynids(struct usb_serial_driver *drv)
{
struct usb_dynid *dynid, *n;
spin_lock(&drv->dynids.lock);
list_for_each_entry_safe(dynid, n, &drv->dynids.list, node) {
list_del(&dynid->node);
kfree(dynid);
}
spin_unlock(&drv->dynids.lock);
}
struct bus_type usb_serial_bus_type = {
.name = "usb-serial",
.match = usb_serial_device_match,
.probe = usb_serial_device_probe,
.remove = usb_serial_device_remove,
.drv_groups = usb_serial_drv_groups,
};
int usb_serial_bus_register(struct usb_serial_driver *driver)
{
int retval;
driver->driver.bus = &usb_serial_bus_type;
spin_lock_init(&driver->dynids.lock);
INIT_LIST_HEAD(&driver->dynids.list);
retval = driver_register(&driver->driver);
return retval;
}
void usb_serial_bus_deregister(struct usb_serial_driver *driver)
{
free_dynids(driver);
driver_unregister(&driver->driver);
}
|
/*
* Copyright (c) 2006 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* 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 Institute 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 INSTITUTE 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 INSTITUTE 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 "config.h"
#include "hash.h"
#include "md2.h"
static const unsigned char subst[256] = {
41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6,
19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188,
76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24,
138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251,
245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63,
148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50,
39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165,
181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210,
150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157,
112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27,
96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15,
85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197,
234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65,
129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123,
8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233,
203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228,
166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237,
31, 26, 219, 153, 141, 51, 159, 17, 131, 20
};
void
MD2_Init (struct md2 *m)
{
memset(m, 0, sizeof(*m));
}
static void
calc(struct md2 *m, const void *v)
{
unsigned char x[48], L;
const unsigned char *p = v;
int i, j, t;
L = m->checksum[15];
for (i = 0; i < 16; i++)
L = m->checksum[i] ^= subst[p[i] ^ L];
for (i = 0; i < 16; i++) {
x[i] = m->state[i];
x[i + 16] = p[i];
x[i + 32] = x[i] ^ p[i];
}
t = 0;
for (i = 0; i < 18; i++) {
for (j = 0; j < 48; j++)
t = x[j] ^= subst[t];
t = (t + i) & 0xff;
}
memcpy(m->state, x, 16);
memset(x, 0, sizeof(x));
}
void
MD2_Update (struct md2 *m, const void *v, size_t len)
{
size_t idx = m->len & 0xf;
const unsigned char *p = v;
m->len += len;
if (len + idx >= 16) {
if (idx) {
memcpy(m->data + idx, p, 16 - idx);
calc(m, m->data);
p += 16;
len -= 16 - idx;
}
while (len >= 16) {
calc(m, p);
p += 16;
len -= 16;
}
idx = 0;
}
memcpy(m->data + idx, p, len);
}
void
MD2_Final (void *res, struct md2 *m)
{
unsigned char pad[16];
size_t padlen;
padlen = 16 - (m->len % 16);
memset(pad, padlen, padlen);
MD2_Update(m, pad, padlen);
memcpy(pad, m->checksum, 16);
MD2_Update(m, pad, 16);
memcpy(res, m->state, MD2_DIGEST_LENGTH);
memset(m, 0, sizeof(m));
}
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
/*=====================================================================
**
** Source: test17.c
**
** Purpose: Test #17 for the vswprintf function.
**
**
**===================================================================*/
#include <palsuite.h>
#include "../vswprintf.h"
/* memcmp is used to verify the results, so this test is dependent on it. */
/* ditto with wcslen */
int __cdecl main(int argc, char *argv[])
{
double val = 2560.001;
double neg = -2560.001;
if (PAL_Initialize(argc, argv) != 0)
return(FAIL);
DoDoubleTest(convert("foo %g"), val, convert("foo 2560"),
convert("foo 2560"));
DoDoubleTest(convert("foo %lg"), val, convert("foo 2560"),
convert("foo 2560"));
DoDoubleTest(convert("foo %hg"), val, convert("foo 2560"),
convert("foo 2560"));
DoDoubleTest(convert("foo %Lg"), val, convert("foo 2560"),
convert("foo 2560"));
DoDoubleTest(convert("foo %I64g"), val, convert("foo 2560"),
convert("foo 2560"));
DoDoubleTest(convert("foo %5g"), val, convert("foo 2560"),
convert("foo 2560"));
DoDoubleTest(convert("foo %-5g"), val, convert("foo 2560 "),
convert("foo 2560 "));
DoDoubleTest(convert("foo %.1g"), val, convert("foo 3e+003"),
convert("foo 3e+03"));
DoDoubleTest(convert("foo %.2g"), val, convert("foo 2.6e+003"),
convert("foo 2.6e+03"));
DoDoubleTest(convert("foo %.12g"), val, convert("foo 2560.001"),
convert("foo 2560.001"));
DoDoubleTest(convert("foo %06g"), val, convert("foo 002560"),
convert("foo 002560"));
DoDoubleTest(convert("foo %#g"), val, convert("foo 2560.00"),
convert("foo 2560.00"));
DoDoubleTest(convert("foo %+g"), val, convert("foo +2560"),
convert("foo +2560"));
DoDoubleTest(convert("foo % g"), val, convert("foo 2560"),
convert("foo 2560"));
DoDoubleTest(convert("foo %+g"), neg, convert("foo -2560"),
convert("foo -2560"));
DoDoubleTest(convert("foo % g"), neg, convert("foo -2560"),
convert("foo -2560"));
PAL_Terminate();
return PASS;
}
|
/* { dg-do run } */
/* { dg-options "-O -fdump-tree-alias-details" } */
int *i;
void __attribute__((noinline))
foo (void)
{
*i = 1;
}
int __attribute__((noinline))
bar(int local_p)
{
int x = 0;
int *j;
int **p;
if (local_p)
p = &j;
else
p = &i;
*p = &x; /* This makes x escape. */
foo ();
return x;
}
extern void abort (void);
int main()
{
int k = 2;
i = &k;
if (bar (1) != 0 || k != 1)
abort ();
if (bar (0) != 1)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump "ESCAPED = { NULL ESCAPED NONLOCAL x }" "alias" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump "ESCAPED = { ESCAPED NONLOCAL x }" "alias" { target { keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "alias" } } */
|
/* Copyright 2019 kakunpc
*
* 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"
/* This a shortcut to help you visually see your layout.
*
* The first section contains all of the arguments representing the physical
* layout of the board and position of the Leys.
*
* The second converts the arguments into a two-dimensional array which
* represents the switch matrix.
*/
#define LAYOUT( \
L00, L01, L02, L03, L04, \
L10, L11, L12, L13, L14, \
L20, L21, L22, L23, L24, \
L30, L31, L32 \
) \
{ \
{ L00, L10, L20, L30 }, \
{ L01, L11, L21, L31 }, \
{ L02, L12, L22, L32 }, \
{ L03, L13, L23, KC_NO }, \
{ L04, L14, L24, KC_NO }, \
}
|
/*
* Copyright (C) Kevin Ollivier <kevino@theolliviers.com>. 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 Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebDOMCustomVoidCallback_h
#define WebDOMCustomVoidCallback_h
#include "VoidCallback.h"
#include <wtf/PassRefPtr.h>
// FIXME: This is just a stub to keep compilation working. We need to revisit
// this when we add support for these callbacks to the WebDOM bindings.
class WebDOMCustomVoidCallback : public WebCore::VoidCallback {
public:
static PassRefPtr<WebDOMCustomVoidCallback> create()
{
return adoptRef(new WebDOMCustomVoidCallback());
}
virtual ~WebDOMCustomVoidCallback();
virtual void handleEvent();
private:
WebDOMCustomVoidCallback();
};
WebCore::VoidCallback* toWebCore(const WebDOMCustomVoidCallback&);
#endif // WebDOMCustomVoidCallback_h
|
/**
* Copyright (c) 2015-present, Parse, LLC.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Foundation/Foundation.h>
#import <Parse/PFConstants.h>
#import "PFDataProvider.h"
@class BFTask<__covariant BFGenericType>;
@class PFConfig;
@class PFCurrentConfigController;
@interface PFConfigController : NSObject
@property (nonatomic, weak, readonly) id<PFPersistenceControllerProvider, PFCommandRunnerProvider> dataSource;
@property (nonatomic, strong, readonly) PFCurrentConfigController *currentConfigController;
///--------------------------------------
#pragma mark - Init
///--------------------------------------
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)initWithDataSource:(id<PFPersistenceControllerProvider, PFCommandRunnerProvider>)dataSource NS_DESIGNATED_INITIALIZER;
///--------------------------------------
#pragma mark - Fetch
///--------------------------------------
/**
Fetches current config from network async.
@param sessionToken Current user session token.
@return `BFTask` with result set to `PFConfig`.
*/
- (BFTask *)fetchConfigAsyncWithSessionToken:(NSString *)sessionToken;
@end
|
/* { dg-do run } */
/* { dg-options "-O2 --save-temps -fno-inline" } */
/* { dg-require-effective-target arm32 } */
extern void abort (void);
int
bics_si_test1 (int a, int b, int c)
{
if ((a & b) == a)
return a;
else
return c;
}
int
bics_si_test2 (int a, int b, int c)
{
if ((a & b) == b)
return b;
else
return c;
}
int
main ()
{
int x;
x = bics_si_test1 (0xf00d, 0xf11f, 0);
if (x != 0xf00d)
abort ();
x = bics_si_test1 (0xf11f, 0xf00d, 0);
if (x != 0)
abort ();
x = bics_si_test2 (0xf00d, 0xf11f, 0);
if (x != 0)
abort ();
x = bics_si_test2 (0xf11f, 0xf00d, 0);
if (x != 0xf00d)
abort ();
return 0;
}
/* { dg-final { scan-assembler-times "bics\tr\[0-9\]+, r\[0-9\]+, r\[0-9\]+" 2 } } */
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <vector>
#include "base/basictypes.h"
#include "base/string16.h"
namespace WebKit {
class WebIDBKey;
class WebSerializedScriptValue;
}
namespace webkit_glue {
// Warning: this method holds a V8 lock, it should only be called within a
// sandbox.
bool IDBKeysFromValuesAndKeyPath(
const std::vector<WebKit::WebSerializedScriptValue>&
serialized_script_values,
const string16& idb_key_path,
std::vector<WebKit::WebIDBKey>* values);
WebKit::WebSerializedScriptValue InjectIDBKey(
const WebKit::WebIDBKey& key,
const WebKit::WebSerializedScriptValue& value,
const string16& idb_key_path);
} // namespace webkit_glue
|
#include "rpc.h"
#include "rpcndr.h"
void dump_data(const unsigned char *buf1,int len);
#if _WIN32_WINNT < 0x600
#define NdrSendReceive NdrSendReceiveMarshall
void NdrSendReceiveMarshall(PMIDL_STUB_MESSAGE stubmsg, unsigned char *buffer);
#define NdrGetBuffer NdrGetBufferMarshall
void NdrGetBufferMarshall(PMIDL_STUB_MESSAGE stubmsg, unsigned long len, RPC_BINDING_HANDLE hnd);
#define NdrServerInitializeNew NdrServerInitializeNewMarshall
void NdrServerInitializeNewMarshall(PRPC_MESSAGE pRpcMsg,
PMIDL_STUB_MESSAGE pStubMsg,
PMIDL_STUB_DESC pStubDesc);
#define I_RpcGetBuffer I_RpcGetBufferMarshall
RPC_STATUS WINAPI I_RpcGetBufferMarshall(PRPC_MESSAGE pMsg);
#endif /* _WIN32_WINNT < 0x600 */
|
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright 2019 Collabora ltd. */
#ifndef __PANFROST_DEVFREQ_H__
#define __PANFROST_DEVFREQ_H__
#include <linux/spinlock.h>
#include <linux/ktime.h>
struct devfreq;
struct opp_table;
struct thermal_cooling_device;
struct panfrost_device;
struct panfrost_devfreq {
struct devfreq *devfreq;
struct opp_table *regulators_opp_table;
struct thermal_cooling_device *cooling;
bool opp_of_table_added;
ktime_t busy_time;
ktime_t idle_time;
ktime_t time_last_update;
int busy_count;
/*
* Protect busy_time, idle_time, time_last_update and busy_count
* because these can be updated concurrently between multiple jobs.
*/
spinlock_t lock;
};
int panfrost_devfreq_init(struct panfrost_device *pfdev);
void panfrost_devfreq_fini(struct panfrost_device *pfdev);
void panfrost_devfreq_resume(struct panfrost_device *pfdev);
void panfrost_devfreq_suspend(struct panfrost_device *pfdev);
void panfrost_devfreq_record_busy(struct panfrost_devfreq *devfreq);
void panfrost_devfreq_record_idle(struct panfrost_devfreq *devfreq);
#endif /* __PANFROST_DEVFREQ_H__ */
|
/*
* Marvell Wireless LAN device driver: generic data structures and APIs
*
* Copyright (C) 2011-2014, Marvell International Ltd.
*
* This software file (the "File") is distributed by Marvell International
* Ltd. under the terms of the GNU General Public License Version 2, June 1991
* (the "License"). You may use, redistribute and/or modify this File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.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 License provides additional details about
* this warranty disclaimer.
*/
#ifndef _MWIFIEX_DECL_H_
#define _MWIFIEX_DECL_H_
#undef pr_fmt
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/wait.h>
#include <linux/timer.h>
#include <linux/ieee80211.h>
#include <uapi/linux/if_arp.h>
#include <net/mac80211.h>
#define MWIFIEX_MAX_BSS_NUM (3)
#define MWIFIEX_MIN_DATA_HEADER_LEN 36 /* sizeof(mwifiex_txpd)
* + 4 byte alignment
*/
#define MWIFIEX_MGMT_FRAME_HEADER_SIZE 8 /* sizeof(pkt_type)
* + sizeof(tx_control)
*/
#define MWIFIEX_MAX_TX_BASTREAM_SUPPORTED 2
#define MWIFIEX_MAX_RX_BASTREAM_SUPPORTED 16
#define MWIFIEX_STA_AMPDU_DEF_TXWINSIZE 64
#define MWIFIEX_STA_AMPDU_DEF_RXWINSIZE 64
#define MWIFIEX_UAP_AMPDU_DEF_TXWINSIZE 32
#define MWIFIEX_UAP_AMPDU_DEF_RXWINSIZE 16
#define MWIFIEX_11AC_STA_AMPDU_DEF_TXWINSIZE 64
#define MWIFIEX_11AC_STA_AMPDU_DEF_RXWINSIZE 64
#define MWIFIEX_11AC_UAP_AMPDU_DEF_TXWINSIZE 64
#define MWIFIEX_11AC_UAP_AMPDU_DEF_RXWINSIZE 64
#define MWIFIEX_DEFAULT_BLOCK_ACK_TIMEOUT 0xffff
#define MWIFIEX_RATE_BITMAP_MCS0 32
#define MWIFIEX_RX_DATA_BUF_SIZE (4 * 1024)
#define MWIFIEX_RX_CMD_BUF_SIZE (2 * 1024)
#define MAX_BEACON_PERIOD (4000)
#define MIN_BEACON_PERIOD (50)
#define MAX_DTIM_PERIOD (100)
#define MIN_DTIM_PERIOD (1)
#define MWIFIEX_RTS_MIN_VALUE (0)
#define MWIFIEX_RTS_MAX_VALUE (2347)
#define MWIFIEX_FRAG_MIN_VALUE (256)
#define MWIFIEX_FRAG_MAX_VALUE (2346)
#define MWIFIEX_WMM_VERSION 0x01
#define MWIFIEX_WMM_SUBTYPE 0x01
#define MWIFIEX_RETRY_LIMIT 14
#define MWIFIEX_SDIO_BLOCK_SIZE 256
#define MWIFIEX_BUF_FLAG_REQUEUED_PKT BIT(0)
#define MWIFIEX_BUF_FLAG_BRIDGED_PKT BIT(1)
#define MWIFIEX_BUF_FLAG_TDLS_PKT BIT(2)
#define MWIFIEX_BUF_FLAG_EAPOL_TX_STATUS BIT(3)
#define MWIFIEX_BUF_FLAG_ACTION_TX_STATUS BIT(4)
#define MWIFIEX_BRIDGED_PKTS_THR_HIGH 1024
#define MWIFIEX_BRIDGED_PKTS_THR_LOW 128
#define MWIFIEX_TDLS_DISABLE_LINK 0x00
#define MWIFIEX_TDLS_ENABLE_LINK 0x01
#define MWIFIEX_TDLS_CREATE_LINK 0x02
#define MWIFIEX_TDLS_CONFIG_LINK 0x03
#define MWIFIEX_TDLS_RSSI_HIGH 50
#define MWIFIEX_TDLS_RSSI_LOW 55
#define MWIFIEX_TDLS_MAX_FAIL_COUNT 4
#define MWIFIEX_AUTO_TDLS_IDLE_TIME 10
enum mwifiex_bss_type {
MWIFIEX_BSS_TYPE_STA = 0,
MWIFIEX_BSS_TYPE_UAP = 1,
MWIFIEX_BSS_TYPE_P2P = 2,
MWIFIEX_BSS_TYPE_ANY = 0xff,
};
enum mwifiex_bss_role {
MWIFIEX_BSS_ROLE_STA = 0,
MWIFIEX_BSS_ROLE_UAP = 1,
MWIFIEX_BSS_ROLE_ANY = 0xff,
};
enum mwifiex_tdls_status {
TDLS_NOT_SETUP = 0,
TDLS_SETUP_INPROGRESS,
TDLS_SETUP_COMPLETE,
TDLS_SETUP_FAILURE,
TDLS_LINK_TEARDOWN,
};
enum mwifiex_tdls_error_code {
TDLS_ERR_NO_ERROR = 0,
TDLS_ERR_INTERNAL_ERROR,
TDLS_ERR_MAX_LINKS_EST,
TDLS_ERR_LINK_EXISTS,
TDLS_ERR_LINK_NONEXISTENT,
TDLS_ERR_PEER_STA_UNREACHABLE = 25,
};
#define BSS_ROLE_BIT_MASK BIT(0)
#define GET_BSS_ROLE(priv) ((priv)->bss_role & BSS_ROLE_BIT_MASK)
enum mwifiex_data_frame_type {
MWIFIEX_DATA_FRAME_TYPE_ETH_II = 0,
MWIFIEX_DATA_FRAME_TYPE_802_11,
};
struct mwifiex_fw_image {
u8 *helper_buf;
u32 helper_len;
u8 *fw_buf;
u32 fw_len;
};
struct mwifiex_802_11_ssid {
u32 ssid_len;
u8 ssid[IEEE80211_MAX_SSID_LEN];
};
struct mwifiex_wait_queue {
wait_queue_head_t wait;
int status;
};
struct mwifiex_rxinfo {
u8 bss_num;
u8 bss_type;
struct sk_buff *parent;
u8 use_count;
};
struct mwifiex_txinfo {
u32 status_code;
u8 flags;
u8 bss_num;
u8 bss_type;
u32 pkt_len;
u8 ack_frame_id;
u64 cookie;
};
enum mwifiex_wmm_ac_e {
WMM_AC_BK,
WMM_AC_BE,
WMM_AC_VI,
WMM_AC_VO
} __packed;
struct ieee_types_wmm_ac_parameters {
u8 aci_aifsn_bitmap;
u8 ecw_bitmap;
__le16 tx_op_limit;
} __packed;
struct mwifiex_types_wmm_info {
u8 oui[4];
u8 subtype;
u8 version;
u8 qos_info;
u8 reserved;
struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
} __packed;
struct mwifiex_arp_eth_header {
struct arphdr hdr;
u8 ar_sha[ETH_ALEN];
u8 ar_sip[4];
u8 ar_tha[ETH_ALEN];
u8 ar_tip[4];
} __packed;
struct mwifiex_chan_stats {
u8 chan_num;
u8 bandcfg;
u8 flags;
s8 noise;
u16 total_bss;
u16 cca_scan_dur;
u16 cca_busy_dur;
} __packed;
#endif /* !_MWIFIEX_DECL_H_ */
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_HOST_HOST_STATUS_OBSERVER_H_
#define REMOTING_HOST_HOST_STATUS_OBSERVER_H_
#include <string>
namespace net {
class IPEndPoint;
} // namespace net
namespace remoting {
class SignalStrategy;
namespace protocol {
struct TransportRoute;
};
// Interface for host status observer. All methods are invoked on the
// network thread. Observers must not tear-down ChromotingHost state
// on receipt of these callbacks; they are purely informational.
class HostStatusObserver {
public:
HostStatusObserver() { }
virtual ~HostStatusObserver() { }
// Called when an unauthorized user attempts to connect to the host.
virtual void OnAccessDenied(const std::string& jid) {}
// A new client is authenticated.
virtual void OnClientAuthenticated(const std::string& jid) {}
// All channels for an autheticated client are connected.
virtual void OnClientConnected(const std::string& jid) {}
// An authenticated client is disconnected.
virtual void OnClientDisconnected(const std::string& jid) {}
// Called on notification of a route change event, when a channel is
// connected.
virtual void OnClientRouteChange(const std::string& jid,
const std::string& channel_name,
const protocol::TransportRoute& route) {}
// Called when hosting is started for an account.
virtual void OnStart(const std::string& host_owner_email) {}
// Called when the host shuts down.
virtual void OnShutdown() {}
};
} // namespace remoting
#endif // REMOTING_HOST_HOST_STATUS_OBSERVER_H_
|
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <UIKit/UIKit.h>
#import <React/RCTShadowView.h>
@interface RCTScrollContentShadowView : RCTShadowView
@end
|
/*
* Driver for Aeroflex Gaisler GRLIB GRUSBHC EHCI host controller
*
* GRUSBHC is typically found on LEON/GRLIB SoCs
*
* (c) Jan Andersson <jan@gaisler.com>
*
* Based on ehci-ppc-of.c which is:
* (c) Valentine Barshak <vbarshak@ru.mvista.com>
* and in turn based on "ehci-ppc-soc.c" by Stefan Roese <sr@denx.de>
* and "ohci-ppc-of.c" by Sylvain Munaut <tnt@246tNt.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/err.h>
#include <linux/signal.h>
#include <linux/of_irq.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
#define GRUSBHC_HCIVERSION 0x0100 /* Known value of cap. reg. HCIVERSION */
static const struct hc_driver ehci_grlib_hc_driver = {
.description = hcd_name,
.product_desc = "GRLIB GRUSBHC EHCI",
.hcd_priv_size = sizeof(struct ehci_hcd),
/*
* generic hardware linkage
*/
.irq = ehci_irq,
.flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
/*
* basic lifecycle operations
*/
.reset = ehci_setup,
.start = ehci_run,
.stop = ehci_stop,
.shutdown = ehci_shutdown,
/*
* managing i/o requests and associated device resources
*/
.urb_enqueue = ehci_urb_enqueue,
.urb_dequeue = ehci_urb_dequeue,
.endpoint_disable = ehci_endpoint_disable,
.endpoint_reset = ehci_endpoint_reset,
/*
* scheduling support
*/
.get_frame_number = ehci_get_frame,
/*
* root hub support
*/
.hub_status_data = ehci_hub_status_data,
.hub_control = ehci_hub_control,
#ifdef CONFIG_PM
.bus_suspend = ehci_bus_suspend,
.bus_resume = ehci_bus_resume,
#endif
.relinquish_port = ehci_relinquish_port,
.port_handed_over = ehci_port_handed_over,
.clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
};
static int ehci_hcd_grlib_probe(struct platform_device *op)
{
struct device_node *dn = op->dev.of_node;
struct usb_hcd *hcd;
struct ehci_hcd *ehci = NULL;
struct resource res;
u32 hc_capbase;
int irq;
int rv;
if (usb_disabled())
return -ENODEV;
dev_dbg(&op->dev, "initializing GRUSBHC EHCI USB Controller\n");
rv = of_address_to_resource(dn, 0, &res);
if (rv)
return rv;
/* usb_create_hcd requires dma_mask != NULL */
op->dev.dma_mask = &op->dev.coherent_dma_mask;
hcd = usb_create_hcd(&ehci_grlib_hc_driver, &op->dev,
"GRUSBHC EHCI USB");
if (!hcd)
return -ENOMEM;
hcd->rsrc_start = res.start;
hcd->rsrc_len = resource_size(&res);
irq = irq_of_parse_and_map(dn, 0);
if (irq == NO_IRQ) {
dev_err(&op->dev, "%s: irq_of_parse_and_map failed\n",
__FILE__);
rv = -EBUSY;
goto err_irq;
}
hcd->regs = devm_ioremap_resource(&op->dev, &res);
if (IS_ERR(hcd->regs)) {
rv = PTR_ERR(hcd->regs);
goto err_ioremap;
}
ehci = hcd_to_ehci(hcd);
ehci->caps = hcd->regs;
/* determine endianness of this implementation */
hc_capbase = ehci_readl(ehci, &ehci->caps->hc_capbase);
if (HC_VERSION(ehci, hc_capbase) != GRUSBHC_HCIVERSION) {
ehci->big_endian_mmio = 1;
ehci->big_endian_desc = 1;
ehci->big_endian_capbase = 1;
}
rv = usb_add_hcd(hcd, irq, 0);
if (rv)
goto err_ioremap;
device_wakeup_enable(hcd->self.controller);
return 0;
err_ioremap:
irq_dispose_mapping(irq);
err_irq:
usb_put_hcd(hcd);
return rv;
}
static int ehci_hcd_grlib_remove(struct platform_device *op)
{
struct usb_hcd *hcd = platform_get_drvdata(op);
dev_dbg(&op->dev, "stopping GRLIB GRUSBHC EHCI USB Controller\n");
usb_remove_hcd(hcd);
irq_dispose_mapping(hcd->irq);
usb_put_hcd(hcd);
return 0;
}
static const struct of_device_id ehci_hcd_grlib_of_match[] = {
{
.name = "GAISLER_EHCI",
},
{
.name = "01_026",
},
{},
};
MODULE_DEVICE_TABLE(of, ehci_hcd_grlib_of_match);
static struct platform_driver ehci_grlib_driver = {
.probe = ehci_hcd_grlib_probe,
.remove = ehci_hcd_grlib_remove,
.shutdown = usb_hcd_platform_shutdown,
.driver = {
.name = "grlib-ehci",
.owner = THIS_MODULE,
.of_match_table = ehci_hcd_grlib_of_match,
},
};
|
/*
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SLAVE_PENS_H
#define SLAVE_PENS_H
uint32 const EncounterCount = 3;
#define SPScriptName "instance_the_slave_pens"
#define DataHeader "SP"
enum DataTypes
{
DATA_MENNU_THE_BETRAYER = 1,
DATA_ROKMAR_THE_CRACKLER = 2,
DATA_QUAGMIRRAN = 3
};
#endif // SLAVE_PENS_H
|
/*
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef AccelGlyphCache_h_Included
#define AccelGlyphCache_h_Included
#ifdef __cplusplus
extern "C" {
#endif
#include "jni.h"
#include "fontscalerdefs.h"
typedef void (FlushFunc)();
typedef struct _CacheCellInfo CacheCellInfo;
typedef struct {
CacheCellInfo *head;
CacheCellInfo *tail;
unsigned int cacheID;
jint width;
jint height;
jint cellWidth;
jint cellHeight;
jboolean isFull;
FlushFunc *Flush;
} GlyphCacheInfo;
struct _CacheCellInfo {
GlyphCacheInfo *cacheInfo;
struct GlyphInfo *glyphInfo;
// next cell info in the cache's list
CacheCellInfo *next;
// REMIND: find better name?
// next cell info in the glyph's cell list (next Glyph Cache Info)
CacheCellInfo *nextGCI;
jint timesRendered;
jint x;
jint y;
// number of pixels from the left or right edge not considered touched
// by the glyph
jint leftOff;
jint rightOff;
jfloat tx1;
jfloat ty1;
jfloat tx2;
jfloat ty2;
};
GlyphCacheInfo *
AccelGlyphCache_Init(jint width, jint height,
jint cellWidth, jint cellHeight,
FlushFunc *func);
CacheCellInfo *
AccelGlyphCache_AddGlyph(GlyphCacheInfo *cache, struct GlyphInfo *glyph);
void
AccelGlyphCache_Invalidate(GlyphCacheInfo *cache);
void
AccelGlyphCache_AddCellInfo(struct GlyphInfo *glyph, CacheCellInfo *cellInfo);
void
AccelGlyphCache_RemoveCellInfo(struct GlyphInfo *glyph, CacheCellInfo *cellInfo);
CacheCellInfo *
AccelGlyphCache_GetCellInfoForCache(struct GlyphInfo *glyph,
GlyphCacheInfo *cache);
JNIEXPORT void
AccelGlyphCache_RemoveAllCellInfos(struct GlyphInfo *glyph);
void
AccelGlyphCache_Free(GlyphCacheInfo *cache);
#ifdef __cplusplus
};
#endif
#endif /* AccelGlyphCache_h_Included */
|
/*
* linux/include/asm-arm/arch-sa1100/memory.h
*
* Copyright (C) 1999-2000 Nicolas Pitre <nico@cam.org>
*/
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H
#include <asm/sizes.h>
/*
* Physical DRAM offset is 0xc0000000 on the SA1100
*/
#define PHYS_OFFSET UL(0xc0000000)
#ifndef __ASSEMBLY__
#ifdef CONFIG_SA1111
void sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes);
#define arch_adjust_zones(node, size, holes) \
sa1111_adjust_zones(node, size, holes)
#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_1M - 1)
#endif
#endif
/*
* Virtual view <-> DMA view memory address translations
* virt_to_bus: Used to translate the virtual address to an
* address suitable to be passed to set_dma_addr
* bus_to_virt: Used to convert an address for DMA operations
* to an address that the kernel can use.
*
* On the SA1100, bus addresses are equivalent to physical addresses.
*/
#define __virt_to_bus(x) __virt_to_phys(x)
#define __bus_to_virt(x) __phys_to_virt(x)
/*
* Because of the wide memory address space between physical RAM banks on the
* SA1100, it's much convenient to use Linux's NUMA support to implement our
* memory map representation. Assuming all memory nodes have equal access
* characteristics, we then have generic discontiguous memory support.
*
* Of course, all this isn't mandatory for SA1100 implementations with only
* one used memory bank. For those, simply undefine CONFIG_DISCONTIGMEM.
*
* The nodes are matched with the physical memory bank addresses which are
* incidentally the same as virtual addresses.
*
* node 0: 0xc0000000 - 0xc7ffffff
* node 1: 0xc8000000 - 0xcfffffff
* node 2: 0xd0000000 - 0xd7ffffff
* node 3: 0xd8000000 - 0xdfffffff
*/
#define NODE_MEM_SIZE_BITS 27
/*
* Cache flushing area - SA1100 zero bank
*/
#define FLUSH_BASE_PHYS 0xe0000000
#define FLUSH_BASE 0xf5000000
#define FLUSH_BASE_MINICACHE 0xf5100000
#endif
|
/*
* Suspend/resume support
*
* Copyright 2009 MontaVista Software, Inc.
*
* Author: Anton Vorontsov <avorontsov@ru.mvista.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/export.h>
#include <linux/suspend.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
struct pmc_regs {
__be32 devdisr;
__be32 devdisr2;
__be32 :32;
__be32 :32;
__be32 pmcsr;
#define PMCSR_SLP (1 << 17)
};
static struct device *pmc_dev;
static struct pmc_regs __iomem *pmc_regs;
static int pmc_suspend_enter(suspend_state_t state)
{
int ret;
setbits32(&pmc_regs->pmcsr, PMCSR_SLP);
/* At this point, the CPU is asleep. */
/* Upon resume, wait for SLP bit to be clear. */
ret = spin_event_timeout((in_be32(&pmc_regs->pmcsr) & PMCSR_SLP) == 0,
10000, 10) ? 0 : -ETIMEDOUT;
if (ret)
dev_err(pmc_dev, "tired waiting for SLP bit to clear\n");
return ret;
}
static int pmc_suspend_valid(suspend_state_t state)
{
if (state != PM_SUSPEND_STANDBY)
return 0;
return 1;
}
static const struct platform_suspend_ops pmc_suspend_ops = {
.valid = pmc_suspend_valid,
.enter = pmc_suspend_enter,
};
static int pmc_probe(struct platform_device *ofdev)
{
pmc_regs = of_iomap(ofdev->dev.of_node, 0);
if (!pmc_regs)
return -ENOMEM;
pmc_dev = &ofdev->dev;
suspend_set_ops(&pmc_suspend_ops);
return 0;
}
static const struct of_device_id pmc_ids[] = {
{ .compatible = "fsl,mpc8548-pmc", },
{ .compatible = "fsl,mpc8641d-pmc", },
{ },
};
static struct platform_driver pmc_driver = {
.driver = {
.name = "fsl-pmc",
.owner = THIS_MODULE,
.of_match_table = pmc_ids,
},
.probe = pmc_probe,
};
static int __init pmc_init(void)
{
return platform_driver_register(&pmc_driver);
}
device_initcall(pmc_init);
|
/*
* Put this file in pjlib/include/pj
*/
/* sample configure command:
CFLAGS="-g -Wno-unused-label" ./aconfigure --enable-ext-sound --disable-speex-aec --disable-g711-codec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-opencore-amrnb --disable-sdl --disable-ffmpeg --disable-v4l2
*/
#define THIRD_PARTY_MEDIA 1
#if THIRD_PARTY_MEDIA
/*
* Sample settings for using third party media with pjsua-lib
*/
# define PJSUA_MEDIA_HAS_PJMEDIA 0
# define PJMEDIA_HAS_G711_CODEC 0
# define PJMEDIA_HAS_ALAW_ULAW_TABLE 0
# define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE
# define PJMEDIA_HAS_SPEEX_AEC 0
# define PJMEDIA_HAS_L16_CODEC 0
# define PJMEDIA_HAS_GSM_CODEC 0
# define PJMEDIA_HAS_SPEEX_CODEC 0
# define PJMEDIA_HAS_ILBC_CODEC 0
# define PJMEDIA_HAS_G722_CODEC 0
# define PJMEDIA_HAS_G7221_CODEC 0
# define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 0
# define PJMEDIA_HAS_VIDEO 1
# define PJMEDIA_HAS_FFMPEG 0
# undef PJMEDIA_VIDEO_DEV_HAS_SDL
# define PJMEDIA_VIDEO_DEV_HAS_SDL 0
# define PJMEDIA_VIDEO_DEV_HAS_QT 0
# define PJMEDIA_VIDEO_DEV_HAS_IOS 0
# define PJMEDIA_VIDEO_DEV_HAS_DSHOW 0
# define PJMEDIA_VIDEO_DEV_HAS_CBAR_SRC 0
# define PJMEDIA_VIDEO_DEV_HAS_FFMPEG 0
# undef PJMEDIA_VIDEO_DEV_HAS_V4L2
# define PJMEDIA_VIDEO_DEV_HAS_V4L2 0
#endif /* THIRD_PARTY_MEDIA */
|
/******************************************************************************
* *
* License Agreement *
* *
* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. *
* All rights reserved. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* 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. *
* *
* This agreement shall be governed in all respects by the laws of the State *
* of California and by the laws of the United States of America. *
* *
******************************************************************************/
#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__
#define __ALTERA_AVALON_JTAG_UART_REGS_H__
#include <io.h>
#define ALTERA_AVALON_JTAG_UART_DATA_REG 0
#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \
__IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG)
#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \
IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG)
#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \
IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data)
#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF)
#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0)
#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000)
#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15)
#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000)
#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16)
#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1
#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \
__IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG)
#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \
IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG)
#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \
IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data)
#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001)
#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0)
#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002)
#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1)
#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100)
#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8)
#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200)
#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9)
#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400)
#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10)
#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000)
#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16)
#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */
|
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2004-2010 Sage Weil <sage@newdream.net>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software
* Foundation. See file COPYING.
*
*/
#ifndef CEPH_RBD_TYPES_H
#define CEPH_RBD_TYPES_H
#include <linux/types.h>
/* For format version 2, rbd image 'foo' consists of objects
* rbd_id.foo - id of image
* rbd_header.<id> - image metadata
* rbd_object_map.<id> - optional image object map
* rbd_data.<id>.0000000000000000
* rbd_data.<id>.0000000000000001
* ... - data
* Clients do not access header data directly in rbd format 2.
*/
#define RBD_HEADER_PREFIX "rbd_header."
#define RBD_OBJECT_MAP_PREFIX "rbd_object_map."
#define RBD_ID_PREFIX "rbd_id."
#define RBD_V2_DATA_FORMAT "%s.%016llx"
#define RBD_LOCK_NAME "rbd_lock"
#define RBD_LOCK_TAG "internal"
#define RBD_LOCK_COOKIE_PREFIX "auto"
enum rbd_notify_op {
RBD_NOTIFY_OP_ACQUIRED_LOCK = 0,
RBD_NOTIFY_OP_RELEASED_LOCK = 1,
RBD_NOTIFY_OP_REQUEST_LOCK = 2,
RBD_NOTIFY_OP_HEADER_UPDATE = 3,
};
#define OBJECT_NONEXISTENT 0
#define OBJECT_EXISTS 1
#define OBJECT_PENDING 2
#define OBJECT_EXISTS_CLEAN 3
#define RBD_FLAG_OBJECT_MAP_INVALID (1ULL << 0)
#define RBD_FLAG_FAST_DIFF_INVALID (1ULL << 1)
/*
* For format version 1, rbd image 'foo' consists of objects
* foo.rbd - image metadata
* rb.<idhi>.<idlo>.<extra>.000000000000
* rb.<idhi>.<idlo>.<extra>.000000000001
* ... - data
* There is no notion of a persistent image id in rbd format 1.
*/
#define RBD_SUFFIX ".rbd"
#define RBD_V1_DATA_FORMAT "%s.%012llx"
#define RBD_DIRECTORY "rbd_directory"
#define RBD_INFO "rbd_info"
#define RBD_DEFAULT_OBJ_ORDER 22 /* 4MB */
#define RBD_MIN_OBJ_ORDER 16
#define RBD_MAX_OBJ_ORDER 30
#define RBD_HEADER_TEXT "<<< Rados Block Device Image >>>\n"
#define RBD_HEADER_SIGNATURE "RBD"
#define RBD_HEADER_VERSION "001.005"
struct rbd_image_snap_ondisk {
__le64 id;
__le64 image_size;
} __attribute__((packed));
struct rbd_image_header_ondisk {
char text[40];
char object_prefix[24];
char signature[4];
char version[8];
struct {
__u8 order;
__u8 crypt_type;
__u8 comp_type;
__u8 unused;
} __attribute__((packed)) options;
__le64 image_size;
__le64 snap_seq;
__le32 snap_count;
__le32 reserved;
__le64 snap_names_len;
struct rbd_image_snap_ondisk snaps[0];
} __attribute__((packed));
#endif
|
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <bcm63xx_cpu.h>
static struct resource wdt_resources[] = {
{
.start = -1, /* filled at runtime */
.end = -1, /* filled at runtime */
.flags = IORESOURCE_MEM,
},
};
static struct platform_device bcm63xx_wdt_device = {
.name = "bcm63xx-wdt",
.id = 0,
.num_resources = ARRAY_SIZE(wdt_resources),
.resource = wdt_resources,
};
int __init bcm63xx_wdt_register(void)
{
wdt_resources[0].start = bcm63xx_regset_address(RSET_WDT);
wdt_resources[0].end = wdt_resources[0].start;
wdt_resources[0].end += RSET_WDT_SIZE - 1;
return platform_device_register(&bcm63xx_wdt_device);
}
arch_initcall(bcm63xx_wdt_register);
|
/*
* clock scaling for the UniCore-II
*
* Code specific to PKUnity SoC and UniCore ISA
*
* Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn>
* Copyright (C) 2001-2010 Guan Xuetao
*
* 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/types.h>
#include <linux/init.h>
#include <linux/clk.h>
#include <linux/cpufreq.h>
#include <mach/hardware.h>
static struct cpufreq_driver ucv2_driver;
/* make sure that only the "userspace" governor is run
* -- anything else wouldn't make sense on this platform, anyway.
*/
int ucv2_verify_speed(struct cpufreq_policy *policy)
{
if (policy->cpu)
return -EINVAL;
cpufreq_verify_within_limits(policy,
policy->cpuinfo.min_freq, policy->cpuinfo.max_freq);
return 0;
}
static unsigned int ucv2_getspeed(unsigned int cpu)
{
struct clk *mclk = clk_get(NULL, "MAIN_CLK");
if (cpu)
return 0;
return clk_get_rate(mclk)/1000;
}
static int ucv2_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
unsigned int cur = ucv2_getspeed(0);
struct cpufreq_freqs freqs;
struct clk *mclk = clk_get(NULL, "MAIN_CLK");
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
if (!clk_set_rate(mclk, target_freq * 1000)) {
freqs.old = cur;
freqs.new = target_freq;
freqs.cpu = 0;
}
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
return 0;
}
static int __init ucv2_cpu_init(struct cpufreq_policy *policy)
{
if (policy->cpu != 0)
return -EINVAL;
policy->cur = ucv2_getspeed(0);
policy->min = policy->cpuinfo.min_freq = 250000;
policy->max = policy->cpuinfo.max_freq = 1000000;
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
return 0;
}
static struct cpufreq_driver ucv2_driver = {
.flags = CPUFREQ_STICKY,
.verify = ucv2_verify_speed,
.target = ucv2_target,
.get = ucv2_getspeed,
.init = ucv2_cpu_init,
.name = "UniCore-II",
};
static int __init ucv2_cpufreq_init(void)
{
return cpufreq_register_driver(&ucv2_driver);
}
arch_initcall(ucv2_cpufreq_init);
|
#ifndef B3_CONSTRAINT4_h
#define B3_CONSTRAINT4_h
#include "Bullet3Common/b3Vector3.h"
#include "Bullet3Dynamics/shared/b3ContactConstraint4.h"
B3_ATTRIBUTE_ALIGNED16(struct) b3GpuConstraint4 : public b3ContactConstraint4
{
B3_DECLARE_ALIGNED_ALLOCATOR();
inline void setFrictionCoeff(float value) { m_linear[3] = value; }
inline float getFrictionCoeff() const { return m_linear[3]; }
};
#endif //B3_CONSTRAINT4_h
|
/*
* cocos2d for iPhone: http://www.cocos2d-iphone.org
*
* Copyright (c) 2008-2010 Ricardo Quesada
*
* 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.
*
*/
#import "CCActionInterval.h"
@class CCCamera;
/** Base class for CCCamera actions
*/
@interface CCActionCamera : CCActionInterval <NSCopying>
{
float centerXOrig_;
float centerYOrig_;
float centerZOrig_;
float eyeXOrig_;
float eyeYOrig_;
float eyeZOrig_;
float upXOrig_;
float upYOrig_;
float upZOrig_;
}
@end
/** CCOrbitCamera action
Orbits the camera around the center of the screen using spherical coordinates
*/
@interface CCOrbitCamera : CCActionCamera <NSCopying>
{
float radius_;
float deltaRadius_;
float angleZ_;
float deltaAngleZ_;
float angleX_;
float deltaAngleX_;
float radZ_;
float radDeltaZ_;
float radX_;
float radDeltaX_;
}
/** creates a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX */
+(id) actionWithDuration:(float) t radius:(float)r deltaRadius:(float) dr angleZ:(float)z deltaAngleZ:(float)dz angleX:(float)x deltaAngleX:(float)dx;
/** initializes a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX */
-(id) initWithDuration:(float) t radius:(float)r deltaRadius:(float) dr angleZ:(float)z deltaAngleZ:(float)dz angleX:(float)x deltaAngleX:(float)dx;
/** positions the camera according to spherical coordinates */
-(void) sphericalRadius:(float*) r zenith:(float*) zenith azimuth:(float*) azimuth;
@end
|
/* include/asm-arm/arch-msm/usbdiag.h
*
* Copyright (c) 2008-2010, 2012, The Linux Foundation. All rights reserved.
*
* All source code in this file is licensed under the following license except
* where indicated.
*
* 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, you can find it at http://www.fsf.org
*/
#ifndef _DRIVERS_USB_DIAG_H_
#define _DRIVERS_USB_DIAG_H_
#include <linux/err.h>
#define DIAG_LEGACY "diag"
#define DIAG_MDM "diag_mdm"
#define DIAG_QSC "diag_qsc"
#define USB_DIAG_CONNECT 0
#define USB_DIAG_DISCONNECT 1
#define USB_DIAG_WRITE_DONE 2
#define USB_DIAG_READ_DONE 3
struct diag_request {
char *buf;
int length;
int actual;
int status;
void *context;
};
struct usb_diag_ch {
const char *name;
struct list_head list;
void (*notify)(void *priv, unsigned event, struct diag_request *d_req);
void *priv;
void *priv_usb;
};
#ifdef CONFIG_USB_G_ANDROID
struct usb_diag_ch *usb_diag_open(const char *name, void *priv,
void (*notify)(void *, unsigned, struct diag_request *));
void usb_diag_close(struct usb_diag_ch *ch);
int usb_diag_alloc_req(struct usb_diag_ch *ch, int n_write, int n_read);
void usb_diag_free_req(struct usb_diag_ch *ch);
int usb_diag_read(struct usb_diag_ch *ch, struct diag_request *d_req);
int usb_diag_write(struct usb_diag_ch *ch, struct diag_request *d_req);
#else
static inline struct usb_diag_ch *usb_diag_open(const char *name, void *priv,
void (*notify)(void *, unsigned, struct diag_request *))
{
return ERR_PTR(-ENODEV);
}
static inline void usb_diag_close(struct usb_diag_ch *ch)
{
}
static inline
int usb_diag_alloc_req(struct usb_diag_ch *ch, int n_write, int n_read)
{
return -ENODEV;
}
static inline void usb_diag_free_req(struct usb_diag_ch *ch)
{
}
static inline
int usb_diag_read(struct usb_diag_ch *ch, struct diag_request *d_req)
{
return -ENODEV;
}
static inline
int usb_diag_write(struct usb_diag_ch *ch, struct diag_request *d_req)
{
return -ENODEV;
}
#endif /* CONFIG_USB_G_ANDROID */
#endif /* _DRIVERS_USB_DIAG_H_ */
|
#pragma once
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "threads/CriticalSection.h"
#include "guilib/DirtyRegion.h"
#include <string>
#ifdef HAS_DX
#include "guilib/GUIShaderDX.h"
#endif
typedef uint32_t color_t;
class CBaseTexture;
class CSlideShowPic
{
public:
enum DISPLAY_EFFECT { EFFECT_NONE = 0, EFFECT_FLOAT, EFFECT_ZOOM, EFFECT_RANDOM, EFFECT_PANORAMA, EFFECT_NO_TIMEOUT };
enum TRANSISTION_EFFECT { TRANSISTION_NONE = 0, FADEIN_FADEOUT, CROSSFADE, TRANSISTION_ZOOM, TRANSISTION_ROTATE };
struct TRANSISTION
{
TRANSISTION_EFFECT type;
int start;
int length;
};
CSlideShowPic();
~CSlideShowPic();
void SetTexture(int iSlideNumber, CBaseTexture* pTexture, DISPLAY_EFFECT dispEffect = EFFECT_RANDOM, TRANSISTION_EFFECT transEffect = FADEIN_FADEOUT);
void UpdateTexture(CBaseTexture* pTexture);
bool IsLoaded() const { return m_bIsLoaded;};
void UnLoad() {m_bIsLoaded = false;};
void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
void Render();
void Close();
void Reset(DISPLAY_EFFECT dispEffect = EFFECT_RANDOM, TRANSISTION_EFFECT transEffect = FADEIN_FADEOUT);
DISPLAY_EFFECT DisplayEffect() const { return m_displayEffect; }
bool DisplayEffectNeedChange(DISPLAY_EFFECT newDispEffect) const;
bool IsStarted() const { return m_iCounter > 0; }
bool IsFinished() const { return m_bIsFinished;};
bool DrawNextImage() const { return m_bDrawNextImage;};
int GetWidth() const { return (int)m_fWidth;};
int GetHeight() const { return (int)m_fHeight;};
void Keep();
bool StartTransistion();
int GetTransistionTime(int iType) const;
void SetTransistionTime(int iType, int iTime);
int SlideNumber() const { return m_iSlideNumber;};
void Zoom(float fZoomAmount, bool immediate = false);
void Rotate(float fRotateAngle, bool immediate = false);
void Pause(bool bPause);
void SetInSlideshow(bool slideshow);
void SetOriginalSize(int iOriginalWidth, int iOriginalHeight, bool bFullSize);
bool FullSize() const { return m_bFullSize;};
int GetOriginalWidth();
int GetOriginalHeight();
void Move(float dX, float dY);
float GetZoom() const { return m_fZoomAmount;};
bool m_bIsComic;
bool m_bCanMoveHorizontally;
bool m_bCanMoveVertically;
private:
void SetTexture_Internal(int iSlideNumber, CBaseTexture* pTexture, DISPLAY_EFFECT dispEffect = EFFECT_RANDOM, TRANSISTION_EFFECT transEffect = FADEIN_FADEOUT);
void UpdateVertices(float cur_x[4], float cur_y[4], const float new_x[4], const float new_y[4], CDirtyRegionList &dirtyregions);
void Render(float *x, float *y, CBaseTexture* pTexture, color_t color);
CBaseTexture *m_pImage;
int m_iOriginalWidth;
int m_iOriginalHeight;
int m_iSlideNumber;
bool m_bIsLoaded;
bool m_bIsFinished;
bool m_bDrawNextImage;
bool m_bIsDirty;
std::string m_strFileName;
float m_fWidth;
float m_fHeight;
color_t m_alpha;
// stuff relative to middle position
float m_fPosX;
float m_fPosY;
float m_fPosZ;
float m_fVelocityX;
float m_fVelocityY;
float m_fVelocityZ;
float m_fZoomAmount;
float m_fZoomLeft;
float m_fZoomTop;
float m_ax[4], m_ay[4];
float m_sx[4], m_sy[4];
float m_bx[4], m_by[4];
float m_ox[4], m_oy[4];
// transistion and display effects
DISPLAY_EFFECT m_displayEffect;
TRANSISTION m_transistionStart;
TRANSISTION m_transistionEnd;
TRANSISTION m_transistionTemp; // used for rotations + zooms
float m_fAngle; // angle (between 0 and 2pi to display the image)
float m_fTransistionAngle;
float m_fTransistionZoom;
int m_iCounter;
int m_iTotalFrames;
bool m_bPause;
bool m_bNoEffect;
bool m_bFullSize;
bool m_bTransistionImmediately;
CCriticalSection m_textureAccess;
#ifdef HAS_DX
ID3D11Buffer* m_vb;
bool UpdateVertexBuffer(Vertex *vertecies);
#endif
};
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Derived from arch/powerpc/platforms/powernv/rng.c, which is:
* Copyright 2013, Michael Ellerman, IBM Corporation.
*/
#define pr_fmt(fmt) "microwatt-rng: " fmt
#include <linux/kernel.h>
#include <linux/smp.h>
#include <asm/archrandom.h>
#include <asm/cputable.h>
#include <asm/machdep.h>
#define DARN_ERR 0xFFFFFFFFFFFFFFFFul
int microwatt_get_random_darn(unsigned long *v)
{
unsigned long val;
/* Using DARN with L=1 - 64-bit conditioned random number */
asm volatile(PPC_DARN(%0, 1) : "=r"(val));
if (val == DARN_ERR)
return 0;
*v = val;
return 1;
}
static __init int rng_init(void)
{
unsigned long val;
int i;
for (i = 0; i < 10; i++) {
if (microwatt_get_random_darn(&val)) {
ppc_md.get_random_seed = microwatt_get_random_darn;
return 0;
}
}
pr_warn("Unable to use DARN for get_random_seed()\n");
return -EIO;
}
machine_subsys_initcall(, rng_init);
|
/*
* gpmc-nand.c
*
* Copyright (C) 2009 Texas Instruments
* Vimal Singh <vimalsingh@ti.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/mtd/nand.h>
#include <asm/mach/flash.h>
#include <plat/nand.h>
#include <plat/board.h>
#include <plat/gpmc.h>
static struct resource gpmc_nand_resource = {
.flags = IORESOURCE_MEM,
};
static struct platform_device gpmc_nand_device = {
.name = "omap2-nand",
.id = 0,
.num_resources = 1,
.resource = &gpmc_nand_resource,
};
static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data)
{
struct gpmc_timings t;
int err;
if (!gpmc_nand_data->gpmc_t)
return 0;
memset(&t, 0, sizeof(t));
t.sync_clk = gpmc_nand_data->gpmc_t->sync_clk;
t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_on);
t.adv_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->adv_on);
/* Read */
t.adv_rd_off = gpmc_round_ns_to_ticks(
gpmc_nand_data->gpmc_t->adv_rd_off);
t.oe_on = t.adv_on;
t.access = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->access);
t.oe_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->oe_off);
t.cs_rd_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_rd_off);
t.rd_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->rd_cycle);
/* Write */
t.adv_wr_off = gpmc_round_ns_to_ticks(
gpmc_nand_data->gpmc_t->adv_wr_off);
t.we_on = t.oe_on;
if (cpu_is_omap34xx()) {
t.wr_data_mux_bus = gpmc_round_ns_to_ticks(
gpmc_nand_data->gpmc_t->wr_data_mux_bus);
t.wr_access = gpmc_round_ns_to_ticks(
gpmc_nand_data->gpmc_t->wr_access);
}
t.we_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->we_off);
t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_wr_off);
t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle);
/* Configure GPMC */
if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1);
else
gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
gpmc_cs_configure(gpmc_nand_data->cs,
GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t);
if (err)
return err;
return 0;
}
int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data)
{
int err = 0;
struct device *dev = &gpmc_nand_device.dev;
gpmc_nand_device.dev.platform_data = gpmc_nand_data;
err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE,
&gpmc_nand_data->phys_base);
if (err < 0) {
dev_err(dev, "Cannot request GPMC CS\n");
return err;
}
/* Set timings in GPMC */
err = omap2_nand_gpmc_retime(gpmc_nand_data);
if (err < 0) {
dev_err(dev, "Unable to set gpmc timings: %d\n", err);
return err;
}
/* Enable RD PIN Monitoring Reg */
if (gpmc_nand_data->dev_ready) {
gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_RDY_BSY, 1);
}
err = platform_device_register(&gpmc_nand_device);
if (err < 0) {
dev_err(dev, "Unable to register NAND device\n");
goto out_free_cs;
}
return 0;
out_free_cs:
gpmc_cs_free(gpmc_nand_data->cs);
return err;
}
|
// SPDX-License-Identifier: GPL-2.0
#include <linux/init.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/rtc.h>
#include <linux/vt_kern.h>
#include <linux/interrupt.h>
#include <asm/setup.h>
#include <asm/bootinfo.h>
#include <asm/bootinfo-apollo.h>
#include <asm/byteorder.h>
#include <asm/apollohw.h>
#include <asm/irq.h>
#include <asm/machdep.h>
u_long sio01_physaddr;
u_long sio23_physaddr;
u_long rtc_physaddr;
u_long pica_physaddr;
u_long picb_physaddr;
u_long cpuctrl_physaddr;
u_long timer_physaddr;
u_long apollo_model;
extern void dn_sched_init(void);
extern void dn_init_IRQ(void);
extern int dn_dummy_hwclk(int, struct rtc_time *);
extern void dn_dummy_reset(void);
#ifdef CONFIG_HEARTBEAT
static void dn_heartbeat(int on);
#endif
static irqreturn_t dn_timer_int(int irq,void *);
static void dn_get_model(char *model);
static const char *apollo_models[] = {
[APOLLO_DN3000-APOLLO_DN3000] = "DN3000 (Otter)",
[APOLLO_DN3010-APOLLO_DN3000] = "DN3010 (Otter)",
[APOLLO_DN3500-APOLLO_DN3000] = "DN3500 (Cougar II)",
[APOLLO_DN4000-APOLLO_DN3000] = "DN4000 (Mink)",
[APOLLO_DN4500-APOLLO_DN3000] = "DN4500 (Roadrunner)"
};
int __init apollo_parse_bootinfo(const struct bi_record *record)
{
int unknown = 0;
const void *data = record->data;
switch (be16_to_cpu(record->tag)) {
case BI_APOLLO_MODEL:
apollo_model = be32_to_cpup(data);
break;
default:
unknown=1;
}
return unknown;
}
static void __init dn_setup_model(void)
{
pr_info("Apollo hardware found: [%s]\n",
apollo_models[apollo_model - APOLLO_DN3000]);
switch(apollo_model) {
case APOLLO_UNKNOWN:
panic("Unknown apollo model");
break;
case APOLLO_DN3000:
case APOLLO_DN3010:
sio01_physaddr=SAU8_SIO01_PHYSADDR;
rtc_physaddr=SAU8_RTC_PHYSADDR;
pica_physaddr=SAU8_PICA;
picb_physaddr=SAU8_PICB;
cpuctrl_physaddr=SAU8_CPUCTRL;
timer_physaddr=SAU8_TIMER;
break;
case APOLLO_DN4000:
sio01_physaddr=SAU7_SIO01_PHYSADDR;
sio23_physaddr=SAU7_SIO23_PHYSADDR;
rtc_physaddr=SAU7_RTC_PHYSADDR;
pica_physaddr=SAU7_PICA;
picb_physaddr=SAU7_PICB;
cpuctrl_physaddr=SAU7_CPUCTRL;
timer_physaddr=SAU7_TIMER;
break;
case APOLLO_DN4500:
panic("Apollo model not yet supported");
break;
case APOLLO_DN3500:
sio01_physaddr=SAU7_SIO01_PHYSADDR;
sio23_physaddr=SAU7_SIO23_PHYSADDR;
rtc_physaddr=SAU7_RTC_PHYSADDR;
pica_physaddr=SAU7_PICA;
picb_physaddr=SAU7_PICB;
cpuctrl_physaddr=SAU7_CPUCTRL;
timer_physaddr=SAU7_TIMER;
break;
default:
panic("Undefined apollo model");
break;
}
}
int dn_serial_console_wait_key(struct console *co) {
while(!(sio01.srb_csrb & 1))
barrier();
return sio01.rhrb_thrb;
}
void dn_serial_console_write (struct console *co, const char *str,unsigned int count)
{
while(count--) {
if (*str == '\n') {
sio01.rhrb_thrb = (unsigned char)'\r';
while (!(sio01.srb_csrb & 0x4))
;
}
sio01.rhrb_thrb = (unsigned char)*str++;
while (!(sio01.srb_csrb & 0x4))
;
}
}
void dn_serial_print (const char *str)
{
while (*str) {
if (*str == '\n') {
sio01.rhrb_thrb = (unsigned char)'\r';
while (!(sio01.srb_csrb & 0x4))
;
}
sio01.rhrb_thrb = (unsigned char)*str++;
while (!(sio01.srb_csrb & 0x4))
;
}
}
void __init config_apollo(void)
{
int i;
dn_setup_model();
mach_sched_init=dn_sched_init; /* */
mach_init_IRQ=dn_init_IRQ;
mach_hwclk = dn_dummy_hwclk; /* */
mach_reset = dn_dummy_reset; /* */
#ifdef CONFIG_HEARTBEAT
mach_heartbeat = dn_heartbeat;
#endif
mach_get_model = dn_get_model;
cpuctrl=0xaa00;
/* clear DMA translation table */
for(i=0;i<0x400;i++)
addr_xlat_map[i]=0;
}
irqreturn_t dn_timer_int(int irq, void *dev_id)
{
volatile unsigned char x;
legacy_timer_tick(1);
timer_heartbeat();
x = *(volatile unsigned char *)(apollo_timer + 3);
x = *(volatile unsigned char *)(apollo_timer + 5);
return IRQ_HANDLED;
}
void dn_sched_init(void)
{
/* program timer 1 */
*(volatile unsigned char *)(apollo_timer + 3) = 0x01;
*(volatile unsigned char *)(apollo_timer + 1) = 0x40;
*(volatile unsigned char *)(apollo_timer + 5) = 0x09;
*(volatile unsigned char *)(apollo_timer + 7) = 0xc4;
/* enable IRQ of PIC B */
*(volatile unsigned char *)(pica+1)&=(~8);
#if 0
pr_info("*(0x10803) %02x\n",
*(volatile unsigned char *)(apollo_timer + 0x3));
pr_info("*(0x10803) %02x\n",
*(volatile unsigned char *)(apollo_timer + 0x3));
#endif
if (request_irq(IRQ_APOLLO, dn_timer_int, 0, "time", NULL))
pr_err("Couldn't register timer interrupt\n");
}
int dn_dummy_hwclk(int op, struct rtc_time *t) {
if(!op) { /* read */
t->tm_sec=rtc->second;
t->tm_min=rtc->minute;
t->tm_hour=rtc->hours;
t->tm_mday=rtc->day_of_month;
t->tm_wday=rtc->day_of_week;
t->tm_mon = rtc->month - 1;
t->tm_year=rtc->year;
if (t->tm_year < 70)
t->tm_year += 100;
} else {
rtc->second=t->tm_sec;
rtc->minute=t->tm_min;
rtc->hours=t->tm_hour;
rtc->day_of_month=t->tm_mday;
if(t->tm_wday!=-1)
rtc->day_of_week=t->tm_wday;
rtc->month = t->tm_mon + 1;
rtc->year = t->tm_year % 100;
}
return 0;
}
void dn_dummy_reset(void) {
dn_serial_print("The end !\n");
for(;;);
}
void dn_dummy_waitbut(void) {
dn_serial_print("waitbut\n");
}
static void dn_get_model(char *model)
{
strcpy(model, "Apollo ");
if (apollo_model >= APOLLO_DN3000 && apollo_model <= APOLLO_DN4500)
strcat(model, apollo_models[apollo_model - APOLLO_DN3000]);
}
#ifdef CONFIG_HEARTBEAT
static int dn_cpuctrl=0xff00;
static void dn_heartbeat(int on) {
if(on) {
dn_cpuctrl&=~0x100;
cpuctrl=dn_cpuctrl;
}
else {
dn_cpuctrl&=~0x100;
dn_cpuctrl|=0x100;
cpuctrl=dn_cpuctrl;
}
}
#endif
|
/*
* NXP (Philips) SCC+++(SCN+++) serial driver
*
* Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
*
* Based on sc26xx.c, by Thomas Bogendörfer (tsbogend@alpha.franken.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef _PLATFORM_DATA_SERIAL_SCCNXP_H_
#define _PLATFORM_DATA_SERIAL_SCCNXP_H_
#define SCCNXP_MAX_UARTS 2
/* Output lines */
#define LINE_OP0 1
#define LINE_OP1 2
#define LINE_OP2 3
#define LINE_OP3 4
#define LINE_OP4 5
#define LINE_OP5 6
#define LINE_OP6 7
#define LINE_OP7 8
/* Input lines */
#define LINE_IP0 9
#define LINE_IP1 10
#define LINE_IP2 11
#define LINE_IP3 12
#define LINE_IP4 13
#define LINE_IP5 14
#define LINE_IP6 15
/* Signals */
#define DTR_OP 0 /* DTR */
#define RTS_OP 4 /* RTS */
#define DSR_IP 8 /* DSR */
#define CTS_IP 12 /* CTS */
#define DCD_IP 16 /* DCD */
#define RNG_IP 20 /* RNG */
#define DIR_OP 24 /* Special signal for control RS-485.
* Goes high when transmit,
* then goes low.
*/
/* Routing control signal 'sig' to line 'line' */
#define MCTRL_SIG(sig, line) ((line) << (sig))
/*
* Example board initialization data:
*
* static struct resource sc2892_resources[] = {
* DEFINE_RES_MEM(UART_PHYS_START, 0x10),
* DEFINE_RES_IRQ(IRQ_EXT2),
* };
*
* static struct sccnxp_pdata sc2892_info = {
* .frequency = 3686400,
* .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0),
* .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1),
* };
*
* static struct platform_device sc2892 = {
* .name = "sc2892",
* .id = -1,
* .resource = sc2892_resources,
* .num_resources = ARRAY_SIZE(sc2892_resources),
* .dev = {
* .platform_data = &sc2892_info,
* },
* };
*/
/* SCCNXP platform data structure */
struct sccnxp_pdata {
/* Frequency (extrenal clock or crystal) */
int frequency;
/* Shift for A0 line */
const u8 reg_shift;
/* Modem control lines configuration */
const u32 mctrl_cfg[SCCNXP_MAX_UARTS];
/* Timer value for polling mode (usecs) */
const unsigned int poll_time_us;
};
#endif
|
/*
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <WebCore/InspectorClient.h>
#import <WebCore/InspectorFrontendChannel.h>
#import <WebCore/InspectorFrontendClientLocal.h>
#import <wtf/Forward.h>
#import <wtf/HashMap.h>
#import <wtf/RetainPtr.h>
#import <wtf/text/StringHash.h>
#import <wtf/text/WTFString.h>
#ifdef __OBJC__
@class NSURL;
@class WebInspectorWindowController;
@class WebNodeHighlighter;
@class WebView;
#else
class NSURL;
class WebInspectorWindowController;
class WebNodeHighlighter;
class WebView;
#endif
namespace WebCore {
class Frame;
class Page;
}
class WebInspectorFrontendClient;
class WebInspectorClient : public WebCore::InspectorClient, public WebCore::InspectorFrontendChannel {
public:
explicit WebInspectorClient(WebView *);
virtual void inspectorDestroyed() OVERRIDE;
virtual WebCore::InspectorFrontendChannel* openInspectorFrontend(WebCore::InspectorController*) OVERRIDE;
virtual void closeInspectorFrontend() OVERRIDE;
virtual void bringFrontendToFront() OVERRIDE;
virtual void didResizeMainFrame(WebCore::Frame*) OVERRIDE;
virtual void highlight() OVERRIDE;
virtual void hideHighlight() OVERRIDE;
virtual bool sendMessageToFrontend(const String&) OVERRIDE;
bool inspectorStartsAttached();
void setInspectorStartsAttached(bool);
bool inspectorAttachDisabled();
void setInspectorAttachDisabled(bool);
void releaseFrontend();
private:
PassOwnPtr<WebCore::InspectorFrontendClientLocal::Settings> createFrontendSettings();
WebView *m_webView;
RetainPtr<WebNodeHighlighter> m_highlighter;
WebCore::Page* m_frontendPage;
WebInspectorFrontendClient* m_frontendClient;
};
class WebInspectorFrontendClient : public WebCore::InspectorFrontendClientLocal {
public:
WebInspectorFrontendClient(WebView*, WebInspectorWindowController*, WebCore::InspectorController*, WebCore::Page*, PassOwnPtr<Settings>);
void attachAvailabilityChanged(bool);
virtual void frontendLoaded();
virtual String localizedStringsURL();
virtual void bringToFront();
virtual void closeWindow();
virtual void disconnectFromBackend();
virtual void attachWindow(DockSide);
virtual void detachWindow();
virtual void setAttachedWindowHeight(unsigned height);
virtual void setAttachedWindowWidth(unsigned height);
virtual void setToolbarHeight(unsigned) OVERRIDE;
virtual void inspectedURLChanged(const String& newURL);
private:
void updateWindowTitle() const;
virtual bool canSave() OVERRIDE { return true; }
virtual void save(const String& url, const String& content, bool forceSaveAs) OVERRIDE;
virtual void append(const String& url, const String& content) OVERRIDE;
WebView* m_inspectedWebView;
RetainPtr<WebInspectorWindowController> m_windowController;
String m_inspectedURL;
HashMap<String, RetainPtr<NSURL>> m_suggestedToActualURLMap;
};
|
/* { dg-do run } */
/* { dg-options "-O2 -ffast-math" } */
extern void abort (void);
int foo ( float* dists, int k)
{
if ( ( dists [ 0 ] > 0 ) == ( dists [ 1 ] > 0 ) )
return k;
return 0;
}
main() {
float dists[16] = { 0., 1., 1., 0., 0., -1., -1., 0.,
1., 1., 1., -1., -1., 1., -1., -1. };
if ( foo(&dists[0], 1) +
foo(&dists[2], 2) +
foo(&dists[4], 4) +
foo(&dists[6], 8) +
foo(&dists[8], 16) +
foo(&dists[10], 32) +
foo(&dists[12], 64) +
foo(&dists[14], 128)
!= 156)
abort();
return 0;
}
|
#ifndef __NVKM_CLK_H__
#define __NVKM_CLK_H__
#include <core/subdev.h>
#include <core/notify.h>
struct nvbios_pll;
struct nvkm_pll_vals;
enum nv_clk_src {
nv_clk_src_crystal,
nv_clk_src_href,
nv_clk_src_hclk,
nv_clk_src_hclkm3,
nv_clk_src_hclkm3d2,
nv_clk_src_hclkm2d3, /* NVAA */
nv_clk_src_hclkm4, /* NVAA */
nv_clk_src_cclk, /* NVAA */
nv_clk_src_host,
nv_clk_src_sppll0,
nv_clk_src_sppll1,
nv_clk_src_mpllsrcref,
nv_clk_src_mpllsrc,
nv_clk_src_mpll,
nv_clk_src_mdiv,
nv_clk_src_core,
nv_clk_src_core_intm,
nv_clk_src_shader,
nv_clk_src_mem,
nv_clk_src_gpc,
nv_clk_src_rop,
nv_clk_src_hubk01,
nv_clk_src_hubk06,
nv_clk_src_hubk07,
nv_clk_src_copy,
nv_clk_src_daemon,
nv_clk_src_disp,
nv_clk_src_vdec,
nv_clk_src_dom6,
nv_clk_src_max,
};
struct nvkm_cstate {
struct list_head head;
u8 voltage;
u32 domain[nv_clk_src_max];
};
struct nvkm_pstate {
struct list_head head;
struct list_head list; /* c-states */
struct nvkm_cstate base;
u8 pstate;
u8 fanspeed;
};
struct nvkm_domain {
enum nv_clk_src name;
u8 bios; /* 0xff for none */
#define NVKM_CLK_DOM_FLAG_CORE 0x01
u8 flags;
const char *mname;
int mdiv;
};
struct nvkm_clk {
const struct nvkm_clk_func *func;
struct nvkm_subdev subdev;
const struct nvkm_domain *domains;
struct nvkm_pstate bstate;
struct list_head states;
int state_nr;
struct work_struct work;
wait_queue_head_t wait;
atomic_t waiting;
struct nvkm_notify pwrsrc_ntfy;
int pwrsrc;
int pstate; /* current */
int ustate_ac; /* user-requested (-1 disabled, -2 perfmon) */
int ustate_dc; /* user-requested (-1 disabled, -2 perfmon) */
int astate; /* perfmon adjustment (base) */
int tstate; /* thermal adjustment (max-) */
int dstate; /* display adjustment (min+) */
bool allow_reclock;
/*XXX: die, these are here *only* to support the completely
* bat-shit insane what-was-nouveau_hw.c code
*/
int (*pll_calc)(struct nvkm_clk *, struct nvbios_pll *, int clk,
struct nvkm_pll_vals *pv);
int (*pll_prog)(struct nvkm_clk *, u32 reg1, struct nvkm_pll_vals *pv);
};
int nvkm_clk_read(struct nvkm_clk *, enum nv_clk_src);
int nvkm_clk_ustate(struct nvkm_clk *, int req, int pwr);
int nvkm_clk_astate(struct nvkm_clk *, int req, int rel, bool wait);
int nvkm_clk_dstate(struct nvkm_clk *, int req, int rel);
int nvkm_clk_tstate(struct nvkm_clk *, int req, int rel);
int nv04_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
int nv40_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
int nv50_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
int g84_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
int mcp77_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
int gt215_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
int gf100_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
int gk104_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
int gk20a_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
#endif
|
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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.
*/
class TestRunner;
@interface StorageTrackerDelegate : NSObject {
unsigned numberOfNotificationsToLog;
TestRunner* controllerToNotifyDone;
}
- (void)logNotifications:(unsigned)number controller:(TestRunner*)controller;
- (void)originModified:(NSNotification *)notification;
- (void)setControllerToNotifyDone:(TestRunner*)controller;
@end
|
// -*- C++ -*-
//=============================================================================
/**
* @file FreeBSD_Network_Interface_Monitor.h
*
* $Id: FreeBSD_Network_Interface_Monitor.h 86518 2009-08-18 12:30:56Z olli $
*
* @author Boyan Kasarov
*/
//=============================================================================
#ifndef FREEBSD_NETWORK_INTERFACE_MONITOR_H
#define FREEBSD_NETWORK_INTERFACE_MONITOR_H
#include /**/ "ace/pre.h"
#include "ace/SString.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Monitor_Control/Monitor_Control_export.h"
#if defined (__FreeBSD__) || defined (__Lynx__)
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE
{
namespace Monitor_Control
{
/**
* @class FreeBSD_Network_Interface_Monitor
*
* @brief Mixin class for network interface monitors compiled on
* FreeBSD machines.
*/
class MONITOR_CONTROL_Export FreeBSD_Network_Interface_Monitor
{
protected:
FreeBSD_Network_Interface_Monitor (const ACE_TCHAR *lookup_str);
/// Platform-specific implementation.
void update_i (void);
/// Platform-specific reset.
void clear_impl (void);
protected:
ACE_UINT64 value_;
private:
void init (void);
void fetch (ACE_UINT64& value) const;
ACE_UINT64 start_;
ACE_CString lookup_str_;
};
}
}
ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* defined (__FreeBSD__) || defined (__Lynx__) */
#include /**/ "ace/post.h"
#endif // FREEBSD_NETWORK_INTERFACE_MONITOR_H
|
// -*- C++ -*-
// Copyright (C) 2007-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License as published by the Free Software
// Foundation; either version 3, or (at your option) any later
// version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/**
* @file parallel/tags.h
* @brief Tags for compile-time selection.
* This file is a GNU parallel extension to the Standard C++ Library.
*/
// Written by Johannes Singler and Felix Putze.
#ifndef _GLIBCXX_PARALLEL_TAGS_H
#define _GLIBCXX_PARALLEL_TAGS_H 1
#include <omp.h>
#include <parallel/types.h>
namespace __gnu_parallel
{
/** @brief Forces sequential execution at compile time. */
struct sequential_tag { };
/** @brief Recommends parallel execution at compile time,
* optionally using a user-specified number of threads. */
struct parallel_tag
{
private:
_ThreadIndex _M_num_threads;
public:
/** @brief Default constructor. Use default number of threads. */
parallel_tag()
{ _M_num_threads = 0; }
/** @brief Default constructor. Recommend number of threads to use.
* @param __num_threads Desired number of threads. */
parallel_tag(_ThreadIndex __num_threads)
{ _M_num_threads = __num_threads; }
/** @brief Find out desired number of threads.
* @return Desired number of threads. */
_ThreadIndex __get_num_threads()
{
if(_M_num_threads == 0)
return omp_get_max_threads();
else
return _M_num_threads;
}
/** @brief Set the desired number of threads.
* @param __num_threads Desired number of threads. */
void set_num_threads(_ThreadIndex __num_threads)
{ _M_num_threads = __num_threads; }
};
/** @brief Recommends parallel execution using the
default parallel algorithm. */
struct default_parallel_tag : public parallel_tag
{
default_parallel_tag() { }
default_parallel_tag(_ThreadIndex __num_threads)
: parallel_tag(__num_threads) { }
};
/** @brief Recommends parallel execution using dynamic
load-balancing at compile time. */
struct balanced_tag : public parallel_tag { };
/** @brief Recommends parallel execution using static
load-balancing at compile time. */
struct unbalanced_tag : public parallel_tag { };
/** @brief Recommends parallel execution using OpenMP dynamic
load-balancing at compile time. */
struct omp_loop_tag : public parallel_tag { };
/** @brief Recommends parallel execution using OpenMP static
load-balancing at compile time. */
struct omp_loop_static_tag : public parallel_tag { };
/** @brief Base class for for std::find() variants. */
struct find_tag { };
/** @brief Forces parallel merging
* with exact splitting, at compile time. */
struct exact_tag : public parallel_tag
{
exact_tag() { }
exact_tag(_ThreadIndex __num_threads)
: parallel_tag(__num_threads) { }
};
/** @brief Forces parallel merging
* with exact splitting, at compile time. */
struct sampling_tag : public parallel_tag
{
sampling_tag() { }
sampling_tag(_ThreadIndex __num_threads)
: parallel_tag(__num_threads) { }
};
/** @brief Forces parallel sorting using multiway mergesort
* at compile time. */
struct multiway_mergesort_tag : public parallel_tag
{
multiway_mergesort_tag() { }
multiway_mergesort_tag(_ThreadIndex __num_threads)
: parallel_tag(__num_threads) { }
};
/** @brief Forces parallel sorting using multiway mergesort
* with exact splitting at compile time. */
struct multiway_mergesort_exact_tag : public parallel_tag
{
multiway_mergesort_exact_tag() { }
multiway_mergesort_exact_tag(_ThreadIndex __num_threads)
: parallel_tag(__num_threads) { }
};
/** @brief Forces parallel sorting using multiway mergesort
* with splitting by sampling at compile time. */
struct multiway_mergesort_sampling_tag : public parallel_tag
{
multiway_mergesort_sampling_tag() { }
multiway_mergesort_sampling_tag(_ThreadIndex __num_threads)
: parallel_tag(__num_threads) { }
};
/** @brief Forces parallel sorting using unbalanced quicksort
* at compile time. */
struct quicksort_tag : public parallel_tag
{
quicksort_tag() { }
quicksort_tag(_ThreadIndex __num_threads)
: parallel_tag(__num_threads) { }
};
/** @brief Forces parallel sorting using balanced quicksort
* at compile time. */
struct balanced_quicksort_tag : public parallel_tag
{
balanced_quicksort_tag() { }
balanced_quicksort_tag(_ThreadIndex __num_threads)
: parallel_tag(__num_threads) { }
};
/** @brief Selects the growing block size variant for std::find().
@see _GLIBCXX_FIND_GROWING_BLOCKS */
struct growing_blocks_tag : public find_tag { };
/** @brief Selects the constant block size variant for std::find().
@see _GLIBCXX_FIND_CONSTANT_SIZE_BLOCKS */
struct constant_size_blocks_tag : public find_tag { };
/** @brief Selects the equal splitting variant for std::find().
@see _GLIBCXX_FIND_EQUAL_SPLIT */
struct equal_split_tag : public find_tag { };
}
#endif /* _GLIBCXX_PARALLEL_TAGS_H */
|
/* Copyright (c) 2014 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <asm/barrier.h>
static inline u32 __dcc_getstatus(void)
{
u32 __ret;
asm volatile("mrs %0, mdccsr_el0" : "=r" (__ret)
: : "cc");
return __ret;
}
static inline char __dcc_getchar(void)
{
char __c;
asm volatile("mrs %0, dbgdtrrx_el0" : "=r" (__c));
isb();
return __c;
}
static inline void __dcc_putchar(char c)
{
asm volatile("msr dbgdtrtx_el0, %0"
: /* No output register */
: "r" (c));
isb();
}
|
/*
* nvec_ps2: mouse driver for a NVIDIA compliant embedded controller
*
* Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.launchpad.net>
*
* Authors: Pierre-Hugues Husson <phhusson@free.fr>
* Ilya Petrov <ilya.muromec@gmail.com>
* Marc Dietrich <marvin24@gmx.de>
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
*/
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/serio.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include "nvec.h"
#define PACKET_SIZE 6
#define ENABLE_MOUSE 0xf4
#define DISABLE_MOUSE 0xf5
#define PSMOUSE_RST 0xff
#ifdef NVEC_PS2_DEBUG
#define NVEC_PHD(str, buf, len) \
print_hex_dump(KERN_DEBUG, str, DUMP_PREFIX_NONE, \
16, 1, buf, len, false)
#else
#define NVEC_PHD(str, buf, len)
#endif
enum ps2_subcmds {
SEND_COMMAND = 1,
RECEIVE_N,
AUTO_RECEIVE_N,
CANCEL_AUTO_RECEIVE,
};
struct nvec_ps2 {
struct serio *ser_dev;
struct notifier_block notifier;
struct nvec_chip *nvec;
};
static struct nvec_ps2 ps2_dev;
static int ps2_startstreaming(struct serio *ser_dev)
{
unsigned char buf[] = { NVEC_PS2, AUTO_RECEIVE_N, PACKET_SIZE };
return nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
}
static void ps2_stopstreaming(struct serio *ser_dev)
{
unsigned char buf[] = { NVEC_PS2, CANCEL_AUTO_RECEIVE };
nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
}
static int ps2_sendcommand(struct serio *ser_dev, unsigned char cmd)
{
unsigned char buf[] = { NVEC_PS2, SEND_COMMAND, ENABLE_MOUSE, 1 };
buf[2] = cmd & 0xff;
dev_dbg(&ser_dev->dev, "Sending ps2 cmd %02x\n", cmd);
return nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
}
static int nvec_ps2_notifier(struct notifier_block *nb,
unsigned long event_type, void *data)
{
int i;
unsigned char *msg = (unsigned char *)data;
switch (event_type) {
case NVEC_PS2_EVT:
for (i = 0; i < msg[1]; i++)
serio_interrupt(ps2_dev.ser_dev, msg[2 + i], 0);
NVEC_PHD("ps/2 mouse event: ", &msg[2], msg[1]);
return NOTIFY_STOP;
case NVEC_PS2:
if (msg[2] == 1) {
for (i = 0; i < (msg[1] - 2); i++)
serio_interrupt(ps2_dev.ser_dev, msg[i + 4], 0);
NVEC_PHD("ps/2 mouse reply: ", &msg[4], msg[1] - 2);
}
else if (msg[1] != 2) /* !ack */
NVEC_PHD("unhandled mouse event: ", msg, msg[1] + 2);
return NOTIFY_STOP;
}
return NOTIFY_DONE;
}
static int nvec_mouse_probe(struct platform_device *pdev)
{
struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
struct serio *ser_dev;
char mouse_reset[] = { NVEC_PS2, SEND_COMMAND, PSMOUSE_RST, 3 };
ser_dev = devm_kzalloc(&pdev->dev, sizeof(struct serio), GFP_KERNEL);
if (ser_dev == NULL)
return -ENOMEM;
ser_dev->id.type = SERIO_PS_PSTHRU;
ser_dev->write = ps2_sendcommand;
ser_dev->start = ps2_startstreaming;
ser_dev->stop = ps2_stopstreaming;
strlcpy(ser_dev->name, "nvec mouse", sizeof(ser_dev->name));
strlcpy(ser_dev->phys, "nvec", sizeof(ser_dev->phys));
ps2_dev.ser_dev = ser_dev;
ps2_dev.notifier.notifier_call = nvec_ps2_notifier;
ps2_dev.nvec = nvec;
nvec_register_notifier(nvec, &ps2_dev.notifier, 0);
serio_register_port(ser_dev);
/* mouse reset */
nvec_write_async(nvec, mouse_reset, sizeof(mouse_reset));
return 0;
}
static int nvec_mouse_remove(struct platform_device *pdev)
{
struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
ps2_sendcommand(ps2_dev.ser_dev, DISABLE_MOUSE);
ps2_stopstreaming(ps2_dev.ser_dev);
nvec_unregister_notifier(nvec, &ps2_dev.notifier);
serio_unregister_port(ps2_dev.ser_dev);
return 0;
}
#ifdef CONFIG_PM_SLEEP
static int nvec_mouse_suspend(struct device *dev)
{
/* disable mouse */
ps2_sendcommand(ps2_dev.ser_dev, DISABLE_MOUSE);
/* send cancel autoreceive */
ps2_stopstreaming(ps2_dev.ser_dev);
return 0;
}
static int nvec_mouse_resume(struct device *dev)
{
/* start streaming */
ps2_startstreaming(ps2_dev.ser_dev);
/* enable mouse */
ps2_sendcommand(ps2_dev.ser_dev, ENABLE_MOUSE);
return 0;
}
#endif
static const SIMPLE_DEV_PM_OPS(nvec_mouse_pm_ops, nvec_mouse_suspend,
nvec_mouse_resume);
static struct platform_driver nvec_mouse_driver = {
.probe = nvec_mouse_probe,
.remove = nvec_mouse_remove,
.driver = {
.name = "nvec-mouse",
.owner = THIS_MODULE,
.pm = &nvec_mouse_pm_ops,
},
};
module_platform_driver(nvec_mouse_driver);
MODULE_DESCRIPTION("NVEC mouse driver");
MODULE_AUTHOR("Marc Dietrich <marvin24@gmx.de>");
MODULE_ALIAS("platform:nvec-mouse");
MODULE_LICENSE("GPL");
|
// 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 MEDIA_BASE_AUDIO_PULL_FIFO_H_
#define MEDIA_BASE_AUDIO_PULL_FIFO_H_
#include "base/callback.h"
#include "media/base/media_export.h"
namespace media {
class AudioBus;
// A FIFO (First In First Out) buffer to handle mismatches in buffer sizes
// between a producer and consumer. The consumer will pull data from this FIFO.
// If data is already available in the FIFO, it is provided to the consumer.
// If insufficient data is available to satisfy the request, the FIFO will ask
// the producer for more data to fulfill a request.
class MEDIA_EXPORT AudioPullFifo {
public:
// Callback type for providing more data into the FIFO. Expects AudioBus
// to be completely filled with data upon return; zero padded if not enough
// frames are available to satisfy the request. |frame_delay| is the number
// of output frames already processed and can be used to estimate delay.
typedef base::Callback<void(int frame_delay, AudioBus* audio_bus)> ReadCB;
// Constructs an AudioPullFifo with the specified |read_cb|, which is used to
// read audio data to the FIFO if data is not already available. The internal
// FIFO can contain |channel| number of channels, where each channel is of
// length |frames| audio frames.
AudioPullFifo(int channels, int frames, const ReadCB& read_cb);
virtual ~AudioPullFifo();
// Consumes |frames_to_consume| audio frames from the FIFO and copies
// them to |destination|. If the FIFO does not have enough data, we ask
// the producer to give us more data to fulfill the request using the
// ReadCB implementation.
void Consume(AudioBus* destination, int frames_to_consume);
// Empties the FIFO without deallocating any memory.
void Clear();
private:
// Attempt to fulfill the request using what is available in the FIFO.
// Append new data to the |destination| starting at |write_pos|.
int ReadFromFifo(AudioBus* destination, int frames_to_provide, int write_pos);
// Source of data to the FIFO.
const ReadCB read_cb_;
// Temporary audio bus to hold the data from the producer.
scoped_ptr<AudioBus> fifo_;
int fifo_index_;
DISALLOW_COPY_AND_ASSIGN(AudioPullFifo);
};
} // namespace media
#endif // MEDIA_BASE_AUDIO_PULL_FIFO_H_
|
/*
* Copyright (c) 2008 Patrick McHardy <kaber@trash.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Development of this code funded by Astaro AG (http://www.astaro.com/)
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/netlink.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nf_tables.h>
#include <net/netfilter/nf_tables.h>
// FIXME:
#include <net/ipv6.h>
struct nft_exthdr {
u8 type;
u8 offset;
u8 len;
enum nft_registers dreg:8;
};
static void nft_exthdr_eval(const struct nft_expr *expr,
struct nft_regs *regs,
const struct nft_pktinfo *pkt)
{
struct nft_exthdr *priv = nft_expr_priv(expr);
u32 *dest = ®s->data[priv->dreg];
unsigned int offset = 0;
int err;
err = ipv6_find_hdr(pkt->skb, &offset, priv->type, NULL, NULL);
if (err < 0)
goto err;
offset += priv->offset;
dest[priv->len / NFT_REG32_SIZE] = 0;
if (skb_copy_bits(pkt->skb, offset, dest, priv->len) < 0)
goto err;
return;
err:
regs->verdict.code = NFT_BREAK;
}
static const struct nla_policy nft_exthdr_policy[NFTA_EXTHDR_MAX + 1] = {
[NFTA_EXTHDR_DREG] = { .type = NLA_U32 },
[NFTA_EXTHDR_TYPE] = { .type = NLA_U8 },
[NFTA_EXTHDR_OFFSET] = { .type = NLA_U32 },
[NFTA_EXTHDR_LEN] = { .type = NLA_U32 },
};
static int nft_exthdr_init(const struct nft_ctx *ctx,
const struct nft_expr *expr,
const struct nlattr * const tb[])
{
struct nft_exthdr *priv = nft_expr_priv(expr);
if (tb[NFTA_EXTHDR_DREG] == NULL ||
tb[NFTA_EXTHDR_TYPE] == NULL ||
tb[NFTA_EXTHDR_OFFSET] == NULL ||
tb[NFTA_EXTHDR_LEN] == NULL)
return -EINVAL;
priv->type = nla_get_u8(tb[NFTA_EXTHDR_TYPE]);
priv->offset = ntohl(nla_get_be32(tb[NFTA_EXTHDR_OFFSET]));
priv->len = ntohl(nla_get_be32(tb[NFTA_EXTHDR_LEN]));
priv->dreg = nft_parse_register(tb[NFTA_EXTHDR_DREG]);
return nft_validate_register_store(ctx, priv->dreg, NULL,
NFT_DATA_VALUE, priv->len);
}
static int nft_exthdr_dump(struct sk_buff *skb, const struct nft_expr *expr)
{
const struct nft_exthdr *priv = nft_expr_priv(expr);
if (nft_dump_register(skb, NFTA_EXTHDR_DREG, priv->dreg))
goto nla_put_failure;
if (nla_put_u8(skb, NFTA_EXTHDR_TYPE, priv->type))
goto nla_put_failure;
if (nla_put_be32(skb, NFTA_EXTHDR_OFFSET, htonl(priv->offset)))
goto nla_put_failure;
if (nla_put_be32(skb, NFTA_EXTHDR_LEN, htonl(priv->len)))
goto nla_put_failure;
return 0;
nla_put_failure:
return -1;
}
static struct nft_expr_type nft_exthdr_type;
static const struct nft_expr_ops nft_exthdr_ops = {
.type = &nft_exthdr_type,
.size = NFT_EXPR_SIZE(sizeof(struct nft_exthdr)),
.eval = nft_exthdr_eval,
.init = nft_exthdr_init,
.dump = nft_exthdr_dump,
};
static struct nft_expr_type nft_exthdr_type __read_mostly = {
.name = "exthdr",
.ops = &nft_exthdr_ops,
.policy = nft_exthdr_policy,
.maxattr = NFTA_EXTHDR_MAX,
.owner = THIS_MODULE,
};
static int __init nft_exthdr_module_init(void)
{
return nft_register_expr(&nft_exthdr_type);
}
static void __exit nft_exthdr_module_exit(void)
{
nft_unregister_expr(&nft_exthdr_type);
}
module_init(nft_exthdr_module_init);
module_exit(nft_exthdr_module_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
MODULE_ALIAS_NFT_EXPR("exthdr");
|
#ifndef __V850_USER_H__
#define __V850_USER_H__
/* Adapted from <asm-ppc/user.h>. */
#ifdef __KERNEL__
#include <linux/ptrace.h>
#include <asm/page.h>
/*
* Core file format: The core file is written in such a way that gdb
* can understand it and provide useful information to the user (under
* linux we use the `trad-core' bfd, NOT the osf-core). The file contents
* are as follows:
*
* upage: 1 page consisting of a user struct that tells gdb
* what is present in the file. Directly after this is a
* copy of the task_struct, which is currently not used by gdb,
* but it may come in handy at some point. All of the registers
* are stored as part of the upage. The upage should always be
* only one page long.
* data: The data segment follows next. We use current->end_text to
* current->brk to pick up all of the user variables, plus any memory
* that may have been sbrk'ed. No attempt is made to determine if a
* page is demand-zero or if a page is totally unused, we just cover
* the entire range. All of the addresses are rounded in such a way
* that an integral number of pages is written.
* stack: We need the stack information in order to get a meaningful
* backtrace. We need to write the data from usp to
* current->start_stack, so we round each of these in order to be able
* to write an integer number of pages.
*/
struct user {
struct pt_regs regs; /* entire machine state */
size_t u_tsize; /* text size (pages) */
size_t u_dsize; /* data size (pages) */
size_t u_ssize; /* stack size (pages) */
unsigned long start_code; /* text starting address */
unsigned long start_data; /* data starting address */
unsigned long start_stack; /* stack starting address */
long int signal; /* signal causing core dump */
struct regs * u_ar0; /* help gdb find registers */
unsigned long magic; /* identifies a core file */
char u_comm[32]; /* user command name */
};
#define NBPG PAGE_SIZE
#define UPAGES 1
#define HOST_TEXT_START_ADDR (u.start_code)
#define HOST_DATA_START_ADDR (u.start_data)
#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
#endif /* __KERNEL__ */
#endif /* __V850_USER_H__ */
|
/*
* fs/bfs/file.c
* BFS file operations.
* Copyright (C) 1999,2000 Tigran Aivazian <tigran@veritas.com>
*
* Make the file block allocation algorithm understand the size
* of the underlying block device.
* Copyright (C) 2007 Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
*
*/
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include "bfs.h"
#undef DEBUG
#ifdef DEBUG
#define dprintf(x...) printf(x)
#else
#define dprintf(x...)
#endif
const struct file_operations bfs_file_operations = {
.llseek = generic_file_llseek,
.read_iter = generic_file_read_iter,
.write_iter = generic_file_write_iter,
.mmap = generic_file_mmap,
.splice_read = generic_file_splice_read,
};
static int bfs_move_block(unsigned long from, unsigned long to,
struct super_block *sb)
{
struct buffer_head *bh, *new;
bh = sb_bread(sb, from);
if (!bh)
return -EIO;
new = sb_getblk(sb, to);
memcpy(new->b_data, bh->b_data, bh->b_size);
mark_buffer_dirty(new);
bforget(bh);
brelse(new);
return 0;
}
static int bfs_move_blocks(struct super_block *sb, unsigned long start,
unsigned long end, unsigned long where)
{
unsigned long i;
dprintf("%08lx-%08lx->%08lx\n", start, end, where);
for (i = start; i <= end; i++)
if(bfs_move_block(i, where + i, sb)) {
dprintf("failed to move block %08lx -> %08lx\n", i,
where + i);
return -EIO;
}
return 0;
}
static int bfs_get_block(struct inode *inode, sector_t block,
struct buffer_head *bh_result, int create)
{
unsigned long phys;
int err;
struct super_block *sb = inode->i_sb;
struct bfs_sb_info *info = BFS_SB(sb);
struct bfs_inode_info *bi = BFS_I(inode);
phys = bi->i_sblock + block;
if (!create) {
if (phys <= bi->i_eblock) {
dprintf("c=%d, b=%08lx, phys=%09lx (granted)\n",
create, (unsigned long)block, phys);
map_bh(bh_result, sb, phys);
}
return 0;
}
/*
* If the file is not empty and the requested block is within the
* range of blocks allocated for this file, we can grant it.
*/
if (bi->i_sblock && (phys <= bi->i_eblock)) {
dprintf("c=%d, b=%08lx, phys=%08lx (interim block granted)\n",
create, (unsigned long)block, phys);
map_bh(bh_result, sb, phys);
return 0;
}
/* The file will be extended, so let's see if there is enough space. */
if (phys >= info->si_blocks)
return -ENOSPC;
/* The rest has to be protected against itself. */
mutex_lock(&info->bfs_lock);
/*
* If the last data block for this file is the last allocated
* block, we can extend the file trivially, without moving it
* anywhere.
*/
if (bi->i_eblock == info->si_lf_eblk) {
dprintf("c=%d, b=%08lx, phys=%08lx (simple extension)\n",
create, (unsigned long)block, phys);
map_bh(bh_result, sb, phys);
info->si_freeb -= phys - bi->i_eblock;
info->si_lf_eblk = bi->i_eblock = phys;
mark_inode_dirty(inode);
err = 0;
goto out;
}
/* Ok, we have to move this entire file to the next free block. */
phys = info->si_lf_eblk + 1;
if (phys + block >= info->si_blocks) {
err = -ENOSPC;
goto out;
}
if (bi->i_sblock) {
err = bfs_move_blocks(inode->i_sb, bi->i_sblock,
bi->i_eblock, phys);
if (err) {
dprintf("failed to move ino=%08lx -> fs corruption\n",
inode->i_ino);
goto out;
}
} else
err = 0;
dprintf("c=%d, b=%08lx, phys=%08lx (moved)\n",
create, (unsigned long)block, phys);
bi->i_sblock = phys;
phys += block;
info->si_lf_eblk = bi->i_eblock = phys;
/*
* This assumes nothing can write the inode back while we are here
* and thus update inode->i_blocks! (XXX)
*/
info->si_freeb -= bi->i_eblock - bi->i_sblock + 1 - inode->i_blocks;
mark_inode_dirty(inode);
map_bh(bh_result, sb, phys);
out:
mutex_unlock(&info->bfs_lock);
return err;
}
static int bfs_writepage(struct page *page, struct writeback_control *wbc)
{
return block_write_full_page(page, bfs_get_block, wbc);
}
static int bfs_readpage(struct file *file, struct page *page)
{
return block_read_full_page(page, bfs_get_block);
}
static void bfs_write_failed(struct address_space *mapping, loff_t to)
{
struct inode *inode = mapping->host;
if (to > inode->i_size)
truncate_pagecache(inode, inode->i_size);
}
static int bfs_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
int ret;
ret = block_write_begin(mapping, pos, len, flags, pagep,
bfs_get_block);
if (unlikely(ret))
bfs_write_failed(mapping, pos + len);
return ret;
}
static sector_t bfs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping, block, bfs_get_block);
}
const struct address_space_operations bfs_aops = {
.readpage = bfs_readpage,
.writepage = bfs_writepage,
.write_begin = bfs_write_begin,
.write_end = generic_write_end,
.bmap = bfs_bmap,
};
const struct inode_operations bfs_file_inops;
|
/*
STB6100 Silicon Tuner
Copyright (C) Manu Abraham (abraham.manu@gmail.com)
Copyright (C) ST Microelectronics
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.
*/
static int stb6100_get_frequency(struct dvb_frontend *fe, u32 *frequency)
{
struct dvb_frontend_ops *frontend_ops = &fe->ops;
struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
struct tuner_state t_state;
int err = 0;
if (tuner_ops->get_state) {
err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
if (err < 0) {
printk("%s: Invalid parameter\n", __func__);
return err;
}
*frequency = t_state.frequency;
}
return 0;
}
static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency)
{
struct dvb_frontend_ops *frontend_ops = &fe->ops;
struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
struct tuner_state t_state;
int err = 0;
t_state.frequency = frequency;
if (tuner_ops->set_state) {
err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
if (err < 0) {
printk("%s: Invalid parameter\n", __func__);
return err;
}
}
return 0;
}
static int stb6100_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
{
struct dvb_frontend_ops *frontend_ops = &fe->ops;
struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
struct tuner_state t_state;
int err = 0;
if (tuner_ops->get_state) {
err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state);
if (err < 0) {
printk("%s: Invalid parameter\n", __func__);
return err;
}
*bandwidth = t_state.bandwidth;
}
return 0;
}
static int stb6100_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth)
{
struct dvb_frontend_ops *frontend_ops = &fe->ops;
struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
struct tuner_state t_state;
int err = 0;
t_state.bandwidth = bandwidth;
if (tuner_ops->set_state) {
err = tuner_ops->set_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state);
if (err < 0) {
printk("%s: Invalid parameter\n", __func__);
return err;
}
}
return 0;
}
|
/*
* drivers/power/process.c - Functions for starting/stopping processes on
* suspend transitions.
*
* Originally from swsusp.
*/
#undef DEBUG
#include <linux/interrupt.h>
#include <linux/oom.h>
#include <linux/suspend.h>
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/freezer.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/kmod.h>
/*
* Timeout for stopping processes
*/
#define TIMEOUT (20 * HZ)
static int try_to_freeze_tasks(bool user_only)
{
struct task_struct *g, *p;
unsigned long end_time;
unsigned int todo;
bool wq_busy = false;
struct timeval start, end;
u64 elapsed_csecs64;
unsigned int elapsed_csecs;
bool wakeup = false;
do_gettimeofday(&start);
end_time = jiffies + TIMEOUT;
if (!user_only)
freeze_workqueues_begin();
while (true) {
todo = 0;
read_lock(&tasklist_lock);
do_each_thread(g, p) {
if (p == current || !freeze_task(p))
continue;
/*
* Now that we've done set_freeze_flag, don't
* perturb a task in TASK_STOPPED or TASK_TRACED.
* It is "frozen enough". If the task does wake
* up, it will immediately call try_to_freeze.
*
* Because freeze_task() goes through p's scheduler lock, it's
* guaranteed that TASK_STOPPED/TRACED -> TASK_RUNNING
* transition can't race with task state testing here.
*/
if (!task_is_stopped_or_traced(p) &&
!freezer_should_skip(p))
todo++;
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
if (!user_only) {
wq_busy = freeze_workqueues_busy();
todo += wq_busy;
}
if (!todo || time_after(jiffies, end_time))
break;
if (pm_wakeup_pending()) {
wakeup = true;
break;
}
/*
* We need to retry, but first give the freezing tasks some
* time to enter the regrigerator.
*/
msleep(10);
}
do_gettimeofday(&end);
elapsed_csecs64 = timeval_to_ns(&end) - timeval_to_ns(&start);
do_div(elapsed_csecs64, NSEC_PER_SEC / 100);
elapsed_csecs = elapsed_csecs64;
if (todo) {
printk("\n");
printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds "
"(%d tasks refusing to freeze, wq_busy=%d):\n",
wakeup ? "aborted" : "failed",
elapsed_csecs / 100, elapsed_csecs % 100,
todo - wq_busy, wq_busy);
if (!wakeup) {
read_lock(&tasklist_lock);
do_each_thread(g, p) {
if (p != current && !freezer_should_skip(p)
&& freezing(p) && !frozen(p))
sched_show_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
}
} else {
printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100,
elapsed_csecs % 100);
}
return todo ? -EBUSY : 0;
}
/**
* freeze_processes - Signal user space processes to enter the refrigerator.
*
* On success, returns 0. On failure, -errno and system is fully thawed.
*/
int freeze_processes(void)
{
int error;
error = __usermodehelper_disable(UMH_FREEZING);
if (error)
return error;
if (!pm_freezing)
atomic_inc(&system_freezing_cnt);
printk("Freezing user space processes ... ");
pm_freezing = true;
error = try_to_freeze_tasks(true);
if (!error) {
printk("done.");
__usermodehelper_set_disable_depth(UMH_DISABLED);
oom_killer_disable();
}
printk("\n");
BUG_ON(in_atomic());
if (error)
thaw_processes();
return error;
}
/**
* freeze_kernel_threads - Make freezable kernel threads go to the refrigerator.
*
* On success, returns 0. On failure, -errno and only the kernel threads are
* thawed, so as to give a chance to the caller to do additional cleanups
* (if any) before thawing the userspace tasks. So, it is the responsibility
* of the caller to thaw the userspace tasks, when the time is right.
*/
int freeze_kernel_threads(void)
{
int error;
printk("Freezing remaining freezable tasks ... ");
pm_nosig_freezing = true;
error = try_to_freeze_tasks(false);
if (!error)
printk("done.");
printk("\n");
BUG_ON(in_atomic());
if (error)
thaw_kernel_threads();
return error;
}
void thaw_processes(void)
{
struct task_struct *g, *p;
if (pm_freezing)
atomic_dec(&system_freezing_cnt);
pm_freezing = false;
pm_nosig_freezing = false;
oom_killer_enable();
printk("Restarting tasks ... ");
thaw_workqueues();
read_lock(&tasklist_lock);
do_each_thread(g, p) {
__thaw_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
usermodehelper_enable();
schedule();
printk("done.\n");
}
void thaw_kernel_threads(void)
{
struct task_struct *g, *p;
pm_nosig_freezing = false;
printk("Restarting kernel threads ... ");
thaw_workqueues();
read_lock(&tasklist_lock);
do_each_thread(g, p) {
if (p->flags & (PF_KTHREAD | PF_WQ_WORKER))
__thaw_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
schedule();
printk("done.\n");
}
|
#ifndef __A_OUT_GNU_H__
#define __A_OUT_GNU_H__
#include <bits/a.out.h>
#define __GNU_EXEC_MACROS__
struct exec
{
unsigned long a_info; /* Use macros N_MAGIC, etc for access. */
unsigned int a_text; /* Length of text, in bytes. */
unsigned int a_data; /* Length of data, in bytes. */
unsigned int a_bss; /* Length of uninitialized data area for file, in bytes. */
unsigned int a_syms; /* Length of symbol table data in file, in bytes. */
unsigned int a_entry; /* Start address. */
unsigned int a_trsize;/* Length of relocation info for text, in bytes. */
unsigned int a_drsize;/* Length of relocation info for data, in bytes. */
};
enum machine_type
{
M_OLDSUN2 = 0,
M_68010 = 1,
M_68020 = 2,
M_SPARC = 3,
M_386 = 100,
M_MIPS1 = 151,
M_MIPS2 = 152
};
#define N_MAGIC(exec) ((exec).a_info & 0xffff)
#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
#define N_SET_INFO(exec, magic, type, flags) \
((exec).a_info = ((magic) & 0xffff) \
| (((int)(type) & 0xff) << 16) \
| (((flags) & 0xff) << 24))
#define N_SET_MAGIC(exec, magic) \
((exec).a_info = ((exec).a_info & 0xffff0000) | ((magic) & 0xffff))
#define N_SET_MACHTYPE(exec, machtype) \
((exec).a_info = \
((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
#define N_SET_FLAGS(exec, flags) \
((exec).a_info = \
((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
/* Code indicating object file or impure executable. */
#define OMAGIC 0407
/* Code indicating pure executable. */
#define NMAGIC 0410
/* Code indicating demand-paged executable. */
#define ZMAGIC 0413
/* This indicates a demand-paged executable with the header in the text.
The first page is unmapped to help trap NULL pointer references. */
#define QMAGIC 0314
/* Code indicating core file. */
#define CMAGIC 0421
#define N_TRSIZE(a) ((a).a_trsize)
#define N_DRSIZE(a) ((a).a_drsize)
#define N_SYMSIZE(a) ((a).a_syms)
#define N_BADMAG(x) \
(N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \
&& N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC)
#define _N_HDROFF(x) (1024 - sizeof (struct exec))
#define N_TXTOFF(x) \
(N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
(N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
/* Address of text segment in memory after it is loaded. */
#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? 4096 : 0)
/* Address of data segment in memory after it is loaded. */
#define SEGMENT_SIZE 1024
#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1))
#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
#define N_DATADDR(x) \
(N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
: (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
#if !defined (N_NLIST_DECLARED)
struct nlist
{
union
{
char *n_name;
struct nlist *n_next;
long n_strx;
} n_un;
unsigned char n_type;
char n_other;
short n_desc;
unsigned long n_value;
};
#endif /* no N_NLIST_DECLARED. */
#define N_UNDF 0
#define N_ABS 2
#define N_TEXT 4
#define N_DATA 6
#define N_BSS 8
#define N_FN 15
#define N_EXT 1
#define N_TYPE 036
#define N_STAB 0340
#define N_INDR 0xa
#define N_SETA 0x14 /* Absolute set element symbol. */
#define N_SETT 0x16 /* Text set element symbol. */
#define N_SETD 0x18 /* Data set element symbol. */
#define N_SETB 0x1A /* Bss set element symbol. */
#define N_SETV 0x1C /* Pointer to set vector in data area. */
#if !defined (N_RELOCATION_INFO_DECLARED)
/* This structure describes a single relocation to be performed.
The text-relocation section of the file is a vector of these structures,
all of which apply to the text section.
Likewise, the data-relocation section applies to the data section. */
struct relocation_info
{
int r_address;
unsigned int r_symbolnum:24;
unsigned int r_pcrel:1;
unsigned int r_length:2;
unsigned int r_extern:1;
unsigned int r_pad:4;
};
#endif /* no N_RELOCATION_INFO_DECLARED. */
#endif /* __A_OUT_GNU_H__ */
|
/*
* ChromeOS EC multi-function device
*
* Copyright (C) 2017 Google, Inc
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* The ChromeOS EC multi function device is used to mux all the requests
* to the EC device for its multiple features: keyboard controller,
* battery charging and regulator control, firmware update.
*/
#include <linux/acpi.h>
#define ACPI_LID_DEVICE "LID0"
static int ec_wake_gpe = -EINVAL;
/*
* This handler indicates to ACPI core that this GPE should stay enabled for
* lid to work in suspend to idle path.
*/
static u32 cros_ec_gpe_handler(acpi_handle gpe_device, u32 gpe_number,
void *data)
{
return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
}
/*
* Get ACPI GPE for LID0 device.
*/
static int cros_ec_get_ec_wake_gpe(struct device *dev)
{
struct acpi_device *cros_acpi_dev;
struct acpi_device *adev;
acpi_handle handle;
acpi_status status;
int ret;
cros_acpi_dev = ACPI_COMPANION(dev);
if (!cros_acpi_dev || !cros_acpi_dev->parent ||
!cros_acpi_dev->parent->handle)
return -EINVAL;
status = acpi_get_handle(cros_acpi_dev->parent->handle, ACPI_LID_DEVICE,
&handle);
if (ACPI_FAILURE(status))
return -EINVAL;
ret = acpi_bus_get_device(handle, &adev);
if (ret)
return ret;
return adev->wakeup.gpe_number;
}
int cros_ec_acpi_install_gpe_handler(struct device *dev)
{
acpi_status status;
ec_wake_gpe = cros_ec_get_ec_wake_gpe(dev);
if (ec_wake_gpe < 0)
return ec_wake_gpe;
status = acpi_install_gpe_handler(NULL, ec_wake_gpe,
ACPI_GPE_EDGE_TRIGGERED,
&cros_ec_gpe_handler, NULL);
if (ACPI_FAILURE(status))
return -ENODEV;
dev_info(dev, "Initialized, GPE = 0x%x\n", ec_wake_gpe);
return 0;
}
void cros_ec_acpi_remove_gpe_handler(void)
{
acpi_status status;
if (ec_wake_gpe < 0)
return;
status = acpi_remove_gpe_handler(NULL, ec_wake_gpe,
&cros_ec_gpe_handler);
if (ACPI_FAILURE(status))
pr_err("failed to remove gpe handler\n");
}
void cros_ec_acpi_clear_gpe(void)
{
if (ec_wake_gpe < 0)
return;
acpi_clear_gpe(NULL, ec_wake_gpe);
}
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __org_omg_PortableServer_IdAssignmentPolicyOperations__
#define __org_omg_PortableServer_IdAssignmentPolicyOperations__
#pragma interface
#include <java/lang/Object.h>
extern "Java"
{
namespace org
{
namespace omg
{
namespace CORBA
{
class Policy;
}
namespace PortableServer
{
class IdAssignmentPolicyOperations;
class IdAssignmentPolicyValue;
}
}
}
}
class org::omg::PortableServer::IdAssignmentPolicyOperations : public ::java::lang::Object
{
public:
virtual ::org::omg::PortableServer::IdAssignmentPolicyValue * value() = 0;
virtual ::org::omg::CORBA::Policy * copy() = 0;
virtual void destroy() = 0;
virtual jint policy_type() = 0;
static ::java::lang::Class class$;
} __attribute__ ((java_interface));
#endif // __org_omg_PortableServer_IdAssignmentPolicyOperations__
|
#ifndef __ASM_MACH_MPSPEC_H
#define __ASM_MACH_MPSPEC_H
#define MAX_IRQ_SOURCES 256
/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */
#define MAX_MP_BUSSES 260
#endif /* __ASM_MACH_MPSPEC_H */
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __javax_management_OperationsException__
#define __javax_management_OperationsException__
#pragma interface
#include <javax/management/JMException.h>
extern "Java"
{
namespace javax
{
namespace management
{
class OperationsException;
}
}
}
class javax::management::OperationsException : public ::javax::management::JMException
{
public:
OperationsException();
OperationsException(::java::lang::String *);
private:
static const jlong serialVersionUID = -4967597595580536216LL;
public:
static ::java::lang::Class class$;
};
#endif // __javax_management_OperationsException__
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __java_lang_NoSuchFieldError__
#define __java_lang_NoSuchFieldError__
#pragma interface
#include <java/lang/IncompatibleClassChangeError.h>
class java::lang::NoSuchFieldError : public ::java::lang::IncompatibleClassChangeError
{
public:
NoSuchFieldError();
NoSuchFieldError(::java::lang::String *);
private:
static const jlong serialVersionUID = -3456430195886129035LL;
public:
static ::java::lang::Class class$;
};
#endif // __java_lang_NoSuchFieldError__
|
/**********************************************************************
*
* Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful but, except
* as otherwise stated in writing, 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.
*
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
* Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#ifndef _HASH_H_
#define _HASH_H_
#include "img_types.h"
#include "osfunc.h"
#if defined (__cplusplus)
extern "C" {
#endif
typedef IMG_UINT32 HASH_FUNC(IMG_SIZE_T uKeySize, IMG_VOID *pKey, IMG_UINT32 uHashTabLen);
typedef IMG_BOOL HASH_KEY_COMP(IMG_SIZE_T uKeySize, IMG_VOID *pKey1, IMG_VOID *pKey2);
typedef struct _HASH_TABLE_ HASH_TABLE;
IMG_UINT32 HASH_Func_Default (IMG_SIZE_T uKeySize, IMG_VOID *pKey, IMG_UINT32 uHashTabLen);
IMG_BOOL HASH_Key_Comp_Default (IMG_SIZE_T uKeySize, IMG_VOID *pKey1, IMG_VOID *pKey2);
HASH_TABLE * HASH_Create_Extended (IMG_UINT32 uInitialLen, IMG_SIZE_T uKeySize, HASH_FUNC *pfnHashFunc, HASH_KEY_COMP *pfnKeyComp);
HASH_TABLE * HASH_Create (IMG_UINT32 uInitialLen);
IMG_VOID HASH_Delete (HASH_TABLE *pHash);
IMG_BOOL HASH_Insert_Extended (HASH_TABLE *pHash, IMG_VOID *pKey, IMG_UINTPTR_T v);
IMG_BOOL HASH_Insert (HASH_TABLE *pHash, IMG_UINTPTR_T k, IMG_UINTPTR_T v);
IMG_UINTPTR_T HASH_Remove_Extended(HASH_TABLE *pHash, IMG_VOID *pKey);
IMG_UINTPTR_T HASH_Remove (HASH_TABLE *pHash, IMG_UINTPTR_T k);
IMG_UINTPTR_T HASH_Retrieve_Extended (HASH_TABLE *pHash, IMG_VOID *pKey);
IMG_UINTPTR_T HASH_Retrieve (HASH_TABLE *pHash, IMG_UINTPTR_T k);
#ifdef HASH_TRACE
IMG_VOID HASH_Dump (HASH_TABLE *pHash);
#endif
#if defined (__cplusplus)
}
#endif
#endif
|
/*
* Copyright IBM Corp. 2012
* Author(s): Holger Dengler (hd@linux.vnet.ibm.com)
*/
#ifndef ZCRYPT_DEBUG_H
#define ZCRYPT_DEBUG_H
#include <asm/debug.h>
#include "zcrypt_api.h"
/* that gives us 15 characters in the text event views */
#define ZCRYPT_DBF_LEN 16
/* sort out low debug levels early to avoid wasted sprints */
static inline int zcrypt_dbf_passes(debug_info_t *dbf_grp, int level)
{
return (level <= dbf_grp->level);
}
#define DBF_ERR 3 /* error conditions */
#define DBF_WARN 4 /* warning conditions */
#define DBF_INFO 6 /* informational */
#define RC2WARN(rc) ((rc) ? DBF_WARN : DBF_INFO)
#define ZCRYPT_DBF_COMMON(level, text...) \
do { \
if (zcrypt_dbf_passes(zcrypt_dbf_common, level)) { \
char debug_buffer[ZCRYPT_DBF_LEN]; \
snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
debug_text_event(zcrypt_dbf_common, level, \
debug_buffer); \
} \
} while (0)
#define ZCRYPT_DBF_DEVICES(level, text...) \
do { \
if (zcrypt_dbf_passes(zcrypt_dbf_devices, level)) { \
char debug_buffer[ZCRYPT_DBF_LEN]; \
snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
debug_text_event(zcrypt_dbf_devices, level, \
debug_buffer); \
} \
} while (0)
#define ZCRYPT_DBF_DEV(level, device, text...) \
do { \
if (zcrypt_dbf_passes(device->dbf_area, level)) { \
char debug_buffer[ZCRYPT_DBF_LEN]; \
snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
debug_text_event(device->dbf_area, level, \
debug_buffer); \
} \
} while (0)
int zcrypt_debug_init(void);
void zcrypt_debug_exit(void);
#endif /* ZCRYPT_DEBUG_H */
|
/////////////////////////////////////////////////////////////////////////////
// Name: wx/grid.h
// Purpose: wxGrid base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GRID_H_BASE_
#define _WX_GRID_H_BASE_
#include "wx/generic/grid.h"
// these headers used to be included from the above header but isn't any more,
// still do it from here for compatibility
#include "wx/generic/grideditors.h"
#include "wx/generic/gridctrl.h"
#endif // _WX_GRID_H_BASE_
|
/*
saa7115.h - definition for saa7111/3/4/5 inputs and frequency flags
Copyright (C) 2006 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _SAA7115_H_
#define _SAA7115_H_
/* s_routing inputs, outputs, and config */
/* SAA7111/3/4/5 HW inputs */
#define SAA7115_COMPOSITE0 0
#define SAA7115_COMPOSITE1 1
#define SAA7115_COMPOSITE2 2
#define SAA7115_COMPOSITE3 3
#define SAA7115_COMPOSITE4 4 /* not available for the saa7111/3 */
#define SAA7115_COMPOSITE5 5 /* not available for the saa7111/3 */
#define SAA7115_SVIDEO0 6
#define SAA7115_SVIDEO1 7
#define SAA7115_SVIDEO2 8
#define SAA7115_SVIDEO3 9
/* outputs */
#define SAA7115_IPORT_ON 1
#define SAA7115_IPORT_OFF 0
/* SAA7111 specific outputs. */
#define SAA7111_VBI_BYPASS 2
#define SAA7111_FMT_YUV422 0x00
#define SAA7111_FMT_RGB 0x40
#define SAA7111_FMT_CCIR 0x80
#define SAA7111_FMT_YUV411 0xc0
/* config flags */
/*
* Register 0x85 should set bit 0 to 0 (it's 1 by default). This bit
* controls the IDQ signal polarity which is set to 'inverted' if the bit
* it 1 and to 'default' if it is 0.
*/
#define SAA7115_IDQ_IS_DEFAULT (1 << 0)
/* s_crystal_freq values and flags */
/* SAA7115 v4l2_crystal_freq frequency values */
#define SAA7115_FREQ_32_11_MHZ 32110000 /* 32.11 MHz crystal, SAA7114/5 only */
#define SAA7115_FREQ_24_576_MHZ 24576000 /* 24.576 MHz crystal */
/* SAA7115 v4l2_crystal_freq audio clock control flags */
#define SAA7115_FREQ_FL_UCGC (1 << 0) /* SA 3A[7], UCGC, SAA7115 only */
#define SAA7115_FREQ_FL_CGCDIV (1 << 1) /* SA 3A[6], CGCDIV, SAA7115 only */
#define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */
#define SAA7115_FREQ_FL_DOUBLE_ASCLK (1 << 3) /* SA 39, LRDIV, SAA7114/5 only */
/* ===== SAA7113 Config enums ===== */
/* Register 0x08 "Horizontal time constant" [Bit 3..4]:
* Should be set to "Fast Locking Mode" according to the datasheet,
* and that is the default setting in the gm7113c_init table.
* saa7113_init sets this value to "VTR Mode". */
enum saa7113_r08_htc {
SAA7113_HTC_TV_MODE = 0x00,
SAA7113_HTC_VTR_MODE, /* Default for saa7113_init */
SAA7113_HTC_FAST_LOCKING_MODE = 0x03 /* Default for gm7113c_init */
};
/* Register 0x10 "Output format selection" [Bit 6..7]:
* Defaults to ITU_656 as specified in datasheet. */
enum saa7113_r10_ofts {
SAA7113_OFTS_ITU_656 = 0x0, /* Default */
SAA7113_OFTS_VFLAG_BY_VREF,
SAA7113_OFTS_VFLAG_BY_DATA_TYPE
};
/*
* Register 0x12 "Output control" [Bit 0..3 Or Bit 4..7]:
* This is used to select what data is output on the RTS0 and RTS1 pins.
* RTS1 [Bit 4..7] Defaults to DOT_IN. (This value can not be set for RTS0)
* RTS0 [Bit 0..3] Defaults to VIPB in gm7113c_init as specified
* in the datasheet, but is set to HREF_HS in the saa7113_init table.
*/
enum saa7113_r12_rts {
SAA7113_RTS_DOT_IN = 0, /* OBS: Only for RTS1 (Default RTS1) */
SAA7113_RTS_VIPB, /* Default RTS0 For gm7113c_init */
SAA7113_RTS_GPSW,
SAA7115_RTS_HL,
SAA7113_RTS_VL,
SAA7113_RTS_DL,
SAA7113_RTS_PLIN,
SAA7113_RTS_HREF_HS, /* Default RTS0 For saa7113_init */
SAA7113_RTS_HS,
SAA7113_RTS_HQ,
SAA7113_RTS_ODD,
SAA7113_RTS_VS,
SAA7113_RTS_V123,
SAA7113_RTS_VGATE,
SAA7113_RTS_VREF,
SAA7113_RTS_FID
};
/**
* struct saa7115_platform_data - Allow overriding default initialization
*
* @saa7113_force_gm7113c_init: Force the use of the gm7113c_init table
* instead of saa7113_init table
* (saa7113 only)
* @saa7113_r08_htc: [R_08 - Bit 3..4]
* @saa7113_r10_vrln: [R_10 - Bit 3]
* default: Disabled for gm7113c_init
* Enabled for saa7113c_init
* @saa7113_r10_ofts: [R_10 - Bit 6..7]
* @saa7113_r12_rts0: [R_12 - Bit 0..3]
* @saa7113_r12_rts1: [R_12 - Bit 4..7]
* @saa7113_r13_adlsb: [R_13 - Bit 7] - default: disabled
*/
struct saa7115_platform_data {
bool saa7113_force_gm7113c_init;
enum saa7113_r08_htc *saa7113_r08_htc;
bool *saa7113_r10_vrln;
enum saa7113_r10_ofts *saa7113_r10_ofts;
enum saa7113_r12_rts *saa7113_r12_rts0;
enum saa7113_r12_rts *saa7113_r12_rts1;
bool *saa7113_r13_adlsb;
};
#endif
|
/* xfrm4_tunnel.c: Generic IP tunnel transformer.
*
* Copyright (C) 2003 David S. Miller (davem@redhat.com)
*/
#include <linux/skbuff.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <net/xfrm.h>
#include <net/ip.h>
#include <net/protocol.h>
static int ipip_output(struct xfrm_state *x, struct sk_buff *skb)
{
skb_push(skb, -skb_network_offset(skb));
return 0;
}
static int ipip_xfrm_rcv(struct xfrm_state *x, struct sk_buff *skb)
{
return ip_hdr(skb)->protocol;
}
static int ipip_init_state(struct xfrm_state *x)
{
if (x->props.mode != XFRM_MODE_TUNNEL)
return -EINVAL;
if (x->encap)
return -EINVAL;
x->props.header_len = sizeof(struct iphdr);
return 0;
}
static void ipip_destroy(struct xfrm_state *x)
{
}
static const struct xfrm_type ipip_type = {
.description = "IPIP",
.owner = THIS_MODULE,
.proto = IPPROTO_IPIP,
.init_state = ipip_init_state,
.destructor = ipip_destroy,
.input = ipip_xfrm_rcv,
.output = ipip_output
};
static int xfrm_tunnel_rcv(struct sk_buff *skb)
{
return xfrm4_rcv_spi(skb, IPPROTO_IPIP, ip_hdr(skb)->saddr);
}
static int xfrm_tunnel_err(struct sk_buff *skb, u32 info)
{
return -ENOENT;
}
static struct xfrm_tunnel xfrm_tunnel_handler __read_mostly = {
.handler = xfrm_tunnel_rcv,
.err_handler = xfrm_tunnel_err,
.priority = 2,
};
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
static struct xfrm_tunnel xfrm64_tunnel_handler __read_mostly = {
.handler = xfrm_tunnel_rcv,
.err_handler = xfrm_tunnel_err,
.priority = 2,
};
#endif
static int __init ipip_init(void)
{
if (xfrm_register_type(&ipip_type, AF_INET) < 0) {
printk(KERN_INFO "ipip init: can't add xfrm type\n");
return -EAGAIN;
}
if (xfrm4_tunnel_register(&xfrm_tunnel_handler, AF_INET)) {
printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET\n");
xfrm_unregister_type(&ipip_type, AF_INET);
return -EAGAIN;
}
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
if (xfrm4_tunnel_register(&xfrm64_tunnel_handler, AF_INET6)) {
printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET6\n");
xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET);
xfrm_unregister_type(&ipip_type, AF_INET);
return -EAGAIN;
}
#endif
return 0;
}
static void __exit ipip_fini(void)
{
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
if (xfrm4_tunnel_deregister(&xfrm64_tunnel_handler, AF_INET6))
printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET6\n");
#endif
if (xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET))
printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET\n");
if (xfrm_unregister_type(&ipip_type, AF_INET) < 0)
printk(KERN_INFO "ipip close: can't remove xfrm type\n");
}
module_init(ipip_init);
module_exit(ipip_fini);
MODULE_LICENSE("GPL");
MODULE_ALIAS_XFRM_TYPE(AF_INET, XFRM_PROTO_IPIP);
|
/*
* Copyright (C) 2016 Free Electrons
*
* Maxime Ripard <maxime.ripard@free-electrons.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*/
#include <linux/clk.h>
#include <linux/component.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/reset.h>
struct sun6i_drc {
struct clk *bus_clk;
struct clk *mod_clk;
struct reset_control *reset;
};
static int sun6i_drc_bind(struct device *dev, struct device *master,
void *data)
{
struct sun6i_drc *drc;
int ret;
drc = devm_kzalloc(dev, sizeof(*drc), GFP_KERNEL);
if (!drc)
return -ENOMEM;
dev_set_drvdata(dev, drc);
drc->reset = devm_reset_control_get(dev, NULL);
if (IS_ERR(drc->reset)) {
dev_err(dev, "Couldn't get our reset line\n");
return PTR_ERR(drc->reset);
}
ret = reset_control_deassert(drc->reset);
if (ret) {
dev_err(dev, "Couldn't deassert our reset line\n");
return ret;
}
drc->bus_clk = devm_clk_get(dev, "ahb");
if (IS_ERR(drc->bus_clk)) {
dev_err(dev, "Couldn't get our bus clock\n");
ret = PTR_ERR(drc->bus_clk);
goto err_assert_reset;
}
clk_prepare_enable(drc->bus_clk);
drc->mod_clk = devm_clk_get(dev, "mod");
if (IS_ERR(drc->mod_clk)) {
dev_err(dev, "Couldn't get our mod clock\n");
ret = PTR_ERR(drc->mod_clk);
goto err_disable_bus_clk;
}
clk_prepare_enable(drc->mod_clk);
return 0;
err_disable_bus_clk:
clk_disable_unprepare(drc->bus_clk);
err_assert_reset:
reset_control_assert(drc->reset);
return ret;
}
static void sun6i_drc_unbind(struct device *dev, struct device *master,
void *data)
{
struct sun6i_drc *drc = dev_get_drvdata(dev);
clk_disable_unprepare(drc->mod_clk);
clk_disable_unprepare(drc->bus_clk);
reset_control_assert(drc->reset);
}
static const struct component_ops sun6i_drc_ops = {
.bind = sun6i_drc_bind,
.unbind = sun6i_drc_unbind,
};
static int sun6i_drc_probe(struct platform_device *pdev)
{
return component_add(&pdev->dev, &sun6i_drc_ops);
}
static int sun6i_drc_remove(struct platform_device *pdev)
{
component_del(&pdev->dev, &sun6i_drc_ops);
return 0;
}
static const struct of_device_id sun6i_drc_of_table[] = {
{ .compatible = "allwinner,sun6i-a31-drc" },
{ .compatible = "allwinner,sun6i-a31s-drc" },
{ .compatible = "allwinner,sun8i-a33-drc" },
{ }
};
MODULE_DEVICE_TABLE(of, sun6i_drc_of_table);
static struct platform_driver sun6i_drc_platform_driver = {
.probe = sun6i_drc_probe,
.remove = sun6i_drc_remove,
.driver = {
.name = "sun6i-drc",
.of_match_table = sun6i_drc_of_table,
},
};
module_platform_driver(sun6i_drc_platform_driver);
MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
MODULE_DESCRIPTION("Allwinner A31 Dynamic Range Control (DRC) Driver");
MODULE_LICENSE("GPL");
|
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_minimal_h
#define _SDL_config_minimal_h
#include "SDL_platform.h"
/* This is the minimal configuration that can be used to build SDL */
#include <stdarg.h>
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned int size_t;
typedef unsigned long uintptr_t;
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
#define SDL_CDROM_DISABLED 1
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
#define SDL_JOYSTICK_DISABLED 1
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
#define SDL_LOADSO_DISABLED 1
/* Enable the stub thread support (src/thread/generic/\*.c) */
#define SDL_THREADS_DISABLED 1
/* Enable the stub timer support (src/timer/dummy/\*.c) */
#define SDL_TIMERS_DISABLED 1
/* Enable the dummy video driver (src/video/dummy/\*.c) */
#define SDL_VIDEO_DRIVER_DUMMY 1
#endif /* _SDL_config_minimal_h */
|
// SPDX-License-Identifier: GPL-2.0
/*
* Backlight code for via-pmu
*
* Copyright (C) 1998 Paul Mackerras and Fabio Riccardi.
* Copyright (C) 2001-2002 Benjamin Herrenschmidt
* Copyright (C) 2006 Michael Hanselmann <linux-kernel@hansmi.ch>
*
*/
#include <asm/ptrace.h>
#include <linux/adb.h>
#include <linux/pmu.h>
#include <asm/backlight.h>
#include <asm/prom.h>
#define MAX_PMU_LEVEL 0xFF
static const struct backlight_ops pmu_backlight_data;
static DEFINE_SPINLOCK(pmu_backlight_lock);
static int sleeping, uses_pmu_bl;
static u8 bl_curve[FB_BACKLIGHT_LEVELS];
static void pmu_backlight_init_curve(u8 off, u8 min, u8 max)
{
int i, flat, count, range = (max - min);
bl_curve[0] = off;
for (flat = 1; flat < (FB_BACKLIGHT_LEVELS / 16); ++flat)
bl_curve[flat] = min;
count = FB_BACKLIGHT_LEVELS * 15 / 16;
for (i = 0; i < count; ++i)
bl_curve[flat + i] = min + (range * (i + 1) / count);
}
static int pmu_backlight_curve_lookup(int value)
{
int level = (FB_BACKLIGHT_LEVELS - 1);
int i, max = 0;
/* Look for biggest value */
for (i = 0; i < FB_BACKLIGHT_LEVELS; i++)
max = max((int)bl_curve[i], max);
/* Look for nearest value */
for (i = 0; i < FB_BACKLIGHT_LEVELS; i++) {
int diff = abs(bl_curve[i] - value);
if (diff < max) {
max = diff;
level = i;
}
}
return level;
}
static int pmu_backlight_get_level_brightness(int level)
{
int pmulevel;
/* Get and convert the value */
pmulevel = bl_curve[level] * FB_BACKLIGHT_MAX / MAX_PMU_LEVEL;
if (pmulevel < 0)
pmulevel = 0;
else if (pmulevel > MAX_PMU_LEVEL)
pmulevel = MAX_PMU_LEVEL;
return pmulevel;
}
static int __pmu_backlight_update_status(struct backlight_device *bd)
{
struct adb_request req;
int level = bd->props.brightness;
if (bd->props.power != FB_BLANK_UNBLANK ||
bd->props.fb_blank != FB_BLANK_UNBLANK)
level = 0;
if (level > 0) {
int pmulevel = pmu_backlight_get_level_brightness(level);
pmu_request(&req, NULL, 2, PMU_BACKLIGHT_BRIGHT, pmulevel);
pmu_wait_complete(&req);
pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
PMU_POW_BACKLIGHT | PMU_POW_ON);
pmu_wait_complete(&req);
} else {
pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
PMU_POW_BACKLIGHT | PMU_POW_OFF);
pmu_wait_complete(&req);
}
return 0;
}
static int pmu_backlight_update_status(struct backlight_device *bd)
{
unsigned long flags;
int rc = 0;
spin_lock_irqsave(&pmu_backlight_lock, flags);
/* Don't update brightness when sleeping */
if (!sleeping)
rc = __pmu_backlight_update_status(bd);
spin_unlock_irqrestore(&pmu_backlight_lock, flags);
return rc;
}
static const struct backlight_ops pmu_backlight_data = {
.update_status = pmu_backlight_update_status,
};
#ifdef CONFIG_PM
void pmu_backlight_set_sleep(int sleep)
{
unsigned long flags;
spin_lock_irqsave(&pmu_backlight_lock, flags);
sleeping = sleep;
if (pmac_backlight && uses_pmu_bl) {
if (sleep) {
struct adb_request req;
pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
PMU_POW_BACKLIGHT | PMU_POW_OFF);
pmu_wait_complete(&req);
} else
__pmu_backlight_update_status(pmac_backlight);
}
spin_unlock_irqrestore(&pmu_backlight_lock, flags);
}
#endif /* CONFIG_PM */
void __init pmu_backlight_init(void)
{
struct backlight_properties props;
struct backlight_device *bd;
char name[10];
int level, autosave;
/* Special case for the old PowerBook since I can't test on it */
autosave =
of_machine_is_compatible("AAPL,3400/2400") ||
of_machine_is_compatible("AAPL,3500");
if (!autosave &&
!pmac_has_backlight_type("pmu") &&
!of_machine_is_compatible("AAPL,PowerBook1998") &&
!of_machine_is_compatible("PowerBook1,1"))
return;
snprintf(name, sizeof(name), "pmubl");
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_PLATFORM;
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data,
&props);
if (IS_ERR(bd)) {
printk(KERN_ERR "PMU Backlight registration failed\n");
return;
}
uses_pmu_bl = 1;
pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
level = bd->props.max_brightness;
if (autosave) {
/* read autosaved value if available */
struct adb_request req;
pmu_request(&req, NULL, 2, 0xd9, 0);
pmu_wait_complete(&req);
level = pmu_backlight_curve_lookup(
(req.reply[0] >> 4) *
bd->props.max_brightness / 15);
}
bd->props.brightness = level;
bd->props.power = FB_BLANK_UNBLANK;
backlight_update_status(bd);
printk(KERN_INFO "PMU Backlight initialized (%s)\n", name);
}
|
/* Test for a bogus warning on comparison between signed and unsigned.
This was inspired by code in gcc. */
/* { dg-do compile } */
/* { dg-options "-Wsign-compare" } */
int tf = 1;
void f(int x, unsigned int y)
{
/* Test comparing conditional expressions containing truth values.
This can occur explicitly, or e.g. when (foo?2:(bar?1:0)) is
optimized into (foo?2:(bar!=0)). */
x > (tf?64:(tf!=x)); /* { dg-bogus "signed and unsigned" "case 1" } */
y > (tf?64:(tf!=x)); /* { dg-bogus "signed and unsigned" "case 2" } */
x > (tf?(tf!=x):64); /* { dg-bogus "signed and unsigned" "case 3" } */
y > (tf?(tf!=x):64); /* { dg-bogus "signed and unsigned" "case 4" } */
x > (tf?64:(tf==x)); /* { dg-bogus "signed and unsigned" "case 5" } */
y > (tf?64:(tf==x)); /* { dg-bogus "signed and unsigned" "case 6" } */
x > (tf?(tf==x):64); /* { dg-bogus "signed and unsigned" "case 7" } */
y > (tf?(tf==x):64); /* { dg-bogus "signed and unsigned" "case 8" } */
x > (tf?64:(tf>x)); /* { dg-bogus "signed and unsigned" "case 9" } */
y > (tf?64:(tf>x)); /* { dg-bogus "signed and unsigned" "case 10" } */
x > (tf?(tf>x):64); /* { dg-bogus "signed and unsigned" "case 11" } */
y > (tf?(tf>x):64); /* { dg-bogus "signed and unsigned" "case 12" } */
x < (tf?64:(tf<x)); /* { dg-bogus "signed and unsigned" "case 13" } */
y < (tf?64:(tf<x)); /* { dg-bogus "signed and unsigned" "case 14" } */
x < (tf?(tf<x):64); /* { dg-bogus "signed and unsigned" "case 15" } */
y < (tf?(tf<x):64); /* { dg-bogus "signed and unsigned" "case 16" } */
x > (tf?64:(tf>=x)); /* { dg-bogus "signed and unsigned" "case 17" } */
y > (tf?64:(tf>=x)); /* { dg-bogus "signed and unsigned" "case 18" } */
x > (tf?(tf>=x):64); /* { dg-bogus "signed and unsigned" "case 19" } */
y > (tf?(tf>=x):64); /* { dg-bogus "signed and unsigned" "case 20" } */
x > (tf?64:(tf<=x)); /* { dg-bogus "signed and unsigned" "case 21" } */
y > (tf?64:(tf<=x)); /* { dg-bogus "signed and unsigned" "case 22" } */
x > (tf?(tf<=x):64); /* { dg-bogus "signed and unsigned" "case 23" } */
y > (tf?(tf<=x):64); /* { dg-bogus "signed and unsigned" "case 24" } */
x > (tf?64:(tf&&x)); /* { dg-bogus "signed and unsigned" "case 25" } */
y > (tf?64:(tf&&x)); /* { dg-bogus "signed and unsigned" "case 26" } */
x > (tf?(tf&&x):64); /* { dg-bogus "signed and unsigned" "case 27" } */
y > (tf?(tf&&x):64); /* { dg-bogus "signed and unsigned" "case 28" } */
x > (tf?64:(tf||x)); /* { dg-bogus "signed and unsigned" "case 29" } */
y > (tf?64:(tf||x)); /* { dg-bogus "signed and unsigned" "case 30" } */
x > (tf?(tf||x):64); /* { dg-bogus "signed and unsigned" "case 31" } */
y > (tf?(tf||x):64); /* { dg-bogus "signed and unsigned" "case 32" } */
x > (tf?64:(!tf)); /* { dg-bogus "signed and unsigned" "case 33" } */
y > (tf?64:(!tf)); /* { dg-bogus "signed and unsigned" "case 34" } */
x > (tf?(!tf):64); /* { dg-bogus "signed and unsigned" "case 35" } */
y > (tf?(!tf):64); /* { dg-bogus "signed and unsigned" "case 36" } */
}
|
/*
* Copyright (C) 2009 Samsung Electronics
* Minkyu Kang <mk7.kang@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __JACK_H_
#define __JACK_H_
struct jack_platform_data {
int usb_online;
int charger_online;
int hdmi_online;
int earjack_online;
int earkey_online;
int ums_online;
int cdrom_online;
int jig_online;
int host_online;
int cradle_online;
};
int jack_get_data(const char *name);
void jack_event_handler(const char *name, int value);
#endif
|
/* SPDX-License-Identifier: GPL-2.0 */
/*
* flat.h -- uClinux flat-format executables
*/
#ifndef __M68KNOMMU_FLAT_H__
#define __M68KNOMMU_FLAT_H__
#include <linux/uaccess.h>
#define flat_argvp_envp_on_stack() 1
#define flat_old_ram_flag(flags) (flags)
#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
u32 *addr, u32 *persistent)
{
#ifdef CONFIG_CPU_HAS_NO_UNALIGNED
return copy_from_user(addr, rp, 4) ? -EFAULT : 0;
#else
return get_user(*addr, rp);
#endif
}
static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
{
#ifdef CONFIG_CPU_HAS_NO_UNALIGNED
return copy_to_user(rp, &addr, 4) ? -EFAULT : 0;
#else
return put_user(addr, rp);
#endif
}
#define flat_get_relocate_addr(rel) (rel)
static inline int flat_set_persistent(u32 relval, u32 *persistent)
{
return 0;
}
#define FLAT_PLAT_INIT(regs) \
do { \
if (current->mm) \
(regs)->d5 = current->mm->start_data; \
} while (0)
#endif /* __M68KNOMMU_FLAT_H__ */
|
/*
**********************************************************************
* Copyright (C) 1998-2012, International Business Machines Corporation
* and others. All Rights Reserved.
**********************************************************************
*
* File date.c
*
* Modification History:
*
* Date Name Description
* 4/26/2000 srl created
*******************************************************************************
*/
#include "unicode/utypes.h"
#include <stdio.h>
#include <string.h>
#include "unicode/udata.h"
#include "unicode/ucnv.h"
#include "ucmndata.h"
extern const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT;
int
main(int argc,
char **argv)
{
UConverter *c;
UErrorCode status = U_ZERO_ERROR;
udata_setCommonData(NULL, &status);
printf("setCommonData(NULL) -> %s [should fail]\n", u_errorName(status));
if(status != U_ILLEGAL_ARGUMENT_ERROR)
{
printf("*** FAIL: should have returned U_ILLEGAL_ARGUMENT_ERROR\n");
return 1;
}
status = U_ZERO_ERROR;
udata_setCommonData(&U_ICUDATA_ENTRY_POINT, &status);
printf("setCommonData(%p) -> %s\n", (void*)&U_ICUDATA_ENTRY_POINT, u_errorName(status));
if(U_FAILURE(status))
{
printf("*** FAIL: should have returned U_ZERO_ERROR\n");
return 1;
}
status = U_ZERO_ERROR;
c = ucnv_open("iso-8859-3", &status);
printf("ucnv_open(iso-8859-3)-> %p, err = %s, name=%s\n",
(void *)c, u_errorName(status), (!c)?"?":ucnv_getName(c,&status) );
if(status != U_ZERO_ERROR)
{
printf("\n*** FAIL: should have returned U_ZERO_ERROR;\n");
return 1;
}
else
{
ucnv_close(c);
}
status = U_ZERO_ERROR;
udata_setCommonData(&U_ICUDATA_ENTRY_POINT, &status);
printf("setCommonData(%p) -> %s [should pass]\n", (void*) &U_ICUDATA_ENTRY_POINT, u_errorName(status));
if (U_FAILURE(status) || status == U_USING_DEFAULT_WARNING )
{
printf("\n*** FAIL: should pass and not set U_USING_DEFAULT_ERROR\n");
return 1;
}
printf("\n*** PASS PASS PASS, test PASSED!!!!!!!!\n");
return 0;
}
|
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#define IA_CSS_INCLUDE_STATES
#include "isp/kernels/aa/aa_2/ia_css_aa2.host.h"
#include "isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.h"
#include "isp/kernels/cnr/cnr_2/ia_css_cnr2.host.h"
#include "isp/kernels/de/de_1.0/ia_css_de.host.h"
#include "isp/kernels/dp/dp_1.0/ia_css_dp.host.h"
#include "isp/kernels/ref/ref_1.0/ia_css_ref.host.h"
#include "isp/kernels/tnr/tnr_1.0/ia_css_tnr.host.h"
#include "isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.h"
#include "isp/kernels/dpc2/ia_css_dpc2.host.h"
#include "isp/kernels/eed1_8/ia_css_eed1_8.host.h"
/* Generated code: do not edit or commmit. */
#ifndef _IA_CSS_ISP_STATE_H
#define _IA_CSS_ISP_STATE_H
/* Code generated by genparam/gencode.c:gen_param_enum() */
enum ia_css_state_ids {
IA_CSS_AA_STATE_ID,
IA_CSS_CNR_STATE_ID,
IA_CSS_CNR2_STATE_ID,
IA_CSS_DP_STATE_ID,
IA_CSS_DE_STATE_ID,
IA_CSS_TNR_STATE_ID,
IA_CSS_REF_STATE_ID,
IA_CSS_YNR_STATE_ID,
IA_CSS_NUM_STATE_IDS
};
/* Code generated by genparam/gencode.c:gen_param_offsets() */
struct ia_css_state_memory_offsets {
struct {
struct ia_css_isp_parameter aa;
struct ia_css_isp_parameter cnr;
struct ia_css_isp_parameter cnr2;
struct ia_css_isp_parameter dp;
struct ia_css_isp_parameter de;
struct ia_css_isp_parameter ynr;
} vmem;
struct {
struct ia_css_isp_parameter tnr;
struct ia_css_isp_parameter ref;
} dmem;
};
#if defined(IA_CSS_INCLUDE_STATES)
#include "ia_css_stream.h" /* struct ia_css_stream */
#include "ia_css_binary.h" /* struct ia_css_binary */
/* Code generated by genparam/genstate.c:gen_state_init_table() */
extern void (* ia_css_kernel_init_state[IA_CSS_NUM_STATE_IDS])(const struct ia_css_binary *binary);
#endif /* IA_CSS_INCLUDE_STATE */
#endif /* _IA_CSS_ISP_STATE_H */
|
/* On Darwin, the stub for simple_cst_equal was not being emitted at all
causing the as to die and not create an object file. */
int
attribute_list_contained ()
{
return (simple_cst_equal ());
}
int
simple_cst_list_equal ()
{
return (simple_cst_equal ());
}
int __attribute__((noinline))
simple_cst_equal ()
{
return simple_cst_list_equal ();
}
|
/* Implement the vsnprintf function.
Copyright (C) 2003, 2004, 2005, 2011, 2013 Free Software Foundation, Inc.
Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
This file is part of the libiberty library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, if you link this library with files
compiled with a GNU compiler to produce an executable, this does not cause
the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
/*
@deftypefn Supplemental int vsnprintf (char *@var{buf}, size_t @var{n}, @
const char *@var{format}, va_list @var{ap})
This function is similar to @code{vsprintf}, but it will write to
@var{buf} at most @code{@var{n}-1} bytes of text, followed by a
terminating null byte, for a total of @var{n} bytes. On error the
return value is -1, otherwise it returns the number of characters that
would have been printed had @var{n} been sufficiently large,
regardless of the actual value of @var{n}. Note some pre-C99 system
libraries do not implement this correctly so users cannot generally
rely on the return value if the system version of this function is
used.
@end deftypefn
*/
#include "config.h"
#include "ansidecl.h"
#include <stdarg.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include "libiberty.h"
/* This implementation relies on a working vasprintf. */
int
vsnprintf (char *s, size_t n, const char *format, va_list ap)
{
char *buf = 0;
int result = vasprintf (&buf, format, ap);
if (!buf)
return -1;
if (result < 0)
{
free (buf);
return -1;
}
result = strlen (buf);
if (n > 0)
{
if ((long) n > result)
memcpy (s, buf, result+1);
else
{
memcpy (s, buf, n-1);
s[n - 1] = 0;
}
}
free (buf);
return result;
}
#ifdef TEST
/* Set the buffer to a known state. */
#define CLEAR(BUF) do { memset ((BUF), 'X', sizeof (BUF)); (BUF)[14] = '\0'; } while (0)
/* For assertions. */
#define VERIFY(P) do { if (!(P)) abort(); } while (0)
static int ATTRIBUTE_PRINTF_3
checkit (char *s, size_t n, const char *format, ...)
{
int result;
va_list ap;
va_start (ap, format);
result = vsnprintf (s, n, format, ap);
va_end (ap);
return result;
}
extern int main (void);
int
main (void)
{
char buf[128];
int status;
CLEAR (buf);
status = checkit (buf, 10, "%s:%d", "foobar", 9);
VERIFY (status==8 && memcmp (buf, "foobar:9\0XXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 9, "%s:%d", "foobar", 9);
VERIFY (status==8 && memcmp (buf, "foobar:9\0XXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 8, "%s:%d", "foobar", 9);
VERIFY (status==8 && memcmp (buf, "foobar:\0XXXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 7, "%s:%d", "foobar", 9);
VERIFY (status==8 && memcmp (buf, "foobar\0XXXXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 6, "%s:%d", "foobar", 9);
VERIFY (status==8 && memcmp (buf, "fooba\0XXXXXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 2, "%s:%d", "foobar", 9);
VERIFY (status==8 && memcmp (buf, "f\0XXXXXXXXXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 1, "%s:%d", "foobar", 9);
VERIFY (status==8 && memcmp (buf, "\0XXXXXXXXXXXXX\0", 15) == 0);
CLEAR (buf);
status = checkit (buf, 0, "%s:%d", "foobar", 9);
VERIFY (status==8 && memcmp (buf, "XXXXXXXXXXXXXX\0", 15) == 0);
return 0;
}
#endif /* TEST */
|
// SPDX-License-Identifier: GPL-2.0
/*
* Written by Paul B Schroeder < pschroeder "at" uplogix "dot" com >
* Based on 8250_boca.
*
* Copyright (C) 2005 Russell King.
* Data taken from include/asm-i386/serial.h
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/serial_8250.h>
#include "8250.h"
static struct plat_serial8250_port exar_data[] = {
SERIAL8250_PORT(0x100, 5),
SERIAL8250_PORT(0x108, 5),
SERIAL8250_PORT(0x110, 5),
SERIAL8250_PORT(0x118, 5),
{ },
};
static struct platform_device exar_device = {
.name = "serial8250",
.id = PLAT8250_DEV_EXAR_ST16C554,
.dev = {
.platform_data = exar_data,
},
};
static int __init exar_init(void)
{
return platform_device_register(&exar_device);
}
module_init(exar_init);
MODULE_AUTHOR("Paul B Schroeder");
MODULE_DESCRIPTION("8250 serial probe module for Exar cards");
MODULE_LICENSE("GPL");
|
/*
* Copyright © 2001 Red Hat UK Limited
* Copyright © 2001-2010 David Woodhouse <dwmw2@infradead.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef __LINUX_MTD_GEN_PROBE_H__
#define __LINUX_MTD_GEN_PROBE_H__
#include <linux/mtd/flashchip.h>
#include <linux/mtd/map.h>
#include <linux/mtd/cfi.h>
#include <linux/bitops.h>
struct chip_probe {
char *name;
int (*probe_chip)(struct map_info *map, __u32 base,
unsigned long *chip_map, struct cfi_private *cfi);
};
struct mtd_info *mtd_do_chip_probe(struct map_info *map, struct chip_probe *cp);
#endif /* __LINUX_MTD_GEN_PROBE_H__ */
|
/*****************************************************************************
* randm.h - Random number generator header file.
*
* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
* Copyright (c) 1998 Global Election Systems Inc.
*
* The authors hereby grant permission to use, copy, modify, distribute,
* and license this software and its documentation for any purpose, provided
* that existing copyright notices are retained in all copies and that this
* notice and the following disclaimer are included verbatim in any
* distributions. No written agreement, license, or royalty fee is required
* for any of the authorized uses.
*
* THIS SOFTWARE IS PROVIDED BY THE 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 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.
*
******************************************************************************
* REVISION HISTORY
*
* 03-01-01 Marc Boucher <marc@mbsi.ca>
* Ported to lwIP.
* 98-05-29 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
* Extracted from avos.
*****************************************************************************/
#ifndef RANDM_H
#define RANDM_H
/***********************
*** PUBLIC FUNCTIONS ***
***********************/
/*
* Initialize the random number generator.
*/
void avRandomInit(void);
/*
* Churn the randomness pool on a random event. Call this early and often
* on random and semi-random system events to build randomness in time for
* usage. For randomly timed events, pass a null pointer and a zero length
* and this will use the system timer and other sources to add randomness.
* If new random data is available, pass a pointer to that and it will be
* included.
*/
void avChurnRand(char *randData, u32_t randLen);
/*
* Randomize our random seed value. To be called for truely random events
* such as user operations and network traffic.
*/
#if MD5_SUPPORT
#define avRandomize() avChurnRand(NULL, 0)
#else /* MD5_SUPPORT */
void avRandomize(void);
#endif /* MD5_SUPPORT */
/*
* Use the random pool to generate random data. This degrades to pseudo
* random when used faster than randomness is supplied using churnRand().
* Thus it's important to make sure that the results of this are not
* published directly because one could predict the next result to at
* least some degree. Also, it's important to get a good seed before
* the first use.
*/
void avGenRand(char *buf, u32_t bufLen);
/*
* Return a new random number.
*/
u32_t avRandom(void);
#endif /* RANDM_H */
|
/*
* ks8842.h KS8842 platform data struct definition
* Copyright (c) 2010 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _LINUX_KS8842_H
#define _LINUX_KS8842_H
#include <linux/if_ether.h>
/**
* struct ks8842_platform_data - Platform data of the KS8842 network driver
* @macaddr: The MAC address of the device, set to all 0:s to use the on in
* the chip.
*
*/
struct ks8842_platform_data {
u8 macaddr[ETH_ALEN];
};
#endif
|
#ifndef __HEAP_H__
#define __HEAP_H__
#include "common.h"
#include <stdlib.h>
/* Heap handle type */
typedef struct heap* heap_t;
/* Callback type
*
* Used for freeing up heap resources.
*
* elem - current element
* data - user-supplied data
*/
typedef void (*heap_cb_t)(point_t* elem, void* data);
/* Initialize heap
*
* Initialize a binary heap with an initial capacity.
*
* heap - pointer to a heap handle
* size - initial heap capacity (will grow when needed)
*
* Returns a negative value on failure.
*/
int heap_create(heap_t* heap, size_t size);
/* Get the number of elements in heap
*
* Returns the number of elements in the specified heap.
*
* heap - the heap to count elements in
*
* Returns the number of elements in the heap.
*/
size_t heap_size(heap_t heap);
/* Insert an element into heap
*
* Insert an element in a heap with a specified key.
*
* heap - the heap to insert into
* key - the key to use for the element
* elem - the element to insert
*
* Returns a negative value on failure.
*/
int heap_insert(heap_t heap, int key, point_t* elem);
/* Remove an element from heap
*
* Removes the element with the lowest key from the heap.
*
* heap - the heap to remove from
* elem - if not NULL, elem will be set to the element with lowest key if the
* heap is non-empty
*
* Returns 1 if the heap is non-empty and an element is removed, 0 otherwise.
*/
int heap_remove(heap_t heap, point_t** elem);
/* Clean up heap
*
* Deletes the heap and cleans up the resources.
*
* heap - the heap to destroy
* cb - user-defined callback or NULL
* data - user-defined data
*
* NB! The user-defined callback must manually free element data.
*
* Returns a negative value on failure.
*/
int heap_free(heap_t heap, heap_cb_t cb, void* data);
#endif
|
#include <lasertag/spi.h>
#include <avr/io.h>
void spi_init(void)
{
/* Set MOSI (PB3) and SCK (PB5) to outputs. */
DDRB |= (1 << PB3) | (1 << PB5);
/* Set MISO (PB4) to be an input. */
DDRB &= ~(1 << PB4);
/* Enable the SPI bus in master mode at 1 MHz. */
SPCR = (1 << SPE) | (1 << MSTR) | (1 << SPR0);
}
uint8_t spi_transfer(uint8_t value)
{
/* Start the SPI transfer - write data to the slave. */
SPDR = value;
/* Wait for the transfer to finish. */
while (!(SPSR & (1 << SPIF)));
/* Read the data from the slave. */
value = SPDR;
/* Return the data that was read. */
return value;
}
|
#ifndef __LIBOPENOTR_ERRORS_H__
#define __LIBOPENOTR_ERRORS_H__
#define ENOMEMORY 1
#define ESHORTBUF 2
#define EINVLMSG 3
#define EOPENSSL 4
#define ENOTREADY 4
#endif
|
/* ISC license. */
#ifndef SKALIBS_DIUINT32_H
#define SKALIBS_DIUINT32_H
#include <stdint.h>
typedef struct diuint32_s diuint32, *diuint32_ref ;
struct diuint32_s
{
uint32_t left ;
uint32_t right ;
} ;
#define DIUINT32_ZERO { .left = 0, .right = 0 }
#endif
|
/*
* Copyright (c) 2017 Raphael Sousa Santos <contact@raphaelss.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 TYPES_DEFINED
#define TYPES_DEFINED
/* Forward declarations */
typedef struct Stu Stu;
typedef struct Sv Sv;
typedef unsigned Sv_type;
typedef struct Type_registry {
Sv **name_symbol;
Sv **field_vectors;
unsigned size, capacity;
} Type_registry;
extern void Type_registry_init(Type_registry *);
extern void Type_registry_release(Type_registry *);
extern Sv_type Type_new(Stu *, Sv*, Sv*);
extern Sv *Type_name_symbol(Stu *, Sv_type);
extern const char *Type_name_string(Stu *, Sv_type);
extern Sv *Type_field_vector(Stu *, Sv_type);
extern long Type_field_index(Stu *, Sv_type, Sv*);
#endif
|
//
// AppDelegate.h
// WBNetworkDemo
//
// Created by idol on 2018/4/26.
// Copyright © 2018年 idool. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
* Copyright (c) 2018-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
* 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 ARM_COMPUTE_CL_GEMM_RESHAPE_RHS_MATRIX_KERNEL_H
#define ARM_COMPUTE_CL_GEMM_RESHAPE_RHS_MATRIX_KERNEL_H
#include "src/core/common/Macros.h"
#include "src/gpu/cl/ClCompileContext.h"
#include "src/gpu/cl/IClKernel.h"
namespace arm_compute
{
namespace opencl
{
namespace kernels
{
/** OpenCL kernel to reshape the RHS matrix when performing the matrix multiplication
* In particular, this kernel splits the src matrix in blocks of size K0xN0 and stores each one in
* the dst matrix unrolling the values */
class ClGemmReshapeRhsMatrixKernel : public ICLKernel
{
public:
ClGemmReshapeRhsMatrixKernel();
ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE(ClGemmReshapeRhsMatrixKernel);
/** Initialise the kernel's input and output.
*
* @note If rhs_info.export_to_cl_image = true, this OpenCL kernel will guarantee the OpenCL pitch alignment for the output tensor,
* required to create a OpenCL image object from buffer in @ref ClGemmMatrixMultiplyReshapedKernel and in @ref ClGemmMatrixMultiplyReshapedOnlyRhsKernel
* Since the OpenCL image object is created importing the OpenCL buffer, the following conditions are required:
* -# rhs_info.n0 can only be 4, 8 and 16
* -# rhs_info.k0 can only be 4, 8 and 16
* -# Data type can only be F32, F16
* -# The platform should support the OpenCL cl_khr_image2d_from_buffer extension
* -# output width should be less or equal to (CL_DEVICE_IMAGE2D_MAX_WIDTH * 4)
* -# output (height * depth) should be less or equal to CL_DEVICE_IMAGE2D_MAX_HEIGHT
* -# The output tensor should be only consumed by @ref ClGemmMatrixMultiplyReshapedKernel or @ref ClGemmMatrixMultiplyReshapedOnlyRhsKernel
*
* @param[in] compile_context The compile context to be used.
* @param[in] src Input tensor. Data types supported: All
* @param[out] dst Output tensor. Data type supported: same as @p src
* @param[in] rhs_info RHS matrix information to be used for reshaping. This object contains all the necessary
* information to reshape the src tensor. Only the following values are supported:
* rhs_info.n0: 2,3,4,8,16 (only 4, 8 and 16 if rhs_info.export_to_cl_image == true)
* rhs_info.k0: 1,2,3,4,8,16 (k0 = 1 only if rhs_info.transpose = false), (only 4, 8 and 16 if rhs_info.export_to_cl_image == true)
* rhs_info.h0: greater than 0
* rhs_info.transpose: true, false
* rhs_info.interleave: true, false
*/
void configure(const ClCompileContext &compile_context, ITensorInfo *src, ITensorInfo *dst, const GEMMRHSMatrixInfo &rhs_info);
/** Static function to check if given info will lead to a valid configuration
*
* Similar to @ref ClGemmReshapeRhsMatrixKernel::configure()
*
* @return a status
*/
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const GEMMRHSMatrixInfo &rhs_info);
// Inherited methods overridden:
void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override;
};
} // namespace kernels
} // namespace opencl
} // namespace arm_compute
#endif /* ARM_COMPUTE_CL_GEMM_RESHAPE_RHS_MATRIX_KERNEL_H */ |
/*
* Copyright (c) 2008 Travis Geiselbrecht
*
* 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 __LIB_STRING_H
#define __LIB_STRING_H
#include <stddef.h>
#include <compiler.h>
__BEGIN_CDECLS
void *memchr (void const *, int, size_t) __PURE;
int memcmp (void const *, const void *, size_t) __PURE;
void *memcpy (void *, void const *, size_t);
void *memmove(void *, void const *, size_t);
void *memset (void *, int, size_t);
char *strcat(char *, char const *);
char *strchr(char const *, int) __PURE;
int strcmp(char const *, char const *) __PURE;
char *strcpy(char *, char const *);
char const *strerror(int) __CONST;
size_t strlen(char const *) __PURE;
char *strncat(char *, char const *, size_t);
int strncmp(char const *, char const *, size_t) __PURE;
char *strncpy(char *, char const *, size_t);
char *strpbrk(char const *, char const *) __PURE;
char *strrchr(char const *, int) __PURE;
size_t strspn(char const *, char const *) __PURE;
size_t strcspn(const char *s, const char *) __PURE;
char *strstr(char const *, char const *) __PURE;
char *strtok(char *, char const *);
int strcoll(const char *s1, const char *s2) __PURE;
size_t strxfrm(char *dest, const char *src, size_t n) __PURE;
char *strdup(const char *str) __MALLOC;
/* non standard */
void bcopy(void const *, void *, size_t);
void bzero(void *, size_t);
size_t strlcat(char *, char const *, size_t);
size_t strlcpy(char *, char const *, size_t);
int strncasecmp(char const *, char const *, size_t) __PURE;
int strnicmp(char const *, char const *, size_t) __PURE;
size_t strnlen(char const *s, size_t count) __PURE;
__BEGIN_CDECLS
#endif
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct csr_t {
int n; /* Dimension of matrix (assume square) */
double* pr; /* Array of matrix nonzeros (row major order) */
int* col; /* Column indices of nonzeros */
int* ptr; /* Offsets of the start of each row in pr
(ptr[n] = number of nonzeros) */
} csr_t;
void sparse_multiply(csr_t* A, double* x, double* result)
{
memset(result, 0, A->n * sizeof(double));
for (int i = 0; i < A->n; i++)
for (int j = A->ptr[i]; j < A->ptr[i+1];j++)
result[i] += A->pr[j]*x[A->col[j]];
}
int main()
{
int n = 4;
double pr[7] = { 1.,-1., 1.,-1., 1.,-1., 1. };
int col[7] = { 0, 1, 1, 2, 2, 3, 3 };
int ptr[5] = { 0, 2, 4, 6, 7 };
csr_t A = { n, pr, col, ptr };
double x[4] = {1., 3., 8., 12.};
double result[4];
sparse_multiply(&A, x, result);
/*
* Should compute
* [1, -1, 0, 0 ] [ 1 ] [-2]
* [ 0, 1, -1, 0 ] * [ 3 ] = [-5]
* [ 0, 0, 1, -1 ] [ 8 ] [-4]
* [ 0, 0, 0, 1 ] [ 12 ] [12]
*/
for (int i = 0; i < n; ++i)
printf(" %g\n", result[i]);
}
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <AddressBookUI/ABPropertyGroupItem.h>
@class CNPhoneNumber;
@interface ABPropertyGroupPhoneItem : ABPropertyGroupItem
{
}
- (id)valueForDisplayString:(id)arg1;
- (id)displayStringForValue:(id)arg1;
- (id)bestLabel:(id)arg1;
- (id)defaultActionURL;
- (id)normalizedValue;
@property(readonly, nonatomic) CNPhoneNumber *phoneNumber;
@end
|
#pragma once
#include "Concurrency.h"
#include "Message.h"
namespace Profiler
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class Socket;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class Server
{
InputDataStream networkStream;
static const int BIFFER_SIZE = 1024;
char buffer[BIFFER_SIZE];
Socket* socket;
CriticalSection lock;
Server( short port );
~Server();
public:
bool Connect();
void Send(DataResponse::Type type, OutputDataStream& stream = OutputDataStream::Empty);
void Update();
static Server &Get();
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} |
#pragma once
#include <stdio.h>
#include "echomesh/base/Echomesh.h"
namespace echomesh {
namespace audio {
class ConfigMidiInput;
class ConfigMidiOutput;
class MidiController : public MidiInputCallback {
public:
MidiController();
virtual ~MidiController();
virtual void handleIncomingMidiMessage(MidiInput*, const MidiMessage&);
void config();
void midi();
private:
#if 0
ScopedPointer<ConfigMidiInput> midiInput_;
ScopedPointer<ConfigMidiOutput> midiOutput_;
#endif
DISALLOW_COPY_AND_ASSIGN(MidiController);
};
} // namespace audio
} // namespace echomesh
|
//
// GQSQLiteProtocol.h
// Pods
//
// Created by QianGuoqiang on 16/8/2.
//
//
#import <Foundation/Foundation.h>
@interface GQSQLiteProtocol : NSURLProtocol
@end
extern NSString * const GQSQLiteURLQueryKey;
extern NSString * const GQSQLiteURLProtocolKey;
@interface NSString (GQSQLiteProtocol)
+ (instancetype)sqliteURLStringWithDatabaseName:(NSString *)databaseName sql:(NSString *)sql;
- (NSString *)stringByBindSQLiteWithParams:(NSDictionary *)params;
@end
@interface NSURL (GQSQLiteProtocol)
+ (instancetype)sqliteURLWithDatabaseName:(NSString *)databaseName sql:(NSString *)sql;
- (NSString *)gq_sql;
@end
|
//
// IDAppDelegate.h
// IDAnalyticsDemoApp
//
// Created by Ian Paterson on 4/1/14.
// Copyright (c) 2014 Ian Paterson. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface IDAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
** svn $Id: wc13.h 2328 2014-01-23 20:16:18Z arango $
*******************************************************************************
** Copyright (c) 2002-2014 The ROMS/TOMS Group **
** Licensed under a MIT/X style license **
** See License_ROMS.txt **
*******************************************************************************
**
** Options for the California Current System, 1/3 degree resolution.
**
** Application flag: WC13
** Input script: ocean_wc13.in
** s4dvar.in
**
** Available Drivers options: choose only one and activate it in the
** build.sh script (MY_CPP_FLAGS definition)
**
** AD_SENSITIVITY Adjoint Sensitivity Driver
** AFT_EIGENMODES Adjoint Finite Time Eigenmodes
** ARRAY_MODES Stabilized representer matrix array modes
** CLIPPING Stabilized representer matrix clipped analysis
** CORRELATION Background-error Correlation Check
** GRADIENT_CHECK TLM/ADM Gradient Check
** FORCING_SV Forcing Singular Vectors
** FT_EIGENMODES Finite Time Eigenmodes
** IS4DVAR Incremental, strong constraint 4DVAR
** NLM_DRIVER Nonlinear Basic State trajectory
** OPT_PERTURBATION Optimal perturbations
** PICARD_TEST Picard Iterations Test
** R_SYMMETRY Representer Matrix Symmetry Test
** SANITY_CHECK Sanity Check
** SO_SEMI Stochastic Optimals: Semi-norm
** TLM_CHECK Tangent Linear Model Check
** W4DPSAS Weak constraint 4D-PSAS
** W4DVAR Weak constraint 4DVAR
** VERIFICATION NL Observation Verification Driver
** NORMALIZATION Background error Covariance Normalization
*/
/*
**-----------------------------------------------------------------------------
** Nonlinear basic state settings.
**-----------------------------------------------------------------------------
*/
#ifdef VERIFICATION
# define FULL_GRID
#endif
#define ANA_BSFLUX
#define ANA_BTFLUX
#define UV_ADV
#define DJ_GRADPS
#define UV_COR
#define UV_QDRAG
#define UV_VIS2
#define MIX_S_UV
#define MIX_GEO_TS
#define TS_DIF2
#define TS_U3HADVECTION
#define TS_C4VADVECTION
#define SOLVE3D
#define SALINITY
#define NONLIN_EOS
#define CURVGRID
#define PROFILE
#define SPHERICAL
#define SPLINES
#define MASKING
#ifdef NLM_DRIVER
# define AVERAGES /* define if writing out time-averaged data */
#endif
/*
** Vertical Mixing parameterization
*/
#define GLS_MIXING
#ifdef GLS_MIXING
# define N2S2_HORAVG
# define KANTHA_CLAYSON
#endif
/* If you define SPONGE or allow for a nudging layer at the boundaries,
** you need to provide the appropriate "ana_hmixcoef.h" and "ana_nudgcoef.h"
** for your application. See examples in ROMS/Func
*/
#define SPONGE
/*
** Surface atmospheric fluxes. Note, that we must define DIURNAL_SRFLUX
** when using daily averaged fields.
*/
#define BULK_FLUXES /* turn ON or OFF bulk fluxes computation */
#define DIURNAL_SRFLUX /* impose shortwave radiation local diurnal cycle */
#define SOLAR_SOURCE /* define solar radiation source term */
#define LONGWAVE_OUT /* Compute net longwave radiation internally */
#define EMINUSP /* turn ON internal calculation of E-P */
/*
**-----------------------------------------------------------------------------
** Variational Data Assimilation.
**-----------------------------------------------------------------------------
*/
/*
** Options to compute error covariance normalization coefficients.
*/
#ifdef NORMALIZATION
# define ADJUST_BOUNDARY
# define ADJUST_WSTRESS
# define ADJUST_STFLUX
# define CORRELATION
# define VCONVOLUTION
# define IMPLICIT_VCONV
# define FULL_GRID
# define FORWARD_WRITE
# define FORWARD_READ
# define FORWARD_MIXING
# define OUT_DOUBLE
#endif
/*
** Options for adjoint-based algorithms sanity checks.
*/
#ifdef SANITY_CHECK
# define FULL_GRID
# define FORWARD_READ
# define FORWARD_WRITE
# define FORWARD_MIXING
# define OUT_DOUBLE
# define ANA_PERTURB
# define ANA_INITIAL
#endif
/*
** Common options to all 4DVAR algorithms.
*/
#if defined ARRAY_MODES || defined CLIPPING || \
defined IS4DVAR || defined IS4DVAR_SENSITIVITY || \
defined W4DPSAS || defined W4DPSAS_SENSITIVITY || \
defined W4DVAR || defined W4DVAR_SENSITIVITY
# define ADJUST_BOUNDARY
# define ADJUST_WSTRESS
# define ADJUST_STFLUX
# define NL_BULK_FLUXES
# define VCONVOLUTION
# define IMPLICIT_VCONV
# define BALANCE_OPERATOR
# ifdef BALANCE_OPERATOR
# define ZETA_ELLIPTIC
# endif
# define FORWARD_WRITE
# define FORWARD_READ
# define FORWARD_MIXING
# define OUT_DOUBLE
#endif
/*
** Special options for each 4DVAR algorithm.
*/
#if defined ARRAY_MODES || \
defined W4DVAR || defined W4DVAR_SENSITIVITY
# define RPM_RELAXATION
#endif
|
/**
* \file
*
* \brief Board-specific example configuration
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_EXAMPLE_H
#define CONF_EXAMPLE_H
/* Selecting LED ON STK600-ATMEGA128RFA1 EVK */
#define LED_PIN LED_GREEN_GPIO
/* Buttom on STK600-ATMEGA128RFA1-EK as External Interrupt Source*/
#define BUTTON_INTERRUPT_SOURCE CONFIG_EXT_INT5
/* External Interrupt Input Mode */
#define BUTTON_INTERRUPT_MODE IOPORT_SENSE_RISING
#endif /* CONF_EXAMPLE_H */
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
#import "AVAssetWriterFinishWritingHelperDelegate-Protocol.h"
@interface AVAssetWriterSynchronousMainThreadFinishWritingDelegate : NSObject <AVAssetWriterFinishWritingHelperDelegate>
{
}
- (_Bool)shouldHelperPrepareInputs;
- (void)finishWritingHelperDidFail:(id)arg1;
- (void)finishWritingHelperDidCancelFinishWriting:(id)arg1;
- (void)finishWritingHelper:(id)arg1 didInitiateFinishWritingForFigAssetWriter:(struct OpaqueFigAssetWriter *)arg2;
@end
|
/* -*- Mode: c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2013 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
/* Regression test for ticket #1785, contributed by Jed Brown. The test was
* hanging indefinitely under a buggy version of ch3:sock. */
#include <mpi.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
MPI_Request barrier;
int rank,i,done;
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
MPI_Ibarrier(MPI_COMM_WORLD,&barrier);
for (i=0,done=0; !done; i++) {
usleep(1000);
/*printf("[%d] MPI_Test: %d\n",rank,i);*/
MPI_Test(&barrier,&done,MPI_STATUS_IGNORE);
}
if (rank == 0)
printf(" No Errors\n");
MPI_Finalize();
return 0;
}
|
//
// NSObject+DALLLDBQuickLook.h
// DALDebugging
//
// Created by Daniel Leber on 10/8/14.
// Copyright (c) 2014 Daniel Leber. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// 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.
//
#import <Foundation/Foundation.h>
#if DEBUG
/*
* For use with LLDB-QuickLook
* https://github.com/ryanolsonk/LLDB-QuickLook
*/
@interface NSObject (DALLLDBQuickLook)
- (NSData *)quickLookDebugData;
- (NSString *)quickLookDebugFilename;
@end
#endif
|
// File created: 2012-10-30 18:01:21
#include <mush/cursor.h>
#include <mush/err.h>
#include <mush/space.h>
#include "coords.h"
#include "typenames.h"
#include "util/tap.h"
#define mushcoords NAME(mushcoords)
#define mushspace NAME(mushspace)
#define mushcursor NAME(mushcursor)
#define mushbounds NAME(mushbounds)
#define mushspace_init CAT(mushspace,_init)
#define mushspace_free CAT(mushspace,_free)
#define mushcursor_init CAT(mushcursor,_init)
#define mushcursor_free CAT(mushcursor,_free)
#define mushcursor_get CAT(mushcursor,_get)
#define mushcursor_get_pos CAT(mushcursor,_get_pos)
#define mushcursor_put CAT(mushcursor,_put)
#define mushcursor_advance CAT(mushcursor,_advance)
#define mushcursor_retreat CAT(mushcursor,_retreat)
#define mushspace_get_tight_bounds CAT(mushspace,_get_tight_bounds)
#define mushcoords_sub CAT(mushcoords,_sub)
#define mushcoords_add CAT(mushcoords,_add)
#define mushspace_load_string CAT(mushspace,_load_string)
int main(void) {
tap_n(1 + 5*2 + 1 + 3 + 2*(2+3)+(2+1)+2 + 1 + 1+2*2+1 + 1+2*2+1 + 1);
static const mushcoords beg = MUSHCOORDS_INIT(1000000,1000000,1000000),
delta = MUSHCOORDS_INIT(1,1,1);
mushspace *space = mushspace_init(NULL, NULL);
if (!space) {
tap_not_ok("space_init returned null");
tap_skip_remaining("space_init failed");
return 1;
}
tap_ok("space_init succeeded");
mushcursor *cursor = mushcursor_init(NULL, space, beg);
#define gpg(g, p) do { \
tap_eqc(mushcursor_get(cursor), g); \
mushcursor_put(cursor, p); \
tap_eqc(mushcursor_get(cursor), p); \
} while (0)
// Basic back-and-forthing. The end result should be that we're back at beg
// with -1 behind us, 0 on us, and 1 in front of us.
gpg(' ', 10);
mushcursor_advance(cursor, delta);
gpg(' ', 1);
mushcursor_retreat(cursor, delta);
gpg(10, 12);
mushcursor_retreat(cursor, delta);
gpg(' ', -1);
mushcursor_advance(cursor, delta);
gpg(12, 0);
tap_eqcos(mushcursor_get_pos(cursor), beg,
"cursor is back where it started",
"cursor is not back where it started");
// Check that the tight bounds are currently correct.
#define tight(empty, ebeg, eend) do { \
mushbounds bs; \
if (empty) \
tap_bool(!mushspace_get_tight_bounds(space, &bs), \
"get_tight_bounds says that the space is empty", \
"get_tight_bounds says that the space is nonempty"); \
else { \
tap_bool(mushspace_get_tight_bounds(space, &bs), \
"get_tight_bounds says that the space is nonempty", \
"get_tight_bounds says that the space is empty"); \
tap_eqcos(bs.beg, ebeg, "get_tight_bounds reports correct beg", \
"get_tight_bounds reports incorrect beg"); \
tap_eqcos(bs.end, eend, "get_tight_bounds reports correct end", \
"get_tight_bounds reports incorrect end"); \
} \
} while (0)
tight(false, mushcoords_sub(beg, delta), mushcoords_add(beg, delta));
// Clear the space from left to right, and make sure it remains empty
// afterwards by checking from right to left. The end result should be an
// empty space with the cursor back at beg.
#define clear(ecell, empty, ebeg, eend) do { \
gpg(ecell, ' '); \
tight(empty, ebeg, eend); \
} while (0)
mushcursor_retreat(cursor, delta);
clear(-1, false, beg, mushcoords_add(beg, delta));
mushcursor_advance(cursor, delta);
clear(0, false, mushcoords_add(beg, delta), mushcoords_add(beg, delta));
mushcursor_advance(cursor, delta);
clear(1, true, beg, beg);
mushcursor_retreat(cursor, delta);
tap_eqc(mushcursor_get(cursor), ' ');
mushcursor_retreat(cursor, delta);
tap_eqc(mushcursor_get(cursor), ' ');
mushcursor_advance(cursor, delta);
tap_eqcos(mushcursor_get_pos(cursor), beg,
"cursor is back where it started",
"cursor is not back where it started");
// Create a tiny box (one with volume 1), check that its value is seen by
// the cursor, put something next to it via the cursor, and check that both
// remain correct. End at (beg - delta).
static const unsigned char tiny[] = "x";
mushspace_load_string(space, tiny, 1, NULL, beg, false);
tap_eqc(mushcursor_get(cursor), 'x');
mushcursor_retreat(cursor, delta);
gpg(' ', 'Y');
mushcursor_advance(cursor, delta);
gpg('x', 'z');
mushcursor_retreat(cursor, delta);
tap_eqc(mushcursor_get(cursor), 'Y');
// Create a box overlapping both of the locations allocated above (volume
// 2^dim), check that they were both overwritten correctly, and that they
// can be overwritten correctly. End at beg.
//
// The string is such that the value overwriting the second position (beg)
// is '0' + MUSHSPACE_DIM.
static const unsigned char huge[] = "01\nv2\r\n\fpq\rr3";
mushspace_load_string(space, huge, 13,
NULL, mushcoords_sub(beg, delta), false);
tap_eqc(mushcursor_get(cursor), '0');
mushcursor_advance(cursor, delta);
gpg('0' + MUSHSPACE_DIM, 'k');
mushcursor_retreat(cursor, delta);
gpg('0', 'o');
mushcursor_advance(cursor, delta);
tap_eqc(mushcursor_get(cursor), 'k');
// Check that we are where we expect ourselves to be.
tap_eqcos(mushcursor_get_pos(cursor), beg,
"cursor's final position is where it started",
"cursor's final position is not where it started");
mushcursor_free(cursor);
free(cursor);
mushspace_free(space);
free(space);
}
|
//
// NewFolderController.h
// nexuspad
//
// Created by Ren Liu on 8/22/12.
//
//
#import <UIKit/UIKit.h>
#import "FolderService.h"
#import "FolderUpdaterControllerDelegate.h"
#import "AccountManager.h"
@interface FolderCreateController : UIViewController <NPDataServiceDelegate,
UITableViewDataSource,
UITableViewDelegate,
UITextFieldDelegate>
@property (nonatomic, weak) id<FolderUpdaterControllerDelegate> delegate;
@property (nonatomic, strong) NPFolder *theNewFolder;
@property (nonatomic, strong) NPFolder *parentFolder;
@end
|
#ifndef OOOIRepositoryData_H
#define OOOIRepositoryData_H
#include "OOOCode.h"
#include "OOOIError.h"
#define OOOInterface OOOIRepositoryData
OOOVirtuals
OOOVirtual(char *, getName)
OOOVirtual(void, data, OOOIError * iError, unsigned char * pData, size_t uSize)
OOOVirtualsEnd
#undef OOOInterface
#endif
|
//
// OptAlbumCell.h
// OptImagePicker
//
// Created by LinhLuu on 4/21/16.
// Copyright © 2016 LinhLuu. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OptAlbumCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *imageView1;
@property (weak, nonatomic) IBOutlet UIImageView *imageView2;
@property (weak, nonatomic) IBOutlet UIImageView *imageView3;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *countLabel;
@property (nonatomic, assign) CGFloat borderWidth;
@end
|
//
// UIView+LayoutMethods.h
// TmallClient4iOS-Prime
//
// Created by casa on 14/12/8.
// Copyright (c) 2014年 casa. All rights reserved.
//
#import <UIKit/UIKit.h>
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SCREEN_WIDTH ([[UIScreen mainScreen]bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen]bounds].size.height)
#define SCREEN_WITHOUT_STATUS_HEIGHT (SCREEN_HEIGHT - [[UIApplication sharedApplication] statusBarFrame].size.height)
#define LeftControllerViewWidth (((375 - 64) / 375.0 ) * SCREEN_WIDTH)
typedef CGFloat UIScreenType;
static UIScreenType UIScreenType_iPhone6 = 375.0f;
NS_ASSUME_NONNULL_BEGIN
@interface UIView (LayoutMethods)
// coordinator getters
- (CGFloat)height;
- (CGFloat)width;
- (CGFloat)x;
- (CGFloat)y;
- (CGSize)size;
- (CGPoint)origin;
- (CGFloat)centerX;
- (CGFloat)centerY;
/// 链式
- (UIView*(^)(CGFloat temp))X;
- (UIView*(^)(CGFloat temp))Y;
- (UIView*(^)(CGFloat temp))Width;
- (UIView*(^)(CGFloat temp))Height;
- (CGFloat)left;
- (CGFloat)top;
- (CGFloat)bottom;
- (CGFloat)right;
- (void)setX:(CGFloat)x;
- (void)setLeft:(CGFloat)left;
- (void)setY:(CGFloat)y;
- (void)setTop:(CGFloat)top;
// height
- (void)setHeight:(CGFloat)height;
- (void)heightEqualToView:(UIView *)view;
// width
- (void)setWidth:(CGFloat)width;
- (void)widthEqualToView:(UIView *)view;
// center
- (void)setCenterX:(CGFloat)centerX;
- (void)setCenterY:(CGFloat)centerY;
- (void)centerXEqualToView:(UIView *)view;
- (void)centerYEqualToView:(UIView *)view;
// top, bottom, left, right
- (void)top:(CGFloat)top FromView:(UIView *)view;
- (void)bottom:(CGFloat)bottom FromView:(UIView *)view;
- (void)left:(CGFloat)left FromView:(UIView *)view;
- (void)right:(CGFloat)right FromView:(UIView *)view;
- (void)topRatio:(CGFloat)top FromView:(UIView *)view screenType:(UIScreenType)screenType;
- (void)bottomRatio:(CGFloat)bottom FromView:(UIView *)view screenType:(UIScreenType)screenType;
- (void)leftRatio:(CGFloat)left FromView:(UIView *)view screenType:(UIScreenType)screenType;
- (void)rightRatio:(CGFloat)right FromView:(UIView *)view screenType:(UIScreenType)screenType;
- (void)topInContainer:(CGFloat)top shouldResize:(BOOL)shouldResize;
- (void)bottomInContainer:(CGFloat)bottom shouldResize:(BOOL)shouldResize;
- (void)leftInContainer:(CGFloat)left shouldResize:(BOOL)shouldResize;
- (void)rightInContainer:(CGFloat)right shouldResize:(BOOL)shouldResize;
- (void)topRatioInContainer:(CGFloat)top shouldResize:(BOOL)shouldResize screenType:(UIScreenType)screenType;
- (void)bottomRatioInContainer:(CGFloat)bottom shouldResize:(BOOL)shouldResize screenType:(UIScreenType)screenType;
- (void)leftRatioInContainer:(CGFloat)left shouldResize:(BOOL)shouldResize screenType:(UIScreenType)screenType;
- (void)rightRatioInContainer:(CGFloat)right shouldResize:(BOOL)shouldResize screenType:(UIScreenType)screenType;
- (void)topEqualToView:(UIView *)view;
- (void)bottomEqualToView:(UIView *)view;
- (void)leftEqualToView:(UIView *)view;
- (void)rightEqualToView:(UIView *)view;
// size
- (void)setSize:(CGSize)size;
- (void)sizeEqualToView:(UIView *)view;
// imbueset
- (void)fillWidth;
- (void)fillHeight;
- (void)fill;
//最顶上的View
- (UIView *)topSuperView;
//从XIB中加载
+ (instancetype)FromXIB;
/**
Create a snapshot image of the complete view hierarchy. 截屏成图片
*/
- (nullable UIImage *)snapshotImage;
/**
Create a snapshot image of the complete view hierarchy.
@discussion It's faster than "snapshotImage", but may cause screen updates.
See -[UIView drawViewHierarchyInRect:afterScreenUpdates:] for more information.
*/
- (nullable UIImage *)snapshotImageAfterScreenUpdates:(BOOL)afterUpdates;
/**
Create a snapshot PDF of the complete view hierarchy. 截屏成PDF
*/
- (nullable NSData *)snapshotPDF;
/**
Shortcut to set the view.layer's shadow
@param color Shadow Color
@param offset Shadow offset
@param radius Shadow radius
*/
- (void)setLayerShadow:(nullable UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius;
/**
Remove all subviews.
@warning Never call this method inside your view's drawRect: method.
*/
- (void)removeAllSubviews;
@property (nullable, nonatomic, readonly) UIViewController *viewController;
- (UIView *)findFirstResponder;
/**
设置上边圆角
*/
- (void)setCornerOnTop:(CGFloat) conner;
/**
设置下边圆角
*/
- (void)setCornerOnBottom:(CGFloat) conner;
/**
设置左边圆角
*/
- (void)setCornerOnLeft:(CGFloat) conner;
/**
设置右边圆角
*/
- (void)setCornerOnRight:(CGFloat) conner;
/**
设置左上圆角
*/
- (void)setCornerOnTopLeft:(CGFloat) conner;
/**
设置右上圆角
*/
- (void)setCornerOnTopRight:(CGFloat) conner;
/**
设置左下圆角
*/
- (void)setCornerOnBottomLeft:(CGFloat) conner;
/**
设置右下圆角
*/
- (void)setCornerOnBottomRight:(CGFloat) conner;
/**
设置所有圆角
*/
- (void)setAllCorner:(CGFloat) conner;
@end
NS_ASSUME_NONNULL_END
|
/*
* mpos-ui : http://www.payworks.com
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Payworks GmbH
*
* 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.
*/
#import <UIKit/UIKit.h>
#import "MPUMposUi_Internal.h"
@interface MPUAbstractController : UIViewController
@property (nonatomic, weak) MPUMposUi *mposUi;
@end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.