text stringlengths 4 6.14k |
|---|
/*
* Generated by class-dump 3.1.1.
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2006 by Steve Nygard.
*/
#import <BackRow/BRPanel.h>
@class BRController, NSMutableArray;
@interface BRControllerStack : BRPanel
{
NSMutableArray *_stack;
NSMutableArray *_transactions;
BRController *_poppedController;
int _stackState;
BOOL _dumpStack;
}
- (id)init;
- (void)dealloc;
- (void)pushController:(id)fp8;
- (void)popController;
- (void)popToController:(id)fp8;
- (void)popToControllerOfClass:(Class)fp8;
- (void)popToControllerWithLabel:(id)fp8;
- (void)removeController:(id)fp8;
- (void)swapController:(id)fp8;
- (void)replaceControllersAboveLabel:(id)fp8 withController:(id)fp12;
- (id)peekController;
- (id)controllerLabelled:(id)fp8 deepest:(BOOL)fp12;
- (long)countOfControllersLabelled:(id)fp8;
- (int)count;
- (BOOL)brEventAction:(id)fp8;
@end
|
/* { dg-do run } */
/* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
/* { dg-require-effective-target p8vector_hw } */
#ifndef CHECK_H
#define CHECK_H "sse2-check.h"
#endif
#include CHECK_H
#ifndef TEST
#define TEST sse2_test_psrlq_1
#endif
#define N 60
#include <emmintrin.h>
#ifdef _ARCH_PWR8
static __m128i
__attribute__((noinline, unused))
test (__m128i s1)
{
return _mm_srli_epi64 (s1, N);
}
#endif
static void
TEST (void)
{
#ifdef _ARCH_PWR8
union128i_q u, s;
long long e[2] = {0};
unsigned long long tmp;
int i;
s.x = _mm_set_epi64x (-1, 0xf);
u.x = test (s.x);
if (N < 64)
for (i = 0; i < 2; i++) {
tmp = s.a[i];
e[i] = tmp >> N;
}
if (check_union128i_q (u, e))
abort ();
#endif
}
|
/*
File: CFUUID.h
Contains: CoreFoundation UUIDs
Version: QuickTime 7.1
Copyright: © 2006 © 1999-2001 by Apple Computer, Inc., all rights reserved
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __CFUUID__
#define __CFUUID__
#if PRAGMA_ONCE
#pragma once
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
#include <CFBase.h>
typedef struct __CFUUID* CFUUIDRef;
struct CFUUIDBytes {
UInt8 byte0;
UInt8 byte1;
UInt8 byte2;
UInt8 byte3;
UInt8 byte4;
UInt8 byte5;
UInt8 byte6;
UInt8 byte7;
UInt8 byte8;
UInt8 byte9;
UInt8 byte10;
UInt8 byte11;
UInt8 byte12;
UInt8 byte13;
UInt8 byte14;
UInt8 byte15;
};
typedef struct CFUUIDBytes CFUUIDBytes;
/* The CFUUIDBytes struct is a 128-bit struct that contains the
raw UUID. A CFUUIDRef can provide such a struct from the
CFUUIDGetUUIDBytes() function. This struct is suitable for
passing to APIs that expect a raw UUID.
*/
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif
#endif /* __CFUUID__ */
|
/* Test mpz_fits_*_p */
/*
Copyright 2001 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP 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 MP 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 MP 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.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include "mpir.h"
#include "gmp-impl.h"
#include "tests.h"
/* Nothing sophisticated here, just exercise mpz_fits_*_p on a small amount
of data. */
#define EXPECT_S(fun,name,answer) \
got = fun (z); \
if (got != answer) \
{ \
printf ("%s (%s) got %d want %d\n", name, expr, got, answer); \
printf (" z size %d\n", SIZ(z)); \
printf (" z dec "); mpz_out_str (stdout, 10, z); printf ("\n"); \
printf (" z hex "); mpz_out_str (stdout, 16, z); printf ("\n"); \
error = 1; \
}
#if HAVE_STRINGIZE
#define EXPECT(fun,answer) EXPECT_S(fun,#fun,answer)
#else
#define EXPECT(fun,answer) EXPECT_S(fun,"fun",answer)
#endif
int
main (void)
{
mpz_t z;
int got;
const char *expr;
int error = 0;
tests_start ();
mpz_init (z);
mpz_set_ui (z, 0L);
expr = "0";
EXPECT (mpz_fits_ulong_p, 1);
EXPECT (mpz_fits_uint_p, 1);
EXPECT (mpz_fits_ushort_p, 1);
EXPECT (mpz_fits_slong_p, 1);
EXPECT (mpz_fits_sint_p, 1);
EXPECT (mpz_fits_sshort_p, 1);
mpz_set_ui (z, 1L);
expr = "1";
EXPECT (mpz_fits_ulong_p, 1);
EXPECT (mpz_fits_uint_p, 1);
EXPECT (mpz_fits_ushort_p, 1);
EXPECT (mpz_fits_slong_p, 1);
EXPECT (mpz_fits_sint_p, 1);
EXPECT (mpz_fits_sshort_p, 1);
mpz_set_si (z, -1L);
expr = "-1";
EXPECT (mpz_fits_ulong_p, 0);
EXPECT (mpz_fits_uint_p, 0);
EXPECT (mpz_fits_ushort_p, 0);
EXPECT (mpz_fits_slong_p, 1);
EXPECT (mpz_fits_sint_p, 1);
EXPECT (mpz_fits_sshort_p, 1);
mpz_set_ui (z, 1L);
mpz_mul_2exp (z, z, 5L*BITS_PER_MP_LIMB);
expr = "2^(5*BPML)";
EXPECT (mpz_fits_ulong_p, 0);
EXPECT (mpz_fits_uint_p, 0);
EXPECT (mpz_fits_ushort_p, 0);
EXPECT (mpz_fits_slong_p, 0);
EXPECT (mpz_fits_sint_p, 0);
EXPECT (mpz_fits_sshort_p, 0);
mpz_set_ui (z, (unsigned long) USHRT_MAX);
expr = "USHRT_MAX";
EXPECT (mpz_fits_ulong_p, 1);
EXPECT (mpz_fits_uint_p, 1);
EXPECT (mpz_fits_ushort_p, 1);
mpz_set_ui (z, (unsigned long) USHRT_MAX);
mpz_add_ui (z, z, 1L);
expr = "USHRT_MAX + 1";
EXPECT (mpz_fits_ushort_p, 0);
mpz_set_ui (z, (unsigned long) UINT_MAX);
expr = "UINT_MAX";
EXPECT (mpz_fits_ulong_p, 1);
EXPECT (mpz_fits_uint_p, 1);
mpz_set_ui (z, (unsigned long) UINT_MAX);
mpz_add_ui (z, z, 1L);
expr = "UINT_MAX + 1";
EXPECT (mpz_fits_uint_p, 0);
mpz_set_ui (z, ULONG_MAX);
expr = "ULONG_MAX";
EXPECT (mpz_fits_ulong_p, 1);
mpz_set_ui (z, ULONG_MAX);
mpz_add_ui (z, z, 1L);
expr = "ULONG_MAX + 1";
EXPECT (mpz_fits_ulong_p, 0);
mpz_set_si (z, (long) SHRT_MAX);
expr = "SHRT_MAX";
EXPECT (mpz_fits_slong_p, 1);
EXPECT (mpz_fits_sint_p, 1);
EXPECT (mpz_fits_sshort_p, 1);
mpz_set_si (z, (long) SHRT_MAX);
mpz_add_ui (z, z, 1L);
expr = "SHRT_MAX + 1";
EXPECT (mpz_fits_sshort_p, 0);
mpz_set_si (z, (long) INT_MAX);
expr = "INT_MAX";
EXPECT (mpz_fits_slong_p, 1);
EXPECT (mpz_fits_sint_p, 1);
mpz_set_si (z, (long) INT_MAX);
mpz_add_ui (z, z, 1L);
expr = "INT_MAX + 1";
EXPECT (mpz_fits_sint_p, 0);
mpz_set_si (z, LONG_MAX);
expr = "LONG_MAX";
EXPECT (mpz_fits_slong_p, 1);
mpz_set_si (z, LONG_MAX);
mpz_add_ui (z, z, 1L);
expr = "LONG_MAX + 1";
EXPECT (mpz_fits_slong_p, 0);
mpz_set_si (z, (long) SHRT_MIN);
expr = "SHRT_MIN";
EXPECT (mpz_fits_slong_p, 1);
EXPECT (mpz_fits_sint_p, 1);
EXPECT (mpz_fits_sshort_p, 1);
mpz_set_si (z, (long) SHRT_MIN);
mpz_sub_ui (z, z, 1L);
expr = "SHRT_MIN + 1";
EXPECT (mpz_fits_sshort_p, 0);
mpz_set_si (z, (long) INT_MIN);
expr = "INT_MIN";
EXPECT (mpz_fits_slong_p, 1);
EXPECT (mpz_fits_sint_p, 1);
mpz_set_si (z, (long) INT_MIN);
mpz_sub_ui (z, z, 1L);
expr = "INT_MIN + 1";
EXPECT (mpz_fits_sint_p, 0);
mpz_set_si (z, LONG_MIN);
expr = "LONG_MIN";
EXPECT (mpz_fits_slong_p, 1);
mpz_set_si (z, LONG_MIN);
mpz_sub_ui (z, z, 1L);
expr = "LONG_MIN + 1";
EXPECT (mpz_fits_slong_p, 0);
if (error)
abort ();
mpz_clear (z);
tests_end ();
exit (0);
}
|
N_("Select Font");
N_("_Cancel");
N_("_Select");
|
/* GStreamer
* Copyright (C) 2007-2008 Wouter Cloetens <wouter@mind.be>
*
* 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
*/
#ifndef __GST_SOUP_HTTP_SRC_H__
#define __GST_SOUP_HTTP_SRC_H__
#include <gst/gst.h>
#include <gst/base/gstpushsrc.h>
#include <glib.h>
G_BEGIN_DECLS
#include <libsoup/soup.h>
#define GST_TYPE_SOUP_HTTP_SRC \
(gst_soup_http_src_get_type())
#define GST_SOUP_HTTP_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SOUP_HTTP_SRC,GstSoupHTTPSrc))
#define GST_SOUP_HTTP_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), \
GST_TYPE_SOUP_HTTP_SRC,GstSoupHTTPSrcClass))
#define GST_IS_SOUP_HTTP_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SOUP_HTTP_SRC))
#define GST_IS_SOUP_HTTP_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SOUP_HTTP_SRC))
typedef struct _GstSoupHTTPSrc GstSoupHTTPSrc;
typedef struct _GstSoupHTTPSrcClass GstSoupHTTPSrcClass;
typedef enum {
GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_IDLE,
GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_QUEUED,
GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_RUNNING,
GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_CANCELLED,
} GstSoupHTTPSrcSessionIOStatus;
struct _GstSoupHTTPSrc {
GstPushSrc element;
gchar *location; /* Full URI. */
gchar *redirection_uri; /* Full URI after redirections. */
gboolean redirection_permanent; /* Permanent or temporary redirect? */
gchar *user_agent; /* User-Agent HTTP header. */
gboolean automatic_redirect; /* Follow redirects. */
SoupURI *proxy; /* HTTP proxy URI. */
gchar *user_id; /* Authentication user id for location URI. */
gchar *user_pw; /* Authentication user password for location URI. */
gchar *proxy_id; /* Authentication user id for proxy URI. */
gchar *proxy_pw; /* Authentication user password for proxy URI. */
gchar **cookies; /* HTTP request cookies. */
GMainContext *context; /* I/O context. */
GMainLoop *loop; /* Event loop. */
SoupSession *session; /* Async context. */
GstSoupHTTPSrcSessionIOStatus session_io_status;
/* Async I/O status. */
SoupMessage *msg; /* Request message. */
GstFlowReturn ret; /* Return code from callback. */
GstBuffer **outbuf; /* Return buffer allocated by callback. */
gboolean interrupted; /* Signal unlock(). */
gboolean retry; /* Should attempt to reconnect. */
gint retry_count; /* Number of retries since we received data */
gint max_retries; /* Maximum number of retries */
gboolean got_headers; /* Already received headers from the server */
gboolean have_size; /* Received and parsed Content-Length
header. */
guint64 content_size; /* Value of Content-Length header. */
guint64 read_position; /* Current position. */
gboolean seekable; /* FALSE if the server does not support
Range. */
guint64 request_position; /* Seek to this position. */
guint64 stop_position; /* Stop at this position. */
gboolean have_body; /* Indicates if it has just been signaled the
* end of the message body. This is used to
* decide if an out of range request should be
* handled as an error or EOS when the content
* size is unknown */
gboolean keep_alive; /* Use keep-alive sessions */
gboolean ssl_strict;
gchar *ssl_ca_file;
gboolean ssl_use_system_ca_file;
/* Shoutcast/icecast metadata extraction handling. */
gboolean iradio_mode;
GstCaps *src_caps;
gchar *iradio_name;
gchar *iradio_genre;
gchar *iradio_url;
GstStructure *extra_headers;
SoupLoggerLogLevel log_level;/* Soup HTTP session logger level */
gboolean compress;
guint timeout;
GMutex mutex;
GCond request_finished_cond;
GstEvent *http_headers_event;
};
struct _GstSoupHTTPSrcClass {
GstPushSrcClass parent_class;
};
GType gst_soup_http_src_get_type (void);
G_END_DECLS
#endif /* __GST_SOUP_HTTP_SRC_H__ */
|
/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
static void expect_one_parameter(int a)
{
ztest_check_expected_value(a);
}
static void expect_two_parameters(int a, int b)
{
ztest_check_expected_value(a);
ztest_check_expected_value(b);
}
static void parameter_tests(void)
{
ztest_expect_value(expect_one_parameter, a, 1);
expect_one_parameter(1);
ztest_expect_value(expect_two_parameters, a, 2);
ztest_expect_value(expect_two_parameters, b, 3);
expect_two_parameters(2, 3);
}
static int returns_int(void)
{
return ztest_get_return_value();
}
static void return_value_tests(void)
{
ztest_returns_value(returns_int, 5);
zassert_equal(returns_int(), 5, NULL);
}
void test_main(void)
{
ztest_test_suite(mock_framework_tests,
ztest_unit_test(parameter_tests),
ztest_unit_test(return_value_tests)
);
ztest_run_test_suite(mock_framework_tests);
}
|
/* Copyright (c) 2014, Google Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
#include <openssl/aead.h>
#include <string.h>
#include <openssl/cipher.h>
#include <openssl/err.h>
#include "internal.h"
#include "../internal.h"
size_t EVP_AEAD_key_length(const EVP_AEAD *aead) { return aead->key_len; }
size_t EVP_AEAD_nonce_length(const EVP_AEAD *aead) { return aead->nonce_len; }
size_t EVP_AEAD_max_overhead(const EVP_AEAD *aead) { return aead->overhead; }
size_t EVP_AEAD_max_tag_len(const EVP_AEAD *aead) { return aead->max_tag_len; }
void EVP_AEAD_CTX_zero(EVP_AEAD_CTX *ctx) {
OPENSSL_memset(ctx, 0, sizeof(EVP_AEAD_CTX));
}
int EVP_AEAD_CTX_init(EVP_AEAD_CTX *ctx, const EVP_AEAD *aead,
const uint8_t *key, size_t key_len, size_t tag_len,
ENGINE *impl) {
if (!aead->init) {
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_NO_DIRECTION_SET);
ctx->aead = NULL;
return 0;
}
return EVP_AEAD_CTX_init_with_direction(ctx, aead, key, key_len, tag_len,
evp_aead_open);
}
int EVP_AEAD_CTX_init_with_direction(EVP_AEAD_CTX *ctx, const EVP_AEAD *aead,
const uint8_t *key, size_t key_len,
size_t tag_len,
enum evp_aead_direction_t dir) {
if (key_len != aead->key_len) {
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_KEY_SIZE);
ctx->aead = NULL;
return 0;
}
ctx->aead = aead;
int ok;
if (aead->init) {
ok = aead->init(ctx, key, key_len, tag_len);
} else {
ok = aead->init_with_direction(ctx, key, key_len, tag_len, dir);
}
if (!ok) {
ctx->aead = NULL;
}
return ok;
}
void EVP_AEAD_CTX_cleanup(EVP_AEAD_CTX *ctx) {
if (ctx->aead == NULL) {
return;
}
ctx->aead->cleanup(ctx);
ctx->aead = NULL;
}
/* check_alias returns 1 if |out| is compatible with |in| and 0 otherwise. If
* |in| and |out| alias, we require that |in| == |out|. */
static int check_alias(const uint8_t *in, size_t in_len, const uint8_t *out,
size_t out_len) {
if (!buffers_alias(in, in_len, out, out_len)) {
return 1;
}
return in == out;
}
int EVP_AEAD_CTX_seal(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len,
size_t max_out_len, const uint8_t *nonce,
size_t nonce_len, const uint8_t *in, size_t in_len,
const uint8_t *ad, size_t ad_len) {
size_t possible_out_len = in_len + ctx->aead->overhead;
if (possible_out_len < in_len /* overflow */) {
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE);
goto error;
}
if (!check_alias(in, in_len, out, max_out_len)) {
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_OUTPUT_ALIASES_INPUT);
goto error;
}
if (ctx->aead->seal(ctx, out, out_len, max_out_len, nonce, nonce_len, in,
in_len, ad, ad_len)) {
return 1;
}
error:
/* In the event of an error, clear the output buffer so that a caller
* that doesn't check the return value doesn't send raw data. */
OPENSSL_memset(out, 0, max_out_len);
*out_len = 0;
return 0;
}
int EVP_AEAD_CTX_open(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len,
size_t max_out_len, const uint8_t *nonce,
size_t nonce_len, const uint8_t *in, size_t in_len,
const uint8_t *ad, size_t ad_len) {
if (!check_alias(in, in_len, out, max_out_len)) {
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_OUTPUT_ALIASES_INPUT);
goto error;
}
if (ctx->aead->open(ctx, out, out_len, max_out_len, nonce, nonce_len, in,
in_len, ad, ad_len)) {
return 1;
}
error:
/* In the event of an error, clear the output buffer so that a caller
* that doesn't check the return value doesn't try and process bad
* data. */
OPENSSL_memset(out, 0, max_out_len);
*out_len = 0;
return 0;
}
const EVP_AEAD *EVP_AEAD_CTX_aead(const EVP_AEAD_CTX *ctx) { return ctx->aead; }
int EVP_AEAD_CTX_get_iv(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv,
size_t *out_len) {
if (ctx->aead->get_iv == NULL) {
return 0;
}
return ctx->aead->get_iv(ctx, out_iv, out_len);
}
|
//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************
#ifndef _UIAPPEARANCESETTER_H_
#define _UIAPPEARANCESETTER_H_
#import <Foundation/NSObject.h>
@class UIView;
@interface UIAppearanceSetter : NSObject
+ (void)_applyAppearance:(id)view;
+ (void)_applyAppearance:(id)view withAppearanceClass:(Class)cls withBaseView:(UIView*)baseView;
+ (id)_appearanceWhenContainedIn:(id)containedClass forUIClass:(id)uiClass;
@end
#endif /* _UIAPPEARANCESETTER_H_ */
|
//
// UIView+Extension.h
//
// Created by 张磊 on 14-11-14.
// Copyright (c) 2014年 com.zixue101.www. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (ZLExtension)
@property (nonatomic,assign) CGFloat x;
@property (nonatomic,assign) CGFloat y;
@property (nonatomic,assign) CGFloat centerX;
@property (nonatomic,assign) CGFloat centerY;
@property (nonatomic,assign) CGFloat width;
@property (nonatomic,assign) CGFloat height;
@property (nonatomic,assign) CGSize size;
@end
|
/* uprobes_lib test case - library helper
* Copyright (C) 2009, Red Hat Inc.
*
* This file is part of systemtap, and is free software. You can
* redistribute it and/or modify it under the terms of the GNU General
* Public License (GPL); either version 2, or (at your option) any
* later version.
*/
#include "sys/sdt.h"
// volatile static variable to prevent folding of lib_func
static volatile int foo;
// Marked noinline and has an empty asm statement to prevent inlining
// or optimizing away totally.
int
__attribute__((noinline))
lib_func (int bar)
{
asm ("");
STAP_PROBE1(test, func_count, bar);
if (bar - foo > 0)
foo = lib_func (bar - foo);
return foo;
}
void
lib_main ()
{
foo = 1;
foo = lib_func (3);
}
|
/* Test that gcc destructor functions work */
#include <stdio.h>
__attribute__((destructor))
void dtor(void)
{
printf("Hello from the destructor!\n");
}
int main(void) {
/* Do nothing */
return 0;
}
|
// 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.
// AVFoundation API is only introduced in Mac OS X > 10.6, and there is only one
// build of Chromium, so the (potential) linking with AVFoundation has to happen
// in runtime. For this to be clean, an AVFoundationGlue class is defined to try
// and load these AVFoundation system libraries. If it succeeds, subsequent
// clients can use AVFoundation via the rest of the classes declared in this
// file.
#ifndef MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_
#define MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_
#import <Foundation/Foundation.h>
#include "base/basictypes.h"
#include "media/base/mac/coremedia_glue.h"
#include "media/base/media_export.h"
class MEDIA_EXPORT AVFoundationGlue {
public:
// This method returns true if the OS version supports AVFoundation and the
// AVFoundation bundle could be loaded correctly, or false otherwise.
static bool IsAVFoundationSupported();
static NSBundle const* AVFoundationBundle();
// Originally coming from AVCaptureDevice.h but in global namespace.
static NSString* AVCaptureDeviceWasConnectedNotification();
static NSString* AVCaptureDeviceWasDisconnectedNotification();
// Originally coming from AVMediaFormat.h but in global namespace.
static NSString* AVMediaTypeVideo();
static NSString* AVMediaTypeAudio();
static NSString* AVMediaTypeMuxed();
// Originally from AVCaptureSession.h but in global namespace.
static NSString* AVCaptureSessionRuntimeErrorNotification();
static NSString* AVCaptureSessionDidStopRunningNotification();
static NSString* AVCaptureSessionErrorKey();
// Originally from AVVideoSettings.h but in global namespace.
static NSString* AVVideoScalingModeKey();
static NSString* AVVideoScalingModeResizeAspectFill();
static Class AVCaptureSessionClass();
static Class AVCaptureVideoDataOutputClass();
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(AVFoundationGlue);
};
// Originally AVCaptureDevice and coming from AVCaptureDevice.h
MEDIA_EXPORT
@interface CrAVCaptureDevice : NSObject
- (BOOL)hasMediaType:(NSString*)mediaType;
- (NSString*)uniqueID;
- (NSString*)localizedName;
- (BOOL)isSuspended;
- (NSArray*)formats;
- (int32_t)transportType;
@end
// Originally AVCaptureDeviceFormat and coming from AVCaptureDevice.h.
MEDIA_EXPORT
@interface CrAVCaptureDeviceFormat : NSObject
- (CoreMediaGlue::CMFormatDescriptionRef)formatDescription;
- (NSArray*)videoSupportedFrameRateRanges;
@end
// Originally AVFrameRateRange and coming from AVCaptureDevice.h.
MEDIA_EXPORT
@interface CrAVFrameRateRange : NSObject
- (Float64)maxFrameRate;
@end
MEDIA_EXPORT
@interface CrAVCaptureInput // Originally from AVCaptureInput.h.
@end
MEDIA_EXPORT
@interface CrAVCaptureOutput // Originally from AVCaptureOutput.h.
@end
// Originally AVCaptureSession and coming from AVCaptureSession.h.
MEDIA_EXPORT
@interface CrAVCaptureSession : NSObject
- (void)release;
- (void)addInput:(CrAVCaptureInput*)input;
- (void)removeInput:(CrAVCaptureInput*)input;
- (void)addOutput:(CrAVCaptureOutput*)output;
- (void)removeOutput:(CrAVCaptureOutput*)output;
- (BOOL)isRunning;
- (void)startRunning;
- (void)stopRunning;
@end
// Originally AVCaptureConnection and coming from AVCaptureSession.h.
MEDIA_EXPORT
@interface CrAVCaptureConnection : NSObject
- (BOOL)isVideoMinFrameDurationSupported;
- (void)setVideoMinFrameDuration:(CoreMediaGlue::CMTime)minFrameRate;
- (BOOL)isVideoMaxFrameDurationSupported;
- (void)setVideoMaxFrameDuration:(CoreMediaGlue::CMTime)maxFrameRate;
@end
// Originally AVCaptureDeviceInput and coming from AVCaptureInput.h.
MEDIA_EXPORT
@interface CrAVCaptureDeviceInput : CrAVCaptureInput
@end
// Originally AVCaptureVideoDataOutputSampleBufferDelegate from
// AVCaptureOutput.h.
@protocol CrAVCaptureVideoDataOutputSampleBufferDelegate <NSObject>
@optional
- (void)captureOutput:(CrAVCaptureOutput*)captureOutput
didOutputSampleBuffer:(CoreMediaGlue::CMSampleBufferRef)sampleBuffer
fromConnection:(CrAVCaptureConnection*)connection;
@end
// Originally AVCaptureVideoDataOutput and coming from AVCaptureOutput.h.
MEDIA_EXPORT
@interface CrAVCaptureVideoDataOutput : CrAVCaptureOutput
- (oneway void)release;
- (void)setSampleBufferDelegate:(id)sampleBufferDelegate
queue:(dispatch_queue_t)sampleBufferCallbackQueue;
- (void)setAlwaysDiscardsLateVideoFrames:(BOOL)flag;
- (void)setVideoSettings:(NSDictionary*)videoSettings;
- (NSDictionary*)videoSettings;
- (CrAVCaptureConnection*)connectionWithMediaType:(NSString*)mediaType;
@end
// Class to provide access to class methods of AVCaptureDevice.
MEDIA_EXPORT
@interface AVCaptureDeviceGlue : NSObject
+ (NSArray*)devices;
+ (CrAVCaptureDevice*)deviceWithUniqueID:(NSString*)deviceUniqueID;
@end
// Class to provide access to class methods of AVCaptureDeviceInput.
MEDIA_EXPORT
@interface AVCaptureDeviceInputGlue : NSObject
+ (CrAVCaptureDeviceInput*)deviceInputWithDevice:(CrAVCaptureDevice*)device
error:(NSError**)outError;
@end
#endif // MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_
|
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file objToEgg.h
* @author drose
* @date 2010-12-07
*/
#ifndef OBJTOEGG_H
#define OBJTOEGG_H
#include "pandatoolbase.h"
#include "somethingToEgg.h"
#include "objToEggConverter.h"
/**
* A program to read a Obj file and generate an egg file.
*/
class ObjToEgg : public SomethingToEgg {
public:
ObjToEgg();
void run();
};
#endif
|
#include "../../src/network/kernel/qnetworkfunctions_wince.h"
|
/*
* Copyright (C) 2019 Gunar Schorcht
*
* 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 cpu_esp_common
* @{
*
* @file
* @brief Exception handling for ESP SoCs
*
* @author Gunar Schorcht <gunar@schorcht.net>
* @}
*/
#ifndef EXCEPTIONS_H
#define EXCEPTIONS_H
#ifdef __cplusplus
extern "C" {
#endif
/** Initialize exception handler */
extern void init_exceptions(void);
#ifdef __cplusplus
}
#endif
#endif /* EXCEPTIONS_H */
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2015 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#ifdef USE_TI_UICANVAS
#import "TiViewProxy.h"
@interface TiUICanvasViewProxy : TiViewProxy {
}
@end
#endif
|
/* ========================================================================
* Copyright 1988-2006 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* ========================================================================
*/
/*
* Program: Operating-system dependent routines -- AIX 3.2 on RS 6000
*
* Author: Mark Crispin
* Networks and Distributed Computing
* Computing & Communications
* University of Washington
* Administration Building, AG-44
* Seattle, WA 98195
* Internet: MRC@CAC.Washington.EDU
*
* Date: 1 August 1988
* Last Edited: 30 August 2006
*/
#include "tcp_unix.h" /* must be before osdep includes tcp.h */
#include "mail.h"
#include "osdep.h"
#include <stdio.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <ctype.h>
#include <errno.h>
extern int errno; /* just in case */
#include <pwd.h>
#include "misc.h"
#include <sys/select.h>
char *crypt (char *key,char *salt);
extern int sys_nerr;
extern char *sys_errlist[];
#include "fs_unix.c"
#include "ftl_unix.c"
#include "nl_unix.c"
#include "env_unix.c"
#include "tcp_unix.c"
#include "gr_waitp.c"
#include "tz_sv4.c"
#include "flocksim.c"
#include "utime.c"
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_VIEWS_ROUNDED_RECT_PAINTER_H_
#define UI_VIEWS_ROUNDED_RECT_PAINTER_H_
#include "base/macros.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/views/painter.h"
#include "ui/views/views_export.h"
namespace gfx {
class Canvas;
class Path;
class Size;
}
namespace views {
// Painter to draw a border with rounded corners.
class VIEWS_EXPORT RoundRectPainter : public Painter {
public:
RoundRectPainter(SkColor border_color, int corner_radius);
~RoundRectPainter() override;
// Painter:
gfx::Size GetMinimumSize() const override;
void Paint(gfx::Canvas* canvas, const gfx::Size& size) override;
private:
const SkColor border_color_;
const int corner_radius_;
DISALLOW_COPY_AND_ASSIGN(RoundRectPainter);
};
} // namespace views
#endif // UI_VIEWS_ROUNDED_RECT_PAINTER_H_
|
/*============================================================================
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
Package, Release 3, by John R. Hauser.
Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
(Regents). 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 two paragraphs of disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions, and the following two paragraphs of disclaimer in the
documentation and/or other materials provided with the distribution. Neither
the name of the Regents nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=============================================================================*/
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "internals.h"
#include "softfloat.h"
uint_fast64_t f128_to_ui64_r_minMag( float128_t a, bool exact )
{
union ui128_f128 uA;
uint_fast64_t uiA64, uiA0;
int_fast32_t exp, shiftCount;
uint_fast64_t sig64, sig0;
int_fast16_t negShiftCount;
uint_fast64_t z;
uA.f = a;
uiA64 = uA.ui.v64;
uiA0 = uA.ui.v0;
exp = expF128UI64( uiA64 );
shiftCount = 0x402F - exp;
if ( shiftCount < 0 ) {
if ( signF128UI64( uiA64 ) || (shiftCount < -15) ) goto invalid;
sig64 = fracF128UI64( uiA64 ) | UINT64_C( 0x0001000000000000 );
sig0 = uiA0;
negShiftCount = -shiftCount;
z = sig64<<negShiftCount | sig0>>(shiftCount & 63);
if ( exact && (uint64_t) (sig0<<negShiftCount) ) {
softfloat_exceptionFlags |= softfloat_flag_inexact;
}
} else {
sig64 = fracF128UI64( uiA64 );
sig0 = uiA0;
if ( 49 <= shiftCount ) {
if ( exact && (exp | sig64 | sig0) ) {
softfloat_exceptionFlags |= softfloat_flag_inexact;
}
return 0;
}
if ( signF128UI64( uiA64 ) ) goto invalid;
sig64 |= UINT64_C( 0x0001000000000000 );
z = sig64>>shiftCount;
if ( exact && (sig0 || (z<<shiftCount != sig64)) ) {
softfloat_exceptionFlags |= softfloat_flag_inexact;
}
}
return z;
invalid:
softfloat_raiseFlags( softfloat_flag_invalid );
return UINT64_C( 0xFFFFFFFFFFFFFFFF );
}
|
/* 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 TITANIC_CHEV_LEFT_OFF_H
#define TITANIC_CHEV_LEFT_OFF_H
#include "titanic/gfx/toggle_switch.h"
namespace Titanic {
class CChevLeftOff : public CToggleSwitch {
DECLARE_MESSAGE_MAP;
public:
CLASSDEF;
CChevLeftOff();
/**
* Save the data for the class to file
*/
virtual void save(SimpleFile *file, int indent);
/**
* Load the data for the class from file
*/
virtual void load(SimpleFile *file);
};
} // End of namespace Titanic
#endif /* TITANIC_CHEV_LEFT_OFF_H */
|
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef ANGLE_CLASS
AngleStyle(charmm,AngleCharmm)
#else
#ifndef LMP_ANGLE_CHARMM_H
#define LMP_ANGLE_CHARMM_H
#include <stdio.h>
#include "angle.h"
namespace LAMMPS_NS {
class AngleCharmm : public Angle {
public:
AngleCharmm(class LAMMPS *);
virtual ~AngleCharmm();
virtual void compute(int, int);
virtual void coeff(int, char **);
double equilibrium_angle(int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_data(FILE *);
double single(int, int, int, int);
protected:
double *k,*theta0,*k_ub,*r_ub;
virtual void allocate();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Incorrect args for angle coefficients
Self-explanatory. Check the input script or data file.
*/
|
/**
* Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
*
* 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, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, 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 Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* 4. This software, with or without modification, must only be used with a
* Nordic Semiconductor ASA integrated circuit.
*
* 5. Any software provided in binary form under this license must not be reverse
* engineered, decompiled, modified and/or disassembled.
*
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/** @file
*
* @defgroup sha256 SHA-256 hash library
* @{
* @ingroup app_common
*
* @brief This module calculates SHA-256 (SHA-2, FIPS-180) hashes.
*
* @details To use this module, first call @ref sha256_init on a @ref sha256_context_t instance. Then call @ref
* sha256_update with the data to be hashed. This step can optionally be done with multiple
* calls to @ref sha256_update, each with a section of the data (in the correct order).
* After all data has been passed to @ref sha256_update, call @ref sha256_final to finalize
* and extract the hash value.
*
* This code is adapted from code by Brad Conte, retrieved from
* https://github.com/B-Con/crypto-algorithms.
*
*/
#ifndef SHA256_H
#define SHA256_H
#include <stdint.h>
#include "sdk_errors.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@brief Current state of a hash operation.
*/
typedef struct {
uint8_t data[64];
uint32_t datalen;
uint64_t bitlen;
uint32_t state[8];
} sha256_context_t;
/**@brief Function for initializing a @ref sha256_context_t instance.
*
* @param[out] ctx Context instance to be initialized.
*
* @retval NRF_SUCCESS If the instance was successfully initialized.
* @retval NRF_ERROR_NULL If the parameter was NULL.
*/
ret_code_t sha256_init(sha256_context_t *ctx);
/**@brief Function for calculating the hash of an array of uint8_t data.
*
* @details This function can be called multiple times in sequence. This is equivalent to calling
* the function once on a concatenation of the data from the different calls.
*
* @param[in,out] ctx Hash instance.
* @param[in] data Data to be hashed.
* @param[in] len Length of the data to be hashed.
*
* @retval NRF_SUCCESS If the data was successfully hashed.
* @retval NRF_ERROR_NULL If the ctx parameter was NULL or the data parameter was NULL, while the len parameter was not zero.
*/
ret_code_t sha256_update(sha256_context_t *ctx, const uint8_t * data, const size_t len);
/**@brief Function for extracting the hash value from a hash instance.
*
* @details This function should be called after all data to be hashed has been passed to the hash
* instance (by one or more calls to @ref sha256_update).
*
* Do not call @ref sha256_update again after @ref sha256_final has been called.
*
* @param[in,out] ctx Hash instance.
* @param[out] hash Array to hold the extracted hash value (assumed to be 32 bytes long).
* @param[in] le Store the hash in little-endian.
*
* @retval NRF_SUCCESS If the has value was successfully extracted.
* @retval NRF_ERROR_NULL If a parameter was NULL.
*/
ret_code_t sha256_final(sha256_context_t *ctx, uint8_t * hash, uint8_t le);
#ifdef __cplusplus
}
#endif
#endif // SHA256_H
/** @} */
|
#ifndef QCONF_FORMAT_H
#define QCONF_FORMAT_H
#include <vector>
#include <string>
#include <set>
#include "qconf_common.h"
/**
* free the string vector according to the free_size
*/
static inline void free_string_vector(string_vector_t &vector, size_t free_size)
{
for (size_t i = 0; i < free_size; ++i)
{
free(vector.data[i]);
vector.data[i] = NULL;
}
free(vector.data);
vector.data = NULL;
vector.count = 0;
}
/**
* Format the data_type, idc and path to tblkey
*/
int serialize_to_tblkey(char data_type, const std::string &idc, const std::string &path, std::string &tblkey);
/**
* Get data_type, idc and path from tblkey
*/
int deserialize_from_tblkey(const std::string &tblkey, char &data_type, std::string &idc, std::string &path);
/**
* Format local idc to tblval
*/
int localidc_to_tblval(const std::string &key, const std::string &local_idc, std::string &tblval);
/**
* Format key and nodeval to tblval
*/
int nodeval_to_tblval(const std::string &key, const std::string &nodeval, std::string &tblval_buf);
/**
* Format key and children nodes to tblval
*/
int chdnodeval_to_tblval(const std::string &key, const string_vector_t &nodes, std::string &tblval_buf, const std::vector<char> &valid_flg);
/**
* Format key and batch nodes to tblval
*/
int batchnodeval_to_tblval(const std::string &key, const string_vector_t &nodes, std::string &tblval_buf);
/**
* Format key and host to tblval
*/
int idcval_to_tblval(const std::string &key, const std::string &host, std::string &tblval_buf);
/**
* Get current data type
*/
char get_data_type(const std::string &value);
/**
* Get the local idc from tblval
*/
int tblval_to_localidc(const std::string &tblval, std::string &idc);
/**
* Get the host from tblval
*/
int tblval_to_idcval(const std::string &tblval, std::string &host);
/**
* Get the idc and host from tblval
*/
int tblval_to_idcval(const std::string &tblval, std::string &host, std::string &idc);
/**
* Get node value from tblval
*/
int tblval_to_nodeval(const std::string &tblval, std::string &nodeval);
/**
* Get idc, path and node value from tblval
*/
int tblval_to_nodeval(const std::string &tblval, std::string &nodeval, std::string &idc, std::string &path);
/**
* Get nodes from tblval
*/
int tblval_to_chdnodeval(const std::string &tblval, string_vector_t &nodes);
/**
* Get idc, path and nodes from tblval
*/
int tblval_to_chdnodeval(const std::string &tblval, string_vector_t &nodes, std::string &idc, std::string &path);
/**
* Get batch nodes from tblval
*/
int tblval_to_batchnodeval(const std::string &tblval, string_vector_t &nodes);
/**
* Get idc, path and batch nodes from tblval
*/
int tblval_to_batchnodeval(const std::string &tblval, string_vector_t &nodes, std::string &idc, std::string &path);
/**
* format the idc and host
*/
void serialize_to_idc_host(const std::string &idc, const std::string &host, std::string &dest);
/**
* get idc and host from idc host
*/
int deserialize_from_idc_host(const std::string &idc_host, std::string &idc, std::string &host);
#define LOG_ERR_KEY_INFO(format, ...) qconf_print_key_info(__FILE__, __LINE__, format, ## __VA_ARGS__)
/**
* Get gray nodes from serialized string
*/
int tblval_to_graynodeval(const std::string &tblval, std::set<std::string> &nodes);
/**
* Serialize the gray nodes into string
*/
int graynodeval_to_tblval(const std::set<std::string> &nodes, std::string &tblval);
#endif
|
/***********************************************************************
Copyright (c) 2006-2011, Skype Limited. 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 Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
#include "opus/opus_config.h"
#include "opus/silk/float/main_FLP.h"
#include "opus/silk/tuning_parameters.h"
void silk_find_LTP_FLP(
silk_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */
silk_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */
silk_float *LTPredCodGain, /* O LTP coding gain */
const silk_float r_lpc[], /* I LPC residual */
const opus_int lag[ MAX_NB_SUBFR ], /* I LTP lags */
const silk_float Wght[ MAX_NB_SUBFR ], /* I Weights */
const opus_int subfr_length, /* I Subframe length */
const opus_int nb_subfr, /* I number of subframes */
const opus_int mem_offset /* I Number of samples in LTP memory */
)
{
opus_int i, k;
silk_float *b_ptr, temp, *WLTP_ptr;
silk_float LPC_res_nrg, LPC_LTP_res_nrg;
silk_float d[ MAX_NB_SUBFR ], m, g, delta_b[ LTP_ORDER ];
silk_float w[ MAX_NB_SUBFR ], nrg[ MAX_NB_SUBFR ], regu;
silk_float Rr[ LTP_ORDER ], rr[ MAX_NB_SUBFR ];
const silk_float *r_ptr, *lag_ptr;
b_ptr = b;
WLTP_ptr = WLTP;
r_ptr = &r_lpc[ mem_offset ];
for( k = 0; k < nb_subfr; k++ ) {
lag_ptr = r_ptr - ( lag[ k ] + LTP_ORDER / 2 );
silk_corrMatrix_FLP( lag_ptr, subfr_length, LTP_ORDER, WLTP_ptr );
silk_corrVector_FLP( lag_ptr, r_ptr, subfr_length, LTP_ORDER, Rr );
rr[ k ] = ( silk_float )silk_energy_FLP( r_ptr, subfr_length );
regu = 1.0f + rr[ k ] +
matrix_ptr( WLTP_ptr, 0, 0, LTP_ORDER ) +
matrix_ptr( WLTP_ptr, LTP_ORDER-1, LTP_ORDER-1, LTP_ORDER );
regu *= LTP_DAMPING / 3;
silk_regularize_correlations_FLP( WLTP_ptr, &rr[ k ], regu, LTP_ORDER );
silk_solve_LDL_FLP( WLTP_ptr, LTP_ORDER, Rr, b_ptr );
/* Calculate residual energy */
nrg[ k ] = silk_residual_energy_covar_FLP( b_ptr, WLTP_ptr, Rr, rr[ k ], LTP_ORDER );
temp = Wght[ k ] / ( nrg[ k ] * Wght[ k ] + 0.01f * subfr_length );
silk_scale_vector_FLP( WLTP_ptr, temp, LTP_ORDER * LTP_ORDER );
w[ k ] = matrix_ptr( WLTP_ptr, LTP_ORDER / 2, LTP_ORDER / 2, LTP_ORDER );
r_ptr += subfr_length;
b_ptr += LTP_ORDER;
WLTP_ptr += LTP_ORDER * LTP_ORDER;
}
/* Compute LTP coding gain */
if( LTPredCodGain != NULL ) {
LPC_LTP_res_nrg = 1e-6f;
LPC_res_nrg = 0.0f;
for( k = 0; k < nb_subfr; k++ ) {
LPC_res_nrg += rr[ k ] * Wght[ k ];
LPC_LTP_res_nrg += nrg[ k ] * Wght[ k ];
}
silk_assert( LPC_LTP_res_nrg > 0 );
*LTPredCodGain = 3.0f * silk_log2( LPC_res_nrg / LPC_LTP_res_nrg );
}
/* Smoothing */
/* d = sum( B, 1 ); */
b_ptr = b;
for( k = 0; k < nb_subfr; k++ ) {
d[ k ] = 0;
for( i = 0; i < LTP_ORDER; i++ ) {
d[ k ] += b_ptr[ i ];
}
b_ptr += LTP_ORDER;
}
/* m = ( w * d' ) / ( sum( w ) + 1e-3 ); */
temp = 1e-3f;
for( k = 0; k < nb_subfr; k++ ) {
temp += w[ k ];
}
m = 0;
for( k = 0; k < nb_subfr; k++ ) {
m += d[ k ] * w[ k ];
}
m = m / temp;
b_ptr = b;
for( k = 0; k < nb_subfr; k++ ) {
g = LTP_SMOOTHING / ( LTP_SMOOTHING + w[ k ] ) * ( m - d[ k ] );
temp = 0;
for( i = 0; i < LTP_ORDER; i++ ) {
delta_b[ i ] = silk_max_float( b_ptr[ i ], 0.1f );
temp += delta_b[ i ];
}
temp = g / temp;
for( i = 0; i < LTP_ORDER; i++ ) {
b_ptr[ i ] = b_ptr[ i ] + delta_b[ i ] * temp;
}
b_ptr += LTP_ORDER;
}
}
|
#ifndef _LINUX_NAMEI_H
#define _LINUX_NAMEI_H
#include <linux/kernel.h>
#include <linux/path.h>
#include <linux/fcntl.h>
#include <linux/errno.h>
enum { MAX_NESTED_LINKS = 8 };
#define MAXSYMLINKS 40
/*
* Type of the last component on LOOKUP_PARENT
*/
enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
/*
* The bitmask for a lookup event:
* - follow links at the end
* - require a directory
* - ending slashes ok even for nonexistent files
* - internal "there are more path components" flag
* - dentry cache is untrusted; force a real lookup
* - suppress terminal automount
*/
#define LOOKUP_FOLLOW 0x0001
#define LOOKUP_DIRECTORY 0x0002
#define LOOKUP_AUTOMOUNT 0x0004
#define LOOKUP_PARENT 0x0010
#define LOOKUP_REVAL 0x0020
#define LOOKUP_RCU 0x0040
#define LOOKUP_NO_REVAL 0x0080
/*
* Intent data
*/
#define LOOKUP_OPEN 0x0100
#define LOOKUP_CREATE 0x0200
#define LOOKUP_EXCL 0x0400
#define LOOKUP_RENAME_TARGET 0x0800
#define LOOKUP_JUMPED 0x1000
#define LOOKUP_ROOT 0x2000
#define LOOKUP_EMPTY 0x4000
extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty);
static inline int user_path_at(int dfd, const char __user *name, unsigned flags,
struct path *path)
{
return user_path_at_empty(dfd, name, flags, path, NULL);
}
static inline int user_path(const char __user *name, struct path *path)
{
return user_path_at_empty(AT_FDCWD, name, LOOKUP_FOLLOW, path, NULL);
}
static inline int user_lpath(const char __user *name, struct path *path)
{
return user_path_at_empty(AT_FDCWD, name, 0, path, NULL);
}
static inline int user_path_dir(const char __user *name, struct path *path)
{
return user_path_at_empty(AT_FDCWD, name,
LOOKUP_FOLLOW | LOOKUP_DIRECTORY, path, NULL);
}
extern int kern_path(const char *, unsigned, struct path *);
extern struct dentry *kern_path_create(int, const char *, struct path *, unsigned int);
extern struct dentry *user_path_create(int, const char __user *, struct path *, unsigned int);
extern void done_path_create(struct path *, struct dentry *);
extern struct dentry *kern_path_locked(const char *, struct path *);
extern int kern_path_mountpoint(int, const char *, struct path *, unsigned int);
extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
extern struct dentry *lookup_one_len_unlocked(const char *, struct dentry *, int);
struct qstr;
extern struct dentry *lookup_hash(const struct qstr *, struct dentry *);
extern int follow_down_one(struct path *);
extern int follow_down(struct path *);
extern int follow_up(struct path *);
extern struct dentry *lock_rename(struct dentry *, struct dentry *);
extern void unlock_rename(struct dentry *, struct dentry *);
extern void nd_jump_link(struct path *path);
static inline void nd_terminate_link(void *name, size_t len, size_t maxlen)
{
((char *) name)[min(len, maxlen)] = '\0';
}
/**
* retry_estale - determine whether the caller should retry an operation
* @error: the error that would currently be returned
* @flags: flags being used for next lookup attempt
*
* Check to see if the error code was -ESTALE, and then determine whether
* to retry the call based on whether "flags" already has LOOKUP_REVAL set.
*
* Returns true if the caller should try the operation again.
*/
static inline bool
retry_estale(const long error, const unsigned int flags)
{
return error == -ESTALE && !(flags & LOOKUP_REVAL);
}
#endif /* _LINUX_NAMEI_H */
|
/* for pmi2_job_info_t definition */
#include "setup.h"
/* allocate resources to track PMIX_Ring state */
int pmix_ring_init(const pmi2_job_info_t* job, char*** env);
/* free resources allocated to track PMIX_Ring state */
int pmix_ring_finalize();
/* given a global rank in stepd/srun tree for message received
* from one of our stepd children, compute corresponding child index */
int pmix_ring_id_by_rank(int rank);
/* ring_out messages come in from our parent nodes,
* we process this and send ring_out messages to each of our children:
* count - starting rank for our leftmost application process
* left - left value for leftmost application process in our subtree
* right - right value for rightmost application process in our subtree */
int pmix_ring_out(int count, char* left, char* right);
/* we get a ring_in message from each child (stepd and application tasks),
* once we've gotten a message from each child, we send a ring_in message
* to our parent
* ring_id - index of child (all app procs first, followed by stepds)
* count - count value from child
* left - left value from child
* right - right value from child
*
* upon receiving ring_in messages from all children, sends message to
* parent consisting of:
* count = sum of counts from all children
* left = left value from leftmost child that specified a left value
* right = right value from rightmost child that specified a right value */
int pmix_ring_in(int ring_id, int count, char* left, char* right);
|
/* avermedia-m135a.c - Keytable for Avermedia M135A Remote Controllers
*
* Copyright (c) 2010 by Mauro Carvalho Chehab
* Copyright (c) 2010 by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include <media/rc-map.h>
#include <linux/module.h>
/*
* Avermedia M135A with RM-JX and RM-K6 remote controls
*
* On Avermedia M135A with IR model RM-JX, the same codes exist on both
* Positivo (BR) and original IR, initial version and remote control codes
* added by Mauro Carvalho Chehab <mchehab@infradead.org>
*
* Positivo also ships Avermedia M135A with model RM-K6, extra control
* codes added by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
*/
static struct rc_map_table avermedia_m135a[] = {
/* RM-JX */
{ 0x0200, KEY_POWER2 },
{ 0x022e, KEY_DOT }, /* '.' */
{ 0x0201, KEY_MODE }, /* TV/FM or SOURCE */
{ 0x0205, KEY_1 },
{ 0x0206, KEY_2 },
{ 0x0207, KEY_3 },
{ 0x0209, KEY_4 },
{ 0x020a, KEY_5 },
{ 0x020b, KEY_6 },
{ 0x020d, KEY_7 },
{ 0x020e, KEY_8 },
{ 0x020f, KEY_9 },
{ 0x0211, KEY_0 },
{ 0x0213, KEY_RIGHT }, /* -> or L */
{ 0x0212, KEY_LEFT }, /* <- or R */
{ 0x0215, KEY_MENU },
{ 0x0217, KEY_CAMERA }, /* Capturar Imagem or Snapshot */
{ 0x0210, KEY_SHUFFLE }, /* Amostra or 16 chan prev */
{ 0x0303, KEY_CHANNELUP },
{ 0x0302, KEY_CHANNELDOWN },
{ 0x021f, KEY_VOLUMEUP },
{ 0x021e, KEY_VOLUMEDOWN },
{ 0x020c, KEY_ENTER }, /* Full Screen */
{ 0x0214, KEY_MUTE },
{ 0x0208, KEY_AUDIO },
{ 0x0203, KEY_TEXT }, /* Teletext */
{ 0x0204, KEY_EPG },
{ 0x022b, KEY_TV2 }, /* TV2 or PIP */
{ 0x021d, KEY_RED },
{ 0x021c, KEY_YELLOW },
{ 0x0301, KEY_GREEN },
{ 0x0300, KEY_BLUE },
{ 0x021a, KEY_PLAYPAUSE },
{ 0x0219, KEY_RECORD },
{ 0x0218, KEY_PLAY },
{ 0x021b, KEY_STOP },
/* RM-K6 */
{ 0x0401, KEY_POWER2 },
{ 0x0406, KEY_MUTE },
{ 0x0408, KEY_MODE }, /* TV/FM */
{ 0x0409, KEY_1 },
{ 0x040a, KEY_2 },
{ 0x040b, KEY_3 },
{ 0x040c, KEY_4 },
{ 0x040d, KEY_5 },
{ 0x040e, KEY_6 },
{ 0x040f, KEY_7 },
{ 0x0410, KEY_8 },
{ 0x0411, KEY_9 },
{ 0x044c, KEY_DOT }, /* '.' */
{ 0x0412, KEY_0 },
{ 0x0407, KEY_REFRESH }, /* Refresh/Reload */
{ 0x0413, KEY_AUDIO },
{ 0x0440, KEY_SCREEN }, /* Full Screen toggle */
{ 0x0441, KEY_HOME },
{ 0x0442, KEY_BACK },
{ 0x0447, KEY_UP },
{ 0x0448, KEY_DOWN },
{ 0x0449, KEY_LEFT },
{ 0x044a, KEY_RIGHT },
{ 0x044b, KEY_OK },
{ 0x0404, KEY_VOLUMEUP },
{ 0x0405, KEY_VOLUMEDOWN },
{ 0x0402, KEY_CHANNELUP },
{ 0x0403, KEY_CHANNELDOWN },
{ 0x0443, KEY_RED },
{ 0x0444, KEY_GREEN },
{ 0x0445, KEY_YELLOW },
{ 0x0446, KEY_BLUE },
{ 0x0414, KEY_TEXT },
{ 0x0415, KEY_EPG },
{ 0x041a, KEY_TV2 }, /* PIP */
{ 0x041b, KEY_CAMERA }, /* Snapshot */
{ 0x0417, KEY_RECORD },
{ 0x0416, KEY_PLAYPAUSE },
{ 0x0418, KEY_STOP },
{ 0x0419, KEY_PAUSE },
{ 0x041f, KEY_PREVIOUS },
{ 0x041c, KEY_REWIND },
{ 0x041d, KEY_FORWARD },
{ 0x041e, KEY_NEXT },
};
static struct rc_map_list avermedia_m135a_map = {
.map = {
.scan = avermedia_m135a,
.size = ARRAY_SIZE(avermedia_m135a),
.rc_proto = RC_PROTO_NEC,
.name = RC_MAP_AVERMEDIA_M135A,
}
};
static int __init init_rc_map_avermedia_m135a(void)
{
return rc_map_register(&avermedia_m135a_map);
}
static void __exit exit_rc_map_avermedia_m135a(void)
{
rc_map_unregister(&avermedia_m135a_map);
}
module_init(init_rc_map_avermedia_m135a)
module_exit(exit_rc_map_avermedia_m135a)
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mauro Carvalho Chehab");
|
/*****************************************************************************
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 middle-level C interface to LAPACK function dsbtrd
* Author: Intel Corporation
* Generated November, 2011
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int LAPACKE_dsbtrd_work( int matrix_order, char vect, char uplo,
lapack_int n, lapack_int kd, double* ab,
lapack_int ldab, double* d, double* e,
double* q, lapack_int ldq, double* work )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dsbtrd( &vect, &uplo, &n, &kd, ab, &ldab, d, e, q, &ldq, work,
&info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int ldab_t = MAX(1,kd+1);
lapack_int ldq_t = MAX(1,n);
double* ab_t = NULL;
double* q_t = NULL;
/* Check leading dimension(s) */
if( ldab < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_dsbtrd_work", info );
return info;
}
if( ldq < n ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_dsbtrd_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
ab_t = (double*)LAPACKE_malloc( sizeof(double) * ldab_t * MAX(1,n) );
if( ab_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
if( LAPACKE_lsame( vect, 'u' ) || LAPACKE_lsame( vect, 'v' ) ) {
q_t = (double*)LAPACKE_malloc( sizeof(double) * ldq_t * MAX(1,n) );
if( q_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
}
/* Transpose input matrices */
LAPACKE_dsb_trans( matrix_order, uplo, n, kd, ab, ldab, ab_t, ldab_t );
if( LAPACKE_lsame( vect, 'u' ) || LAPACKE_lsame( vect, 'v' ) ) {
LAPACKE_dge_trans( matrix_order, n, n, q, ldq, q_t, ldq_t );
}
/* Call LAPACK function and adjust info */
LAPACK_dsbtrd( &vect, &uplo, &n, &kd, ab_t, &ldab_t, d, e, q_t, &ldq_t,
work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dsb_trans( LAPACK_COL_MAJOR, uplo, n, kd, ab_t, ldab_t, ab,
ldab );
if( LAPACKE_lsame( vect, 'u' ) || LAPACKE_lsame( vect, 'v' ) ) {
LAPACKE_dge_trans( LAPACK_COL_MAJOR, n, n, q_t, ldq_t, q, ldq );
}
/* Release memory and exit */
if( LAPACKE_lsame( vect, 'u' ) || LAPACKE_lsame( vect, 'v' ) ) {
LAPACKE_free( q_t );
}
exit_level_1:
LAPACKE_free( ab_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dsbtrd_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dsbtrd_work", info );
}
return info;
}
|
/* Copyright (C) 2003-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, see <http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stdlib.h>
#include <time.h>
#include <sysdep.h>
#include "kernel-posix-timers.h"
#ifdef timer_gettime_alias
# define timer_gettime timer_gettime_alias
#endif
int
timer_gettime (timerid, value)
timer_t timerid;
struct itimerspec *value;
{
#undef timer_gettime
struct timer *kt = (struct timer *) timerid;
/* Delete the kernel timer object. */
int res = INLINE_SYSCALL (timer_gettime, 2, kt->ktimerid, value);
return res;
}
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* 'raw' table, which is the very first hooked in at PRE_ROUTING and LOCAL_OUT .
*
* Copyright (C) 2003 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/slab.h>
#include <net/ip.h>
#define RAW_VALID_HOOKS ((1 << NF_INET_PRE_ROUTING) | (1 << NF_INET_LOCAL_OUT))
static int __net_init iptable_raw_table_init(struct net *net);
static bool raw_before_defrag __read_mostly;
MODULE_PARM_DESC(raw_before_defrag, "Enable raw table before defrag");
module_param(raw_before_defrag, bool, 0000);
static const struct xt_table packet_raw = {
.name = "raw",
.valid_hooks = RAW_VALID_HOOKS,
.me = THIS_MODULE,
.af = NFPROTO_IPV4,
.priority = NF_IP_PRI_RAW,
.table_init = iptable_raw_table_init,
};
static const struct xt_table packet_raw_before_defrag = {
.name = "raw",
.valid_hooks = RAW_VALID_HOOKS,
.me = THIS_MODULE,
.af = NFPROTO_IPV4,
.priority = NF_IP_PRI_RAW_BEFORE_DEFRAG,
.table_init = iptable_raw_table_init,
};
/* The work comes in here from netfilter.c. */
static unsigned int
iptable_raw_hook(void *priv, struct sk_buff *skb,
const struct nf_hook_state *state)
{
return ipt_do_table(skb, state, state->net->ipv4.iptable_raw);
}
static struct nf_hook_ops *rawtable_ops __read_mostly;
static int __net_init iptable_raw_table_init(struct net *net)
{
struct ipt_replace *repl;
const struct xt_table *table = &packet_raw;
int ret;
if (raw_before_defrag)
table = &packet_raw_before_defrag;
if (net->ipv4.iptable_raw)
return 0;
repl = ipt_alloc_initial_table(table);
if (repl == NULL)
return -ENOMEM;
ret = ipt_register_table(net, table, repl, rawtable_ops,
&net->ipv4.iptable_raw);
kfree(repl);
return ret;
}
static void __net_exit iptable_raw_net_exit(struct net *net)
{
if (!net->ipv4.iptable_raw)
return;
ipt_unregister_table(net, net->ipv4.iptable_raw, rawtable_ops);
net->ipv4.iptable_raw = NULL;
}
static struct pernet_operations iptable_raw_net_ops = {
.exit = iptable_raw_net_exit,
};
static int __init iptable_raw_init(void)
{
int ret;
const struct xt_table *table = &packet_raw;
if (raw_before_defrag) {
table = &packet_raw_before_defrag;
pr_info("Enabling raw table before defrag\n");
}
rawtable_ops = xt_hook_ops_alloc(table, iptable_raw_hook);
if (IS_ERR(rawtable_ops))
return PTR_ERR(rawtable_ops);
ret = register_pernet_subsys(&iptable_raw_net_ops);
if (ret < 0) {
kfree(rawtable_ops);
return ret;
}
ret = iptable_raw_table_init(&init_net);
if (ret) {
unregister_pernet_subsys(&iptable_raw_net_ops);
kfree(rawtable_ops);
}
return ret;
}
static void __exit iptable_raw_fini(void)
{
unregister_pernet_subsys(&iptable_raw_net_ops);
kfree(rawtable_ops);
}
module_init(iptable_raw_init);
module_exit(iptable_raw_fini);
MODULE_LICENSE("GPL");
|
// SPDX-License-Identifier: GPL-2.0
// SPI driven IR LED device driver
//
// Copyright (c) 2016 Samsung Electronics Co., Ltd.
// Copyright (c) Andi Shyti <andi.shyti@samsung.com>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of_gpio.h>
#include <linux/regulator/consumer.h>
#include <linux/spi/spi.h>
#include <media/rc-core.h>
#define IR_SPI_DRIVER_NAME "ir-spi"
#define IR_SPI_DEFAULT_FREQUENCY 38000
#define IR_SPI_MAX_BUFSIZE 4096
struct ir_spi_data {
u32 freq;
bool negated;
u16 tx_buf[IR_SPI_MAX_BUFSIZE];
u16 pulse;
u16 space;
struct rc_dev *rc;
struct spi_device *spi;
struct regulator *regulator;
};
static int ir_spi_tx(struct rc_dev *dev,
unsigned int *buffer, unsigned int count)
{
int i;
int ret;
unsigned int len = 0;
struct ir_spi_data *idata = dev->priv;
struct spi_transfer xfer;
/* convert the pulse/space signal to raw binary signal */
for (i = 0; i < count; i++) {
unsigned int periods;
int j;
u16 val;
periods = DIV_ROUND_CLOSEST(buffer[i] * idata->freq, 1000000);
if (len + periods >= IR_SPI_MAX_BUFSIZE)
return -EINVAL;
/*
* the first value in buffer is a pulse, so that 0, 2, 4, ...
* contain a pulse duration. On the contrary, 1, 3, 5, ...
* contain a space duration.
*/
val = (i % 2) ? idata->space : idata->pulse;
for (j = 0; j < periods; j++)
idata->tx_buf[len++] = val;
}
memset(&xfer, 0, sizeof(xfer));
xfer.speed_hz = idata->freq * 16;
xfer.len = len * sizeof(*idata->tx_buf);
xfer.tx_buf = idata->tx_buf;
ret = regulator_enable(idata->regulator);
if (ret)
return ret;
ret = spi_sync_transfer(idata->spi, &xfer, 1);
if (ret)
dev_err(&idata->spi->dev, "unable to deliver the signal\n");
regulator_disable(idata->regulator);
return ret ? ret : count;
}
static int ir_spi_set_tx_carrier(struct rc_dev *dev, u32 carrier)
{
struct ir_spi_data *idata = dev->priv;
if (!carrier)
return -EINVAL;
idata->freq = carrier;
return 0;
}
static int ir_spi_set_duty_cycle(struct rc_dev *dev, u32 duty_cycle)
{
struct ir_spi_data *idata = dev->priv;
int bits = (duty_cycle * 15) / 100;
idata->pulse = GENMASK(bits, 0);
if (idata->negated) {
idata->pulse = ~idata->pulse;
idata->space = 0xffff;
} else {
idata->space = 0;
}
return 0;
}
static int ir_spi_probe(struct spi_device *spi)
{
int ret;
u8 dc;
struct ir_spi_data *idata;
idata = devm_kzalloc(&spi->dev, sizeof(*idata), GFP_KERNEL);
if (!idata)
return -ENOMEM;
idata->regulator = devm_regulator_get(&spi->dev, "irda_regulator");
if (IS_ERR(idata->regulator))
return PTR_ERR(idata->regulator);
idata->rc = devm_rc_allocate_device(&spi->dev, RC_DRIVER_IR_RAW_TX);
if (!idata->rc)
return -ENOMEM;
idata->rc->tx_ir = ir_spi_tx;
idata->rc->s_tx_carrier = ir_spi_set_tx_carrier;
idata->rc->s_tx_duty_cycle = ir_spi_set_duty_cycle;
idata->rc->device_name = "IR SPI";
idata->rc->driver_name = IR_SPI_DRIVER_NAME;
idata->rc->priv = idata;
idata->spi = spi;
idata->negated = of_property_read_bool(spi->dev.of_node,
"led-active-low");
ret = of_property_read_u8(spi->dev.of_node, "duty-cycle", &dc);
if (ret)
dc = 50;
/* ir_spi_set_duty_cycle cannot fail,
* it returns int to be compatible with the
* rc->s_tx_duty_cycle function
*/
ir_spi_set_duty_cycle(idata->rc, dc);
idata->freq = IR_SPI_DEFAULT_FREQUENCY;
return devm_rc_register_device(&spi->dev, idata->rc);
}
static int ir_spi_remove(struct spi_device *spi)
{
return 0;
}
static const struct of_device_id ir_spi_of_match[] = {
{ .compatible = "ir-spi-led" },
{},
};
static struct spi_driver ir_spi_driver = {
.probe = ir_spi_probe,
.remove = ir_spi_remove,
.driver = {
.name = IR_SPI_DRIVER_NAME,
.of_match_table = ir_spi_of_match,
},
};
module_spi_driver(ir_spi_driver);
MODULE_AUTHOR("Andi Shyti <andi.shyti@samsung.com>");
MODULE_DESCRIPTION("SPI IR LED");
MODULE_LICENSE("GPL v2");
|
/*
* (C) Copyright 2015
* Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <lcd.h>
#include <video_font.h> /* Get font data, width and height */
static void lcd_putc_xy90(struct console_t *pcons, ushort x, ushort y, char c)
{
int fg_color = lcd_getfgcolor();
int bg_color = lcd_getbgcolor();
int col, i;
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
(x+1) * pcons->lcdsizex -
y;
uchar msk = 0x80;
uchar *pfont = video_fontdata + c * VIDEO_FONT_HEIGHT;
for (col = 0; col < VIDEO_FONT_WIDTH; ++col) {
for (i = 0; i < VIDEO_FONT_HEIGHT; ++i)
*dst-- = (*(pfont + i) & msk) ? fg_color : bg_color;
msk >>= 1;
dst += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
}
}
static inline void console_setrow90(struct console_t *pcons, u32 row, int clr)
{
int i, j;
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
pcons->lcdsizex -
row*VIDEO_FONT_HEIGHT+1;
for (j = 0; j < pcons->lcdsizey; j++) {
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
*dst-- = clr;
dst += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
}
}
static inline void console_moverow90(struct console_t *pcons,
u32 rowdst, u32 rowsrc)
{
int i, j;
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
pcons->lcdsizex -
(rowdst*VIDEO_FONT_HEIGHT+1);
fbptr_t *src = (fbptr_t *)pcons->fbbase +
pcons->lcdsizex -
(rowsrc*VIDEO_FONT_HEIGHT+1);
for (j = 0; j < pcons->lcdsizey; j++) {
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
*dst-- = *src--;
src += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
dst += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
}
}
static void lcd_putc_xy180(struct console_t *pcons, ushort x, ushort y, char c)
{
int fg_color = lcd_getfgcolor();
int bg_color = lcd_getbgcolor();
int i, row;
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
pcons->lcdsizex +
pcons->lcdsizey * pcons->lcdsizex -
y * pcons->lcdsizex -
(x+1);
for (row = 0; row < VIDEO_FONT_HEIGHT; row++) {
uchar bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
for (i = 0; i < VIDEO_FONT_WIDTH; ++i) {
*dst-- = (bits & 0x80) ? fg_color : bg_color;
bits <<= 1;
}
dst -= (pcons->lcdsizex - VIDEO_FONT_WIDTH);
}
}
static inline void console_setrow180(struct console_t *pcons, u32 row, int clr)
{
int i;
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
(pcons->rows-row-1) * VIDEO_FONT_HEIGHT *
pcons->lcdsizex;
for (i = 0; i < (VIDEO_FONT_HEIGHT * pcons->lcdsizex); i++)
*dst++ = clr;
}
static inline void console_moverow180(struct console_t *pcons,
u32 rowdst, u32 rowsrc)
{
int i;
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
(pcons->rows-rowdst-1) * VIDEO_FONT_HEIGHT *
pcons->lcdsizex;
fbptr_t *src = (fbptr_t *)pcons->fbbase +
(pcons->rows-rowsrc-1) * VIDEO_FONT_HEIGHT *
pcons->lcdsizex;
for (i = 0; i < (VIDEO_FONT_HEIGHT * pcons->lcdsizex); i++)
*dst++ = *src++;
}
static void lcd_putc_xy270(struct console_t *pcons, ushort x, ushort y, char c)
{
int fg_color = lcd_getfgcolor();
int bg_color = lcd_getbgcolor();
int i, col;
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
pcons->lcdsizey * pcons->lcdsizex -
(x+1) * pcons->lcdsizex +
y;
uchar msk = 0x80;
uchar *pfont = video_fontdata + c * VIDEO_FONT_HEIGHT;
for (col = 0; col < VIDEO_FONT_WIDTH; ++col) {
for (i = 0; i < VIDEO_FONT_HEIGHT; ++i)
*dst++ = (*(pfont + i) & msk) ? fg_color : bg_color;
msk >>= 1;
dst -= (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
}
}
static inline void console_setrow270(struct console_t *pcons, u32 row, int clr)
{
int i, j;
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
row*VIDEO_FONT_HEIGHT;
for (j = 0; j < pcons->lcdsizey; j++) {
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
*dst++ = clr;
dst += (pcons->lcdsizex - VIDEO_FONT_HEIGHT);
}
}
static inline void console_moverow270(struct console_t *pcons,
u32 rowdst, u32 rowsrc)
{
int i, j;
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
rowdst*VIDEO_FONT_HEIGHT;
fbptr_t *src = (fbptr_t *)pcons->fbbase +
rowsrc*VIDEO_FONT_HEIGHT;
for (j = 0; j < pcons->lcdsizey; j++) {
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
*dst++ = *src++;
src += (pcons->lcdsizex - VIDEO_FONT_HEIGHT);
dst += (pcons->lcdsizex - VIDEO_FONT_HEIGHT);
}
}
static void console_calc_rowcol_rot(struct console_t *pcons)
{
if (pcons->lcdrot == 1 || pcons->lcdrot == 3)
console_calc_rowcol(pcons, pcons->lcdsizey, pcons->lcdsizex);
else
console_calc_rowcol(pcons, pcons->lcdsizex, pcons->lcdsizey);
}
void lcd_init_console_rot(struct console_t *pcons)
{
if (pcons->lcdrot == 0) {
return;
} else if (pcons->lcdrot == 1) {
pcons->fp_putc_xy = &lcd_putc_xy90;
pcons->fp_console_moverow = &console_moverow90;
pcons->fp_console_setrow = &console_setrow90;
} else if (pcons->lcdrot == 2) {
pcons->fp_putc_xy = &lcd_putc_xy180;
pcons->fp_console_moverow = &console_moverow180;
pcons->fp_console_setrow = &console_setrow180;
} else if (pcons->lcdrot == 3) {
pcons->fp_putc_xy = &lcd_putc_xy270;
pcons->fp_console_moverow = &console_moverow270;
pcons->fp_console_setrow = &console_setrow270;
} else {
printf("%s: invalid framebuffer rotation (%d)!\n",
__func__, pcons->lcdrot);
return;
}
console_calc_rowcol_rot(pcons);
}
|
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2013 Inria. All rights reserved.
* Copyright © 2009-2012 Université Bordeaux 1
* Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
/**
* This file contains the inline code of functions declared in hwloc.h
*/
#ifndef HWLOC_DEPRECATED_H
#define HWLOC_DEPRECATED_H
#ifndef HWLOC_H
#error Please include the main hwloc.h instead
#endif
#ifdef __cplusplus
extern "C" {
#endif
/** \brief Stringify a given topology object into a human-readable form.
*
* \note This function is deprecated in favor of hwloc_obj_type_snprintf()
* and hwloc_obj_attr_snprintf() since it is not very flexible and
* only prints physical/OS indexes.
*
* Fill string \p string up to \p size characters with the description
* of topology object \p obj in topology \p topology.
*
* If \p verbose is set, a longer description is used. Otherwise a
* short description is used.
*
* \p indexprefix is used to prefix the \p os_index attribute number of
* the object in the description. If \c NULL, the \c # character is used.
*
* If \p size is 0, \p string may safely be \c NULL.
*
* \return the number of character that were actually written if not truncating,
* or that would have been written (not including the ending \\0).
*/
HWLOC_DECLSPEC int hwloc_obj_snprintf(char * __hwloc_restrict string, size_t size,
hwloc_topology_t topology, hwloc_obj_t obj,
const char * __hwloc_restrict indexprefix, int verbose);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* HWLOC_INLINES_H */
|
/**
******************************************************************************
* @file fonts.h
* @author MCD Application Team
* @version V1.0.0
* @date 18-February-2014
* @brief Header for fonts.c file
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2014 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 __FONTS_H
#define __FONTS_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
/** @addtogroup Utilities
* @{
*/
/** @addtogroup STM32_EVAL
* @{
*/
/** @addtogroup Common
* @{
*/
/** @addtogroup FONTS
* @{
*/
/** @defgroup FONTS_Exported_Types
* @{
*/
typedef struct _tFont
{
const uint8_t *table;
uint16_t Width;
uint16_t Height;
} sFONT;
extern sFONT Font24;
extern sFONT Font20;
extern sFONT Font16;
extern sFONT Font12;
extern sFONT Font8;
/**
* @}
*/
/** @defgroup FONTS_Exported_Constants
* @{
*/
#define LINE(x) ((x) * (((sFONT *)BSP_LCD_GetFont())->Height))
/**
* @}
*/
/** @defgroup FONTS_Exported_Macros
* @{
*/
/**
* @}
*/
/** @defgroup FONTS_Exported_Functions
* @{
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __FONTS_H */
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrTextureDomainEffect_DEFINED
#define GrTextureDomainEffect_DEFINED
#include "GrSingleTextureEffect.h"
class GrGLTextureDomainEffect;
struct SkRect;
/**
* Limits a texture's lookup coordinates to a domain. Samples outside the domain are either clamped
* the edge of the domain or result in a vec4 of zeros. The domain is clipped to normalized texture
* coords ([0,1]x[0,1] square). Bilinear filtering can cause texels outside the domain to affect the
* read value unless the caller considers this when calculating the domain. TODO: This should be a
* helper that can assist an effect rather than effect unto itself.
*/
class GrTextureDomainEffect : public GrSingleTextureEffect {
public:
/**
* If SkShader::kDecal_TileMode sticks then this enum could be replaced by SkShader::TileMode.
* We could also consider replacing/augmenting Decal mode with Border mode where the color
* outside of the domain is user-specifiable. Decal mode currently has a hard (non-lerped)
* transition between the border and the interior.
*/
enum WrapMode {
kClamp_WrapMode,
kDecal_WrapMode,
};
static GrEffectRef* Create(GrTexture*,
const SkMatrix&,
const SkRect& domain,
WrapMode,
GrTextureParams::FilterMode filterMode,
CoordsType = kLocal_CoordsType);
virtual ~GrTextureDomainEffect();
static const char* Name() { return "TextureDomain"; }
typedef GrGLTextureDomainEffect GLEffect;
virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE;
const SkRect& domain() const { return fTextureDomain; }
WrapMode wrapMode() const { return fWrapMode; }
/* Computes a domain that bounds all the texels in texelRect. Note that with bilerp enabled
texels neighboring the domain may be read. */
static const SkRect MakeTexelDomain(const GrTexture* texture, const SkIRect& texelRect) {
SkScalar wInv = SK_Scalar1 / texture->width();
SkScalar hInv = SK_Scalar1 / texture->height();
SkRect result = {
texelRect.fLeft * wInv,
texelRect.fTop * hInv,
texelRect.fRight * wInv,
texelRect.fBottom * hInv
};
return result;
}
protected:
WrapMode fWrapMode;
SkRect fTextureDomain;
private:
GrTextureDomainEffect(GrTexture*,
const SkMatrix&,
const SkRect& domain,
WrapMode,
GrTextureParams::FilterMode filterMode,
CoordsType type);
virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE;
GR_DECLARE_EFFECT_TEST;
typedef GrSingleTextureEffect INHERITED;
};
#endif
|
#include "clar_libgit2.h"
void test_revwalk_simplify__cleanup(void)
{
cl_git_sandbox_cleanup();
}
/*
* a4a7dce [0] Merge branch 'master' into br2
|\
| * 9fd738e [1] a fourth commit
| * 4a202b3 [2] a third commit
* | c47800c [3] branch commit one
|/
* 5b5b025 [5] another commit
* 8496071 [4] testing
*/
static const char *commit_head = "a4a7dce85cf63874e984719f4fdd239f5145052f";
static const char *expected_str[] = {
"a4a7dce85cf63874e984719f4fdd239f5145052f", /* 0 */
"c47800c7266a2be04c571c04d5a6614691ea99bd", /* 3 */
"5b5b025afb0b4c913b4c338a42934a3863bf3644", /* 4 */
"8496071c1b46c854b31185ea97743be6a8774479", /* 5 */
};
void test_revwalk_simplify__first_parent(void)
{
git_repository *repo;
git_revwalk *walk;
git_oid id, expected[4];
int i, error;
for (i = 0; i < 4; i++) {
git_oid_fromstr(&expected[i], expected_str[i]);
}
repo = cl_git_sandbox_init("testrepo.git");
cl_git_pass(git_revwalk_new(&walk, repo));
git_oid_fromstr(&id, commit_head);
cl_git_pass(git_revwalk_push(walk, &id));
git_revwalk_sorting(walk, GIT_SORT_TOPOLOGICAL);
git_revwalk_simplify_first_parent(walk);
i = 0;
while ((error = git_revwalk_next(&id, walk)) == 0) {
cl_assert_equal_oid(&expected[i], &id);
i++;
}
cl_assert_equal_i(i, 4);
cl_assert_equal_i(error, GIT_ITEROVER);
git_revwalk_free(walk);
}
|
/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <stdlib.h>
#undef labs
/* Return the absolute value of I. */
long int
labs (long int i)
{
return i < 0 ? -i : i;
}
|
/* Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _SYS_IPC_H
# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
#endif
#include <sys/types.h>
/* Mode bits for `msgget', `semget', and `shmget'. */
#define IPC_CREAT 01000 /* Create key if key does not exist. */
#define IPC_EXCL 02000 /* Fail if key exists. */
#define IPC_NOWAIT 04000 /* Return error on wait. */
/* Control commands for `msgctl', `semctl', and `shmctl'. */
#define IPC_RMID 0 /* Remove identifier. */
#define IPC_SET 1 /* Set `ipc_perm' options. */
#define IPC_STAT 2 /* Get `ipc_perm' options. */
#define IPC_INFO 3 /* See ipcs. */
/* Special key values. */
#define IPC_PRIVATE ((__key_t) 0) /* Private key. */
/* Data structure used to pass permission information to IPC operations. */
struct ipc_perm
{
__key_t __key; /* Key. */
__uid_t uid; /* Owner's user ID. */
__gid_t gid; /* Owner's group ID. */
__uid_t cuid; /* Creator's user ID. */
__gid_t cgid; /* Creator's group ID. */
__mode_t mode; /* Read/write permission. */
unsigned short int __seq; /* Sequence number. */
unsigned short int __pad1;
unsigned long int __unused1;
unsigned long int __unused2;
};
|
/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
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 <math.h>
float
__copysignf (float x, float y)
{
return __builtin_copysignf (x, y);
}
weak_alias (__copysignf, copysignf)
|
/* Set up the data structures for the system-supplied DSO.
Copyright (C) 2012-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
static inline void __attribute__ ((always_inline))
setup_vdso (struct link_map *main_map __attribute__ ((unused)),
struct link_map ***first_preload __attribute__ ((unused)))
{
#ifdef NEED_DL_SYSINFO_DSO
if (GLRO(dl_sysinfo_dso) == NULL)
return;
/* Do an abridged version of the work _dl_map_object_from_fd would do
to map in the object. It's already mapped and prelinked (and
better be, since it's read-only and so we couldn't relocate it).
We just want our data structures to describe it as if we had just
mapped and relocated it normally. */
struct link_map *l = _dl_new_object ((char *) "", "", lt_library, NULL,
0, LM_ID_BASE);
if (__glibc_likely (l != NULL))
{
static ElfW(Dyn) dyn_temp[DL_RO_DYN_TEMP_CNT] attribute_relro;
l->l_phdr = ((const void *) GLRO(dl_sysinfo_dso)
+ GLRO(dl_sysinfo_dso)->e_phoff);
l->l_phnum = GLRO(dl_sysinfo_dso)->e_phnum;
for (uint_fast16_t i = 0; i < l->l_phnum; ++i)
{
const ElfW(Phdr) *const ph = &l->l_phdr[i];
if (ph->p_type == PT_DYNAMIC)
{
l->l_ld = (void *) ph->p_vaddr;
l->l_ldnum = ph->p_memsz / sizeof (ElfW(Dyn));
}
else if (ph->p_type == PT_LOAD)
{
if (! l->l_addr)
l->l_addr = ph->p_vaddr;
if (ph->p_vaddr + ph->p_memsz >= l->l_map_end)
l->l_map_end = ph->p_vaddr + ph->p_memsz;
if ((ph->p_flags & PF_X)
&& ph->p_vaddr + ph->p_memsz >= l->l_text_end)
l->l_text_end = ph->p_vaddr + ph->p_memsz;
}
else
/* There must be no TLS segment. */
assert (ph->p_type != PT_TLS);
}
l->l_map_start = (ElfW(Addr)) GLRO(dl_sysinfo_dso);
l->l_addr = l->l_map_start - l->l_addr;
l->l_map_end += l->l_addr;
l->l_text_end += l->l_addr;
l->l_ld = (void *) ((ElfW(Addr)) l->l_ld + l->l_addr);
elf_get_dynamic_info (l, dyn_temp);
_dl_setup_hash (l);
l->l_relocated = 1;
/* The vDSO is always used. */
l->l_used = 1;
/* Initialize l_local_scope to contain just this map. This allows
the use of dl_lookup_symbol_x to resolve symbols within the vdso.
So we create a single entry list pointing to l_real as its only
element */
l->l_local_scope[0]->r_nlist = 1;
l->l_local_scope[0]->r_list = &l->l_real;
/* Now that we have the info handy, use the DSO image's soname
so this object can be looked up by name. Note that we do not
set l_name here. That field gives the file name of the DSO,
and this DSO is not associated with any file. */
if (l->l_info[DT_SONAME] != NULL)
{
/* Work around a kernel problem. The kernel cannot handle
addresses in the vsyscall DSO pages in writev() calls. */
const char *dsoname = ((char *) D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_SONAME]->d_un.d_val);
size_t len = strlen (dsoname) + 1;
char *copy = malloc (len);
if (copy == NULL)
_dl_fatal_printf ("out of memory\n");
l->l_libname->name = l->l_name = memcpy (copy, dsoname, len);
}
/* Add the vDSO to the object list. */
_dl_add_to_namespace_list (l, LM_ID_BASE);
# if IS_IN (rtld)
/* Rearrange the list so this DSO appears after rtld_map. */
assert (l->l_next == NULL);
assert (l->l_prev == main_map);
GL(dl_rtld_map).l_next = l;
l->l_prev = &GL(dl_rtld_map);
*first_preload = &l->l_next;
# else
GL(dl_nns) = 1;
# endif
/* We have a prelinked DSO preloaded by the system. */
GLRO(dl_sysinfo_map) = l;
# ifdef NEED_DL_SYSINFO
if (GLRO(dl_sysinfo) == DL_SYSINFO_DEFAULT)
GLRO(dl_sysinfo) = GLRO(dl_sysinfo_dso)->e_entry + l->l_addr;
# endif
}
#endif
}
|
#ifndef ALIPP13NONLINEARITYSCANSELECTION_H
#define ALIPP13NONLINEARITYSCANSELECTION_H
// --- Custom header files ---
#include "AliPP13SelectionWeights.h"
#include "AliPP13SpectrumSelectionMC.h"
// --- AliRoot header files ---
#include <AliVCluster.h>
// TODO: Fix logic for pointers
//
// NB: Don't use pointers in the array, this way will be easier
//
class AliPP13NonlinearityScanSelection : public AliPP13SpectrumSelectionMC
{
enum ScanSize {kNbinsA = 9, kNbinsB = 9};
public:
AliPP13NonlinearityScanSelection(): AliPP13SpectrumSelectionMC() {}
AliPP13NonlinearityScanSelection(const char * name, const char * title, AliPP13ClusterCuts cuts,
AliPP13SelectionWeightsScan * sw, Float_t precA = 0.01, Float_t precB = 0.1):
AliPP13SpectrumSelectionMC(name, title, cuts, sw),
fInvariantMass(),
fMixInvariantMass(),
fPtPrimaryPi0(),
fPrecisionA(precA),
fPrecisionB(precB)
{
Float_t nonA = sw->fE;
Float_t nonB = sw->fD;
for(Int_t ia = 0; ia < kNbinsA; ++ia)
{
for(Int_t ib = 0; ib < kNbinsB; ++ib)
{
AliPP13SelectionWeightsScan & swi = fWeightsScan[ia][ib];
swi.fE = nonA + fPrecisionA * (kNbinsA / 2 - ia) / (kNbinsA / 2);
swi.fD = nonB + fPrecisionB * (kNbinsB / 2 - ib) / (kNbinsB / 2);
}
}
}
virtual void ConsiderGeneratedParticles(const EventFlags & eflags);
virtual void InitSelectionHistograms();
protected:
virtual void ConsiderPair(const AliVCluster * c1, const AliVCluster * c2, const EventFlags & eflags);
virtual TLorentzVector ClusterMomentumBinned(const AliVCluster * c1, const EventFlags & eflags, Int_t ia, Int_t ib) const;
AliPP13NonlinearityScanSelection(const AliPP13NonlinearityScanSelection &);
AliPP13NonlinearityScanSelection & operator = (const AliPP13NonlinearityScanSelection &);
private:
// Set of weights that are need for NonlinearityScan
AliPP13SelectionWeightsScan fWeightsScan[kNbinsA][kNbinsB];
// Parameters of nonlinearity parametrization
TH1 * fInvariantMass[kNbinsA][kNbinsB]; //!
TH1 * fMixInvariantMass[kNbinsA][kNbinsB]; //!
TH1 * fPtPrimaryPi0; //!
Float_t fPrecisionA;
Float_t fPrecisionB;
ClassDef(AliPP13NonlinearityScanSelection, 2)
};
#endif
|
/* GtkPrintUnixDialog
* Copyright (C) 2006 John (J5) Palmieri <johnp@redhat.com>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_PRINT_UNIX_DIALOG_H__
#define __GTK_PRINT_UNIX_DIALOG_H__
#if !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtkunixprint.h> can be included directly."
#endif
#include <gtk/gtk.h>
#include <gtk/gtkprinter.h>
#include <gtk/gtkprintjob.h>
G_BEGIN_DECLS
#define GTK_TYPE_PRINT_UNIX_DIALOG (gtk_print_unix_dialog_get_type ())
#define GTK_PRINT_UNIX_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_UNIX_DIALOG, GtkPrintUnixDialog))
#define GTK_PRINT_UNIX_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PRINT_UNIX_DIALOG, GtkPrintUnixDialogClass))
#define GTK_IS_PRINT_UNIX_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_UNIX_DIALOG))
#define GTK_IS_PRINT_UNIX_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PRINT_UNIX_DIALOG))
#define GTK_PRINT_UNIX_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PRINT_UNIX_DIALOG, GtkPrintUnixDialogClass))
typedef struct _GtkPrintUnixDialog GtkPrintUnixDialog;
typedef struct _GtkPrintUnixDialogClass GtkPrintUnixDialogClass;
typedef struct GtkPrintUnixDialogPrivate GtkPrintUnixDialogPrivate;
struct _GtkPrintUnixDialog
{
GtkDialog parent_instance;
/*< private >*/
GtkPrintUnixDialogPrivate *priv;
};
struct _GtkPrintUnixDialogClass
{
GtkDialogClass parent_class;
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
};
GDK_AVAILABLE_IN_ALL
GType gtk_print_unix_dialog_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkWidget * gtk_print_unix_dialog_new (const gchar *title,
GtkWindow *parent);
GDK_AVAILABLE_IN_ALL
void gtk_print_unix_dialog_set_page_setup (GtkPrintUnixDialog *dialog,
GtkPageSetup *page_setup);
GDK_AVAILABLE_IN_ALL
GtkPageSetup * gtk_print_unix_dialog_get_page_setup (GtkPrintUnixDialog *dialog);
GDK_AVAILABLE_IN_ALL
void gtk_print_unix_dialog_set_current_page (GtkPrintUnixDialog *dialog,
gint current_page);
GDK_AVAILABLE_IN_ALL
gint gtk_print_unix_dialog_get_current_page (GtkPrintUnixDialog *dialog);
GDK_AVAILABLE_IN_ALL
void gtk_print_unix_dialog_set_settings (GtkPrintUnixDialog *dialog,
GtkPrintSettings *settings);
GDK_AVAILABLE_IN_ALL
GtkPrintSettings * gtk_print_unix_dialog_get_settings (GtkPrintUnixDialog *dialog);
GDK_AVAILABLE_IN_ALL
GtkPrinter * gtk_print_unix_dialog_get_selected_printer (GtkPrintUnixDialog *dialog);
GDK_AVAILABLE_IN_ALL
void gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog,
GtkWidget *child,
GtkWidget *tab_label);
GDK_AVAILABLE_IN_ALL
void gtk_print_unix_dialog_set_manual_capabilities (GtkPrintUnixDialog *dialog,
GtkPrintCapabilities capabilities);
GDK_AVAILABLE_IN_ALL
GtkPrintCapabilities gtk_print_unix_dialog_get_manual_capabilities (GtkPrintUnixDialog *dialog);
GDK_AVAILABLE_IN_ALL
void gtk_print_unix_dialog_set_support_selection (GtkPrintUnixDialog *dialog,
gboolean support_selection);
GDK_AVAILABLE_IN_ALL
gboolean gtk_print_unix_dialog_get_support_selection (GtkPrintUnixDialog *dialog);
GDK_AVAILABLE_IN_ALL
void gtk_print_unix_dialog_set_has_selection (GtkPrintUnixDialog *dialog,
gboolean has_selection);
GDK_AVAILABLE_IN_ALL
gboolean gtk_print_unix_dialog_get_has_selection (GtkPrintUnixDialog *dialog);
GDK_AVAILABLE_IN_ALL
void gtk_print_unix_dialog_set_embed_page_setup (GtkPrintUnixDialog *dialog,
gboolean embed);
GDK_AVAILABLE_IN_ALL
gboolean gtk_print_unix_dialog_get_embed_page_setup (GtkPrintUnixDialog *dialog);
GDK_AVAILABLE_IN_ALL
gboolean gtk_print_unix_dialog_get_page_setup_set (GtkPrintUnixDialog *dialog);
G_END_DECLS
#endif /* __GTK_PRINT_UNIX_DIALOG_H__ */
|
#ifndef _BP_AUTO_H
#define _BP_AUTO_H
#include <linux/miscdevice.h>
#include <linux/wakelock.h>
struct bp_private_data;
#define BP_UNKNOW_DATA -1
#define BP_OFF 0
#define BP_ON 1
#define BP_SUSPEND 2
#define BP_WAKE 3
#define BP_IOCTL_BASE 'm'
#define BP_IOCTL_RESET _IOW(BP_IOCTL_BASE, 0x00, int)
#define BP_IOCTL_POWON _IOW(BP_IOCTL_BASE, 0x01, int)
#define BP_IOCTL_POWOFF _IOW(BP_IOCTL_BASE, 0x02, int)
#define BP_IOCTL_WRITE_STATUS _IOW(BP_IOCTL_BASE, 0x03, int)
#define BP_IOCTL_GET_STATUS _IOR(BP_IOCTL_BASE, 0x04, int)
#define BP_IOCTL_SET_PVID _IOW(BP_IOCTL_BASE, 0x05, int)
#define BP_IOCTL_GET_BPID _IOR(BP_IOCTL_BASE, 0x06, int)
enum bp_id{
BP_ID_INVALID = 0,
BP_ID_MT6229,
BP_ID_MU509,
BP_ID_MI700,
BP_ID_MW100,
BP_ID_TD8801,
BP_ID_NUM,
};
enum bp_bus_type{
BP_BUS_TYPE_INVALID = 0,
BP_BUS_TYPE_UART,
BP_BUS_TYPE_SPI,
BP_BUS_TYPE_USB,
BP_BUS_TYPE_SDIO,
BP_BUS_TYPE_USB_UART,
BP_BUS_TYPE_SPI_UART,
BP_BUS_TYPE_SDIO_UART,
BP_BUS_TYPE_NUM_ID,
};
struct bp_platform_data {
int board_id;
int bp_id;
int (*init_platform_hw)(void);
int (*exit_platform_hw)(void);
int bp_power;
int bp_en;
int bp_reset;
int ap_ready;
int bp_ready;
int ap_wakeup_bp;
int bp_wakeup_ap;
int bp_usb_en;
int bp_uart_en;
int gpio_valid;
};
struct bp_operate {
char *name;
int bp_id;
int bp_bus;
int bp_pid;
int bp_vid;
int bp_power;
int bp_en;
int bp_reset;
int ap_ready;
int bp_ready;
int ap_wakeup_bp;
int bp_wakeup_ap;
int bp_usb_en;
int bp_uart_en;
int trig;
int (*active)(struct bp_private_data *bp, int enable);
int (*init)(struct bp_private_data *bp);
int (*reset)(struct bp_private_data *bp);
int (*ap_wake_bp)(struct bp_private_data *bp, int wake);
int (*bp_wake_ap)(struct bp_private_data *bp);
int (*shutdown)(struct bp_private_data *bp);
int (*read_status)(struct bp_private_data *bp);
int (*write_status)(struct bp_private_data *bp);
int (*suspend)(struct bp_private_data *bp);
int (*resume)(struct bp_private_data *bp);
char *misc_name;
struct miscdevice *private_miscdev;
};
struct bp_private_data {
struct device *dev;
int status;
int suspend_status;
struct wake_lock bp_wakelock;
struct delayed_work wakeup_work; /*report second event*/
struct bp_platform_data *pdata;
struct bp_operate *ops;
struct file_operations fops;
struct miscdevice miscdev;
struct file_operations id_fops;
struct miscdevice id_miscdev;
#ifdef CONFIG_HAS_EARLYSUSPEND
struct early_suspend early_suspend;
#endif
};
extern int bp_register_slave(struct bp_private_data *bp,
struct bp_platform_data *slave_pdata,
struct bp_operate *(*get_bp_ops)(void));
extern int bp_unregister_slave(struct bp_private_data *bp,
struct bp_platform_data *slave_pdata,
struct bp_operate *(*get_bp_ops)(void));
#endif
|
/* $NoKeywords:$ */
/**
* @file
*
* AMD CPU BrandId related functions and structures for socket S1g3.
*
* Contains code that provides CPU BrandId information
*
* @xrefitem bom "File Content Label" "Release Content"
* @e project: AGESA
* @e sub-project: CPU
* @e \$Revision: 44324 $ @e \$Date: 2010-12-22 17:16:51 +0800 (Wed, 22 Dec 2010) $
*
*/
/*
******************************************************************************
*
* Copyright (c) 2011, Advanced Micro Devices, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Advanced Micro Devices, Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. 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.
******************************************************************************
*/
/*----------------------------------------------------------------------------------------
* M O D U L E S U S E D
*----------------------------------------------------------------------------------------
*/
#include "AGESA.h"
#include "cpuRegisters.h"
#include "cpuEarlyInit.h"
CODE_GROUP (G1_PEICC)
RDATA_GROUP (G1_PEICC)
/*----------------------------------------------------------------------------------------
* D E F I N I T I O N S A N D M A C R O S
*----------------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* T Y P E D E F S A N D S T R U C T U R E S
*----------------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* P R O T O T Y P E S O F L O C A L F U N C T I O N S
*----------------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* E X P O R T E D F U N C T I O N S
*----------------------------------------------------------------------------------------
*/
// PRIVATE FORMAT FOR BRAND TABLE ... FOR AMD USE ONLY
// String1
/*CHAR8 strEngSample[] = "AMD Engineering Sample";
CHAR8 strTtkSample[] = "AMD Thermal Test Kit";
CHAR8 strUnknown[] = "AMD Processor model unknown";
*/
// S1g3 NC 0
CONST CHAR8 ROMDATA str_F10_S1g3_Sempron_M1[] = "AMD Sempron(tm) M1";
// S1g3 NC 1
CONST CHAR8 ROMDATA str_F10_S1g3_Turion_II_U_DC_M_M6[] = "AMD Turion(tm) II Ultra Dual-Core Mobile M6";
CONST CHAR8 ROMDATA str_F10_S1g3_Turion_II_DC_M_M5[] = "AMD Turion(tm) II Dual-Core Mobile M5";
CONST CHAR8 ROMDATA str_F10_S1g3_Athlon_II_DC_M3[] = "AMD Athlon(tm) II Dual-Core M3";
// String2
/*---------------------------------------------------------------------------------------
* T Y P E D E F S, S T R U C T U R E S, E N U M S
*---------------------------------------------------------------------------------------
*/
CONST AMD_CPU_BRAND ROMDATA CpuF10BrandIdString1ArrayS1g3[] =
{
// S1g3
{1, 0, 0, DR_SOCKET_S1G3, str_F10_S1g3_Sempron_M1, sizeof (str_F10_S1g3_Sempron_M1)},
{2, 0, 0, DR_SOCKET_S1G3, str_F10_S1g3_Turion_II_U_DC_M_M6, sizeof (str_F10_S1g3_Turion_II_U_DC_M_M6)},
{2, 0, 1, DR_SOCKET_S1G3, str_F10_S1g3_Turion_II_DC_M_M5, sizeof (str_F10_S1g3_Turion_II_DC_M_M5)},
{2, 0, 2, DR_SOCKET_S1G3, str_F10_S1g3_Athlon_II_DC_M3, sizeof (str_F10_S1g3_Athlon_II_DC_M3)}
}; //Cores, page, index, socket, stringstart, stringlength
CONST AMD_CPU_BRAND ROMDATA CpuF10BrandIdString2ArrayS1g3[] =
{
// S1g3
{1, 0, 0x0F, DR_SOCKET_S1G3, 0, 0}, //Size 0 for no suffix
{2, 0, 0x0F, DR_SOCKET_S1G3, 0, 0} //Size 0 for no suffix
};
CONST CPU_BRAND_TABLE ROMDATA F10BrandIdString1ArrayS1g3 = {
(sizeof (CpuF10BrandIdString1ArrayS1g3) / sizeof (AMD_CPU_BRAND)),
CpuF10BrandIdString1ArrayS1g3
};
CONST CPU_BRAND_TABLE ROMDATA F10BrandIdString2ArrayS1g3 = {
(sizeof (CpuF10BrandIdString2ArrayS1g3) / sizeof (AMD_CPU_BRAND)),
CpuF10BrandIdString2ArrayS1g3
};
|
/********************************************************************
* swlogic.h - switch logic, loaded from various versions of switch.h
*
* Copyright 1989 Carnegie Mellon University
*
*********************************************************************/
/*
* When included, one of the following should be defined:
* AZTEC (manx compiler, implies AMIGA)
* THINK_C (Think C compiler, implies Macintosh)
* __MWERKS__ (Metrowerks C compiler, implies Macintosh)
* LATTICE & DOS (Lattice compiler for IBM PC/AT/XT/CLONES)
* MICROSOFT & DOS (Microsoft compiler, implies IBM PC/AT/XT/CLONES)
* UNIX (emulator for UNIX)
* UNIX_ITC (ITC code for RS6000)
* UNIX_MACH (MACH ukernel system)
*/
/*------------------------------------------*/
/* Other switches that might be defined in switches.h are as follows: */
/* APPLICATION, SPACE_FOR_PLAY, MAX_CHANNELS */
/*------------------------------------------*/
/* We're moving toward the elimination of switches.h, so try to map
* predefined constants into our standard constants shown above:
*/
/* CHANGE LOG
* --------------------------------------------------------------------
* 28Apr03 dm new conditional compilation structure
* 28Apr03 rbd remove macro redefinitions: MICROSOFT
*/
/* Microsoft C compiler: */
#ifdef _MSC_VER
#endif
#ifdef _MSDOS
#define DOS
#endif
/* Quick C compiler: */
#ifndef DOS
#ifdef MICROSOFT
#define DOS
#endif
#endif
/* Borland C compiler: */
#ifdef __BORLANDC__
#define BORLAND
#define DOS
#endif
/* Borland Turbo C compiler: */
#ifdef __TURBOC__
#define BORLAND]
#define DOS
#endif
/* SGI systems */
#ifdef sgi
#ifndef UNIX
#define UNIX
#endif
#define UNIX_IRIX
#define MAX_CHANNELS 32
#endif
/* APPLICATION -- define APPLICATION if you want to disable
* looking for command line switches in the midi interface.
* I think this feature is here for the Piano Tutor project
* and you should not define APPLICATION for CMU Midi Toolkit
* projects (APPLICATION is a poor choice of terms):
*/
/* memory space management (system dependent):
* SPACE_FOR_PLAY must be enough space to allow
* seq to play a score. This may include space for
* note-off events, I/O buffers, etc.
*/
#ifndef SPACE_FOR_PLAY
#define SPACE_FOR_PLAY 10000L
#endif
/* How many MIDI channels are there? MACINTOSH can use 2 ports,
* so it supports 32 channels. Others have one port, 16 channels.
* On the other hand, if you don't have all the MIDI ports plugged
* into MIDI interfaces, CMT will just hang, so I'll compile with
* just 16 channels. The 32 channel option for the Mac is untested.
*/
#ifndef MAX_CHANNELS
#define MAX_CHANNELS 16
#endif
/*------------------------------------------*/
/* Now we get to the "logic": define things as a function of what
* was defined in switches.h
*/
#ifdef THINK_C
#define MACINTOSH
#endif
#ifdef __MWERKS__
#define MACINTOSH
#endif
#ifdef MACINTOSH
#define MACINTOSH_OR_DOS
#define MACINTOSH_OR_UNIX
/* I don't know if THINK_C defines this and we need it for a few prototypes... */
#ifndef __STDC__
#define __STDC__
#endif
#ifndef TAB_WIDTH
#define TAB_WIDTH 4
#endif
#endif
#ifndef TAB_WIDTH
#define TAB_WIDTH 8
#endif
/*
* If MIDIMGR is defined, compile for the Apple MIDI Manager
* (Non MIDI manager code is no longer supported)
*/
#ifdef MACINTOSH
/* under Nyquist, the MidiMgr is not used, so you can't
* receive or send Midi as in CMU MIDI Toolkit; however,
* much of CMU MIDI Toolkit is used for Midi file IO
*/
#ifndef NYQUIST
#define MIDIMGR
#endif
#define HAVE_VSNPRINTF 1
#endif
#ifdef BORLAND
#define DOS
#endif
#ifdef LATTICE322
#define DOS
#define OLD_PROTOTYPES
#endif
#ifdef UNIX_ITC
#define UNIX
#define ITC
#endif
#ifdef UNIX_MACH
#define UNIX
#define ITC
#endif
/* HAVE_VSNPRINTF says vsnprintf() is defined */
#ifdef ITC
#define HAVE_VSNPRINTF 1
#endif
#ifdef AZTEC
#define HAVE_VSNPRINTF 1
#endif
/* DOTS_FOR_ARGS says ANSI "..." notation is recognized */
#ifdef __STDC__
#define DOTS_FOR_ARGS
#endif
#ifdef UNIX_ITC
#define DOTS_FOR_ARGS
#endif
#ifdef BORLAND
#define DOTS_FOR_ARGS
#endif
#ifdef MICROSOFT
#define DOTS_FOR_ARGS
#endif
#ifdef DOS
#define MACINTOSH_OR_DOS
#else
#define huge
#endif
#ifdef UNIX
#define MACINTOSH_OR_UNIX
#endif
#define SWITCHES
|
// 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_UI_WEBUI_PREDICTORS_PREDICTORS_UI_H_
#define CHROME_BROWSER_UI_WEBUI_PREDICTORS_PREDICTORS_UI_H_
#include "base/macros.h"
#include "content/public/browser/web_ui_controller.h"
class PredictorsUI : public content::WebUIController {
public:
explicit PredictorsUI(content::WebUI* web_ui);
private:
DISALLOW_COPY_AND_ASSIGN(PredictorsUI);
};
#endif // CHROME_BROWSER_UI_WEBUI_PREDICTORS_PREDICTORS_UI_H_
|
// SPDX-License-Identifier: GPL-2.0
/*
* linux/fs/jfs/ioctl.c
*
* Copyright (C) 2006 Herbert Poetzl
* adapted from Remy Card's ext2/ioctl.c
*/
#include <linux/fs.h>
#include <linux/ctype.h>
#include <linux/capability.h>
#include <linux/mount.h>
#include <linux/time.h>
#include <linux/sched.h>
#include <linux/blkdev.h>
#include <asm/current.h>
#include <linux/uaccess.h>
#include "jfs_filsys.h"
#include "jfs_debug.h"
#include "jfs_incore.h"
#include "jfs_dinode.h"
#include "jfs_inode.h"
#include "jfs_dmap.h"
#include "jfs_discard.h"
static struct {
long jfs_flag;
long ext2_flag;
} jfs_map[] = {
{JFS_NOATIME_FL, FS_NOATIME_FL},
{JFS_DIRSYNC_FL, FS_DIRSYNC_FL},
{JFS_SYNC_FL, FS_SYNC_FL},
{JFS_SECRM_FL, FS_SECRM_FL},
{JFS_UNRM_FL, FS_UNRM_FL},
{JFS_APPEND_FL, FS_APPEND_FL},
{JFS_IMMUTABLE_FL, FS_IMMUTABLE_FL},
{0, 0},
};
static long jfs_map_ext2(unsigned long flags, int from)
{
int index=0;
long mapped=0;
while (jfs_map[index].jfs_flag) {
if (from) {
if (jfs_map[index].ext2_flag & flags)
mapped |= jfs_map[index].jfs_flag;
} else {
if (jfs_map[index].jfs_flag & flags)
mapped |= jfs_map[index].ext2_flag;
}
index++;
}
return mapped;
}
long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
struct inode *inode = file_inode(filp);
struct jfs_inode_info *jfs_inode = JFS_IP(inode);
unsigned int flags;
switch (cmd) {
case JFS_IOC_GETFLAGS:
flags = jfs_inode->mode2 & JFS_FL_USER_VISIBLE;
flags = jfs_map_ext2(flags, 0);
return put_user(flags, (int __user *) arg);
case JFS_IOC_SETFLAGS: {
unsigned int oldflags;
int err;
err = mnt_want_write_file(filp);
if (err)
return err;
if (!inode_owner_or_capable(&init_user_ns, inode)) {
err = -EACCES;
goto setflags_out;
}
if (get_user(flags, (int __user *) arg)) {
err = -EFAULT;
goto setflags_out;
}
flags = jfs_map_ext2(flags, 1);
if (!S_ISDIR(inode->i_mode))
flags &= ~JFS_DIRSYNC_FL;
/* Is it quota file? Do not allow user to mess with it */
if (IS_NOQUOTA(inode)) {
err = -EPERM;
goto setflags_out;
}
/* Lock against other parallel changes of flags */
inode_lock(inode);
oldflags = jfs_map_ext2(jfs_inode->mode2 & JFS_FL_USER_VISIBLE,
0);
err = vfs_ioc_setflags_prepare(inode, oldflags, flags);
if (err) {
inode_unlock(inode);
goto setflags_out;
}
flags = flags & JFS_FL_USER_MODIFIABLE;
flags |= jfs_inode->mode2 & ~JFS_FL_USER_MODIFIABLE;
jfs_inode->mode2 = flags;
jfs_set_inode_flags(inode);
inode_unlock(inode);
inode->i_ctime = current_time(inode);
mark_inode_dirty(inode);
setflags_out:
mnt_drop_write_file(filp);
return err;
}
case FITRIM:
{
struct super_block *sb = inode->i_sb;
struct request_queue *q = bdev_get_queue(sb->s_bdev);
struct fstrim_range range;
s64 ret = 0;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (!blk_queue_discard(q)) {
jfs_warn("FITRIM not supported on device");
return -EOPNOTSUPP;
}
if (copy_from_user(&range, (struct fstrim_range __user *)arg,
sizeof(range)))
return -EFAULT;
range.minlen = max_t(unsigned int, range.minlen,
q->limits.discard_granularity);
ret = jfs_ioc_trim(inode, &range);
if (ret < 0)
return ret;
if (copy_to_user((struct fstrim_range __user *)arg, &range,
sizeof(range)))
return -EFAULT;
return 0;
}
default:
return -ENOTTY;
}
}
#ifdef CONFIG_COMPAT
long jfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
/* While these ioctl numbers defined with 'long' and have different
* numbers than the 64bit ABI,
* the actual implementation only deals with ints and is compatible.
*/
switch (cmd) {
case JFS_IOC_GETFLAGS32:
cmd = JFS_IOC_GETFLAGS;
break;
case JFS_IOC_SETFLAGS32:
cmd = JFS_IOC_SETFLAGS;
break;
}
return jfs_ioctl(filp, cmd, arg);
}
#endif
|
/* This testcase is part of GDB, the GNU debugger.
Copyright 2010-2012 Free Software Foundation, Inc.
Contributed by Pierre Muller.
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/>.
Test for problem related to unnamed unions. */
struct a
{
union
{
int i;
};
} a;
int
main (void)
{
return sizeof (a.i);
}
|
char *meson_print(void);
|
// 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.
// Instances of NaCl modules spun up within the plugin as a subprocess.
// This may represent the "main" nacl module, or it may represent helpers
// that perform various tasks within the plugin, for example,
// a NaCl module for a compiler could be loaded to translate LLVM bitcode
// into native code.
#ifndef COMPONENTS_NACL_RENDERER_PLUGIN_NACL_SUBPROCESS_H_
#define COMPONENTS_NACL_RENDERER_PLUGIN_NACL_SUBPROCESS_H_
#include <stdarg.h>
#include "components/nacl/renderer/plugin/service_runtime.h"
#include "components/nacl/renderer/plugin/srpc_client.h"
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/include/portability.h"
namespace plugin {
class Plugin;
class ServiceRuntime;
class SrpcParams;
// A class representing an instance of a NaCl module, loaded by the plugin.
class NaClSubprocess {
public:
NaClSubprocess(const std::string& description,
ServiceRuntime* service_runtime,
SrpcClient* srpc_client);
virtual ~NaClSubprocess();
ServiceRuntime* service_runtime() const { return service_runtime_.get(); }
void set_service_runtime(ServiceRuntime* service_runtime) {
service_runtime_.reset(service_runtime);
}
// The socket used for communicating w/ the NaCl module.
SrpcClient* srpc_client() const { return srpc_client_.get(); }
// A basic description of the subprocess.
std::string description() const { return description_; }
// A detailed description of the subprocess that may contain addresses.
// Only use for debugging, but do not expose this to untrusted webapps.
std::string detailed_description() const;
// Start up interfaces.
bool StartSrpcServices();
// Invoke an Srpc Method. |out_params| must be allocated and cleaned up
// outside of this function, but it will be initialized by this function, and
// on success any out-params (if any) will be placed in |out_params|.
// Input types must be listed in |input_signature|, with the actual
// arguments passed in as var-args. Returns |true| on success.
bool InvokeSrpcMethod(const std::string& method_name,
const std::string& input_signature,
SrpcParams* out_params,
...);
// Fully shut down the subprocess.
void Shutdown();
private:
NACL_DISALLOW_COPY_AND_ASSIGN(NaClSubprocess);
bool VInvokeSrpcMethod(const std::string& method_name,
const std::string& signature,
SrpcParams* params,
va_list vl);
std::string description_;
// The service runtime representing the NaCl module instance.
nacl::scoped_ptr<ServiceRuntime> service_runtime_;
// Ownership of srpc_client taken from the service runtime.
nacl::scoped_ptr<SrpcClient> srpc_client_;
};
} // namespace plugin
#endif // COMPONENTS_NACL_RENDERER_PLUGIN_NACL_SUBPROCESS_H_
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_CHILD_WEBSOCKETSTREAMHANDLE_IMPL_H_
#define WEBKIT_CHILD_WEBSOCKETSTREAMHANDLE_IMPL_H_
#include "base/memory/ref_counted.h"
#include "base/supports_user_data.h"
#include "third_party/WebKit/public/platform/WebSocketStreamHandle.h"
namespace webkit_glue {
class WebKitPlatformSupportImpl;
class WebSocketStreamHandleImpl
: public base::SupportsUserData,
public blink::WebSocketStreamHandle {
public:
explicit WebSocketStreamHandleImpl(WebKitPlatformSupportImpl* platform);
virtual ~WebSocketStreamHandleImpl();
// WebSocketStreamHandle methods:
virtual void connect(
const blink::WebURL& url,
blink::WebSocketStreamHandleClient* client);
virtual bool send(const blink::WebData& data);
virtual void close();
private:
class Context;
scoped_refptr<Context> context_;
WebKitPlatformSupportImpl* platform_;
DISALLOW_COPY_AND_ASSIGN(WebSocketStreamHandleImpl);
};
} // namespace webkit_glue
#endif // WEBKIT_CHILD_WEBSOCKETSTREAMHANDLE_IMPL_H_
|
/**
* \file
*
* \brief maXTouch driver configuration
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_MXT_H_
#define CONF_MXT_H_
#define MXT_TWI_SPEED 400000
/* Uncomment this to enable validation of messages */
/* #define CONF_VALIDATE_MESSAGES */
#endif /* CONF_MXT_H_ */
|
/*
* (C) Copyright 2007-2008
* Stelian Pop <stelian.pop@leadtechdesign.com>
* Lead Tech Design <www.leadtechdesign.com>
*
* (C) Copyright 2010
* Matthias Weisser, Graf-Syteco <weisserm@arcor.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <div64.h>
#include <common.h>
#include <asm/io.h>
#include <asm/arch/hardware.h>
#define TIMER_LOAD_VAL 0xffffffff
#define TIMER_FREQ (CONFIG_MB86R0x_IOCLK / 256)
DECLARE_GLOBAL_DATA_PTR;
#define timestamp gd->tbl
#define lastdec gd->lastinc
static inline unsigned long long tick_to_time(unsigned long long tick)
{
tick *= CONFIG_SYS_HZ;
do_div(tick, TIMER_FREQ);
return tick;
}
static inline unsigned long long usec_to_tick(unsigned long long usec)
{
usec *= TIMER_FREQ;
do_div(usec, 1000000);
return usec;
}
/* nothing really to do with interrupts, just starts up a counter. */
int timer_init(void)
{
struct mb86r0x_timer * timer = (struct mb86r0x_timer *)
MB86R0x_TIMER_BASE;
ulong ctrl = readl(&timer->control);
writel(TIMER_LOAD_VAL, &timer->load);
ctrl |= MB86R0x_TIMER_ENABLE | MB86R0x_TIMER_PRS_8S |
MB86R0x_TIMER_SIZE_32;
writel(ctrl, &timer->control);
reset_timer_masked();
return 0;
}
/*
* timer without interrupts
*/
unsigned long long get_ticks(void)
{
struct mb86r0x_timer * timer = (struct mb86r0x_timer *)
MB86R0x_TIMER_BASE;
ulong now = readl(&timer->value);
if (now <= lastdec) {
/* normal mode (non roll) */
/* move stamp forward with absolut diff ticks */
timestamp += lastdec - now;
} else {
/* we have rollover of incrementer */
timestamp += lastdec + TIMER_LOAD_VAL - now;
}
lastdec = now;
return timestamp;
}
void reset_timer_masked(void)
{
struct mb86r0x_timer * timer = (struct mb86r0x_timer *)
MB86R0x_TIMER_BASE;
/* capture current value time */
lastdec = readl(&timer->value);
timestamp = 0; /* start "advancing" time stamp from 0 */
}
ulong get_timer_masked(void)
{
return tick_to_time(get_ticks());
}
void __udelay(unsigned long usec)
{
unsigned long long tmp;
ulong tmo;
tmo = usec_to_tick(usec);
tmp = get_ticks(); /* get current timestamp */
while ((get_ticks() - tmp) < tmo) /* loop till event */
/*NOP*/;
}
void reset_timer(void)
{
reset_timer_masked();
}
ulong get_timer(ulong base)
{
return get_timer_masked() - base;
}
/*
* This function is derived from PowerPC code (timebase clock frequency).
* On ARM it returns the number of timer ticks per second.
*/
ulong get_tbclk(void)
{
ulong tbclk;
tbclk = TIMER_FREQ;
return tbclk;
}
|
/***************************************************************************
qgstininterpolator.h
--------------------
begin : March 10, 2008
copyright : (C) 2008 by Marco Hugentobler
email : marco dot hugentobler at karto dot baug dot ethz dot ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSTININTERPOLATOR_H
#define QGSTININTERPOLATOR_H
#include "qgsinterpolator.h"
#include <QString>
#include "qgis_analysis.h"
class QgsFeatureSink;
class QgsTriangulation;
class TriangleInterpolator;
class QgsFeature;
class QgsFeedback;
class QgsFields;
/**
* \ingroup analysis
* \brief Interpolation in a triangular irregular network
* \since QGIS 3.0
*/
class ANALYSIS_EXPORT QgsTinInterpolator: public QgsInterpolator
{
public:
//! Indicates the type of interpolation to be performed
enum TinInterpolation
{
Linear, //!< Linear interpolation
CloughTocher, //!< Clough-Tocher interpolation
};
/**
* Constructor for QgsTinInterpolator.
* The \a feedback object specifies an optional QgsFeedback object for progress reports and cancellation support.
* Ownership of \a feedback is not transferred and callers must ensure that it exists for the lifetime of this object.
*/
QgsTinInterpolator( const QList<QgsInterpolator::LayerData> &inputData, TinInterpolation interpolation = Linear, QgsFeedback *feedback = nullptr );
~QgsTinInterpolator() override;
int interpolatePoint( double x, double y, double &result SIP_OUT, QgsFeedback *feedback ) override;
/**
* Returns the fields output by features when saving the triangulation.
* These fields should be used when creating
* a suitable feature sink for setTriangulationSink()
* \see setTriangulationSink()
* \since QGIS 3.0
*/
static QgsFields triangulationFields();
/**
* Sets the optional \a sink for saving the triangulation features.
*
* The sink must be setup to accept LineString features, with fields matching
* those returned by triangulationFields().
*
* \see triangulationFields()
* \since QGIS 3.0
*/
void setTriangulationSink( QgsFeatureSink *sink );
private:
QgsTriangulation *mTriangulation = nullptr;
TriangleInterpolator *mTriangleInterpolator = nullptr;
bool mIsInitialized;
QgsFeedback *mFeedback = nullptr;
//! Feature sink for triangulation
QgsFeatureSink *mTriangulationSink = nullptr;
//! Type of interpolation
TinInterpolation mInterpolation;
//! Create dual edge triangulation
void initialize();
/**
* Inserts the vertices of a feature into the triangulation
* \param f the feature
* \param source source for feature values to interpolate
* \param attr interpolation attribute index (if zCoord is FALSE)
* \param type point/structure line, break line
* \returns 0 in case of success, -1 if the feature could not be inserted because of numerical problems
*/
int insertData( const QgsFeature &f, QgsInterpolator::ValueSource source, int attr, SourceType type );
int addPointsFromGeometry( const QgsGeometry &g, ValueSource source, double attributeValue );
};
#endif
|
/*
* Copyright 2012-15 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DAL_TYPES_H__
#define __DAL_TYPES_H__
#include "signal_types.h"
#include "dc_types.h"
struct dal_logger;
struct dc_bios;
enum dce_version {
DCE_VERSION_UNKNOWN = (-1),
DCE_VERSION_8_0,
DCE_VERSION_8_1,
DCE_VERSION_8_3,
DCE_VERSION_10_0,
DCE_VERSION_11_0,
DCE_VERSION_11_2,
DCE_VERSION_11_22,
DCE_VERSION_12_0,
DCE_VERSION_12_1,
DCE_VERSION_MAX,
DCN_VERSION_1_0,
DCN_VERSION_1_01,
DCN_VERSION_2_0,
DCN_VERSION_2_1,
DCN_VERSION_3_0,
DCN_VERSION_MAX
};
#endif /* __DAL_TYPES_H__ */
|
/*
* Digital Beep Input Interface for HD-audio codec
*
* Author: Matthew Ranostay <mranostay@embeddedalley.com>
* Copyright (c) 2008 Embedded Alley Solutions Inc
*
* This driver 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 driver 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/input.h>
#include <linux/pci.h>
#include <linux/workqueue.h>
#include <sound/core.h>
#include "hda_beep.h"
enum {
DIGBEEP_HZ_STEP = 46875, /* 46.875 Hz */
DIGBEEP_HZ_MIN = 93750, /* 93.750 Hz */
DIGBEEP_HZ_MAX = 12000000, /* 12 KHz */
};
static void snd_hda_generate_beep(struct work_struct *work)
{
struct hda_beep *beep =
container_of(work, struct hda_beep, beep_work);
struct hda_codec *codec = beep->codec;
if (!beep->enabled)
return;
/* generate tone */
snd_hda_codec_write_cache(codec, beep->nid, 0,
AC_VERB_SET_BEEP_CONTROL, beep->tone);
}
static int snd_hda_beep_event(struct input_dev *dev, unsigned int type,
unsigned int code, int hz)
{
struct hda_beep *beep = input_get_drvdata(dev);
switch (code) {
case SND_BELL:
if (hz)
hz = 1000;
case SND_TONE:
hz *= 1000; /* fixed point */
hz = hz - DIGBEEP_HZ_MIN;
if (hz < 0)
hz = 0; /* turn off PC beep*/
else if (hz >= (DIGBEEP_HZ_MAX - DIGBEEP_HZ_MIN))
hz = 0xff;
else {
hz /= DIGBEEP_HZ_STEP;
hz++;
}
break;
default:
return -1;
}
beep->tone = hz;
/* schedule beep event */
schedule_work(&beep->beep_work);
return 0;
}
int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
{
struct input_dev *input_dev;
struct hda_beep *beep;
int err;
beep = kzalloc(sizeof(*beep), GFP_KERNEL);
if (beep == NULL)
return -ENOMEM;
snprintf(beep->phys, sizeof(beep->phys),
"card%d/codec#%d/beep0", codec->bus->card->number, codec->addr);
input_dev = input_allocate_device();
if (!input_dev) {
kfree(beep);
return -ENOMEM;
}
/* setup digital beep device */
input_dev->name = "HDA Digital PCBeep";
input_dev->phys = beep->phys;
input_dev->id.bustype = BUS_PCI;
input_dev->id.vendor = codec->vendor_id >> 16;
input_dev->id.product = codec->vendor_id & 0xffff;
input_dev->id.version = 0x01;
input_dev->evbit[0] = BIT_MASK(EV_SND);
input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
input_dev->event = snd_hda_beep_event;
input_dev->dev.parent = &codec->bus->pci->dev;
input_set_drvdata(input_dev, beep);
err = input_register_device(input_dev);
if (err < 0) {
input_free_device(input_dev);
kfree(beep);
return err;
}
/* enable linear scale */
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_2, 0x01);
beep->nid = nid;
beep->dev = input_dev;
beep->codec = codec;
beep->enabled = 1;
codec->beep = beep;
INIT_WORK(&beep->beep_work, &snd_hda_generate_beep);
return 0;
}
EXPORT_SYMBOL_HDA(snd_hda_attach_beep_device);
void snd_hda_detach_beep_device(struct hda_codec *codec)
{
struct hda_beep *beep = codec->beep;
if (beep) {
cancel_work_sync(&beep->beep_work);
input_unregister_device(beep->dev);
kfree(beep);
codec->beep = NULL;
}
}
EXPORT_SYMBOL_HDA(snd_hda_detach_beep_device);
|
/*********************************************************************/
/* 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"
int CNAME(BLASLONG m, FLOAT alpha_r, FLOAT alpha_i, FLOAT *x, BLASLONG incx,
FLOAT *y, BLASLONG incy, FLOAT *a, BLASLONG lda, FLOAT *buffer){
BLASLONG i;
FLOAT *X, *Y;
X = x;
Y = y;
lda *= 2;
if (incx != 1) {
COPY_K(m, x, incx, buffer, 1);
X = buffer;
}
if (incy != 1) {
COPY_K(m, y, incy, (FLOAT *)((BLASLONG)buffer + (BUFFER_SIZE / 2)), 1);
Y = (FLOAT *)((BLASLONG)buffer + (BUFFER_SIZE / 2));
}
for (i = 0; i < m; i++){
#ifndef LOWER
AXPYU_K(i + 1, 0, 0,
alpha_r * X[i * 2 + 0] - alpha_i * X[i * 2 + 1],
alpha_i * X[i * 2 + 0] + alpha_r * X[i * 2 + 1],
Y, 1, a, 1, NULL, 0);
AXPYU_K(i + 1, 0, 0,
alpha_r * Y[i * 2 + 0] - alpha_i * Y[i * 2 + 1],
alpha_i * Y[i * 2 + 0] + alpha_r * Y[i * 2 + 1],
X, 1, a, 1, NULL, 0);
a += lda;
#else
AXPYU_K(m - i, 0, 0,
alpha_r * X[i * 2 + 0] - alpha_i * X[i * 2 + 1],
alpha_i * X[i * 2 + 0] + alpha_r * X[i * 2 + 1],
Y + i * 2, 1, a, 1, NULL, 0);
AXPYU_K(m - i, 0, 0,
alpha_r * Y[i * 2 + 0] - alpha_i * Y[i * 2 + 1],
alpha_i * Y[i * 2 + 0] + alpha_r * Y[i * 2 + 1],
X + i * 2, 1, a, 1, NULL, 0);
a += 2 + lda;
#endif
}
return 0;
}
|
/*
* Copyright 2012 Michael Ellerman, IBM Corporation.
* Copyright 2012 Benjamin Herrenschmidt, IBM Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*/
#ifndef _KVM_PPC_BOOK3S_XICS_H
#define _KVM_PPC_BOOK3S_XICS_H
/*
* We use a two-level tree to store interrupt source information.
* There are up to 1024 ICS nodes, each of which can represent
* 1024 sources.
*/
#define KVMPPC_XICS_MAX_ICS_ID 1023
#define KVMPPC_XICS_ICS_SHIFT 10
#define KVMPPC_XICS_IRQ_PER_ICS (1 << KVMPPC_XICS_ICS_SHIFT)
#define KVMPPC_XICS_SRC_MASK (KVMPPC_XICS_IRQ_PER_ICS - 1)
/*
* Interrupt source numbers below this are reserved, for example
* 0 is "no interrupt", and 2 is used for IPIs.
*/
#define KVMPPC_XICS_FIRST_IRQ 16
#define KVMPPC_XICS_NR_IRQS ((KVMPPC_XICS_MAX_ICS_ID + 1) * \
KVMPPC_XICS_IRQ_PER_ICS)
/* Priority value to use for disabling an interrupt */
#define MASKED 0xff
#define PQ_PRESENTED 1
#define PQ_QUEUED 2
/* State for one irq source */
struct ics_irq_state {
u32 number;
u32 server;
u32 pq_state;
u8 priority;
u8 saved_priority;
u8 resend;
u8 masked_pending;
u8 lsi; /* level-sensitive interrupt */
u8 exists;
int intr_cpu;
u32 host_irq;
};
/* Atomic ICP state, updated with a single compare & swap */
union kvmppc_icp_state {
unsigned long raw;
struct {
u8 out_ee:1;
u8 need_resend:1;
u8 cppr;
u8 mfrr;
u8 pending_pri;
u32 xisr;
};
};
/* One bit per ICS */
#define ICP_RESEND_MAP_SIZE (KVMPPC_XICS_MAX_ICS_ID / BITS_PER_LONG + 1)
struct kvmppc_icp {
struct kvm_vcpu *vcpu;
unsigned long server_num;
union kvmppc_icp_state state;
unsigned long resend_map[ICP_RESEND_MAP_SIZE];
/* Real mode might find something too hard, here's the action
* it might request from virtual mode
*/
#define XICS_RM_KICK_VCPU 0x1
#define XICS_RM_CHECK_RESEND 0x2
#define XICS_RM_NOTIFY_EOI 0x8
u32 rm_action;
struct kvm_vcpu *rm_kick_target;
struct kvmppc_icp *rm_resend_icp;
u32 rm_reject;
u32 rm_eoied_irq;
/* Counters for each reason we exited real mode */
unsigned long n_rm_kick_vcpu;
unsigned long n_rm_check_resend;
unsigned long n_rm_notify_eoi;
/* Counters for handling ICP processing in real mode */
unsigned long n_check_resend;
unsigned long n_reject;
/* Debug stuff for real mode */
union kvmppc_icp_state rm_dbgstate;
struct kvm_vcpu *rm_dbgtgt;
};
struct kvmppc_ics {
arch_spinlock_t lock;
u16 icsid;
struct ics_irq_state irq_state[KVMPPC_XICS_IRQ_PER_ICS];
};
struct kvmppc_xics {
struct kvm *kvm;
struct kvm_device *dev;
struct dentry *dentry;
u32 max_icsid;
bool real_mode;
bool real_mode_dbg;
u32 err_noics;
u32 err_noicp;
struct kvmppc_ics *ics[KVMPPC_XICS_MAX_ICS_ID + 1];
};
static inline struct kvmppc_icp *kvmppc_xics_find_server(struct kvm *kvm,
u32 nr)
{
struct kvm_vcpu *vcpu = NULL;
int i;
kvm_for_each_vcpu(i, vcpu, kvm) {
if (vcpu->arch.icp && nr == vcpu->arch.icp->server_num)
return vcpu->arch.icp;
}
return NULL;
}
static inline struct kvmppc_ics *kvmppc_xics_find_ics(struct kvmppc_xics *xics,
u32 irq, u16 *source)
{
u32 icsid = irq >> KVMPPC_XICS_ICS_SHIFT;
u16 src = irq & KVMPPC_XICS_SRC_MASK;
struct kvmppc_ics *ics;
if (source)
*source = src;
if (icsid > KVMPPC_XICS_MAX_ICS_ID)
return NULL;
ics = xics->ics[icsid];
if (!ics)
return NULL;
return ics;
}
#endif /* _KVM_PPC_BOOK3S_XICS_H */
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#pragma mark -
//
// File: /Applications/Xcode-7GM.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/IDS.framework/IDS
// UUID: C769DE1B-BD2D-3074-8ADC-58BB2CC42E38
//
// Arch: x86_64
// Current version: 800.0.0
// Compatibility version: 1.0.0
// Source version: 849.24.0.0.0
// Minimum iOS version: 9.0.0
// SDK version: 9.0.0
//
//
// This file does not contain any Objective-C runtime information.
//
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#pragma mark -
//
// File: /Applications/Xcode-7GM.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/PrivateFrameworks/CellularPlanManager.framework/CellularPlanManager
// UUID: AD2EAFB6-4632-3B56-91D7-93CD0E3AF57A
//
// Arch: i386
// Current version: 0.0.0
// Compatibility version: 1.0.0
// Source version: 3376.0.0.0.0
//
//
// This file does not contain any Objective-C runtime information.
//
|
//=============================================================================
// MusE Score
// Linux Music Score Editor
//
// Copyright (C) 2002-2009 Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================
#ifndef EDITSTRINGDATA_H
#define EDITSTRINGDATA_H
#include "ui_editstringdata.h"
#include "libmscore/stringdata.h"
namespace Ms {
//---------------------------------------------------------
// EditStringData
//---------------------------------------------------------
class EditStringData : public QDialog, private Ui::EditStringDataBase {
Q_OBJECT
int* _frets;
bool _modified;
QList<instrString>* _strings; // pointer to original string list
QList<instrString> _stringsLoc; // local working copy of string list
public:
EditStringData(QWidget *parent, QList<instrString> * strings, int * frets);
~EditStringData();
protected:
QString midiCodeToStr(int midiCode);
private slots:
void accept();
void deleteStringClicked();
void editStringClicked();
void listItemClicked(QTableWidgetItem * item);
void newStringClicked();
};
}
#endif // EDITSTRINGDATA_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.
*
*/
/*
* Based on
* WebVenture (c) 2010, Sean Kasun
* https://github.com/mrkite/webventure, http://seancode.com/webventure/
*
* Used with explicit permission from the author
*/
#ifndef MACVENTURE_CONTAINER_H
#define MACVENTURE_CONTAINER_H
#include "macventure/macventure.h"
#include "common/file.h"
#include "common/fs.h"
namespace MacVenture {
struct ItemGroup {
uint32 bitOffset; //It's really uint24
uint32 offset; //It's really uint24
uint32 lengths[64];
};
typedef uint32 ContainerHeader;
class Container {
public:
Container(Common::String filename);
~Container();
public:
/**
* Must be called before retrieving an object.
*/
uint32 getItemByteSize(uint32 id);
/**
* getItemByteSize should be called before this one
*/
Common::SeekableReadStream *getItem(uint32 id);
protected:
bool _simplified;
uint _lenObjs; // In the case of simple container, lenght of an object
uint _numObjs;
ContainerHeader _header;
Common::Array<uint16> _huff; // huffman masks
Common::Array<uint8> _lens; // huffman lengths
Common::Array<ItemGroup> _groups;
Common::String _filename;
Common::File _file;
Common::SeekableReadStream *_res;
};
} // End of namespace MacVenture
#endif
|
/*
ataraid.h Copyright (C) 2001 Red Hat, Inc. 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; either version 2, or (at your option)
any later version.
You should have received a copy of the GNU General Public License
(for example /usr/src/linux/COPYING); if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Authors: Arjan van de Ven <arjanv@redhat.com>
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <asm/semaphore.h>
#include <linux/blkdev.h>
#include <linux/blkpg.h>
#include <linux/genhd.h>
#include <linux/ioctl.h>
#include <linux/ide.h>
#include <asm/uaccess.h>
#define ATAMAJOR 114
#define SHIFT 4
#define MINOR_MASK 15
#define MAJOR_MASK 15
/* raid_device_operations is a light struct block_device_operations with an
added method for make_request */
struct raid_device_operations {
int (*open) (struct inode *, struct file *);
int (*release) (struct inode *, struct file *);
int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long);
int (*make_request) (request_queue_t *q, int rw, struct buffer_head * bh);
};
struct geom {
unsigned char heads;
unsigned int cylinders;
unsigned char sectors;
};
/* structure for the splitting of bufferheads */
struct ataraid_bh_private {
struct buffer_head *parent;
atomic_t count;
};
extern struct gendisk ataraid_gendisk;
extern int ataraid_get_device(struct raid_device_operations *fops);
extern void ataraid_release_device(int device);
extern int get_blocksize(kdev_t dev);
extern void ataraid_register_disk(int device,long size);
extern struct buffer_head *ataraid_get_bhead(void);
extern struct ataraid_bh_private *ataraid_get_private(void);
extern void ataraid_end_request(struct buffer_head *bh, int uptodate);
|
/*
* Platform data definition for the Realtek RTL8366S ethernet switch driver
*
* Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#ifndef _RTL8366RB_H
#define _RTL8366RB_H
#define RTL8366RB_DRIVER_NAME "rtl8366rb"
struct rtl8366rb_platform_data {
unsigned gpio_sda;
unsigned gpio_sck;
};
#endif /* _RTL8366RB_SMI_H */
|
/*
* Copyright (C) 2014 Freie Universität Berlin
*
* 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.
*/
#ifndef IAP_H
#define IAP_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* IAP-Commands */
#define PREPARE_SECTOR_FOR_WRITE_OPERATION (50)
#define COPY_RAM_TO_FLASH (51)
#define ERASE_SECTOR (52)
#define BLANK_CHECK_SECTOR (53)
#define READ_PART_ID (54)
#define READ_BOOT_CODE_VERSION (55)
#define COMPARE (56)
/* IAP status codes */
#define CMD_SUCCESS (0)
#define INVALID_COMMAND (1)
#define SRC_ADDR_ERROR (2)
#define DST_ADDR_ERROR (3)
#define SRC_ADDR_NOT_MAPPED (4)
#define DST_ADDR_NOT_MAPPED (5)
#define COUNT_ERROR (6)
#define INVALID_SECTOR (7)
#define SECTOR_NOT_BLANK (8)
#define SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION (9)
#define COMPARE_ERROR (10)
#define BUSY (11)
#define INVALID_ADDRESS (0xFF)
/* IAP start location on flash */
#define IAP_LOCATION (0x7FFFFFF1)
/* PLL */
#define PLLCON_PLLE (0x01) /**< PLL Enable */
#define PLLCON_PLLD (0x00) /**< PLL Disable */
#define PLLCON_PLLC (0x03) /**< PLL Connect */
#define PLLSTAT_PLOCK (0x0400) /**< PLL Lock Status */
/*
* @brief: Converts 'addr' to sector number
* @note: Sector table (Users Manual P. 610)
*
* @param addr Flash address
*
* @return Sector number. 0xFF on error
*/
uint8_t iap_get_sector(uint32_t addr);
#ifdef __cplusplus
}
#endif
#endif /* IAP_H */
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2015 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#import "TiLayoutView.h"
@interface TiScrollableView : TiLayoutView<UIScrollViewDelegate>
@end
|
// Copyright (c) 2011 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_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
#include "chrome/browser/bookmarks/bookmark_node_data.h"
#if defined(__OBJC__)
@class NSString;
#endif // __OBJC__
namespace base {
class FilePath;
}
// This set of functions lets C++ code interact with the cocoa pasteboard and
// dragging methods.
// Writes a set of bookmark elements from a profile to the specified pasteboard.
void WriteBookmarksToPasteboard(
ui::ClipboardType type,
const std::vector<BookmarkNodeData::Element>& elements,
const base::FilePath& profile_path);
// Reads a set of bookmark elements from the specified pasteboard.
bool ReadBookmarksFromPasteboard(
ui::ClipboardType type,
std::vector<BookmarkNodeData::Element>& elements,
base::FilePath* profile_path);
// Returns true if the specified pasteboard contains any sort of bookmark
// elements. It currently does not consider a plaintext url a valid bookmark.
bool PasteboardContainsBookmarks(ui::ClipboardType type);
#if defined(__OBJC__)
// Pasteboard type for dictionary containing bookmark structure consisting
// of individual bookmark nodes and/or bookmark folders.
extern "C" NSString* const kBookmarkDictionaryListPboardType;
#endif // __OBJC__
#endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
|
/*
* Copyright (c) 2007-2012 SlimDX Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#pragma once
#include "CommonMocks.h"
struct IDXGIDeviceMock : IDXGIDevice {
MOCK_IUNKNOWN;
MOCK_IDXGIOBJECT;
MOCK_METHOD1_WITH_CALLTYPE( STDMETHODCALLTYPE, GetAdapter, HRESULT( IDXGIAdapter** ) );
MOCK_METHOD5_WITH_CALLTYPE( STDMETHODCALLTYPE, CreateSurface, HRESULT( const DXGI_SURFACE_DESC *, UINT, DXGI_USAGE, const DXGI_SHARED_RESOURCE*, IDXGISurface** ) );
MOCK_METHOD3_WITH_CALLTYPE( STDMETHODCALLTYPE, QueryResourceResidency, HRESULT( IUnknown* const*, DXGI_RESIDENCY*, UINT ) );
MOCK_METHOD1_WITH_CALLTYPE( STDMETHODCALLTYPE, SetGPUThreadPriority, HRESULT( INT ) );
MOCK_METHOD1_WITH_CALLTYPE( STDMETHODCALLTYPE, GetGPUThreadPriority, HRESULT( INT* ) );
}; |
/* @(#)s_lrint.c 5.1 93/09/24 */
/*
* ====================================================
* 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.
* ====================================================
*/
/*
FUNCTION
<<lrint>>, <<lrintf>>, <<llrint>>, <<llrintf>>---round to integer
INDEX
lrint
INDEX
lrintf
INDEX
llrint
INDEX
llrintf
ANSI_SYNOPSIS
#include <math.h>
long int lrint(double <[x]>);
long int lrintf(float <[x]>);
long long int llrint(double <[x]>);
long long int llrintf(float <[x]>);
DESCRIPTION
The <<lrint>> and <<llrint>> functions round their argument to the nearest
integer value, using the current rounding direction. If the rounded value is
outside the range of the return type, the numeric result is unspecified. A
range error may occur if the magnitude of <[x]> is too large.
The "inexact" floating-point exception is raised in implementations that
support it when the result differs in value from the argument (i.e., when
a fraction actually has been truncated).
RETURNS
<[x]> rounded to an integral value, using the current rounding direction.
SEEALSO
<<lround>>
PORTABILITY
ANSI C, POSIX
*/
/*
* lrint(x)
* Return x rounded to integral value according to the prevailing
* rounding mode.
* Method:
* Using floating addition.
* Exception:
* Inexact flag raised if x not equal to lrint(x).
*/
#include "fdlibm.h"
#ifndef _DOUBLE_IS_32BITS
#ifdef __STDC__
static const double
#else
static double
#endif
/* Adding a double, x, to 2^52 will cause the result to be rounded based on
the fractional part of x, according to the implementation's current rounding
mode. 2^52 is the smallest double that can be represented using all 52 significant
digits. */
TWO52[2]={
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
-4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
};
#ifdef __STDC__
long int lrint(double x)
#else
long int lrint(x)
double x;
#endif
{
__int32_t i0,j0,sx;
__uint32_t i1;
double t;
volatile double w;
long int result;
EXTRACT_WORDS(i0,i1,x);
/* Extract sign bit. */
sx = (i0>>31)&1;
/* Extract exponent field. */
j0 = ((i0 & 0x7ff00000) >> 20) - 1023;
/* j0 in [-1023,1024] */
if(j0 < 20)
{
/* j0 in [-1023,19] */
if(j0 < -1)
return 0;
else
{
/* j0 in [0,19] */
/* shift amt in [0,19] */
w = TWO52[sx] + x;
t = w - TWO52[sx];
GET_HIGH_WORD(i0, t);
/* Detect the all-zeros representation of plus and
minus zero, which fails the calculation below. */
if ((i0 & ~(1L << 31)) == 0)
return 0;
/* After round: j0 in [0,20] */
j0 = ((i0 & 0x7ff00000) >> 20) - 1023;
i0 &= 0x000fffff;
i0 |= 0x00100000;
/* shift amt in [20,0] */
result = i0 >> (20 - j0);
}
}
else if (j0 < (int)(8 * sizeof (long int)) - 1)
{
/* 32bit return: j0 in [20,30] */
/* 64bit return: j0 in [20,62] */
if (j0 >= 52)
/* 64bit return: j0 in [52,62] */
/* 64bit return: left shift amt in [32,42] */
result = ((long int) ((i0 & 0x000fffff) | 0x0010000) << (j0 - 20)) |
/* 64bit return: right shift amt in [0,10] */
(i1 << (j0 - 52));
else
{
/* 32bit return: j0 in [20,30] */
/* 64bit return: j0 in [20,51] */
w = TWO52[sx] + x;
t = w - TWO52[sx];
EXTRACT_WORDS (i0, i1, t);
j0 = ((i0 & 0x7ff00000) >> 20) - 1023;
i0 &= 0x000fffff;
i0 |= 0x00100000;
/* After round:
* 32bit return: j0 in [20,31];
* 64bit return: j0 in [20,52] */
/* 32bit return: left shift amt in [0,11] */
/* 64bit return: left shift amt in [0,32] */
/* ***32bit return: right shift amt in [32,21] */
/* ***64bit return: right shift amt in [32,0] */
result = ((long int) i0 << (j0 - 20))
| SAFE_RIGHT_SHIFT (i1, (52 - j0));
}
}
else
{
return (long int) x;
}
return sx ? -result : result;
}
#endif /* _DOUBLE_IS_32BITS */
|
/* { dg-do run } */
/* { dg-options "-O1 -fdump-tree-original" } */
char *buffer1;
char *buffer2;
#define SIZE 1000
int
main (void)
{
const char* const foo1 = "hello world";
buffer1 = __builtin_malloc (SIZE);
__builtin_strcpy (buffer1, foo1);
buffer2 = __builtin_malloc (SIZE);
__builtin_strcpy (buffer2, foo1);
/* MEMCHR. */
if (__builtin_memchr ("hello world", 'x', 11))
__builtin_abort ();
if (__builtin_memchr ("hello world", 'x', 0) != 0)
__builtin_abort ();
if (__builtin_memchr ("hello world", 'w', 2))
__builtin_abort ();
if (__builtin_memchr ("hello world", 'd', 10))
__builtin_abort ();
if (__builtin_memchr ("hello world", '\0', 11))
__builtin_abort ();
/* STRCMP. */
if (__builtin_strcmp ("hello", "aaaaa") <= 0)
__builtin_abort ();
if (__builtin_strcmp ("aaaaa", "aaaaa") != 0)
__builtin_abort ();
if (__builtin_strcmp ("aaaaa", "") <= 0)
__builtin_abort ();
if (__builtin_strcmp ("", "aaaaa") >= 0)
__builtin_abort ();
if (__builtin_strcmp ("ab", "ba") >= 0)
__builtin_abort ();
/* STRNCMP. */
if (__builtin_strncmp ("hello", "aaaaa", 0) != 0)
__builtin_abort ();
if (__builtin_strncmp ("aaaaa", "aaaaa", 100) != 0)
__builtin_abort ();
if (__builtin_strncmp ("aaaaa", "", 100) <= 0)
__builtin_abort ();
if (__builtin_strncmp ("", "aaaaa", 100) >= 0)
__builtin_abort ();
if (__builtin_strncmp ("ab", "ba", 1) >= 0)
__builtin_abort ();
if (__builtin_strncmp ("aab", "aac", 2) != 0)
__builtin_abort ();
/* STRCASECMP. */
if (__builtin_strcasecmp ("aaaaa", "aaaaa") != 0)
__builtin_abort ();
/* STRNCASECMP. */
if (__builtin_strncasecmp ("hello", "aaaaa", 0) != 0)
__builtin_abort ();
if (__builtin_strncasecmp ("aaaaa", "aaaaa", 100) != 0)
__builtin_abort ();
if (__builtin_strncasecmp ("aab", "aac", 2) != 0)
__builtin_abort ();
/* MEMCMP. */
if (__builtin_memcmp ("aaaaa", "aaaaa", 6) != 0)
__builtin_abort ();
return 0;
}
/* { dg-final { scan-tree-dump-not "__builtin_strcmp" "original" } } */
/* { dg-final { scan-tree-dump-not "__builtin_strcasecmp" "original" } } */
/* { dg-final { scan-tree-dump-not "__builtin_strncmp" "original" } } */
/* { dg-final { scan-tree-dump-not "__builtin_strncasecmp" "original" } } */
/* { dg-final { scan-tree-dump-not "__builtin_memchr" "original" } } */
/* { dg-final { scan-tree-dump-not "__builtin_memcmp" "original" } } */
|
/*
* v4l2-i2c-drv.h - contains I2C handling code that's identical for
* all V4L2 I2C drivers. Use this header if the
* I2C driver is only used by drivers converted
* to the bus-based I2C API.
*
* Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* NOTE: the full version of this header is in the v4l-dvb repository
* and allows v4l i2c drivers to be compiled on older kernels as well.
* The version of this header as it appears in the kernel is a stripped
* version (without all the backwards compatibility stuff) and so it
* looks a bit odd.
*
* If you look at the full version then you will understand the reason
* for introducing this header since you really don't want to have all
* the tricky backwards compatibility code in each and every i2c driver.
*/
#ifndef __V4L2_I2C_DRV_H__
#define __V4L2_I2C_DRV_H__
#include <media/v4l2-common.h>
struct v4l2_i2c_driver_data {
const char * const name;
int (*command)(struct i2c_client *client, unsigned int cmd, void *arg);
int (*probe)(struct i2c_client *client, const struct i2c_device_id *id);
int (*remove)(struct i2c_client *client);
int (*suspend)(struct i2c_client *client, pm_message_t state);
int (*resume)(struct i2c_client *client);
const struct i2c_device_id *id_table;
};
static struct v4l2_i2c_driver_data v4l2_i2c_data;
static struct i2c_driver v4l2_i2c_driver;
/* Bus-based I2C implementation for kernels >= 2.6.26 */
static int __init v4l2_i2c_drv_init(void)
{
v4l2_i2c_driver.driver.name = v4l2_i2c_data.name;
v4l2_i2c_driver.command = v4l2_i2c_data.command;
v4l2_i2c_driver.probe = v4l2_i2c_data.probe;
v4l2_i2c_driver.remove = v4l2_i2c_data.remove;
v4l2_i2c_driver.suspend = v4l2_i2c_data.suspend;
v4l2_i2c_driver.resume = v4l2_i2c_data.resume;
v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table;
return i2c_add_driver(&v4l2_i2c_driver);
}
static void __exit v4l2_i2c_drv_cleanup(void)
{
i2c_del_driver(&v4l2_i2c_driver);
}
module_init(v4l2_i2c_drv_init);
module_exit(v4l2_i2c_drv_cleanup);
#endif /* __V4L2_I2C_DRV_H__ */
|
/* Copyright 2015 Samsung Electronics Co., LTD
*
* 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.
*/
/***************************************************************************
* For convenience in Java.
***************************************************************************/
#ifndef HYBRID_OBJECT_H_
#define HYBRID_OBJECT_H_
namespace gvr {
class HybridObject {
public:
HybridObject() {
}
virtual ~HybridObject() {
}
};
}
#endif
|
/****************************************************************************
*
* Copyright 2016 Samsung Electronics All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
****************************************************************************/
/****************************************************************************
* libc/math/lib_copysignl.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
* Dave Marples <dave@marples.net>
*
* 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 NuttX 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.
*
****************************************************************************/
/************************************************************************
* Included Files
************************************************************************/
#include <tinyara/compiler.h>
#include <math.h>
/************************************************************************
* Public Functions
************************************************************************/
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double copysignl(long double x, long double y)
{
if (y < 0) {
return -fabsl(x);
}
return fabsl(x);
}
#endif
|
/*
* Copyright (C) 2006 The Android Open Source Project
*
* 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 SkPerspIter_DEFINED
#define SkPerspIter_DEFINED
#include "SkMatrix.h"
class SkPerspIter {
public:
/** Iterate a line through the matrix [x,y] ... [x+count-1, y].
@param m The matrix we will be iterating a line through
@param x The initial X coordinate to be mapped through the matrix
@param y The initial Y coordinate to be mapped through the matrix
@param count The number of points (x,y) (x+1,y) (x+2,y) ... we will eventually map
*/
SkPerspIter(const SkMatrix& m, SkScalar x, SkScalar y, int count);
/** Return the buffer of [x,y] fixed point values we will be filling.
This always returns the same value, so it can be saved across calls to
next().
*/
const SkFixed* getXY() const { return fStorage; }
/** Return the number of [x,y] pairs that have been filled in the getXY() buffer.
When this returns 0, the iterator is finished.
*/
int next();
private:
enum {
kShift = 4,
kCount = (1 << kShift)
};
const SkMatrix& fMatrix;
SkFixed fStorage[kCount * 2];
SkFixed fX, fY;
SkScalar fSX, fSY;
int fCount;
};
#endif
|
/* PR middle-end/37009 */
/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
/* { dg-options "-m32 -mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
extern void bar (double *);
double
foo(double x)
{
double xxx = x + 13.0;
bar (&xxx);
return xxx;
}
/* { dg-final { scan-assembler "andl\[\\t \]*\\$-8,\[\\t \]*%esp" } } */
|
/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
/* see jconfig.txt for explanations */
#ifndef __JCONFIG_WIN_H__
#define __JCONFIG_WIN_H__
#define HAVE_PROTOTYPES
#define HAVE_UNSIGNED_CHAR
#define HAVE_UNSIGNED_SHORT
/* #define void char */
/* #define const */
#undef CHAR_IS_UNSIGNED
#define HAVE_STDDEF_H
#define HAVE_STDLIB_H
#undef NEED_BSD_STRINGS
#undef NEED_SYS_TYPES_H
#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
#undef NEED_SHORT_EXTERNAL_NAMES
#undef INCOMPLETE_TYPES_BROKEN
/* Define "boolean" as unsigned char, not int, per Windows custom */
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
typedef unsigned char boolean;
#endif
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
#ifdef JPEG_INTERNALS
#undef RIGHT_SHIFT_IS_UNSIGNED
#endif /* JPEG_INTERNALS */
#ifdef JPEG_CJPEG_DJPEG
#define BMP_SUPPORTED /* BMP image file format */
#define GIF_SUPPORTED /* GIF image file format */
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
#undef RLE_SUPPORTED /* Utah RLE image file format */
#define TARGA_SUPPORTED /* Targa image file format */
#define TWO_FILE_COMMANDLINE /* optional */
#define USE_SETMODE /* Microsoft has setmode() */
#undef NEED_SIGNAL_CATCHER
#undef DONT_USE_B_MODE
#undef PROGRESS_REPORT /* optional */
#endif /* JPEG_CJPEG_DJPEG */
#endif // __JCONFIG_WIN_H__
|
/* -*- c++ -*- */
/*
* Copyright 2015 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_LDPC_DECODER_H
#define INCLUDED_LDPC_DECODER_H
typedef float INPUT_DATATYPE;
typedef unsigned char OUTPUT_DATATYPE;
#include <map>
#include <string>
#include <gnuradio/fec/decoder.h>
#include <vector>
#include <gnuradio/fec/cldpc.h>
#include <gnuradio/fec/alist.h>
#include <gnuradio/fec/awgn_bp.h>
namespace gr {
namespace fec {
#define MAXLOG 1e7
class FEC_API ldpc_decoder : public generic_decoder
{
private:
//private constructor
ldpc_decoder(std::string alist_file, float sigma, int max_iterations);
//plug into the generic fec api
int get_history();
float get_shift();
const char* get_conversion();
void generic_work(void *inBuffer, void *outbuffer);
float d_iterations;
int d_input_size, d_output_size;
double d_rate;
alist d_list;
cldpc d_code;
awgn_bp d_spa;
public:
~ldpc_decoder ();
double rate();
bool set_frame_size(unsigned int frame_size);
static generic_decoder::sptr make(std::string alist_file,
float sigma=0.5,
int max_iterations=50);
int get_output_size();
int get_input_size();
int get_input_item_size();
int get_output_item_size();
float get_iterations(){ return d_iterations; }
};
} // namespace fec
} // namespace gr
#endif /* INCLUDED_LDPC_DECODER_H */
|
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef BAZEL_SRC_MAIN_CPP_UTIL_NUMBERS_H_
#define BAZEL_SRC_MAIN_CPP_UTIL_NUMBERS_H_
#include <string>
namespace blaze_util {
bool safe_strto32(const std::string &text, int *value);
int32_t strto32(const char *str, char **endptr, int base);
} // namespace blaze_util
#endif // BAZEL_SRC_MAIN_CPP_UTIL_NUMBERS_H_
|
/*
Copyright (c) 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, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ABSTRACT_CONNECTION_PROVIDER_INCLUDED
#define ABSTRACT_CONNECTION_PROVIDER_INCLUDED
#include "i_connection_provider.h"
#include "base/i_connection_factory.h"
#include "i_callable.h"
namespace Mysql{
namespace Tools{
namespace Dump{
class Abstract_connection_provider : public I_connection_provider
{
protected:
Abstract_connection_provider(
Mysql::Tools::Base::I_connection_factory* connection_factory);
virtual Mysql::Tools::Base::Mysql_query_runner* create_new_runner(
Mysql::I_callable<bool, const Mysql::Tools::Base::Message_data&>*
message_handler);
private:
Mysql::Tools::Base::I_connection_factory* m_connection_factory;
class Message_handler_wrapper
{
public:
Message_handler_wrapper(
Mysql::I_callable<bool, const Mysql::Tools::Base::Message_data&>*
message_handler);
int64 pass_message(const Mysql::Tools::Base::Message_data& message);
private:
Mysql::I_callable<bool, const Mysql::Tools::Base::Message_data&>*
m_message_handler;
};
};
}
}
}
#endif
|
/*
* Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
* 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 Sandia 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.
*
*/
#include "exodusII.h"
/*!
\deprecated Use ex_get_ids()(exoid, EX_ELEM_BLOCK, ids) instead
The function ex_get_elem_blk_ids() reads the IDs of all of the element
blocks. Memory must be allocated for the returned array of
({num_elem_blk}) IDs before this function is invoked. The required
size(\c num_elem_blk) can be determined via a call to ex_inquire() or
ex_inquire_int().
\return In case of an error, ex_get_elem_blk_ids() returns a negative
number; a warning will return a positive number. Possible causes of
errors include:
- data file not properly opened with call to ex_create() or ex_open()
\param[in] exoid exodus file ID returned from a previous call to ex_create() or ex_open().
\param[out] ids Returned array of the element blocks IDs. The order of the IDs in this
array reflects the sequence that the element blocks were introduced
into the file.
The following code segment reads all the element block IDs:
\code
int error, exoid, *idelbs, num_elem_blk;
idelbs = (int *) calloc(num_elem_blk, sizeof(int));
error = ex_get_elem_blk_ids (exoid, idelbs);
\comment{Same result using non-deprecated functions}
error = ex_get_ids (exoid, EX_ELEM_BLOCK, idelbs);
\endcode
*/
int ex_get_elem_blk_ids (int exoid,
void_int *ids)
{
/* ex_get_elem_blk_ids should be deprecated. */
return ex_get_ids( exoid, EX_ELEM_BLOCK, ids );
}
|
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <grpc/support/port_platform.h>
#ifdef GRPC_STAP_PROFILER
#include "src/core/profiling/timers.h"
#include <sys/sdt.h>
/* Generated from src/core/profiling/stap_probes.d */
#include "src/core/profiling/stap_probes.h"
/* Latency profiler API implementation. */
void gpr_timer_add_mark(int tag, const char *tagstr, void *id, const char *file,
int line) {
_STAP_ADD_MARK(tag);
}
void gpr_timer_add_important_mark(int tag, const char *tagstr, void *id,
const char *file, int line) {
_STAP_ADD_IMPORTANT_MARK(tag);
}
void gpr_timer_begin(int tag, const char *tagstr, void *id, const char *file,
int line) {
_STAP_TIMING_NS_BEGIN(tag);
}
void gpr_timer_end(int tag, const char *tagstr, void *id, const char *file,
int line) {
_STAP_TIMING_NS_END(tag);
}
#endif /* GRPC_STAP_PROFILER */
|
// 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 CHROMECAST_BASE_CAST_CONSTANTS_H_
#define CHROMECAST_BASE_CAST_CONSTANTS_H_
namespace chromecast {
extern const char kChromeResourceScheme[];
} // namespace chromecast
#endif // CHROMECAST_BASE_CAST_CONSTANTS_H_
|
/*
* CAAM/SEC 4.x driver backend
* Private/internal definitions between modules
*
* Copyright 2008-2011 Freescale Semiconductor, Inc.
*
*/
#ifndef INTERN_H
#define INTERN_H
#define JOBR_UNASSIGNED 0
#define JOBR_ASSIGNED 1
/* Currently comes from Kconfig param as a ^2 (driver-required) */
#define JOBR_DEPTH (1 << CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE)
/* Kconfig params for interrupt coalescing if selected (else zero) */
#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_INTC
#define JOBR_INTC JRCFG_ICEN
#define JOBR_INTC_TIME_THLD CONFIG_CRYPTO_DEV_FSL_CAAM_INTC_TIME_THLD
#define JOBR_INTC_COUNT_THLD CONFIG_CRYPTO_DEV_FSL_CAAM_INTC_COUNT_THLD
#else
#define JOBR_INTC 0
#define JOBR_INTC_TIME_THLD 0
#define JOBR_INTC_COUNT_THLD 0
#endif
/*
* Storage for tracking each in-process entry moving across a ring
* Each entry on an output ring needs one of these
*/
struct caam_jrentry_info {
void (*callbk)(struct device *dev, u32 *desc, u32 status, void *arg);
void *cbkarg; /* Argument per ring entry */
u32 *desc_addr_virt; /* Stored virt addr for postprocessing */
dma_addr_t desc_addr_dma; /* Stored bus addr for done matching */
u32 desc_size; /* Stored size for postprocessing, header derived */
};
/* Private sub-storage for a single JobR */
struct caam_drv_private_jr {
struct device *parentdev; /* points back to controller dev */
int ridx;
struct caam_job_ring __iomem *rregs; /* JobR's register space */
struct tasklet_struct irqtask;
int irq; /* One per queue */
int assign; /* busy/free */
/* Job ring info */
int ringsize; /* Size of rings (assume input = output) */
struct caam_jrentry_info *entinfo; /* Alloc'ed 1 per ring entry */
spinlock_t inplock ____cacheline_aligned; /* Input ring index lock */
int inp_ring_write_index; /* Input index "tail" */
int head; /* entinfo (s/w ring) head index */
dma_addr_t *inpring; /* Base of input ring, alloc DMA-safe */
spinlock_t outlock ____cacheline_aligned; /* Output ring index lock */
int out_ring_read_index; /* Output index "tail" */
int tail; /* entinfo (s/w ring) tail index */
struct jr_outentry *outring; /* Base of output ring, DMA-safe */
};
/*
* Driver-private storage for a single CAAM block instance
*/
struct caam_drv_private {
struct device *dev;
struct device **jrdev; /* Alloc'ed array per sub-device */
spinlock_t jr_alloc_lock;
struct platform_device *pdev;
/* Physical-presence section */
struct caam_ctrl *ctrl; /* controller region */
struct caam_deco **deco; /* DECO/CCB views */
struct caam_assurance *ac;
struct caam_queue_if *qi; /* QI control region */
/*
* Detected geometry block. Filled in from device tree if powerpc,
* or from register-based version detection code
*/
u8 total_jobrs; /* Total Job Rings in device */
u8 qi_present; /* Nonzero if QI present in device */
int secvio_irq; /* Security violation interrupt number */
/* which jr allocated to scatterlist crypto */
atomic_t tfm_count ____cacheline_aligned;
/* list of registered crypto algorithms (mk generic context handle?) */
struct list_head alg_list;
/* list of registered hash algorithms (mk generic context handle?) */
struct list_head hash_list;
/*
* debugfs entries for developer view into driver/device
* variables at runtime.
*/
#ifdef CONFIG_DEBUG_FS
struct dentry *dfs_root;
struct dentry *ctl; /* controller dir */
struct dentry *ctl_rq_dequeued, *ctl_ob_enc_req, *ctl_ib_dec_req;
struct dentry *ctl_ob_enc_bytes, *ctl_ob_prot_bytes;
struct dentry *ctl_ib_dec_bytes, *ctl_ib_valid_bytes;
struct dentry *ctl_faultaddr, *ctl_faultdetail, *ctl_faultstatus;
struct debugfs_blob_wrapper ctl_kek_wrap, ctl_tkek_wrap, ctl_tdsk_wrap;
struct dentry *ctl_kek, *ctl_tkek, *ctl_tdsk;
#endif
};
void caam_jr_algapi_init(struct device *dev);
void caam_jr_algapi_remove(struct device *dev);
#endif /* INTERN_H */
|
/*
* fs/isofs/export.c
*
* (C) 2004 Paul Serice - The new inode scheme requires switching
* from iget() to iget5_locked() which means
* the NFS export operations have to be hand
* coded because the default routines rely on
* iget().
*
* The following files are helpful:
*
* Documentation/filesystems/Exporting
* fs/exportfs/expfs.c.
*/
#include "isofs.h"
static struct dentry *
isofs_export_iget(struct super_block *sb,
unsigned long block,
unsigned long offset,
__u32 generation)
{
struct inode *inode;
if (block == 0)
return ERR_PTR(-ESTALE);
inode = isofs_iget(sb, block, offset);
if (IS_ERR(inode))
return ERR_CAST(inode);
if (generation && inode->i_generation != generation) {
iput(inode);
return ERR_PTR(-ESTALE);
}
return d_obtain_alias(inode);
}
/* This function is surprisingly simple. The trick is understanding
* that "child" is always a directory. So, to find its parent, you
* simply need to find its ".." entry, normalize its block and offset,
* and return the underlying inode. See the comments for
* isofs_normalize_block_and_offset(). */
static struct dentry *isofs_export_get_parent(struct dentry *child)
{
unsigned long parent_block = 0;
unsigned long parent_offset = 0;
struct inode *child_inode = child->d_inode;
struct iso_inode_info *e_child_inode = ISOFS_I(child_inode);
struct iso_directory_record *de = NULL;
struct buffer_head * bh = NULL;
struct dentry *rv = NULL;
/* "child" must always be a directory. */
if (!S_ISDIR(child_inode->i_mode)) {
printk(KERN_ERR "isofs: isofs_export_get_parent(): "
"child is not a directory!\n");
rv = ERR_PTR(-EACCES);
goto out;
}
/* It is an invariant that the directory offset is zero. If
* it is not zero, it means the directory failed to be
* normalized for some reason. */
if (e_child_inode->i_iget5_offset != 0) {
printk(KERN_ERR "isofs: isofs_export_get_parent(): "
"child directory not normalized!\n");
rv = ERR_PTR(-EACCES);
goto out;
}
/* The child inode has been normalized such that its
* i_iget5_block value points to the "." entry. Fortunately,
* the ".." entry is located in the same block. */
parent_block = e_child_inode->i_iget5_block;
/* Get the block in question. */
bh = sb_bread(child_inode->i_sb, parent_block);
if (bh == NULL) {
rv = ERR_PTR(-EACCES);
goto out;
}
/* This is the "." entry. */
de = (struct iso_directory_record*)bh->b_data;
/* The ".." entry is always the second entry. */
parent_offset = (unsigned long)isonum_711(de->length);
de = (struct iso_directory_record*)(bh->b_data + parent_offset);
/* Verify it is in fact the ".." entry. */
if ((isonum_711(de->name_len) != 1) || (de->name[0] != 1)) {
printk(KERN_ERR "isofs: Unable to find the \"..\" "
"directory for NFS.\n");
rv = ERR_PTR(-EACCES);
goto out;
}
/* Normalize */
isofs_normalize_block_and_offset(de, &parent_block, &parent_offset);
rv = d_obtain_alias(isofs_iget(child_inode->i_sb, parent_block,
parent_offset));
out:
if (bh)
brelse(bh);
return rv;
}
static int
isofs_export_encode_fh(struct dentry *dentry,
__u32 *fh32,
int *max_len,
int connectable)
{
struct inode * inode = dentry->d_inode;
struct iso_inode_info * ei = ISOFS_I(inode);
int len = *max_len;
int type = 1;
__u16 *fh16 = (__u16*)fh32;
/*
* WARNING: max_len is 5 for NFSv2. Because of this
* limitation, we use the lower 16 bits of fh32[1] to hold the
* offset of the inode and the upper 16 bits of fh32[1] to
* hold the offset of the parent.
*/
if (len < 3 || (connectable && len < 5))
return 255;
len = 3;
fh32[0] = ei->i_iget5_block;
fh16[2] = (__u16)ei->i_iget5_offset; /* fh16 [sic] */
fh16[3] = 0; /* avoid leaking uninitialized data */
fh32[2] = inode->i_generation;
if (connectable && !S_ISDIR(inode->i_mode)) {
struct inode *parent;
struct iso_inode_info *eparent;
spin_lock(&dentry->d_lock);
parent = dentry->d_parent->d_inode;
eparent = ISOFS_I(parent);
fh32[3] = eparent->i_iget5_block;
fh16[3] = (__u16)eparent->i_iget5_offset; /* fh16 [sic] */
fh32[4] = parent->i_generation;
spin_unlock(&dentry->d_lock);
len = 5;
type = 2;
}
*max_len = len;
return type;
}
struct isofs_fid {
u32 block;
u16 offset;
u16 parent_offset;
u32 generation;
u32 parent_block;
u32 parent_generation;
};
static struct dentry *isofs_fh_to_dentry(struct super_block *sb,
struct fid *fid, int fh_len, int fh_type)
{
struct isofs_fid *ifid = (struct isofs_fid *)fid;
if (fh_len < 3 || fh_type > 2)
return NULL;
return isofs_export_iget(sb, ifid->block, ifid->offset,
ifid->generation);
}
static struct dentry *isofs_fh_to_parent(struct super_block *sb,
struct fid *fid, int fh_len, int fh_type)
{
struct isofs_fid *ifid = (struct isofs_fid *)fid;
if (fh_type != 2)
return NULL;
return isofs_export_iget(sb,
fh_len > 2 ? ifid->parent_block : 0,
ifid->parent_offset,
fh_len > 4 ? ifid->parent_generation : 0);
}
const struct export_operations isofs_export_ops = {
.encode_fh = isofs_export_encode_fh,
.fh_to_dentry = isofs_fh_to_dentry,
.fh_to_parent = isofs_fh_to_parent,
.get_parent = isofs_export_get_parent,
};
|
/*
* Copyright (C) 2015 Red Hat, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <linux/debugfs.h>
#include "drmP.h"
#include "virtgpu_drv.h"
static int
virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data)
{
struct drm_info_node *node = (struct drm_info_node *) m->private;
struct virtio_gpu_device *vgdev = node->minor->dev->dev_private;
seq_printf(m, "fence %llu %lld\n",
(u64)atomic64_read(&vgdev->fence_drv.last_seq),
vgdev->fence_drv.sync_seq);
return 0;
}
static struct drm_info_list virtio_gpu_debugfs_list[] = {
{ "irq_fence", virtio_gpu_debugfs_irq_info, 0, NULL },
};
#define VIRTIO_GPU_DEBUGFS_ENTRIES ARRAY_SIZE(virtio_gpu_debugfs_list)
int
virtio_gpu_debugfs_init(struct drm_minor *minor)
{
drm_debugfs_create_files(virtio_gpu_debugfs_list,
VIRTIO_GPU_DEBUGFS_ENTRIES,
minor->debugfs_root, minor);
return 0;
}
|
/*
* Copyright (C) 2014 Sergey Krukowski <softsr@yahoo.de>
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* @file subsystems/gps/gps_sim_hitl.h
* GPS subsystem simulation from rotorcrafts horizontal/vertical reference system
*/
#ifndef GPS_SIM_HITL_H
#define GPS_SIM_HITL_H
#ifndef PRIMARY_GPS
#define PRIMARY_GPS GPS_SIM
#endif
extern void gps_sim_hitl_event(void);
extern void gps_sim_hitl_init(void);
#endif /* GPS_SIM_HITL_H */
|
/*
* linux/fs/ext2/xip.c
*
* Copyright (C) 2005 IBM Corporation
* Author: Carsten Otte (cotte@de.ibm.com)
*/
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/genhd.h>
#include <linux/buffer_head.h>
#include <linux/blkdev.h>
#include "ext2.h"
#include "xip.h"
static inline int
__inode_direct_access(struct inode *inode, sector_t block,
void **kaddr, unsigned long *pfn)
{
struct block_device *bdev = inode->i_sb->s_bdev;
const struct block_device_operations *ops = bdev->bd_disk->fops;
sector_t sector;
sector = block * (PAGE_SIZE / 512);
BUG_ON(!ops->direct_access);
return ops->direct_access(bdev, sector, kaddr, pfn);
}
static inline int
__ext2_get_block(struct inode *inode, pgoff_t pgoff, int create,
sector_t *result)
{
struct buffer_head tmp;
int rc;
memset(&tmp, 0, sizeof(struct buffer_head));
rc = ext2_get_block(inode, pgoff, &tmp, create);
*result = tmp.b_blocknr;
if (!tmp.b_blocknr && !rc) {
BUG_ON(create);
rc = -ENODATA;
}
return rc;
}
int
ext2_clear_xip_target(struct inode *inode, sector_t block)
{
void *kaddr;
unsigned long pfn;
int rc;
rc = __inode_direct_access(inode, block, &kaddr, &pfn);
if (!rc)
clear_page(kaddr);
return rc;
}
void ext2_xip_verify_sb(struct super_block *sb)
{
struct ext2_sb_info *sbi = EXT2_SB(sb);
if ((sbi->s_mount_opt & EXT2_MOUNT_XIP) &&
!sb->s_bdev->bd_disk->fops->direct_access) {
sbi->s_mount_opt &= (~EXT2_MOUNT_XIP);
ext2_msg(sb, KERN_WARNING,
"warning: ignoring xip option - "
"not supported by bdev");
}
}
int ext2_get_xip_mem(struct address_space *mapping, pgoff_t pgoff, int create,
void **kmem, unsigned long *pfn)
{
int rc;
sector_t block;
rc = __ext2_get_block(mapping->host, pgoff, create, &block);
if (rc)
return rc;
rc = __inode_direct_access(mapping->host, block, kmem, pfn);
return rc;
}
|
/* Copyright (C) 2002 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Header file for my_aes.c */
/* Wrapper to give simple interface for MySQL to AES standard encryption */
#include "rijndael.h"
C_MODE_START
#define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */
/*
my_aes_encrypt - Crypt buffer with AES encryption algorithm.
source - Pointer to data for encryption
source_length - size of encryption data
dest - buffer to place encrypted data (must be large enough)
key - Key to be used for encryption
kel_length - Length of the key. Will handle keys of any length
returns - size of encrypted data, or negative in case of error.
*/
int my_aes_encrypt(const char *source, int source_length, char *dest,
const char *key, int key_length);
/*
my_aes_decrypt - DeCrypt buffer with AES encryption algorithm.
source - Pointer to data for decryption
source_length - size of encrypted data
dest - buffer to place decrypted data (must be large enough)
key - Key to be used for decryption
kel_length - Length of the key. Will handle keys of any length
returns - size of original data, or negative in case of error.
*/
int my_aes_decrypt(const char *source, int source_length, char *dest,
const char *key, int key_length);
/*
my_aes_get_size - get size of buffer which will be large enough for encrypted
data
source_length - length of data to be encrypted
returns - size of buffer required to store encrypted data
*/
int my_aes_get_size(int source_length);
C_MODE_END
|
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) STMicroelectronics SA 2017
*
* Authors: Philippe Cornu <philippe.cornu@st.com>
* Yannick Fertre <yannick.fertre@st.com>
* Fabien Dessenne <fabien.dessenne@st.com>
* Mickael Reulier <mickael.reulier@st.com>
*/
#ifndef _LTDC_H_
#define _LTDC_H_
struct ltdc_caps {
u32 hw_version; /* hardware version */
u32 nb_layers; /* number of supported layers */
u32 reg_ofs; /* register offset for applicable regs */
u32 bus_width; /* bus width (32 or 64 bits) */
const u32 *pix_fmt_hw; /* supported pixel formats */
bool non_alpha_only_l1; /* non-native no-alpha formats on layer 1 */
int pad_max_freq_hz; /* max frequency supported by pad */
};
#define LTDC_MAX_LAYER 4
struct fps_info {
unsigned int counter;
ktime_t last_timestamp;
};
struct ltdc_device {
void __iomem *regs;
struct clk *pixel_clk; /* lcd pixel clock */
struct mutex err_lock; /* protecting error_status */
struct ltdc_caps caps;
u32 error_status;
u32 irq_status;
struct fps_info plane_fpsi[LTDC_MAX_LAYER];
};
bool ltdc_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,
bool in_vblank_irq, int *vpos, int *hpos,
ktime_t *stime, ktime_t *etime,
const struct drm_display_mode *mode);
int ltdc_load(struct drm_device *ddev);
void ltdc_unload(struct drm_device *ddev);
#endif
|
#ifndef __DMI_H__
#define __DMI_H__
#include <linux/list.h>
#include <linux/kobject.h>
#include <linux/mod_devicetable.h>
/* enum dmi_field is in mod_devicetable.h */
enum dmi_device_type {
DMI_DEV_TYPE_ANY = 0,
DMI_DEV_TYPE_OTHER,
DMI_DEV_TYPE_UNKNOWN,
DMI_DEV_TYPE_VIDEO,
DMI_DEV_TYPE_SCSI,
DMI_DEV_TYPE_ETHERNET,
DMI_DEV_TYPE_TOKENRING,
DMI_DEV_TYPE_SOUND,
DMI_DEV_TYPE_PATA,
DMI_DEV_TYPE_SATA,
DMI_DEV_TYPE_SAS,
DMI_DEV_TYPE_IPMI = -1,
DMI_DEV_TYPE_OEM_STRING = -2,
DMI_DEV_TYPE_DEV_ONBOARD = -3,
};
enum dmi_entry_type {
DMI_ENTRY_BIOS = 0,
DMI_ENTRY_SYSTEM,
DMI_ENTRY_BASEBOARD,
DMI_ENTRY_CHASSIS,
DMI_ENTRY_PROCESSOR,
DMI_ENTRY_MEM_CONTROLLER,
DMI_ENTRY_MEM_MODULE,
DMI_ENTRY_CACHE,
DMI_ENTRY_PORT_CONNECTOR,
DMI_ENTRY_SYSTEM_SLOT,
DMI_ENTRY_ONBOARD_DEVICE,
DMI_ENTRY_OEMSTRINGS,
DMI_ENTRY_SYSCONF,
DMI_ENTRY_BIOS_LANG,
DMI_ENTRY_GROUP_ASSOC,
DMI_ENTRY_SYSTEM_EVENT_LOG,
DMI_ENTRY_PHYS_MEM_ARRAY,
DMI_ENTRY_MEM_DEVICE,
DMI_ENTRY_32_MEM_ERROR,
DMI_ENTRY_MEM_ARRAY_MAPPED_ADDR,
DMI_ENTRY_MEM_DEV_MAPPED_ADDR,
DMI_ENTRY_BUILTIN_POINTING_DEV,
DMI_ENTRY_PORTABLE_BATTERY,
DMI_ENTRY_SYSTEM_RESET,
DMI_ENTRY_HW_SECURITY,
DMI_ENTRY_SYSTEM_POWER_CONTROLS,
DMI_ENTRY_VOLTAGE_PROBE,
DMI_ENTRY_COOLING_DEV,
DMI_ENTRY_TEMP_PROBE,
DMI_ENTRY_ELECTRICAL_CURRENT_PROBE,
DMI_ENTRY_OOB_REMOTE_ACCESS,
DMI_ENTRY_BIS_ENTRY,
DMI_ENTRY_SYSTEM_BOOT,
DMI_ENTRY_MGMT_DEV,
DMI_ENTRY_MGMT_DEV_COMPONENT,
DMI_ENTRY_MGMT_DEV_THRES,
DMI_ENTRY_MEM_CHANNEL,
DMI_ENTRY_IPMI_DEV,
DMI_ENTRY_SYS_POWER_SUPPLY,
DMI_ENTRY_ADDITIONAL,
DMI_ENTRY_ONBOARD_DEV_EXT,
DMI_ENTRY_MGMT_CONTROLLER_HOST,
DMI_ENTRY_INACTIVE = 126,
DMI_ENTRY_END_OF_TABLE = 127,
};
struct dmi_header {
u8 type;
u8 length;
u16 handle;
} __packed;
struct dmi_device {
struct list_head list;
int type;
const char *name;
void *device_data; /* Type specific data */
};
#ifdef CONFIG_DMI
struct dmi_dev_onboard {
struct dmi_device dev;
int instance;
int segment;
int bus;
int devfn;
};
extern struct kobject *dmi_kobj;
extern int dmi_check_system(const struct dmi_system_id *list);
const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list);
extern const char * dmi_get_system_info(int field);
extern const struct dmi_device * dmi_find_device(int type, const char *name,
const struct dmi_device *from);
extern void dmi_scan_machine(void);
extern void dmi_memdev_walk(void);
extern void dmi_set_dump_stack_arch_desc(void);
extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
extern int dmi_name_in_vendors(const char *str);
extern int dmi_name_in_serial(const char *str);
extern int dmi_available;
extern int dmi_walk(void (*decode)(const struct dmi_header *, void *),
void *private_data);
extern bool dmi_match(enum dmi_field f, const char *str);
extern void dmi_memdev_name(u16 handle, const char **bank, const char **device);
#else
static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
static inline const char * dmi_get_system_info(int field) { return NULL; }
static inline const struct dmi_device * dmi_find_device(int type, const char *name,
const struct dmi_device *from) { return NULL; }
static inline void dmi_scan_machine(void) { return; }
static inline void dmi_memdev_walk(void) { }
static inline void dmi_set_dump_stack_arch_desc(void) { }
static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
{
if (yearp)
*yearp = 0;
if (monthp)
*monthp = 0;
if (dayp)
*dayp = 0;
return false;
}
static inline int dmi_name_in_vendors(const char *s) { return 0; }
static inline int dmi_name_in_serial(const char *s) { return 0; }
#define dmi_available 0
static inline int dmi_walk(void (*decode)(const struct dmi_header *, void *),
void *private_data) { return -1; }
static inline bool dmi_match(enum dmi_field f, const char *str)
{ return false; }
static inline void dmi_memdev_name(u16 handle, const char **bank,
const char **device) { }
static inline const struct dmi_system_id *
dmi_first_match(const struct dmi_system_id *list) { return NULL; }
#endif
#endif /* __DMI_H__ */
|
#if defined(_MSC_VER)
// Microsoft
#define EXPORT __declspec(dllexport)
#define IMPORT __declspec(dllimport)
#elif defined(_GCC)
// GCC
#define EXPORT __attribute__((visibility("default")))
#define IMPORT
#else
// do nothing and hope for the best?
#define EXPORT
#define IMPORT
#endif
extern IMPORT int foo();
extern EXPORT int bar();
EXPORT int bar()
{
return foo() * foo();
}
|
/*******************************************************************************
*
* Copyright (c) 2015-2016 Intel Corporation. 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
* OpenFabrics.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 I40IW_VF_H
#define I40IW_VF_H
struct i40iw_sc_cqp;
struct i40iw_manage_vf_pble_info {
u32 sd_index;
u16 first_pd_index;
u16 pd_entry_cnt;
u8 inv_pd_ent;
u64 pd_pl_pba;
};
struct i40iw_vf_cqp_ops {
enum i40iw_status_code (*manage_vf_pble_bp)(struct i40iw_sc_cqp *,
struct i40iw_manage_vf_pble_info *,
u64,
bool);
};
enum i40iw_status_code i40iw_manage_vf_pble_bp(struct i40iw_sc_cqp *cqp,
struct i40iw_manage_vf_pble_info *info,
u64 scratch,
bool post_sq);
extern struct i40iw_vf_cqp_ops iw_vf_cqp_ops;
#endif
|
#ifndef __APP_DELEGATE_H__
#define __APP_DELEGATE_H__
#include "cocos2d.h"
/**
@brief The cocos2d Application.
The reason for implement as private inheritance is to hide some interface call by CCDirector.
*/
class AppDelegate : private cocos2d::CCApplication
{
public:
AppDelegate();
virtual ~AppDelegate();
/**
@brief Implement CCDirector and CCScene init code here.
@return true Initialize success, app continue.
@return false Initialize failed, app terminate.
*/
virtual bool applicationDidFinishLaunching();
/**
@brief The function be called when the application enter background
@param the pointer of the application
*/
virtual void applicationDidEnterBackground();
/**
@brief The function be called when the application enter foreground
@param the pointer of the application
*/
virtual void applicationWillEnterForeground();
};
#endif // __APP_DELEGATE_H__
|
/*
* Common hypervisor code
*
* Copyright (C) 2008, VMware, Inc.
* Author : Alok N Kataria <akataria@vmware.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
* NON INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <linux/init.h>
#include <linux/export.h>
#include <asm/processor.h>
#include <asm/hypervisor.h>
static const __initconst struct hypervisor_x86 * const hypervisors[] =
{
#ifdef CONFIG_XEN_PV
&x86_hyper_xen_pv,
#endif
#ifdef CONFIG_XEN_PVHVM
&x86_hyper_xen_hvm,
#endif
&x86_hyper_vmware,
&x86_hyper_ms_hyperv,
#ifdef CONFIG_KVM_GUEST
&x86_hyper_kvm,
#endif
#ifdef CONFIG_JAILHOUSE_GUEST
&x86_hyper_jailhouse,
#endif
#ifdef CONFIG_ACRN_GUEST
&x86_hyper_acrn,
#endif
};
enum x86_hypervisor_type x86_hyper_type;
EXPORT_SYMBOL(x86_hyper_type);
bool __initdata nopv;
static __init int parse_nopv(char *arg)
{
nopv = true;
return 0;
}
early_param("nopv", parse_nopv);
static inline const struct hypervisor_x86 * __init
detect_hypervisor_vendor(void)
{
const struct hypervisor_x86 *h = NULL, * const *p;
uint32_t pri, max_pri = 0;
for (p = hypervisors; p < hypervisors + ARRAY_SIZE(hypervisors); p++) {
if (unlikely(nopv) && !(*p)->ignore_nopv)
continue;
pri = (*p)->detect();
if (pri > max_pri) {
max_pri = pri;
h = *p;
}
}
if (h)
pr_info("Hypervisor detected: %s\n", h->name);
return h;
}
static void __init copy_array(const void *src, void *target, unsigned int size)
{
unsigned int i, n = size / sizeof(void *);
const void * const *from = (const void * const *)src;
const void **to = (const void **)target;
for (i = 0; i < n; i++)
if (from[i])
to[i] = from[i];
}
void __init init_hypervisor_platform(void)
{
const struct hypervisor_x86 *h;
h = detect_hypervisor_vendor();
if (!h)
return;
copy_array(&h->init, &x86_init.hyper, sizeof(h->init));
copy_array(&h->runtime, &x86_platform.hyper, sizeof(h->runtime));
x86_hyper_type = h->type;
x86_init.hyper.init_platform();
}
|
/* Copyright 2020 Evy Dekkers
*
* 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 QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_all(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PSCR,
KC_DEL, KC_END, KC_PGDN, KC_SLCK,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PPLS,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT
),
}; |
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __NET_FRAG_H__
#define __NET_FRAG_H__
struct netns_frags {
/* Keep atomic mem on separate cachelines in structs that include it */
atomic_t mem ____cacheline_aligned_in_smp;
/* sysctls */
int timeout;
int high_thresh;
int low_thresh;
int max_dist;
};
/**
* fragment queue flags
*
* @INET_FRAG_FIRST_IN: first fragment has arrived
* @INET_FRAG_LAST_IN: final fragment has arrived
* @INET_FRAG_COMPLETE: frag queue has been processed and is due for destruction
*/
enum {
INET_FRAG_FIRST_IN = BIT(0),
INET_FRAG_LAST_IN = BIT(1),
INET_FRAG_COMPLETE = BIT(2),
};
/**
* struct inet_frag_queue - fragment queue
*
* @lock: spinlock protecting the queue
* @timer: queue expiration timer
* @list: hash bucket list
* @refcnt: reference count of the queue
* @fragments: received fragments head
* @fragments_tail: received fragments tail
* @stamp: timestamp of the last received fragment
* @len: total length of the original datagram
* @meat: length of received fragments so far
* @flags: fragment queue flags
* @max_size: maximum received fragment size
* @net: namespace that this frag belongs to
* @list_evictor: list of queues to forcefully evict (e.g. due to low memory)
*/
struct inet_frag_queue {
spinlock_t lock;
struct timer_list timer;
struct hlist_node list;
refcount_t refcnt;
struct sk_buff *fragments;
struct sk_buff *fragments_tail;
ktime_t stamp;
int len;
int meat;
__u8 flags;
u16 max_size;
struct netns_frags *net;
struct hlist_node list_evictor;
};
#define INETFRAGS_HASHSZ 1024
/* averaged:
* max_depth = default ipfrag_high_thresh / INETFRAGS_HASHSZ /
* rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or
* struct frag_queue))
*/
#define INETFRAGS_MAXDEPTH 128
struct inet_frag_bucket {
struct hlist_head chain;
spinlock_t chain_lock;
};
struct inet_frags {
struct inet_frag_bucket hash[INETFRAGS_HASHSZ];
struct work_struct frags_work;
unsigned int next_bucket;
unsigned long last_rebuild_jiffies;
bool rebuild;
/* The first call to hashfn is responsible to initialize
* rnd. This is best done with net_get_random_once.
*
* rnd_seqlock is used to let hash insertion detect
* when it needs to re-lookup the hash chain to use.
*/
u32 rnd;
seqlock_t rnd_seqlock;
unsigned int qsize;
unsigned int (*hashfn)(const struct inet_frag_queue *);
bool (*match)(const struct inet_frag_queue *q,
const void *arg);
void (*constructor)(struct inet_frag_queue *q,
const void *arg);
void (*destructor)(struct inet_frag_queue *);
void (*frag_expire)(struct timer_list *t);
struct kmem_cache *frags_cachep;
const char *frags_cache_name;
};
int inet_frags_init(struct inet_frags *);
void inet_frags_fini(struct inet_frags *);
static inline void inet_frags_init_net(struct netns_frags *nf)
{
atomic_set(&nf->mem, 0);
}
void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f);
void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f);
void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f);
struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,
struct inet_frags *f, void *key, unsigned int hash);
void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q,
const char *prefix);
static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f)
{
if (refcount_dec_and_test(&q->refcnt))
inet_frag_destroy(q, f);
}
static inline bool inet_frag_evicting(struct inet_frag_queue *q)
{
return !hlist_unhashed(&q->list_evictor);
}
/* Memory Tracking Functions. */
static inline int frag_mem_limit(struct netns_frags *nf)
{
return atomic_read(&nf->mem);
}
static inline void sub_frag_mem_limit(struct netns_frags *nf, int i)
{
atomic_sub(i, &nf->mem);
}
static inline void add_frag_mem_limit(struct netns_frags *nf, int i)
{
atomic_add(i, &nf->mem);
}
static inline int sum_frag_mem_limit(struct netns_frags *nf)
{
return atomic_read(&nf->mem);
}
/* RFC 3168 support :
* We want to check ECN values of all fragments, do detect invalid combinations.
* In ipq->ecn, we store the OR value of each ip4_frag_ecn() fragment value.
*/
#define IPFRAG_ECN_NOT_ECT 0x01 /* one frag had ECN_NOT_ECT */
#define IPFRAG_ECN_ECT_1 0x02 /* one frag had ECN_ECT_1 */
#define IPFRAG_ECN_ECT_0 0x04 /* one frag had ECN_ECT_0 */
#define IPFRAG_ECN_CE 0x08 /* one frag had ECN_CE */
extern const u8 ip_frag_ecn_table[16];
#endif
|
#ifndef DEF_BLACKWING_DESCENT_H
#define DEF_BLACKWING_DESCENT_H
enum Data
{
//Encounters
DATA_MAGMAW,
DATA_OMNOTRON_DEFENSE_SYSTEM,
DATA_MALORIAK,
DATA_CHIMAERON,
DATA_ATRAMEDES,
DATA_NEFARIAN,
DATA_ABBERATIONS_LEFT,
DATA_DRAKONID
};
enum Creatures
{
BOSS_MAGMAW = 41570,
BOSS_OMNOTRON = 42186,
BOSS_MALORIAK = 41378,
BOSS_ATRAMEDES = 41442,
BOSS_CHIMAERON = 43296,
BOSS_NEFARIAN = 41376,
// Magmaw
NPC_MAGMAWS_HEAD = 42347,
NPC_IGNITION_TRIGGER = 49447,
NPC_LAVA_PARASITE = 41806,
NPC_PILLAR_OF_FLAME_TRIGGER = 41843,
NPC_BLAZING_BONE_CONSTRUCT = 49416,
NPC_DRAGONID_DRUDGE = 42362,
NPC_MAGMAWS_HEAD2 = 48270,
NPC_MAGMAWS_PINCER = 41620,
NPC_MAGMAWS_PINCER2 = 41789,
NPC_SPIKE_STALKER = 41767,
// Omnotron Defense System
// Toxitron
NPC_TOXITRON = 42180,
NPC_POISON_BOMB = 42897,
NPC_POISON_CLOUD = 42934,
// Arcanotron
NPC_ARCANOTRON = 42166,
NPC_POWER_GENERATOR = 42733,
// Electron
NPC_ELECTRON = 42179,
// Magmatron
NPC_MAGMATRON = 42178,
// Chimaeron
NPC_BILE_O_TRON = 44418,
NPC_FINKLE_EINHORN = 44202,
// Maloriak
NPC_ABBERATON = 41440,
NPC_PRIME_SUBJECT = 41841,
NPC_SLIME_TRIGGER = 41377,
NPC_FLASH_FREEZE = 41576,
NPC_MAGMA_JET_CONTROLLER = 50030,
NPC_ABSOLUTE_ZERO = 41961,
NPC_VILE_SWILL = 49811,
// Atramedes
// Pre Event
NPC_PRE_MALORIAK = 43404,
NPC_PRE_NEFARIAN = 49799,
NPC_PRE_ATRAMEDES = 43407,
NPC_PRE_LIGHT_EFFECT = 41525,
NPC_SONAR_PULSE = 49623,
NPC_OBNOXIOUS_FIEND = 49740,
// Nefarian
NPC_ONYXIA = 41270,
// Misc
NPC_NEFARIAN_HELPER_HEROIC = 49226,
NPC_LORD_VICTOR_NEFARIAN = 41379,
NPC_DRAKONID_CHAIN = 42649,
};
enum Gameobjects
{
GOB_DOOR_PRE_BOSSES = 402092,
GOB_DOOR_ATRAMEDES = 402368,
GOB_ONYXIA_PLATFORM = 207834,
GOB_MALORIAKS_CAULDRON = 203306,
GOB_NEFARIANS_THRONE = 202832,
};
#endif
|
// Copyright (c) 2011 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 PPAPI_CPP_DEV_URL_UTIL_DEV_H_
#define PPAPI_CPP_DEV_URL_UTIL_DEV_H_
#include "ppapi/c/dev/ppb_url_util_dev.h"
#include "ppapi/cpp/var.h"
namespace pp {
class InstanceHandle;
// Simple wrapper around the PPB_URLUtil interface.
class URLUtil_Dev {
public:
// This class is just a collection of random functions that aren't
// particularly attached to anything. So this getter returns a cached
// instance of this interface. This may return NULL if the browser doesn't
// support the URLUtil interface. Since this is a singleton, don't delete the
// pointer.
static const URLUtil_Dev* Get();
Var Canonicalize(const Var& url,
PP_URLComponents_Dev* components = NULL) const;
Var ResolveRelativeToURL(const Var& base_url,
const Var& relative_string,
PP_URLComponents_Dev* components = NULL) const;
Var ResolveRelativeToDocument(const InstanceHandle& instance,
const Var& relative_string,
PP_URLComponents_Dev* components = NULL) const;
bool IsSameSecurityOrigin(const Var& url_a, const Var& url_b) const;
bool DocumentCanRequest(const InstanceHandle& instance, const Var& url) const;
bool DocumentCanAccessDocument(const InstanceHandle& active,
const InstanceHandle& target) const;
Var GetDocumentURL(const InstanceHandle& instance,
PP_URLComponents_Dev* components = NULL) const;
Var GetPluginInstanceURL(const InstanceHandle& instance,
PP_URLComponents_Dev* components = NULL) const;
private:
URLUtil_Dev() : interface_(NULL) {}
// Copy and assignment are disallowed.
URLUtil_Dev(const URLUtil_Dev& other);
URLUtil_Dev& operator=(const URLUtil_Dev& other);
const PPB_URLUtil_Dev* interface_;
};
} // namespace pp
#endif // PPAPI_CPP_DEV_URL_UTIL_DEV_H_
|
/*
* ocp_zmii.h
*
* Defines for the IBM ZMII bridge
*
* Armin Kuster akuster@mvista.com
* Dec, 2001
*
* Copyright 2001 MontaVista Softare Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#ifndef _IBM_EMAC_ZMII_H_
#define _IBM_EMAC_ZMII_H_
#include <linux/config.h>
/* ZMII bridge registers */
struct zmii_regs {
u32 fer; /* Function enable reg */
u32 ssr; /* Speed select reg */
u32 smiirs; /* SMII status reg */
};
#define ZMII_INPUTS 4
/* ZMII device */
struct ibm_ocp_zmii {
struct zmii_regs *base;
int mode[ZMII_INPUTS];
int users; /* number of EMACs using this ZMII bridge */
};
/* Fuctional Enable Reg */
#define ZMII_FER_MASK(x) (0xf0000000 >> (4*x))
#define ZMII_MDI0 0x80000000
#define ZMII_SMII0 0x40000000
#define ZMII_RMII0 0x20000000
#define ZMII_MII0 0x10000000
#define ZMII_MDI1 0x08000000
#define ZMII_SMII1 0x04000000
#define ZMII_RMII1 0x02000000
#define ZMII_MII1 0x01000000
#define ZMII_MDI2 0x00800000
#define ZMII_SMII2 0x00400000
#define ZMII_RMII2 0x00200000
#define ZMII_MII2 0x00100000
#define ZMII_MDI3 0x00080000
#define ZMII_SMII3 0x00040000
#define ZMII_RMII3 0x00020000
#define ZMII_MII3 0x00010000
/* Speed Selection reg */
#define ZMII_SCI0 0x40000000
#define ZMII_FSS0 0x20000000
#define ZMII_SP0 0x10000000
#define ZMII_SCI1 0x04000000
#define ZMII_FSS1 0x02000000
#define ZMII_SP1 0x01000000
#define ZMII_SCI2 0x00400000
#define ZMII_FSS2 0x00200000
#define ZMII_SP2 0x00100000
#define ZMII_SCI3 0x00040000
#define ZMII_FSS3 0x00020000
#define ZMII_SP3 0x00010000
#define ZMII_MII0_100MB ZMII_SP0
#define ZMII_MII0_10MB ~ZMII_SP0
#define ZMII_MII1_100MB ZMII_SP1
#define ZMII_MII1_10MB ~ZMII_SP1
#define ZMII_MII2_100MB ZMII_SP2
#define ZMII_MII2_10MB ~ZMII_SP2
#define ZMII_MII3_100MB ZMII_SP3
#define ZMII_MII3_10MB ~ZMII_SP3
/* SMII Status reg */
#define ZMII_STS0 0xFF000000 /* EMAC0 smii status mask */
#define ZMII_STS1 0x00FF0000 /* EMAC1 smii status mask */
#define SMII 0
#define RMII 1
#define MII 2
#define MDI 3
#endif /* _IBM_EMAC_ZMII_H_ */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.