text
stringlengths 4
6.14k
|
|---|
// Author: Enric Tejedor CERN 08/2019
// Original PyROOT code by Wim Lavrijsen, LBL
//
// /*************************************************************************
// * Copyright (C) 1995-2019, 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_TPyClassGenerator
#define ROOT_TPyClassGenerator
// ROOT
#include "TClassGenerator.h"
class TPyClassGenerator : public TClassGenerator {
public:
virtual TClass *GetClass(const char *name, Bool_t load);
virtual TClass *GetClass(const std::type_info &typeinfo, Bool_t load);
virtual TClass *GetClass(const char *name, Bool_t load, Bool_t silent);
virtual TClass *GetClass(const std::type_info &typeinfo, Bool_t load, Bool_t silent);
};
#endif // !ROOT_TPyClassGenerator
|
// 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 MEDIA_CDM_PPAPI_PPAPI_CDM_BUFFER_H_
#define MEDIA_CDM_PPAPI_PPAPI_CDM_BUFFER_H_
#include <map>
#include <utility>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "build/build_config.h"
#include "media/cdm/api/content_decryption_module.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/cpp/dev/buffer_dev.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/logging.h"
namespace media {
class PpbBufferAllocator;
// cdm::Buffer implementation that provides access to memory owned by a
// pp::Buffer_Dev.
// This class holds a reference to the Buffer_Dev throughout its lifetime.
// TODO(xhwang): Find a better name. It's confusing to have PpbBuffer,
// pp::Buffer_Dev and PPB_Buffer_Dev.
class PpbBuffer : public cdm::Buffer {
public:
static PpbBuffer* Create(const pp::Buffer_Dev& buffer,
uint32_t buffer_id,
PpbBufferAllocator* allocator);
// cdm::Buffer implementation.
void Destroy() override;
uint32_t Capacity() const override;
uint8_t* Data() override;
void SetSize(uint32_t size) override;
uint32_t Size() const override { return size_; }
// Takes the |buffer_| from this class and returns it.
// Note: The caller must ensure |allocator->Release()| is called later so that
// the buffer can be reused by the allocator.
// Since pp::Buffer_Dev is ref-counted, the caller now holds one reference to
// the buffer and this class holds no reference. Note that other references
// may still exist. For example, PpbBufferAllocator always holds a reference
// to all allocated buffers.
pp::Buffer_Dev TakeBuffer();
uint32_t buffer_id() const { return buffer_id_; }
private:
PpbBuffer(pp::Buffer_Dev buffer,
uint32_t buffer_id,
PpbBufferAllocator* allocator);
~PpbBuffer() override;
pp::Buffer_Dev buffer_;
uint32_t buffer_id_;
uint32_t size_;
PpbBufferAllocator* allocator_;
DISALLOW_COPY_AND_ASSIGN(PpbBuffer);
};
class PpbBufferAllocator {
public:
explicit PpbBufferAllocator(pp::Instance* instance)
: instance_(instance), next_buffer_id_(1) {}
~PpbBufferAllocator() {}
cdm::Buffer* Allocate(uint32_t capacity);
// Releases the buffer with |buffer_id|. A buffer can be recycled after
// it is released.
void Release(uint32_t buffer_id);
private:
typedef std::map<uint32_t, pp::Buffer_Dev> AllocatedBufferMap;
typedef std::multimap<uint32_t, std::pair<uint32_t, pp::Buffer_Dev>>
FreeBufferMap;
pp::Buffer_Dev AllocateNewBuffer(uint32_t capacity);
pp::Instance* const instance_;
uint32_t next_buffer_id_;
AllocatedBufferMap allocated_buffers_;
FreeBufferMap free_buffers_;
DISALLOW_COPY_AND_ASSIGN(PpbBufferAllocator);
};
} // namespace media
#endif // MEDIA_CDM_PPAPI_PPAPI_CDM_BUFFER_H_
|
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
* Copyright (C) 2000-2007 The R Core Team
*
* 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, a copy is available at
* http://www.r-project.org/Licenses/
*/
#include "nmath.h"
#include "dpq.h"
double pt(double x, double n, int lower_tail, int log_p)
{
/* return P[ T <= x ] where
* T ~ t_{n} (t distrib. with n degrees of freedom).
* --> ./pnt.c for NON-central
*/
double val, nx;
#ifdef IEEE_754
if (ISNAN(x) || ISNAN(n))
return x + n;
#endif
if (n <= 0.0) ML_ERR_return_NAN;
if(!R_FINITE(x))
return (x < 0) ? R_DT_0 : R_DT_1;
if(!R_FINITE(n))
return pnorm(x, 0.0, 1.0, lower_tail, log_p);
#ifdef R_version_le_260
if (n > 4e5) { /*-- Fixme(?): test should depend on `n' AND `x' ! */
/* Approx. from Abramowitz & Stegun 26.7.8 (p.949) */
val = 1./(4.*n);
return pnorm(x*(1. - val)/sqrt(1. + x*x*2.*val), 0.0, 1.0,
lower_tail, log_p);
}
#endif
nx = 1 + (x/n)*x;
/* FIXME: This test is probably losing rather than gaining precision,
* now that pbeta(*, log_p = TRUE) is much better.
* Note however that a version of this test *is* needed for x*x > D_MAX */
if(nx > 1e100) { /* <==> x*x > 1e100 * n */
/* Danger of underflow. So use Abramowitz & Stegun 26.5.4
pbeta(z, a, b) ~ z^a(1-z)^b / aB(a,b) ~ z^a / aB(a,b),
with z = 1/nx, a = n/2, b= 1/2 :
*/
double lval;
lval = -0.5*n*(2*log(fabs(x)) - log(n))
- lbeta(0.5*n, 0.5) - log(0.5*n);
val = log_p ? lval : exp(lval);
} else {
val = (n > x * x)
? pbeta (x * x / (n + x * x), 0.5, n / 2., /*lower_tail*/0, log_p)
: pbeta (1. / nx, n / 2., 0.5, /*lower_tail*/1, log_p);
}
/* Use "1 - v" if lower_tail and x > 0 (but not both):*/
if(x <= 0.)
lower_tail = !lower_tail;
if(log_p) {
if(lower_tail) return log1p(-0.5*exp(val));
else return val - M_LN2; /* = log(.5* pbeta(....)) */
}
else {
val /= 2.;
return R_D_Cval(val);
}
}
|
// license:BSD-3-Clause
// copyright-holders:David Haywood
#ifndef MAME_MACHINE_ELAN_EU3A14SYS_H
#define MAME_MACHINE_ELAN_EU3A14SYS_H
#include "elan_eu3a05commonsys.h"
class elan_eu3a14sys_device : public elan_eu3a05commonsys_device, public device_memory_interface
{
public:
elan_eu3a14sys_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
uint8_t dma_trigger_r();
void dma_trigger_w(uint8_t data);
uint8_t dma_param_r(offs_t offset);
void dma_param_w(offs_t offset, uint8_t data);
virtual void map(address_map& map) override;
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual space_config_vector memory_space_config() const override;
private:
const address_space_config m_space_config;
uint8_t m_dmaparams[9];
};
DECLARE_DEVICE_TYPE(ELAN_EU3A14_SYS, elan_eu3a14sys_device)
#endif // MAME_MACHINE_ELAN_EU3A14SYS_H
|
/***************************************************************************//**
* @file PinNames.h
*******************************************************************************
* @section License
* <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software.
* 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.
*
* DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no
* obligation to support this Software. Silicon Labs is providing the
* Software "AS IS", with no express or implied warranties of any kind,
* including, but not limited to, any implied warranties of merchantability
* or fitness for any particular purpose or warranties against infringement
* of any proprietary rights of a third party.
*
* Silicon Labs will not be liable for any consequential, incidental, or
* special damages, or any other relief, or for any claim by any third party,
* arising from your use of this Software.
*
******************************************************************************/
#ifndef MBED_PINNAMES_H
#define MBED_PINNAMES_H
#include "cmsis.h"
#include "em_gpio.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
PIN_INPUT = 0,
PIN_OUTPUT = 1
} PinDirection;
typedef enum {
/* EFM32 Pin Names
* First 4 bits represent pin number, the remaining
* bits represent port number (A = 0, B = 1, ...)
*/
PA0 = 0 << 4, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15,
PB0 = 1 << 4, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15,
PC0 = 2 << 4, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15,
PD0 = 3 << 4, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15,
PE0 = 4 << 4, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15,
PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15,
/* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */
LED0 = PC10,
LED1 = PC11,
LED2 = LED0,
LED3 = LED0,
LED4 = LED1,
/* Push Buttons */
SW0 = PC8,
SW1 = PC9,
BTN0 = SW0,
BTN1 = SW1,
/* Serial */
SERIAL_TX = PD7,
SERIAL_RX = PD6,
USBTX = PD4,
USBRX = PD5,
EFM_BC_EN = PA9,
/* Not connected */
NC = (int) 0xFFFFFFFF
} PinName;
/* 0x10 represents setting the DOUT register (see efm32 modes in ref. manual) */
typedef enum {
/* EFM32 pin modes */
Disabled = gpioModeDisabled,
DisabledPullUp = gpioModeDisabled | 0x10,
Input = gpioModeInput,
InputFilter = gpioModeInput | 0x10,
InputPullDown = gpioModeInputPull,
InputPullUp = gpioModeInputPull | 0x10,
InputPullFilterDown = gpioModeInputPullFilter,
InputPullFilterUp = gpioModeInputPullFilter | 0x10,
PushPull = gpioModePushPull,
PushPullDrive = gpioModePushPullDrive,
WiredOr = gpioModeWiredOr,
WiredOrPullDown = gpioModeWiredOrPullDown,
WiredAnd = gpioModeWiredAnd,
WiredAndFilter = gpioModeWiredAndFilter,
WiredAndPullUp = gpioModeWiredAndPullUp,
WiredAndPullUpFilter = gpioModeWiredAndPullUpFilter,
WiredAndDrive = gpioModeWiredAndDrive,
WiredAndDriveFilter = gpioModeWiredAndDriveFilter,
WiredAndDrivePullUp = gpioModeWiredAndDrivePullUp,
WiredAndDrivePullUpFilter = gpioModeWiredAndDrivePullUpFilter,
/* mbed modes:
* PullUp, PullDown, PullNone, OpenDrain
*
* mbed default digital input mode:
* PullDefault
*
* mbed default digital output mode:
* PullNone
*/
PullUp = InputPullUp,
PullDown = InputPullDown,
OpenDrain = WiredAnd,
PullNone = PushPull,
PullDefault = PushPull
} PinMode;
#ifdef __cplusplus
}
#endif
#endif
|
/* pam_winbind header file
(Solaris needs some macros from Linux for common PAM code)
Shirish Kalele 2000
*/
#include "../lib/replace/replace.h"
#include "system/syslog.h"
#include "system/time.h"
#include <talloc.h>
#include "libwbclient/wbclient.h"
#include "localedir.h"
#define MODULE_NAME "pam_winbind"
#define PAM_SM_AUTH
#define PAM_SM_ACCOUNT
#define PAM_SM_PASSWORD
#define PAM_SM_SESSION
#ifndef PAM_WINBIND_CONFIG_FILE
#define PAM_WINBIND_CONFIG_FILE "/etc/security/pam_winbind.conf"
#endif
#include <iniparser.h>
#ifdef HAVE_LIBINTL_H
#include <libintl.h>
#endif
#if defined(LINUX)
/* newer versions of PAM have this in _pam_compat.h */
#ifndef PAM_AUTHTOK_RECOVERY_ERR
#define PAM_AUTHTOK_RECOVERY_ERR PAM_AUTHTOK_RECOVER_ERR
#endif
#else /* !LINUX */
/* Solaris always uses dynamic pam modules */
#define PAM_EXTERN extern
#if defined(HAVE_SECURITY_PAM_APPL_H)
#include <security/pam_appl.h>
#elif defined(HAVE_PAM_PAM_APPL_H)
#include <pam/pam_appl.h>
#endif
#ifndef PAM_AUTHTOK_RECOVER_ERR
#define PAM_AUTHTOK_RECOVER_ERR PAM_AUTHTOK_RECOVERY_ERR
#endif
#endif /* defined(SUNOS5) || defined(SUNOS4) || defined(HPUX) || defined(FREEBSD) || defined(AIX) */
#if defined(HAVE_SECURITY_PAM_MODULES_H)
#include <security/pam_modules.h>
#elif defined(HAVE_PAM_PAM_MODULES_H)
#include <pam/pam_modules.h>
#endif
#if defined(HAVE_SECURITY__PAM_MACROS_H)
#include <security/_pam_macros.h>
#elif defined(HAVE_PAM__PAM_MACROS_H)
#include <pam/_pam_macros.h>
#else
/* Define required macros from (Linux PAM 0.68) security/_pam_macros.h */
#define _pam_drop_reply(/* struct pam_response * */ reply, /* int */ replies) \
do { \
int reply_i; \
\
for (reply_i=0; reply_i<replies; ++reply_i) { \
if (reply[reply_i].resp) { \
_pam_overwrite(reply[reply_i].resp); \
free(reply[reply_i].resp); \
} \
} \
if (reply) \
free(reply); \
} while (0)
#define _pam_overwrite(x) \
do { \
register char *__xx__; \
if ((__xx__=(x))) \
while (*__xx__) \
*__xx__++ = '\0'; \
} while (0)
/*
* Don't just free it, forget it too.
*/
#define _pam_drop(X) SAFE_FREE(X)
#define x_strdup(s) ( (s) ? strdup(s):NULL )
#endif /* HAVE_SECURITY__PAM_MACROS_H */
#ifdef HAVE_SECURITY_PAM_EXT_H
#include <security/pam_ext.h>
#endif
#define WINBIND_DEBUG_ARG 0x00000001
#define WINBIND_USE_AUTHTOK_ARG 0x00000002
#define WINBIND_UNKNOWN_OK_ARG 0x00000004
#define WINBIND_TRY_FIRST_PASS_ARG 0x00000008
#define WINBIND_USE_FIRST_PASS_ARG 0x00000010
#define WINBIND__OLD_PASSWORD 0x00000020
#define WINBIND_REQUIRED_MEMBERSHIP 0x00000040
#define WINBIND_KRB5_AUTH 0x00000080
#define WINBIND_KRB5_CCACHE_TYPE 0x00000100
#define WINBIND_CACHED_LOGIN 0x00000200
#define WINBIND_CONFIG_FILE 0x00000400
#define WINBIND_SILENT 0x00000800
#define WINBIND_DEBUG_STATE 0x00001000
#define WINBIND_WARN_PWD_EXPIRE 0x00002000
#define WINBIND_MKHOMEDIR 0x00004000
#if defined(HAVE_GETTEXT) && !defined(__LCLINT__)
#define _(string) dgettext(MODULE_NAME, string)
#else
#define _(string) string
#endif
#define N_(string) string
/*
* here is the string to inform the user that the new passwords they
* typed were not the same.
*/
#define MISTYPED_PASS _("Sorry, passwords do not match")
#define on(x, y) (x & y)
#define off(x, y) (!(x & y))
#define PAM_WINBIND_NEW_AUTHTOK_REQD "PAM_WINBIND_NEW_AUTHTOK_REQD"
#define PAM_WINBIND_NEW_AUTHTOK_REQD_DURING_AUTH "PAM_WINBIND_NEW_AUTHTOK_REQD_DURING_AUTH"
#define PAM_WINBIND_HOMEDIR "PAM_WINBIND_HOMEDIR"
#define PAM_WINBIND_LOGONSCRIPT "PAM_WINBIND_LOGONSCRIPT"
#define PAM_WINBIND_LOGONSERVER "PAM_WINBIND_LOGONSERVER"
#define PAM_WINBIND_PROFILEPATH "PAM_WINBIND_PROFILEPATH"
#define PAM_WINBIND_PWD_LAST_SET "PAM_WINBIND_PWD_LAST_SET"
#define SECONDS_PER_DAY 86400
#define DEFAULT_DAYS_TO_WARN_BEFORE_PWD_EXPIRES 14
#include "winbind_client.h"
#define PAM_WB_REMARK_DIRECT(c,x)\
{\
const char *error_string = NULL; \
error_string = _get_ntstatus_error_string(x);\
if (error_string != NULL) {\
_make_remark(c, PAM_ERROR_MSG, error_string);\
} else {\
_make_remark(c, PAM_ERROR_MSG, x);\
};\
};
#define LOGON_KRB5_FAIL_CLOCK_SKEW 0x02000000
#define PAM_WB_CACHED_LOGON(x) (x & WBC_AUTH_USER_INFO_CACHED_ACCOUNT)
#define PAM_WB_KRB5_CLOCK_SKEW(x) (x & LOGON_KRB5_FAIL_CLOCK_SKEW)
#define PAM_WB_GRACE_LOGON(x) ((WBC_AUTH_USER_INFO_CACHED_ACCOUNT|WBC_AUTH_USER_INFO_GRACE_LOGON) == ( x & (WBC_AUTH_USER_INFO_CACHED_ACCOUNT|WBC_AUTH_USER_INFO_GRACE_LOGON)))
struct pwb_context {
pam_handle_t *pamh;
int flags;
int argc;
const char **argv;
dictionary *dict;
uint32_t ctrl;
};
#ifndef TALLOC_FREE
#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
#endif
#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type)
#define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)
|
/*
* << Haru Free PDF Library 2.0.0 >> -- hpdf_destination.c
*
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
*
* 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 copyright notice and this permission notice appear
* in supporting documentation.
* It is provided "as is" without express or implied warranty.
*
*/
#ifndef _HPDF_DESTINATION_H
#define _HPDF_DESTINATION_H
#include "hpdf_objects.h"
#ifdef __cplusplus
extern "C" {
#endif
/*----------------------------------------------------------------------------*/
/*----- HPDF_Destination -----------------------------------------------------*/
HPDF_Destination
HPDF_Destination_New (HPDF_MMgr mmgr,
HPDF_Page target,
HPDF_Xref xref);
HPDF_BOOL
HPDF_Destination_Validate (HPDF_Destination dst);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _HPDF_DESTINATION_H */
|
//
// GlanceController.h
// TestWatchApp WatchKit Extension
//
// Created by Jonathan Alter on 4/16/15.
// Copyright (c) 2015 Appcelerator. All rights reserved.
//
#import <WatchKit/WatchKit.h>
#import <Foundation/Foundation.h>
@interface GlanceController : WKInterfaceController
@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_WEBUI_OPTIONS_CHROMEOS_CORE_CHROMEOS_OPTIONS_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CORE_CHROMEOS_OPTIONS_HANDLER_H_
#include <map>
#include "base/compiler_specific.h"
#include "base/memory/linked_ptr.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/ui_proxy_config_service.h"
#include "chrome/browser/ui/webui/options/core_options_handler.h"
namespace chromeos {
namespace options {
// CoreChromeOSOptionsHandler handles ChromeOS settings.
class CoreChromeOSOptionsHandler : public ::options::CoreOptionsHandler {
public:
CoreChromeOSOptionsHandler();
virtual ~CoreChromeOSOptionsHandler();
// ::CoreOptionsHandler overrides
virtual void RegisterMessages() OVERRIDE;
virtual base::Value* FetchPref(const std::string& pref_name) OVERRIDE;
virtual void InitializeHandler() OVERRIDE;
virtual void ObservePref(const std::string& pref_name) OVERRIDE;
virtual void SetPref(const std::string& pref_name,
const base::Value* value,
const std::string& metric) OVERRIDE;
virtual void StopObservingPref(const std::string& path) OVERRIDE;
// OptionsPageUIHandler implementation.
virtual void GetLocalizedValues(
base::DictionaryValue* localized_strings) OVERRIDE;
private:
virtual void OnPreferenceChanged(PrefService* service,
const std::string& pref_name) OVERRIDE;
// Called from Javascript to select the network to show proxy settings
// for. Triggers pref notifications about the updated proxy settings.
void SelectNetworkCallback(const base::ListValue* args);
// Notifies registered JS callbacks on ChromeOS setting change.
void NotifySettingsChanged(const std::string& setting_name);
void NotifyProxyPrefsChanged();
typedef std::map<std::string, linked_ptr<CrosSettings::ObserverSubscription> >
SubscriptionMap;
SubscriptionMap pref_subscription_map_;
UIProxyConfigService proxy_config_service_;
};
} // namespace options
} // namespace chromeos
#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CORE_CHROMEOS_OPTIONS_HANDLER_H_
|
/*
* Part of the HSI character device driver.
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Andras Domokos <andras.domokos at nokia.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef __HSI_CHAR_H
#define __HSI_CHAR_H
#define HSI_CHAR_MAGIC 'k'
#define HSC_IOW(num, dtype) _IOW(HSI_CHAR_MAGIC, num, dtype)
#define HSC_IOR(num, dtype) _IOR(HSI_CHAR_MAGIC, num, dtype)
#define HSC_IOWR(num, dtype) _IOWR(HSI_CHAR_MAGIC, num, dtype)
#define HSC_IO(num) _IO(HSI_CHAR_MAGIC, num)
#define HSC_RESET HSC_IO(16)
#define HSC_SET_PM HSC_IO(17)
#define HSC_SEND_BREAK HSC_IO(18)
#define HSC_SET_RX HSC_IOW(19, struct hsc_rx_config)
#define HSC_GET_RX HSC_IOW(20, struct hsc_rx_config)
#define HSC_SET_TX HSC_IOW(21, struct hsc_tx_config)
#define HSC_GET_TX HSC_IOW(22, struct hsc_tx_config)
#define HSC_PM_DISABLE 0
#define HSC_PM_ENABLE 1
#define HSC_MODE_STREAM 1
#define HSC_MODE_FRAME 2
#define HSC_FLOW_SYNC 0
#define HSC_ARB_RR 0
#define HSC_ARB_PRIO 1
struct hsc_rx_config {
uint32_t mode;
uint32_t flow;
uint32_t channels;
};
struct hsc_tx_config {
uint32_t mode;
uint32_t channels;
uint32_t speed;
uint32_t arb_mode;
};
#endif /* __HSI_CHAR_H */
|
/*!
\file gd32f30x_crc.c
\brief CRC driver
\version 2018-10-10, V1.1.0, firmware for GD32F30x (The version is for mbed)
*/
/*
Copyright (c) 2018, GigaDevice Semiconductor Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder 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.
*/
#include "gd32f30x_crc.h"
/*!
\brief deinit CRC calculation unit
\param[in] none
\param[out] none
\retval none
*/
void crc_deinit(void)
{
CRC_DATA = (uint32_t)0xFFFFFFFFU;
CRC_FDATA = (uint32_t)0x00000000U;
CRC_CTL = (uint32_t)CRC_CTL_RST;
}
/*!
\brief reset data register to the value of initializaiton data register
\param[in] none
\param[out] none
\retval none
*/
void crc_data_register_reset(void)
{
CRC_CTL |= (uint32_t)CRC_CTL_RST;
}
/*!
\brief read the data register
\param[in] none
\param[out] none
\retval 32-bit value of the data register
*/
uint32_t crc_data_register_read(void)
{
uint32_t data;
data = CRC_DATA;
return (data);
}
/*!
\brief read the free data register
\param[in] none
\param[out] none
\retval 8-bit value of the free data register
*/
uint8_t crc_free_data_register_read(void)
{
uint8_t fdata;
fdata = (uint8_t)CRC_FDATA;
return (fdata);
}
/*!
\brief write the free data register
\param[in] free_data: specify 8-bit data
\param[out] none
\retval none
*/
void crc_free_data_register_write(uint8_t free_data)
{
CRC_FDATA = (uint32_t)free_data;
}
/*!
\brief CRC calculate a 32-bit data
\param[in] sdata: specify 32-bit data
\param[out] none
\retval 32-bit CRC calculate value
*/
uint32_t crc_single_data_calculate(uint32_t sdata)
{
CRC_DATA = sdata;
return (CRC_DATA);
}
/*!
\brief CRC calculate a 32-bit data array
\param[in] array: pointer to an array of 32 bit data words
\param[in] size: size of the array
\param[out] none
\retval 32-bit CRC calculate value
*/
uint32_t crc_block_data_calculate(uint32_t array[], uint32_t size)
{
uint32_t index;
for (index = 0U; index < size; index++) {
CRC_DATA = array[index];
}
return (CRC_DATA);
}
|
/*
* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
*
* 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_CHAIN_AND_POLYGON_CONTACT_H
#define B2_CHAIN_AND_POLYGON_CONTACT_H
#include <Box2D/Dynamics/Contacts/b2Contact.h>
class b2BlockAllocator;
class b2ChainAndPolygonContact : public b2Contact
{
public:
static b2Contact* Create( b2Fixture* fixtureA, int32 indexA,
b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator);
static void Destroy(b2Contact* contact, b2BlockAllocator* allocator);
b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB);
~b2ChainAndPolygonContact() {}
void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB);
};
#endif
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PMU_HYBRID_H
#define __PMU_HYBRID_H
#include <linux/perf_event.h>
#include <linux/compiler.h>
#include <linux/list.h>
#include <stdbool.h>
#include "pmu.h"
extern struct list_head perf_pmu__hybrid_pmus;
#define perf_pmu__for_each_hybrid_pmu(pmu) \
list_for_each_entry(pmu, &perf_pmu__hybrid_pmus, hybrid_list)
bool perf_pmu__hybrid_mounted(const char *name);
struct perf_pmu *perf_pmu__find_hybrid_pmu(const char *name);
bool perf_pmu__is_hybrid(const char *name);
char *perf_pmu__hybrid_type_to_pmu(const char *type);
#endif /* __PMU_HYBRID_H */
|
#ifndef IA_CSS_DEVPROXY_SERVICE_CCM_COMM_H_
#define IA_CSS_DEVPROXY_SERVICE_CCM_COMM_H_
#include "type_support.h" /* uint8_t, uint32_t */
#include "ia_css_devproxy_ctrl.h"
/* CCM service state structure */
struct ia_css_devproxy_service_ccm_state_type {
uint32_t initialized;
uint32_t num_configs;
uint32_t used_configs;
ia_css_devproxy_ctrl_reference_t init_ref;
uint32_t num_lines;
uint32_t ack_addr;
uint32_t ack_token;
};
void ia_css_devproxy_service_ccm_init_ref(
unsigned int service_pid, /* [in] the service to address */
unsigned int channel_num, /* [in] the channel to use */
ia_css_devproxy_ctrl_reference_t *init_ref);
void ia_css_devproxy_service_ccm_route_out(
unsigned int service_pid, /* [in] the service to address */
unsigned int channel_num, /* [in] the channel to use */
uint32_t ack_addr,
uint32_t ack_token);
void ia_css_devproxy_service_ccm_config(
unsigned int service_pid, /* [in] the service to address */
unsigned int channel_num, /* [in] the channel to use */
uint32_t num_lines);
#endif /*IA_CSS_DEVPROXY_SERVICE_CCM_COMM_H_*/
|
///////////////////////////////////////////////////////////////////////////////
// Name: msw/caret.h
// Purpose: wxCaret class - the MSW implementation of wxCaret
// Author: Vadim Zeitlin
// Modified by:
// Created: 23.05.99
// RCS-ID: $Id: caret.h 35650 2005-09-23 12:56:45Z MR $
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CARET_H_
#define _WX_CARET_H_
class WXDLLEXPORT wxCaret : public wxCaretBase
{
public:
wxCaret() { Init(); }
// create the caret of given (in pixels) width and height and associate
// with the given window
wxCaret(wxWindow *window, int width, int height)
{
Init();
(void)Create(window, width, height);
}
// same as above
wxCaret(wxWindowBase *window, const wxSize& size)
{
Init();
(void)Create(window, size);
}
// process wxWindow notifications
virtual void OnSetFocus();
virtual void OnKillFocus();
protected:
void Init()
{
wxCaretBase::Init();
m_hasCaret = false;
}
// override base class virtuals
virtual void DoMove();
virtual void DoShow();
virtual void DoHide();
virtual void DoSize();
// helper function which creates the system caret
bool MSWCreateCaret();
private:
bool m_hasCaret;
DECLARE_NO_COPY_CLASS(wxCaret)
};
#endif // _WX_CARET_H_
|
/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#ifndef _X86INTRIN_H_INCLUDED
# error "Never use <tbmintrin.h> directly; include <x86intrin.h> instead."
#endif
#ifndef _TBMINTRIN_H_INCLUDED
#define _TBMINTRIN_H_INCLUDED
#ifndef __TBM__
#pragma GCC push_options
#pragma GCC target("tbm")
#define __DISABLE_TBM__
#endif /* __TBM__ */
#ifdef __OPTIMIZE__
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__bextri_u32 (unsigned int __X, const unsigned int __I)
{
return __builtin_ia32_bextri_u32 (__X, __I);
}
#else
#define __bextri_u32(X, I) \
((unsigned int)__builtin_ia32_bextri_u32 ((unsigned int)(X), \
(unsigned int)(I)))
#endif /*__OPTIMIZE__ */
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blcfill_u32 (unsigned int __X)
{
return __X & (__X + 1);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blci_u32 (unsigned int __X)
{
return __X | ~(__X + 1);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blcic_u32 (unsigned int __X)
{
return ~__X & (__X + 1);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blcmsk_u32 (unsigned int __X)
{
return __X ^ (__X + 1);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blcs_u32 (unsigned int __X)
{
return __X | (__X + 1);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blsfill_u32 (unsigned int __X)
{
return __X | (__X - 1);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blsic_u32 (unsigned int __X)
{
return ~__X | (__X - 1);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__t1mskc_u32 (unsigned int __X)
{
return ~__X | (__X + 1);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__tzmsk_u32 (unsigned int __X)
{
return ~__X & (__X - 1);
}
#ifdef __x86_64__
#ifdef __OPTIMIZE__
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__bextri_u64 (unsigned long long __X, const unsigned int __I)
{
return __builtin_ia32_bextri_u64 (__X, __I);
}
#else
#define __bextri_u64(X, I) \
((unsigned long long)__builtin_ia32_bextri_u64 ((unsigned long long)(X), \
(unsigned long long)(I)))
#endif /*__OPTIMIZE__ */
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blcfill_u64 (unsigned long long __X)
{
return __X & (__X + 1);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blci_u64 (unsigned long long __X)
{
return __X | ~(__X + 1);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blcic_u64 (unsigned long long __X)
{
return ~__X & (__X + 1);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blcmsk_u64 (unsigned long long __X)
{
return __X ^ (__X + 1);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blcs_u64 (unsigned long long __X)
{
return __X | (__X + 1);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blsfill_u64 (unsigned long long __X)
{
return __X | (__X - 1);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blsic_u64 (unsigned long long __X)
{
return ~__X | (__X - 1);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__t1mskc_u64 (unsigned long long __X)
{
return ~__X | (__X + 1);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__tzmsk_u64 (unsigned long long __X)
{
return ~__X & (__X - 1);
}
#endif /* __x86_64__ */
#ifdef __DISABLE_TBM__
#undef __DISABLE_TBM__
#pragma GCC pop_options
#endif /* __DISABLE_TBM__ */
#endif /* _TBMINTRIN_H_INCLUDED */
|
/*
* Matrix-centric header file for the SAMA5D3 family
*
* Copyright (C) 2009-2012 Atmel Corporation.
*
* Only EBI related registers.
* Write Protect register definitions may be useful.
*
* Licensed under GPLv2 or later.
*/
#ifndef SAMA5D3_MATRIX_H
#define SAMA5D3_MATRIX_H
#endif
|
/*
* Copyright (C) 2013 Stefan Roese <sr@denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <common.h>
#include <spl.h>
DECLARE_GLOBAL_DATA_PTR;
/*
* Return selected boot device. On PPC4xx its only NOR flash right now.
*/
u32 spl_boot_device(void)
{
return BOOT_DEVICE_NOR;
}
/*
* SPL version of board_init_f()
*/
void board_init_f(ulong bootflag)
{
/*
* First we need to initialize the SDRAM, so that the real
* U-Boot or the OS (Linux) can be loaded
*/
initdram(0);
/* Clear bss */
memset(__bss_start, '\0', __bss_end - __bss_start);
/*
* Init global_data pointer. Has to be done before calling
* get_clocks(), as it stores some clock values into gd needed
* later on in the serial driver.
*/
/* Pointer is writable since we allocated a register for it */
gd = (gd_t *)(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
/* Clear initial global data */
memset((void *)gd, 0, sizeof(gd_t));
/*
* get_clocks() needs to be called so that the serial driver
* works correctly
*/
get_clocks();
/*
* Do rudimental console / serial setup
*/
preloader_console_init();
/*
* Call board_init_r() (SPL framework version) to load and boot
* real U-Boot or OS
*/
board_init_r(NULL, 0);
/* Does not return!!! */
}
|
/*
* Copyright 2008 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 SkMallocPixelRef_DEFINED
#define SkMallocPixelRef_DEFINED
#include "SkPixelRef.h"
/** We explicitly use the same allocator for our pixels that SkMask does,
so that we can freely assign memory allocated by one class to the other.
*/
class SK_API SkMallocPixelRef : public SkPixelRef {
public:
SK_DECLARE_INST_COUNT(SkMallocPixelRef)
/**
* Return a new SkMallocPixelRef with the provided pixel storage, rowBytes,
* and optional colortable. The caller is responsible for managing the
* lifetime of the pixel storage buffer, as this pixelref will not try
* to delete it.
*
* The pixelref will ref() the colortable (if not NULL).
*
* Returns NULL on failure.
*/
static SkMallocPixelRef* NewDirect(const SkImageInfo&, void* addr,
size_t rowBytes, SkColorTable*);
/**
* Return a new SkMallocPixelRef, automatically allocating storage for the
* pixels. If rowBytes are 0, an optimal value will be chosen automatically.
* If rowBytes is > 0, then it will be respected, or NULL will be returned
* if rowBytes is invalid for the specified info.
*
* This pixelref will ref() the specified colortable (if not NULL).
*
* Returns NULL on failure.
*/
static SkMallocPixelRef* NewAllocate(const SkImageInfo& info,
size_t rowBytes, SkColorTable*);
/**
* Return a new SkMallocPixelRef with the provided pixel storage,
* rowBytes, and optional colortable. On destruction, ReleaseProc
* will be called.
*
* This pixelref will ref() the specified colortable (if not NULL).
*
* Returns NULL on failure.
*/
typedef void (*ReleaseProc)(void* addr, void* context);
static SkMallocPixelRef* NewWithProc(const SkImageInfo& info,
size_t rowBytes, SkColorTable*,
void* addr, ReleaseProc proc,
void* context);
/**
* Return a new SkMallocPixelRef that will use the provided
* SkData, rowBytes, and optional colortable as pixel storage.
* The SkData will be ref()ed and on destruction of the PielRef,
* the SkData will be unref()ed.
*
* This pixelref will ref() the specified colortable (if not NULL).
*
* Returns NULL on failure.
*/
static SkMallocPixelRef* NewWithData(const SkImageInfo& info,
size_t rowBytes,
SkColorTable* ctable,
SkData* data);
void* getAddr() const { return fStorage; }
class PRFactory : public SkPixelRefFactory {
public:
virtual SkPixelRef* create(const SkImageInfo&,
size_t rowBytes,
SkColorTable*) SK_OVERRIDE;
};
protected:
// The ownPixels version of this constructor is deprecated.
SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*,
bool ownPixels);
virtual ~SkMallocPixelRef();
virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE;
virtual void onUnlockPixels() SK_OVERRIDE;
virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE;
private:
void* fStorage;
SkColorTable* fCTable;
size_t fRB;
ReleaseProc fReleaseProc;
void* fReleaseProcContext;
SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*,
ReleaseProc proc, void* context);
typedef SkPixelRef INHERITED;
};
#endif
|
/* libunwind - a platform-independent unwind library
Copyright (C) 2003, 2005 Hewlett-Packard Co
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef unwind_internal_h
#define unwind_internal_h
#define UNW_LOCAL_ONLY
#include <unwind.h>
#include <stdlib.h>
#include <libunwind.h>
#include "libunwind_i.h"
/* The version of the _Unwind_*() interface implemented by this code. */
#define _U_VERSION 1
typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
(int, _Unwind_Action, uint64_t, struct _Unwind_Exception *,
struct _Unwind_Context *);
struct _Unwind_Context {
unw_cursor_t cursor;
int end_of_stack; /* set to 1 if the end of stack was reached */
};
/* This must be a macro because unw_getcontext() must be invoked from
the callee, even if optimization (and hence inlining) is turned
off. The macro arguments MUST NOT have any side-effects. */
#define _Unwind_InitContext(context, uc) \
((context)->end_of_stack = 0, \
((unw_getcontext (uc) < 0 || unw_init_local (&(context)->cursor, uc) < 0) \
? -1 : 0))
static _Unwind_Reason_Code ALWAYS_INLINE
_Unwind_Phase2 (struct _Unwind_Exception *exception_object,
struct _Unwind_Context *context)
{
_Unwind_Stop_Fn stop = (_Unwind_Stop_Fn) exception_object->private_1;
uint64_t exception_class = exception_object->exception_class;
void *stop_parameter = (void *) exception_object->private_2;
_Unwind_Personality_Fn personality;
_Unwind_Reason_Code reason;
_Unwind_Action actions;
unw_proc_info_t pi;
unw_word_t ip;
int ret;
actions = _UA_CLEANUP_PHASE;
if (stop)
actions |= _UA_FORCE_UNWIND;
while (1)
{
ret = unw_step (&context->cursor);
if (ret <= 0)
{
if (ret == 0)
{
actions |= _UA_END_OF_STACK;
context->end_of_stack = 1;
}
else
return _URC_FATAL_PHASE2_ERROR;
}
if (stop)
{
reason = (*stop) (_U_VERSION, actions, exception_class,
exception_object, context, stop_parameter);
if (reason != _URC_NO_REASON)
/* Stop function may return _URC_FATAL_PHASE2_ERROR if
it's unable to handle end-of-stack condition or
_URC_FATAL_PHASE2_ERROR if something is wrong. Not
that it matters: the resulting state is indeterminate
anyhow so we must return _URC_FATAL_PHASE2_ERROR... */
return _URC_FATAL_PHASE2_ERROR;
}
if (context->end_of_stack
|| unw_get_proc_info (&context->cursor, &pi) < 0)
return _URC_FATAL_PHASE2_ERROR;
personality = (_Unwind_Personality_Fn) (uintptr_t) pi.handler;
if (personality)
{
if (!stop)
{
if (unw_get_reg (&context->cursor, UNW_REG_IP, &ip) < 0)
return _URC_FATAL_PHASE2_ERROR;
if ((unsigned long) stop_parameter == ip)
actions |= _UA_HANDLER_FRAME;
}
reason = (*personality) (_U_VERSION, actions, exception_class,
exception_object, context);
if (reason != _URC_CONTINUE_UNWIND)
{
if (reason == _URC_INSTALL_CONTEXT)
{
/* we may regain control via _Unwind_Resume() */
unw_resume (&context->cursor);
abort ();
}
else
return _URC_FATAL_PHASE2_ERROR;
}
if (actions & _UA_HANDLER_FRAME)
/* The personality routine for the handler-frame changed
it's mind; that's a no-no... */
abort ();
}
}
return _URC_FATAL_PHASE2_ERROR; /* shouldn't be reached */
}
#endif /* unwind_internal_h */
|
/***************************************************************************/
/* */
/* gxvmorx4.c */
/* */
/* TrueTypeGX/AAT morx table validation */
/* body for "morx" type4 (Non-Contextual Glyph Substitution) subtable. */
/* */
/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* 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. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
#include "gxvmorx.h"
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_gxvmorx
FT_LOCAL_DEF( void )
gxv_morx_subtable_type4_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
{
GXV_NAME_ENTER( "morx chain subtable type4 "
"(Non-Contextual Glyph Substitution)" );
gxv_mort_subtable_type4_validate( table, limit, valid );
GXV_EXIT;
}
/* 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_BROWSING_DATA_MOCK_BROWSING_DATA_FILE_SYSTEM_HELPER_H_
#define CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_FILE_SYSTEM_HELPER_H_
#include <list>
#include <map>
#include <string>
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "chrome/browser/browsing_data/browsing_data_file_system_helper.h"
// Mock for BrowsingDataFileSystemHelper.
// Use AddFileSystemSamples() or add directly to response_ list, then call
// Notify().
class MockBrowsingDataFileSystemHelper : public BrowsingDataFileSystemHelper {
public:
explicit MockBrowsingDataFileSystemHelper(Profile* profile);
// BrowsingDataFileSystemHelper implementation.
void StartFetching(
const base::Callback<void(const std::list<FileSystemInfo>&)>& callback)
override;
void DeleteFileSystemOrigin(const GURL& origin) override;
// Adds a specific filesystem.
void AddFileSystem(const GURL& origin,
bool has_persistent,
bool has_temporary,
bool has_syncable);
// Adds some FilesystemInfo samples.
void AddFileSystemSamples();
// Notifies the callback.
void Notify();
// Marks all filesystems as existing.
void Reset();
// Returns true if all filesystemss since the last Reset() invocation were
// deleted.
bool AllDeleted();
GURL last_deleted_origin_;
private:
~MockBrowsingDataFileSystemHelper() override;
base::Callback<void(const std::list<FileSystemInfo>&)> callback_;
// Stores which filesystems exist.
std::map<const std::string, bool> file_systems_;
std::list<FileSystemInfo> response_;
DISALLOW_COPY_AND_ASSIGN(MockBrowsingDataFileSystemHelper);
};
#endif // CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_FILE_SYSTEM_HELPER_H_
|
// Copyright 2014 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 ContextAttributeHelpers_h
#define ContextAttributeHelpers_h
#include "core/html/canvas/CanvasContextCreationAttributes.h"
#include "modules/canvas2d/Canvas2DContextAttributes.h"
namespace blink {
Canvas2DContextAttributes to2DContextAttributes(const CanvasContextCreationAttributes&);
} // namespace blink
#endif // ContextAttributeHelpers_h
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_S390X_COMPAT_H
#define _ASM_S390X_COMPAT_H
/*
* Architecture specific compatibility types
*/
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/sched/task_stack.h>
#include <linux/thread_info.h>
#define compat_mode_t compat_mode_t
typedef u16 compat_mode_t;
#include <asm-generic/compat.h>
#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p( \
typeof(0?(__force t)0:0ULL), u64))
#define __SC_DELOUSE(t,v) ({ \
BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
(__force t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
})
#define PSW32_MASK_PER 0x40000000UL
#define PSW32_MASK_DAT 0x04000000UL
#define PSW32_MASK_IO 0x02000000UL
#define PSW32_MASK_EXT 0x01000000UL
#define PSW32_MASK_KEY 0x00F00000UL
#define PSW32_MASK_BASE 0x00080000UL /* Always one */
#define PSW32_MASK_MCHECK 0x00040000UL
#define PSW32_MASK_WAIT 0x00020000UL
#define PSW32_MASK_PSTATE 0x00010000UL
#define PSW32_MASK_ASC 0x0000C000UL
#define PSW32_MASK_CC 0x00003000UL
#define PSW32_MASK_PM 0x00000f00UL
#define PSW32_MASK_RI 0x00000080UL
#define PSW32_MASK_USER 0x0000FF00UL
#define PSW32_ADDR_AMODE 0x80000000UL
#define PSW32_ADDR_INSN 0x7FFFFFFFUL
#define PSW32_DEFAULT_KEY (((u32) PAGE_DEFAULT_ACC) << 20)
#define PSW32_ASC_PRIMARY 0x00000000UL
#define PSW32_ASC_ACCREG 0x00004000UL
#define PSW32_ASC_SECONDARY 0x00008000UL
#define PSW32_ASC_HOME 0x0000C000UL
#define PSW32_USER_BITS (PSW32_MASK_DAT | PSW32_MASK_IO | PSW32_MASK_EXT | \
PSW32_DEFAULT_KEY | PSW32_MASK_BASE | \
PSW32_MASK_MCHECK | PSW32_MASK_PSTATE | \
PSW32_ASC_PRIMARY)
#define COMPAT_USER_HZ 100
#define COMPAT_UTS_MACHINE "s390\0\0\0\0"
typedef u16 __compat_uid_t;
typedef u16 __compat_gid_t;
typedef u16 compat_dev_t;
typedef u16 compat_nlink_t;
typedef u16 compat_ipc_pid_t;
typedef __kernel_fsid_t compat_fsid_t;
typedef struct {
u32 mask;
u32 addr;
} __aligned(8) psw_compat_t;
typedef struct {
psw_compat_t psw;
u32 gprs[NUM_GPRS];
u32 acrs[NUM_ACRS];
u32 orig_gpr2;
} s390_compat_regs;
typedef struct {
u32 gprs_high[NUM_GPRS];
} s390_compat_regs_high;
struct compat_stat {
compat_dev_t st_dev;
u16 __pad1;
compat_ino_t st_ino;
compat_mode_t st_mode;
compat_nlink_t st_nlink;
__compat_uid_t st_uid;
__compat_gid_t st_gid;
compat_dev_t st_rdev;
u16 __pad2;
u32 st_size;
u32 st_blksize;
u32 st_blocks;
u32 st_atime;
u32 st_atime_nsec;
u32 st_mtime;
u32 st_mtime_nsec;
u32 st_ctime;
u32 st_ctime_nsec;
u32 __unused4;
u32 __unused5;
};
struct compat_flock {
short l_type;
short l_whence;
compat_off_t l_start;
compat_off_t l_len;
compat_pid_t l_pid;
};
#define F_GETLK64 12
#define F_SETLK64 13
#define F_SETLKW64 14
struct compat_flock64 {
short l_type;
short l_whence;
compat_loff_t l_start;
compat_loff_t l_len;
compat_pid_t l_pid;
};
struct compat_statfs {
u32 f_type;
u32 f_bsize;
u32 f_blocks;
u32 f_bfree;
u32 f_bavail;
u32 f_files;
u32 f_ffree;
compat_fsid_t f_fsid;
u32 f_namelen;
u32 f_frsize;
u32 f_flags;
u32 f_spare[4];
};
struct compat_statfs64 {
u32 f_type;
u32 f_bsize;
u64 f_blocks;
u64 f_bfree;
u64 f_bavail;
u64 f_files;
u64 f_ffree;
compat_fsid_t f_fsid;
u32 f_namelen;
u32 f_frsize;
u32 f_flags;
u32 f_spare[4];
};
#define COMPAT_RLIM_INFINITY 0xffffffff
#define COMPAT_OFF_T_MAX 0x7fffffff
/*
* A pointer passed in from user mode. This should not
* be used for syscall parameters, just declare them
* as pointers because the syscall entry code will have
* appropriately converted them already.
*/
static inline void __user *compat_ptr(compat_uptr_t uptr)
{
return (void __user *)(unsigned long)(uptr & 0x7fffffffUL);
}
#define compat_ptr(uptr) compat_ptr(uptr)
#ifdef CONFIG_COMPAT
static inline int is_compat_task(void)
{
return test_thread_flag(TIF_31BIT);
}
#endif
struct compat_ipc64_perm {
compat_key_t key;
__compat_uid32_t uid;
__compat_gid32_t gid;
__compat_uid32_t cuid;
__compat_gid32_t cgid;
compat_mode_t mode;
unsigned short __pad1;
unsigned short seq;
unsigned short __pad2;
unsigned int __unused1;
unsigned int __unused2;
};
struct compat_semid64_ds {
struct compat_ipc64_perm sem_perm;
compat_ulong_t sem_otime;
compat_ulong_t sem_otime_high;
compat_ulong_t sem_ctime;
compat_ulong_t sem_ctime_high;
compat_ulong_t sem_nsems;
compat_ulong_t __unused1;
compat_ulong_t __unused2;
};
struct compat_msqid64_ds {
struct compat_ipc64_perm msg_perm;
compat_ulong_t msg_stime;
compat_ulong_t msg_stime_high;
compat_ulong_t msg_rtime;
compat_ulong_t msg_rtime_high;
compat_ulong_t msg_ctime;
compat_ulong_t msg_ctime_high;
compat_ulong_t msg_cbytes;
compat_ulong_t msg_qnum;
compat_ulong_t msg_qbytes;
compat_pid_t msg_lspid;
compat_pid_t msg_lrpid;
compat_ulong_t __unused1;
compat_ulong_t __unused2;
};
struct compat_shmid64_ds {
struct compat_ipc64_perm shm_perm;
compat_size_t shm_segsz;
compat_ulong_t shm_atime;
compat_ulong_t shm_atime_high;
compat_ulong_t shm_dtime;
compat_ulong_t shm_dtime_high;
compat_ulong_t shm_ctime;
compat_ulong_t shm_ctime_high;
compat_pid_t shm_cpid;
compat_pid_t shm_lpid;
compat_ulong_t shm_nattch;
compat_ulong_t __unused1;
compat_ulong_t __unused2;
};
#endif /* _ASM_S390X_COMPAT_H */
|
/* $NoKeywords:$ */
/**
* @file
*
* NB reset init interface
*
*
*
* @xrefitem bom "File Content Label" "Release Content"
* @e project:
* @e sub-project:
* @e \$Revision: 34897 $ @e \$Date: 2010-07-14 10:07:10 +0800 (Wed, 14 Jul 2010) $
*
*/
/*
*****************************************************************************
*
* Copyright (c) 2011, Advanced Micro Devices, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Advanced Micro Devices, Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***************************************************************************
*
*/
#ifndef _NBINITATRESET_H_
#define _NBINITATRESET_H_
AGESA_STATUS
NbInitAtReset (
IN AMD_CONFIG_PARAMS *StdHeader
);
#endif
|
/****************************************************************************
Copyright 2009 - 2011 Broadcom Corporation
Unless you and Broadcom execute a separate written software license agreement
governing use of this software, this software is licensed to you under the
terms of the GNU General Public License version 2 (the GPL), available at
http://www.broadcom.com/licenses/GPLv2.php
with the following added to such license:
As a special exception, the copyright holders of this software give you
permission to link this software with independent modules, and to copy and
distribute the resulting executable under terms of your choice, provided
that you also meet, for each linked independent module, the terms and
conditions of the license of that module.
An independent module is a module which is not derived from this software.
The special exception does not apply to any modifications of the software.
Notwithstanding the above, under no circumstances may you combine this software
in any way with any other Broadcom software provided under a license other than
the GPL, without Broadcom's express prior written consent.
***************************************************************************/
/**
*
* @file voif_handler.h
*
* @brief Template voif handler API. Customer can add new API's and functions here.
*
* @note
*****************************************************************************/
/**
*
* @defgroup Audio Audio Component
*
* @brief Updated by customer
*
* @ingroup Audio Component
*****************************************************************************/
#ifndef __AUDIO_VOIF_HANDLER_H__
#define __AUDIO_VOIF_HANDLER_H__
/**
*
* @addtogroup Audio
* @{
*/
enum _VoIF_CallType_t {
VOIF_NO_CALL = 0x00,
VOIF_VOICE_CALL_NB = 0x10,
VOIF_VOICE_CALL_WB = 0x20,
VOIF_VT_CALL_NB = 0x30,
VOIF_VT_CALL_WB = 0x40
};
#define VoIF_CallType_t enum _VoIF_CallType_t
enum _VoIF_HeadsetType_t {
VOIF_OTHER_TYPE,
VOIF_HEADPHONE_TYPE, // 3-pole
VOIF_HEADSET_TYPE, // 4-pole
VOIF_TOTAL_TYPE
};
#define VoIF_HeadsetType_t enum _VoIF_HeadsetType_t
enum _VoIF_Band_t {
VOIF_NARROW_BAND = 0,
VOIF_WIDE_BAND,
VOIF_BAND_MAX
};
#define VoIF_Band_t enum _VoIF_Band_t
/**
* Start the VOIF processing.
*
* @param mode: audio mode (equivalently to channel)
* @param hstype: headset type (headset type only)
* @return void
* @note
**************************************************************************/
void VoIF_init(AudioMode_t mode, VoIF_HeadsetType_t hstype, VoIF_CallType_t callType);
/**
* Stop the VOIF processing.
*
* @param none
* @return void
* @note
**************************************************************************/
void VoIF_Deinit(void);
#ifdef CONFIG_ENABLE_VOIF
/**
* Update audio mode to VOIF handler.
*
* @param mode: audio mode (equivalently to channel)
* @param hstype: headset type (headset type only)
* @return void
* @note
**************************************************************************/
void VoIF_modeChange(AudioMode_t mode, VoIF_HeadsetType_t hstype);
/**
* Update voice volume index to VOIF handler.
*
* @param vol_index: volume index
* @return void
* @note
**************************************************************************/
void VoIF_volumeSetting(int vol_index);
/**
* Update call type to VOIF handler.
*
* @param callType: call type (VT / Voice)
* @return void
* @note
**************************************************************************/
void VoIF_setCallType(VoIF_CallType_t callType);
/**
* Return call type to VOIF handler.
*
* @param void
* @return call type (VT / Voice)
* @note
**************************************************************************/
VoIF_CallType_t VoIF_getCallType(void);
/**
* Update loopback mode to VOIF handler.
*
* @param whether loopback mode or not (0 / 1)
* @return void
* @note
**************************************************************************/
void VoIF_setLoopbackMode(short isLoopback);
#ifdef ENABLE_DIAMOND_SOLUTION
/**
* Update DHA Voice EQ parameter to VOIF handler.
*
* @param mode : audio path
* @param arg1~arg4 : parameter
* @return void
* @note
**************************************************************************/
void VoIF_setDhaVoiceEq(int mode, int arg1, int arg2, int arg3, int arg4);
#endif
#endif /* CONFIG_ENABLE_VOIF */
#ifndef CONFIG_ENABLE_VOIF
void VoIF_SetDelay(int delay); /* For test purpose only */
void VoIF_SetGain(int gain); /* For test purpose only */
#endif
#endif /* __AUDIO_VOIF_HANDLER_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 GOOGLE_APIS_GOOGLE_API_KEYS_H_
#define GOOGLE_APIS_GOOGLE_API_KEYS_H_
// If you add more includes to this file, you also need to add them to
// google_api_keys_unittest.cc.
#include <string>
// These functions enable you to retrieve keys to use for Google APIs
// such as Translate and Safe Browsing.
//
// You can retrieve either an "API key" (sometimes called a developer
// key) which identifies you (or the company you work for) as a
// developer, or you can retrieve the "client ID" and "client secret"
// used by you (or the company you work for) to generate OAuth2
// requests.
//
// Each developer (or group of developers working together for a
// single company) must request a Google API key and the client ID and
// client secret for OAuth2. See
// https://developers.google.com/console/help/ and
// https://developers.google.com/console/.
//
// The keys must either be provided using preprocessor variables (set
// via e.g. ~/.gyp/include.gypi). Alternatively, they can be
// overridden at runtime using environment variables of the same name.
//
// The names of the preprocessor variables (or environment variables
// to override them at runtime) are as follows:
// - GOOGLE_API_KEY: The API key, a.k.a. developer key.
// - GOOGLE_DEFAULT_CLIENT_ID: If set, this is used as the default for
// all client IDs not otherwise set. This is intended only for
// development.
// - GOOGLE_DEFAULT_CLIENT_SECRET: If set, this is used as the default
// for all client secrets. This is intended only for development.
// - GOOGLE_CLIENT_ID_[client name]
// (e.g. GOOGLE_CLIENT_ID_CLOUD_PRINT, i.e. one for each item in the
// OAuth2Client enumeration below)
// - GOOGLE_CLIENT_SECRET_[client name]
// (e.g. GOOGLE_CLIENT_SECRET_CLOUD_PRINT, i.e. one for each item in
// the OAuth2Client enumeration below)
//
// The GOOGLE_CLIENT_ID_MAIN and GOOGLE_CLIENT_SECRET_MAIN values can
// also be set via the command line (this overrides any other
// setting). The command-line parameters are --oauth2-client-id and
// --oauth2-client-secret.
//
// If some of the parameters mentioned above are not provided,
// Chromium will still build and run, but services that require them
// may fail to work without warning. They should do so gracefully,
// similar to what would happen when a network connection is
// unavailable.
namespace google_apis {
// Returns true if no dummy API keys or OAuth2 tokens are set.
bool HasKeysConfigured();
// Retrieves the API key, a.k.a. developer key, or a dummy string
// if not set.
//
// Note that the key should be escaped for the context you use it in,
// e.g. URL-escaped if you use it in a URL.
std::string GetAPIKey();
std::string GetSafeSitesAPIKey();
// Represents the different sets of client IDs and secrets in use.
enum OAuth2Client {
CLIENT_MAIN, // Several different features use this.
CLIENT_CLOUD_PRINT,
CLIENT_REMOTING,
CLIENT_REMOTING_HOST,
CLIENT_NUM_ITEMS // Must be last item.
};
// Retrieves the OAuth2 client ID for the specified client, or the
// empty string if not set.
//
// Note that the ID should be escaped for the context you use it in,
// e.g. URL-escaped if you use it in a URL.
std::string GetOAuth2ClientID(OAuth2Client client);
// Retrieves the OAuth2 client secret for the specified client, or the
// empty string if not set.
//
// Note that the secret should be escaped for the context you use it
// in, e.g. URL-escaped if you use it in a URL.
std::string GetOAuth2ClientSecret(OAuth2Client client);
// Returns the auth token for the data reduction proxy.
std::string GetSpdyProxyAuthValue();
// Returns if the API key using in the current build is the one for official
// Google Chrome.
bool IsGoogleChromeAPIKeyUsed();
} // namespace google_apis
#endif // GOOGLE_APIS_GOOGLE_API_KEYS_H_
|
/* rmd160.h
* Copyright (C) 2008 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
* GnuPG 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.
*
* GnuPG 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 G10_RMD160_H
#define G10_RMD160_H
void rmd160_hash_buffer (void *outbuf, const void *buffer, size_t length);
#endif /*G10_RMD160_H*/
|
/* Copyright Statement:
*
* This software/firmware and related documentation ("MediaTek Software") are
* protected under relevant copyright laws. The information contained herein
* is confidential and proprietary to MediaTek Inc. and/or its licensors.
* Without the prior written permission of MediaTek inc. and/or its licensors,
* any reproduction, modification, use or disclosure of MediaTek Software,
* and information contained herein, in whole or in part, shall be strictly prohibited.
*/
/* MediaTek Inc. (C) 2010. All rights reserved.
*
* BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
* THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
* CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
* SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
* STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
* CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* The following software/firmware and/or related documentation ("MediaTek Software")
* have been modified by MediaTek Inc. All revisions are subject to any receiver's
* applicable license agreements with MediaTek Inc.
*/
#ifndef MMC_TEST_H
#define MMC_TEST_H
//#define MMC_PROFILING
#define MMC_TEST
#ifdef __cplusplus
extern "C" {
#endif
struct mmc_test_config {
char *desc; /* description */
int id; /* host id to test */
int autocmd; /* auto command */
int mode; /* PIO/DMA mode */
int uhsmode; /* UHS mode */
int burstsz; /* DMA burst size */
int piobits;
unsigned int flags; /* DMA flags */
int count; /* repeat counts */
int clksrc; /* clock source */
unsigned int clock; /* clock frequency for testing */
unsigned int buswidth; /* bus width */
unsigned long blknr; /* n'th block number for read/write test */
unsigned int total_size; /* total size to test */
unsigned int blksz; /* block size */
int chunk_blks; /* blocks of chunk */
char *buf; /* read/write buffer */
unsigned char chk_result; /* check write result? */
unsigned char tst_single; /* test single block read/write? */
unsigned char tst_multiple; /* test multiple block read/write? */
unsigned char tst_interleave; /* test interleave block read/write ? */
};
struct mmc_op_report {
unsigned long count; /* the count of this operation */
unsigned long min_time; /* the min. time of this operation */
unsigned long max_time; /* the max. time of this operation */
unsigned long total_time; /* the total time of this operation */
unsigned long total_size; /* the total size of this operation */
};
struct mmc_op_perf {
struct mmc_host *host;
struct mmc_card *card;
struct mmc_op_report single_blk_read;
struct mmc_op_report single_blk_write;
struct mmc_op_report multi_blks_read;
struct mmc_op_report multi_blks_write;
};
typedef void (*mmc_prof_callback)(void *data, ulong id, ulong counts);
#ifdef MMC_PROFILING
#if 0
extern struct mmc_op_perf *mmc_prof_handle(int id);
extern void mmc_prof_init(int id, struct mmc_host *host, struct mmc_card *card);
extern void mmc_prof_start(void);
extern void mmc_prof_stop(void);
extern unsigned int mmc_prof_count(void);
extern void mmc_prof_update(mmc_prof_callback cb, ulong id, void *data);
extern void mmc_prof_report(struct mmc_op_report *rpt);
extern int mmc_prof_dump(int dev_id);
#else
struct mmc_op_perf *mmc_prof_handle(int id);
void mmc_prof_init(int id, struct mmc_host *host, struct mmc_card *card);
void mmc_prof_start(void);
void mmc_prof_stop(void);
unsigned int mmc_prof_count(void);
void mmc_prof_update(mmc_prof_callback cb, ulong id, void *data);
void mmc_prof_report(struct mmc_op_report *rpt);
int mmc_prof_dump(int dev_id);
#endif
#else
#define mmc_prof_handle(i) NULL
#define mmc_prof_init(i,h,c) do{}while(0)
#define mmc_prof_count() 0
#define mmc_prof_start() do{}while(0)
#define mmc_prof_stop() do{}while(0)
#define mmc_prof_update(c,i,d) do{}while(0)
#define mmc_prof_report(rpt) do{}while(0)
#define mmc_prof_dump(id) do{}while(0)
#endif
#ifdef MMC_TEST
#if 0
extern int mmc_test(int argc, char *argv[]);
#else
int mmc_test(int argc, char *argv[]);
#endif
#else
#define mmc_test(c,v) 0
#endif
#ifdef __cplusplus
}
#endif
#endif /* MMC_TEST_H */
|
/**
* Copyright (c) 2014-2015, RongCloud.
* All rights reserved.
*
* All the contents are the copyright of RongCloud Network Technology Co.Ltd.
* Unless otherwise credited. http://rongcloud.cn
*
*/
// RCPersonalInfo.h
// Created by xugang on 5/8/15.
#import <Foundation/Foundation.h>
/**
* 个人信息类
*/
@interface RCPersonalInfo : NSObject
/**
* 真实姓名
*/
@property(nonatomic, copy) NSString *realName;
/**
* 性别
*/
@property(nonatomic, copy) NSString *sex;
/**
* 生日
*/
@property(nonatomic, copy) NSString *birthday;
/**
* 年龄
*/
@property(nonatomic, copy) NSString *age;
/**
* 职业
*/
@property(nonatomic, copy) NSString *job;
/**
* 头像URL
*/
@property(nonatomic, copy) NSString *portraitUri;
/**
* 备注
*/
@property(nonatomic, copy) NSString *comment;
@end
|
// 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_EXTENSIONS_CHROME_NOTIFICATION_OBSERVER_H_
#define CHROME_BROWSER_EXTENSIONS_CHROME_NOTIFICATION_OBSERVER_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
class Browser;
namespace content {
class RenderProcessHost;
}
namespace extensions {
// Observer for Chrome-specific notifications that need to be relayed to the
// extensions module.
class ChromeNotificationObserver : public content::NotificationObserver {
public:
ChromeNotificationObserver();
~ChromeNotificationObserver() override;
// Notification handlers:
void OnRendererProcessCreated(content::RenderProcessHost* process);
// content::NotificationObserver overrides:
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
private:
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(ChromeNotificationObserver);
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_CHROME_NOTIFICATION_OBSERVER_H_
|
/*
* arch/cris/mm/ioremap.c
*
* Re-map IO memory to kernel address space so that we can access it.
* Needed for memory-mapped I/O devices mapped outside our normal DRAM
* window (that is, all memory-mapped I/O devices).
*
* (C) Copyright 1995 1996 Linus Torvalds
* CRIS-port by Axis Communications AB
*/
#include <linux/vmalloc.h>
#include <asm/io.h>
#include <asm/pgalloc.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
extern inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
unsigned long phys_addr, unsigned long flags)
{
unsigned long end;
address &= ~PMD_MASK;
end = address + size;
if (end > PMD_SIZE)
end = PMD_SIZE;
if (address >= end)
BUG();
do {
if (!pte_none(*pte)) {
printk("remap_area_pte: page already exists\n");
BUG();
}
set_pte(pte, mk_pte_phys(phys_addr, __pgprot(_PAGE_PRESENT | __READABLE |
__WRITEABLE | _PAGE_GLOBAL |
_PAGE_KERNEL | flags)));
address += PAGE_SIZE;
phys_addr += PAGE_SIZE;
pte++;
} while (address && (address < end));
}
static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
unsigned long phys_addr, unsigned long flags)
{
unsigned long end;
address &= ~PGDIR_MASK;
end = address + size;
if (end > PGDIR_SIZE)
end = PGDIR_SIZE;
phys_addr -= address;
if (address >= end)
BUG();
do {
pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address);
if (!pte)
return -ENOMEM;
remap_area_pte(pte, address, end - address, address + phys_addr, flags);
address = (address + PMD_SIZE) & PMD_MASK;
pmd++;
} while (address && (address < end));
return 0;
}
static int remap_area_pages(unsigned long address, unsigned long phys_addr,
unsigned long size, unsigned long flags)
{
int error;
pgd_t * dir;
unsigned long end = address + size;
phys_addr -= address;
dir = pgd_offset(&init_mm, address);
flush_cache_all();
if (address >= end)
BUG();
spin_lock(&init_mm.page_table_lock);
do {
pmd_t *pmd;
pmd = pmd_alloc(&init_mm, dir, address);
error = -ENOMEM;
if (!pmd)
break;
if (remap_area_pmd(pmd, address, end - address,
phys_addr + address, flags))
break;
error = 0;
address = (address + PGDIR_SIZE) & PGDIR_MASK;
dir++;
} while (address && (address < end));
spin_unlock(&init_mm.page_table_lock);
flush_tlb_all();
return error;
}
/*
* Generic mapping function (not visible outside):
*/
/*
* Remap an arbitrary physical address space into the kernel virtual
* address space. Needed when the kernel wants to access high addresses
* directly.
*
* NOTE! We need to allow non-page-aligned mappings too: we will obviously
* have to convert them into an offset in a page-aligned mapping, but the
* caller shouldn't need to know that small detail.
*/
void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags)
{
void * addr;
struct vm_struct * area;
unsigned long offset, last_addr;
/* Don't allow wraparound or zero size */
last_addr = phys_addr + size - 1;
if (!size || last_addr < phys_addr)
return NULL;
/*
* Mappings have to be page-aligned
*/
offset = phys_addr & ~PAGE_MASK;
phys_addr &= PAGE_MASK;
size = PAGE_ALIGN(last_addr+1) - phys_addr;
/*
* Ok, go for it..
*/
area = get_vm_area(size, VM_IOREMAP);
if (!area)
return NULL;
addr = area->addr;
if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) {
vfree(addr);
return NULL;
}
return (void *) (offset + (char *)addr);
}
void iounmap(void *addr)
{
if (addr > high_memory)
return vfree((void *) (PAGE_MASK & (unsigned long) addr));
}
|
/*
* linux/include/asm-cris/fasttimer.h
*
* Fast timers for ETRAX100LX
* Copyright (C) 2000-2007 Axis Communications AB
*/
#include <linux/time.h>
#include <linux/timex.h>
#ifdef CONFIG_ETRAX_FAST_TIMER
typedef void fast_timer_function_type(unsigned long);
struct fasttime_t {
unsigned long tv_jiff;
unsigned long tv_usec;
};
struct fast_timer{
struct fast_timer *next;
struct fast_timer *prev;
struct fasttime_t tv_set;
struct fasttime_t tv_expires;
unsigned long delay_us;
fast_timer_function_type *function;
unsigned long data;
const char *name;
};
extern struct fast_timer *fast_timer_list;
void start_one_shot_timer(struct fast_timer *t,
fast_timer_function_type *function,
unsigned long data,
unsigned long delay_us,
const char *name);
int del_fast_timer(struct fast_timer * t);
void schedule_usleep(unsigned long us);
int fast_timer_init(void);
#endif
|
// Copyright 2014 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 ModuleBindingsInitializer_h
#define ModuleBindingsInitializer_h
namespace blink {
class ModuleBindingsInitializer {
public:
static void init();
};
} // namespace blink
#endif
|
#ifndef __CCB_KEYFRAME_H__
#define __CCB_KEYFRAME_H__
#include "cocos2d.h"
#include "ExtensionMacros.h"
NS_CC_EXT_BEGIN
class CCBKeyframe : public CCObject
{
private:
CCObject *mValue;
float mTime;
int mEasingType;
float mEasingOpt;
public:
CCBKeyframe();
~CCBKeyframe();
CCObject* getValue();
void setValue(CCObject *pValue); // retain
float getTime();
void setTime(float fTime);
int getEasingType();
void setEasingType(int nEasingType);
float getEasingOpt();
void setEasingOpt(float fEasingOpt);
};
NS_CC_EXT_END
#endif // __CCB_KEYFRAME_H__
|
/*
* Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DEF_GUNDRAK_H
#define DEF_GUNDRAK_H
enum Data
{
DATA_SLAD_RAN_EVENT,
DATA_MOORABI_EVENT,
DATA_DRAKKARI_COLOSSUS_EVENT,
DATA_GAL_DARAH_EVENT,
DATA_ECK_THE_FEROCIOUS_EVENT,
DATA_ALIVE_RUIN_DWELLERS
};
enum Data64
{
DATA_SLAD_RAN_ALTAR,
DATA_MOORABI_ALTAR,
DATA_DRAKKARI_COLOSSUS_ALTAR,
DATA_SLAD_RAN_STATUE,
DATA_MOORABI_STATUE,
DATA_DRAKKARI_COLOSSUS_STATUE,
DATA_DRAKKARI_COLOSSUS,
DATA_RUIN_DWELLER_DIED,
DATA_STATUE_ACTIVATE,
};
enum mainCreatures
{
CREATURE_RUIN_DWELLER = 29920,
CREATURE_SLAD_RAN = 29304,
CREATURE_MOORABI = 29305,
CREATURE_GALDARAH = 29306,
CREATURE_DRAKKARICOLOSSUS = 29307,
CREATURE_ECK = 29932
};
#endif
|
/* Copyright 2019
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x1209
#define PRODUCT_ID 0xA1E5
#define DEVICE_VER 0x0008
#define MANUFACTURER Technomancy
#define PRODUCT Atreus
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 11
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
//#define BACKLIGHT_LEVELS 3
/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
|
#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 "../QtGui/qfilesystemmodel.h"
|
//
// ActiveStarter.h
//
// $Id: //poco/1.4/Foundation/include/Poco/ActiveStarter.h#1 $
//
// Library: Foundation
// Package: Threading
// Module: ActiveObjects
//
// Definition of the ActiveStarter class.
//
// Copyright (c) 2006-2007, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#ifndef Foundation_ActiveStarter_INCLUDED
#define Foundation_ActiveStarter_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/ThreadPool.h"
#include "Poco/ActiveRunnable.h"
namespace Poco {
template <class OwnerType>
class ActiveStarter
/// The default implementation of the StarterType
/// policy for ActiveMethod. It starts the method
/// in its own thread, obtained from the default
/// thread pool.
{
public:
static void start(OwnerType* pOwner, ActiveRunnableBase::Ptr pRunnable)
{
ThreadPool::defaultPool().start(*pRunnable);
pRunnable->duplicate(); // The runnable will release itself.
}
};
} // namespace Poco
#endif // Foundation_ActiveStarter_INCLUDED
|
/* Fudge a file description into a client instead of a socket connection so
* that we can write out packets to a file.
* See http://answers.launchpad.net/mosquitto/+question/123594
* also http://answers.launchpad.net/mosquitto/+question/136821
*/
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <mosquitto.h>
#include <mosquitto_internal.h>
#include <send_mosq.h>
int main(int argc, char *argv[])
{
struct mosquitto *mosq;
int fd;
bool clean_session = true;
int keepalive = 60;
mosq = mosquitto_new("packetgen", NULL);
if(!mosq){
fprintf(stderr, "Error: Out of memory.\n");
return 1;
}
/* CONNECT */
fd = open("mqtt.connect", O_CREAT|O_WRONLY, 00644);
if(fd<0){
fprintf(stderr, "Error: Unable to open mqtt.connect for writing.\n");
return 1;
}
mosq->core.sock = fd;
printf("_mosquitto_send_connect(): %d\n", _mosquitto_send_connect(mosq, keepalive, clean_session));
printf("loop: %d\n", mosquitto_loop_write(mosq));
close(fd);
/* SUBSCRIBE */
fd = open("mqtt.subscribe", O_CREAT|O_WRONLY, 00644);
if(fd<0){
fprintf(stderr, "Error: Unable to open mqtt.subscribe for writing.\n");
return 1;
}
mosq->core.sock = fd;
printf("_mosquitto_send_subscribe(): %d\n", _mosquitto_send_subscribe(mosq, NULL, false, "subscribe/topic", 2));
printf("loop: %d\n", mosquitto_loop_write(mosq));
close(fd);
mosquitto_destroy(mosq);
return 0;
}
|
//
// TMAppDelegate.h
// iOSReachabilityTestARC
//
// Created by Tony Million on 21/11/2011.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@class TMViewController;
@interface TMAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) TMViewController *viewController;
@end
|
/*****************************************************************************
* Copyright 2006 - 2011 Broadcom Corporation. All rights reserved.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2, available at
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a
* license other than the GPL, without Broadcom's express prior written
* consent.
*****************************************************************************/
#ifndef KEYMAP_SETTINGS_H
#define KEYMAP_SETTINGS_H
#define HW_DEFAULT_KEYMAP \
{ \
{ 0x01, 115 }, /* VOL_UP */ \
{ 0x11, 114 }, /* VOL_DOWN */ \
{ 0x21, 102 }, /* HOME */ \
{ 0x31, 158 }, /* BACK */ \
{ 0x41, 59 }, /* MENU */ \
{ 0x02, 108 }, /* DOWN */ \
{ 0x12, 105 }, /* LEFT */ \
{ 0x22, 103 }, /* UP */ \
{ 0x32, 232 }, /* OK (CENTER) */ \
{ 0x42, 106 }, /* RIGHT */ \
{ 0x03, 231 }, /* DIAL */ \
{ 0x13, 107 }, /* HANG_UP */ \
{ 0x23, 127 }, /* SEARCH */ \
}
#define HW_DEFAULT_POWEROFF { } /* Power button uses gpio-keys driver */
#endif
|
#ifndef __HID_ROCCAT_PYRA_H
#define __HID_ROCCAT_PYRA_H
/*
* Copyright (c) 2010 Stefan Achatz <erazor_de@users.sourceforge.net>
* Copyright (C) 2015 XiaoMi, Inc.
*/
/*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*/
#include <linux/types.h>
enum {
PYRA_SIZE_CONTROL = 0x03,
PYRA_SIZE_INFO = 0x06,
PYRA_SIZE_PROFILE_SETTINGS = 0x0d,
PYRA_SIZE_PROFILE_BUTTONS = 0x13,
PYRA_SIZE_SETTINGS = 0x03,
};
enum pyra_control_requests {
PYRA_CONTROL_REQUEST_PROFILE_SETTINGS = 0x10,
PYRA_CONTROL_REQUEST_PROFILE_BUTTONS = 0x20
};
struct pyra_settings {
uint8_t command; /* PYRA_COMMAND_SETTINGS */
uint8_t size; /* always 3 */
uint8_t startup_profile; /* Range 0-4! */
} __attribute__ ((__packed__));
struct pyra_profile_settings {
uint8_t command; /* PYRA_COMMAND_PROFILE_SETTINGS */
uint8_t size; /* always 0xd */
uint8_t number; /* Range 0-4 */
uint8_t xysync;
uint8_t x_sensitivity; /* 0x1-0xa */
uint8_t y_sensitivity;
uint8_t x_cpi; /* unused */
uint8_t y_cpi; /* this value is for x and y */
uint8_t lightswitch; /* 0 = off, 1 = on */
uint8_t light_effect;
uint8_t handedness;
uint16_t checksum; /* byte sum */
} __attribute__ ((__packed__));
struct pyra_info {
uint8_t command; /* PYRA_COMMAND_INFO */
uint8_t size; /* always 6 */
uint8_t firmware_version;
uint8_t unknown1; /* always 0 */
uint8_t unknown2; /* always 1 */
uint8_t unknown3; /* always 0 */
} __attribute__ ((__packed__));
enum pyra_commands {
PYRA_COMMAND_CONTROL = 0x4,
PYRA_COMMAND_SETTINGS = 0x5,
PYRA_COMMAND_PROFILE_SETTINGS = 0x6,
PYRA_COMMAND_PROFILE_BUTTONS = 0x7,
PYRA_COMMAND_INFO = 0x9,
PYRA_COMMAND_B = 0xb
};
enum pyra_mouse_report_numbers {
PYRA_MOUSE_REPORT_NUMBER_HID = 1,
PYRA_MOUSE_REPORT_NUMBER_AUDIO = 2,
PYRA_MOUSE_REPORT_NUMBER_BUTTON = 3,
};
struct pyra_mouse_event_button {
uint8_t report_number; /* always 3 */
uint8_t unknown; /* always 0 */
uint8_t type;
uint8_t data1;
uint8_t data2;
} __attribute__ ((__packed__));
struct pyra_mouse_event_audio {
uint8_t report_number; /* always 2 */
uint8_t type;
uint8_t unused; /* always 0 */
} __attribute__ ((__packed__));
/* hid audio controls */
enum pyra_mouse_event_audio_types {
PYRA_MOUSE_EVENT_AUDIO_TYPE_MUTE = 0xe2,
PYRA_MOUSE_EVENT_AUDIO_TYPE_VOLUME_UP = 0xe9,
PYRA_MOUSE_EVENT_AUDIO_TYPE_VOLUME_DOWN = 0xea,
};
enum pyra_mouse_event_button_types {
/*
* Mouse sends tilt events on report_number 1 and 3
* Tilt events are sent repeatedly with 0.94s between first and second
* event and 0.22s on subsequent
*/
PYRA_MOUSE_EVENT_BUTTON_TYPE_TILT = 0x10,
/*
* These are sent sequentially
* data1 contains new profile number in range 1-5
*/
PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_1 = 0x20,
PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2 = 0x30,
/*
* data1 = button_number (rmp index)
* data2 = pressed/released
*/
PYRA_MOUSE_EVENT_BUTTON_TYPE_MACRO = 0x40,
PYRA_MOUSE_EVENT_BUTTON_TYPE_SHORTCUT = 0x50,
/*
* data1 = button_number (rmp index)
*/
PYRA_MOUSE_EVENT_BUTTON_TYPE_QUICKLAUNCH = 0x60,
/* data1 = new cpi */
PYRA_MOUSE_EVENT_BUTTON_TYPE_CPI = 0xb0,
/* data1 and data2 = new sensitivity */
PYRA_MOUSE_EVENT_BUTTON_TYPE_SENSITIVITY = 0xc0,
PYRA_MOUSE_EVENT_BUTTON_TYPE_MULTIMEDIA = 0xf0,
};
enum {
PYRA_MOUSE_EVENT_BUTTON_PRESS = 0,
PYRA_MOUSE_EVENT_BUTTON_RELEASE = 1,
};
struct pyra_roccat_report {
uint8_t type;
uint8_t value;
uint8_t key;
} __attribute__ ((__packed__));
struct pyra_device {
int actual_profile;
int actual_cpi;
int roccat_claimed;
int chrdev_minor;
struct mutex pyra_lock;
struct pyra_profile_settings profile_settings[5];
};
#endif
|
/* radare - LGPL - Copyright 2009-2016 pancake */
#define R_BIN_ELF64 1
#include "bin_write_elf.c"
RBinWrite r_bin_write_elf64 = {
.scn_resize = &scn_resize,
.scn_perms = &scn_perms,
.rpath_del = &rpath_del,
.entry = &chentry,
};
|
// x86-64.h -- ELF definitions specific to EM_X86_64 -*- C++ -*-
// Copyright (C) 2006-2014 Free Software Foundation, Inc.
// Written by Andrew Chatham.
// This file is part of elfcpp.
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public License
// as published by the Free Software Foundation; either version 2, or
// (at your option) any later version.
// In addition to the permissions in the GNU Library General Public
// License, the Free Software Foundation gives you unlimited
// permission to link the compiled version of this file into
// combinations with other programs, and to distribute those
// combinations without any restriction coming from the use of this
// file. (The Library Public License restrictions do apply in other
// respects; for example, they cover modification of the file, and
/// distribution when not linked into a combined executable.)
// 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
// Library General Public License for more details.
// You should have received a copy of the GNU Library General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
// 02110-1301, USA.
#ifndef ELFCPP_X86_64_H
#define ELFCPP_X86_64_H
namespace elfcpp
{
// Documentation is taken from
// http://www.x86-64.org/documentation/abi-0.98.pdf
// elf.h
// Documentation for the TLS relocs is taken from
// http://people.redhat.com/drepper/tls.pdf
// http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt
enum
{
R_X86_64_NONE = 0, // No reloc
R_X86_64_64 = 1, // Direct 64 bit
R_X86_64_PC32 = 2, // PC relative 32 bit signed
R_X86_64_GOT32 = 3, // 32 bit GOT entry
R_X86_64_PLT32 = 4, // 32 bit PLT address
R_X86_64_COPY = 5, // Copy symbol at runtime
R_X86_64_GLOB_DAT = 6, // Create GOT entry
R_X86_64_JUMP_SLOT = 7, // Create PLT entry
R_X86_64_RELATIVE = 8, // Adjust by program base
R_X86_64_GOTPCREL = 9, // 32 bit signed PC relative offset to GOT
R_X86_64_32 = 10, // Direct 32 bit zero extended
R_X86_64_32S = 11, // Direct 32 bit sign extended
R_X86_64_16 = 12, // Direct 16 bit zero extended
R_X86_64_PC16 = 13, // 16 bit sign extended pc relative
R_X86_64_8 = 14, // Direct 8 bit sign extended
R_X86_64_PC8 = 15, // 8 bit sign extended pc relative
// TLS relocations
R_X86_64_DTPMOD64 = 16, // ID of module containing symbol
R_X86_64_DTPOFF64 = 17, // Offset in module's TLS block
R_X86_64_TPOFF64 = 18, // Offset in initial TLS block
R_X86_64_TLSGD = 19, // 32 bit signed PC relative offset to two
// GOT entries for GD symbol
R_X86_64_TLSLD = 20, // 32 bit signed PC relative offset to two
// GOT entries for LD symbol
R_X86_64_DTPOFF32 = 21, // Offset in TLS block
R_X86_64_GOTTPOFF = 22, // 32 bit signed PC relative offset to GOT
// entry for IE symbol
R_X86_64_TPOFF32 = 23, // Offset in initial TLS block
R_X86_64_PC64 = 24, // 64-bit PC relative
R_X86_64_GOTOFF64 = 25, // 64-bit GOT offset
R_X86_64_GOTPC32 = 26, // 32-bit PC relative offset to GOT
R_X86_64_GOT64 = 27, // 64-bit GOT entry offset
R_X86_64_GOTPCREL64 = 28, // 64-bit PC relative offset to GOT entry
R_X86_64_GOTPC64 = 29, // 64-bit PC relative offset to GOT
R_X86_64_GOTPLT64 = 30, // Like GOT64, indicates that PLT entry needed
R_X86_64_PLTOFF64 = 31, // 64-bit GOT relative offset to PLT entry
R_X86_64_SIZE32 = 32,
R_X86_64_SIZE64 = 33,
R_X86_64_GOTPC32_TLSDESC = 34, // 32-bit PC relative to TLS descriptor in GOT
R_X86_64_TLSDESC_CALL = 35, // Relaxable call through TLS descriptor
R_X86_64_TLSDESC = 36, // 2 by 64-bit TLS descriptor
R_X86_64_IRELATIVE = 37, // Adjust indirectly by program base
R_X86_64_RELATIVE64 = 38, // 64-bit adjust by program base
R_X86_64_PC32_BND = 39, // PC relative 32 bit signed with BND prefix
R_X86_64_PLT32_BND = 40, // 32 bit PLT address with BND prefix
// GNU vtable garbage collection extensions.
R_X86_64_GNU_VTINHERIT = 250,
R_X86_64_GNU_VTENTRY = 251
};
} // End namespace elfcpp.
#endif // !defined(ELFCPP_X86_64_H)
|
//
// Copyright 2011-2014 NimbusKit
//
// 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 "NICellFactory.h"
// Private classes for use in Nimbus.
@interface NICellObject ()
// A property to change the cell class of this cell object.
@property(nonatomic, assign) Class cellClass;
@end
|
/****************************************************************************/
/* Copyright 2009, 2010 Broadcom Corporation. All rights reserved. */
/* Unless you and Broadcom execute a separate written software license */
/* agreement governing */
/* use of this software, this software is licensed to you under the */
/* terms of the GNU General Public License version 2 (the GPL), */
/* available at */
/* */
/* http://www.broadcom.com/licenses/GPLv2.php */
/* */
/* with the following added to such license: */
/* */
/* As a special exception, the copyright holders of this software give */
/* you permission to link this software with independent modules, and */
/* to copy and distribute the resulting executable under terms of your */
/* choice, provided that you also meet, for each linked independent */
/* module, the terms and conditions of the license of that module. */
/* An independent module is a module which is not derived from this */
/* software. The special exception does not apply to any modifications */
/* of the software. */
/* */
/* Notwithstanding the above, under no circumstances may you combine */
/* this software in any way with any other Broadcom software provided */
/* under a license other than the GPL, without Broadcom's express prior */
/* written consent. */
/* */
/****************************************************************************/
/**
*
* @file csl_audio_capture.h
*
* @brief This file contains the definition for capture CSL driver layer
*
****************************************************************************/
#ifndef _CSL_AUDIO_CAPTURE_
#define _CSL_AUDIO_CAPTURE_
typedef void (*CSL_AUDCAPTURE_CB) (UInt32 streamID);
struct _CSL_CAPH_Capture_Drv_t {
UInt32 streamID;
CSL_CAPH_DEVICE_e source;
CSL_CAPH_DEVICE_e sink;
CSL_CAPH_PathID pathID;
CSL_AUDCAPTURE_CB dmaCB;
CSL_CAPH_DMA_CHNL_e dmaCH;
CSL_CAPH_DMA_CHNL_e dmaCH2; /* temp leave this back compatible */
UInt8 *ringBuffer;
UInt32 numBlocks;
UInt32 blockSize;
UInt32 blockIndex;
} ;
#define CSL_CAPH_Capture_Drv_t struct _CSL_CAPH_Capture_Drv_t
/**
*
* @brief initialize the audio capture block
*
* @param source (in) The source of the audio stream.
* @param sink (in) The sink of the audio stream.
*
* @return UInt32 the capture stream ID.
*****************************************************************************/
UInt32 csl_audio_capture_init(CSL_CAPH_DEVICE_e source, CSL_CAPH_DEVICE_e sink);
/**
*
* @brief deinitialize the audio capture
*
* @param streamID (in) Capture stream ID
*
* @return Result_t status
*****************************************************************************/
Result_t csl_audio_capture_deinit(UInt32 streamID);
/**
*
* @brief configure a audio capture for processing audio stream
*
* @param sampleRate (in) Sampling rate for this stream
* @param numChannels (in) number of channels
* @param bitsPerSample (in) bits/sample
* @param ringBuffer (in) start address of ring buffer
* @param numBlocks (in) number of blocks in ring buffer
* @param blockSize (in) size per each block
* @param csl_audio_capture_cb (in) cb registered by capture driver
* @param streamID (in) stream id of this stream
*
* @return Result_t status
*****************************************************************************/
Result_t csl_audio_capture_configure(AUDIO_SAMPLING_RATE_t sampleRate,
AUDIO_NUM_OF_CHANNEL_t numChannels,
AUDIO_BITS_PER_SAMPLE_t bitsPerSample,
UInt8 *ringBuffer,
UInt32 numBlocks,
UInt32 blockSize,
CSL_AUDCAPTURE_CB csl_audio_capture_cb,
UInt32 streamID);
/**
*
* @brief start the stream for audio capture
*
* @param streamID (in) capture audio stream id
*
* @return Result_t status
*****************************************************************************/
Result_t csl_audio_capture_start(UInt32 streamID);
/**
*
* @brief stop the stream for a caph capture
*
* @param streamID (in) capture audio stream id
*
* @return Result_t status
*****************************************************************************/
Result_t csl_audio_capture_stop(UInt32 streamID);
/**
*
* @brief pause the stream for audio capture
*
* @param streamID (in) capture audio stream id
*
* @return Result_t status
*****************************************************************************/
Result_t csl_audio_capture_pause(UInt32 streamID);
/**
*
* @brief resume the stream for audio capture
*
* @param streamID (in) capture audio stream id
*
* @return Result_t status
*****************************************************************************/
Result_t csl_audio_capture_resume(UInt32 streamID);
CSL_CAPH_Capture_Drv_t *GetCaptureDriverByType(UInt32 streamID);
#endif /* _CSL_AUDIO_CAPTURE_ */
|
///
/// \file AliFemtoV0Cut.h
///
#ifndef AliFemtoV0Cut_hh
#define AliFemtoV0Cut_hh
#include "AliFemtoTypes.h"
#include "AliFemtoV0.h"
#include "AliFemtoXi.h"
#include "AliFemtoParticleCut.h"
/// \class AliFemtoV0Cut
/// \brief The pure virtual base class for the V0 cut
///
/// All V0 cuts must inherit from this one.
///
class AliFemtoV0Cut : public AliFemtoParticleCut {
public:
AliFemtoV0Cut(); ///< default constructor. - Users should write their own
AliFemtoV0Cut(const AliFemtoV0Cut& aCut); ///< copy constructor
virtual ~AliFemtoV0Cut(); ///< destructor
AliFemtoV0Cut& operator=(const AliFemtoV0Cut& aCut); ///< copy constructor
virtual bool Pass(const AliFemtoV0* aV0) = 0; ///< true if V0 passes, false if not
virtual bool Pass(const AliFemtoXi* aXi) = 0; ///< true if Xi passes, false if not
virtual AliFemtoParticleType Type() { return hbtV0; };
virtual AliFemtoV0Cut* Clone() { return NULL; }; ///< WARNING - default implementation returns NULL
#ifdef __ROOT__
/// \cond CLASSIMP
ClassDef(AliFemtoV0Cut, 0);
/// \endcond
#endif
};
inline AliFemtoV0Cut::AliFemtoV0Cut()
{ // no-op
}
inline AliFemtoV0Cut::AliFemtoV0Cut(const AliFemtoV0Cut& c):
AliFemtoParticleCut(c)
{ // no-op
}
inline AliFemtoV0Cut::~AliFemtoV0Cut()
{ // no-op
}
inline AliFemtoV0Cut& AliFemtoV0Cut::operator=(const AliFemtoV0Cut& c)
{
if (this != &c) {
AliFemtoParticleCut::operator=(c);
}
return *this;
}
#endif
|
#ifndef INCLUDE_XEN_OPS_H
#define INCLUDE_XEN_OPS_H
#include <linux/percpu.h>
#include <linux/notifier.h>
#include <linux/efi.h>
#include <asm/xen/interface.h>
DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu);
void xen_arch_pre_suspend(void);
void xen_arch_post_suspend(int suspend_cancelled);
void xen_timer_resume(void);
void xen_arch_resume(void);
void xen_resume_notifier_register(struct notifier_block *nb);
void xen_resume_notifier_unregister(struct notifier_block *nb);
int xen_setup_shutdown_event(void);
extern unsigned long *xen_contiguous_bitmap;
int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
unsigned int address_bits,
dma_addr_t *dma_handle);
void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order);
struct vm_area_struct;
int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
unsigned long addr,
xen_pfn_t mfn, int nr,
pgprot_t prot, unsigned domid,
struct page **pages);
int xen_unmap_domain_mfn_range(struct vm_area_struct *vma,
int numpgs, struct page **pages);
bool xen_running_on_version_or_later(unsigned int major, unsigned int minor);
#ifdef CONFIG_XEN_EFI
extern efi_system_table_t *xen_efi_probe(void);
#else
static inline efi_system_table_t __init *xen_efi_probe(void)
{
return NULL;
}
#endif
#ifdef CONFIG_PREEMPT
static inline void xen_preemptible_hcall_begin(void)
{
}
static inline void xen_preemptible_hcall_end(void)
{
}
#else
DECLARE_PER_CPU(bool, xen_in_preemptible_hcall);
static inline void xen_preemptible_hcall_begin(void)
{
__this_cpu_write(xen_in_preemptible_hcall, true);
}
static inline void xen_preemptible_hcall_end(void)
{
__this_cpu_write(xen_in_preemptible_hcall, false);
}
#endif /* CONFIG_PREEMPT */
#endif /* INCLUDE_XEN_OPS_H */
|
/* Copyright 2020 DmNosachev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* ,-------------------------------------------------------------------------------------------------------------------------------------.
* | xxx | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | xxx |PrnSc| ScLk|Pause| |
* |-------------------------------------------------------------------------------------------------------------------------------------|
* | esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ~ |backspc| | ins | del | |NumLk| / | * | - |
* |-------------------------------------------------------------------------------------------------------------------------------------|
* | tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | enter | PgUp| PgDn| | 7 | 8 | 9 | += |
* |-------------------------------------------------------------------------------- |--------------------------------------|
* | ctrl | A | S | D | F | G | H | J | K | L | ;: | '" | |\ | | home| end | | 4 | 5 | 6 | + |
* |-------------------------------------------------------------------------------------------------------------------------------------|
* | shift | Z | X | C | V | B | N | M | , | . | /? | ctrl| shift | up | down| | 1 | 2 | 3 |enter|
* |-------------------------------------------------------------------------------------------------------------------------------| |
* | | gui | alt | Space | alt | | left|right| | 0 | . | |
* `-------------------------------------------------------------------------------------------------------------------------------------'
*/
[0] = LAYOUT(
KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS,
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_INS, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGUP, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_EQL,
KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_HOME, KC_END, KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RCTRL, KC_RSFT, KC_UP, KC_DOWN, KC_P1, KC_P2, KC_P3, KC_PENT,
KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_LEFT, KC_RGHT, KC_P0, KC_PDOT
)
};
void keyboard_post_init_user(void) {
// Customise these values to desired behaviour
debug_enable=true;
debug_matrix=true;
//debug_keyboard=true;
//debug_mouse=true;
}
|
/******************************************************************************
*
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
******************************************************************************/
#define _OSDEP_SERVICE_C_
#include <osdep_service.h>
#include <drv_types.h>
#include <recv_osdep.h>
#include <linux/vmalloc.h>
#define RT_TAG ('1178')
/*
* Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE23a
* @return: one of RTW_STATUS_CODE23a
*/
inline int RTW_STATUS_CODE23a(int error_code)
{
if (error_code >= 0)
return _SUCCESS;
return _FAIL;
}
inline u8 *_rtw_vmalloc(u32 sz)
{
u8 *pbuf;
pbuf = vmalloc(sz);
return pbuf;
}
inline u8 *_rtw_zvmalloc(u32 sz)
{
u8 *pbuf;
pbuf = _rtw_vmalloc(sz);
if (pbuf != NULL)
memset(pbuf, 0, sz);
return pbuf;
}
inline void _rtw_vmfree(u8 *pbuf, u32 sz)
{
vfree(pbuf);
}
void _rtw_init_queue23a(struct rtw_queue *pqueue)
{
INIT_LIST_HEAD(&pqueue->queue);
spin_lock_init(&pqueue->lock);
}
u32 _rtw_queue_empty23a(struct rtw_queue *pqueue)
{
if (list_empty(&pqueue->queue))
return true;
else
return false;
}
u64 rtw_modular6423a(u64 x, u64 y)
{
return do_div(x, y);
}
u64 rtw_division6423a(u64 x, u64 y)
{
do_div(x, y);
return x;
}
/* rtw_cbuf_full23a - test if cbuf is full
* @cbuf: pointer of struct rtw_cbuf
*
* Returns: true if cbuf is full
*/
inline bool rtw_cbuf_full23a(struct rtw_cbuf *cbuf)
{
return (cbuf->write == cbuf->read-1) ? true : false;
}
/* rtw_cbuf_empty23a - test if cbuf is empty
* @cbuf: pointer of struct rtw_cbuf
*
* Returns: true if cbuf is empty
*/
inline bool rtw_cbuf_empty23a(struct rtw_cbuf *cbuf)
{
return (cbuf->write == cbuf->read) ? true : false;
}
/**
* rtw_cbuf_push23a - push a pointer into cbuf
* @cbuf: pointer of struct rtw_cbuf
* @buf: pointer to push in
*
* Lock free operation, be careful of the use scheme
* Returns: true push success
*/
bool rtw_cbuf_push23a(struct rtw_cbuf *cbuf, void *buf)
{
if (rtw_cbuf_full23a(cbuf))
return _FAIL;
if (0)
DBG_8723A("%s on %u\n", __func__, cbuf->write);
cbuf->bufs[cbuf->write] = buf;
cbuf->write = (cbuf->write+1)%cbuf->size;
return _SUCCESS;
}
/**
* rtw_cbuf_pop23a - pop a pointer from cbuf
* @cbuf: pointer of struct rtw_cbuf
*
* Lock free operation, be careful of the use scheme
* Returns: pointer popped out
*/
void *rtw_cbuf_pop23a(struct rtw_cbuf *cbuf)
{
void *buf;
if (rtw_cbuf_empty23a(cbuf))
return NULL;
if (0)
DBG_8723A("%s on %u\n", __func__, cbuf->read);
buf = cbuf->bufs[cbuf->read];
cbuf->read = (cbuf->read+1)%cbuf->size;
return buf;
}
/**
* rtw_cbuf_alloc23a - allocte a rtw_cbuf with given size and do initialization
* @size: size of pointer
*
* Returns: pointer of srtuct rtw_cbuf, NULL for allocation failure
*/
struct rtw_cbuf *rtw_cbuf_alloc23a(u32 size)
{
struct rtw_cbuf *cbuf;
cbuf = kmalloc(sizeof(*cbuf) + sizeof(void *)*size, GFP_KERNEL);
if (cbuf) {
cbuf->write = 0;
cbuf->read = 0;
cbuf->size = size;
}
return cbuf;
}
/**
* rtw_cbuf_free - free the given rtw_cbuf
* @cbuf: pointer of struct rtw_cbuf to free
*/
void rtw_cbuf_free(struct rtw_cbuf *cbuf)
{
kfree(cbuf);
}
|
/*
* lib/fib_lookup/request.c FIB Lookup Request
*
* 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 version 2.1
* of the License.
*
* Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
*/
/**
* @ingroup fib_lookup
* @defgroup flreq Request
* @brief
* @{
*/
#include <netlink-local.h>
#include <netlink/netlink.h>
#include <netlink/attr.h>
#include <netlink/utils.h>
#include <netlink/object.h>
#include <netlink/fib_lookup/request.h>
static struct nl_object_ops request_obj_ops;
/** @cond SKIP */
#define REQUEST_ATTR_ADDR 0x01
#define REQUEST_ATTR_FWMARK 0x02
#define REQUEST_ATTR_TOS 0x04
#define REQUEST_ATTR_SCOPE 0x08
#define REQUEST_ATTR_TABLE 0x10
/** @endcond */
static void request_free_data(struct nl_object *obj)
{
struct flnl_request *req = REQUEST_CAST(obj);
if (req)
nl_addr_put(req->lr_addr);
}
static int request_clone(struct nl_object *_dst, struct nl_object *_src)
{
struct flnl_request *dst = nl_object_priv(_dst);
struct flnl_request *src = nl_object_priv(_src);
if (src->lr_addr)
if (!(dst->lr_addr = nl_addr_clone(src->lr_addr)))
return -NLE_NOMEM;
return 0;
}
static int request_compare(struct nl_object *_a, struct nl_object *_b,
uint32_t attrs, int flags)
{
struct flnl_request *a = (struct flnl_request *) _a;
struct flnl_request *b = (struct flnl_request *) _b;
int diff = 0;
#define REQ_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, REQUEST_ATTR_##ATTR, a, b, EXPR)
diff |= REQ_DIFF(FWMARK, a->lr_fwmark != b->lr_fwmark);
diff |= REQ_DIFF(TOS, a->lr_tos != b->lr_tos);
diff |= REQ_DIFF(SCOPE, a->lr_scope != b->lr_scope);
diff |= REQ_DIFF(TABLE, a->lr_table != b->lr_table);
diff |= REQ_DIFF(ADDR, nl_addr_cmp(a->lr_addr, b->lr_addr));
#undef REQ_DIFF
return diff;
}
/**
* @name Lookup Request Creation/Deletion
* @{
*/
struct flnl_request *flnl_request_alloc(void)
{
return REQUEST_CAST(nl_object_alloc(&request_obj_ops));
}
/** @} */
/**
* @name Attributes
* @{
*/
void flnl_request_set_fwmark(struct flnl_request *req, uint64_t fwmark)
{
req->lr_fwmark = fwmark;
req->ce_mask |= REQUEST_ATTR_FWMARK;
}
uint64_t flnl_request_get_fwmark(struct flnl_request *req)
{
if (req->ce_mask & REQUEST_ATTR_FWMARK)
return req->lr_fwmark;
else
return UINT_LEAST64_MAX;
}
void flnl_request_set_tos(struct flnl_request *req, int tos)
{
req->lr_tos = tos;
req->ce_mask |= REQUEST_ATTR_TOS;
}
int flnl_request_get_tos(struct flnl_request *req)
{
if (req->ce_mask & REQUEST_ATTR_TOS)
return req->lr_tos;
else
return -1;
}
void flnl_request_set_scope(struct flnl_request *req, int scope)
{
req->lr_scope = scope;
req->ce_mask |= REQUEST_ATTR_SCOPE;
}
int flnl_request_get_scope(struct flnl_request *req)
{
if (req->ce_mask & REQUEST_ATTR_SCOPE)
return req->lr_scope;
else
return -1;
}
void flnl_request_set_table(struct flnl_request *req, int table)
{
req->lr_table = table;
req->ce_mask |= REQUEST_ATTR_TABLE;
}
int flnl_request_get_table(struct flnl_request *req)
{
if (req->ce_mask & REQUEST_ATTR_TABLE)
return req->lr_table;
else
return -1;
}
int flnl_request_set_addr(struct flnl_request *req, struct nl_addr *addr)
{
if (addr->a_family != AF_INET)
return -NLE_AF_NOSUPPORT;
if (req->lr_addr)
nl_addr_put(req->lr_addr);
nl_addr_get(addr);
req->lr_addr = addr;
req->ce_mask |= REQUEST_ATTR_ADDR;
return 0;
}
struct nl_addr *flnl_request_get_addr(struct flnl_request *req)
{
if (req->ce_mask & REQUEST_ATTR_ADDR)
return req->lr_addr;
else
return NULL;
}
/** @} */
static struct nl_object_ops request_obj_ops = {
.oo_name = "fib_lookup/request",
.oo_size = sizeof(struct flnl_request),
.oo_free_data = request_free_data,
.oo_clone = request_clone,
.oo_compare = request_compare,
.oo_id_attrs = ~0,
};
/** @} */
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_X86_CACHEFLUSH_H
#define _ASM_X86_CACHEFLUSH_H
/* Caches aren't brain-dead on the intel. */
#include <asm-generic/cacheflush.h>
#include <asm/special_insns.h>
void clflush_cache_range(void *addr, unsigned int size);
#endif /* _ASM_X86_CACHEFLUSH_H */
|
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
* Copyright 2004-2008 Analog Devices Inc.
*
* Licensed under the GPL-2 or later.
*/
#ifndef _UAPI_BFIN_SIGINFO_H
#define _UAPI_BFIN_SIGINFO_H
#include <linux/types.h>
#include <asm-generic/siginfo.h>
#define UID16_SIGINFO_COMPAT_NEEDED
#define si_uid16 _sifields._kill._uid
#define ILL_ILLPARAOP 2 /* illegal opcode combine ********** */
#define ILL_ILLEXCPT 4 /* unrecoverable exception ********** */
#define ILL_CPLB_VI 9 /* D/I CPLB protect violation ******** */
#define ILL_CPLB_MISS 10 /* D/I CPLB miss ******** */
#define ILL_CPLB_MULHIT 11 /* D/I CPLB multiple hit ******** */
#undef NSIGILL
#define NSIGILL 11
/*
* SIGBUS si_codes
*/
#define BUS_OPFETCH 4 /* error from instruction fetch ******** */
#undef NSIGBUS
#define NSIGBUS 4
/*
* SIGTRAP si_codes
*/
#define TRAP_STEP 1 /* single-step breakpoint************* */
#define TRAP_TRACEFLOW 2 /* trace buffer overflow ************* */
#define TRAP_WATCHPT 3 /* watchpoint match ************* */
#define TRAP_ILLTRAP 4 /* illegal trap ************* */
#undef NSIGTRAP
#define NSIGTRAP 4
/*
* SIGSEGV si_codes
*/
#define SEGV_STACKFLOW 3 /* stack overflow */
#undef NSIGSEGV
#define NSIGSEGV 3
#endif /* _UAPI_BFIN_SIGINFO_H */
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* lm70.c
*
* The LM70 is a temperature sensor chip from National Semiconductor (NS).
* Copyright (C) 2006 Kaiwan N Billimoria <kaiwan@designergraphix.com>
*
* The LM70 communicates with a host processor via an SPI/Microwire Bus
* interface. The complete datasheet is available at National's website
* here:
* http://www.national.com/pf/LM/LM70.html
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/sysfs.h>
#include <linux/hwmon.h>
#include <linux/mutex.h>
#include <linux/mod_devicetable.h>
#include <linux/property.h>
#include <linux/spi/spi.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#define DRVNAME "lm70"
#define LM70_CHIP_LM70 0 /* original NS LM70 */
#define LM70_CHIP_TMP121 1 /* TI TMP121/TMP123 */
#define LM70_CHIP_LM71 2 /* NS LM71 */
#define LM70_CHIP_LM74 3 /* NS LM74 */
#define LM70_CHIP_TMP122 4 /* TI TMP122/TMP124 */
struct lm70 {
struct spi_device *spi;
struct mutex lock;
unsigned int chip;
};
/* sysfs hook function */
static ssize_t temp1_input_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct lm70 *p_lm70 = dev_get_drvdata(dev);
struct spi_device *spi = p_lm70->spi;
int status, val = 0;
u8 rxbuf[2];
s16 raw = 0;
if (mutex_lock_interruptible(&p_lm70->lock))
return -ERESTARTSYS;
/*
* spi_read() requires a DMA-safe buffer; so we use
* spi_write_then_read(), transmitting 0 bytes.
*/
status = spi_write_then_read(spi, NULL, 0, &rxbuf[0], 2);
if (status < 0) {
dev_warn(dev, "spi_write_then_read failed with status %d\n",
status);
goto out;
}
raw = (rxbuf[0] << 8) + rxbuf[1];
dev_dbg(dev, "rxbuf[0] : 0x%02x rxbuf[1] : 0x%02x raw=0x%04x\n",
rxbuf[0], rxbuf[1], raw);
/*
* LM70:
* The "raw" temperature read into rxbuf[] is a 16-bit signed 2's
* complement value. Only the MSB 11 bits (1 sign + 10 temperature
* bits) are meaningful; the LSB 5 bits are to be discarded.
* See the datasheet.
*
* Further, each bit represents 0.25 degrees Celsius; so, multiply
* by 0.25. Also multiply by 1000 to represent in millidegrees
* Celsius.
* So it's equivalent to multiplying by 0.25 * 1000 = 250.
*
* LM74 and TMP121/TMP122/TMP123/TMP124:
* 13 bits of 2's complement data, discard LSB 3 bits,
* resolution 0.0625 degrees celsius.
*
* LM71:
* 14 bits of 2's complement data, discard LSB 2 bits,
* resolution 0.0312 degrees celsius.
*/
switch (p_lm70->chip) {
case LM70_CHIP_LM70:
val = ((int)raw / 32) * 250;
break;
case LM70_CHIP_TMP121:
case LM70_CHIP_TMP122:
case LM70_CHIP_LM74:
val = ((int)raw / 8) * 625 / 10;
break;
case LM70_CHIP_LM71:
val = ((int)raw / 4) * 3125 / 100;
break;
}
status = sprintf(buf, "%d\n", val); /* millidegrees Celsius */
out:
mutex_unlock(&p_lm70->lock);
return status;
}
static DEVICE_ATTR_RO(temp1_input);
static struct attribute *lm70_attrs[] = {
&dev_attr_temp1_input.attr,
NULL
};
ATTRIBUTE_GROUPS(lm70);
/*----------------------------------------------------------------------*/
#ifdef CONFIG_OF
static const struct of_device_id lm70_of_ids[] = {
{
.compatible = "ti,lm70",
.data = (void *) LM70_CHIP_LM70,
},
{
.compatible = "ti,tmp121",
.data = (void *) LM70_CHIP_TMP121,
},
{
.compatible = "ti,tmp122",
.data = (void *) LM70_CHIP_TMP122,
},
{
.compatible = "ti,lm71",
.data = (void *) LM70_CHIP_LM71,
},
{
.compatible = "ti,lm74",
.data = (void *) LM70_CHIP_LM74,
},
{},
};
MODULE_DEVICE_TABLE(of, lm70_of_ids);
#endif
#ifdef CONFIG_ACPI
static const struct acpi_device_id lm70_acpi_ids[] = {
{
.id = "LM000070",
.driver_data = LM70_CHIP_LM70,
},
{
.id = "TMP00121",
.driver_data = LM70_CHIP_TMP121,
},
{
.id = "LM000071",
.driver_data = LM70_CHIP_LM71,
},
{
.id = "LM000074",
.driver_data = LM70_CHIP_LM74,
},
{},
};
MODULE_DEVICE_TABLE(acpi, lm70_acpi_ids);
#endif
static int lm70_probe(struct spi_device *spi)
{
struct device *hwmon_dev;
struct lm70 *p_lm70;
int chip;
if (dev_fwnode(&spi->dev))
chip = (int)(uintptr_t)device_get_match_data(&spi->dev);
else
chip = spi_get_device_id(spi)->driver_data;
/* signaling is SPI_MODE_0 */
if (spi->mode & (SPI_CPOL | SPI_CPHA))
return -EINVAL;
/* NOTE: we assume 8-bit words, and convert to 16 bits manually */
p_lm70 = devm_kzalloc(&spi->dev, sizeof(*p_lm70), GFP_KERNEL);
if (!p_lm70)
return -ENOMEM;
mutex_init(&p_lm70->lock);
p_lm70->chip = chip;
p_lm70->spi = spi;
hwmon_dev = devm_hwmon_device_register_with_groups(&spi->dev,
spi->modalias,
p_lm70, lm70_groups);
return PTR_ERR_OR_ZERO(hwmon_dev);
}
static const struct spi_device_id lm70_ids[] = {
{ "lm70", LM70_CHIP_LM70 },
{ "tmp121", LM70_CHIP_TMP121 },
{ "tmp122", LM70_CHIP_TMP122 },
{ "lm71", LM70_CHIP_LM71 },
{ "lm74", LM70_CHIP_LM74 },
{ },
};
MODULE_DEVICE_TABLE(spi, lm70_ids);
static struct spi_driver lm70_driver = {
.driver = {
.name = "lm70",
.of_match_table = of_match_ptr(lm70_of_ids),
.acpi_match_table = ACPI_PTR(lm70_acpi_ids),
},
.id_table = lm70_ids,
.probe = lm70_probe,
};
module_spi_driver(lm70_driver);
MODULE_AUTHOR("Kaiwan N Billimoria");
MODULE_DESCRIPTION("NS LM70 and compatibles Linux driver");
MODULE_LICENSE("GPL");
|
/*
* 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.
*
* Copyright (C) 2010 John Crispin <blogic@openwrt.org>
*/
#include <linux/module.h>
#include <linux/clk.h>
#include <asm/bootinfo.h>
#include <asm/time.h>
#include <lantiq_soc.h>
#include "../prom.h"
#define SOC_AMAZON_SE "Amazon_SE"
#define PART_SHIFT 12
#define PART_MASK 0x0FFFFFFF
#define REV_SHIFT 28
#define REV_MASK 0xF0000000
void __init ltq_soc_detect(struct ltq_soc_info *i)
{
i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
switch (i->partnum) {
case SOC_ID_AMAZON_SE:
i->name = SOC_AMAZON_SE;
i->type = SOC_TYPE_AMAZON_SE;
break;
default:
unreachable();
break;
}
}
|
/****************************************************************************
(c) SYSTEC electronic GmbH, D-07973 Greiz, August-Bebel-Str. 29
www.systec-electronic.com
Project: openPOWERLINK
Description: include file for NMT-Userspace-Module
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 name of SYSTEC electronic GmbH nor the names of its
contributors may be used to endorse or promote products derived
from this software without prior written permission. For written
permission, please contact info@systec-electronic.com.
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 HOLDERS 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.
Severability Clause:
If a provision of this License is or becomes illegal, invalid or
unenforceable in any jurisdiction, that shall not affect:
1. the validity or enforceability in that jurisdiction of any other
provision of this License; or
2. the validity or enforceability in other jurisdictions of that or
any other provision of this License.
-------------------------------------------------------------------------
$RCSfile: EplNmtu.h,v $
$Author: D.Krueger $
$Revision: 1.5 $ $Date: 2008/10/17 15:32:32 $
$State: Exp $
Build Environment:
GCC V3.4
-------------------------------------------------------------------------
Revision History:
2006/06/09 k.t.: start of the implementation
****************************************************************************/
#ifndef _EPLNMTU_H_
#define _EPLNMTU_H_
#include "../EplNmt.h"
#include "EplEventu.h"
// nmt commands
typedef enum {
// requestable ASnd ServiceIds 0x01..0x1F
kEplNmtCmdIdentResponse = 0x01,
kEplNmtCmdStatusResponse = 0x02,
// plain NMT state commands 0x20..0x3F
kEplNmtCmdStartNode = 0x21,
kEplNmtCmdStopNode = 0x22,
kEplNmtCmdEnterPreOperational2 = 0x23,
kEplNmtCmdEnableReadyToOperate = 0x24,
kEplNmtCmdResetNode = 0x28,
kEplNmtCmdResetCommunication = 0x29,
kEplNmtCmdResetConfiguration = 0x2A,
kEplNmtCmdSwReset = 0x2B,
// extended NMT state commands 0x40..0x5F
kEplNmtCmdStartNodeEx = 0x41,
kEplNmtCmdStopNodeEx = 0x42,
kEplNmtCmdEnterPreOperational2Ex = 0x43,
kEplNmtCmdEnableReadyToOperateEx = 0x44,
kEplNmtCmdResetNodeEx = 0x48,
kEplNmtCmdResetCommunicationEx = 0x49,
kEplNmtCmdResetConfigurationEx = 0x4A,
kEplNmtCmdSwResetEx = 0x4B,
// NMT managing commands 0x60..0x7F
kEplNmtCmdNetHostNameSet = 0x62,
kEplNmtCmdFlushArpEntry = 0x63,
// NMT info services 0x80..0xBF
kEplNmtCmdPublishConfiguredCN = 0x80,
kEplNmtCmdPublishActiveCN = 0x90,
kEplNmtCmdPublishPreOperational1 = 0x91,
kEplNmtCmdPublishPreOperational2 = 0x92,
kEplNmtCmdPublishReadyToOperate = 0x93,
kEplNmtCmdPublishOperational = 0x94,
kEplNmtCmdPublishStopped = 0x95,
kEplNmtCmdPublishEmergencyNew = 0xA0,
kEplNmtCmdPublishTime = 0xB0,
kEplNmtCmdInvalidService = 0xFF
} tEplNmtCommand;
typedef tEplKernel(* tEplNmtuStateChangeCallback) (tEplEventNmtStateChange NmtStateChange_p);
typedef tEplKernel(* tEplNmtuCheckEventCallback) (tEplNmtEvent NmtEvent_p);
#if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMTU)) != 0)
tEplKernel EplNmtuInit(void);
tEplKernel EplNmtuAddInstance(void);
tEplKernel EplNmtuDelInstance(void);
tEplKernel EplNmtuNmtEvent(tEplNmtEvent NmtEvent_p);
tEplNmtState EplNmtuGetNmtState(void);
tEplKernel EplNmtuProcessEvent(tEplEvent *pEplEvent_p);
tEplKernel EplNmtuRegisterStateChangeCb(tEplNmtuStateChangeCallback pfnEplNmtStateChangeCb_p);
#endif // #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMTU)) != 0)
#endif // #ifndef _EPLNMTU_H_
|
// Copyright 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_RESOURCES_LAYER_UPDATER_H_
#define CC_RESOURCES_LAYER_UPDATER_H_
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "cc/base/cc_export.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/vector2d.h"
namespace cc {
class PrioritizedResource;
class PrioritizedResourceManager;
class ResourceUpdateQueue;
class TextureManager;
class CC_EXPORT LayerUpdater : public base::RefCounted<LayerUpdater> {
public:
// Allows updaters to store per-resource update properties.
class CC_EXPORT Resource {
public:
virtual ~Resource();
PrioritizedResource* texture() { return texture_.get(); }
// TODO(reveman): partial_update should be a property of this class
// instead of an argument passed to Update().
virtual void Update(ResourceUpdateQueue* queue,
gfx::Rect source_rect,
gfx::Vector2d dest_offset,
bool partial_update) = 0;
protected:
explicit Resource(scoped_ptr<PrioritizedResource> texture);
private:
scoped_ptr<PrioritizedResource> texture_;
DISALLOW_COPY_AND_ASSIGN(Resource);
};
LayerUpdater() {}
virtual scoped_ptr<Resource> CreateResource(
PrioritizedResourceManager* manager) = 0;
// The |resulting_opaque_rect| gives back a region of the layer that was
// painted opaque. If the layer is marked opaque in the updater, then this
// region should be ignored in preference for the entire layer's area.
virtual void PrepareToUpdate(gfx::Rect content_rect,
gfx::Size tile_size,
float contents_width_scale,
float contents_height_scale,
gfx::Rect* resulting_opaque_rect) {}
virtual void ReduceMemoryUsage() {}
// Set true by the layer when it is known that the entire output is going to
// be opaque.
virtual void SetOpaque(bool opaque) {}
protected:
virtual ~LayerUpdater() {}
private:
friend class base::RefCounted<LayerUpdater>;
DISALLOW_COPY_AND_ASSIGN(LayerUpdater);
};
} // namespace cc
#endif // CC_RESOURCES_LAYER_UPDATER_H_
|
#ifndef foopulsefdsemhfoo
#define foopulsefdsemhfoo
/***
This file is part of PulseAudio.
Copyright 2004-2006 Lennart Poettering
PulseAudio 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.
PulseAudio 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 PulseAudio; if not, see <http://www.gnu.org/licenses/>.
***/
#include <sys/types.h>
/* A simple, asynchronous semaphore which uses fds for sleeping. In
* the best case all functions are lock-free unless sleeping is
* required. */
#include <pulsecore/atomic.h>
typedef struct pa_fdsem pa_fdsem;
typedef struct pa_fdsem_data {
pa_atomic_t waiting;
pa_atomic_t signalled;
pa_atomic_t in_pipe;
} pa_fdsem_data;
pa_fdsem *pa_fdsem_new(void);
pa_fdsem *pa_fdsem_open_shm(pa_fdsem_data *data, int event_fd);
pa_fdsem *pa_fdsem_new_shm(pa_fdsem_data *data);
void pa_fdsem_free(pa_fdsem *f);
void pa_fdsem_post(pa_fdsem *f);
void pa_fdsem_wait(pa_fdsem *f);
int pa_fdsem_try(pa_fdsem *f);
int pa_fdsem_get(pa_fdsem *f);
int pa_fdsem_before_poll(pa_fdsem *f);
int pa_fdsem_after_poll(pa_fdsem *f);
#endif
|
/*
* Register map access API internal header
*
* Copyright 2011 Wolfson Microelectronics plc
*
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef _REGMAP_INTERNAL_H
#define _REGMAP_INTERNAL_H
#include <linux/regmap.h>
#include <linux/fs.h>
struct regmap;
struct regcache_ops;
struct regmap_format {
size_t buf_size;
size_t reg_bytes;
size_t pad_bytes;
size_t val_bytes;
void (*format_write)(struct regmap *map,
unsigned int reg, unsigned int val);
void (*format_reg)(void *buf, unsigned int reg, unsigned int shift);
void (*format_val)(void *buf, unsigned int val, unsigned int shift);
unsigned int (*parse_val)(void *buf);
};
typedef void (*regmap_lock)(struct regmap *map);
typedef void (*regmap_unlock)(struct regmap *map);
struct regmap {
struct mutex mutex;
spinlock_t spinlock;
regmap_lock lock;
regmap_unlock unlock;
struct device *dev; /* Device we do I/O on */
void *work_buf; /* Scratch buffer used to format I/O */
struct regmap_format format; /* Buffer format */
const struct regmap_bus *bus;
void *bus_context;
const char *name;
#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs;
const char *debugfs_name;
#endif
unsigned int max_register;
bool (*writeable_reg)(struct device *dev, unsigned int reg);
bool (*readable_reg)(struct device *dev, unsigned int reg);
bool (*volatile_reg)(struct device *dev, unsigned int reg);
bool (*precious_reg)(struct device *dev, unsigned int reg);
u8 read_flag_mask;
u8 write_flag_mask;
/* number of bits to (left) shift the reg value when formatting*/
int reg_shift;
int reg_stride;
/* regcache specific members */
const struct regcache_ops *cache_ops;
enum regcache_type cache_type;
/* number of bytes in reg_defaults_raw */
unsigned int cache_size_raw;
/* number of bytes per word in reg_defaults_raw */
unsigned int cache_word_size;
/* number of entries in reg_defaults */
unsigned int num_reg_defaults;
/* number of entries in reg_defaults_raw */
unsigned int num_reg_defaults_raw;
/* if set, only the cache is modified not the HW */
u32 cache_only;
/* if set, only the HW is modified not the cache */
u32 cache_bypass;
/* if set, remember to free reg_defaults_raw */
bool cache_free;
struct reg_default *reg_defaults;
const void *reg_defaults_raw;
void *cache;
u32 cache_dirty;
struct reg_default *patch;
int patch_regs;
/* if set, converts bulk rw to single rw */
bool use_single_rw;
};
struct regcache_ops {
const char *name;
enum regcache_type type;
int (*init)(struct regmap *map);
int (*exit)(struct regmap *map);
int (*read)(struct regmap *map, unsigned int reg, unsigned int *value);
int (*write)(struct regmap *map, unsigned int reg, unsigned int value);
int (*sync)(struct regmap *map, unsigned int min, unsigned int max);
};
bool regmap_writeable(struct regmap *map, unsigned int reg);
bool regmap_readable(struct regmap *map, unsigned int reg);
bool regmap_volatile(struct regmap *map, unsigned int reg);
bool regmap_precious(struct regmap *map, unsigned int reg);
int _regmap_write(struct regmap *map, unsigned int reg,
unsigned int val);
#ifdef CONFIG_DEBUG_FS
extern void regmap_debugfs_initcall(void);
extern void regmap_debugfs_init(struct regmap *map, const char *name);
extern void regmap_debugfs_exit(struct regmap *map);
#else
static inline void regmap_debugfs_initcall(void) { }
static inline void regmap_debugfs_init(struct regmap *map, const char *name) { }
static inline void regmap_debugfs_exit(struct regmap *map) { }
#endif
/* regcache core declarations */
int regcache_init(struct regmap *map, const struct regmap_config *config);
void regcache_exit(struct regmap *map);
int regcache_read(struct regmap *map,
unsigned int reg, unsigned int *value);
int regcache_write(struct regmap *map,
unsigned int reg, unsigned int value);
int regcache_sync(struct regmap *map);
unsigned int regcache_get_val(const void *base, unsigned int idx,
unsigned int word_size);
bool regcache_set_val(void *base, unsigned int idx,
unsigned int val, unsigned int word_size);
int regcache_lookup_reg(struct regmap *map, unsigned int reg);
extern struct regcache_ops regcache_rbtree_ops;
extern struct regcache_ops regcache_lzo_ops;
#endif
|
/*
BCM2835 "GPU_FFT" release 2.0
Copyright (c) 2014, Andrew Holme.
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 copyright holder 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.
*/
#include <string.h>
#include <stdio.h>
#include <time.h>
#include "gpu_fft_trans.h"
#include "hello_fft_2d_bitmap.h"
#define log2_N 9
#define N (1<<log2_N)
#define GPU_FFT_ROW(fft, io, y) ((fft)->io+(fft)->step*(y))
unsigned Microseconds(void) {
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
return ts.tv_sec*1000000 + ts.tv_nsec/1000;
}
int main(int argc, char *argv[]) {
int x, y, ret, mb = mbox_open();
unsigned t[4];
struct GPU_FFT_COMPLEX *row;
struct GPU_FFT_TRANS *trans;
struct GPU_FFT *fft_pass[2];
BITMAPFILEHEADER bfh;
BITMAPINFOHEADER bih;
// Create Windows bitmap file
FILE *fp = fopen("hello_fft_2d.bmp", "wb");
if (!fp) return -666;
// Write bitmap header
memset(&bfh, 0, sizeof(bfh));
bfh.bfType = 0x4D42; //"BM"
bfh.bfSize = N*N*3;
bfh.bfOffBits = sizeof(bfh) + sizeof(bih);
fwrite(&bfh, sizeof(bfh), 1, fp);
// Write bitmap info
memset(&bih, 0, sizeof(bih));
bih.biSize = sizeof(bih);
bih.biWidth = N;
bih.biHeight = N;
bih.biPlanes = 1;
bih.biBitCount = 24;
bih.biCompression = BI_RGB;
fwrite(&bih, sizeof(bih), 1, fp);
// Prepare 1st FFT pass
ret = gpu_fft_prepare(mb, log2_N, GPU_FFT_REV, N, fft_pass+0);
if (ret) {
return ret;
}
// Prepare 2nd FFT pass
ret = gpu_fft_prepare(mb, log2_N, GPU_FFT_REV, N, fft_pass+1);
if (ret) {
gpu_fft_release(fft_pass[0]);
return ret;
}
// Transpose from 1st pass output to 2nd pass input
ret = gpu_fft_trans_prepare(mb, fft_pass[0], fft_pass[1], &trans);
if (ret) {
gpu_fft_release(fft_pass[0]);
gpu_fft_release(fft_pass[1]);
return ret;
}
// Clear input array
for (y=0; y<N; y++) {
row = GPU_FFT_ROW(fft_pass[0], in, y);
for (x=0; x<N; x++) row[x].re = row[x].im = 0;
}
// Setup input data
GPU_FFT_ROW(fft_pass[0], in, 2)[ 2].re = 60;
GPU_FFT_ROW(fft_pass[0], in, N-2)[N-2].re = 60;
// ==> FFT() ==> T() ==> FFT() ==>
usleep(1); /* yield to OS */ t[0] = Microseconds();
gpu_fft_execute(fft_pass[0]); t[1] = Microseconds();
gpu_fft_trans_execute(trans); t[2] = Microseconds();
gpu_fft_execute(fft_pass[1]); t[3] = Microseconds();
// Write output to bmp file
for (y=0; y<N; y++) {
row = GPU_FFT_ROW(fft_pass[1], out, y);
for (x=0; x<N; x++) {
fputc(128+row[x].re, fp); // blue
fputc(128+row[x].re, fp); // green
fputc(128+row[x].re, fp); // red
}
}
printf( "1st FFT %6d usecs\n"
"Transpose %6d usecs\n"
"2nd FFT %6d usecs\n",
t[3]-t[2], t[2]-t[1], t[1]-t[0]);
// Clean-up properly. Videocore memory lost if not freed !
gpu_fft_release(fft_pass[0]);
gpu_fft_release(fft_pass[1]);
gpu_fft_trans_release(trans);
return 0;
}
|
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2004 Cavium Networks
*/
#ifndef __ASM_MACH_CAVIUM_OCTEON_CPU_FEATURE_OVERRIDES_H
#define __ASM_MACH_CAVIUM_OCTEON_CPU_FEATURE_OVERRIDES_H
#include <linux/types.h>
#include <asm/mipsregs.h>
/*
* Cavium Octeons are MIPS64v2 processors
*/
#define cpu_dcache_line_size() 128
#define cpu_icache_line_size() 128
#define cpu_has_4kex 1
#define cpu_has_3k_cache 0
#define cpu_has_4k_cache 0
#define cpu_has_tx39_cache 0
#define cpu_has_fpu 0
#define cpu_has_counter 1
#define cpu_has_watch 1
#define cpu_has_divec 1
#define cpu_has_vce 0
#define cpu_has_cache_cdex_p 0
#define cpu_has_cache_cdex_s 0
#define cpu_has_prefetch 1
#define cpu_has_llsc 1
/*
* We Disable LL/SC on non SMP systems as it is faster to disable
* interrupts for atomic access than a LL/SC.
*/
#ifdef CONFIG_SMP
# define kernel_uses_llsc 1
#else
# define kernel_uses_llsc 0
#endif
#define cpu_has_vtag_icache 1
#define cpu_has_dc_aliases 0
#define cpu_has_ic_fills_f_dc 0
#define cpu_has_64bits 1
#define cpu_has_octeon_cache 1
#define cpu_has_saa octeon_has_saa()
#define cpu_has_mips32r1 0
#define cpu_has_mips32r2 0
#define cpu_has_mips64r1 0
#define cpu_has_mips64r2 1
#define cpu_has_mips_r2_exec_hazard 0
#define cpu_has_dsp 0
#define cpu_has_mipsmt 0
#define cpu_has_vint 0
#define cpu_has_veic 0
#define cpu_hwrena_impl_bits 0xc0000000
#define kernel_uses_smartmips_rixi (cpu_data[0].cputype != CPU_CAVIUM_OCTEON)
#define ARCH_HAS_IRQ_PER_CPU 1
#define ARCH_HAS_SPINLOCK_PREFETCH 1
#define spin_lock_prefetch(x) prefetch(x)
#define PREFETCH_STRIDE 128
#ifdef __OCTEON__
/*
* All gcc versions that have OCTEON support define __OCTEON__ and have the
* __builtin_popcount support.
*/
#define ARCH_HAS_USABLE_BUILTIN_POPCOUNT 1
#endif
static inline int octeon_has_saa(void)
{
int id;
asm volatile ("mfc0 %0, $15,0" : "=r" (id));
return id >= 0x000d0300;
}
/*
* The last 256MB are reserved for device to device mappings and the
* BAR1 hole.
*/
#define MAX_DMA32_PFN (((1ULL << 32) - (1ULL << 28)) >> PAGE_SHIFT)
#endif
|
/*
* 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
#include "DirectoryNode.h"
namespace XFILE
{
namespace MUSICDATABASEDIRECTORY
{
class CDirectoryNodeAlbumRecentlyPlayedSong : public CDirectoryNode
{
public:
CDirectoryNodeAlbumRecentlyPlayedSong(const std::string& strName, CDirectoryNode* pParent);
protected:
bool GetContent(CFileItemList& items) const override;
};
}
}
|
/*
* 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
#include <string>
#include <vector>
namespace MUSIC_INFO
{
class CMusicInfoTag;
}
class CFileItem; // forward
struct LABEL_MASKS
{
LABEL_MASKS(const std::string& strLabelFile="", const std::string& strLabel2File="", const std::string& strLabelFolder="", const std::string& strLabel2Folder="") :
m_strLabelFile(strLabelFile),
m_strLabel2File(strLabel2File),
m_strLabelFolder(strLabelFolder),
m_strLabel2Folder(strLabel2Folder)
{}
std::string m_strLabelFile;
std::string m_strLabel2File;
std::string m_strLabelFolder;
std::string m_strLabel2Folder;
};
class CLabelFormatter
{
public:
CLabelFormatter(const std::string &mask, const std::string &mask2);
void FormatLabel(CFileItem *item) const;
void FormatLabel2(CFileItem *item) const;
void FormatLabels(CFileItem *item) const // convenient shorthand
{
FormatLabel(item);
FormatLabel2(item);
}
bool FillMusicTag(const std::string &fileName, MUSIC_INFO::CMusicInfoTag *tag) const;
private:
class CMaskString
{
public:
CMaskString(const std::string &prefix, char content, const std::string &postfix) :
m_prefix(prefix),
m_postfix(postfix),
m_content(content)
{};
std::string m_prefix;
std::string m_postfix;
char m_content;
};
// functions for assembling the mask vectors
void AssembleMask(unsigned int label, const std::string &mask);
void SplitMask(unsigned int label, const std::string &mask);
// functions for retrieving content based on our mask vectors
std::string GetContent(unsigned int label, const CFileItem *item) const;
std::string GetMaskContent(const CMaskString &mask, const CFileItem *item) const;
void FillMusicMaskContent(const char mask, const std::string &value, MUSIC_INFO::CMusicInfoTag *tag) const;
std::vector<std::string> m_staticContent[2];
std::vector<CMaskString> m_dynamicContent[2];
bool m_hideFileExtensions;
};
|
/* Verify that IPA-CP can make edges direct based on aggregate contents. */
/* { dg-do compile } */
/* { dg-options "-O3 -fno-early-inlining -fdump-ipa-cp -fdump-ipa-inline" } */
struct S
{
int i;
void (*f)(struct S *);
unsigned u;
};
struct U
{
struct U *next;
struct S s;
short a[8];
};
extern void non_existent(struct S *p, int);
static void hooray1 (struct S *p)
{
non_existent (p, 1);
}
static __attribute__ ((noinline))
void hiphip1 (struct S *p)
{
p->f (p);
}
int test1 (void)
{
struct S s;
s.i = 1234;
s.f = hooray1;
s.u = 1001;
hiphip1 (&s);
return 0;
}
/* { dg-final { scan-ipa-dump "ipa-prop: Discovered an indirect call to a known target" "cp" } } */
/* { dg-final { scan-ipa-dump "hooray1\[^\\n\]*inline copy in hiphip1" "inline" } } */
|
/*
* Copyright (C) 2005 Anthony Liguori <anthony@codemonkey.ws>
*
* Network Block Device
*
* 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; under version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NBD_H
#define NBD_H
#include <sys/types.h>
#include "qemu-common.h"
#include "qemu/option.h"
struct nbd_request {
uint32_t magic;
uint32_t type;
uint64_t handle;
uint64_t from;
uint32_t len;
} QEMU_PACKED;
struct nbd_reply {
uint32_t magic;
uint32_t error;
uint64_t handle;
} QEMU_PACKED;
#define NBD_FLAG_HAS_FLAGS (1 << 0) /* Flags are there */
#define NBD_FLAG_READ_ONLY (1 << 1) /* Device is read-only */
#define NBD_FLAG_SEND_FLUSH (1 << 2) /* Send FLUSH */
#define NBD_FLAG_SEND_FUA (1 << 3) /* Send FUA (Force Unit Access) */
#define NBD_FLAG_ROTATIONAL (1 << 4) /* Use elevator algorithm - rotational media */
#define NBD_FLAG_SEND_TRIM (1 << 5) /* Send TRIM (discard) */
/* New-style global flags. */
#define NBD_FLAG_FIXED_NEWSTYLE (1 << 0) /* Fixed newstyle protocol. */
/* New-style client flags. */
#define NBD_FLAG_C_FIXED_NEWSTYLE (1 << 0) /* Fixed newstyle protocol. */
/* Reply types. */
#define NBD_REP_ACK (1) /* Data sending finished. */
#define NBD_REP_SERVER (2) /* Export description. */
#define NBD_REP_ERR_UNSUP ((1 << 31) | 1) /* Unknown option. */
#define NBD_REP_ERR_INVALID ((1 << 31) | 3) /* Invalid length. */
#define NBD_CMD_MASK_COMMAND 0x0000ffff
#define NBD_CMD_FLAG_FUA (1 << 16)
enum {
NBD_CMD_READ = 0,
NBD_CMD_WRITE = 1,
NBD_CMD_DISC = 2,
NBD_CMD_FLUSH = 3,
NBD_CMD_TRIM = 4
};
#define NBD_DEFAULT_PORT 10809
/* Maximum size of a single READ/WRITE data buffer */
#define NBD_MAX_BUFFER_SIZE (32 * 1024 * 1024)
ssize_t nbd_wr_sync(int fd, void *buffer, size_t size, bool do_read);
int nbd_receive_negotiate(int csock, const char *name, uint32_t *flags,
off_t *size, size_t *blocksize);
int nbd_init(int fd, int csock, uint32_t flags, off_t size, size_t blocksize);
ssize_t nbd_send_request(int csock, struct nbd_request *request);
ssize_t nbd_receive_reply(int csock, struct nbd_reply *reply);
int nbd_client(int fd);
int nbd_disconnect(int fd);
typedef struct NBDExport NBDExport;
typedef struct NBDClient NBDClient;
NBDExport *nbd_export_new(BlockDriverState *bs, off_t dev_offset,
off_t size, uint32_t nbdflags,
void (*close)(NBDExport *));
void nbd_export_close(NBDExport *exp);
void nbd_export_get(NBDExport *exp);
void nbd_export_put(NBDExport *exp);
BlockDriverState *nbd_export_get_blockdev(NBDExport *exp);
NBDExport *nbd_export_find(const char *name);
void nbd_export_set_name(NBDExport *exp, const char *name);
void nbd_export_close_all(void);
NBDClient *nbd_client_new(NBDExport *exp, int csock,
void (*close)(NBDClient *));
void nbd_client_close(NBDClient *client);
void nbd_client_get(NBDClient *client);
void nbd_client_put(NBDClient *client);
#endif
|
// Copyright 2014 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 COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_HEADERS_TEST_UTILS_H_
#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_HEADERS_TEST_UTILS_H_
#include <string>
namespace data_reduction_proxy {
// Transform "normal"-looking headers (\n-separated) to the appropriate
// input format for ParseRawHeaders (\0-separated).
void HeadersToRaw(std::string* headers);
} // namespace data_reduction_proxy
#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_HEADERS_TEST_UTILS_H_
|
/* include/linux/android_alarm.h
*
* Copyright (C) 2006-2007 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _LINUX_ANDROID_ALARM_H
#define _LINUX_ANDROID_ALARM_H
#include <linux/ioctl.h>
#include <linux/time.h>
enum android_alarm_type {
/* return code bit numbers or set alarm arg */
ANDROID_ALARM_RTC_WAKEUP,
ANDROID_ALARM_RTC,
ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP,
ANDROID_ALARM_ELAPSED_REALTIME,
ANDROID_ALARM_SYSTEMTIME,
ANDROID_ALARM_RTC_POWEROFF_WAKEUP,
ANDROID_ALARM_TYPE_COUNT,
/* return code bit numbers */
/* ANDROID_ALARM_TIME_CHANGE = 16 */
};
enum android_alarm_return_flags {
ANDROID_ALARM_RTC_WAKEUP_MASK = 1U << ANDROID_ALARM_RTC_WAKEUP,
ANDROID_ALARM_RTC_MASK = 1U << ANDROID_ALARM_RTC,
ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK =
1U << ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP,
ANDROID_ALARM_ELAPSED_REALTIME_MASK =
1U << ANDROID_ALARM_ELAPSED_REALTIME,
ANDROID_ALARM_RTC_POWEROFF_WAKEUP_MASK =
1U << ANDROID_ALARM_RTC_POWEROFF_WAKEUP,
ANDROID_ALARM_SYSTEMTIME_MASK = 1U << ANDROID_ALARM_SYSTEMTIME,
ANDROID_ALARM_TIME_CHANGE_MASK = 1U << 16
};
/* Disable alarm */
#define ANDROID_ALARM_CLEAR(type) _IO('a', 0 | ((type) << 4))
/* Ack last alarm and wait for next */
#define ANDROID_ALARM_WAIT _IO('a', 1)
#define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size)
/* Set alarm */
#define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec)
#define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec)
#define ANDROID_ALARM_GET_TIME(type) ALARM_IOW(4, type, struct timespec)
#define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec)
#define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0)))
#define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4)
#endif
|
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/* Copyright (c) 2020 Mellanox Technologies. */
#ifndef __ML5_ESW_CHAINS_H__
#define __ML5_ESW_CHAINS_H__
#include "eswitch.h"
#if IS_ENABLED(CONFIG_MLX5_CLS_ACT)
bool
mlx5_esw_chains_prios_supported(struct mlx5_eswitch *esw);
bool
mlx5_esw_chains_backwards_supported(struct mlx5_eswitch *esw);
u32
mlx5_esw_chains_get_prio_range(struct mlx5_eswitch *esw);
u32
mlx5_esw_chains_get_chain_range(struct mlx5_eswitch *esw);
u32
mlx5_esw_chains_get_ft_chain(struct mlx5_eswitch *esw);
struct mlx5_flow_table *
mlx5_esw_chains_get_table(struct mlx5_eswitch *esw, u32 chain, u32 prio,
u32 level);
void
mlx5_esw_chains_put_table(struct mlx5_eswitch *esw, u32 chain, u32 prio,
u32 level);
struct mlx5_flow_table *
mlx5_esw_chains_get_tc_end_ft(struct mlx5_eswitch *esw);
struct mlx5_flow_table *
mlx5_esw_chains_create_global_table(struct mlx5_eswitch *esw);
void
mlx5_esw_chains_destroy_global_table(struct mlx5_eswitch *esw,
struct mlx5_flow_table *ft);
int
mlx5_esw_chains_get_chain_mapping(struct mlx5_eswitch *esw, u32 chain,
u32 *chain_mapping);
int
mlx5_esw_chains_put_chain_mapping(struct mlx5_eswitch *esw,
u32 chain_mapping);
int mlx5_esw_chains_create(struct mlx5_eswitch *esw);
void mlx5_esw_chains_destroy(struct mlx5_eswitch *esw);
int
mlx5_eswitch_get_chain_for_tag(struct mlx5_eswitch *esw, u32 tag, u32 *chain);
#else /* CONFIG_MLX5_CLS_ACT */
static inline struct mlx5_flow_table *
mlx5_esw_chains_get_table(struct mlx5_eswitch *esw, u32 chain, u32 prio,
u32 level) { return ERR_PTR(-EOPNOTSUPP); }
static inline void
mlx5_esw_chains_put_table(struct mlx5_eswitch *esw, u32 chain, u32 prio,
u32 level) {}
static inline struct mlx5_flow_table *
mlx5_esw_chains_get_tc_end_ft(struct mlx5_eswitch *esw) { return ERR_PTR(-EOPNOTSUPP); }
static inline int mlx5_esw_chains_create(struct mlx5_eswitch *esw) { return 0; }
static inline void mlx5_esw_chains_destroy(struct mlx5_eswitch *esw) {}
#endif /* CONFIG_MLX5_CLS_ACT */
#endif /* __ML5_ESW_CHAINS_H__ */
|
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Atomic operations for the Hexagon architecture
*
* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
*/
#ifndef _ASM_ATOMIC_H
#define _ASM_ATOMIC_H
#include <linux/types.h>
#include <asm/cmpxchg.h>
#include <asm/barrier.h>
#define ATOMIC_INIT(i) { (i) }
/* Normal writes in our arch don't clear lock reservations */
static inline void atomic_set(atomic_t *v, int new)
{
asm volatile(
"1: r6 = memw_locked(%0);\n"
" memw_locked(%0,p0) = %1;\n"
" if (!P0) jump 1b;\n"
:
: "r" (&v->counter), "r" (new)
: "memory", "p0", "r6"
);
}
#define atomic_set_release(v, i) atomic_set((v), (i))
/**
* atomic_read - reads a word, atomically
* @v: pointer to atomic value
*
* Assumes all word reads on our architecture are atomic.
*/
#define atomic_read(v) READ_ONCE((v)->counter)
/**
* atomic_xchg - atomic
* @v: pointer to memory to change
* @new: new value (technically passed in a register -- see xchg)
*/
#define atomic_xchg(v, new) (xchg(&((v)->counter), (new)))
/**
* atomic_cmpxchg - atomic compare-and-exchange values
* @v: pointer to value to change
* @old: desired old value to match
* @new: new value to put in
*
* Parameters are then pointer, value-in-register, value-in-register,
* and the output is the old value.
*
* Apparently this is complicated for archs that don't support
* the memw_locked like we do (or it's broken or whatever).
*
* Kind of the lynchpin of the rest of the generically defined routines.
* Remember V2 had that bug with dotnew predicate set by memw_locked.
*
* "old" is "expected" old val, __oldval is actual old value
*/
static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
{
int __oldval;
asm volatile(
"1: %0 = memw_locked(%1);\n"
" { P0 = cmp.eq(%0,%2);\n"
" if (!P0.new) jump:nt 2f; }\n"
" memw_locked(%1,P0) = %3;\n"
" if (!P0) jump 1b;\n"
"2:\n"
: "=&r" (__oldval)
: "r" (&v->counter), "r" (old), "r" (new)
: "memory", "p0"
);
return __oldval;
}
#define ATOMIC_OP(op) \
static inline void atomic_##op(int i, atomic_t *v) \
{ \
int output; \
\
__asm__ __volatile__ ( \
"1: %0 = memw_locked(%1);\n" \
" %0 = "#op "(%0,%2);\n" \
" memw_locked(%1,P3)=%0;\n" \
" if !P3 jump 1b;\n" \
: "=&r" (output) \
: "r" (&v->counter), "r" (i) \
: "memory", "p3" \
); \
} \
#define ATOMIC_OP_RETURN(op) \
static inline int atomic_##op##_return(int i, atomic_t *v) \
{ \
int output; \
\
__asm__ __volatile__ ( \
"1: %0 = memw_locked(%1);\n" \
" %0 = "#op "(%0,%2);\n" \
" memw_locked(%1,P3)=%0;\n" \
" if !P3 jump 1b;\n" \
: "=&r" (output) \
: "r" (&v->counter), "r" (i) \
: "memory", "p3" \
); \
return output; \
}
#define ATOMIC_FETCH_OP(op) \
static inline int atomic_fetch_##op(int i, atomic_t *v) \
{ \
int output, val; \
\
__asm__ __volatile__ ( \
"1: %0 = memw_locked(%2);\n" \
" %1 = "#op "(%0,%3);\n" \
" memw_locked(%2,P3)=%1;\n" \
" if !P3 jump 1b;\n" \
: "=&r" (output), "=&r" (val) \
: "r" (&v->counter), "r" (i) \
: "memory", "p3" \
); \
return output; \
}
#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op)
ATOMIC_OPS(add)
ATOMIC_OPS(sub)
#undef ATOMIC_OPS
#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_FETCH_OP(op)
ATOMIC_OPS(and)
ATOMIC_OPS(or)
ATOMIC_OPS(xor)
#undef ATOMIC_OPS
#undef ATOMIC_FETCH_OP
#undef ATOMIC_OP_RETURN
#undef ATOMIC_OP
/**
* atomic_fetch_add_unless - add unless the number is a given value
* @v: pointer to value
* @a: amount to add
* @u: unless value is equal to u
*
* Returns old value.
*
*/
static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u)
{
int __oldval;
register int tmp;
asm volatile(
"1: %0 = memw_locked(%2);"
" {"
" p3 = cmp.eq(%0, %4);"
" if (p3.new) jump:nt 2f;"
" %1 = add(%0, %3);"
" }"
" memw_locked(%2, p3) = %1;"
" {"
" if !p3 jump 1b;"
" }"
"2:"
: "=&r" (__oldval), "=&r" (tmp)
: "r" (v), "r" (a), "r" (u)
: "memory", "p3"
);
return __oldval;
}
#define atomic_fetch_add_unless atomic_fetch_add_unless
#endif
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#import "TiProxy.h"
#if defined(USE_TI_UIIOS3DMATRIX) || defined(USE_TI_UI3DMATRIX)
#import <QuartzCore/QuartzCore.h>
@interface Ti3DMatrix : TiProxy {
@protected
CATransform3D matrix;
}
-(id)initWithProperties:(NSDictionary*)dict_;
-(id)initWithMatrix:(CATransform3D)matrix_;
-(CATransform3D)matrix;
-(Ti3DMatrix*)translate:(id)args;
-(Ti3DMatrix*)scale:(id)args;
-(Ti3DMatrix*)rotate:(id)args;
-(Ti3DMatrix*)invert:(id)args;
-(Ti3DMatrix*)multiply:(id)args;
@property(nonatomic,readwrite,retain) NSNumber* m11;
@property(nonatomic,readwrite,retain) NSNumber* m12;
@property(nonatomic,readwrite,retain) NSNumber* m13;
@property(nonatomic,readwrite,retain) NSNumber* m14;
@property(nonatomic,readwrite,retain) NSNumber* m21;
@property(nonatomic,readwrite,retain) NSNumber* m22;
@property(nonatomic,readwrite,retain) NSNumber* m23;
@property(nonatomic,readwrite,retain) NSNumber* m24;
@property(nonatomic,readwrite,retain) NSNumber* m31;
@property(nonatomic,readwrite,retain) NSNumber* m32;
@property(nonatomic,readwrite,retain) NSNumber* m33;
@property(nonatomic,readwrite,retain) NSNumber* m34;
@property(nonatomic,readwrite,retain) NSNumber* m41;
@property(nonatomic,readwrite,retain) NSNumber* m42;
@property(nonatomic,readwrite,retain) NSNumber* m43;
@property(nonatomic,readwrite,retain) NSNumber* m44;
@end
#endif
|
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _FSL_FLEXIO_CAMERA_EDMA_H_
#define _FSL_FLEXIO_CAMERA_EDMA_H_
#include "fsl_flexio_camera.h"
#include "fsl_dmamux.h"
#include "fsl_edma.h"
/*!
* @addtogroup flexio_edma_camera
* @{
*/
/*******************************************************************************
* Definitions
******************************************************************************/
/*! @brief Forward declaration of the handle typedef. */
typedef struct _flexio_camera_edma_handle flexio_camera_edma_handle_t;
/*! @brief CAMERA transfer callback function. */
typedef void (*flexio_camera_edma_transfer_callback_t)(FLEXIO_CAMERA_Type *base,
flexio_camera_edma_handle_t *handle,
status_t status,
void *userData);
/*!
* @brief CAMERA eDMA handle
*/
struct _flexio_camera_edma_handle
{
flexio_camera_edma_transfer_callback_t callback; /*!< Callback function. */
void *userData; /*!< CAMERA callback function parameter.*/
size_t rxSize; /*!< Total bytes to be received. */
edma_handle_t *rxEdmaHandle; /*!< The eDMA RX channel used. */
volatile uint8_t rxState; /*!< RX transfer state */
};
/*******************************************************************************
* API
******************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif
/*!
* @name eDMA transactional
* @{
*/
/*!
* @brief Initializes the camera handle, which is used in transactional functions.
*
* @param base pointer to FLEXIO_CAMERA_Type.
* @param handle Pointer to flexio_camera_edma_handle_t structure.
* @param callback The callback function.
* @param userData The parameter of the callback function.
* @param rxEdmaHandle User requested DMA handle for RX DMA transfer.
* @retval kStatus_Success Successfully create the handle.
* @retval kStatus_OutOfRange The FlexIO camera eDMA type/handle table out of range.
*/
status_t FLEXIO_CAMERA_TransferCreateHandleEDMA(FLEXIO_CAMERA_Type *base,
flexio_camera_edma_handle_t *handle,
flexio_camera_edma_transfer_callback_t callback,
void *userData,
edma_handle_t *rxEdmaHandle);
/*!
* @brief Receives data using eDMA.
*
* This function receives data using eDMA. This is a non-blocking function, which returns
* right away. When all data is received, the receive callback function is called.
*
* @param base Pointer to the FLEXIO_CAMERA_Type.
* @param handle Pointer to the flexio_camera_edma_handle_t structure.
* @param xfer CAMERA eDMA transfer structure, see #flexio_camera_transfer_t.
* @retval kStatus_Success if succeeded, others failed.
* @retval kStatus_CAMERA_RxBusy Previous transfer on going.
*/
status_t FLEXIO_CAMERA_TransferReceiveEDMA(FLEXIO_CAMERA_Type *base,
flexio_camera_edma_handle_t *handle,
flexio_camera_transfer_t *xfer);
/*!
* @brief Aborts the receive data which used the eDMA.
*
* This function aborts the receive data which used the eDMA.
*
* @param base Pointer to the FLEXIO_CAMERA_Type.
* @param handle Pointer to the flexio_camera_edma_handle_t structure.
*/
void FLEXIO_CAMERA_TransferAbortReceiveEDMA(FLEXIO_CAMERA_Type *base, flexio_camera_edma_handle_t *handle);
/*!
* @brief Gets the remaining bytes to be received.
*
* This function gets the number of bytes still not received.
*
* @param base Pointer to the FLEXIO_CAMERA_Type.
* @param handle Pointer to the flexio_camera_edma_handle_t structure.
* @param count Number of bytes sent so far by the non-blocking transaction.
* @retval kStatus_Success Succeed get the transfer count.
* @retval kStatus_InvalidArgument The count parameter is invalid.
*/
status_t FLEXIO_CAMERA_TransferGetReceiveCountEDMA(FLEXIO_CAMERA_Type *base,
flexio_camera_edma_handle_t *handle,
size_t *count);
/*@}*/
#if defined(__cplusplus)
}
#endif
/*! @}*/
#endif /* _FSL_CAMERA_EDMA_H_ */
|
/******************************************************************************
*
* Copyright(c) 2009-2012 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* wlanfae <wlanfae@realtek.com>
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
* Hsinchu 300, Taiwan.
*
* Larry Finger <Larry.Finger@lwfinger.net>
*
*****************************************************************************/
#ifndef __RTL92C_MAC_H__
#define __RTL92C_MAC_H__
#define LLT_LAST_ENTRY_OF_TX_PKT_BUFFER 255
#define DRIVER_EARLY_INT_TIME 0x05
#define BCN_DMA_ATIME_INT_TIME 0x02
void rtl92c_read_chip_version(struct ieee80211_hw *hw);
bool rtl92c_llt_write(struct ieee80211_hw *hw, u32 address, u32 data);
bool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary);
void rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
u8 *p_macaddr, bool is_group, u8 enc_algo,
bool is_wepkey, bool clear_all);
void rtl92c_enable_interrupt(struct ieee80211_hw *hw);
void rtl92c_disable_interrupt(struct ieee80211_hw *hw);
void rtl92c_set_qos(struct ieee80211_hw *hw, int aci);
/*---------------------------------------------------------------
* Hardware init functions
*---------------------------------------------------------------*/
void rtl92c_set_mac_addr(struct ieee80211_hw *hw, const u8 *addr);
void rtl92c_init_interrupt(struct ieee80211_hw *hw);
void rtl92c_init_driver_info_size(struct ieee80211_hw *hw, u8 size);
int rtl92c_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type);
void rtl92c_init_network_type(struct ieee80211_hw *hw);
void rtl92c_init_adaptive_ctrl(struct ieee80211_hw *hw);
void rtl92c_init_rate_fallback(struct ieee80211_hw *hw);
void rtl92c_init_edca_param(struct ieee80211_hw *hw,
u16 queue,
u16 txop,
u8 ecwmax,
u8 ecwmin,
u8 aifs);
void rtl92c_init_edca(struct ieee80211_hw *hw);
void rtl92c_init_ampdu_aggregation(struct ieee80211_hw *hw);
void rtl92c_init_beacon_max_error(struct ieee80211_hw *hw, bool infra_mode);
void rtl92c_init_rdg_setting(struct ieee80211_hw *hw);
void rtl92c_init_retry_function(struct ieee80211_hw *hw);
void rtl92c_init_beacon_parameters(struct ieee80211_hw *hw,
enum version_8192c version);
void rtl92c_disable_fast_edca(struct ieee80211_hw *hw);
void rtl92c_set_min_space(struct ieee80211_hw *hw, bool is2T);
/* For filter */
u16 rtl92c_get_mgt_filter(struct ieee80211_hw *hw);
void rtl92c_set_mgt_filter(struct ieee80211_hw *hw, u16 filter);
u16 rtl92c_get_ctrl_filter(struct ieee80211_hw *hw);
void rtl92c_set_ctrl_filter(struct ieee80211_hw *hw, u16 filter);
u16 rtl92c_get_data_filter(struct ieee80211_hw *hw);
void rtl92c_set_data_filter(struct ieee80211_hw *hw, u16 filter);
u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw);
struct rx_fwinfo_92c {
u8 gain_trsw[4];
u8 pwdb_all;
u8 cfosho[4];
u8 cfotail[4];
char rxevm[2];
char rxsnr[4];
u8 pdsnr[2];
u8 csi_current[2];
u8 csi_target[2];
u8 sigevm;
u8 max_ex_pwr;
u8 ex_intf_flag:1;
u8 sgi_en:1;
u8 rxsc:2;
u8 reserve:4;
} __packed;
struct rx_desc_92c {
u32 length:14;
u32 crc32:1;
u32 icverror:1;
u32 drv_infosize:4;
u32 security:3;
u32 qos:1;
u32 shift:2;
u32 phystatus:1;
u32 swdec:1;
u32 lastseg:1;
u32 firstseg:1;
u32 eor:1;
u32 own:1;
u32 macid:5; /* word 1 */
u32 tid:4;
u32 hwrsvd:5;
u32 paggr:1;
u32 faggr:1;
u32 a1_fit:4;
u32 a2_fit:4;
u32 pam:1;
u32 pwr:1;
u32 moredata:1;
u32 morefrag:1;
u32 type:2;
u32 mc:1;
u32 bc:1;
u32 seq:12; /* word 2 */
u32 frag:4;
u32 nextpktlen:14;
u32 nextind:1;
u32 rsvd:1;
u32 rxmcs:6; /* word 3 */
u32 rxht:1;
u32 amsdu:1;
u32 splcp:1;
u32 bandwidth:1;
u32 htc:1;
u32 tcpchk_rpt:1;
u32 ipcchk_rpt:1;
u32 tcpchk_valid:1;
u32 hwpcerr:1;
u32 hwpcind:1;
u32 iv0:16;
u32 iv1; /* word 4 */
u32 tsfl; /* word 5 */
u32 bufferaddress; /* word 6 */
u32 bufferaddress64; /* word 7 */
} __packed;
enum rtl_desc_qsel rtl92c_map_hwqueue_to_fwqueue(u16 fc,
unsigned int
skb_queue);
void rtl92c_translate_rx_signal_stuff(struct ieee80211_hw *hw,
struct sk_buff *skb,
struct rtl_stats *pstats,
struct rx_desc_92c *pdesc,
struct rx_fwinfo_92c *p_drvinfo);
/*---------------------------------------------------------------
* Card disable functions
*---------------------------------------------------------------*/
#endif
|
/*
* ATSTK1000 board-specific setup code.
*
* Copyright (C) 2005-2006 Atmel Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/bootmem.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/linkage.h>
#include <video/atmel_lcdc.h>
#include <asm/setup.h>
#include <asm/arch/board.h>
#include "atstk1000.h"
/* Initialized by bootloader-specific startup code. */
struct tag *bootloader_tags __initdata;
static struct fb_videomode __initdata ltv350qv_modes[] = {
{
.name = "320x240 @ 75",
.refresh = 75,
.xres = 320, .yres = 240,
.pixclock = KHZ2PICOS(6891),
.left_margin = 17, .right_margin = 33,
.upper_margin = 10, .lower_margin = 10,
.hsync_len = 16, .vsync_len = 1,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
},
};
static struct fb_monspecs __initdata atstk1000_default_monspecs = {
.manufacturer = "SNG",
.monitor = "LTV350QV",
.modedb = ltv350qv_modes,
.modedb_len = ARRAY_SIZE(ltv350qv_modes),
.hfmin = 14820,
.hfmax = 22230,
.vfmin = 60,
.vfmax = 90,
.dclkmax = 30000000,
};
struct atmel_lcdfb_info __initdata atstk1000_lcdc_data = {
.default_bpp = 24,
.default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
.default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
| ATMEL_LCDC_INVCLK
| ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
| ATMEL_LCDC_MEMOR_BIG),
.default_monspecs = &atstk1000_default_monspecs,
.guard_time = 2,
};
|
// Support for atomic operations -*- C++ -*-
// Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file ext/atomicity.h
* This file is a GNU extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_ATOMICITY_H
#define _GLIBCXX_ATOMICITY_H 1
#include <bits/c++config.h>
#include <bits/gthr.h>
#include <bits/atomic_word.h>
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Functions for portable atomic access.
// To abstract locking primitives across all thread policies, use:
// __exchange_and_add_dispatch
// __atomic_add_dispatch
#ifdef _GLIBCXX_ATOMIC_BUILTINS
static inline _Atomic_word
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{ return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
static inline void
__atomic_add(volatile _Atomic_word* __mem, int __val)
{ __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
#else
_Atomic_word
__attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word*, int) throw ();
void
__attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word*, int) throw ();
#endif
static inline _Atomic_word
__exchange_and_add_single(_Atomic_word* __mem, int __val)
{
_Atomic_word __result = *__mem;
*__mem += __val;
return __result;
}
static inline void
__atomic_add_single(_Atomic_word* __mem, int __val)
{ *__mem += __val; }
static inline _Atomic_word
__attribute__ ((__unused__))
__exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
{
#ifdef __GTHREADS
if (__gthread_active_p())
return __exchange_and_add(__mem, __val);
else
return __exchange_and_add_single(__mem, __val);
#else
return __exchange_and_add_single(__mem, __val);
#endif
}
static inline void
__attribute__ ((__unused__))
__atomic_add_dispatch(_Atomic_word* __mem, int __val)
{
#ifdef __GTHREADS
if (__gthread_active_p())
__atomic_add(__mem, __val);
else
__atomic_add_single(__mem, __val);
#else
__atomic_add_single(__mem, __val);
#endif
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
// Even if the CPU doesn't need a memory barrier, we need to ensure
// that the compiler doesn't reorder memory accesses across the
// barriers.
#ifndef _GLIBCXX_READ_MEM_BARRIER
#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
#endif
#ifndef _GLIBCXX_WRITE_MEM_BARRIER
#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
#endif
#endif
|
/*
'aes_xcbc.c' Obfuscated by COBF (Version 1.06 2006-01-07 by BB) at Mon Jun 10 09:48:00 2013
*/
#include"cobf.h"
#ifdef _WIN32
#if defined( UNDER_CE) && defined( bb344) || ! defined( bb338)
#define bb340 1
#define bb336 1
#else
#define bb351 bb357
#define bb330 1
#define bb352 1
#endif
#define bb353 1
#include"uncobf.h"
#include<ndis.h>
#include"cobf.h"
#ifdef UNDER_CE
#include"uncobf.h"
#include<ndiswan.h>
#include"cobf.h"
#endif
#include"uncobf.h"
#include<stdio.h>
#include<basetsd.h>
#include"cobf.h"
bba bbs bbl bbf, *bb1;bba bbs bbe bbq, *bb94;bba bb135 bb124, *bb337;
bba bbs bbl bb39, *bb72;bba bbs bb135 bbk, *bb59;bba bbe bbu, *bb133;
bba bbh bbf*bb89;
#ifdef bb308
bba bbd bb60, *bb122;
#endif
#else
#include"uncobf.h"
#include<linux/module.h>
#include<linux/ctype.h>
#include<linux/time.h>
#include<linux/slab.h>
#include"cobf.h"
#ifndef bb116
#define bb116
#ifdef _WIN32
#include"uncobf.h"
#include<wtypes.h>
#include"cobf.h"
#else
#ifdef bb117
#include"uncobf.h"
#include<linux/types.h>
#include"cobf.h"
#else
#include"uncobf.h"
#include<stddef.h>
#include<sys/types.h>
#include"cobf.h"
#endif
#endif
#ifdef _WIN32
bba bb111 bb256;
#else
bba bbe bbu, *bb133, *bb279;
#define bb201 1
#define bb202 0
bba bb284 bb227, *bb217, *bb229;bba bbe bb263, *bb250, *bb287;bba bbs
bbq, *bb94, *bb289;bba bb6 bb223, *bb285;bba bbs bb6 bb214, *bb259;
bba bb6 bb118, *bb238;bba bbs bb6 bb64, *bb241;bba bb64 bb258, *bb228
;bba bb64 bb276, *bb255;bba bb118 bb111, *bb249;bba bb290 bb264;bba
bb208 bb124;bba bb271 bb83;bba bb115 bb114;bba bb115 bb274;
#ifdef bb226
bba bb235 bb39, *bb72;bba bb254 bbk, *bb59;bba bb248 bbd, *bb29;bba
bb270 bb56, *bb113;
#else
bba bb246 bb39, *bb72;bba bb257 bbk, *bb59;bba bb278 bbd, *bb29;bba
bb206 bb56, *bb113;
#endif
bba bb39 bbf, *bb1, *bb224;bba bbk bb243, *bb209, *bb221;bba bbk bb275
, *bb210, *bb245;bba bbd bb60, *bb122, *bb252;bba bb83 bb37, *bb267, *
bb240;bba bbd bb234, *bb211, *bb222;bba bb114 bb251, *bb269, *bb231;
bba bb56 bb225, *bb280, *bb273;
#define bb141 bbb
bba bbb*bb212, *bb77;bba bbh bbb*bb230;bba bbl bb207;bba bbl*bb232;
bba bbh bbl*bb82;
#if defined( bb117)
bba bbe bb112;
#endif
bba bb112 bb19;bba bb19*bb233;bba bbh bb19*bb188;
#if defined( bb283) || defined( bb236)
bba bb19 bb36;bba bb19 bb120;
#else
bba bbl bb36;bba bbs bbl bb120;
#endif
bba bbh bb36*bb262;bba bb36*bb268;bba bb60 bb266, *bb216;bba bbb*
bb107;bba bb107*bb237;
#define bb215( bb35) bbi bb35##__ { bbe bb219; }; bba bbi bb35##__ * \
bb35
bba bbi{bb37 bb190,bb265,bb239,bb244;}bb272, *bb281, *bb261;bba bbi{
bb37 bb8,bb193;}bb292, *bb242, *bb277;bba bbi{bb37 bb218,bb247;}bb220
, *bb213, *bb260;
#endif
bba bbh bbf*bb89;
#endif
bba bbf bb101;
#define IN
#define OUT
#ifdef _DEBUG
#define bb146( bbc) bb32( bbc)
#else
#define bb146( bbc) ( bbb)( bbc)
#endif
bba bbe bb161, *bb173;
#define bb288 0
#define bb312 1
#define bb296 2
#define bb323 3
#define bb343 4
bba bbe bb349;bba bbb*bb121;
#endif
#ifdef _WIN32
#ifndef UNDER_CE
#define bb31 bb341
#define bb43 bb346
bba bbs bb6 bb31;bba bb6 bb43;
#endif
#else
#endif
#ifdef _WIN32
bbb*bb128(bb31 bb47);bbb bb109(bbb* );bbb*bb137(bb31 bb159,bb31 bb47);
#else
#define bb128( bbc) bb147(1, bbc, bb140)
#define bb109( bbc) bb331( bbc)
#define bb137( bbc, bbn) bb147( bbc, bbn, bb140)
#endif
#ifdef _WIN32
#define bb32( bbc) bb339( bbc)
#else
#ifdef _DEBUG
bbe bb144(bbh bbl*bb95,bbh bbl*bb25,bbs bb286);
#define bb32( bbc) ( bbb)(( bbc) || ( bb144(# bbc, __FILE__, __LINE__ \
)))
#else
#define bb32( bbc) (( bbb)0)
#endif
#endif
bb43 bb302(bb43*bb324);
#ifndef _WIN32
bbe bb328(bbh bbl*bbg);bbe bb321(bbh bbl*bb20,...);
#endif
#ifdef _WIN32
bba bb342 bb96;
#define bb139( bbc) bb354( bbc)
#define bb142( bbc) bb329( bbc)
#define bb134( bbc) bb348( bbc)
#define bb132( bbc) bb332( bbc)
#else
bba bb334 bb96;
#define bb139( bbc) ( bbb)( * bbc = bb356( bbc))
#define bb142( bbc) (( bbb)0)
#define bb134( bbc) bb333( bbc)
#define bb132( bbc) bb358( bbc)
#endif
#ifdef __cplusplus
bbr"\x43"{
#endif
#ifdef __cplusplus
bbr"\x43"{
#endif
bba bbi{bbq bb447;bbd bb417[4 * (14 +1 )];}bb364;bbb bb1099(bb364*bbj,
bbh bbb*bb71,bbq bb143);bbb bb1736(bb364*bbj,bbh bbb*bb71,bbq bb143);
bbb bb1035(bb364*bbj,bbb*bb14,bbh bbb*bb5);bbb bb1775(bb364*bbj,bbb*
bb14,bbh bbb*bb5);
#ifdef __cplusplus
}
#endif
bba bbi{bb364 bb2117;bbq bb9;bbf bb102[16 ];bbf bb1926[16 ];bbf bb1928[
16 ];bbf bb1842[16 ];}bb939;bbb bb2042(bb939*bbj,bbh bbb*bb71,bbq bb143
);bbb bb2092(bb939*bbj,bbh bbb*bb5,bbq bb9);bbb bb2103(bb939*bbj,bbb*
bb14);
#ifdef __cplusplus
}
#endif
bbb bb2042(bb939*bbj,bbh bbb*bb71,bbq bb143){bb364 bb2147;bbf bb2181[
16 ];bbj->bb9=0 ;bb32(bb143==16 );bb1099(&bb2147,bb71,bb143);bb998(bbj->
bb1842,0 ,16 );bb998(bb2181,1 ,16 );bb1035(&bb2147,bb2181,bb2181);bb998(
bbj->bb1926,2 ,16 );bb1035(&bb2147,bbj->bb1926,bbj->bb1926);bb998(bbj->
bb1928,3 ,16 );bb1035(&bb2147,bbj->bb1928,bbj->bb1928);bb1099(&bbj->
bb2117,bb2181,bb143);}bb41 bbb bb1254(bb939*bbj,bbh bbf*bb5){bbq bbz;
bb90(bbz=0 ;bbz<16 ;bbz++)bbj->bb1842[bbz]^=bb5[bbz];bb1035(&bbj->
bb2117,bbj->bb1842,bbj->bb1842);}bbb bb2092(bb939*bbj,bbh bbb*bb498,
bbq bb9){bbh bbf*bb5=(bbh bbf* )bb498;bbq bb383=bbj->bb9?(bbj->bb9-1 )%
16 +1 :0 ;bbj->bb9+=bb9;bbm(bb383){bbq bb11=16 -bb383;bb81(bbj->bb102+
bb383,bb5,((bb9)<(bb11)?(bb9):(bb11)));bbm(bb9<=bb11)bb2;bb5+=bb11;
bb9-=bb11;bb1254(bbj,bbj->bb102);}bb90(;bb9>16 ;bb9-=16 ,bb5+=16 )bb1254
(bbj,bb5);bb81(bbj->bb102,bb5,bb9);}bbb bb2103(bb939*bbj,bbb*bb14){
bb1 bb3;bbq bbz,bb383=bbj->bb9?(bbj->bb9-1 )%16 +1 :0 ;bbm(bb383<16 ){bbj
->bb102[bb383++]=0x80 ;bb998(bbj->bb102+bb383,0 ,16 -bb383);bb3=bbj->
bb1928;}bb54 bb3=bbj->bb1926;bb90(bbz=0 ;bbz<16 ;bbz++)bbj->bb102[bbz]
^=bb3[bbz];bb1254(bbj,bbj->bb102);bb81(bb14,bbj->bb1842,16 );}
|
/*
* Copyright (C) 2010-2015 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_notification.c
* Implementation of the OS abstraction layer for the kernel device driver
*/
#include "mali_osk.h"
#include "mali_kernel_common.h"
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
/**
* Declaration of the notification queue object type
* Contains a linked list of notification pending delivery to user space.
* It also contains a wait queue of exclusive waiters blocked in the ioctl
* When a new notification is posted a single thread is resumed.
*/
struct _mali_osk_notification_queue_t_struct {
spinlock_t mutex; /**< Mutex protecting the list */
wait_queue_head_t receive_queue; /**< Threads waiting for new entries to the queue */
struct list_head head; /**< List of notifications waiting to be picked up */
};
typedef struct _mali_osk_notification_wrapper_t_struct {
struct list_head list; /**< Internal linked list variable */
_mali_osk_notification_t data; /**< Notification data */
} _mali_osk_notification_wrapper_t;
_mali_osk_notification_queue_t *_mali_osk_notification_queue_init(void)
{
_mali_osk_notification_queue_t *result;
result = (_mali_osk_notification_queue_t *)kmalloc(sizeof(_mali_osk_notification_queue_t), GFP_KERNEL);
if (NULL == result) return NULL;
spin_lock_init(&result->mutex);
init_waitqueue_head(&result->receive_queue);
INIT_LIST_HEAD(&result->head);
return result;
}
_mali_osk_notification_t *_mali_osk_notification_create(u32 type, u32 size)
{
/* OPT Recycling of notification objects */
_mali_osk_notification_wrapper_t *notification;
notification = (_mali_osk_notification_wrapper_t *)kmalloc(sizeof(_mali_osk_notification_wrapper_t) + size,
GFP_KERNEL | __GFP_HIGH | __GFP_REPEAT);
if (NULL == notification) {
MALI_DEBUG_PRINT(1, ("Failed to create a notification object\n"));
return NULL;
}
/* Init the list */
INIT_LIST_HEAD(¬ification->list);
if (0 != size) {
notification->data.result_buffer = ((u8 *)notification) + sizeof(_mali_osk_notification_wrapper_t);
} else {
notification->data.result_buffer = NULL;
}
/* set up the non-allocating fields */
notification->data.notification_type = type;
notification->data.result_buffer_size = size;
/* all ok */
return &(notification->data);
}
void _mali_osk_notification_delete(_mali_osk_notification_t *object)
{
_mali_osk_notification_wrapper_t *notification;
MALI_DEBUG_ASSERT_POINTER(object);
notification = container_of(object, _mali_osk_notification_wrapper_t, data);
/* Free the container */
kfree(notification);
}
void _mali_osk_notification_queue_term(_mali_osk_notification_queue_t *queue)
{
_mali_osk_notification_t *result;
MALI_DEBUG_ASSERT_POINTER(queue);
while (_MALI_OSK_ERR_OK == _mali_osk_notification_queue_dequeue(queue, &result)) {
_mali_osk_notification_delete(result);
}
/* not much to do, just free the memory */
kfree(queue);
}
void _mali_osk_notification_queue_send(_mali_osk_notification_queue_t *queue, _mali_osk_notification_t *object)
{
#if defined(MALI_UPPER_HALF_SCHEDULING)
unsigned long irq_flags;
#endif
_mali_osk_notification_wrapper_t *notification;
MALI_DEBUG_ASSERT_POINTER(queue);
MALI_DEBUG_ASSERT_POINTER(object);
notification = container_of(object, _mali_osk_notification_wrapper_t, data);
#if defined(MALI_UPPER_HALF_SCHEDULING)
spin_lock_irqsave(&queue->mutex, irq_flags);
#else
spin_lock(&queue->mutex);
#endif
list_add_tail(¬ification->list, &queue->head);
#if defined(MALI_UPPER_HALF_SCHEDULING)
spin_unlock_irqrestore(&queue->mutex, irq_flags);
#else
spin_unlock(&queue->mutex);
#endif
/* and wake up one possible exclusive waiter */
wake_up(&queue->receive_queue);
}
_mali_osk_errcode_t _mali_osk_notification_queue_dequeue(_mali_osk_notification_queue_t *queue, _mali_osk_notification_t **result)
{
#if defined(MALI_UPPER_HALF_SCHEDULING)
unsigned long irq_flags;
#endif
_mali_osk_errcode_t ret = _MALI_OSK_ERR_ITEM_NOT_FOUND;
_mali_osk_notification_wrapper_t *wrapper_object;
#if defined(MALI_UPPER_HALF_SCHEDULING)
spin_lock_irqsave(&queue->mutex, irq_flags);
#else
spin_lock(&queue->mutex);
#endif
if (!list_empty(&queue->head)) {
wrapper_object = list_entry(queue->head.next, _mali_osk_notification_wrapper_t, list);
*result = &(wrapper_object->data);
list_del_init(&wrapper_object->list);
ret = _MALI_OSK_ERR_OK;
}
#if defined(MALI_UPPER_HALF_SCHEDULING)
spin_unlock_irqrestore(&queue->mutex, irq_flags);
#else
spin_unlock(&queue->mutex);
#endif
return ret;
}
_mali_osk_errcode_t _mali_osk_notification_queue_receive(_mali_osk_notification_queue_t *queue, _mali_osk_notification_t **result)
{
/* check input */
MALI_DEBUG_ASSERT_POINTER(queue);
MALI_DEBUG_ASSERT_POINTER(result);
/* default result */
*result = NULL;
if (wait_event_interruptible(queue->receive_queue,
_MALI_OSK_ERR_OK == _mali_osk_notification_queue_dequeue(queue, result))) {
return _MALI_OSK_ERR_RESTARTSYSCALL;
}
return _MALI_OSK_ERR_OK; /* all ok */
}
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_SIGNAL_H
#define _ASM_SIGNAL_H
#include <uapi/asm/signal.h>
#endif /* _ASM_SIGNAL_H */
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_CRIS_UCONTEXT_H
#define _ASM_CRIS_UCONTEXT_H
struct ucontext {
unsigned long uc_flags;
struct ucontext *uc_link;
stack_t uc_stack;
struct sigcontext uc_mcontext;
sigset_t uc_sigmask; /* mask last for extensibility */
};
#endif /* !_ASM_CRIS_UCONTEXT_H */
|
/*
* snfc_hw_rev.c
*
*/
/*
* Include header files
*/
#include "snfc_gpio.h"
#include <mach/board_lge.h>
/*
* Defines
*/
/*
* Internal definition
*/
/*
* Internal variables
*/
static int isopen_snfchwrev = 0; // 0 : No open 1 : Open
/*
* Function prototypes
*/
/*
* Function definitions
*/
/*
* Description :
* Input :
* Output :
*/
static int snfc_hw_rev_open (struct inode *inode, struct file *fp)
{
int rc = 0;
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] snfc_hw_rev_open - start \n");
if(isopen_snfchwrev == 1)
{
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] snfc_hw_rev_open - already open \n");
return 0;
}
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] snfc_hw_rev_open - end \n");
isopen_snfchwrev = 1;
return rc;
}
/*
* Description :
* Input :
* Output :
*/
static ssize_t snfc_hw_rev_read(struct file *pf, char *pbuf, size_t size, loff_t *pos)
{
int rc = 0;
int rev = lge_get_board_revno();
int retrev;
switch(rev)
{
case HW_REV_A:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.a\n");
retrev = 'a';
break;
case HW_REV_B:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.b\n");
retrev = 'b';
break;
case HW_REV_C:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.c\n");
retrev = 'c';
break;
case HW_REV_D:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.d\n");
retrev = 'd';
break;
case HW_REV_E:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.e\n");
retrev = 'e';
break;
case HW_REV_F:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.f\n");
retrev = 'f';
break;
case HW_REV_G:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.g\n");
retrev = 'g';
break;
case HW_REV_H:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.h\n");
retrev = 'g';
break;
case HW_REV_1_0:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.1.0\n");
retrev = '0';
break;
case HW_REV_1_1:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.1.1\n");
retrev = '1';
break;
case HW_REV_1_2:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as rev.1.2\n");
retrev = '2';
break;
default:
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] read hw as unknown\n");
}
rc = copy_to_user((void*)pbuf, (void*)&retrev, size);
if(rc)
{
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] ERROR - copy_to_user \n");
return rc;
}
return size;
}
/*
* Description :
* Input :
* Output :
*/
static int snfc_hw_rev_release (struct inode *inode, struct file *fp)
{
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] snfc_hw_rev_release - start \n");
if(isopen_snfchwrev ==0)
{
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] snfc_hw_rev_release - not open \n");
return -1;
}
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] snfc_hw_rev_release - end \n");
isopen_snfchwrev = 0;
return 0;
}
static struct file_operations snfc_hw_rev_fops =
{
.owner = THIS_MODULE,
.open = snfc_hw_rev_open,
.read = snfc_hw_rev_read,
.release = snfc_hw_rev_release,
};
static struct miscdevice snfc_hw_rev_device =
{
.minor = 124,
.name = "snfc_hw_rev",
.fops = &snfc_hw_rev_fops,
};
static int snfc_hw_rev_init(void)
{
int rc = 0;
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] snfc_hw_rev_init - start \n");
/* Register the device file */
rc = misc_register(&snfc_hw_rev_device);
if (rc)
{
SNFC_DEBUG_MSG("[snfc_hw_rev] FAIL!! can not register snfc_hw_rev_init \n");
return rc;
}
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] snfc_hw_rev_init - end \n");
return 0;
}
static void snfc_hw_rev_exit(void)
{
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] snfc_pon_exit - start \n");
/* Deregister the device file */
misc_deregister(&snfc_hw_rev_device);
SNFC_DEBUG_MSG_MIDDLE("[snfc_hw_rev] snfc_pon_exit - end \n");
}
module_init(snfc_hw_rev_init);
module_exit(snfc_hw_rev_exit);
MODULE_LICENSE("Dual BSD/GPL");
|
/* Copyright (c) 2008-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef MDSS_SDC_PANEL_H
#define MDSS_SDC_PANEL_H
#include "mdss_panel.h"
#define MAX_BRIGHTNESS_LEVEL 255
#define MID_BRIGHTNESS_LEVEL 143
#define LOW_BRIGHTNESS_LEVEL 20
#define DIM_BRIGHTNESS_LEVEL 30
#define BL_MIN_BRIGHTNESS 2
#define BL_MAX_BRIGHTNESS_LEVEL 230
#define BL_MID_BRIGHTNESS_LEVEL 115
#define BL_LOW_BRIGHTNESS_LEVEL 2
#define BL_DIM_BRIGHTNESS_LEVEL 9
#define BL_DEFAULT_BRIGHTNESS BL_MID_BRIGHTNESS_LEVEL
enum {
MIPI_RESUME_STATE,
MIPI_SUSPEND_STATE,
};
struct display_status{
unsigned char auto_brightness;
int bright_level;
int siop_status;
};
struct mdss_samsung_driver_data{
struct dsi_buf sdc_tx_buf;
struct msm_fb_data_type *mfd;
struct dsi_buf sdc_rx_buf;
struct mdss_panel_common_pdata *mdss_sdc_disp_pdata;
struct mdss_panel_data *mpd;
struct mutex lock;
#if defined(CONFIG_LCD_CLASS_DEVICE)
struct platform_device *msm_pdev;
#endif
#if defined(CONFIG_HAS_EARLYSUSPEND)
struct early_suspend early_suspend;
#endif
struct display_status dstat;
};
void mdnie_lite_tuning_init(struct mdss_samsung_driver_data* msd);
void mdss_dsi_cmds_send(struct mdss_dsi_ctrl_pdata *ctrl, struct dsi_cmd_desc *cmds, int cnt,int flag);
#endif
|
#ifndef __NVBIOS_RAMCFG_H__
#define __NVBIOS_RAMCFG_H__
struct nouveau_bios;
struct nvbios_ramcfg {
unsigned rammap_ver;
unsigned rammap_hdr;
unsigned rammap_min;
unsigned rammap_max;
union {
struct {
unsigned rammap_10_04_02:1;
unsigned rammap_10_04_08:1;
};
struct {
unsigned rammap_11_08_01:1;
unsigned rammap_11_08_0c:2;
unsigned rammap_11_08_10:1;
unsigned rammap_11_09_01ff:9;
unsigned rammap_11_0a_03fe:9;
unsigned rammap_11_0a_0400:1;
unsigned rammap_11_0a_0800:1;
unsigned rammap_11_0b_01f0:5;
unsigned rammap_11_0b_0200:1;
unsigned rammap_11_0b_0400:1;
unsigned rammap_11_0b_0800:1;
unsigned rammap_11_0d:8;
unsigned rammap_11_0e:8;
unsigned rammap_11_0f:8;
unsigned rammap_11_11_0c:2;
};
};
unsigned ramcfg_ver;
unsigned ramcfg_hdr;
unsigned ramcfg_timing;
union {
struct {
unsigned ramcfg_10_02_01:1;
unsigned ramcfg_10_02_02:1;
unsigned ramcfg_10_02_04:1;
unsigned ramcfg_10_02_08:1;
unsigned ramcfg_10_02_10:1;
unsigned ramcfg_10_02_20:1;
unsigned ramcfg_10_02_40:1;
unsigned ramcfg_10_03_0f:4;
unsigned ramcfg_10_05:8;
unsigned ramcfg_10_06:8;
unsigned ramcfg_10_07:8;
unsigned ramcfg_10_08:8;
unsigned ramcfg_10_09_0f:4;
unsigned ramcfg_10_09_f0:4;
};
struct {
unsigned ramcfg_11_01_01:1;
unsigned ramcfg_11_01_02:1;
unsigned ramcfg_11_01_04:1;
unsigned ramcfg_11_01_08:1;
unsigned ramcfg_11_01_10:1;
unsigned ramcfg_11_01_20:1;
unsigned ramcfg_11_01_40:1;
unsigned ramcfg_11_01_80:1;
unsigned ramcfg_11_02_03:2;
unsigned ramcfg_11_02_04:1;
unsigned ramcfg_11_02_08:1;
unsigned ramcfg_11_02_10:1;
unsigned ramcfg_11_02_40:1;
unsigned ramcfg_11_02_80:1;
unsigned ramcfg_11_03_0f:4;
unsigned ramcfg_11_03_30:2;
unsigned ramcfg_11_03_c0:2;
unsigned ramcfg_11_03_f0:4;
unsigned ramcfg_11_04:8;
unsigned ramcfg_11_06:8;
unsigned ramcfg_11_07_02:1;
unsigned ramcfg_11_07_04:1;
unsigned ramcfg_11_07_08:1;
unsigned ramcfg_11_07_10:1;
unsigned ramcfg_11_07_40:1;
unsigned ramcfg_11_07_80:1;
unsigned ramcfg_11_08_01:1;
unsigned ramcfg_11_08_02:1;
unsigned ramcfg_11_08_04:1;
unsigned ramcfg_11_08_08:1;
unsigned ramcfg_11_08_10:1;
unsigned ramcfg_11_08_20:1;
unsigned ramcfg_11_09:8;
};
};
unsigned timing_ver;
unsigned timing_hdr;
unsigned timing[11];
union {
struct {
unsigned timing_10_WR:8;
unsigned timing_10_CL:8;
unsigned timing_10_ODT:3;
unsigned timing_10_CWL:8;
};
struct {
unsigned timing_20_2e_03:2;
unsigned timing_20_2e_30:2;
unsigned timing_20_2e_c0:2;
unsigned timing_20_2f_03:2;
unsigned timing_20_2c_003f:6;
unsigned timing_20_2c_1fc0:7;
unsigned timing_20_30_f8:5;
unsigned timing_20_30_07:3;
unsigned timing_20_31_0007:3;
unsigned timing_20_31_0078:4;
unsigned timing_20_31_0780:4;
unsigned timing_20_31_0800:1;
unsigned timing_20_31_7000:3;
unsigned timing_20_31_8000:1;
};
};
};
u8 nvbios_ramcfg_count(struct nouveau_bios *);
u8 nvbios_ramcfg_index(struct nouveau_subdev *);
#endif
|
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "msm_camera_eeprom.h"
int32_t msm_camera_eeprom_read(struct msm_eeprom_ctrl_t *ectrl,
uint32_t reg_addr, void *data, uint32_t num_byte,
uint16_t convert_endian)
{
int rc = 0;
if (ectrl->func_tbl.eeprom_set_dev_addr != NULL)
ectrl->func_tbl.eeprom_set_dev_addr(ectrl, ®_addr);
if (!convert_endian) {
rc = msm_camera_i2c_read_seq(
&ectrl->i2c_client, reg_addr, data, num_byte);
} else {
unsigned char buf[num_byte];
uint8_t *data_ptr = (uint8_t *) data;
int i;
rc = msm_camera_i2c_read_seq(
&ectrl->i2c_client, reg_addr, buf, num_byte);
for (i = 0; i < num_byte; i += 2) {
data_ptr[i] = buf[i+1];
data_ptr[i+1] = buf[i];
}
}
return rc;
}
int32_t msm_camera_eeprom_read_tbl(struct msm_eeprom_ctrl_t *ectrl,
struct msm_camera_eeprom_read_t *read_tbl, uint16_t tbl_size)
{
int i, rc = 0;
CDBG("%s: open\n", __func__);
if (read_tbl == NULL)
return rc;
for (i = 0; i < tbl_size; i++) {
rc = msm_camera_eeprom_read
(ectrl, read_tbl[i].reg_addr,
read_tbl[i].dest_ptr, read_tbl[i].num_byte,
read_tbl[i].convert_endian);
if (rc < 0) {
pr_err("%s: read failed\n", __func__);
return rc;
}
}
CDBG("%s: done\n", __func__);
return rc;
}
int32_t msm_camera_eeprom_get_info(struct msm_eeprom_ctrl_t *ectrl,
struct msm_camera_eeprom_info_t *einfo)
{
int rc = 0;
CDBG("%s: open\n", __func__);
memcpy(einfo, ectrl->info, ectrl->info_size);
CDBG("%s: done =%d\n", __func__, rc);
return rc;
}
int32_t msm_camera_eeprom_get_data(struct msm_eeprom_ctrl_t *ectrl,
struct msm_eeprom_data_t *edata)
{
int rc = 0;
if (edata->index >= ectrl->data_tbl_size)
return -EFAULT;
if (copy_to_user(edata->eeprom_data,
ectrl->data_tbl[edata->index].data,
ectrl->data_tbl[edata->index].size))
rc = -EFAULT;
return rc;
}
int32_t msm_eeprom_config(struct msm_eeprom_ctrl_t *e_ctrl,
void __user *argp)
{
struct msm_eeprom_cfg_data cdata;
int32_t rc = 0;
if (copy_from_user(&cdata,
(void *)argp,
sizeof(struct msm_eeprom_cfg_data)))
return -EFAULT;
mutex_lock(e_ctrl->eeprom_mutex);
switch (cdata.cfgtype) {
case CFG_GET_EEPROM_INFO:
if (e_ctrl->func_tbl.eeprom_get_info == NULL) {
rc = -EFAULT;
break;
}
rc = e_ctrl->func_tbl.eeprom_get_info(e_ctrl,
&cdata.cfg.get_info);
cdata.is_eeprom_supported = 1;
if (copy_to_user((void *)argp,
&cdata,
sizeof(struct msm_eeprom_cfg_data)))
rc = -EFAULT;
break;
case CFG_GET_EEPROM_DATA:
if (e_ctrl->func_tbl.eeprom_get_data == NULL) {
rc = -EFAULT;
break;
}
rc = e_ctrl->func_tbl.eeprom_get_data(e_ctrl,
&cdata.cfg.get_data);
if (copy_to_user((void *)argp,
&cdata,
sizeof(struct msm_eeprom_cfg_data)))
rc = -EFAULT;
break;
default:
break;
}
mutex_unlock(e_ctrl->eeprom_mutex);
return rc;
}
struct msm_eeprom_ctrl_t *get_ectrl(struct v4l2_subdev *sd)
{
return container_of(sd, struct msm_eeprom_ctrl_t, sdev);
}
long msm_eeprom_subdev_ioctl(struct v4l2_subdev *sd,
unsigned int cmd, void *arg)
{
struct msm_eeprom_ctrl_t *e_ctrl = get_ectrl(sd);
void __user *argp = (void __user *)arg;
switch (cmd) {
case VIDIOC_MSM_EEPROM_CFG:
return msm_eeprom_config(e_ctrl, argp);
default:
return -ENOIOCTLCMD;
}
}
int32_t msm_eeprom_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int rc = 0;
struct msm_eeprom_ctrl_t *e_ctrl_t = NULL;
CDBG("%s called\n", __func__);
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
pr_err("i2c_check_functionality failed\n");
goto probe_failure;
}
e_ctrl_t = (struct msm_eeprom_ctrl_t *)(id->driver_data);
e_ctrl_t->i2c_client.client = client;
if (e_ctrl_t->i2c_addr != 0)
e_ctrl_t->i2c_client.client->addr = e_ctrl_t->i2c_addr;
CDBG("%s client = %x\n", __func__, (unsigned int) client);
/* Assign name for sub device */
snprintf(e_ctrl_t->sdev.name, sizeof(e_ctrl_t->sdev.name),
"%s", e_ctrl_t->i2c_driver->driver.name);
if (e_ctrl_t->func_tbl.eeprom_init != NULL) {
rc = e_ctrl_t->func_tbl.eeprom_init(e_ctrl_t,
e_ctrl_t->i2c_client.client->adapter);
}
msm_camera_eeprom_read_tbl(e_ctrl_t,
e_ctrl_t->read_tbl,
e_ctrl_t->read_tbl_size);
if (e_ctrl_t->func_tbl.eeprom_format_data != NULL)
e_ctrl_t->func_tbl.eeprom_format_data();
if (e_ctrl_t->func_tbl.eeprom_release != NULL)
rc = e_ctrl_t->func_tbl.eeprom_release(e_ctrl_t);
/* Initialize sub device */
v4l2_i2c_subdev_init(&e_ctrl_t->sdev,
e_ctrl_t->i2c_client.client,
e_ctrl_t->eeprom_v4l2_subdev_ops);
CDBG("%s success resut=%d\n", __func__, rc);
return rc;
probe_failure:
pr_err("%s failed! rc = %d\n", __func__, rc);
return rc;
}
|
#ifndef KISS_FTR_H
#define KISS_FTR_H
#include "kiss_fft.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
Real optimized version can save about 45% cpu time vs. complex fft of a real seq.
*/
typedef struct kiss_fftr_state *kiss_fftr_cfg;
kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem, size_t * lenmem);
/*
nfft must be even
If you don't care to allocate space, use mem = lenmem = NULL
*/
void kiss_fftr(kiss_fftr_cfg cfg,const kiss_fft_scalar *timedata,kiss_fft_cpx *freqdata);
/*
input timedata has nfft scalar points
output freqdata has nfft/2+1 complex points
*/
void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar *freqdata);
void kiss_fftri(kiss_fftr_cfg cfg,const kiss_fft_cpx *freqdata,kiss_fft_scalar *timedata);
void kiss_fftri2(kiss_fftr_cfg st,const kiss_fft_scalar *freqdata, kiss_fft_scalar *timedata);
/*
input freqdata has nfft/2+1 complex points
output timedata has nfft scalar points
*/
#define kiss_fftr_free speex_free
#ifdef __cplusplus
}
#endif
#endif
|
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright(c) 2009-2012 Realtek Corporation.*/
#ifndef __RTL8723E_PWRSEQCMD_H__
#define __RTL8723E_PWRSEQCMD_H__
#include "wifi.h"
/*---------------------------------------------
* 3 The value of cmd: 4 bits
*---------------------------------------------
*/
#define PWR_CMD_READ 0x00
#define PWR_CMD_WRITE 0x01
#define PWR_CMD_POLLING 0x02
#define PWR_CMD_DELAY 0x03
#define PWR_CMD_END 0x04
/* define the base address of each block */
#define PWR_BASEADDR_MAC 0x00
#define PWR_BASEADDR_USB 0x01
#define PWR_BASEADDR_PCIE 0x02
#define PWR_BASEADDR_SDIO 0x03
#define PWR_INTF_SDIO_MSK BIT(0)
#define PWR_INTF_USB_MSK BIT(1)
#define PWR_INTF_PCI_MSK BIT(2)
#define PWR_INTF_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
#define PWR_FAB_TSMC_MSK BIT(0)
#define PWR_FAB_UMC_MSK BIT(1)
#define PWR_FAB_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
#define PWR_CUT_TESTCHIP_MSK BIT(0)
#define PWR_CUT_A_MSK BIT(1)
#define PWR_CUT_B_MSK BIT(2)
#define PWR_CUT_C_MSK BIT(3)
#define PWR_CUT_D_MSK BIT(4)
#define PWR_CUT_E_MSK BIT(5)
#define PWR_CUT_F_MSK BIT(6)
#define PWR_CUT_G_MSK BIT(7)
#define PWR_CUT_ALL_MSK 0xFF
enum pwrseq_delay_unit {
PWRSEQ_DELAY_US,
PWRSEQ_DELAY_MS,
};
struct wlan_pwr_cfg {
u16 offset;
u8 cut_msk;
u8 fab_msk:4;
u8 interface_msk:4;
u8 base:4;
u8 cmd:4;
u8 msk;
u8 value;
};
#define GET_PWR_CFG_OFFSET(__PWR_CMD) (__PWR_CMD.offset)
#define GET_PWR_CFG_CUT_MASK(__PWR_CMD) (__PWR_CMD.cut_msk)
#define GET_PWR_CFG_FAB_MASK(__PWR_CMD) (__PWR_CMD.fab_msk)
#define GET_PWR_CFG_INTF_MASK(__PWR_CMD) (__PWR_CMD.interface_msk)
#define GET_PWR_CFG_BASE(__PWR_CMD) (__PWR_CMD.base)
#define GET_PWR_CFG_CMD(__PWR_CMD) (__PWR_CMD.cmd)
#define GET_PWR_CFG_MASK(__PWR_CMD) (__PWR_CMD.msk)
#define GET_PWR_CFG_VALUE(__PWR_CMD) (__PWR_CMD.value)
bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version,
u8 fab_version, u8 interface_type,
struct wlan_pwr_cfg pwrcfgcmd[]);
#endif
|
/*
* ChaCha20 256-bit cipher algorithm, RFC7539
*
* Copyright (C) 2015 Martin Willi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include <asm/unaligned.h>
#include <crypto/algapi.h>
#include <crypto/chacha20.h>
#include <crypto/internal/skcipher.h>
#include <linux/module.h>
static void chacha20_docrypt(u32 *state, u8 *dst, const u8 *src,
unsigned int bytes)
{
u32 stream[CHACHA20_BLOCK_WORDS];
if (dst != src)
memcpy(dst, src, bytes);
while (bytes >= CHACHA20_BLOCK_SIZE) {
chacha20_block(state, stream);
crypto_xor(dst, (const u8 *)stream, CHACHA20_BLOCK_SIZE);
bytes -= CHACHA20_BLOCK_SIZE;
dst += CHACHA20_BLOCK_SIZE;
}
if (bytes) {
chacha20_block(state, stream);
crypto_xor(dst, (const u8 *)stream, bytes);
}
}
void crypto_chacha20_init(u32 *state, struct chacha20_ctx *ctx, u8 *iv)
{
state[0] = 0x61707865; /* "expa" */
state[1] = 0x3320646e; /* "nd 3" */
state[2] = 0x79622d32; /* "2-by" */
state[3] = 0x6b206574; /* "te k" */
state[4] = ctx->key[0];
state[5] = ctx->key[1];
state[6] = ctx->key[2];
state[7] = ctx->key[3];
state[8] = ctx->key[4];
state[9] = ctx->key[5];
state[10] = ctx->key[6];
state[11] = ctx->key[7];
state[12] = get_unaligned_le32(iv + 0);
state[13] = get_unaligned_le32(iv + 4);
state[14] = get_unaligned_le32(iv + 8);
state[15] = get_unaligned_le32(iv + 12);
}
EXPORT_SYMBOL_GPL(crypto_chacha20_init);
int crypto_chacha20_setkey(struct crypto_skcipher *tfm, const u8 *key,
unsigned int keysize)
{
struct chacha20_ctx *ctx = crypto_skcipher_ctx(tfm);
int i;
if (keysize != CHACHA20_KEY_SIZE)
return -EINVAL;
for (i = 0; i < ARRAY_SIZE(ctx->key); i++)
ctx->key[i] = get_unaligned_le32(key + i * sizeof(u32));
return 0;
}
EXPORT_SYMBOL_GPL(crypto_chacha20_setkey);
int crypto_chacha20_crypt(struct skcipher_request *req)
{
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
struct chacha20_ctx *ctx = crypto_skcipher_ctx(tfm);
struct skcipher_walk walk;
u32 state[16];
int err;
err = skcipher_walk_virt(&walk, req, true);
crypto_chacha20_init(state, ctx, walk.iv);
while (walk.nbytes > 0) {
unsigned int nbytes = walk.nbytes;
if (nbytes < walk.total)
nbytes = round_down(nbytes, walk.stride);
chacha20_docrypt(state, walk.dst.virt.addr, walk.src.virt.addr,
nbytes);
err = skcipher_walk_done(&walk, walk.nbytes - nbytes);
}
return err;
}
EXPORT_SYMBOL_GPL(crypto_chacha20_crypt);
static struct skcipher_alg alg = {
.base.cra_name = "chacha20",
.base.cra_driver_name = "chacha20-generic",
.base.cra_priority = 100,
.base.cra_blocksize = 1,
.base.cra_ctxsize = sizeof(struct chacha20_ctx),
.base.cra_module = THIS_MODULE,
.min_keysize = CHACHA20_KEY_SIZE,
.max_keysize = CHACHA20_KEY_SIZE,
.ivsize = CHACHA20_IV_SIZE,
.chunksize = CHACHA20_BLOCK_SIZE,
.setkey = crypto_chacha20_setkey,
.encrypt = crypto_chacha20_crypt,
.decrypt = crypto_chacha20_crypt,
};
static int __init chacha20_generic_mod_init(void)
{
return crypto_register_skcipher(&alg);
}
static void __exit chacha20_generic_mod_fini(void)
{
crypto_unregister_skcipher(&alg);
}
module_init(chacha20_generic_mod_init);
module_exit(chacha20_generic_mod_fini);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Martin Willi <martin@strongswan.org>");
MODULE_DESCRIPTION("chacha20 cipher algorithm");
MODULE_ALIAS_CRYPTO("chacha20");
MODULE_ALIAS_CRYPTO("chacha20-generic");
|
// Copyright 2018 Google Inc. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the COPYING file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
// -----------------------------------------------------------------------------
//
// ARM NEON version of cost functions
#include "src/dsp/dsp.h"
#if defined(WEBP_USE_NEON)
#include "src/dsp/neon.h"
#include "src/enc/cost_enc.h"
static const uint8_t position[16] = { 1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16 };
static void SetResidualCoeffs_NEON(const int16_t* const coeffs,
VP8Residual* const res) {
const int16x8_t minus_one = vdupq_n_s16(-1);
const int16x8_t coeffs_0 = vld1q_s16(coeffs);
const int16x8_t coeffs_1 = vld1q_s16(coeffs + 8);
const uint16x8_t eob_0 = vtstq_s16(coeffs_0, minus_one);
const uint16x8_t eob_1 = vtstq_s16(coeffs_1, minus_one);
const uint8x16_t eob = vcombine_u8(vqmovn_u16(eob_0), vqmovn_u16(eob_1));
const uint8x16_t masked = vandq_u8(eob, vld1q_u8(position));
#ifdef __aarch64__
res->last = vmaxvq_u8(masked) - 1;
#else
const uint8x8_t eob_8x8 = vmax_u8(vget_low_u8(masked), vget_high_u8(masked));
const uint16x8_t eob_16x8 = vmovl_u8(eob_8x8);
const uint16x4_t eob_16x4 =
vmax_u16(vget_low_u16(eob_16x8), vget_high_u16(eob_16x8));
const uint32x4_t eob_32x4 = vmovl_u16(eob_16x4);
uint32x2_t eob_32x2 =
vmax_u32(vget_low_u32(eob_32x4), vget_high_u32(eob_32x4));
eob_32x2 = vpmax_u32(eob_32x2, eob_32x2);
vst1_lane_s32(&res->last, vreinterpret_s32_u32(eob_32x2), 0);
--res->last;
#endif // __aarch64__
res->coeffs = coeffs;
}
static int GetResidualCost_NEON(int ctx0, const VP8Residual* const res) {
uint8_t levels[16], ctxs[16];
uint16_t abs_levels[16];
int n = res->first;
// should be prob[VP8EncBands[n]], but it's equivalent for n=0 or 1
const int p0 = res->prob[n][ctx0][0];
CostArrayPtr const costs = res->costs;
const uint16_t* t = costs[n][ctx0];
// bit_cost(1, p0) is already incorporated in t[] tables, but only if ctx != 0
// (as required by the syntax). For ctx0 == 0, we need to add it here or it'll
// be missing during the loop.
int cost = (ctx0 == 0) ? VP8BitCost(1, p0) : 0;
if (res->last < 0) {
return VP8BitCost(0, p0);
}
{ // precompute clamped levels and contexts, packed to 8b.
const uint8x16_t kCst2 = vdupq_n_u8(2);
const uint8x16_t kCst67 = vdupq_n_u8(MAX_VARIABLE_LEVEL);
const int16x8_t c0 = vld1q_s16(res->coeffs);
const int16x8_t c1 = vld1q_s16(res->coeffs + 8);
const uint16x8_t E0 = vreinterpretq_u16_s16(vabsq_s16(c0));
const uint16x8_t E1 = vreinterpretq_u16_s16(vabsq_s16(c1));
const uint8x16_t F = vcombine_u8(vqmovn_u16(E0), vqmovn_u16(E1));
const uint8x16_t G = vminq_u8(F, kCst2); // context = 0,1,2
const uint8x16_t H = vminq_u8(F, kCst67); // clamp_level in [0..67]
vst1q_u8(ctxs, G);
vst1q_u8(levels, H);
vst1q_u16(abs_levels, E0);
vst1q_u16(abs_levels + 8, E1);
}
for (; n < res->last; ++n) {
const int ctx = ctxs[n];
const int level = levels[n];
const int flevel = abs_levels[n]; // full level
cost += VP8LevelFixedCosts[flevel] + t[level]; // simplified VP8LevelCost()
t = costs[n + 1][ctx];
}
// Last coefficient is always non-zero
{
const int level = levels[n];
const int flevel = abs_levels[n];
assert(flevel != 0);
cost += VP8LevelFixedCosts[flevel] + t[level];
if (n < 15) {
const int b = VP8EncBands[n + 1];
const int ctx = ctxs[n];
const int last_p0 = res->prob[b][ctx][0];
cost += VP8BitCost(0, last_p0);
}
}
return cost;
}
//------------------------------------------------------------------------------
// Entry point
extern void VP8EncDspCostInitNEON(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitNEON(void) {
VP8SetResidualCoeffs = SetResidualCoeffs_NEON;
VP8GetResidualCost = GetResidualCost_NEON;
}
#else // !WEBP_USE_NEON
WEBP_DSP_INIT_STUB(VP8EncDspCostInitNEON)
#endif // WEBP_USE_NEON
|
/*
* PS3 bootwrapper support.
*
* Copyright (C) 2007 Sony Computer Entertainment Inc.
* Copyright 2007 Sony 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; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <stddef.h>
#include "types.h"
#include "elf.h"
#include "string.h"
#include "stdio.h"
#include "page.h"
#include "ops.h"
extern int lv1_panic(u64 in_1);
extern int lv1_get_logical_partition_id(u64 *out_1);
extern int lv1_get_logical_ppe_id(u64 *out_1);
extern int lv1_get_repository_node_value(u64 in_1, u64 in_2, u64 in_3,
u64 in_4, u64 in_5, u64 *out_1, u64 *out_2);
#ifdef DEBUG
#define DBG(fmt...) printf(fmt)
#else
static inline int __attribute__ ((format (printf, 1, 2))) DBG(
const char *fmt, ...) {return 0;}
#endif
BSS_STACK(4096);
/* A buffer that may be edited by tools operating on a zImage binary so as to
* edit the command line passed to vmlinux (by setting /chosen/bootargs).
* The buffer is put in it's own section so that tools may locate it easier.
*/
static char cmdline[COMMAND_LINE_SIZE]
__attribute__((__section__("__builtin_cmdline")));
static void prep_cmdline(void *chosen)
{
if (cmdline[0] == '\0')
getprop(chosen, "bootargs", cmdline, COMMAND_LINE_SIZE-1);
else
setprop_str(chosen, "bootargs", cmdline);
printf("cmdline: '%s'\n", cmdline);
}
static void ps3_console_write(const char *buf, int len)
{
}
static void ps3_exit(void)
{
printf("ps3_exit\n");
/* lv1_panic will shutdown the lpar. */
lv1_panic(0); /* zero = do not reboot */
while (1);
}
static int ps3_repository_read_rm_size(u64 *rm_size)
{
int result;
u64 lpar_id;
u64 ppe_id;
u64 v2;
result = lv1_get_logical_partition_id(&lpar_id);
if (result)
return -1;
result = lv1_get_logical_ppe_id(&ppe_id);
if (result)
return -1;
/*
* n1: 0000000062690000 : ....bi..
* n2: 7075000000000000 : pu......
* n3: 0000000000000001 : ........
* n4: 726d5f73697a6500 : rm_size.
*/
result = lv1_get_repository_node_value(lpar_id, 0x0000000062690000ULL,
0x7075000000000000ULL, ppe_id, 0x726d5f73697a6500ULL, rm_size,
&v2);
printf("%s:%d: ppe_id %lu \n", __func__, __LINE__,
(unsigned long)ppe_id);
printf("%s:%d: lpar_id %lu \n", __func__, __LINE__,
(unsigned long)lpar_id);
printf("%s:%d: rm_size %llxh \n", __func__, __LINE__, *rm_size);
return result ? -1 : 0;
}
void ps3_copy_vectors(void)
{
extern char __system_reset_kernel[];
memcpy((void *)0x100, __system_reset_kernel, 512);
flush_cache((void *)0x100, 512);
}
void platform_init(void)
{
const u32 heapsize = 0x1000000 - (u32)_end; /* 16MiB */
void *chosen;
unsigned long ft_addr;
u64 rm_size;
console_ops.write = ps3_console_write;
platform_ops.exit = ps3_exit;
printf("\n-- PS3 bootwrapper --\n");
simple_alloc_init(_end, heapsize, 32, 64);
fdt_init(_dtb_start);
chosen = finddevice("/chosen");
ps3_repository_read_rm_size(&rm_size);
dt_fixup_memory(0, rm_size);
if (_initrd_end > _initrd_start) {
setprop_val(chosen, "linux,initrd-start", (u32)(_initrd_start));
setprop_val(chosen, "linux,initrd-end", (u32)(_initrd_end));
}
prep_cmdline(chosen);
ft_addr = dt_ops.finalize();
ps3_copy_vectors();
printf(" flat tree at 0x%lx\n\r", ft_addr);
((kernel_entry_t)0)(ft_addr, 0, NULL);
ps3_exit();
}
|
/* Copyright 2018 xAceOfSpaidsx
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
// Layer shorthand
#define _QW 0
#define _FN 1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY - based off xd75 default map with a couple modifications for my preference
* .--------------------------------------------------------------------------------------------------------------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | F2 | ` | F5 | 6 | 7 | 8 | 9 | 0 | BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | E | R | T | - | \ | = | Y | U | I | O | P | ' |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
* | CAP LK | A | S | D | F | G | HOME | DEL | PG UP | H | J | K | L | ; | ENTER |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
* | LSHIFT | Z | X | C | V | B | END | UP | PG DN | N | M | , | . | / | RSHIFT |
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
* | LCTRL | LGUI | LALT | FN | SPACE | SPACE | LEFT | DOWN | RIGHT | [ | ] | FN | RALT | RGUI | RCTRL |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_QW] = LAYOUT_ortho_5x15( /* QWERTY */
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F2, KC_GRV, KC_F5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_BSLS, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_LBRC, KC_RBRC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL \
),
/* FUNCTION Layer - removed the rgb hue saturation and vibrance for audio controls and added some functionality I use from other boards.
* .--------------------------------------------------------------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | NUM LK | P/ | P* | F7 | F8 | F9 | F10 | F11 | F12 |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | SELECT | CALC | UP | | | NEXT | P7 | P8 | P9 | - | | | PR SCR | SCR LK | PAUSE |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | PREV | LEFT | DOWN | RIGHT | DEL | PLAY | P4 | P5 | P6 | + | | RESET | | | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | VOL- | MUTE | VOL+ | APP | | STOP | P1 | P2 | P3 | PENT | | | | | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | | RGB TG | FN | RGB RMD| RGB MD | P0 | | P. | PENT | PENT | FN | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_FN] = LAYOUT_ortho_5x15( /* FUNCTION */
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
KC_MSEL, KC_CALC, KC_UP , _______, _______, KC_MNXT, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \
KC_MPRV, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL , KC_MPLY, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______, \
KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, _______, KC_MSTP, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______, \
_______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ \
),
};
|
/*
* Modified for use with MPlayer, detailed changelog at
* http://svn.mplayerhq.hu/mplayer/trunk/
*/
#ifndef MPLAYER_EXT_H
#define MPLAYER_EXT_H
#include "wine/windef.h"
LPVOID FILE_dommap( int unix_handle, LPVOID start,
DWORD size_high, DWORD size_low,
DWORD offset_high, DWORD offset_low,
int prot, int flags );
int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low );
int wcsnicmp( const unsigned short* s1, const unsigned short* s2, int n );
int __vprintf( const char *format, ... );
#endif /* MPLAYER_EXT_H */
|
#include <linux/init.h>
#include <linux/kthread.h>
#include <linux/hrtimer.h>
#include <linux/fs.h>
#include <linux/debugfs.h>
#include <linux/export.h>
#include <linux/spinlock.h>
static int ss_get(void *data, u64 *val)
{
ktime_t start, finish;
int loops;
int cont;
DEFINE_RAW_SPINLOCK(ss_spin);
loops = 1000000;
cont = 1;
start = ktime_get();
while (cont) {
raw_spin_lock(&ss_spin);
loops--;
if (loops == 0)
cont = 0;
raw_spin_unlock(&ss_spin);
}
finish = ktime_get();
*val = ktime_us_delta(finish, start);
return 0;
}
DEFINE_SIMPLE_ATTRIBUTE(fops_ss, ss_get, NULL, "%llu\n");
struct spin_multi_state {
raw_spinlock_t lock;
atomic_t start_wait;
atomic_t enter_wait;
atomic_t exit_wait;
int loops;
};
struct spin_multi_per_thread {
struct spin_multi_state *state;
ktime_t start;
};
static int multi_other(void *data)
{
int loops;
int cont;
struct spin_multi_per_thread *pt = data;
struct spin_multi_state *s = pt->state;
loops = s->loops;
cont = 1;
atomic_dec(&s->enter_wait);
while (atomic_read(&s->enter_wait))
; /* spin */
pt->start = ktime_get();
atomic_dec(&s->start_wait);
while (atomic_read(&s->start_wait))
; /* spin */
while (cont) {
raw_spin_lock(&s->lock);
loops--;
if (loops == 0)
cont = 0;
raw_spin_unlock(&s->lock);
}
atomic_dec(&s->exit_wait);
while (atomic_read(&s->exit_wait))
; /* spin */
return 0;
}
static int multi_get(void *data, u64 *val)
{
ktime_t finish;
struct spin_multi_state ms;
struct spin_multi_per_thread t1, t2;
ms.lock = __RAW_SPIN_LOCK_UNLOCKED("multi_get");
ms.loops = 1000000;
atomic_set(&ms.start_wait, 2);
atomic_set(&ms.enter_wait, 2);
atomic_set(&ms.exit_wait, 2);
t1.state = &ms;
t2.state = &ms;
kthread_run(multi_other, &t2, "multi_get");
multi_other(&t1);
finish = ktime_get();
*val = ktime_us_delta(finish, t1.start);
return 0;
}
DEFINE_SIMPLE_ATTRIBUTE(fops_multi, multi_get, NULL, "%llu\n");
extern struct dentry *mips_debugfs_dir;
static int __init spinlock_test(void)
{
struct dentry *d;
if (!mips_debugfs_dir)
return -ENODEV;
d = debugfs_create_file("spin_single", S_IRUGO,
mips_debugfs_dir, NULL,
&fops_ss);
if (!d)
return -ENOMEM;
d = debugfs_create_file("spin_multi", S_IRUGO,
mips_debugfs_dir, NULL,
&fops_multi);
if (!d)
return -ENOMEM;
return 0;
}
device_initcall(spinlock_test);
|
/*
* cocos2d for iPhone: http://www.cocos2d-iphone.org
*
* Copyright (c) 2008-2010 Ricardo Quesada
* Copyright (c) 2011 Zynga Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* 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.
*/
// Only compile this code on iOS. These files should NOT be included on your Mac project.
// But in case they are included, it won't be compiled.
#import "../../ccMacros.h"
#ifdef __CC_PLATFORM_IOS
#import "../../CCDirector.h"
#import "kazmath/mat4.h"
@class CCTouchDispatcher;
/** CCDirector extensions for iPhone
*/
@interface CCDirector (iOSExtension)
/** sets the CCTouchDispatcher (iOS only) */
@property (nonatomic,readwrite,retain) CCTouchDispatcher * touchDispatcher;
/** The size in pixels of the surface. It could be different than the screen size.
High-res devices might have a higher surface size than the screen size.
In non High-res device the contentScale will be emulated.
The recommend way to enable Retina Display is by using the "enableRetinaDisplay:(BOOL)enabled" method.
@since v0.99.4
*/
-(void) setContentScaleFactor:(CGFloat)scaleFactor;
/** Will enable Retina Display on devices that supports it.
It will enable Retina Display on iPhone4 and iPod Touch 4.
It will return YES, if it could enabled it, otherwise it will return NO.
This is the recommended way to enable Retina Display.
@since v0.99.5
*/
-(BOOL) enableRetinaDisplay:(BOOL)enableRetina;
/** returns the content scale factor */
-(CGFloat) contentScaleFactor;
/** converts a UITouch to a GL point */
-(CGPoint)convertTouchToGL:(UITouch*)touch;
@end
#pragma mark -
#pragma mark CCDirectorIOS
/** CCDirectorIOS: Base class of iOS directors
@since v0.99.5
*/
@interface CCDirectorIOS : CCDirector
{
/* contentScaleFactor could be simulated */
BOOL _isContentScaleSupported;
CCTouchDispatcher *_touchDispatcher;
}
// XXX: At least one method is needed for BridgeSupport
- (void) drawScene;
@end
/** DisplayLinkDirector is a Director that synchronizes timers with the refresh rate of the display.
*
* Features and Limitations:
* - Only available on 3.1+
* - Scheduled timers & drawing are synchronizes with the refresh rate of the display
* - Only supports animation intervals of 1/60 1/30 & 1/15
*
* It is the recommended Director if the SDK is 3.1 or newer
*
* @since v0.8.2
*/
@interface CCDirectorDisplayLink : CCDirectorIOS
{
CADisplayLink *_displayLink;
CFTimeInterval _lastDisplayTime;
}
-(void) mainLoop:(id)sender;
@end
// optimization. Should only be used to read it. Never to write it.
extern CGFloat __ccContentScaleFactor;
#endif // __CC_PLATFORM_IOS
|
/*
* AVR32 sempahore implementation.
*
* Copyright (C) 2004-2006 Atmel Corporation
*
* Based on linux/arch/i386/kernel/semaphore.c
* Copyright (C) 1999 Linus Torvalds
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <asm/semaphore.h>
#include <asm/atomic.h>
/*
* Semaphores are implemented using a two-way counter:
* The "count" variable is decremented for each process
* that tries to acquire the semaphore, while the "sleeping"
* variable is a count of such acquires.
*
* Notably, the inline "up()" and "down()" functions can
* efficiently test if they need to do any extra work (up
* needs to do something only if count was negative before
* the increment operation.
*
* "sleeping" and the contention routine ordering is protected
* by the spinlock in the semaphore's waitqueue head.
*
* Note that these functions are only called when there is
* contention on the lock, and as such all this is the
* "non-critical" part of the whole semaphore business. The
* critical part is the inline stuff in <asm/semaphore.h>
* where we want to avoid any extra jumps and calls.
*/
/*
* Logic:
* - only on a boundary condition do we need to care. When we go
* from a negative count to a non-negative, we wake people up.
* - when we go from a non-negative count to a negative do we
* (a) synchronize with the "sleeper" count and (b) make sure
* that we're on the wakeup list before we synchronize so that
* we cannot lose wakeup events.
*/
void __up(struct semaphore *sem)
{
wake_up(&sem->wait);
}
EXPORT_SYMBOL(__up);
void __sched __down(struct semaphore *sem)
{
struct task_struct *tsk = current;
DECLARE_WAITQUEUE(wait, tsk);
unsigned long flags;
tsk->state = TASK_UNINTERRUPTIBLE;
spin_lock_irqsave(&sem->wait.lock, flags);
add_wait_queue_exclusive_locked(&sem->wait, &wait);
sem->sleepers++;
for (;;) {
int sleepers = sem->sleepers;
/*
* Add "everybody else" into it. They aren't
* playing, because we own the spinlock in
* the wait_queue_head.
*/
if (atomic_add_return(sleepers - 1, &sem->count) >= 0) {
sem->sleepers = 0;
break;
}
sem->sleepers = 1; /* us - see -1 above */
spin_unlock_irqrestore(&sem->wait.lock, flags);
schedule();
spin_lock_irqsave(&sem->wait.lock, flags);
tsk->state = TASK_UNINTERRUPTIBLE;
}
remove_wait_queue_locked(&sem->wait, &wait);
wake_up_locked(&sem->wait);
spin_unlock_irqrestore(&sem->wait.lock, flags);
tsk->state = TASK_RUNNING;
}
EXPORT_SYMBOL(__down);
int __sched __down_interruptible(struct semaphore *sem)
{
int retval = 0;
struct task_struct *tsk = current;
DECLARE_WAITQUEUE(wait, tsk);
unsigned long flags;
tsk->state = TASK_INTERRUPTIBLE;
spin_lock_irqsave(&sem->wait.lock, flags);
add_wait_queue_exclusive_locked(&sem->wait, &wait);
sem->sleepers++;
for (;;) {
int sleepers = sem->sleepers;
/*
* With signals pending, this turns into the trylock
* failure case - we won't be sleeping, and we can't
* get the lock as it has contention. Just correct the
* count and exit.
*/
if (signal_pending(current)) {
retval = -EINTR;
sem->sleepers = 0;
atomic_add(sleepers, &sem->count);
break;
}
/*
* Add "everybody else" into it. They aren't
* playing, because we own the spinlock in
* the wait_queue_head.
*/
if (atomic_add_return(sleepers - 1, &sem->count) >= 0) {
sem->sleepers = 0;
break;
}
sem->sleepers = 1; /* us - see -1 above */
spin_unlock_irqrestore(&sem->wait.lock, flags);
schedule();
spin_lock_irqsave(&sem->wait.lock, flags);
tsk->state = TASK_INTERRUPTIBLE;
}
remove_wait_queue_locked(&sem->wait, &wait);
wake_up_locked(&sem->wait);
spin_unlock_irqrestore(&sem->wait.lock, flags);
tsk->state = TASK_RUNNING;
return retval;
}
EXPORT_SYMBOL(__down_interruptible);
|
/*
* CAN driver for PEAK System USB adapters
* Derived from the PCAN project file driver/src/pcan_usb_core.c
*
* Copyright (C) 2003-2010 PEAK System-Technik GmbH
* Copyright (C) 2010-2012 Stephane Grosjean <s.grosjean@peak-system.com>
*
* Many thanks to Klaus Hitschler <klaus.hitschler@gmx.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef PCAN_USB_CORE_H
#define PCAN_USB_CORE_H
/* PEAK-System vendor id. */
#define PCAN_USB_VENDOR_ID 0x0c72
/* supported device ids. */
#define PCAN_USB_PRODUCT_ID 0x000c
#define PCAN_USBPRO_PRODUCT_ID 0x000d
#define PCAN_USB_DRIVER_NAME "peak_usb"
/* number of urbs that are submitted for rx/tx per channel */
#define PCAN_USB_MAX_RX_URBS 4
#define PCAN_USB_MAX_TX_URBS 10
/* usb adapters maximum channels per usb interface */
#define PCAN_USB_MAX_CHANNEL 2
/* maximum length of the usb commands sent to/received from the devices */
#define PCAN_USB_MAX_CMD_LEN 32
struct peak_usb_device;
/* PEAK-System USB adapter descriptor */
struct peak_usb_adapter {
char *name;
u32 device_id;
struct can_clock clock;
const struct can_bittiming_const bittiming_const;
unsigned int ctrl_count;
int (*intf_probe)(struct usb_interface *intf);
int (*dev_init)(struct peak_usb_device *dev);
void (*dev_exit)(struct peak_usb_device *dev);
void (*dev_free)(struct peak_usb_device *dev);
int (*dev_open)(struct peak_usb_device *dev);
int (*dev_close)(struct peak_usb_device *dev);
int (*dev_set_bittiming)(struct peak_usb_device *dev,
struct can_bittiming *bt);
int (*dev_set_bus)(struct peak_usb_device *dev, u8 onoff);
int (*dev_get_device_id)(struct peak_usb_device *dev, u32 *device_id);
int (*dev_decode_buf)(struct peak_usb_device *dev, struct urb *urb);
int (*dev_encode_msg)(struct peak_usb_device *dev, struct sk_buff *skb,
u8 *obuf, size_t *size);
int (*dev_start)(struct peak_usb_device *dev);
int (*dev_stop)(struct peak_usb_device *dev);
int (*dev_restart_async)(struct peak_usb_device *dev, struct urb *urb,
u8 *buf);
u8 ep_msg_in;
u8 ep_msg_out[PCAN_USB_MAX_CHANNEL];
u8 ts_used_bits;
u32 ts_period;
u8 us_per_ts_shift;
u32 us_per_ts_scale;
int rx_buffer_size;
int tx_buffer_size;
int sizeof_dev_private;
};
extern struct peak_usb_adapter pcan_usb;
extern struct peak_usb_adapter pcan_usb_pro;
struct peak_time_ref {
struct timeval tv_host_0, tv_host;
u32 ts_dev_1, ts_dev_2;
u64 ts_total;
u32 tick_count;
struct peak_usb_adapter *adapter;
};
struct peak_tx_urb_context {
struct peak_usb_device *dev;
u32 echo_index;
u8 dlc;
struct urb *urb;
};
#define PCAN_USB_STATE_CONNECTED 0x00000001
#define PCAN_USB_STATE_STARTED 0x00000002
/* PEAK-System USB device */
struct peak_usb_device {
struct can_priv can;
struct peak_usb_adapter *adapter;
unsigned int ctrl_idx;
int open_time;
u32 state;
struct sk_buff *echo_skb[PCAN_USB_MAX_TX_URBS];
struct usb_device *udev;
struct net_device *netdev;
atomic_t active_tx_urbs;
struct usb_anchor tx_submitted;
struct peak_tx_urb_context tx_contexts[PCAN_USB_MAX_TX_URBS];
u8 *cmd_buf;
struct usb_anchor rx_submitted;
u32 device_number;
u8 device_rev;
u8 ep_msg_in;
u8 ep_msg_out;
u16 bus_load;
struct peak_usb_device *prev_siblings;
struct peak_usb_device *next_siblings;
};
void dump_mem(char *prompt, void *p, int l);
/* common timestamp management */
void peak_usb_init_time_ref(struct peak_time_ref *time_ref,
struct peak_usb_adapter *adapter);
void peak_usb_update_ts_now(struct peak_time_ref *time_ref, u32 ts_now);
void peak_usb_set_ts_now(struct peak_time_ref *time_ref, u32 ts_now);
void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts,
struct timeval *tv);
void peak_usb_async_complete(struct urb *urb);
void peak_usb_restart_complete(struct peak_usb_device *dev);
#endif
|
//
// Copyright (c) 2012 The ANGLE 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.
//
// SwapChain.h: Defines a back-end specific class that hides the details of the
// implementation-specific swapchain.
#ifndef LIBGLESV2_RENDERER_SWAPCHAIN_H_
#define LIBGLESV2_RENDERER_SWAPCHAIN_H_
#include "common/angleutils.h"
#include "common/NativeWindow.h"
#include "common/platform.h"
#include <GLES2/gl2.h>
#include <EGL/egl.h>
#if !defined(ANGLE_FORCE_VSYNC_OFF)
#define ANGLE_FORCE_VSYNC_OFF 0
#endif
namespace rx
{
class SwapChain
{
public:
SwapChain(rx::NativeWindow nativeWindow, HANDLE shareHandle, GLenum backBufferFormat, GLenum depthBufferFormat)
: mNativeWindow(nativeWindow), mShareHandle(shareHandle), mBackBufferFormat(backBufferFormat), mDepthBufferFormat(depthBufferFormat)
{
}
virtual ~SwapChain() {};
virtual EGLint resize(EGLint backbufferWidth, EGLint backbufferSize) = 0;
virtual EGLint reset(EGLint backbufferWidth, EGLint backbufferHeight, EGLint swapInterval) = 0;
virtual EGLint swapRect(EGLint x, EGLint y, EGLint width, EGLint height) = 0;
virtual void recreate() = 0;
GLenum GetBackBufferInternalFormat() const { return mBackBufferFormat; }
GLenum GetDepthBufferInternalFormat() const { return mDepthBufferFormat; }
virtual HANDLE getShareHandle() {return mShareHandle;};
protected:
rx::NativeWindow mNativeWindow; // Handler for the Window that the surface is created for.
const GLenum mBackBufferFormat;
const GLenum mDepthBufferFormat;
HANDLE mShareHandle;
};
}
#endif // LIBGLESV2_RENDERER_SWAPCHAIN_H_
|
/*
* TQM85xx (40/41/55/60) board definitions
*
* Copyright (c) 2005 DENX Software Engineering
* Stefan Roese <sr@denx.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
*/
#ifndef __MACH_TQM85XX_H
#define __MACH_TQM85XX_H
#include <linux/init.h>
#include <asm/ppcboot.h>
#define BOARD_CCSRBAR ((uint)0xe0000000)
#define CCSRBAR_SIZE ((uint)1024*1024)
#define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET)
#define PCI_CFG_ADDR_OFFSET (0x8000)
#define PCI_CFG_DATA_OFFSET (0x8004)
/* PCI interrupt controller */
#define PIRQA MPC85xx_IRQ_EXT2
#define PIRQB MPC85xx_IRQ_EXT3
#define MPC85XX_PCI1_LOWER_IO 0x00000000
#define MPC85XX_PCI1_UPPER_IO 0x00ffffff
#define MPC85XX_PCI1_LOWER_MEM 0x80000000
#define MPC85XX_PCI1_UPPER_MEM 0x9fffffff
#define MPC85XX_PCI1_IO_BASE 0xe2000000
#define MPC85XX_PCI1_MEM_OFFSET 0x00000000
#define MPC85XX_PCI1_IO_SIZE 0x01000000
#define BASE_BAUD 115200
extern void mpc85xx_setup_hose(void) __init;
extern void mpc85xx_restart(char *cmd);
extern void mpc85xx_power_off(void);
extern void mpc85xx_halt(void);
extern void mpc85xx_init_IRQ(void) __init;
extern unsigned long mpc85xx_find_end_of_memory(void) __init;
extern void mpc85xx_calibrate_decr(void) __init;
#endif /* __MACH_TQM85XX_H */
|
/**
* \file
*
* \brief SAM4CP clock configuration.
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_CLOCK_H_INCLUDED
#define CONF_CLOCK_H_INCLUDED
// ===== System Clock (MCK) Source Options
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_RC
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_XTAL
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_BYPASS
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_4M_RC
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_8M_RC
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_12M_RC
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_XTAL
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_BYPASS
//#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLLACK
#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLLBCK
// ===== System Clock (MCK) Prescaler Options (Fmck = Fsys / (SYSCLK_PRES))
#define CONFIG_SYSCLK_PRES SYSCLK_PRES_1
//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_2
//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_4
//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_8
//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_16
//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_32
//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_64
//#define CONFIG_SYSCLK_PRES SYSCLK_PRES_3
// ===== PLL0 (A) Options (8.192M = (32.768K * 250) / 1)
//#define CONFIG_PLL0_SOURCE PLLA_SRC_SLCK_32K_XTAL
// ===== PLL1 (B) Options (Fpll = (Fclk * PLL_mul) / PLL_div)
// Use mul and div effective values here.
#define CONFIG_PLL1_SOURCE PLLB_SRC_MAINCK_BYPASS
#define CONFIG_PLL1_MUL (240000000UL / BOARD_FREQ_MAINCK_BYPASS)
#define CONFIG_PLL1_DIV 2
// ===== Coprocessor System Clock (CPMCK) Options
// Fcpmck = Fcpclk_source / CPCLK_PRES
// Note:
// CONFIG_CPCLK_ENABLE MUST be defined if using peripherals on bus matrix 1.
#define CONFIG_CPCLK_ENABLE
// Coprocessor System Clock Source Options
//#define CONFIG_CPCLK_SOURCE CPCLK_SRC_SLCK
//#define CONFIG_CPCLK_SOURCE CPCLK_SRC_MAINCK
//#define CONFIG_CPCLK_SOURCE CPCLK_SRC_PLLACK
//#define CONFIG_CPCLK_SOURCE CPCLK_SRC_PLLBCK
#define CONFIG_CPCLK_SOURCE CPCLK_SRC_MCK
// Coprocessor System Clock Prescaler Options (CPCLK_PRES may be 1 to 16).
#define CONFIG_CPCLK_PRES 1
// ===== Main processor frequency (MCK)
// - Bypass mode frequency: 10MHz
// - System clock source: PLLB
// - System clock prescaler: 1 (divided by 1)
// - PLLB source: BYPASS
// - PLLB output: BYPASS * 24 / 2
// - System clock: 10 * 24 / 2 / 1 = 120MHz
//
// ===== Coprocessor frequency (CPMCK)
// - Coprocessor system clock source: MCK
// - Coprocessor system clock prescaler: 1 (divided by 1)
// - Coprocessor system clock: 120MHz / 1 = 120MHz
#endif /* CONF_CLOCK_H_INCLUDED */
|
/* { dg-do link { target { *-*-linux* && powerpc_fprs } } } */
/* { dg-options "-W -Wall -Wno-uninitialized -Wno-unused-but-set-variable -mcpu=cell" } */
/* Test some PPU intrinsics from <ppu_intrinsics.h>. */
#include <ppu_intrinsics.h>
int main ()
{
double d, d1, d2;
float f, f1, f2;
unsigned long long ull, a, b;
long long ll;
int i;
#ifdef __powerpc64__
ull = __rldcl (a, b, 3);
ull = __rldcr (a, b, 3);
ull = __rldic (a, 3, 4);
ull = __rldicl (a, 4, 5);
ull = __rldicr (a, 2, 3);
ull = __rldimi (a, b, 4, 6);
#endif
ull = __rlwimi (a, b, 6, 9, 12);
ull = __rlwnm (a, b, 3, 5);
d = __fmul (d1, d2);
f = __fmuls (f1, f2);
f = __frsp (f);
d = __fcfid (ll);
d = __frsqrte (d1);
ll = __fctid (d);
ll = __fctidz (d);
i = __fctiw (d);
i = __fctiwz (d);
__protected_stream_count (1, 2);
__protected_stream_go ();
__protected_stream_set (1, 0x1000, 3);
__protected_stream_stop (3);
__protected_stream_stop_all ();
__protected_unlimited_stream_set (3, 0x1000, 1);
return 0;
}
|
#include "crypto_sign.h"
#include "crypto_verify_32.h"
#include "crypto_hash_sha512.h"
#include "ge25519.h"
#include "hram.h"
int crypto_sign_open(
unsigned char *m,unsigned long long *mlen,
const unsigned char *sm,unsigned long long smlen,
const unsigned char *pk
)
{
int i;
unsigned char t2[32];
ge25519 get1, get2;
sc25519 schram, scs;
unsigned char hram[crypto_hash_sha512_BYTES];
*mlen = (unsigned long long) -1;
if (smlen < 64) goto badsig;
if (ge25519_unpackneg_vartime(&get1, pk)) goto badsig;
get_hram(hram,sm,pk,m,smlen);
sc25519_from64bytes(&schram, hram);
sc25519_from32bytes(&scs, sm+32);
ge25519_double_scalarmult_vartime(&get2, &get1, &schram, &scs);
ge25519_pack(t2, &get2);
if (!crypto_verify_32(sm, t2))
{
for(i=0;i<smlen-64;i++)
m[i] = sm[i + 64];
*mlen = smlen-64;
return 0;
}
badsig:
for(i=0;i<smlen-64;i++)
m[i] = 0;
return -1;
}
|
/* SPDX-License-Identifier: GPL-2.0 */
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
******************************************************************************/
#ifndef __ODMCFOTRACK_H__
#define __ODMCFOTRACK_H__
#define CFO_TH_XTAL_HIGH 20 /* kHz */
#define CFO_TH_XTAL_LOW 10 /* kHz */
#define CFO_TH_ATC 80 /* kHz */
typedef struct _CFO_TRACKING_ {
bool bATCStatus;
bool largeCFOHit;
bool bAdjust;
u8 CrystalCap;
u8 DefXCap;
int CFO_tail[2];
int CFO_ave_pre;
u32 packetCount;
u32 packetCount_pre;
bool bForceXtalCap;
bool bReset;
} CFO_TRACKING, *PCFO_TRACKING;
void ODM_CfoTrackingReset(void *pDM_VOID
);
void ODM_CfoTrackingInit(void *pDM_VOID);
void ODM_CfoTracking(void *pDM_VOID);
void ODM_ParsingCFO(void *pDM_VOID, void *pPktinfo_VOID, s8 *pcfotail);
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.