text stringlengths 4 6.14k |
|---|
/*
* tun.h
*
* Network tunnel device.
*
* Copyright (c) 2001 Dug Song <dugsong@monkey.org>
*
* $Id: tun.h 547 2005-01-25 21:30:40Z dugsong $
*/
#ifndef DNET_TUN_H
#define DNET_TUN_H
typedef struct tun tun_t;
__BEGIN_DECLS
tun_t *tun_open(struct addr *src, struct addr *dst, int mtu);
int tun_fileno(tun_t *tun);
const char *tun_name(tun_t *tun);
ssize_t tun_send(tun_t *tun, const void *buf, size_t size);
ssize_t tun_recv(tun_t *tun, void *buf, size_t size);
tun_t *tun_close(tun_t *tun);
__END_DECLS
#endif /* DNET_TUN_H */
|
/*******************************************************************************
* *
* PrimeSense NITE 1.3 *
* Copyright (C) 2010 PrimeSense Ltd. *
* *
*******************************************************************************/
#ifndef _XNV_MESSAGE_LISTENER_H_
#define _XNV_MESSAGE_LISTENER_H_
#include <XnThreadSafeQueue.h>
#include "XnVMessage.h"
class XnVMessageQueue;
class XnVMessageSpecificEvent;
class XnVEvent;
/**
* A XnVMessageListener is a general listener, that received Messages and handles them.
* It supports Multi-Threaded work, by knowing the thread it works in,
* and putting Messages in a Queue when accessed from other threads.
*/
class XNV_NITE_API XnVMessageListener
{
public:
/**
* Type for callbacks after a Message is handled
*/
typedef void (XN_CALLBACK_TYPE* MessageUpdateCB)(XnVMessage* pMessage, void* cxt);
/**
* Type for callbacks on activation
*/
typedef void (XN_CALLBACK_TYPE* ActivateCB)(void* cxt);
/**
* Type for callbacks on deactivation
*/
typedef void (XN_CALLBACK_TYPE* DeactivateCB)(void* cxt);
/**
* Constructor. Create a new Message Listener
*
* @param [in] strName Name of the control, for log purposes.
*/
XnVMessageListener(const XnChar* strName = "XnVMessageListener");
virtual ~XnVMessageListener();
/**
* This method handles multi-thread support, calling Update only when run from the proper thread
* and copying the Message to a Queue when not.
*
* @param [in] pMessage The Message that should be handled
*/
void BaseUpdate(XnVMessage* pMessage);
/**
* This method will be implemented by descendants, handling the Message
*
* @param [in] pMessage The Message that was received
*/
virtual void Update(XnVMessage* pMessage) = 0;
/**
* Handle Control Messages. By default, it calls Activate for Activation Messages.
* Can be reimplemented to handle additional Message types.
* Is called from BaseUpdate, before Update.
*
* @param [in] pMessage The message to handle
*/
virtual void HandleCCMessages(XnVMessage* pMessage);
/**
* This method is called (by the default HandleCCMessages) when an Activation Message is received.
*
* @param [in] bActive TRUE if this listener is now active, FALSE if it is now inactive
*/
virtual void Activate(XnBool bActive) {}
/**
* Get the listener's name. Mostly for Log use.
*
* @return The current Listener's name
*/
const XnChar* GetListenerName() const;
/**
* Supply the Message Listener with run-time from its thread. Read from the Queue, and BaseUpdate.
*
* @param [in] nSessionMaxLength Maximum number of Messages to be handled in a single Run
*/
void Run(XnUInt32 nSessionMaxLength = ms_nSessionDefaultLength);
/**
* Open a thread, and run the Listener in it.
*
* @return XN_STATUS_OK if OK, other on error
*/
XnStatus RunAsThread();
/**
* Change the working thread, in which actual work is done
*
* @param [in] hThread The ID of the relevant thread
*/
void SetThreadId(XN_THREAD_ID hThread);
/**
* Change the working thread to the one from which it is called
*/
void SetCurrentThread();
/**
* Register a callback to be called after the Message is handled
*
* @param [in] cxt User's context
* @param [in] CB The Callback to call when the event is invoked.
*
* @return A handle, to allow unregistration.
*/
XnCallbackHandle RegisterUpdate(void* cxt, MessageUpdateCB CB);
/**
* Register for the activation event
*
* @param [in] cxt User's context
* @param [in] CB The Callback to call when the event is invoked.
*
* @return A handle, to allow unregistration.
*/
XnCallbackHandle RegisterActivate(void* cxt, ActivateCB CB);
/**
* Register for the deactivation event
*
* @param [in] cxt User's context
* @param [in] CB The Callback to call when the event is invoked.
*
* @return A handle, to allow unregistration.
*/
XnCallbackHandle RegisterDeactivate(void* cxt, DeactivateCB CB);
/**
* Unregister from the Message Update
*
* @param [in] hCB The handle provided on registration.
*/
void UnregisterUpdate(XnCallbackHandle hCB);
/**
* Unregister from the activation event
*
* @param [in] hCB The handle provided on registration.
*/
void UnregisterActivate(XnCallbackHandle hCB);
/**
* Unregister from the deactivation event
*
* @param [in] hCB The handle provided on registration.
*/
void UnregisterDeactivate(XnCallbackHandle hCB);
/**
* Change the multi-thread mode.
*
* @param [in] bMode The new mode
*/
void SetThreadProtectionQueueMode(XnBool bMode);
/**
* Get the current multi-thread mode
*
* @return TRUE if queues are used, FALSE if Update will be called from anywhere
*/
XnBool GetThreadProtectecionQueueMode() const;
/**
* Clear the Multi-thread queue
*/
virtual void ClearQueue();
protected:
XnBool IsInActivityThread() const;
static XN_THREAD_PROC MessageListenerThread(XN_THREAD_PARAM param);
void MainLoop();
XN_THREAD_ID m_hActivityThreadId;
XN_THREAD_HANDLE m_hActivityThread; // When thread is internal
XnBool m_bInternalThreadAlive;
XnBool m_bInternalThreadKill;
XnBool m_bThreadProtectionQueueMode;
static const XnUInt32 ms_nSessionDefaultLength;
XnVMessageQueue* m_pMessageQueue;
XnVMessageSpecificEvent* m_pUpdateCBs;
XnVEvent* m_pActivateCBs;
XnVEvent* m_pDeactivateCBs;
XnChar* m_strListenerName;
XN_CRITICAL_SECTION_HANDLE m_hListenerCS;
};
#endif
|
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef BOUNDARYUSEROBJECT_H
#define BOUNDARYUSEROBJECT_H
#include "SideUserObject.h"
class BoundaryUserObject;
template<>
InputParameters validParams<BoundaryUserObject>();
/**
*
*/
class BoundaryUserObject : public SideUserObject
{
public:
BoundaryUserObject(const std::string & name, InputParameters parameters);
virtual ~BoundaryUserObject();
virtual void initialize();
virtual void execute();
virtual void finalize();
virtual void threadJoin(const UserObject & uo);
Real getValue() const { return _value; }
protected:
VariableValue & _u;
Real _value;
std::map<BoundaryID, Real> _factors;
};
#endif /* BOUNDARYUSEROBJECT_H */
|
/*
* Copyright (C) 2015 Hamburg University of Applied Sciences
*
* 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.
*/
/**
* @defgroup boards_limifrog-v1 LimiFrog Version 1
* @ingroup boards
* @brief Board specific files for the limifrog-v1 board.
* @{
*
* @file
* @brief Board specific definitions for the limifrog-v1 board.
*
* @author Katja Kirstein <katja.kirstein@haw-hamburg.de>
*/
#ifndef BOARD_H
#define BOARD_H
#include <stdint.h>
#include "cpu.h"
#include "periph_conf.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PORT_C, 3)
#define LED0_PORT (GPIOC)
#define LED0_MASK (1 << 3)
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H */
/** @} */
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2010 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 <Foundation/Foundation.h>
@interface ApplicationRouting : NSObject {
}
+ (NSData *)resolveAppAsset:(NSString *)path;
@end
|
/* Copyright 2015 The TensorFlow 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 TENSORFLOW_STREAM_EXECUTOR_LIB_STR_UTIL_H_
#define TENSORFLOW_STREAM_EXECUTOR_LIB_STR_UTIL_H_
#include "tensorflow/core/lib/strings/str_util.h"
#include "tensorflow/stream_executor/lib/stringpiece.h"
namespace stream_executor {
namespace port {
using tensorflow::str_util::Join;
using tensorflow::str_util::Split;
// Returns a copy of the input string 'str' with the given 'suffix'
// removed. If the suffix doesn't match, returns a copy of the original string.
inline string StripSuffixString(port::StringPiece str, port::StringPiece suffix) {
if (tensorflow::str_util::EndsWith(str, suffix)) {
str.remove_suffix(suffix.size());
}
return std::string(str);
}
using tensorflow::str_util::Lowercase;
} // namespace port
} // namespace stream_executor
#endif // TENSORFLOW_STREAM_EXECUTOR_LIB_STR_UTIL_H_
|
/*
* Copyright 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef RTC_BASE_SYNCHRONIZATION_YIELD_POLICY_H_
#define RTC_BASE_SYNCHRONIZATION_YIELD_POLICY_H_
namespace rtc {
class YieldInterface {
public:
virtual ~YieldInterface() = default;
virtual void YieldExecution() = 0;
};
// Sets the current thread-local yield policy while it's in scope and reverts
// to the previous policy when it leaves the scope.
class ScopedYieldPolicy final {
public:
explicit ScopedYieldPolicy(YieldInterface* policy);
ScopedYieldPolicy(const ScopedYieldPolicy&) = delete;
ScopedYieldPolicy& operator=(const ScopedYieldPolicy&) = delete;
~ScopedYieldPolicy();
// Will yield as specified by the currently active thread-local yield policy
// (which by default is a no-op).
static void YieldExecution();
private:
YieldInterface* const previous_;
};
} // namespace rtc
#endif // RTC_BASE_SYNCHRONIZATION_YIELD_POLICY_H_
|
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _GPIO_H_
#define _GPIO_H_
#define TLMM_PULL_MASK 0x3
#define TLMM_HDRV_MASK 0x7
/* Current values for tlmm pins */
enum {
TLMM_CUR_VAL_2MA = 0x0,
TLMM_CUR_VAL_4MA,
TLMM_CUR_VAL_6MA,
TLMM_CUR_VAL_8MA,
TLMM_CUR_VAL_10MA,
TLMM_CUR_VAL_12MA,
TLMM_CUR_VAL_14MA,
TLMM_CUR_VAL_16MA,
} tlmm_drive_config;
enum {
TLMM_PULL_UP = 0x3,
TLMM_PULL_DOWN = 0x1,
TLMM_NO_PULL = 0x0,
} tlmm_pull_values;
/* Bit offsets in the TLMM register */
enum {
SDC1_DATA_HDRV_CTL_OFF = 0,
SDC1_CMD_HDRV_CTL_OFF = 3,
SDC1_CLK_HDRV_CTL_OFF = 6,
SDC1_DATA_PULL_CTL_OFF = 9,
SDC1_CMD_PULL_CTL_OFF = 11,
SDC1_CLK_PULL_CTL_OFF = 13,
SDC1_RCLK_PULL_CTL_OFF = 15,
} tlmm_drv_ctrl;
/* Input for the tlmm config function */
struct tlmm_cfgs {
uint32_t off; /* Bit offeset in the register */
uint8_t val; /* Current value */
uint8_t mask; /* Mask for the clk/dat/cmd control */
};
/* APIs: exposed for other drivers */
/* API: Hdrive control for tlmm pins */
void tlmm_set_hdrive_ctrl(struct tlmm_cfgs *, uint8_t);
/* API: Pull control for tlmm pins */
void tlmm_set_pull_ctrl(struct tlmm_cfgs *, uint8_t);
#endif
|
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_OBJECTS_H
#define ZEND_OBJECTS_H
#include "zend.h"
BEGIN_EXTERN_C()
ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC);
ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC);
ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC);
ZEND_API zend_object *zend_objects_get_address(const zval *object TSRMLS_DC);
ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC);
ZEND_API zend_object_value zend_objects_clone_obj(zval *object TSRMLS_DC);
ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC);
END_EXTERN_C()
#endif /* ZEND_OBJECTS_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
|
#ifndef _PPC_BOOT_PAGE_H
#define _PPC_BOOT_PAGE_H
/*
* Copyright (C) 2001 PPC64 Team, IBM Corp
*
* 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.
*/
#ifdef __ASSEMBLY__
#define ASM_CONST(x) x
#else
#define __ASM_CONST(x) x##UL
#define ASM_CONST(x) __ASM_CONST(x)
#endif
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
/* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
#endif /* _PPC_BOOT_PAGE_H */
|
/* { dg-do compile } */
/* { dg-options "-mfma -mavx512vl -O2" } */
/* { dg-final { scan-assembler-times "vfnmsub...ps\[ \\t\]+\\(%(?:eax|rdi|edi)\\)\\\{1to\[1-8\]+\\\}, %ymm\[0-9\]+, %ymm0" 1 } } */
/* { dg-final { scan-assembler-not "vbroadcastss\[^\n\]*%ymm\[0-9\]+" } } */
#define type __m256
#define vec 256
#define op fnmsub
#define suffix ps
#define SCALAR float
#include "avx512-fma-1.h"
|
/* Author: Peter Schwabe, ported from an assembly implementation by Emilia Käsper
* Date: 2009-03-19
* Public domain */
#include "crypto_stream_aes128ctr.h"
#include "int128.h"
#include "common.h"
#include "consts.h"
int crypto_stream_aes128ctr_afternm(unsigned char *out, unsigned long long len, const unsigned char *nonce, const unsigned char *c)
{
int128 xmm0;
int128 xmm1;
int128 xmm2;
int128 xmm3;
int128 xmm4;
int128 xmm5;
int128 xmm6;
int128 xmm7;
int128 xmm8;
int128 xmm9;
int128 xmm10;
int128 xmm11;
int128 xmm12;
int128 xmm13;
int128 xmm14;
int128 xmm15;
int128 nonce_stack;
unsigned long long lensav;
unsigned char bl[128];
unsigned char *blp;
unsigned char *np;
unsigned char b;
uint32 tmp;
/* Copy nonce on the stack */
copy2(&nonce_stack, (const int128 *) (nonce + 0));
np = (unsigned char *)&nonce_stack;
enc_block:
xmm0 = *(int128 *) (np + 0);
copy2(&xmm1, &xmm0);
shufb(&xmm1, SWAP32);
copy2(&xmm2, &xmm1);
copy2(&xmm3, &xmm1);
copy2(&xmm4, &xmm1);
copy2(&xmm5, &xmm1);
copy2(&xmm6, &xmm1);
copy2(&xmm7, &xmm1);
add_uint32_big(&xmm1, 1);
add_uint32_big(&xmm2, 2);
add_uint32_big(&xmm3, 3);
add_uint32_big(&xmm4, 4);
add_uint32_big(&xmm5, 5);
add_uint32_big(&xmm6, 6);
add_uint32_big(&xmm7, 7);
shufb(&xmm0, M0);
shufb(&xmm1, M0SWAP);
shufb(&xmm2, M0SWAP);
shufb(&xmm3, M0SWAP);
shufb(&xmm4, M0SWAP);
shufb(&xmm5, M0SWAP);
shufb(&xmm6, M0SWAP);
shufb(&xmm7, M0SWAP);
bitslice(xmm7, xmm6, xmm5, xmm4, xmm3, xmm2, xmm1, xmm0, xmm8)
aesround( 1, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
aesround( 2, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c)
aesround( 3, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
aesround( 4, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c)
aesround( 5, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
aesround( 6, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c)
aesround( 7, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
aesround( 8, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c)
aesround( 9, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,c)
lastround(xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,c)
bitslice(xmm13, xmm10, xmm15, xmm11, xmm14, xmm12, xmm9, xmm8, xmm0)
if(len < 128) goto partial;
if(len == 128) goto full;
tmp = LOAD32_BE(np + 12);
tmp += 8;
STORE32_BE(np + 12, tmp);
*(int128 *) (out + 0) = xmm8;
*(int128 *) (out + 16) = xmm9;
*(int128 *) (out + 32) = xmm12;
*(int128 *) (out + 48) = xmm14;
*(int128 *) (out + 64) = xmm11;
*(int128 *) (out + 80) = xmm15;
*(int128 *) (out + 96) = xmm10;
*(int128 *) (out + 112) = xmm13;
len -= 128;
out += 128;
goto enc_block;
partial:
lensav = len;
len >>= 4;
tmp = LOAD32_BE(np + 12);
tmp += len;
STORE32_BE(np + 12, tmp);
blp = bl;
*(int128 *)(blp + 0) = xmm8;
*(int128 *)(blp + 16) = xmm9;
*(int128 *)(blp + 32) = xmm12;
*(int128 *)(blp + 48) = xmm14;
*(int128 *)(blp + 64) = xmm11;
*(int128 *)(blp + 80) = xmm15;
*(int128 *)(blp + 96) = xmm10;
*(int128 *)(blp + 112) = xmm13;
bytes:
if(lensav == 0) goto end;
b = blp[0]; /* clang false positive */
*(unsigned char *)(out + 0) = b;
blp += 1;
out +=1;
lensav -= 1;
goto bytes;
full:
tmp = LOAD32_BE(np + 12);
tmp += 8;
STORE32_BE(np + 12, tmp);
*(int128 *) (out + 0) = xmm8;
*(int128 *) (out + 16) = xmm9;
*(int128 *) (out + 32) = xmm12;
*(int128 *) (out + 48) = xmm14;
*(int128 *) (out + 64) = xmm11;
*(int128 *) (out + 80) = xmm15;
*(int128 *) (out + 96) = xmm10;
*(int128 *) (out + 112) = xmm13;
end:
return 0;
}
|
/*
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
*
* 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 auto_init_gnrc_netif
* @{
*
* @file
* @brief Auto initialization for XBee network interfaces
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#ifdef MODULE_GNRC_SLIP
#include "board.h"
#include "net/gnrc/nomac.h"
#include "net/gnrc.h"
#include "net/gnrc/slip.h"
#include "slip_params.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
#define SLIP_NUM (sizeof(gnrc_slip_params)/sizeof(gnrc_slip_params_t))
static gnrc_slip_dev_t slip_devs[SLIP_NUM];
/**
* @brief Define stack parameters for the MAC layer thread
* @{
*/
#define SLIP_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define SLIP_PRIO (THREAD_PRIORITY_MAIN - 4)
/**
* @brief Stacks for the MAC layer threads
*/
static char _slip_stacks[SLIP_STACKSIZE][SLIP_NUM];
void auto_init_slip(void)
{
for (unsigned int i = 0; i < SLIP_NUM; i++) {
const gnrc_slip_params_t *p = &gnrc_slip_params[i];
DEBUG("Initializing SLIP radio at UART_%d\n", p->uart);
kernel_pid_t res = gnrc_slip_init(&slip_devs[i], p->uart, p->baudrate,
_slip_stacks[i], SLIP_STACKSIZE,
SLIP_PRIO);
if (res <= KERNEL_PID_UNDEF) {
DEBUG("Error initializing SLIP radio device!\n");
}
}
}
#else
typedef int dont_be_pedantic;
#endif /* MODULE_GNRC_SLIP */
/** @} */
|
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2007 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.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.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE msg_inlined.c
*
* Expand inlined msg functions non-inline.
*
*/
#include "config.h"
#include <sofia-sip/su_config.h>
#if SU_HAVE_INLINE
extern int xyzzy;
#else
#undef SU_HAVE_INLINE
#undef su_inline
#define SU_HAVE_INLINE 1
#define su_inline
#include "sofia-sip/msg_header.h"
#include "sofia-sip/msg_mime_protos.h"
#endif
|
#include <stddef.h>
#include "malloc.h"
#include "os.h"
typedef long Align;
union header {
struct {
union header *ptr;
unsigned int size;
} s;
Align x;
};
typedef union header Header;
static unsigned char heaps[MAX_HEAPS];
static unsigned char *program_break = heaps;
static Header base; /* empty list to get started */
static Header *freep = NULL; /* start of free list */
static void *sbrk(unsigned int nbytes)
{
if (program_break + nbytes >= heaps
&& program_break + nbytes < heaps + MAX_HEAPS) {
unsigned char *previous_pb = program_break;
program_break += nbytes;
return (void *) previous_pb;
}
return (void *) - 1;
}
void *malloc(unsigned int nbytes)
{
Header *p, *prevp;
unsigned int nunits;
void *cp;
nunits = (nbytes + sizeof(Header) - 1) / sizeof(Header) + 1;
if ((prevp = freep) == NULL) {
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for (p = prevp->s.ptr; ; prevp = p, p = p->s.ptr) {
if (p->s.size >= nunits) {
if (p->s.size == nunits) {
prevp->s.ptr = p->s.ptr;
} else {
p->s.size -= nunits;
p += p->s.size;
p->s.size = nunits;
}
freep = prevp;
return (void *)(p + 1);
}
if (p == freep) {
cp = sbrk(nunits * sizeof(Header));
if (cp == (void *) -1) {
return NULL;
} else {
p = (Header *) cp;
p->s.size = nunits;
free((void *) (p + 1));
p = freep;
}
}
}
}
void free(void *ap)
{
Header *bp, *p;
bp = (Header *) ap - 1;
for (p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) {
if (p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
}
if (bp + bp->s.size == p->s.ptr) {
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else {
bp->s.ptr = p->s.ptr;
}
if (p + p->s.size == bp) {
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else {
p->s.ptr = bp;
}
freep = p;
}
|
/*
* vicii-cmdline-options.h - Command-line options for the MOS 6569 (VIC-II)
* emulation.
*
* Written by
* Ettore Perazzoli <ettore@comm2000.it>
* Andreas Boose <viceteam@t-online.de>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.
*
*/
#ifndef VICE_VICII_CMDLINE_OPTIONS_H
#define VICE_VICII_CMDLINE_OPTIONS_H
extern int vicii_cmdline_options_init(void);
#endif
|
#include <linux/utsrelease.h>
#include <linux/module.h>
/* Simply sanity version stamp for modules. */
#ifdef CONFIG_SMP
#define MODULE_VERMAGIC_SMP "SMP "
#else
#define MODULE_VERMAGIC_SMP ""
#endif
#ifdef CONFIG_PREEMPT
#define MODULE_VERMAGIC_PREEMPT "preempt "
#else
#define MODULE_VERMAGIC_PREEMPT ""
#endif
#ifdef CONFIG_MODULE_UNLOAD
#define MODULE_VERMAGIC_MODULE_UNLOAD "mod_unload "
#else
#define MODULE_VERMAGIC_MODULE_UNLOAD ""
#endif
#ifdef CONFIG_MODVERSIONS
#define MODULE_VERMAGIC_MODVERSIONS "modversions "
#else
#define MODULE_VERMAGIC_MODVERSIONS ""
#endif
#ifndef MODULE_ARCH_VERMAGIC
#define MODULE_ARCH_VERMAGIC ""
#endif
#define VERMAGIC_STRING \
KERNEL_VER_NOSCM " " \
MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \
MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS \
MODULE_ARCH_VERMAGIC
|
/*
* JFFS2 -- Journalling Flash File System, Version 2.
*
* Copyright (C) 2001, 2002 Red Hat, Inc.
*
* Created by David Woodhouse <dwmw2@cambridge.redhat.com>
*
* The original JFFS, from which the design for JFFS2 was derived,
* was designed and implemented by Axis Communications AB.
*
* The contents of this file are subject to the Red Hat eCos Public
* License Version 1.1 (the "Licence"); you may not use this file
* except in compliance with the Licence. You may obtain a copy of
* the Licence at http://www.redhat.com/
*
* Software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the Licence for the specific language governing rights and
* limitations under the Licence.
*
* The Original Code is JFFS2 - Journalling Flash File System, version 2
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License version 2 (the "GPL"), in
* which case the provisions of the GPL are applicable instead of the
* above. If you wish to allow the use of your version of this file
* only under the terms of the GPL and not to allow others to use your
* version of this file under the RHEPL, indicate your decision by
* deleting the provisions above and replace them with the notice and
* other provisions required by the GPL. If you do not delete the
* provisions above, a recipient may use your version of this file
* under either the RHEPL or the GPL.
*
* $Id: compr_zlib.c,v 1.8.2.1 2002/10/11 09:04:44 dwmw2 Exp $
*
*/
#ifndef __KERNEL__
#error "The userspace support got too messy and was removed. Update your mkfs.jffs2"
#endif
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/mtd/compatmac.h> /* for min() */
#include <linux/slab.h>
#include <linux/jffs2.h>
#include <linux/zlib.h>
#include "nodelist.h"
/* Plan: call deflate() with avail_in == *sourcelen,
avail_out = *dstlen - 12 and flush == Z_FINISH.
If it doesn't manage to finish, call it again with
avail_in == 0 and avail_out set to the remaining 12
bytes for it to clean up.
Q: Is 12 bytes sufficient?
*/
#define STREAM_END_SPACE 12
static DECLARE_MUTEX(deflate_sem);
static DECLARE_MUTEX(inflate_sem);
static void *deflate_workspace;
static void *inflate_workspace;
int __init jffs2_zlib_init(void)
{
deflate_workspace = vmalloc(zlib_deflate_workspacesize());
if (!deflate_workspace) {
printk(KERN_WARNING "Failed to allocate %d bytes for deflate workspace\n", zlib_deflate_workspacesize());
return -ENOMEM;
}
D1(printk(KERN_DEBUG "Allocated %d bytes for deflate workspace\n", zlib_deflate_workspacesize()));
inflate_workspace = vmalloc(zlib_inflate_workspacesize());
if (!inflate_workspace) {
printk(KERN_WARNING "Failed to allocate %d bytes for inflate workspace\n", zlib_inflate_workspacesize());
vfree(deflate_workspace);
return -ENOMEM;
}
D1(printk(KERN_DEBUG "Allocated %d bytes for inflate workspace\n", zlib_inflate_workspacesize()));
return 0;
}
void jffs2_zlib_exit(void)
{
vfree(deflate_workspace);
vfree(inflate_workspace);
}
int zlib_compress(unsigned char *data_in, unsigned char *cpage_out,
__u32 *sourcelen, __u32 *dstlen)
{
z_stream strm;
int ret;
if (*dstlen <= STREAM_END_SPACE)
return -1;
down(&deflate_sem);
strm.workspace = deflate_workspace;
if (Z_OK != zlib_deflateInit(&strm, 3)) {
printk(KERN_WARNING "deflateInit failed\n");
up(&deflate_sem);
return -1;
}
strm.next_in = data_in;
strm.total_in = 0;
strm.next_out = cpage_out;
strm.total_out = 0;
while (strm.total_out < *dstlen - STREAM_END_SPACE && strm.total_in < *sourcelen) {
strm.avail_out = *dstlen - (strm.total_out + STREAM_END_SPACE);
strm.avail_in = min((unsigned)(*sourcelen-strm.total_in), strm.avail_out);
D1(printk(KERN_DEBUG "calling deflate with avail_in %d, avail_out %d\n",
strm.avail_in, strm.avail_out));
ret = zlib_deflate(&strm, Z_PARTIAL_FLUSH);
D1(printk(KERN_DEBUG "deflate returned with avail_in %d, avail_out %d, total_in %ld, total_out %ld\n",
strm.avail_in, strm.avail_out, strm.total_in, strm.total_out));
if (ret != Z_OK) {
D1(printk(KERN_DEBUG "deflate in loop returned %d\n", ret));
zlib_deflateEnd(&strm);
up(&deflate_sem);
return -1;
}
}
strm.avail_out += STREAM_END_SPACE;
strm.avail_in = 0;
ret = zlib_deflate(&strm, Z_FINISH);
zlib_deflateEnd(&strm);
up(&deflate_sem);
if (ret != Z_STREAM_END) {
D1(printk(KERN_DEBUG "final deflate returned %d\n", ret));
return -1;
}
D1(printk(KERN_DEBUG "zlib compressed %ld bytes into %ld\n",
strm.total_in, strm.total_out));
if (strm.total_out >= strm.total_in)
return -1;
*dstlen = strm.total_out;
*sourcelen = strm.total_in;
return 0;
}
void zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
__u32 srclen, __u32 destlen)
{
z_stream strm;
int ret;
down(&inflate_sem);
strm.workspace = inflate_workspace;
if (Z_OK != zlib_inflateInit(&strm)) {
printk(KERN_WARNING "inflateInit failed\n");
up(&inflate_sem);
return;
}
strm.next_in = data_in;
strm.avail_in = srclen;
strm.total_in = 0;
strm.next_out = cpage_out;
strm.avail_out = destlen;
strm.total_out = 0;
while((ret = zlib_inflate(&strm, Z_FINISH)) == Z_OK)
;
if (ret != Z_STREAM_END) {
printk(KERN_NOTICE "inflate returned %d\n", ret);
}
zlib_inflateEnd(&strm);
up(&inflate_sem);
}
|
/*
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MAP_BUILDER_H
#define _MAP_BUILDER_H
#include "TerrainBuilder.h"
#include "Recast.h"
#include "DetourNavMesh.h"
#include "ProducerConsumerQueue.h"
#include <vector>
#include <set>
#include <list>
#include <atomic>
#include <thread>
using namespace VMAP;
namespace MMAP
{
struct MapTiles
{
MapTiles() : m_mapId(uint32(-1)), m_tiles(NULL) {}
MapTiles(uint32 id, std::set<uint32>* tiles) : m_mapId(id), m_tiles(tiles) {}
~MapTiles() {}
uint32 m_mapId;
std::set<uint32>* m_tiles;
bool operator==(uint32 id)
{
return m_mapId == id;
}
};
typedef std::list<MapTiles> TileList;
struct Tile
{
Tile() : chf(NULL), solid(NULL), cset(NULL), pmesh(NULL), dmesh(NULL) {}
~Tile()
{
rcFreeCompactHeightfield(chf);
rcFreeContourSet(cset);
rcFreeHeightField(solid);
rcFreePolyMesh(pmesh);
rcFreePolyMeshDetail(dmesh);
}
rcCompactHeightfield* chf;
rcHeightfield* solid;
rcContourSet* cset;
rcPolyMesh* pmesh;
rcPolyMeshDetail* dmesh;
};
class MapBuilder
{
public:
MapBuilder(float maxWalkableAngle = 70.f,
bool skipLiquid = false,
bool skipContinents = false,
bool skipJunkMaps = true,
bool skipBattlegrounds = false,
bool debugOutput = false,
bool bigBaseUnit = false,
const char* offMeshFilePath = NULL);
~MapBuilder();
// builds all mmap tiles for the specified map id (ignores skip settings)
void buildMap(uint32 mapID);
void buildMeshFromFile(char* name);
// builds an mmap tile for the specified map and its mesh
void buildSingleTile(uint32 mapID, uint32 tileX, uint32 tileY);
// builds list of maps, then builds all of mmap tiles (based on the skip settings)
void buildAllMaps(int threads);
void WorkerThread();
private:
// detect maps and tiles
void discoverTiles();
std::set<uint32>* getTileList(uint32 mapID);
void buildNavMesh(uint32 mapID, dtNavMesh* &navMesh);
void buildTile(uint32 mapID, uint32 tileX, uint32 tileY, dtNavMesh* navMesh);
// move map building
void buildMoveMapTile(uint32 mapID,
uint32 tileX,
uint32 tileY,
MeshData &meshData,
float bmin[3],
float bmax[3],
dtNavMesh* navMesh);
void getTileBounds(uint32 tileX, uint32 tileY,
float* verts, int vertCount,
float* bmin, float* bmax);
void getGridBounds(uint32 mapID, uint32 &minX, uint32 &minY, uint32 &maxX, uint32 &maxY) const;
bool shouldSkipMap(uint32 mapID);
bool isTransportMap(uint32 mapID);
bool shouldSkipTile(uint32 mapID, uint32 tileX, uint32 tileY);
TerrainBuilder* m_terrainBuilder;
TileList m_tiles;
bool m_debugOutput;
const char* m_offMeshFilePath;
bool m_skipContinents;
bool m_skipJunkMaps;
bool m_skipBattlegrounds;
float m_maxWalkableAngle;
bool m_bigBaseUnit;
// build performance - not really used for now
rcContext* m_rcContext;
std::vector<std::thread> _workerThreads;
ProducerConsumerQueue<uint32> _queue;
std::atomic<bool> _cancelationToken;
};
}
#endif
|
/*
* Copyright (c) 2012 cocos2d-x.org
* http://www.cocos2d-x.org
*
* Copyright 2012 Stewart Hamilton-Arrandale.
* http://creativewax.co.uk
*
* Modified by Yannick Loriot.
* http://yannickloriot.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Converted to c++ / cocos2d-x by Angus C
*/
#ifndef __CCCONTROL_COLOUR_PICKER_H__
#define __CCCONTROL_COLOUR_PICKER_H__
#include "CCControl.h"
#include "CCControlUtils.h"
#include "CCControlHuePicker.h"
#include "CCControlSaturationBrightnessPicker.h"
NS_CC_EXT_BEGIN
/**
* @addtogroup GUI
* @{
* @addtogroup control_extension
* @{
*/
class ControlColourPicker: public Control
{
public:
static ControlColourPicker* create();
/**
* @js ctor
*/
ControlColourPicker();
/**
* @js NA
* @lua NA
*/
virtual ~ControlColourPicker();
virtual bool init();
virtual void setColor(const Color3B& colorValue);
virtual void setEnabled(bool bEnabled);
//virtual ~ControlColourPicker();
void hueSliderValueChanged(Object * sender, Control::EventType controlEvent);
void colourSliderValueChanged(Object * sender, Control::EventType controlEvent);
protected:
void updateControlPicker();
void updateHueAndControlPicker();
virtual bool onTouchBegan(Touch* touch, Event* pEvent);
HSV _hsv;
CC_SYNTHESIZE_RETAIN(ControlSaturationBrightnessPicker*, _colourPicker, colourPicker)
CC_SYNTHESIZE_RETAIN(ControlHuePicker*, _huePicker, HuePicker)
CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background)
};
// end of GUI group
/// @}
/// @}
NS_CC_EXT_END
#endif |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <mutex>
#include <jsi/decorator.h>
#include <jsi/jsi.h>
namespace facebook {
namespace jsi {
class ThreadSafeRuntime : public Runtime {
public:
virtual void lock() const = 0;
virtual void unlock() const = 0;
virtual Runtime& getUnsafeRuntime() = 0;
};
namespace detail {
template <typename R, typename L>
struct WithLock {
L lock;
WithLock(R& r) : lock(r) {}
void before() {
lock.lock();
}
void after() {
lock.unlock();
}
};
// The actual implementation of a given ThreadSafeRuntime. It's parameterized
// by:
//
// - R: The actual Runtime type that this wraps
// - L: A lock type that has three members:
// - L(R& r) // ctor
// - void lock()
// - void unlock()
template <typename R, typename L>
class ThreadSafeRuntimeImpl final
: public WithRuntimeDecorator<WithLock<R, L>, R, ThreadSafeRuntime> {
public:
template <typename... Args>
ThreadSafeRuntimeImpl(Args&&... args)
: WithRuntimeDecorator<WithLock<R, L>, R, ThreadSafeRuntime>(
unsafe_,
lock_),
unsafe_(std::forward<Args>(args)...),
lock_(unsafe_) {}
R& getUnsafeRuntime() override {
return WithRuntimeDecorator<WithLock<R, L>, R, ThreadSafeRuntime>::plain();
}
void lock() const override {
lock_.before();
}
void unlock() const override {
lock_.after();
}
private:
R unsafe_;
mutable WithLock<R, L> lock_;
};
} // namespace detail
} // namespace jsi
} // namespace facebook
|
/*
* linux/arch/arm/plat-omap/mux.c
*
* Utility to set the Omap MUX and PULL_DWN registers from a table in mux.h
*
* Copyright (C) 2003 - 2008 Nokia Corporation
*
* Written by Tony Lindgren
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <asm/system.h>
#include <asm/io.h>
#include <linux/spinlock.h>
#include <mach/mux.h>
#ifdef CONFIG_OMAP_MUX
static struct omap_mux_cfg *mux_cfg;
int __init omap_mux_register(struct omap_mux_cfg *arch_mux_cfg)
{
if (!arch_mux_cfg || !arch_mux_cfg->pins || arch_mux_cfg->size == 0
|| !arch_mux_cfg->cfg_reg) {
printk(KERN_ERR "Invalid pin table\n");
return -EINVAL;
}
mux_cfg = arch_mux_cfg;
return 0;
}
/*
* Sets the Omap MUX and PULL_DWN registers based on the table
*/
int __init_or_module omap_cfg_reg(const unsigned long index)
{
struct pin_config *reg;
if (mux_cfg == NULL) {
printk(KERN_ERR "Pin mux table not initialized\n");
return -ENODEV;
}
if (index >= mux_cfg->size) {
printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n",
index, mux_cfg->size);
dump_stack();
return -ENODEV;
}
reg = (struct pin_config *)&mux_cfg->pins[index];
if (!mux_cfg->cfg_reg)
return -ENODEV;
return mux_cfg->cfg_reg(reg);
}
EXPORT_SYMBOL(omap_cfg_reg);
#else
#define omap_mux_init() do {} while(0)
#define omap_cfg_reg(x) do {} while(0)
#endif /* CONFIG_OMAP_MUX */
|
#pragma once
struct SceScreenShotParam
{
vm::lcptr<char> photoTitle;
vm::lcptr<char> gameTitle;
vm::lcptr<char> gameComment;
vm::lptr<void> reserved;
};
extern psv_log_base sceScreenShot;
|
// @(#)root/meta:$Id$
// Author: Rene Brun 04/02/95
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TDataType
#define ROOT_TDataType
//////////////////////////////////////////////////////////////////////////
// //
// TDataType //
// //
// Basic data type descriptor (datatype information is obtained from //
// CINT). //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TDictionary
#include "TDictionary.h"
#endif
enum EDataType {
kChar_t = 1, kUChar_t = 11, kShort_t = 2, kUShort_t = 12,
kInt_t = 3, kUInt_t = 13, kLong_t = 4, kULong_t = 14,
kFloat_t = 5, kDouble_t = 8, kDouble32_t = 9, kchar = 10,
kBool_t = 18, kLong64_t = 16, kULong64_t = 17, kOther_t = -1,
kNoType_t = 0, kFloat16_t= 19,
kCounter = 6, kCharStar = 7, kBits = 15 /* for compatibility with TStreamerInfo */,
kVoid_t = 20,
kDataTypeAliasUnsigned_t = 21,
kDataTypeAliasSignedChar_t = 22,
// could add "long int" etc
kNumDataTypes
};
class TDataType : public TDictionary {
private:
TypedefInfo_t *fInfo; //!pointer to CINT typedef info
Int_t fSize; //size of type
EDataType fType; //type id
Long_t fProperty; //The property information for the (potential) underlying class
TString fTrueName; //Qualified name of the (potential) underlying class, e.g. "MyClass*const*"
Int_t fTypeNameIdx; //Start of class name part of the (potential) underlying class in fTrueName
Int_t fTypeNameLen; //Strlen of class name part of the (potential) underlying class in fTrueName
static TDataType* fgBuiltins[kNumDataTypes]; //Array of builtins
void CheckInfo();
void SetType(const char *name);
protected:
TDataType(const TDataType&);
TDataType& operator=(const TDataType&);
public:
TDataType(TypedefInfo_t *info = 0);
TDataType(const char *typenam);
virtual ~TDataType();
Int_t Size() const;
Int_t GetType() const { return (Int_t)fType; }
TString GetTypeName();
const char *GetFullTypeName() const;
const char *AsString(void *buf) const;
Long_t Property() const;
static const char *GetTypeName(EDataType type);
static TDataType *GetDataType(EDataType type);
static EDataType GetType(const type_info &typeinfo);
static void AddBuiltins(TCollection* types);
ClassDef(TDataType,2) //Basic data type descriptor
};
#endif
|
/* Copyright 2019 The TensorFlow 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 TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_EAGER_DESTROY_TENSOR_HANDLE_NODE_H_
#define TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_EAGER_DESTROY_TENSOR_HANDLE_NODE_H_
#include "tensorflow/core/common_runtime/eager/context.h"
#include "tensorflow/core/common_runtime/eager/eager_executor.h"
#include "tensorflow/core/distributed_runtime/eager/eager_client.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/protobuf/eager_service.pb.h"
namespace tensorflow {
namespace eager {
// DestroyTensorHandleNode is an implementation of EagerNode which enqueues a
// request to destroy a remote tensor handle.
class DestroyTensorHandleNode : public tensorflow::AsyncEagerNode {
public:
DestroyTensorHandleNode(std::unique_ptr<EnqueueRequest> request,
core::RefCountPtr<EagerClient> eager_client,
bool ready)
: tensorflow::AsyncEagerNode(),
request_(std::move(request)),
eager_client_(std::move(eager_client)),
ready_(ready) {}
~DestroyTensorHandleNode() override {}
void RunAsync(StatusCallback done) override {
EnqueueResponse* response = new EnqueueResponse;
bool ready = ready_;
// NOTE(fishx): Don't use StreamingEnqueueAsync here. When a
// StreamingEnqueueAsync request fails all following requests will fail as
// well. We don't want this request poison following requests since it is
// safe to ignore a failing destroy tensor handle request.
eager_client_->EnqueueAsync(
/*call_opts=*/nullptr, request_.get(), response,
[response, ready, done](const tensorflow::Status& s) {
// Omit the warning if:
// 1. The remote tensor isn't ready.
// 2. Lost connection to remote worker. In this case client will
// crash. We don't want to spam user with redundant warning logs.
if (!s.ok() && ready && s.code() != errors::Code::UNAVAILABLE) {
LOG_EVERY_N_SEC(WARNING, 60)
<< "Ignoring an error encountered when deleting "
"remote tensors handles: "
<< s.ToString();
}
done(Status::OK());
delete response;
});
}
void Abort(Status status) override {}
// Remote node deletions are best effort
bool Fatal() const override { return false; }
string DebugString() const override {
string out = "[DestroyTensorHandleNode]";
strings::StrAppend(&out, " request: ", request_->DebugString());
return out;
}
private:
std::unique_ptr<EnqueueRequest> request_;
core::RefCountPtr<EagerClient> eager_client_;
const string remote_task_;
bool ready_;
};
} // namespace eager
} // namespace tensorflow
#endif // TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_EAGER_DESTROY_TENSOR_HANDLE_NODE_H_
|
// Copyright 2011 Google Inc. 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 NINJA_DISK_INTERFACE_H_
#define NINJA_DISK_INTERFACE_H_
#include <map>
#include <string>
using namespace std;
#include "timestamp.h"
/// Interface for accessing the disk.
///
/// Abstract so it can be mocked out for tests. The real implementation
/// is RealDiskInterface.
struct DiskInterface {
virtual ~DiskInterface() {}
/// stat() a file, returning the mtime, or 0 if missing and -1 on
/// other errors.
virtual TimeStamp Stat(const string& path, string* err) const = 0;
/// Create a directory, returning false on failure.
virtual bool MakeDir(const string& path) = 0;
/// Create a file, with the specified name and contents
/// Returns true on success, false on failure
virtual bool WriteFile(const string& path, const string& contents) = 0;
/// Read a file to a string. Fill in |err| on error.
virtual string ReadFile(const string& path, string* err) = 0;
/// Remove the file named @a path. It behaves like 'rm -f path' so no errors
/// are reported if it does not exists.
/// @returns 0 if the file has been removed,
/// 1 if the file does not exist, and
/// -1 if an error occurs.
virtual int RemoveFile(const string& path) = 0;
/// Create all the parent directories for path; like mkdir -p
/// `basename path`.
bool MakeDirs(const string& path);
};
/// Implementation of DiskInterface that actually hits the disk.
struct RealDiskInterface : public DiskInterface {
RealDiskInterface()
#ifdef _WIN32
: use_cache_(false)
#endif
{}
virtual ~RealDiskInterface() {}
virtual TimeStamp Stat(const string& path, string* err) const;
virtual bool MakeDir(const string& path);
virtual bool WriteFile(const string& path, const string& contents);
virtual string ReadFile(const string& path, string* err);
virtual int RemoveFile(const string& path);
/// Whether stat information can be cached. Only has an effect on Windows.
void AllowStatCache(bool allow);
private:
#ifdef _WIN32
/// Whether stat information can be cached.
bool use_cache_;
typedef map<string, TimeStamp> DirCache;
// TODO: Neither a map nor a hashmap seems ideal here. If the statcache
// works out, come up with a better data structure.
typedef map<string, DirCache> Cache;
mutable Cache cache_;
#endif
};
#endif // NINJA_DISK_INTERFACE_H_
|
// Copyright 2014 Zwopple Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import <Foundation/Foundation.h>
#import "PSWebSocketTypes.h"
typedef NS_ENUM(NSInteger, PSWebSocketReadyState) {
PSWebSocketReadyStateConnecting = 0,
PSWebSocketReadyStateOpen,
PSWebSocketReadyStateClosing,
PSWebSocketReadyStateClosed
};
@class PSWebSocket;
/**
* PSWebSocketDelegate
*/
@protocol PSWebSocketDelegate <NSObject>
@required
- (void)webSocketDidOpen:(PSWebSocket *)webSocket;
- (void)webSocket:(PSWebSocket *)webSocket didFailWithError:(NSError *)error;
- (void)webSocket:(PSWebSocket *)webSocket didReceiveMessage:(id)message;
- (void)webSocket:(PSWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean;
@end
/**
* PSWebSocket
*/
@interface PSWebSocket : NSObject
#pragma mark - Class Methods
/**
* Given a NSURLRequest determine if it is a websocket request based on it's headers
*
* @param request request to check
*
* @return whether or not the given request is a websocket request
*/
+ (BOOL)isWebSocketRequest:(NSURLRequest *)request;
#pragma mark - Properties
@property (nonatomic, assign, readonly) PSWebSocketReadyState readyState;
@property (nonatomic, weak) id <PSWebSocketDelegate> delegate;
@property (nonatomic, strong) dispatch_queue_t delegateQueue;
#pragma mark - Initialization
/**
* Initialize a PSWebSocket instance in client mode.
*
* @param request that is to be used to initiate the handshake
*
* @return an initialized instance of PSWebSocket in client mode
*/
+ (instancetype)clientSocketWithRequest:(NSURLRequest *)request;
/**
* Initialize a PSWebSocket instance in server mode
*
* @param request request that is to be used to initiate the handshake response
* @param inputStream opened input stream to be taken over by the websocket
* @param outputStream opened output stream to be taken over by the websocket
*
* @return an initialized instance of PSWebSocket in server mode
*/
+ (instancetype)serverSocketWithRequest:(NSURLRequest *)request inputStream:(NSInputStream *)inputStream outputStream:(NSOutputStream *)outputStream;
#pragma mark - Actions
/**
* Opens the websocket connection and initiates the handshake. Once
* opened an instance of PSWebSocket can never be opened again. The
* connection obeys any timeout interval set on the NSURLRequest used
* to initialize the websocket.
*/
- (void)open;
/**
* Send a message over the websocket
*
* @param message an instance of NSData or NSString to send
*/
- (void)send:(id)message;
/**
* Send a ping over the websocket
*
* @param pingData data to include with the ping
* @param handler optional callback handler when the corrosponding pong is received
*/
- (void)ping:(NSData *)pingData handler:(void (^)(NSData *pongData))handler;
/**
* Close the websocket will default to code 1000 and nil reason
*/
- (void)close;
/**
* Close the websocket with a specific code and/or reason
*
* @param code close code reason
* @param reason short textual reason why the connection was closed
*/
- (void)closeWithCode:(NSInteger)code reason:(NSString *)reason;
#pragma mark - Stream Properties
/**
* Copy a property from the streams this websocket is backed by
*
* @param key property key - see kCFStreamProperty constants
*
* @return property value
*/
- (CFTypeRef)copyStreamPropertyForKey:(NSString *)key;
/**
* Set a property on the streams this websocket is backed by. Calling this
* method once the websocket has been opened will raise an exception.
*
* @param property property value
* @param key property key - see kCFStreamProperty constants
*/
- (void)setStreamProperty:(CFTypeRef)property forKey:(NSString *)key;
@end
|
//===-- popcountti2.c - Implement __popcountti2
//----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements __popcountti2 for the compiler_rt library.
//
//===----------------------------------------------------------------------===//
#include "int_lib.h"
#ifdef CRT_HAS_128BIT
// Returns: count of 1 bits
COMPILER_RT_ABI int __popcountti2(ti_int a) {
tu_int x3 = (tu_int)a;
x3 = x3 - ((x3 >> 1) &
(((tu_int)0x5555555555555555uLL << 64) | 0x5555555555555555uLL));
// Every 2 bits holds the sum of every pair of bits (64)
x3 = ((x3 >> 2) &
(((tu_int)0x3333333333333333uLL << 64) | 0x3333333333333333uLL)) +
(x3 & (((tu_int)0x3333333333333333uLL << 64) | 0x3333333333333333uLL));
// Every 4 bits holds the sum of every 4-set of bits (3 significant bits) (32)
x3 = (x3 + (x3 >> 4)) &
(((tu_int)0x0F0F0F0F0F0F0F0FuLL << 64) | 0x0F0F0F0F0F0F0F0FuLL);
// Every 8 bits holds the sum of every 8-set of bits (4 significant bits) (16)
du_int x2 = (du_int)(x3 + (x3 >> 64));
// Every 8 bits holds the sum of every 8-set of bits (5 significant bits) (8)
su_int x = (su_int)(x2 + (x2 >> 32));
// Every 8 bits holds the sum of every 8-set of bits (6 significant bits) (4)
x = x + (x >> 16);
// Every 8 bits holds the sum of every 8-set of bits (7 significant bits) (2)
//
// Upper 16 bits are garbage
return (x + (x >> 8)) & 0xFF; // (8 significant bits)
}
#endif // CRT_HAS_128BIT
|
#ifndef CLI_H
#define CLI_H
#define MAX_CMD_HISTORY 64
#define COMMAND_DELIM " \t\n" // Whitespace delimiters
#define MAX_COMMAND_ARGS 40
struct cli_command {
struct list_head list;
char *command;
};
extern void clear_screen(void);
extern int mygetkey(clock_t timeout);
extern const char *edit_cmdline(const char *input, int top /*, int width */ ,
int (*pDraw_Menu) (int, int, int),
void (*show_fkey) (int), bool *);
extern struct menu *root_menu, *start_menu, *hide_menu, *menu_list, *default_menu;
#endif
|
#ifndef __LINUX_WAIT_H__
#define __LINUX_WAIT_H__
typedef struct { } wait_queue_head_t;
#define init_waitqueue_head(wait) do{} while (0)
#define add_wait_queue(wait,new_wait) do{} while (0)
#define remove_wait_queue(wait,old_wait) do{} while (0)
#define DECLARE_WAITQUEUE(wait,current) do{} while (0)
static inline void wake_up(wait_queue_head_t *erase_wait) { }
#endif /* __LINUX_WAIT_H__ */
|
/***************************************************************************/
/* */
/* pfrdrivr.c */
/* */
/* FreeType PFR driver interface (body). */
/* */
/* Copyright 2002, 2003, 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_SERVICE_PFR_H
#include FT_SERVICE_XFREE86_NAME_H
#include "pfrdrivr.h"
#include "pfrobjs.h"
#include "pfrerror.h"
FT_CALLBACK_DEF( FT_Error )
pfr_get_kerning( FT_Face pfrface, /* PFR_Face */
FT_UInt left,
FT_UInt right,
FT_Vector *avector )
{
PFR_Face face = (PFR_Face)pfrface;
PFR_PhyFont phys = &face->phy_font;
pfr_face_get_kerning( pfrface, left, right, avector );
/* convert from metrics to outline units when necessary */
if ( phys->outline_resolution != phys->metrics_resolution )
{
if ( avector->x != 0 )
avector->x = FT_MulDiv( avector->x, phys->outline_resolution,
phys->metrics_resolution );
if ( avector->y != 0 )
avector->y = FT_MulDiv( avector->x, phys->outline_resolution,
phys->metrics_resolution );
}
return PFR_Err_Ok;
}
/*
* PFR METRICS SERVICE
*
*/
FT_CALLBACK_DEF( FT_Error )
pfr_get_advance( FT_Face pfrface, /* PFR_Face */
FT_UInt gindex,
FT_Pos *anadvance )
{
PFR_Face face = (PFR_Face)pfrface;
FT_Error error = PFR_Err_Bad_Argument;
*anadvance = 0;
if ( face )
{
PFR_PhyFont phys = &face->phy_font;
if ( gindex < phys->num_chars )
{
*anadvance = phys->chars[gindex].advance;
error = 0;
}
}
return error;
}
FT_CALLBACK_DEF( FT_Error )
pfr_get_metrics( FT_Face pfrface, /* PFR_Face */
FT_UInt *anoutline_resolution,
FT_UInt *ametrics_resolution,
FT_Fixed *ametrics_x_scale,
FT_Fixed *ametrics_y_scale )
{
PFR_Face face = (PFR_Face)pfrface;
PFR_PhyFont phys = &face->phy_font;
FT_Fixed x_scale, y_scale;
FT_Size size = face->root.size;
if ( anoutline_resolution )
*anoutline_resolution = phys->outline_resolution;
if ( ametrics_resolution )
*ametrics_resolution = phys->metrics_resolution;
x_scale = 0x10000L;
y_scale = 0x10000L;
if ( size )
{
x_scale = FT_DivFix( size->metrics.x_ppem << 6,
phys->metrics_resolution );
y_scale = FT_DivFix( size->metrics.y_ppem << 6,
phys->metrics_resolution );
}
if ( ametrics_x_scale )
*ametrics_x_scale = x_scale;
if ( ametrics_y_scale )
*ametrics_y_scale = y_scale;
return PFR_Err_Ok;
}
FT_CALLBACK_TABLE_DEF
const FT_Service_PfrMetricsRec pfr_metrics_service_rec =
{
pfr_get_metrics,
pfr_face_get_kerning,
pfr_get_advance
};
/*
* SERVICE LIST
*
*/
static const FT_ServiceDescRec pfr_services[] =
{
{ FT_SERVICE_ID_PFR_METRICS, &pfr_metrics_service_rec },
{ FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PFR },
{ NULL, NULL }
};
FT_CALLBACK_DEF( FT_Module_Interface )
pfr_get_service( FT_Module module,
const FT_String* service_id )
{
FT_UNUSED( module );
return ft_service_list_lookup( pfr_services, service_id );
}
FT_CALLBACK_TABLE_DEF
const FT_Driver_ClassRec pfr_driver_class =
{
{
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_SCALABLE,
sizeof( FT_DriverRec ),
"pfr",
0x10000L,
0x20000L,
NULL,
0,
0,
pfr_get_service
},
sizeof( PFR_FaceRec ),
sizeof( PFR_SizeRec ),
sizeof( PFR_SlotRec ),
pfr_face_init,
pfr_face_done,
0, /* FT_Size_InitFunc */
0, /* FT_Size_DoneFunc */
pfr_slot_init,
pfr_slot_done,
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
ft_stub_set_char_sizes,
ft_stub_set_pixel_sizes,
#endif
pfr_slot_load,
pfr_get_kerning,
0, /* FT_Face_AttachFunc */
0, /* FT_Face_GetAdvancesFunc */
0, /* FT_Size_RequestFunc */
0, /* FT_Size_SelectFunc */
};
/* END */
|
//
// SimpleAuthSingleSignOnProvider.h
// SimpleAuth
//
// Created by Julien Seren-Rosso on 14/02/2014.
// Copyright (c) 2014 Byliner, Inc. All rights reserved.
//
@protocol SimpleAuthSingleSignOnProvider <NSObject>
- (BOOL)handleCallback:(NSURL *)URL;
@end
|
// 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_OMNIBOX_OMNIBOX_POPUP_MODEL_H_
#define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_MODEL_H_
#include "base/basictypes.h"
#include "chrome/browser/autocomplete/autocomplete_controller.h"
#include "chrome/browser/autocomplete/autocomplete_result.h"
#include "chrome/browser/ui/omnibox/omnibox_edit_model.h"
class OmniboxPopupView;
namespace gfx {
class Image;
}
class OmniboxPopupModel {
public:
// See selected_line_state_ for details.
enum LineState {
NORMAL = 0,
KEYWORD
};
OmniboxPopupModel(OmniboxPopupView* popup_view, OmniboxEditModel* edit_model);
~OmniboxPopupModel();
// Returns true if the popup is currently open.
bool IsOpen() const;
OmniboxPopupView* view() const { return view_; }
// Returns the AutocompleteController used by this popup.
AutocompleteController* autocomplete_controller() const {
return edit_model_->autocomplete_controller();
}
const AutocompleteResult& result() const {
return autocomplete_controller()->result();
}
size_t hovered_line() const { return hovered_line_; }
// Call to change the hovered line. |line| should be within the range of
// valid lines (to enable hover) or kNoMatch (to disable hover).
void SetHoveredLine(size_t line);
size_t selected_line() const { return selected_line_; }
LineState selected_line_state() const { return selected_line_state_; }
// Call to change the selected line. This will update all state and repaint
// the necessary parts of the window, as well as updating the edit with the
// new temporary text. |line| will be clamped to the range of valid lines.
// |reset_to_default| is true when the selection is being reset back to the
// default match, and thus there is no temporary text (and no
// |manually_selected_match_|). If |force| is true then the selected line will
// be updated forcibly even if the |line| is same as the current selected
// line.
// NOTE: This assumes the popup is open, and thus both old and new values for
// the selected line should not be kNoMatch.
void SetSelectedLine(size_t line, bool reset_to_default, bool force);
// Called when the user hits escape after arrowing around the popup. This
// will change the selected line back to the default match and redraw.
void ResetToDefaultMatch();
// Immediately updates and opens the popup if necessary, then moves the
// current selection down (|count| > 0) or up (|count| < 0), clamping to the
// first or last result if necessary. If |count| == 0, the selection will be
// unchanged, but the popup will still redraw and modify the text in the
// OmniboxEditModel.
void Move(int count);
// If the selected line has both a normal match and a keyword match, this can
// be used to choose which to select. It is an error to call this when the
// selected line does not have both matches (or there is no selection).
void SetSelectedLineState(LineState state);
// Called when the user hits shift-delete. This should determine if the item
// can be removed from history, and if so, remove it and update the popup.
void TryDeletingCurrentItem();
// If |match| is from an extension, returns the extension icon; otherwise
// returns an empty Image.
gfx::Image GetIconIfExtensionMatch(const AutocompleteMatch& match) const;
// The match the user has manually chosen, if any.
const AutocompleteResult::Selection& manually_selected_match() const {
return manually_selected_match_;
}
// Invoked from the edit model any time the result set of the controller
// changes.
void OnResultChanged();
// The token value for selected_line_, hover_line_ and functions dealing with
// a "line number" that indicates "no line".
static const size_t kNoMatch;
private:
OmniboxPopupView* view_;
OmniboxEditModel* edit_model_;
// The line that's currently hovered. If we're not drawing a hover rect,
// this will be kNoMatch, even if the cursor is over the popup contents.
size_t hovered_line_;
// The currently selected line. This is kNoMatch when nothing is selected,
// which should only be true when the popup is closed.
size_t selected_line_;
// If the selected line has both a normal match and a keyword match, this
// determines whether the normal match (if NORMAL) or the keyword match
// (if KEYWORD) is selected.
LineState selected_line_state_;
// The match the user has manually chosen, if any.
AutocompleteResult::Selection manually_selected_match_;
DISALLOW_COPY_AND_ASSIGN(OmniboxPopupModel);
};
#endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_MODEL_H_
|
RALINK_REG(0xbe005018)=0x0e0e0e0e;
RALINK_REG(0xbe005048)=0x0000d10d;
RALINK_REG(0xbe0050d8)=0x00100900;
RALINK_REG(0xbe0050f0)=0x00000000;
udelay_a(200*oneusec);
RALINK_REG(0xbe0050e4)=0x000000b3;
udelay_a(500*oneusec);
RALINK_REG(0xbe005090)=0x00000000;
RALINK_REG(0xbe005094)=0x80000000;
RALINK_REG(0xbe0050dc)=0x83000000;
RALINK_REG(0xbe0050e0)=0x14000000;
RALINK_REG(0xbe0050f4)=0x01000000;
RALINK_REG(0xbe0050fc)=0x07100000;
RALINK_REG(0xbe005168)=0x00000080;
RALINK_REG(0xbe005130)=0x30000000;
udelay_a(1*oneusec);
RALINK_REG(0xbe0050d8)=0x00300900;
RALINK_REG(0xbe005004)=0xf07486a1;
RALINK_REG(0xbe0051ec)=0x00000000;
RALINK_REG(0xbe00508c)=0x00000000;
RALINK_REG(0xbe005124)=0x80000000;
RALINK_REG(0xbe005094)=0x00000000;//0x40404040;
RALINK_REG(0xbe0051c0)=0x00000000;
RALINK_REG(0xbe00507c)=0xc2872215;
RALINK_REG(0xbe005028)=0xf1200f01;
RALINK_REG(0xbe005158)=0x00000000;
RALINK_REG(0xbe0051e0)=0x8c000000;
RALINK_REG(0xbe0050e4)=0x000000b7;
udelay_a(2*oneusec);
RALINK_REG(0xbe005110)=0x00051100;
RALINK_REG(0xbe005088)=0x00004010;
RALINK_REG(0xbe0051e4)=0x00000001;
udelay_a(1*oneusec);
RALINK_REG(0xbe0051e4)=0x00000000;
RALINK_REG(0xbe005088)=0x00006000;
RALINK_REG(0xbe0051e4)=0x00000001;
udelay_a(1*oneusec);
RALINK_REG(0xbe0051e4)=0x00000000;
RALINK_REG(0xbe005088)=0x00002040;
RALINK_REG(0xbe0051e4)=0x00000001;
udelay_a(1*oneusec);
RALINK_REG(0xbe0051e4)=0x00000000;
RALINK_REG(0xbe005088)=0x00001b61;
RALINK_REG(0xbe0051e4)=0x00000001;
udelay_a(1*oneusec);
RALINK_REG(0xbe0051e4)=0x00000000;
RALINK_REG(0xbe005088)=0x00000400;
RALINK_REG(0xbe0051e4)=0x00000010;
udelay_a(1*oneusec);
RALINK_REG(0xbe0051e4)=0x00000000;
udelay_a(1*oneusec);
RALINK_REG(0xbe0051e4)=0x00001100;
RALINK_REG(0xbe0050e4)=0x000022b3;
RALINK_REG(0xbe0051e0)=0x8c000000;
RALINK_REG(0xbe00507c)=0xc2872211;//0xc287221d;
RALINK_REG(0xbe0051dc)=0x15602842;
RALINK_REG(0xbe00500c)=0x02000000;
RALINK_REG(0xbe005000)=0x44694683;
RALINK_REG(0xbe005044)=0x9f060481;
RALINK_REG(0xbe0051e8)=0x00000210;
RALINK_REG(0xbe005010)=0x00008888;
RALINK_REG(0xbe0050f8)=0xedcb000f;
RALINK_REG(0xbe0051d8)=0x00c80008;
RALINK_REG(0xbe005008)=0x03046948;
RALINK_REG(0xbe005200)=0x88888888;
RALINK_REG(0xbe005204)=0x88888888;
RALINK_REG(0xbe005208)=0x88888888;
RALINK_REG(0xbe00520c)=0x88888888;
RALINK_REG(0xbe005014)=0x00008888;
|
/*
* YAFFS: Yet another FFS. A NAND-flash specific file system.
*
* Copyright (C) 2002 Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning <charles@aleph1.co.uk>
*
* 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.
*
* $Id: yaffs_tagsvalidity.h,v 1.2 2005/08/11 02:33:03 marty Exp $
*/
//yaffs_tagsvalidity.h
#ifndef __YAFFS_TAGS_VALIDITY_H__
#define __YAFFS_TAGS_VALIDITY_H__
#include "yaffs_guts.h"
void yaffs_InitialiseTags(yaffs_ExtendedTags * tags);
int yaffs_ValidateTags(yaffs_ExtendedTags * tags);
#endif
|
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_ANDROID_VIDEO_RENDER_ANDROID_SURFACE_VIEW_H_
#define WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_ANDROID_VIDEO_RENDER_ANDROID_SURFACE_VIEW_H_
#include <jni.h>
#include "video_render_defines.h"
#include "video_render_android_impl.h"
namespace webrtc {
class CriticalSectionWrapper;
class AndroidSurfaceViewChannel : public AndroidStream {
public:
AndroidSurfaceViewChannel(WebRtc_UWord32 streamId,
JavaVM* jvm,
VideoRenderAndroid& renderer,
jobject javaRenderObj);
~AndroidSurfaceViewChannel();
WebRtc_Word32 Init(WebRtc_Word32 zOrder,
const float left,
const float top,
const float right,
const float bottom);
//Implement VideoRenderCallback
virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId,
VideoFrame& videoFrame);
//Implements AndroidStream
virtual void DeliverFrame(JNIEnv* jniEnv);
private:
WebRtc_UWord32 _id;
CriticalSectionWrapper& _renderCritSect;
VideoFrame _bufferToRender;
VideoRenderAndroid& _renderer;
JavaVM* _jvm;
jobject _javaRenderObj;
jobject _javaByteBufferObj;
unsigned char* _directBuffer;
jmethodID _createByteBufferCid;
jmethodID _drawByteBufferCid;
jmethodID _setCoordinatesCid;
unsigned int _bitmapWidth;
unsigned int _bitmapHeight;
};
class AndroidSurfaceViewRenderer : private VideoRenderAndroid {
public:
AndroidSurfaceViewRenderer(const WebRtc_Word32 id,
const VideoRenderType videoRenderType,
void* window,
const bool fullscreen);
~AndroidSurfaceViewRenderer();
WebRtc_Word32 Init();
virtual AndroidStream* CreateAndroidRenderChannel(
WebRtc_Word32 streamId,
WebRtc_Word32 zOrder,
const float left,
const float top,
const float right,
const float bottom,
VideoRenderAndroid& renderer);
private:
jobject _javaRenderObj;
jclass _javaRenderClass;
};
} // namespace webrtc
#endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_ANDROID_VIDEO_RENDER_ANDROID_SURFACE_VIEW_H_
|
// RUN: %clang -target mipsel-unknown-linux -O3 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=O32
// RUN: %clang -target mips64el-unknown-linux -O3 -S -mabi=n64 -o - -emit-llvm %s | FileCheck %s -check-prefix=N64
// vectors larger than 16-bytes are returned via the hidden pointer argument.
// N64/N32 returns vectors whose size is equal to or smaller than 16-bytes in
// integer registers.
typedef float v4sf __attribute__ ((__vector_size__ (16)));
typedef double v4df __attribute__ ((__vector_size__ (32)));
typedef int v4i32 __attribute__ ((__vector_size__ (16)));
// O32-LABEL: define void @test_v4sf(<4 x float>* noalias nocapture sret
// N64: define inreg { i64, i64 } @test_v4sf
v4sf test_v4sf(float a) {
return (v4sf){0.0f, a, 0.0f, 0.0f};
}
// O32-LABEL: define void @test_v4df(<4 x double>* noalias nocapture sret
// N64-LABEL: define void @test_v4df(<4 x double>* noalias nocapture sret
v4df test_v4df(double a) {
return (v4df){0.0, a, 0.0, 0.0};
}
// O32 returns integer vectors whose size is equal to or smaller than 16-bytes
// in integer registers.
//
// O32: define inreg { i32, i32, i32, i32 } @test_v4i32
// N64: define inreg { i64, i64 } @test_v4i32
v4i32 test_v4i32(int a) {
return (v4i32){0, a, 0, 0};
}
|
/*
* Copyright (c) 2006-2010 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#ifndef B2_TOI_SOLVER_H
#define B2_TOI_SOLVER_H
#include "Box2D/Common/b2Math.h"
class b2Contact;
class b2Body;
struct b2TOIConstraint;
class b2StackAllocator;
/// This is a pure position solver for a single movable body in contact with
/// multiple non-moving bodies.
class b2TOISolver
{
public:
b2TOISolver(b2StackAllocator* allocator);
~b2TOISolver();
void Initialize(b2Contact** contacts, int32 contactCount, b2Body* toiBody);
void Clear();
// Perform one solver iteration. Returns true if converged.
bool Solve(float32 baumgarte);
private:
b2TOIConstraint* m_constraints;
int32 m_count;
b2Body* m_toiBody;
b2StackAllocator* m_allocator;
};
#endif
|
//=================================================================================================
/*!
// \file blazemark/gmm/TSMatTDMatMult.h
// \brief Header file for the GMM++ transpose sparse matrix/transpose dense matrix multiplication kernel
//
// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD 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. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
#ifndef _BLAZEMARK_GMM_TSMATTDMATMULT_H_
#define _BLAZEMARK_GMM_TSMATTDMATMULT_H_
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <blazemark/system/Types.h>
namespace blazemark {
namespace gmm {
//=================================================================================================
//
// KERNEL FUNCTIONS
//
//=================================================================================================
//*************************************************************************************************
/*!\name GMM++ kernel functions */
//@{
double tsmattdmatmult( size_t N, size_t F, size_t steps );
//@}
//*************************************************************************************************
} // namespace gmm
} // namespace blazemark
#endif
|
{- --------------------------------------------------------------------------
// Macros to help make Typeable instances.
//
// INSTANCE_TYPEABLEn(tc,tcname,"tc") defines
//
// instance Typeable/n/ tc
// instance Typeable a => Typeable/n-1/ (tc a)
// instance (Typeable a, Typeable b) => Typeable/n-2/ (tc a b)
// ...
// instance (Typeable a1, ..., Typeable an) => Typeable (tc a1 ... an)
// --------------------------------------------------------------------------
-}
#ifndef TYPEABLE_H
#define TYPEABLE_H
#ifdef __GLASGOW_HASKELL__
-- // For GHC, we can use DeriveDataTypeable + StandaloneDeriving to
-- // generate the instances.
#define INSTANCE_TYPEABLE0(tycon,tcname,str) deriving instance Typeable tycon
#define INSTANCE_TYPEABLE1(tycon,tcname,str) deriving instance Typeable1 tycon
#define INSTANCE_TYPEABLE2(tycon,tcname,str) deriving instance Typeable2 tycon
#define INSTANCE_TYPEABLE3(tycon,tcname,str) deriving instance Typeable3 tycon
#define INSTANCE_TYPEABLE4(tycon,tcname,str) deriving instance Typeable4 tycon
#define INSTANCE_TYPEABLE5(tycon,tcname,str) deriving instance Typeable5 tycon
#define INSTANCE_TYPEABLE6(tycon,tcname,str) deriving instance Typeable6 tycon
#define INSTANCE_TYPEABLE7(tycon,tcname,str) deriving instance Typeable7 tycon
#else /* !__GLASGOW_HASKELL__ */
#define INSTANCE_TYPEABLE0(tycon,tcname,str) \
tcname :: TyCon; \
tcname = mkTyCon str; \
instance Typeable tycon where { typeOf _ = mkTyConApp tcname [] }
#define INSTANCE_TYPEABLE1(tycon,tcname,str) \
tcname = mkTyCon str; \
instance Typeable1 tycon where { typeOf1 _ = mkTyConApp tcname [] }; \
instance Typeable a => Typeable (tycon a) where { typeOf = typeOfDefault }
#define INSTANCE_TYPEABLE2(tycon,tcname,str) \
tcname = mkTyCon str; \
instance Typeable2 tycon where { typeOf2 _ = mkTyConApp tcname [] }; \
instance Typeable a => Typeable1 (tycon a) where { \
typeOf1 = typeOf1Default }; \
instance (Typeable a, Typeable b) => Typeable (tycon a b) where { \
typeOf = typeOfDefault }
#define INSTANCE_TYPEABLE3(tycon,tcname,str) \
tcname = mkTyCon str; \
instance Typeable3 tycon where { typeOf3 _ = mkTyConApp tcname [] }; \
instance Typeable a => Typeable2 (tycon a) where { \
typeOf2 = typeOf2Default }; \
instance (Typeable a, Typeable b) => Typeable1 (tycon a b) where { \
typeOf1 = typeOf1Default }; \
instance (Typeable a, Typeable b, Typeable c) => Typeable (tycon a b c) where { \
typeOf = typeOfDefault }
#define INSTANCE_TYPEABLE4(tycon,tcname,str) \
tcname = mkTyCon str; \
instance Typeable4 tycon where { typeOf4 _ = mkTyConApp tcname [] }; \
instance Typeable a => Typeable3 (tycon a) where { \
typeOf3 = typeOf3Default }; \
instance (Typeable a, Typeable b) => Typeable2 (tycon a b) where { \
typeOf2 = typeOf2Default }; \
instance (Typeable a, Typeable b, Typeable c) => Typeable1 (tycon a b c) where { \
typeOf1 = typeOf1Default }; \
instance (Typeable a, Typeable b, Typeable c, Typeable d) => Typeable (tycon a b c d) where { \
typeOf = typeOfDefault }
#define INSTANCE_TYPEABLE5(tycon,tcname,str) \
tcname = mkTyCon str; \
instance Typeable5 tycon where { typeOf5 _ = mkTyConApp tcname [] }; \
instance Typeable a => Typeable4 (tycon a) where { \
typeOf4 = typeOf4Default }; \
instance (Typeable a, Typeable b) => Typeable3 (tycon a b) where { \
typeOf3 = typeOf3Default }; \
instance (Typeable a, Typeable b, Typeable c) => Typeable2 (tycon a b c) where { \
typeOf2 = typeOf2Default }; \
instance (Typeable a, Typeable b, Typeable c, Typeable d) => Typeable1 (tycon a b c d) where { \
typeOf1 = typeOf1Default }; \
instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e) => Typeable (tycon a b c d e) where { \
typeOf = typeOfDefault }
#define INSTANCE_TYPEABLE6(tycon,tcname,str) \
tcname = mkTyCon str; \
instance Typeable6 tycon where { typeOf6 _ = mkTyConApp tcname [] }; \
instance Typeable a => Typeable5 (tycon a) where { \
typeOf5 = typeOf5Default }; \
instance (Typeable a, Typeable b) => Typeable4 (tycon a b) where { \
typeOf4 = typeOf4Default }; \
instance (Typeable a, Typeable b, Typeable c) => Typeable3 (tycon a b c) where { \
typeOf3 = typeOf3Default }; \
instance (Typeable a, Typeable b, Typeable c, Typeable d) => Typeable2 (tycon a b c d) where { \
typeOf2 = typeOf2Default }; \
instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e) => Typeable1 (tycon a b c d e) where { \
typeOf1 = typeOf1Default }; \
instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e, Typeable f) => Typeable (tycon a b c d e f) where { \
typeOf = typeOfDefault }
#define INSTANCE_TYPEABLE7(tycon,tcname,str) \
tcname = mkTyCon str; \
instance Typeable7 tycon where { typeOf7 _ = mkTyConApp tcname [] }; \
instance Typeable a => Typeable6 (tycon a) where { \
typeOf6 = typeOf6Default }; \
instance (Typeable a, Typeable b) => Typeable5 (tycon a b) where { \
typeOf5 = typeOf5Default }; \
instance (Typeable a, Typeable b, Typeable c) => Typeable4 (tycon a b c) where { \
typeOf4 = typeOf4Default }; \
instance (Typeable a, Typeable b, Typeable c, Typeable d) => Typeable3 (tycon a b c d) where { \
typeOf3 = typeOf3Default }; \
instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e) => Typeable2 (tycon a b c d e) where { \
typeOf2 = typeOf2Default }; \
instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e, Typeable f) => Typeable1 (tycon a b c d e f) where { \
typeOf1 = typeOf1Default }; \
instance (Typeable a, Typeable b, Typeable c, Typeable d, Typeable e, Typeable f, Typeable g) => Typeable (tycon a b c d e f g) where { \
typeOf = typeOfDefault }
#endif /* !__GLASGOW_HASKELL__ */
#endif
|
#pragma once
#include "NativeSubsystem.h"
namespace blackbone
{
/// <summary>
/// X86 OS subsystem. Used
/// </summary>
class x86Native : public Native
{
public:
BLACKBONE_API x86Native( HANDLE hProcess );
BLACKBONE_API ~x86Native();
/// <summary>
/// Query virtual memory
/// </summary>
/// <param name="lpAddress">Address to query</param>
/// <param name="lpBuffer">Retrieved memory info</param>
/// <returns>Status code</returns>
virtual NTSTATUS VirtualQueryExT( ptr_t lpAddress, PMEMORY_BASIC_INFORMATION64 lpBuffer );
/// <summary>
/// Get WOW64 thread context
/// </summary>
/// <param name="hThread">Thread handle.</param>
/// <param name="ctx">Thread context</param>
/// <returns>Status code</returns>
virtual NTSTATUS GetThreadContextT( HANDLE hThread, _CONTEXT32& ctx );
/// <summary>
/// Get native thread context
/// </summary>
/// <param name="hThread">Thread handle.</param>
/// <param name="ctx">Thread context</param>
/// <returns>Status code</returns>
virtual NTSTATUS GetThreadContextT( HANDLE hThread, _CONTEXT64& ctx );
/// <summary>
/// Set WOW64 thread context
/// </summary>
/// <param name="hThread">Thread handle.</param>
/// <param name="ctx">Thread context</param>
/// <returns>Status code</returns>
virtual NTSTATUS SetThreadContextT( HANDLE hThread, _CONTEXT32& ctx );
/// <summary>
/// Set native thread context
/// </summary>
/// <param name="hThread">Thread handle.</param>
/// <param name="ctx">Thread context</param>
/// <returns>Status code</returns>
virtual NTSTATUS SetThreadContextT( HANDLE hThread, _CONTEXT64& ctx );
/// <summary>
/// Gets WOW64 PEB
/// </summary>
/// <param name="ppeb">Retrieved PEB</param>
/// <returns>PEB pointer</returns>
virtual ptr_t getPEB( _PEB32* ppeb );
/// <summary>
/// Get native PEB
/// </summary>
/// <param name="ppeb">Retrieved PEB</param>
/// <returns>PEB pointer</returns>
virtual ptr_t getPEB( _PEB64* ppeb );
/// <summary>
/// Get WOW64 TEB
/// </summary>
/// <param name="ppeb">Retrieved TEB</param>
/// <returns>TEB pointer</returns>
virtual ptr_t getTEB( HANDLE hThread, _TEB32* pteb );
/// <summary>
/// Get native TEB
/// </summary>
/// <param name="ppeb">Retrieved TEB</param>
/// <returns>TEB pointer</returns>
virtual ptr_t getTEB( HANDLE hThread, _TEB64* pteb );
private:
};
} |
#include <limits.h>
#define ACQ_MSGQ_SIZE 600
#define ACQ_MSGQ_SHMKEY 0x39457f73
#define ACQ_MSGQ_SHMPROJID 12345
#define ACQ_MSGQ_SHMPATH "/opt/ctf/bin/Acq"
#define ACQ_BUFFER_SIZE 28160 // this is needed for all other software versions
// #define ACQ_BUFFER_SIZE 40000 // this is needed for software version 6.1.5-el6_7.x86_64-20160720-3344
/*
* See also
* http://www.fieldtriptoolbox.org/development/realtime/ctf#different_software_versions
* http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3185
* https://github.com/fieldtrip/fieldtrip/issues/699
* https://github.com/fieldtrip/fieldtrip/issues/724
*/
typedef enum {
ACQ_MSGQ_SETUP_COLLECTION,
ACQ_MSGQ_DATA,
ACQ_MSGQ_CLOSE_CONNECTION,
ACQ_MSGQ_INVALID = INT_MAX
} ACQ_MessageType;
typedef struct {
ACQ_MessageType message_type;
int messageId;
int sampleNumber;
int numSamples;
int numChannels;
int data[ACQ_BUFFER_SIZE];
} ACQ_MessagePacketType;
|
/*--------------------------------------------------------------------*/
/*--- Basic Mach interface functions mach_basics.c ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright (C) 2005-2017 Apple Inc.
Greg Parker gparker@apple.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
#if defined(VGO_darwin)
#include "pub_core_basics.h"
#include "pub_core_mach.h"
#include <mach/mach.h>
#include <mach/machine/ndr_def.h>
/* From mach_traps-<arch>-darwin.S */
//extern mach_port_name_t host_self_trap(void);
extern mach_port_name_t thread_self_trap(void);
extern mach_port_t mach_reply_port(void);
/* Global variables set in mach_init() */
vm_size_t vm_page_size = 0;
mach_port_name_t mach_task_self_ = 0;
mach_port_name_t mach_thread_self(void)
{
return thread_self_trap();
}
static mach_port_t reply = 0;
mach_port_t mig_get_reply_port(void)
{
if (!reply) reply = mach_reply_port();
return reply;
// GrP fixme is just one enough for valgrind's own use?
// might work if valgrind never blocks in mig calls on
// its own behalf, and doesn't call mig outside the semaphore
}
void mig_dealloc_reply_port(mach_port_t reply_port)
{
}
void mig_put_reply_port(mach_port_t reply_port)
{
}
/* Initialize Mach global data.
Should be called early in main(). */
void VG_(mach_init)(void)
{
reply = 0;
mach_task_self_ = task_self_trap();
// GrP fixme host_page_size(host_self_trap(), &vm_page_size);
vm_page_size = 4096;
}
#endif // defined(VGO_darwin)
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
|
/*
* This file defines the USB charger type and state that are needed for
* USB device APIs.
*/
#ifndef _UAPI__LINUX_USB_CHARGER_H
#define _UAPI__LINUX_USB_CHARGER_H
/*
* USB charger type:
* SDP (Standard Downstream Port)
* DCP (Dedicated Charging Port)
* CDP (Charging Downstream Port)
* ACA (Accessory Charger Adapters)
*/
enum usb_charger_type {
UNKNOWN_TYPE,
SDP_TYPE,
DCP_TYPE,
CDP_TYPE,
ACA_TYPE,
};
/* USB charger state */
enum usb_charger_state {
USB_CHARGER_DEFAULT,
USB_CHARGER_PRESENT,
USB_CHARGER_ABSENT,
};
#endif /* _UAPI__LINUX_USB_CHARGER_H */
|
/* Copyright 2016 The TensorFlow 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.
==============================================================================*/
// Classes to maintain a static registry of whole-graph optimization
// passes to be applied by the Session when it initializes a graph.
#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_OPTIMIZATION_REGISTRY_H_
#define TENSORFLOW_CORE_COMMON_RUNTIME_OPTIMIZATION_REGISTRY_H_
#include <functional>
#include <map>
#include <vector>
#include "tensorflow/core/framework/function.h"
#include "tensorflow/core/graph/costmodel.h"
#include "tensorflow/core/graph/graph.h"
namespace tensorflow {
struct SessionOptions;
// All the parameters used by an optimization pass are packaged in
// this struct. They should be enough for the optimization pass to use
// as a key into a state dictionary if it wants to keep state across
// calls.
struct GraphOptimizationPassOptions {
string session_handle;
const SessionOptions* session_options = nullptr;
const CostModel* cost_model = nullptr;
FunctionLibraryDefinition* flib_def = nullptr; // Not owned.
// The graph to optimize, for optimization passes that run before
// partitioning. Null for post-partitioning passes.
// An optimization pass may replace *graph with a new graph object.
std::unique_ptr<Graph>* graph = nullptr;
// Graphs for each partition, if running post-partitioning. Optimization
// passes may alter the graphs, but must not add or remove partitions.
// Null for pre-partitioning passes.
std::unordered_map<string, std::unique_ptr<Graph>>* partition_graphs =
nullptr;
};
// Optimization passes are implemented by inheriting from
// GraphOptimizationPass.
class GraphOptimizationPass {
public:
virtual ~GraphOptimizationPass() {}
virtual Status Run(const GraphOptimizationPassOptions& options) = 0;
};
// The key is a 'phase' number. Phases are executed in increasing
// order. Within each phase the order of passes is undefined.
typedef std::map<int, std::vector<std::unique_ptr<GraphOptimizationPass>>>
GraphOptimizationPasses;
// A global OptimizationPassRegistry is used to hold all passes.
class OptimizationPassRegistry {
public:
// Groups of passes are run at different points in initialization.
enum Grouping {
PRE_PLACEMENT, // after cost model assignment, before placement.
POST_PLACEMENT, // after placement.
POST_REWRITE_FOR_EXEC, // after re-write using feed/fetch endpoints.
POST_PARTITIONING, // after partitioning
};
// Add an optimization pass to the registry.
void Register(Grouping grouping, int phase,
std::unique_ptr<GraphOptimizationPass> pass);
// Run all passes in grouping, ordered by phase, with the same
// options.
Status RunGrouping(Grouping grouping,
const GraphOptimizationPassOptions& options);
// Returns the global registry of optimization passes.
static OptimizationPassRegistry* Global();
private:
std::map<Grouping, GraphOptimizationPasses> groups_;
};
namespace optimization_registration {
class OptimizationPassRegistration {
public:
OptimizationPassRegistration(OptimizationPassRegistry::Grouping grouping,
int phase,
std::unique_ptr<GraphOptimizationPass> pass) {
OptimizationPassRegistry::Global()->Register(grouping, phase,
std::move(pass));
}
};
} // namespace optimization_registration
#define REGISTER_OPTIMIZATION(grouping, phase, optimization) \
REGISTER_OPTIMIZATION_UNIQ_HELPER(__COUNTER__, grouping, phase, optimization)
#define REGISTER_OPTIMIZATION_UNIQ_HELPER(ctr, grouping, phase, optimization) \
REGISTER_OPTIMIZATION_UNIQ(ctr, grouping, phase, optimization)
#define REGISTER_OPTIMIZATION_UNIQ(ctr, grouping, phase, optimization) \
static optimization_registration::OptimizationPassRegistration \
register_optimization_##ctr( \
grouping, phase, \
std::unique_ptr<GraphOptimizationPass>(new optimization))
} // namespace tensorflow
#endif // TENSORFLOW_CORE_COMMON_RUNTIME_OPTIMIZATION_REGISTRY_H_
|
/**********************************************************************
Audacity: A Digital Audio Editor
MultiFormatReader.h
Philipp Sibler
**********************************************************************/
#ifndef __AUDACITY_MULTIFORMATREADER_H__
#define __AUDACITY_MULTIFORMATREADER_H__
class MachineEndianness
{
public:
typedef enum
{
Little = 0,
Big
} EndiannessT;
MachineEndianness()
{
if (wxBYTE_ORDER == wxLITTLE_ENDIAN)
{
mFlag = MachineEndianness::Little;
}
else
{
mFlag = MachineEndianness::Big;
}
}
~MachineEndianness()
{}
int IsLittle()
{
return (mFlag == MachineEndianness::Little) ? 1 : 0;
}
int IsBig()
{
return (mFlag == MachineEndianness::Big) ? 1 : 0;
}
EndiannessT Which()
{
return mFlag;
}
private:
EndiannessT mFlag;
};
class MultiFormatReader
{
FILE* mpFid;
MachineEndianness mEnd;
uint8_t mSwapBuffer[8];
public:
typedef enum
{
Int8 = 0,
Int16,
Int32,
Uint8,
Uint16,
Uint32,
Float,
Double
} FormatT;
MultiFormatReader(const char* filename);
~MultiFormatReader();
void Reset();
size_t ReadSamples(void* buffer, size_t len,
MultiFormatReader::FormatT format,
MachineEndianness::EndiannessT end);
size_t ReadSamples(void* buffer, size_t len, size_t stride,
MultiFormatReader::FormatT format,
MachineEndianness::EndiannessT end);
private:
size_t Read(void* buffer, size_t size, size_t len, size_t stride);
void SwapBytes(void* buffer, size_t size, size_t len);
};
#endif
|
/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -mavx512er" } */
/* { dg-require-effective-target avx512er } */
#include "avx512er-check.h"
#include <x86intrin.h>
#include <unistd.h>
#include <signal.h>
static int counter;
void handler (int i)
{
exit (0);
}
static void
avx512er_test (void)
{
struct sigaction s;
sigemptyset (&s.sa_mask);
s.sa_handler = handler;
s.sa_flags = 0;
sigaction (SIGFPE, &s, NULL);
__m512 a = _mm512_set1_ps (-1.f);
_mm_setcsr ( _MM_MASK_MASK & ~_MM_MASK_INVALID );
__m512 r1 = _mm512_rsqrt28_round_ps (a, _MM_FROUND_NO_EXC);
__m512 r2 = _mm512_rsqrt28_round_ps (a, _MM_FROUND_CUR_DIRECTION);
if (r1[0] + r2[0])
abort ();
}
|
/**
@file WeakCache.h
@maintainer Morgan McGuire, graphics3d.com
@created 2007-05-16
@edited 2007-05-16
Copyright 2000-2007, Morgan McGuire.
All rights reserved.
*/
#ifndef G3D_WEAKCACHE_H
#define G3D_WEAKCACHE_H
#include "G3D/ReferenceCount.h"
#include "G3D/Table.h"
namespace G3D {
/**
A cache that does not prevent its members from being garbage collected.
Useful to avoid loading or computing an expression twice. Useful
for memoization and dynamic programming.
Maintains a table of weak pointers. Weak pointers do not prevent
an object from being garbage collected. If the object is garbage
collected, the cache removes its reference.
There are no "contains" or "iterate" methods because elements can be
flushed from the cache at any time if they are garbage collected.
Example:
<pre>
WeakCache<std::string, TextureRef> textureCache;
TextureRef loadTexture(std::string s) {
TextureRef t = textureCache[s];
if (t.isNull()) {
t = Texture::fromFile(s);
textureCache.set(s, t);
}
return t;
}
</pre>
*/
template<class Key, class ValueRef>
class WeakCache {
typedef WeakReferenceCountedPointer<typename ValueRef::element_type> ValueWeakRef;
private:
Table<Key, ValueWeakRef> table;
public:
/**
Returns NULL if the object is not in the cache
*/
ValueRef operator[](const Key& k) {
if (table.containsKey(k)) {
ValueWeakRef w = table[k];
ValueRef s = w.createStrongPtr();
if (s.isNull()) {
// This object has been collected; clean out its key
table.remove(k);
}
return s;
} else {
return NULL;
}
}
void set(const Key& k, ValueRef v) {
table.set(k, v);
}
/** Removes k from the cache or does nothing if it is not currently in the cache.*/
void remove(const Key& k) {
if (table.containsKey(k)) {
table.remove(k);
}
}
};
#if 0 // To turn off all WeakCaching
template<class Key, class ValueRef>
class WeakCache {
private:
Table<Key, ValueRef> table;
public:
/**
Returns NULL if the object is not in the cache
*/
ValueRef operator[](const Key& k) {
if (table.containsKey(k)) {
return table[k];
} else {
return NULL;
}
}
void set(const Key& k, ValueRef v) {
table.set(k, v);
}
/** Removes k from the cache or does nothing if it is not currently in the cache.*/
void remove(const Key& k) {
if (table.containsKey(k)) {
table.remove(k);
}
}
};
#endif
}
#endif
|
/* Copyright (C) 1992-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 <errno.h>
#include <sys/socket.h>
#include <hurd.h>
#include <hurd/fd.h>
#include <hurd/socket.h>
#include <string.h>
/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
actual length. Returns 0 on success, -1 for errors. */
/* XXX should be __getsockopt ? */
int
getsockopt (int fd,
int level,
int optname,
void *optval,
socklen_t *optlen)
{
error_t err;
char *buf = optval;
mach_msg_type_number_t buflen = *optlen;
if (err = HURD_DPORT_USE (fd, __socket_getopt (port,
level, optname,
&buf, &buflen)))
return __hurd_dfail (fd, err);
if (*optlen > buflen)
*optlen = buflen;
if (buf != optval)
{
memcpy (optval, buf, *optlen);
__vm_deallocate (__mach_task_self (), (vm_address_t) buf, buflen);
}
return 0;
}
|
/* Copyright (C) 2007-2013 Arjen G Lentz & Antony T Curtis for Open Query
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, 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 */
/* ======================================================================
Open Query Graph Computation Engine, based on a concept by Arjen Lentz
v3 implementation by Antony Curtis, Arjen Lentz, Andrew McDonnell
For more information, documentation, support, enhancement engineering,
see http://openquery.com/graph or contact graph@openquery.com
======================================================================
*/
#ifndef oq_graphcore_h_
#define oq_graphcore_h_
/* #define GRAPHCORE_INTERNAL __attribute__((visibility("hidden"))) */
#define GRAPHCORE_INTERNAL
#include "graphcore-types.h"
namespace open_query
{
class oqgraph_share;
class oqgraph_cursor;
struct row
{
bool latch_indicator;
bool orig_indicator;
bool dest_indicator;
bool weight_indicator;
bool seq_indicator;
bool link_indicator;
int latch;
const char* latchStringValue; // workaround for when latch is a Varchar
int latchStringValueLen;
VertexID orig;
VertexID dest;
EdgeWeight weight;
unsigned seq;
VertexID link;
};
class oqgraph
{
oqgraph_share *const share;
oqgraph_cursor *cursor;
row row_info;
inline oqgraph(oqgraph_share*) throw();
inline ~oqgraph() throw();
public:
// Integer operation flags
enum {
NO_SEARCH = 0,
DIJKSTRAS = 1,
BREADTH_FIRST = 2,
NUM_SEARCH_OP = 3,
ALGORITHM = 0x0ffff,
HAVE_ORIG = 0x10000,
HAVE_DEST = 0x20000,
};
enum error_code
{
OK= 0,
NO_MORE_DATA,
EDGE_NOT_FOUND,
INVALID_WEIGHT,
DUPLICATE_EDGE,
CANNOT_ADD_VERTEX,
CANNOT_ADD_EDGE,
MISC_FAIL
};
struct current_row_st {};
static inline current_row_st current_row()
{ return current_row_st(); }
unsigned vertices_count() const throw();
unsigned edges_count() const throw();
int delete_all(void) throw();
int insert_edge(VertexID, VertexID, EdgeWeight, bool=0) throw();
int modify_edge(VertexID, VertexID, EdgeWeight) throw();
int delete_edge(VertexID, VertexID) throw();
int modify_edge(current_row_st,
VertexID*, VertexID*, EdgeWeight*, bool=0) throw();
int delete_edge(current_row_st) throw();
int replace_edge(VertexID orig, VertexID dest, EdgeWeight weight) throw()
{ return insert_edge(orig, dest, weight, true); }
// Update the retained latch string value, for later retrieval by
// fetch_row() as a workaround for making sure we return the correct
// string to match the latch='' clause
// (This is a hack for mariadb mysql compatibility)
// IT SHOULD ONLY BE CALLED IMMEIDATELY BEFORE search)(
void retainLatchFieldValue(const char *retainedLatch);
int search(int*, VertexID*, VertexID*) throw();
int random(bool) throw();
int fetch_row(row&) throw();
int fetch_row(row&, const void*) throw();
void row_ref(void*) throw();
void init_row_ref(void*) throw();
static oqgraph* create(oqgraph_share*) throw();
static oqgraph_share *create(TABLE*,Field*,Field*,Field*) throw();
THD* get_thd();
void set_thd(THD*);
static void free(oqgraph*) throw();
static void free(oqgraph_share*) throw();
void release_cursor() throw();
static const size_t sizeof_ref;
private:
char *lastRetainedLatch;
};
}
#endif
|
/*
* delaycontrols.h - declaration of DelayControl class.
*
* Copyright (c) 2014 David French <dave/dot/french3/at/googlemail/dot/com>
*
* This file is part of LMMS - http://lmms.io
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#ifndef DELAYCONTROLS_H
#define DELAYCONTROLS_H
#include "EffectControls.h"
#include "Knob.h"
#include "DelayControlsDialog.h"
class DelayEffect;
class DelayControls : public EffectControls
{
Q_OBJECT
public:
DelayControls( DelayEffect* effect );
virtual ~DelayControls()
{
}
virtual void saveSettings( QDomDocument& doc, QDomElement& parent );
virtual void loadSettings( const QDomElement& _this );
inline virtual QString nodeName() const
{
return "Delay";
}
virtual int controlCount(){
return 5;
}
virtual EffectControlDialog* createView()
{
return new DelayControlsDialog( this );
}
float m_outPeakL;
float m_outPeakR;
private slots:
void changeSampleRate();
private:
DelayEffect* m_effect;
TempoSyncKnobModel m_delayTimeModel;
FloatModel m_feedbackModel;
TempoSyncKnobModel m_lfoTimeModel;
TempoSyncKnobModel m_lfoAmountModel;
FloatModel m_outGainModel;
friend class DelayControlsDialog;
friend class DelayEffect;
};
#endif // DELAYCONTROLS_H
|
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
/*!
\file GUIInfoLabel.h
\brief
*/
#include <functional>
#include <string>
#include <vector>
class CGUIListItem;
namespace KODI
{
namespace GUILIB
{
namespace GUIINFO
{
class CGUIInfoLabel
{
public:
CGUIInfoLabel() = default;
CGUIInfoLabel(const std::string &label, const std::string &fallback = "", int context = 0);
void SetLabel(const std::string &label, const std::string &fallback, int context = 0);
/*!
\brief Gets a label (or image) for a given window context from the info manager.
\param contextWindow the context in which to evaluate the expression.
\param preferImage caller is specifically wanting an image rather than a label. Defaults to false.
\param fallback if non-NULL, is set to an alternate value to use should the actual value be not appropriate. Defaults to NULL.
\return label (or image).
*/
const std::string &GetLabel(int contextWindow, bool preferImage = false, std::string *fallback = NULL) const;
/*!
\brief Gets the label and returns it as an int value
\param contextWindow the context in which to evaluate the expression.
\return int value.
\sa GetLabel
*/
int GetIntValue(int contextWindow) const;
/*!
\brief Gets a label (or image) for a given listitem from the info manager.
\param item listitem in question.
\param preferImage caller is specifically wanting an image rather than a label. Defaults to false.
\param fallback if non-NULL, is set to an alternate value to use should the actual value be not appropriate. Defaults to NULL.
\return label (or image).
*/
const std::string &GetItemLabel(const CGUIListItem *item, bool preferImage = false, std::string *fallback = NULL) const;
bool IsConstant() const;
bool IsEmpty() const;
const std::string &GetFallback() const { return m_fallback; };
static std::string GetLabel(const std::string &label, int contextWindow = 0, bool preferImage = false);
static std::string GetItemLabel(const std::string &label, const CGUIListItem *item, bool preferImage = false);
/*!
\brief Replaces instances of $LOCALIZE[number] with the appropriate localized string
\param label text to replace
\return text with any localized strings filled in.
*/
static std::string ReplaceLocalize(const std::string &label);
/*!
\brief Replaces instances of $ADDON[id number] with the appropriate localized addon string
\param label text to replace
\return text with any localized strings filled in.
*/
static std::string ReplaceAddonStrings(std::string &&label);
typedef std::function<std::string(const std::string&)> StringReplacerFunc;
/*!
\brief Replaces instances of $strKeyword[value] with the appropriate resolved string
\param strInput text to replace
\param strKeyword keyword to look for
\param func function that does the actual replacement of each bracketed value found
\param strOutput the output string
\return whether anything has been replaced.
*/
static bool ReplaceSpecialKeywordReferences(const std::string &strInput, const std::string &strKeyword, const StringReplacerFunc &func, std::string &strOutput);
/*!
\brief Replaces instances of $strKeyword[value] with the appropriate resolved string in-place
\param work text to replace in-place
\param strKeyword keyword to look for
\param func function that does the actual replacement of each bracketed value found
\return whether anything has been replaced.
*/
static bool ReplaceSpecialKeywordReferences(std::string &work, const std::string &strKeyword, const StringReplacerFunc &func);
private:
void Parse(const std::string &label, int context);
/*! \brief return (and cache) built label from info portions.
\param rebuild whether we need to rebuild the label
\sa GetLabel, GetItemLabel
*/
const std::string &CacheLabel(bool rebuild) const;
class CInfoPortion
{
public:
CInfoPortion(int info, const std::string &prefix, const std::string &postfix, bool escaped = false);
bool NeedsUpdate(const std::string &label) const;
std::string Get() const;
int m_info;
private:
bool m_escaped;
mutable std::string m_label;
std::string m_prefix;
std::string m_postfix;
};
mutable bool m_dirty = false;
mutable std::string m_label;
std::string m_fallback;
std::vector<CInfoPortion> m_info;
};
} // namespace GUIINFO
} // namespace GUILIB
} // namespace KODI
|
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software 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.
*
* Cleanflight and Betaflight are distributed in the hope that they
* 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 software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "pg/pg.h"
#include "common/time.h"
#include "drivers/rangefinder/rangefinder.h"
#include "sensors/battery.h"
#define RANGEFINDER_HCSR04_TASK_PERIOD_MS 70
typedef struct sonarConfig_s {
ioTag_t triggerTag;
ioTag_t echoTag;
} sonarConfig_t;
PG_DECLARE(sonarConfig_t, sonarConfig);
bool hcsr04Detect(rangefinderDev_t *dev, const sonarConfig_t * sonarConfig);
|
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software 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.
*
* Cleanflight and Betaflight are distributed in the hope that they
* 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 software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
void initLtmTelemetry(void);
void handleLtmTelemetry(void);
void checkLtmTelemetryState(void);
void freeLtmTelemetryPort(void);
void configureLtmTelemetryPort(void);
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/webui/options/options_ui.h"
namespace base {
class DictionaryValue;
class ListValue;
} // namespace base
class AutomaticProfileResetter;
class BrandcodeConfigFetcher;
class ProfileResetter;
class ResettableSettingsSnapshot;
namespace options {
// Handler for both the 'Reset Profile Settings' overlay page and also the
// corresponding banner that is shown at the top of the options page.
class ResetProfileSettingsHandler
: public OptionsPageUIHandler,
public base::SupportsWeakPtr<ResetProfileSettingsHandler> {
public:
ResetProfileSettingsHandler();
virtual ~ResetProfileSettingsHandler();
// OptionsPageUIHandler implementation.
virtual void GetLocalizedValues(
base::DictionaryValue* localized_strings) OVERRIDE;
virtual void InitializeHandler() OVERRIDE;
virtual void InitializePage() OVERRIDE;
virtual void Uninitialize() OVERRIDE;
// WebUIMessageHandler implementation.
virtual void RegisterMessages() OVERRIDE;
private:
// Javascript callback to start clearing data.
void HandleResetProfileSettings(const base::ListValue* value);
// Closes the dialog once all requested settings has been reset.
void OnResetProfileSettingsDone();
// Called when the confirmation box appears.
void OnShowResetProfileDialog(const base::ListValue* value);
// Called when the reset banner is dismissed from the WebUI.
void OnDismissedResetProfileSettingsBanner(const base::ListValue* args);
// Called when BrandcodeConfigFetcher completed fetching settings.
void OnSettingsFetched();
// Resets profile settings to default values. |send_settings| is true if user
// gave his consent to upload broken settings to Google for analysis.
void ResetProfile(bool send_settings);
// Destroyed with the Profile, thus it should outlive us. This will be NULL if
// the underlying profile is off-the-record (e.g. in Guest mode on Chrome OS).
AutomaticProfileResetter* automatic_profile_resetter_;
// Records whether or not the Profile Reset confirmation dialog was opened at
// least once during the lifetime of the settings page.
bool has_shown_confirmation_dialog_;
scoped_ptr<ProfileResetter> resetter_;
scoped_ptr<BrandcodeConfigFetcher> config_fetcher_;
// Snapshot of settings before profile was reseted.
scoped_ptr<ResettableSettingsSnapshot> setting_snapshot_;
// Contains Chrome brand code; empty for organic Chrome.
std::string brandcode_;
DISALLOW_COPY_AND_ASSIGN(ResetProfileSettingsHandler);
};
} // namespace options
#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_RESET_PROFILE_SETTINGS_HANDLER_H_
|
/*
* Copyright 2012-present Pixate, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// NSObject+Swizzle.h
// PXStyleKit
//
// Copyright (c) 2012 Pixate, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSObject (PXSubclass)
+ (void)subclassInstance:(id)object;
@end
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _RAID5_LOG_H
#define _RAID5_LOG_H
extern int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev);
extern void r5l_exit_log(struct r5conf *conf);
extern int r5l_write_stripe(struct r5l_log *log, struct stripe_head *head_sh);
extern void r5l_write_stripe_run(struct r5l_log *log);
extern void r5l_flush_stripe_to_raid(struct r5l_log *log);
extern void r5l_stripe_write_finished(struct stripe_head *sh);
extern int r5l_handle_flush_request(struct r5l_log *log, struct bio *bio);
extern void r5l_quiesce(struct r5l_log *log, int quiesce);
extern bool r5l_log_disk_error(struct r5conf *conf);
extern bool r5c_is_writeback(struct r5l_log *log);
extern int
r5c_try_caching_write(struct r5conf *conf, struct stripe_head *sh,
struct stripe_head_state *s, int disks);
extern void
r5c_finish_stripe_write_out(struct r5conf *conf, struct stripe_head *sh,
struct stripe_head_state *s);
extern void r5c_release_extra_page(struct stripe_head *sh);
extern void r5c_use_extra_page(struct stripe_head *sh);
extern void r5l_wake_reclaim(struct r5l_log *log, sector_t space);
extern void r5c_handle_cached_data_endio(struct r5conf *conf,
struct stripe_head *sh, int disks);
extern int r5c_cache_data(struct r5l_log *log, struct stripe_head *sh);
extern void r5c_make_stripe_write_out(struct stripe_head *sh);
extern void r5c_flush_cache(struct r5conf *conf, int num);
extern void r5c_check_stripe_cache_usage(struct r5conf *conf);
extern void r5c_check_cached_full_stripe(struct r5conf *conf);
extern struct md_sysfs_entry r5c_journal_mode;
extern void r5c_update_on_rdev_error(struct mddev *mddev,
struct md_rdev *rdev);
extern bool r5c_big_stripe_cached(struct r5conf *conf, sector_t sect);
extern struct dma_async_tx_descriptor *
ops_run_partial_parity(struct stripe_head *sh, struct raid5_percpu *percpu,
struct dma_async_tx_descriptor *tx);
extern int ppl_init_log(struct r5conf *conf);
extern void ppl_exit_log(struct r5conf *conf);
extern int ppl_write_stripe(struct r5conf *conf, struct stripe_head *sh);
extern void ppl_write_stripe_run(struct r5conf *conf);
extern void ppl_stripe_write_finished(struct stripe_head *sh);
extern int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add);
static inline bool raid5_has_ppl(struct r5conf *conf)
{
return test_bit(MD_HAS_PPL, &conf->mddev->flags);
}
static inline int log_stripe(struct stripe_head *sh, struct stripe_head_state *s)
{
struct r5conf *conf = sh->raid_conf;
if (conf->log) {
if (!test_bit(STRIPE_R5C_CACHING, &sh->state)) {
/* writing out phase */
if (s->waiting_extra_page)
return 0;
return r5l_write_stripe(conf->log, sh);
} else if (test_bit(STRIPE_LOG_TRAPPED, &sh->state)) {
/* caching phase */
return r5c_cache_data(conf->log, sh);
}
} else if (raid5_has_ppl(conf)) {
return ppl_write_stripe(conf, sh);
}
return -EAGAIN;
}
static inline void log_stripe_write_finished(struct stripe_head *sh)
{
struct r5conf *conf = sh->raid_conf;
if (conf->log)
r5l_stripe_write_finished(sh);
else if (raid5_has_ppl(conf))
ppl_stripe_write_finished(sh);
}
static inline void log_write_stripe_run(struct r5conf *conf)
{
if (conf->log)
r5l_write_stripe_run(conf->log);
else if (raid5_has_ppl(conf))
ppl_write_stripe_run(conf);
}
static inline void log_exit(struct r5conf *conf)
{
if (conf->log)
r5l_exit_log(conf);
else if (raid5_has_ppl(conf))
ppl_exit_log(conf);
}
static inline int log_init(struct r5conf *conf, struct md_rdev *journal_dev,
bool ppl)
{
if (journal_dev)
return r5l_init_log(conf, journal_dev);
else if (ppl)
return ppl_init_log(conf);
return 0;
}
static inline int log_modify(struct r5conf *conf, struct md_rdev *rdev, bool add)
{
if (raid5_has_ppl(conf))
return ppl_modify_log(conf, rdev, add);
return 0;
}
#endif
|
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
//
// Scenario2_Polling.xaml.h
// Declaration of the Scenario2_Polling class
//
#pragma once
#include "pch.h"
#include "Scenario2_Polling.g.h"
#include "MainPage.xaml.h"
namespace SimpleOrientationCPP
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
[Windows::Foundation::Metadata::WebHostHidden]
public ref class Scenario2_Polling sealed
{
public:
Scenario2_Polling();
protected:
virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
private:
SDKTemplate::MainPage^ rootPage;
Windows::Devices::Sensors::SimpleOrientationSensor^ sensor;
void DisplayOrientation(Windows::Devices::Sensors::SimpleOrientation orientation);
void ScenarioGet(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
};
} |
/****************************************************************************
* Copyright (c) 2006-2010,2012 Free Software Foundation, 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, distribute with modifications, 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 ABOVE 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. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
/****************************************************************************
* Author: Thomas E. Dickey 2006 *
****************************************************************************/
/* $Id: nc_tparm.h,v 1.6 2012/02/18 21:34:42 tom Exp $ */
#ifndef NC_TPARM_included
#define NC_TPARM_included 1
/*
* Cast parameters past the formatting-string for tparm() to match the
* assumption of the varargs code.
*/
#ifndef TPARM_ARG
#ifdef NCURSES_TPARM_ARG
#define TPARM_ARG NCURSES_TPARM_ARG
#else
#define TPARM_ARG long
#endif
#endif /* TPARAM_ARG */
#define TPARM_N(n) (TPARM_ARG)(n)
#define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j))
#if NCURSES_TPARM_VARARGS
#define TPARM_8(a,b,c,d,e,f,g,h,i) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i))
#define TPARM_7(a,b,c,d,e,f,g,h) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h))
#define TPARM_6(a,b,c,d,e,f,g) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g))
#define TPARM_5(a,b,c,d,e,f) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f))
#define TPARM_4(a,b,c,d,e) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e))
#define TPARM_3(a,b,c,d) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d))
#define TPARM_2(a,b,c) tparm(a,TPARM_N(b),TPARM_N(c))
#define TPARM_1(a,b) tparm(a,TPARM_N(b))
#define TPARM_0(a) tparm(a)
#else
#define TPARM_8(a,b,c,d,e,f,g,h,i) TPARM_9(a,b,c,d,e,f,g,h,i,0)
#define TPARM_7(a,b,c,d,e,f,g,h) TPARM_8(a,b,c,d,e,f,g,h,0)
#define TPARM_6(a,b,c,d,e,f,g) TPARM_7(a,b,c,d,e,f,g,0)
#define TPARM_5(a,b,c,d,e,f) TPARM_6(a,b,c,d,e,f,0)
#define TPARM_4(a,b,c,d,e) TPARM_5(a,b,c,d,e,0)
#define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0)
#define TPARM_2(a,b,c) TPARM_3(a,b,c,0)
#define TPARM_1(a,b) TPARM_2(a,b,0)
#define TPARM_1(a,b) TPARM_2(a,b,0)
#define TPARM_0(a) TPARM_1(a,0)
#endif
#endif /* NC_TPARM_included */
|
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1994 - 2001 by Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
*/
#ifndef _ASM_PGALLOC_H
#define _ASM_PGALLOC_H
#include <linux/config.h>
#include <linux/mm.h>
#include <asm/fixmap.h>
/* TLB flushing:
*
* - flush_tlb_all() flushes all processes TLB entries
* - flush_tlb_mm(mm) flushes the specified mm context TLB entries
* - flush_tlb_page(mm, vmaddr) flushes a single page
* - flush_tlb_range(mm, start, end) flushes a range of pages
* - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
* - flush_tlb_one(page) flushes a single kernel page
*/
extern void local_flush_tlb_all(void);
extern void local_flush_tlb_mm(struct mm_struct *mm);
extern void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
unsigned long end);
extern void local_flush_tlb_page(struct vm_area_struct *vma,
unsigned long page);
extern void local_flush_tlb_one(unsigned long page);
#ifdef CONFIG_SMP
extern void flush_tlb_all(void);
extern void flush_tlb_mm(struct mm_struct *);
extern void flush_tlb_range(struct mm_struct *, unsigned long, unsigned long);
extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
#else /* CONFIG_SMP */
#define flush_tlb_all() local_flush_tlb_all()
#define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
#define flush_tlb_range(mm,vmaddr,end) local_flush_tlb_range(mm, vmaddr, end)
#define flush_tlb_page(vma,page) local_flush_tlb_page(vma, page)
#endif /* CONFIG_SMP */
static inline void flush_tlb_pgtables(struct mm_struct *mm,
unsigned long start, unsigned long end)
{
/* Nothing to do on MIPS. */
}
/*
* Allocate and free page tables.
*/
#define pgd_quicklist (current_cpu_data.pgd_quick)
#define pmd_quicklist ((unsigned long *)0)
#define pte_quicklist (current_cpu_data.pte_quick)
#define pgtable_cache_size (current_cpu_data.pgtable_cache_sz)
#define pmd_populate(mm, pmd, pte) pmd_set(pmd, pte)
/*
* Initialize new page directory with pointers to invalid ptes
*/
extern void pgd_init(unsigned long page);
static __inline__ pgd_t *get_pgd_slow(void)
{
pgd_t *ret = (pgd_t *)__get_free_pages(GFP_KERNEL, PGD_ORDER), *init;
if (ret) {
init = pgd_offset(&init_mm, 0);
pgd_init((unsigned long)ret);
memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
}
return ret;
}
static __inline__ pgd_t *get_pgd_fast(void)
{
unsigned long *ret;
if((ret = pgd_quicklist) != NULL) {
pgd_quicklist = (unsigned long *)(*ret);
ret[0] = ret[1];
pgtable_cache_size--;
} else
ret = (unsigned long *)get_pgd_slow();
return (pgd_t *)ret;
}
static __inline__ void free_pgd_fast(pgd_t *pgd)
{
*(unsigned long *)pgd = (unsigned long) pgd_quicklist;
pgd_quicklist = (unsigned long *) pgd;
pgtable_cache_size++;
}
static __inline__ void free_pgd_slow(pgd_t *pgd)
{
free_pages((unsigned long)pgd, PGD_ORDER);
}
static __inline__ pte_t *get_pte_fast(void)
{
unsigned long *ret;
if((ret = (unsigned long *)pte_quicklist) != NULL) {
pte_quicklist = (unsigned long *)(*ret);
ret[0] = ret[1];
pgtable_cache_size--;
}
return (pte_t *)ret;
}
static __inline__ void free_pte_fast(pte_t *pte)
{
*(unsigned long *)pte = (unsigned long) pte_quicklist;
pte_quicklist = (unsigned long *) pte;
pgtable_cache_size++;
}
static __inline__ void free_pte_slow(pte_t *pte)
{
free_page((unsigned long)pte);
}
/* We don't use pmd cache, so these are dummy routines */
static __inline__ pmd_t *get_pmd_fast(void)
{
return (pmd_t *)0;
}
static __inline__ void free_pmd_fast(pmd_t *pmd)
{
}
static __inline__ void free_pmd_slow(pmd_t *pmd)
{
}
extern void __bad_pte(pmd_t *pmd);
static inline pte_t *pte_alloc_one(struct mm_struct *mm, unsigned long address)
{
pte_t *pte;
pte = (pte_t *) __get_free_page(GFP_KERNEL);
if (pte)
clear_page(pte);
return pte;
}
static inline pte_t *pte_alloc_one_fast(struct mm_struct *mm, unsigned long address)
{
unsigned long *ret;
if ((ret = (unsigned long *)pte_quicklist) != NULL) {
pte_quicklist = (unsigned long *)(*ret);
ret[0] = ret[1];
pgtable_cache_size--;
}
return (pte_t *)ret;
}
static __inline__ void pte_free_fast(pte_t *pte)
{
*(unsigned long *)pte = (unsigned long) pte_quicklist;
pte_quicklist = (unsigned long *) pte;
pgtable_cache_size++;
}
static __inline__ void pte_free_slow(pte_t *pte)
{
free_page((unsigned long)pte);
}
#define pte_free(pte) pte_free_fast(pte)
#define pgd_free(pgd) free_pgd_fast(pgd)
#define pgd_alloc(mm) get_pgd_fast()
/*
* allocating and freeing a pmd is trivial: the 1-entry pmd is
* inside the pgd, so has no extra memory associated with it.
*/
#define pmd_alloc_one_fast(mm, addr) ({ BUG(); ((pmd_t *)1); })
#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
#define pmd_free(x) do { } while (0)
#define pgd_populate(mm, pmd, pte) BUG()
extern int do_check_pgt_cache(int, int);
#endif /* _ASM_PGALLOC_H */
|
/*
* (C) Copyright 2007 Semihalf
*
* Written by: Rafal Jaworowski <raj@semihalf.com>
*
* 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
*
*/
/*
* This is the header file for conveniency wrapper routines (API glue)
*/
#ifndef _API_GLUE_H_
#define _API_GLUE_H_
#define API_SEARCH_START (255 * 1024 * 1024) /* start at 1MB below top RAM */
#define API_SEARCH_END (256 * 1024 * 1024 - 1) /* ...and search to the end */
int syscall(int, int *, ...);
void * syscall_ptr;
int api_search_sig(struct api_signature **sig);
/*
* ub_ library calls are part of the application, not U-Boot code! They are
* front-end wrappers that are used by the consumer application: they prepare
* arguments for particular syscall and jump to the low level syscall()
*/
/* console */
int ub_getc(void);
int ub_tstc(void);
void ub_putc(char c);
void ub_puts(const char *s);
/* system */
void ub_reset(void);
struct sys_info * ub_get_sys_info(void);
/* time */
void ub_udelay(unsigned long);
unsigned long ub_get_timer(unsigned long);
/* env vars */
char * ub_env_get(const char *name);
void ub_env_set(const char *name, char *value);
const char * ub_env_enum(const char *last);
/* devices */
int ub_dev_enum(void);
int ub_dev_open(int handle);
int ub_dev_close(int handle);
int ub_dev_read(int handle, void *buf,
lbasize_t len, lbastart_t start);
int ub_dev_send(int handle, void *buf, int len);
int ub_dev_recv(int handle, void *buf, int len);
struct device_info * ub_dev_get(int);
#endif /* _API_GLUE_H_ */
|
/* Copyright 2017 The TensorFlow 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 TENSORFLOW_COMPILER_XLA_CLIENT_LIB_ARITHMETIC_H_
#define TENSORFLOW_COMPILER_XLA_CLIENT_LIB_ARITHMETIC_H_
#include <memory>
#include "tensorflow/compiler/xla/client/computation.h"
#include "tensorflow/compiler/xla/client/computation_builder.h"
#include "tensorflow/compiler/xla/xla_data.pb.h"
namespace xla {
// Creates a scalar add computation and returns it.
Computation CreateScalarAddComputation(PrimitiveType type,
ComputationBuilder* builder);
// Creates a scalar multiply computation and returns it.
Computation CreateScalarMultiplyComputation(PrimitiveType type,
ComputationBuilder* builder);
// Creates a scalar ge computation and returns it.
Computation CreateScalarGeComputation(PrimitiveType type,
ComputationBuilder* builder);
// Creates a scalar max computation and returns it.
Computation CreateScalarMaxComputation(PrimitiveType type,
ComputationBuilder* builder);
// Creates a scalar min computation and returns it.
Computation CreateScalarMinComputation(PrimitiveType type,
ComputationBuilder* builder);
// Creates a scalar logical AND computation and returns it.
Computation CreateScalarAndComputation(ComputationBuilder* builder);
// Creates a scalar logical OR computation and returns it.
Computation CreateScalarOrComputation(ComputationBuilder* builder);
// Returns whether any predicate in "predicates" is set.
//
// Note: if predicates is zero-sized, Any() vacuously returns false.
StatusOr<ComputationDataHandle> Any(const ComputationDataHandle& predicates,
ComputationBuilder* builder);
} // namespace xla
#endif // TENSORFLOW_COMPILER_XLA_CLIENT_LIB_ARITHMETIC_H_
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_MEDIA_WEBAUDIOSOURCEPROVIDER_IMPL_H_
#define CONTENT_RENDERER_MEDIA_WEBAUDIOSOURCEPROVIDER_IMPL_H_
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "content/common/content_export.h"
#include "media/base/audio_renderer_sink.h"
#include "third_party/WebKit/public/platform/WebAudioSourceProvider.h"
#include "third_party/WebKit/public/platform/WebVector.h"
namespace blink {
class WebAudioSourceProviderClient;
}
namespace content {
// WebAudioSourceProviderImpl provides a bridge between classes:
// blink::WebAudioSourceProvider <---> media::AudioRendererSink
//
// WebAudioSourceProviderImpl wraps an existing audio sink that is used unless
// WebKit has set a client via setClient(). While a client is set WebKit will
// periodically call provideInput() to render a certain number of audio
// sample-frames using the sink's RenderCallback to get the data.
//
// All calls are protected by a lock.
class CONTENT_EXPORT WebAudioSourceProviderImpl
: NON_EXPORTED_BASE(public blink::WebAudioSourceProvider),
NON_EXPORTED_BASE(public media::AudioRendererSink) {
public:
explicit WebAudioSourceProviderImpl(
const scoped_refptr<media::AudioRendererSink>& sink);
// blink::WebAudioSourceProvider implementation.
virtual void setClient(blink::WebAudioSourceProviderClient* client);
virtual void provideInput(const blink::WebVector<float*>& audio_data,
size_t number_of_frames);
// media::AudioRendererSink implementation.
virtual void Start() OVERRIDE;
virtual void Stop() OVERRIDE;
virtual void Play() OVERRIDE;
virtual void Pause() OVERRIDE;
virtual bool SetVolume(double volume) OVERRIDE;
virtual void Initialize(const media::AudioParameters& params,
RenderCallback* renderer) OVERRIDE;
protected:
virtual ~WebAudioSourceProviderImpl();
private:
// Calls setFormat() on |client_| from the Blink renderer thread.
void OnSetFormat();
base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_this_;
// Closure that posts a task to call OnSetFormat() on the renderer thread.
base::Closure set_format_cb_;
// Set to true when Initialize() is called.
int channels_;
int sample_rate_;
double volume_;
// Tracks the current playback state.
enum PlaybackState { kStopped, kStarted, kPlaying };
PlaybackState state_;
// Where audio comes from.
media::AudioRendererSink::RenderCallback* renderer_;
// When set via setClient() it overrides |sink_| for consuming audio.
blink::WebAudioSourceProviderClient* client_;
// Where audio ends up unless overridden by |client_|.
base::Lock sink_lock_;
scoped_refptr<media::AudioRendererSink> sink_;
scoped_ptr<media::AudioBus> bus_wrapper_;
DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl);
};
} // namespace content
#endif // CONTENT_RENDERER_MEDIA_WEBAUDIOSOURCEPROVIDER_IMPL_H_
|
// SPDX-License-Identifier: GPL-2.0
/*
* VFIO based Physical Subchannel device driver
*
* Copyright IBM Corp. 2017
*
* Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
* Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/uuid.h>
#include <linux/mdev.h>
#include <asm/isc.h>
#include "ioasm.h"
#include "css.h"
#include "vfio_ccw_private.h"
struct workqueue_struct *vfio_ccw_work_q;
/*
* Helpers
*/
int vfio_ccw_sch_quiesce(struct subchannel *sch)
{
struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev);
DECLARE_COMPLETION_ONSTACK(completion);
int iretry, ret = 0;
spin_lock_irq(sch->lock);
if (!sch->schib.pmcw.ena)
goto out_unlock;
ret = cio_disable_subchannel(sch);
if (ret != -EBUSY)
goto out_unlock;
do {
iretry = 255;
ret = cio_cancel_halt_clear(sch, &iretry);
while (ret == -EBUSY) {
/*
* Flush all I/O and wait for
* cancel/halt/clear completion.
*/
private->completion = &completion;
spin_unlock_irq(sch->lock);
wait_for_completion_timeout(&completion, 3*HZ);
spin_lock_irq(sch->lock);
private->completion = NULL;
flush_workqueue(vfio_ccw_work_q);
ret = cio_cancel_halt_clear(sch, &iretry);
};
ret = cio_disable_subchannel(sch);
} while (ret == -EBUSY);
out_unlock:
private->state = VFIO_CCW_STATE_NOT_OPER;
spin_unlock_irq(sch->lock);
return ret;
}
static void vfio_ccw_sch_io_todo(struct work_struct *work)
{
struct vfio_ccw_private *private;
struct irb *irb;
private = container_of(work, struct vfio_ccw_private, io_work);
irb = &private->irb;
if (scsw_is_solicited(&irb->scsw)) {
cp_update_scsw(&private->cp, &irb->scsw);
cp_free(&private->cp);
}
memcpy(private->io_region.irb_area, irb, sizeof(*irb));
if (private->io_trigger)
eventfd_signal(private->io_trigger, 1);
if (private->mdev)
private->state = VFIO_CCW_STATE_IDLE;
}
/*
* Css driver callbacks
*/
static void vfio_ccw_sch_irq(struct subchannel *sch)
{
struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev);
inc_irq_stat(IRQIO_CIO);
vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_INTERRUPT);
}
static int vfio_ccw_sch_probe(struct subchannel *sch)
{
struct pmcw *pmcw = &sch->schib.pmcw;
struct vfio_ccw_private *private;
int ret;
if (pmcw->qf) {
dev_warn(&sch->dev, "vfio: ccw: does not support QDIO: %s\n",
dev_name(&sch->dev));
return -ENODEV;
}
private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA);
if (!private)
return -ENOMEM;
private->sch = sch;
dev_set_drvdata(&sch->dev, private);
spin_lock_irq(sch->lock);
private->state = VFIO_CCW_STATE_NOT_OPER;
sch->isc = VFIO_CCW_ISC;
ret = cio_enable_subchannel(sch, (u32)(unsigned long)sch);
spin_unlock_irq(sch->lock);
if (ret)
goto out_free;
ret = vfio_ccw_mdev_reg(sch);
if (ret)
goto out_disable;
INIT_WORK(&private->io_work, vfio_ccw_sch_io_todo);
atomic_set(&private->avail, 1);
private->state = VFIO_CCW_STATE_STANDBY;
return 0;
out_disable:
cio_disable_subchannel(sch);
out_free:
dev_set_drvdata(&sch->dev, NULL);
kfree(private);
return ret;
}
static int vfio_ccw_sch_remove(struct subchannel *sch)
{
struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev);
vfio_ccw_sch_quiesce(sch);
vfio_ccw_mdev_unreg(sch);
dev_set_drvdata(&sch->dev, NULL);
kfree(private);
return 0;
}
static void vfio_ccw_sch_shutdown(struct subchannel *sch)
{
vfio_ccw_sch_quiesce(sch);
}
/**
* vfio_ccw_sch_event - process subchannel event
* @sch: subchannel
* @process: non-zero if function is called in process context
*
* An unspecified event occurred for this subchannel. Adjust data according
* to the current operational state of the subchannel. Return zero when the
* event has been handled sufficiently or -EAGAIN when this function should
* be called again in process context.
*/
static int vfio_ccw_sch_event(struct subchannel *sch, int process)
{
struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev);
unsigned long flags;
int rc = -EAGAIN;
spin_lock_irqsave(sch->lock, flags);
if (!device_is_registered(&sch->dev))
goto out_unlock;
if (work_pending(&sch->todo_work))
goto out_unlock;
if (cio_update_schib(sch)) {
vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER);
rc = 0;
goto out_unlock;
}
private = dev_get_drvdata(&sch->dev);
if (private->state == VFIO_CCW_STATE_NOT_OPER) {
private->state = private->mdev ? VFIO_CCW_STATE_IDLE :
VFIO_CCW_STATE_STANDBY;
}
rc = 0;
out_unlock:
spin_unlock_irqrestore(sch->lock, flags);
return rc;
}
static struct css_device_id vfio_ccw_sch_ids[] = {
{ .match_flags = 0x1, .type = SUBCHANNEL_TYPE_IO, },
{ /* end of list */ },
};
MODULE_DEVICE_TABLE(css, vfio_ccw_sch_ids);
static struct css_driver vfio_ccw_sch_driver = {
.drv = {
.name = "vfio_ccw",
.owner = THIS_MODULE,
},
.subchannel_type = vfio_ccw_sch_ids,
.irq = vfio_ccw_sch_irq,
.probe = vfio_ccw_sch_probe,
.remove = vfio_ccw_sch_remove,
.shutdown = vfio_ccw_sch_shutdown,
.sch_event = vfio_ccw_sch_event,
};
static int __init vfio_ccw_sch_init(void)
{
int ret;
vfio_ccw_work_q = create_singlethread_workqueue("vfio-ccw");
if (!vfio_ccw_work_q)
return -ENOMEM;
isc_register(VFIO_CCW_ISC);
ret = css_driver_register(&vfio_ccw_sch_driver);
if (ret) {
isc_unregister(VFIO_CCW_ISC);
destroy_workqueue(vfio_ccw_work_q);
}
return ret;
}
static void __exit vfio_ccw_sch_exit(void)
{
css_driver_unregister(&vfio_ccw_sch_driver);
isc_unregister(VFIO_CCW_ISC);
destroy_workqueue(vfio_ccw_work_q);
}
module_init(vfio_ccw_sch_init);
module_exit(vfio_ccw_sch_exit);
MODULE_LICENSE("GPL v2");
|
/* Defined in scandir.c. */
|
#if defined __GNUC__
#warning use "ruby/st.h" instead of bare "st.h"
#elif defined _MSC_VER
#pragma message("warning: use \"ruby/st.h\" instead of bare \"st.h\"")
#endif
#include "ruby/st.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 CHROME_BROWSER_NET_CHROME_NET_LOG_H_
#define CHROME_BROWSER_NET_CHROME_NET_LOG_H_
#include "base/atomicops.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/synchronization/lock.h"
#include "net/base/net_log.h"
namespace net {
class NetLogLogger;
class TraceNetLogObserver;
}
class NetLogTempFile;
// ChromeNetLog is an implementation of NetLog that adds file loggers
// as its observers.
class ChromeNetLog : public net::NetLog {
public:
ChromeNetLog();
virtual ~ChromeNetLog();
NetLogTempFile* net_log_temp_file() {
return net_log_temp_file_.get();
}
private:
scoped_ptr<net::NetLogLogger> net_log_logger_;
scoped_ptr<NetLogTempFile> net_log_temp_file_;
scoped_ptr<net::TraceNetLogObserver> trace_net_log_observer_;
DISALLOW_COPY_AND_ASSIGN(ChromeNetLog);
};
#endif // CHROME_BROWSER_NET_CHROME_NET_LOG_H_
|
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
*
* 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 MBEDTLS_SHA512_ALT_H
#define MBEDTLS_SHA512_ALT_H
#include "mbedtls/sha512.h"
#if defined(MBEDTLS_SHA512_ALT)
#include "sha_alt_hw.h"
#include "sha512_alt_sw.h"
#ifdef __cplusplus
extern "C" {
#endif
struct mbedtls_sha512_context_s;
/**
* \brief SHA-512 context structure
*/
typedef struct mbedtls_sha512_context_s {
void *active_ctx;
crypto_sha_context hw_ctx;
mbedtls_sha512_sw_context sw_ctx;
}
mbedtls_sha512_context;
/**
* \brief Initialize SHA-512 context
*
* \param ctx SHA-512 context to be initialized
*/
void mbedtls_sha512_init( mbedtls_sha512_context *ctx );
/**
* \brief Clear SHA-512 context
*
* \param ctx SHA-512 context to be cleared
*/
void mbedtls_sha512_free( mbedtls_sha512_context *ctx );
/**
* \brief Clone (the state of) a SHA-512 context
*
* \param dst The destination context
* \param src The context to be cloned
*/
void mbedtls_sha512_clone( mbedtls_sha512_context *dst,
const mbedtls_sha512_context *src );
/**
* \brief SHA-512 context setup
*
* \param ctx context to be initialized
* \param is384 0 = use SHA512, 1 = use SHA384
*
* \returns error code
*/
int mbedtls_sha512_starts_ret( mbedtls_sha512_context *ctx, int is384 );
/**
* \brief SHA-512 process buffer
*
* \param ctx SHA-512 context
* \param input buffer holding the data
* \param ilen length of the input data
*
* \returns error code
*/
int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx, const unsigned char *input,
size_t ilen );
/**
* \brief SHA-512 final digest
*
* \param ctx SHA-512 context
* \param output SHA-384/512 checksum result
*
* \returns error code
*/
int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx, unsigned char output[64] );
/* Internal use */
int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx, const unsigned char data[128] );
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
#if defined(MBEDTLS_DEPRECATED_WARNING)
#define MBEDTLS_DEPRECATED __attribute__((deprecated))
#else
#define MBEDTLS_DEPRECATED
#endif
/**
* \brief This function starts a SHA-384 or SHA-512 checksum
* calculation.
*
* \deprecated Superseded by mbedtls_sha512_starts_ret() in 2.7.0
*
* \param ctx The SHA-512 context to initialize.
* \param is384 Determines which function to use.
* <ul><li>0: Use SHA-512.</li>
* <li>1: Use SHA-384.</li></ul>
*/
MBEDTLS_DEPRECATED void mbedtls_sha512_starts( mbedtls_sha512_context *ctx,
int is384 );
/**
* \brief This function feeds an input buffer into an ongoing
* SHA-512 checksum calculation.
*
* \deprecated Superseded by mbedtls_sha512_update_ret() in 2.7.0
*
* \param ctx The SHA-512 context.
* \param input The buffer holding the data.
* \param ilen The length of the input data.
*/
MBEDTLS_DEPRECATED void mbedtls_sha512_update( mbedtls_sha512_context *ctx,
const unsigned char *input,
size_t ilen );
/**
* \brief This function finishes the SHA-512 operation, and writes
* the result to the output buffer.
*
* \deprecated Superseded by mbedtls_sha512_finish_ret() in 2.7.0
*
* \param ctx The SHA-512 context.
* \param output The SHA-384 or SHA-512 checksum result.
*/
MBEDTLS_DEPRECATED void mbedtls_sha512_finish( mbedtls_sha512_context *ctx,
unsigned char output[64] );
/**
* \brief This function processes a single data block within
* the ongoing SHA-512 computation. This function is for
* internal use only.
*
* \deprecated Superseded by mbedtls_internal_sha512_process() in 2.7.0
*
* \param ctx The SHA-512 context.
* \param data The buffer holding one block of data.
*/
MBEDTLS_DEPRECATED void mbedtls_sha512_process( mbedtls_sha512_context *ctx,
const unsigned char data[128] );
#undef MBEDTLS_DEPRECATED
#endif /* !MBEDTLS_DEPRECATED_REMOVED */
#ifdef __cplusplus
}
#endif
#endif /* MBEDTLS_SHA512_ALT */
#endif /* sha512_alt.h */
|
/*
This code has been taken from meterpreter and modified to be integrated into pupy.
original code :https://github.com/rapid7/metasploit-payloads/blob/master/c/meterpreter/source/common/arch/win/i386/
Meterpreter is available for use under the following license, commonly known as the
3-clause (or "modified") BSD license:
=========================================================================================
Meterpreter
-----------
Copyright (c) 2006-2013, Rapid7 Inc
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of Rapid7 nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//===============================================================================================//
#ifndef _METERPRETER_BASE_INJECT_H
#define _METERPRETER_BASE_INJECT_H
//===============================================================================================//
// These are defined in the stdapi projects ps.h file. We should put them somewhere more generic so we dont dup them here.
#define PROCESS_ARCH_UNKNOWN 0
#define PROCESS_ARCH_X86 1
#define PROCESS_ARCH_X64 2
#define PROCESS_ARCH_IA64 3
// The three injection techniques currently supported.
#define MIGRATE_TECHNIQUE_REMOTETHREAD 0
#define MIGRATE_TECHNIQUE_REMOTETHREADWOW64 1
#define MIGRATE_TECHNIQUE_APCQUEUE 2
extern const DWORD dwPupyArch;
//===============================================================================================//
// Definition of ntdll!NtQueueApcThread
typedef NTSTATUS (NTAPI * NTQUEUEAPCTHREAD)( HANDLE hThreadHandle, LPVOID lpApcRoutine, LPVOID lpApcRoutineContext, LPVOID lpApcStatusBlock, LPVOID lpApcReserved );
// Definitions used for running native x64 code from a wow64 process (see executex64.asm)
typedef BOOL (WINAPI * X64FUNCTION)( DWORD dwParameter );
typedef DWORD (WINAPI * EXECUTEX64)( X64FUNCTION pFunction, DWORD dwParameter );
//===============================================================================================//
// The context used for injection via migrate_via_apcthread
typedef struct _APCCONTEXT
{
union
{
LPVOID lpStartAddress;
BYTE bPadding1[8];
} s;
union
{
LPVOID lpParameter;
BYTE bPadding2[8];
} p;
BYTE bExecuted;
} APCCONTEXT, * LPAPCCONTEXT;
// The context used for injection via migrate_via_remotethread_wow64
typedef struct _WOW64CONTEXT
{
union
{
HANDLE hProcess;
BYTE bPadding2[8];
} h;
union
{
LPVOID lpStartAddress;
BYTE bPadding1[8];
} s;
union
{
LPVOID lpParameter;
BYTE bPadding2[8];
} p;
union
{
HANDLE hThread;
BYTE bPadding2[8];
} t;
} WOW64CONTEXT, * LPWOW64CONTEXT;
//===============================================================================================//
DWORD inject_via_apcthread(HANDLE hProcess, DWORD dwProcessID, DWORD dwDestinationArch, LPVOID lpStartAddress, LPVOID lpParameter);
DWORD inject_via_remotethread(HANDLE hProcess, DWORD dwDestinationArch, LPVOID lpStartAddress, LPVOID lpParameter);
DWORD inject_via_remotethread_wow64(HANDLE hProcess, LPVOID lpStartAddress, LPVOID lpParameter, HANDLE * pThread);
DWORD inject_dll(DWORD dwPid, LPVOID lpDllBuffer, DWORD dwDllLenght, char * cpCommandLine);
//===============================================================================================//
#endif
//===============================================================================================//
|
/****************************************************************************
* Copyright (C) 2003-2006 by XGI Technology, Taiwan.
*
* 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 on 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
* NON-INFRINGEMENT. IN NO EVENT SHALL XGI AND/OR
* ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
***************************************************************************/
#ifndef _XGI_DRM_H_
#define _XGI_DRM_H_
#include <linux/types.h>
#include <asm/ioctl.h>
struct drm_xgi_sarea {
__u16 device_id;
__u16 vendor_id;
char device_name[32];
unsigned int scrn_start;
unsigned int scrn_xres;
unsigned int scrn_yres;
unsigned int scrn_bpp;
unsigned int scrn_pitch;
};
struct xgi_bootstrap {
/**
* Size of PCI-e GART range in megabytes.
*/
struct drm_map gart;
};
enum xgi_mem_location {
XGI_MEMLOC_NON_LOCAL = 0,
XGI_MEMLOC_LOCAL = 1,
XGI_MEMLOC_INVALID = 0x7fffffff
};
struct xgi_mem_alloc {
/**
* Memory region to be used for allocation.
*
* Must be one of XGI_MEMLOC_NON_LOCAL or XGI_MEMLOC_LOCAL.
*/
unsigned int location;
/**
* Number of bytes request.
*
* On successful allocation, set to the actual number of bytes
* allocated.
*/
unsigned int size;
/**
* Address of the memory from the graphics hardware's point of view.
*/
__u32 hw_addr;
/**
* Offset of the allocation in the mapping.
*/
__u32 offset;
/**
* Magic handle used to release memory.
*
* See also DRM_XGI_FREE ioctl.
*/
__u32 index;
};
enum xgi_batch_type {
BTYPE_2D = 0,
BTYPE_3D = 1,
BTYPE_FLIP = 2,
BTYPE_CTRL = 3,
BTYPE_NONE = 0x7fffffff
};
struct xgi_cmd_info {
__u32 type;
__u32 hw_addr;
__u32 size;
__u32 id;
};
struct xgi_state_info {
unsigned int _fromState;
unsigned int _toState;
};
/*
* Ioctl definitions
*/
#define DRM_XGI_BOOTSTRAP 0
#define DRM_XGI_ALLOC 1
#define DRM_XGI_FREE 2
#define DRM_XGI_SUBMIT_CMDLIST 3
#define DRM_XGI_STATE_CHANGE 4
#define DRM_XGI_SET_FENCE 5
#define DRM_XGI_WAIT_FENCE 6
#define XGI_IOCTL_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_XGI_BOOTSTRAP, struct xgi_bootstrap)
#define XGI_IOCTL_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_XGI_ALLOC, struct xgi_mem_alloc)
#define XGI_IOCTL_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_XGI_FREE, __u32)
#define XGI_IOCTL_SUBMIT_CMDLIST DRM_IOW(DRM_COMMAND_BASE + DRM_XGI_SUBMIT_CMDLIST, struct xgi_cmd_info)
#define XGI_IOCTL_STATE_CHANGE DRM_IOW(DRM_COMMAND_BASE + DRM_XGI_STATE_CHANGE, struct xgi_state_info)
#define XGI_IOCTL_SET_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XGI_SET_FENCE, u32)
#define XGI_IOCTL_WAIT_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XGI_WAIT_FENCE, u32)
#endif /* _XGI_DRM_H_ */
|
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <netdb.h>
#define LOOKUP_TYPE struct protoent
#define FUNCTION_NAME getprotobynumber
#define DATABASE_NAME protocols
#define ADD_PARAMS int proto
#define ADD_VARIABLES proto
#define BUFLEN 1024
#include "../nss/getXXbyYY.c"
|
#include "config.h"
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <libsmbclient.h>
#include "get_auth_data_fn.h"
int main(int argc, char * argv[])
{
int debug = 0;
char m_time[32];
char c_time[32];
char a_time[32];
const char * pSmbPath = NULL;
time_t t = time(NULL);
struct stat st;
struct utimbuf utimbuf;
if (argc == 1)
{
pSmbPath = "smb://RANDOM/Public/small";
}
else if (argc == 2)
{
pSmbPath = argv[1];
}
else if (argc == 3)
{
pSmbPath = argv[1];
t = (time_t) strtol(argv[2], NULL, 10);
}
else
{
printf("usage: "
"%s [ smb://path/to/file [ mtime ] ]\n",
argv[0]);
return 1;
}
smbc_init(get_auth_data_fn, debug);
if (smbc_stat(pSmbPath, &st) < 0)
{
perror("smbc_stat");
return 1;
}
printf("Before\n mtime:%lu/%s ctime:%lu/%s atime:%lu/%s\n",
st.st_mtime, ctime_r(&st.st_mtime, m_time),
st.st_ctime, ctime_r(&st.st_ctime, c_time),
st.st_atime, ctime_r(&st.st_atime, a_time));
utimbuf.actime = t; /* unchangable (wont change) */
utimbuf.modtime = t; /* this one should succeed */
if (smbc_utime(pSmbPath, &utimbuf) < 0)
{
perror("smbc_utime");
return 1;
}
if (smbc_stat(pSmbPath, &st) < 0)
{
perror("smbc_stat");
return 1;
}
printf("After\n mtime:%lu/%s ctime:%lu/%s atime:%lu/%s\n",
st.st_mtime, ctime_r(&st.st_mtime, m_time),
st.st_ctime, ctime_r(&st.st_ctime, c_time),
st.st_atime, ctime_r(&st.st_atime, a_time));
return 0;
}
|
/*
* LIRC base driver
*
* by Artur Lipowski <alipowski@interia.pl>
* This code is licensed under GNU GPL
*
*/
#ifndef _LINUX_LIRC_DEV_H
#define _LINUX_LIRC_DEV_H
#define MAX_IRCTL_DEVICES 8
#define BUFLEN 16
#define mod(n, div) ((n) % (div))
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/ioctl.h>
#include <linux/poll.h>
#include <linux/kfifo.h>
#include <media/lirc.h>
struct lirc_buffer {
wait_queue_head_t wait_poll;
spinlock_t fifo_lock;
unsigned int chunk_size;
unsigned int size; /* in chunks */
/* Using chunks instead of bytes pretends to simplify boundary checking
* And should allow for some performance fine tunning later */
struct kfifo fifo;
u8 fifo_initialized;
};
static inline void lirc_buffer_clear(struct lirc_buffer *buf)
{
unsigned long flags;
if (buf->fifo_initialized) {
spin_lock_irqsave(&buf->fifo_lock, flags);
kfifo_reset(&buf->fifo);
spin_unlock_irqrestore(&buf->fifo_lock, flags);
} else
WARN(1, "calling %s on an uninitialized lirc_buffer\n",
__func__);
}
static inline int lirc_buffer_init(struct lirc_buffer *buf,
unsigned int chunk_size,
unsigned int size)
{
int ret;
init_waitqueue_head(&buf->wait_poll);
spin_lock_init(&buf->fifo_lock);
buf->chunk_size = chunk_size;
buf->size = size;
ret = kfifo_alloc(&buf->fifo, size * chunk_size, GFP_KERNEL);
if (ret == 0)
buf->fifo_initialized = 1;
return ret;
}
static inline void lirc_buffer_free(struct lirc_buffer *buf)
{
if (buf->fifo_initialized) {
kfifo_free(&buf->fifo);
buf->fifo_initialized = 0;
} else
WARN(1, "calling %s on an uninitialized lirc_buffer\n",
__func__);
}
static inline int lirc_buffer_len(struct lirc_buffer *buf)
{
int len;
unsigned long flags;
spin_lock_irqsave(&buf->fifo_lock, flags);
len = kfifo_len(&buf->fifo);
spin_unlock_irqrestore(&buf->fifo_lock, flags);
return len;
}
static inline int lirc_buffer_full(struct lirc_buffer *buf)
{
return lirc_buffer_len(buf) == buf->size * buf->chunk_size;
}
static inline int lirc_buffer_empty(struct lirc_buffer *buf)
{
return !lirc_buffer_len(buf);
}
static inline int lirc_buffer_available(struct lirc_buffer *buf)
{
return buf->size - (lirc_buffer_len(buf) / buf->chunk_size);
}
static inline unsigned int lirc_buffer_read(struct lirc_buffer *buf,
unsigned char *dest)
{
unsigned int ret = 0;
if (lirc_buffer_len(buf) >= buf->chunk_size)
ret = kfifo_out_locked(&buf->fifo, dest, buf->chunk_size,
&buf->fifo_lock);
return ret;
}
static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf,
unsigned char *orig)
{
unsigned int ret;
ret = kfifo_in_locked(&buf->fifo, orig, buf->chunk_size,
&buf->fifo_lock);
return ret;
}
struct lirc_driver {
char name[40];
int minor;
__u32 code_length;
unsigned int buffer_size; /* in chunks holding one code each */
int sample_rate;
__u32 features;
unsigned int chunk_size;
void *data;
int min_timeout;
int max_timeout;
int (*add_to_buf) (void *data, struct lirc_buffer *buf);
struct lirc_buffer *rbuf;
int (*set_use_inc) (void *data);
void (*set_use_dec) (void *data);
const struct file_operations *fops;
struct device *dev;
struct module *owner;
};
/* name:
* this string will be used for logs
*
* minor:
* indicates minor device (/dev/lirc) number for registered driver
* if caller fills it with negative value, then the first free minor
* number will be used (if available)
*
* code_length:
* length of the remote control key code expressed in bits
*
* sample_rate:
*
* data:
* it may point to any driver data and this pointer will be passed to
* all callback functions
*
* add_to_buf:
* add_to_buf will be called after specified period of the time or
* triggered by the external event, this behavior depends on value of
* the sample_rate this function will be called in user context. This
* routine should return 0 if data was added to the buffer and
* -ENODATA if none was available. This should add some number of bits
* evenly divisible by code_length to the buffer
*
* rbuf:
* if not NULL, it will be used as a read buffer, you will have to
* write to the buffer by other means, like irq's (see also
* lirc_serial.c).
*
* set_use_inc:
* set_use_inc will be called after device is opened
*
* set_use_dec:
* set_use_dec will be called after device is closed
*
* fops:
* file_operations for drivers which don't fit the current driver model.
*
* Some ioctl's can be directly handled by lirc_dev if the driver's
* ioctl function is NULL or if it returns -ENOIOCTLCMD (see also
* lirc_serial.c).
*
* owner:
* the module owning this struct
*
*/
/* following functions can be called ONLY from user context
*
* returns negative value on error or minor number
* of the registered device if success
* contents of the structure pointed by p is copied
*/
extern int lirc_register_driver(struct lirc_driver *d);
/* returns negative value on error or 0 if success
*/
extern int lirc_unregister_driver(int minor);
/* Returns the private data stored in the lirc_driver
* associated with the given device file pointer.
*/
void *lirc_get_pdata(struct file *file);
/* default file operations
* used by drivers if they override only some operations
*/
int lirc_dev_fop_open(struct inode *inode, struct file *file);
int lirc_dev_fop_close(struct inode *inode, struct file *file);
unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait);
long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length,
loff_t *ppos);
ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
size_t length, loff_t *ppos);
#endif
|
/*----------------------------------------------------------------------
PuReMD - Purdue ReaxFF Molecular Dynamics Program
Copyright (2010) Purdue University
Hasan Metin Aktulga, hmaktulga@lbl.gov
Joseph Fogarty, jcfogart@mail.usf.edu
Sagar Pandit, pandit@usf.edu
Ananth Y Grama, ayg@cs.purdue.edu
Please cite the related publication:
H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama,
"Parallel Reactive Molecular Dynamics: Numerical Methods and
Algorithmic Techniques", Parallel Computing, in press.
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:
<http://www.gnu.org/licenses/>.
----------------------------------------------------------------------*/
#ifndef __VALENCE_ANGLES_H_
#define __VALENCE_ANGLES_H_
#include "reaxc_types.h"
void Valence_Angles( reax_system*, control_params*, simulation_data*,
storage*, reax_list**, output_controls* );
void Calculate_Theta( rvec, double, rvec, double, double*, double* );
void Calculate_dCos_Theta( rvec, double, rvec, double, rvec*, rvec*, rvec* );
#endif
|
/*****************************************************************************
Copyright (c) 2010, 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 C interface to LAPACK utility function
* Author: Intel Corporation
* Created in February, 2010
*****************************************************************************/
#include "lapacke_utils.h"
/* Check a matrix for NaN entries. */
lapack_logical LAPACKE_cgt_nancheck( lapack_int n,
const lapack_complex_float *dl,
const lapack_complex_float *d,
const lapack_complex_float *du )
{
return LAPACKE_c_nancheck( n-1, dl, 1 )
|| LAPACKE_c_nancheck( n , d, 1 )
|| LAPACKE_c_nancheck( n-1, du, 1 );
}
|
/*
* Copyright (C) 2010, 2013-2014 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
*
* A copy of the licence is included with the program, and can also be obtained from Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* @file mali_osk_time.c
* Implementation of the OS abstraction layer for the kernel device driver
*/
#include "mali_osk.h"
#include <linux/jiffies.h>
#include <linux/time.h>
#include <asm/delay.h>
int _mali_osk_time_after(u32 ticka, u32 tickb)
{
return time_after((unsigned long)ticka, (unsigned long)tickb);
}
u32 _mali_osk_time_mstoticks(u32 ms)
{
return msecs_to_jiffies(ms);
}
u32 _mali_osk_time_tickstoms(u32 ticks)
{
return jiffies_to_msecs(ticks);
}
u32 _mali_osk_time_tickcount(void)
{
return jiffies;
}
void _mali_osk_time_ubusydelay(u32 usecs)
{
udelay(usecs);
}
u64 _mali_osk_time_get_ns(void)
{
struct timespec tsval;
getnstimeofday(&tsval);
return (u64)timespec_to_ns(&tsval);
}
|
#ifndef BWTALN_H
#define BWTALN_H
#include <stdint.h>
#include "bwt.h"
#define BWA_TYPE_NO_MATCH 0
#define BWA_TYPE_UNIQUE 1
#define BWA_TYPE_REPEAT 2
#define BWA_TYPE_MATESW 3
#define SAM_FPD 1 // paired
#define SAM_FPP 2 // properly paired
#define SAM_FSU 4 // self-unmapped
#define SAM_FMU 8 // mate-unmapped
#define SAM_FSR 16 // self on the reverse strand
#define SAM_FMR 32 // mate on the reverse strand
#define SAM_FR1 64 // this is read one
#define SAM_FR2 128 // this is read two
#define SAM_FSC 256 // secondary alignment
#define BWA_AVG_ERR 0.02
#define BWA_MIN_RDLEN 35 // for read trimming
#define BWA_MAX_BCLEN 63 // maximum barcode length; 127 is the maximum
#ifndef bns_pac
#define bns_pac(pac, k) ((pac)[(k)>>2] >> ((~(k)&3)<<1) & 3)
#endif
#define FROM_M 0
#define FROM_I 1
#define FROM_D 2
#define FROM_S 3
#define SAI_MAGIC "SAI\1"
typedef struct {
bwtint_t w;
int bid;
} bwt_width_t;
typedef struct {
uint64_t n_mm:8, n_gapo:8, n_gape:8, score:20, n_ins:10, n_del:10;
bwtint_t k, l;
} bwt_aln1_t;
typedef uint16_t bwa_cigar_t;
/* rgoya: If changing order of bytes, beware of operations like:
* s->cigar[0] += s->full_len - s->len;
*/
#define CIGAR_OP_SHIFT 14
#define CIGAR_LN_MASK 0x3fff
#define __cigar_op(__cigar) ((__cigar)>>CIGAR_OP_SHIFT)
#define __cigar_len(__cigar) ((__cigar)&CIGAR_LN_MASK)
#define __cigar_create(__op, __len) ((__op)<<CIGAR_OP_SHIFT | (__len))
typedef struct {
uint32_t n_cigar:15, gap:8, mm:8, strand:1;
int ref_shift;
bwtint_t pos;
bwa_cigar_t *cigar;
} bwt_multi1_t;
typedef struct {
char *name;
ubyte_t *seq, *rseq, *qual;
uint32_t len:20, strand:1, type:2, dummy:1, extra_flag:8;
uint32_t n_mm:8, n_gapo:8, n_gape:8, mapQ:8;
int score;
int clip_len;
// alignments in SA coordinates
int n_aln;
bwt_aln1_t *aln;
// multiple hits
int n_multi;
bwt_multi1_t *multi;
// alignment information
bwtint_t sa, pos;
uint64_t c1:28, c2:28, seQ:8; // number of top1 and top2 hits; single-end mapQ
int ref_shift;
int n_cigar;
bwa_cigar_t *cigar;
// for multi-threading only
int tid;
// barcode
char bc[BWA_MAX_BCLEN+1]; // null terminated; up to BWA_MAX_BCLEN bases
// NM and MD tags
uint32_t full_len:20, nm:12;
char *md;
} bwa_seq_t;
#define BWA_MODE_GAPE 0x01
#define BWA_MODE_COMPREAD 0x02
#define BWA_MODE_LOGGAP 0x04
#define BWA_MODE_CFY 0x08
#define BWA_MODE_NONSTOP 0x10
#define BWA_MODE_BAM 0x20
#define BWA_MODE_BAM_SE 0x40
#define BWA_MODE_BAM_READ1 0x80
#define BWA_MODE_BAM_READ2 0x100
#define BWA_MODE_IL13 0x200
typedef struct {
int s_mm, s_gapo, s_gape;
int mode; // bit 24-31 are the barcode length
int indel_end_skip, max_del_occ, max_entries;
float fnr;
int max_diff, max_gapo, max_gape;
int max_seed_diff, seed_len;
int n_threads;
int max_top2;
int trim_qual;
} gap_opt_t;
#define BWA_PET_STD 1
typedef struct {
int max_isize, force_isize;
int max_occ;
int n_multi, N_multi;
int type, is_sw, is_preload;
double ap_prior;
} pe_opt_t;
struct __bwa_seqio_t;
typedef struct __bwa_seqio_t bwa_seqio_t;
#ifdef __cplusplus
extern "C" {
#endif
gap_opt_t *gap_init_opt();
void bwa_aln_core(const char *prefix, const char *fn_fa, const gap_opt_t *opt);
bwa_seqio_t *bwa_seq_open(const char *fn);
bwa_seqio_t *bwa_bam_open(const char *fn, int which);
void bwa_seq_close(bwa_seqio_t *bs);
void seq_reverse(int len, ubyte_t *seq, int is_comp);
bwa_seq_t *bwa_read_seq(bwa_seqio_t *seq, int n_needed, int *n, int mode, int trim_qual);
void bwa_free_read_seq(int n_seqs, bwa_seq_t *seqs);
int bwa_cal_maxdiff(int l, double err, double thres);
void bwa_cal_sa_reg_gap(int tid, bwt_t *const bwt, int n_seqs, bwa_seq_t *seqs, const gap_opt_t *opt);
void bwa_cs2nt_core(bwa_seq_t *p, bwtint_t l_pac, ubyte_t *pac);
#ifdef __cplusplus
}
#endif
#endif
|
/*<html><pre> -<a href="qh-user_r.htm"
>-------------------------------</a><a name="TOP">-</a>
usermem_r.c
user redefinable functions -- qh_exit, qh_free, and qh_malloc
See README.txt.
If you redefine one of these functions you must redefine all of them.
If you recompile and load this file, then usermem.o will not be loaded
from qhull.a or qhull.lib
See libqhull_r.h for data structures, macros, and user-callable functions.
See user_r.c for qhull-related, redefinable functions
see user_r.h for user-definable constants
See userprintf_r.c for qh_fprintf and userprintf_rbox_r.c for qh_fprintf_rbox
Please report any errors that you fix to qhull@qhull.org
*/
#include "libqhull_r.h"
#include <stdarg.h>
#include <stdlib.h>
/*-<a href="qh-user_r.htm#TOC"
>-------------------------------</a><a name="qh_exit">-</a>
qh_exit( exitcode )
exit program
the exitcode must be 255 or less. Zero indicates success.
Note: Exit status ('$?') in bash reports 256 as 0
notes:
qh_exit() is called when qh_errexit() and longjmp() are not available.
This is the only use of exit() in Qhull
To replace qh_exit with 'throw', see libqhullcpp/usermem_r-cpp.cpp
*/
void qh_exit(int exitcode) {
exit(exitcode);
} /* exit */
/*-<a href="qh-user_r.htm#TOC"
>-------------------------------</a><a name="qh_fprintf_stderr">-</a>
qh_fprintf_stderr( msgcode, format, list of args )
fprintf to stderr with msgcode (non-zero)
notes:
qh_fprintf_stderr() is called when qh.ferr is not defined, usually due to an initialization error
if msgcode is a MSG_ERROR (6000), caller should set qh.last_errcode (like qh_fprintf) or variable 'last_errcode'
It is typically followed by qh_errexit().
Redefine this function to avoid using stderr
Use qh_fprintf [userprintf_r.c] for normal printing
*/
void qh_fprintf_stderr(int msgcode, const char *fmt, ... ) {
va_list args;
va_start(args, fmt);
if(msgcode)
fprintf(stderr, "QH%.4d ", msgcode);
vfprintf(stderr, fmt, args);
va_end(args);
} /* fprintf_stderr */
/*-<a href="qh-user_r.htm#TOC"
>-------------------------------</a><a name="qh_free">-</a>
qh_free(qh, mem )
free memory
notes:
same as free()
No calls to qh_errexit()
*/
void qh_free(void *mem) {
free(mem);
} /* free */
/*-<a href="qh-user_r.htm#TOC"
>-------------------------------</a><a name="qh_malloc">-</a>
qh_malloc( mem )
allocate memory
notes:
same as malloc()
*/
void *qh_malloc(size_t size) {
return malloc(size);
} /* malloc */
|
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2017 Facebook
*/
#include <linux/slab.h>
#include <linux/bpf.h>
#include <linux/btf.h>
#include "map_in_map.h"
struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)
{
struct bpf_map *inner_map, *inner_map_meta;
u32 inner_map_meta_size;
struct fd f;
f = fdget(inner_map_ufd);
inner_map = __bpf_map_get(f);
if (IS_ERR(inner_map))
return inner_map;
/* Does not support >1 level map-in-map */
if (inner_map->inner_map_meta) {
fdput(f);
return ERR_PTR(-EINVAL);
}
if (!inner_map->ops->map_meta_equal) {
fdput(f);
return ERR_PTR(-ENOTSUPP);
}
if (map_value_has_spin_lock(inner_map)) {
fdput(f);
return ERR_PTR(-ENOTSUPP);
}
inner_map_meta_size = sizeof(*inner_map_meta);
/* In some cases verifier needs to access beyond just base map. */
if (inner_map->ops == &array_map_ops)
inner_map_meta_size = sizeof(struct bpf_array);
inner_map_meta = kzalloc(inner_map_meta_size, GFP_USER);
if (!inner_map_meta) {
fdput(f);
return ERR_PTR(-ENOMEM);
}
inner_map_meta->map_type = inner_map->map_type;
inner_map_meta->key_size = inner_map->key_size;
inner_map_meta->value_size = inner_map->value_size;
inner_map_meta->map_flags = inner_map->map_flags;
inner_map_meta->max_entries = inner_map->max_entries;
inner_map_meta->spin_lock_off = inner_map->spin_lock_off;
inner_map_meta->timer_off = inner_map->timer_off;
if (inner_map->btf) {
btf_get(inner_map->btf);
inner_map_meta->btf = inner_map->btf;
}
/* Misc members not needed in bpf_map_meta_equal() check. */
inner_map_meta->ops = inner_map->ops;
if (inner_map->ops == &array_map_ops) {
inner_map_meta->bypass_spec_v1 = inner_map->bypass_spec_v1;
container_of(inner_map_meta, struct bpf_array, map)->index_mask =
container_of(inner_map, struct bpf_array, map)->index_mask;
}
fdput(f);
return inner_map_meta;
}
void bpf_map_meta_free(struct bpf_map *map_meta)
{
btf_put(map_meta->btf);
kfree(map_meta);
}
bool bpf_map_meta_equal(const struct bpf_map *meta0,
const struct bpf_map *meta1)
{
/* No need to compare ops because it is covered by map_type */
return meta0->map_type == meta1->map_type &&
meta0->key_size == meta1->key_size &&
meta0->value_size == meta1->value_size &&
meta0->timer_off == meta1->timer_off &&
meta0->map_flags == meta1->map_flags;
}
void *bpf_map_fd_get_ptr(struct bpf_map *map,
struct file *map_file /* not used */,
int ufd)
{
struct bpf_map *inner_map, *inner_map_meta;
struct fd f;
f = fdget(ufd);
inner_map = __bpf_map_get(f);
if (IS_ERR(inner_map))
return inner_map;
inner_map_meta = map->inner_map_meta;
if (inner_map_meta->ops->map_meta_equal(inner_map_meta, inner_map))
bpf_map_inc(inner_map);
else
inner_map = ERR_PTR(-EINVAL);
fdput(f);
return inner_map;
}
void bpf_map_fd_put_ptr(void *ptr)
{
/* ptr->ops->map_free() has to go through one
* rcu grace period by itself.
*/
bpf_map_put(ptr);
}
u32 bpf_map_fd_sys_lookup_elem(void *ptr)
{
return ((struct bpf_map *)ptr)->id;
}
|
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#ifndef GEOS_INDEX_SWEEPLINE_SWEEPLINEINTERVAL_H
#define GEOS_INDEX_SWEEPLINE_SWEEPLINEINTERVAL_H
#include <geos/export.h>
namespace geos {
namespace index { // geos.index
namespace sweepline { // geos:index:sweepline
class GEOS_DLL SweepLineInterval {
public:
SweepLineInterval(double newMin, double newMax, void* newItem=0);
double getMin();
double getMax();
void* getItem();
private:
double min, max;
void* item;
};
} // namespace geos:index:sweepline
} // namespace geos:index
} // namespace geos
#endif // GEOS_INDEX_SWEEPLINE_SWEEPLINEINTERVAL_H
|
/***************************************************************************
qgslayertreeviewtemporalindicator.h
---------------
begin : February 2020
copyright : (C) 2020 by Samweli Mwakisambwe
email : samweli at kartoza dot com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSLAYERTREEVIEWTEMPORALINDICATOR_H
#define QGSLAYERTREEVIEWTEMPORALINDICATOR_H
#include "qgslayertreeviewindicatorprovider.h"
//! Adds indicators for showing temporal layers.
class QgsLayerTreeViewTemporalIndicatorProvider : public QgsLayerTreeViewIndicatorProvider
{
Q_OBJECT
public:
explicit QgsLayerTreeViewTemporalIndicatorProvider( QgsLayerTreeView *view );
protected:
void connectSignals( QgsMapLayer *layer ) override;
protected slots:
void onIndicatorClicked( const QModelIndex &index ) override;
//! Adds/removes indicator of a layer
void onLayerChanged( QgsMapLayer *layer );
private:
bool acceptLayer( QgsMapLayer *layer ) override;
QString iconName( QgsMapLayer *layer ) override;
QString tooltipText( QgsMapLayer *layer ) override;
};
#endif // QGSLAYERTREEVIEWTEMPORALINDICATOR_H
|
#ifndef _TSPP_H_
#define _TSPP_H_
#include <linux/ioctl.h>
#define TSPP_NUM_SYSTEM_KEYS 8
enum tspp_key_parity {
TSPP_KEY_PARITY_EVEN,
TSPP_KEY_PARITY_ODD
};
enum tspp_source {
TSPP_SOURCE_TSIF0,
TSPP_SOURCE_TSIF1,
TSPP_SOURCE_MEM,
TSPP_SOURCE_NONE = -1
};
enum tspp_mode {
TSPP_MODE_DISABLED,
TSPP_MODE_PES,
TSPP_MODE_RAW,
TSPP_MODE_RAW_NO_SUFFIX
};
enum tspp_tsif_mode {
TSPP_TSIF_MODE_LOOPBACK,
TSPP_TSIF_MODE_1,
TSPP_TSIF_MODE_2
};
struct tspp_filter {
int pid;
int mask;
enum tspp_mode mode;
unsigned int priority;
int decrypt;
enum tspp_source source;
};
struct tspp_select_source {
enum tspp_source source;
enum tspp_tsif_mode mode;
int clk_inverse;
int data_inverse;
int sync_inverse;
int enable_inverse;
};
struct tspp_pid {
int pid;
};
struct tspp_key {
enum tspp_key_parity parity;
int lsb;
int msb;
};
struct tspp_iv {
int data[2];
};
struct tspp_system_keys {
int data[TSPP_NUM_SYSTEM_KEYS];
};
struct tspp_buffer {
int size;
};
#define TSPP_IOCTL_BASE 0xAA
#define TSPP_IOCTL_SELECT_SOURCE \
_IOW(TSPP_IOCTL_BASE, 0, struct tspp_select_source)
#define TSPP_IOCTL_ADD_FILTER \
_IOW(TSPP_IOCTL_BASE, 1, struct tspp_filter)
#define TSPP_IOCTL_REMOVE_FILTER \
_IOW(TSPP_IOCTL_BASE, 2, struct tspp_pid)
#define TSPP_IOCTL_SET_KEY \
_IOW(TSPP_IOCTL_BASE, 3, struct tspp_key)
#define TSPP_IOCTL_SET_IV \
_IOW(TSPP_IOCTL_BASE, 4, struct tspp_iv)
#define TSPP_IOCTL_SET_SYSTEM_KEYS \
_IOW(TSPP_IOCTL_BASE, 5, struct tspp_system_keys)
#define TSPP_IOCTL_BUFFER_SIZE \
_IOW(TSPP_IOCTL_BASE, 6, struct tspp_buffer)
#define TSPP_IOCTL_CLOSE_STREAM \
_IO(TSPP_IOCTL_BASE, 7)
#endif
|
/** @file
Guid used to define the Firmware File System 2.
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
GUIDs introduced in PI Version 1.0.
**/
#ifndef __FIRMWARE_FILE_SYSTEM2_GUID_H__
#define __FIRMWARE_FILE_SYSTEM2_GUID_H__
///
/// The firmware volume header contains a data field for
/// the file system GUID
///
#define EFI_FIRMWARE_FILE_SYSTEM2_GUID \
{ 0x8c8ce578, 0x8a3d, 0x4f1c, { 0x99, 0x35, 0x89, 0x61, 0x85, 0xc3, 0x2d, 0xd3 } }
///
/// A Volume Top File (VTF) is a file that must be
/// located such that the last byte of the file is
/// also the last byte of the firmware volume
///
#define EFI_FFS_VOLUME_TOP_FILE_GUID \
{ 0x1BA0062E, 0xC779, 0x4582, { 0x85, 0x66, 0x33, 0x6A, 0xE8, 0xF7, 0x8F, 0x9 } }
extern EFI_GUID gEfiFirmwareFileSystem2Guid;
extern EFI_GUID gEfiFirmwareVolumeTopFileGuid;
#endif
|
#ifndef __ASM_GENERIC_VGA_H
#define __ASM_GENERIC_VGA_H
#ifndef VGA_MAP_MEM
#define VGA_MAP_MEM(x, s) (unsigned long)phys_to_virt(x)
#endif
#define vga_readb(x) (*(x))
#define vga_writeb(x, y) (*(y) = (x))
#endif
|
// 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_CHROMEOS_POLICY_USER_POLICY_DISK_CACHE_H_
#define CHROME_BROWSER_CHROMEOS_POLICY_USER_POLICY_DISK_CACHE_H_
#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
namespace enterprise_management {
class CachedCloudPolicyResponse;
}
namespace policy {
// Handles the on-disk cache file used by UserPolicyCache. This class handles
// the necessary thread switching and may outlive the associated UserPolicyCache
// instance.
class UserPolicyDiskCache
: public base::RefCountedThreadSafe<UserPolicyDiskCache> {
public:
// Indicates the status of a completed load operation.
enum LoadResult {
// Policy was loaded successfully.
LOAD_RESULT_SUCCESS,
// Cache file missing.
LOAD_RESULT_NOT_FOUND,
// Failed to read cache file.
LOAD_RESULT_READ_ERROR,
// Failed to parse cache file.
LOAD_RESULT_PARSE_ERROR,
};
// Delegate interface for observing loads operations.
class Delegate {
public:
virtual ~Delegate();
virtual void OnDiskCacheLoaded(
LoadResult result,
const enterprise_management::CachedCloudPolicyResponse& policy) = 0;
};
UserPolicyDiskCache(const base::WeakPtr<Delegate>& delegate,
const base::FilePath& backing_file_path);
// Starts reading the policy cache from disk. Passes the read policy
// information back to the hosting UserPolicyCache after a successful cache
// load through UserPolicyCache::OnDiskCacheLoaded().
void Load();
// Triggers a write operation to the disk cache on the FILE thread.
void Store(const enterprise_management::CachedCloudPolicyResponse& policy);
private:
friend class base::RefCountedThreadSafe<UserPolicyDiskCache>;
~UserPolicyDiskCache();
// Tries to load the cache file on the FILE thread.
void LoadOnFileThread();
// Forwards the result to the UI thread.
void LoadDone(LoadResult result,
const enterprise_management::CachedCloudPolicyResponse& policy);
// Passes back the successfully read policy to the cache on the UI thread.
void ReportResultOnUIThread(
LoadResult result,
const enterprise_management::CachedCloudPolicyResponse& policy);
// Saves a policy blob on the FILE thread.
void StoreOnFileThread(
const enterprise_management::CachedCloudPolicyResponse& policy);
base::WeakPtr<Delegate> delegate_;
const base::FilePath backing_file_path_;
DISALLOW_COPY_AND_ASSIGN(UserPolicyDiskCache);
};
} // namespace policy
#endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_POLICY_DISK_CACHE_H_
|
/*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef COMPAT_TMS470_MATH_H
#define COMPAT_TMS470_MATH_H
#include_next <math.h>
#undef INFINITY
#undef NAN
#define INFINITY (*(const float*)((const unsigned []){ 0x7f800000 }))
#define NAN (*(const float*)((const unsigned []){ 0x7fc00000 }))
#endif /* COMPAT_TMS470_MATH_H */
|
/* GLIB - Library of useful routines for C programming
* gmappedfile.h: Simplified wrapper around the mmap function
*
* Copyright 2005 Matthias Clasen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __G_MAPPED_FILE_H__
#define __G_MAPPED_FILE_H__
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
#error "Only <glib.h> can be included directly."
#endif
#include <glib/gbytes.h>
#include <glib/gerror.h>
G_BEGIN_DECLS
typedef struct _GMappedFile GMappedFile;
GLIB_AVAILABLE_IN_ALL
GMappedFile *g_mapped_file_new (const gchar *filename,
gboolean writable,
GError **error) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
GMappedFile *g_mapped_file_new_from_fd (gint fd,
gboolean writable,
GError **error) G_GNUC_MALLOC;
GLIB_AVAILABLE_IN_ALL
gsize g_mapped_file_get_length (GMappedFile *file);
GLIB_AVAILABLE_IN_ALL
gchar *g_mapped_file_get_contents (GMappedFile *file);
GLIB_AVAILABLE_IN_2_34
GBytes * g_mapped_file_get_bytes (GMappedFile *file);
GLIB_AVAILABLE_IN_ALL
GMappedFile *g_mapped_file_ref (GMappedFile *file);
GLIB_AVAILABLE_IN_ALL
void g_mapped_file_unref (GMappedFile *file);
GLIB_DEPRECATED_FOR(g_mapped_file_unref)
void g_mapped_file_free (GMappedFile *file);
G_END_DECLS
#endif /* __G_MAPPED_FILE_H__ */
|
//===-- llvm/CodeGen/MachineModuleInfoImpls.h -------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines object-file format specific implementations of
// MachineModuleInfoImpl.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
#define LLVM_CODEGEN_MACHINEMODULEINFOIMPLS_H
#include "llvm/CodeGen/MachineModuleInfo.h"
namespace llvm {
class MCSymbol;
/// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
/// for MachO targets.
class MachineModuleInfoMachO : public MachineModuleInfoImpl {
/// FnStubs - Darwin '$stub' stubs. The key is something like "Lfoo$stub",
/// the value is something like "_foo".
DenseMap<MCSymbol*, StubValueTy> FnStubs;
/// GVStubs - Darwin '$non_lazy_ptr' stubs. The key is something like
/// "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra bit
/// is true if this GV is external.
DenseMap<MCSymbol*, StubValueTy> GVStubs;
/// HiddenGVStubs - Darwin '$non_lazy_ptr' stubs. The key is something like
/// "Lfoo$non_lazy_ptr", the value is something like "_foo". Unlike GVStubs
/// these are for things with hidden visibility. The extra bit is true if
/// this GV is external.
DenseMap<MCSymbol*, StubValueTy> HiddenGVStubs;
virtual void Anchor(); // Out of line virtual method.
public:
MachineModuleInfoMachO(const MachineModuleInfo &) {}
StubValueTy &getFnStubEntry(MCSymbol *Sym) {
assert(Sym && "Key cannot be null");
return FnStubs[Sym];
}
StubValueTy &getGVStubEntry(MCSymbol *Sym) {
assert(Sym && "Key cannot be null");
return GVStubs[Sym];
}
StubValueTy &getHiddenGVStubEntry(MCSymbol *Sym) {
assert(Sym && "Key cannot be null");
return HiddenGVStubs[Sym];
}
/// Accessor methods to return the set of stubs in sorted order.
SymbolListTy GetFnStubList() const {
return GetSortedStubs(FnStubs);
}
SymbolListTy GetGVStubList() const {
return GetSortedStubs(GVStubs);
}
SymbolListTy GetHiddenGVStubList() const {
return GetSortedStubs(HiddenGVStubs);
}
};
/// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
/// for ELF targets.
class MachineModuleInfoELF : public MachineModuleInfoImpl {
/// GVStubs - These stubs are used to materialize global addresses in PIC
/// mode.
DenseMap<MCSymbol*, StubValueTy> GVStubs;
virtual void Anchor(); // Out of line virtual method.
public:
MachineModuleInfoELF(const MachineModuleInfo &) {}
StubValueTy &getGVStubEntry(MCSymbol *Sym) {
assert(Sym && "Key cannot be null");
return GVStubs[Sym];
}
/// Accessor methods to return the set of stubs in sorted order.
SymbolListTy GetGVStubList() const {
return GetSortedStubs(GVStubs);
}
};
} // end namespace llvm
#endif
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle
* Copyright (C) 2000, 2001 Silicon Graphics, Inc.
*/
#ifndef _UAPI_ASM_SOCKET_H
#define _UAPI_ASM_SOCKET_H
#include <linux/posix_types.h>
#include <asm/sockios.h>
/*
* For setsockopt(2)
*
* This defines are ABI conformant as far as Linux supports these ...
*/
#define SOL_SOCKET 0xffff
#define SO_DEBUG 0x0001 /* Record debugging information. */
#define SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */
#define SO_KEEPALIVE 0x0008 /* Keep connections alive and send
SIGPIPE when they die. */
#define SO_DONTROUTE 0x0010 /* Don't do local routing. */
#define SO_BROADCAST 0x0020 /* Allow transmission of
broadcast messages. */
#define SO_LINGER 0x0080 /* Block on close of a reliable
socket to transmit pending data. */
#define SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */
#define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
#define SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
#define SO_STYLE SO_TYPE /* Synonym */
#define SO_ERROR 0x1007 /* get error status and clear */
#define SO_SNDBUF 0x1001 /* Send buffer size. */
#define SO_RCVBUF 0x1002 /* Receive buffer. */
#define SO_SNDLOWAT 0x1003 /* send low-water mark */
#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
#define SO_SNDTIMEO_OLD 0x1005 /* send timeout */
#define SO_RCVTIMEO_OLD 0x1006 /* receive timeout */
#define SO_ACCEPTCONN 0x1009
#define SO_PROTOCOL 0x1028 /* protocol type */
#define SO_DOMAIN 0x1029 /* domain/socket family */
/* linux-specific, might as well be the same as on i386 */
#define SO_NO_CHECK 11
#define SO_PRIORITY 12
#define SO_BSDCOMPAT 14
#define SO_PASSCRED 17
#define SO_PEERCRED 18
/* Security levels - as per NRL IPv6 - don't actually do anything */
#define SO_SECURITY_AUTHENTICATION 22
#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
#define SO_SECURITY_ENCRYPTION_NETWORK 24
#define SO_BINDTODEVICE 25
/* Socket filtering */
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_GET_FILTER SO_ATTACH_FILTER
#define SO_PEERNAME 28
#define SO_PEERSEC 30
#define SO_SNDBUFFORCE 31
#define SO_RCVBUFFORCE 33
#define SO_PASSSEC 34
#define SO_MARK 36
#define SO_RXQ_OVFL 40
#define SO_WIFI_STATUS 41
#define SCM_WIFI_STATUS SO_WIFI_STATUS
#define SO_PEEK_OFF 42
/* Instruct lower device to use last 4-bytes of skb data as FCS */
#define SO_NOFCS 43
#define SO_LOCK_FILTER 44
#define SO_SELECT_ERR_QUEUE 45
#define SO_BUSY_POLL 46
#define SO_MAX_PACING_RATE 47
#define SO_BPF_EXTENSIONS 48
#define SO_INCOMING_CPU 49
#define SO_ATTACH_BPF 50
#define SO_DETACH_BPF SO_DETACH_FILTER
#define SO_ATTACH_REUSEPORT_CBPF 51
#define SO_ATTACH_REUSEPORT_EBPF 52
#define SO_CNX_ADVICE 53
#define SCM_TIMESTAMPING_OPT_STATS 54
#define SO_MEMINFO 55
#define SO_INCOMING_NAPI_ID 56
#define SO_COOKIE 57
#define SCM_TIMESTAMPING_PKTINFO 58
#define SO_PEERGROUPS 59
#define SO_ZEROCOPY 60
#define SO_TXTIME 61
#define SCM_TXTIME SO_TXTIME
#define SO_BINDTOIFINDEX 62
#define SO_TIMESTAMP_OLD 29
#define SO_TIMESTAMPNS_OLD 35
#define SO_TIMESTAMPING_OLD 37
#define SO_TIMESTAMP_NEW 63
#define SO_TIMESTAMPNS_NEW 64
#define SO_TIMESTAMPING_NEW 65
#define SO_RCVTIMEO_NEW 66
#define SO_SNDTIMEO_NEW 67
#define SO_DETACH_REUSEPORT_BPF 68
#define SO_PREFER_BUSY_POLL 69
#define SO_BUSY_POLL_BUDGET 70
#define SO_NETNS_COOKIE 71
#define SO_BUF_LOCK 72
#if !defined(__KERNEL__)
#if __BITS_PER_LONG == 64
#define SO_TIMESTAMP SO_TIMESTAMP_OLD
#define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD
#define SO_TIMESTAMPING SO_TIMESTAMPING_OLD
#define SO_RCVTIMEO SO_RCVTIMEO_OLD
#define SO_SNDTIMEO SO_SNDTIMEO_OLD
#else
#define SO_TIMESTAMP (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMP_OLD : SO_TIMESTAMP_NEW)
#define SO_TIMESTAMPNS (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPNS_OLD : SO_TIMESTAMPNS_NEW)
#define SO_TIMESTAMPING (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_TIMESTAMPING_OLD : SO_TIMESTAMPING_NEW)
#define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
#define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)
#endif
#define SCM_TIMESTAMP SO_TIMESTAMP
#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
#define SCM_TIMESTAMPING SO_TIMESTAMPING
#endif
#endif /* _UAPI_ASM_SOCKET_H */
|
#ifndef QT_NO_QT_INCLUDE_WARN
#if defined(__GNUC__)
#warning "Inclusion of header files from include/Qt is deprecated."
#elif defined(_MSC_VER)
#pragma message("WARNING: Inclusion of header files from include/Qt is deprecated.")
#endif
#endif
#include "../QtSql/qsqldatabase.h"
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2010 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 <Foundation/Foundation.h>
/**
* Operation Queue is a utility class that provides a shared queue
* that can be used to handle background jobs and after the jobs complete
* can call a callback either on or off the main UI thread.
*/
@interface OperationQueue : NSObject {
NSOperationQueue *queue;
}
/**
Returns shared instance.
@return The shared instance.
*/
+(OperationQueue*)sharedQueue;
/**
Queues an operation.
Queues an operation that targets selector on target
invoke after (if not nil) on when completed
pass YES to ui to invoke after on UI main thread
@param selector The selector.
@param target The target.
@param arg The argument
@param after The after selector.
@param on The after target.
@param ui The flag to invoke after on UI thread.
*/
-(void)queue:(SEL)selector target:(id)target arg:(id)arg after:(SEL)after on:(id)on ui:(BOOL)ui;
@end
|
/* SoX Resampler Library Copyright (c) 2007-13 robs@users.sourceforge.net
* Licence for this file: LGPL v2.1 See LICENCE for details. */
void ORDERED_CONVOLVE(int n, void * not_used, DFT_FLOAT * a, const DFT_FLOAT * b)
{
int i;
a[0] *= b[0];
a[1] *= b[1];
for (i = 2; i < n; i += 2) {
DFT_FLOAT tmp = a[i];
a[i ] = b[i ] * tmp - b[i+1] * a[i+1];
a[i+1] = b[i+1] * tmp + b[i ] * a[i+1];
}
(void)not_used;
}
void ORDERED_PARTIAL_CONVOLVE(int n, DFT_FLOAT * a, const DFT_FLOAT * b)
{
int i;
a[0] *= b[0];
for (i = 2; i < n; i += 2) {
DFT_FLOAT tmp = a[i];
a[i ] = b[i ] * tmp - b[i+1] * a[i+1];
a[i+1] = b[i+1] * tmp + b[i ] * a[i+1];
}
a[1] = b[i] * a[i] - b[i+1] * a[i+1];
}
#undef ORDERED_CONVOLVE
#undef ORDERED_PARTIAL_CONVOLVE
#undef DFT_FLOAT
|
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ARCH_ARM_MACH_MSM_GPIOMUX_8X60_H
#define __ARCH_ARM_MACH_MSM_GPIOMUX_8X60_H
void __init msm8x60_init_gpiomux(struct msm_gpiomux_configs *cfgs);
extern struct msm_gpiomux_configs msm8x60_qrdc_gpiomux_cfgs[] __initdata;
extern struct msm_gpiomux_configs msm8x60_surf_ffa_gpiomux_cfgs[] __initdata;
extern struct msm_gpiomux_configs msm8x60_fluid_gpiomux_cfgs[] __initdata;
extern struct msm_gpiomux_configs msm8x60_charm_gpiomux_cfgs[] __initdata;
extern struct msm_gpiomux_configs msm8x60_qt_gpiomux_cfgs[] __initdata;
#endif
|
/* int mpz_fits_sshort_p (mpz_t z) -- test whether z fits a short.
Copyright 1997, 2000, 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 either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
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 General Public License
for more details.
You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
#define FUNCTION mpz_fits_sshort_p
#define MAXIMUM SHRT_MAX
#define MINIMUM SHRT_MIN
#include "fits_s.h"
|
/*
* Copyright 2006 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkColorFilter_DEFINED
#define SkColorFilter_DEFINED
#include "SkColor.h"
#include "SkFlattenable.h"
#include "SkXfermode.h"
class SK_API SkColorFilter : public SkFlattenable {
public:
/**
* If the filter can be represented by a source color plus Mode, this
* returns true, and sets (if not NULL) the color and mode appropriately.
* If not, this returns false and ignores the parameters.
*/
virtual bool asColorMode(SkColor* color, SkXfermode::Mode* mode);
/**
* If the filter can be represented by a 5x4 matrix, this
* returns true, and sets the matrix appropriately.
* If not, this returns false and ignores the parameter.
*/
virtual bool asColorMatrix(SkScalar matrix[20]);
/**
* If the filter can be represented by per-component table, return true,
* and if table is not null, copy the bitmap containing the table into it.
*
* The table bitmap will be in SkBitmap::kA8_Config. Each row corresponding
* to each component in ARGB order. e.g. row[0] == alpha, row[1] == red,
* etc. To transform a color, you (logically) perform the following:
*
* a' = *table.getAddr8(a, 0);
* r' = *table.getAddr8(r, 1);
* g' = *table.getAddr8(g, 2);
* b' = *table.getAddr8(b, 3);
*
* The original component value is the horizontal index for a given row,
* and the stored value at that index is the new value for that component.
*/
virtual bool asComponentTable(SkBitmap* table);
/** Called with a scanline of colors, as if there was a shader installed.
The implementation writes out its filtered version into result[].
Note: shader and result may be the same buffer.
@param src array of colors, possibly generated by a shader
@param count the number of entries in the src[] and result[] arrays
@param result written by the filter
*/
virtual void filterSpan(const SkPMColor src[], int count,
SkPMColor result[]) = 0;
/** Called with a scanline of colors, as if there was a shader installed.
The implementation writes out its filtered version into result[].
Note: shader and result may be the same buffer.
@param src array of colors, possibly generated by a shader
@param count the number of entries in the src[] and result[] arrays
@param result written by the filter
*/
virtual void filterSpan16(const uint16_t shader[], int count,
uint16_t result[]);
enum Flags {
/** If set the filter methods will not change the alpha channel of the
colors.
*/
kAlphaUnchanged_Flag = 0x01,
/** If set, this subclass implements filterSpan16(). If this flag is
set, then kAlphaUnchanged_Flag must also be set.
*/
kHasFilter16_Flag = 0x02
};
/** Returns the flags for this filter. Override in subclasses to return
custom flags.
*/
virtual uint32_t getFlags() { return 0; }
/**
* Apply this colorfilter to the specified SkColor. This routine handles
* converting to SkPMColor, calling the filter, and then converting back
* to SkColor. This method is not virtual, but will call filterSpan()
* which is virtual.
*/
SkColor filterColor(SkColor);
/** Create a colorfilter that uses the specified color and mode.
If the Mode is DST, this function will return NULL (since that
mode will have no effect on the result).
@param c The source color used with the specified mode
@param mode The xfermode mode that is applied to each color in
the colorfilter's filterSpan[16,32] methods
@return colorfilter object that applies the src color and mode,
or NULL if the mode will have no effect.
*/
static SkColorFilter* CreateModeFilter(SkColor c, SkXfermode::Mode mode);
/** Create a colorfilter that calls through to the specified procs to
filter the colors. The SkXfermodeProc parameter must be non-null, but
the SkXfermodeProc16 is optional, and may be null.
*/
static SkColorFilter* CreateProcFilter(SkColor srcColor,
SkXfermodeProc proc,
SkXfermodeProc16 proc16 = NULL);
/** Create a colorfilter that multiplies the RGB channels by one color, and
then adds a second color, pinning the result for each component to
[0..255]. The alpha components of the mul and add arguments
are ignored.
*/
static SkColorFilter* CreateLightingFilter(SkColor mul, SkColor add);
SK_DECLARE_FLATTENABLE_REGISTRAR()
protected:
SkColorFilter() {}
SkColorFilter(SkFlattenableReadBuffer& rb) : INHERITED(rb) {}
private:
typedef SkFlattenable INHERITED;
};
#include "SkShader.h"
class SkFilterShader : public SkShader {
public:
SkFilterShader(SkShader* shader, SkColorFilter* filter);
virtual ~SkFilterShader();
// override
virtual uint32_t getFlags();
virtual bool setContext(const SkBitmap& device, const SkPaint& paint,
const SkMatrix& matrix);
virtual void shadeSpan(int x, int y, SkPMColor result[], int count);
virtual void shadeSpan16(int x, int y, uint16_t result[], int count);
virtual void beginSession();
virtual void endSession();
protected:
SkFilterShader(SkFlattenableReadBuffer& );
virtual void flatten(SkFlattenableWriteBuffer& ) SK_OVERRIDE;
virtual Factory getFactory() SK_OVERRIDE { return CreateProc; }
private:
static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) {
return SkNEW_ARGS(SkFilterShader, (buffer)); }
SkShader* fShader;
SkColorFilter* fFilter;
typedef SkShader INHERITED;
};
#endif
|
//
// ViewController.h
// ActivityIndicatorStatusBarDemo
//
// Created by Arthur Knopper on 15-05-13.
// Copyright (c) 2013 Arthur Knopper. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
/* BFD back-end for SH PECOFF files.
Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
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, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#define TARGET_SHL_SYM sh_pe_le_vec
#define TARGET_SHL_NAME "pe-shl"
#define COFF_WITH_PE
#define PCRELOFFSET TRUE
#define TARGET_UNDERSCORE '_'
#define COFF_LONG_SECTION_NAMES
#include "coff-sh.c"
|
/*
* cdbbackup.h
*
*/
#ifndef CDBBACKUP_H
#define CDBBACKUP_H
/*
* External declarations
*/
extern Datum gp_backup_launch__(PG_FUNCTION_ARGS);
extern Datum gp_restore_launch__(PG_FUNCTION_ARGS);
extern Datum gp_read_backup_file__(PG_FUNCTION_ARGS);
extern Datum gp_write_backup_file__(PG_FUNCTION_ARGS);
#endif /* CDBBACKUP_H */
|
/*
* U-boot - Configuration file for CM-BF527 board
*/
#ifndef __CONFIG_CM_BF527_H__
#define __CONFIG_CM_BF527_H__
#include <asm/config-pre.h>
/*
* Processor Settings
*/
#define CONFIG_BFIN_CPU bf527-0.0
#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_PARA
/*
* Clock Settings
* CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
* SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
*/
/* CONFIG_CLKIN_HZ is any value in Hz */
#define CONFIG_CLKIN_HZ 25000000
/* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */
/* 1 = CLKIN / 2 */
#define CONFIG_CLKIN_HALF 0
/* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */
/* 1 = bypass PLL */
#define CONFIG_PLL_BYPASS 0
/* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL */
/* Values can range from 0-63 (where 0 means 64) */
#define CONFIG_VCO_MULT 21
/* CCLK_DIV controls the core clock divider */
/* Values can be 1, 2, 4, or 8 ONLY */
#define CONFIG_CCLK_DIV 1
/* SCLK_DIV controls the system clock divider */
/* Values can range from 1-15 */
#define CONFIG_SCLK_DIV 4
/* Decrease core voltage */
#define CONFIG_VR_CTL_VAL (VLEV_120 | CLKBUFOE | FREQ_1000)
/*
* Memory Settings
*/
#define CONFIG_MEM_ADD_WDTH 9
#define CONFIG_MEM_SIZE 32
#define CONFIG_EBIU_SDRRC_VAL 0x3f8
#define CONFIG_EBIU_SDGCTL_VAL 0x9111cd
#define CONFIG_EBIU_AMGCTL_VAL (AMBEN_ALL)
#define CONFIG_EBIU_AMBCTL0_VAL (B1WAT_7 | B1RAT_11 | B1HT_2 | B1ST_3 | B0WAT_7 | B0RAT_11 | B0HT_2 | B0ST_3)
#define CONFIG_EBIU_AMBCTL1_VAL (B3WAT_7 | B3RAT_11 | B3HT_2 | B3ST_3 | B2WAT_7 | B2RAT_11 | B2HT_2 | B2ST_3)
#define CONFIG_SYS_MONITOR_LEN (256 * 1024)
#define CONFIG_SYS_MALLOC_LEN (128 * 1024)
/*
* NAND Settings
* (can't be used sametime as ethernet)
*/
/* #define CONFIG_BFIN_NFC */
#ifdef CONFIG_BFIN_NFC
#define CONFIG_BFIN_NFC_CTL_VAL 0x0033
#define CONFIG_SYS_NAND_BASE 0 /* not actually used */
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define NAND_MAX_CHIPS 1
#define CONFIG_CMD_NAND
#endif
/*
* Network Settings
*/
#if !defined(__ADSPBF522__) && !defined(__ADSPBF523__) && \
!defined(__ADSPBF524__) && !defined(__ADSPBF525__) && !defined(CONFIG_BFIN_NFC)
#define ADI_CMDS_NETWORK 1
#define CONFIG_BFIN_MAC
#define CONFIG_RMII
#define CONFIG_NETCONSOLE 1
#define CONFIG_NET_MULTI 1
#endif
#define CONFIG_HOSTNAME cm-bf527
/* Uncomment next line to use fixed MAC address */
/* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */
/*
* Flash Settings
*/
#define CONFIG_FLASH_CFI_DRIVER
#define CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
#define CONFIG_SYS_FLASH_BASE 0x20000000
#define CONFIG_SYS_FLASH_CFI
#define CONFIG_SYS_FLASH_PROTECTION
#define CONFIG_SYS_MAX_FLASH_BANKS 1
#define CONFIG_SYS_MAX_FLASH_SECT 67
/*
* Env Storage Settings
*/
#define CONFIG_ENV_IS_IN_FLASH 1
#define CONFIG_ENV_ADDR 0x20008000
#define CONFIG_ENV_OFFSET 0x8000
#define CONFIG_ENV_SIZE 0x8000
#define CONFIG_ENV_SECT_SIZE 0x8000
#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
/*
* I2C Settings
*/
#define CONFIG_BFIN_TWI_I2C 1
#define CONFIG_HARD_I2C 1
/*
* Misc Settings
*/
#define CONFIG_BAUDRATE 115200
#define CONFIG_MISC_INIT_R
#define CONFIG_RTC_BFIN
#define CONFIG_UART_CONSOLE 0
#define CONFIG_BOOTCOMMAND "run flashboot"
#define FLASHBOOT_ENV_SETTINGS \
"flashboot=flread 20040000 1000000 300000;" \
"bootm 0x1000000\0"
/*
* Pull in common ADI header for remaining command/environment setup
*/
#include <configs/bfin_adi_common.h>
#endif
|
/*
LUFA Library
Copyright (C) Dean Camera, 2014.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
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, 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.
*/
/** \file
*
* Header file for BootloaderAPI.c.
*/
#ifndef _BOOTLOADER_API_H_
#define _BOOTLOADER_API_H_
/* Includes: */
#include <avr/io.h>
#include <avr/boot.h>
#include <stdbool.h>
#include <LUFA/Common/Common.h>
#include "Config/AppConfig.h"
/* Function Prototypes: */
void BootloaderAPI_ErasePage(const uint32_t Address);
void BootloaderAPI_WritePage(const uint32_t Address);
void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word);
uint8_t BootloaderAPI_ReadSignature(const uint16_t Address);
uint8_t BootloaderAPI_ReadFuse(const uint16_t Address);
uint8_t BootloaderAPI_ReadLock(void);
void BootloaderAPI_WriteLock(const uint8_t LockBits);
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.