text stringlengths 4 6.14k |
|---|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <pthread.h>
#include "zdtmtst.h"
#define gettid() pthread_self()
const char *test_doc = "Create a few pthreads and test TLS + blocked signals\n";
const char *test_author = "Cyrill Gorcunov <gorcunov@openvz.org";
static __thread struct tls_data_s {
char *rand_string[10];
sigset_t blk_sigset;
} tls_data;
static task_waiter_t t1;
static task_waiter_t t2;
static char *decode_signal(const sigset_t *s, char *buf)
{
buf[0] = '\0';
#define COLLECT(sig) \
do { \
if ((long)s->__val[0] & (long)sigmask(sig)) \
strcat(buf, #sig " "); \
} while (0)
COLLECT(SIGHUP); COLLECT(SIGINT); COLLECT(SIGQUIT); COLLECT(SIGILL); COLLECT(SIGTRAP);
COLLECT(SIGABRT); COLLECT(SIGIOT); COLLECT(SIGBUS); COLLECT(SIGFPE); COLLECT(SIGKILL);
COLLECT(SIGUSR1); COLLECT(SIGSEGV); COLLECT(SIGUSR2); COLLECT(SIGPIPE); COLLECT(SIGALRM);
COLLECT(SIGTERM); COLLECT(SIGSTKFLT); COLLECT(SIGCHLD); COLLECT(SIGCONT); COLLECT(SIGSTOP);
COLLECT(SIGTSTP); COLLECT(SIGTTIN); COLLECT(SIGTTOU); COLLECT(SIGURG); COLLECT(SIGXCPU);
COLLECT(SIGXFSZ); COLLECT(SIGVTALRM); COLLECT(SIGPROF); COLLECT(SIGWINCH); COLLECT(SIGIO);
COLLECT(SIGPOLL); COLLECT(SIGPWR); COLLECT(SIGSYS); COLLECT(SIGUNUSED);
#undef COLLECT
return buf;
}
static void __show_sigset(int line, const sigset_t *s)
{
char buf[sizeof(sigset_t) * 2 + 1] = { };
decode_signal(s, buf);
test_msg("sigset at %4d: %s\n", line, buf);
}
#define show_sigset(set) __show_sigset(__LINE__, set)
static void *ch_thread_2(void *arg)
{
char __tls_data[sizeof(tls_data.rand_string)] = "XM5o:?B*[a";
int *results_map = arg;
sigset_t blk_sigset = { };
sigset_t new = { };
memcpy(tls_data.rand_string, __tls_data, sizeof(tls_data.rand_string));
sigemptyset(&blk_sigset);
pthread_sigmask(SIG_SETMASK, NULL, &blk_sigset);
sigaddset(&blk_sigset, SIGFPE);
pthread_sigmask(SIG_SETMASK, &blk_sigset, NULL);
memcpy(&tls_data.blk_sigset, &blk_sigset, sizeof(tls_data.blk_sigset));
show_sigset(&blk_sigset);
show_sigset(&tls_data.blk_sigset);
task_waiter_complete(&t2, 1);
task_waiter_wait4(&t2, 2);
if (memcmp(tls_data.rand_string, __tls_data, sizeof(tls_data.rand_string))) {
pr_perror("Failed to restore tls_data.rand_string in thread 2");
results_map[2] = -1;
} else
results_map[2] = 1;
if (memcmp(&tls_data.blk_sigset, &blk_sigset, sizeof(tls_data.blk_sigset))) {
pr_perror("Failed to restore tls_data.blk_sigset in thread 2");
results_map[4] = -1;
} else
results_map[4] = 1;
pthread_sigmask(SIG_SETMASK, NULL, &new);
if (memcmp(&tls_data.blk_sigset, &new, sizeof(tls_data.blk_sigset))) {
pr_perror("Failed to restore blk_sigset in thread 2");
results_map[6] = -1;
show_sigset(&tls_data.blk_sigset);
show_sigset(&new);
} else
results_map[6] = 1;
return NULL;
}
static void *ch_thread_1(void *arg)
{
char __tls_data[sizeof(tls_data.rand_string)] = "pffYQSBo?6";
int *results_map = arg;
sigset_t blk_sigset = { };
sigset_t new = { };
memcpy(tls_data.rand_string, __tls_data, sizeof(tls_data.rand_string));
sigemptyset(&blk_sigset);
pthread_sigmask(SIG_SETMASK, NULL, &blk_sigset);
sigaddset(&blk_sigset, SIGWINCH);
sigaddset(&blk_sigset, SIGALRM);
pthread_sigmask(SIG_SETMASK, &blk_sigset, NULL);
memcpy(&tls_data.blk_sigset, &blk_sigset, sizeof(tls_data.blk_sigset));
show_sigset(&blk_sigset);
show_sigset(&tls_data.blk_sigset);
task_waiter_complete(&t1, 1);
task_waiter_wait4(&t1, 2);
if (memcmp(tls_data.rand_string, __tls_data, sizeof(tls_data.rand_string))) {
pr_perror("Failed to restore tls_data.rand_string in thread 1");
results_map[1] = -1;
} else
results_map[1] = 1;
if (memcmp(&tls_data.blk_sigset, &blk_sigset, sizeof(tls_data.blk_sigset))) {
pr_perror("Failed to restore tls_data.blk_sigset in thread 1");
results_map[3] = -1;
} else
results_map[3] = 1;
sigemptyset(&new);
pthread_sigmask(SIG_SETMASK, NULL, &new);
if (memcmp(&tls_data.blk_sigset, &new, sizeof(tls_data.blk_sigset))) {
pr_perror("Failed to restore blk_sigset in thread 1");
results_map[5] = -1;
show_sigset(&tls_data.blk_sigset);
show_sigset(&new);
} else
results_map[5] = 1;
return NULL;
}
int main(int argc, char *argv[])
{
pthread_t thread_1, thread_2;
int *results_map;
int rc1, rc2;
test_init(argc, argv);
task_waiter_init(&t1);
task_waiter_init(&t2);
test_msg("%s pid %d\n", argv[0], getpid());
results_map = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
if ((void *)results_map == MAP_FAILED) {
fail("Can't map");
exit(1);
}
rc1 = pthread_create(&thread_1, NULL, &ch_thread_1, results_map);
rc2 = pthread_create(&thread_2, NULL, &ch_thread_2, results_map);
if (rc1 | rc2) {
fail("Can't pthread_create");
exit(1);
}
test_msg("Waiting until all threads are created\n");
task_waiter_wait4(&t1, 1);
task_waiter_wait4(&t2, 1);
test_daemon();
test_waitsig();
task_waiter_complete(&t1, 2);
task_waiter_complete(&t2, 2);
test_msg("Waiting while all threads are joined\n");
pthread_join(thread_1, NULL);
pthread_join(thread_2, NULL);
if (results_map[1] == 1 &&
results_map[2] == 1 &&
results_map[3] == 1 &&
results_map[4] == 1 &&
results_map[5] == 1 &&
results_map[6] == 1)
pass();
else
fail();
return 0;
}
|
/*
Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
2004, 2005, 2006 Rob Buis <buis@kde.org>
This file is part of the KDE project
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef SVGAnimatedPathData_h
#define SVGAnimatedPathData_h
#if ENABLE(SVG)
namespace WebCore
{
class SVGPathSegList;
class SVGAnimatedPathData
{
public:
SVGAnimatedPathData();
virtual ~SVGAnimatedPathData();
// 'SVGAnimatedPathData' functions
virtual SVGPathSegList* pathSegList() const = 0;
virtual SVGPathSegList* normalizedPathSegList() const = 0;
virtual SVGPathSegList* animatedPathSegList() const = 0;
virtual SVGPathSegList* animatedNormalizedPathSegList() const = 0;
};
} // namespace WebCore
#endif // ENABLE(SVG)
#endif
// vim:ts=4:noet
|
/*
* Copyright (C) 2007, 2008 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 COMPUTER, 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 COMPUTER, 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 FontSelector_h
#define FontSelector_h
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
class FontData;
class FontDescription;
class FontSelectorClient;
class FontSelector : public RefCounted<FontSelector> {
public:
virtual ~FontSelector() { }
virtual PassRefPtr<FontData> getFontData(const FontDescription&, const AtomicString& familyName) = 0;
virtual void fontCacheInvalidated() { }
virtual void registerForInvalidationCallbacks(FontSelectorClient*) = 0;
virtual void unregisterForInvalidationCallbacks(FontSelectorClient*) = 0;
virtual unsigned version() const = 0;
};
class FontSelectorClient {
public:
virtual ~FontSelectorClient() { }
virtual void fontsNeedUpdate(FontSelector*) = 0;
};
} // namespace WebCore
#endif // FontSelector_h
|
// Copyright 2012 Cloudera Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef IMPALA_TESTUTIL_ROW_DESC_BUILDER_H_
#define IMPALA_TESTUTIL_ROW_DESC_BUILDER_H_
#include "runtime/runtime-state.h"
namespace impala {
class ObjectPool;
class TupleDescBuilder;
// Aids in the construction of a DescriptorTbl by declaring tuples and slots
// associated with those tuples.
// TupleIds are monotonically increasing from 0 for each DeclareTuple, and
// SlotIds increase similarly, but are always greater than all TupleIds.
// Unlike FE, slots are not reordered based on size, and padding is not addded.
//
// Example usage:
// DescriptorTblBuilder builder;
// builder.DeclareTuple() << TYPE_TINYINT << TYPE_TIMESTAMP; // gets TupleId 0
// builder.DeclareTuple() << TYPE_FLOAT; // gets TupleId 1
// DescriptorTbl desc_tbl = builder.Build();
class DescriptorTblBuilder {
public:
DescriptorTblBuilder(ObjectPool* object_pool);
TupleDescBuilder& DeclareTuple();
DescriptorTbl* Build();
private:
// Owned by caller.
ObjectPool* obj_pool_;
std::vector<TupleDescBuilder*> tuples_descs_;
};
class TupleDescBuilder {
public:
TupleDescBuilder& operator<< (ColumnType slot_type) {
slot_types_.push_back(slot_type);
return *this;
}
std::vector<ColumnType> slot_types() const { return slot_types_; }
private:
std::vector<ColumnType> slot_types_;
};
}
#endif
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SERVICES_SKY_DART_LIBRARY_PROVIDER_IMPL_H_
#define SERVICES_SKY_DART_LIBRARY_PROVIDER_IMPL_H_
#include "base/memory/scoped_ptr.h"
#include "sky/shell/dart/dart_library_provider_network.h"
namespace sky {
class DartLibraryProviderImpl : public shell::DartLibraryProviderNetwork {
public:
struct PrefetchedLibrary {
PrefetchedLibrary();
~PrefetchedLibrary();
std::string name;
mojo::ScopedDataPipeConsumerHandle pipe;
};
explicit DartLibraryProviderImpl(mojo::NetworkService* network_service,
scoped_ptr<PrefetchedLibrary> prefetched);
~DartLibraryProviderImpl() override;
private:
void GetLibraryAsStream(const std::string& name,
blink::DataPipeConsumerCallback callback) override;
scoped_ptr<PrefetchedLibrary> prefetched_library_;
DISALLOW_COPY_AND_ASSIGN(DartLibraryProviderImpl);
};
} // namespace sky
#endif // SERVICES_SKY_DART_LIBRARY_PROVIDER_IMPL_H_
|
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
/*
* recursiveassign.c
* testObjects
*
* Created by Blaine Garst on 12/3/08.
*
*/
// CONFIG rdar://6639533
// The compiler is prefetching x->forwarding before evaluting code that recomputes forwarding and so the value goes to a place that is never seen again.
#include <stdio.h>
#include <stdlib.h>
#include <Block.h>
int main(int argc, char* argv[]) {
__block void (^recursive_copy_block)(int) = ^(int arg) { printf("got wrong Block\n"); exit(1); };
recursive_copy_block = Block_copy(^(int i) {
if (i > 0) {
recursive_copy_block(i - 1);
}
else {
printf("done!\n");
}
});
recursive_copy_block(5);
printf("%s: Success\n", argv[0]);
return 0;
}
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Defines a simple float vector class. This class is used to indicate a
// distance in two dimensions between two points. Subtracting two points should
// produce a vector, and adding a vector to a point produces the point at the
// vector's distance from the original point.
#ifndef UI_GFX_GEOMETRY_VECTOR2D_F_H_
#define UI_GFX_GEOMETRY_VECTOR2D_F_H_
#include <string>
#include "ui/gfx/gfx_export.h"
namespace gfx {
class GFX_EXPORT Vector2dF {
public:
Vector2dF() : x_(0), y_(0) {}
Vector2dF(float x, float y) : x_(x), y_(y) {}
float x() const { return x_; }
void set_x(float x) { x_ = x; }
float y() const { return y_; }
void set_y(float y) { y_ = y; }
// True if both components of the vector are 0.
bool IsZero() const;
// Add the components of the |other| vector to the current vector.
void Add(const Vector2dF& other);
// Subtract the components of the |other| vector from the current vector.
void Subtract(const Vector2dF& other);
void operator+=(const Vector2dF& other) { Add(other); }
void operator-=(const Vector2dF& other) { Subtract(other); }
void SetToMin(const Vector2dF& other) {
x_ = x_ <= other.x_ ? x_ : other.x_;
y_ = y_ <= other.y_ ? y_ : other.y_;
}
void SetToMax(const Vector2dF& other) {
x_ = x_ >= other.x_ ? x_ : other.x_;
y_ = y_ >= other.y_ ? y_ : other.y_;
}
// Gives the square of the diagonal length of the vector.
double LengthSquared() const;
// Gives the diagonal length of the vector.
float Length() const;
// Scale the x and y components of the vector by |scale|.
void Scale(float scale) { Scale(scale, scale); }
// Scale the x and y components of the vector by |x_scale| and |y_scale|
// respectively.
void Scale(float x_scale, float y_scale);
std::string ToString() const;
private:
float x_;
float y_;
};
inline bool operator==(const Vector2dF& lhs, const Vector2dF& rhs) {
return lhs.x() == rhs.x() && lhs.y() == rhs.y();
}
inline bool operator!=(const Vector2dF& lhs, const Vector2dF& rhs) {
return !(lhs == rhs);
}
inline Vector2dF operator-(const Vector2dF& v) {
return Vector2dF(-v.x(), -v.y());
}
inline Vector2dF operator+(const Vector2dF& lhs, const Vector2dF& rhs) {
Vector2dF result = lhs;
result.Add(rhs);
return result;
}
inline Vector2dF operator-(const Vector2dF& lhs, const Vector2dF& rhs) {
Vector2dF result = lhs;
result.Add(-rhs);
return result;
}
// Return the cross product of two vectors.
GFX_EXPORT double CrossProduct(const Vector2dF& lhs, const Vector2dF& rhs);
// Return the dot product of two vectors.
GFX_EXPORT double DotProduct(const Vector2dF& lhs, const Vector2dF& rhs);
// Return a vector that is |v| scaled by the given scale factors along each
// axis.
GFX_EXPORT Vector2dF ScaleVector2d(const Vector2dF& v,
float x_scale,
float y_scale);
// Return a vector that is |v| scaled by the given scale factor.
inline Vector2dF ScaleVector2d(const Vector2dF& v, float scale) {
return ScaleVector2d(v, scale, scale);
}
} // namespace gfx
#endif // UI_GFX_GEOMETRY_VECTOR2D_F_H_
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef ULTIMA4_CONTROLLERS_REAGENTS_MENU_CONTROLLER_H
#define ULTIMA4_CONTROLLERS_REAGENTS_MENU_CONTROLLER_H
#include "ultima/ultima4/controllers/menu_controller.h"
namespace Ultima {
namespace Ultima4 {
class Ingredients;
/**
* Controller for the reagents menu used when mixing spells. Fills
* the passed in Ingredients with the selected reagents.
*/
class ReagentsMenuController : public MenuController {
public:
ReagentsMenuController(Menu *menu, Ingredients *i, TextView *view) : MenuController(menu, view), _ingredients(i) { }
/**
* Handles spell mixing for the Ultima V-style menu-system
*/
bool keyPressed(int key) override;
void keybinder(KeybindingAction action) override;
private:
Ingredients *_ingredients;
};
} // End of namespace Ultima4
} // End of namespace Ultima
#endif
|
#ifndef _PARSE_ARG_H
#define _PARSE_ARG_H
#include <stdlib.h>
#define PATH_LEN 128
#define ID_MAX_LEN 64
#define PWD_MAX_LEN 64
#define URL_MAX_LEN 128
#define FLAG_LEN 2
#define PORT_LEN 8
int parse_arg(int argc, char* argv[] );
int get_arg_field(char* field, char* ret_val );
void dump_arg();
#endif
|
/* libFLAC - Free Lossless Audio Codec
* Copyright (C) 2002-2009 Josh Coalson
* Copyright (C) 2011-2016 Xiph.Org Foundation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of the Xiph.org Foundation nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 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 FLAC__PRIVATE__OGG_ENCODER_ASPECT_H
#define FLAC__PRIVATE__OGG_ENCODER_ASPECT_H
#include <ogg/ogg.h>
#include "FLAC/ordinals.h"
#include "FLAC/stream_encoder.h" /* for FLAC__StreamEncoderWriteStatus */
typedef struct FLAC__OggEncoderAspect {
/* these are storage for values that can be set through the API */
long serial_number;
uint32_t num_metadata;
/* these are for internal state related to Ogg encoding */
ogg_stream_state stream_state;
ogg_page page;
FLAC__bool seen_magic; /* true if we've seen the fLaC magic in the write callback yet */
FLAC__bool is_first_packet;
FLAC__uint64 samples_written;
} FLAC__OggEncoderAspect;
void FLAC__ogg_encoder_aspect_set_serial_number(FLAC__OggEncoderAspect *aspect, long value);
FLAC__bool FLAC__ogg_encoder_aspect_set_num_metadata(FLAC__OggEncoderAspect *aspect, uint32_t value);
void FLAC__ogg_encoder_aspect_set_defaults(FLAC__OggEncoderAspect *aspect);
FLAC__bool FLAC__ogg_encoder_aspect_init(FLAC__OggEncoderAspect *aspect);
void FLAC__ogg_encoder_aspect_finish(FLAC__OggEncoderAspect *aspect);
typedef FLAC__StreamEncoderWriteStatus (*FLAC__OggEncoderAspectWriteCallbackProxy)(const void *encoder, const FLAC__byte buffer[], size_t bytes, uint32_t samples, uint32_t current_frame, void *client_data);
FLAC__StreamEncoderWriteStatus FLAC__ogg_encoder_aspect_write_callback_wrapper(FLAC__OggEncoderAspect *aspect, const FLAC__byte buffer[], size_t bytes, uint32_t samples, uint32_t current_frame, FLAC__bool is_last_block, FLAC__OggEncoderAspectWriteCallbackProxy write_callback, void *encoder, void *client_data);
#endif
|
/* net/atm/common.h - ATM sockets (common part for PVC and SVC) */
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
#ifndef NET_ATM_COMMON_H
#define NET_ATM_COMMON_H
#include <linux/net.h>
#include <linux/poll.h> /* for poll_table */
int vcc_create(struct socket *sock, int protocol, int family);
int vcc_release(struct socket *sock);
int vcc_connect(struct socket *sock, int itf, short vpi, int vci);
int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
size_t size, int flags);
int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
size_t total_len);
unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait);
int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
int vcc_setsockopt(struct socket *sock, int level, int optname,
char __user *optval, int optlen);
int vcc_getsockopt(struct socket *sock, int level, int optname,
char __user *optval, int __user *optlen);
int atmpvc_init(void);
void atmpvc_exit(void);
int atmsvc_init(void);
void atmsvc_exit(void);
int atm_sysfs_init(void);
void atm_sysfs_exit(void);
#ifdef CONFIG_PROC_FS
int atm_proc_init(void);
void atm_proc_exit(void);
#else
static inline int atm_proc_init(void)
{
return 0;
}
static inline void atm_proc_exit(void)
{
/* nothing */
}
#endif /* CONFIG_PROC_FS */
/* SVC */
int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos);
void atm_dev_release_vccs(struct atm_dev *dev);
#endif
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QFINALSTATE_H
#define QFINALSTATE_H
#include <QtCore/qabstractstate.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_STATEMACHINE
class QFinalStatePrivate;
class Q_CORE_EXPORT QFinalState : public QAbstractState
{
Q_OBJECT
public:
QFinalState(QState *parent = 0);
~QFinalState();
protected:
void onEntry(QEvent *event) Q_DECL_OVERRIDE;
void onExit(QEvent *event) Q_DECL_OVERRIDE;
bool event(QEvent *e) Q_DECL_OVERRIDE;
private:
Q_DISABLE_COPY(QFinalState)
Q_DECLARE_PRIVATE(QFinalState)
};
#endif //QT_NO_STATEMACHINE
QT_END_NAMESPACE
#endif
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SANDBOX_WOW_HELPER_SERVICE64_RESOLVER_H__
#define SANDBOX_WOW_HELPER_SERVICE64_RESOLVER_H__
#include "sandbox/src/nt_internals.h"
#include "sandbox/src/resolver.h"
namespace sandbox {
// This is the concrete resolver used to perform service-call type functions
// inside ntdll.dll (64-bit).
class Service64ResolverThunk : public ResolverThunk {
public:
// The service resolver needs a child process to write to.
explicit Service64ResolverThunk(HANDLE process)
: process_(process), ntdll_base_(NULL) {}
virtual ~Service64ResolverThunk() {}
// Implementation of Resolver::Setup.
virtual NTSTATUS Setup(const void* target_module,
const void* interceptor_module,
const char* target_name,
const char* interceptor_name,
const void* interceptor_entry_point,
void* thunk_storage,
size_t storage_bytes,
size_t* storage_used);
// Implementation of Resolver::ResolveInterceptor.
virtual NTSTATUS ResolveInterceptor(const void* module,
const char* function_name,
const void** address);
// Implementation of Resolver::ResolveTarget.
virtual NTSTATUS ResolveTarget(const void* module,
const char* function_name,
void** address);
// Implementation of Resolver::GetThunkSize.
virtual size_t GetThunkSize() const;
protected:
// The unit test will use this member to allow local patch on a buffer.
HMODULE ntdll_base_;
// Handle of the child process.
HANDLE process_;
private:
// Returns true if the code pointer by target_ corresponds to the expected
// type of function. Saves that code on the first part of the thunk pointed
// by local_thunk (should be directly accessible from the parent).
virtual bool IsFunctionAService(void* local_thunk) const;
// Performs the actual patch of target_.
// local_thunk must be already fully initialized, and the first part must
// contain the original code. The real type of this buffer is ServiceFullThunk
// (yes, private). remote_thunk (real type ServiceFullThunk), must be
// allocated on the child, and will contain the thunk data, after this call.
// Returns the apropriate status code.
virtual NTSTATUS PerformPatch(void* local_thunk, void* remote_thunk);
DISALLOW_COPY_AND_ASSIGN(Service64ResolverThunk);
};
} // namespace sandbox
#endif // SANDBOX_WOW_HELPER_SERVICE64_RESOLVER_H__
|
//
// _ASAsyncTransactionContainer+Private.h
// AsyncDisplayKit
//
// Copyright (c) 2014-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 <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
NS_ASSUME_NONNULL_BEGIN
@class _ASAsyncTransaction;
@interface CALayer (ASAsyncTransactionContainerTransactions)
@property (nonatomic, strong, nullable, setter=asyncdisplaykit_setAsyncLayerTransactions:) NSHashTable<_ASAsyncTransaction *> *asyncdisplaykit_asyncLayerTransactions;
- (void)asyncdisplaykit_asyncTransactionContainerWillBeginTransaction:(_ASAsyncTransaction *)transaction;
- (void)asyncdisplaykit_asyncTransactionContainerDidCompleteTransaction:(_ASAsyncTransaction *)transaction;
@end
NS_ASSUME_NONNULL_END
|
/* { dg-do compile { target { powerpc*-*-linux* } } } */
/* { dg-require-effective-target hard_dfp } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
/* { dg-options "-mcpu=power7 -O2" } */
/* { dg-final { scan-assembler-times "ddedpd " 4 } } */
/* { dg-final { scan-assembler-times "denbcd " 2 } } */
/* { dg-final { scan-assembler-times "dxex " 1 } } */
/* { dg-final { scan-assembler-times "diex " 1 } } */
/* { dg-final { scan-assembler-times "dscli " 2 } } */
/* { dg-final { scan-assembler-times "dscri " 2 } } */
/* { dg-final { scan-assembler-times "std " 1 { target lp64 } } } */
/* { dg-final { scan-assembler-times "ld " 1 { target lp64 } } } */
/* 32-bit needs a stack frame, and needs two GPR mem insns per _Decimal64. */
/* { dg-final { scan-assembler-times "stwu " 2 { target ilp32 } } } */
/* { dg-final { scan-assembler-times "stw " 2 { target ilp32 } } } */
/* { dg-final { scan-assembler-times "lwz " 2 { target ilp32 } } } */
/* { dg-final { scan-assembler-times "stfd " 1 } } */
/* { dg-final { scan-assembler-times "lfd " 1 } } */
/* { dg-final { scan-assembler-not "bl __builtin" } } */
/* { dg-final { scan-assembler-not "dctqpq" } } */
/* { dg-final { scan-assembler-not "drdpq" } } */
_Decimal64
do_dedpd_0 (_Decimal64 a)
{
return __builtin_ddedpd (0, a);
}
_Decimal64
do_dedpd_1 (_Decimal64 a)
{
return __builtin_ddedpd (1, a);
}
_Decimal64
do_dedpd_2 (_Decimal64 a)
{
return __builtin_ddedpd (2, a);
}
_Decimal64
do_dedpd_3 (_Decimal64 a)
{
return __builtin_ddedpd (3, a);
}
_Decimal64
do_enbcd_0 (_Decimal64 a)
{
return __builtin_denbcd (0, a);
}
_Decimal64
do_enbcd_1 (_Decimal64 a)
{
return __builtin_denbcd (1, a);
}
long long
do_xex (_Decimal64 a)
{
return __builtin_dxex (a);
}
_Decimal64
do_iex (long long a, _Decimal64 b)
{
return __builtin_diex (a, b);
}
_Decimal64
do_scli_1 (_Decimal64 a)
{
return __builtin_dscli (a, 1);
}
_Decimal64
do_scli_10 (_Decimal64 a)
{
return __builtin_dscli (a, 10);
}
_Decimal64
do_scri_1 (_Decimal64 a)
{
return __builtin_dscri (a, 1);
}
_Decimal64
do_scri_10 (_Decimal64 a)
{
return __builtin_dscri (a, 10);
}
|
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
/* { dg-require-effective-target lp64 } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
/* { dg-options "-mcpu=power9" } */
#include <stddef.h>
#include <altivec.h>
void
store_data (vector unsigned int *datap, unsigned int *address, size_t length)
{
vector unsigned int data = *datap;
vec_xst_len (data, address, length);
}
/* { dg-final { scan-assembler "sldi" } } */
/* { dg-final { scan-assembler "stxvl" } } */
|
#ifndef CONFIG_SIDEBAND_H
#define CONFIG_SIDEBAND_H
/** @file
*
* Sideband access by platform firmware
*
*/
FILE_LICENCE ( GPL2_OR_LATER );
//#define CONFIG_BOFM /* IBM's BladeCenter Open Fabric Manager */
//#define VMWARE_SETTINGS /* VMware GuestInfo settings */
#endif /* CONFIG_SIDEBAND_H */
|
/*
* Copyright (C) 2012 ARM Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __ASM_ELF_H
#define __ASM_ELF_H
#include <asm/hwcap.h>
/*
* ELF register definitions..
*/
#include <asm/ptrace.h>
#include <asm/user.h>
/*
* AArch64 static relocation types.
*/
/* Miscellaneous. */
#define R_ARM_NONE 0
#define R_AARCH64_NONE 256
/* Data. */
#define R_AARCH64_ABS64 257
#define R_AARCH64_ABS32 258
#define R_AARCH64_ABS16 259
#define R_AARCH64_PREL64 260
#define R_AARCH64_PREL32 261
#define R_AARCH64_PREL16 262
/* Instructions. */
#define R_AARCH64_MOVW_UABS_G0 263
#define R_AARCH64_MOVW_UABS_G0_NC 264
#define R_AARCH64_MOVW_UABS_G1 265
#define R_AARCH64_MOVW_UABS_G1_NC 266
#define R_AARCH64_MOVW_UABS_G2 267
#define R_AARCH64_MOVW_UABS_G2_NC 268
#define R_AARCH64_MOVW_UABS_G3 269
#define R_AARCH64_MOVW_SABS_G0 270
#define R_AARCH64_MOVW_SABS_G1 271
#define R_AARCH64_MOVW_SABS_G2 272
#define R_AARCH64_LD_PREL_LO19 273
#define R_AARCH64_ADR_PREL_LO21 274
#define R_AARCH64_ADR_PREL_PG_HI21 275
#define R_AARCH64_ADR_PREL_PG_HI21_NC 276
#define R_AARCH64_ADD_ABS_LO12_NC 277
#define R_AARCH64_LDST8_ABS_LO12_NC 278
#define R_AARCH64_TSTBR14 279
#define R_AARCH64_CONDBR19 280
#define R_AARCH64_JUMP26 282
#define R_AARCH64_CALL26 283
#define R_AARCH64_LDST16_ABS_LO12_NC 284
#define R_AARCH64_LDST32_ABS_LO12_NC 285
#define R_AARCH64_LDST64_ABS_LO12_NC 286
#define R_AARCH64_LDST128_ABS_LO12_NC 299
#define R_AARCH64_MOVW_PREL_G0 287
#define R_AARCH64_MOVW_PREL_G0_NC 288
#define R_AARCH64_MOVW_PREL_G1 289
#define R_AARCH64_MOVW_PREL_G1_NC 290
#define R_AARCH64_MOVW_PREL_G2 291
#define R_AARCH64_MOVW_PREL_G2_NC 292
#define R_AARCH64_MOVW_PREL_G3 293
#define R_AARCH64_RELATIVE 1027
/*
* These are used to set parameters in the core dumps.
*/
#define ELF_CLASS ELFCLASS64
#ifdef __AARCH64EB__
#define ELF_DATA ELFDATA2MSB
#else
#define ELF_DATA ELFDATA2LSB
#endif
#define ELF_ARCH EM_AARCH64
/*
* This yields a string that ld.so will use to load implementation
* specific libraries for optimization. This is more specific in
* intent than poking at uname or /proc/cpuinfo.
*/
#define ELF_PLATFORM_SIZE 16
#ifdef __AARCH64EB__
#define ELF_PLATFORM ("aarch64_be")
#else
#define ELF_PLATFORM ("aarch64")
#endif
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
#define elf_check_arch(x) ((x)->e_machine == EM_AARCH64)
#define elf_read_implies_exec(ex,stk) (stk != EXSTACK_DISABLE_X)
#define CORE_DUMP_USE_REGSET
#define ELF_EXEC_PAGESIZE PAGE_SIZE
/*
* This is the base location for PIE (ET_DYN with INTERP) loads. On
* 64-bit, this is above 4GB to leave the entire 32-bit address
* space open for things that want to use the area for 32-bit pointers.
*/
#define ELF_ET_DYN_BASE (2 * TASK_SIZE_64 / 3)
#ifndef __ASSEMBLY__
typedef unsigned long elf_greg_t;
#define ELF_NGREG (sizeof(struct user_pt_regs) / sizeof(elf_greg_t))
#define ELF_CORE_COPY_REGS(dest, regs) \
*(struct user_pt_regs *)&(dest) = (regs)->user_regs;
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
typedef struct user_fpsimd_state elf_fpregset_t;
/*
* When the program starts, a1 contains a pointer to a function to be
* registered with atexit, as per the SVR4 ABI. A value of 0 means we have no
* such handler.
*/
#define ELF_PLAT_INIT(_r, load_addr) (_r)->regs[0] = 0
#define SET_PERSONALITY(ex) \
({ \
clear_bit(TIF_32BIT, ¤t->mm->context.flags); \
clear_thread_flag(TIF_32BIT); \
current->personality &= ~READ_IMPLIES_EXEC; \
})
/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
#define ARCH_DLINFO \
do { \
NEW_AUX_ENT(AT_SYSINFO_EHDR, \
(elf_addr_t)current->mm->context.vdso); \
} while (0)
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES
struct linux_binprm;
extern int arch_setup_additional_pages(struct linux_binprm *bprm,
int uses_interp);
/* 1GB of VA */
#ifdef CONFIG_COMPAT
#define STACK_RND_MASK (test_thread_flag(TIF_32BIT) ? \
0x7ff >> (PAGE_SHIFT - 12) : \
0x3ffff >> (PAGE_SHIFT - 12))
#else
#define STACK_RND_MASK (0x3ffff >> (PAGE_SHIFT - 12))
#endif
#ifdef __AARCH64EB__
#define COMPAT_ELF_PLATFORM ("v8b")
#else
#define COMPAT_ELF_PLATFORM ("v8l")
#endif
#ifdef CONFIG_COMPAT
/* PIE load location for compat arm. Must match ARM ELF_ET_DYN_BASE. */
#define COMPAT_ELF_ET_DYN_BASE 0x000400000UL
/* AArch32 registers. */
#define COMPAT_ELF_NGREG 18
typedef unsigned int compat_elf_greg_t;
typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG];
/* AArch32 EABI. */
#define EF_ARM_EABI_MASK 0xff000000
#define compat_elf_check_arch(x) (system_supports_32bit_el0() && \
((x)->e_machine == EM_ARM) && \
((x)->e_flags & EF_ARM_EABI_MASK))
#define compat_start_thread compat_start_thread
/*
* Unlike the native SET_PERSONALITY macro, the compat version inherits
* READ_IMPLIES_EXEC across a fork() since this is the behaviour on
* arch/arm/.
*/
#define COMPAT_SET_PERSONALITY(ex) \
({ \
set_bit(TIF_32BIT, ¤t->mm->context.flags); \
set_thread_flag(TIF_32BIT); \
})
#define COMPAT_ARCH_DLINFO
extern int aarch32_setup_vectors_page(struct linux_binprm *bprm,
int uses_interp);
#define compat_arch_setup_additional_pages \
aarch32_setup_vectors_page
#endif /* CONFIG_COMPAT */
#endif /* !__ASSEMBLY__ */
#endif
|
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#import <Cocoa/Cocoa.h>
/* Portions of CPS.h */
typedef struct CPSProcessSerNum
{
UInt32 lo;
UInt32 hi;
} CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
static int gArgc;
static char **gArgv;
static BOOL gFinderLaunch;
static BOOL gCalledAppMainline = FALSE;
@interface SDLApplication : NSApplication
@end
@interface SDLMain : NSObject
@end
/* This is needed in Tiger */
@interface NSApplication(PrBoom)
- (void)setAppleMenu:(NSMenu *)menu;
@end
|
/*
* Copyright (C) 2020 Benjamin Valentin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Test application for the EDBG EUI driver
*
* @author Benjamin Valentin <benjamin.valentin@ml-pa.com>
*
* @}
*/
#include <stdio.h>
#include "edbg_eui.h"
static int test_get_eui64(void)
{
eui64_t e64;
if (edbg_get_eui64(&e64) != 0) {
puts("[FAILED]");
return 1;
}
printf("EUI-64:");
for (unsigned i = 0; i < sizeof(e64.uint8); ++i) {
printf(" %02x", e64.uint8[i]);
}
puts("");
return 0;
}
int main(void)
{
if (test_get_eui64()) {
return -1;
}
puts("[SUCCESS]");
return 0;
}
|
/*
* hsi_driver_if.h
*
* Header for the HSI driver low level interface.
*
* Copyright (C) 2007-2008 Nokia Corporation. All rights reserved.
* Copyright (C) 2009 Texas Instruments, Inc.
*
* Author: Carlos Chinea <carlos.chinea@nokia.com>
* Author: Sebastien JAN <s-jan@ti.com>
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef __HSI_DRIVER_IF_H__
#define __HSI_DRIVER_IF_H__
#include <linux/platform_device.h>
#include <linux/device.h>
#include <linux/clk.h>
#include <linux/notifier.h>
/* The number of ports handled by the driver (MAX:2). Reducing this value
* optimizes the driver memory footprint.
*/
#define HSI_MAX_PORTS 2
/* bit-field definition for allowed controller IDs and channels */
#define ANY_HSI_CONTROLLER -1
/* HSR special divisor values set to control the auto-divisor Rx mode */
#define HSI_HSR_DIVISOR_AUTO 0x1000 /* Activate auto Rx */
#define HSI_SSR_DIVISOR_USE_TIMEOUT 0x1001 /* De-activate auto-Rx (SSI) */
#define HSI_SPEED_LOW_SPEED 0 /* Switch to 96MHz */
#define HSI_SPEED_HI_SPEED 1 /* Switch to 192MHz */
enum {
HSI_EVENT_BREAK_DETECTED = 0,
HSI_EVENT_ERROR,
HSI_EVENT_PRE_SPEED_CHANGE,
HSI_EVENT_POST_SPEED_CHANGE,
HSI_EVENT_CAWAKE_UP,
HSI_EVENT_CAWAKE_DOWN,
HSI_EVENT_HSR_DATAAVAILABLE,
};
enum {
HSI_IOCTL_ACWAKE_DOWN = 0, /* Unset HST ACWAKE line for channel */
HSI_IOCTL_ACWAKE_UP, /* Set HSI wakeup line (acwake) for channel */
HSI_IOCTL_SEND_BREAK, /* Send a HW BREAK frame in FRAME mode */
HSI_IOCTL_GET_ACWAKE, /* Get HST CAWAKE line status */
HSI_IOCTL_FLUSH_RX, /* Force the HSR to idle state */
HSI_IOCTL_FLUSH_TX, /* Force the HST to idle state */
HSI_IOCTL_GET_CAWAKE, /* Get CAWAKE (HSR) line status */
HSI_IOCTL_SET_RX, /* Set HSR configuration */
HSI_IOCTL_GET_RX, /* Get HSR configuration */
HSI_IOCTL_SET_TX, /* Set HST configuration */
HSI_IOCTL_GET_TX, /* Get HST configuration */
HSI_IOCTL_SW_RESET, /* Force a HSI SW RESET */
HSI_IOCTL_GET_FIFO_OCCUPANCY, /* Get amount of words in RX FIFO */
HSI_IOCTL_SET_WAKE_RX_3WIRES_MODE, /* Enable RX wakeup 3-wires mode */
HSI_IOCTL_SET_WAKE_RX_4WIRES_MODE, /* Enable RX wakeup 4-wires mode */
HSI_IOCTL_SET_HI_SPEED, /* Change HSI Fclock (96MHz/192MHz) */
HSI_IOCTL_GET_SPEED, /* Get HSI Fclock (96MHz/192MHz) */
HSI_IOCTL_SET_CLK_FORCE_ON, /* Enter mode where HSI clk are forced on */
HSI_IOCTL_SET_CLK_DYNAMIC, /* Exit from forced clocks on mode */
HSI_IOCTL_SET_HSI_LATENCY, /* Change HSI latency for high tput */
HSI_IOCTL_GET_HSI_LATENCY, /* Get HSI latency */
HSI_IOCTL_SET_MPU_LATENCY, /* Change MPU latency for high tput */
HSI_IOCTL_GET_MPU_LATENCY, /* Get MPU latency */
HSI_IOCTL_GET_TX_STATE_PORT, /* Get HST FSM state for a given port */
};
/* Forward references */
struct hsi_device;
struct hsi_channel;
/* DPS */
struct hst_ctx {
u32 mode;
u32 flow; /* Kept for Legacy: flow is not used for HST */
u32 frame_size;
u32 divisor;
u32 arb_mode;
u32 channels;
};
struct hsr_ctx {
u32 mode;
u32 flow;
u32 frame_size;
u32 divisor;
u32 counters;
u32 channels;
};
struct hsi_port_ctx {
int port_number; /* Range [1, 2] */
u32 sys_mpu_enable[2];
struct hst_ctx hst;
struct hsr_ctx hsr;
};
/**
* struct hsi_ctrl_ctx - hsi controller regs context
* @sysconfig: keeps HSI_SYSCONFIG reg state
* @gdd_gcr: keeps DMA_GCR reg state
* @pctx: array of port context
*/
struct hsi_ctrl_ctx {
u32 sysconfig;
u32 gdd_gcr;
struct hsi_port_ctx *pctx;
};
/* END DPS */
/**
* struct hsi_device - HSI device object (Virtual)
* @n_ctrl: associated HSI controller platform id number
* @n_p: port number [0, 1]
* @n_ch: channel number
* @ch: channel descriptor
* @device: associated device
*/
struct hsi_device {
int n_ctrl;
unsigned int n_p;
unsigned int n_ch;
struct hsi_channel *ch;
struct device device;
};
#define to_hsi_device(dev) container_of(dev, struct hsi_device, device)
/**
* struct hsi_device_driver - HSI driver instance container
* @ctrl_mask: bit-field indicating the supported HSI device ids
* @ch_mask: bit-field indicating enabled channels for this port
* @probe: probe callback (driver registering)
* @remove: remove callback (driver un-registering)
* @suspend: suspend callback
* @resume: resume callback
* @driver: associated device_driver object
*/
struct hsi_device_driver {
unsigned long ctrl_mask;
unsigned long ch_mask[HSI_MAX_PORTS];
int (*probe) (struct hsi_device *dev);
int (*remove) (struct hsi_device *dev);
int (*suspend) (struct hsi_device *dev, pm_message_t mesg);
int (*resume) (struct hsi_device *dev);
struct device_driver driver;
void *priv_data;
};
#define to_hsi_device_driver(drv) container_of(drv, \
struct hsi_device_driver, \
driver)
int hsi_register_driver(struct hsi_device_driver *driver);
void hsi_unregister_driver(struct hsi_device_driver *driver);
int hsi_open(struct hsi_device *dev);
int hsi_write(struct hsi_device *dev, u32 *addr, unsigned int size);
int hsi_write_cancel(struct hsi_device *dev);
int hsi_read(struct hsi_device *dev, u32 *addr, unsigned int size);
int hsi_read_cancel(struct hsi_device *dev);
int hsi_poll(struct hsi_device *dev);
int hsi_unpoll(struct hsi_device *dev);
int hsi_ioctl(struct hsi_device *dev, unsigned int command, void *arg);
void hsi_close(struct hsi_device *dev);
void hsi_set_read_cb(struct hsi_device *dev,
void (*read_cb) (struct hsi_device *dev,
unsigned int size));
void hsi_set_write_cb(struct hsi_device *dev,
void (*write_cb) (struct hsi_device *dev,
unsigned int size));
void hsi_set_port_event_cb(struct hsi_device *dev,
void (*port_event_cb) (struct hsi_device *dev,
unsigned int event,
void *arg));
#endif /* __HSI_DRIVER_IF_H__ */
|
#ifndef _INET_COMMON_H
#define _INET_COMMON_H
#include <net/sock.h>
extern const struct proto_ops inet_stream_ops;
extern const struct proto_ops inet_dgram_ops;
/*
* INET4 prototypes used by INET6
*/
struct msghdr;
struct sock;
struct sockaddr;
struct socket;
extern int inet_create(struct net *net, struct socket *sock, int protocol,
int kern);
extern int inet6_create(struct net *net, struct socket *sock, int protocol,
int kern);
extern int inet_release(struct socket *sock);
extern int inet_stream_connect(struct socket *sock, struct sockaddr * uaddr,
int addr_len, int flags);
extern int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr,
int addr_len, int flags);
extern int inet_accept(struct socket *sock, struct socket *newsock, int flags);
extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size);
extern ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
size_t size, int flags);
extern int inet_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size, int flags);
extern int inet_shutdown(struct socket *sock, int how);
extern int inet_listen(struct socket *sock, int backlog);
extern void inet_sock_destruct(struct sock *sk);
extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
extern int inet_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer);
extern int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
extern int inet_ctl_sock_create(struct sock **sk, unsigned short family,
unsigned short type, unsigned char protocol,
struct net *net);
static inline void inet_ctl_sock_destroy(struct sock *sk)
{
sk_release_kernel(sk);
}
#endif
|
/**************************************************************************//**
* @file efm32pg1b_rtcc_ret.h
* @brief EFM32PG1B_RTCC_RET register and bit field definitions
* @version 4.2.0
******************************************************************************
* @section License
* <b>Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com</b>
******************************************************************************
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software.@n
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.@n
* 3. This notice may not be removed or altered from any source distribution.
*
* DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Laboratories, Inc.
* has no obligation to support this Software. Silicon Laboratories, Inc. is
* providing the Software "AS IS", with no express or implied warranties of any
* kind, including, but not limited to, any implied warranties of
* merchantability or fitness for any particular purpose or warranties against
* infringement of any proprietary rights of a third party.
*
* Silicon Laboratories, Inc. will not be liable for any consequential,
* incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software.
*
*****************************************************************************/
/**************************************************************************//**
* @addtogroup Parts
* @{
******************************************************************************/
/**************************************************************************//**
* @brief RTCC_RET EFM32PG1B RTCC RET
*****************************************************************************/
typedef struct
{
__IO uint32_t REG; /**< Retention register */
} RTCC_RET_TypeDef;
/** @} End of group Parts */
|
//
// ex13_34_36_37.h
// Exercise 13.34 13.36 13.37
//
// Created by pezy on 1/26/15.
//
// 34: Write the Message class as described in this section.
//
// 36: Design and implement the corresponding Folder class. That class should hold a set that points to the Messages in that Folder.
//
// 37: Add members to the Message class to insert or remove a given Folder* into folders.
// These members are analogous to Folder’s addMsg and remMsg operations.
#ifndef CP5_ex13_34_36_37_h
#define CP5_ex13_34_36_37_h
#include <string>
#include <set>
class Folder;
class Message {
friend void swap(Message &, Message &);
friend void swap(Folder &, Folder &);
friend class Folder;
public:
explicit Message(const std::string &str = ""):contents(str) { }
Message(const Message&);
Message& operator=(const Message&);
~Message();
void save(Folder&);
void remove(Folder&);
void print_debug();
private:
std::string contents;
std::set<Folder*> folders;
void add_to_Folders(const Message&);
void remove_from_Folders();
void addFldr(Folder *f) { folders.insert(f); }
void remFldr(Folder *f) { folders.erase(f); }
};
void swap(Message&, Message&);
class Folder {
friend void swap(Message&, Message&);
friend void swap(Folder &, Folder &);
friend class Message;
public:
Folder() = default;
Folder(const Folder &);
Folder& operator=(const Folder &);
~Folder();
void print_debug();
private:
std::set<Message*> msgs;
void add_to_Message(const Folder&);
void remove_to_Message();
void addMsg(Message *m) { msgs.insert(m); }
void remMsg(Message *m) { msgs.erase(m); }
};
void swap(Folder &, Folder &);
#endif // MESSAGE
|
/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#define WCSRCHR __wcsrchr_power7
#include <sysdeps/powerpc/power6/wcsrchr.c>
|
/*
* Copyright (C) 2014-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include <string>
#include <stdint.h>
#include "addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioEncoder.h"
class IEncoder
{
public:
virtual ~IEncoder() = default;
virtual bool Init(AddonToKodiFuncTable_AudioEncoder& callbacks) = 0;
virtual int Encode(int nNumBytesRead, uint8_t* pbtStream) = 0;
virtual bool Close() = 0;
// tag info
std::string m_strComment;
std::string m_strArtist;
std::string m_strAlbumArtist;
std::string m_strTitle;
std::string m_strAlbum;
std::string m_strGenre;
std::string m_strTrack;
std::string m_strYear;
std::string m_strFile;
int m_iTrackLength = 0;
int m_iInChannels = 0;
int m_iInSampleRate = 0;
int m_iInBitsPerSample = 0;
};
|
/*
* 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) 1992-1997,2000-2006 Silicon Graphics, Inc. All rights reserved.
*/
#ifndef _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H
#define _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H
#ifdef XEN
#include <linux/spinlock.h>
#include <linux/linux-pci.h>
#endif
#include <asm/sn/intr.h>
#include <asm/sn/pcibus_provider_defs.h>
/* Workarounds */
#define PV907516 (1 << 1) /* TIOCP: Don't write the write buffer flush reg */
#define BUSTYPE_MASK 0x1
/* Macros given a pcibus structure */
#define IS_PCIX(ps) ((ps)->pbi_bridge_mode & BUSTYPE_MASK)
#define IS_PCI_BRIDGE_ASIC(asic) (asic == PCIIO_ASIC_TYPE_PIC || \
asic == PCIIO_ASIC_TYPE_TIOCP)
#define IS_PIC_SOFT(ps) (ps->pbi_bridge_type == PCIBR_BRIDGETYPE_PIC)
/*
* The different PCI Bridge types supported on the SGI Altix platforms
*/
#define PCIBR_BRIDGETYPE_UNKNOWN -1
#define PCIBR_BRIDGETYPE_PIC 2
#define PCIBR_BRIDGETYPE_TIOCP 3
/*
* Bridge 64bit Direct Map Attributes
*/
#define PCI64_ATTR_PREF (1ull << 59)
#define PCI64_ATTR_PREC (1ull << 58)
#define PCI64_ATTR_VIRTUAL (1ull << 57)
#define PCI64_ATTR_BAR (1ull << 56)
#define PCI64_ATTR_SWAP (1ull << 55)
#define PCI64_ATTR_VIRTUAL1 (1ull << 54)
#define PCI32_LOCAL_BASE 0
#define PCI32_MAPPED_BASE 0x40000000
#define PCI32_DIRECT_BASE 0x80000000
#define IS_PCI32_MAPPED(x) ((u64)(x) < PCI32_DIRECT_BASE && \
(u64)(x) >= PCI32_MAPPED_BASE)
#define IS_PCI32_DIRECT(x) ((u64)(x) >= PCI32_MAPPED_BASE)
/*
* Bridge PMU Address Transaltion Entry Attibutes
*/
#define PCI32_ATE_V (0x1 << 0)
#define PCI32_ATE_CO (0x1 << 1)
#define PCI32_ATE_PREC (0x1 << 2)
#define PCI32_ATE_MSI (0x1 << 2)
#define PCI32_ATE_PREF (0x1 << 3)
#define PCI32_ATE_BAR (0x1 << 4)
#define PCI32_ATE_ADDR_SHFT 12
#define MINIMAL_ATES_REQUIRED(addr, size) \
(IOPG(IOPGOFF(addr) + (size) - 1) == IOPG((size) - 1))
#define MINIMAL_ATE_FLAG(addr, size) \
(MINIMAL_ATES_REQUIRED((u64)addr, size) ? 1 : 0)
/* bit 29 of the pci address is the SWAP bit */
#define ATE_SWAPSHIFT 29
#define ATE_SWAP_ON(x) ((x) |= (1 << ATE_SWAPSHIFT))
#define ATE_SWAP_OFF(x) ((x) &= ~(1 << ATE_SWAPSHIFT))
/*
* I/O page size
*/
#if PAGE_SIZE < 16384
#define IOPFNSHIFT 12 /* 4K per mapped page */
#else
#define IOPFNSHIFT 14 /* 16K per mapped page */
#endif
#define IOPGSIZE (1 << IOPFNSHIFT)
#define IOPG(x) ((x) >> IOPFNSHIFT)
#define IOPGOFF(x) ((x) & (IOPGSIZE-1))
#define PCIBR_DEV_SWAP_DIR (1ull << 19)
#define PCIBR_CTRL_PAGE_SIZE (0x1 << 21)
/*
* PMU resources.
*/
struct ate_resource{
u64 *ate;
u64 num_ate;
u64 lowest_free_index;
};
struct pcibus_info {
struct pcibus_bussoft pbi_buscommon; /* common header */
u32 pbi_moduleid;
short pbi_bridge_type;
short pbi_bridge_mode;
struct ate_resource pbi_int_ate_resource;
u64 pbi_int_ate_size;
u64 pbi_dir_xbase;
char pbi_hub_xid;
u64 pbi_devreg[8];
u32 pbi_valid_devices;
u32 pbi_enabled_devices;
spinlock_t pbi_lock;
};
extern int pcibr_init_provider(void);
extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *);
extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t, int type);
extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t, int type);
extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int);
/*
* prototypes for the bridge asic register access routines in pcibr_reg.c
*/
extern void pcireg_control_bit_clr(struct pcibus_info *, u64);
extern void pcireg_control_bit_set(struct pcibus_info *, u64);
extern u64 pcireg_tflush_get(struct pcibus_info *);
extern u64 pcireg_intr_status_get(struct pcibus_info *);
extern void pcireg_intr_enable_bit_clr(struct pcibus_info *, u64);
extern void pcireg_intr_enable_bit_set(struct pcibus_info *, u64);
extern void pcireg_intr_addr_addr_set(struct pcibus_info *, int, u64);
extern void pcireg_force_intr_set(struct pcibus_info *, int);
extern u64 pcireg_wrb_flush_get(struct pcibus_info *, int);
extern void pcireg_int_ate_set(struct pcibus_info *, int, u64);
extern u64 __iomem * pcireg_int_ate_addr(struct pcibus_info *, int);
extern void pcibr_force_interrupt(struct sn_irq_info *sn_irq_info);
extern void pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info);
extern int pcibr_ate_alloc(struct pcibus_info *, int);
extern void pcibr_ate_free(struct pcibus_info *, int);
extern void ate_write(struct pcibus_info *, int, int, u64);
extern int sal_pcibr_slot_enable(struct pcibus_info *soft, int device,
void *resp);
extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device,
int action, void *resp);
extern u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus);
#endif
|
/* Copyright (C) 1991-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <unistd.h>
#include "hurdhost.h"
/* Set the name of the current host to NAME, which is LEN bytes long.
This call is restricted to the super-user. */
/* XXX should be __sethostname ? */
int
sethostname (name, len)
const char *name;
size_t len;
{
/* The host name is just the contents of the file /etc/hostname. */
ssize_t n = _hurd_set_host_config ("/etc/hostname", name, len);
return n < 0 ? -1 : 0;
}
|
#define _UNICODE 1
#define UNICODE 1
#include "wincrt1.c"
|
/*
* Copyright (C) 2007 Kevin Watters, Kevin Ollivier. 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 COMPUTER, 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 COMPUTER, 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.
*/
#include "Font.h"
#include "GlyphBuffer.h"
#include <wx/defs.h>
#include <wx/dcclient.h>
#if __WXGTK__ && USE(WXGC)
#include <cairo.h>
#include <pango/pango.h>
#include <pango/pangocairo.h>
#endif
namespace WebCore {
extern void drawTextWithSpacing(GraphicsContext* graphicsContext, const SimpleFontData* font, const wxColour& color, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point);
#if __WXGTK__ && USE(WXGC)
PangoFontMap* pangoFontMap();
PangoFont* createPangoFontForFont(const wxFont* wxfont);
cairo_scaled_font_t* createScaledFontForFont(const wxFont* wxfont);
PangoGlyph pango_font_get_glyph(PangoFont* font, PangoContext* context, gunichar wc);
#endif
}
|
/**
******************************************************************************
* @file audio.h
* @author MCD Application Team
* @version V4.0.1
* @date 21-July-2015
* @brief This header file contains the common defines and functions prototypes
* for the Audio driver.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __AUDIO_H
#define __AUDIO_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
/** @addtogroup BSP
* @{
*/
/** @addtogroup Components
* @{
*/
/** @addtogroup AUDIO
* @{
*/
/** @defgroup AUDIO_Exported_Constants
* @{
*/
/* Codec audio Standards */
#define CODEC_STANDARD 0x04
#define I2S_STANDARD I2S_STANDARD_PHILIPS
/**
* @}
*/
/** @defgroup AUDIO_Exported_Types
* @{
*/
/** @defgroup AUDIO_Driver_structure Audio Driver structure
* @{
*/
typedef struct
{
uint32_t (*Init)(uint16_t, uint16_t, uint8_t, uint32_t);
void (*DeInit)(void);
uint32_t (*ReadID)(uint16_t);
uint32_t (*Play)(uint16_t, uint16_t*, uint16_t);
uint32_t (*Pause)(uint16_t);
uint32_t (*Resume)(uint16_t);
uint32_t (*Stop)(uint16_t, uint32_t);
uint32_t (*SetFrequency)(uint16_t, uint32_t);
uint32_t (*SetVolume)(uint16_t, uint8_t);
uint32_t (*SetMute)(uint16_t, uint32_t);
uint32_t (*SetOutputMode)(uint16_t, uint8_t);
uint32_t (*Reset)(uint16_t);
}AUDIO_DrvTypeDef;
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __AUDIO_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef SVGElementRareData_h
#define SVGElementRareData_h
#include "core/svg/SVGElement.h"
#include "platform/heap/Handle.h"
#include "wtf/HashSet.h"
#include "wtf/Noncopyable.h"
#include "wtf/StdLibExtras.h"
namespace blink {
class CSSCursorImageValue;
class SVGCursorElement;
class SVGElementRareData : public NoBaseWillBeGarbageCollectedFinalized<SVGElementRareData> {
WTF_MAKE_NONCOPYABLE(SVGElementRareData); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(SVGElementRareData);
public:
SVGElementRareData(SVGElement* owner)
#if ENABLE(OILPAN)
: m_owner(owner)
, m_cursorElement(nullptr)
#else
: m_cursorElement(nullptr)
#endif
, m_cursorImageValue(nullptr)
, m_correspondingElement(nullptr)
, m_instancesUpdatesBlocked(false)
, m_useOverrideComputedStyle(false)
, m_needsOverrideComputedStyleUpdate(false)
{
}
SVGElementSet& outgoingReferences() { return m_outgoingReferences; }
const SVGElementSet& outgoingReferences() const { return m_outgoingReferences; }
SVGElementSet& incomingReferences() { return m_incomingReferences; }
const SVGElementSet& incomingReferences() const { return m_incomingReferences; }
WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>>& elementInstances() { return m_elementInstances; }
const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>>& elementInstances() const { return m_elementInstances; }
bool instanceUpdatesBlocked() const { return m_instancesUpdatesBlocked; }
void setInstanceUpdatesBlocked(bool value) { m_instancesUpdatesBlocked = value; }
SVGCursorElement* cursorElement() const { return m_cursorElement; }
void setCursorElement(SVGCursorElement* cursorElement) { m_cursorElement = cursorElement; }
SVGElement* correspondingElement() { return m_correspondingElement.get(); }
void setCorrespondingElement(SVGElement* correspondingElement) { m_correspondingElement = correspondingElement; }
CSSCursorImageValue* cursorImageValue() const { return m_cursorImageValue; }
void setCursorImageValue(CSSCursorImageValue* cursorImageValue) { m_cursorImageValue = cursorImageValue; }
MutableStylePropertySet* animatedSMILStyleProperties() const { return m_animatedSMILStyleProperties.get(); }
MutableStylePropertySet* ensureAnimatedSMILStyleProperties();
ComputedStyle* overrideComputedStyle(Element*, const ComputedStyle*);
bool useOverrideComputedStyle() const { return m_useOverrideComputedStyle; }
void setUseOverrideComputedStyle(bool value) { m_useOverrideComputedStyle = value; }
void setNeedsOverrideComputedStyleUpdate() { m_needsOverrideComputedStyleUpdate = true; }
AffineTransform* animateMotionTransform();
DECLARE_TRACE();
void processWeakMembers(Visitor*);
private:
#if ENABLE(OILPAN)
Member<SVGElement> m_owner;
#endif
SVGElementSet m_outgoingReferences;
SVGElementSet m_incomingReferences;
WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>> m_elementInstances;
RawPtrWillBeWeakMember<SVGCursorElement> m_cursorElement;
RawPtrWillBeWeakMember<CSSCursorImageValue> m_cursorImageValue;
RefPtrWillBeMember<SVGElement> m_correspondingElement;
bool m_instancesUpdatesBlocked : 1;
bool m_useOverrideComputedStyle : 1;
bool m_needsOverrideComputedStyleUpdate : 1;
RefPtrWillBeMember<MutableStylePropertySet> m_animatedSMILStyleProperties;
RefPtr<ComputedStyle> m_overrideComputedStyle;
// Used by <animateMotion>
OwnPtr<AffineTransform> m_animateMotionTransform;
};
}
#endif
|
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "../../headers/tomcrypt.h"
/**
@file der_encode_set.c
ASN.1 DER, Encode a SET, Tom St Denis
*/
#ifdef LTC_DER
/* LTC define to ASN.1 TAG */
static int ltc_to_asn1(int v)
{
switch (v) {
case LTC_ASN1_BOOLEAN: return 0x01;
case LTC_ASN1_INTEGER:
case LTC_ASN1_SHORT_INTEGER: return 0x02;
case LTC_ASN1_BIT_STRING: return 0x03;
case LTC_ASN1_OCTET_STRING: return 0x04;
case LTC_ASN1_NULL: return 0x05;
case LTC_ASN1_OBJECT_IDENTIFIER: return 0x06;
case LTC_ASN1_UTF8_STRING: return 0x0C;
case LTC_ASN1_PRINTABLE_STRING: return 0x13;
case LTC_ASN1_IA5_STRING: return 0x16;
case LTC_ASN1_UTCTIME: return 0x17;
case LTC_ASN1_SEQUENCE: return 0x30;
case LTC_ASN1_SET:
case LTC_ASN1_SETOF: return 0x31;
default: return -1;
}
}
static int qsort_helper(const void *a, const void *b)
{
ltc_asn1_list *A = (ltc_asn1_list *)a, *B = (ltc_asn1_list *)b;
int r;
r = ltc_to_asn1(A->type) - ltc_to_asn1(B->type);
/* for QSORT the order is UNDEFINED if they are "equal" which means it is NOT DETERMINISTIC. So we force it to be :-) */
if (r == 0) {
/* their order in the original list now determines the position */
return A->used - B->used;
} else {
return r;
}
}
/*
Encode a SET type
@param list The list of items to encode
@param inlen The number of items in the list
@param out [out] The destination
@param outlen [in/out] The size of the output
@return CRYPT_OK on success
*/
int der_encode_set(ltc_asn1_list *list, unsigned long inlen,
unsigned char *out, unsigned long *outlen)
{
ltc_asn1_list *copy;
unsigned long x;
int err;
/* make copy of list */
copy = XCALLOC(inlen, sizeof(*copy));
if (copy == NULL) {
return CRYPT_MEM;
}
/* fill in used member with index so we can fully sort it */
for (x = 0; x < inlen; x++) {
copy[x] = list[x];
copy[x].used = x;
}
/* sort it by the "type" field */
XQSORT(copy, inlen, sizeof(*copy), &qsort_helper);
/* call der_encode_sequence_ex() */
err = der_encode_sequence_ex(copy, inlen, out, outlen, LTC_ASN1_SET);
/* free list */
XFREE(copy);
return err;
}
#endif
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/set/der_encode_set.c,v $ */
/* $Revision: 1.12 $ */
/* $Date: 2006/12/28 01:27:24 $ */
|
//******************************************************************************
//
// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************
#pragma once
#import <AVFoundation/AVFoundationExport.h>
#import <Foundation/NSObject.h>
@class NSArray;
AVFOUNDATION_EXPORT_CLASS
@interface AVCaptureInput : NSObject
@property (readonly, nonatomic) NSArray* ports STUB_PROPERTY;
@end
|
/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher
* Copyright (C) 2011, 2012, 2013, 2014 Dean Beeler, Jerome Fisher, Sergey V. Mikayev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MT32EMU_TABLES_H
#define MT32EMU_TABLES_H
namespace MT32Emu {
class Tables {
private:
Tables();
Tables(Tables &);
~Tables() {}
public:
static const Tables &getInstance();
// Constant LUTs
// CONFIRMED: This is used to convert several parameters to amp-modifying values in the TVA envelope:
// - PatchTemp.outputLevel
// - RhythmTemp.outlevel
// - PartialParam.tva.level
// - expression
// It's used to determine how much to subtract from the amp envelope's target value
Bit8u levelToAmpSubtraction[101];
// CONFIRMED: ...
Bit8u envLogarithmicTime[256];
// CONFIRMED: ...
Bit8u masterVolToAmpSubtraction[101];
// CONFIRMED:
Bit8u pulseWidth100To255[101];
Bit16u exp9[512];
Bit16u logsin9[512];
const Bit8u *resAmpDecayFactor;
};
}
#endif
|
/*
* setup.c, Setup for the TANBAC TB0226.
*
* Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/config.h>
#include <asm/vr41xx/vr41xx.h>
const char *get_system_type(void)
{
return "TANBAC TB0226";
}
static int tanbac_tb0226_setup(void)
{
#ifdef CONFIG_SERIAL_8250
vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
vr41xx_siu_init();
#endif
return 0;
}
early_initcall(tanbac_tb0226_setup);
|
/* e_remainderl.c -- long double version of e_remainder.c.
* Conversion to long double by Ulrich Drepper,
* Cygnus Support, drepper@cygnus.com.
*/
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/* __ieee754_remainderl(x,p)
* Return :
* returns x REM p = x - [x/p]*p as if in infinite
* precise arithmetic, where [x/p] is the (infinite bit)
* integer nearest x/p (in half way case choose the even one).
* Method :
* Based on fmod() return x-[x/p]chopped*p exactlp.
*/
#include <math.h>
#include <math_private.h>
static const long double zero = 0.0;
long double
__ieee754_remainderl(long double x, long double p)
{
u_int32_t sx,sex,sep,x0,x1,p0,p1;
long double p_half;
GET_LDOUBLE_WORDS(sex,x0,x1,x);
GET_LDOUBLE_WORDS(sep,p0,p1,p);
sx = sex&0x8000;
sep &= 0x7fff;
sex &= 0x7fff;
/* purge off exception values */
if((sep|p0|p1)==0) return (x*p)/(x*p); /* p = 0 */
if((sex==0x7fff)|| /* x not finite */
((sep==0x7fff)&& /* p is NaN */
((p0|p1)!=0)))
return (x*p)/(x*p);
if (sep<0x7ffe) x = __ieee754_fmodl(x,p+p); /* now x < 2p */
if (((sex-sep)|(x0-p0)|(x1-p1))==0) return zero*x;
x = fabsl(x);
p = fabsl(p);
if (sep<0x0002) {
if(x+x>p) {
x-=p;
if(x+x>=p) x -= p;
}
} else {
p_half = 0.5*p;
if(x>p_half) {
x-=p;
if(x>=p_half) x -= p;
}
}
GET_LDOUBLE_EXP(sex,x);
SET_LDOUBLE_EXP(x,sex^sx);
return x;
}
strong_alias (__ieee754_remainderl, __remainderl_finite)
|
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
/* MD5 context. */
typedef struct {
UINT4 state[4]; /* state (ABCD) */
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} MD5_CTX;
void MD5Init PROTO_LIST((MD5_CTX *));
void MD5Update PROTO_LIST((MD5_CTX *, unsigned char *, unsigned int));
void MD5Final PROTO_LIST((unsigned char[16], MD5_CTX *));
/* sha.h */
/* The structure for storing SHS info */
typedef struct {
UINT4 digest[5]; /* Message digest */
UINT4 countLo, countHi; /* 64-bit bit count */
UINT4 data[16]; /* SHS data buffer */
int Endianness;
} SHA_CTX;
/* Message digest functions */
void SHAInit(SHA_CTX *);
void SHAUpdate(SHA_CTX *, BYTE * buffer, int count);
void SHAFinal(BYTE * output, SHA_CTX *);
|
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "Material.h"
class ConstantIDMaterial : public Material
{
public:
static InputParameters validParams();
ConstantIDMaterial(const InputParameters & parameters);
protected:
virtual void computeQpProperties() override;
const dof_id_type & _id;
MaterialProperty<Real> & _prop;
std::vector<Real> _values;
};
|
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Module: $URL$
Copyright (c) 2006-2010 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMCODESTRING_H
#define GDCMCODESTRING_H
#include "gdcmString.h"
namespace gdcm
{
/**
* \brief CodeString
* This is an implementation of DICOM VR: CS
* The cstor will properly Trim so that operator== is correct.
*
* \note the cstor of CodeString will Trim the string on the fly so as
* to remove the extra leading and ending spaces. However it will not
* perform validation on the fly (CodeString obj can contains invalid
* char such as lower cases). This design was chosen to be a little tolerant
* to broken DICOM implementation, and thus allow user to compare lower
* case CS from there input file without the need to first rewrite them
* to get rid of invalid character (validation is a different operation from
* searching, querying).
* \warning when writing out DICOM file it is highly recommended to perform
* the IsValid() call, at least to check that the length of the string match
* the definition in the standard.
*/
// Note to myself: because note all wrapped language support exception
// we could not support throwing an exception during object construction.
class GDCM_EXPORT CodeString
{
friend std::ostream& operator<< (std::ostream& os, const CodeString& str);
friend bool operator==(const CodeString &ref, const CodeString& cs);
friend bool operator!=(const CodeString &ref, const CodeString& cs);
typedef String<'\\',16> InternalClass;
public:
typedef InternalClass::value_type value_type;
typedef InternalClass::pointer pointer;
typedef InternalClass::reference reference;
typedef InternalClass::const_reference const_reference;
typedef InternalClass::size_type size_type;
typedef InternalClass::difference_type difference_type;
typedef InternalClass::iterator iterator;
typedef InternalClass::const_iterator const_iterator;
typedef InternalClass::reverse_iterator reverse_iterator;
typedef InternalClass::const_reverse_iterator const_reverse_iterator;
/// CodeString constructors.
CodeString(): Internal() {}
CodeString(const value_type* s): Internal(s) { Internal = Internal.Trim(); }
CodeString(const value_type* s, size_type n): Internal(s, n) {
Internal = Internal.Trim(); }
CodeString(const InternalClass& s, size_type pos=0, size_type n=InternalClass::npos):
Internal(s, pos, n) { Internal = Internal.Trim(); }
/// Check if CodeString obj is correct..
bool IsValid() const;
/// Return the full code string as std::string
std::string GetAsString() const {
return Internal;
}
/// \deprecated Remove extra leading and ending spaces.
GDCM_LEGACY(std::string Trim() const)
/// Return the size of the string
size_type Size() const { return Internal.size(); }
/// \deprecated
/// Return the size of the string
GDCM_LEGACY(size_type size() const)
protected:
std::string TrimInternal() const {
return Internal.Trim();
}
private:
String<'\\',16> Internal;
};
inline std::ostream& operator<< (std::ostream& os, const CodeString& str)
{
os << str.Internal;
return os;
}
inline bool operator==(const CodeString &ref, const CodeString& cs)
{
return ref.Internal == cs.Internal;
}
inline bool operator!=(const CodeString &ref, const CodeString& cs)
{
return ref.Internal != cs.Internal;
}
} // end namespace gdcm
#endif //GDCMCODESTRING_H
|
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#ifndef _GFXCARDPROFILE_H_
#define _GFXCARDPROFILE_H_
#ifndef _TDICTIONARY_H_
#include "core/util/tDictionary.h"
#endif
#ifndef _GFXDEVICE_H_
#include "gfx/gfxDevice.h"
#endif
#ifndef _TORQUE_STRING_H_
#include "core/util/str.h"
#endif
/// GFXCardProfiler provides a device independent wrapper around both the
/// capabilities reported by the card/drivers and the exceptions recorded
/// in various scripts.
///
/// See the Torque Scripting Manual for more details.
///
class GFXCardProfiler
{
/// @name icpi Internal Card Profile Interface
///
/// This is the interface implemented by subclasses of this class in order
/// to provide implementation-specific information about the current
/// card/drivers.
///
/// Basically, the implementation needs to provide some unique strings:
/// - mVersionString indicating the current driver version of the
/// card in question. (For instance, "53.36")
/// - mCardDescription indicating the name of the card ("Radeon 8500")
/// - getRendererString() indicating the name of the renderer ("DX9", "GL1.2").
/// Each card profiler subclass must return a unique constant so we can keep
/// data separate. Bear in mind that punctuation is stripped from filenames.
///
/// The profiler also needs to implement setupCardCapabilities(), which is responsible
/// for querying the active device and setting defaults based on the reported capabilities,
/// and _queryCardCap, which is responsible for recognizing and responding to
/// device-specific capability queries.
///
/// @{
public:
///
const String &getVersionString() const { return mVersionString; }
const String &getCardString() const { return mCardDescription; }
const String &getChipString() const { return mChipSet; }
U32 getVideoMemoryInMB() const { return mVideoMemory; }
virtual const String &getRendererString() const = 0;
protected:
String mVersionString;
String mCardDescription;
String mChipSet;
U32 mVideoMemory;
virtual void setupCardCapabilities()=0;
/// Implementation specific query code.
///
/// This function is meant to be overridden by the specific implementation class.
///
/// Some query strings are handled by the external implementation while others must
/// be done by the specific implementation. This is given first chance to return
/// a result, then the generic rules are applied.
///
/// @param query Capability being queried.
/// @param foundResult Result to return to the caller. If the function returns true
/// then this value is returned as the result of the query.
virtual bool _queryCardCap(const String &query, U32 &foundResult)=0;
virtual bool _queryFormat( const GFXFormat fmt, const GFXTextureProfile *profile, bool &inOutAutogenMips ) = 0;
/// @}
/// @name helpergroup Helper Functions
///
/// Various helper functions.
/// Load a specified script file from the profiles directory, if it exists.
void loadProfileScript(const char* scriptName);
/// Load the script files in order for the specified card profile tuple.
void loadProfileScripts(const String& render, const String& vendor, const String& card, const String& version);
String strippedString(const char*string);
/// @}
/// Capability dictionary.
Map<String, U32> mCapDictionary;
public:
/// @name ecpi External Card Profile Interface
///
/// @{
/// Called for a profile for a given device.
GFXCardProfiler();
virtual ~GFXCardProfiler();
/// Set load script files and generally initialize things.
virtual void init()=0;
/// Called to query a capability. Given a query string it returns a
/// bool indicating whether or not the capability holds. If you call
/// this and cap isn't recognized then it returns false and prints
/// a console error.
U32 queryProfile(const String &cap);
/// Same as queryProfile(), but a default can be specified to indicate
/// what value should be returned if the profiler doesn't know anything
/// about it. If cap is not recognized, defaultValue is returned and
/// no error is reported.
U32 queryProfile(const String &cap, U32 defaultValue);
/// Set the specified capability to the specified value.
void setCapability(const String &cap, U32 value);
/// Queries support for the specified texture format, and texture profile
bool checkFormat( const GFXFormat fmt, const GFXTextureProfile *profile, bool &inOutAutogenMips );
/// @}
};
#endif
|
//
// WAList1DetailExtraViewController.h
// WAAppRouter
//
// Created by Marian Paul on 18/08/2015.
// Copyright (c) 2015 Wasappli. All rights reserved.
//
#import "WABaseDetailViewController.h"
@interface WAListDetailExtraViewController : WABaseDetailViewController
@end
|
/// \file noexceptions.h
/// \brief Declares interface that allows exceptions to be optional
///
/// A class may inherit from OptionalExceptions, which will add to it
/// a mechanism by which a user can tell objects of that class to
/// suppress exceptions. (They are enabled by default.) This module
/// also declares a NoExceptions class, objects of which take a
/// reference to any class derived from OptionalExceptions. The
/// NoExceptions constructor calls the method that disables exceptions,
/// and the destructor reverts them to the previous state. One uses
/// the NoExceptions object within a scope to suppress exceptions in
/// that block, without having to worry about reverting the setting when
/// the block exits.
/***********************************************************************
Copyright (c) 2005-2007 by Educational Technology Resources, Inc.
Others may also hold copyrights on code in this file. See the
CREDITS.txt file in the top directory of the distribution for details.
This file is part of MySQL++.
MySQL++ 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.
MySQL++ 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 MySQL++; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
***********************************************************************/
#ifndef MYSQLPP_NOEXCEPTIONS_H
#define MYSQLPP_NOEXCEPTIONS_H
#include "common.h"
namespace mysqlpp {
#if !defined(DOXYGEN_IGNORE)
// Make Doxygen ignore this
class MYSQLPP_EXPORT NoExceptions;
#endif
/// \brief Interface allowing a class to have optional exceptions.
///
/// A class derives from this one to acquire a standard interface for
/// disabling exceptions, possibly only temporarily. By default,
/// exceptions are enabled.
///
/// Note that all methods are const even though some of them change our
/// internal flag indicating whether exceptions should be thrown. This
/// is justifiable because this is just an interface class, and it
/// changes the behavior of our subclass literally only in exceptional
/// conditions. This Jesuitical interpretation of "const" is required
/// because you may want to disable exceptions on const subclass
/// instances.
///
/// If it makes you feel better about this, consider that the real
/// change isn't within the const OptionalExceptions subclass instance.
/// What changes is the code wrapping the method call on that instance
/// that can optionally throw an exception. This outside code is in
/// a better position to say what "const" means than the subclass
/// instance.
class MYSQLPP_EXPORT OptionalExceptions
{
public:
/// \brief Default constructor
///
/// \param e if true, exceptions are enabled (this is the default)
OptionalExceptions(bool e = true) :
exceptions_(e)
{
}
/// \brief Destroy object
virtual ~OptionalExceptions() { }
/// \brief Enable exceptions from the object
void enable_exceptions() const { exceptions_ = true; }
/// \brief Disable exceptions from the object
void disable_exceptions() const { exceptions_ = false; }
/// \brief Returns true if exceptions are enabled
bool throw_exceptions() const { return exceptions_; }
protected:
/// \brief Sets the exception state to a particular value
///
/// This method is protected because it is only intended for use by
/// subclasses' copy constructors and the like.
void set_exceptions(bool e) const { exceptions_ = e; }
/// \brief Declare NoExceptions to be our friend so it can access
/// our protected functions.
friend class NoExceptions;
private:
mutable bool exceptions_;
};
/// \brief Disable exceptions in an object derived from
/// OptionalExceptions.
///
/// This class was designed to be created on the stack, taking a
/// reference to a subclass of OptionalExceptions. (We call that our
/// "associate" object.) On creation, we save that object's current
/// exception state, and disable exceptions. On destruction, we restore
/// our associate's previous state.
class MYSQLPP_EXPORT NoExceptions
{
public:
/// \brief Constructor
///
/// Takes a reference to an OptionalExceptions derivative,
/// saves that object's current exception state, and disables
/// exceptions.
NoExceptions(const OptionalExceptions& a) :
assoc_(a),
exceptions_were_enabled_(a.throw_exceptions())
{
assoc_.disable_exceptions();
}
/// \brief Destructor
///
/// Restores our associate object's previous exception state.
~NoExceptions()
{
assoc_.set_exceptions(exceptions_were_enabled_);
}
private:
const OptionalExceptions& assoc_;
bool exceptions_were_enabled_;
// Hidden assignment operator and copy ctor, because we should not
// be copied.
NoExceptions(const NoExceptions&);
NoExceptions& operator=(const NoExceptions&);
};
} // end namespace mysqlpp
#endif // MYSQLPP_NOEXCEPTIONS_H
|
namespace ns1 {
namespace ns2 {
namespace ns3{
using namespace foo::os;
class foo2
{
int i2;
};
}
}
}
|
/* Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved.
* Copyright (c) 2010-2012 Sony Ericsson Mobile Communications AB.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __LINUX_USB_GADGET_MSM72K_OTG_H__
#define __LINUX_USB_GADGET_MSM72K_OTG_H__
#include <linux/usb.h>
#include <linux/usb/gadget.h>
#include <linux/usb/otg.h>
#include <linux/wakelock.h>
#include <mach/msm_hsusb.h>
#include <asm/mach-types.h>
#include <mach/msm_hsusb.h>
#define OTGSC_BSVIE (1 << 27)
#define OTGSC_IDIE (1 << 24)
#define OTGSC_IDPU (1 << 5)
#define OTGSC_BSVIS (1 << 19)
#define OTGSC_ID (1 << 8)
#define OTGSC_IDIS (1 << 16)
#define OTGSC_BSV (1 << 11)
#define OTGSC_DPIE (1 << 30)
#define OTGSC_DPIS (1 << 22)
#define OTGSC_HADP (1 << 6)
#define OTGSC_IDPU (1 << 5)
#define ULPI_STP_CTRL (1 << 30)
#define ASYNC_INTR_CTRL (1 << 29)
#define ULPI_SYNC_STATE (1 << 27)
#define PORTSC_PHCD (1 << 23)
#define PORTSC_CSC (1 << 1)
#define disable_phy_clk() (writel(readl(USB_PORTSC) | PORTSC_PHCD, USB_PORTSC))
#define enable_phy_clk() (writel(readl(USB_PORTSC) & ~PORTSC_PHCD, USB_PORTSC))
#define is_phy_clk_disabled() (readl(USB_PORTSC) & PORTSC_PHCD)
#define is_phy_active() (readl_relaxed(USB_ULPI_VIEWPORT) &\
ULPI_SYNC_STATE)
#define is_usb_active() (!(readl(USB_PORTSC) & PORTSC_SUSP))
/* Timeout (in msec) values (min - max) associated with OTG timers */
#define TA_WAIT_VRISE 100 /* ( - 100) */
#define TA_WAIT_VFALL 500 /* ( - 1000) */
/*
* This option is set for embedded hosts or OTG devices in which leakage
* currents are very minimal.
*/
#ifdef CONFIG_MSM_OTG_ENABLE_A_WAIT_BCON_TIMEOUT
#define TA_WAIT_BCON 30000 /* (1100 - 30000) */
#else
#define TA_WAIT_BCON -1
#endif
/* AIDL_BDIS should be 500 */
#define TA_AIDL_BDIS 200 /* (200 - ) */
#define TA_BIDL_ADIS 155 /* (155 - 200) */
#define TB_SRP_FAIL 6000 /* (5000 - 6000) */
#define TB_ASE0_BRST 155 /* (155 - ) */
/* TB_SSEND_SRP and TB_SE0_SRP are combined */
#define TB_SRP_INIT 2000 /* (1500 - ) */
/* Timeout variables */
#define A_WAIT_VRISE 0
#define A_WAIT_VFALL 1
#define A_WAIT_BCON 2
#define A_AIDL_BDIS 3
#define A_BIDL_ADIS 4
#define B_SRP_FAIL 5
#define B_ASE0_BRST 6
/* Internal flags like a_set_b_hnp_en, b_hnp_en are maintained
* in usb_bus and usb_gadget
*/
#define A_BUS_DROP 0
#define A_BUS_REQ 1
#define A_SRP_DET 2
#define A_VBUS_VLD 3
#define B_CONN 4
#define ID 5
#define ADP_CHANGE 6
#define POWER_UP 7
#define A_CLR_ERR 8
#define A_BUS_RESUME 9
#define A_BUS_SUSPEND 10
#define A_CONN 11
#define B_BUS_REQ 12
#define B_SESS_VLD 13
#define ID_A 14
#define ID_B 15
#define ID_C 16
#define ACA_ID_INPUTS 17
#define VBUS_DROP_DET 18
#define USB_IDCHG_MIN 500
#define USB_IDCHG_MAX 1500
#define USB_IB_UNCFG 2
#define OTG_ID_POLL_MS 1000
struct msm_otg {
struct otg_transceiver otg;
/* usb clocks */
struct clk *alt_core_clk;
struct clk *iface_clk;
struct clk *core_clk;
/* clk regime has created dummy clock id for phy so
* that generic clk_reset api can be used to reset phy
*/
struct clk *phy_reset_clk;
int irq;
int vbus_on_irq;
int id_irq;
void __iomem *regs;
atomic_t in_lpm;
/* charger-type is modified by gadget for legacy chargers
* and OTG modifies it for ACA
*/
atomic_t chg_type;
void (*start_host) (struct usb_bus *bus, int suspend);
/* Enable/disable the clocks */
int (*set_clk) (struct otg_transceiver *otg, int on);
/* Reset phy and link */
void (*reset) (struct otg_transceiver *otg, int phy_reset);
/* pmic notfications apis */
u8 pmic_vbus_notif_supp;
u8 pmic_id_notif_supp;
struct msm_otg_platform_data *pdata;
spinlock_t lock; /* protects OTG state */
struct wake_lock wlock;
unsigned long b_last_se0_sess; /* SRP initial condition check */
unsigned long inputs;
unsigned long tmouts;
u8 active_tmout;
struct hrtimer timer;
struct workqueue_struct *wq;
struct work_struct sm_work; /* state machine work */
struct work_struct otg_resume_work;
struct notifier_block usbdev_nb;
struct msm_xo_voter *xo_handle; /*handle to vote for TCXO D1 buffer*/
#ifdef CONFIG_USB_MSM_ACA
struct timer_list id_timer; /* drives id_status polling */
unsigned b_max_power; /* ACA: max power of accessory*/
int wait_id_stable_duration;
#endif
atomic_t shuttingdown;
atomic_t pm_suspend;
wait_queue_head_t pm_wait;
unsigned long wait_charger_init_start;
atomic_t skip_lpm;
};
static inline int can_phy_power_collapse(struct msm_otg *dev)
{
if (!dev || !dev->pdata)
return -ENODEV;
return dev->pdata->phy_can_powercollapse;
}
/* When detected VBUS drop, it is notified from a charger. */
void msm_otg_notify_vbus_drop(void);
#endif
|
/**************************************************************************/
/* */
/* OCaml */
/* */
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
/* */
/* Copyright 1996 Institut National de Recherche en Informatique et */
/* en Automatique. */
/* */
/* All rights reserved. This file is distributed under the terms of */
/* the GNU Lesser General Public License version 2.1, with the */
/* special exception on linking described in the file LICENSE. */
/* */
/**************************************************************************/
#include <caml/mlvalues.h>
#include <caml/alloc.h>
#include <caml/memory.h>
#include <caml/signals.h>
#define CAML_INTERNALS
#include <caml/osdeps.h>
#include "unixsupport.h"
#ifdef HAS_UNISTD
# include <unistd.h>
#else
# ifndef _WIN32
# include <sys/file.h>
# endif
# ifndef R_OK
# define R_OK 4/* test for read permission */
# define W_OK 2/* test for write permission */
# define X_OK 1/* test for execute (search) permission */
# define F_OK 0/* test for presence of file */
# endif
#endif
static int access_permission_table[] = {
R_OK,
W_OK,
#ifdef _WIN32
/* Since there is no concept of execute permission on Windows,
we fall b+ack to the read permission */
R_OK,
#else
X_OK,
#endif
F_OK
};
CAMLprim value unix_access(value path, value perms)
{
CAMLparam2(path, perms);
char_os * p;
int ret, cv_flags;
caml_unix_check_path(path, "access");
cv_flags = caml_convert_flag_list(perms, access_permission_table);
p = caml_stat_strdup_to_os(String_val(path));
caml_enter_blocking_section();
ret = access_os(p, cv_flags);
caml_leave_blocking_section();
caml_stat_free(p);
if (ret == -1)
uerror("access", path);
CAMLreturn(Val_unit);
}
|
/*
Copyright Rene Rivera 2008-2014
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef MSGPACK_PREDEF_COMPILER_TENDRA_H
#define MSGPACK_PREDEF_COMPILER_TENDRA_H
#include <msgpack/predef/version_number.h>
#include <msgpack/predef/make.h>
/*`
[heading `MSGPACK_COMP_TENDRA`]
[@http://en.wikipedia.org/wiki/TenDRA_Compiler TenDRA C/C++] compiler.
[table
[[__predef_symbol__] [__predef_version__]]
[[`__TenDRA__`] [__predef_detection__]]
]
*/
#define MSGPACK_COMP_TENDRA MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
#if defined(__TenDRA__)
# define MSGPACK_COMP_TENDRA_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
#endif
#ifdef MSGPACK_COMP_TENDRA_DETECTION
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
# define MSGPACK_COMP_TENDRA_EMULATED MSGPACK_COMP_TENDRA_DETECTION
# else
# undef MSGPACK_COMP_TENDRA
# define MSGPACK_COMP_TENDRA MSGPACK_COMP_TENDRA_DETECTION
# endif
# define MSGPACK_COMP_TENDRA_AVAILABLE
# include <msgpack/predef/detail/comp_detected.h>
#endif
#define MSGPACK_COMP_TENDRA_NAME "TenDRA C/C++"
#include <msgpack/predef/detail/test.h>
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_TENDRA,MSGPACK_COMP_TENDRA_NAME)
#ifdef MSGPACK_COMP_TENDRA_EMULATED
#include <msgpack/predef/detail/test.h>
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_TENDRA_EMULATED,MSGPACK_COMP_TENDRA_NAME)
#endif
#endif
|
/*****************************************************************************
Copyright (c) 2011, Intel Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************
* Contents: Native high-level C interface to LAPACK function dspgvx
* Author: Intel Corporation
* Generated November, 2011
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int LAPACKE_dspgvx( int matrix_order, lapack_int itype, char jobz,
char range, char uplo, lapack_int n, double* ap,
double* bp, double vl, double vu, lapack_int il,
lapack_int iu, double abstol, lapack_int* m,
double* w, double* z, lapack_int ldz,
lapack_int* ifail )
{
lapack_int info = 0;
lapack_int* iwork = NULL;
double* work = NULL;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dspgvx", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_d_nancheck( 1, &abstol, 1 ) ) {
return -13;
}
if( LAPACKE_dsp_nancheck( n, ap ) ) {
return -7;
}
if( LAPACKE_dsp_nancheck( n, bp ) ) {
return -8;
}
if( LAPACKE_lsame( range, 'v' ) ) {
if( LAPACKE_d_nancheck( 1, &vl, 1 ) ) {
return -9;
}
}
if( LAPACKE_lsame( range, 'v' ) ) {
if( LAPACKE_d_nancheck( 1, &vu, 1 ) ) {
return -10;
}
}
#endif
/* Allocate memory for working array(s) */
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,5*n) );
if( iwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,8*n) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_dspgvx_work( matrix_order, itype, jobz, range, uplo, n, ap,
bp, vl, vu, il, iu, abstol, m, w, z, ldz, work,
iwork, ifail );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( iwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dspgvx", info );
}
return info;
}
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: George Riley <riley@ece.gatech.edu>
*
*/
#ifndef NS3_DISTRIBUTED_SIMULATOR_IMPL_H
#define NS3_DISTRIBUTED_SIMULATOR_IMPL_H
#include "ns3/simulator-impl.h"
#include "ns3/scheduler.h"
#include "ns3/event-impl.h"
#include "ns3/ptr.h"
#include <list>
namespace ns3 {
/**
* \ingroup mpi
*
* \brief Structure used for all-reduce LBTS computation
*/
class LbtsMessage
{
public:
LbtsMessage ()
: m_txCount (0),
m_rxCount (0),
m_myId (0),
m_isFinished (false)
{
}
/**
* \param rxc received count
* \param txc transmitted count
* \param id mpi rank
* \param isFinished whether message is finished
* \param t smallest time
*/
LbtsMessage (uint32_t rxc, uint32_t txc, uint32_t id, bool isFinished, const Time& t)
: m_txCount (txc),
m_rxCount (rxc),
m_myId (id),
m_smallestTime (t),
m_isFinished (isFinished)
{
}
~LbtsMessage ();
/**
* \return smallest time
*/
Time GetSmallestTime ();
/**
* \return transmitted count
*/
uint32_t GetTxCount ();
/**
* \return received count
*/
uint32_t GetRxCount ();
/**
* \return id which corresponds to mpi rank
*/
uint32_t GetMyId ();
/**
* \return true if system is finished
*/
bool IsFinished ();
private:
uint32_t m_txCount;
uint32_t m_rxCount;
uint32_t m_myId;
Time m_smallestTime;
bool m_isFinished;
};
/**
* \ingroup simulator
* \ingroup mpi
*
* \brief Distributed simulator implementation using lookahead
*/
class DistributedSimulatorImpl : public SimulatorImpl
{
public:
static TypeId GetTypeId (void);
DistributedSimulatorImpl ();
~DistributedSimulatorImpl ();
// virtual from SimulatorImpl
virtual void Destroy ();
virtual bool IsFinished (void) const;
virtual void Stop (void);
virtual void Stop (Time const &time);
virtual EventId Schedule (Time const &time, EventImpl *event);
virtual void ScheduleWithContext (uint32_t context, Time const &time, EventImpl *event);
virtual EventId ScheduleNow (EventImpl *event);
virtual EventId ScheduleDestroy (EventImpl *event);
virtual void Remove (const EventId &id);
virtual void Cancel (const EventId &id);
virtual bool IsExpired (const EventId &id) const;
virtual void Run (void);
virtual Time Now (void) const;
virtual Time GetDelayLeft (const EventId &id) const;
virtual Time GetMaximumSimulationTime (void) const;
virtual void SetMaximumLookAhead (const Time lookAhead);
virtual void SetScheduler (ObjectFactory schedulerFactory);
virtual uint32_t GetSystemId (void) const;
virtual uint32_t GetContext (void) const;
private:
virtual void DoDispose (void);
void CalculateLookAhead (void);
bool IsLocalFinished (void) const;
void ProcessOneEvent (void);
uint64_t NextTs (void) const;
Time Next (void) const;
typedef std::list<EventId> DestroyEvents;
DestroyEvents m_destroyEvents;
bool m_stop;
bool m_globalFinished; // Are all parallel instances completed.
Ptr<Scheduler> m_events;
uint32_t m_uid;
uint32_t m_currentUid;
uint64_t m_currentTs;
uint32_t m_currentContext;
// number of events that have been inserted but not yet scheduled,
// not counting the "destroy" events; this is used for validation
int m_unscheduledEvents;
LbtsMessage* m_pLBTS; // Allocated once we know how many systems
uint32_t m_myId; // MPI Rank
uint32_t m_systemCount; // MPI Size
Time m_grantedTime; // Last LBTS
static Time m_lookAhead; // Lookahead value
};
} // namespace ns3
#endif /* NS3_DISTRIBUTED_SIMULATOR_IMPL_H */
|
/*
FUNCTION
<<islower>>, <<islower_l>>---lowercase character predicate
INDEX
islower
INDEX
islower_l
SYNOPSIS
#include <ctype.h>
int islower(int <[c]>);
#include <ctype.h>
int islower_l(int <[c]>, locale_t <[locale]>);
DESCRIPTION
<<islower>> is a macro which classifies singlebyte charset values by table
lookup. It is a predicate returning non-zero for minuscules
(lowercase alphabetic characters), and 0 for other characters.
It is defined only if <[c]> is representable as an unsigned char or if
<[c]> is EOF.
<<islower_l>> is like <<islower>> but performs the check based on the
locale specified by the locale object locale. If <[locale]> is
LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined.
You can use a compiled subroutine instead of the macro definition by
undefining the macro using `<<#undef islower>>' or `<<#undef islower_l>>'.
RETURNS
<<islower>>, <<islower_l>> return non-zero if <[c]> is a lowercase letter.
PORTABILITY
<<islower>> is ANSI C.
<<islower_l>> is POSIX-1.2008.
No supporting OS subroutines are required.
*/
#include <_ansi.h>
#include <ctype.h>
#undef islower
int
islower (int c)
{
return ((__CTYPE_PTR[c+1] & (_U|_L)) == _L);
}
|
/*
* Copyright (c) 2013 Nicira, Inc.
* Copyright (c) 2013 Cisco Systems, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/net.h>
#include <linux/rculist.h>
#include <linux/udp.h>
#include <net/icmp.h>
#include <net/ip.h>
#include <net/udp.h>
#include <net/ip_tunnels.h>
#include <net/udp.h>
#include <net/rtnetlink.h>
#include <net/route.h>
#include <net/dsfield.h>
#include <net/inet_ecn.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include <net/vxlan.h>
#include "datapath.h"
#include "vport.h"
/**
* struct vxlan_port - Keeps track of open UDP ports
* @vs: vxlan_sock created for the port.
* @name: vport name.
*/
struct vxlan_port {
struct vxlan_sock *vs;
char name[IFNAMSIZ];
};
static inline struct vxlan_port *vxlan_vport(const struct vport *vport)
{
return vport_priv(vport);
}
/* Called with rcu_read_lock and BH disabled. */
static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb, __be32 vx_vni)
{
struct ovs_key_ipv4_tunnel tun_key;
struct vport *vport = vs->data;
struct iphdr *iph;
__be64 key;
/* Save outer tunnel values */
iph = ip_hdr(skb);
key = cpu_to_be64(ntohl(vx_vni) >> 8);
ovs_flow_tun_key_init(&tun_key, iph, key, TUNNEL_KEY);
ovs_vport_receive(vport, skb, &tun_key);
}
static int vxlan_get_options(const struct vport *vport, struct sk_buff *skb)
{
struct vxlan_port *vxlan_port = vxlan_vport(vport);
__be16 dst_port = inet_sk(vxlan_port->vs->sock->sk)->sport;
if (nla_put_u16(skb, OVS_TUNNEL_ATTR_DST_PORT, ntohs(dst_port)))
return -EMSGSIZE;
return 0;
}
static void vxlan_tnl_destroy(struct vport *vport)
{
struct vxlan_port *vxlan_port = vxlan_vport(vport);
vxlan_sock_release(vxlan_port->vs);
ovs_vport_deferred_free(vport);
}
static struct vport *vxlan_tnl_create(const struct vport_parms *parms)
{
struct net *net = ovs_dp_get_net(parms->dp);
struct nlattr *options = parms->options;
struct vxlan_port *vxlan_port;
struct vxlan_sock *vs;
struct vport *vport;
struct nlattr *a;
u16 dst_port;
int err;
if (!options) {
err = -EINVAL;
goto error;
}
a = nla_find_nested(options, OVS_TUNNEL_ATTR_DST_PORT);
if (a && nla_len(a) == sizeof(u16)) {
dst_port = nla_get_u16(a);
} else {
/* Require destination port from userspace. */
err = -EINVAL;
goto error;
}
vport = ovs_vport_alloc(sizeof(struct vxlan_port),
&ovs_vxlan_vport_ops, parms);
if (IS_ERR(vport))
return vport;
vxlan_port = vxlan_vport(vport);
strncpy(vxlan_port->name, parms->name, IFNAMSIZ);
vs = vxlan_sock_add(net, htons(dst_port), vxlan_rcv, vport, true);
if (IS_ERR(vs)) {
ovs_vport_free(vport);
return (void *)vs;
}
vxlan_port->vs = vs;
return vport;
error:
return ERR_PTR(err);
}
static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb)
{
struct net *net = ovs_dp_get_net(vport->dp);
struct vxlan_port *vxlan_port = vxlan_vport(vport);
__be16 dst_port = inet_sk(vxlan_port->vs->sock->sk)->sport;
struct rtable *rt;
struct flowi fl;
__be16 src_port;
int port_min;
int port_max;
__be16 df;
int err;
if (unlikely(!OVS_CB(skb)->tun_key)) {
err = -EINVAL;
goto error;
}
/* Route lookup */
memset(&fl, 0, sizeof(fl));
fl.fl4_dst = OVS_CB(skb)->tun_key->ipv4_dst;
fl.fl4_src = OVS_CB(skb)->tun_key->ipv4_src;
fl.fl4_tos = RT_TOS(OVS_CB(skb)->tun_key->ipv4_tos);
fl.mark = skb->mark;
fl.proto = IPPROTO_UDP;
err = ip_route_output_key(net, &rt, &fl);
if (err)
goto error;
df = OVS_CB(skb)->tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ?
htons(IP_DF) : 0;
skb->local_df = 1;
inet_get_local_port_range(&port_min, &port_max);
src_port = vxlan_src_port(port_min, port_max, skb);
err = vxlan_xmit_skb(net, vxlan_port->vs, rt, skb,
fl.fl4_src, OVS_CB(skb)->tun_key->ipv4_dst,
OVS_CB(skb)->tun_key->ipv4_tos,
OVS_CB(skb)->tun_key->ipv4_ttl, df,
src_port, dst_port,
htonl(be64_to_cpu(OVS_CB(skb)->tun_key->tun_id) << 8));
if (err < 0)
ip_rt_put(rt);
error:
return err;
}
static const char *vxlan_get_name(const struct vport *vport)
{
struct vxlan_port *vxlan_port = vxlan_vport(vport);
return vxlan_port->name;
}
const struct vport_ops ovs_vxlan_vport_ops = {
.type = OVS_VPORT_TYPE_VXLAN,
.create = vxlan_tnl_create,
.destroy = vxlan_tnl_destroy,
.get_name = vxlan_get_name,
.get_options = vxlan_get_options,
.send = vxlan_tnl_send,
};
|
/*
Copyright Rene Rivera 2008-2013
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_LIBRARY_STD_DINKUMWARE_H
#define BOOST_PREDEF_LIBRARY_STD_DINKUMWARE_H
#include <boost/predef/library/std/_prefix.h>
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/*`
[heading `BOOST_LIB_STD_DINKUMWARE`]
[@http://en.wikipedia.org/wiki/Dinkumware Dinkumware] Standard C++ Library.
If available version number as major, minor, and patch.
[table
[[__predef_symbol__] [__predef_version__]]
[[`_YVALS`, `__IBMCPP__`] [__predef_detection__]]
[[`_CPPLIB_VER`] [__predef_detection__]]
[[`_CPPLIB_VER`] [V.R.0]]
]
*/
#define BOOST_LIB_STD_DINKUMWARE BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
# undef BOOST_LIB_STD_DINKUMWARE
# if defined(_CPPLIB_VER)
# define BOOST_LIB_STD_DINKUMWARE BOOST_PREDEF_MAKE_10_VVRR(_CPPLIB_VER)
# else
# define BOOST_LIB_STD_DINKUMWARE BOOST_VERSION_NUMBER_AVAILABLE
# endif
#endif
#if BOOST_LIB_STD_DINKUMWARE
# define BOOST_LIB_STD_DINKUMWARE_AVAILABLE
#endif
#define BOOST_LIB_STD_DINKUMWARE_NAME "Dinkumware"
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_DINKUMWARE,BOOST_LIB_STD_DINKUMWARE_NAME)
#endif
|
/* PR c/82167 */
/* { dg-do compile } */
void
fn1 (int a[])
{
__builtin_printf ("%zu\n", sizeof (*&a)); /* { dg-warning ".sizeof. on array function parameter .a. will return size of .int \\*." } */
}
void
fn2 (int *a[])
{
__builtin_printf ("%zu\n", sizeof (*&a)); /* { dg-warning ".sizeof. on array function parameter .a. will return size of .int \\*\\*." } */
}
|
/*
* Copyright 2008-2013 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <thrust/detail/config.h>
#include <thrust/system/detail/generic/tag.h>
namespace thrust
{
namespace system
{
namespace detail
{
namespace generic
{
template<typename DerivedPolicy,
typename ForwardIterator,
typename UnaryOperation>
__host__ __device__
void tabulate(thrust::execution_policy<DerivedPolicy> &exec,
ForwardIterator first,
ForwardIterator last,
UnaryOperation unary_op);
} // end namespace generic
} // end namespace detail
} // end namespace system
} // end namespace thrust
#include <thrust/system/detail/generic/tabulate.inl>
|
//===-- XCoreRegisterInfo.h - XCore Register Information Impl ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the XCore implementation of the MRegisterInfo class.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIB_TARGET_XCORE_XCOREREGISTERINFO_H
#define LLVM_LIB_TARGET_XCORE_XCOREREGISTERINFO_H
#include "llvm/Target/TargetRegisterInfo.h"
#define GET_REGINFO_HEADER
#include "XCoreGenRegisterInfo.inc"
namespace llvm {
class TargetInstrInfo;
struct XCoreRegisterInfo : public XCoreGenRegisterInfo {
public:
XCoreRegisterInfo();
/// Code Generation virtual methods...
const MCPhysReg *
getCalleeSavedRegs(const MachineFunction *MF =nullptr) const override;
BitVector getReservedRegs(const MachineFunction &MF) const override;
bool requiresRegisterScavenging(const MachineFunction &MF) const override;
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override;
bool useFPForScavengingIndex(const MachineFunction &MF) const override;
void eliminateFrameIndex(MachineBasicBlock::iterator II,
int SPAdj, unsigned FIOperandNum,
RegScavenger *RS = nullptr) const override;
// Debug information queries.
unsigned getFrameRegister(const MachineFunction &MF) const override;
//! Return whether to emit frame moves
static bool needsFrameMoves(const MachineFunction &MF);
};
} // end namespace llvm
#endif
|
/*
* highmem.c: virtual kernel memory mappings for high memory
*
* Provides kernel-static versions of atomic kmap functions originally
* found as inlines in include/asm-sparc/highmem.h. These became
* needed as kmap_atomic() and kunmap_atomic() started getting
* called from within modules.
* -- Tomas Szepe <szepe@pinerecords.com>, September 2002
*/
#include <linux/mm.h>
#include <linux/highmem.h>
#include <asm/pgalloc.h>
/*
* The use of kmap_atomic/kunmap_atomic is discouraged -- kmap()/kunmap()
* gives a more generic (and caching) interface. But kmap_atomic() can
* be used in IRQ contexts, so in some (very limited) cases we need it.
*/
void *kmap_atomic(struct page *page, enum km_type type)
{
unsigned long idx;
unsigned long vaddr;
if (page < highmem_start_page)
return page_address(page);
idx = type + KM_TYPE_NR * smp_processor_id();
vaddr = fix_kmap_begin + idx * PAGE_SIZE;
/* XXX Fix - Anton */
#if 0
__flush_cache_one(vaddr);
#else
flush_cache_all();
#endif
#if HIGHMEM_DEBUG
if (!pte_none(*(kmap_pte + idx)))
BUG();
#endif
set_pte(kmap_pte + idx, mk_pte(page, kmap_prot));
/* XXX Fix - Anton */
#if 0
__flush_tlb_one(vaddr);
#else
flush_tlb_all();
#endif
return (void *) vaddr;
}
void kunmap_atomic(void *kvaddr, enum km_type type)
{
unsigned long vaddr = (unsigned long) kvaddr;
unsigned long idx = type + KM_TYPE_NR * smp_processor_id();
if (vaddr < fix_kmap_begin) /* FIXME */
return;
if (vaddr != fix_kmap_begin + idx * PAGE_SIZE)
BUG();
/* XXX Fix - Anton */
#if 0
__flush_cache_one(vaddr);
#else
flush_cache_all();
#endif
#ifdef HIGHMEM_DEBUG
/*
* Force other mappings to oops if they try to access
* this pte without first remapping it.
*/
pte_clear(kmap_pte + idx);
/* XXX Fix - Anton */
#if 0
__flush_tlb_one(vaddr);
#else
flush_tlb_all();
#endif
#endif
}
|
// ObjList.h
// Copyright (c) 2009, Dan Heeks
// This program is released under the BSD license. See the file COPYING for details.
#pragma once
#include "HeeksObj.h"
#include "Tool.h"
#include <list>
#include <vector>
#include <set>
class ObjList : public HeeksObj
{
friend class ReorderTool;
protected:
std::list<HeeksObj*> m_objects;
std::list<HeeksObj*>::iterator LoopIt;
std::list<std::list<HeeksObj*>::iterator> LoopItStack;
std::vector<HeeksObj*> m_index_list; // for quick performance of GetAtIndex();
bool m_index_list_valid;
void recalculate_index_list();
public:
ObjList():m_index_list_valid(true){}
ObjList(const ObjList& objlist);
virtual ~ObjList(){}
const ObjList& operator=(const ObjList& objlist);
bool operator==( const ObjList & rhs ) const;
bool operator!=( const ObjList & rhs ) const { return(! (*this == rhs)); }
bool IsDifferent(HeeksObj *other) { return( *this != (*(ObjList *)other) ); }
void ClearUndoably(void);
void Clear(std::set<HeeksObj*> &to_delete);
HeeksObj* MakeACopy(void) const;
void GetBox(CBox &box);
void glCommands(bool select, bool marked, bool no_color);
void Draw(wxDC& dc);
HeeksObj* GetFirstChild();
HeeksObj* GetNextChild();
HeeksObj* GetAtIndex(int index);
int GetNumChildren();
std::list<HeeksObj *> GetChildren() const;
bool CanAdd(HeeksObj* object){return true;}
virtual bool Add(HeeksObj* object, HeeksObj* prev_object);
virtual void Add(std::list<HeeksObj*> objects);
virtual void Remove(HeeksObj* object);
virtual void Remove(std::list<HeeksObj*> objects);
void Clear();
void KillGLLists(void);
void WriteBaseXML(TiXmlElement *element);
void ReadBaseXML(TiXmlElement* element);
void ModifyByMatrix(const double *m);
void GetTriangles(void(*callbackfunc)(const double* x, const double* n), double cusp, bool just_one_average_normal = true);
bool IsList(){return true;}
void GetProperties(std::list<Property *> *list);
void ReloadPointers();
void OnChangeViewUnits(const double units);
HeeksObj *Find( const int type, const unsigned int id ); // Search for an object by type/id from this or any child objects.
/* virtual */ void SetIdPreservation(const bool flag);
};
class ReorderTool: public Undoable
{
ObjList* m_object;
std::list<HeeksObj *> m_original_order;
std::list<HeeksObj *> m_new_order;
public:
ReorderTool(ObjList* object, std::list<HeeksObj *> &new_order);
const wxChar* GetTitle(){return _("Reorder");}
void Run(bool redo);
void RollBack();
};
|
// Nintendo Game Boy sound hardware emulator with save state support
// Gb_Snd_Emu 0.2.0
#ifndef GB_APU_H
#define GB_APU_H
#include "Gb_Oscs.h"
struct gb_apu_state_t;
class Gb_Apu {
public:
// Basics
// Clock rate that sound hardware runs at.
enum { clock_rate = 4194304 * GB_APU_OVERCLOCK };
// Sets buffer(s) to generate sound into. If left and right are NULL, output is mono.
// If all are NULL, no output is generated but other emulation still runs.
// If chan is specified, only that channel's output is changed, otherwise all are.
enum { osc_count = 4 }; // 0: Square 1, 1: Square 2, 2: Wave, 3: Noise
void set_output( Blip_Buffer* center, Blip_Buffer* left = NULL, Blip_Buffer* right = NULL,
int chan = osc_count );
// Resets hardware to initial power on state BEFORE boot ROM runs. Mode selects
// sound hardware. Additional AGB wave features are enabled separately.
enum mode_t {
mode_dmg, // Game Boy monochrome
mode_cgb, // Game Boy Color
mode_agb // Game Boy Advance
};
void reset( mode_t mode = mode_cgb, bool agb_wave = false );
// Reads and writes must be within the start_addr to end_addr range, inclusive.
// Addresses outside this range are not mapped to the sound hardware.
enum { start_addr = 0xFF10 };
enum { end_addr = 0xFF3F };
enum { register_count = end_addr - start_addr + 1 };
// Times are specified as the number of clocks since the beginning of the
// current time frame.
// Emulates CPU write of data to addr at specified time.
void write_register( blip_time_t time, unsigned addr, int data );
// Emulates CPU read from addr at specified time.
int read_register( blip_time_t time, unsigned addr );
// Emulates sound hardware up to specified time, ends current time frame, then
// starts a new frame at time 0.
void end_frame( blip_time_t frame_length );
// Sound adjustments
// Sets overall volume, where 1.0 is normal.
void volume( double );
// If true, reduces clicking by disabling DAC biasing. Note that this reduces
// emulation accuracy, since the clicks are authentic.
void reduce_clicks( bool reduce = true );
// Sets treble equalization.
void treble_eq( blip_eq_t const& );
// Treble and bass values for various hardware.
enum {
speaker_treble = -47, // speaker on system
speaker_bass = 2000,
dmg_treble = 0, // headphones on each system
dmg_bass = 30,
cgb_treble = 0,
cgb_bass = 300, // CGB has much less bass
agb_treble = 0,
agb_bass = 30
};
// Sets frame sequencer rate, where 1.0 is normal. Meant for adjusting the
// tempo in a game music player.
void set_tempo( double );
// Save states
// Saves full emulation state to state_out. Data format is portable and
// includes some extra space to avoid expansion in case more state needs
// to be stored in the future.
void save_state( gb_apu_state_t* state_out );
// Loads state. You should call reset() BEFORE this.
blargg_err_t load_state( gb_apu_state_t const& in );
public:
Gb_Apu();
// Use set_output() in place of these
BLARGG_DEPRECATED void output ( Blip_Buffer* c ) { set_output( c, c, c ); }
BLARGG_DEPRECATED void output ( Blip_Buffer* c, Blip_Buffer* l, Blip_Buffer* r ) { set_output( c, l, r ); }
BLARGG_DEPRECATED void osc_output( int i, Blip_Buffer* c ) { set_output( c, c, c, i ); }
BLARGG_DEPRECATED void osc_output( int i, Blip_Buffer* c, Blip_Buffer* l, Blip_Buffer* r ) { set_output( c, l, r, i ); }
private:
// noncopyable
Gb_Apu( const Gb_Apu& );
Gb_Apu& operator = ( const Gb_Apu& );
Gb_Osc* oscs [osc_count];
blip_time_t last_time; // time sound emulator has been run to
blip_time_t frame_period; // clocks between each frame sequencer step
double volume_;
bool reduce_clicks_;
Gb_Sweep_Square square1;
Gb_Square square2;
Gb_Wave wave;
Gb_Noise noise;
blip_time_t frame_time; // time of next frame sequencer action
int frame_phase; // phase of next frame sequencer step
enum { regs_size = register_count + 0x10 };
BOOST::uint8_t regs [regs_size];// last values written to registers
// large objects after everything else
Gb_Osc::Good_Synth good_synth;
Gb_Osc::Med_Synth med_synth;
void reset_lengths();
void reset_regs();
int calc_output( int osc ) const;
void apply_stereo();
void apply_volume();
void synth_volume( int );
void run_until_( blip_time_t );
void run_until( blip_time_t );
void silence_osc( Gb_Osc& );
void write_osc( int index, int reg, int old_data, int data );
const char* save_load( gb_apu_state_t*, bool save );
void save_load2( gb_apu_state_t*, bool save );
friend class Gb_Apu_Tester;
};
// Format of save state. Should be stable across versions of the library,
// with earlier versions properly opening later save states. Includes some
// room for expansion so the state size shouldn't increase.
struct gb_apu_state_t
{
#if GB_APU_CUSTOM_STATE
// Values stored as plain int so your code can read/write them easily.
// Structure can NOT be written to disk, since format is not portable.
typedef int val_t;
#else
// Values written in portable little-endian format, allowing structure
// to be written directly to disk.
typedef unsigned char val_t [4];
#endif
enum { format0 = 0x50414247 };
val_t format; // format of all following data
val_t version; // later versions just add fields to end
unsigned char regs [0x40];
val_t frame_time;
val_t frame_phase;
val_t sweep_freq;
val_t sweep_delay;
val_t sweep_enabled;
val_t sweep_neg;
val_t noise_divider;
val_t wave_buf;
val_t delay [4];
val_t length_ctr [4];
val_t phase [4];
val_t enabled [4];
val_t env_delay [3];
val_t env_volume [3];
val_t env_enabled [3];
val_t unused [13]; // for future expansion
};
#endif
|
/*
* drivers/usb/gadget/s3c_udc.h
* Samsung S3C on-chip full/high speed USB device controllers
* Copyright (C) 2005 for Samsung Electronics
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __S3C_USB_GADGET
#define __S3C_USB_GADGET
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/types.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/timer.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
#include <linux/mm.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <asm/byteorder.h>
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/unaligned.h>
#if 0
#include <asm/hardware.h>
#endif
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/host_notify.h>
/* Max packet size */
#if defined(CONFIG_USB_GADGET_S3C_FS)
#define EP0_FIFO_SIZE 8
#define EP_FIFO_SIZE 64
#define S3C_MAX_ENDPOINTS 5
#elif defined(CONFIG_USB_GADGET_S3C_HS) || defined(CONFIG_PLAT_S5P64XX)\
|| defined(CONFIG_PLAT_S5PC11X) || defined(CONFIG_CPU_S5P6442)\
|| defined(CONFIG_CPU_S5P6450) || defined(CONFIG_CPU_S5PV310)
#define EP0_FIFO_SIZE 64
#define EP_FIFO_SIZE 512
#define EP_FIFO_SIZE2 1024
#define S3C_MAX_ENDPOINTS 16
#define DED_TX_FIFO 1 /* Dedicated NPTx fifo for s5p6440 */
#else
#define EP0_FIFO_SIZE 64
#define EP_FIFO_SIZE 512
#define EP_FIFO_SIZE2 1024
#define S3C_MAX_ENDPOINTS 16
#endif
#define WAIT_FOR_SETUP 0
#define DATA_STATE_XMIT 1
#define DATA_STATE_NEED_ZLP 2
#define WAIT_FOR_OUT_STATUS 3
#define DATA_STATE_RECV 4
#define RegReadErr 5
#define FAIL_TO_SETUP 6
#define TEST_J_SEL 0x1
#define TEST_K_SEL 0x2
#define TEST_SE0_NAK_SEL 0x3
#define TEST_PACKET_SEL 0x4
#define TEST_FORCE_ENABLE_SEL 0x5
#define USE_USB_LDO_CONTROL /* This definition is for LDO control. */
#include <linux/regulator/consumer.h>
/*
* ------------------------------------------------------------------------------------------
* Debugging macro and defines
*/
/*#define CSY_DEBUG */
/* #define CSY_DEBUG2 */
#define CSY_DEBUG_ESS
/* #define CSY_MORE_DEBUG */
#ifdef CSY_DEBUG
# ifdef CSY_MORE_DEBUG
# define CSY_DBG(fmt, args...) printk(KERN_INFO "usb %s:%d "fmt, __func__, __LINE__, ##args)
# else
# define CSY_DBG(fmt, args...) printk(KERN_DEBUG "usb "fmt, ##args)
# endif
#else /* DO NOT PRINT LOG */
# define CSY_DBG(fmt, args...) do { } while (0)
#endif /* CSY_DEBUG */
#ifdef CSY_DEBUG2
# ifdef CSY_MORE_DEBUG
# define CSY_DBG2(fmt, args...) printk(KERN_INFO "usb %s:%d "fmt, __func__, __LINE__, ##args)
# else
# define CSY_DBG2(fmt, args...) printk(KERN_DEBUG "usb "fmt, ##args)
# endif
#else /* DO NOT PRINT LOG */
# define CSY_DBG2(fmt, args...) do { } while (0)
#endif /* CSY_DEBUG2 */
#ifdef CSY_DEBUG_ESS
# ifdef CSY_MORE_DEBUG
# define CSY_DBG_ESS(fmt, args...) printk(KERN_INFO "usb %s:%d "fmt, __func__, __LINE__, ##args)
# else
# define CSY_DBG_ESS(fmt, args...) printk(KERN_DEBUG "usb "fmt, ##args)
# endif
#else /* DO NOT PRINT LOG */
# define CSY_DBG_ESS(fmt, args...) do { } while (0)
#endif /* CSY_DEBUG_ESS */
#ifdef CSY_DEBUG
#undef DBG
# define DBG(devvalue, fmt, args...) \
printk(KERN_INFO "usb %s:%d "fmt, __func__, __LINE__, ##args)
#endif
/* ************************************************************************* */
/* IO
*/
typedef enum ep_type {
ep_control, ep_bulk_in, ep_bulk_out, ep_interrupt
} ep_type_t;
struct s3c_ep {
struct usb_ep ep;
struct s3c_udc *dev;
const struct usb_endpoint_descriptor *desc;
struct list_head queue;
unsigned long pio_irqs;
u8 stopped;
u8 bEndpointAddress;
u8 bmAttributes;
ep_type_t ep_type;
u32 fifo;
#ifdef CONFIG_USB_GADGET_S3C_FS
u32 csr1;
u32 csr2;
#endif
};
struct s3c_request {
struct usb_request req;
struct list_head queue;
unsigned char mapped;
};
struct s3c_udc {
struct usb_gadget gadget;
struct usb_gadget_driver *driver;
#if 0
struct device *dev;
#endif
struct platform_device *dev;
spinlock_t lock;
#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
u16 status;
struct regulator *udc_vcc_d, *udc_vcc_a;
int udc_enabled;
atomic_t usb_status;
int (*get_usb_mode)(void);
int (*change_usb_mode)(int mode);
struct mutex mutex;
struct host_notify_dev * ndev;
#endif
int ep0state;
struct s3c_ep ep[S3C_MAX_ENDPOINTS];
unsigned char usb_address;
unsigned req_pending:1, req_std:1, req_config:1;
};
extern struct s3c_udc *the_controller;
#define ep_is_in(EP) (((EP)->bEndpointAddress&USB_DIR_IN) == USB_DIR_IN)
#define ep_index(EP) ((EP)->bEndpointAddress&0xF)
#define ep_maxpacket(EP) ((EP)->ep.maxpacket)
#endif
|
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_GL_INIT_GL_INIT_EXPORT_H_
#define UI_GL_INIT_GL_INIT_EXPORT_H_
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(GL_INIT_IMPLEMENTATION)
#define GL_INIT_EXPORT __declspec(dllexport)
#else
#define GL_INIT_EXPORT __declspec(dllimport)
#endif // defined(GL_INIT_IMPLEMENTATION)
#else // defined(WIN32)
#if defined(GL_INIT_IMPLEMENTATION)
#define GL_INIT_EXPORT __attribute__((visibility("default")))
#else
#define GL_INIT_EXPORT
#endif
#endif
#else // defined(COMPONENT_BUILD)
#define GL_INIT_EXPORT
#endif
#endif // UI_GL_INIT_GL_INIT_EXPORT_H_
|
/* We do not define a getdirentries or getdirentries64 entry point at all. */
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_
#define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/spellchecker/spelling_service_client.h"
#include "content/public/browser/browser_message_filter.h"
class SpellCheckMarker;
class SpellcheckService;
struct SpellCheckResult;
// A message filter implementation that receives spell checker requests from
// SpellCheckProvider.
class SpellCheckMessageFilter : public content::BrowserMessageFilter {
public:
explicit SpellCheckMessageFilter(int render_process_id);
// content::BrowserMessageFilter implementation.
void OverrideThreadForMessage(const IPC::Message& message,
content::BrowserThread::ID* thread) override;
bool OnMessageReceived(const IPC::Message& message) override;
private:
friend class TestingSpellCheckMessageFilter;
~SpellCheckMessageFilter() override;
void OnSpellCheckerRequestDictionary();
void OnNotifyChecked(const base::string16& word, bool misspelled);
void OnRespondDocumentMarkers(const std::vector<uint32>& markers);
#if !defined(OS_MACOSX)
void OnCallSpellingService(int route_id,
int identifier,
const base::string16& text,
std::vector<SpellCheckMarker> markers);
// A callback function called when the Spelling service finishes checking
// text. Sends the given results to a renderer.
void OnTextCheckComplete(
int route_id,
int identifier,
const std::vector<SpellCheckMarker>& markers,
bool success,
const base::string16& text,
const std::vector<SpellCheckResult>& results);
// Checks the user profile and sends a JSON-RPC request to the Spelling
// service if a user enables the "Ask Google for suggestions" option. When we
// receive a response (including an error) from the service, it calls
// OnTextCheckComplete. When this function is called before we receive a
// response for the previous request, this function cancels the previous
// request and sends a new one.
void CallSpellingService(
const base::string16& text,
int route_id,
int identifier,
const std::vector<SpellCheckMarker>& markers);
#endif
// Can be overridden for testing.
virtual SpellcheckService* GetSpellcheckService() const;
int render_process_id_;
// A JSON-RPC client that calls the Spelling service in the background.
scoped_ptr<SpellingServiceClient> client_;
};
#endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_
|
/*
* Copyright (C) 2002 ARM Limited, 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 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/irqchip/arm-gic.h>
#include "irq-gic-common.h"
void gic_configure_irq(unsigned int irq, unsigned int type,
void __iomem *base, void (*sync_access)(void))
{
u32 enablemask = 1 << (irq % 32);
u32 enableoff = (irq / 32) * 4;
u32 confmask = 0x2 << ((irq % 16) * 2);
u32 confoff = (irq / 16) * 4;
bool enabled = false;
u32 val;
/*
* Read current configuration register, and insert the config
* for "irq", depending on "type".
*/
val = readl_relaxed(base + GIC_DIST_CONFIG + confoff);
#ifdef CONFIG_MEDIATEK_SOLUTION
if ((type == IRQ_TYPE_LEVEL_HIGH) || (type == IRQ_TYPE_LEVEL_LOW))
val &= ~confmask;
else if ((type == IRQ_TYPE_EDGE_RISING) ||
(type == IRQ_TYPE_EDGE_FALLING))
val |= confmask;
#else
if (type == IRQ_TYPE_LEVEL_HIGH)
val &= ~confmask;
else if (type == IRQ_TYPE_EDGE_RISING)
val |= confmask;
#endif
/*
* As recommended by the spec, disable the interrupt before changing
* the configuration
*/
if (readl_relaxed(base + GIC_DIST_ENABLE_SET + enableoff) & enablemask) {
writel_relaxed(enablemask, base + GIC_DIST_ENABLE_CLEAR + enableoff);
if (sync_access)
sync_access();
enabled = true;
}
/*
* Write back the new configuration, and possibly re-enable
* the interrupt.
*/
writel_relaxed(val, base + GIC_DIST_CONFIG + confoff);
if (enabled)
writel_relaxed(enablemask, base + GIC_DIST_ENABLE_SET + enableoff);
if (sync_access)
sync_access();
}
void __init gic_dist_config(void __iomem *base, int gic_irqs,
void (*sync_access)(void))
{
unsigned int i;
/*
* Set all global interrupts to be level triggered, active low.
*/
for (i = 32; i < gic_irqs; i += 16)
writel_relaxed(GICD_INT_ACTLOW_LVLTRIG,
base + GIC_DIST_CONFIG + i / 4);
/*
* Set priority on all global interrupts.
*/
for (i = 32; i < gic_irqs; i += 4)
writel_relaxed(GICD_INT_DEF_PRI_X4, base + GIC_DIST_PRI + i);
/*
* Disable all interrupts. Leave the PPI and SGIs alone
* as they are enabled by redistributor registers.
*/
for (i = 32; i < gic_irqs; i += 32)
writel_relaxed(GICD_INT_EN_CLR_X32,
base + GIC_DIST_ENABLE_CLEAR + i / 8);
if (sync_access)
sync_access();
}
void gic_cpu_config(void __iomem *base, void (*sync_access)(void))
{
int i;
/*
* Deal with the banked PPI and SGI interrupts - disable all
* PPI interrupts, ensure all SGI interrupts are enabled.
*/
writel_relaxed(GICD_INT_EN_CLR_PPI, base + GIC_DIST_ENABLE_CLEAR);
writel_relaxed(GICD_INT_EN_SET_SGI, base + GIC_DIST_ENABLE_SET);
/*
* Set priority on PPI and SGI interrupts
*/
for (i = 0; i < 32; i += 4)
writel_relaxed(GICD_INT_DEF_PRI_X4,
base + GIC_DIST_PRI + i * 4 / 4);
if (sync_access)
sync_access();
}
|
/* Copyright (C) 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _SYS_TIMERFD_H
#define _SYS_TIMERFD_H 1
#include <time.h>
/* Bits to be set in the FLAGS parameter of `timerfd_create'. */
enum
{
TFD_CLOEXEC = 0x400000,
#define TFD_CLOEXEC TFD_CLOEXEC
TFD_NONBLOCK = 0x4000
#define TFD_NONBLOCK TFD_NONBLOCK
};
/* Bits to be set in the FLAGS parameter of `timerfd_settime'. */
enum
{
TFD_TIMER_ABSTIME = 1 << 0
#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
};
__BEGIN_DECLS
/* Return file descriptor for new interval timer source. */
extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW;
/* Set next expiration time of interval timer source UFD to UTMR. If
FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
absolute. Optionally return the old expiration time in OTMR. */
extern int timerfd_settime (int __ufd, int __flags,
__const struct itimerspec *__utmr,
struct itimerspec *__otmr) __THROW;
/* Return the next expiration time of UFD. */
extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
__END_DECLS
#endif /* sys/timerfd.h */
|
/**
******************************************************************************
* @file usb_init.c
* @author MCD Application Team
* @version V4.0.0
* @date 28-August-2012
* @brief Initialization routines & global variables
******************************************************************************
Released into the public domain.
This work is free: you can redistribute it and/or modify it under the terms of
Creative Commons Zero license v1.0
This work is licensed under the Creative Commons Zero 1.0 United States License.
To view a copy of this license, visit http://creativecommons.org/publicdomain/zero/1.0/
or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco,
California, 94105, USA.
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.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "usb_lib.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* The number of current endpoint, it will be used to specify an endpoint */
uint8_t EPindex;
/* The number of current device, it is an index to the Device_Table */
/* uint8_t Device_no; */
/* Points to the DEVICE_INFO structure of current device */
/* The purpose of this register is to speed up the execution */
DEVICE_INFO *pInformation;
/* Points to the DEVICE_PROP structure of current device */
/* The purpose of this register is to speed up the execution */
const DEVICE_PROP *pProperty;
/* Temporary save the state of Rx & Tx status. */
/* Whenever the Rx or Tx state is changed, its value is saved */
/* in this variable first and will be set to the EPRB or EPRA */
/* at the end of interrupt process */
volatile uint16_t SaveState ;
volatile uint16_t wInterrupt_Mask;
DEVICE_INFO Device_Info;
const USER_STANDARD_REQUESTS *pUser_Standard_Requests;
/* Extern variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/*******************************************************************************
* Function Name : USB_Init
* Description : USB system initialization
* Input : None.
* Output : None.
* Return : None.
*******************************************************************************/
void USB_Init(void)
{
pInformation = &Device_Info;
pInformation->ControlState = 2;
pProperty = &Device_Property;
pUser_Standard_Requests = &User_Standard_Requests;
/* Initialize devices one by one */
pProperty->Init();
}
|
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-forwprop1 -fdump-tree-ccp1" } */
int foo (int x)
{
int tem = x / 3;
return tem / 5;
}
int bar (int x)
{
int tem = x / 3;
return tem / (__INT_MAX__ / 2);
}
/* { dg-final { scan-tree-dump "x_.\\(D\\) / 15" "forwprop1" } } */
/* { dg-final { scan-tree-dump "return 0;" "ccp1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "ccp1" } } */
|
/*
* Copyright (c) 2017, Mellanox Technologies. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 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 MLX5_IB_CMD_H
#define MLX5_IB_CMD_H
#include "mlx5_ib.h"
#include <linux/kernel.h>
#include <linux/mlx5/driver.h>
int mlx5_cmd_dump_fill_mkey(struct mlx5_core_dev *dev, u32 *mkey);
int mlx5_cmd_null_mkey(struct mlx5_core_dev *dev, u32 *null_mkey);
int mlx5_cmd_query_cong_params(struct mlx5_core_dev *dev, int cong_point,
void *out);
int mlx5_cmd_alloc_memic(struct mlx5_dm *dm, phys_addr_t *addr,
u64 length, u32 alignment);
void mlx5_cmd_dealloc_memic(struct mlx5_dm *dm, phys_addr_t addr, u64 length);
void mlx5_cmd_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn, u16 uid);
void mlx5_cmd_destroy_tir(struct mlx5_core_dev *dev, u32 tirn, u16 uid);
void mlx5_cmd_destroy_tis(struct mlx5_core_dev *dev, u32 tisn, u16 uid);
void mlx5_cmd_destroy_rqt(struct mlx5_core_dev *dev, u32 rqtn, u16 uid);
int mlx5_cmd_alloc_transport_domain(struct mlx5_core_dev *dev, u32 *tdn,
u16 uid);
void mlx5_cmd_dealloc_transport_domain(struct mlx5_core_dev *dev, u32 tdn,
u16 uid);
int mlx5_cmd_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid,
u32 qpn, u16 uid);
int mlx5_cmd_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid,
u32 qpn, u16 uid);
int mlx5_cmd_xrcd_alloc(struct mlx5_core_dev *dev, u32 *xrcdn, u16 uid);
int mlx5_cmd_xrcd_dealloc(struct mlx5_core_dev *dev, u32 xrcdn, u16 uid);
int mlx5_cmd_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb,
u16 opmod, u8 port);
#endif /* MLX5_IB_CMD_H */
|
/*
* omap iommu: omap device registration
*
* Copyright (C) 2008-2009 Nokia Corporation
*
* Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/platform_device.h>
#include <linux/err.h>
#include <plat/iommu.h>
#include <plat/omap_device.h>
#include <plat/omap_hwmod.h>
struct iommu_device {
resource_size_t base;
int irq;
struct iommu_platform_data pdata;
struct resource res[2];
};
static struct iommu_platform_data *devices_data;
static int num_iommu_devices;
#ifdef CONFIG_ARCH_OMAP3
static struct iommu_platform_data omap3_devices_data[] = {
{
.name = "isp",
.oh_name = "isp",
.nr_tlb_entries = 8,
.da_start = 0x0,
.da_end = 0xFFFFF000,
},
#if defined(CONFIG_OMAP_IOMMU_IVA2)
{
.name = "iva2",
.oh_name = "dsp",
.nr_tlb_entries = 32,
.da_start = 0x11000000,
.da_end = 0xFFFFF000,
},
#endif
};
#define NR_OMAP3_IOMMU_DEVICES ARRAY_SIZE(omap3_devices_data)
#else
#define omap3_devices_data NULL
#define NR_OMAP3_IOMMU_DEVICES 0
#endif
#ifdef CONFIG_ARCH_OMAP4
#define SET_DSP_CONSTRAINT 10
#define SET_MPU_CORE_CONSTRAINT 10
static struct iommu_platform_data omap4_devices_data[] = {
{
.name = "ducati",
.oh_name = "ipu",
.nr_tlb_entries = 32,
.da_start = 0x0,
.da_end = 0xFFFFF000,
.pm_constraint = SET_MPU_CORE_CONSTRAINT,
},
{
.name = "tesla",
.oh_name = "dsp",
.nr_tlb_entries = 32,
.da_start = 0x0,
.da_end = 0xFFFFF000,
.pm_constraint = SET_DSP_CONSTRAINT,
},
};
#define NR_OMAP4_IOMMU_DEVICES ARRAY_SIZE(omap4_devices_data)
#else
#define omap4_devices_data NULL
#define NR_OMAP4_IOMMU_DEVICES 0
#endif
static struct omap_device_pm_latency omap_iommu_latency[] = {
[0] = {
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
int iommu_get_plat_data_size(void)
{
return num_iommu_devices;
}
EXPORT_SYMBOL(iommu_get_plat_data_size);
struct iommu_platform_data *iommu_get_device_data(void)
{
return devices_data;
}
static int __init omap_iommu_init(void)
{
int i, ohl_cnt;
struct omap_hwmod *oh;
struct omap_device *od;
struct omap_device_pm_latency *ohl;
if (cpu_is_omap34xx()) {
devices_data = omap3_devices_data;
num_iommu_devices = NR_OMAP3_IOMMU_DEVICES;
} else if (cpu_is_omap44xx()) {
devices_data = omap4_devices_data;
num_iommu_devices = NR_OMAP4_IOMMU_DEVICES;
} else
return -ENODEV;
ohl = omap_iommu_latency;
ohl_cnt = ARRAY_SIZE(omap_iommu_latency);
for (i = 0; i < num_iommu_devices; i++) {
struct iommu_platform_data *data = &devices_data[i];
oh = omap_hwmod_lookup(data->oh_name);
data->io_base = oh->_mpu_rt_va;
data->irq = oh->mpu_irqs[0].irq;
if (!oh) {
pr_err("%s: could not look up %s\n", __func__,
data->oh_name);
continue;
}
od = omap_device_build("omap-iommu", i, oh,
data, sizeof(*data),
ohl, ohl_cnt, false);
WARN(IS_ERR(od), "Could not build omap_device"
"for %s %s\n", "omap-iommu", data->oh_name);
}
return 0;
}
module_init(omap_iommu_init);
MODULE_AUTHOR("Hiroshi DOYU");
MODULE_AUTHOR("Hari Kanigeri");
MODULE_DESCRIPTION("omap iommu: omap device registration");
MODULE_LICENSE("GPL v2");
|
/*
* (C) Copyright 2002
* Daniel Engström, Omicron Ceti AB, daniel@omicron.se
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_PROCESSOR_H_
#define __ASM_PROCESSOR_H_ 1
/* Currently this header is unused in the i386 port
* but some generic files #include <asm/processor.h>
* so this file is a placeholder. */
#endif
|
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
#ident "$Id$"
/*======
This file is part of PerconaFT.
Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
PerconaFT 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.
PerconaFT 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 PerconaFT. If not, see <http://www.gnu.org/licenses/>.
----------------------------------------
PerconaFT is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License, version 3,
as published by the Free Software Foundation.
PerconaFT 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
======= */
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
#pragma once
#include <memory.h>
//******************************************************************************
//
// Overview: A growable array is a little bit like std::vector except that
// it doesn't have constructors (hence can be used in static constructs, since
// the google style guide says no constructors), and it's a little simpler.
// Operations:
// init and deinit (we don't have constructors and destructors).
// fetch_unchecked to get values out.
// store_unchecked to put values in.
// push to add an element at the end
// get_size to find out the size
// get_memory_size to find out how much memory the data stucture is using.
//
//******************************************************************************
namespace toku {
template<typename T> class GrowableArray {
public:
void init (void)
// Effect: Initialize the array to contain no elements.
{
m_array=NULL;
m_size=0;
m_size_limit=0;
}
void deinit (void)
// Effect: Deinitialize the array (freeing any memory it uses, for example).
{
toku_free(m_array);
m_array =NULL;
m_size =0;
m_size_limit=0;
}
T fetch_unchecked (size_t i) const
// Effect: Fetch the ith element. If i is out of range, the system asserts.
{
return m_array[i];
}
void store_unchecked (size_t i, T v)
// Effect: Store v in the ith element. If i is out of range, the system asserts.
{
paranoid_invariant(i<m_size);
m_array[i]=v;
}
void push (T v)
// Effect: Add v to the end of the array (increasing the size). The amortized cost of this operation is constant.
// Implementation hint: Double the size of the array when it gets too big so that the amortized cost stays constant.
{
if (m_size>=m_size_limit) {
if (m_array==NULL) {
m_size_limit=1;
} else {
m_size_limit*=2;
}
XREALLOC_N(m_size_limit, m_array);
}
m_array[m_size++]=v;
}
size_t get_size (void) const
// Effect: Return the number of elements in the array.
{
return m_size;
}
size_t memory_size(void) const
// Effect: Return the size (in bytes) that the array occupies in memory. This is really only an estimate.
{
return sizeof(*this)+sizeof(T)*m_size_limit;
}
private:
T *m_array;
size_t m_size;
size_t m_size_limit; // How much space is allocated in array.
};
}
|
/*=============================================================================
Library: CTK
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=============================================================================*/
#ifndef CTKPLUGINGENERATOROPTIONSDIALOG_H
#define CTKPLUGINGENERATOROPTIONSDIALOG_H
#include <QDialog>
namespace Ui {
class ctkPluginGeneratorOptionsDialog;
}
class ctkPluginGeneratorOptionsDialog : public QDialog
{
Q_OBJECT
public:
explicit ctkPluginGeneratorOptionsDialog(QWidget *parent = 0);
~ctkPluginGeneratorOptionsDialog();
void accept();
private:
Ui::ctkPluginGeneratorOptionsDialog *ui;
};
#endif // CTKPLUGINGENERATOROPTIONSDIALOG_H
|
/*********************************************************************/
/* Copyright 2009, 2010 The University of Texas at Austin. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
/* without modification, are permitted provided that the following */
/* conditions are met: */
/* */
/* 1. Redistributions of source code must retain the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer. */
/* */
/* 2. Redistributions in binary form must reproduce the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer in the documentation and/or other materials */
/* provided with the distribution. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
/* AUSTIN ``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 UNIVERSITY OF TEXAS AT */
/* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
/* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
/* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */
/* */
/* The views and conclusions contained in the software and */
/* documentation are those of the authors and should not be */
/* interpreted as representing official policies, either expressed */
/* or implied, of The University of Texas at Austin. */
/*********************************************************************/
#include <stdio.h>
#include <ctype.h>
#include "common.h"
#ifdef FUNCTION_PROFILE
#include "functable.h"
#endif
#ifdef XDOUBLE
#define ERROR_NAME "QSPR "
#elif defined(DOUBLE)
#define ERROR_NAME "DSPR "
#else
#define ERROR_NAME "SSPR "
#endif
static int (*spr[])(BLASLONG, FLOAT, FLOAT *, BLASLONG, FLOAT *, FLOAT *) = {
#ifdef XDOUBLE
qspr_U, qspr_L,
#elif defined(DOUBLE)
dspr_U, dspr_L,
#else
sspr_U, sspr_L,
#endif
};
#ifdef SMP
static int (*spr_thread[])(BLASLONG, FLOAT, FLOAT *, BLASLONG, FLOAT *, FLOAT *, int) = {
#ifdef XDOUBLE
qspr_thread_U, qspr_thread_L,
#elif defined(DOUBLE)
dspr_thread_U, dspr_thread_L,
#else
sspr_thread_U, sspr_thread_L,
#endif
};
#endif
#ifndef CBLAS
void NAME(char *UPLO, blasint *N, FLOAT *ALPHA,
FLOAT *x, blasint *INCX, FLOAT *a){
char uplo_arg = *UPLO;
blasint n = *N;
FLOAT alpha = *ALPHA;
blasint incx = *INCX;
blasint info;
int uplo;
FLOAT *buffer;
#ifdef SMP
int nthreads;
#endif
PRINT_DEBUG_NAME;
TOUPPER(uplo_arg);
uplo = -1;
if (uplo_arg == 'U') uplo = 0;
if (uplo_arg == 'L') uplo = 1;
info = 0;
if (incx == 0) info = 5;
if (n < 0) info = 2;
if (uplo < 0) info = 1;
if (info != 0) {
BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME));
return;
}
#else
void CNAME(enum CBLAS_ORDER order,
enum CBLAS_UPLO Uplo,
blasint n,
FLOAT alpha,
FLOAT *x, blasint incx,
FLOAT *a) {
FLOAT *buffer;
int uplo;
blasint info;
#ifdef SMP
int nthreads;
#endif
PRINT_DEBUG_CNAME;
uplo = -1;
info = 0;
if (order == CblasColMajor) {
if (Uplo == CblasUpper) uplo = 0;
if (Uplo == CblasLower) uplo = 1;
info = -1;
if (incx == 0) info = 5;
if (n < 0) info = 2;
if (uplo < 0) info = 1;
}
if (order == CblasRowMajor) {
if (Uplo == CblasUpper) uplo = 1;
if (Uplo == CblasLower) uplo = 0;
info = -1;
if (incx == 0) info = 5;
if (n < 0) info = 2;
if (uplo < 0) info = 1;
}
if (info >= 0) {
BLASFUNC(xerbla)(ERROR_NAME, &info, sizeof(ERROR_NAME));
return;
}
#endif
if (n == 0) return;
if (alpha == ZERO) return;
IDEBUG_START;
FUNCTION_PROFILE_START();
if (incx < 0 ) x -= (n - 1) * incx;
buffer = (FLOAT *)blas_memory_alloc(1);
#ifdef SMP
nthreads = num_cpu_avail(2);
if (nthreads == 1) {
#endif
(spr[uplo])(n, alpha, x, incx, a, buffer);
#ifdef SMP
} else {
(spr_thread[uplo])(n, alpha, x, incx, a, buffer, nthreads);
}
#endif
blas_memory_free(buffer);
FUNCTION_PROFILE_END(1, n * n / 2 + n, n * n);
IDEBUG_END;
return;
}
|
/*
* Sonics Silicon Backplane
* Broadcom USB-core OHCI driver
*
* Copyright 2007 Michael Buesch <mb@bu3sch.de>
*
* Derived from the OHCI-PCI driver
* Copyright 1999 Roman Weissgaerber
* Copyright 2000-2002 David Brownell
* Copyright 1999 Linus Torvalds
* Copyright 1999 Gregory P. Smith
*
* Derived from the USBcore related parts of Broadcom-SB
* Copyright 2005 Broadcom Corporation
*
* Licensed under the GNU/GPL. See COPYING for details.
*/
#include <linux/ssb/ssb.h>
#define SSB_OHCI_TMSLOW_HOSTMODE (1 << 29)
struct ssb_ohci_device {
struct ohci_hcd ohci; /* _must_ be at the beginning. */
u32 enable_flags;
};
static inline
struct ssb_ohci_device *hcd_to_ssb_ohci(struct usb_hcd *hcd)
{
return (struct ssb_ohci_device *)(hcd->hcd_priv);
}
static int ssb_ohci_reset(struct usb_hcd *hcd)
{
struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
struct ohci_hcd *ohci = &ohcidev->ohci;
int err;
ohci_hcd_init(ohci);
err = ohci_init(ohci);
return err;
}
static int ssb_ohci_start(struct usb_hcd *hcd)
{
struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
struct ohci_hcd *ohci = &ohcidev->ohci;
int err;
err = ohci_run(ohci);
if (err < 0) {
ohci_err(ohci, "can't start\n");
ohci_stop(hcd);
}
return err;
}
#ifdef CONFIG_PM
static int ssb_ohci_hcd_suspend(struct usb_hcd *hcd, pm_message_t message)
{
struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
struct ohci_hcd *ohci = &ohcidev->ohci;
unsigned long flags;
spin_lock_irqsave(&ohci->lock, flags);
ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
ohci_readl(ohci, &ohci->regs->intrdisable); /* commit write */
/* make sure snapshot being resumed re-enumerates everything */
if (message.event == PM_EVENT_PRETHAW)
ohci_usb_reset(ohci);
clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
spin_unlock_irqrestore(&ohci->lock, flags);
return 0;
}
static int ssb_ohci_hcd_resume(struct usb_hcd *hcd)
{
set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
usb_hcd_resume_root_hub(hcd);
return 0;
}
#endif /* CONFIG_PM */
static const struct hc_driver ssb_ohci_hc_driver = {
.description = "ssb-usb-ohci",
.product_desc = "SSB OHCI Controller",
.hcd_priv_size = sizeof(struct ssb_ohci_device),
.irq = ohci_irq,
.flags = HCD_MEMORY | HCD_USB11,
.reset = ssb_ohci_reset,
.start = ssb_ohci_start,
.stop = ohci_stop,
.shutdown = ohci_shutdown,
#ifdef CONFIG_PM
.suspend = ssb_ohci_hcd_suspend,
.resume = ssb_ohci_hcd_resume,
#endif
.urb_enqueue = ohci_urb_enqueue,
.urb_dequeue = ohci_urb_dequeue,
.endpoint_disable = ohci_endpoint_disable,
.get_frame_number = ohci_get_frame,
.hub_status_data = ohci_hub_status_data,
.hub_control = ohci_hub_control,
.hub_irq_enable = ohci_rhsc_enable,
#ifdef CONFIG_PM
.bus_suspend = ohci_bus_suspend,
.bus_resume = ohci_bus_resume,
#endif
.start_port_reset = ohci_start_port_reset,
};
static void ssb_ohci_detach(struct ssb_device *dev)
{
struct usb_hcd *hcd = ssb_get_drvdata(dev);
usb_remove_hcd(hcd);
iounmap(hcd->regs);
usb_put_hcd(hcd);
ssb_device_disable(dev, 0);
}
static int ssb_ohci_attach(struct ssb_device *dev)
{
struct ssb_ohci_device *ohcidev;
struct usb_hcd *hcd;
int err = -ENOMEM;
u32 tmp, flags = 0;
if (dev->id.coreid == SSB_DEV_USB11_HOSTDEV)
flags |= SSB_OHCI_TMSLOW_HOSTMODE;
ssb_device_enable(dev, flags);
hcd = usb_create_hcd(&ssb_ohci_hc_driver, dev->dev,
dev->dev->bus_id);
if (!hcd)
goto err_dev_disable;
ohcidev = hcd_to_ssb_ohci(hcd);
ohcidev->enable_flags = flags;
tmp = ssb_read32(dev, SSB_ADMATCH0);
hcd->rsrc_start = ssb_admatch_base(tmp);
hcd->rsrc_len = ssb_admatch_size(tmp);
hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
if (!hcd->regs)
goto err_put_hcd;
err = usb_add_hcd(hcd, dev->irq, IRQF_DISABLED | IRQF_SHARED);
if (err)
goto err_iounmap;
ssb_set_drvdata(dev, hcd);
return err;
err_iounmap:
iounmap(hcd->regs);
err_put_hcd:
usb_put_hcd(hcd);
err_dev_disable:
ssb_device_disable(dev, flags);
return err;
}
static int ssb_ohci_probe(struct ssb_device *dev,
const struct ssb_device_id *id)
{
int err;
u16 chipid_top;
/* USBcores are only connected on embedded devices. */
chipid_top = (dev->bus->chip_id & 0xFF00);
if (chipid_top != 0x4700 && chipid_top != 0x5300)
return -ENODEV;
/* TODO: Probably need checks here; is the core connected? */
if (usb_disabled())
return -ENODEV;
/* We currently always attach SSB_DEV_USB11_HOSTDEV
* as HOST OHCI. If we want to attach it as Client device,
* we must branch here and call into the (yet to
* be written) Client mode driver. Same for remove(). */
err = ssb_ohci_attach(dev);
return err;
}
static void ssb_ohci_remove(struct ssb_device *dev)
{
ssb_ohci_detach(dev);
}
#ifdef CONFIG_PM
static int ssb_ohci_suspend(struct ssb_device *dev, pm_message_t state)
{
ssb_device_disable(dev, 0);
return 0;
}
static int ssb_ohci_resume(struct ssb_device *dev)
{
struct usb_hcd *hcd = ssb_get_drvdata(dev);
struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
ssb_device_enable(dev, ohcidev->enable_flags);
return 0;
}
#else /* !CONFIG_PM */
#define ssb_ohci_suspend NULL
#define ssb_ohci_resume NULL
#endif /* CONFIG_PM */
static const struct ssb_device_id ssb_ohci_table[] = {
SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOSTDEV, SSB_ANY_REV),
SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOST, SSB_ANY_REV),
SSB_DEVTABLE_END
};
MODULE_DEVICE_TABLE(ssb, ssb_ohci_table);
static struct ssb_driver ssb_ohci_driver = {
.name = KBUILD_MODNAME,
.id_table = ssb_ohci_table,
.probe = ssb_ohci_probe,
.remove = ssb_ohci_remove,
.suspend = ssb_ohci_suspend,
.resume = ssb_ohci_resume,
};
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* Qualcomm SMEM NAND flash partition parser
*
* Copyright (C) 2020, Linaro Ltd.
*/
#include <linux/ctype.h>
#include <linux/module.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/slab.h>
#include <linux/soc/qcom/smem.h>
#define SMEM_AARM_PARTITION_TABLE 9
#define SMEM_APPS 0
#define SMEM_FLASH_PART_MAGIC1 0x55ee73aa
#define SMEM_FLASH_PART_MAGIC2 0xe35ebddb
#define SMEM_FLASH_PTABLE_V3 3
#define SMEM_FLASH_PTABLE_V4 4
#define SMEM_FLASH_PTABLE_MAX_PARTS_V3 16
#define SMEM_FLASH_PTABLE_MAX_PARTS_V4 48
#define SMEM_FLASH_PTABLE_HDR_LEN (4 * sizeof(u32))
#define SMEM_FLASH_PTABLE_NAME_SIZE 16
/**
* struct smem_flash_pentry - SMEM Flash partition entry
* @name: Name of the partition
* @offset: Offset in blocks
* @length: Length of the partition in blocks
* @attr: Flags for this partition
*/
struct smem_flash_pentry {
char name[SMEM_FLASH_PTABLE_NAME_SIZE];
__le32 offset;
__le32 length;
u8 attr;
} __packed __aligned(4);
/**
* struct smem_flash_ptable - SMEM Flash partition table
* @magic1: Partition table Magic 1
* @magic2: Partition table Magic 2
* @version: Partition table version
* @numparts: Number of partitions in this ptable
* @pentry: Flash partition entries belonging to this ptable
*/
struct smem_flash_ptable {
__le32 magic1;
__le32 magic2;
__le32 version;
__le32 numparts;
struct smem_flash_pentry pentry[SMEM_FLASH_PTABLE_MAX_PARTS_V4];
} __packed __aligned(4);
static int parse_qcomsmem_part(struct mtd_info *mtd,
const struct mtd_partition **pparts,
struct mtd_part_parser_data *data)
{
struct smem_flash_pentry *pentry;
struct smem_flash_ptable *ptable;
size_t len = SMEM_FLASH_PTABLE_HDR_LEN;
struct mtd_partition *parts;
int ret, i, numparts;
char *name, *c;
if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_4K_SECTORS)
&& mtd->type == MTD_NORFLASH) {
pr_err("%s: SMEM partition parser is incompatible with 4K sectors\n",
mtd->name);
return -EINVAL;
}
pr_debug("Parsing partition table info from SMEM\n");
ptable = qcom_smem_get(SMEM_APPS, SMEM_AARM_PARTITION_TABLE, &len);
if (IS_ERR(ptable)) {
pr_err("Error reading partition table header\n");
return PTR_ERR(ptable);
}
/* Verify ptable magic */
if (le32_to_cpu(ptable->magic1) != SMEM_FLASH_PART_MAGIC1 ||
le32_to_cpu(ptable->magic2) != SMEM_FLASH_PART_MAGIC2) {
pr_err("Partition table magic verification failed\n");
return -EINVAL;
}
/* Ensure that # of partitions is less than the max we have allocated */
numparts = le32_to_cpu(ptable->numparts);
if (numparts > SMEM_FLASH_PTABLE_MAX_PARTS_V4) {
pr_err("Partition numbers exceed the max limit\n");
return -EINVAL;
}
/* Find out length of partition data based on table version */
if (le32_to_cpu(ptable->version) <= SMEM_FLASH_PTABLE_V3) {
len = SMEM_FLASH_PTABLE_HDR_LEN + SMEM_FLASH_PTABLE_MAX_PARTS_V3 *
sizeof(struct smem_flash_pentry);
} else if (le32_to_cpu(ptable->version) == SMEM_FLASH_PTABLE_V4) {
len = SMEM_FLASH_PTABLE_HDR_LEN + SMEM_FLASH_PTABLE_MAX_PARTS_V4 *
sizeof(struct smem_flash_pentry);
} else {
pr_err("Unknown ptable version (%d)", le32_to_cpu(ptable->version));
return -EINVAL;
}
/*
* Now that the partition table header has been parsed, verified
* and the length of the partition table calculated, read the
* complete partition table
*/
ptable = qcom_smem_get(SMEM_APPS, SMEM_AARM_PARTITION_TABLE, &len);
if (IS_ERR(ptable)) {
pr_err("Error reading partition table\n");
return PTR_ERR(ptable);
}
parts = kcalloc(numparts, sizeof(*parts), GFP_KERNEL);
if (!parts)
return -ENOMEM;
for (i = 0; i < numparts; i++) {
pentry = &ptable->pentry[i];
if (pentry->name[0] == '\0')
continue;
name = kstrdup(pentry->name, GFP_KERNEL);
if (!name) {
ret = -ENOMEM;
goto out_free_parts;
}
/* Convert name to lower case */
for (c = name; *c != '\0'; c++)
*c = tolower(*c);
parts[i].name = name;
parts[i].offset = le32_to_cpu(pentry->offset) * mtd->erasesize;
parts[i].mask_flags = pentry->attr;
parts[i].size = le32_to_cpu(pentry->length) * mtd->erasesize;
pr_debug("%d: %s offs=0x%08x size=0x%08x attr:0x%08x\n",
i, pentry->name, le32_to_cpu(pentry->offset),
le32_to_cpu(pentry->length), pentry->attr);
}
pr_debug("SMEM partition table found: ver: %d len: %d\n",
le32_to_cpu(ptable->version), numparts);
*pparts = parts;
return numparts;
out_free_parts:
while (--i >= 0)
kfree(parts[i].name);
kfree(parts);
*pparts = NULL;
return ret;
}
static const struct of_device_id qcomsmem_of_match_table[] = {
{ .compatible = "qcom,smem-part" },
{},
};
MODULE_DEVICE_TABLE(of, qcomsmem_of_match_table);
static struct mtd_part_parser mtd_parser_qcomsmem = {
.parse_fn = parse_qcomsmem_part,
.name = "qcomsmem",
.of_match_table = qcomsmem_of_match_table,
};
module_mtd_part_parser(mtd_parser_qcomsmem);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>");
MODULE_DESCRIPTION("Qualcomm SMEM NAND flash partition parser");
|
/*
* Copyright (C) 2018 Freie Universität Berlin
* Copyright (C) 2018 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Tests c25519 package
*
* @author Koen Zandberg <koen@bergzand.net>
*
* @}
*/
#include <string.h>
#include "edsign.h"
#include "ed25519.h"
#include "embUnit.h"
#include "random.h"
static uint8_t message[] = "0123456789abcdef";
static uint8_t sign_sk[EDSIGN_SECRET_KEY_SIZE];
static uint8_t sign_pk[EDSIGN_PUBLIC_KEY_SIZE];
static uint8_t signature[EDSIGN_SIGNATURE_SIZE];
static void setUp(void)
{
/* Initialize */
random_init(0);
}
static void test_c25519_signverify(void)
{
int res;
/* Creating keypair ... */
random_bytes(sign_sk, sizeof(sign_sk));
ed25519_prepare(sign_sk);
edsign_sec_to_pub(sign_pk, sign_sk);
/* Sign */
edsign_sign(signature, sign_pk, sign_sk, message, sizeof(message));
/* Verifying... */
res = edsign_verify(signature, sign_pk, message, sizeof(message));
TEST_ASSERT(res);
}
static void test_c25519_verifynegative(void)
{
int res;
/* changing message */
message[0] = 'A';
/* Verifying... */
res = edsign_verify(signature, sign_pk, message, sizeof(message));
TEST_ASSERT_EQUAL_INT(0, res);
}
Test *tests_c25519(void)
{
EMB_UNIT_TESTFIXTURES(fixtures) {
new_TestFixture(test_c25519_signverify),
new_TestFixture(test_c25519_verifynegative)
};
EMB_UNIT_TESTCALLER(c25519_tests, setUp, NULL, fixtures);
return (Test*)&c25519_tests;
}
int main(void)
{
TESTS_START();
TESTS_RUN(tests_c25519());
TESTS_END();
return 0;
}
|
/* GLIB - Library of useful routines for C programming
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GLib Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GLib at ftp://ftp.gtk.org/pub/gtk/.
*/
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
#error "Only <glib.h> can be included directly."
#endif
#ifndef __G_THREADPOOL_H__
#define __G_THREADPOOL_H__
#include <glib/gthread.h>
G_BEGIN_DECLS
typedef struct _GThreadPool GThreadPool;
/* Thread Pools
*/
struct _GThreadPool
{
GFunc func;
gpointer user_data;
gboolean exclusive;
};
GThreadPool * g_thread_pool_new (GFunc func,
gpointer user_data,
gint max_threads,
gboolean exclusive,
GError **error);
void g_thread_pool_free (GThreadPool *pool,
gboolean immediate,
gboolean wait_);
gboolean g_thread_pool_push (GThreadPool *pool,
gpointer data,
GError **error);
guint g_thread_pool_unprocessed (GThreadPool *pool);
void g_thread_pool_set_sort_function (GThreadPool *pool,
GCompareDataFunc func,
gpointer user_data);
gboolean g_thread_pool_set_max_threads (GThreadPool *pool,
gint max_threads,
GError **error);
gint g_thread_pool_get_max_threads (GThreadPool *pool);
guint g_thread_pool_get_num_threads (GThreadPool *pool);
void g_thread_pool_set_max_unused_threads (gint max_threads);
gint g_thread_pool_get_max_unused_threads (void);
guint g_thread_pool_get_num_unused_threads (void);
void g_thread_pool_stop_unused_threads (void);
void g_thread_pool_set_max_idle_time (guint interval);
guint g_thread_pool_get_max_idle_time (void);
G_END_DECLS
#endif /* __G_THREADPOOL_H__ */
|
#ifndef _LINUX_RING_BUFFER_H
#define _LINUX_RING_BUFFER_H
#include <linux/mm.h>
#include <linux/seq_file.h>
struct ring_buffer;
struct ring_buffer_iter;
/*
* Don't refer to this struct directly, use functions below.
*/
struct ring_buffer_event {
u32 type:2, len:3, time_delta:27;
u32 array[];
};
/**
* enum ring_buffer_type - internal ring buffer types
*
* @RINGBUF_TYPE_PADDING: Left over page padding or discarded event
* If time_delta is 0:
* array is ignored
* size is variable depending on how much
* padding is needed
* If time_delta is non zero:
* everything else same as RINGBUF_TYPE_DATA
*
* @RINGBUF_TYPE_TIME_EXTEND: Extend the time delta
* array[0] = time delta (28 .. 59)
* size = 8 bytes
*
* @RINGBUF_TYPE_TIME_STAMP: Sync time stamp with external clock
* array[0] = tv_nsec
* array[1..2] = tv_sec
* size = 16 bytes
*
* @RINGBUF_TYPE_DATA: Data record
* If len is zero:
* array[0] holds the actual length
* array[1..(length+3)/4] holds data
* size = 4 + 4 + length (bytes)
* else
* length = len << 2
* array[0..(length+3)/4-1] holds data
* size = 4 + length (bytes)
*/
enum ring_buffer_type {
RINGBUF_TYPE_PADDING,
RINGBUF_TYPE_TIME_EXTEND,
/* FIXME: RINGBUF_TYPE_TIME_STAMP not implemented */
RINGBUF_TYPE_TIME_STAMP,
RINGBUF_TYPE_DATA,
};
unsigned ring_buffer_event_length(struct ring_buffer_event *event);
void *ring_buffer_event_data(struct ring_buffer_event *event);
/**
* ring_buffer_event_time_delta - return the delta timestamp of the event
* @event: the event to get the delta timestamp of
*
* The delta timestamp is the 27 bit timestamp since the last event.
*/
static inline unsigned
ring_buffer_event_time_delta(struct ring_buffer_event *event)
{
return event->time_delta;
}
void ring_buffer_event_discard(struct ring_buffer_event *event);
/*
* size is in bytes for each per CPU buffer.
*/
struct ring_buffer *
ring_buffer_alloc(unsigned long size, unsigned flags);
void ring_buffer_free(struct ring_buffer *buffer);
int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size);
struct ring_buffer_event *ring_buffer_lock_reserve(struct ring_buffer *buffer,
unsigned long length);
int ring_buffer_unlock_commit(struct ring_buffer *buffer,
struct ring_buffer_event *event);
int ring_buffer_write(struct ring_buffer *buffer,
unsigned long length, void *data);
struct ring_buffer_event *
ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts);
struct ring_buffer_event *
ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts);
struct ring_buffer_iter *
ring_buffer_read_start(struct ring_buffer *buffer, int cpu);
void ring_buffer_read_finish(struct ring_buffer_iter *iter);
struct ring_buffer_event *
ring_buffer_iter_peek(struct ring_buffer_iter *iter, u64 *ts);
struct ring_buffer_event *
ring_buffer_read(struct ring_buffer_iter *iter, u64 *ts);
void ring_buffer_iter_reset(struct ring_buffer_iter *iter);
int ring_buffer_iter_empty(struct ring_buffer_iter *iter);
unsigned long ring_buffer_size(struct ring_buffer *buffer);
void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu);
void ring_buffer_reset(struct ring_buffer *buffer);
int ring_buffer_swap_cpu(struct ring_buffer *buffer_a,
struct ring_buffer *buffer_b, int cpu);
int ring_buffer_empty(struct ring_buffer *buffer);
int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu);
void ring_buffer_record_disable(struct ring_buffer *buffer);
void ring_buffer_record_enable(struct ring_buffer *buffer);
void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu);
void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu);
unsigned long ring_buffer_entries(struct ring_buffer *buffer);
unsigned long ring_buffer_overruns(struct ring_buffer *buffer);
unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu);
unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu);
u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu);
void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer,
int cpu, u64 *ts);
void ring_buffer_set_clock(struct ring_buffer *buffer,
u64 (*clock)(void));
size_t ring_buffer_page_len(void *page);
void *ring_buffer_alloc_read_page(struct ring_buffer *buffer);
void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data);
int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page,
size_t len, int cpu, int full);
enum ring_buffer_flags {
RB_FL_OVERWRITE = 1 << 0,
};
#endif /* _LINUX_RING_BUFFER_H */
|
/*
* ex-opt.c
*
* Extension command line options
*
* (c) 2006, Luis E. Garcia Ontanon <luis@ontanon.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <glib.h>
#include "ex-opt.h"
static GHashTable* ex_opts = NULL;
gboolean ex_opt_add(const gchar* optarg) {
gchar** splitted;
if (!ex_opts)
ex_opts = g_hash_table_new(g_str_hash,g_str_equal);
splitted = g_strsplit(optarg,":",2);
if (splitted[0] && splitted[1]) {
GPtrArray* this_opts = (GPtrArray *)g_hash_table_lookup(ex_opts,splitted[0]);
if (this_opts) {
g_ptr_array_add(this_opts,splitted[1]);
g_free(splitted[0]);
} else {
this_opts = g_ptr_array_new();
g_ptr_array_add(this_opts,splitted[1]);
g_hash_table_insert(ex_opts,splitted[0],this_opts);
}
g_free(splitted);
return TRUE;
} else {
g_strfreev(splitted);
return FALSE;
}
}
gint ex_opt_count(const gchar* key) {
GPtrArray* this_opts;
if (! ex_opts)
return 0;
this_opts = (GPtrArray *)g_hash_table_lookup(ex_opts,key);
if (this_opts) {
return this_opts->len;
} else {
return 0;
}
}
const gchar* ex_opt_get_nth(const gchar* key, guint index) {
GPtrArray* this_opts;
if (! ex_opts)
return 0;
this_opts = (GPtrArray *)g_hash_table_lookup(ex_opts,key);
if (this_opts) {
if (this_opts->len > index) {
return (const gchar *)g_ptr_array_index(this_opts,index);
} else {
/* XXX: assert? */
return NULL;
}
} else {
return NULL;
}
}
extern const gchar* ex_opt_get_next(const gchar* key) {
GPtrArray* this_opts;
if (! ex_opts)
return 0;
this_opts = (GPtrArray *)g_hash_table_lookup(ex_opts,key);
if (this_opts) {
if (this_opts->len)
return (const gchar *)g_ptr_array_remove_index(this_opts,0);
else
return NULL;
} else {
return NULL;
}
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
|
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef METAJAVA_H
#define METAJAVA_H
#include "abstractmetalang.h"
class MetaJavaClass;
class MetaJavaField;
class MetaJavaFunction;
class MetaJavaType;
class MetaJavaVariable;
class MetaJavaArgument;
class MetaJavaEnumValue;
class MetaJavaEnum;
class MetaJavaType : public AbstractMetaType
{};
class MetaJavaArgument : public AbstractMetaArgument
{};
class MetaJavaField : public AbstractMetaField
{};
class MetaJavaFunction : public AbstractMetaFunction
{};
class MetaJavaEnumValue : public AbstractMetaEnumValue
{};
class MetaJavaEnum : public AbstractMetaEnum
{};
class MetaJavaClass : public AbstractMetaClass
{};
#endif // METAJAVA_H
|
#ifndef POST_H_HD2H7K9B
#define POST_H_HD2H7K9B
#include <oak/misc.h>
PUBLIC long post_to_server (std::string const& url, std::map<std::string, std::string> const& payload, std::map<std::string, std::string>* headersOut = NULL);
#endif /* end of include guard: POST_H_HD2H7K9B */
|
/**
* WinPR: Windows Portable Runtime
* WinPR Logger
*
* Copyright 2014 Armin Novak <armin.novak@thincast.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef WINPR_WLOG_CALLBACK_APPENDER_PRIVATE_H
#define WINPR_WLOG_CALLBACK_APPENDER_PRIVATE_H
#include <winpr/wlog.h>
#include "wlog/wlog.h"
WINPR_API wLogCallbackAppender* WLog_CallbackAppender_New(wLog* log);
WINPR_API void WLog_CallbackAppender_Free(wLog* log, wLogCallbackAppender* appender);
#endif /* WINPR_WLOG_CALLBACK_APPENDER_PRIVATE_H */
|
#import <Foundation/Foundation.h>
@interface MJUserNotificationManager : NSObject
+ (MJUserNotificationManager*) sharedManager;
- (void) sendNotification:(NSString*)title handler:(dispatch_block_t)handler;
@end
|
/*
* include/linux/nfsd/nfsfh.h
*
* This file describes the layout of the file handles as passed
* over the wire.
*
* Earlier versions of knfsd used to sign file handles using keyed MD5
* or SHA. I've removed this code, because it doesn't give you more
* security than blocking external access to port 2049 on your firewall.
*
* Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
*/
#ifndef _LINUX_NFSD_FH_H
#define _LINUX_NFSD_FH_H
# include <linux/types.h>
#include <linux/nfsd/const.h>
/*
* This is the old "dentry style" Linux NFSv2 file handle.
*
* The xino and xdev fields are currently used to transport the
* ino/dev of the exported inode.
*/
struct nfs_fhbase_old {
__u32 fb_dcookie; /* dentry cookie - always 0xfeebbaca */
__u32 fb_ino; /* our inode number */
__u32 fb_dirino; /* dir inode number, 0 for directories */
__u32 fb_dev; /* our device */
__u32 fb_xdev;
__u32 fb_xino;
__u32 fb_generation;
};
/*
* This is the new flexible, extensible style NFSv2/v3 file handle.
* by Neil Brown <neilb@cse.unsw.edu.au> - March 2000
*
* The file handle starts with a sequence of four-byte words.
* The first word contains a version number (1) and three descriptor bytes
* that tell how the remaining 3 variable length fields should be handled.
* These three bytes are auth_type, fsid_type and fileid_type.
*
* All four-byte values are in host-byte-order.
*
* The auth_type field specifies how the filehandle can be authenticated
* This might allow a file to be confirmed to be in a writable part of a
* filetree without checking the path from it upto the root.
* Current values:
* 0 - No authentication. fb_auth is 0 bytes long
* Possible future values:
* 1 - 4 bytes taken from MD5 hash of the remainer of the file handle
* prefixed by a secret and with the important export flags.
*
* The fsid_type identifies how the filesystem (or export point) is
* encoded.
* Current values:
* 0 - 4 byte device id (ms-2-bytes major, ls-2-bytes minor), 4byte inode number
* NOTE: we cannot use the kdev_t device id value, because kdev_t.h
* says we mustn't. We must break it up and reassemble.
* 1 - 4 byte user specified identifier
* 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED
* 3 - 4 byte device id, encoded for user-space, 4 byte inode number
* 4 - 4 byte inode number and 4 byte uuid
* 5 - 8 byte uuid
* 6 - 16 byte uuid
* 7 - 8 byte inode number and 16 byte uuid
*
* The fileid_type identified how the file within the filesystem is encoded.
* This is (will be) passed to, and set by, the underlying filesystem if it supports
* filehandle operations. The filesystem must not use the value '0' or '0xff' and may
* only use the values 1 and 2 as defined below:
* Current values:
* 0 - The root, or export point, of the filesystem. fb_fileid is 0 bytes.
* 1 - 32bit inode number, 32 bit generation number.
* 2 - 32bit inode number, 32 bit generation number, 32 bit parent directory inode number.
*
*/
struct nfs_fhbase_new {
__u8 fb_version; /* == 1, even => nfs_fhbase_old */
__u8 fb_auth_type;
__u8 fb_fsid_type;
__u8 fb_fileid_type;
__u32 fb_auth[1];
/* __u32 fb_fsid[0]; floating */
/* __u32 fb_fileid[0]; floating */
};
struct knfsd_fh {
unsigned int fh_size; /* significant for NFSv3.
* Points to the current size while building
* a new file handle
*/
union {
struct nfs_fhbase_old fh_old;
__u32 fh_pad[NFS4_FHSIZE/4];
struct nfs_fhbase_new fh_new;
} fh_base;
};
#define ofh_dcookie fh_base.fh_old.fb_dcookie
#define ofh_ino fh_base.fh_old.fb_ino
#define ofh_dirino fh_base.fh_old.fb_dirino
#define ofh_dev fh_base.fh_old.fb_dev
#define ofh_xdev fh_base.fh_old.fb_xdev
#define ofh_xino fh_base.fh_old.fb_xino
#define ofh_generation fh_base.fh_old.fb_generation
#define fh_version fh_base.fh_new.fb_version
#define fh_fsid_type fh_base.fh_new.fb_fsid_type
#define fh_auth_type fh_base.fh_new.fb_auth_type
#define fh_fileid_type fh_base.fh_new.fb_fileid_type
#define fh_auth fh_base.fh_new.fb_auth
#define fh_fsid fh_base.fh_new.fb_auth
#endif /* _LINUX_NFSD_FH_H */
|
/* A small multi-threaded test case.
Copyright 2004, 2007 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdio.h>
#include <time.h>
void
cond_wait (pthread_cond_t *cond, pthread_mutex_t *mut)
{
pthread_mutex_lock(mut);
pthread_cond_wait (cond, mut);
pthread_mutex_unlock (mut);
}
void
noreturn (void)
{
pthread_mutex_t mut;
pthread_cond_t cond;
pthread_mutex_init (&mut, NULL);
pthread_cond_init (&cond, NULL);
/* Wait for a condition that will never be signaled, so we effectively
block the thread here. */
cond_wait (&cond, &mut);
}
void *
forever_pthread (void *unused)
{
noreturn ();
}
void
break_me (void)
{
/* Just an anchor to help putting a breakpoint. */
}
int
main (void)
{
pthread_t forever;
const struct timespec ts = { 0, 10000000 }; /* 0.01 sec */
pthread_create (&forever, NULL, forever_pthread, NULL);
for (;;)
{
nanosleep (&ts, NULL);
break_me();
}
return 0;
}
|
//===-- SystemZMCTargetDesc.h - SystemZ target descriptions -----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZMCTARGETDESC_H
#define LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZMCTARGETDESC_H
#include "llvm/Support/DataTypes.h"
namespace llvm {
class MCAsmBackend;
class MCCodeEmitter;
class MCContext;
class MCInstrInfo;
class MCObjectWriter;
class MCRegisterInfo;
class MCSubtargetInfo;
class StringRef;
class Target;
class Triple;
class raw_pwrite_stream;
class raw_ostream;
extern Target TheSystemZTarget;
namespace SystemZMC {
// How many bytes are in the ABI-defined, caller-allocated part of
// a stack frame.
const int64_t CallFrameSize = 160;
// The offset of the DWARF CFA from the incoming stack pointer.
const int64_t CFAOffsetFromInitialSP = CallFrameSize;
// Maps of asm register numbers to LLVM register numbers, with 0 indicating
// an invalid register. In principle we could use 32-bit and 64-bit register
// classes directly, provided that we relegated the GPR allocation order
// in SystemZRegisterInfo.td to an AltOrder and left the default order
// as %r0-%r15. It seems better to provide the same interface for
// all classes though.
extern const unsigned GR32Regs[16];
extern const unsigned GRH32Regs[16];
extern const unsigned GR64Regs[16];
extern const unsigned GR128Regs[16];
extern const unsigned FP32Regs[16];
extern const unsigned FP64Regs[16];
extern const unsigned FP128Regs[16];
extern const unsigned VR32Regs[32];
extern const unsigned VR64Regs[32];
extern const unsigned VR128Regs[32];
// Return the 0-based number of the first architectural register that
// contains the given LLVM register. E.g. R1D -> 1.
unsigned getFirstReg(unsigned Reg);
// Return the given register as a GR64.
inline unsigned getRegAsGR64(unsigned Reg) {
return GR64Regs[getFirstReg(Reg)];
}
// Return the given register as a low GR32.
inline unsigned getRegAsGR32(unsigned Reg) {
return GR32Regs[getFirstReg(Reg)];
}
// Return the given register as a high GR32.
inline unsigned getRegAsGRH32(unsigned Reg) {
return GRH32Regs[getFirstReg(Reg)];
}
// Return the given register as a VR128.
inline unsigned getRegAsVR128(unsigned Reg) {
return VR128Regs[getFirstReg(Reg)];
}
} // end namespace SystemZMC
MCCodeEmitter *createSystemZMCCodeEmitter(const MCInstrInfo &MCII,
const MCRegisterInfo &MRI,
MCContext &Ctx);
MCAsmBackend *createSystemZMCAsmBackend(const Target &T,
const MCRegisterInfo &MRI,
const Triple &TT, StringRef CPU);
MCObjectWriter *createSystemZObjectWriter(raw_pwrite_stream &OS, uint8_t OSABI);
} // end namespace llvm
// Defines symbolic names for SystemZ registers.
// This defines a mapping from register name to register number.
#define GET_REGINFO_ENUM
#include "SystemZGenRegisterInfo.inc"
// Defines symbolic names for the SystemZ instructions.
#define GET_INSTRINFO_ENUM
#include "SystemZGenInstrInfo.inc"
#define GET_SUBTARGETINFO_ENUM
#include "SystemZGenSubtargetInfo.inc"
#endif
|
/* Generated automatically. DO NOT EDIT! */
#define SIMD_HEADER "simd-neon.h"
#include "../common/hc2cbdftv_20.c"
|
/***************************************************************************
qgsgraphalyzer.h - QGIS Tools for graph analysis
-------------------
begin : 14 april 2010
copyright : (C) Sergey Yakushev
email : yakushevs@list.ru
***************************************************************************/
/***************************************************************************
* *
* 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 QGSGRAPHANALYZERH
#define QGSGRAPHANALYZERH
//QT-includes
#include <QVector>
// forward-declaration
class QgsGraph;
/** \ingroup networkanalysis
* The QGis class provides graph analysis functions
*/
class ANALYSIS_EXPORT QgsGraphAnalyzer
{
public:
/**
* solve shortest path problem using dijkstra algorithm
* @param source The source graph
* @param startVertexIdx index of start vertex
* @param criterionNum index of arc property as optimization criterion
* @param resultTree array represents the shortest path tree. resultTree[ vertexIndex ] == inboundingArcIndex if vertex reacheble and resultTree[ vertexIndex ] == -1 others.
* @param resultCost array of cost paths
*/
static void dijkstra( const QgsGraph* source, int startVertexIdx, int criterionNum, QVector<int>* resultTree = NULL, QVector<double>* resultCost = NULL );
/**
* return shortest path tree with root-node in startVertexIdx
* @param source The source graph
* @param startVertexIdx index of start vertex
* @param criterionNum index of edge property as optimization criterion
*/
static QgsGraph* shortestTree( const QgsGraph* source, int startVertexIdx, int criterionNum );
};
#endif //QGSGRAPHANALYZERH
|
/* { dg-do compile { target { ! ia32 } } } */
/* { dg-options "-O2 -mavx512vl -mavx512dq" } */
#include <x86intrin.h>
__m128d
f1 (__m128d a, __m128d b)
{
register __m128d c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm_and_pd (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vandpd\[^\n\r\]*xmm\[0-9\]" 1 } } */
__m128d
f2 (__m128d a, __m128d b)
{
register __m128d c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm_or_pd (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vorpd\[^\n\r\]*xmm\[0-9\]" 1 } } */
__m128d
f3 (__m128d a, __m128d b)
{
register __m128d c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm_xor_pd (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vxorpd\[^\n\r\]*xmm\[0-9\]" 1 } } */
__m128d
f4 (__m128d a, __m128d b)
{
register __m128d c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm_andnot_pd (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vandnpd\[^\n\r\]*xmm\[0-9\]" 1 } } */
__m128
f5 (__m128 a, __m128 b)
{
register __m128 c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm_and_ps (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vandps\[^\n\r\]*xmm\[0-9\]" 1 } } */
__m128
f6 (__m128 a, __m128 b)
{
register __m128 c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm_or_ps (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vorps\[^\n\r\]*xmm\[0-9\]" 1 } } */
__m128
f7 (__m128 a, __m128 b)
{
register __m128 c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm_xor_ps (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 1 } } */
__m128
f8 (__m128 a, __m128 b)
{
register __m128 c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm_andnot_ps (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vandnps\[^\n\r\]*xmm\[0-9\]" 1 } } */
__m256d
f9 (__m256d a, __m256d b)
{
register __m256d c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm256_and_pd (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vandpd\[^\n\r\]*ymm\[0-9\]" 1 } } */
__m256d
f10 (__m256d a, __m256d b)
{
register __m256d c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm256_or_pd (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vorpd\[^\n\r\]*ymm\[0-9\]" 1 } } */
__m256d
f11 (__m256d a, __m256d b)
{
register __m256d c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm256_xor_pd (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vxorpd\[^\n\r\]*ymm\[0-9\]" 1 } } */
__m256d
f12 (__m256d a, __m256d b)
{
register __m256d c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm256_andnot_pd (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vandnpd\[^\n\r\]*ymm\[0-9\]" 1 } } */
__m256
f13 (__m256 a, __m256 b)
{
register __m256 c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm256_and_ps (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vandps\[^\n\r\]*ymm\[0-9\]" 1 } } */
__m256
f14 (__m256 a, __m256 b)
{
register __m256 c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm256_or_ps (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vorps\[^\n\r\]*ymm\[0-9\]" 1 } } */
__m256
f15 (__m256 a, __m256 b)
{
register __m256 c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm256_xor_ps (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*ymm\[0-9\]" 1 } } */
__m256
f16 (__m256 a, __m256 b)
{
register __m256 c __asm ("xmm16") = a;
asm volatile ("" : "+v" (c));
c = _mm256_andnot_ps (c, b);
asm volatile ("" : "+v" (c));
return c;
}
/* { dg-final { scan-assembler-times "vandnps\[^\n\r\]*ymm\[0-9\]" 1 } } */
|
/*****************************************************************************
* dummy.c: dummy stream output module
*****************************************************************************
* Copyright (C) 2003-2004 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_block.h>
#include <vlc_sout.h>
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
static int Send( sout_stream_t *, sout_stream_id_t *, block_t* );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin ()
set_description( N_("Dummy stream output") )
set_capability( "sout stream", 50 )
add_shortcut( "dummy", "drop" )
set_callbacks( Open, Close )
vlc_module_end ()
/*****************************************************************************
* Open:
*****************************************************************************/
static int Open( vlc_object_t *p_this )
{
sout_stream_t *p_stream = (sout_stream_t*)p_this;
p_stream->pf_add = Add;
p_stream->pf_del = Del;
p_stream->pf_send = Send;
p_stream->p_sys = NULL;
return VLC_SUCCESS;
}
/*****************************************************************************
* Close:
*****************************************************************************/
static void Close( vlc_object_t * p_this )
{
(void)p_this;
}
static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
{
VLC_UNUSED(p_stream); VLC_UNUSED(p_fmt);
return malloc( 1 );
}
static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
{
VLC_UNUSED(p_stream);
free( id );
return VLC_SUCCESS;
}
static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
block_t *p_buffer )
{
(void)p_stream; (void)id;
block_ChainRelease( p_buffer );
return VLC_SUCCESS;
}
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __nssrenam_h_
#define __nssrenam_h_
#define CERT_AddTempCertToPerm __CERT_AddTempCertToPerm
#define PK11_CreateContextByRawKey __PK11_CreateContextByRawKey
#define CERT_ClosePermCertDB __CERT_ClosePermCertDB
#define CERT_DecodeDERCertificate __CERT_DecodeDERCertificate
#define CERT_TraversePermCertsForNickname __CERT_TraversePermCertsForNickname
#define CERT_TraversePermCertsForSubject __CERT_TraversePermCertsForSubject
#endif /* __nssrenam_h_ */
|
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
/* This struct includes all reserved words and functions */
#ifndef _lex_symbol_h
#define _lex_symbol_h
enum SYM_GROUP
{
SG_KEYWORDS= 1 << 0, // SQL keywords and reserved words
SG_FUNCTIONS= 1 << 1, // very special native SQL functions
SG_HINTABLE_KEYWORDS= 1 << 2, // SQL keywords that accept optimizer hints
SG_HINTS= 1 << 3, // optimizer hint parser keywords
/* All tokens of the main parser: */
SG_MAIN_PARSER= SG_KEYWORDS | SG_HINTABLE_KEYWORDS | SG_FUNCTIONS
};
struct SYMBOL {
const char *name;
const unsigned int length;
const unsigned int tok;
int group; //< group mask, see SYM_GROUP enum for bits
};
struct LEX_SYMBOL
{
const SYMBOL *symbol;
char *str;
unsigned int length;
};
#endif /* _lex_symbol_h */
|
#ifndef M68K_MCF_PGALLOC_H
#define M68K_MCF_PGALLOC_H
#include <asm/tlb.h>
#include <asm/tlbflush.h>
extern inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
{
free_page((unsigned long) pte);
}
extern const char bad_pmd_string[];
extern inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
unsigned long address)
{
unsigned long page = __get_free_page(GFP_DMA);
if (!page)
return NULL;
memset((void *)page, 0, PAGE_SIZE);
return (pte_t *) (page);
}
extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address)
{
return (pmd_t *) pgd;
}
#define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); })
#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); })
#define pte_alloc_one_fast(mm, addr) pte_alloc_one(mm, addr)
#define pmd_populate(mm, pmd, page) (pmd_val(*pmd) = \
(unsigned long)(page_address(page)))
#define pmd_populate_kernel(mm, pmd, pte) (pmd_val(*pmd) = (unsigned long)(pte))
#define pmd_pgtable(pmd) pmd_page(pmd)
static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page,
unsigned long address)
{
__free_page(page);
}
#define __pmd_free_tlb(tlb, pmd, address) do { } while (0)
static inline struct page *pte_alloc_one(struct mm_struct *mm,
unsigned long address)
{
struct page *page = alloc_pages(GFP_DMA, 0);
pte_t *pte;
if (!page)
return NULL;
if (!pgtable_page_ctor(page)) {
__free_page(page);
return NULL;
}
pte = kmap(page);
if (pte) {
clear_page(pte);
__flush_page_to_ram(pte);
flush_tlb_kernel_page(pte);
nocache_page(pte);
}
kunmap(page);
return page;
}
extern inline void pte_free(struct mm_struct *mm, struct page *page)
{
__free_page(page);
}
/*
* In our implementation, each pgd entry contains 1 pmd that is never allocated
* or freed. pgd_present is always 1, so this should never be called. -NL
*/
#define pmd_free(mm, pmd) BUG()
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{
free_page((unsigned long) pgd);
}
static inline pgd_t *pgd_alloc(struct mm_struct *mm)
{
pgd_t *new_pgd;
new_pgd = (pgd_t *)__get_free_page(GFP_DMA | __GFP_NOWARN);
if (!new_pgd)
return NULL;
memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE);
memset(new_pgd, 0, PAGE_OFFSET >> PGDIR_SHIFT);
return new_pgd;
}
#define pgd_populate(mm, pmd, pte) BUG()
#endif /* M68K_MCF_PGALLOC_H */
|
#ifndef _LINUX_X25_ASY_H
#define _LINUX_X25_ASY_H
/* X.25 asy configuration. */
#define SL_NRUNIT 256 /* MAX number of X.25 channels;
This can be overridden with
insmod -ox25_asy_maxdev=nnn */
#define SL_MTU 256
/* X25 async protocol characters. */
#define X25_END 0x7E /* indicates end of frame */
#define X25_ESC 0x7D /* indicates byte stuffing */
#define X25_ESCAPE(x) ((x)^0x20)
#define X25_UNESCAPE(x) ((x)^0x20)
struct x25_asy {
int magic;
/* Various fields. */
struct tty_struct *tty; /* ptr to TTY structure */
struct net_device *dev; /* easy for intr handling */
/* These are pointers to the malloc()ed frame buffers. */
unsigned char *rbuff; /* receiver buffer */
int rcount; /* received chars counter */
unsigned char *xbuff; /* transmitter buffer */
unsigned char *xhead; /* pointer to next byte to XMIT */
int xleft; /* bytes left in XMIT queue */
/* X.25 interface statistics. */
unsigned long rx_packets; /* inbound frames counter */
unsigned long tx_packets; /* outbound frames counter */
unsigned long rx_bytes; /* inbound byte counte */
unsigned long tx_bytes; /* outbound byte counter */
unsigned long rx_errors; /* Parity, etc. errors */
unsigned long tx_errors; /* Planned stuff */
unsigned long rx_dropped; /* No memory for skb */
unsigned long tx_dropped; /* When MTU change */
unsigned long rx_over_errors; /* Frame bigger then X.25 buf. */
int mtu; /* Our mtu (to spot changes!) */
int buffsize; /* Max buffers sizes */
unsigned long flags; /* Flag values/ mode etc */
#define SLF_INUSE 0 /* Channel in use */
#define SLF_ESCAPE 1 /* ESC received */
#define SLF_ERROR 2 /* Parity, etc. error */
#define SLF_OUTWAIT 4 /* Waiting for output */
};
#define X25_ASY_MAGIC 0x5303
extern int x25_asy_init(struct net_device *dev);
#endif /* _LINUX_X25_ASY.H */
|
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/sh_intc.h>
int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int irq;
if (dev->bus->number == 0) {
switch (slot) {
case 4: return evt2irq(0x2a0); /* eth0 */
case 8: return evt2irq(0x2a0); /* eth1 */
case 6: return evt2irq(0x240); /* PCI bridge */
default:
printk(KERN_ERR "PCI: Bad IRQ mapping request "
"for slot %d\n", slot);
return evt2irq(0x240);
}
} else {
switch (pin) {
case 0: irq = evt2irq(0x240); break;
case 1: irq = evt2irq(0x240); break;
case 2: irq = evt2irq(0x240); break;
case 3: irq = evt2irq(0x240); break;
case 4: irq = evt2irq(0x240); break;
default: irq = -1; break;
}
}
return irq;
}
|
/* Copyright 2019 gtips
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "reviung34.h"
// Optional override functions below.
// You can leave any or all of these undefined.
// These are only required if you want to perform custom actions.
/*
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
*/
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_MEDIA_GALLERIES_LINUX_SNAPSHOT_FILE_DETAILS_H_
#define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_SNAPSHOT_FILE_DETAILS_H_
#include <string>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h"
// Used to represent snapshot file request params.
struct SnapshotRequestInfo {
SnapshotRequestInfo(
uint32 file_id,
const base::FilePath& snapshot_file_path,
const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback&
success_callback,
const MTPDeviceAsyncDelegate::ErrorCallback& error_callback);
~SnapshotRequestInfo();
// MTP device file id.
const uint32 file_id;
// Local platform path of the snapshot file.
const base::FilePath snapshot_file_path;
// A callback to be called when CreateSnapshotFile() succeeds.
const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback
success_callback;
// A callback to be called when CreateSnapshotFile() fails.
const MTPDeviceAsyncDelegate::ErrorCallback error_callback;
};
// SnapshotFileDetails tracks the current state of the snapshot file (e.g how
// many bytes written to the snapshot file, source file details, snapshot file
// metadata information, etc).
class SnapshotFileDetails {
public:
SnapshotFileDetails(const SnapshotRequestInfo& request_info,
const base::File::Info& file_info);
~SnapshotFileDetails();
uint32 file_id() const {
return request_info_.file_id;
}
base::FilePath snapshot_file_path() const {
return request_info_.snapshot_file_path;
}
uint32 bytes_written() const {
return bytes_written_;
}
const base::File::Info& file_info() const {
return file_info_;
}
const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback
success_callback() const {
return request_info_.success_callback;
}
const MTPDeviceAsyncDelegate::ErrorCallback error_callback() const {
return request_info_.error_callback;
}
bool error_occurred() const {
return error_occurred_;
}
void set_error_occurred(bool error);
// Adds |bytes_written| to |bytes_written_|.
// |bytes_written| specifies the total number of bytes transferred during the
// last write operation.
// If |bytes_written| is valid, returns true and adds |bytes_written| to
// |bytes_written_|.
// If |bytes_written| is invalid, returns false and does not add
// |bytes_written| to |bytes_written_|.
bool AddBytesWritten(uint32 bytes_written);
// Returns true if the snapshot file is created successfully (no more write
// operation is required to complete the snapshot file).
bool IsSnapshotFileWriteComplete() const;
uint32 BytesToRead() const;
private:
// Snapshot file request params.
const SnapshotRequestInfo request_info_;
// Metadata of the snapshot file (such as name, size, type, etc).
const base::File::Info file_info_;
// Number of bytes written into the snapshot file.
uint32 bytes_written_;
// Whether an error occurred during file transfer.
bool error_occurred_;
DISALLOW_COPY_AND_ASSIGN(SnapshotFileDetails);
};
#endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_SNAPSHOT_FILE_DETAILS_H_
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_ANDROID_KEYSTORE_H
#define NET_ANDROID_KEYSTORE_H
#include <jni.h>
#include <string>
#include <vector>
#include "base/android/scoped_java_ref.h"
#include "base/basictypes.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "net/ssl/ssl_client_cert_type.h"
// Misc functions to access the Android platform KeyStore.
namespace net {
namespace android {
struct AndroidEVP_PKEY;
// Define a list of constants describing private key types. The
// values are shared with Java through org.chromium.net.PrivateKeyType.
// Example: PRIVATE_KEY_TYPE_RSA.
enum PrivateKeyType {
#define DEFINE_PRIVATE_KEY_TYPE(name,value) PRIVATE_KEY_TYPE_ ## name = value,
#include "net/android/private_key_type_list.h"
#undef DEFINE_PRIVATE_KEY_TYPE
};
// Returns the modulus of a given RSAPrivateKey platform object,
// as a series of bytes, in big-endian representation. This can be
// used with BN_bin2bn() to convert to an OpenSSL BIGNUM.
//
// |private_key| is a JNI reference for the private key.
// |modulus| will receive the modulus bytes on success.
// Returns true on success, or false on failure (e.g. if the key
// is not RSA).
NET_EXPORT bool GetRSAKeyModulus(jobject private_key,
std::vector<uint8>* modulus);
// Returns the Q parameter of a given DSAPrivateKey platform object,
// as a series of bytes, in big-endian representation. This can be used
// with BN_bin2bn() to convert to an OpenSSL BIGNUM.
// |private_key| is a JNI reference for the private key.
// |q| will receive the result bytes on success.
// Returns true on success, or false on failure (e.g. if the key is
// not DSA).
NET_EXPORT bool GetDSAKeyParamQ(jobject private_key,
std::vector<uint8>* q);
// Returns the order parameter of a given ECPrivateKey platform object,
// as a series of bytes, in big-endian representation. This can be used
// with BN_bin2bn() to convert to an OpenSSL BIGNUM.
// |private_key| is a JNI reference for the private key.
// |order| will receive the result bytes on success.
// Returns true on success, or false on failure (e.g. if the key is
// not EC).
bool GetECKeyOrder(jobject private_key,
std::vector<uint8>* order);
// Returns the encoded PKCS#8 representation of a private key.
// This only works on Android 4.0.3 and older releases for platform keys
// (i.e. all keys except those explicitely generated by the application).
// |private_key| is a JNI reference for the private key.
// |encoded| will receive the encoded data on success.
// Returns true on success, or false on failure (e.g. on 4.0.4 or higher).
bool GetPrivateKeyEncodedBytes(jobject private_key,
std::vector<uint8>* encoded);
// Compute the signature of a given message, which is actually a hash,
// using a private key. For more details, please read the comments for the
// rawSignDigestWithPrivateKey method in AndroidKeyStore.java.
//
// |private_key| is a JNI reference for the private key.
// |digest| is the input digest.
// |signature| will receive the signature on success.
// Returns true on success, false on failure.
//
NET_EXPORT bool RawSignDigestWithPrivateKey(
jobject private_key,
const base::StringPiece& digest,
std::vector<uint8>* signature);
// Return the PrivateKeyType of a given private key.
// |private_key| is a JNI reference for the private key.
// Returns a PrivateKeyType, while will be CLIENT_CERT_INVALID_TYPE
// on error.
NET_EXPORT PrivateKeyType GetPrivateKeyType(jobject private_key);
// Returns a handle to the system AndroidEVP_PKEY object used to back a given
// private_key object. This must *only* be used for RSA private keys on Android
// < 4.2. Technically, this is only guaranteed to work if the system image
// contains a vanilla implementation of the Java API frameworks based on Harmony
// + OpenSSL.
//
// |private_key| is a JNI reference for the private key.
// Returns an AndroidEVP_PKEY* handle, or NULL in case of error.
//
// Note: Despite its name and return type, this function doesn't know
// anything about OpenSSL, it just type-casts a system pointer that
// is passed as an int through JNI. As such, it never increments
// the returned key's reference count.
AndroidEVP_PKEY* GetOpenSSLSystemHandleForPrivateKey(jobject private_key);
// Returns a JNI reference to the OpenSSLEngine object which is used to back a
// given private_key object. This must *only* be used for RSA private keys on
// Android < 4.2. Technically, this is only guaranteed to work if the system
// image contains a vanilla implementation of the Java API frameworks based on
// Harmony + OpenSSL.
base::android::ScopedJavaLocalRef<jobject> GetOpenSSLEngineForPrivateKey(
jobject private_key);
NET_EXPORT void ReleaseKey(jobject private_key);
// Register JNI methods
NET_EXPORT bool RegisterKeyStore(JNIEnv* env);
} // namespace android
} // namespace net
#endif // NET_ANDROID_KEYSTORE_H
|
//
// ______ ______ ______
// /\ __ \ /\ ___\ /\ ___\
// \ \ __< \ \ __\_ \ \ __\_
// \ \_____\ \ \_____\ \ \_____\
// \/_____/ \/_____/ \/_____/
//
//
// Copyright (c) 2014-2015, Geek Zoo Studio
// http://www.bee-framework.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
#import "Bee_UILayout.h"
#import "Bee_UITemplate.h"
#pragma mark -
@interface UIViewController(BeeUITemplate)
@property (nonatomic, retain) NSString * templateName;
@property (nonatomic, retain) NSString * templateFile;
@property (nonatomic, retain) NSString * templateResource;
@property (nonatomic, readonly) BeeUITemplateBlockS FROM_NAME;
@property (nonatomic, readonly) BeeUITemplateBlockS FROM_FILE;
@property (nonatomic, readonly) BeeUITemplateBlockS FROM_RESOURCE;
@end
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
#include "cphy.h"
#include "elmer0.h"
#include "suni1x10gexp_regs.h"
static int my3126_reset(struct cphy *cphy, int wait)
{
return 0;
}
static int my3126_interrupt_enable(struct cphy *cphy)
{
schedule_delayed_work(&cphy->phy_update, HZ/30);
t1_tpi_read(cphy->adapter, A_ELMER0_GPO, &cphy->elmer_gpo);
return 0;
}
static int my3126_interrupt_disable(struct cphy *cphy)
{
cancel_delayed_work_sync(&cphy->phy_update);
return 0;
}
static int my3126_interrupt_clear(struct cphy *cphy)
{
return 0;
}
#define OFFSET(REG_ADDR) (REG_ADDR << 2)
static int my3126_interrupt_handler(struct cphy *cphy)
{
u32 val;
u16 val16;
u16 status;
u32 act_count;
adapter_t *adapter;
adapter = cphy->adapter;
if (cphy->count == 50) {
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_STAT1, &val);
val16 = (u16) val;
status = cphy->bmsr ^ val16;
if (status & MDIO_STAT1_LSTATUS)
t1_link_changed(adapter, 0);
cphy->bmsr = val16;
cphy->count = 0;
}
t1_tpi_write(adapter, OFFSET(SUNI1x10GEXP_REG_MSTAT_CONTROL),
SUNI1x10GEXP_BITMSK_MSTAT_SNAP);
t1_tpi_read(adapter,
OFFSET(SUNI1x10GEXP_REG_MSTAT_COUNTER_1_LOW), &act_count);
t1_tpi_read(adapter,
OFFSET(SUNI1x10GEXP_REG_MSTAT_COUNTER_33_LOW), &val);
act_count += val;
t1_tpi_read(adapter, A_ELMER0_GPO, &val);
cphy->elmer_gpo = val;
if ( (val & (1 << 8)) || (val & (1 << 19)) ||
(cphy->act_count == act_count) || cphy->act_on ) {
if (is_T2(adapter))
val |= (1 << 9);
else if (t1_is_T1B(adapter))
val |= (1 << 20);
cphy->act_on = 0;
} else {
if (is_T2(adapter))
val &= ~(1 << 9);
else if (t1_is_T1B(adapter))
val &= ~(1 << 20);
cphy->act_on = 1;
}
t1_tpi_write(adapter, A_ELMER0_GPO, val);
cphy->elmer_gpo = val;
cphy->act_count = act_count;
cphy->count++;
return cphy_cause_link_change;
}
static void my3216_poll(struct work_struct *work)
{
struct cphy *cphy = container_of(work, struct cphy, phy_update.work);
my3126_interrupt_handler(cphy);
}
static int my3126_set_loopback(struct cphy *cphy, int on)
{
return 0;
}
static int my3126_get_link_status(struct cphy *cphy,
int *link_ok, int *speed, int *duplex, int *fc)
{
u32 val;
u16 val16;
adapter_t *adapter;
adapter = cphy->adapter;
cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_STAT1, &val);
val16 = (u16) val;
t1_tpi_read(adapter, A_ELMER0_GPO, &val);
cphy->elmer_gpo = val;
*link_ok = (val16 & MDIO_STAT1_LSTATUS);
if (*link_ok) {
if (is_T2(adapter))
val &= ~(1 << 8);
else if (t1_is_T1B(adapter))
val &= ~(1 << 19);
} else {
if (is_T2(adapter))
val |= (1 << 8);
else if (t1_is_T1B(adapter))
val |= (1 << 19);
}
t1_tpi_write(adapter, A_ELMER0_GPO, val);
cphy->elmer_gpo = val;
*speed = SPEED_10000;
*duplex = DUPLEX_FULL;
if (fc)
*fc = PAUSE_RX | PAUSE_TX;
return 0;
}
static void my3126_destroy(struct cphy *cphy)
{
kfree(cphy);
}
static struct cphy_ops my3126_ops = {
.destroy = my3126_destroy,
.reset = my3126_reset,
.interrupt_enable = my3126_interrupt_enable,
.interrupt_disable = my3126_interrupt_disable,
.interrupt_clear = my3126_interrupt_clear,
.interrupt_handler = my3126_interrupt_handler,
.get_link_status = my3126_get_link_status,
.set_loopback = my3126_set_loopback,
.mmds = (MDIO_DEVS_PMAPMD | MDIO_DEVS_PCS |
MDIO_DEVS_PHYXS),
};
static struct cphy *my3126_phy_create(struct net_device *dev,
int phy_addr, const struct mdio_ops *mdio_ops)
{
struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL);
if (!cphy)
return NULL;
cphy_init(cphy, dev, phy_addr, &my3126_ops, mdio_ops);
INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll);
cphy->bmsr = 0;
return cphy;
}
static int my3126_phy_reset(adapter_t * adapter)
{
u32 val;
t1_tpi_read(adapter, A_ELMER0_GPO, &val);
val &= ~4;
t1_tpi_write(adapter, A_ELMER0_GPO, val);
msleep(100);
t1_tpi_write(adapter, A_ELMER0_GPO, val | 4);
msleep(1000);
t1_tpi_read(adapter, A_ELMER0_GPO, &val);
val |= 0x8000;
t1_tpi_write(adapter, A_ELMER0_GPO, val);
udelay(100);
return 0;
}
const struct gphy t1_my3126_ops = {
.create = my3126_phy_create,
.reset = my3126_phy_reset
};
|
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Changed to return -1 for -Inf by Ulrich Drepper <drepper@cygnus.com>.
* Public domain.
*/
/*
* isinf(x) returns 1 is x is inf, -1 if x is -inf, else 0;
* no branching!
*/
#include "math.h"
#include "math_private.h"
int __isinf(double x)
{
int32_t hx,lx;
EXTRACT_WORDS(hx,lx,x);
lx |= (hx & 0x7fffffff) ^ 0x7ff00000;
lx |= -lx;
return ~(lx >> 31) & (hx >> 30);
}
libm_hidden_def(__isinf)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.