text stringlengths 4 6.14k |
|---|
/* { dg-do preprocess } */
/* { dg-options "-P -dU" } */
/* { dg-final { scan-file cmdlne-dU-1.i "^\n*#undef A\n*$" } } */
#ifdef A
#endif
|
#ifndef ALIANALYSISTASKZDCPBPB_H
#define ALIANALYSISTASKZDCPBPB_H
/* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
//*****************************************************
// Class AliAnalysisTaskZDCpA
// author: Chiara Oppedisano
//*****************************************************
#include "AliAnalysisTaskSE.h"
class TROOT;
class TSystem;
class TList;
class TFile;
class TH1F;
class TH2F;
#include "AliAnalysisTaskSE.h"
class AliAnalysisTaskZDCpA : public AliAnalysisTaskSE {
public:
enum kAnalysisInput{kESD=1, kAOD=2};
AliAnalysisTaskZDCpA();
AliAnalysisTaskZDCpA(const char *name);
AliAnalysisTaskZDCpA& operator= (const AliAnalysisTaskZDCpA& ana);
AliAnalysisTaskZDCpA(const AliAnalysisTaskZDCpA& c);
virtual ~AliAnalysisTaskZDCpA();
// Implementation of interface methods
virtual void UserCreateOutputObjects();
virtual void UserExec(Option_t *option);
virtual void Terminate(Option_t *option);
virtual void SetDebugLevel(Int_t level) {fDebug = level;}
void SetInput(int input) {fAnalysisInput = input;}
void SetMCInput() {fIsMCInput = kTRUE;}
void SetCentralityRange(Float_t centrlow=0., Float_t centrup=100.) {fCentrLowLim=centrlow;
fCentrUpLim=centrup;}
void SetCentralityEstimator(TString centrest = "V0M") {fCentrEstimator=centrest;}
private:
Int_t fAnalysisInput; // analysis input
Bool_t fIsMCInput; // true when input is MC
Float_t fCentrLowLim; // centrality lower limit
Float_t fCentrUpLim; // centrality upper limit
TString fCentrEstimator; // string for the centrality estimator
//
TList *fOutput; //! list send on output slot 0
//
TH1F *fhZNCPM[5]; //! ZNC PM high res.
TH1F *fhZNAPM[5]; //! ZNA PM high res.
TH1F *fhZPCPM[5]; //! ZPC PM high res.
TH1F *fhZPAPM[5]; //! ZPA PM high res.
TH1F *fhZEM[2]; //! ZEM PM high res.
TH1F *fhZNCPMlg[5]; //! ZNC PM low res.
TH1F *fhZNAPMlg[5]; //! ZNA PM low res.
TH1F *fhZPCPMlg[5]; //! ZPC PM low res.
TH1F *fhZPAPMlg[5]; //! ZPA PM low res.
TH1F *fhTDCraw[6]; //! raw TDC histos
TH1F *fhTDC[6]; //! corrected TDC histos
//
TH1F *fhZNCPMQiPMC[4]; //! PMQi/PMC for ZNC
TH1F *fhZNAPMQiPMC[4]; //! PMQi/PMC for ZNA
TH1F *fhZPCPMQiPMC[4]; //! PMQi/PMC for ZPC
TH1F *fhZPAPMQiPMC[4]; //! PMQi/PMC for ZPA
//
TH2F *fhZNCvsZNA; //! ZNC vs ZNA;
TH2F *fhZPCvsZPA; //! ZPC vs ZPA;
TH2F *fhZNCvsZPC; //! ZNC vs ZPC;
TH2F *fhZNAvsZPA; //! ZNA vs ZPA;
TH2F *fhZNAvsZEM; //! ZNA vs ZEM;
TH2F *fhZNCvsZEM; //! ZNC vs ZEM;
TH1F *fhZNAwV0M; //! ZNA weighted with V0M centr. perc.;
TH1F *fhZNCwV0M; //! ZNC weighted with V0M centr. perc.;
TH2F *fhZNAvsVZERO; //! ZNA vs VZERO;
TH2F *fhZNCvsVZERO; //! ZNC vs VZERO;
TH2F *fhZDCAvsTracklets; //! ZDCA vs N_tracklets;
TH2F *fhZDCCvsTracklets; //! ZDCC vs N_tracklets;
TH2F *fhVZEROvsZEM; //! VZERO vs ZEM;
TH2F *fhDebunch; //! Debunch;
TH2F *fhZNCcentroid; //! ZNC centroid
TH2F *fhZNAcentroid; //! ZNA centroid
TH2F *fhPMCvsPMQ[4]; //! PMC vs sum PMQi
//
TH2F *fhZNCvscentrality; //! ZNC vs. centrality
TH2F *fhZNAvscentrality; //! ZNA vs. centrality
TH2F *fhZPCvscentrality; //! ZPC vs. centrality
TH2F *fhZPAvscentrality; //! ZPA vs. centrality
//
TH2F *fhZNCpmcvscentr; //! ZNC vs. centrality
TH2F *fhZNApmcvscentr; //! ZNA vs. centrality
TH2F *fhZPCpmcvscentr; //! ZPC vs. centrality
TH2F *fhZPApmcvscentr; //! ZPA vs. centrality
ClassDef(AliAnalysisTaskZDCpA,1);
};
#endif
|
//
// XHMoreSettingTableViewController.h
// MessageDisplayExample
//
// Created by 曾 宪华 on 14-5-22.
// Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved.
//
#import "XHMultipleSectionTableViewController.h"
@interface XHMoreSettingTableViewController : XHMultipleSectionTableViewController
@end
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#ifndef _SuperPMI
#define _SuperPMI
#include "errorhandling.h"
enum SPMI_TARGET_ARCHITECTURE
{
SPMI_TARGET_ARCHITECTURE_X86,
SPMI_TARGET_ARCHITECTURE_AMD64,
SPMI_TARGET_ARCHITECTURE_ARM64,
SPMI_TARGET_ARCHITECTURE_ARM
};
extern SPMI_TARGET_ARCHITECTURE SpmiTargetArchitecture;
extern void SetSuperPmiTargetArchitecture(const char* targetArchitecture);
extern const char* const g_SuperPMIUsageFirstLine;
extern const char* const g_AllFormatStringFixedPrefix;
extern const char* const g_SummaryFormatString;
extern const char* const g_AsmDiffsSummaryFormatString;
#endif
|
/*
* linux/include/net/sunrpc/msg_prot.h
*
* Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
*/
#ifndef _LINUX_SUNRPC_MSGPROT_H_
#define _LINUX_SUNRPC_MSGPROT_H_
#ifdef __KERNEL__ /* user programs should get these from the rpc header files */
#define RPC_VERSION 2
enum rpc_auth_flavor {
RPC_AUTH_NULL = 0,
RPC_AUTH_UNIX = 1,
RPC_AUTH_SHORT = 2,
RPC_AUTH_DES = 3,
RPC_AUTH_KRB = 4,
};
enum rpc_msg_type {
RPC_CALL = 0,
RPC_REPLY = 1
};
enum rpc_reply_stat {
RPC_MSG_ACCEPTED = 0,
RPC_MSG_DENIED = 1
};
enum rpc_accept_stat {
RPC_SUCCESS = 0,
RPC_PROG_UNAVAIL = 1,
RPC_PROG_MISMATCH = 2,
RPC_PROC_UNAVAIL = 3,
RPC_GARBAGE_ARGS = 4,
RPC_SYSTEM_ERR = 5
};
enum rpc_reject_stat {
RPC_MISMATCH = 0,
RPC_AUTH_ERROR = 1
};
enum rpc_auth_stat {
RPC_AUTH_OK = 0,
RPC_AUTH_BADCRED = 1,
RPC_AUTH_REJECTEDCRED = 2,
RPC_AUTH_BADVERF = 3,
RPC_AUTH_REJECTEDVERF = 4,
RPC_AUTH_TOOWEAK = 5
};
#define RPC_PMAP_PROGRAM 100000
#define RPC_PMAP_VERSION 2
#define RPC_PMAP_PORT 111
#define RPC_MAXNETNAMELEN 256
#endif /* __KERNEL__ */
#endif /* _LINUX_SUNRPC_MSGPROT_H_ */
|
#ifndef UNITTEST_TIMEHELPERS_H
#define UNITTEST_TIMEHELPERS_H
#include "../Config.h"
#include "../HelperMacros.h"
#ifdef UNITTEST_MINGW
#ifndef __int64
#define __int64 long long
#endif
#endif
namespace UnitTest {
class UNITTEST_LINKAGE Timer
{
public:
Timer();
void Start();
double GetTimeInMs() const;
private:
__int64 GetTime() const;
void* m_threadHandle;
#if defined(_WIN64)
unsigned __int64 m_processAffinityMask;
#else
unsigned long m_processAffinityMask;
#endif
__int64 m_startTime;
__int64 m_frequency;
};
namespace TimeHelpers
{
UNITTEST_LINKAGE void SleepMs(int ms);
}
}
#endif
|
// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2013-2017 Oracle Corporation
* This file is based on ast_ttm.c
* Copyright 2012 Red Hat Inc.
* Authors: Dave Airlie <airlied@redhat.com>
* Michael Thayer <michael.thayer@oracle.com>
*/
#include <linux/pci.h>
#include <drm/drm_file.h>
#include "vbox_drv.h"
int vbox_mm_init(struct vbox_private *vbox)
{
struct drm_vram_mm *vmm;
int ret;
struct drm_device *dev = &vbox->ddev;
vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(dev->pdev, 0),
vbox->available_vram_size,
&drm_gem_vram_mm_funcs);
if (IS_ERR(vmm)) {
ret = PTR_ERR(vmm);
DRM_ERROR("Error initializing VRAM MM; %d\n", ret);
return ret;
}
#ifdef DRM_MTRR_WC
vbox->fb_mtrr = drm_mtrr_add(pci_resource_start(dev->pdev, 0),
pci_resource_len(dev->pdev, 0),
DRM_MTRR_WC);
#else
vbox->fb_mtrr = arch_phys_wc_add(pci_resource_start(dev->pdev, 0),
pci_resource_len(dev->pdev, 0));
#endif
return 0;
}
void vbox_mm_fini(struct vbox_private *vbox)
{
#ifdef DRM_MTRR_WC
drm_mtrr_del(vbox->fb_mtrr,
pci_resource_start(vbox->ddev.pdev, 0),
pci_resource_len(vbox->ddev.pdev, 0), DRM_MTRR_WC);
#else
arch_phys_wc_del(vbox->fb_mtrr);
#endif
drm_vram_helper_release_mm(&vbox->ddev);
}
|
// SPDX-License-Identifier: GPL-2.0
/*
* Precise Delay Loops for S390
*
* Copyright IBM Corp. 1999, 2008
* Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>,
* Heiko Carstens <heiko.carstens@de.ibm.com>,
*/
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/timex.h>
#include <linux/export.h>
#include <linux/irqflags.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <asm/vtimer.h>
#include <asm/div64.h>
#include <asm/idle.h>
void __delay(unsigned long loops)
{
/*
* To end the bloody studid and useless discussion about the
* BogoMips number I took the liberty to define the __delay
* function in a way that that resulting BogoMips number will
* yield the megahertz number of the cpu. The important function
* is udelay and that is done using the tod clock. -- martin.
*/
asm volatile("0: brct %0,0b" : : "d" ((loops/2) + 1));
}
EXPORT_SYMBOL(__delay);
static void __udelay_disabled(unsigned long long usecs)
{
unsigned long cr0, cr0_new, psw_mask;
struct s390_idle_data idle;
u64 end;
end = get_tod_clock() + (usecs << 12);
__ctl_store(cr0, 0, 0);
cr0_new = cr0 & ~CR0_IRQ_SUBCLASS_MASK;
cr0_new |= (1UL << (63 - 52)); /* enable clock comparator irq */
__ctl_load(cr0_new, 0, 0);
psw_mask = __extract_psw() | PSW_MASK_EXT | PSW_MASK_WAIT;
set_clock_comparator(end);
set_cpu_flag(CIF_IGNORE_IRQ);
psw_idle(&idle, psw_mask);
clear_cpu_flag(CIF_IGNORE_IRQ);
set_clock_comparator(S390_lowcore.clock_comparator);
__ctl_load(cr0, 0, 0);
}
static void __udelay_enabled(unsigned long long usecs)
{
u64 clock_saved, end;
end = get_tod_clock_fast() + (usecs << 12);
do {
clock_saved = 0;
if (tod_after(S390_lowcore.clock_comparator, end)) {
clock_saved = local_tick_disable();
set_clock_comparator(end);
}
enabled_wait();
if (clock_saved)
local_tick_enable(clock_saved);
} while (get_tod_clock_fast() < end);
}
/*
* Waits for 'usecs' microseconds using the TOD clock comparator.
*/
void __udelay(unsigned long long usecs)
{
unsigned long flags;
preempt_disable();
local_irq_save(flags);
if (in_irq()) {
__udelay_disabled(usecs);
goto out;
}
if (in_softirq()) {
if (raw_irqs_disabled_flags(flags))
__udelay_disabled(usecs);
else
__udelay_enabled(usecs);
goto out;
}
if (raw_irqs_disabled_flags(flags)) {
local_bh_disable();
__udelay_disabled(usecs);
_local_bh_enable();
goto out;
}
__udelay_enabled(usecs);
out:
local_irq_restore(flags);
preempt_enable();
}
EXPORT_SYMBOL(__udelay);
/*
* Simple udelay variant. To be used on startup and reboot
* when the interrupt handler isn't working.
*/
void udelay_simple(unsigned long long usecs)
{
u64 end;
end = get_tod_clock_fast() + (usecs << 12);
while (get_tod_clock_fast() < end)
cpu_relax();
}
void __ndelay(unsigned long long nsecs)
{
u64 end;
nsecs <<= 9;
do_div(nsecs, 125);
end = get_tod_clock_fast() + nsecs;
if (nsecs & ~0xfffUL)
__udelay(nsecs >> 12);
while (get_tod_clock_fast() < end)
barrier();
}
EXPORT_SYMBOL(__ndelay);
|
// SPDX-License-Identifier: GPL-2.0
/* Copyright (C) 2010-2019 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*/
#include "log.h"
#include "main.h"
#include <linux/compiler.h>
#include <linux/debugfs.h>
#include <linux/errno.h>
#include <linux/eventpoll.h>
#include <linux/export.h>
#include <linux/fcntl.h>
#include <linux/fs.h>
#include <linux/gfp.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/poll.h>
#include <linux/sched.h> /* for linux/wait.h */
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/stddef.h>
#include <linux/types.h>
#include <linux/uaccess.h>
#include <linux/wait.h>
#include <stdarg.h>
#include "debugfs.h"
#include "trace.h"
#ifdef CONFIG_BATMAN_ADV_DEBUGFS
#define BATADV_LOG_BUFF_MASK (batadv_log_buff_len - 1)
static const int batadv_log_buff_len = BATADV_LOG_BUF_LEN;
static char *batadv_log_char_addr(struct batadv_priv_debug_log *debug_log,
size_t idx)
{
return &debug_log->log_buff[idx & BATADV_LOG_BUFF_MASK];
}
static void batadv_emit_log_char(struct batadv_priv_debug_log *debug_log,
char c)
{
char *char_addr;
char_addr = batadv_log_char_addr(debug_log, debug_log->log_end);
*char_addr = c;
debug_log->log_end++;
if (debug_log->log_end - debug_log->log_start > batadv_log_buff_len)
debug_log->log_start = debug_log->log_end - batadv_log_buff_len;
}
__printf(2, 3)
static int batadv_fdebug_log(struct batadv_priv_debug_log *debug_log,
const char *fmt, ...)
{
va_list args;
static char debug_log_buf[256];
char *p;
if (!debug_log)
return 0;
spin_lock_bh(&debug_log->lock);
va_start(args, fmt);
vscnprintf(debug_log_buf, sizeof(debug_log_buf), fmt, args);
va_end(args);
for (p = debug_log_buf; *p != 0; p++)
batadv_emit_log_char(debug_log, *p);
spin_unlock_bh(&debug_log->lock);
wake_up(&debug_log->queue_wait);
return 0;
}
static int batadv_log_open(struct inode *inode, struct file *file)
{
if (!try_module_get(THIS_MODULE))
return -EBUSY;
batadv_debugfs_deprecated(file,
"Use tracepoint batadv:batadv_dbg instead\n");
stream_open(inode, file);
file->private_data = inode->i_private;
return 0;
}
static int batadv_log_release(struct inode *inode, struct file *file)
{
module_put(THIS_MODULE);
return 0;
}
static bool batadv_log_empty(struct batadv_priv_debug_log *debug_log)
{
return !(debug_log->log_start - debug_log->log_end);
}
static ssize_t batadv_log_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct batadv_priv *bat_priv = file->private_data;
struct batadv_priv_debug_log *debug_log = bat_priv->debug_log;
int error, i = 0;
char *char_addr;
char c;
if ((file->f_flags & O_NONBLOCK) && batadv_log_empty(debug_log))
return -EAGAIN;
if (!buf)
return -EINVAL;
if (count == 0)
return 0;
if (!access_ok(buf, count))
return -EFAULT;
error = wait_event_interruptible(debug_log->queue_wait,
(!batadv_log_empty(debug_log)));
if (error)
return error;
spin_lock_bh(&debug_log->lock);
while ((!error) && (i < count) &&
(debug_log->log_start != debug_log->log_end)) {
char_addr = batadv_log_char_addr(debug_log,
debug_log->log_start);
c = *char_addr;
debug_log->log_start++;
spin_unlock_bh(&debug_log->lock);
error = __put_user(c, buf);
spin_lock_bh(&debug_log->lock);
buf++;
i++;
}
spin_unlock_bh(&debug_log->lock);
if (!error)
return i;
return error;
}
static __poll_t batadv_log_poll(struct file *file, poll_table *wait)
{
struct batadv_priv *bat_priv = file->private_data;
struct batadv_priv_debug_log *debug_log = bat_priv->debug_log;
poll_wait(file, &debug_log->queue_wait, wait);
if (!batadv_log_empty(debug_log))
return EPOLLIN | EPOLLRDNORM;
return 0;
}
static const struct file_operations batadv_log_fops = {
.open = batadv_log_open,
.release = batadv_log_release,
.read = batadv_log_read,
.poll = batadv_log_poll,
.llseek = no_llseek,
};
/**
* batadv_debug_log_setup() - Initialize debug log
* @bat_priv: the bat priv with all the soft interface information
*
* Return: 0 on success or negative error number in case of failure
*/
int batadv_debug_log_setup(struct batadv_priv *bat_priv)
{
bat_priv->debug_log = kzalloc(sizeof(*bat_priv->debug_log), GFP_ATOMIC);
if (!bat_priv->debug_log)
return -ENOMEM;
spin_lock_init(&bat_priv->debug_log->lock);
init_waitqueue_head(&bat_priv->debug_log->queue_wait);
debugfs_create_file("log", 0400, bat_priv->debug_dir, bat_priv,
&batadv_log_fops);
return 0;
}
/**
* batadv_debug_log_cleanup() - Destroy debug log
* @bat_priv: the bat priv with all the soft interface information
*/
void batadv_debug_log_cleanup(struct batadv_priv *bat_priv)
{
kfree(bat_priv->debug_log);
bat_priv->debug_log = NULL;
}
#endif /* CONFIG_BATMAN_ADV_DEBUGFS */
/**
* batadv_debug_log() - Add debug log entry
* @bat_priv: the bat priv with all the soft interface information
* @fmt: format string
*
* Return: 0 on success or negative error number in case of failure
*/
int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...)
{
struct va_format vaf;
va_list args;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
#ifdef CONFIG_BATMAN_ADV_DEBUGFS
batadv_fdebug_log(bat_priv->debug_log, "[%10u] %pV",
jiffies_to_msecs(jiffies), &vaf);
#endif
trace_batadv_dbg(bat_priv, &vaf);
va_end(args);
return 0;
}
|
/*
* Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
#ifndef __MXC_DISPDRV_H__
#define __MXC_DISPDRV_H__
#include <linux/fb.h>
struct mxc_dispdrv_handle {
struct mxc_dispdrv_driver *drv;
};
struct mxc_dispdrv_setting {
/*input-feedback parameter*/
struct fb_info *fbi;
int if_fmt;
int default_bpp;
char *dft_mode_str;
/*feedback parameter*/
int dev_id;
int disp_id;
};
struct mxc_dispdrv_driver {
const char *name;
int (*init) (struct mxc_dispdrv_handle *, struct mxc_dispdrv_setting *);
void (*deinit) (struct mxc_dispdrv_handle *);
/* display driver enable function for extension */
int (*enable) (struct mxc_dispdrv_handle *);
/* display driver disable function, called at early part of fb_blank */
void (*disable) (struct mxc_dispdrv_handle *);
/* display driver setup function, called at early part of fb_set_par */
int (*setup) (struct mxc_dispdrv_handle *, struct fb_info *fbi);
};
struct mxc_dispdrv_handle *mxc_dispdrv_register(struct mxc_dispdrv_driver *drv);
int mxc_dispdrv_unregister(struct mxc_dispdrv_handle *handle);
struct mxc_dispdrv_handle *mxc_dispdrv_gethandle(char *name,
struct mxc_dispdrv_setting *setting);
void mxc_dispdrv_puthandle(struct mxc_dispdrv_handle *handle);
int mxc_dispdrv_setdata(struct mxc_dispdrv_handle *handle, void *data);
void *mxc_dispdrv_getdata(struct mxc_dispdrv_handle *handle);
#endif
|
#ifndef MFD_TMIO_H
#define MFD_TMIO_H
#include <linux/fb.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#define tmio_ioread8(addr) readb(addr)
#define tmio_ioread16(addr) readw(addr)
#define tmio_ioread16_rep(r, b, l) readsw(r, b, l)
#define tmio_ioread32(addr) \
(((u32) readw((addr))) | (((u32) readw((addr) + 2)) << 16))
#define tmio_iowrite8(val, addr) writeb((val), (addr))
#define tmio_iowrite16(val, addr) writew((val), (addr))
#define tmio_iowrite16_rep(r, b, l) writesw(r, b, l)
#define tmio_iowrite32(val, addr) \
do { \
writew((val), (addr)); \
writew((val) >> 16, (addr) + 2); \
} while (0)
#define CNF_CMD 0x04
#define CNF_CTL_BASE 0x10
#define CNF_INT_PIN 0x3d
#define CNF_STOP_CLK_CTL 0x40
#define CNF_GCLK_CTL 0x41
#define CNF_SD_CLK_MODE 0x42
#define CNF_PIN_STATUS 0x44
#define CNF_PWR_CTL_1 0x48
#define CNF_PWR_CTL_2 0x49
#define CNF_PWR_CTL_3 0x4a
#define CNF_CARD_DETECT_MODE 0x4c
#define CNF_SD_SLOT 0x50
#define CNF_EXT_GCLK_CTL_1 0xf0
#define CNF_EXT_GCLK_CTL_2 0xf1
#define CNF_EXT_GCLK_CTL_3 0xf9
#define CNF_SD_LED_EN_1 0xfa
#define CNF_SD_LED_EN_2 0xfe
#define SDCREN 0x2 /* Enable access to MMC CTL regs. (flag in COMMAND_REG)*/
#define sd_config_write8(base, shift, reg, val) \
tmio_iowrite8((val), (base) + ((reg) << (shift)))
#define sd_config_write16(base, shift, reg, val) \
tmio_iowrite16((val), (base) + ((reg) << (shift)))
#define sd_config_write32(base, shift, reg, val) \
do { \
tmio_iowrite16((val), (base) + ((reg) << (shift))); \
tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \
} while (0)
int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
/*
* data for the MMC controller
*/
struct tmio_mmc_data {
unsigned int hclk;
unsigned long capabilities;
void (*set_pwr)(struct platform_device *host, int state);
void (*set_clk_div)(struct platform_device *host, int state);
};
/*
* data for the NAND controller
*/
struct tmio_nand_data {
struct nand_bbt_descr *badblock_pattern;
struct mtd_partition *partition;
unsigned int num_partitions;
};
#define FBIO_TMIO_ACC_WRITE 0x7C639300
#define FBIO_TMIO_ACC_SYNC 0x7C639301
struct tmio_fb_data {
int (*lcd_set_power)(struct platform_device *fb_dev,
bool on);
int (*lcd_mode)(struct platform_device *fb_dev,
const struct fb_videomode *mode);
int num_modes;
struct fb_videomode *modes;
/* in mm: size of screen */
int height;
int width;
};
#endif
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
/***************************************************************************/
/* */
/* qgrayraster_p.h, derived from ftgrays.h */
/* */
/* FreeType smooth renderer declaration */
/* */
/* Copyright 1996-2001 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, ../../3rdparty/freetype/docs/FTL.TXT. By continuing to use, */
/* modify, or distribute this file you indicate that you have read */
/* the license and understand and accept it fully. */
/***************************************************************************/
#ifndef __FTGRAYS_H__
#define __FTGRAYS_H__
/*
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <private/qrasterdefs_p.h>
/*************************************************************************/
/* */
/* To make ftgrays.h independent from configuration files we check */
/* whether QT_FT_EXPORT_VAR has been defined already. */
/* */
/* On some systems and compilers (Win32 mostly), an extra keyword is */
/* necessary to compile the library as a DLL. */
/* */
#ifndef QT_FT_EXPORT_VAR
#define QT_FT_EXPORT_VAR( x ) extern x
#endif
/* Minimum buffer size for raster object, that accounts
for TWorker and TCell sizes.*/
#define MINIMUM_POOL_SIZE 8192
QT_FT_EXPORT_VAR( const QT_FT_Raster_Funcs ) qt_ft_grays_raster;
#ifdef __cplusplus
}
#endif
#endif /* __FTGRAYS_H__ */
/* END */
|
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_LIB_GTL_PRIORITY_QUEUE_UTIL_H_
#define TENSORFLOW_CORE_LIB_GTL_PRIORITY_QUEUE_UTIL_H_
#include <algorithm>
#include <queue>
#include <utility>
namespace tensorflow {
namespace gtl {
// Removes the top element from a std::priority_queue and returns it.
// Supports movable types.
template <typename T, typename Container, typename Comparator>
T ConsumeTop(std::priority_queue<T, Container, Comparator>* q) {
// std::priority_queue is required to implement pop() as if it
// called:
// std::pop_heap()
// c.pop_back()
// unfortunately, it does not provide access to the removed element.
// If the element is move only (such as a unique_ptr), there is no way to
// reclaim it in the standard API. std::priority_queue does, however, expose
// the underlying container as a protected member, so we use that access
// to extract the desired element between those two calls.
using Q = std::priority_queue<T, Container, Comparator>;
struct Expose : Q {
using Q::c;
using Q::comp;
};
auto& c = q->*&Expose::c;
auto& comp = q->*&Expose::comp;
std::pop_heap(c.begin(), c.end(), comp);
auto r = std::move(c.back());
c.pop_back();
return r;
}
} // namespace gtl
} // namespace tensorflow
#endif // TENSORFLOW_CORE_LIB_GTL_PRIORITY_QUEUE_UTIL_H_
|
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
* Copyright (C) 2000 by Colin Ngam
*/
#ifndef _ASM_SN_LAUNCH_H
#define _ASM_SN_LAUNCH_H
#include <linux/config.h>
#include <asm/sn/types.h>
#include <asm/sn/addrs.h>
/*
* The launch data structure resides at a fixed place in each node's memory
* and is used to communicate between the master processor and the slave
* processors.
*
* The master stores launch parameters in the launch structure
* corresponding to a target processor that is in a slave loop, then sends
* an interrupt to the slave processor. The slave calls the desired
* function, then returns to the slave loop. The master may poll or wait
* for the slaves to finish.
*
* There is an array of launch structures, one per CPU on the node. One
* interrupt level is used per local CPU.
*/
#define LAUNCH_MAGIC 0xaddbead2addbead3
#ifdef CONFIG_SGI_IP27
#define LAUNCH_SIZEOF 0x100
#define LAUNCH_PADSZ 0xa0
#endif
#define LAUNCH_OFF_MAGIC 0x00 /* Struct offsets for assembly */
#define LAUNCH_OFF_BUSY 0x08
#define LAUNCH_OFF_CALL 0x10
#define LAUNCH_OFF_CALLC 0x18
#define LAUNCH_OFF_CALLPARM 0x20
#define LAUNCH_OFF_STACK 0x28
#define LAUNCH_OFF_GP 0x30
#define LAUNCH_OFF_BEVUTLB 0x38
#define LAUNCH_OFF_BEVNORMAL 0x40
#define LAUNCH_OFF_BEVECC 0x48
#define LAUNCH_STATE_DONE 0 /* Return value of LAUNCH_POLL */
#define LAUNCH_STATE_SENT 1
#define LAUNCH_STATE_RECD 2
/*
* The launch routine is called only if the complement address is correct.
*
* Before control is transferred to a routine, the complement address
* is zeroed (invalidated) to prevent an accidental call from a spurious
* interrupt.
*
* The slave_launch routine turns on the BUSY flag, and the slave loop
* clears the BUSY flag after control is returned to it.
*/
#ifndef __ASSEMBLY__
typedef int launch_state_t;
typedef void (*launch_proc_t)(u64 call_parm);
typedef struct launch_s {
volatile u64 magic; /* Magic number */
volatile u64 busy; /* Slave currently active */
volatile launch_proc_t call_addr; /* Func. for slave to call */
volatile u64 call_addr_c; /* 1's complement of call_addr*/
volatile u64 call_parm; /* Single parm passed to call*/
volatile void *stack_addr; /* Stack pointer for slave function */
volatile void *gp_addr; /* Global pointer for slave func. */
volatile char *bevutlb;/* Address of bev utlb ex handler */
volatile char *bevnormal;/*Address of bev normal ex handler */
volatile char *bevecc;/* Address of bev cache err handler */
volatile char pad[160]; /* Pad to LAUNCH_SIZEOF */
} launch_t;
/*
* PROM entry points for launch routines are determined by IPxxprom/start.s
*/
#define LAUNCH_SLAVE (*(void (*)(int nasid, int cpu, \
launch_proc_t call_addr, \
u64 call_parm, \
void *stack_addr, \
void *gp_addr)) \
IP27PROM_LAUNCHSLAVE)
#define LAUNCH_WAIT (*(void (*)(int nasid, int cpu, int timeout_msec)) \
IP27PROM_WAITSLAVE)
#define LAUNCH_POLL (*(launch_state_t (*)(int nasid, int cpu)) \
IP27PROM_POLLSLAVE)
#define LAUNCH_LOOP (*(void (*)(void)) \
IP27PROM_SLAVELOOP)
#define LAUNCH_FLASH (*(void (*)(void)) \
IP27PROM_FLASHLEDS)
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_SN_LAUNCH_H */
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef TOOLS_GN_INPUT_FILE_MANAGER_H_
#define TOOLS_GN_INPUT_FILE_MANAGER_H_
#include <set>
#include <utility>
#include <vector>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "tools/gn/build_settings.h"
#include "tools/gn/input_file.h"
#include "tools/gn/parse_tree.h"
#include "tools/gn/settings.h"
class Err;
class LocationRange;
class ParseNode;
class Token;
// Manages loading and parsing files from disk. This doesn't actually have
// any context for executing the results, so potentially multiple configs
// could use the same input file (saving parsing).
//
// This class is threadsafe.
//
// InputFile objects must never be deleted while the program is running since
// various state points into them.
class InputFileManager : public base::RefCountedThreadSafe<InputFileManager> {
public:
// Callback issued when a file is laoded. On auccess, the parse node will
// refer to the root block of the file. On failure, this will be NULL.
typedef base::Callback<void(const ParseNode*)> FileLoadCallback;
InputFileManager();
// Loads the given file and executes the callback on the worker pool.
//
// There are two types of errors. For errors known synchronously, the error
// will be set, it will return false, and no work will be scheduled.
//
// For parse errors and such that happen in the future, the error will be
// logged to the scheduler and the callback will be invoked with a null
// ParseNode pointer. The given |origin| will be blamed for the invocation.
bool AsyncLoadFile(const LocationRange& origin,
const BuildSettings* build_settings,
const SourceFile& file_name,
const FileLoadCallback& callback,
Err* err);
// Loads and parses the given file synchronously, returning the root block
// corresponding to the parsed result. On error, return NULL and the given
// Err is set.
const ParseNode* SyncLoadFile(const LocationRange& origin,
const BuildSettings* build_settings,
const SourceFile& file_name,
Err* err);
int GetInputFileCount() const;
// Fills the vector with all input files.
void GetAllPhysicalInputFileNames(std::vector<base::FilePath>* result) const;
private:
friend class base::RefCountedThreadSafe<InputFileManager>;
struct InputFileData {
InputFileData(const SourceFile& file_name);
~InputFileData();
// Don't touch this outside the lock until it's marked loaded.
InputFile file;
bool loaded;
bool sync_invocation;
// Lists all invocations that need to be executed when the file completes
// loading.
std::vector<FileLoadCallback> scheduled_callbacks;
// Event to signal when the load is complete (or fails). This is lazily
// created only when a thread is synchronously waiting for this load (which
// only happens for imports).
scoped_ptr<base::WaitableEvent> completion_event;
std::vector<Token> tokens;
// Null before the file is loaded or if loading failed.
scoped_ptr<ParseNode> parsed_root;
};
virtual ~InputFileManager();
void BackgroundLoadFile(const LocationRange& origin,
const BuildSettings* build_settings,
const SourceFile& name,
InputFile* file);
// Loads the given file. On error, sets the Err and return false.
bool LoadFile(const LocationRange& origin,
const BuildSettings* build_settings,
const SourceFile& name,
InputFile* file,
Err* err);
mutable base::Lock lock_;
// Maps repo-relative filenames to the corresponding owned pointer.
typedef base::hash_map<SourceFile, InputFileData*> InputFileMap;
InputFileMap input_files_;
DISALLOW_COPY_AND_ASSIGN(InputFileManager);
};
#endif // TOOLS_GN_INPUT_FILE_MANAGER_H_
|
/* s_nexttoward.c
* Special i387 version
* Conversion from s_nextafter.c by Ulrich Drepper, Cygnus Support,
* drepper@cygnus.com.
*/
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if defined(LIBM_SCCS) && !defined(lint)
static char rcsid[] = "$NetBSD: $";
#endif
/* IEEE functions
* nexttoward(x,y)
* return the next machine floating-point number of x in the
* direction toward y.
* Special cases:
*/
#include <math.h>
#include <math_private.h>
#include <float.h>
double __nexttoward(double x, long double y)
{
int32_t hx,ix,iy;
u_int32_t lx,hy,ly,esy;
EXTRACT_WORDS(hx,lx,x);
GET_LDOUBLE_WORDS(esy,hy,ly,y);
ix = hx&0x7fffffff; /* |x| */
iy = esy&0x7fff; /* |y| */
/* Intel's extended format has the normally implicit 1 explicit
present. Sigh! */
if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || /* x is nan */
((iy>=0x7fff)&&((hy&0x7fffffff)|ly)!=0)) /* y is nan */
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
double u;
INSERT_WORDS(x,(esy&0x8000)<<16,1); /* return +-minsub */
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
return x;
}
if(hx>=0) { /* x > 0 */
if (x > y) { /* x -= ulp */
if(lx==0) hx -= 1;
lx -= 1;
} else { /* x < y, x += ulp */
lx += 1;
if(lx==0) hx += 1;
}
} else { /* x < 0 */
if (x < y) { /* x -= ulp */
if(lx==0) hx -= 1;
lx -= 1;
} else { /* x > y, x += ulp */
lx += 1;
if(lx==0) hx += 1;
}
}
hy = hx&0x7ff00000;
if(hy>=0x7ff00000) {
x = x+x; /* overflow */
if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1)
/* Force conversion to double. */
asm ("" : "+m"(x));
return x;
}
if(hy<0x00100000) {
double u = x*x; /* underflow */
math_force_eval (u); /* raise underflow flag */
}
INSERT_WORDS(x,hx,lx);
return x;
}
weak_alias (__nexttoward, nexttoward)
#ifdef NO_LONG_DOUBLE
strong_alias (__nexttoward, __nexttowardl)
weak_alias (__nexttoward, nexttowardl)
#endif
|
/**********************************************************************
*
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful but, except
* as otherwise stated in writing, without any warranty; without even the
* implied warranty of merchantability or fitness for a particular purpose.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Contact Information:
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
* Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
*
******************************************************************************/
#if !defined (__PDUMPDEFS_H__)
#define __PDUMPDEFS_H__
typedef enum _PDUMP_PIXEL_FORMAT_
{
PVRSRV_PDUMP_PIXEL_FORMAT_UNSUPPORTED = 0,
PVRSRV_PDUMP_PIXEL_FORMAT_RGB8 = 1,
PVRSRV_PDUMP_PIXEL_FORMAT_RGB332 = 2,
PVRSRV_PDUMP_PIXEL_FORMAT_KRGB555 = 3,
PVRSRV_PDUMP_PIXEL_FORMAT_RGB565 = 4,
PVRSRV_PDUMP_PIXEL_FORMAT_ARGB4444 = 5,
PVRSRV_PDUMP_PIXEL_FORMAT_ARGB1555 = 6,
PVRSRV_PDUMP_PIXEL_FORMAT_RGB888 = 7,
PVRSRV_PDUMP_PIXEL_FORMAT_ARGB8888 = 8,
PVRSRV_PDUMP_PIXEL_FORMAT_YUV8 = 9,
PVRSRV_PDUMP_PIXEL_FORMAT_AYUV4444 = 10,
PVRSRV_PDUMP_PIXEL_FORMAT_VY0UY1_8888 = 11,
PVRSRV_PDUMP_PIXEL_FORMAT_UY0VY1_8888 = 12,
PVRSRV_PDUMP_PIXEL_FORMAT_Y0UY1V_8888 = 13,
PVRSRV_PDUMP_PIXEL_FORMAT_Y0VY1U_8888 = 14,
PVRSRV_PDUMP_PIXEL_FORMAT_YUV888 = 15,
PVRSRV_PDUMP_PIXEL_FORMAT_UYVY10101010 = 16,
PVRSRV_PDUMP_PIXEL_FORMAT_VYAUYA8888 = 17,
PVRSRV_PDUMP_PIXEL_FORMAT_AYUV8888 = 18,
PVRSRV_PDUMP_PIXEL_FORMAT_AYUV2101010 = 19,
PVRSRV_PDUMP_PIXEL_FORMAT_YUV101010 = 20,
PVRSRV_PDUMP_PIXEL_FORMAT_PL12Y8 = 21,
PVRSRV_PDUMP_PIXEL_FORMAT_YUV_IMC2 = 22,
PVRSRV_PDUMP_PIXEL_FORMAT_YUV_YV12 = 23,
PVRSRV_PDUMP_PIXEL_FORMAT_YUV_PL8 = 24,
PVRSRV_PDUMP_PIXEL_FORMAT_YUV_PL12 = 25,
PVRSRV_PDUMP_PIXEL_FORMAT_422PL12YUV8 = 26,
PVRSRV_PDUMP_PIXEL_FORMAT_420PL12YUV8 = 27,
PVRSRV_PDUMP_PIXEL_FORMAT_PL12Y10 = 28,
PVRSRV_PDUMP_PIXEL_FORMAT_422PL12YUV10 = 29,
PVRSRV_PDUMP_PIXEL_FORMAT_420PL12YUV10 = 30,
PVRSRV_PDUMP_PIXEL_FORMAT_ABGR8888 = 31,
PVRSRV_PDUMP_PIXEL_FORMAT_BGRA8888 = 32,
PVRSRV_PDUMP_PIXEL_FORMAT_ARGB8332 = 33,
PVRSRV_PDUMP_PIXEL_FORMAT_RGB555 = 34,
PVRSRV_PDUMP_PIXEL_FORMAT_F16 = 35,
PVRSRV_PDUMP_PIXEL_FORMAT_F32 = 36,
PVRSRV_PDUMP_PIXEL_FORMAT_L16 = 37,
PVRSRV_PDUMP_PIXEL_FORMAT_L32 = 38,
PVRSRV_PDUMP_PIXEL_FORMAT_RGBA8888 = 39,
PVRSRV_PDUMP_PIXEL_FORMAT_ABGR4444 = 40,
PVRSRV_PDUMP_PIXEL_FORMAT_RGBA4444 = 41,
PVRSRV_PDUMP_PIXEL_FORMAT_BGRA4444 = 42,
PVRSRV_PDUMP_PIXEL_FORMAT_ABGR1555 = 43,
PVRSRV_PDUMP_PIXEL_FORMAT_RGBA5551 = 44,
PVRSRV_PDUMP_PIXEL_FORMAT_BGRA5551 = 45,
PVRSRV_PDUMP_PIXEL_FORMAT_BGR565 = 46,
PVRSRV_PDUMP_PIXEL_FORMAT_A8 = 47,
PVRSRV_PDUMP_PIXEL_FORMAT_FORCE_I32 = 0x7fffffff
} PDUMP_PIXEL_FORMAT;
typedef enum _PDUMP_MEM_FORMAT_
{
PVRSRV_PDUMP_MEM_FORMAT_STRIDE = 0,
PVRSRV_PDUMP_MEM_FORMAT_RESERVED = 1,
PVRSRV_PDUMP_MEM_FORMAT_TILED = 8,
PVRSRV_PDUMP_MEM_FORMAT_TWIDDLED = 9,
PVRSRV_PDUMP_MEM_FORMAT_HYBRID = 10,
PVRSRV_PDUMP_MEM_FORMAT_FORCE_I32 = 0x7fffffff
} PDUMP_MEM_FORMAT;
typedef enum _PDUMP_POLL_OPERATOR
{
PDUMP_POLL_OPERATOR_EQUAL = 0,
PDUMP_POLL_OPERATOR_LESS = 1,
PDUMP_POLL_OPERATOR_LESSEQUAL = 2,
PDUMP_POLL_OPERATOR_GREATER = 3,
PDUMP_POLL_OPERATOR_GREATEREQUAL = 4,
PDUMP_POLL_OPERATOR_NOTEQUAL = 5,
} PDUMP_POLL_OPERATOR;
#endif
|
/*
* boblight
* Copyright (C) Bob 2009
*
* boblight 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.
*
* boblight 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 "devicers232.h"
#ifndef DEVICEAMBIODER
#define DEVICEAMBIODER
class CDeviceAmbioder : public CDeviceRS232
{
public:
CDeviceAmbioder(CClientsHandler& clients);
bool SetPrecision(int max);
private:
int m_precision;
bool SetupDevice();
bool WriteOutput();
void CloseDevice();
~CDeviceAmbioder();
};
#endif //DEVICEAMBIODER
|
/**
* \file
* <!--
* This file is part of BeRTOS.
*
* Bertos is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* As a special exception, you may use this file as part of a free software
* library without restriction. Specifically, if other files instantiate
* templates or use macros or inline functions from this file, or you compile
* this file and link it with other files to produce an executable, this
* file does not by itself cause the resulting executable to be covered by
* the GNU General Public License. This exception does not however
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*
* Copyright 2003, 2004, 2005, 2006, 2008 Develer S.r.l. (http://www.develer.com/)
* Copyright 2000 Bernie Innocenti
* All Rights Reserved.
* -->
*
* \brief Keyboard hardware-specific definitions
*
*
* \author Francesco Sacchi <batt@develer.com>
* \author Stefano Fedrigo <a@develer.com>
*/
#ifndef HW_KBD_H
#define HW_KBD_H
#include "hw/kbd_map.h"
#include <cfg/macros.h>
#warning TODO:This is an example implementation, you must implement it!
#define K_RPT_MASK (K_UP | K_DOWN | K_OK | K_CANCEL)
#define KBD_HW_INIT \
do { \
/* Put here code to init hw */ \
} while (0)
EXTERN_C int emul_kbdReadCols(void);
/**
* Read the keyboard ports and return the mask of
* depressed keys.
*/
INLINE keymask_t kbd_readkeys(void)
{
/* Implement me! */
//Only for test remove when implement this function
return 0;
}
#endif /* HW_KBD_H */
|
/*
* arch/sh/mm/cache-shx3.c - SH-X3 optimized cache ops
*
* Copyright (C) 2010 Paul Mundt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/io.h>
#include <asm/cache.h>
#define CCR_CACHE_SNM 0x40000 /* Hardware-assisted synonym avoidance */
#define CCR_CACHE_IBE 0x1000000 /* ICBI broadcast */
void __init shx3_cache_init(void)
{
unsigned int ccr;
ccr = __raw_readl(SH_CCR);
/*
* If we've got cache aliases, resolve them in hardware.
*/
if (boot_cpu_data.dcache.n_aliases || boot_cpu_data.icache.n_aliases) {
ccr |= CCR_CACHE_SNM;
boot_cpu_data.icache.n_aliases = 0;
boot_cpu_data.dcache.n_aliases = 0;
pr_info("Enabling hardware synonym avoidance\n");
}
#ifdef CONFIG_SMP
/*
* Broadcast I-cache block invalidations by default.
*/
ccr |= CCR_CACHE_IBE;
#endif
writel_uncached(ccr, SH_CCR);
}
|
/*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
#include <stdlib.h>
#include <string.h>
#include "gsm610_priv.h"
/*
* 4.2 FIXED POINT IMPLEMENTATION OF THE RPE-LTP CODER
*/
void Gsm_Coder (
struct gsm_state * State,
word * s, /* [0..159] samples IN */
/*
* The RPE-LTD coder works on a frame by frame basis. The length of
* the frame is equal to 160 samples. Some computations are done
* once per frame to produce at the output of the coder the
* LARc[1..8] parameters which are the coded LAR coefficients and
* also to realize the inverse filtering operation for the entire
* frame (160 samples of signal d[0..159]). These parts produce at
* the output of the coder:
*/
word * LARc, /* [0..7] LAR coefficients OUT */
/*
* Procedure 4.2.11 to 4.2.18 are to be executed four times per
* frame. That means once for each sub-segment RPE-LTP analysis of
* 40 samples. These parts produce at the output of the coder:
*/
word * Nc, /* [0..3] LTP lag OUT */
word * bc, /* [0..3] coded LTP gain OUT */
word * Mc, /* [0..3] RPE grid selection OUT */
word * xmaxc,/* [0..3] Coded maximum amplitude OUT */
word * xMc /* [13*4] normalized RPE samples OUT */
)
{
int k;
word * dp = State->dp0 + 120; /* [ -120...-1 ] */
word * dpp = dp; /* [ 0...39 ] */
word so[160];
Gsm_Preprocess (State, s, so);
Gsm_LPC_Analysis (State, so, LARc);
Gsm_Short_Term_Analysis_Filter (State, LARc, so);
for (k = 0; k <= 3; k++, xMc += 13) {
Gsm_Long_Term_Predictor ( State,
so+k*40, /* d [0..39] IN */
dp, /* dp [-120..-1] IN */
State->e + 5, /* e [0..39] OUT */
dpp, /* dpp [0..39] OUT */
Nc++,
bc++);
Gsm_RPE_Encoding ( /*-S,-*/
State->e + 5, /* e ][0..39][ IN/OUT */
xmaxc++, Mc++, xMc );
/*
* Gsm_Update_of_reconstructed_short_time_residual_signal
* ( dpp, State->e + 5, dp );
*/
{ register int i;
for (i = 0; i <= 39; i++)
dp[ i ] = GSM_ADD( State->e[5 + i], dpp[i] );
}
dp += 40;
dpp += 40;
}
(void)memcpy( (char *)State->dp0, (char *)(State->dp0 + 160),
120 * sizeof(*State->dp0) );
}
|
/* -*- c++ -*- */
/*
* Copyright 2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_STREAM_TO_STREAMS_IMPL_H
#define INCLUDED_STREAM_TO_STREAMS_IMPL_H
#include <gnuradio/blocks/stream_to_streams.h>
namespace gr {
namespace blocks {
class BLOCKS_API stream_to_streams_impl : public stream_to_streams
{
public:
stream_to_streams_impl(size_t itemsize, size_t nstreams);
int work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
} /* namespace blocks */
} /* namespace gr */
#endif /* INCLUDED_STREAM_TO_STREAMS_IMPL_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 MOJO_PUBLIC_JS_BINDINGS_CONSTANTS_H_
#define MOJO_PUBLIC_JS_BINDINGS_CONSTANTS_H_
namespace mojo {
// JavaScript module names:
extern const char kBindingsModuleName[];
extern const char kBufferModuleName[];
extern const char kCodecModuleName[];
extern const char kConnectionModuleName[];
extern const char kConnectorModuleName[];
extern const char kUnicodeModuleName[];
extern const char kRouterModuleName[];
extern const char kValidatorModuleName[];
} // namespace mojo
#endif // MOJO_PUBLIC_JS_BINDINGS_CONSTANTS_H_
|
/* Test STT_GNU_IFUNC symbols without direct function call. */
#include "ifunc-sel.h"
int global __attribute__ ((visibility ("hidden"))) = -1;
static int
one (void)
{
return 1;
}
static int
minus_one (void)
{
return -1;
}
static int
zero (void)
{
return 0;
}
void * foo_ifunc (void) __asm__ ("foo");
__asm__(".type foo, %gnu_indirect_function");
void *
foo_ifunc (void)
{
return ifunc_sel (one, minus_one, zero);
}
void * foo_hidden_ifunc (void) __asm__ ("foo_hidden");
__asm__(".type foo_hidden, %gnu_indirect_function");
void *
foo_hidden_ifunc (void)
{
return ifunc_sel (minus_one, one, zero);
}
void * foo_protected_ifunc (void) __asm__ ("foo_protected");
__asm__(".type foo_protected, %gnu_indirect_function");
void *
foo_protected_ifunc (void)
{
return ifunc_sel (one, zero, minus_one);
}
/* Test hidden indirect function. */
__asm__(".hidden foo_hidden");
/* Test protected indirect function. */
__asm__(".protected foo_protected");
|
/****************************************************************************
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
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 _CC_CUSTOMCOMMAND_H_
#define _CC_CUSTOMCOMMAND_H_
#include "renderer/CCRenderCommand.h"
#include "renderer/CCRenderCommandPool.h"
NS_CC_BEGIN
class CustomCommand : public RenderCommand
{
public:
CustomCommand();
~CustomCommand();
public:
void init(float depth);
void execute();
inline bool isTranslucent() { return true; }
std::function<void()> func;
protected:
};
NS_CC_END
#endif //_CC_CUSTOMCOMMAND_H_
|
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PACKET_BURST_GENERATOR_H_
#define PACKET_BURST_GENERATOR_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <rte_mbuf.h>
#include <rte_ether.h>
#include <rte_arp.h>
#include <rte_ip.h>
#include <rte_udp.h>
#define IPV4_ADDR(a, b, c, d)(((a & 0xff) << 24) | ((b & 0xff) << 16) | \
((c & 0xff) << 8) | (d & 0xff))
#define PACKET_BURST_GEN_PKT_LEN 60
#define PACKET_BURST_GEN_PKT_LEN_128 128
void
initialize_eth_header(struct ether_hdr *eth_hdr, struct ether_addr *src_mac,
struct ether_addr *dst_mac, uint16_t ether_type,
uint8_t vlan_enabled, uint16_t van_id);
void
initialize_arp_header(struct arp_hdr *arp_hdr, struct ether_addr *src_mac,
struct ether_addr *dst_mac, uint32_t src_ip, uint32_t dst_ip,
uint32_t opcode);
uint16_t
initialize_udp_header(struct udp_hdr *udp_hdr, uint16_t src_port,
uint16_t dst_port, uint16_t pkt_data_len);
uint16_t
initialize_ipv6_header(struct ipv6_hdr *ip_hdr, uint8_t *src_addr,
uint8_t *dst_addr, uint16_t pkt_data_len);
uint16_t
initialize_ipv4_header(struct ipv4_hdr *ip_hdr, uint32_t src_addr,
uint32_t dst_addr, uint16_t pkt_data_len);
int
generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst,
uint8_t pkt_len, uint8_t nb_pkt_segs);
#ifdef __cplusplus
}
#endif
#endif /* PACKET_BURST_GENERATOR_H_ */
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd 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.
systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>.
***/
typedef struct Timer Timer;
#include "calendarspec.h"
typedef enum TimerState {
TIMER_DEAD,
TIMER_WAITING,
TIMER_RUNNING,
TIMER_ELAPSED,
TIMER_FAILED,
_TIMER_STATE_MAX,
_TIMER_STATE_INVALID = -1
} TimerState;
typedef enum TimerBase {
TIMER_ACTIVE,
TIMER_BOOT,
TIMER_STARTUP,
TIMER_UNIT_ACTIVE,
TIMER_UNIT_INACTIVE,
TIMER_CALENDAR,
_TIMER_BASE_MAX,
_TIMER_BASE_INVALID = -1
} TimerBase;
typedef struct TimerValue {
TimerBase base;
bool disabled;
usec_t value; /* only for monotonic events */
CalendarSpec *calendar_spec; /* only for calendar events */
usec_t next_elapse;
LIST_FIELDS(struct TimerValue, value);
} TimerValue;
typedef enum TimerResult {
TIMER_SUCCESS,
TIMER_FAILURE_RESOURCES,
_TIMER_RESULT_MAX,
_TIMER_RESULT_INVALID = -1
} TimerResult;
struct Timer {
Unit meta;
usec_t accuracy_usec;
LIST_HEAD(TimerValue, values);
usec_t next_elapse_realtime;
usec_t next_elapse_monotonic_or_boottime;
dual_timestamp last_trigger;
TimerState state, deserialized_state;
sd_event_source *monotonic_event_source;
sd_event_source *realtime_event_source;
TimerResult result;
bool persistent;
bool wake_system;
char *stamp_path;
};
void timer_free_values(Timer *t);
extern const UnitVTable timer_vtable;
const char *timer_state_to_string(TimerState i) _const_;
TimerState timer_state_from_string(const char *s) _pure_;
const char *timer_base_to_string(TimerBase i) _const_;
TimerBase timer_base_from_string(const char *s) _pure_;
const char* timer_result_to_string(TimerResult i) _const_;
TimerResult timer_result_from_string(const char *s) _pure_;
|
#ifndef _PPC_PAGE_H
#define _PPC_PAGE_H
#include <asm/asm-compat.h>
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
/*
* Subtle: this is an int (not an unsigned long) and so it
* gets extended to 64 bits the way want (i.e. with 1s). -- paulus
*/
#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
#ifdef __KERNEL__
/* This must match what is in arch/ppc/Makefile */
#define PAGE_OFFSET CONFIG_KERNEL_START
#define KERNELBASE PAGE_OFFSET
#define is_kernel_addr(x) ((x) >= PAGE_OFFSET)
#ifndef __ASSEMBLY__
/*
* The basic type of a PTE - 64 bits for those CPUs with > 32 bit
* physical addressing. For now this just the IBM PPC440.
*/
#ifdef CONFIG_PTE_64BIT
typedef unsigned long long pte_basic_t;
#define PTE_SHIFT (PAGE_SHIFT - 3) /* 512 ptes per page */
#define PTE_FMT "%16Lx"
#else
typedef unsigned long pte_basic_t;
#define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */
#define PTE_FMT "%.8lx"
#endif
/* align addr on a size boundary - adjust address up/down if needed */
#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1)))
#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1)))
/* align addr on a size boundary - adjust address up if needed */
#define _ALIGN(addr,size) _ALIGN_UP(addr,size)
/* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE)
#undef STRICT_MM_TYPECHECKS
#ifdef STRICT_MM_TYPECHECKS
/*
* These are used to make use of C type-checking..
*/
typedef struct { pte_basic_t pte; } pte_t;
typedef struct { unsigned long pmd; } pmd_t;
typedef struct { unsigned long pgd; } pgd_t;
typedef struct { unsigned long pgprot; } pgprot_t;
#define pte_val(x) ((x).pte)
#define pmd_val(x) ((x).pmd)
#define pgd_val(x) ((x).pgd)
#define pgprot_val(x) ((x).pgprot)
#define __pte(x) ((pte_t) { (x) } )
#define __pmd(x) ((pmd_t) { (x) } )
#define __pgd(x) ((pgd_t) { (x) } )
#define __pgprot(x) ((pgprot_t) { (x) } )
#else
/*
* .. while these make it easier on the compiler
*/
typedef pte_basic_t pte_t;
typedef unsigned long pmd_t;
typedef unsigned long pgd_t;
typedef unsigned long pgprot_t;
#define pte_val(x) (x)
#define pmd_val(x) (x)
#define pgd_val(x) (x)
#define pgprot_val(x) (x)
#define __pte(x) (x)
#define __pmd(x) (x)
#define __pgd(x) (x)
#define __pgprot(x) (x)
#endif
struct page;
extern void clear_pages(void *page, int order);
static inline void clear_page(void *page) { clear_pages(page, 0); }
extern void copy_page(void *to, void *from);
extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
extern void copy_user_page(void *to, void *from, unsigned long vaddr,
struct page *pg);
#ifndef CONFIG_APUS
#define PPC_MEMSTART 0
#define PPC_PGSTART 0
#define PPC_MEMOFFSET PAGE_OFFSET
#else
extern unsigned long ppc_memstart;
extern unsigned long ppc_pgstart;
extern unsigned long ppc_memoffset;
#define PPC_MEMSTART ppc_memstart
#define PPC_PGSTART ppc_pgstart
#define PPC_MEMOFFSET ppc_memoffset
#endif
#if defined(CONFIG_APUS) && !defined(MODULE)
/* map phys->virtual and virtual->phys for RAM pages */
static inline unsigned long ___pa(unsigned long v)
{
unsigned long p;
asm volatile ("1: addis %0, %1, %2;"
".section \".vtop_fixup\",\"aw\";"
".align 1;"
".long 1b;"
".previous;"
: "=r" (p)
: "b" (v), "K" (((-PAGE_OFFSET) >> 16) & 0xffff));
return p;
}
static inline void* ___va(unsigned long p)
{
unsigned long v;
asm volatile ("1: addis %0, %1, %2;"
".section \".ptov_fixup\",\"aw\";"
".align 1;"
".long 1b;"
".previous;"
: "=r" (v)
: "b" (p), "K" (((PAGE_OFFSET) >> 16) & 0xffff));
return (void*) v;
}
#else
#define ___pa(vaddr) ((vaddr)-PPC_MEMOFFSET)
#define ___va(paddr) ((paddr)+PPC_MEMOFFSET)
#endif
extern int page_is_ram(unsigned long pfn);
#define __pa(x) ___pa((unsigned long)(x))
#define __va(x) ((void *)(___va((unsigned long)(x))))
#define ARCH_PFN_OFFSET (PPC_PGSTART)
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
#define pfn_valid(pfn) (((pfn) - PPC_PGSTART) < max_mapnr)
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
/* Pure 2^n version of get_order */
extern __inline__ int get_order(unsigned long size)
{
int lz;
size = (size-1) >> PAGE_SHIFT;
asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size));
return 32 - lz;
}
#endif /* __ASSEMBLY__ */
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
/* We do define AT_SYSINFO_EHDR but don't use the gate mechanism */
#define __HAVE_ARCH_GATE_AREA 1
#include <asm-generic/memory_model.h>
#endif /* __KERNEL__ */
#endif /* _PPC_PAGE_H */
|
/*===---- clflushoptintrin.h - CLFLUSHOPT intrinsic ------------------------===
*
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
* See https://llvm.org/LICENSE.txt for license information.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*
*===-----------------------------------------------------------------------===
*/
#ifndef __IMMINTRIN_H
#error "Never use <clflushoptintrin.h> directly; include <immintrin.h> instead."
#endif
#ifndef __CLFLUSHOPTINTRIN_H
#define __CLFLUSHOPTINTRIN_H
/* Define the default attributes for the functions in this file. */
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("clflushopt")))
static __inline__ void __DEFAULT_FN_ATTRS
_mm_clflushopt(void const * __m) {
__builtin_ia32_clflushopt(__m);
}
#undef __DEFAULT_FN_ATTRS
#endif
|
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
MiNT audio driver
Patrice Mandin
*/
#ifndef _SDL_mintaudio_h
#define _SDL_mintaudio_h
#include "../SDL_sysaudio.h"
#include "SDL_mintaudio_stfa.h"
/* Hidden "this" pointer for the audio functions */
#define _THIS SDL_AudioDevice *this
/* 16 predivisors with 3 clocks max. */
#define MINTAUDIO_maxfreqs (16*3)
typedef struct {
Uint32 frequency;
Uint32 masterclock;
Uint32 predivisor;
int gpio_bits; /* in case of external clock */
} mint_frequency_t;
struct SDL_PrivateAudioData {
mint_frequency_t frequencies[MINTAUDIO_maxfreqs];
int freq_count; /* Number of frequencies in the array */
int numfreq; /* Number of selected frequency */
};
/* Old variable names */
#define MINTAUDIO_frequencies (this->hidden->frequencies)
#define MINTAUDIO_freqcount (this->hidden->freq_count)
#define MINTAUDIO_numfreq (this->hidden->numfreq)
/* _MCH cookie (values>>16) */
enum {
MCH_ST=0,
MCH_STE,
MCH_TT,
MCH_F30,
MCH_CLONE,
MCH_ARANYM
};
/* Master clocks for replay frequencies */
#define MASTERCLOCK_STE 8010666 /* Not sure of this one */
#define MASTERCLOCK_TT 16107953 /* Not sure of this one */
#define MASTERCLOCK_FALCON1 25175000
#define MASTERCLOCK_FALCON2 32000000 /* Only usable for DSP56K */
#define MASTERCLOCK_FALCONEXT -1 /* Clock on DSP56K port, unknown */
#define MASTERCLOCK_44K 22579200 /* Standard clock for 44.1 Khz */
#define MASTERCLOCK_48K 24576000 /* Standard clock for 48 Khz */
/* Master clock predivisors */
#define MASTERPREDIV_STE 160
#define MASTERPREDIV_TT 320
#define MASTERPREDIV_FALCON 256
#define MASTERPREDIV_MILAN 256
/* MFP 68901 interrupt sources */
#ifndef MFP_PARALLEL
enum {
MFP_PARALLEL=0,
MFP_DCD,
MFP_CTS,
MFP_BITBLT,
MFP_TIMERD,
MFP_BAUDRATE=MFP_TIMERD,
MFP_TIMERC,
MFP_200HZ=MFP_TIMERC,
MFP_ACIA,
MFP_DISK,
MFP_TIMERB,
MFP_HBLANK=MFP_TIMERB,
MFP_TERR,
MFP_TBE,
MFP_RERR,
MFP_RBF,
MFP_TIMERA,
MFP_DMASOUND=MFP_TIMERA,
MFP_RING,
MFP_MONODETECT
};
#endif
/* Xbtimer() timers */
#ifndef XB_TIMERA
enum {
XB_TIMERA=0,
XB_TIMERB,
XB_TIMERC,
XB_TIMERD
};
#endif
/* Variables */
extern SDL_AudioDevice *SDL_MintAudio_device;
extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */
extern unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */
extern volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
extern volatile unsigned short SDL_MintAudio_mutex;
extern cookie_stfa_t *SDL_MintAudio_stfa;
extern volatile unsigned long SDL_MintAudio_clocktics;
extern unsigned short SDL_MintAudio_hasfpu; /* To preserve fpu registers if needed */
/* MiNT thread variables */
extern SDL_bool SDL_MintAudio_mint_present;
extern SDL_bool SDL_MintAudio_quit_thread;
extern SDL_bool SDL_MintAudio_thread_finished;
extern long SDL_MintAudio_thread_pid;
/* Functions */
void SDL_MintAudio_Callback(void);
void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock,
Uint32 prediv, int gpio_bits);
int SDL_MintAudio_SearchFrequency(_THIS, int desired_freq);
void SDL_MintAudio_CheckFpu(void);
/* MiNT thread functions */
int SDL_MintAudio_Thread(long param);
void SDL_MintAudio_WaitThread(void);
/* ASM interrupt functions */
void SDL_MintAudio_GsxbInterrupt(void);
void SDL_MintAudio_EmptyGsxbInterrupt(void);
void SDL_MintAudio_XbiosInterruptMeasureClock(void);
void SDL_MintAudio_XbiosInterrupt(void);
void SDL_MintAudio_Dma8Interrupt(void);
void SDL_MintAudio_StfaInterrupt(void);
#endif /* _SDL_mintaudio_h */
|
/*
* Copyright 2010 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include "drmP.h"
#include "nouveau_drv.h"
#include "nouveau_hw.h"
#include "nouveau_gpio.h"
#include "nv50_display.h"
static int
nv50_gpio_location(int line, u32 *reg, u32 *shift)
{
const uint32_t nv50_gpio_reg[4] = { 0xe104, 0xe108, 0xe280, 0xe284 };
if (line >= 32)
return -EINVAL;
*reg = nv50_gpio_reg[line >> 3];
*shift = (line & 7) << 2;
return 0;
}
int
nv50_gpio_drive(struct drm_device *dev, int line, int dir, int out)
{
u32 reg, shift;
if (nv50_gpio_location(line, ®, &shift))
return -EINVAL;
nv_mask(dev, reg, 7 << shift, (((dir ^ 1) << 1) | out) << shift);
return 0;
}
int
nv50_gpio_sense(struct drm_device *dev, int line)
{
u32 reg, shift;
if (nv50_gpio_location(line, ®, &shift))
return -EINVAL;
return !!(nv_rd32(dev, reg) & (4 << shift));
}
void
nv50_gpio_irq_enable(struct drm_device *dev, int line, bool on)
{
u32 reg = line < 16 ? 0xe050 : 0xe070;
u32 mask = 0x00010001 << (line & 0xf);
nv_wr32(dev, reg + 4, mask);
nv_mask(dev, reg + 0, mask, on ? mask : 0);
}
int
nvd0_gpio_drive(struct drm_device *dev, int line, int dir, int out)
{
u32 data = ((dir ^ 1) << 13) | (out << 12);
nv_mask(dev, 0x00d610 + (line * 4), 0x00003000, data);
nv_mask(dev, 0x00d604, 0x00000001, 0x00000001); /* update? */
return 0;
}
int
nvd0_gpio_sense(struct drm_device *dev, int line)
{
return !!(nv_rd32(dev, 0x00d610 + (line * 4)) & 0x00004000);
}
static void
nv50_gpio_isr(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
u32 intr0, intr1 = 0;
u32 hi, lo;
intr0 = nv_rd32(dev, 0xe054) & nv_rd32(dev, 0xe050);
if (dev_priv->chipset >= 0x90)
intr1 = nv_rd32(dev, 0xe074) & nv_rd32(dev, 0xe070);
hi = (intr0 & 0x0000ffff) | (intr1 << 16);
lo = (intr0 >> 16) | (intr1 & 0xffff0000);
nouveau_gpio_isr(dev, 0, hi | lo);
nv_wr32(dev, 0xe054, intr0);
if (dev_priv->chipset >= 0x90)
nv_wr32(dev, 0xe074, intr1);
}
int
nv50_gpio_init(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
/* disable, and ack any pending gpio interrupts */
nv_wr32(dev, 0xe050, 0x00000000);
nv_wr32(dev, 0xe054, 0xffffffff);
if (dev_priv->chipset >= 0x90) {
nv_wr32(dev, 0xe070, 0x00000000);
nv_wr32(dev, 0xe074, 0xffffffff);
}
nouveau_irq_register(dev, 21, nv50_gpio_isr);
return 0;
}
void
nv50_gpio_fini(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
nv_wr32(dev, 0xe050, 0x00000000);
if (dev_priv->chipset >= 0x90)
nv_wr32(dev, 0xe070, 0x00000000);
nouveau_irq_unregister(dev, 21);
}
|
/* @(#)z_numtestf.c 1.0 98/08/13 */
/******************************************************************
* Numtest
*
* Input:
* x - pointer to a floating point value
*
* Output:
* An integer that indicates what kind of number was passed in:
* NUM = 3 - a finite value
* NAN = 2 - not a number
* INF = 1 - an infinite value
* 0 - zero
*
* Description:
* This routine returns an integer that indicates the character-
* istics of the number that was passed in.
*
*****************************************************************/
#include "fdlibm.h"
#include "zmath.h"
int
_DEFUN (numtestf, (float),
float x)
{
__int32_t wx;
int exp;
GET_FLOAT_WORD (wx, x);
exp = (wx & 0x7f800000) >> 23;
/* Check for a zero input. */
if (x == 0.0)
{
return (0);
}
/* Check for not a number or infinity. */
if (exp == 0xff)
{
if(wx & 0x7fffff)
return (NAN);
else
return (INF);
}
/* Otherwise it's a finite value. */
else
return (NUM);
}
#ifdef _DOUBLE_IS_32BITS
int numtest (double x)
{
return numtestf ((float) x);
}
#endif /* defined(_DOUBLE_IS_32BITS) */
|
// Copyright (c) 2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_BLOOM_H
#define BITCOIN_BLOOM_H
#include <vector>
#include "uint256.h"
#include "serialize.h"
class COutPoint;
class CTransaction;
// 20,000 items with fp rate < 0.1% or 10,000 items and <0.0001%
static const unsigned int MAX_BLOOM_FILTER_SIZE = 36000; // bytes
static const unsigned int MAX_HASH_FUNCS = 50;
// First two bits of nFlags control how much IsRelevantAndUpdate actually updates
// The remaining bits are reserved
enum bloomflags
{
BLOOM_UPDATE_NONE = 0,
BLOOM_UPDATE_ALL = 1,
// Only adds outpoints to the filter if the output is a pay-to-pubkey/pay-to-multisig script
BLOOM_UPDATE_P2PUBKEY_ONLY = 2,
BLOOM_UPDATE_MASK = 3,
};
/**
* BloomFilter is a probabilistic filter which SPV clients provide
* so that we can filter the transactions we sends them.
*
* This allows for significantly more efficient transaction and block downloads.
*
* Because bloom filters are probabilistic, an SPV node can increase the false-
* positive rate, making us send them transactions which aren't actually theirs,
* allowing clients to trade more bandwidth for more privacy by obfuscating which
* keys are owned by them.
*/
class CBloomFilter
{
private:
std::vector<unsigned char> vData;
bool isFull;
bool isEmpty;
unsigned int nHashFuncs;
unsigned int nTweak;
unsigned char nFlags;
unsigned int Hash(unsigned int nHashNum, const std::vector<unsigned char>& vDataToHash) const;
public:
// Creates a new bloom filter which will provide the given fp rate when filled with the given number of elements
// Note that if the given parameters will result in a filter outside the bounds of the protocol limits,
// the filter created will be as close to the given parameters as possible within the protocol limits.
// This will apply if nFPRate is very low or nElements is unreasonably high.
// nTweak is a constant which is added to the seed value passed to the hash function
// It should generally always be a random value (and is largely only exposed for unit testing)
// nFlags should be one of the BLOOM_UPDATE_* enums (not _MASK)
CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweak, unsigned char nFlagsIn);
CBloomFilter() : isFull(true) {}
IMPLEMENT_SERIALIZE
(
READWRITE(vData);
READWRITE(nHashFuncs);
READWRITE(nTweak);
READWRITE(nFlags);
)
void insert(const std::vector<unsigned char>& vKey);
void insert(const COutPoint& outpoint);
void insert(const uint256& hash);
bool contains(const std::vector<unsigned char>& vKey) const;
bool contains(const COutPoint& outpoint) const;
bool contains(const uint256& hash) const;
// True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS
// (catch a filter which was just deserialized which was too big)
bool IsWithinSizeConstraints() const;
// Also adds any outputs which match the filter to the filter (to match their spending txes)
bool IsRelevantAndUpdate(const CTransaction& tx, const uint256& hash);
// Checks for empty and full filters to avoid wasting cpu
void UpdateEmptyFull();
};
#endif /* BITCOIN_BLOOM_H */
|
/*****************************************************************************
* vlc_addons.h : addons handling and describing
*****************************************************************************
* Copyright (C) 2013 VideoLAN and authors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_ADDONS_H
#define VLC_ADDONS_H 1
#include <vlc_arrays.h>
#include <vlc_events.h>
# ifdef __cplusplus
extern "C" {
# endif
typedef enum addon_type_t
{
ADDON_UNKNOWN = 0,
ADDON_EXTENSION,
ADDON_PLAYLIST_PARSER,
ADDON_SERVICE_DISCOVERY,
ADDON_SKIN2,
ADDON_PLUGIN,
ADDON_INTERFACE,
ADDON_META,
ADDON_OTHER
} addon_type_t;
typedef enum addon_state_t
{
ADDON_NOTINSTALLED = 0,
ADDON_INSTALLING,
ADDON_INSTALLED,
ADDON_UNINSTALLING
} addon_state_t;
typedef enum addon_flags_t
{
ADDON_BROKEN = 1, /* Have install inconsistency */
ADDON_MANAGEABLE = 1 << 1, /* Have manifest, can install or uninstall files */
ADDON_UPDATABLE = 1 << 2,
} addon_flags_t;
#define ADDON_MAX_SCORE (5 * 100)
#define ADDON_UUID_SIZE 16
#define ADDON_UUID_PSZ_SIZE (ADDON_UUID_SIZE * 2 + 4)
typedef uint8_t addon_uuid_t[ADDON_UUID_SIZE];
typedef struct addon_file_t
{
addon_type_t e_filetype;
char *psz_download_uri;
char *psz_filename;
} addon_file_t;
struct addon_entry_t
{
vlc_mutex_t lock;
addon_type_t e_type;
addon_state_t e_state;
addon_flags_t e_flags;
/* data describing addon */
addon_uuid_t uuid;
char *psz_name;
char *psz_summary;
char *psz_description;
char *psz_author;
char *psz_source_uri; /* webpage, ... */
char *psz_image_uri;
char *psz_image_data; /* base64, png */
char *psz_version;
/* stats */
long int i_downloads;
int i_score; /* score 0..5 in hundredth */
/* Lister */
char *psz_source_module;
/* files list */
char *psz_archive_uri; /* Archive */
DECL_ARRAY(addon_file_t *) files;
/* custom data storage (if needed by module/source) */
void * p_custom;
};
typedef struct addons_finder_t addons_finder_t;
typedef struct addons_finder_sys_t addons_finder_sys_t;
struct addons_finder_t
{
VLC_COMMON_MEMBERS
int ( * pf_find )( addons_finder_t * );
int ( * pf_retrieve )( addons_finder_t *, addon_entry_t * );
DECL_ARRAY( addon_entry_t * ) entries;
char *psz_uri;
addons_finder_sys_t *p_sys;
};
typedef struct addons_storage_t addons_storage_t;
typedef struct addons_storage_sys_t addons_storage_sys_t;
struct addons_storage_t
{
VLC_COMMON_MEMBERS
int ( * pf_install )( addons_storage_t *, addon_entry_t * );
int ( * pf_remove )( addons_storage_t *, addon_entry_t * );
int ( * pf_catalog ) ( addons_storage_t *, addon_entry_t **, int );
addons_storage_sys_t *p_sys;
};
typedef struct addons_manager_private_t addons_manager_private_t;
struct addons_manager_t
{
vlc_event_manager_t * p_event_manager;
addons_manager_private_t *p_priv;
};
typedef struct addons_manager_t addons_manager_t;
/**
* addon entry lifecycle
*/
VLC_API addon_entry_t *addon_entry_New( void );
VLC_API addon_entry_t *addon_entry_Hold(addon_entry_t *);
VLC_API void addon_entry_Release(addon_entry_t *);
/**
* addons manager lifecycle
*/
VLC_API addons_manager_t *addons_manager_New( vlc_object_t * );
VLC_API void addons_manager_Delete( addons_manager_t * );
/**
* Charge currently installed, usable and manageable addons
* (default "addons storage" module)
*/
VLC_API int addons_manager_LoadCatalog( addons_manager_t * );
/**
* Gather addons info from repository (default "addons finder" module)
* If psz_uri is not NULL, only gather info from the pointed package.
*/
VLC_API void addons_manager_Gather( addons_manager_t *, const char *psz_uri );
/**
* Install or Remove the addon identified by its uuid
*/
VLC_API int addons_manager_Install( addons_manager_t *p_manager, const addon_uuid_t uuid );
VLC_API int addons_manager_Remove( addons_manager_t *p_manager, const addon_uuid_t uuid );
/**
* String uuid to binary uuid helpers
*/
static inline bool addons_uuid_read( const char *psz_uuid, addon_uuid_t *p_uuid )
{
if ( !psz_uuid ) return false;
if ( strlen( psz_uuid ) < ADDON_UUID_PSZ_SIZE ) return false;
int i = 0, j = 0;
while ( i<ADDON_UUID_PSZ_SIZE )
{
if ( *( psz_uuid + i ) == '-' )
i++;
int v;
sscanf( psz_uuid + i, "%02x", &v );
(*p_uuid)[j++] = v & 0xFF;
i+=2;
}
return true;
}
static inline char * addons_uuid_to_psz( const addon_uuid_t * p_uuid )
{
char *psz = (char*) calloc( ADDON_UUID_PSZ_SIZE + 1 , sizeof(char) );
if ( psz )
{
int i=0;
char *p = psz;
while ( i < ADDON_UUID_SIZE )
{
if ( i == 4 || i== 7 || i== 9 || i== 11 )
*p++ = '-';
int v = 0xFF & (*p_uuid)[i];
sprintf( p, "%02x", v );
p += 2;
i++;
}
}
return psz;
}
# ifdef __cplusplus
}
# endif
#endif
|
//
// SSDKUser.h
// ShareSDK
//
// Created by 冯 鸿杰 on 15/2/6.
// Copyright (c) 2015年 掌淘科技. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SSDKTypeDefine.h"
@class SSDKCredential;
/**
* 性别
*/
typedef NS_ENUM(NSUInteger, SSDKGender){
/**
* 男
*/
SSDKGenderMale = 0,
/**
* 女
*/
SSDKGenderFemale = 1,
/**
* 未知
*/
SSDKGenderUnknown = 2,
};
/**
* 用户信息
*/
@interface SSDKUser : NSObject
/**
* 平台类型
*/
@property (nonatomic) SSDKPlatformType platformType;
/**
* 授权凭证, 为nil则表示尚未授权
*/
@property (nonatomic, retain) SSDKCredential *credential;
/**
* 用户标识
*/
@property (nonatomic, copy) NSString *uid;
/**
* 昵称
*/
@property (nonatomic, copy) NSString *nickname;
/**
* 头像
*/
@property (nonatomic, copy) NSString *icon;
/**
* 性别
*/
@property (nonatomic) SSDKGender gender;
/**
* 用户主页
*/
@property (nonatomic, copy) NSString *url;
/**
* 用户简介
*/
@property (nonatomic, copy) NSString *aboutMe;
/**
* 认证用户类型
*/
@property (nonatomic) NSInteger verifyType;
/**
* 认证描述
*/
@property (nonatomic, copy) NSString *verifyReason;
/**
* 生日
*/
@property (nonatomic, strong) NSDate *birthday;
/**
* 粉丝数
*/
@property (nonatomic) NSInteger followerCount;
/**
* 好友数
*/
@property (nonatomic) NSInteger friendCount;
/**
* 分享数
*/
@property (nonatomic) NSInteger shareCount;
/**
* 注册时间
*/
@property (nonatomic) NSTimeInterval regAt;
/**
* 用户等级
*/
@property (nonatomic) NSInteger level;
/**
* 教育信息
*/
@property (nonatomic, retain) NSArray *educations;
/**
* 职业信息
*/
@property (nonatomic, retain) NSArray *works;
/**
* 原始数据
*/
@property (nonatomic, retain) NSDictionary *rawData;
@end
|
#define SUFF f
#define float_type float
#include <e_pow.c>
|
/*
* Copyright 2014 Broadcom 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 (the "GPL").
*
* 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.
*
* A copy of the GPL is available at
* http://www.broadcom.com/licenses/GPLv2.php, or by writing to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* The BBD (Broadcom Bridge Driver)
*
* tabstop = 8
*/
#include "bbd_internal.h"
static unsigned char bbd_patch[] =
{
#include "bbd_patch_file.h"
};
#ifdef SUPPORT_MCU_HOST_WAKE
#ifdef CONFIG_SENSORS_SSP_VLTE
static unsigned char bbd_new_patch[] =
{
#include "bbd_new_patch_file_V.h"
};
#else
static unsigned char bbd_new_patch[] =
{
#include "bbd_new_patch_file.h"
};
#endif
#endif
void bbd_patch_init_vars(struct bbd_device *dev, int* result)
{
#ifdef SUPPORT_MCU_HOST_WAKE
if(gpbbd_dev->hw_rev >= BBD_NEW_HW_REV)
printk(KERN_INFO "BBD:%s() %u\n", __func__, (u32)sizeof(bbd_new_patch));
else
#endif
printk(KERN_INFO "BBD:%s() %u\n", __func__, (u32)sizeof(bbd_patch));
dev->bbd_ptr[BBD_MINOR_PATCH] = 0;
}
int bbd_patch_uninit(void)
{
return 0;
}
int bbd_patch_open(struct inode *inode, struct file *filp)
{
#ifdef SUPPORT_MCU_HOST_WAKE
if(gpbbd_dev->hw_rev >= BBD_NEW_HW_REV)
printk(KERN_INFO "BBD:%s() %u\n", __func__, (u32)sizeof(bbd_new_patch));
else
#endif
printk(KERN_INFO "BBD:%s() %u\n", __func__, (u32)sizeof(bbd_patch));
if (!gpbbd_dev)
return -EFAULT;
filp->private_data = gpbbd_dev;
return 0;
}
int bbd_patch_release(struct inode *inode, struct file *filp)
{
return 0;
}
ssize_t bbd_patch_read( struct file *filp,
char __user *buf,
size_t size, loff_t *ppos)
{
ssize_t rd_size = size;
size_t offset = filp->f_pos;
#ifdef SUPPORT_MCU_HOST_WAKE
if(gpbbd_dev->hw_rev >= BBD_NEW_HW_REV) {
if (offset >= sizeof(bbd_new_patch)) { /* signal EOF */
*ppos = 0;
return 0;
}
if (offset+size > sizeof(bbd_new_patch))
rd_size = sizeof(bbd_new_patch) - offset;
if (copy_to_user(buf, bbd_new_patch + offset, rd_size))
rd_size = -EFAULT;
else
*ppos = filp->f_pos + rd_size;
}
else {
#endif
if (offset >= sizeof(bbd_patch)) { /* signal EOF */
*ppos = 0;
return 0;
}
if (offset+size > sizeof(bbd_patch))
rd_size = sizeof(bbd_patch) - offset;
if (copy_to_user(buf, bbd_patch + offset, rd_size))
rd_size = -EFAULT;
else
*ppos = filp->f_pos + rd_size;
#ifdef SUPPORT_MCU_HOST_WAKE
}
#endif
return rd_size;
}
|
/* Definitions of Objective-C front-end entry points used for C and C++.
Copyright (C) 1987-2014 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.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCC_C_COMMON_OBJC_H
#define GCC_C_COMMON_OBJC_H
/* ObjC ivar visibility types. */
typedef enum objc_ivar_visibility_kind {
OBJC_IVAR_VIS_PROTECTED = 0,
OBJC_IVAR_VIS_PUBLIC = 1,
OBJC_IVAR_VIS_PRIVATE = 2,
OBJC_IVAR_VIS_PACKAGE = 3
} objc_ivar_visibility_kind;
/* Objective-C / Objective-C++ entry points. */
/* The following ObjC/ObjC++ functions are called by the C and/or C++
front-ends; they all must have corresponding stubs in stub-objc.c. */
extern void objc_write_global_declarations (void);
extern tree objc_is_class_name (tree);
extern tree objc_is_object_ptr (tree);
extern void objc_check_decl (tree);
extern void objc_check_global_decl (tree);
extern tree objc_common_type (tree, tree);
extern bool objc_compare_types (tree, tree, int, tree);
extern bool objc_have_common_type (tree, tree, int, tree);
extern bool objc_diagnose_private_ivar (tree);
extern void objc_volatilize_decl (tree);
extern tree objc_rewrite_function_call (tree, tree);
extern tree objc_message_selector (void);
extern tree objc_lookup_ivar (tree, tree);
extern void objc_clear_super_receiver (void);
extern int objc_is_public (tree, tree);
extern tree objc_is_id (tree);
extern void objc_declare_alias (tree, tree);
extern void objc_declare_class (tree);
extern void objc_declare_protocol (tree, tree);
extern tree objc_build_message_expr (tree, tree);
extern tree objc_finish_message_expr (tree, tree, tree, tree*);
extern tree objc_build_selector_expr (location_t, tree);
extern tree objc_build_protocol_expr (tree);
extern tree objc_build_encode_expr (tree);
extern tree objc_build_string_object (tree);
extern tree objc_get_protocol_qualified_type (tree, tree);
extern tree objc_get_class_reference (tree);
extern tree objc_get_class_ivars (tree);
extern bool objc_detect_field_duplicates (bool);
extern void objc_start_class_interface (tree, tree, tree, tree);
extern void objc_start_category_interface (tree, tree, tree, tree);
extern void objc_start_protocol (tree, tree, tree);
extern void objc_continue_interface (void);
extern void objc_finish_interface (void);
extern void objc_start_class_implementation (tree, tree);
extern void objc_start_category_implementation (tree, tree);
extern void objc_continue_implementation (void);
extern void objc_finish_implementation (void);
extern void objc_set_visibility (objc_ivar_visibility_kind);
extern tree objc_build_method_signature (bool, tree, tree, tree, bool);
extern void objc_add_method_declaration (bool, tree, tree);
extern bool objc_start_method_definition (bool, tree, tree, tree);
extern void objc_finish_method_definition (tree);
extern void objc_add_instance_variable (tree);
extern tree objc_build_keyword_decl (tree, tree, tree, tree);
extern tree objc_build_throw_stmt (location_t, tree);
extern void objc_begin_try_stmt (location_t, tree);
extern tree objc_finish_try_stmt (void);
extern void objc_begin_catch_clause (tree);
extern void objc_finish_catch_clause (void);
extern void objc_build_finally_clause (location_t, tree);
extern tree objc_build_synchronized (location_t, tree, tree);
extern int objc_static_init_needed_p (void);
extern tree objc_generate_static_init_call (tree);
extern tree objc_generate_write_barrier (tree, enum tree_code, tree);
extern void objc_set_method_opt (bool);
extern void objc_finish_foreach_loop (location_t, tree, tree, tree, tree, tree);
extern bool objc_method_decl (enum tree_code);
extern void objc_add_property_declaration (location_t, tree, bool, bool, bool,
bool, bool, bool, tree, tree);
extern tree objc_maybe_build_component_ref (tree, tree);
extern tree objc_build_class_component_ref (tree, tree);
extern tree objc_maybe_build_modify_expr (tree, tree);
extern tree objc_build_incr_expr_for_property_ref (location_t, enum tree_code,
tree, tree);
extern void objc_add_synthesize_declaration (location_t, tree);
extern void objc_add_dynamic_declaration (location_t, tree);
extern const char * objc_maybe_printable_name (tree, int);
extern bool objc_is_property_ref (tree);
extern bool objc_string_ref_type_p (tree);
extern void objc_check_format_arg (tree, tree);
extern void objc_finish_function (void);
extern void objc_maybe_warn_exceptions (location_t);
/* The following are provided by the C and C++ front-ends, and called by
ObjC/ObjC++. */
extern void *objc_get_current_scope (void);
extern void objc_mark_locals_volatile (void *);
#endif /* ! GCC_C_COMMON_OBJC_H */
|
// Copyright 2013 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.
// -----------------------------------------------------------------------------
//
// Alpha plane de-quantization utility
//
// Author: Vikas Arora (vikasa@google.com)
#ifndef WEBP_UTILS_QUANT_LEVELS_DEC_H_
#define WEBP_UTILS_QUANT_LEVELS_DEC_H_
#include "../webp/types.h"
#ifdef __cplusplus
extern "C" {
#endif
// Apply post-processing to input 'data' of size 'width'x'height' assuming that
// the source was quantized to a reduced number of levels. 'stride' is in bytes.
// Strength is in [0..100] and controls the amount of dithering applied.
// Returns false in case of error (data is NULL, invalid parameters,
// malloc failure, ...).
int WebPDequantizeLevels(uint8_t* const data, int width, int height, int stride,
int strength);
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* WEBP_UTILS_QUANT_LEVELS_DEC_H_ */
|
/*************************************************************************/ /*!
@File
@Title Server bridge for rgxpdump
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for rgxpdump
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
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.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) 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; AND (B) 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.
*/ /**************************************************************************/
#include <stddef.h>
#include <asm/uaccess.h>
#include "img_defs.h"
#include "rgxpdump.h"
#include "common_rgxpdump_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgePDumpTraceBuffer(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER *psPDumpTraceBufferIN,
PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER *psPDumpTraceBufferOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDeviceNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER);
{
/* Look up the address from the handle */
psPDumpTraceBufferOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDeviceNodeInt,
psPDumpTraceBufferIN->hDeviceNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psPDumpTraceBufferOUT->eError != PVRSRV_OK)
{
goto PDumpTraceBuffer_exit;
}
}
psPDumpTraceBufferOUT->eError =
PVRSRVPDumpTraceBufferKM(
hDeviceNodeInt,
psPDumpTraceBufferIN->ui32PDumpFlags);
PDumpTraceBuffer_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePDumpSignatureBuffer(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER *psPDumpSignatureBufferIN,
PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER *psPDumpSignatureBufferOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDeviceNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER);
{
/* Look up the address from the handle */
psPDumpSignatureBufferOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDeviceNodeInt,
psPDumpSignatureBufferIN->hDeviceNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psPDumpSignatureBufferOUT->eError != PVRSRV_OK)
{
goto PDumpSignatureBuffer_exit;
}
}
psPDumpSignatureBufferOUT->eError =
PVRSRVPDumpSignatureBufferKM(
hDeviceNodeInt,
psPDumpSignatureBufferIN->ui32PDumpFlags);
PDumpSignatureBuffer_exit:
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterRGXPDUMPFunctions(IMG_VOID);
IMG_VOID UnregisterRGXPDUMPFunctions(IMG_VOID);
/*
* Register all RGXPDUMP functions with services
*/
PVRSRV_ERROR RegisterRGXPDUMPFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER, PVRSRVBridgePDumpTraceBuffer);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER, PVRSRVBridgePDumpSignatureBuffer);
return PVRSRV_OK;
}
/*
* Unregister all rgxpdump functions with services
*/
IMG_VOID UnregisterRGXPDUMPFunctions(IMG_VOID)
{
}
|
/* ============================================================================
Module Name:
MLMETxRx.C
Description:
The interface between MDS (MAC Data Service) and MLME.
Revision History:
--------------------------------------------------------------------------
200209 UN20 Jennifer Xu
Initial Release
20021108 PD43 Austin Liu
20030117 PD43 Austin Liu
Deleted MLMEReturnPacket and MLMEProcThread()
Copyright (c) 1996-2002 Winbond Electronics Corp. All Rights Reserved.
============================================================================ */
#include "sysdef.h"
#include "mds_f.h"
/* ============================================================================= */
u8 MLMESendFrame(struct wbsoft_priv *adapter, u8 *pMMPDU, u16 len, u8 DataType)
/* DataType : FRAME_TYPE_802_11_MANAGEMENT, FRAME_TYPE_802_11_MANAGEMENT_CHALLENGE,
FRAME_TYPE_802_11_DATA */
{
if (adapter->sMlmeFrame.IsInUsed != PACKET_FREE_TO_USE) {
adapter->sMlmeFrame.wNumTxMMPDUDiscarded++;
return false;
}
adapter->sMlmeFrame.IsInUsed = PACKET_COME_FROM_MLME;
/* Keep information for sending */
adapter->sMlmeFrame.pMMPDU = pMMPDU;
adapter->sMlmeFrame.DataType = DataType;
/* len must be the last setting due to QUERY_SIZE_SECOND of Mds */
adapter->sMlmeFrame.len = len;
adapter->sMlmeFrame.wNumTxMMPDU++;
/* H/W will enter power save by set the register. S/W don't send null frame
with PWRMgt bit enbled to enter power save now. */
/* Transmit NDIS packet */
Mds_Tx(adapter);
return true;
}
void MLME_GetNextPacket(struct wbsoft_priv *adapter, struct wb35_descriptor *desc)
{
desc->InternalUsed = desc->buffer_start_index + desc->buffer_number;
desc->InternalUsed %= MAX_DESCRIPTOR_BUFFER_INDEX;
desc->buffer_address[desc->InternalUsed] = adapter->sMlmeFrame.pMMPDU;
desc->buffer_size[desc->InternalUsed] = adapter->sMlmeFrame.len;
desc->buffer_total_size += adapter->sMlmeFrame.len;
desc->buffer_number++;
desc->Type = adapter->sMlmeFrame.DataType;
}
static void MLMEfreeMMPDUBuffer(struct wbsoft_priv *adapter, s8 *pData)
{
int i;
/* Reclaim the data buffer */
for (i = 0; i < MAX_NUM_TX_MMPDU; i++) {
if (pData == (s8 *)&(adapter->sMlmeFrame.TxMMPDU[i]))
break;
}
if (adapter->sMlmeFrame.TxMMPDUInUse[i])
adapter->sMlmeFrame.TxMMPDUInUse[i] = false;
else {
/* Something wrong
PD43 Add debug code here??? */
}
}
void
MLME_SendComplete(struct wbsoft_priv *adapter, u8 PacketID, unsigned char SendOK)
{
MLME_TXCALLBACK TxCallback;
/* Reclaim the data buffer */
adapter->sMlmeFrame.len = 0;
MLMEfreeMMPDUBuffer(adapter, adapter->sMlmeFrame.pMMPDU);
TxCallback.bResult = MLME_SUCCESS;
/* Return resource */
adapter->sMlmeFrame.IsInUsed = PACKET_FREE_TO_USE;
}
|
/*
* YAFFS: Yet another Flash File System . A NAND-flash specific file system.
*
* Copyright (C) 2002-2010 Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning <charles@aleph1.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1 as
* published by the Free Software Foundation.
*
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
#ifndef __YAFFS_MTDIF_H__
#define __YAFFS_MTDIF_H__
#include "yaffs_guts.h"
int nandmtd_erase_block(struct yaffs_dev *dev, int block_no);
int nandmtd_initialise(struct yaffs_dev *dev);
#endif
|
/* crypt.h -- base code for crypt/uncrypt ZIPfile
Version 1.01e, February 12th, 2005
Copyright (C) 1998-2005 Gilles Vollant
This code is a modified version of crypting code in Infozip distribution
The encryption/decryption parts of this source code (as opposed to the
non-echoing password parts) were originally written in Europe. The
whole source package can be freely distributed, including from the USA.
(Prior to January 2000, re-export from the US was a violation of US law.)
This encryption code is a direct transcription of the algorithm from
Roger Schlafly, described by Phil Katz in the file appnote.txt. This
file (appnote.txt) is distributed with the PKZIP program (even in the
version without encryption capabilities).
If you don't need crypting in your application, just define symbols
NOCRYPT and NOUNCRYPT.
This code support the "Traditional PKWARE Encryption".
The new AES encryption added on Zip format by Winzip (see the page
http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
Encryption is not supported.
*/
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
/***********************************************************************
* Return the next byte in the pseudo-random sequence
*/
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
{
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
* unpredictable manner on 16-bit systems; not a problem
* with any known compiler so far, though */
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
}
/***********************************************************************
* Update the encryption keys with the next byte of plain text
*/
static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
{
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
{
register int keyshift = (int)((*(pkeys+1)) >> 24);
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
}
return c;
}
/***********************************************************************
* Initialize the encryption keys and the random header according to
* the given password.
*/
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
{
*(pkeys+0) = 305419896L;
*(pkeys+1) = 591751049L;
*(pkeys+2) = 878082192L;
while (*passwd != '\0') {
update_keys(pkeys,pcrc_32_tab,(int)*passwd);
passwd++;
}
}
#define zdecode(pkeys,pcrc_32_tab,c) \
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
#define zencode(pkeys,pcrc_32_tab,c,t) \
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
#define RAND_HEAD_LEN 12
/* "last resort" source for second part of crypt seed pattern */
# ifndef ZCR_SEED2
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
# endif
static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
const char *passwd; /* password string */
unsigned char *buf; /* where to write header */
int bufSize;
unsigned long* pkeys;
const unsigned long* pcrc_32_tab;
unsigned long crcForCrypting;
{
int n; /* index in random header */
int t; /* temporary */
int c; /* random byte */
unsigned char header[RAND_HEAD_LEN-2]; /* random header */
static unsigned calls = 0; /* ensure different random header each time */
if (bufSize<RAND_HEAD_LEN)
return 0;
/* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
* output of rand() to get less predictability, since rand() is
* often poorly implemented.
*/
if (++calls == 1)
{
srand((unsigned)(time(NULL) ^ ZCR_SEED2));
}
init_keys(passwd, pkeys, pcrc_32_tab);
for (n = 0; n < RAND_HEAD_LEN-2; n++)
{
c = (rand() >> 7) & 0xff;
header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
}
/* Encrypt random header (last two bytes is high word of crc) */
init_keys(passwd, pkeys, pcrc_32_tab);
for (n = 0; n < RAND_HEAD_LEN-2; n++)
{
buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
}
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
return n;
}
#endif
|
/* { dg-do run } */
/* { dg-options "-O2 -mavx512dq" } */
/* { dg-require-effective-target avx512dq } */
#define AVX512DQ
#include "avx512f-helper.h"
#define SIZE (AVX512F_LEN / 64)
#define SIZE_HALF (AVX512F_LEN_HALF / 32)
#include "avx512f-mask-type.h"
void
CALC (unsigned long long *s, float *r)
{
int i;
for (i = 0; i < SIZE_HALF; i++)
r[i] = (i < SIZE) ? (float) s[i] : 0;
}
void
TEST (void)
{
UNION_TYPE (AVX512F_LEN, i_q) s;
UNION_TYPE (AVX512F_LEN_HALF,) res1, res2, res3;
MASK_TYPE mask = MASK_VALUE;
float res_ref[SIZE_HALF];
int i;
for (i = 0; i < SIZE; i++)
{
s.a[i] = 123 * (i + 2000);
res2.a[i] = DEFAULT_VALUE;
}
res1.x = INTRINSIC (_cvtepu64_ps) (s.x);
res2.x = INTRINSIC (_mask_cvtepu64_ps) (res2.x, mask, s.x);
res3.x = INTRINSIC (_maskz_cvtepu64_ps) (mask, s.x);
CALC (s.a, res_ref);
if (UNION_CHECK (AVX512F_LEN_HALF,) (res1, res_ref))
abort ();
MASK_MERGE ()(res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN_HALF,) (res2, res_ref))
abort ();
MASK_ZERO ()(res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN_HALF,) (res3, res_ref))
abort ();
}
|
/* { dg-do compile } */
/* { dg-options "-mavx512f -O2" } */
/* { dg-final { scan-assembler-times "vpmovsqb\[ \\t\]+\[^\{\n\]*(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vpmovsqb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vpmovsqb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vpmovsqb\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */
#include <immintrin.h>
volatile __m512i s;
volatile __m128i res;
volatile __mmask8 m;
void extern
avx512f_test (void)
{
res = _mm512_cvtsepi64_epi8 (s);
res = _mm512_mask_cvtsepi64_epi8 (res, m, s);
res = _mm512_maskz_cvtsepi64_epi8 (m, s);
_mm512_mask_cvtsepi64_storeu_epi8 ((void *) &res, m, s);
}
|
/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/mount.h>
#include <linux/seq_file.h>
#include <linux/poll.h>
#include <linux/ns_common.h>
#include <linux/fs_pin.h>
struct mnt_namespace {
atomic_t count;
struct ns_common ns;
struct mount * root;
struct list_head list;
struct user_namespace *user_ns;
struct ucounts *ucounts;
u64 seq; /* Sequence number to prevent loops */
wait_queue_head_t poll;
u64 event;
unsigned int mounts; /* # of mounts in the namespace */
unsigned int pending_mounts;
} __randomize_layout;
struct mnt_pcp {
int mnt_count;
int mnt_writers;
};
struct mountpoint {
struct hlist_node m_hash;
struct dentry *m_dentry;
struct hlist_head m_list;
int m_count;
};
struct mount {
struct hlist_node mnt_hash;
struct mount *mnt_parent;
struct dentry *mnt_mountpoint;
struct vfsmount mnt;
union {
struct rcu_head mnt_rcu;
struct llist_node mnt_llist;
};
#ifdef CONFIG_SMP
struct mnt_pcp __percpu *mnt_pcp;
#else
int mnt_count;
int mnt_writers;
#endif
struct list_head mnt_mounts; /* list of children, anchored here */
struct list_head mnt_child; /* and going through their mnt_child */
struct list_head mnt_instance; /* mount instance on sb->s_mounts */
const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
struct list_head mnt_list;
struct list_head mnt_expire; /* link in fs-specific expiry list */
struct list_head mnt_share; /* circular list of shared mounts */
struct list_head mnt_slave_list;/* list of slave mounts */
struct list_head mnt_slave; /* slave list entry */
struct mount *mnt_master; /* slave is on master->mnt_slave_list */
struct mnt_namespace *mnt_ns; /* containing namespace */
struct mountpoint *mnt_mp; /* where is it mounted */
union {
struct hlist_node mnt_mp_list; /* list mounts with the same mountpoint */
struct hlist_node mnt_umount;
};
struct list_head mnt_umounting; /* list entry for umount propagation */
#ifdef CONFIG_FSNOTIFY
struct fsnotify_mark_connector __rcu *mnt_fsnotify_marks;
__u32 mnt_fsnotify_mask;
#endif
int mnt_id; /* mount identifier */
int mnt_group_id; /* peer group identifier */
int mnt_expiry_mark; /* true if marked for expiry */
struct hlist_head mnt_pins;
struct hlist_head mnt_stuck_children;
} __randomize_layout;
#define MNT_NS_INTERNAL ERR_PTR(-EINVAL) /* distinct from any mnt_namespace */
static inline struct mount *real_mount(struct vfsmount *mnt)
{
return container_of(mnt, struct mount, mnt);
}
static inline int mnt_has_parent(struct mount *mnt)
{
return mnt != mnt->mnt_parent;
}
static inline int is_mounted(struct vfsmount *mnt)
{
/* neither detached nor internal? */
return !IS_ERR_OR_NULL(real_mount(mnt)->mnt_ns);
}
extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *);
extern int __legitimize_mnt(struct vfsmount *, unsigned);
extern bool legitimize_mnt(struct vfsmount *, unsigned);
static inline bool __path_is_mountpoint(const struct path *path)
{
struct mount *m = __lookup_mnt(path->mnt, path->dentry);
return m && likely(!(m->mnt.mnt_flags & MNT_SYNC_UMOUNT));
}
extern void __detach_mounts(struct dentry *dentry);
static inline void detach_mounts(struct dentry *dentry)
{
if (!d_mountpoint(dentry))
return;
__detach_mounts(dentry);
}
static inline void get_mnt_ns(struct mnt_namespace *ns)
{
atomic_inc(&ns->count);
}
extern seqlock_t mount_lock;
static inline void lock_mount_hash(void)
{
write_seqlock(&mount_lock);
}
static inline void unlock_mount_hash(void)
{
write_sequnlock(&mount_lock);
}
struct proc_mounts {
struct mnt_namespace *ns;
struct path root;
int (*show)(struct seq_file *, struct vfsmount *);
void *cached_mount;
u64 cached_event;
loff_t cached_index;
};
extern const struct seq_operations mounts_op;
extern bool __is_local_mountpoint(struct dentry *dentry);
static inline bool is_local_mountpoint(struct dentry *dentry)
{
if (!d_mountpoint(dentry))
return false;
return __is_local_mountpoint(dentry);
}
static inline bool is_anon_ns(struct mnt_namespace *ns)
{
return ns->seq == 0;
}
|
/*
* RAW H.261 video demuxer
* Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavcodec/get_bits.h"
#include "avformat.h"
#include "rawdec.h"
static int h261_probe(AVProbeData *p)
{
int i;
int valid_psc=0;
int invalid_psc=0;
int next_gn=0;
int src_fmt=0;
for(i=0; i<p->buf_size; i++){
if ((AV_RB16(&p->buf[i]) - 1) < 0xFFU) {
int shift = av_log2_16bit(p->buf[i+1]);
uint32_t code = AV_RB64(&p->buf[FFMAX(i-1, 0)]) >> (24+shift);
if ((code & 0xffff0000) == 0x10000) {
int gn= (code>>12)&0xf;
if(!gn)
src_fmt= code&8;
if(gn != next_gn) invalid_psc++;
else valid_psc++;
if(src_fmt){ // CIF
static const int lut[16]={1,2,3,4,5,6,7,8,9,10,11,12,0,16,16,16};
next_gn = lut[gn];
}else{ //QCIF
static const int lut[16]={1,3,16,5,16,0,16,16,16,16,16,16,16,16,16,16};
next_gn = lut[gn];
}
}
}
}
if(valid_psc > 2*invalid_psc + 6){
return AVPROBE_SCORE_EXTENSION;
}else if(valid_psc > 2*invalid_psc + 2)
return AVPROBE_SCORE_EXTENSION / 2;
return 0;
}
FF_DEF_RAWVIDEO_DEMUXER(h261, "raw H.261", h261_probe, "h261", AV_CODEC_ID_H261)
|
#include <stdio.h>
typedef unsigned long long int ULong;
ULong do_clc ( void )
{
ULong res;
__asm__ __volatile__(
"pushq $0x8d5\n\t" /* OSZACP */
"popfq\n\t"
"clc\n\t"
"pushfq\n\t"
"popq %0"
: "=r"(res)
:
: "memory", "cc"
);
return res;
}
ULong do_stc ( void )
{
ULong res;
__asm__ __volatile__(
"pushq $0x0\n\t"
"popfq\n\t"
"stc\n\t"
"pushfq\n\t"
"popq %0"
: "=r"(res)
:
: "memory", "cc"
);
return res;
}
ULong do_cmc ( void )
{
ULong res;
__asm__ __volatile__(
"pushq $0x0\n\t"
"popfq\n\t"
"stc\n\t"
"cmc\n\t"
"pushfq\n\t"
"popq %0"
: "=r"(res)
:
: "memory", "cc"
);
return res;
}
int main ( void )
{
printf("clc: 0x%016llx\n", 0x8d5 & do_clc());
printf("stc: 0x%016llx\n", 0x8d5 & do_stc());
printf("cmc: 0x%016llx\n", 0x8d5 & do_cmc());
return 0;
}
|
/*
* ASoC simple sound card support
*
* Copyright (C) 2012 Renesas Solutions Corp.
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.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 __SIMPLE_CARD_H
#define __SIMPLE_CARD_H
#include <sound/soc.h>
struct asoc_simple_dai {
const char *name;
unsigned int fmt;
unsigned int sysclk;
int slots;
int slot_width;
};
struct asoc_simple_card_info {
const char *name;
const char *card;
const char *codec;
const char *platform;
unsigned int daifmt;
struct asoc_simple_dai cpu_dai;
struct asoc_simple_dai codec_dai;
};
#endif /* __SIMPLE_CARD_H */
|
/* linux/drivers/media/platform/s5p-jpeg/jpeg-core.h
*
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef JPEG_CORE_H_
#define JPEG_CORE_H_
#include <linux/interrupt.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-ctrls.h>
#define S5P_JPEG_M2M_NAME "s5p-jpeg"
/* JPEG compression quality setting */
#define S5P_JPEG_COMPR_QUAL_BEST 0
#define S5P_JPEG_COMPR_QUAL_WORST 3
/* JPEG RGB to YCbCr conversion matrix coefficients */
#define S5P_JPEG_COEF11 0x4d
#define S5P_JPEG_COEF12 0x97
#define S5P_JPEG_COEF13 0x1e
#define S5P_JPEG_COEF21 0x2c
#define S5P_JPEG_COEF22 0x57
#define S5P_JPEG_COEF23 0x83
#define S5P_JPEG_COEF31 0x83
#define S5P_JPEG_COEF32 0x6e
#define S5P_JPEG_COEF33 0x13
#define EXYNOS3250_IRQ_TIMEOUT 0x10000000
/* a selection of JPEG markers */
#define TEM 0x01
#define SOF0 0xc0
#define RST 0xd0
#define SOI 0xd8
#define EOI 0xd9
#define DHP 0xde
/* Flags that indicate a format can be used for capture/output */
#define SJPEG_FMT_FLAG_ENC_CAPTURE (1 << 0)
#define SJPEG_FMT_FLAG_ENC_OUTPUT (1 << 1)
#define SJPEG_FMT_FLAG_DEC_CAPTURE (1 << 2)
#define SJPEG_FMT_FLAG_DEC_OUTPUT (1 << 3)
#define SJPEG_FMT_FLAG_S5P (1 << 4)
#define SJPEG_FMT_FLAG_EXYNOS3250 (1 << 5)
#define SJPEG_FMT_FLAG_EXYNOS4 (1 << 6)
#define SJPEG_FMT_RGB (1 << 7)
#define SJPEG_FMT_NON_RGB (1 << 8)
#define S5P_JPEG_ENCODE 0
#define S5P_JPEG_DECODE 1
#define FMT_TYPE_OUTPUT 0
#define FMT_TYPE_CAPTURE 1
#define SJPEG_SUBSAMPLING_444 0x11
#define SJPEG_SUBSAMPLING_422 0x21
#define SJPEG_SUBSAMPLING_420 0x22
/* Version numbers */
enum sjpeg_version {
SJPEG_S5P,
SJPEG_EXYNOS3250,
SJPEG_EXYNOS4,
SJPEG_EXYNOS5420,
};
enum exynos4_jpeg_result {
OK_ENC_OR_DEC,
ERR_PROT,
ERR_DEC_INVALID_FORMAT,
ERR_MULTI_SCAN,
ERR_FRAME,
ERR_UNKNOWN,
};
enum exynos4_jpeg_img_quality_level {
QUALITY_LEVEL_1 = 0, /* high */
QUALITY_LEVEL_2,
QUALITY_LEVEL_3,
QUALITY_LEVEL_4, /* low */
};
/**
* struct s5p_jpeg - JPEG IP abstraction
* @lock: the mutex protecting this structure
* @slock: spinlock protecting the device contexts
* @v4l2_dev: v4l2 device for mem2mem mode
* @vfd_encoder: video device node for encoder mem2mem mode
* @vfd_decoder: video device node for decoder mem2mem mode
* @m2m_dev: v4l2 mem2mem device data
* @regs: JPEG IP registers mapping
* @irq: JPEG IP irq
* @clk: JPEG IP clock
* @sclk: Exynos3250 JPEG IP special clock
* @dev: JPEG IP struct device
* @alloc_ctx: videobuf2 memory allocator's context
* @variant: driver variant to be used
* @irq_status interrupt flags set during single encode/decode
operation
*/
struct s5p_jpeg {
struct mutex lock;
spinlock_t slock;
struct v4l2_device v4l2_dev;
struct video_device *vfd_encoder;
struct video_device *vfd_decoder;
struct v4l2_m2m_dev *m2m_dev;
void __iomem *regs;
unsigned int irq;
enum exynos4_jpeg_result irq_ret;
struct clk *clk;
struct clk *sclk;
struct device *dev;
void *alloc_ctx;
struct s5p_jpeg_variant *variant;
u32 irq_status;
};
struct s5p_jpeg_variant {
unsigned int version;
unsigned int fmt_ver_flag;
unsigned int hw3250_compat:1;
unsigned int htbl_reinit:1;
struct v4l2_m2m_ops *m2m_ops;
irqreturn_t (*jpeg_irq)(int irq, void *priv);
};
/**
* struct jpeg_fmt - driver's internal color format data
* @name: format descritpion
* @fourcc: the fourcc code, 0 if not applicable
* @depth: number of bits per pixel
* @colplanes: number of color planes (1 for packed formats)
* @h_align: horizontal alignment order (align to 2^h_align)
* @v_align: vertical alignment order (align to 2^v_align)
* @flags: flags describing format applicability
*/
struct s5p_jpeg_fmt {
char *name;
u32 fourcc;
int depth;
int colplanes;
int memplanes;
int h_align;
int v_align;
int subsampling;
u32 flags;
};
/**
* s5p_jpeg_q_data - parameters of one queue
* @fmt: driver-specific format of this queue
* @w: image width
* @h: image height
* @size: image buffer size in bytes
*/
struct s5p_jpeg_q_data {
struct s5p_jpeg_fmt *fmt;
u32 w;
u32 h;
u32 size;
};
/**
* s5p_jpeg_ctx - the device context data
* @jpeg: JPEG IP device for this context
* @mode: compression (encode) operation or decompression (decode)
* @compr_quality: destination image quality in compression (encode) mode
* @restart_interval: JPEG restart interval for JPEG encoding
* @subsampling: subsampling of a raw format or a JPEG
* @out_q: source (output) queue information
* @cap_q: destination (capture) queue queue information
* @scale_factor: scale factor for JPEG decoding
* @crop_rect: a rectangle representing crop area of the output buffer
* @fh: V4L2 file handle
* @hdr_parsed: set if header has been parsed during decompression
* @crop_altered: set if crop rectangle has been altered by the user space
* @ctrl_handler: controls handler
*/
struct s5p_jpeg_ctx {
struct s5p_jpeg *jpeg;
unsigned int mode;
unsigned short compr_quality;
unsigned short restart_interval;
unsigned short subsampling;
struct s5p_jpeg_q_data out_q;
struct s5p_jpeg_q_data cap_q;
unsigned int scale_factor;
struct v4l2_rect crop_rect;
struct v4l2_fh fh;
bool hdr_parsed;
bool crop_altered;
struct v4l2_ctrl_handler ctrl_handler;
};
/**
* s5p_jpeg_buffer - description of memory containing input JPEG data
* @size: buffer size
* @curr: current position in the buffer
* @data: pointer to the data
*/
struct s5p_jpeg_buffer {
unsigned long size;
unsigned long curr;
unsigned long data;
};
/**
* struct s5p_jpeg_addr - JPEG converter physical address set for DMA
* @y: luminance plane physical address
* @cb: Cb plane physical address
* @cr: Cr plane physical address
*/
struct s5p_jpeg_addr {
u32 y;
u32 cb;
u32 cr;
};
#endif /* JPEG_CORE_H */
|
#ifndef __M68K_ENTRY_H
#define __M68K_ENTRY_H
#include <asm/setup.h>
#include <asm/page.h>
/*
* Stack layout in 'ret_from_exception':
*
* This allows access to the syscall arguments in registers d1-d5
*
* 0(sp) - d1
* 4(sp) - d2
* 8(sp) - d3
* C(sp) - d4
* 10(sp) - d5
* 14(sp) - a0
* 18(sp) - a1
* 1C(sp) - a2
* 20(sp) - d0
* 24(sp) - orig_d0
* 28(sp) - stack adjustment
* 2C(sp) - sr
* 2E(sp) - pc
* 32(sp) - format & vector
*/
/*
* 97/05/14 Andreas: Register %a2 is now set to the current task throughout
* the whole kernel.
*/
/* the following macro is used when enabling interrupts */
#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
/* block out HSYNC on the atari */
#define ALLOWINT (~0x400)
#define MAX_NOINT_IPL 3
#else
/* portable version */
#define ALLOWINT (~0x700)
#define MAX_NOINT_IPL 0
#endif /* machine compilation types */
#ifdef __ASSEMBLY__
#define curptr a2
LFLUSH_I_AND_D = 0x00000808
LSIGTRAP = 5
/* process bits for task_struct.ptrace */
PT_TRACESYS_OFF = 3
PT_TRACESYS_BIT = 1
PT_PTRACED_OFF = 3
PT_PTRACED_BIT = 0
PT_DTRACE_OFF = 3
PT_DTRACE_BIT = 2
#define SAVE_ALL_INT save_all_int
#define SAVE_ALL_SYS save_all_sys
#define RESTORE_ALL restore_all
/*
* This defines the normal kernel pt-regs layout.
*
* regs a3-a6 and d6-d7 are preserved by C code
* the kernel doesn't mess with usp unless it needs to
*/
/*
* a -1 in the orig_d0 field signifies
* that the stack frame is NOT for syscall
*/
.macro save_all_int
clrl %sp@- | stk_adj
pea -1:w | orig d0
movel %d0,%sp@- | d0
moveml %d1-%d5/%a0-%a1/%curptr,%sp@-
.endm
.macro save_all_sys
clrl %sp@- | stk_adj
movel %d0,%sp@- | orig d0
movel %d0,%sp@- | d0
moveml %d1-%d5/%a0-%a1/%curptr,%sp@-
.endm
.macro restore_all
moveml %sp@+,%a0-%a1/%curptr/%d1-%d5
movel %sp@+,%d0
addql #4,%sp | orig d0
addl %sp@+,%sp | stk adj
rte
.endm
#define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
#define SAVE_SWITCH_STACK save_switch_stack
#define RESTORE_SWITCH_STACK restore_switch_stack
#define GET_CURRENT(tmp) get_current tmp
.macro save_switch_stack
moveml %a3-%a6/%d6-%d7,%sp@-
.endm
.macro restore_switch_stack
moveml %sp@+,%a3-%a6/%d6-%d7
.endm
.macro get_current reg=%d0
movel %sp,\reg
andw #-THREAD_SIZE,\reg
movel \reg,%curptr
movel %curptr@,%curptr
.endm
#else /* C source */
#define STR(X) STR1(X)
#define STR1(X) #X
#define PT_OFF_ORIG_D0 0x24
#define PT_OFF_FORMATVEC 0x32
#define PT_OFF_SR 0x2C
#define SAVE_ALL_INT \
"clrl %%sp@-;" /* stk_adj */ \
"pea -1:w;" /* orig d0 = -1 */ \
"movel %%d0,%%sp@-;" /* d0 */ \
"moveml %%d1-%%d5/%%a0-%%a2,%%sp@-"
#define GET_CURRENT(tmp) \
"movel %%sp,"#tmp"\n\t" \
"andw #-"STR(THREAD_SIZE)","#tmp"\n\t" \
"movel "#tmp",%%a2\n\t" \
"movel %%a2@,%%a2"
#endif
#endif /* __M68K_ENTRY_H */
|
/*
* Copyright 2012 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include "priv.h"
#include "ram.h"
#include <core/memory.h>
#include <core/option.h>
#include <subdev/bios.h>
#include <subdev/bios/M0203.h>
#include <engine/gr.h>
#include <engine/mpeg.h>
void
nvkm_fb_tile_fini(struct nvkm_fb *fb, int region, struct nvkm_fb_tile *tile)
{
fb->func->tile.fini(fb, region, tile);
}
void
nvkm_fb_tile_init(struct nvkm_fb *fb, int region, u32 addr, u32 size,
u32 pitch, u32 flags, struct nvkm_fb_tile *tile)
{
fb->func->tile.init(fb, region, addr, size, pitch, flags, tile);
}
void
nvkm_fb_tile_prog(struct nvkm_fb *fb, int region, struct nvkm_fb_tile *tile)
{
struct nvkm_device *device = fb->subdev.device;
if (fb->func->tile.prog) {
fb->func->tile.prog(fb, region, tile);
if (device->gr)
nvkm_engine_tile(&device->gr->engine, region);
if (device->mpeg)
nvkm_engine_tile(device->mpeg, region);
}
}
int
nvkm_fb_bios_memtype(struct nvkm_bios *bios)
{
struct nvkm_subdev *subdev = &bios->subdev;
struct nvkm_device *device = subdev->device;
const u8 ramcfg = (nvkm_rd32(device, 0x101000) & 0x0000003c) >> 2;
struct nvbios_M0203E M0203E;
u8 ver, hdr;
if (nvbios_M0203Em(bios, ramcfg, &ver, &hdr, &M0203E)) {
switch (M0203E.type) {
case M0203E_TYPE_DDR2 : return NVKM_RAM_TYPE_DDR2;
case M0203E_TYPE_DDR3 : return NVKM_RAM_TYPE_DDR3;
case M0203E_TYPE_GDDR3 : return NVKM_RAM_TYPE_GDDR3;
case M0203E_TYPE_GDDR5 : return NVKM_RAM_TYPE_GDDR5;
case M0203E_TYPE_GDDR5X: return NVKM_RAM_TYPE_GDDR5X;
case M0203E_TYPE_GDDR6 : return NVKM_RAM_TYPE_GDDR6;
case M0203E_TYPE_HBM2 : return NVKM_RAM_TYPE_HBM2;
default:
nvkm_warn(subdev, "M0203E type %02x\n", M0203E.type);
return NVKM_RAM_TYPE_UNKNOWN;
}
}
nvkm_warn(subdev, "M0203E not matched!\n");
return NVKM_RAM_TYPE_UNKNOWN;
}
static void
nvkm_fb_intr(struct nvkm_subdev *subdev)
{
struct nvkm_fb *fb = nvkm_fb(subdev);
if (fb->func->intr)
fb->func->intr(fb);
}
static int
nvkm_fb_oneinit(struct nvkm_subdev *subdev)
{
struct nvkm_fb *fb = nvkm_fb(subdev);
u32 tags = 0;
if (fb->func->ram_new) {
int ret = fb->func->ram_new(fb, &fb->ram);
if (ret) {
nvkm_error(subdev, "vram setup failed, %d\n", ret);
return ret;
}
}
if (fb->func->oneinit) {
int ret = fb->func->oneinit(fb);
if (ret)
return ret;
}
/* Initialise compression tag allocator.
*
* LTC oneinit() will override this on Fermi and newer.
*/
if (fb->func->tags) {
tags = fb->func->tags(fb);
nvkm_debug(subdev, "%d comptags\n", tags);
}
return nvkm_mm_init(&fb->tags, 0, 0, tags, 1);
}
static int
nvkm_fb_init(struct nvkm_subdev *subdev)
{
struct nvkm_fb *fb = nvkm_fb(subdev);
int ret, i;
if (fb->ram) {
ret = nvkm_ram_init(fb->ram);
if (ret)
return ret;
}
for (i = 0; i < fb->tile.regions; i++)
fb->func->tile.prog(fb, i, &fb->tile.region[i]);
if (fb->func->init)
fb->func->init(fb);
if (fb->func->init_remapper)
fb->func->init_remapper(fb);
if (fb->func->init_page) {
ret = fb->func->init_page(fb);
if (WARN_ON(ret))
return ret;
}
if (fb->func->init_unkn)
fb->func->init_unkn(fb);
return 0;
}
static void *
nvkm_fb_dtor(struct nvkm_subdev *subdev)
{
struct nvkm_fb *fb = nvkm_fb(subdev);
int i;
nvkm_memory_unref(&fb->mmu_wr);
nvkm_memory_unref(&fb->mmu_rd);
for (i = 0; i < fb->tile.regions; i++)
fb->func->tile.fini(fb, i, &fb->tile.region[i]);
nvkm_mm_fini(&fb->tags);
nvkm_ram_del(&fb->ram);
if (fb->func->dtor)
return fb->func->dtor(fb);
return fb;
}
static const struct nvkm_subdev_func
nvkm_fb = {
.dtor = nvkm_fb_dtor,
.oneinit = nvkm_fb_oneinit,
.init = nvkm_fb_init,
.intr = nvkm_fb_intr,
};
void
nvkm_fb_ctor(const struct nvkm_fb_func *func, struct nvkm_device *device,
int index, struct nvkm_fb *fb)
{
nvkm_subdev_ctor(&nvkm_fb, device, index, &fb->subdev);
fb->func = func;
fb->tile.regions = fb->func->tile.regions;
fb->page = nvkm_longopt(device->cfgopt, "NvFbBigPage",
fb->func->default_bigpage);
}
int
nvkm_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device,
int index, struct nvkm_fb **pfb)
{
if (!(*pfb = kzalloc(sizeof(**pfb), GFP_KERNEL)))
return -ENOMEM;
nvkm_fb_ctor(func, device, index, *pfb);
return 0;
}
|
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code 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.
Doom 3 Source Code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#ifndef __GAME_WORLDSPAWN_H__
#define __GAME_WORLDSPAWN_H__
/*
===============================================================================
World entity.
===============================================================================
*/
class idWorldspawn : public idEntity {
public:
CLASS_PROTOTYPE( idWorldspawn );
~idWorldspawn();
void Spawn( void );
void Save( idRestoreGame *savefile );
void Restore( idRestoreGame *savefile );
private:
void Event_Remove( void );
};
#endif /* !__GAME_WORLDSPAWN_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 NET_CERT_SINGLE_REQUEST_CERT_VERIFIER_H_
#define NET_CERT_SINGLE_REQUEST_CERT_VERIFIER_H_
#include "net/cert/cert_verifier.h"
namespace net {
// This class represents the task of verifying a certificate. It wraps
// CertVerifier to verify only a single certificate at a time and cancels this
// request when going out of scope.
class SingleRequestCertVerifier {
public:
// |cert_verifier| must remain valid for the lifetime of |this|.
explicit SingleRequestCertVerifier(CertVerifier* cert_verifier);
// If a completion callback is pending when the verifier is destroyed, the
// certificate verification is canceled, and the completion callback will
// not be called.
~SingleRequestCertVerifier();
// Verifies the given certificate, filling out the |verify_result| object
// upon success. See CertVerifier::Verify() for details.
int Verify(X509Certificate* cert,
const std::string& hostname,
int flags,
CRLSet* crl_set,
CertVerifyResult* verify_result,
const CompletionCallback& callback,
const BoundNetLog& net_log);
private:
// Callback for when the request to |cert_verifier_| completes, so we
// dispatch to the user's callback.
void OnVerifyCompletion(int result);
// The actual certificate verifier that will handle the request.
CertVerifier* const cert_verifier_;
// The current request (if any).
CertVerifier::RequestHandle cur_request_;
CompletionCallback cur_request_callback_;
DISALLOW_COPY_AND_ASSIGN(SingleRequestCertVerifier);
};
} // namespace net
#endif // NET_CERT_SINGLE_REQUEST_CERT_VERIFIER_H_
|
/*
* Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#include <linux/io.h>
#include <linux/pm.h>
#include <asm/idle.h>
#include <asm/reboot.h>
#include <loongson1.h>
static void ls1x_restart(char *command)
{
__raw_writel(0x1, LS1X_WDT_EN);
__raw_writel(0x5000000, LS1X_WDT_TIMER);
__raw_writel(0x1, LS1X_WDT_SET);
}
static void ls1x_halt(void)
{
while (1) {
if (cpu_wait)
cpu_wait();
}
}
static void ls1x_power_off(void)
{
ls1x_halt();
}
static int __init ls1x_reboot_setup(void)
{
_machine_restart = ls1x_restart;
_machine_halt = ls1x_halt;
pm_power_off = ls1x_power_off;
return 0;
}
arch_initcall(ls1x_reboot_setup);
|
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_PLOT_SCALE_ITEM_H
#define QWT_PLOT_SCALE_ITEM_H
#include "qwt_global.h"
#include "qwt_plot_item.h"
#include "qwt_scale_draw.h"
class QPalette;
/*!
\brief A class which draws a scale inside the plot canvas
QwtPlotScaleItem can be used to draw an axis inside the plot canvas.
It might by synchronized to one of the axis of the plot, but can
also display its own ticks and labels.
It is allowed to synchronize the scale item with a disabled axis.
In plots with vertical and horizontal scale items, it might be
necessary to remove ticks at the intersections, by overloading
updateScaleDiv().
The scale might be at a specific position (f.e 0.0) or it might be
aligned to a canvas border.
\par Example
The following example shows how to replace the left axis, by a scale item
at the x position 0.0.
\verbatim
QwtPlotScaleItem *scaleItem =
new QwtPlotScaleItem(QwtScaleDraw::RightScale, 0.0);
scaleItem->setFont(plot->axisWidget(QwtPlot::yLeft)->font());
scaleItem->attach(plot);
plot->enableAxis(QwtPlot::yLeft, false);
\endverbatim
*/
class QWT_EXPORT QwtPlotScaleItem: public QwtPlotItem
{
public:
explicit QwtPlotScaleItem(
QwtScaleDraw::Alignment = QwtScaleDraw::BottomScale,
const double pos = 0.0 );
virtual ~QwtPlotScaleItem();
virtual int rtti() const;
void setScaleDiv( const QwtScaleDiv& );
const QwtScaleDiv& scaleDiv() const;
void setScaleDivFromAxis( bool on );
bool isScaleDivFromAxis() const;
void setPalette( const QPalette & );
QPalette palette() const;
void setFont( const QFont& );
QFont font() const;
void setScaleDraw( QwtScaleDraw * );
const QwtScaleDraw *scaleDraw() const;
QwtScaleDraw *scaleDraw();
void setPosition( double pos );
double position() const;
void setBorderDistance( int numPixels );
int borderDistance() const;
void setAlignment( QwtScaleDraw::Alignment );
virtual void draw( QPainter *p,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &rect ) const;
virtual void updateScaleDiv( const QwtScaleDiv &, const QwtScaleDiv & );
private:
class PrivateData;
PrivateData *d_data;
};
#endif
|
/* { dg-do compile } */
/* { dg-require-effective-target arm_arch_v8a_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v8a } */
#include "../aarch64/atomic-op-acquire.x"
/* { dg-final { scan-assembler-times "ldaex\tr\[0-9\]+, \\\[r\[0-9\]+\\\]" 6 } } */
/* { dg-final { scan-assembler-times "strex\t...?, r\[0-9\]+, \\\[r\[0-9\]+\\\]" 6 } } */
/* { dg-final { scan-assembler-not "dmb" } } */
|
/* { dg-options "-fpeephole2 -mtune=m14k (-mmicromips)" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
void MICROMIPS
foo (int *r4, int r5, int r6)
{
r5 *= r5;
r4[0] = r5;
r4[1] = r6;
{
register int r5asm asm ("$5") = r5;
register int r6asm asm ("$6") = r6;
asm ("#foo" : "=m" (r4[2]) : "d" (r5asm), "d" (r6asm));
}
}
/* { dg-final { scan-assembler "\tswp\t\\\$5,0\\(\\\$4\\)" } }*/
|
#ifndef _PERF_UI_HELPLINE_H_
#define _PERF_UI_HELPLINE_H_ 1
#include <stdio.h>
#include <stdarg.h>
#include "../util/cache.h"
struct ui_helpline {
void (*pop)(void);
void (*push)(const char *msg);
int (*show)(const char *fmt, va_list ap);
};
extern struct ui_helpline *helpline_fns;
void ui_helpline__init(void);
void ui_helpline__pop(void);
void ui_helpline__push(const char *msg);
void ui_helpline__vpush(const char *fmt, va_list ap);
void ui_helpline__fpush(const char *fmt, ...);
void ui_helpline__puts(const char *msg);
void ui_helpline__printf(const char *fmt, ...);
int ui_helpline__vshow(const char *fmt, va_list ap);
extern char ui_helpline__current[512];
extern char ui_helpline__last_msg[];
#endif /* _PERF_UI_HELPLINE_H_ */
|
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/usb/ch11.h>
#define TEST_SE0_NAK_PID 0x0101
#define TEST_J_PID 0x0102
#define TEST_K_PID 0x0103
#define TEST_PACKET_PID 0x0104
#define TEST_HS_HOST_PORT_SUSPEND_RESUME 0x0106
#define TEST_SINGLE_STEP_GET_DEV_DESC 0x0107
#define TEST_SINGLE_STEP_SET_FEATURE 0x0108
static int ehset_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
int ret = -EINVAL;
struct usb_device *dev = interface_to_usbdev(intf);
struct usb_device *hub_udev = dev->parent;
struct usb_device_descriptor buf;
u8 portnum = dev->portnum;
u16 test_pid = le16_to_cpu(dev->descriptor.idProduct);
switch (test_pid) {
case TEST_SE0_NAK_PID:
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE,
USB_RT_PORT, USB_PORT_FEAT_TEST,
(USB_TEST_SE0_NAK << 8) | portnum,
NULL, 0, 1000, GFP_KERNEL);
break;
case TEST_J_PID:
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE,
USB_RT_PORT, USB_PORT_FEAT_TEST,
(USB_TEST_J << 8) | portnum, NULL, 0,
1000, GFP_KERNEL);
break;
case TEST_K_PID:
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE,
USB_RT_PORT, USB_PORT_FEAT_TEST,
(USB_TEST_K << 8) | portnum, NULL, 0,
1000, GFP_KERNEL);
break;
case TEST_PACKET_PID:
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE,
USB_RT_PORT, USB_PORT_FEAT_TEST,
(USB_TEST_PACKET << 8) | portnum,
NULL, 0, 1000, GFP_KERNEL);
break;
case TEST_HS_HOST_PORT_SUSPEND_RESUME:
/* Test: wait for 15secs -> suspend -> 15secs delay -> resume */
msleep(15 * 1000);
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE,
USB_RT_PORT, USB_PORT_FEAT_SUSPEND,
portnum, NULL, 0, 1000, GFP_KERNEL);
if (ret < 0)
break;
msleep(15 * 1000);
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_CLEAR_FEATURE,
USB_RT_PORT, USB_PORT_FEAT_SUSPEND,
portnum, NULL, 0, 1000, GFP_KERNEL);
break;
case TEST_SINGLE_STEP_GET_DEV_DESC:
/* Test: wait for 15secs -> GetDescriptor request */
msleep(15 * 1000);
ret = usb_control_msg_recv(dev, 0, USB_REQ_GET_DESCRIPTOR,
USB_DIR_IN, USB_DT_DEVICE << 8, 0,
&buf, USB_DT_DEVICE_SIZE,
USB_CTRL_GET_TIMEOUT, GFP_KERNEL);
break;
case TEST_SINGLE_STEP_SET_FEATURE:
/*
* GetDescriptor SETUP request -> 15secs delay -> IN & STATUS
*
* Note, this test is only supported on root hubs since the
* SetPortFeature handling can only be done inside the HCD's
* hub_control callback function.
*/
if (hub_udev != dev->bus->root_hub) {
dev_err(&intf->dev, "SINGLE_STEP_SET_FEATURE test only supported on root hub\n");
break;
}
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE,
USB_RT_PORT, USB_PORT_FEAT_TEST,
(6 << 8) | portnum, NULL, 0,
60 * 1000, GFP_KERNEL);
break;
default:
dev_err(&intf->dev, "%s: unsupported PID: 0x%x\n",
__func__, test_pid);
}
return ret;
}
static void ehset_disconnect(struct usb_interface *intf)
{
}
static const struct usb_device_id ehset_id_table[] = {
{ USB_DEVICE(0x1a0a, TEST_SE0_NAK_PID) },
{ USB_DEVICE(0x1a0a, TEST_J_PID) },
{ USB_DEVICE(0x1a0a, TEST_K_PID) },
{ USB_DEVICE(0x1a0a, TEST_PACKET_PID) },
{ USB_DEVICE(0x1a0a, TEST_HS_HOST_PORT_SUSPEND_RESUME) },
{ USB_DEVICE(0x1a0a, TEST_SINGLE_STEP_GET_DEV_DESC) },
{ USB_DEVICE(0x1a0a, TEST_SINGLE_STEP_SET_FEATURE) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, ehset_id_table);
static struct usb_driver ehset_driver = {
.name = "usb_ehset_test",
.probe = ehset_probe,
.disconnect = ehset_disconnect,
.id_table = ehset_id_table,
};
module_usb_driver(ehset_driver);
MODULE_DESCRIPTION("USB Driver for EHSET Test Fixture");
MODULE_LICENSE("GPL v2");
|
/*
* Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org)
* Copyright (C) 1999, 2000 Silcon Graphics, Inc.
* Copyright (C) 2004 Christoph Hellwig.
* Released under GPL v2.
*
* Generic XTALK initialization code
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/smp.h>
#include <asm/sn/types.h>
#include <asm/sn/klconfig.h>
#include <asm/sn/hub.h>
#include <asm/pci/bridge.h>
#include <asm/xtalk/xtalk.h>
#define XBOW_WIDGET_PART_NUM 0x0
#define XXBOW_WIDGET_PART_NUM 0xd000 /* Xbow in Xbridge */
#define BASE_XBOW_PORT 8 /* Lowest external port */
extern int bridge_probe(nasid_t nasid, int widget, int masterwid);
static int probe_one_port(nasid_t nasid, int widget, int masterwid)
{
widgetreg_t widget_id;
xwidget_part_num_t partnum;
widget_id = *(volatile widgetreg_t *)
(RAW_NODE_SWIN_BASE(nasid, widget) + WIDGET_ID);
partnum = XWIDGET_PART_NUM(widget_id);
printk(KERN_INFO "Cpu %d, Nasid 0x%x, widget 0x%x (partnum 0x%x) is ",
smp_processor_id(), nasid, widget, partnum);
switch (partnum) {
case BRIDGE_WIDGET_PART_NUM:
case XBRIDGE_WIDGET_PART_NUM:
bridge_probe(nasid, widget, masterwid);
break;
default:
break;
}
return 0;
}
static int xbow_probe(nasid_t nasid)
{
lboard_t *brd;
klxbow_t *xbow_p;
unsigned masterwid, i;
printk("is xbow\n");
/*
* found xbow, so may have multiple bridges
* need to probe xbow
*/
brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_MIDPLANE8);
if (!brd)
return -ENODEV;
xbow_p = (klxbow_t *)find_component(brd, NULL, KLSTRUCT_XBOW);
if (!xbow_p)
return -ENODEV;
/*
* Okay, here's a xbow. Lets arbitrate and find
* out if we should initialize it. Set enabled
* hub connected at highest or lowest widget as
* master.
*/
#ifdef WIDGET_A
i = HUB_WIDGET_ID_MAX + 1;
do {
i--;
} while ((!XBOW_PORT_TYPE_HUB(xbow_p, i)) ||
(!XBOW_PORT_IS_ENABLED(xbow_p, i)));
#else
i = HUB_WIDGET_ID_MIN - 1;
do {
i++;
} while ((!XBOW_PORT_TYPE_HUB(xbow_p, i)) ||
(!XBOW_PORT_IS_ENABLED(xbow_p, i)));
#endif
masterwid = i;
if (nasid != XBOW_PORT_NASID(xbow_p, i))
return 1;
for (i = HUB_WIDGET_ID_MIN; i <= HUB_WIDGET_ID_MAX; i++) {
if (XBOW_PORT_IS_ENABLED(xbow_p, i) &&
XBOW_PORT_TYPE_IO(xbow_p, i))
probe_one_port(nasid, i, masterwid);
}
return 0;
}
void xtalk_probe_node(cnodeid_t nid)
{
volatile u64 hubreg;
nasid_t nasid;
xwidget_part_num_t partnum;
widgetreg_t widget_id;
nasid = COMPACT_TO_NASID_NODEID(nid);
hubreg = REMOTE_HUB_L(nasid, IIO_LLP_CSR);
/* check whether the link is up */
if (!(hubreg & IIO_LLP_CSR_IS_UP))
return;
widget_id = *(volatile widgetreg_t *)
(RAW_NODE_SWIN_BASE(nasid, 0x0) + WIDGET_ID);
partnum = XWIDGET_PART_NUM(widget_id);
printk(KERN_INFO "Cpu %d, Nasid 0x%x: partnum 0x%x is ",
smp_processor_id(), nasid, partnum);
switch (partnum) {
case BRIDGE_WIDGET_PART_NUM:
bridge_probe(nasid, 0x8, 0xa);
break;
case XBOW_WIDGET_PART_NUM:
case XXBOW_WIDGET_PART_NUM:
xbow_probe(nasid);
break;
default:
printk(" unknown widget??\n");
break;
}
}
|
/*
* Copyright (c) 2006 Tensilica, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2.1 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
* USA.
*/
#ifndef _XTENSA_REGS_H
#define _XTENSA_REGS_H
/* Special registers. */
#define SREG_MR 32
#define SREG_IBREAKENABLE 96
#define SREG_IBREAKA 128
#define SREG_DBREAKA 144
#define SREG_DBREAKC 160
#define SREG_EPC 176
#define SREG_EPS 192
#define SREG_EXCSAVE 208
#define SREG_CCOMPARE 240
#define SREG_MISC 244
/* EXCCAUSE register fields */
#define EXCCAUSE_EXCCAUSE_SHIFT 0
#define EXCCAUSE_EXCCAUSE_MASK 0x3F
#define EXCCAUSE_ILLEGAL_INSTRUCTION 0
#define EXCCAUSE_SYSTEM_CALL 1
#define EXCCAUSE_INSTRUCTION_FETCH_ERROR 2
#define EXCCAUSE_LOAD_STORE_ERROR 3
#define EXCCAUSE_LEVEL1_INTERRUPT 4
#define EXCCAUSE_ALLOCA 5
#define EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6
#define EXCCAUSE_SPECULATION 7
#define EXCCAUSE_PRIVILEGED 8
#define EXCCAUSE_UNALIGNED 9
#define EXCCAUSE_INSTR_DATA_ERROR 12
#define EXCCAUSE_LOAD_STORE_DATA_ERROR 13
#define EXCCAUSE_INSTR_ADDR_ERROR 14
#define EXCCAUSE_LOAD_STORE_ADDR_ERROR 15
#define EXCCAUSE_ITLB_MISS 16
#define EXCCAUSE_ITLB_MULTIHIT 17
#define EXCCAUSE_ITLB_PRIVILEGE 18
#define EXCCAUSE_ITLB_SIZE_RESTRICTION 19
#define EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20
#define EXCCAUSE_DTLB_MISS 24
#define EXCCAUSE_DTLB_MULTIHIT 25
#define EXCCAUSE_DTLB_PRIVILEGE 26
#define EXCCAUSE_DTLB_SIZE_RESTRICTION 27
#define EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28
#define EXCCAUSE_STORE_CACHE_ATTRIBUTE 29
#define EXCCAUSE_COPROCESSOR0_DISABLED 32
#define EXCCAUSE_COPROCESSOR1_DISABLED 33
#define EXCCAUSE_COPROCESSOR2_DISABLED 34
#define EXCCAUSE_COPROCESSOR3_DISABLED 35
#define EXCCAUSE_COPROCESSOR4_DISABLED 36
#define EXCCAUSE_COPROCESSOR5_DISABLED 37
#define EXCCAUSE_COPROCESSOR6_DISABLED 38
#define EXCCAUSE_COPROCESSOR7_DISABLED 39
/* PS register fields. */
#define PS_WOE_BIT 18
#define PS_CALLINC_SHIFT 16
#define PS_CALLINC_MASK 0x00030000
#define PS_OWB_SHIFT 8
#define PS_OWB_WIDTH 4
#define PS_OWB_MASK 0x00000F00
#define PS_RING_SHIFT 6
#define PS_RING_MASK 0x000000C0
#define PS_UM_BIT 5
#define PS_EXCM_BIT 4
#define PS_INTLEVEL_SHIFT 0
#define PS_INTLEVEL_WIDTH 4
#define PS_INTLEVEL_MASK 0x0000000F
/* DBREAKCn register fields. */
#define DBREAKC_MASK_BIT 0
#define DBREAKC_MASK_MASK 0x0000003F
#define DBREAKC_LOAD_BIT 30
#define DBREAKC_LOAD_MASK 0x40000000
#define DBREAKC_STOR_BIT 31
#define DBREAKC_STOR_MASK 0x80000000
/* DEBUGCAUSE register fields. */
#define DEBUGCAUSE_DBNUM_MASK 0xf00
#define DEBUGCAUSE_DBNUM_SHIFT 8 /* First bit of DBNUM field */
#define DEBUGCAUSE_DEBUGINT_BIT 5 /* External debug interrupt */
#define DEBUGCAUSE_BREAKN_BIT 4 /* BREAK.N instruction */
#define DEBUGCAUSE_BREAK_BIT 3 /* BREAK instruction */
#define DEBUGCAUSE_DBREAK_BIT 2 /* DBREAK match */
#define DEBUGCAUSE_IBREAK_BIT 1 /* IBREAK match */
#define DEBUGCAUSE_ICOUNT_BIT 0 /* ICOUNT would incr. to zero */
#endif /* _XTENSA_SPECREG_H */
|
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* bpf_jit64.h: BPF JIT compiler for PPC64
*
* Copyright 2016 Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
* IBM Corporation
*/
#ifndef _BPF_JIT64_H
#define _BPF_JIT64_H
#include "bpf_jit.h"
/*
* Stack layout:
* Ensure the top half (upto local_tmp_var) stays consistent
* with our redzone usage.
*
* [ prev sp ] <-------------
* [ nv gpr save area ] 6*8 |
* [ tail_call_cnt ] 8 |
* [ local_tmp_var ] 8 |
* fp (r31) --> [ ebpf stack space ] upto 512 |
* [ frame header ] 32/112 |
* sp (r1) ---> [ stack pointer ] --------------
*/
/* for gpr non volatile registers BPG_REG_6 to 10 */
#define BPF_PPC_STACK_SAVE (6*8)
/* for bpf JIT code internal usage */
#define BPF_PPC_STACK_LOCALS 16
/* stack frame excluding BPF stack, ensure this is quadword aligned */
#define BPF_PPC_STACKFRAME (STACK_FRAME_MIN_SIZE + \
BPF_PPC_STACK_LOCALS + BPF_PPC_STACK_SAVE)
#ifndef __ASSEMBLY__
/* BPF register usage */
#define TMP_REG_1 (MAX_BPF_JIT_REG + 0)
#define TMP_REG_2 (MAX_BPF_JIT_REG + 1)
/* BPF to ppc register mappings */
static const int b2p[] = {
/* function return value */
[BPF_REG_0] = 8,
/* function arguments */
[BPF_REG_1] = 3,
[BPF_REG_2] = 4,
[BPF_REG_3] = 5,
[BPF_REG_4] = 6,
[BPF_REG_5] = 7,
/* non volatile registers */
[BPF_REG_6] = 27,
[BPF_REG_7] = 28,
[BPF_REG_8] = 29,
[BPF_REG_9] = 30,
/* frame pointer aka BPF_REG_10 */
[BPF_REG_FP] = 31,
/* eBPF jit internal registers */
[BPF_REG_AX] = 2,
[TMP_REG_1] = 9,
[TMP_REG_2] = 10
};
/* PPC NVR range -- update this if we ever use NVRs below r27 */
#define BPF_PPC_NVR_MIN 27
/*
* WARNING: These can use TMP_REG_2 if the offset is not at word boundary,
* so ensure that it isn't in use already.
*/
#define PPC_BPF_LL(r, base, i) do { \
if ((i) % 4) { \
PPC_LI(b2p[TMP_REG_2], (i)); \
PPC_LDX(r, base, b2p[TMP_REG_2]); \
} else \
PPC_LD(r, base, i); \
} while(0)
#define PPC_BPF_STL(r, base, i) do { \
if ((i) % 4) { \
PPC_LI(b2p[TMP_REG_2], (i)); \
PPC_STDX(r, base, b2p[TMP_REG_2]); \
} else \
PPC_STD(r, base, i); \
} while(0)
#define PPC_BPF_STLU(r, base, i) do { PPC_STDU(r, base, i); } while(0)
#define SEEN_FUNC 0x1000 /* might call external helpers */
#define SEEN_STACK 0x2000 /* uses BPF stack */
#define SEEN_TAILCALL 0x4000 /* uses tail calls */
struct codegen_context {
/*
* This is used to track register usage as well
* as calls to external helpers.
* - register usage is tracked with corresponding
* bits (r3-r10 and r27-r31)
* - rest of the bits can be used to track other
* things -- for now, we use bits 16 to 23
* encoded in SEEN_* macros above
*/
unsigned int seen;
unsigned int idx;
unsigned int stack_size;
};
#endif /* !__ASSEMBLY__ */
#endif
|
/* { dg-do compile } */
/* { dg-require-alias "" } */
/* { dg-options "-O2" } */
static void f (void) __attribute__((alias("g"))); static void g (void) __attribute__((alias("f"))); // { dg-error "part of alias cycle" "" }
void h ()
{
f ();
}
|
/* $Id: sph_blake.h 252 2011-06-07 17:55:14Z tp $ */
/**
* BLAKE interface. BLAKE is a family of functions which differ by their
* output size; this implementation defines BLAKE for output sizes 224,
* 256, 384 and 512 bits. This implementation conforms to the "third
* round" specification.
*
* ==========================(LICENSE BEGIN)============================
*
* Copyright (c) 2007-2010 Projet RNRT SAPHIR
*
* 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.
*
* ===========================(LICENSE END)=============================
*
* @file sph_blake.h
* @author Thomas Pornin <thomas.pornin@cryptolog.com>
*/
#ifndef SPH_BLAKE_H__
#define SPH_BLAKE_H__
#ifdef __cplusplus
extern "C"{
#endif
#include <stddef.h>
#include "sph_types.h"
/*define data alignment for different C compilers*/
#if defined(__GNUC__)
#define DATA_ALIGN16(x) x __attribute__ ((aligned(16)))
#else
#define DATA_ALIGN16(x) __declspec(align(16)) x
#endif
/**
* Output size (in bits) for BLAKE-512.
*/
#define SPH_SIZE_blake512 512
/**
* This structure is a context for BLAKE-384 and BLAKE-512 computations:
* it contains the intermediate values and some data from the last
* entered block. Once a BLAKE computation has been performed, the
* context can be reused for another computation.
*
* The contents of this structure are private. A running BLAKE
* computation can be cloned by copying the context (e.g. with a simple
* <code>memcpy()</code>).
*/
typedef struct {
#ifndef DOXYGEN_IGNORE
DATA_ALIGN16(sph_u64 blkH[8]);
DATA_ALIGN16(sph_u64 blkS[4]);
#endif
} sph_blake_big_context;
/**
* This structure is a context for BLAKE-512 computations. It is
*/
typedef sph_blake_big_context sph_blake512_context;
#ifdef __cplusplus
}
#endif
#endif
|
/*
* Copyright (C) 2005, 2006, 2007 Apple, Inc. All rights reserved.
* (C) 2007 Graham Dennis (graham.dennis@gmail.com)
* (C) 2007 Eric Seidel <eric@webkit.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void makeLargeMallocFailSilently();
|
/*
* Copyright 2017 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "vmm.h"
static const struct nvkm_vmm_func
gp10b_vmm = {
.join = gp100_vmm_join,
.part = gf100_vmm_part,
.aper = gk20a_vmm_aper,
.valid = gp100_vmm_valid,
.flush = gp100_vmm_flush,
.page = {
{ 47, &gp100_vmm_desc_16[4], NVKM_VMM_PAGE_Sxxx },
{ 38, &gp100_vmm_desc_16[3], NVKM_VMM_PAGE_Sxxx },
{ 29, &gp100_vmm_desc_16[2], NVKM_VMM_PAGE_Sxxx },
{ 21, &gp100_vmm_desc_16[1], NVKM_VMM_PAGE_SxHC },
{ 16, &gp100_vmm_desc_16[0], NVKM_VMM_PAGE_SxHC },
{ 12, &gp100_vmm_desc_12[0], NVKM_VMM_PAGE_SxHx },
{}
}
};
int
gp10b_vmm_new(struct nvkm_mmu *mmu, u64 addr, u64 size, void *argv, u32 argc,
struct lock_class_key *key, const char *name,
struct nvkm_vmm **pvmm)
{
return nv04_vmm_new_(&gp10b_vmm, mmu, 0, addr, size,
argv, argc, key, name, pvmm);
}
|
/*
* intel-mid_wdt: generic Intel MID SCU watchdog driver
*
* Platforms supported so far:
* - Merrifield only
*
* Copyright (C) 2014 Intel Corporation. All rights reserved.
* Contact: David Cohen <david.a.cohen@linux.intel.com>
*
* 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.
*/
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/nmi.h>
#include <linux/platform_device.h>
#include <linux/watchdog.h>
#include <linux/platform_data/intel-mid_wdt.h>
#include <asm/intel_scu_ipc.h>
#include <asm/intel-mid.h>
#define IPC_WATCHDOG 0xf8
#define MID_WDT_PRETIMEOUT 15
#define MID_WDT_TIMEOUT_MIN (1 + MID_WDT_PRETIMEOUT)
#define MID_WDT_TIMEOUT_MAX 170
#define MID_WDT_DEFAULT_TIMEOUT 90
/* SCU watchdog messages */
enum {
SCU_WATCHDOG_START = 0,
SCU_WATCHDOG_STOP,
SCU_WATCHDOG_KEEPALIVE,
};
static inline int wdt_command(int sub, u32 *in, int inlen)
{
return intel_scu_ipc_command(IPC_WATCHDOG, sub, in, inlen, NULL, 0);
}
static int wdt_start(struct watchdog_device *wd)
{
int ret, in_size;
int timeout = wd->timeout;
struct ipc_wd_start {
u32 pretimeout;
u32 timeout;
} ipc_wd_start = { timeout - MID_WDT_PRETIMEOUT, timeout };
/*
* SCU expects the input size for watchdog IPC to
* be based on 4 bytes
*/
in_size = DIV_ROUND_UP(sizeof(ipc_wd_start), 4);
ret = wdt_command(SCU_WATCHDOG_START, (u32 *)&ipc_wd_start, in_size);
if (ret) {
struct device *dev = watchdog_get_drvdata(wd);
dev_crit(dev, "error starting watchdog: %d\n", ret);
}
return ret;
}
static int wdt_ping(struct watchdog_device *wd)
{
int ret;
ret = wdt_command(SCU_WATCHDOG_KEEPALIVE, NULL, 0);
if (ret) {
struct device *dev = watchdog_get_drvdata(wd);
dev_crit(dev, "Error executing keepalive: 0x%x\n", ret);
}
return ret;
}
static int wdt_stop(struct watchdog_device *wd)
{
int ret;
ret = wdt_command(SCU_WATCHDOG_STOP, NULL, 0);
if (ret) {
struct device *dev = watchdog_get_drvdata(wd);
dev_crit(dev, "Error stopping watchdog: 0x%x\n", ret);
}
return ret;
}
static irqreturn_t mid_wdt_irq(int irq, void *dev_id)
{
panic("Kernel Watchdog");
/* This code should not be reached */
return IRQ_HANDLED;
}
static const struct watchdog_info mid_wdt_info = {
.identity = "Intel MID SCU watchdog",
.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT,
};
static const struct watchdog_ops mid_wdt_ops = {
.owner = THIS_MODULE,
.start = wdt_start,
.stop = wdt_stop,
.ping = wdt_ping,
};
static int mid_wdt_probe(struct platform_device *pdev)
{
struct watchdog_device *wdt_dev;
struct intel_mid_wdt_pdata *pdata = pdev->dev.platform_data;
int ret;
if (!pdata) {
dev_err(&pdev->dev, "missing platform data\n");
return -EINVAL;
}
if (pdata->probe) {
ret = pdata->probe(pdev);
if (ret)
return ret;
}
wdt_dev = devm_kzalloc(&pdev->dev, sizeof(*wdt_dev), GFP_KERNEL);
if (!wdt_dev)
return -ENOMEM;
wdt_dev->info = &mid_wdt_info;
wdt_dev->ops = &mid_wdt_ops;
wdt_dev->min_timeout = MID_WDT_TIMEOUT_MIN;
wdt_dev->max_timeout = MID_WDT_TIMEOUT_MAX;
wdt_dev->timeout = MID_WDT_DEFAULT_TIMEOUT;
watchdog_set_drvdata(wdt_dev, &pdev->dev);
platform_set_drvdata(pdev, wdt_dev);
ret = devm_request_irq(&pdev->dev, pdata->irq, mid_wdt_irq,
IRQF_SHARED | IRQF_NO_SUSPEND, "watchdog",
wdt_dev);
if (ret) {
dev_err(&pdev->dev, "error requesting warning irq %d\n",
pdata->irq);
return ret;
}
ret = watchdog_register_device(wdt_dev);
if (ret) {
dev_err(&pdev->dev, "error registering watchdog device\n");
return ret;
}
dev_info(&pdev->dev, "Intel MID watchdog device probed\n");
return 0;
}
static int mid_wdt_remove(struct platform_device *pdev)
{
struct watchdog_device *wd = platform_get_drvdata(pdev);
watchdog_unregister_device(wd);
return 0;
}
static struct platform_driver mid_wdt_driver = {
.probe = mid_wdt_probe,
.remove = mid_wdt_remove,
.driver = {
.name = "intel_mid_wdt",
},
};
module_platform_driver(mid_wdt_driver);
MODULE_AUTHOR("David Cohen <david.a.cohen@linux.intel.com>");
MODULE_DESCRIPTION("Watchdog Driver for Intel MID platform");
MODULE_LICENSE("GPL");
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __java_awt_Button__
#define __java_awt_Button__
#pragma interface
#include <java/awt/Component.h>
#include <gcj/array.h>
extern "Java"
{
namespace java
{
namespace awt
{
class AWTEvent;
class Button;
namespace event
{
class ActionEvent;
class ActionListener;
}
}
}
namespace javax
{
namespace accessibility
{
class AccessibleContext;
}
}
}
class java::awt::Button : public ::java::awt::Component
{
public:
Button();
Button(::java::lang::String *);
virtual ::java::lang::String * getLabel();
virtual void setLabel(::java::lang::String *);
virtual ::java::lang::String * getActionCommand();
virtual void setActionCommand(::java::lang::String *);
virtual void addActionListener(::java::awt::event::ActionListener *);
virtual void removeActionListener(::java::awt::event::ActionListener *);
virtual JArray< ::java::awt::event::ActionListener * > * getActionListeners();
virtual JArray< ::java::util::EventListener * > * getListeners(::java::lang::Class *);
virtual void addNotify();
public: // actually protected
virtual void processEvent(::java::awt::AWTEvent *);
virtual void processActionEvent(::java::awt::event::ActionEvent *);
public: // actually package-private
virtual void dispatchEventImpl(::java::awt::AWTEvent *);
public: // actually protected
virtual ::java::lang::String * paramString();
public:
virtual ::javax::accessibility::AccessibleContext * getAccessibleContext();
public: // actually package-private
virtual ::java::lang::String * generateName();
private:
static jlong getUniqueLong();
static const jlong serialVersionUID = -8774683716313001058LL;
public: // actually package-private
::java::lang::String * __attribute__((aligned(__alignof__( ::java::awt::Component)))) actionCommand;
::java::lang::String * label;
private:
::java::awt::event::ActionListener * action_listeners;
static jlong next_button_number;
public:
static ::java::lang::Class class$;
};
#endif // __java_awt_Button__
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* POWER Data Stream Control Register (DSCR) explicit test
*
* This test modifies the DSCR value using mtspr instruction and
* verifies the change with mfspr instruction. It uses both the
* privilege state SPR and the problem state SPR for this purpose.
*
* When using the privilege state SPR, the instructions such as
* mfspr or mtspr are priviledged and the kernel emulates them
* for us. Instructions using problem state SPR can be exuecuted
* directly without any emulation if the HW supports them. Else
* they also get emulated by the kernel.
*
* Copyright 2012, Anton Blanchard, IBM Corporation.
* Copyright 2015, Anshuman Khandual, IBM Corporation.
*/
#include "dscr.h"
int dscr_explicit(void)
{
unsigned long i, dscr = 0;
srand(getpid());
set_dscr(dscr);
for (i = 0; i < COUNT; i++) {
unsigned long cur_dscr, cur_dscr_usr;
double ret = uniform_deviate(rand());
if (ret < 0.001) {
dscr++;
if (dscr > DSCR_MAX)
dscr = 0;
set_dscr(dscr);
}
cur_dscr = get_dscr();
if (cur_dscr != dscr) {
fprintf(stderr, "Kernel DSCR should be %ld but "
"is %ld\n", dscr, cur_dscr);
return 1;
}
ret = uniform_deviate(rand());
if (ret < 0.001) {
dscr++;
if (dscr > DSCR_MAX)
dscr = 0;
set_dscr_usr(dscr);
}
cur_dscr_usr = get_dscr_usr();
if (cur_dscr_usr != dscr) {
fprintf(stderr, "User DSCR should be %ld but "
"is %ld\n", dscr, cur_dscr_usr);
return 1;
}
}
return 0;
}
int main(int argc, char *argv[])
{
return test_harness(dscr_explicit, "dscr_explicit_test");
}
|
/* -fstack-limit should be rejected without an ICE. */
/* { dg-do compile } */
/* { dg-options "-fstack-limit" } */
/* { dg-error "unrecognized command line option" "" { target *-*-* } 0 } */
|
/*
* arch/arm/mach-orion5x/wnr854t-setup.c
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#include <linux/gpio.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/pci.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <linux/mtd/physmap.h>
#include <linux/mv643xx_eth.h>
#include <linux/ethtool.h>
#include <net/dsa.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/pci.h>
#include "orion5x.h"
#include "common.h"
#include "mpp.h"
static unsigned int wnr854t_mpp_modes[] __initdata = {
MPP0_GPIO, /* Power LED green (0=on) */
MPP1_GPIO, /* Reset Button (0=off) */
MPP2_GPIO, /* Power LED blink (0=off) */
MPP3_GPIO, /* WAN Status LED amber (0=off) */
MPP4_GPIO, /* PCI int */
MPP5_GPIO, /* ??? */
MPP6_GPIO, /* ??? */
MPP7_GPIO, /* ??? */
MPP8_UNUSED, /* ??? */
MPP9_GIGE, /* GE_RXERR */
MPP10_UNUSED, /* ??? */
MPP11_UNUSED, /* ??? */
MPP12_GIGE, /* GE_TXD[4] */
MPP13_GIGE, /* GE_TXD[5] */
MPP14_GIGE, /* GE_TXD[6] */
MPP15_GIGE, /* GE_TXD[7] */
MPP16_GIGE, /* GE_RXD[4] */
MPP17_GIGE, /* GE_RXD[5] */
MPP18_GIGE, /* GE_RXD[6] */
MPP19_GIGE, /* GE_RXD[7] */
0,
};
/*
* 8M NOR flash Device bus boot chip select
*/
#define WNR854T_NOR_BOOT_BASE 0xf4000000
#define WNR854T_NOR_BOOT_SIZE SZ_8M
static struct mtd_partition wnr854t_nor_flash_partitions[] = {
{
.name = "kernel",
.offset = 0x00000000,
.size = 0x00100000,
}, {
.name = "rootfs",
.offset = 0x00100000,
.size = 0x00660000,
}, {
.name = "uboot",
.offset = 0x00760000,
.size = 0x00040000,
},
};
static struct physmap_flash_data wnr854t_nor_flash_data = {
.width = 2,
.parts = wnr854t_nor_flash_partitions,
.nr_parts = ARRAY_SIZE(wnr854t_nor_flash_partitions),
};
static struct resource wnr854t_nor_flash_resource = {
.flags = IORESOURCE_MEM,
.start = WNR854T_NOR_BOOT_BASE,
.end = WNR854T_NOR_BOOT_BASE + WNR854T_NOR_BOOT_SIZE - 1,
};
static struct platform_device wnr854t_nor_flash = {
.name = "physmap-flash",
.id = 0,
.dev = {
.platform_data = &wnr854t_nor_flash_data,
},
.num_resources = 1,
.resource = &wnr854t_nor_flash_resource,
};
static struct mv643xx_eth_platform_data wnr854t_eth_data = {
.phy_addr = MV643XX_ETH_PHY_NONE,
.speed = SPEED_1000,
.duplex = DUPLEX_FULL,
};
static struct dsa_chip_data wnr854t_switch_chip_data = {
.port_names[0] = "lan3",
.port_names[1] = "lan4",
.port_names[2] = "wan",
.port_names[3] = "cpu",
.port_names[5] = "lan1",
.port_names[7] = "lan2",
};
static struct dsa_platform_data wnr854t_switch_plat_data = {
.nr_chips = 1,
.chip = &wnr854t_switch_chip_data,
};
static void __init wnr854t_init(void)
{
/*
* Setup basic Orion functions. Need to be called early.
*/
orion5x_init();
orion5x_mpp_conf(wnr854t_mpp_modes);
/*
* Configure peripherals.
*/
orion5x_eth_init(&wnr854t_eth_data);
orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
orion5x_uart0_init();
mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
ORION_MBUS_DEVBUS_BOOT_ATTR,
WNR854T_NOR_BOOT_BASE,
WNR854T_NOR_BOOT_SIZE);
platform_device_register(&wnr854t_nor_flash);
}
static int __init wnr854t_pci_map_irq(const struct pci_dev *dev, u8 slot,
u8 pin)
{
int irq;
/*
* Check for devices with hard-wired IRQs.
*/
irq = orion5x_pci_map_irq(dev, slot, pin);
if (irq != -1)
return irq;
/*
* Mini-PCI slot.
*/
if (slot == 7)
return gpio_to_irq(4);
return -1;
}
static struct hw_pci wnr854t_pci __initdata = {
.nr_controllers = 2,
.setup = orion5x_pci_sys_setup,
.scan = orion5x_pci_sys_scan_bus,
.map_irq = wnr854t_pci_map_irq,
};
static int __init wnr854t_pci_init(void)
{
if (machine_is_wnr854t())
pci_common_init(&wnr854t_pci);
return 0;
}
subsys_initcall(wnr854t_pci_init);
MACHINE_START(WNR854T, "Netgear WNR854T")
/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
.atag_offset = 0x100,
.nr_irqs = ORION5X_NR_IRQS,
.init_machine = wnr854t_init,
.map_io = orion5x_map_io,
.init_early = orion5x_init_early,
.init_irq = orion5x_init_irq,
.init_time = orion5x_timer_init,
.fixup = tag_fixup_mem32,
.restart = orion5x_restart,
MACHINE_END
|
/*
* RNDIS Definitions for Remote NDIS
*
* Authors: Benedikt Spranger, Pengutronix
* Robert Schwebel, Pengutronix
*
* 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 software was originally developed in conformance with
* Microsoft's Remote NDIS Specification License Agreement.
*/
#ifndef _LINUX_RNDIS_H
#define _LINUX_RNDIS_H
#include <linux/rndis.h>
#include "ndis.h"
#define RNDIS_MAXIMUM_FRAME_SIZE 1518
#define RNDIS_MAX_TOTAL_SIZE 1558
typedef struct rndis_init_msg_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 RequestID;
__le32 MajorVersion;
__le32 MinorVersion;
__le32 MaxTransferSize;
} rndis_init_msg_type;
typedef struct rndis_init_cmplt_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 RequestID;
__le32 Status;
__le32 MajorVersion;
__le32 MinorVersion;
__le32 DeviceFlags;
__le32 Medium;
__le32 MaxPacketsPerTransfer;
__le32 MaxTransferSize;
__le32 PacketAlignmentFactor;
__le32 AFListOffset;
__le32 AFListSize;
} rndis_init_cmplt_type;
typedef struct rndis_halt_msg_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 RequestID;
} rndis_halt_msg_type;
typedef struct rndis_query_msg_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 RequestID;
__le32 OID;
__le32 InformationBufferLength;
__le32 InformationBufferOffset;
__le32 DeviceVcHandle;
} rndis_query_msg_type;
typedef struct rndis_query_cmplt_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 RequestID;
__le32 Status;
__le32 InformationBufferLength;
__le32 InformationBufferOffset;
} rndis_query_cmplt_type;
typedef struct rndis_set_msg_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 RequestID;
__le32 OID;
__le32 InformationBufferLength;
__le32 InformationBufferOffset;
__le32 DeviceVcHandle;
} rndis_set_msg_type;
typedef struct rndis_set_cmplt_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 RequestID;
__le32 Status;
} rndis_set_cmplt_type;
typedef struct rndis_reset_msg_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 Reserved;
} rndis_reset_msg_type;
typedef struct rndis_reset_cmplt_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 Status;
__le32 AddressingReset;
} rndis_reset_cmplt_type;
typedef struct rndis_indicate_status_msg_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 Status;
__le32 StatusBufferLength;
__le32 StatusBufferOffset;
} rndis_indicate_status_msg_type;
typedef struct rndis_keepalive_msg_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 RequestID;
} rndis_keepalive_msg_type;
typedef struct rndis_keepalive_cmplt_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 RequestID;
__le32 Status;
} rndis_keepalive_cmplt_type;
struct rndis_packet_msg_type
{
__le32 MessageType;
__le32 MessageLength;
__le32 DataOffset;
__le32 DataLength;
__le32 OOBDataOffset;
__le32 OOBDataLength;
__le32 NumOOBDataElements;
__le32 PerPacketInfoOffset;
__le32 PerPacketInfoLength;
__le32 VcHandle;
__le32 Reserved;
} __attribute__ ((packed));
struct rndis_config_parameter
{
__le32 ParameterNameOffset;
__le32 ParameterNameLength;
__le32 ParameterType;
__le32 ParameterValueOffset;
__le32 ParameterValueLength;
};
/* implementation specific */
enum rndis_state
{
RNDIS_UNINITIALIZED,
RNDIS_INITIALIZED,
RNDIS_DATA_INITIALIZED,
};
typedef struct rndis_resp_t
{
struct list_head list;
u8 *buf;
u32 length;
int send;
} rndis_resp_t;
typedef struct rndis_params
{
u8 confignr;
u8 used;
u16 saved_filter;
enum rndis_state state;
u32 medium;
u32 speed;
u32 media_state;
const u8 *host_mac;
u16 *filter;
struct net_device *dev;
u32 vendorID;
u8 max_pkt_per_xfer;
u8 pkt_alignment_factor;
const char *vendorDescr;
void (*resp_avail)(void *v);
void *v;
struct list_head resp_queue;
spinlock_t lock;
u32 host_rndis_major_ver;
u32 host_rndis_minor_ver;
u32 ul_max_xfer_size;
u32 dl_max_xfer_size;
} rndis_params;
/* RNDIS Message parser and other useless functions */
int rndis_msg_parser (u8 configNr, u8 *buf);
int rndis_register(void (*resp_avail)(void *v), void *v);
void rndis_deregister (int configNr);
int rndis_set_param_dev (u8 configNr, struct net_device *dev,
u16 *cdc_filter);
int rndis_set_param_vendor (u8 configNr, u32 vendorID,
const char *vendorDescr);
int rndis_set_param_medium (u8 configNr, u32 medium, u32 speed);
void rndis_set_max_pkt_xfer(u8 configNr, u8 max_pkt_per_xfer);
u32 rndis_get_ul_max_xfer_size(u8 configNr);
u32 rndis_get_dl_max_xfer_size(u8 configNr);
void rndis_add_hdr (struct sk_buff *skb);
int rndis_rm_hdr(struct gether *port, struct sk_buff *skb,
struct sk_buff_head *list);
u8 *rndis_get_next_response (int configNr, u32 *length);
void rndis_free_response (int configNr, u8 *buf);
void rndis_uninit (int configNr);
int rndis_signal_connect (int configNr);
int rndis_signal_disconnect (int configNr);
int rndis_state (int configNr);
extern void rndis_set_host_mac (int configNr, const u8 *addr);
extern bool is_rndis_ipa_supported(void);
int rndis_init(void);
void rndis_exit (void);
#endif /* _LINUX_RNDIS_H */
|
/* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2018 Renesas Electronics Corp.
*/
#ifndef __DT_BINDINGS_POWER_R8A77470_SYSC_H__
#define __DT_BINDINGS_POWER_R8A77470_SYSC_H__
/*
* These power domain indices match the numbers of the interrupt bits
* representing the power areas in the various Interrupt Registers
* (e.g. SYSCISR, Interrupt Status Register)
*/
#define R8A77470_PD_CA7_CPU0 5
#define R8A77470_PD_CA7_CPU1 6
#define R8A77470_PD_SGX 20
#define R8A77470_PD_CA7_SCU 21
/* Always-on power area */
#define R8A77470_PD_ALWAYS_ON 32
#endif /* __DT_BINDINGS_POWER_R8A77470_SYSC_H__ */
|
/*---------------------------------------------------------------------------+
| fpu_tags.c |
| |
| Set FPU register tags. |
| |
| Copyright (C) 1997 |
| W. Metzenthen, 22 Parker St, Ormond, Vic 3163, Australia |
| E-mail billm@jacobi.maths.monash.edu.au |
| |
| |
+---------------------------------------------------------------------------*/
#include "fpu_emu.h"
#include "fpu_system.h"
#include "exception.h"
void FPU_pop(void)
{
fpu_tag_word |= 3 << ((top & 7)*2);
top++;
}
int FPU_gettag0(void)
{
return (fpu_tag_word >> ((top & 7)*2)) & 3;
}
int FPU_gettagi(int stnr)
{
return (fpu_tag_word >> (((top+stnr) & 7)*2)) & 3;
}
int FPU_gettag(int regnr)
{
return (fpu_tag_word >> ((regnr & 7)*2)) & 3;
}
void FPU_settag0(int tag)
{
int regnr = top;
regnr &= 7;
fpu_tag_word &= ~(3 << (regnr*2));
fpu_tag_word |= (tag & 3) << (regnr*2);
}
void FPU_settagi(int stnr, int tag)
{
int regnr = stnr+top;
regnr &= 7;
fpu_tag_word &= ~(3 << (regnr*2));
fpu_tag_word |= (tag & 3) << (regnr*2);
}
void FPU_settag(int regnr, int tag)
{
regnr &= 7;
fpu_tag_word &= ~(3 << (regnr*2));
fpu_tag_word |= (tag & 3) << (regnr*2);
}
int FPU_Special(FPU_REG const *ptr)
{
int exp = exponent(ptr);
if ( exp == EXP_BIAS+EXP_UNDER )
return TW_Denormal;
else if ( exp != EXP_BIAS+EXP_OVER )
return TW_NaN;
else if ( (ptr->sigh == 0x80000000) && (ptr->sigl == 0) )
return TW_Infinity;
return TW_NaN;
}
int isNaN(FPU_REG const *ptr)
{
return ( (exponent(ptr) == EXP_BIAS+EXP_OVER)
&& !((ptr->sigh == 0x80000000) && (ptr->sigl == 0)) );
}
int FPU_empty_i(int stnr)
{
int regnr = (top+stnr) & 7;
return ((fpu_tag_word >> (regnr*2)) & 3) == TAG_Empty;
}
int FPU_stackoverflow(FPU_REG **st_new_ptr)
{
*st_new_ptr = &st(-1);
return ((fpu_tag_word >> (((top - 1) & 7)*2)) & 3) != TAG_Empty;
}
void FPU_copy_to_regi(FPU_REG const *r, u_char tag, int stnr)
{
reg_copy(r, &st(stnr));
FPU_settagi(stnr, tag);
}
void FPU_copy_to_reg1(FPU_REG const *r, u_char tag)
{
reg_copy(r, &st(1));
FPU_settagi(1, tag);
}
void FPU_copy_to_reg0(FPU_REG const *r, u_char tag)
{
int regnr = top;
regnr &= 7;
reg_copy(r, &st(0));
fpu_tag_word &= ~(3 << (regnr*2));
fpu_tag_word |= (tag & 3) << (regnr*2);
}
|
/* { dg-do compile } */
void foo (int *, int *);
int bar ()
{
int a = 0;
int b = 0;
if (b != 0)
{
int ax = a;
int bx = b;
while (bx != 0)
{
int tem = ax % bx;
ax = bx;
bx = tem;
}
}
foo (&a, &b);
}
|
#ifndef __PERF_SORT_H
#define __PERF_SORT_H
#include "../builtin.h"
#include "util.h"
#include "color.h"
#include <linux/list.h>
#include "cache.h"
#include <linux/rbtree.h>
#include "symbol.h"
#include "string.h"
#include "callchain.h"
#include "strlist.h"
#include "values.h"
#include "../perf.h"
#include "debug.h"
#include "header.h"
#include "parse-options.h"
#include "parse-events.h"
#include "hist.h"
#include "thread.h"
extern regex_t parent_regex;
extern const char *sort_order;
extern const char *field_order;
extern const char default_parent_pattern[];
extern const char *parent_pattern;
extern const char default_sort_order[];
extern regex_t ignore_callees_regex;
extern int have_ignore_callees;
extern int sort__need_collapse;
extern int sort__has_parent;
extern int sort__has_sym;
extern enum sort_mode sort__mode;
extern struct sort_entry sort_comm;
extern struct sort_entry sort_dso;
extern struct sort_entry sort_sym;
extern struct sort_entry sort_parent;
extern struct sort_entry sort_dso_from;
extern struct sort_entry sort_dso_to;
extern struct sort_entry sort_sym_from;
extern struct sort_entry sort_sym_to;
extern enum sort_type sort__first_dimension;
extern const char default_mem_sort_order[];
struct he_stat {
u64 period;
u64 period_sys;
u64 period_us;
u64 period_guest_sys;
u64 period_guest_us;
u64 weight;
u32 nr_events;
};
struct hist_entry_diff {
bool computed;
union {
/* PERF_HPP__DELTA */
double period_ratio_delta;
/* PERF_HPP__RATIO */
double period_ratio;
/* HISTC_WEIGHTED_DIFF */
s64 wdiff;
};
};
/**
* struct hist_entry - histogram entry
*
* @row_offset - offset from the first callchain expanded to appear on screen
* @nr_rows - rows expanded in callchain, recalculated on folding/unfolding
*/
struct hist_entry {
struct rb_node rb_node_in;
struct rb_node rb_node;
union {
struct list_head node;
struct list_head head;
} pairs;
struct he_stat stat;
struct he_stat *stat_acc;
struct map_symbol ms;
struct thread *thread;
struct comm *comm;
u64 ip;
u64 transaction;
s32 cpu;
u8 cpumode;
/* We are added by hists__add_dummy_entry. */
bool dummy;
char level;
u8 filtered;
union {
/*
* Since perf diff only supports the stdio output, TUI
* fields are only accessed from perf report (or perf
* top). So make it an union to reduce memory usage.
*/
struct hist_entry_diff diff;
struct /* for TUI */ {
u16 row_offset;
u16 nr_rows;
bool init_have_children;
bool unfolded;
bool has_children;
};
};
char *srcline;
struct symbol *parent;
struct rb_root sorted_chain;
struct branch_info *branch_info;
struct hists *hists;
struct mem_info *mem_info;
struct callchain_root callchain[0]; /* must be last member */
};
static inline bool hist_entry__has_pairs(struct hist_entry *he)
{
return !list_empty(&he->pairs.node);
}
static inline struct hist_entry *hist_entry__next_pair(struct hist_entry *he)
{
if (hist_entry__has_pairs(he))
return list_entry(he->pairs.node.next, struct hist_entry, pairs.node);
return NULL;
}
static inline void hist_entry__add_pair(struct hist_entry *pair,
struct hist_entry *he)
{
list_add_tail(&pair->pairs.node, &he->pairs.head);
}
static inline float hist_entry__get_percent_limit(struct hist_entry *he)
{
u64 period = he->stat.period;
u64 total_period = hists__total_period(he->hists);
if (unlikely(total_period == 0))
return 0;
if (symbol_conf.cumulate_callchain)
period = he->stat_acc->period;
return period * 100.0 / total_period;
}
enum sort_mode {
SORT_MODE__NORMAL,
SORT_MODE__BRANCH,
SORT_MODE__MEMORY,
SORT_MODE__TOP,
SORT_MODE__DIFF,
};
enum sort_type {
/* common sort keys */
SORT_PID,
SORT_COMM,
SORT_DSO,
SORT_SYM,
SORT_PARENT,
SORT_CPU,
SORT_SRCLINE,
SORT_LOCAL_WEIGHT,
SORT_GLOBAL_WEIGHT,
SORT_TRANSACTION,
/* branch stack specific sort keys */
__SORT_BRANCH_STACK,
SORT_DSO_FROM = __SORT_BRANCH_STACK,
SORT_DSO_TO,
SORT_SYM_FROM,
SORT_SYM_TO,
SORT_MISPREDICT,
SORT_ABORT,
SORT_IN_TX,
/* memory mode specific sort keys */
__SORT_MEMORY_MODE,
SORT_MEM_DADDR_SYMBOL = __SORT_MEMORY_MODE,
SORT_MEM_DADDR_DSO,
SORT_MEM_LOCKED,
SORT_MEM_TLB,
SORT_MEM_LVL,
SORT_MEM_SNOOP,
SORT_MEM_DCACHELINE,
};
/*
* configurable sorting bits
*/
struct sort_entry {
struct list_head list;
const char *se_header;
int64_t (*se_cmp)(struct hist_entry *, struct hist_entry *);
int64_t (*se_collapse)(struct hist_entry *, struct hist_entry *);
int64_t (*se_sort)(struct hist_entry *, struct hist_entry *);
int (*se_snprintf)(struct hist_entry *he, char *bf, size_t size,
unsigned int width);
u8 se_width_idx;
};
extern struct sort_entry sort_thread;
extern struct list_head hist_entry__sort_list;
int setup_sorting(void);
int setup_output_field(void);
void reset_output_field(void);
extern int sort_dimension__add(const char *);
void sort__setup_elide(FILE *fp);
void perf_hpp__set_elide(int idx, bool elide);
int report_parse_ignore_callees_opt(const struct option *opt, const char *arg, int unset);
bool is_strict_order(const char *order);
#endif /* __PERF_SORT_H */
|
/*
* Copyright 2017 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "gf100.h"
static const struct nvkm_bar_func
gm20b_bar_func = {
.dtor = gf100_bar_dtor,
.oneinit = gf100_bar_oneinit,
.bar1.init = gf100_bar_bar1_init,
.bar1.wait = gm107_bar_bar1_wait,
.bar1.vmm = gf100_bar_bar1_vmm,
.flush = g84_bar_flush,
};
int
gm20b_bar_new(struct nvkm_device *device, int index, struct nvkm_bar **pbar)
{
int ret = gf100_bar_new_(&gm20b_bar_func, device, index, pbar);
if (ret == 0)
(*pbar)->iomap_uncached = true;
return ret;
}
|
#pragma once
//-------------------------------------------------------------------------------------------------
// <copyright file="wcawow64.h" company="Outercurve Foundation">
// Copyright (c) 2004, Outercurve Foundation.
// This software is released under Microsoft Reciprocal License (MS-RL).
// The license and further copyright text can be found in the file
// LICENSE.TXT at the root directory of the distribution.
// </copyright>
//
// <summary>
// Windows Installer XML CustomAction utility library for Wow64 API-related functionality.
// </summary>
//-------------------------------------------------------------------------------------------------
#include "wcautil.h"
#ifdef __cplusplus
extern "C" {
#endif
HRESULT WIXAPI WcaInitializeWow64();
BOOL WIXAPI WcaIsWow64Process();
BOOL WIXAPI WcaIsWow64Initialized();
HRESULT WIXAPI WcaDisableWow64FSRedirection();
HRESULT WIXAPI WcaRevertWow64FSRedirection();
HRESULT WIXAPI WcaFinalizeWow64();
#ifdef __cplusplus
}
#endif
|
/*
* AEAD: Authenticated Encryption with Associated Data
*
* Copyright (c) 2007 Herbert Xu <herbert@gondor.apana.org.au>
*
* 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 _CRYPTO_INTERNAL_AEAD_H
#define _CRYPTO_INTERNAL_AEAD_H
#include <crypto/aead.h>
#include <crypto/algapi.h>
#include <linux/types.h>
struct rtattr;
struct crypto_aead_spawn {
struct crypto_spawn base;
};
extern const struct crypto_type crypto_nivaead_type;
static inline void crypto_set_aead_spawn(
struct crypto_aead_spawn *spawn, struct crypto_instance *inst)
{
crypto_set_spawn(&spawn->base, inst);
}
int crypto_grab_aead(struct crypto_aead_spawn *spawn, const char *name,
u32 type, u32 mask);
static inline void crypto_drop_aead(struct crypto_aead_spawn *spawn)
{
crypto_drop_spawn(&spawn->base);
}
static inline struct crypto_alg *crypto_aead_spawn_alg(
struct crypto_aead_spawn *spawn)
{
return spawn->base.alg;
}
static inline struct crypto_aead *crypto_spawn_aead(
struct crypto_aead_spawn *spawn)
{
return __crypto_aead_cast(
crypto_spawn_tfm(&spawn->base, CRYPTO_ALG_TYPE_AEAD,
CRYPTO_ALG_TYPE_MASK));
}
struct crypto_instance *aead_geniv_alloc(struct crypto_template *tmpl,
struct rtattr **tb, u32 type,
u32 mask);
void aead_geniv_free(struct crypto_instance *inst);
int aead_geniv_init(struct crypto_tfm *tfm);
void aead_geniv_exit(struct crypto_tfm *tfm);
static inline struct crypto_aead *aead_geniv_base(struct crypto_aead *geniv)
{
return crypto_aead_crt(geniv)->base;
}
static inline void *aead_givcrypt_reqctx(struct aead_givcrypt_request *req)
{
return aead_request_ctx(&req->areq);
}
static inline void aead_givcrypt_complete(struct aead_givcrypt_request *req,
int err)
{
aead_request_complete(&req->areq, err);
}
#endif /* _CRYPTO_INTERNAL_AEAD_H */
|
/*
* (C) Copyright 2000
* Wolfgang Denk, DENX Software Engineering, wd@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.
*
* 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 <common.h>
#include <exports.h>
int hello_world (int argc, char * const argv[])
{
int i;
/* Print the ABI version */
app_startup(argv);
printf ("Example expects ABI version %d\n", XF_VERSION);
printf ("Actual U-Boot ABI version %d\n", (int)get_version());
printf ("Hello World\n");
printf ("argc = %d\n", argc);
for (i=0; i<=argc; ++i) {
printf ("argv[%d] = \"%s\"\n",
i,
argv[i] ? argv[i] : "<NULL>");
}
printf ("Hit any key to exit ... ");
while (!tstc())
;
/* consume input */
(void) getc();
printf ("\n\n");
return (0);
}
|
double sqrt(double),fabs(double),sin(double);
int sxs;
int sys;
f()
{
int l;
int sm = -52, sx = 52;
char *smap;
for (l = 0; l < 9; l++)
{
double g;
int cx, cy, gx, gy, x, y;
gx = 2 > g / 3 ? 2 : g / 3;
gy = 2 > g / 3 ? 2 : g / 3;
for (y = 0 > cy - gy ? 0 : cy - gy; y <= (sys - 1 < cy + gy ? sys : cy + gy); y++)
{
int sx = 0 > cx - gx ? 0 : cx - gx;
short *ax = (short *) (y * sxs + sx);
for (x = sx; x <= (sxs - 1 < cx + gx ? sxs - 1 : cx + gx); x++)
{
double c=2.25, z=sqrt(fabs(1-c)), cz=(c>1?0.0:-10)>z?c>1?0:1:z;
}
}
}
for (l = sm; l <= sx; l++)
smap[l] = l > 0 ? 1 + foo(sin(.1 * l / sx)) : 1 - foo(sin(.1 * l / sm));
}
|
#ifndef _YASM_LIBYASM_STDINT_H
#define _YASM_LIBYASM_STDINT_H 1
#ifndef _GENERATED_STDINT_H
#define _GENERATED_STDINT_H "yasm 1.1.0"
/* generated using gcc -std=gnu99 */
#define _STDINT_HAVE_STDINT_H 1
#include <stdint.h>
#endif
#endif
|
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* transport_class.h - a generic container for all transport classes
*
* Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
*/
#ifndef _TRANSPORT_CLASS_H_
#define _TRANSPORT_CLASS_H_
#include <linux/device.h>
#include <linux/bug.h>
#include <linux/attribute_container.h>
struct transport_container;
struct transport_class {
struct class class;
int (*setup)(struct transport_container *, struct device *,
struct device *);
int (*configure)(struct transport_container *, struct device *,
struct device *);
int (*remove)(struct transport_container *, struct device *,
struct device *);
};
#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \
struct transport_class cls = { \
.class = { \
.name = nm, \
}, \
.setup = su, \
.remove = rm, \
.configure = cfg, \
}
struct anon_transport_class {
struct transport_class tclass;
struct attribute_container container;
};
#define DECLARE_ANON_TRANSPORT_CLASS(cls, mtch, cfg) \
struct anon_transport_class cls = { \
.tclass = { \
.configure = cfg, \
}, \
. container = { \
.match = mtch, \
}, \
}
#define class_to_transport_class(x) \
container_of(x, struct transport_class, class)
struct transport_container {
struct attribute_container ac;
const struct attribute_group *statistics;
};
#define attribute_container_to_transport_container(x) \
container_of(x, struct transport_container, ac)
void transport_remove_device(struct device *);
int transport_add_device(struct device *);
void transport_setup_device(struct device *);
void transport_configure_device(struct device *);
void transport_destroy_device(struct device *);
static inline int
transport_register_device(struct device *dev)
{
transport_setup_device(dev);
return transport_add_device(dev);
}
static inline void
transport_unregister_device(struct device *dev)
{
transport_remove_device(dev);
transport_destroy_device(dev);
}
static inline int transport_container_register(struct transport_container *tc)
{
return attribute_container_register(&tc->ac);
}
static inline void transport_container_unregister(struct transport_container *tc)
{
if (unlikely(attribute_container_unregister(&tc->ac)))
BUG();
}
int transport_class_register(struct transport_class *);
int anon_transport_class_register(struct anon_transport_class *);
void transport_class_unregister(struct transport_class *);
void anon_transport_class_unregister(struct anon_transport_class *);
#endif
|
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/dma-mapping.h>
#include <linux/dma-debug.h>
#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 15)
static int __init dma_init(void)
{
dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
return 0;
}
fs_initcall(dma_init);
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Futex2 library addons for futex tests
*
* Copyright 2021 Collabora Ltd.
*/
#include <stdint.h>
#define u64_to_ptr(x) ((void *)(uintptr_t)(x))
/**
* futex_waitv - Wait at multiple futexes, wake on any
* @waiters: Array of waiters
* @nr_waiters: Length of waiters array
* @flags: Operation flags
* @timo: Optional timeout for operation
*/
static inline int futex_waitv(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
unsigned long flags, struct timespec *timo, clockid_t clockid)
{
return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
}
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2008 INRIA
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#ifndef PACKET_SOCKET_HELPER_H
#define PACKET_SOCKET_HELPER_H
#include "ns3/node-container.h"
namespace ns3 {
/**
* \brief Give ns3::PacketSocket powers to ns3::Node.
*/
class PacketSocketHelper
{
public:
/**
* Aggregate an instance of a ns3::PacketSocketFactory onto the provided
* node.
*
* \param node Node on which to aggregate the ns3::PacketSocketFactory.
*/
void Install (Ptr<Node> node) const;
/**
* Aggregate an instance of a ns3::PacketSocketFactory onto the provided
* node.
*
* \param nodeName The name of the node on which to aggregate the ns3::PacketSocketFactory.
*/
void Install (std::string nodeName) const;
/**
* For each node in the provided container, aggregate an instance of a
* ns3::PacketSocketFactory.
*
* \param c NodeContainer of the set of nodes to aggregate the
* ns3::PacketSocketFactory on.
*/
void Install (NodeContainer c) const;
};
} // namespace ns3
#endif /* PACKET_SOCKET_HELPER_H */
|
#include <stdlib.h>
int
main(int argc, char *argv[])
{
(void)argc;
(void)argv;
(void)qsort_r;
exit(0);
}
|
/* $OpenBSD: debug_md.h,v 1.7 2006/06/06 13:30:42 mickey Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#define REG_NAMES \
"eax", "ecx", "edx", "ebx", "esp", \
"ebp", "esi", "edi", "eip", "eflags", \
"cs", "ss", "ds", "es", "fs", \
"gs"
#define REG_VALUES(r) \
&(r).r_eax, &(r).r_ecx, &(r).r_edx, &(r).r_ebx, &(r).r_esp, \
&(r).r_ebp, &(r).r_esi, &(r).r_edi, &(r).r_eip, &(r).r_eflags, \
&(r).r_cs , &(r).r_ss, &(r).r_ds, &(r).r_es, &(r).r_fs, \
&(r).r_gs
#define TRAP_NAMES \
"invalid opcode fault", "breakpoint trap", "arithmetic trap", \
"asynchronous system trap", "protection fault", "trace trap", \
"page fault", "alignment fault", "integer divide fault", \
"non-maskable interrupt", "overflow trap", "bounds check fault", \
"device not available fault", "double fault", \
"fp coprocessor operand fetch fault (![P]Pro)", "invalid tss fault", \
"segment not present fault", "stack fault", "machine check ([P]Pro)", \
"reserved fault base"
#ifdef _LOCORE
.globl _C_LABEL(reg)
#define DUMP_REGS int $2
#else
#define DUMP_REGS __asm("int $2")
extern struct reg reg;
#endif
|
/* See LICENSE file for copyright and license details. */
#include "common.h"
/**
* Get the output size of the algorithm specified for a state
*
* @param state The state
* @return The number of bytes in the output, zero on error
*/
size_t
libsha2_state_output_size(const struct libsha2_state *restrict state)
{
return libsha2_algorithm_output_size(state->algorithm);
}
|
/*!
* MPT solver library
* get solver interface from metatype
*/
#include <string.h>
#include <ctype.h>
#include "types.h"
#include "client.h"
#include "config.h"
#include "meta.h"
#include "solver.h"
/*!
* \ingroup mptSolver
* \brief solver access
*
* Convert metatype element to compatible solver type interface.
*
* \param mt metatype reference
* \param match solver capablities to select
* \param info log/error output descriptor
*
* \return solver interface
*/
extern MPT_SOLVER(interface) *mpt_solver_conv(MPT_INTERFACE(convertable) *val, int match, MPT_INTERFACE(logger) *info)
{
MPT_SOLVER(interface) *sol;
MPT_INTERFACE(object) *obj;
const char *name, *msg;
int cap;
/* object interface for name query */
obj = 0;
name = 0;
if (info
&& (cap = val->_vptr->convert(val, MPT_ENUM(TypeObjectPtr), &obj)) >= 0
&& obj) {
name = mpt_object_typename(obj);
}
/* can convert to solver interface */
if (!val
|| (cap = val->_vptr->convert(val, MPT_ENUM(TypeSolverPtr), &sol)) < 0
|| !sol) {
if (!info) {
return 0;
}
msg = MPT_tr("no valid solver");
cap = val->_vptr->convert(val, 0, 0);
if (name) {
mpt_log(info, __func__, MPT_LOG(Error), "%s: %s (%d)",
msg, name, cap);
} else {
mpt_log(info, __func__, MPT_LOG(Error), "%s: %d",
msg, cap);
}
return 0;
}
/* query solver capabilities */
if ((cap = sol->_vptr->report(sol, 0, 0, 0)) < 0) {
if (!info) {
return 0;
}
msg = MPT_tr("no solver capabilities");
cap = val->_vptr->convert(val, 0, 0);
if (name) {
mpt_log(info, __func__, MPT_LOG(Error), "%s: %s (%d)",
msg, name, cap);
} else {
mpt_log(info, __func__, MPT_LOG(Error), "%s: %d",
msg, cap);
}
return 0;
}
if (match && !(cap & match)) {
if (!info) {
return 0;
}
msg = MPT_tr("solver has incompatile capabilities");
if (name) {
mpt_log(info, __func__, MPT_LOG(Error), "%s (%s): 0x%02x <> 0x%02x",
msg, name, cap, match);
} else {
mpt_log(info, __func__, MPT_LOG(Error), "%s: 0x%02x <> 0x%02x",
msg, cap, match);
}
return 0;
}
if (!info) {
return sol;
}
msg = MPT_tr("use solver instance");
if (name) {
mpt_log(info, __func__, MPT_LOG(Info), "%s: %s (0x%02x)",
msg, name, cap);
} else {
mpt_log(info, __func__, MPT_LOG(Info), "%s: 0x%02x",
msg, cap);
}
return sol;
}
|
#include <cgreen/cgreen.h>
#include <cgreen/vector.h>
#include <stdlib.h>
#include "../src/utils.h"
#ifdef __cplusplus
using namespace cgreen;
#endif
static CgreenVector *vector;
static char a = 'a', b = 'b', c = 'c';
static int times_called = 0;
static void set_up_vector(void) {
vector = create_cgreen_vector(NULL);
times_called = 0;
}
static void tear_down_vector(void) {
destroy_cgreen_vector(vector);
}
Describe(Vector);
BeforeEach(Vector) {
set_up_vector();
}
AfterEach(Vector) {
tear_down_vector();
}
Ensure(Vector, new_vector_is_empty) {
assert_that(cgreen_vector_size(vector), is_equal_to(0));
}
Ensure(Vector, single_item_gives_count_of_one) {
cgreen_vector_add(vector, &a);
assert_that(cgreen_vector_size(vector), is_equal_to(1));
}
Ensure(Vector, single_item_is_readable) {
cgreen_vector_add(vector, &a);
assert_that(*(char *)cgreen_vector_get(vector, 0), is_equal_to('a'));
}
Ensure(Vector, double_item_gives_count_of_two) {
cgreen_vector_add(vector, &a);
cgreen_vector_add(vector, &b);
assert_that(cgreen_vector_size(vector), is_equal_to(2));
}
Ensure(Vector, two_items_are_readable) {
cgreen_vector_add(vector, &a);
cgreen_vector_add(vector, &b);
assert_that(*(char *)cgreen_vector_get(vector, 0), is_equal_to('a'));
assert_that(*(char *)cgreen_vector_get(vector, 1), is_equal_to('b'));
}
Ensure(Vector, can_extract_only_item) {
cgreen_vector_add(vector, &a);
assert_that(*(char *)cgreen_vector_remove(vector, 0), is_equal_to('a'));
assert_that(cgreen_vector_size(vector), is_equal_to(0));
}
Ensure(Vector, can_extract_head_item) {
cgreen_vector_add(vector, &a);
cgreen_vector_add(vector, &b);
cgreen_vector_add(vector, &c);
assert_that(*(char *)cgreen_vector_remove(vector, 0), is_equal_to('a'));
assert_that(*(char *)cgreen_vector_get(vector, 0), is_equal_to('b'));
assert_that(*(char *)cgreen_vector_get(vector, 1), is_equal_to('c'));
}
Ensure(Vector, can_extract_tail_item) {
cgreen_vector_add(vector, &a);
cgreen_vector_add(vector, &b);
cgreen_vector_add(vector, &c);
assert_that(*(char *)cgreen_vector_remove(vector, 2), is_equal_to('c'));
assert_that(*(char *)cgreen_vector_get(vector, 0), is_equal_to('a'));
assert_that(*(char *)cgreen_vector_get(vector, 1), is_equal_to('b'));
}
Ensure(Vector, can_extract_middle_item) {
cgreen_vector_add(vector, &a);
cgreen_vector_add(vector, &b);
cgreen_vector_add(vector, &c);
assert_that(*(char *)cgreen_vector_remove(vector, 1), is_equal_to('b'));
assert_that(*(char *)cgreen_vector_get(vector, 0), is_equal_to('a'));
assert_that(*(char *)cgreen_vector_get(vector, 1), is_equal_to('c'));
}
static void sample_destructor(void *item) {
(void)item;
times_called++;
}
Ensure(Vector, destructor_is_called_on_single_item) {
CgreenVector *vector = create_cgreen_vector(&sample_destructor);
cgreen_vector_add(vector, &a);
destroy_cgreen_vector(vector);
assert_that(times_called, is_equal_to(1));
}
Ensure(Vector, destructor_is_not_called_on_empty_vector) {
CgreenVector *vector = create_cgreen_vector(&sample_destructor);
destroy_cgreen_vector(vector);
assert_that(times_called, is_equal_to(0));
}
Ensure(Vector, destructor_is_called_three_times_on_three_item_vector) {
CgreenVector *vector = create_cgreen_vector(&sample_destructor);
cgreen_vector_add(vector, &a);
cgreen_vector_add(vector, &b);
cgreen_vector_add(vector, &c);
destroy_cgreen_vector(vector);
assert_that(times_called, is_equal_to(3));
}
Ensure(Vector, vector_size_of_null_pointer_is_zero) {
assert_that(cgreen_vector_size(NULL), is_equal_to(0));
}
Ensure(Vector, returns_null_for_get_on_illegal_index) {
CgreenVector *vector = create_cgreen_vector(NULL);
char panic_message[1000];
panic_set_output_buffer(panic_message);
assert_that(cgreen_vector_get(vector, -1), is_equal_to(NULL));
assert_that(panic_message, contains_string("illegal position (-1) in vector operation"));
}
Ensure(Vector, returns_null_for_remove_from_illegal_index) {
CgreenVector *vector = create_cgreen_vector(NULL);
char panic_message[1000];
panic_set_output_buffer(panic_message);
assert_that(cgreen_vector_remove(vector, 1), is_equal_to(NULL));
assert_that(panic_message, contains_string("illegal position (1) in vector operation"));
}
TestSuite *vector_tests(void) {
TestSuite *suite = create_test_suite();
set_setup(suite, set_up_vector);
set_teardown(suite, tear_down_vector);
add_test_with_context(suite, Vector, new_vector_is_empty);
add_test_with_context(suite, Vector, single_item_gives_count_of_one);
add_test_with_context(suite, Vector, single_item_is_readable);
add_test_with_context(suite, Vector, double_item_gives_count_of_two);
add_test_with_context(suite, Vector, two_items_are_readable);
add_test_with_context(suite, Vector, can_extract_only_item);
add_test_with_context(suite, Vector, can_extract_head_item);
add_test_with_context(suite, Vector, can_extract_tail_item);
add_test_with_context(suite, Vector, can_extract_middle_item);
add_test_with_context(suite, Vector, destructor_is_called_on_single_item);
add_test_with_context(suite, Vector, destructor_is_not_called_on_empty_vector);
add_test_with_context(suite, Vector, destructor_is_called_three_times_on_three_item_vector);
add_test_with_context(suite, Vector, vector_size_of_null_pointer_is_zero);
add_test_with_context(suite, Vector, returns_null_for_get_on_illegal_index);
add_test_with_context(suite, Vector, returns_null_for_remove_from_illegal_index);
return suite;
}
|
/* Copyright (c) 2017 Dennis Wölfing
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* libc/src/stdlib/abort.c
* Abnormal process termination.
*/
#include <signal.h>
#include <stdlib.h>
#include <sys/syscall.h>
DEFINE_SYSCALL(SYSCALL_ABORT, __noreturn void, sys_abort, (void));
__noreturn void abort(void) {
raise(SIGABRT);
// If the call above returned, terminate by sending an uncatchable SIGABRT.
sys_abort();
}
|
#include <stdio.h>
int main(void) {
int i;
char line[81];
void readLine(char buffer[]);
for (i = 0; i < 3; ++i) {
readLine(line);
printf("%s\n\n", line);
}
return 0;
}
// Function to read a line of text from the terminal
void readLine(char buffer[]) {
char character;
int i = 0;
do {
character = getchar();
buffer[i] = character;
++i;
} while (character != '\n');
buffer[i - 1] = '\0';
}
|
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
private slots:
void on_actionNew_Item_triggered();
void on_actionNewStorage_triggered();
};
#endif // MAINWINDOW_H
|
#ifndef ZOOKEEPER_LIB_H
#define ZOOKEEPER_LIB_H
#include "ruby.h"
#include "c-client-src/zookeeper.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#define ZK_TRUE 1
#define ZK_FALSE 0
#define ZKRB_GLOBAL_REQ -1
extern int ZKRBDebugging;
struct zkrb_data_completion {
char *data;
struct Stat *stat;
};
struct zkrb_stat_completion {
struct Stat *stat;
};
struct zkrb_void_completion {
};
struct zkrb_string_completion {
char *value;
};
struct zkrb_strings_completion {
struct String_vector *values;
};
struct zkrb_strings_stat_completion {
struct String_vector *values;
struct Stat *stat;
};
struct zkrb_acl_completion {
struct ACL_vector *acl;
struct Stat *stat;
};
struct zkrb_watcher_completion {
int type;
int state;
char *path;
};
typedef struct {
int64_t req_id;
int rc;
enum {
ZKRB_DATA = 0,
ZKRB_STAT = 1,
ZKRB_VOID = 2,
ZKRB_STRING = 3,
ZKRB_STRINGS = 4,
ZKRB_STRINGS_STAT = 5,
ZKRB_ACL = 6,
ZKRB_WATCHER = 7
} type;
union {
struct zkrb_data_completion *data_completion;
struct zkrb_stat_completion *stat_completion;
struct zkrb_void_completion *void_completion;
struct zkrb_string_completion *string_completion;
struct zkrb_strings_completion *strings_completion;
struct zkrb_strings_stat_completion *strings_stat_completion;
struct zkrb_acl_completion *acl_completion;
struct zkrb_watcher_completion *watcher_completion;
} completion;
} zkrb_event_t;
struct zkrb_event_ll_t {
zkrb_event_t *event;
struct zkrb_event_ll_t *next;
};
typedef struct {
struct zkrb_event_ll_t *head;
struct zkrb_event_ll_t *tail;
} zkrb_queue_t;
zkrb_queue_t * zkrb_queue_alloc(void);
zkrb_event_t * zkrb_event_alloc(void);
void zkrb_event_free(zkrb_event_t *ptr);
/* push/pop is a misnomer, this is a queue */
void zkrb_enqueue(zkrb_queue_t *queue, zkrb_event_t *elt);
zkrb_event_t * zkrb_peek(zkrb_queue_t *queue);
zkrb_event_t * zkrb_dequeue(zkrb_queue_t *queue);
void zkrb_print_stat(const struct Stat *s);
typedef struct {
int64_t req_id;
zkrb_queue_t *queue;
} zkrb_calling_context;
void zkrb_print_calling_context(zkrb_calling_context *ctx);
zkrb_calling_context *zkrb_calling_context_alloc(int64_t req_id, zkrb_queue_t *queue);
/*
default process completions that get queued into the ruby client event queue
*/
void zkrb_state_callback(
zhandle_t *zh, int type, int state, const char *path, void *calling_ctx);
void zkrb_data_callback(
int rc, const char *value, int value_len, const struct Stat *stat, const void *calling_ctx);
void zkrb_stat_callback(
int rc, const struct Stat *stat, const void *calling_ctx);
void zkrb_string_callback(
int rc, const char *string, const void *calling_ctx);
void zkrb_strings_callback(
int rc, const struct String_vector *strings, const void *calling_ctx);
void zkrb_strings_stat_callback(
int rc, const struct String_vector *strings, const struct Stat* stat, const void *calling_ctx);
void zkrb_void_callback(
int rc, const void *calling_ctx);
void zkrb_acl_callback(
int rc, struct ACL_vector *acls, struct Stat *stat, const void *calling_ctx);
VALUE zkrb_event_to_ruby(zkrb_event_t *event);
VALUE zkrb_acl_to_ruby(struct ACL *acl);
VALUE zkrb_acl_vector_to_ruby(struct ACL_vector *acl_vector);
VALUE zkrb_id_to_ruby(struct Id *id);
VALUE zkrb_string_vector_to_ruby(struct String_vector *string_vector);
VALUE zkrb_stat_to_rarray(const struct Stat *stat);
VALUE zkrb_stat_to_rhash(const struct Stat* stat);
struct ACL_vector * zkrb_ruby_to_aclvector(VALUE acl_ary);
struct ACL_vector * zkrb_clone_acl_vector(struct ACL_vector * src);
struct String_vector * zkrb_clone_string_vector(struct String_vector * src);
struct ACL zkrb_ruby_to_acl(VALUE rubyacl);
struct Id zkrb_ruby_to_id(VALUE rubyid);
#endif /* ZOOKEEPER_LIB_H */
|
char *srPartyMsg1 = " 21/7/2549¢³Ð¹Õé¼Ùé¹Ó Party ¤×Í %s ";
char *srPartyMsg2 = " Party ä´é¶Ù¡Â¡àÅÔ¡ ";
char *srPartyMsg3 = " %s ä´éà¢éÒÃèÇÁ Party ";
char *srPartyMsg4 = " äÁèÊÒÁÒöà¢éÒÃèÇÁ Party ä´é ";
char *srPartyMsg5 = " %s ä´éÍÍ¡¨Ò¡ Party ";
|
#ifndef VISIONIPC_H
#define VISIONIPC_H
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#define VIPC_SOCKET_PATH "/tmp/vision_socket"
#define VIPC_MAX_FDS 64
#ifdef __cplusplus
extern "C" {
#endif
typedef enum VisionIPCPacketType {
VIPC_INVALID = 0,
VIPC_STREAM_SUBSCRIBE,
VIPC_STREAM_BUFS,
VIPC_STREAM_ACQUIRE,
VIPC_STREAM_RELEASE,
} VisionIPCPacketType;
typedef enum VisionStreamType {
VISION_STREAM_RGB_BACK,
VISION_STREAM_RGB_FRONT,
VISION_STREAM_RGB_WIDE,
VISION_STREAM_YUV,
VISION_STREAM_YUV_FRONT,
VISION_STREAM_YUV_WIDE,
VISION_STREAM_MAX,
} VisionStreamType;
typedef struct VisionUIInfo {
int big_box_x, big_box_y;
int big_box_width, big_box_height;
int transformed_width, transformed_height;
int front_box_x, front_box_y;
int front_box_width, front_box_height;
int wide_box_x, wide_box_y;
int wide_box_width, wide_box_height;
} VisionUIInfo;
typedef struct VisionStreamBufs {
VisionStreamType type;
int width, height, stride;
size_t buf_len;
union {
VisionUIInfo ui_info;
} buf_info;
} VisionStreamBufs;
typedef struct VIPCBufExtra {
// only for yuv
uint32_t frame_id;
uint64_t timestamp_eof;
} VIPCBufExtra;
typedef union VisionPacketData {
struct {
VisionStreamType type;
bool tbuffer;
} stream_sub;
VisionStreamBufs stream_bufs;
struct {
VisionStreamType type;
int idx;
VIPCBufExtra extra;
} stream_acq;
struct {
VisionStreamType type;
int idx;
} stream_rel;
} VisionPacketData;
typedef struct VisionPacket {
int type;
VisionPacketData d;
int num_fds;
int fds[VIPC_MAX_FDS];
} VisionPacket;
int vipc_connect(void);
int vipc_recv(int fd, VisionPacket *out_p);
int vipc_send(int fd, const VisionPacket *p);
typedef struct VIPCBuf {
int fd;
size_t len;
void* addr;
} VIPCBuf;
void vipc_bufs_load(VIPCBuf *bufs, const VisionStreamBufs *stream_bufs,
int num_fds, const int* fds);
typedef struct VisionStream {
int ipc_fd;
int last_idx;
int last_type;
int num_bufs;
VisionStreamBufs bufs_info;
VIPCBuf *bufs;
} VisionStream;
int visionstream_init(VisionStream *s, VisionStreamType type, bool tbuffer, VisionStreamBufs *out_bufs_info);
void visionstream_release(VisionStream *s);
VIPCBuf* visionstream_get(VisionStream *s, VIPCBufExtra *out_extra);
void visionstream_destroy(VisionStream *s);
#ifdef __cplusplus
}
#endif
#endif
|
// Geometric3D_EMC.h
// created by Kuangdai on 16-May-2017
// topography on a boundary at any depth, with IRIS-EMC format
#pragma once
#include "Geometric3D.h"
#include "eigenp.h"
class Geometric3D_EMC: public Geometric3D {
public:
void initialize();
void initialize(const std::vector<std::string> ¶ms);
double getDeltaR(double r, double theta, double phi, double rElemCenter) const;
std::string verbose() const;
private:
// radius
double mRLayer;
double mRLower;
double mRUpper;
// file
std::string mFileName;
std::string mVarName;
// factor
double mFactor = 1.0;
// use geocentric or geographic
bool mGeographic = false;
// data
RDMatXX mGridData;
RDColX mGridLat;
RDColX mGridLon;
};
|
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __E_MATERIAL_FLAGS_H_INCLUDED__
#define __E_MATERIAL_FLAGS_H_INCLUDED__
namespace irr
{
namespace video
{
//! Material flags
enum E_MATERIAL_FLAG
{
//! Draw as wireframe or filled triangles? Default: false
EMF_WIREFRAME = 0,
//! Draw as point cloud or filled triangles? Default: false
EMF_POINTCLOUD,
//! Flat or Gouraud shading? Default: true
EMF_GOURAUD_SHADING,
//! Will this material be lighted? Default: true
EMF_LIGHTING,
//! Is the ZBuffer enabled? Default: true
EMF_ZBUFFER,
//! May be written to the zbuffer or is it readonly. Default: true
//! This flag is ignored, if the material type is a transparent type.
EMF_ZWRITE_ENABLE,
//! Is backfaceculling enabled? Default: true
EMF_BACK_FACE_CULLING,
//! Is bilinear filtering enabled? Default: true
EMF_BILINEAR_FILTER,
//! Is trilinear filtering enabled? Default: false
//! If the trilinear filter flag is enabled,
//! the bilinear filtering flag is ignored.
EMF_TRILINEAR_FILTER,
//! Is anisotropic filtering? Default: false
//! In Irrlicht you can use anisotropic texture filtering in
//! conjunction with bilinear or trilinear texture filtering
//! to improve rendering results. Primitives will look less
//! blurry with this flag switched on.
EMF_ANISOTROPIC_FILTER,
//! Is fog enabled? Default: false
EMF_FOG_ENABLE,
//! Normalizes normals.You can enable this if you need
//! to scale a dynamic lighted model. Usually, its normals will get scaled
//! too then and it will get darker. If you enable the EMF_NORMALIZE_NORMALS flag,
//! the normals will be normalized again, and the model will look as bright as it should.
EMF_NORMALIZE_NORMALS,
//! Access to all layers texture wrap settings. Overwrites separate layer settings.
EMF_TEXTURE_WRAP,
//! This is not a flag, but a value indicating how much flags there are.
EMF_MATERIAL_FLAG_COUNT
};
} // end namespace video
} // end namespace irr
#endif // __E_MATERIAL_FLAGS_H_INCLUDED__
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.