answer
stringlengths 15
1.25M
|
|---|
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - <API key></title>
<script src="../../components/jquery-2.1.1/jquery.js"></script>
<script src="../../../angular.js"></script>
<script src="script.js"></script>
</head>
<body ng-app="orderByExample">
<div ng-controller="ExampleController">
<table class="friend">
<tr>
<th>Name</th>
<th>Phone Number</th>
<th>Age</th>
</tr>
<tr ng-repeat="friend in friends | orderBy:'-age'">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<td>{{friend.age}}</td>
</tr>
</table>
</div>
</body>
</html>
|
/* <API key>: GPL-2.0 */
/*
* ioport.h Definitions of routines for detecting, reserving and
* allocating system resources.
*
* Authors: Linus Torvalds
*/
#ifndef _LINUX_IOPORT_H
#define _LINUX_IOPORT_H
#ifndef __ASSEMBLY__
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/bits.h>
/*
* Resources are tree-like, allowing
* nesting etc..
*/
struct resource {
resource_size_t start;
resource_size_t end;
const char *name;
unsigned long flags;
unsigned long desc;
struct resource *parent, *sibling, *child;
};
/*
* IO resources have these defined flags.
*
* PCI devices expose these flags to userspace in the "resource" sysfs file,
* so don't move them.
*/
#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */
#define <API key> 0x00001f00 /* Resource type */
#define IORESOURCE_IO 0x00000100 /* PCI/ISA I/O ports */
#define IORESOURCE_MEM 0x00000200
#define IORESOURCE_REG 0x00000300 /* Register offsets */
#define IORESOURCE_IRQ 0x00000400
#define IORESOURCE_DMA 0x00000800
#define IORESOURCE_BUS 0x00001000
#define IORESOURCE_PREFETCH 0x00002000 /* No side effects */
#define IORESOURCE_READONLY 0x00004000
#define <API key> 0x00008000
#define <API key> 0x00010000
#define <API key> 0x00020000
#define <API key> 0x00040000 /* size indicates alignment */
#define <API key> 0x00080000 /* start field is alignment */
#define IORESOURCE_MEM_64 0x00100000
#define IORESOURCE_WINDOW 0x00200000 /* forwarded by bridge */
#define IORESOURCE_MUXED 0x00400000 /* Resource is software muxed */
#define <API key> 0x01000000 /* Resource extended types */
#define IORESOURCE_SYSRAM 0x01000000 /* System RAM (modifier) */
#define <API key> 0x08000000 /* Userland may not map this resource */
#define IORESOURCE_DISABLED 0x10000000
#define IORESOURCE_UNSET 0x20000000 /* No address assigned yet */
#define IORESOURCE_AUTO 0x40000000
#define IORESOURCE_BUSY 0x80000000 /* Driver has marked this resource busy */
/* I/O resource extended types */
#define <API key> (IORESOURCE_MEM|IORESOURCE_SYSRAM)
/* PnP IRQ specific bits (IORESOURCE_BITS) */
#define <API key> (1<<0)
#define <API key> (1<<1)
#define <API key> (1<<2)
#define <API key> (1<<3)
#define <API key> (1<<4)
#define <API key> (1<<5)
/* PnP DMA specific bits (IORESOURCE_BITS) */
#define <API key> (3<<0)
#define IORESOURCE_DMA_8BIT (0<<0)
#define <API key> (1<<0)
#define <API key> (2<<0)
#define <API key> (1<<2)
#define IORESOURCE_DMA_BYTE (1<<3)
#define IORESOURCE_DMA_WORD (1<<4)
#define <API key> (3<<6)
#define <API key> (0<<6)
#define <API key> (1<<6)
#define <API key> (2<<6)
#define <API key> (3<<6)
/* PnP memory I/O specific bits (IORESOURCE_BITS) */
#define <API key> (1<<0) /* dup: IORESOURCE_READONLY */
#define <API key> (1<<1) /* dup: <API key> */
#define <API key> (1<<2) /* dup: <API key> */
#define <API key> (3<<3)
#define IORESOURCE_MEM_8BIT (0<<3)
#define <API key> (1<<3)
#define <API key> (2<<3)
#define <API key> (3<<3)
#define <API key> (1<<5) /* dup: <API key> */
#define <API key> (1<<6)
#define <API key> (1<<7)
/* PnP I/O specific bits (IORESOURCE_BITS) */
#define <API key> (1<<0)
#define IORESOURCE_IO_FIXED (1<<1)
#define <API key> (1<<2)
/* PCI ROM control bits (IORESOURCE_BITS) */
#define <API key> (1<<0) /* ROM is enabled, same as <API key> */
#define <API key> (1<<1) /* Use RAM image, not ROM BAR */
/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */
#define <API key> (1<<4) /* Do not move resource */
#define <API key> (1<<5) /* BAR Equivalent Indicator */
/*
* I/O Resource Descriptors
*
* Descriptors are used by walk_iomem_res_desc() and region_intersects()
* for searching a specific resource range in the iomem table. Assign
* a new descriptor when a resource range supports the search interfaces.
* Otherwise, resource.desc must be set to IORES_DESC_NONE (0).
*/
enum {
IORES_DESC_NONE = 0,
<API key> = 1,
<API key> = 2,
<API key> = 3,
<API key> = 4,
<API key> = 5,
<API key> = 6,
IORES_DESC_RESERVED = 7,
<API key> = 8,
};
/*
* Flags controlling ioremap() behavior.
*/
enum {
<API key> = BIT(0),
IORES_MAP_ENCRYPTED = BIT(1),
};
/* helpers to define resources */
#define DEFINE_RES_NAMED(_start, _size, _name, _flags) \
{ \
.start = (_start), \
.end = (_start) + (_size) - 1, \
.name = (_name), \
.flags = (_flags), \
.desc = IORES_DESC_NONE, \
}
#define DEFINE_RES_IO_NAMED(_start, _size, _name) \
DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
#define DEFINE_RES_IO(_start, _size) \
DEFINE_RES_IO_NAMED((_start), (_size), NULL)
#define <API key>(_start, _size, _name) \
DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_MEM)
#define DEFINE_RES_MEM(_start, _size) \
<API key>((_start), (_size), NULL)
#define <API key>(_irq, _name) \
DEFINE_RES_NAMED((_irq), 1, (_name), IORESOURCE_IRQ)
#define DEFINE_RES_IRQ(_irq) \
<API key>((_irq), NULL)
#define <API key>(_dma, _name) \
DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA)
#define DEFINE_RES_DMA(_dma) \
<API key>((_dma), NULL)
/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
extern struct resource ioport_resource;
extern struct resource iomem_resource;
extern struct resource *<API key>(struct resource *root, struct resource *new);
extern int request_resource(struct resource *root, struct resource *new);
extern int release_resource(struct resource *new);
void <API key>(struct resource *new);
extern void <API key>(struct resource *root,
resource_size_t start, resource_size_t end,
const char *name);
extern struct resource *<API key>(struct resource *parent, struct resource *new);
extern int insert_resource(struct resource *parent, struct resource *new);
extern void <API key>(struct resource *root, struct resource *new);
extern int remove_resource(struct resource *old);
extern void <API key>(struct resource *avail);
extern int allocate_resource(struct resource *root, struct resource *new,
resource_size_t size, resource_size_t min,
resource_size_t max, resource_size_t align,
resource_size_t (*alignf)(void *,
const struct resource *,
resource_size_t,
resource_size_t),
void *alignf_data);
struct resource *lookup_resource(struct resource *root, resource_size_t start);
int adjust_resource(struct resource *res, resource_size_t start,
resource_size_t size);
resource_size_t resource_alignment(struct resource *res);
static inline resource_size_t resource_size(const struct resource *res)
{
return res->end - res->start + 1;
}
static inline unsigned long resource_type(const struct resource *res)
{
return res->flags & <API key>;
}
static inline unsigned long resource_ext_type(const struct resource *res)
{
return res->flags & <API key>;
}
/* True iff r1 completely contains r2 */
static inline bool resource_contains(struct resource *r1, struct resource *r2)
{
if (resource_type(r1) != resource_type(r2))
return false;
if (r1->flags & IORESOURCE_UNSET || r2->flags & IORESOURCE_UNSET)
return false;
return r1->start <= r2->start && r1->end >= r2->end;
}
/* Convenience shorthand with allocation */
#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0)
#define <API key>(start,n,name) __request_region(&ioport_resource, (start), (n), (name), IORESOURCE_MUXED)
#define <API key>(start,n,name, excl) __request_region(&iomem_resource, (start), (n), (name), excl)
#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name), 0)
#define <API key>(start,n,name) \
__request_region(&iomem_resource, (start), (n), (name), <API key>)
#define rename_region(region, newname) do { (region)->name = (newname); } while (0)
extern struct resource * __request_region(struct resource *,
resource_size_t start,
resource_size_t n,
const char *name, int flags);
/* Compatibility cruft */
#define release_region(start,n) __release_region(&ioport_resource, (start), (n))
#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
extern void __release_region(struct resource *, resource_size_t,
resource_size_t);
#ifdef <API key>
extern int <API key>(struct resource *, resource_size_t,
resource_size_t);
#endif
/* Wrappers for managed devices */
struct device;
extern int <API key>(struct device *dev, struct resource *root,
struct resource *new);
extern void <API key>(struct device *dev, struct resource *new);
#define devm_request_region(dev,start,n,name) \
<API key>(dev, &ioport_resource, (start), (n), (name))
#define <API key>(dev,start,n,name) \
<API key>(dev, &iomem_resource, (start), (n), (name))
extern struct resource * <API key>(struct device *dev,
struct resource *parent, resource_size_t start,
resource_size_t n, const char *name);
#define devm_release_region(dev, start, n) \
<API key>(dev, &ioport_resource, (start), (n))
#define <API key>(dev, start, n) \
<API key>(dev, &iomem_resource, (start), (n))
extern void <API key>(struct device *dev, struct resource *parent,
resource_size_t start, resource_size_t n);
extern int <API key>(resource_size_t addr, unsigned long size);
extern bool iomem_is_exclusive(u64 addr);
extern int
<API key>(unsigned long start_pfn, unsigned long nr_pages,
void *arg, int (*func)(unsigned long, unsigned long, void *));
extern int
walk_mem_res(u64 start, u64 end, void *arg,
int (*func)(struct resource *, void *));
extern int
walk_system_ram_res(u64 start, u64 end, void *arg,
int (*func)(struct resource *, void *));
extern int
walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start, u64 end,
void *arg, int (*func)(struct resource *, void *));
/* True if any part of r1 overlaps r2 */
static inline bool resource_overlaps(struct resource *r1, struct resource *r2)
{
return (r1->start <= r2->end && r1->end >= r2->start);
}
struct resource *<API key>(struct device *dev,
struct resource *base, unsigned long size);
struct resource *<API key>(struct resource *base,
unsigned long size, const char *name);
#ifdef <API key>
void revoke_devmem(struct resource *res);
#else
static inline void revoke_devmem(struct resource *res) { };
#endif
#endif /* __ASSEMBLY__ */
#endif /* _LINUX_IOPORT_H */
|
// <API key>: GPL-2.0-only
#include <linux/clk.h>
#include <linux/component.h>
#include <linux/module.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_managed.h>
#include <drm/drm_prime.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_of.h>
#include <drm/drm_vblank.h>
#include "armada_crtc.h"
#include "armada_drm.h"
#include "armada_gem.h"
#include "armada_fb.h"
#include "armada_hw.h"
#include <drm/armada_drm.h>
#include "armada_ioctlP.h"
static struct drm_ioctl_desc armada_ioctls[] = {
DRM_IOCTL_DEF_DRV(ARMADA_GEM_CREATE, <API key>,0),
DRM_IOCTL_DEF_DRV(ARMADA_GEM_MMAP, <API key>, 0),
DRM_IOCTL_DEF_DRV(ARMADA_GEM_PWRITE, <API key>, 0),
};
DEFINE_DRM_GEM_FOPS(armada_drm_fops);
static struct drm_driver armada_drm_driver = {
.lastclose = <API key>,
.<API key> = <API key>,
.prime_handle_to_fd = <API key>,
.prime_fd_to_handle = <API key>,
.gem_prime_export = <API key>,
.gem_prime_import = <API key>,
.dumb_create = <API key>,
.gem_vm_ops = &armada_gem_vm_ops,
.major = 1,
.minor = 0,
.name = "armada-drm",
.desc = "Armada SoC DRM",
.date = "20120730",
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
.ioctls = armada_ioctls,
.fops = &armada_drm_fops,
};
static const struct <API key> <API key> = {
.fb_create = armada_fb_create,
.output_poll_changed = <API key>,
.atomic_check = <API key>,
.atomic_commit = <API key>,
};
static int armada_drm_bind(struct device *dev)
{
struct armada_private *priv;
struct resource *mem = NULL;
int ret, n;
for (n = 0; ; n++) {
struct resource *r = <API key>(to_platform_device(dev),
IORESOURCE_MEM, n);
if (!r)
break;
/* Resources above 64K are graphics memory */
if (resource_size(r) > SZ_64K)
mem = r;
else
return -EINVAL;
}
if (!mem)
return -ENXIO;
if (!<API key>(dev, mem->start, resource_size(mem),
"armada-drm"))
return -EBUSY;
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
/*
* The drm_device structure must be at the start of
* armada_private for drm_dev_put() to work correctly.
*/
BUILD_BUG_ON(offsetof(struct armada_private, drm) != 0);
ret = drm_dev_init(&priv->drm, &armada_drm_driver, dev);
if (ret) {
dev_err(dev, "[" DRM_NAME ":%s] drm_dev_init failed: %d\n",
__func__, ret);
kfree(priv);
return ret;
}
<API key>(&priv->drm, priv);
/* Remove early framebuffers */
ret = <API key>(NULL,
"armada-drm-fb",
false);
if (ret) {
dev_err(dev, "[" DRM_NAME ":%s] can't kick out simple-fb: %d\n",
__func__, ret);
kfree(priv);
return ret;
}
priv->drm.dev_private = priv;
dev_set_drvdata(dev, &priv->drm);
/* Mode setting support */
<API key>(&priv->drm);
priv->drm.mode_config.min_width = 320;
priv->drm.mode_config.min_height = 200;
/*
* With vscale enabled, the maximum width is 1920 due to the
* 1920 by 3 lines RAM
*/
priv->drm.mode_config.max_width = 1920;
priv->drm.mode_config.max_height = 2048;
priv->drm.mode_config.preferred_depth = 24;
priv->drm.mode_config.funcs = &<API key>;
drm_mm_init(&priv->linear, mem->start, resource_size(mem));
mutex_init(&priv->linear_lock);
ret = component_bind_all(dev, &priv->drm);
if (ret)
goto err_kms;
ret = drm_vblank_init(&priv->drm, priv->drm.mode_config.num_crtc);
if (ret)
goto err_comp;
priv->drm.irq_enabled = true;
<API key>(&priv->drm);
ret = armada_fbdev_init(&priv->drm);
if (ret)
goto err_comp;
<API key>(&priv->drm);
ret = drm_dev_register(&priv->drm, 0);
if (ret)
goto err_poll;
#ifdef CONFIG_DEBUG_FS
<API key>(priv->drm.primary);
#endif
return 0;
err_poll:
<API key>(&priv->drm);
armada_fbdev_fini(&priv->drm);
err_comp:
<API key>(dev, &priv->drm);
err_kms:
<API key>(&priv->drm);
drm_mm_takedown(&priv->linear);
drm_dev_put(&priv->drm);
return ret;
}
static void armada_drm_unbind(struct device *dev)
{
struct drm_device *drm = dev_get_drvdata(dev);
struct armada_private *priv = drm->dev_private;
<API key>(&priv->drm);
armada_fbdev_fini(&priv->drm);
drm_dev_unregister(&priv->drm);
<API key>(&priv->drm);
<API key>(dev, &priv->drm);
<API key>(&priv->drm);
drm_mm_takedown(&priv->linear);
drm_dev_put(&priv->drm);
}
static int compare_of(struct device *dev, void *data)
{
return dev->of_node == data;
}
static int compare_dev_name(struct device *dev, void *data)
{
const char *name = data;
return !strcmp(dev_name(dev), name);
}
static void <API key>(struct device *dev,
struct component_match **match, struct device_node *dev_node)
{
struct device_node *ep, *remote;
<API key>(dev_node, ep) {
remote = <API key>(ep);
if (remote && <API key>(remote))
<API key>(dev, match, compare_of,
remote);
of_node_put(remote);
}
}
static const struct <API key> armada_master_ops = {
.bind = armada_drm_bind,
.unbind = armada_drm_unbind,
};
static int armada_drm_probe(struct platform_device *pdev)
{
struct component_match *match = NULL;
struct device *dev = &pdev->dev;
int ret;
ret = <API key>(dev, compare_dev_name, &armada_master_ops);
if (ret != -EINVAL)
return ret;
if (dev->platform_data) {
char **devices = dev->platform_data;
struct device *d;
int i;
for (i = 0; devices[i]; i++)
component_match_add(dev, &match, compare_dev_name,
devices[i]);
if (i == 0) {
dev_err(dev, "missing 'ports' property\n");
return -ENODEV;
}
for (i = 0; devices[i]; i++) {
d = <API key>(&platform_bus_type, NULL,
devices[i]);
if (d && d->of_node)
<API key>(dev, &match, d->of_node);
put_device(d);
}
}
return <API key>(&pdev->dev, &armada_master_ops,
match);
}
static int armada_drm_remove(struct platform_device *pdev)
{
<API key>(&pdev->dev, &armada_master_ops);
return 0;
}
static const struct platform_device_id <API key>[] = {
{
.name = "armada-drm",
}, {
.name = "armada-510-drm",
},
{ },
};
MODULE_DEVICE_TABLE(platform, <API key>);
static struct platform_driver <API key> = {
.probe = armada_drm_probe,
.remove = armada_drm_remove,
.driver = {
.name = "armada-drm",
},
.id_table = <API key>,
};
static int __init armada_drm_init(void)
{
int ret;
armada_drm_driver.num_ioctls = ARRAY_SIZE(armada_ioctls);
ret = <API key>(&<API key>);
if (ret)
return ret;
ret = <API key>(&<API key>);
if (ret)
<API key>(&<API key>);
return ret;
}
module_init(armada_drm_init);
static void __exit armada_drm_exit(void)
{
<API key>(&<API key>);
<API key>(&<API key>);
}
module_exit(armada_drm_exit);
MODULE_AUTHOR("Russell King <rmk+kernel@armlinux.org.uk>");
MODULE_DESCRIPTION("Armada DRM Driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:armada-drm");
|
#![cfg(test)]
extern crate servo_config;
mod opts;
mod prefs;
|
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.<API key> { background: none; border: none; margin: 0; padding: 0; }
|
<?php
/**
* @file
* Contains \Drupal\filter\FilterProcessResult.
*/
namespace Drupal\filter;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Core\Template\Attribute;
/**
* Used to return values from a text filter plugin's processing method.
*
* The typical use case for a text filter plugin's processing method is to just
* apply some filtering to the given text, but for more advanced use cases,
* it may be necessary to also:
* - Declare asset libraries to be loaded.
* - Declare cache tags that the filtered text depends upon, so when either of
* those cache tags is invalidated, the filtered text should also be
* invalidated.
* - Declare cache context to vary by, e.g. 'language' to do language-specific
* filtering.
* - Declare a maximum age for the filtered text.
* - Apply uncacheable filtering, for example because it differs per user.
*
* In case a filter needs one or more of these advanced use cases, it can use
* the additional methods available.
*
* The typical use case:
* @code
* public function process($text, $langcode) {
* // Modify $text.
*
* return new FilterProcess($text);
* }
* @endcode
*
* The advanced use cases:
* @code
* public function process($text, $langcode) {
* // Modify $text.
*
* $result = new FilterProcess($text);
*
* // Associate assets to be attached.
* $result->setAttachments(array(
* 'library' => array(
* 'filter/caption',
* ),
* ));
*
* // Associate cache contexts to vary by.
* $result->setCacheContexts(['language']);
*
* // Associate cache tags to be invalidated by.
* $result->setCacheTags($node->getCacheTags());
*
* // Associate a maximum age.
* $result->setCacheMaxAge(300); // 5 minutes.
*
* return $result;
* }
* @endcode
*/
class FilterProcessResult extends BubbleableMetadata {
/**
* The processed text.
*
* @see \Drupal\filter\Plugin\FilterInterface::process()
*
* @var string
*/
protected $processedText;
/**
* Constructs a FilterProcessResult object.
*
* @param string $processed_text
* The text as processed by a text filter.
*/
public function __construct($processed_text) {
$this->processedText = $processed_text;
}
/**
* Gets the processed text.
*
* @return string
*/
public function getProcessedText() {
return $this->processedText;
}
/**
* Gets the processed text.
*
* @return string
*/
public function __toString() {
return $this->getProcessedText();
}
/**
* Sets the processed text.
*
* @param string $processed_text
* The text as processed by a text filter.
*
* @return $this
*/
public function setProcessedText($processed_text) {
$this->processedText = $processed_text;
return $this;
}
/**
* Creates a placeholder.
*
* This generates its own placeholder markup for one major reason: to not have
* FilterProcessResult depend on the Renderer service, because this is a value
* object. As a side-effect and added benefit, this makes it easier to
* distinguish placeholders for filtered text versus generic render system
* placeholders.
*
* @param string $callback
* The #lazy_builder callback that will replace the placeholder with its
* eventual markup.
* @param array $args
* The arguments for the #lazy_builder callback.
*
* @return string
* The placeholder markup.
*/
public function createPlaceholder($callback, array $args) {
// Generate placeholder markup.
// @see \Drupal\Core\Render\Renderer::createPlaceholder()
$attributes = new Attribute();
$attributes['callback'] = $callback;
$attributes['arguments'] = UrlHelper::buildQuery($args);
$attributes['token'] = hash('sha1', serialize([$callback, $args]));
$placeholder_markup = Html::normalize('<<API key>' . $attributes . '></<API key>>');
// Add the placeholder attachment.
$this->addAttachments([
'placeholders' => [
$placeholder_markup => [
'#lazy_builder' => [$callback, $args],
]
],
]);
// Return the placeholder markup, so that the filter wanting to use a
// placeholder can actually insert the placeholder markup where it needs the
// placeholder to be replaced.
return $placeholder_markup;
}
}
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include "dvb_math.h"
#include "dvb_frontend.h"
#include "dib9000.h"
#include "dibx000_common.h"
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "turn on debugging (default: 0)");
#define dprintk(fmt, arg...) do { \
if (debug) \
printk(KERN_DEBUG pr_fmt("%s: " fmt), \
__func__, ##arg); \
} while (0)
#define <API key> 6
struct i2c_device {
struct i2c_adapter *i2c_adap;
u8 i2c_addr;
u8 *i2c_read_buffer;
u8 *i2c_write_buffer;
};
struct dib9000_pid_ctrl {
#define <API key> 0
#define DIB9000_PID_FILTER 1
u8 cmd;
u8 id;
u16 pid;
u8 onoff;
};
struct dib9000_state {
struct i2c_device i2c;
struct dibx000_i2c_master i2c_master;
struct i2c_adapter tuner_adap;
struct i2c_adapter component_bus;
u16 revision;
u8 reg_offs;
enum frontend_tune_state tune_state;
u32 status;
struct <API key> channel_status;
u8 fe_id;
#define <API key> 0xffff
u16 gpio_dir;
#define <API key> 0x0000
u16 gpio_val;
#define <API key> 0xffff
u16 gpio_pwm_pos;
union { /* common for all chips */
struct {
u8 mobile_mode:1;
} host;
struct {
struct <API key> {
u16 addr;
u16 size;
} fe_mm[18];
u8 memcmd;
struct mutex mbx_if_lock; /* to protect read/write operations */
struct mutex mbx_lock; /* to protect the whole mailbox handling */
struct mutex mem_lock; /* to protect the memory accesses */
struct mutex mem_mbx_lock; /* to protect the memory-based mailbox */
#define MBX_MAX_WORDS (256 - 200 - 2)
#define <API key> 2
u16 message_cache[<API key>][MBX_MAX_WORDS];
u8 fw_is_running;
} risc;
} platform;
union { /* common for all platforms */
struct {
struct dib9000_config cfg;
} d9;
} chip;
struct dvb_frontend *fe[<API key>];
u16 component_bus_speed;
/* for the I2C transfer */
struct i2c_msg msg[2];
u8 i2c_write_buffer[255];
u8 i2c_read_buffer[255];
struct mutex demod_lock;
u8 <API key>;
struct dib9000_pid_ctrl pid_ctrl[10];
s8 pid_ctrl_index; /* -1: empty list; -2: do not use the list */
};
static const u32 fe_info[44] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
enum dib9000_power_mode {
DIB9000_POWER_ALL = 0,
DIB9000_POWER_NO,
<API key>,
<API key>,
<API key>,
<API key>,
};
enum <API key> {
OUT_MSG_HBM_ACK,
<API key>,
OUT_MSG_REQ_VERSION,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
OUT_MSG_MONIT_DEMOD,
OUT_MSG_CONF_GPIO,
OUT_MSG_DEBUG_HELP,
OUT_MSG_SUBBAND_SEL,
<API key>,
OUT_MSG_FE_FW_DL,
<API key>,
<API key>,
OUT_MSG_FE_SLEEP,
OUT_MSG_FE_SYNC,
OUT_MSG_CTL_MONIT,
OUT_MSG_CONF_SVC,
OUT_MSG_SET_HBM,
OUT_MSG_INIT_DEMOD,
<API key>,
<API key>,
<API key>,
OUT_MSG_ACK_FRG,
OUT_MSG_INIT_PMU,
};
enum dib9000_in_messages {
IN_MSG_DATA,
IN_MSG_FRAME_INFO,
IN_MSG_CTL_MONIT,
<API key>,
IN_MSG_DEBUG_BUF,
IN_MSG_MPE_MONITOR,
<API key>,
<API key>,
<API key>,
IN_MSG_VERSION,
IN_MSG_END_OF_SCAN,
IN_MSG_MONIT_DEMOD,
IN_MSG_ERROR,
<API key>,
IN_MSG_EVENT,
<API key>,
IN_MSG_HBM_PROF,
};
/* memory_access requests */
#define FE_MM_W_CHANNEL 0
#define FE_MM_W_FE_INFO 1
#define FE_MM_RW_SYNC 2
#define FE_SYNC_CHANNEL 1
#define <API key> 2
#define <API key> 3
#define <API key> 3
#define <API key> 4
#define FE_MM_R_FE_INFO 5
#define FE_MM_R_FE_MONITOR 6
#define <API key> 7
#define <API key> 8
#define <API key> 9
#define <API key> 10
#define <API key> 11
#define <API key> 12
#define <API key> 13
#define <API key> 14
#define <API key> 15
#define <API key> 16
#define <API key> 17
static int <API key>(struct dib9000_state *state, u32 address, u16 attribute, const u8 * tx, u32 txlen, u8 * b, u32 len);
static int <API key>(struct dib9000_state *state, u32 address, u16 attribute, const u8 * b, u32 len);
static u16 to_fw_output_mode(u16 mode)
{
switch (mode) {
case OUTMODE_HIGH_Z:
return 0;
case <API key>:
return 4;
case <API key>:
return 8;
case <API key>:
return 16;
case OUTMODE_DIVERSITY:
return 128;
case OUTMODE_MPEG2_FIFO:
return 2;
case OUTMODE_ANALOG_ADC:
return 1;
default:
return 0;
}
}
static int dib9000_read16_attr(struct dib9000_state *state, u16 reg, u8 *b, u32 len, u16 attribute)
{
u32 chunk_size = 126;
u32 l;
int ret;
if (state->platform.risc.fw_is_running && (reg < 1024))
return <API key>(state, reg, attribute, NULL, 0, b, len);
memset(state->msg, 0, 2 * sizeof(struct i2c_msg));
state->msg[0].addr = state->i2c.i2c_addr >> 1;
state->msg[0].flags = 0;
state->msg[0].buf = state->i2c_write_buffer;
state->msg[0].len = 2;
state->msg[1].addr = state->i2c.i2c_addr >> 1;
state->msg[1].flags = I2C_M_RD;
state->msg[1].buf = b;
state->msg[1].len = len;
state->i2c_write_buffer[0] = reg >> 8;
state->i2c_write_buffer[1] = reg & 0xff;
if (attribute & <API key>)
state->i2c_write_buffer[0] |= (1 << 5);
if (attribute & <API key>)
state->i2c_write_buffer[0] |= (1 << 4);
do {
l = len < chunk_size ? len : chunk_size;
state->msg[1].len = l;
state->msg[1].buf = b;
ret = i2c_transfer(state->i2c.i2c_adap, state->msg, 2) != 2 ? -EREMOTEIO : 0;
if (ret != 0) {
dprintk("i2c read error on %d\n", reg);
return -EREMOTEIO;
}
b += l;
len -= l;
if (!(attribute & <API key>))
reg += l / 2;
} while ((ret == 0) && len);
return 0;
}
static u16 dib9000_i2c_read16(struct i2c_device *i2c, u16 reg)
{
struct i2c_msg msg[2] = {
{.addr = i2c->i2c_addr >> 1, .flags = 0,
.buf = i2c->i2c_write_buffer, .len = 2},
{.addr = i2c->i2c_addr >> 1, .flags = I2C_M_RD,
.buf = i2c->i2c_read_buffer, .len = 2},
};
i2c->i2c_write_buffer[0] = reg >> 8;
i2c->i2c_write_buffer[1] = reg & 0xff;
if (i2c_transfer(i2c->i2c_adap, msg, 2) != 2) {
dprintk("read register %x error\n", reg);
return 0;
}
return (i2c->i2c_read_buffer[0] << 8) | i2c->i2c_read_buffer[1];
}
static inline u16 dib9000_read_word(struct dib9000_state *state, u16 reg)
{
if (dib9000_read16_attr(state, reg, state->i2c_read_buffer, 2, 0) != 0)
return 0;
return (state->i2c_read_buffer[0] << 8) | state->i2c_read_buffer[1];
}
static inline u16 <API key>(struct dib9000_state *state, u16 reg, u16 attribute)
{
if (dib9000_read16_attr(state, reg, state->i2c_read_buffer, 2,
attribute) != 0)
return 0;
return (state->i2c_read_buffer[0] << 8) | state->i2c_read_buffer[1];
}
#define <API key>(state, reg, b, len, attribute) dib9000_read16_attr(state, reg, b, len, (attribute) | <API key>)
static int <API key>(struct dib9000_state *state, u16 reg, const u8 *buf, u32 len, u16 attribute)
{
u32 chunk_size = 126;
u32 l;
int ret;
if (state->platform.risc.fw_is_running && (reg < 1024)) {
if (<API key>
(state, reg, <API key> | <API key> | attribute, buf, len) != 0)
return -EINVAL;
return 0;
}
memset(&state->msg[0], 0, sizeof(struct i2c_msg));
state->msg[0].addr = state->i2c.i2c_addr >> 1;
state->msg[0].flags = 0;
state->msg[0].buf = state->i2c_write_buffer;
state->msg[0].len = len + 2;
state->i2c_write_buffer[0] = (reg >> 8) & 0xff;
state->i2c_write_buffer[1] = (reg) & 0xff;
if (attribute & <API key>)
state->i2c_write_buffer[0] |= (1 << 5);
if (attribute & <API key>)
state->i2c_write_buffer[0] |= (1 << 4);
do {
l = len < chunk_size ? len : chunk_size;
state->msg[0].len = l + 2;
memcpy(&state->i2c_write_buffer[2], buf, l);
ret = i2c_transfer(state->i2c.i2c_adap, state->msg, 1) != 1 ? -EREMOTEIO : 0;
buf += l;
len -= l;
if (!(attribute & <API key>))
reg += l / 2;
} while ((ret == 0) && len);
return ret;
}
static int dib9000_i2c_write16(struct i2c_device *i2c, u16 reg, u16 val)
{
struct i2c_msg msg = {
.addr = i2c->i2c_addr >> 1, .flags = 0,
.buf = i2c->i2c_write_buffer, .len = 4
};
i2c->i2c_write_buffer[0] = (reg >> 8) & 0xff;
i2c->i2c_write_buffer[1] = reg & 0xff;
i2c->i2c_write_buffer[2] = (val >> 8) & 0xff;
i2c->i2c_write_buffer[3] = val & 0xff;
return i2c_transfer(i2c->i2c_adap, &msg, 1) != 1 ? -EREMOTEIO : 0;
}
static inline int dib9000_write_word(struct dib9000_state *state, u16 reg, u16 val)
{
u8 b[2] = { val >> 8, val & 0xff };
return <API key>(state, reg, b, 2, 0);
}
static inline int <API key>(struct dib9000_state *state, u16 reg, u16 val, u16 attribute)
{
u8 b[2] = { val >> 8, val & 0xff };
return <API key>(state, reg, b, 2, attribute);
}
#define dib9000_write(state, reg, buf, len) <API key>(state, reg, buf, len, 0)
#define <API key>(state, reg, buf, len) <API key>(state, reg, buf, len, <API key>)
#define <API key>(state, reg, buf, len, attribute) <API key>(state, reg, buf, len, <API key> | (attribute))
#define dib9000_mbx_send(state, id, data, len) <API key>(state, id, data, len, 0)
#define <API key>(state, id, msg, len) <API key>(state, id, msg, len, 0)
#define MAC_IRQ (1 << 1)
#define IRQ_POL_MSK (1 << 4)
#define <API key>(state, b, len) dib9000_read16_attr(state, 1063, b, len, <API key> | <API key>)
#define <API key>(state, buf, len) <API key>(state, 1063, buf, len, <API key> | <API key>)
static void <API key>(struct dib9000_state *state, u32 addr, u32 len, u8 reading)
{
u8 b[14] = { 0 };
/* dprintk("%d memcmd: %d %d %d\n", state->fe_id, addr, addr+len, len); */
/* b[0] = 0 << 7; */
b[1] = 1;
/* b[2] = 0; */
/* b[3] = 0; */
b[4] = (u8) (addr >> 8);
b[5] = (u8) (addr & 0xff);
/* b[10] = 0; */
/* b[11] = 0; */
b[12] = (u8) (addr >> 8);
b[13] = (u8) (addr & 0xff);
addr += len;
/* b[6] = 0; */
/* b[7] = 0; */
b[8] = (u8) (addr >> 8);
b[9] = (u8) (addr & 0xff);
dib9000_write(state, 1056, b, 14);
if (reading)
dib9000_write_word(state, 1056, (1 << 15) | 1);
state->platform.risc.memcmd = -1; /* if it was called directly reset it - to force a future setup-call to set it */
}
static void <API key>(struct dib9000_state *state, u8 cmd)
{
struct <API key> *m = &state->platform.risc.fe_mm[cmd & 0x7f];
/* decide whether we need to "refresh" the memory controller */
if (state->platform.risc.memcmd == cmd && /* same command */
!(cmd & 0x80 && m->size < 67)) /* and we do not want to read something with less than 67 bytes looping - working around a bug in the memory controller */
return;
<API key>(state, m->addr, m->size, cmd & 0x80);
state->platform.risc.memcmd = cmd;
}
static int <API key>(struct dib9000_state *state, u8 cmd, u8 * b, u16 len)
{
if (!state->platform.risc.fw_is_running)
return -EIO;
if (<API key>(&state->platform.risc.mem_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
<API key>(state, cmd | 0x80);
<API key>(state, b, len);
mutex_unlock(&state->platform.risc.mem_lock);
return 0;
}
static int <API key>(struct dib9000_state *state, u8 cmd, const u8 * b)
{
struct <API key> *m = &state->platform.risc.fe_mm[cmd];
if (!state->platform.risc.fw_is_running)
return -EIO;
if (<API key>(&state->platform.risc.mem_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
<API key>(state, cmd);
<API key>(state, b, m->size);
mutex_unlock(&state->platform.risc.mem_lock);
return 0;
}
static int <API key>(struct dib9000_state *state, u8 risc_id, u16 key, const u8 * code, u32 len)
{
u16 offs;
if (risc_id == 1)
offs = 16;
else
offs = 0;
/* config crtl reg */
dib9000_write_word(state, 1024 + offs, 0x000f);
dib9000_write_word(state, 1025 + offs, 0);
dib9000_write_word(state, 1031 + offs, key);
dprintk("going to download %dB of microcode\n", len);
if (<API key>(state, 1026 + offs, (u8 *) code, (u16) len) != 0) {
dprintk("error while downloading microcode for RISC %c\n", 'A' + risc_id);
return -EIO;
}
dprintk("Microcode for RISC %c loaded\n", 'A' + risc_id);
return 0;
}
static int <API key>(struct dib9000_state *state, u8 risc_id)
{
u16 mbox_offs;
u16 reset_reg;
u16 tries = 1000;
if (risc_id == 1)
mbox_offs = 16;
else
mbox_offs = 0;
/* Reset mailbox */
dib9000_write_word(state, 1027 + mbox_offs, 0x8000);
/* Read reset status */
do {
reset_reg = dib9000_read_word(state, 1027 + mbox_offs);
msleep(100);
} while ((reset_reg & 0x8000) && --tries);
if (reset_reg & 0x8000) {
dprintk("MBX: init ERROR, no response from RISC %c\n", 'A' + risc_id);
return -EIO;
}
dprintk("MBX: initialized\n");
return 0;
}
#define MAX_MAILBOX_TRY 100
static int <API key>(struct dib9000_state *state, u8 id, u16 * data, u8 len, u16 attr)
{
u8 *d, b[2];
u16 tmp;
u16 size;
u32 i;
int ret = 0;
if (!state->platform.risc.fw_is_running)
return -EINVAL;
if (<API key>(&state->platform.risc.mbx_if_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
tmp = MAX_MAILBOX_TRY;
do {
size = <API key>(state, 1043, attr) & 0xff;
if ((size + len + 1) > MBX_MAX_WORDS && --tmp) {
dprintk("MBX: RISC mbx full, retrying\n");
msleep(100);
} else
break;
} while (1);
/*dprintk( "MBX: size: %d\n", size); */
if (tmp == 0) {
ret = -EINVAL;
goto out;
}
#ifdef DUMP_MSG
dprintk("--> %02x %d %*ph\n", id, len + 1, len, data);
#endif
/* byte-order conversion - works on big (where it is not necessary) or little endian */
d = (u8 *) data;
for (i = 0; i < len; i++) {
tmp = data[i];
*d++ = tmp >> 8;
*d++ = tmp & 0xff;
}
/* write msg */
b[0] = id;
b[1] = len + 1;
if (<API key>(state, 1045, b, 2, attr) != 0 || <API key>(state, 1045, (u8 *) data, len * 2, attr) != 0) {
ret = -EIO;
goto out;
}
/* update register nb_mes_in_RX */
ret = (u8) <API key>(state, 1043, 1 << 14, attr);
out:
mutex_unlock(&state->platform.risc.mbx_if_lock);
return ret;
}
static u8 dib9000_mbx_read(struct dib9000_state *state, u16 * data, u8 risc_id, u16 attr)
{
#ifdef DUMP_MSG
u16 *d = data;
#endif
u16 tmp, i;
u8 size;
u8 mc_base;
if (!state->platform.risc.fw_is_running)
return 0;
if (<API key>(&state->platform.risc.mbx_if_lock) < 0) {
dprintk("could not get the lock\n");
return 0;
}
if (risc_id == 1)
mc_base = 16;
else
mc_base = 0;
/* Length and type in the first word */
*data = <API key>(state, 1029 + mc_base, attr);
size = *data & 0xff;
if (size <= MBX_MAX_WORDS) {
data++;
size--; /* Initial word already read */
<API key>(state, 1029 + mc_base, (u8 *) data, size * 2, attr);
/* to word conversion */
for (i = 0; i < size; i++) {
tmp = *data;
*data = (tmp >> 8) | (tmp << 8);
data++;
}
#ifdef DUMP_MSG
dprintk("<
for (i = 0; i < size + 1; i++)
dprintk("%04x\n", d[i]);
dprintk("\n");
#endif
} else {
dprintk("MBX: message is too big for message cache (%d), flushing message\n", size);
size--; /* Initial word already read */
while (size
<API key>(state, 1029 + mc_base, (u8 *) data, 2, attr);
}
/* Update register nb_mes_in_TX */
<API key>(state, 1028 + mc_base, 1 << 14, attr);
mutex_unlock(&state->platform.risc.mbx_if_lock);
return size + 1;
}
static int <API key>(struct dib9000_state *state, u16 * data, u8 size)
{
u32 ts = data[1] << 16 | data[0];
char *b = (char *)&data[2];
b[2 * (size - 2) - 1] = '\0'; /* Bullet proof the buffer */
if (*b == '~') {
b++;
dprintk("%s\n", b);
} else
dprintk("RISC%d: %d.%04d %s\n",
state->fe_id,
ts / 10000, ts % 10000, *b ? b : "<empty>");
return 1;
}
static int <API key>(struct dib9000_state *state, u16 attr)
{
int i;
u8 size;
u16 *block;
/* find a free slot */
for (i = 0; i < <API key>; i++) {
block = state->platform.risc.message_cache[i];
if (*block == 0) {
size = dib9000_mbx_read(state, block, 1, attr);
/* dprintk( "MBX: fetched %04x message to cache\n", *block); */
switch (*block >> 8) {
case IN_MSG_DEBUG_BUF:
<API key>(state, block + 1, size); /* debug-messages are going to be printed right away */
*block = 0; /* free the block */
break;
#if 0
case IN_MSG_DATA: /* FE-TRACE */
<API key>(state, block + 1, size);
*block = 0;
break;
#endif
default:
break;
}
return 1;
}
}
dprintk("MBX: no free cache-slot found for new message...\n");
return -1;
}
static u8 dib9000_mbx_count(struct dib9000_state *state, u8 risc_id, u16 attr)
{
if (risc_id == 0)
return (u8) (<API key>(state, 1028, attr) >> 10) & 0x1f; /* 5 bit field */
else
return (u8) (<API key>(state, 1044, attr) >> 8) & 0x7f; /* 7 bit field */
}
static int dib9000_mbx_process(struct dib9000_state *state, u16 attr)
{
int ret = 0;
if (!state->platform.risc.fw_is_running)
return -1;
if (<API key>(&state->platform.risc.mbx_lock) < 0) {
dprintk("could not get the lock\n");
return -1;
}
if (dib9000_mbx_count(state, 1, attr)) /* 1=RiscB */
ret = <API key>(state, attr);
<API key>(state, 1229, attr); /* Clear the IRQ */
/* if (tmp) */
/* dprintk( "cleared IRQ: %x\n", tmp); */
mutex_unlock(&state->platform.risc.mbx_lock);
return ret;
}
static int <API key>(struct dib9000_state *state, u16 id, u16 * msg, u8 * size, u16 attr)
{
u8 i;
u16 *block;
u16 timeout = 30;
*msg = 0;
do {
/* <API key>(); */
for (i = 0; i < <API key>; i++) {
block = state->platform.risc.message_cache[i];
if ((*block >> 8) == id) {
*size = (*block & 0xff) - 1;
memcpy(msg, block + 1, (*size) * 2);
*block = 0; /* free the block */
i = 0; /* signal that we found a message */
break;
}
}
if (i == 0)
break;
if (dib9000_mbx_process(state, attr) == -1) /* try to fetch one message - if any */
return -1;
} while (--timeout);
if (timeout == 0) {
dprintk("waiting for message %d timed out\n", id);
return -1;
}
return i == 0;
}
static int <API key>(struct dib9000_state *state)
{
u8 r[4];
u8 size;
u16 fw_version = 0;
if (dib9000_mbx_send(state, OUT_MSG_REQ_VERSION, &fw_version, 1) != 0)
return -EIO;
if (<API key>(state, IN_MSG_VERSION, (u16 *) r, &size) < 0)
return -EIO;
fw_version = (r[0] << 8) | r[1];
dprintk("RISC: ver: %d.%02d (IC: %d)\n", fw_version >> 10, fw_version & 0x3ff, (r[2] << 8) | r[3]);
if ((fw_version >> 10) != 7)
return -EINVAL;
switch (fw_version & 0x3ff) {
case 11:
case 12:
case 14:
case 15:
case 16:
case 17:
break;
default:
dprintk("RISC: invalid firmware version");
return -EINVAL;
}
dprintk("RISC: valid firmware version");
return 0;
}
static int dib9000_fw_boot(struct dib9000_state *state, const u8 * codeA, u32 lenA, const u8 * codeB, u32 lenB)
{
/* Reconfig pool mac ram */
dib9000_write_word(state, 1225, 0x02); /* A: 8k C, 4 k D - B: 32k C 6 k D - IRAM 96k */
dib9000_write_word(state, 1226, 0x05);
/* Toggles IP crypto to Host APB interface. */
dib9000_write_word(state, 1542, 1);
/* Set jump and no jump in the dma box */
dib9000_write_word(state, 1074, 0);
dib9000_write_word(state, 1075, 0);
/* Set MAC as APB Master. */
dib9000_write_word(state, 1237, 0);
/* Reset the RISCs */
if (codeA != NULL)
dib9000_write_word(state, 1024, 2);
else
dib9000_write_word(state, 1024, 15);
if (codeB != NULL)
dib9000_write_word(state, 1040, 2);
if (codeA != NULL)
<API key>(state, 0, 0x1234, codeA, lenA);
if (codeB != NULL)
<API key>(state, 1, 0x1234, codeB, lenB);
/* Run the RISCs */
if (codeA != NULL)
dib9000_write_word(state, 1024, 0);
if (codeB != NULL)
dib9000_write_word(state, 1040, 0);
if (codeA != NULL)
if (<API key>(state, 0) != 0)
return -EIO;
if (codeB != NULL)
if (<API key>(state, 1) != 0)
return -EIO;
msleep(100);
state->platform.risc.fw_is_running = 1;
if (<API key>(state) != 0)
return -EINVAL;
state->platform.risc.memcmd = 0xff;
return 0;
}
static u16 dib9000_identify(struct i2c_device *client)
{
u16 value;
value = dib9000_i2c_read16(client, 896);
if (value != 0x01b3) {
dprintk("wrong Vendor ID (0x%x)\n", value);
return 0;
}
value = dib9000_i2c_read16(client, 897);
if (value != 0x4000 && value != 0x4001 && value != 0x4002 && value != 0x4003 && value != 0x4004 && value != 0x4005) {
dprintk("wrong Device ID (0x%x)\n", value);
return 0;
}
/* protect this driver to be used with 7000PC */
if (value == 0x4000 && dib9000_i2c_read16(client, 769) == 0x4000) {
dprintk("this driver does not work with DiB7000PC\n");
return 0;
}
switch (value) {
case 0x4000:
dprintk("found DiB7000MA/PA/MB/PB\n");
break;
case 0x4001:
dprintk("found DiB7000HC\n");
break;
case 0x4002:
dprintk("found DiB7000MC\n");
break;
case 0x4003:
dprintk("found DiB9000A\n");
break;
case 0x4004:
dprintk("found DiB9000H\n");
break;
case 0x4005:
dprintk("found DiB9000M\n");
break;
}
return value;
}
static void <API key>(struct dib9000_state *state, enum dib9000_power_mode mode)
{
/* by default everything is going to be powered off */
u16 reg_903 = 0x3fff, reg_904 = 0xffff, reg_905 = 0xffff, reg_906;
u8 offset;
if (state->revision == 0x4003 || state->revision == 0x4004 || state->revision == 0x4005)
offset = 1;
else
offset = 0;
reg_906 = dib9000_read_word(state, 906 + offset) | 0x3; /* keep settings for RISC */
/* now, depending on the requested mode, we power on */
switch (mode) {
/* power up everything in the demod */
case DIB9000_POWER_ALL:
reg_903 = 0x0000;
reg_904 = 0x0000;
reg_905 = 0x0000;
reg_906 = 0x0000;
break;
/* just leave power on the control-interfaces: GPIO and (I2C or SDIO or SRAM) */
case <API key>: /* TODO power up either SDIO or I2C or SRAM */
reg_905 &= ~((1 << 7) | (1 << 6) | (1 << 5) | (1 << 2));
break;
case <API key>:
reg_903 &= ~((1 << 15) | (1 << 14) | (1 << 11) | (1 << 10));
reg_905 &= ~((1 << 7) | (1 << 6) | (1 << 5) | (1 << 4) | (1 << 2));
reg_906 &= ~((1 << 0));
break;
case <API key>:
reg_903 = 0x0000;
reg_904 = 0x801f;
reg_905 = 0x0000;
reg_906 &= ~((1 << 0));
break;
case <API key>:
reg_903 = 0x0000;
reg_904 = 0x8000;
reg_905 = 0x010b;
reg_906 &= ~((1 << 0));
break;
default:
case DIB9000_POWER_NO:
break;
}
/* always power down unused parts */
if (!state->platform.host.mobile_mode)
reg_904 |= (1 << 7) | (1 << 6) | (1 << 4) | (1 << 2) | (1 << 1);
/* P_sdio_select_clk = 0 on MC and after */
if (state->revision != 0x4000)
reg_906 <<= 1;
dib9000_write_word(state, 903 + offset, reg_903);
dib9000_write_word(state, 904 + offset, reg_904);
dib9000_write_word(state, 905 + offset, reg_905);
dib9000_write_word(state, 906 + offset, reg_906);
}
static int dib9000_fw_reset(struct dvb_frontend *fe)
{
struct dib9000_state *state = fe->demodulator_priv;
dib9000_write_word(state, 1817, 0x0003);
dib9000_write_word(state, 1227, 1);
dib9000_write_word(state, 1227, 0);
switch ((state->revision = dib9000_identify(&state->i2c))) {
case 0x4003:
case 0x4004:
case 0x4005:
state->reg_offs = 1;
break;
default:
return -EINVAL;
}
/* reset the i2c-master to use the host interface */
<API key>(&state->i2c_master);
<API key>(state, DIB9000_POWER_ALL);
/* unforce divstr regardless whether i2c enumeration was done or not */
dib9000_write_word(state, 1794, dib9000_read_word(state, 1794) & ~(1 << 1));
dib9000_write_word(state, 1796, 0);
dib9000_write_word(state, 1805, 0x805);
/* restart all parts */
dib9000_write_word(state, 898, 0xffff);
dib9000_write_word(state, 899, 0xffff);
dib9000_write_word(state, 900, 0x0001);
dib9000_write_word(state, 901, 0xff19);
dib9000_write_word(state, 902, 0x003c);
dib9000_write_word(state, 898, 0);
dib9000_write_word(state, 899, 0);
dib9000_write_word(state, 900, 0);
dib9000_write_word(state, 901, 0);
dib9000_write_word(state, 902, 0);
dib9000_write_word(state, 911, state->chip.d9.cfg.if_drives);
<API key>(state, <API key>);
return 0;
}
static int <API key>(struct dib9000_state *state, u32 address, u16 attribute, const u8 * tx, u32 txlen, u8 * b, u32 len)
{
u16 mb[10];
u8 i, s;
if (address >= 1024 || !state->platform.risc.fw_is_running)
return -EINVAL;
/* dprintk( "APB access thru rd fw %d %x\n", address, attribute); */
mb[0] = (u16) address;
mb[1] = len / 2;
<API key>(state, <API key>, mb, 2, attribute);
switch (<API key>(state, <API key>, mb, &s, attribute)) {
case 1:
s
for (i = 0; i < s; i++) {
b[i * 2] = (mb[i + 1] >> 8) & 0xff;
b[i * 2 + 1] = (mb[i + 1]) & 0xff;
}
return 0;
default:
return -EIO;
}
return -EIO;
}
static int <API key>(struct dib9000_state *state, u32 address, u16 attribute, const u8 * b, u32 len)
{
u16 mb[10];
u8 s, i;
if (address >= 1024 || !state->platform.risc.fw_is_running)
return -EINVAL;
if (len > 18)
return -EINVAL;
/* dprintk( "APB access thru wr fw %d %x\n", address, attribute); */
mb[0] = (u16)address;
for (i = 0; i + 1 < len; i += 2)
mb[1 + i / 2] = b[i] << 8 | b[i + 1];
if (len & 1)
mb[1 + len / 2] = b[len - 1] << 8;
<API key>(state, <API key>, mb, (3 + len) / 2, attribute);
return <API key>(state, <API key>, mb, &s, attribute) == 1 ? 0 : -EINVAL;
}
static int <API key>(struct dib9000_state *state, u8 i)
{
u8 index_loop = 10;
if (!state->platform.risc.fw_is_running)
return 0;
<API key>(state, FE_MM_RW_SYNC, &i);
do {
<API key>(state, FE_MM_RW_SYNC, state->i2c_read_buffer, 1);
} while (state->i2c_read_buffer[0] && index_loop
if (index_loop > 0)
return 0;
return -EIO;
}
static int dib9000_fw_init(struct dib9000_state *state)
{
struct dibGPIOFunction *f;
u16 b[40] = { 0 };
u8 i;
u8 size;
if (dib9000_fw_boot(state, NULL, 0, state->chip.d9.cfg.<API key>, state->chip.d9.cfg.microcode_B_fe_size) != 0)
return -EIO;
/* initialize the firmware */
for (i = 0; i < ARRAY_SIZE(state->chip.d9.cfg.gpio_function); i++) {
f = &state->chip.d9.cfg.gpio_function[i];
if (f->mask) {
switch (f->function) {
case <API key>:
b[0] = (u16) f->mask;
b[1] = (u16) f->direction;
b[2] = (u16) f->value;
break;
case <API key>:
b[3] = (u16) f->mask;
b[4] = (u16) f->direction;
b[5] = (u16) f->value;
break;
}
}
}
if (dib9000_mbx_send(state, OUT_MSG_CONF_GPIO, b, 15) != 0)
return -EIO;
/* subband */
b[0] = state->chip.d9.cfg.subband.size; /* type == 0 -> GPIO - PWM not yet supported */
for (i = 0; i < state->chip.d9.cfg.subband.size; i++) {
b[1 + i * 4] = state->chip.d9.cfg.subband.subband[i].f_mhz;
b[2 + i * 4] = (u16) state->chip.d9.cfg.subband.subband[i].gpio.mask;
b[3 + i * 4] = (u16) state->chip.d9.cfg.subband.subband[i].gpio.direction;
b[4 + i * 4] = (u16) state->chip.d9.cfg.subband.subband[i].gpio.value;
}
b[1 + i * 4] = 0; /* fe_id */
if (dib9000_mbx_send(state, OUT_MSG_SUBBAND_SEL, b, 2 + 4 * i) != 0)
return -EIO;
/* 0 - id, 1 - no_of_frontends */
b[0] = (0 << 8) | 1;
/* 0 = i2c-address demod, 0 = tuner */
b[1] = (0 << 8) | (0);
b[2] = (u16) (((state->chip.d9.cfg.xtal_clock_khz * 1000) >> 16) & 0xffff);
b[3] = (u16) (((state->chip.d9.cfg.xtal_clock_khz * 1000)) & 0xffff);
b[4] = (u16) ((state->chip.d9.cfg.vcxo_timer >> 16) & 0xffff);
b[5] = (u16) ((state->chip.d9.cfg.vcxo_timer) & 0xffff);
b[6] = (u16) ((state->chip.d9.cfg.timing_frequency >> 16) & 0xffff);
b[7] = (u16) ((state->chip.d9.cfg.timing_frequency) & 0xffff);
b[29] = state->chip.d9.cfg.if_drives;
if (dib9000_mbx_send(state, OUT_MSG_INIT_DEMOD, b, ARRAY_SIZE(b)) != 0)
return -EIO;
if (dib9000_mbx_send(state, OUT_MSG_FE_FW_DL, NULL, 0) != 0)
return -EIO;
if (<API key>(state, <API key>, b, &size) < 0)
return -EIO;
if (size > ARRAY_SIZE(b)) {
dprintk("error : firmware returned %dbytes needed but the used buffer has only %dbytes\n Firmware init ABORTED", size,
(int)ARRAY_SIZE(b));
return -EINVAL;
}
for (i = 0; i < size; i += 2) {
state->platform.risc.fe_mm[i / 2].addr = b[i + 0];
state->platform.risc.fe_mm[i / 2].size = b[i + 1];
}
return 0;
}
static void <API key>(struct dib9000_state *state)
{
u8 b[9];
u32 freq = state->fe[0]->dtv_property_cache.frequency / 1000;
if (state->fe_id % 2)
freq += 101;
b[0] = (u8) ((freq >> 0) & 0xff);
b[1] = (u8) ((freq >> 8) & 0xff);
b[2] = (u8) ((freq >> 16) & 0xff);
b[3] = (u8) ((freq >> 24) & 0xff);
b[4] = (u8) ((state->fe[0]->dtv_property_cache.bandwidth_hz / 1000 >> 0) & 0xff);
b[5] = (u8) ((state->fe[0]->dtv_property_cache.bandwidth_hz / 1000 >> 8) & 0xff);
b[6] = (u8) ((state->fe[0]->dtv_property_cache.bandwidth_hz / 1000 >> 16) & 0xff);
b[7] = (u8) ((state->fe[0]->dtv_property_cache.bandwidth_hz / 1000 >> 24) & 0xff);
b[8] = 0x80; /* do not wait for CELL ID when doing autosearch */
if (state->fe[0]->dtv_property_cache.delivery_system == SYS_DVBT)
b[8] |= 1;
<API key>(state, <API key>, b);
}
static int <API key>(struct dvb_frontend *fe)
{
struct dib9000_state *state = fe->demodulator_priv;
struct dibDVBTChannel {
s8 spectrum_inversion;
s8 nfft;
s8 guard;
s8 constellation;
s8 hrch;
s8 alpha;
s8 code_rate_hp;
s8 code_rate_lp;
s8 select_hp;
s8 intlv_native;
};
struct dibDVBTChannel *ch;
int ret = 0;
if (<API key>(&state->platform.risc.mem_mbx_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
if (<API key>(state, FE_SYNC_CHANNEL) < 0) {
ret = -EIO;
goto error;
}
<API key>(state, <API key>,
state->i2c_read_buffer, sizeof(struct dibDVBTChannel));
ch = (struct dibDVBTChannel *)state->i2c_read_buffer;
switch (ch->spectrum_inversion & 0x7) {
case 1:
state->fe[0]->dtv_property_cache.inversion = INVERSION_ON;
break;
case 0:
state->fe[0]->dtv_property_cache.inversion = INVERSION_OFF;
break;
default:
case -1:
state->fe[0]->dtv_property_cache.inversion = INVERSION_AUTO;
break;
}
switch (ch->nfft) {
case 0:
state->fe[0]->dtv_property_cache.transmission_mode = <API key>;
break;
case 2:
state->fe[0]->dtv_property_cache.transmission_mode = <API key>;
break;
case 1:
state->fe[0]->dtv_property_cache.transmission_mode = <API key>;
break;
default:
case -1:
state->fe[0]->dtv_property_cache.transmission_mode = <API key>;
break;
}
switch (ch->guard) {
case 0:
state->fe[0]->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_32;
break;
case 1:
state->fe[0]->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_16;
break;
case 2:
state->fe[0]->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_8;
break;
case 3:
state->fe[0]->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_4;
break;
default:
case -1:
state->fe[0]->dtv_property_cache.guard_interval = GUARD_INTERVAL_AUTO;
break;
}
switch (ch->constellation) {
case 2:
state->fe[0]->dtv_property_cache.modulation = QAM_64;
break;
case 1:
state->fe[0]->dtv_property_cache.modulation = QAM_16;
break;
case 0:
state->fe[0]->dtv_property_cache.modulation = QPSK;
break;
default:
case -1:
state->fe[0]->dtv_property_cache.modulation = QAM_AUTO;
break;
}
switch (ch->hrch) {
case 0:
state->fe[0]->dtv_property_cache.hierarchy = HIERARCHY_NONE;
break;
case 1:
state->fe[0]->dtv_property_cache.hierarchy = HIERARCHY_1;
break;
default:
case -1:
state->fe[0]->dtv_property_cache.hierarchy = HIERARCHY_AUTO;
break;
}
switch (ch->code_rate_hp) {
case 1:
state->fe[0]->dtv_property_cache.code_rate_HP = FEC_1_2;
break;
case 2:
state->fe[0]->dtv_property_cache.code_rate_HP = FEC_2_3;
break;
case 3:
state->fe[0]->dtv_property_cache.code_rate_HP = FEC_3_4;
break;
case 5:
state->fe[0]->dtv_property_cache.code_rate_HP = FEC_5_6;
break;
case 7:
state->fe[0]->dtv_property_cache.code_rate_HP = FEC_7_8;
break;
default:
case -1:
state->fe[0]->dtv_property_cache.code_rate_HP = FEC_AUTO;
break;
}
switch (ch->code_rate_lp) {
case 1:
state->fe[0]->dtv_property_cache.code_rate_LP = FEC_1_2;
break;
case 2:
state->fe[0]->dtv_property_cache.code_rate_LP = FEC_2_3;
break;
case 3:
state->fe[0]->dtv_property_cache.code_rate_LP = FEC_3_4;
break;
case 5:
state->fe[0]->dtv_property_cache.code_rate_LP = FEC_5_6;
break;
case 7:
state->fe[0]->dtv_property_cache.code_rate_LP = FEC_7_8;
break;
default:
case -1:
state->fe[0]->dtv_property_cache.code_rate_LP = FEC_AUTO;
break;
}
error:
mutex_unlock(&state->platform.risc.mem_mbx_lock);
return ret;
}
static int <API key>(struct dvb_frontend *fe)
{
struct dib9000_state *state = fe->demodulator_priv;
struct dibDVBTChannel {
s8 spectrum_inversion;
s8 nfft;
s8 guard;
s8 constellation;
s8 hrch;
s8 alpha;
s8 code_rate_hp;
s8 code_rate_lp;
s8 select_hp;
s8 intlv_native;
};
struct dibDVBTChannel ch;
switch (state->fe[0]->dtv_property_cache.inversion) {
case INVERSION_ON:
ch.spectrum_inversion = 1;
break;
case INVERSION_OFF:
ch.spectrum_inversion = 0;
break;
default:
case INVERSION_AUTO:
ch.spectrum_inversion = -1;
break;
}
switch (state->fe[0]->dtv_property_cache.transmission_mode) {
case <API key>:
ch.nfft = 0;
break;
case <API key>:
ch.nfft = 2;
break;
case <API key>:
ch.nfft = 1;
break;
default:
case <API key>:
ch.nfft = 1;
break;
}
switch (state->fe[0]->dtv_property_cache.guard_interval) {
case GUARD_INTERVAL_1_32:
ch.guard = 0;
break;
case GUARD_INTERVAL_1_16:
ch.guard = 1;
break;
case GUARD_INTERVAL_1_8:
ch.guard = 2;
break;
case GUARD_INTERVAL_1_4:
ch.guard = 3;
break;
default:
case GUARD_INTERVAL_AUTO:
ch.guard = -1;
break;
}
switch (state->fe[0]->dtv_property_cache.modulation) {
case QAM_64:
ch.constellation = 2;
break;
case QAM_16:
ch.constellation = 1;
break;
case QPSK:
ch.constellation = 0;
break;
default:
case QAM_AUTO:
ch.constellation = -1;
break;
}
switch (state->fe[0]->dtv_property_cache.hierarchy) {
case HIERARCHY_NONE:
ch.hrch = 0;
break;
case HIERARCHY_1:
case HIERARCHY_2:
case HIERARCHY_4:
ch.hrch = 1;
break;
default:
case HIERARCHY_AUTO:
ch.hrch = -1;
break;
}
ch.alpha = 1;
switch (state->fe[0]->dtv_property_cache.code_rate_HP) {
case FEC_1_2:
ch.code_rate_hp = 1;
break;
case FEC_2_3:
ch.code_rate_hp = 2;
break;
case FEC_3_4:
ch.code_rate_hp = 3;
break;
case FEC_5_6:
ch.code_rate_hp = 5;
break;
case FEC_7_8:
ch.code_rate_hp = 7;
break;
default:
case FEC_AUTO:
ch.code_rate_hp = -1;
break;
}
switch (state->fe[0]->dtv_property_cache.code_rate_LP) {
case FEC_1_2:
ch.code_rate_lp = 1;
break;
case FEC_2_3:
ch.code_rate_lp = 2;
break;
case FEC_3_4:
ch.code_rate_lp = 3;
break;
case FEC_5_6:
ch.code_rate_lp = 5;
break;
case FEC_7_8:
ch.code_rate_lp = 7;
break;
default:
case FEC_AUTO:
ch.code_rate_lp = -1;
break;
}
ch.select_hp = 1;
ch.intlv_native = 1;
<API key>(state, <API key>, (u8 *) &ch);
return 0;
}
static int dib9000_fw_tune(struct dvb_frontend *fe)
{
struct dib9000_state *state = fe->demodulator_priv;
int ret = 10, search = state->channel_status.status == <API key>;
s8 i;
switch (state->tune_state) {
case CT_DEMOD_START:
<API key>(state);
/* write the channel context - a channel is initialized to 0, so it is OK */
<API key>(state, <API key>, (u8 *) fe_info);
<API key>(state, FE_MM_W_FE_INFO, (u8 *) fe_info);
if (search)
dib9000_mbx_send(state, <API key>, NULL, 0);
else {
<API key>(fe);
dib9000_mbx_send(state, <API key>, NULL, 0);
}
state->tune_state = CT_DEMOD_STEP_1;
break;
case CT_DEMOD_STEP_1:
if (search)
<API key>(state, <API key>, state->i2c_read_buffer, 1);
else
<API key>(state, <API key>, state->i2c_read_buffer, 1);
i = (s8)state->i2c_read_buffer[0];
switch (i) { /* something happened */
case 0:
break;
case -2: /* tps locks are "slower" than MPEG locks -> even in autosearch data is OK here */
if (search)
state->status = <API key>;
else {
state->tune_state = CT_DEMOD_STOP;
state->status = FE_STATUS_LOCKED;
}
break;
default:
state->status = <API key>;
state->tune_state = CT_DEMOD_STOP;
break;
}
break;
default:
ret = <API key>;
break;
}
return ret;
}
static int <API key>(struct dvb_frontend *fe, int onoff)
{
struct dib9000_state *state = fe->demodulator_priv;
u16 mode = (u16) onoff;
return dib9000_mbx_send(state, <API key>, &mode, 1);
}
static int <API key>(struct dvb_frontend *fe, int mode)
{
struct dib9000_state *state = fe->demodulator_priv;
u16 outreg, smo_mode;
dprintk("setting output mode for demod %p to %d\n", fe, mode);
switch (mode) {
case <API key>:
outreg = (1 << 10); /* 0x0400 */
break;
case <API key>:
outreg = (1 << 10) | (1 << 6); /* 0x0440 */
break;
case <API key>:
outreg = (1 << 10) | (2 << 6) | (0 << 1); /* 0x0482 */
break;
case OUTMODE_DIVERSITY:
outreg = (1 << 10) | (4 << 6); /* 0x0500 */
break;
case OUTMODE_MPEG2_FIFO:
outreg = (1 << 10) | (5 << 6);
break;
case OUTMODE_HIGH_Z:
outreg = 0;
break;
default:
dprintk("Unhandled output_mode passed to be set for demod %p\n", &state->fe[0]);
return -EINVAL;
}
dib9000_write_word(state, 1795, outreg);
switch (mode) {
case <API key>:
case <API key>:
case <API key>:
case OUTMODE_MPEG2_FIFO:
smo_mode = (dib9000_read_word(state, 295) & 0x0010) | (1 << 1);
if (state->chip.d9.cfg.<API key>)
smo_mode |= (1 << 5);
dib9000_write_word(state, 295, smo_mode);
break;
}
outreg = to_fw_output_mode(mode);
return dib9000_mbx_send(state, <API key>, &outreg, 1);
}
static int dib9000_tuner_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msg[], int num)
{
struct dib9000_state *state = i2c_get_adapdata(i2c_adap);
u16 i, len, t, index_msg;
for (index_msg = 0; index_msg < num; index_msg++) {
if (msg[index_msg].flags & I2C_M_RD) { /* read */
len = msg[index_msg].len;
if (len > 16)
len = 16;
if (dib9000_read_word(state, 790) != 0)
dprintk("TunerITF: read busy\n");
dib9000_write_word(state, 784, (u16) (msg[index_msg].addr));
dib9000_write_word(state, 787, (len / 2) - 1);
dib9000_write_word(state, 786, 1); /* start read */
i = 1000;
while (dib9000_read_word(state, 790) != (len / 2) && i)
i
if (i == 0)
dprintk("TunerITF: read failed\n");
for (i = 0; i < len; i += 2) {
t = dib9000_read_word(state, 785);
msg[index_msg].buf[i] = (t >> 8) & 0xff;
msg[index_msg].buf[i + 1] = (t) & 0xff;
}
if (dib9000_read_word(state, 790) != 0)
dprintk("TunerITF: read more data than expected\n");
} else {
i = 1000;
while (dib9000_read_word(state, 789) && i)
i
if (i == 0)
dprintk("TunerITF: write busy\n");
len = msg[index_msg].len;
if (len > 16)
len = 16;
for (i = 0; i < len; i += 2)
dib9000_write_word(state, 785, (msg[index_msg].buf[i] << 8) | msg[index_msg].buf[i + 1]);
dib9000_write_word(state, 784, (u16) msg[index_msg].addr);
dib9000_write_word(state, 787, (len / 2) - 1);
dib9000_write_word(state, 786, 0); /* start write */
i = 1000;
while (dib9000_read_word(state, 791) > 0 && i)
i
if (i == 0)
dprintk("TunerITF: write failed\n");
}
}
return num;
}
int <API key>(struct dvb_frontend *fe, u16 speed)
{
struct dib9000_state *state = fe->demodulator_priv;
state->component_bus_speed = speed;
return 0;
}
EXPORT_SYMBOL(<API key>);
static int <API key>(struct i2c_adapter *i2c_adap, struct i2c_msg msg[], int num)
{
struct dib9000_state *state = i2c_get_adapdata(i2c_adap);
u8 type = 0; /* I2C */
u8 port = <API key>;
u16 scl = state->component_bus_speed; /* SCL frequency */
struct <API key> *m = &state->platform.risc.fe_mm[<API key>];
u8 p[13] = { 0 };
p[0] = type;
p[1] = port;
p[2] = msg[0].addr << 1;
p[3] = (u8) scl & 0xff; /* scl */
p[4] = (u8) (scl >> 8);
p[7] = 0;
p[8] = 0;
p[9] = (u8) (msg[0].len);
p[10] = (u8) (msg[0].len >> 8);
if ((num > 1) && (msg[1].flags & I2C_M_RD)) {
p[11] = (u8) (msg[1].len);
p[12] = (u8) (msg[1].len >> 8);
} else {
p[11] = 0;
p[12] = 0;
}
if (<API key>(&state->platform.risc.mem_mbx_lock) < 0) {
dprintk("could not get the lock\n");
return 0;
}
<API key>(state, <API key>, p);
{ /* write-part */
<API key>(state, m->addr, msg[0].len, 0);
<API key>(state, msg[0].buf, msg[0].len);
}
/* do the transaction */
if (<API key>(state, <API key>) < 0) {
mutex_unlock(&state->platform.risc.mem_mbx_lock);
return 0;
}
/* read back any possible result */
if ((num > 1) && (msg[1].flags & I2C_M_RD))
<API key>(state, <API key>, msg[1].buf, msg[1].len);
mutex_unlock(&state->platform.risc.mem_mbx_lock);
return num;
}
static u32 dib9000_i2c_func(struct i2c_adapter *adapter)
{
return I2C_FUNC_I2C;
}
static const struct i2c_algorithm dib9000_tuner_algo = {
.master_xfer = dib9000_tuner_xfer,
.functionality = dib9000_i2c_func,
};
static const struct i2c_algorithm <API key> = {
.master_xfer = <API key>,
.functionality = dib9000_i2c_func,
};
struct i2c_adapter *<API key>(struct dvb_frontend *fe)
{
struct dib9000_state *st = fe->demodulator_priv;
return &st->tuner_adap;
}
EXPORT_SYMBOL(<API key>);
struct i2c_adapter *<API key>(struct dvb_frontend *fe)
{
struct dib9000_state *st = fe->demodulator_priv;
return &st->component_bus;
}
EXPORT_SYMBOL(<API key>);
struct i2c_adapter *<API key>(struct dvb_frontend *fe, enum <API key> intf, int gating)
{
struct dib9000_state *st = fe->demodulator_priv;
return <API key>(&st->i2c_master, intf, gating);
}
EXPORT_SYMBOL(<API key>);
int <API key>(struct dvb_frontend *fe, struct i2c_adapter *i2c)
{
struct dib9000_state *st = fe->demodulator_priv;
st->i2c.i2c_adap = i2c;
return 0;
}
EXPORT_SYMBOL(<API key>);
static int dib9000_cfg_gpio(struct dib9000_state *st, u8 num, u8 dir, u8 val)
{
st->gpio_dir = dib9000_read_word(st, 773);
st->gpio_dir &= ~(1 << num); /* reset the direction bit */
st->gpio_dir |= (dir & 0x1) << num; /* set the new direction */
dib9000_write_word(st, 773, st->gpio_dir);
st->gpio_val = dib9000_read_word(st, 774);
st->gpio_val &= ~(1 << num); /* reset the direction bit */
st->gpio_val |= (val & 0x01) << num; /* set the new value */
dib9000_write_word(st, 774, st->gpio_val);
dprintk("gpio dir: %04x: gpio val: %04x\n", st->gpio_dir, st->gpio_val);
return 0;
}
int dib9000_set_gpio(struct dvb_frontend *fe, u8 num, u8 dir, u8 val)
{
struct dib9000_state *state = fe->demodulator_priv;
return dib9000_cfg_gpio(state, num, dir, val);
}
EXPORT_SYMBOL(dib9000_set_gpio);
int <API key>(struct dvb_frontend *fe, u8 onoff)
{
struct dib9000_state *state = fe->demodulator_priv;
u16 val;
int ret;
if ((state->pid_ctrl_index != -2) && (state->pid_ctrl_index < 9)) {
/* postpone the pid filtering cmd */
dprintk("pid filter cmd postpone\n");
state->pid_ctrl_index++;
state->pid_ctrl[state->pid_ctrl_index].cmd = <API key>;
state->pid_ctrl[state->pid_ctrl_index].onoff = onoff;
return 0;
}
if (<API key>(&state->demod_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
val = dib9000_read_word(state, 294 + 1) & 0xffef;
val |= (onoff & 0x1) << 4;
dprintk("PID filter enabled %d\n", onoff);
ret = dib9000_write_word(state, 294 + 1, val);
mutex_unlock(&state->demod_lock);
return ret;
}
EXPORT_SYMBOL(<API key>);
int <API key>(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
{
struct dib9000_state *state = fe->demodulator_priv;
int ret;
if (state->pid_ctrl_index != -2) {
/* postpone the pid filtering cmd */
dprintk("pid filter postpone\n");
if (state->pid_ctrl_index < 9) {
state->pid_ctrl_index++;
state->pid_ctrl[state->pid_ctrl_index].cmd = DIB9000_PID_FILTER;
state->pid_ctrl[state->pid_ctrl_index].id = id;
state->pid_ctrl[state->pid_ctrl_index].pid = pid;
state->pid_ctrl[state->pid_ctrl_index].onoff = onoff;
} else
dprintk("can not add any more pid ctrl cmd\n");
return 0;
}
if (<API key>(&state->demod_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
dprintk("Index %x, PID %d, OnOff %d\n", id, pid, onoff);
ret = dib9000_write_word(state, 300 + 1 + id,
onoff ? (1 << 13) | pid : 0);
mutex_unlock(&state->demod_lock);
return ret;
}
EXPORT_SYMBOL(<API key>);
int <API key>(struct dvb_frontend *fe)
{
struct dib9000_state *state = fe->demodulator_priv;
return dib9000_fw_init(state);
}
EXPORT_SYMBOL(<API key>);
static void dib9000_release(struct dvb_frontend *demod)
{
struct dib9000_state *st = demod->demodulator_priv;
u8 index_frontend;
for (index_frontend = 1; (index_frontend < <API key>) && (st->fe[index_frontend] != NULL); index_frontend++)
dvb_frontend_detach(st->fe[index_frontend]);
<API key>(&st->i2c_master);
i2c_del_adapter(&st->tuner_adap);
i2c_del_adapter(&st->component_bus);
kfree(st->fe[0]);
kfree(st);
}
static int dib9000_wakeup(struct dvb_frontend *fe)
{
return 0;
}
static int dib9000_sleep(struct dvb_frontend *fe)
{
struct dib9000_state *state = fe->demodulator_priv;
u8 index_frontend;
int ret = 0;
if (<API key>(&state->demod_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
for (index_frontend = 1; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++) {
ret = state->fe[index_frontend]->ops.sleep(state->fe[index_frontend]);
if (ret < 0)
goto error;
}
ret = dib9000_mbx_send(state, OUT_MSG_FE_SLEEP, NULL, 0);
error:
mutex_unlock(&state->demod_lock);
return ret;
}
static int <API key>(struct dvb_frontend *fe, struct <API key> *tune)
{
tune->min_delay_ms = 1000;
return 0;
}
static int <API key>(struct dvb_frontend *fe,
struct <API key> *c)
{
struct dib9000_state *state = fe->demodulator_priv;
u8 index_frontend, sub_index_frontend;
enum fe_status stat;
int ret = 0;
if (state-><API key> == 0) {
if (<API key>(&state->demod_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
}
for (index_frontend = 1; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++) {
state->fe[index_frontend]->ops.read_status(state->fe[index_frontend], &stat);
if (stat & FE_HAS_SYNC) {
dprintk("TPS lock on the slave%i\n", index_frontend);
/* synchronize the cache with the other frontends */
state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], c);
for (sub_index_frontend = 0; (sub_index_frontend < <API key>) && (state->fe[sub_index_frontend] != NULL);
sub_index_frontend++) {
if (sub_index_frontend != index_frontend) {
state->fe[sub_index_frontend]->dtv_property_cache.modulation =
state->fe[index_frontend]->dtv_property_cache.modulation;
state->fe[sub_index_frontend]->dtv_property_cache.inversion =
state->fe[index_frontend]->dtv_property_cache.inversion;
state->fe[sub_index_frontend]->dtv_property_cache.transmission_mode =
state->fe[index_frontend]->dtv_property_cache.transmission_mode;
state->fe[sub_index_frontend]->dtv_property_cache.guard_interval =
state->fe[index_frontend]->dtv_property_cache.guard_interval;
state->fe[sub_index_frontend]->dtv_property_cache.hierarchy =
state->fe[index_frontend]->dtv_property_cache.hierarchy;
state->fe[sub_index_frontend]->dtv_property_cache.code_rate_HP =
state->fe[index_frontend]->dtv_property_cache.code_rate_HP;
state->fe[sub_index_frontend]->dtv_property_cache.code_rate_LP =
state->fe[index_frontend]->dtv_property_cache.code_rate_LP;
state->fe[sub_index_frontend]->dtv_property_cache.rolloff =
state->fe[index_frontend]->dtv_property_cache.rolloff;
}
}
ret = 0;
goto return_value;
}
}
/* get the channel from master chip */
ret = <API key>(fe);
if (ret != 0)
goto return_value;
/* synchronize the cache with the other frontends */
for (index_frontend = 1; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++) {
state->fe[index_frontend]->dtv_property_cache.inversion = c->inversion;
state->fe[index_frontend]->dtv_property_cache.transmission_mode = c->transmission_mode;
state->fe[index_frontend]->dtv_property_cache.guard_interval = c->guard_interval;
state->fe[index_frontend]->dtv_property_cache.modulation = c->modulation;
state->fe[index_frontend]->dtv_property_cache.hierarchy = c->hierarchy;
state->fe[index_frontend]->dtv_property_cache.code_rate_HP = c->code_rate_HP;
state->fe[index_frontend]->dtv_property_cache.code_rate_LP = c->code_rate_LP;
state->fe[index_frontend]->dtv_property_cache.rolloff = c->rolloff;
}
ret = 0;
return_value:
if (state-><API key> == 0)
mutex_unlock(&state->demod_lock);
return ret;
}
static int <API key>(struct dvb_frontend *fe, enum frontend_tune_state tune_state)
{
struct dib9000_state *state = fe->demodulator_priv;
state->tune_state = tune_state;
if (tune_state == CT_DEMOD_START)
state->status = <API key>;
return 0;
}
static u32 dib9000_get_status(struct dvb_frontend *fe)
{
struct dib9000_state *state = fe->demodulator_priv;
return state->status;
}
static int <API key>(struct dvb_frontend *fe, struct <API key> *channel_status)
{
struct dib9000_state *state = fe->demodulator_priv;
memcpy(&state->channel_status, channel_status, sizeof(struct <API key>));
return 0;
}
static int <API key>(struct dvb_frontend *fe)
{
struct dib9000_state *state = fe->demodulator_priv;
int sleep_time, sleep_time_slave;
u32 frontend_status;
u8 nbr_pending, exit_condition, index_frontend, <API key>;
struct <API key> channel_status;
/* check that the correct parameters are set */
if (state->fe[0]->dtv_property_cache.frequency == 0) {
dprintk("dib9000: must specify frequency\n");
return 0;
}
if (state->fe[0]->dtv_property_cache.bandwidth_hz == 0) {
dprintk("dib9000: must specify bandwidth\n");
return 0;
}
state->pid_ctrl_index = -1; /* postpone the pid filtering cmd */
if (<API key>(&state->demod_lock) < 0) {
dprintk("could not get the lock\n");
return 0;
}
fe->dtv_property_cache.delivery_system = SYS_DVBT;
/* set the master status */
if (state->fe[0]->dtv_property_cache.transmission_mode == <API key> ||
state->fe[0]->dtv_property_cache.guard_interval == GUARD_INTERVAL_AUTO ||
state->fe[0]->dtv_property_cache.modulation == QAM_AUTO ||
state->fe[0]->dtv_property_cache.code_rate_HP == FEC_AUTO) {
/* no channel specified, autosearch the channel */
state->channel_status.status = <API key>;
} else
state->channel_status.status = <API key>;
/* set mode and status for the different frontends */
for (index_frontend = 0; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++) {
<API key>(state->fe[index_frontend], 1);
/* synchronization of the cache */
memcpy(&state->fe[index_frontend]->dtv_property_cache, &fe->dtv_property_cache, sizeof(struct <API key>));
state->fe[index_frontend]->dtv_property_cache.delivery_system = SYS_DVBT;
<API key>(state->fe[index_frontend], OUTMODE_HIGH_Z);
<API key>(state->fe[index_frontend], &state->channel_status);
<API key>(state->fe[index_frontend], CT_DEMOD_START);
}
/* actual tune */
exit_condition = 0; /* 0: tune pending; 1: tune failed; 2:tune success */
<API key> = 0;
do {
sleep_time = dib9000_fw_tune(state->fe[0]);
for (index_frontend = 1; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++) {
sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend]);
if (sleep_time == <API key>)
sleep_time = sleep_time_slave;
else if ((sleep_time_slave != <API key>) && (sleep_time_slave > sleep_time))
sleep_time = sleep_time_slave;
}
if (sleep_time != <API key>)
msleep(sleep_time / 10);
else
break;
nbr_pending = 0;
exit_condition = 0;
<API key> = 0;
for (index_frontend = 0; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++) {
frontend_status = -dib9000_get_status(state->fe[index_frontend]);
if (frontend_status > -<API key>) {
exit_condition = 2; /* tune success */
<API key> = index_frontend;
break;
}
if (frontend_status == -<API key>)
nbr_pending++; /* some frontends are still tuning */
}
if ((exit_condition != 2) && (nbr_pending == 0))
exit_condition = 1; /* if all tune are done and no success, exit: tune failed */
} while (exit_condition == 0);
/* check the tune result */
if (exit_condition == 1) { /* tune failed */
dprintk("tune failed\n");
mutex_unlock(&state->demod_lock);
/* tune failed; put all the pid filtering cmd to junk */
state->pid_ctrl_index = -1;
return 0;
}
dprintk("tune success on frontend%i\n", <API key>);
/* synchronize all the channel cache */
state-><API key> = 1;
<API key>(state->fe[0], &state->fe[0]->dtv_property_cache);
state-><API key> = 0;
/* retune the other frontends with the found channel */
channel_status.status = <API key>;
for (index_frontend = 0; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++) {
/* only retune the frontends which was not tuned success */
if (index_frontend != <API key>) {
<API key>(state->fe[index_frontend], &channel_status);
<API key>(state->fe[index_frontend], CT_DEMOD_START);
}
}
do {
sleep_time = <API key>;
for (index_frontend = 0; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++) {
if (index_frontend != <API key>) {
sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend]);
if (sleep_time == <API key>)
sleep_time = sleep_time_slave;
else if ((sleep_time_slave != <API key>) && (sleep_time_slave > sleep_time))
sleep_time = sleep_time_slave;
}
}
if (sleep_time != <API key>)
msleep(sleep_time / 10);
else
break;
nbr_pending = 0;
for (index_frontend = 0; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++) {
if (index_frontend != <API key>) {
frontend_status = -dib9000_get_status(state->fe[index_frontend]);
if ((index_frontend != <API key>) && (frontend_status == -<API key>))
nbr_pending++; /* some frontends are still tuning */
}
}
} while (nbr_pending != 0);
/* set the output mode */
<API key>(state->fe[0], state->chip.d9.cfg.output_mode);
for (index_frontend = 1; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++)
<API key>(state->fe[index_frontend], OUTMODE_DIVERSITY);
/* turn off the diversity for the last frontend */
<API key>(state->fe[index_frontend - 1], 0);
mutex_unlock(&state->demod_lock);
if (state->pid_ctrl_index >= 0) {
u8 <API key>;
u8 pid_ctrl_index = state->pid_ctrl_index;
state->pid_ctrl_index = -2;
for (<API key> = 0;
<API key> <= pid_ctrl_index;
<API key>++) {
if (state->pid_ctrl[<API key>].cmd == <API key>)
<API key>(state->fe[0],
state->pid_ctrl[<API key>].onoff);
else if (state->pid_ctrl[<API key>].cmd == DIB9000_PID_FILTER)
<API key>(state->fe[0],
state->pid_ctrl[<API key>].id,
state->pid_ctrl[<API key>].pid,
state->pid_ctrl[<API key>].onoff);
}
}
/* do not postpone any more the pid filtering */
state->pid_ctrl_index = -2;
return 0;
}
static u16 dib9000_read_lock(struct dvb_frontend *fe)
{
struct dib9000_state *state = fe->demodulator_priv;
return dib9000_read_word(state, 535);
}
static int dib9000_read_status(struct dvb_frontend *fe, enum fe_status *stat)
{
struct dib9000_state *state = fe->demodulator_priv;
u8 index_frontend;
u16 lock = 0, lock_slave = 0;
if (<API key>(&state->demod_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
for (index_frontend = 1; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++)
lock_slave |= dib9000_read_lock(state->fe[index_frontend]);
lock = dib9000_read_word(state, 535);
*stat = 0;
if ((lock & 0x8000) || (lock_slave & 0x8000))
*stat |= FE_HAS_SIGNAL;
if ((lock & 0x3000) || (lock_slave & 0x3000))
*stat |= FE_HAS_CARRIER;
if ((lock & 0x0100) || (lock_slave & 0x0100))
*stat |= FE_HAS_VITERBI;
if (((lock & 0x0038) == 0x38) || ((lock_slave & 0x0038) == 0x38))
*stat |= FE_HAS_SYNC;
if ((lock & 0x0008) || (lock_slave & 0x0008))
*stat |= FE_HAS_LOCK;
mutex_unlock(&state->demod_lock);
return 0;
}
static int dib9000_read_ber(struct dvb_frontend *fe, u32 * ber)
{
struct dib9000_state *state = fe->demodulator_priv;
u16 *c;
int ret = 0;
if (<API key>(&state->demod_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
if (<API key>(&state->platform.risc.mem_mbx_lock) < 0) {
dprintk("could not get the lock\n");
ret = -EINTR;
goto error;
}
if (<API key>(state, FE_SYNC_CHANNEL) < 0) {
mutex_unlock(&state->platform.risc.mem_mbx_lock);
ret = -EIO;
goto error;
}
<API key>(state, FE_MM_R_FE_MONITOR,
state->i2c_read_buffer, 16 * 2);
mutex_unlock(&state->platform.risc.mem_mbx_lock);
c = (u16 *)state->i2c_read_buffer;
*ber = c[10] << 16 | c[11];
error:
mutex_unlock(&state->demod_lock);
return ret;
}
static int <API key>(struct dvb_frontend *fe, u16 * strength)
{
struct dib9000_state *state = fe->demodulator_priv;
u8 index_frontend;
u16 *c = (u16 *)state->i2c_read_buffer;
u16 val;
int ret = 0;
if (<API key>(&state->demod_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
*strength = 0;
for (index_frontend = 1; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++) {
state->fe[index_frontend]->ops.<API key>(state->fe[index_frontend], &val);
if (val > 65535 - *strength)
*strength = 65535;
else
*strength += val;
}
if (<API key>(&state->platform.risc.mem_mbx_lock) < 0) {
dprintk("could not get the lock\n");
ret = -EINTR;
goto error;
}
if (<API key>(state, FE_SYNC_CHANNEL) < 0) {
mutex_unlock(&state->platform.risc.mem_mbx_lock);
ret = -EIO;
goto error;
}
<API key>(state, FE_MM_R_FE_MONITOR, (u8 *) c, 16 * 2);
mutex_unlock(&state->platform.risc.mem_mbx_lock);
val = 65535 - c[4];
if (val > 65535 - *strength)
*strength = 65535;
else
*strength += val;
error:
mutex_unlock(&state->demod_lock);
return ret;
}
static u32 dib9000_get_snr(struct dvb_frontend *fe)
{
struct dib9000_state *state = fe->demodulator_priv;
u16 *c = (u16 *)state->i2c_read_buffer;
u32 n, s, exp;
u16 val;
if (<API key>(&state->platform.risc.mem_mbx_lock) < 0) {
dprintk("could not get the lock\n");
return 0;
}
if (<API key>(state, FE_SYNC_CHANNEL) < 0) {
mutex_unlock(&state->platform.risc.mem_mbx_lock);
return 0;
}
<API key>(state, FE_MM_R_FE_MONITOR, (u8 *) c, 16 * 2);
mutex_unlock(&state->platform.risc.mem_mbx_lock);
val = c[7];
n = (val >> 4) & 0xff;
exp = ((val & 0xf) << 2);
val = c[8];
exp += ((val >> 14) & 0x3);
if ((exp & 0x20) != 0)
exp -= 0x40;
n <<= exp + 16;
s = (val >> 6) & 0xFF;
exp = (val & 0x3F);
if ((exp & 0x20) != 0)
exp -= 0x40;
s <<= exp + 16;
if (n > 0) {
u32 t = (s / n) << 16;
return t + ((s << 16) - n * t) / n;
}
return 0xffffffff;
}
static int dib9000_read_snr(struct dvb_frontend *fe, u16 * snr)
{
struct dib9000_state *state = fe->demodulator_priv;
u8 index_frontend;
u32 snr_master;
if (<API key>(&state->demod_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
snr_master = dib9000_get_snr(fe);
for (index_frontend = 1; (index_frontend < <API key>) && (state->fe[index_frontend] != NULL); index_frontend++)
snr_master += dib9000_get_snr(state->fe[index_frontend]);
if ((snr_master >> 16) != 0) {
snr_master = 10 * intlog10(snr_master >> 16);
*snr = snr_master / ((1 << 24) / 10);
} else
*snr = 0;
mutex_unlock(&state->demod_lock);
return 0;
}
static int <API key>(struct dvb_frontend *fe, u32 * unc)
{
struct dib9000_state *state = fe->demodulator_priv;
u16 *c = (u16 *)state->i2c_read_buffer;
int ret = 0;
if (<API key>(&state->demod_lock) < 0) {
dprintk("could not get the lock\n");
return -EINTR;
}
if (<API key>(&state->platform.risc.mem_mbx_lock) < 0) {
dprintk("could not get the lock\n");
ret = -EINTR;
goto error;
}
if (<API key>(state, FE_SYNC_CHANNEL) < 0) {
mutex_unlock(&state->platform.risc.mem_mbx_lock);
ret = -EIO;
goto error;
}
<API key>(state, FE_MM_R_FE_MONITOR, (u8 *) c, 16 * 2);
mutex_unlock(&state->platform.risc.mem_mbx_lock);
*unc = c[12];
error:
mutex_unlock(&state->demod_lock);
return ret;
}
int <API key>(struct i2c_adapter *i2c, int no_of_demods, u8 default_addr, u8 first_addr)
{
int k = 0, ret = 0;
u8 new_addr = 0;
struct i2c_device client = {.i2c_adap = i2c };
client.i2c_write_buffer = kzalloc(4 * sizeof(u8), GFP_KERNEL);
if (!client.i2c_write_buffer) {
dprintk("%s: not enough memory\n", __func__);
return -ENOMEM;
}
client.i2c_read_buffer = kzalloc(4 * sizeof(u8), GFP_KERNEL);
if (!client.i2c_read_buffer) {
dprintk("%s: not enough memory\n", __func__);
ret = -ENOMEM;
goto error_memory;
}
client.i2c_addr = default_addr + 16;
dib9000_i2c_write16(&client, 1796, 0x0);
for (k = no_of_demods - 1; k >= 0; k
/* designated i2c address */
new_addr = first_addr + (k << 1);
client.i2c_addr = default_addr;
dib9000_i2c_write16(&client, 1817, 3);
dib9000_i2c_write16(&client, 1796, 0);
dib9000_i2c_write16(&client, 1227, 1);
dib9000_i2c_write16(&client, 1227, 0);
client.i2c_addr = new_addr;
dib9000_i2c_write16(&client, 1817, 3);
dib9000_i2c_write16(&client, 1796, 0);
dib9000_i2c_write16(&client, 1227, 1);
dib9000_i2c_write16(&client, 1227, 0);
if (dib9000_identify(&client) == 0) {
client.i2c_addr = default_addr;
if (dib9000_identify(&client) == 0) {
dprintk("DiB9000 #%d: not identified\n", k);
ret = -EIO;
goto error;
}
}
dib9000_i2c_write16(&client, 1795, (1 << 10) | (4 << 6));
dib9000_i2c_write16(&client, 1794, (new_addr << 2) | 2);
dprintk("IC %d initialized (to i2c_address 0x%x)\n", k, new_addr);
}
for (k = 0; k < no_of_demods; k++) {
new_addr = first_addr | (k << 1);
client.i2c_addr = new_addr;
dib9000_i2c_write16(&client, 1794, (new_addr << 2));
dib9000_i2c_write16(&client, 1795, 0);
}
error:
kfree(client.i2c_read_buffer);
error_memory:
kfree(client.i2c_write_buffer);
return ret;
}
EXPORT_SYMBOL(<API key>);
int <API key>(struct dvb_frontend *fe, struct dvb_frontend *fe_slave)
{
struct dib9000_state *state = fe->demodulator_priv;
u8 index_frontend = 1;
while ((index_frontend < <API key>) && (state->fe[index_frontend] != NULL))
index_frontend++;
if (index_frontend < <API key>) {
dprintk("set slave fe %p to index %i\n", fe_slave, index_frontend);
state->fe[index_frontend] = fe_slave;
return 0;
}
dprintk("too many slave frontend\n");
return -ENOMEM;
}
EXPORT_SYMBOL(<API key>);
struct dvb_frontend *<API key>(struct dvb_frontend *fe, int slave_index)
{
struct dib9000_state *state = fe->demodulator_priv;
if (slave_index >= <API key>)
return NULL;
return state->fe[slave_index];
}
EXPORT_SYMBOL(<API key>);
static const struct dvb_frontend_ops dib9000_ops;
struct dvb_frontend *dib9000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, const struct dib9000_config *cfg)
{
struct dvb_frontend *fe;
struct dib9000_state *st;
st = kzalloc(sizeof(struct dib9000_state), GFP_KERNEL);
if (st == NULL)
return NULL;
fe = kzalloc(sizeof(struct dvb_frontend), GFP_KERNEL);
if (fe == NULL) {
kfree(st);
return NULL;
}
memcpy(&st->chip.d9.cfg, cfg, sizeof(struct dib9000_config));
st->i2c.i2c_adap = i2c_adap;
st->i2c.i2c_addr = i2c_addr;
st->i2c.i2c_write_buffer = st->i2c_write_buffer;
st->i2c.i2c_read_buffer = st->i2c_read_buffer;
st->gpio_dir = <API key>;
st->gpio_val = <API key>;
st->gpio_pwm_pos = <API key>;
mutex_init(&st->platform.risc.mbx_if_lock);
mutex_init(&st->platform.risc.mbx_lock);
mutex_init(&st->platform.risc.mem_lock);
mutex_init(&st->platform.risc.mem_mbx_lock);
mutex_init(&st->demod_lock);
st-><API key> = 0;
st->pid_ctrl_index = -2;
st->fe[0] = fe;
fe->demodulator_priv = st;
memcpy(&st->fe[0]->ops, &dib9000_ops, sizeof(struct dvb_frontend_ops));
/* Ensure the output mode remains at the previous default if it's
* not specifically set by the caller.
*/
if ((st->chip.d9.cfg.output_mode != <API key>) && (st->chip.d9.cfg.output_mode != <API key>))
st->chip.d9.cfg.output_mode = OUTMODE_MPEG2_FIFO;
if (dib9000_identify(&st->i2c) == 0)
goto error;
<API key>(&st->i2c_master, DIB7000MC, st->i2c.i2c_adap, st->i2c.i2c_addr);
st->tuner_adap.dev.parent = i2c_adap->dev.parent;
strncpy(st->tuner_adap.name, "DIB9000_FW TUNER ACCESS", sizeof(st->tuner_adap.name));
st->tuner_adap.algo = &dib9000_tuner_algo;
st->tuner_adap.algo_data = NULL;
i2c_set_adapdata(&st->tuner_adap, st);
if (i2c_add_adapter(&st->tuner_adap) < 0)
goto error;
st->component_bus.dev.parent = i2c_adap->dev.parent;
strncpy(st->component_bus.name, "DIB9000_FW COMPONENT BUS ACCESS", sizeof(st->component_bus.name));
st->component_bus.algo = &<API key>;
st->component_bus.algo_data = NULL;
st->component_bus_speed = 340;
i2c_set_adapdata(&st->component_bus, st);
if (i2c_add_adapter(&st->component_bus) < 0)
goto <API key>;
dib9000_fw_reset(fe);
return fe;
<API key>:
i2c_del_adapter(&st->tuner_adap);
error:
kfree(st);
return NULL;
}
EXPORT_SYMBOL(dib9000_attach);
static const struct dvb_frontend_ops dib9000_ops = {
.delsys = { SYS_DVBT },
.info = {
.name = "DiBcom 9000",
.frequency_min = 44250000,
.frequency_max = 867250000,
.frequency_stepsize = 62500,
.caps = <API key> |
FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
<API key> | <API key> | FE_CAN_RECOVER | <API key>,
},
.release = dib9000_release,
.init = dib9000_wakeup,
.sleep = dib9000_sleep,
.set_frontend = <API key>,
.get_tune_settings = <API key>,
.get_frontend = <API key>,
.read_status = dib9000_read_status,
.read_ber = dib9000_read_ber,
.<API key> = <API key>,
.read_snr = dib9000_read_snr,
.read_ucblocks = <API key>,
};
MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@posteo.de>");
MODULE_AUTHOR("Olivier Grenie <olivier.grenie@parrot.com>");
MODULE_DESCRIPTION("Driver for the DiBcom 9000 COFDM demodulator");
MODULE_LICENSE("GPL");
|
import path from 'path';
import cp from 'child_process';
/**
* Launches Node.js/Express web server in a separate (forked) process.
*/
export default () => new Promise((resolve, reject) => {
console.log('serve');
const server = cp.fork(path.join(__dirname, '../build/server.js'), {
env: Object.assign({NODE_ENV: 'development'}, process.env)
});
server.once('message', message => {
if (message.match(/^online$/)) {
resolve();
}
});
server.once('error', err => reject(error));
process.on('exit', () => server.kill('SIGTERM'));
});
|
<!DOCTYPE html>
<title>Reference for WebVTT rendering, one line cue and cue that wraps - both should be fully visible</title>
<style>
html { overflow:hidden }
body { margin:0 }
.video {
display: inline-block;
width: 320px;
height: 180px;
position: relative;
font-size: 9px;
}
.cue {
position: absolute;
bottom: 0;
left: 15%;
right: 0;
width: 70%;
text-align: center
}
.cue > span {
font-family: Ahem, sans-serif;
background: rgba(0,0,0,0.8);
color: green;
}
</style>
<div class="video"><span class="cue"><span>This is a test subtitle<br>This test subtitle wraps and should be visible</span></span></div>
|
// file at the top-level directory of this distribution and at
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// #11612
// We weren't updating the auto adjustments with all the resolved
// type information after type check.
// pretty-expanded FIXME #23616
trait A { fn dummy(&self) { } }
struct B<'a, T:'a> {
f: &'a T
}
impl<'a, T> A for B<'a, T> {}
fn foo(_: &A) {}
fn bar<G>(b: &B<G>) {
foo(b); // Coercion should work
foo(b as &A); // Explicit cast should work as well
}
fn main() {}
|
package org.openhab.binding.maxcube.internal.exceptions;
/**
* Will be thrown when there is an attempt to put a new message line into the message processor,
* but the processor is currently processing an other message type.
*
* @author Christian Rockrohr <christian@rockrohr.de>
*/
public class <API key> extends Exception {
private static final long serialVersionUID = -<API key>;
}
|
#include <sys/cdefs.h>
#include <ctype.h>
#include <string.h>
#include <strings.h>
#if !defined(<API key>) && !defined(__OPTIMIZE_SIZE__)
# define RETURN_TYPE char *
# define AVAILABLE(h, h_l, j, n_l) \
(!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
&& ((h_l) = (j) + (n_l)))
#if __GNUC_PREREQ (4, 2)
/* strncasecmp uses signed char, CMP_FUNC is expected to use unsigned char. */
#pragma GCC diagnostic ignored "-Wpointer-sign"
#endif
# define CMP_FUNC strncasecmp
# include "str-two-way.h"
#endif
/*
* Find the first occurrence of find in s, ignore case.
*/
char *
_DEFUN (strcasestr, (s, find),
_CONST char *s _AND
_CONST char *find)
{
#if defined(<API key>) || defined(__OPTIMIZE_SIZE__)
/* Less code size, but quadratic performance in the worst case. */
char c, sc;
size_t len;
if ((c = *find++) != 0) {
c = tolower((unsigned char)c);
len = strlen(find);
do {
do {
if ((sc = *s++) == 0)
return (NULL);
} while ((char)tolower((unsigned char)sc) != c);
} while (strncasecmp(s, find, len) != 0);
s
}
return ((char *)s);
#else /* compilation for speed */
/* Larger code size, but guaranteed linear performance. */
const char *haystack = s;
const char *needle = find;
size_t needle_len; /* Length of NEEDLE. */
size_t haystack_len; /* Known minimum length of HAYSTACK. */
int ok = 1; /* True if NEEDLE is prefix of HAYSTACK. */
/* Determine length of NEEDLE, and in the process, make sure
HAYSTACK is at least as long (no point processing all of a long
NEEDLE if HAYSTACK is too short). */
while (*haystack && *needle)
ok &= (tolower ((unsigned char) *haystack++)
== tolower ((unsigned char) *needle++));
if (*needle)
return NULL;
if (ok)
return (char *) s;
needle_len = needle - find;
haystack = s + 1;
haystack_len = needle_len - 1;
/* Perform the search. */
if (needle_len < <API key>)
return <API key> ((const unsigned char *) haystack,
haystack_len,
(const unsigned char *) find, needle_len);
return two_way_long_needle ((const unsigned char *) haystack, haystack_len,
(const unsigned char *) find, needle_len);
#endif /* compilation for speed */
}
|
// Use, modification and distribution are subject to the
// Note that this file contains quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//[policy_ref_snip7
#include <boost/math/distributions/negative_binomial.hpp>
using boost::math::<API key>;
using namespace boost::math::policies;
typedef <API key><
double,
policy<discrete_quantile<<API key>> >
> dist_type;
// Lower quantile rounded up:
double x = quantile(dist_type(20, 0.3), 0.05); // 28 rounded up from 27.3898
// Upper quantile rounded down:
double y = quantile(complement(dist_type(20, 0.3), 0.05)); // 68 rounded down from 68.1584
//] //[/policy_ref_snip7]
#include <iostream>
using std::cout; using std::endl;
int main()
{
cout << "using policy<discrete_quantile<<API key>> > " << endl
<< "quantile(dist_type(20, 0.3), 0.05) = " << x << endl
<< "quantile(complement(dist_type(20, 0.3), 0.05)) = " << y << endl;
}
/*
Output:
using policy<discrete_quantile<<API key>> >
quantile(dist_type(20, 0.3), 0.05) = 28
quantile(complement(dist_type(20, 0.3), 0.05)) = 68
*/
|
#ifndef __RTL8188E_RECV_H__
#define __RTL8188E_RECV_H__
#include <rtl8192c_recv.h>
#define TX_RPT1_PKT_LEN 8
typedef struct rxreport_8188e
{
//Offset 0
u32 pktlen:14;
u32 crc32:1;
u32 icverr:1;
u32 drvinfosize:4;
u32 security:3;
u32 qos:1;
u32 shift:2;
u32 physt:1;
u32 swdec:1;
u32 ls:1;
u32 fs:1;
u32 eor:1;
u32 own:1;
//Offset 4
u32 macid:5;
u32 tid:4;
u32 hwrsvd:4;
u32 amsdu:1;
u32 paggr:1;
u32 faggr:1;
u32 a1fit:4;
u32 a2fit:4;
u32 pam:1;
u32 pwr:1;
u32 md:1;
u32 mf:1;
u32 type:2;
u32 mc:1;
u32 bc:1;
//Offset 8
u32 seq:12;
u32 frag:4;
u32 nextpktlen:14;
u32 nextind:1;
u32 rsvd0831:1;
//Offset 12
u32 rxmcs:6;
u32 rxht:1;
u32 gf:1;
u32 splcp:1;
u32 bw:1;
u32 htc:1;
u32 eosp:1;
u32 bssidfit:2;
u32 rpt_sel:2;
u32 rsvd1216:13;
u32 pattern_match:1;
u32 unicastwake:1;
u32 magicwake:1;
//Offset 16
/*
u32 pattern0match:1;
u32 pattern1match:1;
u32 pattern2match:1;
u32 pattern3match:1;
u32 pattern4match:1;
u32 pattern5match:1;
u32 pattern6match:1;
u32 pattern7match:1;
u32 pattern8match:1;
u32 pattern9match:1;
u32 patternamatch:1;
u32 patternbmatch:1;
u32 patterncmatch:1;
u32 rsvd1613:19;
*/
u32 rsvd16;
//Offset 20
u32 tsfl;
//Offset 24
u32 bassn:12;
u32 bavld:1;
u32 rsvd2413:19;
} RXREPORT, *PRXREPORT;
#ifdef CONFIG_SDIO_HCI
s32 <API key>(PADAPTER padapter);
void <API key>(PADAPTER padapter);
void rtl8188es_recv_hdl(PADAPTER padapter, struct recv_buf *precvbuf);
#endif
#ifdef CONFIG_USB_HCI
#define <API key> 60
void <API key>(_adapter *padapter, struct recv_buf *precvbuf);
s32 <API key>(PADAPTER padapter);
void <API key>(PADAPTER padapter);
void rtl8188eu_recv_hdl(PADAPTER padapter, struct recv_buf *precvbuf);
void <API key>(void *priv);
#endif
#ifdef CONFIG_PCI_HCI
s32 <API key>(PADAPTER padapter);
void <API key>(PADAPTER padapter);
#endif
void <API key>(union recv_frame *prframe, struct phy_stat *pphy_stat);
void <API key>(PADAPTER padapter, void *prframe);
void <API key>(union recv_frame *precvframe,struct phy_stat *pphy_status);
void <API key>( union recv_frame *precvframe, struct recv_stat *prxstat);
#endif
|
require File.expand_path('../../../spec_helper', __FILE__)
require 'bigdecimal'
describe "BigDecimal#remainder" do
before(:each) do
@zero = BigDecimal("0")
@one = BigDecimal("0")
@mixed = BigDecimal("1.23456789")
@pos_int = BigDecimal("2E5555")
@neg_int = BigDecimal("-2E5555")
@pos_frac = BigDecimal("2E-9999")
@neg_frac = BigDecimal("-2E-9999")
@nan = BigDecimal("NaN")
@infinity = BigDecimal("Infinity")
@infinity_minus = BigDecimal("-Infinity")
@one_minus = BigDecimal("-1")
@frac_1 = BigDecimal("1E-99999")
@frac_2 = BigDecimal("0.9E-99999")
end
it "it equals modulo, if both values are of same sign" do
BigDecimal('<API key>').remainder(BigDecimal('1')).should == @zero
BigDecimal('123456789').remainder(BigDecimal('<API key>')).should == BigDecimal('0.<API key>')
@mixed.remainder(@pos_frac).should == @mixed % @pos_frac
@pos_int.remainder(@pos_frac).should == @pos_int % @pos_frac
@neg_frac.remainder(@neg_int).should == @neg_frac % @neg_int
@neg_int.remainder(@neg_frac).should == @neg_int % @neg_frac
end
it "means self-arg*(self/arg).truncate" do
@mixed.remainder(@neg_frac).should == @mixed - @neg_frac * (@mixed / @neg_frac).truncate
@pos_int.remainder(@neg_frac).should == @pos_int - @neg_frac * (@pos_int / @neg_frac).truncate
@neg_frac.remainder(@pos_int).should == @neg_frac - @pos_int * (@neg_frac / @pos_int).truncate
@neg_int.remainder(@pos_frac).should == @neg_int - @pos_frac * (@neg_int / @pos_frac).truncate
end
it "returns NaN used with zero" do
@mixed.remainder(@zero).nan?.should == true
@zero.remainder(@zero).nan?.should == true
end
it "returns zero if used on zero" do
@zero.remainder(@mixed).should == @zero
end
it "returns NaN if NaN is involved" do
@nan.remainder(@nan).nan?.should == true
@nan.remainder(@one).nan?.should == true
@one.remainder(@nan).nan?.should == true
@infinity.remainder(@nan).nan?.should == true
@nan.remainder(@infinity).nan?.should == true
end
it "returns NaN if Infinity is involved" do
@infinity.remainder(@infinity).nan?.should == true
@infinity.remainder(@one).nan?.should == true
@infinity.remainder(@mixed).nan?.should == true
@infinity.remainder(@one_minus).nan?.should == true
@infinity.remainder(@frac_1).nan?.should == true
@one.remainder(@infinity).nan?.should == true
@infinity_minus.remainder(@infinity_minus).nan?.should == true
@infinity_minus.remainder(@one).nan?.should == true
@one.remainder(@infinity_minus).nan?.should == true
@frac_2.remainder(@infinity_minus).nan?.should == true
@infinity.remainder(@infinity_minus).nan?.should == true
@infinity_minus.remainder(@infinity).nan?.should == true
end
it "coerces arguments to BigDecimal if possible" do
@one.remainder(2).should == @one
end
it "raises TypeError if the argument cannot be coerced to BigDecimal" do
lambda {
@one.remainder('2')
}.should raise_error(TypeError)
end
end
|
(function(){
/* global ResizeSensor: false */
/* global ElementQueries: false */
'use strict';
angular.module('gantt.resizeSensor', ['gantt']).directive('ganttResizeSensor', [function() {
return {
restrict: 'E',
require: '^gantt',
scope: {
enabled: '=?'
},
link: function(scope, element, attrs, ganttCtrl) {
var api = ganttCtrl.gantt.api;
// Load options from global options attribute.
if (scope.options && typeof(scope.options.progress) === 'object') {
for (var option in scope.options.progress) {
scope[option] = scope.options[option];
}
}
if (scope.enabled === undefined) {
scope.enabled = true;
}
function buildSensor() {
var ganttElement = element.parent().parent().parent()[0].querySelectorAll('div.gantt')[0];
return new ResizeSensor(ganttElement, function() {
ganttCtrl.gantt.$scope.ganttElementWidth = ganttElement.clientWidth;
ganttCtrl.gantt.$scope.$apply();
});
}
var rendered = false;
api.core.on.rendered(scope, function() {
rendered = true;
if (sensor !== undefined) {
sensor.detach();
}
if (scope.enabled) {
ElementQueries.update();
sensor = buildSensor();
}
});
var sensor;
scope.$watch('enabled', function(newValue) {
if (rendered) {
if (newValue && sensor === undefined) {
ElementQueries.update();
sensor = buildSensor();
} else if (!newValue && sensor !== undefined) {
sensor.detach();
sensor = undefined;
}
}
});
}
};
}]);
}());
angular.module('gantt.resizeSensor.templates', []).run(['$templateCache', function($templateCache) {
}]);
//# sourceMappingURL=<API key>.js.map
|
// <API key>: GPL-2.0
#include "camss-csiphy.h"
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#define <API key>(n) (0x004 + 0x40 * (n))
#define <API key>(n) (0x008 + 0x40 * (n))
#define <API key> 0x140
#define <API key> 0x144
#define <API key> 0x164
#define <API key> 0x188
#define <API key>(n) (0x18c + 0x4 * (n))
#define <API key>(n) (0x1ac + 0x4 * (n))
#define <API key>(n) (0x1cc + 0x4 * (n))
#define <API key> 0x1ec
#define <API key> 0x1f4
static void <API key>(struct csiphy_device *csiphy,
struct device *dev)
{
u8 hw_version = readl_relaxed(csiphy->base +
<API key>);
dev_dbg(dev, "CSIPHY HW Version = 0x%02x\n", hw_version);
}
/*
* csiphy_reset - Perform software reset on CSIPHY module
* @csiphy: CSIPHY device
*/
static void csiphy_reset(struct csiphy_device *csiphy)
{
writel_relaxed(0x1, csiphy->base + <API key>);
usleep_range(5000, 8000);
writel_relaxed(0x0, csiphy->base + <API key>);
}
/*
* <API key> - Calculate settle count value
*
* Helper function to calculate settle count value. This is
* based on the CSI2 T_hs_settle parameter which in turn
* is calculated based on the CSI2 transmitter link frequency.
*
* Return settle count value or 0 if the CSI2 link frequency
* is not available
*/
static u8 <API key>(s64 link_freq, u32 timer_clk_rate)
{
u32 ui;
u32 timer_period;
u32 t_hs_prepare_max;
u32 <API key>;
u32 t_hs_settle;
u8 settle_cnt;
if (link_freq <= 0)
return 0;
ui = div_u64(1000000000000LL, link_freq);
ui /= 2;
t_hs_prepare_max = 85000 + 6 * ui;
<API key> = 145000 + 10 * ui;
t_hs_settle = (t_hs_prepare_max + <API key>) / 2;
timer_period = div_u64(1000000000000LL, timer_clk_rate);
settle_cnt = t_hs_settle / timer_period - 1;
return settle_cnt;
}
static void csiphy_lanes_enable(struct csiphy_device *csiphy,
struct csiphy_config *cfg,
s64 link_freq, u8 lane_mask)
{
struct csiphy_lanes_cfg *c = &cfg->csi2->lane_cfg;
u8 settle_cnt;
u8 val, l = 0;
int i = 0;
settle_cnt = <API key>(link_freq, csiphy->timer_clk_rate);
writel_relaxed(0x1, csiphy->base +
<API key>);
writel_relaxed(0x1, csiphy->base +
<API key>);
val = 0x1;
val |= lane_mask << 1;
writel_relaxed(val, csiphy->base + <API key>);
val = cfg->combo_mode << 4;
writel_relaxed(val, csiphy->base + <API key>);
for (i = 0; i <= c->num_data; i++) {
if (i == c->num_data)
l = c->clk.pos;
else
l = c->data[i].pos;
writel_relaxed(0x10, csiphy->base +
<API key>(l));
writel_relaxed(settle_cnt, csiphy->base +
<API key>(l));
writel_relaxed(0x3f, csiphy->base +
<API key>(l));
writel_relaxed(0x3f, csiphy->base +
<API key>(l));
}
}
static void <API key>(struct csiphy_device *csiphy,
struct csiphy_config *cfg)
{
struct csiphy_lanes_cfg *c = &cfg->csi2->lane_cfg;
u8 l = 0;
int i = 0;
for (i = 0; i <= c->num_data; i++) {
if (i == c->num_data)
l = c->clk.pos;
else
l = c->data[i].pos;
writel_relaxed(0x0, csiphy->base +
<API key>(l));
}
writel_relaxed(0x0, csiphy->base + <API key>);
}
/*
* csiphy_isr - CSIPHY module interrupt handler
* @irq: Interrupt line
* @dev: CSIPHY device
*
* Return IRQ_HANDLED on success
*/
static irqreturn_t csiphy_isr(int irq, void *dev)
{
struct csiphy_device *csiphy = dev;
u8 i;
for (i = 0; i < 8; i++) {
u8 val = readl_relaxed(csiphy->base +
<API key>(i));
writel_relaxed(val, csiphy->base +
<API key>(i));
writel_relaxed(0x1, csiphy->base + <API key>);
writel_relaxed(0x0, csiphy->base + <API key>);
writel_relaxed(0x0, csiphy->base +
<API key>(i));
}
return IRQ_HANDLED;
}
const struct csiphy_hw_ops csiphy_ops_2ph_1_0 = {
.hw_version_read = <API key>,
.reset = csiphy_reset,
.lanes_enable = csiphy_lanes_enable,
.lanes_disable = <API key>,
.isr = csiphy_isr,
};
|
#include "msm_fb.h"
#include "mddihost.h"
#include "mddihosti.h"
#define SHARP_QVGA_PRIM 1
#define SHARP_128X128_SECD 2
extern uint32 <API key>;
static boolean <API key> = FALSE;
static boolean <API key> = TRUE;
static boolean <API key> = TRUE;
static boolean <API key> = FALSE;
static uint32 <API key> = 13830; /* 5200000/376 */
static uint32 <API key> = 338;
static uint32 <API key> = 24440; /* (376+338)/5200000 */
static boolean <API key> = FALSE;
extern mddi_gpio_info_type mddi_gpio;
extern boolean <API key>;
static <API key> <API key>;
static void *<API key>;
static uint16 <API key>;
static void <API key>(void);
static void <API key>(void);
static void <API key>(struct msm_fb_data_type *mfd);
static void <API key>(<API key> handler,
void *);
static void <API key>(boolean detected);
static struct <API key> *mddi_sharp_pdata;
#define REG_SYSCTL 0x0000
#define REG_INTR 0x0006
#define REG_CLKCNF 0x000C
#define REG_CLKDIV1 0x000E
#define REG_CLKDIV2 0x0010
#define REG_GIOD 0x0040
#define REG_GIOA 0x0042
#define REG_AGM 0x010A
#define REG_FLFT 0x0110
#define REG_FRGT 0x0112
#define REG_FTOP 0x0114
#define REG_FBTM 0x0116
#define REG_FSTRX 0x0118
#define REG_FSTRY 0x011A
#define REG_VRAM 0x0202
#define REG_SSDCTL 0x0330
#define REG_SSD0 0x0332
#define REG_PSTCTL1 0x0400
#define REG_PSTCTL2 0x0402
#define REG_PTGCTL 0x042A
#define REG_PTHP 0x042C
#define REG_PTHB 0x042E
#define REG_PTHW 0x0430
#define REG_PTHF 0x0432
#define REG_PTVP 0x0434
#define REG_PTVB 0x0436
#define REG_PTVW 0x0438
#define REG_PTVF 0x043A
#define REG_VBLKS 0x0458
#define REG_VBLKE 0x045A
#define REG_SUBCTL 0x0700
#define REG_SUBTCMD 0x0702
#define REG_SUBTCMDD 0x0704
#define REG_REVBYTE 0x0A02
#define REG_REVCNT 0x0A04
#define REG_REVATTR 0x0A06
#define REG_REVFMT 0x0A08
#define SHARP_SUB_UNKNOWN 0xffffffff
#define SHARP_SUB_HYNIX 1
#define SHARP_SUB_ROHM 2
static uint32 sharp_subpanel_type = SHARP_SUB_UNKNOWN;
static void sub_through_write(int sub_rs, uint32 sub_data)
{
<API key>(REG_SUBTCMDD, sub_data, FALSE, 0);
/* CS=1,RD=1,WE=1,RS=sub_rs */
<API key>(REG_SUBTCMD, 0x000e | sub_rs, FALSE, 0);
/* CS=0,RD=1,WE=1,RS=sub_rs */
<API key>(REG_SUBTCMD, 0x0006 | sub_rs, FALSE, 0);
/* CS=0,RD=1,WE=0,RS=sub_rs */
<API key>(REG_SUBTCMD, 0x0004 | sub_rs, FALSE, 0);
/* CS=0,RD=1,WE=1,RS=sub_rs */
<API key>(REG_SUBTCMD, 0x0006 | sub_rs, FALSE, 0);
/* CS=1,RD=1,WE=1,RS=sub_rs */
<API key>(REG_SUBTCMD, 0x000e | sub_rs, TRUE, 0);
}
static uint32 sub_through_read(int sub_rs)
{
uint32 sub_data;
/* CS=1,RD=1,WE=1,RS=sub_rs */
<API key>(REG_SUBTCMD, 0x000e | sub_rs, FALSE, 0);
/* CS=0,RD=1,WE=1,RS=sub_rs */
<API key>(REG_SUBTCMD, 0x0006 | sub_rs, FALSE, 0);
/* CS=0,RD=1,WE=0,RS=sub_rs */
<API key>(REG_SUBTCMD, 0x0002 | sub_rs, TRUE, 0);
<API key>(REG_SUBTCMDD, &sub_data, TRUE, 0);
/* CS=0,RD=1,WE=1,RS=sub_rs */
<API key>(REG_SUBTCMD, 0x0006 | sub_rs, FALSE, 0);
/* CS=1,RD=1,WE=1,RS=sub_rs */
<API key>(REG_SUBTCMD, 0x000e | sub_rs, TRUE, 0);
return sub_data;
}
static void serigo(uint32 ssd)
{
uint32 ssdctl;
<API key>(REG_SSDCTL, &ssdctl, TRUE, 0);
ssdctl = ((ssdctl & 0xE7) | 0x02);
<API key>(REG_SSD0, ssd, FALSE, 0);
<API key>(REG_SSDCTL, ssdctl, TRUE, 0);
do {
<API key>(REG_SSDCTL, &ssdctl, TRUE, 0);
} while ((ssdctl & 0x0002) != 0);
if (<API key>)
mddi_wait(2);
}
static void <API key>(void)
{
serigo(0x0131);
serigo(0x0300);
mddi_wait(40);
serigo(0x0135);
mddi_wait(20);
serigo(0x2122);
mddi_wait(20);
serigo(0x0201);
mddi_wait(20);
serigo(0x2100);
mddi_wait(20);
serigo(0x2000);
mddi_wait(20);
<API key>(REG_PSTCTL1, 0x1, TRUE, 0);
mddi_wait(100);
<API key>(REG_PSTCTL1, 0x0, TRUE, 0);
mddi_wait(2);
<API key>(REG_SYSCTL, 0x1, TRUE, 0);
mddi_wait(2);
<API key>(REG_CLKDIV1, 0x3, TRUE, 0);
mddi_wait(2);
<API key>(REG_SSDCTL, 0x0000, TRUE, 0); /* SSDRESET */
<API key>(REG_SYSCTL, 0x0, TRUE, 0);
mddi_wait(2);
}
static void <API key>(struct msm_fb_data_type *mfd)
{
uint32 regdata;
int32 level;
int max = mfd->panel_info.bl_max;
int min = mfd->panel_info.bl_min;
if (mddi_sharp_pdata && mddi_sharp_pdata->backlight_level) {
level = mddi_sharp_pdata->backlight_level(mfd->bl_level,
max,
min);
if (level < 0)
return;
/* use Rodem GPIO(2:0) to give 8 levels of backlight (7-0) */
/* Set lower 3 GPIOs as Outputs (set to 0) */
<API key>(REG_GIOA, ®data, TRUE, 0);
<API key>(REG_GIOA, regdata & 0xfff8, TRUE, 0);
/* Set lower 3 GPIOs as level */
<API key>(REG_GIOD, ®data, TRUE, 0);
<API key>(REG_GIOD,
(regdata & 0xfff8) | (0x07 & level), TRUE, 0);
}
}
static void <API key>(void)
{
<API key>(REG_SYSCTL, 0x4000, TRUE, 0);
mddi_wait(1);
<API key>(REG_SYSCTL, 0x0000, TRUE, 0);
mddi_wait(5);
<API key>(REG_SYSCTL, 0x0001, FALSE, 0);
<API key>(REG_CLKDIV1, 0x000b, FALSE, 0);
/* new reg write below */
if (<API key>)
<API key>(REG_CLKCNF, 0x070d, FALSE, 0);
else
<API key>(REG_CLKCNF, 0x0708, FALSE, 0);
<API key>(REG_SYSCTL, 0x0201, FALSE, 0);
<API key>(REG_PTGCTL, 0x0010, FALSE, 0);
<API key>(REG_PTHP, 4, FALSE, 0);
<API key>(REG_PTHB, 40, FALSE, 0);
<API key>(REG_PTHW, 240, FALSE, 0);
if (<API key>)
<API key>(REG_PTHF, 12, FALSE, 0);
else
<API key>(REG_PTHF, 92, FALSE, 0);
mddi_wait(1);
<API key>(REG_PTVP, 1, FALSE, 0);
<API key>(REG_PTVB, 2, FALSE, 0);
<API key>(REG_PTVW, 320, FALSE, 0);
<API key>(REG_PTVF, 15, FALSE, 0);
mddi_wait(1);
/* vram_color set REG_AGM???? */
<API key>(REG_AGM, 0x0000, TRUE, 0);
<API key>(REG_SSDCTL, 0x0000, FALSE, 0);
<API key>(REG_SSDCTL, 0x0001, TRUE, 0);
mddi_wait(1);
<API key>(REG_PSTCTL1, 0x0001, TRUE, 0);
mddi_wait(10);
serigo(0x0701);
/* software reset */
mddi_wait(1);
/* Wait over 50us */
serigo(0x0400);
/* DCLK~ACHSYNC~ACVSYNC polarity setting */
serigo(0x2900);
/* EEPROM start read address setting */
serigo(0x2606);
/* EEPROM start read register setting */
mddi_wait(20);
/* Wait over 20ms */
serigo(0x0503);
/* Horizontal timing setting */
serigo(0x062C);
/* Veritical timing setting */
serigo(0x2001);
/* power initialize setting(VDC2) */
mddi_wait(20);
/* Wait over 20ms */
serigo(0x2120);
/* Initialize power setting(CPS) */
mddi_wait(20);
/* Wait over 20ms */
serigo(0x2130);
/* Initialize power setting(CPS) */
mddi_wait(20);
/* Wait over 20ms */
serigo(0x2132);
/* Initialize power setting(CPS) */
mddi_wait(10);
/* Wait over 10ms */
serigo(0x2133);
/* Initialize power setting(CPS) */
mddi_wait(20);
/* Wait over 20ms */
serigo(0x0200);
/* Panel initialize release(INIT) */
mddi_wait(1);
/* Wait over 1ms */
serigo(0x0131);
/* Panel setting(CPS) */
mddi_wait(1);
/* Wait over 1ms */
<API key>(REG_PSTCTL1, 0x0003, TRUE, 0);
/* if (FFA LCD is upside down) -> serigo(0x0100); */
serigo(0x0130);
/* Black mask release(display ON) */
mddi_wait(1);
/* Wait over 1ms */
if (<API key>) {
<API key>(REG_VBLKS, 0x1001, TRUE, 0);
<API key>(REG_VBLKE, 0x1002, TRUE, 0);
}
/* Set the MDP pixel data attributes for Primary Display */
<API key>(0x00C3);
return;
}
void <API key>(void)
{
<API key>(REG_SYSCTL, 0x4000, FALSE, 0);
<API key>(REG_SYSCTL, 0x0000, TRUE, 0);
mddi_wait(100);
<API key>(REG_SYSCTL, 0x0001, FALSE, 0);
<API key>(REG_CLKDIV1, 0x000b, FALSE, 0);
<API key>(REG_CLKCNF, 0x0708, FALSE, 0);
<API key>(REG_SYSCTL, 0x0201, FALSE, 0);
<API key>(REG_PTGCTL, 0x0010, FALSE, 0);
<API key>(REG_PTHP, 4, FALSE, 0);
<API key>(REG_PTHB, 40, FALSE, 0);
<API key>(REG_PTHW, 128, FALSE, 0);
<API key>(REG_PTHF, 92, FALSE, 0);
<API key>(REG_PTVP, 1, FALSE, 0);
<API key>(REG_PTVB, 2, FALSE, 0);
<API key>(REG_PTVW, 128, FALSE, 0);
<API key>(REG_PTVF, 15, FALSE, 0);
/* Now the sub display..... */
/* Reset High */
<API key>(REG_SUBCTL, 0x0200, FALSE, 0);
/* CS=1,RD=1,WE=1,RS=1 */
<API key>(REG_SUBTCMD, 0x000f, TRUE, 0);
mddi_wait(1);
/* Wait 5us */
if (sharp_subpanel_type == SHARP_SUB_UNKNOWN) {
uint32 data;
sub_through_write(1, 0x05);
sub_through_write(1, 0x6A);
sub_through_write(1, 0x1D);
sub_through_write(1, 0x05);
data = sub_through_read(1);
if (data == 0x6A) {
sharp_subpanel_type = SHARP_SUB_HYNIX;
} else {
sub_through_write(0, 0x36);
sub_through_write(1, 0xA8);
sub_through_write(0, 0x09);
data = sub_through_read(1);
data = sub_through_read(1);
if (data == 0x54) {
sub_through_write(0, 0x36);
sub_through_write(1, 0x00);
sharp_subpanel_type = SHARP_SUB_ROHM;
}
}
}
if (sharp_subpanel_type == SHARP_SUB_HYNIX) {
sub_through_write(1, 0x00); /* Display setting 1 */
sub_through_write(1, 0x04);
sub_through_write(1, 0x01);
sub_through_write(1, 0x05);
sub_through_write(1, 0x0280);
sub_through_write(1, 0x0301);
sub_through_write(1, 0x0402);
sub_through_write(1, 0x0500);
sub_through_write(1, 0x0681);
sub_through_write(1, 0x077F);
sub_through_write(1, 0x08C0);
sub_through_write(1, 0x0905);
sub_through_write(1, 0x0A02);
sub_through_write(1, 0x0B00);
sub_through_write(1, 0x0C00);
sub_through_write(1, 0x0D00);
sub_through_write(1, 0x0E00);
sub_through_write(1, 0x0F00);
sub_through_write(1, 0x100B); /* Display setting 2 */
sub_through_write(1, 0x1103);
sub_through_write(1, 0x1237);
sub_through_write(1, 0x1300);
sub_through_write(1, 0x1400);
sub_through_write(1, 0x1500);
sub_through_write(1, 0x1605);
sub_through_write(1, 0x1700);
sub_through_write(1, 0x1800);
sub_through_write(1, 0x192E);
sub_through_write(1, 0x1A00);
sub_through_write(1, 0x1B00);
sub_through_write(1, 0x1C00);
sub_through_write(1, 0x151A); /* Power setting */
sub_through_write(1, 0x2002); /* Gradation Palette setting */
sub_through_write(1, 0x2107);
sub_through_write(1, 0x220C);
sub_through_write(1, 0x2310);
sub_through_write(1, 0x2414);
sub_through_write(1, 0x2518);
sub_through_write(1, 0x261C);
sub_through_write(1, 0x2720);
sub_through_write(1, 0x2824);
sub_through_write(1, 0x2928);
sub_through_write(1, 0x2A2B);
sub_through_write(1, 0x2B2E);
sub_through_write(1, 0x2C31);
sub_through_write(1, 0x2D34);
sub_through_write(1, 0x2E37);
sub_through_write(1, 0x2F3A);
sub_through_write(1, 0x303C);
sub_through_write(1, 0x313E);
sub_through_write(1, 0x323F);
sub_through_write(1, 0x3340);
sub_through_write(1, 0x3441);
sub_through_write(1, 0x3543);
sub_through_write(1, 0x3646);
sub_through_write(1, 0x3749);
sub_through_write(1, 0x384C);
sub_through_write(1, 0x394F);
sub_through_write(1, 0x3A52);
sub_through_write(1, 0x3B59);
sub_through_write(1, 0x3C60);
sub_through_write(1, 0x3D67);
sub_through_write(1, 0x3E6E);
sub_through_write(1, 0x3F7F);
sub_through_write(1, 0x4001);
sub_through_write(1, 0x4107);
sub_through_write(1, 0x420C);
sub_through_write(1, 0x4310);
sub_through_write(1, 0x4414);
sub_through_write(1, 0x4518);
sub_through_write(1, 0x461C);
sub_through_write(1, 0x4720);
sub_through_write(1, 0x4824);
sub_through_write(1, 0x4928);
sub_through_write(1, 0x4A2B);
sub_through_write(1, 0x4B2E);
sub_through_write(1, 0x4C31);
sub_through_write(1, 0x4D34);
sub_through_write(1, 0x4E37);
sub_through_write(1, 0x4F3A);
sub_through_write(1, 0x503C);
sub_through_write(1, 0x513E);
sub_through_write(1, 0x523F);
sub_through_write(1, 0x5340);
sub_through_write(1, 0x5441);
sub_through_write(1, 0x5543);
sub_through_write(1, 0x5646);
sub_through_write(1, 0x5749);
sub_through_write(1, 0x584C);
sub_through_write(1, 0x594F);
sub_through_write(1, 0x5A52);
sub_through_write(1, 0x5B59);
sub_through_write(1, 0x5C60);
sub_through_write(1, 0x5D67);
sub_through_write(1, 0x5E6E);
sub_through_write(1, 0x5F7E);
sub_through_write(1, 0x6000);
sub_through_write(1, 0x6107);
sub_through_write(1, 0x620C);
sub_through_write(1, 0x6310);
sub_through_write(1, 0x6414);
sub_through_write(1, 0x6518);
sub_through_write(1, 0x661C);
sub_through_write(1, 0x6720);
sub_through_write(1, 0x6824);
sub_through_write(1, 0x6928);
sub_through_write(1, 0x6A2B);
sub_through_write(1, 0x6B2E);
sub_through_write(1, 0x6C31);
sub_through_write(1, 0x6D34);
sub_through_write(1, 0x6E37);
sub_through_write(1, 0x6F3A);
sub_through_write(1, 0x703C);
sub_through_write(1, 0x713E);
sub_through_write(1, 0x723F);
sub_through_write(1, 0x7340);
sub_through_write(1, 0x7441);
sub_through_write(1, 0x7543);
sub_through_write(1, 0x7646);
sub_through_write(1, 0x7749);
sub_through_write(1, 0x784C);
sub_through_write(1, 0x794F);
sub_through_write(1, 0x7A52);
sub_through_write(1, 0x7B59);
sub_through_write(1, 0x7C60);
sub_through_write(1, 0x7D67);
sub_through_write(1, 0x7E6E);
sub_through_write(1, 0x7F7D);
sub_through_write(1, 0x1851); /* Display on */
<API key>(REG_AGM, 0x0000, TRUE, 0);
/* 1 pixel / 1 post clock */
<API key>(REG_CLKDIV2, 0x3b00, FALSE, 0);
/* SUB LCD select */
<API key>(REG_PSTCTL2, 0x0080, FALSE, 0);
/* RS=0,command initiate number=0,select master mode */
<API key>(REG_SUBCTL, 0x0202, FALSE, 0);
/* Sub LCD Data transform start */
<API key>(REG_PSTCTL1, 0x0003, FALSE, 0);
} else if (sharp_subpanel_type == SHARP_SUB_ROHM) {
sub_through_write(0, 0x01); /* Display setting */
sub_through_write(1, 0x00);
mddi_wait(1);
sub_through_write(0, 0xB6);
sub_through_write(1, 0x0C);
sub_through_write(1, 0x4A);
sub_through_write(1, 0x20);
sub_through_write(0, 0x3A);
sub_through_write(1, 0x05);
sub_through_write(0, 0xB7);
sub_through_write(1, 0x01);
sub_through_write(0, 0xBA);
sub_through_write(1, 0x20);
sub_through_write(1, 0x02);
sub_through_write(0, 0x25);
sub_through_write(1, 0x4F);
sub_through_write(0, 0xBB);
sub_through_write(1, 0x00);
sub_through_write(0, 0x36);
sub_through_write(1, 0x00);
sub_through_write(0, 0xB1);
sub_through_write(1, 0x05);
sub_through_write(0, 0xBE);
sub_through_write(1, 0x80);
sub_through_write(0, 0x26);
sub_through_write(1, 0x01);
sub_through_write(0, 0x2A);
sub_through_write(1, 0x02);
sub_through_write(1, 0x81);
sub_through_write(0, 0x2B);
sub_through_write(1, 0x00);
sub_through_write(1, 0x7F);
sub_through_write(0, 0x2C);
sub_through_write(0, 0x11); /* Sleep mode off */
mddi_wait(1);
sub_through_write(0, 0x29); /* Display on */
sub_through_write(0, 0xB3);
sub_through_write(1, 0x20);
sub_through_write(1, 0xAA);
sub_through_write(1, 0xA0);
sub_through_write(1, 0x20);
sub_through_write(1, 0x30);
sub_through_write(1, 0xA6);
sub_through_write(1, 0xFF);
sub_through_write(1, 0x9A);
sub_through_write(1, 0x9F);
sub_through_write(1, 0xAF);
sub_through_write(1, 0xBC);
sub_through_write(1, 0xCF);
sub_through_write(1, 0xDF);
sub_through_write(1, 0x20);
sub_through_write(1, 0x9C);
sub_through_write(1, 0x8A);
sub_through_write(0, 0x002C); /* Display on */
/* 1 pixel / 2 post clock */
<API key>(REG_CLKDIV2, 0x7b00, FALSE, 0);
/* SUB LCD select */
<API key>(REG_PSTCTL2, 0x0080, FALSE, 0);
/* RS=1,command initiate number=0,select master mode */
<API key>(REG_SUBCTL, 0x0242, FALSE, 0);
/* Sub LCD Data transform start */
<API key>(REG_PSTCTL1, 0x0003, FALSE, 0);
}
/* Set the MDP pixel data attributes for Sub Display */
<API key>(0x00C0);
}
void <API key>(boolean detected)
{
/* static timetick_type start_time = 0; */
static struct timeval start_time;
static boolean first_time = TRUE;
/* uint32 mdp_cnt_val = 0; */
/* timetick_type elapsed_us; */
struct timeval now;
uint32 elapsed_us;
uint32 num_vsyncs;
if ((detected) || (<API key> > 5)) {
if ((detected) && (<API key>)) {
/* if (start_time != 0) */
if (!first_time) {
jiffies_to_timeval(jiffies, &now);
elapsed_us =
(now.tv_sec - start_time.tv_sec) * 1000000 +
now.tv_usec - start_time.tv_usec;
/*
* LCD is configured for a refresh every usecs,
* so to determine the number of vsyncs that
* have occurred since the last measurement add
* half that to the time difference and divide
* by the refresh rate.
*/
num_vsyncs = (elapsed_us +
(<API key> >>
1)) /
<API key>;
/*
* LCD is configured for * hsyncs (rows) per
* refresh cycle. Calculate new rows_per_second
* value based upon these new measurements.
* MDP can update with this new value.
*/
<API key> =
(<API key> * 1000 *
num_vsyncs) / (elapsed_us / 1000);
}
/* start_time = timetick_get(); */
first_time = FALSE;
jiffies_to_timeval(jiffies, &start_time);
if (<API key>) {
/* mdp_cnt_val = MDP_LINE_COUNT; */
}
}
/* if detected = TRUE, client initiated wakeup was detected */
if (<API key> != NULL) {
(*<API key>)
(<API key>);
<API key> = NULL;
}
<API key> = FALSE;
<API key> = 0;
/* need to clear this vsync wakeup */
if (!<API key>(REG_INTR, 0x0000)) {
MDDI_MSG_ERR("Vsync interrupt clear failed!\n");
}
if (!detected) {
/* give up after 5 failed attempts but show error */
MDDI_MSG_NOTICE("Vsync detection failed!\n");
} else if ((<API key>) &&
(<API key>)) {
MDDI_MSG_NOTICE(" Lines Per Second=%d!\n",
<API key>);
}
} else
/* if detected = FALSE, we woke up from hibernation, but did not
* detect client initiated wakeup.
*/
<API key>++;
}
/* ISR to be executed */
void <API key>(<API key> handler, void *arg)
{
boolean error = FALSE;
unsigned long flags;
/* Disable interrupts */
spin_lock_irqsave(&mddi_host_spin_lock, flags);
/* INTLOCK(); */
if (<API key> != NULL)
error = TRUE;
/* Register the handler for this particular GROUP interrupt source */
<API key> = handler;
<API key> = arg;
/* Restore interrupts */
<API key>(&mddi_host_spin_lock, flags);
/* INTFREE(); */
if (error)
MDDI_MSG_ERR("MDDI: Previous Vsync handler never called\n");
/* Enable the vsync wakeup */
<API key>(REG_INTR, 0x8100, FALSE, 0);
<API key> = 1;
<API key> = TRUE;
} /* <API key> */
static int mddi_sharp_lcd_on(struct platform_device *pdev)
{
struct msm_fb_data_type *mfd;
mfd = <API key>(pdev);
if (!mfd)
return -ENODEV;
if (mfd->key != MFD_KEY)
return -EINVAL;
<API key>();
if (mfd->panel.id == SHARP_QVGA_PRIM)
<API key>();
else
<API key>();
return 0;
}
static int mddi_sharp_lcd_off(struct platform_device *pdev)
{
if (<API key> != NULL) {
(*<API key>)
(<API key>);
<API key> = NULL;
printk(KERN_INFO "%s: clean up vsyn_handler=%x\n", __func__,
(int)<API key>);
}
<API key>();
return 0;
}
static int __devinit mddi_sharp_probe(struct platform_device *pdev)
{
if (pdev->id == 0) {
mddi_sharp_pdata = pdev->dev.platform_data;
return 0;
}
msm_fb_add_device(pdev);
return 0;
}
static struct platform_driver this_driver = {
.probe = mddi_sharp_probe,
.driver = {
.name = "mddi_sharp_qvga",
},
};
static struct msm_fb_panel_data <API key> = {
.on = mddi_sharp_lcd_on,
.off = mddi_sharp_lcd_off,
.set_backlight = <API key>,
.set_vsync_notifier = <API key>,
};
static struct platform_device this_device_0 = {
.name = "mddi_sharp_qvga",
.id = SHARP_QVGA_PRIM,
.dev = {
.platform_data = &<API key>,
}
};
static struct msm_fb_panel_data <API key> = {
.on = mddi_sharp_lcd_on,
.off = mddi_sharp_lcd_off,
};
static struct platform_device this_device_1 = {
.name = "mddi_sharp_qvga",
.id = SHARP_128X128_SECD,
.dev = {
.platform_data = &<API key>,
}
};
static int __init mddi_sharp_init(void)
{
int ret;
struct msm_panel_info *pinfo;
#ifdef <API key>
u32 id;
ret = <API key>("mddi_sharp_qvga");
if (ret == -ENODEV)
return 0;
if (ret) {
id = mddi_get_client_id();
if (((id >> 16) != 0x0) || ((id & 0xffff) != 0x8835))
return 0;
}
#endif
if (<API key> > 8) {
/* can use faster refresh with newer hw revisions */
<API key> = TRUE;
/* Timing variables for tracking vsync */
/* dot_clock = 6.00MHz
* horizontal count = 296
* vertical count = 338
* refresh rate = 6000000/(296+338) = 60Hz
*/
<API key> = 20270; /* 6000000/296 */
<API key> = 338;
<API key> = 16674; /* (296+338)/6000000 */
} else {
/* Timing variables for tracking vsync */
/* dot_clock = 5.20MHz
* horizontal count = 376
* vertical count = 338
* refresh rate = 5200000/(376+338) = 41Hz
*/
<API key> = 13830; /* 5200000/376 */
<API key> = 338;
<API key> = 24440; /* (376+338)/5200000 */
}
ret = <API key>(&this_driver);
if (!ret) {
pinfo = &<API key>.panel_info;
pinfo->xres = 240;
pinfo->yres = 320;
<API key>(pinfo);
pinfo->type = MDDI_PANEL;
pinfo->pdest = DISPLAY_1;
pinfo->mddi.vdopkt = <API key>;
pinfo->wait_cycle = 0;
pinfo->bpp = 18;
pinfo->fb_num = 2;
pinfo->clk_rate = 122880000;
pinfo->clk_min = 120000000;
pinfo->clk_max = 125000000;
pinfo->lcd.vsync_enable = TRUE;
pinfo->mddi.is_type1 = TRUE;
pinfo->lcd.refx100 =
(<API key> * 100) /
<API key>;
pinfo->lcd.v_back_porch = 12;
pinfo->lcd.v_front_porch = 6;
pinfo->lcd.v_pulse_width = 0;
pinfo->lcd.hw_vsync_mode = FALSE;
pinfo->lcd.<API key> = (1 * HZ);
pinfo->bl_max = 7;
pinfo->bl_min = 1;
ret = <API key>(&this_device_0);
if (ret)
<API key>(&this_driver);
pinfo = &<API key>.panel_info;
pinfo->xres = 128;
pinfo->yres = 128;
<API key>(pinfo);
pinfo->type = MDDI_PANEL;
pinfo->pdest = DISPLAY_2;
pinfo->mddi.vdopkt = 0x400;
pinfo->wait_cycle = 0;
pinfo->bpp = 18;
pinfo->clk_rate = 122880000;
pinfo->clk_min = 120000000;
pinfo->clk_max = 125000000;
pinfo->fb_num = 2;
ret = <API key>(&this_device_1);
if (ret) {
<API key>(&this_device_0);
<API key>(&this_driver);
}
}
if (!ret)
mddi_lcd.vsync_detected = <API key>;
return ret;
}
module_init(mddi_sharp_init);
|
(function(x,n){'use strict';function s(f,k){var e=!1,a=!1;this.<API key>=function(b){return n.isDefined(b)?(b&&!a&&(a=!0,t.$$moduleName="ngTouch",k.directive("ngClick",t),f.decorator("ngClickDirective",["$delegate",function(a){if(e)a.shift();else for(var b=a.length-1;0<=b;){if("ngTouch"===a[b].$$moduleName){a.splice(b,1);break}b--}return a}])),e=b,this):e};this.$get=function(){return{<API key>:function(){return e}}}}function v(f,k,e){p.directive(f,["$parse","$swipe",function(a,
b){return function(l,u,g){function h(c){if(!d)return!1;var a=Math.abs(c.y-d.y);c=(c.x-d.x)*k;return r&&75>a&&0<c&&30<c&&.3>a/c}var m=a(g[f]),d,r,c=["touch"];n.isDefined(g.ngSwipeDisableMouse)||c.push("mouse");b.bind(u,{start:function(c,a){d=c;r=!0},cancel:function(c){r=!1},end:function(c,d){h(c)&&l.$apply(function(){u.triggerHandler(e);m(l,{$event:d})})}},c)}}])}var p=n.module("ngTouch",[]);p.provider("$touch",s);s.$inject=["$provide","$compileProvider"];p.factory("$swipe",[function(){function f(a){a=
a.originalEvent||a;var b=a.touches&&a.touches.length?a.touches:[a];a=a.changedTouches&&a.changedTouches[0]||b[0];return{x:a.clientX,y:a.clientY}}function k(a,b){var l=[];n.forEach(a,function(a){(a=e[a][b])&&l.push(a)});return l.join(" ")}var e={mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},touch:{start:"touchstart",move:"touchmove",end:"touchend",cancel:"touchcancel"},pointer:{start:"pointerdown",move:"pointermove",end:"pointerup",cancel:"pointercancel"}};return{bind:function(a,b,l){var e,
g,h,m,d=!1;l=l||["mouse","touch","pointer"];a.on(k(l,"start"),function(c){h=f(c);d=!0;g=e=0;m=h;b.start&&b.start(h,c)});var r=k(l,"cancel");if(r)a.on(r,function(c){d=!1;b.cancel&&b.cancel(c)});a.on(k(l,"move"),function(c){if(d&&h){var a=f(c);e+=Math.abs(a.x-m.x);g+=Math.abs(a.y-m.y);m=a;10>e&&10>g||(g>e?(d=!1,b.cancel&&b.cancel(c)):(c.preventDefault(),b.move&&b.move(a,c)))}});a.on(k(l,"end"),function(c){d&&(d=!1,b.end&&b.end(f(c),c))})}}}]);var t=["$parse","$timeout","$rootElement",function(f,k,e){function a(a,
d,b){for(var c=0;c<a.length;c+=2){var g=a[c+1],e=b;if(25>Math.abs(a[c]-d)&&25>Math.abs(g-e))return a.splice(c,c+2),!0}return!1}function b(b){if(!(2500<Date.now()-u)){var d=b.touches&&b.touches.length?b.touches:[b],e=d[0].clientX,d=d[0].clientY;if(!(1>e&&1>d||h&&h[0]===e&&h[1]===d)){h&&(h=null);var c=b.target;"label"===n.lowercase(c.nodeName||c[0]&&c[0].nodeName)&&(h=[e,d]);a(g,e,d)||(b.stopPropagation(),b.preventDefault(),b.target&&b.target.blur&&b.target.blur())}}}function l(a){a=a.touches&&a.touches.length?
a.touches:[a];var b=a[0].clientX,e=a[0].clientY;g.push(b,e);k(function(){for(var a=0;a<g.length;a+=2)if(g[a]===b&&g[a+1]===e){g.splice(a,a+2);break}},2500,!1)}var u,g,h;return function(h,d,k){var c=f(k.ngClick),w=!1,q,p,s,t;d.on("touchstart",function(a){w=!0;q=a.target?a.target:a.srcElement;3===q.nodeType&&(q=q.parentNode);d.addClass("ng-click-active");p=Date.now();a=a.originalEvent||a;a=(a.touches&&a.touches.length?a.touches:[a])[0];s=a.clientX;t=a.clientY});d.on("touchcancel",function(a){w=!1;d.removeClass("ng-click-active")});
d.on("touchend",function(c){var h=Date.now()-p,f=c.originalEvent||c,m=(f.changedTouches&&f.changedTouches.length?f.changedTouches:f.touches&&f.touches.length?f.touches:[f])[0],f=m.clientX,m=m.clientY,v=Math.sqrt(Math.pow(f-s,2)+Math.pow(m-t,2));w&&750>h&&12>v&&(g||(e[0].addEventListener("click",b,!0),e[0].addEventListener("touchstart",l,!0),g=[]),u=Date.now(),a(g,f,m),q&&q.blur(),n.isDefined(k.disabled)&&!1!==k.disabled||d.triggerHandler("click",[c]));w=!1;d.removeClass("ng-click-active")});d.onclick=
function(a){};d.on("click",function(a,b){h.$apply(function(){c(h,{$event:b||a})})});d.on("mousedown",function(a){d.addClass("ng-click-active")});d.on("mousemove mouseup",function(a){d.removeClass("ng-click-active")})}}];v("ngSwipeLeft",-1,"swipeleft");v("ngSwipeRight",1,"swiperight")})(window,window.angular);
//# sourceMappingURL=angular-touch.min.js.map
|
#ifndef <API key>
#define <API key>
#pragma once
#include <string>
#include "chrome/browser/prefs/<API key>.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/sync/engine/syncapi.h"
#include "chrome/browser/sync/glue/change_processor.h"
#include "chrome/browser/sync/glue/sync_backend_host.h"
#include "content/common/<API key>.h"
namespace browser_sync {
class <API key>;
class <API key>;
// This class is responsible for taking changes from the PrefService and
// applying them to the sync_api 'syncable' model, and vice versa. All
// operations and use of this class are from the UI thread.
class <API key> : public ChangeProcessor,
public <API key> {
public:
<API key>(<API key>* model_associator,
<API key>* error_handler);
virtual ~<API key>();
// <API key> implementation.
// PrefService -> sync_api model change application.
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
// sync_api model -> PrefService change application.
virtual void <API key>(
const sync_api::BaseTransaction* trans,
const sync_api::SyncManager::ChangeRecord* changes,
int change_count);
protected:
virtual void StartImpl(Profile* profile);
virtual void StopImpl();
private:
Value* ReadPreference(sync_api::ReadNode* node, std::string* name);
void StartObserving();
void StopObserving();
// The model we are processing changes from. Non-NULL when |running_| is true.
PrefService* pref_service_;
// The two models should be associated according to this ModelAssociator.
<API key>* model_associator_;
// Whether we are currently processing a preference change notification.
bool <API key>;
PrefChangeRegistrar registrar_;
<API key>(<API key>);
};
} // namespace browser_sync
#endif // <API key>
|
package daemon
import (
"errors"
"io"
"os"
"path/filepath"
"strings"
"github.com/docker/docker/builder"
"github.com/docker/docker/container"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/chrootarchive"
"github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/system"
"github.com/docker/engine-api/types"
)
// <API key> is used to convey that the operation to extract
// a tar archive to a directory in a container has failed because the specified
// path does not refer to a directory.
var <API key> = errors.New("extraction point is not a directory")
// ContainerCopy performs a deprecated operation of archiving the resource at
// the specified path in the container identified by the given name.
func (daemon *Daemon) ContainerCopy(name string, res string) (io.ReadCloser, error) {
container, err := daemon.GetContainer(name)
if err != nil {
return nil, err
}
if res[0] == '/' || res[0] == '\\' {
res = res[1:]
}
return daemon.containerCopy(container, res)
}
// ContainerStatPath stats the filesystem resource at the specified path in the
// container identified by the given name.
func (daemon *Daemon) ContainerStatPath(name string, path string) (stat *types.ContainerPathStat, err error) {
container, err := daemon.GetContainer(name)
if err != nil {
return nil, err
}
return daemon.containerStatPath(container, path)
}
// <API key> creates an archive of the filesystem resource at the
// specified path in the container identified by the given name. Returns a
// tar archive of the resource and whether it was a directory or a single file.
func (daemon *Daemon) <API key>(name string, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error) {
container, err := daemon.GetContainer(name)
if err != nil {
return nil, nil, err
}
return daemon.<API key>(container, path)
}
// <API key> extracts the given archive to the specified location
// in the filesystem of the container identified by the given name. The given
// path must be of a directory in the container. If it is not, the error will
// be <API key>. If <API key> is true then it will
// be an error if unpacking the given content would cause an existing directory
// to be replaced with a non-directory and vice versa.
func (daemon *Daemon) <API key>(name, path string, <API key> bool, content io.Reader) error {
container, err := daemon.GetContainer(name)
if err != nil {
return err
}
return daemon.<API key>(container, path, <API key>, content)
}
// containerStatPath stats the filesystem resource at the specified path in this
// container. Returns stat info about the resource.
func (daemon *Daemon) containerStatPath(container *container.Container, path string) (stat *types.ContainerPathStat, err error) {
container.Lock()
defer container.Unlock()
if err = daemon.Mount(container); err != nil {
return nil, err
}
defer daemon.Unmount(container)
err = daemon.mountVolumes(container)
defer container.UnmountVolumes(true, daemon.LogVolumeEvent)
if err != nil {
return nil, err
}
resolvedPath, absPath, err := container.ResolvePath(path)
if err != nil {
return nil, err
}
return container.StatPath(resolvedPath, absPath)
}
// <API key> creates an archive of the filesystem resource at the specified
// path in this container. Returns a tar archive of the resource and stat info
// about the resource.
func (daemon *Daemon) <API key>(container *container.Container, path string) (content io.ReadCloser, stat *types.ContainerPathStat, err error) {
container.Lock()
defer func() {
if err != nil {
// Wait to unlock the container until the archive is fully read
// (see the ReadCloseWrapper func below) or if there is an error
// before that occurs.
container.Unlock()
}
}()
if err = daemon.Mount(container); err != nil {
return nil, nil, err
}
defer func() {
if err != nil {
// unmount any volumes
container.UnmountVolumes(true, daemon.LogVolumeEvent)
// unmount the container's rootfs
daemon.Unmount(container)
}
}()
if err = daemon.mountVolumes(container); err != nil {
return nil, nil, err
}
resolvedPath, absPath, err := container.ResolvePath(path)
if err != nil {
return nil, nil, err
}
stat, err = container.StatPath(resolvedPath, absPath)
if err != nil {
return nil, nil, err
}
// We need to rebase the archive entries if the last element of the
// resolved path was a symlink that was evaluated and is now different
// than the requested path. For example, if the given path was "/foo/bar/",
// but it resolved to "/var/lib/docker/containers/{id}/foo/baz/", we want
// to ensure that the archive entries start with "bar" and not "baz". This
// also catches the case when the root directory of the container is
// requested: we want the archive entries to start with "/" and not the
// container ID.
data, err := archive.TarResourceRebase(resolvedPath, filepath.Base(absPath))
if err != nil {
return nil, nil, err
}
content = ioutils.<API key>(data, func() error {
err := data.Close()
container.UnmountVolumes(true, daemon.LogVolumeEvent)
daemon.Unmount(container)
container.Unlock()
return err
})
daemon.LogContainerEvent(container, "archive-path")
return content, stat, nil
}
// <API key> extracts the given tar archive to the specified location in the
// filesystem of this container. The given path must be of a directory in the
// container. If it is not, the error will be <API key>. If
// <API key> is true then it will be an error if unpacking the
// given content would cause an existing directory to be replaced with a non-
// directory and vice versa.
func (daemon *Daemon) <API key>(container *container.Container, path string, <API key> bool, content io.Reader) (err error) {
container.Lock()
defer container.Unlock()
if err = daemon.Mount(container); err != nil {
return err
}
defer daemon.Unmount(container)
err = daemon.mountVolumes(container)
defer container.UnmountVolumes(true, daemon.LogVolumeEvent)
if err != nil {
return err
}
// Check if a drive letter supplied, it must be the system drive. No-op except on Windows
path, err = system.<API key>(path)
if err != nil {
return err
}
// The destination path needs to be resolved to a host path, with all
// symbolic links followed in the scope of the container's rootfs. Note
// that we do not use `container.ResolvePath(path)` here because we need
// to also evaluate the last path element if it is a symlink. This is so
// that you can extract an archive to a symlink that points to a directory.
// Consider the given path as an absolute path in the container.
absPath := archive.<API key>(filepath.Join(string(filepath.Separator), path), path)
// This will evaluate the last path element if it is a symlink.
resolvedPath, err := container.GetResourcePath(absPath)
if err != nil {
return err
}
stat, err := os.Lstat(resolvedPath)
if err != nil {
return err
}
if !stat.IsDir() {
return <API key>
}
// Need to check if the path is in a volume. If it is, it cannot be in a
// read-only volume. If it is not in a volume, the container cannot be
// configured with a read-only rootfs.
// Use the resolved path relative to the container rootfs as the new
// absPath. This way we fully follow any symlinks in a volume that may
// lead back outside the volume.
// The Windows implementation of filepath.Rel in golang 1.4 does not
// support volume style file path semantics. On Windows when using the
// filter driver, we are guaranteed that the path will always be
// a volume file path.
var baseRel string
if strings.HasPrefix(resolvedPath, `\\?\Volume{`) {
if strings.HasPrefix(resolvedPath, container.BaseFS) {
baseRel = resolvedPath[len(container.BaseFS):]
if baseRel[:1] == `\` {
baseRel = baseRel[1:]
}
}
} else {
baseRel, err = filepath.Rel(container.BaseFS, resolvedPath)
}
if err != nil {
return err
}
// Make it an absolute path.
absPath = filepath.Join(string(filepath.Separator), baseRel)
toVolume, err := <API key>(container, absPath)
if err != nil {
return err
}
if !toVolume && container.HostConfig.ReadonlyRootfs {
return ErrRootFSReadOnly
}
uid, gid := daemon.GetRemappedUIDGID()
options := &archive.TarOptions{
<API key>: <API key>,
ChownOpts: &archive.TarChownOptions{
UID: uid, GID: gid, // TODO: should all ownership be set to root (either real or remapped)?
},
}
if err := chrootarchive.Untar(content, resolvedPath, options); err != nil {
return err
}
daemon.LogContainerEvent(container, "extract-to-dir")
return nil
}
func (daemon *Daemon) containerCopy(container *container.Container, resource string) (rc io.ReadCloser, err error) {
container.Lock()
defer func() {
if err != nil {
// Wait to unlock the container until the archive is fully read
// (see the ReadCloseWrapper func below) or if there is an error
// before that occurs.
container.Unlock()
}
}()
if err := daemon.Mount(container); err != nil {
return nil, err
}
defer func() {
if err != nil {
// unmount any volumes
container.UnmountVolumes(true, daemon.LogVolumeEvent)
// unmount the container's rootfs
daemon.Unmount(container)
}
}()
if err := daemon.mountVolumes(container); err != nil {
return nil, err
}
basePath, err := container.GetResourcePath(resource)
if err != nil {
return nil, err
}
stat, err := os.Stat(basePath)
if err != nil {
return nil, err
}
var filter []string
if !stat.IsDir() {
d, f := filepath.Split(basePath)
basePath = d
filter = []string{f}
} else {
filter = []string{filepath.Base(basePath)}
basePath = filepath.Dir(basePath)
}
archive, err := archive.TarWithOptions(basePath, &archive.TarOptions{
Compression: archive.Uncompressed,
IncludeFiles: filter,
})
if err != nil {
return nil, err
}
reader := ioutils.<API key>(archive, func() error {
err := archive.Close()
container.UnmountVolumes(true, daemon.LogVolumeEvent)
daemon.Unmount(container)
container.Unlock()
return err
})
daemon.LogContainerEvent(container, "copy")
return reader, nil
}
// CopyOnBuild copies/extracts a source FileInfo to a destination path inside a container
// specified by a container object.
// TODO: make sure callers don't unnecessarily convert destPath with filepath.FromSlash (Copy does it already).
// CopyOnBuild should take in abstract paths (with slashes) and the implementation should convert it to OS-specific paths.
func (daemon *Daemon) CopyOnBuild(cID string, destPath string, src builder.FileInfo, decompress bool) error {
srcPath := src.Path()
destExists := true
destDir := false
rootUID, rootGID := daemon.GetRemappedUIDGID()
// Work in daemon-local OS specific file paths
destPath = filepath.FromSlash(destPath)
c, err := daemon.GetContainer(cID)
if err != nil {
return err
}
err = daemon.Mount(c)
if err != nil {
return err
}
defer daemon.Unmount(c)
dest, err := c.GetResourcePath(destPath)
if err != nil {
return err
}
// Preserve the trailing slash
// TODO: why are we appending another path separator if there was already one?
if strings.HasSuffix(destPath, string(os.PathSeparator)) || destPath == "." {
destDir = true
dest += string(os.PathSeparator)
}
destPath = dest
destStat, err := os.Stat(destPath)
if err != nil {
if !os.IsNotExist(err) {
//logrus.Errorf("Error performing os.Stat on %s. %s", destPath, err)
return err
}
destExists = false
}
uidMaps, gidMaps := daemon.GetUIDGIDMaps()
archiver := &archive.Archiver{
Untar: chrootarchive.Untar,
UIDMaps: uidMaps,
GIDMaps: gidMaps,
}
if src.IsDir() {
// copy as directory
if err := archiver.CopyWithTar(srcPath, destPath); err != nil {
return err
}
return fixPermissions(srcPath, destPath, rootUID, rootGID, destExists)
}
if decompress && archive.IsArchivePath(srcPath) {
// Only try to untar if it is a file and that we've been told to decompress (when ADD-ing a remote file)
// First try to unpack the source as an archive
// to support the untar feature we need to clean up the path a little bit
// because tar is very forgiving. First we need to strip off the archive's
// filename from the path but this is only added if it does not end in slash
tarDest := destPath
if strings.HasSuffix(tarDest, string(os.PathSeparator)) {
tarDest = filepath.Dir(destPath)
}
// try to successfully untar the orig
err := archiver.UntarPath(srcPath, tarDest)
/*
if err != nil {
logrus.Errorf("Couldn't untar to %s: %v", tarDest, err)
}
*/
return err
}
if destDir || (destExists && destStat.IsDir()) {
destPath = filepath.Join(destPath, src.Name())
}
if err := idtools.MkdirAllNewAs(filepath.Dir(destPath), 0755, rootUID, rootGID); err != nil {
return err
}
if err := archiver.CopyFileWithTar(srcPath, destPath); err != nil {
return err
}
return fixPermissions(srcPath, destPath, rootUID, rootGID, destExists)
}
|
cask 'dsp-radio' do
version '1.4.1'
sha256 '<SHA256-like>'
url "https://dl2sdr.homepage.t-online.de/files/DSP_Radio_#{version.delete('.')}.zip"
name 'DSP Radio'
homepage 'https://dl2sdr.homepage.t-online.de/'
license :gratis
app "DSP Radio #{version}.app"
end
|
#include <linux/host1x.h>
#include "drm.h"
#include "gem.h"
#define DRIVER_NAME "tegra"
#define DRIVER_DESC "NVIDIA Tegra graphics"
#define DRIVER_DATE "20120330"
#define DRIVER_MAJOR 0
#define DRIVER_MINOR 0
#define DRIVER_PATCHLEVEL 0
struct tegra_drm_file {
struct list_head contexts;
};
static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
{
struct host1x_device *device = to_host1x_device(drm->dev);
struct tegra_drm *tegra;
int err;
tegra = kzalloc(sizeof(*tegra), GFP_KERNEL);
if (!tegra)
return -ENOMEM;
dev_set_drvdata(drm->dev, tegra);
mutex_init(&tegra->clients_lock);
INIT_LIST_HEAD(&tegra->clients);
drm->dev_private = tegra;
tegra->drm = drm;
<API key>(drm);
err = host1x_device_init(device);
if (err < 0)
return err;
/*
* We don't use the drm_irq_install() helpers provided by the DRM
* core, so we need to set this manually in order to allow the
* <API key> to operate correctly.
*/
drm->irq_enabled = true;
err = drm_vblank_init(drm, drm->mode_config.num_crtc);
if (err < 0)
return err;
err = tegra_drm_fb_init(drm);
if (err < 0)
return err;
<API key>(drm);
return 0;
}
static int tegra_drm_unload(struct drm_device *drm)
{
struct host1x_device *device = to_host1x_device(drm->dev);
int err;
<API key>(drm);
tegra_drm_fb_exit(drm);
drm_vblank_cleanup(drm);
<API key>(drm);
err = host1x_device_exit(device);
if (err < 0)
return err;
return 0;
}
static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp)
{
struct tegra_drm_file *fpriv;
fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL);
if (!fpriv)
return -ENOMEM;
INIT_LIST_HEAD(&fpriv->contexts);
filp->driver_priv = fpriv;
return 0;
}
static void <API key>(struct tegra_drm_context *context)
{
context->client->ops->close_channel(context);
kfree(context);
}
static void tegra_drm_lastclose(struct drm_device *drm)
{
struct tegra_drm *tegra = drm->dev_private;
<API key>(tegra->fbdev);
}
static struct host1x_bo *
host1x_bo_lookup(struct drm_device *drm, struct drm_file *file, u32 handle)
{
struct drm_gem_object *gem;
struct tegra_bo *bo;
gem = <API key>(drm, file, handle);
if (!gem)
return NULL;
mutex_lock(&drm->struct_mutex);
<API key>(gem);
mutex_unlock(&drm->struct_mutex);
bo = to_tegra_bo(gem);
return &bo->base;
}
int tegra_drm_submit(struct tegra_drm_context *context,
struct drm_tegra_submit *args, struct drm_device *drm,
struct drm_file *file)
{
unsigned int num_cmdbufs = args->num_cmdbufs;
unsigned int num_relocs = args->num_relocs;
unsigned int num_waitchks = args->num_waitchks;
struct drm_tegra_cmdbuf __user *cmdbufs =
(void __user *)(uintptr_t)args->cmdbufs;
struct drm_tegra_reloc __user *relocs =
(void __user *)(uintptr_t)args->relocs;
struct drm_tegra_waitchk __user *waitchks =
(void __user *)(uintptr_t)args->waitchks;
struct drm_tegra_syncpt syncpt;
struct host1x_job *job;
int err;
/* We don't yet support other than one syncpt_incr struct per submit */
if (args->num_syncpts != 1)
return -EINVAL;
job = host1x_job_alloc(context->channel, args->num_cmdbufs,
args->num_relocs, args->num_waitchks);
if (!job)
return -ENOMEM;
job->num_relocs = args->num_relocs;
job->num_waitchk = args->num_waitchks;
job->client = (u32)args->context;
job->class = context->client->base.class;
job->serialize = true;
while (num_cmdbufs) {
struct drm_tegra_cmdbuf cmdbuf;
struct host1x_bo *bo;
if (copy_from_user(&cmdbuf, cmdbufs, sizeof(cmdbuf))) {
err = -EFAULT;
goto fail;
}
bo = host1x_bo_lookup(drm, file, cmdbuf.handle);
if (!bo) {
err = -ENOENT;
goto fail;
}
<API key>(job, bo, cmdbuf.words, cmdbuf.offset);
num_cmdbufs
cmdbufs++;
}
if (copy_from_user(job->relocarray, relocs,
sizeof(*relocs) * num_relocs)) {
err = -EFAULT;
goto fail;
}
while (num_relocs
struct host1x_reloc *reloc = &job->relocarray[num_relocs];
struct host1x_bo *cmdbuf, *target;
cmdbuf = host1x_bo_lookup(drm, file, (u32)reloc->cmdbuf);
target = host1x_bo_lookup(drm, file, (u32)reloc->target);
reloc->cmdbuf = cmdbuf;
reloc->target = target;
if (!reloc->target || !reloc->cmdbuf) {
err = -ENOENT;
goto fail;
}
}
if (copy_from_user(job->waitchk, waitchks,
sizeof(*waitchks) * num_waitchks)) {
err = -EFAULT;
goto fail;
}
if (copy_from_user(&syncpt, (void __user *)(uintptr_t)args->syncpts,
sizeof(syncpt))) {
err = -EFAULT;
goto fail;
}
job->is_addr_reg = context->client->ops->is_addr_reg;
job->syncpt_incrs = syncpt.incrs;
job->syncpt_id = syncpt.id;
job->timeout = 10000;
if (args->timeout && args->timeout < 10000)
job->timeout = args->timeout;
err = host1x_job_pin(job, context->client->base.dev);
if (err)
goto fail;
err = host1x_job_submit(job);
if (err)
goto fail_submit;
args->fence = job->syncpt_end;
host1x_job_put(job);
return 0;
fail_submit:
host1x_job_unpin(job);
fail:
host1x_job_put(job);
return err;
}
#ifdef <API key>
static struct tegra_drm_context *<API key>(__u64 context)
{
return (struct tegra_drm_context *)(uintptr_t)context;
}
static bool <API key>(struct tegra_drm_file *file,
struct tegra_drm_context *context)
{
struct tegra_drm_context *ctx;
list_for_each_entry(ctx, &file->contexts, list)
if (ctx == context)
return true;
return false;
}
static int tegra_gem_create(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct <API key> *args = data;
struct tegra_bo *bo;
bo = <API key>(file, drm, args->size, args->flags,
&args->handle);
if (IS_ERR(bo))
return PTR_ERR(bo);
return 0;
}
static int tegra_gem_mmap(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct drm_tegra_gem_mmap *args = data;
struct drm_gem_object *gem;
struct tegra_bo *bo;
gem = <API key>(drm, file, args->handle);
if (!gem)
return -EINVAL;
bo = to_tegra_bo(gem);
args->offset = <API key>(&bo->gem.vma_node);
<API key>(gem);
return 0;
}
static int tegra_syncpt_read(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct host1x *host = dev_get_drvdata(drm->dev->parent);
struct <API key> *args = data;
struct host1x_syncpt *sp;
sp = host1x_syncpt_get(host, args->id);
if (!sp)
return -EINVAL;
args->value = <API key>(sp);
return 0;
}
static int tegra_syncpt_incr(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct host1x *host1x = dev_get_drvdata(drm->dev->parent);
struct <API key> *args = data;
struct host1x_syncpt *sp;
sp = host1x_syncpt_get(host1x, args->id);
if (!sp)
return -EINVAL;
return host1x_syncpt_incr(sp);
}
static int tegra_syncpt_wait(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct host1x *host1x = dev_get_drvdata(drm->dev->parent);
struct <API key> *args = data;
struct host1x_syncpt *sp;
sp = host1x_syncpt_get(host1x, args->id);
if (!sp)
return -EINVAL;
return host1x_syncpt_wait(sp, args->thresh, args->timeout,
&args->value);
}
static int tegra_open_channel(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct tegra_drm_file *fpriv = file->driver_priv;
struct tegra_drm *tegra = drm->dev_private;
struct <API key> *args = data;
struct tegra_drm_context *context;
struct tegra_drm_client *client;
int err = -ENODEV;
context = kzalloc(sizeof(*context), GFP_KERNEL);
if (!context)
return -ENOMEM;
list_for_each_entry(client, &tegra->clients, list)
if (client->base.class == args->client) {
err = client->ops->open_channel(client, context);
if (err)
break;
list_add(&context->list, &fpriv->contexts);
args->context = (uintptr_t)context;
context->client = client;
return 0;
}
kfree(context);
return err;
}
static int tegra_close_channel(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct tegra_drm_file *fpriv = file->driver_priv;
struct <API key> *args = data;
struct tegra_drm_context *context;
context = <API key>(args->context);
if (!<API key>(fpriv, context))
return -EINVAL;
list_del(&context->list);
<API key>(context);
return 0;
}
static int tegra_get_syncpt(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct tegra_drm_file *fpriv = file->driver_priv;
struct <API key> *args = data;
struct tegra_drm_context *context;
struct host1x_syncpt *syncpt;
context = <API key>(args->context);
if (!<API key>(fpriv, context))
return -ENODEV;
if (args->index >= context->client->base.num_syncpts)
return -EINVAL;
syncpt = context->client->base.syncpts[args->index];
args->id = host1x_syncpt_id(syncpt);
return 0;
}
static int tegra_submit(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct tegra_drm_file *fpriv = file->driver_priv;
struct drm_tegra_submit *args = data;
struct tegra_drm_context *context;
context = <API key>(args->context);
if (!<API key>(fpriv, context))
return -ENODEV;
return context->client->ops->submit(context, args, drm, file);
}
static int <API key>(struct drm_device *drm, void *data,
struct drm_file *file)
{
struct tegra_drm_file *fpriv = file->driver_priv;
struct <API key> *args = data;
struct tegra_drm_context *context;
struct host1x_syncpt_base *base;
struct host1x_syncpt *syncpt;
context = <API key>(args->context);
if (!<API key>(fpriv, context))
return -ENODEV;
if (args->syncpt >= context->client->base.num_syncpts)
return -EINVAL;
syncpt = context->client->base.syncpts[args->syncpt];
base = <API key>(syncpt);
if (!base)
return -ENXIO;
args->id = <API key>(base);
return 0;
}
#endif
static const struct drm_ioctl_desc tegra_drm_ioctls[] = {
#ifdef <API key>
DRM_IOCTL_DEF_DRV(TEGRA_GEM_CREATE, tegra_gem_create, DRM_UNLOCKED | DRM_AUTH),
DRM_IOCTL_DEF_DRV(TEGRA_GEM_MMAP, tegra_gem_mmap, DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(TEGRA_SYNCPT_READ, tegra_syncpt_read, DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(TEGRA_SYNCPT_INCR, tegra_syncpt_incr, DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(TEGRA_SYNCPT_WAIT, tegra_syncpt_wait, DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(TEGRA_OPEN_CHANNEL, tegra_open_channel, DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(TEGRA_CLOSE_CHANNEL, tegra_close_channel, DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(TEGRA_GET_SYNCPT, tegra_get_syncpt, DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(TEGRA_SUBMIT, tegra_submit, DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(<API key>, <API key>, DRM_UNLOCKED),
#endif
};
static const struct file_operations tegra_drm_fops = {
.owner = THIS_MODULE,
.open = drm_open,
.release = drm_release,
.unlocked_ioctl = drm_ioctl,
.mmap = tegra_drm_mmap,
.poll = drm_poll,
.read = drm_read,
#ifdef CONFIG_COMPAT
.compat_ioctl = drm_compat_ioctl,
#endif
.llseek = noop_llseek,
};
static struct drm_crtc *<API key>(struct drm_device *drm, int pipe)
{
struct drm_crtc *crtc;
list_for_each_entry(crtc, &drm->mode_config.crtc_list, head) {
struct tegra_dc *dc = to_tegra_dc(crtc);
if (dc->pipe == pipe)
return crtc;
}
return NULL;
}
static u32 <API key>(struct drm_device *dev, int crtc)
{
/* TODO: implement real hardware counter using syncpoints */
return drm_vblank_count(dev, crtc);
}
static int <API key>(struct drm_device *drm, int pipe)
{
struct drm_crtc *crtc = <API key>(drm, pipe);
struct tegra_dc *dc = to_tegra_dc(crtc);
if (!crtc)
return -ENODEV;
<API key>(dc);
return 0;
}
static void <API key>(struct drm_device *drm, int pipe)
{
struct drm_crtc *crtc = <API key>(drm, pipe);
struct tegra_dc *dc = to_tegra_dc(crtc);
if (crtc)
<API key>(dc);
}
static void tegra_drm_preclose(struct drm_device *drm, struct drm_file *file)
{
struct tegra_drm_file *fpriv = file->driver_priv;
struct tegra_drm_context *context, *tmp;
struct drm_crtc *crtc;
list_for_each_entry(crtc, &drm->mode_config.crtc_list, head)
<API key>(crtc, file);
<API key>(context, tmp, &fpriv->contexts, list)
<API key>(context);
kfree(fpriv);
}
#ifdef CONFIG_DEBUG_FS
static int <API key>(struct seq_file *s, void *data)
{
struct drm_info_node *node = (struct drm_info_node *)s->private;
struct drm_device *drm = node->minor->dev;
struct drm_framebuffer *fb;
mutex_lock(&drm->mode_config.fb_lock);
list_for_each_entry(fb, &drm->mode_config.fb_list, head) {
seq_printf(s, "%3d: user size: %d x %d, depth %d, %d bpp, refcount %d\n",
fb->base.id, fb->width, fb->height, fb->depth,
fb->bits_per_pixel,
atomic_read(&fb->refcount.refcount));
}
mutex_unlock(&drm->mode_config.fb_lock);
return 0;
}
static struct drm_info_list tegra_debugfs_list[] = {
{ "framebuffers", <API key>, 0 },
};
static int tegra_debugfs_init(struct drm_minor *minor)
{
return <API key>(tegra_debugfs_list,
ARRAY_SIZE(tegra_debugfs_list),
minor->debugfs_root, minor);
}
static void <API key>(struct drm_minor *minor)
{
<API key>(tegra_debugfs_list,
ARRAY_SIZE(tegra_debugfs_list), minor);
}
#endif
static struct drm_driver tegra_drm_driver = {
.driver_features = DRIVER_MODESET | DRIVER_GEM,
.load = tegra_drm_load,
.unload = tegra_drm_unload,
.open = tegra_drm_open,
.preclose = tegra_drm_preclose,
.lastclose = tegra_drm_lastclose,
.get_vblank_counter = <API key>,
.enable_vblank = <API key>,
.disable_vblank = <API key>,
#if defined(CONFIG_DEBUG_FS)
.debugfs_init = tegra_debugfs_init,
.debugfs_cleanup = <API key>,
#endif
.gem_free_object = <API key>,
.gem_vm_ops = &tegra_bo_vm_ops,
.dumb_create = <API key>,
.dumb_map_offset = <API key>,
.dumb_destroy = <API key>,
.ioctls = tegra_drm_ioctls,
.num_ioctls = ARRAY_SIZE(tegra_drm_ioctls),
.fops = &tegra_drm_fops,
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
.date = DRIVER_DATE,
.major = DRIVER_MAJOR,
.minor = DRIVER_MINOR,
.patchlevel = DRIVER_PATCHLEVEL,
};
int <API key>(struct tegra_drm *tegra,
struct tegra_drm_client *client)
{
mutex_lock(&tegra->clients_lock);
list_add_tail(&client->list, &tegra->clients);
mutex_unlock(&tegra->clients_lock);
return 0;
}
int <API key>(struct tegra_drm *tegra,
struct tegra_drm_client *client)
{
mutex_lock(&tegra->clients_lock);
list_del_init(&client->list);
mutex_unlock(&tegra->clients_lock);
return 0;
}
static int host1x_drm_probe(struct host1x_device *device)
{
return drm_host1x_init(&tegra_drm_driver, device);
}
static int host1x_drm_remove(struct host1x_device *device)
{
drm_host1x_exit(&tegra_drm_driver, device);
return 0;
}
static const struct of_device_id host1x_drm_subdevs[] = {
{ .compatible = "nvidia,tegra20-dc", },
{ .compatible = "nvidia,tegra20-hdmi", },
{ .compatible = "nvidia,tegra20-gr2d", },
{ .compatible = "nvidia,tegra20-gr3d", },
{ .compatible = "nvidia,tegra30-dc", },
{ .compatible = "nvidia,tegra30-hdmi", },
{ .compatible = "nvidia,tegra30-gr2d", },
{ .compatible = "nvidia,tegra30-gr3d", },
{ .compatible = "nvidia,tegra114-hdmi", },
{ .compatible = "nvidia,tegra114-gr3d", },
{ /* sentinel */ }
};
static struct host1x_driver host1x_drm_driver = {
.name = "drm",
.probe = host1x_drm_probe,
.remove = host1x_drm_remove,
.subdevs = host1x_drm_subdevs,
};
static int __init host1x_drm_init(void)
{
int err;
err = <API key>(&host1x_drm_driver);
if (err < 0)
return err;
err = <API key>(&tegra_dc_driver);
if (err < 0)
goto unregister_host1x;
err = <API key>(&tegra_hdmi_driver);
if (err < 0)
goto unregister_dc;
err = <API key>(&tegra_gr2d_driver);
if (err < 0)
goto unregister_hdmi;
err = <API key>(&tegra_gr3d_driver);
if (err < 0)
goto unregister_gr2d;
return 0;
unregister_gr2d:
<API key>(&tegra_gr2d_driver);
unregister_hdmi:
<API key>(&tegra_hdmi_driver);
unregister_dc:
<API key>(&tegra_dc_driver);
unregister_host1x:
<API key>(&host1x_drm_driver);
return err;
}
module_init(host1x_drm_init);
static void __exit host1x_drm_exit(void)
{
<API key>(&tegra_gr3d_driver);
<API key>(&tegra_gr2d_driver);
<API key>(&tegra_hdmi_driver);
<API key>(&tegra_dc_driver);
<API key>(&host1x_drm_driver);
}
module_exit(host1x_drm_exit);
MODULE_AUTHOR("Thierry Reding <thierry.reding@avionic-design.de>");
MODULE_DESCRIPTION("NVIDIA Tegra DRM driver");
MODULE_LICENSE("GPL v2");
|
#include <errno.h>
#include <malloc.h>
#include <string.h>
#define __USE_GNU
#ifndef __set_errno
#define __set_errno(e) errno = (e)
#endif
#include <search.h>
/* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986
[Knuth] The Art of Computer Programming, part 3 (6.4) */
/* The reentrant version has no static variables to maintain the state.
Instead the interface of all functions is extended to take an argument
which describes the current status. */
typedef struct _ENTRY
{
unsigned int used;
ENTRY entry;
}
_ENTRY;
/* For the used double hash method the table size has to be a prime. To
correct the user given table size we need a prime test. This trivial
algorithm is adequate because
a) the code is (most probably) called a few times per program run and
b) the number is small because the table must fit in the core */
static int
isprime (unsigned int number)
{
/* no even number will be passed */
unsigned int div = 3;
while (div * div < number && number % div != 0)
div += 2;
return number % div != 0;
}
/* Before using the hash table we must allocate memory for it.
Test for an existing table are done. We allocate one element
more as the found prime number says. This is done for more effective
indexing as explained in the comment for the hsearch function.
The contents of the table is zeroed, especially the field used
becomes zero. */
int
hcreate_r (nel, htab)
size_t nel;
struct hsearch_data *htab;
{
/* Test for correct arguments. */
if (htab == NULL)
{
__set_errno (EINVAL);
return 0;
}
/* There is still another table active. Return with error. */
if (htab->table != NULL)
return 0;
/* Change nel to the first prime number not smaller as nel. */
nel |= 1; /* make odd */
while (!isprime (nel))
nel += 2;
htab->size = nel;
htab->filled = 0;
/* allocate memory and zero out */
htab->table = (_ENTRY *) calloc (htab->size + 1, sizeof (_ENTRY));
if (htab->table == NULL)
return 0;
/* everything went alright */
return 1;
}
/* After using the hash table it has to be destroyed. The used memory can
be freed and the local static variable can be marked as not used. */
void
hdestroy_r (htab)
struct hsearch_data *htab;
{
/* Test for correct arguments. */
if (htab == NULL)
{
__set_errno (EINVAL);
return;
}
if (htab->table != NULL)
/* free used memory */
free (htab->table);
/* the sign for an existing table is an value != NULL in htable */
htab->table = NULL;
}
int
hsearch_r (item, action, retval, htab)
ENTRY item;
ACTION action;
ENTRY **retval;
struct hsearch_data *htab;
{
unsigned int hval;
unsigned int count;
unsigned int len = strlen (item.key);
unsigned int idx;
/* Compute an value for the given string. Perhaps use a better method. */
hval = len;
count = len;
while (count
{
hval <<= 4;
hval += item.key[count];
}
/* First hash function: simply take the modulo but prevent zero. */
hval %= htab->size;
if (hval == 0)
++hval;
/* The first index tried. */
idx = hval;
if (htab->table[idx].used)
{
/* Further action might be required according to the action value. */
unsigned hval2;
if (htab->table[idx].used == hval
&& strcmp (item.key, htab->table[idx].entry.key) == 0)
{
if (action == ENTER)
htab->table[idx].entry.data = item.data;
*retval = &htab->table[idx].entry;
return 1;
}
/* Second hash function, as suggested in [Knuth] */
hval2 = 1 + hval % (htab->size - 2);
do
{
/* Because SIZE is prime this guarantees to step through all
available indexes. */
if (idx <= hval2)
idx = htab->size + idx - hval2;
else
idx -= hval2;
/* If we visited all entries leave the loop unsuccessfully. */
if (idx == hval)
break;
/* If entry is found use it. */
if (htab->table[idx].used == hval
&& strcmp (item.key, htab->table[idx].entry.key) == 0)
{
if (action == ENTER)
htab->table[idx].entry.data = item.data;
*retval = &htab->table[idx].entry;
return 1;
}
}
while (htab->table[idx].used);
}
/* An empty bucket has been found. */
if (action == ENTER)
{
/* If table is full and another entry should be entered return
with error. */
if (action == ENTER && htab->filled == htab->size)
{
__set_errno (ENOMEM);
*retval = NULL;
return 0;
}
htab->table[idx].used = hval;
htab->table[idx].entry = item;
++htab->filled;
*retval = &htab->table[idx].entry;
return 1;
}
__set_errno (ESRCH);
*retval = NULL;
return 0;
}
|
#miniTip,#miniTip_a{position:absolute;top:0;left:0}#miniTip{background-color:#262626;max-width:250px;color:#fff;display:none;border-radius:3;opacity:.95;border:4px solid #000}#miniTip .bottom,#miniTip .top{border-left:8px solid transparent;border-right:8px solid transparent}#miniTip_a{width:0;height:0}#miniTip .top{border-top:8px solid #000;border-bottom:0}#miniTip .bottom{border-bottom:8px solid #000;border-top:0}#miniTip .left,#miniTip .right{border-bottom:8px solid transparent;border-top:8px solid transparent}#miniTip .right{border-right:8px solid #000;border-left:0}#miniTip .left{border-left:8px solid #000;border-right:0}#miniTip_t{padding:4 6;background-color:#191919;font-weight:700}#miniTip_c{padding:6px}
|
#include "i40iw_osdep.h"
#include "i40iw_register.h"
#include "i40iw_status.h"
#include "i40iw_hmc.h"
#include "i40iw_d.h"
#include "i40iw_type.h"
#include "i40iw_p.h"
#include "i40iw_virtchnl.h"
/**
* <API key> - Request Channel version
* @dev: IWARP device pointer
* @vchnl_req: Virtual channel message request pointer
*/
static enum i40iw_status_code <API key>(struct i40iw_sc_dev *dev,
struct i40iw_virtchnl_req *vchnl_req)
{
enum i40iw_status_code ret_code = I40IW_ERR_NOT_READY;
struct <API key> *vchnl_msg = vchnl_req->vchnl_msg;
if (!dev->vchnl_up)
return ret_code;
memset(vchnl_msg, 0, sizeof(*vchnl_msg));
vchnl_msg->iw_chnl_op_ctx = (uintptr_t)vchnl_req;
vchnl_msg->iw_chnl_buf_len = sizeof(*vchnl_msg);
vchnl_msg->iw_op_code = <API key>;
vchnl_msg->iw_op_ver = <API key>;
ret_code = dev->vchnl_if.vchnl_send(dev, 0, (u8 *)vchnl_msg, vchnl_msg->iw_chnl_buf_len);
if (ret_code)
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: virt channel send failed 0x%x\n", __func__, ret_code);
return ret_code;
}
/**
* <API key> - Request HMC Function from VF
* @dev: IWARP device pointer
* @vchnl_req: Virtual channel message request pointer
*/
static enum i40iw_status_code <API key>(struct i40iw_sc_dev *dev,
struct i40iw_virtchnl_req *vchnl_req)
{
enum i40iw_status_code ret_code = I40IW_ERR_NOT_READY;
struct <API key> *vchnl_msg = vchnl_req->vchnl_msg;
if (!dev->vchnl_up)
return ret_code;
memset(vchnl_msg, 0, sizeof(*vchnl_msg));
vchnl_msg->iw_chnl_op_ctx = (uintptr_t)vchnl_req;
vchnl_msg->iw_chnl_buf_len = sizeof(*vchnl_msg);
vchnl_msg->iw_op_code = <API key>;
vchnl_msg->iw_op_ver = <API key>;
ret_code = dev->vchnl_if.vchnl_send(dev, 0, (u8 *)vchnl_msg, vchnl_msg->iw_chnl_buf_len);
if (ret_code)
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: virt channel send failed 0x%x\n", __func__, ret_code);
return ret_code;
}
/**
* <API key> - Request PE stats from VF
* @dev: IWARP device pointer
* @vchnl_req: Virtual channel message request pointer
*/
static enum i40iw_status_code <API key>(struct i40iw_sc_dev *dev,
struct i40iw_virtchnl_req *vchnl_req)
{
enum i40iw_status_code ret_code = I40IW_ERR_NOT_READY;
struct <API key> *vchnl_msg = vchnl_req->vchnl_msg;
if (!dev->vchnl_up)
return ret_code;
memset(vchnl_msg, 0, sizeof(*vchnl_msg));
vchnl_msg->iw_chnl_op_ctx = (uintptr_t)vchnl_req;
vchnl_msg->iw_chnl_buf_len = sizeof(*vchnl_msg) + sizeof(struct i40iw_dev_hw_stats) - 1;
vchnl_msg->iw_op_code = <API key>;
vchnl_msg->iw_op_ver = <API key>;
ret_code = dev->vchnl_if.vchnl_send(dev, 0, (u8 *)vchnl_msg, vchnl_msg->iw_chnl_buf_len);
if (ret_code)
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: virt channel send failed 0x%x\n", __func__, ret_code);
return ret_code;
}
/**
* <API key> - Add HMC objects
* @dev: IWARP device pointer
* @vchnl_req: Virtual channel message request pointer
*/
static enum i40iw_status_code <API key>(struct i40iw_sc_dev *dev,
struct i40iw_virtchnl_req *vchnl_req,
enum i40iw_hmc_rsrc_type rsrc_type,
u32 start_index,
u32 rsrc_count)
{
enum i40iw_status_code ret_code = I40IW_ERR_NOT_READY;
struct <API key> *vchnl_msg = vchnl_req->vchnl_msg;
struct <API key> *add_hmc_obj;
if (!dev->vchnl_up)
return ret_code;
add_hmc_obj = (struct <API key> *)vchnl_msg->iw_chnl_buf;
memset(vchnl_msg, 0, sizeof(*vchnl_msg));
memset(add_hmc_obj, 0, sizeof(*add_hmc_obj));
vchnl_msg->iw_chnl_op_ctx = (uintptr_t)vchnl_req;
vchnl_msg->iw_chnl_buf_len = sizeof(*vchnl_msg) + sizeof(struct <API key>) - 1;
vchnl_msg->iw_op_code = <API key>;
vchnl_msg->iw_op_ver = <API key>;
add_hmc_obj->obj_type = (u16)rsrc_type;
add_hmc_obj->start_index = start_index;
add_hmc_obj->obj_count = rsrc_count;
ret_code = dev->vchnl_if.vchnl_send(dev, 0, (u8 *)vchnl_msg, vchnl_msg->iw_chnl_buf_len);
if (ret_code)
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: virt channel send failed 0x%x\n", __func__, ret_code);
return ret_code;
}
/**
* <API key> - del HMC objects
* @dev: IWARP device pointer
* @vchnl_req: Virtual channel message request pointer
* @ rsrc_type - resource type to delete
* @ start_index - starting index for resource
* @ rsrc_count - number of resource type to delete
*/
static enum i40iw_status_code <API key>(struct i40iw_sc_dev *dev,
struct i40iw_virtchnl_req *vchnl_req,
enum i40iw_hmc_rsrc_type rsrc_type,
u32 start_index,
u32 rsrc_count)
{
enum i40iw_status_code ret_code = I40IW_ERR_NOT_READY;
struct <API key> *vchnl_msg = vchnl_req->vchnl_msg;
struct <API key> *add_hmc_obj;
if (!dev->vchnl_up)
return ret_code;
add_hmc_obj = (struct <API key> *)vchnl_msg->iw_chnl_buf;
memset(vchnl_msg, 0, sizeof(*vchnl_msg));
memset(add_hmc_obj, 0, sizeof(*add_hmc_obj));
vchnl_msg->iw_chnl_op_ctx = (uintptr_t)vchnl_req;
vchnl_msg->iw_chnl_buf_len = sizeof(*vchnl_msg) + sizeof(struct <API key>) - 1;
vchnl_msg->iw_op_code = <API key>;
vchnl_msg->iw_op_ver = <API key>;
add_hmc_obj->obj_type = (u16)rsrc_type;
add_hmc_obj->start_index = start_index;
add_hmc_obj->obj_count = rsrc_count;
ret_code = dev->vchnl_if.vchnl_send(dev, 0, (u8 *)vchnl_msg, vchnl_msg->iw_chnl_buf_len);
if (ret_code)
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: virt channel send failed 0x%x\n", __func__, ret_code);
return ret_code;
}
/**
* <API key> - Send channel version to VF
* @dev: IWARP device pointer
* @vf_id: Virtual function ID associated with the message
* @vchnl_msg: Virtual channel message buffer pointer
*/
static void <API key>(struct i40iw_sc_dev *dev,
u32 vf_id,
struct <API key> *vchnl_msg)
{
enum i40iw_status_code ret_code;
u8 resp_buffer[sizeof(struct <API key>) + sizeof(u32) - 1];
struct <API key> *vchnl_msg_resp = (struct <API key> *)resp_buffer;
memset(resp_buffer, 0, sizeof(*resp_buffer));
vchnl_msg_resp->iw_chnl_op_ctx = vchnl_msg->iw_chnl_op_ctx;
vchnl_msg_resp->iw_chnl_buf_len = sizeof(resp_buffer);
vchnl_msg_resp->iw_op_ret_code = I40IW_SUCCESS;
*((u32 *)vchnl_msg_resp->iw_chnl_buf) = <API key>;
ret_code = dev->vchnl_if.vchnl_send(dev, vf_id, resp_buffer, sizeof(resp_buffer));
if (ret_code)
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: virt channel send failed 0x%x\n", __func__, ret_code);
}
/**
* <API key> - Send HMC Function to VF
* @dev: IWARP device pointer
* @vf_id: Virtual function ID associated with the message
* @vchnl_msg: Virtual channel message buffer pointer
*/
static void <API key>(struct i40iw_sc_dev *dev,
u32 vf_id,
struct <API key> *vchnl_msg,
u16 hmc_fcn)
{
enum i40iw_status_code ret_code;
u8 resp_buffer[sizeof(struct <API key>) + sizeof(u16) - 1];
struct <API key> *vchnl_msg_resp = (struct <API key> *)resp_buffer;
memset(resp_buffer, 0, sizeof(*resp_buffer));
vchnl_msg_resp->iw_chnl_op_ctx = vchnl_msg->iw_chnl_op_ctx;
vchnl_msg_resp->iw_chnl_buf_len = sizeof(resp_buffer);
vchnl_msg_resp->iw_op_ret_code = I40IW_SUCCESS;
*((u16 *)vchnl_msg_resp->iw_chnl_buf) = hmc_fcn;
ret_code = dev->vchnl_if.vchnl_send(dev, vf_id, resp_buffer, sizeof(resp_buffer));
if (ret_code)
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: virt channel send failed 0x%x\n", __func__, ret_code);
}
/**
* <API key> - Send PE Stats to VF
* @dev: IWARP device pointer
* @vf_id: Virtual function ID associated with the message
* @vchnl_msg: Virtual channel message buffer pointer
* @hw_stats: HW Stats struct
*/
static void <API key>(struct i40iw_sc_dev *dev,
u32 vf_id,
struct <API key> *vchnl_msg,
struct i40iw_dev_hw_stats *hw_stats)
{
enum i40iw_status_code ret_code;
u8 resp_buffer[sizeof(struct <API key>) + sizeof(struct i40iw_dev_hw_stats) - 1];
struct <API key> *vchnl_msg_resp = (struct <API key> *)resp_buffer;
memset(resp_buffer, 0, sizeof(*resp_buffer));
vchnl_msg_resp->iw_chnl_op_ctx = vchnl_msg->iw_chnl_op_ctx;
vchnl_msg_resp->iw_chnl_buf_len = sizeof(resp_buffer);
vchnl_msg_resp->iw_op_ret_code = I40IW_SUCCESS;
*((struct i40iw_dev_hw_stats *)vchnl_msg_resp->iw_chnl_buf) = *hw_stats;
ret_code = dev->vchnl_if.vchnl_send(dev, vf_id, resp_buffer, sizeof(resp_buffer));
if (ret_code)
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: virt channel send failed 0x%x\n", __func__, ret_code);
}
/**
* <API key> - Send an error response to VF
* @dev: IWARP device pointer
* @vf_id: Virtual function ID associated with the message
* @vchnl_msg: Virtual channel message buffer pointer
*/
static void <API key>(struct i40iw_sc_dev *dev, u32 vf_id,
struct <API key> *vchnl_msg,
u16 op_ret_code)
{
enum i40iw_status_code ret_code;
u8 resp_buffer[sizeof(struct <API key>)];
struct <API key> *vchnl_msg_resp = (struct <API key> *)resp_buffer;
memset(resp_buffer, 0, sizeof(resp_buffer));
vchnl_msg_resp->iw_chnl_op_ctx = vchnl_msg->iw_chnl_op_ctx;
vchnl_msg_resp->iw_chnl_buf_len = sizeof(resp_buffer);
vchnl_msg_resp->iw_op_ret_code = (u16)op_ret_code;
ret_code = dev->vchnl_if.vchnl_send(dev, vf_id, resp_buffer, sizeof(resp_buffer));
if (ret_code)
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: virt channel send failed 0x%x\n", __func__, ret_code);
}
/**
* <API key> - Callback for Get HMC Fcn
* @cqp_req_param: CQP Request param value
* @not_used: unused CQP callback parameter
*/
static void <API key>(struct i40iw_sc_dev *dev, void *callback_param,
struct i40iw_ccq_cqe_info *cqe_info)
{
struct i40iw_vfdev *vf_dev = callback_param;
struct i40iw_virt_mem vf_dev_mem;
if (cqe_info->error) {
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"CQP Completion Error on Get HMC Function. Maj = 0x%04x, Minor = 0x%04x\n",
cqe_info->maj_err_code, cqe_info->min_err_code);
dev->vf_dev[vf_dev->iw_vf_idx] = NULL;
<API key>(dev, vf_dev->vf_id, &vf_dev->vf_msg_buffer.vchnl_msg,
(u16)<API key>);
vf_dev_mem.va = vf_dev;
vf_dev_mem.size = sizeof(*vf_dev);
i40iw_free_virt_mem(dev->hw, &vf_dev_mem);
} else {
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"CQP Completion Operation Return information = 0x%08x\n",
cqe_info->op_ret_val);
vf_dev->pmf_index = (u16)cqe_info->op_ret_val;
vf_dev->msg_count
<API key>(dev,
vf_dev->vf_id,
&vf_dev->vf_msg_buffer.vchnl_msg,
vf_dev->pmf_index);
}
}
/**
* pf_add_hmc_obj - Callback for Add HMC Object
* @vf_dev: pointer to the VF Device
*/
static void <API key>(void *work_vf_dev)
{
struct i40iw_vfdev *vf_dev = (struct i40iw_vfdev *)work_vf_dev;
struct i40iw_hmc_info *hmc_info = &vf_dev->hmc_info;
struct <API key> *vchnl_msg = &vf_dev->vf_msg_buffer.vchnl_msg;
struct <API key> info;
struct <API key> *add_hmc_obj;
enum i40iw_status_code ret_code;
if (!vf_dev->pf_hmc_initialized) {
ret_code = i40iw_pf_init_vfhmc(vf_dev->pf_dev, (u8)vf_dev->pmf_index, NULL);
if (ret_code)
goto add_out;
vf_dev->pf_hmc_initialized = true;
}
add_hmc_obj = (struct <API key> *)vchnl_msg->iw_chnl_buf;
memset(&info, 0, sizeof(info));
info.hmc_info = hmc_info;
info.is_pf = false;
info.rsrc_type = (u32)add_hmc_obj->obj_type;
info.entry_type = (info.rsrc_type == I40IW_HMC_IW_PBLE) ? I40IW_SD_TYPE_PAGED : <API key>;
info.start_idx = add_hmc_obj->start_index;
info.count = add_hmc_obj->obj_count;
i40iw_debug(vf_dev->pf_dev, I40IW_DEBUG_VIRT,
"<API key>. Add %u type %u objects\n",
info.count, info.rsrc_type);
ret_code = <API key>(vf_dev->pf_dev, &info);
if (!ret_code)
vf_dev->hmc_info.hmc_obj[add_hmc_obj->obj_type].cnt = add_hmc_obj->obj_count;
add_out:
vf_dev->msg_count
<API key>(vf_dev->pf_dev, vf_dev->vf_id, vchnl_msg, (u16)ret_code);
}
/**
* <API key> - Callback for delete HMC Object
* @work_vf_dev: pointer to the VF Device
*/
static void <API key>(void *work_vf_dev)
{
struct i40iw_vfdev *vf_dev = (struct i40iw_vfdev *)work_vf_dev;
struct i40iw_hmc_info *hmc_info = &vf_dev->hmc_info;
struct <API key> *vchnl_msg = &vf_dev->vf_msg_buffer.vchnl_msg;
struct <API key> info;
struct <API key> *del_hmc_obj;
enum i40iw_status_code ret_code = I40IW_SUCCESS;
if (!vf_dev->pf_hmc_initialized)
goto del_out;
del_hmc_obj = (struct <API key> *)vchnl_msg->iw_chnl_buf;
memset(&info, 0, sizeof(info));
info.hmc_info = hmc_info;
info.is_pf = false;
info.rsrc_type = (u32)del_hmc_obj->obj_type;
info.start_idx = del_hmc_obj->start_index;
info.count = del_hmc_obj->obj_count;
i40iw_debug(vf_dev->pf_dev, I40IW_DEBUG_VIRT,
"<API key>. Delete %u type %u objects\n",
info.count, info.rsrc_type);
ret_code = <API key>(vf_dev->pf_dev, &info, false);
del_out:
vf_dev->msg_count
<API key>(vf_dev->pf_dev, vf_dev->vf_id, vchnl_msg, (u16)ret_code);
}
/**
* <API key> - Initialize stats for VF
* @devL pointer to the VF Device
* @stats: Statistics structure pointer
* @index: Stats index
*/
static void <API key>(struct i40iw_sc_dev *dev, struct i40iw_vsi_pestat *stats, u16 index)
{
stats->hw = dev->hw;
i40iw_hw_stats_init(stats, (u8)index, false);
spin_lock_init(&stats->lock);
}
/**
* i40iw_vchnl_recv_pf - Receive PF virtual channel messages
* @dev: IWARP device pointer
* @vf_id: Virtual function ID associated with the message
* @msg: Virtual channel message buffer pointer
* @len: Length of the virtual channels message
*/
enum i40iw_status_code i40iw_vchnl_recv_pf(struct i40iw_sc_dev *dev,
u32 vf_id,
u8 *msg,
u16 len)
{
struct <API key> *vchnl_msg = (struct <API key> *)msg;
struct i40iw_vfdev *vf_dev = NULL;
struct i40iw_hmc_fcn_info hmc_fcn_info;
u16 iw_vf_idx;
u16 first_avail_iw_vf = <API key>;
struct i40iw_virt_mem vf_dev_mem;
struct <API key> work_info;
struct i40iw_vsi_pestat *stats;
enum i40iw_status_code ret_code;
if (!dev || !msg || !len)
return I40IW_ERR_PARAM;
if (!dev->vchnl_up)
return I40IW_ERR_NOT_READY;
if (vchnl_msg->iw_op_code == <API key>) {
if (vchnl_msg->iw_op_ver != <API key>)
<API key>(dev, vf_id, vchnl_msg);
else
<API key>(dev, vf_id, vchnl_msg);
return I40IW_SUCCESS;
}
for (iw_vf_idx = 0; iw_vf_idx < <API key>; iw_vf_idx++) {
if (!dev->vf_dev[iw_vf_idx]) {
if (first_avail_iw_vf == <API key>)
first_avail_iw_vf = iw_vf_idx;
continue;
}
if (dev->vf_dev[iw_vf_idx]->vf_id == vf_id) {
vf_dev = dev->vf_dev[iw_vf_idx];
break;
}
}
if (vf_dev) {
if (!vf_dev->msg_count) {
vf_dev->msg_count++;
} else {
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"VF%u already has a channel message in progress.\n",
vf_id);
return I40IW_SUCCESS;
}
}
switch (vchnl_msg->iw_op_code) {
case <API key>:
if (!vf_dev &&
(first_avail_iw_vf != <API key>)) {
ret_code = <API key>(dev->hw, &vf_dev_mem, sizeof(struct i40iw_vfdev) +
(sizeof(struct i40iw_hmc_obj_info) * I40IW_HMC_IW_MAX));
if (!ret_code) {
vf_dev = vf_dev_mem.va;
vf_dev->stats_initialized = false;
vf_dev->pf_dev = dev;
vf_dev->msg_count = 1;
vf_dev->vf_id = vf_id;
vf_dev->iw_vf_idx = first_avail_iw_vf;
vf_dev->pf_hmc_initialized = false;
vf_dev->hmc_info.hmc_obj = (struct i40iw_hmc_obj_info *)(&vf_dev[1]);
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"vf_dev %p, hmc_info %p, hmc_obj %p\n",
vf_dev, &vf_dev->hmc_info, vf_dev->hmc_info.hmc_obj);
dev->vf_dev[first_avail_iw_vf] = vf_dev;
iw_vf_idx = first_avail_iw_vf;
} else {
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"VF%u Unable to allocate a VF device structure.\n",
vf_id);
<API key>(dev, vf_id, vchnl_msg, (u16)I40IW_ERR_NO_MEMORY);
return I40IW_SUCCESS;
}
memcpy(&vf_dev->vf_msg_buffer.vchnl_msg, vchnl_msg, len);
hmc_fcn_info.callback_fcn = <API key>;
hmc_fcn_info.vf_id = vf_id;
hmc_fcn_info.iw_vf_idx = vf_dev->iw_vf_idx;
hmc_fcn_info.cqp_callback_param = vf_dev;
hmc_fcn_info.free_fcn = false;
ret_code = <API key>(dev, &hmc_fcn_info);
if (ret_code)
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"VF%u error CQP HMC Function operation.\n",
vf_id);
<API key>(dev, &vf_dev->pestat, vf_dev->pmf_index);
vf_dev->stats_initialized = true;
} else {
if (vf_dev) {
vf_dev->msg_count
<API key>(dev, vf_id, vchnl_msg, vf_dev->pmf_index);
} else {
<API key>(dev, vf_id, vchnl_msg,
(u16)I40IW_ERR_NO_MEMORY);
}
}
break;
case <API key>:
if (!vf_dev)
return I40IW_ERR_BAD_PTR;
work_info.worker_vf_dev = vf_dev;
work_info.callback_fcn = <API key>;
memcpy(&vf_dev->vf_msg_buffer.vchnl_msg, vchnl_msg, len);
<API key>(dev, &work_info, vf_dev->iw_vf_idx);
break;
case <API key>:
if (!vf_dev)
return I40IW_ERR_BAD_PTR;
work_info.worker_vf_dev = vf_dev;
work_info.callback_fcn = <API key>;
memcpy(&vf_dev->vf_msg_buffer.vchnl_msg, vchnl_msg, len);
<API key>(dev, &work_info, vf_dev->iw_vf_idx);
break;
case <API key>:
if (!vf_dev)
return I40IW_ERR_BAD_PTR;
stats = &vf_dev->pestat;
<API key>(stats, &stats->hw_stats);
vf_dev->msg_count
<API key>(dev, vf_id, vchnl_msg, &stats->hw_stats);
break;
default:
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"40iw_vchnl_recv_pf: Invalid OpCode 0x%x\n",
vchnl_msg->iw_op_code);
<API key>(dev, vf_id,
vchnl_msg, (u16)<API key>);
}
return I40IW_SUCCESS;
}
/**
* i40iw_vchnl_recv_vf - Receive VF virtual channel messages
* @dev: IWARP device pointer
* @vf_id: Virtual function ID associated with the message
* @msg: Virtual channel message buffer pointer
* @len: Length of the virtual channels message
*/
enum i40iw_status_code i40iw_vchnl_recv_vf(struct i40iw_sc_dev *dev,
u32 vf_id,
u8 *msg,
u16 len)
{
struct <API key> *vchnl_msg_resp = (struct <API key> *)msg;
struct i40iw_virtchnl_req *vchnl_req;
vchnl_req = (struct i40iw_virtchnl_req *)(uintptr_t)vchnl_msg_resp->iw_chnl_op_ctx;
vchnl_req->ret_code = (enum i40iw_status_code)vchnl_msg_resp->iw_op_ret_code;
if (len == (sizeof(*vchnl_msg_resp) + vchnl_req->parm_len - 1)) {
if (vchnl_req->parm_len && vchnl_req->parm)
memcpy(vchnl_req->parm, vchnl_msg_resp->iw_chnl_buf, vchnl_req->parm_len);
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: Got response, data size %u\n", __func__,
vchnl_req->parm_len);
} else {
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s: error length on response, Got %u, expected %u\n", __func__,
len, (u32)(sizeof(*vchnl_msg_resp) + vchnl_req->parm_len - 1));
}
return I40IW_SUCCESS;
}
/**
* <API key> - Request Channel version
* @dev: IWARP device pointer
* @vchnl_ver: Virtual channel message version pointer
*/
enum i40iw_status_code <API key>(struct i40iw_sc_dev *dev,
u32 *vchnl_ver)
{
struct i40iw_virtchnl_req vchnl_req;
enum i40iw_status_code ret_code;
if (!<API key>(dev))
return I40IW_ERR_TIMEOUT;
memset(&vchnl_req, 0, sizeof(vchnl_req));
vchnl_req.dev = dev;
vchnl_req.parm = vchnl_ver;
vchnl_req.parm_len = sizeof(*vchnl_ver);
vchnl_req.vchnl_msg = &dev->vchnl_vf_msg_buf.vchnl_msg;
ret_code = <API key>(dev, &vchnl_req);
if (ret_code) {
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s Send message failed 0x%0x\n", __func__, ret_code);
return ret_code;
}
ret_code = <API key>(dev);
if (ret_code)
return ret_code;
else
return vchnl_req.ret_code;
}
/**
* <API key> - Request HMC Function
* @dev: IWARP device pointer
* @hmc_fcn: HMC function index pointer
*/
enum i40iw_status_code <API key>(struct i40iw_sc_dev *dev,
u16 *hmc_fcn)
{
struct i40iw_virtchnl_req vchnl_req;
enum i40iw_status_code ret_code;
if (!<API key>(dev))
return I40IW_ERR_TIMEOUT;
memset(&vchnl_req, 0, sizeof(vchnl_req));
vchnl_req.dev = dev;
vchnl_req.parm = hmc_fcn;
vchnl_req.parm_len = sizeof(*hmc_fcn);
vchnl_req.vchnl_msg = &dev->vchnl_vf_msg_buf.vchnl_msg;
ret_code = <API key>(dev, &vchnl_req);
if (ret_code) {
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s Send message failed 0x%0x\n", __func__, ret_code);
return ret_code;
}
ret_code = <API key>(dev);
if (ret_code)
return ret_code;
else
return vchnl_req.ret_code;
}
/**
* <API key> - Add HMC Object
* @dev: IWARP device pointer
* @rsrc_type: HMC Resource type
* @start_index: Starting index of the objects to be added
* @rsrc_count: Number of resources to be added
*/
enum i40iw_status_code <API key>(struct i40iw_sc_dev *dev,
enum i40iw_hmc_rsrc_type rsrc_type,
u32 start_index,
u32 rsrc_count)
{
struct i40iw_virtchnl_req vchnl_req;
enum i40iw_status_code ret_code;
if (!<API key>(dev))
return I40IW_ERR_TIMEOUT;
memset(&vchnl_req, 0, sizeof(vchnl_req));
vchnl_req.dev = dev;
vchnl_req.vchnl_msg = &dev->vchnl_vf_msg_buf.vchnl_msg;
ret_code = <API key>(dev,
&vchnl_req,
rsrc_type,
start_index,
rsrc_count);
if (ret_code) {
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s Send message failed 0x%0x\n", __func__, ret_code);
return ret_code;
}
ret_code = <API key>(dev);
if (ret_code)
return ret_code;
else
return vchnl_req.ret_code;
}
/**
* <API key> - del HMC obj
* @dev: IWARP device pointer
* @rsrc_type: HMC Resource type
* @start_index: Starting index of the object to delete
* @rsrc_count: Number of resources to be delete
*/
enum i40iw_status_code <API key>(struct i40iw_sc_dev *dev,
enum i40iw_hmc_rsrc_type rsrc_type,
u32 start_index,
u32 rsrc_count)
{
struct i40iw_virtchnl_req vchnl_req;
enum i40iw_status_code ret_code;
if (!<API key>(dev))
return I40IW_ERR_TIMEOUT;
memset(&vchnl_req, 0, sizeof(vchnl_req));
vchnl_req.dev = dev;
vchnl_req.vchnl_msg = &dev->vchnl_vf_msg_buf.vchnl_msg;
ret_code = <API key>(dev,
&vchnl_req,
rsrc_type,
start_index,
rsrc_count);
if (ret_code) {
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s Send message failed 0x%0x\n", __func__, ret_code);
return ret_code;
}
ret_code = <API key>(dev);
if (ret_code)
return ret_code;
else
return vchnl_req.ret_code;
}
/**
* <API key> - Get PE stats
* @dev: IWARP device pointer
* @hw_stats: HW stats struct
*/
enum i40iw_status_code <API key>(struct i40iw_sc_dev *dev,
struct i40iw_dev_hw_stats *hw_stats)
{
struct i40iw_virtchnl_req vchnl_req;
enum i40iw_status_code ret_code;
if (!<API key>(dev))
return I40IW_ERR_TIMEOUT;
memset(&vchnl_req, 0, sizeof(vchnl_req));
vchnl_req.dev = dev;
vchnl_req.parm = hw_stats;
vchnl_req.parm_len = sizeof(*hw_stats);
vchnl_req.vchnl_msg = &dev->vchnl_vf_msg_buf.vchnl_msg;
ret_code = <API key>(dev, &vchnl_req);
if (ret_code) {
i40iw_debug(dev, I40IW_DEBUG_VIRT,
"%s Send message failed 0x%0x\n", __func__, ret_code);
return ret_code;
}
ret_code = <API key>(dev);
if (ret_code)
return ret_code;
else
return vchnl_req.ret_code;
}
|
/**
* @file daemontest_post.c
* @brief Testcase for libmicrohttpd POST operations using URL-encoding
* @author Christian Grothoff
*/
#include "MHD_config.h"
#include "platform.h"
#include <curl/curl.h>
#include <microhttpd.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifndef WINDOWS
#include <unistd.h>
#endif
#include "socat.c"
#define POST_DATA "name=daniel&project=curl"
static int oneone;
struct CBC
{
char *buf;
size_t pos;
size_t size;
};
static size_t
copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
{
struct CBC *cbc = ctx;
if (cbc->pos + size * nmemb > cbc->size)
return 0; /* overflow */
memcpy (&cbc->buf[cbc->pos], ptr, size * nmemb);
cbc->pos += size * nmemb;
return size * nmemb;
}
/**
* Note that this post_iterator is not perfect
* in that it fails to support incremental processing.
* (to be fixed in the future)
*/
static int
post_iterator (void *cls,
enum MHD_ValueKind kind,
const char *key,
const char *filename,
const char *content_type,
const char *transfer_encoding,
const char *value, uint64_t off, size_t size)
{
int *eok = cls;
if ((0 == strcmp (key, "name")) &&
(size == strlen ("daniel")) && (0 == strncmp (value, "daniel", size)))
(*eok) |= 1;
if ((0 == strcmp (key, "project")) &&
(size == strlen ("curl")) && (0 == strncmp (value, "curl", size)))
(*eok) |= 2;
return MHD_YES;
}
static int
ahc_echo (void *cls,
struct MHD_Connection *connection,
const char *url,
const char *method,
const char *version,
const char *upload_data, size_t *upload_data_size,
void **unused)
{
static int eok;
struct MHD_Response *response;
struct MHD_PostProcessor *pp;
int ret;
if (0 != strcmp ("POST", method))
{
return MHD_NO; /* unexpected method */
}
pp = *unused;
if (pp == NULL)
{
eok = 0;
pp = <API key> (connection, 1024, &post_iterator, &eok);
*unused = pp;
}
MHD_post_process (pp, upload_data, *upload_data_size);
if ((eok == 3) && (0 == *upload_data_size))
{
response = <API key> (strlen (url),
(void *) url,
MHD_NO, MHD_YES);
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
<API key> (response);
<API key> (pp);
*unused = NULL;
return ret;
}
*upload_data_size = 0;
return MHD_YES;
}
static int
testInternalPost ()
{
struct MHD_Daemon *d;
CURL *c;
char buf[2048];
struct CBC cbc;
int i;
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon (<API key> /* | MHD_USE_DEBUG */ ,
11080, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
if (d == NULL)
return 1;
zzuf_socat_start ();
for (i = 0; i < LOOP_COUNT; i++)
{
fprintf (stderr, ".");
c = curl_easy_init ();
curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world");
curl_easy_setopt (c, <API key>, ©Buffer);
curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
curl_easy_setopt (c, <API key>, strlen (POST_DATA));
curl_easy_setopt (c, CURLOPT_POST, 1L);
curl_easy_setopt (c, CURLOPT_FAILONERROR, 1);
curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
if (oneone)
curl_easy_setopt (c, <API key>, <API key>);
else
curl_easy_setopt (c, <API key>, <API key>);
curl_easy_setopt (c, <API key>, CURL_TIMEOUT);
// NOTE: use of CONNECTTIMEOUT without also
// setting NOSIGNAL results in really weird
// crashes on my system!
curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1);
curl_easy_perform (c);
curl_easy_cleanup (c);
}
fprintf (stderr, "\n");
zzuf_socat_stop ();
MHD_stop_daemon (d);
return 0;
}
static int
<API key> ()
{
struct MHD_Daemon *d;
CURL *c;
char buf[2048];
struct CBC cbc;
int i;
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon (<API key> /* | MHD_USE_DEBUG */ ,
11080, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
if (d == NULL)
return 16;
zzuf_socat_start ();
for (i = 0; i < LOOP_COUNT; i++)
{
fprintf (stderr, ".");
c = curl_easy_init ();
curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world");
curl_easy_setopt (c, <API key>, ©Buffer);
curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
curl_easy_setopt (c, <API key>, strlen (POST_DATA));
curl_easy_setopt (c, CURLOPT_POST, 1L);
curl_easy_setopt (c, CURLOPT_FAILONERROR, 1);
curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
if (oneone)
curl_easy_setopt (c, <API key>, <API key>);
else
curl_easy_setopt (c, <API key>, <API key>);
curl_easy_setopt (c, <API key>, CURL_TIMEOUT);
// NOTE: use of CONNECTTIMEOUT without also
// setting NOSIGNAL results in really weird
// crashes on my system!
curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1);
curl_easy_perform (c);
curl_easy_cleanup (c);
}
fprintf (stderr, "\n");
zzuf_socat_stop ();
MHD_stop_daemon (d);
return 0;
}
static int
testExternalPost ()
{
struct MHD_Daemon *d;
CURL *c;
char buf[2048];
struct CBC cbc;
CURLM *multi;
CURLMcode mret;
fd_set rs;
fd_set ws;
fd_set es;
int max;
int running;
time_t start;
struct timeval tv;
int i;
multi = NULL;
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_DEBUG */ ,
1082, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
if (d == NULL)
return 256;
multi = curl_multi_init ();
if (multi == NULL)
{
MHD_stop_daemon (d);
return 512;
}
zzuf_socat_start ();
for (i = 0; i < LOOP_COUNT; i++)
{
fprintf (stderr, ".");
c = curl_easy_init ();
curl_easy_setopt (c, CURLOPT_URL, "http://localhost:1082/hello_world");
curl_easy_setopt (c, <API key>, ©Buffer);
curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA);
curl_easy_setopt (c, <API key>, strlen (POST_DATA));
curl_easy_setopt (c, CURLOPT_POST, 1L);
curl_easy_setopt (c, CURLOPT_FAILONERROR, 1);
curl_easy_setopt (c, CURLOPT_TIMEOUT_MS, CURL_TIMEOUT);
if (oneone)
curl_easy_setopt (c, <API key>, <API key>);
else
curl_easy_setopt (c, <API key>, <API key>);
curl_easy_setopt (c, <API key>, CURL_TIMEOUT);
// NOTE: use of CONNECTTIMEOUT without also
// setting NOSIGNAL results in really weird
// crashes on my system!
curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1);
mret = <API key> (multi, c);
if (mret != CURLM_OK)
{
curl_multi_cleanup (multi);
curl_easy_cleanup (c);
zzuf_socat_stop ();
MHD_stop_daemon (d);
return 1024;
}
start = time (NULL);
while ((time (NULL) - start < 5) && (c != NULL))
{
max = 0;
FD_ZERO (&rs);
FD_ZERO (&ws);
FD_ZERO (&es);
curl_multi_perform (multi, &running);
mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
if (mret != CURLM_OK)
{
<API key> (multi, c);
curl_multi_cleanup (multi);
curl_easy_cleanup (c);
zzuf_socat_stop ();
MHD_stop_daemon (d);
return 2048;
}
if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max))
{
<API key> (multi, c);
curl_multi_cleanup (multi);
curl_easy_cleanup (c);
zzuf_socat_stop ();
MHD_stop_daemon (d);
return 4096;
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
select (max + 1, &rs, &ws, &es, &tv);
curl_multi_perform (multi, &running);
if (running == 0)
{
<API key> (multi, &running);
<API key> (multi, c);
curl_easy_cleanup (c);
c = NULL;
}
MHD_run (d);
}
if (c != NULL)
{
<API key> (multi, c);
curl_easy_cleanup (c);
}
}
fprintf (stderr, "\n");
curl_multi_cleanup (multi);
zzuf_socat_stop ();
MHD_stop_daemon (d);
return 0;
}
int
main (int argc, char *const *argv)
{
unsigned int errorCount = 0;
oneone = NULL != strstr (argv[0], "11");
if (0 != curl_global_init (CURL_GLOBAL_WIN32))
return 2;
errorCount += testInternalPost ();
errorCount += <API key> ();
errorCount += testExternalPost ();
if (errorCount != 0)
fprintf (stderr, "Error (code: %u)\n", errorCount);
curl_global_cleanup ();
return errorCount != 0; /* 0 == pass */
}
|
// Type definitions for <API key> 0.11
// Project: https://github.com/lodash/<API key>#readme
import { Plugin } from 'webpack';
export = <API key>;
declare class <API key> extends Plugin {
constructor(options?: <API key>.Options);
}
declare namespace <API key> {
interface Options {
caching?: boolean;
chaining?: boolean;
cloning?: boolean;
coercions?: boolean;
collections?: boolean;
currying?: boolean;
deburring?: boolean;
exotics?: boolean;
flattening?: boolean;
guards?: boolean;
memoizing?: boolean;
metadata?: boolean;
paths?: boolean;
placeholders?: boolean;
shorthands?: boolean;
unicode?: boolean;
}
}
|
#define DEBUG
#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/io.h>
#include <linux/jiffies.h>
#include <linux/firmware.h>
#include <linux/err.h>
#include <linux/sched.h>
#include <linux/dma-mapping.h>
#include <asm/cacheflush.h>
#ifdef <API key>
#include <config/exynos/iovmm.h>
#endif
#include "hevc_common.h"
#include "hevc_cmd.h"
#include "hevc_mem.h"
#include "hevc_intr.h"
#include "hevc_inst.h"
#include "hevc_pm.h"
#include "hevc_debug.h"
#include "hevc_dec.h"
#include "hevc_opr.h"
#include "regs-hevc.h"
#include "hevc_reg.h"
/* #define HEVC_DEBUG_REGWRITE */
#ifdef HEVC_DEBUG_REGWRITE
#undef writel
#define writel(v, r) \
do { \
printk(KERN_ERR "HEVCWRITE(%p): %08x\n", r, (unsigned int)v); \
__raw_writel(v, r); \
} while (0)
#endif /* HEVC_DEBUG_REGWRITE */
#define READL(offset) readl(dev->regs_base + (offset))
#define WRITEL(data, offset) writel((data), dev->regs_base + (offset))
#define OFFSETA(x) (((x) - dev->port_a) >> HEVC_MEM_OFFSET)
#define OFFSETB(x) (((x) - dev->port_b) >> HEVC_MEM_OFFSET)
/* Allocate codec buffers */
int <API key>(struct hevc_ctx *ctx)
{
struct hevc_dev *dev;
struct hevc_dec *dec;
unsigned int mb_width, mb_height;
void *alloc_ctx;
int i;
int lcu_width, lcu_height;
hevc_debug_enter();
if (!ctx) {
hevc_err("no hevc context to run\n");
return -EINVAL;
}
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
dec = ctx->dec_priv;
alloc_ctx = dev->alloc_ctx[<API key>];
mb_width = mb_width(ctx->img_width);
mb_height = mb_height(ctx->img_height);
if (ctx->type == HEVCINST_DECODER) {
for (i = 0; i < ctx->raw_buf.num_planes; i++)
hevc_debug(2, "Plane[%d] size:%d\n",
i, ctx->raw_buf.plane_size[i]);
hevc_debug(2, "MV size: %d, Totals bufs: %d\n",
ctx->mv_size, dec->total_dpb_count);
} else {
return -EINVAL;
}
ctx->lcu_size = 64;
hevc_info("ctx->lcu_size : %d\n", ctx->lcu_size);
lcu_width = ALIGN(ctx->img_width, ctx->lcu_size);
lcu_height = ALIGN(ctx->img_height, ctx->lcu_size);
ctx->scratch_buf_size =
<API key>(lcu_width , lcu_height);
ctx->scratch_buf_size = ALIGN(ctx->scratch_buf_size, 256);
ctx->port_a_size =
ctx->scratch_buf_size +
(dec->mv_count * ctx->mv_size);
if (ctx->is_drm)
alloc_ctx = dev->alloc_ctx_drm;
/* Allocate only if memory from bank 1 is necessary */
if (ctx->port_a_size > 0) {
ctx->port_a_buf = hevc_mem_alloc_priv(
alloc_ctx, ctx->port_a_size);
if (IS_ERR(ctx->port_a_buf)) {
ctx->port_a_buf = 0;
printk(KERN_ERR
"Buf alloc for decoding failed (port A).\n");
return -ENOMEM;
}
ctx->port_a_phys = hevc_mem_daddr_priv(ctx->port_a_buf);
}
hevc_debug_leave();
return 0;
}
/* Release buffers allocated for codec */
void <API key>(struct hevc_ctx *ctx)
{
if (!ctx) {
hevc_err("no hevc context to run\n");
return;
}
if (ctx->port_a_buf) {
hevc_mem_free_priv(ctx->port_a_buf);
ctx->port_a_buf = 0;
ctx->port_a_phys = 0;
ctx->port_a_size = 0;
}
}
/* Allocate memory for instance data buffer */
int <API key>(struct hevc_ctx *ctx)
{
struct hevc_dev *dev;
struct hevc_buf_size_v6 *buf_size;
void *alloc_ctx;
hevc_debug_enter();
if (!ctx) {
hevc_err("no hevc context to run\n");
return -EINVAL;
}
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
buf_size = dev->variant->buf_size->buf;
alloc_ctx = dev->alloc_ctx[<API key>];
ctx->ctx_buf_size = buf_size->dec_ctx;
if (ctx->is_drm)
alloc_ctx = dev->alloc_ctx_drm;
ctx->ctx.alloc = hevc_mem_alloc_priv(alloc_ctx, ctx->ctx_buf_size);
if (IS_ERR(ctx->ctx.alloc)) {
hevc_err("Allocating context buffer failed.\n");
return PTR_ERR(ctx->ctx.alloc);
}
ctx->ctx.ofs = hevc_mem_daddr_priv(ctx->ctx.alloc);
ctx->ctx.virt = hevc_mem_vaddr_priv(ctx->ctx.alloc);
if (!ctx->ctx.virt) {
hevc_mem_free_priv(ctx->ctx.alloc);
ctx->ctx.alloc = NULL;
ctx->ctx.ofs = 0;
ctx->ctx.virt = NULL;
hevc_err("Remapping context buffer failed.\n");
return -ENOMEM;
}
hevc_debug_leave();
return 0;
}
/* Release instance buffer */
void <API key>(struct hevc_ctx *ctx)
{
hevc_debug_enter();
if (!ctx) {
hevc_err("no hevc context to run\n");
return;
}
if (ctx->ctx.alloc) {
hevc_mem_free_priv(ctx->ctx.alloc);
ctx->ctx.alloc = NULL;
ctx->ctx.ofs = 0;
ctx->ctx.virt = NULL;
}
hevc_debug_leave();
}
/* Allocate context buffers for SYS_INIT */
int <API key>(struct hevc_dev *dev)
{
struct hevc_buf_size_v6 *buf_size;
void *alloc_ctx;
hevc_debug_enter();
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
buf_size = dev->variant->buf_size->buf;
alloc_ctx = dev->alloc_ctx[<API key>];
hevc_info("dev context buf_size : %d\n", buf_size->dev_ctx);
#ifdef <API key>
if (dev->num_drm_inst)
alloc_ctx = dev->alloc_ctx_drm;
#endif
dev->ctx_buf.alloc =
hevc_mem_alloc_priv(alloc_ctx, buf_size->dev_ctx);
if (IS_ERR(dev->ctx_buf.alloc)) {
hevc_err("Allocating DESC buffer failed.\n");
return PTR_ERR(dev->ctx_buf.alloc);
}
dev->ctx_buf.ofs = hevc_mem_daddr_priv(dev->ctx_buf.alloc);
dev->ctx_buf.virt = hevc_mem_vaddr_priv(dev->ctx_buf.alloc);
if (!dev->ctx_buf.virt) {
hevc_mem_free_priv(dev->ctx_buf.alloc);
dev->ctx_buf.alloc = NULL;
dev->ctx_buf.ofs = 0;
hevc_err("Remapping DESC buffer failed.\n");
return -ENOMEM;
}
hevc_debug_leave();
return 0;
}
/* Release context buffers for SYS_INIT */
void <API key>(struct hevc_dev *dev)
{
if (!dev) {
hevc_err("no hevc device to run\n");
return;
}
if (dev->ctx_buf.alloc) {
hevc_mem_free_priv(dev->ctx_buf.alloc);
dev->ctx_buf.alloc = NULL;
dev->ctx_buf.ofs = 0;
dev->ctx_buf.virt = NULL;
}
}
static int calc_plane(int width, int height, int is_tiled)
{
int mbX, mbY;
mbX = (width + 15)/16;
mbY = (height + 15)/16;
/* Alignment for interlaced processing */
if (is_tiled)
mbY = (mbY + 1) / 2 * 2;
return (mbX * 16) * (mbY * 16);
}
static void <API key>(struct hevc_ctx *ctx, struct hevc_fmt *fmt)
{
struct hevc_raw_info *raw;
int i;
raw = &ctx->raw_buf;
switch (fmt->fourcc) {
case <API key>:
case <API key>:
ctx->raw_buf.stride[0] = ctx->img_width;
ctx->raw_buf.stride[1] = ctx->img_width >> 1;
ctx->raw_buf.stride[2] = ctx->img_width >> 1;
break;
case <API key>:
case V4L2_PIX_FMT_NV12MT:
case V4L2_PIX_FMT_NV12M:
case V4L2_PIX_FMT_NV21M:
raw->stride[0] = ctx->img_width;
raw->stride[1] = ctx->img_width;
raw->stride[2] = 0;
break;
case V4L2_PIX_FMT_RGB24:
ctx->raw_buf.stride[0] = ctx->img_width * 3;
ctx->raw_buf.stride[1] = 0;
ctx->raw_buf.stride[2] = 0;
break;
case V4L2_PIX_FMT_RGB565:
ctx->raw_buf.stride[0] = ctx->img_width * 2;
ctx->raw_buf.stride[1] = 0;
ctx->raw_buf.stride[2] = 0;
break;
case V4L2_PIX_FMT_RGB32X:
case V4L2_PIX_FMT_BGR32:
ctx->raw_buf.stride[0] = ctx->img_width * 4;
ctx->raw_buf.stride[1] = 0;
ctx->raw_buf.stride[2] = 0;
break;
default:
break;
}
/* Decoder needs multiple of 16 alignment for stride */
if (ctx->type == HEVCINST_DECODER) {
for (i = 0; i < 3; i++)
ctx->raw_buf.stride[i] =
ALIGN(ctx->raw_buf.stride[i], 16);
}
}
void <API key>(struct hevc_ctx *ctx)
{
struct hevc_dev *dev;
struct hevc_dec *dec;
struct hevc_raw_info *raw;
int i;
if (!ctx) {
hevc_err("no hevc context to run\n");
return;
}
dev = ctx->dev;
raw = &ctx->raw_buf;
dec = ctx->dec_priv;
ctx->buf_width = ALIGN(ctx->img_width, 16);
ctx->buf_height = ALIGN(ctx->img_height, 16);
hevc_info("SEQ Done: Movie dimensions %dx%d, "
"buffer dimensions: %dx%d\n", ctx->img_width,
ctx->img_height, ctx->buf_width, ctx->buf_height);
switch (ctx->dst_fmt->fourcc) {
case V4L2_PIX_FMT_NV12M:
case V4L2_PIX_FMT_NV21M:
raw->plane_size[0] = ctx->buf_width*ctx->img_height;
raw->plane_size[1] = ctx->buf_width*(ctx->img_height >> 1);
raw->plane_size[2] = 0;
break;
case <API key>:
case <API key>:
raw->plane_size[0] =
calc_plane(ctx->img_width, ctx->img_height, 0);
raw->plane_size[1] =
calc_plane(ctx->img_width >> 1, ctx->img_height >> 1, 0);
raw->plane_size[2] =
calc_plane(ctx->img_width >> 1, ctx->img_height >> 1, 0);
break;
default:
raw->plane_size[0] = 0;
raw->plane_size[1] = 0;
raw->plane_size[2] = 0;
hevc_err("Invalid pixelformat : %s\n", ctx->dst_fmt->name);
break;
}
<API key>(ctx, ctx->dst_fmt);
for (i = 0; i < raw->num_planes; i++)
hevc_debug(2, "Plane[%d] size = %d, stride = %d\n",
i, raw->plane_size[i], raw->stride[i]);
switch (ctx->dst_fmt->fourcc) {
case V4L2_PIX_FMT_NV12M:
case V4L2_PIX_FMT_NV21M:
raw->plane_size[0] += 64;
raw->plane_size[1] += 64;
break;
case <API key>:
case <API key>:
raw->plane_size[0] += 64;
raw->plane_size[1] += 64;
raw->plane_size[2] += 64;
break;
default:
break;
}
hevc_info("codec mode : %d\n", ctx->codec_mode);
if (ctx->codec_mode == <API key>) {
ctx->mv_size = hevc_dec_mv_size(ctx->img_width,
ctx->img_height);
ctx->mv_size = ALIGN(ctx->mv_size, 32);
} else {
ctx->mv_size = 0;
}
}
/* Set registers for decoding stream buffer */
int <API key>(struct hevc_ctx *ctx, dma_addr_t buf_addr,
unsigned int start_num_byte, unsigned int strm_size)
{
struct hevc_dec *dec;
struct hevc_dev *dev;
size_t cpb_buf_size;
hevc_debug_enter();
if (!ctx) {
hevc_err("no hevc context to run\n");
return -EINVAL;
}
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
dec = ctx->dec_priv;
if (!dec) {
hevc_err("no mfc decoder to run\n");
return -EINVAL;
}
cpb_buf_size = ALIGN(dec->src_buf_size, HEVC_NV12M_HALIGN);
hevc_debug(2, "inst_no: %d, buf_addr: 0x%x\n", ctx->inst_no, buf_addr);
hevc_debug(2, "strm_size: 0x%08x cpb_buf_size: 0x%x\n",
strm_size, cpb_buf_size);
WRITEL(strm_size, <API key>);
WRITEL(buf_addr, <API key>);
WRITEL(cpb_buf_size, <API key>);
WRITEL(start_num_byte, <API key>);
hevc_debug_leave();
return 0;
}
/* Set display buffer through shared memory at INIT_BUFFER */
int <API key>(struct hevc_ctx *ctx, struct list_head *buf_queue)
{
struct hevc_dev *dev = ctx->dev;
int i;
for (i = 0; i < ctx->raw_buf.num_planes; i++) {
WRITEL(ctx->raw_buf.stride[i],
<API key> + (i * 4));
hevc_debug(2, "# plane%d.size = %d, stride = %d\n", i,
ctx->raw_buf.plane_size[i], ctx->raw_buf.stride[i]);
}
return 0;
}
/* Set decoding frame buffer */
int <API key>(struct hevc_ctx *ctx)
{
struct hevc_dev *dev;
struct hevc_dec *dec;
unsigned int i, frame_size_mv;
size_t buf_addr1;
int buf_size1;
int align_gap;
struct hevc_buf *buf;
struct hevc_raw_info *raw;
struct list_head *buf_queue;
unsigned char *dpb_vir;
int j;
if (!ctx) {
hevc_err("no hevc context to run\n");
return -EINVAL;
}
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
dec = ctx->dec_priv;
if (!dec) {
hevc_err("no hevc decoder to run\n");
return -EINVAL;
}
raw = &ctx->raw_buf;
buf_addr1 = ctx->port_a_phys;
buf_size1 = ctx->port_a_size;
hevc_debug(2, "Buf1: %p (%d)\n", (void *)buf_addr1, buf_size1);
hevc_info("Total DPB COUNT: %d\n", dec->total_dpb_count);
hevc_debug(2, "Setting display delay to %d\n", dec->display_delay);
hevc_debug(2, "ctx->scratch_buf_size %d\n", ctx->scratch_buf_size);
WRITEL(dec->total_dpb_count, HEVC_D_NUM_DPB);
hevc_debug(2, "raw->num_planes %d\n", raw->num_planes);
for (i = 0; i < raw->num_planes; i++) {
hevc_debug(2, "raw->plane_size[%d]= %d\n", i, raw->plane_size[i]);
WRITEL(raw->plane_size[i], <API key> + i*4);
}
if (dec->is_dynamic_dpb)
WRITEL((0x1 << <API key>), <API key>);
WRITEL(buf_addr1, <API key>);
WRITEL(ctx->scratch_buf_size, <API key>);
buf_addr1 += ctx->scratch_buf_size;
buf_size1 -= ctx->scratch_buf_size;
WRITEL(ctx->mv_size, <API key>);
frame_size_mv = ctx->mv_size;
hevc_debug(2, "Frame size: %d, %d, %d, mv: %d\n",
raw->plane_size[0], raw->plane_size[1],
raw->plane_size[2], frame_size_mv);
if (dec->dst_memtype == V4L2_MEMORY_USERPTR || dec->dst_memtype == V4L2_MEMORY_DMABUF)
buf_queue = &ctx->dst_queue;
else
buf_queue = &dec->dpb_queue;
i = 0;
list_for_each_entry(buf, buf_queue, list) {
/* Do not setting DPB */
if (dec->is_dynamic_dpb)
break;
for (j = 0; j < raw->num_planes; j++) {
hevc_debug(2, "buf->planes.raw[%d] = 0x%x\n", j, buf->planes.raw[j]);
WRITEL(buf->planes.raw[j], <API key> + (j*0x100 + i*4));
}
if ((i == 0) && (!ctx->is_drm)) {
int j, color[3] = { 0x0, 0x80, 0x80 };
for (j = 0; j < raw->num_planes; j++) {
dpb_vir = vb2_plane_vaddr(&buf->vb, j);
if (dpb_vir)
memset(dpb_vir, color[j],
raw->plane_size[j]);
}
hevc_mem_clean_vb(&buf->vb, j);
}
i++;
}
<API key>(ctx, buf_queue);
WRITEL(dec->mv_count, HEVC_D_NUM_MV);
for (i = 0; i < dec->mv_count; i++) {
/* To test alignment */
align_gap = buf_addr1;
buf_addr1 = ALIGN(buf_addr1, 16);
align_gap = buf_addr1 - align_gap;
buf_size1 -= align_gap;
hevc_debug(2, "\tBuf1: %x, size: %d\n", buf_addr1, buf_size1);
WRITEL(buf_addr1, HEVC_D_MV_BUFFER0 + i * 4);
buf_addr1 += frame_size_mv;
buf_size1 -= frame_size_mv;
}
hevc_debug(2, "Buf1: %u, buf_size1: %d (frames %d)\n",
buf_addr1, buf_size1, dec->total_dpb_count);
if (buf_size1 < 0) {
hevc_debug(2, "Not enough memory has been allocated.\n");
return -ENOMEM;
}
WRITEL(ctx->inst_no, HEVC_INSTANCE_ID);
hevc_cmd_host2risc(HEVC_CH_INIT_BUFS, NULL);
hevc_debug(2, "After setting buffers.\n");
return 0;
}
/* Initialize decoding */
int hevc_init_decode(struct hevc_ctx *ctx)
{
struct hevc_dev *dev;
struct hevc_dec *dec;
unsigned int reg = 0, pix_val;
int fmo_aso_ctrl = 0;
hevc_debug_enter();
if (!ctx) {
hevc_err("no hevc context to run\n");
return -EINVAL;
}
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
dec = ctx->dec_priv;
if (!dec) {
hevc_err("no hevc decoder to run\n");
return -EINVAL;
}
hevc_debug(2, "InstNo: %d/%d\n", ctx->inst_no, HEVC_CH_SEQ_HEADER);
hevc_debug(2, "BUFs: %08x %08x %08x\n",
READL(<API key>),
READL(<API key>),
READL(<API key>));
reg |= (dec->idr_decoding << <API key>);
/* FMO_ASO_CTRL - 0: Enable, 1: Disable */
reg |= (fmo_aso_ctrl << <API key>);
/* When user sets desplay_delay to 0,
* It works as "display_delay enable" and delay set to 0.
* If user wants display_delay disable, It should be
* set to negative value. */
if (dec->display_delay >= 0) {
reg |= (0x1 << <API key>);
WRITEL(dec->display_delay, <API key>);
}
if (ctx->dst_fmt->fourcc == <API key>)
reg |= (0x1 << <API key>);
hevc_debug(2, "HEVC_D_DEC_OPTIONS : 0x%x\n", reg);
WRITEL(0x20, HEVC_D_DEC_OPTIONS);
switch (ctx->dst_fmt->fourcc) {
case V4L2_PIX_FMT_NV12M:
case <API key>:
pix_val = 0;
break;
case V4L2_PIX_FMT_NV21M:
pix_val = 1;
break;
case <API key>:
pix_val = 2;
break;
case <API key>:
pix_val = 3;
break;
default:
pix_val = 0;
break;
}
hevc_debug(2, "pixel format: %d\n", pix_val);
WRITEL(pix_val, HEVC_PIXEL_FORMAT);
/* sei parse */
reg = dec->sei_parse;
hevc_debug(2, "sei parse: %d\n", dec->sei_parse);
/* Enable realloc interface if SEI is enabled */
if (dec->sei_parse)
reg |= (0x1 << <API key>);
WRITEL(reg, HEVC_D_SEI_ENABLE);
WRITEL(ctx->inst_no, HEVC_INSTANCE_ID);
WRITEL(0xffffffff, <API key>);
WRITEL(0xffffffff, <API key>);
hevc_cmd_host2risc(HEVC_CH_SEQ_HEADER, NULL);
hevc_debug_leave();
return 0;
}
/* Decode a single frame */
int <API key>(struct hevc_ctx *ctx, int last_frame)
{
struct hevc_dev *dev;
struct hevc_dec *dec;
if (!ctx) {
hevc_err("no hevc context to run\n");
return -EINVAL;
}
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
dec = ctx->dec_priv;
if (!dec) {
hevc_err("no hevc decoder to run\n");
return -EINVAL;
}
hevc_debug(2, "Setting flags to %08lx (free:%d WTF:%d)\n",
dec->dpb_status, ctx->dst_queue_cnt,
dec->dpb_queue_cnt);
if (dec->is_dynamic_dpb) {
hevc_debug(2, "Dynamic:0x%08x, Available:0x%08lx\n",
dec->dynamic_set, dec->dpb_status);
WRITEL(dec->dynamic_set, <API key>);
WRITEL(0x0, <API key>);
}
WRITEL(dec->dpb_status, <API key>);
WRITEL(0x0, <API key>);
WRITEL(dec->slice_enable, <API key>);
hevc_debug(2, "dec->slice_enable : %d\n", dec->slice_enable);
hevc_debug(2, "inst_no : %d last_frame : %d\n", ctx->inst_no, last_frame);
WRITEL(ctx->inst_no, HEVC_INSTANCE_ID);
/* Issue different commands to instance basing on whether it
* is the last frame or not. */
switch (last_frame) {
case 0:
hevc_cmd_host2risc(HEVC_CH_FRAME_START, NULL);
break;
case 1:
hevc_cmd_host2risc(HEVC_CH_LAST_FRAME, NULL);
break;
}
hevc_debug(2, "Decoding a usual frame.\n");
return 0;
}
static inline int hevc_get_new_ctx(struct hevc_dev *dev)
{
int new_ctx;
int cnt;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
hevc_debug(2, "Previous context: %d (bits %08lx)\n", dev->curr_ctx,
dev->ctx_work_bits);
if (dev->preempt_ctx > <API key>)
return dev->preempt_ctx;
else
new_ctx = (dev->curr_ctx + 1) % HEVC_NUM_CONTEXTS;
cnt = 0;
while (!test_bit(new_ctx, &dev->ctx_work_bits)) {
new_ctx = (new_ctx + 1) % HEVC_NUM_CONTEXTS;
cnt++;
if (cnt > HEVC_NUM_CONTEXTS) {
/* No contexts to run */
return -EAGAIN;
}
}
return new_ctx;
}
static int <API key>(struct hevc_ctx *ctx, struct hevc_buf *dst_vb)
{
struct hevc_dev *dev = ctx->dev;
struct hevc_dec *dec = ctx->dec_priv;
struct hevc_raw_info *raw = &ctx->raw_buf;
int dst_index;
int i;
dst_index = dst_vb->vb.v4l2_buf.index;
dec->dynamic_set = 1 << dst_index;
dst_vb->used = 1;
set_bit(dst_index, &dec->dpb_status);
hevc_debug(2, "ADDING Flag after: %lx\n", dec->dpb_status);
hevc_debug(2, "Dst addr [%d] = 0x%x\n", dst_index,
dst_vb->planes.raw[0]);
for (i = 0; i < raw->num_planes; i++) {
WRITEL(raw->plane_size[i], <API key> + i*4);
WRITEL(dst_vb->planes.raw[i],
<API key> + (i*0x100 + dst_index*4));
}
return 0;
}
static inline int <API key>(struct hevc_ctx *ctx)
{
struct hevc_dev *dev;
struct hevc_buf *temp_vb, *dst_vb;
struct hevc_dec *dec;
unsigned long flags;
if (!ctx) {
hevc_err("no hevc context to run\n");
return -EINVAL;
}
dec = ctx->dec_priv;
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
spin_lock_irqsave(&dev->irqlock, flags);
if ((dec->is_dynamic_dpb) && (ctx->dst_queue_cnt == 0)) {
hevc_debug(2, "No dst buffer\n");
<API key>(&dev->irqlock, flags);
return -EAGAIN;
}
/* Frames are being decoded */
if (list_empty(&ctx->src_queue)) {
hevc_debug(2, "No src buffers.\n");
<API key>(ctx, 0, 0, 0);
} else {
/* Get the next source buffer */
temp_vb = list_entry(ctx->src_queue.next,
struct hevc_buf, list);
temp_vb->used = 1;
<API key>(ctx,
hevc_mem_plane_addr(ctx, &temp_vb->vb, 0), 0, 0);
}
if (dec->is_dynamic_dpb) {
dst_vb = list_entry(ctx->dst_queue.next,
struct hevc_buf, list);
<API key>(ctx, dst_vb);
}
<API key>(&dev->irqlock, flags);
dev->curr_ctx = ctx->num;
<API key>(ctx);
<API key>(ctx, 1);
return 0;
}
static inline int hevc_run_dec_frame(struct hevc_ctx *ctx)
{
struct hevc_dev *dev;
struct hevc_buf *temp_vb, *dst_vb;
struct hevc_dec *dec;
unsigned long flags;
int last_frame = 0;
unsigned int index;
if (!ctx) {
hevc_err("no hevc context to run\n");
return -EINVAL;
}
dec = ctx->dec_priv;
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
spin_lock_irqsave(&dev->irqlock, flags);
/* Frames are being decoded */
if (list_empty(&ctx->src_queue)) {
hevc_debug(2, "No src buffers.\n");
<API key>(&dev->irqlock, flags);
return -EAGAIN;
}
if ((dec->is_dynamic_dpb && ctx->dst_queue_cnt == 0) ||
(!dec->is_dynamic_dpb && ctx->dst_queue_cnt < ctx->dpb_count)) {
<API key>(&dev->irqlock, flags);
return -EAGAIN;
}
/* Get the next source buffer */
temp_vb = list_entry(ctx->src_queue.next, struct hevc_buf, list);
temp_vb->used = 1;
hevc_debug(2, "Temp vb: %p\n", temp_vb);
hevc_debug(2, "Src Addr: 0x%08lx\n",
(unsigned long)hevc_mem_plane_addr(ctx, &temp_vb->vb, 0));
<API key>(ctx,
hevc_mem_plane_addr(ctx, &temp_vb->vb, 0),
dec->src_offset, temp_vb->vb.v4l2_planes[0].bytesused);
index = temp_vb->vb.v4l2_buf.index;
if (call_cop(ctx, set_buf_ctrls_val, ctx, &ctx->src_ctrls[index]) < 0)
hevc_err("failed in set_buf_ctrls_val\n");
if (dec->is_dynamic_dpb) {
dst_vb = list_entry(ctx->dst_queue.next,
struct hevc_buf, list);
<API key>(ctx, dst_vb);
}
<API key>(&dev->irqlock, flags);
dev->curr_ctx = ctx->num;
<API key>(ctx);
if (temp_vb->vb.v4l2_planes[0].bytesused == 0 ||
temp_vb->vb.v4l2_buf.reserved2 == FLAG_LAST_FRAME) {
last_frame = 1;
hevc_debug(2, "Setting ctx->state to FINISHING\n");
ctx->state = HEVCINST_FINISHING;
}
<API key>(ctx, last_frame);
return 0;
}
static inline void hevc_run_init_dec(struct hevc_ctx *ctx)
{
struct hevc_dev *dev;
struct hevc_dec *dec;
unsigned long flags;
struct hevc_buf *temp_vb;
if (!ctx) {
hevc_err("no hevc context to run\n");
return;
}
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return;
}
dec = ctx->dec_priv;
/* Initializing decoding - parsing header */
spin_lock_irqsave(&dev->irqlock, flags);
hevc_info("Preparing to init decoding.\n");
temp_vb = list_entry(ctx->src_queue.next, struct hevc_buf, list);
hevc_info("Header size: %d\n", temp_vb->vb.v4l2_planes[0].bytesused);
<API key>(ctx,
hevc_mem_plane_addr(ctx, &temp_vb->vb, 0),
dec->src_offset, temp_vb->vb.v4l2_planes[0].bytesused);
<API key>(&dev->irqlock, flags);
dev->curr_ctx = ctx->num;
hevc_debug(2, "Header addr: 0x%08lx\n",
(unsigned long)hevc_mem_plane_addr(ctx, &temp_vb->vb, 0));
<API key>(ctx);
hevc_init_decode(ctx);
}
static inline int <API key>(struct hevc_ctx *ctx)
{
struct hevc_dev *dev;
struct hevc_dec *dec;
int ret;
if (!ctx) {
hevc_err("no hevc context to run\n");
return -EINVAL;
}
dec = ctx->dec_priv;
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
/* Initializing decoding - parsing header */
/* Header was parsed now starting processing
* First set the output frame buffers
* <API key>(ctx); */
if (!dec->is_dynamic_dpb && (ctx->capture_state != QUEUE_BUFS_MMAPED)) {
hevc_err("It seems that not all destionation buffers were "
"mmaped.\nHEVC requires that all destination are mmaped "
"before starting processing.\n");
return -EAGAIN;
}
dev->curr_ctx = ctx->num;
<API key>(ctx);
ret = <API key>(ctx);
if (ret) {
hevc_err("Failed to alloc frame mem.\n");
ctx->state = HEVCINST_ERROR;
}
return ret;
}
static inline int hevc_abort_inst(struct hevc_ctx *ctx)
{
struct hevc_dev *dev;
if (!ctx) {
hevc_err("no hevc context to run\n");
return -EINVAL;
}
dev = ctx->dev;
if (!dev) {
hevc_err("no hevc device to run\n");
return -EINVAL;
}
dev->curr_ctx = ctx->num;
<API key>(ctx);
WRITEL(ctx->inst_no, HEVC_INSTANCE_ID);
hevc_cmd_host2risc(HEVC_CH_NAL_ABORT, NULL);
return 0;
}
static inline int hevc_dec_dpb_flush(struct hevc_ctx *ctx)
{
struct hevc_dev *dev = ctx->dev;
dev->curr_ctx = ctx->num;
<API key>(ctx);
WRITEL(ctx->inst_no, HEVC_INSTANCE_ID);
hevc_cmd_host2risc(HEVC_H2R_CMD_FLUSH, NULL);
return 0;
}
static inline int hevc_ctx_ready(struct hevc_ctx *ctx)
{
if (ctx->type == HEVCINST_DECODER)
return hevc_dec_ctx_ready(ctx);
return 0;
}
/* Try running an operation on hardware */
void hevc_try_run(struct hevc_dev *dev)
{
struct hevc_ctx *ctx;
int new_ctx;
unsigned int ret = 0;
hevc_debug(1, "Try run dev: %p\n", dev);
if (!dev) {
hevc_err("no hevc device to run\n");
return;
}
spin_lock_irq(&dev->condlock);
/* Check whether hardware is not running */
if (dev->hw_lock != 0) {
spin_unlock_irq(&dev->condlock);
/* This is perfectly ok, the scheduled ctx should wait */
hevc_debug(1, "Couldn't lock HW.\n");
return;
}
/* Choose the context to run */
new_ctx = hevc_get_new_ctx(dev);
if (new_ctx < 0) {
/* No contexts to run */
spin_unlock_irq(&dev->condlock);
hevc_debug(1, "No ctx is scheduled to be run.\n");
return;
}
ctx = dev->ctx[new_ctx];
if (!ctx) {
spin_unlock_irq(&dev->condlock);
hevc_err("no hevc context to run\n");
return;
}
if (test_and_set_bit(ctx->num, &dev->hw_lock) != 0) {
spin_unlock_irq(&dev->condlock);
hevc_err("Failed to lock hardware.\n");
return;
}
spin_unlock_irq(&dev->condlock);
hevc_debug(1, "New context: %d\n", new_ctx);
hevc_debug(1, "Seting new context to %p\n", ctx);
/* Got context to run in ctx */
hevc_debug(1, "ctx->dst_queue_cnt=%d ctx->dpb_count=%d ctx->src_queue_cnt=%d\n",
ctx->dst_queue_cnt, ctx->dpb_count, ctx->src_queue_cnt);
hevc_debug(1, "ctx->state=%d\n", ctx->state);
/* Last frame has already been sent to HEVC
* Now obtaining frames from HEVC buffer */
dev->curr_ctx_drm = ctx->is_drm;
hevc_clock_on();
if (ctx->type == HEVCINST_DECODER) {
switch (ctx->state) {
case HEVCINST_FINISHING:
ret = <API key>(ctx);
break;
case HEVCINST_RUNNING:
ret = hevc_run_dec_frame(ctx);
break;
case HEVCINST_INIT:
ret = hevc_open_inst(ctx);
break;
case <API key>:
ret = hevc_close_inst(ctx);
break;
case HEVCINST_GOT_INST:
hevc_run_init_dec(ctx);
break;
case <API key>:
ret = <API key>(ctx);
break;
case <API key>:
ret = <API key>(ctx);
break;
case <API key>:
ret = <API key>(ctx);
break;
case <API key>:
hevc_debug(2, "Finished remaining frames after resolution change.\n");
ctx->capture_state = QUEUE_FREE;
hevc_debug(2, "Will re-init the codec`.\n");
hevc_run_init_dec(ctx);
break;
case <API key>:
ret = hevc_dec_dpb_flush(ctx);
break;
default:
ret = -EAGAIN;
}
} else {
hevc_err("invalid context type: %d\n", ctx->type);
ret = -EAGAIN;
}
if (ret) {
/* Check again the ctx condition and clear work bits
* if ctx is not available. */
if (hevc_ctx_ready(ctx) == 0) {
spin_lock_irq(&dev->condlock);
clear_bit(ctx->num, &dev->ctx_work_bits);
spin_unlock_irq(&dev->condlock);
}
/* Free hardware lock */
if (hevc_clear_hw_bit(ctx) == 0)
hevc_err("Failed to unlock hardware.\n");
hevc_clock_off();
/* Trigger again if other instance's work is waiting */
spin_lock_irq(&dev->condlock);
if (dev->ctx_work_bits)
queue_work(dev->sched_wq, &dev->sched_work);
spin_unlock_irq(&dev->condlock);
}
}
void hevc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq)
{
struct hevc_buf *b;
int i;
while (!list_empty(lh)) {
b = list_entry(lh->next, struct hevc_buf, list);
for (i = 0; i < b->vb.num_planes; i++)
<API key>(&b->vb, i, 0);
vb2_buffer_done(&b->vb, VB2_BUF_STATE_ERROR);
list_del(&b->list);
}
}
void hevc_write_info(struct hevc_ctx *ctx, unsigned int data, unsigned int ofs)
{
struct hevc_dev *dev = ctx->dev;
if (dev->hw_lock) {
WRITEL(data, ofs);
} else {
hevc_clock_on();
WRITEL(data, ofs);
hevc_clock_off();
}
}
unsigned int hevc_read_info(struct hevc_ctx *ctx, unsigned int ofs)
{
struct hevc_dev *dev = ctx->dev;
int ret;
if (dev->hw_lock) {
ret = READL(ofs);
} else {
hevc_clock_on();
ret = READL(ofs);
hevc_clock_off();
}
return ret;
}
|
package com.badlogic.gdx.physics.bullet.linearmath;
import com.badlogic.gdx.physics.bullet.BulletBase;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Matrix3;
import com.badlogic.gdx.math.Matrix4;
public class <API key> extends BulletBase {
private long swigCPtr;
protected <API key>(final String className, long cPtr, boolean cMemoryOwn) {
super(className, cPtr, cMemoryOwn);
swigCPtr = cPtr;
}
/** Construct a new <API key>, normally you should not need this constructor it's intended for low-level usage. */
public <API key>(long cPtr, boolean cMemoryOwn) {
this("<API key>", cPtr, cMemoryOwn);
construct();
}
@Override
protected void reset(long cPtr, boolean cMemoryOwn) {
if (!destroyed)
destroy();
super.reset(swigCPtr = cPtr, cMemoryOwn);
}
public static long getCPtr(<API key> obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
@Override
protected void finalize() throws Throwable {
if (!destroyed)
destroy();
super.finalize();
}
@Override protected synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
LinearMathJNI.<API key>(swigCPtr);
}
swigCPtr = 0;
}
super.delete();
}
static public class Edge extends BulletBase {
private long swigCPtr;
protected Edge(final String className, long cPtr, boolean cMemoryOwn) {
super(className, cPtr, cMemoryOwn);
swigCPtr = cPtr;
}
/** Construct a new Edge, normally you should not need this constructor it's intended for low-level usage. */
public Edge(long cPtr, boolean cMemoryOwn) {
this("Edge", cPtr, cMemoryOwn);
construct();
}
@Override
protected void reset(long cPtr, boolean cMemoryOwn) {
if (!destroyed)
destroy();
super.reset(swigCPtr = cPtr, cMemoryOwn);
}
public static long getCPtr(Edge obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
@Override
protected void finalize() throws Throwable {
if (!destroyed)
destroy();
super.finalize();
}
@Override protected synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
LinearMathJNI.<API key>(swigCPtr);
}
swigCPtr = 0;
}
super.delete();
}
public int getSourceVertex() {
return LinearMathJNI.<API key>(swigCPtr, this);
}
public int getTargetVertex() {
return LinearMathJNI.<API key>(swigCPtr, this);
}
public <API key>.Edge getNextEdgeOfVertex() {
long cPtr = LinearMathJNI.<API key>(swigCPtr, this);
return (cPtr == 0) ? null : new <API key>.Edge(cPtr, false);
}
public <API key>.Edge getNextEdgeOfFace() {
long cPtr = LinearMathJNI.<API key>(swigCPtr, this);
return (cPtr == 0) ? null : new <API key>.Edge(cPtr, false);
}
public <API key>.Edge getReverseEdge() {
long cPtr = LinearMathJNI.<API key>(swigCPtr, this);
return (cPtr == 0) ? null : new <API key>.Edge(cPtr, false);
}
public Edge() {
this(LinearMathJNI.<API key>(), true);
}
}
public void setVertices(btVector3Array value) {
LinearMathJNI.<API key>(swigCPtr, this, btVector3Array.getCPtr(value), value);
}
public btVector3Array getVertices() {
long cPtr = LinearMathJNI.<API key>(swigCPtr, this);
return (cPtr == 0) ? null : new btVector3Array(cPtr, false);
}
public void setEdges(<API key> value) {
LinearMathJNI.<API key>(swigCPtr, this, <API key>.getCPtr(value));
}
public <API key> getEdges() {
long cPtr = LinearMathJNI.<API key>(swigCPtr, this);
return (cPtr == 0) ? null : new <API key>(cPtr, false);
}
public void setFaces(<API key> value) {
LinearMathJNI.<API key>(swigCPtr, this, <API key>.getCPtr(value));
}
public <API key> getFaces() {
long cPtr = LinearMathJNI.<API key>(swigCPtr, this);
return (cPtr == 0) ? null : new <API key>(cPtr, false);
}
public float compute(java.nio.FloatBuffer coords, int stride, int count, float shrink, float shrinkClamp) {
assert coords.isDirect() : "Buffer must be allocated direct.";
{
return LinearMathJNI.<API key>(swigCPtr, this, coords, stride, count, shrink, shrinkClamp);
}
}
public float compute(java.nio.DoubleBuffer coords, int stride, int count, float shrink, float shrinkClamp) {
assert coords.isDirect() : "Buffer must be allocated direct.";
{
return LinearMathJNI.<API key>(swigCPtr, this, coords, stride, count, shrink, shrinkClamp);
}
}
public <API key>() {
this(LinearMathJNI.<API key>(), true);
}
}
|
#include "tools/<API key>/test/simple_api.h"
#include "testing/gtest/include/gtest/gtest.h"
using namespace test::api::simple_api;
namespace {
static scoped_ptr<base::DictionaryValue> <API key>() {
scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
value-><API key>("number", new base::FundamentalValue(1.1));
value-><API key>("integer", new base::FundamentalValue(4));
value-><API key>("string", new base::StringValue("bling"));
value-><API key>("boolean", new base::FundamentalValue(true));
return value.Pass();
}
} // namespace
TEST(<API key>, <API key>) {
scoped_ptr<base::ListValue> results = IncrementInteger::Results::Create(5);
base::ListValue expected;
expected.Append(new base::FundamentalValue(5));
EXPECT_TRUE(results->Equals(&expected));
}
TEST(<API key>, <API key>) {
scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(new base::FundamentalValue(6));
scoped_ptr<IncrementInteger::Params> params(
IncrementInteger::Params::Create(*params_value));
EXPECT_TRUE(params.get());
EXPECT_EQ(6, params->num);
}
TEST(<API key>, NumberOfParams) {
{
scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(new base::StringValue("text"));
params_value->Append(new base::StringValue("text"));
scoped_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_FALSE(params.get());
}
{
scoped_ptr<base::ListValue> params_value(new base::ListValue());
scoped_ptr<IncrementInteger::Params> params(
IncrementInteger::Params::Create(*params_value));
EXPECT_FALSE(params.get());
}
}
TEST(<API key>, <API key>) {
{
scoped_ptr<base::ListValue> params_value(new base::ListValue());
scoped_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_TRUE(params.get());
EXPECT_FALSE(params->str.get());
}
{
scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(new base::StringValue("asdf"));
scoped_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_TRUE(params.get());
EXPECT_TRUE(params->str.get());
EXPECT_EQ("asdf", *params->str);
}
}
TEST(<API key>, <API key>) {
{
scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(base::Value::CreateNullValue());
scoped_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_TRUE(params.get());
EXPECT_FALSE(params->str.get());
}
}
TEST(<API key>, <API key>) {
{
scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(new base::FundamentalValue(5));
scoped_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_FALSE(params.get());
}
}
TEST(<API key>, <API key>) {
{
scoped_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(base::Value::CreateNullValue());
params_value->Append(new base::StringValue("asdf"));
scoped_ptr<<API key>::Params> params(
<API key>::Params::Create(*params_value));
EXPECT_TRUE(params.get());
EXPECT_FALSE(params->first.get());
EXPECT_EQ("asdf", params->second);
}
}
TEST(<API key>, <API key>) {
scoped_ptr<base::ListValue> results = OptionalString::Results::Create();
base::ListValue expected;
EXPECT_TRUE(results->Equals(&expected));
}
TEST(<API key>, TestTypePopulate) {
{
scoped_ptr<TestType> test_type(new TestType());
scoped_ptr<base::DictionaryValue> value = <API key>();
EXPECT_TRUE(TestType::Populate(*value, test_type.get()));
EXPECT_EQ("bling", test_type->string);
EXPECT_EQ(1.1, test_type->number);
EXPECT_EQ(4, test_type->integer);
EXPECT_EQ(true, test_type->boolean);
EXPECT_TRUE(value->Equals(test_type->ToValue().get()));
}
{
scoped_ptr<TestType> test_type(new TestType());
scoped_ptr<base::DictionaryValue> value = <API key>();
value->Remove("number", NULL);
EXPECT_FALSE(TestType::Populate(*value, test_type.get()));
}
}
TEST(<API key>, GetTestType) {
{
scoped_ptr<base::DictionaryValue> value = <API key>();
scoped_ptr<TestType> test_type(new TestType());
EXPECT_TRUE(TestType::Populate(*value, test_type.get()));
scoped_ptr<base::ListValue> results =
GetTestType::Results::Create(*test_type);
base::DictionaryValue* result = NULL;
results->GetDictionary(0, &result);
EXPECT_TRUE(result->Equals(value.get()));
}
}
TEST(<API key>, <API key>) {
{
scoped_ptr<base::ListValue> results(OnIntegerFired::Create(5));
base::ListValue expected;
expected.Append(new base::FundamentalValue(5));
EXPECT_TRUE(results->Equals(&expected));
}
}
TEST(<API key>, OnStringFiredCreate) {
{
scoped_ptr<base::ListValue> results(OnStringFired::Create("yo dawg"));
base::ListValue expected;
expected.Append(new base::StringValue("yo dawg"));
EXPECT_TRUE(results->Equals(&expected));
}
}
TEST(<API key>, <API key>) {
{
TestType some_test_type;
scoped_ptr<base::DictionaryValue> expected = <API key>();
ASSERT_TRUE(expected->GetDouble("number", &some_test_type.number));
ASSERT_TRUE(expected->GetString("string", &some_test_type.string));
ASSERT_TRUE(expected->GetInteger("integer", &some_test_type.integer));
ASSERT_TRUE(expected->GetBoolean("boolean", &some_test_type.boolean));
scoped_ptr<base::ListValue> results(
OnTestTypeFired::Create(some_test_type));
base::DictionaryValue* result = NULL;
results->GetDictionary(0, &result);
EXPECT_TRUE(result->Equals(expected.get()));
}
}
|
// Use of this source code is governed by the Apache 2.0
package internal
// This file implements a network dialer that limits the number of concurrent connections.
// It is only used for API calls.
import (
"log"
"net"
"runtime"
"sync"
"time"
)
var limitSem = make(chan int, 100) // TODO(dsymonds): Use environment variable.
func limitRelease() {
// non-blocking
select {
case <-limitSem:
default:
// This should not normally happen.
log.Print("appengine: unbalanced limitSem release!")
}
}
func limitDial(network, addr string) (net.Conn, error) {
limitSem <- 1
// Dial with a timeout in case the API host is MIA.
// The connection should normally be very fast.
conn, err := net.DialTimeout(network, addr, 500*time.Millisecond)
if err != nil {
limitRelease()
return nil, err
}
lc := &limitConn{Conn: conn}
runtime.SetFinalizer(lc, (*limitConn).Close) // shouldn't usually be required
return lc, nil
}
type limitConn struct {
close sync.Once
net.Conn
}
func (lc *limitConn) Close() error {
defer lc.close.Do(func() {
limitRelease()
runtime.SetFinalizer(lc, nil)
})
return lc.Conn.Close()
}
|
<reference path="denodeify.d.ts" />
<reference path="../node/node.d.ts" />
import denodeify = require("denodeify");
import fs = require('fs');
import cp = require('child_process');
const readFile = denodeify<string,string,string>(fs.readFile);
const exec = denodeify<string,string>(cp.exec, (err, stdout, stderr) => [err, stdout]);
|
/* { dg-do compile } */
/* { <API key> ia32 } */
/* { <API key> fpic } */
/* { dg-skip-if "" { *-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-skip-if "No Windows PIC" { *-*-mingw* *-*-cygwin } { "*" } { "" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom -fPIC" } */
/* { dg-final { <API key> "nop" 8 } } */
/* { dg-final { scan-assembler-not "rep" } } */
extern int bar;
int
foo ()
{
asm volatile ("");
return bar;
}
|
package graph
import (
"strings"
"github.com/docker/docker/engine"
"github.com/docker/docker/image"
)
func (s *TagStore) CmdViz(job *engine.Job) engine.Status {
images, _ := s.graph.Map()
if images == nil {
return engine.StatusOK
}
job.Stdout.Write([]byte("digraph docker {\n"))
var (
parentImage *image.Image
err error
)
for _, image := range images {
parentImage, err = image.GetParent()
if err != nil {
return job.Errorf("Error while getting parent image: %v", err)
}
if parentImage != nil {
job.Stdout.Write([]byte(" \"" + parentImage.ID + "\" -> \"" + image.ID + "\"\n"))
} else {
job.Stdout.Write([]byte(" base -> \"" + image.ID + "\" [style=invis]\n"))
}
}
for id, repos := range s.GetRepoRefs() {
job.Stdout.Write([]byte(" \"" + id + "\" [label=\"" + id + "\\n" + strings.Join(repos, "\\n") + "\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n"))
}
job.Stdout.Write([]byte(" base [style=invisible]\n}\n"))
return engine.StatusOK
}
|
#include "PathOpsExtendedTest.h"
#include "<API key>.h"
static void testOpCubicsMain(PathOpsThreadState* data) {
#if <API key>
strncpy(<API key>, "", <API key>);
#endif
SkASSERT(data);
PathOpsThreadState& state = *data;
char pathStr[1024]; // gdb: set print elements 400
bool progress = state.fReporter->verbose(); // FIXME: break out into its own parameter?
if (progress) {
sk_bzero(pathStr, sizeof(pathStr));
}
for (int a = 0 ; a < 6; ++a) {
for (int b = a + 1 ; b < 7; ++b) {
for (int c = 0 ; c < 6; ++c) {
for (int d = c + 1 ; d < 7; ++d) {
for (int e = SkPath::kWinding_FillType ; e <= SkPath::kEvenOdd_FillType; ++e) {
for (int f = SkPath::kWinding_FillType ; f <= SkPath::kEvenOdd_FillType; ++f) {
SkPath pathA, pathB;
if (progress) {
char* str = pathStr;
str += sprintf(str, " path.setFillType(SkPath::k%s_FillType);\n",
e == SkPath::kWinding_FillType ? "Winding" : e == SkPath::kEvenOdd_FillType
? "EvenOdd" : "?UNDEFINED");
str += sprintf(str, " path.moveTo(%d,%d);\n", state.fA, state.fB);
str += sprintf(str, " path.cubicTo(%d,%d, %d,%d, %d,%d);\n", state.fC, state.fD,
b, a, d, c);
str += sprintf(str, " path.close();\n");
str += sprintf(str, " pathB.setFillType(SkPath::k%s_FillType);\n",
f == SkPath::kWinding_FillType ? "Winding" : f == SkPath::kEvenOdd_FillType
? "EvenOdd" : "?UNDEFINED");
str += sprintf(str, " pathB.moveTo(%d,%d);\n", a, b);
str += sprintf(str, " pathB.cubicTo(%d,%d, %d,%d, %d,%d);\n", c, d,
state.fB, state.fA, state.fD, state.fC);
str += sprintf(str, " pathB.close();\n");
}
pathA.setFillType((SkPath::FillType) e);
pathA.moveTo(SkIntToScalar(state.fA), SkIntToScalar(state.fB));
pathA.cubicTo(SkIntToScalar(state.fC), SkIntToScalar(state.fD), SkIntToScalar(b),
SkIntToScalar(a), SkIntToScalar(d), SkIntToScalar(c));
pathA.close();
pathB.setFillType((SkPath::FillType) f);
pathB.moveTo(SkIntToScalar(a), SkIntToScalar(b));
pathB.cubicTo(SkIntToScalar(c), SkIntToScalar(d), SkIntToScalar(state.fB),
SkIntToScalar(state.fA), SkIntToScalar(state.fD), SkIntToScalar(state.fC));
pathB.close();
for (int op = 0 ; op <= kXOR_PathOp; ++op) {
if (progress) {
outputProgress(state.fPathStr, pathStr, (SkPathOp) op);
}
testThreadedPathOp(state.fReporter, pathA, pathB, (SkPathOp) op, "cubics");
}
}
}
}
}
}
}
}
DEF_TEST(<API key>, reporter) {
int threadCount = initializeTests(reporter, "cubicOp");
<API key> testRunner(reporter, threadCount);
for (int a = 0; a < 6; ++a) { // outermost
for (int b = a + 1; b < 7; ++b) {
for (int c = 0 ; c < 6; ++c) {
for (int d = c + 1; d < 7; ++d) {
*testRunner.fRunnables.append() = SkNEW_ARGS(<API key>,
(&testOpCubicsMain, a, b, c, d, &testRunner));
}
}
if (!reporter->allowExtendedTest()) goto finish;
}
}
finish:
testRunner.render();
ShowTestArray();
}
|
.foo > .bar, .foo > .bip + .baz {
a: b; }
|
import * as angular from 'angular';
angular
.module('app', ['<API key>'])
.config(['<API key>', (<API key>: angular.desktopNotification.<API key>) => {
<API key>.config({
autoClose: true,
duration: 5,
showOnPageHidden: false,
});
}])
.controller('AppController', ['desktopNotification', (desktopNotification: angular.desktopNotification.<API key>) => {
const <API key> = desktopNotification.isSupported();
const <API key> = desktopNotification.currentPermission();
if (<API key> === desktopNotification.permissions.granted) {
}
desktopNotification.requestPermission().then(
(permission) => {
// Show notification
desktopNotification.show(
"Notification title",
{
tag: "tag",
body: "Notification body",
icon: "https:
onClick: () => {
// Notification clicked
}
});
},
() => {
});
}]);
|
/* <API key>: GPL-2.0 */
#ifndef __STA_INFO_H_
#define __STA_INFO_H_
#include "osdep_service.h"
#include "drv_types.h"
#include "wifi.h"
#define NUM_STA 32
#define NUM_ACL 64
/* if mode ==0, then the sta is allowed once the addr is hit.
* if mode ==1, then the sta is rejected once the addr is non-hit.
*/
struct wlan_acl_node {
struct list_head list;
u8 addr[ETH_ALEN];
u8 mode;
};
struct wlan_acl_pool {
struct wlan_acl_node aclnode[NUM_ACL];
};
struct stainfo_stats {
uint rx_pkts;
uint rx_bytes;
u64 tx_pkts;
uint tx_bytes;
};
struct sta_info {
spinlock_t lock;
struct list_head list; /*free_sta_queue*/
struct list_head hash_list; /*sta_hash*/
struct sta_xmit_priv sta_xmitpriv;
struct sta_recv_priv sta_recvpriv;
uint state;
uint aid;
uint mac_id;
uint qos_option;
u8 hwaddr[ETH_ALEN];
uint ieee8021x_blocked; /*0: allowed, 1:blocked */
uint XPrivacy; /*aes, tkip...*/
union Keytype tkiptxmickey;
union Keytype tkiprxmickey;
union Keytype x_UncstKey;
union pn48 txpn; /* PN48 used for Unicast xmit.*/
union pn48 rxpn; /* PN48 used for Unicast recv.*/
u8 bssrateset[16];
uint bssratelen;
s32 rssi;
s32 signal_quality;
struct stainfo_stats sta_stats;
/*for A-MPDU Rx reordering buffer control */
struct recv_reorder_ctrl recvreorder_ctrl[16];
struct ht_priv htpriv;
/* Notes:
* STA_Mode:
* curr_network(mlme_priv/security_priv/qos/ht)
* + sta_info: (STA & AP) CAP/INFO
* scan_q: AP CAP/INFO
* AP_Mode:
* curr_network(mlme_priv/security_priv/qos/ht) : AP CAP/INFO
* sta_info: (AP & STA) CAP/INFO
*/
struct list_head asoc_list;
struct list_head auth_list;
unsigned int expire_to;
unsigned int auth_seq;
unsigned int authalg;
unsigned char chg_txt[128];
unsigned int tx_ra_bitmap;
};
struct sta_priv {
u8 *<API key>;
u8 *pstainfo_buf;
struct __queue free_sta_queue;
spinlock_t sta_hash_lock;
struct list_head sta_hash[NUM_STA];
int asoc_sta_count;
struct __queue sleep_q;
struct __queue wakeup_q;
struct _adapter *padapter;
struct list_head asoc_list;
struct list_head auth_list;
unsigned int auth_to; /* sec, time to expire in authenticating. */
unsigned int assoc_to; /* sec, time to expire before associating. */
unsigned int expire_to; /* sec , time to expire after associated. */
};
static inline u32 wifi_mac_hash(u8 *mac)
{
u32 x;
x = mac[0];
x = (x << 2) ^ mac[1];
x = (x << 2) ^ mac[2];
x = (x << 2) ^ mac[3];
x = (x << 2) ^ mac[4];
x = (x << 2) ^ mac[5];
x ^= x >> 8;
x = x & (NUM_STA - 1);
return x;
}
int <API key>(struct sta_priv *pstapriv);
void <API key>(struct sta_priv *pstapriv);
struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv,
u8 *hwaddr);
void r8712_free_stainfo(struct _adapter *padapter, struct sta_info *psta);
void <API key>(struct _adapter *padapter);
struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr);
void <API key>(struct _adapter *padapter);
struct sta_info *<API key>(struct _adapter *padapter);
u8 r8712_access_ctrl(struct wlan_acl_pool *pacl_list, u8 *mac_addr);
#endif /* _STA_INFO_H_ */
|
// Protocol Buffers - Google's data interchange format
// modification, are permitted provided that the following conditions are
// met:
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <Python.h>
#include <string>
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/pyext/descriptor.h>
#include <google/protobuf/pyext/scoped_pyobject_ptr.h>
#define C(str) const_cast<char*>(str)
#if PY_MAJOR_VERSION >= 3
#define <API key> <API key>
#define PyInt_FromLong PyLong_FromLong
#if PY_VERSION_HEX < 0x03030000
#error "Python 3.0 - 3.2 are not supported."
#else
#define PyString_AsString(ob) \
(PyUnicode_Check(ob)? PyUnicode_AsUTF8(ob): PyBytes_AS_STRING(ob))
#endif
#endif
namespace google {
namespace protobuf {
namespace python {
#ifndef <API key>
#define <API key>(type, size) PyObject_HEAD_INIT(type) size,
#endif
#ifndef Py_TYPE
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#endif
static google::protobuf::DescriptorPool* g_descriptor_pool = NULL;
namespace cfield_descriptor {
static void Dealloc(CFieldDescriptor* self) {
Py_CLEAR(self->descriptor_field);
Py_TYPE(self)->tp_free(reinterpret_cast<PyObject*>(self));
}
static PyObject* GetFullName(CFieldDescriptor* self, void *closure) {
return <API key>(
self->descriptor->full_name().c_str(),
self->descriptor->full_name().size());
}
static PyObject* GetName(CFieldDescriptor *self, void *closure) {
return <API key>(
self->descriptor->name().c_str(),
self->descriptor->name().size());
}
static PyObject* GetCppType(CFieldDescriptor *self, void *closure) {
return PyInt_FromLong(self->descriptor->cpp_type());
}
static PyObject* GetLabel(CFieldDescriptor *self, void *closure) {
return PyInt_FromLong(self->descriptor->label());
}
static PyObject* GetID(CFieldDescriptor *self, void *closure) {
return PyLong_FromVoidPtr(self);
}
static PyGetSetDef Getters[] = {
{ C("full_name"), (getter)GetFullName, NULL, "Full name", NULL},
{ C("name"), (getter)GetName, NULL, "last name", NULL},
{ C("cpp_type"), (getter)GetCppType, NULL, "C++ Type", NULL},
{ C("label"), (getter)GetLabel, NULL, "Label", NULL},
{ C("id"), (getter)GetID, NULL, "ID", NULL},
{NULL}
};
} // namespace cfield_descriptor
PyTypeObject <API key> = {
<API key>(&PyType_Type, 0)
C("google.protobuf.internal."
"<API key>."
"CFieldDescriptor"), // tp_name
sizeof(CFieldDescriptor), // tp_basicsize
0, // tp_itemsize
(destructor)cfield_descriptor::Dealloc, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr
0, // tp_compare
0, // tp_repr
0, // tp_as_number
0, // tp_as_sequence
0, // tp_as_mapping
0, // tp_hash
0, // tp_call
0, // tp_str
0, // tp_getattro
0, // tp_setattro
0, // tp_as_buffer
Py_TPFLAGS_DEFAULT, // tp_flags
C("A Field Descriptor"), // tp_doc
0, // tp_traverse
0, // tp_clear
0, // tp_richcompare
0, // tp_weaklistoffset
0, // tp_iter
0, // tp_iternext
0, // tp_methods
0, // tp_members
cfield_descriptor::Getters, // tp_getset
0, // tp_base
0, // tp_dict
0, // tp_descr_get
0, // tp_descr_set
0, // tp_dictoffset
0, // tp_init
PyType_GenericAlloc, // tp_alloc
PyType_GenericNew, // tp_new
PyObject_Del, // tp_free
};
namespace cdescriptor_pool {
static void Dealloc(CDescriptorPool* self) {
Py_TYPE(self)->tp_free(reinterpret_cast<PyObject*>(self));
}
static PyObject* NewCDescriptor(
const google::protobuf::FieldDescriptor* field_descriptor) {
CFieldDescriptor* cfield_descriptor = PyObject_New(
CFieldDescriptor, &<API key>);
if (cfield_descriptor == NULL) {
return NULL;
}
cfield_descriptor->descriptor = field_descriptor;
cfield_descriptor->descriptor_field = NULL;
return reinterpret_cast<PyObject*>(cfield_descriptor);
}
PyObject* FindFieldByName(CDescriptorPool* self, PyObject* name) {
const char* full_field_name = PyString_AsString(name);
if (full_field_name == NULL) {
return NULL;
}
const google::protobuf::FieldDescriptor* field_descriptor = NULL;
field_descriptor = self->pool->FindFieldByName(full_field_name);
if (field_descriptor == NULL) {
PyErr_Format(PyExc_TypeError, "Couldn't find field %.200s",
full_field_name);
return NULL;
}
return NewCDescriptor(field_descriptor);
}
PyObject* FindExtensionByName(CDescriptorPool* self, PyObject* arg) {
const char* full_field_name = PyString_AsString(arg);
if (full_field_name == NULL) {
return NULL;
}
const google::protobuf::FieldDescriptor* field_descriptor =
self->pool->FindExtensionByName(full_field_name);
if (field_descriptor == NULL) {
PyErr_Format(PyExc_TypeError, "Couldn't find field %.200s",
full_field_name);
return NULL;
}
return NewCDescriptor(field_descriptor);
}
static PyMethodDef Methods[] = {
{ C("FindFieldByName"),
(PyCFunction)FindFieldByName,
METH_O,
C("Searches for a field descriptor by full name.") },
{ C("FindExtensionByName"),
(PyCFunction)FindExtensionByName,
METH_O,
C("Searches for extension descriptor by full name.") },
{NULL}
};
} // namespace cdescriptor_pool
PyTypeObject <API key> = {
<API key>(&PyType_Type, 0)
C("google.protobuf.internal."
"<API key>."
"CFieldDescriptor"), // tp_name
sizeof(CDescriptorPool), // tp_basicsize
0, // tp_itemsize
(destructor)cdescriptor_pool::Dealloc, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr
0, // tp_compare
0, // tp_repr
0, // tp_as_number
0, // tp_as_sequence
0, // tp_as_mapping
0, // tp_hash
0, // tp_call
0, // tp_str
0, // tp_getattro
0, // tp_setattro
0, // tp_as_buffer
Py_TPFLAGS_DEFAULT, // tp_flags
C("A Descriptor Pool"), // tp_doc
0, // tp_traverse
0, // tp_clear
0, // tp_richcompare
0, // tp_weaklistoffset
0, // tp_iter
0, // tp_iternext
cdescriptor_pool::Methods, // tp_methods
0, // tp_members
0, // tp_getset
0, // tp_base
0, // tp_dict
0, // tp_descr_get
0, // tp_descr_set
0, // tp_dictoffset
0, // tp_init
PyType_GenericAlloc, // tp_alloc
PyType_GenericNew, // tp_new
PyObject_Del, // tp_free
};
google::protobuf::DescriptorPool* GetDescriptorPool() {
if (g_descriptor_pool == NULL) {
g_descriptor_pool = new google::protobuf::DescriptorPool(
google::protobuf::DescriptorPool::generated_pool());
}
return g_descriptor_pool;
}
PyObject* <API key>(PyObject* ignored, PyObject* args) {
CDescriptorPool* cdescriptor_pool = PyObject_New(
CDescriptorPool, &<API key>);
if (cdescriptor_pool == NULL) {
return NULL;
}
cdescriptor_pool->pool = GetDescriptorPool();
return reinterpret_cast<PyObject*>(cdescriptor_pool);
}
// Collects errors that occur during proto file building to allow them to be
// propagated in the python exception instead of only living in ERROR logs.
class <API key> : public google::protobuf::DescriptorPool::ErrorCollector {
public:
<API key>() : error_message(""), had_errors(false) {}
void AddError(const string& filename, const string& element_name,
const Message* descriptor, ErrorLocation location,
const string& message) {
// Replicates the logging behavior that happens in the C++ implementation
// when an error collector is not passed in.
if (!had_errors) {
error_message +=
("Invalid proto descriptor for file \"" + filename + "\":\n");
}
// As this only happens on failure and will result in the program not
// running at all, no effort is made to optimize this string manipulation.
error_message += (" " + element_name + ": " + message + "\n");
}
string error_message;
bool had_errors;
};
PyObject* Python_BuildFile(PyObject* ignored, PyObject* arg) {
char* message_type;
Py_ssize_t message_len;
if (<API key>(arg, &message_type, &message_len) < 0) {
return NULL;
}
google::protobuf::FileDescriptorProto file_proto;
if (!file_proto.ParseFromArray(message_type, message_len)) {
PyErr_SetString(PyExc_TypeError, "Couldn't parse file content!");
return NULL;
}
if (google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
file_proto.name()) != NULL) {
Py_RETURN_NONE;
}
<API key> error_collector;
const google::protobuf::FileDescriptor* descriptor =
GetDescriptorPool()-><API key>(file_proto,
&error_collector);
if (descriptor == NULL) {
PyErr_Format(PyExc_TypeError,
"Couldn't build proto file into descriptor pool!\n%s",
error_collector.error_message.c_str());
return NULL;
}
Py_RETURN_NONE;
}
bool InitDescriptor() {
<API key>.tp_new = PyType_GenericNew;
if (PyType_Ready(&<API key>) < 0)
return false;
<API key>.tp_new = PyType_GenericNew;
if (PyType_Ready(&<API key>) < 0)
return false;
return true;
}
} // namespace python
} // namespace protobuf
} // namespace google
|
using System;
using System.Collections;
using System.Collections.Generic;
using Xunit;
using <API key>.<API key>;
using <API key>;
namespace <API key>
{
public class <API key>
{
public class IntGenerator
{
private int _index;
public IntGenerator()
{
_index = 0;
}
public int NextValue()
{
return _index++;
}
public Object NextValueObject()
{
return (Object)NextValue();
}
}
public class StringGenerator
{
private int _index;
public StringGenerator()
{
_index = 0;
}
public String NextValue()
{
return (_index++).ToString();
}
public Object NextValueObject()
{
return (Object)NextValue();
}
}
[Fact]
public static void <API key>()
{
IntGenerator intGenerator = new IntGenerator();
StringGenerator stringGenerator = new StringGenerator();
intGenerator.NextValue();
stringGenerator.NextValue();
//Scenario 1: Vanilla - fill in an SortedDictionary with 10 keys and check this property
Driver<int, int> IntDriver = new Driver<int, int>();
Driver<SimpleRef<String>, SimpleRef<String>> simpleRef = new Driver<SimpleRef<String>, SimpleRef<String>>();
Driver<SimpleRef<int>, SimpleRef<int>> simpleVal = new Driver<SimpleRef<int>, SimpleRef<int>>();
int count = 1000;
SimpleRef<int>[] simpleInts = <API key>.GetSimpleInts(count);
SimpleRef<String>[] simpleStrings = <API key>.GetSimpleStrings(count);
int[] ints = new int[count];
for (int i = 0; i < count; i++)
ints[i] = i;
IntDriver.TestVanilla(ints, ints);
simpleRef.TestVanilla(simpleStrings, simpleStrings);
simpleVal.TestVanilla(simpleInts, simpleInts);
IntDriver.<API key>(ints, ints);
simpleRef.<API key>(simpleStrings, simpleStrings);
simpleVal.<API key>(simpleInts, simpleInts);
//Scenario 2: Check for an empty SortedDictionary
IntDriver.TestVanilla(new int[0], new int[0]);
simpleRef.TestVanilla(new SimpleRef<String>[0], new SimpleRef<String>[0]);
simpleVal.TestVanilla(new SimpleRef<int>[0], new SimpleRef<int>[0]);
IntDriver.<API key>(new int[0], new int[0]);
simpleRef.<API key>(new SimpleRef<String>[0], new SimpleRef<String>[0]);
simpleVal.<API key>(new SimpleRef<int>[0], new SimpleRef<int>[0]);
//Scenario 3: Check the underlying reference. Change the SortedDictionary afterwards and examine ICollection keys and make sure that the
//change is reflected
int half = count / 2;
SimpleRef<int>[] simpleInts_1 = new SimpleRef<int>[half];
SimpleRef<String>[] simpleStrings_1 = new SimpleRef<String>[half];
SimpleRef<int>[] simpleInts_2 = new SimpleRef<int>[half];
SimpleRef<String>[] simpleStrings_2 = new SimpleRef<String>[half];
int[] ints_1 = new int[half];
int[] ints_2 = new int[half];
for (int i = 0; i < half; i++)
{
simpleInts_1[i] = simpleInts[i];
simpleStrings_1[i] = simpleStrings[i];
ints_1[i] = ints[i];
simpleInts_2[i] = simpleInts[i + half];
simpleStrings_2[i] = simpleStrings[i + half];
ints_2[i] = ints[i + half];
}
IntDriver.TestModify(ints_1, ints_1, ints_2);
simpleRef.TestModify(simpleStrings_1, simpleStrings_1, simpleStrings_2);
simpleVal.TestModify(simpleInts_1, simpleInts_1, simpleInts_2);
IntDriver.<API key>(ints_1, ints_1, ints_2);
simpleRef.<API key>(simpleStrings_1, simpleStrings_1, simpleStrings_2);
simpleVal.<API key>(simpleInts_1, simpleInts_1, simpleInts_2);
}
[Fact]
public static void <API key>()
{
IntGenerator intGenerator = new IntGenerator();
StringGenerator stringGenerator = new StringGenerator();
intGenerator.NextValue();
stringGenerator.NextValue();
//Scenario 1: Vanilla - fill in SortedDictionary with 10 keys and check this property
Driver<int, int> IntDriver = new Driver<int, int>();
Driver<SimpleRef<String>, SimpleRef<String>> simpleRef = new Driver<SimpleRef<String>, SimpleRef<String>>();
Driver<SimpleRef<int>, SimpleRef<int>> simpleVal = new Driver<SimpleRef<int>, SimpleRef<int>>();
int count = 1000;
SimpleRef<int>[] simpleInts = <API key>.GetSimpleInts(count);
SimpleRef<String>[] simpleStrings = <API key>.GetSimpleStrings(count);
int[] ints = new int[count];
for (int i = 0; i < count; i++)
ints[i] = i;
IntDriver.<API key>(ints, ints);
simpleRef.<API key>(simpleStrings, simpleStrings);
simpleVal.<API key>(simpleInts, simpleInts);
IntDriver.<API key>(ints, ints);
simpleRef.<API key>(simpleStrings, simpleStrings);
simpleVal.<API key>(simpleInts, simpleInts);
//Scenario 2: Check for an empty SortedDictionary
IntDriver.<API key>(new int[0], new int[0]);
simpleRef.<API key>(new SimpleRef<String>[0], new SimpleRef<String>[0]);
simpleVal.<API key>(new SimpleRef<int>[0], new SimpleRef<int>[0]);
IntDriver.<API key>(new int[0], new int[0]);
simpleRef.<API key>(new SimpleRef<String>[0], new SimpleRef<String>[0]);
simpleVal.<API key>(new SimpleRef<int>[0], new SimpleRef<int>[0]);
}
[Fact]
public static void <API key>()
{
IntGenerator intGenerator = new IntGenerator();
StringGenerator stringGenerator = new StringGenerator();
intGenerator.NextValue();
stringGenerator.NextValue();
Driver<int, int> intDriver = new Driver<int, int>();
Driver<SimpleRef<String>, SimpleRef<String>> simpleRef = new Driver<SimpleRef<String>, SimpleRef<String>>();
Driver<SimpleRef<int>, SimpleRef<int>> simpleVal = new Driver<SimpleRef<int>, SimpleRef<int>>();
//Scenario 3: Check the underlying reference. Change the SortedDictionary afterwards and examine ICollection keys and make sure that the
//change is reflected
int count = 1000;
SimpleRef<int>[] simpleInts = <API key>.GetSimpleInts(count);
SimpleRef<String>[] simpleStrings = <API key>.GetSimpleStrings(count);
int[] ints = new int[count];
int half = count / 2;
SimpleRef<int>[] simpleInts_1 = new SimpleRef<int>[half];
SimpleRef<String>[] simpleStrings_1 = new SimpleRef<String>[half];
SimpleRef<int>[] simpleInts_2 = new SimpleRef<int>[half];
SimpleRef<String>[] simpleStrings_2 = new SimpleRef<String>[half];
for (int i = 0; i < count; i++)
ints[i] = i;
int[] ints_1 = new int[half];
int[] ints_2 = new int[half];
for (int i = 0; i < half; i++)
{
simpleInts_1[i] = simpleInts[i];
simpleStrings_1[i] = simpleStrings[i];
ints_1[i] = ints[i];
simpleInts_2[i] = simpleInts[i + half];
simpleStrings_2[i] = simpleStrings[i + half];
ints_2[i] = ints[i + half];
}
intDriver.TestModify(ints_1, ints_1, ints_2);
simpleRef.TestModify(simpleStrings_1, simpleStrings_1, simpleStrings_2);
simpleVal.TestModify(simpleInts_1, simpleInts_1, simpleInts_2);
intDriver.<API key>(ints_1, ints_1, ints_2);
simpleRef.<API key>(simpleStrings_1, simpleStrings_1, simpleStrings_2);
simpleVal.<API key>(simpleInts_1, simpleInts_1, simpleInts_2);
}
}
namespace <API key>
{
public class Driver<KeyType, ValueType>
{
public void TestVanilla(KeyType[] keys, ValueType[] values)
{
SortedDictionary<KeyType, ValueType> _dic = new SortedDictionary<KeyType, ValueType>();
for (int i = 0; i < keys.Length - 1; i++)
_dic.Add(keys[i], values[i]);
SortedDictionary<KeyType, ValueType>.KeyCollection _col = new SortedDictionary<KeyType, ValueType>.KeyCollection(_dic);
Assert.Equal(_col.Count, _dic.Count); //"Err_1! Count not equal"
IEnumerator<KeyType> _enum = _col.GetEnumerator();
int count = 0;
while (_enum.MoveNext())
{
Assert.True(_dic.ContainsKey(_enum.Current)); //"Err_2! Expected key to be present"
count++;
}
Assert.Equal(count, _dic.Count); //"Err_3! Count not equal"
KeyType[] _keys = new KeyType[_dic.Count];
_col.CopyTo(_keys, 0);
for (int i = 0; i < keys.Length - 1; i++)
Assert.True(_dic.ContainsKey(_keys[i])); //"Err_4! Expected key to be present"
count = 0;
foreach (KeyType currKey in _dic.Keys)
{
Assert.True(_dic.ContainsKey(currKey)); //"Err_5! Expected key to be present"
count++;
}
Assert.Equal(count, _dic.Count); //"Err_6! Count not equal"
try
{
//The behavior here is undefined as long as we don't AV we're fine
KeyType item = _enum.Current;
}
catch (Exception) { }
}
// verify we get <API key> when we call MoveNext() after adding a key
public void <API key>(KeyType[] keys, ValueType[] values)
{
SortedDictionary<KeyType, ValueType> _dic = new SortedDictionary<KeyType, ValueType>();
for (int i = 0; i < keys.Length - 1; i++)
_dic.Add(keys[i], values[i]);
SortedDictionary<KeyType, ValueType>.KeyCollection _col = new SortedDictionary<KeyType, ValueType>.KeyCollection(_dic);
IEnumerator<KeyType> _enum = _col.GetEnumerator();
if (keys.Length > 0)
{
_dic.Add(keys[keys.Length - 1], values[values.Length - 1]);
Assert.Throws<<API key>>((() => _enum.MoveNext())); //"Err_7! Expected <API key>."
}
}
public void TestModify(KeyType[] keys, ValueType[] values, KeyType[] newKeys)
{
SortedDictionary<KeyType, ValueType> _dic = new SortedDictionary<KeyType, ValueType>();
for (int i = 0; i < keys.Length; i++)
{
_dic.Add(keys[i], values[i]);
}
SortedDictionary<KeyType, ValueType>.KeyCollection _col = new SortedDictionary<KeyType, ValueType>.KeyCollection(_dic);
for (int i = 0; i < keys.Length; i++)
_dic.Remove(keys[i]);
Assert.Equal(_col.Count, 0); //"Err_8! Expected count to be zero"
IEnumerator<KeyType> _enum = _col.GetEnumerator();
int count = 0;
while (_enum.MoveNext())
{
Assert.True(_dic.ContainsKey(_enum.Current)); //"Err_9! Expected key to be present"
count++;
}
Assert.Equal(count, 0); //"Err_10! Expected count to be zero"
for (int i = 0; i < keys.Length; i++)
_dic.Add(newKeys[i], values[i]);
Assert.Equal(_col.Count, _dic.Count); //"Err_11! Count not equal"
_enum = _col.GetEnumerator();
count = 0;
while (_enum.MoveNext())
{
Assert.True(_dic.ContainsKey(_enum.Current)); //"Err_12! Expected key to be present"
count++;
}
Assert.Equal(count, _dic.Count); //"Err_13! Count not equal"
KeyType[] _keys = new KeyType[_dic.Count];
_col.CopyTo(_keys, 0);
for (int i = 0; i < keys.Length; i++)
Assert.True(_dic.ContainsKey(_keys[i])); //"Err_14! Expected key to be present"
}
public void <API key>(KeyType[] keys, ValueType[] values)
{
SortedDictionary<KeyType, ValueType> _dic = new SortedDictionary<KeyType, ValueType>();
IDictionary _idic = _dic;
for (int i = 0; i < keys.Length - 1; i++)
_dic.Add(keys[i], values[i]);
SortedDictionary<KeyType, ValueType>.KeyCollection _col = new SortedDictionary<KeyType, ValueType>.KeyCollection(_dic);
Assert.Equal(_col.Count, _dic.Count); //"Err_15! Count not equal"
IEnumerator _enum = _col.GetEnumerator();
int count = 0;
while (_enum.MoveNext())
{
Assert.True(_dic.ContainsKey((KeyType)_enum.Current)); //"Err_16! Expected key to be present"
count++;
}
Assert.Equal(count, _dic.Count); //"Err_17! Count not equal"
KeyType[] _keys = new KeyType[_dic.Count];
_col.CopyTo(_keys, 0);
for (int i = 0; i < keys.Length - 1; i++)
Assert.True(_dic.ContainsKey(_keys[i])); //"Err_18! Expected key to be present"
_enum.Reset();
count = 0;
while (_enum.MoveNext())
{
Assert.True(_dic.ContainsKey((KeyType)_enum.Current)); //"Err_19! Expected key to be present"
count++;
}
Assert.Equal(count, _dic.Count); //"Err_20! Count not equal"
_keys = new KeyType[_dic.Count];
_col.CopyTo(_keys, 0);
for (int i = 0; i < keys.Length - 1; i++)
Assert.True(_dic.ContainsKey(_keys[i])); //"Err_21! Expected key to be present"
}
public void <API key>(KeyType[] keys, ValueType[] values)
{
SortedDictionary<KeyType, ValueType> _dic = new SortedDictionary<KeyType, ValueType>();
IDictionary _idic = _dic;
for (int i = 0; i < keys.Length - 1; i++)
_dic.Add(keys[i], values[i]);
SortedDictionary<KeyType, ValueType>.KeyCollection _col = new SortedDictionary<KeyType, ValueType>.KeyCollection(_dic);
IEnumerator _enum = _col.GetEnumerator();
// get to the end
while (_enum.MoveNext()) { }
Assert.Throws<<API key>>((() => _dic.ContainsKey((KeyType)_enum.Current))); //"Err_22! Expected <API key>."
if (keys.Length > 0)
{
_dic.Add(keys[keys.Length - 1], values[values.Length - 1]);
Assert.Throws<<API key>>((() => _enum.MoveNext())); //"Err_23! Expected <API key>."
Assert.Throws<<API key>>((() => _enum.Reset())); //"Err_24! Expected <API key>."
}
}
public void <API key>(KeyType[] keys, ValueType[] values, KeyType[] newKeys)
{
SortedDictionary<KeyType, ValueType> _dic = new SortedDictionary<KeyType, ValueType>();
IDictionary _idic = _dic;
for (int i = 0; i < keys.Length; i++)
_dic.Add(keys[i], values[i]);
SortedDictionary<KeyType, ValueType>.KeyCollection _col = new SortedDictionary<KeyType, ValueType>.KeyCollection(_dic);
for (int i = 0; i < keys.Length; i++)
_dic.Remove(keys[i]);
Assert.Equal(_col.Count, 0); //"Err_25! Expected count to be zero"
IEnumerator _enum = _col.GetEnumerator();
int count = 0;
while (_enum.MoveNext())
{
Assert.True(_dic.ContainsKey((KeyType)_enum.Current)); //"Err_26! Expected key to be present"
count++;
}
Assert.Equal(count, 0); //"Err_27! Expected count to be zero"
for (int i = 0; i < keys.Length; i++)
_dic.Add(newKeys[i], values[i]);
Assert.Equal(_col.Count, _dic.Count); //"Err_28! Count not equal"
_enum = _col.GetEnumerator();
count = 0;
while (_enum.MoveNext())
{
Assert.True(_dic.ContainsKey((KeyType)_enum.Current)); //"Err_29! Expected key to be present"
count++;
}
Assert.Equal(count, _dic.Count); //"Err_30! Count not equal"
KeyType[] _keys = new KeyType[_dic.Count];
_col.CopyTo(_keys, 0);
for (int i = 0; i < keys.Length; i++)
Assert.True(_dic.ContainsKey(_keys[i])); //"Err_31! Expected key to be present"
}
}
}
}
|
<?php
// Moodle is free software: you can redistribute it and/or modify
// (at your option) any later version.
// Moodle is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
defined('MOODLE_INTERNAL') || die();
$string['cannotcreatelangdir'] = 'Hindi makalikha ng lang bgsk.';
$string['cannotcreatetempdir'] = 'Hindi makalikha ng temp bgsk.';
$string['<API key>'] = 'Hindi mai-download ang mga sangkap';
$string['<API key>'] = 'Hindi mai-download ang ZIP file.';
$string['cannotfindcomponent'] = 'Hindi makita ang component.';
$string['cannotsavemd5file'] = 'Hindi mai-save ang file na md5.';
$string['cannotsavezipfile'] = 'Hindi mai-save ang file na ZIP.';
$string['cannotunzipfile'] = 'Hindi mai-unzip ang file.';
$string['componentisuptodate'] = 'Up-to-date ang component.';
$string['<API key>'] = 'Bigo ang pagsusuri sa idinownload na file.';
$string['invalidmd5'] = 'Mali ang check variable - paki-ulit';
$string['<API key>'] = 'May ilang nawawalang field na kailangan';
$string['wrongdestpath'] = 'Mali ang patutunguhang landas';
$string['wrongsourcebase'] = 'Mali ang URL base ng source.';
$string['wrongzipfilename'] = 'Mali ang pangalan ng ZIP file';
|
/* PR target/8340 */
/* { dg-do compile } */
/* { <API key> ia32 } */
/* { <API key> fpic } */
/* { dg-skip-if "No Windows PIC" { *-*-mingw* *-*-cygwin } { "*" } { "" } } */
/* { dg-options "-fPIC" } */
/* Test verifies that %ebx is no longer fixed when generating PIC code on i686. */
int foo ()
{
static int a;
__asm__ __volatile__ (
"xorl %%ebx, %%ebx\n"
"movl %%ebx, %0\n"
: "=m" (a)
:
: "%ebx"
);
return a;
}
|
<!doctype html>
<html>
<head>
<title>Analytics sample app</title>
</head>
<body>
<div>
<button id="chocolate">Chocolate</button>
<button id="vanilla">Vanilla</button>
<div id=out></div>
</div>
<div id="settings">
<h1>Settings</h1>
<div id="settings-loading">
Loading settings...
</div>
<div id="settings-loaded" hidden>
<label>
<input id="analytics" type="checkbox" />
Send anonymous usage data.
</label>
</div>
</div>
<script src="<API key>.js"></script>
<script src="main.js"></script>
</body>
</html>
|
package butterknife;
import android.view.View;
import butterknife.internal.ListenerClass;
import butterknife.internal.ListenerMethod;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static android.widget.AdapterView.<API key>;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.CLASS;
/**
* Bind a method to an {@link <API key> <API key>} on the view for each
* ID specified.
* <pre><code>
* {@literal @}OnItemSelected(R.id.example_list) void onItemSelected(int position) {
* Toast.makeText(this, "Selected position " + position + "!", Toast.LENGTH_SHORT).show();
* }
* </code></pre>
* Any number of parameters from
* {@link <API key>#onItemSelected(android.widget.AdapterView, android.view.View, int,
* long) onItemSelected} may be used on the method.
* <p>
* To bind to methods other than {@code onItemSelected}, specify a different {@code callback}.
* <pre><code>
* {@literal @}OnItemSelected(value = R.id.example_list, callback = NOTHING_SELECTED)
* void onNothingSelected() {
* Toast.makeText(this, "Nothing selected!", Toast.LENGTH_SHORT).show();
* }
* </code></pre>
*
* @see <API key>
*/
@Target(METHOD)
@Retention(CLASS)
@ListenerClass(
targetType = "android.widget.AdapterView<?>",
setter = "<API key>",
type = "android.widget.AdapterView.<API key>",
callbacks = OnItemSelected.Callback.class
)
public @interface OnItemSelected {
/** View IDs to which the method will be bound. */
int[] value() default { View.NO_ID };
/** Listener callback to which the method will be bound. */
Callback callback() default Callback.ITEM_SELECTED;
/** {@link <API key>} callback methods. */
enum Callback {
/**
* {@link <API key>#onItemSelected(android.widget.AdapterView, android.view.View,
* int, long)}
*/
@ListenerMethod(
name = "onItemSelected",
parameters = {
"android.widget.AdapterView<?>",
"android.view.View",
"int",
"long"
}
)
ITEM_SELECTED,
/** {@link <API key>#onNothingSelected(android.widget.AdapterView)} */
@ListenerMethod(
name = "onNothingSelected",
parameters = "android.widget.AdapterView<?>"
)
NOTHING_SELECTED
}
}
|
topojson = (function() {
function merge(topology, arcs) {
var arcsByEnd = {},
fragmentByStart = {},
fragmentByEnd = {};
arcs.forEach(function(i) {
var e = ends(i);
(arcsByEnd[e[0]] || (arcsByEnd[e[0]] = [])).push(i);
(arcsByEnd[e[1]] || (arcsByEnd[e[1]] = [])).push(~i);
});
arcs.forEach(function(i) {
var e = ends(i),
start = e[0],
end = e[1],
f, g;
if (f = fragmentByEnd[start]) {
delete fragmentByEnd[f.end];
f.push(i);
f.end = end;
if (g = fragmentByStart[end]) {
delete fragmentByStart[g.start];
var fg = g === f ? f : f.concat(g);
fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;
} else if (g = fragmentByEnd[end]) {
delete fragmentByStart[g.start];
delete fragmentByEnd[g.end];
var fg = f.concat(g.map(function(i) { return ~i; }).reverse());
fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.start] = fg;
} else {
fragmentByStart[f.start] = fragmentByEnd[f.end] = f;
}
} else if (f = fragmentByStart[end]) {
delete fragmentByStart[f.start];
f.unshift(i);
f.start = start;
if (g = fragmentByEnd[start]) {
delete fragmentByEnd[g.end];
var gf = g === f ? f : g.concat(f);
fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;
} else if (g = fragmentByStart[start]) {
delete fragmentByStart[g.start];
delete fragmentByEnd[g.end];
var gf = g.map(function(i) { return ~i; }).reverse().concat(f);
fragmentByStart[gf.start = g.end] = fragmentByEnd[gf.end = f.end] = gf;
} else {
fragmentByStart[f.start] = fragmentByEnd[f.end] = f;
}
} else if (f = fragmentByStart[start]) {
delete fragmentByStart[f.start];
f.unshift(~i);
f.start = end;
if (g = fragmentByEnd[end]) {
delete fragmentByEnd[g.end];
var gf = g === f ? f : g.concat(f);
fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;
} else if (g = fragmentByStart[end]) {
delete fragmentByStart[g.start];
delete fragmentByEnd[g.end];
var gf = g.map(function(i) { return ~i; }).reverse().concat(f);
fragmentByStart[gf.start = g.end] = fragmentByEnd[gf.end = f.end] = gf;
} else {
fragmentByStart[f.start] = fragmentByEnd[f.end] = f;
}
} else if (f = fragmentByEnd[end]) {
delete fragmentByEnd[f.end];
f.push(~i);
f.end = start;
if (g = fragmentByEnd[start]) {
delete fragmentByStart[g.start];
var fg = g === f ? f : f.concat(g);
fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;
} else if (g = fragmentByStart[start]) {
delete fragmentByStart[g.start];
delete fragmentByEnd[g.end];
var fg = f.concat(g.map(function(i) { return ~i; }).reverse());
fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.start] = fg;
} else {
fragmentByStart[f.start] = fragmentByEnd[f.end] = f;
}
} else {
f = [i];
fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;
}
});
function ends(i) {
var arc = topology.arcs[i], p0 = arc[0], p1 = [0, 0];
arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });
return [p0, p1];
}
var fragments = [];
for (var k in fragmentByEnd) fragments.push(fragmentByEnd[k]);
return fragments;
}
function mesh(topology, o, filter) {
var arcs = [];
if (arguments.length > 1) {
var geomsByArc = [],
geom;
function arc(i) {
if (i < 0) i = ~i;
(geomsByArc[i] || (geomsByArc[i] = [])).push(geom);
}
function line(arcs) {
arcs.forEach(arc);
}
function polygon(arcs) {
arcs.forEach(line);
}
function geometry(o) {
if (o.type === "GeometryCollection") o.geometries.forEach(geometry);
else if (o.type in geometryType) {
geom = o;
geometryType[o.type](o.arcs);
}
}
var geometryType = {
LineString: line,
MultiLineString: polygon,
Polygon: polygon,
MultiPolygon: function(arcs) { arcs.forEach(polygon); }
};
geometry(o);
geomsByArc.forEach(arguments.length < 3
? function(geoms, i) { arcs.push([i]); }
: function(geoms, i) { if (filter(geoms[0], geoms[geoms.length - 1])) arcs.push([i]); });
} else {
for (var i = 0, n = topology.arcs.length; i < n; ++i) arcs.push([i]);
}
return object(topology, {type: "MultiLineString", arcs: merge(topology, arcs)});
}
function object(topology, o) {
var tf = topology.transform,
kx = tf.scale[0],
ky = tf.scale[1],
dx = tf.translate[0],
dy = tf.translate[1],
arcs = topology.arcs;
function arc(i, points) {
if (points.length) points.pop();
for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length, x = 0, y = 0, p; k < n; ++k) points.push([
(x += (p = a[k])[0]) * kx + dx,
(y += p[1]) * ky + dy
]);
if (i < 0) reverse(points, n);
}
function point(coordinates) {
return [coordinates[0] * kx + dx, coordinates[1] * ky + dy];
}
function line(arcs) {
var points = [];
for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);
if (points.length < 2) points.push(points[0]);
return points;
}
function ring(arcs) {
var points = line(arcs);
while (points.length < 4) points.push(points[0]);
return points;
}
function polygon(arcs) {
return arcs.map(ring);
}
function geometry(o) {
var t = o.type, g = t === "GeometryCollection" ? {type: t, geometries: o.geometries.map(geometry)}
: t in geometryType ? {type: t, coordinates: geometryType[t](o)}
: {type: null};
if ("id" in o) g.id = o.id;
if ("properties" in o) g.properties = o.properties;
return g;
}
var geometryType = {
Point: function(o) { return point(o.coordinates); },
MultiPoint: function(o) { return o.coordinates.map(point); },
LineString: function(o) { return line(o.arcs); },
MultiLineString: function(o) { return o.arcs.map(line); },
Polygon: function(o) { return polygon(o.arcs); },
MultiPolygon: function(o) { return o.arcs.map(polygon); }
};
return geometry(o);
}
function reverse(array, n) {
var t, j = array.length, i = j - n; while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;
}
function bisect(a, x) {
var lo = 0, hi = a.length;
while (lo < hi) {
var mid = lo + hi >>> 1;
if (a[mid] < x) lo = mid + 1;
else hi = mid;
}
return lo;
}
function neighbors(objects) {
var objectsByArc = [],
neighbors = objects.map(function() { return []; });
function line(arcs, i) {
arcs.forEach(function(a) {
if (a < 0) a = ~a;
var o = objectsByArc[a] || (objectsByArc[a] = []);
if (!o[i]) o.forEach(function(j) {
var n, k;
k = bisect(n = neighbors[i], j); if (n[k] !== j) n.splice(k, 0, j);
k = bisect(n = neighbors[j], i); if (n[k] !== i) n.splice(k, 0, i);
}), o[i] = i;
});
}
function polygon(arcs, i) {
arcs.forEach(function(arc) { line(arc, i); });
}
function geometry(o, i) {
if (o.type === "GeometryCollection") o.geometries.forEach(function(o) { geometry(o, i); });
else if (o.type in geometryType) geometryType[o.type](o.arcs, i);
}
var geometryType = {
LineString: line,
MultiLineString: polygon,
Polygon: polygon,
MultiPolygon: function(arcs, i) { arcs.forEach(function(arc) { polygon(arc, i); }); }
};
objects.forEach(geometry);
return neighbors;
}
return {
version: "0.0.28",
mesh: mesh,
object: object,
neighbors: neighbors
};
})();
|
/* Public domain. */
#ifndef CDB_H
#define CDB_H
#include <string.h>
#include "types.h"
#define KVLSZ 4
#define CDB_MAX_KEY 0xff
#define CDB_MAX_VALUE 0xffffff
#define CDB_HASHSTART 5381
struct cdb {
char *map; /* 0 if no map is available */
int fd; /* filedescriptor */
ut32 size; /* initialized if map is nonzero */
ut32 loop; /* number of hash slots searched under this key */
ut32 khash; /* initialized if loop is nonzero */
ut32 kpos; /* initialized if loop is nonzero */
ut32 hpos; /* initialized if loop is nonzero */
ut32 hslots; /* initialized if loop is nonzero */
ut32 dpos; /* initialized if cdb_findnext() returns 1 */
ut32 dlen; /* initialized if cdb_findnext() returns 1 */
};
/* TODO THIS MUST GTFO! */
bool cdb_getkvlen(struct cdb *db, ut32 *klen, ut32 *vlen, ut32 pos);
void cdb_free(struct cdb *);
bool cdb_init(struct cdb *, int fd);
void cdb_findstart(struct cdb *);
bool cdb_read(struct cdb *, char *, unsigned int, ut32);
int cdb_findnext(struct cdb *, ut32 u, const char *, ut32);
#define cdb_datapos(c) ((c)->dpos)
#define cdb_datalen(c) ((c)->dlen)
#endif
|
Package.describe({
summary: "Github OAuth flow",
version: "1.1.4-plugins.0"
});
Package.onUse(function(api) {
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('underscore', 'client');
api.use('templating', 'client');
api.use('random', 'client');
api.use('<API key>', ['client', 'server']);
api.export('Github');
api.addFiles(
['github_configure.html', 'github_configure.js'],
'client');
api.addFiles('github_server.js', 'server');
api.addFiles('github_client.js', 'client');
});
|
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# copies or substantial portions of the Software.
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# 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.
module TZInfo
# Represents an offset defined in a Timezone data file.
# @private
class TimezoneOffsetInfo #:nodoc:
# The base offset of the timezone from UTC in seconds.
attr_reader :utc_offset
# The offset from standard time for the zone in seconds (i.e. non-zero if
# daylight savings is being observed).
attr_reader :std_offset
# The total offset of this observance from UTC in seconds
# (utc_offset + std_offset).
attr_reader :utc_total_offset
# The abbreviation that identifies this observance, e.g. "GMT"
# (Greenwich Mean Time) or "BST" (British Summer Time) for "Europe/London". The returned identifier is a
# symbol.
attr_reader :abbreviation
# Constructs a new TimezoneOffsetInfo. utc_offset and std_offset are
# specified in seconds.
def initialize(utc_offset, std_offset, abbreviation)
@utc_offset = utc_offset
@std_offset = std_offset
@abbreviation = abbreviation
@utc_total_offset = @utc_offset + @std_offset
end
# True if std_offset is non-zero.
def dst?
@std_offset != 0
end
# Converts a UTC DateTime to local time based on the offset of this period.
def to_local(utc)
TimeOrDateTime.wrap(utc) {|wrapped|
wrapped + @utc_total_offset
}
end
# Converts a local DateTime to UTC based on the offset of this period.
def to_utc(local)
TimeOrDateTime.wrap(local) {|wrapped|
wrapped - @utc_total_offset
}
end
# Returns true if and only if toi has the same utc_offset, std_offset
# and abbreviation as this TimezoneOffsetInfo.
def ==(toi)
toi.kind_of?(TimezoneOffsetInfo) &&
utc_offset == toi.utc_offset && std_offset == toi.std_offset && abbreviation == toi.abbreviation
end
# Returns true if and only if toi has the same utc_offset, std_offset
# and abbreviation as this TimezoneOffsetInfo.
def eql?(toi)
self == toi
end
# Returns a hash of this TimezoneOffsetInfo.
def hash
utc_offset.hash ^ std_offset.hash ^ abbreviation.hash
end
# Returns internal object state as a programmer-readable string.
def inspect
"#<#{self.class}: #@utc_offset,#@std_offset,#@abbreviation>"
end
end
end
|
define(
"dijit/form/nls/ca/validate", ({
invalidMessage: "El valor introduït no és vàlid",
missingMessage: "Aquest valor és necessari",
rangeMessage: "Aquest valor és fora de l'interval"
})
);
|
> :[jdneo](https:
AndroidAndroidPDF
Android 4.4API Level 19AndroidHTML
## Lessons
* [****](photos.html)
* [**HTML**](html-docs.html)
HTML
* [****](custom-docs.html)
Android
|
html {
overflow-y: auto;
}
body {
padding: 1em;
}
.snippets {
}
.snippet {
background: white;
padding: 10px 20px 0px 20px;
margin-top: 20px;
border: 1px solid #ddd;
}
.snippet h2 {
margin-top: 0;
margin-left: -10px;
}
.snippet pre {
font-size: 13px;
overflow: auto;
-webkit-user-select: initial;
}
.snippet h2 span {
display: inline-block;
margin-left: 1em;
font-size: 10px;
font-weight: normal;
}
.snippet h2 span a {
text-decoration: none;
}
|
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace Org.Mentalis.Network.ProxySocket.Authentication {
<summary>
This class implements the 'username/password authentication' scheme.
</summary>
internal sealed class AuthUserPass : AuthMethod {
<summary>
Initializes a new AuthUserPass instance.
</summary>
<param name="server">The socket connection with the proxy server.</param>
<param name="user">The username to use.</param>
<param name="pass">The password to use.</param>
<exception cref="<API key>"><c>user</c> -or- <c>pass</c> is null.</exception>
public AuthUserPass(Socket server, string user, string pass) : base(server) {
Username = user;
Password = pass;
}
<summary>
Creates an array of bytes that has to be sent if the user wants to authenticate with the username/password authentication scheme.
</summary>
<returns>An array of bytes that has to be sent if the user wants to authenticate with the username/password authentication scheme.</returns>
private byte[] <API key>() {
byte[] buffer = new byte[3 + Username.Length + Password.Length];
buffer[0] = 1;
buffer[1] = (byte)Username.Length;
Array.Copy(Encoding.ASCII.GetBytes(Username), 0, buffer, 2, Username.Length);
buffer[Username.Length + 2] = (byte)Password.Length;
Array.Copy(Encoding.ASCII.GetBytes(Password), 0, buffer, Username.Length + 3, Password.Length);
return buffer;
}
<summary>
Starts the authentication process.
</summary>
public override void Authenticate() {
Server.Send(<API key>());
byte[] buffer = new byte[2];
int received = 0;
while (received != 2) {
received += Server.Receive(buffer, received, 2 - received, SocketFlags.None);
}
if (buffer[1] != 0) {
Server.Close();
throw new ProxyException("Username/password combination rejected.");
}
return;
}
<summary>
Starts the asynchronous authentication process.
</summary>
<param name="callback">The method to call when the authentication is complete.</param>
public override void BeginAuthenticate(HandShakeComplete callback) {
CallBack = callback;
Server.BeginSend(<API key>(), 0, 3 + Username.Length + Password.Length, SocketFlags.None, new AsyncCallback(this.OnSent), Server);
return;
}
<summary>
Called when the authentication bytes have been sent.
</summary>
<param name="ar">Stores state information for this asynchronous operation as well as any user-defined data.</param>
private void OnSent(IAsyncResult ar) {
try {
Server.EndSend(ar);
Buffer = new byte[2];
Server.BeginReceive(Buffer, 0, 2, SocketFlags.None, new AsyncCallback(this.OnReceive), Server);
} catch (Exception e) {
CallBack(e);
}
}
<summary>
Called when the socket received an authentication reply.
</summary>
<param name="ar">Stores state information for this asynchronous operation as well as any user-defined data.</param>
private void OnReceive(IAsyncResult ar) {
try {
Received += Server.EndReceive(ar);
if (Received == Buffer.Length)
if (Buffer[1] == 0)
CallBack(null);
else
throw new ProxyException("Username/password combination not accepted.");
else
Server.BeginReceive(Buffer, Received, Buffer.Length - Received, SocketFlags.None, new AsyncCallback(this.OnReceive), Server);
} catch (Exception e) {
CallBack(e);
}
}
<summary>
Gets or sets the username to use when authenticating with the proxy server.
</summary>
<value>The username to use when authenticating with the proxy server.</value>
<exception cref="<API key>">The specified value is null.</exception>
private string Username {
get {
return m_Username;
}
set {
if (value == null)
throw new <API key>();
m_Username = value;
}
}
<summary>
Gets or sets the password to use when authenticating with the proxy server.
</summary>
<value>The password to use when authenticating with the proxy server.</value>
<exception cref="<API key>">The specified value is null.</exception>
private string Password {
get {
return m_Password;
}
set {
if (value == null)
throw new <API key>();
m_Password = value;
}
}
// private variables
<summary>Holds the value of the Username property.</summary>
private string m_Username;
<summary>Holds the value of the Password property.</summary>
private string m_Password;
}
}
|
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package glacier provides the client and types for making API
// requests to Amazon Glacier.
// Amazon Glacier is a storage solution for "cold data."
// Amazon Glacier is an extremely low-cost storage service that provides secure,
// durable, and easy-to-use storage for data backup and archival. With Amazon
// Glacier, customers can store their data cost effectively for months, years,
// or decades. Amazon Glacier also enables customers to offload the administrative
// burdens of operating and scaling storage to AWS, so they don't have to worry
// about capacity planning, hardware provisioning, data replication, hardware
// failure and recovery, or time-consuming hardware migrations.
// Amazon Glacier is a great storage choice when low storage cost is paramount,
// your data is rarely retrieved, and retrieval latency of several hours is
// acceptable. If your application requires fast or frequent access to your
// data, consider using Amazon S3. For more information, see Amazon Simple Storage
// You can store any kind of data in any format. There is no maximum limit on
// the total amount of data you can store in Amazon Glacier.
// If you are a first-time user of Amazon Glacier, we recommend that you begin
// by reading the following sections in the Amazon Glacier Developer Guide:
// - This section of the Developer Guide describes the underlying data model,
// the operations it supports, and the AWS SDKs that you can use to interact
// with the service.
// - The Getting Started section walks you through the process of creating
// a vault, uploading archives, creating jobs to download archives, retrieving
// the job output, and deleting archives.
// See glacier package documentation for more information.
// Using the Client
// To Amazon Glacier with the SDK use the New function to create
// a new service client. With that client you can make API requests to the service.
// These clients are safe to use concurrently.
// See the SDK's documentation for more information on how to use the SDK.
// See aws.Config documentation for more information on configuring SDK clients.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
// See the Amazon Glacier client Glacier for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/glacier/#New
package glacier
|
#include "builtin.h"
#include "tree-walk.h"
#include "xdiff-interface.h"
#include "blob.h"
#include "exec_cmd.h"
#include "merge-blobs.h"
static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>";
struct merge_list {
struct merge_list *next;
struct merge_list *link; /* other stages for this object */
unsigned int stage : 2;
unsigned int mode;
const char *path;
struct blob *blob;
};
static struct merge_list *merge_result, **merge_result_end = &merge_result;
static void add_merge_entry(struct merge_list *entry)
{
*merge_result_end = entry;
merge_result_end = &entry->next;
}
static void <API key>(struct tree_desc t[3], const char *base, int df_conflict);
static const char *explanation(struct merge_list *entry)
{
switch (entry->stage) {
case 0:
return "merged";
case 3:
return "added in remote";
case 2:
if (entry->link)
return "added in both";
return "added in local";
}
/* Existed in base */
entry = entry->link;
if (!entry)
return "removed in both";
if (entry->link)
return "changed in both";
if (entry->stage == 3)
return "removed in local";
return "removed in remote";
}
static void *result(struct merge_list *entry, unsigned long *size)
{
enum object_type type;
struct blob *base, *our, *their;
const char *path = entry->path;
if (!entry->stage)
return read_sha1_file(entry->blob->object.sha1, &type, size);
base = NULL;
if (entry->stage == 1) {
base = entry->blob;
entry = entry->link;
}
our = NULL;
if (entry && entry->stage == 2) {
our = entry->blob;
entry = entry->link;
}
their = NULL;
if (entry)
their = entry->blob;
return merge_blobs(path, base, our, their, size);
}
static void *origin(struct merge_list *entry, unsigned long *size)
{
enum object_type type;
while (entry) {
if (entry->stage == 2)
return read_sha1_file(entry->blob->object.sha1, &type, size);
entry = entry->link;
}
return NULL;
}
static int show_outf(void *priv_, mmbuffer_t *mb, int nbuf)
{
int i;
for (i = 0; i < nbuf; i++)
printf("%.*s", (int) mb[i].size, mb[i].ptr);
return 0;
}
static void show_diff(struct merge_list *entry)
{
unsigned long size;
mmfile_t src, dst;
xpparam_t xpp;
xdemitconf_t xecfg;
xdemitcb_t ecb;
xpp.flags = 0;
memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = 3;
ecb.outf = show_outf;
ecb.priv = NULL;
src.ptr = origin(entry, &size);
if (!src.ptr)
size = 0;
src.size = size;
dst.ptr = result(entry, &size);
if (!dst.ptr)
size = 0;
dst.size = size;
xdi_diff(&src, &dst, &xpp, &xecfg, &ecb);
free(src.ptr);
free(dst.ptr);
}
static void show_result_list(struct merge_list *entry)
{
printf("%s\n", explanation(entry));
do {
struct merge_list *link = entry->link;
static const char *desc[4] = { "result", "base", "our", "their" };
printf(" %-6s %o %s %s\n", desc[entry->stage], entry->mode, sha1_to_hex(entry->blob->object.sha1), entry->path);
entry = link;
} while (entry);
}
static void show_result(void)
{
struct merge_list *walk;
walk = merge_result;
while (walk) {
show_result_list(walk);
show_diff(walk);
walk = walk->next;
}
}
/* An empty entry never compares same, not even to another empty entry */
static int same_entry(struct name_entry *a, struct name_entry *b)
{
return a->sha1 &&
b->sha1 &&
!hashcmp(a->sha1, b->sha1) &&
a->mode == b->mode;
}
static int both_empty(struct name_entry *a, struct name_entry *b)
{
return !(a->sha1 || b->sha1);
}
static struct merge_list *create_entry(unsigned stage, unsigned mode, const unsigned char *sha1, const char *path)
{
struct merge_list *res = xcalloc(1, sizeof(*res));
res->stage = stage;
res->path = path;
res->mode = mode;
res->blob = lookup_blob(sha1);
return res;
}
static char *traverse_path(const struct traverse_info *info, const struct name_entry *n)
{
char *path = xmalloc(traverse_path_len(info, n) + 1);
return make_traverse_path(path, info, n);
}
static void resolve(const struct traverse_info *info, struct name_entry *ours, struct name_entry *result)
{
struct merge_list *orig, *final;
const char *path;
/* If it's already ours, don't bother showing it */
if (!ours)
return;
path = traverse_path(info, result);
orig = create_entry(2, ours->mode, ours->sha1, path);
final = create_entry(0, result->mode, result->sha1, path);
final->link = orig;
add_merge_entry(final);
}
static void <API key>(const struct traverse_info *info, struct name_entry n[3],
int df_conflict)
{
char *newbase;
struct name_entry *p;
struct tree_desc t[3];
void *buf0, *buf1, *buf2;
for (p = n; p < n + 3; p++) {
if (p->mode && S_ISDIR(p->mode))
break;
}
if (n + 3 <= p)
return; /* there is no tree here */
newbase = traverse_path(info, p);
#define ENTRY_SHA1(e) (((e)->mode && S_ISDIR((e)->mode)) ? (e)->sha1 : NULL)
buf0 = <API key>(t+0, ENTRY_SHA1(n + 0));
buf1 = <API key>(t+1, ENTRY_SHA1(n + 1));
buf2 = <API key>(t+2, ENTRY_SHA1(n + 2));
#undef ENTRY_SHA1
<API key>(t, newbase, df_conflict);
free(buf0);
free(buf1);
free(buf2);
free(newbase);
}
static struct merge_list *link_entry(unsigned stage, const struct traverse_info *info, struct name_entry *n, struct merge_list *entry)
{
const char *path;
struct merge_list *link;
if (!n->mode)
return entry;
if (entry)
path = entry->path;
else
path = traverse_path(info, n);
link = create_entry(stage, n->mode, n->sha1, path);
link->link = entry;
return link;
}
static void unresolved(const struct traverse_info *info, struct name_entry n[3])
{
struct merge_list *entry = NULL;
int i;
unsigned dirmask = 0, mask = 0;
for (i = 0; i < 3; i++) {
mask |= (1 << i);
/*
* Treat missing entries as directories so that we return
* after <API key> has handled this.
*/
if (!n[i].mode || S_ISDIR(n[i].mode))
dirmask |= (1 << i);
}
<API key>(info, n, dirmask && (dirmask != mask));
if (dirmask == mask)
return;
if (n[2].mode && !S_ISDIR(n[2].mode))
entry = link_entry(3, info, n + 2, entry);
if (n[1].mode && !S_ISDIR(n[1].mode))
entry = link_entry(2, info, n + 1, entry);
if (n[0].mode && !S_ISDIR(n[0].mode))
entry = link_entry(1, info, n + 0, entry);
add_merge_entry(entry);
}
/*
* Merge two trees together (t[1] and t[2]), using a common base (t[0])
* as the origin.
*
* This walks the (sorted) trees in lock-step, checking every possible
* name. Note that directories automatically sort differently from other
* files (see "base_name_compare"), so you'll never see file/directory
* conflicts, because they won't ever compare the same.
*
* IOW, if a directory changes to a filename, it will automatically be
* seen as the directory going away, and the filename being created.
*
* Think of this as a three-way diff.
*
* The output will be either:
* - successful merge
* "0 mode sha1 filename"
* NOTE NOTE NOTE! FIXME! We really really need to walk the index
* in parallel with this too!
*
* - conflict:
* "1 mode sha1 filename"
* "2 mode sha1 filename"
* "3 mode sha1 filename"
* where not all of the 1/2/3 lines may exist, of course.
*
* The successful merge rules are the same as for the three-way merge
* in git-read-tree.
*/
static int threeway_callback(int n, unsigned long mask, unsigned long dirmask, struct name_entry *entry, struct traverse_info *info)
{
/* Same in both? */
if (same_entry(entry+1, entry+2) || both_empty(entry+1, entry+2)) {
/* Modified, added or removed identically */
resolve(info, NULL, entry+1);
return mask;
}
if (same_entry(entry+0, entry+1)) {
if (entry[2].sha1 && !S_ISDIR(entry[2].mode)) {
/* We did not touch, they modified -- take theirs */
resolve(info, entry+1, entry+2);
return mask;
}
/*
* If we did not touch a directory but they made it
* into a file, we fall through and unresolved()
* recurses down. Likewise for the opposite case.
*/
}
if (same_entry(entry+0, entry+2) || both_empty(entry+0, entry+2)) {
/* We added, modified or removed, they did not touch -- take ours */
resolve(info, NULL, entry+1);
return mask;
}
unresolved(info, entry);
return mask;
}
static void <API key>(struct tree_desc t[3], const char *base, int df_conflict)
{
struct traverse_info info;
setup_traverse_info(&info, base);
info.data = &df_conflict;
info.fn = threeway_callback;
traverse_trees(3, t, &info);
}
static void merge_trees(struct tree_desc t[3], const char *base)
{
<API key>(t, base, 0);
}
static void *get_tree_descriptor(struct tree_desc *desc, const char *rev)
{
unsigned char sha1[20];
void *buf;
if (get_sha1(rev, sha1))
die("unknown rev %s", rev);
buf = <API key>(desc, sha1);
if (!buf)
die("%s is not a tree", rev);
return buf;
}
int cmd_merge_tree(int argc, const char **argv, const char *prefix)
{
struct tree_desc t[3];
void *buf1, *buf2, *buf3;
if (argc != 4)
usage(merge_tree_usage);
buf1 = get_tree_descriptor(t+0, argv[1]);
buf2 = get_tree_descriptor(t+1, argv[2]);
buf3 = get_tree_descriptor(t+2, argv[3]);
merge_trees(t, "");
free(buf1);
free(buf2);
free(buf3);
show_result();
return 0;
}
|
// <API key>: GPL-2.0-only
#include <linux/module.h>
#include <net/tcp.h>
/* These factors derived from the recommended values in the aer:
* .01 and and 7/8.
*/
#define TCP_SCALABLE_AI_CNT 100U
#define <API key> 3
static void <API key>(struct sock *sk, u32 ack, u32 acked)
{
struct tcp_sock *tp = tcp_sk(sk);
if (!tcp_is_cwnd_limited(sk))
return;
if (tcp_in_slow_start(tp)) {
acked = tcp_slow_start(tp, acked);
if (!acked)
return;
}
tcp_cong_avoid_ai(tp, min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT),
acked);
}
static u32 <API key>(struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
return max(tp->snd_cwnd - (tp->snd_cwnd>><API key>), 2U);
}
static struct tcp_congestion_ops tcp_scalable __read_mostly = {
.ssthresh = <API key>,
.undo_cwnd = tcp_reno_undo_cwnd,
.cong_avoid = <API key>,
.owner = THIS_MODULE,
.name = "scalable",
};
static int __init <API key>(void)
{
return <API key>(&tcp_scalable);
}
static void __exit <API key>(void)
{
<API key>(&tcp_scalable);
}
module_init(<API key>);
module_exit(<API key>);
MODULE_AUTHOR("John Heffner");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Scalable TCP");
|
#ifndef <API key>
#define <API key>
#include <linux/types.h>
/*
* If the UFFDIO_API is upgraded someday, the UFFDIO_UNREGISTER and
* UFFDIO_WAKE ioctls should be defined as _IOW and not as _IOR. In
* userfaultfd.h we assumed the kernel was reading (instead _IOC_READ
* means the userland is reading).
*/
#define UFFD_API ((__u64)0xAA)
#define UFFD_API_FEATURES (<API key> | \
<API key> | \
<API key> | \
<API key> | \
<API key> | \
<API key>)
#define UFFD_API_IOCTLS \
((__u64)1 << _UFFDIO_REGISTER | \
(__u64)1 << _UFFDIO_UNREGISTER | \
(__u64)1 << _UFFDIO_API)
#define <API key> \
((__u64)1 << _UFFDIO_WAKE | \
(__u64)1 << _UFFDIO_COPY | \
(__u64)1 << _UFFDIO_ZEROPAGE)
#define <API key> \
((__u64)1 << _UFFDIO_WAKE | \
(__u64)1 << _UFFDIO_COPY)
/*
* Valid ioctl command number range with this API is from 0x00 to
* 0x3F. UFFDIO_API is the fixed number, everything else can be
* changed by implementing a different UFFD_API. If sticking to the
* same UFFD_API more ioctl can be added and userland will be aware of
* which ioctl the running kernel implements through the ioctl command
* bitmask written by the UFFDIO_API.
*/
#define _UFFDIO_REGISTER (0x00)
#define _UFFDIO_UNREGISTER (0x01)
#define _UFFDIO_WAKE (0x02)
#define _UFFDIO_COPY (0x03)
#define _UFFDIO_ZEROPAGE (0x04)
#define _UFFDIO_API (0x3F)
/* userfaultfd ioctl ids */
#define UFFDIO 0xAA
#define UFFDIO_API _IOWR(UFFDIO, _UFFDIO_API, \
struct uffdio_api)
#define UFFDIO_REGISTER _IOWR(UFFDIO, _UFFDIO_REGISTER, \
struct uffdio_register)
#define UFFDIO_UNREGISTER _IOR(UFFDIO, _UFFDIO_UNREGISTER, \
struct uffdio_range)
#define UFFDIO_WAKE _IOR(UFFDIO, _UFFDIO_WAKE, \
struct uffdio_range)
#define UFFDIO_COPY _IOWR(UFFDIO, _UFFDIO_COPY, \
struct uffdio_copy)
#define UFFDIO_ZEROPAGE _IOWR(UFFDIO, _UFFDIO_ZEROPAGE, \
struct uffdio_zeropage)
/* read() structure */
struct uffd_msg {
__u8 event;
__u8 reserved1;
__u16 reserved2;
__u32 reserved3;
union {
struct {
__u64 flags;
__u64 address;
} pagefault;
struct {
__u32 ufd;
} fork;
struct {
__u64 from;
__u64 to;
__u64 len;
} remap;
struct {
__u64 start;
__u64 end;
} remove;
struct {
/* unused reserved fields */
__u64 reserved1;
__u64 reserved2;
__u64 reserved3;
} reserved;
} arg;
} __packed;
/*
* Start at 0x12 and not at 0 to be more strict against bugs.
*/
#define <API key> 0x12
#define UFFD_EVENT_FORK 0x13
#define UFFD_EVENT_REMAP 0x14
#define UFFD_EVENT_REMOVE 0x15
#define UFFD_EVENT_UNMAP 0x16
/* flags for <API key> */
#define <API key> (1<<0) /* If this was a write fault */
#define <API key> (1<<1) /* If reason is VM_UFFD_WP */
struct uffdio_api {
/* userland asks for an API number and the features to enable */
__u64 api;
/*
* Kernel answers below with the all available features for
* the API, this notifies userland of which events and/or
* which flags for each event are enabled in the current
* kernel.
*
* Note: <API key> and <API key>
* are to be considered implicitly always enabled in all kernels as
* long as the uffdio_api.api requested matches UFFD_API.
*
* <API key> means an UFFDIO_REGISTER
* with <API key> mode will succeed on
* hugetlbfs virtual memory ranges. Adding or not adding
* <API key> to uffdio_api.features has
* no real functional effect after UFFDIO_API returns, but
* it's only useful for an initial feature set probe at
* UFFDIO_API time. There are two ways to use it:
*
* 1) by adding <API key> to the
* uffdio_api.features before calling UFFDIO_API, an error
* will be returned by UFFDIO_API on a kernel without
* hugetlbfs missing support
*
* 2) the <API key> can not be added in
* uffdio_api.features and instead it will be set by the
* kernel in the uffdio_api.features if the kernel supports
* it, so userland can later check if the feature flag is
* present in uffdio_api.features after UFFDIO_API
* succeeded.
*
* <API key> works the same as
* <API key>, but it applies to shmem
* (i.e. tmpfs and other shmem based APIs).
*/
#define <API key> (1<<0)
#define <API key> (1<<1)
#define <API key> (1<<2)
#define <API key> (1<<3)
#define <API key> (1<<4)
#define <API key> (1<<5)
#define <API key> (1<<6)
__u64 features;
__u64 ioctls;
};
struct uffdio_range {
__u64 start;
__u64 len;
};
struct uffdio_register {
struct uffdio_range range;
#define <API key> ((__u64)1<<0)
#define <API key> ((__u64)1<<1)
__u64 mode;
/*
* kernel answers which ioctl commands are available for the
* range, keep at the end as the last 8 bytes aren't read.
*/
__u64 ioctls;
};
struct uffdio_copy {
__u64 dst;
__u64 src;
__u64 len;
/*
* There will be a wrprotection flag later that allows to map
* pages wrprotected on the fly. And such a flag will be
* available if the wrprotection ioctl are implemented for the
* range according to the uffdio_register.ioctls.
*/
#define <API key> ((__u64)1<<0)
__u64 mode;
/*
* "copy" is written by the ioctl and must be at the end: the
* copy_from_user will not read the last 8 bytes.
*/
__s64 copy;
};
struct uffdio_zeropage {
struct uffdio_range range;
#define <API key> ((__u64)1<<0)
__u64 mode;
/*
* "zeropage" is written by the ioctl and must be at the end:
* the copy_from_user will not read the last 8 bytes.
*/
__s64 zeropage;
};
#endif /* <API key> */
|
!function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e:t.interpolate=e()}(this,function(){"use strict";function t(t){"String"===e(t)&&(this.template=n(t))}function e(t){return Object.prototype.toString.call(t).slice(8,-1)}function n(t){return t.replace(/\s(?![^}}]*\{\{)/g,"")}return t.prototype.parse=function(t){if("Object"===e(t)){var n=this.template;for(var r in t){var i=new RegExp("{{"+r+"}}","g");i.test(n)&&(n=n.replace(i,t[r]))}return n}},function(e){var n=new t(e);return function(t){return n.parse(t)}}});
|
<?php
namespace Symfony\Component\Config\Definition\Builder;
use Symfony\Component\Config\Definition\EnumNode;
use Symfony\Component\Config\Definition\Builder\<API key>;
/**
* Enum Node Definition.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class EnumNodeDefinition extends <API key>
{
private $values;
public function values(array $values)
{
$values = array_unique($values);
if (count($values) <= 1) {
throw new \<API key>('->values() must be called with at least two distinct values.');
}
$this->values = $values;
return $this;
}
/**
* Instantiate a Node
*
* @return EnumNode The node
*
* @throws \RuntimeException
*/
protected function instantiateNode()
{
if (null === $this->values) {
throw new \RuntimeException('You must call ->values() on enum nodes.');
}
return new EnumNode($this->name, $this->parent, $this->values);
}
}
|
#!/bin/sh
test_description="Test the svn importer's input handling routines.
These tests provide some simple checks that the line_buffer API
behaves as advertised.
While at it, check that input of newlines and null bytes are handled
correctly.
"
. ./test-lib.sh
test_expect_success 'hello world' '
echo ">HELLO" >expect &&
test-line-buffer <<-\EOF >actual &&
binary 6
HELLO
EOF
test_cmp expect actual
'
test_expect_success '0-length read, send along greeting' '
echo ">HELLO" >expect &&
test-line-buffer <<-\EOF >actual &&
binary 0
copy 6
HELLO
EOF
test_cmp expect actual
'
test_expect_success 'read from file descriptor' '
rm -f input &&
echo hello >expect &&
echo hello >input &&
echo copy 6 |
test-line-buffer "&4" 4<input >actual &&
test_cmp expect actual
'
test_expect_success 'skip, copy null byte' '
echo Q | q_to_nul >expect &&
q_to_nul <<-\EOF | test-line-buffer >actual &&
skip 2
Q
copy 2
Q
EOF
test_cmp expect actual
'
test_expect_success 'read null byte' '
echo ">QhelloQ" | q_to_nul >expect &&
q_to_nul <<-\EOF | test-line-buffer >actual &&
binary 8
QhelloQ
EOF
test_cmp expect actual
'
test_expect_success 'long reads are truncated' '
echo ">foo" >expect &&
test-line-buffer <<-\EOF >actual &&
binary 5
foo
EOF
test_cmp expect actual
'
test_expect_success 'long copies are truncated' '
printf "%s\n" ">" foo >expect &&
test-line-buffer <<-\EOF >actual &&
binary 1
copy 5
foo
EOF
test_cmp expect actual
'
test_expect_success 'long binary reads are truncated' '
echo ">foo" >expect &&
test-line-buffer <<-\EOF >actual &&
binary 5
foo
EOF
test_cmp expect actual
'
test_done
|
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
do_action( '<API key>', $order, $sent_to_admin, $plain_text, $email );
echo strtoupper( sprintf( __( 'Order number: %s', 'woocommerce' ), $order->get_order_number() ) ) . "\n";
echo date_i18n( __( 'jS F Y', 'woocommerce' ), strtotime( $order->order_date ) ) . "\n";
echo "\n" . $order-><API key>( array(
'show_sku' => $sent_to_admin,
'show_image' => false,
'image_size' => array( 32, 32 ),
'plain_text' => true
) );
echo "==========\n\n";
if ( $totals = $order-><API key>() ) {
foreach ( $totals as $total ) {
echo $total['label'] . "\t " . $total['value'] . "\n";
}
}
if ( $sent_to_admin ) {
echo "\n" . sprintf( __( 'View order: %s', 'woocommerce'), admin_url( 'post.php?post=' . $order->id . '&action=edit' ) ) . "\n";
}
do_action( '<API key>', $order, $sent_to_admin, $plain_text, $email );
|
!function(a,b){function c(){function a(){"undefined"!=typeof _wpmejsSettings&&(c=b.extend(!0,{},_wpmejsSettings)),c.success=c.success||function(a){var b,c;"flash"===a.pluginType&&(b=a.attributes.autoplay&&"false"!==a.attributes.autoplay,c=a.attributes.loop&&"false"!==a.attributes.loop,b&&a.addEventListener("canplay",function(){a.play()},!1),c&&a.addEventListener("ended",function(){a.play()},!1))},b(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").filter(function(){return!b(this).parent().hasClass(".mejs-mediaelement")}).mediaelementplayer(c)}var c={};return{initialize:a}}a.wp=a.wp||{},mejs.plugins.silverlight[0].types.push("video/x-ms-wmv"),mejs.plugins.silverlight[0].types.push("audio/x-ms-wma"),a.wp.mediaelement=new c,b(a.wp.mediaelement.initialize)}(window,jQuery);
|
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports Microsoft.CodeAnalysis.Editor.VisualBasic.KeywordHighlighting
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.KeywordHighlighting
Public Class <API key>
Inherits <API key>
Friend Overrides Function CreateHighlighter() As IHighlighter
Return New <API key>()
End Function
<Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)>
Public Sub TestMultilineIf1()
Test(<Text><![CDATA[
Class C
Sub M()
{|Cursor:[|If|]|} a < b [|Then|]
a = b
[|ElseIf|] DateTime.Now.Ticks Mod 2 = 0
Throw New RandomException
[|Else|]
If a < b Then a = b Else b = a
[|End If|]
End Sub
End Class]]></Text>)
End Sub
<Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)>
Public Sub TestMultilineIf2()
Test(<Text><![CDATA[
Class C
Sub M()
[|If|] a < b {|Cursor:[|Then|]|}
a = b
[|ElseIf|] DateTime.Now.Ticks Mod 2 = 0
Throw New RandomException
[|Else|]
If a < b Then a = b Else b = a
[|End If|]
End Sub
End Class]]></Text>)
End Sub
<Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)>
Public Sub TestMultilineIf3()
Test(<Text><![CDATA[
Class C
Sub M()
[|If|] a < b [|Then|]
a = b
{|Cursor:[|ElseIf|]|} DateTime.Now.Ticks Mod 2 = 0
Throw New RandomException
[|Else|]
If a < b Then a = b Else b = a
[|End If|]
End Sub
End Class]]></Text>)
End Sub
<Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)>
Public Sub TestMultilineIf4()
Test(<Text><![CDATA[
Class C
Sub M()
[|If|] a < b [|Then|]
a = b
[|ElseIf|] DateTime.Now.Ticks Mod 2 = 0
Throw New RandomException
[|{|Cursor:Else|}|]
If a < b Then a = b Else b = a
[|End If|]
End Sub
End Class]]></Text>)
End Sub
<Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)>
Public Sub TestMultilineIf5()
Test(<Text><![CDATA[
Class C
Sub M()
[|If|] a < b [|Then|]
a = b
[|ElseIf|] DateTime.Now.Ticks Mod 2 = 0
Throw New RandomException
[|Else|]
If a < b Then a = b Else b = a
{|Cursor:[|End If|]|}
End Sub
End Class]]></Text>)
End Sub
<WorkItem(542614)>
<Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)>
Public Sub TestMultilineIf6()
Test(<Text><![CDATA[
Imports System
Module M
Sub C()
Dim x As Integer = 5
[|If|] x < 0 [|Then|]
{|Cursor:[|Else If|]|}
[|End If|]
End Sub
End Module]]></Text>)
End Sub
End Class
End Namespace
|
#ifndef CHIP_OSC_H_INCLUDED
#define CHIP_OSC_H_INCLUDED
#include "board.h"
#include "pmc.h"
@cond 0
/**INDENT-OFF**/
#ifdef __cplusplus
extern "C" {
#endif
/**INDENT-ON**/
@endcond
/**
* \weakgroup osc_group
* @{
*/
//! \name Oscillator identifiers
#define OSC_SLCK_32K_RC 0 //!< Internal 32kHz RC oscillator.
#define OSC_SLCK_32K_XTAL 1 //!< External 32kHz crystal oscillator.
#define OSC_SLCK_32K_BYPASS 2 //!< External 32kHz bypass oscillator.
#define OSC_MAINCK_8M_RC 3 //!< Internal 8MHz RC oscillator.
#define OSC_MAINCK_16M_RC 4 //!< Internal 16MHz RC oscillator.
#define OSC_MAINCK_24M_RC 5 //!< Internal 24MHz RC oscillator.
#define OSC_MAINCK_XTAL 6 //!< External crystal oscillator.
#define OSC_MAINCK_BYPASS 7 //!< External bypass oscillator.
//! \name Oscillator clock speed in hertz
#define OSC_SLCK_32K_RC_HZ CHIP_FREQ_SLCK_RC //!< Internal 32kHz RC oscillator.
#define <API key> <API key> //!< External 32kHz crystal oscillator.
#define <API key> <API key> //!< External 32kHz bypass oscillator.
#define OSC_MAINCK_8M_RC_HZ <API key> //!< Internal 8MHz RC oscillator.
#define <API key> <API key> //!< Internal 16MHz RC oscillator.
#define <API key> <API key> //!< Internal 24MHz RC oscillator.
#define OSC_MAINCK_XTAL_HZ <API key> //!< External crystal oscillator.
#define <API key> <API key> //!< External bypass oscillator.
static inline void osc_enable(uint32_t ul_id)
{
switch (ul_id) {
case OSC_SLCK_32K_RC:
break;
case OSC_SLCK_32K_XTAL:
<API key>(PMC_OSC_XTAL);
break;
case OSC_SLCK_32K_BYPASS:
<API key>(PMC_OSC_BYPASS);
break;
case OSC_MAINCK_8M_RC:
<API key>(<API key>);
break;
case OSC_MAINCK_16M_RC:
<API key>(<API key>);
break;
case OSC_MAINCK_24M_RC:
<API key>(<API key>);
break;
case OSC_MAINCK_XTAL:
<API key>(PMC_OSC_XTAL,
pmc_us_to_moscxtst(<API key>,
OSC_SLCK_32K_RC_HZ));
break;
case OSC_MAINCK_BYPASS:
<API key>(PMC_OSC_BYPASS,
pmc_us_to_moscxtst(<API key>,
OSC_SLCK_32K_RC_HZ));
break;
}
}
static inline void osc_disable(uint32_t ul_id)
{
switch (ul_id) {
case OSC_SLCK_32K_RC:
case OSC_SLCK_32K_XTAL:
case OSC_SLCK_32K_BYPASS:
break;
case OSC_MAINCK_8M_RC:
case OSC_MAINCK_16M_RC:
case OSC_MAINCK_24M_RC:
<API key>();
break;
case OSC_MAINCK_XTAL:
<API key>(PMC_OSC_XTAL);
break;
case OSC_MAINCK_BYPASS:
<API key>(PMC_OSC_BYPASS);
break;
}
}
static inline bool osc_is_ready(uint32_t ul_id)
{
switch (ul_id) {
case OSC_SLCK_32K_RC:
return 1;
case OSC_SLCK_32K_XTAL:
case OSC_SLCK_32K_BYPASS:
return <API key>();
case OSC_MAINCK_8M_RC:
case OSC_MAINCK_16M_RC:
case OSC_MAINCK_24M_RC:
case OSC_MAINCK_XTAL:
case OSC_MAINCK_BYPASS:
return <API key>();
}
return 0;
}
static inline uint32_t osc_get_rate(uint32_t ul_id)
{
switch (ul_id) {
case OSC_SLCK_32K_RC:
return OSC_SLCK_32K_RC_HZ;
#ifdef <API key>
case OSC_SLCK_32K_XTAL:
return <API key>;
#endif
#ifdef <API key>
case OSC_SLCK_32K_BYPASS:
return <API key>;
#endif
case OSC_MAINCK_8M_RC:
return OSC_MAINCK_8M_RC_HZ;
case OSC_MAINCK_16M_RC:
return <API key>;
case OSC_MAINCK_24M_RC:
return <API key>;
#ifdef <API key>
case OSC_MAINCK_XTAL:
return <API key>;
#endif
#ifdef <API key>
case OSC_MAINCK_BYPASS:
return <API key>;
#endif
}
return 0;
}
@cond 0
/**INDENT-OFF**/
#ifdef __cplusplus
}
#endif
/**INDENT-ON**/
@endcond
#endif /* CHIP_OSC_H_INCLUDED */
|
/* filename: main.c */
#include "issp_revision.h"
#ifdef PROJECT_REV_304
/*/////////////////////////////////////////////////////////////////////////////
// PROJECT HISTORY
// date revision author description
// 7/23/08 3.04 ptj 1. CPU clock speed set to to 12MHz (default) after
// TSYNC is disabled. Previously, it was being set
// to 3MHz on accident. This affects the following
// mnemonics:
// ID_SETUP_1,
// VERIFY_SETUP,
// ERASE,
// SECURE,
// CHECKSUM_SETUP,
// PROGRAM_AND_VERIFY,
// ID_SETUP_2,
// SYNC_DISABLE
// 6/06/08 3.03 ptj 1. The Verify_Setup section can tell when flash
// is fully protected. bTargetStatus[0] shows a
// 01h when flash is "W" Full Protection
// 7/23/08 2. READ-ID-WORD updated to read Revision ID from
// Accumulator A and X, registers T,F0h and T,F3h
// 5/30/08 3.02 ptj 1. All vectors work.
// 2. Main function will execute the
// following programming sequence:
// . id setup 1
// . id setup 2
// . erase
// . program and verify
// . verify (although not necessary)
// . secure flash
// . read security
// . checksum
// 05/28/08 3.01 ptj TEST CODE - NOT COMPLETE
// 1. The sequence surrounding PROGRAM-AND-VERIFY was
// improved and works according to spec.
// 2. The sequence surroudning VERIFY-SETUP was devel-
// oped and improved.
// 3. TSYNC Enable is used to in a limited way
// 4. Working Vectors: ID-SETUP-1, ID-SETUP-2, ERASE,
// PROGRAM-AND-VERIFY, SECURE, VERIFY-SETUP,
// CHECKSUM-SETUP
// 5. Un-tested Vectors: READ-SECURITY
// 05/23/08 3.00 ptj TEST CODE - NOT COMPLETE
// 1. This code is a test platform for the development
// of the Krypton (cy8c20x66) Programming Sequence.
// See 001-15870 rev *A. This code works on "rev B"
// silicon.
// 2. Host is Hydra 29000, Target is Krypton "rev B"
// 3. Added Krypton device support
// 4. TYSNC Enable/Disable is not used.
// 5. Working Vectors: ID-SETUP-1, ID-SETUP-2, ERASE,
// PROGRAM-AND-VERIFY, SECURE
// 6. Non-working Vectors: CHECKSUM-SETUP
// 7. Un-tested Vectors: READ-SECURITY, VERIFY-SETUP
// 8. Other minor (non-SROM) vectors not listed.
// 09/23/07 2.11 dkn 1. Added searchable comments for the HSSP app note.
// 2. Added new device vectors.
// 3. Verified write and erase pulsewidths.
// 4. Modified some functions for easier porting to
// other processors.
// 09/23/06 2.10 mwl 1. Added #define <API key> to
// file issp_defs.h. Modified function
// <API key>() in issp_routines.c
// to use new #define. Modified function
// fLoadSecurityData() in <API key>.c
// to accept a bank number. Modified the secure
// data loop in main.c to program multiple banks.
// 2. Created function <API key> to
// read and add the target bank checksum to the
// referenced accumulator. This allows the
// checksum loop in main.c to function at the
// same level of abstraction as the other
// programming steps. Accordingly, modified the
// checksum loop in main.c. Deleted previous
// function <API key>().
// 09/08/06 2.00 mwl 1. Array variable abTargetDataOUT was not
// getting intialized anywhere and compiled as a
// one-byte array. Modified <API key>.c
// line 44 to initialize with TARGET_DATABUFF_LEN.
// 2. Function void LoadProgramData(unsigned char
// bBlockNum) in <API key>.c had only
// one parameter bBlockNum but was being called
// from function main() with two parameters,
// LoadProgramData(bBankCounter, (unsigned char)
// iBlockCounter). Modified function
// LoadProgramData() to accept both parameters,
// and in turn modified InitTargetTestData() to
// accept and use both as well.
// 3. Corrected byte set_bank_number[1]
// inissp_vectors.h. Was 0xF2, correct value is
// 0xE2.
// 4. Corrected the logic to send the SET_BANK_NUM
// vectors per the AN2026B flow chart.The previous
// code version was sending once per block, but
// should have been once per bank. Removed the
// <API key> bank setting code blocks
// from the top of fProgramTargetBlock() and
// fVerifyTargetBlock() int issp_routines.c and
// created a <API key> subroutine in
// that same file called SetBankNumber(). Two
// <API key> calls to SetBankNumber()
// were added to main.c().
// 5. Corrected CY8C29x66 NUM_BANKS and
// BLOCKS_PER_BANK definitions in ISSP_Defs.h.
// Was 2 and 256 respectively, correct values are
// 4 and 128.
// 6. Modified function <API key>()
// in issp_routines.c to read and accumulate multiple
// banks of checksums as required for targets
// CY8C24x94 and CY8C29x66. Would have kept same
// level of abstraction as other multi-bank functions
// in main.c, but this implementation impacted the
// code the least.
// 7. Corrected byte checksum_v[26] of
// <API key> in issp_vectors.h. Was 0x02,
// correct value is 0x04.
// 06/30/06 1.10 jvy Added support for 24x94 and 29x66 devices.
// 06/09/06 1.00 jvy Changed CPU Clk to 12MHz (from 24MHz) so the
// host can run from 3.3V.
// Simplified init of security data.
// 06/05/06 0.06 jvy Version #ifdef added to each file to make sure
// all of the file are from the same revision.
// Added flags to prevent multiple includes of H
// files.
// Changed pre-determined data for demo to be
// unique for each block.
// Changed block verify to check all blocks after
// block programming has been completed.
// Added SetSCLKHiZ to explicitly set the Clk to
// HighZ before power cycle acquire.
// Fixed wrong vectors in setting Security.
// Fixed wrong vectors in Block program.
// Added support for pods
// 06/05/06 0.05 jvy Comments from code review. First copy checked
// into perforce. Code has been updated enough to
// compile, by implementing some comments and
// fixing others.
// 06/04/06 0.04 jvy made code more efficient in bReceiveByte(), and
// SendVector() by re-arranging so that local vars
// could be eliminated.
// added defines for the delays used in the code.
// 06/02/06 0.03 jvy added number of Flash block adjustment to
// programming. added power cycle programming
// mode support. This is the version initially
// sent out for peer review.
// 06/02/06 0.02 jvy added framework for multiple chip support from
// one source code set using compiler directives.
// added timeout to high-low trasition detection.
// added multiple error message to allow tracking
// of failures.
// 05/30/06 0.01 jvy initial version,
// created from DBD's issp_27xxx_v3 program.
//////////////////////////////////////////////////////////////////////////*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/sched.h>
#include <linux/pm.h>
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
#include <linux/delay.h>
#include <linux/input.h>
#include <plat/gpio-nomadik.h>
/* #include <mach/regs-gpio.h> */
/* #include <plat/gpio-cfg.h> */
#include <asm/gpio.h>
#include <asm/uaccess.h>
#include <asm/io.h>
/* #include <m8c.h> // part specific constants and macros */
/* #include "PSoCAPI.h" // PSoC API definitions for all User Modules */
#include "issp_extern.h"
#include "issp_directives.h"
#include "issp_defs.h"
#include "issp_errors.h"
#include "u8500-cypress-gpio.h"
unsigned char bBankCounter;
unsigned int iBlockCounter;
unsigned int iChecksumData;
unsigned int iChecksumTarget;
/* update version "eclair/vendor/samsung/apps/Lcdtest/src/com/sec/android/app/lcdtest/touch_firmware.java" */
unsigned char firmware_data0[] = { /* 111226 HW08 SW0B */
0x40, 0x7d, 0x00, 0x68, 0x30, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7d, 0x00, 0x68, 0x7e, 0x7e, 0x30, 0x30, 0x30, 0x7d, 0x04, 0xac, 0x7e, 0x7e, 0x30, 0x30, 0x30, 0x7d, 0x05, 0xf9, 0x7e, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30
, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x40, 0x71, 0x10, 0x62, 0xe3, 0x06, 0x70, 0xef, 0x62, 0xe3, 0x38, 0x50, 0x80, 0x4e, 0x62, 0xe3, 0x38, 0x5d, 0xd5, 0x08, 0x62, 0xd5, 0x00, 0x55
, 0xfa, 0x01, 0x40, 0x4f, 0x5b, 0x01, 0x03, 0x53, 0xf9, 0x55, 0xf8, 0x3a, 0x50, 0x06, 0x00, 0x40, 0x40, 0x71, 0x10, 0x51, 0xfa, 0x60, 0xe8, 0x70, 0xef, 0x18, 0x60, 0xd5, 0x55, 0xf8, 0x00, 0x55, 0xf9, 0x00, 0x71, 0x10, 0x62, 0xe0, 0x1a, 0x70, 0xef, 0x62, 0xe3, 0x38, 0x71, 0x10, 0x41, 0xe1, 0xfe, 0x70, 0xef, 0x62, 0xe3, 0x38, 0x62, 0xd1, 0x03, 0x50, 0x80, 0x4e, 0x62, 0xd3, 0x03, 0x62
, 0xd0, 0x00, 0x62, 0xd5, 0x00, 0x62, 0xd4, 0x00, 0x71, 0xc0, 0x7c, 0x03, 0x19, 0x62, 0xd0, 0x00, 0x50, 0x01, 0x57, 0xc0, 0x08, 0x28, 0x53, 0x5d, 0x18, 0x75, 0x09, 0x00, 0x28, 0x4b, 0x51, 0x5d, 0x80, 0x04, 0x75, 0x09, 0x00, 0x62, 0xe3, 0x00, 0x08, 0x28, 0x60, 0xd5, 0x74, 0xa0, 0x4b, 0x18, 0x75, 0x09, 0x00, 0x08, 0x28, 0x53, 0x5d, 0x18, 0x75, 0x09, 0x00, 0x08, 0x28, 0xa0, 0x1c, 0x53
, 0x5c, 0x18, 0x75, 0x09, 0x00, 0x08, 0x28, 0x3f, 0x5d, 0x47, 0x5d, 0xff, 0xb0, 0x06, 0x5d, 0xd5, 0x74, 0x60, 0xd5, 0x18, 0x7a, 0x5c, 0xbf, 0xeb, 0x8f, 0xc9, 0x18, 0x75, 0x09, 0x00, 0x08, 0x28, 0x53, 0x5c, 0x50, 0x00, 0x3f, 0x5d, 0x47, 0x5d, 0xff, 0xb0, 0x08, 0x5d, 0xd5, 0x74, 0x60, 0xd5, 0x50, 0x00, 0x7a, 0x5c, 0xbf, 0xef, 0x18, 0x8f, 0xaa, 0x18, 0x71, 0x10, 0x43, 0xe3, 0x00, 0x70
, 0xef, 0x62, 0xe0, 0x00, 0x41, 0xfe, 0xe7, 0x43, 0xfe, 0x10, 0x71, 0x10, 0x43, 0xe9, 0x20, 0x62, 0xe0, 0x1a, 0x70, 0xef, 0x62, 0xe2, 0x00, 0x7c, 0x19, 0x80, 0x8f, 0xff, 0x7f, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x01, 0x99, 0x03, 0x33, 0x06, 0x66, 0x0c, 0xcc, 0x19, 0x99, 0x33, 0x33, 0x66, 0x66, 0xcc, 0xcc
, 0x01, 0x80, 0x03, 0x00, 0x06, 0x00, 0x0b, 0xff, 0x18, 0x00, 0x2f, 0xff, 0x5f, 0xff, 0xbf, 0xff, 0x01, 0x66, 0x02, 0xcc, 0x05, 0x99, 0x0b, 0x32, 0x16, 0x66, 0x2c, 0xcc, 0x59, 0x98, 0xb3, 0x32, 0x01, 0x4c, 0x02, 0x99, 0x05, 0x33, 0x0a, 0x66, 0x14, 0xcc, 0x29, 0x90, 0x53, 0x33, 0xa6, 0x66, 0x01, 0x33, 0x02, 0x66, 0x04, 0xcc, 0x09, 0x99, 0x13, 0x33, 0x26, 0x65, 0x4c, 0xcc, 0x99, 0x99
, 0x1c, 0x06, 0x70, 0xef, 0x62, 0x61, 0x00, 0x62, 0xfd, 0x00, 0x62, 0xcd, 0x00, 0x62, 0xce, 0x00, 0x62, 0xa5, 0x00, 0x62, 0xa4, 0x00, 0x62, 0xa0, 0x00, 0x62, 0xa1, 0x80, 0x62, 0xa2, 0xc0, 0x62, 0xa3, 0x0c, 0x62, 0xa8, 0x00, 0x62, 0xa6, 0x00, 0x62, 0xa7, 0x00, 0x62, 0x7c, 0x33, 0x62, 0x7a, 0x00, 0x62, 0x7b, 0x00, 0x62, 0x79, 0x00, 0x62, 0x36, 0x00, 0x62, 0x37, 0x00, 0x62, 0x38, 0x00
, 0x62, 0x39, 0x00, 0x62, 0x3a, 0x00, 0x62, 0x3b, 0x00, 0x62, 0x3c, 0x00, 0x62, 0x3d, 0x00, 0x62, 0x3e, 0x00, 0x62, 0x3f, 0x00, 0x62, 0x40, 0x00, 0x62, 0x41, 0x00, 0x62, 0x42, 0x00, 0x62, 0x43, 0x00, 0x62, 0x44, 0x00, 0x62, 0x45, 0x00, 0x62, 0x46, 0x00, 0x62, 0x47, 0x00, 0x62, 0x48, 0x00, 0x62, 0x49, 0x00, 0x62, 0x4a, 0x00, 0x62, 0x4b, 0x00, 0x62, 0x4c, 0x00, 0x62, 0x4d, 0x00, 0x62
, 0x4e, 0x00, 0x62, 0x4f, 0x00, 0x62, 0xca, 0x20, 0x62, 0xd6, 0x44, 0x62, 0xcf, 0x00, 0x62, 0xcb, 0x00, 0x62, 0xc8, 0x00, 0x62, 0xcc, 0x00, 0x62, 0xc9, 0x00, 0x62, 0xd7, 0x00, 0x62, 0xa9, 0x00, 0x62, 0x2b, 0x00, 0x62, 0xb0, 0x00, 0x62, 0xb3, 0x02, 0x62, 0xb6, 0x00, 0x62, 0xb2, 0x00, 0x62, 0xb5, 0x00, 0x62, 0xb8, 0x00, 0x62, 0xb1, 0x00, 0x62, 0xb4, 0x00, 0x62, 0xb7, 0x00, 0x62, 0x33
, 0x00, 0x62, 0x34, 0x00, 0x62, 0x35, 0x00, 0x71, 0x10, 0x62, 0x54, 0x00, 0x62, 0x55, 0x00, 0x62, 0x56, 0x00, 0x62, 0x57, 0x00, 0x62, 0x58, 0x00, 0x62, 0x59, 0x00, 0x62, 0x5a, 0x00, 0x62, 0x5b, 0x00, 0x62, 0xdc, 0x00, 0x62, 0xe2, 0x00, 0x62, 0xdd, 0x00, 0x62, 0xd8, 0x02, 0x62, 0xd9, 0x20, 0x62, 0xda, 0x20, 0x62, 0xdb, 0x00, 0x62, 0xdf, 0x00, 0x62, 0x29, 0x00, 0x62, 0x30, 0x00, 0x62
, 0xbd, 0x00, 0x70, 0xef, 0x70, 0xef, 0x62, 0x00, 0x00, 0x71, 0x10, 0x62, 0x00, 0x08, 0x62, 0x01, 0x92, 0x70, 0xef, 0x62, 0x04, 0x17, 0x71, 0x10, 0x62, 0x04, 0x17, 0x62, 0x05, 0xab, 0x70, 0xef, 0x62, 0x08, 0x00, 0x71, 0x10, 0x62, 0x08, 0x00, 0x62, 0x09, 0x28, 0x70, 0xef, 0x62, 0x0c, 0x00, 0x71, 0x10, 0x62, 0x0c, 0x00, 0x62, 0x0d, 0x00, 0x70, 0xef, 0x62, 0x10, 0x00, 0x71, 0x10, 0x62
, 0x10, 0x00, 0x62, 0x11, 0x00, 0x70, 0xef, 0x62, 0x01, 0x00, 0x62, 0x05, 0x00, 0x62, 0x09, 0x00, 0x62, 0x0d, 0x00, 0x62, 0x11, 0x00, 0x70, 0xef, 0x7f, 0x55, 0x02, 0x00, 0x55, 0x03, 0x17, 0x55, 0x04, 0x00, 0x7c, 0x03, 0x26, 0x7f, 0x7c, 0x01, 0xc2, 0x70, 0xef, 0x7f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x62, 0xd0, 0x00, 0x53
, 0x00, 0x71, 0x10, 0x5d, 0xe0, 0x08, 0x21, 0xf8, 0x29, 0x00, 0x70, 0xfe, 0x60, 0xe0, 0x70, 0xef, 0x4b, 0x4b, 0x4b, 0x4b, 0x51, 0x02, 0x21, 0xf7, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08
, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05
, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x47, 0x00, 0x00, 0x49, 0x01, 0x00, 0x29, 0x08, 0x60, 0x00, 0x57, 0x01, 0x79, 0xbf, 0xfe, 0x18, 0x71, 0x10, 0x60, 0xe0, 0x70, 0xef, 0x71, 0x01, 0x7f, 0x08, 0x67, 0x67, 0x67, 0x67, 0x21, 0x0f, 0xff, 0x40, 0x9f, 0x4e, 0x18, 0x21, 0x0f, 0xff, 0x39, 0x9f, 0x47, 0x7f, 0x08, 0x10, 0x28, 0xa0, 0x0b, 0x9f, 0x3f, 0x20, 0x18, 0x75
, 0xdf, 0xf5, 0x74, 0x8f, 0xf2, 0x38, 0xfe, 0x7f, 0x52, 0x00, 0xa0, 0x08, 0x10, 0x9f, 0x2d, 0x20, 0x75, 0x8f, 0xf6, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x50, 0x0d, 0x9f, 0x20, 0x50, 0x0a, 0x9f, 0x1c, 0x7f, 0x70, 0xbf, 0x62, 0xd3, 0x03, 0x4f, 0x52, 0xfb, 0xa0, 0x15, 0x7b, 0xfb, 0x52, 0xfc, 0x59, 0xfd, 0x60, 0xd3, 0x52, 0x00, 0x9f, 0x05, 0x4f, 0x62, 0xd3, 0x03, 0x77, 0xfd, 0x8f, 0xe9, 0x70
, 0x3f, 0x71, 0xc0, 0x7f, 0x3d, 0xfa, 0x00, 0xb0, 0x06, 0x3d, 0xfb, 0x00, 0xa0, 0x18, 0x10, 0x52, 0xfc, 0x59, 0xfd, 0x28, 0x9e, 0xe6, 0x20, 0x07, 0xfd, 0x01, 0x0f, 0xfc, 0x00, 0x17, 0xfb, 0x01, 0x1f, 0xfa, 0x00, 0x8f, 0xe0, 0x7f, 0x50, 0x01, 0x80, 0x03, 0x50, 0x00, 0x62, 0xd0, 0x00, 0x29, 0x00, 0xa0, 0x06, 0x26, 0x03, 0xfb, 0x80, 0x04, 0x2e, 0x03, 0x04, 0x51, 0x03, 0x60, 0x04, 0x70
, 0x3f, 0x71, 0xc0, 0x7f, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x50, 0x01, 0x80, 0x03, 0x50, 0x00, 0x62, 0xd0, 0x00, 0x29, 0x00, 0xa0, 0x06, 0x26, 0x03, 0xef, 0x80, 0x04, 0x2e, 0x03, 0x10, 0x51, 0x03, 0x60, 0x04, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x08, 0x10, 0x70, 0x3f, 0x71, 0x80, 0x5d, 0xd3, 0x08, 0x5d, 0xd0, 0x08, 0x62, 0xd0, 0x00, 0x51, 0x08, 0x60, 0xd3, 0x2e
, 0x05, 0x80, 0x49, 0xd7, 0x08, 0xa0, 0x09, 0x26, 0x05, 0xf0, 0x2e, 0x05, 0x00, 0x80, 0x08, 0x49, 0xd7, 0x20, 0xa0, 0x03, 0x80, 0xa6, 0x51, 0x05, 0x21, 0x0e, 0xe0, 0x01, 0x80, 0x11, 0x80, 0x67, 0x80, 0x79, 0x80, 0x47, 0x80, 0x96, 0x80, 0x94, 0x80, 0x92, 0x80, 0x90, 0x80, 0x97, 0x5d, 0xd8, 0x21, 0xfe, 0x39, 0x40, 0xa0, 0x06, 0x62, 0xd7, 0x00, 0x80, 0x8a, 0x49, 0xd8, 0x01, 0xb0, 0x0f
, 0x55, 0x0c, 0x02, 0x26, 0x05, 0xf0, 0x2e, 0x05, 0x02, 0x62, 0xd7, 0x10, 0x80, 0x77, 0x55, 0x0c, 0x01, 0x26, 0x05, 0xf0, 0x2e, 0x05, 0x06, 0x5f, 0x07, 0x06, 0x51, 0x09, 0x02, 0x07, 0x5c, 0x52, 0x00, 0x60, 0xd8, 0x76, 0x07, 0x62, 0xd7, 0x14, 0x80, 0x5b, 0x51, 0x0a, 0x78, 0x3a, 0x07, 0xc0, 0x0f, 0x51, 0x09, 0x02, 0x07, 0x5c, 0x52, 0x00, 0x60, 0xd8, 0x76, 0x07, 0x2e, 0x05, 0x20, 0x60
, 0xd8, 0x62, 0xd7, 0x04, 0x80, 0x3f, 0x5d, 0xd8, 0x3a, 0x0a, 0xd0, 0x2b, 0xa0, 0x29, 0x53, 0x07, 0x53, 0x06, 0x26, 0x05, 0xf0, 0x2e, 0x05, 0x04, 0x80, 0x18, 0x51, 0x0b, 0x78, 0x3a, 0x07, 0xc0, 0x16, 0x51, 0x09, 0x02, 0x07, 0x5c, 0x5d, 0xd8, 0x54, 0x00, 0x2e, 0x05, 0x10, 0x76, 0x07, 0x80, 0x01, 0x62, 0xd7, 0x10, 0x80, 0x0f, 0x62, 0xd7, 0x00, 0x80, 0x0a, 0x26, 0x05, 0xf0, 0x2e, 0x05
, 0x00, 0x55, 0x0c, 0x00, 0x18, 0x60, 0xd0, 0x18, 0x60, 0xd3, 0x20, 0x18, 0x7e, 0x62, 0xd0, 0x00, 0x71, 0x10, 0x41, 0x04, 0xfc, 0x43, 0x05, 0x03, 0x70, 0xef, 0x26, 0x03, 0xfc, 0x51, 0x03, 0x60, 0x04, 0x55, 0x0c, 0x00, 0x90, 0x28, 0x90, 0x2d, 0x40, 0x40, 0x40, 0x40, 0x40, 0x50, 0x00, 0x53, 0x06, 0x71, 0x10, 0x43, 0x04, 0x03, 0x43, 0x05, 0x03, 0x70, 0xef, 0x2e, 0x03, 0x03, 0x51, 0x03
, 0x60, 0x04, 0x7f, 0x62, 0xd0, 0x00, 0x51, 0x05, 0x21, 0xb0, 0x26, 0x05, 0x4f, 0x7f, 0x41, 0xe0, 0x7f, 0x43, 0xe0, 0x80, 0x7f, 0x43, 0xd6, 0x31, 0x7f, 0x41, 0xe0, 0x7f, 0x41, 0xd6, 0xfe, 0x7f, 0x62, 0xd0, 0x00, 0x4f, 0x52, 0xfd, 0x53, 0x0a, 0x52, 0xfc, 0x53, 0x0b, 0x52, 0xfb, 0x53, 0x09, 0x52, 0xfa, 0x53, 0x08, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x08, 0x5d, 0xa4, 0x04, 0x1b, 0x5d, 0xa5
, 0x0c, 0x1a, 0x55, 0x1c, 0x01, 0x18, 0x7e, 0x70, 0xbf, 0x62, 0xd0, 0x00, 0x70, 0xbf, 0x53, 0x1e, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x98, 0x62, 0xd3, 0x00, 0x13, 0x90, 0x62, 0xd3, 0x00, 0x54, 0x94, 0x62, 0xd3, 0x00, 0x52, 0x97, 0x62, 0xd3, 0x00, 0x1b, 0x8f, 0x62, 0xd3, 0x00, 0x54, 0x93, 0x48, 0x93, 0x80, 0xb0, 0x33, 0x3d, 0x93, 0x00, 0xb0, 0x7b, 0x51, 0x0d, 0x3b, 0x94, 0xc0, 0x75
, 0x52, 0x94, 0x58, 0x1e, 0x01, 0x00, 0x6d, 0x62, 0xd3, 0x00, 0x05, 0x5e, 0xc0, 0x09, 0x51, 0x0f, 0x3b, 0x5e, 0xd0, 0x12, 0xa0, 0x10, 0x56, 0x5e, 0x00, 0x5b, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x07, 0x90, 0x01, 0x0f, 0x8f, 0x00, 0x80, 0x41, 0x3d, 0x93, 0xff, 0xb0, 0x09, 0x50, 0xff, 0x12, 0x0e, 0x3b, 0x94, 0xc0, 0x20, 0x62, 0xd3, 0x00, 0x56, 0x94, 0x00, 0x56, 0x93, 0x00, 0x5b, 0x67, 0x5c
, 0x62, 0xd3, 0x00, 0x52, 0x65, 0x78, 0xd0, 0x03, 0x50, 0x00, 0x54, 0x65, 0x08, 0x5b, 0x64, 0x5c, 0x18, 0xb0, 0x2c, 0x62, 0xd3, 0x00, 0x52, 0x98, 0x62, 0xd3, 0x00, 0x54, 0x90, 0x62, 0xd3, 0x00, 0x52, 0x97, 0x62, 0xd3, 0x00, 0x54, 0x8f, 0x51, 0x1e, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x56, 0x94, 0x00, 0x56, 0x93, 0x00, 0x5b, 0x67, 0x5c, 0x62, 0xd3, 0x00, 0x51, 0x12, 0x54, 0x65, 0x70, 0x3f
, 0x71, 0xc0, 0x7f, 0x70, 0xbf, 0x62, 0xd0, 0x00, 0x70, 0xbf, 0x08, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x60, 0x53, 0x19, 0x55, 0x18, 0x00, 0x18, 0x08, 0x90, 0x7e, 0x62, 0xd3, 0x00, 0x23, 0x62, 0xb0, 0x2c, 0x51, 0x10, 0x04, 0x19, 0x0e, 0x18, 0x00, 0x18, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x94, 0x12, 0x19, 0x52, 0x93, 0x1a, 0x18, 0xc0, 0x39, 0x5b, 0x67, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x63
, 0x78, 0x54, 0x63, 0x08, 0x5b, 0x64, 0x5c, 0x18, 0xb0, 0x3e, 0x80, 0x18, 0x51, 0x10, 0x14, 0x19, 0x1e, 0x18, 0x00, 0x18, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x94, 0x12, 0x19, 0x52, 0x93, 0x1a, 0x18, 0xc0, 0x0e, 0x5b, 0x67, 0x90, 0x31, 0x62, 0xd3, 0x00, 0x2d, 0x62, 0x50, 0x01, 0x80, 0x24, 0x5b, 0x67, 0x08, 0x90, 0x23, 0x73, 0x62, 0xd3, 0x00, 0x25, 0x62, 0x62, 0xd3, 0x00, 0x20, 0x51
, 0x11, 0x54, 0x63, 0x50, 0x00, 0x80, 0x0d, 0x5b, 0x67, 0x90, 0x0d, 0x73, 0x62, 0xd3, 0x00, 0x25, 0x62, 0x50, 0x00, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x08, 0x67, 0x67, 0x67, 0x5c, 0x18, 0x21, 0x07, 0xf0, 0x01, 0x7f, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x70, 0xbf, 0x70, 0xbf, 0x62, 0xd3, 0x00, 0x50, 0x02, 0x78, 0x08, 0x5c, 0x56, 0x60, 0x28, 0x18, 0x78, 0xdf, 0xf8, 0x70, 0x3f
, 0x71, 0xc0, 0x7f, 0x08, 0x91, 0xaf, 0x70, 0xbf, 0x18, 0x08, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x98, 0x62, 0xd3, 0x00, 0x54, 0x90, 0x62, 0xd3, 0x00, 0x52, 0x97, 0x62, 0xd3, 0x00, 0x54, 0x8f, 0x18, 0x78, 0xdf, 0xe0, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x62, 0xd0, 0x00, 0x55, 0x14, 0x00, 0x50, 0x02, 0x78, 0x08, 0x9f, 0x0e, 0x39, 0x01, 0xb0, 0x04, 0x55, 0x14, 0x01, 0x18, 0x78, 0xdf, 0xf3
, 0x51, 0x14, 0x7f, 0x08, 0x9e, 0x41, 0x18, 0x78, 0xdf, 0xfa, 0x7f, 0x98, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0xd8, 0xd9, 0xda, 0xdb, 0xdf, 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff, 0x70, 0xbf, 0x62, 0xd0, 0x00, 0x62, 0xd3, 0x00, 0x57, 0x00, 0x56, 0x62, 0x00, 0x79, 0xdf, 0xfb, 0x62, 0xd3, 0x00, 0x57, 0x01, 0x50, 0x03, 0x54, 0x63, 0x79, 0xdf, 0xfc, 0x62, 0xd3
, 0x00, 0x50, 0x14, 0x57, 0x01, 0x54, 0x65, 0x79, 0xdf, 0xfc, 0x70, 0x3f, 0x71, 0xc0, 0x55, 0x0d, 0x14, 0x55, 0x0e, 0x05, 0x55, 0x0f, 0x14, 0x55, 0x10, 0x01, 0x55, 0x11, 0x03, 0x55, 0x12, 0x14, 0x55, 0x22, 0x04, 0x55, 0x1f, 0x14, 0x43, 0x61, 0x0d, 0x57, 0x00, 0x50, 0x02, 0x90, 0xae, 0x50, 0x04, 0xff, 0x98, 0x29, 0x00, 0x60, 0xa9, 0x62, 0xa0, 0x08, 0x43, 0xa2, 0x04, 0x62, 0xa3, 0x70
, 0x43, 0x7a, 0x01, 0x43, 0xaa, 0x02, 0x43, 0xdf, 0x01, 0x50, 0x01, 0x57, 0x09, 0x90, 0x20, 0x90, 0x55, 0x57, 0x01, 0x50, 0xb3, 0x91, 0x5d, 0x50, 0x00, 0x57, 0x0d, 0x90, 0x12, 0x90, 0x47, 0x7f, 0x53, 0x22, 0xff, 0x67, 0x29, 0x00, 0x60, 0xa9, 0x51, 0x21, 0x58, 0x20, 0x90, 0x01, 0x7f, 0x62, 0xd0, 0x00, 0x21, 0x03, 0x53, 0x21, 0x64, 0x64, 0x64, 0x64, 0x64, 0x29, 0x80, 0x60, 0xa1, 0x5b
, 0x78, 0x21, 0x0f, 0x29, 0x08, 0x74, 0x53, 0x20, 0x12, 0x22, 0x02, 0x21, 0x5c, 0x50, 0x00, 0x53, 0x1d, 0x53, 0x23, 0x29, 0x01, 0x79, 0xa0, 0x08, 0x64, 0x6b, 0x1d, 0x6b, 0x23, 0x8f, 0xf5, 0x60, 0xb5, 0x51, 0x1d, 0x60, 0xb4, 0x7f, 0x50, 0x02, 0x78, 0x08, 0x90, 0x28, 0x90, 0x5a, 0x18, 0x78, 0xdf, 0xf8, 0x7f, 0x41, 0xdf, 0xfe, 0x71, 0x10, 0x41, 0xd8, 0xfd, 0x70, 0xef, 0x41, 0x61, 0xf3
, 0x41, 0xa2, 0xfb, 0x41, 0xa0, 0xf7, 0x62, 0xa3, 0x00, 0x62, 0xa9, 0x00, 0x41, 0xaa, 0xfd, 0x7f, 0x01, 0x20, 0x02, 0x20, 0x64, 0x5c, 0xff, 0xf8, 0x4b, 0x74, 0xff, 0xf4, 0x7f, 0x62, 0xd0, 0x00, 0x53, 0x1d, 0x10, 0x5b, 0x64, 0x64, 0x5c, 0x71, 0x10, 0x5e, 0x01, 0x2a, 0x1d, 0x61, 0x01, 0x36, 0x1d, 0xff, 0x5e, 0x00, 0x22, 0x1d, 0x61, 0x00, 0x36, 0x1d, 0xff, 0x18, 0xfe, 0xd6, 0x5c, 0x5e
, 0x00, 0x2a, 0x1d, 0x61, 0x00, 0x70, 0xef, 0x7f, 0x62, 0xd0, 0x00, 0x10, 0x73, 0x53, 0x1d, 0x71, 0x10, 0x5b, 0xfe, 0xc0, 0x5c, 0x5e, 0x00, 0x22, 0x1d, 0x61, 0x00, 0x70, 0xef, 0x18, 0x64, 0x64, 0x5c, 0x71, 0x10, 0x5e, 0x01, 0x22, 0x1d, 0x61, 0x01, 0x36, 0x1d, 0xff, 0x5e, 0x00, 0x2a, 0x1d, 0x61, 0x00, 0x70, 0xef, 0x7f, 0x70, 0xbf, 0x62, 0xd0, 0x00, 0x53, 0x1e, 0x50, 0x00, 0x53, 0x1a
, 0x53, 0x1b, 0x51, 0x1e, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x24, 0x53, 0x1f, 0x43, 0xa0, 0x01, 0x51, 0x1f, 0x60, 0xfd, 0x41, 0xa3, 0xdf, 0x51, 0x1e, 0x9f, 0x7a, 0x9f, 0x81, 0x58, 0x23, 0x55, 0x1c, 0x00, 0x62, 0xa5, 0x00, 0x62, 0xa4, 0x00, 0x43, 0xb3, 0x01, 0x51, 0x1c, 0xaf, 0xfd, 0x79, 0xdf, 0xee, 0x51, 0x1e, 0x9f, 0x5f, 0x9f, 0x91, 0x43, 0xa3, 0x20, 0x41, 0xa0, 0xfe, 0x62, 0xfd, 0x00
, 0x50, 0xff, 0x4c, 0x1b, 0x14, 0x1b, 0x51, 0x20, 0x11, 0x08, 0xfe, 0x4d, 0x4c, 0x1a, 0x1c, 0x1a, 0xd0, 0x07, 0x55, 0x1a, 0x00, 0x55, 0x1b, 0x00, 0x51, 0x1e, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x51, 0x1b, 0x54, 0x98, 0x51, 0x1a, 0x54, 0x97, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x08, 0x9f, 0x86, 0x18, 0x78, 0xdf, 0xfa, 0x7f, 0x70, 0xbf, 0x62, 0xd0, 0x00, 0x53, 0x27, 0x5a, 0x26, 0x55, 0x1e, 0x01
, 0x62, 0xd3, 0x00, 0x58, 0x1e, 0x56, 0x24, 0x80, 0x55, 0x29, 0x08, 0x55, 0x28, 0x80, 0x51, 0x1e, 0x9f, 0x63, 0x51, 0x1e, 0x9f, 0x5f, 0x70, 0xbf, 0x58, 0x1e, 0x62, 0xd3, 0x00, 0x51, 0x1b, 0x3a, 0x27, 0x51, 0x1a, 0x1a, 0x26, 0xd0, 0x06, 0x51, 0x28, 0x73, 0x25, 0x24, 0x68, 0x28, 0x26, 0x28, 0x7f, 0x51, 0x28, 0x2d, 0x24, 0x7a, 0x29, 0xbf, 0xd6, 0x7a, 0x1e, 0xdf, 0xc4, 0x70, 0x3f, 0x71
, 0xc0, 0x7f, 0x62, 0xd0, 0x00, 0x3c, 0xb4, 0x01, 0xb0, 0x29, 0x51, 0xae, 0x11, 0xfd, 0x51, 0xad, 0x19, 0x02, 0xd0, 0x12, 0x7c, 0x14, 0xdd, 0x39, 0x0f, 0xa0, 0x41, 0x62, 0xd0, 0x00, 0x76, 0xae, 0x0e, 0xad, 0x00, 0x80, 0x37, 0x62, 0xd0, 0x00, 0x55, 0xae, 0x00, 0x55, 0xad, 0x00, 0x90, 0xe1, 0x80, 0x2a, 0x62, 0xd0, 0x00, 0x51, 0xae, 0x11, 0xca, 0x51, 0xad, 0x19, 0x08, 0xd0, 0x12, 0x7c
, 0x14, 0xdd, 0x39, 0x0f, 0xa0, 0x16, 0x62, 0xd0, 0x00, 0x76, 0xae, 0x0e, 0xad, 0x00, 0x80, 0x0c, 0x62, 0xd0, 0x00, 0x55, 0xae, 0x00, 0x55, 0xad, 0x00, 0x90, 0xb6, 0x7f, 0x62, 0xd0, 0x00, 0x3c, 0xb4, 0x01, 0xb0, 0x06, 0x55, 0xb6, 0x05, 0x80, 0x07, 0x62, 0xd0, 0x00, 0x55, 0xb6, 0x03, 0x62, 0xd0, 0x00, 0x3c, 0xb3, 0xf0, 0xd0, 0x03, 0x76, 0xb3, 0x62, 0xd0, 0x00, 0x51, 0x2f, 0x21, 0x7f
, 0x53, 0x5d, 0x51, 0xb3, 0x3a, 0x5d, 0xb0, 0x4a, 0x7c, 0x14, 0xdd, 0x62, 0xd0, 0x00, 0x53, 0xbc, 0x3c, 0xbc, 0x0f, 0xa0, 0x37, 0x3c, 0xba, 0x00, 0xb0, 0x1c, 0x55, 0xa3, 0x00, 0x55, 0xa4, 0x00, 0x51, 0xbc, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x06, 0x5c, 0xa3, 0x0e, 0x5d, 0x00, 0x51, 0x5d, 0x60, 0xd5, 0x50, 0x08, 0x3f, 0x5c, 0x62, 0xd0, 0x00, 0x55, 0xb7, 0x00, 0x3c, 0xb2, 0x00, 0xb0, 0x12
, 0x7c, 0x15, 0x7a, 0x62, 0xd0, 0x00, 0x55, 0xb2, 0x01, 0x80, 0x07, 0x62, 0xd0, 0x00, 0x55, 0xb3, 0x00, 0x7f, 0x62, 0xd0, 0x00, 0x55, 0xae, 0x00, 0x55, 0xad, 0x00, 0x3c, 0xb2, 0x01, 0xb0, 0x31, 0x7a, 0xb6, 0x3c, 0xb6, 0x00, 0xb0, 0x2a, 0x3c, 0xb2, 0x01, 0xb0, 0x0a, 0x7c, 0x16, 0x11, 0x62, 0xd0, 0x00, 0x55, 0xb2, 0x00, 0x62, 0xd0, 0x00, 0x3c, 0xba, 0x00, 0xb0, 0x0e, 0x51, 0xbc, 0x53
, 0x5c, 0x55, 0x5d, 0x00, 0x06, 0x5c, 0xa3, 0x7c, 0x1b, 0xfa, 0x62, 0xd0, 0x00, 0x55, 0xb3, 0x00, 0x7f, 0x10, 0x4f, 0x38, 0x16, 0x62, 0xd0, 0x00, 0x3c, 0xb9, 0x00, 0xb0, 0x05, 0x51, 0xa7, 0x53, 0x24, 0x56, 0x0d, 0x00, 0x80, 0x96, 0x56, 0x00, 0x00, 0x80, 0x8a, 0x62, 0xd0, 0x00, 0x3c, 0xb9, 0x00, 0xb0, 0x1b, 0x52, 0x00, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x06, 0x5c, 0xa7, 0x7c, 0x1a, 0xa4
, 0x52, 0x00, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x06, 0x5a, 0x24, 0x7c, 0x1b, 0x87, 0x10, 0x52, 0x00, 0x7c, 0x09, 0x35, 0x20, 0x10, 0x7c, 0x05, 0xc3, 0x62, 0xd0, 0x00, 0x20, 0x39, 0x00, 0xbf, 0xee, 0x52, 0x00, 0x7c, 0x1a, 0x27, 0x7c, 0x1a, 0xc8, 0x70, 0xfb, 0x6e, 0x5b, 0x6e, 0x5a, 0x06, 0x5c, 0x6f, 0x0e, 0x5d, 0x00, 0x7c, 0x1a, 0xb0, 0x52, 0x00, 0x7c, 0x1a, 0x27, 0x53, 0x5b, 0x06, 0x5c
, 0x6f, 0x7c, 0x1a, 0xa4, 0x7c, 0x1b, 0x27, 0x7c, 0x1a, 0x3b, 0x52, 0x0d, 0x7c, 0x1b, 0xee, 0x02, 0x5c, 0x53, 0x5c, 0x51, 0x5b, 0x0a, 0x5d, 0x53, 0x5d, 0x52, 0x00, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x65, 0x5a, 0x6b, 0x5b, 0x06, 0x5a, 0x97, 0x0e, 0x5b, 0x00, 0x51, 0x5b, 0x7c, 0x1a, 0xc8, 0x7c, 0x1a, 0xb0, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xcf, 0x73, 0x77, 0x0d, 0x3d, 0x0d, 0x03, 0xcf, 0x67
, 0x56, 0x00, 0x00, 0x81, 0x04, 0x62, 0xd0, 0x00, 0x7c, 0x1a, 0x3b, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x54, 0x0e, 0x3e, 0x5c, 0x54, 0x0f, 0x52, 0x00, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x55, 0x5a, 0x06, 0x55, 0x5b, 0x00, 0x55, 0x55, 0x00, 0x55, 0x54, 0x00, 0x3c, 0x5b, 0x00, 0xb0, 0x06, 0x3c, 0x5a, 0x00, 0xa0, 0x1a, 0x70, 0xfb, 0x6e, 0x5b, 0x6e, 0x5a, 0xd0, 0x0c, 0x62, 0xd0, 0x00, 0x51
, 0x5c, 0x04, 0x55, 0x51, 0x5d, 0x0c, 0x54, 0x65, 0x5c, 0x6b, 0x5d, 0x8f, 0xde, 0x5f, 0x5c, 0x55, 0x5f, 0x5d, 0x54, 0x62, 0xd0, 0x00, 0x5a, 0x5a, 0x06, 0x5a, 0x03, 0x51, 0x5a, 0x04, 0x5c, 0x0e, 0x5d, 0x03, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x54, 0x10, 0x3e, 0x5c, 0x54, 0x11, 0x52, 0x00, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x55, 0x5a, 0x06, 0x55, 0x5b, 0x00, 0x55, 0x55, 0x00, 0x55, 0x54
, 0x00, 0x3c, 0x5b, 0x00, 0xb0, 0x06, 0x3c, 0x5a, 0x00, 0xa0, 0x1a, 0x70, 0xfb, 0x6e, 0x5b, 0x6e, 0x5a, 0xd0, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x5c, 0x04, 0x55, 0x51, 0x5d, 0x0c, 0x54, 0x65, 0x5c, 0x6b, 0x5d, 0x8f, 0xde, 0x5f, 0x5c, 0x55, 0x5f, 0x5d, 0x54, 0x62, 0xd0, 0x00, 0x5a, 0x5a, 0x06, 0x5a, 0x05, 0x51, 0x5a, 0x04, 0x5c, 0x0e, 0x5d, 0x03, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x54
, 0x12, 0x3e, 0x5c, 0x54, 0x13, 0x50, 0x03, 0x08, 0x5a, 0x5c, 0x06, 0x5c, 0x0e, 0x08, 0x51, 0x5c, 0x08, 0x7c, 0x18, 0xb7, 0x38, 0xfd, 0x62, 0xd0, 0x00, 0x51, 0x5c, 0x54, 0x15, 0x51, 0x5d, 0x54, 0x14, 0x52, 0x00, 0x7c, 0x1a, 0x27, 0x7c, 0x1b, 0x93, 0x06, 0x5c, 0x8f, 0x7c, 0x1b, 0xa9, 0x7c, 0x1a, 0xe9, 0x51, 0x5c, 0x01, 0x77, 0x7c, 0x1b, 0x4f, 0x51, 0x5c, 0x01, 0x7f, 0x7c, 0x1b, 0x4f
, 0x06, 0x5c, 0x87, 0x7c, 0x1b, 0xa9, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xce, 0xf9, 0x38, 0xea, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x16, 0x10, 0x57, 0x09, 0x50, 0x01, 0x7c, 0x08, 0x6f, 0x20, 0x62, 0xd0, 0x00, 0x50, 0x01, 0x10, 0x08, 0x57, 0xb0, 0x28, 0x53, 0x5d, 0x18, 0x75, 0x09, 0x00, 0x28, 0x53, 0x5c, 0x20, 0x10, 0x51, 0x5d, 0x08, 0x51, 0x5c, 0x20, 0x7c, 0x09, 0xb4, 0x20, 0x10, 0x57, 0x0d
, 0x50, 0x00, 0x7c, 0x08, 0x6f, 0x20, 0x62, 0xd0, 0x00, 0x3c, 0xb9, 0x01, 0xb0, 0x0b, 0x51, 0x24, 0x53, 0x30, 0x51, 0x25, 0x53, 0x31, 0x80, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0xa7, 0x53, 0x24, 0x51, 0xa8, 0x53, 0x25, 0x10, 0x50, 0x00, 0x7c, 0x09, 0x35, 0x20, 0x56, 0x0d, 0x00, 0x80, 0x96, 0x56, 0x00, 0x00, 0x80, 0x8a, 0x62, 0xd0, 0x00, 0x3c, 0xb9, 0x00, 0xb0, 0x1b, 0x52, 0x00, 0x53, 0x5c
, 0x55, 0x5d, 0x00, 0x06, 0x5c, 0xa7, 0x7c, 0x1a, 0xa4, 0x52, 0x00, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x06, 0x5a, 0x24, 0x7c, 0x1b, 0x87, 0x10, 0x52, 0x00, 0x7c, 0x09, 0x35, 0x20, 0x10, 0x7c, 0x05, 0xc3, 0x62, 0xd0, 0x00, 0x20, 0x39, 0x00, 0xbf, 0xee, 0x52, 0x00, 0x7c, 0x1a, 0x27, 0x7c, 0x1a, 0xc8, 0x70, 0xfb, 0x6e, 0x5b, 0x6e, 0x5a, 0x06, 0x5c, 0x6f, 0x0e, 0x5d, 0x00, 0x7c, 0x1a, 0xb0
, 0x52, 0x00, 0x7c, 0x1a, 0x27, 0x53, 0x5b, 0x06, 0x5c, 0x6f, 0x7c, 0x1a, 0xa4, 0x7c, 0x1b, 0x27, 0x7c, 0x1a, 0x3b, 0x52, 0x0d, 0x7c, 0x1b, 0xee, 0x02, 0x5c, 0x53, 0x5c, 0x51, 0x5b, 0x0a, 0x5d, 0x53, 0x5d, 0x52, 0x00, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x65, 0x5a, 0x6b, 0x5b, 0x06, 0x5a, 0x97, 0x0e, 0x5b, 0x00, 0x51, 0x5b, 0x7c, 0x1a, 0xc8, 0x7c, 0x1a, 0xb0, 0x77, 0x00, 0x3d, 0x00, 0x02
, 0xcf, 0x73, 0x77, 0x0d, 0x3d, 0x0d, 0x03, 0xcf, 0x67, 0x56, 0x00, 0x00, 0x81, 0x04, 0x62, 0xd0, 0x00, 0x7c, 0x1a, 0x3b, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x54, 0x0e, 0x3e, 0x5c, 0x54, 0x0f, 0x52, 0x00, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x55, 0x5a, 0x06, 0x55, 0x5b, 0x00, 0x55, 0x55, 0x00, 0x55, 0x54, 0x00, 0x3c, 0x5b, 0x00, 0xb0, 0x06, 0x3c, 0x5a, 0x00, 0xa0, 0x1a, 0x70, 0xfb, 0x6e
, 0x5b, 0x6e, 0x5a, 0xd0, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x5c, 0x04, 0x55, 0x51, 0x5d, 0x0c, 0x54, 0x65, 0x5c, 0x6b, 0x5d, 0x8f, 0xde, 0x5f, 0x5c, 0x55, 0x5f, 0x5d, 0x54, 0x62, 0xd0, 0x00, 0x5a, 0x5a, 0x06, 0x5a, 0x03, 0x51, 0x5a, 0x04, 0x5c, 0x0e, 0x5d, 0x03, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x54, 0x10, 0x3e, 0x5c, 0x54, 0x11, 0x52, 0x00, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x55, 0x5a
, 0x06, 0x55, 0x5b, 0x00, 0x55, 0x55, 0x00, 0x55, 0x54, 0x00, 0x3c, 0x5b, 0x00, 0xb0, 0x06, 0x3c, 0x5a, 0x00, 0xa0, 0x1a, 0x70, 0xfb, 0x6e, 0x5b, 0x6e, 0x5a, 0xd0, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x5c, 0x04, 0x55, 0x51, 0x5d, 0x0c, 0x54, 0x65, 0x5c, 0x6b, 0x5d, 0x8f, 0xde, 0x5f, 0x5c, 0x55, 0x5f, 0x5d, 0x54, 0x62, 0xd0, 0x00, 0x5a, 0x5a, 0x06, 0x5a, 0x05, 0x51, 0x5a, 0x04, 0x5c, 0x0e
, 0x5d, 0x03, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x54, 0x12, 0x3e, 0x5c, 0x54, 0x13, 0x50, 0x03, 0x08, 0x5a, 0x5c, 0x06, 0x5c, 0x0e, 0x08, 0x51, 0x5c, 0x08, 0x7c, 0x18, 0xb7, 0x38, 0xfd, 0x62, 0xd0, 0x00, 0x51, 0x5c, 0x54, 0x15, 0x51, 0x5d, 0x54, 0x14, 0x52, 0x00, 0x7c, 0x1a, 0x27, 0x7c, 0x1b, 0x93, 0x06, 0x5c, 0x8f, 0x7c, 0x1b, 0xa9, 0x7c, 0x1a, 0xe9, 0x51, 0x5c, 0x01, 0x77, 0x7c
, 0x1b, 0x4f, 0x51, 0x5c, 0x01, 0x7f, 0x7c, 0x1b, 0x4f, 0x06, 0x5c, 0x87, 0x7c, 0x1b, 0xa9, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xce, 0xf9, 0x56, 0x00, 0x00, 0x80, 0x19, 0x7c, 0x1b, 0x1c, 0x06, 0x5c, 0x24, 0x7c, 0x1a, 0xa4, 0x52, 0x00, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x06, 0x5a, 0x30, 0x7c, 0x1b, 0x87, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xcf, 0xe4, 0x38, 0xea, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x02
, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x01, 0x02, 0x53, 0x5c, 0x52, 0xfb, 0x09, 0x00, 0x7c, 0x1a, 0xd3, 0x52, 0xfc, 0x01, 0x04, 0x53, 0x5a, 0x52, 0xfb, 0x7c, 0x1a, 0xbd, 0x12, 0x5c, 0x51, 0x5b, 0x1a, 0x5d, 0xc0, 0x64, 0x52, 0xfc, 0x53, 0x5c, 0x52, 0xfb, 0x7c, 0x1a, 0xd3, 0x52, 0xfc, 0x01, 0x02, 0x53, 0x5a, 0x52, 0xfb, 0x7c, 0x1a, 0xbd, 0x12, 0x5c, 0x51, 0x5b, 0x1a, 0x5d, 0xc0, 0x10, 0x52
, 0xfc, 0x01, 0x02, 0x7c, 0x1b, 0x7c, 0x54, 0x00, 0x3e, 0x5c, 0x54, 0x01, 0x80, 0x9d, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x01, 0x04, 0x53, 0x5c, 0x52, 0xfb, 0x09, 0x00, 0x7c, 0x1a, 0xd3, 0x52, 0xfc, 0x53, 0x5a, 0x52, 0xfb, 0x7c, 0x1b, 0x6d, 0xc0, 0x10, 0x52, 0xfc, 0x01, 0x04, 0x7c, 0x1b, 0x7c, 0x54, 0x00, 0x3e, 0x5c, 0x54, 0x01, 0x80, 0x73, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x53, 0x5c, 0x52
, 0xfb, 0x7c, 0x1b, 0x9e, 0x80, 0x65, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x53, 0x5c, 0x52, 0xfb, 0x7c, 0x1a, 0xd3, 0x52, 0xfc, 0x01, 0x04, 0x53, 0x5a, 0x52, 0xfb, 0x7c, 0x1a, 0xbd, 0x12, 0x5c, 0x51, 0x5b, 0x1a, 0x5d, 0xc0, 0x10, 0x52, 0xfc, 0x01, 0x04, 0x7c, 0x1b, 0x7c, 0x54, 0x00, 0x3e, 0x5c, 0x54, 0x01, 0x80, 0x37, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x01, 0x02, 0x53, 0x5c, 0x52, 0xfb, 0x09
, 0x00, 0x7c, 0x1a, 0xd3, 0x52, 0xfc, 0x53, 0x5a, 0x52, 0xfb, 0x7c, 0x1b, 0x6d, 0xc0, 0x10, 0x52, 0xfc, 0x01, 0x02, 0x7c, 0x1b, 0x7c, 0x54, 0x00, 0x3e, 0x5c, 0x54, 0x01, 0x80, 0x0d, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x53, 0x5c, 0x52, 0xfb, 0x7c, 0x1b, 0x9e, 0x62, 0xd0, 0x00, 0x52, 0x01, 0x53, 0x5c, 0x52, 0x00, 0x53, 0x5d, 0x38, 0xfe, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x05, 0x62, 0xd0, 0x00
, 0x55, 0xbe, 0x00, 0x3c, 0xb9, 0x00, 0xb0, 0x05, 0x51, 0xa7, 0x53, 0x24, 0x56, 0x02, 0x00, 0x81, 0x62, 0x62, 0xd0, 0x00, 0x3c, 0xb9, 0x00, 0xb0, 0x1b, 0x52, 0x02, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x06, 0x5c, 0xa7, 0x7c, 0x1a, 0xa4, 0x52, 0x02, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x06, 0x5a, 0x24, 0x7c, 0x1b, 0x87, 0x62, 0xd0, 0x00, 0x3c, 0xb4, 0x01, 0xb0, 0xf9, 0x56, 0x01, 0x00, 0x80, 0x37
, 0x10, 0x52, 0x02, 0x7c, 0x09, 0x35, 0x20, 0x10, 0x7c, 0x05, 0xc3, 0x62, 0xd0, 0x00, 0x20, 0x39, 0x00, 0xbf, 0xee, 0x7c, 0x1a, 0x87, 0x06, 0x5c, 0x97, 0x7c, 0x1a, 0xa4, 0x3e, 0x5c, 0x53, 0x5c, 0x52, 0x01, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x65, 0x5a, 0x6b, 0x5b, 0x06, 0x5a, 0x40, 0x0e, 0x5b, 0x00, 0x7c, 0x1b, 0x60, 0x77, 0x01, 0x3d, 0x01, 0x05, 0xcf, 0xc6, 0x56, 0x01, 0x00, 0x80, 0x95
, 0x52, 0x01, 0x01, 0x01, 0x54, 0x00, 0x80, 0x86, 0x62, 0xd0, 0x00, 0x7c, 0x1a, 0xe9, 0x06, 0x5c, 0x40, 0x7c, 0x1a, 0xa4, 0x3e, 0x5c, 0x53, 0x5c, 0x52, 0x01, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x65, 0x5a, 0x6b, 0x5b, 0x06, 0x5a, 0x40, 0x0e, 0x5b, 0x00, 0x51, 0x5b, 0x7c, 0x1b, 0x6d, 0xd0, 0x5c, 0x7c, 0x1a, 0xe9, 0x06, 0x5c, 0x40, 0x0e, 0x5d, 0x00, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x53
, 0xab, 0x3e, 0x5c, 0x53, 0xac, 0x52, 0x01, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x65, 0x5c, 0x6b, 0x5d, 0x06, 0x5c, 0x40, 0x7c, 0x1a, 0xa4, 0x3e, 0x5c, 0x53, 0x5c, 0x52, 0x00, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x65, 0x5a, 0x6b, 0x5b, 0x06, 0x5a, 0x40, 0x0e, 0x5b, 0x00, 0x7c, 0x1b, 0x60, 0x52, 0x01, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x65, 0x5c, 0x6b, 0x5d, 0x06, 0x5c, 0x40, 0x0e, 0x5d, 0x00, 0x51
, 0x5d, 0x60, 0xd5, 0x51, 0xab, 0x3f, 0x5c, 0x51, 0xac, 0x3f, 0x5c, 0x77, 0x00, 0x3d, 0x00, 0x05, 0xcf, 0x77, 0x77, 0x01, 0x3d, 0x01, 0x05, 0xcf, 0x68, 0x62, 0xd0, 0x00, 0x7c, 0x1a, 0x87, 0x06, 0x5c, 0x97, 0x0e, 0x5d, 0x00, 0x51, 0x5d, 0x60, 0xd5, 0x51, 0x44, 0x3f, 0x5c, 0x51, 0x45, 0x3f, 0x5c, 0x80, 0x14, 0x10, 0x52, 0x02, 0x7c, 0x09, 0x35, 0x20, 0x10, 0x7c, 0x05, 0xc3, 0x62, 0xd0
, 0x00, 0x20, 0x39, 0x00, 0xbf, 0xee, 0x62, 0xd0, 0x00, 0x52, 0x02, 0x7c, 0x1a, 0x27, 0x7c, 0x1a, 0xc8, 0x70, 0xfb, 0x6e, 0x5b, 0x6e, 0x5a, 0x06, 0x5c, 0x6f, 0x0e, 0x5d, 0x00, 0x7c, 0x1a, 0xb0, 0x52, 0x02, 0x7c, 0x1a, 0x27, 0x53, 0x5b, 0x06, 0x5c, 0x6f, 0x7c, 0x1a, 0xa4, 0x7c, 0x1b, 0x27, 0x77, 0x02, 0x3d, 0x02, 0x02, 0xce, 0x9b, 0x56, 0x02, 0x00, 0x82, 0x10, 0x62, 0xd0, 0x00, 0x52
, 0x02, 0x7c, 0x1a, 0x27, 0x7c, 0x1a, 0xc8, 0x06, 0x5c, 0x87, 0x7c, 0x1a, 0xa4, 0x7c, 0x1b, 0xd2, 0xd0, 0x56, 0x7c, 0x1a, 0x87, 0x7c, 0x1b, 0x06, 0x06, 0x5a, 0x01, 0x0e, 0x5b, 0x00, 0x7c, 0x1a, 0xb0, 0x52, 0x02, 0x7c, 0x1a, 0x27, 0x7c, 0x1a, 0xc8, 0x06, 0x5c, 0x87, 0x7c, 0x1a, 0xa4, 0x7c, 0x1b, 0xd2, 0xd0, 0xac, 0x7c, 0x1a, 0x87, 0x7c, 0x1b, 0x06, 0x06, 0x5a, 0x01, 0x0e, 0x5b, 0x00
, 0x7c, 0x1a, 0xb0, 0x52, 0x02, 0x7c, 0x1a, 0x27, 0x7c, 0x1a, 0xc8, 0x06, 0x5c, 0x87, 0x7c, 0x1a, 0xa4, 0x7c, 0x1b, 0xd2, 0xd0, 0x8a, 0x7c, 0x1a, 0x87, 0x7c, 0x1b, 0x06, 0x06, 0x5a, 0x01, 0x0e, 0x5b, 0x00, 0x7c, 0x1a, 0xb0, 0x80, 0x79, 0x62, 0xd0, 0x00, 0x52, 0x02, 0x7c, 0x1a, 0x27, 0x7c, 0x1a, 0xc8, 0x06, 0x5c, 0x87, 0x7c, 0x1a, 0xa4, 0x3e, 0x5c, 0x12, 0x5a, 0x51, 0x5d, 0x1a, 0x5b
, 0xd0, 0x5e, 0x7c, 0x1a, 0x87, 0x7c, 0x1b, 0x06, 0x16, 0x5a, 0x01, 0x1e, 0x5b, 0x00, 0x7c, 0x1a, 0xb0, 0x52, 0x02, 0x7c, 0x1a, 0x27, 0x7c, 0x1a, 0xc8, 0x06, 0x5c, 0x87, 0x7c, 0x1a, 0xa4, 0x3e, 0x5c, 0x12, 0x5a, 0x51, 0x5d, 0x1a, 0x5b, 0xd0, 0x37, 0x7c, 0x1a, 0x87, 0x7c, 0x1b, 0x06, 0x16, 0x5a, 0x01, 0x1e, 0x5b, 0x00, 0x7c, 0x1a, 0xb0, 0x52, 0x02, 0x97, 0xeb, 0x40, 0x7c, 0x1a, 0xc8
, 0x06, 0x5c, 0x87, 0x7c, 0x1a, 0xa4, 0x3e, 0x5c, 0x12, 0x5a, 0x51, 0x5d, 0x1a, 0x5b, 0xd0, 0x10, 0x7c, 0x1a, 0x87, 0x7c, 0x1b, 0x06, 0x16, 0x5a, 0x01, 0x1e, 0x5b, 0x00, 0x7c, 0x1a, 0xb0, 0x62, 0xd0, 0x00, 0x7c, 0x1a, 0x87, 0x51, 0x5c, 0x01, 0x7f, 0x7c, 0x1a, 0x93, 0x06, 0x5c, 0x77, 0x0e, 0x5d, 0x00, 0x7c, 0x1a, 0xb0, 0x7c, 0x1a, 0x87, 0x51, 0x5c, 0x01, 0x87, 0x7c, 0x1a, 0x93, 0x06
, 0x5c, 0x7f, 0x0e, 0x5d, 0x00, 0x7c, 0x1a, 0xb0, 0x52, 0x02, 0x97, 0x9b, 0x40, 0x7c, 0x1a, 0xc8, 0x06, 0x5c, 0x87, 0x0e, 0x5d, 0x00, 0x7c, 0x1a, 0xb0, 0x52, 0x02, 0x97, 0x8a, 0x40, 0x53, 0x5b, 0x60, 0xd4, 0x3e, 0x5a, 0x53, 0x59, 0x3e, 0x5a, 0x16, 0x5a, 0x02, 0x53, 0x58, 0x08, 0x51, 0x59, 0x53, 0x57, 0x18, 0x53, 0x56, 0x65, 0x56, 0x6b, 0x57, 0x06, 0x5c, 0x7f, 0x97, 0xe6, 0x40, 0x3e
, 0x5c, 0x53, 0x5c, 0x51, 0x56, 0x04, 0x5c, 0x51, 0x57, 0x0c, 0x5d, 0x51, 0x58, 0x04, 0x5c, 0x51, 0x59, 0x0c, 0x5d, 0x70, 0xfb, 0x6e, 0x5d, 0x6e, 0x5c, 0x70, 0xfb, 0x6e, 0x5d, 0x6e, 0x5c, 0x7c, 0x1b, 0x60, 0x10, 0x52, 0x02, 0x7c, 0x06, 0x07, 0x20, 0x62, 0xd0, 0x00, 0x52, 0x02, 0x97, 0x37, 0x40, 0x97, 0xd5, 0x40, 0x06, 0x5c, 0x8f, 0x97, 0xab, 0x40, 0x7c, 0x1b, 0xd2, 0xd0, 0x25, 0x52
, 0x02, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x06, 0x5c, 0x9f, 0x0e, 0x5d, 0x00, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x7a, 0x5c, 0x53, 0x5b, 0x06, 0x5b, 0x01, 0x51, 0x5d, 0x60, 0xd5, 0x51, 0x5b, 0x3f, 0x5c, 0x80, 0x0a, 0x97, 0xb9, 0x40, 0x06, 0x5c, 0x9f, 0x7c, 0x1b, 0xfa, 0x97, 0xb0, 0x40, 0x06, 0x5c, 0x9f, 0x97, 0x70, 0x40, 0x50, 0x05, 0x3a, 0x5d, 0xd0, 0x4f, 0x97, 0x4a, 0x40, 0x51, 0x5c
, 0x01, 0x8f, 0x53, 0x5a, 0x51, 0x5d, 0x09, 0x00, 0x53, 0x5b, 0x06, 0x5c, 0x97, 0x97, 0x55, 0x40, 0x3e, 0x5c, 0x53, 0x5c, 0x51, 0x5b, 0x60, 0xd4, 0x3e, 0x5a, 0x53, 0x59, 0x3e, 0x5a, 0x16, 0x5a, 0x02, 0x02, 0x5c, 0x53, 0x5c, 0x51, 0x59, 0x0a, 0x5d, 0x53, 0x5d, 0x70, 0xfb, 0x6e, 0x5d, 0x6e, 0x5c, 0x97, 0xed, 0x40, 0x52, 0x02, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x06, 0x5c, 0x9f, 0x0e, 0x5d
, 0x00, 0x51, 0x5d, 0x60, 0xd5, 0x50, 0x00, 0x3f, 0x5c, 0x77, 0x02, 0x3d, 0x02, 0x02, 0xcd, 0xed, 0x62, 0xd0, 0x00, 0x3c, 0xb5, 0x02, 0xb0, 0xd6, 0x56, 0x02, 0x00, 0x80, 0xcc, 0x62, 0xd0, 0x00, 0x96, 0xe5, 0x40, 0x51, 0x5c, 0x01, 0x6f, 0x96, 0xea, 0x40, 0x51, 0x5c, 0x01, 0x97, 0x7c, 0x1b, 0xdf, 0x12, 0x5a, 0x53, 0x5a, 0x51, 0x59, 0x1a, 0x5b, 0x53, 0x5b, 0x06, 0x5c, 0x38, 0x0e, 0x5d
, 0x00, 0x96, 0xed, 0x40, 0x96, 0xc1, 0x40, 0x51, 0x5c, 0x01, 0x8f, 0x96, 0xc6, 0x40, 0x06, 0x5c, 0x3c, 0x0e, 0x5d, 0x00, 0x96, 0xda, 0x40, 0x96, 0xae, 0x40, 0x51, 0x5c, 0x01, 0x6f, 0x96, 0xb3, 0x40, 0x51, 0x5c, 0x01, 0x3c, 0x97, 0xf8, 0x40, 0x12, 0x5a, 0x53, 0x5a, 0x51, 0x59, 0x1a, 0x5b, 0x53, 0x5b, 0x06, 0x5c, 0x3c, 0x0e, 0x5d, 0x00, 0x96, 0xb6, 0x40, 0x96, 0x8a, 0x40, 0x51, 0x5c
, 0x01, 0x8f, 0x96, 0x8f, 0x40, 0x51, 0x5c, 0x01, 0x97, 0x97, 0xd4, 0x40, 0x53, 0x58, 0x51, 0x5a, 0x12, 0x58, 0x51, 0x5b, 0x1a, 0x59, 0xd0, 0x34, 0x52, 0x02, 0x97, 0xd2, 0x40, 0x01, 0x8f, 0x53, 0x58, 0x51, 0x5b, 0x09, 0x00, 0x60, 0xd4, 0x3e, 0x58, 0x53, 0x59, 0x3e, 0x58, 0x53, 0x58, 0x06, 0x5a, 0x97, 0x0e, 0x5b, 0x00, 0x51, 0x5b, 0x60, 0xd4, 0x3e, 0x5a, 0x53, 0x5b, 0x3e, 0x5a, 0x12
, 0x58, 0x54, 0x04, 0x51, 0x5b, 0x1a, 0x59, 0x54, 0x03, 0x80, 0x07, 0x56, 0x04, 0x00, 0x56, 0x03, 0x00, 0x62, 0xd0, 0x00, 0x06, 0x5c, 0x34, 0x0e, 0x5d, 0x00, 0x51, 0x5d, 0x60, 0xd5, 0x52, 0x03, 0x3f, 0x5c, 0x52, 0x04, 0x3f, 0x5c, 0x77, 0x02, 0x3d, 0x02, 0x02, 0xcf, 0x31, 0x38, 0xfb, 0x20, 0x7f, 0x10, 0x4f, 0x80, 0x02, 0x40, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x53, 0x5c, 0x52, 0xfb, 0x53
, 0x5d, 0x51, 0x5c, 0x11, 0x01, 0x54, 0xfc, 0x51, 0x5d, 0x19, 0x00, 0x54, 0xfb, 0x3c, 0x5d, 0x00, 0xbf, 0xe4, 0x3c, 0x5c, 0x00, 0xbf, 0xdf, 0x20, 0x7f, 0x10, 0x7c, 0x04, 0x8d, 0x7c, 0x04, 0x6a, 0x20, 0x7f, 0x10, 0x7c, 0x04, 0x89, 0x7c, 0x04, 0x66, 0x20, 0x7f, 0x62, 0xd0, 0x00, 0x51, 0x60, 0x12, 0x94, 0x50, 0x00, 0x1a, 0x93, 0xd0, 0x0f, 0x51, 0x61, 0x12, 0x96, 0x50, 0x00, 0x1a, 0x95
, 0xd0, 0x05, 0x50, 0x0f, 0x80, 0x17, 0x62, 0xd0, 0x00, 0x51, 0x96, 0x12, 0x94, 0x51, 0x95, 0x1a, 0x93, 0xd0, 0x05, 0x50, 0x00, 0x80, 0x06, 0x62, 0xd0, 0x00, 0x50, 0x01, 0x7f, 0x10, 0x4f, 0x38, 0x05, 0x62, 0xd0, 0x00, 0x51, 0x94, 0x54, 0x02, 0x51, 0x93, 0x54, 0x01, 0x56, 0x04, 0x00, 0x56, 0x00, 0x00, 0x56, 0x03, 0x00, 0x80, 0x69, 0x96, 0x23, 0x40, 0x06, 0x5c, 0x60, 0x0e, 0x5d, 0x00
, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x53, 0x5c, 0x52, 0x00, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x65, 0x5a, 0x6b, 0x5b, 0x06, 0x5a, 0x93, 0x0e, 0x5b, 0x00, 0x51, 0x5b, 0x95, 0xab, 0x40, 0x51, 0x5c, 0x12, 0x5a, 0x50, 0x00, 0x1a, 0x5b, 0xd0, 0x03, 0x77, 0x03, 0x62, 0xd0, 0x00, 0x95, 0xba, 0x40, 0x06, 0x5c, 0x93, 0x95, 0x6f, 0x40, 0x3e, 0x5c, 0x53, 0x5c, 0x52, 0x02, 0x12, 0x5c, 0x52, 0x01
, 0x1a, 0x5d, 0xd0, 0x1a, 0x95, 0xa3, 0x40, 0x06, 0x5c, 0x93, 0x0e, 0x5d, 0x00, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x54, 0x01, 0x3e, 0x5c, 0x54, 0x02, 0x52, 0x00, 0x54, 0x04, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xcf, 0x94, 0x50, 0x01, 0x3b, 0x03, 0xd0, 0x08, 0x62, 0xd0, 0x00, 0x50, 0x0f, 0x80, 0x06, 0x52, 0x04, 0x62, 0xd0, 0x00, 0x38, 0xfb, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x02, 0x70, 0xfe
, 0x62, 0xd0, 0x00, 0x26, 0x2a, 0xf0, 0x51, 0xbc, 0x01, 0x01, 0x53, 0x5d, 0x51, 0x2a, 0x2a, 0x5d, 0x53, 0x2a, 0x51, 0x2a, 0x53, 0xb1, 0x71, 0x01, 0x62, 0xe3, 0x38, 0x10, 0x7c, 0x05, 0xc3, 0x62, 0xd0, 0x00, 0x20, 0x43, 0x00, 0x08, 0x56, 0x01, 0x00, 0x56, 0x00, 0x00, 0x80, 0x21, 0x10, 0x7c, 0x05, 0xc3, 0x62, 0xd0, 0x00, 0x20, 0x53, 0x5d, 0x47, 0x5d, 0x20, 0xa0, 0x03, 0x80, 0x1a, 0x50
, 0x00, 0x08, 0x50, 0x04, 0x08, 0x9e, 0xaa, 0x38, 0xfe, 0x77, 0x01, 0x0f, 0x00, 0x00, 0x52, 0x01, 0x11, 0xdc, 0x52, 0x00, 0x19, 0x05, 0xcf, 0xd7, 0x56, 0x01, 0x00, 0x56, 0x00, 0x00, 0x80, 0x21, 0x10, 0x7c, 0x05, 0xc3, 0x62, 0xd0, 0x00, 0x20, 0x53, 0x5d, 0x47, 0x5d, 0x20, 0xb0, 0x03, 0x80, 0x1a, 0x50, 0x00, 0x08, 0x50, 0x04, 0x08, 0x9e, 0x78, 0x38, 0xfe, 0x77, 0x01, 0x0f, 0x00, 0x00
, 0x52, 0x01, 0x11, 0x2c, 0x52, 0x00, 0x19, 0x01, 0xcf, 0xd7, 0x41, 0x00, 0xf7, 0x38, 0xfe, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x02, 0x70, 0xfe, 0x62, 0xd0, 0x00, 0x26, 0x2a, 0xf0, 0x51, 0xbc, 0x01, 0x09, 0x53, 0x5d, 0x51, 0x2a, 0x2a, 0x5d, 0x53, 0x2a, 0x51, 0x2a, 0x53, 0xb1, 0x71, 0x01, 0x62, 0xe3, 0x38, 0x10, 0x7c, 0x05, 0xc3, 0x62, 0xd0, 0x00, 0x20, 0x43, 0x00, 0x08, 0x56, 0x01, 0x00
, 0x56, 0x00, 0x00, 0x80, 0x21, 0x10, 0x7c, 0x05, 0xc3, 0x62, 0xd0, 0x00, 0x20, 0x53, 0x5d, 0x47, 0x5d, 0x20, 0xa0, 0x03, 0x80, 0x1a, 0x50, 0x00, 0x08, 0x50, 0x04, 0x08, 0x9e, 0x13, 0x38, 0xfe, 0x77, 0x01, 0x0f, 0x00, 0x00, 0x52, 0x01, 0x11, 0xdc, 0x52, 0x00, 0x19, 0x05, 0xcf, 0xd7, 0x56, 0x01, 0x00, 0x56, 0x00, 0x00, 0x80, 0x21, 0x10, 0x7c, 0x05, 0xc3, 0x62, 0xd0, 0x00, 0x20, 0x53
, 0x5d, 0x47, 0x5d, 0x20, 0xb0, 0x03, 0x80, 0x1a, 0x50, 0x00, 0x08, 0x50, 0x04, 0x08, 0x9d, 0xe1, 0x38, 0xfe, 0x77, 0x01, 0x0f, 0x00, 0x00, 0x52, 0x01, 0x11, 0x2c, 0x52, 0x00, 0x19, 0x01, 0xcf, 0xd7, 0x41, 0x00, 0xf7, 0x38, 0xfe, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x04, 0x62, 0xd0, 0x00, 0x51, 0x2a, 0x21, 0xf0, 0x54, 0x00, 0x51, 0x2d, 0x54, 0x01, 0x3c, 0x32, 0x01, 0xb0, 0x11, 0x3c, 0xb4
, 0x00, 0xb0, 0x1d, 0x55, 0xb4, 0x01, 0x55, 0x60, 0x3c, 0x55, 0x61, 0x5f, 0x80, 0x12, 0x62, 0xd0, 0x00, 0x3c, 0xb4, 0x01, 0xb0, 0x0a, 0x55, 0xb4, 0x00, 0x55, 0x60, 0x28, 0x55, 0x61, 0x28, 0x3d, 0x00, 0x10, 0xb0, 0x27, 0x62, 0xd0, 0x00, 0x55, 0xb7, 0x00, 0x3c, 0xba, 0x01, 0xb0, 0x09, 0x55, 0xa3, 0x00, 0x55, 0xa4, 0x00, 0x80, 0x0f, 0x62, 0xd0, 0x00, 0x3c, 0xb2, 0x01, 0xa0, 0x07, 0x55
, 0xa3, 0x00, 0x55, 0xa4, 0x00, 0x93, 0xee, 0x40, 0x81, 0x68, 0x3d, 0x00, 0x20, 0xb0, 0x15, 0x62, 0xd0, 0x00, 0x55, 0xb7, 0x01, 0x55, 0xb8, 0x00, 0x55, 0xa3, 0x08, 0x55, 0xa4, 0x08, 0x93, 0xd5, 0x40, 0x81, 0x4f, 0x3d, 0x00, 0x40, 0xb0, 0x0c, 0x62, 0xd0, 0x00, 0x55, 0xb5, 0x02, 0x93, 0xc5, 0x40, 0x81, 0x3f, 0x3d, 0x00, 0x50, 0xb0, 0xa1, 0x52, 0x01, 0x54, 0x03, 0x56, 0x02, 0x00, 0x3d
, 0x02, 0x00, 0xb0, 0x06, 0x3d, 0x03, 0x01, 0xa0, 0x21, 0x3d, 0x02, 0x00, 0xb0, 0x06, 0x3d, 0x03, 0x02, 0xa0, 0x28, 0x3d, 0x02, 0x00, 0xb0, 0x06, 0x3d, 0x03, 0x04, 0xa0, 0x36, 0x3d, 0x02, 0x00, 0xb0, 0x06, 0x3d, 0x03, 0x08, 0xa0, 0x48, 0x80, 0x62, 0x62, 0xd0, 0x00, 0x55, 0xb9, 0x01, 0x51, 0x2f, 0x29, 0x80, 0x53, 0x2f, 0x7c, 0x0c, 0xd1, 0x80, 0x51, 0x62, 0xd0, 0x00, 0x51, 0x2b, 0x53
, 0x60, 0x51, 0x2b, 0x53, 0x61, 0x51, 0x2b, 0x53, 0x2e, 0x51, 0x2c, 0x53, 0x0e, 0x55, 0x0d, 0x00, 0x80, 0x39, 0x62, 0xd0, 0x00, 0x51, 0x2b, 0x53, 0x2f, 0x3c, 0xb9, 0x00, 0xa0, 0x09, 0x51, 0x2f, 0x29, 0x80, 0x53, 0x2f, 0x80, 0x25, 0x62, 0xd0, 0x00, 0x26, 0x2f, 0x7f, 0x80, 0x1d, 0x62, 0xd0, 0x00, 0x55, 0xb9, 0x00, 0x26, 0x2f, 0x7f, 0x51, 0xa7, 0x53, 0x24, 0x51, 0x24, 0x53, 0x30, 0x51
, 0xa8, 0x53, 0x25, 0x51, 0x25, 0x53, 0x31, 0x7c, 0x0c, 0xd1, 0x93, 0x29, 0x40, 0x55, 0x2b, 0x0b, 0x55, 0x2c, 0x08, 0x55, 0x2d, 0x00, 0x80, 0x9a, 0x3d, 0x00, 0x60, 0xb0, 0x0c, 0x62, 0xd0, 0x00, 0x55, 0xba, 0x01, 0x93, 0x10, 0x40, 0x80, 0x8a, 0x3d, 0x00, 0x70, 0xb0, 0x0c, 0x62, 0xd0, 0x00, 0x55, 0xba, 0x00, 0x93, 0x00, 0x40, 0x80, 0x7a, 0x3d, 0x00, 0x80, 0xb0, 0x75, 0x92, 0xf6, 0x40
, 0x9c, 0x97, 0x10, 0x7c, 0x08, 0xb3, 0x7c, 0x05, 0xd9, 0x20, 0x70, 0xfe, 0x71, 0x10, 0x41, 0x00, 0xf7, 0x41, 0x01, 0xf7, 0x70, 0xcf, 0x62, 0xda, 0x00, 0x71, 0x10, 0x41, 0xdc, 0xfe, 0x70, 0xcf, 0x43, 0x01, 0x08, 0x43, 0x00, 0x08, 0x50, 0x00, 0x08, 0x50, 0x1e, 0x08, 0x9c, 0x43, 0x38, 0xfe, 0x71, 0x01, 0x43, 0xe0, 0x10, 0x41, 0x7a, 0xef, 0x41, 0x7a, 0xfe, 0x71, 0x10, 0x41, 0xdc, 0xfd
, 0x41, 0xec, 0xfd, 0x43, 0xe0, 0x40, 0x41, 0xe0, 0xdf, 0x70, 0xcf, 0x43, 0xff, 0x08, 0x43, 0x7a, 0x10, 0x43, 0x7a, 0x01, 0x70, 0xfe, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x10, 0x7c, 0x07, 0xe2, 0x7c, 0x05, 0x8d, 0x7c, 0x05, 0xce, 0x20, 0x93, 0x4f, 0x40, 0x62, 0xe3, 0x38, 0x92, 0x85, 0x40, 0x38, 0xfc, 0x20, 0x7f, 0x62, 0xd0, 0x00, 0x3c, 0xb7, 0x00, 0xa0, 0x10, 0x9c, 0x1a, 0x62
, 0xd0, 0x00, 0x3c, 0xb8, 0x00, 0xb0, 0x30, 0x55, 0xb8, 0x01, 0x80, 0x2b, 0x62, 0xd0, 0x00, 0x50, 0x01, 0x3a, 0xa3, 0xd0, 0x08, 0x10, 0x7c, 0x04, 0x8d, 0x20, 0x80, 0x06, 0x10, 0x7c, 0x04, 0x89, 0x20, 0x62, 0xd0, 0x00, 0x50, 0x01, 0x3a, 0xa4, 0xd0, 0x08, 0x10, 0x7c, 0x04, 0x6a, 0x20, 0x80, 0x06, 0x10, 0x7c, 0x04, 0x66, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x03, 0x56, 0x02, 0x00, 0x56, 0x01
, 0x00, 0x56, 0x00, 0x00, 0x80, 0x37, 0x62, 0xd0, 0x00, 0x92, 0x1e, 0x40, 0x52, 0xfc, 0x04, 0x5c, 0x52, 0xfb, 0x0c, 0x5d, 0x51, 0x5d, 0x91, 0xfb, 0x40, 0x52, 0x02, 0x12, 0x5c, 0x52, 0x01, 0x1a, 0x5d, 0xd0, 0x18, 0x92, 0x04, 0x40, 0x52, 0xfc, 0x04, 0x5c, 0x52, 0xfb, 0x0c, 0x5d, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x54, 0x01, 0x3e, 0x5c, 0x54, 0x02, 0x77, 0x00, 0x52, 0x00, 0x3b, 0xfa
, 0xcf, 0xc5, 0x62, 0xd0, 0x00, 0x52, 0x02, 0x53, 0x5c, 0x52, 0x01, 0x53, 0x5d, 0x38, 0xfd, 0x20, 0x7f, 0x10, 0x7c, 0x04, 0x18, 0x20, 0x10, 0x50, 0x04, 0x08, 0x50, 0x00, 0x08, 0x50, 0x97, 0x08, 0x7c, 0x04, 0x21, 0x38, 0xfd, 0x20, 0x10, 0x50, 0x04, 0x08, 0x50, 0x00, 0x08, 0x50, 0x8f, 0x08, 0x7c, 0x04, 0x21, 0x38, 0xfd, 0x20, 0x10, 0x50, 0x04, 0x08, 0x50, 0x00, 0x08, 0x50, 0x93, 0x08
, 0x7c, 0x04, 0x21, 0x38, 0xfd, 0x20, 0x10, 0x50, 0x00, 0x7c, 0x03, 0x3c, 0x20, 0x10, 0x50, 0xff, 0x7c, 0x03, 0x3c, 0x20, 0x10, 0x50, 0xff, 0x7c, 0x03, 0x3c, 0x20, 0x7f, 0x62, 0xd0, 0x00, 0x76, 0xb0, 0x0e, 0xaf, 0x00, 0x50, 0x38, 0x12, 0xb0, 0x50, 0x01, 0x1a, 0xaf, 0xd0, 0x12, 0x55, 0xb0, 0x00, 0x55, 0xaf, 0x00, 0x76, 0x33, 0x50, 0x80, 0x3a, 0x33, 0xd0, 0x04, 0x55, 0x33, 0x0a, 0x7f
, 0x62, 0xd0, 0x00, 0x55, 0xb9, 0x00, 0x55, 0xba, 0x01, 0x10, 0x7c, 0x04, 0x8d, 0x7c, 0x04, 0x6a, 0x20, 0x9b, 0x06, 0x62, 0xe3, 0x38, 0x71, 0x10, 0x43, 0x00, 0x08, 0x41, 0x01, 0xf7, 0x70, 0xcf, 0x41, 0x00, 0xf7, 0x62, 0xd0, 0x00, 0x55, 0x2a, 0x08, 0x55, 0x2b, 0x0b, 0x55, 0x2c, 0x08, 0x55, 0x2e, 0x28, 0x55, 0x2f, 0x05, 0x55, 0x30, 0x12, 0x55, 0x31, 0x0d, 0x55, 0x32, 0x00, 0x55, 0x33
, 0x00, 0x55, 0x33, 0x0a, 0x3c, 0xb9, 0x00, 0xa0, 0x09, 0x51, 0x2f, 0x29, 0x80, 0x53, 0x2f, 0x80, 0x07, 0x62, 0xd0, 0x00, 0x26, 0x2f, 0x7f, 0x10, 0x50, 0x00, 0x08, 0x50, 0x2a, 0x08, 0x50, 0x09, 0x08, 0x50, 0x16, 0x08, 0x7c, 0x05, 0xe0, 0x38, 0xfc, 0x7c, 0x05, 0x8d, 0x7c, 0x05, 0xce, 0x20, 0x91, 0xc7, 0x40, 0x10, 0x7c, 0x07, 0xe2, 0x7c, 0x07, 0x6b, 0x20, 0x7c, 0x0c, 0xd1, 0x80, 0x24
, 0x62, 0xe3, 0x38, 0x9f, 0x57, 0x7c, 0x0f, 0xf9, 0x10, 0x7c, 0x07, 0xa9, 0x62, 0xd0, 0x00, 0x20, 0x39, 0x00, 0xa0, 0x09, 0x7c, 0x0a, 0x02, 0x7c, 0x0a, 0x5c, 0x80, 0x04, 0x7c, 0x0a, 0xd2, 0x9c, 0x87, 0x9e, 0x52, 0x8f, 0xdc, 0x8f, 0xff, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x65, 0x5c, 0x6b, 0x5d, 0x51, 0x5c, 0x01, 0x97, 0x53, 0x5a, 0x51, 0x5d, 0x09, 0x00, 0x7f, 0x52, 0x00, 0x53, 0x5c, 0x55
, 0x5d, 0x00, 0x55, 0x5a, 0x06, 0x55, 0x5b, 0x00, 0x55, 0x55, 0x00, 0x55, 0x54, 0x00, 0x3c, 0x5b, 0x00, 0xb0, 0x06, 0x3c, 0x5a, 0x00, 0xa0, 0x1a, 0x70, 0xfb, 0x6e, 0x5b, 0x6e, 0x5a, 0xd0, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x5c, 0x04, 0x55, 0x51, 0x5d, 0x0c, 0x54, 0x65, 0x5c, 0x6b, 0x5d, 0x8f, 0xde, 0x5f, 0x5c, 0x55, 0x5f, 0x5d, 0x54, 0x62, 0xd0, 0x00, 0x5a, 0x5a, 0x06, 0x5a, 0x01, 0x51
, 0x5a, 0x04, 0x5c, 0x0e, 0x5d, 0x03, 0x7f, 0x52, 0x02, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x65, 0x5c, 0x6b, 0x5d, 0x7f, 0x53, 0x5a, 0x51, 0x5d, 0x09, 0x00, 0x60, 0xd4, 0x3e, 0x5a, 0x53, 0x5b, 0x3e, 0x5a, 0x53, 0x5a, 0x7f, 0x0e, 0x5d, 0x00, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x53, 0x5d, 0x7f, 0x51, 0x5d, 0x60, 0xd5, 0x51, 0x5b, 0x3f, 0x5c, 0x51, 0x5a, 0x3f, 0x5c, 0x7f, 0x09, 0x00, 0x60
, 0xd4, 0x3e, 0x5a, 0x53, 0x5b, 0x3e, 0x5a, 0x7f, 0x60, 0xd4, 0x3e, 0x5a, 0x53, 0x5b, 0x3e, 0x5a, 0x53, 0x5a, 0x7f, 0x60, 0xd4, 0x3e, 0x5c, 0x53, 0x5d, 0x3e, 0x5c, 0x53, 0x5c, 0x7f, 0x62, 0xd0, 0x00, 0x52, 0x02, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x7f, 0x52, 0x00, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x65, 0x5c, 0x6b, 0x5d, 0x7f, 0x56, 0x00, 0x00, 0x62, 0xd0, 0x00, 0x51, 0xb1, 0x62, 0xd0, 0x00
, 0x53, 0x2a, 0x26, 0x2a, 0x0f, 0x7f, 0x06, 0x5c, 0x97, 0x0e, 0x5d, 0x00, 0x51, 0x5d, 0x60, 0xd4, 0x3e, 0x5c, 0x53, 0x5b, 0x3e, 0x5c, 0x16, 0x5c, 0x02, 0x53, 0x5a, 0x7f, 0x62, 0xd0, 0x00, 0x52, 0x00, 0x53, 0x5c, 0x55, 0x5d, 0x00, 0x7f, 0x3e, 0x5c, 0x53, 0x5c, 0x51, 0x5b, 0x60, 0xd4, 0x3e, 0x5a, 0x53, 0x59, 0x3e, 0x5a, 0x16, 0x5a, 0x02, 0x02, 0x5c, 0x53, 0x5c, 0x51, 0x59, 0x0a, 0x5d
, 0x53, 0x5d, 0x51, 0x5b, 0x60, 0xd5, 0x51, 0x5d, 0x3f, 0x5a, 0x51, 0x5c, 0x3f, 0x5a, 0x7f, 0x53, 0x5a, 0x51, 0x5d, 0x09, 0x00, 0x60, 0xd5, 0x52, 0x14, 0x3f, 0x5a, 0x52, 0x15, 0x3f, 0x5a, 0x7f, 0x51, 0x5b, 0x60, 0xd5, 0x51, 0x5d, 0x3f, 0x5a, 0x51, 0x5c, 0x3f, 0x5a, 0x7f, 0x60, 0xd4, 0x3e, 0x5a, 0x53, 0x5b, 0x3e, 0x5a, 0x12, 0x5c, 0x51, 0x5b, 0x1a, 0x5d, 0x7f, 0x53, 0x5c, 0x52, 0xfb
, 0x09, 0x00, 0x60, 0xd4, 0x3e, 0x5c, 0x7f, 0x0e, 0x5b, 0x00, 0x51, 0x5b, 0x60, 0xd5, 0x51, 0x5d, 0x3f, 0x5a, 0x7f, 0x60, 0xd5, 0x52, 0x14, 0x3f, 0x5a, 0x52, 0x15, 0x3f, 0x5a, 0x7f, 0x60, 0xd4, 0x3e, 0x5c, 0x54, 0x00, 0x3e, 0x5c, 0x54, 0x01, 0x7f, 0x0e, 0x5d, 0x00, 0x51, 0x5d, 0x60, 0xd5, 0x52, 0x14, 0x3f, 0x5c, 0x52, 0x15, 0x3f, 0x5c, 0x7f, 0x71, 0x10, 0x41, 0x04, 0xfe, 0x41, 0x05
, 0xfe, 0x41, 0x04, 0xfd, 0x41, 0x05, 0xfd, 0x70, 0xcf, 0x43, 0x04, 0x01, 0x43, 0x04, 0x02, 0x71, 0x01, 0x7f, 0x3e, 0x5c, 0x53, 0x5c, 0x51, 0x5a, 0x12, 0x5c, 0x51, 0x5b, 0x1a, 0x5d, 0x7f, 0x53, 0x58, 0x51, 0x5d, 0x09, 0x00, 0x60, 0xd4, 0x3e, 0x58, 0x53, 0x59, 0x3e, 0x58, 0x7f, 0x53, 0x5a, 0x55, 0x5b, 0x00, 0x65, 0x5a, 0x6b, 0x5b, 0x51, 0x5a, 0x7f, 0x0e, 0x5d, 0x00, 0x51, 0x5d, 0x60
, 0xd5, 0x50, 0x00, 0x3f, 0x5c, 0x7f, 0x00, 0x2a, 0x00, 0x2a, 0x00, 0x67, 0x00, 0x28, 0x00, 0x9b, 0x00, 0x08, 0x00, 0xa3, 0x06, 0x08, 0x08, 0x08, 0x08, 0x12, 0x0d, 0x00, 0xa9, 0x00, 0x0d, 0x00, 0xb6, 0x09, 0x03, 0x01, 0x01, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0xff, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
};
unsigned char firmware_data1[] = { /* 111006 HW03 SW05 */
0x40, 0x7d, 0x00, 0x68, 0x30, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7d, 0x00, 0x68, 0x7e, 0x7e, 0x30, 0x30, 0x30, 0x7d, 0x05, 0x2c, 0x7e, 0x7e, 0x30, 0x30, 0x30, 0x7d, 0x06, 0x79, 0x7e, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30
, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x7e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x40, 0x71, 0x10, 0x62, 0xe3, 0x06, 0x70, 0xef, 0x62, 0xe3, 0x38, 0x50, 0x80, 0x4e, 0x62, 0xe3, 0x38, 0x5d, 0xd5, 0x08, 0x62, 0xd5, 0x00, 0x55
, 0xfa, 0x01, 0x40, 0x4f, 0x5b, 0x01, 0x03, 0x53, 0xf9, 0x55, 0xf8, 0x3a, 0x50, 0x06, 0x00, 0x40, 0x40, 0x71, 0x10, 0x51, 0xfa, 0x60, 0xe8, 0x70, 0xef, 0x18, 0x60, 0xd5, 0x55, 0xf8, 0x00, 0x55, 0xf9, 0x00, 0x71, 0x10, 0x62, 0xe0, 0x1a, 0x70, 0xef, 0x62, 0xe3, 0x38, 0x71, 0x10, 0x41, 0xe1, 0xfe, 0x70, 0xef, 0x62, 0xe3, 0x38, 0x62, 0xd1, 0x03, 0x50, 0x80, 0x4e, 0x62, 0xd3, 0x03, 0x62
, 0xd0, 0x00, 0x62, 0xd5, 0x00, 0x62, 0xd4, 0x00, 0x71, 0xc0, 0x7c, 0x03, 0x99, 0x62, 0xd0, 0x00, 0x50, 0x02, 0x57, 0x40, 0x08, 0x28, 0x53, 0x49, 0x18, 0x75, 0x09, 0x00, 0x28, 0x4b, 0x51, 0x49, 0x80, 0x04, 0x75, 0x09, 0x00, 0x62, 0xe3, 0x00, 0x08, 0x28, 0x60, 0xd5, 0x74, 0xa0, 0x4b, 0x18, 0x75, 0x09, 0x00, 0x08, 0x28, 0x53, 0x49, 0x18, 0x75, 0x09, 0x00, 0x08, 0x28, 0xa0, 0x1c, 0x53
, 0x48, 0x18, 0x75, 0x09, 0x00, 0x08, 0x28, 0x3f, 0x49, 0x47, 0x49, 0xff, 0xb0, 0x06, 0x5d, 0xd5, 0x74, 0x60, 0xd5, 0x18, 0x7a, 0x48, 0xbf, 0xeb, 0x8f, 0xc9, 0x18, 0x75, 0x09, 0x00, 0x08, 0x28, 0x53, 0x48, 0x50, 0x00, 0x3f, 0x49, 0x47, 0x49, 0xff, 0xb0, 0x08, 0x5d, 0xd5, 0x74, 0x60, 0xd5, 0x50, 0x00, 0x7a, 0x48, 0xbf, 0xef, 0x18, 0x8f, 0xaa, 0x18, 0x71, 0x10, 0x43, 0xe3, 0x00, 0x70
, 0xef, 0x62, 0xe0, 0x00, 0x41, 0xfe, 0xe7, 0x43, 0xfe, 0x10, 0x71, 0x10, 0x43, 0xe9, 0x20, 0x62, 0xe0, 0x1a, 0x70, 0xef, 0x62, 0xe2, 0x00, 0x7c, 0x19, 0x0d, 0x8f, 0xff, 0x7f, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x01, 0x99, 0x03, 0x33, 0x06, 0x66, 0x0c, 0xcc, 0x19, 0x99, 0x33, 0x33, 0x66, 0x66, 0xcc, 0xcc, 0x01, 0x80, 0x03, 0x00, 0x06, 0x00, 0x0b, 0xff, 0x18, 0x00, 0x2f, 0xff, 0x5f, 0xff, 0xbf, 0xff, 0x01, 0x66, 0x02, 0xcc, 0x05, 0x99, 0x0b, 0x32, 0x16, 0x66, 0x2c, 0xcc, 0x59, 0x98, 0xb3, 0x32, 0x01, 0x33, 0x02, 0x66, 0x04, 0xcc, 0x09, 0x99, 0x13, 0x33, 0x26, 0x65, 0x4c, 0xcc, 0x99, 0x99
, 0x1b, 0xa6, 0x70, 0xef, 0x62, 0x61, 0x00, 0x62, 0xfd, 0x00, 0x62, 0xcd, 0x00, 0x62, 0xce, 0x00, 0x62, 0xa5, 0x00, 0x62, 0xa4, 0x00, 0x62, 0xa0, 0x00, 0x62, 0xa1, 0x80, 0x62, 0xa2, 0xc0, 0x62, 0xa3, 0x0c, 0x62, 0xa8, 0x00, 0x62, 0xa6, 0x00, 0x62, 0xa7, 0x00, 0x62, 0x7c, 0x33, 0x62, 0x7a, 0x00, 0x62, 0x7b, 0x00, 0x62, 0x79, 0x00, 0x62, 0x36, 0x00, 0x62, 0x37, 0x00, 0x62, 0x38, 0x00
, 0x62, 0x39, 0x00, 0x62, 0x3a, 0x00, 0x62, 0x3b, 0x00, 0x62, 0x3c, 0x00, 0x62, 0x3d, 0x00, 0x62, 0x3e, 0x00, 0x62, 0x3f, 0x00, 0x62, 0x40, 0x00, 0x62, 0x41, 0x00, 0x62, 0x42, 0x00, 0x62, 0x43, 0x00, 0x62, 0x44, 0x00, 0x62, 0x45, 0x00, 0x62, 0x46, 0x00, 0x62, 0x47, 0x00, 0x62, 0x48, 0x00, 0x62, 0x49, 0x00, 0x62, 0x4a, 0x00, 0x62, 0x4b, 0x00, 0x62, 0x4c, 0x00, 0x62, 0x4d, 0x00, 0x62
, 0x4e, 0x00, 0x62, 0x4f, 0x00, 0x62, 0xca, 0x20, 0x62, 0xd6, 0x44, 0x62, 0xcf, 0x00, 0x62, 0xcb, 0x00, 0x62, 0xc8, 0x00, 0x62, 0xcc, 0x00, 0x62, 0xc9, 0x00, 0x62, 0xd7, 0x00, 0x62, 0xa9, 0x00, 0x62, 0x2b, 0x00, 0x62, 0xb0, 0x00, 0x62, 0xb3, 0x02, 0x62, 0xb6, 0x00, 0x62, 0xb2, 0x00, 0x62, 0xb5, 0x00, 0x62, 0xb8, 0x00, 0x62, 0xb1, 0x00, 0x62, 0xb4, 0x00, 0x62, 0xb7, 0x00, 0x62, 0x33
, 0x00, 0x62, 0x34, 0x00, 0x62, 0x35, 0x00, 0x71, 0x10, 0x62, 0x54, 0x00, 0x62, 0x55, 0x00, 0x62, 0x56, 0x00, 0x62, 0x57, 0x00, 0x62, 0x58, 0x00, 0x62, 0x59, 0x00, 0x62, 0x5a, 0x00, 0x62, 0x5b, 0x00, 0x62, 0xdc, 0x00, 0x62, 0xe2, 0x00, 0x62, 0xdd, 0x00, 0x62, 0xd8, 0x02, 0x62, 0xd9, 0x00, 0x62, 0xda, 0x28, 0x62, 0xdb, 0x00, 0x62, 0xdf, 0x00, 0x62, 0x29, 0x00, 0x62, 0x30, 0x00, 0x62
, 0xbd, 0x00, 0x70, 0xef, 0x70, 0xef, 0x62, 0x00, 0x00, 0x71, 0x10, 0x62, 0x00, 0x00, 0x62, 0x01, 0x9a, 0x70, 0xef, 0x62, 0x04, 0x17, 0x71, 0x10, 0x62, 0x04, 0x17, 0x62, 0x05, 0xab, 0x70, 0xef, 0x62, 0x08, 0x00, 0x71, 0x10, 0x62, 0x08, 0x00, 0x62, 0x09, 0x28, 0x70, 0xef, 0x62, 0x0c, 0x00, 0x71, 0x10, 0x62, 0x0c, 0x00, 0x62, 0x0d, 0x00, 0x70, 0xef, 0x62, 0x10, 0x00, 0x71, 0x10, 0x62
, 0x10, 0x00, 0x62, 0x11, 0x00, 0x70, 0xef, 0x62, 0x01, 0x00, 0x62, 0x05, 0x00, 0x62, 0x09, 0x00, 0x62, 0x0d, 0x00, 0x62, 0x11, 0x00, 0x70, 0xef, 0x7f, 0x55, 0x02, 0x00, 0x55, 0x03, 0x17, 0x55, 0x04, 0x00, 0x7c, 0x03, 0xa6, 0x7f, 0x7c, 0x02, 0x42, 0x70, 0xef, 0x7f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x62, 0xd0, 0x00, 0x53
, 0x00, 0x71, 0x10, 0x5d, 0xe0, 0x08, 0x21, 0xf8, 0x29, 0x00, 0x70, 0xfe, 0x60, 0xe0, 0x70, 0xef, 0x4b, 0x4b, 0x4b, 0x4b, 0x51, 0x02, 0x21, 0xf7, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08
, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x6e, 0x00, 0xc0, 0x05
, 0x21, 0xf7, 0x80, 0x05, 0x29, 0x08, 0x80, 0x01, 0x60, 0x00, 0x47, 0x00, 0x00, 0x49, 0x01, 0x00, 0x29, 0x08, 0x60, 0x00, 0x57, 0x01, 0x79, 0xbf, 0xfe, 0x18, 0x71, 0x10, 0x60, 0xe0, 0x70, 0xef, 0x71, 0x01, 0x7f, 0x08, 0x67, 0x67, 0x67, 0x67, 0x21, 0x0f, 0xff, 0x40, 0x9f, 0x4e, 0x18, 0x21, 0x0f, 0xff, 0x39, 0x9f, 0x47, 0x7f, 0x08, 0x10, 0x28, 0xa0, 0x0b, 0x9f, 0x3f, 0x20, 0x18, 0x75
, 0xdf, 0xf5, 0x74, 0x8f, 0xf2, 0x38, 0xfe, 0x7f, 0x52, 0x00, 0xa0, 0x08, 0x10, 0x9f, 0x2d, 0x20, 0x75, 0x8f, 0xf6, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x50, 0x0d, 0x9f, 0x20, 0x50, 0x0a, 0x9f, 0x1c, 0x7f, 0x70, 0xbf, 0x62, 0xd3, 0x03, 0x4f, 0x52, 0xfb, 0xa0, 0x15, 0x7b, 0xfb, 0x52, 0xfc, 0x59, 0xfd, 0x60, 0xd3, 0x52, 0x00, 0x9f, 0x05, 0x4f, 0x62, 0xd3, 0x03, 0x77, 0xfd, 0x8f, 0xe9, 0x70
, 0x3f, 0x71, 0xc0, 0x7f, 0x3d, 0xfa, 0x00, 0xb0, 0x06, 0x3d, 0xfb, 0x00, 0xa0, 0x18, 0x10, 0x52, 0xfc, 0x59, 0xfd, 0x28, 0x9e, 0xe6, 0x20, 0x07, 0xfd, 0x01, 0x0f, 0xfc, 0x00, 0x17, 0xfb, 0x01, 0x1f, 0xfa, 0x00, 0x8f, 0xe0, 0x7f, 0x50, 0x01, 0x80, 0x03, 0x50, 0x00, 0x62, 0xd0, 0x00, 0x29, 0x00, 0xa0, 0x06, 0x26, 0x03, 0xfb, 0x80, 0x04, 0x2e, 0x03, 0x04, 0x51, 0x03, 0x60, 0x04, 0x70
, 0x3f, 0x71, 0xc0, 0x7f, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x50, 0x01, 0x80, 0x03, 0x50, 0x00, 0x62, 0xd0, 0x00, 0x29, 0x00, 0xa0, 0x06, 0x26, 0x03, 0xef, 0x80, 0x04, 0x2e, 0x03, 0x10, 0x51, 0x03, 0x60, 0x04, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x08, 0x10, 0x70, 0x3f, 0x71, 0x80, 0x5d, 0xd3, 0x08, 0x5d, 0xd0, 0x08, 0x62, 0xd0, 0x00, 0x51, 0x08, 0x60, 0xd3, 0x2e
, 0x05, 0x80, 0x49, 0xd7, 0x08, 0xa0, 0x09, 0x26, 0x05, 0xf0, 0x2e, 0x05, 0x00, 0x80, 0x08, 0x49, 0xd7, 0x20, 0xa0, 0x03, 0x80, 0xa6, 0x51, 0x05, 0x21, 0x0e, 0xe0, 0x01, 0x80, 0x11, 0x80, 0x67, 0x80, 0x79, 0x80, 0x47, 0x80, 0x96, 0x80, 0x94, 0x80, 0x92, 0x80, 0x90, 0x80, 0x97, 0x5d, 0xd8, 0x21, 0xfe, 0x39, 0x40, 0xa0, 0x06, 0x62, 0xd7, 0x00, 0x80, 0x8a, 0x49, 0xd8, 0x01, 0xb0, 0x0f
, 0x55, 0x0c, 0x02, 0x26, 0x05, 0xf0, 0x2e, 0x05, 0x02, 0x62, 0xd7, 0x10, 0x80, 0x77, 0x55, 0x0c, 0x01, 0x26, 0x05, 0xf0, 0x2e, 0x05, 0x06, 0x5f, 0x07, 0x06, 0x51, 0x09, 0x02, 0x07, 0x5c, 0x52, 0x00, 0x60, 0xd8, 0x76, 0x07, 0x62, 0xd7, 0x14, 0x80, 0x5b, 0x51, 0x0a, 0x78, 0x3a, 0x07, 0xc0, 0x0f, 0x51, 0x09, 0x02, 0x07, 0x5c, 0x52, 0x00, 0x60, 0xd8, 0x76, 0x07, 0x2e, 0x05, 0x20, 0x60
, 0xd8, 0x62, 0xd7, 0x04, 0x80, 0x3f, 0x5d, 0xd8, 0x3a, 0x0a, 0xd0, 0x2b, 0xa0, 0x29, 0x53, 0x07, 0x53, 0x06, 0x26, 0x05, 0xf0, 0x2e, 0x05, 0x04, 0x80, 0x18, 0x51, 0x0b, 0x78, 0x3a, 0x07, 0xc0, 0x16, 0x51, 0x09, 0x02, 0x07, 0x5c, 0x5d, 0xd8, 0x54, 0x00, 0x2e, 0x05, 0x10, 0x76, 0x07, 0x80, 0x01, 0x62, 0xd7, 0x10, 0x80, 0x0f, 0x62, 0xd7, 0x00, 0x80, 0x0a, 0x26, 0x05, 0xf0, 0x2e, 0x05
, 0x00, 0x55, 0x0c, 0x00, 0x18, 0x60, 0xd0, 0x18, 0x60, 0xd3, 0x20, 0x18, 0x7e, 0x62, 0xd0, 0x00, 0x71, 0x10, 0x41, 0x04, 0xfc, 0x43, 0x05, 0x03, 0x70, 0xef, 0x26, 0x03, 0xfc, 0x51, 0x03, 0x60, 0x04, 0x55, 0x0c, 0x00, 0x90, 0x28, 0x90, 0x2d, 0x40, 0x40, 0x40, 0x40, 0x40, 0x50, 0x00, 0x53, 0x06, 0x71, 0x10, 0x43, 0x04, 0x03, 0x43, 0x05, 0x03, 0x70, 0xef, 0x2e, 0x03, 0x03, 0x51, 0x03
, 0x60, 0x04, 0x7f, 0x62, 0xd0, 0x00, 0x51, 0x05, 0x21, 0xb0, 0x26, 0x05, 0x4f, 0x7f, 0x41, 0xe0, 0x7f, 0x43, 0xe0, 0x80, 0x7f, 0x43, 0xd6, 0x31, 0x7f, 0x41, 0xe0, 0x7f, 0x41, 0xd6, 0xfe, 0x7f, 0x62, 0xd0, 0x00, 0x4f, 0x52, 0xfd, 0x53, 0x0a, 0x52, 0xfc, 0x53, 0x0b, 0x52, 0xfb, 0x53, 0x09, 0x52, 0xfa, 0x53, 0x08, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x08, 0x5d, 0xa4, 0x04, 0x1b, 0x5d, 0xa5
, 0x0c, 0x1a, 0x55, 0x1c, 0x01, 0x18, 0x7e, 0x70, 0xbf, 0x62, 0xd0, 0x00, 0x70, 0xbf, 0x53, 0x1e, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x8e, 0x62, 0xd3, 0x00, 0x13, 0x6c, 0x62, 0xd3, 0x00, 0x54, 0x70, 0x62, 0xd3, 0x00, 0x52, 0x8d, 0x62, 0xd3, 0x00, 0x1b, 0x6b, 0x62, 0xd3, 0x00, 0x54, 0x6f, 0x48, 0x6f, 0x80, 0xb0, 0x33, 0x3d, 0x6f, 0x00, 0xb0, 0x7b, 0x51, 0x0d, 0x3b, 0x70, 0xc0, 0x75
, 0x52, 0x70, 0x58, 0x1e, 0x01, 0x00, 0x6d, 0x62, 0xd3, 0x00, 0x05, 0x4a, 0xc0, 0x09, 0x51, 0x0f, 0x3b, 0x4a, 0xd0, 0x12, 0xa0, 0x10, 0x56, 0x4a, 0x00, 0x5b, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x07, 0x6c, 0x01, 0x0f, 0x6b, 0x00, 0x80, 0x41, 0x3d, 0x6f, 0xff, 0xb0, 0x09, 0x50, 0xff, 0x12, 0x0e, 0x3b, 0x70, 0xc0, 0x20, 0x62, 0xd3, 0x00, 0x56, 0x70, 0x00, 0x56, 0x6f, 0x00, 0x5b, 0x67, 0x5c
, 0x62, 0xd3, 0x00, 0x52, 0x51, 0x78, 0xd0, 0x03, 0x50, 0x00, 0x54, 0x51, 0x08, 0x5b, 0x64, 0x5c, 0x18, 0xb0, 0x2c, 0x62, 0xd3, 0x00, 0x52, 0x8e, 0x62, 0xd3, 0x00, 0x54, 0x6c, 0x62, 0xd3, 0x00, 0x52, 0x8d, 0x62, 0xd3, 0x00, 0x54, 0x6b, 0x51, 0x1e, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x56, 0x70, 0x00, 0x56, 0x6f, 0x00, 0x5b, 0x67, 0x5c, 0x62, 0xd3, 0x00, 0x51, 0x12, 0x54, 0x51, 0x70, 0x3f
, 0x71, 0xc0, 0x7f, 0x70, 0xbf, 0x62, 0xd0, 0x00, 0x70, 0xbf, 0x08, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x4c, 0x53, 0x19, 0x55, 0x18, 0x00, 0x18, 0x08, 0x90, 0x7e, 0x62, 0xd3, 0x00, 0x23, 0x4e, 0xb0, 0x2c, 0x51, 0x10, 0x04, 0x19, 0x0e, 0x18, 0x00, 0x18, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x70, 0x12, 0x19, 0x52, 0x6f, 0x1a, 0x18, 0xc0, 0x39, 0x5b, 0x67, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x4f
, 0x78, 0x54, 0x4f, 0x08, 0x5b, 0x64, 0x5c, 0x18, 0xb0, 0x3e, 0x80, 0x18, 0x51, 0x10, 0x14, 0x19, 0x1e, 0x18, 0x00, 0x18, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x70, 0x12, 0x19, 0x52, 0x6f, 0x1a, 0x18, 0xc0, 0x0e, 0x5b, 0x67, 0x90, 0x31, 0x62, 0xd3, 0x00, 0x2d, 0x4e, 0x50, 0x01, 0x80, 0x24, 0x5b, 0x67, 0x08, 0x90, 0x23, 0x73, 0x62, 0xd3, 0x00, 0x25, 0x4e, 0x62, 0xd3, 0x00, 0x20, 0x51
, 0x11, 0x54, 0x4f, 0x50, 0x00, 0x80, 0x0d, 0x5b, 0x67, 0x90, 0x0d, 0x73, 0x62, 0xd3, 0x00, 0x25, 0x4e, 0x50, 0x00, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x08, 0x67, 0x67, 0x67, 0x5c, 0x18, 0x21, 0x07, 0xf0, 0x01, 0x7f, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x70, 0xbf, 0x70, 0xbf, 0x62, 0xd3, 0x00, 0x50, 0x02, 0x78, 0x08, 0x5c, 0x56, 0x4c, 0x32, 0x18, 0x78, 0xdf, 0xf8, 0x70, 0x3f
, 0x71, 0xc0, 0x7f, 0x08, 0x91, 0xb2, 0x70, 0xbf, 0x18, 0x08, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x8e, 0x62, 0xd3, 0x00, 0x54, 0x6c, 0x62, 0xd3, 0x00, 0x52, 0x8d, 0x62, 0xd3, 0x00, 0x54, 0x6b, 0x18, 0x78, 0xdf, 0xe0, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x62, 0xd0, 0x00, 0x55, 0x14, 0x00, 0x50, 0x02, 0x78, 0x08, 0x9f, 0x0e, 0x39, 0x01, 0xb0, 0x04, 0x55, 0x14, 0x01, 0x18, 0x78, 0xdf, 0xf3
, 0x51, 0x14, 0x7f, 0x50, 0x02, 0x78, 0x08, 0x9e, 0x3e, 0x18, 0x78, 0xdf, 0xfa, 0x7f, 0x98, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0xd8, 0xd9, 0xda, 0xdb, 0xdf, 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff, 0x70, 0xbf, 0x62, 0xd0, 0x00, 0x62, 0xd3, 0x00, 0x57, 0x00, 0x56, 0x4e, 0x00, 0x79, 0xdf, 0xfb, 0x62, 0xd3, 0x00, 0x57, 0x01, 0x50, 0x03, 0x54, 0x4f, 0x79, 0xdf
, 0xfc, 0x62, 0xd3, 0x00, 0x50, 0x14, 0x57, 0x01, 0x54, 0x51, 0x79, 0xdf, 0xfc, 0x70, 0x3f, 0x71, 0xc0, 0x55, 0x0d, 0x1e, 0x55, 0x0e, 0x05, 0x55, 0x0f, 0x14, 0x55, 0x10, 0x01, 0x55, 0x11, 0x03, 0x55, 0x12, 0x14, 0x55, 0x22, 0x04, 0x55, 0x1f, 0x14, 0x43, 0x61, 0x0d, 0x57, 0x00, 0x50, 0x02, 0x90, 0xae, 0x50, 0x04, 0xff, 0x98, 0x29, 0x00, 0x60, 0xa9, 0x62, 0xa0, 0x08, 0x43, 0xa2, 0x04
, 0x62, 0xa3, 0x70, 0x43, 0x7a, 0x01, 0x43, 0xaa, 0x02, 0x43, 0xdf, 0x01, 0x50, 0x01, 0x57, 0x09, 0x90, 0x20, 0x90, 0x55, 0x57, 0x01, 0x50, 0xb3, 0x91, 0x5d, 0x50, 0x00, 0x57, 0x0e, 0x90, 0x12, 0x90, 0x47, 0x7f, 0x53, 0x22, 0xff, 0x67, 0x29, 0x00, 0x60, 0xa9, 0x51, 0x21, 0x58, 0x20, 0x90, 0x01, 0x7f, 0x62, 0xd0, 0x00, 0x21, 0x03, 0x53, 0x21, 0x64, 0x64, 0x64, 0x64, 0x64, 0x29, 0x80
, 0x60, 0xa1, 0x5b, 0x78, 0x21, 0x0f, 0x29, 0x08, 0x74, 0x53, 0x20, 0x12, 0x22, 0x02, 0x21, 0x5c, 0x50, 0x00, 0x53, 0x1d, 0x53, 0x23, 0x29, 0x01, 0x79, 0xa0, 0x08, 0x64, 0x6b, 0x1d, 0x6b, 0x23, 0x8f, 0xf5, 0x60, 0xb5, 0x51, 0x1d, 0x60, 0xb4, 0x7f, 0x50, 0x02, 0x78, 0x08, 0x90, 0x28, 0x90, 0x5a, 0x18, 0x78, 0xdf, 0xf8, 0x7f, 0x41, 0xdf, 0xfe, 0x71, 0x10, 0x41, 0xd8, 0xfd, 0x70, 0xef
, 0x41, 0x61, 0xf3, 0x41, 0xa2, 0xfb, 0x41, 0xa0, 0xf7, 0x62, 0xa3, 0x00, 0x62, 0xa9, 0x00, 0x41, 0xaa, 0xfd, 0x7f, 0x02, 0x20, 0x02, 0x08, 0x64, 0x5c, 0xff, 0xf8, 0x4b, 0x74, 0xff, 0xf4, 0x7f, 0x62, 0xd0, 0x00, 0x53, 0x1d, 0x10, 0x5b, 0x64, 0x64, 0x5c, 0x71, 0x10, 0x5e, 0x01, 0x2a, 0x1d, 0x61, 0x01, 0x36, 0x1d, 0xff, 0x5e, 0x00, 0x22, 0x1d, 0x61, 0x00, 0x36, 0x1d, 0xff, 0x18, 0xfe
, 0xd6, 0x5c, 0x5e, 0x00, 0x2a, 0x1d, 0x61, 0x00, 0x70, 0xef, 0x7f, 0x62, 0xd0, 0x00, 0x10, 0x73, 0x53, 0x1d, 0x71, 0x10, 0x5b, 0xfe, 0xc0, 0x5c, 0x5e, 0x00, 0x22, 0x1d, 0x61, 0x00, 0x70, 0xef, 0x18, 0x64, 0x64, 0x5c, 0x71, 0x10, 0x5e, 0x01, 0x22, 0x1d, 0x61, 0x01, 0x36, 0x1d, 0xff, 0x5e, 0x00, 0x2a, 0x1d, 0x61, 0x00, 0x70, 0xef, 0x7f, 0x70, 0xbf, 0x62, 0xd0, 0x00, 0x53, 0x1e, 0x50
, 0x00, 0x53, 0x1a, 0x53, 0x1b, 0x51, 0x1e, 0x5c, 0x62, 0xd3, 0x00, 0x52, 0x24, 0x53, 0x1f, 0x43, 0xa0, 0x01, 0x51, 0x1f, 0x60, 0xfd, 0x41, 0xa3, 0xdf, 0x51, 0x1e, 0x9f, 0x7a, 0x9f, 0x81, 0x58, 0x23, 0x55, 0x1c, 0x00, 0x62, 0xa5, 0x00, 0x62, 0xa4, 0x00, 0x43, 0xb3, 0x01, 0x51, 0x1c, 0xaf, 0xfd, 0x79, 0xdf, 0xee, 0x51, 0x1e, 0x9f, 0x5f, 0x9f, 0x91, 0x43, 0xa3, 0x20, 0x41, 0xa0, 0xfe
, 0x62, 0xfd, 0x00, 0x50, 0xff, 0x4c, 0x1b, 0x14, 0x1b, 0x51, 0x20, 0x11, 0x08, 0xfe, 0x4d, 0x4c, 0x1a, 0x1c, 0x1a, 0xd0, 0x07, 0x55, 0x1a, 0x00, 0x55, 0x1b, 0x00, 0x51, 0x1e, 0x64, 0x5c, 0x62, 0xd3, 0x00, 0x51, 0x1b, 0x54, 0x8e, 0x51, 0x1a, 0x54, 0x8d, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x08, 0x9f, 0x86, 0x18, 0x78, 0xdf, 0xfa, 0x7f, 0x70, 0xbf, 0x62, 0xd0, 0x00, 0x53, 0x27, 0x5a, 0x26
, 0x55, 0x1e, 0x01, 0x62, 0xd3, 0x00, 0x58, 0x1e, 0x56, 0x24, 0x80, 0x55, 0x29, 0x08, 0x55, 0x28, 0x80, 0x51, 0x1e, 0x9f, 0x63, 0x51, 0x1e, 0x9f, 0x5f, 0x70, 0xbf, 0x58, 0x1e, 0x62, 0xd3, 0x00, 0x51, 0x1b, 0x3a, 0x27, 0x51, 0x1a, 0x1a, 0x26, 0xd0, 0x06, 0x51, 0x28, 0x73, 0x25, 0x24, 0x68, 0x28, 0x26, 0x28, 0x7f, 0x51, 0x28, 0x2d, 0x24, 0x7a, 0x29, 0xbf, 0xd6, 0x7a, 0x1e, 0xdf, 0xc4
, 0x70, 0x3f, 0x71, 0xc0, 0x7f, 0x62, 0xd0, 0x00, 0x51, 0x94, 0x11, 0x35, 0x51, 0x93, 0x19, 0x0c, 0xd0, 0x12, 0x7c, 0x14, 0x91, 0x39, 0x0f, 0xa0, 0x16, 0x62, 0xd0, 0x00, 0x76, 0x94, 0x0e, 0x93, 0x00, 0x80, 0x0c, 0x62, 0xd0, 0x00, 0x55, 0x94, 0x00, 0x55, 0x93, 0x00, 0x90, 0xa9, 0x7f, 0x62, 0xd0, 0x00, 0x3c, 0x9e, 0xf0, 0xd0, 0x03, 0x76, 0x9e, 0x62, 0xd0, 0x00, 0x51, 0x2f, 0x21, 0x7f
, 0x53, 0x49, 0x51, 0x9e, 0x3a, 0x49, 0xb0, 0x50, 0x7c, 0x14, 0x91, 0x62, 0xd0, 0x00, 0x53, 0x9f, 0x3c, 0x9f, 0x0f, 0xa0, 0x3d, 0x3c, 0x9b, 0x00, 0xb0, 0x1c, 0x55, 0x89, 0x00, 0x55, 0x8a, 0x00, 0x51, 0x9f, 0x53, 0x48, 0x55, 0x49, 0x00, 0x06, 0x48, 0x89, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd5, 0x50, 0x08, 0x3f, 0x48, 0x62, 0xd0, 0x00, 0x55, 0x98, 0x00, 0x3c, 0x9d, 0x00, 0xb0, 0x0a
, 0x7c, 0x15, 0x26, 0x62, 0xd0, 0x00, 0x55, 0x9d, 0x01, 0x62, 0xd0, 0x00, 0x55, 0x97, 0x05, 0x80, 0x07, 0x62, 0xd0, 0x00, 0x55, 0x9e, 0x00, 0x7f, 0x62, 0xd0, 0x00, 0x55, 0x94, 0x00, 0x55, 0x93, 0x00, 0x3c, 0x9d, 0x01, 0xb0, 0x31, 0x7a, 0x97, 0x3c, 0x97, 0x00, 0xb0, 0x2a, 0x3c, 0x9d, 0x01, 0xb0, 0x0a, 0x7c, 0x15, 0xb9, 0x62, 0xd0, 0x00, 0x55, 0x9d, 0x00, 0x62, 0xd0, 0x00, 0x3c, 0x9b
, 0x00, 0xb0, 0x0e, 0x51, 0x9f, 0x53, 0x48, 0x55, 0x49, 0x00, 0x06, 0x48, 0x89, 0x7c, 0x1b, 0x67, 0x62, 0xd0, 0x00, 0x55, 0x9e, 0x00, 0x7f, 0x10, 0x4f, 0x38, 0x16, 0x62, 0xd0, 0x00, 0x3c, 0x9a, 0x00, 0xb0, 0x05, 0x51, 0x79, 0x53, 0x24, 0x56, 0x0d, 0x00, 0x80, 0x67, 0x56, 0x00, 0x00, 0x80, 0x5b, 0x62, 0xd0, 0x00, 0x3c, 0x9a, 0x00, 0xb0, 0x1b, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00
, 0x06, 0x48, 0x79, 0x7c, 0x1a, 0x6d, 0x52, 0x00, 0x53, 0x46, 0x55, 0x47, 0x00, 0x06, 0x46, 0x24, 0x7c, 0x1b, 0x23, 0x10, 0x52, 0x00, 0x7c, 0x09, 0xb8, 0x20, 0x10, 0x7c, 0x06, 0x43, 0x62, 0xd0, 0x00, 0x20, 0x39, 0x00, 0xbf, 0xee, 0x7c, 0x19, 0xdc, 0x52, 0x0d, 0x7c, 0x1b, 0x5b, 0x02, 0x48, 0x53, 0x48, 0x51, 0x47, 0x0a, 0x49, 0x53, 0x49, 0x7c, 0x1b, 0x17, 0x06, 0x46, 0x8d, 0x0e, 0x47
, 0x00, 0x51, 0x47, 0x7c, 0x1a, 0x79, 0x7c, 0x1a, 0x8f, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xcf, 0xa2, 0x77, 0x0d, 0x3d, 0x0d, 0x03, 0xcf, 0x96, 0x56, 0x00, 0x00, 0x81, 0x05, 0x7c, 0x19, 0xc0, 0x7c, 0x1a, 0x28, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x54, 0x0e, 0x3e, 0x48, 0x54, 0x0f, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x55, 0x46, 0x06, 0x55, 0x47, 0x00, 0x55, 0x41, 0x00, 0x55, 0x40
, 0x00, 0x3c, 0x47, 0x00, 0xb0, 0x06, 0x3c, 0x46, 0x00, 0xa0, 0x1a, 0x70, 0xfb, 0x6e, 0x47, 0x6e, 0x46, 0xd0, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x48, 0x04, 0x41, 0x51, 0x49, 0x0c, 0x40, 0x65, 0x48, 0x6b, 0x49, 0x8f, 0xde, 0x5f, 0x48, 0x41, 0x5f, 0x49, 0x40, 0x62, 0xd0, 0x00, 0x5a, 0x46, 0x06, 0x46, 0x03, 0x51, 0x46, 0x04, 0x48, 0x0e, 0x49, 0x03, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x54
, 0x10, 0x3e, 0x48, 0x54, 0x11, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x55, 0x46, 0x06, 0x55, 0x47, 0x00, 0x55, 0x41, 0x00, 0x55, 0x40, 0x00, 0x3c, 0x47, 0x00, 0xb0, 0x06, 0x3c, 0x46, 0x00, 0xa0, 0x1a, 0x70, 0xfb, 0x6e, 0x47, 0x6e, 0x46, 0xd0, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x48, 0x04, 0x41, 0x51, 0x49, 0x0c, 0x40, 0x65, 0x48, 0x6b, 0x49, 0x8f, 0xde, 0x5f, 0x48, 0x41, 0x5f, 0x49
, 0x40, 0x62, 0xd0, 0x00, 0x5a, 0x46, 0x06, 0x46, 0x05, 0x51, 0x46, 0x04, 0x48, 0x0e, 0x49, 0x03, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x54, 0x12, 0x3e, 0x48, 0x54, 0x13, 0x50, 0x03, 0x08, 0x5a, 0x48, 0x06, 0x48, 0x0e, 0x08, 0x51, 0x48, 0x08, 0x7c, 0x18, 0x3d, 0x38, 0xfd, 0x62, 0xd0, 0x00, 0x51, 0x48, 0x54, 0x15, 0x51, 0x49, 0x54, 0x14, 0x7c, 0x19, 0xb4, 0x7c, 0x1a, 0xa7, 0x7c, 0x1a
, 0xf1, 0x06, 0x48, 0x6b, 0x7c, 0x1b, 0x07, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x5b, 0x7c, 0x1a, 0xc8, 0x51, 0x48, 0x01, 0x63, 0x7c, 0x1a, 0xc8, 0x06, 0x48, 0x53, 0x7c, 0x1b, 0x07, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xce, 0xf8, 0x38, 0xea, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x16, 0x10, 0x57, 0x09, 0x50, 0x01, 0x7c, 0x08, 0xf2, 0x20, 0x62, 0xd0, 0x00, 0x50, 0x02, 0x10, 0x08, 0x57, 0x30, 0x28
, 0x53, 0x49, 0x18, 0x75, 0x09, 0x00, 0x28, 0x53, 0x48, 0x20, 0x10, 0x51, 0x49, 0x08, 0x51, 0x48, 0x20, 0x7c, 0x0a, 0x37, 0x20, 0x10, 0x57, 0x0e, 0x50, 0x00, 0x7c, 0x08, 0xf2, 0x20, 0x62, 0xd0, 0x00, 0x3c, 0x9a, 0x01, 0xb0, 0x0b, 0x51, 0x24, 0x53, 0x30, 0x51, 0x25, 0x53, 0x31, 0x80, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x79, 0x53, 0x24, 0x51, 0x7a, 0x53, 0x25, 0x10, 0x50, 0x00, 0x7c, 0x09
, 0xb8, 0x20, 0x56, 0x0d, 0x00, 0x80, 0x67, 0x56, 0x00, 0x00, 0x80, 0x5b, 0x62, 0xd0, 0x00, 0x3c, 0x9a, 0x00, 0xb0, 0x1b, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x06, 0x48, 0x79, 0x7c, 0x1a, 0x6d, 0x52, 0x00, 0x53, 0x46, 0x55, 0x47, 0x00, 0x06, 0x46, 0x24, 0x7c, 0x1b, 0x23, 0x10, 0x52, 0x00, 0x7c, 0x09, 0xb8, 0x20, 0x10, 0x7c, 0x06, 0x43, 0x62, 0xd0, 0x00, 0x20, 0x39, 0x00, 0xbf
, 0xee, 0x7c, 0x19, 0xdc, 0x52, 0x0d, 0x7c, 0x1b, 0x5b, 0x02, 0x48, 0x53, 0x48, 0x51, 0x47, 0x0a, 0x49, 0x53, 0x49, 0x7c, 0x1b, 0x17, 0x06, 0x46, 0x8d, 0x0e, 0x47, 0x00, 0x51, 0x47, 0x7c, 0x1a, 0x79, 0x7c, 0x1a, 0x8f, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xcf, 0xa2, 0x77, 0x0d, 0x3d, 0x0d, 0x03, 0xcf, 0x96, 0x56, 0x00, 0x00, 0x81, 0x05, 0x7c, 0x19, 0xc0, 0x7c, 0x1a, 0x28, 0x51, 0x49, 0x60
, 0xd4, 0x3e, 0x48, 0x54, 0x0e, 0x3e, 0x48, 0x54, 0x0f, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x55, 0x46, 0x06, 0x55, 0x47, 0x00, 0x55, 0x41, 0x00, 0x55, 0x40, 0x00, 0x3c, 0x47, 0x00, 0xb0, 0x06, 0x3c, 0x46, 0x00, 0xa0, 0x1a, 0x70, 0xfb, 0x6e, 0x47, 0x6e, 0x46, 0xd0, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x48, 0x04, 0x41, 0x51, 0x49, 0x0c, 0x40, 0x65, 0x48, 0x6b, 0x49, 0x8f, 0xde, 0x5f
, 0x48, 0x41, 0x5f, 0x49, 0x40, 0x62, 0xd0, 0x00, 0x5a, 0x46, 0x06, 0x46, 0x03, 0x51, 0x46, 0x04, 0x48, 0x0e, 0x49, 0x03, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x54, 0x10, 0x3e, 0x48, 0x54, 0x11, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x55, 0x46, 0x06, 0x55, 0x47, 0x00, 0x55, 0x41, 0x00, 0x55, 0x40, 0x00, 0x3c, 0x47, 0x00, 0xb0, 0x06, 0x3c, 0x46, 0x00, 0xa0, 0x1a, 0x70, 0xfb, 0x6e
, 0x47, 0x6e, 0x46, 0xd0, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x48, 0x04, 0x41, 0x51, 0x49, 0x0c, 0x40, 0x65, 0x48, 0x6b, 0x49, 0x8f, 0xde, 0x5f, 0x48, 0x41, 0x5f, 0x49, 0x40, 0x62, 0xd0, 0x00, 0x5a, 0x46, 0x06, 0x46, 0x05, 0x51, 0x46, 0x04, 0x48, 0x0e, 0x49, 0x03, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x54, 0x12, 0x3e, 0x48, 0x54, 0x13, 0x50, 0x03, 0x08, 0x5a, 0x48, 0x06, 0x48, 0x0e, 0x08
, 0x51, 0x48, 0x08, 0x7c, 0x18, 0x3d, 0x38, 0xfd, 0x62, 0xd0, 0x00, 0x51, 0x48, 0x54, 0x15, 0x51, 0x49, 0x54, 0x14, 0x7c, 0x19, 0xb4, 0x7c, 0x1a, 0xa7, 0x7c, 0x1a, 0xf1, 0x06, 0x48, 0x6b, 0x7c, 0x1b, 0x07, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x5b, 0x7c, 0x1a, 0xc8, 0x51, 0x48, 0x01, 0x63, 0x7c, 0x1a, 0xc8, 0x06, 0x48, 0x53, 0x7c, 0x1b, 0x07, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xce, 0xf8
, 0x56, 0x00, 0x00, 0x80, 0x19, 0x7c, 0x19, 0xc0, 0x06, 0x48, 0x24, 0x7c, 0x1a, 0x6d, 0x52, 0x00, 0x53, 0x46, 0x55, 0x47, 0x00, 0x06, 0x46, 0x30, 0x7c, 0x1b, 0x23, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xcf, 0xe4, 0x38, 0xea, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x02, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x01, 0x02, 0x53, 0x48, 0x52, 0xfb, 0x09, 0x00, 0x7c, 0x1a, 0x9c, 0x52, 0xfc, 0x01, 0x04, 0x53, 0x46
, 0x52, 0xfb, 0x7c, 0x1a, 0x84, 0x12, 0x48, 0x51, 0x47, 0x1a, 0x49, 0xc0, 0x6f, 0x52, 0xfc, 0x53, 0x48, 0x52, 0xfb, 0x7c, 0x1a, 0x9c, 0x52, 0xfc, 0x01, 0x02, 0x53, 0x46, 0x52, 0xfb, 0x7c, 0x1a, 0x84, 0x12, 0x48, 0x51, 0x47, 0x1a, 0x49, 0xc0, 0x10, 0x52, 0xfc, 0x01, 0x02, 0x7c, 0x1a, 0xe6, 0x54, 0x00, 0x3e, 0x48, 0x54, 0x01, 0x80, 0xb3, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x01, 0x04, 0x53
, 0x48, 0x52, 0xfb, 0x09, 0x00, 0x7c, 0x1a, 0x9c, 0x52, 0xfc, 0x53, 0x46, 0x52, 0xfb, 0x60, 0xd4, 0x3e, 0x46, 0x53, 0x47, 0x3e, 0x46, 0x12, 0x48, 0x51, 0x47, 0x1a, 0x49, 0xc0, 0x10, 0x52, 0xfc, 0x01, 0x04, 0x7c, 0x1a, 0xe6, 0x54, 0x00, 0x3e, 0x48, 0x54, 0x01, 0x80, 0x7e, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x53, 0x48, 0x52, 0xfb, 0x7c, 0x1a, 0xfc, 0x80, 0x70, 0x62, 0xd0, 0x00, 0x52, 0xfc
, 0x53, 0x48, 0x52, 0xfb, 0x7c, 0x1a, 0x9c, 0x52, 0xfc, 0x01, 0x04, 0x53, 0x46, 0x52, 0xfb, 0x7c, 0x1a, 0x84, 0x12, 0x48, 0x51, 0x47, 0x1a, 0x49, 0xc0, 0x10, 0x52, 0xfc, 0x01, 0x04, 0x7c, 0x1a, 0xe6, 0x54, 0x00, 0x3e, 0x48, 0x54, 0x01, 0x80, 0x42, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x01, 0x02, 0x53, 0x48, 0x52, 0xfb, 0x09, 0x00, 0x7c, 0x1a, 0x9c, 0x52, 0xfc, 0x53, 0x46, 0x52, 0xfb, 0x60
, 0xd4, 0x3e, 0x46, 0x53, 0x47, 0x3e, 0x46, 0x12, 0x48, 0x51, 0x47, 0x1a, 0x49, 0xc0, 0x10, 0x52, 0xfc, 0x01, 0x02, 0x7c, 0x1a, 0xe6, 0x54, 0x00, 0x3e, 0x48, 0x54, 0x01, 0x80, 0x0d, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x53, 0x48, 0x52, 0xfb, 0x7c, 0x1a, 0xfc, 0x62, 0xd0, 0x00, 0x52, 0x01, 0x53, 0x48, 0x52, 0x00, 0x53, 0x49, 0x38, 0xfe, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x05, 0x62, 0xd0, 0x00
, 0x55, 0x96, 0x00, 0x3c, 0x9a, 0x00, 0xb0, 0x05, 0x51, 0x79, 0x53, 0x24, 0x10, 0x50, 0x00, 0x7c, 0x09, 0xb8, 0x20, 0x56, 0x00, 0x00, 0x80, 0x38, 0x62, 0xd0, 0x00, 0x3c, 0x9a, 0x00, 0xb0, 0x1b, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x06, 0x48, 0x79, 0x7c, 0x1a, 0x6d, 0x52, 0x00, 0x53, 0x46, 0x55, 0x47, 0x00, 0x06, 0x46, 0x24, 0x7c, 0x1b, 0x23, 0x10, 0x52, 0x00, 0x7c, 0x09, 0xb8
, 0x20, 0x10, 0x7c, 0x06, 0x43, 0x62, 0xd0, 0x00, 0x20, 0x39, 0x00, 0xbf, 0xee, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xcf, 0xc5, 0x56, 0x00, 0x00, 0x83, 0x04, 0x62, 0xd0, 0x00, 0x3c, 0xa0, 0x02, 0xa0, 0x9f, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x6b, 0x7c, 0x19, 0xcb, 0x06, 0x48, 0x8d, 0x7c, 0x1a, 0x6d, 0x7c, 0x1a, 0xd9, 0xd0, 0x16, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x6b, 0x7c, 0x19, 0xcb
, 0x06, 0x48, 0x8d, 0x7c, 0x1a, 0x6d, 0x7c, 0x1b, 0x73, 0x80, 0x17, 0x62, 0xd0, 0x00, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x8d, 0x7c, 0x19, 0xcb, 0x06, 0x48, 0x6b, 0x7c, 0x1a, 0x6d, 0x7c, 0x1b, 0x73, 0x50, 0xfa, 0x13, 0x02, 0x50, 0x00, 0x1b, 0x01, 0xc0, 0x4e, 0x62, 0xd0, 0x00, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x53, 0x7c, 0x19, 0xcb, 0x06, 0x48, 0x8d, 0x7c, 0x1a, 0x6d, 0x7c, 0x1a
, 0xd9, 0xd0, 0x16, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x53, 0x7c, 0x19, 0xcb, 0x06, 0x48, 0x8d, 0x7c, 0x1a, 0x6d, 0x7c, 0x1b, 0x80, 0x80, 0x17, 0x62, 0xd0, 0x00, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x8d, 0x7c, 0x19, 0xcb, 0x06, 0x48, 0x53, 0x7c, 0x1a, 0x6d, 0x7c, 0x1b, 0x80, 0x50, 0xfa, 0x13, 0x04, 0x50, 0x00, 0x1b, 0x03, 0xd0, 0x08, 0x62, 0xd0, 0x00, 0x76, 0x96, 0x82, 0x5c, 0x62
, 0xd0, 0x00, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x8d, 0x7c, 0x19, 0xcb, 0x06, 0x48, 0x53, 0x7c, 0x1a, 0x6d, 0x7c, 0x1a, 0xd9, 0xd0, 0x5a, 0x7c, 0x19, 0xb4, 0x7c, 0x1a, 0xb2, 0x06, 0x46, 0x01, 0x0e, 0x47, 0x00, 0x7c, 0x1a, 0x8f, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x8d, 0x7c, 0x19, 0xcb, 0x06, 0x48, 0x53, 0x7c, 0x1a, 0x6d, 0x7c, 0x1a, 0xd9, 0xd0, 0xb4, 0x7c, 0x19, 0xb4, 0x7c, 0x1a
, 0xb2, 0x06, 0x46, 0x01, 0x0e, 0x47, 0x00, 0x7c, 0x1a, 0x8f, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x8d, 0x7c, 0x19, 0xcb, 0x06, 0x48, 0x53, 0x7c, 0x1a, 0x6d, 0x7c, 0x1a, 0xd9, 0xd0, 0x90, 0x7c, 0x19, 0xb4, 0x7c, 0x1a, 0xb2, 0x06, 0x46, 0x01, 0x0e, 0x47, 0x00, 0x7c, 0x1a, 0x8f, 0x80, 0x7f, 0x62, 0xd0, 0x00, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x8d, 0x7c, 0x19, 0xcb, 0x06, 0x48, 0x53
, 0x7c, 0x1a, 0x6d, 0x3e, 0x48, 0x12, 0x46, 0x51, 0x49, 0x1a, 0x47, 0xd0, 0x62, 0x7c, 0x19, 0xb4, 0x7c, 0x1a, 0xb2, 0x16, 0x46, 0x01, 0x1e, 0x47, 0x00, 0x7c, 0x1a, 0x8f, 0x7c, 0x19, 0xb4, 0x51, 0x48, 0x01, 0x8d, 0x7c, 0x19, 0xcb, 0x06, 0x48, 0x53, 0x7c, 0x1a, 0x6d, 0x3e, 0x48, 0x12, 0x46, 0x51, 0x49, 0x1a, 0x47, 0xd0, 0x39, 0x97, 0xfc, 0x40, 0x7c, 0x1a, 0xb2, 0x16, 0x46, 0x01, 0x1e
, 0x47, 0x00, 0x7c, 0x1a, 0x8f, 0x97, 0xed, 0x40, 0x51, 0x48, 0x01, 0x8d, 0x97, 0xfd, 0x40, 0x06, 0x48, 0x53, 0x7c, 0x1a, 0x6d, 0x3e, 0x48, 0x12, 0x46, 0x51, 0x49, 0x1a, 0x47, 0xd0, 0x10, 0x97, 0xd3, 0x40, 0x7c, 0x1a, 0xb2, 0x16, 0x46, 0x01, 0x1e, 0x47, 0x00, 0x7c, 0x1a, 0x8f, 0x62, 0xd0, 0x00, 0x97, 0xc1, 0x40, 0x51, 0x48, 0x01, 0x63, 0x97, 0xd1, 0x40, 0x06, 0x48, 0x5b, 0x0e, 0x49
, 0x00, 0x7c, 0x1a, 0x8f, 0x97, 0xae, 0x40, 0x51, 0x48, 0x01, 0x53, 0x97, 0xbe, 0x40, 0x06, 0x48, 0x63, 0x0e, 0x49, 0x00, 0x7c, 0x1a, 0x8f, 0x97, 0x9b, 0x40, 0x51, 0x48, 0x01, 0x8d, 0x97, 0xab, 0x40, 0x06, 0x48, 0x53, 0x0e, 0x49, 0x00, 0x7c, 0x1a, 0x8f, 0x97, 0x88, 0x40, 0x06, 0x48, 0x5b, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x53, 0x73, 0x3e, 0x48, 0x53, 0x74, 0x97
, 0x73, 0x40, 0x06, 0x48, 0x63, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x53, 0x75, 0x3e, 0x48, 0x53, 0x76, 0x97, 0x5e, 0x40, 0x06, 0x48, 0x53, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x53, 0x77, 0x3e, 0x48, 0x53, 0x78, 0x50, 0x00, 0x08, 0x50, 0x73, 0x08, 0x9c, 0x75, 0x38, 0xfe, 0x62, 0xd0, 0x00, 0x7c, 0x1b, 0x17, 0x06, 0x46, 0x8d, 0x7c, 0x1b, 0x23, 0x51
, 0x48, 0x3f, 0x46, 0x97, 0x2f, 0x40, 0x7c, 0x1a, 0xa7, 0x53, 0x47, 0x7c, 0x1b, 0x9a, 0x53, 0x44, 0x08, 0x51, 0x45, 0x53, 0x43, 0x18, 0x53, 0x42, 0x65, 0x42, 0x6b, 0x43, 0x06, 0x48, 0x63, 0x97, 0xcc, 0x40, 0x3e, 0x48, 0x53, 0x48, 0x51, 0x42, 0x04, 0x48, 0x51, 0x43, 0x0c, 0x49, 0x51, 0x44, 0x04, 0x48, 0x51, 0x45, 0x0c, 0x49, 0x70, 0xfb, 0x6e, 0x49, 0x6e, 0x48, 0x7c, 0x1b, 0x48, 0x10
, 0x52, 0x00, 0x7c, 0x06, 0x87, 0x20, 0x62, 0xd0, 0x00, 0x96, 0xe9, 0x40, 0x51, 0x48, 0x01, 0x8d, 0x96, 0xf9, 0x40, 0x06, 0x48, 0x6b, 0x97, 0x95, 0x40, 0x97, 0xfe, 0x40, 0xd0, 0x25, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x06, 0x48, 0x85, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x7a, 0x48, 0x53, 0x47, 0x06, 0x47, 0x01, 0x51, 0x49, 0x60, 0xd5, 0x51, 0x47, 0x3f, 0x48
, 0x80, 0x0a, 0x96, 0xbc, 0x40, 0x06, 0x48, 0x85, 0x7c, 0x1b, 0x67, 0x96, 0xb3, 0x40, 0x06, 0x48, 0x85, 0x97, 0x5a, 0x40, 0x50, 0x05, 0x3a, 0x49, 0xd0, 0x41, 0x96, 0x98, 0x40, 0x51, 0x48, 0x01, 0x6b, 0x53, 0x46, 0x51, 0x49, 0x09, 0x00, 0x53, 0x47, 0x06, 0x48, 0x8d, 0x97, 0x3f, 0x40, 0x3e, 0x48, 0x53, 0x48, 0x51, 0x47, 0x7c, 0x1b, 0x9a, 0x02, 0x48, 0x53, 0x48, 0x51, 0x45, 0x0a, 0x49
, 0x53, 0x49, 0x7c, 0x1b, 0x48, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x06, 0x48, 0x85, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd5, 0x50, 0x00, 0x3f, 0x48, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xcc, 0xf9, 0x62, 0xd0, 0x00, 0x3c, 0xa0, 0x02, 0xb0, 0x9a, 0x56, 0x00, 0x00, 0x80, 0x90, 0x62, 0xd0, 0x00, 0x96, 0x41, 0x40, 0x51, 0x48, 0x01, 0x8d, 0x96, 0x51, 0x40, 0x06, 0x48, 0x38, 0x0e, 0x49
, 0x00, 0x97, 0x0c, 0x40, 0x96, 0x2e, 0x40, 0x51, 0x48, 0x01, 0x6b, 0x96, 0x3e, 0x40, 0x06, 0x48, 0x3c, 0x0e, 0x49, 0x00, 0x96, 0xf9, 0x40, 0x96, 0x1b, 0x40, 0x51, 0x48, 0x01, 0x6b, 0x96, 0x2b, 0x40, 0x51, 0x48, 0x01, 0x8d, 0x53, 0x44, 0x51, 0x49, 0x97, 0xe2, 0x40, 0x51, 0x46, 0x12, 0x44, 0x51, 0x47, 0x1a, 0x45, 0xd0, 0x2b, 0x97, 0x5f, 0x40, 0x51, 0x46, 0x01, 0x6b, 0x53, 0x44, 0x51
, 0x47, 0x97, 0xca, 0x40, 0x06, 0x46, 0x8d, 0x0e, 0x47, 0x00, 0x51, 0x47, 0x60, 0xd4, 0x3e, 0x46, 0x53, 0x47, 0x3e, 0x46, 0x12, 0x44, 0x54, 0x02, 0x51, 0x47, 0x1a, 0x45, 0x54, 0x01, 0x80, 0x07, 0x56, 0x02, 0x00, 0x56, 0x01, 0x00, 0x62, 0xd0, 0x00, 0x06, 0x48, 0x34, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd5, 0x52, 0x01, 0x3f, 0x48, 0x52, 0x02, 0x3f, 0x48, 0x77, 0x00, 0x3d, 0x00, 0x02
, 0xcf, 0x6d, 0x62, 0xd0, 0x00, 0x3c, 0xa0, 0x02, 0xa0, 0x18, 0x3c, 0x96, 0x00, 0xa0, 0x13, 0x50, 0x75, 0x08, 0x50, 0x30, 0x08, 0x90, 0x0e, 0x38, 0xfe, 0x7c, 0x0b, 0x57, 0x10, 0x7c, 0x08, 0x43, 0x20, 0x38, 0xfb, 0x20, 0x7f, 0x10, 0x4f, 0x80, 0x02, 0x40, 0x62, 0xd0, 0x00, 0x52, 0xfc, 0x53, 0x48, 0x52, 0xfb, 0x53, 0x49, 0x51, 0x48, 0x11, 0x01, 0x54, 0xfc, 0x51, 0x49, 0x19, 0x00, 0x54
, 0xfb, 0x3c, 0x49, 0x00, 0xbf, 0xe4, 0x3c, 0x48, 0x00, 0xbf, 0xdf, 0x20, 0x7f, 0x10, 0x7c, 0x05, 0x0d, 0x7c, 0x04, 0xea, 0x20, 0x7f, 0x10, 0x7c, 0x05, 0x09, 0x7c, 0x04, 0xe6, 0x20, 0x7f, 0x62, 0xd0, 0x00, 0x51, 0x4c, 0x12, 0x70, 0x50, 0x00, 0x1a, 0x6f, 0xd0, 0x0f, 0x51, 0x4d, 0x12, 0x72, 0x50, 0x00, 0x1a, 0x71, 0xd0, 0x05, 0x50, 0x0f, 0x80, 0x17, 0x62, 0xd0, 0x00, 0x51, 0x72, 0x12
, 0x70, 0x51, 0x71, 0x1a, 0x6f, 0xd0, 0x05, 0x50, 0x00, 0x80, 0x06, 0x62, 0xd0, 0x00, 0x50, 0x01, 0x7f, 0x10, 0x4f, 0x38, 0x05, 0x62, 0xd0, 0x00, 0x51, 0x70, 0x54, 0x02, 0x51, 0x6f, 0x54, 0x01, 0x56, 0x04, 0x00, 0x56, 0x00, 0x00, 0x56, 0x03, 0x00, 0x80, 0x61, 0x95, 0x13, 0x40, 0x06, 0x48, 0x4c, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x53, 0x48, 0x96, 0x59, 0x40, 0x06
, 0x46, 0x6f, 0x0e, 0x47, 0x00, 0x51, 0x47, 0x95, 0xb0, 0x40, 0x51, 0x48, 0x12, 0x46, 0x50, 0x00, 0x1a, 0x47, 0xd0, 0x03, 0x77, 0x03, 0x62, 0xd0, 0x00, 0x94, 0xd9, 0x40, 0x06, 0x48, 0x6f, 0x95, 0x8c, 0x40, 0x3e, 0x48, 0x53, 0x48, 0x52, 0x02, 0x12, 0x48, 0x52, 0x01, 0x1a, 0x49, 0xd0, 0x1a, 0x94, 0xc2, 0x40, 0x06, 0x48, 0x6f, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x54
, 0x01, 0x3e, 0x48, 0x54, 0x02, 0x52, 0x00, 0x54, 0x04, 0x77, 0x00, 0x3d, 0x00, 0x02, 0xcf, 0x9c, 0x50, 0x01, 0x3b, 0x03, 0xd0, 0x08, 0x62, 0xd0, 0x00, 0x50, 0x0f, 0x80, 0x06, 0x52, 0x04, 0x62, 0xd0, 0x00, 0x38, 0xfb, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x02, 0x70, 0xfe, 0x62, 0xd0, 0x00, 0x26, 0x2a, 0xf0, 0x51, 0x9f, 0x01, 0x01, 0x53, 0x49, 0x51, 0x2a, 0x2a, 0x49, 0x53, 0x2a, 0x71, 0x01
, 0x62, 0xe3, 0x38, 0x10, 0x7c, 0x06, 0x43, 0x62, 0xd0, 0x00, 0x20, 0x43, 0x00, 0x08, 0x56, 0x01, 0x00, 0x56, 0x00, 0x00, 0x80, 0x21, 0x10, 0x7c, 0x06, 0x43, 0x62, 0xd0, 0x00, 0x20, 0x53, 0x49, 0x47, 0x49, 0x20, 0xa0, 0x03, 0x80, 0x1a, 0x50, 0x00, 0x08, 0x50, 0x04, 0x08, 0x9e, 0xb6, 0x38, 0xfe, 0x77, 0x01, 0x0f, 0x00, 0x00, 0x52, 0x01, 0x11, 0xdc, 0x52, 0x00, 0x19, 0x05, 0xcf, 0xd7
, 0x56, 0x01, 0x00, 0x56, 0x00, 0x00, 0x80, 0x21, 0x10, 0x7c, 0x06, 0x43, 0x62, 0xd0, 0x00, 0x20, 0x53, 0x49, 0x47, 0x49, 0x20, 0xb0, 0x03, 0x80, 0x1a, 0x50, 0x00, 0x08, 0x50, 0x04, 0x08, 0x9e, 0x84, 0x38, 0xfe, 0x77, 0x01, 0x0f, 0x00, 0x00, 0x52, 0x01, 0x11, 0x2c, 0x52, 0x00, 0x19, 0x01, 0xcf, 0xd7, 0x41, 0x00, 0xf7, 0x38, 0xfe, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x02, 0x70, 0xfe, 0x62
, 0xd0, 0x00, 0x26, 0x2a, 0xf0, 0x51, 0x9f, 0x01, 0x09, 0x53, 0x49, 0x51, 0x2a, 0x2a, 0x49, 0x53, 0x2a, 0x71, 0x01, 0x62, 0xe3, 0x38, 0x10, 0x7c, 0x06, 0x43, 0x62, 0xd0, 0x00, 0x20, 0x43, 0x00, 0x08, 0x56, 0x01, 0x00, 0x56, 0x00, 0x00, 0x80, 0x21, 0x10, 0x7c, 0x06, 0x43, 0x62, 0xd0, 0x00, 0x20, 0x53, 0x49, 0x47, 0x49, 0x20, 0xa0, 0x03, 0x80, 0x1a, 0x50, 0x00, 0x08, 0x50, 0x04, 0x08
, 0x9e, 0x23, 0x38, 0xfe, 0x77, 0x01, 0x0f, 0x00, 0x00, 0x52, 0x01, 0x11, 0xdc, 0x52, 0x00, 0x19, 0x05, 0xcf, 0xd7, 0x56, 0x01, 0x00, 0x56, 0x00, 0x00, 0x80, 0x21, 0x10, 0x7c, 0x06, 0x43, 0x62, 0xd0, 0x00, 0x20, 0x53, 0x49, 0x47, 0x49, 0x20, 0xb0, 0x03, 0x80, 0x1a, 0x50, 0x00, 0x08, 0x50, 0x04, 0x08, 0x9d, 0xf1, 0x38, 0xfe, 0x77, 0x01, 0x0f, 0x00, 0x00, 0x52, 0x01, 0x11, 0x2c, 0x52
, 0x00, 0x19, 0x01, 0xcf, 0xd7, 0x41, 0x00, 0xf7, 0x38, 0xfe, 0x20, 0x7f, 0x10, 0x4f, 0x38, 0x04, 0x62, 0xd0, 0x00, 0x51, 0x2a, 0x21, 0xf0, 0x54, 0x00, 0x51, 0x2d, 0x54, 0x01, 0x3d, 0x00, 0x10, 0xb0, 0x2a, 0x55, 0x98, 0x00, 0x3c, 0x9b, 0x01, 0xb0, 0x09, 0x55, 0x89, 0x00, 0x55, 0x8a, 0x00, 0x80, 0x0f, 0x62, 0xd0, 0x00, 0x3c, 0x9d, 0x01, 0xa0, 0x07, 0x55, 0x89, 0x00, 0x55, 0x8a, 0x00
, 0x56, 0x00, 0x00, 0x62, 0xd0, 0x00, 0x26, 0x2a, 0x0f, 0x81, 0x6a, 0x3d, 0x00, 0x20, 0xb0, 0x18, 0x62, 0xd0, 0x00, 0x55, 0x98, 0x01, 0x55, 0x99, 0x00, 0x55, 0x89, 0x08, 0x55, 0x8a, 0x08, 0x56, 0x00, 0x00, 0x26, 0x2a, 0x0f, 0x81, 0x4e, 0x3d, 0x00, 0x40, 0xb0, 0x0f, 0x62, 0xd0, 0x00, 0x55, 0xa0, 0x02, 0x56, 0x00, 0x00, 0x26, 0x2a, 0x0f, 0x81, 0x3b, 0x3d, 0x00, 0x50, 0xb0, 0xa7, 0x52
, 0x01, 0x54, 0x03, 0x56, 0x02, 0x00, 0x3d, 0x02, 0x00, 0xb0, 0x06, 0x3d, 0x03, 0x01, 0xa0, 0x21, 0x3d, 0x02, 0x00, 0xb0, 0x06, 0x3d, 0x03, 0x02, 0xa0, 0x28, 0x3d, 0x02, 0x00, 0xb0, 0x06, 0x3d, 0x03, 0x04, 0xa0, 0x36, 0x3d, 0x02, 0x00, 0xb0, 0x06, 0x3d, 0x03, 0x08, 0xa0, 0x48, 0x80, 0x62, 0x62, 0xd0, 0x00, 0x55, 0x9a, 0x01, 0x51, 0x2f, 0x29, 0x80, 0x53, 0x2f, 0x7c, 0x0c, 0xe9, 0x80
, 0x51, 0x62, 0xd0, 0x00, 0x51, 0x2b, 0x53, 0x4c, 0x51, 0x2b, 0x53, 0x4d, 0x51, 0x2b, 0x53, 0x2e, 0x51, 0x2c, 0x53, 0x0e, 0x55, 0x0d, 0x00, 0x80, 0x39, 0x62, 0xd0, 0x00, 0x51, 0x2b, 0x53, 0x2f, 0x3c, 0x9a, 0x00, 0xa0, 0x09, 0x51, 0x2f, 0x29, 0x80, 0x53, 0x2f, 0x80, 0x25, 0x62, 0xd0, 0x00, 0x26, 0x2f, 0x7f, 0x80, 0x1d, 0x62, 0xd0, 0x00, 0x55, 0x9a, 0x00, 0x26, 0x2f, 0x7f, 0x51, 0x79
, 0x53, 0x24, 0x51, 0x24, 0x53, 0x30, 0x51, 0x7a, 0x53, 0x25, 0x51, 0x25, 0x53, 0x31, 0x7c, 0x0c, 0xe9, 0x56, 0x00, 0x00, 0x62, 0xd0, 0x00, 0x26, 0x2a, 0x0f, 0x55, 0x2b, 0x05, 0x55, 0x2c, 0x03, 0x55, 0x2d, 0x00, 0x80, 0x90, 0x3d, 0x00, 0x60, 0xb0, 0x0f, 0x62, 0xd0, 0x00, 0x55, 0x9b, 0x01, 0x56, 0x00, 0x00, 0x26, 0x2a, 0x0f, 0x80, 0x7d, 0x3d, 0x00, 0x70, 0xb0, 0x0f, 0x62, 0xd0, 0x00
, 0x55, 0x9b, 0x00, 0x56, 0x00, 0x00, 0x26, 0x2a, 0x0f, 0x80, 0x6a, 0x3d, 0x00, 0x80, 0xb0, 0x65, 0x56, 0x00, 0x00, 0x62, 0xd0, 0x00, 0x26, 0x2a, 0x0f, 0x9c, 0xb2, 0x10, 0x7c, 0x09, 0x36, 0x7c, 0x06, 0x59, 0x20, 0x70, 0xfe, 0x71, 0x10, 0x41, 0x00, 0xf7, 0x41, 0x01, 0xf7, 0x70, 0xcf, 0x62, 0xda, 0x00, 0x71, 0x10, 0x41, 0xdc, 0xfe, 0x70, 0xcf, 0x43, 0x01, 0x08, 0x43, 0x00, 0x08, 0x50
, 0x00, 0x08, 0x50, 0x1e, 0x08, 0x9c, 0x5e, 0x38, 0xfe, 0x71, 0x01, 0x43, 0xe0, 0x10, 0x43, 0xff, 0x08, 0x70, 0xfe, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x10, 0x7c, 0x08, 0x65, 0x7c, 0x06, 0x0d, 0x7c, 0x06, 0x4e, 0x20, 0x93, 0x48, 0x40, 0x62, 0xe3, 0x38, 0x56, 0x00, 0x00, 0x62, 0xd0, 0x00, 0x26, 0x2a, 0x0f, 0x38, 0xfc, 0x20, 0x7f, 0x62, 0xd0, 0x00, 0x3c, 0x98, 0x00, 0xa0, 0x13
, 0x9c, 0x4b, 0x62, 0xd0, 0x00, 0x3c, 0x99, 0x00, 0xb0, 0x33, 0x55, 0x99, 0x01, 0x7c, 0x0b, 0x57, 0x80, 0x2b, 0x62, 0xd0, 0x00, 0x50, 0x01, 0x3a, 0x89, 0xd0, 0x08, 0x10, 0x7c, 0x05, 0x0d, 0x20, 0x80, 0x06, 0x10, 0x7c, 0x05, 0x09, 0x20, 0x62, 0xd0, 0x00, 0x50, 0x01, 0x3a, 0x8a, 0xd0, 0x08, 0x10, 0x7c, 0x04, 0xea, 0x20, 0x80, 0x06, 0x10, 0x7c, 0x04, 0xe6, 0x20, 0x7f, 0x10, 0x4f, 0x38
, 0x03, 0x56, 0x02, 0x00, 0x56, 0x01, 0x00, 0x56, 0x00, 0x00, 0x80, 0x3e, 0x62, 0xd0, 0x00, 0x91, 0x63, 0x40, 0x52, 0xfc, 0x04, 0x48, 0x52, 0xfb, 0x0c, 0x49, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x53, 0x49, 0x3e, 0x48, 0x53, 0x48, 0x52, 0x02, 0x12, 0x48, 0x52, 0x01, 0x1a, 0x49, 0xd0, 0x18, 0x91, 0x42, 0x40, 0x52, 0xfc, 0x04, 0x48, 0x52, 0xfb, 0x0c, 0x49, 0x51, 0x49, 0x60, 0xd4, 0x3e
, 0x48, 0x54, 0x01, 0x3e, 0x48, 0x54, 0x02, 0x77, 0x00, 0x52, 0x00, 0x3b, 0xfa, 0xcf, 0xbe, 0x62, 0xd0, 0x00, 0x52, 0x02, 0x53, 0x48, 0x52, 0x01, 0x53, 0x49, 0x38, 0xfd, 0x20, 0x7f, 0x10, 0x7c, 0x04, 0x98, 0x20, 0x10, 0x50, 0x04, 0x08, 0x50, 0x00, 0x08, 0x50, 0x8d, 0x08, 0x7c, 0x04, 0xa1, 0x38, 0xfd, 0x20, 0x10, 0x50, 0x04, 0x08, 0x50, 0x00, 0x08, 0x50, 0x6b, 0x08, 0x7c, 0x04, 0xa1
, 0x38, 0xfd, 0x20, 0x10, 0x50, 0x04, 0x08, 0x50, 0x00, 0x08, 0x50, 0x6f, 0x08, 0x7c, 0x04, 0xa1, 0x38, 0xfd, 0x20, 0x10, 0x50, 0x00, 0x7c, 0x03, 0xbc, 0x20, 0x10, 0x50, 0xff, 0x7c, 0x03, 0xbc, 0x20, 0x10, 0x50, 0xff, 0x7c, 0x03, 0xbc, 0x20, 0x7f, 0x62, 0xd0, 0x00, 0x76, 0x92, 0x0e, 0x91, 0x00, 0x50, 0x38, 0x12, 0x92, 0x50, 0x01, 0x1a, 0x91, 0xd0, 0x12, 0x55, 0x92, 0x00, 0x55, 0x91
, 0x00, 0x76, 0x33, 0x50, 0x80, 0x3a, 0x33, 0xd0, 0x04, 0x55, 0x33, 0x0a, 0x7f, 0x62, 0xd0, 0x00, 0x55, 0x9a, 0x00, 0x55, 0x9b, 0x01, 0x10, 0x7c, 0x05, 0x0d, 0x7c, 0x04, 0xea, 0x20, 0x9b, 0x2d, 0x62, 0xe3, 0x38, 0x71, 0x10, 0x43, 0x00, 0x08, 0x41, 0x01, 0xf7, 0x70, 0xcf, 0x41, 0x00, 0xf7, 0x62, 0xd0, 0x00, 0x55, 0x2a, 0x08, 0x55, 0x2b, 0x05, 0x55, 0x2c, 0x03, 0x55, 0x2e, 0x32, 0x55
, 0x2f, 0x05, 0x55, 0x30, 0x18, 0x55, 0x31, 0x11, 0x55, 0x32, 0x11, 0x55, 0x33, 0x11, 0x55, 0x33, 0x0a, 0x3c, 0x9a, 0x00, 0xa0, 0x09, 0x51, 0x2f, 0x29, 0x80, 0x53, 0x2f, 0x80, 0x07, 0x62, 0xd0, 0x00, 0x26, 0x2f, 0x7f, 0x10, 0x50, 0x00, 0x08, 0x50, 0x2a, 0x08, 0x50, 0x06, 0x08, 0x50, 0x16, 0x08, 0x7c, 0x06, 0x60, 0x38, 0xfc, 0x7c, 0x06, 0x0d, 0x7c, 0x06, 0x4e, 0x20, 0x91, 0xb0, 0x40
, 0x10, 0x7c, 0x08, 0x65, 0x7c, 0x07, 0xeb, 0x20, 0x7c, 0x0c, 0xe9, 0x80, 0x24, 0x62, 0xe3, 0x38, 0x9f, 0x57, 0x7c, 0x0f, 0xf9, 0x10, 0x7c, 0x08, 0x29, 0x62, 0xd0, 0x00, 0x20, 0x39, 0x00, 0xa0, 0x09, 0x7c, 0x0a, 0x85, 0x7c, 0x0a, 0xaf, 0x80, 0x04, 0x7c, 0x0b, 0x18, 0x9c, 0x9e, 0x9e, 0x48, 0x8f, 0xdc, 0x8f, 0xff, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x65, 0x48, 0x6b, 0x49, 0x7f
, 0x62, 0xd0, 0x00, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x7f, 0x53, 0x46, 0x51, 0x49, 0x09, 0x00, 0x60, 0xd4, 0x3e, 0x46, 0x53, 0x47, 0x3e, 0x46, 0x53, 0x46, 0x7f, 0x52, 0x00, 0x53, 0x48, 0x55, 0x49, 0x00, 0x55, 0x46, 0x06, 0x55, 0x47, 0x00, 0x55, 0x41, 0x00, 0x55, 0x40, 0x00, 0x3c, 0x47, 0x00, 0xb0, 0x06, 0x3c, 0x46, 0x00, 0xa0, 0x1a, 0x70, 0xfb, 0x6e, 0x47, 0x6e, 0x46, 0xd0
, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x48, 0x04, 0x41, 0x51, 0x49, 0x0c, 0x40, 0x65, 0x48, 0x6b, 0x49, 0x8f, 0xde, 0x5f, 0x48, 0x41, 0x5f, 0x49, 0x40, 0x62, 0xd0, 0x00, 0x5a, 0x46, 0x06, 0x46, 0x01, 0x51, 0x46, 0x04, 0x48, 0x0e, 0x49, 0x03, 0x7f, 0x55, 0x46, 0x06, 0x55, 0x47, 0x00, 0x55, 0x41, 0x00, 0x55, 0x40, 0x00, 0x3c, 0x47, 0x00, 0xb0, 0x06, 0x3c, 0x46, 0x00, 0xa0, 0x1a, 0x70, 0xfb
, 0x6e, 0x47, 0x6e, 0x46, 0xd0, 0x0c, 0x62, 0xd0, 0x00, 0x51, 0x48, 0x04, 0x41, 0x51, 0x49, 0x0c, 0x40, 0x65, 0x48, 0x6b, 0x49, 0x8f, 0xde, 0x5f, 0x48, 0x41, 0x5f, 0x49, 0x40, 0x62, 0xd0, 0x00, 0x5a, 0x46, 0x06, 0x46, 0x01, 0x51, 0x46, 0x04, 0x48, 0x0e, 0x49, 0x03, 0x7f, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x53, 0x49, 0x7f, 0x60, 0xd4, 0x3e, 0x46, 0x53, 0x47, 0x3e
, 0x46, 0x53, 0x46, 0x7f, 0x09, 0x00, 0x60, 0xd4, 0x3e, 0x46, 0x53, 0x47, 0x3e, 0x46, 0x7f, 0x51, 0x49, 0x60, 0xd5, 0x51, 0x47, 0x3f, 0x48, 0x51, 0x46, 0x3f, 0x48, 0x7f, 0x60, 0xd4, 0x3e, 0x48, 0x53, 0x49, 0x3e, 0x48, 0x53, 0x48, 0x7f, 0x51, 0x48, 0x01, 0x8d, 0x53, 0x46, 0x51, 0x49, 0x09, 0x00, 0x7f, 0x06, 0x48, 0x8d, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd4, 0x3e, 0x48, 0x53, 0x47
, 0x3e, 0x48, 0x16, 0x48, 0x02, 0x53, 0x46, 0x7f, 0x53, 0x46, 0x51, 0x49, 0x09, 0x00, 0x60, 0xd5, 0x52, 0x14, 0x3f, 0x46, 0x52, 0x15, 0x3f, 0x46, 0x7f, 0x3e, 0x48, 0x53, 0x48, 0x51, 0x46, 0x12, 0x48, 0x51, 0x47, 0x1a, 0x49, 0x7f, 0x53, 0x48, 0x52, 0xfb, 0x09, 0x00, 0x60, 0xd4, 0x3e, 0x48, 0x7f, 0x60, 0xd5, 0x52, 0x14, 0x3f, 0x46, 0x52, 0x15, 0x3f, 0x46, 0x7f, 0x60, 0xd4, 0x3e, 0x48
, 0x54, 0x00, 0x3e, 0x48, 0x54, 0x01, 0x7f, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd5, 0x52, 0x14, 0x3f, 0x48, 0x52, 0x15, 0x3f, 0x48, 0x7f, 0x52, 0x00, 0x53, 0x46, 0x55, 0x47, 0x00, 0x65, 0x46, 0x6b, 0x47, 0x7f, 0x0e, 0x47, 0x00, 0x51, 0x47, 0x60, 0xd5, 0x51, 0x49, 0x3f, 0x46, 0x7f, 0x71, 0x10, 0x41, 0x04, 0xfe, 0x41, 0x05, 0xfe, 0x41, 0x04, 0xfd, 0x41, 0x05, 0xfd, 0x70, 0xcf, 0x43
, 0x04, 0x01, 0x43, 0x04, 0x02, 0x71, 0x01, 0x7f, 0x70, 0xfb, 0x6e, 0x49, 0x6e, 0x48, 0x51, 0x47, 0x60, 0xd5, 0x51, 0x49, 0x3f, 0x46, 0x51, 0x48, 0x3f, 0x46, 0x7f, 0x53, 0x46, 0x55, 0x47, 0x00, 0x65, 0x46, 0x6b, 0x47, 0x51, 0x46, 0x7f, 0x0e, 0x49, 0x00, 0x51, 0x49, 0x60, 0xd5, 0x50, 0x00, 0x3f, 0x48, 0x7f, 0x3e, 0x48, 0x12, 0x46, 0x54, 0x02, 0x51, 0x49, 0x1a, 0x47, 0x54, 0x01, 0x7f
, 0x3e, 0x48, 0x12, 0x46, 0x54, 0x04, 0x51, 0x49, 0x1a, 0x47, 0x54, 0x03, 0x7f, 0x09, 0x00, 0x60, 0xd4, 0x3e, 0x44, 0x53, 0x45, 0x3e, 0x44, 0x53, 0x44, 0x7f, 0x60, 0xd4, 0x3e, 0x46, 0x53, 0x45, 0x3e, 0x46, 0x16, 0x46, 0x02, 0x7f, 0x00, 0x2a, 0x00, 0x16, 0x00, 0x53, 0x00, 0x18, 0x00, 0x73, 0x00, 0x06, 0x00, 0x79, 0x04, 0x18, 0x11, 0x11, 0x11, 0x00, 0x7d, 0x00, 0x0c, 0x00, 0x89, 0x04
, 0x08, 0x08, 0x08, 0x08, 0x00, 0x91, 0x00, 0x04, 0x00, 0x95, 0x07, 0x02, 0x00, 0x05, 0x01, 0x01, 0x00, 0x01, 0x00, 0x9c, 0x00, 0x05, 0xff, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
};
/* I2C */
#define EXT_I2C_SCL_HIGH \
do { \
int delay_count; \
<API key>(_3_TOUCH_SCL_28V, 1); \
<API key>(_3_TOUCH_SCL_28V); \
delay_count = 100000; \
while (delay_count
if (gpio_get_value(_3_TOUCH_SCL_28V)) \
break; \
udelay(1); \
} \
} while (0);
#define EXT_I2C_SCL_LOW <API key>(_3_TOUCH_SCL_28V, 0);
#define EXT_I2C_SDA_HIGH <API key>(_3_TOUCH_SDA_28V, 1);
#define EXT_I2C_SDA_LOW <API key>(_3_TOUCH_SDA_28V, 0);
#define TRUE 1
#define FALSE 0
static void EXT_I2C_LOW(u32 delay)
{
EXT_I2C_SDA_LOW;
/* udelay(delay); */
EXT_I2C_SCL_HIGH;
/* udelay(delay); */
EXT_I2C_SCL_LOW;
/* udelay(delay); */
}
static void EXT_I2C_HIGH(u32 delay)
{
EXT_I2C_SDA_HIGH;
/* udelay(delay); */
EXT_I2C_SCL_HIGH;
/* udelay(delay); */
EXT_I2C_SCL_LOW;
/* udelay(delay); */
}
static void EXT_I2C_START(u32 delay)
{
EXT_I2C_SDA_HIGH;
EXT_I2C_SCL_HIGH;
/* udelay(delay); */
EXT_I2C_SDA_LOW;
/* udelay(delay); */
EXT_I2C_SCL_LOW;
/* udelay(delay); */
}
static void EXT_I2C_END(u32 delay)
{
EXT_I2C_SDA_LOW;
EXT_I2C_SCL_HIGH;
/* udelay(delay); */
EXT_I2C_SDA_HIGH;
}
static int EXT_I2C_ACK(u32 delay)
{
u32 ack;
/* SDA -> Input */
<API key>(_3_TOUCH_SDA_28V);
udelay(delay);
EXT_I2C_SCL_HIGH;
/* udelay(delay); */
ack = gpio_get_value(_3_TOUCH_SDA_28V);
EXT_I2C_SCL_LOW;
/* udelay(delay); */
if (ack)
printk(KERN_INFO "EXT_I2C No ACK\n");
return ack;
}
static void EXT_I2C_NACK(u32 delay)
{
EXT_I2C_SDA_HIGH;
EXT_I2C_SCL_HIGH;
/* udelay(delay); */
EXT_I2C_SCL_LOW;
/* udelay(delay); */
}
static void EXT_I2C_SEND_ACK(u32 delay)
{
<API key>(_3_TOUCH_SDA_28V, 0);
EXT_I2C_SCL_HIGH;
/* udelay(delay); */
EXT_I2C_SCL_LOW;
/* udelay(delay); */
}
#define EXT_I2C_DELAY 1
static int _i2c_read_(unsigned char SlaveAddr, unsigned char *pData, unsigned char cLength)
{
unsigned int i;
int delay_count = 10000;
EXT_I2C_START(EXT_I2C_DELAY);
SlaveAddr = SlaveAddr << 1;
for (i = 8; i > 1; i
if ((SlaveAddr >> (i - 1)) & 0x1)
EXT_I2C_HIGH(EXT_I2C_DELAY);
else
EXT_I2C_LOW(EXT_I2C_DELAY);
}
EXT_I2C_HIGH(EXT_I2C_DELAY); /* readwrite */
if (EXT_I2C_ACK(EXT_I2C_DELAY)) {
EXT_I2C_END(EXT_I2C_DELAY);
return FALSE;
}
udelay(10);
<API key>(_3_TOUCH_SCL_28V);
delay_count = 100000;
while (delay_count
if (gpio_get_value(_3_TOUCH_SCL_28V))
break;
udelay(1);
}
while (cLength
*pData = 0;
for (i = 8; i > 0; i
/* udelay(EXT_I2C_DELAY); */
EXT_I2C_SCL_HIGH;
/* udelay(EXT_I2C_DELAY); */
*pData |=
(!!(gpio_get_value(_3_TOUCH_SDA_28V)) << (i - 1));
/* udelay(EXT_I2C_DELAY); */
EXT_I2C_SCL_LOW;
/* udelay(EXT_I2C_DELAY); */
}
if (cLength) {
EXT_I2C_SEND_ACK(EXT_I2C_DELAY);
udelay(10);
pData++;
<API key>(_3_TOUCH_SDA_28V);
<API key>(_3_TOUCH_SCL_28V);
delay_count = 100000;
while (delay_count
if (gpio_get_value(_3_TOUCH_SCL_28V))
break;
udelay(1);
}
} else
EXT_I2C_NACK(EXT_I2C_DELAY);
}
EXT_I2C_END(EXT_I2C_DELAY);
return TRUE;
}
#define TOUCHKEY_ADDRESS 0x20
int <API key>(char *version)
{
int retry = 3;
while (retry
if (_i2c_read_(TOUCHKEY_ADDRESS, version, 3))
return 0;
}
return -1;
}
void ErrorTrap(unsigned char bErrorNumber)
{
#ifndef RESET_MODE
/* Set all pins to highZ to avoid back powering the PSoC through the GPIO
// protection diodes. */
SetSCLKHiZ();
SetSDATAHiZ();
/* If Power Cycle programming, turn off the target */
RemoveTargetVDD();
#endif
printk(KERN_INFO "\r\nErrorTrap: errorNumber: %d\n", bErrorNumber);
/* TODO: write retry code or some processing. */
return;
/* while (1); */
}
/* MAIN LOOP */
/* Based on the diagram in the AN2026 */
int ISSP_main(void)
{
unsigned long flags;
nmk_gpio_set_pull(_3_TOUCH_SCL_28V, NMK_GPIO_PULL_UP);
<API key>(_3_GPIO_TOUCH_EN, 0);
msleep(1);
#ifdef RESET_MODE
gpio_tlmm_config(LED_26V_EN);
gpio_tlmm_config(EXT_TSP_SCL);
gpio_tlmm_config(EXT_TSP_SDA);
gpio_tlmm_config(LED_RST);
gpio_out(LED_RST, GPIO_LOW_VALUE);
clk_busy_wait(10);
gpio_out(LED_26V_EN, GPIO_HIGH_VALUE);
for (temp = 0; temp < 16; temp++) {
clk_busy_wait(1000);
dog_kick();
}
/* Initialize the Host & Target for ISSP operations */
printk(KERN_INFO "<API key> Start\n");
/* INTLOCK(); */
local_save_flags(flags);
local_irq_disable();
fIsError = <API key>();
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
/* INTFREE(); */
#else
/* INTLOCK(); */
local_irq_save(flags);
/* Initialize the Host & Target for ISSP operations */
fIsError = <API key>(flags);
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
/* INTFREE(); */
#endif /* RESET_MODE */
#if 0 /* issp_test_2010 block */
printk("<API key> END\n");
/* Run the SiliconID Verification, and proceed according to result. */
printk("fVerifySiliconID START\n");
#endif
/* INTLOCK(); */
fVerifySiliconID(); /* .. error // issp_test_20100709 unblock */
#if 0
fIsError = fVerifySiliconID();
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
#endif
/* INTFREE(); */
local_irq_restore(flags);
/* printk("fVerifySiliconID END\n"); // issp_test_2010 block */
/* Bulk-Erase the Device. */
/* printk("fEraseTarget START\n"); // issp_test_2010 block */
/* INTLOCK(); */
local_irq_save(flags);
fIsError = fEraseTarget();
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
/* INTFREE(); */
local_irq_restore(flags);
/* printk("fEraseTarget END\n"); // issp_test_2010 block */
/* printk("Program Flash Blocks Start\n"); */
iChecksumData = 0; /* Calculte the device checksum as you go */
for (bBankCounter = 0; bBankCounter < NUM_BANKS; bBankCounter++) { /* PTJ: NUM_BANKS should be 1 for Krypton */
local_irq_save(flags);
for (iBlockCounter = 0; iBlockCounter < BLOCKS_PER_BANK;
iBlockCounter++) {
/* printk("Program Loop : iBlockCounter %d \n",iBlockCounter); */
/* INTLOCK(); */
/* local_irq_save(flags); */
/* PTJ: READ-WRITE-SETUP used here to select SRAM Bank 1, and TSYNC Enable */
#ifdef CY8C20x66
fIsError = fSyncEnable();
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
fIsError = fReadWriteSetup();
if (fIsError) { /* send write command - swanhan */
ErrorTrap(fIsError);
return fIsError;
}
#endif
/* firmware read. */
/* LoadProgramData(bBankCounter, (unsigned char)iBlockCounter); //PTJ: this loads the Hydra with test data, not the krypton */
LoadProgramData((unsigned char)iBlockCounter, bBankCounter); /* PTJ: this loads the Hydra with test data, not the krypton */
iChecksumData += iLoadTarget(); /*PTJ: this loads the Krypton */
/* dog_kick(); */
fIsError = fProgramTargetBlock(bBankCounter,
(unsigned char)iBlockCounter);
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
#ifdef CY8C20x66 /* PTJ: READ-STATUS after PROGRAM-AND-VERIFY */
fIsError = fReadStatus();
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
#endif
/* INTFREE(); */
/* local_irq_restore(flags); */
}
local_irq_restore(flags);
}
/* printk("\r\n Program Flash Blocks End\n"); */
#if 1 /* security start */
/* printk("Program security data START\n"); */
/* INTLOCK(); */
local_irq_save(flags);
for (bBankCounter = 0; bBankCounter < NUM_BANKS; bBankCounter++) {
/* PTJ: READ-WRITE-SETUP used here to select SRAM Bank 1 */
#ifdef CY8C20x66
fIsError = fSyncEnable();
if (fIsError) { /* PTJ: 307, added for tsync enable testing. */
ErrorTrap(fIsError);
return fIsError;
}
fIsError = fReadWriteSetup();
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
#endif
/* Load one bank of security data from hex file into buffer */
fIsError = fLoadSecurityData(bBankCounter);
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
/* Secure one bank of the target flash */
fIsError = fSecureTargetFlash();
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
}
/* INTFREE(); */
local_irq_restore(flags);
/* printk("Program security data END\n"); */
/* INTLOCK(); */
local_irq_save(flags);
fIsError = fLoadSecurityData(bBankCounter);
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
#ifdef CY8C20x66
fIsError = fReadSecurity();
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
#endif
/* INTFREE(); */
local_irq_restore(flags);
/* printk("Load security data END\n"); */
#endif /* security end */
/* INTLOCK(); */
local_irq_save(flags);
iChecksumTarget = 0;
for (bBankCounter = 0; bBankCounter < NUM_BANKS; bBankCounter++) {
fIsError = <API key>(&iChecksumTarget);
if (fIsError) {
ErrorTrap(fIsError);
return fIsError;
}
}
/* INTFREE(); */
local_irq_restore(flags);
/* printk("Checksum : iChecksumTarget (0x%X)\n", (unsigned char)iChecksumTarget); */
/* printk ("Checksum : iChecksumData (0x%X)\n", (unsigned char)iChecksumData); */
if ((unsigned short)(iChecksumTarget & 0xffff) !=
(unsigned short)(iChecksumData & 0xffff)) {
ErrorTrap(VERIFY_ERROR);
return fIsError;
}
/* printk("Doing Checksum END\n"); */
/* You may want to restart Your Target PSoC Here. */
local_irq_enable();
ReStartTarget(); /* Touch IC Reset. */
/* printk("ReStartTarget\n"); */
return 0;
}
/* end of main() */
#endif /* (PROJECT_REV_) end of file main.c */
|
#define DEBUG_SUBSYSTEM S_LOG
#include "../include/obd_class.h"
#include "llog_internal.h"
/* Open an existent log handle and add it to the open list.
* This log handle will be closed when all of the records in it are removed.
*
* Assumes caller has already pushed us into the kernel context and is locking.
* We return a lock on the handle to ensure nobody yanks it from us.
*
* This takes extra reference on llog_handle via llog_handle_get() and require
* this reference to be put by caller using llog_handle_put()
*/
static int llog_cat_id2handle(const struct lu_env *env,
struct llog_handle *cathandle,
struct llog_handle **res,
struct llog_logid *logid)
{
struct llog_handle *loghandle;
int rc = 0;
if (!cathandle)
return -EBADF;
down_write(&cathandle->lgh_lock);
list_for_each_entry(loghandle, &cathandle->u.chd.chd_head,
u.phd.phd_entry) {
struct llog_logid *cgl = &loghandle->lgh_id;
if (ostid_id(&cgl->lgl_oi) == ostid_id(&logid->lgl_oi) &&
ostid_seq(&cgl->lgl_oi) == ostid_seq(&logid->lgl_oi)) {
if (cgl->lgl_ogen != logid->lgl_ogen) {
CERROR("%s: log "DOSTID" generation %x != %x\n",
loghandle->lgh_ctxt->loc_obd->obd_name,
POSTID(&logid->lgl_oi), cgl->lgl_ogen,
logid->lgl_ogen);
continue;
}
loghandle->u.phd.phd_cat_handle = cathandle;
up_write(&cathandle->lgh_lock);
rc = 0;
goto out;
}
}
up_write(&cathandle->lgh_lock);
rc = llog_open(env, cathandle->lgh_ctxt, &loghandle, logid, NULL,
LLOG_OPEN_EXISTS);
if (rc < 0) {
CERROR("%s: error opening log id "DOSTID":%x: rc = %d\n",
cathandle->lgh_ctxt->loc_obd->obd_name,
POSTID(&logid->lgl_oi), logid->lgl_ogen, rc);
return rc;
}
rc = llog_init_handle(env, loghandle, LLOG_F_IS_PLAIN, NULL);
if (rc < 0) {
llog_close(env, loghandle);
loghandle = NULL;
return rc;
}
down_write(&cathandle->lgh_lock);
list_add(&loghandle->u.phd.phd_entry, &cathandle->u.chd.chd_head);
up_write(&cathandle->lgh_lock);
loghandle->u.phd.phd_cat_handle = cathandle;
loghandle->u.phd.phd_cookie.lgc_lgl = cathandle->lgh_id;
loghandle->u.phd.phd_cookie.lgc_index =
loghandle->lgh_hdr->llh_cat_idx;
out:
llog_handle_get(loghandle);
*res = loghandle;
return 0;
}
int llog_cat_close(const struct lu_env *env, struct llog_handle *cathandle)
{
struct llog_handle *loghandle, *n;
int rc;
<API key>(loghandle, n, &cathandle->u.chd.chd_head,
u.phd.phd_entry) {
/* unlink open-not-created llogs */
list_del_init(&loghandle->u.phd.phd_entry);
llog_close(env, loghandle);
}
/* if handle was stored in ctxt, remove it too */
if (cathandle->lgh_ctxt->loc_handle == cathandle)
cathandle->lgh_ctxt->loc_handle = NULL;
rc = llog_close(env, cathandle);
return rc;
}
EXPORT_SYMBOL(llog_cat_close);
static int llog_cat_process_cb(const struct lu_env *env,
struct llog_handle *cat_llh,
struct llog_rec_hdr *rec, void *data)
{
struct llog_process_data *d = data;
struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
struct llog_handle *llh;
int rc;
if (rec->lrh_type != LLOG_LOGID_MAGIC) {
CERROR("invalid record in catalog\n");
return -EINVAL;
}
CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog "
DOSTID"\n", POSTID(&lir->lid_id.lgl_oi), lir->lid_id.lgl_ogen,
rec->lrh_index, POSTID(&cat_llh->lgh_id.lgl_oi));
rc = llog_cat_id2handle(env, cat_llh, &llh, &lir->lid_id);
if (rc) {
CERROR("%s: cannot find handle for llog "DOSTID": %d\n",
cat_llh->lgh_ctxt->loc_obd->obd_name,
POSTID(&lir->lid_id.lgl_oi), rc);
return rc;
}
if (rec->lrh_index < d->lpd_startcat)
/* Skip processing of the logs until startcat */
rc = 0;
else if (d->lpd_startidx > 0) {
struct <API key> cd;
cd.lpcd_first_idx = d->lpd_startidx;
cd.lpcd_last_idx = 0;
rc = <API key>(env, llh, d->lpd_cb, d->lpd_data,
&cd, false);
/* Continue processing the next log from idx 0 */
d->lpd_startidx = 0;
} else {
rc = <API key>(env, llh, d->lpd_cb, d->lpd_data,
NULL, false);
}
llog_handle_put(llh);
return rc;
}
static int <API key>(const struct lu_env *env,
struct llog_handle *cat_llh,
llog_cb_t cb, void *data, int startcat,
int startidx, bool fork)
{
struct llog_process_data d;
struct llog_log_hdr *llh = cat_llh->lgh_hdr;
int rc;
LASSERT(llh->llh_flags & LLOG_F_IS_CAT);
d.lpd_data = data;
d.lpd_cb = cb;
d.lpd_startcat = startcat;
d.lpd_startidx = startidx;
if (llh->llh_cat_idx > cat_llh->lgh_last_idx) {
struct <API key> cd;
CWARN("catlog "DOSTID" crosses index zero\n",
POSTID(&cat_llh->lgh_id.lgl_oi));
cd.lpcd_first_idx = llh->llh_cat_idx;
cd.lpcd_last_idx = 0;
rc = <API key>(env, cat_llh, llog_cat_process_cb,
&d, &cd, fork);
if (rc != 0)
return rc;
cd.lpcd_first_idx = 0;
cd.lpcd_last_idx = cat_llh->lgh_last_idx;
rc = <API key>(env, cat_llh, llog_cat_process_cb,
&d, &cd, fork);
} else {
rc = <API key>(env, cat_llh, llog_cat_process_cb,
&d, NULL, fork);
}
return rc;
}
int llog_cat_process(const struct lu_env *env, struct llog_handle *cat_llh,
llog_cb_t cb, void *data, int startcat, int startidx)
{
return <API key>(env, cat_llh, cb, data, startcat,
startidx, false);
}
EXPORT_SYMBOL(llog_cat_process);
|
<?php
class <API key> extends <API key>
{
/**
* IDp wrappers initializer
*/
function initialize()
{
parent::initialize();
// Provider api end-points
$this->api->api_endpoint_url = "http://api.myspace.com/v1/";
$this->api->authorize_url = "http://api.myspace.com/authorize";
$this->api->request_token_url = "http://api.myspace.com/request_token";
$this->api->access_token_url = "http://api.myspace.com/access_token";
}
/**
* get the connected uid from myspace api
*/
public function getCurrentUserId()
{
$response = $this->api->get( 'http://api.myspace.com/v1/user.json' );
if ( ! isset( $response->userId ) ){
throw new Exception( "User id request failed! {$this->providerId} returned an invalid response." );
}
return $response->userId;
}
/**
* load the user profile from the IDp api client
*/
function getUserProfile()
{
$userId = $this->getCurrentUserId();
$data = $this->api->get( 'http://api.myspace.com/v1/users/' . $userId . '/profile.json' );
if ( ! is_object( $data ) ){
throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
}
$this->user->profile->identifier = $userId;
$this->user->profile->displayName = $data->basicprofile->name;
$this->user->profile->description = $data->aboutme;
$this->user->profile->gender = $data->basicprofile->gender;
$this->user->profile->photoURL = $data->basicprofile->image;
$this->user->profile->profileURL = $data->basicprofile->webUri;
$this->user->profile->age = $data->age;
$this->user->profile->country = $data->country;
$this->user->profile->region = $data->region;
$this->user->profile->city = $data->city;
$this->user->profile->zip = $data->postalcode;
return $this->user->profile;
}
/**
* load the user contacts
*/
function getUserContacts()
{
$userId = $this->getCurrentUserId();
$response = $this->api->get( "http://api.myspace.com/v1/users/" . $userId . "/friends.json" );
if ( ! is_object( $response ) ){
throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
}
$contacts = ARRAY();
foreach( $response->Friends as $item ){
$uc = new Hybrid_User_Contact();
$uc->identifier = $item->userId;
$uc->displayName = $item->name;
$uc->profileURL = $item->webUri;
$uc->photoURL = $item->image;
$uc->description = $item->status;
$contacts[] = $uc;
}
return $contacts;
}
/**
* update user status
*/
function setUserStatus( $status )
{
// crappy myspace... gonna see this asaic
$userId = $this->getCurrentUserId();
$parameters = array( 'status' => $status );
$response = $this->api->api( "http://api.myspace.com/v1/users/" . $userId . "/status", 'PUT', $parameters );
// check the last HTTP status code returned
if ( $this->api->http_code != 200 )
{
throw new Exception( "Update user status failed! {$this->providerId} returned an error. " . $this-><API key>( $this->api->http_code ) );
}
}
/**
* load the user latest activity
* - timeline : all the stream
* - me : the user activity only
*/
function getUserActivity( $stream )
{
$userId = $this->getCurrentUserId();
if( $stream == "me" ){
$response = $this->api->get( "http://api.myspace.com/v1/users/" . $userId . "/status.json" );
}
else{
$response = $this->api->get( "http://api.myspace.com/v1/users/" . $userId . "/friends/status.json" );
}
if ( ! is_object( $response ) ){
throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
}
$activities = ARRAY();
if( $stream == "me" ){
// todo
}
else{
foreach( $response->FriendsStatus as $item ){
$ua = new <API key>();
$ua->id = $item->statusId;
$ua->date = NULL; // to find out!!
$ua->text = $item->status;
$ua->user->identifier = $item->user->userId;
$ua->user->displayName = $item->user->name;
$ua->user->profileURL = $item->user->uri;
$ua->user->photoURL = $item->user->image;
$activities[] = $ua;
}
}
return $activities;
}
}
|
Shindo.tests('Fog::Compute::RackspaceV2 | network_tests', ['rackspace']) do
service = Fog::Compute.new(:provider => 'Rackspace', :version => 'V2')
network_format = {
'id' => String,
'label' => String,
'cidr' => Fog::Nullable::String
}
get_network_format = {
'network' => network_format
}
<API key> = {
'networks' => [network_format]
}
tests('success') do
network_id = nil
tests('#create_network').formats(get_network_format) do
service.create_network("fog_#{Time.now.to_i.to_s}", '192.168.0.0/24').body.tap do |r|
network_id = r['network']['id']
end
end
tests('#list_networks').formats(<API key>) do
service.list_networks.body
end
tests('#get_network').formats(get_network_format) do
service.get_network(network_id).body
end
tests('#delete_network').succeeds do
service.delete_network(network_id)
end
end
test('failure') do
tests('#get_network').raises(Fog::Compute::RackspaceV2::NotFound) do
service.get_network(0)
end
tests('#delete_network').raises(Fog::Compute::RackspaceV2::NotFound) do
service.delete_network(0)
end
end
end
|
<?php
namespace Gedmo\Uploadable\Stub;
use Gedmo\Uploadable\FileInfo\FileInfoArray;
class FileInfoStub extends FileInfoArray
{
}
|
#include "net/disk_cache/blockfile/bitmap.h"
#include <algorithm>
#include "base/logging.h"
namespace {
// Returns the number of trailing zeros.
int FindLSBSetNonZero(uint32 word) {
// Get the LSB, put it on the exponent of a 32 bit float and remove the
// mantisa and the bias. This code requires IEEE 32 bit float compliance.
float f = static_cast<float>(word & -static_cast<int>(word));
// We use a union to go around strict-aliasing complains.
union {
float ieee_float;
uint32 as_uint;
} x;
x.ieee_float = f;
return (x.as_uint >> 23) - 0x7f;
}
// Returns the index of the first bit set to |value| from |word|. This code
// assumes that we'll be able to find that bit.
int FindLSBNonEmpty(uint32 word, bool value) {
// If we are looking for 0, negate |word| and look for 1.
if (!value)
word = ~word;
return FindLSBSetNonZero(word);
}
} // namespace
namespace disk_cache {
Bitmap::Bitmap(int num_bits, bool clear_bits)
: num_bits_(num_bits),
array_size_(RequiredArraySize(num_bits)),
alloc_(true) {
map_ = new uint32[array_size_];
// Initialize all of the bits.
if (clear_bits)
Clear();
}
Bitmap::Bitmap(uint32* map, int num_bits, int num_words)
: map_(map),
num_bits_(num_bits),
// If size is larger than necessary, trim because array_size_ is used
// as a bound by various methods.
array_size_(std::min(RequiredArraySize(num_bits), num_words)),
alloc_(false) {
}
Bitmap::~Bitmap() {
if (alloc_)
delete [] map_;
}
void Bitmap::Resize(int num_bits, bool clear_bits) {
DCHECK(alloc_ || !map_);
const int old_maxsize = num_bits_;
const int old_array_size = array_size_;
array_size_ = RequiredArraySize(num_bits);
if (array_size_ != old_array_size) {
uint32* new_map = new uint32[array_size_];
// Always clear the unused bits in the last word.
new_map[array_size_ - 1] = 0;
memcpy(new_map, map_,
sizeof(*map_) * std::min(array_size_, old_array_size));
if (alloc_)
delete[] map_; // No need to check for NULL.
map_ = new_map;
alloc_ = true;
}
num_bits_ = num_bits;
if (old_maxsize < num_bits_ && clear_bits) {
SetRange(old_maxsize, num_bits_, false);
}
}
void Bitmap::Set(int index, bool value) {
DCHECK_LT(index, num_bits_);
DCHECK_GE(index, 0);
const int i = index & (kIntBits - 1);
const int j = index / kIntBits;
if (value)
map_[j] |= (1 << i);
else
map_[j] &= ~(1 << i);
}
bool Bitmap::Get(int index) const {
DCHECK_LT(index, num_bits_);
DCHECK_GE(index, 0);
const int i = index & (kIntBits-1);
const int j = index / kIntBits;
return ((map_[j] & (1 << i)) != 0);
}
void Bitmap::Toggle(int index) {
DCHECK_LT(index, num_bits_);
DCHECK_GE(index, 0);
const int i = index & (kIntBits - 1);
const int j = index / kIntBits;
map_[j] ^= (1 << i);
}
void Bitmap::SetMapElement(int array_index, uint32 value) {
DCHECK_LT(array_index, array_size_);
DCHECK_GE(array_index, 0);
map_[array_index] = value;
}
uint32 Bitmap::GetMapElement(int array_index) const {
DCHECK_LT(array_index, array_size_);
DCHECK_GE(array_index, 0);
return map_[array_index];
}
void Bitmap::SetMap(const uint32* map, int size) {
memcpy(map_, map, std::min(size, array_size_) * sizeof(*map_));
}
void Bitmap::SetRange(int begin, int end, bool value) {
DCHECK_LE(begin, end);
int start_offset = begin & (kIntBits - 1);
if (start_offset) {
// Set the bits in the first word.
int len = std::min(end - begin, kIntBits - start_offset);
SetWordBits(begin, len, value);
begin += len;
}
if (begin == end)
return;
// Now set the bits in the last word.
int end_offset = end & (kIntBits - 1);
end -= end_offset;
SetWordBits(end, end_offset, value);
// Set all the words in the middle.
memset(map_ + (begin / kIntBits), (value ? 0xFF : 0x00),
((end / kIntBits) - (begin / kIntBits)) * sizeof(*map_));
}
// Return true if any bit between begin inclusive and end exclusive
// is set. 0 <= begin <= end <= bits() is required.
bool Bitmap::TestRange(int begin, int end, bool value) const {
DCHECK_LT(begin, num_bits_);
DCHECK_LE(end, num_bits_);
DCHECK_LE(begin, end);
DCHECK_GE(begin, 0);
DCHECK_GE(end, 0);
// Return false immediately if the range is empty.
if (begin >= end || end <= 0)
return false;
// Calculate the indices of the words containing the first and last bits,
// along with the positions of the bits within those words.
int word = begin / kIntBits;
int offset = begin & (kIntBits - 1);
int last_word = (end - 1) / kIntBits;
int last_offset = (end - 1) & (kIntBits - 1);
// If we are looking for zeros, negate the data from the map.
uint32 this_word = map_[word];
if (!value)
this_word = ~this_word;
// If the range spans multiple words, discard the extraneous bits of the
// first word by shifting to the right, and then test the remaining bits.
if (word < last_word) {
if (this_word >> offset)
return true;
offset = 0;
word++;
// Test each of the "middle" words that lies completely within the range.
while (word < last_word) {
this_word = map_[word++];
if (!value)
this_word = ~this_word;
if (this_word)
return true;
}
}
// Test the portion of the last word that lies within the range. (This logic
// also handles the case where the entire range lies within a single word.)
const uint32 mask = ((2 << (last_offset - offset)) - 1) << offset;
this_word = map_[last_word];
if (!value)
this_word = ~this_word;
return (this_word & mask) != 0;
}
bool Bitmap::FindNextBit(int* index, int limit, bool value) const {
DCHECK_LT(*index, num_bits_);
DCHECK_LE(limit, num_bits_);
DCHECK_LE(*index, limit);
DCHECK_GE(*index, 0);
DCHECK_GE(limit, 0);
const int bit_index = *index;
if (bit_index >= limit || limit <= 0)
return false;
// From now on limit != 0, since if it was we would have returned false.
int word_index = bit_index >> kLogIntBits;
uint32 one_word = map_[word_index];
// Simple optimization where we can immediately return true if the first
// bit is set. This helps for cases where many bits are set, and doesn't
// hurt too much if not.
if (Get(bit_index) == value)
return true;
const int first_bit_offset = bit_index & (kIntBits - 1);
// First word is special - we need to mask off leading bits.
uint32 mask = 0xFFFFFFFF << first_bit_offset;
if (value) {
one_word &= mask;
} else {
one_word |= ~mask;
}
uint32 empty_value = value ? 0 : 0xFFFFFFFF;
// Loop through all but the last word. Note that 'limit' is one
// past the last bit we want to check, and we don't want to read
// past the end of "words". E.g. if num_bits_ == 32 only words[0] is
// valid, so we want to avoid reading words[1] when limit == 32.
const int last_word_index = (limit - 1) >> kLogIntBits;
while (word_index < last_word_index) {
if (one_word != empty_value) {
*index = (word_index << kLogIntBits) + FindLSBNonEmpty(one_word, value);
return true;
}
one_word = map_[++word_index];
}
// Last word is special - we may need to mask off trailing bits. Note that
// 'limit' is one past the last bit we want to check, and if limit is a
// multiple of 32 we want to check all bits in this word.
const int last_bit_offset = (limit - 1) & (kIntBits - 1);
mask = 0xFFFFFFFE << last_bit_offset;
if (value) {
one_word &= ~mask;
} else {
one_word |= mask;
}
if (one_word != empty_value) {
*index = (word_index << kLogIntBits) + FindLSBNonEmpty(one_word, value);
return true;
}
return false;
}
int Bitmap::FindBits(int* index, int limit, bool value) const {
DCHECK_LT(*index, num_bits_);
DCHECK_LE(limit, num_bits_);
DCHECK_LE(*index, limit);
DCHECK_GE(*index, 0);
DCHECK_GE(limit, 0);
if (!FindNextBit(index, limit, value))
return false;
// Now see how many bits have the same value.
int end = *index;
if (!FindNextBit(&end, limit, !value))
return limit - *index;
return end - *index;
}
void Bitmap::SetWordBits(int start, int len, bool value) {
DCHECK_LT(len, kIntBits);
DCHECK_GE(len, 0);
if (!len)
return;
int word = start / kIntBits;
int offset = start % kIntBits;
uint32 to_add = 0xffffffff << len;
to_add = (~to_add) << offset;
if (value) {
map_[word] |= to_add;
} else {
map_[word] &= ~to_add;
}
}
} // namespace disk_cache
|
/**
*
* @bug 4959409
* @author Naoto Sato
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class bug4959409 extends javax.swing.JApplet {
public void init() {
new TestFrame();
}
}
class TestFrame extends JFrame implements KeyListener {
JTextField text;
JLabel label;
TestFrame () {
text = new JTextField();
text.addKeyListener(this);
label = new JLabel(" ");
Container c = getContentPane();
BorderLayout borderLayout1 = new BorderLayout();
c.setLayout(borderLayout1);
c.add(text, BorderLayout.CENTER);
c.add(label, BorderLayout.SOUTH);
setSize(300, 200);
setVisible(true);
}
public void keyPressed(KeyEvent e) {
int code = e.getKeyCode();
int mods = e.getModifiers();
if (code == '1' && mods == KeyEvent.SHIFT_MASK) {
label.setText("KEYPRESS received for Shift+1");
} else {
label.setText(" ");
}
}
public void keyTyped(KeyEvent e) {
}
public void keyReleased(KeyEvent e) {
}
}
|
/*
* This header file contains extensions to the TEE Client API that are
* specific to the Trusted Foundations implementations
*/
#ifndef <API key>
#define <API key>
#include <linux/types.h>
/* <API key> login types */
#define <API key> 0x80000000
#define <API key> 0x80000002
#define <API key> 0x80000002
/* Type definitions */
typedef u64 TEEC_TimeLimit;
void TEEC_EXPORT TEEC_GetTimeLimit(
TEEC_Context * context,
uint32_t timeout,
TEEC_TimeLimit *timeLimit);
TEEC_Result TEEC_EXPORT TEEC_OpenSessionEx(
TEEC_Context * context,
TEEC_Session * session,
const TEEC_TimeLimit *timeLimit,
const TEEC_UUID * destination,
uint32_t connectionMethod,
void *connectionData,
TEEC_Operation * operation,
uint32_t *errorOrigin);
TEEC_Result TEEC_EXPORT <API key>(
TEEC_Session * session,
const TEEC_TimeLimit *timeLimit,
uint32_t commandID,
TEEC_Operation * operation,
uint32_t *errorOrigin);
#endif /* <API key> */
|
declare var a: number;
var b: typeof a = "...";
var c: typeof a = "...";
type T = number;
var x:T = "...";
// what about recursive unions?
|
/**
* Italian translation for <API key>
* Enrico Rubboli <rubboli@gmail.com>
*/
;(function($){
$.fn.datepicker.dates['it'] = {
days: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"],
daysShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom"],
daysMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"],
months: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
monthsShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"],
today: "Oggi",
weekStart: 1,
format: "dd/mm/yyyy"
};
}(jQuery));
|
<?php
namespace Symfony\Component\Security\Core\Tests\Authentication\Provider;
use Symfony\Component\Security\Core\Authentication\Provider\LdapBind<API key>;
use Symfony\Component\Security\Core\Authentication\Token\<API key>;
use Symfony\Component\Security\Core\User\User;
use Symfony\Component\Ldap\Exception\ConnectionException;
/**
* @requires extension ldap
*/
class LdapBind<API key> extends \<API key>
{
/**
* @expectedException \Symfony\Component\Security\Core\Exception\<API key>
* @<API key> The presented password is invalid.
*/
public function <API key>()
{
$userProvider = $this->getMock('Symfony\Component\Security\Core\User\<API key>');
$ldap = $this->getMock('Symfony\Component\Ldap\LdapClientInterface');
$ldap
->expects($this->once())
->method('bind')
->will($this->throwException(new ConnectionException()))
;
$userChecker = $this->getMock('Symfony\Component\Security\Core\User\<API key>');
$provider = new LdapBind<API key>($userProvider, $userChecker, 'key', $ldap);
$reflection = new \ReflectionMethod($provider, 'checkAuthentication');
$reflection->setAccessible(true);
$reflection->invoke($provider, new User('foo', null), new <API key>('foo', '', 'key'));
}
public function testRetrieveUser()
{
$userProvider = $this->getMock('Symfony\Component\Security\Core\User\<API key>');
$userProvider
->expects($this->once())
->method('loadUserByUsername')
->with('foo')
;
$ldap = $this->getMock('Symfony\Component\Ldap\LdapClientInterface');
$userChecker = $this->getMock('Symfony\Component\Security\Core\User\<API key>');
$provider = new LdapBind<API key>($userProvider, $userChecker, 'key', $ldap);
$reflection = new \ReflectionMethod($provider, 'retrieveUser');
$reflection->setAccessible(true);
$reflection->invoke($provider, 'foo', new <API key>('foo', 'bar', 'key'));
}
}
|
<a href='https://github.com/angular/angular.js/edit/v1.5.x/docs/content/error/$compile/nodomevents.ngdoc?message=docs(error%2Fnodomevents)%3A%20describe%20your%20change...' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit"> </i>Improve this Doc</a>
<h1>Error: $compile:nodomevents
<div><span class='hint'>Interpolated Event Attributes</span></div>
</h1>
<div>
<pre class="minerr-errmsg" error-display="Interpolations for HTML DOM event attributes are disallowed. Please use the ng- versions (such as ng-click instead of onclick) instead.">Interpolations for HTML DOM event attributes are disallowed. Please use the ng- versions (such as ng-click instead of onclick) instead.</pre>
</div>
<h2>Description</h2>
<div class="description">
<p>This error occurs when one tries to create a binding for event handler attributes like <code>onclick</code>, <code>onload</code>, <code>onsubmit</code>, etc.</p>
<p>There is no practical value in binding to these attributes and doing so only exposes your application to security vulnerabilities like XSS.
For these reasons binding to event handler attributes (all attributes that start with <code>on</code> and <code>formaction</code> attribute) is not supported.</p>
<p>An example code that would allow XSS vulnerability by evaluating user input in the window context could look like this:</p>
<pre><code><input ng-model="username">
<div onclick="{{username}}">click me</div>
</code></pre>
<p>Since the <code>onclick</code> evaluates the value as JavaScript code in the window context, setting the <code>username</code> model to a value like <code>javascript:alert('PWND')</code> would result in script injection when the <code>div</code> is clicked.</p>
</div>
|
/*
* lh7a40x SoC series common interface
*/
#ifndef __LH7A40X_H__
#define __LH7A40X_H__
/* (SMC) Static Memory Controller (usersguide 4.2.1) */
typedef struct {
volatile u32 attib;
volatile u32 com;
volatile u32 io;
volatile u32 rsvd1;
} /*__attribute__((__packed__))*/ lh7a40x_pccard_t;
typedef struct {
volatile u32 bcr[8];
lh7a40x_pccard_t pccard[2];
volatile u32 pcmciacon;
} /*__attribute__((__packed__))*/ lh7a40x_smc_t;
#define LH7A40X_SMC_BASE (0x80002000)
#define LH7A40X_SMC_PTR ((lh7a40x_smc_t*) LH7A40X_SMC_BASE)
/* (SDMC) Synchronous Dynamic Ram Controller (usersguide 5.3.1) */
typedef struct {
volatile u32 rsvd1;
volatile u32 gblcnfg;
volatile u32 rfshtmr;
volatile u32 bootstat;
volatile u32 sdcsc[4];
} /*__attribute__((__packed__))*/ lh7a40x_sdmc_t;
#define LH7A40X_SDMC_BASE (0x80002400)
#define LH7A40X_SDMC_PTR ((lh7a40x_sdmc_t*) LH7A40X_SDMC_BASE)
/* (CSC) Clock and State Controller (userguide 6.2.1) */
typedef struct {
volatile u32 pwrsr;
volatile u32 pwrcnt;
volatile u32 halt;
volatile u32 stby;
volatile u32 bleoi;
volatile u32 mceoi;
volatile u32 teoi;
volatile u32 stfclr;
volatile u32 clkset;
volatile u32 scrreg[2];
volatile u32 rsvd1;
volatile u32 usbreset;
} /*__attribute__((__packed__))*/ lh7a40x_csc_t;
#define LH7A40X_STPWR_BASE (0x80000400)
#define LH7A40X_CSC_PTR ((lh7a40x_csc_t*) LH7A40X_STPWR_BASE)
#define CLKSET_SMCROM (0x01000000)
#define CLKSET_PS (0x000C0000)
#define CLKSET_PS_0 (0x00000000)
#define CLKSET_PS_1 (0x00040000)
#define CLKSET_PS_2 (0x00080000)
#define CLKSET_PS_3 (0x000C0000)
#define CLKSET_PCLKDIV (0x00030000)
#define CLKSET_PCLKDIV_2 (0x00000000)
#define CLKSET_PCLKDIV_4 (0x00010000)
#define CLKSET_PCLKDIV_8 (0x00020000)
#define CLKSET_MAINDIV2 (0x0000f800)
#define CLKSET_MAINDIV1 (0x00000780)
#define CLKSET_PREDIV (0x0000007C)
#define CLKSET_HCLKDIV (0x00000003)
/* (DMA) Direct Memory Access Controller (userguide 9.2.1) */
typedef struct {
volatile u32 maxcnt;
volatile u32 base;
volatile u32 current;
volatile u32 rsvd1;
} lh7a40x_dmabuf_t;
typedef struct {
volatile u32 control;
volatile u32 interrupt;
volatile u32 rsvd1;
volatile u32 status;
volatile u32 rsvd2;
volatile u32 remain;
volatile u32 rsvd3;
volatile u32 rsvd4;
lh7a40x_dmabuf_t buf[2];
} /*__attribute__((__packed__))*/ lh7a40x_dmachan_t;
/* (WDT) Watchdog Timer (userguide 11.2.1) */
typedef struct {
volatile u32 ctl;
volatile u32 rst;
volatile u32 status;
volatile u32 count[4];
} /*__attribute__((__packed__))*/ lh7a40x_wdt_t;
#define LH7A40X_WDT_BASE (0x80001400)
#define LH7A40X_WDT_PTR ((lh7a40x_wdt_t*) LH7A40X_WDT_BASE)
/* (RTC) Real Time Clock (lh7a400 userguide 12.2.1, lh7a404 userguide 13.2.1) */
typedef struct {
volatile u32 rtcdr;
volatile u32 rtclr;
volatile u32 rtcmr;
volatile u32 unk1;
volatile u32 rtcstat_eoi;
volatile u32 rtccr;
volatile u32 rsvd1[58];
} /*__attribute__((__packed__))*/ lh7a40x_rtc_t;
#define LH7A40X_RTC_BASE (0x80000D00)
#define LH7A40X_RTC_PTR ((lh7a40x_rtc_t*) LH7A40X_RTC_BASE)
/* Timers (lh7a400 userguide 13.2.1, lh7a404 userguide 11.2.1) */
typedef struct {
volatile u32 load;
volatile u32 value;
volatile u32 control;
volatile u32 tceoi;
} /*__attribute__((__packed__))*/ lh7a40x_timer_t;
typedef struct {
lh7a40x_timer_t timer1;
volatile u32 rsvd1[4];
lh7a40x_timer_t timer2;
volatile u32 unk1[4];
volatile u32 bzcon;
volatile u32 unk2[15];
lh7a40x_timer_t timer3;
/*volatile u32 rsvd2;*/
} /*__attribute__((__packed__))*/ lh7a40x_timers_t;
#define LH7A40X_TIMERS_BASE (0x80000C00)
#define LH7A40X_TIMERS_PTR ((lh7a40x_timers_t*) LH7A40X_TIMERS_BASE)
#define TIMER_EN (0x00000080)
#define TIMER_PER (0x00000040)
#define TIMER_FREE (0x00000000)
#define TIMER_CLK508K (0x00000008)
#define TIMER_CLK2K (0x00000000)
/* (SSP) Sychronous Serial Ports (lh7a400 userguide 14.2.1, lh7a404 userguide 14.2.1) */
typedef struct {
volatile u32 cr0;
volatile u32 cr1;
volatile u32 irr_roeoi;
volatile u32 dr;
volatile u32 cpr;
volatile u32 sr;
/*volatile u32 rsvd1[58];*/
} /*__attribute__((__packed__))*/ lh7a40x_ssp_t;
#define LH7A40X_SSP_BASE (0x80000B00)
#define LH7A40X_SSP_PTR ((lh7a40x_ssp_t*) LH7A40X_SSP_BASE)
/* (UART) Universal Asychronous Receiver/Transmitter (lh7a400 userguide 15.2.1, lh7a404 userguide 15.2.1) */
typedef struct {
volatile u32 data;
volatile u32 fcon;
volatile u32 brcon;
volatile u32 con;
volatile u32 status;
volatile u32 rawisr;
volatile u32 inten;
volatile u32 isr;
volatile u32 rsvd1[56];
} /*__attribute__((__packed__))*/ lh7a40x_uart_t;
#define LH7A40X_UART_BASE (0x80000600)
#define LH7A40X_UART_PTR(n) \
((lh7a40x_uart_t*) (LH7A40X_UART_BASE + ((n-1) * sizeof(lh7a40x_uart_t))))
#define UART_BE (0x00000800) /* the rx error bits */
#define UART_OE (0x00000400)
#define UART_PE (0x00000200)
#define UART_FE (0x00000100)
#define UART_WLEN (0x00000060) /* fcon bits */
#define UART_WLEN_8 (0x00000060)
#define UART_WLEN_7 (0x00000040)
#define UART_WLEN_6 (0x00000020)
#define UART_WLEN_5 (0x00000000)
#define UART_FEN (0x00000010)
#define UART_STP2 (0x00000008)
#define UART_STP2_2 (0x00000008)
#define UART_STP2_1 (0x00000000)
#define UART_EPS (0x00000004)
#define UART_EPS_EVEN (0x00000004)
#define UART_EPS_ODD (0x00000000)
#define UART_PEN (0x00000002)
#define UART_BRK (0x00000001)
#define UART_BAUDDIV (0x0000ffff) /* brcon bits */
#define UART_SIRBD (0x00000080) /* con bits */
#define UART_LBE (0x00000040)
#define UART_MXP (0x00000020)
#define UART_TXP (0x00000010)
#define UART_RXP (0x00000008)
#define UART_SIRLP (0x00000004)
#define UART_SIRD (0x00000002)
#define UART_EN (0x00000001)
#define UART_TXFE (0x00000080) /* status bits */
#define UART_RXFF (0x00000040)
#define UART_TXFF (0x00000020)
#define UART_RXFE (0x00000010)
#define UART_BUSY (0x00000008)
#define UART_DCD (0x00000004)
#define UART_DSR (0x00000002)
#define UART_CTS (0x00000001)
#define UART_MSEOI (0xfffffff0) /* rawisr interrupt bits */
#define UART_RTI (0x00000008) /* generic interrupt bits */
#define UART_MI (0x00000004)
#define UART_TI (0x00000002)
#define UART_RI (0x00000001)
/* (GPIO) General Purpose IO and External Interrupts (userguide 16.2.1) */
typedef struct {
volatile u32 pad;
volatile u32 pbd;
volatile u32 pcd;
volatile u32 pdd;
volatile u32 padd;
volatile u32 pbdd;
volatile u32 pcdd;
volatile u32 pddd;
volatile u32 ped;
volatile u32 pedd;
volatile u32 kbdctl;
volatile u32 pinmux;
volatile u32 pfd;
volatile u32 pfdd;
volatile u32 pgd;
volatile u32 pgdd;
volatile u32 phd;
volatile u32 phdd;
volatile u32 rsvd1;
volatile u32 inttype1;
volatile u32 inttype2;
volatile u32 gpiofeoi;
volatile u32 gpiointen;
volatile u32 intstatus;
volatile u32 rawintstatus;
volatile u32 gpiodb;
volatile u32 papd;
volatile u32 pbpd;
volatile u32 pcpd;
volatile u32 pdpd;
volatile u32 pepd;
volatile u32 pfpd;
volatile u32 pgpd;
volatile u32 phpd;
} /*__attribute__((__packed__))*/ lh7a40x_gpioint_t;
#define <API key> (0x80000E00)
#define LH7A40X_GPIOINT_PTR ((lh7a40x_gpioint_t*) <API key>)
/* Embedded SRAM */
#define CFG_SRAM_BASE (0xB0000000)
#define CFG_SRAM_SIZE (80*1024) /* 80kB */
#endif /* __LH7A40X_H__ */
|
kitten_paw
=======
This is the firmware for the 2016 revision of the Kitten Paw controller by Bathroom Epiphanies. Most of the boilerplate code is the work of [BathroomEpiphanies](https://github.com/BathroomEpiphanies).
NKRO doesn't work at the moment, I don't know if I will take the time to find out how to fix this, so far 6KRO is enough for me.
Keyboard Maintainer: QMK Community
Hardware Supported: Kitten Paw PCB
Hardware Availability: https://geekhack.org/index.php?topic=46700.0
Make example for this keyboard (after setting up your build environment):
make bpiphany/kitten_paw:default
See the [build environment setup](https://docs.qmk.fm/
|
.fs_grid_row {
width: 300px;
margin-left: auto;
margin-right: auto;
}
@media screen and (min-width: 500px) {
.fs_grid_row {
width: 480px;
}
}
@media screen and (min-width: 740px) {
.fs_grid_row {
width: 720px;
}
}
@media screen and (min-width: 980px) {
.fs_grid_row {
width: 960px;
}
}
@media screen and (min-width: 1220px) {
.fs_grid_row {
width: 1200px;
}
}
.fs_grid_row:after {
height: 0;
clear: both;
content: ".";
display: block;
line-height: 0;
visibility: hidden;
}
.fs_grid_row_fluid {
width: 96%;
width: -webkit-calc(100% - 40px);
width: calc(100% - 40px);
}
@media screen and (max-width: 739px) {
.<API key> {
width: 96%;
width: -webkit-calc(100% - 40px);
width: calc(100% - 40px);
}
}
.fs_grid_row_row {
width: 102.08333333%;
margin-left: -1.04166667%;
margin-right: -1.04166667%;
}
.<API key> {
width: 100%;
margin-left: 0;
margin-right: 0;
}
.fs_grid_cell {
width: 97.91666667%;
float: left;
margin-left: 1.04166667%;
margin-right: 1.04166667%;
}
.<API key> {
float: none;
margin-left: auto;
margin-right: auto;
}
.fs_grid_cell_padded {
box-sizing: content-box;
margin-left: 0;
margin-right: 0;
padding-left: 1.04166667%;
padding-right: 1.04166667%;
}
.<API key> {
margin-left: 0;
margin-right: 0;
}
.fs_grid_cell_right {
float: right;
}
*,
*:before,
*:after {
behavior: url(boxsizing.htc);
}
.fs-grid .fs-row {
width: 960px;
}
.fs-grid .fs-row .fs-lg-1 {
width: 6.25%;
}
.fs-grid .fs-row .fs-lg-2 {
width: 14.58333333%;
}
.fs-grid .fs-row .fs-lg-3 {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-lg-4 {
width: 31.25%;
}
.fs-grid .fs-row .fs-lg-5 {
width: 39.58333333%;
}
.fs-grid .fs-row .fs-lg-6 {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-lg-7 {
width: 56.25%;
}
.fs-grid .fs-row .fs-lg-8 {
width: 64.58333333%;
}
.fs-grid .fs-row .fs-lg-9 {
width: 72.91666667%;
}
.fs-grid .fs-row .fs-lg-10 {
width: 81.25%;
}
.fs-grid .fs-row .fs-lg-11 {
width: 89.58333333%;
}
.fs-grid .fs-row .fs-lg-12 {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-lg-push-1 {
margin-left: 9.375%;
}
.fs-grid .fs-row .fs-lg-push-2 {
margin-left: 17.70833333%;
}
.fs-grid .fs-row .fs-lg-push-3 {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-lg-push-4 {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-lg-push-5 {
margin-left: 42.70833333%;
}
.fs-grid .fs-row .fs-lg-push-6 {
margin-left: 51.04166667%;
}
.fs-grid .fs-row .fs-lg-push-7 {
margin-left: 59.375%;
}
.fs-grid .fs-row .fs-lg-push-8 {
margin-left: 67.70833333%;
}
.fs-grid .fs-row .fs-lg-push-9 {
margin-left: 76.04166667%;
}
.fs-grid .fs-row .fs-lg-push-10 {
margin-left: 84.375%;
}
.fs-grid .fs-row .fs-lg-push-11 {
margin-left: 92.70833333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-1 {
width: 8.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-2 {
width: 16.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-3 {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-4 {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-5 {
width: 41.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-6 {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-7 {
width: 58.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-8 {
width: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-9 {
width: 75%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-10 {
width: 83.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-11 {
width: 91.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-12 {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-1 {
margin-left: 8.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-2 {
margin-left: 16.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-3 {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-4 {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-5 {
margin-left: 41.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-6 {
margin-left: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-7 {
margin-left: 58.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-8 {
margin-left: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-9 {
margin-left: 75%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-10 {
margin-left: 83.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-11 {
margin-left: 91.66666667%;
}
.fs-grid .fs-row .fs-lg-fifth {
width: 17.91666667%;
}
.fs-grid .fs-row .fs-lg-fourth {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-lg-third {
width: 31.25%;
}
.fs-grid .fs-row .fs-lg-half {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-lg-full {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-lg-push-fifth {
margin-left: 21.04166667%;
}
.fs-grid .fs-row .fs-lg-push-fourth {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-lg-push-third {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-lg-push-half {
margin-left: 51.04166667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-fifth {
width: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-fourth {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-third {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-half {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-full {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-fifth {
margin-left: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-fourth {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-third {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-half {
margin-left: 50%;
}
.fs-grid .fs-row .fs-lg-hide {
display: none;
}
.fs-grid .fs-row .fs-cell.-padded {
behavior: none;
}
|
#include <linux/pci.h>
#include <linux/i2c.h>
#include <linux/kdev_t.h>
#include <linux/slab.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-ctrls.h>
#include <media/tuner.h>
#include <media/tveeprom.h>
#include <media/videobuf2-dma-sg.h>
#include <media/videobuf2-dvb.h>
#include <media/rc-core.h>
#include "cx23885-reg.h"
#include "media/drv-intf/cx2341x.h"
#include <linux/mutex.h>
#define CX23885_VERSION "0.0.4"
#define UNSET (-1U)
#define CX23885_MAXBOARDS 8
/* Max number of inputs by card */
#define MAX_CX23885_INPUT 8
#define INPUT(nr) (&cx23885_boards[dev->board].input[nr])
#define BUFFER_TIMEOUT (HZ) /* 0.5 seconds */
#define <API key> UNSET
#define <API key> 0
#define <API key> 1
#define <API key> 2
#define <API key> 3
#define <API key> 4
#define <API key> 5
#define <API key> 6
#define <API key> 7
#define <API key> 8
#define <API key> 9
#define <API key> 10
#define <API key> 11
#define <API key> 12
#define <API key> 13
#define <API key> 14
#define <API key> 15
#define <API key> 16
#define <API key> 17
#define <API key> 18
#define <API key> 19
#define <API key> 20
#define <API key> 21
#define <API key> 22
#define <API key> 23
#define <API key> 24
#define <API key> 25
#define <API key> 26
#define <API key> 27
#define <API key> 28
#define <API key> 29
#define <API key> 30
#define <API key> 31
#define <API key> 32
#define <API key> 33
#define <API key> 34
#define <API key> 35
#define <API key> 36
#define <API key> 37
#define <API key> 38
#define <API key> 39
#define <API key> 40
#define <API key> 41
#define <API key> 42
#define <API key> 43
#define <API key> 44
#define <API key> 45
#define <API key> 46
#define <API key> 47
#define <API key> 48
#define <API key> 49
#define <API key> 50
#define <API key> 51
#define <API key> 52
#define <API key> 53
#define <API key> 54
#define <API key> 55
#define <API key> 56
#define <API key> 57
#define GPIO_0 0x00000001
#define GPIO_1 0x00000002
#define GPIO_2 0x00000004
#define GPIO_3 0x00000008
#define GPIO_4 0x00000010
#define GPIO_5 0x00000020
#define GPIO_6 0x00000040
#define GPIO_7 0x00000080
#define GPIO_8 0x00000100
#define GPIO_9 0x00000200
#define GPIO_10 0x00000400
#define GPIO_11 0x00000800
#define GPIO_12 0x00001000
#define GPIO_13 0x00002000
#define GPIO_14 0x00004000
#define GPIO_15 0x00008000
/* Currently unsupported by the driver: PAL/H, NTSC/Kr, SECAM B/G/H/LC */
#define CX23885_NORMS (\
V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_443 | \
V4L2_STD_PAL_BG | V4L2_STD_PAL_DK | V4L2_STD_PAL_I | \
V4L2_STD_PAL_M | V4L2_STD_PAL_N | V4L2_STD_PAL_Nc | \
V4L2_STD_PAL_60 | V4L2_STD_SECAM_L | V4L2_STD_SECAM_DK)
struct cx23885_fmt {
char *name;
u32 fourcc; /* v4l2 format id */
int depth;
int flags;
u32 cxformat;
};
struct cx23885_tvnorm {
char *name;
v4l2_std_id id;
u32 cxiformat;
u32 cxoformat;
};
enum cx23885_itype {
<API key> = 1,
<API key>,
<API key>,
<API key>,
CX23885_VMUX_SVIDEO,
<API key>,
<API key>,
CX23885_VMUX_CABLE,
CX23885_VMUX_DVB,
CX23885_VMUX_DEBUG,
CX23885_RADIO,
};
enum <API key> {
<API key> = 0,
<API key>
};
struct cx23885_riscmem {
unsigned int size;
__le32 *cpu;
__le32 *jmp;
dma_addr_t dma;
};
/* buffer for one video frame */
struct cx23885_buffer {
/* common v4l buffer stuff -- must be first */
struct vb2_v4l2_buffer vb;
struct list_head queue;
/* cx23885 specific */
unsigned int bpl;
struct cx23885_riscmem risc;
struct cx23885_fmt *fmt;
u32 count;
};
struct cx23885_input {
enum cx23885_itype type;
unsigned int vmux;
unsigned int amux;
u32 gpio0, gpio1, gpio2, gpio3;
};
typedef enum {
<API key> = 0,
CX23885_MPEG_DVB,
<API key>,
<API key>,
} port_t;
struct cx23885_board {
char *name;
port_t porta, portb, portc;
int num_fds_portb, num_fds_portc;
unsigned int tuner_type;
unsigned int radio_type;
unsigned char tuner_addr;
unsigned char radio_addr;
unsigned int tuner_bus;
/* Vendors can and do run the PCIe bridge at different
* clock rates, driven physically by crystals on the PCBs.
* The core has to accommodate this. This allows the user
* to add new boards with new frequencys. The value is
* expressed in Hz.
*
* The core framework will default this value based on
* current designs, but it can vary.
*/
u32 clk_freq;
struct cx23885_input input[MAX_CX23885_INPUT];
int ci_type; /* for NetUP */
/* Force bottom field first during DMA (888 workaround) */
u32 force_bff;
};
struct cx23885_subid {
u16 subvendor;
u16 subdevice;
u32 card;
};
struct cx23885_i2c {
struct cx23885_dev *dev;
int nr;
/* i2c i/o */
struct i2c_adapter i2c_adap;
struct i2c_client i2c_client;
u32 i2c_rc;
/* 885 registers used for raw addess */
u32 i2c_period;
u32 reg_ctrl;
u32 reg_stat;
u32 reg_addr;
u32 reg_rdata;
u32 reg_wdata;
};
struct cx23885_dmaqueue {
struct list_head active;
u32 count;
};
struct cx23885_tsport {
struct cx23885_dev *dev;
unsigned nr;
int sram_chno;
struct vb2_dvb_frontends frontends;
/* dma queues */
struct cx23885_dmaqueue mpegq;
u32 ts_packet_size;
u32 ts_packet_count;
int width;
int height;
spinlock_t slock;
/* registers */
u32 reg_gpcnt;
u32 reg_gpcnt_ctl;
u32 reg_dma_ctl;
u32 reg_lngth;
u32 reg_hw_sop_ctrl;
u32 reg_gen_ctrl;
u32 reg_bd_pkt_status;
u32 reg_sop_status;
u32 reg_fifo_ovfl_stat;
u32 reg_vld_misc;
u32 reg_ts_clk_en;
u32 reg_ts_int_msk;
u32 reg_ts_int_stat;
u32 reg_src_sel;
/* Default register vals */
int pci_irqmask;
u32 dma_ctl_val;
u32 ts_int_msk_val;
u32 gen_ctrl_val;
u32 ts_clk_en_val;
u32 src_sel_val;
u32 vld_misc_val;
u32 hw_sop_ctrl_val;
/* Allow a single tsport to have multiple frontends */
u32 num_frontends;
void (*gate_ctrl)(struct cx23885_tsport *port, int open);
void *port_priv;
/* Workaround for a temp dvb_frontend that the tuner can attached to */
struct dvb_frontend analog_fe;
struct i2c_client *i2c_client_demod;
struct i2c_client *i2c_client_tuner;
struct i2c_client *i2c_client_sec;
struct i2c_client *i2c_client_ci;
int (*set_frontend)(struct dvb_frontend *fe);
int (*fe_set_voltage)(struct dvb_frontend *fe,
enum fe_sec_voltage voltage);
};
struct cx23885_kernel_ir {
struct cx23885_dev *cx;
char *name;
char *phys;
struct rc_dev *rc;
};
struct <API key> {
unsigned int bpl;
struct cx23885_riscmem risc;
void *vaddr;
struct scatterlist *sglist;
int sglen;
int nr_pages;
};
struct cx23885_audio_dev {
struct cx23885_dev *dev;
struct pci_dev *pci;
struct snd_card *card;
spinlock_t lock;
atomic_t count;
unsigned int dma_size;
unsigned int period_size;
unsigned int num_periods;
struct <API key> *buf;
struct snd_pcm_substream *substream;
};
struct cx23885_dev {
atomic_t refcount;
struct v4l2_device v4l2_dev;
struct v4l2_ctrl_handler ctrl_handler;
/* pci stuff */
struct pci_dev *pci;
unsigned char pci_rev, pci_lat;
int pci_bus, pci_slot;
u32 __iomem *lmmio;
u8 __iomem *bmmio;
int pci_irqmask;
spinlock_t pci_irqmask_lock; /* protects mask reg too */
int hwrevision;
/* This valud is board specific and is used to configure the
* AV core so we see nice clean and stable video and audio. */
u32 clk_freq;
/* I2C adapters: Master 1 & 2 (External) & Master 3 (Internal only) */
struct cx23885_i2c i2c_bus[3];
int nr;
struct mutex lock;
struct mutex gpio_lock;
/* board details */
unsigned int board;
char name[32];
struct cx23885_tsport ts1, ts2;
/* sram configuration */
struct sram_channel *sram_channels;
enum {
<API key> = 0,
CX23885_BRIDGE_885 = 885,
CX23885_BRIDGE_887 = 887,
CX23885_BRIDGE_888 = 888,
} bridge;
/* Analog video */
unsigned int input;
unsigned int audinput; /* Selectable audio input */
u32 tvaudio;
v4l2_std_id tvnorm;
unsigned int tuner_type;
unsigned char tuner_addr;
unsigned int tuner_bus;
unsigned int radio_type;
unsigned char radio_addr;
struct v4l2_subdev *sd_cx25840;
struct work_struct cx25840_work;
/* Infrared */
struct v4l2_subdev *sd_ir;
struct work_struct ir_rx_work;
unsigned long ir_rx_notifications;
struct work_struct ir_tx_work;
unsigned long ir_tx_notifications;
struct cx23885_kernel_ir *kernel_ir;
atomic_t ir_input_stopping;
/* V4l */
u32 freq;
struct video_device *video_dev;
struct video_device *vbi_dev;
/* video capture */
struct cx23885_fmt *fmt;
unsigned int width, height;
unsigned field;
struct cx23885_dmaqueue vidq;
struct vb2_queue vb2_vidq;
struct cx23885_dmaqueue vbiq;
struct vb2_queue vb2_vbiq;
spinlock_t slock;
/* MPEG Encoder ONLY settings */
u32 cx23417_mailbox;
struct cx2341x_handler cxhdl;
struct video_device *v4l_device;
struct vb2_queue vb2_mpegq;
struct cx23885_tvnorm encodernorm;
/* Analog raw audio */
struct cx23885_audio_dev *audio_dev;
};
static inline struct cx23885_dev *to_cx23885(struct v4l2_device *v4l2_dev)
{
return container_of(v4l2_dev, struct cx23885_dev, v4l2_dev);
}
#define call_all(dev, o, f, args...) \
<API key>(&dev->v4l2_dev, 0, o, f, ##args)
#define CX23885_HW_888_IR (1 << 0)
#define CX23885_HW_AV_CORE (1 << 1)
#define call_hw(dev, grpid, o, f, args...) \
<API key>(&dev->v4l2_dev, grpid, o, f, ##args)
extern struct v4l2_subdev *cx23885_find_hw(struct cx23885_dev *dev, u32 hw);
#define SRAM_CH01 0 /* Video A */
#define SRAM_CH02 1 /* VBI A */
#define SRAM_CH03 2 /* Video B */
#define SRAM_CH04 3 /* Transport via B */
#define SRAM_CH05 4 /* VBI B */
#define SRAM_CH06 5 /* Video C */
#define SRAM_CH07 6 /* Transport via C */
#define SRAM_CH08 7 /* Audio Internal A */
#define SRAM_CH09 8 /* Audio Internal B */
#define SRAM_CH10 9 /* Audio External */
#define SRAM_CH11 10 /* COMB_3D_N */
#define SRAM_CH12 11 /* Comb 3D N1 */
#define SRAM_CH13 12 /* Comb 3D N2 */
#define SRAM_CH14 13 /* MOE Vid */
#define SRAM_CH15 14 /* MOE RSLT */
struct sram_channel {
char *name;
u32 cmds_start;
u32 ctrl_start;
u32 cdt;
u32 fifo_start;
u32 fifo_size;
u32 ptr1_reg;
u32 ptr2_reg;
u32 cnt1_reg;
u32 cnt2_reg;
u32 jumponly;
};
#define cx_read(reg) readl(dev->lmmio + ((reg)>>2))
#define cx_write(reg, value) writel((value), dev->lmmio + ((reg)>>2))
#define cx_andor(reg, mask, value) \
writel((readl(dev->lmmio+((reg)>>2)) & ~(mask)) |\
((value) & (mask)), dev->lmmio+((reg)>>2))
#define cx_set(reg, bit) cx_andor((reg), (bit), (bit))
#define cx_clear(reg, bit) cx_andor((reg), (bit), 0)
/* cx23885-core.c */
extern int <API key>(struct cx23885_dev *dev,
struct sram_channel *ch,
unsigned int bpl, u32 risc);
extern void <API key>(struct cx23885_dev *dev,
struct sram_channel *ch);
extern int cx23885_risc_buffer(struct pci_dev *pci, struct cx23885_riscmem *risc,
struct scatterlist *sglist,
unsigned int top_offset, unsigned int bottom_offset,
unsigned int bpl, unsigned int padding, unsigned int lines);
extern int <API key>(struct pci_dev *pci,
struct cx23885_riscmem *risc, struct scatterlist *sglist,
unsigned int top_offset, unsigned int bottom_offset,
unsigned int bpl, unsigned int padding, unsigned int lines);
int cx23885_start_dma(struct cx23885_tsport *port,
struct cx23885_dmaqueue *q,
struct cx23885_buffer *buf);
void <API key>(struct cx23885_tsport *port);
extern void cx23885_gpio_set(struct cx23885_dev *dev, u32 mask);
extern void cx23885_gpio_clear(struct cx23885_dev *dev, u32 mask);
extern u32 cx23885_gpio_get(struct cx23885_dev *dev, u32 mask);
extern void cx23885_gpio_enable(struct cx23885_dev *dev, u32 mask,
int asoutput);
extern void <API key>(struct cx23885_dev *dev, u32 mask);
extern void cx23885_irq_enable(struct cx23885_dev *dev, u32 mask);
extern void cx23885_irq_disable(struct cx23885_dev *dev, u32 mask);
extern void cx23885_irq_remove(struct cx23885_dev *dev, u32 mask);
/* cx23885-cards.c */
extern struct cx23885_board cx23885_boards[];
extern const unsigned int cx23885_bcount;
extern struct cx23885_subid cx23885_subids[];
extern const unsigned int cx23885_idcount;
extern int <API key>(void *priv, int component,
int command, int arg);
extern void cx23885_card_list(struct cx23885_dev *dev);
extern int cx23885_ir_init(struct cx23885_dev *dev);
extern void <API key>(struct cx23885_dev *dev);
extern void cx23885_ir_fini(struct cx23885_dev *dev);
extern void cx23885_gpio_setup(struct cx23885_dev *dev);
extern void cx23885_card_setup(struct cx23885_dev *dev);
extern void <API key>(struct cx23885_dev *dev);
extern int <API key>(struct cx23885_tsport *port);
extern int <API key>(struct cx23885_tsport *port);
extern int cx23885_buf_prepare(struct cx23885_buffer *buf,
struct cx23885_tsport *port);
extern void cx23885_buf_queue(struct cx23885_tsport *port,
struct cx23885_buffer *buf);
extern void cx23885_free_buffer(struct cx23885_dev *dev,
struct cx23885_buffer *buf);
/* cx23885-video.c */
/* Video */
extern int <API key>(struct cx23885_dev *dev);
extern void <API key>(struct cx23885_dev *dev);
extern int cx23885_video_irq(struct cx23885_dev *dev, u32 status);
extern void <API key>(struct cx23885_dev *dev,
struct cx23885_dmaqueue *q, u32 count);
int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i);
int cx23885_set_input(struct file *file, void *priv, unsigned int i);
int cx23885_get_input(struct file *file, void *priv, unsigned int *i);
int <API key>(struct file *file, void *priv, const struct v4l2_frequency *f);
int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm);
/* cx23885-vbi.c */
extern int cx23885_vbi_fmt(struct file *file, void *priv,
struct v4l2_format *f);
extern void cx23885_vbi_timeout(unsigned long data);
extern struct vb2_ops cx23885_vbi_qops;
extern int cx23885_vbi_irq(struct cx23885_dev *dev, u32 status);
/* cx23885-i2c.c */
extern int <API key>(struct cx23885_i2c *bus);
extern int <API key>(struct cx23885_i2c *bus);
extern void cx23885_av_clk(struct cx23885_dev *dev, int enable);
/* cx23885-417.c */
extern int <API key>(struct cx23885_dev *dev);
extern void <API key>(struct cx23885_dev *dev);
extern int cx23885_irq_417(struct cx23885_dev *dev, u32 status);
extern void <API key>(struct cx23885_dev *dev);
extern void cx23885_mc417_init(struct cx23885_dev *dev);
extern int mc417_memory_read(struct cx23885_dev *dev, u32 address, u32 *value);
extern int mc417_memory_write(struct cx23885_dev *dev, u32 address, u32 value);
extern int mc417_register_read(struct cx23885_dev *dev,
u16 address, u32 *value);
extern int <API key>(struct cx23885_dev *dev,
u16 address, u32 value);
extern void mc417_gpio_set(struct cx23885_dev *dev, u32 mask);
extern void mc417_gpio_clear(struct cx23885_dev *dev, u32 mask);
extern void mc417_gpio_enable(struct cx23885_dev *dev, u32 mask, int asoutput);
/* cx23885-alsa.c */
extern struct cx23885_audio_dev *<API key>(
struct cx23885_dev *dev);
extern void <API key>(struct cx23885_dev *dev);
extern int cx23885_audio_irq(struct cx23885_dev *dev, u32 status, u32 mask);
extern int <API key>(struct pci_dev *pci,
struct cx23885_riscmem *risc,
struct scatterlist *sglist,
unsigned int bpl,
unsigned int lines,
unsigned int lpi);
/* tv norms */
static inline unsigned int norm_maxh(v4l2_std_id norm)
{
return (norm & V4L2_STD_525_60) ? 480 : 576;
}
|
// Use of this source code is governed by a BSD-style
// Extensions to the standard "os" package.
package osext // import "github.com/kardianos/osext"
import "path/filepath"
// Executable returns an absolute path that can be used to
// re-invoke the current program.
// It may not be valid after the current program exits.
func Executable() (string, error) {
p, err := executable()
return filepath.Clean(p), err
}
// Returns same path as Executable, returns just the folder
// path. Excludes the executable name.
func ExecutableFolder() (string, error) {
p, err := Executable()
if err != nil {
return "", err
}
folder, _ := filepath.Split(p)
return folder, nil
}
|
#ifndef <API key>
#define <API key>
// 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.
#include "QtPrintSupport/qprintengine.h"
#ifndef QT_NO_PRINTER
#include <QtCore/qstring.h>
#include <QtGui/qpaintengine.h>
#include <private/qpaintengine_p.h>
#include <private/qprintdevice_p.h>
#include <private/qprintengine_pdf_p.h>
QT_BEGIN_NAMESPACE
class <API key>;
class QCupsPrintEngine : public QPdfPrintEngine
{
Q_DECLARE_PRIVATE(QCupsPrintEngine)
public:
QCupsPrintEngine(QPrinter::PrinterMode m);
virtual ~QCupsPrintEngine();
// reimplementations QPdfPrintEngine
void setProperty(<API key> key, const QVariant &value);
QVariant property(<API key> key) const;
// end reimplementations QPdfPrintEngine
private:
Q_DISABLE_COPY(QCupsPrintEngine)
};
class <API key> : public <API key>
{
Q_DECLARE_PUBLIC(QCupsPrintEngine)
public:
<API key>(QPrinter::PrinterMode m);
~<API key>();
bool openPrintDevice();
void closePrintDevice();
private:
Q_DISABLE_COPY(<API key>)
void setupDefaultPrinter();
void changePrinter(const QString &newPrinter);
void setPageSize(const QPageSize &pageSize);
QPrintDevice m_printDevice;
QStringList cupsOptions;
QString cupsTempFile;
};
QT_END_NAMESPACE
#endif // QT_NO_PRINTER
#endif // <API key>
|
# modification, are permitted provided that the following conditions
# are met:
# 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
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# 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.
ifeq ($(RTE_SDK),)
$(error "Please define RTE_SDK environment variable")
endif
# Default target, can be overriden by command line or environment
RTE_TARGET ?= <API key>
include $(RTE_SDK)/mk/rte.vars.mk
# binary name
APP = l2fwd
# all source are stored in SRCS-y
SRCS-y := main.c
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
include $(RTE_SDK)/mk/rte.extapp.mk
|
<?php
namespace PicoFeed\Scraper;
use DomDocument;
use DOMXPath;
use PicoFeed\Logging\Logger;
use PicoFeed\Parser\XmlParser;
/**
* Candidate Parser.
*
* @author Frederic Guillot
*/
class CandidateParser implements ParserInterface
{
private $dom;
private $xpath;
/**
* List of attributes to try to get the content, order is important, generic terms at the end.
*
* @var array
*/
private $<API key> = array(
'articleBody',
'articlebody',
'article-body',
'articleContent',
'articlecontent',
'article-content',
'articlePage',
'post-content',
'post_content',
'entry-content',
'entry-body',
'main-content',
'story_content',
'storycontent',
'entryBox',
'entrytext',
'comic',
'post',
'article',
'content',
'main',
);
/**
* List of attributes to strip.
*
* @var array
*/
private $stripAttributes = array(
'comment',
'share',
'links',
'toolbar',
'fb',
'footer',
'credit',
'bottom',
'nav',
'header',
'social',
'tag',
'metadata',
'entry-utility',
'related-posts',
'tweet',
'categories',
'post_title',
'by_line',
'byline',
'sponsors',
);
/**
* Tags to remove.
*
* @var array
*/
private $stripTags = array(
'nav',
'header',
'footer',
'aside',
'form',
);
/**
* Constructor.
*
* @param string $html
*/
public function __construct($html)
{
$this->dom = XmlParser::getHtmlDocument('<?xml version="1.0" encoding="UTF-8">'.$html);
$this->xpath = new DOMXPath($this->dom);
}
/**
* Get the relevant content with the list of potential attributes.
*
* @return string
*/
public function execute()
{
$content = $this-><API key>();
if (strlen($content) < 200) {
$content = $this-><API key>();
}
if (strlen($content) < 50) {
$content = $this->findContentWithBody();
}
return $this->stripGarbage($content);
}
/**
* Find content based on the list of tag candidates.
*
* @return string
*/
public function <API key>()
{
foreach ($this-><API key> as $candidate) {
Logger::setMessage(get_called_class().': Try this candidate: "'.$candidate.'"');
/**
* Find <article/> tag.
*
* @return string
*/
public function <API key>()
{
$nodes = $this->xpath->query('//article');
if ($nodes !== false && $nodes->length > 0) {
Logger::setMessage(get_called_class().': Find <article/> tag');
return $this->dom->saveXML($nodes->item(0));
}
return '';
}
/**
* Find <body/> tag.
*
* @return string
*/
public function findContentWithBody()
{
$nodes = $this->xpath->query('//body');
if ($nodes !== false && $nodes->length > 0) {
Logger::setMessage(get_called_class().' Find <body/>');
return $this->dom->saveXML($nodes->item(0));
}
return '';
}
/**
* Strip useless tags.
*
* @param string $content
*
* @return string
*/
public function stripGarbage($content)
{
$dom = XmlParser::getDomDocument($content);
if ($dom !== false) {
$xpath = new DOMXPath($dom);
$this->stripTags($xpath);
$this->stripAttributes($dom, $xpath);
$content = $dom->saveXML($dom->documentElement);
}
return $content;
}
/**
* Remove blacklisted tags.
*
* @param DOMXPath $xpath
*/
public function stripTags(DOMXPath $xpath)
{
foreach ($this->stripTags as $tag) {
$nodes = $xpath->query('//'.$tag);
if ($nodes !== false && $nodes->length > 0) {
Logger::setMessage(get_called_class().': Strip tag: "'.$tag.'"');
foreach ($nodes as $node) {
$node->parentNode->removeChild($node);
}
}
}
}
/**
* Remove blacklisted attributes.
*
* @param DomDocument $dom
* @param DOMXPath $xpath
*/
public function stripAttributes(DomDocument $dom, DOMXPath $xpath)
{
foreach ($this->stripAttributes as $attribute) {
/**
* Return false if the node should not be removed.
*
* @param DomDocument $dom
* @param DomNode $node
*
* @return bool
*/
public function shouldRemove(DomDocument $dom, $node)
{
$document_length = strlen($dom->textContent);
$node_length = strlen($node->textContent);
if ($document_length === 0) {
return true;
}
$ratio = $node_length * 100 / $document_length;
if ($ratio >= 90) {
Logger::setMessage(get_called_class().': Should not remove this node ('.$node->nodeName.') ratio: '.$ratio.'%');
return false;
}
return true;
}
}
|
<div class="modal" ng-controller="<API key>">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 translate="EDITOR.POPUP.UNSAVED-CHANGES.TITLE"></h2>
</div>
<div class="modal-body">
<p translate="EDITOR.POPUP.UNSAVED-CHANGES.DESCRIPTION"></p>
</div>
<div class="modal-footer">
<div class="pull-right">
<button class="btn btn-danger" ng-click="ok()" translate="EDITOR.POPUP.UNSAVED-CHANGES.ACTION.DISCARD"></button>
<button class="btn btn-default" ng-click="cancel()" translate="EDITOR.POPUP.UNSAVED-CHANGES.ACTION.CONTINUE"></button>
</div>
<div class="loading pull-right" ng-show="loading">
<div class="l1"></div><div class="l2"></div><div class="l2"></div>
</div>
</div>
</div>
</div>
</div>
|
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Displays the 'User groups' sub page under 'Users' page.
*
* @package PhpMyAdmin
*/
require_once 'libraries/common.inc.php';
require_once 'libraries/server_users.lib.php';
require_once 'libraries/server_user_groups.lib.php';
<API key>();
if (! $GLOBALS['cfgRelation']['menuswork']) {
exit;
}
$response = PMA_Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('server_user_groups.js');
/**
* Only allowed to superuser
*/
if (! $GLOBALS['is_superuser']) {
$response->addHTML(PMA_Message::error(__('No Privileges'))->getDisplay());
exit;
}
$response->addHTML('<div>');
$response->addHTML(<API key>('server_user_groups.php'));
/**
* Delete user group
*/
if (! empty($_REQUEST['deleteUserGroup'])) {
PMA_deleteUserGroup($_REQUEST['userGroup']);
}
/**
* Add a new user group
*/
if (! empty($_REQUEST['addUserGroupSubmit'])) {
PMA_editUserGroup($_REQUEST['userGroup'], true);
}
/**
* Update a user group
*/
if (! empty($_REQUEST['editUserGroupSubmit'])) {
PMA_editUserGroup($_REQUEST['userGroup']);
}
if (isset($_REQUEST['viewUsers'])) {
// Display users belonging to a user group
$response->addHTML(<API key>($_REQUEST['userGroup']));
}
if (isset($_REQUEST['addUserGroup'])) {
// Display add user group dialog
$response->addHTML(<API key>());
} elseif (isset($_REQUEST['editUserGroup'])) {
// Display edit user group dialog
$response->addHTML(<API key>($_REQUEST['userGroup']));
} else {
// Display user groups table
$response->addHTML(<API key>());
}
$response->addHTML('</div>');
|
// <API key>: GPL-2.0
/* ethtool support for iavf */
#include "iavf.h"
#include <linux/uaccess.h>
/* ethtool statistics helpers */
/**
* struct iavf_stats - definition for an ethtool statistic
* @stat_string: statistic name to display in ethtool -S output
* @sizeof_stat: the sizeof() the stat, must be no greater than sizeof(u64)
* @stat_offset: offsetof() the stat from a base pointer
*
* This structure defines a statistic to be added to the ethtool stats buffer.
* It defines a statistic as offset from a common base pointer. Stats should
* be defined in constant arrays using the IAVF_STAT macro, with every element
* of the array using the same _type for calculating the sizeof_stat and
* stat_offset.
*
* The @sizeof_stat is expected to be sizeof(u8), sizeof(u16), sizeof(u32) or
* sizeof(u64). Other sizes are not expected and will produce a WARN_ONCE from
* the <API key>() helper function.
*
* The @stat_string is interpreted as a format string, allowing formatted
* values to be inserted while looping over multiple structures for a given
* statistics array. Thus, every statistic string in an array should have the
* same type and number of format specifiers, to be formatted by variadic
* arguments to the <API key>() helper function.
**/
struct iavf_stats {
char stat_string[ETH_GSTRING_LEN];
int sizeof_stat;
int stat_offset;
};
/* Helper macro to define an iavf_stat structure with proper size and type.
* Use this when defining constant statistics arrays. Note that @_type expects
* only a type name and is used multiple times.
*/
#define IAVF_STAT(_type, _name, _stat) { \
.stat_string = _name, \
.sizeof_stat = sizeof_field(_type, _stat), \
.stat_offset = offsetof(_type, _stat) \
}
/* Helper macro for defining some statistics related to queues */
#define IAVF_QUEUE_STAT(_name, _stat) \
IAVF_STAT(struct iavf_ring, _name, _stat)
/* Stats associated with a Tx or Rx ring */
static const struct iavf_stats <API key>[] = {
IAVF_QUEUE_STAT("%s-%u.packets", stats.packets),
IAVF_QUEUE_STAT("%s-%u.bytes", stats.bytes),
};
/**
* <API key> - copy the stat into the supplied buffer
* @data: location to store the stat value
* @pointer: basis for where to copy from
* @stat: the stat definition
*
* Copies the stat data defined by the pointer and stat structure pair into
* the memory supplied as data. Used to implement <API key> and
* <API key>. If the pointer is null, data will be zero'd.
*/
static void
<API key>(u64 *data, void *pointer,
const struct iavf_stats *stat)
{
char *p;
if (!pointer) {
/* ensure that the ethtool data buffer is zero'd for any stats
* which don't have a valid pointer.
*/
*data = 0;
return;
}
p = (char *)pointer + stat->stat_offset;
switch (stat->sizeof_stat) {
case sizeof(u64):
*data = *((u64 *)p);
break;
case sizeof(u32):
*data = *((u32 *)p);
break;
case sizeof(u16):
*data = *((u16 *)p);
break;
case sizeof(u8):
*data = *((u8 *)p);
break;
default:
WARN_ONCE(1, "unexpected stat size for %s",
stat->stat_string);
*data = 0;
}
}
/**
* <API key> - copy stats into the ethtool supplied buffer
* @data: ethtool stats buffer
* @pointer: location to copy stats from
* @stats: array of stats to copy
* @size: the size of the stats definition
*
* Copy the stats defined by the stats array using the pointer as a base into
* the data buffer supplied by ethtool. Updates the data pointer to point to
* the next empty location for successive calls to <API key>.
* If pointer is null, set the data values to zero and update the pointer to
* skip these stats.
**/
static void
<API key>(u64 **data, void *pointer,
const struct iavf_stats stats[],
const unsigned int size)
{
unsigned int i;
for (i = 0; i < size; i++)
<API key>((*data)++, pointer, &stats[i]);
}
/**
* <API key> - copy stats into ethtool supplied buffer
* @data: ethtool stats buffer
* @pointer: location where stats are stored
* @stats: static const array of stat definitions
*
* Macro to ease the use of <API key> by taking a static
* constant stats array and passing the ARRAY_SIZE(). This avoids typos by
* ensuring that we pass the size associated with the given stats array.
*
* The parameter @stats is evaluated twice, so parameters with side effects
* should be avoided.
**/
#define <API key>(data, pointer, stats) \
<API key>(data, pointer, stats, ARRAY_SIZE(stats))
/**
* <API key> - copy queue statistics into supplied buffer
* @data: ethtool stats buffer
* @ring: the ring to copy
*
* Queue statistics must be copied while protected by
* <API key>, so we can't directly use <API key>.
* Assumes that queue stats are defined in <API key>. If the
* ring pointer is null, zero out the queue stat values and update the data
* pointer. Otherwise safely copy the stats from the ring into the supplied
* buffer and update the data pointer when finished.
*
* This function expects to be called while under rcu_read_lock().
**/
static void
<API key>(u64 **data, struct iavf_ring *ring)
{
const unsigned int size = ARRAY_SIZE(<API key>);
const struct iavf_stats *stats = <API key>;
unsigned int start;
unsigned int i;
/* To avoid invalid statistics values, ensure that we keep retrying
* the copy until we get a consistent value according to
* <API key>. But first, make sure our ring is
* non-null before attempting to access its syncp.
*/
do {
start = !ring ? 0 : <API key>(&ring->syncp);
for (i = 0; i < size; i++)
<API key>(&(*data)[i], ring, &stats[i]);
} while (ring && <API key>(&ring->syncp, start));
/* Once we successfully copy the stats in, update the data pointer */
*data += size;
}
/**
* <API key> - copy stat strings into ethtool buffer
* @p: ethtool supplied buffer
* @stats: stat definitions array
* @size: size of the stats array
*
* Format and copy the strings described by stats into the buffer pointed at
* by p.
**/
static void <API key>(u8 **p, const struct iavf_stats stats[],
const unsigned int size, ...)
{
unsigned int i;
for (i = 0; i < size; i++) {
va_list args;
va_start(args, size);
vsnprintf(*p, ETH_GSTRING_LEN, stats[i].stat_string, args);
*p += ETH_GSTRING_LEN;
va_end(args);
}
}
/**
* <API key> - copy stat strings into ethtool buffer
* @p: ethtool supplied buffer
* @stats: stat definitions array
*
* Format and copy the strings described by the const static stats value into
* the buffer pointed at by p.
*
* The parameter @stats is evaluated twice, so parameters with side effects
* should be avoided. Additionally, stats must be an array such that
* ARRAY_SIZE can be called on it.
**/
#define <API key>(p, stats, ...) \
<API key>(p, stats, ARRAY_SIZE(stats), ## __VA_ARGS__)
#define VF_STAT(_name, _stat) \
IAVF_STAT(struct iavf_adapter, _name, _stat)
static const struct iavf_stats iavf_gstrings_stats[] = {
VF_STAT("rx_bytes", current_stats.rx_bytes),
VF_STAT("rx_unicast", current_stats.rx_unicast),
VF_STAT("rx_multicast", current_stats.rx_multicast),
VF_STAT("rx_broadcast", current_stats.rx_broadcast),
VF_STAT("rx_discards", current_stats.rx_discards),
VF_STAT("rx_unknown_protocol", current_stats.rx_unknown_protocol),
VF_STAT("tx_bytes", current_stats.tx_bytes),
VF_STAT("tx_unicast", current_stats.tx_unicast),
VF_STAT("tx_multicast", current_stats.tx_multicast),
VF_STAT("tx_broadcast", current_stats.tx_broadcast),
VF_STAT("tx_discards", current_stats.tx_discards),
VF_STAT("tx_errors", current_stats.tx_errors),
};
#define IAVF_STATS_LEN ARRAY_SIZE(iavf_gstrings_stats)
#define <API key> ARRAY_SIZE(<API key>)
/* For now we have one and only one private flag and it is only defined
* when we have support for the SKIP_CPU_SYNC DMA attribute. Instead
* of leaving all this code sitting around empty we will strip it unless
* our one private flag is actually available.
*/
struct iavf_priv_flags {
char flag_string[ETH_GSTRING_LEN];
u32 flag;
bool read_only;
};
#define IAVF_PRIV_FLAG(_name, _flag, _read_only) { \
.flag_string = _name, \
.flag = _flag, \
.read_only = _read_only, \
}
static const struct iavf_priv_flags <API key>[] = {
IAVF_PRIV_FLAG("legacy-rx", IAVF_FLAG_LEGACY_RX, 0),
};
#define <API key> ARRAY_SIZE(<API key>)
/**
* <API key> - Get Link Speed and Duplex settings
* @netdev: network interface device structure
* @cmd: ethtool command
*
* Reports speed/duplex settings. Because this is a VF, we don't know what
* kind of link we really have, so we fake it.
**/
static int <API key>(struct net_device *netdev,
struct <API key> *cmd)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
<API key>(cmd, supported);
cmd->base.autoneg = AUTONEG_DISABLE;
cmd->base.port = PORT_NONE;
cmd->base.duplex = DUPLEX_FULL;
if (ADV_LINK_SUPPORT(adapter)) {
if (adapter->link_speed_mbps &&
adapter->link_speed_mbps < U32_MAX)
cmd->base.speed = adapter->link_speed_mbps;
else
cmd->base.speed = SPEED_UNKNOWN;
return 0;
}
switch (adapter->link_speed) {
case <API key>:
cmd->base.speed = SPEED_40000;
break;
case <API key>:
cmd->base.speed = SPEED_25000;
break;
case <API key>:
cmd->base.speed = SPEED_20000;
break;
case <API key>:
cmd->base.speed = SPEED_10000;
break;
case <API key>:
cmd->base.speed = SPEED_5000;
break;
case <API key>:
cmd->base.speed = SPEED_2500;
break;
case <API key>:
cmd->base.speed = SPEED_1000;
break;
case <API key>:
cmd->base.speed = SPEED_100;
break;
default:
break;
}
return 0;
}
/**
* iavf_get_sset_count - Get length of string set
* @netdev: network interface device structure
* @sset: id of string set
*
* Reports size of various string tables.
**/
static int iavf_get_sset_count(struct net_device *netdev, int sset)
{
if (sset == ETH_SS_STATS)
return IAVF_STATS_LEN +
(<API key> * 2 * IAVF_MAX_REQ_QUEUES);
else if (sset == ETH_SS_PRIV_FLAGS)
return <API key>;
else
return -EINVAL;
}
/**
* <API key> - report device statistics
* @netdev: network interface device structure
* @stats: ethtool statistics structure
* @data: pointer to data buffer
*
* All statistics are added to the data buffer as an array of u64.
**/
static void <API key>(struct net_device *netdev,
struct ethtool_stats *stats, u64 *data)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
unsigned int i;
<API key>(&data, adapter, iavf_gstrings_stats);
rcu_read_lock();
for (i = 0; i < IAVF_MAX_REQ_QUEUES; i++) {
struct iavf_ring *ring;
/* Avoid accessing un-allocated queues */
ring = (i < adapter->num_active_queues ?
&adapter->tx_rings[i] : NULL);
<API key>(&data, ring);
/* Avoid accessing un-allocated queues */
ring = (i < adapter->num_active_queues ?
&adapter->rx_rings[i] : NULL);
<API key>(&data, ring);
}
rcu_read_unlock();
}
/**
* <API key> - Get private flag strings
* @netdev: network interface device structure
* @data: buffer for string data
*
* Builds the private flags string table
**/
static void <API key>(struct net_device *netdev, u8 *data)
{
unsigned int i;
for (i = 0; i < <API key>; i++) {
snprintf(data, ETH_GSTRING_LEN, "%s",
<API key>[i].flag_string);
data += ETH_GSTRING_LEN;
}
}
/**
* <API key> - Get stat strings
* @netdev: network interface device structure
* @data: buffer for string data
*
* Builds the statistics string table
**/
static void <API key>(struct net_device *netdev, u8 *data)
{
unsigned int i;
<API key>(&data, iavf_gstrings_stats);
/* Queues are always allocated in pairs, so we just use num_tx_queues
* for both Tx and Rx queues.
*/
for (i = 0; i < netdev->num_tx_queues; i++) {
<API key>(&data, <API key>,
"tx", i);
<API key>(&data, <API key>,
"rx", i);
}
}
/**
* iavf_get_strings - Get string set
* @netdev: network interface device structure
* @sset: id of string set
* @data: buffer for string data
*
* Builds string tables for various string sets
**/
static void iavf_get_strings(struct net_device *netdev, u32 sset, u8 *data)
{
switch (sset) {
case ETH_SS_STATS:
<API key>(netdev, data);
break;
case ETH_SS_PRIV_FLAGS:
<API key>(netdev, data);
break;
default:
break;
}
}
/**
* iavf_get_priv_flags - report device private flags
* @netdev: network interface device structure
*
* The get string set count and the string set should be matched for each
* flag returned. Add new strings for each flag to the <API key>
* array.
*
* Returns a u32 bitmap of flags.
**/
static u32 iavf_get_priv_flags(struct net_device *netdev)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
u32 i, ret_flags = 0;
for (i = 0; i < <API key>; i++) {
const struct iavf_priv_flags *priv_flags;
priv_flags = &<API key>[i];
if (priv_flags->flag & adapter->flags)
ret_flags |= BIT(i);
}
return ret_flags;
}
/**
* iavf_set_priv_flags - set private flags
* @netdev: network interface device structure
* @flags: bit flags to be set
**/
static int iavf_set_priv_flags(struct net_device *netdev, u32 flags)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
u32 orig_flags, new_flags, changed_flags;
u32 i;
orig_flags = READ_ONCE(adapter->flags);
new_flags = orig_flags;
for (i = 0; i < <API key>; i++) {
const struct iavf_priv_flags *priv_flags;
priv_flags = &<API key>[i];
if (flags & BIT(i))
new_flags |= priv_flags->flag;
else
new_flags &= ~(priv_flags->flag);
if (priv_flags->read_only &&
((orig_flags ^ new_flags) & ~BIT(i)))
return -EOPNOTSUPP;
}
/* Before we finalize any flag changes, any checks which we need to
* perform to determine if the new flags will be supported should go
* here...
*/
/* Compare and exchange the new flags into place. If we failed, that
* is if cmpxchg returns anything but the old value, this means
* something else must have modified the flags variable since we
* copied it. We'll just punt with an error and log something in the
* message buffer.
*/
if (cmpxchg(&adapter->flags, orig_flags, new_flags) != orig_flags) {
dev_warn(&adapter->pdev->dev,
"Unable to update adapter->flags as it was modified by another thread...\n");
return -EAGAIN;
}
changed_flags = orig_flags ^ new_flags;
/* Process any additional changes needed as a result of flag changes.
* The changed_flags value reflects the list of bits that were changed
* in the code above.
*/
/* issue a reset to force legacy-rx change to take effect */
if (changed_flags & IAVF_FLAG_LEGACY_RX) {
if (netif_running(netdev)) {
adapter->flags |= <API key>;
queue_work(iavf_wq, &adapter->reset_task);
}
}
return 0;
}
/**
* iavf_get_msglevel - Get debug message level
* @netdev: network interface device structure
*
* Returns current debug message level.
**/
static u32 iavf_get_msglevel(struct net_device *netdev)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
return adapter->msg_enable;
}
/**
* iavf_set_msglevel - Set debug message level
* @netdev: network interface device structure
* @data: message level
*
* Set current debug message level. Higher values cause the driver to
* be noisier.
**/
static void iavf_set_msglevel(struct net_device *netdev, u32 data)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
if (IAVF_DEBUG_USER & data)
adapter->hw.debug_mask = data;
adapter->msg_enable = data;
}
/**
* iavf_get_drvinfo - Get driver info
* @netdev: network interface device structure
* @drvinfo: ethool driver info structure
*
* Returns information about the driver and device for display to the user.
**/
static void iavf_get_drvinfo(struct net_device *netdev,
struct ethtool_drvinfo *drvinfo)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
strlcpy(drvinfo->driver, iavf_driver_name, 32);
strlcpy(drvinfo->fw_version, "N/A", 4);
strlcpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
drvinfo->n_priv_flags = <API key>;
}
/**
* iavf_get_ringparam - Get ring parameters
* @netdev: network interface device structure
* @ring: ethtool ringparam structure
*
* Returns current ring parameters. TX and RX rings are reported separately,
* but the number of rings is not reported.
**/
static void iavf_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
ring->rx_max_pending = IAVF_MAX_RXD;
ring->tx_max_pending = IAVF_MAX_TXD;
ring->rx_pending = adapter->rx_desc_count;
ring->tx_pending = adapter->tx_desc_count;
}
/**
* iavf_set_ringparam - Set ring parameters
* @netdev: network interface device structure
* @ring: ethtool ringparam structure
*
* Sets ring parameters. TX and RX rings are controlled separately, but the
* number of rings is not specified, so all rings get the same settings.
**/
static int iavf_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
u32 new_rx_count, new_tx_count;
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
return -EINVAL;
new_tx_count = clamp_t(u32, ring->tx_pending,
IAVF_MIN_TXD,
IAVF_MAX_TXD);
new_tx_count = ALIGN(new_tx_count, <API key>);
new_rx_count = clamp_t(u32, ring->rx_pending,
IAVF_MIN_RXD,
IAVF_MAX_RXD);
new_rx_count = ALIGN(new_rx_count, <API key>);
/* if nothing to do return success */
if ((new_tx_count == adapter->tx_desc_count) &&
(new_rx_count == adapter->rx_desc_count))
return 0;
adapter->tx_desc_count = new_tx_count;
adapter->rx_desc_count = new_rx_count;
if (netif_running(netdev)) {
adapter->flags |= <API key>;
queue_work(iavf_wq, &adapter->reset_task);
}
return 0;
}
/**
* __iavf_get_coalesce - get per-queue coalesce settings
* @netdev: the netdev to check
* @ec: ethtool coalesce data structure
* @queue: which queue to pick
*
* Gets the per-queue settings for coalescence. Specifically Rx and Tx usecs
* are per queue. If queue is <0 then we default to queue 0 as the
* representative value.
**/
static int __iavf_get_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec, int queue)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
struct iavf_vsi *vsi = &adapter->vsi;
struct iavf_ring *rx_ring, *tx_ring;
ec-><API key> = vsi->work_limit;
ec-><API key> = vsi->work_limit;
/* Rx and Tx usecs per queue value. If user doesn't specify the
* queue, return queue 0's value to represent.
*/
if (queue < 0)
queue = 0;
else if (queue >= adapter->num_active_queues)
return -EINVAL;
rx_ring = &adapter->rx_rings[queue];
tx_ring = &adapter->tx_rings[queue];
if (ITR_IS_DYNAMIC(rx_ring->itr_setting))
ec-><API key> = 1;
if (ITR_IS_DYNAMIC(tx_ring->itr_setting))
ec-><API key> = 1;
ec->rx_coalesce_usecs = rx_ring->itr_setting & ~IAVF_ITR_DYNAMIC;
ec->tx_coalesce_usecs = tx_ring->itr_setting & ~IAVF_ITR_DYNAMIC;
return 0;
}
/**
* iavf_get_coalesce - Get interrupt coalescing settings
* @netdev: network interface device structure
* @ec: ethtool coalesce structure
*
* Returns current coalescing settings. This is referred to elsewhere in the
* driver as Interrupt Throttle Rate, as this is how the hardware describes
* this functionality. Note that if per-queue settings have been modified this
* only represents the settings of queue 0.
**/
static int iavf_get_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec)
{
return __iavf_get_coalesce(netdev, ec, -1);
}
/**
* <API key> - get coalesce values for specific queue
* @netdev: netdev to read
* @ec: coalesce settings from ethtool
* @queue: the queue to read
*
* Read specific queue's coalesce settings.
**/
static int <API key>(struct net_device *netdev, u32 queue,
struct ethtool_coalesce *ec)
{
return __iavf_get_coalesce(netdev, ec, queue);
}
/**
* <API key> - set ITR values for specific queue
* @adapter: the VF adapter struct to set values for
* @ec: coalesce settings from ethtool
* @queue: the queue to modify
*
* Change the ITR settings for a specific queue.
**/
static void <API key>(struct iavf_adapter *adapter,
struct ethtool_coalesce *ec, int queue)
{
struct iavf_ring *rx_ring = &adapter->rx_rings[queue];
struct iavf_ring *tx_ring = &adapter->tx_rings[queue];
struct iavf_q_vector *q_vector;
rx_ring->itr_setting = ITR_REG_ALIGN(ec->rx_coalesce_usecs);
tx_ring->itr_setting = ITR_REG_ALIGN(ec->tx_coalesce_usecs);
rx_ring->itr_setting |= IAVF_ITR_DYNAMIC;
if (!ec-><API key>)
rx_ring->itr_setting ^= IAVF_ITR_DYNAMIC;
tx_ring->itr_setting |= IAVF_ITR_DYNAMIC;
if (!ec-><API key>)
tx_ring->itr_setting ^= IAVF_ITR_DYNAMIC;
q_vector = rx_ring->q_vector;
q_vector->rx.target_itr = ITR_TO_REG(rx_ring->itr_setting);
q_vector = tx_ring->q_vector;
q_vector->tx.target_itr = ITR_TO_REG(tx_ring->itr_setting);
/* The interrupt handler itself will take care of programming
* the Tx and Rx ITR values based on the values we have entered
* into the q_vector, no need to write the values now.
*/
}
/**
* __iavf_set_coalesce - set coalesce settings for particular queue
* @netdev: the netdev to change
* @ec: ethtool coalesce settings
* @queue: the queue to change
*
* Sets the coalesce settings for a particular queue.
**/
static int __iavf_set_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec, int queue)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
struct iavf_vsi *vsi = &adapter->vsi;
int i;
if (ec-><API key> || ec-><API key>)
vsi->work_limit = ec-><API key>;
if (ec->rx_coalesce_usecs == 0) {
if (ec-><API key>)
netif_info(adapter, drv, netdev, "rx-usecs=0, need to disable adaptive-rx for a complete disable\n");
} else if ((ec->rx_coalesce_usecs < IAVF_MIN_ITR) ||
(ec->rx_coalesce_usecs > IAVF_MAX_ITR)) {
netif_info(adapter, drv, netdev, "Invalid value, rx-usecs range is 0-8160\n");
return -EINVAL;
} else if (ec->tx_coalesce_usecs == 0) {
if (ec-><API key>)
netif_info(adapter, drv, netdev, "tx-usecs=0, need to disable adaptive-tx for a complete disable\n");
} else if ((ec->tx_coalesce_usecs < IAVF_MIN_ITR) ||
(ec->tx_coalesce_usecs > IAVF_MAX_ITR)) {
netif_info(adapter, drv, netdev, "Invalid value, tx-usecs range is 0-8160\n");
return -EINVAL;
}
/* Rx and Tx usecs has per queue value. If user doesn't specify the
* queue, apply to all queues.
*/
if (queue < 0) {
for (i = 0; i < adapter->num_active_queues; i++)
<API key>(adapter, ec, i);
} else if (queue < adapter->num_active_queues) {
<API key>(adapter, ec, queue);
} else {
netif_info(adapter, drv, netdev, "Invalid queue value, queue range is 0 - %d\n",
adapter->num_active_queues - 1);
return -EINVAL;
}
return 0;
}
/**
* iavf_set_coalesce - Set interrupt coalescing settings
* @netdev: network interface device structure
* @ec: ethtool coalesce structure
*
* Change current coalescing settings for every queue.
**/
static int iavf_set_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec)
{
return __iavf_set_coalesce(netdev, ec, -1);
}
/**
* <API key> - set specific queue's coalesce settings
* @netdev: the netdev to change
* @ec: ethtool's coalesce settings
* @queue: the queue to modify
*
* Modifies a specific queue's coalesce settings.
*/
static int <API key>(struct net_device *netdev, u32 queue,
struct ethtool_coalesce *ec)
{
return __iavf_set_coalesce(netdev, ec, queue);
}
/**
* iavf_get_rxnfc - command to get RX flow classification rules
* @netdev: network interface device structure
* @cmd: ethtool rxnfc command
* @rule_locs: pointer to store rule locations
*
* Returns Success if the command is supported.
**/
static int iavf_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
u32 *rule_locs)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
int ret = -EOPNOTSUPP;
switch (cmd->cmd) {
case ETHTOOL_GRXRINGS:
cmd->data = adapter->num_active_queues;
ret = 0;
break;
case ETHTOOL_GRXFH:
netdev_info(netdev,
"RSS hash info is not available to vf, use pf.\n");
break;
default:
break;
}
return ret;
}
/**
* iavf_get_channels: get the number of channels supported by the device
* @netdev: network interface device structure
* @ch: channel information structure
*
* For the purposes of our device, we only use combined channels, i.e. a tx/rx
* queue pair. Report one extra channel to match our "other" MSI-X vector.
**/
static void iavf_get_channels(struct net_device *netdev,
struct ethtool_channels *ch)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
/* Report maximum channels */
ch->max_combined = adapter->vsi_res->num_queue_pairs;
ch->max_other = NONQ_VECS;
ch->other_count = NONQ_VECS;
ch->combined_count = adapter->num_active_queues;
}
/**
* iavf_set_channels: set the new channel count
* @netdev: network interface device structure
* @ch: channel information structure
*
* Negotiate a new number of channels with the PF then do a reset. During
* reset we'll realloc queues and fix the RSS table. Returns 0 on success,
* negative on failure.
**/
static int iavf_set_channels(struct net_device *netdev,
struct ethtool_channels *ch)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
u32 num_req = ch->combined_count;
if ((adapter->vf_res->vf_cap_flags & <API key>) &&
adapter->num_tc) {
dev_info(&adapter->pdev->dev, "Cannot set channels since ADq is enabled.\n");
return -EINVAL;
}
/* All of these should have already been checked by ethtool before this
* even gets to us, but just to be sure.
*/
if (num_req > adapter->vsi_res->num_queue_pairs)
return -EINVAL;
if (num_req == adapter->num_active_queues)
return 0;
if (ch->rx_count || ch->tx_count || ch->other_count != NONQ_VECS)
return -EINVAL;
adapter->num_req_queues = num_req;
adapter->flags |= <API key>;
iavf_schedule_reset(adapter);
return 0;
}
/**
* <API key> - get the RSS hash key size
* @netdev: network interface device structure
*
* Returns the table size.
**/
static u32 <API key>(struct net_device *netdev)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
return adapter->rss_key_size;
}
/**
* <API key> - get the rx flow hash indirection table size
* @netdev: network interface device structure
*
* Returns the table size.
**/
static u32 <API key>(struct net_device *netdev)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
return adapter->rss_lut_size;
}
/**
* iavf_get_rxfh - get the rx flow hash indirection table
* @netdev: network interface device structure
* @indir: indirection table
* @key: hash key
* @hfunc: hash function in use
*
* Reads the indirection table directly from the hardware. Always returns 0.
**/
static int iavf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
u8 *hfunc)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
u16 i;
if (hfunc)
*hfunc = ETH_RSS_HASH_TOP;
if (!indir)
return 0;
memcpy(key, adapter->rss_key, adapter->rss_key_size);
/* Each 32 bits pointed by 'indir' is stored with a lut entry */
for (i = 0; i < adapter->rss_lut_size; i++)
indir[i] = (u32)adapter->rss_lut[i];
return 0;
}
/**
* iavf_set_rxfh - set the rx flow hash indirection table
* @netdev: network interface device structure
* @indir: indirection table
* @key: hash key
* @hfunc: hash function to use
*
* Returns -EINVAL if the table specifies an inavlid queue id, otherwise
* returns 0 after programming the table.
**/
static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir,
const u8 *key, const u8 hfunc)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
u16 i;
/* We do not allow change in unsupported parameters */
if (key ||
(hfunc != <API key> && hfunc != ETH_RSS_HASH_TOP))
return -EOPNOTSUPP;
if (!indir)
return 0;
if (key)
memcpy(adapter->rss_key, key, adapter->rss_key_size);
/* Each 32 bits pointed by 'indir' is stored with a lut entry */
for (i = 0; i < adapter->rss_lut_size; i++)
adapter->rss_lut[i] = (u8)(indir[i]);
return iavf_config_rss(adapter);
}
static const struct ethtool_ops iavf_ethtool_ops = {
.<API key> = <API key> |
<API key> |
<API key> |
<API key>,
.get_drvinfo = iavf_get_drvinfo,
.get_link = ethtool_op_get_link,
.get_ringparam = iavf_get_ringparam,
.set_ringparam = iavf_set_ringparam,
.get_strings = iavf_get_strings,
.get_ethtool_stats = <API key>,
.get_sset_count = iavf_get_sset_count,
.get_priv_flags = iavf_get_priv_flags,
.set_priv_flags = iavf_set_priv_flags,
.get_msglevel = iavf_get_msglevel,
.set_msglevel = iavf_set_msglevel,
.get_coalesce = iavf_get_coalesce,
.set_coalesce = iavf_set_coalesce,
.<API key> = <API key>,
.<API key> = <API key>,
.get_rxnfc = iavf_get_rxnfc,
.get_rxfh_indir_size = <API key>,
.get_rxfh = iavf_get_rxfh,
.set_rxfh = iavf_set_rxfh,
.get_channels = iavf_get_channels,
.set_channels = iavf_set_channels,
.get_rxfh_key_size = <API key>,
.get_link_ksettings = <API key>,
};
/**
* <API key> - Initialize ethtool ops struct
* @netdev: network interface device structure
*
* Sets ethtool ops struct in our netdev so that ethtool can call
* our functions.
**/
void <API key>(struct net_device *netdev)
{
netdev->ethtool_ops = &iavf_ethtool_ops;
}
|
public class Foo {
public void foo(boolean a, int x,
int y, int z) {
label1:
do {
try {
if (x > 0) {
int someVariable = a ?
x :
y;
}
else if (x < 0) {
int someVariable = (y +
z
);
someVariable = x =
x +
y;
}
else {
label2:
for (int i = 0;
i < 5;
i++)
doSomething(i);
}
switch (a) {
case 0:
doCase0();
break;
default:
doDefault();
}
}
catch (Exception e) {
processException(e.getMessage(),
x + y, z, a);
}
finally {
processFinally();
}
}
while (true);
if (2 < 3) return;
if (3 < 4)
return;
do x++ while (x < 10000);
while (x < 50000) x++;
for (int i = 0; i < 5; i++) System.out.println(i);
}
private class InnerClass implements I1,
I2 {
public void bar() throws E1,
E2 {
}
}
}
|
# are permitted provided that the following conditions are met:
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of Distance nor the names of its contributors may be used
# to endorse or promote products derived from this software without
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# 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.
__all__ = ['A', 'Area', 'D', 'Distance']
from decimal import Decimal
from functools import total_ordering
from django.utils import six
NUMERIC_TYPES = six.integer_types + (float, Decimal)
AREA_PREFIX = "sq_"
def pretty_name(obj):
return obj.__name__ if obj.__class__ == type else obj.__class__.__name__
@total_ordering
class MeasureBase(object):
STANDARD_UNIT = None
ALIAS = {}
UNITS = {}
LALIAS = {}
def __init__(self, default_unit=None, **kwargs):
value, self._default_unit = self.default_units(kwargs)
setattr(self, self.STANDARD_UNIT, value)
if default_unit and isinstance(default_unit, six.string_types):
self._default_unit = default_unit
def _get_standard(self):
return getattr(self, self.STANDARD_UNIT)
def _set_standard(self, value):
setattr(self, self.STANDARD_UNIT, value)
standard = property(_get_standard, _set_standard)
def __getattr__(self, name):
if name in self.UNITS:
return self.standard / self.UNITS[name]
else:
raise AttributeError('Unknown unit type: %s' % name)
def __repr__(self):
return '%s(%s=%s)' % (pretty_name(self), self._default_unit,
getattr(self, self._default_unit))
def __str__(self):
return '%s %s' % (getattr(self, self._default_unit), self._default_unit)
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.standard == other.standard
else:
return NotImplemented
def __lt__(self, other):
if isinstance(other, self.__class__):
return self.standard < other.standard
else:
return NotImplemented
def __add__(self, other):
if isinstance(other, self.__class__):
return self.__class__(default_unit=self._default_unit,
**{self.STANDARD_UNIT: (self.standard + other.standard)})
else:
raise TypeError('%(class)s must be added with %(class)s' % {"class": pretty_name(self)})
def __iadd__(self, other):
if isinstance(other, self.__class__):
self.standard += other.standard
return self
else:
raise TypeError('%(class)s must be added with %(class)s' % {"class": pretty_name(self)})
def __sub__(self, other):
if isinstance(other, self.__class__):
return self.__class__(default_unit=self._default_unit,
**{self.STANDARD_UNIT: (self.standard - other.standard)})
else:
raise TypeError('%(class)s must be subtracted from %(class)s' % {"class": pretty_name(self)})
def __isub__(self, other):
if isinstance(other, self.__class__):
self.standard -= other.standard
return self
else:
raise TypeError('%(class)s must be subtracted from %(class)s' % {"class": pretty_name(self)})
def __mul__(self, other):
if isinstance(other, NUMERIC_TYPES):
return self.__class__(default_unit=self._default_unit,
**{self.STANDARD_UNIT: (self.standard * other)})
else:
raise TypeError('%(class)s must be multiplied with number' % {"class": pretty_name(self)})
def __imul__(self, other):
if isinstance(other, NUMERIC_TYPES):
self.standard *= float(other)
return self
else:
raise TypeError('%(class)s must be multiplied with number' % {"class": pretty_name(self)})
def __rmul__(self, other):
return self * other
def __truediv__(self, other):
if isinstance(other, self.__class__):
return self.standard / other.standard
if isinstance(other, NUMERIC_TYPES):
return self.__class__(default_unit=self._default_unit,
**{self.STANDARD_UNIT: (self.standard / other)})
else:
raise TypeError('%(class)s must be divided with number or %(class)s' % {"class": pretty_name(self)})
def __div__(self, other): # Python 2 compatibility
return type(self).__truediv__(self, other)
def __itruediv__(self, other):
if isinstance(other, NUMERIC_TYPES):
self.standard /= float(other)
return self
else:
raise TypeError('%(class)s must be divided with number' % {"class": pretty_name(self)})
def __idiv__(self, other): # Python 2 compatibility
return type(self).__itruediv__(self, other)
def __bool__(self):
return bool(self.standard)
def __nonzero__(self): # Python 2 compatibility
return type(self).__bool__(self)
def default_units(self, kwargs):
"""
Return the unit value and the default units specified
from the given keyword arguments dictionary.
"""
val = 0.0
default_unit = self.STANDARD_UNIT
for unit, value in six.iteritems(kwargs):
if not isinstance(value, float):
value = float(value)
if unit in self.UNITS:
val += self.UNITS[unit] * value
default_unit = unit
elif unit in self.ALIAS:
u = self.ALIAS[unit]
val += self.UNITS[u] * value
default_unit = u
else:
lower = unit.lower()
if lower in self.UNITS:
val += self.UNITS[lower] * value
default_unit = lower
elif lower in self.LALIAS:
u = self.LALIAS[lower]
val += self.UNITS[u] * value
default_unit = u
else:
raise AttributeError('Unknown unit type: %s' % unit)
return val, default_unit
@classmethod
def unit_attname(cls, unit_str):
"""
Retrieves the unit attribute name for the given unit string.
For example, if the given unit string is 'metre', 'm' would be returned.
An exception is raised if an attribute cannot be found.
"""
lower = unit_str.lower()
if unit_str in cls.UNITS:
return unit_str
elif lower in cls.UNITS:
return lower
elif lower in cls.LALIAS:
return cls.LALIAS[lower]
else:
raise Exception('Could not find a unit keyword associated with "%s"' % unit_str)
class Distance(MeasureBase):
STANDARD_UNIT = "m"
UNITS = {
'chain': 20.1168,
'chain_benoit': 20.116782,
'chain_sears': 20.1167645,
'<API key>': 20.1167824944,
'british_chain_sears': 20.1167651216,
'<API key>': 20.116756,
'cm': 0.01,
'british_ft': 0.304799471539,
'british_yd': 0.914398414616,
'clarke_ft': 0.3047972654,
'clarke_link': 0.201166195164,
'fathom': 1.8288,
'ft': 0.3048,
'german_m': 1.0000135965,
'gold_coast_ft': 0.304799710181508,
'indian_yd': 0.914398530744,
'inch': 0.0254,
'km': 1000.0,
'link': 0.201168,
'link_benoit': 0.20116782,
'link_sears': 0.20116765,
'm': 1.0,
'mi': 1609.344,
'mm': 0.001,
'nm': 1852.0,
'nm_uk': 1853.184,
'rod': 5.0292,
'sears_yd': 0.91439841,
'survey_ft': 0.304800609601,
'um': 0.000001,
'yd': 0.9144,
}
# Unit aliases for `UNIT` terms encountered in Spatial Reference WKT.
ALIAS = {
'centimeter': 'cm',
'foot': 'ft',
'inches': 'inch',
'kilometer': 'km',
'kilometre': 'km',
'meter': 'm',
'metre': 'm',
'micrometer': 'um',
'micrometre': 'um',
'millimeter': 'mm',
'millimetre': 'mm',
'mile': 'mi',
'yard': 'yd',
'British chain (Benoit 1895 B)': '<API key>',
'British chain (Sears 1922)': 'british_chain_sears',
'British chain (Sears 1922 truncated)': '<API key>',
'British foot (Sears 1922)': 'british_ft',
'British foot': 'british_ft',
'British yard (Sears 1922)': 'british_yd',
'British yard': 'british_yd',
"Clarke's Foot": 'clarke_ft',
"Clarke's link": 'clarke_link',
'Chain (Benoit)': 'chain_benoit',
'Chain (Sears)': 'chain_sears',
'Foot (International)': 'ft',
'German legal metre': 'german_m',
'Gold Coast foot': 'gold_coast_ft',
'Indian yard': 'indian_yd',
'Link (Benoit)': 'link_benoit',
'Link (Sears)': 'link_sears',
'Nautical Mile': 'nm',
'Nautical Mile (UK)': 'nm_uk',
'US survey foot': 'survey_ft',
'U.S. Foot': 'survey_ft',
'Yard (Indian)': 'indian_yd',
'Yard (Sears)': 'sears_yd'
}
LALIAS = {k.lower(): v for k, v in ALIAS.items()}
def __mul__(self, other):
if isinstance(other, self.__class__):
return Area(default_unit=AREA_PREFIX + self._default_unit,
**{AREA_PREFIX + self.STANDARD_UNIT: (self.standard * other.standard)})
elif isinstance(other, NUMERIC_TYPES):
return self.__class__(default_unit=self._default_unit,
**{self.STANDARD_UNIT: (self.standard * other)})
else:
raise TypeError('%(distance)s must be multiplied with number or %(distance)s' % {
"distance": pretty_name(self.__class__),
})
class Area(MeasureBase):
STANDARD_UNIT = AREA_PREFIX + Distance.STANDARD_UNIT
# Getting the square units values and the alias dictionary.
UNITS = {'%s%s' % (AREA_PREFIX, k): v ** 2 for k, v in Distance.UNITS.items()}
ALIAS = {k: '%s%s' % (AREA_PREFIX, v) for k, v in Distance.ALIAS.items()}
LALIAS = {k.lower(): v for k, v in ALIAS.items()}
def __truediv__(self, other):
if isinstance(other, NUMERIC_TYPES):
return self.__class__(default_unit=self._default_unit,
**{self.STANDARD_UNIT: (self.standard / other)})
else:
raise TypeError('%(class)s must be divided by a number' % {"class": pretty_name(self)})
def __div__(self, other): # Python 2 compatibility
return type(self).__truediv__(self, other)
# Shortcuts
D = Distance
A = Area
|
<?php
/**
* @file
* Template file for Radix modal.
*/
?>
<!-- Button trigger modal -->
<?php print render($trigger_button); ?>
<!-- Modal -->
<div class="modal fade" id="<?php print $modal_id; ?>" tabindex="-1" role="dialog" aria-labelledby="<?php print $modal_id; ?>" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<?php if ($header): ?>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">
<?php print $header; ?>
</h4>
</div>
<?php endif; ?>
<?php if ($content): ?>
<div class="modal-body">
<?php print render($content); ?>
</div>
<?php endif; ?>
<?php if (count($buttons)): ?>
<div class="modal-footer">
<?php foreach ($buttons as $button): ?>
<?php print $button; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
|
/* <API key>: GPL-2.0 */
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <elf.h>
#include "elfconfig.h"
/* On BSD-alike OSes elf.h defines these according to host's word size */
#undef ELF_ST_BIND
#undef ELF_ST_TYPE
#undef ELF_R_SYM
#undef ELF_R_TYPE
#if KERNEL_ELFCLASS == ELFCLASS32
#define Elf_Ehdr Elf32_Ehdr
#define Elf_Shdr Elf32_Shdr
#define Elf_Sym Elf32_Sym
#define Elf_Addr Elf32_Addr
#define Elf_Sword Elf64_Sword
#define Elf_Section Elf32_Half
#define ELF_ST_BIND ELF32_ST_BIND
#define ELF_ST_TYPE ELF32_ST_TYPE
#define Elf_Rel Elf32_Rel
#define Elf_Rela Elf32_Rela
#define ELF_R_SYM ELF32_R_SYM
#define ELF_R_TYPE ELF32_R_TYPE
#else
#define Elf_Ehdr Elf64_Ehdr
#define Elf_Shdr Elf64_Shdr
#define Elf_Sym Elf64_Sym
#define Elf_Addr Elf64_Addr
#define Elf_Sword Elf64_Sxword
#define Elf_Section Elf64_Half
#define ELF_ST_BIND ELF64_ST_BIND
#define ELF_ST_TYPE ELF64_ST_TYPE
#define Elf_Rel Elf64_Rel
#define Elf_Rela Elf64_Rela
#define ELF_R_SYM ELF64_R_SYM
#define ELF_R_TYPE ELF64_R_TYPE
#endif
/* The 64-bit MIPS ELF ABI uses an unusual reloc format. */
typedef struct
{
Elf32_Word r_sym; /* Symbol index */
unsigned char r_ssym; /* Special symbol for 2nd relocation */
unsigned char r_type3; /* 3rd relocation type */
unsigned char r_type2; /* 2nd relocation type */
unsigned char r_type1; /* 1st relocation type */
} _Elf64_Mips_R_Info;
typedef union
{
Elf64_Xword r_info_number;
_Elf64_Mips_R_Info r_info_fields;
} <API key>;
#define ELF64_MIPS_R_SYM(i) \
((__extension__ (<API key>)(i)).r_info_fields.r_sym)
#define ELF64_MIPS_R_TYPE(i) \
((__extension__ (<API key>)(i)).r_info_fields.r_type1)
#if KERNEL_ELFDATA != HOST_ELFDATA
static inline void __endian(const void *src, void *dest, unsigned int size)
{
unsigned int i;
for (i = 0; i < size; i++)
((unsigned char*)dest)[i] = ((unsigned char*)src)[size - i-1];
}
#define TO_NATIVE(x) \
({ \
typeof(x) __x; \
__endian(&(x), &(__x), sizeof(__x)); \
__x; \
})
#else /* endianness matches */
#define TO_NATIVE(x) (x)
#endif
#define NOFAIL(ptr) do_nofail((ptr), #ptr)
void *do_nofail(void *ptr, const char *expr);
struct buffer {
char *p;
int pos;
int size;
};
void __attribute__((format(printf, 2, 3)))
buf_printf(struct buffer *buf, const char *fmt, ...);
void
buf_write(struct buffer *buf, const char *s, int len);
struct namespace_list {
struct namespace_list *next;
char namespace[];
};
struct module {
struct module *next;
int gpl_compatible;
struct symbol *unres;
int from_dump; /* 1 if module was loaded from *.symvers */
int is_vmlinux;
int seen;
int has_init;
int has_cleanup;
struct buffer dev_table_buf;
char srcversion[25];
// Missing namespace dependencies
struct namespace_list *missing_namespaces;
// Actual imported namespaces
struct namespace_list *imported_namespaces;
char name[];
};
struct elf_info {
size_t size;
Elf_Ehdr *hdr;
Elf_Shdr *sechdrs;
Elf_Sym *symtab_start;
Elf_Sym *symtab_stop;
Elf_Section export_sec;
Elf_Section export_unused_sec;
Elf_Section export_gpl_sec;
Elf_Section <API key>;
Elf_Section <API key>;
char *strtab;
char *modinfo;
unsigned int modinfo_len;
/* support for 32bit section numbers */
unsigned int num_sections; /* max_secindex + 1 */
unsigned int secindex_strings;
/* if Nth symbol table entry has .st_shndx = SHN_XINDEX,
* take shndx from symtab_shndx_start[N] instead */
Elf32_Word *symtab_shndx_start;
Elf32_Word *symtab_shndx_stop;
};
static inline int is_shndx_special(unsigned int i)
{
return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE;
}
/*
* Move reserved section indices SHN_LORESERVE..SHN_HIRESERVE out of
* the way to -256..-1, to avoid conflicting with real section
* indices.
*/
#define SPECIAL(i) ((i) - (SHN_HIRESERVE + 1))
/* Accessor for sym->st_shndx, hides ugliness of "64k sections" */
static inline unsigned int get_secindex(const struct elf_info *info,
const Elf_Sym *sym)
{
if (is_shndx_special(sym->st_shndx))
return SPECIAL(sym->st_shndx);
if (sym->st_shndx != SHN_XINDEX)
return sym->st_shndx;
return info->symtab_shndx_start[sym - info->symtab_start];
}
/* file2alias.c */
extern unsigned int cross_build;
void handle_moddevtable(struct module *mod, struct elf_info *info,
Elf_Sym *sym, const char *symname);
void add_moddevtable(struct buffer *buf, struct module *mod);
/* sumversion.c */
void get_src_version(const char *modname, char sum[], unsigned sumlen);
/* from modpost.c */
char *read_text_file(const char *filename);
char *get_line(char **stringp);
enum loglevel {
LOG_WARN,
LOG_ERROR,
LOG_FATAL
};
void modpost_log(enum loglevel loglevel, const char *fmt, ...);
#define warn(fmt, args...) modpost_log(LOG_WARN, fmt, ##args)
#define merror(fmt, args...) modpost_log(LOG_ERROR, fmt, ##args)
#define fatal(fmt, args...) modpost_log(LOG_FATAL, fmt, ##args)
|
'use strict';
var $ = require('jquery');
require('./github-node-cfg.js');
var AddonHelper = require('js/addonHelper');
$(window.contextVars.<API key>).on('submit', AddonHelper.onSubmitSettings);
|
#include <linux/gpio.h>
#include "msm_fb.h"
#include "mipi_dsi.h"
#include "mipi_lgit.h"
#include "mdp4.h"
static struct <API key> *mipi_lgit_pdata;
static struct dsi_buf lgit_tx_buf;
static struct dsi_buf lgit_rx_buf;
static int skip_init;
#define DSV_ONBST 57
static int <API key>(uint8_t on_off)
{
int ret =0;
static int init_done=0;
if (!init_done) {
ret = gpio_request(DSV_ONBST,"DSV_ONBST_en");
if (ret) {
pr_err("%s: failed to request DSV_ONBST gpio \n", __func__);
goto out;
}
ret = <API key>(DSV_ONBST, 1);
if (ret) {
pr_err("%s: failed to set DSV_ONBST direction\n", __func__);
goto err_gpio;
}
init_done = 1;
}
gpio_set_value(DSV_ONBST, on_off);
mdelay(20);
goto out;
err_gpio:
gpio_free(DSV_ONBST);
out:
return ret;
}
static int mipi_lgit_lcd_on(struct platform_device *pdev)
{
struct msm_fb_data_type *mfd;
int ret = 0;
pr_info("%s started\n", __func__);
mfd = <API key>(pdev);
if (!mfd)
return -ENODEV;
if (mfd->key != MFD_KEY)
return -EINVAL;
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000);
ret = mipi_dsi_cmds_tx(&lgit_tx_buf,
mipi_lgit_pdata->power_on_set_1,
mipi_lgit_pdata->power_on_set_size_1);
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000);
if (ret < 0) {
pr_err("%s: failed to transmit power_on_set_1 cmds\n", __func__);
return ret;
}
if(!skip_init){
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000);
ret = mipi_dsi_cmds_tx(&lgit_tx_buf,
mipi_lgit_pdata->power_on_set_2,
mipi_lgit_pdata->power_on_set_size_2);
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000);
if (ret < 0) {
pr_err("%s: failed to transmit power_on_set_2 cmds\n", __func__);
return ret;
}
}
skip_init = false;
ret = <API key>(1);
if (ret < 0) {
pr_err("%s: failed to turn on external dsv\n", __func__);
return ret;
}
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000);
ret = mipi_dsi_cmds_tx(&lgit_tx_buf,
mipi_lgit_pdata->power_on_set_3,
mipi_lgit_pdata->power_on_set_size_3);
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000);
if (ret < 0) {
pr_err("%s: failed to transmit power_on_set_3 cmds\n", __func__);
return ret;
}
pr_info("%s finished\n", __func__);
return 0;
}
static int mipi_lgit_lcd_off(struct platform_device *pdev)
{
struct msm_fb_data_type *mfd;
int ret = 0;
pr_info("%s started\n", __func__);
if (mipi_lgit_pdata->bl_pwm_disable)
mipi_lgit_pdata->bl_pwm_disable();
mfd = <API key>(pdev);
if (!mfd)
return -ENODEV;
if (mfd->key != MFD_KEY)
return -EINVAL;
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000);
ret = mipi_dsi_cmds_tx(&lgit_tx_buf,
mipi_lgit_pdata->power_off_set_1,
mipi_lgit_pdata-><API key>);
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000);
if (ret < 0) {
pr_err("%s: failed to transmit power_off_set_1 cmds\n", __func__);
return ret;
}
ret = <API key>(0);
if (ret < 0) {
pr_err("%s: failed to turn off external dsv\n", __func__);
return ret;
}
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000);
ret = mipi_dsi_cmds_tx(&lgit_tx_buf,
mipi_lgit_pdata->power_off_set_2,
mipi_lgit_pdata-><API key>);
MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000);
if (ret < 0) {
pr_err("%s: failed to transmit power_off_set_2 cmds\n", __func__);
return ret;
}
pr_info("%s finished\n", __func__);
return 0;
}
static int <API key>(void)
{
return (mipi_lgit_pdata->bl_on_status());
}
static void <API key>(struct msm_fb_data_type *mfd)
{
int level;
level = (int)mfd->bl_level;
mipi_lgit_pdata->backlight_level(level, 0, 0);
}
static int mipi_lgit_lcd_probe(struct platform_device *pdev)
{
if (pdev->id == 0) {
mipi_lgit_pdata = pdev->dev.platform_data;
return 0;
}
pr_info("%s start\n", __func__);
skip_init = true;
msm_fb_add_device(pdev);
return 0;
}
static struct platform_driver this_driver = {
.probe = mipi_lgit_lcd_probe,
.driver = {
.name = "mipi_lgit",
},
};
static struct msm_fb_panel_data lgit_panel_data = {
.on = mipi_lgit_lcd_on,
.off = mipi_lgit_lcd_off,
.set_backlight = <API key>,
.<API key> = <API key>,
};
static int ch_used[3];
int <API key>(struct msm_panel_info *pinfo,
u32 channel, u32 panel)
{
struct platform_device *pdev = NULL;
int ret;
if ((channel >= 3) || ch_used[channel])
return -ENODEV;
ch_used[channel] = TRUE;
pdev = <API key>("mipi_lgit", (panel << 8)|channel);
if (!pdev)
return -ENOMEM;
lgit_panel_data.panel_info = *pinfo;
ret = <API key>(pdev, &lgit_panel_data,
sizeof(lgit_panel_data));
if (ret) {
pr_err("%s: <API key> failed!\n", __func__);
goto err_device_put;
}
ret = platform_device_add(pdev);
if (ret) {
pr_err("%s: <API key> failed!\n", __func__);
goto err_device_put;
}
return 0;
err_device_put:
platform_device_put(pdev);
return ret;
}
static int __init mipi_lgit_lcd_init(void)
{
mipi_dsi_buf_alloc(&lgit_tx_buf, DSI_BUF_SIZE);
mipi_dsi_buf_alloc(&lgit_rx_buf, DSI_BUF_SIZE);
return <API key>(&this_driver);
}
module_init(mipi_lgit_lcd_init);
|
#include "ash/wm/event_client_impl.h"
#include "ash/session/<API key>.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ui/aura/window.h"
#include "ui/keyboard/keyboard_util.h"
namespace ash {
EventClientImpl::EventClientImpl() {
}
EventClientImpl::~EventClientImpl() {
}
bool EventClientImpl::<API key>(
const aura::Window* window) const {
const aura::Window* root_window = window ? window->GetRootWindow() : NULL;
if (!root_window ||
!Shell::GetInstance()-><API key>()-><API key>()) {
return true;
}
const aura::Window* <API key> = Shell::GetContainer(
root_window,
<API key>);
const aura::Window* <API key> = Shell::GetContainer(
root_window,
<API key>);
const aura::Window* <API key> = Shell::GetContainer(
root_window,
<API key>);
bool can_process_events = (window->Contains(<API key>) &&
window->Contains(<API key>) &&
window->Contains(<API key>)) ||
<API key>->Contains(window) ||
<API key>->Contains(window) ||
<API key>->Contains(window);
if (keyboard::IsKeyboardEnabled()) {
const aura::Window* <API key> = Shell::GetContainer(
root_window,
<API key>);
can_process_events |= (window->Contains(<API key>) ||
<API key>->Contains(window));
}
return can_process_events;
}
ui::EventTarget* EventClientImpl::<API key>() {
return Shell::GetInstance();
}
} // namespace ash
|
public enum A {
;
A(String s){}
}
|
class A {
public void f() {
Inner i = new Inner();
i.doStuff();
}
private class <caret>Inner {
public void doStuff() {
}
}
}
|
class MyException extends RuntimeException{}
class MyClass {
public void foo() throws MyException {
throw new MyException();<caret>
}
}
|
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
// UMD (Universal Module Definition)
(function (root, factory) {
'use strict';
/* global define, exports, module */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
}
}(this, function () {
// Shortcut to an often accessed properties, in order to avoid multiple
// dereference that costs universally. This also holds a reference to known-good
// functions.
var $Array = Array;
var ArrayPrototype = $Array.prototype;
var $Object = Object;
var ObjectPrototype = $Object.prototype;
var FunctionPrototype = Function.prototype;
var $String = String;
var StringPrototype = $String.prototype;
var $Number = Number;
var NumberPrototype = $Number.prototype;
var array_slice = ArrayPrototype.slice;
var array_splice = ArrayPrototype.splice;
var array_push = ArrayPrototype.push;
var array_unshift = ArrayPrototype.unshift;
var array_concat = ArrayPrototype.concat;
var call = FunctionPrototype.call;
var max = Math.max;
var min = Math.min;
// Having a toString local variable name breaks in Opera so use to_string.
var to_string = ObjectPrototype.toString;
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var isCallable; var fnToStr = Function.prototype.toString, tryFunctionObject = function tryFunctionObject(value) { try { fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]'; isCallable = function isCallable(value) { if (typeof value !== 'function') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; };
var isRegex; var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec(value) { try { regexExec.call(value); return true; } catch (e) { return false; } }, regexClass = '[object RegExp]'; isRegex = function isRegex(value) { if (typeof value !== 'object') { return false; } return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass; };
var isString; var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; };
var defineProperties = (function (has) {
var supportsDescriptors = $Object.defineProperty && (function () {
try {
var obj = {};
$Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
for (var _ in obj) { return false; }
return obj.x === obj;
} catch (e) { /* this is ES3 */
return false;
}
}());
// Define configurable, writable and non-enumerable props
// if they don't exist.
var defineProperty;
if (supportsDescriptors) {
defineProperty = function (object, name, method, forceAssign) {
if (!forceAssign && (name in object)) { return; }
$Object.defineProperty(object, name, {
configurable: true,
enumerable: false,
writable: true,
value: method
});
};
} else {
defineProperty = function (object, name, method, forceAssign) {
if (!forceAssign && (name in object)) { return; }
object[name] = method;
};
}
return function defineProperties(object, map, forceAssign) {
for (var name in map) {
if (has.call(map, name)) {
defineProperty(object, name, map[name], forceAssign);
}
}
};
}(ObjectPrototype.hasOwnProperty));
// Util
var isPrimitive = function isPrimitive(input) {
var type = typeof input;
return input === null || (type !== 'object' && type !== 'function');
};
var isActualNaN = $Number.isNaN || function (x) { return x !== x; };
var ES = {
// ES5 9.4
// http://es5.github.com/#x9.4
ToInteger: function ToInteger(num) {
var n = +num;
if (isActualNaN(n)) {
n = 0;
} else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
}
return n;
},
ToPrimitive: function ToPrimitive(input) {
var val, valueOf, toStr;
if (isPrimitive(input)) {
return input;
}
valueOf = input.valueOf;
if (isCallable(valueOf)) {
val = valueOf.call(input);
if (isPrimitive(val)) {
return val;
}
}
toStr = input.toString;
if (isCallable(toStr)) {
val = toStr.call(input);
if (isPrimitive(val)) {
return val;
}
}
throw new TypeError();
},
// ES5 9.9
// http://es5.github.com/#x9.9
ToObject: function (o) {
/* jshint eqnull: true */
if (o == null) { // this matches both null and undefined
throw new TypeError("can't convert " + o + ' to object');
}
return $Object(o);
},
ToUint32: function ToUint32(x) {
return x >>> 0;
}
};
// Function
// ES-5 15.3.4.5
// http://es5.github.com/#x15.3.4.5
var Empty = function Empty() {};
defineProperties(FunctionPrototype, {
bind: function bind(that) { // .length is 1
// 1. Let Target be the this value.
var target = this;
// 2. If IsCallable(Target) is false, throw a TypeError exception.
if (!isCallable(target)) {
throw new TypeError('Function.prototype.bind called on incompatible ' + target);
}
// 3. Let A be a new (possibly empty) internal list of all of the
// argument values provided after thisArg (arg1, arg2 etc), in order.
// XXX slicedArgs will stand in for "A" if used
var args = array_slice.call(arguments, 1); // for normal call
// 4. Let F be a new native ECMAScript object.
// 11. Set the [[Prototype]] internal property of F to the standard
// built-in Function prototype object as specified in 15.3.3.1.
// 12. Set the [[Call]] internal property of F as described in
// 15.3.4.5.1.
// 13. Set the [[Construct]] internal property of F as described in
// 15.3.4.5.2.
// 14. Set the [[HasInstance]] internal property of F as described in
// 15.3.4.5.3.
var bound;
var binder = function () {
if (this instanceof bound) {
// 15.3.4.5.2 [[Construct]]
// When the [[Construct]] internal method of a function object,
// F that was created using the bind function is called with a
// list of arguments ExtraArgs, the following steps are taken:
// 1. Let target be the value of F's [[TargetFunction]]
// internal property.
// 2. If target has no [[Construct]] internal method, a
// TypeError exception is thrown.
// 3. Let boundArgs be the value of F's [[BoundArgs]] internal
// property.
// 4. Let args be a new list containing the same values as the
// list boundArgs in the same order followed by the same
// values as the list ExtraArgs in the same order.
// 5. Return the result of calling the [[Construct]] internal
// method of target providing args as the arguments.
var result = target.apply(
this,
array_concat.call(args, array_slice.call(arguments))
);
if ($Object(result) === result) {
return result;
}
return this;
} else {
// 15.3.4.5.1 [[Call]]
// When the [[Call]] internal method of a function object, F,
// which was created using the bind function is called with a
// this value and a list of arguments ExtraArgs, the following
// steps are taken:
// 1. Let boundArgs be the value of F's [[BoundArgs]] internal
// property.
// 2. Let boundThis be the value of F's [[BoundThis]] internal
// property.
// 3. Let target be the value of F's [[TargetFunction]] internal
// property.
// 4. Let args be a new list containing the same values as the
// list boundArgs in the same order followed by the same
// values as the list ExtraArgs in the same order.
// 5. Return the result of calling the [[Call]] internal method
// of target providing boundThis as the this value and
// providing args as the arguments.
// equiv: target.call(this, ...boundArgs, ...args)
return target.apply(
that,
array_concat.call(args, array_slice.call(arguments))
);
}
};
// 15. If the [[Class]] internal property of Target is "Function", then
// a. Let L be the length property of Target minus the length of A.
// b. Set the length own property of F to either 0 or L, whichever is
// larger.
// 16. Else set the length own property of F to 0.
var boundLength = max(0, target.length - args.length);
// 17. Set the attributes of the length own property of F to the values
// specified in 15.3.5.1.
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
array_push.call(boundArgs, '$' + i);
}
// XXX Build a dynamic function with desired amount of arguments is the only
// way to set the length property of a function.
// In environments where Content Security Policies enabled (Chrome extensions,
// for ex.) all use of eval or Function costructor throws an exception.
// However in all of these environments Function.prototype.bind exists
// and so this code will never be executed.
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this, arguments); }')(binder);
if (target.prototype) {
Empty.prototype = target.prototype;
bound.prototype = new Empty();
// Clean up dangling references.
Empty.prototype = null;
}
// TODO
// 18. Set the [[Extensible]] internal property of F to true.
// TODO
// 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
// 20. Call the [[DefineOwnProperty]] internal method of F with
// arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
// thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
// false.
// 21. Call the [[DefineOwnProperty]] internal method of F with
// arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
// [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
// and false.
// TODO
// NOTE Function objects created using Function.prototype.bind do not
// have a prototype property or the [[Code]], [[FormalParameters]], and
// [[Scope]] internal properties.
// XXX can't delete prototype in pure-js.
// 22. Return F.
return bound;
}
});
// _Please note: Shortcuts are defined after `Function.prototype.bind` as we
// us it in defining shortcuts.
var owns = call.bind(ObjectPrototype.hasOwnProperty);
var toStr = call.bind(ObjectPrototype.toString);
var strSlice = call.bind(StringPrototype.slice);
var strSplit = call.bind(StringPrototype.split);
var strIndexOf = call.bind(StringPrototype.indexOf);
// Array
var isArray = $Array.isArray || function isArray(obj) {
return toStr(obj) === '[object Array]';
};
// ES5 15.4.4.12
// http://es5.github.com/#x15.4.4.13
// Return len+argCount.
// [bugfix, ielt8]
var <API key> = [].unshift(0) !== 1;
defineProperties(ArrayPrototype, {
unshift: function () {
array_unshift.apply(this, arguments);
return this.length;
}
}, <API key>);
// ES5 15.4.3.2
// http://es5.github.com/#x15.4.3.2
defineProperties($Array, { isArray: isArray });
// The IsCallable() check in the Array functions
// has been replaced with a strict check on the
// internal class of the object to trap cases where
// the provided function was actually a regular
// expression literal, which in V8 and
// JavaScriptCore is a typeof "function". Only in
// V8 are regular expression literals permitted as
// reduce parameters, so it is desirable in the
// general case for the shim to match the more
// strict and common behavior of rejecting regular
// expressions.
// ES5 15.4.4.18
// http://es5.github.com/#x15.4.4.18
// Check failure of by-index access of string characters (IE < 9)
// and failure of `0 in boxedString` (Rhino)
var boxedString = $Object('a');
var splitString = boxedString[0] !== 'a' || !(0 in boxedString);
var <API key> = function properlyBoxed(method) {
// Check node 0.6.21 bug where third parameter is not boxed
var <API key> = true;
var properlyBoxesStrict = true;
if (method) {
method.call('foo', function (_, __, context) {
if (typeof context !== 'object') { <API key> = false; }
});
method.call([1], function () {
'use strict';
properlyBoxesStrict = typeof this === 'string';
}, 'x');
}
return !!method && <API key> && properlyBoxesStrict;
};
defineProperties(ArrayPrototype, {
forEach: function forEach(callbackfn /*, thisArg*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var i = -1;
var length = ES.ToUint32(self.length);
var T;
if (arguments.length > 1) {
T = arguments[1];
}
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.forEach callback must be a function');
}
while (++i < length) {
if (i in self) {
// Invoke the callback function with call, passing arguments:
// context, property value, property key, thisArg object
if (typeof T === 'undefined') {
callbackfn(self[i], i, object);
} else {
callbackfn.call(T, self[i], i, object);
}
}
}
}
}, !<API key>(ArrayPrototype.forEach));
// ES5 15.4.4.19
// http://es5.github.com/#x15.4.4.19
defineProperties(ArrayPrototype, {
map: function map(callbackfn/*, thisArg*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
var result = $Array(length);
var T;
if (arguments.length > 1) {
T = arguments[1];
}
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.map callback must be a function');
}
for (var i = 0; i < length; i++) {
if (i in self) {
if (typeof T === 'undefined') {
result[i] = callbackfn(self[i], i, object);
} else {
result[i] = callbackfn.call(T, self[i], i, object);
}
}
}
return result;
}
}, !<API key>(ArrayPrototype.map));
// ES5 15.4.4.20
// http://es5.github.com/#x15.4.4.20
defineProperties(ArrayPrototype, {
filter: function filter(callbackfn /*, thisArg*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
var result = [];
var value;
var T;
if (arguments.length > 1) {
T = arguments[1];
}
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.filter callback must be a function');
}
for (var i = 0; i < length; i++) {
if (i in self) {
value = self[i];
if (typeof T === 'undefined' ? callbackfn(value, i, object) : callbackfn.call(T, value, i, object)) {
array_push.call(result, value);
}
}
}
return result;
}
}, !<API key>(ArrayPrototype.filter));
// ES5 15.4.4.16
// http://es5.github.com/#x15.4.4.16
defineProperties(ArrayPrototype, {
every: function every(callbackfn /*, thisArg*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
var T;
if (arguments.length > 1) {
T = arguments[1];
}
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.every callback must be a function');
}
for (var i = 0; i < length; i++) {
if (i in self && !(typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
return false;
}
}
return true;
}
}, !<API key>(ArrayPrototype.every));
// ES5 15.4.4.17
// http://es5.github.com/#x15.4.4.17
defineProperties(ArrayPrototype, {
some: function some(callbackfn/*, thisArg */) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
var T;
if (arguments.length > 1) {
T = arguments[1];
}
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.some callback must be a function');
}
for (var i = 0; i < length; i++) {
if (i in self && (typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
return true;
}
}
return false;
}
}, !<API key>(ArrayPrototype.some));
// ES5 15.4.4.21
// http://es5.github.com/#x15.4.4.21
var <API key> = false;
if (ArrayPrototype.reduce) {
<API key> = typeof ArrayPrototype.reduce.call('es5', function (_, __, ___, list) { return list; }) === 'object';
}
defineProperties(ArrayPrototype, {
reduce: function reduce(callbackfn /*, initialValue*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.reduce callback must be a function');
}
// no value to return if no initial value and an empty array
if (length === 0 && arguments.length === 1) {
throw new TypeError('reduce of empty array with no initial value');
}
var i = 0;
var result;
if (arguments.length >= 2) {
result = arguments[1];
} else {
do {
if (i in self) {
result = self[i++];
break;
}
// if array contains no values, no initial value to return
if (++i >= length) {
throw new TypeError('reduce of empty array with no initial value');
}
} while (true);
}
for (; i < length; i++) {
if (i in self) {
result = callbackfn(result, self[i], i, object);
}
}
return result;
}
}, !<API key>);
// ES5 15.4.4.22
// http://es5.github.com/#x15.4.4.22
var <API key> = false;
if (ArrayPrototype.reduceRight) {
<API key> = typeof ArrayPrototype.reduceRight.call('es5', function (_, __, ___, list) { return list; }) === 'object';
}
defineProperties(ArrayPrototype, {
reduceRight: function reduceRight(callbackfn/*, initial*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.reduceRight callback must be a function');
}
// no value to return if no initial value, empty array
if (length === 0 && arguments.length === 1) {
throw new TypeError('reduceRight of empty array with no initial value');
}
var result;
var i = length - 1;
if (arguments.length >= 2) {
result = arguments[1];
} else {
do {
if (i in self) {
result = self[i
break;
}
// if array contains no values, no initial value to return
if (--i < 0) {
throw new TypeError('reduceRight of empty array with no initial value');
}
} while (true);
}
if (i < 0) {
return result;
}
do {
if (i in self) {
result = callbackfn(result, self[i], i, object);
}
} while (i
return result;
}
}, !<API key>);
// ES5 15.4.4.14
// http://es5.github.com/#x15.4.4.14
var <API key> = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
defineProperties(ArrayPrototype, {
indexOf: function indexOf(searchElement /*, fromIndex */) {
var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this);
var length = ES.ToUint32(self.length);
if (length === 0) {
return -1;
}
var i = 0;
if (arguments.length > 1) {
i = ES.ToInteger(arguments[1]);
}
// handle negative indices
i = i >= 0 ? i : max(0, length + i);
for (; i < length; i++) {
if (i in self && self[i] === searchElement) {
return i;
}
}
return -1;
}
}, <API key>);
// ES5 15.4.4.15
// http://es5.github.com/#x15.4.4.15
var <API key> = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1;
defineProperties(ArrayPrototype, {
lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */) {
var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this);
var length = ES.ToUint32(self.length);
if (length === 0) {
return -1;
}
var i = length - 1;
if (arguments.length > 1) {
i = min(i, ES.ToInteger(arguments[1]));
}
// handle negative indices
i = i >= 0 ? i : length - Math.abs(i);
for (; i >= 0; i
if (i in self && searchElement === self[i]) {
return i;
}
}
return -1;
}
}, <API key>);
// ES5 15.4.4.12
// http://es5.github.com/#x15.4.4.12
var <API key> = (function () {
var a = [1, 2];
var result = a.splice();
return a.length === 2 && isArray(result) && result.length === 0;
}());
defineProperties(ArrayPrototype, {
// Safari 5.0 bug where .splice() returns undefined
splice: function splice(start, deleteCount) {
if (arguments.length === 0) {
return [];
} else {
return array_splice.apply(this, arguments);
}
}
}, !<API key>);
var <API key> = (function () {
var obj = {};
ArrayPrototype.splice.call(obj, 0, 0, 1);
return obj.length === 1;
}());
defineProperties(ArrayPrototype, {
splice: function splice(start, deleteCount) {
if (arguments.length === 0) { return []; }
var args = arguments;
this.length = max(ES.ToInteger(this.length), 0);
if (arguments.length > 0 && typeof deleteCount !== 'number') {
args = array_slice.call(arguments);
if (args.length < 2) {
array_push.call(args, this.length - start);
} else {
args[1] = ES.ToInteger(deleteCount);
}
}
return array_splice.apply(this, args);
}
}, !<API key>);
var <API key> = (function () {
// Safari 7/8 breaks with sparse arrays of size 1e5 or greater
var arr = new $Array(1e5);
// note: the index MUST be 8 or larger or the test will false pass
arr[8] = 'x';
arr.splice(1, 1);
// note: this test must be defined *after* the indexOf shim
return arr.indexOf('x') === 7;
}());
var <API key> = (function () {
// Opera 12.15 breaks on this, no idea why.
var n = 256;
var arr = [];
arr[n] = 'a';
arr.splice(n + 1, 0, 'b');
return arr[n] === 'a';
}());
defineProperties(ArrayPrototype, {
splice: function splice(start, deleteCount) {
var O = ES.ToObject(this);
var A = [];
var len = ES.ToUint32(O.length);
var relativeStart = ES.ToInteger(start);
var actualStart = relativeStart < 0 ? max((len + relativeStart), 0) : min(relativeStart, len);
var actualDeleteCount = min(max(ES.ToInteger(deleteCount), 0), len - actualStart);
var k = 0;
var from;
while (k < actualDeleteCount) {
from = $String(actualStart + k);
if (owns(O, from)) {
A[k] = O[from];
}
k += 1;
}
var items = array_slice.call(arguments, 2);
var itemCount = items.length;
var to;
if (itemCount < actualDeleteCount) {
k = actualStart;
while (k < (len - actualDeleteCount)) {
from = $String(k + actualDeleteCount);
to = $String(k + itemCount);
if (owns(O, from)) {
O[to] = O[from];
} else {
delete O[to];
}
k += 1;
}
k = len;
while (k > (len - actualDeleteCount + itemCount)) {
delete O[k - 1];
k -= 1;
}
} else if (itemCount > actualDeleteCount) {
k = len - actualDeleteCount;
while (k > actualStart) {
from = $String(k + actualDeleteCount - 1);
to = $String(k + itemCount - 1);
if (owns(O, from)) {
O[to] = O[from];
} else {
delete O[to];
}
k -= 1;
}
}
k = actualStart;
for (var i = 0; i < items.length; ++i) {
O[k] = items[i];
k += 1;
}
O.length = len - actualDeleteCount + itemCount;
return A;
}
}, !<API key> || !<API key>);
// Object
// ES5 15.2.3.14
// http://es5.github.com/#x15.2.3.14
var hasDontEnumBug = !({ 'toString': null }).<API key>('toString');
var hasProtoEnumBug = function () {}.<API key>('prototype');
var hasStringEnumBug = !owns('x', '0');
var <API key> = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
var blacklistedKeys = {
$window: true,
$console: true,
$parent: true,
$self: true,
$frame: true,
$frames: true,
$frameElement: true,
$webkitIndexedDB: true,
$webkitStorageInfo: true
};
var <API key> = (function () {
/* globals window */
if (typeof window === 'undefined') { return false; }
for (var k in window) {
try {
if (!blacklistedKeys['$' + k] && owns(window, k) && window[k] !== null && typeof window[k] === 'object') {
<API key>(window[k]);
}
} catch (e) {
return true;
}
}
return false;
}());
var <API key> = function (object) {
if (typeof window === 'undefined' || !<API key>) { return <API key>(object); }
try {
return <API key>(object);
} catch (e) {
return false;
}
};
var dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'<API key>',
'constructor'
];
var dontEnumsLength = dontEnums.length;
// can be replaced with require('is-arguments') if we ever use a build process instead
var isStandardArguments = function isArguments(value) {
return toStr(value) === '[object Arguments]';
};
var isLegacyArguments = function isArguments(value) {
return value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
!isArray(value) &&
isCallable(value.callee);
};
var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments;
defineProperties($Object, {
keys: function keys(object) {
var isFn = isCallable(object);
var isArgs = isArguments(object);
var isObject = object !== null && typeof object === 'object';
var isStr = isObject && isString(object);
if (!isObject && !isFn && !isArgs) {
throw new TypeError('Object.keys called on a non-object');
}
var theKeys = [];
var skipProto = hasProtoEnumBug && isFn;
if ((isStr && hasStringEnumBug) || isArgs) {
for (var i = 0; i < object.length; ++i) {
array_push.call(theKeys, $String(i));
}
}
if (!isArgs) {
for (var name in object) {
if (!(skipProto && name === 'prototype') && owns(object, name)) {
array_push.call(theKeys, $String(name));
}
}
}
if (hasDontEnumBug) {
var skipConstructor = <API key>(object);
for (var j = 0; j < dontEnumsLength; j++) {
var dontEnum = dontEnums[j];
if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) {
array_push.call(theKeys, dontEnum);
}
}
}
return theKeys;
}
});
var <API key> = $Object.keys && (function () {
// Safari 5.0 bug
return $Object.keys(arguments).length === 2;
}(1, 2));
var <API key> = $Object.keys && (function () {
var argKeys = $Object.keys(arguments);
return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1;
}(1));
var originalKeys = $Object.keys;
defineProperties($Object, {
keys: function keys(object) {
if (isArguments(object)) {
return originalKeys(array_slice.call(object));
} else {
return originalKeys(object);
}
}
}, !<API key> || <API key>);
// Date
// ES5 15.9.5.43
// http://es5.github.com/#x15.9.5.43
// This function returns a String value represent the instance in time
// represented by this Date object. The format of the String is the Date Time
// string format defined in 15.9.1.15. All fields are present in the String.
// The time zone is always UTC, denoted by the suffix Z. If the time value of
// this object is not a finite Number a RangeError exception is thrown.
var negativeDate = -62198755200000;
var negativeYearString = '-000001';
var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1;
var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z';
defineProperties(Date.prototype, {
toISOString: function toISOString() {
var result, length, value, year, month;
if (!isFinite(this)) {
throw new RangeError('Date.prototype.toISOString called on non-finite value.');
}
year = this.getUTCFullYear();
month = this.getUTCMonth();
year += Math.floor(month / 12);
month = (month % 12 + 12) % 12;
// the date time string format is specified in 15.9.1.15.
result = [month + 1, this.getUTCDate(), this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
year = (
(year < 0 ? '-' : (year > 9999 ? '+' : '')) +
strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6)
);
length = result.length;
while (length
value = result[length];
// pad months, days, hours, minutes, and seconds to have two
// digits.
if (value < 10) {
result[length] = '0' + value;
}
}
// pad milliseconds to have three digits.
return (
year + '-' + array_slice.call(result, 0, 2).join('-') +
'T' + array_slice.call(result, 2).join(':') + '.' +
strSlice('000' + this.getUTCMilliseconds(), -3) + 'Z'
);
}
}, hasNegativeDateBug || hasSafari51DateBug);
// ES5 15.9.5.44
// http://es5.github.com/#x15.9.5.44
// This function provides a String representation of a Date object for use by
// JSON.stringify (15.12.3).
var <API key> = (function () {
try {
return Date.prototype.toJSON &&
new Date(NaN).toJSON() === null &&
new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 &&
Date.prototype.toJSON.call({ // generic
toISOString: function () { return true; }
});
} catch (e) {
return false;
}
}());
if (!<API key>) {
Date.prototype.toJSON = function toJSON(key) {
// When the toJSON method is called with argument key, the following
// steps are taken:
// 1. Let O be the result of calling ToObject, giving it the this
// value as its argument.
// 2. Let tv be ES.ToPrimitive(O, hint Number).
var O = $Object(this);
var tv = ES.ToPrimitive(O);
// 3. If tv is a Number and is not finite, return null.
if (typeof tv === 'number' && !isFinite(tv)) {
return null;
}
// 4. Let toISO be the result of calling the [[Get]] internal method of
// O with argument "toISOString".
var toISO = O.toISOString;
// 5. If IsCallable(toISO) is false, throw a TypeError exception.
if (!isCallable(toISO)) {
throw new TypeError('toISOString property is not callable');
}
// 6. Return the result of calling the [[Call]] internal method of
// toISO with O as the this value and an empty argument list.
return toISO.call(O);
// NOTE 1 The argument is ignored.
// NOTE 2 The toJSON function is intentionally generic; it does not
// require that its this value be a Date object. Therefore, it can be
// transferred to other kinds of objects for use as a method. However,
// it does require that any such object have a toISOString method. An
// object is free to use the argument key to filter its
// stringification.
};
}
// ES5 15.9.4.2
// http://es5.github.com/#x15.9.4.2
// based on work shared by Daniel Friesen (dantman)
var <API key> = Date.parse('+033658-09-27T01:46:40.000Z') === 1e15;
var acceptsInvalidDates = !isNaN(Date.parse('2012-04-04T24:00:00.500Z')) || !isNaN(Date.parse('2012-11-31T23:59:59.000Z')) || !isNaN(Date.parse('2012-12-31T23:59:60.000Z'));
var <API key> = isNaN(Date.parse('2000-01-01T00:00:00.000Z'));
if (<API key> || acceptsInvalidDates || !<API key>) {
// XXX global assignment won't work in embeddings that use
// an alternate object for the context.
/* eslint-disable no-undef */
var <API key> = Math.pow(2, 31) - 1;
var <API key> = Math.floor(<API key> / 1e3);
var <API key> = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, <API key> + 1).getTime());
Date = (function (NativeDate) {
/* eslint-enable no-undef */
var DateShim = function Date(Y, M, D, h, m, s, ms) {
var length = arguments.length;
var date;
if (this instanceof NativeDate) {
var seconds = s;
var millis = ms;
if (<API key> && length >= 7 && ms > <API key>) {
// work around a Safari 8/9 bug where it treats the seconds as signed
var msToShift = Math.floor(ms / <API key>) * <API key>;
var sToShift = Math.floor(msToShift / 1e3);
seconds += sToShift;
millis -= sToShift * 1e3;
}
date = length === 1 && $String(Y) === Y ? // isString(Y)
// We explicitly pass it through parse:
new NativeDate(DateShim.parse(Y)) :
// We have to manually make calls depending on argument
// length here
length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis) :
length >= 6 ? new NativeDate(Y, M, D, h, m, seconds) :
length >= 5 ? new NativeDate(Y, M, D, h, m) :
length >= 4 ? new NativeDate(Y, M, D, h) :
length >= 3 ? new NativeDate(Y, M, D) :
length >= 2 ? new NativeDate(Y, M) :
length >= 1 ? new NativeDate(Y) :
new NativeDate();
} else {
date = NativeDate.apply(this, arguments);
}
if (!isPrimitive(date)) {
// Prevent mixups with unfixed Date object
defineProperties(date, { constructor: DateShim }, true);
}
return date;
};
// 15.9.1.15 Date Time String Format.
var isoDateExpression = new RegExp('^' +
'(\\d{4}|[+-]\\d{6})' + // four-digit year capture or sign +
// 6-digit extended year
'(?:-(\\d{2})' + // optional month capture
'(?:-(\\d{2})' + // optional day capture
'(?:' + // capture hours:minutes:seconds.milliseconds
'T(\\d{2})' + // hours capture
':(\\d{2})' + // minutes capture
'(?:' + // optional :seconds.milliseconds
':(\\d{2})' + // seconds capture
'(?:(\\.\\d{1,}))?' + // milliseconds capture
')?' +
'(' + // capture UTC offset component
'Z|' + // UTC capture
'(?:' + // offset specifier +/-hours:minutes
'([-+])' + // sign capture
'(\\d{2})' + // hours offset capture
':(\\d{2})' + // minutes offset capture
')' +
')?)?)?)?' +
'$');
var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
var dayFromMonth = function dayFromMonth(year, month) {
var t = month > 1 ? 1 : 0;
return (
months[month] +
Math.floor((year - 1969 + t) / 4) -
Math.floor((year - 1901 + t) / 100) +
Math.floor((year - 1601 + t) / 400) +
365 * (year - 1970)
);
};
var toUTC = function toUTC(t) {
var s = 0;
var ms = t;
if (<API key> && ms > <API key>) {
// work around a Safari 8/9 bug where it treats the seconds as signed
var msToShift = Math.floor(ms / <API key>) * <API key>;
var sToShift = Math.floor(msToShift / 1e3);
s += sToShift;
ms -= sToShift * 1e3;
}
return $Number(new NativeDate(1970, 0, 1, 0, 0, s, ms));
};
// Copy any custom methods a 3rd party library may have added
for (var key in NativeDate) {
if (owns(NativeDate, key)) {
DateShim[key] = NativeDate[key];
}
}
// Copy "native" methods explicitly; they may be non-enumerable
defineProperties(DateShim, {
now: NativeDate.now,
UTC: NativeDate.UTC
}, true);
DateShim.prototype = NativeDate.prototype;
defineProperties(DateShim.prototype, {
constructor: DateShim
}, true);
// Upgrade Date.parse to handle simplified ISO 8601 strings
var parseShim = function parse(string) {
var match = isoDateExpression.exec(string);
if (match) {
// parse months, days, hours, minutes, seconds, and milliseconds
// provide default values if necessary
// parse the UTC offset component
var year = $Number(match[1]),
month = $Number(match[2] || 1) - 1,
day = $Number(match[3] || 1) - 1,
hour = $Number(match[4] || 0),
minute = $Number(match[5] || 0),
second = $Number(match[6] || 0),
millisecond = Math.floor($Number(match[7] || 0) * 1000),
// When time zone is missed, local offset should be used
// (ES 5.1 bug)
isLocalTime = Boolean(match[4] && !match[8]),
signOffset = match[9] === '-' ? 1 : -1,
hourOffset = $Number(match[10] || 0),
minuteOffset = $Number(match[11] || 0),
result;
var <API key> = minute > 0 || second > 0 || millisecond > 0;
if (
hour < (<API key> ? 24 : 25) &&
minute < 60 && second < 60 && millisecond < 1000 &&
month > -1 && month < 12 && hourOffset < 24 &&
minuteOffset < 60 && // detect invalid offsets
day > -1 &&
day < (dayFromMonth(year, month + 1) - dayFromMonth(year, month))
) {
result = (
(dayFromMonth(year, month) + day) * 24 +
hour +
hourOffset * signOffset
) * 60;
result = (
(result + minute + minuteOffset * signOffset) * 60 +
second
) * 1000 + millisecond;
if (isLocalTime) {
result = toUTC(result);
}
if (-8.64e15 <= result && result <= 8.64e15) {
return result;
}
}
return NaN;
}
return NativeDate.parse.apply(this, arguments);
};
defineProperties(DateShim, { parse: parseShim });
return DateShim;
}(Date));
}
// ES5 15.9.4.4
// http://es5.github.com/#x15.9.4.4
if (!Date.now) {
Date.now = function now() {
return new Date().getTime();
};
}
// Number
// ES5.1 15.7.4.5
// http://es5.github.com/#x15.7.4.5
var hasToFixedBugs = NumberPrototype.toFixed && (
(0.00008).toFixed(3) !== '0.000' ||
(0.9).toFixed(0) !== '1' ||
(1.255).toFixed(2) !== '1.25' ||
(1000000000000000128).toFixed(0) !== '1000000000000000128'
);
var toFixedHelpers = {
base: 1e7,
size: 6,
data: [0, 0, 0, 0, 0, 0],
multiply: function multiply(n, c) {
var i = -1;
var c2 = c;
while (++i < toFixedHelpers.size) {
c2 += n * toFixedHelpers.data[i];
toFixedHelpers.data[i] = c2 % toFixedHelpers.base;
c2 = Math.floor(c2 / toFixedHelpers.base);
}
},
divide: function divide(n) {
var i = toFixedHelpers.size, c = 0;
while (--i >= 0) {
c += toFixedHelpers.data[i];
toFixedHelpers.data[i] = Math.floor(c / n);
c = (c % n) * toFixedHelpers.base;
}
},
numToString: function numToString() {
var i = toFixedHelpers.size;
var s = '';
while (--i >= 0) {
if (s !== '' || i === 0 || toFixedHelpers.data[i] !== 0) {
var t = $String(toFixedHelpers.data[i]);
if (s === '') {
s = t;
} else {
s += strSlice('0000000', 0, 7 - t.length) + t;
}
}
}
return s;
},
pow: function pow(x, n, acc) {
return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc)));
},
log: function log(x) {
var n = 0;
var x2 = x;
while (x2 >= 4096) {
n += 12;
x2 /= 4096;
}
while (x2 >= 2) {
n += 1;
x2 /= 2;
}
return n;
}
};
defineProperties(NumberPrototype, {
toFixed: function toFixed(fractionDigits) {
var f, x, s, m, e, z, j, k;
// Test for NaN and round fractionDigits down
f = $Number(fractionDigits);
f = isActualNaN(f) ? 0 : Math.floor(f);
if (f < 0 || f > 20) {
throw new RangeError('Number.toFixed called with invalid number of decimals');
}
x = $Number(this);
if (isActualNaN(x)) {
return 'NaN';
}
// If it is too big or small, return the string value of the number
if (x <= -1e21 || x >= 1e21) {
return $String(x);
}
s = '';
if (x < 0) {
s = '-';
x = -x;
}
m = '0';
if (x > 1e-21) {
// 1e-21 < x < 1e21
// -70 < log2(x) < 70
e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69;
z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1));
z *= 0x10000000000000; // Math.pow(2, 52);
e = 52 - e;
// -18 < e < 122
// x = z / 2 ^ e
if (e > 0) {
toFixedHelpers.multiply(0, z);
j = f;
while (j >= 7) {
toFixedHelpers.multiply(1e7, 0);
j -= 7;
}
toFixedHelpers.multiply(toFixedHelpers.pow(10, j, 1), 0);
j = e - 1;
while (j >= 23) {
toFixedHelpers.divide(1 << 23);
j -= 23;
}
toFixedHelpers.divide(1 << j);
toFixedHelpers.multiply(1, 1);
toFixedHelpers.divide(2);
m = toFixedHelpers.numToString();
} else {
toFixedHelpers.multiply(0, z);
toFixedHelpers.multiply(1 << (-e), 0);
m = toFixedHelpers.numToString() + strSlice('0.<API key>', 2, 2 + f);
}
}
if (f > 0) {
k = m.length;
if (k <= f) {
m = s + strSlice('0.0000000000000000000', 0, f - k + 2) + m;
} else {
m = s + strSlice(m, 0, k - f) + '.' + strSlice(m, k - f);
}
} else {
m = s + m;
}
return m;
}
}, hasToFixedBugs);
// String
// ES5 15.5.4.14
// http://es5.github.com/#x15.5.4.14
// [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
// Many browsers do not split properly with regular expressions or they
// do not perform the split correctly under obscure conditions.
// I've tested in many browsers and this seems to cover the deviant ones:
// 'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
// '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
// 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not
// [undefined, "t", undefined, "e", ...]
// ''.split(/.?/) should be [], not [""]
// '.'.split(/()()/) should be ["."], not ["", "", "."]
if (
'ab'.split(/(?:ab)*/).length !== 2 ||
'.'.split(/(.?)(.?)/).length !== 4 ||
'tesst'.split(/(s)*/)[1] === 't' ||
'test'.split(/(?:)/, -1).length !== 4 ||
''.split(/.?/).length ||
'.'.split(/()()/).length > 1
) {
(function () {
var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group
var maxSafe32BitInt = Math.pow(2, 32) - 1;
StringPrototype.split = function (separator, limit) {
var string = this;
if (typeof separator === 'undefined' && limit === 0) {
return [];
}
// If `separator` is not a regex, use native split
if (!isRegex(separator)) {
return strSplit(this, separator, limit);
}
var output = [];
var flags = (separator.ignoreCase ? 'i' : '') +
(separator.multiline ? 'm' : '') +
(separator.unicode ? 'u' : '') + // in ES6
(separator.sticky ? 'y' : ''), // Firefox 3+ and ES6
lastLastIndex = 0,
// Make `global` and avoid `lastIndex` issues by working with a copy
separator2, match, lastIndex, lastLength;
var separatorCopy = new RegExp(separator.source, flags + 'g');
string += ''; // Type-convert
if (!compliantExecNpcg) {
// Doesn't need flags gy, but they don't hurt
separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
}
/* Values for `limit`, per the spec:
* If undefined: 4294967295 // maxSafe32BitInt
* If 0, Infinity, or NaN: 0
* If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
* If negative number: 4294967296 - Math.floor(Math.abs(limit))
* If other: Type-convert, then use the above rules
*/
var splitLimit = typeof limit === 'undefined' ? maxSafe32BitInt : ES.ToUint32(limit);
match = separatorCopy.exec(string);
while (match) {
// `separatorCopy.lastIndex` is not reliable cross-browser
lastIndex = match.index + match[0].length;
if (lastIndex > lastLastIndex) {
array_push.call(output, strSlice(string, lastLastIndex, match.index));
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1) {
/* eslint-disable no-loop-func */
match[0].replace(separator2, function () {
for (var i = 1; i < arguments.length - 2; i++) {
if (typeof arguments[i] === 'undefined') {
match[i] = void 0;
}
}
});
/* eslint-enable no-loop-func */
}
if (match.length > 1 && match.index < string.length) {
array_push.apply(output, array_slice.call(match, 1));
}
lastLength = match[0].length;
lastLastIndex = lastIndex;
if (output.length >= splitLimit) {
break;
}
}
if (separatorCopy.lastIndex === match.index) {
separatorCopy.lastIndex++; // Avoid an infinite loop
}
match = separatorCopy.exec(string);
}
if (lastLastIndex === string.length) {
if (lastLength || !separatorCopy.test('')) {
array_push.call(output, '');
}
} else {
array_push.call(output, strSlice(string, lastLastIndex));
}
return output.length > splitLimit ? strSlice(output, 0, splitLimit) : output;
};
}());
// [bugfix, chrome]
// If separator is undefined, then the result array contains just one String,
// which is the this value (converted to a String). If limit is not undefined,
// then the output array is truncated so that it contains no more than limit
// elements.
// "0".split(undefined, 0) -> []
} else if ('0'.split(void 0, 0).length) {
StringPrototype.split = function split(separator, limit) {
if (typeof separator === 'undefined' && limit === 0) { return []; }
return strSplit(this, separator, limit);
};
}
var str_replace = StringPrototype.replace;
var <API key> = (function () {
var groups = [];
'x'.replace(/x(.)?/g, function (match, group) {
array_push.call(groups, group);
});
return groups.length === 1 && typeof groups[0] === 'undefined';
}());
if (!<API key>) {
StringPrototype.replace = function replace(searchValue, replaceValue) {
var isFn = isCallable(replaceValue);
var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source);
if (!isFn || !hasCapturingGroups) {
return str_replace.call(this, searchValue, replaceValue);
} else {
var wrappedReplaceValue = function (match) {
var length = arguments.length;
var originalLastIndex = searchValue.lastIndex;
searchValue.lastIndex = 0;
var args = searchValue.exec(match) || [];
searchValue.lastIndex = originalLastIndex;
array_push.call(args, arguments[length - 2], arguments[length - 1]);
return replaceValue.apply(this, args);
};
return str_replace.call(this, searchValue, wrappedReplaceValue);
}
};
}
// ECMA-262, 3rd B.2.3
// Not an ECMAScript standard, although ECMAScript 3rd Edition has a
// non-normative section suggesting uniform semantics and it should be
// normalized across all browsers
// [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
var string_substr = StringPrototype.substr;
var <API key> = ''.substr && '0b'.substr(-1) !== 'b';
defineProperties(StringPrototype, {
substr: function substr(start, length) {
var normalizedStart = start;
if (start < 0) {
normalizedStart = max(this.length + start, 0);
}
return string_substr.call(this, normalizedStart, length);
}
}, <API key>);
// ES5 15.5.4.20
// whitespace from: http://es5.github.io/#x15.5.4.20
var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028' +
'\u2029\uFEFF';
var zeroWidth = '\u200b';
var wsRegexChars = '[' + ws + ']';
var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*');
var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$');
var <API key> = StringPrototype.trim && (ws.trim() || !zeroWidth.trim());
defineProperties(StringPrototype, {
trim: function trim() {
if (typeof this === 'undefined' || this === null) {
throw new TypeError("can't convert " + this + ' to object');
}
return $String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, '');
}
}, <API key>);
var hasLastIndexBug = String.prototype.lastIndexOf && 'abc'.lastIndexOf('', 2) !== -1;
defineProperties(StringPrototype, {
lastIndexOf: function lastIndexOf(searchString) {
if (typeof this === 'undefined' || this === null) {
throw new TypeError("can't convert " + this + ' to object');
}
var S = $String(this);
var searchStr = $String(searchString);
var numPos = arguments.length > 1 ? $Number(arguments[1]) : NaN;
var pos = isActualNaN(numPos) ? Infinity : ES.ToInteger(numPos);
var start = min(max(pos, 0), S.length);
var searchLen = searchStr.length;
var k = start + searchLen;
while (k > 0) {
k = max(0, k - searchLen);
var index = strIndexOf(strSlice(S, k, start + searchLen), searchStr);
if (index !== -1) {
return k + index;
}
}
return -1;
}
}, hasLastIndexBug);
// ES-5 15.1.2.2
if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) {
/* global parseInt: true */
parseInt = (function (origParseInt) {
var hexRegex = /^0[xX]/;
return function parseInt(str, radix) {
var string = $String(str).trim();
var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
return origParseInt(string, defaultedRadix);
};
}(parseInt));
}
}));
|
require(__dirname).test
( { xml : "<!-- stand alone comment -->"
, expect :
[ [ "comment", " stand alone comment " ] ]
, strict : true
, opt : {}
}
)
|
<?php
namespace Drupal\views_ui\Form\Ajax;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\ViewExecutable;
use Drupal\views\ViewEntityInterface;
use Drupal\views\Views;
/**
* Provides a form for adding an item in the Views UI.
*/
class AddHandler extends ViewsFormBase {
/**
* Constructs a new AddHandler object.
*/
public function __construct($type = NULL) {
$this->setType($type);
}
/**
* {@inheritdoc}
*/
public function getFormKey() {
return 'add-handler';
}
/**
* {@inheritdoc}
*/
public function getForm(ViewEntityInterface $view, $display_id, $js, $type = NULL) {
$this->setType($type);
return parent::getForm($view, $display_id, $js);
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return '<API key>';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$view = $form_state->get('view');
$display_id = $form_state->get('display_id');
$type = $form_state->get('type');
$form = array(
'options' => array(
'#theme_wrappers' => array('container'),
'#attributes' => array('class' => array('scroll'), '<API key>' => TRUE),
),
);
$executable = $view->getExecutable();
if (!$executable->setDisplay($display_id)) {
$form['markup'] = array('#markup' => $this->t('Invalid display id @display', array('@display' => $display_id)));
return $form;
}
$display = &$executable->displayHandlers->get($display_id);
$types = ViewExecutable::getHandlerTypes();
$ltitle = $types[$type]['ltitle'];
$section = $types[$type]['plural'];
if (!empty($types[$type]['type'])) {
$type = $types[$type]['type'];
}
$form['#title'] = $this->t('Add @type', array('@type' => $ltitle));
$form['#section'] = $display_id . 'add-handler';
// Add the display override dropdown.
<API key>($form, $form_state, $section);
// Figure out all the base tables allowed based upon what the relationships provide.
$base_tables = $executable->getBaseTables();
$options = Views::viewsDataHelper()->fetchFields(array_keys($base_tables), $type, $display->useGroupBy(), $form_state->get('type'));
if (!empty($options)) {
$form['override']['controls'] = array(
'#theme_wrappers' => array('container'),
'#id' => '<API key>',
'#attributes' => ['class' => ['form--inline', '<API key>']],
);
$form['override']['controls']['options_search'] = array(
'#type' => 'textfield',
'#title' => $this->t('Search'),
);
$groups = array('all' => $this->t('- All -'));
$form['override']['controls']['group'] = array(
'#type' => 'select',
'#title' => $this->t('Type'),
'#options' => array(),
);
$form['options']['name'] = array(
'#prefix' => '<div class="views-radio-box form-checkboxes <API key>">',
'#suffix' => '</div>',
'#type' => 'tableselect',
'#header' => array(
'title' => $this->t('Title'),
'group' => $this->t('Category'),
'help' => $this->t('Description'),
),
'#js_select' => FALSE,
);
$grouped_options = array();
foreach ($options as $key => $option) {
$group = preg_replace('/[^a-z0-9]/', '-', strtolower($option['group']));
$groups[$group] = $option['group'];
$grouped_options[$group][$key] = $option;
if (!empty($option['aliases']) && is_array($option['aliases'])) {
foreach ($option['aliases'] as $id => $alias) {
if (empty($alias['base']) || !empty($base_tables[$alias['base']])) {
$copy = $option;
$copy['group'] = $alias['group'];
$copy['title'] = $alias['title'];
if (isset($alias['help'])) {
$copy['help'] = $alias['help'];
}
$group = preg_replace('/[^a-z0-9]/', '-', strtolower($copy['group']));
$groups[$group] = $copy['group'];
$grouped_options[$group][$key . '$' . $id] = $copy;
}
}
}
}
foreach ($grouped_options as $group => $group_options) {
foreach ($group_options as $key => $option) {
$form['options']['name']['#options'][$key] = array(
'#attributes' => array(
'class' => array('filterable-option', $group),
),
'title' => array(
'data' => array(
'#title' => $option['title'],
'#plain_text' => $option['title'],
),
'class' => array('title'),
),
'group' => $option['group'],
'help' => array(
'data' => $option['help'],
'class' => array('description'),
),
);
}
}
$form['override']['controls']['group']['#options'] = $groups;
}
else {
$form['options']['markup'] = array(
'#markup' => '<div class="js-form-item form-item">' . $this->t('There are no @types available to add.', array('@types' => $ltitle)) . '</div>',
);
}
// Add a div to show the selected items
$form['selected'] = array(
'#type' => 'item',
'#markup' => '<span class="views-ui-view-title">' . $this->t('Selected:') . '</span> ' . '<div class="<API key>"></div>',
'#theme_wrappers' => array('form_element', 'views_ui_container'),
'#attributes' => array(
'class' => array('container-inline', '<API key>', 'views-offset-bottom'),
'<API key>' => 'bottom',
),
);
$view->getStandardButtons($form, $form_state, '<API key>', $this->t('Add and configure @types', array('@types' => $ltitle)));
// Remove the default submit function.
$form['actions']['submit']['#submit'] = array_filter($form['actions']['submit']['#submit'], function($var) {
return !(is_array($var) && isset($var[1]) && $var[1] == 'standardSubmit');
});
$form['actions']['submit']['#submit'][] = array($view, 'submitItemAdd');
return $form;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.